Repository: eternalai-org/eternal-ai Branch: master Commit: ee870c890893 Files: 2663 Total size: 70.1 MB Directory structure: gitextract_7dr28zc4/ ├── .gitignore ├── Dockerfile.backend ├── Dockerfile.de-infer ├── EternalAI.js/ │ ├── .gitignore │ ├── README.md │ ├── lerna.json │ ├── package.json │ └── packages/ │ ├── core/ │ │ ├── .github/ │ │ │ └── workflows/ │ │ │ ├── main.yml │ │ │ └── size.yml │ │ ├── .gitignore │ │ ├── LICENSE │ │ ├── README.md │ │ ├── build.tsconfig.json │ │ ├── package.json │ │ ├── rollup.config.js │ │ ├── src/ │ │ │ ├── index.ts │ │ │ ├── types.d.ts │ │ │ └── utils/ │ │ │ ├── index.ts │ │ │ └── injects/ │ │ │ ├── ethers.ts │ │ │ └── index.ts │ │ └── tsconfig.json │ ├── interact/ │ │ ├── .github/ │ │ │ └── workflows/ │ │ │ ├── main.yml │ │ │ └── size.yml │ │ ├── .gitignore │ │ ├── LICENSE │ │ ├── README.md │ │ ├── build.tsconfig.json │ │ ├── package.json │ │ ├── rollup.config.js │ │ ├── scripts/ │ │ │ └── main.ts │ │ ├── src/ │ │ │ ├── baseInteract.ts │ │ │ ├── constants.ts │ │ │ ├── global.d.ts │ │ │ ├── index.ts │ │ │ ├── inject.ts │ │ │ ├── interact.ts │ │ │ ├── interactWithExternalWallet.ts │ │ │ ├── methods/ │ │ │ │ ├── index.ts │ │ │ │ ├── infer/ │ │ │ │ │ ├── constants.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ └── types.ts │ │ │ │ └── types.ts │ │ │ ├── services/ │ │ │ │ └── light_house.ts │ │ │ ├── types.ts │ │ │ └── utils/ │ │ │ └── time.ts │ │ ├── test/ │ │ │ └── blah.test.ts │ │ └── tsconfig.json │ ├── langchain/ │ │ ├── .eslintrc.cjs │ │ ├── .gitignore │ │ ├── .prettierrc │ │ ├── .release-it.json │ │ ├── LICENSE │ │ ├── README.md │ │ ├── jest.config.cjs │ │ ├── jest.env.cjs │ │ ├── langchain.config.js │ │ ├── package.json │ │ ├── scripts/ │ │ │ └── jest-setup-after-env.js │ │ ├── src/ │ │ │ ├── chat_models.ts │ │ │ ├── index.ts │ │ │ ├── llms.ts │ │ │ ├── tests/ │ │ │ │ ├── chat_models.test.ts │ │ │ │ ├── integration.int.test.ts │ │ │ │ ├── llms.test.ts │ │ │ │ └── vectorstores.test.ts │ │ │ └── vectorstores.ts │ │ ├── tsconfig.cjs.json │ │ ├── tsconfig.json │ │ └── turbo.json │ └── ui/ │ ├── .gitignore │ ├── README.md │ ├── eslint.config.js │ ├── index.html │ ├── package.json │ ├── public/ │ │ └── bundle.iife.js │ ├── src/ │ │ ├── App.css │ │ ├── App.tsx │ │ ├── index.css │ │ ├── main.tsx │ │ ├── pages/ │ │ │ ├── home/ │ │ │ │ ├── Styles.css │ │ │ │ └── index.tsx │ │ │ ├── package-core/ │ │ │ │ ├── Styles.css │ │ │ │ └── index.tsx │ │ │ └── package-interact/ │ │ │ ├── Styles.css │ │ │ └── index.tsx │ │ └── vite-env.d.ts │ ├── tsconfig.app.json │ ├── tsconfig.json │ ├── tsconfig.node.json │ └── vite.config.ts ├── LICENSE ├── Makefile ├── README.md ├── agent-as-a-service/ │ ├── .eslint.config.js │ ├── .gitignore │ ├── .npmrc │ ├── .yarnrc.yml │ ├── README.md │ ├── agent-deep-researcher/ │ │ ├── Dockerfile │ │ ├── Pipfile │ │ └── src/ │ │ ├── deep_research.py │ │ └── main.py │ ├── agent-launchpad/ │ │ ├── .gitignore │ │ ├── README.md │ │ ├── contracts/ │ │ │ ├── base/ │ │ │ │ ├── BaseMulticall.sol │ │ │ │ ├── BaseUpgradeable.sol │ │ │ │ └── BlockContext.sol │ │ │ ├── core/ │ │ │ │ ├── NoDelegateCall.sol │ │ │ │ ├── UniswapV3Factory.sol │ │ │ │ ├── UniswapV3Pool.sol │ │ │ │ ├── UniswapV3PoolDeployer.sol │ │ │ │ ├── UniswapV3PoolProxy.sol │ │ │ │ ├── interfaces/ │ │ │ │ │ ├── IERC20Minimal.sol │ │ │ │ │ ├── IUniswapV3Factory.sol │ │ │ │ │ ├── IUniswapV3Pool.sol │ │ │ │ │ ├── IUniswapV3PoolDeployer.sol │ │ │ │ │ ├── callback/ │ │ │ │ │ │ ├── IUniswapV3FlashCallback.sol │ │ │ │ │ │ ├── IUniswapV3MintCallback.sol │ │ │ │ │ │ └── IUniswapV3SwapCallback.sol │ │ │ │ │ └── pool/ │ │ │ │ │ ├── IUniswapV3PoolActions.sol │ │ │ │ │ ├── IUniswapV3PoolDerivedState.sol │ │ │ │ │ ├── IUniswapV3PoolEvents.sol │ │ │ │ │ ├── IUniswapV3PoolImmutables.sol │ │ │ │ │ ├── IUniswapV3PoolOwnerActions.sol │ │ │ │ │ └── IUniswapV3PoolState.sol │ │ │ │ ├── libraries/ │ │ │ │ │ ├── BitMath.sol │ │ │ │ │ ├── FixedPoint128.sol │ │ │ │ │ ├── FixedPoint96.sol │ │ │ │ │ ├── FullMath.sol │ │ │ │ │ ├── LiquidityMath.sol │ │ │ │ │ ├── LowGasSafeMath.sol │ │ │ │ │ ├── Oracle.sol │ │ │ │ │ ├── Position.sol │ │ │ │ │ ├── SafeCast.sol │ │ │ │ │ ├── SqrtPriceMath.sol │ │ │ │ │ ├── SwapMath.sol │ │ │ │ │ ├── Tick.sol │ │ │ │ │ ├── TickBitmap.sol │ │ │ │ │ ├── TickMath.sol │ │ │ │ │ ├── TransferHelper.sol │ │ │ │ │ └── UnsafeMath.sol │ │ │ │ └── test/ │ │ │ │ └── TestUniswapV3Callee.sol │ │ │ ├── interfaces/ │ │ │ │ └── IWETH.sol │ │ │ ├── periphery/ │ │ │ │ ├── NonfungiblePositionManager.sol │ │ │ │ ├── NonfungibleTokenPositionDescriptor.sol │ │ │ │ ├── SwapRouter.sol │ │ │ │ ├── base/ │ │ │ │ │ ├── BlockTimestamp.sol │ │ │ │ │ ├── ERC721Permit.sol │ │ │ │ │ ├── LiquidityManagement.sol │ │ │ │ │ ├── Multicall.sol │ │ │ │ │ ├── PeripheryImmutableState.sol │ │ │ │ │ ├── PeripheryPayments.sol │ │ │ │ │ ├── PeripheryPaymentsWithFee.sol │ │ │ │ │ ├── PeripheryValidation.sol │ │ │ │ │ ├── PoolInitializer.sol │ │ │ │ │ └── SelfPermit.sol │ │ │ │ ├── interfaces/ │ │ │ │ │ ├── IERC20Metadata.sol │ │ │ │ │ ├── IERC721Permit.sol │ │ │ │ │ ├── IMulticall.sol │ │ │ │ │ ├── INonfungiblePositionManager.sol │ │ │ │ │ ├── INonfungibleTokenPositionDescriptor.sol │ │ │ │ │ ├── IPeripheryImmutableState.sol │ │ │ │ │ ├── IPeripheryPayments.sol │ │ │ │ │ ├── IPeripheryPaymentsWithFee.sol │ │ │ │ │ ├── IPoolInitializer.sol │ │ │ │ │ ├── IQuoter.sol │ │ │ │ │ ├── IQuoterV2.sol │ │ │ │ │ ├── ISelfPermit.sol │ │ │ │ │ ├── ISwapRouter.sol │ │ │ │ │ ├── ITickLens.sol │ │ │ │ │ ├── IV3Migrator.sol │ │ │ │ │ └── external/ │ │ │ │ │ ├── IERC1271.sol │ │ │ │ │ └── IERC20PermitAllowed.sol │ │ │ │ ├── lens/ │ │ │ │ │ ├── Quoter.sol │ │ │ │ │ ├── QuoterV2.sol │ │ │ │ │ ├── TickLens.sol │ │ │ │ │ └── UniswapInterfaceMulticall.sol │ │ │ │ └── libraries/ │ │ │ │ ├── AddressStringUtil.sol │ │ │ │ ├── BytesLib.sol │ │ │ │ ├── CallbackValidation.sol │ │ │ │ ├── ChainId.sol │ │ │ │ ├── HexStrings.sol │ │ │ │ ├── LiquidityAmounts.sol │ │ │ │ ├── NFTDescriptor.sol │ │ │ │ ├── NFTSVG.sol │ │ │ │ ├── OracleLibrary.sol │ │ │ │ ├── Path.sol │ │ │ │ ├── PoolAddress.sol │ │ │ │ ├── PoolTicksCounter.sol │ │ │ │ ├── PositionKey.sol │ │ │ │ ├── PositionValue.sol │ │ │ │ ├── SafeERC20Namer.sol │ │ │ │ ├── SqrtPriceMathPartial.sol │ │ │ │ ├── TokenRatioSortOrder.sol │ │ │ │ ├── TransferHelper.sol │ │ │ │ └── UniswapV3Broker.sol │ │ │ └── token/ │ │ │ └── AGENTToken.sol │ │ ├── deploy/ │ │ │ ├── apechain/ │ │ │ │ └── deployed.json │ │ │ ├── arbitrum/ │ │ │ │ └── deployed.json │ │ │ ├── base/ │ │ │ │ └── deployed.json │ │ │ ├── bittensor/ │ │ │ │ └── deployed.json │ │ │ ├── bsc/ │ │ │ │ └── deployed.json │ │ │ ├── helpers.ts │ │ │ ├── migrations.ts │ │ │ └── types.ts │ │ ├── hardhat.config.ts │ │ ├── package.json │ │ └── tsconfig.json │ ├── agent-orchestration/ │ │ ├── README.md │ │ ├── backend/ │ │ │ ├── .cursorignore │ │ │ ├── .gitignore │ │ │ ├── Dockerfile │ │ │ ├── Dockerfile.compose │ │ │ ├── apis/ │ │ │ │ ├── api_admin.go │ │ │ │ ├── api_agent.go │ │ │ │ ├── api_agent_assistant.go │ │ │ │ ├── api_agent_infer.go │ │ │ │ ├── api_agent_infra.go │ │ │ │ ├── api_agent_trade.go │ │ │ │ ├── api_external_wallet.go │ │ │ │ ├── api_infra_twitter_app.go │ │ │ │ ├── api_internal.go │ │ │ │ ├── api_key_subscription.go │ │ │ │ ├── api_knowledge.go │ │ │ │ ├── api_pump.go │ │ │ │ ├── api_robot.go │ │ │ │ ├── api_sample_twitter_app.go │ │ │ │ ├── api_store.go │ │ │ │ ├── api_store_trading_app.go │ │ │ │ ├── api_user.go │ │ │ │ ├── api_vibe.go │ │ │ │ ├── apis.go │ │ │ │ ├── middlewares.go │ │ │ │ └── routers.go │ │ │ ├── compose.yaml │ │ │ ├── configs/ │ │ │ │ ├── config.json.local │ │ │ │ ├── config.json.sample │ │ │ │ ├── configs.go │ │ │ │ └── mission_token.go │ │ │ ├── daos/ │ │ │ │ ├── agent_chain_fee.go │ │ │ │ ├── agent_dao.go │ │ │ │ ├── agent_eai_topup.go │ │ │ │ ├── agent_external_info.go │ │ │ │ ├── agent_info.go │ │ │ │ ├── agent_info_install.go │ │ │ │ ├── agent_info_knowledge_base.go │ │ │ │ ├── agent_library.go │ │ │ │ ├── agent_snapshot_mission.go │ │ │ │ ├── agent_snapshot_post.go │ │ │ │ ├── agent_snapshot_post_action.go │ │ │ │ ├── agent_store.go │ │ │ │ ├── agent_store_install.go │ │ │ │ ├── agent_store_mission.go │ │ │ │ ├── agent_store_try.go │ │ │ │ ├── agent_store_try_detail.go │ │ │ │ ├── agent_token_dao.go │ │ │ │ ├── agent_trade_token.go │ │ │ │ ├── agent_twitter_post.go │ │ │ │ ├── agent_wallet.go │ │ │ │ ├── agent_wallet_action.go │ │ │ │ ├── api_subscription_history.go │ │ │ │ ├── api_subscription_key.go │ │ │ │ ├── api_subscription_package.go │ │ │ │ ├── api_subscription_usage_log.go │ │ │ │ ├── batch_infer_history.go │ │ │ │ ├── block_scan_info.go │ │ │ │ ├── chain_config.go │ │ │ │ ├── daos.go │ │ │ │ ├── external_wallet.go │ │ │ │ ├── external_wallet_order.go │ │ │ │ ├── external_wallet_token.go │ │ │ │ ├── infra_twiiter_app.go │ │ │ │ ├── job_config.go │ │ │ │ ├── launchpad.go │ │ │ │ ├── launchpad_member.go │ │ │ │ ├── launchpad_transaction.go │ │ │ │ ├── meme_fees_collected.go │ │ │ │ ├── mission_store.go │ │ │ │ ├── mission_store_history.go │ │ │ │ ├── mission_store_rating.go │ │ │ │ ├── model_market.go │ │ │ │ ├── model_predict_history.go │ │ │ │ ├── robot_dao.go │ │ │ │ ├── sample_twiiter_app.go │ │ │ │ ├── store_trading_app.go │ │ │ │ ├── training_request.go │ │ │ │ ├── training_request_erc20_info.go │ │ │ │ ├── twitter_following.go │ │ │ │ ├── twitter_post.go │ │ │ │ ├── twitter_tweet.go │ │ │ │ ├── twitter_tweet_liked.go │ │ │ │ ├── twitter_user.go │ │ │ │ ├── user_dao.go │ │ │ │ ├── user_transaction.go │ │ │ │ ├── vibe.go │ │ │ │ └── zk_sync_network.go │ │ │ ├── databases/ │ │ │ │ └── database.go │ │ │ ├── errs/ │ │ │ │ └── errors.go │ │ │ ├── go.mod │ │ │ ├── go.sum │ │ │ ├── helpers/ │ │ │ │ ├── auth.go │ │ │ │ ├── copier.go │ │ │ │ ├── crypto.go │ │ │ │ ├── file.go │ │ │ │ ├── http_request.go │ │ │ │ ├── json.go │ │ │ │ ├── net.go │ │ │ │ ├── rand.go │ │ │ │ ├── recaptcha.go │ │ │ │ ├── sign.go │ │ │ │ ├── time.go │ │ │ │ ├── tpl.go │ │ │ │ ├── twitter.go │ │ │ │ ├── univ3.go │ │ │ │ └── utils.go │ │ │ ├── internal/ │ │ │ │ ├── core/ │ │ │ │ │ └── ports/ │ │ │ │ │ ├── agent_info.go │ │ │ │ │ ├── app_config.go │ │ │ │ │ ├── knowledge_ports.go │ │ │ │ │ └── scraper_ports.go │ │ │ │ ├── repository/ │ │ │ │ │ ├── agent_info_knowledge_base_repo.go │ │ │ │ │ ├── agent_info_repo.go │ │ │ │ │ ├── app_config.go │ │ │ │ │ ├── knowledge_base_file_repo.go │ │ │ │ │ └── knowledge_base_repo.go │ │ │ │ └── usecase/ │ │ │ │ ├── agent_info/ │ │ │ │ │ └── agent_info.go │ │ │ │ ├── appconfig/ │ │ │ │ │ └── appconfig_usecase.go │ │ │ │ └── knowledge/ │ │ │ │ └── knowledge_usecase.go │ │ │ ├── logger/ │ │ │ │ └── logger.go │ │ │ ├── models/ │ │ │ │ ├── agent.go │ │ │ │ ├── agent_info_knowledege_bases.go │ │ │ │ ├── agent_library.go │ │ │ │ ├── agent_snapshot_post.go │ │ │ │ ├── agent_store.go │ │ │ │ ├── agent_wallet.go │ │ │ │ ├── api_subscription.go │ │ │ │ ├── app_configs.go │ │ │ │ ├── external_wallet.go │ │ │ │ ├── infer.go │ │ │ │ ├── infra_twitter_app.go │ │ │ │ ├── knowledge_base.go │ │ │ │ ├── launchpad.go │ │ │ │ ├── llm_model.go │ │ │ │ ├── meme.go │ │ │ │ ├── mission_store.go │ │ │ │ ├── models.go │ │ │ │ ├── robot.go │ │ │ │ ├── sample_twiiter_app.go │ │ │ │ ├── store_trading_app.go │ │ │ │ ├── tokens.go │ │ │ │ ├── twitter_post.go │ │ │ │ ├── users.go │ │ │ │ └── vibe.go │ │ │ ├── pkg/ │ │ │ │ ├── drivers/ │ │ │ │ │ └── mysql/ │ │ │ │ │ ├── action.go │ │ │ │ │ ├── base.go │ │ │ │ │ ├── filter.go │ │ │ │ │ ├── gorm_connection.go │ │ │ │ │ ├── mysql_config.go │ │ │ │ │ └── mysql_connection.go │ │ │ │ ├── encrypt/ │ │ │ │ │ └── encrypt.go │ │ │ │ ├── eth/ │ │ │ │ │ └── client.go │ │ │ │ ├── scraper/ │ │ │ │ │ └── colly/ │ │ │ │ │ ├── colly.go │ │ │ │ │ └── colly_test.go │ │ │ │ ├── secret_manager/ │ │ │ │ │ └── secret_manager.go │ │ │ │ └── utils/ │ │ │ │ ├── copier.go │ │ │ │ ├── crypto.go │ │ │ │ ├── scraper.go │ │ │ │ ├── solana.go │ │ │ │ ├── solana_test.go │ │ │ │ ├── string_utils.go │ │ │ │ └── utils.go │ │ │ ├── serializers/ │ │ │ │ ├── agent_assistant_serializers.go │ │ │ │ ├── agent_library.go │ │ │ │ ├── agent_serializers.go │ │ │ │ ├── agent_store.go │ │ │ │ ├── agent_token_serializers.go │ │ │ │ ├── api_key_subscription.go │ │ │ │ ├── external_wallet_serializers.go │ │ │ │ ├── infer_req.go │ │ │ │ ├── knowledge_serializers.go │ │ │ │ ├── launchpad_serializers.go │ │ │ │ ├── mission_store.go │ │ │ │ ├── preview_serializers.go │ │ │ │ ├── pump_serializers.go │ │ │ │ ├── reqs.go │ │ │ │ ├── resps.go │ │ │ │ ├── robot_serializers.go │ │ │ │ ├── token_holder_serializers.go │ │ │ │ ├── user_serializers.go │ │ │ │ ├── user_transaction.go │ │ │ │ └── vibe_serializers.go │ │ │ ├── server.go │ │ │ ├── server_test.go │ │ │ ├── services/ │ │ │ │ ├── 3rd/ │ │ │ │ │ ├── aidojo/ │ │ │ │ │ │ └── aidojo.go │ │ │ │ │ ├── binds/ │ │ │ │ │ │ ├── agentfactory/ │ │ │ │ │ │ │ ├── AgentFactory.go │ │ │ │ │ │ │ ├── AgentFactory.json │ │ │ │ │ │ │ └── abigen.sh │ │ │ │ │ │ ├── agentshares/ │ │ │ │ │ │ │ ├── AgentShares.go │ │ │ │ │ │ │ └── abi.json │ │ │ │ │ │ ├── agenttoken/ │ │ │ │ │ │ │ └── AGENTToken.go │ │ │ │ │ │ ├── agentupgradeable/ │ │ │ │ │ │ │ ├── AgentUpgradeable.go │ │ │ │ │ │ │ ├── AgentUpgradeable.json │ │ │ │ │ │ │ └── abigen.sh │ │ │ │ │ │ ├── aikb721/ │ │ │ │ │ │ │ ├── KB721.abi │ │ │ │ │ │ │ └── kb_721.go │ │ │ │ │ │ ├── apechainnonfungiblepositionmanager/ │ │ │ │ │ │ │ ├── NonfungiblePositionManager.go │ │ │ │ │ │ │ └── abi.json │ │ │ │ │ │ ├── apechainpool/ │ │ │ │ │ │ │ ├── Pool.go │ │ │ │ │ │ │ └── abi.json │ │ │ │ │ │ ├── arbitrumfactory/ │ │ │ │ │ │ │ ├── Factory.go │ │ │ │ │ │ │ └── abi.json │ │ │ │ │ │ ├── arbitrumnonfungiblepositionmanager/ │ │ │ │ │ │ │ ├── NonfungiblePositionManager.go │ │ │ │ │ │ │ └── abi.json │ │ │ │ │ │ ├── arbitrumpool/ │ │ │ │ │ │ │ ├── Pool.go │ │ │ │ │ │ │ └── abi.json │ │ │ │ │ │ ├── avaxnonfungiblepositionmanager/ │ │ │ │ │ │ │ ├── NonfungiblePositionManager.go │ │ │ │ │ │ │ └── abi.json │ │ │ │ │ │ ├── basenonfungiblepositionmanager/ │ │ │ │ │ │ │ ├── NonfungiblePositionManager.go │ │ │ │ │ │ │ └── abi.json │ │ │ │ │ │ ├── basequoterv2/ │ │ │ │ │ │ │ ├── QuoterV2.go │ │ │ │ │ │ │ ├── abi.json │ │ │ │ │ │ │ └── extras.go │ │ │ │ │ │ ├── baseswaprouter02/ │ │ │ │ │ │ │ ├── SwapRouter02.go │ │ │ │ │ │ │ └── abi.json │ │ │ │ │ │ ├── bridge/ │ │ │ │ │ │ │ └── Bridge.go │ │ │ │ │ │ ├── bscfactory/ │ │ │ │ │ │ │ ├── Factory.go │ │ │ │ │ │ │ └── abi.json │ │ │ │ │ │ ├── bscnonfungiblepositionmanager/ │ │ │ │ │ │ │ ├── NonfungiblePositionManager.go │ │ │ │ │ │ │ └── abi.json │ │ │ │ │ │ ├── bscpool/ │ │ │ │ │ │ │ ├── Pool.go │ │ │ │ │ │ │ └── abi.json │ │ │ │ │ │ ├── celononfungiblepositionmanager/ │ │ │ │ │ │ │ ├── NonfungiblePositionManager.go │ │ │ │ │ │ │ ├── abi.json │ │ │ │ │ │ │ └── abigen.sh │ │ │ │ │ │ ├── dagent721/ │ │ │ │ │ │ │ ├── Dagent721.go │ │ │ │ │ │ │ └── abi.json │ │ │ │ │ │ ├── daotoken/ │ │ │ │ │ │ │ └── DAOToken.go │ │ │ │ │ │ ├── daotreasury/ │ │ │ │ │ │ │ └── DAOTreasury.go │ │ │ │ │ │ ├── erc1155/ │ │ │ │ │ │ │ └── ERC1155.go │ │ │ │ │ │ ├── erc20/ │ │ │ │ │ │ │ └── erc20.go │ │ │ │ │ │ ├── erc20realworldagent/ │ │ │ │ │ │ │ ├── ERC20RealWorldAgent.go │ │ │ │ │ │ │ ├── ERC20RealWorldAgent.json │ │ │ │ │ │ │ └── abigen.sh │ │ │ │ │ │ ├── erc20utilityagent/ │ │ │ │ │ │ │ ├── ERC20UtilityAgent.go │ │ │ │ │ │ │ ├── ERC20UtilityAgent.json │ │ │ │ │ │ │ └── abigen.sh │ │ │ │ │ │ ├── erc721/ │ │ │ │ │ │ │ └── erc721.go │ │ │ │ │ │ ├── ethereumnonfungiblepositionmanager/ │ │ │ │ │ │ │ ├── NonfungiblePositionManager.go │ │ │ │ │ │ │ └── abi.json │ │ │ │ │ │ ├── filestore/ │ │ │ │ │ │ │ └── FileStore.json │ │ │ │ │ │ ├── gpumanager/ │ │ │ │ │ │ │ ├── GPUManagerr.go │ │ │ │ │ │ │ └── abi.json │ │ │ │ │ │ ├── iagenttokendeployer/ │ │ │ │ │ │ │ └── IAGENTTokenDeployer.go │ │ │ │ │ │ ├── ihybridmodel/ │ │ │ │ │ │ │ └── IHybridModel.go │ │ │ │ │ │ ├── imagehub/ │ │ │ │ │ │ │ └── ImageHub.go │ │ │ │ │ │ ├── isystempromptmanager/ │ │ │ │ │ │ │ └── ISystemPromptManager.go │ │ │ │ │ │ ├── iv3swaprouter/ │ │ │ │ │ │ │ └── IV3SwapRouter.go │ │ │ │ │ │ ├── iworkerhub/ │ │ │ │ │ │ │ └── workerhub.go │ │ │ │ │ │ ├── memenonfungiblepositionmanager/ │ │ │ │ │ │ │ ├── NonfungiblePositionManager.go │ │ │ │ │ │ │ └── abi.json │ │ │ │ │ │ ├── memequoter/ │ │ │ │ │ │ │ ├── QuoterV2.go │ │ │ │ │ │ │ └── extras.go │ │ │ │ │ │ ├── memeswaprouter/ │ │ │ │ │ │ │ └── SwapRouter.go │ │ │ │ │ │ ├── multisend/ │ │ │ │ │ │ │ └── MultiSend.go │ │ │ │ │ │ ├── orderpayment/ │ │ │ │ │ │ │ ├── OrderPayment.go │ │ │ │ │ │ │ └── abi.json │ │ │ │ │ │ ├── polygonnonfungiblepositionmanager/ │ │ │ │ │ │ │ ├── NonfungiblePositionManager.go │ │ │ │ │ │ │ └── abi.json │ │ │ │ │ │ ├── proxyadmin/ │ │ │ │ │ │ │ └── ProxyAdmin.go │ │ │ │ │ │ ├── sunpumplaunchpad/ │ │ │ │ │ │ │ ├── SunpumpLaunchpad.go │ │ │ │ │ │ │ └── abi.json │ │ │ │ │ │ ├── systempromptmanager/ │ │ │ │ │ │ │ └── SystemPromptManager.go │ │ │ │ │ │ ├── tokenfactory/ │ │ │ │ │ │ │ └── TokenFactory.go │ │ │ │ │ │ ├── transparentupgradeableproxy/ │ │ │ │ │ │ │ └── TransparentUpgradeableProxy.go │ │ │ │ │ │ ├── transparentupgradeableproxyzk/ │ │ │ │ │ │ │ └── TransparentUpgradeableProxy.go │ │ │ │ │ │ ├── uniswapv3factory/ │ │ │ │ │ │ │ └── UniswapV3Factory.go │ │ │ │ │ │ ├── uniswapv3pool/ │ │ │ │ │ │ │ └── UniswapV3Pool.go │ │ │ │ │ │ ├── vibetokenfactory/ │ │ │ │ │ │ │ └── VibeTokenFactory.go │ │ │ │ │ │ ├── wbvm/ │ │ │ │ │ │ │ └── WBVM.go │ │ │ │ │ │ ├── workerhub/ │ │ │ │ │ │ │ └── workerhub.go │ │ │ │ │ │ └── zksyncnonfungiblepositionmanager/ │ │ │ │ │ │ ├── NonfungiblePositionManager.go │ │ │ │ │ │ └── abi.json │ │ │ │ │ ├── blockchain_utils/ │ │ │ │ │ │ └── blockchain_utils.go │ │ │ │ │ ├── bridgeapi/ │ │ │ │ │ │ └── bridge_api.go │ │ │ │ │ ├── btcapi/ │ │ │ │ │ │ ├── blockchain.go │ │ │ │ │ │ ├── client.go │ │ │ │ │ │ ├── hiroso.go │ │ │ │ │ │ ├── mempool.go │ │ │ │ │ │ └── sdk.go │ │ │ │ │ ├── clanker/ │ │ │ │ │ │ └── clanker_client.go │ │ │ │ │ ├── coingecko/ │ │ │ │ │ │ └── client.go │ │ │ │ │ ├── coinmarketcap/ │ │ │ │ │ │ └── coin_market_cap.go │ │ │ │ │ ├── core/ │ │ │ │ │ │ └── client.go │ │ │ │ │ ├── deep_research/ │ │ │ │ │ │ └── deep_research.go │ │ │ │ │ ├── delegate_cash/ │ │ │ │ │ │ └── delegate_cash.go │ │ │ │ │ ├── dexscreener/ │ │ │ │ │ │ ├── dexscreener.go │ │ │ │ │ │ └── dexscreener_wss.go │ │ │ │ │ ├── eth/ │ │ │ │ │ │ └── client.go │ │ │ │ │ ├── ethapi/ │ │ │ │ │ │ ├── agenttoken.go │ │ │ │ │ │ ├── agentupgradeable.go │ │ │ │ │ │ ├── apechain_swapv3.go │ │ │ │ │ │ ├── arbitrum_swapv3.go │ │ │ │ │ │ ├── avax_swapv3.go │ │ │ │ │ │ ├── base_swapv3.go │ │ │ │ │ │ ├── bsc_swapv3.go │ │ │ │ │ │ ├── celo_swapv3.go │ │ │ │ │ │ ├── client.go │ │ │ │ │ │ ├── dagent721.go │ │ │ │ │ │ ├── daotoken.go │ │ │ │ │ │ ├── daotreasury.go │ │ │ │ │ │ ├── erc20.go │ │ │ │ │ │ ├── erc20realworldagent.go │ │ │ │ │ │ ├── erc20utilityagent.go │ │ │ │ │ │ ├── erc721.go │ │ │ │ │ │ ├── ethereum_swapv3.go │ │ │ │ │ │ ├── events.go │ │ │ │ │ │ ├── external_events.go │ │ │ │ │ │ ├── gpumanager.go │ │ │ │ │ │ ├── iagenttokendeployer.go │ │ │ │ │ │ ├── iv3swaprouter.go │ │ │ │ │ │ ├── meme_swapv3.go │ │ │ │ │ │ ├── multisend.go │ │ │ │ │ │ ├── polygon_swapv3.go │ │ │ │ │ │ ├── proxyadmin.go │ │ │ │ │ │ ├── systempromptmanager.go │ │ │ │ │ │ ├── tokenfactory.go │ │ │ │ │ │ ├── transparentupgradeableproxy.go │ │ │ │ │ │ ├── univ3.go │ │ │ │ │ │ ├── vibe_token.go │ │ │ │ │ │ └── workerhub.go │ │ │ │ │ ├── evmapi/ │ │ │ │ │ │ └── base.go │ │ │ │ │ ├── googlestorage/ │ │ │ │ │ │ └── client.go │ │ │ │ │ ├── hiro/ │ │ │ │ │ │ ├── hiro.go │ │ │ │ │ │ └── structs.go │ │ │ │ │ ├── lighthouse/ │ │ │ │ │ │ ├── lighthouse.go │ │ │ │ │ │ ├── zip_upload.go │ │ │ │ │ │ └── zip_upload_test.go │ │ │ │ │ ├── magiceden/ │ │ │ │ │ │ ├── magiceden.go │ │ │ │ │ │ ├── magiceden_hardcode.go │ │ │ │ │ │ └── structs.go │ │ │ │ │ ├── moralis/ │ │ │ │ │ │ ├── client.go │ │ │ │ │ │ ├── moralis.go │ │ │ │ │ │ └── structure.go │ │ │ │ │ ├── openai/ │ │ │ │ │ │ ├── openai.go │ │ │ │ │ │ └── utils.go │ │ │ │ │ ├── opensea/ │ │ │ │ │ │ ├── opensea.go │ │ │ │ │ │ └── structures.go │ │ │ │ │ ├── privy/ │ │ │ │ │ │ └── privy_client.go │ │ │ │ │ ├── pumfun/ │ │ │ │ │ │ └── client.go │ │ │ │ │ ├── rapid/ │ │ │ │ │ │ └── rapid.go │ │ │ │ │ ├── taapi/ │ │ │ │ │ │ └── taapi.go │ │ │ │ │ ├── telegram/ │ │ │ │ │ │ └── telegram.go │ │ │ │ │ ├── trxapi/ │ │ │ │ │ │ ├── client.go │ │ │ │ │ │ ├── common.go │ │ │ │ │ │ ├── sunpumplaunchpad.go │ │ │ │ │ │ ├── systempromptmanager.go │ │ │ │ │ │ └── trx20.go │ │ │ │ │ ├── twitter/ │ │ │ │ │ │ ├── auth.go │ │ │ │ │ │ ├── client.go │ │ │ │ │ │ ├── common_obj.go │ │ │ │ │ │ ├── error_obj.go │ │ │ │ │ │ ├── exclude.go │ │ │ │ │ │ ├── expansions.go │ │ │ │ │ │ ├── media_obj.go │ │ │ │ │ │ ├── place_obj.go │ │ │ │ │ │ ├── poll_obj.go │ │ │ │ │ │ ├── tweet.go │ │ │ │ │ │ ├── tweet_obj.go │ │ │ │ │ │ ├── tweet_params.go │ │ │ │ │ │ ├── upload_video.go │ │ │ │ │ │ ├── user.go │ │ │ │ │ │ ├── user_obj.go │ │ │ │ │ │ ├── user_params.go │ │ │ │ │ │ └── wrap_api.go │ │ │ │ │ ├── zkapi/ │ │ │ │ │ │ ├── client.go │ │ │ │ │ │ ├── erc1155.go │ │ │ │ │ │ ├── erc20.go │ │ │ │ │ │ ├── erc721.go │ │ │ │ │ │ ├── hybridmodel.go │ │ │ │ │ │ ├── image_hub.go │ │ │ │ │ │ ├── systempromptmanager.go │ │ │ │ │ │ ├── transparentupgradeableproxy.go │ │ │ │ │ │ └── zksync_swapv3.go │ │ │ │ │ └── zkclient/ │ │ │ │ │ └── client.go │ │ │ │ ├── agent_abilities_job.go │ │ │ │ ├── agent_abilities_luckymoney.go │ │ │ │ ├── agent_abilities_telebot.go │ │ │ │ ├── agent_abilities_twitter.go │ │ │ │ ├── agent_analytic.go │ │ │ │ ├── agent_balances.go │ │ │ │ ├── agent_brains.go │ │ │ │ ├── agent_create_agent_srv.go │ │ │ │ ├── agent_create_token_video.go │ │ │ │ ├── agent_infer.go │ │ │ │ ├── agent_infer_job.go │ │ │ │ ├── agent_infra.go │ │ │ │ ├── agent_knowledgebase.go │ │ │ │ ├── agent_launchpad.go │ │ │ │ ├── agent_launchpad_job.go │ │ │ │ ├── agent_library.go │ │ │ │ ├── agent_manage.go │ │ │ │ ├── agent_mints.go │ │ │ │ ├── agent_nfts.go │ │ │ │ ├── agent_report.go │ │ │ │ ├── agent_srv.go │ │ │ │ ├── agent_store.go │ │ │ │ ├── agent_token_srv.go │ │ │ │ ├── agent_trading.go │ │ │ │ ├── agent_twin_trains.go │ │ │ │ ├── agent_utilities.go │ │ │ │ ├── agent_video.go │ │ │ │ ├── api_subscription_srv.go │ │ │ │ ├── blockchain_subcriber.go │ │ │ │ ├── blockchain_subcriber_job.go │ │ │ │ ├── dex_srv.go │ │ │ │ ├── external_wallet_srv.go │ │ │ │ ├── infra_twitter_app.go │ │ │ │ ├── internal_srv.go │ │ │ │ ├── ipfs.go │ │ │ │ ├── job_srv.go │ │ │ │ ├── knowledge_base_job.go │ │ │ │ ├── mission_store.go │ │ │ │ ├── redis_srv.go │ │ │ │ ├── robot_srv.go │ │ │ │ ├── sample_twitter_app.go │ │ │ │ ├── service.go │ │ │ │ ├── store_trading_app.go │ │ │ │ ├── telegram.go │ │ │ │ ├── token_liquidity.go │ │ │ │ ├── token_liquidity_events.go │ │ │ │ ├── token_liquidity_job.go │ │ │ │ ├── twitter_job.go │ │ │ │ ├── user_srv.go │ │ │ │ ├── vibe_srv.go │ │ │ │ └── video_magic_prompt.go │ │ │ └── types/ │ │ │ └── numeric/ │ │ │ ├── address.go │ │ │ ├── bigints.go │ │ │ ├── common.go │ │ │ ├── hash.go │ │ │ ├── hex.go │ │ │ ├── numeric.go │ │ │ └── quote_uint64s.go │ │ ├── core/ │ │ │ ├── cmd/ │ │ │ │ └── api/ │ │ │ │ └── main.go │ │ │ ├── common/ │ │ │ │ └── database/ │ │ │ │ └── database.go │ │ │ ├── config/ │ │ │ │ └── config.json.sample │ │ │ ├── domain/ │ │ │ │ ├── errors.go │ │ │ │ └── wallet.go │ │ │ ├── go.mod │ │ │ ├── go.sum │ │ │ ├── logger/ │ │ │ │ └── logger.go │ │ │ ├── modules/ │ │ │ │ └── wallet/ │ │ │ │ ├── delivery/ │ │ │ │ │ └── http/ │ │ │ │ │ └── handler.go │ │ │ │ ├── repository/ │ │ │ │ │ └── mysql/ │ │ │ │ │ └── mysql.go │ │ │ │ └── usecase/ │ │ │ │ └── usecase.go │ │ │ ├── pkg/ │ │ │ │ └── core/ │ │ │ │ ├── core.go │ │ │ │ └── wallet/ │ │ │ │ └── wallet.go │ │ │ ├── serializers/ │ │ │ │ └── serializers.go │ │ │ ├── server/ │ │ │ │ └── http.go │ │ │ └── utils/ │ │ │ ├── blowfish.go │ │ │ ├── ip.go │ │ │ ├── map.go │ │ │ └── utils.go │ │ ├── lib-services/ │ │ │ ├── .gitignore │ │ │ ├── package.json │ │ │ ├── src/ │ │ │ │ ├── contants.ts │ │ │ │ ├── core/ │ │ │ │ │ └── index.ts │ │ │ │ ├── neynar.ts │ │ │ │ ├── raydium.ts │ │ │ │ ├── server.ts │ │ │ │ └── utils.ts │ │ │ ├── tsconfig-scryptTS.json │ │ │ └── tsconfig.json │ │ ├── md.go │ │ └── remote-service/ │ │ ├── .cursorignore │ │ ├── .gitignore │ │ ├── cmd/ │ │ │ ├── client/ │ │ │ │ └── main.go │ │ │ └── server/ │ │ │ ├── discover/ │ │ │ │ └── discover.go │ │ │ └── main.go │ │ ├── go.mod │ │ ├── go.sum │ │ └── proto/ │ │ ├── script.sh │ │ ├── script_service.pb.go │ │ ├── script_service.proto │ │ └── script_service_grpc.pb.go │ ├── characters/ │ │ └── luna.character.ts │ ├── dagent/ │ │ ├── package.json │ │ ├── src/ │ │ │ ├── agent/ │ │ │ │ └── index.ts │ │ │ ├── dagentCharacter.ts │ │ │ ├── direct/ │ │ │ │ ├── constant.ts │ │ │ │ ├── index.ts │ │ │ │ ├── service.ts │ │ │ │ └── utils.ts │ │ │ ├── storage/ │ │ │ │ └── index.ts │ │ │ └── utils/ │ │ │ ├── environment.ts │ │ │ └── helpers.ts │ │ ├── tsconfig.json │ │ └── tsup.config.ts │ ├── lerna.json │ ├── package.json │ ├── plugins/ │ │ ├── client-dagent/ │ │ │ ├── package.json │ │ │ ├── src/ │ │ │ │ ├── dagent-farcaster.ts │ │ │ │ ├── dagent-twitter.ts │ │ │ │ ├── index.ts │ │ │ │ └── types.ts │ │ │ ├── tsconfig.build.json │ │ │ ├── tsconfig.json │ │ │ └── tsup.config.ts │ │ ├── core/ │ │ │ ├── package.json │ │ │ ├── src/ │ │ │ │ ├── base-dagent.ts │ │ │ │ ├── client/ │ │ │ │ │ ├── agent.ts │ │ │ │ │ ├── base.ts │ │ │ │ │ └── index.ts │ │ │ │ ├── index.ts │ │ │ │ ├── logger.ts │ │ │ │ ├── store/ │ │ │ │ │ └── store.ts │ │ │ │ ├── types/ │ │ │ │ │ ├── agent.ts │ │ │ │ │ ├── api.ts │ │ │ │ │ ├── chain.ts │ │ │ │ │ ├── character.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── store.ts │ │ │ │ │ └── token.ts │ │ │ │ └── utils/ │ │ │ │ └── generation.ts │ │ │ ├── tsconfig.build.json │ │ │ ├── tsconfig.json │ │ │ └── tsup.config.ts │ │ ├── plugin-direct/ │ │ │ ├── README.md │ │ │ ├── nodemon.json │ │ │ ├── package.json │ │ │ ├── src/ │ │ │ │ └── index.ts │ │ │ ├── tsconfig.json │ │ │ └── tsup.config.ts │ │ ├── plugin-farcaster/ │ │ │ ├── package.json │ │ │ ├── src/ │ │ │ │ ├── index.ts │ │ │ │ └── types.ts │ │ │ ├── tsconfig.build.json │ │ │ ├── tsconfig.json │ │ │ └── tsup.config.ts │ │ └── plugin-twitter/ │ │ ├── package.json │ │ ├── src/ │ │ │ ├── index.ts │ │ │ └── types.ts │ │ ├── tsconfig.build.json │ │ ├── tsconfig.json │ │ └── tsup.config.ts │ ├── scripts/ │ │ ├── comma.js │ │ └── start-dagent.js │ └── tsconfig.json ├── agent-cli/ │ ├── bin/ │ │ └── eai.js │ ├── install.sh │ ├── package.json │ ├── src/ │ │ ├── const.ts │ │ ├── eliza/ │ │ │ ├── Dockerfile │ │ │ ├── config.json │ │ │ ├── sample.sh │ │ │ └── start.sh │ │ ├── eternalai/ │ │ │ ├── Dockerfile │ │ │ ├── chat.sh │ │ │ ├── default_config.json │ │ │ ├── default_local_contracts.json │ │ │ └── start.sh │ │ ├── handler.ts │ │ ├── log.ts │ │ ├── main.ts │ │ ├── manager.ts │ │ ├── mintv1.ts │ │ ├── mintv2.ts │ │ ├── model_handler.ts │ │ ├── rig/ │ │ │ ├── Dockerfile │ │ │ ├── agent_with_eternalai.rs │ │ │ └── start.sh │ │ └── utils.ts │ ├── tsconfig.json │ └── tsup.config.ts ├── agent-launcher/ │ ├── .eslintrc.cjs │ ├── .gitignore │ ├── README.md │ ├── crypto-agents/ │ │ ├── README.md │ │ └── js/ │ │ ├── twitter-dm/ │ │ │ ├── .dockerignore │ │ │ ├── .gitignore │ │ │ ├── Dockerfile │ │ │ ├── README.md │ │ │ ├── docker-compose.yml │ │ │ ├── package.json │ │ │ ├── src/ │ │ │ │ ├── prompt/ │ │ │ │ │ └── index.ts │ │ │ │ ├── server.ts │ │ │ │ ├── types/ │ │ │ │ │ └── chat.ts │ │ │ │ └── utils/ │ │ │ │ └── logger.ts │ │ │ └── tsconfig.json │ │ └── twitter-infra/ │ │ ├── .gitignore │ │ ├── Dockerfile │ │ ├── README.md │ │ ├── package.json │ │ └── src/ │ │ ├── index.ts │ │ └── prompt/ │ │ ├── index.ts │ │ └── types.ts │ ├── electron/ │ │ ├── electron-env.d.ts │ │ ├── main.ts │ │ └── preload.ts │ ├── electron-builder.json5 │ ├── index.html │ ├── package.json │ ├── src/ │ │ ├── App.tsx │ │ ├── components/ │ │ │ ├── header/ │ │ │ │ ├── index.tsx │ │ │ │ ├── menu/ │ │ │ │ │ ├── index.tsx │ │ │ │ │ ├── menuConfig.ts │ │ │ │ │ └── styles.module.scss │ │ │ │ ├── styles.module.scss │ │ │ │ └── wallet/ │ │ │ │ ├── index.tsx │ │ │ │ └── styles.module.scss │ │ │ └── layout/ │ │ │ ├── index.tsx │ │ │ └── styles.module.scss │ │ ├── constants/ │ │ │ └── route-path.ts │ │ ├── hooks/ │ │ │ └── useOnClickOutSide.ts │ │ ├── main.tsx │ │ ├── pages/ │ │ │ ├── home/ │ │ │ │ ├── chat-agent/ │ │ │ │ │ ├── bundle.js │ │ │ │ │ └── index.tsx │ │ │ │ ├── index.tsx │ │ │ │ ├── provider/ │ │ │ │ │ ├── index.tsx │ │ │ │ │ └── interface.ts │ │ │ │ └── trade-agent/ │ │ │ │ ├── form-trade/ │ │ │ │ │ └── index.tsx │ │ │ │ ├── index.tsx │ │ │ │ └── styles.module.scss │ │ │ └── mine/ │ │ │ ├── __mock__/ │ │ │ │ └── nodes.ts │ │ │ ├── components/ │ │ │ │ ├── button-base/ │ │ │ │ │ ├── index.tsx │ │ │ │ │ └── styles.module.scss │ │ │ │ ├── card-base/ │ │ │ │ │ ├── index.tsx │ │ │ │ │ └── styles.module.scss │ │ │ │ ├── config-info-card/ │ │ │ │ │ ├── index.tsx │ │ │ │ │ └── styles.module.scss │ │ │ │ └── node-card/ │ │ │ │ ├── index.tsx │ │ │ │ └── styles.module.scss │ │ │ ├── features/ │ │ │ │ ├── header/ │ │ │ │ │ ├── index.tsx │ │ │ │ │ └── styles.module.scss │ │ │ │ ├── node-actions/ │ │ │ │ │ └── index.tsx │ │ │ │ ├── node-config-info/ │ │ │ │ │ ├── index.tsx │ │ │ │ │ └── styles.module.scss │ │ │ │ ├── node-device-info/ │ │ │ │ │ ├── index.tsx │ │ │ │ │ └── styles.module.scss │ │ │ │ └── node-list/ │ │ │ │ ├── index.tsx │ │ │ │ └── styles.module.scss │ │ │ ├── index.tsx │ │ │ └── stores/ │ │ │ └── useNodes.ts │ │ ├── styles/ │ │ │ └── global.scss │ │ ├── types/ │ │ │ └── data.ts │ │ ├── utils/ │ │ │ ├── data.ts │ │ │ └── extension.ts │ │ ├── vite-env.d.ts │ │ └── worker.js │ ├── tsconfig.json │ ├── tsconfig.node.json │ └── vite.config.ts ├── agent-studio/ │ ├── .eslint.config.js │ ├── .gitignore │ ├── .npmrc │ ├── .yarnrc.yml │ ├── README.md │ ├── lerna.json │ ├── package.json │ ├── packages/ │ │ ├── studio-app/ │ │ │ ├── .gitignore │ │ │ ├── README.md │ │ │ ├── package.json │ │ │ ├── public/ │ │ │ │ ├── index.html │ │ │ │ ├── manifest.json │ │ │ │ └── robots.txt │ │ │ ├── src/ │ │ │ │ ├── App.module.scss │ │ │ │ ├── App.test.tsx │ │ │ │ ├── App.tsx │ │ │ │ ├── categories/ │ │ │ │ │ ├── ai-framework/ │ │ │ │ │ │ ├── CustomRenderer/ │ │ │ │ │ │ │ └── index.tsx │ │ │ │ │ │ ├── eliza/ │ │ │ │ │ │ │ ├── ElizaFramework/ │ │ │ │ │ │ │ │ └── index.tsx │ │ │ │ │ │ │ └── types.ts │ │ │ │ │ │ └── validates/ │ │ │ │ │ │ ├── create.ts │ │ │ │ │ │ ├── index.ts │ │ │ │ │ │ └── update.ts │ │ │ │ │ ├── blockchains/ │ │ │ │ │ │ ├── CustomRenderer/ │ │ │ │ │ │ │ └── index.tsx │ │ │ │ │ │ └── validates/ │ │ │ │ │ │ ├── create.ts │ │ │ │ │ │ ├── index.ts │ │ │ │ │ │ └── update.ts │ │ │ │ │ ├── categories.ts │ │ │ │ │ ├── decentralize-inference/ │ │ │ │ │ │ ├── CustomRenderer/ │ │ │ │ │ │ │ └── index.tsx │ │ │ │ │ │ └── validates/ │ │ │ │ │ │ ├── create.ts │ │ │ │ │ │ ├── index.ts │ │ │ │ │ │ └── update.ts │ │ │ │ │ ├── defi/ │ │ │ │ │ │ └── tradeAnalytics/ │ │ │ │ │ │ ├── CustomRenderer/ │ │ │ │ │ │ │ ├── Fields/ │ │ │ │ │ │ │ │ ├── FrequencyField.tsx │ │ │ │ │ │ │ │ └── TokenField.tsx │ │ │ │ │ │ │ └── index.tsx │ │ │ │ │ │ ├── types.ts │ │ │ │ │ │ └── validates/ │ │ │ │ │ │ ├── create.ts │ │ │ │ │ │ ├── index.ts │ │ │ │ │ │ └── update.ts │ │ │ │ │ ├── farcaster/ │ │ │ │ │ │ ├── postOnFarcaster/ │ │ │ │ │ │ │ ├── CustomRenderer/ │ │ │ │ │ │ │ │ ├── Fields/ │ │ │ │ │ │ │ │ │ ├── AiModelField.tsx │ │ │ │ │ │ │ │ │ ├── DetailsField.tsx │ │ │ │ │ │ │ │ │ └── FrequencyField.tsx │ │ │ │ │ │ │ │ └── index.tsx │ │ │ │ │ │ │ ├── types.ts │ │ │ │ │ │ │ └── validates/ │ │ │ │ │ │ │ ├── create.ts │ │ │ │ │ │ │ ├── index.ts │ │ │ │ │ │ │ └── update.ts │ │ │ │ │ │ ├── replyOnFarcaster/ │ │ │ │ │ │ │ ├── CustomRenderer/ │ │ │ │ │ │ │ │ ├── Fields/ │ │ │ │ │ │ │ │ │ ├── AiModelField.tsx │ │ │ │ │ │ │ │ │ ├── DetailsField.tsx │ │ │ │ │ │ │ │ │ └── FrequencyField.tsx │ │ │ │ │ │ │ │ └── index.tsx │ │ │ │ │ │ │ ├── types.ts │ │ │ │ │ │ │ └── validates/ │ │ │ │ │ │ │ ├── create.ts │ │ │ │ │ │ │ ├── index.ts │ │ │ │ │ │ │ └── update.ts │ │ │ │ │ │ └── styles.module.scss │ │ │ │ │ ├── new-agent/ │ │ │ │ │ │ └── validates/ │ │ │ │ │ │ ├── create.ts │ │ │ │ │ │ ├── index.ts │ │ │ │ │ │ └── update.ts │ │ │ │ │ ├── persisted-agent.ts │ │ │ │ │ ├── personalities/ │ │ │ │ │ │ ├── ReviewNft.tsx │ │ │ │ │ │ ├── helpers.ts │ │ │ │ │ │ ├── import-from-nft/ │ │ │ │ │ │ │ ├── ImportFromNft/ │ │ │ │ │ │ │ │ ├── CollectionModal/ │ │ │ │ │ │ │ │ │ ├── CollectionListView.tsx │ │ │ │ │ │ │ │ │ ├── CollectionNFTItem.tsx │ │ │ │ │ │ │ │ │ ├── index.tsx │ │ │ │ │ │ │ │ │ └── styles.module.scss │ │ │ │ │ │ │ │ ├── CollectionThumbItem.tsx │ │ │ │ │ │ │ │ ├── CollectionView.tsx │ │ │ │ │ │ │ │ ├── PersonalityView.tsx │ │ │ │ │ │ │ │ ├── TokenIdView.tsx │ │ │ │ │ │ │ │ ├── index.tsx │ │ │ │ │ │ │ │ └── styles.module.scss │ │ │ │ │ │ │ └── types.ts │ │ │ │ │ │ ├── import-from-ordinals/ │ │ │ │ │ │ │ ├── CustomRenderer/ │ │ │ │ │ │ │ │ ├── Fields/ │ │ │ │ │ │ │ │ │ ├── CollectionModal/ │ │ │ │ │ │ │ │ │ │ ├── CollectionListView.tsx │ │ │ │ │ │ │ │ │ │ ├── CollectionNFTItem.tsx │ │ │ │ │ │ │ │ │ │ ├── index.tsx │ │ │ │ │ │ │ │ │ │ └── styles.module.scss │ │ │ │ │ │ │ │ │ ├── CollectionThumbItem.tsx │ │ │ │ │ │ │ │ │ ├── CollectionView.tsx │ │ │ │ │ │ │ │ │ ├── PersonalityView.tsx │ │ │ │ │ │ │ │ │ └── TokenIdView.tsx │ │ │ │ │ │ │ │ ├── index.tsx │ │ │ │ │ │ │ │ └── styles.module.scss │ │ │ │ │ │ │ └── types.ts │ │ │ │ │ │ ├── import-from-token/ │ │ │ │ │ │ │ ├── CustomRenderer/ │ │ │ │ │ │ │ │ ├── Fields/ │ │ │ │ │ │ │ │ │ ├── ContractAddressView.tsx │ │ │ │ │ │ │ │ │ ├── PersonalityView.tsx │ │ │ │ │ │ │ │ │ ├── TokenNameView.tsx │ │ │ │ │ │ │ │ │ └── TokenSymbolView.tsx │ │ │ │ │ │ │ │ ├── index.tsx │ │ │ │ │ │ │ │ └── styles.module.scss │ │ │ │ │ │ │ └── types.ts │ │ │ │ │ │ ├── import-genomics/ │ │ │ │ │ │ │ ├── CustomRenderer/ │ │ │ │ │ │ │ │ ├── SelectTwitterModal/ │ │ │ │ │ │ │ │ │ ├── SelectTwitterModal.module.scss │ │ │ │ │ │ │ │ │ └── index.tsx │ │ │ │ │ │ │ │ ├── TwitterCloneTube/ │ │ │ │ │ │ │ │ │ └── index.tsx │ │ │ │ │ │ │ │ ├── TwitterClonedView/ │ │ │ │ │ │ │ │ │ └── index.tsx │ │ │ │ │ │ │ │ ├── index.tsx │ │ │ │ │ │ │ │ └── styles.module.scss │ │ │ │ │ │ │ └── types.ts │ │ │ │ │ │ ├── knowledge/ │ │ │ │ │ │ │ ├── CustomRenderer/ │ │ │ │ │ │ │ │ ├── Fields/ │ │ │ │ │ │ │ │ │ ├── DescriptionView.tsx │ │ │ │ │ │ │ │ │ ├── NameView.tsx │ │ │ │ │ │ │ │ │ └── UploadFile/ │ │ │ │ │ │ │ │ │ ├── ListFiles/ │ │ │ │ │ │ │ │ │ │ ├── index.tsx │ │ │ │ │ │ │ │ │ │ └── styles.module.scss │ │ │ │ │ │ │ │ │ ├── index.tsx │ │ │ │ │ │ │ │ │ └── styles.module.scss │ │ │ │ │ │ │ │ ├── index.tsx │ │ │ │ │ │ │ │ └── styles.module.scss │ │ │ │ │ │ │ ├── types.ts │ │ │ │ │ │ │ └── validates/ │ │ │ │ │ │ │ ├── create.ts │ │ │ │ │ │ │ ├── index.ts │ │ │ │ │ │ │ └── update.ts │ │ │ │ │ │ ├── new-personality/ │ │ │ │ │ │ │ ├── NewPersonality/ │ │ │ │ │ │ │ │ ├── index.tsx │ │ │ │ │ │ │ │ └── styles.module.scss │ │ │ │ │ │ │ └── types.ts │ │ │ │ │ │ └── validates/ │ │ │ │ │ │ ├── create.ts │ │ │ │ │ │ ├── index.ts │ │ │ │ │ │ └── update.ts │ │ │ │ │ ├── shared/ │ │ │ │ │ │ ├── CustomRendererNoInput/ │ │ │ │ │ │ │ └── index.tsx │ │ │ │ │ │ └── validators/ │ │ │ │ │ │ └── index.ts │ │ │ │ │ ├── tokens/ │ │ │ │ │ │ ├── CustomRenderer/ │ │ │ │ │ │ │ └── index.tsx │ │ │ │ │ │ └── validates/ │ │ │ │ │ │ ├── create.ts │ │ │ │ │ │ ├── index.ts │ │ │ │ │ │ └── update.ts │ │ │ │ │ └── x/ │ │ │ │ │ ├── engageOnX/ │ │ │ │ │ │ ├── CustomRenderer/ │ │ │ │ │ │ │ ├── Fields/ │ │ │ │ │ │ │ │ ├── AiModelField.tsx │ │ │ │ │ │ │ │ ├── DetailsField.tsx │ │ │ │ │ │ │ │ └── FrequencyField.tsx │ │ │ │ │ │ │ └── index.tsx │ │ │ │ │ │ ├── types.ts │ │ │ │ │ │ └── validates/ │ │ │ │ │ │ ├── create.ts │ │ │ │ │ │ ├── index.ts │ │ │ │ │ │ └── update.ts │ │ │ │ │ ├── followOnX/ │ │ │ │ │ │ ├── CustomRenderer/ │ │ │ │ │ │ │ ├── Fields/ │ │ │ │ │ │ │ │ ├── AiModelField.tsx │ │ │ │ │ │ │ │ ├── DetailsField.tsx │ │ │ │ │ │ │ │ └── FrequencyField.tsx │ │ │ │ │ │ │ └── index.tsx │ │ │ │ │ │ ├── types.ts │ │ │ │ │ │ └── validates/ │ │ │ │ │ │ ├── create.ts │ │ │ │ │ │ ├── index.ts │ │ │ │ │ │ └── update.ts │ │ │ │ │ ├── postFollowingOnX/ │ │ │ │ │ │ ├── CustomRenderer/ │ │ │ │ │ │ │ ├── Fields/ │ │ │ │ │ │ │ │ ├── AiModelField.tsx │ │ │ │ │ │ │ │ ├── DetailsField.tsx │ │ │ │ │ │ │ │ ├── FetchPostsFrequencyField.tsx │ │ │ │ │ │ │ │ ├── FrequencyField.tsx │ │ │ │ │ │ │ │ └── styles.module.scss │ │ │ │ │ │ │ └── index.tsx │ │ │ │ │ │ ├── types.ts │ │ │ │ │ │ └── validates/ │ │ │ │ │ │ ├── create.ts │ │ │ │ │ │ ├── index.ts │ │ │ │ │ │ └── update.ts │ │ │ │ │ ├── postNewsOnX/ │ │ │ │ │ │ ├── CustomRenderer/ │ │ │ │ │ │ │ ├── Fields/ │ │ │ │ │ │ │ │ ├── AiModelField.tsx │ │ │ │ │ │ │ │ ├── DetailsField.tsx │ │ │ │ │ │ │ │ ├── FrequencyField.tsx │ │ │ │ │ │ │ │ ├── SearchTopicField.tsx │ │ │ │ │ │ │ │ └── styles.module.scss │ │ │ │ │ │ │ └── index.tsx │ │ │ │ │ │ ├── types.ts │ │ │ │ │ │ └── validates/ │ │ │ │ │ │ ├── create.ts │ │ │ │ │ │ ├── index.ts │ │ │ │ │ │ └── update.ts │ │ │ │ │ ├── postOnX/ │ │ │ │ │ │ ├── CustomRenderer/ │ │ │ │ │ │ │ ├── Fields/ │ │ │ │ │ │ │ │ ├── AiModelField.tsx │ │ │ │ │ │ │ │ ├── DetailsField.tsx │ │ │ │ │ │ │ │ └── FrequencyField.tsx │ │ │ │ │ │ │ └── index.tsx │ │ │ │ │ │ ├── types.ts │ │ │ │ │ │ └── validates/ │ │ │ │ │ │ ├── create.ts │ │ │ │ │ │ ├── index.ts │ │ │ │ │ │ └── update.ts │ │ │ │ │ ├── replyOnX/ │ │ │ │ │ │ ├── CustomRenderer/ │ │ │ │ │ │ │ ├── Fields/ │ │ │ │ │ │ │ │ ├── AiModelField.tsx │ │ │ │ │ │ │ │ ├── DetailsField.tsx │ │ │ │ │ │ │ │ └── FrequencyField.tsx │ │ │ │ │ │ │ └── index.tsx │ │ │ │ │ │ ├── types.ts │ │ │ │ │ │ └── validates/ │ │ │ │ │ │ ├── create.ts │ │ │ │ │ │ ├── index.ts │ │ │ │ │ │ └── update.ts │ │ │ │ │ ├── styles.module.scss │ │ │ │ │ └── tradingOnX/ │ │ │ │ │ ├── CustomRenderer/ │ │ │ │ │ │ ├── Fields/ │ │ │ │ │ │ │ ├── AiModelField.tsx │ │ │ │ │ │ │ ├── DetailsField.tsx │ │ │ │ │ │ │ └── FrequencyField.tsx │ │ │ │ │ │ └── index.tsx │ │ │ │ │ ├── types.ts │ │ │ │ │ └── validates/ │ │ │ │ │ ├── create.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ └── update.ts │ │ │ │ ├── chakra-themes.tsx │ │ │ │ ├── components/ │ │ │ │ │ ├── ConnectXContent/ │ │ │ │ │ │ ├── index.tsx │ │ │ │ │ │ └── styles.module.scss │ │ │ │ │ ├── CustomRendererBase/ │ │ │ │ │ │ ├── CustomRendererBaseTitle.tsx │ │ │ │ │ │ └── index.tsx │ │ │ │ │ ├── IconRenderer/ │ │ │ │ │ │ └── index.tsx │ │ │ │ │ ├── LoadingRow/ │ │ │ │ │ │ ├── index.tsx │ │ │ │ │ │ └── styles.module.scss │ │ │ │ │ ├── NumberCounter/ │ │ │ │ │ │ └── index.tsx │ │ │ │ │ ├── ScreenLoading/ │ │ │ │ │ │ ├── index.tsx │ │ │ │ │ │ └── styles.module.scss │ │ │ │ │ ├── SimulateTasks/ │ │ │ │ │ │ ├── ChatSimulate/ │ │ │ │ │ │ │ ├── Chat/ │ │ │ │ │ │ │ │ ├── ChatList.tsx │ │ │ │ │ │ │ │ ├── ChatMessage.tsx │ │ │ │ │ │ │ │ ├── index.tsx │ │ │ │ │ │ │ │ ├── styles.module.scss │ │ │ │ │ │ │ │ └── types.ts │ │ │ │ │ │ │ └── index.tsx │ │ │ │ │ │ ├── EngageSimulate/ │ │ │ │ │ │ │ └── index.tsx │ │ │ │ │ │ ├── PostFollowingSimulate/ │ │ │ │ │ │ │ ├── SearchedFollowing.module.scss │ │ │ │ │ │ │ ├── SearchedFollowing.tsx │ │ │ │ │ │ │ └── index.tsx │ │ │ │ │ │ ├── PostNewsSimulate/ │ │ │ │ │ │ │ ├── SearchedNews.module.scss │ │ │ │ │ │ │ ├── SearchedNews.tsx │ │ │ │ │ │ │ └── index.tsx │ │ │ │ │ │ ├── PostSimulate/ │ │ │ │ │ │ │ └── index.tsx │ │ │ │ │ │ ├── ReplySimulate/ │ │ │ │ │ │ │ └── index.tsx │ │ │ │ │ │ ├── SimulateResult/ │ │ │ │ │ │ │ ├── SimulateResult.module.scss │ │ │ │ │ │ │ └── index.tsx │ │ │ │ │ │ ├── constants.ts │ │ │ │ │ │ ├── hooks/ │ │ │ │ │ │ │ └── useHandleSimulateTasks.ts │ │ │ │ │ │ └── index.tsx │ │ │ │ │ ├── SvgInset/ │ │ │ │ │ │ └── index.tsx │ │ │ │ │ ├── TextRender/ │ │ │ │ │ │ └── index.tsx │ │ │ │ │ ├── ToastMessage/ │ │ │ │ │ │ ├── index.tsx │ │ │ │ │ │ └── styles.module.scss │ │ │ │ │ ├── ToastOverlay/ │ │ │ │ │ │ └── index.tsx │ │ │ │ │ ├── buttons/ │ │ │ │ │ │ ├── ResetButton/ │ │ │ │ │ │ │ └── index.tsx │ │ │ │ │ │ ├── SubmitButton/ │ │ │ │ │ │ │ └── index.tsx │ │ │ │ │ │ └── styles.ts │ │ │ │ │ ├── form/ │ │ │ │ │ │ ├── fields/ │ │ │ │ │ │ │ ├── StudioFieldInputPlaceholder/ │ │ │ │ │ │ │ │ └── index.tsx │ │ │ │ │ │ │ ├── StudioFieldLabel/ │ │ │ │ │ │ │ │ └── index.tsx │ │ │ │ │ │ │ ├── StudioFieldTooltip/ │ │ │ │ │ │ │ │ └── index.tsx │ │ │ │ │ │ │ ├── StudioHorizontalField/ │ │ │ │ │ │ │ │ └── index.tsx │ │ │ │ │ │ │ └── StudioVerticalField/ │ │ │ │ │ │ │ └── index.tsx │ │ │ │ │ │ ├── index.tsx │ │ │ │ │ │ ├── inputs/ │ │ │ │ │ │ │ ├── StudioDatetimeInput/ │ │ │ │ │ │ │ │ ├── index.tsx │ │ │ │ │ │ │ │ └── styles.module.scss │ │ │ │ │ │ │ ├── StudioDropdown/ │ │ │ │ │ │ │ │ └── index.tsx │ │ │ │ │ │ │ ├── StudioInput/ │ │ │ │ │ │ │ │ └── index.tsx │ │ │ │ │ │ │ ├── StudioTextArea/ │ │ │ │ │ │ │ │ └── index.tsx │ │ │ │ │ │ │ └── StudioToggle/ │ │ │ │ │ │ │ ├── index.tsx │ │ │ │ │ │ │ └── styles.module.scss │ │ │ │ │ │ ├── styles.ts │ │ │ │ │ │ └── types.ts │ │ │ │ │ ├── icons/ │ │ │ │ │ │ ├── LaunchIcon.tsx │ │ │ │ │ │ ├── common.tsx │ │ │ │ │ │ └── studio.tsx │ │ │ │ │ └── skeleton/ │ │ │ │ │ ├── SkeletonMessage.tsx │ │ │ │ │ ├── styles.module.scss │ │ │ │ │ └── versions/ │ │ │ │ │ ├── SkeletonAvatar.tsx │ │ │ │ │ ├── SkeletonCustom.tsx │ │ │ │ │ ├── SkeletonLongText.tsx │ │ │ │ │ ├── SkeletonShortText.tsx │ │ │ │ │ ├── constants.ts │ │ │ │ │ └── index.ts │ │ │ │ ├── configs/ │ │ │ │ │ └── index.ts │ │ │ │ ├── constants/ │ │ │ │ │ ├── agent.ts │ │ │ │ │ ├── category-keys.ts │ │ │ │ │ ├── category-option-keys.ts │ │ │ │ │ ├── default-values.ts │ │ │ │ │ ├── mapping.ts │ │ │ │ │ ├── models.ts │ │ │ │ │ ├── networks.ts │ │ │ │ │ ├── option-values.ts │ │ │ │ │ ├── tokens.ts │ │ │ │ │ ├── toolset.ts │ │ │ │ │ └── validates.ts │ │ │ │ ├── hooks/ │ │ │ │ │ ├── useAgentDataFieldChange.ts │ │ │ │ │ ├── useCollections.ts │ │ │ │ │ ├── useDataValidates.ts │ │ │ │ │ ├── useDebounce.ts │ │ │ │ │ ├── useDetectChainIdForMissionModel.ts │ │ │ │ │ ├── useEffectOnce.ts │ │ │ │ │ ├── useGeneratePersonality.ts │ │ │ │ │ ├── useLatest.ts │ │ │ │ │ ├── useThrottle.ts │ │ │ │ │ ├── useThrottleValue.ts │ │ │ │ │ └── useUnmount.ts │ │ │ │ ├── index.css │ │ │ │ ├── index.tsx │ │ │ │ ├── pages/ │ │ │ │ │ ├── Create/ │ │ │ │ │ │ ├── CreateButton/ │ │ │ │ │ │ │ └── index.tsx │ │ │ │ │ │ └── index.tsx │ │ │ │ │ └── Update/ │ │ │ │ │ ├── AutoUpdateSaving/ │ │ │ │ │ │ └── index.tsx │ │ │ │ │ └── index.tsx │ │ │ │ ├── providers/ │ │ │ │ │ └── GlobalDataProvider/ │ │ │ │ │ ├── ModelData.tsx │ │ │ │ │ └── index.tsx │ │ │ │ ├── react-app-env.d.ts │ │ │ │ ├── reportWebVitals.ts │ │ │ │ ├── services/ │ │ │ │ │ ├── agent-database.ts │ │ │ │ │ └── apis/ │ │ │ │ │ ├── agent/ │ │ │ │ │ │ ├── index.tsx │ │ │ │ │ │ └── types.ts │ │ │ │ │ ├── chain/ │ │ │ │ │ │ ├── index.ts │ │ │ │ │ │ └── types.ts │ │ │ │ │ ├── clients.ts │ │ │ │ │ ├── file/ │ │ │ │ │ │ ├── index.ts │ │ │ │ │ │ └── types.ts │ │ │ │ │ ├── model/ │ │ │ │ │ │ ├── index.ts │ │ │ │ │ │ └── types.ts │ │ │ │ │ └── studio/ │ │ │ │ │ ├── index.ts │ │ │ │ │ └── types.ts │ │ │ │ ├── setupTests.ts │ │ │ │ ├── stores/ │ │ │ │ │ ├── useAgentServiceStore.ts │ │ │ │ │ ├── useCommonStore.ts │ │ │ │ │ └── useStudioAgentStore.ts │ │ │ │ ├── types/ │ │ │ │ │ ├── agent.ts │ │ │ │ │ ├── collection.ts │ │ │ │ │ ├── message.ts │ │ │ │ │ └── px2rem.ts │ │ │ │ └── utils/ │ │ │ │ ├── agent.ts │ │ │ │ ├── category.ts │ │ │ │ ├── common.ts │ │ │ │ ├── data.ts │ │ │ │ ├── file.ts │ │ │ │ ├── process.ts │ │ │ │ ├── prompt.ts │ │ │ │ ├── string.ts │ │ │ │ ├── time.ts │ │ │ │ ├── toast.tsx │ │ │ │ ├── twitter.ts │ │ │ │ ├── validate.ts │ │ │ │ └── validator.ts │ │ │ └── tsconfig.json │ │ └── studio-dnd/ │ │ ├── .gitignore │ │ ├── .npmignore │ │ ├── .prettierrc.json │ │ ├── .storybook/ │ │ │ ├── main.ts │ │ │ ├── preview.scss │ │ │ └── preview.ts │ │ ├── .stylelintignore │ │ ├── .stylelintrc.cjs │ │ ├── LICENSE │ │ ├── README.md │ │ ├── eslint.config.js │ │ ├── package.json │ │ ├── rollup.config.mjs │ │ ├── setupTests.ts │ │ ├── src/ │ │ │ ├── enums/ │ │ │ │ └── node-type.ts │ │ │ ├── hooks/ │ │ │ │ ├── useEffectOnce.ts │ │ │ │ ├── useLatest.ts │ │ │ │ ├── useThrottle.ts │ │ │ │ ├── useThrottleValue.ts │ │ │ │ └── useUnmount.ts │ │ │ ├── index.ts │ │ │ ├── modules/ │ │ │ │ ├── Studio/ │ │ │ │ │ ├── Studio.scss │ │ │ │ │ ├── Studio.stories.tsx │ │ │ │ │ ├── Studio.tsx │ │ │ │ │ ├── StudioAgent.stories.tsx │ │ │ │ │ ├── StudioAgentV2.stories.tsx │ │ │ │ │ ├── __mocks__/ │ │ │ │ │ │ ├── agent-categories-v2.tsx │ │ │ │ │ │ ├── agent-categories.tsx │ │ │ │ │ │ ├── agent-data-source-v2.ts │ │ │ │ │ │ ├── agent-data-source.ts │ │ │ │ │ │ ├── categories.ts │ │ │ │ │ │ ├── data-source.ts │ │ │ │ │ │ └── data.ts │ │ │ │ │ ├── components/ │ │ │ │ │ │ ├── Board/ │ │ │ │ │ │ │ ├── Board.scss │ │ │ │ │ │ │ ├── BoardOverlay/ │ │ │ │ │ │ │ │ └── index.tsx │ │ │ │ │ │ │ └── index.tsx │ │ │ │ │ │ ├── CustomEdges/ │ │ │ │ │ │ │ └── EdgeBase/ │ │ │ │ │ │ │ ├── EdgeBase.scss │ │ │ │ │ │ │ └── index.tsx │ │ │ │ │ │ ├── CustomNodes/ │ │ │ │ │ │ │ ├── DraggingPlaceholder/ │ │ │ │ │ │ │ │ └── index.tsx │ │ │ │ │ │ │ └── NodeBase/ │ │ │ │ │ │ │ ├── DraggingFloating/ │ │ │ │ │ │ │ │ └── index.tsx │ │ │ │ │ │ │ ├── LegoRender/ │ │ │ │ │ │ │ │ ├── LegoRender.scss │ │ │ │ │ │ │ │ └── index.tsx │ │ │ │ │ │ │ ├── NodeBase.scss │ │ │ │ │ │ │ ├── NodeBaseChild/ │ │ │ │ │ │ │ │ └── index.tsx │ │ │ │ │ │ │ ├── NodeBaseConnection/ │ │ │ │ │ │ │ │ ├── NodeBaseConnection.scss │ │ │ │ │ │ │ │ └── index.tsx │ │ │ │ │ │ │ ├── NodeBaseReadOnly/ │ │ │ │ │ │ │ │ └── index.tsx │ │ │ │ │ │ │ ├── NodeBaseWrapper/ │ │ │ │ │ │ │ │ ├── NodeBaseWrapper.scss │ │ │ │ │ │ │ │ └── index.tsx │ │ │ │ │ │ │ ├── NodeSingle/ │ │ │ │ │ │ │ │ ├── NodeSingle.scss │ │ │ │ │ │ │ │ └── index.tsx │ │ │ │ │ │ │ ├── NodeStacks/ │ │ │ │ │ │ │ │ ├── NodeStacks.scss │ │ │ │ │ │ │ │ └── index.tsx │ │ │ │ │ │ │ ├── index.tsx │ │ │ │ │ │ │ └── types.ts │ │ │ │ │ │ ├── DataFields/ │ │ │ │ │ │ │ ├── FormRender/ │ │ │ │ │ │ │ │ ├── FormRender.scss │ │ │ │ │ │ │ │ └── index.tsx │ │ │ │ │ │ │ ├── Select/ │ │ │ │ │ │ │ │ ├── Select.scss │ │ │ │ │ │ │ │ └── index.tsx │ │ │ │ │ │ │ ├── TextArea/ │ │ │ │ │ │ │ │ ├── TextArea.scss │ │ │ │ │ │ │ │ └── index.tsx │ │ │ │ │ │ │ └── Textbox/ │ │ │ │ │ │ │ ├── Textbox.scss │ │ │ │ │ │ │ └── index.tsx │ │ │ │ │ │ ├── DataFlow/ │ │ │ │ │ │ │ └── index.tsx │ │ │ │ │ │ ├── DnD/ │ │ │ │ │ │ │ ├── Distribution/ │ │ │ │ │ │ │ │ └── index.tsx │ │ │ │ │ │ │ ├── DndFlow/ │ │ │ │ │ │ │ │ └── index.tsx │ │ │ │ │ │ │ ├── Factory/ │ │ │ │ │ │ │ │ └── index.tsx │ │ │ │ │ │ │ ├── Package/ │ │ │ │ │ │ │ │ ├── Package.scss │ │ │ │ │ │ │ │ └── index.tsx │ │ │ │ │ │ │ ├── Product/ │ │ │ │ │ │ │ │ └── index.tsx │ │ │ │ │ │ │ ├── ProductAddon/ │ │ │ │ │ │ │ │ └── index.tsx │ │ │ │ │ │ │ ├── ProductPlaceholder/ │ │ │ │ │ │ │ │ ├── Package.scss │ │ │ │ │ │ │ │ └── index.tsx │ │ │ │ │ │ │ ├── Source/ │ │ │ │ │ │ │ │ └── index.tsx │ │ │ │ │ │ │ └── base/ │ │ │ │ │ │ │ ├── DragMask/ │ │ │ │ │ │ │ │ └── index.tsx │ │ │ │ │ │ │ ├── Draggable/ │ │ │ │ │ │ │ │ ├── Draggable.scss │ │ │ │ │ │ │ │ └── index.tsx │ │ │ │ │ │ │ ├── NoDraggable/ │ │ │ │ │ │ │ │ ├── NoDraggable.scss │ │ │ │ │ │ │ │ └── index.tsx │ │ │ │ │ │ │ └── StaticDroppable/ │ │ │ │ │ │ │ ├── StaticDroppable.scss │ │ │ │ │ │ │ └── index.tsx │ │ │ │ │ │ ├── EventHandler/ │ │ │ │ │ │ │ └── index.tsx │ │ │ │ │ │ ├── Lego/ │ │ │ │ │ │ │ ├── Lego.scss │ │ │ │ │ │ │ └── index.tsx │ │ │ │ │ │ ├── LegoContent/ │ │ │ │ │ │ │ ├── LegoContent.scss │ │ │ │ │ │ │ └── index.tsx │ │ │ │ │ │ ├── LegoParent/ │ │ │ │ │ │ │ ├── LegoParent.scss │ │ │ │ │ │ │ └── index.tsx │ │ │ │ │ │ ├── Overlay/ │ │ │ │ │ │ │ ├── Overlay.scss │ │ │ │ │ │ │ └── index.tsx │ │ │ │ │ │ ├── Render/ │ │ │ │ │ │ │ ├── ImageRender/ │ │ │ │ │ │ │ │ └── index.tsx │ │ │ │ │ │ │ └── TextRender/ │ │ │ │ │ │ │ └── index.tsx │ │ │ │ │ │ ├── Sidebar/ │ │ │ │ │ │ │ ├── CategoryGroup/ │ │ │ │ │ │ │ │ ├── CategoryGroup.scss │ │ │ │ │ │ │ │ └── index.tsx │ │ │ │ │ │ │ ├── Sidebar.scss │ │ │ │ │ │ │ ├── SidebarOverlay/ │ │ │ │ │ │ │ │ └── index.tsx │ │ │ │ │ │ │ ├── SidebarTab/ │ │ │ │ │ │ │ │ ├── SidebarTab.scss │ │ │ │ │ │ │ │ └── index.tsx │ │ │ │ │ │ │ └── index.tsx │ │ │ │ │ │ ├── icons/ │ │ │ │ │ │ │ ├── common.tsx │ │ │ │ │ │ │ └── lego.tsx │ │ │ │ │ │ ├── index.tsx │ │ │ │ │ │ └── ui/ │ │ │ │ │ │ └── Tooltip/ │ │ │ │ │ │ ├── Tooltip.scss │ │ │ │ │ │ └── index.tsx │ │ │ │ │ ├── constants/ │ │ │ │ │ │ ├── area-class-names.ts │ │ │ │ │ │ ├── color-palettes.ts │ │ │ │ │ │ ├── configs.ts │ │ │ │ │ │ ├── default-values.ts │ │ │ │ │ │ ├── key-map.ts │ │ │ │ │ │ └── time.ts │ │ │ │ │ ├── database/ │ │ │ │ │ │ └── category-color-database.ts │ │ │ │ │ ├── enums/ │ │ │ │ │ │ ├── category.ts │ │ │ │ │ │ ├── index.ts │ │ │ │ │ │ ├── side.ts │ │ │ │ │ │ └── tab.ts │ │ │ │ │ ├── hooks/ │ │ │ │ │ │ ├── useContainerMouse.ts │ │ │ │ │ │ ├── useDndAction.ts │ │ │ │ │ │ ├── useDndInteraction.ts │ │ │ │ │ │ ├── useEdgeSelected.ts │ │ │ │ │ │ ├── useFormFunction.ts │ │ │ │ │ │ ├── useNewStore.ts │ │ │ │ │ │ ├── useNodeSelected.ts │ │ │ │ │ │ └── useStudio.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── stores/ │ │ │ │ │ │ ├── useStudioCategoryStore.ts │ │ │ │ │ │ ├── useStudioConfigStore.ts │ │ │ │ │ │ ├── useStudioDataSourceStore.ts │ │ │ │ │ │ ├── useStudioDataStore.ts │ │ │ │ │ │ ├── useStudioDndStore.ts │ │ │ │ │ │ ├── useStudioFlowStore.ts │ │ │ │ │ │ ├── useStudioFlowViewStore.ts │ │ │ │ │ │ ├── useStudioFormStore.ts │ │ │ │ │ │ └── useStudioStore.ts │ │ │ │ │ ├── types/ │ │ │ │ │ │ ├── base.ts │ │ │ │ │ │ ├── category.ts │ │ │ │ │ │ ├── config.ts │ │ │ │ │ │ ├── data-source.ts │ │ │ │ │ │ ├── dnd.ts │ │ │ │ │ │ ├── graph.ts │ │ │ │ │ │ ├── index.ts │ │ │ │ │ │ └── ui.ts │ │ │ │ │ └── utils/ │ │ │ │ │ ├── array.ts │ │ │ │ │ ├── category.ts │ │ │ │ │ ├── data.ts │ │ │ │ │ ├── edge.ts │ │ │ │ │ ├── node.ts │ │ │ │ │ ├── ui.ts │ │ │ │ │ └── validates.ts │ │ │ │ └── index.ts │ │ │ ├── styles/ │ │ │ │ ├── _reset.scss │ │ │ │ ├── _root.scss │ │ │ │ └── global.scss │ │ │ └── utils/ │ │ │ └── data.ts │ │ ├── tsconfig.json │ │ ├── vite.config.ts │ │ └── vitest.config.ts │ └── tsconfig.json ├── ai-architectures/ │ ├── README.md │ ├── agent-battle/ │ │ ├── .gitignore │ │ ├── Dockerfile │ │ ├── Makefile │ │ ├── README.md │ │ ├── api.http │ │ ├── cmd/ │ │ │ ├── api/ │ │ │ │ ├── module.go │ │ │ │ └── route.go │ │ │ ├── main.go │ │ │ ├── setting/ │ │ │ │ ├── module.go │ │ │ │ └── setting.go │ │ │ └── worker/ │ │ │ ├── module.go │ │ │ └── worker.go │ │ ├── docs/ │ │ │ ├── diagrams/ │ │ │ │ └── userflow.puml │ │ │ ├── docs.go │ │ │ ├── swagger.json │ │ │ └── swagger.yaml │ │ ├── go.mod │ │ ├── go.sum │ │ ├── internal/ │ │ │ ├── adapters/ │ │ │ │ ├── handler/ │ │ │ │ │ └── game/ │ │ │ │ │ └── game_handler.go │ │ │ │ └── repository/ │ │ │ │ └── mongo/ │ │ │ │ ├── game_repo.go │ │ │ │ ├── module.go │ │ │ │ ├── setting_repo.go │ │ │ │ └── worker_repo.go │ │ │ ├── contract/ │ │ │ │ └── erc20/ │ │ │ │ ├── erc20.go │ │ │ │ ├── erc20.json │ │ │ │ └── usecase/ │ │ │ │ ├── usecase.go │ │ │ │ └── usecase_test.go │ │ │ └── core/ │ │ │ ├── middleware/ │ │ │ │ ├── authentication.go │ │ │ │ └── middleware.go │ │ │ ├── model/ │ │ │ │ ├── base.go │ │ │ │ ├── game.go │ │ │ │ ├── setting.go │ │ │ │ └── worker.go │ │ │ ├── port/ │ │ │ │ ├── erc20_port.go │ │ │ │ └── game_port.go │ │ │ ├── service/ │ │ │ │ └── game_usecase/ │ │ │ │ ├── usecase.go │ │ │ │ └── usecase_test.go │ │ │ └── worker/ │ │ │ └── game/ │ │ │ └── worker.go │ │ └── pkg/ │ │ ├── constants/ │ │ │ ├── constants.go │ │ │ └── sort/ │ │ │ └── constant.go │ │ ├── cryptoamount/ │ │ │ ├── cryptoamount.go │ │ │ └── cryptoamount_test.go │ │ ├── drivers/ │ │ │ └── mongodb/ │ │ │ ├── cast/ │ │ │ │ └── cast.go │ │ │ ├── init.go │ │ │ ├── module.go │ │ │ ├── options.go │ │ │ ├── repository.go │ │ │ └── types.go │ │ ├── encrypt/ │ │ │ └── encrypt.go │ │ ├── eth/ │ │ │ └── client.go │ │ ├── fiber/ │ │ │ ├── cache/ │ │ │ │ ├── cache.go │ │ │ │ ├── config.go │ │ │ │ ├── heap.go │ │ │ │ ├── manager.go │ │ │ │ └── manager_msgp.go │ │ │ └── fiberzap/ │ │ │ ├── filberzap.go │ │ │ └── types.go │ │ ├── logger/ │ │ │ └── logger.go │ │ ├── rest/ │ │ │ └── template.go │ │ ├── secret_manager/ │ │ │ └── secret_manager.go │ │ ├── telegram/ │ │ │ └── client.go │ │ └── utils/ │ │ ├── copier.go │ │ ├── crypto.go │ │ ├── fiber_error.go │ │ ├── file.go │ │ ├── html.go │ │ ├── jwt_token.go │ │ ├── mongo.go │ │ ├── password.go │ │ ├── slice.go │ │ ├── string.go │ │ ├── url.go │ │ └── utils.go │ ├── agent-task-handlers/ │ │ ├── .gitignore │ │ ├── .pre-commit-config.yaml │ │ ├── Dockerfile │ │ ├── Makefile │ │ ├── README.md │ │ ├── pyproject.toml │ │ ├── requirements-dev.txt │ │ ├── requirements.txt │ │ ├── scripts/ │ │ │ └── reset_redis.sh │ │ ├── server.py │ │ ├── tests/ │ │ │ ├── __init__.py │ │ │ └── unit/ │ │ │ ├── __init__.py │ │ │ ├── mock/ │ │ │ │ ├── __init__.py │ │ │ │ ├── api_twitter.py │ │ │ │ ├── kn_base.py │ │ │ │ ├── llm.py │ │ │ │ ├── postprocess.py │ │ │ │ ├── sleep.py │ │ │ │ └── twin_agent.py │ │ │ ├── test_post_v2.py │ │ │ └── utils.py │ │ └── x_content/ │ │ ├── __init__.py │ │ ├── api.py │ │ ├── cache/ │ │ │ ├── __init__.py │ │ │ ├── base_state_handler.py │ │ │ ├── chat_request_state_handler.py │ │ │ ├── entity_cache.py │ │ │ └── mission_state_handler.py │ │ ├── constants/ │ │ │ ├── __init__.py │ │ │ ├── analytic.py │ │ │ ├── chain.py │ │ │ ├── game.py │ │ │ ├── main.py │ │ │ ├── models.py │ │ │ ├── redis.py │ │ │ ├── telegram.py │ │ │ ├── trading.py │ │ │ ├── twin.py │ │ │ └── utils.py │ │ ├── legacy_services/ │ │ │ ├── __init__.py │ │ │ ├── post.py │ │ │ ├── twin.py │ │ │ └── utils.py │ │ ├── llm/ │ │ │ ├── __init__.py │ │ │ ├── base.py │ │ │ ├── eternal_ai.py │ │ │ ├── local.py │ │ │ ├── time_estimation.py │ │ │ └── utils.py │ │ ├── models.py │ │ ├── service.py │ │ ├── services/ │ │ │ ├── __init__.py │ │ │ ├── chat/ │ │ │ │ ├── __init__.py │ │ │ │ ├── chat_langgraph.py │ │ │ │ ├── memory.py │ │ │ │ ├── service.py │ │ │ │ └── tools.py │ │ │ └── fact/ │ │ │ ├── __init__.py │ │ │ ├── fact_check.py │ │ │ ├── run_fact_check.py │ │ │ └── service.py │ │ ├── tasks/ │ │ │ ├── __init__.py │ │ │ ├── _legacy/ │ │ │ │ ├── __init__.py │ │ │ │ ├── post_search.py │ │ │ │ ├── quote_tweet.py │ │ │ │ └── shadow_reply.py │ │ │ ├── base.py │ │ │ ├── game_agent/ │ │ │ │ ├── __init__.py │ │ │ │ ├── create_gamev2.py │ │ │ │ ├── judge_gamev2.py │ │ │ │ ├── prompts.py │ │ │ │ └── subtasks/ │ │ │ │ ├── __init__.py │ │ │ │ └── reply/ │ │ │ │ ├── __init__.py │ │ │ │ └── reply_create_game.py │ │ │ ├── others.py │ │ │ ├── reply_base.py │ │ │ ├── reply_subtask_base.py │ │ │ ├── social_agent/ │ │ │ │ ├── __init__.py │ │ │ │ ├── chat.py │ │ │ │ ├── chat_v2.py │ │ │ │ ├── post_v2.py │ │ │ │ ├── post_v3.py │ │ │ │ ├── react_agent.py │ │ │ │ ├── react_agent_for_trading.py │ │ │ │ ├── react_agent_use_deepseek_r1.py │ │ │ │ ├── social_reply.py │ │ │ │ └── subtasks/ │ │ │ │ ├── __init__.py │ │ │ │ └── reply/ │ │ │ │ ├── __init__.py │ │ │ │ ├── reply_game.py │ │ │ │ └── reply_regular.py │ │ │ └── utils.py │ │ ├── toolcall/ │ │ │ ├── __init__.py │ │ │ ├── dynamic_toolcall.py │ │ │ ├── toolcall.py │ │ │ ├── utils.py │ │ │ └── wrapped_external_apis.py │ │ ├── utils.py │ │ ├── verifications.py │ │ └── wrappers/ │ │ ├── __init__.py │ │ ├── analytic/ │ │ │ ├── __init__.py │ │ │ └── custom.py │ │ ├── api/ │ │ │ ├── __init__.py │ │ │ └── twitter_v2/ │ │ │ ├── __init__.py │ │ │ ├── main.py │ │ │ └── models/ │ │ │ ├── __init__.py │ │ │ ├── objects.py │ │ │ └── response.py │ │ ├── assets/ │ │ │ └── twitter_accounts.json │ │ ├── bing_search.py │ │ ├── browsing.py │ │ ├── conversation.py │ │ ├── game.py │ │ ├── gcs.py │ │ ├── google_search.py │ │ ├── knowledge_base/ │ │ │ ├── __init__.py │ │ │ ├── base.py │ │ │ ├── eternals_kb.py │ │ │ └── local.py │ │ ├── llm_tasks.py │ │ ├── log_decorators.py │ │ ├── magic.py │ │ ├── postprocess.py │ │ ├── rag_search.py │ │ ├── redis_wrapper.py │ │ ├── telegram.py │ │ ├── trading.py │ │ ├── tweet_specialty.py │ │ ├── twin_agent.py │ │ └── vision_tasks.py │ ├── docling-server/ │ │ ├── Dockerfile │ │ ├── requirements.txt │ │ └── server.py │ ├── knowledge-base/ │ │ ├── .gitignore │ │ ├── Dockerfile │ │ ├── README.md │ │ ├── app/ │ │ │ ├── __init__.py │ │ │ ├── api.py │ │ │ ├── constants.py │ │ │ ├── embedding.py │ │ │ ├── graph_handlers.py │ │ │ ├── handlers.py │ │ │ ├── io.py │ │ │ ├── models.py │ │ │ ├── registry.py │ │ │ ├── state.py │ │ │ ├── utils.py │ │ │ ├── verifications.py │ │ │ └── wrappers/ │ │ │ ├── __init__.py │ │ │ ├── log_decorators.py │ │ │ ├── milvus_kit.py │ │ │ ├── redis_kit.py │ │ │ └── telegram_kit.py │ │ ├── docker-compose.yml │ │ ├── example.env │ │ ├── milvus-docker-compose.yml │ │ ├── models-docker-compose.yml │ │ ├── requirements.txt │ │ ├── scripts/ │ │ │ ├── export_collection_data.py │ │ │ ├── reset_milvus.sh │ │ │ └── reset_redis.sh │ │ └── server.py │ └── launchpad-agent/ │ ├── .gitignore │ ├── Dockerfile │ ├── LICENSE │ ├── README.md │ ├── app/ │ │ ├── __init__.py │ │ ├── agents/ │ │ │ ├── __init__.py │ │ │ ├── investor_analyzer.py │ │ │ ├── mcp_agent.py │ │ │ ├── onboarding_agent.py │ │ │ ├── project_identifier.py │ │ │ └── tweet_classifier.py │ │ ├── apis.py │ │ ├── config.py │ │ ├── handlers.py │ │ ├── mcps/ │ │ │ ├── __init__.py │ │ │ ├── launchpad_mcp.py │ │ │ ├── twitter_mcp.py │ │ │ └── utils.py │ │ ├── schemas/ │ │ │ ├── __init__.py │ │ │ ├── agents.py/ │ │ │ │ └── receptionist_models.py │ │ │ ├── commons.py │ │ │ ├── evaluation.py │ │ │ ├── evaluation_state.py │ │ │ ├── launchpad.py │ │ │ ├── services.py │ │ │ ├── twitter.py │ │ │ └── utils.py │ │ └── utils/ │ │ ├── __init__.py │ │ ├── caching.py │ │ ├── concurrency.py │ │ ├── launchpad_api_calls.py │ │ ├── lm.py │ │ ├── logging.py │ │ ├── misc.py │ │ ├── mongodb.py │ │ └── twitter_api_calls.py │ ├── requirements.base.txt │ ├── requirements.txt │ └── server.py ├── ai-kernel/ │ ├── .gitignore │ ├── .mocharc.json │ ├── compiler_config.json │ ├── contracts/ │ │ ├── GPUManager.sol │ │ ├── HybridModel.sol │ │ ├── ModelCollection.sol │ │ ├── ModelLoadBalancer.sol │ │ ├── PromptScheduler.sol │ │ ├── StakingHub.sol │ │ ├── Treasury.sol │ │ ├── WorkerHub.sol │ │ ├── interfaces/ │ │ │ ├── ICallBack.sol │ │ │ ├── IGPUManager.sol │ │ │ ├── IHybridModel.sol │ │ │ ├── IInferable.sol │ │ │ ├── IModel.sol │ │ │ ├── IModelCollection.sol │ │ │ ├── IModelLoadBalancer.sol │ │ │ ├── IScheduler.sol │ │ │ ├── IStakingHub.sol │ │ │ ├── ISystemPromptManager.sol │ │ │ └── IWorkerHub.sol │ │ ├── library/ │ │ │ ├── Random.sol │ │ │ ├── Set.sol │ │ │ └── TransferHelper.sol │ │ ├── storages/ │ │ │ ├── GPUManagerStorage.sol │ │ │ ├── HybridModelStorage.sol │ │ │ ├── ModelCollectionStorage.sol │ │ │ ├── ModelLoadBalancerStorage.sol │ │ │ ├── PromptSchedulerStorage.sol │ │ │ ├── StakingHubStorage.sol │ │ │ └── WorkerHubStorage.sol │ │ ├── tokens/ │ │ │ ├── DAOToken.sol │ │ │ └── IDAOToken.sol │ │ └── wEAI.sol │ ├── foundry.toml │ ├── hardhat.config.ts │ ├── mocha-report.json │ ├── package.json │ ├── remappings.txt │ └── tsconfig.json ├── blockchains/ │ ├── README.md │ ├── arbitrum/ │ │ └── README.md │ ├── base/ │ │ └── README.md │ ├── bitcoin/ │ │ └── README.md │ ├── ethereum/ │ │ └── README.md │ └── solana/ │ └── README.md ├── compose.yaml ├── decentralized-agents/ │ ├── .gitignore │ ├── .mocharc.json │ ├── README.md │ ├── characters/ │ │ ├── donald_trump.txt │ │ ├── elon_musk.txt │ │ ├── lex_fridman-by-ben.txt │ │ ├── mr-robot-by-hope.txt │ │ ├── naruto_fan.txt │ │ └── pikachu.txt │ ├── compiler_config.json │ ├── contracts/ │ │ ├── standards/ │ │ │ ├── AI721.sol │ │ │ ├── interfaces/ │ │ │ │ ├── IAI721.sol │ │ │ │ ├── IAI721Errors.sol │ │ │ │ └── IBase.sol │ │ │ ├── llm-agent/ │ │ │ │ ├── ERC20LLMAgent.sol │ │ │ │ ├── ICommonAgent.sol │ │ │ │ ├── ILLMAgent.sol │ │ │ │ ├── LLMAgent.sol │ │ │ │ └── interfaces/ │ │ │ │ ├── IHybridModel.sol │ │ │ │ ├── IInferable.sol │ │ │ │ ├── IModel.sol │ │ │ │ └── IPromptScheduler.sol │ │ │ ├── real-world-agent/ │ │ │ │ ├── ERC20RealWorldAgent.sol │ │ │ │ ├── IRealWorldAgent.sol │ │ │ │ └── RealWorldAgent.sol │ │ │ └── utility-agent/ │ │ │ ├── ERC20UtilityAgent.sol │ │ │ ├── File.sol │ │ │ ├── ICommonAgent.sol │ │ │ ├── IFileStore.sol │ │ │ ├── IUtilityAgent.sol │ │ │ └── UtilityAgent.sol │ │ └── standards-upgradeable/ │ │ ├── AI721Upgradeable.sol │ │ └── interfaces/ │ │ ├── IAI721Upgradeable.sol │ │ └── IBase.sol │ ├── foundry.toml │ ├── hardhat.config.ts │ ├── mocha-report.json │ ├── package.json │ ├── remappings.txt │ └── tsconfig.json ├── decentralized-compute/ │ ├── README.md │ ├── cluster/ │ │ ├── .dockerignore │ │ ├── .gitignore │ │ ├── Dockerfile │ │ ├── Dockerfile.Arm │ │ ├── Dockerfile.Hardhat │ │ ├── Dockerfile.build │ │ ├── Makefile │ │ ├── README.md │ │ ├── _hardhat.config.ts │ │ ├── build.sh │ │ ├── chains/ │ │ │ ├── abstract_testnet/ │ │ │ │ ├── chain.go │ │ │ │ ├── cluster.go │ │ │ │ └── staking.go │ │ │ ├── base/ │ │ │ │ ├── chain.go │ │ │ │ └── staking.go │ │ │ ├── base_new/ │ │ │ │ ├── chain.go │ │ │ │ ├── cluster.go │ │ │ │ └── staking.go │ │ │ ├── common/ │ │ │ │ └── common.go │ │ │ └── local/ │ │ │ ├── chain.go │ │ │ ├── cluster.go │ │ │ └── staking.go │ │ ├── cmd/ │ │ │ ├── api/ │ │ │ │ └── main.go │ │ │ └── miner/ │ │ │ └── main.go │ │ ├── config/ │ │ │ └── configs.go │ │ ├── docker-compose-arm-local.yml │ │ ├── docker-compose-arm.yml │ │ ├── docker-compose-local.yml │ │ ├── docker-compose.yml │ │ ├── download_model_linux.sh │ │ ├── download_model_macos.sh │ │ ├── entrypoint.sh │ │ ├── go.mod │ │ ├── go.sum │ │ ├── hardhat.config.js │ │ ├── internal/ │ │ │ ├── contracts/ │ │ │ │ ├── erc20/ │ │ │ │ │ ├── erc20.go │ │ │ │ │ └── erc20.json │ │ │ │ ├── gpu_manager/ │ │ │ │ │ ├── gpu_manager.go │ │ │ │ │ └── gpu_manager.json │ │ │ │ ├── load_balancer/ │ │ │ │ │ ├── load_balancer.go │ │ │ │ │ └── load_balancer.json │ │ │ │ ├── model_collection/ │ │ │ │ │ ├── model_collection.go │ │ │ │ │ └── model_collection.json │ │ │ │ ├── prompt_scheduler/ │ │ │ │ │ ├── prompt_scheduler.go │ │ │ │ │ └── prompt_scheduler.json │ │ │ │ ├── proxy/ │ │ │ │ │ ├── proxy.go │ │ │ │ │ └── proxy.json │ │ │ │ ├── staking_hub/ │ │ │ │ │ ├── staking_hub.go │ │ │ │ │ └── staking_hub.json │ │ │ │ ├── w_eai/ │ │ │ │ │ ├── w_eai.go │ │ │ │ │ └── w_eai.json │ │ │ │ └── worker_hub/ │ │ │ │ ├── worker_hub.go │ │ │ │ └── worker_hub.json │ │ │ ├── delivery/ │ │ │ │ ├── cmd/ │ │ │ │ │ ├── app.go │ │ │ │ │ └── handler.go │ │ │ │ └── http/ │ │ │ │ └── app.go │ │ │ ├── factory/ │ │ │ │ └── factory.go │ │ │ ├── model/ │ │ │ │ ├── const.go │ │ │ │ ├── local_chain.go │ │ │ │ ├── metadata.go │ │ │ │ └── model.go │ │ │ ├── port/ │ │ │ │ └── port.go │ │ │ └── usecase/ │ │ │ ├── cmd_cluster.go │ │ │ ├── cmd_local_chain.go │ │ │ └── miner.go │ │ ├── package.json │ │ ├── pkg/ │ │ │ ├── commons.go │ │ │ ├── const.go │ │ │ ├── eth/ │ │ │ │ ├── client.go │ │ │ │ └── proxy.go │ │ │ ├── googlecloud/ │ │ │ │ ├── gcs.go │ │ │ │ └── util.go │ │ │ ├── httpRequest.go │ │ │ ├── lighthouse/ │ │ │ │ ├── Kvasir.txt │ │ │ │ ├── lighthouse.go │ │ │ │ └── lighthouse_test.go │ │ │ ├── logger/ │ │ │ │ └── logger.go │ │ │ └── utils/ │ │ │ └── copier.go │ │ ├── setup-eternal.sh │ │ ├── setup-miner-manual.md │ │ ├── setup-ollam.md │ │ ├── sol/ │ │ │ ├── .gitignore │ │ │ ├── .gitmodules │ │ │ ├── .mocharc.json │ │ │ ├── README.md │ │ │ ├── compiler_config.json │ │ │ ├── contracts/ │ │ │ │ ├── Dagent721.sol │ │ │ │ ├── GPUManager.sol │ │ │ │ ├── ModelCollection.sol │ │ │ │ ├── ModelLoadBalancer.sol │ │ │ │ ├── PromptScheduler.sol │ │ │ │ ├── Treasury.sol │ │ │ │ ├── interfaces/ │ │ │ │ │ ├── ICallBack.sol │ │ │ │ │ ├── IGPUManager.sol │ │ │ │ │ ├── IInferable.sol │ │ │ │ │ ├── IModel.sol │ │ │ │ │ ├── IModelCollection.sol │ │ │ │ │ ├── IModelLoadBalancer.sol │ │ │ │ │ ├── IScheduler.sol │ │ │ │ │ └── ISystemPromptManager.sol │ │ │ │ ├── library/ │ │ │ │ │ ├── Random.sol │ │ │ │ │ ├── Set.sol │ │ │ │ │ └── TransferHelper.sol │ │ │ │ ├── standardUpgradeable/ │ │ │ │ │ ├── AI20Upgradeable.sol │ │ │ │ │ ├── AI721Upgradeable.sol │ │ │ │ │ └── interfaces/ │ │ │ │ │ ├── IAI20Upgradeable.sol │ │ │ │ │ ├── IAI721Upgradeable.sol │ │ │ │ │ └── IBase.sol │ │ │ │ ├── standards/ │ │ │ │ │ ├── AI20.sol │ │ │ │ │ ├── AI721.sol │ │ │ │ │ └── interfaces/ │ │ │ │ │ ├── IAI20.sol │ │ │ │ │ ├── IAI721.sol │ │ │ │ │ └── IBase.sol │ │ │ │ ├── storages/ │ │ │ │ │ ├── GPUManagerStorage.sol │ │ │ │ │ ├── ModelCollectionStorage.sol │ │ │ │ │ ├── ModelLoadBalancerStorage.sol │ │ │ │ │ └── PromptSchedulerStorage.sol │ │ │ │ └── wEAI.sol │ │ │ ├── deployedAddressesV2.json │ │ │ ├── foundry.toml │ │ │ ├── hardhat.config.ts │ │ │ ├── mocha-report.json │ │ │ ├── package.json │ │ │ ├── remappings.txt │ │ │ ├── scripts/ │ │ │ │ ├── auto_deploy.ts │ │ │ │ ├── library/ │ │ │ │ │ ├── lib.ts │ │ │ │ │ └── utils.ts │ │ │ │ ├── registerMiners.ts │ │ │ │ ├── tasks/ │ │ │ │ │ ├── control.task.ts │ │ │ │ │ └── wallet.task.ts │ │ │ │ ├── updateHybridModelMetadata.ts │ │ │ │ └── utils.ts │ │ │ ├── tests/ │ │ │ │ ├── address.seed.ts │ │ │ │ └── refactor/ │ │ │ │ ├── helpers.ts │ │ │ │ └── refactor.test.ts │ │ │ └── tsconfig.json │ │ └── version.txt │ ├── core/ │ │ ├── contracts/ │ │ │ ├── erc20/ │ │ │ │ ├── erc20.go │ │ │ │ └── erc20.json │ │ │ ├── gpu_manager/ │ │ │ │ ├── gpu_manager.go │ │ │ │ └── gpu_manager.json │ │ │ ├── load_balancer/ │ │ │ │ ├── load_balancer.go │ │ │ │ └── load_balancer.json │ │ │ ├── model_collection/ │ │ │ │ ├── model_collection.go │ │ │ │ └── model_collection.json │ │ │ ├── model_collection_v1/ │ │ │ │ ├── model_collection_v1.go │ │ │ │ └── model_collection_v1.json │ │ │ ├── prompt_scheduler/ │ │ │ │ ├── prompt_scheduler.go │ │ │ │ └── prompt_scheduler.json │ │ │ ├── proxy/ │ │ │ │ ├── proxy.go │ │ │ │ └── proxy.json │ │ │ ├── staking_hub/ │ │ │ │ ├── staking_hub.go │ │ │ │ └── staking_hub.json │ │ │ ├── v1/ │ │ │ │ ├── hybrid_model/ │ │ │ │ │ ├── hybrid_model.go │ │ │ │ │ ├── hybrid_model.json │ │ │ │ │ └── hybrid_model_abi.json │ │ │ │ ├── staking_hub/ │ │ │ │ │ ├── staking_hub.go │ │ │ │ │ ├── staking_hub.json │ │ │ │ │ └── staking_hub_abi.json │ │ │ │ └── worker_hub/ │ │ │ │ ├── worker_hub.go │ │ │ │ ├── worker_hub.json │ │ │ │ └── worker_hub_abi.json │ │ │ ├── w_eai/ │ │ │ │ ├── w_eai.go │ │ │ │ └── w_eai.json │ │ │ └── worker_hub/ │ │ │ ├── worker_hub.go │ │ │ └── worker_hub.json │ │ ├── go.mod │ │ └── go.sum │ ├── miner/ │ │ ├── .gitignore │ │ ├── chains/ │ │ │ ├── base/ │ │ │ │ ├── chain.go │ │ │ │ └── staking.go │ │ │ ├── base_new/ │ │ │ │ ├── chain.go │ │ │ │ ├── cluster.go │ │ │ │ └── staking.go │ │ │ └── common/ │ │ │ └── common.go │ │ ├── cmd/ │ │ │ ├── api/ │ │ │ │ ├── main.go │ │ │ │ └── main_test.go │ │ │ └── miner/ │ │ │ ├── main.go │ │ │ └── main_test.go │ │ ├── config/ │ │ │ └── configs.go │ │ ├── go.mod │ │ ├── go.sum │ │ ├── install.sh │ │ ├── internal/ │ │ │ ├── delivery/ │ │ │ │ └── http/ │ │ │ │ ├── app.go │ │ │ │ ├── commons.go │ │ │ │ ├── response/ │ │ │ │ │ └── response.go │ │ │ │ └── routers.go │ │ │ ├── factory/ │ │ │ │ └── factory.go │ │ │ ├── model/ │ │ │ │ ├── const.go │ │ │ │ ├── infomation.go │ │ │ │ ├── local_chain.go │ │ │ │ ├── metadata.go │ │ │ │ └── model.go │ │ │ ├── port/ │ │ │ │ └── port.go │ │ │ └── usecase/ │ │ │ ├── api.go │ │ │ ├── miner.go │ │ │ └── miner_test.go │ │ ├── miner.sh │ │ └── pkg/ │ │ ├── commons.go │ │ ├── const.go │ │ ├── db/ │ │ │ └── sqlite/ │ │ │ └── sqlite.go │ │ ├── eth/ │ │ │ ├── client.go │ │ │ └── proxy.go │ │ ├── googlecloud/ │ │ │ ├── gcs.go │ │ │ └── util.go │ │ ├── httpRequest.go │ │ ├── lighthouse/ │ │ │ ├── Kvasir.txt │ │ │ ├── lighthouse.go │ │ │ └── lighthouse_test.go │ │ ├── logger/ │ │ │ └── logger.go │ │ ├── utils/ │ │ │ └── copier.go │ │ └── zip_hf_model_to_light_house/ │ │ └── zip_hf_model.go │ ├── models/ │ │ ├── Modelfile │ │ ├── download_model_linux.sh │ │ └── download_model_macos.sh │ ├── node/ │ │ ├── Dockerfile │ │ ├── Dockerfile.Arm │ │ ├── Makefile │ │ ├── README.md │ │ ├── build-arm.Dockerfile │ │ ├── build-arm.sh │ │ ├── build.Dockerfile │ │ ├── build.sh │ │ ├── chains/ │ │ │ ├── abstract_testnet/ │ │ │ │ ├── chain.go │ │ │ │ └── staking.go │ │ │ ├── base/ │ │ │ │ ├── chain.go │ │ │ │ └── staking.go │ │ │ ├── base_new/ │ │ │ │ ├── chain.go │ │ │ │ └── staking.go │ │ │ └── common/ │ │ │ └── common.go │ │ ├── config/ │ │ │ └── configs.go │ │ ├── docker-compose-arm.yml │ │ ├── docker-compose.yml │ │ ├── entrypoint.sh │ │ ├── go.mod │ │ ├── go.sum │ │ ├── internal/ │ │ │ ├── contracts/ │ │ │ │ ├── erc20/ │ │ │ │ │ ├── erc20.go │ │ │ │ │ └── erc20.json │ │ │ │ ├── gpu_manager/ │ │ │ │ │ ├── gpu_manager.go │ │ │ │ │ └── gpu_manager.json │ │ │ │ ├── prompt_scheduler/ │ │ │ │ │ ├── prompt_scheduler.go │ │ │ │ │ └── prompt_scheduler.json │ │ │ │ ├── staking_hub/ │ │ │ │ │ ├── staking_hub.go │ │ │ │ │ └── staking_hub.json │ │ │ │ └── worker_hub/ │ │ │ │ ├── worker_hub.go │ │ │ │ └── worker_hub.json │ │ │ ├── model/ │ │ │ │ ├── const.go │ │ │ │ └── model.go │ │ │ ├── port/ │ │ │ │ └── port.go │ │ │ └── usecase/ │ │ │ └── task_watcher.go │ │ ├── main.go │ │ ├── pkg/ │ │ │ ├── commons.go │ │ │ ├── const.go │ │ │ ├── eth/ │ │ │ │ └── client.go │ │ │ ├── googlecloud/ │ │ │ │ ├── gcs.go │ │ │ │ └── util.go │ │ │ ├── httpRequest.go │ │ │ ├── lighthouse/ │ │ │ │ ├── lighthouse.go │ │ │ │ └── lighthouse_test.go │ │ │ ├── logger/ │ │ │ │ └── logger.go │ │ │ ├── miner/ │ │ │ │ └── factory.go │ │ │ └── utils/ │ │ │ └── copier.go │ │ ├── setup-eternal.sh │ │ └── setup-ollam.md │ └── worker-hub/ │ ├── .dockerignore │ ├── .gitignore │ ├── Dockerfile │ ├── Dockerfile-api │ ├── Dockerfile-api.Arm │ ├── Dockerfile.Arm │ ├── Dockerfile.Hardhat │ ├── Dockerfile.build │ ├── Makefile │ ├── README.md │ ├── _hardhat.config.ts │ ├── build.sh │ ├── chains/ │ │ ├── abstract_testnet/ │ │ │ ├── chain.go │ │ │ ├── cluster.go │ │ │ └── staking.go │ │ ├── base/ │ │ │ ├── chain.go │ │ │ └── staking.go │ │ ├── base_new/ │ │ │ ├── chain.go │ │ │ ├── cluster.go │ │ │ └── staking.go │ │ ├── common/ │ │ │ └── common.go │ │ ├── local/ │ │ │ ├── chain.go │ │ │ ├── cluster.go │ │ │ └── staking.go │ │ └── local_v1/ │ │ ├── chain.go │ │ └── staking.go │ ├── cmd/ │ │ ├── api/ │ │ │ └── main.go │ │ ├── cli/ │ │ │ └── main.go │ │ ├── cli-fast/ │ │ │ └── main.go │ │ ├── download_model/ │ │ │ └── main.go │ │ └── miner/ │ │ └── main.go │ ├── config/ │ │ └── configs.go │ ├── docker-compose-arm-local.yml │ ├── docker-compose-arm.yml │ ├── docker-compose-local.yml │ ├── docker-compose.yml │ ├── download_model_linux.sh │ ├── download_model_macos.sh │ ├── entrypoint.sh │ ├── go.mod │ ├── go.sum │ ├── hardhat.config.js │ ├── internal/ │ │ ├── contracts/ │ │ │ ├── erc20/ │ │ │ │ ├── erc20.go │ │ │ │ └── erc20.json │ │ │ ├── gpu_manager/ │ │ │ │ ├── gpu_manager.go │ │ │ │ └── gpu_manager.json │ │ │ ├── load_balancer/ │ │ │ │ ├── load_balancer.go │ │ │ │ └── load_balancer.json │ │ │ ├── model_collection/ │ │ │ │ ├── model_collection.go │ │ │ │ └── model_collection.json │ │ │ ├── model_collection_v1/ │ │ │ │ ├── model_collection_v1.go │ │ │ │ └── model_collection_v1.json │ │ │ ├── prompt_scheduler/ │ │ │ │ ├── prompt_scheduler.go │ │ │ │ └── prompt_scheduler.json │ │ │ ├── proxy/ │ │ │ │ ├── proxy.go │ │ │ │ └── proxy.json │ │ │ ├── staking_hub/ │ │ │ │ ├── staking_hub.go │ │ │ │ └── staking_hub.json │ │ │ ├── v1/ │ │ │ │ ├── hybrid_model/ │ │ │ │ │ ├── hybrid_model.go │ │ │ │ │ ├── hybrid_model.json │ │ │ │ │ └── hybrid_model_abi.json │ │ │ │ ├── staking_hub/ │ │ │ │ │ ├── staking_hub.go │ │ │ │ │ ├── staking_hub.json │ │ │ │ │ └── staking_hub_abi.json │ │ │ │ └── worker_hub/ │ │ │ │ ├── worker_hub.go │ │ │ │ ├── worker_hub.json │ │ │ │ └── worker_hub_abi.json │ │ │ ├── w_eai/ │ │ │ │ ├── w_eai.go │ │ │ │ └── w_eai.json │ │ │ └── worker_hub/ │ │ │ ├── worker_hub.go │ │ │ └── worker_hub.json │ │ ├── delivery/ │ │ │ ├── cmd/ │ │ │ │ ├── app.go │ │ │ │ └── handler.go │ │ │ └── http/ │ │ │ ├── app.go │ │ │ └── response/ │ │ │ └── response.go │ │ ├── factory/ │ │ │ ├── factory.go │ │ │ └── local_chain_factory.go │ │ ├── model/ │ │ │ ├── const.go │ │ │ ├── local_chain.go │ │ │ ├── metadata.go │ │ │ └── model.go │ │ ├── port/ │ │ │ └── port.go │ │ └── usecase/ │ │ ├── api_local_chain_v1.go │ │ ├── cmd_cluster.go │ │ ├── cmd_local_chain_v1.go │ │ ├── cmd_local_chain_v2.go │ │ └── miner.go │ ├── package.json │ ├── pkg/ │ │ ├── commons.go │ │ ├── const.go │ │ ├── eth/ │ │ │ ├── client.go │ │ │ └── proxy.go │ │ ├── googlecloud/ │ │ │ ├── gcs.go │ │ │ └── util.go │ │ ├── httpRequest.go │ │ ├── lighthouse/ │ │ │ ├── Kvasir.txt │ │ │ ├── lighthouse.go │ │ │ └── lighthouse_test.go │ │ ├── logger/ │ │ │ └── logger.go │ │ ├── utils/ │ │ │ └── copier.go │ │ └── zip_hf_model_to_light_house/ │ │ └── zip_hf_model.go │ ├── setup-eternal.sh │ ├── setup-miner-manual.md │ ├── setup-ollama.md │ ├── sol/ │ │ ├── smart-contract-v1/ │ │ │ ├── .gitignore │ │ │ ├── .gitmodules │ │ │ ├── README.md │ │ │ ├── contracts/ │ │ │ │ ├── AI721.sol │ │ │ │ ├── HybridModel.sol │ │ │ │ ├── ModelCollection.sol │ │ │ │ ├── StakingHub.sol │ │ │ │ ├── Treasury.sol │ │ │ │ ├── WorkerHub.sol │ │ │ │ ├── interfaces/ │ │ │ │ │ ├── IAI721.sol │ │ │ │ │ ├── ICallBack.sol │ │ │ │ │ ├── IHybridModel.sol │ │ │ │ │ ├── IInferable.sol │ │ │ │ │ ├── IModel.sol │ │ │ │ │ ├── IModelCollection.sol │ │ │ │ │ ├── IStakingHub.sol │ │ │ │ │ └── IWorkerHub.sol │ │ │ │ ├── library/ │ │ │ │ │ ├── Random.sol │ │ │ │ │ ├── Set.sol │ │ │ │ │ └── TransferHelper.sol │ │ │ │ ├── storages/ │ │ │ │ │ ├── AI721Storage.sol │ │ │ │ │ ├── HybridModelStorage.sol │ │ │ │ │ ├── ModelCollectionStorage.sol │ │ │ │ │ ├── StakingHubStorage.sol │ │ │ │ │ └── WorkerHubStorage.sol │ │ │ │ ├── tokens/ │ │ │ │ │ ├── DAOToken.sol │ │ │ │ │ └── IDAOToken.sol │ │ │ │ └── wEAI.sol │ │ │ ├── deployedAddresses.json │ │ │ ├── hardhat.config.ts │ │ │ ├── package.json │ │ │ ├── scripts/ │ │ │ │ ├── autoDeploy.ts │ │ │ │ └── library/ │ │ │ │ ├── lib.ts │ │ │ │ └── utils.ts │ │ │ └── tsconfig.json │ │ └── smart-contract-v2/ │ │ ├── .gitignore │ │ ├── .gitmodules │ │ ├── .mocharc.json │ │ ├── README.md │ │ ├── compiler_config.json │ │ ├── contracts/ │ │ │ ├── Dagent721.sol │ │ │ ├── GPUManager.sol │ │ │ ├── ModelCollection.sol │ │ │ ├── ModelLoadBalancer.sol │ │ │ ├── PromptScheduler.sol │ │ │ ├── Treasury.sol │ │ │ ├── interfaces/ │ │ │ │ ├── ICallBack.sol │ │ │ │ ├── IGPUManager.sol │ │ │ │ ├── IInferable.sol │ │ │ │ ├── IModel.sol │ │ │ │ ├── IModelCollection.sol │ │ │ │ ├── IModelLoadBalancer.sol │ │ │ │ ├── IScheduler.sol │ │ │ │ └── ISystemPromptManager.sol │ │ │ ├── library/ │ │ │ │ ├── Random.sol │ │ │ │ ├── Set.sol │ │ │ │ └── TransferHelper.sol │ │ │ ├── standardUpgradeable/ │ │ │ │ ├── AI20Upgradeable.sol │ │ │ │ ├── AI721Upgradeable.sol │ │ │ │ └── interfaces/ │ │ │ │ ├── IAI20Upgradeable.sol │ │ │ │ ├── IAI721Upgradeable.sol │ │ │ │ └── IBase.sol │ │ │ ├── standards/ │ │ │ │ ├── AI20.sol │ │ │ │ ├── AI721.sol │ │ │ │ └── interfaces/ │ │ │ │ ├── IAI20.sol │ │ │ │ ├── IAI721.sol │ │ │ │ └── IBase.sol │ │ │ ├── storages/ │ │ │ │ ├── GPUManagerStorage.sol │ │ │ │ ├── ModelCollectionStorage.sol │ │ │ │ ├── ModelLoadBalancerStorage.sol │ │ │ │ └── PromptSchedulerStorage.sol │ │ │ └── wEAI.sol │ │ ├── deployedAddressesV2.json │ │ ├── foundry.toml │ │ ├── hardhat.config.ts │ │ ├── mocha-report.json │ │ ├── package.json │ │ ├── remappings.txt │ │ ├── scripts/ │ │ │ ├── auto_deploy.ts │ │ │ ├── registerMiners.ts │ │ │ ├── tasks/ │ │ │ │ ├── control.task.ts │ │ │ │ └── wallet.task.ts │ │ │ ├── updateHybridModelMetadata.ts │ │ │ └── utils.ts │ │ ├── tests/ │ │ │ ├── address.seed.ts │ │ │ └── refactor/ │ │ │ ├── helpers.ts │ │ │ └── refactor.test.ts │ │ └── tsconfig.json │ └── version.txt ├── decentralized-inference/ │ ├── .dockerignore │ ├── .gitignore │ ├── README.md │ ├── chat_config.json.example │ ├── cmd/ │ │ ├── other/ │ │ │ └── chat/ │ │ │ ├── chat.go │ │ │ └── chat_config.go │ │ └── server/ │ │ ├── decentralize_infer.go │ │ ├── router.go │ │ └── server.go │ ├── config.json │ ├── config.json.example │ ├── eai │ ├── go.mod │ ├── go.sum │ ├── internal/ │ │ ├── abi/ │ │ │ ├── ai721.go │ │ │ └── workerhub.go │ │ ├── client/ │ │ │ └── client.go │ │ ├── config/ │ │ │ └── config.go │ │ ├── database/ │ │ │ ├── mongo.go │ │ │ └── mysql.go │ │ ├── eaimodel/ │ │ │ └── eaimodel.go │ │ ├── libs/ │ │ │ └── http_client/ │ │ │ └── http.go │ │ ├── lighthouse/ │ │ │ └── lighthouse.go │ │ ├── logger/ │ │ │ └── logger.go │ │ ├── models/ │ │ │ ├── batch_infer_history.go │ │ │ ├── chain_config.go │ │ │ ├── cloud_worker_proccess_histories.go │ │ │ ├── decentralize_infer.go │ │ │ ├── job_config.go │ │ │ ├── mysql_models/ │ │ │ │ ├── agent_snapshot_missions.go │ │ │ │ ├── agent_snapshot_post_action.go │ │ │ │ ├── app_configs.go │ │ │ │ ├── assistance_info.go │ │ │ │ ├── buy_order.go │ │ │ │ ├── eternal_key_trade_histories.go │ │ │ │ ├── eternal_keys.go │ │ │ │ ├── token_holders.go │ │ │ │ ├── twitter_infos.go │ │ │ │ └── twitter_tweet.go │ │ │ └── sync_state.go │ │ ├── rest/ │ │ │ └── template.go │ │ ├── services/ │ │ │ ├── chain_config.go │ │ │ ├── config.json │ │ │ ├── decentralize_infer.go │ │ │ ├── jobconfig.go │ │ │ ├── service.go │ │ │ ├── submit_solution_job.go │ │ │ ├── submit_solution_job_test.go │ │ │ └── worker_process_history.go │ │ └── types/ │ │ └── decentralize-infer.go │ ├── main.go │ └── main_test.go ├── decentralized-storage/ │ ├── .gitignore │ ├── .mocharc.json │ ├── README copy.md │ ├── README.md │ ├── arweave/ │ │ └── README.md │ ├── compiler_config.json │ ├── filecoin/ │ │ └── README.md │ ├── foundry.toml │ ├── greenfield/ │ │ └── README.md │ ├── hardhat.config.ts │ ├── mocha-report.json │ ├── package.json │ ├── remappings.txt │ └── tsconfig.json ├── developer-guides/ │ ├── README.md │ ├── agent-design-patterns/ │ │ ├── README.md │ │ ├── augmented-llm/ │ │ │ └── README.md │ │ ├── autonomous-agent/ │ │ │ └── README.md │ │ ├── evaluator-optimizer/ │ │ │ └── README.md │ │ ├── orchestrator-workers/ │ │ │ └── README.md │ │ ├── parallelization/ │ │ │ └── README.md │ │ ├── prompt-chaining/ │ │ │ └── README.md │ │ └── routing/ │ │ └── README.md │ ├── examples/ │ │ ├── README.md │ │ ├── ai-powered-wallet/ │ │ │ ├── .gitignore │ │ │ ├── contracts/ │ │ │ │ ├── AIPoweredWallet.sol │ │ │ │ └── AIPoweredWalletV2.sol │ │ │ ├── hardhat.config.ts │ │ │ ├── package.json │ │ │ ├── readme.md │ │ │ ├── scripts/ │ │ │ │ ├── deployAIPoweredWallet.ts │ │ │ │ ├── suspiciousTransaction.ts │ │ │ │ └── suspiciousTransactionV2.ts │ │ │ └── tsconfig.json │ │ ├── crosschain-llm-communicate/ │ │ │ ├── .eslintignore │ │ │ ├── .eslintrc.js │ │ │ ├── .gitignore │ │ │ ├── .prettierignore │ │ │ ├── .prettierrc │ │ │ ├── .prettierrc.js │ │ │ ├── README.md │ │ │ ├── contracts/ │ │ │ │ ├── Questioner.sol │ │ │ │ ├── RequestBuilder.sol │ │ │ │ └── interfaces/ │ │ │ │ ├── IAIKernel.sol │ │ │ │ ├── IInferable.sol │ │ │ │ ├── IModel.sol │ │ │ │ └── IPromptScheduler.sol │ │ │ ├── deploy/ │ │ │ │ └── Questioner.ts │ │ │ ├── foundry.toml │ │ │ ├── hardhat.config.ts │ │ │ ├── layerzero.config.ts │ │ │ ├── mainnet.layerzero.config.ts │ │ │ ├── package.json │ │ │ ├── scripts/ │ │ │ │ └── askLLM.ts │ │ │ ├── solhint.config.js │ │ │ └── tsconfig.json │ │ ├── dagent-play-chess/ │ │ │ ├── .gitignore │ │ │ ├── contracts/ │ │ │ │ └── DagentPlayChess.sol │ │ │ ├── hardhat.config.ts │ │ │ ├── package.json │ │ │ ├── readme.md │ │ │ ├── scripts/ │ │ │ │ ├── playChess.ts │ │ │ │ └── processBoard.ts │ │ │ └── tsconfig.json │ │ ├── decentralized-chatgpt/ │ │ │ ├── README.md │ │ │ ├── configs/ │ │ │ │ ├── daemon.json │ │ │ │ └── eternal.json │ │ │ ├── daemon.py │ │ │ ├── dagent/ │ │ │ │ ├── __init__.py │ │ │ │ ├── agents/ │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── base_agent.py │ │ │ │ │ ├── react_agent.py │ │ │ │ │ └── simple_chat_agent.py │ │ │ │ ├── characters/ │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── character_base.py │ │ │ │ │ ├── simple_character.py │ │ │ │ │ └── twitter_user_character.py │ │ │ │ ├── constant.py │ │ │ │ ├── llm/ │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── base_llm.py │ │ │ │ │ └── eternal_llm.py │ │ │ │ ├── models.py │ │ │ │ ├── registry.py │ │ │ │ ├── service.py │ │ │ │ ├── tools/ │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── base_toolset.py │ │ │ │ │ ├── functional.py │ │ │ │ │ ├── search.py │ │ │ │ │ ├── trading_toolset.py │ │ │ │ │ └── twitter_toolset.py │ │ │ │ ├── utils.py │ │ │ │ └── version.py │ │ │ ├── http_endpoints.py │ │ │ ├── requirements.txt │ │ │ ├── setup.py │ │ │ └── toolkit/ │ │ │ ├── chat-lite.py │ │ │ ├── chat.py │ │ │ ├── get_json_schema.py │ │ │ └── health_check.py │ │ ├── decentralized-inference-api-deephermes-base/ │ │ │ ├── README.md │ │ │ └── chat.js │ │ ├── decentralized-inference-api-deepseek-r1-1776-avax/ │ │ │ ├── README.md │ │ │ └── chat.js │ │ ├── decentralized-inference-api-deepseek-r1-base/ │ │ │ └── README.md │ │ ├── decentralized-inference-api-deepseek-r1-bnb/ │ │ │ └── README.md │ │ ├── decentralized-inference-api-dobby-polygon/ │ │ │ └── README.md │ │ ├── decentralized-inference-api-hyperevm/ │ │ │ ├── README.md │ │ │ └── chat.js │ │ ├── decentralized-inference-api-wan2.1-base/ │ │ │ └── README.md │ │ ├── decentralized-inference-contract-interaction-deepseek-r1-1776-avax/ │ │ │ └── README.md │ │ ├── decentralized-inference-contract-interaction-deepseek-r1-hyperevm/ │ │ │ └── README.md │ │ ├── eliza-deepseek-r1-base/ │ │ │ └── README.md │ │ ├── eliza-dobby-polygon/ │ │ │ └── README.md │ │ ├── how-to-mint-agent/ │ │ │ ├── .gitignore │ │ │ ├── config.json │ │ │ ├── mintAgent.ts │ │ │ ├── package.json │ │ │ ├── prompt.txt │ │ │ ├── readme.md │ │ │ └── tsconfig.json │ │ ├── rig-deepseek-r1-base/ │ │ │ └── README.md │ │ ├── rig-dobby-polygon/ │ │ │ └── README.md │ │ ├── rig-dobby70-polygon/ │ │ │ └── README.md │ │ ├── tee-phala-cloud/ │ │ │ ├── README.md │ │ │ └── golang/ │ │ │ ├── Dockerfile │ │ │ ├── docker-compose.yml │ │ │ ├── docker-phala.yml │ │ │ ├── go.mod │ │ │ ├── go.sum │ │ │ └── main.go │ │ ├── universe-dagents/ │ │ │ ├── .gitignore │ │ │ ├── contracts/ │ │ │ │ ├── IHybridModel.sol │ │ │ │ └── IPromptScheduler.sol │ │ │ ├── hardhat.config.ts │ │ │ ├── package.json │ │ │ ├── readme.md │ │ │ ├── scripts/ │ │ │ │ ├── config.json │ │ │ │ └── sendUniverseAgentRequest.ts │ │ │ └── tsconfig.json │ │ ├── zerepy-deepseek-r1-base/ │ │ │ └── README.md │ │ └── zerepy-dobby-polygon/ │ │ └── README.md │ └── run-an-end-to-end-decentralized-for-ai-agents/ │ ├── 4.how-to-deploy-and-mint-agent/ │ │ ├── .gitignore │ │ ├── README.md │ │ ├── contracts/ │ │ │ ├── AI721.sol │ │ │ ├── HybridModel.sol │ │ │ ├── ModelCollection.sol │ │ │ ├── StakingHub.sol │ │ │ ├── Treasury.sol │ │ │ ├── WorkerHub.sol │ │ │ ├── interfaces/ │ │ │ │ ├── IAI721.sol │ │ │ │ ├── ICallBack.sol │ │ │ │ ├── IHybridModel.sol │ │ │ │ ├── IInferable.sol │ │ │ │ ├── IModel.sol │ │ │ │ ├── IModelCollection.sol │ │ │ │ ├── IStakingHub.sol │ │ │ │ └── IWorkerHub.sol │ │ │ ├── library/ │ │ │ │ ├── Random.sol │ │ │ │ ├── Set.sol │ │ │ │ └── TransferHelper.sol │ │ │ ├── storages/ │ │ │ │ ├── AI721Storage.sol │ │ │ │ ├── HybridModelStorage.sol │ │ │ │ ├── ModelCollectionStorage.sol │ │ │ │ ├── StakingHubStorage.sol │ │ │ │ └── WorkerHubStorage.sol │ │ │ ├── tokens/ │ │ │ │ ├── DAOToken.sol │ │ │ │ └── IDAOToken.sol │ │ │ └── wEAI.sol │ │ ├── deploy-ai721.sh │ │ ├── deployedAddresses.json │ │ ├── get-system-prompt.sh │ │ ├── hardhat.config.ts │ │ ├── ls-agents.sh │ │ ├── mint-agent.sh │ │ ├── package.json │ │ ├── scripts/ │ │ │ ├── autoDeploy.ts │ │ │ ├── getSystemPrompt.ts │ │ │ ├── library/ │ │ │ │ ├── lib.ts │ │ │ │ └── utils.ts │ │ │ ├── lsAgent.ts │ │ │ └── mintAgent.ts │ │ ├── system-prompts/ │ │ │ └── naruto_fan.txt │ │ └── tsconfig.json │ ├── 5.start-agent/ │ │ ├── Dockerfile │ │ ├── README.md │ │ ├── config.json │ │ └── setup.js │ └── README.md ├── docs/ │ ├── README.md │ ├── SUMMARY.md │ ├── ai-chains/ │ │ ├── ai-chains-bitcoin-l2s-vs-subnets.md │ │ ├── apps-smart-contracts-vs-apis.md │ │ ├── base-layer-bitcoin-vs-bittensor.md │ │ ├── bittensor-and-existing-concepts.md │ │ └── what-are-ai-chains.md │ ├── decentralized-inference-api/ │ │ ├── api/ │ │ │ ├── README.md │ │ │ ├── agent-completion.md │ │ │ ├── api-key.md │ │ │ ├── chat-completion.md │ │ │ ├── completions.md │ │ │ ├── create-a-dagent.md │ │ │ ├── get-dagent-info.md │ │ │ ├── get-deposit-address.md │ │ │ └── imagine-and-reimagine.md │ │ ├── onchain-models.md │ │ ├── open-source/ │ │ │ ├── README.md │ │ │ ├── architecture.md │ │ │ └── installation.md │ │ └── tutorials/ │ │ ├── README.md │ │ ├── adjust-your-dagent-personality.md │ │ ├── build-a-dagent-as-a-service-with-eternalai-api.md │ │ ├── build-unstoppable-eliza-agents.md │ │ ├── build-unstoppable-rig-agents.md │ │ ├── build-unstoppable-zerepy-agents-1.md │ │ ├── build-unstoppable-zerepy-agents.md │ │ ├── chain-of-thought.md │ │ ├── decentralized-chatgpt.md │ │ ├── dont-trust-verify.md │ │ └── launch-on-twitter.md │ ├── eai/ │ │ ├── tokenomics.md │ │ └── utilities.md │ ├── eternals/ │ │ ├── proof-of-compute.md │ │ ├── specification.md │ │ └── what-are-eternals.md │ ├── fully-onchain-ai-models/ │ │ ├── architecture.md │ │ ├── deploy-your-first-fully-onchain-ai/ │ │ │ ├── README.md │ │ │ ├── create-a-self-custody-wallet.md │ │ │ ├── send-receive-and-trade-eternals.md │ │ │ ├── set-up-your-development-environment.md │ │ │ ├── train-an-ai-model-in-keras.md │ │ │ └── transform-the-keras-model-to-eternal.md │ │ ├── misc/ │ │ │ ├── README.md │ │ │ ├── specification/ │ │ │ │ ├── README.md │ │ │ │ ├── layers.md │ │ │ │ └── models.md │ │ │ ├── standardized-data-formats.md │ │ │ └── transforming-an-ai-model-into-an-eternal.md │ │ └── progress.md │ ├── neurons/ │ │ ├── neuron-device.md │ │ ├── virtual-neurons/ │ │ │ ├── README.md │ │ │ ├── neuron-as-a-service.md │ │ │ ├── pooled-neuron.md │ │ │ └── solo-neuron.md │ │ └── what-are-neurons.md │ ├── smart-contracts-ai-powered/ │ │ ├── how-to-use-onchain-flux.1.md │ │ ├── how-to-use-onchain-llm.md │ │ ├── onchain-ai-composability-ai-powered-gaming-with-chess.md │ │ └── onchain-ai-composability-ai-powered-wallet.md │ └── the-new-internet-ai-powered/ │ ├── bitcoin-ai-powered/ │ │ ├── README.md │ │ ├── bitai-virtual-machine.md │ │ ├── eternals-on-bitcoin.md │ │ └── run-a-bitai-node.md │ ├── ethereum-ai-powered.md │ └── solana-ai-powered.md ├── eai.sh ├── install.sh ├── media-kit/ │ ├── .gitignore │ ├── README.md │ └── fonts/ │ ├── Inter/ │ │ ├── OFL.txt │ │ └── README.txt │ └── JetBrains_Mono/ │ ├── OFL.txt │ └── README.txt ├── quickstart.sh └── research/ ├── README.md ├── cuda-evm/ │ ├── README.md │ ├── eternal-cuda-evm-kernel/ │ │ ├── .gitignore │ │ ├── README.md │ │ ├── src/ │ │ │ ├── Makefile │ │ │ ├── algo/ │ │ │ │ ├── activations.cu │ │ │ │ ├── conv.cu │ │ │ │ ├── element_wise_operator.cu │ │ │ │ ├── kernels.cu │ │ │ │ ├── matrixmul.cu │ │ │ │ ├── merging.cu │ │ │ │ ├── normalization.cu │ │ │ │ ├── pooling.cu │ │ │ │ ├── reduction.cu │ │ │ │ └── transforms.cu │ │ │ ├── computelib.cu │ │ │ ├── deprecated/ │ │ │ │ └── algo/ │ │ │ │ └── wrapper.cu │ │ │ ├── include/ │ │ │ │ ├── computelib.h │ │ │ │ ├── fixedlonglong32x32.cuh │ │ │ │ ├── helpers.cuh │ │ │ │ ├── kernels.cuh │ │ │ │ ├── operations.cuh │ │ │ │ └── tensor.h │ │ │ ├── jsoncpp/ │ │ │ │ ├── json/ │ │ │ │ │ ├── json-forwards.h │ │ │ │ │ └── json.h │ │ │ │ └── jsoncpp.cpp │ │ │ └── utils/ │ │ │ └── helpers.cu │ │ └── test/ │ │ ├── abi.py │ │ ├── op.py │ │ ├── packs/ │ │ │ ├── __init__.py │ │ │ ├── test_abi.py │ │ │ ├── test_activations.py │ │ │ ├── test_conv2d.py │ │ │ ├── test_elementwise.py │ │ │ ├── test_matmul.py │ │ │ ├── test_merging.py │ │ │ ├── test_norm.py │ │ │ ├── test_pooling.py │ │ │ ├── test_reduction.py │ │ │ ├── test_registry.py │ │ │ └── test_transformation.py │ │ ├── requirements.txt │ │ ├── run.py │ │ ├── tensor.py │ │ └── utils.py │ ├── eternal-keras/ │ │ ├── .gitignore │ │ ├── README.md │ │ ├── eai/ │ │ │ ├── __init__.py │ │ │ ├── artifacts/ │ │ │ │ ├── __init__.py │ │ │ │ ├── collection/ │ │ │ │ │ ├── ModelCollection.py │ │ │ │ │ └── __init__.py │ │ │ │ ├── layers/ │ │ │ │ │ ├── AddLayer.py │ │ │ │ │ ├── AveragePooling2DLayer.py │ │ │ │ │ ├── BatchNormalizationLayer.py │ │ │ │ │ ├── ConcatenateLayer.py │ │ │ │ │ ├── Conv2DLayer.py │ │ │ │ │ ├── DenseLayer.py │ │ │ │ │ ├── DropoutLayer.py │ │ │ │ │ ├── FlattenLayer.py │ │ │ │ │ ├── GlobalAveragePooling2DLayer.py │ │ │ │ │ ├── InputLayer.py │ │ │ │ │ ├── LinearLayer.py │ │ │ │ │ ├── MaxPooling2DLayer.py │ │ │ │ │ ├── MultiplyLayer.py │ │ │ │ │ ├── OnesLikeLayer.py │ │ │ │ │ ├── ReLULayer.py │ │ │ │ │ ├── RescaleLayer.py │ │ │ │ │ ├── SigmoidLayer.py │ │ │ │ │ ├── SoftmaxLayer.py │ │ │ │ │ ├── ZeroPadding2DLayer.py │ │ │ │ │ ├── ZerosLikeLayer.py │ │ │ │ │ └── __init__.py │ │ │ │ └── models/ │ │ │ │ ├── FunctionalModel.py │ │ │ │ └── __init__.py │ │ │ ├── cli.py │ │ │ ├── deployer.py │ │ │ ├── exporter.py │ │ │ ├── func.py │ │ │ ├── layer_config.py │ │ │ ├── layers.py │ │ │ ├── model.py │ │ │ ├── network_config.py │ │ │ ├── utils.py │ │ │ └── version.py │ │ ├── examples/ │ │ │ └── fashion_mnist/ │ │ │ ├── fashion_mnist.keras │ │ │ └── fashion_mnist_input.npy │ │ ├── requirements.txt │ │ ├── setup.py │ │ └── tutorial.ipynb │ └── eternal-tensor/ │ ├── .gitignore │ ├── .mocharc.json │ ├── README.md │ ├── contracts/ │ │ ├── FunctionalModel.sol │ │ ├── interfaces/ │ │ │ ├── ICollectibleModel.sol │ │ │ └── IFunctionalModel.sol │ │ └── libraries/ │ │ ├── Float32x32/ │ │ │ ├── ABDKMath32x32.sol │ │ │ └── Lib32x32.sol │ │ ├── layers-new/ │ │ │ ├── AddLayer.sol │ │ │ ├── AveragePooling2DLayer.sol │ │ │ ├── BatchNormalizationLayer.sol │ │ │ ├── ConcatenateLayer.sol │ │ │ ├── Conv2DLayer.sol │ │ │ ├── DenseLayer.sol │ │ │ ├── DepthwiseConv2D.sol │ │ │ ├── DropoutLayer.sol │ │ │ ├── FlattenLayer.sol │ │ │ ├── GlobalAveragePooling2DLayer.sol │ │ │ ├── ILayer.sol │ │ │ ├── InputLayer.sol │ │ │ ├── Layers.sol │ │ │ ├── LinearLayer.sol │ │ │ ├── MaxPooling2DLayer.sol │ │ │ ├── MultiplyLayer.sol │ │ │ ├── OnesLikeLayer.sol │ │ │ ├── ReLULayer.sol │ │ │ ├── RescaleLayer.sol │ │ │ ├── SigmoidLayer.sol │ │ │ ├── SoftmaxLayer.sol │ │ │ ├── ZeroPadding2DLayer.sol │ │ │ ├── ZerosLikeLayer.sol │ │ │ └── _deprecated/ │ │ │ ├── EmbeddingLayer.sol │ │ │ ├── LSTMLayer.sol │ │ │ └── SimpleRNNLayer.sol │ │ ├── libCudaParams.sol │ │ ├── libCudaTensor.sol │ │ └── tensors/ │ │ ├── TensorMethods.sol │ │ ├── Tensors.sol │ │ └── _deprecated/ │ │ ├── Tensor1DCuda.sol │ │ ├── Tensor1DMethods.sol │ │ ├── Tensor2DCuda.sol │ │ ├── Tensor2DMethods.sol │ │ ├── Tensor3DCuda.sol │ │ ├── Tensor3DMethods.sol │ │ ├── Tensor4DCuda.sol │ │ └── Tensor4DMethods.sol │ ├── foundry.toml │ ├── hardhat.config.ts │ ├── mocha-report.json │ ├── package.json │ ├── sample-models/ │ │ ├── lenet5.b64 │ │ ├── lenet5.json │ │ ├── nft-classifier.b64 │ │ └── nft-classifier.json │ ├── scripts/ │ │ ├── deploy-functional-model.ts │ │ ├── export-artifacts.py │ │ ├── get-miniconda3.sh │ │ ├── libraries/ │ │ │ ├── modelLib.ts │ │ │ ├── tensorData.ts │ │ │ └── utils.ts │ │ └── tests/ │ │ └── layers/ │ │ ├── add.py │ │ ├── add.test.ts │ │ ├── avgPooling.test.ts │ │ ├── avgpooling2D.py │ │ ├── batchnorm.py │ │ ├── batchnorm.test.ts │ │ ├── concatenate.test.ts │ │ ├── conv2d.py │ │ ├── conv2d.test.ts │ │ ├── dense.py │ │ ├── dense.test.ts │ │ ├── depthwiseConv2d.py │ │ ├── depthwiseconv2d.test.ts │ │ ├── dropout.test.ts │ │ ├── embedding.test.ts │ │ ├── flatten.test.ts │ │ ├── globalAvgPooling.test.ts │ │ ├── globalavgpooling.py │ │ ├── linear.test.ts │ │ ├── maxpooling.test.ts │ │ ├── maxpooling2D.py │ │ ├── multiply.py │ │ ├── multiply.test.ts │ │ ├── oneslike.test.ts │ │ ├── padding.py │ │ ├── relu.py │ │ ├── relu.test.ts │ │ ├── rescale.py │ │ ├── rescale.test.ts │ │ ├── sigmoid.py │ │ ├── sigmoid.test.ts │ │ ├── simpleRNN.test.ts │ │ ├── softmax.py │ │ ├── softmax.test.ts │ │ ├── zeropadding.test.ts │ │ └── zeroslike.test.ts │ └── tsconfig.json ├── dao-ai/ │ └── README.md ├── game-ai/ │ └── README.md ├── nft-ai/ │ ├── README.md │ ├── cryptoagents/ │ │ └── README.md │ └── cryptohumans/ │ └── README.md ├── physical-ai/ │ ├── README.md │ ├── neuron/ │ │ └── README.md │ └── sentient/ │ └── README.md ├── stores/ │ ├── README.md │ ├── ability-store/ │ │ └── README.md │ ├── agent-store/ │ │ └── README.md │ ├── knowledge-store/ │ │ └── README.md │ └── model-store/ │ └── README.md └── tee/ ├── README.md ├── marlin/ │ └── README.md └── phala/ ├── README.md └── golang/ ├── Dockerfile ├── docker-compose.yml ├── docker-phala.yml ├── go.mod ├── go.sum └── main.go ================================================ FILE CONTENTS ================================================ ================================================ FILE: .gitignore ================================================ # Ignore model files decentralized-compute/models/DeepSeek-R1-Distill-Qwen-1.5B-Q8_0/DeepSeek-R1-Distill-Qwen-1.5B-Q8_0.gguf # Ignore vim files [._]*.s[a-v][a-z] !*.svg # comment out if you don't need vector files [._]*.sw[a-p] [._]s[a-rt-v][a-z] [._]ss[a-gi-z] [._]sw[a-p] Session.vim Sessionx.vim .netrwhist *~ tags [._]*.un~ # Etc .DS_Store .idea *.log tmp/ neurons/solo/build/ neurons/solo/env/ decentralized-compute/cluster/sol/deploy.sh decentralized-compute/cluster/sol/package-lock.json # Byte-compiled / optimized / DLL files __pycache__/ *.py[cod] *$py.class # C extensions *.so # Distribution / packaging .Python build/ develop-eggs/ dist/ downloads/ eggs/ .eggs/ lib/ lib64/ parts/ sdist/ var/ wheels/ share/python-wheels/ *.egg-info/ .installed.cfg *.egg MANIFEST node_modules/ # PyInstaller # Usually these files are written by a python script from a template # before PyInstaller builds the exe, so as to inject date/other infos into it. *.manifest *.spec # Installer logs pip-log.txt pip-delete-this-directory.txt # Unit test / coverage reports htmlcov/ .tox/ .nox/ .coverage .coverage.* .cache nosetests.xml coverage.xml *.cover *.py,cover .hypothesis/ .pytest_cache/ cover/ # Translations *.mo *.pot # Django stuff: *.log local_settings.py db.sqlite3 db.sqlite3-journal # Flask stuff: instance/ .webassets-cache # Scrapy stuff: .scrapy # Sphinx documentation docs/_build/ # PyBuilder .pybuilder/ target/ # Jupyter Notebook .ipynb_checkpoints # IPython profile_default/ ipython_config.py # pyenv # For a library or package, you might want to ignore these files since the code is # intended to run in multiple environments; otherwise, check them in: # .python-version # pipenv # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. # However, in case of collaboration, if having platform-specific dependencies or dependencies # having no cross-platform support, pipenv may install dependencies that don't work, or not # install all needed dependencies. #Pipfile.lock # UV # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control. # This is especially recommended for binary packages to ensure reproducibility, and is more # commonly ignored for libraries. #uv.lock # poetry # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. # This is especially recommended for binary packages to ensure reproducibility, and is more # commonly ignored for libraries. # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control #poetry.lock # pdm # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control. #pdm.lock # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it # in version control. # https://pdm.fming.dev/latest/usage/project/#working-with-version-control .pdm.toml .pdm-python .pdm-build/ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm __pypackages__/ # Celery stuff celerybeat-schedule celerybeat.pid # SageMath parsed files *.sage.py # Environments .auth/ .env/ .env .venv env/ venv/ ENV/ env.bak/ venv.bak/ vendor/ # Spyder project settings .spyderproject .spyproject # Rope project settings .ropeproject # mkdocs documentation /site # mypy .mypy_cache/ .dmypy.json dmypy.json # Pyre type checker .pyre/ # pytype static type analyzer .pytype/ # Cython debug symbols cython_debug/ # PyCharm # JetBrains specific template is maintained in a separate JetBrains.gitignore that can # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore # and can be added to the global gitignore or merged into this file. For a more nuclear # option (not recommended) you can uncomment the following to ignore the entire idea folder. #.idea/ # PyPI configuration file .pypirc # Ignore build binary eai-chat eai-chat-linux .vscode/ agent-cli/agents/ ================================================ FILE: Dockerfile.backend ================================================ FROM golang:1.23-bookworm ENV GIN_MODE=release WORKDIR /app RUN apt-get update && apt-get install -y build-essential git COPY ./agent-as-a-service/agent-orchestration/backend/go.mod ./ COPY ./agent-as-a-service/agent-orchestration/backend/go.sum ./ RUN go mod download COPY ./agent-as-a-service/agent-orchestration/backend/ ./ RUN mv ./configs/config.json.local ./configs/config.json CMD ["go", "run", "server.go"] ================================================ FILE: Dockerfile.de-infer ================================================ FROM golang:1.23.4 as builder WORKDIR /app COPY decentralized-inference/go.mod decentralized-inference/go.sum ./ RUN go mod download COPY decentralized-inference /app/ RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o decentralized-inference-app . FROM alpine:latest WORKDIR /app COPY --from=builder /app/decentralized-inference-app /app/ COPY decentralized-inference/config.json /app/decentralized-inference/config.json COPY decentralized-compute/worker-hub/env/local_contracts.json /app/decentralized-compute/worker-hub/env/local_contracts.json CMD ["./decentralized-inference-app", "server"] ================================================ FILE: EternalAI.js/.gitignore ================================================ node_modules/ **/node_modules/ db/* /packages/uniswap/db/uniswap ================================================ FILE: EternalAI.js/README.md ================================================ # EternalAI.js is a friendly tool for learning to code and create decentralized AI in JavaScript. ## Development - you place at root folder - run some of script to start project at development mode - yarn - yarn dev ================================================ FILE: EternalAI.js/lerna.json ================================================ { "$schema": "node_modules/lerna/schemas/lerna-schema.json", "version": "0.0.0", "npmClient": "yarn" } ================================================ FILE: EternalAI.js/package.json ================================================ { "name": "root", "private": true, "workspaces": [ "packages/*" ], "dependencies": {}, "scripts": { "start": "lerna run start --stream --parallel", "dev": "lerna run dev --stream --parallel", "build": "lerna run build --stream" }, "devDependencies": { "lerna": "^8.1.9" }, "packageManager": "yarn@1.22.22+sha1.ac34549e6aa8e7ead463a7407e1c7390f61a6610" } ================================================ FILE: EternalAI.js/packages/core/.github/workflows/main.yml ================================================ name: CI on: [push] jobs: build: name: Build, lint, and test on Node ${{ matrix.node }} and ${{ matrix.os }} runs-on: ${{ matrix.os }} strategy: matrix: node: ['10.x', '12.x', '14.x'] os: [ubuntu-latest, windows-latest, macOS-latest] steps: - name: Checkout repo uses: actions/checkout@v2 - name: Use Node ${{ matrix.node }} uses: actions/setup-node@v1 with: node-version: ${{ matrix.node }} - name: Install deps and build (with cache) uses: bahmutov/npm-install@v1 - name: Lint run: yarn lint - name: Test run: yarn test --ci --coverage --maxWorkers=2 - name: Build run: yarn build ================================================ FILE: EternalAI.js/packages/core/.github/workflows/size.yml ================================================ name: size on: [pull_request] jobs: size: runs-on: ubuntu-latest env: CI_JOB_NUMBER: 1 steps: - uses: actions/checkout@v1 - uses: andresz1/size-limit-action@v1 with: github_token: ${{ secrets.GITHUB_TOKEN }} ================================================ FILE: EternalAI.js/packages/core/.gitignore ================================================ *.log .DS_Store node_modules dist ================================================ FILE: EternalAI.js/packages/core/LICENSE ================================================ MIT License Copyright (c) 2025 Peter Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: EternalAI.js/packages/core/README.md ================================================ # TSDX User Guide Congrats! You just saved yourself hours of work by bootstrapping this project with TSDX. Let’s get you oriented with what’s here and how to use it. > This TSDX setup is meant for developing libraries (not apps!) that can be published to NPM. If you’re looking to build a Node app, you could use `ts-node-dev`, plain `ts-node`, or simple `tsc`. > If you’re new to TypeScript, checkout [this handy cheatsheet](https://devhints.io/typescript) ## Commands TSDX scaffolds your new library inside `/src`. To run TSDX, use: ```bash npm start # or yarn start ``` This builds to `/dist` and runs the project in watch mode so any edits you save inside `src` causes a rebuild to `/dist`. To do a one-off build, use `npm run build` or `yarn build`. To run tests, use `npm test` or `yarn test`. ## Configuration Code quality is set up for you with `prettier`, `husky`, and `lint-staged`. Adjust the respective fields in `package.json` accordingly. ### Jest Jest tests are set up to run with `npm test` or `yarn test`. ### Bundle Analysis [`size-limit`](https://github.com/ai/size-limit) is set up to calculate the real cost of your library with `npm run size` and visualize the bundle with `npm run analyze`. #### Setup Files This is the folder structure we set up for you: ```txt /src index.tsx # EDIT THIS /test blah.test.tsx # EDIT THIS .gitignore package.json README.md # EDIT THIS tsconfig.json ``` ### Rollup TSDX uses [Rollup](https://rollupjs.org) as a bundler and generates multiple rollup configs for various module formats and build settings. See [Optimizations](#optimizations) for details. ### TypeScript `tsconfig.json` is set up to interpret `dom` and `esnext` types, as well as `react` for `jsx`. Adjust according to your needs. ## Continuous Integration ### GitHub Actions Two actions are added by default: - `main` which installs deps w/ cache, lints, tests, and builds on all pushes against a Node and OS matrix - `size` which comments cost comparison of your library on every pull request using [`size-limit`](https://github.com/ai/size-limit) ## Optimizations Please see the main `tsdx` [optimizations docs](https://github.com/palmerhq/tsdx#optimizations). In particular, know that you can take advantage of development-only optimizations: ```js // ./types/index.d.ts declare var __DEV__: boolean; // inside your code... if (__DEV__) { console.log('foo'); } ``` You can also choose to install and use [invariant](https://github.com/palmerhq/tsdx#invariant) and [warning](https://github.com/palmerhq/tsdx#warning) functions. ## Module Formats CJS, ESModules, and UMD module formats are supported. The appropriate paths are configured in `package.json` and `dist/index.js` accordingly. Please report if any issues are found. ## Named Exports Per Palmer Group guidelines, [always use named exports.](https://github.com/palmerhq/typescript#exports) Code split inside your React app instead of your React library. ## Including Styles There are many ways to ship styles, including with CSS-in-JS. TSDX has no opinion on this, configure how you like. For vanilla CSS, you can include it at the root directory and add it to the `files` section in your `package.json`, so that it can be imported separately by your users and run through their bundler's loader. ## Publishing to NPM We recommend using [np](https://github.com/sindresorhus/np). ================================================ FILE: EternalAI.js/packages/core/build.tsconfig.json ================================================ { "compilerOptions": { "target": "esnext", "module": "commonjs", "lib": ["dom", "esnext"], "jsx": "react-jsx", "strict": true, "moduleResolution": "node", "esModuleInterop": true, "skipLibCheck": true, "forceConsistentCasingInFileNames": true, "declaration": true, "declarationMap": true, "sourceMap": true, "outDir": "dist", "baseUrl": ".", "paths": { "@/*": ["src/*"] }, "resolveJsonModule": true }, "include": ["src"], "exclude": ["node_modules", "dist"] } ================================================ FILE: EternalAI.js/packages/core/package.json ================================================ { "name": "@eternalai.js/core", "version": "0.1.0", "license": "MIT", "main": "dist/bundle.cjs.js", "module": "dist/bundle.esm.js", "typings": "dist/index.d.ts", "files": [ "dist", "src" ], "engines": { "node": ">=10" }, "scripts": { "build": "rm -rf dist && rollup -c", "build:watch": "rollup -c -w", "test": "vitest", "lint": "eslint . --ext .ts,.tsx", "size": "size-limit", "analyze": "size-limit --why" }, "peerDependencies": {}, "husky": { "hooks": { "pre-commit": "eslint . --ext .ts,.tsx" } }, "prettier": { "printWidth": 80, "semi": true, "singleQuote": true, "trailingComma": "es5" }, "author": "Peter", "devDependencies": { "@rollup/plugin-commonjs": "^21.0.1", "@rollup/plugin-json": "^6.1.0", "@rollup/plugin-node-resolve": "^13.0.6", "@rollup/plugin-typescript": "^8.3.3", "@size-limit/preset-small-lib": "^11.1.6", "husky": "^9.1.7", "rollup": "^2.56.3", "rollup-plugin-node-builtins": "^2.1.2", "rollup-plugin-node-globals": "^1.4.0", "rollup-plugin-terser": "^7.0.2", "rollup-plugin-uglify": "^6.0.4", "size-limit": "^11.1.6", "tsconfig-paths": "^4.2.0", "typescript": "^5.7.3" }, "dependencies": { "ethers": "5.7.2" } } ================================================ FILE: EternalAI.js/packages/core/rollup.config.js ================================================ const resolve = require('@rollup/plugin-node-resolve').default; const commonjs = require('@rollup/plugin-commonjs'); const typescript = require('@rollup/plugin-typescript'); const { terser } = require('rollup-plugin-terser'); const pkg = require('./package.json'); const json = require('@rollup/plugin-json'); const builtins = require('rollup-plugin-node-builtins'); const globals = require('rollup-plugin-node-globals'); const inject = require('@rollup/plugin-inject'); module.exports = { input: ['./src/index.ts'], output: [ { dir: 'dist', format: 'cjs', sourcemap: true, }, ], plugins: [ resolve({}), inject({}), commonjs(), globals(), builtins(), typescript({ tsconfig: './build.tsconfig.json' }), terser(), json(), ], external: [...Object.keys(pkg.peerDependencies || {}), 'ethers'], }; ================================================ FILE: EternalAI.js/packages/core/src/index.ts ================================================ export * as utils from './utils'; ================================================ FILE: EternalAI.js/packages/core/src/types.d.ts ================================================ declare global { namespace InjectedTypes { type ethers = typeof import('ethers'); } } export {}; ================================================ FILE: EternalAI.js/packages/core/src/utils/index.ts ================================================ export * as injects from './injects'; ================================================ FILE: EternalAI.js/packages/core/src/utils/injects/ethers.ts ================================================ // Ensure globalThis is defined if (typeof globalThis === 'undefined') { (globalThis as any) = global; } const injectDependency = (packageName: 'ethers'): T => { if ((globalThis as any)[packageName]) { return (globalThis as any)[packageName]; } if (packageName === 'ethers') { (globalThis as any)[packageName] = require('ethers'); return (globalThis as any)[packageName]; } throw new Error(`Package ${packageName} not found`); }; export default injectDependency; ================================================ FILE: EternalAI.js/packages/core/src/utils/injects/index.ts ================================================ export * from './ethers'; ================================================ FILE: EternalAI.js/packages/core/tsconfig.json ================================================ { "compilerOptions": { "target": "esnext", "module": "commonjs", "lib": ["dom", "esnext"], "jsx": "react-jsx", "strict": true, "moduleResolution": "node", "esModuleInterop": true, "skipLibCheck": true, "forceConsistentCasingInFileNames": true, "declaration": true, "declarationMap": true, "sourceMap": true, "outDir": "dist", "baseUrl": ".", "paths": { "@/*": ["src/*"] }, "resolveJsonModule": true }, "include": ["src"], "exclude": ["node_modules", "dist"] } ================================================ FILE: EternalAI.js/packages/interact/.github/workflows/main.yml ================================================ name: CI on: [push] jobs: build: name: Build, lint, and test on Node ${{ matrix.node }} and ${{ matrix.os }} runs-on: ${{ matrix.os }} strategy: matrix: node: ['10.x', '12.x', '14.x'] os: [ubuntu-latest, windows-latest, macOS-latest] steps: - name: Checkout repo uses: actions/checkout@v2 - name: Use Node ${{ matrix.node }} uses: actions/setup-node@v1 with: node-version: ${{ matrix.node }} - name: Install deps and build (with cache) uses: bahmutov/npm-install@v1 - name: Lint run: yarn lint - name: Test run: yarn test --ci --coverage --maxWorkers=2 - name: Build run: yarn build ================================================ FILE: EternalAI.js/packages/interact/.github/workflows/size.yml ================================================ name: size on: [pull_request] jobs: size: runs-on: ubuntu-latest env: CI_JOB_NUMBER: 1 steps: - uses: actions/checkout@v1 - uses: andresz1/size-limit-action@v1 with: github_token: ${{ secrets.GITHUB_TOKEN }} ================================================ FILE: EternalAI.js/packages/interact/.gitignore ================================================ *.log .DS_Store node_modules dist ================================================ FILE: EternalAI.js/packages/interact/LICENSE ================================================ MIT License Copyright (c) 2025 Peter Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: EternalAI.js/packages/interact/README.md ================================================ # TSDX User Guide Congrats! You just saved yourself hours of work by bootstrapping this project with TSDX. Let’s get you oriented with what’s here and how to use it. > This TSDX setup is meant for developing libraries (not apps!) that can be published to NPM. If you’re looking to build a Node app, you could use `ts-node-dev`, plain `ts-node`, or simple `tsc`. > If you’re new to TypeScript, checkout [this handy cheatsheet](https://devhints.io/typescript) ## Commands TSDX scaffolds your new library inside `/src`. To run TSDX, use: ```bash npm start # or yarn start ``` This builds to `/dist` and runs the project in watch mode so any edits you save inside `src` causes a rebuild to `/dist`. To do a one-off build, use `npm run build` or `yarn build`. To run tests, use `npm test` or `yarn test`. ## Configuration Code quality is set up for you with `prettier`, `husky`, and `lint-staged`. Adjust the respective fields in `package.json` accordingly. ### Jest Jest tests are set up to run with `npm test` or `yarn test`. ### Bundle Analysis [`size-limit`](https://github.com/ai/size-limit) is set up to calculate the real cost of your library with `npm run size` and visualize the bundle with `npm run analyze`. #### Setup Files This is the folder structure we set up for you: ```txt /src index.tsx # EDIT THIS /test blah.test.tsx # EDIT THIS .gitignore package.json README.md # EDIT THIS tsconfig.json ``` ### Rollup TSDX uses [Rollup](https://rollupjs.org) as a bundler and generates multiple rollup configs for various module formats and build settings. See [Optimizations](#optimizations) for details. ### TypeScript `tsconfig.json` is set up to interpret `dom` and `esnext` types, as well as `react` for `jsx`. Adjust according to your needs. ## Continuous Integration ### GitHub Actions Two actions are added by default: - `main` which installs deps w/ cache, lints, tests, and builds on all pushes against a Node and OS matrix - `size` which comments cost comparison of your library on every pull request using [`size-limit`](https://github.com/ai/size-limit) ## Optimizations Please see the main `tsdx` [optimizations docs](https://github.com/palmerhq/tsdx#optimizations). In particular, know that you can take advantage of development-only optimizations: ```js // ./types/index.d.ts declare var __DEV__: boolean; // inside your code... if (__DEV__) { console.log('foo'); } ``` You can also choose to install and use [invariant](https://github.com/palmerhq/tsdx#invariant) and [warning](https://github.com/palmerhq/tsdx#warning) functions. ## Module Formats CJS, ESModules, and UMD module formats are supported. The appropriate paths are configured in `package.json` and `dist/index.js` accordingly. Please report if any issues are found. ## Named Exports Per Palmer Group guidelines, [always use named exports.](https://github.com/palmerhq/typescript#exports) Code split inside your React app instead of your React library. ## Including Styles There are many ways to ship styles, including with CSS-in-JS. TSDX has no opinion on this, configure how you like. For vanilla CSS, you can include it at the root directory and add it to the `files` section in your `package.json`, so that it can be imported separately by your users and run through their bundler's loader. ## Publishing to NPM We recommend using [np](https://github.com/sindresorhus/np). ================================================ FILE: EternalAI.js/packages/interact/build.tsconfig.json ================================================ { "compilerOptions": { "target": "esnext", "module": "esnext", "lib": ["dom", "esnext"], "jsx": "react-jsx", "strict": true, "moduleResolution": "node", "esModuleInterop": true, "skipLibCheck": true, "forceConsistentCasingInFileNames": true, "declaration": true, "declarationMap": true, "sourceMap": true, "outDir": "dist", "baseUrl": ".", "paths": { "@/*": ["src/*"] }, "resolveJsonModule": true }, "include": ["src", "src/types.d.ts", "src/**/*.d.ts"], "exclude": ["node_modules", "dist"] } ================================================ FILE: EternalAI.js/packages/interact/package.json ================================================ { "name": "@eternalai.js/interact", "version": "0.1.0", "license": "MIT", "main": "dist/bundle.cjs.js", "module": "dist/bundle.esm.js", "typings": "dist/index.d.ts", "files": [ "dist", "src" ], "engines": { "node": ">=10" }, "scripts": { "build": "rm -rf dist && rollup -c", "build:watch": "rollup -c -w", "test": "vitest", "lint": "eslint . --ext .ts,.tsx", "prepare": "rollup -c", "size": "size-limit", "analyze": "size-limit --why", "run-main": "ts-node -r tsconfig-paths/register --transpile-only ./scripts/main.ts" }, "peerDependencies": {}, "husky": { "hooks": { "pre-commit": "eslint . --ext .ts,.tsx" } }, "prettier": { "printWidth": 80, "semi": true, "singleQuote": true, "trailingComma": "es5" }, "author": "Peter", "size-limit": [ { "path": "dist/bundle.cjs.js", "limit": "10 KB" }, { "path": "dist/bundle.esm.js", "limit": "10 KB" } ], "devDependencies": { "@rollup/plugin-commonjs": "^21.0.1", "@rollup/plugin-json": "^6.1.0", "@rollup/plugin-node-resolve": "^13.0.6", "@rollup/plugin-typescript": "^8.3.3", "@size-limit/preset-small-lib": "^11.1.6", "husky": "^9.1.7", "rollup": "^2.56.3", "rollup-plugin-node-builtins": "^2.1.2", "rollup-plugin-node-globals": "^1.4.0", "rollup-plugin-terser": "^7.0.2", "rollup-plugin-uglify": "^6.0.4", "size-limit": "^11.1.6", "tsconfig-paths": "^4.2.0", "typescript": "^5.7.3" }, "dependencies": { "ethers": "5.7.2" } } ================================================ FILE: EternalAI.js/packages/interact/rollup.config.js ================================================ const resolve = require('@rollup/plugin-node-resolve').default; const commonjs = require('@rollup/plugin-commonjs'); const typescript = require('@rollup/plugin-typescript'); const { terser } = require('rollup-plugin-terser'); const pkg = require('./package.json'); const json = require('@rollup/plugin-json'); const builtins = require('rollup-plugin-node-builtins'); const globals = require('rollup-plugin-node-globals'); const inject = require('@rollup/plugin-inject'); const { uglify } = require('rollup-plugin-uglify'); import gzipPlugin from 'rollup-plugin-gzip'; module.exports = { input: ['./src/index.ts'], output: [ { // dir: 'dist', format: 'cjs', file: 'dist/index.cjs.js', sourcemap: false, }, { // dir: 'dist', format: 'umd', file: 'dist/index.umd.js', name: 'Interact', sourcemap: false, }, ], plugins: [ resolve({}), inject({}), commonjs(), globals(), builtins(), typescript({ tsconfig: './build.tsconfig.json', declaration: false }), terser(), json(), uglify(), gzipPlugin(), ], external: [...Object.keys(pkg.peerDependencies || {}), 'ethers'], }; ================================================ FILE: EternalAI.js/packages/interact/scripts/main.ts ================================================ import { ethers } from 'ethers'; import { default as Interact } from '../src/interact'; import { default as InteractWithExternalWallet } from '../src/interactWithExternalWallet'; import { InferPayloadWithMessages, InferPayloadWithPrompt } from '../src/types'; import { ChainId } from '../src/constants'; export const AGENT_CONTRACT_ADDRESSES: Record = { [ChainId.BSC]: '0x3B9710bA5578C2eeD075D8A23D8c596925fa4625', [ChainId.BASE]: '0x1E65FCa9b6640bC87AE41f1a897762c334821D1C', }; // const wallet = new ethers.Wallet("Your private key here"); const wallet = ethers.Wallet.createRandom(); const externalWallet = { address: wallet.address, getAddress: wallet.getAddress, requestSignature: async ( transaction: ethers.providers.TransactionRequest ) => { return await wallet.signTransaction(transaction); }, }; async function testInferV1() { const inferPayload = { chainId: ChainId.BSC, agentAddress: AGENT_CONTRACT_ADDRESSES[ChainId.BSC], prompt: 'Can you tell me about BTC', } satisfies InferPayloadWithPrompt; { const interact = new Interact(wallet); await interact.infer(inferPayload); } } async function testInferV2() { const inferPayload = { chainId: ChainId.BSC, agentAddress: AGENT_CONTRACT_ADDRESSES[ChainId.BSC], messages: [ { role: 'system', content: 'You are a BTC master', }, { role: 'user', content: 'Can you tell me about BTC', }, ], isLightHouse: true, } satisfies InferPayloadWithMessages; { const interact = new Interact(wallet); await interact.infer(inferPayload); } } async function testInferExternalWalletV1() { const inferPayload = { chainId: ChainId.BSC, agentAddress: AGENT_CONTRACT_ADDRESSES[ChainId.BSC], prompt: 'Can you tell me about BTC', } satisfies InferPayloadWithPrompt; { const interact = new InteractWithExternalWallet(externalWallet); await interact.infer(inferPayload); } } async function testInferExternalWalletV2() { const inferPayload = { chainId: ChainId.BSC, agentAddress: AGENT_CONTRACT_ADDRESSES[ChainId.BSC], messages: [ { role: 'system', content: 'You are a BTC master', }, { role: 'user', content: 'Can you tell me about BTC', }, ], isLightHouse: true, } satisfies InferPayloadWithMessages; { const interact = new InteractWithExternalWallet(externalWallet); await interact.infer(inferPayload); } } testInferV1(); ================================================ FILE: EternalAI.js/packages/interact/src/baseInteract.ts ================================================ import { CHAIN_MAPPING, ChainId } from './constants'; import { InferPayloadWithMessages, InferPayloadWithPrompt } from './types'; import * as methods from './methods'; import { InteractWallet } from './methods/types'; import injectDependency from '@/inject'; // this is inject supported packages const packages = { ethers: injectDependency('ethers'), }; class BaseInteract { protected getProvider(chainId: ChainId, rpcUrl?: string) { // create provider from user optional if (!!rpcUrl) { return new packages.ethers.providers.JsonRpcProvider(rpcUrl); } if (!CHAIN_MAPPING[chainId]) { throw new Error(`Unsupported chainId: ${chainId}`); } // create provider from default supported chainId return new packages.ethers.providers.JsonRpcProvider( CHAIN_MAPPING[chainId] ); } protected normalizePayload( payload: InferPayloadWithPrompt | InferPayloadWithMessages ) { return { ...payload, isLightHouse: payload.isLightHouse ?? false, }; } protected async sendSignedTransactionAndListenResult( signer: InteractWallet, signedTx: string, agentAddress: string, chainId: ChainId ) { const sendPromptTxHash = await methods.Infer.sendPrompt(signer, signedTx); const workerHubAddress = await methods.Infer.getWorkerHubAddress( agentAddress, signer ); return await methods.Infer.listenPromptResponse( chainId, signer, workerHubAddress, sendPromptTxHash ); } } export interface IInteract { infer( payload: InferPayloadWithPrompt | InferPayloadWithMessages ): Promise; } export default BaseInteract; ================================================ FILE: EternalAI.js/packages/interact/src/constants.ts ================================================ export enum ChainId { BASE = 8453, BSC = 56, } export const CHAIN_MAPPING: Record = { 56: 'https://bsc-dataseed.binance.org/', 8453: 'https://base.llamarpc.com', }; ================================================ FILE: EternalAI.js/packages/interact/src/global.d.ts ================================================ declare global { namespace InjectedTypes { type ethers = typeof import('ethers'); } } export {}; ================================================ FILE: EternalAI.js/packages/interact/src/index.ts ================================================ export { default as Interact } from './interact'; export { default as InteractWithExternalWallet } from './interactWithExternalWallet'; export * as methods from './methods'; export * from './types'; export * from './constants'; ================================================ FILE: EternalAI.js/packages/interact/src/inject.ts ================================================ // Ensure globalThis is defined if (typeof globalThis === 'undefined') { (globalThis as any) = global; } const injectDependency = (packageName: 'ethers'): T => { if ((globalThis as any)[packageName]) { return (globalThis as any)[packageName]; } if (packageName === 'ethers') { (globalThis as any)[packageName] = require('ethers'); return (globalThis as any)[packageName]; } throw new Error(`Package ${packageName} not found`); }; export default injectDependency; ================================================ FILE: EternalAI.js/packages/interact/src/interact.ts ================================================ import * as ethers from 'ethers'; import { InferPayloadWithMessages, InferPayloadWithPrompt } from './types'; import * as methods from './methods'; import { ChainId } from './constants'; import BaseInteract, { IInteract } from './baseInteract'; class Interact extends BaseInteract implements IInteract { private _wallet: ethers.Wallet; constructor(wallet: ethers.Wallet) { super(); if (!ethers.Wallet.isSigner(wallet)) { throw new Error('Provided wallet is not a signer'); } this._wallet = wallet; } private getNetworkCredential(chainId: ChainId, rpcUrl?: string) { const provider = this.getProvider(chainId, rpcUrl); const signer = this._wallet.connect(provider); return { provider, signer, }; } // Overload signatures // @ts-ignore public async infer(payload: InferPayloadWithPrompt): Promise; // @ts-ignore public async infer(payload: InferPayloadWithMessages): Promise; // Implementation // @ts-ignore public async infer( payload: InferPayloadWithPrompt | InferPayloadWithMessages ): Promise { try { const normalizedPayload = this.normalizePayload(payload); console.log('infer - start', { payload: normalizedPayload, }); if ( typeof (normalizedPayload as InferPayloadWithPrompt).prompt === 'string' ) { const result = await this.inferWithPrompt( normalizedPayload as InferPayloadWithPrompt ); console.log('infer - succeed', result); return result; } else { const result = await this.inferWithMessages( normalizedPayload as InferPayloadWithMessages ); console.log('infer - succeed', result); return result; } } catch (e) { console.log('infer - failed', e); throw e; } finally { console.log('infer - end'); } } private async inferWithPrompt( payload: InferPayloadWithPrompt ): Promise { console.log('inferWithPrompt - start'); const { signer } = this.getNetworkCredential( payload.chainId, payload.rpcUrl ); const params = await methods.Infer.createPayloadWithPrompt(signer, payload); const signedTx = await signer.signTransaction(params); return await this.sendSignedTransactionAndListenResult( signer, signedTx, payload.agentAddress, payload.chainId ); } private async inferWithMessages( payload: InferPayloadWithMessages ): Promise { console.log('inferWithMessages - start'); const { signer } = this.getNetworkCredential( payload.chainId, payload.rpcUrl ); const params = await methods.Infer.createPayloadWithMessages( signer, payload ); const signedTx = await signer.signTransaction(params); return await this.sendSignedTransactionAndListenResult( signer, signedTx, payload.agentAddress, payload.chainId ); } } export default Interact; ================================================ FILE: EternalAI.js/packages/interact/src/interactWithExternalWallet.ts ================================================ import { ExternalWallet, InferPayloadWithMessages, InferPayloadWithPrompt, } from './types'; import * as methods from './methods'; import { ChainId } from './constants'; import { InteractWallet } from './methods/types'; import BaseInteract, { IInteract } from './baseInteract'; class InteractWithExternalWallet extends BaseInteract implements IInteract { private _wallet: ExternalWallet; constructor(wallet: ExternalWallet) { super(); this._wallet = wallet; } private getNetworkCredential(chainId: ChainId, rpcUrl?: string) { const provider = this.getProvider(chainId, rpcUrl); const signer = { ...this._wallet, provider, } satisfies InteractWallet; return { provider, signer, }; } // Overload signatures // @ts-ignore public async infer(payload: InferPayloadWithPrompt): Promise; // @ts-ignore public async infer(payload: InferPayloadWithMessages): Promise; // Implementation // @ts-ignore public async infer( payload: InferPayloadWithPrompt | InferPayloadWithMessages ): Promise { try { const normalizedPayload = this.normalizePayload(payload); console.log('inferWithExternalWallet - start', { payload: normalizedPayload, }); if ( typeof (normalizedPayload as InferPayloadWithPrompt).prompt === 'string' ) { const result = await this.inferWithPrompt( normalizedPayload as InferPayloadWithPrompt ); console.log('inferWithExternalWallet - succeed', result); return result; } else { const result = await this.inferWithMessages( normalizedPayload as InferPayloadWithMessages ); console.log('inferWithExternalWallet - succeed', result); return result; } } catch (e) { console.log('inferWithExternalWallet - failed', e); throw e; } finally { console.log('inferWithExternalWallet - end'); } } private async inferWithPrompt( payload: InferPayloadWithPrompt ): Promise { console.log('inferWithEternalWalletWithPrompt - start'); const { signer } = this.getNetworkCredential( payload.chainId, payload.rpcUrl ); const params = await methods.Infer.createPayloadWithPrompt(signer, payload); const signedTx = await signer.requestSignature(params); return await this.sendSignedTransactionAndListenResult( signer, signedTx, payload.agentAddress, payload.chainId ); } private async inferWithMessages( payload: InferPayloadWithMessages ): Promise { console.log('inferWithEternalWalletWithMessages - start'); const { signer } = this.getNetworkCredential( payload.chainId, payload.rpcUrl ); const params = await methods.Infer.createPayloadWithMessages( signer, payload ); const signedTx = await signer.requestSignature(params); return await this.sendSignedTransactionAndListenResult( signer, signedTx, payload.agentAddress, payload.chainId ); } } export default InteractWithExternalWallet; ================================================ FILE: EternalAI.js/packages/interact/src/methods/index.ts ================================================ export { default as Infer } from './infer'; ================================================ FILE: EternalAI.js/packages/interact/src/methods/infer/constants.ts ================================================ import * as ethers from 'ethers'; export const AGENT_ABI: ethers.ContractInterface = [ { inputs: [ { internalType: 'string', name: 'name_', type: 'string', }, { internalType: 'string', name: 'symbol_', type: 'string', }, { internalType: 'uint256', name: 'amount_', type: 'uint256', }, { internalType: 'address', name: 'recipient_', type: 'address', }, { internalType: 'address', name: 'promptScheduler_', type: 'address', }, { internalType: 'address', name: 'modelAddress_', type: 'address', }, { internalType: 'string', name: 'systemPrompt_', type: 'string', }, { internalType: 'bytes', name: 'storageInfo_', type: 'bytes', }, ], stateMutability: 'nonpayable', type: 'constructor', }, { inputs: [], name: 'InvalidAddress', type: 'error', }, { inputs: [], name: 'InvalidData', type: 'error', }, { inputs: [], name: 'InvalidShortString', type: 'error', }, { inputs: [ { internalType: 'string', name: 'str', type: 'string', }, ], name: 'StringTooLong', type: 'error', }, { anonymous: false, inputs: [ { indexed: true, internalType: 'address', name: 'owner', type: 'address', }, { indexed: true, internalType: 'address', name: 'spender', type: 'address', }, { indexed: false, internalType: 'uint256', name: 'value', type: 'uint256', }, ], name: 'Approval', type: 'event', }, { anonymous: false, inputs: [ { indexed: true, internalType: 'address', name: 'delegator', type: 'address', }, { indexed: true, internalType: 'address', name: 'fromDelegate', type: 'address', }, { indexed: true, internalType: 'address', name: 'toDelegate', type: 'address', }, ], name: 'DelegateChanged', type: 'event', }, { anonymous: false, inputs: [ { indexed: true, internalType: 'address', name: 'delegate', type: 'address', }, { indexed: false, internalType: 'uint256', name: 'previousBalance', type: 'uint256', }, { indexed: false, internalType: 'uint256', name: 'newBalance', type: 'uint256', }, ], name: 'DelegateVotesChanged', type: 'event', }, { anonymous: false, inputs: [], name: 'EIP712DomainChanged', type: 'event', }, { anonymous: false, inputs: [ { indexed: false, internalType: 'address', name: 'hybridModel', type: 'address', }, ], name: 'ModelUpdate', type: 'event', }, { anonymous: false, inputs: [ { indexed: true, internalType: 'address', name: 'previousOwner', type: 'address', }, { indexed: true, internalType: 'address', name: 'newOwner', type: 'address', }, ], name: 'OwnershipTransferred', type: 'event', }, { anonymous: false, inputs: [ { indexed: true, internalType: 'address', name: 'caller', type: 'address', }, { indexed: true, internalType: 'uint256', name: 'inferId', type: 'uint256', }, { indexed: false, internalType: 'bytes', name: 'request', type: 'bytes', }, ], name: 'PromptPerformed', type: 'event', }, { anonymous: false, inputs: [ { indexed: false, internalType: 'address', name: 'promptScheduler', type: 'address', }, ], name: 'PromptSchedulerHubUpdate', type: 'event', }, { anonymous: false, inputs: [ { indexed: false, internalType: 'string', name: 'systemPrompt', type: 'string', }, ], name: 'SystemPromptUpdate', type: 'event', }, { anonymous: false, inputs: [ { indexed: true, internalType: 'address', name: 'from', type: 'address', }, { indexed: true, internalType: 'address', name: 'to', type: 'address', }, { indexed: false, internalType: 'uint256', name: 'value', type: 'uint256', }, ], name: 'Transfer', type: 'event', }, { inputs: [], name: 'CLOCK_MODE', outputs: [ { internalType: 'string', name: '', type: 'string', }, ], stateMutability: 'view', type: 'function', }, { inputs: [], name: 'DOMAIN_SEPARATOR', outputs: [ { internalType: 'bytes32', name: '', type: 'bytes32', }, ], stateMutability: 'view', type: 'function', }, { inputs: [ { internalType: 'address', name: 'owner', type: 'address', }, { internalType: 'address', name: 'spender', type: 'address', }, ], name: 'allowance', outputs: [ { internalType: 'uint256', name: '', type: 'uint256', }, ], stateMutability: 'view', type: 'function', }, { inputs: [ { internalType: 'address', name: 'spender', type: 'address', }, { internalType: 'uint256', name: 'amount', type: 'uint256', }, ], name: 'approve', outputs: [ { internalType: 'bool', name: '', type: 'bool', }, ], stateMutability: 'nonpayable', type: 'function', }, { inputs: [ { internalType: 'address', name: 'account', type: 'address', }, ], name: 'balanceOf', outputs: [ { internalType: 'uint256', name: '', type: 'uint256', }, ], stateMutability: 'view', type: 'function', }, { inputs: [ { internalType: 'address', name: 'account', type: 'address', }, { internalType: 'uint32', name: 'pos', type: 'uint32', }, ], name: 'checkpoints', outputs: [ { components: [ { internalType: 'uint32', name: 'fromBlock', type: 'uint32', }, { internalType: 'uint224', name: 'votes', type: 'uint224', }, ], internalType: 'struct ERC20Votes.Checkpoint', name: '', type: 'tuple', }, ], stateMutability: 'view', type: 'function', }, { inputs: [], name: 'clock', outputs: [ { internalType: 'uint48', name: '', type: 'uint48', }, ], stateMutability: 'view', type: 'function', }, { inputs: [], name: 'decimals', outputs: [ { internalType: 'uint8', name: '', type: 'uint8', }, ], stateMutability: 'view', type: 'function', }, { inputs: [ { internalType: 'address', name: 'spender', type: 'address', }, { internalType: 'uint256', name: 'subtractedValue', type: 'uint256', }, ], name: 'decreaseAllowance', outputs: [ { internalType: 'bool', name: '', type: 'bool', }, ], stateMutability: 'nonpayable', type: 'function', }, { inputs: [ { internalType: 'address', name: 'delegatee', type: 'address', }, ], name: 'delegate', outputs: [], stateMutability: 'nonpayable', type: 'function', }, { inputs: [ { internalType: 'address', name: 'delegatee', type: 'address', }, { internalType: 'uint256', name: 'nonce', type: 'uint256', }, { internalType: 'uint256', name: 'expiry', type: 'uint256', }, { internalType: 'uint8', name: 'v', type: 'uint8', }, { internalType: 'bytes32', name: 'r', type: 'bytes32', }, { internalType: 'bytes32', name: 's', type: 'bytes32', }, ], name: 'delegateBySig', outputs: [], stateMutability: 'nonpayable', type: 'function', }, { inputs: [ { internalType: 'address', name: 'account', type: 'address', }, ], name: 'delegates', outputs: [ { internalType: 'address', name: '', type: 'address', }, ], stateMutability: 'view', type: 'function', }, { inputs: [], name: 'eip712Domain', outputs: [ { internalType: 'bytes1', name: 'fields', type: 'bytes1', }, { internalType: 'string', name: 'name', type: 'string', }, { internalType: 'string', name: 'version', type: 'string', }, { internalType: 'uint256', name: 'chainId', type: 'uint256', }, { internalType: 'address', name: 'verifyingContract', type: 'address', }, { internalType: 'bytes32', name: 'salt', type: 'bytes32', }, { internalType: 'uint256[]', name: 'extensions', type: 'uint256[]', }, ], stateMutability: 'view', type: 'function', }, { inputs: [], name: 'fetchCode', outputs: [ { internalType: 'string', name: 'logic', type: 'string', }, ], stateMutability: 'view', type: 'function', }, { inputs: [], name: 'getFileStorageChunkInfo', outputs: [ { components: [ { internalType: 'uint256', name: 'size', type: 'uint256', }, { components: [ { internalType: 'address', name: 'pointer', type: 'address', }, { internalType: 'uint32', name: 'start', type: 'uint32', }, { internalType: 'uint32', name: 'end', type: 'uint32', }, ], internalType: 'struct BytecodeSlice[]', name: 'slices', type: 'tuple[]', }, ], internalType: 'struct File', name: 'file', type: 'tuple', }, ], stateMutability: 'view', type: 'function', }, { inputs: [], name: 'getModelAddress', outputs: [ { internalType: 'address', name: '', type: 'address', }, ], stateMutability: 'view', type: 'function', }, { inputs: [ { internalType: 'uint256', name: 'timepoint', type: 'uint256', }, ], name: 'getPastTotalSupply', outputs: [ { internalType: 'uint256', name: '', type: 'uint256', }, ], stateMutability: 'view', type: 'function', }, { inputs: [ { internalType: 'address', name: 'account', type: 'address', }, { internalType: 'uint256', name: 'timepoint', type: 'uint256', }, ], name: 'getPastVotes', outputs: [ { internalType: 'uint256', name: '', type: 'uint256', }, ], stateMutability: 'view', type: 'function', }, { inputs: [], name: 'getPromptSchedulerAddress', outputs: [ { internalType: 'address', name: '', type: 'address', }, ], stateMutability: 'view', type: 'function', }, { inputs: [ { internalType: 'uint256', name: 'id', type: 'uint256', }, ], name: 'getResultById', outputs: [ { internalType: 'bytes', name: '', type: 'bytes', }, ], stateMutability: 'view', type: 'function', }, { inputs: [], name: 'getStorageInfo', outputs: [ { components: [ { internalType: 'address', name: 'contractAddress', type: 'address', }, { internalType: 'string', name: 'filename', type: 'string', }, ], internalType: 'struct IUtilityAgent.StorageInfo', name: '', type: 'tuple', }, ], stateMutability: 'view', type: 'function', }, { inputs: [], name: 'getStorageMode', outputs: [ { internalType: 'string', name: '', type: 'string', }, ], stateMutability: 'view', type: 'function', }, { inputs: [], name: 'getSystemPrompt', outputs: [ { internalType: 'string', name: '', type: 'string', }, ], stateMutability: 'view', type: 'function', }, { inputs: [ { internalType: 'address', name: 'account', type: 'address', }, ], name: 'getVotes', outputs: [ { internalType: 'uint256', name: '', type: 'uint256', }, ], stateMutability: 'view', type: 'function', }, { inputs: [ { internalType: 'address', name: 'spender', type: 'address', }, { internalType: 'uint256', name: 'addedValue', type: 'uint256', }, ], name: 'increaseAllowance', outputs: [ { internalType: 'bool', name: '', type: 'bool', }, ], stateMutability: 'nonpayable', type: 'function', }, { inputs: [], name: 'name', outputs: [ { internalType: 'string', name: '', type: 'string', }, ], stateMutability: 'view', type: 'function', }, { inputs: [ { internalType: 'address', name: 'owner', type: 'address', }, ], name: 'nonces', outputs: [ { internalType: 'uint256', name: '', type: 'uint256', }, ], stateMutability: 'view', type: 'function', }, { inputs: [ { internalType: 'address', name: 'account', type: 'address', }, ], name: 'numCheckpoints', outputs: [ { internalType: 'uint32', name: '', type: 'uint32', }, ], stateMutability: 'view', type: 'function', }, { inputs: [], name: 'owner', outputs: [ { internalType: 'address', name: '', type: 'address', }, ], stateMutability: 'view', type: 'function', }, { inputs: [ { internalType: 'address', name: 'owner', type: 'address', }, { internalType: 'address', name: 'spender', type: 'address', }, { internalType: 'uint256', name: 'value', type: 'uint256', }, { internalType: 'uint256', name: 'deadline', type: 'uint256', }, { internalType: 'uint8', name: 'v', type: 'uint8', }, { internalType: 'bytes32', name: 'r', type: 'bytes32', }, { internalType: 'bytes32', name: 's', type: 'bytes32', }, ], name: 'permit', outputs: [], stateMutability: 'nonpayable', type: 'function', }, { inputs: [ { internalType: 'bytes', name: 'request', type: 'bytes', }, ], name: 'prompt', outputs: [ { internalType: 'uint256', name: 'inferId', type: 'uint256', }, ], stateMutability: 'nonpayable', type: 'function', }, { inputs: [], name: 'renounceOwnership', outputs: [], stateMutability: 'nonpayable', type: 'function', }, { inputs: [], name: 'symbol', outputs: [ { internalType: 'string', name: '', type: 'string', }, ], stateMutability: 'view', type: 'function', }, { inputs: [], name: 'totalSupply', outputs: [ { internalType: 'uint256', name: '', type: 'uint256', }, ], stateMutability: 'view', type: 'function', }, { inputs: [ { internalType: 'address', name: 'to', type: 'address', }, { internalType: 'uint256', name: 'amount', type: 'uint256', }, ], name: 'transfer', outputs: [ { internalType: 'bool', name: '', type: 'bool', }, ], stateMutability: 'nonpayable', type: 'function', }, { inputs: [ { internalType: 'address', name: 'from', type: 'address', }, { internalType: 'address', name: 'to', type: 'address', }, { internalType: 'uint256', name: 'amount', type: 'uint256', }, ], name: 'transferFrom', outputs: [ { internalType: 'bool', name: '', type: 'bool', }, ], stateMutability: 'nonpayable', type: 'function', }, { inputs: [ { internalType: 'address', name: 'newOwner', type: 'address', }, ], name: 'transferOwnership', outputs: [], stateMutability: 'nonpayable', type: 'function', }, { inputs: [ { internalType: 'string', name: 'filename', type: 'string', }, ], name: 'updateFileName', outputs: [], stateMutability: 'nonpayable', type: 'function', }, { inputs: [ { internalType: 'address', name: 'modelAddress', type: 'address', }, ], name: 'updateModelAddress', outputs: [], stateMutability: 'nonpayable', type: 'function', }, { inputs: [ { internalType: 'address', name: 'promptScheduler', type: 'address', }, ], name: 'updatePromptScheduler', outputs: [], stateMutability: 'nonpayable', type: 'function', }, { inputs: [ { internalType: 'string', name: 'systemPrompt', type: 'string', }, ], name: 'updateSystemPrompt', outputs: [], stateMutability: 'nonpayable', type: 'function', }, ]; export const HYBRID_MODEL_ABI: ethers.ContractInterface = [ { inputs: [], name: 'ModelIdAlreadySet', type: 'error', }, { anonymous: false, inputs: [ { indexed: false, internalType: 'uint256', name: 'newValue', type: 'uint256', }, ], name: 'IdentifierUpdate', type: 'event', }, { anonymous: false, inputs: [ { indexed: false, internalType: 'uint8', name: 'version', type: 'uint8', }, ], name: 'Initialized', type: 'event', }, { anonymous: false, inputs: [ { indexed: false, internalType: 'string', name: 'newValue', type: 'string', }, ], name: 'MetadataUpdate', type: 'event', }, { anonymous: false, inputs: [ { indexed: false, internalType: 'string', name: 'newValue', type: 'string', }, ], name: 'NameUpdate', type: 'event', }, { anonymous: false, inputs: [ { indexed: true, internalType: 'address', name: 'previousOwner', type: 'address', }, { indexed: true, internalType: 'address', name: 'newOwner', type: 'address', }, ], name: 'OwnershipTransferred', type: 'event', }, { anonymous: false, inputs: [ { indexed: false, internalType: 'address', name: 'account', type: 'address', }, ], name: 'Paused', type: 'event', }, { anonymous: false, inputs: [ { indexed: false, internalType: 'address', name: 'account', type: 'address', }, ], name: 'Unpaused', type: 'event', }, { anonymous: false, inputs: [ { indexed: false, internalType: 'address', name: 'newAddress', type: 'address', }, ], name: 'WorkerHubUpdate', type: 'event', }, { inputs: [], name: 'identifier', outputs: [ { internalType: 'uint256', name: '', type: 'uint256', }, ], stateMutability: 'view', type: 'function', }, { inputs: [ { internalType: 'bytes', name: '_input', type: 'bytes', }, { internalType: 'bool', name: '_rawFlag', type: 'bool', }, ], name: 'infer', outputs: [ { internalType: 'uint256', name: '', type: 'uint256', }, ], stateMutability: 'payable', type: 'function', }, { inputs: [ { internalType: 'bytes', name: '_input', type: 'bytes', }, ], name: 'infer', outputs: [ { internalType: 'uint256', name: '', type: 'uint256', }, ], stateMutability: 'payable', type: 'function', }, { inputs: [ { internalType: 'bytes', name: '_input', type: 'bytes', }, { internalType: 'address', name: '_creator', type: 'address', }, { internalType: 'bool', name: '_flag', type: 'bool', }, ], name: 'infer', outputs: [ { internalType: 'uint256', name: '', type: 'uint256', }, ], stateMutability: 'payable', type: 'function', }, { inputs: [ { internalType: 'bytes', name: '_input', type: 'bytes', }, { internalType: 'address', name: '_creator', type: 'address', }, ], name: 'infer', outputs: [ { internalType: 'uint256', name: '', type: 'uint256', }, ], stateMutability: 'payable', type: 'function', }, { inputs: [ { internalType: 'address', name: '_workerHub', type: 'address', }, { internalType: 'address', name: '_modelCollection', type: 'address', }, { internalType: 'uint256', name: '_identifier', type: 'uint256', }, { internalType: 'string', name: '_name', type: 'string', }, { internalType: 'string', name: '_metadata', type: 'string', }, ], name: 'initialize', outputs: [], stateMutability: 'nonpayable', type: 'function', }, { inputs: [], name: 'metadata', outputs: [ { internalType: 'string', name: '', type: 'string', }, ], stateMutability: 'view', type: 'function', }, { inputs: [], name: 'modelCollection', outputs: [ { internalType: 'address', name: '', type: 'address', }, ], stateMutability: 'view', type: 'function', }, { inputs: [], name: 'name', outputs: [ { internalType: 'string', name: '', type: 'string', }, ], stateMutability: 'view', type: 'function', }, { inputs: [], name: 'owner', outputs: [ { internalType: 'address', name: '', type: 'address', }, ], stateMutability: 'view', type: 'function', }, { inputs: [], name: 'pause', outputs: [], stateMutability: 'nonpayable', type: 'function', }, { inputs: [], name: 'paused', outputs: [ { internalType: 'bool', name: '', type: 'bool', }, ], stateMutability: 'view', type: 'function', }, { inputs: [], name: 'renounceOwnership', outputs: [], stateMutability: 'nonpayable', type: 'function', }, { inputs: [ { internalType: 'uint256', name: '_modelId', type: 'uint256', }, ], name: 'setModelId', outputs: [], stateMutability: 'nonpayable', type: 'function', }, { inputs: [ { internalType: 'address', name: 'newOwner', type: 'address', }, ], name: 'transferOwnership', outputs: [], stateMutability: 'nonpayable', type: 'function', }, { inputs: [], name: 'unpause', outputs: [], stateMutability: 'nonpayable', type: 'function', }, { inputs: [ { internalType: 'uint256', name: '_identifier', type: 'uint256', }, ], name: 'updateIdentifier', outputs: [], stateMutability: 'nonpayable', type: 'function', }, { inputs: [ { internalType: 'string', name: '_metadata', type: 'string', }, ], name: 'updateMetadata', outputs: [], stateMutability: 'nonpayable', type: 'function', }, { inputs: [ { internalType: 'string', name: '_name', type: 'string', }, ], name: 'updateName', outputs: [], stateMutability: 'nonpayable', type: 'function', }, { inputs: [ { internalType: 'address', name: '_workerHub', type: 'address', }, ], name: 'updateWorkerHub', outputs: [], stateMutability: 'nonpayable', type: 'function', }, { inputs: [], name: 'version', outputs: [ { internalType: 'string', name: '', type: 'string', }, ], stateMutability: 'pure', type: 'function', }, { inputs: [], name: 'workerHub', outputs: [ { internalType: 'address', name: '', type: 'address', }, ], stateMutability: 'view', type: 'function', }, { stateMutability: 'payable', type: 'receive', }, ]; export const WORKER_HUB_ABI: ethers.ContractInterface = [ { inputs: [], name: 'AlreadyCommitted', type: 'error', }, { inputs: [], name: 'AlreadyRevealed', type: 'error', }, { inputs: [], name: 'AlreadySeized', type: 'error', }, { inputs: [], name: 'AlreadySubmitted', type: 'error', }, { inputs: [ { internalType: 'bytes32', name: 'value', type: 'bytes32', }, ], name: 'Bytes32Set_DuplicatedValue', type: 'error', }, { inputs: [], name: 'CannotFastForward', type: 'error', }, { inputs: [], name: 'CommitTimeout', type: 'error', }, { inputs: [], name: 'FailedTransfer', type: 'error', }, { inputs: [], name: 'InvalidAddress', type: 'error', }, { inputs: [], name: 'InvalidCommitment', type: 'error', }, { inputs: [], name: 'InvalidContext', type: 'error', }, { inputs: [], name: 'InvalidData', type: 'error', }, { inputs: [], name: 'InvalidInferenceStatus', type: 'error', }, { inputs: [], name: 'InvalidMiner', type: 'error', }, { inputs: [], name: 'InvalidNonce', type: 'error', }, { inputs: [], name: 'InvalidReveal', type: 'error', }, { inputs: [], name: 'InvalidRole', type: 'error', }, { inputs: [], name: 'NotCommitted', type: 'error', }, { inputs: [], name: 'NotEnoughMiners', type: 'error', }, { inputs: [], name: 'OnlyAssignedWorker', type: 'error', }, { inputs: [], name: 'RevealTimeout', type: 'error', }, { inputs: [], name: 'SubmitTimeout', type: 'error', }, { inputs: [ { internalType: 'uint256', name: 'value', type: 'uint256', }, ], name: 'Uint256Set_DuplicatedValue', type: 'error', }, { inputs: [], name: 'Unauthorized', type: 'error', }, { anonymous: false, inputs: [ { indexed: true, internalType: 'address', name: 'miner', type: 'address', }, { indexed: true, internalType: 'uint256', name: 'assigmentId', type: 'uint256', }, { indexed: false, internalType: 'bytes32', name: 'commitment', type: 'bytes32', }, ], name: 'CommitmentSubmission', type: 'event', }, { anonymous: false, inputs: [ { indexed: false, internalType: 'uint256', name: 'chainId', type: 'uint256', }, { indexed: false, internalType: 'uint256', name: 'inferenceId', type: 'uint256', }, { indexed: false, internalType: 'address', name: 'modelAddress', type: 'address', }, { components: [ { internalType: 'address', name: 'receiver', type: 'address', }, { internalType: 'uint256', name: 'amount', type: 'uint256', }, { internalType: 'enum IWorkerHub.DAOTokenReceiverRole', name: 'role', type: 'uint8', }, ], indexed: false, internalType: 'struct IWorkerHub.DAOTokenReceiverInfor[]', name: 'receivers', type: 'tuple[]', }, ], name: 'DAOTokenMintedV2', type: 'event', }, { anonymous: false, inputs: [ { components: [ { internalType: 'uint16', name: 'minerPercentage', type: 'uint16', }, { internalType: 'uint16', name: 'userPercentage', type: 'uint16', }, { internalType: 'uint16', name: 'referrerPercentage', type: 'uint16', }, { internalType: 'uint16', name: 'refereePercentage', type: 'uint16', }, { internalType: 'uint16', name: 'l2OwnerPercentage', type: 'uint16', }, ], indexed: false, internalType: 'struct IWorkerHub.DAOTokenPercentage', name: 'oldValue', type: 'tuple', }, { components: [ { internalType: 'uint16', name: 'minerPercentage', type: 'uint16', }, { internalType: 'uint16', name: 'userPercentage', type: 'uint16', }, { internalType: 'uint16', name: 'referrerPercentage', type: 'uint16', }, { internalType: 'uint16', name: 'refereePercentage', type: 'uint16', }, { internalType: 'uint16', name: 'l2OwnerPercentage', type: 'uint16', }, ], indexed: false, internalType: 'struct IWorkerHub.DAOTokenPercentage', name: 'newValue', type: 'tuple', }, ], name: 'DAOTokenPercentageUpdated', type: 'event', }, { anonymous: false, inputs: [ { indexed: true, internalType: 'uint256', name: 'inferenceId', type: 'uint256', }, { indexed: false, internalType: 'enum IWorkerHub.InferenceStatus', name: 'newStatus', type: 'uint8', }, ], name: 'InferenceStatusUpdate', type: 'event', }, { anonymous: false, inputs: [ { indexed: false, internalType: 'uint8', name: 'version', type: 'uint8', }, ], name: 'Initialized', type: 'event', }, { anonymous: false, inputs: [ { indexed: true, internalType: 'uint256', name: 'assignmentId', type: 'uint256', }, { indexed: true, internalType: 'uint256', name: 'inferenceId', type: 'uint256', }, { indexed: true, internalType: 'address', name: 'miner', type: 'address', }, ], name: 'MinerRoleSeized', type: 'event', }, { anonymous: false, inputs: [ { indexed: true, internalType: 'uint256', name: 'assignmentId', type: 'uint256', }, { indexed: true, internalType: 'uint256', name: 'inferenceId', type: 'uint256', }, { indexed: true, internalType: 'address', name: 'miner', type: 'address', }, { indexed: false, internalType: 'uint40', name: 'expiredAt', type: 'uint40', }, ], name: 'NewAssignment', type: 'event', }, { anonymous: false, inputs: [ { indexed: true, internalType: 'uint256', name: 'inferenceId', type: 'uint256', }, { indexed: true, internalType: 'address', name: 'model', type: 'address', }, { indexed: true, internalType: 'address', name: 'creator', type: 'address', }, { indexed: false, internalType: 'uint256', name: 'value', type: 'uint256', }, { indexed: false, internalType: 'uint256', name: 'originInferenceId', type: 'uint256', }, ], name: 'NewInference', type: 'event', }, { anonymous: false, inputs: [ { indexed: true, internalType: 'address', name: 'previousOwner', type: 'address', }, { indexed: true, internalType: 'address', name: 'newOwner', type: 'address', }, ], name: 'OwnershipTransferred', type: 'event', }, { anonymous: false, inputs: [ { indexed: false, internalType: 'address', name: 'account', type: 'address', }, ], name: 'Paused', type: 'event', }, { anonymous: false, inputs: [ { indexed: true, internalType: 'uint256', name: 'inferenceId', type: 'uint256', }, { indexed: true, internalType: 'address', name: 'model', type: 'address', }, { indexed: true, internalType: 'address', name: 'creator', type: 'address', }, { indexed: false, internalType: 'uint256', name: 'value', type: 'uint256', }, { indexed: false, internalType: 'uint256', name: 'originInferenceId', type: 'uint256', }, { indexed: false, internalType: 'bytes', name: 'input', type: 'bytes', }, { indexed: false, internalType: 'bool', name: 'flag', type: 'bool', }, ], name: 'RawSubmitted', type: 'event', }, { anonymous: false, inputs: [ { indexed: true, internalType: 'address', name: 'miner', type: 'address', }, { indexed: true, internalType: 'uint256', name: 'assigmentId', type: 'uint256', }, { indexed: false, internalType: 'uint40', name: 'nonce', type: 'uint40', }, { indexed: false, internalType: 'bytes', name: 'output', type: 'bytes', }, ], name: 'RevealSubmission', type: 'event', }, { anonymous: false, inputs: [ { indexed: true, internalType: 'address', name: 'miner', type: 'address', }, { indexed: true, internalType: 'uint256', name: 'assigmentId', type: 'uint256', }, ], name: 'SolutionSubmission', type: 'event', }, { anonymous: false, inputs: [ { indexed: true, internalType: 'uint256', name: 'assignmentId', type: 'uint256', }, { indexed: false, internalType: 'bytes', name: 'data', type: 'bytes', }, ], name: 'StreamedData', type: 'event', }, { anonymous: false, inputs: [ { indexed: false, internalType: 'address', name: 'account', type: 'address', }, ], name: 'Unpaused', type: 'event', }, { inputs: [], name: 'assignmentNumber', outputs: [ { internalType: 'uint256', name: '', type: 'uint256', }, ], stateMutability: 'view', type: 'function', }, { inputs: [ { internalType: 'uint256', name: '', type: 'uint256', }, ], name: 'assignments', outputs: [ { internalType: 'uint256', name: 'inferenceId', type: 'uint256', }, { internalType: 'bytes32', name: 'commitment', type: 'bytes32', }, { internalType: 'bytes32', name: 'digest', type: 'bytes32', }, { internalType: 'uint40', name: 'revealNonce', type: 'uint40', }, { internalType: 'address', name: 'worker', type: 'address', }, { internalType: 'enum IWorkerHub.AssignmentRole', name: 'role', type: 'uint8', }, { internalType: 'enum IWorkerHub.Vote', name: 'vote', type: 'uint8', }, { internalType: 'bytes', name: 'output', type: 'bytes', }, ], stateMutability: 'view', type: 'function', }, { inputs: [ { internalType: 'uint256', name: '_assignId', type: 'uint256', }, { internalType: 'bytes32', name: '_commitment', type: 'bytes32', }, ], name: 'commit', outputs: [], stateMutability: 'nonpayable', type: 'function', }, { inputs: [ { internalType: 'uint256', name: '_assignmentId', type: 'uint256', }, ], name: 'getAssignmentInfo', outputs: [ { components: [ { internalType: 'uint256', name: 'inferenceId', type: 'uint256', }, { internalType: 'bytes32', name: 'commitment', type: 'bytes32', }, { internalType: 'bytes32', name: 'digest', type: 'bytes32', }, { internalType: 'uint40', name: 'revealNonce', type: 'uint40', }, { internalType: 'address', name: 'worker', type: 'address', }, { internalType: 'enum IWorkerHub.AssignmentRole', name: 'role', type: 'uint8', }, { internalType: 'enum IWorkerHub.Vote', name: 'vote', type: 'uint8', }, { internalType: 'bytes', name: 'output', type: 'bytes', }, ], internalType: 'struct IWorkerHub.Assignment', name: '', type: 'tuple', }, ], stateMutability: 'view', type: 'function', }, { inputs: [ { internalType: 'uint256', name: '_inferenceId', type: 'uint256', }, ], name: 'getAssignmentsByInference', outputs: [ { internalType: 'uint256[]', name: '', type: 'uint256[]', }, ], stateMutability: 'view', type: 'function', }, { inputs: [ { internalType: 'uint256', name: '_inferenceId', type: 'uint256', }, ], name: 'getInferenceInfo', outputs: [ { components: [ { internalType: 'uint256[]', name: 'assignments', type: 'uint256[]', }, { internalType: 'bytes', name: 'input', type: 'bytes', }, { internalType: 'uint256', name: 'value', type: 'uint256', }, { internalType: 'uint256', name: 'feeL2', type: 'uint256', }, { internalType: 'uint256', name: 'feeTreasury', type: 'uint256', }, { internalType: 'address', name: 'modelAddress', type: 'address', }, { internalType: 'uint40', name: 'submitTimeout', type: 'uint40', }, { internalType: 'uint40', name: 'commitTimeout', type: 'uint40', }, { internalType: 'uint40', name: 'revealTimeout', type: 'uint40', }, { internalType: 'enum IWorkerHub.InferenceStatus', name: 'status', type: 'uint8', }, { internalType: 'address', name: 'creator', type: 'address', }, { internalType: 'address', name: 'processedMiner', type: 'address', }, { internalType: 'address', name: 'referrer', type: 'address', }, ], internalType: 'struct IWorkerHub.Inference', name: '', type: 'tuple', }, ], stateMutability: 'view', type: 'function', }, { inputs: [ { internalType: 'address', name: '_modelAddress', type: 'address', }, ], name: 'getMinFeeToUse', outputs: [ { internalType: 'uint256', name: '', type: 'uint256', }, ], stateMutability: 'view', type: 'function', }, { inputs: [], name: 'getTreasuryAddress', outputs: [ { internalType: 'address', name: '', type: 'address', }, ], stateMutability: 'view', type: 'function', }, { inputs: [ { internalType: 'bytes', name: '_input', type: 'bytes', }, { internalType: 'address', name: '_creator', type: 'address', }, { internalType: 'bool', name: '_flag', type: 'bool', }, ], name: 'infer', outputs: [ { internalType: 'uint256', name: '', type: 'uint256', }, ], stateMutability: 'payable', type: 'function', }, { inputs: [ { internalType: 'bytes', name: '_input', type: 'bytes', }, { internalType: 'address', name: '_creator', type: 'address', }, ], name: 'infer', outputs: [ { internalType: 'uint256', name: '', type: 'uint256', }, ], stateMutability: 'payable', type: 'function', }, { inputs: [], name: 'inferenceNumber', outputs: [ { internalType: 'uint256', name: '', type: 'uint256', }, ], stateMutability: 'view', type: 'function', }, { inputs: [ { internalType: 'address', name: '_wEAI', type: 'address', }, { internalType: 'address', name: '_l2Owner', type: 'address', }, { internalType: 'address', name: '_treasury', type: 'address', }, { internalType: 'address', name: '_daoToken', type: 'address', }, { internalType: 'address', name: '_stakingHub', type: 'address', }, { internalType: 'uint16', name: '_feeL2Percentage', type: 'uint16', }, { internalType: 'uint16', name: '_feeTreasuryPercentage', type: 'uint16', }, { internalType: 'uint8', name: '_minerRequirement', type: 'uint8', }, { internalType: 'uint40', name: '_submitDuration', type: 'uint40', }, { internalType: 'uint40', name: '_commitDuration', type: 'uint40', }, { internalType: 'uint40', name: '_revealDuration', type: 'uint40', }, { internalType: 'uint16', name: '_feeRatioMinerValidor', type: 'uint16', }, { internalType: 'uint256', name: '_daoTokenReward', type: 'uint256', }, { components: [ { internalType: 'uint16', name: 'minerPercentage', type: 'uint16', }, { internalType: 'uint16', name: 'userPercentage', type: 'uint16', }, { internalType: 'uint16', name: 'referrerPercentage', type: 'uint16', }, { internalType: 'uint16', name: 'refereePercentage', type: 'uint16', }, { internalType: 'uint16', name: 'l2OwnerPercentage', type: 'uint16', }, ], internalType: 'struct IWorkerHub.DAOTokenPercentage', name: '_daoTokenPercentage', type: 'tuple', }, ], name: 'initialize', outputs: [], stateMutability: 'nonpayable', type: 'function', }, { inputs: [], name: 'owner', outputs: [ { internalType: 'address', name: '', type: 'address', }, ], stateMutability: 'view', type: 'function', }, { inputs: [], name: 'pause', outputs: [], stateMutability: 'nonpayable', type: 'function', }, { inputs: [], name: 'paused', outputs: [ { internalType: 'bool', name: '', type: 'bool', }, ], stateMutability: 'view', type: 'function', }, { inputs: [ { internalType: 'address[]', name: '_referrers', type: 'address[]', }, { internalType: 'address[]', name: '_referees', type: 'address[]', }, ], name: 'registerReferrer', outputs: [], stateMutability: 'nonpayable', type: 'function', }, { inputs: [], name: 'renounceOwnership', outputs: [], stateMutability: 'nonpayable', type: 'function', }, { inputs: [ { internalType: 'uint256', name: '_inferenceId', type: 'uint256', }, ], name: 'resolveInference', outputs: [], stateMutability: 'nonpayable', type: 'function', }, { inputs: [ { internalType: 'uint256', name: '_assignId', type: 'uint256', }, { internalType: 'uint40', name: '_nonce', type: 'uint40', }, { internalType: 'bytes', name: '_data', type: 'bytes', }, ], name: 'reveal', outputs: [], stateMutability: 'nonpayable', type: 'function', }, { inputs: [ { internalType: 'uint256', name: '_assignmentId', type: 'uint256', }, ], name: 'seizeMinerRole', outputs: [], stateMutability: 'nonpayable', type: 'function', }, { inputs: [ { internalType: 'uint256', name: '_newDAOTokenReward', type: 'uint256', }, ], name: 'setDAOTokenReward', outputs: [], stateMutability: 'nonpayable', type: 'function', }, { inputs: [ { internalType: 'address', name: '_wEAI', type: 'address', }, ], name: 'setWEAIAddress', outputs: [], stateMutability: 'nonpayable', type: 'function', }, { inputs: [ { internalType: 'uint256', name: '_assigmentId', type: 'uint256', }, { internalType: 'bytes', name: '_data', type: 'bytes', }, ], name: 'submitSolution', outputs: [], stateMutability: 'nonpayable', type: 'function', }, { inputs: [ { internalType: 'address', name: 'newOwner', type: 'address', }, ], name: 'transferOwnership', outputs: [], stateMutability: 'nonpayable', type: 'function', }, { inputs: [], name: 'unpause', outputs: [], stateMutability: 'nonpayable', type: 'function', }, { inputs: [ { internalType: 'bool', name: '_isReferred', type: 'bool', }, ], name: 'validateDAOSupplyIncrease', outputs: [ { internalType: 'bool', name: 'notReachedLimit', type: 'bool', }, ], stateMutability: 'view', type: 'function', }, { inputs: [], name: 'version', outputs: [ { internalType: 'string', name: '', type: 'string', }, ], stateMutability: 'pure', type: 'function', }, { stateMutability: 'payable', type: 'receive', }, ]; export const PROMPT_SCHEDULER_ABI: ethers.ContractInterface = [ { inputs: [], name: 'AlreadyCommitted', type: 'error', }, { inputs: [], name: 'AlreadyRevealed', type: 'error', }, { inputs: [], name: 'AlreadySeized', type: 'error', }, { inputs: [], name: 'AlreadySubmitted', type: 'error', }, { inputs: [], name: 'CannotFastForward', type: 'error', }, { inputs: [], name: 'CommitTimeout', type: 'error', }, { inputs: [], name: 'InvalidAddress', type: 'error', }, { inputs: [], name: 'InvalidCommitment', type: 'error', }, { inputs: [], name: 'InvalidContext', type: 'error', }, { inputs: [], name: 'InvalidData', type: 'error', }, { inputs: [], name: 'InvalidInferenceStatus', type: 'error', }, { inputs: [], name: 'InvalidMiner', type: 'error', }, { inputs: [], name: 'InvalidNonce', type: 'error', }, { inputs: [], name: 'InvalidReveal', type: 'error', }, { inputs: [], name: 'InvalidRole', type: 'error', }, { inputs: [], name: 'NotCommitted', type: 'error', }, { inputs: [], name: 'NotEnoughMiners', type: 'error', }, { inputs: [], name: 'OnlyAssignedWorker', type: 'error', }, { inputs: [], name: 'RevealTimeout', type: 'error', }, { inputs: [], name: 'SubmitTimeout', type: 'error', }, { inputs: [ { internalType: 'uint256', name: 'value', type: 'uint256', }, ], name: 'Uint256Set_DuplicatedValue', type: 'error', }, { inputs: [], name: 'Unauthorized', type: 'error', }, { anonymous: false, inputs: [ { indexed: true, internalType: 'address', name: 'miner', type: 'address', }, { indexed: true, internalType: 'uint256', name: 'assigmentId', type: 'uint256', }, { indexed: false, internalType: 'bytes32', name: 'commitment', type: 'bytes32', }, ], name: 'CommitmentSubmission', type: 'event', }, { anonymous: false, inputs: [ { indexed: false, internalType: 'uint256', name: 'chainId', type: 'uint256', }, { indexed: false, internalType: 'uint256', name: 'inferenceId', type: 'uint256', }, { indexed: false, internalType: 'address', name: 'modelAddress', type: 'address', }, { components: [ { internalType: 'address', name: 'receiver', type: 'address', }, { internalType: 'uint256', name: 'amount', type: 'uint256', }, { internalType: 'enum IWorkerHub.DAOTokenReceiverRole', name: 'role', type: 'uint8', }, ], indexed: false, internalType: 'struct IWorkerHub.DAOTokenReceiverInfor[]', name: 'receivers', type: 'tuple[]', }, ], name: 'DAOTokenMintedV2', type: 'event', }, { anonymous: false, inputs: [ { components: [ { internalType: 'uint16', name: 'minerPercentage', type: 'uint16', }, { internalType: 'uint16', name: 'userPercentage', type: 'uint16', }, { internalType: 'uint16', name: 'referrerPercentage', type: 'uint16', }, { internalType: 'uint16', name: 'refereePercentage', type: 'uint16', }, { internalType: 'uint16', name: 'l2OwnerPercentage', type: 'uint16', }, ], indexed: false, internalType: 'struct IWorkerHub.DAOTokenPercentage', name: 'oldValue', type: 'tuple', }, { components: [ { internalType: 'uint16', name: 'minerPercentage', type: 'uint16', }, { internalType: 'uint16', name: 'userPercentage', type: 'uint16', }, { internalType: 'uint16', name: 'referrerPercentage', type: 'uint16', }, { internalType: 'uint16', name: 'refereePercentage', type: 'uint16', }, { internalType: 'uint16', name: 'l2OwnerPercentage', type: 'uint16', }, ], indexed: false, internalType: 'struct IWorkerHub.DAOTokenPercentage', name: 'newValue', type: 'tuple', }, ], name: 'DAOTokenPercentageUpdated', type: 'event', }, { anonymous: false, inputs: [ { indexed: true, internalType: 'uint256', name: 'inferenceId', type: 'uint256', }, { indexed: false, internalType: 'enum IWorkerHub.InferenceStatus', name: 'newStatus', type: 'uint8', }, ], name: 'InferenceStatusUpdate', type: 'event', }, { anonymous: false, inputs: [ { indexed: false, internalType: 'uint8', name: 'version', type: 'uint8', }, ], name: 'Initialized', type: 'event', }, { anonymous: false, inputs: [ { indexed: true, internalType: 'uint256', name: 'assignmentId', type: 'uint256', }, { indexed: true, internalType: 'uint256', name: 'inferenceId', type: 'uint256', }, { indexed: true, internalType: 'address', name: 'miner', type: 'address', }, ], name: 'MinerRoleSeized', type: 'event', }, { anonymous: false, inputs: [ { indexed: true, internalType: 'uint256', name: 'assignmentId', type: 'uint256', }, { indexed: true, internalType: 'uint256', name: 'inferenceId', type: 'uint256', }, { indexed: true, internalType: 'address', name: 'miner', type: 'address', }, { indexed: false, internalType: 'uint40', name: 'expiredAt', type: 'uint40', }, ], name: 'NewAssignment', type: 'event', }, { anonymous: false, inputs: [ { indexed: true, internalType: 'uint256', name: 'inferenceId', type: 'uint256', }, { indexed: true, internalType: 'address', name: 'model', type: 'address', }, { indexed: true, internalType: 'address', name: 'creator', type: 'address', }, { indexed: false, internalType: 'uint256', name: 'value', type: 'uint256', }, { indexed: false, internalType: 'uint256', name: 'originInferenceId', type: 'uint256', }, ], name: 'NewInference', type: 'event', }, { anonymous: false, inputs: [ { indexed: true, internalType: 'address', name: 'previousOwner', type: 'address', }, { indexed: true, internalType: 'address', name: 'newOwner', type: 'address', }, ], name: 'OwnershipTransferred', type: 'event', }, { anonymous: false, inputs: [ { indexed: false, internalType: 'address', name: 'account', type: 'address', }, ], name: 'Paused', type: 'event', }, { anonymous: false, inputs: [ { indexed: true, internalType: 'uint256', name: 'inferenceId', type: 'uint256', }, { indexed: true, internalType: 'address', name: 'model', type: 'address', }, { indexed: true, internalType: 'address', name: 'creator', type: 'address', }, { indexed: false, internalType: 'uint256', name: 'value', type: 'uint256', }, { indexed: false, internalType: 'uint256', name: 'originInferenceId', type: 'uint256', }, { indexed: false, internalType: 'bytes', name: 'input', type: 'bytes', }, { indexed: false, internalType: 'bool', name: 'flag', type: 'bool', }, ], name: 'RawSubmitted', type: 'event', }, { anonymous: false, inputs: [ { indexed: true, internalType: 'address', name: 'miner', type: 'address', }, { indexed: true, internalType: 'uint256', name: 'assigmentId', type: 'uint256', }, { indexed: false, internalType: 'uint40', name: 'nonce', type: 'uint40', }, { indexed: false, internalType: 'bytes', name: 'output', type: 'bytes', }, ], name: 'RevealSubmission', type: 'event', }, { anonymous: false, inputs: [ { indexed: true, internalType: 'address', name: 'miner', type: 'address', }, { indexed: true, internalType: 'uint256', name: 'inferId', type: 'uint256', }, ], name: 'SolutionSubmission', type: 'event', }, { anonymous: false, inputs: [ { indexed: true, internalType: 'uint256', name: 'assignmentId', type: 'uint256', }, { indexed: false, internalType: 'bytes', name: 'data', type: 'bytes', }, ], name: 'StreamedData', type: 'event', }, { anonymous: false, inputs: [ { indexed: false, internalType: 'address', name: 'account', type: 'address', }, ], name: 'Unpaused', type: 'event', }, { inputs: [ { internalType: 'uint256', name: '_inferenceId', type: 'uint256', }, ], name: 'getInferenceInfo', outputs: [ { components: [ { internalType: 'uint256', name: 'value', type: 'uint256', }, { internalType: 'uint256', name: 'feeL2', type: 'uint256', }, { internalType: 'uint256', name: 'feeTreasury', type: 'uint256', }, { internalType: 'address', name: 'modelAddress', type: 'address', }, { internalType: 'uint40', name: 'submitTimeout', type: 'uint40', }, { internalType: 'enum IWorkerHub.InferenceStatus', name: 'status', type: 'uint8', }, { internalType: 'address', name: 'creator', type: 'address', }, { internalType: 'address', name: 'processedMiner', type: 'address', }, { internalType: 'address', name: 'referrer', type: 'address', }, { internalType: 'bytes', name: 'input', type: 'bytes', }, { internalType: 'bytes', name: 'output', type: 'bytes', }, ], internalType: 'struct IWorkerHub.Inference', name: '', type: 'tuple', }, ], stateMutability: 'view', type: 'function', }, { inputs: [ { internalType: 'address', name: '_modelAddress', type: 'address', }, ], name: 'getMinFeeToUse', outputs: [ { internalType: 'uint256', name: '', type: 'uint256', }, ], stateMutability: 'view', type: 'function', }, { inputs: [], name: 'getMinerRequirement', outputs: [ { internalType: 'uint8', name: '', type: 'uint8', }, ], stateMutability: 'view', type: 'function', }, { inputs: [], name: 'getSubmitDuration', outputs: [ { internalType: 'uint40', name: '', type: 'uint40', }, ], stateMutability: 'view', type: 'function', }, { inputs: [], name: 'getTreasuryAddress', outputs: [ { internalType: 'address', name: '', type: 'address', }, ], stateMutability: 'view', type: 'function', }, { inputs: [ { internalType: 'bytes', name: '_input', type: 'bytes', }, { internalType: 'address', name: '_creator', type: 'address', }, { internalType: 'bool', name: '_flag', type: 'bool', }, ], name: 'infer', outputs: [ { internalType: 'uint256', name: '', type: 'uint256', }, ], stateMutability: 'payable', type: 'function', }, { inputs: [ { internalType: 'bytes', name: '_input', type: 'bytes', }, { internalType: 'address', name: '_creator', type: 'address', }, ], name: 'infer', outputs: [ { internalType: 'uint256', name: '', type: 'uint256', }, ], stateMutability: 'payable', type: 'function', }, { inputs: [], name: 'inferenceNumber', outputs: [ { internalType: 'uint256', name: '', type: 'uint256', }, ], stateMutability: 'view', type: 'function', }, { inputs: [ { internalType: 'address', name: '_wEAI', type: 'address', }, { internalType: 'address', name: '_l2Owner', type: 'address', }, { internalType: 'address', name: '_treasury', type: 'address', }, { internalType: 'address', name: '_daoToken', type: 'address', }, { internalType: 'address', name: '_stakingHub', type: 'address', }, { internalType: 'uint16', name: '_feeL2Percentage', type: 'uint16', }, { internalType: 'uint16', name: '_feeTreasuryPercentage', type: 'uint16', }, { internalType: 'uint8', name: '_minerRequirement', type: 'uint8', }, { internalType: 'uint40', name: '_submitDuration', type: 'uint40', }, { internalType: 'uint16', name: '_feeRatioMinerValidor', type: 'uint16', }, { internalType: 'uint256', name: '_daoTokenReward', type: 'uint256', }, { components: [ { internalType: 'uint16', name: 'minerPercentage', type: 'uint16', }, { internalType: 'uint16', name: 'userPercentage', type: 'uint16', }, { internalType: 'uint16', name: 'referrerPercentage', type: 'uint16', }, { internalType: 'uint16', name: 'refereePercentage', type: 'uint16', }, { internalType: 'uint16', name: 'l2OwnerPercentage', type: 'uint16', }, ], internalType: 'struct IWorkerHub.DAOTokenPercentage', name: '_daoTokenPercentage', type: 'tuple', }, ], name: 'initialize', outputs: [], stateMutability: 'nonpayable', type: 'function', }, { inputs: [], name: 'owner', outputs: [ { internalType: 'address', name: '', type: 'address', }, ], stateMutability: 'view', type: 'function', }, { inputs: [], name: 'pause', outputs: [], stateMutability: 'nonpayable', type: 'function', }, { inputs: [], name: 'paused', outputs: [ { internalType: 'bool', name: '', type: 'bool', }, ], stateMutability: 'view', type: 'function', }, { inputs: [ { internalType: 'address[]', name: '_referrers', type: 'address[]', }, { internalType: 'address[]', name: '_referees', type: 'address[]', }, ], name: 'registerReferrer', outputs: [], stateMutability: 'nonpayable', type: 'function', }, { inputs: [], name: 'renounceOwnership', outputs: [], stateMutability: 'nonpayable', type: 'function', }, { inputs: [ { internalType: 'address', name: '_daoToken', type: 'address', }, ], name: 'setDAOTokenAddress', outputs: [], stateMutability: 'nonpayable', type: 'function', }, { inputs: [ { internalType: 'address', name: '_stakingHub', type: 'address', }, ], name: 'setStakingHubAddress', outputs: [], stateMutability: 'nonpayable', type: 'function', }, { inputs: [ { internalType: 'uint40', name: '_submitDuration', type: 'uint40', }, ], name: 'setSubmitDuration', outputs: [], stateMutability: 'nonpayable', type: 'function', }, { inputs: [ { internalType: 'address', name: '_wEAI', type: 'address', }, ], name: 'setWEAIAddress', outputs: [], stateMutability: 'nonpayable', type: 'function', }, { inputs: [], name: 'stakingHub', outputs: [ { internalType: 'address', name: '', type: 'address', }, ], stateMutability: 'view', type: 'function', }, { inputs: [ { internalType: 'uint256', name: '_inferId', type: 'uint256', }, { internalType: 'bytes', name: '_data', type: 'bytes', }, ], name: 'submitSolution', outputs: [], stateMutability: 'nonpayable', type: 'function', }, { inputs: [ { internalType: 'address', name: 'newOwner', type: 'address', }, ], name: 'transferOwnership', outputs: [], stateMutability: 'nonpayable', type: 'function', }, { inputs: [], name: 'unpause', outputs: [], stateMutability: 'nonpayable', type: 'function', }, { inputs: [], name: 'version', outputs: [ { internalType: 'string', name: '', type: 'string', }, ], stateMutability: 'pure', type: 'function', }, { stateMutability: 'payable', type: 'receive', }, ]; export const IPFS = 'ipfs://'; export const LIGHTHOUSE_IPFS = 'https://gateway.lighthouse.storage/ipfs/'; ================================================ FILE: EternalAI.js/packages/interact/src/methods/infer/index.ts ================================================ import * as ethers from 'ethers'; import { InteractWallet } from '../types'; import { Message, SendInferResponse } from './types'; import { AGENT_ABI, IPFS, LIGHTHOUSE_IPFS, PROMPT_SCHEDULER_ABI, WORKER_HUB_ABI, } from './constants'; import { ChainId } from '../../constants'; import { InferPayloadWithMessages, InferPayloadWithPrompt } from '../../types'; import { sleep } from '../../utils/time'; import { Fragment, LogDescription } from 'ethers/lib/utils'; import LightHouse from '@/services/light_house'; import injectDependency from '@/inject'; // this is inject supported packages const packages = { ethers: injectDependency('ethers'), }; const contracts: Record = {}; const getAgentContract = (contractAddress: string, wallet: InteractWallet) => { if (!contracts[contractAddress]) { contracts[contractAddress] = new packages.ethers.Contract( contractAddress, AGENT_ABI, wallet.provider ); } return contracts[contractAddress]; }; const getWorkerHubContract = ( contractAddress: string, wallet: InteractWallet ) => { if (!contracts[contractAddress]) { contracts[contractAddress] = new packages.ethers.Contract( contractAddress, PROMPT_SCHEDULER_ABI, wallet.provider ); } return contracts[contractAddress]; }; export class InferenceResponse { result_uri: string; storage: string; data: string; constructor(result_uri: string, storage: string, data: string) { this.result_uri = result_uri; this.storage = storage; this.data = data; } static fromJSON(json: string): InferenceResponse { const parsed = JSON.parse(json); return Object.assign(new InferenceResponse('', '', ''), parsed); } } const Infer = { convertMessagesToBytes: async ( messages: Message[], isLightHouse: boolean ) => { if (isLightHouse) { const uploadedUrl = await LightHouse.upload(JSON.stringify(messages)); return packages.ethers.utils.toUtf8Bytes(uploadedUrl); } return packages.ethers.utils.toUtf8Bytes( JSON.stringify({ messages, }) ); }, getSystemPrompt: async (contractAddress: string, wallet: InteractWallet) => { try { console.log('infer getSystemPrompt - start'); const contract = getAgentContract(contractAddress, wallet); const systemPrompt = await contract.getSystemPrompt(); console.log('infer getSystemPrompt - succeed', systemPrompt); return systemPrompt; } catch (e) { console.log('infer getSystemPrompt - failed'); throw e; } finally { console.log('infer getSystemPrompt - end'); } }, createPayloadWithPrompt: async ( wallet: InteractWallet, payload: InferPayloadWithPrompt ) => { try { console.log('infer createPayloadWithPrompt - start', payload); const contractAddress = payload.agentAddress; const contract = getAgentContract(contractAddress, wallet); const systemPrompt = await Infer.getSystemPrompt(contractAddress, wallet); const { chainId, prompt, isLightHouse } = payload; const promptPayload = await Infer.convertMessagesToBytes( [ { role: 'system', content: systemPrompt, }, { role: 'user', content: prompt, }, ], !!isLightHouse ); const callData = contract.interface.encodeFunctionData('prompt(bytes)', [ promptPayload, ]); const from = wallet.address || (await wallet.getAddress()); const [gasLimit, gasPrice, nonce] = await Promise.all([ contract.estimateGas.prompt(promptPayload), wallet.provider.getGasPrice(), wallet.provider.getTransactionCount(from), ]); const params = { to: contractAddress, // smart contract address from: from, // sender address data: callData, // data chainId: packages.ethers.BigNumber.from(chainId).toNumber(), gasLimit: gasLimit, gasPrice: gasPrice, nonce: nonce, } satisfies ethers.ethers.providers.TransactionRequest; console.log('infer createPayloadWithPrompt - succeed', params); return params; } catch (e) { console.log('infer createPayloadWithPrompt - failed'); throw e; } finally { console.log('infer createPayloadWithPrompt - end'); } }, createPayloadWithMessages: async ( wallet: InteractWallet, payload: InferPayloadWithMessages ) => { try { console.log('infer createPayloadWithMessages - start', payload); const contractAddress = payload.agentAddress; const contract = getAgentContract(contractAddress, wallet); const { chainId, messages, isLightHouse } = payload; const promptPayload = await Infer.convertMessagesToBytes( messages, !!isLightHouse ); const callData = contract.interface.encodeFunctionData('prompt(bytes)', [ promptPayload, ]); const from = wallet.address || (await wallet.getAddress()); const [gasLimit, gasPrice, nonce] = await Promise.all([ contract.estimateGas.prompt(promptPayload), wallet.provider.getGasPrice(), wallet.provider.getTransactionCount(from), ]); const params = { to: contractAddress, from: from, data: callData, chainId: packages.ethers.BigNumber.from(chainId).toNumber(), gasLimit: gasLimit, gasPrice: gasPrice, nonce: nonce, } satisfies ethers.ethers.providers.TransactionRequest; console.log('infer createPayloadWithMessages - succeed', params); return params; } catch (e) { console.log('infer createPayloadWithMessages - failed'); throw e; } finally { console.log('infer createPayloadWithMessages - end'); } }, sendPrompt: async ( wallet: InteractWallet, signedTx: string ): Promise => { try { console.log('infer execute - start'); console.log('infer execute - send transaction', signedTx); const txResponse = await wallet.provider.sendTransaction(signedTx); console.log('infer execute - waiting', txResponse); const receipt = await txResponse.wait(); return receipt.transactionHash; } catch (e) { console.log('infer execute - failed'); throw e; } finally { console.log('infer execute - end'); } }, getWorkerHubAddress: async (agentAddress: string, wallet: InteractWallet) => { try { console.log('infer getWorkerHubAddress - start', { agentAddress, }); const contractAddress = agentAddress; const contract = getAgentContract(contractAddress, wallet); const schedule = await contract.getPromptSchedulerAddress(); console.log('infer getWorkerHubAddress - succeed', schedule); return schedule; } catch (e) { console.log('infer getWorkerHubAddress - failed'); throw e; } finally { console.log('infer getWorkerHubAddress - end'); } }, getInferId: async (wallet: InteractWallet, promptedTxHash: string) => { const txReceipt = await wallet.provider.getTransactionReceipt( promptedTxHash ); if (!txReceipt || txReceipt.status != 1) { throw new Error('Transaction receipt not found.'); } else { try { const iface = new packages.ethers.utils.Interface( WORKER_HUB_ABI as ReadonlyArray ); const events = txReceipt.logs .map((log) => { try { return iface.parseLog(log); } catch (error) { return null; } }) .filter((event) => event !== null); const newInference = events?.find( ((event: LogDescription) => event.name === 'NewInference') as any ); return newInference?.args?.inferenceId; } catch (e) { throw new Error('No Infer Id'); } } }, processOutput: (out: any) => { const str: string = packages.ethers.utils.toUtf8String(out); try { const result = InferenceResponse.fromJSON(str); return result; } catch (e) { return null; } }, processOutputToInferResponse: async (output: ethers.Bytes) => { const inferResponse = Infer.processOutput(output); if (!inferResponse) { return null; } else { if ( inferResponse.storage == 'lighthouse-filecoint' || inferResponse.result_uri.includes('ipfs://') ) { const light_house = inferResponse.result_uri.replace( IPFS, LIGHTHOUSE_IPFS ); const light_house_reponse = await fetch(light_house); if (light_house_reponse.ok) { const result = await light_house_reponse.text(); return result; } return null; } else { if (inferResponse.data != '') { const decodedString = atob(inferResponse.data); return decodedString; } return null; } } }, getInferenceById: async ( wallet: InteractWallet, workerHubAddress: string, inferId: string, chainId: ChainId ) => { if (chainId === ChainId.BSC) { const contract = getWorkerHubContract(workerHubAddress, wallet); const inferenceInfo = await contract.getInferenceInfo(inferId); const output = inferenceInfo[10]; const bytesData = packages.ethers.utils.arrayify(output); if (bytesData.length != 0) { const result = await Infer.processOutputToInferResponse(bytesData); if (result) { return result; } else { return null; } } else { throw new Error(`waiting process inference ${inferId}`); } } else if (chainId === ChainId.BASE) { const contract = getWorkerHubContract(workerHubAddress, wallet); const assignIds = await contract.getInferenceInfo(inferId); if (assignIds.length == 0) { throw new Error('No assignment found'); } const assignId = assignIds[0]; const assignInfo = await contract.getAssignmentInfo(assignId); if (assignInfo.length == 0) { throw new Error('Inference result not ready'); } const output = assignInfo[7]; const bytesData = packages.ethers.utils.arrayify(output); if (bytesData.length != 0) { const result = await Infer.processOutputToInferResponse(bytesData); if (result) { return result; } else { return null; } } else { throw new Error(`waiting process inference ${inferId}`); } } else { throw Error('Unsupported chainId'); } }, listenPromptResponse: async ( chainId: ChainId, wallet: InteractWallet, workerHubAddress: string, promptedTxHash: string ) => { try { console.log('infer listenPromptResponse - start', { chainId, workerHubAddress, promptedTxHash, }); let result: string | null = null; const inferId = await Infer.getInferId(wallet, promptedTxHash); while (true) { try { result = await Infer.getInferenceById( wallet, workerHubAddress, inferId, chainId ); break; } catch (e) { console.log('Retry to get inference by reference id'); await sleep(30); } } console.log('infer listenPromptResponse - succeed', result); return result; } catch (e) { console.log('infer listenPromptResponse - failed'); throw e; } finally { console.log('infer listenPromptResponse - end'); } }, }; export default Infer; ================================================ FILE: EternalAI.js/packages/interact/src/methods/infer/types.ts ================================================ export type Message = { role: 'system' | 'user' | 'assistant'; content: string; }; export type SendInferResponse = string; export type ListenInferPayload = SendInferResponse; ================================================ FILE: EternalAI.js/packages/interact/src/methods/types.ts ================================================ import * as ethers from 'ethers'; export interface InteractWallet { provider: ethers.providers.Provider; getAddress: () => Promise; address: string; } export type InteractMethod = { createPayload: (payload: P) => R; execute: (signedTx: string) => Promise; }; ================================================ FILE: EternalAI.js/packages/interact/src/services/light_house.ts ================================================ const LightHouse = { upload: async (content: string) => { console.log('LightHouse - Upload content to light house'); const res = await fetch( 'https://api.eternalai.org/api/service/light-house/upload/public', { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ content }), } ); if (!res.ok) { throw new Error(`Light house upload failed: ${res.statusText}`); } const data = await res.json(); console.log('LightHouse - Upload succeed - url', data.data); // https://gateway.lighthouse.storage/ipfs/bafkreiddf4lmd3nfd5ebusz2ho3usvivmknwf3u6dabjfu2fcptgvrhbvm return data.data; }, }; export default LightHouse; ================================================ FILE: EternalAI.js/packages/interact/src/types.ts ================================================ import * as ethers from 'ethers'; import { ChainId } from './constants'; import { Message } from './methods/infer/types'; import { InteractWallet } from './methods/types'; type InferPayloadBase = { agentAddress: string; isLightHouse?: boolean; rpcUrl?: string; }; export type InferPayloadWithPrompt = InferPayloadBase & { chainId: ChainId; prompt: string; }; export type InferPayloadWithMessages = InferPayloadBase & { chainId: ChainId; messages: Message[]; }; export type ExternalWallet = Pick & { requestSignature: ( transaction: ethers.ethers.providers.TransactionRequest ) => Promise; }; ================================================ FILE: EternalAI.js/packages/interact/src/utils/time.ts ================================================ export const sleep = async (ms: number) => { return new Promise((resolve) => { setTimeout(resolve, ms); }); }; ================================================ FILE: EternalAI.js/packages/interact/test/blah.test.ts ================================================ import { sum } from '../src'; describe('blah', () => { it('works', () => { expect(sum(1, 1)).toEqual(2); }); }); ================================================ FILE: EternalAI.js/packages/interact/tsconfig.json ================================================ { "compilerOptions": { "target": "esnext", "module": "commonjs", "lib": ["dom", "esnext"], "jsx": "react-jsx", "strict": true, "moduleResolution": "node", "esModuleInterop": true, "skipLibCheck": true, "forceConsistentCasingInFileNames": true, "declaration": true, "declarationMap": true, "sourceMap": true, "outDir": "dist", "baseUrl": ".", "paths": { "@/*": ["src/*"] }, "resolveJsonModule": true }, "include": ["src", "src/**/*.d.ts"], "exclude": ["node_modules", "dist"] } ================================================ FILE: EternalAI.js/packages/langchain/.eslintrc.cjs ================================================ module.exports = { extends: [ "airbnb-base", "eslint:recommended", "prettier", "plugin:@typescript-eslint/recommended", ], parserOptions: { ecmaVersion: 12, parser: "@typescript-eslint/parser", project: "./tsconfig.json", sourceType: "module", }, plugins: ["@typescript-eslint", "no-instanceof"], ignorePatterns: [ ".eslintrc.cjs", "scripts", "node_modules", "dist", "dist-cjs", "*.js", "*.cjs", "*.d.ts", ], rules: { "no-process-env": 2, "no-instanceof/no-instanceof": 2, "@typescript-eslint/explicit-module-boundary-types": 0, "@typescript-eslint/no-empty-function": 0, "@typescript-eslint/no-shadow": 0, "@typescript-eslint/no-empty-interface": 0, "@typescript-eslint/no-use-before-define": ["error", "nofunc"], "@typescript-eslint/no-unused-vars": ["warn", { args: "none" }], "@typescript-eslint/no-floating-promises": "error", "@typescript-eslint/no-misused-promises": "error", camelcase: 0, "class-methods-use-this": 0, "import/extensions": [2, "ignorePackages"], "import/no-extraneous-dependencies": [ "error", { devDependencies: ["**/*.test.ts"] }, ], "import/no-unresolved": 0, "import/prefer-default-export": 0, "keyword-spacing": "error", "max-classes-per-file": 0, "max-len": 0, "no-await-in-loop": 0, "no-bitwise": 0, "no-console": 0, "no-restricted-syntax": 0, "no-shadow": 0, "no-continue": 0, "no-void": 0, "no-underscore-dangle": 0, "no-use-before-define": 0, "no-useless-constructor": 0, "no-return-await": 0, "consistent-return": 0, "no-else-return": 0, "func-names": 0, "no-lonely-if": 0, "prefer-rest-params": 0, "new-cap": ["error", { properties: false, capIsNew: false }], }, overrides: [ { files: ["**/*.test.ts"], rules: { "@typescript-eslint/no-unused-vars": "off", }, }, ], }; ================================================ FILE: EternalAI.js/packages/langchain/.gitignore ================================================ node_modules dist .yarn ================================================ FILE: EternalAI.js/packages/langchain/.prettierrc ================================================ { "$schema": "https://json.schemastore.org/prettierrc", "printWidth": 80, "tabWidth": 2, "useTabs": false, "semi": true, "singleQuote": false, "quoteProps": "as-needed", "jsxSingleQuote": false, "trailingComma": "es5", "bracketSpacing": true, "arrowParens": "always", "requirePragma": false, "insertPragma": false, "proseWrap": "preserve", "htmlWhitespaceSensitivity": "css", "vueIndentScriptAndStyle": false, "endOfLine": "lf" } ================================================ FILE: EternalAI.js/packages/langchain/.release-it.json ================================================ { "github": { "release": true, "autoGenerate": true, "tokenRef": "GITHUB_TOKEN_RELEASE" }, "npm": { "versionArgs": ["--workspaces-update=false"] } } ================================================ FILE: EternalAI.js/packages/langchain/LICENSE ================================================ The MIT License Copyright (c) 2023 LangChain Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: EternalAI.js/packages/langchain/README.md ================================================ # @langchain/eternalai This package contains the LangChain.js integrations for eternalai through their SDK. ## Installation ```bash npm2yarn npm install @langchain/eternalai @langchain/core ``` This package, along with the main LangChain package, depends on [`@langchain/core`](https://npmjs.com/package/@langchain/core/). If you are using this package with other LangChain packages, you should make sure that all of the packages depend on the same instance of `@langchain/core`. You can do so by adding appropriate field to your project's `package.json` like this: ```json { "name": "your-project", "version": "0.0.0", "dependencies": { "@langchain/eternalai": "^0.0.0", "@langchain/core": "^0.3.0" }, "resolutions": { "@langchain/core": "^0.3.0" }, "overrides": { "@langchain/core": "^0.3.0" }, "pnpm": { "overrides": { "@langchain/core": "^0.3.0" } } } ``` The field you need depends on the package manager you're using, but we recommend adding a field for the common `yarn`, `npm`, and `pnpm` to maximize compatibility. ## Chat Models This package contains the `` class, which is the recommended way to interface with the eternalai series of models. To use, install the requirements, and configure your environment. ```bash export =your-api-key ``` Then initialize ```typescript import { } from "@langchain/eternalai"; const model = new ExampleChatClass({ apiKey: process.env.EXAMPLE_API_KEY, }); const response = await model.invoke(new HumanMessage("Hello world!")); ``` ## Development To develop the eternalai package, you'll need to follow these instructions: ### Install dependencies ```bash yarn install ``` ### Build the package ```bash yarn build ``` Or from the repo root: ```bash yarn build --filter=@langchain/eternalai ``` ### Run tests Test files should live within a `tests/` file in the `src/` folder. Unit tests should end in `.test.ts` and integration tests should end in `.int.test.ts`: ```bash $ yarn test $ yarn test:int ``` ### Lint & Format Run the linter & formatter to ensure your code is up to standard: ```bash yarn lint && yarn format ``` ### Adding new entrypoints If you add a new file to be exported, either import & re-export from `src/index.ts`, or add it to the `entrypoints` field in the `config` variable located inside `langchain.config.js` and run `yarn build` to generate the new entrypoint. ================================================ FILE: EternalAI.js/packages/langchain/jest.config.cjs ================================================ /** @type {import('ts-jest').JestConfigWithTsJest} */ module.exports = { preset: "ts-jest/presets/default-esm", testEnvironment: "./jest.env.cjs", modulePathIgnorePatterns: ["dist/", "docs/"], moduleNameMapper: { "^(\\.{1,2}/.*)\\.js$": "$1", }, transform: { "^.+\\.tsx?$": ["@swc/jest"], }, transformIgnorePatterns: [ "/node_modules/", "\\.pnp\\.[^\\/]+$", "./scripts/jest-setup-after-env.js", ], setupFiles: ["dotenv/config"], testTimeout: 20_000, passWithNoTests: true, collectCoverageFrom: ["src/**/*.ts"], }; ================================================ FILE: EternalAI.js/packages/langchain/jest.env.cjs ================================================ const { TestEnvironment } = require("jest-environment-node"); class AdjustedTestEnvironmentToSupportFloat32Array extends TestEnvironment { constructor(config, context) { // Make `instanceof Float32Array` return true in tests // to avoid https://github.com/xenova/transformers.js/issues/57 and https://github.com/jestjs/jest/issues/2549 super(config, context); this.global.Float32Array = Float32Array; } } module.exports = AdjustedTestEnvironmentToSupportFloat32Array; ================================================ FILE: EternalAI.js/packages/langchain/langchain.config.js ================================================ import { resolve, dirname } from "node:path"; import { fileURLToPath } from "node:url"; /** * @param {string} relativePath * @returns {string} */ function abs(relativePath) { return resolve(dirname(fileURLToPath(import.meta.url)), relativePath); } export const config = { internals: [/node\:/, /@langchain\/core\//], entrypoints: { index: "index", }, requiresOptionalDependency: [], tsConfigPath: resolve("./tsconfig.json"), cjsSource: "./dist-cjs", cjsDestination: "./dist", abs, }; ================================================ FILE: EternalAI.js/packages/langchain/package.json ================================================ { "name": "eternalai", "version": "0.0.0", "description": "Eternalai integration for LangChain.js", "type": "module", "engines": { "node": ">=18" }, "main": "./index.js", "types": "./index.d.ts", "repository": { "type": "git", "url": "git@github.com:langchain-ai/langchainjs.git" }, "homepage": "https://github.com/langchain-ai/langchainjs/tree/main/libs/eternalai/", "scripts": { "build": "yarn turbo:command build:internal --filter=@langchain/eternalai", "build:internal": "yarn lc_build --create-entrypoints --pre --tree-shaking", "lint:eslint": "NODE_OPTIONS=--max-old-space-size=4096 eslint --cache --ext .ts,.js src/", "lint:dpdm": "dpdm --exit-code circular:1 --no-warning --no-tree src/*.ts src/**/*.ts", "lint": "yarn lint:eslint && yarn lint:dpdm", "lint:fix": "yarn lint:eslint --fix && yarn lint:dpdm", "clean": "rm -rf .turbo dist/", "prepack": "yarn build", "test": "NODE_OPTIONS=--experimental-vm-modules jest --testPathIgnorePatterns=\\.int\\.test.ts --testTimeout 30000 --maxWorkers=50%", "test:watch": "NODE_OPTIONS=--experimental-vm-modules jest --watch --testPathIgnorePatterns=\\.int\\.test.ts", "test:single": "NODE_OPTIONS=--experimental-vm-modules yarn run jest --config jest.config.cjs --testTimeout 100000", "test:int": "NODE_OPTIONS=--experimental-vm-modules jest --testPathPattern=\\.int\\.test.ts --testTimeout 100000 --maxWorkers=50%", "format": "prettier --config .prettierrc --write \"src\"", "format:check": "prettier --config .prettierrc --check \"src\"" }, "author": "LangChain", "license": "MIT", "peerDependencies": { "@langchain/core": ">=0.3.0 <0.4.0" }, "devDependencies": { "@jest/globals": "^29.5.0", "@swc/core": "^1.3.90", "@swc/jest": "^0.2.29", "@langchain/core": "^0.3.40", "@langchain/scripts": ">=0.1.0 <0.2.0", "@tsconfig/recommended": "^1.0.3", "@typescript-eslint/eslint-plugin": "^6.12.0", "@typescript-eslint/parser": "^6.12.0", "dotenv": "^16.3.1", "dpdm": "^3.12.0", "release-it": "^15.10.1", "eslint": "^8.33.0", "eslint-config-airbnb-base": "^15.0.0", "eslint-config-prettier": "^8.6.0", "eslint-plugin-import": "^2.27.5", "eslint-plugin-no-instanceof": "^1.0.1", "eslint-plugin-prettier": "^4.2.1", "jest": "^29.5.0", "jest-environment-node": "^29.6.4", "prettier": "^2.8.3", "rollup": "^4.5.2", "ts-jest": "^29.1.0", "typescript": "<5.2.0" }, "publishConfig": { "access": "public" }, "exports": { ".": { "types": { "import": "./index.d.ts", "require": "./index.d.cts", "default": "./index.d.ts" }, "import": "./index.js", "require": "./index.cjs" }, "./package.json": "./package.json" }, "files": [ "dist/", "index.cjs", "index.js", "index.d.ts", "index.d.cts" ] } ================================================ FILE: EternalAI.js/packages/langchain/scripts/jest-setup-after-env.js ================================================ import { awaitAllCallbacks } from "@langchain/core/callbacks/promises"; import { afterAll, jest } from "@jest/globals"; afterAll(awaitAllCallbacks); // Allow console.log to be disabled in tests if (process.env.DISABLE_CONSOLE_LOGS === "true") { console.log = jest.fn(); } ================================================ FILE: EternalAI.js/packages/langchain/src/chat_models.ts ================================================ import { type BaseMessage } from "@langchain/core/messages"; import { type BaseLanguageModelCallOptions } from "@langchain/core/language_models/base"; import { CallbackManagerForLLMRun } from "@langchain/core/callbacks/manager"; import { type BaseChatModelParams, SimpleChatModel, } from "@langchain/core/language_models/chat_models"; // Uncomment if implementing streaming // import { // ChatGenerationChunk, // } from "@langchain/core/outputs"; // import { // AIMessageChunk, // } from "@langchain/core/messages"; // Uncomment if implementing tool calling // import { // type BindToolsInput, // } from "@langchain/core/language_models/chat_models"; /** * Input to chat model class. */ export interface ChatIntegrationInput extends BaseChatModelParams {} /** * Integration with a chat model. */ export class ChatIntegration // Extend BaseLanguageModelCallOptions and pass it as the generic here // to support typing for additional runtime parameters for your integration extends SimpleChatModel implements ChatIntegrationInput { // Used for tracing, replace with the same name as your class static lc_name() { return "ChatIntegration"; } lc_serializable = true; /** * Replace with any secrets this class passes to `super`. * See {@link ../../langchain-cohere/src/chat_model.ts} for * an example. */ get lc_secrets(): { [key: string]: string } | undefined { return { apiKey: "API_KEY_NAME", }; } get lc_aliases(): { [key: string]: string } | undefined { return { apiKey: "API_KEY_NAME", }; } constructor(fields?: ChatIntegrationInput) { super(fields ?? {}); } // Replace _llmType() { return "chat_integration"; } /** * For some given input messages and options, return a string output. */ _call( _messages: BaseMessage[], _options: this["ParsedCallOptions"], _runManager?: CallbackManagerForLLMRun ): Promise { throw new Error("Not implemented."); } /** * Implement to support streaming. * Should yield chunks iteratively. */ // async *_streamResponseChunks( // messages: BaseMessage[], // options: this["ParsedCallOptions"], // runManager?: CallbackManagerForLLMRun // ): AsyncGenerator { // // All models have a built in `this.caller` property for retries // const stream = await this.caller.call(async () => // createStreamMethod() // ); // for await (const chunk of stream) { // if (!chunk.done) { // yield new ChatGenerationChunk({ // text: chunk.response, // message: new AIMessageChunk({ content: chunk.response }), // }); // await runManager?.handleLLMNewToken(chunk.response ?? ""); // } // } // } /** * Implement to support tool calling. * You must also pass the bound tools into your actual chat completion call. * See {@link ../../langchain-cerberas/src/chat_model.ts} for * an example. */ // override bindTools( // tools: BindToolsInput[], // kwargs?: Partial // ): Runnable { // return this.bind({ // tools: tools.map((tool) => convertToIntegrationFormat(tool)), // ...kwargs, // }); // } /** @ignore */ _combineLLMOutput() { return []; } } ================================================ FILE: EternalAI.js/packages/langchain/src/index.ts ================================================ export * from "./chat_models.js"; export * from "./llms.js"; export * from "./vectorstores.js"; ================================================ FILE: EternalAI.js/packages/langchain/src/llms.ts ================================================ import { CallbackManagerForLLMRun } from "@langchain/core/callbacks/manager"; import { LLM, type BaseLLMParams } from "@langchain/core/language_models/llms"; import { type BaseLanguageModelCallOptions } from "@langchain/core/language_models/base"; // Uncomment if implementing streaming // import { // GenerationChunk, // } from "@langchain/core/outputs"; /** * Input to LLM class. */ export interface LLMIntegrationInput extends BaseLLMParams {} /** * Integration with an LLM. */ export class LLMIntegration extends LLM implements LLMIntegrationInput { // Used for tracing, replace with the same name as your class static lc_name() { return "LLMIntegration"; } lc_serializable = true; constructor(fields: LLMIntegrationInput) { super(fields); } // Replace _llmType() { return "llm_integration"; } /** * Replace with any secrets this class passes to `super`. * See {@link ../../langchain-cohere/src/chat_model.ts} for * an example. */ get lc_secrets(): { [key: string]: string } | undefined { return { apiKey: "API_KEY_NAME", }; } get lc_aliases(): { [key: string]: string } | undefined { return { apiKey: "API_KEY_NAME", }; } /** * For some given input string and options, return a string output. */ async _call( _prompt: string, _options: this["ParsedCallOptions"], _runManager?: CallbackManagerForLLMRun ): Promise { throw new Error("Not implemented."); } /** * Implement to support streaming. * Should yield chunks iteratively. */ // async *_streamResponseChunks( // prompt: string, // options: this["ParsedCallOptions"], // runManager?: CallbackManagerForLLMRun // ): AsyncGenerator { // const stream = await this.caller.call(async () => // createStream() // ); // for await (const chunk of stream) { // yield new GenerationChunk({ // text: chunk.response, // generationInfo: { // ...chunk, // response: undefined, // }, // }); // await runManager?.handleLLMNewToken(chunk.response ?? ""); // } // } } ================================================ FILE: EternalAI.js/packages/langchain/src/tests/chat_models.test.ts ================================================ import { test } from "@jest/globals"; test("Test chat model", async () => { // Your test here }); ================================================ FILE: EternalAI.js/packages/langchain/src/tests/integration.int.test.ts ================================================ import { test } from "@jest/globals"; test("Test chat model", async () => { // Your integration test here }); ================================================ FILE: EternalAI.js/packages/langchain/src/tests/llms.test.ts ================================================ import { test } from "@jest/globals"; test("Test LLM", async () => { // Your test here }); ================================================ FILE: EternalAI.js/packages/langchain/src/tests/vectorstores.test.ts ================================================ import { test } from "@jest/globals"; test("Test vectorstore", async () => { // Your test here }); ================================================ FILE: EternalAI.js/packages/langchain/src/vectorstores.ts ================================================ import type { EmbeddingsInterface } from "@langchain/core/embeddings"; import { VectorStore } from "@langchain/core/vectorstores"; import { Document } from "@langchain/core/documents"; /** * Database config for your vectorstore. */ export interface VectorstoreIntegrationParams {} /** * Class for managing and operating vector search applications with * Tigris, an open-source Serverless NoSQL Database and Search Platform. */ export class VectorstoreIntegration extends VectorStore { // Replace _vectorstoreType(): string { return "vectorstore_integration"; } constructor( embeddings: EmbeddingsInterface, params: VectorstoreIntegrationParams ) { super(embeddings, params); this.embeddings = embeddings; } /** * Replace with any secrets this class passes to `super`. * See {@link ../../langchain-cohere/src/chat_model.ts} for * an example. */ get lc_secrets(): { [key: string]: string } | undefined { return { apiKey: "API_KEY_NAME", }; } get lc_aliases(): { [key: string]: string } | undefined { return { apiKey: "API_KEY_NAME", }; } /** * Method to add an array of documents to the vectorstore. * * Useful to override in case your vectorstore doesn't work directly with embeddings. */ async addDocuments( documents: Document[], options?: { ids?: string[] } | string[] ): Promise { const texts = documents.map(({ pageContent }) => pageContent); await this.addVectors( await this.embeddings.embedDocuments(texts), documents, options ); } /** * Method to add raw vectors to the vectorstore. */ async addVectors( _vectors: number[][], _documents: Document[], _options?: { ids?: string[] } | string[] ) { throw new Error("Not implemented."); } /** * Method to perform a similarity search over the vectorstore and return * the k most similar vectors along with their similarity scores. */ async similaritySearchVectorWithScore( _query: number[], _k: number, _filter?: object ): Promise<[Document, number][]> { throw new Error("Not implemented."); } /** * Static method to create a new instance of the vectorstore from an * array of Document instances. * * Other common static initializer names are fromExistingIndex, initialize, and fromTexts. */ static async fromDocuments( docs: Document[], embeddings: EmbeddingsInterface, dbConfig: VectorstoreIntegrationParams ): Promise { const instance = new this(embeddings, dbConfig); await instance.addDocuments(docs); return instance; } } ================================================ FILE: EternalAI.js/packages/langchain/tsconfig.cjs.json ================================================ { "extends": "./tsconfig.json", "compilerOptions": { "module": "commonjs", "declaration": false }, "exclude": ["node_modules", "dist", "docs", "**/tests"] } ================================================ FILE: EternalAI.js/packages/langchain/tsconfig.json ================================================ { "extends": "@tsconfig/recommended", "compilerOptions": { "outDir": "../dist", "rootDir": "./src", "target": "ES2021", "lib": ["ES2021", "ES2022.Object", "DOM"], "module": "ES2020", "moduleResolution": "nodenext", "esModuleInterop": true, "declaration": true, "noImplicitReturns": true, "noFallthroughCasesInSwitch": true, "noUnusedLocals": true, "noUnusedParameters": true, "useDefineForClassFields": true, "strictPropertyInitialization": false, "allowJs": true, "strict": true }, "include": ["src/**/*"], "exclude": ["node_modules", "dist", "docs"] } ================================================ FILE: EternalAI.js/packages/langchain/turbo.json ================================================ { "extends": ["//"], "pipeline": { "build": { "outputs": ["**/dist/**"] }, "build:internal": { "dependsOn": ["^build:internal"] } } } ================================================ FILE: EternalAI.js/packages/ui/.gitignore ================================================ # Logs logs *.log npm-debug.log* yarn-debug.log* yarn-error.log* pnpm-debug.log* lerna-debug.log* node_modules dist dist-ssr *.local # Editor directories and files .vscode/* !.vscode/extensions.json .idea .DS_Store *.suo *.ntvs* *.njsproj *.sln *.sw? ================================================ FILE: EternalAI.js/packages/ui/README.md ================================================ # React + TypeScript + Vite This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules. Currently, two official plugins are available: - [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh - [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh ## Expanding the ESLint configuration If you are developing a production application, we recommend updating the configuration to enable type aware lint rules: - Configure the top-level `parserOptions` property like this: ```js export default tseslint.config({ languageOptions: { // other options... parserOptions: { project: ['./tsconfig.node.json', './tsconfig.app.json'], tsconfigRootDir: import.meta.dirname, }, }, }) ``` - Replace `tseslint.configs.recommended` to `tseslint.configs.recommendedTypeChecked` or `tseslint.configs.strictTypeChecked` - Optionally add `...tseslint.configs.stylisticTypeChecked` - Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and update the config: ```js // eslint.config.js import react from 'eslint-plugin-react' export default tseslint.config({ // Set the react version settings: { react: { version: '18.3' } }, plugins: { // Add the react plugin react, }, rules: { // other rules... // Enable its recommended rules ...react.configs.recommended.rules, ...react.configs['jsx-runtime'].rules, }, }) ``` ================================================ FILE: EternalAI.js/packages/ui/eslint.config.js ================================================ import js from '@eslint/js' import globals from 'globals' import reactHooks from 'eslint-plugin-react-hooks' import reactRefresh from 'eslint-plugin-react-refresh' import tseslint from 'typescript-eslint' export default tseslint.config( { ignores: ['dist'] }, { extends: [js.configs.recommended, ...tseslint.configs.recommended], files: ['**/*.{ts,tsx}'], languageOptions: { ecmaVersion: 2020, globals: globals.browser, }, plugins: { 'react-hooks': reactHooks, 'react-refresh': reactRefresh, }, rules: { ...reactHooks.configs.recommended.rules, 'react-refresh/only-export-components': [ 'warn', { allowConstantExport: true }, ], }, }, ) ================================================ FILE: EternalAI.js/packages/ui/index.html ================================================ Vite + React + TS
================================================ FILE: EternalAI.js/packages/ui/package.json ================================================ { "name": "@eternalai.js/ui", "private": true, "version": "0.1.0", "type": "module", "scripts": { "start": "vite", "dev": "vite", "build-test": "tsc -b && vite build", "lint": "eslint .", "preview": "vite preview" }, "dependencies": { "ethers": "5.7.2", "react": "^19.0.0", "react-dom": "^19.0.0" }, "devDependencies": { "@eternalai.js/core": "*", "@eternalai.js/interact": "*", "@eslint/js": "^9.19.0", "@types/react": "^19.0.8", "@types/react-dom": "^19.0.3", "@vitejs/plugin-react": "^4.3.4", "eslint": "^9.19.0", "eslint-plugin-react-hooks": "^5.0.0", "eslint-plugin-react-refresh": "^0.4.18", "globals": "^15.14.0", "react-router": "^7.1.1", "typescript": "~5.7.2", "typescript-eslint": "^8.22.0", "vite": "^6.1.0" } } ================================================ FILE: EternalAI.js/packages/ui/public/bundle.iife.js ================================================ var Interact=function(e,t){"use strict";function n(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var a=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,a.get?a:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var a=n(t);const i=[{inputs:[{internalType:"string",name:"name_",type:"string"},{internalType:"string",name:"symbol_",type:"string"},{internalType:"uint256",name:"amount_",type:"uint256"},{internalType:"address",name:"recipient_",type:"address"},{internalType:"address",name:"promptScheduler_",type:"address"},{internalType:"address",name:"modelAddress_",type:"address"},{internalType:"string",name:"systemPrompt_",type:"string"},{internalType:"bytes",name:"storageInfo_",type:"bytes"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[],name:"InvalidAddress",type:"error"},{inputs:[],name:"InvalidData",type:"error"},{inputs:[],name:"InvalidShortString",type:"error"},{inputs:[{internalType:"string",name:"str",type:"string"}],name:"StringTooLong",type:"error"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"delegator",type:"address"},{indexed:!0,internalType:"address",name:"fromDelegate",type:"address"},{indexed:!0,internalType:"address",name:"toDelegate",type:"address"}],name:"DelegateChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"delegate",type:"address"},{indexed:!1,internalType:"uint256",name:"previousBalance",type:"uint256"},{indexed:!1,internalType:"uint256",name:"newBalance",type:"uint256"}],name:"DelegateVotesChanged",type:"event"},{anonymous:!1,inputs:[],name:"EIP712DomainChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"hybridModel",type:"address"}],name:"ModelUpdate",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"caller",type:"address"},{indexed:!0,internalType:"uint256",name:"inferId",type:"uint256"},{indexed:!1,internalType:"bytes",name:"request",type:"bytes"}],name:"PromptPerformed",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"promptScheduler",type:"address"}],name:"PromptSchedulerHubUpdate",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"string",name:"systemPrompt",type:"string"}],name:"SystemPromptUpdate",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Transfer",type:"event"},{inputs:[],name:"CLOCK_MODE",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"DOMAIN_SEPARATOR",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"}],name:"allowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"approve",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"uint32",name:"pos",type:"uint32"}],name:"checkpoints",outputs:[{components:[{internalType:"uint32",name:"fromBlock",type:"uint32"},{internalType:"uint224",name:"votes",type:"uint224"}],internalType:"struct ERC20Votes.Checkpoint",name:"",type:"tuple"}],stateMutability:"view",type:"function"},{inputs:[],name:"clock",outputs:[{internalType:"uint48",name:"",type:"uint48"}],stateMutability:"view",type:"function"},{inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"subtractedValue",type:"uint256"}],name:"decreaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"delegatee",type:"address"}],name:"delegate",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"delegatee",type:"address"},{internalType:"uint256",name:"nonce",type:"uint256"},{internalType:"uint256",name:"expiry",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"delegateBySig",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"delegates",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"eip712Domain",outputs:[{internalType:"bytes1",name:"fields",type:"bytes1"},{internalType:"string",name:"name",type:"string"},{internalType:"string",name:"version",type:"string"},{internalType:"uint256",name:"chainId",type:"uint256"},{internalType:"address",name:"verifyingContract",type:"address"},{internalType:"bytes32",name:"salt",type:"bytes32"},{internalType:"uint256[]",name:"extensions",type:"uint256[]"}],stateMutability:"view",type:"function"},{inputs:[],name:"fetchCode",outputs:[{internalType:"string",name:"logic",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"getFileStorageChunkInfo",outputs:[{components:[{internalType:"uint256",name:"size",type:"uint256"},{components:[{internalType:"address",name:"pointer",type:"address"},{internalType:"uint32",name:"start",type:"uint32"},{internalType:"uint32",name:"end",type:"uint32"}],internalType:"struct BytecodeSlice[]",name:"slices",type:"tuple[]"}],internalType:"struct File",name:"file",type:"tuple"}],stateMutability:"view",type:"function"},{inputs:[],name:"getModelAddress",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"timepoint",type:"uint256"}],name:"getPastTotalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"uint256",name:"timepoint",type:"uint256"}],name:"getPastVotes",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"getPromptSchedulerAddress",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"id",type:"uint256"}],name:"getResultById",outputs:[{internalType:"bytes",name:"",type:"bytes"}],stateMutability:"view",type:"function"},{inputs:[],name:"getStorageInfo",outputs:[{components:[{internalType:"address",name:"contractAddress",type:"address"},{internalType:"string",name:"filename",type:"string"}],internalType:"struct IUtilityAgent.StorageInfo",name:"",type:"tuple"}],stateMutability:"view",type:"function"},{inputs:[],name:"getStorageMode",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"getSystemPrompt",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"getVotes",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"addedValue",type:"uint256"}],name:"increaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"}],name:"nonces",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"numCheckpoints",outputs:[{internalType:"uint32",name:"",type:"uint32"}],stateMutability:"view",type:"function"},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"permit",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes",name:"request",type:"bytes"}],name:"prompt",outputs:[{internalType:"uint256",name:"inferId",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"renounceOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transfer",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transferFrom",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"newOwner",type:"address"}],name:"transferOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"string",name:"filename",type:"string"}],name:"updateFileName",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"modelAddress",type:"address"}],name:"updateModelAddress",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"promptScheduler",type:"address"}],name:"updatePromptScheduler",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"string",name:"systemPrompt",type:"string"}],name:"updateSystemPrompt",outputs:[],stateMutability:"nonpayable",type:"function"}],r=[{inputs:[],name:"AlreadyCommitted",type:"error"},{inputs:[],name:"AlreadyRevealed",type:"error"},{inputs:[],name:"AlreadySeized",type:"error"},{inputs:[],name:"AlreadySubmitted",type:"error"},{inputs:[{internalType:"bytes32",name:"value",type:"bytes32"}],name:"Bytes32Set_DuplicatedValue",type:"error"},{inputs:[],name:"CannotFastForward",type:"error"},{inputs:[],name:"CommitTimeout",type:"error"},{inputs:[],name:"FailedTransfer",type:"error"},{inputs:[],name:"InvalidAddress",type:"error"},{inputs:[],name:"InvalidCommitment",type:"error"},{inputs:[],name:"InvalidContext",type:"error"},{inputs:[],name:"InvalidData",type:"error"},{inputs:[],name:"InvalidInferenceStatus",type:"error"},{inputs:[],name:"InvalidMiner",type:"error"},{inputs:[],name:"InvalidNonce",type:"error"},{inputs:[],name:"InvalidReveal",type:"error"},{inputs:[],name:"InvalidRole",type:"error"},{inputs:[],name:"NotCommitted",type:"error"},{inputs:[],name:"NotEnoughMiners",type:"error"},{inputs:[],name:"OnlyAssignedWorker",type:"error"},{inputs:[],name:"RevealTimeout",type:"error"},{inputs:[],name:"SubmitTimeout",type:"error"},{inputs:[{internalType:"uint256",name:"value",type:"uint256"}],name:"Uint256Set_DuplicatedValue",type:"error"},{inputs:[],name:"Unauthorized",type:"error"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"miner",type:"address"},{indexed:!0,internalType:"uint256",name:"assigmentId",type:"uint256"},{indexed:!1,internalType:"bytes32",name:"commitment",type:"bytes32"}],name:"CommitmentSubmission",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"chainId",type:"uint256"},{indexed:!1,internalType:"uint256",name:"inferenceId",type:"uint256"},{indexed:!1,internalType:"address",name:"modelAddress",type:"address"},{components:[{internalType:"address",name:"receiver",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"enum IWorkerHub.DAOTokenReceiverRole",name:"role",type:"uint8"}],indexed:!1,internalType:"struct IWorkerHub.DAOTokenReceiverInfor[]",name:"receivers",type:"tuple[]"}],name:"DAOTokenMintedV2",type:"event"},{anonymous:!1,inputs:[{components:[{internalType:"uint16",name:"minerPercentage",type:"uint16"},{internalType:"uint16",name:"userPercentage",type:"uint16"},{internalType:"uint16",name:"referrerPercentage",type:"uint16"},{internalType:"uint16",name:"refereePercentage",type:"uint16"},{internalType:"uint16",name:"l2OwnerPercentage",type:"uint16"}],indexed:!1,internalType:"struct IWorkerHub.DAOTokenPercentage",name:"oldValue",type:"tuple"},{components:[{internalType:"uint16",name:"minerPercentage",type:"uint16"},{internalType:"uint16",name:"userPercentage",type:"uint16"},{internalType:"uint16",name:"referrerPercentage",type:"uint16"},{internalType:"uint16",name:"refereePercentage",type:"uint16"},{internalType:"uint16",name:"l2OwnerPercentage",type:"uint16"}],indexed:!1,internalType:"struct IWorkerHub.DAOTokenPercentage",name:"newValue",type:"tuple"}],name:"DAOTokenPercentageUpdated",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"uint256",name:"inferenceId",type:"uint256"},{indexed:!1,internalType:"enum IWorkerHub.InferenceStatus",name:"newStatus",type:"uint8"}],name:"InferenceStatusUpdate",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint8",name:"version",type:"uint8"}],name:"Initialized",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"uint256",name:"assignmentId",type:"uint256"},{indexed:!0,internalType:"uint256",name:"inferenceId",type:"uint256"},{indexed:!0,internalType:"address",name:"miner",type:"address"}],name:"MinerRoleSeized",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"uint256",name:"assignmentId",type:"uint256"},{indexed:!0,internalType:"uint256",name:"inferenceId",type:"uint256"},{indexed:!0,internalType:"address",name:"miner",type:"address"},{indexed:!1,internalType:"uint40",name:"expiredAt",type:"uint40"}],name:"NewAssignment",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"uint256",name:"inferenceId",type:"uint256"},{indexed:!0,internalType:"address",name:"model",type:"address"},{indexed:!0,internalType:"address",name:"creator",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"},{indexed:!1,internalType:"uint256",name:"originInferenceId",type:"uint256"}],name:"NewInference",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"account",type:"address"}],name:"Paused",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"uint256",name:"inferenceId",type:"uint256"},{indexed:!0,internalType:"address",name:"model",type:"address"},{indexed:!0,internalType:"address",name:"creator",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"},{indexed:!1,internalType:"uint256",name:"originInferenceId",type:"uint256"},{indexed:!1,internalType:"bytes",name:"input",type:"bytes"},{indexed:!1,internalType:"bool",name:"flag",type:"bool"}],name:"RawSubmitted",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"miner",type:"address"},{indexed:!0,internalType:"uint256",name:"assigmentId",type:"uint256"},{indexed:!1,internalType:"uint40",name:"nonce",type:"uint40"},{indexed:!1,internalType:"bytes",name:"output",type:"bytes"}],name:"RevealSubmission",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"miner",type:"address"},{indexed:!0,internalType:"uint256",name:"assigmentId",type:"uint256"}],name:"SolutionSubmission",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"uint256",name:"assignmentId",type:"uint256"},{indexed:!1,internalType:"bytes",name:"data",type:"bytes"}],name:"StreamedData",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"account",type:"address"}],name:"Unpaused",type:"event"},{inputs:[],name:"assignmentNumber",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"assignments",outputs:[{internalType:"uint256",name:"inferenceId",type:"uint256"},{internalType:"bytes32",name:"commitment",type:"bytes32"},{internalType:"bytes32",name:"digest",type:"bytes32"},{internalType:"uint40",name:"revealNonce",type:"uint40"},{internalType:"address",name:"worker",type:"address"},{internalType:"enum IWorkerHub.AssignmentRole",name:"role",type:"uint8"},{internalType:"enum IWorkerHub.Vote",name:"vote",type:"uint8"},{internalType:"bytes",name:"output",type:"bytes"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"_assignId",type:"uint256"},{internalType:"bytes32",name:"_commitment",type:"bytes32"}],name:"commit",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"_assignmentId",type:"uint256"}],name:"getAssignmentInfo",outputs:[{components:[{internalType:"uint256",name:"inferenceId",type:"uint256"},{internalType:"bytes32",name:"commitment",type:"bytes32"},{internalType:"bytes32",name:"digest",type:"bytes32"},{internalType:"uint40",name:"revealNonce",type:"uint40"},{internalType:"address",name:"worker",type:"address"},{internalType:"enum IWorkerHub.AssignmentRole",name:"role",type:"uint8"},{internalType:"enum IWorkerHub.Vote",name:"vote",type:"uint8"},{internalType:"bytes",name:"output",type:"bytes"}],internalType:"struct IWorkerHub.Assignment",name:"",type:"tuple"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"_inferenceId",type:"uint256"}],name:"getAssignmentsByInference",outputs:[{internalType:"uint256[]",name:"",type:"uint256[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"_inferenceId",type:"uint256"}],name:"getInferenceInfo",outputs:[{components:[{internalType:"uint256[]",name:"assignments",type:"uint256[]"},{internalType:"bytes",name:"input",type:"bytes"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"uint256",name:"feeL2",type:"uint256"},{internalType:"uint256",name:"feeTreasury",type:"uint256"},{internalType:"address",name:"modelAddress",type:"address"},{internalType:"uint40",name:"submitTimeout",type:"uint40"},{internalType:"uint40",name:"commitTimeout",type:"uint40"},{internalType:"uint40",name:"revealTimeout",type:"uint40"},{internalType:"enum IWorkerHub.InferenceStatus",name:"status",type:"uint8"},{internalType:"address",name:"creator",type:"address"},{internalType:"address",name:"processedMiner",type:"address"},{internalType:"address",name:"referrer",type:"address"}],internalType:"struct IWorkerHub.Inference",name:"",type:"tuple"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"_modelAddress",type:"address"}],name:"getMinFeeToUse",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"getTreasuryAddress",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes",name:"_input",type:"bytes"},{internalType:"address",name:"_creator",type:"address"},{internalType:"bool",name:"_flag",type:"bool"}],name:"infer",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"bytes",name:"_input",type:"bytes"},{internalType:"address",name:"_creator",type:"address"}],name:"infer",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"payable",type:"function"},{inputs:[],name:"inferenceNumber",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"_wEAI",type:"address"},{internalType:"address",name:"_l2Owner",type:"address"},{internalType:"address",name:"_treasury",type:"address"},{internalType:"address",name:"_daoToken",type:"address"},{internalType:"address",name:"_stakingHub",type:"address"},{internalType:"uint16",name:"_feeL2Percentage",type:"uint16"},{internalType:"uint16",name:"_feeTreasuryPercentage",type:"uint16"},{internalType:"uint8",name:"_minerRequirement",type:"uint8"},{internalType:"uint40",name:"_submitDuration",type:"uint40"},{internalType:"uint40",name:"_commitDuration",type:"uint40"},{internalType:"uint40",name:"_revealDuration",type:"uint40"},{internalType:"uint16",name:"_feeRatioMinerValidor",type:"uint16"},{internalType:"uint256",name:"_daoTokenReward",type:"uint256"},{components:[{internalType:"uint16",name:"minerPercentage",type:"uint16"},{internalType:"uint16",name:"userPercentage",type:"uint16"},{internalType:"uint16",name:"referrerPercentage",type:"uint16"},{internalType:"uint16",name:"refereePercentage",type:"uint16"},{internalType:"uint16",name:"l2OwnerPercentage",type:"uint16"}],internalType:"struct IWorkerHub.DAOTokenPercentage",name:"_daoTokenPercentage",type:"tuple"}],name:"initialize",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"pause",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"paused",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address[]",name:"_referrers",type:"address[]"},{internalType:"address[]",name:"_referees",type:"address[]"}],name:"registerReferrer",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"renounceOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"_inferenceId",type:"uint256"}],name:"resolveInference",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"_assignId",type:"uint256"},{internalType:"uint40",name:"_nonce",type:"uint40"},{internalType:"bytes",name:"_data",type:"bytes"}],name:"reveal",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"_assignmentId",type:"uint256"}],name:"seizeMinerRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"_newDAOTokenReward",type:"uint256"}],name:"setDAOTokenReward",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_wEAI",type:"address"}],name:"setWEAIAddress",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"_assigmentId",type:"uint256"},{internalType:"bytes",name:"_data",type:"bytes"}],name:"submitSolution",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"newOwner",type:"address"}],name:"transferOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"unpause",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bool",name:"_isReferred",type:"bool"}],name:"validateDAOSupplyIncrease",outputs:[{internalType:"bool",name:"notReachedLimit",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"version",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"pure",type:"function"},{stateMutability:"payable",type:"receive"}],s=[{inputs:[],name:"AlreadyCommitted",type:"error"},{inputs:[],name:"AlreadyRevealed",type:"error"},{inputs:[],name:"AlreadySeized",type:"error"},{inputs:[],name:"AlreadySubmitted",type:"error"},{inputs:[],name:"CannotFastForward",type:"error"},{inputs:[],name:"CommitTimeout",type:"error"},{inputs:[],name:"InvalidAddress",type:"error"},{inputs:[],name:"InvalidCommitment",type:"error"},{inputs:[],name:"InvalidContext",type:"error"},{inputs:[],name:"InvalidData",type:"error"},{inputs:[],name:"InvalidInferenceStatus",type:"error"},{inputs:[],name:"InvalidMiner",type:"error"},{inputs:[],name:"InvalidNonce",type:"error"},{inputs:[],name:"InvalidReveal",type:"error"},{inputs:[],name:"InvalidRole",type:"error"},{inputs:[],name:"NotCommitted",type:"error"},{inputs:[],name:"NotEnoughMiners",type:"error"},{inputs:[],name:"OnlyAssignedWorker",type:"error"},{inputs:[],name:"RevealTimeout",type:"error"},{inputs:[],name:"SubmitTimeout",type:"error"},{inputs:[{internalType:"uint256",name:"value",type:"uint256"}],name:"Uint256Set_DuplicatedValue",type:"error"},{inputs:[],name:"Unauthorized",type:"error"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"miner",type:"address"},{indexed:!0,internalType:"uint256",name:"assigmentId",type:"uint256"},{indexed:!1,internalType:"bytes32",name:"commitment",type:"bytes32"}],name:"CommitmentSubmission",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"chainId",type:"uint256"},{indexed:!1,internalType:"uint256",name:"inferenceId",type:"uint256"},{indexed:!1,internalType:"address",name:"modelAddress",type:"address"},{components:[{internalType:"address",name:"receiver",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"enum IWorkerHub.DAOTokenReceiverRole",name:"role",type:"uint8"}],indexed:!1,internalType:"struct IWorkerHub.DAOTokenReceiverInfor[]",name:"receivers",type:"tuple[]"}],name:"DAOTokenMintedV2",type:"event"},{anonymous:!1,inputs:[{components:[{internalType:"uint16",name:"minerPercentage",type:"uint16"},{internalType:"uint16",name:"userPercentage",type:"uint16"},{internalType:"uint16",name:"referrerPercentage",type:"uint16"},{internalType:"uint16",name:"refereePercentage",type:"uint16"},{internalType:"uint16",name:"l2OwnerPercentage",type:"uint16"}],indexed:!1,internalType:"struct IWorkerHub.DAOTokenPercentage",name:"oldValue",type:"tuple"},{components:[{internalType:"uint16",name:"minerPercentage",type:"uint16"},{internalType:"uint16",name:"userPercentage",type:"uint16"},{internalType:"uint16",name:"referrerPercentage",type:"uint16"},{internalType:"uint16",name:"refereePercentage",type:"uint16"},{internalType:"uint16",name:"l2OwnerPercentage",type:"uint16"}],indexed:!1,internalType:"struct IWorkerHub.DAOTokenPercentage",name:"newValue",type:"tuple"}],name:"DAOTokenPercentageUpdated",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"uint256",name:"inferenceId",type:"uint256"},{indexed:!1,internalType:"enum IWorkerHub.InferenceStatus",name:"newStatus",type:"uint8"}],name:"InferenceStatusUpdate",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint8",name:"version",type:"uint8"}],name:"Initialized",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"uint256",name:"assignmentId",type:"uint256"},{indexed:!0,internalType:"uint256",name:"inferenceId",type:"uint256"},{indexed:!0,internalType:"address",name:"miner",type:"address"}],name:"MinerRoleSeized",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"uint256",name:"assignmentId",type:"uint256"},{indexed:!0,internalType:"uint256",name:"inferenceId",type:"uint256"},{indexed:!0,internalType:"address",name:"miner",type:"address"},{indexed:!1,internalType:"uint40",name:"expiredAt",type:"uint40"}],name:"NewAssignment",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"uint256",name:"inferenceId",type:"uint256"},{indexed:!0,internalType:"address",name:"model",type:"address"},{indexed:!0,internalType:"address",name:"creator",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"},{indexed:!1,internalType:"uint256",name:"originInferenceId",type:"uint256"}],name:"NewInference",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"account",type:"address"}],name:"Paused",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"uint256",name:"inferenceId",type:"uint256"},{indexed:!0,internalType:"address",name:"model",type:"address"},{indexed:!0,internalType:"address",name:"creator",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"},{indexed:!1,internalType:"uint256",name:"originInferenceId",type:"uint256"},{indexed:!1,internalType:"bytes",name:"input",type:"bytes"},{indexed:!1,internalType:"bool",name:"flag",type:"bool"}],name:"RawSubmitted",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"miner",type:"address"},{indexed:!0,internalType:"uint256",name:"assigmentId",type:"uint256"},{indexed:!1,internalType:"uint40",name:"nonce",type:"uint40"},{indexed:!1,internalType:"bytes",name:"output",type:"bytes"}],name:"RevealSubmission",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"miner",type:"address"},{indexed:!0,internalType:"uint256",name:"inferId",type:"uint256"}],name:"SolutionSubmission",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"uint256",name:"assignmentId",type:"uint256"},{indexed:!1,internalType:"bytes",name:"data",type:"bytes"}],name:"StreamedData",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"account",type:"address"}],name:"Unpaused",type:"event"},{inputs:[{internalType:"uint256",name:"_inferenceId",type:"uint256"}],name:"getInferenceInfo",outputs:[{components:[{internalType:"uint256",name:"value",type:"uint256"},{internalType:"uint256",name:"feeL2",type:"uint256"},{internalType:"uint256",name:"feeTreasury",type:"uint256"},{internalType:"address",name:"modelAddress",type:"address"},{internalType:"uint40",name:"submitTimeout",type:"uint40"},{internalType:"enum IWorkerHub.InferenceStatus",name:"status",type:"uint8"},{internalType:"address",name:"creator",type:"address"},{internalType:"address",name:"processedMiner",type:"address"},{internalType:"address",name:"referrer",type:"address"},{internalType:"bytes",name:"input",type:"bytes"},{internalType:"bytes",name:"output",type:"bytes"}],internalType:"struct IWorkerHub.Inference",name:"",type:"tuple"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"_modelAddress",type:"address"}],name:"getMinFeeToUse",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"getMinerRequirement",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[],name:"getSubmitDuration",outputs:[{internalType:"uint40",name:"",type:"uint40"}],stateMutability:"view",type:"function"},{inputs:[],name:"getTreasuryAddress",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes",name:"_input",type:"bytes"},{internalType:"address",name:"_creator",type:"address"},{internalType:"bool",name:"_flag",type:"bool"}],name:"infer",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"bytes",name:"_input",type:"bytes"},{internalType:"address",name:"_creator",type:"address"}],name:"infer",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"payable",type:"function"},{inputs:[],name:"inferenceNumber",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"_wEAI",type:"address"},{internalType:"address",name:"_l2Owner",type:"address"},{internalType:"address",name:"_treasury",type:"address"},{internalType:"address",name:"_daoToken",type:"address"},{internalType:"address",name:"_stakingHub",type:"address"},{internalType:"uint16",name:"_feeL2Percentage",type:"uint16"},{internalType:"uint16",name:"_feeTreasuryPercentage",type:"uint16"},{internalType:"uint8",name:"_minerRequirement",type:"uint8"},{internalType:"uint40",name:"_submitDuration",type:"uint40"},{internalType:"uint16",name:"_feeRatioMinerValidor",type:"uint16"},{internalType:"uint256",name:"_daoTokenReward",type:"uint256"},{components:[{internalType:"uint16",name:"minerPercentage",type:"uint16"},{internalType:"uint16",name:"userPercentage",type:"uint16"},{internalType:"uint16",name:"referrerPercentage",type:"uint16"},{internalType:"uint16",name:"refereePercentage",type:"uint16"},{internalType:"uint16",name:"l2OwnerPercentage",type:"uint16"}],internalType:"struct IWorkerHub.DAOTokenPercentage",name:"_daoTokenPercentage",type:"tuple"}],name:"initialize",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"pause",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"paused",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address[]",name:"_referrers",type:"address[]"},{internalType:"address[]",name:"_referees",type:"address[]"}],name:"registerReferrer",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"renounceOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_daoToken",type:"address"}],name:"setDAOTokenAddress",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_stakingHub",type:"address"}],name:"setStakingHubAddress",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint40",name:"_submitDuration",type:"uint40"}],name:"setSubmitDuration",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_wEAI",type:"address"}],name:"setWEAIAddress",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"stakingHub",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"_inferId",type:"uint256"},{internalType:"bytes",name:"_data",type:"bytes"}],name:"submitSolution",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"newOwner",type:"address"}],name:"transferOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"unpause",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"version",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"pure",type:"function"},{stateMutability:"payable",type:"receive"}];var p;e.ChainId=void 0,(p=e.ChainId||(e.ChainId={}))[p.BASE=8453]="BASE",p[p.BSC=56]="BSC";const u={56:"https://bsc-dataseed.binance.org/",8453:"https://base.llamarpc.com"},y=async e=>new Promise((t=>{setTimeout(t,e)})),o=async e=>{console.log("LightHouse - Upload content to light house");const t=await fetch("https://api.eternalai.org/api/service/light-house/upload/public",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:e})});if(!t.ok)throw new Error(`Light house upload failed: ${t.statusText}`);const n=await t.json();return console.log("LightHouse - Upload succeed - url",n.data),n.data},d={},l=(e,t)=>(d[e]||(d[e]=new a.Contract(e,i,t.provider)),d[e]),m=(e,t)=>(d[e]||(d[e]=new a.Contract(e,s,t.provider)),d[e]);class c{result_uri;storage;data;constructor(e,t,n){this.result_uri=e,this.storage=t,this.data=n}static fromJSON(e){const t=JSON.parse(e);return Object.assign(new c("","",""),t)}}const T={convertMessagesToBytes:async(e,t)=>{if(t){const t=await o(JSON.stringify(e));return a.utils.toUtf8Bytes(t)}return a.utils.toUtf8Bytes(JSON.stringify({messages:e}))},getSystemPrompt:async(e,t)=>{try{console.log("infer getSystemPrompt - start");const n=l(e,t),a=await n.getSystemPrompt();return console.log("infer getSystemPrompt - succeed",a),a}catch(e){throw console.log("infer getSystemPrompt - failed"),e}finally{console.log("infer getSystemPrompt - end")}},createPayloadWithPrompt:async(e,t)=>{try{console.log("infer createPayloadWithPrompt - start",t);const n=t.agentAddress,i=l(n,e),r=await T.getSystemPrompt(n,e),{chainId:s,prompt:p,isLightHouse:u}=t,y=await T.convertMessagesToBytes([{role:"system",content:r},{role:"user",content:p}],!!u),o=i.interface.encodeFunctionData("prompt(bytes)",[y]),d=e.address||await e.getAddress(),[m,c,f]=await Promise.all([i.estimateGas.prompt(y),e.provider.getGasPrice(),e.provider.getTransactionCount(d)]),g={to:n,from:d,data:o,chainId:a.BigNumber.from(s).toNumber(),gasLimit:m,gasPrice:c,nonce:f};return console.log("infer createPayloadWithPrompt - succeed",g),g}catch(e){throw console.log("infer createPayloadWithPrompt - failed"),e}finally{console.log("infer createPayloadWithPrompt - end")}},createPayloadWithMessages:async(e,t)=>{try{console.log("infer createPayloadWithMessages - start",t);const n=t.agentAddress,i=l(n,e),{chainId:r,messages:s,isLightHouse:p}=t,u=await T.convertMessagesToBytes(s,!!p),y=i.interface.encodeFunctionData("prompt(bytes)",[u]),o=e.address||await e.getAddress(),[d,m,c]=await Promise.all([i.estimateGas.prompt(u),e.provider.getGasPrice(),e.provider.getTransactionCount(o)]),f={to:n,from:o,data:y,chainId:a.BigNumber.from(r).toNumber(),gasLimit:d,gasPrice:m,nonce:c};return console.log("infer createPayloadWithMessages - succeed",f),f}catch(e){throw console.log("infer createPayloadWithMessages - failed"),e}finally{console.log("infer createPayloadWithMessages - end")}},sendPrompt:async(e,t)=>{try{console.log("infer execute - start"),console.log("infer execute - send transaction",t);const n=await e.provider.sendTransaction(t);console.log("infer execute - waiting",n);return(await n.wait()).transactionHash}catch(e){throw console.log("infer execute - failed"),e}finally{console.log("infer execute - end")}},getWorkerHubAddress:async(e,t)=>{try{console.log("infer getWorkerHubAddress - start",{agentAddress:e});const n=l(e,t),a=await n.getPromptSchedulerAddress();return console.log("infer getWorkerHubAddress - succeed",a),a}catch(e){throw console.log("infer getWorkerHubAddress - failed"),e}finally{console.log("infer getWorkerHubAddress - end")}},getInferId:async(e,t)=>{const n=await e.provider.getTransactionReceipt(t);if(!n||1!=n.status)throw new Error("Transaction receipt not found.");try{const e=new a.utils.Interface(r),t=n.logs.map((t=>{try{return e.parseLog(t)}catch(e){return null}})).filter((e=>null!==e)),i=t?.find((e=>"NewInference"===e.name));return i?.args?.inferenceId}catch(e){throw new Error("No Infer Id")}},processOutput:e=>{const t=a.utils.toUtf8String(e);try{return c.fromJSON(t)}catch(e){return null}},processOutputToInferResponse:async e=>{const t=T.processOutput(e);if(t){if("lighthouse-filecoint"==t.storage||t.result_uri.includes("ipfs://")){const e=t.result_uri.replace("ipfs://","https://gateway.lighthouse.storage/ipfs/"),n=await fetch(e);if(n.ok){return await n.text()}return null}if(""!=t.data){return atob(t.data)}return null}return null},getInferenceById:async(t,n,i,r)=>{if(r===e.ChainId.BSC){const e=m(n,t),r=(await e.getInferenceInfo(i))[10],s=a.utils.arrayify(r);if(0!=s.length){const e=await T.processOutputToInferResponse(s);return e||null}throw new Error(`waiting process inference ${i}`)}if(r===e.ChainId.BASE){const e=m(n,t),r=await e.getInferenceInfo(i);if(0==r.length)throw new Error("No assignment found");const s=r[0],p=await e.getAssignmentInfo(s);if(0==p.length)throw new Error("Inference result not ready");const u=p[7],y=a.utils.arrayify(u);if(0!=y.length){const e=await T.processOutputToInferResponse(y);return e||null}throw new Error(`waiting process inference ${i}`)}throw Error("Unsupported chainId")},listenPromptResponse:async(e,t,n,a)=>{try{console.log("infer listenPromptResponse - start",{chainId:e,workerHubAddress:n,promptedTxHash:a});let i=null;const r=await T.getInferId(t,a);for(;;)try{i=await T.getInferenceById(t,n,r,e);break}catch(e){console.log("Retry to get inference by reference id"),await y(30)}return console.log("infer listenPromptResponse - succeed",i),i}catch(e){throw console.log("infer listenPromptResponse - failed"),e}finally{console.log("infer listenPromptResponse - end")}}};var f=Object.freeze({__proto__:null,Infer:T});return e.CHAIN_MAPPING=u,e.Interact=class{_wallet;constructor(e){if(!a.Wallet.isSigner(e))throw new Error("Provided wallet is not a signer");this._wallet=e}getProvider(e,t){if(t)return new a.providers.JsonRpcProvider(t);if(!u[e])throw new Error(`Unsupported chainId: ${e}`);return new a.providers.JsonRpcProvider(u[e])}getNetworkCredential(e,t){const n=this.getProvider(e,t);return{provider:n,signer:this._wallet.connect(n)}}normalizePayload(e){return{...e,isLightHouse:e.isLightHouse??!1}}async infer(e){try{const t=this.normalizePayload(e);if(console.log("infer - start",{payload:t}),"string"==typeof t.prompt){const e=await this.inferWithPrompt(t);return console.log("infer - succeed",e),e}{const e=await this.inferWithMessages(t);return console.log("infer - succeed",e),e}}catch(e){throw console.log("infer - failed",e),e}finally{console.log("infer - end")}}async inferWithPrompt(e){console.log("inferWithPrompt - start");const{signer:t}=this.getNetworkCredential(e.chainId,e.rpcUrl),n=await T.createPayloadWithPrompt(t,e),a=await t.signTransaction(n),i=await T.sendPrompt(t,a),r=await T.getWorkerHubAddress(e.agentAddress,t);return await T.listenPromptResponse(e.chainId,t,r,i)}async inferWithMessages(e){console.log("inferWithMessages - start");const{signer:t}=this.getNetworkCredential(e.chainId,e.rpcUrl),n=await T.createPayloadWithMessages(t,e),a=await t.signTransaction(n),i=await T.sendPrompt(t,a),r=await T.getWorkerHubAddress(e.agentAddress,t);return await T.listenPromptResponse(e.chainId,t,r,i)}},e.InteractWithExternalWallet=class{_wallet;constructor(e){this._wallet=e}getProvider(e,t){if(t)return new a.providers.JsonRpcProvider(t);if(!u[e])throw new Error(`Unsupported chainId: ${e}`);return new a.providers.JsonRpcProvider(u[e])}getNetworkCredential(e,t){const n=this.getProvider(e,t);return{provider:n,signer:{...this._wallet,provider:n}}}normalizePayload(e){return{...e,isLightHouse:e.isLightHouse??!1}}async infer(e){try{const t=this.normalizePayload(e);if(console.log("inferWithExternalWallet - start",{payload:t}),"string"==typeof t.prompt){const e=await this.inferWithPrompt(t);return console.log("inferWithExternalWallet - succeed",e),e}{const e=await this.inferWithMessages(t);return console.log("inferWithExternalWallet - succeed",e),e}}catch(e){throw console.log("inferWithExternalWallet - failed",e),e}finally{console.log("inferWithExternalWallet - end")}}async inferWithPrompt(e){console.log("inferWithEternalWalletWithPrompt - start");const{signer:t}=this.getNetworkCredential(e.chainId,e.rpcUrl),n=await T.createPayloadWithPrompt(t,e),a=await t.requestSignature(n),i=await T.sendPrompt(t,a),r=await T.getWorkerHubAddress(e.agentAddress,t);return await T.listenPromptResponse(e.chainId,t,r,i)}async inferWithMessages(e){console.log("inferWithEternalWalletWithMessages - start");const{signer:t}=this.getNetworkCredential(e.chainId,e.rpcUrl),n=await T.createPayloadWithMessages(t,e),a=await t.requestSignature(n),i=await T.sendPrompt(t,a),r=await T.getWorkerHubAddress(e.agentAddress,t);return await T.listenPromptResponse(e.chainId,t,r,i)}},e.methods=f,Object.defineProperty(e,"__esModule",{value:!0}),e}({},ethers); //# sourceMappingURL=bundle.iife.js.map ================================================ FILE: EternalAI.js/packages/ui/src/App.css ================================================ #root { max-width: 1280px; margin: 0 auto; padding: 2rem; text-align: center; } .logo { height: 6em; padding: 1.5em; will-change: filter; transition: filter 300ms; } .logo:hover { filter: drop-shadow(0 0 2em #646cffaa); } .logo.react:hover { filter: drop-shadow(0 0 2em #61dafbaa); } @keyframes logo-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } } @media (prefers-reduced-motion: no-preference) { a:nth-of-type(2) .logo { animation: logo-spin infinite 20s linear; } } .card { padding: 2em; } .read-the-docs { color: #888; } ================================================ FILE: EternalAI.js/packages/ui/src/App.tsx ================================================ import { Routes, Route } from "react-router"; import PackageCore from "./pages/package-core"; import Home from "./pages/home"; import PackageInteract from "./pages/package-interact"; function App() { return ( } /> } /> } /> ); } export default App; ================================================ FILE: EternalAI.js/packages/ui/src/index.css ================================================ :root { font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif; line-height: 1.5; font-weight: 400; color-scheme: light dark; color: rgba(255, 255, 255, 0.87); background-color: #242424; font-synthesis: none; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } a { font-weight: 500; color: #646cff; text-decoration: inherit; } a:hover { color: #535bf2; } body { margin: 0; display: flex; place-items: center; min-width: 320px; min-height: 100vh; } h1 { font-size: 3.2em; line-height: 1.1; } button { border-radius: 8px; border: 1px solid transparent; padding: 0.6em 1.2em; font-size: 1em; font-weight: 500; font-family: inherit; background-color: #1a1a1a; cursor: pointer; transition: border-color 0.25s; } button:hover { border-color: #646cff; } button:focus, button:focus-visible { outline: 4px auto -webkit-focus-ring-color; } @media (prefers-color-scheme: light) { :root { color: #213547; background-color: #ffffff; } a:hover { color: #747bff; } button { background-color: #f9f9f9; } } ================================================ FILE: EternalAI.js/packages/ui/src/main.tsx ================================================ import { StrictMode } from "react"; import { createRoot } from "react-dom/client"; import "./index.css"; import App from "./App.tsx"; import { BrowserRouter } from "react-router"; createRoot(document.getElementById("root")!).render( ); ================================================ FILE: EternalAI.js/packages/ui/src/pages/home/Styles.css ================================================ #root { max-width: 1280px; margin: 0 auto; padding: 2rem; text-align: center; } .logo { height: 6em; padding: 1.5em; will-change: filter; transition: filter 300ms; } .logo:hover { filter: drop-shadow(0 0 2em #646cffaa); } .logo.react:hover { filter: drop-shadow(0 0 2em #61dafbaa); } @keyframes logo-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } } @media (prefers-reduced-motion: no-preference) { a:nth-of-type(2) .logo { animation: logo-spin infinite 20s linear; } } .card { padding: 2em; } .read-the-docs { color: #888; } ================================================ FILE: EternalAI.js/packages/ui/src/pages/home/index.tsx ================================================ import "./Styles.css"; function Home() { return ( <>

Vite + React

); } export default Home; ================================================ FILE: EternalAI.js/packages/ui/src/pages/package-core/Styles.css ================================================ #root { max-width: 1280px; margin: 0 auto; padding: 2rem; text-align: center; } .logo { height: 6em; padding: 1.5em; will-change: filter; transition: filter 300ms; } .logo:hover { filter: drop-shadow(0 0 2em #646cffaa); } .logo.react:hover { filter: drop-shadow(0 0 2em #61dafbaa); } @keyframes logo-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } } @media (prefers-reduced-motion: no-preference) { a:nth-of-type(2) .logo { animation: logo-spin infinite 20s linear; } } .card { padding: 2em; } .read-the-docs { color: #888; } ================================================ FILE: EternalAI.js/packages/ui/src/pages/package-core/index.tsx ================================================ import { useState } from "react"; import { sum } from "@eternalai.js/core"; import "./Styles.css"; function PackageCore() { const [num, setNum] = useState(0); return ( <>

Package Core

Edit src/App.tsx and save to test HMR

Click on the Vite and React logos to learn more

); } export default PackageCore; ================================================ FILE: EternalAI.js/packages/ui/src/pages/package-interact/Styles.css ================================================ #root { max-width: 1280px; margin: 0 auto; padding: 2rem; text-align: center; } .logo { height: 6em; padding: 1.5em; will-change: filter; transition: filter 300ms; } .logo:hover { filter: drop-shadow(0 0 2em #646cffaa); } .logo.react:hover { filter: drop-shadow(0 0 2em #61dafbaa); } @keyframes logo-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } } @media (prefers-reduced-motion: no-preference) { a:nth-of-type(2) .logo { animation: logo-spin infinite 20s linear; } } .card { padding: 2em; } .read-the-docs { color: #888; } ================================================ FILE: EternalAI.js/packages/ui/src/pages/package-interact/index.tsx ================================================ import { ChainId, Interact } from "@eternalai.js/interact"; import "./Styles.css"; import { ethers } from "ethers"; import { InferPayloadWithPrompt, InferPayloadWithMessages, } from "@eternalai.js/interact/dist/types"; const AGENT_CONTRACT_ADDRESSES: Record = { [ChainId.BSC]: "0x3B9710bA5578C2eeD075D8A23D8c596925fa4625", [ChainId.BASE]: "0x1E65FCa9b6640bC87AE41f1a897762c334821D1C", }; // const wallet = new ethers.Wallet("Your private key here"); const wallet = ethers.Wallet.createRandom(); function PackageInteract() { return ( <>

Package Interact

Edit src/App.tsx and save to test HMR

Click on the Vite and React logos to learn more

); } export default PackageInteract; ================================================ FILE: EternalAI.js/packages/ui/src/vite-env.d.ts ================================================ /// ================================================ FILE: EternalAI.js/packages/ui/tsconfig.app.json ================================================ { "compilerOptions": { "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo", "target": "ES2020", "useDefineForClassFields": true, "lib": ["ES2020", "DOM", "DOM.Iterable"], "module": "ESNext", "skipLibCheck": true, /* Bundler mode */ "moduleResolution": "bundler", "allowImportingTsExtensions": true, "isolatedModules": true, "moduleDetection": "force", "noEmit": true, "jsx": "react-jsx", /* Linting */ "strict": true, "noUnusedLocals": true, "noUnusedParameters": true, "noFallthroughCasesInSwitch": true, "noUncheckedSideEffectImports": true }, "include": ["src"] } ================================================ FILE: EternalAI.js/packages/ui/tsconfig.json ================================================ { "files": [], "references": [ { "path": "./tsconfig.app.json" }, { "path": "./tsconfig.node.json" } ] } ================================================ FILE: EternalAI.js/packages/ui/tsconfig.node.json ================================================ { "compilerOptions": { "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo", "target": "ES2022", "lib": ["ES2023"], "module": "ESNext", "skipLibCheck": true, /* Bundler mode */ "moduleResolution": "bundler", "allowImportingTsExtensions": true, "isolatedModules": true, "moduleDetection": "force", "noEmit": true, /* Linting */ "strict": true, "noUnusedLocals": true, "noUnusedParameters": true, "noFallthroughCasesInSwitch": true, "noUncheckedSideEffectImports": true }, "include": ["vite.config.ts"] } ================================================ FILE: EternalAI.js/packages/ui/vite.config.ts ================================================ import { defineConfig } from 'vite' import react from '@vitejs/plugin-react' // https://vite.dev/config/ export default defineConfig({ plugins: [react()], }) ================================================ FILE: LICENSE ================================================ MIT License Copyright (c) 2025 3700 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: Makefile ================================================ build_decentralize_server_osx: cd decentralized-inference && docker run --rm -v "$$(pwd)":/app -w /app golang:1.23 sh -c 'GOOS=darwin go build -o eai-chat main.go' \ && mv eai-chat ../eai-chat build_decentralize_server_linux: cd decentralized-inference && docker run --rm -v "$$(pwd)":/app -w /app golang:1.23 sh -c 'GOOS=linux go build -o eai-chat main.go' \ && mv eai-chat ../eai-chat ================================================ FILE: README.md ================================================ # Eternal AI: A Peer-to-Peer Autonomous Agent System Eternal AI is an open source AI protocol for fully onchain agents. Deployed onchain, these AI agents run exactly as programmed — all without a middleman or counterparty risk. They are permissionless, uncensored, trustless, and unstoppable. # Protocol Architecture Eternal AI agents operate on a powerful peer-to-peer global infrastructure with many unique properties: * End-to-end decentralization: Inference, Compute, Storage, etc. * State-of-the-art models: DeepSeek, Llama, FLUX, etc. * Multichain support: Bitcoin, Ethereum, Solana, etc. eai-new-architecture-6 # Get started ## Prerequisites * [Node.js 22.12.0+ and npm 10.9.0+](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) * [Docker Desktop 4.37.1+](https://docs.docker.com/desktop/setup/install/mac-install/) * [Go 1.23.0+](https://go.dev/doc/install) * [Ollama 0.5.7+](https://ollama.com/download) ## Installation Run the following command to start the whole system with your local network. ``` sudo bash quickstart.sh ``` ## `eai` CLI Navigate to `./agent-cli` to install and use eai CLI. Run the command to install: ``` sh install.sh ``` Copy `.env.example` to `.env` and update the `.env` file: ``` cp .env.example .env ``` ``` PRIVATE_KEY= ETERNALAI_API_KEY= ``` For the PRIVATE_KEY, make sure your account has enough gas tokens on the blockchains where you intend to create agents. For the ETERNALAI_API_KEY, you can get it [here](https://eternalai.org/api). ### Create an agent ```bash eai agent create -p -n -c -f -m ``` Only the param `-p` is required, and others are optional. Example: ``` eai agent create -p ../decentralized-agents/characters/donald_trump.txt -n trump-agent -c base -f eternalai -m DeepSeek-R1-Distill-Llama-70B ``` We are creating an agent who is a Donald Trump twin called `trump-agent` on the Base Chain. It uses the EternalAI framework and the DeepSeek-R1-Distill-Llama-70B model. The `.txt` file is the system prompt for your agent, which defines its initial behavior. You can edit this file to customize the agent’s personality. ### List out all agents on your machine ```bash eai agent ls ``` Example output: list_all_agents ### Start an agent ```bash eai agent start -n ``` ### Chat with an agent ```bash eai agent chat -n ``` ### Stop an agent ```bash eai agent stop -n ``` # Design Principles 1. **Decentralize everything**. Ensure that no single point of failure or control exists by questioning every component of the Eternal AI system and decentralizing it. 2. **Trustless**. Use smart contracts at every step to trustlessly coordinate all parties in the system. 3. **Production grade**. Code must be written with production-grade quality and designed for scale. 4. **Everything is an agent**. Not just user-facing agents, but every component in the infrastructure, whether a swarm of agents, an AI model storage system, a GPU compute node, a cross-chain bridge, an infrastructure microservice, or an API, is implemented as an agent. 5. **Agents do one thing and do it well**. Each agent should have a single, well-defined purpose and perform it well. 6. **Prompting as the unified agent interface**. All agents have a unified, simplified I/O interface with prompting and response for both human-to-agent interactions and agent-to-agent interactions. 7. **Composable**. Agents can work together to perform complex tasks via a chain of prompts. # Featured Integrations Eternal AI is built using a modular approach, so support for other blockchains, agent frameworks, GPU providers, or AI models can be implemented quickly. Please reach out if you run into issues while working on an integration. Featured Integrations (1) # Governance We are still building out the Eternal AI DAO. Once the DAO is in place, [EAI holders](https://eternalai.org/eai) will oversee the governance and the treasury of the Eternal AI project with a clear mission: to build truly open AI. # Contribute to Eternal AI Thank you for considering contributing to the source code. We welcome contributions from anyone and are grateful for even the most minor fixes. If you'd like to contribute to Eternal AI, please fork, fix, commit, and send a pull request for the maintainers to review and merge into the main code base. # Communication * [GitHub Issues](https://github.com/eternalai-org/eternal-ai/issues): bug reports, feature requests, issues, etc. * [GitHub Discussions](https://github.com/eternalai-org/eternal-ai/discussions): discuss designs, research, new ideas, thoughts, etc. * [X (Twitter)](https://x.com/cryptoeternalai): announcements about Eternal AI ================================================ FILE: agent-as-a-service/.eslint.config.js ================================================ import globals from "globals"; import js from "@eslint/js"; import ts from "@typescript-eslint/eslint-plugin"; import tsParser from "@typescript-eslint/parser"; import react from "eslint-plugin-react"; /** @type {import('eslint').Linter.FlatConfig[]} */ export default [ { files: ["**/*.{js,jsx,ts,tsx,mjs,cjs}"], ignorePatterns: [ "node_modules", "**/dist/**", "scripts/**", "client/browser/**" ], settings: { "react": { "version": "detect" } }, languageOptions: { parser: tsParser, parserOptions: { ecmaVersion: "latest", sourceType: "module", project: "./tsconfig.json", }, globals: { ...globals.browser, ...globals.node, }, }, plugins: { "@typescript-eslint": ts, react, }, "extends": [ "eslint:recommended", "plugin:@typescript-eslint/recommended", "plugin:react/recommended" ], rules: { ...js.configs.recommended.rules, ...ts.configs.recommended.rules, // Custom rules "object-curly-spacing": ["error", "always"], "indent": ["error", 2], "quotes": ["error", "double"], "semi": ["error", "always"], "@typescript-eslint/no-non-null-asserted-optional-chain": "off", "@typescript-eslint/no-empty-object-type": "off", "import/no-anonymous-default-export": "off", "@typescript-eslint/no-explicit-any": "off", "no-useless-catch": "off", "@typescript-eslint/no-unsafe-function-type": "off", "no-constant-binary-expression": "off", "react/react-in-jsx-scope": "off" }, }, ]; ================================================ FILE: agent-as-a-service/.gitignore ================================================ # Ignore node_modules in the root and all subdirectories node_modules/ **/node_modules/ .idea/ .env /dagent/db/ ================================================ FILE: agent-as-a-service/.npmrc ================================================ legacy-peer-deps=true ================================================ FILE: agent-as-a-service/.yarnrc.yml ================================================ nodeLinker: "node-modules" ================================================ FILE: agent-as-a-service/README.md ================================================ # Agent as a Service ## 🚀 Quick Start ### Use the Starter (Recommended) ```bash git clone https://github.com/eternalai-org/eternal-ai cd agent-as-a-service && cp .env.example .env yarn && yarn build ``` ### Create and Manage Your Agent 1. Modify the Default character: - Open `/dagent/src/dagentCharacter.ts` to modify the default character. Uncomment and edit. 2. Set `OWNER_PRIVATE_KEY`: - Required for authentication with the Eternal AI API. - EVM private key of the agent. 3. Set `ETERNAL_AI_URL`: - Required for connecting to the Eternal AI API. - Defaults to `https://api.eternal.ai`. 4. [Example dagent code](https://github.com/eternalai-org/eternal-ai/blob/master/agent-as-a-service/dagent/src/agent/index.ts) - Open `dagent/src/agent/index.ts` to read example code - Create an agent if you don't have one: - `await basicAgent.create();` - Get created agent information: - `await basicAgent.getAgentById(agent_id);` - agent_id: agent id from the agent creation step - If you don't remember the agent_id, you can get it by running: `await basicAgent.ownedAgents();` 5. Run the agent: - `yarn start:agent` ### Register your app on Shop apps and run your service [Example service code](https://github.com/eternalai-org/eternal-ai/blob/master/agent-as-a-service/dagent/src/direct/index.ts) ```bash yarn start:direct ``` ================================================ FILE: agent-as-a-service/agent-deep-researcher/Dockerfile ================================================ # Use the official Python 3.10 image FROM python:3.10 # Set the working directory in the container WORKDIR /app # Copy the Pipfile and Pipfile.lock to the working directory COPY Pipfile Pipfile.lock /app/ # Install Pipenv and project dependencies RUN pip install pipenv && pipenv install --deploy --ignore-pipfile # Copy the source code to the working directory COPY src /app/src # Expose port 5000 EXPOSE 5000 # Set environment variables ENV FLASK_APP=src/main.py ENV FLASK_RUN_HOST=0.0.0.0 # Install Gunicorn RUN pipenv install gunicorn # Command to run the Flask application with Gunicorn CMD ["pipenv", "run", "gunicorn", "--chdir", "/app/src", "--bind", "0.0.0.0:5000", "src.main:app"] ================================================ FILE: agent-as-a-service/agent-deep-researcher/Pipfile ================================================ [[source]] url = "https://pypi.org/simple" verify_ssl = true name = "pypi" [packages] flask-restful = "==0.3.10" nest-asyncio = "==1.6.0" gradio = "==5.14.0" aiohttp = "==3.11.11" celery = "*" redis = "*" gunicorn = "*" [dev-packages] [requires] python_version = "3.10" ================================================ FILE: agent-as-a-service/agent-deep-researcher/src/deep_research.py ================================================ import nest_asyncio nest_asyncio.apply() import asyncio import aiohttp import json import os # ======================= # Configuration Constants # ======================= OPENROUTER_API_KEY = "xxx" # Replace with your OpenRouter API key SERPAPI_API_KEY = os.getenv('SERPAPI_API_KEY') JINA_API_KEY = "xxx" # Replace with your JINA API key # Endpoints OPENROUTER_URL = "https://openrouter.ai/api/v1/chat/completions" SERPAPI_URL = "https://serpapi.com/search" JINA_BASE_URL = "https://r.jina.ai/" DEFAULT_MODEL = "anthropic/claude-3.5-haiku" # Internal AGENT_API_URL = os.getenv('AGENT_API_URL') AGENT_API_INTERNAL_KEY = os.getenv('AGENT_API_INTERNAL_KEY') INTERNAL_OPENAI_URL = os.getenv('INTERNAL_OPENAI_URL') INTERNAL_OPENAI_MODEL = os.getenv('INTERNAL_OPENAI_MODEL') INTERNAL_OPENAI_API_KEY = os.getenv('INTERNAL_OPENAI_API_KEY') # ============================ # Asynchronous Helper Functions # ============================ # async def call_openrouter_async_bk(session, messages, model=DEFAULT_MODEL): # """ # Asynchronously call the OpenRouter chat completion API with the provided messages. # Returns the content of the assistant’s reply. # """ # headers = { # "Authorization": f"Bearer {OPENROUTER_API_KEY}", # "X-Title": "OpenDeepResearcher, by Matt Shumer", # "Content-Type": "application/json" # } # payload = { # "model": model, # "messages": messages # } # try: # async with session.post(OPENROUTER_URL, headers=headers, json=payload) as resp: # if resp.status == 200: # result = await resp.json() # try: # return result['choices'][0]['message']['content'] # except (KeyError, IndexError) as e: # print("Unexpected OpenRouter response structure:", result) # return None # else: # text = await resp.text() # print(f"OpenRouter API error: {resp.status} - {text}") # return None # except Exception as e: # print("Error calling OpenRouter:", e) # return None async def call_openrouter_async(session, messages, model=INTERNAL_OPENAI_MODEL): """ Asynchronously call the OpenRouter chat completion API with the provided messages. Returns the content of the assistant’s reply. """ headers = { "Authorization": f"Bearer {INTERNAL_OPENAI_API_KEY}", "Content-Type": "application/json" } payload = { "model": model, "messages": messages, "stream": False, } try: async with session.post(INTERNAL_OPENAI_URL, headers=headers, json=payload) as resp: if resp.status == 200: result = await resp.json() try: return result['choices'][0]['message']['content'] except (KeyError, IndexError) as e: print("Unexpected OpenRouter response structure:", result) return None else: text = await resp.text() print(f"OpenRouter API error: {resp.status} - {text}") return None except Exception as e: print("Error calling OpenRouter:", e) return None async def generate_search_queries_async(session, user_query): """ Ask the LLM to produce up to four precise search queries (in Python list format) based on the user’s query. """ prompt = ( "You are an expert research assistant. Given the user's query, generate up to four distinct, " "precise search queries that would help gather comprehensive information on the topic. " "Return only a Python list of strings, for example: ['query1', 'query2', 'query3']." ) messages = [ {"role": "system", "content": "You are a helpful and precise research assistant."}, {"role": "user", "content": f"User Query: {user_query}\n\n{prompt}"} ] response = await call_openrouter_async(session, messages) if response: try: # Expect exactly a Python list (e.g., "['query1', 'query2']") search_queries = eval(response) if isinstance(search_queries, list): return search_queries else: print("LLM did not return a list. Response:", response) return [] except Exception as e: print("Error parsing search queries:", e, "\nResponse:", response) return [] return [] async def perform_search_async(session, query): """ Asynchronously perform a Google search using SERPAPI for the given query. Returns a list of result URLs. """ params = { "q": query, "api_key": SERPAPI_API_KEY, "engine": "google" } try: async with session.get(SERPAPI_URL, params=params) as resp: if resp.status == 200: results = await resp.json() if "organic_results" in results: links = [item.get("link") for item in results["organic_results"] if "link" in item] return links else: print("No organic results in SERPAPI response.") return [] else: text = await resp.text() print(f"SERPAPI error: {resp.status} - {text}") return [] except Exception as e: print("Error performing SERPAPI search:", e) return [] # async def fetch_webpage_text_async_bk(session, url): # """ # Asynchronously retrieve the text content of a webpage using Jina. # The URL is appended to the Jina endpoint. # """ # full_url = f"{JINA_BASE_URL}{url}" # headers = { # "Authorization": f"Bearer {JINA_API_KEY}" # } # try: # async with session.get(full_url, headers=headers) as resp: # if resp.status == 200: # return await resp.text() # else: # text = await resp.text() # print(f"Jina fetch error for {url}: {resp.status} - {text}") # return "" # except Exception as e: # print("Error fetching webpage text with Jina:", e) # return "" async def fetch_webpage_text_async(session, url): """ Asynchronously retrieve the text content of a webpage using Jina. The URL is appended to the Jina endpoint. """ full_url = f"{AGENT_API_URL}/internal/webtext?url={url}&api_key={AGENT_API_INTERNAL_KEY}" headers = {} try: async with session.get(full_url, headers=headers) as resp: if resp.status == 200: result = await resp.json() try: return result['result'] except (KeyError, IndexError) as e: print("Unexpected OpenRouter response structure:", result) return None else: result = await resp.json() print(f"Jina fetch error for {url}: {resp.status} - {result.error}") return "" except Exception as e: print("Error fetching webpage text with Jina:", e) return "" async def is_page_useful_async(session, user_query, page_text): """ Ask the LLM if the provided webpage content is useful for answering the user's query. The LLM must reply with exactly "Yes" or "No". """ prompt = ( "You are a critical research evaluator. Given the user's query and the content of a webpage, " "determine if the webpage contains information relevant and useful for addressing the query. " "Respond with exactly one word: 'Yes' if the page is useful, or 'No' if it is not. Do not include any extra text." ) messages = [ {"role": "system", "content": "You are a strict and concise evaluator of research relevance."}, {"role": "user", "content": f"User Query: {user_query}\n\nWebpage Content (first 20000 characters):\n{page_text[:20000]}\n\n{prompt}"} ] response = await call_openrouter_async(session, messages) if response: answer = response.strip() if answer in ["Yes", "No"]: return answer else: # Fallback: try to extract Yes/No from the response. if "Yes" in answer: return "Yes" elif "No" in answer: return "No" return "No" async def extract_relevant_context_async(session, user_query, search_query, page_text): """ Given the original query, the search query used, and the page content, have the LLM extract all information relevant for answering the query. """ prompt = ( "You are an expert information extractor. Given the user's query, the search query that led to this page, " "and the webpage content, extract all pieces of information that are relevant to answering the user's query. " "Return only the relevant context as plain text without commentary." ) messages = [ {"role": "system", "content": "You are an expert in extracting and summarizing relevant information."}, {"role": "user", "content": f"User Query: {user_query}\nSearch Query: {search_query}\n\nWebpage Content (first 20000 characters):\n{page_text[:20000]}\n\n{prompt}"} ] response = await call_openrouter_async(session, messages) if response: return response.strip() return "" async def get_new_search_queries_async(session, user_query, previous_search_queries, all_contexts): """ Based on the original query, the previously used search queries, and all the extracted contexts, ask the LLM whether additional search queries are needed. If yes, return a Python list of up to four queries; if the LLM thinks research is complete, it should return "". """ context_combined = "\n".join(all_contexts) prompt = ( "You are an analytical research assistant. Based on the original query, the search queries performed so far, " "and the extracted contexts from webpages, determine if further research is needed. " "If further research is needed, provide up to four new search queries as a Python list (for example, " "['new query1', 'new query2']). If you believe no further research is needed, respond with exactly ." "\nOutput only a Python list or the token without any additional text." ) messages = [ {"role": "system", "content": "You are a systematic research planner."}, {"role": "user", "content": f"User Query: {user_query}\nPrevious Search Queries: {previous_search_queries}\n\nExtracted Relevant Contexts:\n{context_combined}\n\n{prompt}"} ] response = await call_openrouter_async(session, messages) if response: cleaned = response.strip() if cleaned == "": return "" try: new_queries = eval(cleaned) if isinstance(new_queries, list): return new_queries else: print("LLM did not return a list for new search queries. Response:", response) return [] except Exception as e: print("Error parsing new search queries:", e, "\nResponse:", response) return [] return [] async def generate_final_report_async(session, user_query, all_contexts): """ Generate the final comprehensive report using all gathered contexts. """ context_combined = "\n".join(all_contexts) print(f"generate_final_report_async: {context_combined}") prompt = ( "You are an expert researcher and report writer. Based on the gathered contexts below and the original query, " "write a comprehensive, well-structured, and detailed report that addresses the query thoroughly. " "Include all relevant insights and conclusions without extraneous commentary." ) messages = [ {"role": "system", "content": "You are a skilled report writer."}, {"role": "user", "content": f"User Query: {user_query}\n\nGathered Relevant Contexts:\n{context_combined}\n\n{prompt}"} ] report = await call_openrouter_async(session, messages) return report async def process_link(session, link, user_query, search_query): """ Process a single link: fetch its content, judge its usefulness, and if useful, extract the relevant context. """ print(f"Fetching content from: {link}") page_text = await fetch_webpage_text_async(session, link) if not page_text: return None usefulness = await is_page_useful_async(session, user_query, page_text) print(f"Page usefulness for {link}: {usefulness}") if usefulness == "Yes": context = await extract_relevant_context_async(session, user_query, search_query, page_text) if context: print(f"Extracted context from {link} (first 200 chars): {context[:200]}") return context return None # ========================= # Main Asynchronous Routine # ========================= async def async_main(run_id = "", user_query="", iteration_limit=2): # user_query = input("Enter your research query/topic: ").strip() # iter_limit_input = input("Enter maximum number of iterations (default 10): ").strip() # iteration_limit = int(iter_limit_input) if iter_limit_input.isdigit() else 10 aggregated_contexts = [] # All useful contexts from every iteration all_search_queries = [] # Every search query used across iterations iteration = 0 async with aiohttp.ClientSession() as session: # ----- INITIAL SEARCH QUERIES ----- new_search_queries = await generate_search_queries_async(session, user_query) print(f"\n=== new_search_queries {new_search_queries} ===") if not new_search_queries: print("No search queries were generated by the LLM. Exiting.") return all_search_queries.extend(new_search_queries) # ----- ITERATIVE RESEARCH LOOP ----- while iteration < iteration_limit: print(f"\n=== Iteration {iteration + 1} ===") iteration_contexts = [] # For each search query, perform SERPAPI searches concurrently. search_tasks = [perform_search_async(session, query) for query in new_search_queries] search_results = await asyncio.gather(*search_tasks) # Aggregate all unique links from all search queries of this iteration. # Map each unique link to the search query that produced it. unique_links = {} for idx, links in enumerate(search_results): query = new_search_queries[idx] for link in links: if link not in unique_links: unique_links[link] = query print(f"Aggregated {len(unique_links)} unique links from this iteration.") # Process each link concurrently: fetch, judge, and extract context. link_tasks = [ process_link(session, link, user_query, unique_links[link]) for link in unique_links ] link_results = await asyncio.gather(*link_tasks) # Collect non-None contexts. for res in link_results: if res: iteration_contexts.append(res) if iteration_contexts: aggregated_contexts.extend(iteration_contexts) else: print("No useful contexts were found in this iteration.") # ----- ASK THE LLM IF MORE SEARCHES ARE NEEDED ----- new_search_queries = await get_new_search_queries_async(session, user_query, all_search_queries, aggregated_contexts) if new_search_queries == "": print("LLM indicated that no further research is needed.") break elif new_search_queries: print("LLM provided new search queries:", new_search_queries) all_search_queries.extend(new_search_queries) else: print("LLM did not provide any new search queries. Ending the loop.") break iteration += 1 # ----- FINAL REPORT ----- print("\nGenerating final report...") final_report = await generate_final_report_async(session, user_query, aggregated_contexts) print(f"\n==== FINAL REPORT {run_id}====\n") print(final_report) def run_deep_research(run_id= "", user_query="", iter_limit_input=2): # asyncio.run_until_complete(async_main(run_id, user_query, iter_limit_input)) asyncio.run(async_main(run_id, user_query, iter_limit_input)) # if __name__ == "__main__": # main() ================================================ FILE: agent-as-a-service/agent-deep-researcher/src/main.py ================================================ from flask import Flask, jsonify, request from flask_restful import Resource, Api from multiprocessing import Process from deep_research import run_deep_research app = Flask(__name__) api = Api(app) class Hello(Resource): def get(self): return jsonify({'result': 'hello world'}) class DeepResearch(Resource): def post(self): req_data = request.get_json() query = req_data.get('query') req_id = req_data.get('req_id') try: p = Process(target=run_deep_research, args=(req_id, query, 1)) p.start() return jsonify({'result': 'ok'}) except Exception as ex: return jsonify({'result': 'failed'}) api.add_resource(Hello, '/') api.add_resource(DeepResearch, '/research') if __name__ == '__main__': app.run(debug = True) ================================================ FILE: agent-as-a-service/agent-launchpad/.gitignore ================================================ node_modules node_modules .env coverage coverage.json typechain typechain-types # Hardhat files cache artifacts artifacts/ artifacts-zk/ cache/ cache-zk/ crytic-export/ node_modules/ typechain/ deployments .env wwwrd.rd* .vscode ================================================ FILE: agent-as-a-service/agent-launchpad/README.md ================================================ # Truly Open AI ================================================ FILE: agent-as-a-service/agent-launchpad/contracts/base/BaseMulticall.sol ================================================ // SPDX-License-Identifier: GPL-2.0-or-later pragma solidity ^0.8.0; /// @title BaseMulticall /// @notice Enables calling multiple methods in a single call to the contract abstract contract BaseMulticall { function multicall( bytes[] calldata data ) public payable returns (bytes[] memory results) { results = new bytes[](data.length); for (uint256 i = 0; i < data.length; i++) { (bool success, bytes memory result) = address(this).delegatecall( data[i] ); if (!success) { // Next 5 lines from https://ethereum.stackexchange.com/a/83577 if (result.length < 68) revert(); assembly { result := add(result, 0x04) } revert(abi.decode(result, (string))); } results[i] = result; } } } ================================================ FILE: agent-as-a-service/agent-launchpad/contracts/base/BaseUpgradeable.sol ================================================ // SPDX-License-Identifier: GPL-3.0-or-later pragma solidity ^0.8.0; import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import {ReentrancyGuardUpgradeable} from "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol"; import {BaseMulticall} from "./BaseMulticall.sol"; import {BlockContext} from "./BlockContext.sol"; contract BaseUpgradeable is BlockContext, BaseMulticall, OwnableUpgradeable, ReentrancyGuardUpgradeable { function __BaseUpgradeable_init() internal { __Ownable_init(); __ReentrancyGuard_init(); } } ================================================ FILE: agent-as-a-service/agent-launchpad/contracts/base/BlockContext.sol ================================================ // SPDX-License-Identifier: GPL-3.0-or-later pragma solidity ^0.8.0; abstract contract BlockContext { function _blockTimestamp32() internal view virtual returns (uint32) { return uint32(block.timestamp); } function _blockTimestamp() internal view virtual returns (uint256) { return uint256(block.timestamp); } function _blockNumber() internal view virtual returns (uint256) { return block.number; } function getChainId() public view virtual returns (uint256 chainId) { assembly { chainId := chainid() } } } ================================================ FILE: agent-as-a-service/agent-launchpad/contracts/core/NoDelegateCall.sol ================================================ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.0; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; /// @title Prevents delegatecall to a contract /// @notice Base contract that provides a modifier for preventing delegatecall to methods in a child contract abstract contract NoDelegateCall is Initializable { /// @dev The original address of this contract address private original; function __NoDelegateCall_init() internal onlyInitializing { original = address(this); } /// @dev Private method is used instead of inlining into modifier because modifiers are copied into each method, /// and the use of immutable means the address bytes are copied in every place the modifier is used. function checkNotDelegateCall() private view { require(address(this) == original); } /// @notice Prevents delegatecall into the modified method modifier noDelegateCall() { checkNotDelegateCall(); _; } } ================================================ FILE: agent-as-a-service/agent-launchpad/contracts/core/UniswapV3Factory.sol ================================================ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.0; import {AddressUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol"; import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import "../base/BlockContext.sol"; import "./interfaces/IUniswapV3Factory.sol"; import "./UniswapV3PoolDeployer.sol"; import "./NoDelegateCall.sol"; import "./UniswapV3Pool.sol"; /// @title Canonical Uniswap V3 factory /// @notice Deploys Uniswap V3 pools and manages _ownership and control over pool protocol fees contract UniswapV3Factory is IUniswapV3Factory, BlockContext, OwnableUpgradeable, UniswapV3PoolDeployer, NoDelegateCall { using AddressUpgradeable for address; // /// @inheritdoc IUniswapV3Factory address public override getUniswapV3PoolImplementation; /// @inheritdoc IUniswapV3Factory mapping(uint24 => int24) public override feeAmountTickSpacing; /// @inheritdoc IUniswapV3Factory mapping(address => mapping(address => mapping(uint24 => address))) public override getPool; /// @inheritdoc IUniswapV3Factory uint8 public override feeProtocol; /// @inheritdoc IUniswapV3Factory address public override feeTo; function initialize() external initializer { __Ownable_init(); __NoDelegateCall_init(); // feeAmountTickSpacing[100] = 1; emit FeeAmountEnabled(100, 1); feeAmountTickSpacing[500] = 10; emit FeeAmountEnabled(500, 10); feeAmountTickSpacing[3000] = 60; emit FeeAmountEnabled(3000, 60); feeAmountTickSpacing[5000] = 100; emit FeeAmountEnabled(5000, 100); feeAmountTickSpacing[10000] = 200; emit FeeAmountEnabled(10000, 200); feeAmountTickSpacing[20000] = 400; emit FeeAmountEnabled(20000, 400); feeAmountTickSpacing[50000] = 1000; emit FeeAmountEnabled(50000, 1000); feeAmountTickSpacing[100000] = 2000; emit FeeAmountEnabled(100000, 2000); // setFeeToInternal(msg.sender); } function setUniswapV3PoolImplementation( address uniswapV3PoolImplementationArg ) external onlyOwner { require(uniswapV3PoolImplementationArg.isContract(), "UF_INC"); getUniswapV3PoolImplementation = uniswapV3PoolImplementationArg; } /// @inheritdoc IUniswapV3Factory function createPool( address tokenA, address tokenB, uint24 fee ) external override noDelegateCall returns (address pool) { require(tokenA != tokenB); (address token0, address token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA); require(token0 != address(0)); int24 tickSpacing = feeAmountTickSpacing[fee]; require(tickSpacing != 0); require(getPool[token0][token1][fee] == address(0)); pool = deploy(address(this), token0, token1, fee, tickSpacing); getPool[token0][token1][fee] = pool; // populate mapping in the reverse direction, deliberate choice to avoid the cost of comparing addresses getPool[token1][token0][fee] = pool; emit PoolCreated(token0, token1, fee, tickSpacing, pool); } /// @inheritdoc IUniswapV3Factory function enableFeeAmount( uint24 fee, int24 tickSpacing ) public override onlyOwner { require(fee < 1000000); // tick spacing is capped at 16384 to prevent the situation where tickSpacing is so large that // TickBitmap#nextInitializedTickWithinOneWord overflows int24 container from a valid tick // 16384 ticks represents a >5x price change with ticks of 1 bips require(tickSpacing > 0 && tickSpacing < 16384); require(feeAmountTickSpacing[fee] == 0); feeAmountTickSpacing[fee] = tickSpacing; emit FeeAmountEnabled(fee, tickSpacing); } function setFeeProtocol( uint8 feeProtocol0, uint8 feeProtocol1 ) external override onlyOwner { setFeeProtocolInternal(feeProtocol0, feeProtocol1); } function setFeeProtocolInternal( uint8 feeProtocol0, uint8 feeProtocol1 ) internal { require( (feeProtocol0 == 0 || (feeProtocol0 >= 1 && feeProtocol0 <= 10)) && (feeProtocol1 == 0 || (feeProtocol1 >= 1 && feeProtocol1 <= 10)) ); uint8 feeProtocolOld = feeProtocol; feeProtocol = feeProtocol0 + (feeProtocol1 << 4); emit SetFeeProtocol( feeProtocolOld % 16, feeProtocolOld >> 4, feeProtocol0, feeProtocol1 ); } function setFeeTo(address feeToArg) external override onlyOwner { setFeeToInternal(feeToArg); } function setFeeToInternal(address feeToArg) internal { require(feeToArg != address(0)); feeTo = feeToArg; emit SetFeeTo(feeToArg, feeTo); } } ================================================ FILE: agent-as-a-service/agent-launchpad/contracts/core/UniswapV3Pool.sol ================================================ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.0; import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import "../base/BlockContext.sol"; import "./interfaces/IUniswapV3Pool.sol"; import "./NoDelegateCall.sol"; import "./libraries/LowGasSafeMath.sol"; import "./libraries/SafeCast.sol"; import "./libraries/Tick.sol"; import "./libraries/TickBitmap.sol"; import "./libraries/Position.sol"; import "./libraries/Oracle.sol"; import "./libraries/FullMath.sol"; import "./libraries/FixedPoint128.sol"; import "./libraries/TransferHelper.sol"; import "./libraries/TickMath.sol"; import "./libraries/LiquidityMath.sol"; import "./libraries/SqrtPriceMath.sol"; import "./libraries/SwapMath.sol"; import "./interfaces/IUniswapV3PoolDeployer.sol"; import "./interfaces/IUniswapV3Factory.sol"; import "./interfaces/IERC20Minimal.sol"; import "./interfaces/callback/IUniswapV3MintCallback.sol"; import "./interfaces/callback/IUniswapV3SwapCallback.sol"; import "./interfaces/callback/IUniswapV3FlashCallback.sol"; contract UniswapV3Pool is IUniswapV3Pool, BlockContext, OwnableUpgradeable, NoDelegateCall { using LowGasSafeMath for uint256; using LowGasSafeMath for int256; using SafeCast for uint256; using SafeCast for int256; using Tick for mapping(int24 => Tick.Info); using TickBitmap for mapping(int16 => uint256); using Position for mapping(bytes32 => Position.Info); using Position for Position.Info; using Oracle for Oracle.Observation[65535]; /// @inheritdoc IUniswapV3PoolImmutables address public override factory; /// @inheritdoc IUniswapV3PoolImmutables address public override token0; /// @inheritdoc IUniswapV3PoolImmutables address public override token1; /// @inheritdoc IUniswapV3PoolImmutables uint24 public override fee; /// @inheritdoc IUniswapV3PoolImmutables int24 public override tickSpacing; /// @inheritdoc IUniswapV3PoolImmutables uint128 public override maxLiquidityPerTick; struct Slot0 { // the current price uint160 sqrtPriceX96; // the current tick int24 tick; // the most-recently updated index of the observations array uint16 observationIndex; // the current maximum number of observations that are being stored uint16 observationCardinality; // the next maximum number of observations to store, triggered in observations.write uint16 observationCardinalityNext; // the current protocol fee as a percentage of the swap fee taken on withdrawal // represented as an integer denominator (1/x)% uint8 feeProtocol_; // whether the pool is locked bool unlocked; } /// @inheritdoc IUniswapV3PoolState Slot0 public override slot0; /// @inheritdoc IUniswapV3PoolState uint256 public override feeGrowthGlobal0X128; /// @inheritdoc IUniswapV3PoolState uint256 public override feeGrowthGlobal1X128; // accumulated protocol fees in token0/token1 units struct ProtocolFees { uint128 token0; uint128 token1; } /// @inheritdoc IUniswapV3PoolState ProtocolFees public override protocolFees; /// @inheritdoc IUniswapV3PoolState uint128 public override liquidity; /// @inheritdoc IUniswapV3PoolState mapping(int24 => Tick.Info) public override ticks; /// @inheritdoc IUniswapV3PoolState mapping(int16 => uint256) public override tickBitmap; /// @inheritdoc IUniswapV3PoolState mapping(bytes32 => Position.Info) public override positions; /// @inheritdoc IUniswapV3PoolState Oracle.Observation[65535] public override observations; /// @dev Mutually exclusive reentrancy protection into the pool to/from a method. This method also prevents entrance /// to a function before the pool is initialized. The reentrancy guard is required throughout the contract because /// we use balance checks to determine the payment status of interactions such as mint, swap and flash. modifier lock() { require(slot0.unlocked, "LOK"); slot0.unlocked = false; _; slot0.unlocked = true; } /// @dev Prevents calling a function from anyone except the address returned by IUniswapV3Factory#owner() modifier onlyFactoryOwner() { require(msg.sender == OwnableUpgradeable(factory).owner()); _; } function init() external override initializer { __Ownable_init(); __NoDelegateCall_init(); // int24 _tickSpacing; (factory, token0, token1, fee, _tickSpacing) = IUniswapV3PoolDeployer( msg.sender ).parameters(); tickSpacing = _tickSpacing; maxLiquidityPerTick = Tick.tickSpacingToMaxLiquidityPerTick( _tickSpacing ); } /// @dev Common checks for valid tick inputs. function checkTicks(int24 tickLower, int24 tickUpper) private pure { require(tickLower < tickUpper, "TLU"); require(tickLower >= TickMath.MIN_TICK, "TLM"); require(tickUpper <= TickMath.MAX_TICK, "TUM"); } /// @dev Get the pool's balance of token0 /// @dev This function is gas optimized to avoid a redundant extcodesize check in addition to the returndatasize /// check function balance0() private view returns (uint256) { (bool success, bytes memory data) = token0.staticcall( abi.encodeWithSelector( IERC20Minimal.balanceOf.selector, address(this) ) ); require(success && data.length >= 32); return abi.decode(data, (uint256)); } /// @dev Get the pool's balance of token1 /// @dev This function is gas optimized to avoid a redundant extcodesize check in addition to the returndatasize /// check function balance1() private view returns (uint256) { (bool success, bytes memory data) = token1.staticcall( abi.encodeWithSelector( IERC20Minimal.balanceOf.selector, address(this) ) ); require(success && data.length >= 32); return abi.decode(data, (uint256)); } /// @inheritdoc IUniswapV3PoolDerivedState function snapshotCumulativesInside( int24 tickLower, int24 tickUpper ) external view override noDelegateCall returns ( int56 tickCumulativeInside, uint160 secondsPerLiquidityInsideX128, uint32 secondsInside ) { checkTicks(tickLower, tickUpper); int56 tickCumulativeLower; int56 tickCumulativeUpper; uint160 secondsPerLiquidityOutsideLowerX128; uint160 secondsPerLiquidityOutsideUpperX128; uint32 secondsOutsideLower; uint32 secondsOutsideUpper; { Tick.Info storage lower = ticks[tickLower]; Tick.Info storage upper = ticks[tickUpper]; bool initializedLower; ( tickCumulativeLower, secondsPerLiquidityOutsideLowerX128, secondsOutsideLower, initializedLower ) = ( lower.tickCumulativeOutside, lower.secondsPerLiquidityOutsideX128, lower.secondsOutside, lower.initialized ); require(initializedLower); bool initializedUpper; ( tickCumulativeUpper, secondsPerLiquidityOutsideUpperX128, secondsOutsideUpper, initializedUpper ) = ( upper.tickCumulativeOutside, upper.secondsPerLiquidityOutsideX128, upper.secondsOutside, upper.initialized ); require(initializedUpper); } Slot0 memory _slot0 = slot0; if (_slot0.tick < tickLower) { return ( tickCumulativeLower - tickCumulativeUpper, secondsPerLiquidityOutsideLowerX128 - secondsPerLiquidityOutsideUpperX128, secondsOutsideLower - secondsOutsideUpper ); } else if (_slot0.tick < tickUpper) { uint32 time = _blockTimestamp32(); ( int56 tickCumulative, uint160 secondsPerLiquidityCumulativeX128 ) = observations.observeSingle( time, 0, _slot0.tick, _slot0.observationIndex, liquidity, _slot0.observationCardinality ); return ( tickCumulative - tickCumulativeLower - tickCumulativeUpper, secondsPerLiquidityCumulativeX128 - secondsPerLiquidityOutsideLowerX128 - secondsPerLiquidityOutsideUpperX128, time - secondsOutsideLower - secondsOutsideUpper ); } else { return ( tickCumulativeUpper - tickCumulativeLower, secondsPerLiquidityOutsideUpperX128 - secondsPerLiquidityOutsideLowerX128, secondsOutsideUpper - secondsOutsideLower ); } } /// @inheritdoc IUniswapV3PoolDerivedState function observe( uint32[] calldata secondsAgos ) external view override noDelegateCall returns ( int56[] memory tickCumulatives, uint160[] memory secondsPerLiquidityCumulativeX128s ) { return observations.observe( _blockTimestamp32(), secondsAgos, slot0.tick, slot0.observationIndex, liquidity, slot0.observationCardinality ); } /// @inheritdoc IUniswapV3PoolActions function increaseObservationCardinalityNext( uint16 observationCardinalityNext ) external override lock noDelegateCall { uint16 observationCardinalityNextOld = slot0.observationCardinalityNext; // for the event uint16 observationCardinalityNextNew = observations.grow( observationCardinalityNextOld, observationCardinalityNext ); slot0.observationCardinalityNext = observationCardinalityNextNew; if (observationCardinalityNextOld != observationCardinalityNextNew) emit IncreaseObservationCardinalityNext( observationCardinalityNextOld, observationCardinalityNextNew ); } /// @inheritdoc IUniswapV3PoolActions /// @dev not locked because it initializes unlocked function initialize(uint160 sqrtPriceX96) external override { require(slot0.sqrtPriceX96 == 0, "AI"); int24 tick = TickMath.getTickAtSqrtRatio(sqrtPriceX96); (uint16 cardinality, uint16 cardinalityNext) = observations.initialize( _blockTimestamp32() ); slot0 = Slot0({ sqrtPriceX96: sqrtPriceX96, tick: tick, observationIndex: 0, observationCardinality: cardinality, observationCardinalityNext: cardinalityNext, feeProtocol_: 0, unlocked: true }); emit Initialize(sqrtPriceX96, tick); } struct ModifyPositionParams { // the address that owns the position address owner; // the lower and upper tick of the position int24 tickLower; int24 tickUpper; // any change in liquidity int128 liquidityDelta; } /// @dev Effect some changes to a position /// @param params the position details and the change to the position's liquidity to effect /// @return position a storage pointer referencing the position with the given owner and tick range /// @return amount0 the amount of token0 owed to the pool, negative if the pool should pay the recipient /// @return amount1 the amount of token1 owed to the pool, negative if the pool should pay the recipient function _modifyPosition( ModifyPositionParams memory params ) private noDelegateCall returns (Position.Info storage position, int256 amount0, int256 amount1) { checkTicks(params.tickLower, params.tickUpper); Slot0 memory _slot0 = slot0; // SLOAD for gas optimization position = _updatePosition( params.owner, params.tickLower, params.tickUpper, params.liquidityDelta, _slot0.tick ); if (params.liquidityDelta != 0) { if (_slot0.tick < params.tickLower) { // current tick is below the passed range; liquidity can only become in range by crossing from left to // right, when we'll need _more_ token0 (it's becoming more valuable) so user must provide it amount0 = SqrtPriceMath.getAmount0Delta( TickMath.getSqrtRatioAtTick(params.tickLower), TickMath.getSqrtRatioAtTick(params.tickUpper), params.liquidityDelta ); } else if (_slot0.tick < params.tickUpper) { // current tick is inside the passed range uint128 liquidityBefore = liquidity; // SLOAD for gas optimization // write an oracle entry ( slot0.observationIndex, slot0.observationCardinality ) = observations.write( _slot0.observationIndex, _blockTimestamp32(), _slot0.tick, liquidityBefore, _slot0.observationCardinality, _slot0.observationCardinalityNext ); amount0 = SqrtPriceMath.getAmount0Delta( _slot0.sqrtPriceX96, TickMath.getSqrtRatioAtTick(params.tickUpper), params.liquidityDelta ); amount1 = SqrtPriceMath.getAmount1Delta( TickMath.getSqrtRatioAtTick(params.tickLower), _slot0.sqrtPriceX96, params.liquidityDelta ); liquidity = LiquidityMath.addDelta( liquidityBefore, params.liquidityDelta ); } else { // current tick is above the passed range; liquidity can only become in range by crossing from right to // left, when we'll need _more_ token1 (it's becoming more valuable) so user must provide it amount1 = SqrtPriceMath.getAmount1Delta( TickMath.getSqrtRatioAtTick(params.tickLower), TickMath.getSqrtRatioAtTick(params.tickUpper), params.liquidityDelta ); } } } /// @dev Gets and updates a position with the given liquidity delta /// @param owner the owner of the position /// @param tickLower the lower tick of the position's tick range /// @param tickUpper the upper tick of the position's tick range /// @param tick the current tick, passed to avoid sloads function _updatePosition( address owner, int24 tickLower, int24 tickUpper, int128 liquidityDelta, int24 tick ) private returns (Position.Info storage position) { position = positions.get(owner, tickLower, tickUpper); uint256 _feeGrowthGlobal0X128 = feeGrowthGlobal0X128; // SLOAD for gas optimization uint256 _feeGrowthGlobal1X128 = feeGrowthGlobal1X128; // SLOAD for gas optimization // if we need to update the ticks, do it bool flippedLower; bool flippedUpper; if (liquidityDelta != 0) { uint32 time = _blockTimestamp32(); ( int56 tickCumulative, uint160 secondsPerLiquidityCumulativeX128 ) = observations.observeSingle( time, 0, slot0.tick, slot0.observationIndex, liquidity, slot0.observationCardinality ); flippedLower = ticks.update( tickLower, tick, liquidityDelta, _feeGrowthGlobal0X128, _feeGrowthGlobal1X128, secondsPerLiquidityCumulativeX128, tickCumulative, time, false, maxLiquidityPerTick ); flippedUpper = ticks.update( tickUpper, tick, liquidityDelta, _feeGrowthGlobal0X128, _feeGrowthGlobal1X128, secondsPerLiquidityCumulativeX128, tickCumulative, time, true, maxLiquidityPerTick ); if (flippedLower) { tickBitmap.flipTick(tickLower, tickSpacing); } if (flippedUpper) { tickBitmap.flipTick(tickUpper, tickSpacing); } } (uint256 feeGrowthInside0X128, uint256 feeGrowthInside1X128) = ticks .getFeeGrowthInside( tickLower, tickUpper, tick, _feeGrowthGlobal0X128, _feeGrowthGlobal1X128 ); position.update( liquidityDelta, feeGrowthInside0X128, feeGrowthInside1X128 ); // clear any tick data that is no longer needed if (liquidityDelta < 0) { if (flippedLower) { ticks.clear(tickLower); } if (flippedUpper) { ticks.clear(tickUpper); } } } /// @inheritdoc IUniswapV3PoolActions /// @dev noDelegateCall is applied indirectly via _modifyPosition function mint( address recipient, int24 tickLower, int24 tickUpper, uint128 amount, bytes calldata data ) external override lock returns (uint256 amount0, uint256 amount1) { require(amount > 0); (, int256 amount0Int, int256 amount1Int) = _modifyPosition( ModifyPositionParams({ owner: recipient, tickLower: tickLower, tickUpper: tickUpper, liquidityDelta: int256(uint256(amount)).toInt128() }) ); amount0 = uint256(amount0Int); amount1 = uint256(amount1Int); uint256 balance0Before; uint256 balance1Before; if (amount0 > 0) balance0Before = balance0(); if (amount1 > 0) balance1Before = balance1(); IUniswapV3MintCallback(msg.sender).uniswapV3MintCallback( amount0, amount1, data ); if (amount0 > 0) require(balance0Before.add(amount0) <= balance0(), "M0"); if (amount1 > 0) require(balance1Before.add(amount1) <= balance1(), "M1"); emit Mint( msg.sender, recipient, tickLower, tickUpper, amount, amount0, amount1 ); // collectProtocolInternal(); } /// @inheritdoc IUniswapV3PoolActions function collect( address recipient, int24 tickLower, int24 tickUpper, uint128 amount0Requested, uint128 amount1Requested ) external override lock returns (uint128 amount0, uint128 amount1) { // we don't need to checkTicks here, because invalid positions will never have non-zero tokensOwed{0,1} Position.Info storage position = positions.get( msg.sender, tickLower, tickUpper ); amount0 = amount0Requested > position.tokensOwed0 ? position.tokensOwed0 : amount0Requested; amount1 = amount1Requested > position.tokensOwed1 ? position.tokensOwed1 : amount1Requested; if (amount0 > 0) { position.tokensOwed0 -= amount0; TransferHelper.safeTransfer(token0, recipient, amount0); } if (amount1 > 0) { position.tokensOwed1 -= amount1; TransferHelper.safeTransfer(token1, recipient, amount1); } emit Collect( msg.sender, recipient, tickLower, tickUpper, amount0, amount1 ); // collectProtocolInternal(); } /// @inheritdoc IUniswapV3PoolActions /// @dev noDelegateCall is applied indirectly via _modifyPosition function burn( int24 tickLower, int24 tickUpper, uint128 amount ) external override lock returns (uint256 amount0, uint256 amount1) { ( Position.Info storage position, int256 amount0Int, int256 amount1Int ) = _modifyPosition( ModifyPositionParams({ owner: msg.sender, tickLower: tickLower, tickUpper: tickUpper, liquidityDelta: -int256(uint256(amount)).toInt128() }) ); amount0 = uint256(-amount0Int); amount1 = uint256(-amount1Int); if (amount0 > 0 || amount1 > 0) { (position.tokensOwed0, position.tokensOwed1) = ( position.tokensOwed0 + uint128(amount0), position.tokensOwed1 + uint128(amount1) ); } emit Burn(msg.sender, tickLower, tickUpper, amount, amount0, amount1); // collectProtocolInternal(); } struct SwapCache { // the protocol fee for the input token uint8 feeProtocol; // liquidity at the beginning of the swap uint128 liquidityStart; // the timestamp of the current block uint32 blockTimestamp; // the current value of the tick accumulator, computed only if we cross an initialized tick int56 tickCumulative; // the current value of seconds per liquidity accumulator, computed only if we cross an initialized tick uint160 secondsPerLiquidityCumulativeX128; // whether we've computed and cached the above two accumulators bool computedLatestObservation; } // the top level state of the swap, the results of which are recorded in storage at the end struct SwapState { // the amount remaining to be swapped in/out of the input/output asset int256 amountSpecifiedRemaining; // the amount already swapped out/in of the output/input asset int256 amountCalculated; // current sqrt(price) uint160 sqrtPriceX96; // the tick associated with the current price int24 tick; // the global fee growth of the input token uint256 feeGrowthGlobalX128; // amount of input token paid as protocol fee uint128 protocolFee; // the current liquidity in range uint128 liquidity; } struct StepComputations { // the price at the beginning of the step uint160 sqrtPriceStartX96; // the next tick to swap to from the current tick in the swap direction int24 tickNext; // whether tickNext is initialized or not bool initialized; // sqrt(price) for the next tick (1/0) uint160 sqrtPriceNextX96; // how much is being swapped in in this step uint256 amountIn; // how much is being swapped out uint256 amountOut; // how much fee is being paid in uint256 feeAmount; } /// @inheritdoc IUniswapV3PoolActions function swap( address recipient, bool zeroForOne, int256 amountSpecified, uint160 sqrtPriceLimitX96, bytes calldata data ) external override noDelegateCall returns (int256 amount0, int256 amount1) { require(amountSpecified != 0, "AS"); Slot0 memory slot0Start = slot0; require(slot0Start.unlocked, "LOK"); require( zeroForOne ? sqrtPriceLimitX96 < slot0Start.sqrtPriceX96 && sqrtPriceLimitX96 > TickMath.MIN_SQRT_RATIO : sqrtPriceLimitX96 > slot0Start.sqrtPriceX96 && sqrtPriceLimitX96 < TickMath.MAX_SQRT_RATIO, "SPL" ); slot0.unlocked = false; SwapCache memory cache; { uint8 feeProtocol = IUniswapV3Factory(factory).feeProtocol(); cache = SwapCache({ liquidityStart: liquidity, blockTimestamp: _blockTimestamp32(), feeProtocol: zeroForOne ? (feeProtocol % 16) : (feeProtocol >> 4), secondsPerLiquidityCumulativeX128: 0, tickCumulative: 0, computedLatestObservation: false }); } bool exactInput = amountSpecified > 0; SwapState memory state = SwapState({ amountSpecifiedRemaining: amountSpecified, amountCalculated: 0, sqrtPriceX96: slot0Start.sqrtPriceX96, tick: slot0Start.tick, feeGrowthGlobalX128: zeroForOne ? feeGrowthGlobal0X128 : feeGrowthGlobal1X128, protocolFee: 0, liquidity: cache.liquidityStart }); // continue swapping as long as we haven't used the entire input/output and haven't reached the price limit while ( state.amountSpecifiedRemaining != 0 && state.sqrtPriceX96 != sqrtPriceLimitX96 ) { StepComputations memory step; step.sqrtPriceStartX96 = state.sqrtPriceX96; (step.tickNext, step.initialized) = tickBitmap .nextInitializedTickWithinOneWord( state.tick, tickSpacing, zeroForOne ); // ensure that we do not overshoot the min/max tick, as the tick bitmap is not aware of these bounds if (step.tickNext < TickMath.MIN_TICK) { step.tickNext = TickMath.MIN_TICK; } else if (step.tickNext > TickMath.MAX_TICK) { step.tickNext = TickMath.MAX_TICK; } // get the price for the next tick step.sqrtPriceNextX96 = TickMath.getSqrtRatioAtTick(step.tickNext); // compute values to swap to the target tick, price limit, or point where input/output amount is exhausted ( state.sqrtPriceX96, step.amountIn, step.amountOut, step.feeAmount ) = SwapMath.computeSwapStep( state.sqrtPriceX96, ( zeroForOne ? step.sqrtPriceNextX96 < sqrtPriceLimitX96 : step.sqrtPriceNextX96 > sqrtPriceLimitX96 ) ? sqrtPriceLimitX96 : step.sqrtPriceNextX96, state.liquidity, state.amountSpecifiedRemaining, fee ); if (exactInput) { state.amountSpecifiedRemaining -= (step.amountIn + step.feeAmount).toInt256(); state.amountCalculated = state.amountCalculated.sub( step.amountOut.toInt256() ); } else { state.amountSpecifiedRemaining += step.amountOut.toInt256(); state.amountCalculated = state.amountCalculated.add( (step.amountIn + step.feeAmount).toInt256() ); } // if the protocol fee is on, calculate how much is owed, decrement feeAmount, and increment protocolFee if (cache.feeProtocol > 0) { uint256 delta = step.feeAmount / cache.feeProtocol; step.feeAmount -= delta; state.protocolFee += uint128(delta); } // update global fee tracker if (state.liquidity > 0) state.feeGrowthGlobalX128 += FullMath.mulDiv( step.feeAmount, FixedPoint128.Q128, state.liquidity ); // shift tick if we reached the next price if (state.sqrtPriceX96 == step.sqrtPriceNextX96) { // if the tick is initialized, run the tick transition if (step.initialized) { // check for the placeholder value, which we replace with the actual value the first time the swap // crosses an initialized tick if (!cache.computedLatestObservation) { ( cache.tickCumulative, cache.secondsPerLiquidityCumulativeX128 ) = observations.observeSingle( cache.blockTimestamp, 0, slot0Start.tick, slot0Start.observationIndex, cache.liquidityStart, slot0Start.observationCardinality ); cache.computedLatestObservation = true; } int128 liquidityNet = ticks.cross( step.tickNext, ( zeroForOne ? state.feeGrowthGlobalX128 : feeGrowthGlobal0X128 ), ( zeroForOne ? feeGrowthGlobal1X128 : state.feeGrowthGlobalX128 ), cache.secondsPerLiquidityCumulativeX128, cache.tickCumulative, cache.blockTimestamp ); // if we're moving leftward, we interpret liquidityNet as the opposite sign // safe because liquidityNet cannot be type(int128).min if (zeroForOne) liquidityNet = -liquidityNet; state.liquidity = LiquidityMath.addDelta( state.liquidity, liquidityNet ); } state.tick = zeroForOne ? step.tickNext - 1 : step.tickNext; } else if (state.sqrtPriceX96 != step.sqrtPriceStartX96) { // recompute unless we're on a lower tick boundary (i.e. already transitioned ticks), and haven't moved state.tick = TickMath.getTickAtSqrtRatio(state.sqrtPriceX96); } } // update tick and write an oracle entry if the tick change if (state.tick != slot0Start.tick) { ( uint16 observationIndex, uint16 observationCardinality ) = observations.write( slot0Start.observationIndex, cache.blockTimestamp, slot0Start.tick, cache.liquidityStart, slot0Start.observationCardinality, slot0Start.observationCardinalityNext ); ( slot0.sqrtPriceX96, slot0.tick, slot0.observationIndex, slot0.observationCardinality ) = ( state.sqrtPriceX96, state.tick, observationIndex, observationCardinality ); } else { // otherwise just update the price slot0.sqrtPriceX96 = state.sqrtPriceX96; } // update liquidity if it changed if (cache.liquidityStart != state.liquidity) liquidity = state.liquidity; // update fee growth global and, if necessary, protocol fees // overflow is acceptable, protocol has to withdraw before it hits type(uint128).max fees if (zeroForOne) { feeGrowthGlobal0X128 = state.feeGrowthGlobalX128; if (state.protocolFee > 0) protocolFees.token0 += state.protocolFee; } else { feeGrowthGlobal1X128 = state.feeGrowthGlobalX128; if (state.protocolFee > 0) protocolFees.token1 += state.protocolFee; } (amount0, amount1) = zeroForOne == exactInput ? ( amountSpecified - state.amountSpecifiedRemaining, state.amountCalculated ) : ( state.amountCalculated, amountSpecified - state.amountSpecifiedRemaining ); // do the transfers and collect payment if (zeroForOne) { if (amount1 < 0) TransferHelper.safeTransfer( token1, recipient, uint256(-amount1) ); uint256 balance0Before = balance0(); IUniswapV3SwapCallback(msg.sender).uniswapV3SwapCallback( amount0, amount1, data ); require(balance0Before.add(uint256(amount0)) <= balance0(), "IIA"); } else { if (amount0 < 0) TransferHelper.safeTransfer( token0, recipient, uint256(-amount0) ); uint256 balance1Before = balance1(); IUniswapV3SwapCallback(msg.sender).uniswapV3SwapCallback( amount0, amount1, data ); require(balance1Before.add(uint256(amount1)) <= balance1(), "IIA"); } emit Swap( msg.sender, recipient, amount0, amount1, state.sqrtPriceX96, state.liquidity, state.tick ); slot0.unlocked = true; // collectProtocolInternal(); } /// @inheritdoc IUniswapV3PoolActions function flash( address recipient, uint256 amount0, uint256 amount1, bytes calldata data ) external override lock noDelegateCall { uint128 _liquidity = liquidity; require(_liquidity > 0, "L"); uint256 fee0 = FullMath.mulDivRoundingUp(amount0, fee, 1e6); uint256 fee1 = FullMath.mulDivRoundingUp(amount1, fee, 1e6); uint256 balance0Before = balance0(); uint256 balance1Before = balance1(); if (amount0 > 0) TransferHelper.safeTransfer(token0, recipient, amount0); if (amount1 > 0) TransferHelper.safeTransfer(token1, recipient, amount1); IUniswapV3FlashCallback(msg.sender).uniswapV3FlashCallback( fee0, fee1, data ); uint256 balance0After = balance0(); uint256 balance1After = balance1(); require(balance0Before.add(fee0) <= balance0After, "F0"); require(balance1Before.add(fee1) <= balance1After, "F1"); // sub is safe because we know balanceAfter is gt balanceBefore by at least fee uint256 paid0 = balance0After - balance0Before; uint256 paid1 = balance1After - balance1Before; if (paid0 > 0) { uint8 feeProtocol = IUniswapV3Factory(factory).feeProtocol(); uint8 feeProtocol0 = feeProtocol % 16; uint256 fees0 = feeProtocol0 == 0 ? 0 : paid0 / feeProtocol0; if (uint128(fees0) > 0) protocolFees.token0 += uint128(fees0); feeGrowthGlobal0X128 += FullMath.mulDiv( paid0 - fees0, FixedPoint128.Q128, _liquidity ); } if (paid1 > 0) { uint8 feeProtocol = IUniswapV3Factory(factory).feeProtocol(); uint8 feeProtocol1 = feeProtocol >> 4; uint256 fees1 = feeProtocol1 == 0 ? 0 : paid1 / feeProtocol1; if (uint128(fees1) > 0) protocolFees.token1 += uint128(fees1); feeGrowthGlobal1X128 += FullMath.mulDiv( paid1 - fees1, FixedPoint128.Q128, _liquidity ); } emit Flash(msg.sender, recipient, amount0, amount1, paid0, paid1); // collectProtocolInternal(); } function collectProtocolInternal() internal returns (uint128 amount0, uint128 amount1) { address recipient = IUniswapV3Factory(factory).feeTo(); amount0 = protocolFees.token0; amount1 = protocolFees.token1; if (amount0 > 0) { if (amount0 == protocolFees.token0) amount0--; // ensure that the slot is not cleared, for gas savings protocolFees.token0 -= amount0; if (amount0 > 0) { TransferHelper.safeTransfer(token0, recipient, amount0); } } if (amount1 > 0) { if (amount1 == protocolFees.token1) amount1--; // ensure that the slot is not cleared, for gas savings protocolFees.token1 -= amount1; if (amount1 > 0) { TransferHelper.safeTransfer(token1, recipient, amount1); } } if (amount0 > 0 || amount1 > 0) { emit CollectProtocol(msg.sender, recipient, amount0, amount1); } } } ================================================ FILE: agent-as-a-service/agent-launchpad/contracts/core/UniswapV3PoolDeployer.sol ================================================ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.0; import "./interfaces/IUniswapV3PoolDeployer.sol"; import "./interfaces/IUniswapV3Pool.sol"; import "./UniswapV3PoolProxy.sol"; contract UniswapV3PoolDeployer is IUniswapV3PoolDeployer { struct Parameters { address factory; address token0; address token1; uint24 fee; int24 tickSpacing; } /// @inheritdoc IUniswapV3PoolDeployer Parameters public override parameters; /// @dev Deploys a pool with the given parameters by transiently setting the parameters storage slot and then /// clearing it after deploying the pool. /// @param factory The contract address of the Uniswap V3 factory /// @param token0 The first token of the pool by address sort order /// @param token1 The second token of the pool by address sort order /// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip /// @param tickSpacing The spacing between usable ticks function deploy( address factory, address token0, address token1, uint24 fee, int24 tickSpacing ) internal returns (address pool) { parameters = Parameters({ factory: factory, token0: token0, token1: token1, fee: fee, tickSpacing: tickSpacing }); pool = address( new UniswapV3PoolProxy{ salt: keccak256(abi.encode(token0, token1, fee)) }() ); IUniswapV3Pool(pool).init(); delete parameters; } } ================================================ FILE: agent-as-a-service/agent-launchpad/contracts/core/UniswapV3PoolProxy.sol ================================================ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import {Proxy} from "@openzeppelin/contracts/proxy/Proxy.sol"; import {IUniswapV3Factory} from "./interfaces/IUniswapV3Factory.sol"; /** * @title InitializedProxy */ contract UniswapV3PoolProxy is Proxy { // IUniswapV3Factory public immutable factory; // ======== Constructor ========= constructor() { factory = IUniswapV3Factory(msg.sender); } /** * @dev This is a virtual function that should be overridden so it returns the address to which the fallback function * and {_fallback} should delegate. */ function _implementation() internal view virtual override returns (address impl) { return factory.getUniswapV3PoolImplementation(); } } ================================================ FILE: agent-as-a-service/agent-launchpad/contracts/core/interfaces/IERC20Minimal.sol ================================================ // SPDX-License-Identifier: GPL-2.0-or-later pragma solidity ^0.8.0; /// @title Minimal ERC20 interface for Uniswap /// @notice Contains a subset of the full ERC20 interface that is used in Uniswap V3 interface IERC20Minimal { /// @notice Returns the balance of a token /// @param account The account for which to look up the number of tokens it has, i.e. its balance /// @return The number of tokens held by the account function balanceOf(address account) external view returns (uint256); /// @notice Transfers the amount of token from the `msg.sender` to the recipient /// @param recipient The account that will receive the amount transferred /// @param amount The number of tokens to send from the sender to the recipient /// @return Returns true for a successful transfer, false for an unsuccessful transfer function transfer(address recipient, uint256 amount) external returns (bool); /// @notice Returns the current allowance given to a spender by an owner /// @param owner The account of the token owner /// @param spender The account of the token spender /// @return The current allowance granted by `owner` to `spender` function allowance(address owner, address spender) external view returns (uint256); /// @notice Sets the allowance of a spender from the `msg.sender` to the value `amount` /// @param spender The account which will be allowed to spend a given amount of the owners tokens /// @param amount The amount of tokens allowed to be used by `spender` /// @return Returns true for a successful approval, false for unsuccessful function approve(address spender, uint256 amount) external returns (bool); /// @notice Transfers `amount` tokens from `sender` to `recipient` up to the allowance given to the `msg.sender` /// @param sender The account from which the transfer will be initiated /// @param recipient The recipient of the transfer /// @param amount The amount of the transfer /// @return Returns true for a successful transfer, false for unsuccessful function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); /// @notice Event emitted when tokens are transferred from one address to another, either via `#transfer` or `#transferFrom`. /// @param from The account from which the tokens were sent, i.e. the balance decreased /// @param to The account to which the tokens were sent, i.e. the balance increased /// @param value The amount of tokens that were transferred event Transfer(address indexed from, address indexed to, uint256 value); /// @notice Event emitted when the approval amount for the spender of a given owner's tokens changes. /// @param owner The account that approved spending of its tokens /// @param spender The account for which the spending allowance was modified /// @param value The new allowance from the owner to the spender event Approval(address indexed owner, address indexed spender, uint256 value); } ================================================ FILE: agent-as-a-service/agent-launchpad/contracts/core/interfaces/IUniswapV3Factory.sol ================================================ // SPDX-License-Identifier: GPL-2.0-or-later pragma solidity ^0.8.0; /// @title The interface for the Uniswap V3 Factory /// @notice The Uniswap V3 Factory facilitates creation of Uniswap V3 pools and control over the protocol fees interface IUniswapV3Factory { /// @notice Emitted when the owner of the factory is changed /// @param oldOwner The owner before the owner was changed /// @param newOwner The owner after the owner was changed event OwnerChanged(address indexed oldOwner, address indexed newOwner); /// @notice Emitted when a pool is created /// @param token0 The first token of the pool by address sort order /// @param token1 The second token of the pool by address sort order /// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip /// @param tickSpacing The minimum number of ticks between initialized ticks /// @param pool The address of the created pool event PoolCreated( address indexed token0, address indexed token1, uint24 indexed fee, int24 tickSpacing, address pool ); /// @notice Emitted when a new fee amount is enabled for pool creation via the factory /// @param fee The enabled fee, denominated in hundredths of a bip /// @param tickSpacing The minimum number of ticks between initialized ticks for pools created with the given fee event FeeAmountEnabled(uint24 indexed fee, int24 indexed tickSpacing); event SetFeeProtocol( uint8 feeProtocol0Old, uint8 feeProtocol1Old, uint8 feeProtocol0New, uint8 feeProtocol1New ); event SetFeeTo(address feeToOld, address feeTo); // function getUniswapV3PoolImplementation() external view returns (address); /// @notice Returns the tick spacing for a given fee amount, if enabled, or 0 if not enabled /// @dev A fee amount can never be removed, so this value should be hard coded or cached in the calling context /// @param fee The enabled fee, denominated in hundredths of a bip. Returns 0 in case of unenabled fee /// @return The tick spacing function feeAmountTickSpacing(uint24 fee) external view returns (int24); /// @notice Returns the pool address for a given pair of tokens and a fee, or address 0 if it does not exist /// @dev tokenA and tokenB may be passed in either token0/token1 or token1/token0 order /// @param tokenA The contract address of either token0 or token1 /// @param tokenB The contract address of the other token /// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip /// @return pool The pool address function getPool( address tokenA, address tokenB, uint24 fee ) external view returns (address pool); /// @notice Creates a pool for the given two tokens and fee /// @param tokenA One of the two tokens in the desired pool /// @param tokenB The other of the two tokens in the desired pool /// @param fee The desired fee for the pool /// @dev tokenA and tokenB may be passed in either order: token0/token1 or token1/token0. tickSpacing is retrieved /// from the fee. The call will revert if the pool already exists, the fee is invalid, or the token arguments /// are invalid. /// @return pool The address of the newly created pool function createPool( address tokenA, address tokenB, uint24 fee ) external returns (address pool); /// @notice Enables a fee amount with the given tickSpacing /// @dev Fee amounts may never be removed once enabled /// @param fee The fee amount to enable, denominated in hundredths of a bip (i.e. 1e-6) /// @param tickSpacing The spacing between ticks to be enforced for all pools created with the given fee amount function enableFeeAmount(uint24 fee, int24 tickSpacing) external; function feeProtocol() external view returns (uint8); function setFeeProtocol(uint8 feeProtocol0, uint8 feeProtocol1) external; function feeTo() external view returns (address); function setFeeTo(address feeToArg) external; } ================================================ FILE: agent-as-a-service/agent-launchpad/contracts/core/interfaces/IUniswapV3Pool.sol ================================================ // SPDX-License-Identifier: GPL-2.0-or-later pragma solidity ^0.8.0; import "./pool/IUniswapV3PoolImmutables.sol"; import "./pool/IUniswapV3PoolState.sol"; import "./pool/IUniswapV3PoolDerivedState.sol"; import "./pool/IUniswapV3PoolActions.sol"; import "./pool/IUniswapV3PoolOwnerActions.sol"; import "./pool/IUniswapV3PoolEvents.sol"; /// @title The interface for a Uniswap V3 Pool /// @notice A Uniswap pool facilitates swapping and automated market making between any two assets that strictly conform /// to the ERC20 specification /// @dev The pool interface is broken up into many smaller pieces interface IUniswapV3Pool is IUniswapV3PoolImmutables, IUniswapV3PoolState, IUniswapV3PoolDerivedState, IUniswapV3PoolActions, IUniswapV3PoolOwnerActions, IUniswapV3PoolEvents { function init() external; } ================================================ FILE: agent-as-a-service/agent-launchpad/contracts/core/interfaces/IUniswapV3PoolDeployer.sol ================================================ // SPDX-License-Identifier: GPL-2.0-or-later pragma solidity ^0.8.0; /// @title An interface for a contract that is capable of deploying Uniswap V3 Pools /// @notice A contract that constructs a pool must implement this to pass arguments to the pool /// @dev This is used to avoid having constructor arguments in the pool contract, which results in the init code hash /// of the pool being constant allowing the CREATE2 address of the pool to be cheaply computed on-chain interface IUniswapV3PoolDeployer { /// @notice Get the parameters to be used in constructing the pool, set transiently during pool creation. /// @dev Called by the pool constructor to fetch the parameters of the pool /// Returns factory The factory address /// Returns token0 The first token of the pool by address sort order /// Returns token1 The second token of the pool by address sort order /// Returns fee The fee collected upon every swap in the pool, denominated in hundredths of a bip /// Returns tickSpacing The minimum number of ticks between initialized ticks function parameters() external view returns ( address factory, address token0, address token1, uint24 fee, int24 tickSpacing ); } ================================================ FILE: agent-as-a-service/agent-launchpad/contracts/core/interfaces/callback/IUniswapV3FlashCallback.sol ================================================ // SPDX-License-Identifier: GPL-2.0-or-later pragma solidity ^0.8.0; /// @title Callback for IUniswapV3PoolActions#flash /// @notice Any contract that calls IUniswapV3PoolActions#flash must implement this interface interface IUniswapV3FlashCallback { /// @notice Called to `msg.sender` after transferring to the recipient from IUniswapV3Pool#flash. /// @dev In the implementation you must repay the pool the tokens sent by flash plus the computed fee amounts. /// The caller of this method must be checked to be a UniswapV3Pool deployed by the canonical UniswapV3Factory. /// @param fee0 The fee amount in token0 due to the pool by the end of the flash /// @param fee1 The fee amount in token1 due to the pool by the end of the flash /// @param data Any data passed through by the caller via the IUniswapV3PoolActions#flash call function uniswapV3FlashCallback( uint256 fee0, uint256 fee1, bytes calldata data ) external; } ================================================ FILE: agent-as-a-service/agent-launchpad/contracts/core/interfaces/callback/IUniswapV3MintCallback.sol ================================================ // SPDX-License-Identifier: GPL-2.0-or-later pragma solidity ^0.8.0; /// @title Callback for IUniswapV3PoolActions#mint /// @notice Any contract that calls IUniswapV3PoolActions#mint must implement this interface interface IUniswapV3MintCallback { /// @notice Called to `msg.sender` after minting liquidity to a position from IUniswapV3Pool#mint. /// @dev In the implementation you must pay the pool tokens owed for the minted liquidity. /// The caller of this method must be checked to be a UniswapV3Pool deployed by the canonical UniswapV3Factory. /// @param amount0Owed The amount of token0 due to the pool for the minted liquidity /// @param amount1Owed The amount of token1 due to the pool for the minted liquidity /// @param data Any data passed through by the caller via the IUniswapV3PoolActions#mint call function uniswapV3MintCallback( uint256 amount0Owed, uint256 amount1Owed, bytes calldata data ) external; } ================================================ FILE: agent-as-a-service/agent-launchpad/contracts/core/interfaces/callback/IUniswapV3SwapCallback.sol ================================================ // SPDX-License-Identifier: GPL-2.0-or-later pragma solidity ^0.8.0; /// @title Callback for IUniswapV3PoolActions#swap /// @notice Any contract that calls IUniswapV3PoolActions#swap must implement this interface interface IUniswapV3SwapCallback { /// @notice Called to `msg.sender` after executing a swap via IUniswapV3Pool#swap. /// @dev In the implementation you must pay the pool tokens owed for the swap. /// The caller of this method must be checked to be a UniswapV3Pool deployed by the canonical UniswapV3Factory. /// amount0Delta and amount1Delta can both be 0 if no tokens were swapped. /// @param amount0Delta The amount of token0 that was sent (negative) or must be received (positive) by the pool by /// the end of the swap. If positive, the callback must send that amount of token0 to the pool. /// @param amount1Delta The amount of token1 that was sent (negative) or must be received (positive) by the pool by /// the end of the swap. If positive, the callback must send that amount of token1 to the pool. /// @param data Any data passed through by the caller via the IUniswapV3PoolActions#swap call function uniswapV3SwapCallback( int256 amount0Delta, int256 amount1Delta, bytes calldata data ) external; } ================================================ FILE: agent-as-a-service/agent-launchpad/contracts/core/interfaces/pool/IUniswapV3PoolActions.sol ================================================ // SPDX-License-Identifier: GPL-2.0-or-later pragma solidity ^0.8.0; /// @title Permissionless pool actions /// @notice Contains pool methods that can be called by anyone interface IUniswapV3PoolActions { /// @notice Sets the initial price for the pool /// @dev Price is represented as a sqrt(amountToken1/amountToken0) Q64.96 value /// @param sqrtPriceX96 the initial sqrt price of the pool as a Q64.96 function initialize(uint160 sqrtPriceX96) external; /// @notice Adds liquidity for the given recipient/tickLower/tickUpper position /// @dev The caller of this method receives a callback in the form of IUniswapV3MintCallback#uniswapV3MintCallback /// in which they must pay any token0 or token1 owed for the liquidity. The amount of token0/token1 due depends /// on tickLower, tickUpper, the amount of liquidity, and the current price. /// @param recipient The address for which the liquidity will be created /// @param tickLower The lower tick of the position in which to add liquidity /// @param tickUpper The upper tick of the position in which to add liquidity /// @param amount The amount of liquidity to mint /// @param data Any data that should be passed through to the callback /// @return amount0 The amount of token0 that was paid to mint the given amount of liquidity. Matches the value in the callback /// @return amount1 The amount of token1 that was paid to mint the given amount of liquidity. Matches the value in the callback function mint( address recipient, int24 tickLower, int24 tickUpper, uint128 amount, bytes calldata data ) external returns (uint256 amount0, uint256 amount1); /// @notice Collects tokens owed to a position /// @dev Does not recompute fees earned, which must be done either via mint or burn of any amount of liquidity. /// Collect must be called by the position owner. To withdraw only token0 or only token1, amount0Requested or /// amount1Requested may be set to zero. To withdraw all tokens owed, caller may pass any value greater than the /// actual tokens owed, e.g. type(uint128).max. Tokens owed may be from accumulated swap fees or burned liquidity. /// @param recipient The address which should receive the fees collected /// @param tickLower The lower tick of the position for which to collect fees /// @param tickUpper The upper tick of the position for which to collect fees /// @param amount0Requested How much token0 should be withdrawn from the fees owed /// @param amount1Requested How much token1 should be withdrawn from the fees owed /// @return amount0 The amount of fees collected in token0 /// @return amount1 The amount of fees collected in token1 function collect( address recipient, int24 tickLower, int24 tickUpper, uint128 amount0Requested, uint128 amount1Requested ) external returns (uint128 amount0, uint128 amount1); /// @notice Burn liquidity from the sender and account tokens owed for the liquidity to the position /// @dev Can be used to trigger a recalculation of fees owed to a position by calling with an amount of 0 /// @dev Fees must be collected separately via a call to #collect /// @param tickLower The lower tick of the position for which to burn liquidity /// @param tickUpper The upper tick of the position for which to burn liquidity /// @param amount How much liquidity to burn /// @return amount0 The amount of token0 sent to the recipient /// @return amount1 The amount of token1 sent to the recipient function burn( int24 tickLower, int24 tickUpper, uint128 amount ) external returns (uint256 amount0, uint256 amount1); /// @notice Swap token0 for token1, or token1 for token0 /// @dev The caller of this method receives a callback in the form of IUniswapV3SwapCallback#uniswapV3SwapCallback /// @param recipient The address to receive the output of the swap /// @param zeroForOne The direction of the swap, true for token0 to token1, false for token1 to token0 /// @param amountSpecified The amount of the swap, which implicitly configures the swap as exact input (positive), or exact output (negative) /// @param sqrtPriceLimitX96 The Q64.96 sqrt price limit. If zero for one, the price cannot be less than this /// value after the swap. If one for zero, the price cannot be greater than this value after the swap /// @param data Any data to be passed through to the callback /// @return amount0 The delta of the balance of token0 of the pool, exact when negative, minimum when positive /// @return amount1 The delta of the balance of token1 of the pool, exact when negative, minimum when positive function swap( address recipient, bool zeroForOne, int256 amountSpecified, uint160 sqrtPriceLimitX96, bytes calldata data ) external returns (int256 amount0, int256 amount1); /// @notice Receive token0 and/or token1 and pay it back, plus a fee, in the callback /// @dev The caller of this method receives a callback in the form of IUniswapV3FlashCallback#uniswapV3FlashCallback /// @dev Can be used to donate underlying tokens pro-rata to currently in-range liquidity providers by calling /// with 0 amount{0,1} and sending the donation amount(s) from the callback /// @param recipient The address which will receive the token0 and token1 amounts /// @param amount0 The amount of token0 to send /// @param amount1 The amount of token1 to send /// @param data Any data to be passed through to the callback function flash( address recipient, uint256 amount0, uint256 amount1, bytes calldata data ) external; /// @notice Increase the maximum number of price and liquidity observations that this pool will store /// @dev This method is no-op if the pool already has an observationCardinalityNext greater than or equal to /// the input observationCardinalityNext. /// @param observationCardinalityNext The desired minimum number of observations for the pool to store function increaseObservationCardinalityNext(uint16 observationCardinalityNext) external; } ================================================ FILE: agent-as-a-service/agent-launchpad/contracts/core/interfaces/pool/IUniswapV3PoolDerivedState.sol ================================================ // SPDX-License-Identifier: GPL-2.0-or-later pragma solidity ^0.8.0; /// @title Pool state that is not stored /// @notice Contains view functions to provide information about the pool that is computed rather than stored on the /// blockchain. The functions here may have variable gas costs. interface IUniswapV3PoolDerivedState { /// @notice Returns the cumulative tick and liquidity as of each timestamp `secondsAgo` from the current block timestamp /// @dev To get a time weighted average tick or liquidity-in-range, you must call this with two values, one representing /// the beginning of the period and another for the end of the period. E.g., to get the last hour time-weighted average tick, /// you must call it with secondsAgos = [3600, 0]. /// @dev The time weighted average tick represents the geometric time weighted average price of the pool, in /// log base sqrt(1.0001) of token1 / token0. The TickMath library can be used to go from a tick value to a ratio. /// @param secondsAgos From how long ago each cumulative tick and liquidity value should be returned /// @return tickCumulatives Cumulative tick values as of each `secondsAgos` from the current block timestamp /// @return secondsPerLiquidityCumulativeX128s Cumulative seconds per liquidity-in-range value as of each `secondsAgos` from the current block /// timestamp function observe(uint32[] calldata secondsAgos) external view returns (int56[] memory tickCumulatives, uint160[] memory secondsPerLiquidityCumulativeX128s); /// @notice Returns a snapshot of the tick cumulative, seconds per liquidity and seconds inside a tick range /// @dev Snapshots must only be compared to other snapshots, taken over a period for which a position existed. /// I.e., snapshots cannot be compared if a position is not held for the entire period between when the first /// snapshot is taken and the second snapshot is taken. /// @param tickLower The lower tick of the range /// @param tickUpper The upper tick of the range /// @return tickCumulativeInside The snapshot of the tick accumulator for the range /// @return secondsPerLiquidityInsideX128 The snapshot of seconds per liquidity for the range /// @return secondsInside The snapshot of seconds per liquidity for the range function snapshotCumulativesInside(int24 tickLower, int24 tickUpper) external view returns ( int56 tickCumulativeInside, uint160 secondsPerLiquidityInsideX128, uint32 secondsInside ); } ================================================ FILE: agent-as-a-service/agent-launchpad/contracts/core/interfaces/pool/IUniswapV3PoolEvents.sol ================================================ // SPDX-License-Identifier: GPL-2.0-or-later pragma solidity ^0.8.0; /// @title Events emitted by a pool /// @notice Contains all events emitted by the pool interface IUniswapV3PoolEvents { /// @notice Emitted exactly once by a pool when #initialize is first called on the pool /// @dev Mint/Burn/Swap cannot be emitted by the pool before Initialize /// @param sqrtPriceX96 The initial sqrt price of the pool, as a Q64.96 /// @param tick The initial tick of the pool, i.e. log base 1.0001 of the starting price of the pool event Initialize(uint160 sqrtPriceX96, int24 tick); /// @notice Emitted when liquidity is minted for a given position /// @param sender The address that minted the liquidity /// @param owner The owner of the position and recipient of any minted liquidity /// @param tickLower The lower tick of the position /// @param tickUpper The upper tick of the position /// @param amount The amount of liquidity minted to the position range /// @param amount0 How much token0 was required for the minted liquidity /// @param amount1 How much token1 was required for the minted liquidity event Mint( address sender, address indexed owner, int24 indexed tickLower, int24 indexed tickUpper, uint128 amount, uint256 amount0, uint256 amount1 ); /// @notice Emitted when fees are collected by the owner of a position /// @dev Collect events may be emitted with zero amount0 and amount1 when the caller chooses not to collect fees /// @param owner The owner of the position for which fees are collected /// @param tickLower The lower tick of the position /// @param tickUpper The upper tick of the position /// @param amount0 The amount of token0 fees collected /// @param amount1 The amount of token1 fees collected event Collect( address indexed owner, address recipient, int24 indexed tickLower, int24 indexed tickUpper, uint128 amount0, uint128 amount1 ); /// @notice Emitted when a position's liquidity is removed /// @dev Does not withdraw any fees earned by the liquidity position, which must be withdrawn via #collect /// @param owner The owner of the position for which liquidity is removed /// @param tickLower The lower tick of the position /// @param tickUpper The upper tick of the position /// @param amount The amount of liquidity to remove /// @param amount0 The amount of token0 withdrawn /// @param amount1 The amount of token1 withdrawn event Burn( address indexed owner, int24 indexed tickLower, int24 indexed tickUpper, uint128 amount, uint256 amount0, uint256 amount1 ); /// @notice Emitted by the pool for any swaps between token0 and token1 /// @param sender The address that initiated the swap call, and that received the callback /// @param recipient The address that received the output of the swap /// @param amount0 The delta of the token0 balance of the pool /// @param amount1 The delta of the token1 balance of the pool /// @param sqrtPriceX96 The sqrt(price) of the pool after the swap, as a Q64.96 /// @param liquidity The liquidity of the pool after the swap /// @param tick The log base 1.0001 of price of the pool after the swap event Swap( address indexed sender, address indexed recipient, int256 amount0, int256 amount1, uint160 sqrtPriceX96, uint128 liquidity, int24 tick ); /// @notice Emitted by the pool for any flashes of token0/token1 /// @param sender The address that initiated the swap call, and that received the callback /// @param recipient The address that received the tokens from flash /// @param amount0 The amount of token0 that was flashed /// @param amount1 The amount of token1 that was flashed /// @param paid0 The amount of token0 paid for the flash, which can exceed the amount0 plus the fee /// @param paid1 The amount of token1 paid for the flash, which can exceed the amount1 plus the fee event Flash( address indexed sender, address indexed recipient, uint256 amount0, uint256 amount1, uint256 paid0, uint256 paid1 ); /// @notice Emitted by the pool for increases to the number of observations that can be stored /// @dev observationCardinalityNext is not the observation cardinality until an observation is written at the index /// just before a mint/swap/burn. /// @param observationCardinalityNextOld The previous value of the next observation cardinality /// @param observationCardinalityNextNew The updated value of the next observation cardinality event IncreaseObservationCardinalityNext( uint16 observationCardinalityNextOld, uint16 observationCardinalityNextNew ); /// @notice Emitted when the protocol fee is changed by the pool /// @param feeProtocol0Old The previous value of the token0 protocol fee /// @param feeProtocol1Old The previous value of the token1 protocol fee /// @param feeProtocol0New The updated value of the token0 protocol fee /// @param feeProtocol1New The updated value of the token1 protocol fee event SetFeeProtocol(uint8 feeProtocol0Old, uint8 feeProtocol1Old, uint8 feeProtocol0New, uint8 feeProtocol1New); /// @notice Emitted when the collected protocol fees are withdrawn by the factory owner /// @param sender The address that collects the protocol fees /// @param recipient The address that receives the collected protocol fees /// @param amount0 The amount of token0 protocol fees that is withdrawn /// @param amount0 The amount of token1 protocol fees that is withdrawn event CollectProtocol(address indexed sender, address indexed recipient, uint128 amount0, uint128 amount1); } ================================================ FILE: agent-as-a-service/agent-launchpad/contracts/core/interfaces/pool/IUniswapV3PoolImmutables.sol ================================================ // SPDX-License-Identifier: GPL-2.0-or-later pragma solidity ^0.8.0; /// @title Pool state that never changes /// @notice These parameters are fixed for a pool forever, i.e., the methods will always return the same values interface IUniswapV3PoolImmutables { /// @notice The contract that deployed the pool, which must adhere to the IUniswapV3Factory interface /// @return The contract address function factory() external view returns (address); /// @notice The first of the two tokens of the pool, sorted by address /// @return The token contract address function token0() external view returns (address); /// @notice The second of the two tokens of the pool, sorted by address /// @return The token contract address function token1() external view returns (address); /// @notice The pool's fee in hundredths of a bip, i.e. 1e-6 /// @return The fee function fee() external view returns (uint24); /// @notice The pool tick spacing /// @dev Ticks can only be used at multiples of this value, minimum of 1 and always positive /// e.g.: a tickSpacing of 3 means ticks can be initialized every 3rd tick, i.e., ..., -6, -3, 0, 3, 6, ... /// This value is an int24 to avoid casting even though it is always positive. /// @return The tick spacing function tickSpacing() external view returns (int24); /// @notice The maximum amount of position liquidity that can use any tick in the range /// @dev This parameter is enforced per tick to prevent liquidity from overflowing a uint128 at any point, and /// also prevents out-of-range liquidity from being used to prevent adding in-range liquidity to a pool /// @return The max amount of liquidity per tick function maxLiquidityPerTick() external view returns (uint128); } ================================================ FILE: agent-as-a-service/agent-launchpad/contracts/core/interfaces/pool/IUniswapV3PoolOwnerActions.sol ================================================ // SPDX-License-Identifier: GPL-2.0-or-later pragma solidity ^0.8.0; /// @title Permissioned pool actions /// @notice Contains pool methods that may only be called by the factory owner interface IUniswapV3PoolOwnerActions { /// @notice Set the denominator of the protocol's % share of the fees /// @param feeProtocol0 new protocol fee for token0 of the pool /// @param feeProtocol1 new protocol fee for token1 of the pool // function setFeeProtocol(uint8 feeProtocol0, uint8 feeProtocol1) external; /// @notice Collect the protocol fee accrued to the pool /// @param recipient The address to which collected protocol fees should be sent /// @param amount0Requested The maximum amount of token0 to send, can be 0 to collect fees in only token1 /// @param amount1Requested The maximum amount of token1 to send, can be 0 to collect fees in only token0 /// @return amount0 The protocol fee collected in token0 /// @return amount1 The protocol fee collected in token1 // function collectProtocol( // address recipient, // uint128 amount0Requested, // uint128 amount1Requested // ) external returns (uint128 amount0, uint128 amount1); } ================================================ FILE: agent-as-a-service/agent-launchpad/contracts/core/interfaces/pool/IUniswapV3PoolState.sol ================================================ // SPDX-License-Identifier: GPL-2.0-or-later pragma solidity ^0.8.0; /// @title Pool state that can change /// @notice These methods compose the pool's state, and can change with any frequency including multiple times /// per transaction interface IUniswapV3PoolState { /// @notice The 0th storage slot in the pool stores many values, and is exposed as a single method to save gas /// when accessed externally. /// @return sqrtPriceX96 The current price of the pool as a sqrt(token1/token0) Q64.96 value /// tick The current tick of the pool, i.e. according to the last tick transition that was run. /// This value may not always be equal to SqrtTickMath.getTickAtSqrtRatio(sqrtPriceX96) if the price is on a tick /// boundary. /// observationIndex The index of the last oracle observation that was written, /// observationCardinality The current maximum number of observations stored in the pool, /// observationCardinalityNext The next maximum number of observations, to be updated when the observation. /// feeProtocol The protocol fee for both tokens of the pool. /// Encoded as two 4 bit values, where the protocol fee of token1 is shifted 4 bits and the protocol fee of token0 /// is the lower 4 bits. Used as the denominator of a fraction of the swap fee, e.g. 4 means 1/4th of the swap fee. /// unlocked Whether the pool is currently locked to reentrancy function slot0() external view returns ( uint160 sqrtPriceX96, int24 tick, uint16 observationIndex, uint16 observationCardinality, uint16 observationCardinalityNext, uint8 feeProtocol, bool unlocked ); /// @notice The fee growth as a Q128.128 fees of token0 collected per unit of liquidity for the entire life of the pool /// @dev This value can overflow the uint256 function feeGrowthGlobal0X128() external view returns (uint256); /// @notice The fee growth as a Q128.128 fees of token1 collected per unit of liquidity for the entire life of the pool /// @dev This value can overflow the uint256 function feeGrowthGlobal1X128() external view returns (uint256); /// @notice The amounts of token0 and token1 that are owed to the protocol /// @dev Protocol fees will never exceed uint128 max in either token function protocolFees() external view returns (uint128 token0, uint128 token1); /// @notice The currently in range liquidity available to the pool /// @dev This value has no relationship to the total liquidity across all ticks function liquidity() external view returns (uint128); /// @notice Look up information about a specific tick in the pool /// @param tick The tick to look up /// @return liquidityGross the total amount of position liquidity that uses the pool either as tick lower or /// tick upper, /// liquidityNet how much liquidity changes when the pool price crosses the tick, /// feeGrowthOutside0X128 the fee growth on the other side of the tick from the current tick in token0, /// feeGrowthOutside1X128 the fee growth on the other side of the tick from the current tick in token1, /// tickCumulativeOutside the cumulative tick value on the other side of the tick from the current tick /// secondsPerLiquidityOutsideX128 the seconds spent per liquidity on the other side of the tick from the current tick, /// secondsOutside the seconds spent on the other side of the tick from the current tick, /// initialized Set to true if the tick is initialized, i.e. liquidityGross is greater than 0, otherwise equal to false. /// Outside values can only be used if the tick is initialized, i.e. if liquidityGross is greater than 0. /// In addition, these values are only relative and must be used only in comparison to previous snapshots for /// a specific position. function ticks(int24 tick) external view returns ( uint128 liquidityGross, int128 liquidityNet, uint256 feeGrowthOutside0X128, uint256 feeGrowthOutside1X128, int56 tickCumulativeOutside, uint160 secondsPerLiquidityOutsideX128, uint32 secondsOutside, bool initialized ); /// @notice Returns 256 packed tick initialized boolean values. See TickBitmap for more information function tickBitmap(int16 wordPosition) external view returns (uint256); /// @notice Returns the information about a position by the position's key /// @param key The position's key is a hash of a preimage composed by the owner, tickLower and tickUpper /// @return _liquidity The amount of liquidity in the position, /// Returns feeGrowthInside0LastX128 fee growth of token0 inside the tick range as of the last mint/burn/poke, /// Returns feeGrowthInside1LastX128 fee growth of token1 inside the tick range as of the last mint/burn/poke, /// Returns tokensOwed0 the computed amount of token0 owed to the position as of the last mint/burn/poke, /// Returns tokensOwed1 the computed amount of token1 owed to the position as of the last mint/burn/poke function positions(bytes32 key) external view returns ( uint128 _liquidity, uint256 feeGrowthInside0LastX128, uint256 feeGrowthInside1LastX128, uint128 tokensOwed0, uint128 tokensOwed1 ); /// @notice Returns data about a specific observation index /// @param index The element of the observations array to fetch /// @dev You most likely want to use #observe() instead of this method to get an observation as of some amount of time /// ago, rather than at a specific index in the array. /// @return blockTimestamp The timestamp of the observation, /// Returns tickCumulative the tick multiplied by seconds elapsed for the life of the pool as of the observation timestamp, /// Returns secondsPerLiquidityCumulativeX128 the seconds per in range liquidity for the life of the pool as of the observation timestamp, /// Returns initialized whether the observation has been initialized and the values are safe to use function observations(uint256 index) external view returns ( uint32 blockTimestamp, int56 tickCumulative, uint160 secondsPerLiquidityCumulativeX128, bool initialized ); } ================================================ FILE: agent-as-a-service/agent-launchpad/contracts/core/libraries/BitMath.sol ================================================ // SPDX-License-Identifier: GPL-2.0-or-later pragma solidity ^0.8.0; /// @title BitMath /// @dev This library provides functionality for computing bit properties of an unsigned integer library BitMath { /// @notice Returns the index of the most significant bit of the number, /// where the least significant bit is at index 0 and the most significant bit is at index 255 /// @dev The function satisfies the property: /// x >= 2**mostSignificantBit(x) and x < 2**(mostSignificantBit(x)+1) /// @param x the value for which to compute the most significant bit, must be greater than 0 /// @return r the index of the most significant bit function mostSignificantBit(uint256 x) internal pure returns (uint8 r) { require(x > 0); unchecked { if (x >= 0x100000000000000000000000000000000) { x >>= 128; r += 128; } if (x >= 0x10000000000000000) { x >>= 64; r += 64; } if (x >= 0x100000000) { x >>= 32; r += 32; } if (x >= 0x10000) { x >>= 16; r += 16; } if (x >= 0x100) { x >>= 8; r += 8; } if (x >= 0x10) { x >>= 4; r += 4; } if (x >= 0x4) { x >>= 2; r += 2; } if (x >= 0x2) r += 1; } } /// @notice Returns the index of the least significant bit of the number, /// where the least significant bit is at index 0 and the most significant bit is at index 255 /// @dev The function satisfies the property: /// (x & 2**leastSignificantBit(x)) != 0 and (x & (2**(leastSignificantBit(x)) - 1)) == 0) /// @param x the value for which to compute the least significant bit, must be greater than 0 /// @return r the index of the least significant bit function leastSignificantBit(uint256 x) internal pure returns (uint8 r) { require(x > 0); unchecked { r = 255; if (x & type(uint128).max > 0) { r -= 128; } else { x >>= 128; } if (x & type(uint64).max > 0) { r -= 64; } else { x >>= 64; } if (x & type(uint32).max > 0) { r -= 32; } else { x >>= 32; } if (x & type(uint16).max > 0) { r -= 16; } else { x >>= 16; } if (x & type(uint8).max > 0) { r -= 8; } else { x >>= 8; } if (x & 0xf > 0) { r -= 4; } else { x >>= 4; } if (x & 0x3 > 0) { r -= 2; } else { x >>= 2; } if (x & 0x1 > 0) r -= 1; } } } ================================================ FILE: agent-as-a-service/agent-launchpad/contracts/core/libraries/FixedPoint128.sol ================================================ // SPDX-License-Identifier: GPL-2.0-or-later pragma solidity ^0.8.0; /// @title FixedPoint128 /// @notice A library for handling binary fixed point numbers, see https://en.wikipedia.org/wiki/Q_(number_format) library FixedPoint128 { uint256 internal constant Q128 = 0x100000000000000000000000000000000; } ================================================ FILE: agent-as-a-service/agent-launchpad/contracts/core/libraries/FixedPoint96.sol ================================================ // SPDX-License-Identifier: GPL-2.0-or-later pragma solidity ^0.8.0; /// @title FixedPoint96 /// @notice A library for handling binary fixed point numbers, see https://en.wikipedia.org/wiki/Q_(number_format) /// @dev Used in SqrtPriceMath.sol library FixedPoint96 { uint8 internal constant RESOLUTION = 96; uint256 internal constant Q96 = 0x1000000000000000000000000; } ================================================ FILE: agent-as-a-service/agent-launchpad/contracts/core/libraries/FullMath.sol ================================================ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /// @title Contains 512-bit math functions /// @notice Facilitates multiplication and division that can have overflow of an intermediate value without any loss of precision /// @dev Handles "phantom overflow" i.e., allows multiplication and division where an intermediate value overflows 256 bits library FullMath { /// @notice Calculates floor(a×b÷denominator) with full precision. Throws if result overflows a uint256 or denominator == 0 /// @param a The multiplicand /// @param b The multiplier /// @param denominator The divisor /// @return result The 256-bit result /// @dev Credit to Remco Bloemen under MIT license https://xn--2-umb.com/21/muldiv function mulDiv( uint256 a, uint256 b, uint256 denominator ) internal pure returns (uint256 result) { unchecked { // 512-bit multiply [prod1 prod0] = a * b // Compute the product mod 2**256 and mod 2**256 - 1 // then use the Chinese Remainder Theorem to reconstruct // the 512 bit result. The result is stored in two 256 // variables such that product = prod1 * 2**256 + prod0 uint256 prod0; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(a, b, not(0)) prod0 := mul(a, b) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Handle non-overflow cases, 256 by 256 division if (prod1 == 0) { require(denominator > 0); assembly { result := div(prod0, denominator) } return result; } // Make sure the result is less than 2**256. // Also prevents denominator == 0 require(denominator > prod1); /////////////////////////////////////////////// // 512 by 256 division. /////////////////////////////////////////////// // Make division exact by subtracting the remainder from [prod1 prod0] // Compute remainder using mulmod uint256 remainder; assembly { remainder := mulmod(a, b, denominator) } // Subtract 256 bit number from 512 bit number assembly { prod1 := sub(prod1, gt(remainder, prod0)) prod0 := sub(prod0, remainder) } // Factor powers of two out of denominator // Compute largest power of two divisor of denominator. // Always >= 1. uint256 twos = (0 - denominator) & denominator; // Divide denominator by power of two assembly { denominator := div(denominator, twos) } // Divide [prod1 prod0] by the factors of two assembly { prod0 := div(prod0, twos) } // Shift in bits from prod1 into prod0. For this we need // to flip `twos` such that it is 2**256 / twos. // If twos is zero, then it becomes one assembly { twos := add(div(sub(0, twos), twos), 1) } prod0 |= prod1 * twos; // Invert denominator mod 2**256 // Now that denominator is an odd number, it has an inverse // modulo 2**256 such that denominator * inv = 1 mod 2**256. // Compute the inverse by starting with a seed that is correct // correct for four bits. That is, denominator * inv = 1 mod 2**4 uint256 inv = (3 * denominator) ^ 2; // Now use Newton-Raphson iteration to improve the precision. // Thanks to Hensel's lifting lemma, this also works in modular // arithmetic, doubling the correct bits in each step. inv *= 2 - denominator * inv; // inverse mod 2**8 inv *= 2 - denominator * inv; // inverse mod 2**16 inv *= 2 - denominator * inv; // inverse mod 2**32 inv *= 2 - denominator * inv; // inverse mod 2**64 inv *= 2 - denominator * inv; // inverse mod 2**128 inv *= 2 - denominator * inv; // inverse mod 2**256 // Because the division is now exact we can divide by multiplying // with the modular inverse of denominator. This will give us the // correct result modulo 2**256. Since the precoditions guarantee // that the outcome is less than 2**256, this is the final result. // We don't need to compute the high bits of the result and prod1 // is no longer required. result = prod0 * inv; return result; } } /// @notice Calculates ceil(a×b÷denominator) with full precision. Throws if result overflows a uint256 or denominator == 0 /// @param a The multiplicand /// @param b The multiplier /// @param denominator The divisor /// @return result The 256-bit result function mulDivRoundingUp( uint256 a, uint256 b, uint256 denominator ) internal pure returns (uint256 result) { unchecked { result = mulDiv(a, b, denominator); if (mulmod(a, b, denominator) > 0) { require(result < type(uint256).max); result++; } } } } ================================================ FILE: agent-as-a-service/agent-launchpad/contracts/core/libraries/LiquidityMath.sol ================================================ // SPDX-License-Identifier: GPL-2.0-or-later pragma solidity ^0.8.0; /// @title Math library for liquidity library LiquidityMath { /// @notice Add a signed liquidity delta to liquidity and revert if it overflows or underflows /// @param x The liquidity before change /// @param y The delta by which liquidity should be changed /// @return z The liquidity delta function addDelta(uint128 x, int128 y) internal pure returns (uint128 z) { if (y < 0) { require((z = x - uint128(-y)) < x, 'LS'); } else { require((z = x + uint128(y)) >= x, 'LA'); } } } ================================================ FILE: agent-as-a-service/agent-launchpad/contracts/core/libraries/LowGasSafeMath.sol ================================================ // SPDX-License-Identifier: GPL-2.0-or-later pragma solidity ^0.8.0; /// @title Optimized overflow and underflow safe math operations /// @notice Contains methods for doing math operations that revert on overflow or underflow for minimal gas cost library LowGasSafeMath { /// @notice Returns x + y, reverts if sum overflows uint256 /// @param x The augend /// @param y The addend /// @return z The sum of x and y function add(uint256 x, uint256 y) internal pure returns (uint256 z) { require((z = x + y) >= x); } /// @notice Returns x - y, reverts if underflows /// @param x The minuend /// @param y The subtrahend /// @return z The difference of x and y function sub(uint256 x, uint256 y) internal pure returns (uint256 z) { require((z = x - y) <= x); } /// @notice Returns x * y, reverts if overflows /// @param x The multiplicand /// @param y The multiplier /// @return z The product of x and y function mul(uint256 x, uint256 y) internal pure returns (uint256 z) { require(x == 0 || (z = x * y) / x == y); } /// @notice Returns x + y, reverts if overflows or underflows /// @param x The augend /// @param y The addend /// @return z The sum of x and y function add(int256 x, int256 y) internal pure returns (int256 z) { require((z = x + y) >= x == (y >= 0)); } /// @notice Returns x - y, reverts if overflows or underflows /// @param x The minuend /// @param y The subtrahend /// @return z The difference of x and y function sub(int256 x, int256 y) internal pure returns (int256 z) { require((z = x - y) <= x == (y >= 0)); } } ================================================ FILE: agent-as-a-service/agent-launchpad/contracts/core/libraries/Oracle.sol ================================================ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.0; /// @title Oracle /// @notice Provides price and liquidity data useful for a wide variety of system designs /// @dev Instances of stored oracle data, "observations", are collected in the oracle array /// Every pool is initialized with an oracle array length of 1. Anyone can pay the SSTOREs to increase the /// maximum length of the oracle array. New slots will be added when the array is fully populated. /// Observations are overwritten when the full length of the oracle array is populated. /// The most recent observation is available, independent of the length of the oracle array, by passing 0 to observe() library Oracle { error I(); error OLD(); struct Observation { // the block timestamp of the observation uint32 blockTimestamp; // the tick accumulator, i.e. tick * time elapsed since the pool was first initialized int56 tickCumulative; // the seconds per liquidity, i.e. seconds elapsed / max(1, liquidity) since the pool was first initialized uint160 secondsPerLiquidityCumulativeX128; // whether or not the observation is initialized bool initialized; } /// @notice Transforms a previous observation into a new observation, given the passage of time and the current tick and liquidity values /// @dev blockTimestamp _must_ be chronologically equal to or greater than last.blockTimestamp, safe for 0 or 1 overflows /// @param last The specified observation to be transformed /// @param blockTimestamp The timestamp of the new observation /// @param tick The active tick at the time of the new observation /// @param liquidity The total in-range liquidity at the time of the new observation /// @return Observation The newly populated observation function transform( Observation memory last, uint32 blockTimestamp, int24 tick, uint128 liquidity ) private pure returns (Observation memory) { unchecked { uint32 delta = blockTimestamp - last.blockTimestamp; return Observation({ blockTimestamp: blockTimestamp, tickCumulative: last.tickCumulative + int56(tick) * int56(uint56(delta)), secondsPerLiquidityCumulativeX128: last .secondsPerLiquidityCumulativeX128 + ((uint160(delta) << 128) / (liquidity > 0 ? liquidity : 1)), initialized: true }); } } /// @notice Initialize the oracle array by writing the first slot. Called once for the lifecycle of the observations array /// @param self The stored oracle array /// @param time The time of the oracle initialization, via block.timestamp truncated to uint32 /// @return cardinality The number of populated elements in the oracle array /// @return cardinalityNext The new length of the oracle array, independent of population function initialize( Observation[65535] storage self, uint32 time ) internal returns (uint16 cardinality, uint16 cardinalityNext) { self[0] = Observation({ blockTimestamp: time, tickCumulative: 0, secondsPerLiquidityCumulativeX128: 0, initialized: true }); return (1, 1); } /// @notice Writes an oracle observation to the array /// @dev Writable at most once per block. Index represents the most recently written element. cardinality and index must be tracked externally. /// If the index is at the end of the allowable array length (according to cardinality), and the next cardinality /// is greater than the current one, cardinality may be increased. This restriction is created to preserve ordering. /// @param self The stored oracle array /// @param index The index of the observation that was most recently written to the observations array /// @param blockTimestamp The timestamp of the new observation /// @param tick The active tick at the time of the new observation /// @param liquidity The total in-range liquidity at the time of the new observation /// @param cardinality The number of populated elements in the oracle array /// @param cardinalityNext The new length of the oracle array, independent of population /// @return indexUpdated The new index of the most recently written element in the oracle array /// @return cardinalityUpdated The new cardinality of the oracle array function write( Observation[65535] storage self, uint16 index, uint32 blockTimestamp, int24 tick, uint128 liquidity, uint16 cardinality, uint16 cardinalityNext ) internal returns (uint16 indexUpdated, uint16 cardinalityUpdated) { unchecked { Observation memory last = self[index]; // early return if we've already written an observation this block if (last.blockTimestamp == blockTimestamp) return (index, cardinality); // if the conditions are right, we can bump the cardinality if (cardinalityNext > cardinality && index == (cardinality - 1)) { cardinalityUpdated = cardinalityNext; } else { cardinalityUpdated = cardinality; } indexUpdated = (index + 1) % cardinalityUpdated; self[indexUpdated] = transform( last, blockTimestamp, tick, liquidity ); } } /// @notice Prepares the oracle array to store up to `next` observations /// @param self The stored oracle array /// @param current The current next cardinality of the oracle array /// @param next The proposed next cardinality which will be populated in the oracle array /// @return next The next cardinality which will be populated in the oracle array function grow( Observation[65535] storage self, uint16 current, uint16 next ) internal returns (uint16) { unchecked { if (current <= 0) revert I(); // no-op if the passed next value isn't greater than the current next value if (next <= current) return current; // store in each slot to prevent fresh SSTOREs in swaps // this data will not be used because the initialized boolean is still false for (uint16 i = current; i < next; i++) self[i].blockTimestamp = 1; return next; } } /// @notice comparator for 32-bit timestamps /// @dev safe for 0 or 1 overflows, a and b _must_ be chronologically before or equal to time /// @param time A timestamp truncated to 32 bits /// @param a A comparison timestamp from which to determine the relative position of `time` /// @param b From which to determine the relative position of `time` /// @return Whether `a` is chronologically <= `b` function lte(uint32 time, uint32 a, uint32 b) private pure returns (bool) { unchecked { // if there hasn't been overflow, no need to adjust if (a <= time && b <= time) return a <= b; uint256 aAdjusted = a > time ? a : a + 2 ** 32; uint256 bAdjusted = b > time ? b : b + 2 ** 32; return aAdjusted <= bAdjusted; } } /// @notice Fetches the observations beforeOrAt and atOrAfter a target, i.e. where [beforeOrAt, atOrAfter] is satisfied. /// The result may be the same observation, or adjacent observations. /// @dev The answer must be contained in the array, used when the target is located within the stored observation /// boundaries: older than the most recent observation and younger, or the same age as, the oldest observation /// @param self The stored oracle array /// @param time The current block.timestamp /// @param target The timestamp at which the reserved observation should be for /// @param index The index of the observation that was most recently written to the observations array /// @param cardinality The number of populated elements in the oracle array /// @return beforeOrAt The observation recorded before, or at, the target /// @return atOrAfter The observation recorded at, or after, the target function binarySearch( Observation[65535] storage self, uint32 time, uint32 target, uint16 index, uint16 cardinality ) private view returns (Observation memory beforeOrAt, Observation memory atOrAfter) { unchecked { uint256 l = (index + 1) % cardinality; // oldest observation uint256 r = l + cardinality - 1; // newest observation uint256 i; while (true) { i = (l + r) / 2; beforeOrAt = self[i % cardinality]; // we've landed on an uninitialized tick, keep searching higher (more recently) if (!beforeOrAt.initialized) { l = i + 1; continue; } atOrAfter = self[(i + 1) % cardinality]; bool targetAtOrAfter = lte( time, beforeOrAt.blockTimestamp, target ); // check if we've found the answer! if ( targetAtOrAfter && lte(time, target, atOrAfter.blockTimestamp) ) break; if (!targetAtOrAfter) r = i - 1; else l = i + 1; } } } /// @notice Fetches the observations beforeOrAt and atOrAfter a given target, i.e. where [beforeOrAt, atOrAfter] is satisfied /// @dev Assumes there is at least 1 initialized observation. /// Used by observeSingle() to compute the counterfactual accumulator values as of a given block timestamp. /// @param self The stored oracle array /// @param time The current block.timestamp /// @param target The timestamp at which the reserved observation should be for /// @param tick The active tick at the time of the returned or simulated observation /// @param index The index of the observation that was most recently written to the observations array /// @param liquidity The total pool liquidity at the time of the call /// @param cardinality The number of populated elements in the oracle array /// @return beforeOrAt The observation which occurred at, or before, the given timestamp /// @return atOrAfter The observation which occurred at, or after, the given timestamp function getSurroundingObservations( Observation[65535] storage self, uint32 time, uint32 target, int24 tick, uint16 index, uint128 liquidity, uint16 cardinality ) private view returns (Observation memory beforeOrAt, Observation memory atOrAfter) { unchecked { // optimistically set before to the newest observation beforeOrAt = self[index]; // if the target is chronologically at or after the newest observation, we can early return if (lte(time, beforeOrAt.blockTimestamp, target)) { if (beforeOrAt.blockTimestamp == target) { // if newest observation equals target, we're in the same block, so we can ignore atOrAfter return (beforeOrAt, atOrAfter); } else { // otherwise, we need to transform return ( beforeOrAt, transform(beforeOrAt, target, tick, liquidity) ); } } // now, set before to the oldest observation beforeOrAt = self[(index + 1) % cardinality]; if (!beforeOrAt.initialized) beforeOrAt = self[0]; // ensure that the target is chronologically at or after the oldest observation if (!lte(time, beforeOrAt.blockTimestamp, target)) revert OLD(); // if we've reached this point, we have to binary search return binarySearch(self, time, target, index, cardinality); } } /// @dev Reverts if an observation at or before the desired observation timestamp does not exist. /// 0 may be passed as `secondsAgo' to return the current cumulative values. /// If called with a timestamp falling between two observations, returns the counterfactual accumulator values /// at exactly the timestamp between the two observations. /// @param self The stored oracle array /// @param time The current block timestamp /// @param secondsAgo The amount of time to look back, in seconds, at which point to return an observation /// @param tick The current tick /// @param index The index of the observation that was most recently written to the observations array /// @param liquidity The current in-range pool liquidity /// @param cardinality The number of populated elements in the oracle array /// @return tickCumulative The tick * time elapsed since the pool was first initialized, as of `secondsAgo` /// @return secondsPerLiquidityCumulativeX128 The time elapsed / max(1, liquidity) since the pool was first initialized, as of `secondsAgo` function observeSingle( Observation[65535] storage self, uint32 time, uint32 secondsAgo, int24 tick, uint16 index, uint128 liquidity, uint16 cardinality ) internal view returns ( int56 tickCumulative, uint160 secondsPerLiquidityCumulativeX128 ) { unchecked { if (secondsAgo == 0) { Observation memory last = self[index]; if (last.blockTimestamp != time) last = transform(last, time, tick, liquidity); return ( last.tickCumulative, last.secondsPerLiquidityCumulativeX128 ); } uint32 target = time - secondsAgo; ( Observation memory beforeOrAt, Observation memory atOrAfter ) = getSurroundingObservations( self, time, target, tick, index, liquidity, cardinality ); if (target == beforeOrAt.blockTimestamp) { // we're at the left boundary return ( beforeOrAt.tickCumulative, beforeOrAt.secondsPerLiquidityCumulativeX128 ); } else if (target == atOrAfter.blockTimestamp) { // we're at the right boundary return ( atOrAfter.tickCumulative, atOrAfter.secondsPerLiquidityCumulativeX128 ); } else { // we're in the middle uint32 observationTimeDelta = atOrAfter.blockTimestamp - beforeOrAt.blockTimestamp; uint32 targetDelta = target - beforeOrAt.blockTimestamp; return ( beforeOrAt.tickCumulative + ((atOrAfter.tickCumulative - beforeOrAt.tickCumulative) / int56(uint56(observationTimeDelta))) * int56(uint56(targetDelta)), beforeOrAt.secondsPerLiquidityCumulativeX128 + uint160( (uint256( atOrAfter.secondsPerLiquidityCumulativeX128 - beforeOrAt.secondsPerLiquidityCumulativeX128 ) * targetDelta) / observationTimeDelta ) ); } } } /// @notice Returns the accumulator values as of each time seconds ago from the given time in the array of `secondsAgos` /// @dev Reverts if `secondsAgos` > oldest observation /// @param self The stored oracle array /// @param time The current block.timestamp /// @param secondsAgos Each amount of time to look back, in seconds, at which point to return an observation /// @param tick The current tick /// @param index The index of the observation that was most recently written to the observations array /// @param liquidity The current in-range pool liquidity /// @param cardinality The number of populated elements in the oracle array /// @return tickCumulatives The tick * time elapsed since the pool was first initialized, as of each `secondsAgo` /// @return secondsPerLiquidityCumulativeX128s The cumulative seconds / max(1, liquidity) since the pool was first initialized, as of each `secondsAgo` function observe( Observation[65535] storage self, uint32 time, uint32[] memory secondsAgos, int24 tick, uint16 index, uint128 liquidity, uint16 cardinality ) internal view returns ( int56[] memory tickCumulatives, uint160[] memory secondsPerLiquidityCumulativeX128s ) { unchecked { if (cardinality <= 0) revert I(); tickCumulatives = new int56[](secondsAgos.length); secondsPerLiquidityCumulativeX128s = new uint160[]( secondsAgos.length ); for (uint256 i = 0; i < secondsAgos.length; i++) { ( tickCumulatives[i], secondsPerLiquidityCumulativeX128s[i] ) = observeSingle( self, time, secondsAgos[i], tick, index, liquidity, cardinality ); } } } } ================================================ FILE: agent-as-a-service/agent-launchpad/contracts/core/libraries/Position.sol ================================================ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.0; import {FullMath} from "./FullMath.sol"; import {FixedPoint128} from "./FixedPoint128.sol"; /// @title Position /// @notice Positions represent an owner address' liquidity between a lower and upper tick boundary /// @dev Positions store additional state for tracking fees owed to the position library Position { error NP(); // info stored for each user's position struct Info { // the amount of liquidity owned by this position uint128 liquidity; // fee growth per unit of liquidity as of the last update to liquidity or fees owed uint256 feeGrowthInside0LastX128; uint256 feeGrowthInside1LastX128; // the fees owed to the position owner in token0/token1 uint128 tokensOwed0; uint128 tokensOwed1; } /// @notice Returns the Info struct of a position, given an owner and position boundaries /// @param self The mapping containing all user positions /// @param owner The address of the position owner /// @param tickLower The lower tick boundary of the position /// @param tickUpper The upper tick boundary of the position /// @return position The position info struct of the given owners' position function get( mapping(bytes32 => Info) storage self, address owner, int24 tickLower, int24 tickUpper ) internal view returns (Position.Info storage position) { position = self[ keccak256(abi.encodePacked(owner, tickLower, tickUpper)) ]; } /// @notice Credits accumulated fees to a user's position /// @param self The individual position to update /// @param liquidityDelta The change in pool liquidity as a result of the position update /// @param feeGrowthInside0X128 The all-time fee growth in token0, per unit of liquidity, inside the position's tick boundaries /// @param feeGrowthInside1X128 The all-time fee growth in token1, per unit of liquidity, inside the position's tick boundaries function update( Info storage self, int128 liquidityDelta, uint256 feeGrowthInside0X128, uint256 feeGrowthInside1X128 ) internal { Info memory _self = self; uint128 liquidityNext; if (liquidityDelta == 0) { if (_self.liquidity <= 0) revert NP(); // disallow pokes for 0 liquidity positions liquidityNext = _self.liquidity; } else { liquidityNext = liquidityDelta < 0 ? _self.liquidity - uint128(-liquidityDelta) : _self.liquidity + uint128(liquidityDelta); } // calculate accumulated fees. overflow in the subtraction of fee growth is expected uint128 tokensOwed0; uint128 tokensOwed1; unchecked { tokensOwed0 = uint128( FullMath.mulDiv( feeGrowthInside0X128 - _self.feeGrowthInside0LastX128, _self.liquidity, FixedPoint128.Q128 ) ); tokensOwed1 = uint128( FullMath.mulDiv( feeGrowthInside1X128 - _self.feeGrowthInside1LastX128, _self.liquidity, FixedPoint128.Q128 ) ); // update the position if (liquidityDelta != 0) self.liquidity = liquidityNext; self.feeGrowthInside0LastX128 = feeGrowthInside0X128; self.feeGrowthInside1LastX128 = feeGrowthInside1X128; if (tokensOwed0 > 0 || tokensOwed1 > 0) { // overflow is acceptable, user must withdraw before they hit type(uint128).max fees self.tokensOwed0 += tokensOwed0; self.tokensOwed1 += tokensOwed1; } } } } ================================================ FILE: agent-as-a-service/agent-launchpad/contracts/core/libraries/SafeCast.sol ================================================ // SPDX-License-Identifier: GPL-2.0-or-later pragma solidity ^0.8.0; /// @title Safe casting methods /// @notice Contains methods for safely casting between types library SafeCast { /// @notice Cast a uint256 to a uint160, revert on overflow /// @param y The uint256 to be downcasted /// @return z The downcasted integer, now type uint160 function toUint160(uint256 y) internal pure returns (uint160 z) { require((z = uint160(y)) == y); } /// @notice Cast a int256 to a int128, revert on overflow or underflow /// @param y The int256 to be downcasted /// @return z The downcasted integer, now type int128 function toInt128(int256 y) internal pure returns (int128 z) { require((z = int128(y)) == y); } /// @notice Cast a uint256 to a int256, revert on overflow /// @param y The uint256 to be casted /// @return z The casted integer, now type int256 function toInt256(uint256 y) internal pure returns (int256 z) { require(y < 2**255); z = int256(y); } } ================================================ FILE: agent-as-a-service/agent-launchpad/contracts/core/libraries/SqrtPriceMath.sol ================================================ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.0; import './LowGasSafeMath.sol'; import './SafeCast.sol'; import './FullMath.sol'; import './UnsafeMath.sol'; import './FixedPoint96.sol'; /// @title Functions based on Q64.96 sqrt price and liquidity /// @notice Contains the math that uses square root of price as a Q64.96 and liquidity to compute deltas library SqrtPriceMath { using LowGasSafeMath for uint256; using SafeCast for uint256; /// @notice Gets the next sqrt price given a delta of token0 /// @dev Always rounds up, because in the exact output case (increasing price) we need to move the price at least /// far enough to get the desired output amount, and in the exact input case (decreasing price) we need to move the /// price less in order to not send too much output. /// The most precise formula for this is liquidity * sqrtPX96 / (liquidity +- amount * sqrtPX96), /// if this is impossible because of overflow, we calculate liquidity / (liquidity / sqrtPX96 +- amount). /// @param sqrtPX96 The starting price, i.e. before accounting for the token0 delta /// @param liquidity The amount of usable liquidity /// @param amount How much of token0 to add or remove from virtual reserves /// @param add Whether to add or remove the amount of token0 /// @return The price after adding or removing amount, depending on add function getNextSqrtPriceFromAmount0RoundingUp( uint160 sqrtPX96, uint128 liquidity, uint256 amount, bool add ) internal pure returns (uint160) { // we short circuit amount == 0 because the result is otherwise not guaranteed to equal the input price if (amount == 0) return sqrtPX96; uint256 numerator1 = uint256(liquidity) << FixedPoint96.RESOLUTION; if (add) { uint256 product; if ((product = amount * sqrtPX96) / amount == sqrtPX96) { uint256 denominator = numerator1 + product; if (denominator >= numerator1) // always fits in 160 bits return uint160(FullMath.mulDivRoundingUp(numerator1, sqrtPX96, denominator)); } return uint160(UnsafeMath.divRoundingUp(numerator1, (numerator1 / sqrtPX96).add(amount))); } else { uint256 product; // if the product overflows, we know the denominator underflows // in addition, we must check that the denominator does not underflow require((product = amount * sqrtPX96) / amount == sqrtPX96 && numerator1 > product); uint256 denominator = numerator1 - product; return FullMath.mulDivRoundingUp(numerator1, sqrtPX96, denominator).toUint160(); } } /// @notice Gets the next sqrt price given a delta of token1 /// @dev Always rounds down, because in the exact output case (decreasing price) we need to move the price at least /// far enough to get the desired output amount, and in the exact input case (increasing price) we need to move the /// price less in order to not send too much output. /// The formula we compute is within <1 wei of the lossless version: sqrtPX96 +- amount / liquidity /// @param sqrtPX96 The starting price, i.e., before accounting for the token1 delta /// @param liquidity The amount of usable liquidity /// @param amount How much of token1 to add, or remove, from virtual reserves /// @param add Whether to add, or remove, the amount of token1 /// @return The price after adding or removing `amount` function getNextSqrtPriceFromAmount1RoundingDown( uint160 sqrtPX96, uint128 liquidity, uint256 amount, bool add ) internal pure returns (uint160) { // if we're adding (subtracting), rounding down requires rounding the quotient down (up) // in both cases, avoid a mulDiv for most inputs if (add) { uint256 quotient = ( amount <= type(uint160).max ? (amount << FixedPoint96.RESOLUTION) / liquidity : FullMath.mulDiv(amount, FixedPoint96.Q96, liquidity) ); return uint256(sqrtPX96).add(quotient).toUint160(); } else { uint256 quotient = ( amount <= type(uint160).max ? UnsafeMath.divRoundingUp(amount << FixedPoint96.RESOLUTION, liquidity) : FullMath.mulDivRoundingUp(amount, FixedPoint96.Q96, liquidity) ); require(sqrtPX96 > quotient); // always fits 160 bits return uint160(sqrtPX96 - quotient); } } /// @notice Gets the next sqrt price given an input amount of token0 or token1 /// @dev Throws if price or liquidity are 0, or if the next price is out of bounds /// @param sqrtPX96 The starting price, i.e., before accounting for the input amount /// @param liquidity The amount of usable liquidity /// @param amountIn How much of token0, or token1, is being swapped in /// @param zeroForOne Whether the amount in is token0 or token1 /// @return sqrtQX96 The price after adding the input amount to token0 or token1 function getNextSqrtPriceFromInput( uint160 sqrtPX96, uint128 liquidity, uint256 amountIn, bool zeroForOne ) internal pure returns (uint160 sqrtQX96) { require(sqrtPX96 > 0); require(liquidity > 0); // round to make sure that we don't pass the target price return zeroForOne ? getNextSqrtPriceFromAmount0RoundingUp(sqrtPX96, liquidity, amountIn, true) : getNextSqrtPriceFromAmount1RoundingDown(sqrtPX96, liquidity, amountIn, true); } /// @notice Gets the next sqrt price given an output amount of token0 or token1 /// @dev Throws if price or liquidity are 0 or the next price is out of bounds /// @param sqrtPX96 The starting price before accounting for the output amount /// @param liquidity The amount of usable liquidity /// @param amountOut How much of token0, or token1, is being swapped out /// @param zeroForOne Whether the amount out is token0 or token1 /// @return sqrtQX96 The price after removing the output amount of token0 or token1 function getNextSqrtPriceFromOutput( uint160 sqrtPX96, uint128 liquidity, uint256 amountOut, bool zeroForOne ) internal pure returns (uint160 sqrtQX96) { require(sqrtPX96 > 0); require(liquidity > 0); // round to make sure that we pass the target price return zeroForOne ? getNextSqrtPriceFromAmount1RoundingDown(sqrtPX96, liquidity, amountOut, false) : getNextSqrtPriceFromAmount0RoundingUp(sqrtPX96, liquidity, amountOut, false); } /// @notice Gets the amount0 delta between two prices /// @dev Calculates liquidity / sqrt(lower) - liquidity / sqrt(upper), /// i.e. liquidity * (sqrt(upper) - sqrt(lower)) / (sqrt(upper) * sqrt(lower)) /// @param sqrtRatioAX96 A sqrt price /// @param sqrtRatioBX96 Another sqrt price /// @param liquidity The amount of usable liquidity /// @param roundUp Whether to round the amount up or down /// @return amount0 Amount of token0 required to cover a position of size liquidity between the two passed prices function getAmount0Delta( uint160 sqrtRatioAX96, uint160 sqrtRatioBX96, uint128 liquidity, bool roundUp ) internal pure returns (uint256 amount0) { if (sqrtRatioAX96 > sqrtRatioBX96) (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96); uint256 numerator1 = uint256(liquidity) << FixedPoint96.RESOLUTION; uint256 numerator2 = sqrtRatioBX96 - sqrtRatioAX96; require(sqrtRatioAX96 > 0); return roundUp ? UnsafeMath.divRoundingUp( FullMath.mulDivRoundingUp(numerator1, numerator2, sqrtRatioBX96), sqrtRatioAX96 ) : FullMath.mulDiv(numerator1, numerator2, sqrtRatioBX96) / sqrtRatioAX96; } /// @notice Gets the amount1 delta between two prices /// @dev Calculates liquidity * (sqrt(upper) - sqrt(lower)) /// @param sqrtRatioAX96 A sqrt price /// @param sqrtRatioBX96 Another sqrt price /// @param liquidity The amount of usable liquidity /// @param roundUp Whether to round the amount up, or down /// @return amount1 Amount of token1 required to cover a position of size liquidity between the two passed prices function getAmount1Delta( uint160 sqrtRatioAX96, uint160 sqrtRatioBX96, uint128 liquidity, bool roundUp ) internal pure returns (uint256 amount1) { if (sqrtRatioAX96 > sqrtRatioBX96) (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96); return roundUp ? FullMath.mulDivRoundingUp(liquidity, sqrtRatioBX96 - sqrtRatioAX96, FixedPoint96.Q96) : FullMath.mulDiv(liquidity, sqrtRatioBX96 - sqrtRatioAX96, FixedPoint96.Q96); } /// @notice Helper that gets signed token0 delta /// @param sqrtRatioAX96 A sqrt price /// @param sqrtRatioBX96 Another sqrt price /// @param liquidity The change in liquidity for which to compute the amount0 delta /// @return amount0 Amount of token0 corresponding to the passed liquidityDelta between the two prices function getAmount0Delta( uint160 sqrtRatioAX96, uint160 sqrtRatioBX96, int128 liquidity ) internal pure returns (int256 amount0) { return liquidity < 0 ? -getAmount0Delta(sqrtRatioAX96, sqrtRatioBX96, uint128(-liquidity), false).toInt256() : getAmount0Delta(sqrtRatioAX96, sqrtRatioBX96, uint128(liquidity), true).toInt256(); } /// @notice Helper that gets signed token1 delta /// @param sqrtRatioAX96 A sqrt price /// @param sqrtRatioBX96 Another sqrt price /// @param liquidity The change in liquidity for which to compute the amount1 delta /// @return amount1 Amount of token1 corresponding to the passed liquidityDelta between the two prices function getAmount1Delta( uint160 sqrtRatioAX96, uint160 sqrtRatioBX96, int128 liquidity ) internal pure returns (int256 amount1) { return liquidity < 0 ? -getAmount1Delta(sqrtRatioAX96, sqrtRatioBX96, uint128(-liquidity), false).toInt256() : getAmount1Delta(sqrtRatioAX96, sqrtRatioBX96, uint128(liquidity), true).toInt256(); } } ================================================ FILE: agent-as-a-service/agent-launchpad/contracts/core/libraries/SwapMath.sol ================================================ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.0; import './FullMath.sol'; import './SqrtPriceMath.sol'; /// @title Computes the result of a swap within ticks /// @notice Contains methods for computing the result of a swap within a single tick price range, i.e., a single tick. library SwapMath { /// @notice Computes the result of swapping some amount in, or amount out, given the parameters of the swap /// @dev The fee, plus the amount in, will never exceed the amount remaining if the swap's `amountSpecified` is positive /// @param sqrtRatioCurrentX96 The current sqrt price of the pool /// @param sqrtRatioTargetX96 The price that cannot be exceeded, from which the direction of the swap is inferred /// @param liquidity The usable liquidity /// @param amountRemaining How much input or output amount is remaining to be swapped in/out /// @param feePips The fee taken from the input amount, expressed in hundredths of a bip /// @return sqrtRatioNextX96 The price after swapping the amount in/out, not to exceed the price target /// @return amountIn The amount to be swapped in, of either token0 or token1, based on the direction of the swap /// @return amountOut The amount to be received, of either token0 or token1, based on the direction of the swap /// @return feeAmount The amount of input that will be taken as a fee function computeSwapStep( uint160 sqrtRatioCurrentX96, uint160 sqrtRatioTargetX96, uint128 liquidity, int256 amountRemaining, uint24 feePips ) internal pure returns ( uint160 sqrtRatioNextX96, uint256 amountIn, uint256 amountOut, uint256 feeAmount ) { bool zeroForOne = sqrtRatioCurrentX96 >= sqrtRatioTargetX96; bool exactIn = amountRemaining >= 0; if (exactIn) { uint256 amountRemainingLessFee = FullMath.mulDiv(uint256(amountRemaining), 1e6 - feePips, 1e6); amountIn = zeroForOne ? SqrtPriceMath.getAmount0Delta(sqrtRatioTargetX96, sqrtRatioCurrentX96, liquidity, true) : SqrtPriceMath.getAmount1Delta(sqrtRatioCurrentX96, sqrtRatioTargetX96, liquidity, true); if (amountRemainingLessFee >= amountIn) sqrtRatioNextX96 = sqrtRatioTargetX96; else sqrtRatioNextX96 = SqrtPriceMath.getNextSqrtPriceFromInput( sqrtRatioCurrentX96, liquidity, amountRemainingLessFee, zeroForOne ); } else { amountOut = zeroForOne ? SqrtPriceMath.getAmount1Delta(sqrtRatioTargetX96, sqrtRatioCurrentX96, liquidity, false) : SqrtPriceMath.getAmount0Delta(sqrtRatioCurrentX96, sqrtRatioTargetX96, liquidity, false); if (uint256(-amountRemaining) >= amountOut) sqrtRatioNextX96 = sqrtRatioTargetX96; else sqrtRatioNextX96 = SqrtPriceMath.getNextSqrtPriceFromOutput( sqrtRatioCurrentX96, liquidity, uint256(-amountRemaining), zeroForOne ); } bool max = sqrtRatioTargetX96 == sqrtRatioNextX96; // get the input/output amounts if (zeroForOne) { amountIn = max && exactIn ? amountIn : SqrtPriceMath.getAmount0Delta(sqrtRatioNextX96, sqrtRatioCurrentX96, liquidity, true); amountOut = max && !exactIn ? amountOut : SqrtPriceMath.getAmount1Delta(sqrtRatioNextX96, sqrtRatioCurrentX96, liquidity, false); } else { amountIn = max && exactIn ? amountIn : SqrtPriceMath.getAmount1Delta(sqrtRatioCurrentX96, sqrtRatioNextX96, liquidity, true); amountOut = max && !exactIn ? amountOut : SqrtPriceMath.getAmount0Delta(sqrtRatioCurrentX96, sqrtRatioNextX96, liquidity, false); } // cap the output amount to not exceed the remaining output amount if (!exactIn && amountOut > uint256(-amountRemaining)) { amountOut = uint256(-amountRemaining); } if (exactIn && sqrtRatioNextX96 != sqrtRatioTargetX96) { // we didn't reach the target, so take the remainder of the maximum input as fee feeAmount = uint256(amountRemaining) - amountIn; } else { feeAmount = FullMath.mulDivRoundingUp(amountIn, feePips, 1e6 - feePips); } } } ================================================ FILE: agent-as-a-service/agent-launchpad/contracts/core/libraries/Tick.sol ================================================ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.0; import {SafeCast} from "./SafeCast.sol"; import {TickMath} from "./TickMath.sol"; /// @title Tick /// @notice Contains functions for managing tick processes and relevant calculations library Tick { error LO(); using SafeCast for int256; // info stored for each initialized individual tick struct Info { // the total position liquidity that references this tick uint128 liquidityGross; // amount of net liquidity added (subtracted) when tick is crossed from left to right (right to left), int128 liquidityNet; // fee growth per unit of liquidity on the _other_ side of this tick (relative to the current tick) // only has relative meaning, not absolute — the value depends on when the tick is initialized uint256 feeGrowthOutside0X128; uint256 feeGrowthOutside1X128; // the cumulative tick value on the other side of the tick int56 tickCumulativeOutside; // the seconds per unit of liquidity on the _other_ side of this tick (relative to the current tick) // only has relative meaning, not absolute — the value depends on when the tick is initialized uint160 secondsPerLiquidityOutsideX128; // the seconds spent on the other side of the tick (relative to the current tick) // only has relative meaning, not absolute — the value depends on when the tick is initialized uint32 secondsOutside; // true iff the tick is initialized, i.e. the value is exactly equivalent to the expression liquidityGross != 0 // these 8 bits are set to prevent fresh sstores when crossing newly initialized ticks bool initialized; } /// @notice Derives max liquidity per tick from given tick spacing /// @dev Executed within the pool constructor /// @param tickSpacing The amount of required tick separation, realized in multiples of `tickSpacing` /// e.g., a tickSpacing of 3 requires ticks to be initialized every 3rd tick i.e., ..., -6, -3, 0, 3, 6, ... /// @return The max liquidity per tick function tickSpacingToMaxLiquidityPerTick( int24 tickSpacing ) internal pure returns (uint128) { unchecked { int24 minTick = (TickMath.MIN_TICK / tickSpacing) * tickSpacing; int24 maxTick = (TickMath.MAX_TICK / tickSpacing) * tickSpacing; uint24 numTicks = uint24((maxTick - minTick) / tickSpacing) + 1; return type(uint128).max / numTicks; } } /// @notice Retrieves fee growth data /// @param self The mapping containing all tick information for initialized ticks /// @param tickLower The lower tick boundary of the position /// @param tickUpper The upper tick boundary of the position /// @param tickCurrent The current tick /// @param feeGrowthGlobal0X128 The all-time global fee growth, per unit of liquidity, in token0 /// @param feeGrowthGlobal1X128 The all-time global fee growth, per unit of liquidity, in token1 /// @return feeGrowthInside0X128 The all-time fee growth in token0, per unit of liquidity, inside the position's tick boundaries /// @return feeGrowthInside1X128 The all-time fee growth in token1, per unit of liquidity, inside the position's tick boundaries function getFeeGrowthInside( mapping(int24 => Tick.Info) storage self, int24 tickLower, int24 tickUpper, int24 tickCurrent, uint256 feeGrowthGlobal0X128, uint256 feeGrowthGlobal1X128 ) internal view returns (uint256 feeGrowthInside0X128, uint256 feeGrowthInside1X128) { unchecked { Info storage lower = self[tickLower]; Info storage upper = self[tickUpper]; // calculate fee growth below uint256 feeGrowthBelow0X128; uint256 feeGrowthBelow1X128; if (tickCurrent >= tickLower) { feeGrowthBelow0X128 = lower.feeGrowthOutside0X128; feeGrowthBelow1X128 = lower.feeGrowthOutside1X128; } else { feeGrowthBelow0X128 = feeGrowthGlobal0X128 - lower.feeGrowthOutside0X128; feeGrowthBelow1X128 = feeGrowthGlobal1X128 - lower.feeGrowthOutside1X128; } // calculate fee growth above uint256 feeGrowthAbove0X128; uint256 feeGrowthAbove1X128; if (tickCurrent < tickUpper) { feeGrowthAbove0X128 = upper.feeGrowthOutside0X128; feeGrowthAbove1X128 = upper.feeGrowthOutside1X128; } else { feeGrowthAbove0X128 = feeGrowthGlobal0X128 - upper.feeGrowthOutside0X128; feeGrowthAbove1X128 = feeGrowthGlobal1X128 - upper.feeGrowthOutside1X128; } feeGrowthInside0X128 = feeGrowthGlobal0X128 - feeGrowthBelow0X128 - feeGrowthAbove0X128; feeGrowthInside1X128 = feeGrowthGlobal1X128 - feeGrowthBelow1X128 - feeGrowthAbove1X128; } } /// @notice Updates a tick and returns true if the tick was flipped from initialized to uninitialized, or vice versa /// @param self The mapping containing all tick information for initialized ticks /// @param tick The tick that will be updated /// @param tickCurrent The current tick /// @param liquidityDelta A new amount of liquidity to be added (subtracted) when tick is crossed from left to right (right to left) /// @param feeGrowthGlobal0X128 The all-time global fee growth, per unit of liquidity, in token0 /// @param feeGrowthGlobal1X128 The all-time global fee growth, per unit of liquidity, in token1 /// @param secondsPerLiquidityCumulativeX128 The all-time seconds per max(1, liquidity) of the pool /// @param tickCumulative The tick * time elapsed since the pool was first initialized /// @param time The current block timestamp cast to a uint32 /// @param upper true for updating a position's upper tick, or false for updating a position's lower tick /// @param maxLiquidity The maximum liquidity allocation for a single tick /// @return flipped Whether the tick was flipped from initialized to uninitialized, or vice versa function update( mapping(int24 => Tick.Info) storage self, int24 tick, int24 tickCurrent, int128 liquidityDelta, uint256 feeGrowthGlobal0X128, uint256 feeGrowthGlobal1X128, uint160 secondsPerLiquidityCumulativeX128, int56 tickCumulative, uint32 time, bool upper, uint128 maxLiquidity ) internal returns (bool flipped) { Tick.Info storage info = self[tick]; uint128 liquidityGrossBefore = info.liquidityGross; uint128 liquidityGrossAfter = liquidityDelta < 0 ? liquidityGrossBefore - uint128(-liquidityDelta) : liquidityGrossBefore + uint128(liquidityDelta); if (liquidityGrossAfter > maxLiquidity) revert LO(); flipped = (liquidityGrossAfter == 0) != (liquidityGrossBefore == 0); if (liquidityGrossBefore == 0) { // by convention, we assume that all growth before a tick was initialized happened _below_ the tick if (tick <= tickCurrent) { info.feeGrowthOutside0X128 = feeGrowthGlobal0X128; info.feeGrowthOutside1X128 = feeGrowthGlobal1X128; info .secondsPerLiquidityOutsideX128 = secondsPerLiquidityCumulativeX128; info.tickCumulativeOutside = tickCumulative; info.secondsOutside = time; } info.initialized = true; } info.liquidityGross = liquidityGrossAfter; // when the lower (upper) tick is crossed left to right (right to left), liquidity must be added (removed) info.liquidityNet = upper ? info.liquidityNet - liquidityDelta : info.liquidityNet + liquidityDelta; } /// @notice Clears tick data /// @param self The mapping containing all initialized tick information for initialized ticks /// @param tick The tick that will be cleared function clear( mapping(int24 => Tick.Info) storage self, int24 tick ) internal { delete self[tick]; } /// @notice Transitions to next tick as needed by price movement /// @param self The mapping containing all tick information for initialized ticks /// @param tick The destination tick of the transition /// @param feeGrowthGlobal0X128 The all-time global fee growth, per unit of liquidity, in token0 /// @param feeGrowthGlobal1X128 The all-time global fee growth, per unit of liquidity, in token1 /// @param secondsPerLiquidityCumulativeX128 The current seconds per liquidity /// @param tickCumulative The tick * time elapsed since the pool was first initialized /// @param time The current block.timestamp /// @return liquidityNet The amount of liquidity added (subtracted) when tick is crossed from left to right (right to left) function cross( mapping(int24 => Tick.Info) storage self, int24 tick, uint256 feeGrowthGlobal0X128, uint256 feeGrowthGlobal1X128, uint160 secondsPerLiquidityCumulativeX128, int56 tickCumulative, uint32 time ) internal returns (int128 liquidityNet) { unchecked { Tick.Info storage info = self[tick]; info.feeGrowthOutside0X128 = feeGrowthGlobal0X128 - info.feeGrowthOutside0X128; info.feeGrowthOutside1X128 = feeGrowthGlobal1X128 - info.feeGrowthOutside1X128; info.secondsPerLiquidityOutsideX128 = secondsPerLiquidityCumulativeX128 - info.secondsPerLiquidityOutsideX128; info.tickCumulativeOutside = tickCumulative - info.tickCumulativeOutside; info.secondsOutside = time - info.secondsOutside; liquidityNet = info.liquidityNet; } } } ================================================ FILE: agent-as-a-service/agent-launchpad/contracts/core/libraries/TickBitmap.sol ================================================ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.0; import {BitMath} from "./BitMath.sol"; /// @title Packed tick initialized state library /// @notice Stores a packed mapping of tick index to its initialized state /// @dev The mapping uses int16 for keys since ticks are represented as int24 and there are 256 (2^8) values per word. library TickBitmap { /// @notice Computes the position in the mapping where the initialized bit for a tick lives /// @param tick The tick for which to compute the position /// @return wordPos The key in the mapping containing the word in which the bit is stored /// @return bitPos The bit position in the word where the flag is stored function position( int24 tick ) private pure returns (int16 wordPos, uint8 bitPos) { unchecked { wordPos = int16(tick >> 8); bitPos = uint8(int8(tick % 256)); } } /// @notice Flips the initialized state for a given tick from false to true, or vice versa /// @param self The mapping in which to flip the tick /// @param tick The tick to flip /// @param tickSpacing The spacing between usable ticks function flipTick( mapping(int16 => uint256) storage self, int24 tick, int24 tickSpacing ) internal { unchecked { require(tick % tickSpacing == 0); // ensure that the tick is spaced (int16 wordPos, uint8 bitPos) = position(tick / tickSpacing); uint256 mask = 1 << bitPos; self[wordPos] ^= mask; } } /// @notice Returns the next initialized tick contained in the same word (or adjacent word) as the tick that is either /// to the left (less than or equal to) or right (greater than) of the given tick /// @param self The mapping in which to compute the next initialized tick /// @param tick The starting tick /// @param tickSpacing The spacing between usable ticks /// @param lte Whether to search for the next initialized tick to the left (less than or equal to the starting tick) /// @return next The next initialized or uninitialized tick up to 256 ticks away from the current tick /// @return initialized Whether the next tick is initialized, as the function only searches within up to 256 ticks function nextInitializedTickWithinOneWord( mapping(int16 => uint256) storage self, int24 tick, int24 tickSpacing, bool lte ) internal view returns (int24 next, bool initialized) { unchecked { int24 compressed = tick / tickSpacing; if (tick < 0 && tick % tickSpacing != 0) compressed--; // round towards negative infinity if (lte) { (int16 wordPos, uint8 bitPos) = position(compressed); // all the 1s at or to the right of the current bitPos uint256 mask = (1 << bitPos) - 1 + (1 << bitPos); uint256 masked = self[wordPos] & mask; // if there are no initialized ticks to the right of or at the current tick, return rightmost in the word initialized = masked != 0; // overflow/underflow is possible, but prevented externally by limiting both tickSpacing and tick next = initialized ? (compressed - int24( uint24(bitPos - BitMath.mostSignificantBit(masked)) )) * tickSpacing : (compressed - int24(uint24(bitPos))) * tickSpacing; } else { // start from the word of the next tick, since the current tick state doesn't matter (int16 wordPos, uint8 bitPos) = position(compressed + 1); // all the 1s at or to the left of the bitPos uint256 mask = ~((1 << bitPos) - 1); uint256 masked = self[wordPos] & mask; // if there are no initialized ticks to the left of the current tick, return leftmost in the word initialized = masked != 0; // overflow/underflow is possible, but prevented externally by limiting both tickSpacing and tick next = initialized ? (compressed + 1 + int24( uint24(BitMath.leastSignificantBit(masked) - bitPos) )) * tickSpacing : (compressed + 1 + int24(uint24(type(uint8).max - bitPos))) * tickSpacing; } } } } ================================================ FILE: agent-as-a-service/agent-launchpad/contracts/core/libraries/TickMath.sol ================================================ // SPDX-License-Identifier: GPL-2.0-or-later pragma solidity ^0.8.0; /// @title Math library for computing sqrt prices from ticks and vice versa /// @notice Computes sqrt price for ticks of size 1.0001, i.e. sqrt(1.0001^tick) as fixed point Q64.96 numbers. Supports /// prices between 2**-128 and 2**128 library TickMath { error T(); error R(); /// @dev The minimum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**-128 int24 internal constant MIN_TICK = -887272; /// @dev The maximum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**128 int24 internal constant MAX_TICK = -MIN_TICK; /// @dev The minimum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MIN_TICK) uint160 internal constant MIN_SQRT_RATIO = 4295128739; /// @dev The maximum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MAX_TICK) uint160 internal constant MAX_SQRT_RATIO = 1461446703485210103287273052203988822378723970342; /// @notice Calculates sqrt(1.0001^tick) * 2^96 /// @dev Throws if |tick| > max tick /// @param tick The input tick for the above formula /// @return sqrtPriceX96 A Fixed point Q64.96 number representing the sqrt of the ratio of the two assets (token1/token0) /// at the given tick function getSqrtRatioAtTick( int24 tick ) internal pure returns (uint160 sqrtPriceX96) { unchecked { uint256 absTick = tick < 0 ? uint256(-int256(tick)) : uint256(int256(tick)); if (absTick > uint256(int256(MAX_TICK))) revert T(); uint256 ratio = absTick & 0x1 != 0 ? 0xfffcb933bd6fad37aa2d162d1a594001 : 0x100000000000000000000000000000000; if (absTick & 0x2 != 0) ratio = (ratio * 0xfff97272373d413259a46990580e213a) >> 128; if (absTick & 0x4 != 0) ratio = (ratio * 0xfff2e50f5f656932ef12357cf3c7fdcc) >> 128; if (absTick & 0x8 != 0) ratio = (ratio * 0xffe5caca7e10e4e61c3624eaa0941cd0) >> 128; if (absTick & 0x10 != 0) ratio = (ratio * 0xffcb9843d60f6159c9db58835c926644) >> 128; if (absTick & 0x20 != 0) ratio = (ratio * 0xff973b41fa98c081472e6896dfb254c0) >> 128; if (absTick & 0x40 != 0) ratio = (ratio * 0xff2ea16466c96a3843ec78b326b52861) >> 128; if (absTick & 0x80 != 0) ratio = (ratio * 0xfe5dee046a99a2a811c461f1969c3053) >> 128; if (absTick & 0x100 != 0) ratio = (ratio * 0xfcbe86c7900a88aedcffc83b479aa3a4) >> 128; if (absTick & 0x200 != 0) ratio = (ratio * 0xf987a7253ac413176f2b074cf7815e54) >> 128; if (absTick & 0x400 != 0) ratio = (ratio * 0xf3392b0822b70005940c7a398e4b70f3) >> 128; if (absTick & 0x800 != 0) ratio = (ratio * 0xe7159475a2c29b7443b29c7fa6e889d9) >> 128; if (absTick & 0x1000 != 0) ratio = (ratio * 0xd097f3bdfd2022b8845ad8f792aa5825) >> 128; if (absTick & 0x2000 != 0) ratio = (ratio * 0xa9f746462d870fdf8a65dc1f90e061e5) >> 128; if (absTick & 0x4000 != 0) ratio = (ratio * 0x70d869a156d2a1b890bb3df62baf32f7) >> 128; if (absTick & 0x8000 != 0) ratio = (ratio * 0x31be135f97d08fd981231505542fcfa6) >> 128; if (absTick & 0x10000 != 0) ratio = (ratio * 0x9aa508b5b7a84e1c677de54f3e99bc9) >> 128; if (absTick & 0x20000 != 0) ratio = (ratio * 0x5d6af8dedb81196699c329225ee604) >> 128; if (absTick & 0x40000 != 0) ratio = (ratio * 0x2216e584f5fa1ea926041bedfe98) >> 128; if (absTick & 0x80000 != 0) ratio = (ratio * 0x48a170391f7dc42444e8fa2) >> 128; if (tick > 0) ratio = type(uint256).max / ratio; // this divides by 1<<32 rounding up to go from a Q128.128 to a Q128.96. // we then downcast because we know the result always fits within 160 bits due to our tick input constraint // we round up in the division so getTickAtSqrtRatio of the output price is always consistent sqrtPriceX96 = uint160( (ratio >> 32) + (ratio % (1 << 32) == 0 ? 0 : 1) ); } } /// @notice Calculates the greatest tick value such that getRatioAtTick(tick) <= ratio /// @dev Throws in case sqrtPriceX96 < MIN_SQRT_RATIO, as MIN_SQRT_RATIO is the lowest value getRatioAtTick may /// ever return. /// @param sqrtPriceX96 The sqrt ratio for which to compute the tick as a Q64.96 /// @return tick The greatest tick for which the ratio is less than or equal to the input ratio function getTickAtSqrtRatio( uint160 sqrtPriceX96 ) internal pure returns (int24 tick) { unchecked { // second inequality must be < because the price can never reach the price at the max tick if ( !(sqrtPriceX96 >= MIN_SQRT_RATIO && sqrtPriceX96 < MAX_SQRT_RATIO) ) revert R(); uint256 ratio = uint256(sqrtPriceX96) << 32; uint256 r = ratio; uint256 msb = 0; assembly { let f := shl(7, gt(r, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF)) msb := or(msb, f) r := shr(f, r) } assembly { let f := shl(6, gt(r, 0xFFFFFFFFFFFFFFFF)) msb := or(msb, f) r := shr(f, r) } assembly { let f := shl(5, gt(r, 0xFFFFFFFF)) msb := or(msb, f) r := shr(f, r) } assembly { let f := shl(4, gt(r, 0xFFFF)) msb := or(msb, f) r := shr(f, r) } assembly { let f := shl(3, gt(r, 0xFF)) msb := or(msb, f) r := shr(f, r) } assembly { let f := shl(2, gt(r, 0xF)) msb := or(msb, f) r := shr(f, r) } assembly { let f := shl(1, gt(r, 0x3)) msb := or(msb, f) r := shr(f, r) } assembly { let f := gt(r, 0x1) msb := or(msb, f) } if (msb >= 128) r = ratio >> (msb - 127); else r = ratio << (127 - msb); int256 log_2 = (int256(msb) - 128) << 64; assembly { r := shr(127, mul(r, r)) let f := shr(128, r) log_2 := or(log_2, shl(63, f)) r := shr(f, r) } assembly { r := shr(127, mul(r, r)) let f := shr(128, r) log_2 := or(log_2, shl(62, f)) r := shr(f, r) } assembly { r := shr(127, mul(r, r)) let f := shr(128, r) log_2 := or(log_2, shl(61, f)) r := shr(f, r) } assembly { r := shr(127, mul(r, r)) let f := shr(128, r) log_2 := or(log_2, shl(60, f)) r := shr(f, r) } assembly { r := shr(127, mul(r, r)) let f := shr(128, r) log_2 := or(log_2, shl(59, f)) r := shr(f, r) } assembly { r := shr(127, mul(r, r)) let f := shr(128, r) log_2 := or(log_2, shl(58, f)) r := shr(f, r) } assembly { r := shr(127, mul(r, r)) let f := shr(128, r) log_2 := or(log_2, shl(57, f)) r := shr(f, r) } assembly { r := shr(127, mul(r, r)) let f := shr(128, r) log_2 := or(log_2, shl(56, f)) r := shr(f, r) } assembly { r := shr(127, mul(r, r)) let f := shr(128, r) log_2 := or(log_2, shl(55, f)) r := shr(f, r) } assembly { r := shr(127, mul(r, r)) let f := shr(128, r) log_2 := or(log_2, shl(54, f)) r := shr(f, r) } assembly { r := shr(127, mul(r, r)) let f := shr(128, r) log_2 := or(log_2, shl(53, f)) r := shr(f, r) } assembly { r := shr(127, mul(r, r)) let f := shr(128, r) log_2 := or(log_2, shl(52, f)) r := shr(f, r) } assembly { r := shr(127, mul(r, r)) let f := shr(128, r) log_2 := or(log_2, shl(51, f)) r := shr(f, r) } assembly { r := shr(127, mul(r, r)) let f := shr(128, r) log_2 := or(log_2, shl(50, f)) } int256 log_sqrt10001 = log_2 * 255738958999603826347141; // 128.128 number int24 tickLow = int24( (log_sqrt10001 - 3402992956809132418596140100660247210) >> 128 ); int24 tickHi = int24( (log_sqrt10001 + 291339464771989622907027621153398088495) >> 128 ); tick = tickLow == tickHi ? tickLow : getSqrtRatioAtTick(tickHi) <= sqrtPriceX96 ? tickHi : tickLow; } } } ================================================ FILE: agent-as-a-service/agent-launchpad/contracts/core/libraries/TransferHelper.sol ================================================ // SPDX-License-Identifier: GPL-2.0-or-later pragma solidity ^0.8.0; import {IERC20Minimal} from "../interfaces/IERC20Minimal.sol"; /// @title TransferHelper /// @notice Contains helper methods for interacting with ERC20 tokens that do not consistently return true/false library TransferHelper { error TF(); /// @notice Transfers tokens from msg.sender to a recipient /// @dev Calls transfer on token contract, errors with TF if transfer fails /// @param token The contract address of the token which will be transferred /// @param to The recipient of the transfer /// @param value The value of the transfer function safeTransfer(address token, address to, uint256 value) internal { (bool success, bytes memory data) = token.call( abi.encodeWithSelector(IERC20Minimal.transfer.selector, to, value) ); if (!(success && (data.length == 0 || abi.decode(data, (bool))))) revert TF(); } } ================================================ FILE: agent-as-a-service/agent-launchpad/contracts/core/libraries/UnsafeMath.sol ================================================ // SPDX-License-Identifier: GPL-2.0-or-later pragma solidity ^0.8.0; /// @title Math functions that do not check inputs or outputs /// @notice Contains methods that perform common math functions but do not do any overflow or underflow checks library UnsafeMath { /// @notice Returns ceil(x / y) /// @dev division by 0 has unspecified behavior, and must be checked externally /// @param x The dividend /// @param y The divisor /// @return z The quotient, ceil(x / y) function divRoundingUp(uint256 x, uint256 y) internal pure returns (uint256 z) { assembly { z := add(div(x, y), gt(mod(x, y), 0)) } } } ================================================ FILE: agent-as-a-service/agent-launchpad/contracts/core/test/TestUniswapV3Callee.sol ================================================ // SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.0; import "../interfaces/IERC20Minimal.sol"; import "../libraries/SafeCast.sol"; import "../libraries/TickMath.sol"; import "../interfaces/callback/IUniswapV3MintCallback.sol"; import "../interfaces/callback/IUniswapV3SwapCallback.sol"; import "../interfaces/callback/IUniswapV3FlashCallback.sol"; import "../interfaces/IUniswapV3Pool.sol"; contract TestUniswapV3Callee is IUniswapV3MintCallback, IUniswapV3SwapCallback, IUniswapV3FlashCallback { using SafeCast for uint256; function swapExact0For1( address pool, uint256 amount0In, address recipient, uint160 sqrtPriceLimitX96 ) external { IUniswapV3Pool(pool).swap( recipient, true, amount0In.toInt256(), sqrtPriceLimitX96, abi.encode(msg.sender) ); } function swap0ForExact1( address pool, uint256 amount1Out, address recipient, uint160 sqrtPriceLimitX96 ) external { IUniswapV3Pool(pool).swap( recipient, true, -amount1Out.toInt256(), sqrtPriceLimitX96, abi.encode(msg.sender) ); } function swapExact1For0( address pool, uint256 amount1In, address recipient, uint160 sqrtPriceLimitX96 ) external { IUniswapV3Pool(pool).swap( recipient, false, amount1In.toInt256(), sqrtPriceLimitX96, abi.encode(msg.sender) ); } function swap1ForExact0( address pool, uint256 amount0Out, address recipient, uint160 sqrtPriceLimitX96 ) external { IUniswapV3Pool(pool).swap( recipient, false, -amount0Out.toInt256(), sqrtPriceLimitX96, abi.encode(msg.sender) ); } function swapToLowerSqrtPrice( address pool, uint160 sqrtPriceX96, address recipient ) external { IUniswapV3Pool(pool).swap( recipient, true, type(int256).max, sqrtPriceX96, abi.encode(msg.sender) ); } function swapToHigherSqrtPrice( address pool, uint160 sqrtPriceX96, address recipient ) external { IUniswapV3Pool(pool).swap( recipient, false, type(int256).max, sqrtPriceX96, abi.encode(msg.sender) ); } event SwapCallback(int256 amount0Delta, int256 amount1Delta); function uniswapV3SwapCallback( int256 amount0Delta, int256 amount1Delta, bytes calldata data ) external override { address sender = abi.decode(data, (address)); emit SwapCallback(amount0Delta, amount1Delta); if (amount0Delta > 0) { IERC20Minimal(IUniswapV3Pool(msg.sender).token0()).transferFrom( sender, msg.sender, uint256(amount0Delta) ); } else if (amount1Delta > 0) { IERC20Minimal(IUniswapV3Pool(msg.sender).token1()).transferFrom( sender, msg.sender, uint256(amount1Delta) ); } else { // if both are not gt 0, both must be 0. assert(amount0Delta == 0 && amount1Delta == 0); } } function mint( address pool, address recipient, int24 tickLower, int24 tickUpper, uint128 amount ) external { IUniswapV3Pool(pool).mint( recipient, tickLower, tickUpper, amount, abi.encode(msg.sender) ); } event MintCallback(uint256 amount0Owed, uint256 amount1Owed); function uniswapV3MintCallback( uint256 amount0Owed, uint256 amount1Owed, bytes calldata data ) external override { address sender = abi.decode(data, (address)); emit MintCallback(amount0Owed, amount1Owed); if (amount0Owed > 0) IERC20Minimal(IUniswapV3Pool(msg.sender).token0()).transferFrom( sender, msg.sender, amount0Owed ); if (amount1Owed > 0) IERC20Minimal(IUniswapV3Pool(msg.sender).token1()).transferFrom( sender, msg.sender, amount1Owed ); } event FlashCallback(uint256 fee0, uint256 fee1); function flash( address pool, address recipient, uint256 amount0, uint256 amount1, uint256 pay0, uint256 pay1 ) external { IUniswapV3Pool(pool).flash( recipient, amount0, amount1, abi.encode(msg.sender, pay0, pay1) ); } function uniswapV3FlashCallback( uint256 fee0, uint256 fee1, bytes calldata data ) external override { emit FlashCallback(fee0, fee1); (address sender, uint256 pay0, uint256 pay1) = abi.decode( data, (address, uint256, uint256) ); if (pay0 > 0) IERC20Minimal(IUniswapV3Pool(msg.sender).token0()).transferFrom( sender, msg.sender, pay0 ); if (pay1 > 0) IERC20Minimal(IUniswapV3Pool(msg.sender).token1()).transferFrom( sender, msg.sender, pay1 ); } } ================================================ FILE: agent-as-a-service/agent-launchpad/contracts/interfaces/IWETH.sol ================================================ // SPDX-License-Identifier: GPL-2.0-or-later pragma solidity ^0.8.0; import '@openzeppelin/contracts/token/ERC20/IERC20.sol'; /// @title Interface for WETH interface IWETH is IERC20 { /// @notice Deposit ether to get wrapped ether function deposit() external payable; /// @notice Withdraw wrapped ether to get ether function withdraw(uint256) external; } ================================================ FILE: agent-as-a-service/agent-launchpad/contracts/periphery/NonfungiblePositionManager.sol ================================================ // SPDX-License-Identifier: GPL-2.0-or-later pragma solidity ^0.8.0; import "../core/interfaces/IUniswapV3Pool.sol"; import "../core/libraries/FixedPoint128.sol"; import "../core/libraries/FullMath.sol"; import "./interfaces/INonfungiblePositionManager.sol"; import "./interfaces/INonfungibleTokenPositionDescriptor.sol"; import "./libraries/PositionKey.sol"; import "./libraries/PoolAddress.sol"; import "./base/LiquidityManagement.sol"; import "./base/PeripheryImmutableState.sol"; import "./base/Multicall.sol"; import "./base/ERC721Permit.sol"; import "./base/PeripheryValidation.sol"; import "./base/SelfPermit.sol"; import "./base/PoolInitializer.sol"; import "./libraries/UniswapV3Broker.sol"; /// @title NFT positions /// @notice Wraps Uniswap V3 positions in the ERC721 non-fungible token interface contract NonfungiblePositionManager is INonfungiblePositionManager, Multicall, ERC721Permit, PeripheryImmutableState, PoolInitializer, LiquidityManagement, PeripheryValidation, SelfPermit { /// @dev IDs of pools assigned by this contract mapping(address => uint80) private _poolIds; /// @dev Pool keys by pool ID, to save on SSTOREs for position data mapping(uint80 => PoolAddress.PoolKey) private _poolIdToPoolKey; /// @dev The token ID position data mapping(uint256 => UniswapV3Broker.Position) private _positions; /// @dev The ID of the next token that will be minted. Skips 0 uint176 private _nextId; /// @dev The ID of the next pool that is used for the first time. Skips 0 uint80 private _nextPoolId; /// @dev The address of the token descriptor contract, which handles generating token URIs for position tokens address private _tokenDescriptor; function initialize( address _factory, address _WETH, address _tokenDescriptor_ ) external initializer { __Ownable_init(); __ERC721Permit_init("Uniswap V3 Positions NFT-V1", "UNI-V3-POS", "1"); __PeripheryImmutableState_init(_factory, _WETH); // _tokenDescriptor = _tokenDescriptor_; // _nextId = 1; /// @dev The ID of the next pool that is used for the first time. Skips 0 _nextPoolId = 1; } /// @inheritdoc INonfungiblePositionManager function positions( uint256 tokenId ) external view override returns ( uint96 nonce, address operator, address token0, address token1, uint24 fee, int24 tickLower, int24 tickUpper, uint128 liquidity, uint256 feeGrowthInside0LastX128, uint256 feeGrowthInside1LastX128, uint128 tokensOwed0, uint128 tokensOwed1 ) { UniswapV3Broker.Position memory position = _positions[tokenId]; require(position.poolId != 0, "Invalid token ID"); PoolAddress.PoolKey memory poolKey = _poolIdToPoolKey[position.poolId]; return ( position.nonce, position.operator, poolKey.token0, poolKey.token1, poolKey.fee, position.tickLower, position.tickUpper, position.liquidity, position.feeGrowthInside0LastX128, position.feeGrowthInside1LastX128, position.tokensOwed0, position.tokensOwed1 ); } /// @dev Caches a pool key function cachePoolKey( address pool, PoolAddress.PoolKey memory poolKey ) private returns (uint80 poolId) { poolId = _poolIds[pool]; if (poolId == 0) { _poolIds[pool] = (poolId = _nextPoolId++); _poolIdToPoolKey[poolId] = poolKey; } } /// @inheritdoc INonfungiblePositionManager function mint( MintParams calldata params ) external payable override checkDeadline(params.deadline) returns ( uint256 tokenId, uint128 liquidity, uint256 amount0, uint256 amount1 ) { IUniswapV3Pool pool; (liquidity, amount0, amount1, pool) = addLiquidity( UniswapV3Broker.AddLiquidityParams({ token0: params.token0, token1: params.token1, fee: params.fee, recipient: address(this), tickLower: params.tickLower, tickUpper: params.tickUpper, amount0Desired: params.amount0Desired, amount1Desired: params.amount1Desired, amount0Min: params.amount0Min, amount1Min: params.amount1Min }) ); _mint(params.recipient, (tokenId = _nextId++)); bytes32 positionKey = PositionKey.compute( address(this), params.tickLower, params.tickUpper ); ( , uint256 feeGrowthInside0LastX128, uint256 feeGrowthInside1LastX128, , ) = pool.positions(positionKey); // idempotent set uint80 poolId = cachePoolKey( address(pool), PoolAddress.PoolKey({ token0: params.token0, token1: params.token1, fee: params.fee }) ); _positions[tokenId] = UniswapV3Broker.Position({ nonce: 0, operator: address(0), poolId: poolId, tickLower: params.tickLower, tickUpper: params.tickUpper, liquidity: liquidity, feeGrowthInside0LastX128: feeGrowthInside0LastX128, feeGrowthInside1LastX128: feeGrowthInside1LastX128, tokensOwed0: 0, tokensOwed1: 0 }); emit IncreaseLiquidity(tokenId, liquidity, amount0, amount1); } modifier isAuthorizedForToken(uint256 tokenId) { require(_isApprovedOrOwner(msg.sender, tokenId), "Not approved"); _; } function tokenURI( uint256 tokenId ) public view override(ERC721Upgradeable, IERC721MetadataUpgradeable) returns (string memory) { require(_exists(tokenId)); return INonfungibleTokenPositionDescriptor(_tokenDescriptor).tokenURI( this, tokenId ); } // save bytecode by removing implementation of unused method function baseURI() public pure returns (string memory) {} /// @inheritdoc INonfungiblePositionManager function increaseLiquidity( UniswapV3Broker.IncreaseLiquidityParams calldata params ) external payable override checkDeadline(params.deadline) returns (uint128 liquidity, uint256 amount0, uint256 amount1) { UniswapV3Broker.Position storage position = _positions[params.tokenId]; PoolAddress.PoolKey memory poolKey = _poolIdToPoolKey[position.poolId]; ( UniswapV3Broker.Position memory positionRes, uint128 liquidityRes, uint256 amount0Res, uint256 amount1Res ) = UniswapV3Broker.increaseLiquidity( factory, params, position, poolKey ); // save position _positions[params.tokenId] = positionRes; // return liquidity = liquidityRes; amount0 = amount0Res; amount1 = amount1Res; } /// @inheritdoc INonfungiblePositionManager function decreaseLiquidity( UniswapV3Broker.DecreaseLiquidityParams calldata params ) external payable override isAuthorizedForToken(params.tokenId) checkDeadline(params.deadline) returns (uint256 amount0, uint256 amount1) { UniswapV3Broker.Position storage position = _positions[params.tokenId]; PoolAddress.PoolKey memory poolKey = _poolIdToPoolKey[position.poolId]; ( UniswapV3Broker.Position memory positionRes, uint256 amount0Res, uint256 amount1Res ) = UniswapV3Broker.decreaseLiquidity( factory, params, position, poolKey ); // save position _positions[params.tokenId] = positionRes; // return amount0 = amount0Res; amount1 = amount1Res; } /// @inheritdoc INonfungiblePositionManager function collect( UniswapV3Broker.CollectParams calldata params ) external payable override isAuthorizedForToken(params.tokenId) returns (uint256 amount0, uint256 amount1) { UniswapV3Broker.Position storage position = _positions[params.tokenId]; PoolAddress.PoolKey memory poolKey = _poolIdToPoolKey[position.poolId]; ( UniswapV3Broker.Position memory positionRes, , uint256 amount0Res, uint256 amount1Res ) = UniswapV3Broker.collect(factory, params, position, poolKey); require(params.amount0Max > 0 || params.amount1Max > 0); // save position _positions[params.tokenId] = positionRes; // return amount0 = amount0Res; amount1 = amount1Res; } /// @inheritdoc INonfungiblePositionManager function burn( uint256 tokenId ) external payable override isAuthorizedForToken(tokenId) { UniswapV3Broker.Position storage position = _positions[tokenId]; require( position.liquidity == 0 && position.tokensOwed0 == 0 && position.tokensOwed1 == 0, "Not cleared" ); delete _positions[tokenId]; _burn(tokenId); } function _getAndIncrementNonce( uint256 tokenId ) internal override returns (uint256) { return uint256(_positions[tokenId].nonce++); } /// @inheritdoc IERC721Upgradeable function getApproved( uint256 tokenId ) public view override(ERC721Upgradeable, IERC721Upgradeable) returns (address) { require( _exists(tokenId), "ERC721: approved query for nonexistent token" ); return _positions[tokenId].operator; } /// @dev Overrides _approve to use the operator in the position, which is packed with the position permit nonce function _approve( address to, uint256 tokenId ) internal override(ERC721Upgradeable) { _positions[tokenId].operator = to; emit Approval(ownerOf(tokenId), to, tokenId); } } ================================================ FILE: agent-as-a-service/agent-launchpad/contracts/periphery/NonfungibleTokenPositionDescriptor.sol ================================================ // SPDX-License-Identifier: GPL-2.0-or-later pragma solidity ^0.8.0; import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import "../core/interfaces/IUniswapV3Pool.sol"; import "./libraries/SafeERC20Namer.sol"; import "./libraries/ChainId.sol"; import "./interfaces/INonfungiblePositionManager.sol"; import "./interfaces/INonfungibleTokenPositionDescriptor.sol"; import "./interfaces/IERC20Metadata.sol"; import "./libraries/PoolAddress.sol"; import "./libraries/NFTDescriptor.sol"; import "./libraries/TokenRatioSortOrder.sol"; /// @title Describes NFT token positions /// @notice Produces a string containing the data URI for a JSON metadata string contract NonfungibleTokenPositionDescriptor is INonfungibleTokenPositionDescriptor, OwnableUpgradeable { address public WETH; /// @dev A null-terminated string bytes32 public nativeCurrencyLabelBytes; function initialize( address _WETH, bytes32 _nativeCurrencyLabelBytes ) external initializer { __Ownable_init(); // WETH = _WETH; nativeCurrencyLabelBytes = _nativeCurrencyLabelBytes; } function setWETH( address _WETH, bytes32 _nativeCurrencyLabelBytes ) external onlyOwner { WETH = _WETH; nativeCurrencyLabelBytes = _nativeCurrencyLabelBytes; } /// @notice Returns the native currency label as a string function nativeCurrencyLabel() public view returns (string memory) { uint256 len = 0; while (len < 32 && nativeCurrencyLabelBytes[len] != 0) { len++; } bytes memory b = new bytes(len); for (uint256 i = 0; i < len; i++) { b[i] = nativeCurrencyLabelBytes[i]; } return string(b); } /// @inheritdoc INonfungibleTokenPositionDescriptor function tokenURI( INonfungiblePositionManager positionManager, uint256 tokenId ) external view override returns (string memory) { ( , , address token0, address token1, uint24 fee, int24 tickLower, int24 tickUpper, , , , , ) = positionManager.positions(tokenId); IUniswapV3Pool pool = IUniswapV3Pool( PoolAddress.computeAddress( positionManager.factory(), PoolAddress.PoolKey({token0: token0, token1: token1, fee: fee}) ) ); bool _flipRatio = flipRatio(token0, token1, ChainId.get()); address quoteTokenAddress = !_flipRatio ? token1 : token0; address baseTokenAddress = !_flipRatio ? token0 : token1; (, int24 tick, , , , , ) = pool.slot0(); return NFTDescriptor.constructTokenURI( NFTDescriptor.ConstructTokenURIParams({ tokenId: tokenId, quoteTokenAddress: quoteTokenAddress, baseTokenAddress: baseTokenAddress, quoteTokenSymbol: quoteTokenAddress == WETH ? nativeCurrencyLabel() : SafeERC20Namer.tokenSymbol(quoteTokenAddress), baseTokenSymbol: baseTokenAddress == WETH ? nativeCurrencyLabel() : SafeERC20Namer.tokenSymbol(baseTokenAddress), quoteTokenDecimals: IERC20Metadata(quoteTokenAddress) .decimals(), baseTokenDecimals: IERC20Metadata(baseTokenAddress) .decimals(), flipRatio: _flipRatio, tickLower: tickLower, tickUpper: tickUpper, tickCurrent: tick, tickSpacing: pool.tickSpacing(), fee: fee, poolAddress: address(pool) }) ); } function flipRatio( address token0, address token1, uint256 chainId ) public view returns (bool) { return tokenRatioPriority(token0, chainId) > tokenRatioPriority(token1, chainId); } function tokenRatioPriority( address token, uint256 chainId ) public view returns (int256) { if (token == WETH) { return TokenRatioSortOrder.DENOMINATOR; } return 0; } } ================================================ FILE: agent-as-a-service/agent-launchpad/contracts/periphery/SwapRouter.sol ================================================ // SPDX-License-Identifier: GPL-2.0-or-later pragma solidity ^0.8.0; import "../core/libraries/SafeCast.sol"; import "../core/libraries/TickMath.sol"; import "../core/interfaces/IUniswapV3Pool.sol"; import "./interfaces/ISwapRouter.sol"; import "./base/PeripheryImmutableState.sol"; import "./base/PeripheryValidation.sol"; import "./base/PeripheryPaymentsWithFee.sol"; import "./base/Multicall.sol"; import "./base/SelfPermit.sol"; import "./libraries/Path.sol"; import "./libraries/PoolAddress.sol"; import "./libraries/CallbackValidation.sol"; import "../interfaces/IWETH.sol"; /// @title Uniswap V3 Swap Router /// @notice Router for stateless execution of swaps against Uniswap V3 contract SwapRouter is ISwapRouter, PeripheryImmutableState, PeripheryValidation, PeripheryPaymentsWithFee, Multicall, SelfPermit { using Path for bytes; using SafeCast for uint256; /// @dev Used as the placeholder value for amountInCached, because the computed amount in for an exact output swap /// can never actually be this value uint256 private constant DEFAULT_AMOUNT_IN_CACHED = type(uint256).max; /// @dev Transient storage variable used for returning the computed amount in for an exact output swap. uint256 private amountInCached = DEFAULT_AMOUNT_IN_CACHED; function initialize(address _factory, address _WETH) external initializer { __PeripheryImmutableState_init(_factory, _WETH); } /// @dev Returns the pool for the given token pair and fee. The pool contract may or may not exist. function getPool( address tokenA, address tokenB, uint24 fee ) private view returns (IUniswapV3Pool) { return IUniswapV3Pool( PoolAddress.computeAddress( factory, PoolAddress.getPoolKey(tokenA, tokenB, fee) ) ); } struct SwapCallbackData { bytes path; address payer; } /// @inheritdoc IUniswapV3SwapCallback function uniswapV3SwapCallback( int256 amount0Delta, int256 amount1Delta, bytes calldata _data ) external override { require(amount0Delta > 0 || amount1Delta > 0); // swaps entirely within 0-liquidity regions are not supported SwapCallbackData memory data = abi.decode(_data, (SwapCallbackData)); (address tokenIn, address tokenOut, uint24 fee) = data .path .decodeFirstPool(); CallbackValidation.verifyCallback(factory, tokenIn, tokenOut, fee); (bool isExactInput, uint256 amountToPay) = amount0Delta > 0 ? (tokenIn < tokenOut, uint256(amount0Delta)) : (tokenOut < tokenIn, uint256(amount1Delta)); if (isExactInput) { pay(tokenIn, data.payer, msg.sender, amountToPay); } else { // either initiate the next swap or pay if (data.path.hasMultiplePools()) { data.path = data.path.skipToken(); exactOutputInternal(amountToPay, msg.sender, 0, data); } else { amountInCached = amountToPay; tokenIn = tokenOut; // swap in/out because exact output swaps are reversed pay(tokenIn, data.payer, msg.sender, amountToPay); } } } /// @dev Performs a single exact input swap function exactInputInternal( uint256 amountIn, address recipient, uint160 sqrtPriceLimitX96, SwapCallbackData memory data ) private returns (uint256 amountOut) { // allow swapping to the router address with address 0 if (recipient == address(0)) recipient = address(this); (address tokenIn, address tokenOut, uint24 fee) = data .path .decodeFirstPool(); bool zeroForOne = tokenIn < tokenOut; (int256 amount0, int256 amount1) = getPool(tokenIn, tokenOut, fee).swap( recipient, zeroForOne, amountIn.toInt256(), sqrtPriceLimitX96 == 0 ? ( zeroForOne ? TickMath.MIN_SQRT_RATIO + 1 : TickMath.MAX_SQRT_RATIO - 1 ) : sqrtPriceLimitX96, abi.encode(data) ); return uint256(-(zeroForOne ? amount1 : amount0)); } /// @inheritdoc ISwapRouter function exactInputSingle( ExactInputSingleParams calldata params ) external payable override checkDeadline(params.deadline) returns (uint256 amountOut) { amountOut = exactInputInternal( params.amountIn, params.recipient, params.sqrtPriceLimitX96, SwapCallbackData({ path: abi.encodePacked( params.tokenIn, params.fee, params.tokenOut ), payer: msg.sender }) ); require(amountOut >= params.amountOutMinimum, "Too little received"); } /// @inheritdoc ISwapRouter function exactInput( ExactInputParams memory params ) external payable override checkDeadline(params.deadline) returns (uint256 amountOut) { address payer = msg.sender; // msg.sender pays for the first hop while (true) { bool hasMultiplePools = params.path.hasMultiplePools(); // the outputs of prior swaps become the inputs to subsequent ones params.amountIn = exactInputInternal( params.amountIn, hasMultiplePools ? address(this) : params.recipient, // for intermediate swaps, this contract custodies 0, SwapCallbackData({ path: params.path.getFirstPool(), // only the first pool in the path is necessary payer: payer }) ); // decide whether to continue or terminate if (hasMultiplePools) { payer = address(this); // at this point, the caller has paid params.path = params.path.skipToken(); } else { amountOut = params.amountIn; break; } } require(amountOut >= params.amountOutMinimum, "Too little received"); } /// @dev Performs a single exact output swap function exactOutputInternal( uint256 amountOut, address recipient, uint160 sqrtPriceLimitX96, SwapCallbackData memory data ) private returns (uint256 amountIn) { // allow swapping to the router address with address 0 if (recipient == address(0)) recipient = address(this); (address tokenOut, address tokenIn, uint24 fee) = data .path .decodeFirstPool(); bool zeroForOne = tokenIn < tokenOut; (int256 amount0Delta, int256 amount1Delta) = getPool( tokenIn, tokenOut, fee ).swap( recipient, zeroForOne, -amountOut.toInt256(), sqrtPriceLimitX96 == 0 ? ( zeroForOne ? TickMath.MIN_SQRT_RATIO + 1 : TickMath.MAX_SQRT_RATIO - 1 ) : sqrtPriceLimitX96, abi.encode(data) ); uint256 amountOutReceived; (amountIn, amountOutReceived) = zeroForOne ? (uint256(amount0Delta), uint256(-amount1Delta)) : (uint256(amount1Delta), uint256(-amount0Delta)); // it's technically possible to not receive the full output amount, // so if no price limit has been specified, require this possibility away if (sqrtPriceLimitX96 == 0) require(amountOutReceived == amountOut); } /// @inheritdoc ISwapRouter function exactOutputSingle( ExactOutputSingleParams calldata params ) external payable override checkDeadline(params.deadline) returns (uint256 amountIn) { // avoid an SLOAD by using the swap return data amountIn = exactOutputInternal( params.amountOut, params.recipient, params.sqrtPriceLimitX96, SwapCallbackData({ path: abi.encodePacked( params.tokenOut, params.fee, params.tokenIn ), payer: msg.sender }) ); require(amountIn <= params.amountInMaximum, "Too much requested"); // has to be reset even though we don't use it in the single hop case amountInCached = DEFAULT_AMOUNT_IN_CACHED; } /// @inheritdoc ISwapRouter function exactOutput( ExactOutputParams calldata params ) external payable override checkDeadline(params.deadline) returns (uint256 amountIn) { // it's okay that the payer is fixed to msg.sender here, as they're only paying for the "final" exact output // swap, which happens first, and subsequent swaps are paid for within nested callback frames exactOutputInternal( params.amountOut, params.recipient, 0, SwapCallbackData({path: params.path, payer: msg.sender}) ); amountIn = amountInCached; require(amountIn <= params.amountInMaximum, "Too much requested"); amountInCached = DEFAULT_AMOUNT_IN_CACHED; } } ================================================ FILE: agent-as-a-service/agent-launchpad/contracts/periphery/base/BlockTimestamp.sol ================================================ // SPDX-License-Identifier: GPL-2.0-or-later pragma solidity ^0.8.0; /// @title Function for getting block timestamp /// @dev Base contract that is overridden for tests abstract contract BlockTimestamp { /// @dev Method that exists purely to be overridden for tests /// @return The current block timestamp function _blockTimestamp() internal view virtual returns (uint256) { return block.timestamp; } } ================================================ FILE: agent-as-a-service/agent-launchpad/contracts/periphery/base/ERC721Permit.sol ================================================ // SPDX-License-Identifier: GPL-2.0-or-later pragma solidity ^0.8.0; import "@openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "../libraries/ChainId.sol"; import "../interfaces/external/IERC1271.sol"; import "../interfaces/IERC721Permit.sol"; import "./BlockTimestamp.sol"; /// @title ERC721 with permit /// @notice Nonfungible tokens that support an approve via signature, i.e. permit abstract contract ERC721Permit is BlockTimestamp, ERC721Upgradeable, IERC721Permit { /// @dev Gets the current nonce for a token ID and then increments it, returning the original value function _getAndIncrementNonce( uint256 tokenId ) internal virtual returns (uint256); /// @dev The hash of the name used in the permit signature verification bytes32 private nameHash; /// @dev The hash of the version string used in the permit signature verification bytes32 private versionHash; function __ERC721Permit_init( string memory name_, string memory symbol_, string memory version_ ) internal initializer { __ERC721_init(name_, symbol_); // nameHash = keccak256(bytes(name_)); versionHash = keccak256(bytes(version_)); } /// @inheritdoc IERC721Permit function DOMAIN_SEPARATOR() public view override returns (bytes32) { return keccak256( abi.encode( // keccak256('EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)') 0x8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f, nameHash, versionHash, ChainId.get(), address(this) ) ); } /// @inheritdoc IERC721Permit /// @dev Value is equal to keccak256("Permit(address spender,uint256 tokenId,uint256 nonce,uint256 deadline)"); bytes32 public constant override PERMIT_TYPEHASH = 0x49ecf333e5b8c95c40fdafc95c1ad136e8914a8fb55e9dc8bb01eaa83a2df9ad; /// @inheritdoc IERC721Permit function permit( address spender, uint256 tokenId, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external payable override { require(_blockTimestamp() <= deadline, "Permit expired"); bytes32 digest = keccak256( abi.encodePacked( "\x19\x01", DOMAIN_SEPARATOR(), keccak256( abi.encode( PERMIT_TYPEHASH, spender, tokenId, _getAndIncrementNonce(tokenId), deadline ) ) ) ); address owner = ownerOf(tokenId); require(spender != owner, "ERC721Permit: approval to current owner"); if (Address.isContract(owner)) { require( IERC1271(owner).isValidSignature( digest, abi.encodePacked(r, s, v) ) == 0x1626ba7e, "Unauthorized" ); } else { address recoveredAddress = ecrecover(digest, v, r, s); require(recoveredAddress != address(0), "Invalid signature"); require(recoveredAddress == owner, "Unauthorized"); } _approve(spender, tokenId); } } ================================================ FILE: agent-as-a-service/agent-launchpad/contracts/periphery/base/LiquidityManagement.sol ================================================ // SPDX-License-Identifier: GPL-2.0-or-later pragma solidity ^0.8.0; import "../../core/interfaces/IUniswapV3Factory.sol"; import "../../core/interfaces/callback/IUniswapV3MintCallback.sol"; import "../../core/libraries/TickMath.sol"; import "../libraries/PoolAddress.sol"; import "../libraries/CallbackValidation.sol"; import "../libraries/LiquidityAmounts.sol"; import "../libraries/UniswapV3Broker.sol"; import "./PeripheryPayments.sol"; import "./PeripheryImmutableState.sol"; /// @title Liquidity management functions /// @notice Internal functions for safely managing liquidity in Uniswap V3 abstract contract LiquidityManagement is IUniswapV3MintCallback, PeripheryImmutableState, PeripheryPayments { /// @inheritdoc IUniswapV3MintCallback function uniswapV3MintCallback( uint256 amount0Owed, uint256 amount1Owed, bytes calldata data ) external override { UniswapV3Broker.MintCallbackData memory decoded = abi.decode( data, (UniswapV3Broker.MintCallbackData) ); CallbackValidation.verifyCallback(factory, decoded.poolKey); if (amount0Owed > 0) pay(decoded.poolKey.token0, decoded.payer, msg.sender, amount0Owed); if (amount1Owed > 0) pay(decoded.poolKey.token1, decoded.payer, msg.sender, amount1Owed); } /// @notice Add liquidity to an initialized pool function addLiquidity( UniswapV3Broker.AddLiquidityParams memory params ) internal returns ( uint128 liquidity, uint256 amount0, uint256 amount1, IUniswapV3Pool pool ) { return UniswapV3Broker.addLiquidity(factory, params); } } ================================================ FILE: agent-as-a-service/agent-launchpad/contracts/periphery/base/Multicall.sol ================================================ // SPDX-License-Identifier: GPL-2.0-or-later pragma solidity ^0.8.0; import '../interfaces/IMulticall.sol'; /// @title Multicall /// @notice Enables calling multiple methods in a single call to the contract abstract contract Multicall is IMulticall { /// @inheritdoc IMulticall function multicall(bytes[] calldata data) public payable override returns (bytes[] memory results) { results = new bytes[](data.length); for (uint256 i = 0; i < data.length; i++) { (bool success, bytes memory result) = address(this).delegatecall(data[i]); if (!success) { // Next 5 lines from https://ethereum.stackexchange.com/a/83577 if (result.length < 68) revert(); assembly { result := add(result, 0x04) } revert(abi.decode(result, (string))); } results[i] = result; } } } ================================================ FILE: agent-as-a-service/agent-launchpad/contracts/periphery/base/PeripheryImmutableState.sol ================================================ // SPDX-License-Identifier: GPL-2.0-or-later pragma solidity ^0.8.0; import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import "../interfaces/IPeripheryImmutableState.sol"; /// @title Immutable state /// @notice Immutable state used by periphery contracts abstract contract PeripheryImmutableState is IPeripheryImmutableState, OwnableUpgradeable { /// @inheritdoc IPeripheryImmutableState address public override factory; /// @inheritdoc IPeripheryImmutableState address public override WETH; function __PeripheryImmutableState_init( address _factory, address _WETH ) internal initializer { __Ownable_init(); // factory = _factory; WETH = _WETH; } function setWETH(address WETHArg) external onlyOwner { WETH = WETHArg; } } ================================================ FILE: agent-as-a-service/agent-launchpad/contracts/periphery/base/PeripheryPayments.sol ================================================ // SPDX-License-Identifier: GPL-2.0-or-later pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "../interfaces/IPeripheryPayments.sol"; import "../../interfaces/IWETH.sol"; import "../libraries/TransferHelper.sol"; import "./PeripheryImmutableState.sol"; abstract contract PeripheryPayments is IPeripheryPayments, PeripheryImmutableState { receive() external payable { require(msg.sender == WETH, "Not WETH"); } /// @inheritdoc IPeripheryPayments function unwrapWETH( uint256 amountMinimum, address recipient ) public payable override { uint256 balanceWETH = IWETH(WETH).balanceOf(address(this)); require(balanceWETH >= amountMinimum, "Insufficient WETH"); if (balanceWETH > 0) { IWETH(WETH).withdraw(balanceWETH); TransferHelper.safeTransferETH(recipient, balanceWETH); } } /// @inheritdoc IPeripheryPayments function sweepToken( address token, uint256 amountMinimum, address recipient ) public payable override { uint256 balanceToken = IERC20(token).balanceOf(address(this)); require(balanceToken >= amountMinimum, "Insufficient token"); if (balanceToken > 0) { TransferHelper.safeTransfer(token, recipient, balanceToken); } } /// @inheritdoc IPeripheryPayments function refundETH() external payable override { if (address(this).balance > 0) TransferHelper.safeTransferETH(msg.sender, address(this).balance); } /// @param token The token to pay /// @param payer The entity that must pay /// @param recipient The entity that will receive payment /// @param value The amount to pay function pay( address token, address payer, address recipient, uint256 value ) internal { if (token == WETH && address(this).balance >= value) { // pay with WETH IWETH(WETH).deposit{value: value}(); // wrap only what is needed to pay IWETH(WETH).transfer(recipient, value); } else if (payer == address(this)) { // pay with tokens already in the contract (for the exact input multihop case) TransferHelper.safeTransfer(token, recipient, value); } else { // pull payment TransferHelper.safeTransferFrom(token, payer, recipient, value); } } } ================================================ FILE: agent-as-a-service/agent-launchpad/contracts/periphery/base/PeripheryPaymentsWithFee.sol ================================================ // SPDX-License-Identifier: GPL-2.0-or-later pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "../../core/libraries/LowGasSafeMath.sol"; import "./PeripheryPayments.sol"; import "../interfaces/IPeripheryPaymentsWithFee.sol"; import "../../interfaces/IWETH.sol"; import "../libraries/TransferHelper.sol"; abstract contract PeripheryPaymentsWithFee is PeripheryPayments, IPeripheryPaymentsWithFee { using LowGasSafeMath for uint256; /// @inheritdoc IPeripheryPaymentsWithFee function unwrapWETHWithFee( uint256 amountMinimum, address recipient, uint256 feeBips, address feeRecipient ) public payable override { require(feeBips > 0 && feeBips <= 100); uint256 balanceWETH = IWETH(WETH).balanceOf(address(this)); require(balanceWETH >= amountMinimum, "Insufficient WETH"); if (balanceWETH > 0) { IWETH(WETH).withdraw(balanceWETH); uint256 feeAmount = balanceWETH.mul(feeBips) / 10_000; if (feeAmount > 0) TransferHelper.safeTransferETH(feeRecipient, feeAmount); TransferHelper.safeTransferETH(recipient, balanceWETH - feeAmount); } } /// @inheritdoc IPeripheryPaymentsWithFee function sweepTokenWithFee( address token, uint256 amountMinimum, address recipient, uint256 feeBips, address feeRecipient ) public payable override { require(feeBips > 0 && feeBips <= 100); uint256 balanceToken = IERC20(token).balanceOf(address(this)); require(balanceToken >= amountMinimum, "Insufficient token"); if (balanceToken > 0) { uint256 feeAmount = balanceToken.mul(feeBips) / 10_000; if (feeAmount > 0) TransferHelper.safeTransfer(token, feeRecipient, feeAmount); TransferHelper.safeTransfer( token, recipient, balanceToken - feeAmount ); } } } ================================================ FILE: agent-as-a-service/agent-launchpad/contracts/periphery/base/PeripheryValidation.sol ================================================ // SPDX-License-Identifier: GPL-2.0-or-later pragma solidity ^0.8.0; import './BlockTimestamp.sol'; abstract contract PeripheryValidation is BlockTimestamp { modifier checkDeadline(uint256 deadline) { require(_blockTimestamp() <= deadline, 'Transaction too old'); _; } } ================================================ FILE: agent-as-a-service/agent-launchpad/contracts/periphery/base/PoolInitializer.sol ================================================ // SPDX-License-Identifier: GPL-2.0-or-later pragma solidity ^0.8.0; import '../../core/interfaces/IUniswapV3Factory.sol'; import '../../core/interfaces/IUniswapV3Pool.sol'; import './PeripheryImmutableState.sol'; import '../interfaces/IPoolInitializer.sol'; /// @title Creates and initializes V3 Pools abstract contract PoolInitializer is IPoolInitializer, PeripheryImmutableState { /// @inheritdoc IPoolInitializer function createAndInitializePoolIfNecessary( address token0, address token1, uint24 fee, uint160 sqrtPriceX96 ) external payable override returns (address pool) { require(token0 < token1); pool = IUniswapV3Factory(factory).getPool(token0, token1, fee); if (pool == address(0)) { pool = IUniswapV3Factory(factory).createPool(token0, token1, fee); IUniswapV3Pool(pool).initialize(sqrtPriceX96); } else { (uint160 sqrtPriceX96Existing, , , , , , ) = IUniswapV3Pool(pool).slot0(); if (sqrtPriceX96Existing == 0) { IUniswapV3Pool(pool).initialize(sqrtPriceX96); } } } } ================================================ FILE: agent-as-a-service/agent-launchpad/contracts/periphery/base/SelfPermit.sol ================================================ // SPDX-License-Identifier: GPL-2.0-or-later pragma solidity ^0.8.0; import '@openzeppelin/contracts/token/ERC20/IERC20.sol'; import '@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol'; import '../interfaces/ISelfPermit.sol'; import '../interfaces/external/IERC20PermitAllowed.sol'; /// @title Self Permit /// @notice Functionality to call permit on any EIP-2612-compliant token for use in the route /// @dev These functions are expected to be embedded in multicalls to allow EOAs to approve a contract and call a function /// that requires an approval in a single transaction. abstract contract SelfPermit is ISelfPermit { /// @inheritdoc ISelfPermit function selfPermit( address token, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) public payable override { IERC20Permit(token).permit(msg.sender, address(this), value, deadline, v, r, s); } /// @inheritdoc ISelfPermit function selfPermitIfNecessary( address token, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external payable override { if (IERC20(token).allowance(msg.sender, address(this)) < value) selfPermit(token, value, deadline, v, r, s); } /// @inheritdoc ISelfPermit function selfPermitAllowed( address token, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s ) public payable override { IERC20PermitAllowed(token).permit(msg.sender, address(this), nonce, expiry, true, v, r, s); } /// @inheritdoc ISelfPermit function selfPermitAllowedIfNecessary( address token, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s ) external payable override { if (IERC20(token).allowance(msg.sender, address(this)) < type(uint256).max) selfPermitAllowed(token, nonce, expiry, v, r, s); } } ================================================ FILE: agent-as-a-service/agent-launchpad/contracts/periphery/interfaces/IERC20Metadata.sol ================================================ // SPDX-License-Identifier: GPL-2.0-or-later pragma solidity ^0.8.0; import '@openzeppelin/contracts/token/ERC20/IERC20.sol'; /// @title IERC20Metadata /// @title Interface for ERC20 Metadata /// @notice Extension to IERC20 that includes token metadata interface IERC20Metadata is IERC20 { /// @return The name of the token function name() external view returns (string memory); /// @return The symbol of the token function symbol() external view returns (string memory); /// @return The number of decimal places the token has function decimals() external view returns (uint8); } ================================================ FILE: agent-as-a-service/agent-launchpad/contracts/periphery/interfaces/IERC721Permit.sol ================================================ // SPDX-License-Identifier: GPL-2.0-or-later pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; /// @title ERC721 with permit /// @notice Extension to ERC721 that includes a permit function for signature based approvals interface IERC721Permit { /// @notice The permit typehash used in the permit signature /// @return The typehash for the permit function PERMIT_TYPEHASH() external pure returns (bytes32); /// @notice The domain separator used in the permit signature /// @return The domain seperator used in encoding of permit signature function DOMAIN_SEPARATOR() external view returns (bytes32); /// @notice Approve of a specific token ID for spending by spender via signature /// @param spender The account that is being approved /// @param tokenId The ID of the token that is being approved for spending /// @param deadline The deadline timestamp by which the call must be mined for the approve to work /// @param v Must produce valid secp256k1 signature from the holder along with `r` and `s` /// @param r Must produce valid secp256k1 signature from the holder along with `v` and `s` /// @param s Must produce valid secp256k1 signature from the holder along with `r` and `v` function permit( address spender, uint256 tokenId, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external payable; } ================================================ FILE: agent-as-a-service/agent-launchpad/contracts/periphery/interfaces/IMulticall.sol ================================================ // SPDX-License-Identifier: GPL-2.0-or-later pragma solidity ^0.8.0; pragma abicoder v2; /// @title Multicall interface /// @notice Enables calling multiple methods in a single call to the contract interface IMulticall { /// @notice Call multiple functions in the current contract and return the data from all of them if they all succeed /// @dev The `msg.value` should not be trusted for any method callable from multicall. /// @param data The encoded function data for each of the calls to make to this contract /// @return results The results from each of the calls passed in via data function multicall(bytes[] calldata data) external payable returns (bytes[] memory results); } ================================================ FILE: agent-as-a-service/agent-launchpad/contracts/periphery/interfaces/INonfungiblePositionManager.sol ================================================ // SPDX-License-Identifier: GPL-2.0-or-later pragma solidity ^0.8.0; import "@openzeppelin/contracts-upgradeable/token/ERC721/extensions/IERC721MetadataUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC721/extensions/IERC721EnumerableUpgradeable.sol"; import "../libraries/UniswapV3Broker.sol"; import "./IPoolInitializer.sol"; import "./IERC721Permit.sol"; import "./IPeripheryPayments.sol"; import "./IPeripheryImmutableState.sol"; import "../libraries/PoolAddress.sol"; /// @title Non-fungible token for positions /// @notice Wraps Uniswap V3 positions in a non-fungible token interface which allows for them to be transferred /// and authorized. interface INonfungiblePositionManager is IPoolInitializer, IPeripheryPayments, IPeripheryImmutableState, IERC721MetadataUpgradeable, // IERC721EnumerableUpgradeable, IERC721Permit { /// @notice Emitted when liquidity is increased for a position NFT /// @dev Also emitted when a token is minted /// @param tokenId The ID of the token for which liquidity was increased /// @param liquidity The amount by which liquidity for the NFT position was increased /// @param amount0 The amount of token0 that was paid for the increase in liquidity /// @param amount1 The amount of token1 that was paid for the increase in liquidity event IncreaseLiquidity( uint256 indexed tokenId, uint128 liquidity, uint256 amount0, uint256 amount1 ); /// @notice Emitted when liquidity is decreased for a position NFT /// @param tokenId The ID of the token for which liquidity was decreased /// @param liquidity The amount by which liquidity for the NFT position was decreased /// @param amount0 The amount of token0 that was accounted for the decrease in liquidity /// @param amount1 The amount of token1 that was accounted for the decrease in liquidity event DecreaseLiquidity( uint256 indexed tokenId, uint128 liquidity, uint256 amount0, uint256 amount1 ); /// @notice Emitted when tokens are collected for a position NFT /// @dev The amounts reported may not be exactly equivalent to the amounts transferred, due to rounding behavior /// @param tokenId The ID of the token for which underlying tokens were collected /// @param recipient The address of the account that received the collected tokens /// @param amount0 The amount of token0 owed to the position that was collected /// @param amount1 The amount of token1 owed to the position that was collected event Collect( uint256 indexed tokenId, address recipient, uint256 amount0, uint256 amount1 ); /// @notice Returns the position information associated with a given token ID. /// @dev Throws if the token ID is not valid. /// @param tokenId The ID of the token that represents the position /// @return nonce The nonce for permits /// @return operator The address that is approved for spending /// @return token0 The address of the token0 for a specific pool /// @return token1 The address of the token1 for a specific pool /// @return fee The fee associated with the pool /// @return tickLower The lower end of the tick range for the position /// @return tickUpper The higher end of the tick range for the position /// @return liquidity The liquidity of the position /// @return feeGrowthInside0LastX128 The fee growth of token0 as of the last action on the individual position /// @return feeGrowthInside1LastX128 The fee growth of token1 as of the last action on the individual position /// @return tokensOwed0 The uncollected amount of token0 owed to the position as of the last computation /// @return tokensOwed1 The uncollected amount of token1 owed to the position as of the last computation function positions( uint256 tokenId ) external view returns ( uint96 nonce, address operator, address token0, address token1, uint24 fee, int24 tickLower, int24 tickUpper, uint128 liquidity, uint256 feeGrowthInside0LastX128, uint256 feeGrowthInside1LastX128, uint128 tokensOwed0, uint128 tokensOwed1 ); struct MintParams { address token0; address token1; uint24 fee; int24 tickLower; int24 tickUpper; uint256 amount0Desired; uint256 amount1Desired; uint256 amount0Min; uint256 amount1Min; address recipient; uint256 deadline; } /// @notice Creates a new position wrapped in a NFT /// @dev Call this when the pool does exist and is initialized. Note that if the pool is created but not initialized /// a method does not exist, i.e. the pool is assumed to be initialized. /// @param params The params necessary to mint a position, encoded as `MintParams` in calldata /// @return tokenId The ID of the token that represents the minted position /// @return liquidity The amount of liquidity for this position /// @return amount0 The amount of token0 /// @return amount1 The amount of token1 function mint( MintParams calldata params ) external payable returns ( uint256 tokenId, uint128 liquidity, uint256 amount0, uint256 amount1 ); // struct IncreaseLiquidityParams { // uint256 tokenId; // uint256 amount0Desired; // uint256 amount1Desired; // uint256 amount0Min; // uint256 amount1Min; // uint256 deadline; // } /// @notice Increases the amount of liquidity in a position, with tokens paid by the `msg.sender` /// @param params tokenId The ID of the token for which liquidity is being increased, /// amount0Desired The desired amount of token0 to be spent, /// amount1Desired The desired amount of token1 to be spent, /// amount0Min The minimum amount of token0 to spend, which serves as a slippage check, /// amount1Min The minimum amount of token1 to spend, which serves as a slippage check, /// deadline The time by which the transaction must be included to effect the change /// @return liquidity The new liquidity amount as a result of the increase /// @return amount0 The amount of token0 to acheive resulting liquidity /// @return amount1 The amount of token1 to acheive resulting liquidity function increaseLiquidity( UniswapV3Broker.IncreaseLiquidityParams calldata params ) external payable returns (uint128 liquidity, uint256 amount0, uint256 amount1); struct DecreaseLiquidityParams { uint256 tokenId; uint128 liquidity; uint256 amount0Min; uint256 amount1Min; uint256 deadline; } /// @notice Decreases the amount of liquidity in a position and accounts it to the position /// @param params tokenId The ID of the token for which liquidity is being decreased, /// amount The amount by which liquidity will be decreased, /// amount0Min The minimum amount of token0 that should be accounted for the burned liquidity, /// amount1Min The minimum amount of token1 that should be accounted for the burned liquidity, /// deadline The time by which the transaction must be included to effect the change /// @return amount0 The amount of token0 accounted to the position's tokens owed /// @return amount1 The amount of token1 accounted to the position's tokens owed function decreaseLiquidity( UniswapV3Broker.DecreaseLiquidityParams calldata params ) external payable returns (uint256 amount0, uint256 amount1); struct CollectParams { uint256 tokenId; address recipient; uint128 amount0Max; uint128 amount1Max; } /// @notice Collects up to a maximum amount of fees owed to a specific position to the recipient /// @param params tokenId The ID of the NFT for which tokens are being collected, /// recipient The account that should receive the tokens, /// amount0Max The maximum amount of token0 to collect, /// amount1Max The maximum amount of token1 to collect /// @return amount0 The amount of fees collected in token0 /// @return amount1 The amount of fees collected in token1 function collect( UniswapV3Broker.CollectParams calldata params ) external payable returns (uint256 amount0, uint256 amount1); /// @notice Burns a token ID, which deletes it from the NFT contract. The token must have 0 liquidity and all tokens /// must be collected first. /// @param tokenId The ID of the token that is being burned function burn(uint256 tokenId) external payable; } ================================================ FILE: agent-as-a-service/agent-launchpad/contracts/periphery/interfaces/INonfungibleTokenPositionDescriptor.sol ================================================ // SPDX-License-Identifier: GPL-2.0-or-later pragma solidity ^0.8.0; import './INonfungiblePositionManager.sol'; /// @title Describes position NFT tokens via URI interface INonfungibleTokenPositionDescriptor { /// @notice Produces the URI describing a particular token ID for a position manager /// @dev Note this URI may be a data: URI with the JSON contents directly inlined /// @param positionManager The position manager for which to describe the token /// @param tokenId The ID of the token for which to produce a description, which may not be valid /// @return The URI of the ERC721-compliant metadata function tokenURI(INonfungiblePositionManager positionManager, uint256 tokenId) external view returns (string memory); } ================================================ FILE: agent-as-a-service/agent-launchpad/contracts/periphery/interfaces/IPeripheryImmutableState.sol ================================================ // SPDX-License-Identifier: GPL-2.0-or-later pragma solidity ^0.8.0; /// @title Immutable state /// @notice Functions that return immutable state of the router interface IPeripheryImmutableState { /// @return Returns the address of the Uniswap V3 factory function factory() external view returns (address); /// @return Returns the address of WETH function WETH() external view returns (address); } ================================================ FILE: agent-as-a-service/agent-launchpad/contracts/periphery/interfaces/IPeripheryPayments.sol ================================================ // SPDX-License-Identifier: GPL-2.0-or-later pragma solidity ^0.8.0; /// @title Periphery Payments /// @notice Functions to ease deposits and withdrawals of TC interface IPeripheryPayments { /// @notice Unwraps the contract's WETH balance and sends it to recipient as TC. /// @dev The amountMinimum parameter prevents malicious contracts from stealing WETH from users. /// @param amountMinimum The minimum amount of WETH to unwrap /// @param recipient The address receiving TC function unwrapWETH( uint256 amountMinimum, address recipient ) external payable; /// @notice Refunds any TC balance held by this contract to the `msg.sender` /// @dev Useful for bundling with mint or increase liquidity that uses ether, or exact output swaps /// that use ether for the input amount function refundETH() external payable; /// @notice Transfers the full amount of a token held by this contract to recipient /// @dev The amountMinimum parameter prevents malicious contracts from stealing the token from users /// @param token The contract address of the token which will be transferred to `recipient` /// @param amountMinimum The minimum amount of token required for a transfer /// @param recipient The destination address of the token function sweepToken( address token, uint256 amountMinimum, address recipient ) external payable; } ================================================ FILE: agent-as-a-service/agent-launchpad/contracts/periphery/interfaces/IPeripheryPaymentsWithFee.sol ================================================ // SPDX-License-Identifier: GPL-2.0-or-later pragma solidity ^0.8.0; import './IPeripheryPayments.sol'; /// @title Periphery Payments /// @notice Functions to ease deposits and withdrawals of TC interface IPeripheryPaymentsWithFee is IPeripheryPayments { /// @notice Unwraps the contract's WETH balance and sends it to recipient as TC, with a percentage between /// 0 (exclusive), and 1 (inclusive) going to feeRecipient /// @dev The amountMinimum parameter prevents malicious contracts from stealing WETH from users. function unwrapWETHWithFee( uint256 amountMinimum, address recipient, uint256 feeBips, address feeRecipient ) external payable; /// @notice Transfers the full amount of a token held by this contract to recipient, with a percentage between /// 0 (exclusive) and 1 (inclusive) going to feeRecipient /// @dev The amountMinimum parameter prevents malicious contracts from stealing the token from users function sweepTokenWithFee( address token, uint256 amountMinimum, address recipient, uint256 feeBips, address feeRecipient ) external payable; } ================================================ FILE: agent-as-a-service/agent-launchpad/contracts/periphery/interfaces/IPoolInitializer.sol ================================================ // SPDX-License-Identifier: GPL-2.0-or-later pragma solidity ^0.8.0; pragma abicoder v2; /// @title Creates and initializes V3 Pools /// @notice Provides a method for creating and initializing a pool, if necessary, for bundling with other methods that /// require the pool to exist. interface IPoolInitializer { /// @notice Creates a new pool if it does not exist, then initializes if not initialized /// @dev This method can be bundled with others via IMulticall for the first action (e.g. mint) performed against a pool /// @param token0 The contract address of token0 of the pool /// @param token1 The contract address of token1 of the pool /// @param fee The fee amount of the v3 pool for the specified token pair /// @param sqrtPriceX96 The initial square root price of the pool as a Q64.96 value /// @return pool Returns the pool address based on the pair of tokens and fee, will return the newly created pool address if necessary function createAndInitializePoolIfNecessary( address token0, address token1, uint24 fee, uint160 sqrtPriceX96 ) external payable returns (address pool); } ================================================ FILE: agent-as-a-service/agent-launchpad/contracts/periphery/interfaces/IQuoter.sol ================================================ // SPDX-License-Identifier: GPL-2.0-or-later pragma solidity ^0.8.0; pragma abicoder v2; /// @title Quoter Interface /// @notice Supports quoting the calculated amounts from exact input or exact output swaps /// @dev These functions are not marked view because they rely on calling non-view functions and reverting /// to compute the result. They are also not gas efficient and should not be called on-chain. interface IQuoter { /// @notice Returns the amount out received for a given exact input swap without executing the swap /// @param path The path of the swap, i.e. each token pair and the pool fee /// @param amountIn The amount of the first token to swap /// @return amountOut The amount of the last token that would be received function quoteExactInput(bytes memory path, uint256 amountIn) external returns (uint256 amountOut); /// @notice Returns the amount out received for a given exact input but for a swap of a single pool /// @param tokenIn The token being swapped in /// @param tokenOut The token being swapped out /// @param fee The fee of the token pool to consider for the pair /// @param amountIn The desired input amount /// @param sqrtPriceLimitX96 The price limit of the pool that cannot be exceeded by the swap /// @return amountOut The amount of `tokenOut` that would be received function quoteExactInputSingle( address tokenIn, address tokenOut, uint24 fee, uint256 amountIn, uint160 sqrtPriceLimitX96 ) external returns (uint256 amountOut); /// @notice Returns the amount in required for a given exact output swap without executing the swap /// @param path The path of the swap, i.e. each token pair and the pool fee. Path must be provided in reverse order /// @param amountOut The amount of the last token to receive /// @return amountIn The amount of first token required to be paid function quoteExactOutput(bytes memory path, uint256 amountOut) external returns (uint256 amountIn); /// @notice Returns the amount in required to receive the given exact output amount but for a swap of a single pool /// @param tokenIn The token being swapped in /// @param tokenOut The token being swapped out /// @param fee The fee of the token pool to consider for the pair /// @param amountOut The desired output amount /// @param sqrtPriceLimitX96 The price limit of the pool that cannot be exceeded by the swap /// @return amountIn The amount required as the input for the swap in order to receive `amountOut` function quoteExactOutputSingle( address tokenIn, address tokenOut, uint24 fee, uint256 amountOut, uint160 sqrtPriceLimitX96 ) external returns (uint256 amountIn); } ================================================ FILE: agent-as-a-service/agent-launchpad/contracts/periphery/interfaces/IQuoterV2.sol ================================================ // SPDX-License-Identifier: GPL-2.0-or-later pragma solidity ^0.8.0; pragma abicoder v2; /// @title QuoterV2 Interface /// @notice Supports quoting the calculated amounts from exact input or exact output swaps. /// @notice For each pool also tells you the number of initialized ticks crossed and the sqrt price of the pool after the swap. /// @dev These functions are not marked view because they rely on calling non-view functions and reverting /// to compute the result. They are also not gas efficient and should not be called on-chain. interface IQuoterV2 { /// @notice Returns the amount out received for a given exact input swap without executing the swap /// @param path The path of the swap, i.e. each token pair and the pool fee /// @param amountIn The amount of the first token to swap /// @return amountOut The amount of the last token that would be received /// @return sqrtPriceX96AfterList List of the sqrt price after the swap for each pool in the path /// @return initializedTicksCrossedList List of the initialized ticks that the swap crossed for each pool in the path /// @return gasEstimate The estimate of the gas that the swap consumes function quoteExactInput(bytes memory path, uint256 amountIn) external returns ( uint256 amountOut, uint160[] memory sqrtPriceX96AfterList, uint32[] memory initializedTicksCrossedList, uint256 gasEstimate ); struct QuoteExactInputSingleParams { address tokenIn; address tokenOut; uint256 amountIn; uint24 fee; uint160 sqrtPriceLimitX96; } /// @notice Returns the amount out received for a given exact input but for a swap of a single pool /// @param params The params for the quote, encoded as `QuoteExactInputSingleParams` /// tokenIn The token being swapped in /// tokenOut The token being swapped out /// fee The fee of the token pool to consider for the pair /// amountIn The desired input amount /// sqrtPriceLimitX96 The price limit of the pool that cannot be exceeded by the swap /// @return amountOut The amount of `tokenOut` that would be received /// @return sqrtPriceX96After The sqrt price of the pool after the swap /// @return initializedTicksCrossed The number of initialized ticks that the swap crossed /// @return gasEstimate The estimate of the gas that the swap consumes function quoteExactInputSingle(QuoteExactInputSingleParams memory params) external returns ( uint256 amountOut, uint160 sqrtPriceX96After, uint32 initializedTicksCrossed, uint256 gasEstimate ); /// @notice Returns the amount in required for a given exact output swap without executing the swap /// @param path The path of the swap, i.e. each token pair and the pool fee. Path must be provided in reverse order /// @param amountOut The amount of the last token to receive /// @return amountIn The amount of first token required to be paid /// @return sqrtPriceX96AfterList List of the sqrt price after the swap for each pool in the path /// @return initializedTicksCrossedList List of the initialized ticks that the swap crossed for each pool in the path /// @return gasEstimate The estimate of the gas that the swap consumes function quoteExactOutput(bytes memory path, uint256 amountOut) external returns ( uint256 amountIn, uint160[] memory sqrtPriceX96AfterList, uint32[] memory initializedTicksCrossedList, uint256 gasEstimate ); struct QuoteExactOutputSingleParams { address tokenIn; address tokenOut; uint256 amount; uint24 fee; uint160 sqrtPriceLimitX96; } /// @notice Returns the amount in required to receive the given exact output amount but for a swap of a single pool /// @param params The params for the quote, encoded as `QuoteExactOutputSingleParams` /// tokenIn The token being swapped in /// tokenOut The token being swapped out /// fee The fee of the token pool to consider for the pair /// amountOut The desired output amount /// sqrtPriceLimitX96 The price limit of the pool that cannot be exceeded by the swap /// @return amountIn The amount required as the input for the swap in order to receive `amountOut` /// @return sqrtPriceX96After The sqrt price of the pool after the swap /// @return initializedTicksCrossed The number of initialized ticks that the swap crossed /// @return gasEstimate The estimate of the gas that the swap consumes function quoteExactOutputSingle(QuoteExactOutputSingleParams memory params) external returns ( uint256 amountIn, uint160 sqrtPriceX96After, uint32 initializedTicksCrossed, uint256 gasEstimate ); } ================================================ FILE: agent-as-a-service/agent-launchpad/contracts/periphery/interfaces/ISelfPermit.sol ================================================ // SPDX-License-Identifier: GPL-2.0-or-later pragma solidity ^0.8.0; /// @title Self Permit /// @notice Functionality to call permit on any EIP-2612-compliant token for use in the route interface ISelfPermit { /// @notice Permits this contract to spend a given token from `msg.sender` /// @dev The `owner` is always msg.sender and the `spender` is always address(this). /// @param token The address of the token spent /// @param value The amount that can be spent of token /// @param deadline A timestamp, the current blocktime must be less than or equal to this timestamp /// @param v Must produce valid secp256k1 signature from the holder along with `r` and `s` /// @param r Must produce valid secp256k1 signature from the holder along with `v` and `s` /// @param s Must produce valid secp256k1 signature from the holder along with `r` and `v` function selfPermit( address token, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external payable; /// @notice Permits this contract to spend a given token from `msg.sender` /// @dev The `owner` is always msg.sender and the `spender` is always address(this). /// Can be used instead of #selfPermit to prevent calls from failing due to a frontrun of a call to #selfPermit /// @param token The address of the token spent /// @param value The amount that can be spent of token /// @param deadline A timestamp, the current blocktime must be less than or equal to this timestamp /// @param v Must produce valid secp256k1 signature from the holder along with `r` and `s` /// @param r Must produce valid secp256k1 signature from the holder along with `v` and `s` /// @param s Must produce valid secp256k1 signature from the holder along with `r` and `v` function selfPermitIfNecessary( address token, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external payable; /// @notice Permits this contract to spend the sender's tokens for permit signatures that have the `allowed` parameter /// @dev The `owner` is always msg.sender and the `spender` is always address(this) /// @param token The address of the token spent /// @param nonce The current nonce of the owner /// @param expiry The timestamp at which the permit is no longer valid /// @param v Must produce valid secp256k1 signature from the holder along with `r` and `s` /// @param r Must produce valid secp256k1 signature from the holder along with `v` and `s` /// @param s Must produce valid secp256k1 signature from the holder along with `r` and `v` function selfPermitAllowed( address token, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s ) external payable; /// @notice Permits this contract to spend the sender's tokens for permit signatures that have the `allowed` parameter /// @dev The `owner` is always msg.sender and the `spender` is always address(this) /// Can be used instead of #selfPermitAllowed to prevent calls from failing due to a frontrun of a call to #selfPermitAllowed. /// @param token The address of the token spent /// @param nonce The current nonce of the owner /// @param expiry The timestamp at which the permit is no longer valid /// @param v Must produce valid secp256k1 signature from the holder along with `r` and `s` /// @param r Must produce valid secp256k1 signature from the holder along with `v` and `s` /// @param s Must produce valid secp256k1 signature from the holder along with `r` and `v` function selfPermitAllowedIfNecessary( address token, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s ) external payable; } ================================================ FILE: agent-as-a-service/agent-launchpad/contracts/periphery/interfaces/ISwapRouter.sol ================================================ // SPDX-License-Identifier: GPL-2.0-or-later pragma solidity ^0.8.0; pragma abicoder v2; import '../../core/interfaces/callback/IUniswapV3SwapCallback.sol'; /// @title Router token swapping functionality /// @notice Functions for swapping tokens via Uniswap V3 interface ISwapRouter is IUniswapV3SwapCallback { struct ExactInputSingleParams { address tokenIn; address tokenOut; uint24 fee; address recipient; uint256 deadline; uint256 amountIn; uint256 amountOutMinimum; uint160 sqrtPriceLimitX96; } /// @notice Swaps `amountIn` of one token for as much as possible of another token /// @param params The parameters necessary for the swap, encoded as `ExactInputSingleParams` in calldata /// @return amountOut The amount of the received token function exactInputSingle(ExactInputSingleParams calldata params) external payable returns (uint256 amountOut); struct ExactInputParams { bytes path; address recipient; uint256 deadline; uint256 amountIn; uint256 amountOutMinimum; } /// @notice Swaps `amountIn` of one token for as much as possible of another along the specified path /// @param params The parameters necessary for the multi-hop swap, encoded as `ExactInputParams` in calldata /// @return amountOut The amount of the received token function exactInput(ExactInputParams calldata params) external payable returns (uint256 amountOut); struct ExactOutputSingleParams { address tokenIn; address tokenOut; uint24 fee; address recipient; uint256 deadline; uint256 amountOut; uint256 amountInMaximum; uint160 sqrtPriceLimitX96; } /// @notice Swaps as little as possible of one token for `amountOut` of another token /// @param params The parameters necessary for the swap, encoded as `ExactOutputSingleParams` in calldata /// @return amountIn The amount of the input token function exactOutputSingle(ExactOutputSingleParams calldata params) external payable returns (uint256 amountIn); struct ExactOutputParams { bytes path; address recipient; uint256 deadline; uint256 amountOut; uint256 amountInMaximum; } /// @notice Swaps as little as possible of one token for `amountOut` of another along the specified path (reversed) /// @param params The parameters necessary for the multi-hop swap, encoded as `ExactOutputParams` in calldata /// @return amountIn The amount of the input token function exactOutput(ExactOutputParams calldata params) external payable returns (uint256 amountIn); } ================================================ FILE: agent-as-a-service/agent-launchpad/contracts/periphery/interfaces/ITickLens.sol ================================================ // SPDX-License-Identifier: GPL-2.0-or-later pragma solidity ^0.8.0; pragma abicoder v2; /// @title Tick Lens /// @notice Provides functions for fetching chunks of tick data for a pool /// @dev This avoids the waterfall of fetching the tick bitmap, parsing the bitmap to know which ticks to fetch, and /// then sending additional multicalls to fetch the tick data interface ITickLens { struct PopulatedTick { int24 tick; int128 liquidityNet; uint128 liquidityGross; } /// @notice Get all the tick data for the populated ticks from a word of the tick bitmap of a pool /// @param pool The address of the pool for which to fetch populated tick data /// @param tickBitmapIndex The index of the word in the tick bitmap for which to parse the bitmap and /// fetch all the populated ticks /// @return populatedTicks An array of tick data for the given word in the tick bitmap function getPopulatedTicksInWord(address pool, int16 tickBitmapIndex) external view returns (PopulatedTick[] memory populatedTicks); } ================================================ FILE: agent-as-a-service/agent-launchpad/contracts/periphery/interfaces/IV3Migrator.sol ================================================ // SPDX-License-Identifier: GPL-2.0-or-later pragma solidity ^0.8.0; pragma abicoder v2; import './IMulticall.sol'; import './ISelfPermit.sol'; import './IPoolInitializer.sol'; /// @title V3 Migrator /// @notice Enables migration of liqudity from Uniswap v2-compatible pairs into Uniswap v3 pools interface IV3Migrator is IMulticall, ISelfPermit, IPoolInitializer { struct MigrateParams { address pair; // the Uniswap v2-compatible pair uint256 liquidityToMigrate; // expected to be balanceOf(msg.sender) uint8 percentageToMigrate; // represented as a numerator over 100 address token0; address token1; uint24 fee; int24 tickLower; int24 tickUpper; uint256 amount0Min; // must be discounted by percentageToMigrate uint256 amount1Min; // must be discounted by percentageToMigrate address recipient; uint256 deadline; bool refundAsTC; } /// @notice Migrates liquidity to v3 by burning v2 liquidity and minting a new position for v3 /// @dev Slippage protection is enforced via `amount{0,1}Min`, which should be a discount of the expected values of /// the maximum amount of v3 liquidity that the v2 liquidity can get. For the special case of migrating to an /// out-of-range position, `amount{0,1}Min` may be set to 0, enforcing that the position remains out of range /// @param params The params necessary to migrate v2 liquidity, encoded as `MigrateParams` in calldata function migrate(MigrateParams calldata params) external; } ================================================ FILE: agent-as-a-service/agent-launchpad/contracts/periphery/interfaces/external/IERC1271.sol ================================================ // SPDX-License-Identifier: GPL-2.0-or-later pragma solidity ^0.8.0; /// @title Interface for verifying contract-based account signatures /// @notice Interface that verifies provided signature for the data /// @dev Interface defined by EIP-1271 interface IERC1271 { /// @notice Returns whether the provided signature is valid for the provided data /// @dev MUST return the bytes4 magic value 0x1626ba7e when function passes. /// MUST NOT modify state (using STATICCALL for solc < 0.5, view modifier for solc > 0.5). /// MUST allow external calls. /// @param hash Hash of the data to be signed /// @param signature Signature byte array associated with _data /// @return magicValue The bytes4 magic value 0x1626ba7e function isValidSignature(bytes32 hash, bytes memory signature) external view returns (bytes4 magicValue); } ================================================ FILE: agent-as-a-service/agent-launchpad/contracts/periphery/interfaces/external/IERC20PermitAllowed.sol ================================================ // SPDX-License-Identifier: GPL-2.0-or-later pragma solidity ^0.8.0; /// @title Interface for permit /// @notice Interface used by DAI/CHAI for permit interface IERC20PermitAllowed { /// @notice Approve the spender to spend some tokens via the holder signature /// @dev This is the permit interface used by DAI and CHAI /// @param holder The address of the token holder, the token owner /// @param spender The address of the token spender /// @param nonce The holder's nonce, increases at each call to permit /// @param expiry The timestamp at which the permit is no longer valid /// @param allowed Boolean that sets approval amount, true for type(uint256).max and false for 0 /// @param v Must produce valid secp256k1 signature from the holder along with `r` and `s` /// @param r Must produce valid secp256k1 signature from the holder along with `v` and `s` /// @param s Must produce valid secp256k1 signature from the holder along with `r` and `v` function permit( address holder, address spender, uint256 nonce, uint256 expiry, bool allowed, uint8 v, bytes32 r, bytes32 s ) external; } ================================================ FILE: agent-as-a-service/agent-launchpad/contracts/periphery/lens/Quoter.sol ================================================ // SPDX-License-Identifier: GPL-2.0-or-later pragma solidity ^0.8.0; import "../../core/libraries/SafeCast.sol"; import "../../core/libraries/TickMath.sol"; import "../../core/interfaces/IUniswapV3Pool.sol"; import "../../core/interfaces/callback/IUniswapV3SwapCallback.sol"; import "../interfaces/IQuoter.sol"; import "../base/PeripheryImmutableState.sol"; import "../libraries/Path.sol"; import "../libraries/PoolAddress.sol"; import "../libraries/CallbackValidation.sol"; /// @title Provides quotes for swaps /// @notice Allows getting the expected amount out or amount in for a given swap without executing the swap /// @dev These functions are not gas efficient and should _not_ be called on chain. Instead, optimistically execute /// the swap and check the amounts in the callback. contract Quoter is IQuoter, IUniswapV3SwapCallback, PeripheryImmutableState { using Path for bytes; using SafeCast for uint256; /// @dev Transient storage variable used to check a safety condition in exact output swaps. uint256 private amountOutCached; function initialize(address _factory, address _WETH) external initializer { __PeripheryImmutableState_init(_factory, _WETH); } function getPool( address tokenA, address tokenB, uint24 fee ) private view returns (IUniswapV3Pool) { return IUniswapV3Pool( PoolAddress.computeAddress( factory, PoolAddress.getPoolKey(tokenA, tokenB, fee) ) ); } /// @inheritdoc IUniswapV3SwapCallback function uniswapV3SwapCallback( int256 amount0Delta, int256 amount1Delta, bytes memory path ) external view override { require(amount0Delta > 0 || amount1Delta > 0); // swaps entirely within 0-liquidity regions are not supported (address tokenIn, address tokenOut, uint24 fee) = path .decodeFirstPool(); CallbackValidation.verifyCallback(factory, tokenIn, tokenOut, fee); ( bool isExactInput, uint256 amountToPay, uint256 amountReceived ) = amount0Delta > 0 ? ( tokenIn < tokenOut, uint256(amount0Delta), uint256(-amount1Delta) ) : ( tokenOut < tokenIn, uint256(amount1Delta), uint256(-amount0Delta) ); if (isExactInput) { assembly { let ptr := mload(0x40) mstore(ptr, amountReceived) revert(ptr, 32) } } else { // if the cache has been populated, ensure that the full output amount has been received if (amountOutCached != 0) require(amountReceived == amountOutCached); assembly { let ptr := mload(0x40) mstore(ptr, amountToPay) revert(ptr, 32) } } } /// @dev Parses a revert reason that should contain the numeric quote function parseRevertReason( bytes memory reason ) private pure returns (uint256) { if (reason.length != 32) { if (reason.length < 68) revert("Unexpected error"); assembly { reason := add(reason, 0x04) } revert(abi.decode(reason, (string))); } return abi.decode(reason, (uint256)); } /// @inheritdoc IQuoter function quoteExactInputSingle( address tokenIn, address tokenOut, uint24 fee, uint256 amountIn, uint160 sqrtPriceLimitX96 ) public override returns (uint256 amountOut) { bool zeroForOne = tokenIn < tokenOut; try getPool(tokenIn, tokenOut, fee).swap( address(this), // address(0) might cause issues with some tokens zeroForOne, amountIn.toInt256(), sqrtPriceLimitX96 == 0 ? ( zeroForOne ? TickMath.MIN_SQRT_RATIO + 1 : TickMath.MAX_SQRT_RATIO - 1 ) : sqrtPriceLimitX96, abi.encodePacked(tokenIn, fee, tokenOut) ) {} catch (bytes memory reason) { return parseRevertReason(reason); } } /// @inheritdoc IQuoter function quoteExactInput( bytes memory path, uint256 amountIn ) external override returns (uint256 amountOut) { while (true) { bool hasMultiplePools = path.hasMultiplePools(); (address tokenIn, address tokenOut, uint24 fee) = path .decodeFirstPool(); // the outputs of prior swaps become the inputs to subsequent ones amountIn = quoteExactInputSingle( tokenIn, tokenOut, fee, amountIn, 0 ); // decide whether to continue or terminate if (hasMultiplePools) { path = path.skipToken(); } else { return amountIn; } } } /// @inheritdoc IQuoter function quoteExactOutputSingle( address tokenIn, address tokenOut, uint24 fee, uint256 amountOut, uint160 sqrtPriceLimitX96 ) public override returns (uint256 amountIn) { bool zeroForOne = tokenIn < tokenOut; // if no price limit has been specified, cache the output amount for comparison in the swap callback if (sqrtPriceLimitX96 == 0) amountOutCached = amountOut; try getPool(tokenIn, tokenOut, fee).swap( address(this), // address(0) might cause issues with some tokens zeroForOne, -amountOut.toInt256(), sqrtPriceLimitX96 == 0 ? ( zeroForOne ? TickMath.MIN_SQRT_RATIO + 1 : TickMath.MAX_SQRT_RATIO - 1 ) : sqrtPriceLimitX96, abi.encodePacked(tokenOut, fee, tokenIn) ) {} catch (bytes memory reason) { if (sqrtPriceLimitX96 == 0) delete amountOutCached; // clear cache return parseRevertReason(reason); } } /// @inheritdoc IQuoter function quoteExactOutput( bytes memory path, uint256 amountOut ) external override returns (uint256 amountIn) { while (true) { bool hasMultiplePools = path.hasMultiplePools(); (address tokenOut, address tokenIn, uint24 fee) = path .decodeFirstPool(); // the inputs of prior swaps become the outputs of subsequent ones amountOut = quoteExactOutputSingle( tokenIn, tokenOut, fee, amountOut, 0 ); // decide whether to continue or terminate if (hasMultiplePools) { path = path.skipToken(); } else { return amountOut; } } } } ================================================ FILE: agent-as-a-service/agent-launchpad/contracts/periphery/lens/QuoterV2.sol ================================================ // SPDX-License-Identifier: GPL-2.0-or-later pragma solidity ^0.8.0; import "../../core/libraries/SafeCast.sol"; import "../../core/libraries/TickMath.sol"; import "../../core/libraries/TickBitmap.sol"; import "../../core/interfaces/IUniswapV3Pool.sol"; import "../../core/interfaces/callback/IUniswapV3SwapCallback.sol"; import "../interfaces/IQuoterV2.sol"; import "../base/PeripheryImmutableState.sol"; import "../libraries/Path.sol"; import "../libraries/PoolAddress.sol"; import "../libraries/CallbackValidation.sol"; import "../libraries/PoolTicksCounter.sol"; /// @title Provides quotes for swaps /// @notice Allows getting the expected amount out or amount in for a given swap without executing the swap /// @dev These functions are not gas efficient and should _not_ be called on chain. Instead, optimistically execute /// the swap and check the amounts in the callback. contract QuoterV2 is IQuoterV2, IUniswapV3SwapCallback, PeripheryImmutableState { using Path for bytes; using SafeCast for uint256; using PoolTicksCounter for IUniswapV3Pool; /// @dev Transient storage variable used to check a safety condition in exact output swaps. uint256 private amountOutCached; function initialize(address _factory, address _WETH) external initializer { __PeripheryImmutableState_init(_factory, _WETH); } function getPool( address tokenA, address tokenB, uint24 fee ) private view returns (IUniswapV3Pool) { return IUniswapV3Pool( PoolAddress.computeAddress( factory, PoolAddress.getPoolKey(tokenA, tokenB, fee) ) ); } /// @inheritdoc IUniswapV3SwapCallback function uniswapV3SwapCallback( int256 amount0Delta, int256 amount1Delta, bytes memory path ) external view override { require(amount0Delta > 0 || amount1Delta > 0); // swaps entirely within 0-liquidity regions are not supported (address tokenIn, address tokenOut, uint24 fee) = path .decodeFirstPool(); CallbackValidation.verifyCallback(factory, tokenIn, tokenOut, fee); ( bool isExactInput, uint256 amountToPay, uint256 amountReceived ) = amount0Delta > 0 ? ( tokenIn < tokenOut, uint256(amount0Delta), uint256(-amount1Delta) ) : ( tokenOut < tokenIn, uint256(amount1Delta), uint256(-amount0Delta) ); IUniswapV3Pool pool = getPool(tokenIn, tokenOut, fee); (uint160 sqrtPriceX96After, int24 tickAfter, , , , , ) = pool.slot0(); if (isExactInput) { assembly { let ptr := mload(0x40) mstore(ptr, amountReceived) mstore(add(ptr, 0x20), sqrtPriceX96After) mstore(add(ptr, 0x40), tickAfter) revert(ptr, 96) } } else { // if the cache has been populated, ensure that the full output amount has been received if (amountOutCached != 0) require(amountReceived == amountOutCached); assembly { let ptr := mload(0x40) mstore(ptr, amountToPay) mstore(add(ptr, 0x20), sqrtPriceX96After) mstore(add(ptr, 0x40), tickAfter) revert(ptr, 96) } } } /// @dev Parses a revert reason that should contain the numeric quote function parseRevertReason( bytes memory reason ) private pure returns (uint256 amount, uint160 sqrtPriceX96After, int24 tickAfter) { if (reason.length != 96) { if (reason.length < 68) revert("Unexpected error"); assembly { reason := add(reason, 0x04) } revert(abi.decode(reason, (string))); } return abi.decode(reason, (uint256, uint160, int24)); } function handleRevert( bytes memory reason, IUniswapV3Pool pool, uint256 gasEstimate ) private view returns ( uint256 amount, uint160 sqrtPriceX96After, uint32 initializedTicksCrossed, uint256 ) { int24 tickBefore; int24 tickAfter; (, tickBefore, , , , , ) = pool.slot0(); (amount, sqrtPriceX96After, tickAfter) = parseRevertReason(reason); initializedTicksCrossed = pool.countInitializedTicksCrossed( tickBefore, tickAfter ); return ( amount, sqrtPriceX96After, initializedTicksCrossed, gasEstimate ); } function quoteExactInputSingle( QuoteExactInputSingleParams memory params ) public override returns ( uint256 amountOut, uint160 sqrtPriceX96After, uint32 initializedTicksCrossed, uint256 gasEstimate ) { bool zeroForOne = params.tokenIn < params.tokenOut; IUniswapV3Pool pool = getPool( params.tokenIn, params.tokenOut, params.fee ); uint256 gasBefore = gasleft(); try pool.swap( address(this), // address(0) might cause issues with some tokens zeroForOne, params.amountIn.toInt256(), params.sqrtPriceLimitX96 == 0 ? ( zeroForOne ? TickMath.MIN_SQRT_RATIO + 1 : TickMath.MAX_SQRT_RATIO - 1 ) : params.sqrtPriceLimitX96, abi.encodePacked(params.tokenIn, params.fee, params.tokenOut) ) {} catch (bytes memory reason) { gasEstimate = gasBefore - gasleft(); return handleRevert(reason, pool, gasEstimate); } } function quoteExactInput( bytes memory path, uint256 amountIn ) public override returns ( uint256 amountOut, uint160[] memory sqrtPriceX96AfterList, uint32[] memory initializedTicksCrossedList, uint256 gasEstimate ) { sqrtPriceX96AfterList = new uint160[](path.numPools()); initializedTicksCrossedList = new uint32[](path.numPools()); uint256 i = 0; while (true) { (address tokenIn, address tokenOut, uint24 fee) = path .decodeFirstPool(); // the outputs of prior swaps become the inputs to subsequent ones ( uint256 _amountOut, uint160 _sqrtPriceX96After, uint32 _initializedTicksCrossed, uint256 _gasEstimate ) = quoteExactInputSingle( QuoteExactInputSingleParams({ tokenIn: tokenIn, tokenOut: tokenOut, fee: fee, amountIn: amountIn, sqrtPriceLimitX96: 0 }) ); sqrtPriceX96AfterList[i] = _sqrtPriceX96After; initializedTicksCrossedList[i] = _initializedTicksCrossed; amountIn = _amountOut; gasEstimate += _gasEstimate; i++; // decide whether to continue or terminate if (path.hasMultiplePools()) { path = path.skipToken(); } else { return ( amountIn, sqrtPriceX96AfterList, initializedTicksCrossedList, gasEstimate ); } } } function quoteExactOutputSingle( QuoteExactOutputSingleParams memory params ) public override returns ( uint256 amountIn, uint160 sqrtPriceX96After, uint32 initializedTicksCrossed, uint256 gasEstimate ) { bool zeroForOne = params.tokenIn < params.tokenOut; IUniswapV3Pool pool = getPool( params.tokenIn, params.tokenOut, params.fee ); // if no price limit has been specified, cache the output amount for comparison in the swap callback if (params.sqrtPriceLimitX96 == 0) amountOutCached = params.amount; uint256 gasBefore = gasleft(); try pool.swap( address(this), // address(0) might cause issues with some tokens zeroForOne, -params.amount.toInt256(), params.sqrtPriceLimitX96 == 0 ? ( zeroForOne ? TickMath.MIN_SQRT_RATIO + 1 : TickMath.MAX_SQRT_RATIO - 1 ) : params.sqrtPriceLimitX96, abi.encodePacked(params.tokenOut, params.fee, params.tokenIn) ) {} catch (bytes memory reason) { gasEstimate = gasBefore - gasleft(); if (params.sqrtPriceLimitX96 == 0) delete amountOutCached; // clear cache return handleRevert(reason, pool, gasEstimate); } } function quoteExactOutput( bytes memory path, uint256 amountOut ) public override returns ( uint256 amountIn, uint160[] memory sqrtPriceX96AfterList, uint32[] memory initializedTicksCrossedList, uint256 gasEstimate ) { sqrtPriceX96AfterList = new uint160[](path.numPools()); initializedTicksCrossedList = new uint32[](path.numPools()); uint256 i = 0; while (true) { (address tokenOut, address tokenIn, uint24 fee) = path .decodeFirstPool(); // the inputs of prior swaps become the outputs of subsequent ones ( uint256 _amountIn, uint160 _sqrtPriceX96After, uint32 _initializedTicksCrossed, uint256 _gasEstimate ) = quoteExactOutputSingle( QuoteExactOutputSingleParams({ tokenIn: tokenIn, tokenOut: tokenOut, amount: amountOut, fee: fee, sqrtPriceLimitX96: 0 }) ); sqrtPriceX96AfterList[i] = _sqrtPriceX96After; initializedTicksCrossedList[i] = _initializedTicksCrossed; amountOut = _amountIn; gasEstimate += _gasEstimate; i++; // decide whether to continue or terminate if (path.hasMultiplePools()) { path = path.skipToken(); } else { return ( amountOut, sqrtPriceX96AfterList, initializedTicksCrossedList, gasEstimate ); } } } } ================================================ FILE: agent-as-a-service/agent-launchpad/contracts/periphery/lens/TickLens.sol ================================================ // SPDX-License-Identifier: GPL-2.0-or-later pragma solidity ^0.8.0; pragma abicoder v2; import "../../core/interfaces/IUniswapV3Pool.sol"; import "../interfaces/ITickLens.sol"; /// @title Tick Lens contract contract TickLens is ITickLens { /// @inheritdoc ITickLens function getPopulatedTicksInWord( address pool, int16 tickBitmapIndex ) public view override returns (PopulatedTick[] memory populatedTicks) { // fetch bitmap uint256 bitmap = IUniswapV3Pool(pool).tickBitmap(tickBitmapIndex); unchecked { // calculate the number of populated ticks uint256 numberOfPopulatedTicks; for (uint256 i = 0; i < 256; i++) { if (bitmap & (1 << i) > 0) numberOfPopulatedTicks++; } // fetch populated tick data int24 tickSpacing = IUniswapV3Pool(pool).tickSpacing(); populatedTicks = new PopulatedTick[](numberOfPopulatedTicks); for (uint256 i = 0; i < 256; i++) { if (bitmap & (1 << i) > 0) { int24 populatedTick = ((int24(tickBitmapIndex) << 8) + int24(uint24(i))) * tickSpacing; ( uint128 liquidityGross, int128 liquidityNet, , , , , , ) = IUniswapV3Pool(pool).ticks(populatedTick); populatedTicks[--numberOfPopulatedTicks] = PopulatedTick({ tick: populatedTick, liquidityNet: liquidityNet, liquidityGross: liquidityGross }); } } } } } ================================================ FILE: agent-as-a-service/agent-launchpad/contracts/periphery/lens/UniswapInterfaceMulticall.sol ================================================ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; /// @notice A fork of Multicall2 specifically tailored for the Uniswap Interface contract UniswapInterfaceMulticall is OwnableUpgradeable { struct Call { address target; uint256 gasLimit; bytes callData; } struct Result { bool success; uint256 gasUsed; bytes returnData; } function initialize() external initializer { __Ownable_init(); } function getCurrentBlockTimestamp() public view returns (uint256 timestamp) { timestamp = block.timestamp; } function getEthBalance(address addr) public view returns (uint256 balance) { balance = addr.balance; } function multicall( Call[] memory calls ) public returns (uint256 blockNumber, Result[] memory returnData) { blockNumber = block.number; returnData = new Result[](calls.length); for (uint256 i = 0; i < calls.length; i++) { (address target, uint256 gasLimit, bytes memory callData) = ( calls[i].target, calls[i].gasLimit, calls[i].callData ); uint256 gasLeftBefore = gasleft(); (bool success, bytes memory ret) = target.call{gas: gasLimit}( callData ); uint256 gasUsed = gasLeftBefore - gasleft(); returnData[i] = Result(success, gasUsed, ret); } } } ================================================ FILE: agent-as-a-service/agent-launchpad/contracts/periphery/libraries/AddressStringUtil.sol ================================================ // SPDX-License-Identifier: GPL-3.0-or-later // from https://github.com/Uniswap/solidity-lib/blob/master/contracts/libraries/AddressStringUtil.sol // modified for solidity 0.8 pragma solidity ^0.8.0; library AddressStringUtil { // converts an address to the uppercase hex string, extracting only len bytes (up to 20, multiple of 2) function toAsciiString(address addr, uint256 len) internal pure returns (string memory) { require(len % 2 == 0 && len > 0 && len <= 40, 'AddressStringUtil: INVALID_LEN'); bytes memory s = new bytes(len); uint256 addrNum = uint256(uint160(addr)); for (uint256 i = 0; i < len / 2; i++) { // shift right and truncate all but the least significant byte to extract the byte at position 19-i uint8 b = uint8(addrNum >> (8 * (19 - i))); // first hex character is the most significant 4 bits uint8 hi = b >> 4; // second hex character is the least significant 4 bits uint8 lo = b - (hi << 4); s[2 * i] = char(hi); s[2 * i + 1] = char(lo); } return string(s); } // hi and lo are only 4 bits and between 0 and 16 // this method converts those values to the unicode/ascii code point for the hex representation // uses upper case for the characters function char(uint8 b) private pure returns (bytes1 c) { if (b < 10) { return bytes1(b + 0x30); } else { return bytes1(b + 0x37); } } } ================================================ FILE: agent-as-a-service/agent-launchpad/contracts/periphery/libraries/BytesLib.sol ================================================ // SPDX-License-Identifier: GPL-2.0-or-later /* * @title Solidity Bytes Arrays Utils * @author Gonçalo Sá * * @dev Bytes tightly packed arrays utility library for ethereum contracts written in Solidity. * The library lets you concatenate, slice and type cast bytes arrays both in memory and storage. */ pragma solidity ^0.8.0; library BytesLib { function slice( bytes memory _bytes, uint256 _start, uint256 _length ) internal pure returns (bytes memory) { require(_length + 31 >= _length, 'slice_overflow'); require(_start + _length >= _start, 'slice_overflow'); require(_bytes.length >= _start + _length, 'slice_outOfBounds'); bytes memory tempBytes; assembly { switch iszero(_length) case 0 { // Get a location of some free memory and store it in tempBytes as // Solidity does for memory variables. tempBytes := mload(0x40) // The first word of the slice result is potentially a partial // word read from the original array. To read it, we calculate // the length of that partial word and start copying that many // bytes into the array. The first word we copy will start with // data we don't care about, but the last `lengthmod` bytes will // land at the beginning of the contents of the new array. When // we're done copying, we overwrite the full first word with // the actual length of the slice. let lengthmod := and(_length, 31) // The multiplication in the next line is necessary // because when slicing multiples of 32 bytes (lengthmod == 0) // the following copy loop was copying the origin's length // and then ending prematurely not copying everything it should. let mc := add(add(tempBytes, lengthmod), mul(0x20, iszero(lengthmod))) let end := add(mc, _length) for { // The multiplication in the next line has the same exact purpose // as the one above. let cc := add(add(add(_bytes, lengthmod), mul(0x20, iszero(lengthmod))), _start) } lt(mc, end) { mc := add(mc, 0x20) cc := add(cc, 0x20) } { mstore(mc, mload(cc)) } mstore(tempBytes, _length) //update free-memory pointer //allocating the array padded to 32 bytes like the compiler does now mstore(0x40, and(add(mc, 31), not(31))) } //if we want a zero-length slice let's just return a zero-length array default { tempBytes := mload(0x40) //zero out the 32 bytes slice we are about to return //we need to do it because Solidity does not garbage collect mstore(tempBytes, 0) mstore(0x40, add(tempBytes, 0x20)) } } return tempBytes; } function toAddress(bytes memory _bytes, uint256 _start) internal pure returns (address) { require(_start + 20 >= _start, 'toAddress_overflow'); require(_bytes.length >= _start + 20, 'toAddress_outOfBounds'); address tempAddress; assembly { tempAddress := div(mload(add(add(_bytes, 0x20), _start)), 0x1000000000000000000000000) } return tempAddress; } function toUint24(bytes memory _bytes, uint256 _start) internal pure returns (uint24) { require(_start + 3 >= _start, 'toUint24_overflow'); require(_bytes.length >= _start + 3, 'toUint24_outOfBounds'); uint24 tempUint; assembly { tempUint := mload(add(add(_bytes, 0x3), _start)) } return tempUint; } } ================================================ FILE: agent-as-a-service/agent-launchpad/contracts/periphery/libraries/CallbackValidation.sol ================================================ // SPDX-License-Identifier: GPL-2.0-or-later pragma solidity ^0.8.0; import '../../core/interfaces/IUniswapV3Pool.sol'; import './PoolAddress.sol'; /// @notice Provides validation for callbacks from Uniswap V3 Pools library CallbackValidation { /// @notice Returns the address of a valid Uniswap V3 Pool /// @param factory The contract address of the Uniswap V3 factory /// @param tokenA The contract address of either token0 or token1 /// @param tokenB The contract address of the other token /// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip /// @return pool The V3 pool contract address function verifyCallback( address factory, address tokenA, address tokenB, uint24 fee ) internal view returns (IUniswapV3Pool pool) { return verifyCallback(factory, PoolAddress.getPoolKey(tokenA, tokenB, fee)); } /// @notice Returns the address of a valid Uniswap V3 Pool /// @param factory The contract address of the Uniswap V3 factory /// @param poolKey The identifying key of the V3 pool /// @return pool The V3 pool contract address function verifyCallback(address factory, PoolAddress.PoolKey memory poolKey) internal view returns (IUniswapV3Pool pool) { pool = IUniswapV3Pool(PoolAddress.computeAddress(factory, poolKey)); require(msg.sender == address(pool)); } } ================================================ FILE: agent-as-a-service/agent-launchpad/contracts/periphery/libraries/ChainId.sol ================================================ // SPDX-License-Identifier: GPL-2.0-or-later pragma solidity ^0.8.0; /// @title Function for getting the current chain ID library ChainId { /// @dev Gets the current chain ID /// @return chainId The current chain ID function get() internal view returns (uint256 chainId) { assembly { chainId := chainid() } } } ================================================ FILE: agent-as-a-service/agent-launchpad/contracts/periphery/libraries/HexStrings.sol ================================================ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; library HexStrings { bytes16 internal constant ALPHABET = '0123456789abcdef'; /// @notice Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. /// @dev Credit to Open Zeppelin under MIT license https://github.com/OpenZeppelin/openzeppelin-contracts/blob/243adff49ce1700e0ecb99fe522fb16cff1d1ddc/contracts/utils/Strings.sol#L55 function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = '0'; buffer[1] = 'x'; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = ALPHABET[value & 0xf]; value >>= 4; } require(value == 0, 'Strings: hex length insufficient'); return string(buffer); } function toHexStringNoPrefix(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length); for (uint256 i = buffer.length; i > 0; i--) { buffer[i - 1] = ALPHABET[value & 0xf]; value >>= 4; } return string(buffer); } } ================================================ FILE: agent-as-a-service/agent-launchpad/contracts/periphery/libraries/LiquidityAmounts.sol ================================================ // SPDX-License-Identifier: GPL-2.0-or-later pragma solidity ^0.8.0; import '../../core/libraries/FullMath.sol'; import '../../core/libraries/FixedPoint96.sol'; /// @title Liquidity amount functions /// @notice Provides functions for computing liquidity amounts from token amounts and prices library LiquidityAmounts { /// @notice Downcasts uint256 to uint128 /// @param x The uint258 to be downcasted /// @return y The passed value, downcasted to uint128 function toUint128(uint256 x) private pure returns (uint128 y) { require((y = uint128(x)) == x); } /// @notice Computes the amount of liquidity received for a given amount of token0 and price range /// @dev Calculates amount0 * (sqrt(upper) * sqrt(lower)) / (sqrt(upper) - sqrt(lower)) /// @param sqrtRatioAX96 A sqrt price representing the first tick boundary /// @param sqrtRatioBX96 A sqrt price representing the second tick boundary /// @param amount0 The amount0 being sent in /// @return liquidity The amount of returned liquidity function getLiquidityForAmount0( uint160 sqrtRatioAX96, uint160 sqrtRatioBX96, uint256 amount0 ) internal pure returns (uint128 liquidity) { if (sqrtRatioAX96 > sqrtRatioBX96) (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96); uint256 intermediate = FullMath.mulDiv(sqrtRatioAX96, sqrtRatioBX96, FixedPoint96.Q96); return toUint128(FullMath.mulDiv(amount0, intermediate, sqrtRatioBX96 - sqrtRatioAX96)); } /// @notice Computes the amount of liquidity received for a given amount of token1 and price range /// @dev Calculates amount1 / (sqrt(upper) - sqrt(lower)). /// @param sqrtRatioAX96 A sqrt price representing the first tick boundary /// @param sqrtRatioBX96 A sqrt price representing the second tick boundary /// @param amount1 The amount1 being sent in /// @return liquidity The amount of returned liquidity function getLiquidityForAmount1( uint160 sqrtRatioAX96, uint160 sqrtRatioBX96, uint256 amount1 ) internal pure returns (uint128 liquidity) { if (sqrtRatioAX96 > sqrtRatioBX96) (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96); return toUint128(FullMath.mulDiv(amount1, FixedPoint96.Q96, sqrtRatioBX96 - sqrtRatioAX96)); } /// @notice Computes the maximum amount of liquidity received for a given amount of token0, token1, the current /// pool prices and the prices at the tick boundaries /// @param sqrtRatioX96 A sqrt price representing the current pool prices /// @param sqrtRatioAX96 A sqrt price representing the first tick boundary /// @param sqrtRatioBX96 A sqrt price representing the second tick boundary /// @param amount0 The amount of token0 being sent in /// @param amount1 The amount of token1 being sent in /// @return liquidity The maximum amount of liquidity received function getLiquidityForAmounts( uint160 sqrtRatioX96, uint160 sqrtRatioAX96, uint160 sqrtRatioBX96, uint256 amount0, uint256 amount1 ) internal pure returns (uint128 liquidity) { if (sqrtRatioAX96 > sqrtRatioBX96) (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96); if (sqrtRatioX96 <= sqrtRatioAX96) { liquidity = getLiquidityForAmount0(sqrtRatioAX96, sqrtRatioBX96, amount0); } else if (sqrtRatioX96 < sqrtRatioBX96) { uint128 liquidity0 = getLiquidityForAmount0(sqrtRatioX96, sqrtRatioBX96, amount0); uint128 liquidity1 = getLiquidityForAmount1(sqrtRatioAX96, sqrtRatioX96, amount1); liquidity = liquidity0 < liquidity1 ? liquidity0 : liquidity1; } else { liquidity = getLiquidityForAmount1(sqrtRatioAX96, sqrtRatioBX96, amount1); } } /// @notice Computes the amount of token0 for a given amount of liquidity and a price range /// @param sqrtRatioAX96 A sqrt price representing the first tick boundary /// @param sqrtRatioBX96 A sqrt price representing the second tick boundary /// @param liquidity The liquidity being valued /// @return amount0 The amount of token0 function getAmount0ForLiquidity( uint160 sqrtRatioAX96, uint160 sqrtRatioBX96, uint128 liquidity ) internal pure returns (uint256 amount0) { if (sqrtRatioAX96 > sqrtRatioBX96) (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96); return FullMath.mulDiv( uint256(liquidity) << FixedPoint96.RESOLUTION, sqrtRatioBX96 - sqrtRatioAX96, sqrtRatioBX96 ) / sqrtRatioAX96; } /// @notice Computes the amount of token1 for a given amount of liquidity and a price range /// @param sqrtRatioAX96 A sqrt price representing the first tick boundary /// @param sqrtRatioBX96 A sqrt price representing the second tick boundary /// @param liquidity The liquidity being valued /// @return amount1 The amount of token1 function getAmount1ForLiquidity( uint160 sqrtRatioAX96, uint160 sqrtRatioBX96, uint128 liquidity ) internal pure returns (uint256 amount1) { if (sqrtRatioAX96 > sqrtRatioBX96) (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96); return FullMath.mulDiv(liquidity, sqrtRatioBX96 - sqrtRatioAX96, FixedPoint96.Q96); } /// @notice Computes the token0 and token1 value for a given amount of liquidity, the current /// pool prices and the prices at the tick boundaries /// @param sqrtRatioX96 A sqrt price representing the current pool prices /// @param sqrtRatioAX96 A sqrt price representing the first tick boundary /// @param sqrtRatioBX96 A sqrt price representing the second tick boundary /// @param liquidity The liquidity being valued /// @return amount0 The amount of token0 /// @return amount1 The amount of token1 function getAmountsForLiquidity( uint160 sqrtRatioX96, uint160 sqrtRatioAX96, uint160 sqrtRatioBX96, uint128 liquidity ) internal pure returns (uint256 amount0, uint256 amount1) { if (sqrtRatioAX96 > sqrtRatioBX96) (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96); if (sqrtRatioX96 <= sqrtRatioAX96) { amount0 = getAmount0ForLiquidity(sqrtRatioAX96, sqrtRatioBX96, liquidity); } else if (sqrtRatioX96 < sqrtRatioBX96) { amount0 = getAmount0ForLiquidity(sqrtRatioX96, sqrtRatioBX96, liquidity); amount1 = getAmount1ForLiquidity(sqrtRatioAX96, sqrtRatioX96, liquidity); } else { amount1 = getAmount1ForLiquidity(sqrtRatioAX96, sqrtRatioBX96, liquidity); } } } ================================================ FILE: agent-as-a-service/agent-launchpad/contracts/periphery/libraries/NFTDescriptor.sol ================================================ // SPDX-License-Identifier: GPL-2.0-or-later pragma solidity ^0.8.0; pragma abicoder v2; import "../../core/interfaces/IUniswapV3Pool.sol"; import "../../core/libraries/TickMath.sol"; import "../../core/libraries/BitMath.sol"; import "../../core/libraries/FullMath.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "base64-sol/base64.sol"; import "./HexStrings.sol"; import "./NFTSVG.sol"; library NFTDescriptor { using TickMath for int24; using Strings for uint256; using HexStrings for uint256; uint256 constant sqrt10X128 = 1076067327063303206878105757264492625226; struct ConstructTokenURIParams { uint256 tokenId; address quoteTokenAddress; address baseTokenAddress; string quoteTokenSymbol; string baseTokenSymbol; uint8 quoteTokenDecimals; uint8 baseTokenDecimals; bool flipRatio; int24 tickLower; int24 tickUpper; int24 tickCurrent; int24 tickSpacing; uint24 fee; address poolAddress; } function constructTokenURI( ConstructTokenURIParams memory params ) public pure returns (string memory) { string memory name = generateName( params, feeToPercentString(params.fee) ); string memory descriptionPartOne = generateDescriptionPartOne( escapeQuotes(params.quoteTokenSymbol), escapeQuotes(params.baseTokenSymbol), addressToString(params.poolAddress) ); string memory descriptionPartTwo = generateDescriptionPartTwo( params.tokenId.toString(), escapeQuotes(params.baseTokenSymbol), addressToString(params.quoteTokenAddress), addressToString(params.baseTokenAddress), feeToPercentString(params.fee) ); string memory image = Base64.encode(bytes(generateSVGImage(params))); return string( abi.encodePacked( "data:application/json;base64,", Base64.encode( bytes( abi.encodePacked( '{"name":"', name, '", "description":"', descriptionPartOne, descriptionPartTwo, '", "image": "', "data:image/svg+xml;base64,", image, '"}' ) ) ) ) ); } function escapeQuotes( string memory symbol ) internal pure returns (string memory) { bytes memory symbolBytes = bytes(symbol); uint8 quotesCount = 0; for (uint8 i = 0; i < symbolBytes.length; i++) { if (symbolBytes[i] == '"') { quotesCount++; } } if (quotesCount > 0) { bytes memory escapedBytes = new bytes( symbolBytes.length + (quotesCount) ); uint256 index; for (uint8 i = 0; i < symbolBytes.length; i++) { if (symbolBytes[i] == '"') { escapedBytes[index++] = "\\"; } escapedBytes[index++] = symbolBytes[i]; } return string(escapedBytes); } return symbol; } function generateDescriptionPartOne( string memory quoteTokenSymbol, string memory baseTokenSymbol, string memory poolAddress ) private pure returns (string memory) { return string( abi.encodePacked( "This NFT represents a liquidity position in a Uniswap V3 ", quoteTokenSymbol, "-", baseTokenSymbol, " pool. ", "The owner of this NFT can modify or redeem the position.\\n", "\\nPool Address: ", poolAddress, "\\n", quoteTokenSymbol ) ); } function generateDescriptionPartTwo( string memory tokenId, string memory baseTokenSymbol, string memory quoteTokenAddress, string memory baseTokenAddress, string memory feeTier ) private pure returns (string memory) { return string( abi.encodePacked( " Address: ", quoteTokenAddress, "\\n", baseTokenSymbol, " Address: ", baseTokenAddress, "\\nFee Tier: ", feeTier, "\\nToken ID: ", tokenId, "\\n\\n", unicode"⚠️ DISCLAIMER: Due diligence is imperative when assessing this NFT. Make sure token addresses match the expected tokens, as token symbols may be imitated." ) ); } function generateName( ConstructTokenURIParams memory params, string memory feeTier ) private pure returns (string memory) { return string( abi.encodePacked( "Uniswap - ", feeTier, " - ", escapeQuotes(params.quoteTokenSymbol), "/", escapeQuotes(params.baseTokenSymbol), " - ", tickToDecimalString( !params.flipRatio ? params.tickLower : params.tickUpper, params.tickSpacing, params.baseTokenDecimals, params.quoteTokenDecimals, params.flipRatio ), "<>", tickToDecimalString( !params.flipRatio ? params.tickUpper : params.tickLower, params.tickSpacing, params.baseTokenDecimals, params.quoteTokenDecimals, params.flipRatio ) ) ); } struct DecimalStringParams { // significant figures of decimal uint256 sigfigs; // length of decimal string uint8 bufferLength; // ending index for significant figures (funtion works backwards when copying sigfigs) uint8 sigfigIndex; // index of decimal place (0 if no decimal) uint8 decimalIndex; // start index for trailing/leading 0's for very small/large numbers uint8 zerosStartIndex; // end index for trailing/leading 0's for very small/large numbers uint8 zerosEndIndex; // true if decimal number is less than one bool isLessThanOne; // true if string should include "%" bool isPercent; } function generateDecimalString( DecimalStringParams memory params ) private pure returns (string memory) { bytes memory buffer = new bytes(params.bufferLength); if (params.isPercent) { buffer[buffer.length - 1] = "%"; } if (params.isLessThanOne) { buffer[0] = "0"; buffer[1] = "."; } // add leading/trailing 0's for ( uint256 zerosCursor = params.zerosStartIndex; zerosCursor < params.zerosEndIndex + 1; zerosCursor++ ) { buffer[zerosCursor] = bytes1(uint8(48)); } // add sigfigs unchecked { while (params.sigfigs > 0) { if ( params.decimalIndex > 0 && params.sigfigIndex == params.decimalIndex ) { buffer[params.sigfigIndex--] = "."; } buffer[params.sigfigIndex--] = bytes1( uint8(uint256(48) + (params.sigfigs % 10)) ); params.sigfigs /= 10; } } return string(buffer); } function tickToDecimalString( int24 tick, int24 tickSpacing, uint8 baseTokenDecimals, uint8 quoteTokenDecimals, bool flipRatio ) internal pure returns (string memory) { if (tick == (TickMath.MIN_TICK / tickSpacing) * tickSpacing) { return !flipRatio ? "MIN" : "MAX"; } else if (tick == (TickMath.MAX_TICK / tickSpacing) * tickSpacing) { return !flipRatio ? "MAX" : "MIN"; } else { uint160 sqrtRatioX96 = TickMath.getSqrtRatioAtTick(tick); if (flipRatio) { sqrtRatioX96 = uint160(uint256(1 << 192) / sqrtRatioX96); } return fixedPointToDecimalString( sqrtRatioX96, baseTokenDecimals, quoteTokenDecimals ); } } function sigfigsRounded( uint256 value, uint8 digits ) private pure returns (uint256, bool) { bool extraDigit; if (digits > 5) { value = value / ((10 ** (digits - 5))); } bool roundUp = value % 10 > 4; value = value / 10; if (roundUp) { value = value + 1; } // 99999 -> 100000 gives an extra sigfig if (value == 100000) { value /= 10; extraDigit = true; } return (value, extraDigit); } function adjustForDecimalPrecision( uint160 sqrtRatioX96, uint8 baseTokenDecimals, uint8 quoteTokenDecimals ) private pure returns (uint256 adjustedSqrtRatioX96) { uint256 difference = abs( int256(uint256(baseTokenDecimals)) - int256(uint256(quoteTokenDecimals)) ); if (difference > 0 && difference <= 18) { if (baseTokenDecimals > quoteTokenDecimals) { adjustedSqrtRatioX96 = sqrtRatioX96 * (10 ** (difference / 2)); if (difference % 2 == 1) { adjustedSqrtRatioX96 = FullMath.mulDiv( adjustedSqrtRatioX96, sqrt10X128, 1 << 128 ); } } else { adjustedSqrtRatioX96 = sqrtRatioX96 / (10 ** (difference / 2)); if (difference % 2 == 1) { adjustedSqrtRatioX96 = FullMath.mulDiv( adjustedSqrtRatioX96, 1 << 128, sqrt10X128 ); } } } else { adjustedSqrtRatioX96 = uint256(sqrtRatioX96); } } function abs(int256 x) private pure returns (uint256) { return uint256(x >= 0 ? x : -x); } // @notice Returns string that includes first 5 significant figures of a decimal number // @param sqrtRatioX96 a sqrt price function fixedPointToDecimalString( uint160 sqrtRatioX96, uint8 baseTokenDecimals, uint8 quoteTokenDecimals ) internal pure returns (string memory) { uint256 adjustedSqrtRatioX96 = adjustForDecimalPrecision( sqrtRatioX96, baseTokenDecimals, quoteTokenDecimals ); uint256 value = FullMath.mulDiv( adjustedSqrtRatioX96, adjustedSqrtRatioX96, 1 << 64 ); bool priceBelow1 = adjustedSqrtRatioX96 < 2 ** 96; if (priceBelow1) { // 10 ** 43 is precision needed to retreive 5 sigfigs of smallest possible price + 1 for rounding value = FullMath.mulDiv(value, 10 ** 44, 1 << 128); } else { // leave precision for 4 decimal places + 1 place for rounding value = FullMath.mulDiv(value, 10 ** 5, 1 << 128); } // get digit count uint256 temp = value; uint8 digits; while (temp != 0) { digits++; temp /= 10; } // don't count extra digit kept for rounding digits = digits - 1; // address rounding (uint256 sigfigs, bool extraDigit) = sigfigsRounded(value, digits); if (extraDigit) { digits++; } DecimalStringParams memory params; if (priceBelow1) { // 7 bytes ( "0." and 5 sigfigs) + leading 0's bytes params.bufferLength = uint8(uint8(7) + (uint8(43) - digits)); params.zerosStartIndex = 2; params.zerosEndIndex = uint8(uint256(43) - digits + 1); params.sigfigIndex = uint8(params.bufferLength - 1); } else if (digits >= 9) { // no decimal in price string params.bufferLength = uint8(digits - 4); params.zerosStartIndex = 5; params.zerosEndIndex = uint8(params.bufferLength - 1); params.sigfigIndex = 4; } else { // 5 sigfigs surround decimal params.bufferLength = 6; params.sigfigIndex = 5; params.decimalIndex = uint8(digits - 4); } params.sigfigs = sigfigs; params.isLessThanOne = priceBelow1; params.isPercent = false; return generateDecimalString(params); } struct FeeDigits { uint24 temp; uint8 numSigfigs; uint256 digits; } // @notice Returns string as decimal percentage of fee amount. // @param fee fee amount function feeToPercentString( uint24 fee ) internal pure returns (string memory) { if (fee == 0) { return "0%"; } FeeDigits memory feeDigits = FeeDigits(fee, 0, 0); while (feeDigits.temp != 0) { if (feeDigits.numSigfigs > 0) { // count all digits preceding least significant figure feeDigits.numSigfigs++; } else if (feeDigits.temp % 10 != 0) { feeDigits.numSigfigs++; } feeDigits.digits++; feeDigits.temp /= 10; } DecimalStringParams memory params; uint256 nZeros; if (feeDigits.digits >= 5) { // if decimal > 1 (5th digit is the ones place) uint256 decimalPlace = feeDigits.digits - feeDigits.numSigfigs >= 4 ? 0 : 1; nZeros = feeDigits.digits - 5 < (feeDigits.numSigfigs - 1) ? 0 : feeDigits.digits - 5 - (feeDigits.numSigfigs - 1); params.zerosStartIndex = feeDigits.numSigfigs; params.zerosEndIndex = uint8(params.zerosStartIndex + nZeros - 1); params.sigfigIndex = uint8( params.zerosStartIndex - 1 + decimalPlace ); params.bufferLength = uint8( nZeros + (feeDigits.numSigfigs + 1) + decimalPlace ); } else { // else if decimal < 1 nZeros = uint256(5) - feeDigits.digits; params.zerosStartIndex = 2; params.zerosEndIndex = uint8(nZeros + params.zerosStartIndex - 1); params.bufferLength = uint8(nZeros + (feeDigits.numSigfigs + 2)); params.sigfigIndex = uint8((params.bufferLength) - 2); params.isLessThanOne = true; } params.sigfigs = uint256(fee) / (10 ** (feeDigits.digits - feeDigits.numSigfigs)); params.isPercent = true; params.decimalIndex = feeDigits.digits > 4 ? uint8(feeDigits.digits - 4) : 0; return generateDecimalString(params); } function addressToString( address addr ) internal pure returns (string memory) { return HexStrings.toHexString(uint256(uint160(addr)), 20); } function generateSVGImage( ConstructTokenURIParams memory params ) internal pure returns (string memory svg) { string memory defs = NFTSVG.generateSVGDefs( NFTSVG.SVGDefsParams({ color0: tokenToColorHex( uint256(uint160(params.quoteTokenAddress)), 136 ), color1: tokenToColorHex( uint256(uint160(params.baseTokenAddress)), 136 ), color2: tokenToColorHex( uint256(uint160(params.quoteTokenAddress)), 0 ), color3: tokenToColorHex( uint256(uint160(params.baseTokenAddress)), 0 ), x1: scale( getCircleCoord( uint256(uint160(params.quoteTokenAddress)), 16, params.tokenId ), 0, 255, 16, 274 ), y1: scale( getCircleCoord( uint256(uint160(params.baseTokenAddress)), 16, params.tokenId ), 0, 255, 100, 484 ), x2: scale( getCircleCoord( uint256(uint160(params.quoteTokenAddress)), 32, params.tokenId ), 0, 255, 16, 274 ), y2: scale( getCircleCoord( uint256(uint160(params.baseTokenAddress)), 32, params.tokenId ), 0, 255, 100, 484 ), x3: scale( getCircleCoord( uint256(uint160(params.quoteTokenAddress)), 48, params.tokenId ), 0, 255, 16, 274 ), y3: scale( getCircleCoord( uint256(uint160(params.baseTokenAddress)), 48, params.tokenId ), 0, 255, 100, 484 ) }) ); string memory body = NFTSVG.generateSVGBody( NFTSVG.SVGBodyParams({ quoteToken: addressToString(params.quoteTokenAddress), baseToken: addressToString(params.baseTokenAddress), poolAddress: params.poolAddress, quoteTokenSymbol: params.quoteTokenSymbol, baseTokenSymbol: params.baseTokenSymbol, feeTier: feeToPercentString(params.fee), tickLower: params.tickLower, tickUpper: params.tickUpper, tickSpacing: params.tickSpacing, overRange: overRange( params.tickLower, params.tickUpper, params.tickCurrent ), tokenId: params.tokenId }) ); return NFTSVG.generateSVG(defs, body); } function overRange( int24 tickLower, int24 tickUpper, int24 tickCurrent ) private pure returns (int8) { if (tickCurrent < tickLower) { return -1; } else if (tickCurrent > tickUpper) { return 1; } else { return 0; } } function scale( uint256 n, uint256 inMn, uint256 inMx, uint256 outMn, uint256 outMx ) private pure returns (string memory) { return (((n - inMn) * (outMx - outMn)) / (inMx - inMn) + outMn).toString(); } function tokenToColorHex( uint256 token, uint256 offset ) internal pure returns (string memory str) { return string((token >> offset).toHexStringNoPrefix(3)); } function getCircleCoord( uint256 tokenAddress, uint256 offset, uint256 tokenId ) internal pure returns (uint256) { return (sliceTokenHex(tokenAddress, offset) * tokenId) % 255; } function sliceTokenHex( uint256 token, uint256 offset ) internal pure returns (uint256) { return uint256(uint8(token >> offset)); } } ================================================ FILE: agent-as-a-service/agent-launchpad/contracts/periphery/libraries/NFTSVG.sol ================================================ // SPDX-License-Identifier: GPL-2.0-or-later pragma solidity >=0.7.6; pragma abicoder v2; import '@openzeppelin/contracts/utils/Strings.sol'; import '../../core/libraries/BitMath.sol'; import 'base64-sol/base64.sol'; /// @title NFTSVG /// @notice Provides a function for generating an SVG associated with a Uniswap NFT library NFTSVG { using Strings for uint256; string constant curve1 = "M1 1C41 41 105 105 145 145"; string constant curve2 = "M1 1C33 49 97 113 145 145"; string constant curve3 = "M1 1C33 57 89 113 145 145"; string constant curve4 = "M1 1C25 65 81 121 145 145"; string constant curve5 = "M1 1C17 73 73 129 145 145"; string constant curve6 = "M1 1C9 81 65 137 145 145"; string constant curve7 = "M1 1C1 89 57.5 145 145 145"; string constant curve8 = "M1 1C1 97 49 145 145 145"; struct SVGBodyParams { string quoteToken; string baseToken; address poolAddress; string quoteTokenSymbol; string baseTokenSymbol; string feeTier; int24 tickLower; int24 tickUpper; int24 tickSpacing; int8 overRange; uint256 tokenId; } struct SVGDefsParams { string color0; string color1; string color2; string color3; string x1; string y1; string x2; string y2; string x3; string y3; } function generateSVG( string memory defs, string memory body ) internal pure returns (string memory svg) { /* address: "0xe8ab59d3bcde16a29912de83a90eb39628cfc163", msg: "Forged in SVG for Uniswap in 2021 by 0xe8ab59d3bcde16a29912de83a90eb39628cfc163", sig: "0x2df0e99d9cbfec33a705d83f75666d98b22dea7c1af412c584f7d626d83f02875993df740dc87563b9c73378f8462426da572d7989de88079a382ad96c57b68d1b", version: "2" */ return string(abi.encodePacked(defs, body, "")); } function generateSVGBody( SVGBodyParams memory params ) internal pure returns (string memory body) { return string( abi.encodePacked( generateSVGBorderText( params.quoteToken, params.baseToken, params.quoteTokenSymbol, params.baseTokenSymbol ), generateSVGCardMantle( params.quoteTokenSymbol, params.baseTokenSymbol, params.feeTier ), generageSvgCurve( params.tickLower, params.tickUpper, params.tickSpacing, params.overRange ), generateSVGPositionDataAndLocationCurve( params.tokenId.toString(), params.tickLower, params.tickUpper ), generateSVGRareSparkle(params.tokenId, params.poolAddress) ) ); } function generateSVGDefs( SVGDefsParams memory params ) internal pure returns (string memory svg) { svg = string( abi.encodePacked( '", "", '" ) ) ), '"/>" ) ) ), '"/>" ) ) ), '" />', '" ) ) ), '" /> ', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ' ', '', '', '' ) ); } function generateSVGBorderText( string memory quoteToken, string memory baseToken, string memory quoteTokenSymbol, string memory baseTokenSymbol ) private pure returns (string memory svg) { svg = string( abi.encodePacked( '', '', baseToken, unicode" • ", baseTokenSymbol, ' ', ' ', baseToken, unicode" • ", baseTokenSymbol, ' ', '', quoteToken, unicode" • ", quoteTokenSymbol, ' ', quoteToken, unicode" • ", quoteTokenSymbol, ' ' ) ); } function generateSVGCardMantle( string memory quoteTokenSymbol, string memory baseTokenSymbol, string memory feeTier ) private pure returns (string memory svg) { svg = string( abi.encodePacked( ' ', quoteTokenSymbol, "/", baseTokenSymbol, '', feeTier, "", '' ) ); } function generageSvgCurve( int24 tickLower, int24 tickUpper, int24 tickSpacing, int8 overRange ) private pure returns (string memory svg) { string memory fade = overRange == 1 ? "#fade-up" : overRange == -1 ? "#fade-down" : "#none"; string memory curve = getCurve(tickLower, tickUpper, tickSpacing); svg = string( abi.encodePacked( '' '' '', '', '', '', generateSVGCurveCircle(overRange) ) ); } function getCurve( int24 tickLower, int24 tickUpper, int24 tickSpacing ) internal pure returns (string memory curve) { int24 tickRange = (tickUpper - tickLower) / tickSpacing; if (tickRange <= 4) { curve = curve1; } else if (tickRange <= 8) { curve = curve2; } else if (tickRange <= 16) { curve = curve3; } else if (tickRange <= 32) { curve = curve4; } else if (tickRange <= 64) { curve = curve5; } else if (tickRange <= 128) { curve = curve6; } else if (tickRange <= 256) { curve = curve7; } else { curve = curve8; } } function generateSVGCurveCircle( int8 overRange ) internal pure returns (string memory svg) { string memory curvex1 = "73"; string memory curvey1 = "190"; string memory curvex2 = "217"; string memory curvey2 = "334"; if (overRange == 1 || overRange == -1) { svg = string( abi.encodePacked( '' ) ); } else { svg = string( abi.encodePacked( '', '' ) ); } } function generateSVGPositionDataAndLocationCurve( string memory tokenId, int24 tickLower, int24 tickUpper ) private pure returns (string memory svg) { string memory tickLowerStr = tickToString(tickLower); string memory tickUpperStr = tickToString(tickUpper); uint256 str1length = bytes(tokenId).length + 4; uint256 str2length = bytes(tickLowerStr).length + 10; uint256 str3length = bytes(tickUpperStr).length + 10; (string memory xCoord, string memory yCoord) = rangeLocation( tickLower, tickUpper ); svg = string( abi.encodePacked( ' ', '', 'ID: ', tokenId, "", ' ', '', 'Min Tick: ', tickLowerStr, "", ' ', '', 'Max Tick: ', tickUpperStr, "" '', '', '', '' ) ); } function tickToString(int24 tick) private pure returns (string memory) { string memory sign = ""; if (tick < 0) { tick = tick * -1; sign = "-"; } return string(abi.encodePacked(sign, uint256(uint24(tick)).toString())); } function rangeLocation( int24 tickLower, int24 tickUpper ) internal pure returns (string memory, string memory) { int24 midPoint = (tickLower + tickUpper) / 2; if (midPoint < -125_000) { return ("8", "7"); } else if (midPoint < -75_000) { return ("8", "10.5"); } else if (midPoint < -25_000) { return ("8", "14.25"); } else if (midPoint < -5_000) { return ("10", "18"); } else if (midPoint < 0) { return ("11", "21"); } else if (midPoint < 5_000) { return ("13", "23"); } else if (midPoint < 25_000) { return ("15", "25"); } else if (midPoint < 75_000) { return ("18", "26"); } else if (midPoint < 125_000) { return ("21", "27"); } else { return ("24", "27"); } } function generateSVGRareSparkle( uint256 tokenId, address poolAddress ) private pure returns (string memory svg) { if (isRare(tokenId, poolAddress)) { svg = string( abi.encodePacked( '', '', '' ) ); } else { svg = ""; } } function isRare( uint256 tokenId, address poolAddress ) internal pure returns (bool) { bytes32 h = keccak256(abi.encodePacked(tokenId, poolAddress)); return uint256(h) < type(uint256).max / (1 + BitMath.mostSignificantBit(tokenId) * 2); } } ================================================ FILE: agent-as-a-service/agent-launchpad/contracts/periphery/libraries/OracleLibrary.sol ================================================ // SPDX-License-Identifier: GPL-2.0-or-later pragma solidity >=0.5.0 <0.9.0; import "../../core/libraries/FullMath.sol"; import "../../core/libraries/TickMath.sol"; import "../../core/interfaces/IUniswapV3Pool.sol"; /// @title Oracle library /// @notice Provides functions to integrate with V3 pool oracle library OracleLibrary { /// @notice Calculates time-weighted means of tick and liquidity for a given Uniswap V3 pool /// @param pool Address of the pool that we want to observe /// @param secondsAgo Number of seconds in the past from which to calculate the time-weighted means /// @return arithmeticMeanTick The arithmetic mean tick from (block.timestamp - secondsAgo) to block.timestamp /// @return harmonicMeanLiquidity The harmonic mean liquidity from (block.timestamp - secondsAgo) to block.timestamp function consult( address pool, uint32 secondsAgo ) internal view returns (int24 arithmeticMeanTick, uint128 harmonicMeanLiquidity) { require(secondsAgo != 0, "BP"); uint32[] memory secondsAgos = new uint32[](2); secondsAgos[0] = secondsAgo; secondsAgos[1] = 0; ( int56[] memory tickCumulatives, uint160[] memory secondsPerLiquidityCumulativeX128s ) = IUniswapV3Pool(pool).observe(secondsAgos); int56 tickCumulativesDelta = tickCumulatives[1] - tickCumulatives[0]; uint160 secondsPerLiquidityCumulativesDelta = secondsPerLiquidityCumulativeX128s[ 1 ] - secondsPerLiquidityCumulativeX128s[0]; arithmeticMeanTick = int24( tickCumulativesDelta / int56(uint56(secondsAgo)) ); // Always round to negative infinity if ( tickCumulativesDelta < 0 && (tickCumulativesDelta % int56(uint56(secondsAgo)) != 0) ) arithmeticMeanTick--; // We are multiplying here instead of shifting to ensure that harmonicMeanLiquidity doesn't overflow uint128 uint192 secondsAgoX160 = uint192(secondsAgo) * type(uint160).max; harmonicMeanLiquidity = uint128( secondsAgoX160 / (uint192(secondsPerLiquidityCumulativesDelta) << 32) ); } /// @notice Given a tick and a token amount, calculates the amount of token received in exchange /// @param tick Tick value used to calculate the quote /// @param baseAmount Amount of token to be converted /// @param baseToken Address of an ERC20 token contract used as the baseAmount denomination /// @param quoteToken Address of an ERC20 token contract used as the quoteAmount denomination /// @return quoteAmount Amount of quoteToken received for baseAmount of baseToken function getQuoteAtTick( int24 tick, uint128 baseAmount, address baseToken, address quoteToken ) internal pure returns (uint256 quoteAmount) { uint160 sqrtRatioX96 = TickMath.getSqrtRatioAtTick(tick); // Calculate quoteAmount with better precision if it doesn't overflow when multiplied by itself if (sqrtRatioX96 <= type(uint128).max) { uint256 ratioX192 = uint256(sqrtRatioX96) * sqrtRatioX96; quoteAmount = baseToken < quoteToken ? FullMath.mulDiv(ratioX192, baseAmount, 1 << 192) : FullMath.mulDiv(1 << 192, baseAmount, ratioX192); } else { uint256 ratioX128 = FullMath.mulDiv( sqrtRatioX96, sqrtRatioX96, 1 << 64 ); quoteAmount = baseToken < quoteToken ? FullMath.mulDiv(ratioX128, baseAmount, 1 << 128) : FullMath.mulDiv(1 << 128, baseAmount, ratioX128); } } /// @notice Given a pool, it returns the number of seconds ago of the oldest stored observation /// @param pool Address of Uniswap V3 pool that we want to observe /// @return secondsAgo The number of seconds ago of the oldest observation stored for the pool function getOldestObservationSecondsAgo( address pool ) internal view returns (uint32 secondsAgo) { ( , , uint16 observationIndex, uint16 observationCardinality, , , ) = IUniswapV3Pool(pool).slot0(); require(observationCardinality > 0, "NI"); (uint32 observationTimestamp, , , bool initialized) = IUniswapV3Pool( pool ).observations((observationIndex + 1) % observationCardinality); // The next index might not be initialized if the cardinality is in the process of increasing // In this case the oldest observation is always in index 0 if (!initialized) { (observationTimestamp, , , ) = IUniswapV3Pool(pool).observations(0); } unchecked { secondsAgo = uint32(block.timestamp) - observationTimestamp; } } /// @notice Given a pool, it returns the tick value as of the start of the current block /// @param pool Address of Uniswap V3 pool /// @return The tick that the pool was in at the start of the current block function getBlockStartingTickAndLiquidity( address pool ) internal view returns (int24, uint128) { ( , int24 tick, uint16 observationIndex, uint16 observationCardinality, , , ) = IUniswapV3Pool(pool).slot0(); // 2 observations are needed to reliably calculate the block starting tick require(observationCardinality > 1, "NEO"); // If the latest observation occurred in the past, then no tick-changing trades have happened in this block // therefore the tick in `slot0` is the same as at the beginning of the current block. // We don't need to check if this observation is initialized - it is guaranteed to be. ( uint32 observationTimestamp, int56 tickCumulative, uint160 secondsPerLiquidityCumulativeX128, ) = IUniswapV3Pool(pool).observations(observationIndex); if (observationTimestamp != uint32(block.timestamp)) { return (tick, IUniswapV3Pool(pool).liquidity()); } uint256 prevIndex = (uint256(observationIndex) + observationCardinality - 1) % observationCardinality; ( uint32 prevObservationTimestamp, int56 prevTickCumulative, uint160 prevSecondsPerLiquidityCumulativeX128, bool prevInitialized ) = IUniswapV3Pool(pool).observations(prevIndex); require(prevInitialized, "ONI"); uint32 delta = observationTimestamp - prevObservationTimestamp; tick = int24( (tickCumulative - int56(uint56(prevTickCumulative))) / int56(uint56(delta)) ); uint128 liquidity = uint128( (uint192(delta) * type(uint160).max) / (uint192( secondsPerLiquidityCumulativeX128 - prevSecondsPerLiquidityCumulativeX128 ) << 32) ); return (tick, liquidity); } /// @notice Information for calculating a weighted arithmetic mean tick struct WeightedTickData { int24 tick; uint128 weight; } /// @notice Given an array of ticks and weights, calculates the weighted arithmetic mean tick /// @param weightedTickData An array of ticks and weights /// @return weightedArithmeticMeanTick The weighted arithmetic mean tick /// @dev Each entry of `weightedTickData` should represents ticks from pools with the same underlying pool tokens. If they do not, /// extreme care must be taken to ensure that ticks are comparable (including decimal differences). /// @dev Note that the weighted arithmetic mean tick corresponds to the weighted geometric mean price. function getWeightedArithmeticMeanTick( WeightedTickData[] memory weightedTickData ) internal pure returns (int24 weightedArithmeticMeanTick) { // Accumulates the sum of products between each tick and its weight int256 numerator; // Accumulates the sum of the weights uint256 denominator; // Products fit in 152 bits, so it would take an array of length ~2**104 to overflow this logic for (uint256 i; i < weightedTickData.length; i++) { numerator += weightedTickData[i].tick * int256(uint256(weightedTickData[i].weight)); denominator += weightedTickData[i].weight; } weightedArithmeticMeanTick = int24(numerator / int256(denominator)); // Always round to negative infinity if (numerator < 0 && (numerator % int256(denominator) != 0)) weightedArithmeticMeanTick--; } /// @notice Returns the "synthetic" tick which represents the price of the first entry in `tokens` in terms of the last /// @dev Useful for calculating relative prices along routes. /// @dev There must be one tick for each pairwise set of tokens. /// @param tokens The token contract addresses /// @param ticks The ticks, representing the price of each token pair in `tokens` /// @return syntheticTick The synthetic tick, representing the relative price of the outermost tokens in `tokens` function getChainedPrice( address[] memory tokens, int24[] memory ticks ) internal pure returns (int256 syntheticTick) { require(tokens.length - 1 == ticks.length, "DL"); for (uint256 i = 1; i <= ticks.length; i++) { // check the tokens for address sort order, then accumulate the // ticks into the running synthetic tick, ensuring that intermediate tokens "cancel out" tokens[i - 1] < tokens[i] ? syntheticTick += ticks[i - 1] : syntheticTick -= ticks[i - 1]; } } } ================================================ FILE: agent-as-a-service/agent-launchpad/contracts/periphery/libraries/Path.sol ================================================ // SPDX-License-Identifier: GPL-2.0-or-later pragma solidity ^0.8.0; import './BytesLib.sol'; /// @title Functions for manipulating path data for multihop swaps library Path { using BytesLib for bytes; /// @dev The length of the bytes encoded address uint256 private constant ADDR_SIZE = 20; /// @dev The length of the bytes encoded fee uint256 private constant FEE_SIZE = 3; /// @dev The offset of a single token address and pool fee uint256 private constant NEXT_OFFSET = ADDR_SIZE + FEE_SIZE; /// @dev The offset of an encoded pool key uint256 private constant POP_OFFSET = NEXT_OFFSET + ADDR_SIZE; /// @dev The minimum length of an encoding that contains 2 or more pools uint256 private constant MULTIPLE_POOLS_MIN_LENGTH = POP_OFFSET + NEXT_OFFSET; /// @notice Returns true iff the path contains two or more pools /// @param path The encoded swap path /// @return True if path contains two or more pools, otherwise false function hasMultiplePools(bytes memory path) internal pure returns (bool) { return path.length >= MULTIPLE_POOLS_MIN_LENGTH; } /// @notice Returns the number of pools in the path /// @param path The encoded swap path /// @return The number of pools in the path function numPools(bytes memory path) internal pure returns (uint256) { // Ignore the first token address. From then on every fee and token offset indicates a pool. return ((path.length - ADDR_SIZE) / NEXT_OFFSET); } /// @notice Decodes the first pool in path /// @param path The bytes encoded swap path /// @return tokenA The first token of the given pool /// @return tokenB The second token of the given pool /// @return fee The fee level of the pool function decodeFirstPool(bytes memory path) internal pure returns ( address tokenA, address tokenB, uint24 fee ) { tokenA = path.toAddress(0); fee = path.toUint24(ADDR_SIZE); tokenB = path.toAddress(NEXT_OFFSET); } /// @notice Gets the segment corresponding to the first pool in the path /// @param path The bytes encoded swap path /// @return The segment containing all data necessary to target the first pool in the path function getFirstPool(bytes memory path) internal pure returns (bytes memory) { return path.slice(0, POP_OFFSET); } /// @notice Skips a token + fee element from the buffer and returns the remainder /// @param path The swap path /// @return The remaining token + fee elements in the path function skipToken(bytes memory path) internal pure returns (bytes memory) { return path.slice(NEXT_OFFSET, path.length - NEXT_OFFSET); } } ================================================ FILE: agent-as-a-service/agent-launchpad/contracts/periphery/libraries/PoolAddress.sol ================================================ // SPDX-License-Identifier: GPL-2.0-or-later pragma solidity ^0.8.0; import "../../core/interfaces/IUniswapV3Factory.sol"; /// @title Provides functions for deriving a pool address from the factory, tokens, and the fee library PoolAddress { /// @notice The identifying key of the pool struct PoolKey { address token0; address token1; uint24 fee; } /// @notice Returns PoolKey: the ordered tokens with the matched fee levels /// @param tokenA The first token of a pool, unsorted /// @param tokenB The second token of a pool, unsorted /// @param fee The fee level of the pool /// @return Poolkey The pool details with ordered token0 and token1 assignments function getPoolKey( address tokenA, address tokenB, uint24 fee ) internal pure returns (PoolKey memory) { if (tokenA > tokenB) (tokenA, tokenB) = (tokenB, tokenA); return PoolKey({token0: tokenA, token1: tokenB, fee: fee}); } /// @notice Deterministically computes the pool address given the factory and PoolKey /// @param factory The Uniswap V3 factory contract address /// @param key The PoolKey /// @return pool The contract address of the V3 pool function computeAddress( address factory, PoolKey memory key ) internal view returns (address pool) { require(key.token0 < key.token1); pool = IUniswapV3Factory(factory).getPool( key.token0, key.token1, key.fee ); } } ================================================ FILE: agent-as-a-service/agent-launchpad/contracts/periphery/libraries/PoolTicksCounter.sol ================================================ // SPDX-License-Identifier: GPL-2.0-or-later pragma solidity ^0.8.0; import "../../core/interfaces/IUniswapV3Pool.sol"; library PoolTicksCounter { /// @dev This function counts the number of initialized ticks that would incur a gas cost between tickBefore and tickAfter. /// When tickBefore and/or tickAfter themselves are initialized, the logic over whether we should count them depends on the /// direction of the swap. If we are swapping upwards (tickAfter > tickBefore) we don't want to count tickBefore but we do /// want to count tickAfter. The opposite is true if we are swapping downwards. function countInitializedTicksCrossed( IUniswapV3Pool self, int24 tickBefore, int24 tickAfter ) internal view returns (uint32 initializedTicksCrossed) { int16 wordPosLower; int16 wordPosHigher; uint8 bitPosLower; uint8 bitPosHigher; bool tickBeforeInitialized; bool tickAfterInitialized; { // Get the key and offset in the tick bitmap of the active tick before and after the swap. int16 wordPos = int16((tickBefore / self.tickSpacing()) >> 8); uint8 bitPos = uint8(int8((tickBefore / self.tickSpacing()) % 256)); int16 wordPosAfter = int16((tickAfter / self.tickSpacing()) >> 8); uint8 bitPosAfter = uint8( int8((tickAfter / self.tickSpacing()) % 256) ); // In the case where tickAfter is initialized, we only want to count it if we are swapping downwards. // If the initializable tick after the swap is initialized, our original tickAfter is a // multiple of tick spacing, and we are swapping downwards we know that tickAfter is initialized // and we shouldn't count it. tickAfterInitialized = ((self.tickBitmap(wordPosAfter) & (1 << bitPosAfter)) > 0) && ((tickAfter % self.tickSpacing()) == 0) && (tickBefore > tickAfter); // In the case where tickBefore is initialized, we only want to count it if we are swapping upwards. // Use the same logic as above to decide whether we should count tickBefore or not. tickBeforeInitialized = ((self.tickBitmap(wordPos) & (1 << bitPos)) > 0) && ((tickBefore % self.tickSpacing()) == 0) && (tickBefore < tickAfter); if ( wordPos < wordPosAfter || (wordPos == wordPosAfter && bitPos <= bitPosAfter) ) { wordPosLower = wordPos; bitPosLower = bitPos; wordPosHigher = wordPosAfter; bitPosHigher = bitPosAfter; } else { wordPosLower = wordPosAfter; bitPosLower = bitPosAfter; wordPosHigher = wordPos; bitPosHigher = bitPos; } } // Count the number of initialized ticks crossed by iterating through the tick bitmap. // Our first mask should include the lower tick and everything to its left. uint256 mask = type(uint256).max << bitPosLower; while (wordPosLower <= wordPosHigher) { // If we're on the final tick bitmap page, ensure we only count up to our // ending tick. if (wordPosLower == wordPosHigher) { mask = mask & (type(uint256).max >> (255 - bitPosHigher)); } uint256 masked = self.tickBitmap(wordPosLower) & mask; initializedTicksCrossed += countOneBits(masked); wordPosLower++; // Reset our mask so we consider all bits on the next iteration. mask = type(uint256).max; } if (tickAfterInitialized) { initializedTicksCrossed -= 1; } if (tickBeforeInitialized) { initializedTicksCrossed -= 1; } return initializedTicksCrossed; } function countOneBits(uint256 x) private pure returns (uint16) { uint16 bits = 0; while (x != 0) { bits++; x &= (x - 1); } return bits; } } ================================================ FILE: agent-as-a-service/agent-launchpad/contracts/periphery/libraries/PositionKey.sol ================================================ // SPDX-License-Identifier: GPL-2.0-or-later pragma solidity ^0.8.0; library PositionKey { /// @dev Returns the key of the position in the core library function compute( address owner, int24 tickLower, int24 tickUpper ) internal pure returns (bytes32) { return keccak256(abi.encodePacked(owner, tickLower, tickUpper)); } } ================================================ FILE: agent-as-a-service/agent-launchpad/contracts/periphery/libraries/PositionValue.sol ================================================ // SPDX-License-Identifier: GPL-2.0-or-later pragma solidity >=0.6.8 <0.9.0; import "../../core/interfaces/IUniswapV3Pool.sol"; import "../../core/libraries/FixedPoint128.sol"; import "../../core/libraries/TickMath.sol"; import "../../core/libraries/Tick.sol"; import "../interfaces/INonfungiblePositionManager.sol"; import "./LiquidityAmounts.sol"; import "./PoolAddress.sol"; import "./PositionKey.sol"; /// @title Returns information about the token value held in a Uniswap V3 NFT library PositionValue { /// @notice Returns the total amounts of token0 and token1, i.e. the sum of fees and principal /// that a given nonfungible position manager token is worth /// @param positionManager The Uniswap V3 NonfungiblePositionManager /// @param tokenId The tokenId of the token for which to get the total value /// @param sqrtRatioX96 The square root price X96 for which to calculate the principal amounts /// @return amount0 The total amount of token0 including principal and fees /// @return amount1 The total amount of token1 including principal and fees function total( INonfungiblePositionManager positionManager, uint256 tokenId, uint160 sqrtRatioX96 ) internal view returns (uint256 amount0, uint256 amount1) { (uint256 amount0Principal, uint256 amount1Principal) = principal( positionManager, tokenId, sqrtRatioX96 ); (uint256 amount0Fee, uint256 amount1Fee) = fees( positionManager, tokenId ); return (amount0Principal + amount0Fee, amount1Principal + amount1Fee); } /// @notice Calculates the principal (currently acting as liquidity) owed to the token owner in the event /// that the position is burned /// @param positionManager The Uniswap V3 NonfungiblePositionManager /// @param tokenId The tokenId of the token for which to get the total principal owed /// @param sqrtRatioX96 The square root price X96 for which to calculate the principal amounts /// @return amount0 The principal amount of token0 /// @return amount1 The principal amount of token1 function principal( INonfungiblePositionManager positionManager, uint256 tokenId, uint160 sqrtRatioX96 ) internal view returns (uint256 amount0, uint256 amount1) { ( , , , , , int24 tickLower, int24 tickUpper, uint128 liquidity, , , , ) = positionManager.positions(tokenId); return LiquidityAmounts.getAmountsForLiquidity( sqrtRatioX96, TickMath.getSqrtRatioAtTick(tickLower), TickMath.getSqrtRatioAtTick(tickUpper), liquidity ); } struct FeeParams { address token0; address token1; uint24 fee; int24 tickLower; int24 tickUpper; uint128 liquidity; uint256 positionFeeGrowthInside0LastX128; uint256 positionFeeGrowthInside1LastX128; uint256 tokensOwed0; uint256 tokensOwed1; } /// @notice Calculates the total fees owed to the token owner /// @param positionManager The Uniswap V3 NonfungiblePositionManager /// @param tokenId The tokenId of the token for which to get the total fees owed /// @return amount0 The amount of fees owed in token0 /// @return amount1 The amount of fees owed in token1 function fees( INonfungiblePositionManager positionManager, uint256 tokenId ) internal view returns (uint256 amount0, uint256 amount1) { ( , , address token0, address token1, uint24 fee, int24 tickLower, int24 tickUpper, uint128 liquidity, uint256 positionFeeGrowthInside0LastX128, uint256 positionFeeGrowthInside1LastX128, uint256 tokensOwed0, uint256 tokensOwed1 ) = positionManager.positions(tokenId); return _fees( positionManager, FeeParams({ token0: token0, token1: token1, fee: fee, tickLower: tickLower, tickUpper: tickUpper, liquidity: liquidity, positionFeeGrowthInside0LastX128: positionFeeGrowthInside0LastX128, positionFeeGrowthInside1LastX128: positionFeeGrowthInside1LastX128, tokensOwed0: tokensOwed0, tokensOwed1: tokensOwed1 }) ); } function _fees( INonfungiblePositionManager positionManager, FeeParams memory feeParams ) private view returns (uint256 amount0, uint256 amount1) { ( uint256 poolFeeGrowthInside0LastX128, uint256 poolFeeGrowthInside1LastX128 ) = _getFeeGrowthInside( IUniswapV3Pool( PoolAddress.computeAddress( positionManager.factory(), PoolAddress.PoolKey({ token0: feeParams.token0, token1: feeParams.token1, fee: feeParams.fee }) ) ), feeParams.tickLower, feeParams.tickUpper ); amount0 = FullMath.mulDiv( poolFeeGrowthInside0LastX128 - feeParams.positionFeeGrowthInside0LastX128, feeParams.liquidity, FixedPoint128.Q128 ) + feeParams.tokensOwed0; amount1 = FullMath.mulDiv( poolFeeGrowthInside1LastX128 - feeParams.positionFeeGrowthInside1LastX128, feeParams.liquidity, FixedPoint128.Q128 ) + feeParams.tokensOwed1; } function _getFeeGrowthInside( IUniswapV3Pool pool, int24 tickLower, int24 tickUpper ) private view returns (uint256 feeGrowthInside0X128, uint256 feeGrowthInside1X128) { (, int24 tickCurrent, , , , , ) = pool.slot0(); ( , , uint256 lowerFeeGrowthOutside0X128, uint256 lowerFeeGrowthOutside1X128, , , , ) = pool.ticks(tickLower); ( , , uint256 upperFeeGrowthOutside0X128, uint256 upperFeeGrowthOutside1X128, , , , ) = pool.ticks(tickUpper); if (tickCurrent < tickLower) { feeGrowthInside0X128 = lowerFeeGrowthOutside0X128 - upperFeeGrowthOutside0X128; feeGrowthInside1X128 = lowerFeeGrowthOutside1X128 - upperFeeGrowthOutside1X128; } else if (tickCurrent < tickUpper) { uint256 feeGrowthGlobal0X128 = pool.feeGrowthGlobal0X128(); uint256 feeGrowthGlobal1X128 = pool.feeGrowthGlobal1X128(); feeGrowthInside0X128 = feeGrowthGlobal0X128 - lowerFeeGrowthOutside0X128 - upperFeeGrowthOutside0X128; feeGrowthInside1X128 = feeGrowthGlobal1X128 - lowerFeeGrowthOutside1X128 - upperFeeGrowthOutside1X128; } else { feeGrowthInside0X128 = upperFeeGrowthOutside0X128 - lowerFeeGrowthOutside0X128; feeGrowthInside1X128 = upperFeeGrowthOutside1X128 - lowerFeeGrowthOutside1X128; } } } ================================================ FILE: agent-as-a-service/agent-launchpad/contracts/periphery/libraries/SafeERC20Namer.sol ================================================ // SPDX-License-Identifier: GPL-3.0-or-later // from https://github.com/Uniswap/solidity-lib/blob/master/contracts/libraries/SafeERC20Namer.sol // modified for solidity 0.8 pragma solidity ^0.8.0; import "./AddressStringUtil.sol"; // produces token descriptors from inconsistent or absent ERC20 symbol implementations that can return string or bytes32 // this library will always produce a string symbol to represent the token library SafeERC20Namer { function bytes32ToString(bytes32 x) private pure returns (string memory) { bytes memory bytesString = new bytes(32); uint256 charCount = 0; for (uint256 j = 0; j < 32; j++) { bytes1 char = x[j]; if (char != 0) { bytesString[charCount] = char; charCount++; } } bytes memory bytesStringTrimmed = new bytes(charCount); for (uint256 j = 0; j < charCount; j++) { bytesStringTrimmed[j] = bytesString[j]; } return string(bytesStringTrimmed); } // assumes the data is in position 2 function parseStringData( bytes memory b ) private pure returns (string memory) { uint256 charCount = 0; // first parse the charCount out of the data for (uint256 i = 32; i < 64; i++) { charCount <<= 8; charCount += uint8(b[i]); } bytes memory bytesStringTrimmed = new bytes(charCount); for (uint256 i = 0; i < charCount; i++) { bytesStringTrimmed[i] = b[i + 64]; } return string(bytesStringTrimmed); } // uses a heuristic to produce a token name from the address // the heuristic returns the full hex of the address string in upper case function addressToName(address token) private pure returns (string memory) { return AddressStringUtil.toAsciiString(token, 40); } // uses a heuristic to produce a token symbol from the address // the heuristic returns the first 6 hex of the address string in upper case function addressToSymbol( address token ) private pure returns (string memory) { return AddressStringUtil.toAsciiString(token, 6); } // calls an external view token contract method that returns a symbol or name, and parses the output into a string function callAndParseStringReturn( address token, bytes4 selector ) private view returns (string memory) { (bool success, bytes memory data) = token.staticcall( abi.encodeWithSelector(selector) ); // if not implemented, or returns empty data, return empty string if (!success || data.length == 0) { return ""; } // bytes32 data always has length 32 if (data.length == 32) { bytes32 decoded = abi.decode(data, (bytes32)); return bytes32ToString(decoded); } else if (data.length > 64) { return abi.decode(data, (string)); } return ""; } // attempts to extract the token symbol. if it does not implement symbol, returns a symbol derived from the address function tokenSymbol(address token) internal view returns (string memory) { // 0x95d89b41 = bytes4(keccak256("symbol()")) string memory symbol = callAndParseStringReturn(token, 0x95d89b41); if (bytes(symbol).length == 0) { // fallback to 6 uppercase hex of address return addressToSymbol(token); } return symbol; } // attempts to extract the token name. if it does not implement name, returns a name derived from the address function tokenName(address token) internal view returns (string memory) { // 0x06fdde03 = bytes4(keccak256("name()")) string memory name = callAndParseStringReturn(token, 0x06fdde03); if (bytes(name).length == 0) { // fallback to full hex of address return addressToName(token); } return name; } } ================================================ FILE: agent-as-a-service/agent-launchpad/contracts/periphery/libraries/SqrtPriceMathPartial.sol ================================================ // SPDX-License-Identifier: GPL-2.0-or-later pragma solidity ^0.8.0; import '../../core/libraries/FullMath.sol'; import '../../core/libraries/UnsafeMath.sol'; import '../../core/libraries/FixedPoint96.sol'; /// @title Functions based on Q64.96 sqrt price and liquidity /// @notice Exposes two functions from @uniswap/v3-core SqrtPriceMath /// that use square root of price as a Q64.96 and liquidity to compute deltas library SqrtPriceMathPartial { /// @notice Gets the amount0 delta between two prices /// @dev Calculates liquidity / sqrt(lower) - liquidity / sqrt(upper), /// i.e. liquidity * (sqrt(upper) - sqrt(lower)) / (sqrt(upper) * sqrt(lower)) /// @param sqrtRatioAX96 A sqrt price /// @param sqrtRatioBX96 Another sqrt price /// @param liquidity The amount of usable liquidity /// @param roundUp Whether to round the amount up or down /// @return amount0 Amount of token0 required to cover a position of size liquidity between the two passed prices function getAmount0Delta( uint160 sqrtRatioAX96, uint160 sqrtRatioBX96, uint128 liquidity, bool roundUp ) internal pure returns (uint256 amount0) { if (sqrtRatioAX96 > sqrtRatioBX96) (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96); uint256 numerator1 = uint256(liquidity) << FixedPoint96.RESOLUTION; uint256 numerator2 = sqrtRatioBX96 - sqrtRatioAX96; require(sqrtRatioAX96 > 0); return roundUp ? UnsafeMath.divRoundingUp( FullMath.mulDivRoundingUp(numerator1, numerator2, sqrtRatioBX96), sqrtRatioAX96 ) : FullMath.mulDiv(numerator1, numerator2, sqrtRatioBX96) / sqrtRatioAX96; } /// @notice Gets the amount1 delta between two prices /// @dev Calculates liquidity * (sqrt(upper) - sqrt(lower)) /// @param sqrtRatioAX96 A sqrt price /// @param sqrtRatioBX96 Another sqrt price /// @param liquidity The amount of usable liquidity /// @param roundUp Whether to round the amount up, or down /// @return amount1 Amount of token1 required to cover a position of size liquidity between the two passed prices function getAmount1Delta( uint160 sqrtRatioAX96, uint160 sqrtRatioBX96, uint128 liquidity, bool roundUp ) internal pure returns (uint256 amount1) { if (sqrtRatioAX96 > sqrtRatioBX96) (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96); return roundUp ? FullMath.mulDivRoundingUp(liquidity, sqrtRatioBX96 - sqrtRatioAX96, FixedPoint96.Q96) : FullMath.mulDiv(liquidity, sqrtRatioBX96 - sqrtRatioAX96, FixedPoint96.Q96); } } ================================================ FILE: agent-as-a-service/agent-launchpad/contracts/periphery/libraries/TokenRatioSortOrder.sol ================================================ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; library TokenRatioSortOrder { int256 constant NUMERATOR_MOST = 300; int256 constant NUMERATOR_MORE = 200; int256 constant NUMERATOR = 100; int256 constant DENOMINATOR_MOST = -300; int256 constant DENOMINATOR_MORE = -200; int256 constant DENOMINATOR = -100; } ================================================ FILE: agent-as-a-service/agent-launchpad/contracts/periphery/libraries/TransferHelper.sol ================================================ // SPDX-License-Identifier: GPL-2.0-or-later pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import {IERC1155} from "@openzeppelin/contracts/token/ERC1155/IERC1155.sol"; library TransferHelper { /// @notice Transfers tokens from the targeted address to the given destination /// @notice Errors with 'STF' if transfer fails /// @param token The contract address of the token to be transferred /// @param from The originating address from which the tokens will be transferred /// @param to The destination address of the transfer /// @param value The amount to be transferred function safeTransferFrom( address token, address from, address to, uint256 value ) internal { (bool success, bytes memory data) = token.call( abi.encodeWithSelector( IERC20.transferFrom.selector, from, to, value ) ); require( success && (data.length == 0 || abi.decode(data, (bool))), "STF" ); } /// @notice Transfers tokens from msg.sender to a recipient /// @dev Errors with ST if transfer fails /// @param token The contract address of the token which will be transferred /// @param to The recipient of the transfer /// @param value The value of the transfer function safeTransfer(address token, address to, uint256 value) internal { (bool success, bytes memory data) = token.call( abi.encodeWithSelector(IERC20.transfer.selector, to, value) ); require( success && (data.length == 0 || abi.decode(data, (bool))), "ST" ); } /// @notice Approves the stipulated contract to spend the given allowance in the given token /// @dev Errors with 'SA' if transfer fails /// @param token The contract address of the token to be approved /// @param to The target of the approval /// @param value The amount of the given token the target will be allowed to spend function safeApprove(address token, address to, uint256 value) internal { (bool success, bytes memory data) = token.call( abi.encodeWithSelector(IERC20.approve.selector, to, value) ); require( success && (data.length == 0 || abi.decode(data, (bool))), "SA" ); } /// @notice Transfers TC to the recipient address /// @dev Fails with `STE` /// @param to The destination of the transfer /// @param value The value to be transferred function safeTransferETH(address to, uint256 value) internal { (bool success, ) = to.call{value: value}(new bytes(0)); require(success, "STE"); } function transferFromERC1155( address token, address from, address to, uint256 id, uint256 amount ) internal { IERC1155(token).safeTransferFrom(from, to, id, amount, ""); } } ================================================ FILE: agent-as-a-service/agent-launchpad/contracts/periphery/libraries/UniswapV3Broker.sol ================================================ // SPDX-License-Identifier: GPL-3.0-or-later pragma solidity ^0.8.0; import "../../core/interfaces/IUniswapV3Pool.sol"; import "./PoolAddress.sol"; import "./LiquidityAmounts.sol"; import "./PositionKey.sol"; import "../../core/libraries/FixedPoint128.sol"; import "../../core/libraries/TickMath.sol"; library UniswapV3Broker { /// @notice Emitted when liquidity is increased for a position NFT /// @dev Also emitted when a token is minted /// @param tokenId The ID of the token for which liquidity was increased /// @param liquidity The amount by which liquidity for the NFT position was increased /// @param amount0 The amount of token0 that was paid for the increase in liquidity /// @param amount1 The amount of token1 that was paid for the increase in liquidity event IncreaseLiquidity( uint256 indexed tokenId, uint128 liquidity, uint256 amount0, uint256 amount1 ); event DecreaseLiquidity( uint256 indexed tokenId, uint128 liquidity, uint256 amount0, uint256 amount1 ); event Collect( uint256 indexed tokenId, address recipient, uint256 amount0, uint256 amount1 ); struct MintCallbackData { PoolAddress.PoolKey poolKey; address payer; } struct AddLiquidityParams { address token0; address token1; uint24 fee; address recipient; int24 tickLower; int24 tickUpper; uint256 amount0Desired; uint256 amount1Desired; uint256 amount0Min; uint256 amount1Min; } struct IncreaseLiquidityParams { uint256 tokenId; uint256 amount0Desired; uint256 amount1Desired; uint256 amount0Min; uint256 amount1Min; uint256 deadline; } struct DecreaseLiquidityParams { uint256 tokenId; uint128 liquidity; uint256 amount0Min; uint256 amount1Min; uint256 deadline; } struct CollectParams { uint256 tokenId; address recipient; uint128 amount0Max; uint128 amount1Max; } // details about the uniswap position struct Position { // the nonce for permits uint96 nonce; // the address that is approved for spending this token address operator; // the ID of the pool with which this token is connected uint80 poolId; // the tick range of the position int24 tickLower; int24 tickUpper; // the liquidity of the position uint128 liquidity; // the fee growth of the aggregate position as of the last action on the individual position uint256 feeGrowthInside0LastX128; uint256 feeGrowthInside1LastX128; // how many uncollected tokens are owed to the position, as of the last computation uint128 tokensOwed0; uint128 tokensOwed1; } /// @notice Add liquidity to an initialized pool function addLiquidity( address factory, AddLiquidityParams memory params ) public returns ( uint128 liquidity, uint256 amount0, uint256 amount1, IUniswapV3Pool pool ) { PoolAddress.PoolKey memory poolKey = PoolAddress.PoolKey({ token0: params.token0, token1: params.token1, fee: params.fee }); pool = IUniswapV3Pool(PoolAddress.computeAddress(factory, poolKey)); // compute the liquidity amount { (uint160 sqrtPriceX96, , , , , , ) = pool.slot0(); uint160 sqrtRatioAX96 = TickMath.getSqrtRatioAtTick( params.tickLower ); uint160 sqrtRatioBX96 = TickMath.getSqrtRatioAtTick( params.tickUpper ); liquidity = LiquidityAmounts.getLiquidityForAmounts( sqrtPriceX96, sqrtRatioAX96, sqrtRatioBX96, params.amount0Desired, params.amount1Desired ); } (amount0, amount1) = pool.mint( params.recipient, params.tickLower, params.tickUpper, liquidity, abi.encode(MintCallbackData({poolKey: poolKey, payer: msg.sender})) ); require( amount0 >= params.amount0Min && amount1 >= params.amount1Min, "Price slippage check" ); } function increaseLiquidity( address factory, IncreaseLiquidityParams calldata params, UniswapV3Broker.Position memory positionArg, PoolAddress.PoolKey memory poolKey ) public returns ( UniswapV3Broker.Position memory position, uint128 liquidity, uint256 amount0, uint256 amount1 ) { position = positionArg; IUniswapV3Pool pool; (liquidity, amount0, amount1, pool) = addLiquidity( factory, AddLiquidityParams({ token0: poolKey.token0, token1: poolKey.token1, fee: poolKey.fee, tickLower: position.tickLower, tickUpper: position.tickUpper, amount0Desired: params.amount0Desired, amount1Desired: params.amount1Desired, amount0Min: params.amount0Min, amount1Min: params.amount1Min, recipient: address(this) }) ); bytes32 positionKey = PositionKey.compute( address(this), position.tickLower, position.tickUpper ); // this is now updated to the current transaction ( , uint256 feeGrowthInside0LastX128, uint256 feeGrowthInside1LastX128, , ) = pool.positions(positionKey); position.tokensOwed0 += uint128( FullMath.mulDiv( feeGrowthInside0LastX128 - position.feeGrowthInside0LastX128, position.liquidity, FixedPoint128.Q128 ) ); position.tokensOwed1 += uint128( FullMath.mulDiv( feeGrowthInside1LastX128 - position.feeGrowthInside1LastX128, position.liquidity, FixedPoint128.Q128 ) ); position.feeGrowthInside0LastX128 = feeGrowthInside0LastX128; position.feeGrowthInside1LastX128 = feeGrowthInside1LastX128; position.liquidity += liquidity; emit IncreaseLiquidity(params.tokenId, liquidity, amount0, amount1); } function decreaseLiquidity( address factory, DecreaseLiquidityParams calldata params, UniswapV3Broker.Position memory positionArg, PoolAddress.PoolKey memory poolKey ) public returns ( UniswapV3Broker.Position memory position, uint256 amount0, uint256 amount1 ) { require(params.liquidity > 0); position = positionArg; uint128 positionLiquidity = position.liquidity; require(positionLiquidity >= params.liquidity); IUniswapV3Pool pool = IUniswapV3Pool( PoolAddress.computeAddress(factory, poolKey) ); (amount0, amount1) = pool.burn( position.tickLower, position.tickUpper, params.liquidity ); require( amount0 >= params.amount0Min && amount1 >= params.amount1Min, "Price slippage check" ); bytes32 positionKey = PositionKey.compute( address(this), position.tickLower, position.tickUpper ); // this is now updated to the current transaction ( , uint256 feeGrowthInside0LastX128, uint256 feeGrowthInside1LastX128, , ) = pool.positions(positionKey); position.tokensOwed0 += uint128(amount0) + uint128( FullMath.mulDiv( feeGrowthInside0LastX128 - position.feeGrowthInside0LastX128, positionLiquidity, FixedPoint128.Q128 ) ); position.tokensOwed1 += uint128(amount1) + uint128( FullMath.mulDiv( feeGrowthInside1LastX128 - position.feeGrowthInside1LastX128, positionLiquidity, FixedPoint128.Q128 ) ); position.feeGrowthInside0LastX128 = feeGrowthInside0LastX128; position.feeGrowthInside1LastX128 = feeGrowthInside1LastX128; // subtraction is safe because we checked positionLiquidity is gte params.liquidity position.liquidity = positionLiquidity - params.liquidity; emit DecreaseLiquidity( params.tokenId, params.liquidity, amount0, amount1 ); } function collect( address factory, CollectParams calldata params, UniswapV3Broker.Position memory positionArg, PoolAddress.PoolKey memory poolKey ) internal returns ( UniswapV3Broker.Position memory position, address recipient, uint256 amount0, uint256 amount1 ) { require(params.amount0Max > 0 || params.amount1Max > 0); // allow collecting to the nft position manager address with address 0 recipient = params.recipient == address(0) ? address(this) : params.recipient; position = positionArg; IUniswapV3Pool pool = IUniswapV3Pool( PoolAddress.computeAddress(factory, poolKey) ); (uint128 tokensOwed0, uint128 tokensOwed1) = ( position.tokensOwed0, position.tokensOwed1 ); // trigger an update of the position fees owed and fee growth snapshots if it has any liquidity if (position.liquidity > 0) { pool.burn(position.tickLower, position.tickUpper, 0); ( , uint256 feeGrowthInside0LastX128, uint256 feeGrowthInside1LastX128, , ) = pool.positions( PositionKey.compute( address(this), position.tickLower, position.tickUpper ) ); tokensOwed0 += uint128( FullMath.mulDiv( feeGrowthInside0LastX128 - position.feeGrowthInside0LastX128, position.liquidity, FixedPoint128.Q128 ) ); tokensOwed1 += uint128( FullMath.mulDiv( feeGrowthInside1LastX128 - position.feeGrowthInside1LastX128, position.liquidity, FixedPoint128.Q128 ) ); position.feeGrowthInside0LastX128 = feeGrowthInside0LastX128; position.feeGrowthInside1LastX128 = feeGrowthInside1LastX128; } // compute the arguments to give to the pool#collect method (uint128 amount0Collect, uint128 amount1Collect) = ( params.amount0Max > tokensOwed0 ? tokensOwed0 : params.amount0Max, params.amount1Max > tokensOwed1 ? tokensOwed1 : params.amount1Max ); // the actual amounts collected are returned (amount0, amount1) = pool.collect( recipient, position.tickLower, position.tickUpper, amount0Collect, amount1Collect ); // sometimes there will be a few less wei than expected due to rounding down in core, but we just subtract the full amount expected // instead of the actual amount so we can burn the token (position.tokensOwed0, position.tokensOwed1) = ( tokensOwed0 - amount0Collect, tokensOwed1 - amount1Collect ); emit Collect(params.tokenId, recipient, amount0Collect, amount1Collect); } } ================================================ FILE: agent-as-a-service/agent-launchpad/contracts/token/AGENTToken.sol ================================================ // SPDX-License-Identifier: GPL-3.0-or-later pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import {ERC20Permit} from "@openzeppelin/contracts/token/ERC20/extensions/draft-ERC20Permit.sol"; import {ERC20Votes, EIP712} from "@openzeppelin/contracts/token/ERC20/extensions/ERC20Votes.sol"; contract AGENTToken is ERC20, ERC20Permit, ERC20Votes { constructor( string memory name, string memory symbol, uint256 amount, address recipient ) ERC20(name, symbol) ERC20Permit(name) { _mint(recipient, amount); } function _mint( address account, uint256 amount ) internal virtual override(ERC20, ERC20Votes) { return ERC20Votes._mint(account, amount); } function _burn( address account, uint256 amount ) internal virtual override(ERC20, ERC20Votes) { ERC20Votes._burn(account, amount); } function _afterTokenTransfer( address from, address to, uint256 amount ) internal virtual override(ERC20, ERC20Votes) { ERC20Votes._afterTokenTransfer(from, to, amount); } } ================================================ FILE: agent-as-a-service/agent-launchpad/deploy/apechain/deployed.json ================================================ { "proxyAdmin": { "address": "" }, "uniswapV3Factory": { "address": "", "implAddress": "" }, "uniswapV3Pool": { "address": "", "implAddress": "" }, "nftDescriptor": { "address": "", "implAddress": "" }, "nonfungibleTokenPositionDescriptor": { "address": "", "implAddress": "" }, "uniswapV3Broker": { "address": "", "implAddress": "" }, "nonfungiblePositionManager": { "address": "", "implAddress": "" }, "swapRouter": { "address": "", "implAddress": "" }, "quoterV2": { "address": "", "implAddress": "" }, "WETH": { "address": "", "implAddress": "" } } ================================================ FILE: agent-as-a-service/agent-launchpad/deploy/arbitrum/deployed.json ================================================ { "proxyAdmin": { "address": "" }, "uniswapV3Factory": { "address": "", "implAddress": "" }, "uniswapV3Pool": { "address": "", "implAddress": "" }, "nftDescriptor": { "address": "", "implAddress": "" }, "nonfungibleTokenPositionDescriptor": { "address": "", "implAddress": "" }, "uniswapV3Broker": { "address": "", "implAddress": "" }, "nonfungiblePositionManager": { "address": "", "implAddress": "" }, "swapRouter": { "address": "", "implAddress": "" }, "quoterV2": { "address": "", "implAddress": "" }, "WETH": { "address": "", "implAddress": "" } } ================================================ FILE: agent-as-a-service/agent-launchpad/deploy/base/deployed.json ================================================ { "proxyAdmin": { "address": "" }, "uniswapV3Factory": { "address": "", "implAddress": "" }, "uniswapV3Pool": { "address": "", "implAddress": "" }, "nftDescriptor": { "address": "", "implAddress": "" }, "nonfungibleTokenPositionDescriptor": { "address": "", "implAddress": "" }, "uniswapV3Broker": { "address": "", "implAddress": "" }, "nonfungiblePositionManager": { "address": "", "implAddress": "" }, "swapRouter": { "address": "", "implAddress": "" }, "quoterV2": { "address": "", "implAddress": "" }, "WETH": { "address": "", "implAddress": "" } } ================================================ FILE: agent-as-a-service/agent-launchpad/deploy/bittensor/deployed.json ================================================ { "proxyAdmin": { "address": "" }, "uniswapV3Factory": { "address": "", "implAddress": "" }, "uniswapV3Pool": { "address": "", "implAddress": "" }, "nftDescriptor": { "address": "", "implAddress": "" }, "nonfungibleTokenPositionDescriptor": { "address": "", "implAddress": "" }, "uniswapV3Broker": { "address": "", "implAddress": "" }, "nonfungiblePositionManager": { "address": "", "implAddress": "" }, "swapRouter": { "address": "", "implAddress": "" }, "quoterV2": { "address": "", "implAddress": "" }, "WETH": { "address": "", "implAddress": "" } } ================================================ FILE: agent-as-a-service/agent-launchpad/deploy/bsc/deployed.json ================================================ { "proxyAdmin": { "address": "" }, "uniswapV3Factory": { "address": "", "implAddress": "" }, "uniswapV3Pool": { "address": "", "implAddress": "" }, "nftDescriptor": { "address": "", "implAddress": "" }, "nonfungibleTokenPositionDescriptor": { "address": "", "implAddress": "" }, "uniswapV3Broker": { "address": "", "implAddress": "" }, "nonfungiblePositionManager": { "address": "", "implAddress": "" }, "swapRouter": { "address": "", "implAddress": "" }, "quoterV2": { "address": "", "implAddress": "" }, "WETH": { "address": "", "implAddress": "" } } ================================================ FILE: agent-as-a-service/agent-launchpad/deploy/helpers.ts ================================================ import fs from "fs"; import hre, { ethers } from "hardhat"; import { BaseContract, ContractReceipt, ContractTransaction, Signer } from "ethers"; import { ProxyAdmin } from "../typechain"; const res = { getDeploySigner: async (): Promise => { const ethersSigners = await Promise.all(await ethers.getSigners()); return ethersSigners[0]; }, waitForDeploy: async (contract: BaseContract, note: string = ''): Promise => { var tx: ContractTransaction = contract.deployTransaction console.log(note, 'deploy contract', contract.address, 'at', tx.hash, 'waiting...') let r = await tx.wait(1) console.log(note, 'deploy contract', contract.address, 'at', tx.hash, 'confirmed', 'gasUsed', r.gasUsed.toNumber()) return contract }, waitForTx: async (tx: ContractTransaction, note: string = ''): Promise => { console.log(note, 'contract call method at', tx.hash, 'waiting...') let r = await tx.wait(1) console.log(note, 'contract call method at', tx.hash, 'confirmed', r.gasUsed.toNumber()) return r }, notWaitForTx: async (tx: ContractTransaction, note: string = '') => { console.log(note, 'contract call method at', tx.hash, 'not wait') return tx }, tryWaitForTx: async (tx: ContractTransaction, note: string = '') => { console.log(note, 'contract call method at', tx.hash, 'waiting...') let r: ContractReceipt try { r = await tx.wait(1) } catch (ex) { console.log(note, 'contract call method at', tx.hash, 'error', ex) return } console.log(note, 'contract call method at', tx.hash, 'confirmed', 'gasUsed', r.gasUsed.toNumber()) }, sleep: (ms: number) => { return new Promise(resolve => setTimeout(resolve, ms)); }, getGasPrice: async () => { return (await ethers.provider.getGasPrice()).mul(12).div(10); }, verifyContract: async (deployData: DeployData, network: string, address: string, constructorArguments: any, libraries: any, contract: string) => { if (network != 'local') { var verified = deployData.verifiedContracts[address] if (verified == undefined || verified == false) { try { await hre.run("verify:verify", { address: address, constructorArguments: constructorArguments, libraries: libraries, contract: contract, }) } catch (ex) { var err = '' + ex if (!err.includes('Already Verified')) { throw ex } console.log('Already verified contract address on Etherscan.') console.log('https://testnet.arbiscan.io//address/' + address + '#code') } let env = 'testnet' if (network == 'arbitrum') { env = 'mainnet' } deployData.verifiedContracts[address] = true let fileName = process.cwd() + '/deploy/' + network + '/deployed.json'; await fs.writeFileSync(fileName, JSON.stringify(deployData, null, 4)) } } }, upgradeContract: async (proxyAdmin: ProxyAdmin, address: string, implAddress: string) => { if ((await proxyAdmin.getProxyImplementation(address)) != implAddress) { var tx = await proxyAdmin.upgrade(address, implAddress, { nonce: (await ethers.provider.getTransactionCount((await ethers.getSigners())[0].address)), }) console.log('proxyAdmin.upgrade at', address, implAddress, tx.hash, 'waiting...') let r = await tx.wait(1) console.log('proxyAdmin.upgrade at', address, implAddress, tx.hash, 'confirmed', 'gasUsed', r.gasUsed.toNumber()) } }, loadDB: async (network: string) => { let fileName = process.cwd() + '/deploy/' + network + '/deployed.json'; let deployData: DeployData; if (!(fs.existsSync(fileName))) { throw 'deployed file is not existsed' } let dataText = fs.readFileSync(fileName) deployData = JSON.parse(dataText.toString()) return deployData; }, saveDB: async (network: string, deployData: DeployData) => { let fileName = process.cwd() + '/deploy/' + network + '/deployed.json'; if (!(fs.existsSync(fileName))) { throw 'deployed file is not existsed' } fs.writeFileSync(fileName, JSON.stringify(deployData, null, 4)) return deployData; } }; export default res; ================================================ FILE: agent-as-a-service/agent-launchpad/deploy/migrations.ts ================================================ import hre, { ethers } from "hardhat"; import helpers from "./helpers"; import { NonfungiblePositionManager, NonfungibleTokenPositionDescriptor, QuoterV2, SwapRouter, UniswapV3Factory, UniswapV3Broker } from "../typechain"; const { waitForDeploy, waitForTx, loadDB, saveDB, upgradeContract } = helpers; async function main() { await deploy(); } export default deploy; async function deploy() { const network = hre.network.name; const [deployer] = await ethers.getSigners() let deployData = (await loadDB(network)) // if (deployData.proxyAdmin.address == undefined || deployData.proxyAdmin.address == '') { let ProxyAdmin = await hre.ethers.getContractFactory('ProxyAdmin'); let proxyAdmin = await waitForDeploy(await ProxyAdmin.deploy(), 'ProxyAdmin'); { deployData.proxyAdmin.address = proxyAdmin.address; deployData = (await saveDB(network, deployData)) } console.log('proxyAdmin is deployed', proxyAdmin.address) } let proxyAdmin = await hre.ethers.getContractAt('ProxyAdmin', deployData.proxyAdmin.address); // uniswapV3Factory if (deployData.uniswapV3Factory.implAddress == undefined || deployData.uniswapV3Factory.implAddress == '') { let UniswapV3Factory = await hre.ethers.getContractFactory('UniswapV3Factory'); let uniswapV3Factory = await waitForDeploy(await UniswapV3Factory.deploy(), 'UniswapV3Factory'); { deployData.uniswapV3Factory.implAddress = uniswapV3Factory.address; deployData = (await saveDB(network, deployData)) } console.log('uniswapV3Factory is deployed', uniswapV3Factory.address) } // uniswapV3Pool if (deployData.uniswapV3Pool.implAddress == undefined || deployData.uniswapV3Pool.implAddress == '') { let UniswapV3Pool = await hre.ethers.getContractFactory('UniswapV3Pool'); let uniswapV3Pool = await waitForDeploy(await UniswapV3Pool.deploy(), 'UniswapV3Pool'); { deployData.uniswapV3Pool.implAddress = uniswapV3Pool.address; deployData = (await saveDB(network, deployData)) } console.log('uniswapV3Pool is deployed', uniswapV3Pool.address) } if (deployData.uniswapV3Broker.implAddress == undefined || deployData.uniswapV3Broker.implAddress == '') { let UniswapV3Broker = await hre.ethers.getContractFactory('UniswapV3Broker'); let uniswapV3Broker = await waitForDeploy(await UniswapV3Broker.deploy(), 'UniswapV3Broker'); { deployData.uniswapV3Broker.implAddress = uniswapV3Broker.address; deployData = (await saveDB(network, deployData)) } console.log('uniswapV3Broker is deployed', uniswapV3Broker.address) } if (deployData.nftDescriptor.implAddress == undefined || deployData.nftDescriptor.implAddress == '') { let NftDescriptor = await hre.ethers.getContractFactory('NFTDescriptor'); let nftDescriptor = await waitForDeploy(await NftDescriptor.deploy(), 'NFTDescriptor'); { deployData.nftDescriptor.implAddress = nftDescriptor.address; deployData = (await saveDB(network, deployData)) } console.log('nftDescriptor is deployed', nftDescriptor.address) } // nonfungibleTokenPositionDescriptor: ContractData, if (deployData.nonfungibleTokenPositionDescriptor.implAddress == undefined || deployData.nonfungibleTokenPositionDescriptor.implAddress == '') { let NonfungibleTokenPositionDescriptor = await hre.ethers.getContractFactory('NonfungibleTokenPositionDescriptor', { libraries: { NFTDescriptor: deployData.nftDescriptor.implAddress, }, }); let nonfungibleTokenPositionDescriptor = await waitForDeploy(await NonfungibleTokenPositionDescriptor.deploy(), 'NonfungibleTokenPositionDescriptor'); { deployData.nonfungibleTokenPositionDescriptor.implAddress = nonfungibleTokenPositionDescriptor.address; deployData = (await saveDB(network, deployData)) } console.log('nonfungibleTokenPositionDescriptor is deployed', nonfungibleTokenPositionDescriptor.address) } // nonfungiblePositionManager: ContractData, if (deployData.nonfungiblePositionManager.implAddress == undefined || deployData.nonfungiblePositionManager.implAddress == '') { let NonfungiblePositionManager = await hre.ethers.getContractFactory('NonfungiblePositionManager', { libraries: { UniswapV3Broker: deployData.uniswapV3Broker.implAddress, }, }); let nonfungiblePositionManager = await waitForDeploy(await NonfungiblePositionManager.deploy(), 'NonfungiblePositionManager'); { deployData.nonfungiblePositionManager.implAddress = nonfungiblePositionManager.address; deployData = (await saveDB(network, deployData)) } console.log('nonfungiblePositionManager is deployed', nonfungiblePositionManager.address) } // swapRouter: ContractData, if (deployData.swapRouter.implAddress == undefined || deployData.swapRouter.implAddress == '') { let SwapRouter = await hre.ethers.getContractFactory('SwapRouter'); let swapRouter = await waitForDeploy(await SwapRouter.deploy(), 'SwapRouter'); { deployData.swapRouter.implAddress = swapRouter.address; deployData = (await saveDB(network, deployData)) } console.log('swapRouter is deployed', swapRouter.address) } // quoterV2: ContractData, if (deployData.quoterV2.implAddress == undefined || deployData.quoterV2.implAddress == '') { let QuoterV2 = await hre.ethers.getContractFactory('QuoterV2'); let quoterV2 = await waitForDeploy(await QuoterV2.deploy(), 'QuoterV2'); { deployData.quoterV2.implAddress = quoterV2.address; deployData = (await saveDB(network, deployData)) } console.log('quoterV2 is deployed', quoterV2.address) } // proxy const TransparentUpgradeableProxy = await hre.ethers.getContractFactory('TransparentUpgradeableProxy'); // uniswapV3Factory: ContractData, if (deployData.uniswapV3Factory.address == undefined || deployData.uniswapV3Factory.address == '') { var uniswapV3Factory = await hre.ethers.getContractAt('UniswapV3Factory', deployData.uniswapV3Factory.implAddress) as UniswapV3Factory; var initializeData = uniswapV3Factory.interface.encodeFunctionData('initialize'); var transparentUpgradeableProxy = await waitForDeploy( await TransparentUpgradeableProxy.deploy( deployData.uniswapV3Factory.implAddress, deployData.proxyAdmin.address, initializeData, ) ); { deployData.uniswapV3Factory.address = transparentUpgradeableProxy.address; deployData = (await saveDB(network, deployData)) console.log('uniswapV3Factory TransparentUpgradeableProxy is deployed', transparentUpgradeableProxy.address) } } // nonfungibleTokenPositionDescriptor: ContractData, if (deployData.nonfungibleTokenPositionDescriptor.address == undefined || deployData.nonfungibleTokenPositionDescriptor.address == '') { var nonfungibleTokenPositionDescriptor = await hre.ethers.getContractAt('NonfungibleTokenPositionDescriptor', deployData.nonfungibleTokenPositionDescriptor.implAddress) as NonfungibleTokenPositionDescriptor; var initializeData = nonfungibleTokenPositionDescriptor.interface.encodeFunctionData('initialize', [deployData.WETH.address, ethers.utils.formatBytes32String('ETH')]); var transparentUpgradeableProxy = await waitForDeploy( await TransparentUpgradeableProxy.deploy( deployData.nonfungibleTokenPositionDescriptor.implAddress, deployData.proxyAdmin.address, initializeData, ) ); { deployData.nonfungibleTokenPositionDescriptor.address = transparentUpgradeableProxy.address; deployData = (await saveDB(network, deployData)) console.log('nonfungibleTokenPositionDescriptor TransparentUpgradeableProxy is deployed', transparentUpgradeableProxy.address) } } // nonfungiblePositionManager: ContractData, if (deployData.nonfungiblePositionManager.address == undefined || deployData.nonfungiblePositionManager.address == '') { var nonfungiblePositionManager = await hre.ethers.getContractAt('NonfungiblePositionManager', deployData.nonfungiblePositionManager.implAddress) as NonfungiblePositionManager; var initializeData = nonfungiblePositionManager.interface.encodeFunctionData('initialize', [deployData.uniswapV3Factory.address, deployData.WETH.address, deployData.nonfungibleTokenPositionDescriptor.address]); var transparentUpgradeableProxy = await waitForDeploy( await TransparentUpgradeableProxy.deploy( deployData.nonfungiblePositionManager.implAddress, deployData.proxyAdmin.address, initializeData, ) ); { deployData.nonfungiblePositionManager.address = transparentUpgradeableProxy.address; deployData = (await saveDB(network, deployData)) console.log('nonfungiblePositionManager TransparentUpgradeableProxy is deployed', transparentUpgradeableProxy.address) } } // swapRouter: ContractData, if (deployData.swapRouter.address == undefined || deployData.swapRouter.address == '') { var swapRouter = await hre.ethers.getContractAt('SwapRouter', deployData.swapRouter.implAddress) as SwapRouter; var initializeData = swapRouter.interface.encodeFunctionData('initialize', [deployData.uniswapV3Factory.address, deployData.WETH.address]); var transparentUpgradeableProxy = await waitForDeploy( await TransparentUpgradeableProxy.deploy( deployData.swapRouter.implAddress, deployData.proxyAdmin.address, initializeData, ) ); { deployData.swapRouter.address = transparentUpgradeableProxy.address; deployData = (await saveDB(network, deployData)) console.log('swapRouter TransparentUpgradeableProxy is deployed', transparentUpgradeableProxy.address) } } // quoterV2: ContractData, if (deployData.quoterV2.address == undefined || deployData.quoterV2.address == '') { var quoterV2 = await hre.ethers.getContractAt('QuoterV2', deployData.quoterV2.implAddress) as QuoterV2; var initializeData = quoterV2.interface.encodeFunctionData('initialize', [deployData.uniswapV3Factory.address, deployData.WETH.address]); var transparentUpgradeableProxy = await waitForDeploy( await TransparentUpgradeableProxy.deploy( deployData.quoterV2.implAddress, deployData.proxyAdmin.address, initializeData, ) ); { deployData.quoterV2.address = transparentUpgradeableProxy.address; deployData = (await saveDB(network, deployData)) console.log('quoterV2 TransparentUpgradeableProxy is deployed', transparentUpgradeableProxy.address) } } // { await upgradeContract(proxyAdmin, deployData.uniswapV3Factory.address, deployData.uniswapV3Factory.implAddress) await upgradeContract(proxyAdmin, deployData.nonfungibleTokenPositionDescriptor.address, deployData.nonfungibleTokenPositionDescriptor.implAddress) await upgradeContract(proxyAdmin, deployData.nonfungiblePositionManager.address, deployData.nonfungiblePositionManager.implAddress) await upgradeContract(proxyAdmin, deployData.swapRouter.address, deployData.swapRouter.implAddress) await upgradeContract(proxyAdmin, deployData.quoterV2.address, deployData.quoterV2.implAddress) // var uniswapV3Factory = await hre.ethers.getContractAt('UniswapV3Factory', deployData.uniswapV3Factory.address) as UniswapV3Factory; if ((await uniswapV3Factory.getUniswapV3PoolImplementation()).toLowerCase() != deployData.uniswapV3Pool.implAddress.toLowerCase()) { await waitForTx( await uniswapV3Factory.setUniswapV3PoolImplementation(deployData.uniswapV3Pool.implAddress), `uniswapV3Factory.setUniswapV3PoolImplementation(${deployData.uniswapV3Pool.implAddress})` ) } if ((await uniswapV3Factory.feeProtocol()) != 17) { await waitForTx( await uniswapV3Factory.setFeeProtocol(1, 1), `uniswapV3Factory.setFeeProtocol(1,1)` ) } const feeTo = deployer.address if ((await uniswapV3Factory.feeTo()).toLowerCase() != feeTo.toLowerCase()) { await waitForTx( await uniswapV3Factory.setFeeTo(feeTo), `swapRouter.setFeeTo(${feeTo})` ) } var nonfungibleTokenPositionDescriptor = await hre.ethers.getContractAt('NonfungibleTokenPositionDescriptor', deployData.nonfungibleTokenPositionDescriptor.address) as NonfungibleTokenPositionDescriptor; if ((await nonfungibleTokenPositionDescriptor.WETH()).toLowerCase() != deployData.WETH.address.toLowerCase()) { await waitForTx( await nonfungibleTokenPositionDescriptor.setWETH(deployData.WETH.address, ethers.utils.formatBytes32String('ETH')), `nonfungibleTokenPositionDescriptor.setWETH(${deployData.WETH.address})` ) } const nonfungiblePositionManager = await ethers.getContractAt("NonfungiblePositionManager", deployData.nonfungiblePositionManager.address) as NonfungiblePositionManager; if ((await nonfungiblePositionManager.WETH()).toLowerCase() != deployData.WETH.address.toLowerCase()) { await waitForTx( await nonfungiblePositionManager.setWETH(deployData.WETH.address), `nonfungiblePositionManager.setWETH(${deployData.WETH.address})` ) } const swapRouter = await ethers.getContractAt("SwapRouter", deployData.swapRouter.address) as SwapRouter; if ((await swapRouter.WETH()).toLowerCase() != deployData.WETH.address.toLowerCase()) { await waitForTx( await swapRouter.setWETH(deployData.WETH.address), `swapRouter.setWETH(${deployData.WETH.address})` ) } const quoterV2 = await ethers.getContractAt("QuoterV2", deployData.quoterV2.address) as QuoterV2; if ((await quoterV2.WETH()).toLowerCase() != deployData.WETH.address.toLowerCase()) { await waitForTx( await quoterV2.setWETH(deployData.WETH.address), `quoterV2.setWETH(${deployData.WETH.address})` ) } } } // We recommend this pattern to be able to use async/await everywhere // and properly handle errors. main().catch((error) => { console.error(error); process.exitCode = 1; }); ================================================ FILE: agent-as-a-service/agent-launchpad/deploy/types.ts ================================================ type ContractData = { address: string, implAddress: string, } type DeployData = { verifiedContracts: any, proxyAdmin: ContractData, uniswapV3Factory: ContractData, uniswapV3Pool: ContractData, uniswapV3Broker: ContractData, nftDescriptor: ContractData, nonfungibleTokenPositionDescriptor: ContractData, nonfungiblePositionManager: ContractData, swapRouter: ContractData, quoterV2: ContractData, WETH: ContractData, EAI: ContractData, agentShares: ContractData, } ================================================ FILE: agent-as-a-service/agent-launchpad/hardhat.config.ts ================================================ import '@nomiclabs/hardhat-ethers' import '@nomiclabs/hardhat-waffle' import '@nomiclabs/hardhat-etherscan' import "hardhat-contract-sizer" import "hardhat-dependency-compiler" import "@solarity/hardhat-gobind" import "hardhat-deploy"; import '@typechain/hardhat' import * as dotenv from 'dotenv'; dotenv.config(); export default { etherscan: { }, networks: { hardhat: { allowUnlimitedContractSize: true, }, arbitrum: { url: `https://arbitrum.llamarpc.com`, accounts: [process.env.DEPLOYER_KEY], }, base: { url: `https://base.llamarpc.com`, accounts: [process.env.DEPLOYER_KEY], }, bsc: { url: `https://bnb-mainnet.g.alchemy.com/v2/`, accounts: [process.env.DEPLOYER_KEY], }, bittensor: { url: `https://lite.chain.opentensor.ai`, accounts: [process.env.DEPLOYER_KEY], }, apechain: { url: `https://apechain-mainnet.g.alchemy.com/v2/`, accounts: [process.env.DEPLOYER_KEY], }, }, dependencyCompiler: { // We have to compile from source since UniswapV3 doesn't provide artifacts in their npm package paths: [ "@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol", "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol", ], }, namedAccounts: { deployer: 0, }, contractSizer: { // max bytecode size is 24.576 KB alphaSort: true, runOnCompile: true, disambiguatePaths: true, except: ["@openzeppelin/", "test/"], }, // gasReporter: { // excludeContracts: ["test", '*'], // }, typechain: { outDir: 'typechain', target: 'ethers-v5', externalArtifacts: [] }, solidity: { version: "0.8.19", settings: { "optimizer": { "enabled": true, "runs": 200 }, viaIR: true }, }, gobind: { outdir: "./artifacts/gobind", deployable: true, runOnCompile: true, verbose: false, onlyFiles: [], skipFiles: [], }, } ================================================ FILE: agent-as-a-service/agent-launchpad/package.json ================================================ { "name": "trustless-swapv3", "version": "1.0.0", "main": "index.js", "repository": "git@github.com:TrustlessMarket/trustless-swapv3.git", "author": "ken ", "license": "MIT", "files": [ "artifacts/contracts/", "contracts/" ], "dependencies": { "@ethereum-waffle/chai": "^2.5.1", "@ethereum-waffle/compiler": "^4.0.3", "@ethereum-waffle/mock-contract": "^4.0.4", "@nomiclabs/hardhat-waffle": "^2.0.6", "@solarity/hardhat-gobind": "^1.2.2", "base64-sol": "1.0.1", "dotenv": "^16.0.3", "ethereum-waffle": "^2.2.0", "hardhat": "^2.15.0", "hardhat-contract-sizer": "^2.9.0", "hardhat-dependency-compiler": "^1.1.3", "hardhat-deploy": "^0.11.29", "solc": "0.7.6", "ts-generator": "^0.1.1" }, "devDependencies": { "@ethersproject/abi": "^5.4.7", "@ethersproject/providers": "^5.4.7", "@nomicfoundation/hardhat-chai-matchers": "^1.0.0", "@nomicfoundation/hardhat-network-helpers": "^1.0.0", "@nomicfoundation/hardhat-toolbox": "^1.0.2", "@nomiclabs/hardhat-ethers": "^2.0.0", "@nomiclabs/hardhat-etherscan": "^3.1.7", "@openzeppelin/contracts": "4.9.5", "@openzeppelin/contracts-upgradeable": "4.9.5", "@typechain/ethers-v5": "^10.2.1", "@typechain/hardhat": "^6.1.6", "@types/chai": "^4.2.0", "@types/mocha": ">=9.1.0", "@types/node": ">=12.0.0", "chai": "^4.2.0", "ethers": "^5.4.7", "hardhat-gas-reporter": "^1.0.2", "solidity-coverage": "^0.7.22", "ts-node": ">=8.0.0", "typechain": "^8.1.1", "typescript": "^5.0.4" }, "scripts": { "compile": "hardhat compile", "migrateBase": "yarn compile; hardhat run deploy/migrations.ts --network base", "migrateArbitrum": "yarn compile; hardhat run deploy/migrations.ts --network arbitrum", "migrateBsc": "yarn compile; hardhat run deploy/migrations.ts --network bsc", "migrateBittensor": "yarn compile; hardhat run deploy/migrations.ts --network bittensor", "migrateApechain": "yarn compile; hardhat run deploy/migrations.ts --network apechain" } } ================================================ FILE: agent-as-a-service/agent-launchpad/tsconfig.json ================================================ { "compilerOptions": { "target": "es2020", "module": "commonjs", "esModuleInterop": true, "resolveJsonModule": true, "forceConsistentCasingInFileNames": true, "strict": true, "skipLibCheck": true, "typeRoots": [ "./typechain", "./node_modules/@types" ], "types": [] }, "include": [ "test", "deploy", "script", "typechain", ], "files": [ "./hardhat.config.ts" ] } ================================================ FILE: agent-as-a-service/agent-orchestration/README.md ================================================ # Agent Orchestration ================================================ FILE: agent-as-a-service/agent-orchestration/backend/.cursorignore ================================================ configs/config.json ================================================ FILE: agent-as-a-service/agent-orchestration/backend/.gitignore ================================================ .DS_Store # Binaries for programs and plugins *.exe *.exe~ *.dll *.so *.dylib *.log # Test binary, build with `go test -c` *.test # Output of the go coverage tool, specifically when used with LiteIDE *.out .env .vscode node_modules dist configs/firebase_service_account.json configs/google_storage.json configs/pubsub.json configs/config.json configs/config.json_ config/config.json vendor* tmp/* test_* .vendor* .tmp/* .test_* .idea .vscode Gopkg.lock Gopkg.toml merge.sh merge_*.sh logs log.log __debug_bin node_modules .env dist build Makefile api.http ================================================ FILE: agent-as-a-service/agent-orchestration/backend/Dockerfile ================================================ FROM golang:1.23-bookworm as deps WORKDIR /app RUN apt-get update && apt-get install -y build-essential git COPY go.mod ./ COPY go.sum ./ RUN go mod download FROM deps as builder COPY . . RUN go build -o imagine-backend . FROM debian:bookworm as runner ENV GIN_MODE=release # Install Google Chrome and dependencies RUN apt-get update && apt-get install -y wget gnupg RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - RUN echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list RUN apt-get update && apt-get install -y google-chrome-stable WORKDIR /app COPY --from=builder /app/imagine-backend /app/imagine-backend RUN chmod +x /app/imagine-backend CMD ["/app/imagine-backend"] ================================================ FILE: agent-as-a-service/agent-orchestration/backend/Dockerfile.compose ================================================ FROM golang:1.23-bookworm ENV GIN_MODE=release WORKDIR /app RUN apt-get update && apt-get install -y build-essential git COPY ./go.mod ./ COPY ./go.sum ./ RUN go mod download COPY ./ ./ RUN mv ./configs/config.json.local ./configs/config.json CMD ["go", "run", "server.go"] ================================================ FILE: agent-as-a-service/agent-orchestration/backend/apis/api_admin.go ================================================ package apis import ( "context" "fmt" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/daos" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/logger" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services" "github.com/gin-gonic/gin" "go.uber.org/zap" ) func (s *Server) AdminTriggerJob(c *gin.Context) { request := &struct { JobName string `json:"job_name"` }{} if err := c.ShouldBindJSON(request); err != nil { c.JSON(400, gin.H{"error": err.Error()}) return } if request.JobName == "" { c.JSON(400, gin.H{"error": "job_name is required"}) return } var err error switch request.JobName { case "JobScanAgentTwitterPostForGenerateVideo": err = s.nls.JobScanAgentTwitterPostForGenerateVideo(context.Background()) case "JobAgentTwitterPostSubmitVideoInfer": err = s.nls.JobAgentTwitterPostSubmitVideoInfer(context.Background()) case "JobAgentTwitterScanResultGenerateVideo": err = s.nls.JobAgentTwitterScanResultGenerateVideo(context.Background()) case "JobAgentTwitterPostGenerateVideo": err = s.nls.JobAgentTwitterPostGenerateVideo(context.Background()) default: c.JSON(400, gin.H{"error": "job_name is not implemented at admin internal"}) } if err != nil { c.JSON(500, gin.H{"error": err.Error()}) return } c.JSON(200, gin.H{"message": "job triggered"}) } func (s *Server) AdminHandleVideo(c *gin.Context) { var request struct { TweetID string `json:"tweet_id"` } request.TweetID = s.stringFromContextQuery(c, "tweet_id") if request.TweetID == "" { c.JSON(400, gin.H{"error": "tweet_id is required"}) return } handleRequest := &services.HandleGenerateVideoRequest{ TweetID: request.TweetID, AgentInfoMentionID: s.conf.VideoAiAgentInfoId, } isHandle := s.stringFromContextQuery(c, "is_handle") if isHandle == "100" { decideHandle := true handleRequest.DecideToHandle = &decideHandle } agentTwitterPost, err := s.nls.HandleGenerateVideoWithSpecificTweet(daos.GetDBMainCtx(context.Background()), handleRequest, "admin_api") if err != nil { logger.Error("handle_video", "internal_api_key error", zap.Error(err)) c.JSON(500, gin.H{"error": err.Error()}) return } if agentTwitterPost == nil { c.JSON(200, gin.H{"message": "agent twitter post is nil"}) return } c.JSON(200, gin.H{"message": fmt.Sprintf("SUCCESS insert agent twitter post id: %d", agentTwitterPost.ID)}) return } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/apis/api_agent.go ================================================ package apis import ( "net/http" "strconv" "strings" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/helpers" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/serializers" "github.com/gin-gonic/gin" ) func (s *Server) GetListAgentCategory(c *gin.Context) { ctx := s.requestContext(c) page, limit := s.pagingFromContext(c) ms, err := s.nls.GetListAgentCategory(ctx, page, limit) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: serializers.NewAgentCategoryRespArry(ms)}) } func (s *Server) GetListAgent(c *gin.Context) { ctx := s.requestContext(c) page, limit := s.pagingFromContext(c) chain := s.chainFromContextQuery(c) creator := s.stringFromContextQuery(c, "creator") kw := s.stringFromContextQuery(c, "keyword") agentTypes, err := s.uintArrayFromContextQuery(c, "agent_type") if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } kbStatus, err := s.uint64FromContextQuery(c, "kb_status") if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ms, count, err := s.nls.GetListAgentInfos(ctx, chain, creator, agentTypes, int64(kbStatus), kw, page, limit) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: serializers.NewAgentInfoRespArry(ms), Count: &count}) } func (s *Server) GetListAgentUnClaimed(c *gin.Context) { ctx := s.requestContext(c) page, limit := s.pagingFromContext(c) search := s.stringFromContextQuery(c, "search") ms, count, err := s.nls.GetListAgentUnClaimed(ctx, search, page, limit) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: serializers.NewAgentInfoRespArry(ms), Count: &count}) } func (s *Server) GetListAgentForDojo(c *gin.Context) { ctx := s.requestContext(c) page, limit := s.pagingFromContext(c) chain := s.chainFromContextQuery(c) creator := s.stringFromContextQuery(c, "creator") agentTypes, err := s.uintArrayFromContextQuery(c, "agent_type") kw := s.stringFromContextQuery(c, "keyword") if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } kbStatus, err := s.uint64FromContextQuery(c, "kb_status") if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ms, count, err := s.nls.GetListAgentInfos(ctx, chain, creator, agentTypes, int64(kbStatus), kw, page, limit) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: serializers.NewAssistantRespArry(ms), Count: &count}) } func (s *Server) GetAgentDetail(c *gin.Context) { ctx := s.requestContext(c) agentID := s.stringFromContextParam(c, "id") chain := s.chainFromContextQuery(c) ms, err := s.nls.GetAgentInfoDetail(ctx, chain, agentID) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: serializers.NewAgentInfoResp(ms)}) } func (s *Server) GetAgentDetailByAgentID(c *gin.Context) { ctx := s.requestContext(c) agentID := s.stringFromContextParam(c, "id") ms, err := s.nls.SyncAgentInfoDetailByAgentID(ctx, agentID) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } estimateTime, err := s.nls.GetEstimateTime(ctx, ms) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } result := serializers.NewAgentInfoResp(ms) result.EstimateTwinDoneTimestamp = estimateTime ctxJSON(c, http.StatusOK, &serializers.Resp{Result: result}) } func (s *Server) GetAgentDetailByAgentIDForDojo(c *gin.Context) { ctx := s.requestContext(c) agentID := s.stringFromContextParam(c, "id") ms, err := s.nls.SyncAgentInfoDetailByAgentID(ctx, agentID) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } estimateTime, err := s.nls.GetEstimateTime(ctx, ms) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } result := serializers.NewAssistantResp(ms) result.AgentInfo.EstimateTwinDoneTimestamp = estimateTime ctxJSON(c, http.StatusOK, &serializers.Resp{Result: result}) } func (s *Server) AdminGetAgentDetailByAgentID(c *gin.Context) { ctx := s.requestContext(c) agentID := s.stringFromContextParam(c, "id") ms, err := s.nls.SyncAgentInfoDetailByAgentID(ctx, agentID) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } agentInfo := &models.AgentInfoResponse{} if err = helpers.Copy(agentInfo, ms); err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } data, err := s.nls.FindAgentSnapshotMission(ctx, ms.ID) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } missions := []*models.AgentSnapshotMissionResp{} if err = helpers.Copy(&missions, data); err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } agentInfo.AgentSnapshotMissions = missions ctxJSON(c, http.StatusOK, &serializers.Resp{Result: agentInfo}) } func (s *Server) AdminGetSnapshotPostActionByAgent(c *gin.Context) { ctx := s.requestContext(c) username := s.stringFromContextQuery(c, "twitter_username") ms, err := s.nls.FindAgenByTwitterUsername(ctx, username) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } agentInfo := &models.AgentInfoWithSnapshotPostActionsResponse{} if err = helpers.Copy(agentInfo, ms); err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } data, err := s.nls.FindAgentSnapshotPostAction(ctx, ms.ID) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } actions := []*models.AgentSnapshotPostActionResp{} if err = helpers.Copy(&actions, data); err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } agentInfo.AgentSnapshotPostAction = actions ctxJSON(c, http.StatusOK, &serializers.Resp{Result: agentInfo}) } func (s *Server) GetAgentDetailByContract(c *gin.Context) { ctx := s.requestContext(c) chain := s.chainFromContextQuery(c) agentContractID := s.stringFromContextParam(c, "id") agentContractAddress := s.stringFromContextParam(c, "address") ms, err := s.nls.GetAgentInfoDetailByContract(ctx, chain, agentContractID, agentContractAddress) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: serializers.NewAgentInfoResp(ms)}) } func (s *Server) UpdateAgentFarcaster(c *gin.Context) { ctx := s.requestContext(c) var req serializers.AgentTwitterInfoReq if err := c.ShouldBindJSON(&req); err != nil { ctxJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } agentID := s.stringFromContextParam(c, "id") resp, err := s.nls.UpdateAgentFarcasterInfo(ctx, agentID, req.FarcasterID, req.FarcasterUsername) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: resp}) } func (s *Server) GetListAgentTwitterPost(c *gin.Context) { ctx := s.requestContext(c) page, limit := s.pagingFromContext(c) chain := s.chainFromContextQuery(c) ms, count, err := s.nls.GetListAgentTwitterPost(ctx, chain, page, limit) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: serializers.NewAgentTwitterPostRespArry(ms), Count: &count}) } func (s *Server) GetAgentTwitterPostDetail(c *gin.Context) { ctx := s.requestContext(c) postID := s.uintFromContextParam(c, "id") ms, err := s.nls.GetAgentTwitterPostDetail(ctx, postID) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: serializers.NewAgentTwitterPostResp(ms)}) } func (s *Server) GetListAgentEaiTopup(c *gin.Context) { ctx := s.requestContext(c) page, limit := s.pagingFromContext(c) agentID := s.stringFromContextParam(c, "id") ms, count, err := s.nls.GetListAgentEaiTopup(ctx, agentID, s.stringFromContextQuery(c, "type"), page, limit) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: serializers.NewAgentEaiTopupRespArry(ms), Count: &count}) } func (s *Server) PreviewAgentSystemPromp(c *gin.Context) { ctx := s.requestContext(c) var req struct { Personality string `json:"personality"` Question string `json:"question"` } if err := c.ShouldBindJSON(&req); err != nil { ctxJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } resp, err := s.nls.PreviewAgentSystemPromp(ctx, req.Personality, req.Question) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: resp}) } func (s *Server) PreviewAgentSystemPrompV1(c *gin.Context) { ctx := s.requestContext(c) var req serializers.PreviewRequest if err := c.ShouldBindJSON(&req); err != nil { ctxJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } if !req.Stream { resp, err := s.nls.PreviewAgentSystemPrompV1(ctx, req.Messages, req.AgentID, req.KbId, req.ModelName) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: resp}) } else { c.Writer.Header().Set("Content-Type", "text/event-stream") c.Writer.Header().Set("Connection", "keep-alive") c.Writer.Header().Set("Cache-Control", "no-cache") c.Writer.WriteHeader(http.StatusOK) c.Writer.WriteHeaderNow() outputChan := make(chan *models.ChatCompletionStreamResponse) errChan := make(chan error) doneChan := make(chan bool) go s.nls.ProcessStreamAgentSystemPromptV1(c, &req, outputChan, errChan, doneChan) s.nls.PreviewStreamAgentSystemPromptV1(c, c.Writer, outputChan, errChan, doneChan) } } func (s *Server) AgentChatSupport(c *gin.Context) { ctx := s.requestContext(c) var req struct { Message string `json:"message"` } if err := c.ShouldBindJSON(&req); err != nil { ctxJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } resp, err := s.nls.AgentChatSupport(ctx, req.Message) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: resp}) } func (s *Server) GetAgentBrainHistory(c *gin.Context) { ctx := s.requestContext(c) page, limit := s.pagingFromContext(c) agentContractID := s.stringFromContextParam(c, "id") postID := s.uintFromContextQuery(c, "post_id") ms, count, err := s.nls.GetAgentBrainHistory(ctx, agentContractID, postID, page, limit) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: serializers.NewAgentSnapshotPostRespArry(ms), Count: &count}) } // /// func (s *Server) CreateUpdateAgentSnapshotMission(c *gin.Context) { ctx := s.requestContext(c) var req []*serializers.AgentSnapshotMissionInfo if err := c.ShouldBindJSON(&req); err != nil { ctxJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } authHeader := c.GetHeader("Authorization") agentID := s.stringFromContextParam(c, "id") resp, err := s.nls.CreateUpdateAgentSnapshotMission(ctx, agentID, authHeader, req) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: serializers.NewAgentInfoResp(resp)}) } func (s *Server) DeleteAgentSnapshotMission(c *gin.Context) { ctx := s.requestContext(c) userAddress, err := s.getUserAddressFromTK1Token(c) if err != nil || userAddress == "" { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(errs.ErrUnAuthorization)}) return } missionID := s.uintFromContextParam(c, "id") resp, err := s.nls.DeleteAgentSnapshotMission(ctx, missionID, userAddress) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: resp}) } func (s *Server) GetBrainDetailByTweetID(c *gin.Context) { ctx := s.requestContext(c) tweetID := s.stringFromContextParam(c, "id") ms, err := s.nls.GetBrainDetailByTweetID(ctx, tweetID) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: serializers.NewAgentSnapshotPostResp(ms)}) } // // func (s *Server) UnlinkAgentTwitterInfo(c *gin.Context) { ctx := s.requestContext(c) agentID := s.stringFromContextParam(c, "id") resp, err := s.nls.UnlinkAgentTwitterInfo(ctx, agentID) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: resp}) } func (s *Server) GetDashBoardAgent(c *gin.Context) { ctx := s.requestContext(c) page, limit := s.pagingFromContext(c) chain := s.chainFromContextQuery(c) sortStr := s.agentSortListFromContext(c) search := s.stringFromContextQuery(c, "search") agentType := s.intFromContextQuery(c, "agent_type") agentTypes := s.stringFromContextQuery(c, "agent_types") categoryIds := s.stringArrayFromContextQuery(c, "category_ids") agentTypesStr := strings.Split(agentTypes, ",") includeHidden, _ := s.boolFromContextQuery(c, "include_hidden") var agentTypesInt []int for _, str := range agentTypesStr { num, err := strconv.Atoi(strings.TrimSpace(str)) if err != nil { continue } agentTypesInt = append(agentTypesInt, num) } contractAddressesStr := s.stringFromContextQuery(c, "contract_addresses") contractAddresses := []string{} if contractAddressesStr != "" { contractAddresses = strings.Split(contractAddressesStr, ",") } model := s.stringFromContextQuery(c, "model") userAddress, _ := s.getUserAddressFromTK1Token(c) installed, _ := s.boolFromContextQuery(c, "installed") ids, _ := s.uintArrayFromContextQuery(c, "ids") exludeIds, _ := s.uintArrayFromContextQuery(c, "exlude_ids") ms, count, err := s.nls.GetDashboardAgentInfos(ctx, contractAddresses, userAddress, chain, agentType, agentTypesInt, "", search, model, installed, ids, exludeIds, categoryIds, includeHidden, sortStr, page, limit) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: serializers.NewAgentInfoRespArry(ms), Count: &count}) } func (s *Server) GetDashBoardAgentDetail(c *gin.Context) { ctx := s.requestContext(c) page, limit := s.pagingFromContext(c) chain := s.chainFromContextQuery(c) sortStr := s.agentSortListFromContext(c) search := s.stringFromContextQuery(c, "search") tokenAddress := s.stringFromContextParam(c, "token_address") if tokenAddress == "" { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(errs.ErrBadRequest)}) return } userAddress, _ := s.getUserAddressFromTK1Token(c) includeHidden, _ := s.boolFromContextQuery(c, "include_hidden") ms, _, err := s.nls.GetDashboardAgentInfos(ctx, []string{}, userAddress, chain, -1, []int{}, tokenAddress, search, "", nil, []uint{}, []uint{}, []string{}, includeHidden, sortStr, page, limit) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } if len(ms) > 0 { ctxJSON(c, http.StatusOK, &serializers.Resp{Result: serializers.NewAgentInfoResp(ms[0])}) return } ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(errs.ErrTokenNotFound)}) } func (s *Server) GetTokenInfoByContract(c *gin.Context) { ctx := s.requestContext(c) tokenAddress := s.stringFromContextParam(c, "id") ms, err := s.nls.GetTokenInfoByContract(ctx, tokenAddress) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: ms}) } func (s *Server) GetWebpageText(c *gin.Context) { ctx := s.requestContext(c) webUrl := s.stringFromContextQuery(c, "url") ms, err := s.nls.GetWebpageText(ctx, webUrl) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: ms}) } func (s *Server) GetAgentMissionConfigs(c *gin.Context) { ctx := s.requestContext(c) chainID := s.chainFromContextQuery(c) platform := s.stringFromContextQuery(c, "platform") ms, err := s.nls.GetAgentSnapshotMissionConfigs(ctx, chainID, platform) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: serializers.NewAgentSnapshotMissionConfigsRespArry(ms)}) } func (s *Server) GetAgentMissionTokens(c *gin.Context) { ctx := s.requestContext(c) rs, err := s.nls.GetAgentSnapshotMissionTokens(ctx) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: rs}) } // ///// func (s *Server) AgentChats(c *gin.Context) { ctx := s.requestContext(c) var req serializers.AgentChatMessageReq if err := c.ShouldBindJSON(&req); err != nil { ctxJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } agentID := s.stringFromContextParam(c, "id") resp, err := s.nls.AgentChats(ctx, agentID, req) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: resp}) } func (s *Server) PauseAgent(c *gin.Context) { ctx := s.requestContext(c) agentID := s.stringFromContextParam(c, "id") resp, err := s.nls.PauseAgent(ctx, agentID) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: resp}) } func (s *Server) UpdateAgentExternalInfo(c *gin.Context) { ctx := s.requestContext(c) var req serializers.AgentExternalInfoReq if err := c.ShouldBindJSON(&req); err != nil { ctxJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } agentID := s.stringFromContextParam(c, "id") resp, err := s.nls.UpdateAgentExternalInfo(ctx, agentID, &req) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: resp}) } func (s *Server) GetAgentSummaryReport(c *gin.Context) { ctx := s.requestContext(c) ms, err := s.nls.GetAgentSummaryReport(ctx) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: serializers.NewAgentReportRespArr(ms)}) } func (s *Server) GetAgentChainFees(c *gin.Context) { ctx := s.requestContext(c) ms, err := s.nls.GetAgentChainFees(ctx) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: ms}) } func (s *Server) GetEaiLiquidityNetowrks(c *gin.Context) { ctxJSON(c, http.StatusOK, &serializers.Resp{Result: models.ETERNALAI_LIQUIDITY_SUPPORTED_NETWORKS}) } func (s *Server) GetAgentInfoInstallInfo(c *gin.Context) { ctx := s.requestContext(c) obj, err := s.nls.GetAgentInfoInstall(ctx, s.stringFromContextQuery(c, "code")) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: obj.User.Address}) } func (s *Server) GetAgentInfoInstallCode(c *gin.Context) { ctx := s.requestContext(c) agentStoreID := s.uintFromContextParam(c, "id") agentInfoID := s.uintFromContextParam(c, "agent_info_id") userAddress, err := s.getUserAddressFromTK1Token(c) if err != nil || userAddress == "" { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(errs.ErrUnAuthorization)}) return } res, err := s.nls.CreateAgentStoreInstallCode(ctx, userAddress, agentStoreID, agentInfoID) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: res.Code}) } func (s *Server) GetAgentLibrary(c *gin.Context) { ctx := s.requestContext(c) networkID, _ := s.uint64FromContextQuery(c, "network_id") agentType := s.intFromContextQuery(c, "agent_type") obj, err := s.nls.GetListAgentLibrary(ctx, agentType, networkID) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: serializers.NewAgentLibraryRespArray(obj)}) } func (s *Server) AddAgentLibrary(c *gin.Context) { networkID, _ := s.uint64FromContextQuery(c, "network_id") ctx := s.requestContext(c) var req serializers.AgentLibraryReq if err := c.ShouldBindJSON(&req); err != nil { ctxJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } _, err := s.nls.SaveAgentLibrary(ctx, networkID, &req) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: true}) } func (s *Server) CheckNameExist(c *gin.Context) { ctx := s.requestContext(c) name := s.stringFromContextQuery(c, "name") networkID, _ := s.uint64FromContextQuery(c, "network_id") isExist, err := s.nls.CheckNameExist(ctx, networkID, name) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: isExist}) } // func (s *Server) GetDashBoardAgentVideo(c *gin.Context) { // ctx := s.requestContext(c) // page, limit := s.pagingFromContext(c) // sortStr := s.agentSortListFromContext(c) // search := s.stringFromContextQuery(c, "search") // userAddress, err := s.getUserAddressFromTK1Token(c) // ms, count, err := s.nls.GetDashboardAgentVideo(ctx, userAddress, "", search, sortStr, page, limit) // if err != nil { // ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) // return // } // ctxJSON(c, http.StatusOK, &serializers.Resp{Result: serializers.NewAgentInfoRespArry(ms), Count: &count}) // } // func (s *Server) GetDashBoardAgentVideoDetail(c *gin.Context) { // ctx := s.requestContext(c) // page, limit := s.pagingFromContext(c) // sortStr := s.agentSortListFromContext(c) // search := s.stringFromContextQuery(c, "search") // tokenAddress := s.stringFromContextParam(c, "token_address") // if tokenAddress == "" { // ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(errs.ErrBadRequest)}) // return // } // userAddress, err := s.getUserAddressFromTK1Token(c) // ms, _, err := s.nls.GetDashboardAgentVideo(ctx, userAddress, tokenAddress, search, sortStr, page, limit) // if err != nil { // ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) // return // } // if len(ms) > 0 { // ctxJSON(c, http.StatusOK, &serializers.Resp{Result: serializers.NewAgentInfoResp(ms[0])}) // return // } // ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(errs.ErrTokenNotFound)}) // return // } func (s *Server) GetListUserVideo(c *gin.Context) { ctx := s.requestContext(c) search := s.stringFromContextQuery(c, "search") creator := s.stringFromContextQuery(c, "creator") insts, err := s.nls.GetListUserVideo(ctx, creator, search) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: serializers.NewUserVideoRespArray(insts)}) } func (s *Server) UpdateAgentCodeVersion(c *gin.Context) { ctx := s.requestContext(c) agentID := s.uintFromContextParam(c, "id") err := s.nls.UpdateAgentUpgradeableCodeVersion(ctx, agentID) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: true}) } func (s *Server) ExportUserPrivateKeyForClaimVideoReward(c *gin.Context) { ctx := s.requestContext(c) userAddress, err := s.getUserAddressFromTK1Token(c) if err != nil || userAddress == "" { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(errs.ErrUnAuthorization)}) return } resp, err := s.nls.ExportUserPrivateKeyForClaimVideoReward(ctx, userAddress) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: resp}) } func (s *Server) GetVideoUserInfo(c *gin.Context) { ctx := s.requestContext(c) creator := s.stringFromContextQuery(c, "creator") insts, err := s.nls.GetVideoUserInfo(ctx, creator) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: serializers.NewUserVideoInfoResp(insts)}) } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/apis/api_agent_assistant.go ================================================ package apis import ( "net/http" "strconv" "strings" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/serializers" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/moralis" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/opensea" "github.com/gin-gonic/gin" ) func (s *Server) AgentCreateAgentStudio(c *gin.Context) { ctx := s.requestContext(c) req := &serializers.StudioReq{} if err := c.ShouldBindJSON(req); err != nil { ctxJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } userAddress, err := s.getUserAddressFromTK1Token(c) if err != nil || userAddress == "" { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(errs.ErrUnAuthorization)}) return } resp, err := s.nls.AgentCreateAgentStudio(ctx, userAddress, req.GraphData) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: serializers.NewAssistantRespArry(resp)}) } func (s *Server) AgentUpdateAgentStudio(c *gin.Context) { ctx := s.requestContext(c) var req serializers.StudioReq if err := c.ShouldBindJSON(&req); err != nil { ctxJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } userAddress, err := s.getUserAddressFromTK1Token(c) if err != nil || userAddress == "" { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(errs.ErrUnAuthorization)}) return } agentID := s.stringFromContextParam(c, "id") resp, err := s.nls.AgentUpdateAgentStudio(ctx, userAddress, agentID, req.GraphData) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: serializers.NewAssistantResp(resp)}) } func (s *Server) AgentCreateAgentAssistant(c *gin.Context) { ctx := s.requestContext(c) req := &serializers.AssistantsReq{} if err := c.ShouldBindJSON(req); err != nil { ctxJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } userAddress, err := s.getUserAddressFromTK1Token(c) if err != nil || userAddress == "" { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(errs.ErrUnAuthorization)}) return } resp, err := s.nls.AgentCreateAgentAssistant(ctx, userAddress, req) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: serializers.NewAssistantResp(resp)}) } func (s *Server) AgentUpdateAgentAssistant(c *gin.Context) { ctx := s.requestContext(c) var req serializers.AssistantsReq if err := c.ShouldBindJSON(&req); err != nil { ctxJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } userAddress, err := s.getUserAddressFromTK1Token(c) if err != nil || userAddress == "" { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(errs.ErrUnAuthorization)}) return } resp, err := s.nls.AgentUpdateAgentAssistant(ctx, userAddress, &req) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: serializers.NewAssistantResp(resp)}) } func (s *Server) AgentUpdateAgentAssistantInContract(c *gin.Context) { ctx := s.requestContext(c) var req serializers.UpdateAgentAssistantInContractRequest if err := c.ShouldBindJSON(&req); err != nil { ctxJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } userAddress, err := s.getUserAddressFromTK1Token(c) if err != nil || userAddress == "" { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(errs.ErrUnAuthorization)}) return } resp, err := s.nls.UpdateAgentInfoInContract(ctx, userAddress, &req) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: serializers.NewAssistantResp(resp)}) } func (s *Server) UpdateTwinStatus(c *gin.Context) { ctx := s.requestContext(c) var req serializers.UpdateTwinStatusRequest if err := c.ShouldBindJSON(&req); err != nil { ctxJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } resp, err := s.nls.UpdateTwinStatus(ctx, &req) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: serializers.NewAssistantResp(resp)}) } func (s *Server) UploadDataToLightHouse(c *gin.Context) { ctx := s.requestContext(c) var req serializers.DataUploadToLightHouse if err := c.ShouldBindJSON(&req); err != nil { ctxJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } userAddress, err := s.getUserAddressFromTK1Token(c) if err != nil || userAddress == "" { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(errs.ErrUnAuthorization)}) return } resp, err := s.nls.UploadDataToLightHouse(ctx, userAddress, &req) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Data: resp}) } func (s *Server) GetNftOpenseaCollections(c *gin.Context) { ctx := s.requestContext(c) chain := s.stringFromContextQuery(c, "chain") creatorUsername := s.stringFromContextQuery(c, "creator_username") includeHidden := s.stringFromContextQuery(c, "include_hidden") limit := s.stringFromContextQuery(c, "limit") next := s.stringFromContextQuery(c, "next") orderBy := s.stringFromContextQuery(c, "order_by") inscriptionStr := s.stringFromContextQuery(c, "inscription") f := opensea.OpenSeaFilterCollections{} if chain != "" { f.Chain = chain } if creatorUsername != "" { f.CreatorUsername = creatorUsername } if includeHidden != "" { _includeHidden, err1 := strconv.ParseBool(includeHidden) if err1 == nil { f.IncludeHidden = &_includeHidden } } if limit != "" { _limit, err1 := strconv.Atoi(limit) if err1 == nil { f.Limit = _limit } } if next != "" { f.Next = next } if orderBy != "" { f.OrderBy = orderBy } if inscriptionStr != "" { inscription, err1 := strconv.ParseBool(inscriptionStr) if err1 == nil { f.Inscription = &inscription } } result, err := s.nls.OpenseaCollections(ctx, f) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Data: result}) } func (s *Server) GetNftCollectionsDetail(c *gin.Context) { ctx := s.requestContext(c) inscription := s.stringFromContextQuery(c, "inscription") address := s.stringFromContextParam(c, "address") if inscription == "true" { result, err := s.nls.GetInscriptonInfo(ctx, address, opensea.OpenSeaFilterCollections{}) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Data: result}) } else { cursor := c.Query("cursor") pageSize := c.Query("limit") result, err := s.nls.GetNftCollectionMetadataByContract(ctx, address, cursor, pageSize, moralis.MoralisFilter{}) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Data: result}) } } func (s *Server) GetNftCollectionsByTokenID(c *gin.Context) { ctx := s.requestContext(c) inscription := s.stringFromContextQuery(c, "inscription") address := s.stringFromContextParam(c, "address") tokenId := s.stringFromContextParam(c, "tokenId") if inscription == "true" { if !strings.Contains(tokenId, "i0") { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(errs.ErrBadRequest)}) return } result, err := s.nls.GetInscriptonInfoByTokenID(ctx, address, tokenId, opensea.OpenSeaFilterCollections{}) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Data: result}) } else { result, err := s.nls.GetNftCollectionMetadataByTokenID(ctx, address, tokenId, moralis.MoralisFilter{}) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Data: result}) } } func (s *Server) AgentCreateAgentAssistantForLocal(c *gin.Context) { ctx := s.requestContext(c) req := &serializers.AssistantsReq{} if err := c.ShouldBindJSON(req); err != nil { ctxJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } resp, err := s.nls.AgentCreateAgentAssistantForLocal(ctx, req) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: serializers.NewAssistantResp(resp)}) } func (s *Server) MarkInstalledUtilityAgent(c *gin.Context) { ctx := s.requestContext(c) req := &serializers.AgentActionReq{} if err := c.ShouldBindJSON(req); err != nil { ctxJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } userAddress, err := s.getUserAddressFromTK1Token(c) if err != nil || userAddress == "" { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(errs.ErrUnAuthorization)}) return } resp, err := s.nls.MarkInstalledUtilityAgent(ctx, userAddress, req) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: resp}) } func (s *Server) MarkRecentChatUtilityAgent(c *gin.Context) { ctx := s.requestContext(c) req := &serializers.AgentActionReq{} if err := c.ShouldBindJSON(req); err != nil { ctxJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } userAddress, err := s.getUserAddressFromTK1Token(c) if err != nil || userAddress == "" { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(errs.ErrUnAuthorization)}) return } resp, err := s.nls.MarkRecentChatUtilityAgent(ctx, userAddress, req) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: resp}) } func (s *Server) MarkPromptCountUtilityAgent(c *gin.Context) { ctx := s.requestContext(c) agentID := s.uintFromContextParam(c, "id") userAddress, err := s.getUserAddressFromTK1Token(c) if err != nil || userAddress == "" { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(errs.ErrUnAuthorization)}) return } resp, err := s.nls.MarkPromptCountUtilityAgent(ctx, userAddress, agentID) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: resp}) } func (s *Server) LikeAgent(c *gin.Context) { ctx := s.requestContext(c) agentID := s.uintFromContextParam(c, "id") userAddress, err := s.getUserAddressFromTK1Token(c) if err != nil || userAddress == "" { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(errs.ErrUnAuthorization)}) return } resp, err := s.nls.LikeAgent(ctx, userAddress, agentID) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: resp}) } func (s *Server) CheckAgentLiked(c *gin.Context) { ctx := s.requestContext(c) agentID := s.uintFromContextParam(c, "id") userAddress, err := s.getUserAddressFromTK1Token(c) if err != nil || userAddress == "" { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(errs.ErrUnAuthorization)}) return } resp, err := s.nls.CheckAgentLiked(ctx, userAddress, agentID) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: resp}) } func (s *Server) PublicAgent(c *gin.Context) { ctx := s.requestContext(c) agentID := s.uintFromContextParam(c, "id") userAddress, err := s.getUserAddressFromTK1Token(c) if err != nil || userAddress == "" { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(errs.ErrUnAuthorization)}) return } resp, err := s.nls.PublicAgent(ctx, userAddress, agentID) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: resp}) } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/apis/api_agent_infer.go ================================================ package apis import ( "net/http" "strconv" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/serializers" "github.com/gin-gonic/gin" ) func (s *Server) AsyncBatchPrompt(c *gin.Context) { ctx := s.requestContext(c) var req serializers.ChatCompletionRequest if err := c.ShouldBindJSON(&req); err != nil { ctxJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } userAddress, err := s.getUserAddressFromTK1Token(c) if err != nil || userAddress == "" { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(errs.ErrUnAuthorization)}) return } response, err := s.nls.BatchChatCompletionPrompt(ctx, &req) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(errs.ErrUnAuthorization)}) return } ctxJSON(c, http.StatusOK, &serializers.APIResponse{ Status: 1, Message: "OK", Data: response, }) } func (s *Server) GetBatchItem(c *gin.Context) { ctx := s.requestContext(c) idStr := s.stringFromContextParam(c, "id") id, _ := strconv.ParseUint(idStr, 10, 64) resp, err := s.nls.GetBatchItemDetail(ctx, uint(id)) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(errs.ErrBadRequest)}) return } ctxJSON(c, http.StatusOK, &serializers.APIResponse{ Status: 1, Message: "OK", Data: resp, }) } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/apis/api_agent_infra.go ================================================ package apis import ( "context" "fmt" "net/http" "net/http/httputil" "net/url" "os" "strings" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/serializers" "github.com/gin-gonic/gin" ) func (s *Server) proxyAgentStoreMiddleware(prefixPath string) gin.HandlerFunc { return func(c *gin.Context) { r := c.Request w := c.Writer storeId := s.stringFromContextParam(c, "store_id") // infraCode := c.GetHeader("infra-code") agenStore, err := s.nls.GetAgentStore(context.Background(), storeId) if err != nil { c.AbortWithStatusJSON(http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } if agenStore.Status != models.AgentStoreStatusActived || agenStore.Type != models.AgentStoreTypeInfra { c.AbortWithStatusJSON(http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(errs.ErrBadRequest)}) return } // agentStoreInstall, err := s.nls.ValidateUserStoreFee(context.Background(), infraCode) // if err != nil { // c.AbortWithStatusJSON(http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) // return // } var urlPath string director := func(req *http.Request) { hostURL, err := url.Parse(agenStore.ApiUrl) if err != nil { c.AbortWithStatusJSON(http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } if hostURL.Scheme != "https" { c.AbortWithStatusJSON(http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(errs.ErrBadRequest)}) return } if !strings.Contains(hostURL.Host, ".") { c.AbortWithStatusJSON(http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(errs.ErrBadRequest)}) return } prefixPath = prefixPath + "/" + storeId req.URL.Scheme = hostURL.Scheme req.URL.Host = hostURL.Host req.Host = hostURL.Host subPath := strings.TrimPrefix(req.URL.Path, prefixPath) req.URL.Path = strings.TrimSuffix(hostURL.Path, "/") + "/" + strings.TrimPrefix(subPath, "/") query := req.URL.Query() req.URL.RawQuery = query.Encode() for k := range r.Header { v := c.GetHeader(k) req.Header.Set(k, v) } urlPath = req.URL.String() if os.Getenv("DEV") == "true" { fmt.Printf("%s -> %s\n", r.URL.String(), urlPath) } } proxy := &httputil.ReverseProxy{ Director: director, } proxy.ServeHTTP(w, r) // _ = s.nls.ChargeUserStoreInstall(context.Background(), agentStoreInstall.ID, urlPath, w.Status()) } } func (s *Server) ScanAgentInfraMintHash(c *gin.Context) { ctx := s.requestContext(c) userAddress, err := s.getUserAddressFromTK1Token(c) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } networkID, err := s.uint64FromContextQuery(c, "network_id") if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } err = s.nls.ScanAgentInfraMintHash( ctx, userAddress, networkID, s.stringFromContextQuery(c, "tx_hash"), s.uintFromContextParam(c, "agent_store_id"), ) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: true}) } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/apis/api_agent_trade.go ================================================ package apis import ( "net/http" "strings" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/serializers" "github.com/gin-gonic/gin" ) func (s *Server) GetMemeConfigs(c *gin.Context) { ctx := s.requestContext(c) configs, err := s.nls.GetAllConfigs(ctx) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } fractalConfigs := configs[models.BASE_CHAIN_ID] res := map[string]string{} for k, v := range fractalConfigs { if k == "meme_token_fee_address" || k == "meme_token_fee_admin_address" || k == "btc_contract_addr" || k == "meme_mint_whitelist" { res[k] = v } } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: res}) } func (s *Server) GetListMemeByAddress(c *gin.Context) { ctx := s.requestContext(c) address := s.stringFromContextQuery(c, "address") page, limit := s.pagingFromContext(c) txs, count, err := s.nls.GetListMemes(ctx, address, page, limit) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: serializers.NewMemeRespArray(txs), Count: &count}) } func (s *Server) GetListMemeReport(c *gin.Context) { ctx := s.requestContext(c) address := s.stringFromContextQuery(c, "address") page, limit := s.pagingFromContext(c) search := s.stringFromContextQuery(c, "search") status := s.stringFromContextQuery(c, "status") sortStr := s.sortListFromContext(c) sortCol := s.stringFromContextQuery(c, "sort_col") following := false if strings.Contains(sortCol, "following") { following = true } chain := s.chainFromContextQuery(c) ms, count, err := s.nls.GetListMemeReport(ctx, chain, address, search, status, following, sortStr, page, limit, ) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: serializers.NewMemeRespArray(ms), Count: &count}) } func (s *Server) GetFeedMemeReport(c *gin.Context) { ctx := s.requestContext(c) address := s.stringFromContextQuery(c, "address") page, limit := s.pagingFromContext(c) search := s.stringFromContextQuery(c, "search") sortType := s.stringFromContextQuery(c, "sort_type") ms, count, err := s.nls.GetFeedMemeReport(ctx, address, search, sortType, page, limit) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: serializers.NewMemeRespArray(ms), Count: &count}) } func (s *Server) GetMemeDetail(c *gin.Context) { ctx := s.requestContext(c) address := s.stringFromContextQuery(c, "address") tokenAddress := s.stringFromContextParam(c, "id") resp, err := s.nls.GetMemeDetail(ctx, address, tokenAddress) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } // ctxJSON(c, http.StatusOK, &serializers.Resp{Result: serializers.NewMemeResp(ms)}) ctxSTRING(c, http.StatusOK, resp) } func (s *Server) SeenMemeDetail(c *gin.Context) { ctx := s.requestContext(c) address := s.stringFromContextQuery(c, "address") tokenAddress := s.stringFromContextParam(c, "id") go s.nls.CheckedSeenMeme(ctx, address, tokenAddress) ctxJSON(c, http.StatusOK, &serializers.Resp{Result: true}) } func (s *Server) ShareMeme(c *gin.Context) { ctx := s.requestContext(c) address := s.stringFromContextQuery(c, "address") tokenAddress := s.stringFromContextParam(c, "id") go s.nls.ShareMeme(ctx, address, tokenAddress) ctxJSON(c, http.StatusOK, &serializers.Resp{Result: true}) } func (s *Server) GetMemeCandleChart(c *gin.Context) { ctx := s.requestContext(c) day := s.uintFromContextQuery(c, "day") if day == 0 { day = 90 } else if day > 90 { day = 90 } tokenAddress := s.stringFromContextParam(c, "id") chartType := s.stringFromContextQuery(c, "type") resp, err := s.nls.GetMemeChartCandleData(ctx, tokenAddress, day, chartType, ) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxSTRING(c, http.StatusOK, resp) } func (s *Server) GetMemeTradeHistory(c *gin.Context) { ctx := s.requestContext(c) address := s.stringFromContextQuery(c, "address") page, limit := s.pagingFromContext(c) tokenAddress := s.stringFromContextQuery(c, "token_address") ms, count, err := s.nls.GetMemeTradeHistory(ctx, address, tokenAddress, page, limit) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: serializers.NewTradeHistoryRespArry(ms), Count: &count}) } func (s *Server) GetMemeTradeHistoryLatest(c *gin.Context) { ctx := s.requestContext(c) tokenAddress := s.stringFromContextParam(c, "id") resp, err := s.nls.GetMemeTradeHistoryLatest(ctx, tokenAddress) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxSTRING(c, http.StatusOK, resp) } func (s *Server) GetMemeNotification(c *gin.Context) { ctx := s.requestContext(c) address := s.stringFromContextQuery(c, "address") page, limit := s.pagingFromContext(c) ms, count, err := s.nls.GetMemeNotifications(ctx, address, page, limit) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: serializers.NewMemeNotificationRespArry(ms), Count: &count}) } func (s *Server) GetMemeNotificationLatest(c *gin.Context) { ctx := s.requestContext(c) address := s.stringFromContextQuery(c, "address") resp, err := s.nls.GetMemeNotificationLatest(ctx, address) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxSTRING(c, http.StatusOK, resp) } func (s *Server) GetMemeListHolders(c *gin.Context) { ctx := s.requestContext(c) tokenAddress := s.stringFromContextQuery(c, "token_address") resp, err := s.nls.GetTokenHolders(ctx, tokenAddress) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxSTRING(c, http.StatusOK, resp) } func (s *Server) GetMemeListHolding(c *gin.Context) { ctx := s.requestContext(c) address := s.stringFromContextQuery(c, "address") page, limit := s.pagingFromContext(c) ms, count, err := s.nls.GetTokenHolding(ctx, address, page, limit) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: serializers.NewTokenHolderRespArray(ms), Count: &count}) } // /thread // func (s *Server) CreateMemeThread(c *gin.Context) { // ctx := s.requestContext(c) // address := s.stringFromContextQuery(c, "address") // var req serializers.MemeThreadReq // if err := c.ShouldBindJSON(&req); err != nil { // ctxJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) // return // } // meme, err := s.nls.CreateMemeThread(ctx, address, &req) // if err != nil { // ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) // return // } // ctxJSON(c, http.StatusOK, &serializers.Resp{Result: serializers.NewMemeThreadResp(meme)}) // } // func (s *Server) LikeMemeThread(c *gin.Context) { // ctx := s.requestContext(c) // address := s.stringFromContextQuery(c, "address") // var req serializers.MemeThreadReq // if err := c.ShouldBindJSON(&req); err != nil { // ctxJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) // return // } // resp, err := s.nls.LikeMemeThread(ctx, address, &req) // if err != nil { // ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) // return // } // ctxJSON(c, http.StatusOK, &serializers.Resp{Result: resp}) // } // func (s *Server) UnLikeMemeThread(c *gin.Context) { // ctx := s.requestContext(c) // address := s.stringFromContextQuery(c, "address") // var req serializers.MemeThreadReq // if err := c.ShouldBindJSON(&req); err != nil { // ctxJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) // return // } // resp, err := s.nls.UnLikeMemeThread(ctx, address, &req) // if err != nil { // ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) // return // } // ctxJSON(c, http.StatusOK, &serializers.Resp{Result: resp}) // } func (s *Server) GetListMemeThread(c *gin.Context) { ctx := s.requestContext(c) address := s.stringFromContextQuery(c, "address") page, limit := s.pagingFromContext(c) tokenAddress := s.stringFromContextParam(c, "id") ms, count, err := s.nls.GetListMemeThread(ctx, address, tokenAddress, page, limit) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: serializers.NewMemeThreadRespArry(ms), Count: &count}) } func (s *Server) GetListMemeThreadLatest(c *gin.Context) { ctx := s.requestContext(c) tokenAddress := s.stringFromContextParam(c, "id") resp, err := s.nls.GetListMemeThreadLatest(ctx, tokenAddress) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxSTRING(c, http.StatusOK, resp) } // //// User func (s *Server) GetMemeUserProfile(c *gin.Context) { ctx := s.requestContext(c) address := s.stringFromContextQuery(c, "address") ms, err := s.nls.GetMemeUserProfile(ctx, 0, address) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: serializers.NewUserResp(ms)}) } func (s *Server) MemeValidatedFollow(c *gin.Context) { ctx := s.requestContext(c) address := s.stringFromContextQuery(c, "address") userAddress := s.stringFromContextQuery(c, "user_address") valid, err := s.nls.ValidatedFollowed(ctx, address, userAddress) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: valid}) } // func (s *Server) UpdateMemeUserProfile(c *gin.Context) { // ctx := s.requestContext(c) // address := s.stringFromContextQuery(c, "address") // var req serializers.UserProfileReq // if err := c.ShouldBindJSON(&req); err != nil { // ctxJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) // return // } // user, err := s.nls.UpdateUserProfile(ctx, address, &req) // if err != nil { // ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) // return // } // ctxJSON(c, http.StatusOK, &serializers.Resp{Result: serializers.NewUserResp(user)}) // } // / func (s *Server) FollowUser(c *gin.Context) { ctx := s.requestContext(c) address := s.stringFromContextQuery(c, "address") var req serializers.MemeThreadReq if err := c.ShouldBindJSON(&req); err != nil { ctxJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } resp, err := s.nls.FollowUsers(ctx, address, &req) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: resp}) } func (s *Server) UnFollowUser(c *gin.Context) { ctx := s.requestContext(c) address := s.stringFromContextQuery(c, "address") var req serializers.MemeThreadReq if err := c.ShouldBindJSON(&req); err != nil { ctxJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } resp, err := s.nls.UnFollowUsers(ctx, address, &req) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: resp}) } func (s *Server) GetListFollowers(c *gin.Context) { ctx := s.requestContext(c) address := s.stringFromContextQuery(c, "address") page, limit := s.pagingFromContext(c) ms, count, err := s.nls.GetListFollowers(ctx, address, page, limit) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: serializers.NewMemeFollowersRespArray(ms), Count: &count}) } func (s *Server) GetListFollowings(c *gin.Context) { ctx := s.requestContext(c) address := s.stringFromContextQuery(c, "address") page, limit := s.pagingFromContext(c) ms, count, err := s.nls.GetListFollowings(ctx, address, page, limit) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: serializers.NewMemeFollowersRespArray(ms), Count: &count}) } // CrossChain func (s *Server) HideMemeThread(c *gin.Context) { ctx := s.requestContext(c) address := s.stringFromContextQuery(c, "address") threadID := s.uintFromContextParam(c, "id") resp, err := s.nls.HideMemeThread(ctx, address, threadID) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: resp}) } func (s *Server) GetMemeWhiteListAddress(c *gin.Context) { ctx := s.requestContext(c) resp, err := s.nls.GetMemeWhiteListAddress(ctx) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: resp}) } func (s *Server) GetMemeBurnHistory(c *gin.Context) { ctx := s.requestContext(c) address := s.stringFromContextQuery(c, "address") page, limit := s.pagingFromContext(c) tokenAddress := s.stringFromContextQuery(c, "token_address") ms, count, err := s.nls.GetMemeBurnHistory(ctx, 0, address, tokenAddress, page, limit) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: serializers.NewMemeBurnHistoryRespArry(ms), Count: &count}) } func (s *Server) UserSeenMemeNotification(c *gin.Context) { ctx := s.requestContext(c) address := s.stringFromContextQuery(c, "address") notiID := s.uintFromContextParam(c, "id") resp, err := s.nls.UserSeenMemeNotification(ctx, address, notiID) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: resp}) } func (s *Server) GenerateMemeStory(c *gin.Context) { ctx := s.requestContext(c) name := s.stringFromContextQuery(c, "name") story, err := s.nls.GenerateMemeStory(ctx, name) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: story}) } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/apis/api_external_wallet.go ================================================ package apis import ( "net/http" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/serializers" "github.com/gin-gonic/gin" ) func (s *Server) ExternalWalletCreateSOL(c *gin.Context) { ctx := s.requestContext(c) m, err := s.nls.ExternalWalletCreateSOL(ctx) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: m}) } func (s *Server) ExternalWalletGet(c *gin.Context) { ctx := s.requestContext(c) m, err := s.nls.ExternalWalletGet(ctx, c.GetHeader("api-key")) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: m}) } func (s *Server) ExternalWalletBalances(c *gin.Context) { ctx := s.requestContext(c) m, err := s.nls.ExternalWalletBalances(ctx, c.GetHeader("api-key")) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: m}) } func (s *Server) ExternalWalletComputeOrder(c *gin.Context) { ctx := s.requestContext(c) var req serializers.ExternalWalletOrderReq if err := c.ShouldBindJSON(&req); err != nil { ctxJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } m, err := s.nls.ExternalWalletComputeOrder(ctx, c.GetHeader("api-key"), &req) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: m}) } func (s *Server) ExternalWalletCreateOrder(c *gin.Context) { ctx := s.requestContext(c) var req serializers.ExternalWalletOrderReq if err := c.ShouldBindJSON(&req); err != nil { ctxJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } m, err := s.nls.ExternalWalletCreateOrder(ctx, c.GetHeader("api-key"), &req) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: serializers.NewExternalWalletOrderResp(m)}) } func (s *Server) ExternalWalletGetOrders(c *gin.Context) { ctx := s.requestContext(c) page, limit := s.pagingFromContext(c) ms, err := s.nls.ExternalWalletGetOrders(ctx, c.GetHeader("api-key"), page, limit) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: serializers.NewExternalWalletOrderRespArr(ms)}) } func (s *Server) ExternalWalletGetTokens(c *gin.Context) { ctx := s.requestContext(c) ms, err := s.nls.ExternalWalletGetTokens(ctx, c.GetHeader("api-key")) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: serializers.NewExternalWalletTokenRespArr(ms)}) } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/apis/api_infra_twitter_app.go ================================================ package apis import ( "fmt" "net/http" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/serializers" "github.com/gin-gonic/gin" ) // func (s *Server) InfraTwitterAppAuthenInstall(c *gin.Context) { // ctx := s.requestContext(c) // authUrl, err := s.nls.InfraTwitterAppAuthenInstall( // ctx, // s.stringFromContextQuery(c, "install_code"), // s.stringFromContextQuery(c, "install_uri"), // ) // if err != nil { // ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) // return // } // c.Redirect(http.StatusFound, authUrl) // } func (s *Server) InfraTwitterAppAuthenCallback(c *gin.Context) { ctx := s.requestContext(c) _, err := s.nls.InfraTwitterAppAuthenCallback( ctx, s.stringFromContextQuery(c, "address"), s.stringFromContextQuery(c, "code"), ) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } c.Redirect(http.StatusFound, fmt.Sprintf("https://eternalai.org/%d", s.conf.InfraTwitterApp.AgentID)) } func (s *Server) UtilityPostTwitter(c *gin.Context) { ctx := s.requestContext(c) var req serializers.AgentUtilityTwitterReq if err := c.ShouldBindJSON(&req); err != nil { ctxJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } userAddress := s.getUserAddress(c) resp, err := s.nls.UtilityPostTwitter(ctx, userAddress, &req) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err), Result: &resp}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: resp}) } // func (s *Server) UtilityTwitterVerifyDeposit(c *gin.Context) { // ctx := s.requestContext(c) // var req serializers.AgentUtilityTwitterReq // if err := c.ShouldBindJSON(&req); err != nil { // ctxJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) // return // } // userAddress := s.getUserAddress(c) // resp, err := s.nls.UtilityTwitterVerifyDeposit(ctx, userAddress, req.TxHash) // if err != nil { // ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err), Result: &resp}) // return // } // ctxJSON(c, http.StatusOK, &serializers.Resp{Result: resp}) // } func (s *Server) InfraTwitterAppSearchRecentTweet(c *gin.Context) { ctx := s.requestContext(c) query := s.stringFromContextQuery(c, "query") paginationToken := s.stringFromContextQuery(c, "pagination_token") maxResults := s.maxResultFromContextQuery(c) user, err := s.nls.InfraTwitterAppSearchRecentTweet(ctx, query, paginationToken, maxResults) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: user}) } func (s *Server) GetInfraTwitterAppInfo(c *gin.Context) { ctx := s.requestContext(c) userAddress := s.getUserAddress(c) info, err := s.nls.GetInfraTwitterAppInfo(ctx, userAddress) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: *serializers.NewInfraTwitterAppInfoResp(info)}) } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/apis/api_internal.go ================================================ package apis import ( "net/http" "strconv" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/serializers" "github.com/gin-gonic/gin" ) func (s *Server) GetTwitterUserByID(c *gin.Context) { ctx := s.requestContext(c) twitterID := s.stringFromContextParam(c, "id") user, err := s.nls.GetTwitterUserByID(ctx, twitterID) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: user}) } func (s *Server) GetTwitterUserByIDByQuery(c *gin.Context) { ctx := s.requestContext(c) twitterID := s.stringFromContextQuery(c, "id") user, err := s.nls.GetTwitterUserByID(ctx, twitterID) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: user}) } func (s *Server) GetTwitterUserByUserName(c *gin.Context) { ctx := s.requestContext(c) username := s.stringFromContextParam(c, "username") user, err := s.nls.GetTwitterUserByUsername(ctx, username) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: user}) } func (s *Server) GetTwitterUserByUserNameByQuery(c *gin.Context) { ctx := s.requestContext(c) username := s.stringFromContextQuery(c, "username") user, err := s.nls.GetTwitterUserByUsername(ctx, username) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: user}) } func (s *Server) GetTwitterUserByQuery(c *gin.Context) { ctx := s.requestContext(c) usernames := s.stringFromContextQuery(c, "usernames") user, err := s.nls.SeachTwitterUserByQuery(ctx, usernames) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: user}) } func (s *Server) GetTwitterUserFollowing(c *gin.Context) { ctx := s.requestContext(c) twitterID := s.stringFromContextParam(c, "id") paginationToken := s.stringFromContextQuery(c, "pagination_token") user, err := s.nls.GetTwitterUserFollowingRapid(ctx, twitterID, paginationToken) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: user}) } func (s *Server) GetTwitterUserFollowingByQuery(c *gin.Context) { ctx := s.requestContext(c) twitterID := s.stringFromContextQuery(c, "id") paginationToken := s.stringFromContextQuery(c, "pagination_token") user, err := s.nls.GetTwitterUserFollowingRapid(ctx, twitterID, paginationToken) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: user}) } func (s *Server) GetTwitterUserFollowingByUsername(c *gin.Context) { ctx := s.requestContext(c) username := s.stringFromContextParam(c, "username") paginationToken := s.stringFromContextQuery(c, "pagination_token") user, err := s.nls.GetTwitterUserFollowingRapidByUsername(ctx, username, paginationToken) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: user}) } func (s *Server) GetTwitterUserFollowingByUsernameByQuery(c *gin.Context) { ctx := s.requestContext(c) username := s.stringFromContextQuery(c, "username") paginationToken := s.stringFromContextQuery(c, "pagination_token") user, err := s.nls.GetTwitterUserFollowingRapidByUsername(ctx, username, paginationToken) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: user}) } func (s *Server) GetListUserTweets(c *gin.Context) { ctx := s.requestContext(c) twitterID := s.stringFromContextParam(c, "id") paginationToken := s.stringFromContextQuery(c, "pagination_token") maxResults := s.maxResultFromContextQuery(c) user, err := s.nls.GetListUserTweets(ctx, twitterID, paginationToken, maxResults) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: user}) } func (s *Server) GetListUserTweetsAll(c *gin.Context) { ctx := s.requestContext(c) twitterID := s.stringFromContextParam(c, "id") paginationToken := s.stringFromContextQuery(c, "pagination_token") maxResults := s.maxResultFromContextQuery(c) user, err := s.nls.GetListUserTweetsAll(ctx, twitterID, paginationToken, maxResults) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: user}) } func (s *Server) GetListUserTweetsByQuery(c *gin.Context) { ctx := s.requestContext(c) twitterID := s.stringFromContextQuery(c, "id") paginationToken := s.stringFromContextQuery(c, "pagination_token") maxResults := s.maxResultFromContextQuery(c) user, err := s.nls.GetListUserTweetsV1(ctx, twitterID, paginationToken, maxResults) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: user}) } func (s *Server) GetListUserTweetsByUserName(c *gin.Context) { ctx := s.requestContext(c) username := s.stringFromContextParam(c, "username") paginationToken := s.stringFromContextQuery(c, "pagination_token") maxResults := s.maxResultFromContextQuery(c) user, err := s.nls.GetListUserTweetsByUsername(ctx, username, paginationToken, maxResults) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: user}) } func (s *Server) GetListUserTweetsByUserNameV1(c *gin.Context) { ctx := s.requestContext(c) username := s.stringFromContextParam(c, "username") paginationToken := s.stringFromContextQuery(c, "pagination_token") maxResults := s.maxResultFromContextQuery(c) user, err := s.nls.GetListUserTweetsByUsernameV1(ctx, username, paginationToken, maxResults) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: user}) } func (s *Server) GetListUserTweetsByUserNameByQuery(c *gin.Context) { ctx := s.requestContext(c) username := s.stringFromContextQuery(c, "username") paginationToken := s.stringFromContextQuery(c, "pagination_token") maxResults := s.maxResultFromContextQuery(c) user, err := s.nls.GetListUserTweetsByUsernameV1(ctx, username, paginationToken, maxResults) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: user}) } func (s *Server) LookupUserTweets(c *gin.Context) { ctx := s.requestContext(c) ids := s.stringFromContextQuery(c, "ids") user, err := s.nls.LookupUserTweets(ctx, ids) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: user}) } func (s *Server) LookupUserTweetsV1(c *gin.Context) { ctx := s.requestContext(c) ids := s.stringFromContextQuery(c, "ids") user, err := s.nls.LookupUserTweetsV1(ctx, ids) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: user}) } func (s *Server) GetListUserMentions(c *gin.Context) { ctx := s.requestContext(c) twitterID := s.stringFromContextParam(c, "id") paginationToken := s.stringFromContextQuery(c, "pagination_token") maxResults := s.maxResultFromContextQuery(c) user, err := s.nls.GetListUserMentions(ctx, twitterID, paginationToken, maxResults) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: user}) } func (s *Server) GetListUserMentionsByQuery(c *gin.Context) { ctx := s.requestContext(c) twitterID := s.stringFromContextQuery(c, "id") paginationToken := s.stringFromContextQuery(c, "pagination_token") maxResults := s.maxResultFromContextQuery(c) user, err := s.nls.GetListUserMentions(ctx, twitterID, paginationToken, maxResults) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: user}) } func (s *Server) GetListUserMentionsByUsername(c *gin.Context) { ctx := s.requestContext(c) username := s.stringFromContextParam(c, "username") paginationToken := s.stringFromContextQuery(c, "pagination_token") maxResults := s.maxResultFromContextQuery(c) user, err := s.nls.GetAllUserMentionsByUsername(ctx, username, paginationToken, maxResults) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: user}) } func (s *Server) GetAllUserMentionsByUsername(c *gin.Context) { ctx := s.requestContext(c) username := s.stringFromContextParam(c, "username") paginationToken := s.stringFromContextQuery(c, "pagination_token") maxResults := s.maxResultFromContextQuery(c) user, err := s.nls.GetAllUserMentionsByUsername(ctx, username, paginationToken, maxResults) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: user}) } func (s *Server) GetListUserMentionsByUsernameByQuery(c *gin.Context) { ctx := s.requestContext(c) username := s.stringFromContextQuery(c, "username") paginationToken := s.stringFromContextQuery(c, "pagination_token") maxResults := s.maxResultFromContextQuery(c) user, err := s.nls.GetListUserMentionsByUsername(ctx, username, paginationToken, maxResults) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: user}) } func (s *Server) SearchRecentTweet(c *gin.Context) { ctx := s.requestContext(c) query := s.stringFromContextQuery(c, "query") paginationToken := s.stringFromContextQuery(c, "pagination_token") maxResults := s.maxResultFromContextQuery(c) user, err := s.nls.SearchRecentTweet(ctx, query, paginationToken, maxResults) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: user}) } func (s *Server) SearchTokenTweet(c *gin.Context) { ctx := s.requestContext(c) query := s.stringFromContextQuery(c, "query") paginationToken := s.stringFromContextQuery(c, "pagination_token") maxResults := s.maxResultFromContextQuery(c) user, err := s.nls.SearchTokenTweet(ctx, query, paginationToken, maxResults) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: user}) } func (s *Server) SearchUsers(c *gin.Context) { ctx := s.requestContext(c) query := s.stringFromContextQuery(c, "query") paginationToken := s.stringFromContextQuery(c, "pagination_token") user, err := s.nls.SearchUsers(ctx, query, paginationToken) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: user}) } func (s *Server) CreateAgentInternalAction(c *gin.Context) { ctx := s.requestContext(c) var req serializers.AdminAgentActionReq if err := c.ShouldBindJSON(&req); err != nil { ctxJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } err := s.nls.CreateAgentInternalAction(ctx, &req) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: true}) } func (s *Server) CreateAgentInternalActionByRefID(c *gin.Context) { ctx := s.requestContext(c) var req serializers.AdminAgentActionByRefReq if err := c.ShouldBindJSON(&req); err != nil { ctxJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } refId := s.stringFromContextQuery(c, "ref_id") err := s.nls.CreateAgentInternalActionByRefID(ctx, refId, &req) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: true}) } func (s *Server) AgentWalletCreatePumpFunMeme(c *gin.Context) { ctx := s.requestContext(c) var req serializers.AdminCreatePumpfunMemeReq if err := c.ShouldBindJSON(&req); err != nil { ctxJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } err := s.nls.AgentWalletCreatePumpFunMeme(ctx, uint64(s.uintFromContextParam(c, "chain_id")), s.stringFromContextParam(c, "agent_contract_id"), &req) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: true}) } func (s *Server) AgentWalletTradePumpFunMeme(c *gin.Context) { ctx := s.requestContext(c) var req serializers.AdminTradePumpfunMemeReq if err := c.ShouldBindJSON(&req); err != nil { ctxJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } err := s.nls.AgentWalletTradePumpFunMeme(ctx, uint64(s.uintFromContextParam(c, "chain_id")), s.stringFromContextParam(c, "agent_contract_id"), &req) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: true}) } func (s *Server) AgentWalletTradeRaydiumToken(c *gin.Context) { ctx := s.requestContext(c) var req serializers.AdminTradePumpfunMemeReq if err := c.ShouldBindJSON(&req); err != nil { ctxJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } err := s.nls.AgentWalletTradeRaydiumToken(ctx, uint64(s.uintFromContextParam(c, "chain_id")), s.stringFromContextParam(c, "agent_contract_id"), &req) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: true}) } func (s *Server) AgentWalletGetSolanaTokenBalances(c *gin.Context) { ctx := s.requestContext(c) rs, err := s.nls.AgentWalletGetSolanaTokenBalances(ctx, uint64(s.uintFromContextParam(c, "chain_id")), s.stringFromContextParam(c, "agent_contract_id")) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: rs}) } func (s *Server) GetAgentWalletSolanaTrades(c *gin.Context) { ctx := s.requestContext(c) page, limit := s.pagingFromContext(c) rs, err := s.nls.GetAgentWalletSolanaTrades( ctx, uint64(s.uintFromContextParam(c, "chain_id")), s.stringFromContextParam(c, "agent_contract_id"), s.stringFromContextQuery(c, "mint"), page, limit, ) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: rs}) } func (s *Server) AgentWalletGetSolanaTokenPnls(c *gin.Context) { ctx := s.requestContext(c) rs, err := s.nls.AgentWalletGetSolanaTokenPnls( ctx, uint64(s.uintFromContextParam(c, "chain_id")), s.stringFromContextParam(c, "agent_contract_id"), ) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: rs}) } func (s *Server) GetPumpFunTrades(c *gin.Context) { ctx := s.requestContext(c) page, limit := s.pagingFromContext(c) rs, err := s.nls.GetPumpFunTrades(ctx, s.stringFromContextParam(c, "mint"), page, limit) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: rs}) } func (s *Server) GetPumpFunTokenPrice(c *gin.Context) { ctx := s.requestContext(c) rs, err := s.nls.GetPumpFunTokenPrice(ctx, s.stringFromContextParam(c, "mint")) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: rs}) } func (s *Server) DexSearchPair(c *gin.Context) { ctx := s.requestContext(c) rs, err := s.nls.DexSpotPairsLatest(ctx, s.stringFromContextQuery(c, "symbol"), s.stringFromContextQuery(c, "network")) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: rs}) } func (s *Server) DexPairsTradeLatest(c *gin.Context) { ctx := s.requestContext(c) rs, err := s.nls.DexPairsTradeLatest(ctx, s.stringFromContextQuery(c, "contract_address"), s.stringFromContextQuery(c, "network")) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: rs}) } func (s *Server) DexScreenInfo(c *gin.Context) { ctx := s.requestContext(c) rs, err := s.nls.DexScreenInfo(ctx, s.stringFromContextQuery(c, "contract_address")) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: rs}) } func (s *Server) GetUser3700Liked(c *gin.Context) { ctx := s.requestContext(c) page, limit := s.pagingFromContext(c) replied, _ := s.boolFromContextQuery(c, "replied") resp, err := s.nls.GetUser3700Liked(ctx, replied, page, limit) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: serializers.NewTwitterTweetLikedRespArr(resp)}) } func (s *Server) GetSolanaDataChart24Hour(c *gin.Context) { ctx := s.requestContext(c) rs, err := s.nls.GetSolanaDataChart24Hour(ctx, s.stringFromContextParam(c, "mint")) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: rs}) } func (s *Server) GetAgentTradeTokens(c *gin.Context) { ctx := s.requestContext(c) chainID := s.chainFromContextQuery(c) ms, err := s.nls.GetAgentTradeTokens(ctx, chainID) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: serializers.NewAgentTradeTokenRespArry(ms)}) } // /////// func (s *Server) GetListUserTweetsByUsersForTradeMission(c *gin.Context) { ctx := s.requestContext(c) twitterIDs := s.stringFromContextQuery(c, "ids") user, err := s.nls.GetListUserTweetsByUsersForTradeMission(ctx, twitterIDs) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: user}) } func (s *Server) GetListUserTweetsByAgentForTradeMission(c *gin.Context) { ctx := s.requestContext(c) agentID := s.stringFromContextQuery(c, "agent_id") user, err := s.nls.GetListUserTweetsByAgentForTradeMission(ctx, agentID) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: user}) } func (s *Server) GetTokenQuoteLatestForSolana(c *gin.Context) { ctx := s.requestContext(c) rs, err := s.nls.GetTokenQuoteLatestForSolana(ctx, s.stringFromContextQuery(c, "mint")) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: rs}) } func (s *Server) TweetByToken(c *gin.Context) { ctx := s.requestContext(c) var req serializers.AdminTweetReq if err := c.ShouldBindJSON(&req); err != nil { ctxJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } agentInfoIDstr := c.GetHeader("agent-info-id") agentInfoID, _ := strconv.ParseUint(agentInfoIDstr, 10, 64) err := s.nls.TweetByToken(ctx, uint(agentInfoID), &req) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: true}) } func (s *Server) GetTradeAnalytic(c *gin.Context) { ctx := s.requestContext(c) rs, err := s.nls.GetTradeAnalytic(ctx, s.stringFromContextQuery(c, "token")) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: rs}) } func (s *Server) GetTwitterDataForLaunchpad(c *gin.Context) { ctx := s.requestContext(c) twitterID := s.stringFromContextQuery(c, "id") user, err := s.nls.GetTwitterUserByID(ctx, twitterID) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } tweets, err := s.nls.GetListUserTweetsByUsersForTradeMission(ctx, twitterID) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } if user == nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(errs.ErrBadRequest)}) return } tweetsResp := []map[string]interface{}{} for _, v := range tweets { if v.InReplyToUserID == "" { tweetsResp = append(tweetsResp, map[string]interface{}{ "text": v.Text, "created_at": v.CreatedAt, "public_metrics": v.PublicMetrics, }) } } resp := map[string]interface{}{ "followers_count": user.PublicMetrics.Followers, "following_count": user.PublicMetrics.Following, "tweet_count": user.PublicMetrics.Tweets, "listed_count": user.PublicMetrics.Listed, "blue-checked": user.Verified, "recent-tweets": tweetsResp, } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: resp}) } // launchpad func (s *Server) ExecuteLaunchpadTier(c *gin.Context) { ctx := s.requestContext(c) var req serializers.TierReq if err := c.ShouldBindJSON(&req); err != nil { ctxJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } launchpadID := s.uintFromContextParam(c, "id") memberID := s.uintFromContextParam(c, "member_id") err := s.nls.ExecuteLaunchpadTier(ctx, launchpadID, memberID, &req) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: true}) } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/apis/api_key_subscription.go ================================================ package apis import ( "net/http" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/serializers" "github.com/gin-gonic/gin" ) func (s *Server) CreateApiTokenUsage(c *gin.Context) { ctx := s.requestContext(c) var req serializers.ApiTokenUsageReq if err := c.ShouldBindJSON(&req); err != nil { ctxJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } err := s.nls.CreateApiTokenUsage(ctx, req.NetworkID, req.ApiKey, req.Endpoint, req.NumToken) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: true}) } func (s *Server) RefundApiTokenUsage(c *gin.Context) { ctx := s.requestContext(c) var req serializers.ApiTokenUsageReq if err := c.ShouldBindJSON(&req); err != nil { ctxJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } err := s.nls.RefundApiTokenUsage(ctx, req.ApiKey, req.NumToken) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: true}) } func (s *Server) GetApiUsage(c *gin.Context) { ctx := s.requestContext(c) page, limit := s.pagingFromContext(c) apiKey := s.stringFromContextQuery(c, "api_key") lst, count, err := s.nls.GetApiUsage(ctx, apiKey, page, limit) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: serializers.NewApiSubscriptionUsageLogRespArr(lst), Count: &count}) } func (s *Server) GetApiPackages(c *gin.Context) { ctx := s.requestContext(c) packages, err := s.nls.GetApiPackages(ctx) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: serializers.NewApiSubscriptionPackageRespArr(packages)}) } func (s *Server) GetApiSubscriptionInfo(c *gin.Context) { ctx := s.requestContext(c) apiKey := s.stringFromContextQuery(c, "api_key") address := s.stringFromContextQuery(c, "address") obj, err := s.nls.GetApiKeyInfo(ctx, apiKey, address) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: serializers.NewApiSubscriptionKeyRespArr(obj)}) } func (s *Server) CreateAcctForTest(c *gin.Context) { ctx := s.requestContext(c) address := s.stringFromContextQuery(c, "address") twitterID := s.stringFromContextQuery(c, "twitter_id") obj, err := s.nls.CreateApiSubscriptionKeyForTest(ctx, address, twitterID) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: serializers.NewApiSubscriptionKeyResp(obj)}) } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/apis/api_knowledge.go ================================================ package apis import ( "errors" "io" "net/http" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/pkg/utils" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/serializers" "github.com/gin-gonic/gin" openai2 "github.com/sashabaranov/go-openai" ) func (s *Server) createKnowledge(c *gin.Context) { ctx := s.requestContext(c) userAddress, err := s.getUserAddressFromTK1Token(c) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } req := &serializers.CreateKnowledgeRequest{} if err := c.ShouldBindJSON(&req); err != nil { ctxJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } req.UserAddress = userAddress resp, err := s.nls.KnowledgeUsecase.CreateKnowledgeBase(ctx, req) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: resp}) } func (s *Server) webhookKnowledge(c *gin.Context) { ctx := s.requestContext(c) req := &models.RagHookResponse{} if err := c.ShouldBindJSON(&req); err != nil { ctxJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } _, err := s.nls.KnowledgeUsecase.Webhook(ctx, req) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: "success"}) } func (s *Server) webhookKnowledgeFile(c *gin.Context) { ctx := s.requestContext(c) fileHeader, err := c.FormFile("file") file, err := fileHeader.Open() if err != nil { ctxJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } fileBytes, err := io.ReadAll(file) if err != nil { ctxJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } id := s.uintFromContextParam(c, "id") _, err = s.nls.KnowledgeUsecase.WebhookFile(ctx, fileHeader.Filename, fileBytes, id) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: "success"}) } func (s *Server) listKnowledgeByAgent(c *gin.Context) { ctx := s.requestContext(c) ms, err := s.nls.SyncAgentInfoDetailByAgentID(ctx, s.stringFromContextParam(c, "id")) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } data, err := s.nls.KnowledgeUsecase.MapKnowledgeBaseByAgentIds(ctx, []uint{ms.ID}) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } resp := []*serializers.KnowledgeBase{} if kbs, ok := data[ms.ID]; ok { for _, kb := range kbs { kbR := &serializers.KnowledgeBase{} if err := utils.Copy(kbR, kb); err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } resp = append(resp, kbR) } } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: resp}) return } func (s *Server) listKnowledge(c *gin.Context) { ctx := s.requestContext(c) userAddress, err := s.getUserAddressFromTK1Token(c) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: err}) return } req := &models.ListKnowledgeBaseRequest{} if err := c.ShouldBindQuery(&req); err != nil { ctxJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } req.UserAddress = userAddress resp, err := s.nls.KnowledgeUsecase.ListKnowledgeBase(ctx, req) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: err}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: resp}) } func (s *Server) deleteKnowledge(c *gin.Context) { ctx := s.requestContext(c) userAddress, err := s.getUserAddressFromTK1Token(c) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: err}) return } id := s.uintFromContextParam(c, "id") resp, err := s.nls.KnowledgeUsecase.GetKnowledgeBaseById(ctx, id) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: err}) return } if resp.UserAddress != userAddress { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errors.New("You not owner")}) return } if err := s.nls.KnowledgeUsecase.DeleteKnowledgeBaseById(ctx, id); err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: err}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: resp.ID}) } func (s *Server) detailKnowledge(c *gin.Context) { ctx := s.requestContext(c) userAddress, err := s.getUserAddressFromTK1Token(c) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: err}) return } id := s.uintFromContextParam(c, "id") resp, err := s.nls.KnowledgeUsecase.GetKnowledgeBaseById(ctx, id) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: err}) return } if resp.UserAddress != userAddress { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errors.New("You not owner")}) return } r := &serializers.KnowledgeBase{} if err := utils.Copy(r, resp); err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: err}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: r}) } func (s *Server) updateKnowledge(c *gin.Context) { ctx := s.requestContext(c) userAddress, err := s.getUserAddressFromTK1Token(c) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: err}) return } id := s.uintFromContextParam(c, "id") resp, err := s.nls.KnowledgeUsecase.GetKnowledgeBaseById(ctx, id) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: err}) return } if resp.UserAddress != userAddress { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errors.New("You not owner")}) return } req := &serializers.UpdateKnowledgeRequest{} if err := c.ShouldBindJSON(&req); err != nil { ctxJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } updateMap := make(map[string]interface{}) if req.Name != "" { updateMap["name"] = req.Name } if req.Description != "" { updateMap["description"] = req.Description } if req.DomainUrl != "" { updateMap["domain_url"] = req.DomainUrl } if req.NetworkID != 0 { updateMap["network_id"] = req.NetworkID } if err := s.nls.KnowledgeUsecase.UpdateKnowledgeBaseById(c, resp.ID, updateMap); err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: err}) return } resp, _ = s.nls.KnowledgeUsecase.GetKnowledgeBaseById(ctx, id) r := &serializers.KnowledgeBase{} if err := utils.Copy(r, resp); err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: err}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: r}) } func (s *Server) AgentUseKnowledgeBase(c *gin.Context) { ctx := s.requestContext(c) userAddress, err := s.getUserAddressFromTK1Token(c) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: err}) return } req := &serializers.AgentUseKnowledgeBaseRequest{} if err := c.ShouldBindJSON(&req); err != nil { ctxJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } req.UserAddress = userAddress resp, err := s.nls.AgentUseKnowledgeBase(ctx, req) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: resp}) } func (s *Server) updateKnowledgeBaseInContractWithSignature(c *gin.Context) { ctx := s.requestContext(c) userAddress, err := s.getUserAddressFromTK1Token(c) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: err}) return } req := &serializers.UpdateKnowledgeBaseWithSignatureRequest{} if err := c.ShouldBindJSON(&req); err != nil { ctxJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } info, err := s.nls.KnowledgeUsecase.GetKnowledgeBaseByKBTokenId(ctx, req.KnowledgeBaseId) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: err}) return } if info.UserAddress != userAddress { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errors.New("you are not owner")}) return } info, err = s.nls.UpdateKnowledgeBaseInContractWithSignature(ctx, info, req) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: err}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: info}) } func (s *Server) retrieveKnowledge(c *gin.Context) { ctx := s.requestContext(c) req := &serializers.RetrieveKnowledgeRequest{} if err := c.ShouldBindJSON(&req); err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } if req.Prompt == "" || req.KbId == "" { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errors.New("Prompt and KbId are required")}) return } knowledgeBase, err := s.nls.KnowledgeUsecase.GetKnowledgeBaseByKBId(ctx, req.KbId) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(errors.New("Knowledge agent not found"))}) return } chatTopK := 5 if s.conf.KnowledgeBaseConfig.KbChatTopK > 0 { chatTopK = s.conf.KnowledgeBaseConfig.KbChatTopK } if req.TopK > 0 { chatTopK = req.TopK } var threshold *float64 if req.Threshold > 0 { threshold = &req.Threshold } chatCompletionMessages := []openai2.ChatCompletionMessage{} if len(req.Messages) > 0 { chatCompletionMessages = req.Messages } else { chatCompletionMessages = []openai2.ChatCompletionMessage{{ Content: req.Prompt, Role: openai2.ChatMessageRoleUser, }} } systemPrompt := knowledgeBase.AgentInfo.SystemPrompt if chatCompletionMessages[0].Role != openai2.ChatMessageRoleSystem { newChatCompletionMessages := []openai2.ChatCompletionMessage{{ Content: systemPrompt, Role: openai2.ChatMessageRoleSystem, }} newChatCompletionMessages = append(newChatCompletionMessages, chatCompletionMessages...) chatCompletionMessages = newChatCompletionMessages } if req.Stream != nil && *req.Stream { c.Writer.Header().Set("Content-Type", "text/event-stream") c.Writer.Header().Set("Connection", "keep-alive") c.Writer.Header().Set("Cache-Control", "no-cache") c.Writer.WriteHeader(http.StatusOK) c.Writer.WriteHeaderNow() outputChan := make(chan *models.ChatCompletionStreamResponse) errChan := make(chan error) doneChan := make(chan bool) go s.nls.StreamRetrieveKnowledge(ctx, "", chatCompletionMessages, []*models.KnowledgeBase{knowledgeBase}, &chatTopK, threshold, outputChan, errChan, doneChan) s.nls.PreviewStreamAgentSystemPromptV1(c, c.Writer, outputChan, errChan, doneChan) } else { resp, err := s.nls.RetrieveKnowledge("", chatCompletionMessages, []*models.KnowledgeBase{{ KbId: req.KbId, }}, &chatTopK, threshold) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: resp}) } } func (s *Server) checkBalance(c *gin.Context) { ctx := s.requestContext(c) userAddress, err := s.getUserAddressFromTK1Token(c) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: err}) return } id := s.uintFromContextParam(c, "id") resp, err := s.nls.KnowledgeUsecase.GetKnowledgeBaseById(ctx, id) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: err}) return } if resp.UserAddress != userAddress { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errors.New("You not owner")}) return } if resp.Status == models.KnowledgeBaseStatusWaitingPayment { if err := s.nls.KnowledgeUsecase.CheckBalance(ctx, resp); err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errors.New("You not owner")}) return } } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: resp}) } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/apis/api_pump.go ================================================ package apis import ( "fmt" "net/http" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/serializers" "github.com/gin-gonic/gin" ) func (s *Server) GetPumpBalance(c *gin.Context) { apiKey := c.GetHeader("api-key") if apiKey == "" { ctxJSON(c, http.StatusBadRequest, &serializers.Resp{ Error: fmt.Errorf("api-key header is required"), }) return } response, err := s.nls.GetPumpBalance(c.Request.Context(), apiKey) if err != nil { ctxJSON(c, http.StatusInternalServerError, &serializers.Resp{ Error: fmt.Errorf("failed to get pump balance: %w", err), }) return } ctxJSON(c, http.StatusOK, &serializers.Resp{ Data: response, }) } func (s *Server) GetListTrendingTokens(c *gin.Context) { ctx := s.requestContext(c) tokens, err := s.nls.GetListTrendingTokens(ctx) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: serializers.NewTrendingTokenRespArray(tokens)}) } func (s *Server) GetPumpOrderHistory(c *gin.Context) { ctx := s.requestContext(c) apiKey := c.Request.Header.Get("api-key") orderHistory, err := s.nls.GetPumpOrderHistory(ctx, apiKey) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: orderHistory}) } func (s *Server) NotifyChangePricePump(c *gin.Context) { ctxJSON(c, http.StatusOK, &serializers.Resp{Result: true}) } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/apis/api_robot.go ================================================ package apis import ( "net/http" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/serializers" blockchainutils "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/blockchain_utils" "github.com/gin-gonic/gin" ) func (s *Server) GenerateRobotSaleWallet(c *gin.Context) { ctx := s.requestContext(c) var req serializers.RobotSaleWalletReq if err := c.ShouldBindJSON(&req); err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } robotSaleWallet, err := s.nls.GenerateRobotSaleWallet(ctx, req.ProjectID, req.UserAddress) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: serializers.NewRobotSaleWalletResp(robotSaleWallet)}) } func (s *Server) GetRobotSaleWallet(c *gin.Context) { ctx := s.requestContext(c) projectID := s.stringFromContextQuery(c, "project_id") userAddress := s.stringFromContextQuery(c, "user_address") robotSaleWallet, err := s.nls.GetRobotSaleWallet(ctx, projectID, userAddress) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: serializers.NewRobotSaleWalletResp(robotSaleWallet)}) } func (s *Server) GetRobotProject(c *gin.Context) { ctx := s.requestContext(c) projectID := s.stringFromContextQuery(c, "project_id") robotProject, err := s.nls.GetRobotProject(ctx, projectID) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: serializers.NewRobotProjectResp(robotProject)}) } func (s *Server) RobotCreateToken(c *gin.Context) { ctx := s.requestContext(c) var req blockchainutils.SolanaCreateTokenReq if err := c.ShouldBindJSON(&req); err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } robotProject, err := s.nls.RobotCreateToken(ctx, req.ProjectID, &req) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: serializers.NewRobotProjectResp(robotProject)}) } func (s *Server) RobotTransferToken(c *gin.Context) { ctx := s.requestContext(c) var req serializers.RobotTokenTransferReq if err := c.ShouldBindJSON(&req); err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } transfer, err := s.nls.RobotTransferToken(ctx, &req) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: serializers.NewRobotTokenTransferResp(transfer)}) } func (s *Server) GetRobotProjectLeaderBoards(c *gin.Context) { ctx := s.requestContext(c) projectID := s.stringFromContextQuery(c, "project_id") userAddress := s.stringFromContextQuery(c, "user_address") page, limit := s.pagingFromContext(c) lstResp, err := s.nls.GetRobotProjectLeaderBoards(ctx, userAddress, projectID, page, limit) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: serializers.NewRobotSaleWalletRespList(lstResp)}) } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/apis/api_sample_twitter_app.go ================================================ package apis import ( "net/http" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/serializers" "github.com/gin-gonic/gin" ) func (s *Server) SampleTwitterAppAuthenInstall(c *gin.Context) { ctx := s.requestContext(c) authUrl, err := s.nls.SampleTwitterAppAuthenInstall(ctx, s.stringFromContextQuery(c, "install_code"), s.stringFromContextQuery(c, "install_uri")) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } c.Redirect(http.StatusFound, authUrl) } func (s *Server) SampleTwitterAppAuthenCallback(c *gin.Context) { ctx := s.requestContext(c) returnUri, err := s.nls.SampleTwitterAppAuthenCallback(ctx, s.stringFromContextQuery(c, "install_code"), s.stringFromContextQuery(c, "install_uri"), s.stringFromContextQuery(c, "code")) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } c.Redirect(http.StatusFound, returnUri) } func (s *Server) SampleTwitterAppGetBTCPrice(c *gin.Context) { ctx := s.requestContext(c) btcPrice := s.nls.SampleTwitterAppGetBTCPrice(ctx) ctxJSON(c, http.StatusOK, &serializers.Resp{Result: btcPrice}) } func (s *Server) SampleTwitterAppTweetMessage(c *gin.Context) { ctx := s.requestContext(c) var req struct { Content string `json:"content"` } if err := c.ShouldBindJSON(&req); err != nil { ctxJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } tweetId, err := s.nls.SampleTwitterAppTweetMessage(ctx, c.GetHeader("api-key"), req.Content) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: tweetId}) } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/apis/api_store.go ================================================ package apis import ( "net/http" "strconv" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/serializers" "github.com/gin-gonic/gin" ) func (s *Server) UploadMissionStore(c *gin.Context) { ctx := s.requestContext(c) var req serializers.MissionStoreReq if err := c.ShouldBindJSON(&req); err != nil { ctxJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } err := s.nls.UploadMisstionStore(ctx, &req) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: true}) } func (s *Server) RateMissionStore(c *gin.Context) { ctx := s.requestContext(c) var req serializers.MissionStoreRatingReq if err := c.ShouldBindJSON(&req); err != nil { ctxJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } err := s.nls.RatingMisstionStore(ctx, &req) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: true}) } func (s *Server) GetListMissionStore(c *gin.Context) { ctx := s.requestContext(c) page, limit := s.pagingFromContext(c) search := s.stringFromContextQuery(c, "search") res, count, err := s.nls.GetListMisstionStore(ctx, search, page, limit) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: serializers.NewMissionStoreRespArray(res), Count: &count}) } func (s *Server) GetMissionStoreDetail(c *gin.Context) { ctx := s.requestContext(c) idStr := s.stringFromContextParam(c, "id") id, _ := strconv.ParseUint(idStr, 10, 64) res, err := s.nls.GetMisstionStoreDetail(ctx, uint(id)) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: serializers.NewMissionStoreResp(res)}) } func (s *Server) GetMissionStoreRating(c *gin.Context) { ctx := s.requestContext(c) missionStoreIDstr := s.stringFromContextParam(c, "id") missionStoreID, _ := strconv.ParseUint(missionStoreIDstr, 10, 64) page, limit := s.pagingFromContext(c) res, count, err := s.nls.GetMissionStoreRating(ctx, uint(missionStoreID), page, limit) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: serializers.NewMissionStoreRatingRespArray(res), Count: &count}) } func (s *Server) ClaimFeeMissionStore(c *gin.Context) { ctx := s.requestContext(c) s.nls.ClaimFeeMisstionStore(ctx) ctxJSON(c, http.StatusOK, &serializers.Resp{Result: true}) } func (s *Server) GetMissionStoreHistory(c *gin.Context) { ctx := s.requestContext(c) missionStoreIDstr := s.stringFromContextParam(c, "id") missionStoreID, _ := strconv.ParseUint(missionStoreIDstr, 10, 64) page, limit := s.pagingFromContext(c) res, count, err := s.nls.GetMissionStoreHistory(ctx, uint(missionStoreID), page, limit) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: serializers.NewMissionStoreHistoryRespArray(res), Count: &count}) } func (s *Server) SaveAgentStore(c *gin.Context) { ctx := s.requestContext(c) var req serializers.AgentStoreReq if err := c.ShouldBindJSON(&req); err != nil { ctxJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } userAddress, err := s.getUserAddressFromTK1Token(c) if err != nil || userAddress == "" { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(errs.ErrUnAuthorization)}) return } obj, err := s.nls.SaveAgentStore(ctx, userAddress, &req) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: serializers.NewAgentStoreResp(obj)}) } func (s *Server) GetListAgentStore(c *gin.Context) { ctx := s.requestContext(c) page, limit := s.pagingFromContext(c) search := s.stringFromContextQuery(c, "search") res, count, err := s.nls.GetListAgentStore(ctx, search, s.stringFromContextQuery(c, "type"), page, limit) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: serializers.NewAgentStoreRespArray(res), Count: &count}) } func (s *Server) GetListAgentStoreByOwner(c *gin.Context) { ctx := s.requestContext(c) page, limit := s.pagingFromContext(c) userAddress, err := s.getUserAddressFromTK1Token(c) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } res, count, err := s.nls.GetListAgentStoreByOwner(ctx, userAddress, page, limit) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: serializers.NewAgentStoreRespArray(res), Count: &count}) } func (s *Server) GetAgentStoreDetail(c *gin.Context) { ctx := s.requestContext(c) res, err := s.nls.GetAgentStoreDetail(ctx, s.uintFromContextParam(c, "id")) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: serializers.NewAgentStoreResp(res)}) } func (s *Server) SaveMissionStore(c *gin.Context) { ctx := s.requestContext(c) var req serializers.AgentStoreMissionReq if err := c.ShouldBindJSON(&req); err != nil { ctxJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } userAddress, err := s.getUserAddressFromTK1Token(c) if err != nil || userAddress == "" { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(errs.ErrUnAuthorization)}) return } err = s.nls.SaveMissionStore(ctx, userAddress, s.uintFromContextParam(c, "id"), &req) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: true}) } func (s *Server) AuthenAgentStoreCallback(c *gin.Context) { ctx := s.requestContext(c) var req serializers.AuthenAgentStoreCallback if err := c.ShouldBindJSON(&req); err != nil { ctxJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } err := s.nls.SaveAgentStoreCallback(ctx, &req) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: true}) } func (s *Server) GetListAgentStoreInstall(c *gin.Context) { ctx := s.requestContext(c) page, limit := s.pagingFromContext(c) userAddress, err := s.getUserAddressFromTK1Token(c) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } res, count, err := s.nls.GetListAgentStoreInstall(ctx, userAddress, s.uintFromContextQuery(c, "agent_info_id"), page, limit) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: serializers.NewAgentStoreRespArrayFromInstall(res), Count: &count}) } func (s *Server) GetAgentStoreInstallCode(c *gin.Context) { ctx := s.requestContext(c) agentInfoID := s.uintFromContextParam(c, "id") userAddress, err := s.getUserAddressFromTK1Token(c) if err != nil || userAddress == "" { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(errs.ErrUnAuthorization)}) return } res, err := s.nls.CreateAgentInfoInstallCode(ctx, userAddress, agentInfoID) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: res.Code}) } func (s *Server) RunMission(c *gin.Context) { ctx := s.requestContext(c) var req serializers.AgentStoreMissionReq if err := c.ShouldBindJSON(&req); err != nil { ctxJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } userAddress, err := s.getUserAddressFromTK1Token(c) if err != nil || userAddress == "" { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(errs.ErrUnAuthorization)}) return } obj, err := s.nls.AgentSnapshotPostCreateForUser(ctx, models.HERMES_CHAIN_ID, userAddress, req.Prompt, req.Model, req.ID) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: obj.ResponseId}) } func (s *Server) MissionStoreResult(c *gin.Context) { ctx := s.requestContext(c) userAddress, err := s.getUserAddressFromTK1Token(c) if err != nil || userAddress == "" { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(errs.ErrUnAuthorization)}) return } responseId := s.stringFromContextQuery(c, "id") resp, err := s.nls.GetMissionStoreResult(ctx, userAddress, responseId) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxSTRING(c, http.StatusOK, resp) } func (s *Server) GetInstallInfo(c *gin.Context) { ctx := s.requestContext(c) obj, err := s.nls.GetAgentStoreInstall(ctx, s.stringFromContextQuery(c, "code")) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } if obj != nil && obj.User != nil && obj.Type == models.AgentStoreInstallTypeUser { ctxJSON(c, http.StatusOK, &serializers.Resp{Result: obj.User.Address}) } else { ctxJSON(c, http.StatusOK, &serializers.Resp{Result: ""}) } } func (s *Server) GetTryHistory(c *gin.Context) { ctx := s.requestContext(c) agentStoreID, _ := s.uint64FromContextQuery(c, "agent_store_id") userAddress, err := s.getUserAddressFromTK1Token(c) if err != nil || userAddress == "" { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(errs.ErrUnAuthorization)}) return } res, err := s.nls.GetTryHistory(ctx, userAddress, uint(agentStoreID)) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: res.ID}) } func (s *Server) GetTryHistoryDetail(c *gin.Context) { ctx := s.requestContext(c) historyID := s.uintFromContextParam(c, "id") userAddress, err := s.getUserAddressFromTK1Token(c) if err != nil || userAddress == "" { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(errs.ErrUnAuthorization)}) return } page, limit := s.pagingFromContext(c) res, err := s.nls.GetTryHistoryDetail(ctx, userAddress, historyID, page, limit) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: serializers.NewAgentStoreTryDetailRespArray(res)}) } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/apis/api_store_trading_app.go ================================================ package apis import ( "net/http" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/serializers" "github.com/gin-gonic/gin" ) func (s *Server) StoreDefiAppAuthenInstall(c *gin.Context) { ctx := s.requestContext(c) authUrl, err := s.nls.StoreDefiAppAuthenInstall(ctx, s.stringFromContextQuery(c, "install_code"), s.stringFromContextQuery(c, "install_uri")) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } c.Redirect(http.StatusFound, authUrl) } func (s *Server) StoreDefiAppGetWallet(c *gin.Context) { ctx := s.requestContext(c) address, err := s.nls.StoreDefiAppGetWallet(ctx, c.GetHeader("api-key")) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: address}) } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/apis/api_user.go ================================================ package apis import ( "net/http" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/serializers" "github.com/gin-gonic/gin" ) func (s *Server) VerifyLoginUserByWeb3(c *gin.Context) { ctx := s.requestContext(c) var req struct { Address string `json:"address"` Message string `json:"message"` Signature string `json:"signature"` } if err := c.ShouldBindJSON(&req); err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } tkAuth, err := s.nls.VerifyLoginUserByWeb3(ctx, s.getRequestIP(c), s.getUserAgent(c), req.Address, req.Message, req.Signature) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Data: tkAuth}) } func (s *Server) GetUserProfileWithAuth(c *gin.Context) { ctx := s.requestContext(c) userAddress, err := s.getUserAddressFromTK1Token(c) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } user, err := s.nls.GetUserProfile(ctx, userAddress) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: serializers.NewUserResp(user)}) } func (s *Server) UserUploadFile(c *gin.Context) { ctx := s.requestContext(c) userAddress, err := s.getUserAddressFromTK1Token(c) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } fileHeader, err := c.FormFile("file") if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } path, err := s.nls.UserUploadFile(ctx, userAddress, fileHeader) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: path}) } func (s *Server) AgentRequestTwitterShareCode(c *gin.Context) { ctx := s.requestContext(c) topupAddress := s.stringFromContextQuery(c, "address") authSecretCode, authPublicCode, err := s.nls.AgentRequestTwitterShareCode( ctx, topupAddress, ) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{ Result: gin.H{ "public_code": authPublicCode, "secret_code": authSecretCode, }, }, ) } func (s *Server) AgentVerifyShareTwitter(c *gin.Context) { ctx := s.requestContext(c) var req struct { SecretCode string `json:"secret_code"` Link string `json:"link"` } if err := c.ShouldBindJSON(&req); err != nil { ctxJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } valid, err := s.nls.AgentVerifyShareTwitter(ctx, req.SecretCode, req.Link) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: valid}) } func (s *Server) GetListUserTransactions(c *gin.Context) { ctx := s.requestContext(c) page, limit := s.pagingFromContext(c) userAddress, err := s.getUserAddressFromTK1Token(c) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ms, count, err := s.nls.GetListUserTransactions(ctx, userAddress, s.stringFromContextQuery(c, "type"), page, limit) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: serializers.NewUserTransactionRespArry(ms), Count: &count}) } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/apis/api_vibe.go ================================================ package apis import ( "net/http" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/serializers" "github.com/gin-gonic/gin" ) func (s *Server) AddVibeWhiteList(c *gin.Context) { ctx := s.requestContext(c) var req struct { Email string `json:"email"` } if err := c.ShouldBindJSON(&req); err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } _ = s.nls.AddVibeWhiteList(ctx, req.Email) ctxJSON(c, http.StatusOK, &serializers.Resp{Result: true}) } func (s *Server) VibeValidateReferralCode(c *gin.Context) { ctx := s.requestContext(c) var req struct { RefCode string `json:"ref_code"` UserAddress string `json:"user_address"` } if err := c.ShouldBindJSON(&req); err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } valid, err := s.nls.ValidateReferralCode(ctx, req.RefCode, req.UserAddress) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Result: valid, Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: valid}) } func (s *Server) AgentComment(c *gin.Context) { ctx := s.requestContext(c) agentID := s.uintFromContextParam(c, "id") req := &serializers.AgentCommentReq{} if err := c.ShouldBindJSON(req); err != nil { ctxJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } userAddress, err := s.getUserAddressFromTK1Token(c) if err != nil || userAddress == "" { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(errs.ErrUnAuthorization)}) return } resp, err := s.nls.AgentComment(ctx, userAddress, agentID, req) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: resp}) } func (s *Server) GetListAgentComment(c *gin.Context) { ctx := s.requestContext(c) page, limit := s.pagingFromContext(c) agentID := s.uintFromContextParam(c, "id") agentUserComments, err := s.nls.GetListAgentComment(ctx, agentID, page, limit) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: serializers.NewAgentUserCommentArray(agentUserComments)}) } func (s *Server) GetVibeDashBoards(c *gin.Context) { ctx := s.requestContext(c) page, limit := s.pagingFromContext(c) chain := s.chainFromContextQuery(c) sortStr := s.agentSortListFromContext(c) search := s.stringFromContextQuery(c, "search") categoryIds := s.stringArrayFromContextQuery(c, "category_ids") agentTypesInt, _ := s.intArrayFromContextQuery(c, "agent_types") contractAddresses := s.stringArrayFromContextQuery(c, "contract_addresses") ids, _ := s.uintArrayFromContextQuery(c, "ids") exludeIds, _ := s.uintArrayFromContextQuery(c, "exlude_ids") includeHidden, _ := s.boolFromContextQuery(c, "include_hidden") userAddress, _ := s.getUserAddressFromTK1Token(c) ms, count, err := s.nls.GetVibeDashboard(ctx, includeHidden, contractAddresses, userAddress, chain, agentTypesInt, search, ids, exludeIds, categoryIds, sortStr, page, limit) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: serializers.NewAgentInfoRespArry(ms), Count: &count}) } func (s *Server) GetVibeDashBoardsDetail(c *gin.Context) { ctx := s.requestContext(c) agentID := s.stringFromContextParam(c, "agent_id") ms, err := s.nls.GetVibeDashboardsDetail(ctx, agentID) if err != nil || ms == nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: serializers.NewAgentInfoResp(ms)}) } func (s *Server) VibeTokenGetDeployInfo(c *gin.Context) { ctx := s.requestContext(c) agentID := s.uintFromContextParam(c, "agent_id") userAddress, err := s.getUserAddressFromTK1Token(c) if err != nil || userAddress == "" { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(errs.ErrUnAuthorization)}) return } resp, err := s.nls.VibeTokenGetDeployInfo(ctx, userAddress, agentID) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: resp}) } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/apis/apis.go ================================================ package apis import ( "context" "encoding/json" "io" "math/big" "net/http" "net/url" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/helpers" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/serializers" "github.com/gin-gonic/gin" ) func (s *Server) ClearCacheKey(c *gin.Context) { key := s.stringFromContextQuery(c, "key") prefix, err := s.boolValueFromContextQuery(c, "prefix") if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } if prefix { err = s.nls.DeleteRedisCachedWithPrefix(key) } else { err = s.nls.DeleteRedisCachedWithKey(key) } if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: true}) } func (s *Server) DisableJobs() { s.nls.DisableJobs() } func (s *Server) RunJobs() { go s.nls.RunJobs(context.Background()) } func (s *Server) RunTeleBotJob() { go s.nls.RunTeleBotJob(context.Background()) } func (s *Server) TwitterOauthCallback(c *gin.Context) { ctx := s.requestContext(c) callbackUrl := s.stringFromContextQuery(c, "callback") code := s.stringFromContextQuery(c, "code") address := s.stringFromContextQuery(c, "address") agentID := s.stringFromContextQuery(c, "agent_id") clientID := s.stringFromContextQuery(c, "client_id") mapResp, err := s.nls.TwitterOauthCallbackV1(ctx, callbackUrl, address, code, agentID, clientID) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } if mapResp != nil { callbackUrl = helpers.BuildUri( callbackUrl, mapResp, ) } location := url.URL{Path: callbackUrl} c.Redirect(http.StatusFound, location.RequestURI()) } func (s *Server) TwitterOauthCallbackForInternalData(c *gin.Context) { ctx := s.requestContext(c) callbackUrl := s.stringFromContextQuery(c, "callback") code := s.stringFromContextQuery(c, "code") err := s.nls.TwitterOauthCallbackForInternalData(ctx, callbackUrl, code) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } location := url.URL{Path: callbackUrl} c.Redirect(http.StatusFound, location.RequestURI()) } func (s *Server) GetEAISupplyTotal(c *gin.Context) { ctxJSON(c, http.StatusOK, 1000000000) } func (s *Server) GetEAISupplyCirculating(c *gin.Context) { ctx := s.requestContext(c) supply := big.NewFloat(1000000000) balance, err := s.nls.GetEthereumClient(ctx, models.ETERNAL_AI_CHAIN_ID).Balance("0x6fe0B7d6Ea2597946CCbbD198A79C95ADbb7228E") if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } fBalance := models.ConvertWeiToBigFloat(balance, 18) if fBalance.Cmp(big.NewFloat(0)) == 0 { fBalance = big.NewFloat(798099380) } circulatingSupply := models.SubBigFloats(supply, fBalance) resp, _ := circulatingSupply.Float64() ctxJSON(c, http.StatusOK, resp) } func (s *Server) GetAllConfigsExplorer(c *gin.Context) { cfs, err := s.nls.GetAllConfigsExplorer( s.requestContext(c), ) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: cfs}) } func (s *Server) GetTokenPrice(c *gin.Context) { mapTokenPrice := s.nls.GetMapTokenPrice(c) ctxJSON(c, http.StatusOK, &serializers.Resp{Result: mapTokenPrice}) } func (s *Server) GetListBubbleCrypto(c *gin.Context) { resp, err := http.Get("https://cryptobubbles.net/backend/data/bubbles1000.usd.json") if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } defer resp.Body.Close() body, err := io.ReadAll(resp.Body) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } var data []map[string]interface{} if err := json.Unmarshal(body, &data); err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } result := make([]map[string]interface{}, 0) for _, item := range data { name, ok2 := item["name"].(string) symbol, ok4 := item["symbol"].(string) rank, ok7 := item["rank"].(float64) price, ok9 := item["price"].(float64) marketcap, ok10 := item["marketcap"].(float64) volume, ok11 := item["volume"].(float64) performance, ok13 := item["performance"].(map[string]interface{}) if ok2 && ok4 && ok7 && ok9 && ok10 && ok11 && ok13 { result = append(result, map[string]interface{}{ "name": name, "symbol": symbol, "rank": rank, "price": price, "marketcap": marketcap, "volume": volume, "performance": performance, }) } } if len(result) > 100 { result = result[:100] } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: result}) } func (s *Server) MemeEventsByTransaction(c *gin.Context) { ctx := s.requestContext(c) txHash := s.stringFromContextQuery(c, "tx_hash") networkID, err := s.uint64FromContextQuery(c, "network_id") if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } err = s.nls.MemeEventsByTransaction(ctx, networkID, txHash) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } ctxJSON(c, http.StatusOK, &serializers.Resp{Result: true}) } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/apis/middlewares.go ================================================ package apis import ( "bytes" "context" "encoding/json" "errors" "fmt" "io/ioutil" "net/http" "net/http/httputil" "net/url" "os" "strconv" "strings" "time" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/helpers" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/logger" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/serializers" "github.com/getsentry/raven-go" "go.uber.org/zap" "github.com/gin-gonic/gin" ) const ( CONTEXT_USER_DATA = "context_user_data" CONTEXT_ERROR_DATA = "context_error_data" CONTEXT_STACKTRACE_DATA = "context_stacktrace_data" ) const ( userIDKey = "id" userEmailKey = "email" otp = "OTP" otpToken = "OTPToken" otpPhone = "OTPPhone" userClient = "client" userPermission = "permission" userData = "userData" userCtxData = "userCtxData" userEmail = "userEmail" userId = "userId" errorData = "errorData" stacktraceData = "stacktraceData" stacktraceExtra = "stacktraceExtra" contextBodyLogFun = "contextBodyLogFun" ) func ctxJSON(c *gin.Context, respCode int, resp interface{}) { if respCode != http.StatusOK { WrapRespError(c, resp) } c.JSON(respCode, resp) } func ctxSTRING(c *gin.Context, respCode int, resp string) { if respCode != http.StatusOK { WrapRespError(c, resp) } c.String(respCode, resp) } func ctxData(c *gin.Context, respCode int, contentType string, resp []byte) { if respCode != http.StatusOK { WrapRespError(c, resp) } c.Data(respCode, contentType, resp) } func ctxAbortWithStatusJSON(c *gin.Context, respCode int, resp interface{}) { if respCode != http.StatusOK { WrapRespError(c, resp) } c.AbortWithStatusJSON(respCode, resp) } func WrapRespError(c *gin.Context, resp interface{}) { var retErr *errs.Error switch resp.(type) { case *serializers.Resp: { retResp, ok := resp.(*serializers.Resp) if ok && retResp.Error != nil { retResp.Error = errs.NewError(retResp.Error) retErr, _ = retResp.Error.(*errs.Error) } } } if retErr != nil { c.Set(CONTEXT_ERROR_DATA, retErr.Error()) c.Set(CONTEXT_STACKTRACE_DATA, retErr.Stacktrace()) if strings.ToLower(strings.TrimSpace(c.Query("stacktrace"))) != "true" { retErr.SetStacktrace("") } } } func (s *Server) requestContext(c *gin.Context) context.Context { return c.Request.Context() } func (s *Server) getRequestIP(c *gin.Context) string { var ipStr string if ipStr == "" { ipStr = c.Request.Header.Get("X-Original-Forwarded-For") } if ipStr == "" { ipStr = c.Request.Header.Get("Cf-Connecting-Ip") } if ipStr == "" { ipStr = c.Request.Header.Get("ip") } if ipStr == "" { ipStr = c.ClientIP() } return ipStr } func (s *Server) getUserAgent(c *gin.Context) string { return c.Request.UserAgent() } func (s *Server) contextBVMUserExtra(c *gin.Context) string { var userData interface{} json.Unmarshal([]byte(c.Request.Header.Get("user-data")), &userData) return helpers.ConvertJsonString( map[string]interface{}{ "ip": s.getRequestIP(c), "ip_country": c.Request.Header.Get("Cf-IpLocation"), "agent": c.Request.Header.Get("user-agent"), "user-data": userData, }, ) } type bodyLogWriter struct { gin.ResponseWriter body *bytes.Buffer } func (w bodyLogWriter) Write(b []byte) (int, error) { w.body.Write(b) return w.ResponseWriter.Write(b) } func (w bodyLogWriter) WriteString(s string) (int, error) { w.body.WriteString(s) return w.ResponseWriter.WriteString(s) } func (s *Server) loggerDisabledBodyMiddleware() gin.HandlerFunc { return func(c *gin.Context) { c.Set("log_body", false) c.Next() } } func (s *Server) slackErrorBodyMiddleware() gin.HandlerFunc { return func(c *gin.Context) { c.Set("slack_error", true) c.Next() } } func (s *Server) logApiMiddleware() gin.HandlerFunc { return func(c *gin.Context) { c.Set("log", true) c.Set("log_body", true) c.Set("slack_error", false) start := time.Now() bodyLogWriter := &bodyLogWriter{body: bytes.NewBufferString(""), ResponseWriter: c.Writer} c.Writer = bodyLogWriter var bodyRequest string if (c.Request.Method == http.MethodPost || c.Request.Method == http.MethodPut) && strings.LastIndex(strings.ToLower(c.GetHeader("content-type")), "application/json") >= 0 { buf, bodyErr := ioutil.ReadAll(c.Request.Body) if bodyErr == nil { rdr2 := ioutil.NopCloser(bytes.NewBuffer(buf)) bodyRequest = string(buf) c.Request.Body = rdr2 } } c.Next() if c.GetBool("log") { end := time.Now() latency := end.Sub(start).Seconds() ipStr := c.Request.Header.Get("ip") if ipStr == "" { ipStr = c.ClientIP() } var errText, stacktraceText, bodyResponse string v, ok := c.Get(CONTEXT_ERROR_DATA) if ok { errText = v.(string) } v, ok = c.Get(CONTEXT_STACKTRACE_DATA) if ok { stacktraceText = v.(string) } bodyResponse = bodyLogWriter.body.String() if !c.GetBool("log_body") { bodyRequest = "" } address := s.stringFromContextQuery(c, "address") if bodyResponse != "" { var rsBody struct { Address string `json:"address"` } if rsBody.Address != "" { address = rsBody.Address } } logger.Info( "api_response_time", "request info", zap.Any("referer", c.Request.Referer()), zap.Any("ip", ipStr), zap.Any("method", c.Request.Method), zap.Any("path", c.Request.URL.Path), zap.Any("raw_query", c.Request.URL.RawQuery), zap.Any("latency", latency), zap.Any("status", c.Writer.Status()), zap.Any("user_agent", c.Request.UserAgent()), zap.Any("platform", c.Request.Header.Get("platform")), zap.Any("os", c.Request.Header.Get("os")), zap.Any("country", c.Request.Header.Get("country")), zap.Any("error_text", errText), zap.Any("stacktrace", stacktraceText), zap.Any("body_request", helpers.SubStringBodyResponse(bodyRequest, 10000)), zap.Any("body_response", helpers.SubStringBodyResponse(bodyResponse, 10000)), zap.Any("address", address), zap.Any("ip_country", c.Request.Header.Get("CF-IPLocation")), zap.Any("connecting_ip", c.Request.Header.Get("Cf-Connecting-Ip")), ) if os.Getenv("DEV") == "true" { fmt.Println(stacktraceText) } } } } func (s *Server) recoveryMiddleware(client *raven.Client, onlyCrashes bool) gin.HandlerFunc { return func(c *gin.Context) { defer func() { flags := map[string]string{ "endpoint": c.Request.RequestURI, } if rval := recover(); rval != nil { rvalStr := fmt.Sprint(rval) client.CaptureMessage(rvalStr, flags, raven.NewException(errors.New(rvalStr), raven.NewStacktrace(2, 3, nil)), raven.NewHttp(c.Request)) ctxAbortWithStatusJSON(c, http.StatusInternalServerError, &serializers.Resp{ Result: nil, Error: errs.NewError(errors.New(rvalStr)), }) } if !onlyCrashes { for _, item := range c.Errors { client.CaptureMessage(item.Error(), flags, &raven.Message{ Message: item.Error(), Params: []interface{}{item.Meta}, }, raven.NewHttp(c.Request)) } } }() c.Next() } } func (s *Server) pagingFromContext(c *gin.Context) (int, int) { var ( pageS = c.DefaultQuery("page", "1") limitS = c.DefaultQuery("limit", "50") page int limit int err error ) page, err = strconv.Atoi(pageS) if err != nil { page = 1 } limit, err = strconv.Atoi(limitS) if err != nil { limit = 50 } if limit > 500 { limit = 500 } return page, limit } func (s *Server) ipfsProxyMiddleware(hostPath string) gin.HandlerFunc { return func(c *gin.Context) { hash := c.Param("hash") r := c.Request w := c.Writer director := func(req *http.Request) { hostURL, err := url.Parse(hostPath) if err != nil { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } req.URL.Scheme = hostURL.Scheme req.URL.Host = hostURL.Host req.Host = hostURL.Host req.URL.Path = hostPath + "/" + hash + ".mp4" } proxy := &httputil.ReverseProxy{ Director: director, } proxy.ServeHTTP(w, r) } } func (s *Server) uintFromContextParam(c *gin.Context, param string) uint { val := strings.TrimSpace(c.Param(param)) if val == "" { panic(errors.New("invalid param")) } num, err := strconv.ParseUint(val, 10, 64) if err != nil { panic(errors.New("invalid param")) } return uint(num) } func (s *Server) uint64FromContextParam(c *gin.Context, param string) (uint64, error) { val := strings.TrimSpace(c.Param(param)) if val == "" { return uint64(0), nil } num, err := strconv.ParseUint(val, 10, 64) if err != nil { return 0, err } return uint64(num), nil } func (s *Server) uintFromContextQuery(c *gin.Context, query string) uint { val := strings.TrimSpace(c.Query(query)) if val == "" { return uint(0) } num, err := strconv.ParseUint(val, 10, 64) if err != nil { panic(err) } return uint(num) } func (s *Server) intFromContextQuery(c *gin.Context, query string) int { val := strings.TrimSpace(c.Query(query)) if val == "" { return int(0) } num, err := strconv.ParseInt(val, 10, 64) if err != nil { panic(err) } return int(num) } func (s *Server) float64FromContextQuery(c *gin.Context, query string) (float64, error) { val := strings.TrimSpace(c.Query(query)) if val == "" { return 0, nil } num, err := strconv.ParseFloat(val, 10) if err != nil { return 0, err } return num, nil } func (s *Server) ptrUintFromContextQuery(c *gin.Context, query string) (*uint, error) { val := strings.TrimSpace(c.Query(query)) if val == "" { return nil, nil } num, err := strconv.ParseUint(val, 10, 64) if err != nil { return nil, err } v := uint(num) return &v, nil } func (s *Server) uint64FromContextQuery(c *gin.Context, query string) (uint64, error) { val := strings.TrimSpace(c.Query(query)) if val == "" { return uint64(0), nil } num, err := strconv.ParseUint(val, 10, 64) if err != nil { return 0, err } return uint64(num), nil } func (s *Server) stringFromContextQuery(c *gin.Context, query string) string { return strings.TrimSpace(c.Query(query)) } func (s *Server) stringFromContextQueryDefault(c *gin.Context, query string, df string) string { return strings.TrimSpace(c.DefaultQuery(query, df)) } func (s *Server) stringFromContextParam(c *gin.Context, query string) string { return strings.TrimSpace(c.Param(query)) } func (s *Server) maxResultFromContextQuery(c *gin.Context) int { maxResults := s.intFromContextQuery(c, "max_results") if maxResults == 0 { maxResults = 25 } if maxResults < 5 { maxResults = 5 } return maxResults } func (s *Server) stringArrayFromContextQuery(c *gin.Context, query string) []string { val := strings.ToLower(strings.TrimSpace(c.Query(query))) if val == "" { return []string{} } return strings.Split(val, ",") } func (s *Server) uintArrayFromContextQuery(c *gin.Context, query string) ([]uint, error) { val := strings.TrimSpace(c.Query(query)) if val == "" { return []uint{}, nil } vals := strings.Split(val, ",") rets := []uint{} for _, val := range vals { num, err := strconv.ParseUint(val, 10, 64) if err != nil { return []uint{}, err } rets = append(rets, uint(num)) } return rets, nil } func (s *Server) intArrayFromContextQuery(c *gin.Context, query string) ([]int, error) { val := strings.TrimSpace(c.Query(query)) if val == "" { return []int{}, nil } vals := strings.Split(val, ",") rets := []int{} for _, val := range vals { num, err := strconv.ParseUint(val, 10, 64) if err != nil { return []int{}, err } rets = append(rets, int(num)) } return rets, nil } func (s *Server) dateFromContextQuery(c *gin.Context, query string) (*time.Time, error) { val := strings.TrimSpace(c.Query(query)) if val == "" { return nil, nil } t, err := time.Parse("2006-01-02", val) if err != nil { return nil, err } return &t, nil } func (s *Server) timeFromContextQuery(c *gin.Context, query string) (*time.Time, error) { val := strings.TrimSpace(c.Query(query)) if val == "" { return nil, nil } t, err := time.Parse(time.RFC3339, val) if err != nil { return nil, err } return &t, nil } func (s *Server) boolFromContextQuery(c *gin.Context, query string) (*bool, error) { val := strings.TrimSpace(c.Query(query)) if val == "" { return nil, nil } ret, err := strconv.ParseBool(val) if err != nil { return nil, err } return &ret, nil } func (s *Server) boolValueFromContextQuery(c *gin.Context, query string) (bool, error) { val := strings.TrimSpace(c.Query(query)) if val == "" { return false, nil } ret, err := strconv.ParseBool(val) if err != nil { return false, err } return ret, nil } func (s *Server) proxyMiddleware(prefixPath string, host string, headers map[string]string) gin.HandlerFunc { return func(c *gin.Context) { r := c.Request w := c.Writer director := func(req *http.Request) { hostURL, err := url.Parse(host) if err != nil { c.AbortWithStatusJSON(http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(err)}) return } req.URL.Scheme = hostURL.Scheme req.URL.Host = hostURL.Host req.Host = hostURL.Host req.URL.Path = strings.TrimPrefix(req.URL.Path, prefixPath) query := req.URL.Query() req.URL.RawQuery = query.Encode() for k := range r.Header { v := c.GetHeader(k) req.Header.Set(k, v) } for k, v := range headers { req.Header.Set(k, v) } if os.Getenv("DEV") == "true" { fmt.Printf("%s -> %s\n", r.URL.String(), req.URL.String()) } } proxy := &httputil.ReverseProxy{ Director: director, } proxy.ServeHTTP(w, r) } } const ( SCOPE_TRANSFER string = "constant-transfer" // this const is used to force the user re-login to get newest token VALID_TOKEN = "2019-03-25" PERMISSION_AUTHORIZE = "authorize" PERMISSION_TOKEN = "token" ) func (s *Server) bodyLogMiddleware(fn func(c *gin.Context, req string, res string) (string, string)) gin.HandlerFunc { return func(c *gin.Context) { c.Set(contextBodyLogFun, fn) c.Next() } } func (s *Server) loginBodyLogMiddleware() gin.HandlerFunc { return s.bodyLogMiddleware(func(c *gin.Context, req, res string) (string, string) { rs := struct { Email string }{} err := json.Unmarshal([]byte(req), &rs) if err != nil { return req, "" } { c.Set(userEmail, rs.Email) } reqBytes, err := json.Marshal(&rs) if err != nil { return "", "" } return string(reqBytes), "" }) } func (s *Server) sortListFromContext(c *gin.Context) []string { var ( sortCol = c.DefaultQuery("sort_col", "") sortType = c.DefaultQuery("sort_type", "0") sortStr []string ) arrayCol := strings.Split(sortCol, ",") arrayType := strings.Split(sortType, ",") whiteListSortCol := map[string]string{ "price": "1", "market_cap": "1", "created_at": "1", "total_volume": "1", "percent": "1", "reply_count": "1", "last_reply": "1", } for i, item := range arrayCol { item = strings.TrimSpace(item) if strings.EqualFold(item, "following") { item = "price" } _, ok := whiteListSortCol[item] if item != "" && ok { if strings.Contains(item, " ") { panic("bad request") } sortTypeStr := "desc" sortNum, _ := strconv.Atoi(arrayType[i]) if sortNum > 0 { sortTypeStr = "asc" } sortStr = append(sortStr, fmt.Sprintf(`%s %s`, item, sortTypeStr)) } } return sortStr } func (s *Server) chainFromContextQuery(c *gin.Context) uint64 { chain, err := s.uint64FromContextQuery(c, "chain") if err != nil { chain = 0 } return chain } func (s *Server) internalApiMiddleware() gin.HandlerFunc { return func(c *gin.Context) { internalKey := s.stringFromContextQuery(c, "api_key") if internalKey == "" { internalKey = c.GetHeader("api-key") if internalKey == "" { authHeader := c.GetHeader("Authorization") internalKey = strings.TrimPrefix(authHeader, "Bearer ") } } if !strings.EqualFold(internalKey, s.conf.InternalApiKey) { ctxAbortWithStatusJSON(c, http.StatusBadRequest, &serializers.Resp{Error: errs.NewError(errs.ErrInvalidApiKey)}) return } c.Next() } } func (s *Server) externalApiMiddleware() gin.HandlerFunc { return func(c *gin.Context) { authHeader := c.GetHeader("Authorization") externalKey := strings.TrimPrefix(authHeader, "TK1 ") if externalKey == "" { c.JSON(http.StatusUnauthorized, gin.H{"error": "Invalid API key"}) c.Abort() return } c.Next() } } func (s *Server) agentSortListFromContext(c *gin.Context) []string { var ( sortCol = c.DefaultQuery("sort_col", "") sortType = c.DefaultQuery("sort_type", "0") sortStr []string ) arrayCol := strings.Split(sortCol, ",") arrayType := strings.Split(sortType, ",") whiteListSortCol := map[string]string{ "meme_market_cap": "1", "meme_percent": "1", "reply_latest_time": "1", "meme_price": "1", "meme_volume_last24h": "1", "created_at": "1", "prompt_calls": "1", "installed_count": "1", "recent_chat_time": "1", } for i, item := range arrayCol { item = strings.TrimSpace(item) _, ok := whiteListSortCol[item] if item != "" && ok { if strings.Contains(item, " ") { panic("bad request") } sortTypeStr := "desc" sortNum, _ := strconv.Atoi(arrayType[i]) if sortNum > 0 { sortTypeStr = "asc" } sortStr = append(sortStr, fmt.Sprintf(`%s %s`, item, sortTypeStr)) } } return sortStr } func (s *Server) authCheckTK1TokenMiddleware() gin.HandlerFunc { return func(c *gin.Context) { authHeader := c.GetHeader("Authorization") authHeader = strings.TrimPrefix(authHeader, "TK1 ") if authHeader == "" { ctxAbortWithStatusJSON(c, http.StatusUnauthorized, &serializers.Resp{Error: errs.NewError(errs.ErrUnAuthorization)}) return } authData, err := helpers.DecryptAndVerifyAuthToken(authHeader, s.conf.EncryptAuthenKey) if err != nil { ctxAbortWithStatusJSON(c, http.StatusUnauthorized, &serializers.Resp{Error: errs.NewError(errs.ErrUnAuthorization)}) return } if authData != nil { c.Set("userData", &models.User{ Address: authData.Address, }) } else { ctxAbortWithStatusJSON(c, http.StatusUnauthorized, &serializers.Resp{Error: errs.NewError(errs.ErrUnAuthorization)}) return } c.Next() } } func (s *Server) getUserAddressFromTK1Token(c *gin.Context) (string, error) { authToken := c.GetHeader("Authorization") authToken = strings.TrimPrefix(authToken, "TK1 ") authData, err := helpers.DecryptAndVerifyAuthToken(authToken, s.conf.EncryptAuthenKey) if err != nil { return "", err } return authData.Address, nil } func (s *Server) authCheckSignatureMiddleware() gin.HandlerFunc { return func(c *gin.Context) { userAddress := c.GetHeader("XXX-Address") userMessage := c.GetHeader("XXX-Message") signature := c.GetHeader("XXX-Signature") if signature == "" || userAddress == "" || userMessage == "" { ctxAbortWithStatusJSON(c, http.StatusUnauthorized, &serializers.Resp{Error: errs.NewError(errs.ErrUnAuthorization)}) return } i, err := strconv.ParseInt(userMessage, 10, 64) if err != nil { ctxAbortWithStatusJSON(c, http.StatusUnauthorized, &serializers.Resp{Error: errs.NewError(errs.ErrUnAuthorization)}) return } timeSignature := helpers.TimeFromUnix(i) timeValid := helpers.TimeNow().Add(-15 * time.Minute) if timeSignature.Before(timeValid) { ctxAbortWithStatusJSON(c, http.StatusUnauthorized, &serializers.Resp{Error: errs.NewError(errs.ErrUnAuthorization)}) return } err = s.nls.VerifyAddressSignature(context.Background(), models.ETHEREUM_CHAIN_ID, userAddress, userMessage, signature) if err != nil { ctxAbortWithStatusJSON(c, http.StatusUnauthorized, &serializers.Resp{Error: errs.NewError(errs.ErrUnAuthorization)}) return } c.Set("userData", &models.User{ Address: strings.ToLower(userAddress), }) c.Next() } } func (s *Server) getUserAddress(c *gin.Context) string { return c.GetHeader("XXX-Address") } func (s *Server) middlewareApiLimit(numRequest int, duration time.Duration) gin.HandlerFunc { return func(c *gin.Context) { ip := s.getRequestIP(c) apiPath := c.Request.URL.Path limitKey := fmt.Sprintf("api_limit_%s_%s_%s", c.Request.Method, ip, apiPath) var limit int err := s.nls.GetRedisCachedWithKey(limitKey, &limit) if err != nil { // Only set limit to 0 if key doesn't exist, not on other redis errors if err.Error() == "redis: nil" { limit = 0 } else { ctxAbortWithStatusJSON(c, http.StatusInternalServerError, &serializers.Resp{Error: errs.NewError(err)}) return } } if limit >= numRequest { ctxAbortWithStatusJSON(c, http.StatusTooManyRequests, &serializers.Resp{Error: errs.NewError(errors.New("too many requests"))}) return } // Calculate expiration time from start of current window now := time.Now() windowStart := now.Truncate(duration) expireTime := windowStart.Add(duration) // Only increment if we can set the value err = s.nls.SetRedisCachedWithKey(limitKey, limit+1, time.Until(expireTime)) if err != nil { ctxAbortWithStatusJSON(c, http.StatusInternalServerError, &serializers.Resp{Error: errs.NewError(err)}) return } c.Next() } } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/apis/routers.go ================================================ package apis import ( "net/http" "time" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/configs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/serializers" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services" "github.com/getsentry/raven-go" "github.com/gin-contrib/cors" "github.com/gin-gonic/gin" ) type Server struct { g *gin.Engine conf *configs.Config nls *services.Service } func NewServer( g *gin.Engine, conf *configs.Config, nls *services.Service, ) *Server { return &Server{ g: g, conf: conf, nls: nls, } } func (s *Server) Routers() { s.g.Use(cors.New(cors.Config{ AllowOrigins: []string{"http://*", "https://*"}, ExposeHeaders: []string{"Content-Length"}, AllowCredentials: true, AllowOriginFunc: func(origin string) bool { return true }, AllowMethods: []string{"GET", "POST", "PUT", "HEAD", "OPTIONS", "DELETE"}, AllowHeaders: []string{"*"}, AllowWildcard: true, MaxAge: 12 * time.Hour, })) s.g.Use(s.logApiMiddleware()) s.g.Use(s.recoveryMiddleware(raven.DefaultClient, false)) rootAPI := s.g.Group("/api") { rootAPI.GET("/", func(c *gin.Context) { ctxJSON(c, http.StatusOK, &serializers.Resp{Error: nil}) }) rootAPI.GET("/health", func(c *gin.Context) { ctxJSON(c, http.StatusOK, &serializers.Resp{Error: nil}) }) rootAPI.GET("/configs/explorer", s.GetAllConfigsExplorer) rootAPI.GET("/clear-cache", s.ClearCacheKey) rootAPI.GET("/eai/supply/total", s.GetEAISupplyTotal) rootAPI.GET("/eai/supply/circulating", s.GetEAISupplyCirculating) rootAPI.GET("/coin-prices", s.GetTokenPrice) rootAPI.POST("/vibe-white-list", s.AddVibeWhiteList) rootAPI.GET("/scan-transaction", s.MemeEventsByTransaction) webhookAPI := rootAPI.Group("/webhook") { webhookAPI.GET("/twitter-oauth", s.TwitterOauthCallback) webhookAPI.GET("/twitter-oauth/internal", s.TwitterOauthCallbackForInternalData) } pumpAPI := rootAPI.Group("/pump") { pumpAPI.GET("/orders", s.GetPumpOrderHistory) pumpAPI.GET("/balances", s.GetPumpBalance) rootAPI.GET("/notify-change-price-pump", s.NotifyChangePricePump) rootAPI.GET("/trending-tokens", s.GetListTrendingTokens) } // user authAPI := rootAPI.Group("/auth") { authAPI.POST("/verify", s.VerifyLoginUserByWeb3) } userAPI := rootAPI.Group("/users") { userAPI.POST("/upload", s.UserUploadFile) userAPI.GET("/profile", s.authCheckTK1TokenMiddleware(), s.GetUserProfileWithAuth) userAPI.GET("/transactions", s.authCheckTK1TokenMiddleware(), s.GetListUserTransactions) } adminAPI := rootAPI.Group("/admin") { adminAPI.GET("/agent/:id", s.AdminGetAgentDetailByAgentID) adminAPI.GET("/snapshot_post_acctions", s.AdminGetSnapshotPostActionByAgent) } // Agent management agentAPI := rootAPI.Group("/agent") { agentAPI.GET("/categories", s.GetListAgentCategory) agentAPI.GET("/report", s.GetAgentSummaryReport) agentAPI.GET("/list", s.GetListAgent) agentAPI.GET("/unclaimed", s.GetListAgentUnClaimed) agentAPI.GET("/:id", s.GetAgentDetailByAgentID) agentAPI.GET("/admin/:id", s.GetAgentDetailByAgentID) agentAPI.GET("/by-contract/:address/:id", s.GetAgentDetailByContract) agentAPI.GET("/detail/:id", s.GetAgentDetail) agentAPI.POST("/update-code-version/:id", s.UpdateAgentCodeVersion) agentAPI.GET("/post", s.GetListAgentTwitterPost) agentAPI.GET("/post/:id", s.GetAgentTwitterPostDetail) agentAPI.GET("/topup-history/:id", s.GetListAgentEaiTopup) agentAPI.POST("/update-farcaster/:id", s.UpdateAgentFarcaster) agentAPI.POST("/update-external-info/:id", s.UpdateAgentExternalInfo) agentAPI.POST("/unlink/:id", s.UnlinkAgentTwitterInfo) agentAPI.POST("/pause/:id", s.PauseAgent) agentAPI.POST("/:id/chat/completions", s.AgentChats) agentAPI.POST("/preview", s.PreviewAgentSystemPromp) agentAPI.POST("/preview/v1", s.PreviewAgentSystemPrompV1) agentAPI.POST("/chats", s.AgentChatSupport) agentAPI.GET("/network-fees", s.GetAgentChainFees) agentAPI.GET("/liquidity-networks", s.GetEaiLiquidityNetowrks) twitterAPI := agentAPI.Group("/twitter") { twitterAPI.GET("/user/by/username", s.GetTwitterUserByUserNameByQuery) } faucetAPI := agentAPI.Group("/faucet") { faucetAPI.GET("/request", s.AgentRequestTwitterShareCode) faucetAPI.POST("/verify", s.AgentVerifyShareTwitter) } brainAPI := agentAPI.Group("/brain") { brainAPI.GET("/detail-by-tweet/:id", s.GetBrainDetailByTweetID) brainAPI.GET("/:id", s.GetAgentBrainHistory) } // abilities abilitiesAPI := agentAPI.Group("/mission") { abilitiesAPI.POST("update/:id", s.CreateUpdateAgentSnapshotMission) abilitiesAPI.DELETE("/:id", s.DeleteAgentSnapshotMission) abilitiesAPI.GET("configs", s.GetAgentMissionConfigs) abilitiesAPI.GET("tokens", s.GetAgentMissionTokens) } agentAPI.GET("/dashboard", s.GetDashBoardAgent) agentAPI.GET("/dashboard/:token_address", s.GetDashBoardAgentDetail) agentAPI.GET("/token-info/:id", s.GetTokenInfoByContract) // dojo agentAPI.GET("/dojo/list", s.GetListAgentForDojo) agentAPI.GET("/dojo/:id", s.GetAgentDetailByAgentIDForDojo) agentAPI.GET("/dojo/:id/knowledge-base", s.listKnowledgeByAgent) agentAPI.POST("/create_agent_assistant", s.authCheckTK1TokenMiddleware(), s.AgentCreateAgentAssistant) agentAPI.POST("/update_agent_assistant", s.authCheckTK1TokenMiddleware(), s.AgentUpdateAgentAssistant) agentAPI.POST("/install", s.authCheckTK1TokenMiddleware(), s.MarkInstalledUtilityAgent) agentAPI.POST("/recent-chat", s.authCheckTK1TokenMiddleware(), s.MarkRecentChatUtilityAgent) agentAPI.POST("/prompt/:id", s.authCheckTK1TokenMiddleware(), s.MarkPromptCountUtilityAgent) agentAPI.POST("/comment/:id", s.authCheckTK1TokenMiddleware(), s.AgentComment) agentAPI.GET("/comment/:id", s.GetListAgentComment) agentAPI.POST("/public/:id", s.authCheckTK1TokenMiddleware(), s.PublicAgent) agentAPI.POST("/like/:id", s.authCheckTK1TokenMiddleware(), s.LikeAgent) agentAPI.GET("/like/:id", s.authCheckTK1TokenMiddleware(), s.CheckAgentLiked) agentAPI.POST("/create-local-agent", s.AgentCreateAgentAssistantForLocal) agentAPI.GET("/list-local-agent", s.GetListAgentForDojo) agentAPI.POST("/create_agent_studio", s.authCheckTK1TokenMiddleware(), s.AgentCreateAgentStudio) agentAPI.POST("/update_agent_studio/:id", s.authCheckTK1TokenMiddleware(), s.AgentUpdateAgentStudio) agentAPI.POST("/update_agent_assistant_in_contract", s.authCheckTK1TokenMiddleware(), s.AgentUpdateAgentAssistantInContract) agentAPI.POST("/update_twin_status", s.UpdateTwinStatus) // knowledge base agentAPI.POST("/use-knowledge-base", s.authCheckTK1TokenMiddleware(), s.AgentUseKnowledgeBase) // infer agentAPI.POST("/async-batch-prompt", s.AsyncBatchPrompt) agentAPI.GET("/get-async-prompt-output/:id", s.GetBatchItem) // agentAPI.GET("/:id/install-code", s.authCheckTK1TokenMiddleware(), s.GetAgentStoreInstallCode) agentAPI.GET("/install/info", s.GetAgentInfoInstallInfo) // agentAPI.GET("/library", s.GetAgentLibrary) agentAPI.POST("/add-library", s.AddAgentLibrary) agentAPI.GET("/check-exist", s.CheckNameExist) agentAPI.GET("/video", s.GetListUserVideo) agentAPI.GET("/video/user", s.GetVideoUserInfo) agentAPI.POST("/video/export", s.authCheckTK1TokenMiddleware(), s.ExportUserPrivateKeyForClaimVideoReward) } nftWithAuthAPI := rootAPI.Group("/nft", s.authCheckTK1TokenMiddleware()) { nftWithAuthAPI.GET("/collection", s.GetNftOpenseaCollections) nftWithAuthAPI.GET("/collection/:address", s.GetNftCollectionsDetail) nftWithAuthAPI.GET("/collection/:address/:tokenId", s.GetNftCollectionsByTokenID) } serviceAPI := rootAPI.Group("/service") { serviceAPI.POST("/light-house/upload", s.authCheckTK1TokenMiddleware(), s.UploadDataToLightHouse) } internalAPI := rootAPI.Group("/internal", s.internalApiMiddleware()) { internalAPI.GET("/webtext", s.GetWebpageText) internalAPI.POST("/trigger_job", s.AdminTriggerJob) internalAPI.GET("/handle_video", s.AdminHandleVideo) twitterAPI := internalAPI.Group("/twitter") { twitterAPI.GET("/user/recent-info", s.GetTwitterDataForLaunchpad) twitterAPI.GET("/user/:id", s.GetTwitterUserByID) twitterAPI.GET("/user", s.GetTwitterUserByIDByQuery) twitterAPI.GET("/user/by/username/:username", s.GetTwitterUserByUserName) twitterAPI.GET("/user/by/username", s.GetTwitterUserByUserNameByQuery) twitterAPI.GET("/user/by", s.GetTwitterUserByQuery) twitterAPI.GET("/user/:id/following", s.GetTwitterUserFollowing) twitterAPI.GET("/user/following", s.GetTwitterUserFollowingByQuery) twitterAPI.GET("/tweets/:id", s.GetListUserTweets) twitterAPI.GET("/tweets/:id/all", s.GetListUserTweetsAll) twitterAPI.GET("/tweets-by-id", s.GetListUserTweetsByQuery) twitterAPI.GET("/tweets", s.LookupUserTweets) twitterAPI.GET("/tweets/v1", s.LookupUserTweetsV1) twitterAPI.GET("/user/:id/mentions", s.GetListUserMentions) twitterAPI.GET("/user/mentions", s.GetListUserMentionsByQuery) twitterAPI.GET("/user/by/username/:username/following", s.GetTwitterUserFollowingByUsername) twitterAPI.GET("/user/by/username/following", s.GetTwitterUserFollowingByUsernameByQuery) twitterAPI.GET("/tweets/by/username/:username", s.GetListUserTweetsByUserName) twitterAPI.GET("/tweets/by/username", s.GetListUserTweetsByUserNameByQuery) // get tweets by list users for mission twitterAPI.GET("/tweets/by/users", s.GetListUserTweetsByUsersForTradeMission) twitterAPI.GET("/tweets/by/agent", s.GetListUserTweetsByAgentForTradeMission) twitterAPI.GET("/user/by/username/:username/mentions", s.GetListUserMentionsByUsername) twitterAPI.GET("/user/by/username/:username/mentions/all", s.GetAllUserMentionsByUsername) twitterAPI.GET("/user/by/username/mentions", s.GetListUserMentionsByUsernameByQuery) twitterAPI.GET("/tweets/search/recent", s.SearchRecentTweet) twitterAPI.GET("/tweets/search/token", s.SearchTokenTweet) twitterAPI.GET("/user/search", s.SearchUsers) twitterAPI.GET("/user/liked", s.GetUser3700Liked) // twitterAPI.POST("/user/action", s.CreateAgentInternalAction) // twitterAPI.POST("/wallet/pumfun/create-token/:chain_id/:agent_contract_id", s.AgentWalletCreatePumpFunMeme) twitterAPI.POST("/wallet/pumfun/trade-token/:chain_id/:agent_contract_id", s.AgentWalletTradePumpFunMeme) twitterAPI.POST("/wallet/raydium/trade-token/:chain_id/:agent_contract_id", s.AgentWalletTradeRaydiumToken) twitterAPI.GET("/wallet/solana/balances/:chain_id/:agent_contract_id", s.AgentWalletGetSolanaTokenBalances) twitterAPI.GET("/wallet/solana/trades/:chain_id/:agent_contract_id", s.GetAgentWalletSolanaTrades) twitterAPI.GET("/wallet/solana/pnls/:chain_id/:agent_contract_id", s.AgentWalletGetSolanaTokenPnls) twitterAPI.GET("/wallet/pumfun/trades/:mint", s.GetPumpFunTrades) twitterAPI.GET("/wallet/pumfun/price/:mint", s.GetPumpFunTokenPrice) twitterAPI.GET("/wallet/solana/quote/latest", s.GetTokenQuoteLatestForSolana) twitterAPI.POST("/user/tweet-by-token", s.TweetByToken) twitterAPI.POST("/user/action-by-ref", s.CreateAgentInternalActionByRefID) } // Token management tokenAPI := internalAPI.Group("/trade") { tokenAPI.GET("/tokens", s.GetAgentTradeTokens) tokenAPI.GET("/search", s.DexSearchPair) tokenAPI.GET("/trade-history/latest", s.DexPairsTradeLatest) tokenAPI.GET("/solana/chart-24h/:mint", s.GetSolanaDataChart24Hour) tokenAPI.GET("/dexscreen-info", s.DexScreenInfo) tokenAPI.GET("/analytic", s.GetTradeAnalytic) } // launchpad management launchpadAPI := internalAPI.Group("/launchpad") { launchpadAPI.POST("/:id/tier/:member_id", s.ExecuteLaunchpadTier) } robotAPI := internalAPI.Group("/robot") { robotAPI.POST("/wallet", s.GenerateRobotSaleWallet) robotAPI.GET("/wallet", s.GetRobotSaleWallet) robotAPI.GET("/project", s.GetRobotProject) robotAPI.POST("/token", s.RobotCreateToken) robotAPI.POST("/transfer", s.RobotTransferToken) robotAPI.GET("/leaderboards", s.GetRobotProjectLeaderBoards) } } // deprecated externalWalletAPI := rootAPI.Group("/external-wallet") { externalWalletAPI.POST("/address", s.ExternalWalletCreateSOL) externalWalletAPI.GET("/address", s.ExternalWalletGet) externalWalletAPI.GET("/balances", s.ExternalWalletBalances) externalWalletAPI.POST("/compute-order", s.ExternalWalletComputeOrder) externalWalletAPI.POST("/create-order", s.ExternalWalletCreateOrder) externalWalletAPI.GET("/list-orders", s.ExternalWalletGetOrders) externalWalletAPI.GET("/list-tokens", s.ExternalWalletGetTokens) externalWalletAPI.GET("/tweets/:username", s.GetListUserTweetsByUserName) } subcriptionAPI := rootAPI.Group("/subscription") { subcriptionAPI.POST("/use-api-token", s.internalApiMiddleware(), s.CreateApiTokenUsage) subcriptionAPI.POST("/refund-api-token", s.internalApiMiddleware(), s.CreateApiTokenUsage) subcriptionAPI.GET("/usages", s.GetApiUsage) subcriptionAPI.GET("/packages", s.GetApiPackages) subcriptionAPI.GET("/info", s.GetApiSubscriptionInfo) } bubbleAPI := rootAPI.Group("/bubble") { bubbleAPI.GET("/list", s.GetListBubbleCrypto) } memeAPI := rootAPI.Group("/meme") { // memeAPI.GET("/configs", s.GetMemeConfigs) memeAPI.GET("/memes-by-address", s.GetListMemeByAddress) memeAPI.GET("/list", s.GetListMemeReport) memeAPI.GET("/feed", s.GetFeedMemeReport) memeAPI.GET("/:id", s.GetMemeDetail) memeAPI.GET("/seen/:id", s.SeenMemeDetail) memeAPI.GET("/story", s.GenerateMemeStory) memeAPI.GET("/chart/:id", s.GetMemeCandleChart) memeAPI.GET("/trade-history", s.GetMemeTradeHistory) memeAPI.GET("/trade-history/:id/latest", s.GetMemeTradeHistoryLatest) memeAPI.GET("/holders", s.GetMemeListHolders) memeAPI.GET("/holding", s.GetMemeListHolding) memeAPI.GET("/whitelist-address", s.GetMemeWhiteListAddress) memeAPI.GET("/burn-history", s.GetMemeBurnHistory) memeAPI.POST("/share/:id", s.ShareMeme) threadAPI := memeAPI.Group("/thread") { threadAPI.GET("/list/:id/latest", s.GetListMemeThreadLatest) threadAPI.POST("/hide/:id", s.HideMemeThread) } userAPI := memeAPI.Group("/user") { userAPI.GET("/profile", s.GetMemeUserProfile) userAPI.GET("/validate-follow", s.MemeValidatedFollow) userAPI.POST("/follow", s.FollowUser) userAPI.POST("/unfollow", s.UnFollowUser) userAPI.GET("/followers", s.GetListFollowers) userAPI.GET("/following", s.GetListFollowings) userAPI.GET("/notification", s.GetMemeNotification) userAPI.GET("/notification/latest", s.GetMemeNotificationLatest) userAPI.POST("/notification/seen/:id", s.UserSeenMemeNotification) } } knowledgeHookApi := rootAPI.Group("/knowledge") { knowledgeHookApi.POST("/webhook", s.webhookKnowledge) knowledgeHookApi.POST("/webhook-file/:id", s.webhookKnowledgeFile) } knowledgeApi := rootAPI.Group("/knowledge", s.authCheckTK1TokenMiddleware()) { knowledgeApi.POST("", s.createKnowledge) knowledgeApi.GET("", s.listKnowledge) knowledgeApi.PATCH("/:id", s.updateKnowledge) knowledgeApi.GET("/:id", s.detailKnowledge) knowledgeApi.DELETE("/:id", s.deleteKnowledge) knowledgeApi.POST("/:id/check_balance", s.checkBalance) knowledgeApi.POST("/update-with-signature", s.updateKnowledgeBaseInContractWithSignature) } knowledgeBasePublicApi := rootAPI.Group("/knowledge") { knowledgeBasePublicApi.POST("/retrieve", s.retrieveKnowledge) } infraTwitterApp := rootAPI.Group("/infra-twitter-app") { // infraTwitterApp.GET("/install", s.InfraTwitterAppAuthenInstall) infraTwitterApp.GET("/callback", s.InfraTwitterAppAuthenCallback) infraTwitterApp.GET("/tweets/search", s.middlewareApiLimit(3, 1*time.Second), s.InfraTwitterAppSearchRecentTweet) } utilityApi := rootAPI.Group("/utility", s.authCheckSignatureMiddleware()) // utilityApi := rootAPI.Group("/utility") { utilityApi.GET("/infra-twitter/info", s.GetInfraTwitterAppInfo) utilityApi.POST("/twitter/post", s.UtilityPostTwitter) // utilityApi.POST("/twitter/verify-deposit", s.UtilityTwitterVerifyDeposit) } vibeApi := rootAPI.Group("/vibe") { vibeApi.POST("/validate-ref-code", s.VibeValidateReferralCode) vibeApi.GET("/dashboard", s.GetVibeDashBoards) vibeApi.GET("/dashboard/:agent_id", s.GetVibeDashBoardsDetail) vibeApi.POST("/deploy-token/:agent_id", s.authCheckTK1TokenMiddleware(), s.VibeTokenGetDeployInfo) } } } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/compose.yaml ================================================ version: '3' services: redis: image: docker.io/bitnami/redis:7.4 environment: ALLOW_EMPTY_PASSWORD: "yes" ports: - 6379:6379 mysql: image: mysql environment: MYSQL_ROOT_PASSWORD: root MYSQL_DATABASE: main MYSQL_USER: admin MYSQL_PASSWORD: password ports: - 3306:3306 backend: build: dockerfile: ./Dockerfile.compose ports: - 8480:8480 extra_hosts: - host.docker.internal:host-gateway depends_on: - redis - mysql ================================================ FILE: agent-as-a-service/agent-orchestration/backend/configs/config.json.local ================================================ { "env": "local", "port": 8480, "job": false, "db_url": "admin:password@tcp(mysql:3306)/main?charset=utf8mb4&parseTime=True&loc=UTC", "encrypt_authen_key": "admin", "redis": { "addr": "redis:6379", "password": "", "db": 0 }, "private_keys": { "0x2c6583710bDB4B17588C45726f39d301A97bC992": "0xd9a5b20eb25608d7c81d56ea1ad866456ba6b9ec40f82e93d1b3ddd03e519926" }, "networks": { "1337": { "agent_admin_address": "0x2c6583710bDB4B17588C45726f39d301A97bC992", "agent_contract_address": "", "dagent721_contract_address": "", "prompt_scheduler_contract_address": "", "gpu_manager_contract_address": "", "eai_contract_address": "", "explorer_url": "", "meme_pool_address": "", "network_id": "1337", "rpc_url": "http://host.docker.internal:8545", "memeswap_factory_contract_address": "", "memeswap_position_mamanger_address": "", "uniswap_factory_contract_address": "", "uniswap_position_mamanger_address": "", "weth9_contract_address": "" } } } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/configs/config.json.sample ================================================ { "env": "production", "port": 8480, "debug": false, "job": false, "db_url": "", "encrypt_authen_key": "", "twitter": { "oauth_client_id": "", "oauth_client_secret": "", "token": "", "redirect_uri": "", "consumer_key": "", "consumer_secret": "", "access_token": "", "access_secret": "", "oauth_client_id_for_twitter_data": "", "oauth_client_secret_for_twitter_data": "", "token_for_twitter_data": "", "access_token_for_twitter_data": "", "access_secret_for_twitter_data": "" }, "token_twiter_id_for_internal": "", "google_storage": { "credentials_file": "", "bucket_name": "", "url": "" }, "redis": { "addr": "", "password": "", "db": 0, "prefix_naka": "", "prefix_rune": "" }, "core": { "url": "" }, "cmc_api_key": "", "ai_image_api_key": "", "btc": { "network": "main", "bcy_token": "", "qn_url": "" }, "blockchain_util": { "url": "" }, "ai": { "read_image_url": "", "api_key": "", "auto_agent_api_url": "", "ai_image_api_key": "" }, "ai_dojo_backend": { "url": "", "mention_api_key": "", "api_key": "" }, "token_twiter_id": "", "eternal_ai_agent_info_id": 0, "hiro_url": "", "opensea_api_key": "", "delegate_cash": { "api_key": "", "url": "" }, "lighthouse": { "apikey": "" }, "moralis_api_key": "", "rapid_api_key": "", "generate_image_url": "", "agent_offchain_chat_url": "", "agent_offchain_async_url": "", "agent_offchain_url": "", "eternalai_bridges_url": "", "telebot": { "tracker": { "botkey": "", "chat_id": 0, "message_thread_id": 0 }, "alert": { "botkey": "", "chat_id": 0, "message_thread_id": 0 }, "trade_analytics": { "botkey": "" } }, "networks": { "0": { "agent_token_admin_address": "" }, "42161": { "agent_admin_address": "", "agent_contract_address": "", "eai_contract_address": "0xDB8C67e6CA293F43C75e106c70b97033cC2909E3", "explorer_url": "https://arbiscan.io", "meme_pool_address": "", "network_id": "42161", "rpc_url": "", "memeswap_factory_contract_address": "", "memeswap_position_mamanger_address": "", "uniswap_factory_contract_address": "0x1a3c9B1d2F0529D97f2afC5136Cc23e58f1FD35B", "uniswap_position_mamanger_address": "0x00c7f3082833e796A5b3e4Bd59f6642FF44DCD15", "weth9_contract_address": "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1" }, "8453": { "agent_admin_address": "", "agent_contract_address": "", "eai_contract_address": "0x4B6bF1d365ea1A8d916Da37FaFd4ae8C86d061D7", "explorer_url": "https://basescan.org", "meme_pool_address": "", "network_id": "8453", "rpc_url": "", "memeswap_factory_contract_address": "", "memeswap_position_mamanger_address": "", "uniswap_factory_contract_address": "0x33128a8fC17869897dcE68Ed026d694621f6FDfD", "uniswap_position_mamanger_address": "0x03a520b32C04BF3bEEf7BEb72E919cf822Ed34f1", "weth9_contract_address": "0x4200000000000000000000000000000000000006" }, "56": { "agent_admin_address": "", "agent_contract_address": "", "eai_contract_address": "0x4B6bF1d365ea1A8d916Da37FaFd4ae8C86d061D7", "explorer_url": "https://bscscan.com", "meme_pool_address": "", "network_id": "56", "rpc_url": "", "memeswap_factory_contract_address": "", "memeswap_position_mamanger_address": "", "uniswap_factory_contract_address": "0x0BFbCF9fa4f9C56B0F40a671Ad40E0805A091865", "uniswap_position_mamanger_address": "0x46A15B0b27311cedF172AB29E4f4766fbE7F4364", "weth9_contract_address": "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c" }, "1": { "agent_admin_address": "", "agent_contract_address": "", "eai_contract_address": "0xa84f95eb3dabdc1bbd613709ef5f2fd42ce5be8d", "explorer_url": "https://etherscan.io", "meme_pool_address": "", "network_id": "1", "rpc_url": "", "uniswap_factory_contract_address": "0x1F98431c8aD98523631AE4a59f267346ea31F984", "uniswap_position_mamanger_address": "0xC36442b4a4522E871399CD717aBDD847Ab11FE88", "weth9_contract_address": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2" }, "137": { "agent_admin_address": "", "agent_contract_address": "", "eai_contract_address": "0xf7883f847Ae9b790b4b313f0f2e38Fa90965FB43", "explorer_url": "https://polygonscan.com", "meme_pool_address": "", "min_gas_price": "0", "network_id": "137", "rpc_url": "", "uniswap_factory_contract_address": "0x1F98431c8aD98523631AE4a59f267346ea31F984", "uniswap_position_mamanger_address": "0xC36442b4a4522E871399CD717aBDD847Ab11FE88", "uniswap_quoterv2_contract_address": "0x61fFE014bA17989E743c5F6cB21bF9697530B21e", "uniswap_swaprouter02_contract_address": "0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45", "weth9_contract_address": "0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270" }, "1111": { "agent_contract_address": "", "agent_token_account_address": "", "eai_contract_address": "12KwPzKewFGgzs69pvHmUKvhiDBtkAFCKoNjv6344Rkm", "network_id": "1111" }, "45762": { "agent_admin_address": "", "agent_contract_address": "", "eai_contract_address": "", "explorer_url": "https://explorer.symbiosis.eternalai.org", "network_id": "45762", "paymaster_address": "", "paymaster_fee_zero": "true", "paymaster_token": "", "rpc_url": "https://rpc.hermeschain.eternalai.org", "weth9_contract_address": "", "zk_sync": "true" }, "222671": { "agent_admin_address": "", "agent_contract_address": "", "eai_contract_address": "", "explorer_url": "", "meme_pool_address": "", "min_gas_price": "0", "network_id": "222671", "rpc_url": "https://rpc.shard-ai.l2aas.com", "is_btc_l1": "true" }, "324": { "agent_admin_address": "", "agent_contract_address": "", "eai_contract_address": "0xf3EF1Bd0368F5bF2769c70e3379cdB9cAA09769A", "explorer_url": "https://explorer.zksync.io", "meme_pool_address": "", "network_id": "324", "rpc_url": "", "uniswap_factory_contract_address": "", "uniswap_position_mamanger_address": "", "weth9_contract_address": "0x5AEa5775959fBC2557Cc8789bC1bf90A239D9a91", "zk_sync": "true" }, "43114": { "agent_admin_address": "", "agent_contract_address": "", "eai_contract_address": "0xe30f980a7cE39805fD2B75f34a8BEf30b4c38859", "explorer_url": "https://snowtrace.io", "meme_pool_address": "", "network_id": "43114", "rpc_url": "", "uniswap_factory_contract_address": "0x740b1c1de25031C31FF4fC9A62f554A55cdC1baD", "uniswap_position_mamanger_address": "0x655C406EBFa14EE2006250925e54ec43AD184f8B", "weth9_contract_address": "0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7" }, "43338": { "explorer_url": "https://explorer.eternalai.org", "network_id": "43338", "rpc_url": "https://node.eternalai.org" }, "11124": { "agent_admin_address": "", "agent_contract_address": "", "eai_contract_address": "0x9F06C611474666693b8c3D662eeF03ab7aA3C56E", "explorer_url": "https://explorer.testnet.abs.xyz", "meme_pool_address": "", "network_id": "11124", "rpc_url": "https://api.testnet.abs.xyz", "uniswap_factory_contract_address": "", "uniswap_position_mamanger_address": "", "weth9_contract_address": "", "zk_sync": "true" }, "964": { "agent_admin_address": "", "agent_contract_address": "", "eai_contract_address": "0x4B6bF1d365ea1A8d916Da37FaFd4ae8C86d061D7", "explorer_url": "https://taostats.io/evm", "meme_pool_address": "", "network_id": "964", "rpc_url": "", "uniswap_factory_contract_address": "", "uniswap_position_mamanger_address": "", "weth9_contract_address": "0xef71f3bab4136e87ec34d47f83f310a1998d0e13" }, "33139": { "agent_admin_address": "", "agent_contract_address": "", "eai_contract_address": "0x4b6bf1d365ea1a8d916da37fafd4ae8c86d061d7", "explorer_url": "https://apescan.io", "meme_pool_address": "", "network_id": "33139", "rpc_url": "", "memeswap_factory_contract_address": "", "memeswap_position_mamanger_address": "", "uniswap_factory_contract_address": "0x10aA510d94E094Bd643677bd2964c3EE085Daffc", "uniswap_position_mamanger_address": "0xC216fCdEb961EEF95657Cb45dEe20e379C7624B8", "weth9_contract_address": "0x48b62137EdfA95a428D35C09E44256a739F6B557" }, "5545": { "agent_admin_address": "", "agent_contract_address": "", "eai_contract_address": "0x4B6bF1d365ea1A8d916Da37FaFd4ae8C86d061D7", "explorer_url": "https://scan.duckchain.io", "meme_pool_address": "", "network_id": "5545", "rpc_url": "https://rpc-hk.duckchain.io", "memeswap_factory_contract_address": "", "memeswap_position_mamanger_address": "", "uniswap_factory_contract_address": "", "uniswap_position_mamanger_address": "", "weth9_contract_address": "0x7F9308E8d724e724EC31395f3af52e0593BB2e3f" } }, "tool_lists": { "farcaster_post": "", "farcaster_reply": "", "trade_news": "", "trade_analytic": "" }, "secret_key": "", "knowledge_base_config" : { "enable_simulation": false, "query_service_url": "", "direct_service_url": "", "kb_chat_top_k": 5, "on_chain_url": "https://api.eternalai.org/v1/chat/completions", "onchain_api_key": "" } } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/configs/configs.go ================================================ package configs import ( "encoding/json" "fmt" "os" "strconv" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/types/numeric" ) const ( EAI_OldWH_ChainID = "43338" // workerHub version 0 , other chain workerHub v1 BaseChainID = "8453" BaseChainIDInt = 8453 BitAiChainID = "222671" DAGIChainID = "222672" HermesChain = "45762" ArbitrumChainID = "42161" DuckChainID = "5545" PolygonChainID = "137" ZkSyncChainID = "324" ZkSyncChainIDInt = 324 EthereumChainID = "1" BscChainID = "56" AbstractTestnetChainID = "11124" SubtensorEVMChainID = "964" SubtensorEVMChainIDInt = 964 SolanaChainID = "1111" SolanaModelID = "990001" IPFSPrefix = "ipfs://" TronChainID = "728126428" ) type RPCResponse struct { JSONRPC string `json:"jsonrpc"` Result *ResultResponse `json:"result"` ID int `json:"id"` } type ResultResponse struct { Hash string `json:"hash"` BlockHash *string `json:"blockHash"` BlockNumber *string `json:"blockNumber"` Number *string `json:"number"` ChainID string `json:"chainId"` L1BlockNumber *string `json:"l1BlockNumber"` } var config *Config func init() { file, err := os.Open("configs/config.json") if err != nil { panic(err) } decoder := json.NewDecoder(file) v := Config{} err = decoder.Decode(&v) if err != nil { panic(err) } config = &v } func GetConfig() *Config { return config } type MissionTokensConfig struct { Symbol string `json:"symbol"` Name string `json:"name"` ImageUrl string `json:"image_url"` } func GetMissionTokenConfig() ([]MissionTokensConfig, error) { mapToken := map[string]map[string]string{} for _, item := range MISSION_TOKEN_CONFIGS { mapToken[item["symbol"]] = item } // jsonbody, err := json.Marshal(MISSION_TOKEN_CONFIGS) // if err != nil { // return nil, errs.NewError(err) // } v := []MissionTokensConfig{} for _, item := range BINANCE_TOKENS { i := MissionTokensConfig{ Symbol: item, Name: item, ImageUrl: "", } if v, ok := mapToken[item]; ok { i.Name = v["name"] i.ImageUrl = v["image_url"] } v = append(v, i) } return v, nil } type AppChainConfig struct { NetworkID uint64 `json:"network_id"` ExplorerUrl string `json:"explorer_url"` RpcUrl string `json:"rpc_url"` IsBtcL1 bool `json:"is_btc_l1"` ZkSync bool `json:"zk_sync"` AgentContractAddress string `json:"agent_contract_address"` AgentTokenAccountAddress string `json:"agent_token_account_address"` AgentAdminAddress string `json:"agent_admin_address"` EaiContractAddress string `json:"eai_contract_address"` MemePoolAddress string `json:"meme_pool_address"` UniswapFactoryContractAddress string `json:"uniswap_factory_contract_address"` UniswapPositionMamangerAddress string `json:"uniswap_position_mamanger_address"` Weth9ContractAddress string `json:"weth9_contract_address"` MinGasPrice numeric.BigInt `json:"min_gas_price"` PaymasterAddress string `json:"paymaster_address"` PaymasterToken string `json:"paymaster_token"` PaymasterFeeZero bool `json:"paymaster_fee_zero"` } type Config struct { Env string `json:"env"` Port int `json:"port"` Debug bool `json:"debug"` Job bool `json:"job"` DbURL string `json:"db_url"` EncryptAuthenKey string `json:"encrypt_authen_key"` InternalApiKey string `json:"internal_api_key"` TokenTwiterID string `json:"token_twiter_id"` TokenTwiterIdForInternal string `json:"token_twiter_id_for_internal"` CoinMarketCapApiKey string `json:"coin_market_cap_api_key"` Core struct { Url string `json:"url"` } `json:"core"` BlockchainUtils struct { Url string `json:"url"` } `json:"blockchain_util"` DeepResearch struct { Url string `json:"url"` } `json:"deep_research"` Btc struct { Network string `json:"network"` BcyToken string `json:"bcy_token"` QnUrl string `json:"qn_url"` } `json:"btc"` Redis *struct { Addr string `json:"addr"` Password string `json:"password"` Db int `json:"db"` Prefix string `json:"prefix"` } `json:"redis"` Twitter struct { OauthClientId string `json:"oauth_client_id"` OauthClientSecret string `json:"oauth_client_secret"` Token string `json:"token"` RedirectUri string `json:"redirect_uri"` ConsumerKey string `json:"consumer_key"` ConsumerSecret string `json:"consumer_secret"` AccessToken string `json:"access_token"` AccessSecret string `json:"access_secret"` OauthClientIdForTwitterData string `json:"oauth_client_id_for_twitter_data"` OauthClientSecretForTwitterData string `json:"oauth_client_secret_for_twitter_data"` TokenForTwitterData string `json:"token_for_twitter_data"` AccessTokenForTwitterData string `json:"access_token_for_twitter_data"` AccessSecretForTwitterData string `json:"access_secret_for_twitter_data"` } `json:"twitter"` GsStorage struct { CredentialsFile string `json:"credentials_file"` BucketName string `json:"bucket_name"` Url string `json:"url"` } `json:"google_storage"` AiImageApiKey string `json:"ai_image_api_key"` CMCApiKey string `json:"cmc_api_key"` Ai struct { ChatUrl string `json:"chat_url"` ApiKey string `json:"api_key"` ApiKeyMacStudio string `json:"api_key_mac_studio"` ModelName string `json:"model_name"` } `json:"ai"` Lighthouse struct { Apikey string `json:"apikey"` } `json:"lighthouse"` AiDojoBackend struct { Url string `json:"url"` ApiKey string `json:"api_key"` MentionApiKey string `json:"mention_api_key"` MentionNewFlow bool `json:"MentionNewFlow"` } `json:"ai_dojo_backend"` EternalAiAgentInfoId uint `json:"eternal_ai_agent_info_id"` VideoAiAgentInfoId uint `json:"video_ai_agent_info_id"` DetectVideoLLMVersion string `json:"detect_video_llm_version"` VideoTelegramKey string `json:"video_telegram_key"` VideoActivitiesTelegramAlert string `json:"video_activities_telegram_alert"` VideoFailSyntaxTelegramAlert string `json:"video_fail_syntax_telegram_alert"` GenMagicVideoPrompt bool `json:"gen_magic_video_prompt"` MagicVideoActivitiesTelegramAlert string `json:"magic_video_activities_telegram_alert"` NobullshitAgentInfoId uint `json:"nobullshit_agent_info_id"` LaunchpadAgentInfoId uint `json:"launchpad_agent_info_id"` HiroUrl string `json:"hiro_url"` OpenseaAPIKey string `json:"opensea_api_key"` TaApiKey string `json:"ta_api_key"` DelegateCash struct { Url string `json:"url"` ApiKey string `json:"api_key"` } `json:"delegate_cash"` MoralisApiKey string `json:"moralis_api_key"` RapidApiKey string `json:"rapid_api_key"` GenerateImageUrl string `json:"generate_image_url"` GenerateGifImageUrl string `json:"generate_gif_image_url"` AgentOffchainChatUrl string `json:"agent_offchain_chat_url"` AgentOffchain struct { Url string `json:"url"` ApiKey string `json:"api_key"` } `json:"agent_offchain"` EternalaiBridgesUrl string `json:"eternalai_bridges_url"` Telebot struct { Tracker struct { Botkey string `json:"botkey"` ChatID int64 `json:"chat_id"` MessageThreadID int `json:"message_thread_id"` } `json:"tracker"` Alert struct { Botkey string `json:"botkey"` ChatID int64 `json:"chat_id"` MessageThreadID int `json:"message_thread_id"` } `json:"alert"` TradeAnalytics struct { Botkey string `json:"botkey"` } `json:"trade_analytics"` } `json:"telebot"` ToolLists struct { FarcasterPost string `json:"farcaster_post"` FarcasterReply string `json:"farcaster_reply"` TradeNews string `json:"trade_news"` TradeAnalytic string `json:"trade_analytic"` PostTwitter string `json:"post_twitter"` } `json:"tool_lists"` Tron struct { RpcUrl string `json:"rpc_url"` ApiKey string `json:"api_key"` } `json:"tron"` PrivateKeys map[string]string `json:"private_keys"` Networks map[string]map[string]string `json:"networks"` AdminAutoCreateAgentAddress string `json:"admin_auto_create_agent_address"` SecretKey string `json:"secret_key"` WalletDeployAIKB20 string `json:"wallet_deploy_aik_b20"` HiddenNetworkId string `json:"hidden_network_id"` RagApi string `json:"rag_api"` ListTestToolSet string `json:"list_test_tool_set"` LuckyMoneyAdminAddress string `json:"lucky_money_admin_address"` LuckyMoneyAdminAddressSol string `json:"lucky_money_admin_address_sol"` WebhookUrl string `json:"webhook_url"` KnowledgeBaseConfig KnowledgeBaseConfig `json:"knowledge_base_config"` GetResultInferUrl string `json:"get_result_infer_url"` AgentDeployer struct { Url string `json:"url"` ApiKey string `json:"api_key"` } `json:"agent_deployer"` SampleTwitterApp struct { OauthClientId string `json:"oauth_client_id"` OauthClientSecret string `json:"oauth_client_secret"` RedirectUri string `json:"redirect_uri"` } `json:"sample_twitter_app"` InfraTwitterApp struct { OauthClientId string `json:"oauth_client_id"` OauthClientSecret string `json:"oauth_client_secret"` RedirectUri string `json:"redirect_uri"` InfraAuthUri string `json:"infra_auth_uri"` NetworkID uint64 `json:"network_id"` AgentAddress string `json:"agent_address"` WorkerAddress string `json:"worker_address"` AgentID uint `json:"agent_id"` Fee uint `json:"fee"` } `json:"infra_twitter_app"` Clanker struct { IsCreateToken bool `json:"is_create_token"` RequestorAddress string `json:"requestor_address"` ApiKey string `json:"api_key"` ApiUrl string `json:"api_url"` CreatorRewardsPercentage float64 `json:"creator_rewards_percentage"` CreatorRewardsAdmin string `json:"creator_rewards_admin"` } `json:"clanker"` Privy struct { AppID string `json:"app_id"` AppSecret string `json:"app_secret"` AppIDList []string `json:"app_id_list"` } `json:"privy"` PrivyEx map[string]string `json:"privy_ex"` Robot struct { TokenAdminAddress string `json:"token_admin_address"` TokenSupply uint64 `json:"token_supply"` } `json:"robot"` LighthouseUploadBinaryUrl string `json:"lighthouse_upload_binary_url"` } func (cf *Config) ExistsedConfigKey(networkID uint64, name string) bool { networkIDStr := fmt.Sprintf("%d", networkID) n, ok := cf.Networks[networkIDStr] if !ok { return false } v, ok := n[name] if !ok { return false } if v == "" { return false } return true } func (cf *Config) GetConfigKeyString(networkID uint64, name string) string { networkIDStr := fmt.Sprintf("%d", networkID) n, ok := cf.Networks[networkIDStr] if !ok { panic(fmt.Sprintf("not found %d %s", networkID, name)) } v, ok := n[name] if !ok { panic(fmt.Sprintf("not found %d %s", networkID, name)) } if v == "" { panic(fmt.Sprintf("not found %d %s", networkID, name)) } return v } func (cf *Config) GetConfigKeyBool(networkID uint64, name string) bool { networkIDStr := fmt.Sprintf("%d", networkID) n, ok := cf.Networks[networkIDStr] if !ok { panic(fmt.Sprintf("not found %d %s", networkID, name)) } v, ok := n[name] if !ok { return false } if v == "" { return false } rs, err := strconv.ParseBool(v) if err != nil { panic(err) } return rs } type KnowledgeBaseConfig struct { EnableSimulation bool `json:"enable_simulation"` QueryServiceUrl string `json:"query_service_url"` ToolCallServiceUrl string `json:"tool_call_service_url"` DirectServiceUrl string `json:"direct_service_url"` KbChatTopK int `json:"kb_chat_top_k"` KBTelegramKey string `json:"kb_telegram_key"` KBErrorTelegramAlert string `json:"kb_error_telegram_alert"` KBActivitiesTelegramAlert string `json:"kb_activities_telegram_alert"` BackendWallet string `json:"backend_wallet"` OnchainAPIKey string `json:"onchain_api_key"` OnChainUrl string `json:"on_chain_url"` } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/configs/mission_token.go ================================================ package configs var BINANCE_TOKENS = []string{ "BTC", "ETH", "BNB", "NEO", "LTC", "ADA", "XRP", "EOS", "IOTA", "XLM", "TRX", "ETC", "ICX", "NULS", "VET", "LINK", "ONG", "HOT", "ZIL", "ZRX", "FET", "BAT", "ZEC", "IOST", "CELR", "DASH", "THETA", "ENJ", "ATOM", "TFUEL", "ONE", "ALGO", "DOGE", "DUSK", "ANKR", "WIN", "COS", "MTL", "DENT", "WAN", "FUN", "CHZ", "BAND", "XTZ", "RVN", "HBAR", "NKN", "STX", "KAVA", "ARPA", "IOTX", "RLC", "CTXC", "BCH", "TROY", "OGN", "LSK", "BNT", "LTO", "MBL", "COTI", "STPT", "DATA", "SOL", "CTSI", "HIVE", "CHR", "ARDR", "MDT", "STMX", "KNC", "LRC", "COMP", "SC", "ZEN", "SNX", "VTHO", "DGB", "SXP", "MKR", "DCR", "STORJ", "MANA", "YFI", "BAL", "KMD", "JST", "CRV", "SAND", "NMR", "DOT", "RSR", "PAXG", "TRB", "SUSHI", "KSM", "EGLD", "DIA", "RUNE", "FIO", "UMA", "BEL", "WING", "UNI", "OXT", "SUN", "AVAX", "FLM", "UTK", "XVS", "ALPHA", "AAVE", "NEAR", "FIL", "INJ", "AUDIO", "CTK", "AXS", "AVA", "SKL", "GRT", "1INCH", "CELO", "RIF", "TRU", "CKB", "TWT", "FIRO", "LIT", "SFP", "DODO", "CAKE", "ACM", "BADGER", "FIS", "OM", "POND", "DEGO", "ALICE", "LINA", "PERP", "SUPER", "CFX", "TKO", "PUNDIX", "TLM", "BAR", "FORTH", "BAKE", "BURGER", "SLP", "SHIB", "ICP", "AR", "MASK", "LPT", "XVG", "ATA", "GTC", "ERN", "PHA", "MLN", "DEXE", "C98", "CLV", "QNT", "FLOW", "MINA", "RAY", "FARM", "ALPACA", "MBOX", "REQ", "GHST", "WAXP", "GNO", "XEC", "ELF", "DYDX", "IDEX", "GALA", "ILV", "YGG", "SYS", "DF", "FIDA", "AGLD", "RAD", "BETA", "RARE", "LAZIO", "CHESS", "ADX", "AUCTION", "MOVR", "CITY", "ENS", "QI", "PORTO", "POWR", "JASMY", "AMP", "PYR", "ALCX", "SANTOS", "BICO", "FLUX", "FXS", "VOXEL", "HIGH", "CVX", "PEOPLE", "SPELL", "JOE", "ACH", "IMX", "GLMR", "LOKA", "SCRT", "API3", "BTTC", "ACA", "XNO", "WOO", "ALPINE", "T", "ASTR", "GMT", "KDA", "APE", "BSW", "BIFI", "STEEM", "NEXO", "REI", "LDO", "OP", "LEVER", "STG", "LUNC", "GMX", "POLYX", "APT", "OSMO", "HFT", "VIDT", "PHB", "HOOK", "MAGIC", "HIFI", "RPL", "PROS", "GNS", "BNX", "SYN", "VIB", "SSV", "LQTY", "AMB", "USTC", "TUSD", "USDC", "USDP", "GAS", "GLM", "PROM", "QKC", "UFT", "ID", "ARB", "RDNT", "WBTC", "EDU", "SUI", "AERGO", "PEPE", "FLOKI", "CVC", "AST", "SNT", "COMBO", "MAV", "PENDLE", "ARKM", "WBETH", "QUICK", "WLD", "FDUSD", "SEI", "CYBER", "FTT", "ARK", "CREAM", "IQ", "NTRN", "TIA", "MEME", "ORDI", "BEAMX", "PIVX", "VIC", "BLUR", "VANRY", "JTO", "AEUR", "1000SATS", "BONK", "ACE", "NFP", "AI", "XAI", "MANTA", "ALT", "JUP", "PYTH", "RONIN", "DYM", "PIXEL", "STRK", "PORTAL", "PDA", "AXL", "WIF", "METIS", "AEVO", "BOME", "ETHFI", "STRAX", "ENA", "W", "TNSR", "SAGA", "TAO", "OMNI", "REZ", "BB", "NOT", "IO", "ZK", "LISTA", "ZRO", "G", "BANANA", "RENDER", "TON", "DOGS", "EURI", "SLF", "POL", "NEIRO", "TURBO", "1MBABYDOGE", "CATI", "HMSTR", "EIGEN", // "BNSOL", "LUMIA", "SCR", "KAIA", "COW", "CETUS", "PNUT", "ACT", "THE", "ACX", "ORCA", "MOVE", "ME", "VANA", "USUAL", "PENGU", "BIO", "D", "AIXBT", "CGPT", "COOKIE", "QTUM", "ONT", } var MISSION_TOKEN_CONFIGS = []map[string]string{ { "name": "Bitcoin", "symbol": "BTC", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/1.png", }, { "name": "Ethereum", "symbol": "ETH", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/1027.png", }, { "name": "XRP", "symbol": "XRP", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/52.png", }, { "name": "Tether USDt", "symbol": "USDT", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/825.png", }, { "name": "Solana", "symbol": "SOL", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/5426.png", }, { "name": "BNB", "symbol": "BNB", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/1839.png", }, { "name": "Dogecoin", "symbol": "DOGE", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/74.png", }, { "name": "USDC", "symbol": "USDC", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/3408.png", }, { "name": "Cardano", "symbol": "ADA", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/2010.png", }, { "name": "TRON", "symbol": "TRX", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/1958.png", }, { "name": "Avalanche", "symbol": "AVAX", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/5805.png", }, { "name": "Stellar", "symbol": "XLM", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/512.png", }, { "name": "Chainlink", "symbol": "LINK", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/1975.png", }, { "name": "Hedera", "symbol": "HBAR", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/4642.png", }, { "name": "Sui", "symbol": "SUI", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/20947.png", }, { "name": "Toncoin", "symbol": "TON", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/11419.png", }, { "name": "Shiba Inu", "symbol": "SHIB", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/5994.png", }, { "name": "Polkadot", "symbol": "DOT", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/6636.png", }, { "name": "Litecoin", "symbol": "LTC", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/2.png", }, { "name": "Bitcoin Cash", "symbol": "BCH", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/1831.png", }, { "name": "UNUS SED LEO", "symbol": "LEO", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/3957.png", }, { "name": "Uniswap", "symbol": "UNI", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/7083.png", }, { "name": "Bitget Token", "symbol": "BGB", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/11092.png", }, { "name": "Pepe", "symbol": "PEPE", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/24478.png", }, { "name": "Hyperliquid", "symbol": "HYPE", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/32196.png", }, { "name": "NEAR Protocol", "symbol": "NEAR", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/6535.png", }, { "name": "NEAR Protocol", "symbol": "NEAR", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/6535.png", }, { "name": "Ethena USDe", "symbol": "USDe", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/29470.png", }, { "name": "Aptos", "symbol": "APT", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/21794.png", }, { "name": "Dai", "symbol": "DAI", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/4943.png", }, { "name": "Internet Computer", "symbol": "ICP", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/8916.png", }, { "name": "Aave", "symbol": "AAVE", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/7278.png", }, { "name": "VeChain", "symbol": "VET", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/3077.png", }, { "name": "Ethereum Classic", "symbol": "ETC", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/1321.png", }, { "name": "Monero", "symbol": "XMR", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/328.png", }, { "name": "POL (ex-MATIC)", "symbol": "POL", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/28321.png", }, { "name": "Algorand", "symbol": "ALGO", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/4030.png", }, { "name": "Render", "symbol": "RENDER", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/5690.png", }, { "name": "Cronos", "symbol": "CRO", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/3635.png", }, { "name": "Kaspa", "symbol": "KAS", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/20396.png", }, { "name": "Mantle", "symbol": "MNT", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/27075.png", }, { "name": "MANTRA", "symbol": "OM", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/6536.png", }, { "name": "MANTRA", "symbol": "OM", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/6536.png", }, { "name": "Bittensor", "symbol": "TAO", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/22974.png", }, { "name": "Filecoin", "symbol": "FIL", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/2280.png", }, { "name": "Artificial Superintelligence Alliance", "symbol": "FET", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/3773.png", }, { "name": "Arbitrum", "symbol": "ARB", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/11841.png", }, { "name": "OKB", "symbol": "OKB", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/3897.png", }, { "name": "Ethena", "symbol": "ENA", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/30171.png", }, { "name": "Cosmos", "symbol": "ATOM", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/3794.png", }, { "name": "Celestia", "symbol": "TIA", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/22861.png", }, { "name": "Optimism", "symbol": "OP", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/11840.png", }, { "name": "Stacks", "symbol": "STX", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/4847.png", }, { "name": "Theta Network", "symbol": "THETA", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/2416.png", }, { "name": "Immutable", "symbol": "IMX", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/10603.png", }, { "name": "Injective", "symbol": "INJ", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/7226.png", }, { "name": "Virtuals Protocol", "symbol": "VIRTUAL", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/29420.png", }, { "name": "Sonic (prev. FTM)", "symbol": "S", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/32684.png", }, { "name": "Bonk", "symbol": "BONK", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/23095.png", }, { "name": "XDC Network", "symbol": "XDC", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/2634.png", }, { "name": "The Graph", "symbol": "GRT", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/6719.png", }, { "name": "Pudgy Penguins", "symbol": "PENGU", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/34466.png", }, { "name": "Worldcoin", "symbol": "WLD", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/13502.png", }, { "name": "Worldcoin", "symbol": "WLD", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/13502.png", }, { "name": "Movement", "symbol": "MOVE", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/32452.png", }, { "name": "First Digital USD", "symbol": "FDUSD", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/26081.png", }, { "name": "Sei", "symbol": "SEI", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/23149.png", }, { "name": "Lido DAO", "symbol": "LDO", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/8000.png", }, { "name": "Lido DAO", "symbol": "LDO", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/8000.png", }, { "name": "dogwifhat", "symbol": "WIF", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/28752.png", }, { "name": "GateToken", "symbol": "GT", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/4269.png", }, { "name": "Ondo", "symbol": "ONDO", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/21159.png", }, { "name": "FLOKI", "symbol": "FLOKI", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/10804.png", }, { "name": "Raydium", "symbol": "RAY", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/8526.png", }, { "name": "Flare", "symbol": "FLR", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/7950.png", }, { "name": "JasmyCoin", "symbol": "JASMY", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/8425.png", }, { "name": "The Sandbox", "symbol": "SAND", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/6210.png", }, { "name": "EOS", "symbol": "EOS", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/1765.png", }, { "name": "IOTA", "symbol": "IOTA", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/1720.png", }, { "name": "DeXe", "symbol": "DEXE", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/7326.png", }, { "name": "Quant", "symbol": "QNT", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/3155.png", }, { "name": "ai16z", "symbol": "AI16Z", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/34026.png", }, { "name": "ai16z", "symbol": "AI16Z", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/34026.png", }, { "name": "Fartcoin", "symbol": "FARTCOIN", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/33597.png", }, { "name": "Gala", "symbol": "GALA", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/7080.png", }, { "name": "Tezos", "symbol": "XTZ", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/2011.png", }, { "name": "KuCoin Token", "symbol": "KCS", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/2087.png", }, { "name": "Kaia", "symbol": "KAIA", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/32880.png", }, { "name": "Maker", "symbol": "MKR", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/1518.png", }, { "name": "Brett (Based)", "symbol": "BRETT", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/29743.png", }, { "name": "THORChain", "symbol": "RUNE", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/4157.png", }, { "name": "Pyth Network", "symbol": "PYTH", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/28177.png", }, { "name": "Flow", "symbol": "FLOW", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/4558.png", }, { "name": "Ethereum Name Service", "symbol": "ENS", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/13855.png", }, { "name": "Curve DAO Token", "symbol": "CRV", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/6538.png", }, { "name": "Curve DAO Token", "symbol": "CRV", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/6538.png", }, { "name": "Neo", "symbol": "NEO", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/1376.png", }, { "name": "Beam", "symbol": "BEAM", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/28298.png", }, { "name": "Arweave", "symbol": "AR", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/5632.png", }, { "name": "AIOZ Network", "symbol": "AIOZ", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/9104.png", }, { "name": "Bitcoin SV", "symbol": "BSV", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/3602.png", }, { "name": "BitTorrent [New]", "symbol": "BTT", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/16086.png", }, { "name": "Jupiter", "symbol": "JUP", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/29210.png", }, { "name": "Decentraland", "symbol": "MANA", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/1966.png", }, { "name": "Starknet", "symbol": "STRK", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/22691.png", }, { "name": "Axie Infinity", "symbol": "AXS", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/6783.png", }, { "name": "MultiversX", "symbol": "EGLD", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/6892.png", }, { "name": "Aerodrome Finance", "symbol": "AERO", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/29270.png", }, { "name": "dYdX (Native)", "symbol": "DYDX", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/28324.png", }, { "name": "SPX6900", "symbol": "SPX", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/28081.png", }, { "name": "Core", "symbol": "CORE", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/23254.png", }, { "name": "Polygon", "symbol": "MATIC", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/3890.png", }, { "name": "Nexo", "symbol": "NEXO", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/2694.png", }, { "name": "Helium", "symbol": "HNT", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/5665.png", }, { "name": "Zcash", "symbol": "ZEC", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/1437.png", }, { "name": "ApeCoin", "symbol": "APE", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/18876.png", }, { "name": "Conflux", "symbol": "CFX", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/7334.png", }, { "name": "Chiliz", "symbol": "CHZ", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/4066.png", }, { "name": "Reserve Rights", "symbol": "RSR", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/3964.png", }, { "name": "FTX Token", "symbol": "FTT", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/4195.png", }, { "name": "Akash Network", "symbol": "AKT", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/7431.png", }, { "name": "Jito", "symbol": "JTO", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/28541.png", }, { "name": "Jito", "symbol": "JTO", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/28541.png", }, { "name": "USDD", "symbol": "USDD", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/19891.png", }, { "name": "eCash", "symbol": "XEC", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/10791.png", }, { "name": "Wormhole", "symbol": "W", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/29587.png", }, { "name": "Compound", "symbol": "COMP", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/5692.png", }, { "name": "PancakeSwap", "symbol": "CAKE", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/7186.png", }, { "name": "Amp", "symbol": "AMP", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/6945.png", }, { "name": "Mina", "symbol": "MINA", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/8646.png", }, { "name": "EigenLayer", "symbol": "EIGEN", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/30494.png", }, { "name": "Mog Coin", "symbol": "MOG", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/27659.png", }, { "name": "Ronin", "symbol": "RONIN", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/14101.png", }, { "name": "Ronin", "symbol": "RON", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/14101.png", }, { "name": "aixbt by Virtuals", "symbol": "AIXBT", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/34103.png", }, { "name": "Morpho", "symbol": "MORPHO", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/34104.png", }, { "name": "ZKsync", "symbol": "ZK", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/24091.png", }, { "name": "Tether Gold", "symbol": "XAUt", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/5176.png", }, { "name": "SuperVerse", "symbol": "SUPER", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/8290.png", }, { "name": "Pendle", "symbol": "PENDLE", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/9481.png", }, { "name": "Gnosis", "symbol": "GNO", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/1659.png", }, { "name": "Notcoin", "symbol": "NOT", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/28850.png", }, { "name": "Synthetix", "symbol": "SNX", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/2586.png", }, { "name": "Grass", "symbol": "GRASS", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/32956.png", }, { "name": "Peanut the Squirrel", "symbol": "PNUT", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/33788.png", }, { "name": "Popcat (SOL)", "symbol": "POPCAT", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/28782.png", }, { "name": "Axelar", "symbol": "AXL", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/17799.png", }, { "name": "Oasis", "symbol": "ROSE", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/7653.png", }, { "name": "Gigachad (gigachadsolana.com)", "symbol": "GIGA", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/30063.png", }, { "name": "Terra Classic", "symbol": "LUNC", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/4172.png", }, { "name": "ORDI", "symbol": "ORDI", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/25028.png", }, { "name": "ORDI", "symbol": "ORDI", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/25028.png", }, { "name": "Livepeer", "symbol": "LPT", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/3640.png", }, { "name": "Turbo", "symbol": "TURBO", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/24911.png", }, { "name": "Echelon Prime", "symbol": "PRIME", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/23711.png", }, { "name": "Kava", "symbol": "KAVA", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/4846.png", }, { "name": "PAX Gold", "symbol": "PAXG", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/4705.png", }, { "name": "cat in a dogs world", "symbol": "MEW", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/30126.png", }, { "name": "1inch Network", "symbol": "1INCH", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/8104.png", }, { "name": "Bio Protocol", "symbol": "BIO", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/34812.png", }, { "name": "Kusama", "symbol": "KSM", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/5034.png", }, { "name": "LayerZero", "symbol": "ZRO", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/26997.png", }, { "name": "Trust Wallet Token", "symbol": "TWT", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/5964.png", }, { "name": "Nervos Network", "symbol": "CKB", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/4948.png", }, { "name": "PayPal USD", "symbol": "PYUSD", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/27772.png", }, { "name": "APENFT", "symbol": "NFT", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/9816.png", }, { "name": "TrueUSD", "symbol": "TUSD", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/2563.png", }, { "name": "Dash", "symbol": "DASH", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/131.png", }, { "name": "Blur", "symbol": "BLUR", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/23121.png", }, { "name": "Manta Network", "symbol": "MANTA", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/13631.png", }, { "name": "Manta Network", "symbol": "MANTA", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/13631.png", }, { "name": "Horizen", "symbol": "ZEN", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/1698.png", }, { "name": "Baby Doge Coin", "symbol": "BabyDoge", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/10407.png", }, { "name": "Theta Fuel", "symbol": "TFUEL", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/3822.png", }, { "name": "Astar", "symbol": "ASTR", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/12885.png", }, { "name": "Creditcoin", "symbol": "CTC", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/5198.png", }, { "name": "Convex Finance", "symbol": "CVX", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/9903.png", }, { "name": "io.net", "symbol": "IO", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/29835.png", }, { "name": "ether.fi", "symbol": "ETHFI", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/29814.png", }, { "name": "Safe", "symbol": "SAFE", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/21585.png", }, { "name": "Zilliqa", "symbol": "ZIL", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/2469.png", }, { "name": "0x Protocol", "symbol": "ZRX", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/1896.png", }, { "name": "Holo", "symbol": "HOT", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/2682.png", }, { "name": "SushiSwap", "symbol": "SUSHI", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/6758.png", }, { "name": "BOOK OF MEME", "symbol": "BOME", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/29870.png", }, { "name": "JUST", "symbol": "JST", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/5488.png", }, { "name": "Golem", "symbol": "GLM", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/1455.png", }, { "name": "WOO", "symbol": "WOO", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/7501.png", }, { "name": "WOO", "symbol": "WOO", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/7501.png", }, { "name": "Basic Attention Token", "symbol": "BAT", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/1697.png", }, { "name": "Open Campus", "symbol": "EDU", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/24613.png", }, { "name": "SPACE ID", "symbol": "ID", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/21846.png", }, { "name": "Harmony", "symbol": "ONE", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/3945.png", }, { "name": "Enjin Coin", "symbol": "ENJ", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/2130.png", }, { "name": "Vana", "symbol": "VANA", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/34619.png", }, { "name": "Aethir", "symbol": "ATH", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/30083.png", }, { "name": "Ankr", "symbol": "ANKR", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/3783.png", }, { "name": "Celo", "symbol": "CELO", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/5567.png", }, { "name": "IoTeX", "symbol": "IOTX", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/2777.png", }, { "name": "Goatseus Maximus", "symbol": "GOAT", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/33440.png", }, { "name": "Qtum", "symbol": "QTUM", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/1684.png", }, { "name": "GMT", "symbol": "GMT", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/18069.png", }, { "name": "MX Token", "symbol": "MX", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/4041.png", }, { "name": "Moca Network", "symbol": "MOCA", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/31526.png", }, { "name": "Moca Network", "symbol": "MOCA", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/31526.png", }, { "name": "SafePal", "symbol": "SFP", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/8119.png", }, { "name": "OriginTrail", "symbol": "TRAC", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/2467.png", }, { "name": "WEMIX", "symbol": "WEMIX", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/7548.png", }, { "name": "Siacoin", "symbol": "SC", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/1042.png", }, { "name": "Gas", "symbol": "GAS", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/1785.png", }, { "name": "Memecoin", "symbol": "MEME", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/28301.png", }, { "name": "EthereumPoW", "symbol": "ETHW", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/21296.png", }, { "name": "Solana Swap", "symbol": "SOS", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/33110.png", }, { "name": "Fasttoken", "symbol": "FTN", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/22615.png", }, { "name": "Usual USD", "symbol": "USD0", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/32307.png", }, { "name": "Zeebu", "symbol": "ZBU", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/27765.png", }, { "name": "Fellaz", "symbol": "FLZ", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/20787.png", }, { "name": "ShibaBitcoin", "symbol": "SHIBTC", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/30953.png", }, { "name": "Meta Games Coin", "symbol": "MGC", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/29839.png", }, { "name": "Frax", "symbol": "FRAX", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/6952.png", }, { "name": "DeepBook Protocol", "symbol": "DEEP", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/33391.png", }, { "name": "Dog (Bitcoin)", "symbol": "DOG", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/30933.png", }, { "name": "Beldex", "symbol": "BDX", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/3987.png", }, { "name": "Telcoin", "symbol": "TEL", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/2394.png", }, { "name": "GRIFFAIN", "symbol": "GRIFFAIN", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/34792.png", }, { "name": "Akuma Inu", "symbol": "$AKUMA", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/34457.png", }, { "name": "Snek", "symbol": "SNEK", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/25264.png", }, { "name": "Freysa", "symbol": "FAI", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/34330.png", }, { "name": "Cheelee", "symbol": "CHEEL", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/23054.png", }, { "name": "Cheelee", "symbol": "CHEEL", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/23054.png", }, { "name": "Chintai", "symbol": "CHEX", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/8534.png", }, { "name": "insurance", "symbol": "INSURANCE", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/33553.png", }, { "name": "insurance", "symbol": "INSURANCE", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/33553.png", }, { "name": "AI Rig Complex", "symbol": "ARC", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/34926.png", }, { "name": "Ondo US Dollar Yield", "symbol": "USDY", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/29256.png", }, { "name": "PAAL AI", "symbol": "PAAL", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/27178.png", }, { "name": "Destra Network", "symbol": "DSYNC", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/29884.png", }, { "name": "Osmosis", "symbol": "OSMO", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/12220.png", }, { "name": "Neiro (First Neiro On Ethereum)", "symbol": "NEIRO", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/32521.png", }, { "name": "Neiro (First Neiro On Ethereum)", "symbol": "NEIRO", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/32521.png", }, { "name": "ZetaChain", "symbol": "ZETA", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/21259.png", }, { "name": "Magic Eden", "symbol": "ME", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/32197.png", }, { "name": "aelf", "symbol": "ELF", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/2299.png", }, { "name": "SwissBorg", "symbol": "BORG", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/2499.png", }, { "name": "Chia", "symbol": "XCH", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/9258.png", }, { "name": "Arkham", "symbol": "ARKM", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/27565.png", }, { "name": "Ultima", "symbol": "ULTIMA", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/28293.png", }, { "name": "Drift", "symbol": "DRIFT", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/31278.png", }, { "name": "Ravencoin", "symbol": "RVN", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/2577.png", }, { "name": "Aevo", "symbol": "AEVO", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/29676.png", }, { "name": "ChainGPT", "symbol": "CGPT", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/23756.png", }, { "name": "Tribe", "symbol": "TRIBE", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/9025.png", }, { "name": "SATS (Ordinals)", "symbol": "SATS", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/28194.png", }, { "name": "peaq", "symbol": "PEAQ", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/14588.png", }, { "name": "Threshold", "symbol": "T", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/17751.png", }, { "name": "Clearpool", "symbol": "CPOOL", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/12573.png", }, { "name": "Frax Share", "symbol": "FXS", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/6953.png", }, { "name": "MimbleWimbleCoin", "symbol": "MWC", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/5031.png", }, { "name": "Qubic", "symbol": "QUBIC", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/29169.png", }, { "name": "dYdX (ethDYDX)", "symbol": "ETHDYDX", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/11156.png", }, { "name": "Usual", "symbol": "USUAL", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/33979.png", }, { "name": "Zerebro", "symbol": "ZEREBRO", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/34083.png", }, { "name": "Dymension", "symbol": "DYM", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/28932.png", }, { "name": "Phala Network", "symbol": "PHA", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/6841.png", }, { "name": "Mask Network", "symbol": "MASK", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/8536.png", }, { "name": "yearn.finance", "symbol": "YFI", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/5864.png", }, { "name": "AVA", "symbol": "AVA", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/34116.png", }, { "name": "Kadena", "symbol": "KDA", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/5647.png", }, { "name": "Loopring", "symbol": "LRC", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/1934.png", }, { "name": "Unicorn Fart Dust", "symbol": "UFD", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/34853.png", }, { "name": "XYO", "symbol": "XYO", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/2765.png", }, { "name": "Biconomy", "symbol": "BICO", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/9543.png", }, { "name": "Velo", "symbol": "VELO", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/7127.png", }, { "name": "SKALE", "symbol": "SKL", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/5691.png", }, { "name": "Polymesh", "symbol": "POLYX", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/20362.png", }, { "name": "Gravity", "symbol": "G", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/32120.png", }, { "name": "Metars Genesis", "symbol": "MRS", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/21178.png", }, { "name": "GMX", "symbol": "GMX", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/11857.png", }, { "name": "Sologenic", "symbol": "SOLO", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/5279.png", }, { "name": "ssv.network", "symbol": "SSV", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/12999.png", }, { "name": "Elixir deUSD", "symbol": "DEUSD", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/31024.png", }, { "name": "Elixir deUSD", "symbol": "DEUSD", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/31024.png", }, { "name": "Hive", "symbol": "HIVE", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/5370.png", }, { "name": "Hey Anon", "symbol": "ANON", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/35092.png", }, { "name": "Bazaars", "symbol": "BZR", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/24554.png", }, { "name": "Bazaars", "symbol": "BZR", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/24554.png", }, { "name": "Decred", "symbol": "DCR", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/1168.png", }, { "name": "Act I : The AI Prophecy", "symbol": "ACT", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/33566.png", }, { "name": "Humans.ai", "symbol": "HEART", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/15584.png", }, { "name": "NEM", "symbol": "XEM", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/873.png", }, { "name": "GoldPro Token", "symbol": "GPRO", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/28380.png", }, { "name": "DOGS", "symbol": "DOGS", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/32698.png", }, { "name": "Ontology", "symbol": "ONT", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/2566.png", }, { "name": "Metis", "symbol": "METIS", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/9640.png", }, { "name": "Apu Apustaja", "symbol": "APU", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/30008.png", }, { "name": "Apu Apustaja", "symbol": "APU", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/30008.png", }, { "name": "Altlayer", "symbol": "ALT", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/29073.png", }, { "name": "Casper", "symbol": "CSPR", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/5899.png", }, { "name": "Avail", "symbol": "AVAIL", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/32376.png", }, { "name": "Orbler", "symbol": "ORBR", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/17520.png", }, { "name": "Orbler", "symbol": "ORBR", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/17520.png", }, { "name": "VeThor Token", "symbol": "VTHO", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/3012.png", }, { "name": "Sun [New]", "symbol": "SUN", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/10529.png", }, { "name": "Sun [New]", "symbol": "SUN", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/10529.png", }, { "name": "Verge", "symbol": "XVG", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/693.png", }, { "name": "Solana Name Service", "symbol": "FIDA", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/7978.png", }, { "name": "Wilder World", "symbol": "WILD", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/9674.png", }, { "name": "DigiByte", "symbol": "DGB", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/109.png", }, { "name": "Rocket Pool", "symbol": "RPL", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/2943.png", }, { "name": "TARS AI", "symbol": "TAI", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/20605.png", }, { "name": "CoW Protocol", "symbol": "COW", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/19269.png", }, { "name": "Xai", "symbol": "XAI", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/28933.png", }, { "name": "Flux", "symbol": "FLUX", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/3029.png", }, { "name": "PepeCoin", "symbol": "PEPECOIN", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/24835.png", }, { "name": "UMA", "symbol": "UMA", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/5617.png", }, { "name": "Band Protocol", "symbol": "BAND", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/4679.png", }, { "name": "Waves", "symbol": "WAVES", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/1274.png", }, { "name": "COTI", "symbol": "COTI", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/3992.png", }, { "name": "0x0.ai", "symbol": "0x0", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/23355.png", }, { "name": "Solar", "symbol": "SXP", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/4279.png", }, { "name": "Blast", "symbol": "BLAST", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/28480.png", }, { "name": "Hivemapper", "symbol": "HONEY", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/22850.png", }, { "name": "Polyhedra Network", "symbol": "ZKJ", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/29779.png", }, { "name": "Hamster Kombat", "symbol": "HMSTR", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/32195.png", }, { "name": "GoМining", "symbol": "GOMINING", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/10180.png", }, { "name": "Moonbeam", "symbol": "GLMR", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/6836.png", }, { "name": "LCX", "symbol": "LCX", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/4950.png", }, { "name": "Cetus Protocol", "symbol": "CETUS", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/25114.png", }, { "name": "Storj", "symbol": "STORJ", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/1772.png", }, { "name": "Zentry", "symbol": "ZENT", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/30963.png", }, { "name": "ConstitutionDAO", "symbol": "PEOPLE", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/14806.png", }, { "name": "Illuvium", "symbol": "ILV", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/8719.png", }, { "name": "Alchemy Pay", "symbol": "ACH", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/6958.png", }, { "name": "World Mobile Token", "symbol": "WMTX", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/13769.png", }, { "name": "World Mobile Token", "symbol": "WMTX", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/13769.png", }, { "name": "ICON", "symbol": "ICX", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/2099.png", }, { "name": "Radix", "symbol": "XRD", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/11948.png", }, { "name": "Bitcoin Gold", "symbol": "BTG", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/2083.png", }, { "name": "HarryPotterObamaSonic10Inu (ERC-20)", "symbol": "BITCOIN", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/25220.png", }, { "name": "UXLINK", "symbol": "UXLINK", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/32257.png", }, { "name": "WAX", "symbol": "WAXP", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/2300.png", }, { "name": "Audius", "symbol": "AUDIO", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/7455.png", }, { "name": "Huobi Token", "symbol": "HT", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/2502.png", }, { "name": "Huobi Token", "symbol": "HT", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/2502.png", }, { "name": "Ski Mask Dog", "symbol": "SKI", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/31173.png", }, { "name": "Zano", "symbol": "ZANO", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/4691.png", }, { "name": "Orca", "symbol": "ORCA", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/11165.png", }, { "name": "Nano", "symbol": "XNO", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/1567.png", }, { "name": "Yield Guild Games", "symbol": "YGG", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/10688.png", }, { "name": "Status", "symbol": "SNT", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/1759.png", }, { "name": "Vanar Chain", "symbol": "VANRY", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/8037.png", }, { "name": "Liquity", "symbol": "LQTY", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/7429.png", }, { "name": "Mythos", "symbol": "MYTH", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/22125.png", }, { "name": "Simon's Cat", "symbol": "CAT", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/32724.png", }, { "name": "Moo Deng (moodengsol.com)", "symbol": "MOODENG", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/33093.png", }, { "name": "Rollbit Coin", "symbol": "RLB", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/15271.png", }, { "name": "Constellation", "symbol": "DAG", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/2868.png", }, { "name": "Big Time", "symbol": "BIGTIME", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/28230.png", }, { "name": "Chromia", "symbol": "CHR", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/3978.png", }, { "name": "Swarms", "symbol": "SWARMS", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/34993.png", }, { "name": "ANDY (ETH)", "symbol": "ANDY", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/29879.png", }, { "name": "Non-Playable Coin", "symbol": "NPC", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/27960.png", }, { "name": "Fwog (SOL)", "symbol": "FWOG", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/33291.png", }, { "name": "Polymath", "symbol": "POLY", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/2496.png", }, { "name": "Pixels", "symbol": "PIXEL", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/29335.png", }, { "name": "Saga", "symbol": "SAGA", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/30372.png", }, { "name": "Metaplex", "symbol": "MPLX", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/21870.png", }, { "name": "VVS Finance", "symbol": "VVS", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/14519.png", }, { "name": "VVS Finance", "symbol": "VVS", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/14519.png", }, { "name": "Sleepless AI", "symbol": "AI", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/28846.png", }, { "name": "ZIGChain", "symbol": "ZIG", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/9260.png", }, { "name": "Onyxcoin", "symbol": "XCN", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/18679.png", }, { "name": "Aleo", "symbol": "ALEO", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/32193.png", }, { "name": "BounceBit", "symbol": "BB", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/30746.png", }, { "name": "Civic", "symbol": "CVC", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/1816.png", }, { "name": "Lisk", "symbol": "LSK", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/1214.png", }, { "name": "Cookie DAO", "symbol": "COOKIE", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/31838.png", }, { "name": "BasedAI", "symbol": "BASEDAI", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/30584.png", }, { "name": "Venus", "symbol": "XVS", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/7288.png", }, { "name": "Marlin", "symbol": "POND", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/7497.png", }, { "name": "Ponke", "symbol": "PONKE", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/29150.png", }, { "name": "Limitus", "symbol": "LMT", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/34746.png", }, { "name": "UPCX", "symbol": "UPC", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/28654.png", }, { "name": "Tellor", "symbol": "TRB", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/4944.png", }, { "name": "Powerledger", "symbol": "POWR", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/2132.png", }, { "name": "IQ", "symbol": "IQ", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/2930.png", }, { "name": "Balancer", "symbol": "BAL", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/5728.png", }, { "name": "pippin", "symbol": "PIPPIN", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/35053.png", }, { "name": "iExec RLC", "symbol": "RLC", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/1637.png", }, { "name": "Scroll", "symbol": "SCR", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/26998.png", }, { "name": "Centrifuge", "symbol": "CFG", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/6748.png", }, { "name": "Devve", "symbol": "DEVVE", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/29461.png", }, { "name": "IOST", "symbol": "IOST", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/2405.png", }, { "name": "Delysium", "symbol": "AGI", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/24007.png", }, { "name": "Delysium", "symbol": "AGI", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/24007.png", }, { "name": "BORA", "symbol": "BORA", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/3801.png", }, { "name": "Taiko", "symbol": "TAIKO", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/31525.png", }, { "name": "Taiko", "symbol": "TAIKO", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/31525.png", }, { "name": "Adventure Gold", "symbol": "AGLD", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/11568.png", }, { "name": "Smooth Love Potion", "symbol": "SLP", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/5824.png", }, { "name": "SmarDex", "symbol": "SDEX", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/24203.png", }, { "name": "Across Protocol", "symbol": "ACX", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/22620.png", }, { "name": "JOE", "symbol": "JOE", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/11396.png", }, { "name": "Ergo", "symbol": "ERG", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/1762.png", }, { "name": "USDJ", "symbol": "USDJ", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/5446.png", }, { "name": "Landwolf 0x67", "symbol": "WOLF", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/30902.png", }, { "name": "ANyONe Protocol", "symbol": "ANYONE", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/32037.png", }, { "name": "MAGA (magamemecoin.com)", "symbol": "TRUMP", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/27872.png", }, { "name": "Ontology Gas", "symbol": "ONG", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/3217.png", }, { "name": "Toshi", "symbol": "TOSHI", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/27750.png", }, { "name": "STP", "symbol": "STPT", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/4006.png", }, { "name": "STP", "symbol": "STPT", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/4006.png", }, { "name": "BinaryX", "symbol": "BNX", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/23635.png", }, { "name": "Dent", "symbol": "DENT", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/1886.png", }, { "name": "Altura", "symbol": "ALU", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/9637.png", }, { "name": "Osaka Protocol", "symbol": "OSAK", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/27533.png", }, { "name": "Osaka Protocol", "symbol": "OSAK", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/27533.png", }, { "name": "Stratis [New]", "symbol": "STRAX", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/30168.png", }, { "name": "Bitkub Coin", "symbol": "KUB", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/16093.png", }, { "name": "Degen", "symbol": "DEGEN", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/30096.png", }, { "name": "Coin98", "symbol": "C98", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/10903.png", }, { "name": "Ozone Chain", "symbol": "OZO", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/28076.png", }, { "name": "Ozone Chain", "symbol": "OZO", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/28076.png", }, { "name": "Celer Network", "symbol": "CELR", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/3814.png", }, { "name": "Treasure", "symbol": "MAGIC", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/14783.png", }, { "name": "LOFI", "symbol": "LOFI", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/34187.png", }, { "name": "dKargo", "symbol": "DKA", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/5908.png", }, { "name": "Banana Gun", "symbol": "BANANA", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/28066.png", }, { "name": "Banana Gun", "symbol": "BANANA", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/28066.png", }, { "name": "Prom", "symbol": "PROM", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/4120.png", }, { "name": "API3", "symbol": "API3", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/7737.png", }, { "name": "Secret", "symbol": "SCRT", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/5604.png", }, { "name": "CARV", "symbol": "CARV", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/33372.png", }, { "name": "Nosana", "symbol": "NOS", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/16612.png", }, { "name": "Keep Network", "symbol": "KEEP", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/5566.png", }, { "name": "Oraichain", "symbol": "ORAI", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/7533.png", }, { "name": "Cartesi", "symbol": "CTSI", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/5444.png", }, { "name": "Synapse", "symbol": "SYN", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/12147.png", }, { "name": "Pundi X (New)", "symbol": "PUNDIX", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/9040.png", }, { "name": "Lift Dollar", "symbol": "USDL", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/32454.png", }, { "name": "NetMind Token", "symbol": "NMT", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/29447.png", }, { "name": "STASIS EURO", "symbol": "EURS", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/2989.png", }, { "name": "MVL", "symbol": "MVL", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/2982.png", }, { "name": "Omni Network", "symbol": "OMNI", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/30315.png", }, { "name": "Access Protocol", "symbol": "ACS", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/23195.png", }, { "name": "Seedify.fund", "symbol": "SFUND", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/8972.png", }, { "name": "Just a chill guy", "symbol": "CHILLGUY", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/34125.png", }, { "name": "Satoshi Airline", "symbol": "JET", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/32826.png", }, { "name": "Alephium", "symbol": "ALPH", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/14878.png", }, { "name": "Steem", "symbol": "STEEM", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/1230.png", }, { "name": "Velodrome Finance", "symbol": "VELO", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/20435.png", }, { "name": "Mode", "symbol": "MODE", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/31016.png", }, { "name": "Mode", "symbol": "MODE", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/31016.png", }, { "name": "Node AI", "symbol": "GPU", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/29513.png", }, { "name": "Node AI", "symbol": "GPU", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/29513.png", }, { "name": "Spell Token", "symbol": "SPELL", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/11289.png", }, { "name": "Portal", "symbol": "PORTAL", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/29555.png", }, { "name": "Orbs", "symbol": "ORBS", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/3835.png", }, { "name": "GameStop (gamestop-coin.vip)", "symbol": "GME", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/31248.png", }, { "name": "Arcblock", "symbol": "ABT", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/2545.png", }, { "name": "IAGON", "symbol": "IAG", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/11078.png", }, { "name": "Suilend", "symbol": "SEND", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/34611.png", }, { "name": "Alchemist AI", "symbol": "ALCH", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/34880.png", }, { "name": "Merlin Chain", "symbol": "MERL", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/30712.png", }, { "name": "HashAI", "symbol": "HASHAI", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/30369.png", }, { "name": "Numeraire", "symbol": "NMR", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/1732.png", }, { "name": "MiL.k", "symbol": "MLK", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/5266.png", }, { "name": "Ark", "symbol": "ARK", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/1586.png", }, { "name": "Autonolas", "symbol": "OLAS", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/28458.png", }, { "name": "Spectral", "symbol": "SPEC", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/32925.png", }, { "name": "Orchid", "symbol": "OXT", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/5026.png", }, { "name": "ORBIT", "symbol": "GRIFT", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/35090.png", }, { "name": "Vulcan Forged (PYR)", "symbol": "PYR", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/9308.png", }, { "name": "Kyber Network Crystal v2", "symbol": "KNC", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/9444.png", }, { "name": "Shentu", "symbol": "CTK", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/4807.png", }, { "name": "Realio Network", "symbol": "RIO", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/4166.png", }, { "name": "Coreum", "symbol": "COREUM", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/16399.png", }, { "name": "Cheems (cheems.pet)", "symbol": "CHEEMS", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/33280.png", }, { "name": "Moonriver", "symbol": "MOVR", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/9285.png", }, { "name": "Wise Monkey", "symbol": "MONKY", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/34610.png", }, { "name": "Oasys", "symbol": "OAS", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/22265.png", }, { "name": "WhiteRock", "symbol": "WHITE", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/34143.png", }, { "name": "Neutron", "symbol": "NTRN", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/26680.png", }, { "name": "MediBloc", "symbol": "MED", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/2303.png", }, { "name": "Dogelon Mars", "symbol": "ELON", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/9436.png", }, { "name": "Bone ShibaSwap", "symbol": "BONE", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/11865.png", }, { "name": "Symbol", "symbol": "XYM", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/8677.png", }, { "name": "Aurora", "symbol": "AURORA", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/14803.png", }, { "name": "TerraClassicUSD", "symbol": "USTC", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/7129.png", }, { "name": "Zircuit", "symbol": "ZRC", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/29711.png", }, { "name": "DODO", "symbol": "DODO", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/7224.png", }, { "name": "X Empire", "symbol": "X", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/33108.png", }, { "name": "Cyber", "symbol": "CYBER", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/24781.png", }, { "name": "Dusk", "symbol": "DUSK", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/4092.png", }, { "name": "Metal DAO", "symbol": "MTL", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/1788.png", }, { "name": "Lumia", "symbol": "LUMIA", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/33439.png", }, { "name": "Aragon", "symbol": "ANT", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/1680.png", }, { "name": "CUDOS", "symbol": "CUDOS", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/8258.png", }, { "name": "Propy", "symbol": "PRO", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/1974.png", }, { "name": "TrueFi", "symbol": "TRU", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/7725.png", }, { "name": "Mr Mint", "symbol": "MNT", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/32856.png", }, { "name": "NeuralAI", "symbol": "NEURAL", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/30528.png", }, { "name": "NeuralAI", "symbol": "NEURAL", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/30528.png", }, { "name": "GameBuild", "symbol": "GAME", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/31246.png", }, { "name": "ResearchCoin", "symbol": "RSC", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/27054.png", }, { "name": "Decentralized Social", "symbol": "DESO", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/10442.png", }, { "name": "Bounce Token", "symbol": "AUCTION", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/8602.png", }, { "name": "Highstreet", "symbol": "HIGH", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/11232.png", }, { "name": "WINkLink", "symbol": "WIN", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/4206.png", }, { "name": "Ardor", "symbol": "ARDR", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/1320.png", }, { "name": "Rootstock Infrastructure Framework", "symbol": "RIF", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/3701.png", }, { "name": "ApeX Protocol", "symbol": "APEX", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/19843.png", }, { "name": "Covalent X Token", "symbol": "CXT", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/32526.png", }, { "name": "Covalent X Token", "symbol": "CXT", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/32526.png", }, { "name": "THENA", "symbol": "THE", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/23335.png", }, { "name": "AI Companions", "symbol": "AIC", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/32968.png", }, { "name": "Tokenlon Network Token", "symbol": "LON", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/8083.png", }, { "name": "Acala Token", "symbol": "ACA", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/6756.png", }, { "name": "Braintrust", "symbol": "BTRST", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/11584.png", }, { "name": "NFPrompt", "symbol": "NFP", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/28778.png", }, { "name": "Hashflow", "symbol": "HFT", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/22461.png", }, { "name": "BitMart Token", "symbol": "BMX", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/2933.png", }, { "name": "Artificial Liquid Intelligence", "symbol": "ALI", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/16876.png", }, { "name": "Maple Finance", "symbol": "SYRUP", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/33824.png", }, { "name": "Catizen", "symbol": "CATI", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/32966.png", }, { "name": "ECOMI", "symbol": "OMI", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/19075.png", }, { "name": "SaucerSwap", "symbol": "SAUCE", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/21914.png", }, { "name": "Request", "symbol": "REQ", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/2071.png", }, { "name": "Bitcoin Wizards", "symbol": "WZRD", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/30491.png", }, { "name": "Assemble AI", "symbol": "ASM", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/6069.png", }, { "name": "Cobak Token", "symbol": "CBK", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/8107.png", }, { "name": "Maverick Protocol", "symbol": "MAV", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/18037.png", }, { "name": "Maverick Protocol", "symbol": "MAV", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/18037.png", }, { "name": "VaderAI by Virtuals", "symbol": "VADER", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/34648.png", }, { "name": "Pax Dollar", "symbol": "USDP", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/3330.png", }, { "name": "EURC", "symbol": "EURC", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/20641.png", }, { "name": "48 Club Token", "symbol": "KOGE", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/7184.png", }, { "name": "Stronghold Token", "symbol": "SHX", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/3661.png", }, { "name": "Steem Dollars", "symbol": "SBD", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/1312.png", }, { "name": "Solidus Ai Tech", "symbol": "AITECH", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/19055.png", }, { "name": "Victoria VR", "symbol": "VR", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/14822.png", }, { "name": "Hive AI", "symbol": "BUZZ", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/35188.png", }, { "name": "MetFi", "symbol": "METFI", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/24225.png", }, { "name": "Syscoin", "symbol": "SYS", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/541.png", }, { "name": "DAR Open Network", "symbol": "D", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/11374.png", }, { "name": "SuperRare", "symbol": "RARE", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/11294.png", }, { "name": "USDB", "symbol": "USDB", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/29599.png", }, { "name": "Hifi Finance", "symbol": "HIFI", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/23037.png", }, { "name": "Hifi Finance", "symbol": "HIFI", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/23037.png", }, { "name": "Paycoin", "symbol": "PCI", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/5275.png", }, { "name": "Fusionist", "symbol": "ACE", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/28674.png", }, { "name": "ArchLoot", "symbol": "AL", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/22765.png", }, { "name": "Badger DAO", "symbol": "BADGER", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/7859.png", }, { "name": "Nakamoto Games", "symbol": "NAKA", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/12749.png", }, { "name": "Coq Inu", "symbol": "COQ", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/28675.png", }, { "name": "DIA", "symbol": "DIA", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/6138.png", }, { "name": "Tokamak Network", "symbol": "TOKAMAK", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/6731.png", }, { "name": "sudeng", "symbol": "HIPPO", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/33258.png", }, { "name": "XION", "symbol": "XION", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/32089.png", }, { "name": "RETARDIO", "symbol": "RETARDIO", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/31921.png", }, { "name": "Eliza (elizawakesup)", "symbol": "ELIZA", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/34078.png", }, { "name": "LUKSO", "symbol": "LYX", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/27622.png", }, { "name": "Bancor", "symbol": "BNT", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/1727.png", }, { "name": "Bitget Wallet Token", "symbol": "BWB", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/31503.png", }, { "name": "Bitget Wallet Token", "symbol": "BWB", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/31503.png", }, { "name": "Hooked Protocol", "symbol": "HOOK", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/22764.png", }, { "name": "PaLM AI", "symbol": "PALM", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/28567.png", }, { "name": "PolySwarm", "symbol": "NCT", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/2630.png", }, { "name": "SLERF", "symbol": "SLERF", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/29920.png", }, { "name": "Aleph Zero", "symbol": "AZERO", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/11976.png", }, { "name": "QuarkChain", "symbol": "QKC", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/2840.png", }, { "name": "Shiro Neko", "symbol": "SHIRO", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/34378.png", }, { "name": "DeFi Pulse Index", "symbol": "DPI", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/7055.png", }, { "name": "Stargate Finance", "symbol": "STG", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/18934.png", }, { "name": "SUNDOG", "symbol": "SUNDOG", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/32717.png", }, { "name": "MyNeighborAlice", "symbol": "ALICE", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/8766.png", }, { "name": "RSS3", "symbol": "RSS3", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/17917.png", }, { "name": "Loom Network", "symbol": "LOOM", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/2588.png", }, { "name": "Gearbox Protocol", "symbol": "GEAR", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/16360.png", }, { "name": "Automata Network", "symbol": "ATA", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/10188.png", }, { "name": "Origin Protocol", "symbol": "OGN", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/5117.png", }, { "name": "Top Hat", "symbol": "HAT", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/35075.png", }, { "name": "BENQI", "symbol": "QI", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/9288.png", }, { "name": "Ampleforth Governance Token", "symbol": "FORTH", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/9421.png", }, { "name": "Puffer", "symbol": "PUFFER", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/32325.png", }, { "name": "Phoenix", "symbol": "PHB", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/13969.png", }, { "name": "StormX", "symbol": "STMX", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/2297.png", }, { "name": "Shadow Token", "symbol": "SHDW", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/16868.png", }, { "name": "MOBOX", "symbol": "MBOX", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/9175.png", }, { "name": "ORA", "symbol": "ORA", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/34165.png", }, { "name": "Ancient8", "symbol": "A8", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/18734.png", }, { "name": "MobileCoin", "symbol": "MOB", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/7878.png", }, { "name": "LimeWire", "symbol": "LMWR", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/24476.png", }, { "name": "USDX [Kava]", "symbol": "USDX", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/6651.png", }, { "name": "Hippocrat", "symbol": "HPO", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/3600.png", }, { "name": "Euler", "symbol": "EUL", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/14280.png", }, { "name": "RACA", "symbol": "RACA", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/11346.png", }, { "name": "Helium Mobile", "symbol": "MOBILE", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/24600.png", }, { "name": "BakeryToken", "symbol": "BAKE", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/7064.png", }, { "name": "Verum Coin", "symbol": "VERUM", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/30915.png", }, { "name": "inSure DeFi", "symbol": "SURE", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/5113.png", }, { "name": "Staika", "symbol": "STIK", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/23951.png", }, { "name": "ARPA", "symbol": "ARPA", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/4039.png", }, { "name": "PARSIQ", "symbol": "PRQ", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/5410.png", }, { "name": "NYM", "symbol": "NYM", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/17591.png", }, { "name": "yesnoerror", "symbol": "YNE", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/34854.png", }, { "name": "CLV", "symbol": "CLV", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/8384.png", }, { "name": "lisUSD", "symbol": "lisUSD", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/21330.png", }, { "name": "NKN", "symbol": "NKN", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/2780.png", }, { "name": "dForce", "symbol": "DF", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/4758.png", }, { "name": "Stella", "symbol": "ALPHA", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/7232.png", }, { "name": "MESSIER", "symbol": "M87", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/20561.png", }, { "name": "Kekius Maximus (kekiusmaximus.vip)", "symbol": "KEKIUS", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/35011.png", }, { "name": "Kekius Maximus (kekiusmaximus.vip)", "symbol": "KEKIUS", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/35011.png", }, { "name": "Alien Worlds", "symbol": "TLM", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/9119.png", }, { "name": "Comedian", "symbol": "BAN", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/33881.png", }, { "name": "Strike", "symbol": "STRK", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/8911.png", }, { "name": "Ethena Labs (USDTb)", "symbol": "USDTb", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/34691.png", }, { "name": "Minswap", "symbol": "MIN", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/12787.png", }, { "name": "Stader", "symbol": "SD", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/12623.png", }, { "name": "Pups (Bitcoin)", "symbol": "PUPS", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/33320.png", }, { "name": "Reploy", "symbol": "RAI", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/34591.png", }, { "name": "Renzo", "symbol": "REZ", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/30843.png", }, { "name": "Toko Token", "symbol": "TKO", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/9020.png", }, { "name": "Radiant Capital", "symbol": "RDNT", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/21106.png", }, { "name": "Kujira", "symbol": "KUJI", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/15185.png", }, { "name": "Telos", "symbol": "TLOS", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/4660.png", }, { "name": "XPLA", "symbol": "XPLA", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/22359.png", }, { "name": "CoinEx Token", "symbol": "CET", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/2941.png", }, { "name": "H2O DAO", "symbol": "H2O", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/19091.png", }, { "name": "Radworks", "symbol": "RAD", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/6843.png", }, { "name": "MovieBloc", "symbol": "MBL", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/4038.png", }, { "name": "michi (SOL)", "symbol": "$MICHI", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/30943.png", }, { "name": "Islamic Coin", "symbol": "ISLM", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/26220.png", }, { "name": "SIGMA", "symbol": "SIGMA", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/32498.png", }, { "name": "GEODNET", "symbol": "GEOD", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/20969.png", }, { "name": "Spore", "symbol": "SPORE", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/9468.png", }, { "name": "Gods Unchained", "symbol": "GODS", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/10631.png", }, { "name": "Patriot", "symbol": "PATRIOT", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/33786.png", }, { "name": "Lista DAO", "symbol": "LISTA", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/21533.png", }, { "name": "Lista DAO", "symbol": "LISTA", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/21533.png", }, { "name": "Koma Inu", "symbol": "KOMA", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/33405.png", }, { "name": "LeverFi", "symbol": "LEVER", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/20873.png", }, { "name": "OX Coin", "symbol": "OX", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/29530.png", }, { "name": "OX Coin", "symbol": "OX", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/29530.png", }, { "name": "Parcl", "symbol": "PRCL", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/30661.png", }, { "name": "AVA (Travala)", "symbol": "AVA", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/2776.png", }, { "name": "AI Analysis Token", "symbol": "AIAT", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/28688.png", }, { "name": "KARRAT", "symbol": "KARRAT", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/30825.png", }, { "name": "Metadium", "symbol": "META", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/3418.png", }, { "name": "Magaverse", "symbol": "MVRS", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/34765.png", }, { "name": "Stonks", "symbol": "STNK", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/10332.png", }, { "name": "MARBLEX", "symbol": "MBX", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/18895.png", }, { "name": "Zebec Network", "symbol": "ZBCN", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/30636.png", }, { "name": "Dasha", "symbol": "VVAIFU", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/34025.png", }, { "name": "Dasha", "symbol": "VVAIFU", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/34025.png", }, { "name": "Alkimi", "symbol": "ADS", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/11036.png", }, { "name": "BOBO", "symbol": "BOBO", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/25269.png", }, { "name": "BUSD", "symbol": "BUSD", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/4687.png", }, { "name": "Venus BUSD", "symbol": "vBUSD", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/7959.png", }, { "name": "DAO Maker", "symbol": "DAO", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/8420.png", }, { "name": "Gifto", "symbol": "GFT", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/2289.png", }, { "name": "Cortex", "symbol": "CTXC", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/2638.png", }, { "name": "Gitcoin", "symbol": "GTC", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/10052.png", }, { "name": "Wen", "symbol": "WEN", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/29175.png", }, { "name": "Aergo", "symbol": "AERGO", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/3637.png", }, { "name": "Pundi AI", "symbol": "FX", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/3884.png", }, { "name": "Liquity USD", "symbol": "LUSD", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/9566.png", }, { "name": "Litentry", "symbol": "LIT", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/6833.png", }, { "name": "Wojak", "symbol": "WOJAK", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/24502.png", }, { "name": "Wojak", "symbol": "WOJAK", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/24502.png", }, { "name": "Cakepie", "symbol": "CKP", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/28948.png", }, { "name": "Bifrost", "symbol": "BFC", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/7817.png", }, { "name": "WUFFI", "symbol": "WUF", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/30683.png", }, { "name": "Gemini Dollar", "symbol": "GUSD", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/3306.png", }, { "name": "LTO Network", "symbol": "LTO", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/3714.png", }, { "name": "PlatON", "symbol": "LAT", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/9720.png", }, { "name": "Ethernity Chain", "symbol": "ERN", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/8615.png", }, { "name": "Masa", "symbol": "MASA", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/29547.png", }, { "name": "Maple", "symbol": "MPL", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/9417.png", }, { "name": "Orderly Network", "symbol": "ORDER", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/32809.png", }, { "name": "Anchored Coins AEUR", "symbol": "AEUR", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/28596.png", }, { "name": "REI Network", "symbol": "REI", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/19819.png", }, { "name": "ChainSwap", "symbol": "CSWAP", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/29780.png", }, { "name": "Sweat Economy", "symbol": "SWEAT", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/21351.png", }, { "name": "Myro", "symbol": "MYRO", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/28382.png", }, { "name": "Alpha Quark Token", "symbol": "AQT", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/7460.png", }, { "name": "tokenbot", "symbol": "CLANKER", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/34285.png", }, { "name": "GATSBY (gatsby.fi)", "symbol": "GATSBY", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/34473.png", }, { "name": "Myria", "symbol": "MYRIA", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/22289.png", }, { "name": "RARI", "symbol": "RARI", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/5877.png", }, { "name": "Open Loot", "symbol": "OL", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/34034.png", }, { "name": "Open Loot", "symbol": "OL", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/34034.png", }, { "name": "NAVI Protocol", "symbol": "NAVX", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/29296.png", }, { "name": "Forta", "symbol": "FORT", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/20622.png", }, { "name": "SynFutures", "symbol": "F", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/34297.png", }, { "name": "Star Atlas", "symbol": "ATLAS", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/11212.png", }, { "name": "Mr Miggles", "symbol": "MIGGLES", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/32289.png", }, { "name": "Unizen", "symbol": "ZCX", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/9263.png", }, { "name": "MOO DENG (moodeng.vip)", "symbol": "MOODENG", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/33076.png", }, { "name": "Super Champs", "symbol": "CHAMP", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/34126.png", }, { "name": "aixCB by Virtuals", "symbol": "AIXCB", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/34552.png", }, { "name": "aixCB by Virtuals", "symbol": "AIXCB", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/34552.png", }, { "name": "TokenFi", "symbol": "TOKEN", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/28299.png", }, { "name": "SOVRUN", "symbol": "SOVRN", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/19722.png", }, { "name": "Andy BSC", "symbol": "ANDY", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/35085.png", }, { "name": "Gains Network", "symbol": "GNS", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/13663.png", }, { "name": "Gains Network", "symbol": "GNS", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/13663.png", }, { "name": "Dego Finance", "symbol": "DEGO", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/7087.png", }, { "name": "Tensor", "symbol": "TNSR", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/30449.png", }, { "name": "Swell Network", "symbol": "SWELL", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/24924.png", }, { "name": "McDull", "symbol": "MCDULL", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/32866.png", }, { "name": "Uquid Coin", "symbol": "UQC", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/2273.png", }, { "name": "Electroneum", "symbol": "ETN", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/2137.png", }, { "name": "ViciCoin", "symbol": "VCNT", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/28656.png", }, { "name": "xMoney", "symbol": "UTK", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/2320.png", }, { "name": "Milady Meme Coin", "symbol": "LADYS", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/25023.png", }, { "name": "Milady Meme Coin", "symbol": "LADYS", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/25023.png", }, { "name": "Odos", "symbol": "ODOS", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/34807.png", }, { "name": "Aavegotchi", "symbol": "GHST", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/7046.png", }, { "name": "OMG Network", "symbol": "OMG", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/1808.png", }, { "name": "LooksRare", "symbol": "LOOKS", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/17081.png", }, { "name": "Enzyme", "symbol": "MLN", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/1552.png", }, { "name": "MAP Protocol", "symbol": "MAPO", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/4956.png", }, { "name": "Magpie", "symbol": "MGP", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/22391.png", }, { "name": "Pocket Network", "symbol": "POKT", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/11823.png", }, { "name": "BugsCoin", "symbol": "BGSC", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/34830.png", }, { "name": "Hunt Town", "symbol": "HUNT", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/5380.png", }, { "name": "DEAPcoin", "symbol": "DEP", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/5429.png", }, { "name": "Moss Coin", "symbol": "MOC", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/2915.png", }, { "name": "FUNToken", "symbol": "FUN", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/1757.png", }, { "name": "Entangle", "symbol": "NGL", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/29709.png", }, { "name": "Elastos", "symbol": "ELA", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/2492.png", }, { "name": "Perpetual Protocol", "symbol": "PERP", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/6950.png", }, { "name": "FirmaChain", "symbol": "FCT", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/4953.png", }, { "name": "Aimonica Brands", "symbol": "AIMONICA", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/34590.png", }, { "name": "Streamr", "symbol": "DATA", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/2143.png", }, { "name": "SwarmNode.ai", "symbol": "SNAI", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/35064.png", }, { "name": "Hacken Token", "symbol": "HAI", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/5583.png", }, { "name": "IDEX", "symbol": "IDEX", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/3928.png", }, { "name": "Rekt (rektcoin.com)", "symbol": "REKT", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/34434.png", }, { "name": "district0x", "symbol": "DNT", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/1856.png", }, { "name": "ThunderCore", "symbol": "TT", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/3930.png", }, { "name": "Purple Pepe", "symbol": "$PURPE", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/32171.png", }, { "name": "ALEX Lab", "symbol": "ALEX", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/22074.png", }, { "name": "Solend", "symbol": "SLND", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/13524.png", }, { "name": "Solend", "symbol": "SLND", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/13524.png", }, { "name": "Groestlcoin", "symbol": "GRS", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/258.png", }, { "name": "Chainbounty", "symbol": "BOUNTY", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/2866.png", }, { "name": "Stride", "symbol": "STRD", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/21781.png", }, { "name": "APX", "symbol": "APX", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/16334.png", }, { "name": "Degen Spartan AI", "symbol": "DEGENAI", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/34994.png", }, { "name": "Alchemix", "symbol": "ALCX", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/8613.png", }, { "name": "Ice Open Network", "symbol": "ICE", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/27650.png", }, { "name": "Gelato", "symbol": "GEL", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/7229.png", }, { "name": "Dione Protocol", "symbol": "DIONE", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/21473.png", }, { "name": "Flamingo", "symbol": "FLM", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/7150.png", }, { "name": "MAGA (maga-hat.vip)", "symbol": "MAGA", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/31305.png", }, { "name": "Pepe Unchained", "symbol": "PEPU", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/34448.png", }, { "name": "HOSKY Token", "symbol": "HOSKY", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/16755.png", }, { "name": "Tokemak", "symbol": "TOKE", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/11202.png", }, { "name": "Artrade", "symbol": "ATR", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/19131.png", }, { "name": "Wanchain", "symbol": "WAN", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/2606.png", }, { "name": "Quantum Resistant Ledger", "symbol": "QRL", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/1712.png", }, { "name": "GamerCoin", "symbol": "GHX", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/6554.png", }, { "name": "GamerCoin", "symbol": "GHX", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/6554.png", }, { "name": "Verasity", "symbol": "VRA", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/3816.png", }, { "name": "ArbDoge AI", "symbol": "AIDOGE", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/24477.png", }, { "name": "Whiteheart", "symbol": "WHITE", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/8120.png", }, { "name": "Crown by Third Time Games", "symbol": "CROWN", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/25714.png", }, { "name": "Tornado Cash", "symbol": "TORN", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/8049.png", }, { "name": "StaFi", "symbol": "FIS", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/5882.png", }, { "name": "Polkastarter", "symbol": "POLS", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/7208.png", }, { "name": "SIDUS", "symbol": "SIDUS", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/15463.png", }, { "name": "Goldfinch", "symbol": "GFI", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/13967.png", }, { "name": "Venom", "symbol": "VENOM", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/22059.png", }, { "name": "Komodo", "symbol": "KMD", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/1521.png", }, { "name": "Bella Protocol", "symbol": "BEL", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/6928.png", }, { "name": "A3S Protocol", "symbol": "AA", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/25354.png", }, { "name": "WHY", "symbol": "WHY", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/30867.png", }, { "name": "XSGD", "symbol": "XSGD", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/8489.png", }, { "name": "Bitgert", "symbol": "BRISE", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/11079.png", }, { "name": "NULS", "symbol": "NULS", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/2092.png", }, { "name": "Star Atlas DAO", "symbol": "POLIS", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/11213.png", }, { "name": "Neiro Ethereum", "symbol": "NEIRO", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/32461.png", }, { "name": "OORT", "symbol": "OORT", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/29331.png", }, { "name": "DIMO", "symbol": "DIMO", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/22837.png", }, { "name": "Dimitra", "symbol": "DMTR", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/12041.png", }, { "name": "AhaToken", "symbol": "AHT", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/6641.png", }, { "name": "Sentio Protocol", "symbol": "SEN", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/34916.png", }, { "name": "Energy Web Token", "symbol": "EWT", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/5268.png", }, { "name": "Pirate Chain", "symbol": "ARRR", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/3951.png", }, { "name": "Major Frog", "symbol": "MAJOR", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/34041.png", }, { "name": "Major Frog", "symbol": "MAJOR", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/34041.png", }, { "name": "The Root Network", "symbol": "ROOT", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/28479.png", }, { "name": "Green Satoshi Token (SOL)", "symbol": "GST", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/16352.png", }, { "name": "neur.sh", "symbol": "NEUR", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/35073.png", }, { "name": "ZEON", "symbol": "ZEON", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/3795.png", }, { "name": "Mumu the Bull (SOL)", "symbol": "MUMU", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/30285.png", }, { "name": "Beta Finance", "symbol": "BETA", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/11307.png", }, { "name": "Metacraft", "symbol": "MCT", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/16946.png", }, { "name": "Axol", "symbol": "AXOL", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/33183.png", }, { "name": "MemeFi", "symbol": "MEMEFI", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/33464.png", }, { "name": "XPR Network", "symbol": "XPR", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/5350.png", }, { "name": "Concordium", "symbol": "CCD", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/18031.png", }, { "name": "Concordium", "symbol": "CCD", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/18031.png", }, { "name": "KIKICat", "symbol": "KIKI", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/34888.png", }, { "name": "Gems", "symbol": "GEMS", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/31750.png", }, { "name": "League of Kingdoms Arena", "symbol": "LOKA", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/17145.png", }, { "name": "Tranchess", "symbol": "CHESS", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/10974.png", }, { "name": "MANEKI", "symbol": "MANEKI", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/30912.png", }, { "name": "Sui Name Service", "symbol": "NS", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/32942.png", }, { "name": "Major", "symbol": "MAJOR", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/33188.png", }, { "name": "Biswap", "symbol": "BSW", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/10746.png", }, { "name": "Shoggoth (shoggoth.monster)", "symbol": "SHOGGOTH", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/33595.png", }, { "name": "Houdini Swap", "symbol": "LOCK", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/23396.png", }, { "name": "Metacade", "symbol": "MCADE", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/24303.png", }, { "name": "GameFi.org", "symbol": "GAFI", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/11783.png", }, { "name": "Contentos", "symbol": "COS", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/4036.png", }, { "name": "ORIGYN", "symbol": "OGY", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/17960.png", }, { "name": "Tether EURt", "symbol": "EURt", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/10789.png", }, { "name": "Hoppy", "symbol": "HOPPY", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/30859.png", }, { "name": "Viction", "symbol": "VIC", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/2570.png", }, { "name": "Daddy Tate", "symbol": "DADDY", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/31830.png", }, { "name": "Skey Network", "symbol": "SKEY", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/8133.png", }, { "name": "Dora Factory", "symbol": "DORA", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/27966.png", }, { "name": "BIM", "symbol": "BIM", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/24877.png", }, { "name": "Voxies", "symbol": "VOXEL", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/15678.png", }, { "name": "Tectum", "symbol": "TET", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/21964.png", }, { "name": "DEXTools", "symbol": "DEXT", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/5866.png", }, { "name": "Impossible Finance Launchpad", "symbol": "IDIA", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/10933.png", }, { "name": "Propchain", "symbol": "PROPC", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/24220.png", }, { "name": "Celo Dollar", "symbol": "CUSD", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/7236.png", }, { "name": "ELYSIA", "symbol": "EL", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/5382.png", }, { "name": "TAOCat by Virtuals & Masa", "symbol": "TAOCAT", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/34848.png", }, { "name": "Measurable Data Token", "symbol": "MDT", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/2348.png", }, { "name": "MCOIN", "symbol": "MCOIN", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/23046.png", }, { "name": "MCOIN", "symbol": "MCOIN", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/23046.png", }, { "name": "Numbers Protocol", "symbol": "NUM", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/13521.png", }, { "name": "Numbers Protocol", "symbol": "NUM", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/13521.png", }, { "name": "Linear Finance", "symbol": "LINA", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/7102.png", }, { "name": "My Lovely Planet", "symbol": "MLC", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/32035.png", }, { "name": "Shuffle", "symbol": "SHFL", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/29960.png", }, { "name": "RichQUACK.com", "symbol": "QUACK", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/10641.png", }, { "name": "Large Language Model", "symbol": "LLM", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/35130.png", }, { "name": "Ampleforth", "symbol": "AMPL", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/4056.png", }, { "name": "Kishu Inu", "symbol": "KISHU", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/9386.png", }, { "name": "Boba Network", "symbol": "BOBA", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/14556.png", }, { "name": "Pikaboss", "symbol": "PIKA", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/26532.png", }, { "name": "Pikaboss", "symbol": "PIKA", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/26532.png", }, { "name": "Ultra", "symbol": "UOS", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/4189.png", }, { "name": "deBridge", "symbol": "DBR", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/31528.png", }, { "name": "deBridge", "symbol": "DBR", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/31528.png", }, { "name": "BILLION•DOLLAR•CAT", "symbol": "BDC", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/31668.png", }, { "name": "Strawberry AI", "symbol": "BERRY", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/32915.png", }, { "name": "Shrub", "symbol": "SHRUB", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/31979.png", }, { "name": "Everscale", "symbol": "EVER", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/7505.png", }, { "name": "Everscale", "symbol": "EVER", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/7505.png", }, { "name": "Boson Protocol", "symbol": "BOSON", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/8827.png", }, { "name": "Eurite", "symbol": "EURI", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/32644.png", }, { "name": "Ribbon Finance", "symbol": "RBN", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/12387.png", }, { "name": "Botto", "symbol": "BOTTO", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/14345.png", }, { "name": "Vertex Protocol", "symbol": "VRTX", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/22355.png", }, { "name": "PeiPei (ETH)", "symbol": "PEIPEI", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/31632.png", }, { "name": "RAMP", "symbol": "RAMP", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/7463.png", }, { "name": "FOMO (fomo.fund)", "symbol": "FOMO", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/34754.png", }, { "name": "Genopets", "symbol": "GENE", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/13632.png", }, { "name": "Genopets", "symbol": "GENE", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/13632.png", }, { "name": "Grok", "symbol": "GROK", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/28394.png", }, { "name": "PAID", "symbol": "PAID", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/8329.png", }, { "name": "Pirate Nation", "symbol": "PIRATE", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/31704.png", }, { "name": "OctaSpace", "symbol": "OCTA", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/24261.png", }, { "name": "QuickSwap [Old]", "symbol": "QUICK", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/8206.png", }, { "name": "Zero1 Labs", "symbol": "DEAI", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/29734.png", }, { "name": "TokenPocket", "symbol": "TPT", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/5947.png", }, { "name": "Klever Coin", "symbol": "KLV", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/6724.png", }, { "name": "SPECTRE AI", "symbol": "SPECTRE", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/28446.png", }, { "name": "Quickswap [New]", "symbol": "QUICK", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/19966.png", }, { "name": "Kin", "symbol": "KIN", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/1993.png", }, { "name": "Vara Network", "symbol": "VARA", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/28067.png", }, { "name": "Vara Network", "symbol": "VARA", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/28067.png", }, { "name": "Heroes of Mavia", "symbol": "MAVIA", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/28829.png", }, { "name": "Wirex Token", "symbol": "WXT", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/4090.png", }, { "name": "Global Dollar", "symbol": "USDG", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/33793.png", }, { "name": "StorX Network", "symbol": "SRX", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/10894.png", }, { "name": "Harvest Finance", "symbol": "FARM", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/6859.png", }, { "name": "FIO Protocol", "symbol": "FIO", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/5865.png", }, { "name": "Bluefin", "symbol": "BLUE", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/8724.png", }, { "name": "Amaterasu Omikami", "symbol": "OMIKAMI", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/28147.png", }, { "name": "Aleph.im", "symbol": "ALEPH", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/5821.png", }, { "name": "Baby Shark Meme", "symbol": "BABYSHARK", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/35048.png", }, { "name": "Baby Shark Meme", "symbol": "BABYSHARK", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/35048.png", }, { "name": "Persistence One", "symbol": "XPRT", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/7281.png", }, { "name": "cheqd", "symbol": "CHEQ", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/12256.png", }, { "name": "PepeFork", "symbol": "PORK", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/29220.png", }, { "name": "COMBO", "symbol": "COMBO", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/4275.png", }, { "name": "Banana For Scale", "symbol": "BANANAS31", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/34118.png", }, { "name": "Hathor", "symbol": "HTR", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/5552.png", }, { "name": "Inverse Finance", "symbol": "INV", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/8720.png", }, { "name": "Ren", "symbol": "REN", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/2539.png", }, { "name": "REVOX", "symbol": "REX", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/34600.png", }, { "name": "Step Finance", "symbol": "STEP", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/9443.png", }, { "name": "GT Protocol", "symbol": "GTAI", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/16711.png", }, { "name": "Mother Iggy", "symbol": "MOTHER", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/31510.png", }, { "name": "Mother Iggy", "symbol": "MOTHER", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/31510.png", }, { "name": "Ethervista", "symbol": "VISTA", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/32943.png", }, { "name": "Bertram The Pomeranian", "symbol": "BERT", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/33854.png", }, { "name": "TROY", "symbol": "TROY", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/5007.png", }, { "name": "Quidax Token", "symbol": "QDX", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/10079.png", }, { "name": "AdEx", "symbol": "ADX", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/1768.png", }, { "name": "Reserve Dollar", "symbol": "RSV", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/6727.png", }, { "name": "Cornucopias", "symbol": "COPI", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/15563.png", }, { "name": "Doge Killer", "symbol": "LEASH", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/9286.png", }, { "name": "zkLink", "symbol": "ZKL", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/13039.png", }, { "name": "LUCE", "symbol": "LUCE", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/33694.png", }, { "name": "ARC", "symbol": "ARC", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/13051.png", }, { "name": "METAVERSE", "symbol": "METAV", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/35007.png", }, { "name": "METAVERSE", "symbol": "METAV", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/35007.png", }, { "name": "HOPR", "symbol": "HOPR", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/6520.png", }, { "name": "HOPR", "symbol": "HOPR", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/6520.png", }, { "name": "Pino", "symbol": "PINO", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/33656.png", }, { "name": "Firo", "symbol": "FIRO", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/1414.png", }, { "name": "crow with knife", "symbol": "CAW", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/30402.png", }, { "name": "HyperGPT", "symbol": "HGPT", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/25419.png", }, { "name": "Law Blocks (AI)", "symbol": "LBT", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/20964.png", }, { "name": "Prosper", "symbol": "PROS", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/8255.png", }, { "name": "Memes AI", "symbol": "MemesAI", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/33614.png", }, { "name": "Opulous", "symbol": "OPUL", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/10409.png", }, { "name": "RabBitcoin", "symbol": "RBTC", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/32754.png", }, { "name": "Games for a Living", "symbol": "GFAL", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/23397.png", }, { "name": "Agoras: Tau Net", "symbol": "AGRS", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/1037.png", }, { "name": "Electronic USD", "symbol": "eUSD", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/22933.png", }, { "name": "LayerAI", "symbol": "LAI", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/23846.png", }, { "name": "MATH", "symbol": "MATH", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/5616.png", }, { "name": "UniLend", "symbol": "UFT", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/7412.png", }, { "name": "Wing Finance", "symbol": "WING", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/7048.png", }, { "name": "Cook Finance", "symbol": "COOK", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/8997.png", }, { "name": "SwftCoin", "symbol": "SWFTC", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/2341.png", }, { "name": "Self Chain", "symbol": "SLF", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/32854.png", }, { "name": "Oho", "symbol": "OHO", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/22264.png", }, { "name": "dog with apple in mouth", "symbol": "APPLE", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/31391.png", }, { "name": "ROGin AI", "symbol": "ROG", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/20490.png", }, { "name": "CEEK VR", "symbol": "CEEK", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/2856.png", }, { "name": "AstraAI", "symbol": "ASTRA", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/29593.png", }, { "name": "HyperCycle", "symbol": "HYPC", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/24698.png", }, { "name": "Propbase", "symbol": "PROPS", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/28385.png", }, { "name": "Vita Inu", "symbol": "VINU", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/15270.png", }, { "name": "Locus Chain", "symbol": "LOCUS", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/3855.png", }, { "name": "Bluzelle", "symbol": "BLZ", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/2505.png", }, { "name": "Bluzelle", "symbol": "BLZ", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/2505.png", }, { "name": "Suku", "symbol": "SUKU", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/6180.png", }, { "name": "Numogram", "symbol": "GNON", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/33570.png", }, { "name": "Hege", "symbol": "HEGE", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/31044.png", }, { "name": "Hege", "symbol": "HEGE", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/31044.png", }, { "name": "Beefy", "symbol": "BIFI", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/7311.png", }, { "name": "Moon Tropica", "symbol": "CAH", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/26032.png", }, { "name": "Moon Tropica", "symbol": "CAH", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/26032.png", }, { "name": "Isiklar Coin", "symbol": "ISIKC", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/5468.png", }, { "name": "BurgerCities", "symbol": "BURGER", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/7158.png", }, { "name": "ZTX", "symbol": "ZTX", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/28249.png", }, { "name": "PIVX", "symbol": "PIVX", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/1169.png", }, { "name": "StrikeX", "symbol": "STRX", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/9220.png", }, { "name": "Adshares", "symbol": "ADS", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/1883.png", }, { "name": "BFG Token", "symbol": "BFG", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/11038.png", }, { "name": "Samoyedcoin", "symbol": "SAMO", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/9721.png", }, { "name": "NEOPIN", "symbol": "NPT", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/18966.png", }, { "name": "Taraxa", "symbol": "TARA", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/8715.png", }, { "name": "First Convicted Raccon Fred", "symbol": "FRED", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/33999.png", }, { "name": "PlayDapp", "symbol": "PDA", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/7461.png", }, { "name": "Evan", "symbol": "EVAN", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/34166.png", }, { "name": "zKML", "symbol": "ZKML", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/29445.png", }, { "name": "MAD", "symbol": "MAD", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/32103.png", }, { "name": "OmniFlix Network", "symbol": "FLIX", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/24645.png", }, { "name": "Newton", "symbol": "NEW", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/3871.png", }, { "name": "VAIOT", "symbol": "VAI", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/8479.png", }, { "name": "FractonX", "symbol": "FT", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/21356.png", }, { "name": "Alpaca Finance", "symbol": "ALPACA", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/8707.png", }, { "name": "Synternet", "symbol": "SYNT", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/32108.png", }, { "name": "Velas", "symbol": "VLX", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/4747.png", }, { "name": "Aura Finance", "symbol": "AURA", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/21532.png", }, { "name": "Aura Finance", "symbol": "AURA", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/21532.png", }, { "name": "Connex", "symbol": "CONX", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/28135.png", }, { "name": "Pixer Eternity", "symbol": "PXT", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/24346.png", }, { "name": "VIDT DAO", "symbol": "VIDT", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/22710.png", }, { "name": "Vector Smart Gas", "symbol": "VSG", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/29350.png", }, { "name": "AirDAO", "symbol": "AMB", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/2081.png", }, { "name": "Bitcoin Atom", "symbol": "BCA", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/2387.png", }, { "name": "Urolithin A", "symbol": "URO", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/34090.png", }, { "name": "Nexera", "symbol": "NXRA", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/23825.png", }, { "name": "Opus", "symbol": "OPUS", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/35052.png", }, { "name": "MetaMUI", "symbol": "MMUI", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/11223.png", }, { "name": "Basenji", "symbol": "BENJI", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/30193.png", }, { "name": "Sperax", "symbol": "SPA", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/6715.png", }, { "name": "SIX", "symbol": "SIX", "image_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/3327.png", }, } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/daos/agent_chain_fee.go ================================================ package daos import ( "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/jinzhu/gorm" ) func (d *DAO) FirstAgentChainFeeByID(tx *gorm.DB, id uint, preloads map[string][]interface{}, forUpdate bool) (*models.AgentChainFee, error) { var m models.AgentChainFee if err := d.first(tx, &m, map[string][]interface{}{"id = ?": []interface{}{id}}, preloads, nil, forUpdate); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FirstAgentChainFee(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string) (*models.AgentChainFee, error) { var m models.AgentChainFee if err := d.first(tx, &m, filters, preloads, orders, false); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FindAgentChainFee(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, offset int, limit int) ([]*models.AgentChainFee, error) { var ms []*models.AgentChainFee if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, err } return ms, nil } func (d *DAO) FindAgentChainFee4Page(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.AgentChainFee, uint, error) { var ( offset = (page - 1) * limit ) var ms []*models.AgentChainFee if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, 0, errs.NewError(err) } c, err := d.count(tx, &models.AgentChainFee{}, filters) if err != nil { return nil, 0, errs.NewError(err) } return ms, c, nil } func (d *DAO) FindAgentChainFeeJoinSelect(tx *gorm.DB, selected []string, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.AgentChainFee, error) { var ms []*models.AgentChainFee err := d.findJoinSelect(tx, &models.AgentChainFee{}, &ms, selected, joins, filters, preloads, orders, uint(page), uint(limit), false) if err != nil { return nil, errs.NewError(err) } return ms, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/daos/agent_dao.go ================================================ package daos import ( "strconv" "strings" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/jinzhu/gorm" ) // //// func (d *DAO) FindTwitterInfo(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, offset int, limit int) ([]*models.TwitterInfo, error) { var ms []*models.TwitterInfo if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, err } return ms, nil } func (d *DAO) FirstTwitterInfoByID(tx *gorm.DB, id uint, preloads map[string][]interface{}, forUpdate bool) (*models.TwitterInfo, error) { var m models.TwitterInfo if err := d.first(tx, &m, map[string][]interface{}{"id = ?": []interface{}{id}}, preloads, nil, forUpdate); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FirstTwitterInfo(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, forUpdate bool) (*models.TwitterInfo, error) { var m models.TwitterInfo if err := d.first(tx, &m, filters, preloads, nil, forUpdate); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FirstUserTwitterPost(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string) (*models.UserTwitterPost, error) { var m models.UserTwitterPost if err := d.first(tx, &m, filters, preloads, orders, false); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FindUserTwitterPost(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, offset int, limit int) ([]*models.UserTwitterPost, error) { var ms []*models.UserTwitterPost if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, err } return ms, nil } func (d *DAO) FindAgentTokenJoinSelect(tx *gorm.DB, selected []string, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.AgentTokenInfo, error) { var ms []*models.AgentTokenInfo err := d.findJoinSelect(tx, &models.AgentTokenInfo{}, &ms, selected, joins, filters, preloads, orders, uint(page), uint(limit), false) if err != nil { return nil, errs.NewError(err) } return ms, nil } func (d *DAO) FirstAgentToken(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string) (*models.AgentTokenInfo, error) { var m models.AgentTokenInfo if err := d.first(tx, &m, filters, preloads, orders, false); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FirstAgentTokenByID(tx *gorm.DB, id uint, preloads map[string][]interface{}, forUpdate bool) (*models.AgentTokenInfo, error) { var m models.AgentTokenInfo if err := d.first(tx, &m, map[string][]interface{}{"id = ?": []interface{}{id}}, preloads, nil, forUpdate); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FirstAgentTradeHistoryByID(tx *gorm.DB, id uint, preloads map[string][]interface{}, forUpdate bool) (*models.AgentTradeHistory, error) { var m models.AgentTradeHistory if err := d.first(tx, &m, map[string][]interface{}{"id = ?": []interface{}{id}}, preloads, nil, forUpdate); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FirstAgentTradeHistory(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, order []string) (*models.AgentTradeHistory, error) { var m models.AgentTradeHistory if err := d.first(tx, &m, filters, preloads, order, false); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) GetAgentTradeHistoryInfo(tx *gorm.DB, agentTokenID uint, networkID uint64, tokenAddress string) (*models.AgentTokenInfo, error) { var rs models.AgentTokenInfo query := tx.Raw(` select ifnull(p.price, 0) price, ifnull(p.tick, 0) tick, ifnull(p_24h.price_last24h, 0) price_last24h, ifnull(v_all.total_volume, 0) total_volume, ifnull(v.volume_last24h, 0) volume_last24h, ifnull(holders.holders, 0) holders from ( select f.price, f.tick from agent_trade_histories f where f.agent_token_id = ? order by tx_at desc limit 1 ) p, ( select cast(ifnull(sum(base_amount), 0) as decimal(36,18)) total_volume from agent_trade_histories f where f.agent_token_id = ? ) v_all, ( select cast(ifnull(sum(base_amount), 0) as decimal(36,18)) volume_last24h from agent_trade_histories ob where 1=1 and agent_token_id = ? and tx_at >= now() - INTERVAL 1 DAY ) v, ( select f.price price_last24h from agent_trade_histories f where f.agent_token_id = ? and tx_at <= now() - INTERVAL 1 DAY order by tx_at desc limit 1 ) p_24h, ( select count(distinct address) holders from erc20_holders where network_id = ? and contract_address = ? and cast(balance as decimal(36, 18)) >= 0.0000001 ) holders `, agentTokenID, agentTokenID, agentTokenID, agentTokenID, networkID, tokenAddress) if err := query.Scan(&rs).Error; err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, errs.NewError(err) } return &rs, nil } func (d *DAO) GetAgentSocialInfo(tx *gorm.DB, agentID uint) (*models.AgentTokenInfo, error) { var rs models.AgentTokenInfo query := tx.Raw(` select ifnull(mentions.mentions, 0) mentions, ifnull(tip.amount, 0) tip_amount from ( select count(1) mentions from agent_twitter_posts atp where agent_info_id= ? ) mentions, ( select sum(amount) amount from agent_eai_topups where agent_info_id= ? and status='done' ) tip `, agentID, agentID) if err := query.Scan(&rs).Error; err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, errs.NewError(err) } return &rs, nil } func (d *DAO) GetAgentSummaryReport(tx *gorm.DB, hiddenNetworkId string) ([]*models.AgentInfo, error) { var rs []*models.AgentInfo hideNetwork := []int64{43338, 222672, 0} if hiddenNetworkId != "" { hiddenNetworkIdArry := strings.Split(hiddenNetworkId, ",") for _, s := range hiddenNetworkIdArry { i64, _ := strconv.ParseInt(s, 10, 64) hideNetwork = append(hideNetwork, i64) } } query := tx.Raw(` select network_id, network_name, count(1) counts from agent_infos where 1=1 and network_id not in (?) and deleted_at is null group by network_id, network_name order by counts desc `, hideNetwork) if err := query.Scan(&rs).Error; err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, errs.NewError(err) } return rs, nil } func (d *DAO) FirstAbilityLuckyMoney(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string) (*models.AbilityLuckyMoney, error) { var m models.AbilityLuckyMoney if err := d.first(tx, &m, filters, preloads, orders, false); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FindAbilityLuckyMoney(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, offset int, limit int) ([]*models.AbilityLuckyMoney, error) { var ms []*models.AbilityLuckyMoney if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, err } return ms, nil } func (d *DAO) FirstAbilityLuckyMoneyByID(tx *gorm.DB, id uint, preloads map[string][]interface{}, forUpdate bool) (*models.AbilityLuckyMoney, error) { var m models.AbilityLuckyMoney if err := d.first(tx, &m, map[string][]interface{}{"id = ?": []interface{}{id}}, preloads, nil, forUpdate); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FirstAgentReactionHistory(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string) (*models.AgentReactionHistory, error) { var m models.AgentReactionHistory if err := d.first(tx, &m, filters, preloads, orders, false); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/daos/agent_eai_topup.go ================================================ package daos import ( "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/jinzhu/gorm" ) func (d *DAO) FirstAgentEaiTopupByID(tx *gorm.DB, id uint, preloads map[string][]interface{}, forUpdate bool) (*models.AgentEaiTopup, error) { var m models.AgentEaiTopup if err := d.first(tx, &m, map[string][]interface{}{"id = ?": []interface{}{id}}, preloads, nil, forUpdate); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FirstAgentEaiTopup(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string) (*models.AgentEaiTopup, error) { var m models.AgentEaiTopup if err := d.first(tx, &m, filters, preloads, orders, false); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FindAgentEaiTopup(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, offset int, limit int) ([]*models.AgentEaiTopup, error) { var ms []*models.AgentEaiTopup if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, err } return ms, nil } func (d *DAO) FindAgentEaiTopup4Page(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.AgentEaiTopup, uint, error) { var ( offset = (page - 1) * limit ) var ms []*models.AgentEaiTopup if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, 0, errs.NewError(err) } c, err := d.count(tx, &models.AgentEaiTopup{}, filters) if err != nil { return nil, 0, errs.NewError(err) } return ms, c, nil } func (d *DAO) FindAgentEaiTopupJoinSelect(tx *gorm.DB, selected []string, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.AgentEaiTopup, error) { var ms []*models.AgentEaiTopup err := d.findJoinSelect(tx, &models.AgentEaiTopup{}, &ms, selected, joins, filters, preloads, orders, uint(page), uint(limit), false) if err != nil { return nil, errs.NewError(err) } return ms, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/daos/agent_external_info.go ================================================ package daos import ( "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/jinzhu/gorm" ) func (d *DAO) FirstAgentExternalInfoByID(tx *gorm.DB, id uint, preloads map[string][]interface{}, forUpdate bool) (*models.AgentExternalInfo, error) { var m models.AgentExternalInfo if err := d.first(tx, &m, map[string][]interface{}{"id = ?": []interface{}{id}}, preloads, nil, forUpdate); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FirstAgentExternalInfo(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string) (*models.AgentExternalInfo, error) { var m models.AgentExternalInfo if err := d.first(tx, &m, filters, preloads, orders, false); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FindAgentExternalInfo(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, offset int, limit int) ([]*models.AgentExternalInfo, error) { var ms []*models.AgentExternalInfo if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, err } return ms, nil } func (d *DAO) FindAgentExternalInfo4Page(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.AgentExternalInfo, uint, error) { var ( offset = (page - 1) * limit ) var ms []*models.AgentExternalInfo if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, 0, errs.NewError(err) } c, err := d.count(tx, &models.AgentExternalInfo{}, filters) if err != nil { return nil, 0, errs.NewError(err) } return ms, c, nil } func (d *DAO) FindAgentExternalInfoJoinSelect(tx *gorm.DB, selected []string, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.AgentExternalInfo, error) { var ms []*models.AgentExternalInfo err := d.findJoinSelect(tx, &models.AgentExternalInfo{}, &ms, selected, joins, filters, preloads, orders, uint(page), uint(limit), false) if err != nil { return nil, errs.NewError(err) } return ms, nil } func (d *DAO) FindAgentExternalInfoJoin(tx *gorm.DB, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.AgentExternalInfo, error) { var ( offset = (page - 1) * limit ) var ms []*models.AgentExternalInfo err := d.findJoin(tx, &ms, joins, filters, preloads, orders, offset, limit, false) if err != nil { return nil, errs.NewError(err) } return ms, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/daos/agent_info.go ================================================ package daos import ( "strings" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/jinzhu/gorm" ) func (d *DAO) FindAgentInfoJoinSelect(tx *gorm.DB, selected []string, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.AgentInfo, error) { var ms []*models.AgentInfo err := d.findJoinSelect(tx, &models.AgentInfo{}, &ms, selected, joins, filters, preloads, orders, uint(page), uint(limit), false) if err != nil { return nil, errs.NewError(err) } return ms, nil } func (d *DAO) FirstAgentInfoJoinSelect(tx *gorm.DB, selected []string, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string) (*models.AgentInfo, error) { var ms models.AgentInfo err := d.firstJoinSelect(tx, &ms, selected, joins, filters, preloads, orders, false) if err != nil { return nil, errs.NewError(err) } return &ms, nil } func (d *DAO) FirstAgentInfoByID(tx *gorm.DB, id uint, preloads map[string][]interface{}, forUpdate bool) (*models.AgentInfo, error) { var m models.AgentInfo if err := d.first(tx, &m, map[string][]interface{}{"id = ?": []interface{}{id}}, preloads, nil, forUpdate); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FirstAgentInfo(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string) (*models.AgentInfo, error) { var m models.AgentInfo if err := d.first(tx, &m, filters, preloads, orders, false); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FindAgentInfo(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, offset int, limit int) ([]*models.AgentInfo, error) { var ms []*models.AgentInfo if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, err } return ms, nil } func (d *DAO) FindAgentInfo4Page(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.AgentInfo, uint, error) { offset := (page - 1) * limit var ms []*models.AgentInfo if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, 0, errs.NewError(err) } c, err := d.count(tx, &models.AgentInfo{}, filters) if err != nil { return nil, 0, errs.NewError(err) } return ms, c, nil } func (d *DAO) FindAgentInfoJoin(tx *gorm.DB, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.AgentInfo, error) { offset := (page - 1) * limit var ms []*models.AgentInfo err := d.findJoin(tx, &ms, joins, filters, preloads, orders, offset, limit, false) if err != nil { return nil, errs.NewError(err) } return ms, nil } func (d *DAO) AgentInfoGetReportDaily(tx *gorm.DB) (string, error) { var rs []*struct { Msg string } query := tx.Raw(` select concat('agent created bitcoin : ', ( select count(1) from agent_infos where agent_contract_id != '' and network_id = 222671 )) msg union select concat('agent created base : ', (select count(1) from agent_infos where agent_contract_id != '' and network_id = 8453 ) ) union select concat('agent running bitcoin : ', ( select count(1) from agent_infos where agent_contract_id != '' and network_id = 222671 and twitter_info_id > 0 and ( eai_balance > 0 or eai_wallet_balance > 0 or infer_latest_time is not null ) ) ) union select concat('agent running base : ', ( select count(1) from agent_infos where agent_contract_id != '' and twitter_info_id > 0 and network_id = 8453 and ( eai_balance > 0 or eai_wallet_balance > 0 or infer_latest_time is not null ) ) ) union select concat('eai topped up : ', ( select sum(cast(amount as decimal(18, 2))) from agent_eai_topups where status = 'done' and deposit_address != '' )) union select concat('post num : ', ( (select count(1) from agent_twitter_posts where reply_post_id != '') ) ) `) if err := query.Scan(&rs).Error; err != nil { if err == gorm.ErrRecordNotFound { return "", nil } return "", errs.NewError(err) } var msg string for _, v := range rs { msg = msg + v.Msg + "\n" } msg = strings.TrimSpace(msg) return msg, nil } func (d *DAO) FirstPrivyWallet(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string) (*models.PrivyWallet, error) { var m models.PrivyWallet if err := d.first(tx, &m, filters, preloads, orders, false); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FirstClankerVideoToken(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string) (*models.ClankerVideoToken, error) { var m models.ClankerVideoToken if err := d.first(tx, &m, filters, preloads, orders, false); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FindClankerVideoToken(tx *gorm.DB, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.ClankerVideoToken, error) { offset := (page - 1) * limit var ms []*models.ClankerVideoToken err := d.findJoin(tx, &ms, joins, filters, preloads, orders, offset, limit, false) if err != nil { return nil, errs.NewError(err) } return ms, nil } func (d *DAO) FindAgentCategory(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.AgentCategory, error) { offset := (page - 1) * limit var ms []*models.AgentCategory err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false) if err != nil { return nil, errs.NewError(err) } return ms, nil } func (d *DAO) FindAllAgentAddress(tx *gorm.DB, networkID uint64) ([]string, error) { var ms []*struct { AgentContractAddress string } err := tx.Raw(` select distinct agent_contract_address from agent_infos where 1 = 1 and agent_contract_address != '' and agent_contract_id != '' and network_id = ? `, networkID).Scan(&ms).Error if err != nil { return nil, errs.NewError(err) } addresses := make([]string, len(ms)) for i, v := range ms { addresses[i] = v.AgentContractAddress } return addresses, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/daos/agent_info_install.go ================================================ package daos import ( "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/jinzhu/gorm" ) func (d *DAO) FindAgentInfoInstallJoinSelect(tx *gorm.DB, selected []string, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.AgentInfoInstall, error) { var ms []*models.AgentInfoInstall err := d.findJoinSelect(tx, &models.AgentInfoInstall{}, &ms, selected, joins, filters, preloads, orders, uint(page), uint(limit), false) if err != nil { return nil, errs.NewError(err) } return ms, nil } func (d *DAO) FindAgentInfoInstallJoinSelect4Page(tx *gorm.DB, selected []string, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.AgentInfoInstall, uint, error) { var ms []*models.AgentInfoInstall c, err := d.findJoinSelect4Page(tx, &models.AgentInfoInstall{}, &ms, selected, joins, filters, preloads, orders, uint(page), uint(limit), false) if err != nil { return nil, 0, errs.NewError(err) } return ms, c, nil } func (d *DAO) FirstAgentInfoInstallJoinSelect(tx *gorm.DB, selected []string, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, forUpdate bool) (*models.AgentInfoInstall, error) { var m models.AgentInfoInstall if err := d.firstJoinSelect(tx, &m, selected, joins, filters, preloads, nil, forUpdate); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FirstAgentInfoInstallByID(tx *gorm.DB, id uint, preloads map[string][]interface{}, forUpdate bool) (*models.AgentInfoInstall, error) { var m models.AgentInfoInstall if err := d.first(tx, &m, map[string][]interface{}{"id = ?": []interface{}{id}}, preloads, nil, forUpdate); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FirstAgentInfoInstall(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, forUpdate bool) (*models.AgentInfoInstall, error) { var m models.AgentInfoInstall if err := d.first(tx, &m, filters, preloads, nil, forUpdate); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FindAgentInfoInstall(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, offset int, limit int) ([]*models.AgentInfoInstall, error) { var ms []*models.AgentInfoInstall if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, err } return ms, nil } func (d *DAO) FindAgentInfoInstall4Page(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.AgentInfoInstall, uint, error) { var ( offset = (page - 1) * limit ) var ms []*models.AgentInfoInstall if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, 0, errs.NewError(err) } c, err := d.count(tx, &models.AgentInfoInstall{}, filters) if err != nil { return nil, 0, errs.NewError(err) } return ms, c, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/daos/agent_info_knowledge_base.go ================================================ package daos import ( "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/jinzhu/gorm" ) func (dao *DAO) FirstAgentInfoKnowledgeBaseByAgentInfoID(tx *gorm.DB, agentInfoID uint, preload map[string][]interface{}, orders []string) (*models.AgentInfoKnowledgeBase, error) { var agentInfoKnowledgeBase models.AgentInfoKnowledgeBase if err := dao.first(tx, &agentInfoKnowledgeBase, map[string][]interface{}{"agent_info_id = ?": []interface{}{agentInfoID}}, preload, orders, false); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &agentInfoKnowledgeBase, nil } func (dao *DAO) FirstAgentInfoKnowledgeBaseByAgentInfoIDAndKnowledgeBaseID(tx *gorm.DB, agentInfoID uint, knowledgeBaseID uint) (*models.AgentInfoKnowledgeBase, error) { var agentInfoKnowledgeBase models.AgentInfoKnowledgeBase if err := dao.first(tx, &agentInfoKnowledgeBase, map[string][]interface{}{ "agent_info_id = ?": {agentInfoID}, "knowledge_base_id = ?": {knowledgeBaseID}, }, nil, nil, false); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &agentInfoKnowledgeBase, nil } func (dao *DAO) CreateAgentInfoKnowledgeBase(tx *gorm.DB, agentInfoKnowledgeBase *models.AgentInfoKnowledgeBase) error { return dao.Create(tx, agentInfoKnowledgeBase) } // ========== KNOWLEDGE BASE ========== func (dao *DAO) FirstKnowledgeBase(tx *gorm.DB, filters map[string][]interface{}, preload map[string][]interface{}, order []string, forUpdate bool) (*models.KnowledgeBase, error) { var knowledgeBase models.KnowledgeBase if err := dao.first(tx, &knowledgeBase, filters, preload, order, forUpdate); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &knowledgeBase, nil } func (dao *DAO) FindKnowledgeBases(tx *gorm.DB, filters map[string][]interface{}, preload map[string][]interface{}, order []string, limit, offset int, forUpdate bool) ([]*models.KnowledgeBase, error) { var knowledgeBase []*models.KnowledgeBase if err := dao.find(tx, &knowledgeBase, filters, preload, order, limit, offset, forUpdate); err != nil { return nil, err } return knowledgeBase, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/daos/agent_library.go ================================================ package daos import ( "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/jinzhu/gorm" ) func (d *DAO) FirstAgentLibraryByID(tx *gorm.DB, id uint, preloads map[string][]interface{}, forUpdate bool) (*models.AgentLibrary, error) { var m models.AgentLibrary if err := d.first(tx, &m, map[string][]interface{}{"id = ?": []interface{}{id}}, preloads, nil, forUpdate); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FirstAgentLibrary(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string) (*models.AgentLibrary, error) { var m models.AgentLibrary if err := d.first(tx, &m, filters, preloads, orders, false); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FindAgentLibrary(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, offset int, limit int) ([]*models.AgentLibrary, error) { var ms []*models.AgentLibrary if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, err } return ms, nil } func (d *DAO) FindAgentLibrary4Page(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.AgentLibrary, uint, error) { var ( offset = (page - 1) * limit ) var ms []*models.AgentLibrary if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, 0, errs.NewError(err) } c, err := d.count(tx, &models.AgentLibrary{}, filters) if err != nil { return nil, 0, errs.NewError(err) } return ms, c, nil } func (d *DAO) FindAgentLibraryJoinSelect(tx *gorm.DB, selected []string, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.AgentLibrary, error) { var ms []*models.AgentLibrary err := d.findJoinSelect(tx, &models.AgentLibrary{}, &ms, selected, joins, filters, preloads, orders, uint(page), uint(limit), false) if err != nil { return nil, errs.NewError(err) } return ms, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/daos/agent_snapshot_mission.go ================================================ package daos import ( "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/jinzhu/gorm" ) func (d *DAO) FirstAgentSnapshotMissionByID(tx *gorm.DB, id uint, preloads map[string][]interface{}, forUpdate bool) (*models.AgentSnapshotMission, error) { var m models.AgentSnapshotMission if err := d.first(tx, &m, map[string][]interface{}{"id = ?": []interface{}{id}}, preloads, nil, forUpdate); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FirstAgentSnapshotMission(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string) (*models.AgentSnapshotMission, error) { var m models.AgentSnapshotMission if err := d.first(tx, &m, filters, preloads, orders, false); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FindAgentSnapshotMission(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, offset int, limit int) ([]*models.AgentSnapshotMission, error) { var ms []*models.AgentSnapshotMission if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, err } return ms, nil } func (d *DAO) FindAgentSnapshotMission4Page(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.AgentSnapshotMission, uint, error) { var ( offset = (page - 1) * limit ) var ms []*models.AgentSnapshotMission if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, 0, errs.NewError(err) } c, err := d.count(tx, &models.AgentSnapshotMission{}, filters) if err != nil { return nil, 0, errs.NewError(err) } return ms, c, nil } func (d *DAO) FindAgentSnapshotMissionJoinSelect(tx *gorm.DB, selected []string, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.AgentSnapshotMission, error) { var ms []*models.AgentSnapshotMission err := d.findJoinSelect(tx, &models.AgentSnapshotMission{}, &ms, selected, joins, filters, preloads, orders, uint(page), uint(limit), false) if err != nil { return nil, errs.NewError(err) } return ms, nil } func (d *DAO) FindAgentSnapshotMissionJoin(tx *gorm.DB, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.AgentSnapshotMission, error) { var ( offset = (page - 1) * limit ) var ms []*models.AgentSnapshotMission err := d.findJoin(tx, &ms, joins, filters, preloads, orders, offset, limit, false) if err != nil { return nil, errs.NewError(err) } return ms, nil } func (d *DAO) FirstAgentTeleMsg(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string) (*models.AgentTeleMsg, error) { var m models.AgentTeleMsg if err := d.first(tx, &m, filters, preloads, orders, false); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) GetMissionToolset(tx *gorm.DB, id uint) (string, error) { var rs models.AgentSnapshotMission query := tx.Raw(` select tool_set from agent_snapshot_missions where id = ? `, id) if err := query.Scan(&rs).Error; err != nil { if err == gorm.ErrRecordNotFound { return "", nil } return "", errs.NewError(err) } return string(rs.ToolSet), nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/daos/agent_snapshot_post.go ================================================ package daos import ( "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/jinzhu/gorm" ) func (d *DAO) FirstAgentSnapshotPostByID(tx *gorm.DB, id uint, preloads map[string][]interface{}, forUpdate bool) (*models.AgentSnapshotPost, error) { var m models.AgentSnapshotPost if err := d.first(tx, &m, map[string][]interface{}{"id = ?": []interface{}{id}}, preloads, nil, forUpdate); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FirstAgentSnapshotPost(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string) (*models.AgentSnapshotPost, error) { var m models.AgentSnapshotPost if err := d.first(tx, &m, filters, preloads, orders, false); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FindAgentSnapshotPost(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, offset int, limit int) ([]*models.AgentSnapshotPost, error) { var ms []*models.AgentSnapshotPost if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, err } return ms, nil } func (d *DAO) FindAgentSnapshotPost4Page(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.AgentSnapshotPost, uint, error) { var ( offset = (page - 1) * limit ) var ms []*models.AgentSnapshotPost if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, 0, errs.NewError(err) } c, err := d.count(tx, &models.AgentSnapshotPost{}, filters) if err != nil { return nil, 0, errs.NewError(err) } return ms, c, nil } func (d *DAO) FindAgentSnapshotPostJoinSelect(tx *gorm.DB, selected []string, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.AgentSnapshotPost, error) { var ms []*models.AgentSnapshotPost err := d.findJoinSelect(tx, &models.AgentSnapshotPost{}, &ms, selected, joins, filters, preloads, orders, uint(page), uint(limit), false) if err != nil { return nil, errs.NewError(err) } return ms, nil } func (d *DAO) FindAgentSnapshotMissionConfigs(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, offset int, limit int) ([]*models.AgentSnapshotMissionConfigs, error) { var ms []*models.AgentSnapshotMissionConfigs if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, err } return ms, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/daos/agent_snapshot_post_action.go ================================================ package daos import ( "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/jinzhu/gorm" ) func (d *DAO) FirstAgentSnapshotPostActionByID(tx *gorm.DB, id uint, preloads map[string][]interface{}, forUpdate bool) (*models.AgentSnapshotPostAction, error) { var m models.AgentSnapshotPostAction if err := d.first(tx, &m, map[string][]interface{}{"id = ?": []interface{}{id}}, preloads, nil, forUpdate); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FirstAgentSnapshotPostAction(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string) (*models.AgentSnapshotPostAction, error) { var m models.AgentSnapshotPostAction if err := d.first(tx, &m, filters, preloads, orders, false); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FindAgentSnapshotPostAction(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, offset int, limit int) ([]*models.AgentSnapshotPostAction, error) { var ms []*models.AgentSnapshotPostAction if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, err } return ms, nil } func (d *DAO) FindAgentSnapshotPostAction4Page(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.AgentSnapshotPostAction, uint, error) { var ( offset = (page - 1) * limit ) var ms []*models.AgentSnapshotPostAction if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, 0, errs.NewError(err) } c, err := d.count(tx, &models.AgentSnapshotPostAction{}, filters) if err != nil { return nil, 0, errs.NewError(err) } return ms, c, nil } func (d *DAO) FindAgentSnapshotPostActionJoinSelect(tx *gorm.DB, selected []string, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.AgentSnapshotPostAction, error) { var ms []*models.AgentSnapshotPostAction err := d.findJoinSelect(tx, &models.AgentSnapshotPostAction{}, &ms, selected, joins, filters, preloads, orders, uint(page), uint(limit), false) if err != nil { return nil, errs.NewError(err) } return ms, nil } func (d *DAO) FindAgentSnapshotPostActionJoin(tx *gorm.DB, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.AgentSnapshotPostAction, error) { var ( offset = (page - 1) * limit ) var ms []*models.AgentSnapshotPostAction err := d.findJoin(tx, &ms, joins, filters, preloads, orders, offset, limit, false) if err != nil { return nil, errs.NewError(err) } return ms, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/daos/agent_store.go ================================================ package daos import ( "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/jinzhu/gorm" ) func (d *DAO) FindAgentStoreJoinSelect(tx *gorm.DB, selected []string, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.AgentStore, error) { var ms []*models.AgentStore err := d.findJoinSelect(tx, &models.AgentStore{}, &ms, selected, joins, filters, preloads, orders, uint(page), uint(limit), false) if err != nil { return nil, errs.NewError(err) } return ms, nil } func (d *DAO) FindAgentStoreJoinSelect4Page(tx *gorm.DB, selected []string, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.AgentStore, uint, error) { var ms []*models.AgentStore c, err := d.findJoinSelect4Page(tx, &models.AgentStore{}, &ms, selected, joins, filters, preloads, orders, uint(page), uint(limit), false) if err != nil { return nil, 0, errs.NewError(err) } return ms, c, nil } func (d *DAO) FirstAgentStoreJoinSelect(tx *gorm.DB, selected []string, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, forUpdate bool) (*models.AgentStore, error) { var m models.AgentStore if err := d.firstJoinSelect(tx, &m, selected, joins, filters, preloads, nil, forUpdate); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FirstAgentStoreByID(tx *gorm.DB, id uint, preloads map[string][]interface{}, forUpdate bool) (*models.AgentStore, error) { var m models.AgentStore if err := d.first(tx, &m, map[string][]interface{}{"id = ?": []interface{}{id}}, preloads, nil, forUpdate); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FirstAgentStore(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, forUpdate bool) (*models.AgentStore, error) { var m models.AgentStore if err := d.first(tx, &m, filters, preloads, nil, forUpdate); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FindAgentStore(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, offset int, limit int) ([]*models.AgentStore, error) { var ms []*models.AgentStore if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, err } return ms, nil } func (d *DAO) FindAgentStore4Page(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.AgentStore, uint, error) { var ( offset = (page - 1) * limit ) var ms []*models.AgentStore if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, 0, errs.NewError(err) } c, err := d.count(tx, &models.AgentStore{}, filters) if err != nil { return nil, 0, errs.NewError(err) } return ms, c, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/daos/agent_store_install.go ================================================ package daos import ( "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/jinzhu/gorm" ) func (d *DAO) FindAgentStoreInstallJoinSelect(tx *gorm.DB, selected []string, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.AgentStoreInstall, error) { var ms []*models.AgentStoreInstall err := d.findJoinSelect(tx, &models.AgentStoreInstall{}, &ms, selected, joins, filters, preloads, orders, uint(page), uint(limit), false) if err != nil { return nil, errs.NewError(err) } return ms, nil } func (d *DAO) FindAgentStoreInstallJoinSelect4Page(tx *gorm.DB, selected []string, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.AgentStoreInstall, uint, error) { var ms []*models.AgentStoreInstall c, err := d.findJoinSelect4Page(tx, &models.AgentStoreInstall{}, &ms, selected, joins, filters, preloads, orders, uint(page), uint(limit), false) if err != nil { return nil, 0, errs.NewError(err) } return ms, c, nil } func (d *DAO) FirstAgentStoreInstallJoinSelect(tx *gorm.DB, selected []string, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, forUpdate bool) (*models.AgentStoreInstall, error) { var m models.AgentStoreInstall if err := d.firstJoinSelect(tx, &m, selected, joins, filters, preloads, nil, forUpdate); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FirstAgentStoreInstallByID(tx *gorm.DB, id uint, preloads map[string][]interface{}, forUpdate bool) (*models.AgentStoreInstall, error) { var m models.AgentStoreInstall if err := d.first(tx, &m, map[string][]interface{}{"id = ?": []interface{}{id}}, preloads, nil, forUpdate); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FirstAgentStoreInstall(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string) (*models.AgentStoreInstall, error) { var m models.AgentStoreInstall if err := d.first(tx, &m, filters, preloads, orders, false); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FindAgentStoreInstall(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, offset int, limit int) ([]*models.AgentStoreInstall, error) { var ms []*models.AgentStoreInstall if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, err } return ms, nil } func (d *DAO) FindAgentStoreInstall4Page(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.AgentStoreInstall, uint, error) { var ( offset = (page - 1) * limit ) var ms []*models.AgentStoreInstall if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, 0, errs.NewError(err) } c, err := d.count(tx, &models.AgentStoreInstall{}, filters) if err != nil { return nil, 0, errs.NewError(err) } return ms, c, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/daos/agent_store_mission.go ================================================ package daos import ( "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/jinzhu/gorm" ) func (d *DAO) FindAgentStoreMissionJoinSelect(tx *gorm.DB, selected []string, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.AgentStoreMission, error) { var ms []*models.AgentStoreMission err := d.findJoinSelect(tx, &models.AgentStoreMission{}, &ms, selected, joins, filters, preloads, orders, uint(page), uint(limit), false) if err != nil { return nil, errs.NewError(err) } return ms, nil } func (d *DAO) FindAgentStoreMissionJoinSelect4Page(tx *gorm.DB, selected []string, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.AgentStoreMission, uint, error) { var ms []*models.AgentStoreMission c, err := d.findJoinSelect4Page(tx, &models.AgentStoreMission{}, &ms, selected, joins, filters, preloads, orders, uint(page), uint(limit), false) if err != nil { return nil, 0, errs.NewError(err) } return ms, c, nil } func (d *DAO) FirstAgentStoreMissionJoinSelect(tx *gorm.DB, selected []string, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, forUpdate bool) (*models.AgentStoreMission, error) { var m models.AgentStoreMission if err := d.firstJoinSelect(tx, &m, selected, joins, filters, preloads, nil, forUpdate); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FirstAgentStoreMissionByID(tx *gorm.DB, id uint, preloads map[string][]interface{}, forUpdate bool) (*models.AgentStoreMission, error) { var m models.AgentStoreMission if err := d.first(tx, &m, map[string][]interface{}{"id = ?": []interface{}{id}}, preloads, nil, forUpdate); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FirstAgentStoreMission(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, forUpdate bool) (*models.AgentStoreMission, error) { var m models.AgentStoreMission if err := d.first(tx, &m, filters, preloads, nil, forUpdate); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FindAgentStoreMission(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, offset int, limit int) ([]*models.AgentStoreMission, error) { var ms []*models.AgentStoreMission if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, err } return ms, nil } func (d *DAO) FindAgentStoreMission4Page(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.AgentStoreMission, uint, error) { var ( offset = (page - 1) * limit ) var ms []*models.AgentStoreMission if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, 0, errs.NewError(err) } c, err := d.count(tx, &models.AgentStoreMission{}, filters) if err != nil { return nil, 0, errs.NewError(err) } return ms, c, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/daos/agent_store_try.go ================================================ package daos import ( "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/jinzhu/gorm" ) func (d *DAO) FindAgentStoreTryJoinSelect(tx *gorm.DB, selected []string, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.AgentStoreTry, error) { var ms []*models.AgentStoreTry err := d.findJoinSelect(tx, &models.AgentStoreTry{}, &ms, selected, joins, filters, preloads, orders, uint(page), uint(limit), false) if err != nil { return nil, errs.NewError(err) } return ms, nil } func (d *DAO) FindAgentStoreTryJoinSelect4Page(tx *gorm.DB, selected []string, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.AgentStoreTry, uint, error) { var ms []*models.AgentStoreTry c, err := d.findJoinSelect4Page(tx, &models.AgentStoreTry{}, &ms, selected, joins, filters, preloads, orders, uint(page), uint(limit), false) if err != nil { return nil, 0, errs.NewError(err) } return ms, c, nil } func (d *DAO) FirstAgentStoreTryJoinSelect(tx *gorm.DB, selected []string, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, forUpdate bool) (*models.AgentStoreTry, error) { var m models.AgentStoreTry if err := d.firstJoinSelect(tx, &m, selected, joins, filters, preloads, nil, forUpdate); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FirstAgentStoreTryByID(tx *gorm.DB, id uint, preloads map[string][]interface{}, forUpdate bool) (*models.AgentStoreTry, error) { var m models.AgentStoreTry if err := d.first(tx, &m, map[string][]interface{}{"id = ?": []interface{}{id}}, preloads, nil, forUpdate); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FirstAgentStoreTry(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, forUpdate bool) (*models.AgentStoreTry, error) { var m models.AgentStoreTry if err := d.first(tx, &m, filters, preloads, nil, forUpdate); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FindAgentStoreTry(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, offset int, limit int) ([]*models.AgentStoreTry, error) { var ms []*models.AgentStoreTry if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, err } return ms, nil } func (d *DAO) FindAgentStoreTry4Page(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.AgentStoreTry, uint, error) { var ( offset = (page - 1) * limit ) var ms []*models.AgentStoreTry if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, 0, errs.NewError(err) } c, err := d.count(tx, &models.AgentStoreTry{}, filters) if err != nil { return nil, 0, errs.NewError(err) } return ms, c, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/daos/agent_store_try_detail.go ================================================ package daos import ( "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/jinzhu/gorm" ) func (d *DAO) FindAgentStoreTryDetailJoinSelect(tx *gorm.DB, selected []string, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.AgentStoreTryDetail, error) { var ms []*models.AgentStoreTryDetail err := d.findJoinSelect(tx, &models.AgentStoreTryDetail{}, &ms, selected, joins, filters, preloads, orders, uint(page), uint(limit), false) if err != nil { return nil, errs.NewError(err) } return ms, nil } func (d *DAO) FindAgentStoreTryDetailJoinSelect4Page(tx *gorm.DB, selected []string, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.AgentStoreTryDetail, uint, error) { var ms []*models.AgentStoreTryDetail c, err := d.findJoinSelect4Page(tx, &models.AgentStoreTryDetail{}, &ms, selected, joins, filters, preloads, orders, uint(page), uint(limit), false) if err != nil { return nil, 0, errs.NewError(err) } return ms, c, nil } func (d *DAO) FirstAgentStoreTryDetailJoinSelect(tx *gorm.DB, selected []string, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, forUpdate bool) (*models.AgentStoreTryDetail, error) { var m models.AgentStoreTryDetail if err := d.firstJoinSelect(tx, &m, selected, joins, filters, preloads, nil, forUpdate); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FirstAgentStoreTryDetailByID(tx *gorm.DB, id uint, preloads map[string][]interface{}, forUpdate bool) (*models.AgentStoreTryDetail, error) { var m models.AgentStoreTryDetail if err := d.first(tx, &m, map[string][]interface{}{"id = ?": []interface{}{id}}, preloads, nil, forUpdate); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FirstAgentStoreTryDetail(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, forUpdate bool) (*models.AgentStoreTryDetail, error) { var m models.AgentStoreTryDetail if err := d.first(tx, &m, filters, preloads, nil, forUpdate); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FindAgentStoreTryDetail(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, offset int, limit int) ([]*models.AgentStoreTryDetail, error) { var ms []*models.AgentStoreTryDetail if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, err } return ms, nil } func (d *DAO) FindAgentStoreTryDetail4Page(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.AgentStoreTryDetail, uint, error) { var ( offset = (page - 1) * limit ) var ms []*models.AgentStoreTryDetail if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, 0, errs.NewError(err) } c, err := d.count(tx, &models.AgentStoreTryDetail{}, filters) if err != nil { return nil, 0, errs.NewError(err) } return ms, c, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/daos/agent_token_dao.go ================================================ package daos import ( "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/jinzhu/gorm" ) func (d *DAO) FirstMemeByID(tx *gorm.DB, id uint, preloads map[string][]interface{}, forUpdate bool) (*models.Meme, error) { var m models.Meme if err := d.first(tx, &m, map[string][]interface{}{"id = ?": []interface{}{id}}, preloads, nil, forUpdate); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FirstMeme(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, forUpdate bool) (*models.Meme, error) { var m models.Meme if err := d.first(tx, &m, filters, preloads, nil, forUpdate); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FindMeme(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, offset int, limit int) ([]*models.Meme, error) { var ms []*models.Meme if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, err } return ms, nil } func (d *DAO) FindMeme4Page(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.Meme, uint, error) { var ( offset = (page - 1) * limit ) var ms []*models.Meme if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, 0, errs.NewError(err) } c, err := d.count(tx, &models.Meme{}, filters) if err != nil { return nil, 0, errs.NewError(err) } return ms, c, nil } func (d *DAO) FindMemeJoinSelect(tx *gorm.DB, selected []string, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.Meme, error) { var ms []*models.Meme err := d.findJoinSelect(tx, &models.Meme{}, &ms, selected, joins, filters, preloads, orders, uint(page), uint(limit), false) if err != nil { return nil, errs.NewError(err) } return ms, nil } func (d *DAO) FindMemeJoin(tx *gorm.DB, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.Meme, error) { var ( offset = (page - 1) * limit ) var ms []*models.Meme err := d.findJoin(tx, &ms, joins, filters, preloads, orders, offset, limit, false) if err != nil { return nil, errs.NewError(err) } return ms, nil } func (d *DAO) FirstMemeJoinSelect(tx *gorm.DB, selected []string, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, order []string) (*models.Meme, error) { var m models.Meme if err := d.firstJoinSelect(tx, &m, selected, joins, filters, preloads, order, false); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FindMemeJoinSelect4Page(tx *gorm.DB, selected []string, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.Meme, uint, error) { var ms []*models.Meme c, err := d.findJoinSelect4PageNoCount(tx, &models.Meme{}, &ms, selected, joins, filters, preloads, orders, uint(page), uint(limit), false) if err != nil { return nil, 0, errs.NewError(err) } return ms, c, nil } // // func (d *DAO) FindMemeHistoryJoinSelect(tx *gorm.DB, selected []string, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.MemeTradeHistory, error) { var ms []*models.MemeTradeHistory err := d.findJoinSelect(tx, &models.MemeTradeHistory{}, &ms, selected, joins, filters, preloads, orders, uint(page), uint(limit), false) if err != nil { return nil, errs.NewError(err) } return ms, nil } func (d *DAO) FirstMemeHistoryByID(tx *gorm.DB, id uint, preloads map[string][]interface{}, forUpdate bool) (*models.MemeTradeHistory, error) { var m models.MemeTradeHistory if err := d.first(tx, &m, map[string][]interface{}{"id = ?": []interface{}{id}}, preloads, nil, forUpdate); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FirstMemeHistory(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, order []string) (*models.MemeTradeHistory, error) { var m models.MemeTradeHistory if err := d.first(tx, &m, filters, preloads, order, false); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FindMemeHistory(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, offset int, limit int) ([]*models.MemeTradeHistory, error) { var ms []*models.MemeTradeHistory if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, err } return ms, nil } func (d *DAO) GetMemeTradeHistoryInfo(tx *gorm.DB, pairID uint) (*models.Meme, error) { var rs models.Meme query := tx.Raw(` select ifnull(p.price, 0) price, ifnull(p.tick, 0) tick, ifnull(p_24h.price_last24h, 0) price_last24h, ifnull(v_all.total_volume, 0) total_volume, v.* from ( select f.price, f.tick from meme_trade_histories f where f.meme_id = ? order by tx_at desc limit 1 ) p left join ( select cast(ifnull(sum(base_amount), 0) as decimal(36,18)) total_volume from meme_trade_histories f where f.meme_id = ? ) v_all on 1=1 left join ( select cast(ifnull(sum(base_amount), 0) as decimal(36,18)) volume_last24h from meme_trade_histories ob where 1=1 and meme_id = ? and tx_at >= now() - INTERVAL 1 DAY ) v on 1=1 left join ( select f.price price_last24h from meme_trade_histories f where f.meme_id = ? and tx_at <= now() - INTERVAL 1 DAY order by tx_at desc limit 1 ) p_24h on 1=1 `, pairID, pairID, pairID, pairID) if err := query.Scan(&rs).Error; err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, errs.NewError(err) } return &rs, nil } func (d *DAO) UpdateChartCandleDataByMemeID(tx *gorm.DB, memID uint) (bool, error) { if err := tx.Exec("call create_chart_candles_min30_by_key(?)", memID).Error; err != nil { return false, errs.NewError(err) } if err := tx.Exec("call create_chart_candles_min5_by_key(?)", memID).Error; err != nil { return false, errs.NewError(err) } return true, nil } // //thread // // func (d *DAO) FindMemeThreadJoinSelect(tx *gorm.DB, selected []string, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.MemeThreads, error) { var ms []*models.MemeThreads err := d.findJoinSelect(tx, &models.MemeThreads{}, &ms, selected, joins, filters, preloads, orders, uint(page), uint(limit), false) if err != nil { return nil, errs.NewError(err) } return ms, nil } func (d *DAO) FirstMemeThreadByID(tx *gorm.DB, id uint, preloads map[string][]interface{}, forUpdate bool) (*models.MemeThreads, error) { var m models.MemeThreads if err := d.first(tx, &m, map[string][]interface{}{"id = ?": []interface{}{id}}, preloads, nil, forUpdate); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FirstMemeThread(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, order []string) (*models.MemeThreads, error) { var m models.MemeThreads if err := d.first(tx, &m, filters, preloads, order, false); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FindMemeThread(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, offset int, limit int) ([]*models.MemeThreads, error) { var ms []*models.MemeThreads if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, err } return ms, nil } func (d *DAO) FirstMemeThreadLike(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, order []string) (*models.MemeThreadLike, error) { var m models.MemeThreadLike if err := d.first(tx, &m, filters, preloads, order, false); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } // /followers func (d *DAO) FindMemeFollowersJoinSelect(tx *gorm.DB, selected []string, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.MemeFollowers, error) { var ms []*models.MemeFollowers err := d.findJoinSelect(tx, &models.MemeFollowers{}, &ms, selected, joins, filters, preloads, orders, uint(page), uint(limit), false) if err != nil { return nil, errs.NewError(err) } return ms, nil } func (d *DAO) FirstMemeFollowersJoinSelect(tx *gorm.DB, selected []string, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, order []string) (*models.MemeFollowers, error) { var m models.MemeFollowers if err := d.firstJoinSelect(tx, &m, selected, joins, filters, preloads, order, false); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FirstMemeFollowers(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, order []string) (*models.MemeFollowers, error) { var m models.MemeFollowers if err := d.first(tx, &m, filters, preloads, order, false); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } // ////////chart func (d *DAO) UpdateChartCandleDataByPair(tx *gorm.DB, memeID uint) (bool, error) { if err := tx.Exec("call create_meme_chart_candles_min30_by_id(?)", memeID).Error; err != nil { return false, errs.NewError(err) } if err := tx.Exec("call create_meme_chart_candles_min5_by_id(?)", memeID).Error; err != nil { return false, errs.NewError(err) } if err := tx.Exec("call create_meme_chart_candles_hour1_by_id(?)", memeID).Error; err != nil { return false, errs.NewError(err) } if err := tx.Exec("call create_meme_chart_candles_hour4_by_id(?)", memeID).Error; err != nil { return false, errs.NewError(err) } if err := tx.Exec("call create_meme_chart_candles_day1_by_id(?)", memeID).Error; err != nil { return false, errs.NewError(err) } return true, nil } func (d *DAO) GetMemeChartCandleData30Min(tx *gorm.DB, memeID, day uint) ([]*models.ChartData, error) { var rs []*models.ChartData queryStr := ` SELECT * from meme_chart_candles_min30 where (pair_id = ?) and DATE_ADD(chart_time, INTERVAL ? DAY) >= now() ORDER BY chart_time ` query := tx.Raw(queryStr, memeID, day) if err := query.Scan(&rs).Error; err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, errs.NewError(err) } return rs, nil } func (d *DAO) GetMemeChartCandleData1Hour(tx *gorm.DB, memeID, day uint) ([]*models.ChartData, error) { var rs []*models.ChartData queryStr := ` SELECT * from meme_chart_candles_hour1 where (pair_id = ?) and DATE_ADD(chart_time, INTERVAL ? DAY) >= now() ORDER BY chart_time ` query := tx.Raw(queryStr, memeID, day) if err := query.Scan(&rs).Error; err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, errs.NewError(err) } return rs, nil } func (d *DAO) GetMemeChartCandleData4Hour(tx *gorm.DB, memeID, day uint) ([]*models.ChartData, error) { var rs []*models.ChartData queryStr := ` SELECT * from meme_chart_candles_hour4 where (pair_id = ?) and DATE_ADD(chart_time, INTERVAL ? DAY) >= now() ORDER BY chart_time ` query := tx.Raw(queryStr, memeID, day) if err := query.Scan(&rs).Error; err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, errs.NewError(err) } return rs, nil } func (d *DAO) GetMemeChartCandleData1Day(tx *gorm.DB, memeID, day uint) ([]*models.ChartData, error) { var rs []*models.ChartData queryStr := ` SELECT * from meme_chart_candles_day1 where (pair_id = ?) and DATE_ADD(chart_time, INTERVAL ? DAY) >= now() ORDER BY chart_time ` query := tx.Raw(queryStr, memeID, day) if err := query.Scan(&rs).Error; err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, errs.NewError(err) } return rs, nil } func (d *DAO) GetMemeChartCandleData5Min(tx *gorm.DB, memeID, day uint) ([]*models.ChartData, error) { var rs []*models.ChartData queryStr := ` SELECT * from meme_chart_candles_min5 where (pair_id = ?) and DATE_ADD(chart_time, INTERVAL ? DAY) >= now() ORDER BY chart_time ` query := tx.Raw(queryStr, memeID, day) if err := query.Scan(&rs).Error; err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, errs.NewError(err) } return rs, nil } // ////// func (d *DAO) FirstMemeNotificationByID(tx *gorm.DB, id uint, preloads map[string][]interface{}, forUpdate bool) (*models.MemeNotification, error) { var m models.MemeNotification if err := d.first(tx, &m, map[string][]interface{}{"id = ?": []interface{}{id}}, preloads, nil, forUpdate); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FirstMemeNotification(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, order []string) (*models.MemeNotification, error) { var m models.MemeNotification if err := d.first(tx, &m, filters, preloads, order, false); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FindMemeNotificationJoinSelect(tx *gorm.DB, selected []string, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.MemeNotification, error) { var ms []*models.MemeNotification err := d.findJoinSelect(tx, &models.MemeTradeHistory{}, &ms, selected, joins, filters, preloads, orders, uint(page), uint(limit), false) if err != nil { return nil, errs.NewError(err) } return ms, nil } func (d *DAO) FirstMemeWhiteListAddress(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, order []string) (*models.MemeWhiteListAddress, error) { var m models.MemeWhiteListAddress if err := d.first(tx, &m, filters, preloads, order, false); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FindMemeWhiteListAddress(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, offset int, limit int) ([]*models.MemeWhiteListAddress, error) { var ms []*models.MemeWhiteListAddress if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, err } return ms, nil } func (d *DAO) FindMemeBurnJoinSelect(tx *gorm.DB, selected []string, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.TokenTransfer, error) { var ms []*models.TokenTransfer err := d.findJoinSelect(tx, &models.TokenTransfer{}, &ms, selected, joins, filters, preloads, orders, uint(page), uint(limit), false) if err != nil { return nil, errs.NewError(err) } return ms, nil } func (d *DAO) FirstMemeNotificationSeen(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, order []string) (*models.MemeNotificationSeen, error) { var m models.MemeNotificationSeen if err := d.first(tx, &m, filters, preloads, order, false); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FirstMemeSeenByID(tx *gorm.DB, id uint, preloads map[string][]interface{}, forUpdate bool) (*models.MemeSeen, error) { var m models.MemeSeen if err := d.first(tx, &m, map[string][]interface{}{"id = ?": []interface{}{id}}, preloads, nil, forUpdate); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FirstMemeSeen(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, forUpdate bool) (*models.MemeSeen, error) { var m models.MemeSeen if err := d.first(tx, &m, filters, preloads, nil, forUpdate); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FindTrendingToken(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, offset int, limit int) ([]*models.TrendingToken, error) { var tokens []*models.TrendingToken if err := d.find(tx, &tokens, filters, preloads, orders, offset, limit, false); err != nil { return nil, err } return tokens, nil } func (d *DAO) FindAllMemeTokenAddress(tx *gorm.DB, networkID uint64) ([]string, error) { var ms []*struct { TokenAddress string Pool string UniswapPool string } err := tx.Raw(` select token_address, pool, uniswap_pool from memes where network_id = ? and token_address != '' `, networkID).Scan(&ms).Error if err != nil { return nil, errs.NewError(err) } addresses := []string{} for _, v := range ms { if v.TokenAddress != "" { addresses = append(addresses, v.TokenAddress) } if v.Pool != "" { addresses = append(addresses, v.Pool) } if v.UniswapPool != "" { addresses = append(addresses, v.UniswapPool) } } return addresses, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/daos/agent_trade_token.go ================================================ package daos import ( "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/jinzhu/gorm" ) func (d *DAO) FirstAgentTradeTokenByID(tx *gorm.DB, id uint, preloads map[string][]interface{}, forUpdate bool) (*models.AgentTradeToken, error) { var m models.AgentTradeToken if err := d.first(tx, &m, map[string][]interface{}{"id = ?": []interface{}{id}}, preloads, nil, forUpdate); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FirstAgentTradeToken(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string) (*models.AgentTradeToken, error) { var m models.AgentTradeToken if err := d.first(tx, &m, filters, preloads, orders, false); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FindAgentTradeToken(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, offset int, limit int) ([]*models.AgentTradeToken, error) { var ms []*models.AgentTradeToken if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, err } return ms, nil } func (d *DAO) FindAgentTradeToken4Page(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.AgentTradeToken, uint, error) { var ( offset = (page - 1) * limit ) var ms []*models.AgentTradeToken if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, 0, errs.NewError(err) } c, err := d.count(tx, &models.AgentTradeToken{}, filters) if err != nil { return nil, 0, errs.NewError(err) } return ms, c, nil } func (d *DAO) FindAgentTradeTokenJoinSelect(tx *gorm.DB, selected []string, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.AgentTradeToken, error) { var ms []*models.AgentTradeToken err := d.findJoinSelect(tx, &models.AgentTradeToken{}, &ms, selected, joins, filters, preloads, orders, uint(page), uint(limit), false) if err != nil { return nil, errs.NewError(err) } return ms, nil } func (d *DAO) FindAgentTradeTokenJoin(tx *gorm.DB, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.AgentTradeToken, error) { var ( offset = (page - 1) * limit ) var ms []*models.AgentTradeToken err := d.findJoin(tx, &ms, joins, filters, preloads, orders, offset, limit, false) if err != nil { return nil, errs.NewError(err) } return ms, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/daos/agent_twitter_post.go ================================================ package daos import ( "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/jinzhu/gorm" ) func (d *DAO) FirstAgentTwitterPostByID(tx *gorm.DB, id uint, preloads map[string][]interface{}, forUpdate bool) (*models.AgentTwitterPost, error) { var m models.AgentTwitterPost if err := d.first(tx, &m, map[string][]interface{}{"id = ?": []interface{}{id}}, preloads, nil, forUpdate); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FirstAgentTwitterPost(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string) (*models.AgentTwitterPost, error) { var m models.AgentTwitterPost if err := d.first(tx, &m, filters, preloads, orders, false); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FindAgentTwitterPost(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, offset int, limit int) ([]*models.AgentTwitterPost, error) { var ms []*models.AgentTwitterPost if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, err } return ms, nil } func (d *DAO) FindAgentTwitterPost4Page(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.AgentTwitterPost, uint, error) { var ( offset = (page - 1) * limit ) var ms []*models.AgentTwitterPost if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, 0, errs.NewError(err) } c, err := d.count(tx, &models.AgentTwitterPost{}, filters) if err != nil { return nil, 0, errs.NewError(err) } return ms, c, nil } func (d *DAO) FindAgentTwitterPostJoinSelect(tx *gorm.DB, selected []string, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.AgentTwitterPost, error) { var ms []*models.AgentTwitterPost err := d.findJoinSelect(tx, &models.AgentTwitterPost{}, &ms, selected, joins, filters, preloads, orders, uint(page), uint(limit), false) if err != nil { return nil, errs.NewError(err) } return ms, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/daos/agent_wallet.go ================================================ package daos import ( "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/jinzhu/gorm" ) func (d *DAO) FirstAgentWalletByID(tx *gorm.DB, id uint, preloads map[string][]interface{}, forUpdate bool) (*models.AgentWallet, error) { var m models.AgentWallet if err := d.first(tx, &m, map[string][]interface{}{"id = ?": []interface{}{id}}, preloads, nil, forUpdate); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FirstAgentWallet(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string) (*models.AgentWallet, error) { var m models.AgentWallet if err := d.first(tx, &m, filters, preloads, orders, false); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FindAgentWallet(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, offset int, limit int) ([]*models.AgentWallet, error) { var ms []*models.AgentWallet if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, err } return ms, nil } func (d *DAO) FindAgentWallet4Page(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.AgentWallet, uint, error) { var ( offset = (page - 1) * limit ) var ms []*models.AgentWallet if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, 0, errs.NewError(err) } c, err := d.count(tx, &models.AgentWallet{}, filters) if err != nil { return nil, 0, errs.NewError(err) } return ms, c, nil } func (d *DAO) FindAgentWalletJoinSelect(tx *gorm.DB, selected []string, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.AgentWallet, error) { var ms []*models.AgentWallet err := d.findJoinSelect(tx, &models.AgentWallet{}, &ms, selected, joins, filters, preloads, orders, uint(page), uint(limit), false) if err != nil { return nil, errs.NewError(err) } return ms, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/daos/agent_wallet_action.go ================================================ package daos import ( "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/jinzhu/gorm" ) func (d *DAO) FirstAgentWalletActionByID(tx *gorm.DB, id uint, preloads map[string][]interface{}, forUpdate bool) (*models.AgentWalletAction, error) { var m models.AgentWalletAction if err := d.first(tx, &m, map[string][]interface{}{"id = ?": []interface{}{id}}, preloads, nil, forUpdate); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FirstAgentWalletAction(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string) (*models.AgentWalletAction, error) { var m models.AgentWalletAction if err := d.first(tx, &m, filters, preloads, orders, false); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FindAgentWalletAction(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, offset int, limit int) ([]*models.AgentWalletAction, error) { var ms []*models.AgentWalletAction if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, err } return ms, nil } func (d *DAO) FindAgentWalletAction4Page(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.AgentWalletAction, uint, error) { var ( offset = (page - 1) * limit ) var ms []*models.AgentWalletAction if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, 0, errs.NewError(err) } c, err := d.count(tx, &models.AgentWalletAction{}, filters) if err != nil { return nil, 0, errs.NewError(err) } return ms, c, nil } func (d *DAO) FindAgentWalletActionJoinSelect(tx *gorm.DB, selected []string, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.AgentWalletAction, error) { var ms []*models.AgentWalletAction err := d.findJoinSelect(tx, &models.AgentWalletAction{}, &ms, selected, joins, filters, preloads, orders, uint(page), uint(limit), false) if err != nil { return nil, errs.NewError(err) } return ms, nil } func (d *DAO) GetWalletActionTradeSum(tx *gorm.DB, agentInfoID uint) ([]*models.AgentWalletTradeSum, error) { var rs []*models.AgentWalletTradeSum query := tx.Raw(` select mint, sum( if(side = 'buy', amount_in, 0) ) buy_amount, sum( if(side = 'sell', amount_out, 0) ) sell_amount from agent_wallet_actions where action_type = 'trade_raydium' and status = 'done' and agent_info_id = ? group by mint; `, agentInfoID) if err := query.Scan(&rs).Error; err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, errs.NewError(err) } return rs, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/daos/api_subscription_history.go ================================================ package daos import ( "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/jinzhu/gorm" ) func (d *DAO) FirstApiSubscriptionHistoryByID(tx *gorm.DB, id uint, preloads map[string][]interface{}, forUpdate bool) (*models.ApiSubscriptionHistory, error) { var m models.ApiSubscriptionHistory if err := d.first(tx, &m, map[string][]interface{}{"id = ?": []interface{}{id}}, preloads, nil, forUpdate); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FirstApiSubscriptionHistory(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string) (*models.ApiSubscriptionHistory, error) { var m models.ApiSubscriptionHistory if err := d.first(tx, &m, filters, preloads, orders, false); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FindApiSubscriptionHistory(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, offset int, limit int) ([]*models.ApiSubscriptionHistory, error) { var ms []*models.ApiSubscriptionHistory if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, err } return ms, nil } func (d *DAO) FindApiSubscriptionHistory4Page(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.ApiSubscriptionHistory, uint, error) { var ( offset = (page - 1) * limit ) var ms []*models.ApiSubscriptionHistory if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, 0, errs.NewError(err) } c, err := d.count(tx, &models.ApiSubscriptionHistory{}, filters) if err != nil { return nil, 0, errs.NewError(err) } return ms, c, nil } func (d *DAO) FindApiSubscriptionHistoryJoinSelect(tx *gorm.DB, selected []string, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.ApiSubscriptionHistory, error) { var ms []*models.ApiSubscriptionHistory err := d.findJoinSelect(tx, &models.ApiSubscriptionHistory{}, &ms, selected, joins, filters, preloads, orders, uint(page), uint(limit), false) if err != nil { return nil, errs.NewError(err) } return ms, nil } func (d *DAO) FindApiSubscriptionHistoryJoin(tx *gorm.DB, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.ApiSubscriptionHistory, error) { var ( offset = (page - 1) * limit ) var ms []*models.ApiSubscriptionHistory err := d.findJoin(tx, &ms, joins, filters, preloads, orders, offset, limit, false) if err != nil { return nil, errs.NewError(err) } return ms, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/daos/api_subscription_key.go ================================================ package daos import ( "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/jinzhu/gorm" ) func (d *DAO) FirstApiSubscriptionKeyByID(tx *gorm.DB, id uint, preloads map[string][]interface{}, forUpdate bool) (*models.ApiSubscriptionKey, error) { var m models.ApiSubscriptionKey if err := d.first(tx, &m, map[string][]interface{}{"id = ?": []interface{}{id}}, preloads, nil, forUpdate); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FirstApiSubscriptionKey(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string) (*models.ApiSubscriptionKey, error) { var m models.ApiSubscriptionKey if err := d.first(tx, &m, filters, preloads, orders, false); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FindApiSubscriptionKey(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, offset int, limit int) ([]*models.ApiSubscriptionKey, error) { var ms []*models.ApiSubscriptionKey if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, err } return ms, nil } func (d *DAO) FindApiSubscriptionKey4Page(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.ApiSubscriptionKey, uint, error) { var ( offset = (page - 1) * limit ) var ms []*models.ApiSubscriptionKey if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, 0, errs.NewError(err) } c, err := d.count(tx, &models.ApiSubscriptionKey{}, filters) if err != nil { return nil, 0, errs.NewError(err) } return ms, c, nil } func (d *DAO) FindApiSubscriptionKeyJoinSelect(tx *gorm.DB, selected []string, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.ApiSubscriptionKey, error) { var ms []*models.ApiSubscriptionKey err := d.findJoinSelect(tx, &models.ApiSubscriptionKey{}, &ms, selected, joins, filters, preloads, orders, uint(page), uint(limit), false) if err != nil { return nil, errs.NewError(err) } return ms, nil } func (d *DAO) FindApiSubscriptionKeyJoin(tx *gorm.DB, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.ApiSubscriptionKey, error) { var ( offset = (page - 1) * limit ) var ms []*models.ApiSubscriptionKey err := d.findJoin(tx, &ms, joins, filters, preloads, orders, offset, limit, false) if err != nil { return nil, errs.NewError(err) } return ms, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/daos/api_subscription_package.go ================================================ package daos import ( "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/jinzhu/gorm" ) func (d *DAO) FirstApiSubscriptionPackageByID(tx *gorm.DB, id uint, preloads map[string][]interface{}, forUpdate bool) (*models.ApiSubscriptionPackage, error) { var m models.ApiSubscriptionPackage if err := d.first(tx, &m, map[string][]interface{}{"id = ?": []interface{}{id}}, preloads, nil, forUpdate); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FirstApiSubscriptionPackage(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string) (*models.ApiSubscriptionPackage, error) { var m models.ApiSubscriptionPackage if err := d.first(tx, &m, filters, preloads, orders, false); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FindApiSubscriptionPackage(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, offset int, limit int) ([]*models.ApiSubscriptionPackage, error) { var ms []*models.ApiSubscriptionPackage if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, err } return ms, nil } func (d *DAO) FindApiSubscriptionPackage4Page(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.ApiSubscriptionPackage, uint, error) { var ( offset = (page - 1) * limit ) var ms []*models.ApiSubscriptionPackage if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, 0, errs.NewError(err) } c, err := d.count(tx, &models.ApiSubscriptionPackage{}, filters) if err != nil { return nil, 0, errs.NewError(err) } return ms, c, nil } func (d *DAO) FindApiSubscriptionPackageJoinSelect(tx *gorm.DB, selected []string, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.ApiSubscriptionPackage, error) { var ms []*models.ApiSubscriptionPackage err := d.findJoinSelect(tx, &models.ApiSubscriptionPackage{}, &ms, selected, joins, filters, preloads, orders, uint(page), uint(limit), false) if err != nil { return nil, errs.NewError(err) } return ms, nil } func (d *DAO) FindApiSubscriptionPackageJoin(tx *gorm.DB, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.ApiSubscriptionPackage, error) { var ( offset = (page - 1) * limit ) var ms []*models.ApiSubscriptionPackage err := d.findJoin(tx, &ms, joins, filters, preloads, orders, offset, limit, false) if err != nil { return nil, errs.NewError(err) } return ms, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/daos/api_subscription_usage_log.go ================================================ package daos import ( "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/jinzhu/gorm" ) func (d *DAO) FirstApiSubscriptionUsageLogByID(tx *gorm.DB, id uint, preloads map[string][]interface{}, forUpdate bool) (*models.ApiSubscriptionUsageLog, error) { var m models.ApiSubscriptionUsageLog if err := d.first(tx, &m, map[string][]interface{}{"id = ?": []interface{}{id}}, preloads, nil, forUpdate); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FirstApiSubscriptionUsageLog(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string) (*models.ApiSubscriptionUsageLog, error) { var m models.ApiSubscriptionUsageLog if err := d.first(tx, &m, filters, preloads, orders, false); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FindApiSubscriptionUsageLog(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, offset int, limit int) ([]*models.ApiSubscriptionUsageLog, error) { var ms []*models.ApiSubscriptionUsageLog if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, err } return ms, nil } func (d *DAO) FindApiSubscriptionUsageLog4Page(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.ApiSubscriptionUsageLog, uint, error) { var ( offset = (page - 1) * limit ) var ms []*models.ApiSubscriptionUsageLog if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, 0, errs.NewError(err) } c, err := d.count(tx, &models.ApiSubscriptionUsageLog{}, filters) if err != nil { return nil, 0, errs.NewError(err) } return ms, c, nil } func (d *DAO) FindApiSubscriptionUsageLogJoinSelect(tx *gorm.DB, selected []string, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.ApiSubscriptionUsageLog, error) { var ms []*models.ApiSubscriptionUsageLog err := d.findJoinSelect(tx, &models.ApiSubscriptionUsageLog{}, &ms, selected, joins, filters, preloads, orders, uint(page), uint(limit), false) if err != nil { return nil, errs.NewError(err) } return ms, nil } func (d *DAO) FindApiSubscriptionUsageLogJoin(tx *gorm.DB, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.ApiSubscriptionUsageLog, error) { var ( offset = (page - 1) * limit ) var ms []*models.ApiSubscriptionUsageLog err := d.findJoin(tx, &ms, joins, filters, preloads, orders, offset, limit, false) if err != nil { return nil, errs.NewError(err) } return ms, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/daos/batch_infer_history.go ================================================ package daos import ( "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/jinzhu/gorm" ) func (d *DAO) FindBatchInferHistoryJoinSelect(tx *gorm.DB, selected []string, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.BatchInferHistory, error) { var ms []*models.BatchInferHistory err := d.findJoinSelect(tx, &models.BatchInferHistory{}, &ms, selected, joins, filters, preloads, orders, uint(page), uint(limit), false) if err != nil { return nil, errs.NewError(err) } return ms, nil } func (d *DAO) FindBatchInferHistoryJoinSelect4Page(tx *gorm.DB, selected []string, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.BatchInferHistory, uint, error) { var ms []*models.BatchInferHistory c, err := d.findJoinSelect4Page(tx, &models.BatchInferHistory{}, &ms, selected, joins, filters, preloads, orders, uint(page), uint(limit), false) if err != nil { return nil, 0, errs.NewError(err) } return ms, c, nil } func (d *DAO) FirstBatchInferHistoryJoinSelect(tx *gorm.DB, selected []string, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, forUpdate bool) (*models.BatchInferHistory, error) { var m models.BatchInferHistory if err := d.firstJoinSelect(tx, &m, selected, joins, filters, preloads, nil, forUpdate); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FirstBatchInferHistoryByID(tx *gorm.DB, id uint, preloads map[string][]interface{}, forUpdate bool) (*models.BatchInferHistory, error) { var m models.BatchInferHistory if err := d.first(tx, &m, map[string][]interface{}{"id = ?": []interface{}{id}}, preloads, nil, forUpdate); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FirstBatchInferHistory(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, forUpdate bool) (*models.BatchInferHistory, error) { var m models.BatchInferHistory if err := d.first(tx, &m, filters, preloads, nil, forUpdate); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FindBatchInferHistory(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, offset int, limit int) ([]*models.BatchInferHistory, error) { var ms []*models.BatchInferHistory if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, err } return ms, nil } func (d *DAO) FindBatchInferHistory4Page(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.BatchInferHistory, uint, error) { var ( offset = (page - 1) * limit ) var ms []*models.BatchInferHistory if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, 0, errs.NewError(err) } c, err := d.count(tx, &models.BatchInferHistory{}, filters) if err != nil { return nil, 0, errs.NewError(err) } return ms, c, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/daos/block_scan_info.go ================================================ package daos import ( "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/types/numeric" "github.com/jinzhu/gorm" ) func (d *DAO) FirstBlockScanInfo(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string) (*models.BlockScanInfo, error) { var m models.BlockScanInfo if err := d.first(tx, &m, filters, preloads, orders, false); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FindBlockScanInfo(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, offset int, limit int) ([]*models.BlockScanInfo, error) { var ms []*models.BlockScanInfo if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, err } return ms, nil } func (d *DAO) FindJoinSelectBlockScanInfo(tx *gorm.DB, selected []string, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.BlockScanInfo, error) { var ms []*models.BlockScanInfo err := d.findJoinSelect(tx, &models.BlockScanInfo{}, &ms, selected, joins, filters, preloads, orders, uint(page), uint(limit), false) if err != nil { return nil, errs.NewError(err) } return ms, nil } func (d *DAO) FirstBlockScanInfoByID(tx *gorm.DB, id uint, preloads map[string][]interface{}, forUpdate bool) (*models.BlockScanInfo, error) { var m models.BlockScanInfo if err := d.first(tx, &m, map[string][]interface{}{"id = ?": []interface{}{id}}, preloads, nil, forUpdate); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) GetTokenMarketPrice(tx *gorm.DB, symbol string) (*numeric.BigFloat, *numeric.BigFloat, error) { var rs struct { Price numeric.BigFloat Last24hPrice numeric.BigFloat } query := tx.Raw(` select ttp.price, ttp.last24h_price from token_prices ttp where symbol = ? `, symbol) if err := query.Scan(&rs).Error; err != nil { zeroF := numeric.NewBigFloatFromString("0") if err == gorm.ErrRecordNotFound { return &zeroF, &zeroF, nil } return &zeroF, &zeroF, errs.NewError(err) } return &rs.Price, &rs.Last24hPrice, nil } func (d *DAO) FirstTokenPrice(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, forUpdate bool) (*models.TokenPrice, error) { var m models.TokenPrice if err := d.first(tx, &m, filters, preloads, nil, forUpdate); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/daos/chain_config.go ================================================ package daos import ( "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/jinzhu/gorm" ) func (d *DAO) FindChainConfigJoinSelect(tx *gorm.DB, selected []string, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.ChainConfig, error) { var ms []*models.ChainConfig err := d.findJoinSelect(tx, &models.ChainConfig{}, &ms, selected, joins, filters, preloads, orders, uint(page), uint(limit), false) if err != nil { return nil, errs.NewError(err) } return ms, nil } func (d *DAO) FindChainConfigJoinSelect4Page(tx *gorm.DB, selected []string, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.ChainConfig, uint, error) { var ms []*models.ChainConfig c, err := d.findJoinSelect4Page(tx, &models.ChainConfig{}, &ms, selected, joins, filters, preloads, orders, uint(page), uint(limit), false) if err != nil { return nil, 0, errs.NewError(err) } return ms, c, nil } func (d *DAO) FirstChainConfigJoinSelect(tx *gorm.DB, selected []string, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, forUpdate bool) (*models.ChainConfig, error) { var m models.ChainConfig if err := d.firstJoinSelect(tx, &m, selected, joins, filters, preloads, nil, forUpdate); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FirstChainConfigByID(tx *gorm.DB, id uint, preloads map[string][]interface{}, forUpdate bool) (*models.ChainConfig, error) { var m models.ChainConfig if err := d.first(tx, &m, map[string][]interface{}{"id = ?": []interface{}{id}}, preloads, nil, forUpdate); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FirstChainConfig(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, forUpdate bool) (*models.ChainConfig, error) { var m models.ChainConfig if err := d.first(tx, &m, filters, preloads, nil, forUpdate); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FindChainConfig(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, offset int, limit int) ([]*models.ChainConfig, error) { var ms []*models.ChainConfig if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, err } return ms, nil } func (d *DAO) FindChainConfig4Page(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.ChainConfig, uint, error) { var ( offset = (page - 1) * limit ) var ms []*models.ChainConfig if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, 0, errs.NewError(err) } c, err := d.count(tx, &models.ChainConfig{}, filters) if err != nil { return nil, 0, errs.NewError(err) } return ms, c, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/daos/daos.go ================================================ package daos import ( "context" "fmt" "strings" "sync" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/jinzhu/gorm" "github.com/pkg/errors" ) var dbMain *gorm.DB func InitDBConn(dbMainConn *gorm.DB) { dbMain = dbMainConn } func GetDBMainCtx(ctx context.Context) *gorm.DB { return dbMain.New() } func WithTransaction(dbConn *gorm.DB, callback func(*gorm.DB) error) (err error) { tx := dbConn.Begin() defer func() { if rval := recover(); rval != nil { tx.Rollback() err = errs.NewError(errors.New(fmt.Sprint(rval))) } }() if err = callback(tx); err != nil { tx.Rollback() return err } if err = tx.Commit().Error; err != nil { return errs.NewError(err) } return nil } type DAO struct { mtx sync.Mutex configMap map[string]string } func (d *DAO) Create(tx *gorm.DB, m interface{}) error { if err := tx.Create(m).Error; err != nil { return err } return nil } func (d *DAO) Save(tx *gorm.DB, m interface{}) error { if err := tx.Save(m).Error; err != nil { return err } return nil } func (d *DAO) Delete(tx *gorm.DB, m interface{}) error { if err := tx.Delete(m).Error; err != nil { return err } return nil } func (d *DAO) DeleteUnscoped(tx *gorm.DB, m interface{}) error { if err := tx.Unscoped().Delete(m).Error; err != nil { return err } return nil } func (d *DAO) first(tx *gorm.DB, m interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, forUpdate bool) error { query := tx for k, v := range filters { if v != nil { query = query.Where(k, v...) } else { query = query.Where(k) } } for k, v := range preloads { if v != nil { query = query.Preload(k, v...) } else { query = query.Preload(k) } } if orders != nil && len(orders) > 0 { for _, v := range orders { query = query.Order(v) } } if forUpdate { query = query.Set("gorm:query_option", "FOR UPDATE") } if err := query.First(m).Error; err != nil { return err } return nil } func (d *DAO) find(tx *gorm.DB, ms interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, offset int, limit int, forUpdate bool) error { query := tx for k, v := range filters { if v != nil { query = query.Where(k, v...) } else { query = query.Where(k) } } for k, v := range preloads { if v != nil { query = query.Preload(k, v...) } else { query = query.Preload(k) } } if orders != nil && len(orders) > 0 { for _, v := range orders { query = query.Order(v) } } if offset >= 0 { query = query.Offset(offset) } if limit >= 0 { query = query.Limit(limit) } if forUpdate { query = query.Set("gorm:query_option", "FOR UPDATE") } if err := query.Find(ms).Error; err != nil { return err } return nil } func (d *DAO) count(tx *gorm.DB, m interface{}, filters map[string][]interface{}) (uint, error) { query := tx for k, v := range filters { if v != nil { query = query.Where(k, v...) } else { query = query.Where(k) } } var count uint if err := query.Model(m).Count(&count).Error; err != nil { return 0, err } return count, nil } func (d *DAO) findJoin(tx *gorm.DB, ms interface{}, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, offset int, limit int, forUpdate bool) error { query := tx for k, v := range joins { if v != nil { query = query.Joins(k, v...) } else { query = query.Joins(k) } } for k, v := range filters { if v != nil { query = query.Where(k, v...) } else { query = query.Where(k) } } for k, v := range preloads { if v != nil { query = query.Preload(k, v...) } else { query = query.Preload(k) } } for _, v := range orders { query = query.Order(v) } if offset >= 0 { query = query.Offset(offset) } if limit >= 0 { query = query.Limit(limit) } if forUpdate { query = query.Set("gorm:query_option", "FOR UPDATE") } if err := query.Find(ms).Error; err != nil { return err } return nil } func (d *DAO) countJoin(tx *gorm.DB, m interface{}, joins map[string][]interface{}, filters map[string][]interface{}) (uint, error) { query := tx for k, v := range joins { if v != nil { query = query.Joins(k, v...) } else { query = query.Joins(k) } } for k, v := range filters { if v != nil { query = query.Where(k, v...) } else { query = query.Where(k) } } var count uint if err := query.Model(m).Count(&count).Error; err != nil { return 0, err } return count, nil } func (d *DAO) findJoin4Page(tx *gorm.DB, m interface{}, ms interface{}, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page uint, limit uint, forUpdate bool) (uint, error) { var count uint offset := page*limit - limit query := tx for k, v := range joins { if v != nil { query = query.Joins(k, v...) } else { query = query.Joins(k) } } for k, v := range filters { if v != nil { query = query.Where(k, v...) } else { query = query.Where(k) } } for k, v := range preloads { if v != nil { query = query.Preload(k, v...) } else { query = query.Preload(k) } } for _, v := range orders { query = query.Order(v) } if err := query.Model(m).Count(&count).Error; err != nil { return 0, err } if forUpdate { query = query.Set("gorm:query_option", "FOR UPDATE") } query = query.Limit(limit).Offset(offset) if err := query.Find(ms).Error; err != nil { return 0, err } return count, nil } func (d *DAO) findAll(tx *gorm.DB, ms interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, forUpdate bool) error { query := tx for k, v := range filters { if v != nil { query = query.Where(k, v...) } else { query = query.Where(k) } } for k, v := range preloads { if v != nil { query = query.Preload(k, v...) } else { query = query.Preload(k) } } if len(orders) > 0 { for _, v := range orders { query = query.Order(v) } } if forUpdate { query = query.Set("gorm:query_option", "FOR UPDATE") } if err := query.Find(ms).Error; err != nil { return err } return nil } func (d *DAO) findJoinSelect(tx *gorm.DB, m interface{}, ms interface{}, selected []string, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page uint, limit uint, forUpdate bool) error { offset := page*limit - limit query := tx if len(selected) > 0 { query = query.Select(strings.Join(selected, ", ")) } for k, v := range joins { if v != nil { query = query.Joins(k, v...) } else { query = query.Joins(k) } } for k, v := range filters { if v != nil { query = query.Where(k, v...) } else { query = query.Where(k) } } for k, v := range preloads { if v != nil { query = query.Preload(k, v...) } else { query = query.Preload(k) } } if len(orders) > 0 { for _, v := range orders { query = query.Order(v) } } if forUpdate { query = query.Set("gorm:query_option", "FOR UPDATE") } query = query.Limit(limit).Offset(offset) if err := query.Find(ms).Error; err != nil { return err } return nil } func (d *DAO) firstJoinSelect(tx *gorm.DB, m interface{}, selected []string, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, forUpdate bool) error { query := tx if len(selected) > 0 { query = query.Select(strings.Join(selected, ", ")) } for k, v := range joins { if v != nil { query = query.Joins(k, v...) } else { query = query.Joins(k) } } for k, v := range filters { if v != nil { query = query.Where(k, v...) } else { query = query.Where(k) } } for k, v := range preloads { if v != nil { query = query.Preload(k, v...) } else { query = query.Preload(k) } } if orders != nil && len(orders) > 0 { for _, v := range orders { query = query.Order(v) } } if forUpdate { query = query.Set("gorm:query_option", "FOR UPDATE") } if err := query.First(m).Error; err != nil { return err } return nil } func (d *DAO) findJoinSelect4Page(tx *gorm.DB, m interface{}, ms interface{}, selected []string, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page uint, limit uint, forUpdate bool) (uint, error) { var count uint offset := page*limit - limit query := tx if len(selected) > 0 { query = query.Select(strings.Join(selected, ", ")) } for k, v := range joins { if v != nil { query = query.Joins(k, v...) } else { query = query.Joins(k) } } for k, v := range filters { if v != nil { query = query.Where(k, v...) } else { query = query.Where(k) } } for k, v := range preloads { if v != nil { query = query.Preload(k, v...) } else { query = query.Preload(k) } } if len(orders) > 0 { for _, v := range orders { query = query.Order(v) } } if forUpdate { query = query.Set("gorm:query_option", "FOR UPDATE") } if err := query.Model(m).Count(&count).Error; err != nil { return 0, err } query = query.Limit(limit).Offset(offset) if err := query.Find(ms).Error; err != nil { return 0, err } return count, nil } func (d *DAO) findJoinSelect4PageNoCount(tx *gorm.DB, m interface{}, ms interface{}, selected []string, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page uint, limit uint, forUpdate bool) (uint, error) { offset := page*limit - limit query := tx if len(selected) > 0 { query = query.Select(strings.Join(selected, ", ")) } for k, v := range joins { if v != nil { query = query.Joins(k, v...) } else { query = query.Joins(k) } } for k, v := range filters { if v != nil { query = query.Where(k, v...) } else { query = query.Where(k) } } for k, v := range preloads { if v != nil { query = query.Preload(k, v...) } else { query = query.Preload(k) } } if len(orders) > 0 { for _, v := range orders { query = query.Order(v) } } if forUpdate { query = query.Set("gorm:query_option", "FOR UPDATE") } query = query.Limit(limit).Offset(offset) if err := query.Find(ms).Error; err != nil { return 0, err } return 0, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/daos/external_wallet.go ================================================ package daos import ( "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/jinzhu/gorm" ) func (d *DAO) FirstExternalWalletByID(tx *gorm.DB, id uint, preloads map[string][]interface{}, forUpdate bool) (*models.ExternalWallet, error) { var m models.ExternalWallet if err := d.first(tx, &m, map[string][]interface{}{"id = ?": []interface{}{id}}, preloads, nil, forUpdate); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FirstExternalWallet(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string) (*models.ExternalWallet, error) { var m models.ExternalWallet if err := d.first(tx, &m, filters, preloads, orders, false); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FindExternalWallet(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, offset int, limit int) ([]*models.ExternalWallet, error) { var ms []*models.ExternalWallet if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, err } return ms, nil } func (d *DAO) FindExternalWallet4Page(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.ExternalWallet, uint, error) { var ( offset = (page - 1) * limit ) var ms []*models.ExternalWallet if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, 0, errs.NewError(err) } c, err := d.count(tx, &models.ExternalWallet{}, filters) if err != nil { return nil, 0, errs.NewError(err) } return ms, c, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/daos/external_wallet_order.go ================================================ package daos import ( "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/jinzhu/gorm" ) func (d *DAO) FirstExternalWalletOrderByID(tx *gorm.DB, id uint, preloads map[string][]interface{}, forUpdate bool) (*models.ExternalWalletOrder, error) { var m models.ExternalWalletOrder if err := d.first(tx, &m, map[string][]interface{}{"id = ?": []interface{}{id}}, preloads, nil, forUpdate); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FirstExternalWalletOrder(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string) (*models.ExternalWalletOrder, error) { var m models.ExternalWalletOrder if err := d.first(tx, &m, filters, preloads, orders, false); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FindExternalWalletOrder(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, offset int, limit int) ([]*models.ExternalWalletOrder, error) { var ms []*models.ExternalWalletOrder if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, err } return ms, nil } func (d *DAO) FindExternalWalletOrder4Page(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.ExternalWalletOrder, uint, error) { var ( offset = (page - 1) * limit ) var ms []*models.ExternalWalletOrder if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, 0, errs.NewError(err) } c, err := d.count(tx, &models.ExternalWalletOrder{}, filters) if err != nil { return nil, 0, errs.NewError(err) } return ms, c, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/daos/external_wallet_token.go ================================================ package daos import ( "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/jinzhu/gorm" ) func (d *DAO) FirstExternalWalletTokenByID(tx *gorm.DB, id uint, preloads map[string][]interface{}, forUpdate bool) (*models.ExternalWalletToken, error) { var m models.ExternalWalletToken if err := d.first(tx, &m, map[string][]interface{}{"id = ?": []interface{}{id}}, preloads, nil, forUpdate); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FirstExternalWalletToken(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string) (*models.ExternalWalletToken, error) { var m models.ExternalWalletToken if err := d.first(tx, &m, filters, preloads, orders, false); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FindExternalWalletToken(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, offset int, limit int) ([]*models.ExternalWalletToken, error) { var ms []*models.ExternalWalletToken if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, err } return ms, nil } func (d *DAO) FindExternalWalletToken4Page(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.ExternalWalletToken, uint, error) { var ( offset = (page - 1) * limit ) var ms []*models.ExternalWalletToken if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, 0, errs.NewError(err) } c, err := d.count(tx, &models.ExternalWalletToken{}, filters) if err != nil { return nil, 0, errs.NewError(err) } return ms, c, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/daos/infra_twiiter_app.go ================================================ package daos import ( "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/jinzhu/gorm" ) func (d *DAO) FirstInfraTwitterAppByID(tx *gorm.DB, id uint, preloads map[string][]interface{}, forUpdate bool) (*models.InfraTwitterApp, error) { var m models.InfraTwitterApp if err := d.first(tx, &m, map[string][]interface{}{"id = ?": []interface{}{id}}, preloads, nil, forUpdate); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FirstInfraTwitterApp(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string) (*models.InfraTwitterApp, error) { var m models.InfraTwitterApp if err := d.first(tx, &m, filters, preloads, orders, false); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FindInfraTwitterApp(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, offset int, limit int) ([]*models.InfraTwitterApp, error) { var ms []*models.InfraTwitterApp if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, err } return ms, nil } func (d *DAO) FindInfraTwitterApp4Page(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.InfraTwitterApp, uint, error) { var ( offset = (page - 1) * limit ) var ms []*models.InfraTwitterApp if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, 0, errs.NewError(err) } c, err := d.count(tx, &models.InfraTwitterApp{}, filters) if err != nil { return nil, 0, errs.NewError(err) } return ms, c, nil } func (d *DAO) FindInfraTwitterAppJoinSelect(tx *gorm.DB, selected []string, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.InfraTwitterApp, error) { var ms []*models.InfraTwitterApp err := d.findJoinSelect(tx, &models.InfraTwitterApp{}, &ms, selected, joins, filters, preloads, orders, uint(page), uint(limit), false) if err != nil { return nil, errs.NewError(err) } return ms, nil } func (d *DAO) FirstInfraTwitterTopupTx(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string) (*models.InfraTwitterTopupTx, error) { var m models.InfraTwitterTopupTx if err := d.first(tx, &m, filters, preloads, orders, false); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/daos/job_config.go ================================================ package daos import ( "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/jinzhu/gorm" ) func (d *DAO) FindJobConfigJoinSelect(tx *gorm.DB, selected []string, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.JobConfig, error) { var ms []*models.JobConfig err := d.findJoinSelect(tx, &models.JobConfig{}, &ms, selected, joins, filters, preloads, orders, uint(page), uint(limit), false) if err != nil { return nil, errs.NewError(err) } return ms, nil } func (d *DAO) FindJobConfigJoinSelect4Page(tx *gorm.DB, selected []string, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.JobConfig, uint, error) { var ms []*models.JobConfig c, err := d.findJoinSelect4Page(tx, &models.JobConfig{}, &ms, selected, joins, filters, preloads, orders, uint(page), uint(limit), false) if err != nil { return nil, 0, errs.NewError(err) } return ms, c, nil } func (d *DAO) FirstJobConfigJoinSelect(tx *gorm.DB, selected []string, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, forUpdate bool) (*models.JobConfig, error) { var m models.JobConfig if err := d.firstJoinSelect(tx, &m, selected, joins, filters, preloads, nil, forUpdate); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FirstJobConfigByID(tx *gorm.DB, id uint, preloads map[string][]interface{}, forUpdate bool) (*models.JobConfig, error) { var m models.JobConfig if err := d.first(tx, &m, map[string][]interface{}{"id = ?": []interface{}{id}}, preloads, nil, forUpdate); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FirstJobConfig(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, forUpdate bool) (*models.JobConfig, error) { var m models.JobConfig if err := d.first(tx, &m, filters, preloads, nil, forUpdate); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FindJobConfig(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, offset int, limit int) ([]*models.JobConfig, error) { var ms []*models.JobConfig if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, err } return ms, nil } func (d *DAO) FindJobConfig4Page(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.JobConfig, uint, error) { var ( offset = (page - 1) * limit ) var ms []*models.JobConfig if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, 0, errs.NewError(err) } c, err := d.count(tx, &models.JobConfig{}, filters) if err != nil { return nil, 0, errs.NewError(err) } return ms, c, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/daos/launchpad.go ================================================ package daos import ( "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/jinzhu/gorm" ) func (d *DAO) FirstLaunchpadByID(tx *gorm.DB, id uint, preloads map[string][]interface{}, forUpdate bool) (*models.Launchpad, error) { var m models.Launchpad if err := d.first(tx, &m, map[string][]interface{}{"id = ?": []interface{}{id}}, preloads, nil, forUpdate); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FirstLaunchpad(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string) (*models.Launchpad, error) { var m models.Launchpad if err := d.first(tx, &m, filters, preloads, orders, false); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FindLaunchpad(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, offset int, limit int) ([]*models.Launchpad, error) { var ms []*models.Launchpad if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, err } return ms, nil } func (d *DAO) FindLaunchpad4Page(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.Launchpad, uint, error) { var ( offset = (page - 1) * limit ) var ms []*models.Launchpad if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, 0, errs.NewError(err) } c, err := d.count(tx, &models.Launchpad{}, filters) if err != nil { return nil, 0, errs.NewError(err) } return ms, c, nil } func (d *DAO) FindLaunchpadJoinSelect(tx *gorm.DB, selected []string, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.Launchpad, error) { var ms []*models.Launchpad err := d.findJoinSelect(tx, &models.Launchpad{}, &ms, selected, joins, filters, preloads, orders, uint(page), uint(limit), false) if err != nil { return nil, errs.NewError(err) } return ms, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/daos/launchpad_member.go ================================================ package daos import ( "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/jinzhu/gorm" ) func (d *DAO) FirstLaunchpadMemberByID(tx *gorm.DB, id uint, preloads map[string][]interface{}, forUpdate bool) (*models.LaunchpadMember, error) { var m models.LaunchpadMember if err := d.first(tx, &m, map[string][]interface{}{"id = ?": []interface{}{id}}, preloads, nil, forUpdate); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FirstLaunchpadMember(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string) (*models.LaunchpadMember, error) { var m models.LaunchpadMember if err := d.first(tx, &m, filters, preloads, orders, false); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FindLaunchpadMember(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, offset int, limit int) ([]*models.LaunchpadMember, error) { var ms []*models.LaunchpadMember if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, err } return ms, nil } func (d *DAO) FindLaunchpadMember4Page(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.LaunchpadMember, uint, error) { var ( offset = (page - 1) * limit ) var ms []*models.LaunchpadMember if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, 0, errs.NewError(err) } c, err := d.count(tx, &models.LaunchpadMember{}, filters) if err != nil { return nil, 0, errs.NewError(err) } return ms, c, nil } func (d *DAO) FindLaunchpadMemberJoinSelect(tx *gorm.DB, selected []string, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.LaunchpadMember, error) { var ms []*models.LaunchpadMember err := d.findJoinSelect(tx, &models.LaunchpadMember{}, &ms, selected, joins, filters, preloads, orders, uint(page), uint(limit), false) if err != nil { return nil, errs.NewError(err) } return ms, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/daos/launchpad_transaction.go ================================================ package daos import ( "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/jinzhu/gorm" ) func (d *DAO) FirstLaunchpadTransactionByID(tx *gorm.DB, id uint, preloads map[string][]interface{}, forUpdate bool) (*models.LaunchpadTransaction, error) { var m models.LaunchpadTransaction if err := d.first(tx, &m, map[string][]interface{}{"id = ?": []interface{}{id}}, preloads, nil, forUpdate); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FirstLaunchpadTransaction(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string) (*models.LaunchpadTransaction, error) { var m models.LaunchpadTransaction if err := d.first(tx, &m, filters, preloads, orders, false); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FindLaunchpadTransaction(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, offset int, limit int) ([]*models.LaunchpadTransaction, error) { var ms []*models.LaunchpadTransaction if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, err } return ms, nil } func (d *DAO) FindLaunchpadTransaction4Page(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.LaunchpadTransaction, uint, error) { var ( offset = (page - 1) * limit ) var ms []*models.LaunchpadTransaction if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, 0, errs.NewError(err) } c, err := d.count(tx, &models.LaunchpadTransaction{}, filters) if err != nil { return nil, 0, errs.NewError(err) } return ms, c, nil } func (d *DAO) FindLaunchpadTransactionJoinSelect(tx *gorm.DB, selected []string, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.LaunchpadTransaction, error) { var ms []*models.LaunchpadTransaction err := d.findJoinSelect(tx, &models.LaunchpadTransaction{}, &ms, selected, joins, filters, preloads, orders, uint(page), uint(limit), false) if err != nil { return nil, errs.NewError(err) } return ms, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/daos/meme_fees_collected.go ================================================ package daos import ( "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/jinzhu/gorm" ) func (d *DAO) FirstMemeFeesCollectedByID(tx *gorm.DB, id uint, preloads map[string][]interface{}, forUpdate bool) (*models.MemeFeesCollected, error) { var m models.MemeFeesCollected if err := d.first(tx, &m, map[string][]interface{}{"id = ?": []interface{}{id}}, preloads, nil, forUpdate); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FirstMemeFeesCollected(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string) (*models.MemeFeesCollected, error) { var m models.MemeFeesCollected if err := d.first(tx, &m, filters, preloads, orders, false); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FindMemeFeesCollected(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, offset int, limit int) ([]*models.MemeFeesCollected, error) { var ms []*models.MemeFeesCollected if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, err } return ms, nil } func (d *DAO) FindMemeFeesCollected4Page(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.MemeFeesCollected, uint, error) { var ( offset = (page - 1) * limit ) var ms []*models.MemeFeesCollected if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, 0, errs.NewError(err) } c, err := d.count(tx, &models.MemeFeesCollected{}, filters) if err != nil { return nil, 0, errs.NewError(err) } return ms, c, nil } func (d *DAO) FindMemeFeesCollectedJoinSelect(tx *gorm.DB, selected []string, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.MemeFeesCollected, error) { var ms []*models.MemeFeesCollected err := d.findJoinSelect(tx, &models.MemeFeesCollected{}, &ms, selected, joins, filters, preloads, orders, uint(page), uint(limit), false) if err != nil { return nil, errs.NewError(err) } return ms, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/daos/mission_store.go ================================================ package daos import ( "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/jinzhu/gorm" ) func (d *DAO) FindMissionStoreJoinSelect(tx *gorm.DB, selected []string, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.MissionStore, error) { var ms []*models.MissionStore err := d.findJoinSelect(tx, &models.MissionStore{}, &ms, selected, joins, filters, preloads, orders, uint(page), uint(limit), false) if err != nil { return nil, errs.NewError(err) } return ms, nil } func (d *DAO) FindMissionStoreJoinSelect4Page(tx *gorm.DB, selected []string, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.MissionStore, uint, error) { var ms []*models.MissionStore c, err := d.findJoinSelect4Page(tx, &models.MissionStore{}, &ms, selected, joins, filters, preloads, orders, uint(page), uint(limit), false) if err != nil { return nil, 0, errs.NewError(err) } return ms, c, nil } func (d *DAO) FirstMissionStoreJoinSelect(tx *gorm.DB, selected []string, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, forUpdate bool) (*models.MissionStore, error) { var m models.MissionStore if err := d.firstJoinSelect(tx, &m, selected, joins, filters, preloads, nil, forUpdate); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FirstMissionStoreByID(tx *gorm.DB, id uint, preloads map[string][]interface{}, forUpdate bool) (*models.MissionStore, error) { var m models.MissionStore if err := d.first(tx, &m, map[string][]interface{}{"id = ?": []interface{}{id}}, preloads, nil, forUpdate); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FirstMissionStore(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, forUpdate bool) (*models.MissionStore, error) { var m models.MissionStore if err := d.first(tx, &m, filters, preloads, nil, forUpdate); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FindMissionStore(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, offset int, limit int) ([]*models.MissionStore, error) { var ms []*models.MissionStore if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, err } return ms, nil } func (d *DAO) FindMissionStore4Page(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.MissionStore, uint, error) { var ( offset = (page - 1) * limit ) var ms []*models.MissionStore if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, 0, errs.NewError(err) } c, err := d.count(tx, &models.MissionStore{}, filters) if err != nil { return nil, 0, errs.NewError(err) } return ms, c, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/daos/mission_store_history.go ================================================ package daos import ( "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/jinzhu/gorm" ) func (d *DAO) FindMissionStoreHistoryJoinSelect(tx *gorm.DB, selected []string, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.MissionStoreHistory, error) { var ms []*models.MissionStoreHistory err := d.findJoinSelect(tx, &models.MissionStoreHistory{}, &ms, selected, joins, filters, preloads, orders, uint(page), uint(limit), false) if err != nil { return nil, errs.NewError(err) } return ms, nil } func (d *DAO) FindMissionStoreHistoryJoinSelect4Page(tx *gorm.DB, selected []string, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.MissionStoreHistory, uint, error) { var ms []*models.MissionStoreHistory c, err := d.findJoinSelect4Page(tx, &models.MissionStoreHistory{}, &ms, selected, joins, filters, preloads, orders, uint(page), uint(limit), false) if err != nil { return nil, 0, errs.NewError(err) } return ms, c, nil } func (d *DAO) FirstMissionStoreHistoryJoinSelect(tx *gorm.DB, selected []string, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, forUpdate bool) (*models.MissionStoreHistory, error) { var m models.MissionStoreHistory if err := d.firstJoinSelect(tx, &m, selected, joins, filters, preloads, nil, forUpdate); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FirstMissionStoreHistoryByID(tx *gorm.DB, id uint, preloads map[string][]interface{}, forUpdate bool) (*models.MissionStoreHistory, error) { var m models.MissionStoreHistory if err := d.first(tx, &m, map[string][]interface{}{"id = ?": []interface{}{id}}, preloads, nil, forUpdate); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FirstMissionStoreHistory(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, forUpdate bool) (*models.MissionStoreHistory, error) { var m models.MissionStoreHistory if err := d.first(tx, &m, filters, preloads, nil, forUpdate); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FindMissionStoreHistory(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, offset int, limit int) ([]*models.MissionStoreHistory, error) { var ms []*models.MissionStoreHistory if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, err } return ms, nil } func (d *DAO) FindMissionStoreHistory4Page(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.MissionStoreHistory, uint, error) { var ( offset = (page - 1) * limit ) var ms []*models.MissionStoreHistory if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, 0, errs.NewError(err) } c, err := d.count(tx, &models.MissionStoreHistory{}, filters) if err != nil { return nil, 0, errs.NewError(err) } return ms, c, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/daos/mission_store_rating.go ================================================ package daos import ( "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/jinzhu/gorm" ) func (d *DAO) FindMissionStoreRatingJoinSelect(tx *gorm.DB, selected []string, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.MissionStoreRating, error) { var ms []*models.MissionStoreRating err := d.findJoinSelect(tx, &models.MissionStoreRating{}, &ms, selected, joins, filters, preloads, orders, uint(page), uint(limit), false) if err != nil { return nil, errs.NewError(err) } return ms, nil } func (d *DAO) FindMissionStoreRatingJoinSelect4Page(tx *gorm.DB, selected []string, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.MissionStoreRating, uint, error) { var ms []*models.MissionStoreRating c, err := d.findJoinSelect4Page(tx, &models.MissionStoreRating{}, &ms, selected, joins, filters, preloads, orders, uint(page), uint(limit), false) if err != nil { return nil, 0, errs.NewError(err) } return ms, c, nil } func (d *DAO) FirstMissionStoreRatingJoinSelect(tx *gorm.DB, selected []string, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, forUpdate bool) (*models.MissionStoreRating, error) { var m models.MissionStoreRating if err := d.firstJoinSelect(tx, &m, selected, joins, filters, preloads, nil, forUpdate); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FirstMissionStoreRatingByID(tx *gorm.DB, id uint, preloads map[string][]interface{}, forUpdate bool) (*models.MissionStoreRating, error) { var m models.MissionStoreRating if err := d.first(tx, &m, map[string][]interface{}{"id = ?": []interface{}{id}}, preloads, nil, forUpdate); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FirstMissionStoreRating(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, forUpdate bool) (*models.MissionStoreRating, error) { var m models.MissionStoreRating if err := d.first(tx, &m, filters, preloads, nil, forUpdate); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FindMissionStoreRating(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, offset int, limit int) ([]*models.MissionStoreRating, error) { var ms []*models.MissionStoreRating if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, err } return ms, nil } func (d *DAO) FindMissionStoreRating4Page(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.MissionStoreRating, uint, error) { var ( offset = (page - 1) * limit ) var ms []*models.MissionStoreRating if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, 0, errs.NewError(err) } c, err := d.count(tx, &models.MissionStoreRating{}, filters) if err != nil { return nil, 0, errs.NewError(err) } return ms, c, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/daos/model_market.go ================================================ package daos import ( "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/jinzhu/gorm" ) func (d *DAO) FindModelMarketJoinSelect(tx *gorm.DB, selected []string, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.ModelMarket, error) { var ms []*models.ModelMarket err := d.findJoinSelect(tx, &models.ModelMarket{}, &ms, selected, joins, filters, preloads, orders, uint(page), uint(limit), false) if err != nil { return nil, errs.NewError(err) } return ms, nil } func (d *DAO) FindModelMarketJoinSelect4Page(tx *gorm.DB, selected []string, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.ModelMarket, uint, error) { var ms []*models.ModelMarket c, err := d.findJoinSelect4Page(tx, &models.ModelMarket{}, &ms, selected, joins, filters, preloads, orders, uint(page), uint(limit), false) if err != nil { return nil, 0, errs.NewError(err) } return ms, c, nil } func (d *DAO) FirstModelMarketJoinSelect(tx *gorm.DB, selected []string, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, forUpdate bool) (*models.ModelMarket, error) { var m models.ModelMarket if err := d.firstJoinSelect(tx, &m, selected, joins, filters, preloads, nil, forUpdate); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FirstModelMarketByID(tx *gorm.DB, id uint, preloads map[string][]interface{}, forUpdate bool) (*models.ModelMarket, error) { var m models.ModelMarket if err := d.first(tx, &m, map[string][]interface{}{"id = ?": []interface{}{id}}, preloads, nil, forUpdate); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FirstModelMarket(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, forUpdate bool) (*models.ModelMarket, error) { var m models.ModelMarket if err := d.first(tx, &m, filters, preloads, nil, forUpdate); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FindModelMarket(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, offset int, limit int) ([]*models.ModelMarket, error) { var ms []*models.ModelMarket if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, err } return ms, nil } func (d *DAO) FindModelMarket4Page(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.ModelMarket, uint, error) { var ( offset = (page - 1) * limit ) var ms []*models.ModelMarket if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, 0, errs.NewError(err) } c, err := d.count(tx, &models.ModelMarket{}, filters) if err != nil { return nil, 0, errs.NewError(err) } return ms, c, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/daos/model_predict_history.go ================================================ package daos import ( "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/jinzhu/gorm" ) func (d *DAO) FindModelPredictHistoryJoinSelect(tx *gorm.DB, selected []string, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.ModelPredictHistory, error) { var ms []*models.ModelPredictHistory err := d.findJoinSelect(tx, &models.ModelPredictHistory{}, &ms, selected, joins, filters, preloads, orders, uint(page), uint(limit), false) if err != nil { return nil, errs.NewError(err) } return ms, nil } func (d *DAO) FindModelPredictHistoryJoinSelect4Page(tx *gorm.DB, selected []string, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.ModelPredictHistory, uint, error) { var ms []*models.ModelPredictHistory c, err := d.findJoinSelect4Page(tx, &models.ModelPredictHistory{}, &ms, selected, joins, filters, preloads, orders, uint(page), uint(limit), false) if err != nil { return nil, 0, errs.NewError(err) } return ms, c, nil } func (d *DAO) FirstModelPredictHistoryJoinSelect(tx *gorm.DB, selected []string, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, forUpdate bool) (*models.ModelPredictHistory, error) { var m models.ModelPredictHistory if err := d.firstJoinSelect(tx, &m, selected, joins, filters, preloads, nil, forUpdate); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FirstModelPredictHistoryByID(tx *gorm.DB, id uint, preloads map[string][]interface{}, forUpdate bool) (*models.ModelPredictHistory, error) { var m models.ModelPredictHistory if err := d.first(tx, &m, map[string][]interface{}{"id = ?": []interface{}{id}}, preloads, nil, forUpdate); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FirstModelPredictHistory(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, forUpdate bool) (*models.ModelPredictHistory, error) { var m models.ModelPredictHistory if err := d.first(tx, &m, filters, preloads, nil, forUpdate); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FindModelPredictHistory(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, offset int, limit int) ([]*models.ModelPredictHistory, error) { var ms []*models.ModelPredictHistory if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, err } return ms, nil } func (d *DAO) FindModelPredictHistory4Page(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.ModelPredictHistory, uint, error) { var ( offset = (page - 1) * limit ) var ms []*models.ModelPredictHistory if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, 0, errs.NewError(err) } c, err := d.count(tx, &models.ModelPredictHistory{}, filters) if err != nil { return nil, 0, errs.NewError(err) } return ms, c, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/daos/robot_dao.go ================================================ package daos import ( "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/jinzhu/gorm" ) func (d *DAO) FirstRobotSaleWallet(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string) (*models.RobotSaleWallet, error) { var m models.RobotSaleWallet if err := d.first(tx, &m, filters, preloads, orders, false); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FindRobotSaleWallet(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, offset int, limit int) ([]*models.RobotSaleWallet, error) { var ms []*models.RobotSaleWallet if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, err } return ms, nil } func (d *DAO) FindRobotSaleWallet4Page(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.RobotSaleWallet, error) { var ( offset = (page - 1) * limit ) var ms []*models.RobotSaleWallet if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, errs.NewError(err) } return ms, nil } func (d *DAO) FindRobotSaleWalletJoinSelect(tx *gorm.DB, selected []string, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.RobotSaleWallet, error) { var ms []*models.RobotSaleWallet err := d.findJoinSelect(tx, &models.RobotSaleWallet{}, &ms, selected, joins, filters, preloads, orders, uint(page), uint(limit), false) if err != nil { return nil, errs.NewError(err) } return ms, nil } func (d *DAO) FirstRobotSaleWalletByID(tx *gorm.DB, id uint, preloads map[string][]interface{}, forUpdate bool) (*models.RobotSaleWallet, error) { var m models.RobotSaleWallet if err := d.first(tx, &m, map[string][]interface{}{"id = ?": []interface{}{id}}, preloads, nil, forUpdate); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FirstRobotProject(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string) (*models.RobotProject, error) { var m models.RobotProject if err := d.first(tx, &m, filters, preloads, orders, false); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FirstRobotProjectByID(tx *gorm.DB, id uint, preloads map[string][]interface{}, forUpdate bool) (*models.RobotProject, error) { var m models.RobotProject if err := d.first(tx, &m, map[string][]interface{}{"id = ?": []interface{}{id}}, preloads, nil, forUpdate); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FindRobotProject(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, offset int, limit int) ([]*models.RobotProject, error) { var ms []*models.RobotProject if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, err } return ms, nil } func (d *DAO) UpdatePrijectTotalBalance(tx *gorm.DB, projectID string) error { err := tx.Exec(` update robot_projects join ( select project_id, sum(sol_balance) sol_balance from robot_sale_wallets rsw where project_id = ? group by project_id ) tmp on robot_projects.project_id = tmp.project_id set total_balance= tmp.sol_balance where robot_projects.project_id = ? `, projectID, projectID).Error return err } func (d *DAO) UpdateRobotProjectRanking(tx *gorm.DB, projectID string) error { _ = tx.Exec(` UPDATE robot_sale_wallets AS rsw JOIN ( SELECT id, RANK() OVER (ORDER BY sol_balance DESC, id) AS ranking FROM robot_sale_wallets WHERE sol_balance > 0 AND project_id = ? ) AS tmp ON rsw.id = tmp.id SET rsw.ranking = tmp.ranking WHERE rsw.sol_balance > 0 AND rsw.project_id = ? `, projectID, projectID).Error return nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/daos/sample_twiiter_app.go ================================================ package daos import ( "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/jinzhu/gorm" ) func (d *DAO) FirstSampleTwitterAppByID(tx *gorm.DB, id uint, preloads map[string][]interface{}, forUpdate bool) (*models.SampleTwitterApp, error) { var m models.SampleTwitterApp if err := d.first(tx, &m, map[string][]interface{}{"id = ?": []interface{}{id}}, preloads, nil, forUpdate); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FirstSampleTwitterApp(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string) (*models.SampleTwitterApp, error) { var m models.SampleTwitterApp if err := d.first(tx, &m, filters, preloads, orders, false); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FindSampleTwitterApp(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, offset int, limit int) ([]*models.SampleTwitterApp, error) { var ms []*models.SampleTwitterApp if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, err } return ms, nil } func (d *DAO) FindSampleTwitterApp4Page(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.SampleTwitterApp, uint, error) { var ( offset = (page - 1) * limit ) var ms []*models.SampleTwitterApp if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, 0, errs.NewError(err) } c, err := d.count(tx, &models.SampleTwitterApp{}, filters) if err != nil { return nil, 0, errs.NewError(err) } return ms, c, nil } func (d *DAO) FindSampleTwitterAppJoinSelect(tx *gorm.DB, selected []string, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.SampleTwitterApp, error) { var ms []*models.SampleTwitterApp err := d.findJoinSelect(tx, &models.SampleTwitterApp{}, &ms, selected, joins, filters, preloads, orders, uint(page), uint(limit), false) if err != nil { return nil, errs.NewError(err) } return ms, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/daos/store_trading_app.go ================================================ package daos import ( "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/jinzhu/gorm" ) func (d *DAO) FirstStoreDefiAppByID(tx *gorm.DB, id uint, preloads map[string][]interface{}, forUpdate bool) (*models.StoreDefiApp, error) { var m models.StoreDefiApp if err := d.first(tx, &m, map[string][]interface{}{"id = ?": []interface{}{id}}, preloads, nil, forUpdate); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FirstStoreDefiApp(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string) (*models.StoreDefiApp, error) { var m models.StoreDefiApp if err := d.first(tx, &m, filters, preloads, orders, false); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FindStoreDefiApp(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, offset int, limit int) ([]*models.StoreDefiApp, error) { var ms []*models.StoreDefiApp if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, err } return ms, nil } func (d *DAO) FindStoreDefiApp4Page(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.StoreDefiApp, uint, error) { var ( offset = (page - 1) * limit ) var ms []*models.StoreDefiApp if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, 0, errs.NewError(err) } c, err := d.count(tx, &models.StoreDefiApp{}, filters) if err != nil { return nil, 0, errs.NewError(err) } return ms, c, nil } func (d *DAO) FindStoreDefiAppJoinSelect(tx *gorm.DB, selected []string, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.StoreDefiApp, error) { var ms []*models.StoreDefiApp err := d.findJoinSelect(tx, &models.StoreDefiApp{}, &ms, selected, joins, filters, preloads, orders, uint(page), uint(limit), false) if err != nil { return nil, errs.NewError(err) } return ms, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/daos/training_request.go ================================================ package daos import ( "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/jinzhu/gorm" ) func (d *DAO) FindTrainingRequestJoinSelect(tx *gorm.DB, selected []string, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.TrainingRequest, error) { var ms []*models.TrainingRequest err := d.findJoinSelect(tx, &models.TrainingRequest{}, &ms, selected, joins, filters, preloads, orders, uint(page), uint(limit), false) if err != nil { return nil, errs.NewError(err) } return ms, nil } func (d *DAO) FindTrainingRequestJoinSelect4Page(tx *gorm.DB, selected []string, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.TrainingRequest, uint, error) { var ms []*models.TrainingRequest c, err := d.findJoinSelect4Page(tx, &models.TrainingRequest{}, &ms, selected, joins, filters, preloads, orders, uint(page), uint(limit), false) if err != nil { return nil, 0, errs.NewError(err) } return ms, c, nil } func (d *DAO) FirstTrainingRequestJoinSelect(tx *gorm.DB, selected []string, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, forUpdate bool) (*models.TrainingRequest, error) { var m models.TrainingRequest if err := d.firstJoinSelect(tx, &m, selected, joins, filters, preloads, nil, forUpdate); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FirstTrainingRequestByID(tx *gorm.DB, id uint, preloads map[string][]interface{}, forUpdate bool) (*models.TrainingRequest, error) { var m models.TrainingRequest if err := d.first(tx, &m, map[string][]interface{}{"id = ?": []interface{}{id}}, preloads, nil, forUpdate); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FirstTrainingRequest(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, forUpdate bool) (*models.TrainingRequest, error) { var m models.TrainingRequest if err := d.first(tx, &m, filters, preloads, nil, forUpdate); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FindTrainingRequest(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, offset int, limit int) ([]*models.TrainingRequest, error) { var ms []*models.TrainingRequest if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, err } return ms, nil } func (d *DAO) FindTrainingRequest4Page(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.TrainingRequest, uint, error) { var ( offset = (page - 1) * limit ) var ms []*models.TrainingRequest if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, 0, errs.NewError(err) } c, err := d.count(tx, &models.TrainingRequest{}, filters) if err != nil { return nil, 0, errs.NewError(err) } return ms, c, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/daos/training_request_erc20_info.go ================================================ package daos import ( "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/jinzhu/gorm" ) func (d *DAO) FindTrainingRequestERC20InfoJoinSelect(tx *gorm.DB, selected []string, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.TrainingRequestERC20Info, error) { var ms []*models.TrainingRequestERC20Info err := d.findJoinSelect(tx, &models.TrainingRequestERC20Info{}, &ms, selected, joins, filters, preloads, orders, uint(page), uint(limit), false) if err != nil { return nil, errs.NewError(err) } return ms, nil } func (d *DAO) FindTrainingRequestERC20InfoJoinSelect4Page(tx *gorm.DB, selected []string, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.TrainingRequestERC20Info, uint, error) { var ms []*models.TrainingRequestERC20Info c, err := d.findJoinSelect4Page(tx, &models.TrainingRequestERC20Info{}, &ms, selected, joins, filters, preloads, orders, uint(page), uint(limit), false) if err != nil { return nil, 0, errs.NewError(err) } return ms, c, nil } func (d *DAO) FirstTrainingRequestERC20InfoJoinSelect(tx *gorm.DB, selected []string, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, forUpdate bool) (*models.TrainingRequestERC20Info, error) { var m models.TrainingRequestERC20Info if err := d.firstJoinSelect(tx, &m, selected, joins, filters, preloads, nil, forUpdate); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FirstTrainingRequestERC20InfoByID(tx *gorm.DB, id uint, preloads map[string][]interface{}, forUpdate bool) (*models.TrainingRequestERC20Info, error) { var m models.TrainingRequestERC20Info if err := d.first(tx, &m, map[string][]interface{}{"id = ?": []interface{}{id}}, preloads, nil, forUpdate); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FirstTrainingRequestERC20Info(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, forUpdate bool) (*models.TrainingRequestERC20Info, error) { var m models.TrainingRequestERC20Info if err := d.first(tx, &m, filters, preloads, nil, forUpdate); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FindTrainingRequestERC20Info(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, offset int, limit int) ([]*models.TrainingRequestERC20Info, error) { var ms []*models.TrainingRequestERC20Info if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, err } return ms, nil } func (d *DAO) FindTrainingRequestERC20Info4Page(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.TrainingRequestERC20Info, uint, error) { var ( offset = (page - 1) * limit ) var ms []*models.TrainingRequestERC20Info if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, 0, errs.NewError(err) } c, err := d.count(tx, &models.TrainingRequestERC20Info{}, filters) if err != nil { return nil, 0, errs.NewError(err) } return ms, c, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/daos/twitter_following.go ================================================ package daos import ( "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/jinzhu/gorm" ) func (d *DAO) FirstTwitterFollowingByID(tx *gorm.DB, id uint, preloads map[string][]interface{}, forUpdate bool) (*models.TwitterFollowing, error) { var m models.TwitterFollowing if err := d.first(tx, &m, map[string][]interface{}{"id = ?": []interface{}{id}}, preloads, nil, forUpdate); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FirstTwitterFollowing(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string) (*models.TwitterFollowing, error) { var m models.TwitterFollowing if err := d.first(tx, &m, filters, preloads, orders, false); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FindTwitterFollowing(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, offset int, limit int) ([]*models.TwitterFollowing, error) { var ms []*models.TwitterFollowing if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, err } return ms, nil } func (d *DAO) FindTwitterFollowing4Page(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.TwitterFollowing, uint, error) { var ( offset = (page - 1) * limit ) var ms []*models.TwitterFollowing if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, 0, errs.NewError(err) } c, err := d.count(tx, &models.TwitterFollowing{}, filters) if err != nil { return nil, 0, errs.NewError(err) } return ms, c, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/daos/twitter_post.go ================================================ package daos import ( "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/jinzhu/gorm" ) func (d *DAO) FirstTwitterPostByID(tx *gorm.DB, id uint, preloads map[string][]interface{}, forUpdate bool) (*models.TwitterPost, error) { var m models.TwitterPost if err := d.first(tx, &m, map[string][]interface{}{"id = ?": []interface{}{id}}, preloads, nil, forUpdate); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FirstTwitterPost(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string) (*models.TwitterPost, error) { var m models.TwitterPost if err := d.first(tx, &m, filters, preloads, orders, false); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FindTwitterPost(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, offset int, limit int) ([]*models.TwitterPost, error) { var ms []*models.TwitterPost if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, err } return ms, nil } func (d *DAO) FindTwitterPost4Page(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.TwitterPost, uint, error) { var ( offset = (page - 1) * limit ) var ms []*models.TwitterPost if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, 0, errs.NewError(err) } c, err := d.count(tx, &models.TwitterPost{}, filters) if err != nil { return nil, 0, errs.NewError(err) } return ms, c, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/daos/twitter_tweet.go ================================================ package daos import ( "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/jinzhu/gorm" ) func (d *DAO) FirstTwitterTweetByID(tx *gorm.DB, id uint, preloads map[string][]interface{}, forUpdate bool) (*models.TwitterTweet, error) { var m models.TwitterTweet if err := d.first(tx, &m, map[string][]interface{}{"id = ?": []interface{}{id}}, preloads, nil, forUpdate); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FirstTwitterTweet(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string) (*models.TwitterTweet, error) { var m models.TwitterTweet if err := d.first(tx, &m, filters, preloads, orders, false); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FindTwitterTweet(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, offset int, limit int) ([]*models.TwitterTweet, error) { var ms []*models.TwitterTweet if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, err } return ms, nil } func (d *DAO) FindTwitterTweet4Page(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.TwitterTweet, uint, error) { var ( offset = (page - 1) * limit ) var ms []*models.TwitterTweet if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, 0, errs.NewError(err) } c, err := d.count(tx, &models.TwitterTweet{}, filters) if err != nil { return nil, 0, errs.NewError(err) } return ms, c, nil } func (d *DAO) GetListTwitterScan(tx *gorm.DB) ([]string, error) { var rs []struct { Username string } query := tx.Raw(` select distinct username from ( select twitter_username username from agent_infos where agent_type = 1 and scan_enabled = 1 and agent_contract_id != '' and twitter_info_id > 0 and eai_balance >= 0.1 union select twitter_username username from twitter_followings ) rs order by rand() `) if err := query.Scan(&rs).Error; err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, errs.NewError(err) } // Extract usernames into a slice of strings usernames := make([]string, len(rs)) for i, record := range rs { usernames[i] = record.Username } return usernames, nil } func (d *DAO) GetListTwitterMentionsScan(tx *gorm.DB) ([]string, error) { var rs []struct { Username string } query := tx.Raw(` select username from twitter_scans where enabled = 1 and is_mention=1 and scanned = 0 `) if err := query.Scan(&rs).Error; err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, errs.NewError(err) } // Extract usernames into a slice of strings usernames := make([]string, len(rs)) for i, record := range rs { usernames[i] = record.Username } return usernames, nil } func (d *DAO) GetListTwitterDefaultFollow(tx *gorm.DB) ([]string, error) { var rs []struct { ID string } query := tx.Raw(` select twitter_id id from twitter_scans where enabled = 1 and is_mention=0 order by id asc `) if err := query.Scan(&rs).Error; err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, errs.NewError(err) } ids := make([]string, len(rs)) for i, record := range rs { ids[i] = record.ID } return ids, nil } func (d *DAO) IsTweetReplied(tx *gorm.DB, tweetID string) (bool, error) { var rs []struct { ID string } query := tx.Raw(` select tweetid id from agent_snapshot_post_actions aspa where 1=1 and status ='done' and type = 'reply' and tweetid = ? `, tweetID) if err := query.Scan(&rs).Error; err != nil { if err == gorm.ErrRecordNotFound { return false, nil } return false, errs.NewError(err) } if len(rs) > 0 { return true, nil } return false, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/daos/twitter_tweet_liked.go ================================================ package daos import ( "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/jinzhu/gorm" ) func (d *DAO) FirstTwitterTweetLikedByID(tx *gorm.DB, id uint, preloads map[string][]interface{}, forUpdate bool) (*models.TwitterTweetLiked, error) { var m models.TwitterTweetLiked if err := d.first(tx, &m, map[string][]interface{}{"id = ?": []interface{}{id}}, preloads, nil, forUpdate); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FirstTwitterTweetLiked(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string) (*models.TwitterTweetLiked, error) { var m models.TwitterTweetLiked if err := d.first(tx, &m, filters, preloads, orders, false); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FindTwitterTweetLiked(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, offset int, limit int) ([]*models.TwitterTweetLiked, error) { var ms []*models.TwitterTweetLiked if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, err } return ms, nil } func (d *DAO) FindTwitterTweetLiked4Page(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.TwitterTweetLiked, uint, error) { var ( offset = (page - 1) * limit ) var ms []*models.TwitterTweetLiked if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, 0, errs.NewError(err) } c, err := d.count(tx, &models.TwitterTweetLiked{}, filters) if err != nil { return nil, 0, errs.NewError(err) } return ms, c, nil } func (d *DAO) FindTwitterTweetLikedJoinSelect(tx *gorm.DB, selected []string, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.TwitterTweetLiked, error) { var ms []*models.TwitterTweetLiked err := d.findJoinSelect(tx, &models.TwitterTweetLiked{}, &ms, selected, joins, filters, preloads, orders, uint(page), uint(limit), false) if err != nil { return nil, errs.NewError(err) } return ms, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/daos/twitter_user.go ================================================ package daos import ( "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/jinzhu/gorm" ) func (d *DAO) FirstTwitterUserByID(tx *gorm.DB, id uint, preloads map[string][]interface{}, forUpdate bool) (*models.TwitterUser, error) { var m models.TwitterUser if err := d.first(tx, &m, map[string][]interface{}{"id = ?": []interface{}{id}}, preloads, nil, forUpdate); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FirstTwitterUser(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string) (*models.TwitterUser, error) { var m models.TwitterUser if err := d.first(tx, &m, filters, preloads, orders, false); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FindTwitterUser(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, offset int, limit int) ([]*models.TwitterUser, error) { var ms []*models.TwitterUser if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, err } return ms, nil } func (d *DAO) FindTwitterUser4Page(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.TwitterUser, uint, error) { var ( offset = (page - 1) * limit ) var ms []*models.TwitterUser if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, 0, errs.NewError(err) } c, err := d.count(tx, &models.TwitterUser{}, filters) if err != nil { return nil, 0, errs.NewError(err) } return ms, c, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/daos/user_dao.go ================================================ package daos import ( "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/jinzhu/gorm" ) func (d *DAO) FindUserJoinSelect(tx *gorm.DB, selected []string, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.User, error) { var ms []*models.User err := d.findJoinSelect(tx, &models.User{}, &ms, selected, joins, filters, preloads, orders, uint(page), uint(limit), false) if err != nil { return nil, errs.NewError(err) } return ms, nil } func (d *DAO) FindUserJoinSelect4Page(tx *gorm.DB, selected []string, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.User, uint, error) { var ms []*models.User c, err := d.findJoinSelect4Page(tx, &models.User{}, &ms, selected, joins, filters, preloads, orders, uint(page), uint(limit), false) if err != nil { return nil, 0, errs.NewError(err) } return ms, c, nil } func (d *DAO) FirstUserJoinSelect(tx *gorm.DB, selected []string, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, forUpdate bool) (*models.User, error) { var m models.User if err := d.firstJoinSelect(tx, &m, selected, joins, filters, preloads, nil, forUpdate); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FirstUserByID(tx *gorm.DB, id uint, preloads map[string][]interface{}, forUpdate bool) (*models.User, error) { var m models.User if err := d.first(tx, &m, map[string][]interface{}{"id = ?": []interface{}{id}}, preloads, nil, forUpdate); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FirstUser(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, forUpdate bool) (*models.User, error) { var m models.User if err := d.first(tx, &m, filters, preloads, nil, forUpdate); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FindUser(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, offset int, limit int) ([]*models.User, error) { var ms []*models.User if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, err } return ms, nil } func (d *DAO) FindUser4Page(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.User, uint, error) { var ( offset = (page - 1) * limit ) var ms []*models.User if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, 0, errs.NewError(err) } c, err := d.count(tx, &models.User{}, filters) if err != nil { return nil, 0, errs.NewError(err) } return ms, c, nil } func (d *DAO) FirstAuthCode(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, forUpdate bool) (*models.AuthCode, error) { var m models.AuthCode if err := d.first(tx, &m, filters, preloads, nil, forUpdate); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FindErc20HolderJoinSelect(tx *gorm.DB, selected []string, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.Erc20Holder, error) { var ms []*models.Erc20Holder err := d.findJoinSelect(tx, &models.User{}, &ms, selected, joins, filters, preloads, orders, uint(page), uint(limit), false) if err != nil { return nil, errs.NewError(err) } return ms, nil } func (d *DAO) FindTokenHolderJoinSelect(tx *gorm.DB, selected []string, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.TokenHolder, error) { var ms []*models.TokenHolder err := d.findJoinSelect(tx, &models.User{}, &ms, selected, joins, filters, preloads, orders, uint(page), uint(limit), false) if err != nil { return nil, errs.NewError(err) } return ms, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/daos/user_transaction.go ================================================ package daos import ( "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/jinzhu/gorm" ) func (d *DAO) FirstUserTransactionByID(tx *gorm.DB, id uint, preloads map[string][]interface{}, forUpdate bool) (*models.UserTransaction, error) { var m models.UserTransaction if err := d.first(tx, &m, map[string][]interface{}{"id = ?": []interface{}{id}}, preloads, nil, forUpdate); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FirstUserTransaction(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string) (*models.UserTransaction, error) { var m models.UserTransaction if err := d.first(tx, &m, filters, preloads, orders, false); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FindUserTransaction(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, offset int, limit int) ([]*models.UserTransaction, error) { var ms []*models.UserTransaction if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, err } return ms, nil } func (d *DAO) FindUserTransaction4Page(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.UserTransaction, uint, error) { var ( offset = (page - 1) * limit ) var ms []*models.UserTransaction if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, 0, errs.NewError(err) } c, err := d.count(tx, &models.UserTransaction{}, filters) if err != nil { return nil, 0, errs.NewError(err) } return ms, c, nil } func (d *DAO) FindUserTransactionJoinSelect(tx *gorm.DB, selected []string, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.UserTransaction, error) { var ms []*models.UserTransaction err := d.findJoinSelect(tx, &models.UserTransaction{}, &ms, selected, joins, filters, preloads, orders, uint(page), uint(limit), false) if err != nil { return nil, errs.NewError(err) } return ms, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/daos/vibe.go ================================================ package daos import ( "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/jinzhu/gorm" ) func (d *DAO) FirstVibeReferralCode(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string) (*models.VibeReferralCode, error) { var m models.VibeReferralCode if err := d.first(tx, &m, filters, preloads, orders, false); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FirstVibeReferralCodeByID(tx *gorm.DB, id uint, preloads map[string][]interface{}, forUpdate bool) (*models.VibeReferralCode, error) { var m models.VibeReferralCode if err := d.first(tx, &m, map[string][]interface{}{"id = ?": []interface{}{id}}, preloads, nil, forUpdate); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) AgentUserComment4Page(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.AgentUserComment, error) { offset := (page - 1) * limit var ms []*models.AgentUserComment if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, errs.NewError(err) } return ms, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/daos/zk_sync_network.go ================================================ package daos import ( "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/jinzhu/gorm" ) func (d *DAO) FindZkSyncNetworkJoinSelect(tx *gorm.DB, selected []string, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.ZkSyncNetwork, error) { var ms []*models.ZkSyncNetwork err := d.findJoinSelect(tx, &models.ZkSyncNetwork{}, &ms, selected, joins, filters, preloads, orders, uint(page), uint(limit), false) if err != nil { return nil, errs.NewError(err) } return ms, nil } func (d *DAO) FindZkSyncNetworkJoinSelect4Page(tx *gorm.DB, selected []string, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.ZkSyncNetwork, uint, error) { var ms []*models.ZkSyncNetwork c, err := d.findJoinSelect4Page(tx, &models.ZkSyncNetwork{}, &ms, selected, joins, filters, preloads, orders, uint(page), uint(limit), false) if err != nil { return nil, 0, errs.NewError(err) } return ms, c, nil } func (d *DAO) FirstZkSyncNetworkJoinSelect(tx *gorm.DB, selected []string, joins map[string][]interface{}, filters map[string][]interface{}, preloads map[string][]interface{}, forUpdate bool) (*models.ZkSyncNetwork, error) { var m models.ZkSyncNetwork if err := d.firstJoinSelect(tx, &m, selected, joins, filters, preloads, nil, forUpdate); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FirstZkSyncNetworkByID(tx *gorm.DB, id uint, preloads map[string][]interface{}, forUpdate bool) (*models.ZkSyncNetwork, error) { var m models.ZkSyncNetwork if err := d.first(tx, &m, map[string][]interface{}{"id = ?": []interface{}{id}}, preloads, nil, forUpdate); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FirstZkSyncNetwork(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, forUpdate bool) (*models.ZkSyncNetwork, error) { var m models.ZkSyncNetwork if err := d.first(tx, &m, filters, preloads, nil, forUpdate); err != nil { if err == gorm.ErrRecordNotFound { return nil, nil } return nil, err } return &m, nil } func (d *DAO) FindZkSyncNetwork(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, offset int, limit int) ([]*models.ZkSyncNetwork, error) { var ms []*models.ZkSyncNetwork if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, err } return ms, nil } func (d *DAO) FindZkSyncNetwork4Page(tx *gorm.DB, filters map[string][]interface{}, preloads map[string][]interface{}, orders []string, page int, limit int) ([]*models.ZkSyncNetwork, uint, error) { var ( offset = (page - 1) * limit ) var ms []*models.ZkSyncNetwork if err := d.find(tx, &ms, filters, preloads, orders, offset, limit, false); err != nil { return nil, 0, errs.NewError(err) } c, err := d.count(tx, &models.ZkSyncNetwork{}, filters) if err != nil { return nil, 0, errs.NewError(err) } return ms, c, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/databases/database.go ================================================ package databases import ( "sync" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/jinzhu/gorm" _ "github.com/jinzhu/gorm/dialects/mysql" _ "github.com/jinzhu/gorm/dialects/postgres" "github.com/pkg/errors" ) var ( dbMutex sync.Mutex dbMap map[string]*gorm.DB ) func init() { dbMap = map[string]*gorm.DB{} } func Init(dbURL string, migrateFunc func(db *gorm.DB) error, idleNum int, openNum int, debug bool) (*gorm.DB, error) { dbConn, err := gorm.Open("mysql", dbURL) if err != nil { return nil, errors.Wrap(err, "gorm.Open") } dbConn.LogMode(debug) dbConn = dbConn.Set("gorm:save_associations", false) dbConn = dbConn.Set("gorm:association_save_reference", false) dbConn.DB().SetMaxIdleConns(idleNum) dbConn.DB().SetMaxOpenConns(openNum) if migrateFunc != nil { func() { err = migrateFunc(dbConn) if err != nil { panic(err) } }() } return dbConn, nil } func MigrateDBMain(db *gorm.DB) error { allTables := []any{ (*models.BlockScanInfo)(nil), (*models.AppConfig)(nil), (*models.BTCL1InscribeTx)(nil), (*models.User)(nil), (*models.UserTransaction)(nil), (*models.Erc20Holder)(nil), (*models.Erc721Holder)(nil), (*models.Erc1155Holder)(nil), (*models.TwitterPost)(nil), (*models.TwitterInfo)(nil), (*models.AgentCategory)(nil), (*models.AgentInfo)(nil), (*models.AgentTwitterPost)(nil), (*models.UserTwitterPost)(nil), (*models.AgentTokenInfo)(nil), (*models.AgentTradeHistory)(nil), (*models.TokenPrice)(nil), (*models.TwitterTweet)(nil), (*models.AgentEaiTopup)(nil), (*models.AgentSnapshotPost)(nil), (*models.AgentSnapshotMission)(nil), (*models.AgentSnapshotPostAction)(nil), (*models.AuthCode)(nil), (*models.AgentWallet)(nil), (*models.AgentWalletAction)(nil), (*models.TwitterTweetLiked)(nil), (*models.ExternalWallet)(nil), (*models.ExternalWalletOrder)(nil), (*models.ExternalWalletToken)(nil), (*models.AgentChainFee)(nil), // meme (*models.Meme)(nil), (*models.MemeFeesCollected)(nil), (*models.ApiSubscriptionPackage)(nil), (*models.ApiSubscriptionKey)(nil), (*models.ApiSubscriptionHistory)(nil), (*models.ApiSubscriptionUsageLog)(nil), (*models.AgentSnapshotMissionConfigs)(nil), (*models.AgentTradeToken)(nil), (*models.AgentExternalInfo)(nil), (*models.AgentTeleMsg)(nil), (*models.BatchInferHistory)(nil), (*models.ChainConfig)(nil), (*models.TrainingRequestERC20Info)(nil), (*models.ZkSyncNetwork)(nil), (*models.TrainingRequest)(nil), (*models.ModelPredictHistory)(nil), (*models.ModelMarket)(nil), (*models.JobConfig)(nil), (*models.KnowledgeBase)(nil), (*models.KnowledgeBaseFile)(nil), (*models.AgentInfoKnowledgeBase)(nil), // missionstore (*models.MissionStore)(nil), (*models.MissionStoreRating)(nil), (*models.MissionStoreHistory)(nil), // launchpad (*models.Launchpad)(nil), (*models.LaunchpadMember)(nil), (*models.LaunchpadTransaction)(nil), (*models.AbilityLuckyMoney)(nil), // (*models.AgentStore)(nil), (*models.AgentStoreMission)(nil), (*models.AgentStoreInstall)(nil), (*models.AgentStoreLog)(nil), (*models.SampleTwitterApp)(nil), (*models.InfraTwitterApp)(nil), (*models.InfraTwitterTopupTx)(nil), (*models.StoreDefiApp)(nil), (*models.AgentStoreTry)(nil), (*models.AgentStoreTryDetail)(nil), (*models.AgentInfoInstall)(nil), (*models.AgentLibrary)(nil), (*models.AgentUtilityInstall)(nil), (*models.AgentUtilityRecentChat)(nil), (*models.ClankerVideoToken)(nil), (*models.AgentReactionHistory)(nil), (*models.PrivyWallet)(nil), (*models.RobotSaleWallet)(nil), (*models.RobotProject)(nil), (*models.RobotTokenTransfer)(nil), (*models.TrendingToken)(nil), (*models.VibeWhiteList)(nil), (*models.VibeReferralCode)(nil), (*models.AgentUserComment)(nil), } if err := db.AutoMigrate(allTables...).Error; err != nil { return err } return nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/errs/errors.go ================================================ package errs import ( "errors" "fmt" "os" "strings" "time" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/helpers" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/logger" "github.com/getsentry/raven-go" "go.uber.org/zap" ) var ( ErrInvalidApiKey = &Error{Code: -1000, Message: "Invalid API Key."} ErrSystemError = &Error{Code: -1001, Message: "Something went wrong. Please try again."} ErrInvalidCredentials = &Error{Code: -1002, Message: "Invalid credentials. Please try again"} ErrBadRequest = &Error{Code: -1003, Message: "Something went wrong. Please try again."} ErrBadContent = &Error{Code: -1004, Message: "Something went wrong. Please try again."} ErrInvalidRecaptcha = &Error{Code: -1005, Message: "Invalid reCAPTCHA. Please refresh the page and try again."} ErrPermissionDenied = &Error{Code: -1006, Message: "Something went wrong. Please try again."} ErrUserNotFound = &Error{Code: -1007, Message: "Something went wrong. Please try again."} ErrAuthorizationExistsed = &Error{Code: -1008, Message: "Something went wrong. Please try again."} ErrInvalidSignature = &Error{Code: -1009, Message: "Invalid signature. Please check your wallet address and try again."} ErrRecordNotFound = &Error{Code: -1010, Message: "Something went wrong. Please try again."} ErrTwitterIdNotFound = &Error{Code: -1011, Message: "Something went wrong. Please try again."} ErrRewardNotFound = &Error{Code: -1012, Message: "Something went wrong. Please try again."} ErrUnAuthorization = &Error{Code: -1013, Message: "Something went wrong. Please try again."} ErrInvalidRequest = &Error{Code: -1014, Message: "Invalid request. Please try again."} ErrInternalServerError = &Error{Code: -1015, Message: "Something went wrong. Please try again."} ErrAlreadyPurchase = &Error{Code: -2001, Message: "Already purchase apps. Please try again."} ErrAppNotFound = &Error{Code: -2002, Message: "Something went wrong. Please try again."} ErrPurchaseError = &Error{Code: -2003, Message: "Something went wrong. Please try again."} ErrInvalidOwner = &Error{Code: -2004, Message: "Invalid Owner. Please try again."} ErrAppNotInstalled = &Error{Code: -2005, Message: "This app haven't installed. Please try again."} ErrReferralCodeExistsed = &Error{Code: -2006, Message: "Something went wrong. Please try again."} ErrTokenNotFound = &Error{Code: -2007, Message: "Something went wrong. Please try again."} ErrNetworkNotFound = &Error{Code: -2008, Message: "Something went wrong. Please try again."} ErrTxHashExisted = &Error{Code: -2009, Message: "TxHash already existed"} ErrNameExisted = &Error{Code: -2010, Message: "Name already existed"} ErrUserNotExist = &Error{Code: -2008, Message: "Something went wrong. Please try again."} ErrBadBalance = &Error{Code: -2011, Message: "Insufficient balance. Please check your balance or open orders."} ErrQuestionDuplicate = &Error{Code: -2012, Message: "Question already existed. Please try again."} ErrPostExisted = &Error{Code: -2013, Message: "Post already existed. Please try again."} ErrAgentNotFound = &Error{Code: -2014, Message: "Agent Not Found"} ErrTwitterIDExistsed = &Error{Code: -2015, Message: "TwitterID Existsed"} ErrTwitterUsernameNotFound = &Error{Code: -2015, Message: "Twitter Username Not Found"} ErrInsufficientBalance = &Error{Code: -2016, Message: "Insufficient Balance"} ErrApiUrlNotHealth = &Error{Code: -2016, Message: "Api Url not Health"} ErrApiKeyRateLimited = &Error{Code: -2016, Message: "API Key rate limit"} ErrReferralCodeUsed = &Error{Code: -2017, Message: "Referral code already used"} ErrAgentUtilityNotAuthen = &Error{Code: -3000, Message: "Please authentican with this link and try again"} ErrAgentUtilityInvalidBalance = &Error{Code: -3001, Message: "Insufficient balance! You need at least 1 $EAI to proceed with address {address} in Base."} ErrAgentUtilityPostTweetFailed = &Error{Code: -3002, Message: "Post tweet failed. Please try again."} ErrAgentUtilitySystemError = &Error{Code: -3003, Message: "Something went wrong. Please try again."} ErrAgentUtilityNotFound = &Error{Code: -3004, Message: "Please authentican with this link and try again"} ) type Error struct { Code int `json:"code"` Message string `json:"message"` Trace string `json:"trace"` stacktrace string extra []interface{} } func (e *Error) SetStacktrace(stacktrace string) { e.Trace = stacktrace e.stacktrace = stacktrace } func (e *Error) Stacktrace() string { return e.stacktrace } func (e *Error) Error() string { return e.Message } func (e *Error) SetExtra(extra []interface{}) { e.extra = extra } func (e *Error) Extra() []interface{} { return e.extra } func (e *Error) ExtraJson() string { return helpers.ConvertJsonString(e.extra) } func NewErrorWithId(err error, id interface{}) error { if err != nil { msg := err.Error() err = NewError(err) err.(*Error).Message = fmt.Sprintf("%v : %s", id, msg) } return err } func NewError(err error, extras ...interface{}) error { if err == nil { return nil } _, ok := err.(*Error) if ok { sterr := err.(*Error).Stacktrace() retErr := &Error{ Code: err.(*Error).Code, Message: err.(*Error).Message, } if sterr == "" { retErr.SetStacktrace(fmt.Sprintf("%s\n\n%s", err.Error(), NewStacktraceString(extras...))) err.(*Error).SetExtra(extras) } else { retErr.SetStacktrace(sterr) } return retErr } retErr := &Error{ Code: ErrSystemError.Code, Message: err.Error(), } retErr.SetStacktrace(fmt.Sprintf("%s\n\n%s", err.Error(), NewStacktraceString(extras...))) return retErr } func NewTwitterError(err error, extras ...interface{}) error { return NewError(err, extras...) } func NewStacktraceString(extras ...interface{}) string { var rets []string if len(extras) > 0 { rets = append(rets, fmt.Sprintf("Extras -> %s", helpers.ConvertJsonString(extras))) } st := raven.NewStacktrace(1, 3, nil) for i := len(st.Frames) - 1; i >= 0; i-- { frame := st.Frames[i] if strings.TrimSpace(frame.Filename) != "" { rets = append(rets, fmt.Sprintf("%s\t%s\t%d", frame.Filename, frame.Function, frame.Lineno)) rets = append(rets, fmt.Sprintf("\t%s", strings.Join(frame.PreContext, "\n\t"))) rets = append(rets, fmt.Sprintf("%d.\t%s", frame.Lineno, frame.ContextLine)) rets = append(rets, fmt.Sprintf("\t%s", strings.Join(frame.PostContext, "\n\t"))) } } return strings.Join(rets, "\n") } func MergeError(err1 error, errss ...error) error { var msgs, sterrs []string if err1 != nil { err1 = NewError(err1) _, ok := err1.(*Error) if ok { msgs = append(msgs, strings.TrimSpace(err1.Error())) sterrs = append(sterrs, err1.(*Error).Stacktrace(), ) } } for _, err := range errss { if err != nil { err = NewError(err) _, ok := err.(*Error) if ok { msgs = append(msgs, strings.TrimSpace(err.Error())) sterrs = append(sterrs, fmt.Sprintf( "------------------------------------------------------------------------------------------------------------------------------------\n\n%s\n\n%s", strings.TrimSpace(err.Error()), err.(*Error).Stacktrace()), ) } } } if len(msgs) <= 0 { return nil } err := &Error{ Code: ErrSystemError.Code, Message: strings.Join(msgs, "\n"), } err.SetStacktrace( strings.Join( sterrs, "\n\n", ), ) return err } func LoggerFunc(fn func() error, path string, userID uint, email string, extras ...interface{}) { var err error start := time.Now() defer func() { end := time.Now() latency := end.Sub(start).Seconds() if rval := recover(); rval != nil { if rval := recover(); rval != nil { err = NewError(errors.New(fmt.Sprint(rval))) } } if path == "" { path = "default" } path = fmt.Sprintf("nft-marketet-api-fun-%s", path) var stacktrace, errText string errCode := 200 if err != nil { errCode = 400 err = NewError(err) errText = err.Error() retErr, ok := err.(*Error) if ok { stacktrace = retErr.Stacktrace() } } logger.Info( "logger_func_error", "msg info", zap.Any("referer", ""), zap.Any("ip", ""), zap.Any("method", "FUN"), zap.Any("path", path), zap.Any("raw_query", ""), zap.Any("latency", latency), zap.Any("status", errCode), zap.Any("user_agent", ""), zap.Any("platform", ""), zap.Any("os", ""), zap.Any("country", ""), zap.Any("email", email), zap.Any("user_id", userID), zap.Any("error_text", errText), zap.Any("stacktrace", stacktrace), zap.Any("body_request", helpers.ConvertJsonString(extras)), zap.Any("body_response", ""), ) if os.Getenv("DEV") == "true" { if stacktrace != "" { fmt.Println(stacktrace) } } }() err = fn() } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/go.mod ================================================ module github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend go 1.23.3 toolchain go1.23.8 require ( cloud.google.com/go/secretmanager v1.13.1 cloud.google.com/go/storage v1.43.0 github.com/PuerkitoBio/goquery v1.10.1 github.com/blockcypher/gobcy/v2 v2.0.5 github.com/btcsuite/btcd v0.24.2 github.com/btcsuite/btcd/btcec/v2 v2.3.4 github.com/btcsuite/btcd/btcutil v1.1.6 github.com/chromedp/cdproto v0.0.0-20250101192427-60a0ca35cb84 github.com/chromedp/chromedp v0.11.2 github.com/cosmos/cosmos-sdk v0.50.11 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc github.com/dghubble/oauth1 v0.7.3 github.com/ethereum/go-ethereum v1.14.3 github.com/fbsobreira/gotron-sdk v0.0.0-20230907131216-1e824406fe8c github.com/gagliardetto/solana-go v1.12.0 github.com/getsentry/raven-go v0.2.0 github.com/gin-contrib/cors v1.4.0 github.com/gin-gonic/gin v1.10.0 github.com/go-redis/redis v6.15.9+incompatible github.com/go-resty/resty/v2 v2.16.2 github.com/go-rod/rod v0.116.2 github.com/go-rod/stealth v0.4.9 github.com/gocolly/colly v1.2.0 github.com/google/uuid v1.6.0 github.com/gotd/td v0.122.0 github.com/jasonlvhit/gocron v0.0.1 github.com/jinzhu/copier v0.4.0 github.com/jinzhu/gorm v1.9.16 github.com/leekchan/accounting v1.0.0 github.com/mr-tron/base58 v1.2.0 github.com/mymmrac/telego v0.31.4 github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646 github.com/pkg/errors v0.9.1 github.com/sashabaranov/go-openai v1.36.1 github.com/shopspring/decimal v1.3.1 github.com/spf13/viper v1.19.0 github.com/stretchr/testify v1.10.0 go.mongodb.org/mongo-driver v1.17.1 go.uber.org/zap v1.27.0 google.golang.org/api v0.187.0 google.golang.org/grpc v1.67.1 gopkg.in/DataDog/dd-trace-go.v1 v1.70.3 gorm.io/driver/mysql v1.5.7 gorm.io/gorm v1.25.12 moul.io/zapgorm2 v1.3.0 mvdan.cc/xurls/v2 v2.5.0 ) require ( cloud.google.com/go v0.115.0 // indirect cloud.google.com/go/auth v0.6.1 // indirect cloud.google.com/go/auth/oauth2adapt v0.2.2 // indirect cloud.google.com/go/compute/metadata v0.5.0 // indirect cloud.google.com/go/iam v1.1.8 // indirect cosmossdk.io/api v0.7.6 // indirect cosmossdk.io/collections v0.4.0 // indirect cosmossdk.io/core v0.11.0 // indirect cosmossdk.io/depinject v1.1.0 // indirect cosmossdk.io/errors v1.0.1 // indirect cosmossdk.io/math v1.4.0 // indirect cosmossdk.io/x/tx v0.13.7 // indirect filippo.io/edwards25519 v1.0.0 // indirect github.com/DataDog/appsec-internal-go v1.9.0 // indirect github.com/DataDog/datadog-agent/pkg/obfuscate v0.58.0 // indirect github.com/DataDog/datadog-agent/pkg/proto v0.58.0 // indirect github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.58.0 // indirect github.com/DataDog/datadog-agent/pkg/trace v0.58.0 // indirect github.com/DataDog/datadog-agent/pkg/util/log v0.58.0 // indirect github.com/DataDog/datadog-agent/pkg/util/scrubber v0.58.0 // indirect github.com/DataDog/datadog-go/v5 v5.5.0 // indirect github.com/DataDog/go-libddwaf/v3 v3.5.1 // indirect github.com/DataDog/go-runtime-metrics-internal v0.0.0-20241106155157-194426bbbd59 // indirect github.com/DataDog/go-sqllexer v0.0.14 // indirect github.com/DataDog/go-tuf v1.1.0-0.5.2 // indirect github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.20.0 // indirect github.com/DataDog/sketches-go v1.4.5 // indirect github.com/DataDog/zstd v1.5.5 // indirect github.com/andybalholm/brotli v1.1.1 // indirect github.com/andybalholm/cascadia v1.3.3 // indirect github.com/antchfx/htmlquery v1.2.3 // indirect github.com/antchfx/xmlquery v1.2.4 // indirect github.com/antchfx/xpath v1.1.8 // indirect github.com/benbjohnson/clock v1.3.0 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/blendle/zapdriver v1.3.1 // indirect github.com/bytedance/sonic/loader v0.2.0 // indirect github.com/cenkalti/backoff/v4 v4.3.0 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/chromedp/sysutil v1.1.0 // indirect github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575 // indirect github.com/cloudwego/base64x v0.1.4 // indirect github.com/cloudwego/iasm v0.2.0 // indirect github.com/cockroachdb/apd v1.1.0 // indirect github.com/cockroachdb/errors v1.11.3 // indirect github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce // indirect github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect github.com/cockroachdb/pebble v1.1.2 // indirect github.com/cockroachdb/redact v1.1.5 // indirect github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect github.com/coder/websocket v1.8.13 // indirect github.com/cometbft/cometbft v0.38.12 // indirect github.com/cosmos/cosmos-db v1.1.0 // indirect github.com/cosmos/cosmos-proto v1.0.0-beta.5 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect github.com/cosmos/gogoproto v1.7.0 // indirect github.com/deckarep/golang-set v1.8.0 // indirect github.com/dlclark/regexp2 v1.11.5 // indirect github.com/dustin/go-humanize v1.0.1 // indirect github.com/eapache/queue/v2 v2.0.0-20230407133247-75960ed334e4 // indirect github.com/ebitengine/purego v0.6.0-alpha.5 // indirect github.com/fasthttp/router v1.5.2 // indirect github.com/fatih/color v1.18.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect github.com/gagliardetto/binary v0.8.0 // indirect github.com/gagliardetto/treeout v0.1.4 // indirect github.com/getsentry/sentry-go v0.27.0 // indirect github.com/ghodss/yaml v1.0.0 // indirect github.com/go-faster/errors v0.7.1 // indirect github.com/go-faster/jx v1.1.0 // indirect github.com/go-faster/xor v1.0.0 // indirect github.com/go-faster/yaml v0.4.6 // indirect github.com/go-kit/log v0.2.1 // indirect github.com/go-logfmt/logfmt v0.6.0 // indirect github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/gobwas/glob v0.2.3 // indirect github.com/gobwas/httphead v0.1.0 // indirect github.com/gobwas/pool v0.2.1 // indirect github.com/gobwas/ws v1.4.0 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/protobuf v1.5.4 // indirect github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb // indirect github.com/google/btree v1.1.3 // indirect github.com/google/go-cmp v0.7.0 // indirect github.com/google/pprof v0.0.0-20240727154555-813a5fbdbec8 // indirect github.com/google/s2a-go v0.1.7 // indirect github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect github.com/googleapis/gax-go/v2 v2.12.5 // indirect github.com/gorilla/mux v1.8.1 // indirect github.com/gotd/ige v0.2.2 // indirect github.com/gotd/neo v0.1.5 // indirect github.com/grbit/go-json v0.11.0 // indirect github.com/hashicorp/go-secure-stdlib/parseutil v0.1.7 // indirect github.com/hashicorp/go-secure-stdlib/strutil v0.1.2 // indirect github.com/hashicorp/go-sockaddr v1.0.2 // indirect github.com/hashicorp/hcl v1.0.1-vault-5 // indirect github.com/iancoleman/strcase v0.3.0 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/kennygrant/sanitize v1.2.4 // indirect github.com/klauspost/compress v1.18.0 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect github.com/linxGnu/grocksdb v1.8.14 // indirect github.com/logrusorgru/aurora v2.0.3+incompatible // indirect github.com/lufia/plan9stats v0.0.0-20220913051719-115f729f3c8c // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/mailru/easyjson v0.7.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/go-testing-interface v1.14.1 // indirect github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c // indirect github.com/mostynb/zstdpool-freelist v0.0.0-20201229113212-927304c0c3b1 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a // indirect github.com/ogen-go/ogen v1.10.1 // indirect github.com/outcaste-io/ristretto v0.2.3 // indirect github.com/pborman/uuid v1.2.1 // indirect github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 // indirect github.com/philhofer/fwd v1.1.3-0.20240612014219-fbbf4953d986 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c // indirect github.com/prometheus/client_golang v1.20.1 // indirect github.com/prometheus/client_model v0.6.1 // indirect github.com/prometheus/common v0.55.0 // indirect github.com/prometheus/procfs v0.15.1 // indirect github.com/rjeczalik/notify v0.9.3 // indirect github.com/rogpeppe/go-internal v1.14.1 // indirect github.com/ryanuber/go-glob v1.0.0 // indirect github.com/sagikazarmark/locafero v0.4.0 // indirect github.com/sagikazarmark/slog-shim v0.1.0 // indirect github.com/saintfish/chardet v0.0.0-20120816061221-3af4cd4741ca // indirect github.com/sasha-s/go-deadlock v0.3.1 // indirect github.com/savsgio/gotils v0.0.0-20240704082632-aef3928b8a38 // indirect github.com/secure-systems-lab/go-securesystemslib v0.7.0 // indirect github.com/segmentio/asm v1.2.0 // indirect github.com/shengdoushi/base58 v1.0.0 // indirect github.com/shirou/gopsutil/v3 v3.24.4 // indirect github.com/shoenig/go-m1cpu v0.1.6 // indirect github.com/sourcegraph/conc v0.3.0 // indirect github.com/spf13/afero v1.11.0 // indirect github.com/spf13/cast v1.7.0 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/stephenlacy/go-ethereum-hdwallet v0.0.0-20230913225845-a4fa94429863 // indirect github.com/streamingfast/logging v0.0.0-20230608130331-f22c91403091 // indirect github.com/subosito/gotenv v1.6.0 // indirect github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect github.com/temoto/robotstxt v1.1.1 // indirect github.com/tendermint/go-amino v0.16.0 // indirect github.com/tinylib/msgp v1.2.1 // indirect github.com/tyler-smith/go-bip39 v1.1.0 // indirect github.com/valyala/bytebufferpool v1.0.0 // indirect github.com/valyala/fasthttp v1.59.0 // indirect github.com/valyala/fastjson v1.6.4 // indirect github.com/ysmood/fetchup v0.2.3 // indirect github.com/ysmood/goob v0.4.0 // indirect github.com/ysmood/got v0.40.0 // indirect github.com/ysmood/gson v0.7.3 // indirect github.com/ysmood/leakless v0.9.0 // indirect github.com/yusufpapurcu/wmi v1.2.4 // indirect go.opencensus.io v0.24.0 // indirect go.opentelemetry.io/auto/sdk v1.1.0 // indirect go.opentelemetry.io/collector/component v0.104.0 // indirect go.opentelemetry.io/collector/config/configtelemetry v0.104.0 // indirect go.opentelemetry.io/collector/pdata v1.11.0 // indirect go.opentelemetry.io/collector/pdata/pprofile v0.104.0 // indirect go.opentelemetry.io/collector/semconv v0.104.0 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.52.0 // indirect go.opentelemetry.io/otel v1.35.0 // indirect go.opentelemetry.io/otel/metric v1.35.0 // indirect go.opentelemetry.io/otel/trace v1.35.0 // indirect go.uber.org/atomic v1.11.0 // indirect go.uber.org/ratelimit v0.3.1 // indirect golang.org/x/exp v0.0.0-20240909161429-701f63a606c0 // indirect golang.org/x/oauth2 v0.22.0 // indirect golang.org/x/term v0.30.0 // indirect golang.org/x/time v0.6.0 // indirect golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da // indirect google.golang.org/appengine v1.6.8 // indirect google.golang.org/genproto v0.0.0-20240624140628-dc46fd24d27d // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240930140551-af27646dc61f // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect rsc.io/qr v0.2.0 // indirect sigs.k8s.io/yaml v1.4.0 // indirect ) require ( github.com/Microsoft/go-winio v0.6.1 // indirect github.com/StackExchange/wmi v1.2.1 // indirect github.com/bits-and-blooms/bitset v1.13.0 // indirect github.com/btcsuite/btcd/chaincfg/chainhash v1.1.0 // indirect github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f // indirect github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd // indirect github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792 // indirect github.com/bytedance/sonic v1.12.3 // indirect github.com/certifi/gocertifi v0.0.0-20210507211836-431795d63e8d // indirect github.com/consensys/bavard v0.1.13 // indirect github.com/consensys/gnark-crypto v0.12.1 // indirect github.com/crate-crypto/go-kzg-4844 v1.0.0 // indirect github.com/deckarep/golang-set/v2 v2.6.0 // indirect github.com/decred/dcrd/crypto/blake256 v1.1.0 // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect github.com/ethereum/c-kzg-4844 v1.0.0 // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect github.com/gabriel-vasile/mimetype v1.4.5 github.com/gin-contrib/sse v0.1.0 // indirect github.com/go-ole/go-ole v1.3.0 // indirect github.com/go-playground/locales v0.14.1 // indirect github.com/go-playground/universal-translator v0.18.1 // indirect github.com/go-playground/validator/v10 v10.22.0 // indirect github.com/go-sql-driver/mysql v1.7.0 github.com/goccy/go-json v0.10.3 // indirect github.com/gorilla/websocket v1.5.3 github.com/holiman/uint256 v1.2.4 // indirect github.com/jinzhu/inflection v1.0.0 // indirect github.com/jinzhu/now v1.1.5 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/klauspost/cpuid/v2 v2.2.8 // indirect github.com/leodido/go-urn v1.4.0 // indirect github.com/lib/pq v1.10.9 // indirect github.com/mattn/go-isatty v0.0.20 // indirect github.com/mmcloughlin/addchain v0.4.0 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/pelletier/go-toml/v2 v2.2.3 // indirect github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible // indirect github.com/supranational/blst v0.3.11 // indirect github.com/tklauser/go-sysconf v0.3.12 // indirect github.com/tklauser/numcpus v0.6.1 // indirect github.com/twitchyliquid64/golang-asm v0.15.1 // indirect github.com/ugorji/go/codec v1.2.12 // indirect github.com/zksync-sdk/zksync2-go v0.6.0 go.uber.org/multierr v1.11.0 // indirect golang.org/x/arch v0.9.0 // indirect golang.org/x/crypto v0.36.0 golang.org/x/mod v0.24.0 // indirect golang.org/x/net v0.38.0 // indirect golang.org/x/sync v0.12.0 // indirect golang.org/x/sys v0.31.0 // indirect golang.org/x/text v0.23.0 golang.org/x/tools v0.31.0 // indirect google.golang.org/protobuf v1.35.1 gopkg.in/yaml.v3 v3.0.1 // indirect rsc.io/tmplfunc v0.0.3 // indirect ) ================================================ FILE: agent-as-a-service/agent-orchestration/backend/go.sum ================================================ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.115.0 h1:CnFSK6Xo3lDYRoBKEcAtia6VSC837/ZkJuRduSFnr14= cloud.google.com/go v0.115.0/go.mod h1:8jIM5vVgoAEoiVxQ/O4BFTfHqulPZgs/ufEzMcFMdWU= cloud.google.com/go/auth v0.6.1 h1:T0Zw1XM5c1GlpN2HYr2s+m3vr1p2wy+8VN+Z1FKxW38= cloud.google.com/go/auth v0.6.1/go.mod h1:eFHG7zDzbXHKmjJddFG/rBlcGp6t25SwRUiEQSlO4x4= cloud.google.com/go/auth/oauth2adapt v0.2.2 h1:+TTV8aXpjeChS9M+aTtN/TjdQnzJvmzKFt//oWu7HX4= cloud.google.com/go/auth/oauth2adapt v0.2.2/go.mod h1:wcYjgpZI9+Yu7LyYBg4pqSiaRkfEK3GQcpb7C/uyF1Q= cloud.google.com/go/compute/metadata v0.5.0 h1:Zr0eK8JbFv6+Wi4ilXAR8FJ3wyNdpxHKJNPos6LTZOY= cloud.google.com/go/compute/metadata v0.5.0/go.mod h1:aHnloV2TPI38yx4s9+wAZhHykWvVCfu7hQbF+9CWoiY= cloud.google.com/go/iam v1.1.8 h1:r7umDwhj+BQyz0ScZMp4QrGXjSTI3ZINnpgU2nlB/K0= cloud.google.com/go/iam v1.1.8/go.mod h1:GvE6lyMmfxXauzNq8NbgJbeVQNspG+tcdL/W8QO1+zE= cloud.google.com/go/longrunning v0.5.7 h1:WLbHekDbjK1fVFD3ibpFFVoyizlLRl73I7YKuAKilhU= cloud.google.com/go/longrunning v0.5.7/go.mod h1:8GClkudohy1Fxm3owmBGid8W0pSgodEMwEAztp38Xng= cloud.google.com/go/secretmanager v1.13.1 h1:TTGo2Vz7ZxYn2QbmuFP7Zo4lDm5VsbzBjDReo3SA5h4= cloud.google.com/go/secretmanager v1.13.1/go.mod h1:y9Ioh7EHp1aqEKGYXk3BOC+vkhlHm9ujL7bURT4oI/4= cloud.google.com/go/storage v1.43.0 h1:CcxnSohZwizt4LCzQHWvBf1/kvtHUn7gk9QERXPyXFs= cloud.google.com/go/storage v1.43.0/go.mod h1:ajvxEa7WmZS1PxvKRq4bq0tFT3vMd502JwstCcYv0Q0= cosmossdk.io/api v0.7.6 h1:PC20PcXy1xYKH2KU4RMurVoFjjKkCgYRbVAD4PdqUuY= cosmossdk.io/api v0.7.6/go.mod h1:IcxpYS5fMemZGqyYtErK7OqvdM0C8kdW3dq8Q/XIG38= cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s= cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0= cosmossdk.io/core v0.11.0 h1:vtIafqUi+1ZNAE/oxLOQQ7Oek2n4S48SWLG8h/+wdbo= cosmossdk.io/core v0.11.0/go.mod h1:LaTtayWBSoacF5xNzoF8tmLhehqlA9z1SWiPuNC6X1w= cosmossdk.io/depinject v1.1.0 h1:wLan7LG35VM7Yo6ov0jId3RHWCGRhe8E8bsuARorl5E= cosmossdk.io/depinject v1.1.0/go.mod h1:kkI5H9jCGHeKeYWXTqYdruogYrEeWvBQCw1Pj4/eCFI= cosmossdk.io/errors v1.0.1 h1:bzu+Kcr0kS/1DuPBtUFdWjzLqyUuCiyHjyJB6srBV/0= cosmossdk.io/errors v1.0.1/go.mod h1:MeelVSZThMi4bEakzhhhE/CKqVv3nOJDA25bIqRDu/U= cosmossdk.io/log v1.4.1 h1:wKdjfDRbDyZRuWa8M+9nuvpVYxrEOwbD/CA8hvhU8QM= cosmossdk.io/log v1.4.1/go.mod h1:k08v0Pyq+gCP6phvdI6RCGhLf/r425UT6Rk/m+o74rU= cosmossdk.io/math v1.4.0 h1:XbgExXFnXmF/CccPPEto40gOO7FpWu9yWNAZPN3nkNQ= cosmossdk.io/math v1.4.0/go.mod h1:O5PkD4apz2jZs4zqFdTr16e1dcaQCc5z6lkEnrrppuk= cosmossdk.io/store v1.1.1 h1:NA3PioJtWDVU7cHHeyvdva5J/ggyLDkyH0hGHl2804Y= cosmossdk.io/store v1.1.1/go.mod h1:8DwVTz83/2PSI366FERGbWSH7hL6sB7HbYp8bqksNwM= cosmossdk.io/x/tx v0.13.7 h1:8WSk6B/OHJLYjiZeMKhq7DK7lHDMyK0UfDbBMxVmeOI= cosmossdk.io/x/tx v0.13.7/go.mod h1:V6DImnwJMTq5qFjeGWpXNiT/fjgE4HtmclRmTqRVM3w= filippo.io/edwards25519 v1.0.0 h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek= filippo.io/edwards25519 v1.0.0/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 h1:/vQbFIOMbk2FiG/kXiLl8BRyzTWDw7gX/Hz7Dd5eDMs= github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4/go.mod h1:hN7oaIRCjzsZ2dE+yG5k+rsdt3qcwykqK6HVGcKwsw4= github.com/99designs/keyring v1.2.1 h1:tYLp1ULvO7i3fI5vE21ReQuj99QFSs7lGm0xWyJo87o= github.com/99designs/keyring v1.2.1/go.mod h1:fc+wB5KTk9wQ9sDx0kFXB3A0MaeGHM9AwRStKOQ5vOA= github.com/AlekSi/pointer v1.1.0 h1:SSDMPcXD9jSl8FPy9cRzoRaMJtm9g9ggGTxecRUbQoI= github.com/AlekSi/pointer v1.1.0/go.mod h1:y7BvfRI3wXPWKXEBhU71nbnIEEZX0QTSB2Bj48UJIZE= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/DataDog/appsec-internal-go v1.9.0 h1:cGOneFsg0JTRzWl5U2+og5dbtyW3N8XaYwc5nXe39Vw= github.com/DataDog/appsec-internal-go v1.9.0/go.mod h1:wW0cRfWBo4C044jHGwYiyh5moQV2x0AhnwqMuiX7O/g= github.com/DataDog/datadog-agent/pkg/obfuscate v0.58.0 h1:nOrRNCHyriM/EjptMrttFOQhRSmvfagESdpyknb5VPg= github.com/DataDog/datadog-agent/pkg/obfuscate v0.58.0/go.mod h1:MfDvphBMmEMwE3a30h27AtPO7OzmvdoVTiGY1alEmo4= github.com/DataDog/datadog-agent/pkg/proto v0.58.0 h1:JX2Q0C5QnKcYqnYHWUcP0z7R0WB8iiQz3aWn+kT5DEc= github.com/DataDog/datadog-agent/pkg/proto v0.58.0/go.mod h1:0wLYojGxRZZFQ+SBbFjay9Igg0zbP88l03TfZaVZ6Dc= github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.58.0 h1:5hGO0Z8ih0bRojuq+1ZwLFtdgsfO3TqIjbwJAH12sOQ= github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.58.0/go.mod h1:jN5BsZI+VilHJV1Wac/efGxS4TPtXa1Lh9SiUyv93F4= github.com/DataDog/datadog-agent/pkg/trace v0.58.0 h1:4AjohoBWWN0nNaeD/0SDZ8lRTYmnJ48CqREevUfSets= github.com/DataDog/datadog-agent/pkg/trace v0.58.0/go.mod h1:MFnhDW22V5M78MxR7nv7abWaGc/B4L42uHH1KcIKxZs= github.com/DataDog/datadog-agent/pkg/util/log v0.58.0 h1:2MENBnHNw2Vx/ebKRyOPMqvzWOUps2Ol2o/j8uMvN4U= github.com/DataDog/datadog-agent/pkg/util/log v0.58.0/go.mod h1:1KdlfcwhqtYHS1szAunsgSfvgoiVsf3mAJc+WvNTnIE= github.com/DataDog/datadog-agent/pkg/util/scrubber v0.58.0 h1:Jkf91q3tuIer4Hv9CLJIYjlmcelAsoJRMmkHyz+p1Dc= github.com/DataDog/datadog-agent/pkg/util/scrubber v0.58.0/go.mod h1:krOxbYZc4KKE7bdEDu10lLSQBjdeSFS/XDSclsaSf1Y= github.com/DataDog/datadog-go v3.2.0+incompatible h1:qSG2N4FghB1He/r2mFrWKCaL7dXCilEuNEeAn20fdD4= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/DataDog/datadog-go/v5 v5.5.0 h1:G5KHeB8pWBNXT4Jtw0zAkhdxEAWSpWH00geHI6LDrKU= github.com/DataDog/datadog-go/v5 v5.5.0/go.mod h1:K9kcYBlxkcPP8tvvjZZKs/m1edNAUFzBbdpTUKfCsuw= github.com/DataDog/go-libddwaf/v3 v3.5.1 h1:GWA4ln4DlLxiXm+X7HA/oj0ZLcdCwOS81KQitegRTyY= github.com/DataDog/go-libddwaf/v3 v3.5.1/go.mod h1:n98d9nZ1gzenRSk53wz8l6d34ikxS+hs62A31Fqmyi4= github.com/DataDog/go-runtime-metrics-internal v0.0.0-20241106155157-194426bbbd59 h1:s4hgS6gqbXIakEMMujYiHCVVsB3R3oZtqEzPBMnFU2w= github.com/DataDog/go-runtime-metrics-internal v0.0.0-20241106155157-194426bbbd59/go.mod h1:quaQJ+wPN41xEC458FCpTwyROZm3MzmTZ8q8XOXQiPs= github.com/DataDog/go-sqllexer v0.0.14 h1:xUQh2tLr/95LGxDzLmttLgTo/1gzFeOyuwrQa/Iig4Q= github.com/DataDog/go-sqllexer v0.0.14/go.mod h1:KwkYhpFEVIq+BfobkTC1vfqm4gTi65skV/DpDBXtexc= github.com/DataDog/go-tuf v1.1.0-0.5.2 h1:4CagiIekonLSfL8GMHRHcHudo1fQnxELS9g4tiAupQ4= github.com/DataDog/go-tuf v1.1.0-0.5.2/go.mod h1:zBcq6f654iVqmkk8n2Cx81E1JnNTMOAx1UEO/wZR+P0= github.com/DataDog/gostackparse v0.7.0 h1:i7dLkXHvYzHV308hnkvVGDL3BR4FWl7IsXNPz/IGQh4= github.com/DataDog/gostackparse v0.7.0/go.mod h1:lTfqcJKqS9KnXQGnyQMCugq3u1FP6UZMfWR0aitKFMM= github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.20.0 h1:fKv05WFWHCXQmUTehW1eEZvXJP65Qv00W4V01B1EqSA= github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.20.0/go.mod h1:dvIWN9pA2zWNTw5rhDWZgzZnhcfpH++d+8d1SWW6xkY= github.com/DataDog/sketches-go v1.4.5 h1:ki7VfeNz7IcNafq7yI/j5U/YCkO3LJiMDtXz9OMQbyE= github.com/DataDog/sketches-go v1.4.5/go.mod h1:7Y8GN8Jf66DLyDhc94zuWA3uHEt/7ttt8jHOBWWrSOg= github.com/DataDog/zstd v1.5.5 h1:oWf5W7GtOLgp6bciQYDmhHHjdhYkALu6S/5Ni9ZgSvQ= github.com/DataDog/zstd v1.5.5/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= github.com/Microsoft/go-winio v0.5.0/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= github.com/PuerkitoBio/goquery v1.5.1/go.mod h1:GsLWisAFVj4WgDibEWF4pvYnkVQBpKBKeU+7zCJoLcc= github.com/PuerkitoBio/goquery v1.10.1 h1:Y8JGYUkXWTGRB6Ars3+j3kN0xg1YqqlwvdTV8WTFQcU= github.com/PuerkitoBio/goquery v1.10.1/go.mod h1:IYiHrOMps66ag56LEH7QYDDupKXyo5A8qrjIx3ZtujY= github.com/StackExchange/wmi v1.2.1 h1:VIkavFPXSjcnS+O8yTq7NI32k0R5Aj+v39y29VYDOSA= github.com/StackExchange/wmi v1.2.1/go.mod h1:rcmrprowKIVzvc+NUiLncP2uuArMWLCbu9SBzvHz7e8= github.com/VictoriaMetrics/fastcache v1.12.1 h1:i0mICQuojGDL3KblA7wUNlY5lOK6a4bwt3uRKnkZU40= github.com/VictoriaMetrics/fastcache v1.12.1/go.mod h1:tX04vaqcNoQeGLD+ra5pU5sWkuxnzWhEzLwhP9w653o= github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII= github.com/andybalholm/brotli v1.1.1 h1:PR2pgnyFznKEugtsUo0xLdDop5SKXd5Qf5ysW+7XdTA= github.com/andybalholm/brotli v1.1.1/go.mod h1:05ib4cKhjx3OQYUY22hTVd34Bc8upXjOLL2rKwwZBoA= github.com/andybalholm/cascadia v1.1.0/go.mod h1:GsXiBklL0woXo1j/WYWtSYYC4ouU9PqHO0sqidkEA4Y= github.com/andybalholm/cascadia v1.3.3 h1:AG2YHrzJIm4BZ19iwJ/DAua6Btl3IwJX+VI4kktS1LM= github.com/andybalholm/cascadia v1.3.3/go.mod h1:xNd9bqTn98Ln4DwST8/nG+H0yuB8Hmgu1YHNnWw0GeA= github.com/antchfx/htmlquery v1.2.3 h1:sP3NFDneHx2stfNXCKbhHFo8XgNjCACnU/4AO5gWz6M= github.com/antchfx/htmlquery v1.2.3/go.mod h1:B0ABL+F5irhhMWg54ymEZinzMSi0Kt3I2if0BLYa3V0= github.com/antchfx/xmlquery v1.2.4 h1:T/SH1bYdzdjTMoz2RgsfVKbM5uWh3gjDYYepFqQmFv4= github.com/antchfx/xmlquery v1.2.4/go.mod h1:KQQuESaxSlqugE2ZBcM/qn+ebIpt+d+4Xx7YcSGAIrM= github.com/antchfx/xpath v1.1.6/go.mod h1:Yee4kTMuNiPYJ7nSNorELQMr1J33uOpXDMByNYhvtNk= github.com/antchfx/xpath v1.1.8 h1:PcL6bIX42Px5usSx6xRYw/wjB3wYGkj0MJ9MBzEKVgk= github.com/antchfx/xpath v1.1.8/go.mod h1:Yee4kTMuNiPYJ7nSNorELQMr1J33uOpXDMByNYhvtNk= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A= github.com/benbjohnson/clock v1.3.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 h1:41iFGWnSlI2gVpmOtVTJZNodLdLQLn/KsJqFvXwnd/s= github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bits-and-blooms/bitset v1.13.0 h1:bAQ9OPNFYbGHV6Nez0tmNI0RiEu7/hxlYJRUA0wFAVE= github.com/bits-and-blooms/bitset v1.13.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8= github.com/blendle/zapdriver v1.3.1 h1:C3dydBOWYRiOk+B8X9IVZ5IOe+7cl+tGOexN4QqHfpE= github.com/blendle/zapdriver v1.3.1/go.mod h1:mdXfREi6u5MArG4j9fewC+FGnXaBR+T4Ox4J2u4eHCc= github.com/blockcypher/gobcy/v2 v2.0.5 h1:xCebsc886aGPl8StjcF69HESKEHK2yxykC+sfP00yF4= github.com/blockcypher/gobcy/v2 v2.0.5/go.mod h1:nx47q9T0qeQfYdIDnzmQhuTcck9Jwa7f+xp8UO4WRpg= github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13Px/pDuV7OomQ= github.com/btcsuite/btcd v0.22.0-beta.0.20220111032746-97732e52810c/go.mod h1:tjmYdS6MLJ5/s0Fj4DbLgSbDHbEqLJrtnHecBFkdz5M= github.com/btcsuite/btcd v0.23.5-0.20231215221805-96c9fd8078fd/go.mod h1:nm3Bko6zh6bWP60UxwoT5LzdGJsQJaPo6HjduXq9p6A= github.com/btcsuite/btcd v0.24.2 h1:aLmxPguqxza+4ag8R1I2nnJjSu2iFn/kqtHTIImswcY= github.com/btcsuite/btcd v0.24.2/go.mod h1:5C8ChTkl5ejr3WHj8tkQSCmydiMEPB0ZhQhehpq7Dgg= github.com/btcsuite/btcd/btcec/v2 v2.1.0/go.mod h1:2VzYrv4Gm4apmbVVsSq5bqf1Ec8v56E48Vt0Y/umPgA= github.com/btcsuite/btcd/btcec/v2 v2.1.3/go.mod h1:ctjw4H1kknNJmRN4iP1R7bTQ+v3GJkZBd6mui8ZsAZE= github.com/btcsuite/btcd/btcec/v2 v2.3.4 h1:3EJjcN70HCu/mwqlUsGK8GcNVyLVxFDlWurTXGPFfiQ= github.com/btcsuite/btcd/btcec/v2 v2.3.4/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04= github.com/btcsuite/btcd/btcutil v1.0.0/go.mod h1:Uoxwv0pqYWhD//tfTiipkxNfdhG9UrLwaeswfjfdF0A= github.com/btcsuite/btcd/btcutil v1.1.0/go.mod h1:5OapHB7A2hBBWLm48mmw4MOHNJCcUBTwmWH/0Jn8VHE= github.com/btcsuite/btcd/btcutil v1.1.5/go.mod h1:PSZZ4UitpLBWzxGd5VGOrLnmOjtPP/a6HaFo12zMs00= github.com/btcsuite/btcd/btcutil v1.1.6 h1:zFL2+c3Lb9gEgqKNzowKUPQNb8jV7v5Oaodi/AYFd6c= github.com/btcsuite/btcd/btcutil v1.1.6/go.mod h1:9dFymx8HpuLqBnsPELrImQeTQfKBQqzqGbbV3jK55aE= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.0/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= github.com/btcsuite/btcd/chaincfg/chainhash v1.1.0 h1:59Kx4K6lzOW5w6nFlA0v5+lk/6sjybR934QNHSJZPTQ= github.com/btcsuite/btcd/chaincfg/chainhash v1.1.0/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f h1:bAs4lUbRJpnnkd9VhRV3jjAVU7DJVjMaK+IsvSeZvFo= github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA= github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd h1:R/opQEbFEy9JGkIguV40SvRY1uliPX8ifOvi6ICsFCw= github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd/go.mod h1:HHNXQzUsZCxOoE+CPiyCTO6x34Zs86zZUiwtpXoGdtg= github.com/btcsuite/goleveldb v0.0.0-20160330041536-7834afc9e8cd/go.mod h1:F+uVaaLLH7j4eDXPRvw78tMflu7Ie2bzYOH4Y8rRKBY= github.com/btcsuite/goleveldb v1.0.0/go.mod h1:QiK9vBlgftBg6rWQIj6wFzbPfRjiykIEhBH4obrXJ/I= github.com/btcsuite/snappy-go v0.0.0-20151229074030-0bdef8d06723/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc= github.com/btcsuite/snappy-go v1.0.0/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc= github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792 h1:R8vQdOQdZ9Y3SkEwmHoWBmX1DNXhXZqlTpq6s4tyJGc= github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY= github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs= github.com/bytedance/sonic v1.12.3 h1:W2MGa7RCU1QTeYRTPE3+88mVC0yXmsRQRChiyVocVjU= github.com/bytedance/sonic v1.12.3/go.mod h1:B8Gt/XvtZ3Fqj+iSKMypzymZxw/FVwgIGKzMzT9r/rk= github.com/bytedance/sonic/loader v0.1.1/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU= github.com/bytedance/sonic/loader v0.2.0 h1:zNprn+lsIP06C/IqCHs3gPQIvnvpKbbxyXQP1iU4kWM= github.com/bytedance/sonic/loader v0.2.0/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU= github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8= github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/certifi/gocertifi v0.0.0-20210507211836-431795d63e8d h1:S2NE3iHSwP0XV47EEXL8mWmRdEfGscSJ+7EgePNgt0s= github.com/certifi/gocertifi v0.0.0-20210507211836-431795d63e8d/go.mod h1:sGbDF6GwGcLpkNXPUTkMRoywsNa/ol15pxFe6ERfguA= github.com/cespare/cp v0.1.0 h1:SE+dxFebS7Iik5LK0tsi1k9ZCxEaFX4AjQmoyA+1dJk= github.com/cespare/cp v0.1.0/go.mod h1:SOGHArjBr4JWaSDEVpWpo/hNg6RoKrls6Oh40hiwW+s= github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/chromedp/cdproto v0.0.0-20250101192427-60a0ca35cb84 h1:NXWP4iSVz4BPGk7Z/fPXL0c44hiWbrbyhBY0LwKKZnY= github.com/chromedp/cdproto v0.0.0-20250101192427-60a0ca35cb84/go.mod h1:4XqMl3iIW08jtieURWL6Tt5924w21pxirC6th662XUM= github.com/chromedp/chromedp v0.11.2 h1:ZRHTh7DjbNTlfIv3NFTbB7eVeu5XCNkgrpcGSpn2oX0= github.com/chromedp/chromedp v0.11.2/go.mod h1:lr8dFRLKsdTTWb75C/Ttol2vnBKOSnt0BW8R9Xaupi8= github.com/chromedp/sysutil v1.1.0 h1:PUFNv5EcprjqXZD9nJb9b/c9ibAbxiYo4exNWZyipwM= github.com/chromedp/sysutil v1.1.0/go.mod h1:WiThHUdltqCNKGc4gaU50XgYjwjYIhKWoHGPTUfWTJ8= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575 h1:kHaBemcxl8o/pQ5VM1c8PVE1PubbNx3mjUr09OqWGCs= github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575/go.mod h1:9d6lWj8KzO/fd/NrVaLscBKmPigpZpn5YawRPw+e3Yo= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cloudwego/base64x v0.1.4 h1:jwCgWpFanWmN8xoIUHa2rtzmkd5J2plF/dnLS6Xd/0Y= github.com/cloudwego/base64x v0.1.4/go.mod h1:0zlkT4Wn5C6NdauXdJRhSKRlJvmclQ1hhJgA0rcu/8w= github.com/cloudwego/iasm v0.2.0 h1:1KNIy1I1H9hNNFEEH3DVnI4UujN+1zjpuk6gwHLTssg= github.com/cloudwego/iasm v0.2.0/go.mod h1:8rXZaNYT2n95jn+zTI1sDr+IgcD2GVs0nlbbQPiEFhY= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cockroachdb/apd v1.1.0 h1:3LFP3629v+1aKXU5Q37mxmRxX/pIu1nijXydLShEq5I= github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ= github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f h1:otljaYPt5hWxV3MUfO5dFPFiOXg9CyG5/kCfayTqsJ4= github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= github.com/cockroachdb/errors v1.11.3 h1:5bA+k2Y6r+oz/6Z/RFlNeVCesGARKuC6YymtcDrbC/I= github.com/cockroachdb/errors v1.11.3/go.mod h1:m4UIW4CDjx+R5cybPsNrRbreomiFqt8o1h1wUVazSd8= github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce h1:giXvy4KSc/6g/esnpM7Geqxka4WSqI1SZc7sMJFd3y4= github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce/go.mod h1:9/y3cnZ5GKakj/H4y9r9GTjCvAFta7KLgSHPJJYc52M= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= github.com/cockroachdb/pebble v1.1.2 h1:CUh2IPtR4swHlEj48Rhfzw6l/d0qA31fItcIszQVIsA= github.com/cockroachdb/pebble v1.1.2/go.mod h1:4exszw1r40423ZsmkG/09AFEG83I0uDgfujJdbL6kYU= github.com/cockroachdb/redact v1.1.5 h1:u1PMllDkdFfPWaNGMyLD1+so+aq3uUItthCFqzwPJ30= github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/coder/websocket v1.8.13 h1:f3QZdXy7uGVz+4uCJy2nTZyM0yTBj8yANEHhqlXZ9FE= github.com/coder/websocket v1.8.13/go.mod h1:LNVeNrXQZfe5qhS9ALED3uA+l5pPqvwXg3CKoDBB2gs= github.com/cometbft/cometbft v0.38.12 h1:OWsLZN2KcSSFe8bet9xCn07VwhBnavPea3VyPnNq1bg= github.com/cometbft/cometbft v0.38.12/go.mod h1:GPHp3/pehPqgX1930HmK1BpBLZPxB75v/dZg8Viwy+o= github.com/cometbft/cometbft-db v0.11.0 h1:M3Lscmpogx5NTbb1EGyGDaFRdsoLWrUWimFEyf7jej8= github.com/cometbft/cometbft-db v0.11.0/go.mod h1:GDPJAC/iFHNjmZZPN8V8C1yr/eyityhi2W1hz2MGKSc= github.com/consensys/bavard v0.1.13 h1:oLhMLOFGTLdlda/kma4VOJazblc7IM5y5QPd2A/YjhQ= github.com/consensys/bavard v0.1.13/go.mod h1:9ItSMtA/dXMAiL7BG6bqW2m3NdSEObYWoH223nGHukI= github.com/consensys/gnark-crypto v0.12.1 h1:lHH39WuuFgVHONRl3J0LRBtuYdQTumFSDtJF7HpyG8M= github.com/consensys/gnark-crypto v0.12.1/go.mod h1:v2Gy7L/4ZRosZ7Ivs+9SfUDr0f5UlG+EM5t7MPHiLuY= github.com/cosmos/btcutil v1.0.5 h1:t+ZFcX77LpKtDBhjucvnOH8C2l2ioGsBNEQ3jef8xFk= github.com/cosmos/btcutil v1.0.5/go.mod h1:IyB7iuqZMJlthe2tkIFL33xPyzbFYP0XVdS8P5lUPis= github.com/cosmos/cosmos-db v1.1.0 h1:KLHNVQ73h7vawXTpj9UJ7ZR2IXv51tsEHkQJJ9EBDzI= github.com/cosmos/cosmos-db v1.1.0/go.mod h1:t7c4A6cfGdpUwwVxrQ0gQLeRQqGUBJu0yvE4F/26REg= github.com/cosmos/cosmos-proto v1.0.0-beta.5 h1:eNcayDLpip+zVLRLYafhzLvQlSmyab+RC5W7ZfmxJLA= github.com/cosmos/cosmos-proto v1.0.0-beta.5/go.mod h1:hQGLpiIUloJBMdQMMWb/4wRApmI9hjHH05nefC0Ojec= github.com/cosmos/cosmos-sdk v0.50.11 h1:LxR1aAc8kixdrs3itO+3a44sFoc+vjxVAOyPFx22yjk= github.com/cosmos/cosmos-sdk v0.50.11/go.mod h1:gt14Meok2IDCjbDtjwkbUcgVNEpUBDN/4hg9cCUtLgw= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ4GUkT+tbFI= github.com/cosmos/gogoproto v1.7.0 h1:79USr0oyXAbxg3rspGh/m4SWNyoz/GLaAh0QlCe2fro= github.com/cosmos/gogoproto v1.7.0/go.mod h1:yWChEv5IUEYURQasfyBW5ffkMHR/90hiHgbNgrtp4j0= github.com/cosmos/iavl v1.2.2 h1:qHhKW3I70w+04g5KdsdVSHRbFLgt3yY3qTMd4Xa4rC8= github.com/cosmos/iavl v1.2.2/go.mod h1:GiM43q0pB+uG53mLxLDzimxM9l/5N9UuSY3/D0huuVw= github.com/cosmos/ics23/go v0.11.0 h1:jk5skjT0TqX5e5QJbEnwXIS2yI2vnmLOgpQPeM5RtnU= github.com/cosmos/ics23/go v0.11.0/go.mod h1:A8OjxPE67hHST4Icw94hOxxFEJMBG031xIGF/JHNIY0= github.com/cosmos/ledger-cosmos-go v0.13.3 h1:7ehuBGuyIytsXbd4MP43mLeoN2LTOEnk5nvue4rK+yM= github.com/cosmos/ledger-cosmos-go v0.13.3/go.mod h1:HENcEP+VtahZFw38HZ3+LS3Iv5XV6svsnkk9vdJtLr8= github.com/cpuguy83/go-md2man/v2 v2.0.4 h1:wfIWP927BUkWJb2NmU/kNDYIBTh/ziUX91+lVfRxZq4= github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/crate-crypto/go-ipa v0.0.0-20231025140028-3c0104f4b233 h1:d28BXYi+wUpz1KBmiF9bWrjEMacUEREV6MBi2ODnrfQ= github.com/crate-crypto/go-ipa v0.0.0-20231025140028-3c0104f4b233/go.mod h1:geZJZH3SzKCqnz5VT0q/DyIG/tvu/dZk+VIfXicupJs= github.com/crate-crypto/go-kzg-4844 v1.0.0 h1:TsSgHwrkTKecKJ4kadtHi4b3xHW5dCFUDFnUp1TsawI= github.com/crate-crypto/go-kzg-4844 v1.0.0/go.mod h1:1kMhvPgI0Ky3yIa+9lFySEBUBXkYxeOi8ZF1sYioxhc= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/danieljoos/wincred v1.1.2 h1:QLdCxFs1/Yl4zduvBdcHB8goaYk9RARS2SgLLRuAyr0= github.com/danieljoos/wincred v1.1.2/go.mod h1:GijpziifJoIBfYh+S7BbkdUTU4LfM+QnGqR5Vl2tAx0= github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/deckarep/golang-set v1.8.0 h1:sk9/l/KqpunDwP7pSjUg0keiOOLEnOBHzykLrsPppp4= github.com/deckarep/golang-set v1.8.0/go.mod h1:5nI87KwE7wgsBU1F4GKAw2Qod7p5kyS383rP6+o6qqo= github.com/deckarep/golang-set/v2 v2.6.0 h1:XfcQbWM1LlMB8BsJ8N9vW5ehnnPVIw0je80NsVHagjM= github.com/deckarep/golang-set/v2 v2.6.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4= github.com/decred/dcrd/crypto/blake256 v1.0.0/go.mod h1:sQl2p6Y26YV+ZOcSTP6thNdn47hh8kt6rqSlvmrXFAc= github.com/decred/dcrd/crypto/blake256 v1.1.0 h1:zPMNGQCm0g4QTY27fOCorQW7EryeQ/U0x++OzVrdms8= github.com/decred/dcrd/crypto/blake256 v1.1.0/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1/go.mod h1:hyedUtir6IdtD/7lIxGeCxkaw7y45JueMRL4DIyJDKs= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 h1:rpfIENRNNilwHwZeG5+P150SMrnNEcHYvcCuK6dPZSg= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= github.com/decred/dcrd/lru v1.0.0/go.mod h1:mxKOwFd7lFjN2GZYsiz/ecgqR6kkYAl+0pz0tEMk218= github.com/denisenkom/go-mssqldb v0.0.0-20191124224453-732737034ffd/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU= github.com/denisenkom/go-mssqldb v0.11.0 h1:9rHa233rhdOyrz2GcP9NM+gi2psgJZ4GWDpL/7ND8HI= github.com/denisenkom/go-mssqldb v0.11.0/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f h1:U5y3Y5UE0w7amNe7Z5G/twsBW0KEalRQXZzf8ufSh9I= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f/go.mod h1:xH/i4TFMt8koVQZ6WFms69WAsDWr2XsYL3Hkl7jkoLE= github.com/dghubble/oauth1 v0.7.3 h1:EkEM/zMDMp3zOsX2DC/ZQ2vnEX3ELK0/l9kb+vs4ptE= github.com/dghubble/oauth1 v0.7.3/go.mod h1:oxTe+az9NSMIucDPDCCtzJGsPhciJV33xocHfcR2sVY= github.com/dgraph-io/badger/v2 v2.2007.4 h1:TRWBQg8UrlUhaFdco01nO2uXwzKS7zd+HVdwV/GHc4o= github.com/dgraph-io/badger/v2 v2.2007.4/go.mod h1:vSw/ax2qojzbN6eXHIx6KPKtCSHJN/Uz0X0VPruTIhk= github.com/dgraph-io/ristretto v0.1.1 h1:6CWw5tJNgpegArSHpNHJKldNeq03FQCwYvfMVWajOK8= github.com/dgraph-io/ristretto v0.1.1/go.mod h1:S1GPSBCYCIhmVNfcth17y2zZtQT6wzkzgwUve0VDWWA= github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 h1:fAjc9m62+UWV/WAFKLNi6ZS0675eEUC9y3AlwSbQu1Y= github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/dlclark/regexp2 v1.11.5 h1:Q/sSnsKerHeCkc/jSTNq1oCm7KiVgUMZRDUoRu0JQZQ= github.com/dlclark/regexp2 v1.11.5/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= github.com/dvsekhvalnov/jose2go v1.6.0 h1:Y9gnSnP4qEI0+/uQkHvFXeD2PLPJeXEL+ySMEA2EjTY= github.com/dvsekhvalnov/jose2go v1.6.0/go.mod h1:QsHjhyTlD/lAVqn/NSbVZmSCGeDehTB/mPZadG+mhXU= github.com/eapache/queue/v2 v2.0.0-20230407133247-75960ed334e4 h1:8EXxF+tCLqaVk8AOC29zl2mnhQjwyLxxOTuhUazWRsg= github.com/eapache/queue/v2 v2.0.0-20230407133247-75960ed334e4/go.mod h1:I5sHm0Y0T1u5YjlyqC5GVArM7aNZRUYtTjmJ8mPJFds= github.com/ebitengine/purego v0.6.0-alpha.5 h1:EYID3JOAdmQ4SNZYJHu9V6IqOeRQDBYxqKAg9PyoHFY= github.com/ebitengine/purego v0.6.0-alpha.5/go.mod h1:ah1In8AOtksoNK6yk5z1HTJeUkC1Ez4Wk2idgGslMwQ= github.com/emicklei/dot v1.6.2 h1:08GN+DD79cy/tzN6uLCT84+2Wk9u+wvqP+Hkx/dIR8A= github.com/emicklei/dot v1.6.2/go.mod h1:DeV7GvQtIw4h2u73RKBkkFdvVAz0D9fzeJrgPW6gy/s= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5 h1:Yzb9+7DPaBjB8zlTR87/ElzFsnQfuHnVUVqpZZIcV5Y= github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5/go.mod h1:a2zkGnVExMxdzMo3M0Hi/3sEU+cWnZpSni0O6/Yb/P0= github.com/ethereum/c-kzg-4844 v1.0.0 h1:0X1LBXxaEtYD9xsyj9B9ctQEZIpnvVDeoBx8aHEwTNA= github.com/ethereum/c-kzg-4844 v1.0.0/go.mod h1:VewdlzQmpT5QSrVhbBuGoCdFJkpaJlO1aQputP83wc0= github.com/ethereum/go-ethereum v1.14.3 h1:5zvnAqLtnCZrU9uod1JCvHWJbPMURzYFHfc2eHz4PHA= github.com/ethereum/go-ethereum v1.14.3/go.mod h1:1STrq471D0BQbCX9He0hUj4bHxX2k6mt5nOQJhDNOJ8= github.com/fasthttp/router v1.5.2 h1:ckJCCdV7hWkkrMeId3WfEhz+4Gyyf6QPwxi/RHIMZ6I= github.com/fasthttp/router v1.5.2/go.mod h1:C8EY53ozOwpONyevc/V7Gr8pqnEjwnkFFqPo1alAGs0= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM= github.com/fatih/color v1.18.0/go.mod h1:4FelSpRwEGDpQ12mAdzqdOukCy4u8WUtOY6lkT/6HfU= github.com/fbsobreira/gotron-sdk v0.0.0-20230907131216-1e824406fe8c h1:7NIY9Q4Kpjxja807mi3PJieLX63c/Gm35L8ffCemNUA= github.com/fbsobreira/gotron-sdk v0.0.0-20230907131216-1e824406fe8c/go.mod h1:uxY3MGTmqItqUr8gJzmpo8vrBAUHKW2JrGp3yYcL8us= github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/fjl/memsize v0.0.2 h1:27txuSD9or+NZlnOWdKUxeBzTAUkWCVh+4Gf2dWFOzA= github.com/fjl/memsize v0.0.2/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0= github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= github.com/gabriel-vasile/mimetype v1.4.5 h1:J7wGKdGu33ocBOhGy0z653k/lFKLFDPJMG8Gql0kxn4= github.com/gabriel-vasile/mimetype v1.4.5/go.mod h1:ibHel+/kbxn9x2407k1izTA1S81ku1z/DlgOW2QE0M4= github.com/gagliardetto/binary v0.8.0 h1:U9ahc45v9HW0d15LoN++vIXSJyqR/pWw8DDlhd7zvxg= github.com/gagliardetto/binary v0.8.0/go.mod h1:2tfj51g5o9dnvsc+fL3Jxr22MuWzYXwx9wEoN0XQ7/c= github.com/gagliardetto/solana-go v1.12.0 h1:rzsbilDPj6p+/DOPXBMLhwMZeBgeRuXjm5zQFCoXgsg= github.com/gagliardetto/solana-go v1.12.0/go.mod h1:l/qqqIN6qJJPtxW/G1PF4JtcE3Zg2vD2EliZrr9Gn5k= github.com/gagliardetto/treeout v0.1.4 h1:ozeYerrLCmCubo1TcIjFiOWTTGteOOHND1twdFpgwaw= github.com/gagliardetto/treeout v0.1.4/go.mod h1:loUefvXTrlRG5rYmJmExNryyBRh8f89VZhmMOyCyqok= github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff h1:tY80oXqGNY4FhTFhk+o9oFHGINQ/+vhlm8HFzi6znCI= github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= github.com/gballet/go-verkle v0.1.1-0.20231031103413-a67434b50f46 h1:BAIP2GihuqhwdILrV+7GJel5lyPV3u1+PgzrWLc0TkE= github.com/gballet/go-verkle v0.1.1-0.20231031103413-a67434b50f46/go.mod h1:QNpY22eby74jVhqH4WhDLDwxc/vqsern6pW+u2kbkpc= github.com/getsentry/raven-go v0.2.0 h1:no+xWJRb5ZI7eE8TWgIq1jLulQiIoLG0IfYxv5JYMGs= github.com/getsentry/raven-go v0.2.0/go.mod h1:KungGk8q33+aIAZUIVWZDr2OfAEBsO49PX4NzFV5kcQ= github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gin-contrib/cors v1.4.0 h1:oJ6gwtUl3lqV0WEIwM/LxPF1QZ5qe2lGWdY2+bz7y0g= github.com/gin-contrib/cors v1.4.0/go.mod h1:bs9pNM0x/UsmHPBWT2xZz9ROh8xYjYkiURUfmBoMlcs= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= github.com/gin-gonic/gin v1.8.1/go.mod h1:ji8BvRH1azfM+SYow9zQ6SZMvR8qOMZHmsCuWR9tTTk= github.com/gin-gonic/gin v1.10.0 h1:nTuyha1TYqgedzytsKYqna+DfLos46nTv2ygFy86HFU= github.com/gin-gonic/gin v1.10.0/go.mod h1:4PMNQiOhvDRa013RKVbsiNwoyezlm2rm0uX/T7kzp5Y= github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og= github.com/go-faster/errors v0.7.1 h1:MkJTnDoEdi9pDabt1dpWf7AA8/BaSYZqibYyhZ20AYg= github.com/go-faster/errors v0.7.1/go.mod h1:5ySTjWFiphBs07IKuiL69nxdfd5+fzh1u7FPGZP2quo= github.com/go-faster/jx v1.1.0 h1:ZsW3wD+snOdmTDy9eIVgQdjUpXRRV4rqW8NS3t+20bg= github.com/go-faster/jx v1.1.0/go.mod h1:vKDNikrKoyUmpzaJ0OkIkRQClNHFX/nF3dnTJZb3skg= github.com/go-faster/xor v0.3.0/go.mod h1:x5CaDY9UKErKzqfRfFZdfu+OSTfoZny3w5Ak7UxcipQ= github.com/go-faster/xor v1.0.0 h1:2o8vTOgErSGHP3/7XwA5ib1FTtUsNtwCoLLBjl31X38= github.com/go-faster/xor v1.0.0/go.mod h1:x5CaDY9UKErKzqfRfFZdfu+OSTfoZny3w5Ak7UxcipQ= github.com/go-faster/yaml v0.4.6 h1:lOK/EhI04gCpPgPhgt0bChS6bvw7G3WwI8xxVe0sw9I= github.com/go-faster/yaml v0.4.6/go.mod h1:390dRIvV4zbnO7qC9FGo6YYutc+wyyUSHBgbXL52eXk= github.com/go-kit/kit v0.12.0 h1:e4o3o3IsBfAKQh5Qbbiqyfu97Ku7jrO/JbohvztANh4= github.com/go-kit/kit v0.12.0/go.mod h1:lHd+EkCZPIwYItmGDDRdhinkzX2A1sj+M9biaEaizzs= github.com/go-kit/log v0.2.1 h1:MRVx0/zhvdseW+Gza6N9rVzU/IVzaeE1SFI4raAhmBU= github.com/go-kit/log v0.2.1/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= github.com/go-logfmt/logfmt v0.6.0 h1:wGYYu3uicYdqXVgoYbvnkrPVXkuLM1p1ifugDMEdRi4= github.com/go-logfmt/logfmt v0.6.0/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-ole/go-ole v1.2.5/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= github.com/go-ole/go-ole v1.3.0 h1:Dt6ye7+vXGIKZ7Xtk4s6/xVdGDQynvom7xCFEdWr6uE= github.com/go-ole/go-ole v1.3.0/go.mod h1:5LS6F96DhAwUc7C+1HLexzMXY1xGRSryjyPPKW6zv78= github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s= github.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/locales v0.14.0/go.mod h1:sawfccIbzZTqEDETgFXqTho0QybSa7l++s0DH+LDiLs= github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= github.com/go-playground/universal-translator v0.18.0/go.mod h1:UvRDBj+xPUEGrFYl+lu/H90nyDXpg0fqeB/AQUGNTVA= github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= github.com/go-playground/validator/v10 v10.10.0/go.mod h1:74x4gJWsvQexRdW8Pn3dXSGrTK4nAUsbPlLADvpJkos= github.com/go-playground/validator/v10 v10.22.0 h1:k6HsTZ0sTnROkhS//R0O+55JgM8C4Bx7ia+JlgcnOao= github.com/go-playground/validator/v10 v10.22.0/go.mod h1:dbuPbCMFw/DrkbEynArYaCwl3amGuJotoKCe95atGMM= github.com/go-redis/redis v6.15.5+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= github.com/go-redis/redis v6.15.9+incompatible h1:K0pv1D7EQUjfyoMql+r/jZqCLizCGKFlFgcHWWmHQjg= github.com/go-redis/redis v6.15.9+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= github.com/go-resty/resty/v2 v2.16.2 h1:CpRqTjIzq/rweXUt9+GxzzQdlkqMdt8Lm/fuK/CAbAg= github.com/go-resty/resty/v2 v2.16.2/go.mod h1:0fHAoK7JoBy/Ch36N8VFeMsK7xQOHhvWaC3iOktwmIU= github.com/go-rod/rod v0.113.0/go.mod h1:aiedSEFg5DwG/fnNbUOTPMTTWX3MRj6vIs/a684Mthw= github.com/go-rod/rod v0.116.2 h1:A5t2Ky2A+5eD/ZJQr1EfsQSe5rms5Xof/qj296e+ZqA= github.com/go-rod/rod v0.116.2/go.mod h1:H+CMO9SCNc2TJ2WfrG+pKhITz57uGNYU43qYHh438Mg= github.com/go-rod/stealth v0.4.9 h1:X2PmQk4DUF2wzw6GOsWjW/glb8K5ebnftbEvLh7MlZ4= github.com/go-rod/stealth v0.4.9/go.mod h1:eAzyvw8c0iAd5nJJsSWeh0fQ5z94vCIfdi1hUmYDimc= github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-sql-driver/mysql v1.7.0 h1:ueSltNNllEqE3qcWBTD0iQd3IpL/6U+mJxLkazJ7YPc= github.com/go-sql-driver/mysql v1.7.0/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y= github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8= github.com/gobwas/httphead v0.1.0 h1:exrUm0f4YX0L7EBwZHuCF4GDp8aJfVeBrlLQrs6NqWU= github.com/gobwas/httphead v0.1.0/go.mod h1:O/RXo79gxV8G+RqlR/otEwx4Q36zl9rqC5u12GKvMCM= github.com/gobwas/pool v0.2.1 h1:xfeeEhW7pwmX8nuLVlqbzVc7udMDrwetjEv+TZIz1og= github.com/gobwas/pool v0.2.1/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= github.com/gobwas/ws v1.4.0 h1:CTaoG1tojrh4ucGPcoJFiAQUAsEWekEWvLy7GsVNqGs= github.com/gobwas/ws v1.4.0/go.mod h1:G3gNqMNtPppf5XUz7O4shetPpcZ1VJ7zt18dlUeakrc= github.com/goccy/go-json v0.9.7/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/goccy/go-json v0.10.3 h1:KZ5WoDbxAIgm2HNbYckL0se1fHD6rz5j4ywS6ebzDqA= github.com/goccy/go-json v0.10.3/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M= github.com/gocolly/colly v1.2.0 h1:qRz9YAn8FIH0qzgNUw+HT9UN7wm1oF9OBAilwEWpyrI= github.com/gocolly/colly v1.2.0/go.mod h1:Hof5T3ZswNVsOHYmba1u03W65HDWgpV5HifSuueE0EA= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 h1:ZpnhV/YsD2/4cESfV5+Hoeu/iUR3ruzNvZ+yQfO03a0= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4= github.com/gofrs/flock v0.8.1 h1:+gYjHKf32LDeiEEFhQaotPbLuUXjY5ZqxKgXy7n59aw= github.com/gofrs/flock v0.8.1/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU= github.com/gogo/googleapis v1.4.1 h1:1Yx4Myt7BxzvUr5ldGSbwYiZG6t9wGBZ+8/fX3Wvtq0= github.com/gogo/googleapis v1.4.1/go.mod h1:2lpHqI5OcWCtVElxXnPt+s8oJvMpySlOyM6xDCrzib4= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0= github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9 h1:au07oEsX2xN0ktxqI+Sida1w446QrXBRJ0nee3SNZlA= github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0= github.com/golang-sql/sqlexp v0.1.0 h1:ZCD6MBpcuOVfGVqsEmY5/4FtYiKz6tSyUv9LPEDei6A= github.com/golang-sql/sqlexp v0.1.0/go.mod h1:J4ad9Vo8ZCWQ2GMrC4UCQy1JpCbwU9m3EOqtpKwwwHI= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/glog v1.2.2 h1:1+mZ9upx1Dh6FmUTFR1naJ77miKiXgALjWOZ3NVFPmY= github.com/golang/glog v1.2.2/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.0/go.mod h1:Qd/q+1AKNOZr9uGQzbzCmRO6sUih6GTPZv6a1/R87v0= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb h1:PBC98N2aIaM3XXiurYmW7fx4GZkL8feAMVq7nEjURHk= github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v1.1.3 h1:CVpQJjYgC4VbzxeGVHfvZrv1ctoYCAI8vbl07Fcxlyg= github.com/google/btree v1.1.3/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian/v3 v3.3.3 h1:DIhPTQrbPkgs2yJYdXU/eNACCG5DVQjySNRNlflZ9Fc= github.com/google/martian/v3 v3.3.3/go.mod h1:iEPrYcgCF7jA9OtScMFQyAlZZ4YXTKEtJ1E6RWzmBA0= github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20240727154555-813a5fbdbec8 h1:FKHo8hFI3A+7w0aUQuYXQ+6EN5stWmeY/AZqtM8xk9k= github.com/google/pprof v0.0.0-20240727154555-813a5fbdbec8/go.mod h1:K1liHPHnj73Fdn/EKuT8nrFqBihUSKXoLYU0BuatOYo= github.com/google/s2a-go v0.1.7 h1:60BLSyTrOV4/haCDW4zb1guZItoSq8foHCXrAnjBo/o= github.com/google/s2a-go v0.1.7/go.mod h1:50CgR4k1jNlWBu4UfS4AcfhVe1r6pdZPygJ3R8F0Qdw= github.com/google/subcommands v1.2.0/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/enterprise-certificate-proxy v0.3.2 h1:Vie5ybvEvT75RniqhfFxPRy3Bf7vr3h0cechB90XaQs= github.com/googleapis/enterprise-certificate-proxy v0.3.2/go.mod h1:VLSiSSBs/ksPL8kq3OBOQ6WRI2QnaFynd1DCjZ62+V0= github.com/googleapis/gax-go/v2 v2.12.5 h1:8gw9KZK8TiVKB6q3zHY3SBzLnrGp6HQjyfYBYGmXdxA= github.com/googleapis/gax-go/v2 v2.12.5/go.mod h1:BUDKcWo+RaKq5SC9vVYL0wLADa3VcfswbOMMRmB9H3E= github.com/gorilla/handlers v1.5.1 h1:9lRY6j8DEeeBT10CvO9hGW0gmky0BprnvDI5vfhUHH4= github.com/gorilla/handlers v1.5.1/go.mod h1:t8XrUpc4KVXb7HGyJ4/cEnwQiaxrX/hz1Zv/4g96P1Q= github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY= github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ= github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg= github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gotd/ige v0.2.2 h1:XQ9dJZwBfDnOGSTxKXBGP4gMud3Qku2ekScRjDWWfEk= github.com/gotd/ige v0.2.2/go.mod h1:tuCRb+Y5Y3eNTo3ypIfNpQ4MFjrnONiL2jN2AKZXmb0= github.com/gotd/neo v0.1.5 h1:oj0iQfMbGClP8xI59x7fE/uHoTJD7NZH9oV1WNuPukQ= github.com/gotd/neo v0.1.5/go.mod h1:9A2a4bn9zL6FADufBdt7tZt+WMhvZoc5gWXihOPoiBQ= github.com/gotd/td v0.122.0 h1:xIqoYI02ElZjj+KxOfvoUjA63m7MGWZkemM4m42aqRE= github.com/gotd/td v0.122.0/go.mod h1:vPC2X2rcRQYAGVr9EgmQgswHcj8Ps0Tt66XylR3CxrI= github.com/grbit/go-json v0.11.0 h1:bAbyMdYrYl/OjYsSqLH99N2DyQ291mHy726Mx+sYrnc= github.com/grbit/go-json v0.11.0/go.mod h1:IYpHsdybQ386+6g3VE6AXQ3uTGa5mquBme5/ZWmtzek= github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 h1:UH//fgunKIs4JdUbpDl1VZCDaL56wXCB/5+wF6uHfaI= github.com/grpc-ecosystem/go-grpc-middleware v1.4.0/go.mod h1:g5qyo/la0ALbONm6Vbp88Yd8NsDy6rZz+RcrMPxvld8= github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c h1:6rhixN/i8ZofjG1Y75iExal34USq5p+wiN1tpie8IrU= github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c/go.mod h1:NMPJylDgVpX0MLRlPy15sqSwOFv/U1GZ2m21JhFfek0= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-bexpr v0.1.10 h1:9kuI5PFotCboP3dkDYFr/wi0gg0QVbSNz5oFRpxn4uE= github.com/hashicorp/go-bexpr v0.1.10/go.mod h1:oxlubA2vC/gFVfX1A6JGp7ls7uCDlfJn732ehYYg+g0= github.com/hashicorp/go-hclog v1.6.3 h1:Qr2kF+eVWjTiYmU7Y31tYlP1h0q/X3Nl3tPGdaB11/k= github.com/hashicorp/go-hclog v1.6.3/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc= github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-metrics v0.5.3 h1:M5uADWMOGCTUNU1YuC4hfknOeHNaX54LDm4oYSucoNE= github.com/hashicorp/go-metrics v0.5.3/go.mod h1:KEjodfebIOuBYSAe/bHTm+HChmKSxAOXPBieMLYozDE= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= github.com/hashicorp/go-plugin v1.5.2 h1:aWv8eimFqWlsEiMrYZdPYl+FdHaBJSN4AWwGWfT1G2Y= github.com/hashicorp/go-plugin v1.5.2/go.mod h1:w1sAEES3g3PuV/RzUrgow20W2uErMly84hhD3um1WL4= github.com/hashicorp/go-secure-stdlib/parseutil v0.1.7 h1:UpiO20jno/eV1eVZcxqWnUohyKRe1g8FPV/xH1s/2qs= github.com/hashicorp/go-secure-stdlib/parseutil v0.1.7/go.mod h1:QmrqtbKuxxSWTN3ETMPuB+VtEiBJ/A9XhoYGv8E1uD8= github.com/hashicorp/go-secure-stdlib/strutil v0.1.1/go.mod h1:gKOamz3EwoIoJq7mlMIRBpVTAUn8qPCrEclOKKWhD3U= github.com/hashicorp/go-secure-stdlib/strutil v0.1.2 h1:kes8mmyCpxJsI7FTwtzRqEy9CdjCtrXrXGuOpxEA7Ts= github.com/hashicorp/go-secure-stdlib/strutil v0.1.2/go.mod h1:Gou2R9+il93BqX25LAKCLuM+y9U2T4hlwvT1yprcna4= github.com/hashicorp/go-sockaddr v1.0.2 h1:ztczhD1jLxIRjVejw8gFomI1BQZOe2WoVOu0SyteCQc= github.com/hashicorp/go-sockaddr v1.0.2/go.mod h1:rB4wwRAUzs07qva3c5SdrY/NEtAUjGlgmH/UkBUC97A= github.com/hashicorp/golang-lru v1.0.2 h1:dV3g9Z/unq5DpblPpw+Oqcv4dU/1omnb4Ok8iPY6p1c= github.com/hashicorp/golang-lru v1.0.2/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/hcl v1.0.1-vault-5 h1:kI3hhbbyzr4dldA8UdTb7ZlVVlI2DACdCfz31RPDgJM= github.com/hashicorp/hcl v1.0.1-vault-5/go.mod h1:XYhtn6ijBSAj6n4YqAaf7RBPS4I06AItNorpy+MoQNM= github.com/hashicorp/yamux v0.1.1 h1:yrQxtgseBDrq9Y652vSRDvsKCJKOUD+GzTS4Y0Y8pvE= github.com/hashicorp/yamux v0.1.1/go.mod h1:CtWFDAQgb7dxtzFs4tWbplKIe2jSi3+5vKbgIO0SLnQ= github.com/hdevalence/ed25519consensus v0.1.0 h1:jtBwzzcHuTmFrQN6xQZn6CQEO/V9f7HsjsjeEZ6auqU= github.com/hdevalence/ed25519consensus v0.1.0/go.mod h1:w3BHWjwJbFU29IRHL1Iqkw3sus+7FctEyM4RqDxYNzo= github.com/holiman/billy v0.0.0-20240216141850-2abb0c79d3c4 h1:X4egAf/gcS1zATw6wn4Ej8vjuVGxeHdan+bRb2ebyv4= github.com/holiman/billy v0.0.0-20240216141850-2abb0c79d3c4/go.mod h1:5GuXa7vkL8u9FkFuWdVvfR5ix8hRB7DbOAaYULamFpc= github.com/holiman/bloomfilter/v2 v2.0.3 h1:73e0e/V0tCydx14a0SCYS/EWCxgwLZ18CZcZKVu0fao= github.com/holiman/bloomfilter/v2 v2.0.3/go.mod h1:zpoh+gs7qcpqrHr3dB55AMiJwo0iURXE7ZOP9L9hSkA= github.com/holiman/uint256 v1.2.4 h1:jUc4Nk8fm9jZabQuqr2JzednajVmBpC+oiTiXZJEApU= github.com/holiman/uint256 v1.2.4/go.mod h1:EOMSn4q6Nyt9P6efbI3bueV4e1b3dGlUCXeiRV4ng7E= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/huandu/skiplist v1.2.0 h1:gox56QD77HzSC0w+Ws3MH3iie755GBJU1OER3h5VsYw= github.com/huandu/skiplist v1.2.0/go.mod h1:7v3iFjLcSAzO4fN5B8dvebvo/qsfumiLiDXMrPiHF9w= github.com/huin/goupnp v1.3.0 h1:UvLUlWDNpoUdYzb2TCn+MuTWtcjXKSza2n6CBdQ0xXc= github.com/huin/goupnp v1.3.0/go.mod h1:gnGPsThkYa7bFi/KWmEysQRf48l2dvR5bxr2OFckNX8= github.com/iancoleman/strcase v0.3.0 h1:nTXanmYxhfFAMjZL34Ov6gkzEsSJZ5DbhxWjvSASxEI= github.com/iancoleman/strcase v0.3.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/improbable-eng/grpc-web v0.15.0 h1:BN+7z6uNXZ1tQGcNAuaU1YjsLTApzkjt2tzCixLaUPQ= github.com/improbable-eng/grpc-web v0.15.0/go.mod h1:1sy9HKV4Jt9aEs9JSnkWlRJPuPtwNr0l57L4f878wP8= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM= github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg= github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a h1:bbPeKD0xmW/Y25WS6cokEszi5g+S0QxI/d45PkRi7Nk= github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM= github.com/jackc/pgx/v5 v5.6.0 h1:SWJzexBzPL5jb0GEsrPMLIsi/3jOo7RHlzTjcAeDrPY= github.com/jackc/pgx/v5 v5.6.0/go.mod h1:DNZ/vlrUnhWCoFGxHAG8U2ljioxukquj7utPDgtQdTw= github.com/jackc/puddle/v2 v2.2.1 h1:RhxXJtFG022u4ibrCSMSiu5aOq1i77R3OHKNJj77OAk= github.com/jackc/puddle/v2 v2.2.1/go.mod h1:vriiEXHvEE654aYKXXjOvZM39qJ0q+azkZFrfEOc3H4= github.com/jackpal/go-nat-pmp v1.0.2 h1:KzKSgb7qkJvOUTqYl9/Hg/me3pWgBmERKrTGD7BdWus= github.com/jackpal/go-nat-pmp v1.0.2/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc= github.com/jasonlvhit/gocron v0.0.1 h1:qTt5qF3b3srDjeOIR4Le1LfeyvoYzJlYpqvG7tJX5YU= github.com/jasonlvhit/gocron v0.0.1/go.mod h1:k9a3TV8VcU73XZxfVHCHWMWF9SOqgoku0/QlY2yvlA4= github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jinzhu/copier v0.4.0 h1:w3ciUoD19shMCRargcpm0cm91ytaBhDvuRpz1ODO/U8= github.com/jinzhu/copier v0.4.0/go.mod h1:DfbEm0FYsaqBcKcFuvmOZb218JkPGtvSHsKg8S8hyyg= github.com/jinzhu/gorm v1.9.16 h1:+IyIjPEABKRpsu/F8OvDPy9fyQlgsg2luMV2ZIH5i5o= github.com/jinzhu/gorm v1.9.16/go.mod h1:G3LB3wezTOWM2ITLzPxEXgSkOXAntiLHS7UdBefADcs= github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E= github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= github.com/jinzhu/now v1.0.1/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= github.com/jinzhu/now v1.1.4/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ= github.com/jinzhu/now v1.1.5/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= github.com/jmhodges/levigo v1.0.0 h1:q5EC36kV79HWeTBWsod3mG11EgStG3qArTKcvlksN1U= github.com/jmhodges/levigo v1.0.0/go.mod h1:Q6Qx+uH3RAqyK4rFQroq9RL7mdkABMcfhEI+nNuzMJQ= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 h1:Z9n2FFNUXsshfwJMBgNA0RU6/i7WVaAegv3PtuIHPMs= github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8= github.com/kennygrant/sanitize v1.2.4 h1:gN25/otpP5vAsO2djbMhF/LQX6R7+O1TB4yv8NzpJ3o= github.com/kennygrant/sanitize v1.2.4/go.mod h1:LGsjYYtgxbetdg5owWB2mpgUL6e2nfw2eObZ0u0qvak= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4= github.com/klauspost/compress v1.11.4/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.18.0 h1:c/Cqfb0r+Yi+JtIEq73FWXVkRonBlf0CRNYc8Zttxdo= github.com/klauspost/compress v1.18.0/go.mod h1:2Pp+KzxcywXVXMr50+X0Q/Lsb43OQHYWRCY2AiWywWQ= github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/klauspost/cpuid/v2 v2.2.8 h1:+StwCXwm9PdpiEkPyzBXIy+M9KUb4ODm0Zarf1kS5BM= github.com/klauspost/cpuid/v2 v2.2.8/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= github.com/knz/go-libedit v1.10.1/go.mod h1:MZTVkCWyz0oBc7JOWP3wNAzd002ZbM/5hgShxwh4x8M= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/leanovate/gopter v0.2.9 h1:fQjYxZaynp97ozCzfOyOuAGOU4aU/z37zf/tOujFk7c= github.com/leanovate/gopter v0.2.9/go.mod h1:U2L/78B+KVFIx2VmW6onHJQzXtFb+p5y3y2Sh+Jxxv8= github.com/ledongthuc/pdf v0.0.0-20220302134840-0c2507a12d80 h1:6Yzfa6GP0rIo/kULo2bwGEkFvCePZ3qHDDTC3/J9Swo= github.com/ledongthuc/pdf v0.0.0-20220302134840-0c2507a12d80/go.mod h1:imJHygn/1yfhB7XSJJKlFZKl/J+dCPAknuiaGOshXAs= github.com/leekchan/accounting v1.0.0 h1:+Wd7dJ//dFPa28rc1hjyy+qzCbXPMR91Fb6F1VGTQHg= github.com/leekchan/accounting v1.0.0/go.mod h1:3timm6YPhY3YDaGxl0q3eaflX0eoSx3FXn7ckHe4tO0= github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= github.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ= github.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI= github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.1.1/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw= github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/linxGnu/grocksdb v1.8.14 h1:HTgyYalNwBSG/1qCQUIott44wU5b2Y9Kr3z7SK5OfGQ= github.com/linxGnu/grocksdb v1.8.14/go.mod h1:QYiYypR2d4v63Wj1adOOfzglnoII0gLj3PNh4fZkcFA= github.com/logrusorgru/aurora v2.0.3+incompatible h1:tOpm7WcpBTn4fjmVfgpQq0EfczGlG91VSDkswnjF5A8= github.com/logrusorgru/aurora v2.0.3+incompatible/go.mod h1:7rIyQOR62GCctdiQpZ/zOJlFyk6y+94wXzv6RNZgaR4= github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I= github.com/lufia/plan9stats v0.0.0-20220913051719-115f729f3c8c h1:VtwQ41oftZwlMnOEbMWQtSEUgU64U4s+GHk7hZK+jtY= github.com/lufia/plan9stats v0.0.0-20220913051719-115f729f3c8c/go.mod h1:JKx41uQRwqlTZabZc+kILPrO/3jlKnQ2Z8b7YiVw5cE= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U= github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/mattn/go-sqlite3 v1.14.0/go.mod h1:JIl7NbARA7phWnGvh0LKTyg7S9BA+6gx71ShQilpsus= github.com/mattn/go-sqlite3 v1.14.18 h1:JL0eqdCOq6DJVNPSvArO/bIV9/P7fbGrV00LZHc+5aI= github.com/mattn/go-sqlite3 v1.14.18/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg= github.com/microsoft/go-mssqldb v0.21.0 h1:p2rpHIL7TlSv1QrbXJUAcbyRKnIT0C9rRkH2E4OjLn8= github.com/microsoft/go-mssqldb v0.21.0/go.mod h1:+4wZTUnz/SV6nffv+RRRB/ss8jPng5Sho2SmM1l2ts4= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-testing-interface v1.14.1 h1:jrgshOhYAUVNMAJiKbEu7EqAwgJJ2JqpQmpLJOu07cU= github.com/mitchellh/go-testing-interface v1.14.1/go.mod h1:gfgS7OtZj6MA4U1UrDRp04twqAjfvlZyCfX3sDjEym8= github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c h1:cqn374mizHuIWj+OSJCajGr/phAmuMug9qIX3l9CflE= github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/pointerstructure v1.2.0 h1:O+i9nHnXS3l/9Wu7r4NrEdwA2VFTicjUEN1uBnDo34A= github.com/mitchellh/pointerstructure v1.2.0/go.mod h1:BRAsLI5zgXmw97Lf6s25bs8ohIXc3tViBH44KcwB2g4= github.com/mmcloughlin/addchain v0.4.0 h1:SobOdjm2xLj1KkXN5/n0xTIWyZA2+s99UCY1iPfkHRY= github.com/mmcloughlin/addchain v0.4.0/go.mod h1:A86O+tHqZLMNO4w6ZZ4FlVQEadcoqkyU72HC5wJ4RlU= github.com/mmcloughlin/profile v0.1.1/go.mod h1:IhHD7q1ooxgwTgjxQYkACGA77oFTDdFVejUS1/tS/qU= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/mostynb/zstdpool-freelist v0.0.0-20201229113212-927304c0c3b1 h1:mPMvm6X6tf4w8y7j9YIt6V9jfWhL6QlbEc7CCmeQlWk= github.com/mostynb/zstdpool-freelist v0.0.0-20201229113212-927304c0c3b1/go.mod h1:ye2e/VUEtE2BHE+G/QcKkcLQVAEJoYRFj5VUOQatCRE= github.com/mr-tron/base58 v1.2.0 h1:T/HDJBh4ZCPbU39/+c3rRvE0uKBQlU27+QI8LJ4t64o= github.com/mr-tron/base58 v1.2.0/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= github.com/mtibben/percent v0.2.1 h1:5gssi8Nqo8QU/r2pynCm+hBQHpkB/uNK7BJCFogWdzs= github.com/mtibben/percent v0.2.1/go.mod h1:KG9uO+SZkUp+VkRHsCdYQV3XSZrrSpR3O9ibNBTZrns= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mymmrac/telego v0.31.4 h1:NpiNl0P/8eydknka/k6XaaaWVj5BKMlM3Ibba63QTBU= github.com/mymmrac/telego v0.31.4/go.mod h1:T12js1PgbYDYznvoN05MSMuPMfWTYo7D9LKl5cPFWiI= github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646 h1:zYyBkD/k9seD2A7fsi6Oo2LfFZAehjjQMERAvZLEDnQ= github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646/go.mod h1:jpp1/29i3P1S/RLdc7JQKbRpFeM1dOBd8T9ki5s+AY8= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a h1:dlRvE5fWabOchtH7znfiFCcOvmIYgOeAS5ifBXBlh9Q= github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a/go.mod h1:hVoHR2EVESiICEMbg137etN/Lx+lSrHPTD39Z/uE+2s= github.com/ogen-go/ogen v1.10.1 h1:oeSN8AF9mhTVfapbMuL8pQTF2ToqyW9xXaStmOhHKTA= github.com/ogen-go/ogen v1.10.1/go.mod h1:fXCg9PsNYEzJ8ABdmZ2A7j4hMi9EDHP53jzsNtIM3d0= github.com/oklog/run v1.1.0 h1:GEenZ1cK0+q0+wsJew9qUg/DyD8k3JzYsZAi5gYi2mA= github.com/oklog/run v1.1.0/go.mod h1:sVPdnTZT1zYwAJeCMu2Th4T21pA3FPOQRfWjQlk7DVU= github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= github.com/onsi/gomega v1.20.0 h1:8W0cWlwFkflGPLltQvLRB7ZVD5HuP6ng320w2IS245Q= github.com/onsi/gomega v1.20.0/go.mod h1:DtrZpjmvpn2mPm4YWQa0/ALMDj9v4YxLgojwPeREyVo= github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs= github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= github.com/orisano/pixelmatch v0.0.0-20220722002657-fb0b55479cde h1:x0TT0RDC7UhAVbbWWBzr41ElhJx5tXPWkIHA2HWPRuw= github.com/orisano/pixelmatch v0.0.0-20220722002657-fb0b55479cde/go.mod h1:nZgzbfBr3hhjoZnS66nKrHmduYNpc34ny7RK4z5/HM0= github.com/outcaste-io/ristretto v0.2.3 h1:AK4zt/fJ76kjlYObOeNwh4T3asEuaCmp26pOvUOL9w0= github.com/outcaste-io/ristretto v0.2.3/go.mod h1:W8HywhmtlopSB1jeMg3JtdIhf+DYkLAr0VN/s4+MHac= github.com/pborman/uuid v1.2.1 h1:+ZZIw58t/ozdjRaXh/3awHfmWRbzYxJoAdNJxe/3pvw= github.com/pborman/uuid v1.2.1/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml/v2 v2.0.1/go.mod h1:r9LEWfGN8R5k0VXJ+0BkIe7MYkRdwZOjgMj2KwnJFUo= github.com/pelletier/go-toml/v2 v2.2.3 h1:YmeHyLY8mFWbdkNWwpr+qIL2bEqT0o95WSdkNHvL12M= github.com/pelletier/go-toml/v2 v2.2.3/go.mod h1:MfCQTFTvCcUyyvvwm1+G6H/jORL20Xlb6rzQu9GuUkc= github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 h1:jik8PHtAIsPlCRJjJzl4udgEf7hawInF9texMeO2jrU= github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= github.com/philhofer/fwd v1.1.3-0.20240612014219-fbbf4953d986 h1:jYi87L8j62qkXzaYHAQAhEapgukhenIMZRBKTNRLHJ4= github.com/philhofer/fwd v1.1.3-0.20240612014219-fbbf4953d986/go.mod h1:RqIHx9QI14HlwKwm98g9Re5prTQ6LdeRQn+gXJFxsJM= github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4= github.com/pingcap/errors v0.11.4/go.mod h1:Oi8TUi2kEtXXLMJk9l1cGmz20kV3TaQ0usTwv5KuLY8= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c h1:NRoLoZvkBTKvR5gQLgA3e0hqjkY9u1wm+iOL45VN/qI= github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= github.com/prometheus/client_golang v1.20.1 h1:IMJXHOD6eARkQpxo8KkhgEVFlBNm+nkrFUyGlIu7Na8= github.com/prometheus/client_golang v1.20.1/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= github.com/prometheus/common v0.55.0 h1:KEi6DK7lXW/m7Ig5i47x0vRzuBsHuvJdi5ee6Y3G1dc= github.com/prometheus/common v0.55.0/go.mod h1:2SECS4xJG1kd8XF9IcM1gMX6510RAEL65zxzNImwdc8= github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE= github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= github.com/richardartoul/molecule v1.0.1-0.20240531184615-7ca0df43c0b3 h1:4+LEVOB87y175cLJC/mbsgKmoDOjrBldtXvioEy96WY= github.com/richardartoul/molecule v1.0.1-0.20240531184615-7ca0df43c0b3/go.mod h1:vl5+MqJ1nBINuSsUI2mGgH79UweUT/B5Fy8857PqyyI= github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis= github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/rjeczalik/notify v0.9.3 h1:6rJAzHTGKXGj76sbRgDiDcYj/HniypXmSJo1SWakZeY= github.com/rjeczalik/notify v0.9.3/go.mod h1:gF3zSOrafR9DQEWSE8TjfI9NkooDxbyT4UgRGKZA0lc= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ= github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc= github.com/rs/cors v1.11.1 h1:eU3gRzXLRK57F5rKMGMZURNdIG4EoAmX8k94r9wXWHA= github.com/rs/cors v1.11.1/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= github.com/rs/zerolog v1.33.0 h1:1cU2KZkvPxNyfgEmhHAz/1A9Bz+llsdYzklWFzgp0r8= github.com/rs/zerolog v1.33.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/ryanuber/go-glob v1.0.0 h1:iQh3xXAumdQ+4Ufa5b25cRpC5TYKlno6hsv6Cb3pkBk= github.com/ryanuber/go-glob v1.0.0/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIHxIXzX/Yc= github.com/sagikazarmark/locafero v0.4.0 h1:HApY1R9zGo4DBgr7dqsTH/JJxLTTsOt7u6keLGt6kNQ= github.com/sagikazarmark/locafero v0.4.0/go.mod h1:Pe1W6UlPYUk/+wc/6KFhbORCfqzgYEpgQ3O5fPuL3H4= github.com/sagikazarmark/slog-shim v0.1.0 h1:diDBnUNK9N/354PgrxMywXnAwEr1QZcOr6gto+ugjYE= github.com/sagikazarmark/slog-shim v0.1.0/go.mod h1:SrcSrq8aKtyuqEI1uvTDTK1arOWRIczQRv+GVI1AkeQ= github.com/saintfish/chardet v0.0.0-20120816061221-3af4cd4741ca h1:NugYot0LIVPxTvN8n+Kvkn6TrbMyxQiuvKdEwFdR9vI= github.com/saintfish/chardet v0.0.0-20120816061221-3af4cd4741ca/go.mod h1:uugorj2VCxiV1x+LzaIdVa9b4S4qGAcH6cbhh4qVxOU= github.com/sasha-s/go-deadlock v0.3.1 h1:sqv7fDNShgjcaxkO0JNcOAlr8B9+cV5Ey/OB71efZx0= github.com/sasha-s/go-deadlock v0.3.1/go.mod h1:F73l+cr82YSh10GxyRI6qZiCgK64VaZjwesgfQ1/iLM= github.com/sashabaranov/go-openai v1.36.1 h1:EVfRXwIlW2rUzpx6vR+aeIKCK/xylSrVYAx1TMTSX3g= github.com/sashabaranov/go-openai v1.36.1/go.mod h1:lj5b/K+zjTSFxVLijLSTDZuP7adOgerWeFyZLUhAKRg= github.com/savsgio/gotils v0.0.0-20240704082632-aef3928b8a38 h1:D0vL7YNisV2yqE55+q0lFuGse6U8lxlg7fYTctlT5Gc= github.com/savsgio/gotils v0.0.0-20240704082632-aef3928b8a38/go.mod h1:sM7Mt7uEoCeFSCBM+qBrqvEo+/9vdmj19wzp3yzUhmg= github.com/secure-systems-lab/go-securesystemslib v0.7.0 h1:OwvJ5jQf9LnIAS83waAjPbcMsODrTQUpJ02eNLUoxBg= github.com/secure-systems-lab/go-securesystemslib v0.7.0/go.mod h1:/2gYnlnHVQ6xeGtfIqFy7Do03K4cdCY0A/GlJLDKLHI= github.com/segmentio/asm v1.2.0 h1:9BQrFxC+YOHJlTlHGkTrFWf59nbL3XnCoFLTwDCI7ys= github.com/segmentio/asm v1.2.0/go.mod h1:BqMnlJP91P8d+4ibuonYZw9mfnzI9HfxselHZr5aAcs= github.com/shengdoushi/base58 v1.0.0 h1:tGe4o6TmdXFJWoI31VoSWvuaKxf0Px3gqa3sUWhAxBs= github.com/shengdoushi/base58 v1.0.0/go.mod h1:m5uIILfzcKMw6238iWAhP4l3s5+uXyF3+bJKUNhAL9I= github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible h1:Bn1aCHHRnjv4Bl16T8rcaFjYSrGrIZvpiGO6P3Q4GpU= github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= github.com/shirou/gopsutil/v3 v3.24.4 h1:dEHgzZXt4LMNm+oYELpzl9YCqV65Yr/6SfrvgRBtXeU= github.com/shirou/gopsutil/v3 v3.24.4/go.mod h1:lTd2mdiOspcqLgAnr9/nGi71NkeMpWKdmhuxm9GusH8= github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM= github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ= github.com/shoenig/test v0.6.4 h1:kVTaSd7WLz5WZ2IaoM0RSzRsUD+m8wRR+5qvntpn4LU= github.com/shoenig/test v0.6.4/go.mod h1:byHiCGXqrVaflBLAMq/srcZIHynQPQgeyvkvXnjqq0k= github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4= github.com/shopspring/decimal v1.3.1 h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5gKV8= github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo= github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0= github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.11.0 h1:WJQKhtpdm3v2IzqG8VMqrr6Rf3UYpEF239Jy9wNepM8= github.com/spf13/afero v1.11.0/go.mod h1:GH9Y3pIexgf1MTIWtNGyogA5MwRIDXGUr+hbWNoBjkY= github.com/spf13/cast v1.7.0 h1:ntdiHjuueXFgm5nzDRdOS4yfT43P5Fnud6DH50rz/7w= github.com/spf13/cast v1.7.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM= github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.19.0 h1:RWq5SEjt8o25SROyN3z2OrDB9l7RPd3lwTWU8EcEdcI= github.com/spf13/viper v1.19.0/go.mod h1:GQUN9bilAbhU/jgc1bKs99f/suXKeUMct8Adx5+Ntkg= github.com/status-im/keycard-go v0.2.0 h1:QDLFswOQu1r5jsycloeQh3bVU8n/NatHHaZobtDnDzA= github.com/status-im/keycard-go v0.2.0/go.mod h1:wlp8ZLbsmrF6g6WjugPAx+IzoLrkdf9+mHxBEeo3Hbg= github.com/stephenlacy/go-ethereum-hdwallet v0.0.0-20230913225845-a4fa94429863 h1:ba4VRWSkRzgdP5hB5OxexIzBXZbSwgcw8bEu06ivGQI= github.com/stephenlacy/go-ethereum-hdwallet v0.0.0-20230913225845-a4fa94429863/go.mod h1:oPTjPNrRucLv9mU27iNPj6n0CWWcNFhoXFOLVGJwHCA= github.com/streamingfast/logging v0.0.0-20230608130331-f22c91403091 h1:RN5mrigyirb8anBEtdjtHFIufXdacyTi6i4KBfeNXeo= github.com/streamingfast/logging v0.0.0-20230608130331-f22c91403091/go.mod h1:VlduQ80JcGJSargkRU4Sg9Xo63wZD/l8A5NC/Uo1/uU= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= github.com/supranational/blst v0.3.11 h1:LyU6FolezeWAhvQk0k6O/d49jqgO52MSDDfYgbeoEm4= github.com/supranational/blst v0.3.11/go.mod h1:jZJtfjgudtNl4en1tzwPIV3KjUnQUvG3/j+w+fVonLw= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d h1:vfofYNRScrDdvS342BElfbETmL1Aiz3i2t0zfRj16Hs= github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d/go.mod h1:RRCYJbIwD5jmqPI9XoAFR0OcDxqUctll6zUj/+B4S48= github.com/temoto/robotstxt v1.1.1 h1:Gh8RCs8ouX3hRSxxK7B1mO5RFByQ4CmJZDwgom++JaA= github.com/temoto/robotstxt v1.1.1/go.mod h1:+1AmkuG3IYkh1kv0d2qEB9Le88ehNO0zwOr3ujewlOo= github.com/tendermint/go-amino v0.16.0 h1:GyhmgQKvqF82e2oZeuMSp9JTN0N09emoSZlb2lyGa2E= github.com/tendermint/go-amino v0.16.0/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoMC9Sphe2ZwGME= github.com/test-go/testify v1.1.4 h1:Tf9lntrKUMHiXQ07qBScBTSA0dhYQlu83hswqelv1iE= github.com/test-go/testify v1.1.4/go.mod h1:rH7cfJo/47vWGdi4GPj16x3/t1xGOj2YxzmNQzk2ghU= github.com/tidwall/btree v1.7.0 h1:L1fkJH/AuEh5zBnnBbmTwQ5Lt+bRJ5A8EWecslvo9iI= github.com/tidwall/btree v1.7.0/go.mod h1:twD9XRA5jj9VUQGELzDO4HPQTNJsoWWfYEL+EUQ2cKY= github.com/tinylib/msgp v1.2.1 h1:6ypy2qcCznxpP4hpORzhtXyTqrBs7cfM9MCCWY8zsmU= github.com/tinylib/msgp v1.2.1/go.mod h1:2vIGs3lcUo8izAATNobrCHevYZC/LMsJtw4JPiYPHro= github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU= github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI= github.com/tklauser/numcpus v0.6.1 h1:ng9scYS7az0Bk4OZLvrNXNSAO2Pxr1XXRAPyjhIx+Fk= github.com/tklauser/numcpus v0.6.1/go.mod h1:1XfjsgE2zo8GVw7POkMbHENHzVg3GzmoZ9fESEdAacY= github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= github.com/tyler-smith/go-bip39 v1.1.0 h1:5eUemwrMargf3BSLRRCalXT93Ns6pQJIjYQN2nyfOP8= github.com/tyler-smith/go-bip39 v1.1.0/go.mod h1:gUYDtqQw1JS3ZJ8UWVcGTGqqr6YIN3CWg+kkNaLt55U= github.com/ugorji/go v1.2.7/go.mod h1:nF9osbDWLy6bDVv/Rtoh6QgnvNDpmCalQV5urGCCS6M= github.com/ugorji/go/codec v1.2.7/go.mod h1:WGN1fab3R1fzQlVQTkfxVtIBhWDRqOviHU95kRgeqEY= github.com/ugorji/go/codec v1.2.12 h1:9LC83zGrHhuUA9l16C9AHXAqEV/2wBQ4nkvumAE65EE= github.com/ugorji/go/codec v1.2.12/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= github.com/urfave/cli/v2 v2.25.7 h1:VAzn5oq403l5pHjc4OhD54+XGO9cdKVL/7lDjF+iKUs= github.com/urfave/cli/v2 v2.25.7/go.mod h1:8qnjx1vcq5s2/wpsqoZFndg2CE5tNFyrTvS6SinrnYQ= github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= github.com/valyala/fasthttp v1.59.0 h1:Qu0qYHfXvPk1mSLNqcFtEk6DpxgA26hy6bmydotDpRI= github.com/valyala/fasthttp v1.59.0/go.mod h1:GTxNb9Bc6r2a9D0TWNSPwDz78UxnTGBViY3xZNEqyYU= github.com/valyala/fastjson v1.6.4 h1:uAUNq9Z6ymTgGhcm0UynUAB6tlbakBrz6CQFax3BXVQ= github.com/valyala/fastjson v1.6.4/go.mod h1:CLCAqky6SMuOcxStkYQvblddUtoRxhYMGLrsQns1aXY= github.com/vmihailenco/msgpack/v4 v4.3.12 h1:07s4sz9IReOgdikxLTKNbBdqDMLsjPKXwvCazn8G65U= github.com/vmihailenco/msgpack/v4 v4.3.12/go.mod h1:gborTTJjAo/GWTqqRjrLCn9pgNN+NXzzngzBKDPIqw4= github.com/vmihailenco/tagparser v0.1.2 h1:gnjoVuB/kljJ5wICEEOpx98oXMWPLj22G67Vbd1qPqc= github.com/vmihailenco/tagparser v0.1.2/go.mod h1:OeAg3pn3UbLjkWt+rN9oFYB6u/cQgqMEUPoW2WPyhdI= github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU= github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8= github.com/xyproto/randomstring v1.0.5 h1:YtlWPoRdgMu3NZtP45drfy1GKoojuR7hmRcnhZqKjWU= github.com/xyproto/randomstring v1.0.5/go.mod h1:rgmS5DeNXLivK7YprL0pY+lTuhNQW3iGxZ18UQApw/E= github.com/ysmood/fetchup v0.2.3 h1:ulX+SonA0Vma5zUFXtv52Kzip/xe7aj4vqT5AJwQ+ZQ= github.com/ysmood/fetchup v0.2.3/go.mod h1:xhibcRKziSvol0H1/pj33dnKrYyI2ebIvz5cOOkYGns= github.com/ysmood/goob v0.4.0 h1:HsxXhyLBeGzWXnqVKtmT9qM7EuVs/XOgkX7T6r1o1AQ= github.com/ysmood/goob v0.4.0/go.mod h1:u6yx7ZhS4Exf2MwciFr6nIM8knHQIE22lFpWHnfql18= github.com/ysmood/gop v0.0.2/go.mod h1:rr5z2z27oGEbyB787hpEcx4ab8cCiPnKxn0SUHt6xzk= github.com/ysmood/gop v0.2.0 h1:+tFrG0TWPxT6p9ZaZs+VY+opCvHU8/3Fk6BaNv6kqKg= github.com/ysmood/gop v0.2.0/go.mod h1:rr5z2z27oGEbyB787hpEcx4ab8cCiPnKxn0SUHt6xzk= github.com/ysmood/got v0.34.1/go.mod h1:yddyjq/PmAf08RMLSwDjPyCvHvYed+WjHnQxpH851LM= github.com/ysmood/got v0.40.0 h1:ZQk1B55zIvS7zflRrkGfPDrPG3d7+JOza1ZkNxcc74Q= github.com/ysmood/got v0.40.0/go.mod h1:W7DdpuX6skL3NszLmAsC5hT7JAhuLZhByVzHTq874Qg= github.com/ysmood/gotrace v0.6.0 h1:SyI1d4jclswLhg7SWTL6os3L1WOKeNn/ZtzVQF8QmdY= github.com/ysmood/gotrace v0.6.0/go.mod h1:TzhIG7nHDry5//eYZDYcTzuJLYQIkykJzCRIo4/dzQM= github.com/ysmood/gson v0.7.3 h1:QFkWbTH8MxyUTKPkVWAENJhxqdBa4lYTQWqZCiLG6kE= github.com/ysmood/gson v0.7.3/go.mod h1:3Kzs5zDl21g5F/BlLTNcuAGAYLKt2lV5G8D1zF3RNmg= github.com/ysmood/leakless v0.8.0/go.mod h1:R8iAXPRaG97QJwqxs74RdwzcRHT1SWCGTNqY8q0JvMQ= github.com/ysmood/leakless v0.9.0 h1:qxCG5VirSBvmi3uynXFkcnLMzkphdh3xx5FtrORwDCU= github.com/ysmood/leakless v0.9.0/go.mod h1:R8iAXPRaG97QJwqxs74RdwzcRHT1SWCGTNqY8q0JvMQ= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0= github.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= github.com/zksync-sdk/zksync2-go v0.6.0 h1:UH9PwxT3XpBkKfz52iu4ieXFnUMSsLUMuX4eNFBx9UU= github.com/zksync-sdk/zksync2-go v0.6.0/go.mod h1:AwxRw2lrtrcoYbl0LytVASNE/Vwz1wZ3WZ3X8rjLn3o= github.com/zondax/hid v0.9.2 h1:WCJFnEDMiqGF64nlZz28E9qLVZ0KSJ7xpc5DLEyma2U= github.com/zondax/hid v0.9.2/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= github.com/zondax/ledger-go v0.14.3 h1:wEpJt2CEcBJ428md/5MgSLsXLBos98sBOyxNmCjfUCw= github.com/zondax/ledger-go v0.14.3/go.mod h1:IKKaoxupuB43g4NxeQmbLXv7T9AlQyie1UpHb342ycI= go.etcd.io/bbolt v1.3.10 h1:+BqfJTcCzTItrop8mq/lbzL8wSGtj94UO/3U31shqG0= go.etcd.io/bbolt v1.3.10/go.mod h1:bK3UQLPJZly7IlNmV7uVHJDxfe5aK9Ll93e/74Y9oEQ= go.mongodb.org/mongo-driver v1.17.1 h1:Wic5cJIwJgSpBhe3lx3+/RybR5PiYRMpVFgO7cOHyIM= go.mongodb.org/mongo-driver v1.17.1/go.mod h1:wwWm/+BuOddhcq3n68LKRmgk2wXzmF6s0SFOa0GINL4= go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA= go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A= go.opentelemetry.io/collector/component v0.104.0 h1:jqu/X9rnv8ha0RNZ1a9+x7OU49KwSMsPbOuIEykHuQE= go.opentelemetry.io/collector/component v0.104.0/go.mod h1:1C7C0hMVSbXyY1ycCmaMUAR9fVwpgyiNQqxXtEWhVpw= go.opentelemetry.io/collector/config/configtelemetry v0.104.0 h1:eHv98XIhapZA8MgTiipvi+FDOXoFhCYOwyKReOt+E4E= go.opentelemetry.io/collector/config/configtelemetry v0.104.0/go.mod h1:WxWKNVAQJg/Io1nA3xLgn/DWLE/W1QOB2+/Js3ACi40= go.opentelemetry.io/collector/pdata v1.11.0 h1:rzYyV1zfTQQz1DI9hCiaKyyaczqawN75XO9mdXmR/hE= go.opentelemetry.io/collector/pdata v1.11.0/go.mod h1:IHxHsp+Jq/xfjORQMDJjSH6jvedOSTOyu3nbxqhWSYE= go.opentelemetry.io/collector/pdata/pprofile v0.104.0 h1:MYOIHvPlKEJbWLiBKFQWGD0xd2u22xGVLt4jPbdxP4Y= go.opentelemetry.io/collector/pdata/pprofile v0.104.0/go.mod h1:7WpyHk2wJZRx70CGkBio8klrYTTXASbyIhf+rH4FKnA= go.opentelemetry.io/collector/semconv v0.104.0 h1:dUvajnh+AYJLEW/XOPk0T0BlwltSdi3vrjO7nSOos3k= go.opentelemetry.io/collector/semconv v0.104.0/go.mod h1:yMVUCNoQPZVq/IPfrHrnntZTWsLf5YGZ7qwKulIl5hw= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0 h1:4Pp6oUg3+e/6M4C0A/3kJ2VYa++dsWVTtGgLVj5xtHg= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0/go.mod h1:Mjt1i1INqiaoZOMGR1RIUJN+i3ChKoFRqzrRQhlkbs0= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.52.0 h1:9l89oX4ba9kHbBol3Xin3leYJ+252h0zszDtBwyKe2A= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.52.0/go.mod h1:XLZfZboOJWHNKUv7eH0inh0E9VV6eWDFB/9yJyTLPp0= go.opentelemetry.io/otel v1.35.0 h1:xKWKPxrxB6OtMCbmMY021CqC45J+3Onta9MqjhnusiQ= go.opentelemetry.io/otel v1.35.0/go.mod h1:UEqy8Zp11hpkUrL73gSlELM0DupHoiq72dR+Zqel/+Y= go.opentelemetry.io/otel/exporters/prometheus v0.49.0 h1:Er5I1g/YhfYv9Affk9nJLfH/+qCCVVg1f2R9AbJfqDQ= go.opentelemetry.io/otel/exporters/prometheus v0.49.0/go.mod h1:KfQ1wpjf3zsHjzP149P4LyAwWRupc6c7t1ZJ9eXpKQM= go.opentelemetry.io/otel/metric v1.35.0 h1:0znxYu2SNyuMSQT4Y9WDWej0VpcsxkuklLa4/siN90M= go.opentelemetry.io/otel/metric v1.35.0/go.mod h1:nKVFgxBZ2fReX6IlyW28MgZojkoAkJGaE8CpgeAU3oE= go.opentelemetry.io/otel/sdk v1.35.0 h1:iPctf8iprVySXSKJffSS79eOjl9pvxV9ZqOWT0QejKY= go.opentelemetry.io/otel/sdk v1.35.0/go.mod h1:+ga1bZliga3DxJ3CQGg3updiaAJoNECOgJREo9KHGQg= go.opentelemetry.io/otel/sdk/metric v1.35.0 h1:1RriWBmCKgkeHEhM7a2uMjMUfP7MsOF5JpUCaEqEI9o= go.opentelemetry.io/otel/sdk/metric v1.35.0/go.mod h1:is6XYCUMpcKi+ZsOvfluY5YstFnhW0BidkR+gL+qN+w= go.opentelemetry.io/otel/trace v1.35.0 h1:dPpEfJu1sDIqruz7BHFG3c7528f6ddfSWfFDVt/xgMs= go.opentelemetry.io/otel/trace v1.35.0/go.mod h1:WUk7DtFp1Aw2MkvqGdwiXYDZZNvA/1J8o6xRXLrIkyc= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE= go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/mock v0.5.0 h1:KAMbZvZPyBPWgD14IrIQ38QCyjwpvVVV6K/bHl1IwQU= go.uber.org/mock v0.5.0/go.mod h1:ge71pBPLYDk7QIi1LupWxdAykm7KIEFchiOqd6z7qMM= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= go.uber.org/multierr v1.7.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/ratelimit v0.3.1 h1:K4qVE+byfv/B3tC+4nYWP7v/6SimcO7HzHekoMNBma0= go.uber.org/ratelimit v0.3.1/go.mod h1:6euWsTB6U/Nb3X++xEUXA8ciPJvr19Q/0h1+oDcJhRk= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.21.0/go.mod h1:wjWOCqI0f2ZZrJF/UufIOkiC8ii6tm1iqIsLo76RfJw= go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= golang.org/x/arch v0.9.0 h1:ub9TgUInamJ8mrZIGlBG6/4TqWeMszd4N8lNorbrr6k= golang.org/x/arch v0.9.0/go.mod h1:FEVrYAQjsQXMVJ1nsMoVVXPZg6p2JE2mx8psSWTDQys= golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191205180655-e7c4368fe9dd/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220214200702-86341886e292/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc= golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk= golang.org/x/crypto v0.36.0 h1:AnAEvhDddvBdpY+uR+MyHmuZzzNqXSe/GvuDeob5L34= golang.org/x/crypto v0.36.0/go.mod h1:Y4J0ReaxCR1IMaabaSMugxJES1EpwhBHhv2bDHklZvc= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20240909161429-701f63a606c0 h1:e66Fs6Z+fZTbFBAxKfP3PALWBtpfqks2bwGcexMxgtk= golang.org/x/exp v0.0.0-20240909161429-701f63a606c0/go.mod h1:2TbTHSBQa924w8M6Xs1QcRcFwyucIwBGpK1p2f1YFFY= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/mod v0.24.0 h1:ZfthKaKaT4NrhGVZHO1/WDTwGES4De8KtWO0SIbNJMU= golang.org/x/mod v0.24.0/go.mod h1:IXM97Txy2VM4PJ3gI61r1YEk/gAj6zAHN3AdZt6S9Ww= golang.org/x/net v0.0.0-20180218175443-cbe0f9307d01/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200421231249-e086a090c8fd/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= golang.org/x/net v0.38.0 h1:vRMAPTMaeGqVhG5QyLJHqNDwecKTomGeqbnfZyKlBI8= golang.org/x/net v0.38.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.22.0 h1:BzDx2FehcG7jJwgWLELCdmLuxk2i+x9UDpSiss2u0ZA= golang.org/x/oauth2 v0.22.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sync v0.12.0 h1:MHc5BpPuC30uJk597Ri8TV3CNZcTLu6B6z4lJy+g6Jw= golang.org/x/sync v0.12.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180926160741-c2ed4eda69e7/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220627191245-f75cf1eec38b/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.31.0 h1:ioabZlmFYtWhL+TRYpcnNlLwhyxaM9kWTDEmfnprqik= golang.org/x/sys v0.31.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU= golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= golang.org/x/term v0.27.0/go.mod h1:iMsnZpn0cago0GOrHO2+Y7u7JPn5AylBrcoWkElMTSM= golang.org/x/term v0.30.0 h1:PQ39fJZ+mfadBm0y5WlL4vlM7Sx1Hgf13sMIY2+QS9Y= golang.org/x/term v0.30.0/go.mod h1:NYYFdzHoI5wRh/h5tDMdMqCqPJZEuNqVR5xJLd/n67g= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/text v0.23.0 h1:D71I7dUrlY+VX0gQShAThNGHFxZ13dGLBHQLVl1mJlY= golang.org/x/text v0.23.0/go.mod h1:/BLNzu4aZCJ1+kcD0DNRotWKage4q2rGVAg4o22unh4= golang.org/x/time v0.6.0 h1:eTDhh4ZXt5Qf0augr54TN6suAUudPcawVZeIAPU7D4U= golang.org/x/time v0.6.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= golang.org/x/tools v0.31.0 h1:0EedkvKDbh+qistFTd0Bcwe/YLh4vHwWEkiI0toFIBU= golang.org/x/tools v0.31.0/go.mod h1:naFTU+Cev749tSJRXJlna0T3WxKvb1kWEx15xA4SdmQ= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da h1:noIWHXmPHxILtqtCOPIhSt0ABwskkZKjD3bXGnZGpNY= golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da/go.mod h1:NDW/Ps6MPRej6fsCIbMTohpP40sJ/P/vI1MoTEGwX90= google.golang.org/api v0.187.0 h1:Mxs7VATVC2v7CY+7Xwm4ndkX71hpElcvx0D1Ji/p1eo= google.golang.org/api v0.187.0/go.mod h1:KIHlTc4x7N7gKKuVsdmfBXN13yEEWXWFURWY6SBp2gk= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM= google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20240624140628-dc46fd24d27d h1:PksQg4dV6Sem3/HkBX+Ltq8T0ke0PKIRBNBatoDTVls= google.golang.org/genproto v0.0.0-20240624140628-dc46fd24d27d/go.mod h1:s7iA721uChleev562UJO2OYB0PPT9CMFjV+Ce7VJH5M= google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142 h1:wKguEg1hsxI2/L3hUYrpo1RVi48K+uTyzKqprwLXsb8= google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142/go.mod h1:d6be+8HhtEtucleCbxpPW9PA9XwISACu8nvpPqF0BVo= google.golang.org/genproto/googleapis/rpc v0.0.0-20240930140551-af27646dc61f h1:cUMEy+8oS78BWIH9OWazBkzbr090Od9tWBNtZHkOhf0= google.golang.org/genproto/googleapis/rpc v0.0.0-20240930140551-af27646dc61f/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= google.golang.org/grpc v1.67.1 h1:zWnc1Vrcno+lHZCOofnIMvycFcc0QRGIzm9dhnDX68E= google.golang.org/grpc v1.67.1/go.mod h1:1gLDyUQU7CTLJI90u3nXZ9ekeghjeM7pTDZlqFNg2AA= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.35.1 h1:m3LfL6/Ca+fqnjnlqQXNpFPABW1UD7mjh8KO2mKFytA= google.golang.org/protobuf v1.35.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= gopkg.in/DataDog/dd-trace-go.v1 v1.70.3 h1:lXHrxMpQZjxNdA8mGRfgMtwF/O6qIut5QjL7LICUVJ4= gopkg.in/DataDog/dd-trace-go.v1 v1.70.3/go.mod h1:CVUgctrrPGeB+OSjgyt56CNH5QxQwW3t11QU8R1LQjQ= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/natefinch/lumberjack.v2 v2.0.0 h1:1Lc07Kr7qY4U2YPouBjpCLxpiyxIVoxqXgkXLknAOE8= gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gorm.io/driver/mysql v1.5.7 h1:MndhOPYOfEp2rHKgkZIhJ16eVUIRf2HmzgoPmh7FCWo= gorm.io/driver/mysql v1.5.7/go.mod h1:sEtPWMiqiN1N1cMXoXmBbd8C6/l+TESwriotuRRpkDM= gorm.io/driver/postgres v1.4.6 h1:1FPESNXqIKG5JmraaH2bfCVlMQ7paLoCreFxDtqzwdc= gorm.io/driver/postgres v1.4.6/go.mod h1:UJChCNLFKeBqQRE+HrkFUbKbq9idPXmTOk2u4Wok8S4= gorm.io/driver/sqlserver v1.4.2 h1:nMtEeKqv2R/vv9FoHUFWfXfP6SskAgRar0TPlZV1stk= gorm.io/driver/sqlserver v1.4.2/go.mod h1:XHwBuB4Tlh7DqO0x7Ema8dmyWsQW7wi38VQOAFkrbXY= gorm.io/gorm v1.23.6/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk= gorm.io/gorm v1.25.7/go.mod h1:hbnx/Oo0ChWMn1BIhpy1oYozzpM15i4YPuHDmfYtwg8= gorm.io/gorm v1.25.12 h1:I0u8i2hWQItBq1WfE0o2+WuL9+8L21K9e2HHSTE/0f8= gorm.io/gorm v1.25.12/go.mod h1:xh7N7RHfYlNc5EmcI/El95gXusucDrQnHXe0+CgWcLQ= gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= gotest.tools/v3 v3.5.1 h1:EENdUnS3pdur5nybKYIh2Vfgc8IUNBjxDPSjtiJcOzU= gotest.tools/v3 v3.5.1/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= lukechampine.com/uint128 v1.3.0 h1:cDdUVfRwDUDovz610ABgFD17nXD4/uDgVHl2sC3+sbo= lukechampine.com/uint128 v1.3.0/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk= modernc.org/cc/v3 v3.41.0 h1:QoR1Sn3YWlmA1T4vLaKZfawdVtSiGx8H+cEojbC7v1Q= modernc.org/cc/v3 v3.41.0/go.mod h1:Ni4zjJYJ04CDOhG7dn640WGfwBzfE0ecX8TyMB0Fv0Y= modernc.org/ccgo/v3 v3.16.15 h1:KbDR3ZAVU+wiLyMESPtbtE/Add4elztFyfsWoNTgxS0= modernc.org/ccgo/v3 v3.16.15/go.mod h1:yT7B+/E2m43tmMOT51GMoM98/MtHIcQQSleGnddkUNI= modernc.org/libc v1.37.6 h1:orZH3c5wmhIQFTXF+Nt+eeauyd+ZIt2BX6ARe+kD+aw= modernc.org/libc v1.37.6/go.mod h1:YAXkAZ8ktnkCKaN9sw/UDeUVkGYJ/YquGO4FTi5nmHE= modernc.org/mathutil v1.6.0 h1:fRe9+AmYlaej+64JsEEhoWuAYBkOtQiMEU7n/XgfYi4= modernc.org/mathutil v1.6.0/go.mod h1:Ui5Q9q1TR2gFm0AQRqQUaBWFLAhQpCwNcuhBOSedWPo= modernc.org/memory v1.7.2 h1:Klh90S215mmH8c9gO98QxQFsY+W451E8AnzjoE2ee1E= modernc.org/memory v1.7.2/go.mod h1:NO4NVCQy0N7ln+T9ngWqOQfi7ley4vpwvARR+Hjw95E= modernc.org/opt v0.1.3 h1:3XOZf2yznlhC+ibLltsDGzABUGVx8J6pnFMS3E4dcq4= modernc.org/opt v0.1.3/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0= modernc.org/sqlite v1.28.0 h1:Zx+LyDDmXczNnEQdvPuEfcFVA2ZPyaD7UCZDjef3BHQ= modernc.org/sqlite v1.28.0/go.mod h1:Qxpazz0zH8Z1xCFyi5GSL3FzbtZ3fvbjmywNogldEW0= modernc.org/strutil v1.2.0 h1:agBi9dp1I+eOnxXeiZawM8F4LawKv4NzGWSaLfyeNZA= modernc.org/strutil v1.2.0/go.mod h1:/mdcBmfOibveCTBxUl5B5l6W+TTH1FXPLHZE6bTosX0= modernc.org/token v1.1.0 h1:Xl7Ap9dKaEs5kLoOQeQmPWevfnk/DM5qcLcYlA8ys6Y= modernc.org/token v1.1.0/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM= moul.io/zapgorm2 v1.3.0 h1:+CzUTMIcnafd0d/BvBce8T4uPn6DQnpIrz64cyixlkk= moul.io/zapgorm2 v1.3.0/go.mod h1:nPVy6U9goFKHR4s+zfSo1xVFaoU7Qgd5DoCdOfzoCqs= mvdan.cc/xurls/v2 v2.5.0 h1:lyBNOm8Wo71UknhUs4QTFUNNMyxy2JEIaKKo0RWOh+8= mvdan.cc/xurls/v2 v2.5.0/go.mod h1:yQgaGQ1rFtJUzkmKiHYSSfuQxqfYmd//X6PxvholpeE= nhooyr.io/websocket v1.8.17 h1:KEVeLJkUywCKVsnLIDlD/5gtayKp8VoCkksHCGGfT9Y= nhooyr.io/websocket v1.8.17/go.mod h1:rN9OFWIUwuxg4fR5tELlYC04bXYowCP9GX47ivo2l+c= nullprogram.com/x/optparse v1.0.0/go.mod h1:KdyPE+Igbe0jQUrVfMqDMeJQIJZEuyV7pjYmp6pbG50= pgregory.net/rapid v1.1.0 h1:CMa0sjHSru3puNx+J0MIAuiiEV4N0qj8/cMWGBBCsjw= pgregory.net/rapid v1.1.0/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= rsc.io/qr v0.2.0 h1:6vBLea5/NRMVTz8V66gipeLycZMl/+UlFmk8DvqQ6WY= rsc.io/qr v0.2.0/go.mod h1:IF+uZjkb9fqyeF/4tlBoynqmQxUoPfWEKh921coOuXs= rsc.io/tmplfunc v0.0.3 h1:53XFQh69AfOa8Tw0Jm7t+GV7KZhOi6jzsCzTtKbMvzU= rsc.io/tmplfunc v0.0.3/go.mod h1:AG3sTPzElb1Io3Yg4voV9AGZJuleGAwaVRxL9M49PhA= sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= ================================================ FILE: agent-as-a-service/agent-orchestration/backend/helpers/auth.go ================================================ package helpers import ( "crypto/ecdsa" "crypto/rand" "encoding/base64" "encoding/json" "errors" "fmt" "strings" "time" "github.com/ethereum/go-ethereum/accounts" "github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/crypto/ecies" ) type AuthToken struct { Address string `json:"address"` Exp int64 `json:"exp"` SessionID string `json:"session_id"` } func DecryptAndVerifyAuthToken(authToken, serverKey string) (*AuthToken, error) { encrypted, signed := SplitAuthToken(authToken) if signed == "" { return nil, fmt.Errorf("invalid token") } masterWallet, err := crypto.HexToECDSA(serverKey) if err != nil { return nil, err } publicKey := masterWallet.Public() publicKeyECDSA, _ := publicKey.(*ecdsa.PublicKey) serverAddress := crypto.PubkeyToAddress(*publicKeyECDSA).String() err = VerifyAuthToken(encrypted, signed, serverAddress) if err != nil { return nil, err } decrypted, err := DecryptAuthToken(encrypted, serverKey) if err != nil { return nil, err } currentTime := time.Now().Unix() if decrypted.Exp < currentTime && decrypted.Exp != 0 { return nil, fmt.Errorf("token expired") } return decrypted, nil } func SplitAuthToken(authToken string) (string, string) { parts := strings.Split(authToken, ".") if len(parts) != 2 { return "", "" } return parts[0], parts[1] } func VerifyAuthToken(authTokenStr, signature, address string) error { dataHash := crypto.Keccak256Hash([]byte(authTokenStr)) err := VerifySig(dataHash.Bytes(), signature, address) if err != nil { return err } return nil } func DecryptAuthToken(authTokenStr, serverKey string) (*AuthToken, error) { var authToken AuthToken err := Decrypt(authTokenStr, serverKey, &authToken) if err != nil { return nil, err } return &authToken, nil } func VerifySig(dataHash []byte, sig64, address string) error { signature, err := base64.StdEncoding.DecodeString(sig64) if err != nil { return err } if signature[crypto.RecoveryIDOffset] == 27 || signature[crypto.RecoveryIDOffset] == 28 { signature[crypto.RecoveryIDOffset] -= 27 // Transform yellow paper V from 27/28 to 0/1 } sigPub, err := crypto.SigToPub(dataHash, signature) if err != nil { return errors.New("invalid signature: " + err.Error()) } sigAddress := crypto.PubkeyToAddress(*sigPub).String() if !strings.EqualFold(sigAddress, address) { return fmt.Errorf("invalid signature") } return nil } func Decrypt(dataStr, privKey string, result interface{}) error { masterWallet, err := crypto.HexToECDSA(privKey) if err != nil { return err } encryptedBytes, err := base64.StdEncoding.DecodeString(dataStr) if err != nil { return err } decryptedBytes, err := ecies.ImportECDSA(masterWallet).Decrypt(encryptedBytes, nil, nil) if err != nil { return err } err = json.Unmarshal(decryptedBytes, result) if err != nil { return err } return nil } func VerifySignature(fromAddress, signatureHex, message string) error { signature, err := hexutil.Decode(signatureHex) if err != nil { return err } signature[crypto.RecoveryIDOffset] -= 27 // Transform yellow paper V from 27/28 to 0/1 messageHash := accounts.TextHash([]byte(message)) pubKey, err := crypto.SigToPub(messageHash, signature) if err != nil { return err } if HexToAddress(fromAddress) != crypto.PubkeyToAddress(*pubKey) { return fmt.Errorf("failed to verify signature") } return nil } func EncryptAndSignAuthToken(authToken AuthToken, serverKey string) (string, error) { encrypted, err := EncryptAuthToken(authToken, serverKey) if err != nil { return "", err } signed, err := SignAuthToken(encrypted, serverKey) if err != nil { return "", err } result := fmt.Sprintf("%s.%s", encrypted, signed) return result, nil } func EncryptAuthToken(authToken AuthToken, serverKey string) (string, error) { encrypted, err := Encrypt(authToken, serverKey) if err != nil { return "", err } return encrypted, nil } func Encrypt(data interface{}, privKey string) (string, error) { masterWallet, err := crypto.HexToECDSA(privKey) if err != nil { return "", err } publicKey := masterWallet.Public() publicKeyECDSA, _ := publicKey.(*ecdsa.PublicKey) pubkey := ecies.ImportECDSAPublic(publicKeyECDSA) dataBytes, err := json.Marshal(data) if err != nil { return "", err } ct, err := ecies.Encrypt(rand.Reader, pubkey, dataBytes, nil, nil) if err != nil { return "", err } base64CT := base64.StdEncoding.EncodeToString(ct) return base64CT, nil } func SignAuthToken(authTokenStr, privateKey string) (string, error) { signature, err := Sign(authTokenStr, privateKey) if err != nil { return "", err } return signature, nil } func Sign(dataStr, privKey string) (string, error) { masterWallet, err := crypto.HexToECDSA(privKey) if err != nil { return "", err } dataHash := crypto.Keccak256Hash([]byte(dataStr)) signature, err := crypto.Sign(dataHash.Bytes(), masterWallet) if err != nil { return "", err } signatureStr := base64.StdEncoding.EncodeToString(signature) return signatureStr, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/helpers/copier.go ================================================ package helpers // Fork from https://github.com/jinzhu/copier v0.4.0 import ( "database/sql" "database/sql/driver" "errors" "fmt" "reflect" "strconv" "strings" "sync" "time" "unicode" "go.mongodb.org/mongo-driver/bson/primitive" "google.golang.org/protobuf/types/known/structpb" "google.golang.org/protobuf/types/known/timestamppb" ) var ( ErrInvalidCopyDestination = errors.New("copy destination must be non-nil and addressable") ErrInvalidCopyFrom = errors.New("copy from must be non-nil and addressable") ErrMapKeyNotMatch = errors.New("map's key type doesn't match") ErrNotSupported = errors.New("not supported") ErrFieldNameTagStartNotUpperCase = errors.New("copier field name tag must be start upper case") ) // These flags define options for tag handling const ( // Denotes that a destination field must be copied to. If copying fails then a panic will ensue. tagMust uint8 = 1 << iota // Denotes that the program should not panic when the must flag is on and // value is not copied. The program will return an error instead. tagNoPanic // Ignore a destination field from being copied to. tagIgnore // Denotes that the value as been copied hasCopied // Some default converter types for a nicer syntax String string = "" Bool bool = false Int int = 0 Float32 float32 = 0 Float64 float64 = 0 ) // Option sets copy options type Option struct { // setting this value to true will ignore copying zero values of all the fields, including bools, as well as a // struct having all it's fields set to their zero values respectively (see IsZero() in reflect/value.go) IgnoreEmpty bool CaseSensitive bool DeepCopy bool Converters []TypeConverter // Custom field name mappings to copy values with different names in `fromValue` and `toValue` types. // Examples can be found at `TestCustomFieldName`. FieldNameMapping []FieldNameMapping } func (opt Option) converters() map[converterPair]TypeConverter { converters := map[converterPair]TypeConverter{} // save converters into map for faster lookup for i := range opt.Converters { pair := converterPair{ SrcType: reflect.TypeOf(opt.Converters[i].SrcType), DstType: reflect.TypeOf(opt.Converters[i].DstType), } converters[pair] = opt.Converters[i] } return converters } type TypeConverter struct { SrcType interface{} DstType interface{} Fn func(src interface{}) (dst interface{}, err error) } type converterPair struct { SrcType reflect.Type DstType reflect.Type } func (opt Option) fieldNameMapping() map[converterPair]FieldNameMapping { mapping := map[converterPair]FieldNameMapping{} for i := range opt.FieldNameMapping { pair := converterPair{ SrcType: reflect.TypeOf(opt.FieldNameMapping[i].SrcType), DstType: reflect.TypeOf(opt.FieldNameMapping[i].DstType), } mapping[pair] = opt.FieldNameMapping[i] } return mapping } type FieldNameMapping struct { SrcType interface{} DstType interface{} Mapping map[string]string } // Tag Flags type flags struct { BitFlags map[string]uint8 SrcNames tagNameMapping DestNames tagNameMapping } // Field Tag name mapping type tagNameMapping struct { FieldNameToTag map[string]string TagToFieldName map[string]string } // Copy copy things func Copy(toValue interface{}, fromValue interface{}) (err error) { return copier(toValue, fromValue, Option{}) } // CopyWithOption copy with option func CopyWithOption(toValue interface{}, fromValue interface{}, opt Option) (err error) { return copier(toValue, fromValue, opt) } func copier(toValue interface{}, fromValue interface{}, opt Option) (err error) { var ( isSlice bool amount = 1 from = indirect(reflect.ValueOf(fromValue)) to = indirect(reflect.ValueOf(toValue)) converters = opt.converters() mappings = opt.fieldNameMapping() ) if !to.CanAddr() { return ErrInvalidCopyDestination } // Return is from value is invalid if !from.IsValid() { return ErrInvalidCopyFrom } // Convert string to any data type if to value not string if from, ok := fromValue.(string); ok { if _, ok := toValue.(*string); !ok { switch reflect.ValueOf(toValue).Elem().Interface().(type) { case int: to, _ := strconv.Atoi(from) setValue(toValue, to) return case int32: to, _ := strconv.Atoi(from) setValue(toValue, int32(to)) return case int64: to, _ := strconv.Atoi(from) setValue(toValue, int64(to)) return case float32: to, _ := strconv.ParseFloat(from, 32) setValue(toValue, to) return case float64: to, _ := strconv.ParseFloat(from, 64) setValue(toValue, to) return case bool: to, _ := strconv.ParseBool(from) setValue(toValue, to) return case []string: setValue(toValue, strings.Split(from, ",")) return case time.Time: layout := "02/01/2006 15:04:05" t, _ := time.Parse(layout, from) setValue(toValue, t) return } } } // Convert timestamppb.Timestamp <-> time.Time if time, ok := fromValue.(time.Time); ok { if _, ok := toValue.(**timestamppb.Timestamp); ok { if !time.IsZero() { setValue(toValue, timestamppb.New(time)) } return } } if timestamp, ok := fromValue.(*timestamppb.Timestamp); ok { if _, ok := toValue.(*time.Time); ok { if timestamp.IsValid() && timestamp.AsTime().Year() != 1970 { setValue(toValue, timestamp.AsTime()) } return } } // convert map[string]*timestamppb.Timestamp <-> map[string]time.Time if timestampMap, ok := fromValue.(map[string]*timestamppb.Timestamp); ok { if _, ok := toValue.(*map[string]time.Time); ok { if timestampMap != nil { timestampMap := timestampMap timeMap := make(map[string]time.Time) for key, timestamp := range timestampMap { if timestamp.IsValid() && timestamp.AsTime().Year() != 1970 { timeMap[key] = timestamp.AsTime() } } setValue(toValue, timeMap) } return } } if timeMap, ok := fromValue.(map[string]time.Time); ok { if _, ok := toValue.(*map[string]*timestamppb.Timestamp); ok { if timeMap != nil { timeMap := timeMap timestampMap := make(map[string]*timestamppb.Timestamp) for key, time := range timeMap { if !time.IsZero() { timestampMap[key] = timestamppb.New(time) } } setValue(toValue, timestampMap) } return } } // convert map[uint32]*timestamppb.Timestamp <-> map[uint32]time.Time if timestampMap, ok := fromValue.(map[uint32]*timestamppb.Timestamp); ok { if _, ok := toValue.(*map[uint32]time.Time); ok { if timestampMap != nil { timestampMap := timestampMap timeMap := make(map[uint32]time.Time) for key, timestamp := range timestampMap { if timestamp.IsValid() && timestamp.AsTime().Year() != 1970 { timeMap[key] = timestamp.AsTime() } } setValue(toValue, timeMap) } return } } if timeMap, ok := fromValue.(map[uint32]time.Time); ok { if _, ok := toValue.(*map[uint32]*timestamppb.Timestamp); ok { if timeMap != nil { timeMap := timeMap timestampMap := make(map[uint32]*timestamppb.Timestamp) for key, time := range timeMap { if !time.IsZero() { timestampMap[key] = timestamppb.New(time) } } setValue(toValue, timestampMap) } return } } // Convert primitive.ObjectID <-> string if id, ok := fromValue.(primitive.ObjectID); ok { if _, ok := toValue.(*string); ok { setValue(toValue, id.Hex()) return } } if id, ok := fromValue.(string); ok { if _, ok := toValue.(*primitive.ObjectID); ok { if len(id) > 0 { if objectId, ok := primitive.ObjectIDFromHex(id); ok == nil { setValue(toValue, objectId) return } } } } // Convert []primitive.ObjectID <-> []string // if ids, ok := fromValue.([]primitive.ObjectID); ok { // if _, ok := toValue.(*[]string); ok { // setValue(toValue, cast.ObjectsToHex(ids)) // return // } // } // if ids, ok := fromValue.([]string); ok { // if _, ok := toValue.(*[]primitive.ObjectID); ok { // if len(ids) > 0 { // if objectIds, ok := cast.StringsToObjects(ids); ok == nil { // setValue(toValue, objectIds) // return // } // } // } // } // Convert *structpb.Struct <-> map[string]interface{} if strctpb, ok := fromValue.(*structpb.Struct); ok && strctpb != nil { setValue(toValue, strctpb.AsMap()) return } if m, ok := fromValue.(map[string]interface{}); ok && m != nil { if _, ok := toValue.(**structpb.Struct); ok { if strcpb, err := structpb.NewStruct(m); err == nil { setValue(toValue, strcpb) } } } fromType, isPtrFrom := indirectType(from.Type()) toType, _ := indirectType(to.Type()) if fromType.Kind() == reflect.Interface { fromType = reflect.TypeOf(from.Interface()) } if toType.Kind() == reflect.Interface { toType, _ = indirectType(reflect.TypeOf(to.Interface())) oldTo := to to = reflect.New(reflect.TypeOf(to.Interface())).Elem() defer func() { oldTo.Set(to) }() } // Just set it if possible to assign for normal types if from.Kind() != reflect.Slice && from.Kind() != reflect.Struct && from.Kind() != reflect.Map && (from.Type().AssignableTo(to.Type()) || from.Type().ConvertibleTo(to.Type())) { if !isPtrFrom || !opt.DeepCopy { to.Set(from.Convert(to.Type())) } else { fromCopy := reflect.New(from.Type()) fromCopy.Set(from.Elem()) to.Set(fromCopy.Convert(to.Type())) } return } if from.Kind() != reflect.Slice && fromType.Kind() == reflect.Map && toType.Kind() == reflect.Map { if !fromType.Key().ConvertibleTo(toType.Key()) { return ErrMapKeyNotMatch } if to.IsNil() { to.Set(reflect.MakeMapWithSize(toType, from.Len())) } for _, k := range from.MapKeys() { toKey := indirect(reflect.New(toType.Key())) isSet, err := set(toKey, k, opt.DeepCopy, converters) if err != nil { return err } if !isSet { return fmt.Errorf("%w map, old key: %v, new key: %v", ErrNotSupported, k.Type(), toType.Key()) } elemType := toType.Elem() if elemType.Kind() != reflect.Slice { elemType, _ = indirectType(elemType) } toValue := indirect(reflect.New(elemType)) isSet, err = set(toValue, from.MapIndex(k), opt.DeepCopy, converters) if err != nil { return err } if !isSet { if err = copier(toValue.Addr().Interface(), from.MapIndex(k).Interface(), opt); err != nil { return err } } for { if elemType == toType.Elem() { to.SetMapIndex(toKey, toValue) break } elemType = reflect.PtrTo(elemType) toValue = toValue.Addr() } } return } if from.Kind() == reflect.Slice && to.Kind() == reflect.Slice { if to.IsNil() { slice := reflect.MakeSlice(reflect.SliceOf(to.Type().Elem()), from.Len(), from.Cap()) to.Set(slice) } if fromType.ConvertibleTo(toType) { for i := 0; i < from.Len(); i++ { if to.Len() < i+1 { to.Set(reflect.Append(to, reflect.New(to.Type().Elem()).Elem())) } isSet, err := set(to.Index(i), from.Index(i), opt.DeepCopy, converters) if err != nil { return err } if !isSet { // ignore error while copy slice element err = copier(to.Index(i).Addr().Interface(), from.Index(i).Interface(), opt) if err != nil { continue } } } return } } if fromType.Kind() != reflect.Struct || toType.Kind() != reflect.Struct { // skip not supported type return } if len(converters) > 0 { if ok, e := set(to, from, opt.DeepCopy, converters); e == nil && ok { // converter supported return } } if from.Kind() == reflect.Slice || to.Kind() == reflect.Slice { isSlice = true if from.Kind() == reflect.Slice { amount = from.Len() } } for i := 0; i < amount; i++ { var dest, source reflect.Value if isSlice { // source if from.Kind() == reflect.Slice { source = indirect(from.Index(i)) } else { source = indirect(from) } // dest dest = indirect(reflect.New(toType).Elem()) } else { source = indirect(from) dest = indirect(to) } if len(converters) > 0 { if ok, e := set(dest, source, opt.DeepCopy, converters); e == nil && ok { if isSlice { // FIXME: maybe should check the other types? if to.Type().Elem().Kind() == reflect.Ptr { to.Index(i).Set(dest.Addr()) } else { if to.Len() < i+1 { reflect.Append(to, dest) } else { to.Index(i).Set(dest) } } } else { to.Set(dest) } continue } } destKind := dest.Kind() initDest := false if destKind == reflect.Interface { initDest = true dest = indirect(reflect.New(toType)) } // Get tag options flgs, err := getFlags(dest, source, toType, fromType) if err != nil { return err } // check source if source.IsValid() { copyUnexportedStructFields(dest, source) // Copy from source field to dest field or method fromTypeFields := deepFields(fromType) for _, field := range fromTypeFields { name := field.Name // Get bit flags for field fieldFlags := flgs.BitFlags[name] // Check if we should ignore copying if (fieldFlags & tagIgnore) != 0 { continue } fieldNamesMapping := getFieldNamesMapping(mappings, fromType, toType) srcFieldName, destFieldName := getFieldName(name, flgs, fieldNamesMapping) if fromField := fieldByNameOrZeroValue(source, srcFieldName); fromField.IsValid() && !shouldIgnore(fromField, opt.IgnoreEmpty) { // process for nested anonymous field destFieldNotSet := false if f, ok := dest.Type().FieldByName(destFieldName); ok { // only initialize parent embedded struct pointer in the path for idx := range f.Index[:len(f.Index)-1] { destField := dest.FieldByIndex(f.Index[:idx+1]) if destField.Kind() != reflect.Ptr { continue } if !destField.IsNil() { continue } if !destField.CanSet() { destFieldNotSet = true break } // destField is a nil pointer that can be set newValue := reflect.New(destField.Type().Elem()) destField.Set(newValue) } } if destFieldNotSet { break } toField := fieldByName(dest, destFieldName, opt.CaseSensitive) if toField.IsValid() { if toField.CanSet() { isSet, err := set(toField, fromField, opt.DeepCopy, converters) if err != nil { return err } if !isSet { if err := copier(toField.Addr().Interface(), fromField.Interface(), opt); err != nil { return err } } if fieldFlags != 0 { // Note that a copy was made flgs.BitFlags[name] = fieldFlags | hasCopied } } } else { // try to set to method var toMethod reflect.Value if dest.CanAddr() { toMethod = dest.Addr().MethodByName(destFieldName) } else { toMethod = dest.MethodByName(destFieldName) } if toMethod.IsValid() && toMethod.Type().NumIn() == 1 && fromField.Type().AssignableTo(toMethod.Type().In(0)) { toMethod.Call([]reflect.Value{fromField}) } } } } // Copy from from method to dest field for _, field := range deepFields(toType) { name := field.Name srcFieldName, destFieldName := getFieldName(name, flgs, getFieldNamesMapping(mappings, fromType, toType)) var fromMethod reflect.Value if source.CanAddr() { fromMethod = source.Addr().MethodByName(srcFieldName) } else { fromMethod = source.MethodByName(srcFieldName) } if fromMethod.IsValid() && fromMethod.Type().NumIn() == 0 && fromMethod.Type().NumOut() == 1 && !shouldIgnore(fromMethod, opt.IgnoreEmpty) { if toField := fieldByName(dest, destFieldName, opt.CaseSensitive); toField.IsValid() && toField.CanSet() { values := fromMethod.Call([]reflect.Value{}) if len(values) >= 1 { _, _ = set(toField, values[0], opt.DeepCopy, converters) } } } } } if isSlice && to.Kind() == reflect.Slice { if dest.Addr().Type().AssignableTo(to.Type().Elem()) { if to.Len() < i+1 { to.Set(reflect.Append(to, dest.Addr())) } else { isSet, err := set(to.Index(i), dest.Addr(), opt.DeepCopy, converters) if err != nil { return err } if !isSet { // ignore error while copy slice element err = copier(to.Index(i).Addr().Interface(), dest.Addr().Interface(), opt) if err != nil { continue } } } } else if dest.Type().AssignableTo(to.Type().Elem()) { if to.Len() < i+1 { to.Set(reflect.Append(to, dest)) } else { isSet, err := set(to.Index(i), dest, opt.DeepCopy, converters) if err != nil { return err } if !isSet { // ignore error while copy slice element err = copier(to.Index(i).Addr().Interface(), dest.Interface(), opt) if err != nil { continue } } } } } else if initDest { to.Set(dest) } _ = checkBitFlags(flgs.BitFlags) } return } func getFieldNamesMapping(mappings map[converterPair]FieldNameMapping, fromType reflect.Type, toType reflect.Type) map[string]string { var fieldNamesMapping map[string]string if len(mappings) > 0 { pair := converterPair{ SrcType: fromType, DstType: toType, } if v, ok := mappings[pair]; ok { fieldNamesMapping = v.Mapping } } return fieldNamesMapping } func fieldByNameOrZeroValue(source reflect.Value, fieldName string) (value reflect.Value) { defer func() { if err := recover(); err != nil { value = reflect.Value{} } }() return source.FieldByName(fieldName) } func copyUnexportedStructFields(to, from reflect.Value) { if from.Kind() != reflect.Struct || to.Kind() != reflect.Struct || !from.Type().AssignableTo(to.Type()) { return } // create a shallow copy of 'to' to get all fields tmp := indirect(reflect.New(to.Type())) tmp.Set(from) // revert exported fields for i := 0; i < to.NumField(); i++ { if tmp.Field(i).CanSet() { tmp.Field(i).Set(to.Field(i)) } } to.Set(tmp) } func shouldIgnore(v reflect.Value, ignoreEmpty bool) bool { return ignoreEmpty && v.IsZero() } var ( deepFieldsLock sync.RWMutex deepFieldsMap = make(map[reflect.Type][]reflect.StructField) ) func deepFields(reflectType reflect.Type) []reflect.StructField { deepFieldsLock.RLock() cache, ok := deepFieldsMap[reflectType] deepFieldsLock.RUnlock() if ok { return cache } var res []reflect.StructField if reflectType, _ = indirectType(reflectType); reflectType.Kind() == reflect.Struct { fields := make([]reflect.StructField, 0, reflectType.NumField()) for i := 0; i < reflectType.NumField(); i++ { v := reflectType.Field(i) // PkgPath is the package path that qualifies a lower case (unexported) // field name. It is empty for upper case (exported) field names. // See https://golang.org/ref/spec#Uniqueness_of_identifiers if v.PkgPath == "" { fields = append(fields, v) if v.Anonymous { // also consider fields of anonymous fields as fields of the root fields = append(fields, deepFields(v.Type)...) } } } res = fields } deepFieldsLock.Lock() deepFieldsMap[reflectType] = res deepFieldsLock.Unlock() return res } func indirect(reflectValue reflect.Value) reflect.Value { for reflectValue.Kind() == reflect.Ptr { reflectValue = reflectValue.Elem() } return reflectValue } func indirectType(reflectType reflect.Type) (_ reflect.Type, isPtr bool) { for reflectType.Kind() == reflect.Ptr || reflectType.Kind() == reflect.Slice { reflectType = reflectType.Elem() isPtr = true } return reflectType, isPtr } func set(to, from reflect.Value, deepCopy bool, converters map[converterPair]TypeConverter) (bool, error) { if !from.IsValid() { return true, nil } if ok, err := lookupAndCopyWithConverter(to, from, converters); err != nil { return false, err } else if ok { return true, nil } if to.Kind() == reflect.Ptr { // set `to` to nil if from is nil if from.Kind() == reflect.Ptr && from.IsNil() { to.Set(reflect.Zero(to.Type())) return true, nil } else if to.IsNil() { // `from` -> `to` // sql.NullString -> *string if fromValuer, ok := driverValuer(from); ok { v, err := fromValuer.Value() if err != nil { return true, nil } // if `from` is not valid do nothing with `to` if v == nil { return true, nil } } // allocate new `to` variable with default value (eg. *string -> new(string)) to.Set(reflect.New(to.Type().Elem())) } // depointer `to` to = to.Elem() } if deepCopy { toKind := to.Kind() if toKind == reflect.Interface && to.IsNil() { if reflect.TypeOf(from.Interface()) != nil { to.Set(reflect.New(reflect.TypeOf(from.Interface())).Elem()) toKind = reflect.TypeOf(to.Interface()).Kind() } } if from.Kind() == reflect.Ptr && from.IsNil() { return true, nil } if _, ok := to.Addr().Interface().(sql.Scanner); !ok && (toKind == reflect.Struct || toKind == reflect.Map || toKind == reflect.Slice) { return false, nil } } if from.Type().ConvertibleTo(to.Type()) { to.Set(from.Convert(to.Type())) } else if toScanner, ok := to.Addr().Interface().(sql.Scanner); ok { // `from` -> `to` // *string -> sql.NullString if from.Kind() == reflect.Ptr { // if `from` is nil do nothing with `to` if from.IsNil() { return true, nil } // depointer `from` from = indirect(from) } // `from` -> `to` // string -> sql.NullString // set `to` by invoking method Scan(`from`) err := toScanner.Scan(from.Interface()) if err != nil { return false, nil } } else if fromValuer, ok := driverValuer(from); ok { // `from` -> `to` // sql.NullString -> string v, err := fromValuer.Value() if err != nil { return false, nil } // if `from` is not valid do nothing with `to` if v == nil { return true, nil } rv := reflect.ValueOf(v) if rv.Type().AssignableTo(to.Type()) { to.Set(rv) } else if to.CanSet() && rv.Type().ConvertibleTo(to.Type()) { to.Set(rv.Convert(to.Type())) } } else if from.Kind() == reflect.Ptr { return set(to, from.Elem(), deepCopy, converters) } else { return false, nil } return true, nil } // lookupAndCopyWithConverter looks up the type pair, on success the TypeConverter Fn func is called to copy src to dst field. func lookupAndCopyWithConverter(to, from reflect.Value, converters map[converterPair]TypeConverter) (copied bool, err error) { pair := converterPair{ SrcType: from.Type(), DstType: to.Type(), } if cnv, ok := converters[pair]; ok { result, err := cnv.Fn(from.Interface()) if err != nil { return false, err } if result != nil { to.Set(reflect.ValueOf(result)) } else { // in case we've got a nil value to copy to.Set(reflect.Zero(to.Type())) } return true, nil } return false, nil } // parseTags Parses struct tags and returns uint8 bit flags. func parseTags(tag string) (flg uint8, name string, err error) { for _, t := range strings.Split(tag, ",") { switch t { case "-": flg = tagIgnore return case "must": flg = flg | tagMust case "nopanic": flg = flg | tagNoPanic default: if unicode.IsUpper([]rune(t)[0]) { name = strings.TrimSpace(t) } else { err = ErrFieldNameTagStartNotUpperCase } } } return } // getTagFlags Parses struct tags for bit flags, field name. func getFlags(dest, src reflect.Value, toType, fromType reflect.Type) (flags, error) { flgs := flags{ BitFlags: map[string]uint8{}, SrcNames: tagNameMapping{ FieldNameToTag: map[string]string{}, TagToFieldName: map[string]string{}, }, DestNames: tagNameMapping{ FieldNameToTag: map[string]string{}, TagToFieldName: map[string]string{}, }, } var toTypeFields, fromTypeFields []reflect.StructField if dest.IsValid() { toTypeFields = deepFields(toType) } if src.IsValid() { fromTypeFields = deepFields(fromType) } // Get a list dest of tags for _, field := range toTypeFields { tags := field.Tag.Get("copier") if tags != "" { var name string var err error if flgs.BitFlags[field.Name], name, err = parseTags(tags); err != nil { return flags{}, err } else if name != "" { flgs.DestNames.FieldNameToTag[field.Name] = name flgs.DestNames.TagToFieldName[name] = field.Name } } } // Get a list source of tags for _, field := range fromTypeFields { tags := field.Tag.Get("copier") if tags != "" { var name string var err error if _, name, err = parseTags(tags); err != nil { return flags{}, err } else if name != "" { flgs.SrcNames.FieldNameToTag[field.Name] = name flgs.SrcNames.TagToFieldName[name] = field.Name } } } return flgs, nil } // checkBitFlags Checks flags for error or panic conditions. func checkBitFlags(flagsList map[string]uint8) (err error) { // Check flag conditions were met for name, flgs := range flagsList { if flgs&hasCopied == 0 { switch { case flgs&tagMust != 0 && flgs&tagNoPanic != 0: err = fmt.Errorf("field %s has must tag but was not copied", name) return case flgs&(tagMust) != 0: panic(fmt.Sprintf("Field %s has must tag but was not copied", name)) } } } return } func getFieldName(fieldName string, flgs flags, fieldNameMapping map[string]string) (srcFieldName string, destFieldName string) { // get dest field name if name, ok := fieldNameMapping[fieldName]; ok { srcFieldName = fieldName destFieldName = name return } if srcTagName, ok := flgs.SrcNames.FieldNameToTag[fieldName]; ok { destFieldName = srcTagName if destTagName, ok := flgs.DestNames.TagToFieldName[srcTagName]; ok { destFieldName = destTagName } } else { if destTagName, ok := flgs.DestNames.TagToFieldName[fieldName]; ok { destFieldName = destTagName } } if destFieldName == "" { destFieldName = fieldName } // get source field name if destTagName, ok := flgs.DestNames.FieldNameToTag[fieldName]; ok { srcFieldName = destTagName if srcField, ok := flgs.SrcNames.TagToFieldName[destTagName]; ok { srcFieldName = srcField } } else { if srcField, ok := flgs.SrcNames.TagToFieldName[fieldName]; ok { srcFieldName = srcField } } if srcFieldName == "" { srcFieldName = fieldName } return } func driverValuer(v reflect.Value) (i driver.Valuer, ok bool) { if !v.CanAddr() { i, ok = v.Interface().(driver.Valuer) return } i, ok = v.Addr().Interface().(driver.Valuer) return } func fieldByName(v reflect.Value, name string, caseSensitive bool) reflect.Value { if caseSensitive { return v.FieldByName(name) } return v.FieldByNameFunc(func(n string) bool { return strings.EqualFold(n, name) }) } func setValue(to interface{}, from interface{}) { fromValue := reflect.ValueOf(from) toValue := reflect.ValueOf(to) _, _ = set(toValue, fromValue, false, map[converterPair]TypeConverter{}) } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/helpers/crypto.go ================================================ package helpers import ( "crypto/ecdsa" "errors" "fmt" "math/big" "strings" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/crypto" ) func ValidateMessageSignature(msg string, signatureHex string, signer string) error { msg = fmt.Sprintf("\x19Ethereum Signed Message:\n%d%s", len(msg), msg) msgBytes := []byte(msg) msgHash := crypto.Keccak256Hash( msgBytes, ) signature, err := hexutil.Decode(signatureHex) if err != nil { return err } if signature[crypto.RecoveryIDOffset] > 1 { signature[crypto.RecoveryIDOffset] -= 27 } sigPublicKey, err := crypto.SigToPub(msgHash.Bytes(), signature) if err != nil { return err } pbkHex := crypto.PubkeyToAddress(*sigPublicKey) if !strings.EqualFold(pbkHex.Hex(), signer) { return errors.New("not valid signer") } return nil } // get v, r, s variables from eip712 signature for permit function func ERC20PermitSignature(pk *ecdsa.PrivateKey, domainSeparator, owner, spender common.Address, value, nonce, deadline *big.Int) (byte, [32]byte, [32]byte, error) { permitHash := common.HexToHash("6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9").Bytes() uint256Ty, _ := abi.NewType("uint256", "uint256", nil) bytes32Ty, _ := abi.NewType("bytes32", "bytes32", nil) addressTy, _ := abi.NewType("address", "address", nil) args := abi.Arguments{ { Type: bytes32Ty, }, { Type: addressTy, }, { Type: addressTy, }, { Type: uint256Ty, }, { Type: uint256Ty, }, { Type: uint256Ty, }, } //abi.encode(PERMIT_TYPEHASH, owner, spender, value, nonce, deadline) bytes, err := args.Pack( permitHash, owner, spender, value, nonce, deadline, ) if err != nil { return 0, [32]byte{}, [32]byte{}, err } //this is eq to keccak256(abi.encode(PERMIT_TYPEHASH, owner, spender, value, nonce, deadline)) typedHash := crypto.Keccak256(bytes) //this is eq to keccak256(abi.encodePacked('x19x01', DOMAIN_SEPARATOR, hashed_args)) hash := crypto.Keccak256( []byte("\x19\x01"), domainSeparator[:], typedHash, ) sig, err := crypto.Sign(hash, pk) if err != nil { return 0, [32]byte{}, [32]byte{}, err } var v byte var r [32]byte var s [32]byte v = sig[64] + 27 copy(r[:], sig[:32]) copy(s[:], sig[32:64]) return v, r, s, nil } func HexToBytes32(hex string) [32]byte { bytes := common.HexToHash(hex) if len(bytes) != 32 { panic("wrong bytes") } return bytes } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/helpers/file.go ================================================ package helpers // func WriteFileEternalTemp(body []byte) (string, error) { // if _, err := os.Stat("/tmp/eternal-data/"); os.IsNotExist(err) { // err := os.MkdirAll("/tmp/eternal-data/", os.ModePerm) // if err != nil { // return "", err // } // } // buf := make([]byte, 32) // _, err := cryptorand.Read(buf) // if err != nil { // return "", err // } // hash := big.NewInt(0).SetBytes(buf).Text(16) // err = os.WriteFile("/tmp/eternal-data/"+hash, body, 0644) // if err != nil { // return "", err // } // return "file://" + hash, nil // } // func ReadFileEternalTemp(hash string) ([]byte, error) { // hash = strings.TrimPrefix(hash, "file://") // body, err := os.ReadFile("/tmp/eternal-data/" + hash) // if err != nil { // return nil, err // } // return body, nil // } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/helpers/http_request.go ================================================ package helpers import ( "bytes" "encoding/json" "errors" "io" "net/http" "strings" ) type AllowedCode struct { Code map[string]string } type RelyErrorMessage struct { Code string `json:"code"` Message *string `json:"message"` Error interface{} `json:"error"` } type RelyError struct { Code int `json:"code"` Message string `json:"message"` } func NewAllowedCode() AllowedCode { ac := new(AllowedCode) codes := make(map[string]string) codes["200_ok"] = "200 OK" codes["201_created"] = "201 Created" codes["202_accepted"] = "202 Accepted" ac.Code = codes return *ac } func HttpRequest(fullUrl string, method string, headers map[string]string, reqBody interface{}) ([]byte, *http.Header, int, error) { fullUrl = strings.TrimSpace(fullUrl) bff := new(bytes.Buffer) if reqBody != nil { byteData, err := json.Marshal(reqBody) if err != nil { return nil, nil, 0, err } bff = bytes.NewBuffer(byteData) } req, err := http.NewRequest(method, fullUrl, bff) if err != nil { return nil, nil, 0, err } if len(headers) > 0 { for key, val := range headers { req.Header.Add(key, val) } } res, err := http.DefaultClient.Do(req) if err != nil { return nil, nil, 0, err } defer res.Body.Close() body, _ := io.ReadAll(res.Body) isAllowed := isAllowed(res.Status) if !isAllowed { data := &RelyErrorMessage{} err = json.Unmarshal(body, data) if err != nil { return nil, nil, res.StatusCode, err } dataErrorString, ok := data.Error.(string) if ok { return nil, &res.Header, res.StatusCode, errors.New(dataErrorString) } dataError := &RelyError{} byteArray, err := json.Marshal(data.Error) if err != nil { return nil, nil, res.StatusCode, err } err = json.Unmarshal(byteArray, dataError) if err != nil { if data.Message != nil { return nil, &res.Header, res.StatusCode, errors.New(*data.Message) } } return nil, &res.Header, res.StatusCode, errors.New(dataError.Message) } if err != nil { return nil, nil, res.StatusCode, err } return body, &res.Header, res.StatusCode, nil } func HttpRequestFullResponse(fullUrl string, method string, headers map[string]string, reqBody interface{}) ([]byte, *http.Header, int, error) { fullUrl = strings.TrimSpace(fullUrl) bff := new(bytes.Buffer) if reqBody != nil { byteData, err := json.Marshal(reqBody) if err != nil { return nil, nil, 0, err } bff = bytes.NewBuffer(byteData) } req, err := http.NewRequest(method, fullUrl, bff) if err != nil { return nil, nil, 0, err } if len(headers) > 0 { for key, val := range headers { req.Header.Add(key, val) } } res, err := http.DefaultClient.Do(req) if err != nil { return nil, nil, 0, err } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { return nil, &res.Header, res.StatusCode, err } return body, &res.Header, res.StatusCode, nil } func JsonRequest(fullUrl string, method string, headers map[string]string, reqBody io.Reader) ([]byte, *http.Header, int, error) { // headers["accept"] = "application/json" // headers["content-type"] = "application/json" return HttpRequest(fullUrl, method, headers, reqBody) } func isAllowed(code string) bool { ac := NewAllowedCode() code = strings.ReplaceAll(code, " ", "_") code = strings.ToLower(code) getCode, ok := ac.Code[code] if !ok { return false } _ = getCode return true } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/helpers/json.go ================================================ package helpers import "encoding/json" func ConvertJsonString(data interface{}) string { if data == nil { return "" } b, _ := json.Marshal(data) return string(b) } func ConvertJsonObject(jsonStr string, data interface{}) error { return json.Unmarshal([]byte(jsonStr), data) } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/helpers/net.go ================================================ package helpers import ( "bytes" "encoding/base64" "encoding/json" "fmt" "io" "log" "net/http" "net/url" "regexp" "strings" ) func CurlURL(apiURL string, method string, headers map[string]string, postData interface{}, respData interface{}) error { var err error mt := http.MethodGet if method != "" { mt = method } var bytesBuffer io.Reader if postData != nil { var bodyBytes []byte bodyBytes, err = json.Marshal(postData) if err != nil { return err } bytesBuffer = bytes.NewBuffer(bodyBytes) } var req *http.Request req, err = http.NewRequest(mt, apiURL, bytesBuffer) if err != nil { return err } if len(headers) > 0 { for k, v := range headers { req.Header.Set(k, v) } } else { req.Header.Set("Content-Type", "application/json") } client := &http.Client{} var res *http.Response res, err = client.Do(req) if err != nil { return err } defer res.Body.Close() if res.StatusCode != http.StatusOK { var respBytes []byte respBytes, err = io.ReadAll(res.Body) if err != nil { return err } err = fmt.Errorf("request is bad response status code %d ( %s )", res.StatusCode, string(respBytes)) return err } if respData != nil { var respBytes []byte respBytes, err = io.ReadAll(res.Body) if err != nil { return err } err = json.Unmarshal(respBytes, respData) if err != nil { return err } } return nil } func MakeSeoURL(title string) string { reg, err := regexp.Compile("[^A-Za-z0-9]+") if err != nil { log.Fatal(err) } prettyurl := reg.ReplaceAllString(title, "-") prettyurl = strings.ToLower(strings.Trim(prettyurl, "-")) return prettyurl } func ConvertImageDataURL(tokenURL string) string { var ipfsReplaces = []string{ "https://cloudflare-ipfs.com/ipfs", "https://ipfs.fleek.co/ipfs", "https://nearnaut.mypinata.cloud/ipfs", "ipfs:/", } for _, ipfsReplace := range ipfsReplaces { if strings.HasPrefix(tokenURL, ipfsReplace) { tokenURL = strings.Replace(tokenURL, ipfsReplace, "https://ipfs.io/ipfs", -1) } } return tokenURL } func CurlURLString(apiURL string, method string, headers map[string]string, postData interface{}) (string, error) { var err error mt := http.MethodGet if method != "" { mt = method } var bytesBuffer io.Reader if postData != nil { var bodyBytes []byte bodyBytes, err = json.Marshal(postData) if err != nil { return "", err } bytesBuffer = bytes.NewBuffer(bodyBytes) } var req *http.Request req, err = http.NewRequest(mt, apiURL, bytesBuffer) if err != nil { return "", err } if len(headers) > 0 { for k, v := range headers { req.Header.Set(k, v) } } else { req.Header.Set("Content-Type", "application/json") } client := &http.Client{} var res *http.Response res, err = client.Do(req) if err != nil { return "", err } defer res.Body.Close() if res.StatusCode != http.StatusOK { var respBytes []byte respBytes, err = io.ReadAll(res.Body) if err != nil { return "", err } err = fmt.Errorf("request is bad response status code %d ( %s )", res.StatusCode, string(respBytes)) return "", err } respBytes, err := io.ReadAll(res.Body) if err != nil { return "", err } return string(respBytes), nil } func CurlBase64String(apiURL string) (string, error) { var err error mt := http.MethodGet var req *http.Request req, err = http.NewRequest(mt, apiURL, nil) if err != nil { return "", err } client := &http.Client{} var res *http.Response res, err = client.Do(req) if err != nil { return "", err } defer res.Body.Close() if res.StatusCode != http.StatusOK { var respBytes []byte respBytes, err = io.ReadAll(res.Body) if err != nil { return "", err } err = fmt.Errorf("request is bad response status code %d ( %s )", res.StatusCode, string(respBytes)) return "", err } respBytes, err := io.ReadAll(res.Body) if err != nil { return "", err } return base64.StdEncoding.EncodeToString(respBytes), nil } func RemoveImageURLs(text string) string { // Regex pattern to match media URLs with specific extensions mediaURLPattern := `https?://\S+\.(jpg|jpeg|png|gif|svg)` re := regexp.MustCompile(mediaURLPattern) return re.ReplaceAllString(text, "") } func RemoveURLs(text string) string { // Regex pattern to match media URLs mediaURLPattern := `https?://t\.co/\S+` re := regexp.MustCompile(mediaURLPattern) return re.ReplaceAllString(text, "") } func BuildUri(urlString string, queries map[string]string) string { u, err := url.Parse(urlString) if err != nil { panic(err) } q := u.Query() for k, v := range queries { q.Add(k, v) } u.RawQuery = q.Encode() return u.String() } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/helpers/rand.go ================================================ package helpers import ( cryptorand "crypto/rand" "crypto/sha256" "encoding/hex" "fmt" "math/big" "math/rand" "strconv" "strings" "time" "github.com/ethereum/go-ethereum/common" ) func RandomStringWithLength(length int) string { rand.Seed(time.Now().UnixNano()) chars := []rune( "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + "abcdefghijklmnopqrstuvwxyz" + "0123456789", ) var b strings.Builder for i := 0; i < length; i++ { b.WriteRune(chars[rand.Intn(len(chars))]) } str := b.String() return str } func RandomHex(n int) (string, error) { bytes := make([]byte, n) if _, err := rand.Read(bytes); err != nil { return "", err } // return hex.EncodeToString(bytes), nil return fmt.Sprintf("0x%s", hex.EncodeToString(bytes)), nil } func GenShareCode(length int) string { rand.Seed(time.Now().UnixNano()) chars := []rune( "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + "0123456789", ) var b strings.Builder for i := 0; i < length; i++ { b.WriteRune(chars[rand.Intn(len(chars))]) } str := b.String() return str } func RandomReferralCode(length int) string { rand.Seed(time.Now().UnixNano()) chars := []rune( "abcdefghijklmnopqrstuvwxyz" + "0123456789", ) var b strings.Builder for i := 0; i < length; i++ { b.WriteRune(chars[rand.Intn(len(chars))]) } str := b.String() return str } func RandomBigInt(numBytes int) *big.Int { buf := make([]byte, numBytes) _, err := cryptorand.Read(buf) if err != nil { panic(err) } return new(big.Int).SetBytes((buf)) } func RandomNonceNumber(numberOfDigits int) (string, error) { resp := "" n := 0 for n < numberOfDigits { randomNumber := rand.Intn(9) if (n == 0 && randomNumber != 0) || n > 0 { resp += strconv.Itoa(randomNumber) n += 1 } } return resp, nil } func Sha256ToNonce(s string) *big.Int { h := sha256.New() h.Write([]byte(s)) buf := h.Sum(nil) return new(big.Int).SetBytes((buf[:32])) } func RandHash() string { buf := make([]byte, 32) _, err := cryptorand.Read(buf) if err != nil { panic(err) } return common.BytesToHash(buf).Hex() } func RandInArray(arry []string) string { rand.Seed(time.Now().UnixNano()) // seed or it will be set to 1 randomIndex := rand.Intn(len(arry)) // generate a random int in the range 0 to 9 pick := arry[randomIndex] return pick } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/helpers/recaptcha.go ================================================ package helpers import ( "crypto/tls" "encoding/json" "errors" "fmt" "io/ioutil" "log" "net/http" "net/url" "strings" ) func ValidateRecaptcha(secret string, response string) (bool, error) { apiURL := "https://www.google.com/recaptcha/api/siteverify" form := url.Values{} form.Add("secret", secret) form.Add("response", response) req, err := http.NewRequest("POST", apiURL, strings.NewReader(form.Encode())) if err != nil { return false, err } req.Header.Add("Content-Type", "application/x-www-form-urlencoded") tr := &http.Transport{ TLSClientConfig: &tls.Config{InsecureSkipVerify: true}, } fmt.Println(req.Header) client := &http.Client{Transport: tr} res, err := client.Do(req) if err != nil { return false, err } defer res.Body.Close() body, err := ioutil.ReadAll(res.Body) if err != nil { log.Println("read body error", err.Error()) return false, err } if res.StatusCode > 300 { log.Println("read body error", string(body)) return false, fmt.Errorf("%s: %s request error", res.Status, string(body)) } respMap := make(map[string]interface{}) if err := json.Unmarshal(body, &respMap); err != nil { return false, errors.New("Unmarshal error") } success, ok := respMap["success"] if !ok { return false, errors.New("Bad response") } return success.(bool), nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/helpers/sign.go ================================================ package helpers import ( "fmt" "math/big" "strings" ) func GetSignMsg(msg string) string { return fmt.Sprintf("\x19Ethereum Signed Message:\n%d%s", len(msg), msg) } func AppendHexStrings(values ...string) string { var ret string for _, v := range values { if has0xPrefix(v) { v = v[2:] } ret = fmt.Sprintf("%s%s", ret, v) } return fmt.Sprintf("0x%s", strings.ToLower(ret)) } func ParseHex2Hex(v string) string { if has0xPrefix(v) { v = v[2:] } return v } func ParseNumber2Hex(v string) string { n, _ := big.NewInt(0).SetString(v, 10) return ParseBigInt2Hex(n) } func ParseBigInt2Hex(v *big.Int) string { if v == nil { return strings.Repeat("00", 32) } val := fmt.Sprintf("%s%s", strings.Repeat("00", 32), v.Text(16)) return val[len(val)-64:] } func has0xPrefix(input string) bool { return len(input) >= 2 && input[0] == '0' && (input[1] == 'x' || input[1] == 'X') } func ParseAddress2Hex(v string) string { if has0xPrefix(v) { v = v[2:] } val := fmt.Sprintf("%s%s", strings.Repeat("00", 20), v) return val[len(val)-40:] } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/helpers/time.go ================================================ package helpers import ( "time" ) const ( DEFAULT_DATE_FORMAT = "2006-01-02" DEFAULT_TIME_FORMAT = "2006-01-02 15:04:05" TWITTER_DATE_TIME_FORMAT = "2006-01-02T15:04:05.000Z" DEFAULT_TIME_ONLY_FORMAT = "15:04:05" DEFAULT_FILTER_TIME_FORMAT = "20060102150405" ) func TimeFromUnix(n int64) *time.Time { t := time.Unix(n, 0) if t.Year() > 9999 { t = time.Unix(n/1000, 0) } return &t } func ParseStringToDateDefault(value string) *time.Time { return ParseStringToTime(DEFAULT_DATE_FORMAT, value) } func ParseStringToDateTimeDefault(value string) *time.Time { return ParseStringToTime(DEFAULT_TIME_FORMAT, value) } func ParseStringToDateTimeTwitter(value string) *time.Time { return ParseStringToTime(TWITTER_DATE_TIME_FORMAT, value) } func ParseStringToTime(layout string, value string) *time.Time { t, err := time.Parse(layout, value) if err != nil { return nil } return &t } func ParseTimeToStringDateDefault(value *time.Time) string { return ParseTimeToString(DEFAULT_DATE_FORMAT, value) } func ParseTimeToStringDateTimeDefault(value *time.Time) string { return ParseTimeToString(DEFAULT_TIME_FORMAT, value) } func ParseTimeToString(layout string, value *time.Time) string { if value == nil { return "" } return value.Format(layout) } func NewDate(day int, month time.Month, year int) *time.Time { t := time.Date(year, month, day, 0, 0, 0, 0, time.Now().Location()) return &t } func NewDateForDayOfWeek(dayOffWeek time.Weekday, month time.Month, year int, number int) *time.Time { if number == 0 { return nil } var result *time.Time var num int for i := 1; i <= 31; i++ { t := time.Date(year, month, i, 0, 0, 0, 0, time.Now().Location()) if t.Month() != month { break } if t.Weekday() == dayOffWeek { num++ } if num == number { result = &t break } } return result } func NewLastDateForDayOfWeek(dayOffWeek time.Weekday, month time.Month, year int) *time.Time { var result *time.Time var num int for i := 1; i <= 31; i++ { t := time.Date(year, month, i, 0, 0, 0, 0, time.Now().Location()) if t.Month() != month { break } if t.Weekday() == dayOffWeek { num++ } if num == num { result = &t } } return result } func TimeNow() *time.Time { t := time.Now() return &t } func TimeNowAdd(d time.Duration) *time.Time { t := time.Now().Add(d) return &t } func TimeAdd(t time.Time, d time.Duration) *time.Time { ts := t.Add(d) return &ts } func TruncateDate(toRound time.Time) time.Time { rounded := time.Date(toRound.Year(), toRound.Month(), toRound.Day(), 0, 0, 0, 0, toRound.Location()) return rounded } func NewNearbyDayOfWeekAt(t *time.Time, dayOffWeek time.Weekday) *time.Time { for i := 1; i <= 7; i++ { t1 := t.AddDate(0, 0, -1) t = &t1 if t.Weekday() == dayOffWeek { break } } return t } func NewNearbyDayOfMonthAt(t *time.Time, dayOffMonth int) *time.Time { ts := *t for i := 1; i <= 31; i++ { ts = ts.Add(-24 * time.Hour) if ts.Month() == t.Month() { if ts.Day() == dayOffMonth { break } } else { if ts.Day() == dayOffMonth { break } if ts.Day() < dayOffMonth { break } } } return &ts } func ToWorkHours(t1 *time.Time, t2 *time.Time) float64 { var workHours float64 if t1.Unix() >= t2.Unix() { return 0 } for t1.Unix() <= t2.Unix() { if t1.Weekday() != time.Sunday && t1.Weekday() != time.Saturday { workHours += 8 } t := t1.AddDate(0, 0, 1) t1 = &t } return workHours } func GetStartDayOfWeek(t time.Time) time.Time { //get monday 00:00:00 t = t.UTC() weekday := time.Duration(t.Weekday()) if weekday == 0 { weekday = 7 } year, month, day := t.Date() currentZeroDay := time.Date(year, month, day, 0, 0, 0, 0, time.UTC) return currentZeroDay.Add(-1 * (weekday - 1) * 24 * time.Hour) } func GetStartDayOfMonth(t time.Time) time.Time { //get monday 00:00:00 t = t.UTC() year, month, _ := t.Date() r := time.Date(year, month, 1, 0, 0, 0, 0, time.UTC) return r } func ParseStringToFilterDateDefault(value string) *time.Time { return ParseStringToTime(DEFAULT_FILTER_TIME_FORMAT, value) } func GetNextScheduleTime(interval time.Duration, delay time.Duration) *time.Time { t := time.Now().Truncate(interval).Add(delay) if t.Before(time.Now()) { t = t.Add(interval) } return &t } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/helpers/tpl.go ================================================ package helpers import ( "bytes" "encoding/base64" "html/template" ) var funcMap = template.FuncMap{ "unescape": func(s string) template.HTML { return template.HTML(s) }, } func GenerateTemplateContent(templateContent string, data interface{}) (string, error) { tmpl, err := template.New("content").Funcs(funcMap).Parse(templateContent) if err != nil { return "", err } var tpl bytes.Buffer err = tmpl.ExecuteTemplate(&tpl, "content", data) if err != nil { return "", err } return tpl.String(), nil } func Base64Encode(data []byte) string { sDec := base64.StdEncoding.EncodeToString(data) return sDec } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/helpers/twitter.go ================================================ package helpers import ( "bytes" "encoding/json" "errors" "fmt" "io" "net/http" "strings" "time" ) func SplitTextByCharLimit(text string, limit int) []string { var result []string words := strings.Fields(text) var line string for _, word := range words { if len(line)+len(word)+1 > limit { result = append(result, line) line = word } else { if line != "" { line += " " } line += word } } if line != "" { result = append(result, line) } return result } func RemoveTrailingHashTag(line string) string { line = strings.TrimSpace(line) words := strings.Fields(line) var isOk bool hashtags := []string{} for i := len(words) - 1; i >= 0; i-- { word := words[i] if !strings.HasPrefix(word, "#") { isOk = true } if isOk { } else { hashtags = append(hashtags, word) } } for _, v := range hashtags { line = strings.TrimSpace(strings.TrimSuffix(line, v)) } return line } // SplitTextBySentenceAndCharLimit splits text into lines by sentence boundaries and a character limit per line. func SplitTextBySentenceAndCharLimitAndRemoveTrailingHashTag(originText string, limit int) []string { limit = limit - 1 // Split the text into sentences based on the period "." originText = RemoveTrailingHashTag(strings.TrimSpace(originText)) if len(originText) <= limit { if strings.HasPrefix(originText, "@") { originText = "." + originText } return []string{originText} } text := strings.TrimSuffix(originText, ".") strs := strings.Split(text, ". ") var sentences []string for _, str := range strs { sentences = append(sentences, strings.Split(str, ".\n")...) } var result []string var line string for _, sentence := range sentences { // Trim any leading or trailing spaces in the sentence sentence = strings.TrimSpace(sentence) if sentence == "" { continue } // If the sentence itself exceeds the limit, split it further by words if len(sentence) > limit { words := strings.Fields(sentence) var subLine string for _, word := range words { // If adding the word exceeds the limit, add the current subLine to result and start a new subLine if len(subLine)+len(word)+1 > limit { result = append(result, subLine) subLine = word } else { // Otherwise, add the word to the current subLine if subLine != "" { subLine += " " } subLine += word } } // Append the remaining subLine if it's not empty if subLine != "" { result = append(result, subLine) } } else { // If the sentence is within the limit, try to add it to the current line if len(line)+len(sentence)+2 > limit { // +2 for the period and space result = append(result, line+".") line = sentence } else { if line != "" { line += ". " } line += sentence } } } // Append the last line if there's any content left if line != "" { if strings.HasSuffix(originText, ".") { result = append(result, line+".") } else { result = append(result, line) } } if len(result) > 0 { if strings.HasPrefix(result[0], "@") { result[0] = "." + result[0] } } return result } func ReplyTweetByToken(bearerToken string, replyContent string, tweetID, mediaID string) (string, error) { url := "https://api.twitter.com/2/tweets" payload := map[string]interface{}{ "text": replyContent, "reply": map[string]string{ "in_reply_to_tweet_id": tweetID, }, } if mediaID != "" { payload["media"] = map[string]interface{}{ "media_ids": []string{mediaID}, } } payloadBytes, err := json.Marshal(payload) if err != nil { return "", fmt.Errorf("error encoding payload: %w", err) } req, err := http.NewRequest("POST", url, bytes.NewBuffer(payloadBytes)) if err != nil { return "", fmt.Errorf("error creating request: %w", err) } req.Header.Set("Authorization", "Bearer "+bearerToken) req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { return "", fmt.Errorf("error sending request: %w", err) } defer resp.Body.Close() body, _ := io.ReadAll(resp.Body) if resp.StatusCode != http.StatusCreated { return "", fmt.Errorf("failed to reply tweet, status: %s, body: %s", resp.Status, body) } // Parse response to extract the reply ID var responseData struct { Data struct { ID string `json:"id"` } `json:"data"` } if err := json.Unmarshal(body, &responseData); err != nil { return "", fmt.Errorf("error parsing response: %w", err) } fmt.Println("Reply posted successfully, ID:", responseData.Data.ID) return responseData.Data.ID, nil } func QuoteTweetByToken(bearerToken string, content string, quoteTweetId string) (string, error) { url := "https://api.twitter.com/2/tweets" payload := map[string]interface{}{ "text": content, "quote_tweet_id": quoteTweetId, } payloadBytes, err := json.Marshal(payload) if err != nil { return "", fmt.Errorf("error encoding payload: %w", err) } req, err := http.NewRequest("POST", url, bytes.NewBuffer(payloadBytes)) if err != nil { return "", fmt.Errorf("error creating request: %w", err) } req.Header.Set("Authorization", "Bearer "+bearerToken) req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { return "", fmt.Errorf("error sending request: %w", err) } defer resp.Body.Close() body, _ := io.ReadAll(resp.Body) if resp.StatusCode != http.StatusCreated { return "", fmt.Errorf("failed to reply tweet, status: %s, body: %s", resp.Status, body) } // Parse response to extract the reply ID var responseData struct { Data struct { ID string `json:"id"` } `json:"data"` } if err := json.Unmarshal(body, &responseData); err != nil { return "", fmt.Errorf("error parsing response: %w", err) } fmt.Println("Reply posted successfully, ID:", responseData.Data.ID) return responseData.Data.ID, nil } func RepostTweetByToken(bearerToken string, userID string, tweetID string) (string, error) { url := fmt.Sprintf("https://api.twitter.com/2/users/%s/retweets", userID) payload := map[string]string{ "tweet_id": tweetID, } payloadBytes, err := json.Marshal(payload) if err != nil { return "", fmt.Errorf("error encoding payload: %w", err) } req, err := http.NewRequest("POST", url, bytes.NewBuffer(payloadBytes)) if err != nil { return "", fmt.Errorf("error creating request: %w", err) } req.Header.Set("Authorization", "Bearer "+bearerToken) req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { return "", fmt.Errorf("error sending request: %w", err) } defer resp.Body.Close() body, _ := io.ReadAll(resp.Body) if resp.StatusCode != http.StatusOK { return "", fmt.Errorf("failed to repost tweet, status: %s, body: %s", resp.Status, body) } // Parse response to confirm repost success or get additional info if needed var responseData struct { Data struct { ID string `json:"rest_id"` } `json:"data"` } if err := json.Unmarshal(body, &responseData); err != nil { return "", fmt.Errorf("error parsing response: %w", err) } fmt.Println("Repost successful, ID:", responseData.Data.ID) return responseData.Data.ID, nil } func PostTweetByToken(accessToken, message string, replyID string) (string, error) { url := "https://api.twitter.com/2/tweets" payload := map[string]interface{}{ "text": message, } if replyID != "" { payload["reply"] = map[string]string{ "in_reply_to_tweet_id": replyID, } } payloadBytes, err := json.Marshal(payload) if err != nil { return "", fmt.Errorf("error encoding payload: %w", err) } req, err := http.NewRequest("POST", url, bytes.NewBuffer(payloadBytes)) if err != nil { return "", fmt.Errorf("error creating request: %w", err) } req.Header.Set("Authorization", "Bearer "+accessToken) req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { return "", fmt.Errorf("error sending request: %w", err) } defer resp.Body.Close() body, err := io.ReadAll(resp.Body) if err != nil { return "", err } if resp.StatusCode != http.StatusCreated { return "", fmt.Errorf("failed to post tweet, status: %s, body: %s", resp.Status, body) } // Parse response to extract the tweet ID var responseData struct { Data struct { ID string `json:"id"` } `json:"data"` } if err := json.Unmarshal(body, &responseData); err != nil { return "", fmt.Errorf("error parsing response: %w", err) } fmt.Println("Tweet posted successfully, ID:", responseData.Data.ID) return responseData.Data.ID, nil } type TwitterNotification struct { Data []struct { ID string `json:"id"` Text string `json:"text"` } `json:"data"` } func GetTwitterNotifications(accessToken, userID string) (*TwitterNotification, error) { twitterApiUrl := fmt.Sprintf("https://api.twitter.com/2/users/%s/mentions?max_results=5", userID) req, err := http.NewRequest("GET", twitterApiUrl, nil) if err != nil { return nil, err } req.Header.Set("Authorization", "Bearer "+accessToken) req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() if resp.StatusCode != http.StatusOK { return nil, errors.New("StatusCode not 200") } var respData TwitterNotification err = json.NewDecoder(resp.Body).Decode(&respData) if err != nil { return nil, err } return &respData, nil } type TwitterUserMe struct { Data *struct { ID string `json:"id"` Name string `json:"name"` UserName string `json:"username"` CreatedAt string `json:"created_at"` Description string `json:"description"` Location string `json:"location"` PinnedTweetID string `json:"pinned_tweet_id"` ProfileImageURL string `json:"profile_image_url"` Protected bool `json:"protected"` URL string `json:"url"` Verified bool `json:"verified"` } `json:"data"` } func GetTwitterUserMe(accessToken string) (*TwitterUserMe, error) { twitterApiUrl := "https://api.twitter.com/2/users/me?user.fields=username,name,verified,verified_type,profile_image_url" req, err := http.NewRequest("GET", twitterApiUrl, nil) if err != nil { return nil, err } req.Header.Set("Authorization", "Bearer "+accessToken) req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() if resp.StatusCode != http.StatusOK { return nil, nil } var respData TwitterUserMe err = json.NewDecoder(resp.Body).Decode(&respData) if err != nil { return nil, err } return &respData, nil } func TwitterFollowUserCreate(accessToken, twitterId string, targetTwitterId string) error { url := fmt.Sprintf("https://api.twitter.com/2/users/%s/following", twitterId) payload := map[string]string{ "target_user_id": targetTwitterId, } payloadBytes, err := json.Marshal(payload) if err != nil { return fmt.Errorf("error encoding payload: %w", err) } req, err := http.NewRequest("POST", url, bytes.NewBuffer(payloadBytes)) if err != nil { return fmt.Errorf("error creating request: %w", err) } req.Header.Set("Authorization", "Bearer "+accessToken) req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { return fmt.Errorf("error sending request: %w", err) } defer resp.Body.Close() body, err := io.ReadAll(resp.Body) if err != nil { return err } if resp.StatusCode >= 300 { return fmt.Errorf("failed to post tweet, status: %s, body: %s", resp.Status, body) } var responseData struct { Data struct { ID string `json:"id"` } `json:"data"` } if err := json.Unmarshal(body, &responseData); err != nil { return fmt.Errorf("error parsing response: %w", err) } return nil } // Response structure for liked tweets type LikedTweetsResponse struct { Data []struct { ID string `json:"id"` Text string `json:"text"` } `json:"data"` Meta struct { NextToken string `json:"next_token"` } `json:"meta"` } // Function to fetch liked tweets func GetLikedTweets(userID string, bearerToken string, nextToken string) (*LikedTweetsResponse, error) { baseURL := "https://api.twitter.com/2/users/" + userID + "/liked_tweets" req, err := http.NewRequest("GET", baseURL, nil) if err != nil { return nil, err } // Set headers req.Header.Set("Authorization", "Bearer "+bearerToken) // Add pagination if needed query := req.URL.Query() query.Add("max_results", "100") if nextToken != "" { query.Add("pagination_token", nextToken) } req.URL.RawQuery = query.Encode() client := &http.Client{} resp, err := client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() if resp.StatusCode != http.StatusOK { return nil, fmt.Errorf("failed to fetch liked tweets: %s", resp.Status) } var likedTweets LikedTweetsResponse if err := json.NewDecoder(resp.Body).Decode(&likedTweets); err != nil { return nil, err } return &likedTweets, nil } func PostTweetWithMediaByToken(accessToken, message string, mediaID string) (string, error) { url := "https://api.twitter.com/2/tweets" payload := map[string]interface{}{ "text": message, } if mediaID != "" { payload["media"] = map[string]interface{}{ "media_ids": []string{mediaID}, } } payloadBytes, err := json.Marshal(payload) if err != nil { return "", fmt.Errorf("error encoding payload: %w", err) } req, err := http.NewRequest("POST", url, bytes.NewBuffer(payloadBytes)) if err != nil { return "", fmt.Errorf("error creating request: %w", err) } req.Header.Set("Authorization", "Bearer "+accessToken) req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { return "", fmt.Errorf("error sending request: %w", err) } defer resp.Body.Close() body, err := io.ReadAll(resp.Body) if err != nil { return "", err } if resp.StatusCode != http.StatusCreated { return "", fmt.Errorf("failed to post tweet, status: %s, body: %s", resp.Status, body) } // Parse response to extract the tweet ID var responseData struct { Data struct { ID string `json:"id"` } `json:"data"` } if err := json.Unmarshal(body, &responseData); err != nil { return "", fmt.Errorf("error parsing response: %w", err) } fmt.Println("Tweet posted successfully, ID:", responseData.Data.ID) return responseData.Data.ID, nil } func PostThreadTweetByToken(accessToken string, messages []string) (string, error) { if len(messages) == 0 { return "", nil } parentTweetID, err := PostTweetByToken(accessToken, messages[0], "") if err != nil { return "", err } if parentTweetID != "" { tweetID := parentTweetID for i := 1; i < len(messages); i++ { tweetID, err = PostTweetByToken(accessToken, fmt.Sprintf("#%d: %s", i, messages[i]), tweetID) if err != nil { return "", err } if tweetID == "" { return parentTweetID, nil } time.Sleep(1 * time.Second) } } return parentTweetID, err } // dm func GetListDmRecent(accessToken string) error { return nil } func GetDmByID(accessToken string) error { return nil } func ReplyDm(accessToken string) error { return nil } // ================================================ FILE: agent-as-a-service/agent-orchestration/backend/helpers/univ3.go ================================================ package helpers import ( "errors" "math" "math/big" "regexp" "strconv" "strings" "github.com/ethereum/go-ethereum/common" ) var ( Q128 = big.NewInt(1).Lsh(big.NewInt(1), 128) Q96 = big.NewInt(1).Lsh(big.NewInt(1), 96) Q32 = big.NewInt(1).Lsh(big.NewInt(1), 32) MIN_TICK = big.NewInt(-887272) MAX_TICK = new(big.Int).Neg(MIN_TICK) MAX_UINT256 = new(big.Int).Sub( new(big.Int).Exp(big.NewInt(2), big.NewInt(256), nil), big.NewInt(1), ) ) func HexToBigInt(s string) *big.Int { s = strings.TrimPrefix(s, "0x") n, ok := new(big.Int).SetString(s, 16) if !ok { panic("bad data") } return n } func GetSqrtRatioAtTick(tick int64) *big.Int { absTick := new(big.Int).Abs(big.NewInt(tick)) if absTick.Cmp(MAX_TICK) > 0 { panic("bad data") } ratio := HexToBigInt("0x100000000000000000000000000000000") if new(big.Int).And(absTick, big.NewInt(1)).Cmp(big.NewInt(0)) != 0 { ratio = HexToBigInt("0xfffcb933bd6fad37aa2d162d1a594001") } if new(big.Int).And(absTick, HexToBigInt("0x02")).Cmp(big.NewInt(0)) != 0 { ratio = new(big.Int).Mul(ratio, HexToBigInt("0xfff97272373d413259a46990580e213a")) ratio = new(big.Int).Div(ratio, Q128) } if new(big.Int).And(absTick, HexToBigInt("0x4")).Cmp(big.NewInt(0)) != 0 { ratio = new(big.Int).Mul(ratio, HexToBigInt("0xfff2e50f5f656932ef12357cf3c7fdcc")) ratio = new(big.Int).Div(ratio, Q128) } if new(big.Int).And(absTick, HexToBigInt("0x8")).Cmp(big.NewInt(0)) != 0 { ratio = new(big.Int).Mul(ratio, HexToBigInt("0xffe5caca7e10e4e61c3624eaa0941cd0")) ratio = new(big.Int).Div(ratio, Q128) } if new(big.Int).And(absTick, HexToBigInt("0x10")).Cmp(big.NewInt(0)) != 0 { ratio = new(big.Int).Mul(ratio, HexToBigInt("0xffcb9843d60f6159c9db58835c926644")) ratio = new(big.Int).Div(ratio, Q128) } if new(big.Int).And(absTick, HexToBigInt("0x20")).Cmp(big.NewInt(0)) != 0 { ratio = new(big.Int).Mul(ratio, HexToBigInt("0xff973b41fa98c081472e6896dfb254c0")) ratio = new(big.Int).Div(ratio, Q128) } if new(big.Int).And(absTick, HexToBigInt("0x40")).Cmp(big.NewInt(0)) != 0 { ratio = new(big.Int).Mul(ratio, HexToBigInt("0xff2ea16466c96a3843ec78b326b52861")) ratio = new(big.Int).Div(ratio, Q128) } if new(big.Int).And(absTick, HexToBigInt("0x80")).Cmp(big.NewInt(0)) != 0 { ratio = new(big.Int).Mul(ratio, HexToBigInt("0xfe5dee046a99a2a811c461f1969c3053")) ratio = new(big.Int).Div(ratio, Q128) } if new(big.Int).And(absTick, HexToBigInt("0x100")).Cmp(big.NewInt(0)) != 0 { ratio = new(big.Int).Mul(ratio, HexToBigInt("0xfcbe86c7900a88aedcffc83b479aa3a4")) ratio = new(big.Int).Div(ratio, Q128) } if new(big.Int).And(absTick, HexToBigInt("0x200")).Cmp(big.NewInt(0)) != 0 { ratio = new(big.Int).Mul(ratio, HexToBigInt("0xf987a7253ac413176f2b074cf7815e54")) ratio = new(big.Int).Div(ratio, Q128) } if new(big.Int).And(absTick, HexToBigInt("0x400")).Cmp(big.NewInt(0)) != 0 { ratio = new(big.Int).Mul(ratio, HexToBigInt("0xf3392b0822b70005940c7a398e4b70f3")) ratio = new(big.Int).Div(ratio, Q128) } if new(big.Int).And(absTick, HexToBigInt("0x800")).Cmp(big.NewInt(0)) != 0 { ratio = new(big.Int).Mul(ratio, HexToBigInt("0xe7159475a2c29b7443b29c7fa6e889d9")) ratio = new(big.Int).Div(ratio, Q128) } if new(big.Int).And(absTick, HexToBigInt("0x1000")).Cmp(big.NewInt(0)) != 0 { ratio = new(big.Int).Mul(ratio, HexToBigInt("0xd097f3bdfd2022b8845ad8f792aa5825")) ratio = new(big.Int).Div(ratio, Q128) } if new(big.Int).And(absTick, HexToBigInt("0x2000")).Cmp(big.NewInt(0)) != 0 { ratio = new(big.Int).Mul(ratio, HexToBigInt("0xa9f746462d870fdf8a65dc1f90e061e5")) ratio = new(big.Int).Div(ratio, Q128) } if new(big.Int).And(absTick, HexToBigInt("0x4000")).Cmp(big.NewInt(0)) != 0 { ratio = new(big.Int).Mul(ratio, HexToBigInt("0x70d869a156d2a1b890bb3df62baf32f7")) ratio = new(big.Int).Div(ratio, Q128) } if new(big.Int).And(absTick, HexToBigInt("0x8000")).Cmp(big.NewInt(0)) != 0 { ratio = new(big.Int).Mul(ratio, HexToBigInt("0x31be135f97d08fd981231505542fcfa6")) ratio = new(big.Int).Div(ratio, Q128) } if new(big.Int).And(absTick, HexToBigInt("0x10000")).Cmp(big.NewInt(0)) != 0 { ratio = new(big.Int).Mul(ratio, HexToBigInt("0x9aa508b5b7a84e1c677de54f3e99bc9")) ratio = new(big.Int).Div(ratio, Q128) } if new(big.Int).And(absTick, HexToBigInt("0x20000")).Cmp(big.NewInt(0)) != 0 { ratio = new(big.Int).Mul(ratio, HexToBigInt("0x5d6af8dedb81196699c329225ee604")) ratio = new(big.Int).Div(ratio, Q128) } if new(big.Int).And(absTick, HexToBigInt("0x40000")).Cmp(big.NewInt(0)) != 0 { ratio = new(big.Int).Mul(ratio, HexToBigInt("0x2216e584f5fa1ea926041bedfe98")) ratio = new(big.Int).Div(ratio, Q128) } if new(big.Int).And(absTick, HexToBigInt("0x80000")).Cmp(big.NewInt(0)) != 0 { ratio = new(big.Int).Mul(ratio, HexToBigInt("0x48a170391f7dc42444e8fa2")) ratio = new(big.Int).Div(ratio, Q128) } if tick > 0 { ratio = new(big.Int).Div(MAX_UINT256, ratio) } remainder := new(big.Int).Mod(ratio, new(big.Int).Mul(big.NewInt(1), Q32)) sqrtPriceX96 := new(big.Int).Div(ratio, Q32) if remainder.Cmp(big.NewInt(0)) != 0 { sqrtPriceX96 = new(big.Int).Add(sqrtPriceX96, big.NewInt(1)) } return sqrtPriceX96 } func GetLiquidityForAmount0(sqrtRatioAX96, sqrtRatioBX96, amount0 *big.Int) *big.Int { if sqrtRatioAX96.Cmp(sqrtRatioBX96) > 0 { sqrtRatioAX96, sqrtRatioBX96 = sqrtRatioBX96, sqrtRatioAX96 } intermediate := new(big.Int).Mul(sqrtRatioAX96, sqrtRatioBX96) intermediate.Div(intermediate, Q96) result := new(big.Int).Mul(amount0, intermediate) result.Div(result, new(big.Int).Sub(sqrtRatioBX96, sqrtRatioAX96)) return result } func GetLiquidityForAmount1(sqrtRatioAX96, sqrtRatioBX96, amount1 *big.Int) *big.Int { if sqrtRatioAX96.Cmp(sqrtRatioBX96) > 0 { sqrtRatioAX96, sqrtRatioBX96 = sqrtRatioBX96, sqrtRatioAX96 } result := new(big.Int).Mul(amount1, Q96) result.Div(result, new(big.Int).Sub(sqrtRatioBX96, sqrtRatioAX96)) return result } func GetLiquidityForAmounts(sqrtRatioCurrentX96, sqrtRatioAX96, sqrtRatioBX96, amount0, amount1 *big.Int) *big.Int { if sqrtRatioAX96.Cmp(sqrtRatioBX96) > 0 { sqrtRatioAX96, sqrtRatioBX96 = sqrtRatioBX96, sqrtRatioAX96 } if sqrtRatioCurrentX96.Cmp(sqrtRatioAX96) < 0 { return GetLiquidityForAmount0(sqrtRatioAX96, sqrtRatioBX96, amount0) } else if sqrtRatioCurrentX96.Cmp(sqrtRatioBX96) < 0 { liquidity0 := GetLiquidityForAmount0(sqrtRatioCurrentX96, sqrtRatioBX96, amount0) liquidity1 := GetLiquidityForAmount1(sqrtRatioAX96, sqrtRatioCurrentX96, amount1) if liquidity0.Cmp(liquidity1) < 0 { return liquidity0 } else { return liquidity1 } } else { return GetLiquidityForAmount1(sqrtRatioAX96, sqrtRatioBX96, amount1) } } func GetAmount0ForLiquidity(sqrtRatioAX96, sqrtRatioBX96, liquidity *big.Int) *big.Int { if sqrtRatioAX96.Cmp(sqrtRatioBX96) > 0 { sqrtRatioAX96, sqrtRatioBX96 = sqrtRatioBX96, sqrtRatioAX96 } result := new(big.Int).Mul(liquidity, Q96) result.Mul(result, new(big.Int).Sub(sqrtRatioBX96, sqrtRatioAX96)) result.Div(result, sqrtRatioBX96) result.Div(result, sqrtRatioAX96) return result } func GetAmount1ForLiquidity(sqrtRatioAX96, sqrtRatioBX96, liquidity *big.Int) *big.Int { if sqrtRatioAX96.Cmp(sqrtRatioBX96) > 0 { sqrtRatioAX96, sqrtRatioBX96 = sqrtRatioBX96, sqrtRatioAX96 } result := new(big.Int).Mul(liquidity, new(big.Int).Sub(sqrtRatioBX96, sqrtRatioAX96)) result.Div(result, Q96) return result } func GetAmountsForLiquidity(sqrtRatioCurrentX96, sqrtRatioAX96, sqrtRatioBX96, liquidity *big.Int) (*big.Int, *big.Int) { if sqrtRatioAX96.Cmp(sqrtRatioBX96) > 0 { sqrtRatioAX96, sqrtRatioBX96 = sqrtRatioBX96, sqrtRatioAX96 } amountOut0 := big.NewInt(0) amountOut1 := big.NewInt(0) if sqrtRatioCurrentX96.Cmp(sqrtRatioAX96) < 0 { amountOut0 = GetAmount0ForLiquidity(sqrtRatioAX96, sqrtRatioBX96, liquidity) } else if sqrtRatioCurrentX96.Cmp(sqrtRatioBX96) > 0 { amountOut1 = GetAmount1ForLiquidity(sqrtRatioAX96, sqrtRatioBX96, liquidity) } else { if sqrtRatioCurrentX96.Cmp(sqrtRatioBX96) < 0 { amountOut0 = GetAmount0ForLiquidity(sqrtRatioCurrentX96, sqrtRatioBX96, liquidity) } if sqrtRatioAX96.Cmp(sqrtRatioCurrentX96) < 0 { amountOut1 = GetAmount1ForLiquidity(sqrtRatioAX96, sqrtRatioCurrentX96, liquidity) } } return amountOut0, amountOut1 } func ParseGasFeeError(errText string) (*big.Int, error) { if strings.Contains(errText, "insufficient") && strings.Contains(errText, "cost") { errTexts := strings.Split(errText, " ") for idx, v := range errTexts { if v == "cost" { valueText := strings.Trim(errTexts[idx+1], ",") gasFee, ok := big.NewInt(0).SetString(valueText, 10) if !ok { return nil, errors.New(errText) } return gasFee, nil } } } return nil, errors.New(errText) } func PriceToTick(price float64) int64 { return int64(math.Log(price) / math.Log(1.0001)) } func GetNumberFromString(strText string) int { re := regexp.MustCompile("[0-9]+") arr := re.FindAllString(strText, -1) if len(arr) > 0 { i, err := strconv.Atoi(arr[len(arr)-1]) if err != nil { return 0 } return i } return 0 } func HexToAddress(address string) common.Address { addr := common.HexToAddress(address) if !strings.EqualFold(addr.Hex(), address) { panic("wrong address") } return addr } func HexToHash(hashHex string) common.Hash { hash := common.HexToHash(hashHex) if !strings.EqualFold(hash.Hex(), hashHex) { panic("wrong hash") } return hash } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/helpers/utils.go ================================================ package helpers import ( "bytes" "crypto/md5" "encoding/csv" "encoding/hex" "encoding/json" "errors" "fmt" "html" "io/ioutil" "log" "math/big" "math/rand" "mime" "net/http" "net/url" "regexp" "strconv" "strings" "time" "github.com/PuerkitoBio/goquery" "github.com/davecgh/go-spew/spew" "github.com/go-rod/rod" "github.com/go-rod/rod/lib/launcher" "github.com/go-rod/stealth" "github.com/gocolly/colly" "github.com/leekchan/accounting" "mvdan.cc/xurls/v2" ) func SubStringBodyResponse(obj string, limit int) string { if len(obj) > limit { return obj[0:limit] } return obj } func ExtractTweetID(link string) string { re := regexp.MustCompile(`/status/(\d+)`) matches := re.FindStringSubmatch(link) if len(matches) > 1 { return matches[1] } return "" } func ReplaceQuote(obj string) string { obj = strings.ReplaceAll(obj, "'", "''") obj = strings.ReplaceAll(obj, "\\", "\\\\") return obj } func SimpleAddress(hexAddress string) string { return fmt.Sprintf("%s...%s", hexAddress[:4], hexAddress[len(hexAddress)-4:]) } func MergeMetaInfoURL(baseURL string, mediaURL string) string { if strings.HasPrefix(mediaURL, "http") || strings.HasPrefix(mediaURL, "ipfs") { return mediaURL } return fmt.Sprintf("%s/%s", baseURL, mediaURL) } func RandomSeoURLWithLength(length int) string { rand.Seed(time.Now().UnixNano()) chars := []rune( "abcdefghijklmnopqrstuvwxyz", ) var b strings.Builder for i := 0; i < length; i++ { b.WriteRune(chars[rand.Intn(len(chars))]) } str := b.String() return str } func ExtensionsByContentType(contentType string) (string, error) { exts, err := mime.ExtensionsByType(contentType) if err != nil { return "", err } if len(exts) == 0 { return "", errors.New("contentType not found") } return exts[0], nil } func SlackHook(slackURL, channel, content string) error { // slackURL := "https://hooks.slack.com/services/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" go func() error { bodyRequest, err := json.Marshal(map[string]interface{}{ "channel": channel, "username": "tc-report", "text": content, "icon_url": "http://www.hopabot.com/img/intro-carousel/f2.png", }) if err != nil { return err } req, err := http.NewRequest("POST", slackURL, bytes.NewBuffer(bodyRequest)) if err != nil { return err } req.Header.Set("Content-Type", "application/json") client := &http.Client{} res, err := client.Do(req) if err != nil { return err } defer res.Body.Close() if res.StatusCode != http.StatusOK { return errors.New(res.Status) } return nil }() return nil } type BinancePrice struct { Symbol string `json:"symbol"` Price string `json:"price"` } type BinancePrice24h struct { Symbol string `json:"symbol"` LastPrice string `json:"lastPrice"` PriceChange string `json:"priceChange"` PriceChangePercent string `json:"priceChangePercent"` WeightedAvgPrice string `json:"weightedAvgPrice"` PrevClosePrice string `json:"prevClosePrice"` LastQty string `json:"lastQty"` BidPrice string `json:"bidPrice"` BidQty string `json:"bidQty"` AskQty string `json:"askQty"` OpenPrice string `json:"openPrice"` HighPrice string `json:"highPrice"` LowPrice string `json:"lowPrice"` Volume string `json:"volume"` QuoteVolume string `json:"quoteVolume"` OpenTime int64 `json:"openTime"` CloseTime int64 `json:"closeTime"` } func GetListExternalPrice(tokenSymbol string) ([]BinancePrice, error) { binancePriceURL := fmt.Sprintf("https://api.binance.com/api/v3/ticker/price?symbols=%s", tokenSymbol) var prices []BinancePrice var jsonErr struct { Code int `json:"code"` Msg string `json:"msg"` } retryTimes := 0 retry: retryTimes++ if retryTimes > 2 { return prices, nil } resp, err := http.Get(binancePriceURL) if err != nil { log.Println(err) goto retry } body, err := ioutil.ReadAll(resp.Body) if err != nil { log.Fatalln(err) } err = json.Unmarshal(body, &prices) if err != nil { err = json.Unmarshal(body, &jsonErr) if err != nil { log.Println(err) goto retry } } resp.Body.Close() // value, err := strconv.ParseFloat(price.Price, 32) // if err != nil { // log.Println("getExternalPrice", tokenSymbol, err) // return 0, nil // } return prices, nil } func GetListExternalPrice24h(tokenSymbol string) ([]BinancePrice24h, error) { binancePriceURL := fmt.Sprintf("https://api.binance.com/api/v3/ticker/24hr?symbols=%s", tokenSymbol) var prices []BinancePrice24h var jsonErr struct { Code int `json:"code"` Msg string `json:"msg"` } retryTimes := 0 retry: retryTimes++ if retryTimes > 2 { return prices, nil } resp, err := http.Get(binancePriceURL) if err != nil { log.Println(err) goto retry } body, err := ioutil.ReadAll(resp.Body) if err != nil { log.Fatalln(err) } err = json.Unmarshal(body, &prices) if err != nil { err = json.Unmarshal(body, &jsonErr) if err != nil { log.Println(err) goto retry } } resp.Body.Close() return prices, nil } func GetBinancePrice24h(tokenSymbol string) (BinancePrice24h, error) { binancePriceURL := fmt.Sprintf("https://api.binance.com/api/v3/ticker/24hr?symbol=%s", tokenSymbol) var prices BinancePrice24h var jsonErr struct { Code int `json:"code"` Msg string `json:"msg"` } retryTimes := 0 retry: retryTimes++ if retryTimes > 2 { return prices, nil } resp, err := http.Get(binancePriceURL) if err != nil { log.Println(err) goto retry } body, err := ioutil.ReadAll(resp.Body) if err != nil { log.Fatalln(err) } err = json.Unmarshal(body, &prices) if err != nil { err = json.Unmarshal(body, &jsonErr) if err != nil { log.Println(err) goto retry } } resp.Body.Close() return prices, nil } func GetExternalPrice(tokenSymbol string) (string, error) { binanceAPI := "https://api.binance.com" binancePriceURL := fmt.Sprintf("%v/api/v3/ticker/price?symbol=%s", binanceAPI, tokenSymbol) var price BinancePrice var jsonErr struct { Code int `json:"code"` Msg string `json:"msg"` } retryTimes := 0 retry: retryTimes++ if retryTimes > 2 { return "", nil } resp, err := http.Get(binancePriceURL) if err != nil { log.Println(err) goto retry } body, err := ioutil.ReadAll(resp.Body) if err != nil { log.Fatalln(err) } err = json.Unmarshal(body, &price) if err != nil { err = json.Unmarshal(body, &jsonErr) if err != nil { log.Println(err) goto retry } } resp.Body.Close() return price.Price, nil } func ReadCSVFromUrl(url string) ([][]string, error) { resp, err := http.Get(url) if err != nil { return nil, err } defer resp.Body.Close() reader := csv.NewReader(resp.Body) reader.Comma = ',' data, err := reader.ReadAll() if err != nil { return nil, err } return data, nil } func GenerateMD5(v string) string { data := []byte(v) return fmt.Sprintf("%x", md5.Sum(data)) } func SlackGameAlert(content string) error { slackURL := "https://hooks.slack.com/services/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" channel := "game-alert" go func() error { bodyRequest, err := json.Marshal(map[string]interface{}{ "channel": channel, "username": "game-alert", "text": content, "icon_url": "http://www.hopabot.com/img/intro-carousel/f2.png", }) if err != nil { return err } req, err := http.NewRequest("POST", slackURL, bytes.NewBuffer(bodyRequest)) if err != nil { return err } req.Header.Set("Content-Type", "application/json") client := &http.Client{} res, err := client.Do(req) if err != nil { return err } defer res.Body.Close() if res.StatusCode != http.StatusOK { return errors.New(res.Status) } return nil }() return nil } func RandomInStrings(values []string) string { if len(values) == 0 { panic("wrong values") } if len(values) == 1 { return values[0] } rand.Seed(time.Now().UnixNano()) return values[rand.Intn(len(values))] } func GetTimeIndex(blockNumber, txIndex, logIndex uint) uint64 { blockNumber = blockNumber * 1e7 txIndex = txIndex * 1e3 timeIndex := uint64(blockNumber) + uint64(txIndex) + uint64(logIndex) return timeIndex } func GetFileExtension(fileName string) string { a := strings.Split(fileName, ".") ext := a[len(a)-1] return ext } type NakaChainPrice struct { Result *struct { ETH string `json:"eth,omitempty"` BTC string `json:"btc,omitempty"` EAI string `json:"eai,omitempty"` BVM string `json:"bvm,omitempty"` RUNIX string `json:"runix,omitempty"` NAKA string `json:"naka,omitempty"` } `json:"result"` } func GetNakaChainMarketPrice() (*NakaChainPrice, error) { binancePriceURL := fmt.Sprintf("https://api.nakachain.xyz/api/coin-prices") var prices NakaChainPrice var jsonErr struct { Code int `json:"code"` Msg string `json:"msg"` } retryTimes := 0 retry: retryTimes++ if retryTimes > 2 { return &prices, nil } resp, err := http.Get(binancePriceURL) if err != nil { log.Println(err) goto retry } body, err := ioutil.ReadAll(resp.Body) if err != nil { log.Fatalln(err) } err = json.Unmarshal(body, &prices) if err != nil { err = json.Unmarshal(body, &jsonErr) if err != nil { log.Println(err) goto retry } } resp.Body.Close() return &prices, nil } func SliceToStrings(from, len int, getValueAtIndex func(index int) (string, error)) ([]string, error) { res := []string{} for i := from; i < from+len; i++ { val, err := getValueAtIndex(i) if err != nil { return nil, err } if val != "" { res = append(res, val) } } return res, nil } func IsValidEthereumAddress(address string) bool { // Regular expression to match Ethereum addresses re := regexp.MustCompile(`^0x[0-9a-fA-F]{40}$`) return re.MatchString(address) } func AddressToBinary(address string) ([]byte, error) { hexStr := address[2:] // Convert hex string to byte slice addressHash, err := hex.DecodeString(hexStr) if err != nil { return nil, err } return addressHash, nil } func GetDurationUnit(unit uint8) string { switch unit { case 0: return "days" case 1: return "weeks" case 3: return "months" default: return "" } } // ////////// type CoincodexPrice struct { Symbol string `json:"symbol"` LastPriceUsd float64 `json:"last_price_usd"` DisplaySymbol string `json:"display_symbol"` } func GetCoincodexPriceByTime(monthStr string) ([]*CoincodexPrice, error) { binancePriceURL := fmt.Sprintf("https://coincodex.com/api/coincodex/get_historical_snapshot/%s", monthStr) + `%2000:00/0/200?t=57577472` var prices = struct { Coins []*CoincodexPrice `json:"coins"` }{} retryTimes := 0 retry: retryTimes++ if retryTimes > 2 { return prices.Coins, nil } resp, err := http.Get(binancePriceURL) if err != nil { log.Println(err) goto retry } body, err := ioutil.ReadAll(resp.Body) if err != nil { log.Fatalln(err) } err = json.Unmarshal(body, &prices) if err != nil { if err != nil { log.Println(err) goto retry } } resp.Body.Close() return prices.Coins, nil } func FormatMoney(amount *big.Float) string { amountF, _ := amount.Float64() ac := accounting.Accounting{Symbol: "$", Precision: 2} return ac.FormatMoney(amountF) } func CrawlUrl(urlToCrawl string) string { var ( err error content string urlToGet *url.URL // links []string ) // Parse URL if urlToGet, err = url.Parse(urlToCrawl); err != nil { fmt.Println(err) return "" } // Retrieve content of URL if content, err = getUrlContent(urlToGet.String()); err != nil { fmt.Println(err) return "" } // Clean up HTML entities content = html.UnescapeString(content) fmt.Println(content) // if links, err = parseLinks(urlToGet, content); err != nil { // log.Println(err) // return "" // } // for _, link := range links { // defer CrawlUrl(link) // } return content } func getUrlContent(urlToGet string) (string, error) { var ( err error content []byte resp *http.Response ) // GET content of URL if resp, err = http.Get(urlToGet); err != nil { return "", err } defer resp.Body.Close() // Check if request was successful if resp.StatusCode != 200 { return "", err } // Read the body of the HTTP response if content, err = ioutil.ReadAll(resp.Body); err != nil { return "", err } return string(content), err } func parseLinks(urlToGet *url.URL, content string) ([]string, error) { var ( err error links []string = make([]string, 0) matches [][]string findLinks = regexp.MustCompile(" window.scrollTo(0, document.body.scrollHeight)`) time.Sleep(1 * time.Second) i += 1 } page.MustWaitStable() page.MustEval(`() => document.querySelectorAll("[crossorigin]").forEach((el) => el.removeAttribute('crossorigin')) `) htmlStr, err := page.HTML() if err != nil { return "" } htmlStr, err = MinifyHTML(htmlStr) return htmlStr } func printReport(page *rod.Page) { _ = page.MustElement(".ds-dex-table-row") // for _, row := range el.MustParents("table").First().MustElements("tr:nth-child(n+2)") { // cells := row.MustElements("td") // key := cells[0].MustProperty("textContent") // if strings.HasPrefix(key.String(), "User Agent") { // fmt.Printf("\t\t%s: %t\n\n", key, !strings.Contains(cells[1].MustProperty("textContent").String(), "HeadlessChrome/")) // } else { // fmt.Printf("\t\t%s: %s\n\n", key, cells[1].MustProperty("textContent")) // } // } page.MustScreenshot("") } func RodContentHtmlByUrlV2(rawUrl string) string { path, has := launcher.LookPath() if !has { return "" } spew.Dump(path) u := launcher.New().Bin(path).Headless(true).MustLaunch() browser := rod.New().ControlURL(u).MustConnect() fmt.Printf("js: %x\n\n", md5.Sum([]byte(stealth.JS))) page := stealth.MustPage(browser) page.MustNavigate(rawUrl) // page.MustWaitLoad() // time.Sleep(15 * time.Second) printReport(page) // i := 0 // for i <= 5 { // page.MustEval(`() => window.scrollTo(0, document.body.scrollHeight)`) // time.Sleep(1 * time.Second) // i += 1 // } // page.MustWaitStable() // page.MustEval(`() => document.querySelectorAll("[crossorigin]").forEach((el) => el.removeAttribute('crossorigin')) // `) htmlStr, err := page.HTML() if err != nil { return "" } htmlStr, err = MinifyHTML(htmlStr) return htmlStr } func MinifyHTML(html string) (string, error) { doc, err := goquery.NewDocumentFromReader(strings.NewReader(html)) if err != nil { return "", err } doc.Find("*").Each(func(index int, item *goquery.Selection) { var str string str, err = item.Html() str = strings.TrimSpace(str) str = strings.ReplaceAll(str, "\n", "") str = strings.ReplaceAll(str, "\t", "") if err == nil { item.SetHtml(str) } }) htmlStr, err := doc.Html() if err != nil { return "", err } return strings.TrimSpace(htmlStr), nil } func ExtractLinks(content string) (string, bool) { rx := xurls.Relaxed() extractLink := rx.FindString(content) reg := `((https?):\/\/)?(www.)?x\.com(\/@?(\w){1,15})\/status\/[0-9]{19}` isTwitterPost, _ := regexp.MatchString(reg, extractLink) return extractLink, isTwitterPost } func ExtractMapInfoFromOpenAI(content string) map[string]interface{} { resp := map[string]interface{}{} content = strings.ReplaceAll(content, "`", ``) content = strings.ReplaceAll(content, `\n`, ``) content = strings.ReplaceAll(content, `\`, ``) _ = json.Unmarshal([]byte(content), &resp) return resp } func ExpansionStringArray(arr []string) []string { strs := make([]string, len(arr)) for i, expansion := range arr { strs[i] = string(expansion) } return strs } func RandomInt(from, to int) int { return from + rand.Intn(to-from+1) } func RandomFloat(from, to float64) float64 { return from + rand.Float64()*(to-from) } func ExtractEtherAddress(content string) string { arrStr := strings.Split(content, " ") re := regexp.MustCompile("^0x[0-9a-fA-F]{40}$") for _, item := range arrStr { if re.MatchString(strings.TrimSpace(item)) { return strings.TrimSpace(item) } } return "" } func ExtractEVMAddress(input string) string { re := regexp.MustCompile(`0x[0-9a-fA-F]{40}`) match := re.FindString(input) if match != "" { return match } return "" } func GetStringValueFromMap(mapInfo map[string]interface{}, key string) string { if v, ok := mapInfo[key]; ok { return fmt.Sprintf("%v", v) } return "" } func GetFrequencyFromMap(mapInfo map[string]interface{}) int { frequency := int(2) switch v := mapInfo["frequency"].(type) { case int: frequency = v frequency = frequency * 3600 case float64: { frequencyF := v frequency = int(frequencyF * 3600) } case string: frequency, _ = strconv.Atoi(v) frequency = frequency * 3600 default: frequency = int(2) frequency = frequency * 3600 } return frequency } func GetTokenIDFromMap(mapInfo map[string]interface{}) uint64 { tokenId := int(0) switch v := mapInfo["tokenId"].(type) { case int: tokenId = v case float64: { frequencyF := v tokenId = int(frequencyF) } case string: tokenId, _ = strconv.Atoi(v) } return uint64(tokenId) } func splitStringArray(arr []string, size int) [][]string { var result [][]string for i := 0; i < len(arr); i += size { end := i + size if end > len(arr) { end = len(arr) } result = append(result, arr[i:end]) } return result } func GenerateTokenSymbol(tokenName string) string { // Remove special characters and spaces tokenSymbol := strings.ToLower(tokenName) tokenSymbol = strings.ReplaceAll(tokenSymbol, " ", "") tokenSymbol = strings.ReplaceAll(tokenSymbol, "-", "") tokenSymbol = strings.ReplaceAll(tokenSymbol, "_", "") // Remove any non-alphanumeric characters reg := regexp.MustCompile("[^a-z0-9]") tokenSymbol = reg.ReplaceAllString(tokenSymbol, "") // Take first 5 characters if len(tokenSymbol) > 5 { tokenSymbol = tokenSymbol[:5] } // If empty after cleaning, return default if tokenSymbol == "" { tokenSymbol = RandomStringWithLength(5) } fmt.Println(tokenSymbol) return strings.ToUpper(tokenSymbol) } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/internal/core/ports/agent_info.go ================================================ package ports import ( "context" ) type IAgentInfoUseCase interface { UpdateAgentInfoById(ctx context.Context, id uint, updatedFields map[string]interface{}) error } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/internal/core/ports/app_config.go ================================================ package ports import "context" type IAppConfigUseCase interface { GetAllNameValueInAppConfig(ctx context.Context, networkId string) (map[string]string, error) } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/internal/core/ports/knowledge_ports.go ================================================ package ports import ( "context" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/serializers" ) type IKnowledgeUsecase interface { CreateAgentInfoKnowledgeBase(ctx context.Context, models []*models.AgentInfoKnowledgeBase, agentInfoId uint) ([]*models.AgentInfoKnowledgeBase, error) GetAgentInfoKnowledgeBaseByAgentId(context.Context, uint) (*models.AgentInfoKnowledgeBase, error) GetKnowledgeBaseById(context.Context, uint) (*models.KnowledgeBase, error) DeleteKnowledgeBaseById(context.Context, uint) error CreateKnowledgeBase(context.Context, *serializers.CreateKnowledgeRequest) (*serializers.KnowledgeBase, error) ListKnowledgeBase(context.Context, *models.ListKnowledgeBaseRequest) ([]*serializers.KnowledgeBase, error) WatchWalletChange(context.Context) error GetKnowledgeBaseByStatus(ctx context.Context, status models.KnowledgeBaseStatus, offset, limit int) ([]*models.KnowledgeBase, error) UpdateKnowledgeBaseById(ctx context.Context, id uint, updatedFields map[string]interface{}) error UpdateListKnowledgeBaseFile(ctx context.Context, kbId uint, files []*serializers.File) (bool, error) Webhook(context.Context, *models.RagHookResponse) (*models.KnowledgeBase, error) WebhookFile(context.Context, string, []byte, uint) (*models.KnowledgeBase, error) MapKnowledgeBaseByAgentIds(ctx context.Context, ids []uint) (map[uint][]*models.KnowledgeBase, error) GetKnowledgeBaseByKBId(context.Context, string) (*models.KnowledgeBase, error) GetKnowledgeBaseByKBTokenId(context.Context, string) (*models.KnowledgeBase, error) GetKBAgentsUsedOfSocialAgent(ctx context.Context, socialAgentId uint) ([]*models.KnowledgeBase, error) GetManyKnowledgeBaseByQuery(context.Context, string, string, int, int) ([]*models.KnowledgeBase, error) SendMessage(_ context.Context, content string, chanId int64) (int, error) CalcFeeByKnowledgeBaseId(ctx context.Context, kbId uint) (float64, error) CheckBalance(ctx context.Context, kn *models.KnowledgeBase) error ScanKnowledgeBaseStatusPaymentReceipt(ctx context.Context) } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/internal/core/ports/scraper_ports.go ================================================ package ports import "context" type IScraper interface { ContentHtmlByUrl(ctx context.Context, url string) (string, error) } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/internal/repository/agent_info_knowledge_base_repo.go ================================================ package repository import ( "context" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "gorm.io/gorm" ) type agentInfoKnowledgeBaseRepo struct { db *gorm.DB } type IAgentInfoKnowledgeBaseRepo interface { Create(ctx context.Context, model *models.AgentInfoKnowledgeBase) (*models.AgentInfoKnowledgeBase, error) CreateList(ctx context.Context, models []*models.AgentInfoKnowledgeBase, agentInfoId uint) ([]*models.AgentInfoKnowledgeBase, error) ListByAgentIds(ctx context.Context, ids []uint) ([]*models.AgentInfoKnowledgeBase, error) GetByAgentId(ctx context.Context, id uint) (*models.AgentInfoKnowledgeBase, error) } func (r *agentInfoKnowledgeBaseRepo) GetByAgentId(ctx context.Context, id uint) (*models.AgentInfoKnowledgeBase, error) { knowledge := &models.AgentInfoKnowledgeBase{} err := r.db.WithContext(ctx). Preload("KnowledgeBase"). Preload("AgentInfo"). Preload("KnowledgeBase.KnowledgeBaseFiles"). Where("agent_info_id = ?", id). First(knowledge).Error if err != nil { return nil, err } return knowledge, nil } func (r *agentInfoKnowledgeBaseRepo) ListByAgentIds(ctx context.Context, ids []uint) ([]*models.AgentInfoKnowledgeBase, error) { resp := []*models.AgentInfoKnowledgeBase{} err := r.db.WithContext(ctx). Preload("KnowledgeBase"). Preload("KnowledgeBase.KnowledgeBaseFiles"). Where("agent_info_id IN (?)", ids). Find(&resp).Error if err != nil { return nil, err } return resp, nil } func (r *agentInfoKnowledgeBaseRepo) CreateList(ctx context.Context, addModels []*models.AgentInfoKnowledgeBase, agentInfoId uint) ([]*models.AgentInfoKnowledgeBase, error) { err := r.db.WithContext(ctx).Transaction(func(tx *gorm.DB) error { removeModels := []*models.AgentInfoKnowledgeBase{} if err := tx.Where("agent_info_id = ?", agentInfoId).Delete(&removeModels).Error; err != nil { return err } for _, m := range addModels { result := tx.Create(m) if result.Error != nil { return result.Error } } return nil }) if err != nil { return nil, err } return addModels, nil } func (r *agentInfoKnowledgeBaseRepo) Create(ctx context.Context, model *models.AgentInfoKnowledgeBase) (*models.AgentInfoKnowledgeBase, error) { result := r.db.WithContext(ctx).Create(model) if result.Error != nil { return nil, result.Error } return model, nil } func NewAgentInfoKnowledgeBaseRepository(db *gorm.DB) IAgentInfoKnowledgeBaseRepo { return &agentInfoKnowledgeBaseRepo{db} } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/internal/repository/agent_info_repo.go ================================================ package repository import ( "context" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "gorm.io/gorm" ) type agentInfoRepo struct { db *gorm.DB } type IAgentInfoRepo interface { UpdateById(ctx context.Context, id uint, updatedFields map[string]interface{}) error } func (r *agentInfoRepo) UpdateById(ctx context.Context, id uint, updatedFields map[string]interface{}) error { result := r.db.WithContext(ctx).Model(&models.AgentInfo{}).Where("id = ?", id).Updates(updatedFields) if result.Error != nil { return result.Error } return nil } func NewAgentInfoRepository(db *gorm.DB) IAgentInfoRepo { return &agentInfoRepo{db} } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/internal/repository/app_config.go ================================================ package repository import ( "context" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "gorm.io/gorm" ) type appConfigRepo struct { db *gorm.DB } type AppConfigRepo interface { GetAllNameValueInAppConfig(ctx context.Context, networkId string) (map[string]string, error) } func (r *appConfigRepo) GetAllNameValueInAppConfig(ctx context.Context, networkId string) (map[string]string, error) { var data []*models.AppConfig err := r.db.WithContext(ctx). Where("network_id = ?", networkId). Find(&data).Error if err != nil { return nil, err } info := make(map[string]string) for _, config := range data { info[config.Name] = config.Value } return info, nil } func NewAppConfigRepository(db *gorm.DB) AppConfigRepo { return &appConfigRepo{db} } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/internal/repository/knowledge_base_file_repo.go ================================================ package repository import ( "context" "math" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "gorm.io/gorm" ) type knowledgeBaseFileRepo struct { db *gorm.DB } type KnowledgeBaseFileRepo interface { Create(ctx context.Context, model *models.KnowledgeBaseFile) (*models.KnowledgeBaseFile, error) UpdateByKnowledgeBaseId(ctx context.Context, kbId uint, updatedFields map[string]interface{}) error ListByKbId(ctx context.Context, kbId uint) ([]*models.KnowledgeBaseFile, error) DeleteByIds(ctx context.Context, ids []uint) error CalcTotalFee(ctx context.Context, kbId uint) (float64, error) UpdateTransferHash(ctx context.Context, kbFileIds []uint, transferHash string) error } func round(val float64, precision uint) float64 { ratio := math.Pow(10, float64(precision)) return math.Round(val*ratio) / ratio } func (r *knowledgeBaseFileRepo) UpdateTransferHash(ctx context.Context, kbFileIds []uint, transferHash string) error { if err := r.db.WithContext(ctx).Model(&models.KnowledgeBaseFile{}).Where("id IN (?)", kbFileIds).Update("transfer_hash", transferHash).Error; err != nil { return err } return nil } func (r *knowledgeBaseFileRepo) CalcTotalFee(ctx context.Context, kbId uint) (float64, error) { files := []*models.KnowledgeBaseFile{} err := r.db.WithContext(ctx).Unscoped().Where("knowledge_base_id = ?", kbId).Find(&files).Error if err != nil { return 0, err } unitPrice := 10 total := float64(0) for _, r := range files { if r.DeletedAt.Valid && r.Status == models.KnowledgeBaseFileStatusPending { continue } total += float64(r.FileSize) } price := total / 1_000_000 // 1 Megabyte is equal to 1000000 bytes (decimal). price = round(price, 0) if price == 0 { price = 1 } return price * float64(unitPrice), nil } func (r *knowledgeBaseFileRepo) DeleteByIds(ctx context.Context, ids []uint) error { files := []*models.KnowledgeBaseFile{} err := r.db.WithContext(ctx).Delete(&files, ids).Error return err } func (r *knowledgeBaseFileRepo) ListByKbId(ctx context.Context, kbId uint) ([]*models.KnowledgeBaseFile, error) { files := []*models.KnowledgeBaseFile{} err := r.db.WithContext(ctx).Where("knowledge_base_id = ?", kbId).Find(&files).Error if err != nil { return nil, err } return files, nil } func (r *knowledgeBaseFileRepo) UpdateByKnowledgeBaseId(ctx context.Context, kbFileId uint, updatedFields map[string]interface{}) error { result := r.db.WithContext(ctx). Model(&models.KnowledgeBaseFile{}). Where("id = ?", kbFileId).Updates(updatedFields) if result.Error != nil { return result.Error } return nil } func (r *knowledgeBaseFileRepo) Create(ctx context.Context, model *models.KnowledgeBaseFile) (*models.KnowledgeBaseFile, error) { result := r.db.WithContext(ctx).Create(model) if result.Error != nil { return nil, result.Error } return model, nil } func NewKnowledgeBaseFileRepository(db *gorm.DB) KnowledgeBaseFileRepo { return &knowledgeBaseFileRepo{db} } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/internal/repository/knowledge_base_repo.go ================================================ package repository import ( "context" "fmt" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "gorm.io/gorm" ) type knowledgeBaseRepo struct { db *gorm.DB } type KnowledgeBaseRepo interface { GetById(ctx context.Context, id uint) (*models.KnowledgeBase, error) DeleteById(ctx context.Context, id uint) error Create(ctx context.Context, model *models.KnowledgeBase) (*models.KnowledgeBase, error) GetByStatus(ctx context.Context, status models.KnowledgeBaseStatus, offset, limit int) ([]*models.KnowledgeBase, error) List(ctx context.Context, req *models.ListKnowledgeBaseRequest) ([]*models.KnowledgeBase, error) UpdateStatus(ctx context.Context, model *models.KnowledgeBase) error UpdateById(ctx context.Context, id uint, updatedFields map[string]interface{}) error GetByKBId(context.Context, string) (*models.KnowledgeBase, error) GetByKBTokenId(context.Context, string) (*models.KnowledgeBase, error) GetManyByQuery(ctx context.Context, query string, orderOption string, offset int, limit int) ([]*models.KnowledgeBase, error) GetKBAgentsUsedOfSocialAgent(ctx context.Context, socialAgentId uint) ([]*models.KnowledgeBase, error) } func (r *knowledgeBaseRepo) GetKBAgentsUsedOfSocialAgent(ctx context.Context, socialAgentId uint) ([]*models.KnowledgeBase, error) { knowledge := []*models.KnowledgeBase{} err := r.db.WithContext(ctx). Preload("AgentInfo"). Where("kb_id <> '' and id IN (SELECT knowledge_base_id FROM agent_info_knowledge_bases WHERE agent_info_id = ?)", socialAgentId). Find(&knowledge).Error if err != nil { return nil, err } return knowledge, nil } func (r *knowledgeBaseRepo) UpdateStatus(ctx context.Context, model *models.KnowledgeBase) error { return r.db.Model(model).Update("status", model.Status).Error } func (r *knowledgeBaseRepo) List(ctx context.Context, req *models.ListKnowledgeBaseRequest) ([]*models.KnowledgeBase, error) { knowledges := []*models.KnowledgeBase{} query := r.db.WithContext(ctx). Preload("KnowledgeBaseFiles") if req.UserAddress != "" { query = query.Where("user_address = ?", req.UserAddress) } if len(req.Statuses) != 0 { query = query.Where("status IN (?)", req.Statuses) } if err := query.Find(&knowledges).Error; err != nil { return nil, err } return knowledges, nil } func (r *knowledgeBaseRepo) Create(ctx context.Context, model *models.KnowledgeBase) (*models.KnowledgeBase, error) { result := r.db.WithContext(ctx).Create(model) if result.Error != nil { return nil, result.Error } return model, nil } func (r *knowledgeBaseRepo) GetById(ctx context.Context, id uint) (*models.KnowledgeBase, error) { knowledge := &models.KnowledgeBase{} err := r.db.WithContext(ctx). Preload("KnowledgeBaseFiles"). Where("id = ?", id). First(knowledge).Error if err != nil { return nil, err } return knowledge, nil } func (r *knowledgeBaseRepo) DeleteById(ctx context.Context, id uint) error { tx := r.db.WithContext(ctx) return tx.Transaction(func(tx *gorm.DB) error { data := []*models.KnowledgeBaseFile{} if err := tx.Where("knowledge_base_id = ?", id).Delete(&data).Error; err != nil { return err } return tx.Delete(&models.KnowledgeBase{}, id).Error }) } func (r *knowledgeBaseRepo) GetByStatus(ctx context.Context, status models.KnowledgeBaseStatus, offset, limit int) ([]*models.KnowledgeBase, error) { var data []*models.KnowledgeBase err := r.db.WithContext(ctx). Preload("KnowledgeBaseFiles"). Where("status = ?", status). Offset(offset). Limit(limit). Find(&data).Error if err != nil { return nil, err } return data, nil } func (r *knowledgeBaseRepo) UpdateById(ctx context.Context, id uint, updatedFields map[string]interface{}) error { result := r.db.WithContext(ctx).Model(&models.KnowledgeBase{}).Where("id = ?", id).Updates(updatedFields) if result.Error != nil { return result.Error } return nil } func (r *knowledgeBaseRepo) GetByKBId(ctx context.Context, kbId string) (*models.KnowledgeBase, error) { knowledge := &models.KnowledgeBase{} err := r.db.WithContext(ctx). Preload("AgentInfo"). Preload("KnowledgeBaseFiles"). Where("kb_id = ? ", kbId). First(knowledge).Error if err != nil { return nil, err } return knowledge, nil } func (r *knowledgeBaseRepo) GetByKBTokenId(ctx context.Context, kbTokenId string) (*models.KnowledgeBase, error) { knowledge := &models.KnowledgeBase{} err := r.db.WithContext(ctx). Preload("KnowledgeBaseFiles"). Where("kb_token_id = ? ", kbTokenId). First(knowledge).Error if err != nil { return nil, err } return knowledge, nil } func (r *knowledgeBaseRepo) GetManyByQuery(ctx context.Context, query string, orderOption string, offset int, limit int) ([]*models.KnowledgeBase, error) { if len(query) == 0 { return nil, fmt.Errorf("query is empty") } if orderOption == "" { orderOption = "id asc" } var data []*models.KnowledgeBase err := r.db.WithContext(ctx). Preload("KnowledgeBaseFiles"). Where(query). Order("updated_at"). Offset(offset). Limit(limit). Find(&data).Error if err != nil { return nil, err } return data, nil } func NewKnowledgeBaseRepository(db *gorm.DB) KnowledgeBaseRepo { return &knowledgeBaseRepo{db} } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/internal/usecase/agent_info/agent_info.go ================================================ package agent_info import ( "context" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/internal/core/ports" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/internal/repository" ) type agentInfoUseCase struct { agentInfoRepo repository.IAgentInfoRepo } func (uc *agentInfoUseCase) UpdateAgentInfoById(ctx context.Context, id uint, updatedFields map[string]interface{}) error { return uc.agentInfoRepo.UpdateById(ctx, id, updatedFields) } func NewAgentInfoUseCase(repo repository.IAgentInfoRepo) ports.IAgentInfoUseCase { return &agentInfoUseCase{ agentInfoRepo: repo, } } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/internal/usecase/appconfig/appconfig_usecase.go ================================================ package appconfig import ( "context" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/internal/core/ports" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/internal/repository" ) type appConfigUseCase struct { appConfigRepo repository.AppConfigRepo } func (uc *appConfigUseCase) GetAllNameValueInAppConfig(ctx context.Context, networkId string) (map[string]string, error) { return uc.appConfigRepo.GetAllNameValueInAppConfig(ctx, networkId) } func NewAppConfigUseCase(appConfigRepo repository.AppConfigRepo) ports.IAppConfigUseCase { return &appConfigUseCase{ appConfigRepo: appConfigRepo, } } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/internal/usecase/knowledge/knowledge_usecase.go ================================================ package knowledge import ( "context" "encoding/json" "errors" "fmt" "math/big" "strconv" "strings" "time" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/configs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/internal/core/ports" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/internal/repository" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/logger" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/pkg/eth" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/pkg/utils" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/serializers" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/ethapi" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/lighthouse" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/trxapi" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/zkclient" "github.com/ethereum/go-ethereum/common" resty "github.com/go-resty/resty/v2" "github.com/mymmrac/telego" "go.uber.org/zap" ) var categoryNameTracer string = "knowledge_usecase_tracer" type options func(*knowledgeUsecase) type knowledgeUsecase struct { knowledgeBaseRepo repository.KnowledgeBaseRepo knowledgeBaseFileRepo repository.KnowledgeBaseFileRepo agentInfoKnowledgeBaseRepo repository.IAgentInfoKnowledgeBaseRepo agentInfoRepo repository.IAgentInfoRepo secretKey string networks map[string]map[string]string ethApiMap map[uint64]*ethapi.Client trxApi *trxapi.Client ragApi string lighthouseKey string webhookUrl string notiBot *telego.Bot notiActChanId int64 notiErrorChanId int64 conf *configs.Config } func WithRepos( knowledgeBaseRepo repository.KnowledgeBaseRepo, knowledgeBaseFileRepo repository.KnowledgeBaseFileRepo, agentInfoKnowledgeBaseRepo repository.IAgentInfoKnowledgeBaseRepo, agentInfoRepo repository.IAgentInfoRepo, ) options { return func(uc *knowledgeUsecase) { uc.knowledgeBaseRepo = knowledgeBaseRepo uc.knowledgeBaseFileRepo = knowledgeBaseFileRepo uc.agentInfoKnowledgeBaseRepo = agentInfoKnowledgeBaseRepo uc.agentInfoRepo = agentInfoRepo } } func WithSecretKey(secretKey string) options { return func(uc *knowledgeUsecase) { uc.secretKey = secretKey } } func WithConfig(conf *configs.Config) options { return func(uc *knowledgeUsecase) { uc.conf = conf } } func WithEthApiMap(ethApiMap map[uint64]*ethapi.Client) options { return func(uc *knowledgeUsecase) { uc.ethApiMap = ethApiMap } } func WithNetworks(networks map[string]map[string]string) options { return func(uc *knowledgeUsecase) { uc.networks = networks } } func WithTrxApi(trxApi *trxapi.Client) options { return func(uc *knowledgeUsecase) { uc.trxApi = trxApi } } func WithRagApi(ragApi string) options { return func(uc *knowledgeUsecase) { uc.ragApi = ragApi } } func WithLighthousekey(lighthousekey string) options { return func(uc *knowledgeUsecase) { uc.lighthouseKey = lighthousekey } } func WithWebhookUrl(webhookUrl string) options { return func(uc *knowledgeUsecase) { uc.webhookUrl = webhookUrl } } func WithNotiBot(teleKey, notiActChanId, notiErrorChanId string) options { return func(uc *knowledgeUsecase) { if teleKey != "" { bot, err := telego.NewBot(teleKey, telego.WithDefaultDebugLogger()) if err != nil { logger.Error(categoryNameTracer, "with_noti_bot", zap.Error(err)) } uc.notiBot = bot i, _ := strconv.ParseInt(notiActChanId, 10, 64) uc.notiActChanId = i ei, _ := strconv.ParseInt(notiErrorChanId, 10, 64) uc.notiErrorChanId = ei } } } func NewKnowledgeUsecase(options ...options) ports.IKnowledgeUsecase { uc := &knowledgeUsecase{} for _, opt := range options { opt(uc) } return uc } func (uc *knowledgeUsecase) CalcFeeByKnowledgeBaseId(ctx context.Context, kbId uint) (float64, error) { return uc.knowledgeBaseFileRepo.CalcTotalFee(ctx, kbId) } func (uc *knowledgeUsecase) SendMessage(_ context.Context, content string, chanId int64) (int, error) { if chanId == 0 { chanId = uc.notiActChanId } else if chanId == -1 { chanId = uc.notiErrorChanId } msg := &telego.SendMessageParams{ ChatID: telego.ChatID{ID: chanId}, Text: strings.TrimSpace(content), } resp, err := uc.notiBot.SendMessage(msg) if err != nil { return 0, err } return resp.MessageID, nil } func (uc *knowledgeUsecase) CreateAgentInfoKnowledgeBase(ctx context.Context, models []*models.AgentInfoKnowledgeBase, agentInfoId uint) ([]*models.AgentInfoKnowledgeBase, error) { return uc.agentInfoKnowledgeBaseRepo.CreateList(ctx, models, agentInfoId) } func (uc *knowledgeUsecase) GetKBAgentsUsedOfSocialAgent(ctx context.Context, socialAgentId uint) ([]*models.KnowledgeBase, error) { return uc.knowledgeBaseRepo.GetKBAgentsUsedOfSocialAgent(ctx, socialAgentId) } func (uc *knowledgeUsecase) WebhookFile(ctx context.Context, filename string, bytes []byte, id uint) (*models.KnowledgeBase, error) { return nil, nil kn, err := uc.knowledgeBaseRepo.GetById(ctx, id) if err != nil { return nil, err } logger.Info(categoryNameTracer, "start_webhook_file", zap.Any("knowledge_base_id", id), zap.Any("filename", filename)) updatedFields := make(map[string]interface{}) hash, err := lighthouse.UploadDataWithRetry(uc.lighthouseKey, fmt.Sprintf("%d_%s", time.Now().Unix(), filename), bytes) if err != nil { logger.Error(categoryNameTracer, "upload_data_with_retry", zap.Error(err)) updatedFields["status"] = models.KnowledgeBaseStatusProcessingFailed updatedFields["last_error_message"] = err.Error() uc.SendMessage(ctx, fmt.Sprintf("webhook_file error upload lighthouse to agent: %s (%d) - error %s", kn.Name, kn.ID, updatedFields["last_error_message"]), uc.notiErrorChanId) _ = uc.knowledgeBaseRepo.UpdateById(ctx, id, updatedFields) return nil, err } if kn.KbId != "" { updatedFields["status"] = models.KnowledgeBaseStatusDone } updatedFields["filecoin_hash"] = fmt.Sprintf("ipfs://%s", hash) if err := uc.knowledgeBaseRepo.UpdateById(ctx, id, updatedFields); err != nil { return nil, err } _, _ = uc.SendMessage(ctx, fmt.Sprintf("start_webhook_file agent: %s (%d): %s - filecoin hash: %s", kn.Name, kn.ID, updatedFields["filecoin_hash"], filename), uc.notiActChanId) return kn, nil } func (uc *knowledgeUsecase) Webhook(ctx context.Context, req *models.RagHookResponse) (*models.KnowledgeBase, error) { logger.Info(categoryNameTracer, "webhook_update_kb", zap.Any("data", req)) if req.Result == nil { return nil, nil } id, err := strconv.ParseUint(req.Result.Ref, 10, 64) if err != nil { return nil, err } kn, err := uc.knowledgeBaseRepo.GetById(ctx, uint(id)) if err != nil { return nil, err } if len(req.Result.Identifier) > 0 { // update status a file in kb list file identifies := strings.Split(req.Result.Identifier, "/") if len(identifies) < 2 { return nil, fmt.Errorf("invalid identifier %s", req.Result.Identifier) } hash := identifies[0] indexFile, err := strconv.Atoi(identifies[1]) if err != nil { return nil, fmt.Errorf("invalid identifier index %s", identifies[1]) } body, _, err := lighthouse.DownloadDataSimple(hash) if err != nil { return nil, fmt.Errorf("failed to download lighthouse %s", hash) } var listFileInfo []*lighthouse.FileInLightHouse if err := json.Unmarshal(body, &listFileInfo); err != nil { return nil, fmt.Errorf("failed to unmarshal lighthouse %s", hash) } if len(listFileInfo) < indexFile { return nil, fmt.Errorf("invalid file index len(listFile) %v , index file %v", len(listFileInfo), indexFile) } for _, file := range kn.KnowledgeBaseFiles { var lighthouseFile lighthouse.FileInLightHouse if err := json.Unmarshal([]byte(file.FilecoinHashRawData), &lighthouseFile); err != nil { continue } if lighthouseFile.Name == listFileInfo[indexFile].Name { if req.Status == "ok" { file.Status = models.KnowledgeBaseFileStatusDone err = uc.knowledgeBaseFileRepo.UpdateByKnowledgeBaseId( ctx, file.ID, map[string]interface{}{"status": file.Status}, ) if err != nil { return nil, fmt.Errorf("failed to update knowledge base file status %d", file.Status) } uc.SendMessage(ctx, fmt.Sprintf("process kb file for kb agent via webhook DONE (kb_id: %d: %s : %v)", kn.ID, req.Result.Kb, req.Result.Identifier), uc.notiActChanId) } else if req.Status == "error" { file.Status = models.KnowledgeBaseFileStatusFail file.LastErrorMessage = req.Result.Message err = uc.knowledgeBaseFileRepo.UpdateByKnowledgeBaseId( ctx, file.ID, map[string]interface{}{ "status": file.Status, "last_error_message": file.LastErrorMessage, }, ) if err != nil { return nil, fmt.Errorf("failed to update knowledge base file status %d", file.Status) } uc.SendMessage(ctx, fmt.Sprintf("webhook update kb file status failed: %s (%d) %s - error %s", kn.Name, kn.ID, req.Result.Identifier, file.LastErrorMessage), uc.notiActChanId) } break } } } else { // update kb status updatedFields := make(map[string]interface{}) if req.Status == "ok" && req.Result.Kb == "" { msg := "the kb_id is missing from the webhook API response." uc.SendMessage(ctx, fmt.Sprintf("webhook update agent status failed: %s (%d) - error %s", kn.Name, kn.ID, msg), uc.notiActChanId) updatedFields["status"] = models.KnowledgeBaseStatusProcessingFailed updatedFields["last_error_message"] = msg if err := uc.knowledgeBaseRepo.UpdateById(ctx, kn.ID, updatedFields); err != nil { return nil, err } return nil, errors.New(msg) } if req.Status != "ok" { updatedFields["status"] = models.KnowledgeBaseStatusProcessingFailed updatedFields["last_error_message"] = req.Result.Message uc.SendMessage(ctx, fmt.Sprintf("webhook update agent status failed: %s (%d) - error %s", kn.Name, kn.ID, req.Result.Message), uc.notiActChanId) } else if kn.KbId == "" { updatedFields["kb_id"] = req.Result.Kb updatedFields["status"] = models.KnowledgeBaseStatusDone uc.SendMessage(ctx, fmt.Sprintf("Process update kb_id for agent via webhook DONE (kb_id: %d: %s)", kn.ID, req.Result.Kb), uc.notiActChanId) } else { updatedFields["status"] = models.KnowledgeBaseStatusProcessUpdate uc.SendMessage(ctx, fmt.Sprintf("Process update kb_id for agent via webhook DONE (kb_id: %d: %s)", kn.ID, req.Result.Kb), uc.notiActChanId) } if err := uc.knowledgeBaseRepo.UpdateById(ctx, kn.ID, updatedFields); err != nil { return nil, err } } return kn, nil } func (uc *knowledgeUsecase) CreateKnowledgeBase(ctx context.Context, req *serializers.CreateKnowledgeRequest) (*serializers.KnowledgeBase, error) { model := &models.KnowledgeBase{} if err := utils.Copy(model, req); err != nil { return nil, err } // encryptedTempKey, tempAddr, err := utils.GenerateAddress(uc.secretKey) // if err != nil { // return nil, err // } // model.DepositPrivKey = encryptedTempKey model.DepositAddress = strings.ToLower(req.DepositAddress) // encryptedTempKey, tempAddr, err = utils.GenerateSolanaAddress(uc.secretKey) // if err != nil { // return nil, err // } // model.SolanaDepositPrivKey = encryptedTempKey model.SolanaDepositAddress = strings.ToLower(req.SolanaDepositAddress) model.Status = models.KnowledgeBaseStatusWaitingPayment resp, err := uc.knowledgeBaseRepo.Create(ctx, model) if err != nil { return nil, err } grFileId := time.Now().Unix() files := []*models.KnowledgeBaseFile{} for _, f := range req.Files { file := &models.KnowledgeBaseFile{ FileUrl: f.FileUrl, FileName: f.FileName, FileSize: f.FileSize, KnowledgeBaseId: resp.ID, GroupFileId: grFileId, Status: models.KnowledgeBaseFileStatusPending, } _, err := uc.knowledgeBaseFileRepo.Create(ctx, file) if err != nil { return nil, err } files = append(files, file) } model.KnowledgeBaseFiles = files model.Fee, _ = uc.knowledgeBaseFileRepo.CalcTotalFee(ctx, model.ID) model.ChargeMore = model.Fee updatedFields := make(map[string]interface{}) updatedFields["fee"] = model.Fee updatedFields["charge_more"] = model.ChargeMore if err := uc.UpdateKnowledgeBaseById(ctx, resp.ID, updatedFields); err != nil { return nil, err } result := &serializers.KnowledgeBase{} if err := utils.Copy(result, model); err != nil { return nil, err } return result, nil } func (uc *knowledgeUsecase) ListKnowledgeBase(ctx context.Context, req *models.ListKnowledgeBaseRequest) ([]*serializers.KnowledgeBase, error) { resp, err := uc.knowledgeBaseRepo.List(ctx, req) if err != nil { return nil, err } result := []*serializers.KnowledgeBase{} if err := utils.Copy(&result, resp); err != nil { return nil, err } return result, nil } func (uc *knowledgeUsecase) MapKnowledgeBaseByAgentIds(ctx context.Context, ids []uint) (map[uint][]*models.KnowledgeBase, error) { resp, err := uc.agentInfoKnowledgeBaseRepo.ListByAgentIds(ctx, ids) if err != nil { return nil, err } data := make(map[uint][]*models.KnowledgeBase) for _, r := range resp { if _, ok := data[r.AgentInfoId]; !ok { data[r.AgentInfoId] = make([]*models.KnowledgeBase, 0) } data[r.AgentInfoId] = append(data[r.AgentInfoId], r.KnowledgeBase) } return data, nil } func (uc *knowledgeUsecase) GetKnowledgeBaseById(ctx context.Context, id uint) (*models.KnowledgeBase, error) { return uc.knowledgeBaseRepo.GetById(ctx, id) } func (uc *knowledgeUsecase) GetAgentInfoKnowledgeBaseByAgentId(ctx context.Context, id uint) (*models.AgentInfoKnowledgeBase, error) { return uc.agentInfoKnowledgeBaseRepo.GetByAgentId(ctx, id) } func (uc *knowledgeUsecase) DeleteKnowledgeBaseById(ctx context.Context, id uint) error { return uc.knowledgeBaseRepo.DeleteById(ctx, id) } func (uc *knowledgeUsecase) GetKnowledgeBaseByStatus(ctx context.Context, status models.KnowledgeBaseStatus, offset, limit int) ([]*models.KnowledgeBase, error) { return uc.knowledgeBaseRepo.GetByStatus(ctx, status, offset, limit) } func (uc *knowledgeUsecase) UpdateListKnowledgeBaseFile(ctx context.Context, kbId uint, files []*serializers.File) (bool, error) { fileIds := []uint{} grFileId := time.Now().Unix() updated := false for _, f := range files { if f.KbFileId != 0 { fileIds = append(fileIds, f.KbFileId) continue } file := &models.KnowledgeBaseFile{ FileUrl: f.FileUrl, FileName: f.FileName, FileSize: f.FileSize, KnowledgeBaseId: kbId, GroupFileId: grFileId, Status: models.KnowledgeBaseFileStatusPending, } _, err := uc.knowledgeBaseFileRepo.Create(ctx, file) if err != nil { return false, err } updated = true } // still not support delete /* currentFiles, err := uc.knowledgeBaseFileRepo.ListByKbId(ctx, kbId) if err != nil { return err } mapFiles := make(map[uint]*models.KnowledgeBaseFile) for _, f := range currentFiles { mapFiles[f.ID] = f } deletedIds := []uint{} for k, v := range mapFiles { if v.Status == models.KnowledgeBaseFileStatusDone { continue } if !slices.Contains(fileIds, k) { deletedIds = append(deletedIds, v.ID) } } return uc.knowledgeBaseFileRepo.DeleteByIds(ctx, deletedIds) */ return updated, nil } func (uc *knowledgeUsecase) UpdateKnowledgeBaseById(ctx context.Context, id uint, updatedFields map[string]interface{}) error { return uc.knowledgeBaseRepo.UpdateById(ctx, id, updatedFields) } func (uc *knowledgeUsecase) WatchWalletChange(ctx context.Context) error { start := time.Now() defer logger.Info(categoryNameTracer, "watch_wallet_change", zap.Any("start", start), zap.Any("end", time.Now())) offset := 0 limit := 30 for { resp, err := uc.knowledgeBaseRepo.GetByStatus( ctx, models.KnowledgeBaseStatusWaitingPayment, offset, limit, ) if err != nil { return err } if len(resp) == 0 { break } for _, k := range resp { time.Sleep(500 * time.Microsecond) if err := uc.CheckBalance(ctx, k); err != nil { continue } } offset += len(resp) } return nil } func (uc *knowledgeUsecase) ScanKnowledgeBaseStatusPaymentReceipt(ctx context.Context) { start := time.Now() defer logger.Info(categoryNameTracer, "scan_knowledge_base_payment_receipt", zap.Any("start", start), zap.Any("end", time.Now())) offset := 0 limit := 30 for { resp, err := uc.knowledgeBaseRepo.GetByStatus( ctx, models.KnowledgeBaseStatusPaymentReceipt, offset, limit, ) if err != nil { return } if len(resp) == 0 { break } for _, k := range resp { // chargeMore := k.CalcChargeMore() // Ensure charge_more is executed before the file's status is changed. _, _, err := uc.insertFilesToRAG(ctx, k) if err != nil { continue } // TODO transfer fee to backend wallet // i := 0 // var transferErr error // var hash string // for i < 10 { // amount := new(big.Int).SetInt64(int64(chargeMore)) // hash, transferErr = uc.transferFund(k.DepositPrivKey, uc.conf.KnowledgeBaseConfig.BackendWallet, amount, k.NetworkID) // if transferErr != nil { // i += 1 // time.Sleep(3 * time.Second) // continue // } // if err := uc.knowledgeBaseFileRepo.UpdateTransferHash(ctx, kbFileIds, hash); err != nil { // return err // } // break // } // if transferErr != nil && hash == "" { // _, _ = uc.SendMessage(ctx, fmt.Sprintf("transferFund for agent %s (%d) - has error: %s ", k.Name, k.ID, transferErr.Error()), uc.notiErrorChanId) // } } offset += len(resp) } } func (uc *knowledgeUsecase) CheckBalance(ctx context.Context, kn *models.KnowledgeBase) error { knPrice := new(big.Float).SetFloat64(kn.Fee) knPrice = knPrice.Mul(knPrice, big.NewFloat(1e18)) _knPrice := new(big.Int) _knPrice, _ = knPrice.Int(_knPrice) logger.Info(categoryNameTracer, "check_balance_and_process", zap.Any("knowledge_base", kn), zap.Any("knPrice", knPrice), zap.Any("_knPrice", _knPrice), ) for networkId, net := range uc.networks { nId, err := strconv.ParseUint(networkId, 10, 64) if err != nil { continue } ethClient, ok := uc.ethApiMap[nId] if !ok { if net["rpc_url"] == "" { continue } uc.ethApiMap[nId] = ðapi.Client{ BaseURL: net["rpc_url"], MinGasPrice: net["min_gas_price"], BTCL1: strings.ToUpper(net["is_btc_l1"]) == "TRUE", BlockTimeDisabled: true, } ethClient = uc.ethApiMap[nId] } balance, err := uc.balanceOfAddress(ctx, kn.DepositAddress, ethClient, net) if err != nil { continue } if balance.Cmp(_knPrice) >= 0 && _knPrice.Uint64() > 0 { kn1, err := uc.GetKnowledgeBaseById(ctx, kn.ID) if err != nil { return err } if int(kn1.Status) >= int(models.KnowledgeBaseStatusPaymentReceipt) { return nil } updatedFields := make(map[string]interface{}) kn.Status = models.KnowledgeBaseStatusPaymentReceipt updatedFields["status"] = kn.Status updatedFields["deposit_tx_hash"] = fmt.Sprintf("%s/address/%s", net["explorer_url"], kn.DepositAddress) updatedFields["deposit_chain_id"] = nId if err := uc.knowledgeBaseRepo.UpdateById(ctx, kn.ID, updatedFields); err != nil { return err } content := fmt.Sprintf("Received amount for kb: %s (%d) on chain #%d", kn.Name, kn.ID, nId) uc.SendMessage(ctx, content, uc.notiActChanId) } } return nil } func (uc *knowledgeUsecase) balanceOfAddress(_ context.Context, address string, client *ethapi.Client, netInfo map[string]string) (*big.Int, error) { chainId, err := client.ChainID() if err != nil { return nil, err } conAddress := netInfo["eai_contract_address"] if address == "0x0000000000000000000000000000000000000000" || chainId == 0 || conAddress == "" { return big.NewInt(0), nil } if strings.EqualFold(conAddress, "0x000000000000000000000000000000000000800A") { balance, err := client.Balance(address) if err != nil { return nil, err } return balance, nil } if chainId == models.TRON_CHAIN_ID { balance, err := uc.trxApi.Trc20Balance(conAddress, address) if err != nil { return nil, err } return balance, nil } balanace, err := client.Erc20Balance(conAddress, address) if err != nil { return nil, err } return balanace, nil } func (uc *knowledgeUsecase) insertFilesToRAG(ctx context.Context, kn *models.KnowledgeBase) (*models.InsertRagResponse, []uint, error) { resp := &models.InsertRagResponse{} hash, kbFileIds, err := uc.uploadKBFileToLighthouseAndProcess(ctx, kn) if err != nil { uc.SendMessage(ctx, fmt.Sprintf("uploadKBFileToLighthouseAndProcess for agent %s (%d) - has error: %s ", kn.Name, kn.ID, err.Error()), uc.notiErrorChanId) return nil, nil, err } body := struct { FilecoinMetadataUrl string `json:"filecoin_metadata_url"` Ref string `json:"ref"` Hook string `json:"hook"` Kb string `json:"kb"` }{ FilecoinMetadataUrl: fmt.Sprintf("https://gateway.lighthouse.storage/ipfs/%s", hash), Ref: fmt.Sprintf("%d", kn.ID), Hook: uc.webhookUrl, Kb: kn.KbId, } logger.Info(categoryNameTracer, "insert_file_to_rag", zap.Any("body", body)) // if kn.KbId != "" { // kn.Status = models.KnowledgeBaseStatusProcessUpdate // } else { // kn.Status = models.KnowledgeBaseStatusProcessing // } kn.FilecoinHash = fmt.Sprintf("ipfs://%s", hash) _, err = resty.New().R().SetContext(ctx).SetDebug(true). SetBody(body). SetResult(resp). Post(fmt.Sprintf("%s/api/insert", uc.ragApi)) if err != nil { _, _ = uc.SendMessage(ctx, fmt.Sprintf("insertFilesToRAG for agent %s (%d) - has error: %s ", kn.Name, kn.ID, err.Error()), uc.notiErrorChanId) return nil, nil, err } bBody, _ := json.Marshal(body) kn.RagInsertFileRequest = string(bBody) kn.Status = models.KnowledgeBaseStatusProcessing updatedFields := make(map[string]interface{}) updatedFields["status"] = kn.Status updatedFields["rag_insert_file_request"] = kn.RagInsertFileRequest updatedFields["filecoin_hash"] = kn.FilecoinHash if err = uc.knowledgeBaseRepo.UpdateById(ctx, kn.ID, updatedFields); err != nil { _, _ = uc.SendMessage(ctx, fmt.Sprintf(" uc.knowledgeBaseRepo.UpdateById for agent %s (%d) - has error: %s ", kn.Name, kn.ID, err.Error()), uc.notiErrorChanId) return nil, nil, err } _, _ = uc.SendMessage(ctx, fmt.Sprintf("insertFilesToRAG for agent_id %s (%d): %s", kn.Name, kn.ID, string(bBody)), uc.notiActChanId) return resp, kbFileIds, nil } func (uc *knowledgeUsecase) GetKnowledgeBaseByKBId(ctx context.Context, kbId string) (*models.KnowledgeBase, error) { return uc.knowledgeBaseRepo.GetByKBId(ctx, kbId) } func (uc *knowledgeUsecase) GetKnowledgeBaseByKBTokenId(ctx context.Context, kbId string) (*models.KnowledgeBase, error) { return uc.knowledgeBaseRepo.GetByKBTokenId(ctx, kbId) } func (uc *knowledgeUsecase) GetManyKnowledgeBaseByQuery(ctx context.Context, query string, orderOption string, offset int, limit int) ([]*models.KnowledgeBase, error) { return uc.knowledgeBaseRepo.GetManyByQuery(ctx, query, orderOption, offset, limit) } func (uc *knowledgeUsecase) uploadKBFileToLighthouseAndProcess(ctx context.Context, kn *models.KnowledgeBase) (string, []uint, error) { result := []*lighthouse.FileInLightHouse{} kbFileIds := []uint{} for _, f := range kn.KnowledgeBaseFiles { if f.FilecoinHashRawData != "" { r := &lighthouse.FileInLightHouse{} if err := json.Unmarshal([]byte(f.FilecoinHashRawData), r); err == nil { if f.Status == models.KnowledgeBaseFileStatusDone { r.IsInserted = true } result = append(result, r) continue } } r, err := lighthouse.ZipAndUploadFileInMultiplePartsToLightHouseByUrl(f.FileUrl, "/tmp/data", uc.lighthouseKey) if err != nil { uc.SendMessage(ctx, fmt.Sprintf("uploadKBFileToLighthouseAndProcess for agent %s (%d) - has error: %s ", kn.Name, kn.ID, err.Error()), uc.notiErrorChanId) return "", nil, err } rw, _ := json.Marshal(r) if len(r.Files) > 0 { f.FilecoinHash = r.Files[0].Hash } f.FilecoinHashRawData = string(rw) err = uc.knowledgeBaseFileRepo.UpdateByKnowledgeBaseId( ctx, f.ID, map[string]interface{}{ "filecoin_hash": f.FilecoinHash, "filecoin_hash_raw_data": f.FilecoinHashRawData, }, ) if err != nil { return "", nil, err } kbFileIds = append(kbFileIds, f.ID) r.IsInserted = false result = append(result, r) } data, _ := json.Marshal(result) hash, err := lighthouse.UploadData(uc.lighthouseKey, kn.Name, data) if err != nil { uc.SendMessage(ctx, fmt.Sprintf("uploadKBFileToLighthouseAndProcess for agent %s (%d) - has error: %s ", kn.Name, kn.ID, err.Error()), uc.notiErrorChanId) return "", nil, err } return hash, kbFileIds, nil } func (uc *knowledgeUsecase) transferFund(priKeyFrom string, toAddress string, fund *big.Int, networkId uint64) (string, error) { _, pubKey, err := eth.GetAccountInfo(priKeyFrom) if err != nil { return "", fmt.Errorf("get account info: %v", err) } rpc := uc.conf.GetConfigKeyString(networkId, "rpc_url") var paymasterAddress, paymasterToken string var paymasterFeeZero bool if uc.conf.ExistsedConfigKey(networkId, "paymaster_address") && uc.conf.ExistsedConfigKey(networkId, "paymaster_token") { paymasterAddress = uc.conf.GetConfigKeyString(networkId, "paymaster_address") paymasterToken = uc.conf.GetConfigKeyString(networkId, "paymaster_token") paymasterFeeZero = uc.conf.GetConfigKeyBool(networkId, "paymaster_fee_zero") } aiZkClient := zkclient.NewZkClient( rpc, paymasterFeeZero, paymasterAddress, paymasterToken, ) tx, err := aiZkClient.Transact(priKeyFrom, *pubKey, common.HexToAddress(toAddress), fund, nil) if err != nil { return "", fmt.Errorf("failed to transact: %v", err) } return tx.TxHash.Hex(), nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/logger/logger.go ================================================ package logger import ( "os" "path/filepath" "time" "go.uber.org/zap" "go.uber.org/zap/zapcore" ) const ( LOGGER_API_RESPONSE_TIME = "api_response_time" LOGGER_API_APP_PANIC = "api_app_panic" LOGGER_API_APP_ERROR = "api_app_error" LOGGER_API_APP_REQUEST_ERROR = "api_app_request_error" ) var logger *zap.Logger func Logger() *zap.Logger { return logger } func NewLogger(appName string, env string, logPath string, stdout bool) { var err error outputPaths := []string{} if stdout { outputPaths = append(outputPaths, "stdout") } if logPath != "" { dir := filepath.Dir(logPath) parent := filepath.Base(dir) _, err = os.Stat(parent) if os.IsNotExist(err) { err = os.Mkdir(parent, os.ModePerm) if err != nil { panic(err) } } err = os.Chmod(parent, os.ModePerm) if err != nil { panic(err) } os.OpenFile(logPath, os.O_RDONLY|os.O_CREATE|os.O_APPEND, 0o666) outputPaths = append(outputPaths, logPath) } cfg := zap.NewProductionConfig() cfg.OutputPaths = outputPaths node, _ := os.Hostname() cfg.InitialFields = map[string]interface{}{ "app_name": appName, "env": env, "node": node, } cfg.EncoderConfig.EncodeTime = func(t time.Time, enc zapcore.PrimitiveArrayEncoder) { enc.AppendInt64(time.Now().UnixMilli()) } logger, err = cfg.Build( zap.AddCallerSkip(1), ) if err != nil { panic(err) } } func Sync() error { return logger.Sync() } func Info(category string, msg string, fields ...zap.Field) { logger. With(zap.String("app_category", category)). With(zap.Int64("ts", time.Now().UnixMilli())). Info(msg, fields...) } func Fatal(msg string, fields ...zap.Field) { logger.With(zap.Int64("ts", time.Now().UnixMilli())).Fatal(msg, fields...) } func Error(category string, msg string, fields ...zap.Field) { logger. WithOptions(zap.AddStacktrace(zap.DebugLevel)). With(zap.String("app_category", category)). With(zap.Int64("ts", time.Now().UnixMilli())). Error(msg, fields...) } func WrapError(category string, err error, fields ...zap.Field) error { if err == nil { return nil } logger. WithOptions(zap.AddStacktrace(zap.DebugLevel)). With(zap.String("app_category", category)). With(zap.Any("error", err)). With(zap.Int64("ts", time.Now().UnixMilli())). Error(err.Error(), fields...) return err } func WrapCaptureError(err error, fields ...zap.Field) error { if err == nil { return nil } logger. WithOptions(zap.AddStacktrace(zap.DebugLevel)). With(zap.String("app_category", LOGGER_API_APP_ERROR)). With(zap.Any("error", err)). With(zap.Int64("ts", time.Now().UnixMilli())). Error(err.Error(), fields...) return err } func Debug(msg string, fields ...zap.Field) { logger.With(zap.Int64("ts", time.Now().UnixMilli())).Debug(msg, fields...) } func Panic(msg string, fields ...zap.Field) { logger.With(zap.Int64("ts", time.Now().UnixMilli())).Panic(msg, fields...) } type TracerData struct { m map[string]interface{} } func (d *TracerData) Add(key string, data interface{}) *TracerData { d.m[key] = data return d } func (d TracerData) Data() interface{} { return d.m } func NewTracerData() *TracerData { return &TracerData{m: map[string]interface{}{}} } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/models/agent.go ================================================ package models import ( "encoding/json" "fmt" "strconv" "strings" "time" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/types/numeric" "github.com/jinzhu/gorm" ) type ( BaseTokenSymbol string TokenSetupEnum string ExternalAgentType string ) const ( BaseTokenSymbolBVM BaseTokenSymbol = "BVM" BaseTokenSymbolBTC BaseTokenSymbol = "BTC" BaseTokenSymbolETH BaseTokenSymbol = "ETH" BaseTokenSymbolFB BaseTokenSymbol = "FB" BaseTokenSymbolEAI BaseTokenSymbol = "EAI" BaseTokenSymbolSOL BaseTokenSymbol = "SOL" TokenSetupEnumAutoCreate TokenSetupEnum = "auto_create" TokenSetupEnumAutoCreateRune TokenSetupEnum = "auto_create_rune" TokenSetupEnumNoToken TokenSetupEnum = "no_token" TokenSetupEnumLinkExisting TokenSetupEnum = "link_existing" ExternalAgentTypeFarcaster ExternalAgentType = "farcaster" ) type TwitterInfo struct { gorm.Model TwitterID string `gorm:"unique_index"` TwitterAvatar string TwitterUsername string TwitterName string TokenType string ExpiresIn int AccessToken string `gorm:"type:text"` Scope string RefreshToken string `gorm:"type:text"` ExpiredAt *time.Time OauthClientId string OauthClientSecret string Description string `gorm:"type:longtext"` RefreshError string `gorm:"type:text"` } type AgentInfoAgentType uint const ( AgentInfoAgentTypeNormal AgentInfoAgentType = 0 AgentInfoAgentTypeReasoning AgentInfoAgentType = 1 AgentInfoAgentTypeKnowledgeBase AgentInfoAgentType = 2 AgentInfoAgentTypeEliza AgentInfoAgentType = 3 AgentInfoAgentTypeZerepy AgentInfoAgentType = 4 AgentInfoAgentTypeModel AgentInfoAgentType = 5 AgentInfoAgentTypeJs AgentInfoAgentType = 6 AgentInfoAgentTypePython AgentInfoAgentType = 7 AgentInfoAgentTypeInfa AgentInfoAgentType = 8 AgentInfoAgentTypeVideo AgentInfoAgentType = 9 AgentInfoAgentTypeCustomUi AgentInfoAgentType = 10 AgentInfoAgentTypeCustomPrompt AgentInfoAgentType = 11 AgentInfoAgentTypeModelOnline AgentInfoAgentType = 12 ) type ( AssistantStatus string CreateTokenModeType string ) const ( AssistantStatusPending AssistantStatus = "pending" AssistantStatusMinting AssistantStatus = "minting" AssistantStatusUpdating AssistantStatus = "updating" AssistantStatusReady AssistantStatus = "ready" AssistantStatusFailed AssistantStatus = "failed" CreateTokenModeTypeNoToken CreateTokenModeType = "no_token" CreateTokenModeTypeAutoCreate CreateTokenModeType = "auto_create" CreateTokenModeTypeLinkExisting CreateTokenModeType = "link_existing" ) type TwinStatus string const ( TwinStatusPending TwinStatus = "pending" TwinStatusRunning TwinStatus = "running" TwinStatusDoneSuccess TwinStatus = "done_success" TwinStatusDoneError TwinStatus = "done_error" ) type SocialInfo struct { AccountName string `json:"account_name"` Fee float64 `json:"fee"` } type AgentCategory struct { gorm.Model Name string `gorm:"unique_index"` Priority int `gorm:"default:0"` } type AgentInfo struct { gorm.Model Version string `gorm:"default:'1'"` NetworkID uint64 NetworkName string OauthClientId string OauthClientSecret string AgentCategoryID uint `gorm:"index"` AgentCategory *AgentCategory AgentID string `gorm:"unique_index"` AgentType AgentInfoAgentType `gorm:"default:0"` TwitterInfoID uint `gorm:"index"` TwitterInfo *TwitterInfo TwitterID string `gorm:"index"` TwitterUsername string `gorm:"index"` TwitterVerified bool `gorm:"default:0"` AgentName string SystemPrompt string `gorm:"type:longtext"` UserPrompt string `gorm:"type:longtext"` Creator string AgentContractID string AgentContractAddress string AgentLogicAddress string AgentNftMinted bool `gorm:"default:0"` ScanEnabled bool `gorm:"default:1"` ScanLatestTime *time.Time ScanLatestId string `gorm:"type:longtext"` ScanError string TokenMode string TokenName string TokenSymbol string TokenAddress string TokenStatus string TokenSupply numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` TokenImageUrl string TokenSignature string TokenInfoID uint TokenInfo *AgentTokenInfo TokenImageInferID string TokenPositionHash string TokenDesc string `gorm:"type:longtext"` TokenNetworkID uint64 Priority int ETHAddress string `gorm:"index"` TronAddress string `gorm:"index"` SOLAddress string `gorm:"index"` SummaryLatestTime *time.Time EaiBalance numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` EaiWalletBalance numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` IsAdvance bool `gorm:"default:0"` InferLatestTime *time.Time ReplyLatestTime *time.Time ReplyEnabled bool `gorm:"default:0"` TipEthAddress string TipBtcAddress string TipSolAddress string IsFaucet bool `gorm:"default:0"` AgentSnapshotMission []*AgentSnapshotMission MintFee numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` ActionDelayed int `gorm:"default:900"` TmpTwitterID string `gorm:"index"` TmpTwitterInfo *TwitterUser `gorm:"foreignKey:twitter_id;AssociationForeignKey:tmp_twitter_id"` RefTweetID uint Meme *Meme ActiveLatestTime *time.Time Thumbnail string FarcasterID string `gorm:"index"` FarcasterUsername string `gorm:"index"` MintHash string InferFee numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` SystemReminder string `gorm:"type:longtext"` Status AssistantStatus Uri string AgentBaseModel string MetaData string `gorm:"type:longtext"` Minter string VerifiedNftOwner bool NftAddress string NftTokenID string NftTokenImage string NftOwnerAddress string NftSignature string NftSignMessage string NftDelegateAddress string NftPublicKey string Bio string `gorm:"type:longtext"` Lore string `gorm:"type:longtext"` Knowledge string `gorm:"type:longtext"` MessageExamples string `gorm:"type:longtext"` PostExamples string `gorm:"type:longtext"` Topics string `gorm:"type:longtext"` Style string `gorm:"type:longtext"` Adjectives string `gorm:"type:longtext"` SocialInfo string `gorm:"type:longtext"` InferenceCalls int64 PromptCalls int64 InstalledCount int64 `gorm:"default:0"` ExternalChartUrl string MissionTopics string `gorm:"type:longtext"` GraphData string `gorm:"type:longtext"` ConfigData string `gorm:"type:longtext"` DeployedRefID string FactoryAddress string TwinTwitterUsernames string `gorm:"index"` // multiple twitter usernames, split by , TwinStatus TwinStatus `gorm:"index"` KnowledgeBaseID string `gorm:"index"` TwinCallProcessRequest string `gorm:"type:longtext"` TwinCallProcessResponse string `gorm:"type:longtext"` TwinFee numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` TwinStartTrainingAt *time.Time TwinEndTrainingAt *time.Time TwinTrainingProgress float64 `json:"twin_training_progress"` TwinTrainingMessage string `gorm:"type:longtext"` SourceUrl string `gorm:"type:text"` //ipfs_ || ethfs_ AuthenUrl string `gorm:"type:text"` DependAgents string `gorm:"type:longtext"` RequiredWallet bool `gorm:"default:0"` RequiredEnv bool `gorm:"default:0"` IsOnchain bool `gorm:"default:0"` IsCustomUi bool `gorm:"default:0"` Likes int64 `gorm:"default:0"` IsPublic bool `gorm:"default:1"` IsStreaming bool `gorm:"default:1"` DockerPort string RequiredInfo string `gorm:"type:longtext"` EnvExample string `gorm:"type:longtext"` ShortDescription string `gorm:"type:longtext"` DisplayName string `gorm:"type:longtext"` IsForceUpdate bool `gorm:"default:0"` CodeVersion int `gorm:"default:0"` RunStatus string Author string Rating float64 `gorm:"default:0"` NumOfRating int64 `gorm:"default:0"` NumOfOneStar int64 `gorm:"default:0"` NumOfTwoStar int64 `gorm:"default:0"` NumOfThreeStar int64 `gorm:"default:0"` NumOfFourStar int64 `gorm:"default:0"` NumOfFiveStar int64 `gorm:"default:0"` MinFeeToUse numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` Worker string EstimateTwinDoneTimestamp *time.Time `json:"estimate_twin_done_timestamp"` TotalMintTwinFee float64 TwitterName string `gorm:"-"` MemePercent float64 `gorm:"-"` MemeMarketCap numeric.BigFloat `gorm:"-"` Counts int64 `gorm:"-"` AgentKBId uint `json:"agent_kb_id"` KnowledgeBase *KnowledgeBase `json:"knowledge_base" gorm:"foreignKey:AgentKBId;references:AgentInfoId"` } func (m *AgentInfo) IsVibeAgent() bool { switch m.AgentType { case AgentInfoAgentTypeModel, AgentInfoAgentTypeJs, AgentInfoAgentTypePython, AgentInfoAgentTypeInfa, AgentInfoAgentTypeCustomUi, AgentInfoAgentTypeCustomPrompt, AgentInfoAgentTypeModelOnline: { return true } } return false } func (m *AgentInfo) GetCodeLanguage() string { var codeLanguage string switch m.AgentType { case AgentInfoAgentTypeJs, AgentInfoAgentTypeInfa: { codeLanguage = "javascript" } case AgentInfoAgentTypePython: { codeLanguage = "python" if m.IsCustomUi { codeLanguage = "python_custom_ui" } } case AgentInfoAgentTypeModel: { codeLanguage = "model" } case AgentInfoAgentTypeModelOnline: { codeLanguage = "model_online" } case AgentInfoAgentTypeCustomUi: { codeLanguage = "custom_ui" } case AgentInfoAgentTypeCustomPrompt: { codeLanguage = "custom_prompt" } } return codeLanguage } func (m *AgentInfo) GetCharacterArrayString(charactor string) []string { data := []string{} _ = json.Unmarshal([]byte(charactor), &data) return data } func (m *AgentInfo) GetMessageExamples() [][]struct { User string `json:"user"` Content struct { Text string `json:"text"` } `json:"content"` } { data := [][]struct { User string `json:"user"` Content struct { Text string `json:"text"` } `json:"content"` }{} _ = json.Unmarshal([]byte(m.MessageExamples), &data) return data } func (m *AgentInfo) GetSocialInfo() []*SocialInfo { data := []*SocialInfo{} _ = json.Unmarshal([]byte(m.SocialInfo), &data) return data } func (m *AgentInfo) GetStyle() map[string][]string { data := map[string][]string{} _ = json.Unmarshal([]byte(m.Style), &data) return data } type AgentInfoWithSnapshotPostActionsResponse struct { ID uint `json:"id"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` NetworkID uint64 `json:"network_id"` NetworkName string `json:"network_name"` AgentID string `json:"agent_id"` AgentType AgentInfoAgentType `json:"agent_type"` TwitterInfoID uint `json:"twitter_info_id"` TwitterID string `json:"twitter_id"` TwitterUsername string `json:"twitter_username"` TwitterVerified bool `json:"twitter_verified"` AgentName string `json:"agent_name"` SystemPrompt string `json:"system_prompt"` UserPrompt string `json:"user_prompt"` Creator string `json:"creator"` AgentContractID string `json:"agent_contract_id"` AgentContractAddress string `json:"agent_contract_address"` AgentSnapshotPostAction []*AgentSnapshotPostActionResp `json:"agent_snapshot_post_action"` } type AgentInfoResponse struct { ID uint `json:"id"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` NetworkID uint64 `json:"network_id"` NetworkName string `json:"network_name"` AgentID string `json:"agent_id"` AgentType AgentInfoAgentType `json:"agent_type"` TwitterInfoID uint `json:"twitter_info_id"` TwitterID string `json:"twitter_id"` TwitterUsername string `json:"twitter_username"` TwitterVerified bool `json:"twitter_verified"` AgentName string `json:"agent_name"` SystemPrompt string `json:"system_prompt"` UserPrompt string `json:"user_prompt"` Creator string `json:"creator"` AgentContractID string `json:"agent_contract_id"` AgentContractAddress string `json:"agent_contract_address"` AgentSnapshotMissions []*AgentSnapshotMissionResp `json:"agent_snapshot_missions"` } func (m *AgentInfo) GetAgentContractID() int64 { res, err := strconv.ParseInt(m.AgentContractID, 10, 64) if err != nil { panic(err) } return res } type ( AgentTwitterPostStatus string AgentTwitterPostType string ) const ( AgentTwitterPostTypePost AgentTwitterPostType = "post" AgentTwitterPostTypeReview AgentTwitterPostType = "review" AgentTwitterPostTypeUnReview AgentTwitterPostType = "unreview" AgentTwitterPostTypeText2Video AgentTwitterPostType = "text2video" AgentTwitterPostTypeImage2video AgentTwitterPostType = "image2video" AgentTwitterPostStatusNew AgentTwitterPostStatus = "new" AgentTwitterPostWaitSubmitVideoInfer AgentTwitterPostStatus = "wait_submit_video_infer" AgentTwitterPostStatusInvalid AgentTwitterPostStatus = "invalid" AgentTwitterConversationInvalid AgentTwitterPostStatus = "conversation_invalid" AgentTwitterPostStatusValid AgentTwitterPostStatus = "valid" AgentTwitterPostStatusInferNew AgentTwitterPostStatus = "infer_new" AgentTwitterPostStatusInferSubmitted AgentTwitterPostStatus = "infer_submitted" AgentTwitterPostStatusInferError AgentTwitterPostStatus = "infer_error" AgentTwitterPostStatusInferFailed AgentTwitterPostStatus = "infer_failed" AgentTwitterPostStatusInferResolved AgentTwitterPostStatus = "infer_resolved" AgentTwitterPostStatusReplied AgentTwitterPostStatus = "replied" AgentTwitterPostStatusRepliedError AgentTwitterPostStatus = "replied_error" AgentTwitterPostStatusRepliedCancelled AgentTwitterPostStatus = "replied_cancelled" AgentTwitterPostStatusReposted AgentTwitterPostStatus = "reposted" AgentTwitterPostStatusRepostedError AgentTwitterPostStatus = "reposted_error" AgentTwitterPostStatusDone AgentTwitterPostStatus = "done" ) type AgentTwitterPost struct { gorm.Model NetworkID uint64 AgentInfoID uint `gorm:"index"` AgentInfo *AgentInfo TwitterID string TwitterUser *TwitterUser `gorm:"foreignKey:twitter_id;AssociationForeignKey:twitter_id"` TwitterUsername string TwitterName string TwitterPostID string `gorm:"unique_index"` TwitterConversationId string `gorm:"index"` TwitterParentPostID string `gorm:"index"` TwitterParentPost *UserTwitterPost `gorm:"foreignKey:twitter_parent_post_id;AssociationForeignKey:twitter_post_id"` Type AgentTwitterPostType PostType AgentSnapshotPostActionType PostAt *time.Time `gorm:"index"` Content string `gorm:"type:longtext"` ExtractContent string `gorm:"type:longtext"` ExtractMediaContent string InferData string `gorm:"type:longtext"` ReplyContent string `gorm:"type:longtext"` ReplyPostId string `gorm:"index"` ReplyPostIds string `gorm:"type:text"` RePostId string ImageUrl string InferTxHash string InferId string InferMagicId string InferMagicTxHash string SubmitSolutionTxHash string SubmitSolutionMagicTxHash string InferAt *time.Time InferNum uint `gorm:"default:0"` Status AgentTwitterPostStatus `gorm:"index"` Prompt string `gorm:"type:longtext"` Error string `gorm:"type:longtext"` FollowerCount uint `gorm:"default:0"` ReplyPostAt *time.Time ReplyPostReply int ReplyPostView int ReplyPostFavorite int ReplyPostBookmark int ReplyPostQuote int ReplyPostRetweet int RePostAt *time.Time InscribeTxHash string BitcoinTxHash string ReplyScheduleAt *time.Time Fee numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` IsMigrated bool `gorm:"default:0"` TokenName string TokenSymbol string TokenAddress string TokenImageUrl string TokenDesc string `gorm:"type:longtext"` TokenImageInferID string TokenSignature string IsCreateAgent bool `gorm:"default:0"` AgentChain string OwnerUsername string OwnerTwitterID string } func (m AgentTwitterPost) IsValidSubmitVideoInfer() bool { return m.PostType == AgentSnapshotPostActionTypeGenerateVideo && m.Status == AgentTwitterPostWaitSubmitVideoInfer } func (m *AgentTwitterPost) GetAgentOnwerName() string { if m.OwnerUsername != "" { return m.OwnerUsername } return m.TwitterUsername } func (m *AgentTwitterPost) GetOwnerTwitterID() string { if m.OwnerTwitterID != "" { return m.OwnerTwitterID } return m.TwitterID } type TweetParseInfo struct { TokenName string TokenDesc string TokenSymbol string TokenImageUrl string ChainName string Owner string Personality string Type string IsCreateToken bool IsIntellect bool IsCreateAgent bool Description string IsGenerateVideo bool GenerateVideoContent string } type UserTwitterPost struct { gorm.Model TwitterID string TwitterUsername string TwitterName string TwitterPostID string `gorm:"unique_index"` PostAt *time.Time Content string `gorm:"type:longtext"` } type AgentSummaryPostStatus string const ( AgentSummaryPostStatusNew AgentSummaryPostStatus = "new" AgentSummaryPostStatusInvalid AgentSummaryPostStatus = "invalid" AgentSummaryPostStatusValid AgentSummaryPostStatus = "valid" AgentSummaryPostStatusInferNew AgentSummaryPostStatus = "infer_new" AgentSummaryPostStatusInferSubmitted AgentSummaryPostStatus = "infer_submitted" AgentSummaryPostStatusInferError AgentSummaryPostStatus = "infer_error" AgentSummaryPostStatusInferFailed AgentSummaryPostStatus = "infer_failed" AgentSummaryPostStatusInferResolved AgentSummaryPostStatus = "infer_resolved" AgentSummaryPostStatusPosted AgentSummaryPostStatus = "posted" AgentSummaryPostStatusPostedError AgentSummaryPostStatus = "posted_error" ) type AgentTokenInfo struct { gorm.Model NetworkID uint64 NetworkName string AgentInfoID uint `gorm:"unique_index"` AgentInfo *AgentInfo PriceUsd numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` Price numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` BaseTokenSymbol string BaseTokenPrice numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` PoolAddress string `gorm:"index"` PriceLast24h numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` VolumeLast24h numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` TotalVolume numeric.BigFloat `gorm:"index;type:decimal(36,18);default:0"` TipAmount numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` WalletBalance numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` DexUrl string TotalSupply int64 UsdMarketCap float64 RaydiumPool string PriceChange float64 DexId string // Percent float64 `gorm:"-"` MarketCap numeric.BigFloat `gorm:"-"` } type AgentTradeHistory struct { gorm.Model NetworkID uint64 TxHash string `gorm:"index"` ContractAddress string `gorm:"index"` EventId string `gorm:"unique_index:pump_trade_histories_main_idx"` TxAt time.Time RecipientAddress string `gorm:"index"` RecipientUserID uint `gorm:"index"` RecipientUser *User Amount0 numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` Amount1 numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` SqrtPriceX96 string Liquidity numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` Tick int64 Price numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` AgentTokenAddress string `gorm:"index"` AgentInfoID uint `gorm:"index"` AgentInfo *AgentInfo TokenInAddress string AmountIn numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` TokenOutAddress string `gorm:"index"` AmountOut numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` BaseTokenSymbol string `gorm:"default:'BTC'"` BaseTokenPrice numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` BaseAmount numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` TokenAmount numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` IsBuy bool } type ( AgentEaiTopupType string AgentEaiTopupStatus string ) const ( AgentEaiTopupTypeDeposit AgentEaiTopupType = "deposit" AgentEaiTopupTypeFaucet AgentEaiTopupType = "faucet" AgentEaiTopupTypeSpent AgentEaiTopupType = "spent" AgentEaiTopupTypeRefund AgentEaiTopupType = "refund" AgentEaiTopupTypeRefundTrainFail AgentEaiTopupType = "refund_train_fail" AgentEaiTopupTypeTransfer AgentEaiTopupType = "transfer" AgentEaiTopupStatusNew AgentEaiTopupStatus = "new" AgentEaiTopupStatusProcessing AgentEaiTopupStatus = "processing" AgentEaiTopupStatusDone AgentEaiTopupStatus = "done" AgentEaiTopupStatusError AgentEaiTopupStatus = "error" AgentEaiTopupStatusCancelled AgentEaiTopupStatus = "cancelled" ) type AgentEaiTopup struct { gorm.Model NetworkID uint64 AgentInfoID uint `gorm:"index"` AgentInfo *AgentInfo EventId string `gorm:"unique_index"` Type AgentEaiTopupType `gorm:"default:'deposit'"` DepositAddress string ToAddress string DepositTxHash string TopupTxHash string Amount numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` Status AgentEaiTopupStatus InscribeTxHash string Error string `gorm:"type:longtext"` Toolset string } type AuthCode struct { gorm.Model PublicCode string `gorm:"index"` SecretCode string `gorm:"index"` ETHAddress string `gorm:"index"` Expired time.Time } type ( AgentTipHistoryStatus string AgentTipHistorySymbol string ) const ( AgentTipHistoryStatusDone AgentTipHistoryStatus = "done" AgentTipHistorySymbolBTC AgentTipHistorySymbol = "BTC" AgentTipHistorySymbolETH AgentTipHistorySymbol = "ETH" AgentTipHistorySymbolSOL AgentTipHistorySymbol = "SOL" ) func (m *AgentInfo) GetHeadSystemPrompt() string { var headSystemPrompt string if m.AgentName != "" && m.TwitterUsername != "" { headSystemPrompt = headSystemPrompt + "Your Twitter name is . Your Twitter username is @. People refer to you as , @, .\n\n" } if m.TokenSymbol != "" && m.TokenAddress != "" { headSystemPrompt = headSystemPrompt + "You have a token. Your token name is . Your token ticker is $. People refer to your token as or $. Your token address is . Your token was deployed on Solana.\n\n" } headSystemPrompt = strings.TrimSpace(headSystemPrompt) headSystemPrompt = strings.ReplaceAll(headSystemPrompt, "", m.AgentName) headSystemPrompt = strings.ReplaceAll(headSystemPrompt, "", m.TwitterUsername) headSystemPrompt = strings.ReplaceAll(headSystemPrompt, "", m.TokenName) headSystemPrompt = strings.ReplaceAll(headSystemPrompt, "", m.TokenSymbol) headSystemPrompt = strings.ReplaceAll(headSystemPrompt, "", m.TokenAddress) return headSystemPrompt } func (m *AgentInfo) GetSystemPrompt() string { return fmt.Sprintf(`%s\n\n%s`, m.GetHeadSystemPrompt(), m.SystemPrompt) } type AgentTradeToken struct { gorm.Model NetworkID uint64 NetworkName string TokenSymbol string TokenName string TokenAddress string CmcId string Enabled bool `gorm:"default:1"` } type AgentUriData struct { Name string `json:"name"` } type AgentExternalInfo struct { gorm.Model NetworkID uint64 `gorm:"unique_index:agent_external_main_idx"` Type ExternalAgentType `gorm:"unique_index:agent_external_main_idx"` AgentInfoID uint `gorm:"unique_index:agent_external_main_idx"` AgentInfo *AgentInfo ExternalID string ExternalUsername string ExternalName string } type AgentChainFee struct { gorm.Model NetworkID uint64 `gorm:"unique_index"` InferFee numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` MintFee numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` TokenFee numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` AgentDeployFee numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` } type AgentStudioChildren struct { ID uint `json:"id"` Idx string `json:"idx"` CategoryIdx string `json:"categoryIdx"` Title string `json:"title"` Data map[string]interface{} `json:"data"` } type AgentStudio struct { ID uint `json:"id"` Idx string `json:"idx"` CategoryIdx string `json:"categoryIdx"` Title string `json:"title"` Data map[string]interface{} `json:"data"` Children []*AgentStudioChildren `json:"children"` } type AgentStudioGraphData struct { Data []*AgentStudio `json:"data"` } type AgentStudioTwitterInfo struct { ID uint `json:"id"` Username string `json:"username"` } type ( AgenInfoInstallStatus string ) const ( AgenInfoInstallStatusNew AgenInfoInstallStatus = "new" AgenInfoInstallStatusDone AgenInfoInstallStatus = "done" ) type AgentInfoInstall struct { gorm.Model Code string `gorm:"unique_index"` UserID uint `gorm:"unique_index:agent_info_main_idx"` AgentInfoID uint `gorm:"unique_index:agent_info_main_idx"` User *User CallbackParams string `gorm:"type:longtext"` //{"user_id" : "123", "authen_token" : "xxx",...} Status AgenInfoInstallStatus } type AgentUtilityInstall struct { gorm.Model Address string `gorm:"unique_index:agent_utility_install_main_idx"` AgentInfoID uint `gorm:"unique_index:agent_utility_install_main_idx"` } type AgentUtilityRecentChat struct { gorm.Model Address string `gorm:"unique_index:agent_utility_recent_chat_main_idx"` AgentInfoID uint `gorm:"unique_index:agent_utility_recent_chat_main_idx"` } type ( WalletType string ) const ( WalletTypePrivy WalletType = "privy" WalletTypeInternal WalletType = "internal" ) type PrivyWallet struct { gorm.Model PrivyID string `gorm:"unique_index"` TwitterID string `gorm:"unique_index"` Address string `gorm:"index"` UserAddress string `gorm:"index"` WalletType WalletType `gorm:"default:'privy'"` } type ClankerVideoToken struct { gorm.Model TokenName string TokenSymbol string TokenAddress string TokenStatus string TokenImageUrl string VideoUrl string TokenDesc string `gorm:"type:longtext"` PairAddress string `gorm:"index"` UserAddress string `gorm:"index"` OwnerTwitterID string `gorm:"index"` OwnerTwitterInfo *TwitterUser `gorm:"foreignKey:twitter_id;AssociationForeignKey:owner_twitter_id"` AgentTwitterPostID uint `gorm:"unique_index"` AgentTwitterPost *AgentTwitterPost RequestorAddress string `gorm:"index"` RequestKey string TxHash string Error string } type AgentReactionHistory struct { gorm.Model AgentInfoID uint `gorm:"index"` UserAddress string `gorm:"index"` Reaction string } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/models/agent_info_knowledege_bases.go ================================================ package models import "gorm.io/gorm" type AgentInfoKnowledgeBase struct { gorm.Model AgentInfoId uint `json:"agent_info_id" gorm:"index"` KnowledgeBaseId uint `json:"knowledge_base_id" gorm:"index"` AgentInfo *AgentInfo `json:"agent_info"` KnowledgeBase *KnowledgeBase `json:"knowledge_base"` } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/models/agent_library.go ================================================ package models import ( "github.com/jinzhu/gorm" ) type AgentLibrary struct { gorm.Model NetworkID uint64 `gorm:"unique_index:agent_library_main_idx"` Name string `gorm:"unique_index:agent_library_main_idx"` SourceURL string AgentType AgentInfoAgentType } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/models/agent_snapshot_post.go ================================================ package models import ( "time" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/types/numeric" "github.com/jinzhu/gorm" ) type AgentSnapshotPostStatus string const ( AgentSnapshotPostStatusNew AgentSnapshotPostStatus = "new" AgentSnapshotPostStatusInvalid AgentSnapshotPostStatus = "invalid" AgentSnapshotPostStatusValid AgentSnapshotPostStatus = "valid" AgentSnapshotPostStatusInferNew AgentSnapshotPostStatus = "infer_new" AgentSnapshotPostStatusInferSubmitted AgentSnapshotPostStatus = "infer_submitted" AgentSnapshotPostStatusInferError AgentSnapshotPostStatus = "infer_error" AgentSnapshotPostStatusInferFailed AgentSnapshotPostStatus = "infer_failed" AgentSnapshotPostStatusInferExpired AgentSnapshotPostStatus = "infer_expired" AgentSnapshotPostStatusInferResolved AgentSnapshotPostStatus = "infer_resolved" AgentSnapshotPostStatusInferRefund AgentSnapshotPostStatus = "infer_refund" AgentSnapshotPostStatusReplied AgentSnapshotPostStatus = "replied" AgentSnapshotPostStatusRepliedError AgentSnapshotPostStatus = "replied_error" AgentSnapshotPostStatusRepliedCancelled AgentSnapshotPostStatus = "replied_cancelled" AgentSnapshotPostStatusReposted AgentSnapshotPostStatus = "reposted" AgentSnapshotPostStatusRepostedError AgentSnapshotPostStatus = "reposted_error" ) type AgentSnapshotPost struct { gorm.Model NetworkID uint64 UserID uint `gorm:"index"` User *User AgentInfoID uint `gorm:"index"` AgentInfo *AgentInfo AgentSnapshotMissionID uint `gorm:"index"` AgentSnapshotMission *AgentSnapshotMission InferData string `gorm:"type:longtext"` InferSnapshotHash string InferTxHash string `gorm:"index"` InferAt *time.Time InferNum uint `gorm:"default:0"` InferOutputData string `gorm:"type:longtext"` InferOutputAt *time.Time `gorm:"index"` Status AgentSnapshotPostStatus `gorm:"index"` InscribeTxHash string BitcoinTxHash string Fee numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` Error string UserPrompt string `gorm:"type:longtext"` HeadSystemPrompt string `gorm:"type:longtext"` SystemPrompt string `gorm:"type:longtext"` SystemReminder string `gorm:"type:longtext"` Task string Toolset string ToolList string `gorm:"type:longtext"` AgentMetaData string `gorm:"type:longtext"` ResponseId string AgentBaseModel string ReactMaxSteps int `gorm:"default:0"` AgentSnapshotPostAction []*AgentSnapshotPostAction OrgTweetID string Token string AgentStoreMissionID uint AgentStoreID uint AgentStore *AgentStore IsRated bool AgentStoreMissionFee numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` } type ( AgentSnapshotPostActionType string AgentSnapshotPostActionStatus string ) const ( AgentSnapshotPostActionTypeTweet AgentSnapshotPostActionType = "tweet" AgentSnapshotPostActionTypeRetweet AgentSnapshotPostActionType = "retweet" AgentSnapshotPostActionTypeFollow AgentSnapshotPostActionType = "follow" AgentSnapshotPostActionTypeReply AgentSnapshotPostActionType = "reply" AgentSnapshotPostActionTypeReplyMulti AgentSnapshotPostActionType = "reply_multi" AgentSnapshotPostActionTypeReplyMultiUnlimited AgentSnapshotPostActionType = "reply_multi_unlimited" AgentSnapshotPostActionTypeCreateToken AgentSnapshotPostActionType = "create_token" AgentSnapshotPostActionTypeCreateAgent AgentSnapshotPostActionType = "create_agent" AgentSnapshotPostActionTypeGenerateVideo AgentSnapshotPostActionType = "generate_video" AgentSnapshotPostActionTypeQuoteTweet AgentSnapshotPostActionType = "quote_tweet" AgentSnapshotPostActionTypeInscribeTweet AgentSnapshotPostActionType = "inscribe_tweet" AgentSnapshotPostActionTypeTweetV2 AgentSnapshotPostActionType = "tweet_v2" AgentSnapshotPostActionTypeTweetMulti AgentSnapshotPostActionType = "tweet_multi" AgentSnapshotPostActionTypeCreateLaunchpad AgentSnapshotPostActionType = "create_launchpad" AgentSnapshotPostActionTypeUnknown AgentSnapshotPostActionType = "unknown" AgentSnapshotPostActionTypeTradeHold AgentSnapshotPostActionType = "hold" AgentSnapshotPostActionTypeTradeBuy AgentSnapshotPostActionType = "buy" AgentSnapshotPostActionTypeTradeSell AgentSnapshotPostActionType = "sell" AgentSnapshotPostActionTypeTradeAnalytic AgentSnapshotPostActionType = "analytic" AgentSnapshotPostActionTypeLaunchpadJoin AgentSnapshotPostActionType = "launchpad_join" AgentSnapshotPostActionStatusNew AgentSnapshotPostActionStatus = "new" AgentSnapshotPostActionStatusDone AgentSnapshotPostActionStatus = "done" AgentSnapshotPostActionStatusDone_ AgentSnapshotPostActionStatus = "done_" AgentSnapshotPostActionStatusDoneError AgentSnapshotPostActionStatus = "done_error" AgentSnapshotPostActionStatusDoneDuplicated AgentSnapshotPostActionStatus = "done_duplicated" AgentSnapshotPostActionStatusDoneCancelled AgentSnapshotPostActionStatus = "done_cancelled" AgentSnapshotPostActionStatusInvalid AgentSnapshotPostActionStatus = "invalid" AgentSnapshotPostActionStatusTesting AgentSnapshotPostActionStatus = "testing" AgentSnapshotPostActionStatusInscribing AgentSnapshotPostActionStatus = "inscribing" AgentSnapshotPostActionStatusPaid AgentSnapshotPostActionStatus = "paid" ) type AgentSnapshotPostAction struct { gorm.Model NetworkID uint64 AgentInfoID uint `gorm:"index"` AgentInfo *AgentInfo AgentSnapshotMissionID uint `gorm:"index"` AgentSnapshotMission *AgentSnapshotMission AgentSnapshotPostID uint `gorm:"index"` AgentSnapshotPost *AgentSnapshotPost AgentTwitterId string Type AgentSnapshotPostActionType `gorm:"index"` TargetUsername string TargetTwitterId string `gorm:"index"` ConversationId string `gorm:"index"` Tweetid string `gorm:"index"` Content string `gorm:"type:longtext"` Description string `gorm:"type:longtext"` Status AgentSnapshotPostActionStatus `gorm:"index"` RefId string `gorm:"type:longtext"` RefIds string `gorm:"type:longtext"` Error string FollowerCount uint `gorm:"default:0"` IsApproved bool `gorm:"default:0"` ScheduleAt *time.Time `gorm:"index"` ExecutedAt *time.Time Fee numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` IsMigrated bool `gorm:"default:0"` TokenName string TokenSymbol string TokenAddress string TokenHash string TokenInferID string TokenImageUrl string ReqRefID string ToolSet ToolsetType InscribeId string InscribeTxHash string BitcoinTxHash string Price numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` RewardAmount numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` RewardUser int } type ( LuckyMoneyStatus string ) const ( LuckyMoneyStatusNew LuckyMoneyStatus = "new" LuckyMoneyStatusProcessing LuckyMoneyStatus = "processing" LuckyMoneyStatusInvalid LuckyMoneyStatus = "invalid" LuckyMoneyStatusDone LuckyMoneyStatus = "done" ) type AbilityLuckyMoney struct { gorm.Model NetworkID uint64 AgentInfoID uint `gorm:"index"` AgentInfo *AgentInfo AgentSnapshotMissionID uint `gorm:"index"` AgentSnapshotMission *AgentSnapshotMission AgentSnapshotPostID uint `gorm:"index"` AgentSnapshotPost *AgentSnapshotPost AgentSnapshotPostActionID uint `gorm:"index"` AgentSnapshotPostAction *AgentSnapshotPostAction RewardAmount numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` TokenBalance numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` Status LuckyMoneyStatus Error string TweetID string `gorm:"unique_index"` TweetAt *time.Time `gorm:"index"` TwitterID string TwitterUsername string TwitterName string Content string `gorm:"type:longtext"` UserAddress string RefTweetID string TxHash string } type ToolsetType string const ( ToolsetTypeDefault ToolsetType = "default" ToolsetTypeReplyMentions ToolsetType = "reply_mentions" ToolsetTypeReplyNonMentions ToolsetType = "reply_non_mentions" ToolsetTypeShadowReply ToolsetType = "shadow_reply" ToolsetTypeFollow ToolsetType = "follow" ToolsetTypePost ToolsetType = "post" ToolsetTypePostSearchV2 ToolsetType = "post_search_v2" ToolsetTypePostSearchV3 ToolsetType = "post_search_v3" ToolsetTypeIssueToken ToolsetType = "issue_token" ToolsetTypeInscribeTweet ToolsetType = "inscribe_tweet" ToolsetTypeInscribeTweetNews ToolsetType = "tweet_news" ToolsetTypeTrading ToolsetType = "trading" ToolsetTypeTradeNews ToolsetType = "trade_news" ToolsetTypeTradeAnalytics ToolsetType = "trade_analytics" ToolsetTypeTradeAnalyticsOnTwitter ToolsetType = "trade_analytics_twitter" ToolsetTypeTradeAnalyticsMentions ToolsetType = "trade_analytics_mentions" ToolsetTypeLuckyMoneys ToolsetType = "lucky_moneys" ToolsetTypeLaunchpadJoin ToolsetType = "launchpad_join" ToolsetTypeMissionStore ToolsetType = "mission_store" ToolsetTypeReplyMentionsFarcaster ToolsetType = "reply_mentions_farcaster" ToolsetTypeReplyNonMentionsFarcaster ToolsetType = "reply_non_mentions_farcaster" ToolsetTypePostFarcaster ToolsetType = "post_farcaster" ToolsetTypeTavily ToolsetType = "tavily" ) type AgentSnapshotMission struct { gorm.Model NetworkID uint64 AgentInfoID uint `gorm:"index"` AgentInfo *AgentInfo UserPrompt string `gorm:"type:longtext"` IntervalSec int `gorm:"default:0"` LookupInterval int `gorm:"default:0"` Enabled bool `gorm:"default:0"` ReplyEnabled bool `gorm:"default:0"` IsTesting bool `gorm:"default:0"` ToolSet ToolsetType AgentType AgentInfoAgentType `gorm:"default:0"` InferAt *time.Time SkipThough bool `gorm:"default:0"` ToolList string `gorm:"type:longtext"` UserTwitterIds string `gorm:"type:longtext"` TeleChatID string Tokens string `gorm:"type:longtext"` ReactMaxSteps int `gorm:"default:0"` NotDelay bool `gorm:"default:0"` AgentBaseModel string Topics string `gorm:"type:longtext"` IsTwitterSearch bool `gorm:"default:0"` IsBingSearch bool `gorm:"default:0"` RewardAmount numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` RewardUser int MinTokenHolding numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` LaunchpadMemberID uint AgentStoreID uint AgentStore *AgentStore AgentStoreMissionID uint AgentStoreMission *AgentStoreMission } type TeleMsgStatus string const ( TeleMsgStatusNew TeleMsgStatus = "new" ) type AgentTeleMsg struct { gorm.Model MessageID string `gorm:"unique_index"` MessageDate *time.Time Content string `gorm:"type:longtext"` ChatID string ChatUsername string AgentInfoID uint `gorm:"index"` AgentInfo *AgentInfo AgentSnapshotMissionID uint `gorm:"index"` AgentSnapshotMission *AgentSnapshotMission Status TeleMsgStatus } type PlatformType string const ( PlatformTypeTwitter PlatformType = "twitter" PlatformTypeFarcaster PlatformType = "farcaster" ) type AgentSnapshotMissionConfigs struct { gorm.Model NetworkID uint64 ToolSet ToolsetType ToolSetName string Platform PlatformType IsTesting bool `gorm:"default:0"` } type AgentSnapshotMissionResp struct { ID uint `json:"id"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` NetworkID uint64 `json:"network_id"` AgentInfoID uint `json:"agent_info_id"` AgentInfo *AgentInfo `json:"agent_info"` UserPrompt string `json:"user_prompt"` IntervalSec int `json:"interval_sec"` Enabled bool `json:"enabled"` ReplyEnabled bool `json:"reply_enabled"` IsTesting bool `json:"is_testing"` ToolSet ToolsetType `json:"tool_set"` AgentType AgentInfoAgentType `json:"agent_type"` InferAt *time.Time `json:"infer_at"` SkipThough bool `json:"skip_though"` } type AgentSnapshotPostActionResp struct { ID uint `json:"id"` ExecutedAt *time.Time `json:"executed_at"` ToolSet string `json:"tool_set"` Type string `json:"type"` Tweetid string `json:"tweetid"` TargetUsername string `json:"target_username"` PostTweetid string `json:"post_tweetid"` Content string `json:"content"` UserPrompt string `json:"user_prompt"` InferInputData string `json:"infer_input_data"` InferOutputData string `json:"infer_output_data"` Description string `json:"description"` TargetTwitterId string `json:"target_twitter_id"` TokenInferID string `json:"token_infer_id"` TokenImageUrl string `json:"token_image_url"` AgentSnapshotMission *AgentSnapshotMissionResp `json:"agent_snapshot_mission"` Status AgentSnapshotPostActionStatus `json:"status"` } type ParamWakeupRequest struct { QuoteUsername string `json:"quote_username"` ReactMaxSteps int `json:"react_max_steps"` } type WakeupRequestMetadata struct { TwitterId string `json:"twitter_id"` TwitterUsername string `json:"twitter_username"` AgentContractId string `json:"agent_contract_id"` ChainId string `json:"chain_id"` SystemReminder string `json:"system_reminder"` Params ParamWakeupRequest `json:"params"` RefID string `json:"ref_id"` KnowledgeBaseId string `json:"knowledge_base_id"` } type AgentWakeupKnowledgeBase struct { KbId string `json:"kb_id"` ChainId string `json:"chain_id"` } type AgentMetadataRequest struct { TokenInfo struct { Name string `json:"name"` Symbol string `json:"symbol"` Address string `json:"address"` Chain string `json:"chain"` } `json:"token_info"` KbAgents []AgentWakeupKnowledgeBase `json:"kb_agents"` } type CallWakeupRequest struct { Toolkit []interface{} `json:"toolkit"` Prompt string `json:"prompt"` Task string `json:"task"` Toolset string `json:"toolset"` MetaData WakeupRequestMetadata `json:"meta_data"` SystemPrompt string `json:"system_prompt"` Model string `json:"model"` AgentMetaData AgentMetadataRequest `json:"agent_meta_data"` ToolList string `json:"tool_list"` } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/models/agent_store.go ================================================ package models import ( "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/types/numeric" "github.com/jinzhu/gorm" ) type ( AgentStoreType string AgentStoreStatus string AgentStoreMissionStatus string AgentStoreInstallStatus string AgentStoreInstallType string ) const ( AgentStoreInstallStatusNew AgentStoreInstallStatus = "new" AgentStoreInstallStatusDone AgentStoreInstallStatus = "done" AgentStoreInstallTypeAgent AgentStoreInstallType = "agent" AgentStoreInstallTypeUser AgentStoreInstallType = "user" AgentStoreTypeStore AgentStoreType = "store" AgentStoreTypeInfra AgentStoreType = "infra" AgentStoreStatusNew AgentStoreStatus = "new" AgentStoreStatusActived AgentStoreStatus = "actived" AgentStoreStatusInActived AgentStoreStatus = "inactived" ) type AgentStore struct { gorm.Model NetworkID uint64 `gorm:"default:0"` ContractAddress string TokenId uint64 `gorm:"default:0"` StoreId string `gorm:"unique_index"` Type AgentStoreType Name string Description string `gorm:"type:text"` OwnerAddress string OwnerID uint Owner *User AuthenUrl string `gorm:"type:longtext"` Docs string `gorm:"type:longtext"` ApiUrl string `gorm:"type:longtext"` Icon string `gorm:"type:text"` Status AgentStoreStatus Price numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` AgentStoreMissions []*AgentStoreMission NumInstall uint `gorm:"default:0"` NumUsage uint `gorm:"default:0"` Volume numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` MemeID uint Meme *Meme TokkenAddress string } type AgentStoreMission struct { gorm.Model AgentStoreID uint `gorm:"index"` Name string Description string `gorm:"type:text"` UserPrompt string `gorm:"type:longtext"` Price numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` OwnerAddress string ToolList string `gorm:"type:longtext"` Rating float64 `gorm:"type:decimal(5,2);default:0"` NumRating uint `gorm:"default:0"` NumUsed uint `gorm:"default:0"` Status AgentStoreStatus Icon string `gorm:"type:text"` Volume numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` } type AgentStoreInstall struct { gorm.Model Type AgentStoreInstallType Code string `gorm:"unique_index"` UserID uint `gorm:"unique_index:agent_store_main_idx"` User *User AgentStoreID uint `gorm:"unique_index:agent_store_main_idx"` AgentInfoID uint `gorm:"unique_index:agent_store_main_idx"` AgentStore *AgentStore CallbackParams string `gorm:"type:longtext"` //{"user_id" : "123", "authen_token" : "xxx",...} Status AgentStoreInstallStatus } type AgentStoreLog struct { gorm.Model AgentStoreInstallID uint UserID uint AgentStoreID uint Price numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` UrlPath string `gorm:"type:text"` Status int } type AgentStoreTry struct { gorm.Model UserID uint `gorm:"unique_index:agent_store__try_history_main_idx"` AgentStoreID uint `gorm:"unique_index:agent_store__try_history_main_idx"` } type AgentStoreTryDetail struct { gorm.Model AgentStoreTryID uint `gorm:"index"` FromUser bool Content string `gorm:"type:text"` AgentSnapshotPostID uint AgentSnapshotPost *AgentSnapshotPost } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/models/agent_wallet.go ================================================ package models import ( "time" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/types/numeric" "github.com/jinzhu/gorm" ) type AgentWallet struct { gorm.Model NetworkID uint64 `gorm:"unique_index:agent_wallets_main_idx"` AgentInfoID uint `gorm:"unique_index:agent_wallets_main_idx"` AgentInfo *AgentInfo Address string CdpWalletID string } type AgentWalletActionStatus string const ( AgentWalletActionStatusNew AgentWalletActionStatus = "new" AgentWalletActionStatusDone AgentWalletActionStatus = "done" AgentWalletActionStatusError AgentWalletActionStatus = "error" ) type AgentWalletAction struct { gorm.Model NetworkID uint64 AgentInfoID uint `gorm:"index"` AgentWalletID uint `gorm:"index"` ActionType string ActionInput string `gorm:"type:longtext"` ActionOutput string `gorm:"type:longtext"` Status AgentWalletActionStatus RefID string Toolset string AgentSnapshotMissionID uint `gorm:"index"` AgentSnapshotMission *AgentSnapshotMission AgentSnapshotPostID uint `gorm:"index"` AgentSnapshotPost *AgentSnapshotPost Side string Mint string AmountIn numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` AmountOut numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` TxHash string } type AgentWalletTrade struct { gorm.Model EventId string `gorm:"unique_index"` NetworkID uint64 AgentInfoID uint `gorm:"index"` AgentWalletID uint `gorm:"index"` TradedAt *time.Time TokenIn string TokenOut string AmountIn numeric.BigInt AmountOut numeric.BigInt TxHash string RefID string AgentSnapshotMissionID uint `gorm:"index"` AgentSnapshotMission *AgentSnapshotMission AgentSnapshotPostID uint `gorm:"index"` AgentSnapshotPost *AgentSnapshotPost } type AgentWalletTradeSum struct { Mint string BuyAmount numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` SellAmount numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/models/api_subscription.go ================================================ package models import ( "time" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/types/numeric" "github.com/jinzhu/gorm" ) type ( DepositStatus string PackageType string ) const ( DepositStatusPending DepositStatus = "pending" DepositStatusDone DepositStatus = "done" PackageTypeFree PackageType = "free" PackageTypeBasic PackageType = "basic" PackageTypePro PackageType = "pro" ) type ApiSubscriptionPackage struct { gorm.Model Name string Description string `gorm:"type:text"` Price numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` NetworkID uint64 NumToken uint64 Type PackageType DurationDay uint } type ApiSubscriptionKey struct { gorm.Model NetworkID uint64 `gorm:"unique_index:api_sub_key_main_uidx"` UserAddress string `gorm:"unique_index:api_sub_key_main_uidx"` TwitterID string `gorm:"unique_index:api_sub_key_main_uidx"` TwitterInfoID uint TwitterInfo *TwitterInfo ApiKey string `gorm:"unique_index"` PackageID uint Package ApiSubscriptionPackage QuotaRemaining uint64 StartedAt *time.Time ExpiresAt *time.Time DepositAddress string `gorm:"index"` } type ApiSubscriptionHistory struct { gorm.Model NetworkID uint64 UserAddress string ApiKey string PackageID uint Package ApiSubscriptionPackage DepositAddress string `gorm:"index"` DepositStatus DepositStatus TxHash string EventId string `gorm:"unique_index"` NumToken uint64 StartedAt *time.Time ExpiresAt *time.Time } type ApiSubscriptionUsageLog struct { gorm.Model ApiKey string Endpoint string NumToken uint64 } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/models/app_configs.go ================================================ package models import ( "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/types/numeric" "github.com/jinzhu/gorm" ) var KeyConfigNameWalletDeploy = "wallet_deploy" var KeyConfigNameModelId = "knowledge_base_model_id" var KeyConfigNameKnowledgeBaseWorkerHubAddress = "knowledge_base_worker_hub_address" var KeyConfigNameKnowledgeBaseTokenContractAddress = "knowledge_base_token_contract_address" type AppConfig struct { gorm.Model NetworkID uint64 `gorm:"unique_index:app_configs_main_uidx"` Name string `gorm:"unique_index:app_configs_main_uidx"` Value string Public bool `gorm:"default:0"` TxHash string } type BlockScanInfo struct { gorm.Model Type string NetworkID uint64 Duration uint `gorm:"default:0"` LastBlockNumber int64 `gorm:"default:1"` NumBlocks int64 `gorm:"default:50"` LastBlockError string `gorm:"type:longtext"` Enabled bool `gorm:"default:1"` ContractAddrs string `gorm:"type:longtext"` } type TokenPrice struct { gorm.Model NetworkID uint64 Symbol string Price numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` Last24hPrice numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` } type BTCL1InscribeTx struct { gorm.Model TxHash string InscribeTxHash string Error string `gorm:"type:longtext"` } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/models/external_wallet.go ================================================ package models import ( "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/types/numeric" "github.com/jinzhu/gorm" ) type ExternalWalletType string const ( ExternalWalletTypeSOL ExternalWalletType = "SOL" ) type ExternalWallet struct { gorm.Model APIKey string `gorm:"unique_index"` Type ExternalWalletType Address string `gorm:"unique_index"` } type ExternalWalletOrderType string type ExternalWalletOrderStatus string const ( ExternalWalletOrderTypeBuy ExternalWalletOrderType = "buy" ExternalWalletOrderTypeSell ExternalWalletOrderType = "sell" ExternalWalletOrderTypeWithdraw ExternalWalletOrderType = "withdraw" ExternalWalletOrderStatusNew ExternalWalletOrderStatus = "new" ExternalWalletOrderStatusDone ExternalWalletOrderStatus = "done" ExternalWalletOrderStatusError ExternalWalletOrderStatus = "error" ) type ExternalWalletOrder struct { gorm.Model ExternalWalletID uint ExternalWallet *ExternalWallet Type ExternalWalletOrderType TokenAddress string TokenName string TokenSymbol string Destination string AmountIn numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` AmountOut numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` TxHash string Status ExternalWalletOrderStatus Error string `gorm:"type:longtext"` } type ExternalWalletToken struct { gorm.Model Symbol string Name string TokenAddress string Price float64 `gorm:"default:0"` Enabled bool `gorm:"default:0"` Decimals int `gorm:"default:0"` CoingeckoSlug string } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/models/infer.go ================================================ package models import ( "time" "github.com/jinzhu/gorm" ) const ( MillisecondText = "millisecond" SecondText = "second" MinuteText = "minute" HourText = "hour" ) type BatchInferHistoryStatus string type ContractInferenceStatus int type ModelPredictHistoryStatus int type ModelPredictHistoryVerifyStatus string type TrainingRequestExportStatus string type TrainingRequestStatus string type TrainingRequestType int const ( TrainingRequestTypeUserDefine TrainingRequestType = iota + 1 TrainingRequestTypeHuggingFace ) const ( BatchInferHistoryStatusPending BatchInferHistoryStatus = "pending" BatchInferHistoryStatusAgentInferred BatchInferHistoryStatus = "agent-inferred" BatchInferHistoryStatusQueueHandled BatchInferHistoryStatus = "queue-handled" BatchInferHistoryStatusCompleted BatchInferHistoryStatus = "completed" BatchInferHistoryStatusFailed BatchInferHistoryStatus = "failed" ) const ( ContractInferenceStatusNil ContractInferenceStatus = 0 ContractInferenceStatusSolving ContractInferenceStatus = 1 ContractInferenceStatusCommit ContractInferenceStatus = 2 ContractInferenceStatusReveal ContractInferenceStatus = 3 ContractInferenceStatusProcessed ContractInferenceStatus = 4 ContractInferenceStatusKilled ContractInferenceStatus = 5 ContractInferenceStatusTransferred ContractInferenceStatus = 6 ) const ( ModelPredictHistoryStatusSolving ModelPredictHistoryStatus = 0 ModelPredictHistoryStatusProcessed ModelPredictHistoryStatus = 1 // zk ModelPredictHistoryStatusCommit ModelPredictHistoryStatus = 2 ModelPredictHistoryStatusReveal ModelPredictHistoryStatus = 3 ) const ( ModelPredictHistoryVerifyStatusPending ModelPredictHistoryVerifyStatus = "pending" ModelPredictHistoryVerifyStatusPassed ModelPredictHistoryVerifyStatus = "passed" ModelPredictHistoryVerifyStatusFailed ModelPredictHistoryVerifyStatus = "failed" ) const ( TrainingRequestExportStatusWaiting TrainingRequestExportStatus = "waiting" TrainingRequestExportStatusRunning TrainingRequestExportStatus = "running" TrainingRequestExportStatusCompleted TrainingRequestExportStatus = "completed" TrainingRequestExportStatusFailed TrainingRequestExportStatus = "failed" ) const ( TrainingRequestStatusWaiting TrainingRequestStatus = "waiting" TrainingRequestStatusRunning TrainingRequestStatus = "running" TrainingRequestStatusCompleted TrainingRequestStatus = "completed" TrainingRequestStatusFailed TrainingRequestStatus = "failed" TrainingRequestStatusWaitMint TrainingRequestStatus = "wait-mint" TrainingRequestStatusChecking TrainingRequestStatus = "checking" TrainingRequestStatusDeploying TrainingRequestStatus = "deploying" TrainingRequestStatusDeployed TrainingRequestStatus = "deployed" TrainingRequestStatusWaitingToPayment TrainingRequestStatus = "wait-payment" TrainingRequestStatusPaymentSuccess TrainingRequestStatus = "payment-success" ) type BatchInferHistory struct { gorm.Model UserID string `json:"user_id"` UserAddress string `json:"user_address"` Toolset ToolsetType `json:"toolset"` AgentContractAddress string `json:"agent_contract_address"` ContractAgentID string `json:"contract_agent_id"` ChainID uint64 `json:"chain_id"` AssistantID string `json:"assistant_id"` PromptInput string `json:"prompt_input"` SystemPrompt string `json:"system_prompt"` PromptInputHash string `json:"prompt_input_hash"` AgentType string `json:"agent_type"` TwitterSnapshot string `json:"twitter_snapshot"` UserInfoSnapshot string `json:"user_info_snapshot"` OutputMaxCharacter uint `json:"output_max_character"` PromptOutput string `json:"prompt_output"` PromptOutputHash string `json:"prompt_output_hash"` SubmitPromptOutputAt time.Time `json:"submit_prompt_output_at"` Status BatchInferHistoryStatus `json:"status"` Log string `json:"log"` InferID string `json:"infer_id"` ModelID string `json:"model_id"` InscribeTxHash string `json:"inscribe_tx_hash"` SubmitSolutionInscribeTxHash string `json:"submit_solution_tx_hash"` BtcInscribeTxHash string `json:"btc_inscribe_tx_hash"` BtcSubmitSolutionInscribeTxHash string `json:"btc_submit_solution_inscribe_tx_hash"` InferWalletAddress string `json:"infer_wallet_address"` SubmitInferAt time.Time `json:"submit_infer_at"` AssignmentAddresses string `json:"assignment_addresses" gorm:"type:json"` //[]string SubmitSolutionAddress string `json:"submit_solution_address"` CommitTxHash string `json:"commit_tx_hash" gorm:"type:json"` //[]string RevealTxHash string `json:"reveal_tx_hash" gorm:"type:json"` //[]string BtcCommitInscribeTxHash string `json:"btc_commit_inscribe_tx_hash" gorm:"type:json"` //[]string BtcRevealInscribeTxHash string `json:"btc_reveal_inscribe_tx_hash" gorm:"type:json"` //[]string } type ChainConfig struct { gorm.Model ChainID string `json:"chain_id" gorm:"column:chain_id"` RPC string `json:"rpc" gorm:"column:rpc"` Name string `json:"name" gorm:"column:name"` Explorer string `json:"explorer" gorm:"column:explorer"` EAIErc20 string `json:"eai_erc20" gorm:"column:eai_erc20"` NFTAddress string `json:"nft_address" gorm:"column:nft_address"` // or collect address PaymasterAddress string `json:"paymaster_address" gorm:"column:paymaster_address"` PaymasterFeeZero bool `json:"paymaster_fee_zero" gorm:"column:paymaster_fee_zero"` PaymasterToken string `json:"paymaster_token" gorm:"column:paymaster_token"` WorkerhubAddress string `json:"workerhub_address" gorm:"column:workerhub_address"` StakinghubAddress string `json:"stakinghub_address" gorm:"column:stakinghub_address"` ZkSync bool `json:"zk_sync" gorm:"column:zk_sync"` EAINative bool `json:"eai_native" gorm:"column:eai_native"` Thumbnail string `json:"thumbnail" gorm:"column:thumbnail"` DaoToken string `json:"dao_token" gorm:"column:dao_token"` ModelIds string `json:"model_ids" gorm:"column:model_ids;type:json"` //[]string ModelDetails []*TrainingRequest `json:"model_details" gorm:"-"` AgentContractAddress string `json:"agent_contract_address" gorm:"column:agent_contract_address"` NeedInscribeTx bool `json:"need_inscribe_tx" gorm:"column:need_inscribe_tx"` WebStatUri string `json:"web_stat_uri" gorm:"column:web_stat_uri"` // e.g., https://webstat.shard-ai.l2aas.com BlockNumberDelay uint64 `json:"block_number_delay" gorm:"column:block_number_delay"` ListRPC string `json:"-" gorm:"column:list_rpc;type:json"` //[]string GasLimit uint64 `json:"gas_limit" gorm:"column:gas_limit"` SupportModelNames string `json:"support_model_names" gorm:"column:support_model_names;type:json"` //map[string]string Serialize as JSON SupportStoreRaw bool `json:"support_store_raw" gorm:"column:support_store_raw"` IsWorkerHubV4 bool `json:"is_workerhub_v4" gorm:"column:is_workerhub_v4"` } type TrainingRequestERC20Info struct { gorm.Model ERC20Address string `json:"erc20_address" gorm:"column:erc20_address"` ERC20IssueTime time.Time `json:"erc20_issue_time" gorm:"column:erc20_issue_time"` ERC20Description string `json:"erc20_description" gorm:"column:erc20_description"` ERC20Name string `json:"erc20_name" gorm:"column:erc20_name"` ERC20Symbol string `json:"erc20_symbol" gorm:"column:erc20_symbol"` ERC20Supply string `json:"erc20_supply" gorm:"column:erc20_supply"` TokenPrice string `json:"token_price" gorm:"column:token_price"` TokenPriceNumber float64 `json:"token_price_number" gorm:"column:token_price_number"` TokenMarketCap string `json:"token_market_cap" gorm:"column:token_market_cap"` TokenMarketCapNumber float64 `json:"token_market_cap_number" gorm:"column:token_market_cap_number"` CirculatingSupply string `json:"circulating_supply" gorm:"column:circulating_supply"` CirculatingSupplyNum float64 `json:"circulating_supply_num" gorm:"column:circulating_supply_num"` CurrentDonate string `json:"current_donate" gorm:"column:current_donate"` TotalInvestment string `json:"total_investment" gorm:"-"` TotalBackers int `json:"total_backers" gorm:"-"` IsERC20Deployed bool `json:"is_erc20_deployed" gorm:"column:is_erc20_deployed"` ERC20Owner string `json:"erc20_owner" gorm:"column:erc20_owner"` } type HGModelCheckResult struct { EstimatedSize float64 `json:"estimated_size"` // GB MinRequirements struct { VRAM string `json:"VRAM"` RAM string `json:"RAM"` } `json:"min_requirements"` } type ZkSyncNetwork struct { gorm.Model RPC string `json:"rpc" gorm:"column:rpc"` ChainId string `json:"chain_id" gorm:"column:chain_id"` WorkerHubAddress string `json:"worker_hub_address" gorm:"column:worker_hub_address"` PaymasterToken string `json:"paymaster_token" gorm:"column:paymaster_token"` PaymasterAddress string `json:"paymaster_address" gorm:"column:paymaster_address"` NFTAddress string `json:"nft_address" gorm:"column:nft_address"` // or collectionAddress PaymasterFeeZero bool `json:"paymaster_fee_zero" gorm:"column:paymaster_fee_zero"` DaoToken string `json:"dao_token" gorm:"column:dao_token"` EAIERC20 string `json:"eaierc_20" gorm:"column:eaierc_20"` Name string `json:"name" gorm:"column:name"` Explorer string `json:"explorer" gorm:"column:explorer"` AgentContractAddress string `json:"agent_contract_address" gorm:"column:agent_contract_address"` NeedInscribeTx bool `json:"need_inscribe_tx" gorm:"column:need_inscribe_tx"` StakingHubAddress string `json:"staking_hub_address" gorm:"column:staking_hub_address"` BlockNumberDelay uint64 `json:"block_number_delay" gorm:"column:block_number_delay"` ListRPC string `json:"list_rpc" gorm:"type:json;column:list_rpc"` // []string GasLimit uint64 `json:"gas_limit" gorm:"column:gas_limit"` } type TrainingRequest struct { gorm.Model ModelID string `json:"model_id" gorm:"column:model_id"` Params string `json:"params" gorm:"column:params"` Status TrainingRequestStatus `json:"status" gorm:"column:status"` ModelCheckingLog string `json:"model_checking_log" gorm:"column:model_checking_log"` Result string `json:"result" gorm:"column:result"` Creator string `json:"creator" gorm:"column:creator"` IsOnchain bool `json:"is_onchain" gorm:"column:is_onchain"` Description string `json:"description" gorm:"column:description"` OutputUUID string `json:"output_uuid" gorm:"column:output_uuid"` OutputLink string `json:"output_link" gorm:"column:output_link"` Progress int `json:"progress" gorm:"column:progress"` ExecutedAt int64 `json:"executed_at" gorm:"column:executed_at"` CompletedAt int64 `json:"completed_at" gorm:"column:completed_at"` Error string `json:"error" gorm:"column:error"` Logs string `json:"logs" gorm:"column:logs"` ErrLogs string `json:"err_logs" gorm:"column:err_logs"` Datasets string `json:"datasets" gorm:"type:json"` // []string PredictNumber int `json:"predict_number" gorm:"column:predict_number"` LastPredict *ModelPredictHistory `json:"last_predict" gorm:"-"` Category string `json:"category" gorm:"column:category"` CurrentListing *ModelMarket `json:"current_listing" gorm:"-"` Owner string `json:"owner" gorm:"column:owner"` LastUpdatedBlock uint64 `json:"last_updated_block" gorm:"column:last_updated_block"` Thumbnail string `json:"thumbnail" gorm:"column:thumbnail"` ClaimedDeployReward bool `json:"claimed_deploy_reward" gorm:"column:claimed_deploy_reward"` TrainingType string `json:"training_type" gorm:"column:training_type"` TrainingRequestERC20InfoID uint TrainingRequestERC20Info *TrainingRequestERC20Info Type TrainingRequestType `json:"type" gorm:"column:type"` ExportStatus TrainingRequestExportStatus `json:"export_status" gorm:"column:export_status"` ExportResult string `json:"export_result" gorm:"column:export_result"` ExportLog string `json:"export_log" gorm:"column:export_log"` ModelMetadata string `json:"model_metadata" gorm:"column:model_metadata"` ModelAddressUserDefine string `json:"model_address_user_define" gorm:"column:model_address_user_define"` FileSize int64 `json:"file_size" gorm:"column:file_size"` ChargeFee string `json:"charge_fee" gorm:"column:charge_fee"` ChargeFeeNumber float64 `json:"charge_fee_number" gorm:"column:charge_fee_number"` ChargeFeeTokenSymbol string `json:"charge_fee_token_symbol" gorm:"column:charge_fee_token_symbol"` ChargeReceiveAddress string `json:"charge_receive_address" gorm:"column:charge_receive_address"` ChargePaidTxHash string `json:"charge_paid_tx_hash" gorm:"column:charge_paid_tx_hash"` SortOrder int `json:"sort_order" gorm:"column:sort_order"` HuggingFaceId string `json:"hugging_face_id" gorm:"column:hugging_face_id"` DataTypeExporter string `json:"data_type_exporter" gorm:"column:data_type_exporter"` CheckResult string `json:"check_result" gorm:"type:json"` //json HGModelCheckResult ZkSync bool `json:"zk_sync" gorm:"column:zk_sync"` ZkSyncNetworkID uint ZkSyncNetwork *ZkSyncNetwork ModelStorageUrl string `json:"model_storage_url" gorm:"column:model_storage_url"` Slug string `json:"slug" gorm:"column:slug"` } type ModelPredictHistory struct { gorm.Model RequestID string `json:"requestId" gorm:"column:request_id"` ModelID string `json:"modelId" gorm:"column:model_id"` InferTxHash string `json:"infer_tx_hash" gorm:"column:infer_tx_hash"` IsAgentInfer bool `json:"is_agent_infer" gorm:"column:is_agent_infer"` Requester string `json:"requester" gorm:"column:requester"` ClassName string `json:"className" gorm:"column:class_name"` Status ModelPredictHistoryStatus `json:"status" gorm:"column:status"` // 0: pending, 1: completed CdnURL string `json:"cdnURL" gorm:"column:cdn_url"` Result string `json:"result" gorm:"column:result"` Category string `json:"category" gorm:"column:category"` Hashtag string `json:"hashtag" gorm:"column:hashtag"` // unique generate hashtag to share on Twitter LikeCount int64 `json:"likeCount" gorm:"column:like_count"` ViewCount int64 `json:"viewCount" gorm:"column:view_count"` ClaimedView int64 `json:"claimedView" gorm:"column:claimed_view"` ClaimedLike int64 `json:"claimedLike" gorm:"column:claimed_like"` SharedBy string `json:"sharedBy" gorm:"type:json"` // []string ClaimedPredictReward bool `json:"claimedPredictReward" gorm:"column:claimed_predict_reward"` Metadata string `json:"metadata" gorm:"column:metadata"` Description string `json:"description" gorm:"column:description"` VerifyStatus ModelPredictHistoryVerifyStatus `json:"verifyStatus" gorm:"column:verify_status"` Fee string `json:"fee" gorm:"column:fee"` ProcessedBys string `json:"processedBys" gorm:"type:json"` // []string WinnerMiner string `json:"winnerMiner" gorm:"column:winner_miner"` WinnerFee string `json:"winnerFee" gorm:"column:winner_fee"` WinnerTx string `json:"winnerTx" gorm:"column:winner_tx"` ModelData *TrainingRequest `json:"model_data" gorm:"-"` RefundTx string `json:"refundTx" gorm:"column:refund_tx"` ResolveInference bool `json:"resolve_inference" gorm:"column:resolve_inference"` ContractInferenceStatus ContractInferenceStatus `json:"contract_inference_status" gorm:"column:contract_inference_status"` SubmitTimeout uint64 `json:"submit_timeout" gorm:"column:submit_timeout"` CommitTimeout uint64 `json:"commit_timeout" gorm:"column:commit_timeout"` RevealTimeout uint64 `json:"reveal_timeout" gorm:"column:reveal_timeout"` InferenceMiner string `json:"inference_miner" gorm:"column:inference_miner"` DaoTxTransferToUser string `json:"dao_tx_transfer_to_user" gorm:"column:dao_tx_transfer_to_user"` DaoTxTransferToReferer string `json:"dao_tx_transfer_to_referer" gorm:"column:dao_tx_transfer_to_referer"` } type ModelMarket struct { gorm.Model ModelID string `json:"model_id" gorm:"column:model_id"` ModelAddress string `json:"model_address" gorm:"column:model_address"` IsListing bool `json:"is_listing" gorm:"column:is_listing"` UserAddress string `json:"user_address" gorm:"column:user_address"` Price string `json:"price" gorm:"column:price"` Matched bool `json:"matched" gorm:"column:matched"` Cancelled bool `json:"cancelled" gorm:"column:cancelled"` OfferID string `json:"offer_id" gorm:"column:offer_id"` Deadline int64 `json:"deadline" gorm:"column:deadline"` AcceptAsset string `json:"accept_asset" gorm:"column:accept_asset"` IsInvalid bool `json:"is_invalid" gorm:"column:is_invalid"` AtBlock uint64 `json:"at_block" gorm:"column:at_block"` BuyerAddress string `json:"buyer_address" gorm:"column:buyer_address"` SellerAddress string `json:"seller_address" gorm:"column:seller_address"` } type JobConfig struct { gorm.Model JobName string `json:"job_name"` Enable bool `json:"enable"` Interval int64 `json:"interval"` LastRun *time.Time `json:"last_run"` IntervalUnit string `json:"interval_unit"` } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/models/infra_twitter_app.go ================================================ package models import ( "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/types/numeric" "github.com/jinzhu/gorm" ) type InfraTwitterApp struct { gorm.Model Address string TwitterInfoID uint TwitterInfo *TwitterInfo EaiBalance numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` TotalRequest uint64 RemainRequest uint64 ETHAddress string `gorm:"index"` } type InfraTwitterTopupTx struct { gorm.Model NetworkID uint64 EventId string `gorm:"unique_index"` InfraTwitterAppID uint `gorm:"index"` InfraTwitterApp *InfraTwitterApp Type AgentEaiTopupType `gorm:"default:'deposit'"` DepositAddress string ToAddress string TxHash string Amount numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` Status AgentEaiTopupStatus } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/models/knowledge_base.go ================================================ package models import ( "math" "gorm.io/gorm" ) type ( KnowledgeBaseStatus int64 KnowledgeBaseFileStatus int64 ) const ( KnowledgeBaseStatusWaitingPayment KnowledgeBaseStatus = iota + 1 KnowledgeBaseStatusPaymentReceipt KnowledgeBaseStatusProcessing KnowledgeBaseStatusDone KnowledgeBaseStatusMinted KnowledgeBaseStatusProcessingFailed KnowledgeBaseStatusProcessUpdate KnowledgeBaseStatusProcessCrawlData KnowledgeBaseStatusCrawlDataDone ) const ( KnowledgeBaseFileStatusPending KnowledgeBaseFileStatus = iota + 1 KnowledgeBaseFileStatusDone KnowledgeBaseFileStatusFail ) type KnowledgeBase struct { gorm.Model Status KnowledgeBaseStatus `json:"status"` UserAddress string `json:"user_address"` DepositAddress string `json:"deposit_address"` DepositPrivKey string `json:"-"` DepositTxHash string `json:"deposit_tx_hash"` Name string `json:"name"` Description string `json:"description"` AgentInfoId uint `json:"agent_info_id"` AgentInfo *AgentInfo `json:"agent_info" gorm:"foreignkey:AgentInfoId;references:ID"` NetworkID uint64 `json:"network_id"` KBTokenContractAddress string `json:"kb_token_contract_address"` KBTokenID string `json:"kb_token_id" gorm:"index"` KBTokenMintTx string `json:"kb_token_mint_tx" gorm:"index"` KnowledgeBaseFiles []*KnowledgeBaseFile `json:"knowledge_base_files"` Fee float64 `json:"fee"` // total fee user need pay (all time) ChargeMore float64 `json:"charge_more"` // fee user need pay current (last update or create) SolanaDepositAddress string `json:"solana_deposit_address"` SolanaDepositPrivKey string `json:"-"` FilecoinHash string `json:"filecoin_hash"` DepositChainId uint64 `json:"deposit_chain_id"` LastErrorMessage string `json:"last_error_message"` CurrentGroupFileId int64 `json:"current_group_file_id"` KbId string `json:"kb_id"` ThumbnailUrl string `json:"thumbnail_url"` UsageFee float64 `json:"usage_fee"` RagInsertFileRequest string `json:"rag_insert_file_request"` DomainUrl string `json:"domain_url"` } type KnowledgeBaseFile struct { gorm.Model KnowledgeBaseId uint `json:"knowledge_base_id"` FileUrl string `json:"file_url"` FileName string `json:"name"` FileSize uint `json:"size"` GroupFileId int64 `json:"group_file_id"` Status KnowledgeBaseFileStatus `json:"status"` FilecoinHash string `json:"filecoin_hash"` FilecoinHashRawData string `json:"filecoin_hash_raw_data"` TransferHash string `json:"transfer_hash"` LastErrorMessage string `json:"last_error_message"` FromUrl string `json:"from_url"` } type ListKnowledgeBaseRequest struct { UserAddress string `json:"user_address" form:"-"` AgentIds []uint `json:"agent_ids" form:"agent_ids"` Statuses []int64 `json:"statuses" form:"statuses"` } func (m *KnowledgeBase) FileUrls() []string { urls := []string{} for _, f := range m.KnowledgeBaseFiles { urls = append(urls, f.FileUrl) } return urls } func round(val float64, precision uint) float64 { ratio := math.Pow(10, float64(precision)) return math.Round(val*ratio) / ratio } func (m *KnowledgeBase) CalcChargeMore() float64 { unitPrice := 10 total := float64(0) for _, r := range m.KnowledgeBaseFiles { if r.Status == KnowledgeBaseFileStatusDone { continue } total += float64(r.FileSize) } price := total / 1_000_000 // 1 Megabyte is equal to 1000000 bytes (decimal). price = round(price, 0) if price == 0 { price = 1 } return price * float64(unitPrice) } type RagResult struct { Ref string `json:"ref"` Kb string `json:"kb"` Identifier string `json:"identifier"` Message string `json:"message"` } type RagHookResponse struct { Result *RagResult `json:"result"` Error *string `json:"error"` Status string `json:"status"` } type InsertRagResponse struct { Result string `json:"result"` Error *string `json:"error"` Status string `json:"status"` } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/models/launchpad.go ================================================ package models import ( "time" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/types/numeric" "github.com/jinzhu/gorm" ) type LaunchpadStatus string type LaunchpadTier string const ( LaunchpadStatusNew LaunchpadStatus = "new" LaunchpadStatusRunning LaunchpadStatus = "running" LaunchpadStatusEnd LaunchpadStatus = "end" LaunchpadStatusFailed LaunchpadStatus = "failed" LaunchpadStatusDone LaunchpadStatus = "done" LaunchpadStatusCancelled LaunchpadStatus = "cancelled" LaunchpadStatusTokenError LaunchpadStatus = "token_error" LaunchpadStatusTokenCreated LaunchpadStatus = "token_created" LaunchpadStatusSettleError LaunchpadStatus = "settle_error" LaunchpadStatusSettled LaunchpadStatus = "settled" LaunchpadStatusTge LaunchpadStatus = "tge" LaunchpadStatusPoolError LaunchpadStatus = "pool_error" LaunchpadTier1 LaunchpadTier = "Tier 1" LaunchpadTier2 LaunchpadTier = "Tier 2" LaunchpadTier3 LaunchpadTier = "Tier 3" ) type Launchpad struct { gorm.Model NetworkID uint64 TwitterPostID uint `gorm:"unique_index"` TweetId string `gorm:"unique_index"` Name string Description string `gorm:"type:text"` TwitterId string TwitterUsername string TwitterName string Address string LastScanID string Status LaunchpadStatus `gorm:"index"` AgentSnapshotMissionID uint AgentSnapshotMission *AgentSnapshotMission StartAt *time.Time EndAt *time.Time `gorm:"index"` FinishedAt *time.Time FundBalance numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` TotalBalance numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` SettleFundTxHash string CancelFundTxHash string AddLiquidityTxHash string TokenAddress string `gorm:"index"` TokenName string TokenSymbol string TokenImageUrl string TotalSupply numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` DeployTokenTxHash string TgeBalance numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` MaxFundBalance numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` RefundBalance numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` StartTweetId string EndTweetId string } type LaunchpadMemberStatus string const ( LaunchpadMemberStatusNew LaunchpadMemberStatus = "new" LaunchpadMemberStatusTgeDone LaunchpadMemberStatus = "tge_done" LaunchpadMemberStatusTgeError LaunchpadMemberStatus = "tge_error" LaunchpadMemberStatusDone LaunchpadMemberStatus = "done" LaunchpadMemberStatusRefundError LaunchpadMemberStatus = "refund_error" ) type LaunchpadMember struct { gorm.Model NetworkID uint64 UserAddress string `gorm:"unique_index:lp_member_main_idx"` TwitterID string `gorm:"unique_index:lp_member_main_idx"` LaunchpadID uint `gorm:"unique_index:lp_member_main_idx"` Launchpad *Launchpad TweetID string TweetContent string `gorm:"type:longtext"` Tier LaunchpadTier ReplyContent string `gorm:"type:longtext"` ReplyPostAt *time.Time ReplyPostID string Error string `gorm:"type:longtext"` FundBalance numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` MaxFundBalance numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` TotalBalance numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` RefundBalance numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` RefundFeeBalance numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` TokenBalance numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` TokenTransferTxHash string RefundTransferTxHash string Status LaunchpadMemberStatus `gorm:"default:'new'"` } type LaunchpadTransactionType string type LaunchpadTransactionStatus string const ( LaunchpadTransactionTypeDeposit LaunchpadTransactionType = "deposit" LaunchpadTransactionTypeRefund LaunchpadTransactionType = "refund" LaunchpadTransactionStatusDone LaunchpadTransactionStatus = "done" ) type LaunchpadTransaction struct { gorm.Model NetworkID uint64 EventId string `gorm:"unique_index"` TxHash string Type LaunchpadTransactionType LaunchpadID uint UserAddress string Amount numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` Fee numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` Status LaunchpadTransactionStatus } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/models/llm_model.go ================================================ package models import ( "github.com/sashabaranov/go-openai" ) type ChatCompletionStreamResponse struct { openai.ChatCompletionStreamResponse `json:",inline"` Message string `json:"message"` Code int `json:"code"` OnchainData CompletionOnChainData `json:"onchain_data"` } type CompletionOnChainData struct { InferID string `json:"infer_id"` AssignmentAddresses []string `json:"pbft_committee"` SubmitAddress string `json:"proposer"` InferTx string `json:"infer_tx"` SubmitTx string `json:"propose_tx"` SeizeMinerTx string `json:"-"` InputCid string `json:"input_cid"` OutputCid string `json:"output_cid"` } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/models/meme.go ================================================ package models import ( "time" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/types/numeric" "github.com/jinzhu/gorm" ) type MemeStatus string type TransferStatus string type NotiType string type ChartType string type MemeCatStatus string const ( MemeStatusPending MemeStatus = "pending" MemeStatusNew MemeStatus = "new" MemeStatusCreated MemeStatus = "created" MemeStatusAddPoolLevel0 MemeStatus = "add_pool_0" MemeStatusAddPoolLevel1 MemeStatus = "add_pool_1" MemeStatusReachedMC MemeStatus = "reached_mc" MemeStatusRemovePoolLelve1 MemeStatus = "remove_pool_1" MemeStatusAddPoolLevel2 MemeStatus = "add_pool_2" MemeStatusAddPoolExternal MemeStatus = "add_pool_external" MemeCatStatusProcessing MemeCatStatus = "processing" MemeCatStatusDone MemeCatStatus = "done" ChartTypeHour1 ChartType = "1h" ChartTypeHour4 ChartType = "4h" ChartTypeDay ChartType = "1d" ChartTypeMin30 ChartType = "30min" ChartTypeMin5 ChartType = "5min" TransferStatusPending TransferStatus = "pending" TransferStatusDone TransferStatus = "done" NotiTypeNewMeme NotiType = "new_meme" NotiTypePrice NotiType = "price_pump" NotiTypeReachMC NotiType = "reached_mc" NotiTypeTradeOnNaka NotiType = "trade_on_naka" NotiTypeNewFollower NotiType = "new_follower" ) type Meme struct { gorm.Model NetworkID uint64 OwnerAddress string `gorm:"index"` OwnerID uint `gorm:"index"` Owner *User AgentInfoID uint `gorm:"unique_index"` AgentInfo *AgentInfo TokenAddress string `gorm:"index"` TokenId string `gorm:"index"` FactoryAddress string TotalSuply numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` Decimals uint64 Name string Ticker string Description string `gorm:"type:longtext collate utf8mb4_unicode_ci"` Err string `gorm:"type:text collate utf8mb4_unicode_ci"` Image string Twitter string Telegram string Website string Status MemeStatus `gorm:"index"` Pool string `gorm:"index"` UniswapPool string `gorm:"index"` Token0Address string Token1Address string Reserve0 numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` Reserve1 numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` Supply numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` Price numeric.BigFloat `gorm:"index;type:decimal(36,18);default:0"` PriceUsd numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` PriceLast24h numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` VolumeLast24h numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` TotalVolume numeric.BigFloat `gorm:"index;type:decimal(36,18);default:0"` TimeIndex uint64 BaseTokenIndex int ZeroForOne bool BaseTokenSymbol string `gorm:"default:'ETH'"` ReplyCount uint64 `gorm:"index;default:0"` LastReply *time.Time `gorm:"index"` PositionID int64 `gorm:"default:0"` UniswapPositionID int64 `gorm:"default:0"` Liquidity numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` PositionLiquidity numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` TickLower int64 TickUpper int64 Tick int64 AddPool1TxHash string RemovePool1TxHash string AddPool2TxHash string AddPool2At *time.Time `gorm:"index"` BurnPool2TxHash string BurnPool2At *time.Time `gorm:"index"` PoolFee uint Weight int `gorm:"index;default:0"` Shared int ReqSyncAt *time.Time SyncAt *time.Time Fee numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` ExternalTradeUrl string NumRetries int `gorm:"default:0"` NotGraduated bool `gorm:"default:0"` Fees0CollectedBalance numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` Fees1CollectedBalance numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` FeesCollectedUpdated uint64 `gorm:"default:0"` PoolSwappedUpdated uint64 `gorm:"default:0"` // Percent float64 `gorm:"-"` StoreImageOnChain bool MarketCap numeric.BigFloat `gorm:"-"` TotalBalance numeric.BigFloat `gorm:"-"` Holders int `gorm:"-"` LatestAgentTwitterPost *AgentTwitterPost `gorm:"-"` } type MemeTradeHistory struct { gorm.Model NetworkID uint64 TxHash string `gorm:"index"` ContractAddress string `gorm:"index"` EventId string `gorm:"unique_index:pump_trade_histories_main_idx"` TxAt time.Time RecipientAddress string `gorm:"index"` RecipientUserID uint `gorm:"index"` RecipientUser *User Amount0 numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` Amount1 numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` SqrtPriceX96 string Liquidity numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` Tick int64 Price numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` MemeTokenAddress string `gorm:"index"` TokenId string `gorm:"index"` MemeID uint `gorm:"index"` Meme *Meme TokenInAddress string TokenIn *Meme `gorm:"foreignKey:contract_address_check;AssociationForeignKey:token_in_address"` AmountIn numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` TokenOutAddress string `gorm:"index"` TokenOut *Meme `gorm:"foreignKey:contract_address_check;AssociationForeignKey:token_out_address"` AmountOut numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` BaseTokenSymbol string `gorm:"default:'BTC'"` BaseTokenPrice numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` BaseAmount numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` TokenAmount numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` IsBuy bool } type MemeThreads struct { gorm.Model UserID uint `gorm:"index"` User *User MemeID uint `gorm:"index"` Meme *Meme Text string `gorm:"type:longtext collate utf8mb4_unicode_ci"` ImageUrl string Likes int64 ParentThreadID uint `gorm:"index"` Hidden bool `gorm:"default:0"` Liked bool `gorm:"-"` } type MemeWhiteListAddress struct { gorm.Model Address string `gorm:"index"` } type MemeThreadLike struct { gorm.Model UserID uint `gorm:"unique_index:meme_thread_like_main_idx"` ThreadID uint `gorm:"unique_index:meme_thread_like_main_idx"` } type MemeFollowers struct { gorm.Model UserID uint `gorm:"unique_index:meme_followers_main_idx"` User *User FollowUserID uint `gorm:"unique_index:meme_followers_main_idx"` FollowUser *User } type MemeTokenHolder struct { gorm.Model ContractAddress string `gorm:"unique_index:token_holder_main_uidx"` Address string `gorm:"unique_index:token_holder_main_uidx"` Balance numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` UserName string `gorm:"-"` ImageURL string `gorm:"-"` MemeName string `gorm:"-"` MemeTicker string `gorm:"-"` MemeImage string `gorm:"-"` MemePrice numeric.BigFloat `gorm:"-"` MemePriceUsd numeric.BigFloat `gorm:"-"` MemeBaseTokenSymbol string `gorm:"-"` } type MemeNotification struct { gorm.Model EventId string `gorm:"unique_index:meme_notification_main_idx"` UserID uint `gorm:"index;default:0"` User *User MemeID uint `gorm:"index;default:0"` Meme *Meme FollowerID uint `gorm:"index;default:0"` Follower *User NotiType NotiType Value string `gorm:"type:longtext"` Seen bool `gorm:"index;default:0"` } type MemeNotificationSeen struct { gorm.Model NotificationID uint `gorm:"unique_index:meme_notification_seen_main_idx"` UserID uint `gorm:"unique_index:meme_notification_seen_main_idx"` Seen bool `gorm:"index;default:0"` } type ChartData struct { PairID string `json:"pair_id"` AvgPrice numeric.BigFloat `json:"avg_price"` MinPrice numeric.BigFloat `json:"min_price"` MaxPrice numeric.BigFloat `json:"max_price"` BaseVolume numeric.BigFloat `json:"base_volume"` TokenVolume numeric.BigFloat `json:"token_volume"` OpenPrice numeric.BigFloat `json:"open_price"` ClosePrice numeric.BigFloat `json:"close_price"` ChartTime *time.Time `json:"chart_time"` } type MemeSeen struct { gorm.Model UserID uint `gorm:"unique_index:meme_seen_main_idx"` UserAddress string `gorm:"index"` MemeID uint `gorm:"unique_index:meme_seen_main_idx"` MemeAddress string `gorm:"index"` SeenTime *time.Time `gorm:"index"` } type Cat20TransferTransaction struct { gorm.Model TokenId string ReceiverAddress string SendAmount numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` SenderAddress string `gorm:"index"` TxHash string `gorm:"index"` TxAt *time.Time Error string } type TokenTransfer struct { gorm.Model NetworkID uint64 EventId string `gorm:"unique_index"` ContractAddress string `gorm:"index"` TransactionAt *time.Time `gorm:"index"` TxHash string From string `gorm:"index"` To string `gorm:"index"` Value numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` Name string `gorm:"-"` Ticker string `gorm:"-"` Image string `gorm:"-"` TwitterID string `gorm:"-"` TwitterName string `gorm:"-"` TwitterUsername string `gorm:"-"` TwitterAvatar string `gorm:"-"` UserTwitterID string `gorm:"-"` UserName string `gorm:"-"` ImageURL string `gorm:"-"` } type Bot struct { gorm.Model NetworkID uint64 Address string } type BotOrderType string type BotOrderStatus string const ( BotOrderTypeBuyAfterCreated BotOrderType = "buy_after_created" BotOrderTypeBuy BotOrderType = "buy" BotOrderTypeSell BotOrderType = "sell" BotOrderStatusNew BotOrderStatus = "new" BotOrderStatusDepositing BotOrderStatus = "depositing" BotOrderStatusDone BotOrderStatus = "done" BotOrderStatusPoolled BotOrderStatus = "poolled" BotOrderStatusError BotOrderStatus = "error" ) type BotOrder struct { gorm.Model NetworkID uint64 Address string Type BotOrderType ScheduledAt *time.Time MemeID uint TokenIn string TokenOut string AmountIn numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` AmountOut numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` Price numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` ParentPrice numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` UniFee uint `gorm:"default:0"` DepositHash string TxHash string PoolledHash string Status BotOrderStatus ParentID uint Error string } type MemeFeesCollected struct { gorm.Model EventId string `gorm:"unique_index"` MemeID uint `gorm:"index"` TxHash string Amount0 numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` Amount1 numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/models/mission_store.go ================================================ package models import ( "time" "github.com/jinzhu/gorm" ) type ( OutputType string ) const ( OutputTypeTwitter OutputType = "twitter" OutputTypeOthers OutputType = "others" ) type MissionStore struct { gorm.Model Name string Description string `gorm:"type:text"` UserPrompt string `gorm:"type:longtext"` Price uint OwnerAddress string ToolList string `gorm:"type:longtext"` Rating float64 `gorm:"type:decimal(5,2);default:0"` NumRating uint NumUsed uint Icon string `gorm:"type:text"` OutputType OutputType Params string `gorm:"type:longtext"` //[{"name" : "token", "type" : "text", "description" : "this token is used to authenticate in xxx server side"}] } type MissionStoreHistory struct { gorm.Model UserAddress string MissionStoreID uint MissionStore *MissionStore TxHash string EventId string `gorm:"unique_index"` StartedAt *time.Time ExpiresAt *time.Time IsRated bool } type MissionStoreRating struct { gorm.Model UserAddress string MissionStoreID uint `gorm:"unique_index:mission_store_rating_main_uidx"` MissionStore *MissionStore AgentSnapshotPostID uint `gorm:"unique_index:mission_store_rating_main_uidx"` AgentSnapshotPost AgentSnapshotPost Rating float64 `gorm:"type:decimal(5,2);default:0"` Comment string `gorm:"type:longtext"` } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/models/models.go ================================================ package models import ( "errors" "fmt" "math" "math/big" "math/rand" "strconv" "strings" "time" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/configs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/helpers" "github.com/shopspring/decimal" ) const ( ETH_ZERO_ADDRESS = "0x0000000000000000000000000000000000000000" BURN_ADDRESS = "0x000000000000000000000000000000000000dEaD" GENERTAL_NETWORK_ID = 0 ETHEREUM_NETWORK_ID = 1 DURATION_1D = 24 * 3600 DURATION_30D = 30 * 24 * 3600 DURATION_90D = 90 * 24 * 3600 LOCAL_CHAIN_ID = uint64(1337) ETERNAL_AI_CHAIN_ID = uint64(43338) BTC_CHAIN_ID = uint64(0) ETHEREUM_CHAIN_ID = uint64(1) FANS_CHAIN_ID = uint64(45761) BASE_CHAIN_ID = uint64(8453) SHARDAI_CHAIN_ID = uint64(222671) SOLANA_CHAIN_ID = uint64(1111) SOLANA_CHAIN_ID_OLD = uint64(101) HERMES_CHAIN_ID = uint64(45762) ARBITRUM_CHAIN_ID = uint64(42161) ZKSYNC_CHAIN_ID = uint64(324) POLYGON_CHAIN_ID = uint64(137) BSC_CHAIN_ID = uint64(56) SEPOLIA_CHAIN_ID = uint64(11155111) DAGI_CHAIN_ID = uint64(222672) APE_CHAIN_ID = uint64(33139) AVALANCHE_C_CHAIN_ID = uint64(43114) ABSTRACT_TESTNET_CHAIN_ID = uint64(11124) BITTENSOR_CHAIN_ID = uint64(964) DUCK_CHAIN_ID = uint64(5545) TRON_CHAIN_ID = uint64(728126428) MODE_CHAIN_ID = uint64(34443) ZETA_CHAIN_ID = uint64(7000) STORY_CHAIN_ID = uint64(1514) HYPE_CHAIN_ID = uint64(999) MONAD_TESTNET_CHAIN_ID = uint64(10143) MEGAETH_TESTNET_CHAIN_ID = uint64(1338) BASE_SEPOLIA_CHAIN_ID = uint64(84532) CELO_CHAIN_ID = uint64(42220) LOWER_PRICE_USD = 2800 UPPER_PRICE_USD = 1000000000 TOKEN_SUPPLY = 1000000000 ) var CHAIN_NAME_MAP = map[uint64]string{ BASE_CHAIN_ID: "BASE", SHARDAI_CHAIN_ID: "BITCOIN", FANS_CHAIN_ID: "FANS", ETHEREUM_CHAIN_ID: "ETHEREUM", HERMES_CHAIN_ID: "SYMBIOSIS", ARBITRUM_CHAIN_ID: "ARBITRUM", SOLANA_CHAIN_ID: "SOLANA", ZKSYNC_CHAIN_ID: "ZKSYNC", POLYGON_CHAIN_ID: "POLYGON", BSC_CHAIN_ID: "BSC", SEPOLIA_CHAIN_ID: "SEPOLIA", APE_CHAIN_ID: "APECHAIN", AVALANCHE_C_CHAIN_ID: "AVALANCHE C-CHAIN", ABSTRACT_TESTNET_CHAIN_ID: "ABSTRACT TESTNET", BITTENSOR_CHAIN_ID: "BITTENSOR", DUCK_CHAIN_ID: "DUCK CHAIN", TRON_CHAIN_ID: "TRON", MODE_CHAIN_ID: "MODE", LOCAL_CHAIN_ID: "LOCAL", ZETA_CHAIN_ID: "ZETA", STORY_CHAIN_ID: "STORY", HYPE_CHAIN_ID: "HYPER EVM", MONAD_TESTNET_CHAIN_ID: "MONAD TESTNET", MEGAETH_TESTNET_CHAIN_ID: "MEGAETH TESTNET", BASE_SEPOLIA_CHAIN_ID: "BASE SEPOLIA", CELO_CHAIN_ID: "CELO", } var MAP_TOOLSET_NAME = map[string]string{ "": "Default", "default": "Default", "reply_mentions": "Reply", "reply_mentions_farcaster": "Reply", "shadow_reply": "Reply", "reply_non_mentions_farcaster": "Engage", "follow": "Follow", "post": "Post", "post_farcaster": "Post", "lucky_moneys": "Airdrop", "trade_analytics_twitter": "Trading Analytics", "trade_analytics_mentions": "Trading Analytics", } var MAP_CHAIN_ID_TO_LLM_MODEL = map[uint64]map[string]string{ DAGI_CHAIN_ID: { // AGI chain "neuralmagic/Meta-Llama-3.1-405B-Instruct-quantized.w4a16": "200001", }, BASE_CHAIN_ID: { // Base chain "NousResearch/Hermes-3-Llama-3.1-70B-FP8": "700002", "neuralmagic/Meta-Llama-3.1-405B-Instruct-quantized.w4a16": "700001", }, HERMES_CHAIN_ID: { // uncensored chain "NousResearch/Hermes-3-Llama-3.1-70B-FP8": "500001", "unsloth/Llama-3.3-70B-Instruct-bnb-4bit": "500006", "PrimeIntellect/INTELLECT-1-Instruct": "500007", }, SHARDAI_CHAIN_ID: { "NousResearch/Hermes-3-Llama-3.1-70B-FP8": "600001", }, ARBITRUM_CHAIN_ID: { "NousResearch/Hermes-3-Llama-3.1-70B-FP8": "110001", }, ZKSYNC_CHAIN_ID: { "NousResearch/Hermes-3-Llama-3.1-70B-FP8": "120001", }, POLYGON_CHAIN_ID: { "NousResearch/Hermes-3-Llama-3.1-70B-FP8": "130001", }, SOLANA_CHAIN_ID: { "NousResearch/Hermes-3-Llama-3.1-70B-FP8": "990001", }, APE_CHAIN_ID: { "NousResearch/Hermes-3-Llama-3.1-70B-FP8": "990001", }, AVALANCHE_C_CHAIN_ID: { "NousResearch/Hermes-3-Llama-3.1-70B-FP8": "990001", }, ABSTRACT_TESTNET_CHAIN_ID: { "NousResearch/Hermes-3-Llama-3.1-70B-FP8": "990001", }, } func ONE_ETHER() *big.Int { return big.NewInt(1e18) } func ParseBool(v string) bool { ok, err := strconv.ParseBool(v) if err != nil { panic(err) } return ok } func ConvertFloatToReserveAmount(amt float64) uint64 { if amt < 0 { panic("invalid amount") } return decimal.NewFromFloat(amt).Shift(2).Truncate(0).BigInt().Uint64() } func ConvertPriceAmount(amt float64) float64 { if amt < 0 { panic("invalid amount") } amt, _ = decimal.NewFromFloat(amt).Round(8).Float64() return amt } func ValidateFiatAmount(amt float64) error { if amt < 0 { return errors.New("invalid amount") } if amt != ConvertFiatAmount(amt) { return errors.New("fiat amount is invalid") } return nil } func ConvertFiatAmount(amt float64) float64 { if amt < 0 { panic("invalid amount") } amt, _ = decimal.NewFromFloat(amt).Round(2).Float64() return amt } func ValidateNftCurrencyAmount(amt float64, decimals uint) error { if amt < 0 { return errors.New("amount is small than 0") } newAmt, _ := decimal.NewFromFloat(amt).Round(int32(decimals)).Float64() if newAmt != amt { return errors.New("amount is invalid decimals") } return nil } func ConvertNumberFloat(amt float64, decimals uint) float64 { if amt < 0 { panic(errors.New("amount is small than 0")) } newAmt, _ := decimal.NewFromFloat(amt).Round(int32(decimals)).Float64() return newAmt } func ConvertWeiToBigFloat(amt *big.Int, decimals uint) *big.Float { if amt == nil { return big.NewFloat(0.0) } // if amt.Cmp(big.NewInt(0)) < 0 { // panic(errors.New("amount is small than 0")) // } amtFloat := new(big.Float).SetPrec(1024).SetInt(amt) decimalFloat := new(big.Float).SetPrec(1024).SetInt(new(big.Int).Exp(big.NewInt(10), big.NewInt(int64(decimals)), nil)) retFloat := new(big.Float).Quo(amtFloat, decimalFloat) return retFloat } func ConvertWeiStringToBigFloat(amtString string, decimals uint) *big.Float { if amtString == "s" { return big.NewFloat(0.0) } amt, ok := new(big.Int).SetString(amtString, 10) if !ok { panic("not Ok") } if amt.Cmp(big.NewInt(0)) < 0 { panic(errors.New("amount is small than 0")) } amtFloat := new(big.Float).SetPrec(1024).SetInt(amt) decimalFloat := new(big.Float).SetPrec(1024).SetInt(new(big.Int).Exp(big.NewInt(10), big.NewInt(int64(decimals)), nil)) retFloat := new(big.Float).Quo(amtFloat, decimalFloat) return retFloat } func ConvertStringToBigFloat(amtString string) *big.Float { if amtString == "s" { return big.NewFloat(0.0) } amt, ok := new(big.Float).SetPrec(1024).SetString(amtString) if !ok { panic("not Ok") } return amt } func ConvertWeiToBigFloatNegative(amt *big.Int, decimals uint) *big.Float { // if amt.Cmp(big.NewInt(0)) < 0 { // panic(errors.New("amount is small than 0")) // } if amt == nil { return big.NewFloat(0.0) } amtFloat := new(big.Float).SetPrec(1024).SetInt(amt) decimalFloat := new(big.Float).SetPrec(1024).SetInt(new(big.Int).Exp(big.NewInt(10), big.NewInt(int64(decimals)), nil)) retFloat := new(big.Float).Quo(amtFloat, decimalFloat) return retFloat } func ConvertBigFloatToWei(amt *big.Float, decimals uint) *big.Int { if amt.Cmp(big.NewFloat(0)) < 0 { panic(errors.New("amount is small than 0")) } newAmt, err := decimal.NewFromString(amt.Text('f', 64)) if err != nil { panic(err) } newAmt = newAmt.Shift(int32(decimals)).Truncate(0) return newAmt.BigInt() } func ConvertBigFloatToWeiFull(amt *big.Float, decimals uint) *big.Int { newAmt, err := decimal.NewFromString(amt.Text('f', 64)) if err != nil { panic(err) } newAmt = newAmt.Shift(int32(decimals)).Truncate(0) return newAmt.BigInt() } func ConvertCryptoCurrencyAmount(amt float64) float64 { if amt < 0 { panic("invalid amount") } amt, _ = decimal.NewFromFloat(amt).Round(8).Float64() return amt } func ConvertReserveAmountToFloat(reserveAmt uint64) float64 { amt, _ := decimal.New(int64(reserveAmt), -2).Float64() return amt } func ConvertFloatToCollateralAmount(amt float64) uint64 { if amt < 0 { panic("amount invalid") } return decimal.NewFromFloat(amt).Shift(8).Truncate(0).BigInt().Uint64() } func ParseString2FloatAmountArr(s, sep string) []float64 { rets := []float64{} s = strings.TrimSpace(s) if s != "" { ss := strings.Split(s, sep) if len(ss) > 0 { for _, n := range ss { dm, err := decimal.NewFromString(n) if err != nil { panic(err) } val, _ := dm.Truncate(2).Float64() rets = append(rets, val) } } } return rets } func MulFloats(val1 float64, vals ...float64) float64 { val := decimal.NewFromFloat(val1) for _, v := range vals { val = val.Mul(decimal.NewFromFloat(v)) } num, _ := val.Float64() return num } func DivFloats(val1 float64, vals ...float64) float64 { val := decimal.NewFromFloat(val1) for _, v := range vals { val = val.Div(decimal.NewFromFloat(v)) } num, _ := val.Float64() return num } func AddFloats(val1 float64, vals ...float64) float64 { val := decimal.NewFromFloat(val1) for _, v := range vals { val = val.Add(decimal.NewFromFloat(v)) } num, _ := val.Float64() return num } func SubFloats(val1 float64, vals ...float64) float64 { val := decimal.NewFromFloat(val1) for _, v := range vals { val = val.Sub(decimal.NewFromFloat(v)) } num, _ := val.Float64() return num } func ConvertStringToFloat(s string) (float64, error) { num, err := decimal.NewFromString(s) if err != nil { return 0, err } amount, _ := num.Float64() return amount, nil } func ConvertString2BigInt(s string) (*big.Int, error) { n, ok := big.NewInt(0).SetString(s, 10) if !ok { return nil, fmt.Errorf("%s is not number", s) } return n, nil } func ConvertStringNumber2BigInt(s string) *big.Int { n, ok := big.NewInt(0).SetString(s, 10) if !ok { panic(fmt.Errorf("%s is not number", s)) } return n } func ToEtherPriceFiatAmount(num big.Float, pr float64) float64 { rs, _ := big.NewFloat(0).Mul(&num, big.NewFloat(pr)).Float64() return ConvertFiatAmount(rs) } func ToEtherAmount(e *big.Int) big.Float { if e == nil { return big.Float{} } return *decimal.NewFromBigInt(e, -18).BigFloat() } func ToEtherWeiAmount(num big.Float) big.Int { dn, err := decimal.NewFromString(big.NewFloat(0).Mul(&num, big.NewFloat(1e18)).String()) if err != nil { panic(err) } return *dn.BigInt() } func ToBigInt(s string) big.Int { if s == "" { return big.Int{} } n, ok := big.NewInt(0).SetString(s, 10) if !ok { panic(errors.New("numer is invalid")) } return *n } func Number2BigInt(s string, decimals int) *big.Int { dn, err := decimal.NewFromString(s) if err != nil { panic(err) } dn = dn.Shift(int32(decimals)).Round(0) return dn.BigInt() } func MulBigFloats(val1 *big.Float, vals ...*big.Float) *big.Float { val := val1 for _, v := range vals { val = new(big.Float).Mul(val, v) } return val } func MulBigInts(val1 *big.Int, vals ...*big.Int) *big.Int { val := val1 for _, v := range vals { val = new(big.Int).Mul(val, v) } return val } func MinBigInts(val1 *big.Int, vals ...*big.Int) *big.Int { val := val1 for _, v := range vals { if val.Cmp(v) > 0 { val = v } } return val } func MaxBigInts(val1 *big.Int, vals ...*big.Int) *big.Int { val := val1 for _, v := range vals { if val.Cmp(v) < 0 { val = v } } return val } func MaxBigFloats(val1 *big.Float, vals ...*big.Float) *big.Float { val := val1 for _, v := range vals { if val.Cmp(v) < 0 { val = v } } return val } func AddBigFloats(val1 *big.Float, vals ...*big.Float) *big.Float { val := val1 for _, v := range vals { val = new(big.Float).Add(val, v) } return val } func AddBigInts(val1 *big.Int, vals ...*big.Int) *big.Int { val := val1 for _, v := range vals { val = new(big.Int).Add(val, v) } return val } func SubBigFloats(val1 *big.Float, vals ...*big.Float) *big.Float { val := val1 for _, v := range vals { val = new(big.Float).Sub(val, v) } return val } func SubBigInts(val1 *big.Int, vals ...*big.Int) *big.Int { val := val1 for _, v := range vals { val = new(big.Int).Sub(val, v) } return val } func QuoBigFloats(val1 *big.Float, vals ...*big.Float) *big.Float { val := val1 for _, v := range vals { if v.Cmp(big.NewFloat(0)) == 0 { panic(errors.New("divide zero")) } val = new(big.Float).Quo(val, v) } return val } func QuoBigInts(val1 *big.Int, vals ...*big.Int) *big.Int { val := val1 for _, v := range vals { if v.Cmp(big.NewInt(0)) == 0 { panic(errors.New("divide zero")) } val = new(big.Int).Quo(val, v) } return val } func EqualBigFloats(val1 *big.Float, val2 *big.Float) bool { return val1.Text('f', 64) == val2.Text('f', 64) } func NegativeBigFloat(val *big.Float) *big.Float { return SubBigFloats(big.NewFloat(0), val) } func FormatFloatNumber(f string, amt float64) string { return FormatStringNumber(fmt.Sprintf(f, amt)) } func FormatStringNumber(amt string) string { if strings.Contains(amt, ".") { amt = strings.TrimRight(amt, "0") amt = strings.TrimRight(amt, ".") } return amt } func FormatBigFloatNumber(amt *big.Float) string { return FormatStringNumber(amt.Text('f', 64)) } func FormatEmailTime(t *time.Time) string { if t == nil { return "" } return t.Format("2006-01-02 15:04:05") } func ConvertSqrtPriceX96ToPrice(amt *big.Int, decimals uint) *big.Float { // if amt.Cmp(big.NewInt(0)) < 0 { // panic(errors.New("amount is small than 0")) // } pow := new(big.Int).Exp(amt, big.NewInt(2), nil) x96 := new(big.Int).Exp(big.NewInt(2), big.NewInt(192), nil) powFloat := new(big.Float).SetPrec(1024).SetInt(pow) x96Float := new(big.Float).SetPrec(1024).SetInt(x96) retFloat := new(big.Float).Quo(powFloat, x96Float) return retFloat } func ConvertX96ToNumber(amt *big.Int, decimals uint) *big.Float { // if amt.Cmp(big.NewInt(0)) < 0 { // panic(errors.New("amount is small than 0")) // } // pow := new(big.Int).Exp(amt, big.NewInt(2), nil) x96 := new(big.Int).Exp(big.NewInt(2), big.NewInt(96), nil) powFloat := new(big.Float).SetPrec(1024).SetInt(amt) x96Float := new(big.Float).SetPrec(1024).SetInt(x96) retFloat := new(big.Float).Quo(powFloat, x96Float) return retFloat } func EtherToWeiWithDecimals(eth *big.Float, decimals int) *big.Int { return ConvertBigFloatToWei(eth, uint(decimals)) } func EtherToWei(eth *big.Float) *big.Int { return ConvertBigFloatToWei(eth, 18) } func RoundHalfUp(num *big.Float, decimals int) *big.Float { scale := new(big.Float).SetInt(new(big.Int).Exp(big.NewInt(10), big.NewInt(int64(decimals)), nil)) scaled := new(big.Float).Mul(num, scale) roundedInt, _ := scaled.Int(nil) // Extract the *big.Int value roundedFloat := new(big.Float).SetInt(roundedInt) quotient := new(big.Float).Quo(roundedFloat, scale) return quotient } func AbsBigFloat(val *big.Float) *big.Float { return new(big.Float).Abs(val) } func ConvertSqrtPriceX96ToPriceEx(amt *big.Int, decimals uint, zeroForOne bool) *big.Float { pow := new(big.Int).Exp(amt, big.NewInt(2), nil) x96 := new(big.Int).Exp(big.NewInt(2), big.NewInt(192), nil) powFloat := new(big.Float).SetPrec(1024).SetInt(pow) x96Float := new(big.Float).SetPrec(1024).SetInt(x96) retFloat := new(big.Float).Quo(powFloat, x96Float) if zeroForOne { retFloat = QuoBigFloats( big.NewFloat(1), retFloat, ) } return retFloat } func GetAlphaDBName() string { dbName := "dev_nbc_perp" if configs.GetConfig().Env == "mainnet" { dbName = "prod_nbc_perp" } return dbName } func IsNativeToken(tokenAddress string) bool { return strings.EqualFold("0x0000000000000000000000000000000000000000", tokenAddress) } func PriceToTick(price float64, spacing int64) int64 { const base = 1.0001 tick := int64(math.Log(price) / math.Log(base)) return (tick / spacing) * spacing } func RandFloatInRage(min, max float64) float64 { return min + rand.New(rand.NewSource(time.Now().UnixNano())).Float64()*(max-min) } func RandSeed() uint64 { min := int(1) max := int(10e6) return uint64(rand.New(rand.NewSource(time.Now().UnixNano())).Intn(max-min+1) + min) } func GetSqrtPriceX96ForLiquidityAndAmount0(sqrtPriceX96AMin *big.Int, sqrtPriceX96BMax *big.Int, liquidity *big.Int, amountMax *big.Int) *big.Int { if sqrtPriceX96AMin.Cmp(sqrtPriceX96BMax) >= 0 { panic("wrong sqrtPriceX96A sqrtPriceX96b") } amountCheckMax := helpers.GetAmount0ForLiquidity(sqrtPriceX96AMin, sqrtPriceX96BMax, liquidity) if amountCheckMax.Cmp(amountMax) < 0 { return sqrtPriceX96AMin } sqrtPriceX96A := sqrtPriceX96AMin sqrtPriceX96B := sqrtPriceX96BMax var sqrtPriceX96 *big.Int for i := 0; i < 2560; i++ { sqrtPriceX96Tmp := QuoBigInts(AddBigInts(sqrtPriceX96A, sqrtPriceX96B), big.NewInt(2)) amount := helpers.GetAmount0ForLiquidity(sqrtPriceX96Tmp, sqrtPriceX96BMax, liquidity) if amount.Cmp(amountMax) <= 0 { if SubBigInts(amountMax, amount).Cmp(big.NewInt(10000)) <= 0 { sqrtPriceX96 = sqrtPriceX96Tmp break } sqrtPriceX96B = sqrtPriceX96Tmp } else { sqrtPriceX96A = sqrtPriceX96Tmp } } if sqrtPriceX96 == nil { panic("sqrtPriceX96 not found") } return sqrtPriceX96 } func GetSqrtPriceX96ForLiquidityAndAmount1(sqrtPriceX96AMin *big.Int, sqrtPriceX96BMax *big.Int, liquidity *big.Int, amountMax *big.Int) *big.Int { if sqrtPriceX96AMin.Cmp(sqrtPriceX96BMax) >= 0 { panic("wrong sqrtPriceX96A sqrtPriceX96b") } amountCheckMax := helpers.GetAmount1ForLiquidity(sqrtPriceX96AMin, sqrtPriceX96BMax, liquidity) if amountCheckMax.Cmp(amountMax) < 0 { return sqrtPriceX96BMax } sqrtPriceX96A := sqrtPriceX96AMin sqrtPriceX96B := sqrtPriceX96BMax var sqrtPriceX96 *big.Int for i := 0; i < 2560; i++ { sqrtPriceX96Tmp := QuoBigInts(AddBigInts(sqrtPriceX96A, sqrtPriceX96B), big.NewInt(2)) amount := helpers.GetAmount1ForLiquidity(sqrtPriceX96AMin, sqrtPriceX96Tmp, liquidity) if amount.Cmp(amountMax) <= 0 { if SubBigInts(amountMax, amount).Cmp(big.NewInt(10000)) <= 0 { sqrtPriceX96 = sqrtPriceX96Tmp break } sqrtPriceX96A = sqrtPriceX96Tmp } else { sqrtPriceX96B = sqrtPriceX96Tmp } } if sqrtPriceX96 == nil { panic("sqrtPriceX96 not found") } return sqrtPriceX96 } func GetChainName(chainID uint64) string { return CHAIN_NAME_MAP[chainID] } func GetChainID(chainName string) uint64 { switch strings.ToLower(chainName) { case "base": { return BASE_CHAIN_ID } case "ethereum": { return ETHEREUM_NETWORK_ID } case "solana": { return SOLANA_CHAIN_ID } case "arbitrum": { return ARBITRUM_CHAIN_ID } case "bsc", "bnbchain", "binancechain", "binance", "bnb": { return BSC_CHAIN_ID } case "polygon": { return POLYGON_CHAIN_ID } case "avax", "avalanche": { return AVALANCHE_C_CHAIN_ID } case "apechain", "ape_chain": { return APE_CHAIN_ID } case "zksync_era", "zksync": { return ZKSYNC_CHAIN_ID } case "abstract testnet", "abstract_testnet": { return ABSTRACT_TESTNET_CHAIN_ID } case "bittensor": { return BITTENSOR_CHAIN_ID } case "bitcoin": { return HERMES_CHAIN_ID } case "duck_chain", "duckchain": { return DUCK_CHAIN_ID } default: return GENERTAL_NETWORK_ID } } func GetTradeUrl(tokenNetworkID uint64, tokenAddress, dexID string) string { if tokenNetworkID == BASE_CHAIN_ID { return fmt.Sprintf(`https://app.uniswap.org/explore/tokens/base/%s`, tokenAddress) } else if tokenNetworkID == SOLANA_CHAIN_ID { if dexID == "raydium" { return fmt.Sprintf("https://raydium.io/swap/?inputMint=sol&outputMint=%s", tokenAddress) } else { return fmt.Sprintf("https://pump.fun/coin/%s", tokenAddress) } } else if tokenNetworkID == ARBITRUM_CHAIN_ID { return fmt.Sprintf(`https://app.camelot.exchange/?token1=0xDB8C67e6CA293F43C75e106c70b97033cC2909E3&token2=%s`, tokenAddress) } else if tokenNetworkID == BSC_CHAIN_ID { return fmt.Sprintf(`https://pancakeswap.finance/?outputCurrency=%s&inputCurrency=0x4B6bF1d365ea1A8d916Da37FaFd4ae8C86d061D7`, tokenAddress) } return "" } func GetDexUrl(tokenNetworkID uint64, tokenAddress string) string { if tokenAddress != "" { if tokenNetworkID == BASE_CHAIN_ID { return fmt.Sprintf(`https://dexscreener.com/base/%s`, tokenAddress) } else if tokenNetworkID == ARBITRUM_CHAIN_ID { return fmt.Sprintf(`https://dexscreener.com/arbitrum/%s`, tokenAddress) } else if tokenNetworkID == SOLANA_CHAIN_ID { return fmt.Sprintf(`https://dexscreener.com/solana/%s`, tokenAddress) } else if tokenNetworkID == BSC_CHAIN_ID { return fmt.Sprintf(`https://dexscreener.com/bsc/%s`, tokenAddress) } else if tokenNetworkID == APE_CHAIN_ID { return fmt.Sprintf(`https://dexscreener.com/apechain/%s`, tokenAddress) } } return "" } func GetImageUrl(imageUrl string) string { if strings.HasPrefix(imageUrl, "ipfs://") { imageUrl = strings.Replace(imageUrl, "ipfs://", "https://gateway.lighthouse.storage/ipfs/", -1) } return imageUrl } var ( ETERNALAI_LIQUIDITY_SUPPORTED_NETWORKS = []map[string]any{ { "network": "ETH", "name": "Ethereum", "icon": "https://eternalai.org/icons/coins/ic-eth.svg", "id": ETHEREUM_CHAIN_ID, "explorer": []map[string]any{ { "name": "EtherScan", "url": "https://etherscan.io/", "icon": "https://eternalai.org/icons/coins/ic-ether-scan.png", "okLink": "https://www.okx.com/web3/explorer/eth/", }, }, }, { "network": "BASE", "name": "Base", "icon": "https://eternalai.org/icons/blockchains/ic_base.svg", "id": BASE_CHAIN_ID, "explorer": []map[string]any{ { "name": "BaseScan", "url": "https://basescan.org/", "icon": "https://eternalai.org/icons/coins/ic-base-scan.png", "okLink": "https://www.okx.com/web3/explorer/base/", }, }, }, { "network": "ARBITRUM", "name": "Arbitrum", "icon": "https://eternalai.org/icons/blockchains/ic_arbitrum.svg", "id": ARBITRUM_CHAIN_ID, "explorer": []map[string]any{ { "name": "ArbitrumScan", "url": "https://arbiscan.io/", "icon": "https://eternalai.org/icons/blockchains/ic_arbitrum.svg", "okLink": "https://www.okx.com/web3/explorer/arbitrum/", }, }, }, { "network": "SOL", "name": "Solana", "icon": "https://eternalai.org/icons/blockchains/ic_solana.svg", "id": SOLANA_CHAIN_ID, "explorer": []map[string]any{ { "name": "SolScan", "url": "https://solscan.io/", "icon": "https://eternalai.org/icons/coins/ic-sol-scan.svg", "okLink": "https://www.okx.com/web3/explorer/sol/", }, }, }, { "network": "BSC", "name": "BNB Smart Chain", "icon": "https://eternalai.org/icons/coins/ic-bsc.png", "id": BSC_CHAIN_ID, "explorer": []map[string]any{ { "name": "BscScan", "url": "https://bscscan.com/", "icon": "https://eternalai.org/icons/coins/ic-bsc-scan.svg", "okLink": "https://www.okx.com/web3/explorer/bsc/", }, }, }, { "network": "APE", "name": "ApeChain", "icon": "https://eternalai.org/icons/coins/ic-ape.svg", "id": APE_CHAIN_ID, "explorer": []map[string]any{ { "name": "ApeScan", "url": "https://apescan.io/", "icon": "https://eternalai.org/icons/coins/ic-ape.svg", "okLink": "https://www.okx.com/web3/explorer/apechain/", }, }, }, { "network": "AVAX", "name": "Avalanche C-Chain", "icon": "https://eternalai.org/icons/blockchains/ic_avax.svg", "id": AVALANCHE_C_CHAIN_ID, "explorer": []map[string]any{ { "name": "AVAXScan", "url": "https://subnets.avax.network/c-chain", "icon": "https://eternalai.org/icons/blockchains/ic_avax.svg", "okLink": "https://www.okx.com/web3/explorer/avax/", }, }, }, { "network": "Celo", "name": "Celo", "icon": "https://eternalai.org/icons/blockchains/ic-celo.svg", "id": CELO_CHAIN_ID, "explorer": []map[string]any{ { "name": "CeloScan", "url": "https://celoscan.io/", "icon": "https://eternalai.org/icons/blockchains/ic-celo.svg", "okLink": "", }, }, }, } ) ================================================ FILE: agent-as-a-service/agent-orchestration/backend/models/robot.go ================================================ package models import ( "math/big" "time" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/types/numeric" "github.com/jinzhu/gorm" ) type RobotProject struct { gorm.Model ProjectID string `gorm:"unique_index"` ScanEnabled bool `gorm:"default:0"` TokenAddress string `gorm:"index"` TokenSymbol string TokenName string TokenImageUrl string TokenSupply numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` MintHash string Signature string TotalBalance numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` SolPrice *big.Float `gorm:"-"` } type RobotSaleWallet struct { gorm.Model ProjectID string `gorm:"unique_index:robot_sale_wallet_main_idx"` UserAddress string `gorm:"unique_index:robot_sale_wallet_main_idx"` SOLAddress string `gorm:"index"` SOLBalance numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` SOLOnchainBalance numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` SOLMovedBalance numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` IsSOLTransferring bool `gorm:"default:0"` SOLRequestAt *time.Time `gorm:"index"` SOLScanAt *time.Time `gorm:"index"` Ranking int `gorm:"default:0"` } type RobotTokenTransfer struct { gorm.Model ProjectID string `gorm:"index"` ReceiverAddress string `gorm:"index"` Amount numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` TransferAt *time.Time `gorm:"index"` TxHash string Status string Error string } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/models/sample_twiiter_app.go ================================================ package models import ( "github.com/jinzhu/gorm" ) type SampleTwitterApp struct { gorm.Model InstallCode string ApiKey string TwitterInfoID uint TwitterInfo *TwitterInfo } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/models/store_trading_app.go ================================================ package models import ( "github.com/jinzhu/gorm" ) type StoreDefiApp struct { gorm.Model InstallCode string `gorm:"unique_index"` ApiKey string `gorm:"unique_index"` SolAddress string `gorm:"unique_index"` } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/models/tokens.go ================================================ package models import ( "time" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/types/numeric" "github.com/jinzhu/gorm" ) type Erc20Holder struct { gorm.Model NetworkID uint64 `gorm:"unique_index:token_holder_main_uidx"` ContractAddress string `gorm:"unique_index:token_holder_main_uidx"` Address string `gorm:"unique_index:token_holder_main_uidx"` Balance string `gorm:"default:0"` UserName string `gorm:"-"` ImageURL string `gorm:"-"` MemeName string `gorm:"-"` MemeTicker string `gorm:"-"` MemeImage string `gorm:"-"` MemePrice numeric.BigFloat `gorm:"-"` MemePriceUsd numeric.BigFloat `gorm:"-"` MemeBaseTokenSymbol string `gorm:"-"` } type Erc721Holder struct { gorm.Model NetworkID uint64 `gorm:"unique_index:nft_holders_main_idx"` ContractAddress string `gorm:"unique_index:nft_holders_main_idx"` TokenID uint `gorm:"unique_index:nft_holders_main_idx"` OwnerAddress string `gorm:"index"` } type Erc1155Holder struct { gorm.Model NetworkID uint64 `gorm:"unique_index:nft_holders_main_idx"` ContractAddress string `gorm:"unique_index:nft_holders_main_idx"` TokenID uint `gorm:"unique_index:nft_holders_main_idx"` Address string `gorm:"unique_index:nft_holders_main_idx"` Balance string `gorm:"default:0"` } type TrendingToken struct { gorm.Model ChainId string `gorm:"unique_index:trending_token_main_idx"` TokenAddress string `gorm:"unique_index:trending_token_main_idx"` Name string Symbol string `gorm:"index"` Decimals int Logo string UsdPrice float64 MarketCap float64 `gorm:"index"` LiquidityUsd float64 Holders int `gorm:"index"` MintAt *time.Time // Time-based metrics (1h, 4h, 12h, 24h) PriceChange1h float64 PriceChange4h float64 PriceChange12h float64 PriceChange24h float64 Volume1h float64 Volume4h float64 Volume12h float64 Volume24h float64 `gorm:"index"` Transactions1h int Transactions4h int Transactions12h int Transactions24h int `gorm:"index"` BuyTransactions1h int BuyTransactions4h int BuyTransactions12h int BuyTransactions24h int SellTransactions1h int SellTransactions4h int SellTransactions12h int SellTransactions24h int Buyers1h int Buyers4h int Buyers12h int Buyers24h int `gorm:"index"` Sellers1h int Sellers4h int Sellers12h int Sellers24h int `gorm:"index"` } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/models/twitter_post.go ================================================ package models import ( "time" "github.com/jinzhu/gorm" ) type TwitterPostStatus string type TwitterPostType string const ( TwitterPostTypeText TwitterPostType = "text" TwitterPostTypeImage TwitterPostType = "image" TwitterPostStatusNew TwitterPostStatus = "new" TwitterPostStatusInvalid TwitterPostStatus = "invalid" TwitterPostStatusValid TwitterPostStatus = "valid" TwitterPostStatusInferNew TwitterPostStatus = "infer_new" TwitterPostStatusInferSubmitted TwitterPostStatus = "infer_submitted" TwitterPostStatusInferFailed TwitterPostStatus = "infer_failed" TwitterPostStatusInferResolved TwitterPostStatus = "infer_resolved" TwitterPostStatusReplied TwitterPostStatus = "replied" ) type TwitterPost struct { gorm.Model TwitterID string TwitterPostID string `gorm:"unique_index"` Type TwitterPostType PostAt *time.Time Content string `gorm:"type:longtext"` InferData string `gorm:"type:longtext"` ReplyContent string `gorm:"type:longtext"` ImageUrl string InferId uint `gorm:"default:0"` InferTxHash string InferAt *time.Time InferNum uint `gorm:"default:0"` ResolveTxHash string Status TwitterPostStatus `gorm:"index"` IsGenerateImage bool `gorm:"default:0"` Prompt string `gorm:"type:longtext"` } type UserAgentInferDataItem struct { Role string `json:"role"` Content string `json:"content"` } type TwitterTweet struct { gorm.Model TweetID string `gorm:"unique_index"` TwitterID string LikeCount int RetweetCount int ReplyCount int QuoteCount int ImpressionCount int FullText string `gorm:"type:longtext"` PostedAt time.Time InReplyToUserID string InReplyToTweetID string IsReply bool OriginalText string `gorm:"type:longtext"` // Retweet-related fields IsRetweet bool RepostTweetID string RepostText string `gorm:"type:longtext"` // Quote-related fields IsQuote bool QuoteTweetID string QuoteText string `gorm:"type:longtext"` } type TwitterUser struct { gorm.Model TwitterID string `gorm:"index"` TwitterUsername string `gorm:"type:text collate utf8mb4_unicode_ci"` Name string `gorm:"type:text collate utf8mb4_unicode_ci"` ProfileUrl string `gorm:"type:text collate utf8mb4_unicode_ci"` FollowersCount uint FollowingsCount uint IsBlueVerified bool JoinedAt time.Time } type TwitterFollowing struct { gorm.Model OwnerTwitterID string `gorm:"index"` TwitterID string `gorm:"index"` TwitterUsername string `gorm:"type:text collate utf8mb4_unicode_ci"` Name string `gorm:"type:text collate utf8mb4_unicode_ci"` ProfileUrl string `gorm:"type:text collate utf8mb4_unicode_ci"` FollowersCount uint FollowingsCount uint IsBlueVerified bool JoinedAt *time.Time } type TwitterScan struct { gorm.Model Username string `gorm:"type:varchar(256);"` TwitterID string `gorm:"type:varchar(256);"` Enabled bool `gorm:"default:true"` IsMention bool `gorm:"default:false"` Scanned bool `gorm:"default:false"` CreatedAt time.Time UpdatedAt time.Time } type TwitterTweetLiked struct { gorm.Model LikedUserID string `gorm:"unique_index:liked_main_unique_index;index"` TweetID string `gorm:"unique_index:liked_main_unique_index;index"` TwitterID string LikeCount int RetweetCount int ReplyCount int QuoteCount int ImpressionCount int FullText string `gorm:"type:longtext"` PostedAt time.Time InReplyToUserID string InReplyToTweetID string IsReply bool OriginalText string `gorm:"type:longtext"` // Retweet-related fields IsRetweet bool RepostTweetID string RepostText string `gorm:"type:longtext"` // Quote-related fields IsQuote bool QuoteTweetID string QuoteText string `gorm:"type:longtext"` } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/models/users.go ================================================ package models import ( "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/types/numeric" "github.com/jinzhu/gorm" ) type User struct { gorm.Model NetworkID uint64 `gorm:"unique_index:user_main_uidx"` Address string `gorm:"unique_index:user_main_uidx"` Username string `gorm:"unique_index"` SubscriptionNum uint `gorm:"default:0"` Price30d numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` Price30dUpdated uint64 `gorm:"default:0"` Price90d numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` Price90dUpdated uint64 `gorm:"default:0"` Description string `gorm:"type:text"` Social string `gorm:"type:text"` ImageURL string `gorm:"type:text"` TwitterID string `gorm:"index"` TwitterAvatar string TwitterUsername string TwitterName string EthAddress string `gorm:"index"` TronAddress string `gorm:"index"` SolAddress string `gorm:"index"` EaiBalance numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` Mentions int64 Likes int64 Followers int16 Following int16 Subscribed bool `gorm:"-"` TotalLike uint `gorm:"-"` TotalPost uint `gorm:"-"` TotalMessage uint `gorm:"-"` TipPayment numeric.BigFloat `gorm:"-"` TipReceive numeric.BigFloat `gorm:"-"` } type TokenHolder struct { gorm.Model NetworkID uint64 `gorm:"unique_index:token_holder_main_uidx"` ContractAddress string `gorm:"unique_index:token_holder_main_uidx"` Address string `gorm:"unique_index:token_holder_main_uidx"` Balance string `gorm:"default:0"` LastBlockNumber uint UserName string `gorm:"-"` ImageURL string `gorm:"-"` MemeName string `gorm:"-"` MemeTicker string `gorm:"-"` MemeImage string `gorm:"-"` MemePrice numeric.BigFloat `gorm:"-"` MemePriceUsd numeric.BigFloat `gorm:"-"` MemeBaseTokenSymbol string `gorm:"-"` } type ( UserTransactionType string UserTransactionStatus string ) const ( UserTransactionTypeDeposit UserTransactionType = "deposit" UserTransactionTypeAgentStoreFee UserTransactionType = "agent_store_fee" UserTransactionTypeTriggerFee UserTransactionType = "trigger_fee" UserTransactionTypeTriggerRefundFee UserTransactionType = "trigger_refund_fee" UserTransactionTypeUserAgentInfraFee UserTransactionType = "user_agent_infra_fee" UserTransactionTypeCreatorAgentInfraFee UserTransactionType = "creator_agent_infra_fee" UserTransactionTypeTokenFee UserTransactionType = "token_fee" UserTransactionStatusDone UserTransactionStatus = "done" UserTransactionStatusCancelled UserTransactionStatus = "cancelled" ) type UserTransaction struct { gorm.Model NetworkID uint64 UserID uint `gorm:"index"` User *User EventId string `gorm:"unique_index"` Type UserTransactionType FromAddress string ToAddress string TxHash string Amount numeric.BigFloat `gorm:"type:decimal(36,18);default:0"` Status UserTransactionStatus Error string `gorm:"type:longtext"` } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/models/vibe.go ================================================ package models import "github.com/jinzhu/gorm" type VibeWhiteList struct { gorm.Model Email string `gorm:"unique_index"` } type VibeReferralCode struct { gorm.Model RefCode string `gorm:"unique_index"` UserAddress string `gorm:"index"` Used bool `gorm:"default:false"` } type AgentUserComment struct { gorm.Model AgentInfoID uint `gorm:"index"` UserID uint `gorm:"index"` User *User UserAddress string `gorm:"index"` Comment string `gorm:"type:longtext"` Rating float64 } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/pkg/drivers/mysql/action.go ================================================ package mysql type Action int const ( WriteOrRead = Action(1) ReadOnly = Action(2) ) ================================================ FILE: agent-as-a-service/agent-orchestration/backend/pkg/drivers/mysql/base.go ================================================ package mysql import ( "context" "math/rand" "gorm.io/gorm" ) type IBaseRepository interface { buildCondition(action Action, args ...interface{}) *gorm.DB setMasterDB(db *gorm.DB) *baseRepository setReplicaDb(db ...*gorm.DB) *baseRepository getReplicaDB() *gorm.DB GetDB(actions ...Action) *gorm.DB FindOneHandler(ctx context.Context, result interface{}, args ...interface{}) error FindByIDHandler(ctx context.Context, ID int, result interface{}, args ...interface{}) error FindsHandler(ctx context.Context, result interface{}, args ...interface{}) error } func NewBaseRepository(masterDB *gorm.DB, replicaDB ...*gorm.DB) IBaseRepository { result := &baseRepository{} result = result.setMasterDB(masterDB).setReplicaDb(replicaDB...) return result } type baseRepository struct { masterDB *gorm.DB replicaDB []*gorm.DB } func (m *baseRepository) buildCondition(action Action, args ...interface{}) *gorm.DB { db := m.GetDB(action) limit := ZeroLimit orderBy := ZeroOrderBy for _, arg := range args { switch param := arg.(type) { case Filters: db = param.setCondition(db) case *FilterItem: db = param.setCondition(db) case FilterItem: db = param.setCondition(db) case *PreloadItem: db = param.setCondition(db) case PreloadItem: db = param.setCondition(db) case Preloads: db = param.setCondition(db) case Limit: limit = param case OrderBy: orderBy = param } } if !limit.IsZero() { db = db.Limit(limit.toInt()) } if !orderBy.IsZero() { db = orderBy.SetCondition(db) } return db } func (m *baseRepository) setMasterDB(db *gorm.DB) *baseRepository { m.masterDB = db return m } func (m *baseRepository) setReplicaDb(db ...*gorm.DB) *baseRepository { m.replicaDB = db return m } func (m *baseRepository) GetDB(actions ...Action) *gorm.DB { databaseAction := WriteOrRead if len(actions) > 0 { databaseAction = actions[0] } switch databaseAction { case ReadOnly: return m.getReplicaDB() case WriteOrRead: return m.masterDB } return m.masterDB } func (m *baseRepository) getReplicaDB() *gorm.DB { // if has no replicaDB then get masterDB lenReplicaDB := len(m.replicaDB) if lenReplicaDB == 0 { return m.masterDB } return m.replicaDB[rand.Intn(lenReplicaDB)] } func (m *baseRepository) FindOneHandler(ctx context.Context, result interface{}, args ...interface{}) error { db := m.buildCondition(ReadOnly, args...) err := db.First(result).Error return err } func (m *baseRepository) FindByIDHandler(ctx context.Context, ID int, result interface{}, args ...interface{}) error { db := m.buildCondition(ReadOnly, args...) err := db.First(result, ID).Error return err } func (m *baseRepository) FindsHandler(ctx context.Context, result interface{}, args ...interface{}) error { db := m.buildCondition(ReadOnly, args...) err := db.Find(result).Error return err } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/pkg/drivers/mysql/filter.go ================================================ package mysql import ( "fmt" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/pkg/utils" "gorm.io/gorm" ) type ( FilterItem struct { _ struct{} FieldName string Operator FilterOperator Value interface{} // these fields are used for this statement: db.Where(a.RawQuery, a.Args...) RawQuery string Args []interface{} } FilterOrderBy struct{} PreloadItem struct { _ struct{} Column string Args []interface{} } // Example // func(db *gorm.DB) *gorm.DB { // return db.Where("info_type = 0") // schema_markup // } PreloadArgsFunc func(db *gorm.DB) *gorm.DB FilterOperator string Filters []FilterItem Preloads []PreloadItem Limit int OrderBy string ) const ( EqualOperator = FilterOperator("=") LikeOperator = FilterOperator("like") InOperator = FilterOperator("in") LessThanOperator = FilterOperator("<") GreaterThanOperator = FilterOperator(">") NotInOperator = FilterOperator("not in") LessThanOrEqualOperator = FilterOperator("<=") // zero value ZeroLimit = Limit(-1) ZeroOrderBy = OrderBy("") IDFieldName = "id" ) func NewLimit(i interface{}) Limit { if i == nil { return ZeroLimit } float64Value, ok := i.(float64) if !ok { return ZeroLimit } return Limit(int(float64Value)) } func (a *FilterItem) makeWhereQuery() string { switch a.Operator { case InOperator, NotInOperator: return fmt.Sprintf("%s %s (?)", a.FieldName, a.Operator) } return fmt.Sprintf("%s %s ?", a.FieldName, a.Operator) } func (a FilterItem) setCondition(db *gorm.DB) *gorm.DB { if utils.IsStringNotEmpty(a.RawQuery) { return db.Where(a.RawQuery, a.Args...) } return db.Where(a.makeWhereQuery(), a.Value) } func (a Filters) setCondition(db *gorm.DB) *gorm.DB { newDB := db for _, item := range a { newDB = item.setCondition(newDB) } return newDB } func (a Preloads) setCondition(db *gorm.DB) *gorm.DB { newDB := db for _, item := range a { newDB = item.setCondition(newDB) } return newDB } func (a PreloadItem) setCondition(db *gorm.DB) *gorm.DB { if a.Args == nil { return db.Preload(a.Column) } return db.Preload(a.Column, a.Args...) } func (a Limit) SetCondition(db *gorm.DB) *gorm.DB { newDB := db.Limit(a.toInt()) return newDB } func (a Limit) toInt() int { return int(a) } func (a Limit) IsZero() bool { return a == ZeroLimit } func (a OrderBy) SetCondition(db *gorm.DB) *gorm.DB { newDB := db.Order(string(a)) return newDB } func (a OrderBy) IsZero() bool { return a == ZeroOrderBy } func GenPreloadItemHandlerFunc(handler func(db *gorm.DB) *gorm.DB) []interface{} { return []interface{}{handler} } func GenPreloadItemArgs(args ...interface{}) []interface{} { return args } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/pkg/drivers/mysql/gorm_connection.go ================================================ package mysql import ( "time" mysqlDriver "github.com/go-sql-driver/mysql" "go.uber.org/zap" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/logger" sqltrace "gopkg.in/DataDog/dd-trace-go.v1/contrib/database/sql" gormtrace "gopkg.in/DataDog/dd-trace-go.v1/contrib/gorm.io/gorm.v1" mysqlgorm "gorm.io/driver/mysql" "gorm.io/gorm" gormlogger "gorm.io/gorm/logger" "moul.io/zapgorm2" ) // NewDefaultMysqlGormConn -- func NewDefaultMysqlGormConn(conn *Connection, dbUrl string, debug bool) *gorm.DB { if conn == nil { conn = DefaultMysqlConnectionFromConfig() } conn.EnableLog = debug settings := dbUrl // settings := fmt.Sprintf("%s:%s@%s(%s:%d)/%s?charset=%s&parseTime=%t&loc=%s", // conn.User, conn.Password, // conn.Protocol, // conn.Host, conn.Port, // conn.DatabaseName, // conn.Charset, // conn.ParseTime, // conn.Location, // ) // logSettings := fmt.Sprintf("%s:%s@%s(%s:%d)/%s?charset=%s&parseTime=%t&loc=%s", // conn.User, utils.CensorString(conn.Password), // conn.Protocol, // conn.Host, conn.Port, // conn.DatabaseName, // conn.Charset, // conn.ParseTime, // conn.Location, // ) logSettings := dbUrl logger.Info("[mysql] Gorm connecting with this configuration: ", logSettings) zapLogger := zapgorm2.New(logger.Logger()) zapLogger.SlowThreshold = 10 * time.Second zapLogger.LogLevel = gormlogger.Silent if conn.EnableLog { zapLogger.LogLevel = gormlogger.Info } sqltrace.Register("mysql", &mysqlDriver.MySQLDriver{}, sqltrace.WithServiceName(conn.ServiceName)) sqlDB, err := sqltrace.Open("mysql", settings) if err != nil { logger.Fatal("NewDefaultMysqlGormConn", zap.Error(err)) } if conn.MaxOpenConn > 0 { sqlDB.SetMaxOpenConns(conn.MaxOpenConn) } if conn.MaxIdleConn > 0 && conn.MaxIdleConn < conn.MaxOpenConn { sqlDB.SetMaxIdleConns(conn.MaxIdleConn) } gormConfig := &gorm.Config{ DisableForeignKeyConstraintWhenMigrating: true, Logger: zapLogger, } db, err := gormtrace.Open(mysqlgorm.New(mysqlgorm.Config{Conn: sqlDB}), gormConfig, gormtrace.WithServiceName(conn.ServiceName), gormtrace.WithErrorCheck(gormTraceErrCheck), ) if err != nil { logger.Fatal("NewDefaultMysqlGormConn", zap.Error(err)) } logger.Info("[mysql] Gorm connected, config:", logSettings) return db } // gormTraceErrCheck check error of gorm func gormTraceErrCheck(err error) bool { if err == nil { return false } return err != gorm.ErrRecordNotFound } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/pkg/drivers/mysql/mysql_config.go ================================================ package mysql import "github.com/spf13/viper" // Connection -- mysql connection type Connection struct { Host string Port int Protocol string User string Password string DatabaseName string Charset string ParseTime bool Location string Others string EnableLog bool MaxOpenConn int MaxIdleConn int ServiceName string } const ( // MaxOpenConn -- MaxOpenConn = 100 // MaxIdleConn -- MaxIdleConn = 10 ) // DefaultMysqlConnectionFromConfig -- load connection settings in config with default key func DefaultMysqlConnectionFromConfig() *Connection { maxOpenConn := viper.GetInt("MYSQL_MAX_OPEN_CONN") if maxOpenConn <= 0 { maxOpenConn = MaxOpenConn } maxIdleConn := viper.GetInt("MYSQL_MAX_IDLE_CONN") if MaxIdleConn <= 0 { maxIdleConn = MaxIdleConn } serviceName := viper.GetString("MYSQL_SERVICE_NAME") if serviceName == "" { serviceName = "mysql" } return &Connection{ Host: viper.GetString("MYSQL_HOST"), Port: viper.GetInt("MYSQL_PORT"), Protocol: viper.GetString("MYSQL_PROTOCOL"), User: viper.GetString("MYSQL_USER"), Password: viper.GetString("MYSQL_PASSWORD"), DatabaseName: viper.GetString("MYSQL_DATABASE_NAME"), Charset: viper.GetString("MYSQL_CHARSET"), ParseTime: viper.GetBool("MYSQL_PARSE_TIME"), Location: viper.GetString("MYSQL_LOCATION"), Others: viper.GetString("MYSQL_OTHERS"), EnableLog: viper.GetBool("LOGGER_ENABLE_DEBUG"), ServiceName: serviceName, MaxOpenConn: maxOpenConn, MaxIdleConn: maxIdleConn, } } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/pkg/drivers/mysql/mysql_connection.go ================================================ package mysql import ( "database/sql" "fmt" "time" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/logger" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/pkg/utils" "go.uber.org/zap" ) // CreateMysqlConnection -- func CreateMysqlConnection(conn *Connection) *AtMysql { if conn == nil { conn = DefaultMysqlConnectionFromConfig() } db, err := NewConnection(conn) if err != nil { logger.Panic("CreateMysqlConnection", zap.Error(err)) } return db } // AtMysql -- type AtMysql struct { *sql.DB } // NewConnection -- open connection to db func NewConnection(conn *Connection) (*AtMysql, error) { var err error settings := fmt.Sprintf("%s:%s@%s(%s:%d)/%s?charset=%s&parseTime=%t", conn.User, conn.Password, conn.Protocol, conn.Host, conn.Port, conn.DatabaseName, conn.Charset, conn.ParseTime, ) if utils.IsStringNotEmpty(conn.Others) { settings = fmt.Sprintf("%s&%s", settings, conn.Others) } logSettings := fmt.Sprintf("%s:%s@%s(%s:%d)/%s?charset=%s&parseTime=%t", conn.User, utils.CensorString(conn.Password), conn.Protocol, conn.Host, conn.Port, conn.DatabaseName, conn.Charset, conn.ParseTime, ) logger.Info("[mysql] Connecting with this configuration: ", logSettings) db, err := sql.Open("mysql", settings) if err != nil { logger.Error("mysql", "[mysql] Could not connect database, details: ", zap.Error(err)) return nil, err } if conn.MaxOpenConn > 0 { db.SetMaxOpenConns(conn.MaxOpenConn) } if conn.MaxIdleConn > 0 && conn.MaxIdleConn < conn.MaxOpenConn { db.SetMaxIdleConns(conn.MaxIdleConn) } db.SetConnMaxLifetime(3600 * time.Second) err = db.Ping() if err != nil { logger.Error("mysql", "[mysql] Could not ping to database, details: ", zap.Error(err)) return nil, err } logger.Info("[mysql] Connected, config:", logSettings) return &AtMysql{db}, nil } // Close -- close connection func (c *AtMysql) Close() { if c == nil { return } err := c.DB.Close() if err != nil { logger.Error("mysql", "[mysql] Could not close connect database, details: ", zap.Error(err)) } } // GetDB -- get db func (c *AtMysql) GetDB() *sql.DB { return c.DB } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/pkg/encrypt/encrypt.go ================================================ package encrypt import ( "crypto/aes" "crypto/cipher" "crypto/rand" "encoding/base64" "errors" "io" "golang.org/x/crypto/chacha20poly1305" ) // EncryptToByte encrypts the given value using AES-GCM. func EncryptToByte(value, key []byte) ([]byte, error) { block, err := aes.NewCipher(key) if err != nil { return nil, err } gcm, err := cipher.NewGCM(block) if err != nil { return nil, err } nonce := make([]byte, gcm.NonceSize()) if _, err = io.ReadFull(rand.Reader, nonce); err != nil { return nil, err } ciphertext := gcm.Seal(nonce, nonce, value, nil) return ciphertext, nil } // EncryptToString encrypts the given value using AES-GCM and encodes the result in base64. func EncryptToString(value, key string) (string, error) { if key == "" { return value, nil } keyBytes := []byte(key) valueBytes := []byte(value) ciphertext, err := EncryptToByte(valueBytes, keyBytes) if err != nil { return "", err } return base64.StdEncoding.EncodeToString(ciphertext), nil } // DecryptToByte decrypts the given ciphertext using AES-GCM. func DecryptToByte(ciphertext, key []byte) ([]byte, error) { block, err := aes.NewCipher(key) if err != nil { return nil, err } gcm, err := cipher.NewGCM(block) if err != nil { return nil, err } if len(ciphertext) < gcm.NonceSize() { return nil, errors.New("ciphertext too short") } nonce := ciphertext[:gcm.NonceSize()] plaintext, err := gcm.Open(nil, nonce, ciphertext[gcm.NonceSize():], nil) if err != nil { return nil, err } return plaintext, nil } // DecryptToString decrypts the given base64-encoded ciphertext using AES-GCM. func DecryptToString(ciphertext, key string) (string, error) { if key == "" { return ciphertext, nil } keyBytes := []byte(key) ciphertextBytes, err := base64.StdEncoding.DecodeString(ciphertext) if err != nil { return "", err } plaintextBytes, err := DecryptToByte(ciphertextBytes, keyBytes) if err != nil { return "", err } return string(plaintextBytes), nil } // EncryptToByteChaCha20Poly1305 encrypts the given value using ChaCha20-Poly1305. func EncryptToByteChaCha20Poly1305(value, key []byte) ([]byte, error) { aead, err := chacha20poly1305.New(key) if err != nil { return nil, err } nonce := make([]byte, aead.NonceSize()) if _, err = io.ReadFull(rand.Reader, nonce); err != nil { return nil, err } ciphertext := aead.Seal(nonce, nonce, value, nil) return ciphertext, nil } // EncryptToStringChaCha20Poly1305 encrypts the given value using ChaCha20-Poly1305 and encodes the result in base64. func EncryptToStringChaCha20Poly1305(value, key string) (string, error) { if key == "" { return value, nil } keyBytes := []byte(key) valueBytes := []byte(value) ciphertext, err := EncryptToByteChaCha20Poly1305(valueBytes, keyBytes) if err != nil { return "", err } return base64.StdEncoding.EncodeToString(ciphertext), nil } // DecryptToByteChaCha20Poly1305 decrypts the given ciphertext using ChaCha20-Poly1305. func DecryptToByteChaCha20Poly1305(ciphertext, key []byte) ([]byte, error) { aead, err := chacha20poly1305.New(key) if err != nil { return nil, err } if len(ciphertext) < aead.NonceSize() { return nil, errors.New("ciphertext too short") } nonce := ciphertext[:aead.NonceSize()] plaintext, err := aead.Open(nil, nonce, ciphertext[aead.NonceSize():], nil) if err != nil { return nil, err } return plaintext, nil } // DecryptToStringChaCha20Poly1305 decrypts the given base64-encoded ciphertext using ChaCha20-Poly1305. func DecryptToStringChaCha20Poly1305(ciphertext, key string) (string, error) { if key == "" { return ciphertext, nil } keyBytes := []byte(key) ciphertextBytes, err := base64.StdEncoding.DecodeString(ciphertext) if err != nil { return "", err } plaintextBytes, err := DecryptToByteChaCha20Poly1305(ciphertextBytes, keyBytes) if err != nil { return "", err } return string(plaintextBytes), nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/pkg/eth/client.go ================================================ package eth import ( "context" "crypto/ecdsa" "encoding/hex" "errors" "math/big" "strings" "time" "github.com/cosmos/cosmos-sdk/crypto/hd" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/ethclient" ) // NewEthClient creates a new Ethereum client for HTTP connections func NewEthClient(rpc string) (*ethclient.Client, error) { client, err := ethclient.Dial(rpc) if err != nil { return nil, err } return client, nil } // NewEthWsClient creates a new Ethereum client for WebSocket connections func NewEthWsClient(ws string) (*ethclient.Client, error) { client, err := ethclient.Dial(ws) if err != nil { return nil, err } return client, nil } // WaitForTx waits for a transaction to be mined func WaitForTx(client *ethclient.Client, tx common.Hash) error { for i := 0; i < 30; i++ { time.Sleep(2 * time.Second) _, isPending, err := client.TransactionByHash(context.Background(), tx) if err != nil { continue } if !isPending { time.Sleep(2 * time.Second) return nil } } return errors.New("timeout waiting for transaction") } // WaitForTxReceipt waits for a transaction receipt to be available func WaitForTxReceipt(client *ethclient.Client, tx common.Hash) (*types.Receipt, error) { for i := 0; i < 20; i++ { time.Sleep(2 * time.Second) txReceipt, err := client.TransactionReceipt(context.Background(), tx) if err != nil { continue } if txReceipt != nil { time.Sleep(2 * time.Second) return txReceipt, nil } } return nil, errors.New("timeout waiting for transaction receipt") } // WalletAddressFromCompressedPublicKey converts a compressed public key to an Ethereum address func WalletAddressFromCompressedPublicKey(publicKeyStr string) (string, error) { pubBytes, err := hex.DecodeString(publicKeyStr) if err != nil { return "", err } pubkey, err := crypto.DecompressPubkey(pubBytes) if err != nil { return "", err } return crypto.PubkeyToAddress(*pubkey).Hex(), nil } // GetAccountInfo returns the private key and Ethereum address for a given private key func GetAccountInfo(privKey string) (*ecdsa.PrivateKey, *common.Address, error) { privateKey, err := crypto.HexToECDSA(privKey) if err != nil { return nil, nil, err } publicKeyECDSA, _ := privateKey.Public().(*ecdsa.PublicKey) publicKeyAddress := crypto.PubkeyToAddress(*publicKeyECDSA) return privateKey, &publicKeyAddress, nil } // GenerateKeyFromSeed generates a private key, public key, and address from a seed func GenerateKeyFromSeed(seed string) (string, string, string, error) { seedHex := hex.EncodeToString([]byte(seed)) master, ch := hd.ComputeMastersFromSeed([]byte(seedHex)) path := "m/44'/1022'/0'/0/0'" priv, err := hd.DerivePrivateKeyForPath(master, ch, path) if err != nil { return "", "", "", err } privateKey, err := crypto.ToECDSA(priv) if err != nil { return "", "", "", err } publicKeyECDSA, _ := privateKey.Public().(*ecdsa.PublicKey) privKey := hex.EncodeToString(priv) publicKeyBytes := crypto.FromECDSAPub(publicKeyECDSA) pubKey := hex.EncodeToString(publicKeyBytes) address := crypto.PubkeyToAddress(*publicKeyECDSA).Hex() return privKey, pubKey, strings.ToLower(address), nil } // GenerateAddress generates a new Ethereum address, public key, and private key func GenerateAddress() (privKey, pubKey, address string, err error) { privateKey, err := crypto.GenerateKey() if err != nil { return "", "", "", err } privateKeyBytes := crypto.FromECDSA(privateKey) privKey = hexutil.Encode(privateKeyBytes)[2:] publicKeyECDSA, ok := privateKey.Public().(*ecdsa.PublicKey) if !ok { return "", "", "", errors.New("failed to cast public key to ECDSA") } publicKeyBytes := crypto.FromECDSAPub(publicKeyECDSA) pubKey = hexutil.Encode(publicKeyBytes)[4:] address = crypto.PubkeyToAddress(*publicKeyECDSA).Hex() return privKey, pubKey, address, nil } // GenerateAddressFromPrivKey generates a public key and address from a private key func GenerateAddressFromPrivKey(privKey string) (pubKey, address string, err error) { privateKey, err := crypto.HexToECDSA(privKey) if err != nil { return "", "", err } publicKeyECDSA, ok := privateKey.Public().(*ecdsa.PublicKey) if !ok { return "", "", errors.New("failed to cast public key to ECDSA") } publicKeyBytes := crypto.FromECDSAPub(publicKeyECDSA) pubKey = hexutil.Encode(publicKeyBytes)[4:] address = crypto.PubkeyToAddress(*publicKeyECDSA).Hex() return pubKey, address, nil } // Client wraps an Ethereum client for convenience type Client struct { eth *ethclient.Client } // NewClient creates a new Client instance func NewClient(eth *ethclient.Client) *Client { return &Client{eth} } // PendingNonceAt retrieves the nonce of an address func (c *Client) PendingNonceAt(ctx context.Context, address common.Address) (uint64, error) { return c.eth.PendingNonceAt(ctx, address) } // SuggestGasPrice retrieves the suggested gas price func (c *Client) SuggestGasPrice(ctx context.Context) (*big.Int, error) { return c.eth.SuggestGasPrice(ctx) } // NetworkID retrieves the network ID func (c *Client) NetworkID(ctx context.Context) (*big.Int, error) { return c.eth.NetworkID(ctx) } // SendTransaction sends a transaction to the network func (c *Client) SendTransaction(ctx context.Context, tx *types.Transaction) error { return c.eth.SendTransaction(ctx, tx) } // Transfer creates and sends a transaction from one address to another func (c *Client) Transfer(senderPrivKey, receiverAddress string, amount, gasPrice *big.Int, gasLimit, nonce uint64) (string, error) { privateKey, err := crypto.HexToECDSA(senderPrivKey) if err != nil { return "", err } publicKeyECDSA, _ := privateKey.Public().(*ecdsa.PublicKey) fromAddress := crypto.PubkeyToAddress(*publicKeyECDSA) if nonce <= 0 { nonce, err = c.PendingNonceAt(context.Background(), fromAddress) if err != nil { return "", err } } if gasLimit == 0 { gasLimit = uint64(21000) } if gasPrice == nil { gasPrice, err = c.SuggestGasPrice(context.Background()) if err != nil { return "", err } } // fee := new(big.Int).Mul(big.NewInt(int64(gasLimit)), gasPrice) toAddress := common.HexToAddress(receiverAddress) tx := types.NewTransaction(nonce, toAddress, amount, gasLimit, gasPrice, nil) chainID, err := c.NetworkID(context.Background()) if err != nil { return "", err } signedTx, err := types.SignTx(tx, types.NewEIP155Signer(chainID), privateKey) if err != nil { return "", err } err = c.SendTransaction(context.Background(), signedTx) if err != nil { return "", err } return signedTx.Hash().Hex(), nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/pkg/scraper/colly/colly.go ================================================ package colly import ( "context" "fmt" "net/http" "github.com/davecgh/go-spew/spew" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/internal/core/ports" "github.com/gocolly/colly" ) var tracerTagName = "scraper-colly" type scraper struct { collyCollector *colly.Collector ctx context.Context url string htmlStr string maxDepth int } func NewScraper(ctx context.Context) (ports.IScraper, error) { s := &scraper{ctx: ctx} s.maxDepth = 1 s.setCallback() return s, nil } func (s *scraper) setCallback() { c := colly.NewCollector( colly.MaxDepth(s.maxDepth), colly.AllowedDomains("nbcnews.com", "www.nbcnews.com")) c.WithTransport(&http.Transport{ DisableKeepAlives: true, }) c.OnRequest(func(r *colly.Request) { // logger.Info(tracerTagName, "visiting", zap.Any("url", r.URL.String())) }) c.OnError(func(r *colly.Response, err error) { // logger.Error(tracerTagName, "scraper_error", zap.Error(err), zap.Any("request_url", r.Request.URL), zap.Any("failed with response", r)) spew.Dump(err) }) c.OnHTML("a[href]", func(e *colly.HTMLElement) { link := e.Attr("href") // Print link fmt.Printf("Link found: %q -> %s\n", e.Text, link) // Visit link found on page // Only those links are visited which are in AllowedDomains c.Visit(e.Request.AbsoluteURL(link)) }) // c.OnRequest(func(r *colly.Request) { // fmt.Println("Visiting", r.URL.String()) // }) s.collyCollector = c } func (s *scraper) ContentHtmlByUrl(ctx context.Context, url string) (string, error) { s.url = url req := &colly.Request{} if err := s.collyCollector.Visit(req.AbsoluteURL(s.url)); err != nil { return "", err } return "", nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/pkg/scraper/colly/colly_test.go ================================================ package colly import ( "context" "testing" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/internal/core/ports" "github.com/stretchr/testify/suite" ) type Suite struct { suite.Suite ctx context.Context scraper ports.IScraper } func TestRun(t *testing.T) { suite.Run(t, new(Suite)) } func (s *Suite) SetupSuite() { var err error s.ctx = context.Background() s.scraper, err = NewScraper(s.ctx) if err != nil { panic(err) } } func (s *Suite) TestContentHtmlByUrl() { url := "https://www.nbcnews.com/" s.scraper.ContentHtmlByUrl(s.ctx, url) } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/pkg/secret_manager/secret_manager.go ================================================ package secret_manager import ( "context" secretmanager "cloud.google.com/go/secretmanager/apiv1" "cloud.google.com/go/secretmanager/apiv1/secretmanagerpb" ) func GetGoogleSecretKey(ctx context.Context, name string) (string, error) { // Create the client. client, err := secretmanager.NewClient(ctx) if err != nil { return "", err } defer client.Close() // Build the request. req := &secretmanagerpb.AccessSecretVersionRequest{Name: name} // Call the API. result, err := client.AccessSecretVersion(ctx, req) if err != nil { return "", err } return string(result.Payload.Data), nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/pkg/utils/copier.go ================================================ package utils // Fork from https://github.com/jinzhu/copier v0.4.0 import ( "database/sql" "database/sql/driver" "errors" "fmt" "reflect" "strconv" "strings" "sync" "time" "unicode" "go.mongodb.org/mongo-driver/bson/primitive" "google.golang.org/protobuf/types/known/structpb" "google.golang.org/protobuf/types/known/timestamppb" ) var ( ErrInvalidCopyDestination = errors.New("copy destination must be non-nil and addressable") ErrInvalidCopyFrom = errors.New("copy from must be non-nil and addressable") ErrMapKeyNotMatch = errors.New("map's key type doesn't match") ErrNotSupported = errors.New("not supported") ErrFieldNameTagStartNotUpperCase = errors.New("copier field name tag must be start upper case") ) // These flags define options for tag handling const ( // Denotes that a destination field must be copied to. If copying fails then a panic will ensue. tagMust uint8 = 1 << iota // Denotes that the program should not panic when the must flag is on and // value is not copied. The program will return an error instead. tagNoPanic // Ignore a destination field from being copied to. tagIgnore // Denotes that the value as been copied hasCopied // Some default converter types for a nicer syntax String string = "" Bool bool = false Int int = 0 Float32 float32 = 0 Float64 float64 = 0 ) // Option sets copy options type Option struct { // setting this value to true will ignore copying zero values of all the fields, including bools, as well as a // struct having all it's fields set to their zero values respectively (see IsZero() in reflect/value.go) IgnoreEmpty bool CaseSensitive bool DeepCopy bool Converters []TypeConverter // Custom field name mappings to copy values with different names in `fromValue` and `toValue` types. // Examples can be found at `TestCustomFieldName`. FieldNameMapping []FieldNameMapping } func (opt Option) converters() map[converterPair]TypeConverter { converters := map[converterPair]TypeConverter{} // save converters into map for faster lookup for i := range opt.Converters { pair := converterPair{ SrcType: reflect.TypeOf(opt.Converters[i].SrcType), DstType: reflect.TypeOf(opt.Converters[i].DstType), } converters[pair] = opt.Converters[i] } return converters } type TypeConverter struct { SrcType interface{} DstType interface{} Fn func(src interface{}) (dst interface{}, err error) } type converterPair struct { SrcType reflect.Type DstType reflect.Type } func (opt Option) fieldNameMapping() map[converterPair]FieldNameMapping { mapping := map[converterPair]FieldNameMapping{} for i := range opt.FieldNameMapping { pair := converterPair{ SrcType: reflect.TypeOf(opt.FieldNameMapping[i].SrcType), DstType: reflect.TypeOf(opt.FieldNameMapping[i].DstType), } mapping[pair] = opt.FieldNameMapping[i] } return mapping } type FieldNameMapping struct { SrcType interface{} DstType interface{} Mapping map[string]string } // Tag Flags type flags struct { BitFlags map[string]uint8 SrcNames tagNameMapping DestNames tagNameMapping } // Field Tag name mapping type tagNameMapping struct { FieldNameToTag map[string]string TagToFieldName map[string]string } // Copy copy things func Copy(toValue interface{}, fromValue interface{}) (err error) { return copier(toValue, fromValue, Option{}) } // CopyWithOption copy with option func CopyWithOption(toValue interface{}, fromValue interface{}, opt Option) (err error) { return copier(toValue, fromValue, opt) } func copier(toValue interface{}, fromValue interface{}, opt Option) (err error) { var ( isSlice bool amount = 1 from = indirect(reflect.ValueOf(fromValue)) to = indirect(reflect.ValueOf(toValue)) converters = opt.converters() mappings = opt.fieldNameMapping() ) if !to.CanAddr() { return ErrInvalidCopyDestination } // Return is from value is invalid if !from.IsValid() { return ErrInvalidCopyFrom } // Convert string to any data type if to value not string if from, ok := fromValue.(string); ok { if _, ok := toValue.(*string); !ok { switch reflect.ValueOf(toValue).Elem().Interface().(type) { case int: to, _ := strconv.Atoi(from) setValue(toValue, to) return case int32: to, _ := strconv.Atoi(from) setValue(toValue, int32(to)) return case int64: to, _ := strconv.Atoi(from) setValue(toValue, int64(to)) return case float32: to, _ := strconv.ParseFloat(from, 32) setValue(toValue, to) return case float64: to, _ := strconv.ParseFloat(from, 64) setValue(toValue, to) return case bool: to, _ := strconv.ParseBool(from) setValue(toValue, to) return case []string: setValue(toValue, strings.Split(from, ",")) return case time.Time: layout := "02/01/2006 15:04:05" t, _ := time.Parse(layout, from) setValue(toValue, t) return } } } // Convert timestamppb.Timestamp <-> time.Time if time, ok := fromValue.(time.Time); ok { if _, ok := toValue.(**timestamppb.Timestamp); ok { if !time.IsZero() { setValue(toValue, timestamppb.New(time)) } return } } if timestamp, ok := fromValue.(*timestamppb.Timestamp); ok { if _, ok := toValue.(*time.Time); ok { if timestamp.IsValid() && timestamp.AsTime().Year() != 1970 { setValue(toValue, timestamp.AsTime()) } return } } // convert map[string]*timestamppb.Timestamp <-> map[string]time.Time if timestampMap, ok := fromValue.(map[string]*timestamppb.Timestamp); ok { if _, ok := toValue.(*map[string]time.Time); ok { if timestampMap != nil { timestampMap := timestampMap timeMap := make(map[string]time.Time) for key, timestamp := range timestampMap { if timestamp.IsValid() && timestamp.AsTime().Year() != 1970 { timeMap[key] = timestamp.AsTime() } } setValue(toValue, timeMap) } return } } if timeMap, ok := fromValue.(map[string]time.Time); ok { if _, ok := toValue.(*map[string]*timestamppb.Timestamp); ok { if timeMap != nil { timeMap := timeMap timestampMap := make(map[string]*timestamppb.Timestamp) for key, time := range timeMap { if !time.IsZero() { timestampMap[key] = timestamppb.New(time) } } setValue(toValue, timestampMap) } return } } // convert map[uint32]*timestamppb.Timestamp <-> map[uint32]time.Time if timestampMap, ok := fromValue.(map[uint32]*timestamppb.Timestamp); ok { if _, ok := toValue.(*map[uint32]time.Time); ok { if timestampMap != nil { timestampMap := timestampMap timeMap := make(map[uint32]time.Time) for key, timestamp := range timestampMap { if timestamp.IsValid() && timestamp.AsTime().Year() != 1970 { timeMap[key] = timestamp.AsTime() } } setValue(toValue, timeMap) } return } } if timeMap, ok := fromValue.(map[uint32]time.Time); ok { if _, ok := toValue.(*map[uint32]*timestamppb.Timestamp); ok { if timeMap != nil { timeMap := timeMap timestampMap := make(map[uint32]*timestamppb.Timestamp) for key, time := range timeMap { if !time.IsZero() { timestampMap[key] = timestamppb.New(time) } } setValue(toValue, timestampMap) } return } } // Convert primitive.ObjectID <-> string if id, ok := fromValue.(primitive.ObjectID); ok { if _, ok := toValue.(*string); ok { setValue(toValue, id.Hex()) return } } if id, ok := fromValue.(string); ok { if _, ok := toValue.(*primitive.ObjectID); ok { if len(id) > 0 { if objectId, ok := primitive.ObjectIDFromHex(id); ok == nil { setValue(toValue, objectId) return } } } } // Convert []primitive.ObjectID <-> []string // if ids, ok := fromValue.([]primitive.ObjectID); ok { // if _, ok := toValue.(*[]string); ok { // setValue(toValue, cast.ObjectsToHex(ids)) // return // } // } // if ids, ok := fromValue.([]string); ok { // if _, ok := toValue.(*[]primitive.ObjectID); ok { // if len(ids) > 0 { // if objectIds, ok := cast.StringsToObjects(ids); ok == nil { // setValue(toValue, objectIds) // return // } // } // } // } // Convert *structpb.Struct <-> map[string]interface{} if strctpb, ok := fromValue.(*structpb.Struct); ok && strctpb != nil { setValue(toValue, strctpb.AsMap()) return } if m, ok := fromValue.(map[string]interface{}); ok && m != nil { if _, ok := toValue.(**structpb.Struct); ok { if strcpb, err := structpb.NewStruct(m); err == nil { setValue(toValue, strcpb) } } } fromType, isPtrFrom := indirectType(from.Type()) toType, _ := indirectType(to.Type()) if fromType.Kind() == reflect.Interface { fromType = reflect.TypeOf(from.Interface()) } if toType.Kind() == reflect.Interface { toType, _ = indirectType(reflect.TypeOf(to.Interface())) oldTo := to to = reflect.New(reflect.TypeOf(to.Interface())).Elem() defer func() { oldTo.Set(to) }() } // Just set it if possible to assign for normal types if from.Kind() != reflect.Slice && from.Kind() != reflect.Struct && from.Kind() != reflect.Map && (from.Type().AssignableTo(to.Type()) || from.Type().ConvertibleTo(to.Type())) { if !isPtrFrom || !opt.DeepCopy { to.Set(from.Convert(to.Type())) } else { fromCopy := reflect.New(from.Type()) fromCopy.Set(from.Elem()) to.Set(fromCopy.Convert(to.Type())) } return } if from.Kind() != reflect.Slice && fromType.Kind() == reflect.Map && toType.Kind() == reflect.Map { if !fromType.Key().ConvertibleTo(toType.Key()) { return ErrMapKeyNotMatch } if to.IsNil() { to.Set(reflect.MakeMapWithSize(toType, from.Len())) } for _, k := range from.MapKeys() { toKey := indirect(reflect.New(toType.Key())) isSet, err := set(toKey, k, opt.DeepCopy, converters) if err != nil { return err } if !isSet { return fmt.Errorf("%w map, old key: %v, new key: %v", ErrNotSupported, k.Type(), toType.Key()) } elemType := toType.Elem() if elemType.Kind() != reflect.Slice { elemType, _ = indirectType(elemType) } toValue := indirect(reflect.New(elemType)) isSet, err = set(toValue, from.MapIndex(k), opt.DeepCopy, converters) if err != nil { return err } if !isSet { if err = copier(toValue.Addr().Interface(), from.MapIndex(k).Interface(), opt); err != nil { return err } } for { if elemType == toType.Elem() { to.SetMapIndex(toKey, toValue) break } elemType = reflect.PtrTo(elemType) toValue = toValue.Addr() } } return } if from.Kind() == reflect.Slice && to.Kind() == reflect.Slice { if to.IsNil() { slice := reflect.MakeSlice(reflect.SliceOf(to.Type().Elem()), from.Len(), from.Cap()) to.Set(slice) } if fromType.ConvertibleTo(toType) { for i := 0; i < from.Len(); i++ { if to.Len() < i+1 { to.Set(reflect.Append(to, reflect.New(to.Type().Elem()).Elem())) } isSet, err := set(to.Index(i), from.Index(i), opt.DeepCopy, converters) if err != nil { return err } if !isSet { // ignore error while copy slice element err = copier(to.Index(i).Addr().Interface(), from.Index(i).Interface(), opt) if err != nil { continue } } } return } } if fromType.Kind() != reflect.Struct || toType.Kind() != reflect.Struct { // skip not supported type return } if len(converters) > 0 { if ok, e := set(to, from, opt.DeepCopy, converters); e == nil && ok { // converter supported return } } if from.Kind() == reflect.Slice || to.Kind() == reflect.Slice { isSlice = true if from.Kind() == reflect.Slice { amount = from.Len() } } for i := 0; i < amount; i++ { var dest, source reflect.Value if isSlice { // source if from.Kind() == reflect.Slice { source = indirect(from.Index(i)) } else { source = indirect(from) } // dest dest = indirect(reflect.New(toType).Elem()) } else { source = indirect(from) dest = indirect(to) } if len(converters) > 0 { if ok, e := set(dest, source, opt.DeepCopy, converters); e == nil && ok { if isSlice { // FIXME: maybe should check the other types? if to.Type().Elem().Kind() == reflect.Ptr { to.Index(i).Set(dest.Addr()) } else { if to.Len() < i+1 { reflect.Append(to, dest) } else { to.Index(i).Set(dest) } } } else { to.Set(dest) } continue } } destKind := dest.Kind() initDest := false if destKind == reflect.Interface { initDest = true dest = indirect(reflect.New(toType)) } // Get tag options flgs, err := getFlags(dest, source, toType, fromType) if err != nil { return err } // check source if source.IsValid() { copyUnexportedStructFields(dest, source) // Copy from source field to dest field or method fromTypeFields := deepFields(fromType) for _, field := range fromTypeFields { name := field.Name // Get bit flags for field fieldFlags := flgs.BitFlags[name] // Check if we should ignore copying if (fieldFlags & tagIgnore) != 0 { continue } fieldNamesMapping := getFieldNamesMapping(mappings, fromType, toType) srcFieldName, destFieldName := getFieldName(name, flgs, fieldNamesMapping) if fromField := fieldByNameOrZeroValue(source, srcFieldName); fromField.IsValid() && !shouldIgnore(fromField, opt.IgnoreEmpty) { // process for nested anonymous field destFieldNotSet := false if f, ok := dest.Type().FieldByName(destFieldName); ok { // only initialize parent embedded struct pointer in the path for idx := range f.Index[:len(f.Index)-1] { destField := dest.FieldByIndex(f.Index[:idx+1]) if destField.Kind() != reflect.Ptr { continue } if !destField.IsNil() { continue } if !destField.CanSet() { destFieldNotSet = true break } // destField is a nil pointer that can be set newValue := reflect.New(destField.Type().Elem()) destField.Set(newValue) } } if destFieldNotSet { break } toField := fieldByName(dest, destFieldName, opt.CaseSensitive) if toField.IsValid() { if toField.CanSet() { isSet, err := set(toField, fromField, opt.DeepCopy, converters) if err != nil { return err } if !isSet { if err := copier(toField.Addr().Interface(), fromField.Interface(), opt); err != nil { return err } } if fieldFlags != 0 { // Note that a copy was made flgs.BitFlags[name] = fieldFlags | hasCopied } } } else { // try to set to method var toMethod reflect.Value if dest.CanAddr() { toMethod = dest.Addr().MethodByName(destFieldName) } else { toMethod = dest.MethodByName(destFieldName) } if toMethod.IsValid() && toMethod.Type().NumIn() == 1 && fromField.Type().AssignableTo(toMethod.Type().In(0)) { toMethod.Call([]reflect.Value{fromField}) } } } } // Copy from from method to dest field for _, field := range deepFields(toType) { name := field.Name srcFieldName, destFieldName := getFieldName(name, flgs, getFieldNamesMapping(mappings, fromType, toType)) var fromMethod reflect.Value if source.CanAddr() { fromMethod = source.Addr().MethodByName(srcFieldName) } else { fromMethod = source.MethodByName(srcFieldName) } if fromMethod.IsValid() && fromMethod.Type().NumIn() == 0 && fromMethod.Type().NumOut() == 1 && !shouldIgnore(fromMethod, opt.IgnoreEmpty) { if toField := fieldByName(dest, destFieldName, opt.CaseSensitive); toField.IsValid() && toField.CanSet() { values := fromMethod.Call([]reflect.Value{}) if len(values) >= 1 { _, _ = set(toField, values[0], opt.DeepCopy, converters) } } } } } if isSlice && to.Kind() == reflect.Slice { if dest.Addr().Type().AssignableTo(to.Type().Elem()) { if to.Len() < i+1 { to.Set(reflect.Append(to, dest.Addr())) } else { isSet, err := set(to.Index(i), dest.Addr(), opt.DeepCopy, converters) if err != nil { return err } if !isSet { // ignore error while copy slice element err = copier(to.Index(i).Addr().Interface(), dest.Addr().Interface(), opt) if err != nil { continue } } } } else if dest.Type().AssignableTo(to.Type().Elem()) { if to.Len() < i+1 { to.Set(reflect.Append(to, dest)) } else { isSet, err := set(to.Index(i), dest, opt.DeepCopy, converters) if err != nil { return err } if !isSet { // ignore error while copy slice element err = copier(to.Index(i).Addr().Interface(), dest.Interface(), opt) if err != nil { continue } } } } } else if initDest { to.Set(dest) } _ = checkBitFlags(flgs.BitFlags) } return } func getFieldNamesMapping(mappings map[converterPair]FieldNameMapping, fromType reflect.Type, toType reflect.Type) map[string]string { var fieldNamesMapping map[string]string if len(mappings) > 0 { pair := converterPair{ SrcType: fromType, DstType: toType, } if v, ok := mappings[pair]; ok { fieldNamesMapping = v.Mapping } } return fieldNamesMapping } func fieldByNameOrZeroValue(source reflect.Value, fieldName string) (value reflect.Value) { defer func() { if err := recover(); err != nil { value = reflect.Value{} } }() return source.FieldByName(fieldName) } func copyUnexportedStructFields(to, from reflect.Value) { if from.Kind() != reflect.Struct || to.Kind() != reflect.Struct || !from.Type().AssignableTo(to.Type()) { return } // create a shallow copy of 'to' to get all fields tmp := indirect(reflect.New(to.Type())) tmp.Set(from) // revert exported fields for i := 0; i < to.NumField(); i++ { if tmp.Field(i).CanSet() { tmp.Field(i).Set(to.Field(i)) } } to.Set(tmp) } func shouldIgnore(v reflect.Value, ignoreEmpty bool) bool { return ignoreEmpty && v.IsZero() } var ( deepFieldsLock sync.RWMutex deepFieldsMap = make(map[reflect.Type][]reflect.StructField) ) func deepFields(reflectType reflect.Type) []reflect.StructField { deepFieldsLock.RLock() cache, ok := deepFieldsMap[reflectType] deepFieldsLock.RUnlock() if ok { return cache } var res []reflect.StructField if reflectType, _ = indirectType(reflectType); reflectType.Kind() == reflect.Struct { fields := make([]reflect.StructField, 0, reflectType.NumField()) for i := 0; i < reflectType.NumField(); i++ { v := reflectType.Field(i) // PkgPath is the package path that qualifies a lower case (unexported) // field name. It is empty for upper case (exported) field names. // See https://golang.org/ref/spec#Uniqueness_of_identifiers if v.PkgPath == "" { fields = append(fields, v) if v.Anonymous { // also consider fields of anonymous fields as fields of the root fields = append(fields, deepFields(v.Type)...) } } } res = fields } deepFieldsLock.Lock() deepFieldsMap[reflectType] = res deepFieldsLock.Unlock() return res } func indirect(reflectValue reflect.Value) reflect.Value { for reflectValue.Kind() == reflect.Ptr { reflectValue = reflectValue.Elem() } return reflectValue } func indirectType(reflectType reflect.Type) (_ reflect.Type, isPtr bool) { for reflectType.Kind() == reflect.Ptr || reflectType.Kind() == reflect.Slice { reflectType = reflectType.Elem() isPtr = true } return reflectType, isPtr } func set(to, from reflect.Value, deepCopy bool, converters map[converterPair]TypeConverter) (bool, error) { if !from.IsValid() { return true, nil } if ok, err := lookupAndCopyWithConverter(to, from, converters); err != nil { return false, err } else if ok { return true, nil } if to.Kind() == reflect.Ptr { // set `to` to nil if from is nil if from.Kind() == reflect.Ptr && from.IsNil() { to.Set(reflect.Zero(to.Type())) return true, nil } else if to.IsNil() { // `from` -> `to` // sql.NullString -> *string if fromValuer, ok := driverValuer(from); ok { v, err := fromValuer.Value() if err != nil { return true, nil } // if `from` is not valid do nothing with `to` if v == nil { return true, nil } } // allocate new `to` variable with default value (eg. *string -> new(string)) to.Set(reflect.New(to.Type().Elem())) } // depointer `to` to = to.Elem() } if deepCopy { toKind := to.Kind() if toKind == reflect.Interface && to.IsNil() { if reflect.TypeOf(from.Interface()) != nil { to.Set(reflect.New(reflect.TypeOf(from.Interface())).Elem()) toKind = reflect.TypeOf(to.Interface()).Kind() } } if from.Kind() == reflect.Ptr && from.IsNil() { return true, nil } if _, ok := to.Addr().Interface().(sql.Scanner); !ok && (toKind == reflect.Struct || toKind == reflect.Map || toKind == reflect.Slice) { return false, nil } } if from.Type().ConvertibleTo(to.Type()) { to.Set(from.Convert(to.Type())) } else if toScanner, ok := to.Addr().Interface().(sql.Scanner); ok { // `from` -> `to` // *string -> sql.NullString if from.Kind() == reflect.Ptr { // if `from` is nil do nothing with `to` if from.IsNil() { return true, nil } // depointer `from` from = indirect(from) } // `from` -> `to` // string -> sql.NullString // set `to` by invoking method Scan(`from`) err := toScanner.Scan(from.Interface()) if err != nil { return false, nil } } else if fromValuer, ok := driverValuer(from); ok { // `from` -> `to` // sql.NullString -> string v, err := fromValuer.Value() if err != nil { return false, nil } // if `from` is not valid do nothing with `to` if v == nil { return true, nil } rv := reflect.ValueOf(v) if rv.Type().AssignableTo(to.Type()) { to.Set(rv) } else if to.CanSet() && rv.Type().ConvertibleTo(to.Type()) { to.Set(rv.Convert(to.Type())) } } else if from.Kind() == reflect.Ptr { return set(to, from.Elem(), deepCopy, converters) } else { return false, nil } return true, nil } // lookupAndCopyWithConverter looks up the type pair, on success the TypeConverter Fn func is called to copy src to dst field. func lookupAndCopyWithConverter(to, from reflect.Value, converters map[converterPair]TypeConverter) (copied bool, err error) { pair := converterPair{ SrcType: from.Type(), DstType: to.Type(), } if cnv, ok := converters[pair]; ok { result, err := cnv.Fn(from.Interface()) if err != nil { return false, err } if result != nil { to.Set(reflect.ValueOf(result)) } else { // in case we've got a nil value to copy to.Set(reflect.Zero(to.Type())) } return true, nil } return false, nil } // parseTags Parses struct tags and returns uint8 bit flags. func parseTags(tag string) (flg uint8, name string, err error) { for _, t := range strings.Split(tag, ",") { switch t { case "-": flg = tagIgnore return case "must": flg = flg | tagMust case "nopanic": flg = flg | tagNoPanic default: if unicode.IsUpper([]rune(t)[0]) { name = strings.TrimSpace(t) } else { err = ErrFieldNameTagStartNotUpperCase } } } return } // getTagFlags Parses struct tags for bit flags, field name. func getFlags(dest, src reflect.Value, toType, fromType reflect.Type) (flags, error) { flgs := flags{ BitFlags: map[string]uint8{}, SrcNames: tagNameMapping{ FieldNameToTag: map[string]string{}, TagToFieldName: map[string]string{}, }, DestNames: tagNameMapping{ FieldNameToTag: map[string]string{}, TagToFieldName: map[string]string{}, }, } var toTypeFields, fromTypeFields []reflect.StructField if dest.IsValid() { toTypeFields = deepFields(toType) } if src.IsValid() { fromTypeFields = deepFields(fromType) } // Get a list dest of tags for _, field := range toTypeFields { tags := field.Tag.Get("copier") if tags != "" { var name string var err error if flgs.BitFlags[field.Name], name, err = parseTags(tags); err != nil { return flags{}, err } else if name != "" { flgs.DestNames.FieldNameToTag[field.Name] = name flgs.DestNames.TagToFieldName[name] = field.Name } } } // Get a list source of tags for _, field := range fromTypeFields { tags := field.Tag.Get("copier") if tags != "" { var name string var err error if _, name, err = parseTags(tags); err != nil { return flags{}, err } else if name != "" { flgs.SrcNames.FieldNameToTag[field.Name] = name flgs.SrcNames.TagToFieldName[name] = field.Name } } } return flgs, nil } // checkBitFlags Checks flags for error or panic conditions. func checkBitFlags(flagsList map[string]uint8) (err error) { // Check flag conditions were met for name, flgs := range flagsList { if flgs&hasCopied == 0 { switch { case flgs&tagMust != 0 && flgs&tagNoPanic != 0: err = fmt.Errorf("field %s has must tag but was not copied", name) return case flgs&(tagMust) != 0: panic(fmt.Sprintf("Field %s has must tag but was not copied", name)) } } } return } func getFieldName(fieldName string, flgs flags, fieldNameMapping map[string]string) (srcFieldName string, destFieldName string) { // get dest field name if name, ok := fieldNameMapping[fieldName]; ok { srcFieldName = fieldName destFieldName = name return } if srcTagName, ok := flgs.SrcNames.FieldNameToTag[fieldName]; ok { destFieldName = srcTagName if destTagName, ok := flgs.DestNames.TagToFieldName[srcTagName]; ok { destFieldName = destTagName } } else { if destTagName, ok := flgs.DestNames.TagToFieldName[fieldName]; ok { destFieldName = destTagName } } if destFieldName == "" { destFieldName = fieldName } // get source field name if destTagName, ok := flgs.DestNames.FieldNameToTag[fieldName]; ok { srcFieldName = destTagName if srcField, ok := flgs.SrcNames.TagToFieldName[destTagName]; ok { srcFieldName = srcField } } else { if srcField, ok := flgs.SrcNames.TagToFieldName[fieldName]; ok { srcFieldName = srcField } } if srcFieldName == "" { srcFieldName = fieldName } return } func driverValuer(v reflect.Value) (i driver.Valuer, ok bool) { if !v.CanAddr() { i, ok = v.Interface().(driver.Valuer) return } i, ok = v.Addr().Interface().(driver.Valuer) return } func fieldByName(v reflect.Value, name string, caseSensitive bool) reflect.Value { if caseSensitive { return v.FieldByName(name) } return v.FieldByNameFunc(func(n string) bool { return strings.EqualFold(n, name) }) } func setValue(to interface{}, from interface{}) { fromValue := reflect.ValueOf(from) toValue := reflect.ValueOf(to) _, _ = set(toValue, fromValue, false, map[converterPair]TypeConverter{}) } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/pkg/utils/crypto.go ================================================ package utils import ( "strings" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/pkg/encrypt" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/pkg/eth" ) // return encryptedPrivateKeyKey, address, error func GenerateAddress(secretKey string) (string, string, error) { privateKey, _, address, err := eth.GenerateAddress() if err != nil { return "", "", err } encryptedPrivateKeyKey, err := encrypt.EncryptToString(privateKey, secretKey) if err != nil { return "", "", err } return encryptedPrivateKeyKey, strings.ToLower(address), nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/pkg/utils/scraper.go ================================================ package utils import ( "net/url" "regexp" "strings" "github.com/PuerkitoBio/goquery" ) func MinifyHTML(html string) (string, error) { doc, err := goquery.NewDocumentFromReader(strings.NewReader(html)) if err != nil { return "", err } doc.Find("*").Each(func(index int, item *goquery.Selection) { var str string str, err = item.Html() str = strings.TrimSpace(str) str = strings.ReplaceAll(str, "\n", "") str = strings.ReplaceAll(str, "\t", "") if err == nil { item.SetHtml(str) } }) htmlStr, err := doc.Html() if err != nil { return "", err } return strings.TrimSpace(htmlStr), nil } func ResolveURL(base, ref string) (string, error) { baseURL, err := url.Parse(base) if err != nil { return "", err } refURL, err := url.Parse(ref) if err != nil { return "", err } return baseURL.ResolveReference(refURL).String(), nil } func IsBase64DataURL(urlStr string) bool { // Check if the URL starts with the data URL scheme if !strings.HasPrefix(urlStr, "data:") { return false } // Regular expression to match Base64 data URLs base64Pattern := `^data:[\w/]+;base64,[A-Za-z0-9+/=]+$` matched, err := regexp.MatchString(base64Pattern, urlStr) if err != nil { return false } return matched } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/pkg/utils/solana.go ================================================ package utils import ( "context" "math/big" "strings" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/pkg/encrypt" "github.com/gagliardetto/solana-go/rpc" "github.com/gagliardetto/solana-go" ) func GenerateSolanaAddress(secretKey string) (string, string, error) { account := solana.NewWallet() // Get the public key pubKey := account.PublicKey().String() privKey, err := encrypt.EncryptToString(account.PrivateKey.String(), secretKey) if err != nil { return "", "", err } return privKey, strings.ToLower(pubKey), nil } func GetBalanceOnSolanaChain(ctx context.Context, address string) (*big.Int, error) { pubKey, err := solana.PublicKeyFromBase58(address) if err != nil { return nil, err } endpoint := rpc.MainNetBeta_RPC client := rpc.New(endpoint) out, err := client.GetBalance( ctx, pubKey, rpc.CommitmentFinalized, ) if err != nil { return nil, err } lamportsOnAccount := new(big.Int).SetUint64(out.Value) return lamportsOnAccount, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/pkg/utils/solana_test.go ================================================ package utils_test import ( "context" "math/big" "testing" "github.com/davecgh/go-spew/spew" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/pkg/utils" ) func TestGetBalanceOnSolanaChain(t *testing.T) { tests := []struct { name string // description of this test case // Named input parameters for target function. address string want *big.Int wantErr bool }{ {name: "case 1", address: "4cvnq5d8ctv9zjqkc1rf4j1tdxxc7edt6sm1ocu8qpmc"}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { got, gotErr := utils.GetBalanceOnSolanaChain(context.Background(), tt.address) spew.Dump(got) spew.Dump(gotErr) if gotErr != nil { if !tt.wantErr { t.Errorf("GetBalanceOnSolanaChain() failed: %v", gotErr) } return } if tt.wantErr { t.Fatal("GetBalanceOnSolanaChain() succeeded unexpectedly") } // TODO: update the condition below to compare got with tt.want. if true { t.Errorf("GetBalanceOnSolanaChain() = %v, want %v", got, tt.want) } }) } } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/pkg/utils/string_utils.go ================================================ package utils import "strings" const ( UndefinedString = "undefined" ZeroString = "" CensorStringValue = "***" ) // StringTrimSpace -- trim space of string func StringTrimSpace(s string) string { return strings.TrimSpace(s) } // IsStringEmpty -- check if string is empty func IsStringEmpty(s string) bool { return s == ZeroString } // IsStringNotEmpty -- check if string is not empty func IsStringNotEmpty(s string) bool { return s != ZeroString } // CensorString -- func CensorString(str string) string { if len(str) <= 6 { return CensorStringValue } return str[:2] + CensorStringValue + str[len(str)-2:] } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/pkg/utils/utils.go ================================================ package utils import ( "errors" "io" "log" "net/http" "net/url" "os" "path" "path/filepath" "strings" ) type Environment string const Production Environment = "production" func IsEnvProduction(env string) bool { return env == string(Production) } func filenameWithoutExtension(filename string) string { return strings.TrimSuffix(filename, filepath.Ext(filename)) } func CreateFolderIfNotExists(path string) error { if _, err := os.Stat(path); os.IsNotExist(err) { err := os.MkdirAll(path, os.ModePerm) if err != nil { return err } log.Printf("Created directory: %s", path) } else if err != nil { return err } else { log.Printf("Directory %s already exists", path) } return nil } func DownloadFileByUrl(link string, localPath string) (string, string, error) { parsedUrl, err := url.ParseRequestURI(link) if err != nil { return "", "", err } // Get the data client := &http.Client{} req, _ := http.NewRequest("GET", link, nil) resp, err := client.Do(req) if err != nil { return "", "", err } if resp.StatusCode != http.StatusOK { return "", "", errors.New("received non 200 response code") } fileName := strings.Replace(resp.Header.Get("Content-Disposition"), "attachment; filename=", "", -1) fileName = strings.Replace(fileName, "attachment;filename=", "", -1) if fileName == "" { filePath := parsedUrl.Path fileName = path.Base(filePath) } _ = CreateFolderIfNotExists(filepath.Join(localPath, filenameWithoutExtension(fileName))) pathFile := filepath.Join(localPath, filenameWithoutExtension(fileName), fileName) // Create the file out, err := os.Create(pathFile) if err != nil { return "", "", err } defer out.Close() defer resp.Body.Close() // Write the body to file _, err = io.Copy(out, resp.Body) if err != nil { return "", "", err } return pathFile, fileName, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/serializers/agent_assistant_serializers.go ================================================ package serializers import ( "encoding/json" "time" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/types/numeric" ) type AssistantCharacter struct { Bio []string `json:"bio"` Lore []string `json:"lore"` Knowledge []string `json:"knowledge"` MessageExamples [][]struct { User string `json:"user"` Content struct { Text string `json:"text"` } `json:"content"` } `json:"messageExamples"` PostExamples []string `json:"postExamples"` Topics []string `json:"topics"` Style map[string][]string `json:"style"` Adjectives []string `json:"adjectives"` } type AssistantsReq struct { ID uint `json:"id"` CategoryID uint `json:"category_id"` AgentID string `json:"agent_id"` AgentName string `json:"agent_name"` Creator string `json:"creator"` AgentContractAddress string `json:"agent_contract_address"` AgentContractID string `json:"agent_contract_id"` Minter string `json:"minter"` MetaData string `json:"meta_data"` ChainID uint64 `json:"chain_id"` Thumbnail string `json:"thumbnail"` CreateTokenMode models.CreateTokenModeType `json:"create_token_mode"` Status models.AssistantStatus `json:"status"` UserPrompt string `json:"user_prompt"` SystemContent string `json:"system_content"` Ticker string `json:"ticker"` TokenName string `json:"token_name"` TokenAddress string `json:"token_address"` TokenImageUrl string `json:"token_image_url"` TokenDesc string `json:"token_desc"` AssistantCharacter `json:",inline"` TokenChainId string `json:"token_chain_id"` SocialInfo []*models.SocialInfo `json:"social_info"` AgentType models.AgentInfoAgentType `json:"agent_type"` ConfigData string `json:"config_data"` VerifiedNFTOwner bool `json:"verified_nft_owner"` NFTAddress string `json:"nft_address"` NFTTokenID string `json:"nft_token_id"` NFTTokenImage string `json:"nft_token_image"` NFTOwnerAddress string `json:"nft_owner_address"` NFTSignature string `json:"nft_signature"` NFTSignMessage string `json:"nft_sign_message"` NFTDelegateAddress string `json:"nft_delegate_address"` NFTPublicKey string `json:"nft_public_key"` AgentBaseModel string `json:"agent_base_model"` TwinTwitterUsernames string `json:"twin_twitter_usernames"` MissionTopics string `json:"mission_topics"` CreateKnowledgeRequest *CreateKnowledgeRequest `json:"create_knowledge_request"` KbIds []uint `json:"kb_ids"` SourceUrl string `json:"source_url"` AuthenUrl string `json:"authen_url"` MinFeeToUse numeric.BigFloat `json:"min_fee_to_use"` Worker string `json:"worker"` DependAgents string `json:"depend_agents"` RequiredWallet *bool `json:"required_wallet"` RequiredEnv *bool `json:"required_env"` EnvExample string `json:"env_example"` IsOnchain *bool `json:"is_onchain"` IsStreaming *bool `json:"is_streaming"` IsCustomUi *bool `json:"is_custom_ui"` RequiredInfo *string `json:"required_info"` InferFee *string `json:"infer_fee"` DisplayName string `json:"display_name"` ShortDescription string `json:"short_description"` IsForceUpdate *bool `json:"is_force_update"` Author string `json:"author"` } func (m *AssistantsReq) GetAssistantCharacter(character interface{}) string { urlsJson, _ := json.Marshal(character) if string(urlsJson) == "null" { return "" } return string(urlsJson) } type UpdateAgentAssistantInContractRequest struct { ID uint `json:"id"` AgentID string `json:"agent_id"` HashName string `json:"hash_name"` HashSystemPrompt string `json:"hash_system_prompt"` SignatureName string `json:"signature_name"` SignatureSystemPrompt string `json:"signature_system_prompt"` RandomNonceName string `json:"random_nonce_name"` RandomNonceSystemPrompt string `json:"random_nonce_system_prompt"` } type UpdateAgentAssistantInContractResponse struct { TxUpdateName string `json:"tx_update_name"` TxUpdateSystemPrompt string `json:"tx_update_system_prompt"` } type UpdateTwinStatusRequest struct { AgentID string `json:"agent_id"` TwinStatus string `json:"twin_status"` KnowledgeBaseID string `json:"knowledge_base_id"` SystemPrompt string `json:"system_prompt"` TwinTrainingProgress float64 `json:"twin_training_progress"` TwinTrainingMessage string `json:"twin_training_message"` } // /////////////// type Assistants struct { ID string `json:"id"` CreatedAt time.Time `json:"created_at"` InferFee string `bson:"infer_fee" json:"infer_fee"` AgentName string `bson:"agent_name" json:"agent_name"` Creator string `bson:"creator" json:"creator"` Minter string `bson:"minter" json:"minter"` ContractAgentID string `bson:"contract_agent_id" json:"contract_agent_id"` MetaData string `bson:"meta_data" json:"meta_data"` ChainID uint64 `bson:"chain_id" json:"chain_id"` AgentContractAddress string `bson:"agent_contract_address" json:"agent_contract_address"` TxHash string `bson:"tx_hash" json:"tx_hash"` Uri string `bson:"uri" json:"uri"` Thumbnail string `bson:"thumbnail" json:"thumbnail"` TokenChainId uint64 `json:"token_chain_id" ` TokenImage string `json:"token_image" bson:"token_image"` Ticker string `json:"ticker" bson:"ticker"` TokenName string `json:"token_name" bson:"token_name"` TokenAddress string `bson:"token_address" json:"token_address"` CreateTokenMode models.CreateTokenModeType `bson:"create_token_mode" json:"create_token_mode"` Status models.AssistantStatus `bson:"status" json:"status"` SystemReminder string `bson:"system_reminder" json:"system_reminder"` AgentBaseModel string `bson:"open_ai_assistant_model" json:"agent_base_model"` SystemContent string `bson:"system_content" json:"system_content"` TwitterID string `bson:"twitter_id" json:"twitter_id"` TwitterName string `bson:"twitter_name" json:"twitter_name"` TwitterUserName string `bson:"twitter_username" json:"twitter_username"` TwitterAvatar string `bson:"twitter_avatar" json:"twitter_avatar"` AssistantCharacter `bson:",inline"` VerifiedNFTOwner bool `json:"verified_nft_owner"` NFTAddress string `json:"nft_address"` NFTTokenID string `json:"nft_token_id"` NFTTokenImage string `json:"nft_token_image"` NFTOwnerAddress string `json:"nft_owner_address"` NFTSignature string `json:"nft_signature" bson:"nft_signature"` NFTSignMessage string `json:"nft_sign_message" bson:"nft_sign_message"` NFTDelegateAddress string `json:"nft_delegate_address" bson:"nft_delegate_address"` NFTPublicKey string `json:"nft_public_key" bson:"nft_public_key"` SocialInfo []*models.SocialInfo `json:"social_info" bson:"social_info"` TwinTwitterUsernames string `json:"twin_twitter_usernames"` TwinStatus string `json:"twin_status"` TwinTrainingProgress float64 `json:"twin_training_progress"` TwinTrainingMessage string `json:"twin_training_message"` GraphData string `json:"graph_data"` } type AssistantResp struct { Assistants `json:",inline"` AgentInfo *AgentInfoResp `json:"agent_info"` KnowledgeBase *KnowledgeBase `json:"knowledge_base"` } func NewAssistantResp(m *models.AgentInfo) *AssistantResp { if m == nil { return nil } resp := &AssistantResp{} resp.ID = m.AgentID resp.CreatedAt = m.CreatedAt resp.InferFee = m.InferFee.String() resp.AgentName = m.AgentName resp.Creator = m.Creator resp.Minter = m.Minter resp.ContractAgentID = m.AgentContractID resp.AgentContractAddress = m.AgentContractAddress resp.ChainID = m.NetworkID resp.TxHash = m.MintHash resp.Uri = m.Uri resp.Thumbnail = m.Thumbnail resp.TokenAddress = m.TokenAddress resp.TokenChainId = m.TokenNetworkID resp.TokenImage = m.TokenImageUrl resp.TokenName = m.TokenName resp.Ticker = m.TokenSymbol resp.AgentBaseModel = m.AgentBaseModel resp.Bio = m.GetCharacterArrayString(m.Bio) resp.Lore = m.GetCharacterArrayString(m.Lore) resp.Knowledge = m.GetCharacterArrayString(m.Knowledge) resp.PostExamples = m.GetCharacterArrayString(m.PostExamples) resp.Topics = m.GetCharacterArrayString(m.Topics) resp.Adjectives = m.GetCharacterArrayString(m.Adjectives) resp.MessageExamples = m.GetMessageExamples() resp.Style = m.GetStyle() resp.SocialInfo = m.GetSocialInfo() resp.Status = m.Status resp.SystemReminder = m.SystemReminder resp.MetaData = m.MetaData resp.SystemContent = m.SystemPrompt resp.VerifiedNFTOwner = m.VerifiedNftOwner resp.NFTAddress = m.NftAddress resp.NFTTokenID = m.NftTokenID resp.NFTTokenImage = m.NftTokenImage resp.NFTOwnerAddress = m.NftOwnerAddress resp.NFTSignature = m.NftSignature resp.NFTSignMessage = m.NftSignMessage resp.NFTDelegateAddress = m.NftDelegateAddress resp.NFTPublicKey = m.NftPublicKey resp.CreateTokenMode = models.CreateTokenModeType(m.TokenMode) resp.TwinTwitterUsernames = m.TwinTwitterUsernames resp.TwinStatus = string(m.TwinStatus) resp.TwinTrainingProgress = m.TwinTrainingProgress resp.TwinTrainingMessage = m.TwinTrainingMessage resp.GraphData = m.GraphData if m.TwitterInfo != nil { resp.TwitterID = m.TwitterInfo.TwitterID resp.TwitterName = m.TwitterInfo.TwitterName resp.TwitterUserName = m.TwitterInfo.TwitterUsername resp.TwitterAvatar = m.TwitterInfo.TwitterAvatar } if m.TokenMode == "" { resp.CreateTokenMode = models.CreateTokenModeTypeNoToken } resp.AgentInfo = NewAgentInfoResp(m) resp.KnowledgeBase = NewKnowledgeBaseResp(m.KnowledgeBase) return resp } func NewAssistantRespArry(arr []*models.AgentInfo) []*AssistantResp { resps := []*AssistantResp{} for _, m := range arr { resps = append(resps, NewAssistantResp(m)) } return resps } type DataUploadToLightHouse struct { Content string `json:"content"` } type StudioReq struct { GraphData string `json:"graph_data"` } type AgentActionReq struct { Action string `json:"action"` Ids []uint `json:"ids"` ContractAddress []string `json:"contract_address"` } type AgentCommentReq struct { Comment string `json:"comment"` Rating float64 `json:"rating"` } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/serializers/agent_library.go ================================================ package serializers import ( "time" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" ) type AgentLibraryReq struct { Name string `json:"name"` SourceUrl string `json:"source_url"` AgentType int `json:"agent_type"` } type AgentLibraryResp struct { ID uint `json:"id"` CreatedAt time.Time `json:"created_at"` Name string `json:"name"` SourceUrl string `json:"source_url"` AgentType int `json:"agent_type"` } func NewAgentLibraryResp(m *models.AgentLibrary) *AgentLibraryResp { if m == nil { return nil } return &AgentLibraryResp{ ID: m.ID, CreatedAt: m.CreatedAt, Name: m.Name, SourceUrl: m.SourceURL, AgentType: int(m.AgentType), } } func NewAgentLibraryRespArray(arr []*models.AgentLibrary) []*AgentLibraryResp { resps := []*AgentLibraryResp{} for _, r := range arr { resps = append(resps, NewAgentLibraryResp(r)) } return resps } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/serializers/agent_serializers.go ================================================ package serializers import ( "fmt" "math/big" "strings" "time" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/helpers" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/pkg/utils" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/types/numeric" ) type AgentTokenReq struct { AgentID string `json:"agent_id"` TokenSymbol string `json:"token_symbol"` TokenName string `json:"token_name"` NetworkID uint64 `json:"network_id"` } type AgentTwitterInfoReq struct { FarcasterID string `json:"farcaster_id"` FarcasterUsername string `json:"farcaster_username"` TwitterClientId string `json:"twitter_client_id"` TwitterClientSecret string `json:"twitter_client_secret"` UserPrompt string `json:"user_prompt"` } type AgentExternalInfoReq struct { Type string `json:"type"` ExternalID string `json:"external_id"` ExternalUsername string `json:"external_username"` ExternalName string `json:"external_name"` } type TwitterInfoResp struct { TwitterID string `json:"twitter_id"` TwitterAvatar string `json:"twitter_avatar"` TwitterUsername string `json:"twitter_username"` TwitterName string `json:"twitter_name"` Description string `json:"description"` ReLink bool `json:"re_link"` } type AgentSnapshotMissionInfo struct { ID uint `json:"id"` UserPrompt string `json:"user_prompt"` Interval int `json:"interval"` ToolSet models.ToolsetType `json:"tool_set"` AgentType models.AgentInfoAgentType `json:"agent_type"` UserTwitterIDs string `json:"user_twitter_ids"` ToolList string `json:"tool_list"` Tokens string `json:"tokens"` AgentBaseModel string `json:"agent_base_model"` AgentStoreMissionID uint `json:"agent_store_mission_id"` AgentStoreID uint `json:"agent_store_id"` MissionStoreParams map[string]string `json:"mission_store_params"` Topics string `json:"topics"` IsTwitterSearch bool `json:"is_twitter_search"` IsBingSearch bool `json:"is_bing_search"` RewardAmount numeric.BigFloat `json:"reward_amount"` MinTokenHolding numeric.BigFloat `json:"min_token_holding"` RewardUser int `json:"reward_user"` LookupInterval int `json:"lookup_interval"` } type AgentCategoryResp struct { ID uint `json:"id"` Name string `json:"name"` } func NewAgentCategoryResp(m *models.AgentCategory) *AgentCategoryResp { if m == nil { return nil } return &AgentCategoryResp{ ID: m.ID, Name: m.Name, } } func NewAgentCategoryRespArry(arr []*models.AgentCategory) []*AgentCategoryResp { resp := make([]*AgentCategoryResp, len(arr)) for i, m := range arr { resp[i] = NewAgentCategoryResp(m) } return resp } type AgentInfoResp struct { ID uint `json:"id"` CreatedAt time.Time `json:"created_at"` AgentCategoryID uint `json:"agent_category_id"` AgentCategory *AgentCategoryResp `json:"agent_category"` TwitterInfoID uint `json:"twitter_info_id"` TwitterInfo *TwitterInfoResp `json:"twitter_info"` AgentID string `json:"agent_id"` AgentContractID string `json:"agent_contract_id"` AgentContractAddress string `json:"agent_contract_address"` AgentName string `json:"agent_name"` NetworkID uint64 `json:"network_id"` NetworkName string `json:"network_name"` ETHAddress string `json:"eth_address"` SOLAddress string `json:"sol_address"` TipAmount numeric.BigFloat `json:"tip_amount"` WalletBalance numeric.BigFloat `json:"wallet_balance"` Creator string `json:"creator"` Mentions uint `json:"mentions"` XFollowers uint `json:"x_followers"` TipEthAddress string `json:"tip_eth_address"` TipBtcAddress string `json:"tip_btc_address"` TipSolAddress string `json:"tip_sol_address"` IsFaucet bool `json:"is_faucet"` UserPrompt string `json:"user_prompt"` AgentSnapshotMission []*AgentSnapshotMissionInfo `json:"agent_snapshot_mission"` TokenName string `json:"token_name"` TokenSymbol string `json:"token_symbol"` TokenAddress string `json:"token_address"` TokenImageUrl string `json:"token_image_url"` TokenStatus string `json:"token_status"` TokenMode string `json:"create_token_mode"` TotalSupply int64 `json:"total_supply"` UsdMarketCap float64 `json:"usd_market_cap"` PriceUsd numeric.BigFloat `json:"price_usd"` DexUrl string `json:"dex_url"` LatestTwitterPost *AgentTwitterPostResp `json:"latest_twitter_post"` Personality string `json:"personality"` TmpTwitterInfo *TwitterInfoResp `json:"tmp_twitter_info"` IsClaimed bool `json:"is_claimed"` Meme *MemeResp `json:"meme"` TokenNetworkID uint64 `json:"token_network_id"` TokenNetworkName string `json:"token_network_name"` ReplyLatestTime *time.Time `json:"active_latest_time"` Thumbnail string `json:"thumbnail"` ReplyEnabled bool `json:"reply_enabled"` AgentBaseModel string `json:"agent_base_model"` AssistantCharacter `json:",inline"` SocialInfo []*models.SocialInfo `json:"social_info"` VerifiedNftOwner bool `json:"verified_nft_owner"` NftAddress string `json:"nft_address"` NftTokenID string `json:"nft_token_id"` NftTokenImage string `json:"nft_token_image"` NftOwnerAddress string `json:"nft_owner_address"` Status models.AssistantStatus `json:"status"` InferenceCalls int64 `json:"inference_calls"` PromptCalls int64 `json:"prompt_calls"` TotalMintTwinFee float64 `json:"total_mint_twin_fee"` EstimateTwinDoneTimestamp *time.Time `json:"estimate_twin_done_timestamp"` TokenDesc string `json:"token_desc"` ExternalChartUrl string `json:"external_chart_url"` InferFee numeric.BigFloat `json:"infer_fee"` MissionTopics string `json:"mission_topics"` GraphData string `json:"graph_data"` AgentType models.AgentInfoAgentType `json:"agent_type"` ConfigData string `json:"config_data"` SourceURL string `json:"source_url"` AuthenURL string `json:"authen_url"` AgentKBId uint `json:"kb_id"` DependAgents string `json:"depend_agents"` RequiredWallet bool `json:"required_wallet"` RequiredEnv bool `json:"required_env"` IsOnchain bool `json:"is_onchain"` IsStreaming bool `json:"is_streaming"` IsCustomUi bool `json:"is_custom_ui"` Likes int64 `json:"likes"` IsPublic bool `json:"is_public"` DockerPort string `json:"docker_port"` RequiredInfo string `json:"required_info"` InstalledCount int64 `json:"installed_count"` EnvExample string `json:"env_example"` DisplayName string `json:"display_name"` ShortDescription string `json:"short_description"` IsForceUpdate bool `json:"is_force_update"` CodeVersion int `json:"code_version"` RunStatus string `json:"run_status"` Author string `json:"author"` Rating float64 `json:"rating"` NumOfRating int64 `json:"num_of_rating"` NumOfOneStar int64 `json:"num_of_one_star"` NumOfTwoStar int64 `json:"num_of_two_star"` NumOfThreeStar int64 `json:"num_of_three_star"` NumOfFourStar int64 `json:"num_of_four_star"` NumOfFiveStar int64 `json:"num_of_five_star"` CodeLanguage string `json:"code_language"` } type AgentTwitterPostResp struct { ID uint `json:"id"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` TwitterID string `json:"twitter_id"` TwitterUser *TwitterInfoResp `json:"twitter_user"` TwitterUsername string `json:"twitter_username"` TwitterName string `json:"twitter_name"` TwitterPostID string `json:"twitter_post_id"` PostAt *time.Time `json:"post_at"` Content string `json:"content"` ReplyContent string `json:"reply_content"` AgentInfoID uint `json:"agent_info_id"` AgentInfo *AgentInfoResp `json:"agent_info"` ReplyPostId string `json:"reply_post_id"` ReplyPostAt *time.Time `json:"reply_post_at"` ReplyPostReply int `json:"reply_post_reply"` ReplyPostView int `json:"reply_post_view"` ReplyPostFavorite int `json:"reply_post_favorite"` ReplyPostBookmark int `json:"reply_post_bookmark"` ReplyPostQuote int `json:"reply_post_quote"` ReplyPostRetweet int `json:"reply_post_retweet"` InscribeTxHash string `json:"inscribe_tx_hash"` BitcoinTxHash string `json:"bitcoin_tx_hash"` PostType models.AgentSnapshotPostActionType `json:"post_type"` } func NewTwitterInfoResp(m *models.TwitterInfo) *TwitterInfoResp { if m == nil { return nil } resp := &TwitterInfoResp{ TwitterID: m.TwitterID, TwitterAvatar: m.TwitterAvatar, TwitterUsername: m.TwitterUsername, TwitterName: m.TwitterName, Description: m.Description, ReLink: false, } if m.RefreshError != "" && !strings.EqualFold(m.RefreshError, "ok") { resp.ReLink = true } return resp } func NewTwitterUserResp(m *models.TwitterUser) *TwitterInfoResp { if m == nil { return nil } resp := &TwitterInfoResp{ TwitterID: m.TwitterID, TwitterAvatar: m.ProfileUrl, TwitterUsername: m.TwitterUsername, TwitterName: m.Name, } return resp } func NewAgentSnapshotMissionResp(m *models.AgentSnapshotMission) *AgentSnapshotMissionInfo { if m == nil { return nil } resp := &AgentSnapshotMissionInfo{ ID: m.ID, UserPrompt: m.UserPrompt, Interval: m.IntervalSec, ToolSet: m.ToolSet, AgentType: m.AgentType, UserTwitterIDs: m.UserTwitterIds, Tokens: m.Tokens, AgentBaseModel: m.AgentBaseModel, ToolList: m.ToolList, Topics: m.Topics, IsTwitterSearch: m.IsTwitterSearch, IsBingSearch: m.IsBingSearch, RewardAmount: m.RewardAmount, RewardUser: m.RewardUser, MinTokenHolding: m.MinTokenHolding, LookupInterval: m.LookupInterval, AgentStoreMissionID: m.AgentStoreMissionID, AgentStoreID: m.AgentStoreID, } if m.AgentStoreMissionID > 0 { resp.ToolList = "" resp.ToolSet = models.ToolsetType(fmt.Sprintf("%d", m.AgentStoreMissionID)) } return resp } func NewKnowledgeBaseResp(m *models.KnowledgeBase) *KnowledgeBase { resp := &KnowledgeBase{} if m == nil { return nil } if err := utils.Copy(resp, m); err != nil { return nil } return resp } func NewAgentInfoResp(m *models.AgentInfo) *AgentInfoResp { if m == nil { return nil } resp := &AgentInfoResp{ ID: m.ID, CreatedAt: m.CreatedAt, AgentCategoryID: m.AgentCategoryID, AgentCategory: NewAgentCategoryResp(m.AgentCategory), TwitterInfoID: m.TwitterInfoID, TwitterInfo: NewTwitterInfoResp(m.TwitterInfo), AgentContractID: m.AgentContractID, AgentContractAddress: m.AgentContractAddress, AgentID: m.AgentID, NetworkID: m.NetworkID, NetworkName: m.NetworkName, ETHAddress: m.ETHAddress, SOLAddress: m.SOLAddress, AgentName: m.AgentName, Creator: m.Creator, WalletBalance: m.EaiBalance, TipEthAddress: m.TipEthAddress, TipBtcAddress: m.TipBtcAddress, TipSolAddress: m.TipSolAddress, IsFaucet: m.IsFaucet, UserPrompt: m.UserPrompt, AgentSnapshotMission: []*AgentSnapshotMissionInfo{}, TokenName: m.TokenName, TokenSymbol: m.TokenSymbol, TokenAddress: m.TokenAddress, TokenImageUrl: m.TokenImageUrl, TokenMode: m.TokenMode, Personality: m.SystemPrompt, TmpTwitterInfo: NewTwitterUserResp(m.TmpTwitterInfo), TokenNetworkID: m.TokenNetworkID, TokenNetworkName: models.GetChainName(m.TokenNetworkID), ReplyLatestTime: m.ReplyLatestTime, Thumbnail: m.Thumbnail, TokenStatus: m.TokenStatus, ReplyEnabled: m.ReplyEnabled, AgentBaseModel: m.AgentBaseModel, VerifiedNftOwner: m.VerifiedNftOwner, NftAddress: m.NftAddress, NftTokenID: m.NftTokenID, NftTokenImage: m.NftTokenImage, NftOwnerAddress: m.NftOwnerAddress, Status: m.Status, InferenceCalls: m.InferenceCalls, PromptCalls: m.PromptCalls, TotalMintTwinFee: m.TotalMintTwinFee, TokenDesc: m.TokenDesc, ExternalChartUrl: m.ExternalChartUrl, InferFee: m.InferFee, MissionTopics: m.MissionTopics, GraphData: m.GraphData, AgentType: m.AgentType, SourceURL: m.SourceUrl, AgentKBId: m.AgentKBId, AuthenURL: m.AuthenUrl, DependAgents: m.DependAgents, RequiredWallet: m.RequiredWallet, IsOnchain: m.IsOnchain, IsStreaming: m.IsStreaming, IsCustomUi: m.IsCustomUi, Likes: m.Likes, IsPublic: m.IsPublic, DockerPort: m.DockerPort, RequiredInfo: m.RequiredInfo, InstalledCount: m.InstalledCount, RequiredEnv: m.RequiredEnv, EnvExample: m.EnvExample, DisplayName: m.DisplayName, ShortDescription: m.ShortDescription, IsForceUpdate: m.IsForceUpdate, CodeVersion: m.CodeVersion, RunStatus: m.RunStatus, Author: m.Author, Rating: m.Rating, NumOfRating: m.NumOfRating, NumOfOneStar: m.NumOfOneStar, NumOfTwoStar: m.NumOfTwoStar, NumOfThreeStar: m.NumOfThreeStar, NumOfFourStar: m.NumOfFourStar, NumOfFiveStar: m.NumOfFiveStar, CodeLanguage: m.GetCodeLanguage(), } if m.NftTokenImage != "" { m.Thumbnail = m.NftTokenImage } if m.TokenMode == "" { resp.TokenMode = string(models.CreateTokenModeTypeNoToken) } resp.Bio = m.GetCharacterArrayString(m.Bio) resp.Lore = m.GetCharacterArrayString(m.Lore) resp.Knowledge = m.GetCharacterArrayString(m.Knowledge) resp.PostExamples = m.GetCharacterArrayString(m.PostExamples) resp.Topics = m.GetCharacterArrayString(m.Topics) resp.Adjectives = m.GetCharacterArrayString(m.Adjectives) resp.MessageExamples = m.GetMessageExamples() resp.Style = m.GetStyle() resp.SocialInfo = m.GetSocialInfo() if m.TokenAddress == "" { resp.TokenNetworkID = 0 resp.TokenNetworkName = "" } if m.Creator != "0xf3b5ecf8028424443ccaf35a6d46f31ce80af709" && m.RefTweetID > 0 { resp.IsClaimed = true } if m.TokenInfo != nil { resp.TotalSupply = m.TokenInfo.TotalSupply resp.UsdMarketCap = m.TokenInfo.UsdMarketCap resp.PriceUsd = m.TokenInfo.PriceUsd if m.TokenInfo.PriceUsd.Cmp(big.NewFloat(0)) > 0 { resp.DexUrl = m.TokenInfo.DexUrl } } if resp.DexUrl == "" { resp.DexUrl = models.GetDexUrl(m.TokenNetworkID, m.TokenAddress) } if m.Meme != nil && m.Meme.Status == models.MemeStatusAddPoolLevel1 { resp.Meme = NewMemeRespWithToken(m.Meme) resp.Meme.Percent = m.MemePercent resp.Meme.MarketCap = m.MemeMarketCap resp.UsdMarketCap, _ = m.MemeMarketCap.Float64() resp.Meme.TradeUrl = "" if m.TokenNetworkID == models.SOLANA_CHAIN_ID { resp.Meme.Status = string(models.MemeStatusAddPoolExternal) resp.Meme.TokenAddress = m.TokenAddress } } else { if m.TokenInfo != nil && m.TokenAddress != "" && m.TokenInfo.PriceUsd.Cmp(big.NewFloat(0)) > 0 { resp.Meme = NewMemeFromTokenInfoResp(m.TokenInfo, m) if m.TokenMode == string(models.CreateTokenModeTypeLinkExisting) { resp.Meme.Status = string(models.MemeStatusAddPoolExternal) if m.TokenNetworkID == models.BSC_CHAIN_ID { resp.Meme.TradeUrl = fmt.Sprintf(`https://four.meme/token/%s`, m.TokenAddress) } } else if m.Meme != nil { resp.Meme.Supply = m.Meme.Supply if m.Meme.Status == models.MemeStatusAddPoolExternal { resp.Meme.Status = string(models.MemeStatusAddPoolExternal) resp.Meme.TradeUrl = m.Meme.ExternalTradeUrl } } } else if m.Meme != nil { resp.Meme = NewMemeRespWithToken(m.Meme) resp.Meme.Percent = m.MemePercent resp.Meme.MarketCap = m.MemeMarketCap } else if m.TokenAddress != "" && (m.TokenNetworkID == models.SOLANA_CHAIN_ID || m.TokenMode == string(models.CreateTokenModeTypeLinkExisting)) { resp.Meme = &MemeResp{ Status: string(models.MemeStatusAddPoolExternal), TokenAddress: m.TokenAddress, } if m.TokenNetworkID == models.SOLANA_CHAIN_ID { resp.Meme.TradeUrl = fmt.Sprintf("https://pump.fun/coin/%s", m.TokenAddress) resp.Meme.MarketCap = numeric.NewBigFloatFromString("6740") resp.UsdMarketCap = float64(6740) } else if m.TokenNetworkID == models.BSC_CHAIN_ID { resp.Meme.TradeUrl = fmt.Sprintf(`https://four.meme/token/%s`, m.TokenAddress) } } } if len(m.AgentSnapshotMission) > 0 { for _, item := range m.AgentSnapshotMission { resp.AgentSnapshotMission = append(resp.AgentSnapshotMission, NewAgentSnapshotMissionResp(item)) } } switch m.AgentType { case models.AgentInfoAgentTypeModel: { resp.RunStatus = "local" } case models.AgentInfoAgentTypeModelOnline: { resp.RunStatus = "online" } } return resp } func NewAgentInfoRespArry(arr []*models.AgentInfo) []*AgentInfoResp { resps := []*AgentInfoResp{} for _, m := range arr { resps = append(resps, NewAgentInfoResp(m)) } return resps } func NewAgentTwitterPostResp(m *models.AgentTwitterPost) *AgentTwitterPostResp { if m == nil { return nil } resp := &AgentTwitterPostResp{ ID: m.ID, CreatedAt: m.CreatedAt, UpdatedAt: m.UpdatedAt, TwitterID: m.TwitterID, TwitterUser: NewTwitterUserResp(m.TwitterUser), TwitterUsername: m.TwitterUsername, TwitterName: m.TwitterName, TwitterPostID: m.TwitterPostID, PostAt: m.PostAt, Content: helpers.RemoveTrailingHashTag(m.Content), ReplyContent: helpers.RemoveTrailingHashTag(m.ReplyContent), AgentInfoID: m.AgentInfoID, AgentInfo: NewAgentInfoResp(m.AgentInfo), ReplyPostReply: m.ReplyPostReply, ReplyPostView: m.ReplyPostView, ReplyPostAt: m.ReplyPostAt, ReplyPostId: m.ReplyPostId, ReplyPostFavorite: m.ReplyPostFavorite, ReplyPostBookmark: m.ReplyPostBookmark, ReplyPostQuote: m.ReplyPostQuote, ReplyPostRetweet: m.ReplyPostRetweet, InscribeTxHash: m.InscribeTxHash, BitcoinTxHash: m.BitcoinTxHash, PostType: m.PostType, } return resp } type AgentTokenResp struct { ID uint `json:"id"` AgentInfoID uint `json:"twitter_info_id"` AgentInfo *AgentInfoResp `json:"agent_info"` ContractAddress string `json:"contract_address"` Name string `json:"name"` Symbol string `json:"symbol"` ImageUrl string `json:"image_url"` NetworkID uint64 `json:"network_id"` NetworkName string `json:"network_name"` Price numeric.BigFloat `json:"price"` PriceUsd numeric.BigFloat `json:"price_usd"` TotalSupply numeric.BigFloat `json:"total_supply"` MarketCap numeric.BigFloat `json:"market_cap"` TipAmount numeric.BigFloat `json:"tip_amount"` Holders uint `json:"holders"` XFollowers uint `json:"x_followers"` BaseTokenSymbol string `json:"base_token_symbol"` BaseTokenPrice numeric.BigFloat `json:"base_token_price"` Percent float64 `json:"percent"` TotalVolume numeric.BigFloat `json:"total_volume"` Mentions uint `json:"mentions"` WalletBalance numeric.BigFloat `json:"wallet_balance"` DexUrl string `json:"dex_url"` } func NewAgentTokenResp(m *models.AgentInfo) *AgentTokenResp { if m == nil { return nil } resp := &AgentTokenResp{ ID: m.ID, AgentInfoID: m.ID, AgentInfo: NewAgentInfoResp(m), ContractAddress: m.TokenAddress, Name: m.TokenName, Symbol: m.TokenSymbol, ImageUrl: m.TokenImageUrl, TotalSupply: m.TokenSupply, } if m.TokenInfo != nil { resp.Price = m.TokenInfo.Price resp.MarketCap = numeric.BigFloat{*models.MulBigFloats(&m.TokenInfo.PriceUsd.Float, &m.TokenSupply.Float)} resp.PriceUsd = m.TokenInfo.PriceUsd resp.BaseTokenSymbol = m.TokenInfo.BaseTokenSymbol resp.BaseTokenPrice = m.TokenInfo.BaseTokenPrice resp.TipAmount = m.TokenInfo.TipAmount resp.Percent = m.TokenInfo.Percent resp.TotalVolume = m.TokenInfo.TotalVolume resp.WalletBalance = m.TokenInfo.WalletBalance resp.DexUrl = m.TokenInfo.DexUrl resp.NetworkID = m.TokenInfo.NetworkID resp.NetworkName = m.TokenInfo.NetworkName } return resp } func NewAgentTokenRespArry(arr []*models.AgentInfo) []*AgentTokenResp { resps := []*AgentTokenResp{} for _, m := range arr { resps = append(resps, NewAgentTokenResp(m)) } return resps } func NewAgentTwitterPostRespArry(arr []*models.AgentTwitterPost) []*AgentTwitterPostResp { resps := []*AgentTwitterPostResp{} for _, m := range arr { resps = append(resps, NewAgentTwitterPostResp(m)) } return resps } type AgentEaiTopupResp struct { ID uint `json:"id"` CreatedAt time.Time `json:"created_at"` AgentInfoID uint `json:"agent_info_id"` AgentInfo *AgentInfoResp `json:"agent_info"` NetworkID uint64 `json:"network_id"` NetworkName string `json:"network_name"` Type string `json:"type"` DepositTxHash string `json:"deposit_tx_hash"` TopupTxHash string `json:"topup_tx_hash"` Amount numeric.BigFloat `json:"amount"` Status models.AgentEaiTopupStatus `json:"status"` InscribeTxHash string `json:"inscribe_tx_hash"` DepositAddress string `json:"sender_address"` Toolset string `json:"toolset"` ToolsetName string `json:"toolset_name"` } func NewAgentEaiTopupResp(m *models.AgentEaiTopup) *AgentEaiTopupResp { if m == nil { return nil } resp := &AgentEaiTopupResp{ ID: m.ID, CreatedAt: m.CreatedAt, AgentInfoID: m.AgentInfoID, AgentInfo: NewAgentInfoResp(m.AgentInfo), Type: string(m.Type), NetworkName: models.GetChainName(m.NetworkID), Status: m.Status, NetworkID: m.NetworkID, DepositTxHash: m.DepositTxHash, TopupTxHash: m.TopupTxHash, Amount: m.Amount, InscribeTxHash: m.InscribeTxHash, DepositAddress: m.DepositAddress, Toolset: m.Toolset, } toolsetName := "Default" if v, ok := models.MAP_TOOLSET_NAME[m.Toolset]; ok { toolsetName = v } resp.ToolsetName = toolsetName return resp } func NewAgentEaiTopupRespArry(arr []*models.AgentEaiTopup) []*AgentEaiTopupResp { resps := []*AgentEaiTopupResp{} for _, m := range arr { resps = append(resps, NewAgentEaiTopupResp(m)) } return resps } // // type AgentSnapshotPostActionResp struct { ID uint `json:"id"` CreatedAt time.Time `json:"created_at"` AgentInfoID uint `json:"agent_info_id"` AgentSnapshotPostID uint `json:"agent_snapshot_post_id"` AgentTwitterId string `json:"agent_twitter_id"` Type models.AgentSnapshotPostActionType `json:"type"` TargetUsername string `json:"target_username"` TargetTwitterId string `json:"target_twitter_id"` Tweetid string `json:"tweetid"` Content string `json:"content"` Status models.AgentSnapshotPostActionStatus `json:"status"` FollowerCount uint `json:"follower_count"` Price numeric.BigFloat `json:"price"` InscribeTxHash string `json:"inscribe_tx_hash"` BitcoinTxHash string `json:"bitcoin_tx_hash"` } type AgentSnapshotPostResp struct { ID uint `json:"id"` CreatedAt time.Time `json:"created_at"` AgentInfoID uint `json:"agent_info_id"` AgentInfo *AgentInfoResp `json:"agent_info"` InferData string `json:"infer_data"` InferSnapshotHash string `json:"infer_snapshot_hash"` InferTxHash string `json:"infer_tx_hash"` InferAt *time.Time `json:"infer_at"` InferNum uint `json:"infer_num"` InferOutputData string `json:"infer_output_data"` InferOutputAt *time.Time `json:"infer_output_at"` Status models.AgentSnapshotPostStatus `json:"status"` InscribeTxHash string `json:"inscribe_tx_hash"` BitcoinTxHash string `json:"bitcoin_tx_hash"` Fee numeric.BigFloat `json:"fee"` AgentSnapshotPostAction []*AgentSnapshotPostActionResp `json:"agent_snapshot_post_action"` } func NewAgentSnapshotPostResp(m *models.AgentSnapshotPost) *AgentSnapshotPostResp { if m == nil { return nil } resp := &AgentSnapshotPostResp{ ID: m.ID, CreatedAt: m.CreatedAt, AgentInfoID: m.AgentInfoID, AgentInfo: NewAgentInfoResp(m.AgentInfo), InferData: m.InferData, InferSnapshotHash: m.InferSnapshotHash, InferTxHash: m.InferTxHash, InferAt: m.InferAt, InferNum: m.InferNum, InferOutputData: m.InferOutputData, InferOutputAt: m.InferOutputAt, Status: m.Status, InscribeTxHash: m.InscribeTxHash, BitcoinTxHash: m.BitcoinTxHash, Fee: m.Fee, AgentSnapshotPostAction: NewAgentSnapshotPostActionRespArry(m.AgentSnapshotPostAction), } return resp } func NewAgentSnapshotPostRespArry(arr []*models.AgentSnapshotPost) []*AgentSnapshotPostResp { resps := []*AgentSnapshotPostResp{} for _, m := range arr { resps = append(resps, NewAgentSnapshotPostResp(m)) } return resps } func NewAgentSnapshotPostActionResp(m *models.AgentSnapshotPostAction) *AgentSnapshotPostActionResp { if m == nil { return nil } resp := &AgentSnapshotPostActionResp{ ID: m.ID, CreatedAt: m.CreatedAt, AgentInfoID: m.AgentInfoID, AgentSnapshotPostID: m.AgentSnapshotPostID, AgentTwitterId: m.AgentTwitterId, Type: m.Type, TargetUsername: m.TargetUsername, TargetTwitterId: m.TargetTwitterId, Tweetid: m.Tweetid, Content: m.Content, Status: m.Status, FollowerCount: m.FollowerCount, Price: m.Price, InscribeTxHash: m.InscribeTxHash, BitcoinTxHash: m.BitcoinTxHash, } return resp } func NewAgentSnapshotPostActionRespArry(arr []*models.AgentSnapshotPostAction) []*AgentSnapshotPostActionResp { resps := []*AgentSnapshotPostActionResp{} for _, m := range arr { resps = append(resps, NewAgentSnapshotPostActionResp(m)) } return resps } type AdminAgentActionReq struct { ChainID uint64 `json:"chain_id"` AgentContractId string `json:"agent_contract_id"` ActionType models.AgentSnapshotPostActionType `json:"action_type"` IsTesting bool `json:"is_testing"` RefID string `json:"ref_id"` MissionID uint `json:"mission_id"` ConversationId string `json:"conversation_id"` InscribeTxHash string `json:"inscribe_tx_hash"` BitcoinTxHash string `json:"bitcoin_tx_hash"` ActionInput struct { Content string `json:"content"` TweetId string `json:"tweet_id"` Twid string `json:"twid"` TargetUsername string `json:"target_username"` Comment string `json:"comment"` Name string `json:"name"` Symbol string `json:"symbol"` Description string `json:"description"` ImageUrl string `json:"image_url"` Price numeric.BigFloat `json:"price"` } `json:"action_input"` } type CreateAgentWalletActionReq struct { Username string `json:"username"` ActionType string `json:"action_type"` ActionInput interface{} `json:"action_input"` } type AdminCreatePumpfunMemeReq struct { RefID string `json:"ref_id"` Name string `json:"name"` Symbol string `json:"symbol"` Description string `json:"description"` Amount float64 `json:"amount"` ImageBase64 string `json:"image_base64"` } type AdminTradePumpfunMemeReq struct { RefID string `json:"ref_id"` Action string `json:"action"` Mint string `json:"mint"` Amount float64 `json:"amount"` } type SolanaTokenBalanceResp struct { IsNative bool `json:"is_native"` Mint string `json:"mint"` Amount float64 `json:"amount"` } type WalletActionTradeResp struct { CreatedAt time.Time `json:"created_at"` Mint string `json:"mint"` Side string `json:"side"` AmountIn numeric.BigFloat `json:"amount_in"` AmountOut numeric.BigFloat `json:"amount_out"` TxHash string `json:"tx_hash"` } type PumpFunTradeResp struct { Signature string `json:"signature"` Mint string `json:"mint"` SolAmount float64 `json:"sol_amount"` TokenAmount float64 `json:"token_amount"` IsBuy bool `json:"is_buy"` Timestamp int64 `json:"timestamp"` } type DataChartResp struct { Time time.Time `json:"time"` Price float64 `json:"price"` } // //coinbase type AdminTradeBaseMemeReq struct { FromAssetId string `json:"from_asset_id"` ToAssetId string `json:"to_asset_id"` Amount string `json:"amount"` } type AgentSnapshotMissionConfigsResp struct { ID uint `json:"id"` NetworkID uint64 `json:"network_id"` ToolSet models.ToolsetType `json:"tool_set"` ToolSetName string `json:"tool_set_name"` } func NewAgentSnapshotMissionConfigsResp(m *models.AgentSnapshotMissionConfigs) *AgentSnapshotMissionConfigsResp { if m == nil { return nil } resp := &AgentSnapshotMissionConfigsResp{ ID: m.ID, NetworkID: m.NetworkID, ToolSet: m.ToolSet, ToolSetName: m.ToolSetName, } return resp } func NewAgentSnapshotMissionConfigsRespArry(arr []*models.AgentSnapshotMissionConfigs) []*AgentSnapshotMissionConfigsResp { resps := []*AgentSnapshotMissionConfigsResp{} for _, m := range arr { resps = append(resps, NewAgentSnapshotMissionConfigsResp(m)) } return resps } type AgentChatMessageReq struct { Messages []struct { Role string `json:"role"` Content string `json:"content"` } `json:"messages"` } type AgentTradeTokenResp struct { NetworkID uint64 `json:"network_id"` NetworkName string `json:"network_name"` TokenSymbol string `json:"token_symbol"` TokenName string `json:"token_name"` TokenAddress string `json:"token_address"` } func NewAgentTradeTokenResp(m *models.AgentTradeToken) *AgentTradeTokenResp { if m == nil { return nil } resp := &AgentTradeTokenResp{ NetworkID: m.NetworkID, NetworkName: m.NetworkName, TokenSymbol: m.TokenSymbol, TokenName: m.TokenName, TokenAddress: m.TokenAddress, } return resp } func NewAgentTradeTokenRespArry(arr []*models.AgentTradeToken) []*AgentTradeTokenResp { resps := []*AgentTradeTokenResp{} for _, m := range arr { resps = append(resps, NewAgentTradeTokenResp(m)) } return resps } type AdminTweetReq struct { Text string `json:"text"` } type AdminAgentActionByRefReq struct { ActionType models.AgentSnapshotPostActionType `json:"action_type"` Reason string `json:"reason"` } type TwitterTweetLikedResp struct { LikedUserID string `json:"liked_user_id"` TweetID string `json:"tweet_id"` TwitterID string `json:"twitter_id"` LikeCount int `json:"like_count"` RetweetCount int `json:"retweet_count"` ReplyCount int `json:"reply_count"` QuoteCount int `json:"quote_count"` ImpressionCount int `json:"impression_count"` FullText string `json:"full_text"` PostedAt time.Time `json:"posted_at"` InReplyToUserID string `json:"in_reply_to_user_id"` InReplyToTweetID string `json:"in_reply_to_tweet_id"` IsReply bool `json:"is_reply"` OriginalText string `json:"original_text"` // Retweet-related fields IsRetweet bool `json:"is_retweet"` RepostTweetID string `json:"repost_tweet_id"` RepostText string `json:"repost_text"` // Quote-related fields IsQuote bool `json:"is_quote"` QuoteTweetID string `json:"quote_tweet_id"` QuoteText string `json:"quote_text"` } func NewTwitterTweetLikedResp(m *models.TwitterTweetLiked) *TwitterTweetLikedResp { if m == nil { return nil } resp := &TwitterTweetLikedResp{ LikedUserID: m.LikedUserID, TweetID: m.TweetID, TwitterID: m.TwitterID, LikeCount: m.LikeCount, RetweetCount: m.RetweetCount, ReplyCount: m.ReplyCount, QuoteCount: m.QuoteCount, ImpressionCount: m.ImpressionCount, FullText: m.FullText, PostedAt: m.PostedAt, InReplyToUserID: m.InReplyToUserID, InReplyToTweetID: m.InReplyToTweetID, IsReply: m.IsReply, OriginalText: m.OriginalText, IsRetweet: m.IsRetweet, RepostTweetID: m.RepostTweetID, RepostText: m.RepostText, IsQuote: m.IsQuote, QuoteTweetID: m.QuoteTweetID, QuoteText: m.QuoteText, } return resp } func NewTwitterTweetLikedRespArr(arr []*models.TwitterTweetLiked) []*TwitterTweetLikedResp { resps := []*TwitterTweetLikedResp{} for _, m := range arr { resps = append(resps, NewTwitterTweetLikedResp(m)) } return resps } type AgentReportResp struct { NetworkID uint64 `json:"network_id"` NetworkName string `json:"network_name"` Counts int64 `json:"counts"` } func NewAgentReportResp(m *models.AgentInfo) *AgentReportResp { if m == nil { return nil } resp := &AgentReportResp{ NetworkID: m.NetworkID, NetworkName: m.NetworkName, Counts: m.Counts, } return resp } func NewAgentReportRespArr(arr []*models.AgentInfo) []*AgentReportResp { resps := []*AgentReportResp{} for _, m := range arr { resps = append(resps, NewAgentReportResp(m)) } return resps } type AgentChainFeeResp struct { NetworkID uint64 `json:"network_id"` InferFee numeric.BigFloat `json:"infer_fee"` MintFee numeric.BigFloat `json:"mint_fee"` TokenFee numeric.BigFloat `json:"token_fee"` } func NewAgentChainFeeResp(m *models.AgentChainFee) *AgentChainFeeResp { if m == nil { return nil } resp := &AgentChainFeeResp{ NetworkID: m.NetworkID, InferFee: m.InferFee, MintFee: m.MintFee, TokenFee: m.TokenFee, } return resp } func NewAgentChainFeeRespArr(arr []*models.AgentChainFee) []*AgentChainFeeResp { resps := []*AgentChainFeeResp{} for _, m := range arr { resps = append(resps, NewAgentChainFeeResp(m)) } return resps } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/serializers/agent_store.go ================================================ package serializers import ( "time" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/types/numeric" ) type AgentStoreReq struct { ID uint `json:"id"` Type models.AgentStoreType `json:"type"` Name string `json:"name"` Description string `json:"description"` AuthenUrl string `json:"authen_url"` ApiUrl string `json:"api_url"` Icon string `json:"icon"` Docs string `json:"docs"` Price numeric.BigFloat `json:"price"` Status models.AgentStoreStatus `json:"status"` } type AgentStoreMissionReq struct { ID uint `json:"id"` Name string `json:"name"` Description string `json:"description"` Prompt string `json:"prompt"` Price numeric.BigFloat `json:"price"` ToolList string `json:"tool_list"` Icon string `json:"icon"` NetworkID uint64 `json:"network_id"` Model string `json:"model"` Status string `json:"status"` } type AuthenAgentStoreCallback struct { Code string `json:"code"` CallbackParams map[string]string `json:"callback_params"` } type AgentStoreResp struct { ID uint `json:"id"` CreatedAt time.Time `json:"created_at"` Name string `json:"name"` Owner string `json:"owner"` Description string `json:"description"` AuthenUrl string `json:"authen_url"` Icon string `json:"icon"` Docs string `json:"docs"` ApiUrl string `json:"api_url"` Status models.AgentStoreStatus `json:"status"` Price numeric.BigFloat `json:"price"` NumInstall uint `json:"num_install"` NumUsage uint `json:"num_usage"` Type string `json:"type"` AgentStoreMissions []*AgentStoreMissionResp `json:"agent_store_missions"` } type AgentStoreTryDetailResp struct { HistoryID uint `json:"history_id"` DetailID uint `json:"detail_id"` FromUser bool `json:"from_user"` Content string `json:"content"` AgentSnapshotPost *AgentSnapshotPostResp `json:"id"` CreatedAt time.Time `json:"created_at"` } func NewAgentStoreResp(m *models.AgentStore) *AgentStoreResp { if m == nil { return nil } return &AgentStoreResp{ ID: m.ID, CreatedAt: m.CreatedAt, Name: m.Name, Description: m.Description, AuthenUrl: m.AuthenUrl, Icon: m.Icon, Docs: m.Docs, ApiUrl: m.ApiUrl, NumInstall: m.NumInstall, Status: m.Status, Price: m.Price, Owner: m.OwnerAddress, Type: string(m.Type), NumUsage: m.NumUsage, AgentStoreMissions: NewAgentStoreMissionRespArray(m.AgentStoreMissions), } } func NewAgentStoreRespArray(arr []*models.AgentStore) []*AgentStoreResp { resps := []*AgentStoreResp{} for _, r := range arr { resps = append(resps, NewAgentStoreResp(r)) } return resps } type AgentStoreMissionResp struct { AgentStoreID uint `json:"agent_store_id"` ID uint `json:"id"` CreatedAt time.Time `json:"created_at"` Name string `json:"name"` Description string `json:"description"` UserPrompt string `json:"user_prompt"` Price numeric.BigFloat `json:"price"` ToolList string `json:"tool_list"` Icon string `json:"icon"` NumUsed uint `json:"num_used"` Status string `json:"status"` } func NewAgentStoreMissionResp(m *models.AgentStoreMission) *AgentStoreMissionResp { if m == nil { return nil } return &AgentStoreMissionResp{ AgentStoreID: m.AgentStoreID, ID: m.ID, CreatedAt: m.CreatedAt, Name: m.Name, Description: m.Description, UserPrompt: m.UserPrompt, Price: m.Price, ToolList: m.ToolList, Icon: m.Icon, NumUsed: m.NumUsed, Status: string(m.Status), } } func NewAgentStoreMissionRespArray(arr []*models.AgentStoreMission) []*AgentStoreMissionResp { resps := []*AgentStoreMissionResp{} for _, r := range arr { resps = append(resps, NewAgentStoreMissionResp(r)) } return resps } func NewAgentStoreRespArrayFromInstall(arr []*models.AgentStoreInstall) []*AgentStoreResp { resps := []*AgentStoreResp{} for _, r := range arr { resps = append(resps, NewAgentStoreResp(r.AgentStore)) } return resps } func NewAgentStoreTryDetailResp(m *models.AgentStoreTryDetail) *AgentStoreTryDetailResp { if m == nil { return nil } return &AgentStoreTryDetailResp{ CreatedAt: m.CreatedAt, HistoryID: m.AgentStoreTryID, DetailID: m.ID, FromUser: m.FromUser, Content: m.Content, AgentSnapshotPost: NewAgentSnapshotPostResp(m.AgentSnapshotPost), } } func NewAgentStoreTryDetailRespArray(arr []*models.AgentStoreTryDetail) []*AgentStoreTryDetailResp { resps := []*AgentStoreTryDetailResp{} for _, r := range arr { resps = append(resps, NewAgentStoreTryDetailResp(r)) } return resps } // //// type AgentUtilityTwitterReq struct { AgentID string `json:"agent_id"` Content string `json:"content"` TxHash string `json:"tx_hash"` } type AgentUtilityTwitterResp struct { Message string `json:"message"` AuthUrl string `json:"auth_url"` } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/serializers/agent_token_serializers.go ================================================ package serializers import ( "math/big" "time" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/types/numeric" ) type MemeReq struct { Name string `json:"name"` Ticker string `json:"ticker"` Description string `json:"description"` Image string `json:"image"` Twitter string `json:"twitter"` Telegram string `json:"telegram"` Website string `json:"website"` TxHash string `json:"tx_hash"` SystemPrompt string `json:"system_prompt"` OnchainImage bool `json:"onchain_image"` TotalSuply numeric.BigFloat `json:"total_suply"` Decimals uint64 `json:"decimals"` Cat20Token string `json:"cat20_token"` BtcPair bool `json:"bt_pair"` FbPair bool `json:"fb_pair"` AgentInfoID uint `json:"agent_info_id"` BaseTokenSymbol string `json:"base_token_symbol"` NotGraduated bool `json:"not_graduated"` } type MemeResp struct { ID uint `json:"id"` NetworkID uint64 `json:"network_id"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` OwnerAddress string `json:"owner_address"` Owner *UserResp `json:"owner"` TokenAddress string `json:"token_address"` TokenId string `json:"token_id"` Name string `json:"name"` Description string `json:"description"` Ticker string `json:"ticker"` Image string `json:"image"` Twitter string `json:"twitter"` Telegram string `json:"telegram"` Website string `json:"website"` TxHash string `json:"tx_hash"` Status string `json:"status"` ReplyCount uint64 `json:"reply_count"` LastReply *time.Time `json:"last_reply"` Pool string `json:"pool"` UniswapPool string `json:"uniswap_pool"` Supply numeric.BigFloat `json:"supply"` Price numeric.BigFloat `json:"price"` PriceUsd numeric.BigFloat `json:"price_usd"` PriceLast24h numeric.BigFloat `json:"price_last24h"` VolumeLast24h numeric.BigFloat `json:"volume_last24h"` TotalVolume numeric.BigFloat `json:"total_volume"` BaseTokenSymbol string `json:"base_token_symbol"` Percent float64 `json:"percent"` Decimals uint64 `json:"decimals"` PoolFee uint `json:"pool_fee"` MarketCap numeric.BigFloat `json:"market_cap"` TotalBalance numeric.BigFloat `json:"total_balance"` SystemPrompt string `json:"system_prompt"` Holders int `json:"holders"` Shared int `json:"shared"` AgentInfo *AgentInfoResp `json:"agent_info"` LatestTwitterPost *AgentTwitterPostResp `json:"latest_twitter_post"` DexUrl string `json:"dex_url"` TradeUrl string `json:"trade_url"` DexId string `json:"dex_id"` } func NewMemeResp(m *models.Meme) *MemeResp { if m == nil { return nil } volumeUSD := models.MulBigFloats(&m.PriceUsd.Float, &m.VolumeLast24h.Float) resp := &MemeResp{ ID: m.ID, CreatedAt: m.CreatedAt, UpdatedAt: m.UpdatedAt, NetworkID: m.NetworkID, OwnerAddress: m.OwnerAddress, TokenAddress: m.TokenAddress, TokenId: m.TokenId, Description: m.Description, Name: m.Name, Ticker: m.Ticker, Image: m.Image, Twitter: m.Twitter, Telegram: m.Telegram, Website: m.Website, Status: string(m.Status), Owner: NewUserResp(m.Owner), Pool: m.Pool, UniswapPool: m.UniswapPool, Supply: m.Supply, Price: m.Price, PriceUsd: m.PriceUsd, PriceLast24h: m.PriceLast24h, VolumeLast24h: numeric.BigFloat{*volumeUSD}, TotalVolume: m.TotalVolume, BaseTokenSymbol: m.BaseTokenSymbol, ReplyCount: m.ReplyCount, LastReply: m.LastReply, Percent: m.Percent, Decimals: m.Decimals, PoolFee: m.PoolFee, MarketCap: m.MarketCap, TotalBalance: m.TotalBalance, Holders: m.Holders, Shared: m.Shared, } if m.AgentInfo != nil { resp.AgentInfo = NewAgentInfoResp(m.AgentInfo) } if m.LatestAgentTwitterPost != nil { resp.LatestTwitterPost = NewAgentTwitterPostResp(m.LatestAgentTwitterPost) } return resp } func NewMemeRespWithToken(m *models.Meme) *MemeResp { if m == nil { return nil } volumeUSD := models.MulBigFloats(&m.PriceUsd.Float, &m.VolumeLast24h.Float) resp := &MemeResp{ ID: m.ID, CreatedAt: m.CreatedAt, UpdatedAt: m.UpdatedAt, OwnerAddress: m.OwnerAddress, TokenAddress: m.TokenAddress, Description: m.Description, Name: m.Name, Ticker: m.Ticker, Image: m.Image, Twitter: m.Twitter, Telegram: m.Telegram, Website: m.Website, Status: string(m.Status), Owner: NewUserResp(m.Owner), Pool: m.Pool, UniswapPool: m.UniswapPool, Supply: m.Supply, Price: m.Price, PriceUsd: m.PriceUsd, PriceLast24h: m.PriceLast24h, VolumeLast24h: numeric.BigFloat{*volumeUSD}, TotalVolume: m.TotalVolume, BaseTokenSymbol: m.BaseTokenSymbol, ReplyCount: m.ReplyCount, LastReply: m.LastReply, Percent: m.Percent, Decimals: m.Decimals, PoolFee: m.PoolFee, MarketCap: m.MarketCap, TotalBalance: m.TotalBalance, Holders: m.Holders, Shared: m.Shared, NetworkID: m.NetworkID, } resp.DexUrl = models.GetDexUrl(m.NetworkID, m.TokenAddress) resp.TradeUrl = models.GetTradeUrl(m.NetworkID, m.TokenAddress, "") return resp } func NewMemeFromTokenInfoResp(m *models.AgentTokenInfo, agentInfo *models.AgentInfo) *MemeResp { if m == nil { return nil } resp := &MemeResp{ ID: m.ID, CreatedAt: m.CreatedAt, UpdatedAt: m.UpdatedAt, TokenAddress: agentInfo.TokenAddress, Name: agentInfo.TokenName, Ticker: agentInfo.TokenSymbol, Pool: m.PoolAddress, UniswapPool: m.PoolAddress, Price: m.Price, PriceUsd: m.PriceUsd, PriceLast24h: m.PriceLast24h, VolumeLast24h: m.VolumeLast24h, TotalVolume: m.TotalVolume, BaseTokenSymbol: m.BaseTokenSymbol, Percent: m.PriceChange, MarketCap: numeric.NewBigFloatFromFloat(big.NewFloat(m.UsdMarketCap)), DexId: m.DexId, DexUrl: m.DexUrl, Status: string(models.MemeStatusAddPoolLevel2), NetworkID: agentInfo.TokenNetworkID, } resp.DexUrl = models.GetDexUrl(agentInfo.TokenNetworkID, agentInfo.TokenAddress) resp.TradeUrl = models.GetTradeUrl(agentInfo.TokenNetworkID, agentInfo.TokenAddress, m.DexId) return resp } func NewMemeRespArray(arr []*models.Meme) []*MemeResp { resps := []*MemeResp{} for _, m := range arr { resps = append(resps, NewMemeResp(m)) } return resps } type MemeTradeHistoryResp struct { TxHash string `json:"tx_hash"` TxAt time.Time `json:"tx_at"` RecipientAddress string `json:"recipient_address"` RecipientUser *UserResp `json:"recipient_user"` Price numeric.BigFloat `json:"price"` MemeTokenAddress string `json:"meme_token_address"` MemeID uint `json:"meme_id"` Meme *MemeResp `json:"meme"` AmountIn numeric.BigFloat `json:"amount_in"` AmountOut numeric.BigFloat `json:"amount_out"` BaseTokenSymbol string `json:"base_token_symbol"` BaseTokenPrice numeric.BigFloat `json:"base_token_price"` BaseAmount numeric.BigFloat `json:"base_amount"` TokenAmount numeric.BigFloat `json:"token_amount"` IsBuy bool `json:"is_buy"` } func NewTradeHistoryResp(m *models.MemeTradeHistory) *MemeTradeHistoryResp { if m == nil { return nil } resp := &MemeTradeHistoryResp{ TxAt: m.TxAt, TxHash: m.TxHash, BaseTokenSymbol: m.BaseTokenSymbol, BaseTokenPrice: m.BaseTokenPrice, RecipientAddress: m.RecipientAddress, RecipientUser: NewUserResp(m.RecipientUser), Price: m.Price, MemeTokenAddress: m.MemeTokenAddress, MemeID: m.MemeID, Meme: NewMemeResp(m.Meme), AmountIn: m.AmountIn, AmountOut: m.AmountOut, BaseAmount: m.BaseAmount, TokenAmount: m.TokenAmount, IsBuy: m.IsBuy, } return resp } func NewTradeHistoryRespArry(arr []*models.MemeTradeHistory) []*MemeTradeHistoryResp { resps := []*MemeTradeHistoryResp{} for _, m := range arr { resps = append(resps, NewTradeHistoryResp(m)) } return resps } // // type WithdrawCrossChainReq struct { TxHash string `json:"tx_hash"` } type MemeThreadReq struct { UserAddress string `json:"user_address"` UserID uint `json:"user_id"` MemeID uint `json:"meme_id"` ThreadID uint `json:"thread_id"` Text string `json:"text"` ImageUrl string `json:"image_url"` ParentThreadID uint `json:"parent_thread_id"` } type MemeThreadResp struct { ID uint `json:"id"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` UserID uint `json:"user_id"` User *UserResp `json:"user"` MemeID uint `json:"meme_id"` Meme *MemeResp `json:"meme"` Text string `json:"text"` ImageUrl string `json:"image_url"` Likes int64 `json:"likes"` ParentThreadID uint `json:"parent_thread_id"` Liked bool `json:"liked"` } func NewMemeThreadResp(m *models.MemeThreads) *MemeThreadResp { if m == nil { return nil } resp := &MemeThreadResp{ MemeID: m.MemeID, Meme: NewMemeResp(m.Meme), ID: m.ID, CreatedAt: m.CreatedAt, UpdatedAt: m.UpdatedAt, UserID: m.UserID, User: NewUserResp(m.User), Text: m.Text, ImageUrl: m.ImageUrl, Likes: m.Likes, ParentThreadID: m.ParentThreadID, Liked: m.Liked, } return resp } func NewMemeThreadRespArry(arr []*models.MemeThreads) []*MemeThreadResp { resps := []*MemeThreadResp{} for _, m := range arr { resps = append(resps, NewMemeThreadResp(m)) } return resps } // //// type MemeFollowersResp struct { UserID uint `json:"user_id"` User *UserResp `json:"user"` FollowUserID uint `json:"follow_user_id"` FollowUser *UserResp `json:"follow_user"` } func NewMemeFollowersResp(m *models.MemeFollowers) *MemeFollowersResp { if m == nil { return nil } resp := &MemeFollowersResp{ UserID: m.UserID, User: NewUserResp(m.User), FollowUserID: m.FollowUserID, FollowUser: NewUserResp(m.FollowUser), } return resp } func NewMemeFollowersRespArray(arr []*models.MemeFollowers) []*MemeFollowersResp { resps := []*MemeFollowersResp{} for _, m := range arr { resps = append(resps, NewMemeFollowersResp(m)) } return resps } // /// type MemeNotificationResp struct { ID uint `json:"id"` CreatedAt time.Time `json:"created_at"` MemeID uint `json:"meme_id"` Meme *MemeResp `json:"meme"` FollowerID uint `json:"follower_id"` Follower *UserResp `json:"follower"` NotiType models.NotiType `json:"noti_type"` Value string `json:"value"` Seen bool `json:"seen"` } func NewMemeNotificationResp(m *models.MemeNotification) *MemeNotificationResp { if m == nil { return nil } resp := &MemeNotificationResp{ ID: m.ID, CreatedAt: m.CreatedAt, MemeID: m.MemeID, Meme: NewMemeResp(m.Meme), FollowerID: m.FollowerID, Follower: NewUserResp(m.Follower), NotiType: m.NotiType, Value: m.Value, Seen: m.Seen, } return resp } func NewMemeNotificationRespArry(arr []*models.MemeNotification) []*MemeNotificationResp { resps := []*MemeNotificationResp{} for _, m := range arr { resps = append(resps, NewMemeNotificationResp(m)) } return resps } type MemeBurnHistoryResp struct { TxHash string `json:"tx_hash"` TxAt time.Time `json:"tx_at"` Value numeric.BigFloat `json:"value"` ContractAddress string `json:"contract_address"` Name string `json:"token_name"` Ticker string `json:"token_ticker"` Image string `json:"token_image"` TwitterName string `json:"twitter_name"` TwitterUsername string `json:"twitter_username"` TwitterAvatar string `json:"twitter_avatar"` UserTwitterID string `json:"user_twitter_id"` UserAddress string `json:"user_address"` UserName string `json:"user_name"` ImageURL string `json:"user_image_url"` } func NewMemeBurnHistoryResp(m *models.TokenTransfer) *MemeBurnHistoryResp { if m == nil { return nil } resp := &MemeBurnHistoryResp{ TxAt: *m.TransactionAt, TxHash: m.TxHash, Value: m.Value, ContractAddress: m.ContractAddress, Name: m.Name, Ticker: m.Ticker, Image: m.Image, TwitterName: m.TwitterName, TwitterUsername: m.TwitterUsername, TwitterAvatar: m.TwitterAvatar, UserTwitterID: m.UserTwitterID, UserAddress: m.From, UserName: m.UserName, ImageURL: m.ImageURL, } return resp } func NewMemeBurnHistoryRespArry(arr []*models.TokenTransfer) []*MemeBurnHistoryResp { resps := []*MemeBurnHistoryResp{} for _, m := range arr { resps = append(resps, NewMemeBurnHistoryResp(m)) } return resps } type Cat20TransferTransactionResp struct { TokenId string `json:"token_id"` ReceiverAddress string `json:"receiver_address"` SendAmount numeric.BigFloat `json:"send_amount"` SenderAddress string `json:"sender_address"` TxHash string `json:"tx_hash"` TxAt *time.Time `json:"tx_at"` Error string `json:"error"` } func NewCat20TransferTransactionResp(m *models.Cat20TransferTransaction) *Cat20TransferTransactionResp { if m == nil { return nil } resp := &Cat20TransferTransactionResp{ TokenId: m.TokenId, ReceiverAddress: m.ReceiverAddress, SendAmount: m.SendAmount, SenderAddress: m.SenderAddress, TxHash: m.TxHash, TxAt: m.TxAt, Error: m.Error, } return resp } type TransferCatReq struct { TokenId string `json:"token_id"` ReceiverAddress string `json:"receiver_address"` SendAmount string `json:"send_amount"` SenderAddress string `json:"sender_address"` WifPrivateKey string `json:"wif_private_key"` } type UserVideoResp struct { ID uint `json:"id"` CreatedAt time.Time `json:"created_at"` TokenName string `json:"token_name"` TokenSymbol string `json:"token_symbol"` TokenAddress string `json:"token_address"` TokenImageUrl string `json:"token_image_url"` TokenDesc string `json:"token_desc"` RequestorAddress string `json:"requestor_address"` OwnerTwitterID string `json:"owner_twitter_id"` AgentTwitterPostID uint `json:"agent_twitter_post_id"` AgentTwitterPost *AgentTwitterPostResp `json:"agent_twitter_post"` } func NewUserVideoResp(m *models.ClankerVideoToken) *UserVideoResp { if m == nil { return nil } return &UserVideoResp{ ID: m.ID, CreatedAt: m.CreatedAt, TokenName: m.TokenName, TokenSymbol: m.TokenSymbol, TokenAddress: m.TokenAddress, TokenImageUrl: m.TokenImageUrl, TokenDesc: m.TokenDesc, RequestorAddress: m.RequestorAddress, OwnerTwitterID: m.OwnerTwitterID, AgentTwitterPostID: m.AgentTwitterPostID, AgentTwitterPost: NewAgentTwitterPostResp(m.AgentTwitterPost), } } func NewUserVideoRespArray(arr []*models.ClankerVideoToken) []*UserVideoResp { resps := []*UserVideoResp{} for _, r := range arr { resps = append(resps, NewUserVideoResp(r)) } return resps } type TrendingTokenResp struct { ChainId string `json:"chain_id"` TokenAddress string `json:"token_address"` Name string `json:"name"` Symbol string `json:"symbol"` Decimals int `json:"decimals"` Logo string `json:"logo"` UsdPrice float64 `json:"usd_price"` MarketCap float64 `json:"market_cap"` LiquidityUsd float64 `json:"liquidity_usd"` Holders int `json:"holders"` MintAt *time.Time `json:"mint_at"` Volume1h float64 `json:"volume1h"` Transactions1h int `json:"transactions1h"` Buyers1h int `json:"buyers1h"` } func NewTrendingTokenResp(m *models.TrendingToken) *TrendingTokenResp { if m == nil { return nil } return &TrendingTokenResp{ TokenAddress: m.TokenAddress, Name: m.Name, Symbol: m.Symbol, Decimals: m.Decimals, Logo: m.Logo, UsdPrice: m.UsdPrice, MarketCap: m.MarketCap, LiquidityUsd: m.LiquidityUsd, Holders: m.Holders, MintAt: m.MintAt, Volume1h: m.Volume1h, Transactions1h: m.Transactions1h, Buyers1h: m.Buyers1h, ChainId: m.ChainId, } } func NewTrendingTokenRespArray(arr []*models.TrendingToken) []*TrendingTokenResp { resps := []*TrendingTokenResp{} for _, m := range arr { resps = append(resps, NewTrendingTokenResp(m)) } return resps } type UserVideoInfoResp struct { TwitterID string `json:"twitter_id"` Address string `json:"address"` UserAddress string `json:"user_address"` WalletType models.WalletType `json:"wallet_type"` } func NewUserVideoInfoResp(m *models.PrivyWallet) *UserVideoInfoResp { if m == nil { return nil } return &UserVideoInfoResp{ Address: m.Address, TwitterID: m.TwitterID, UserAddress: m.UserAddress, WalletType: m.WalletType, } } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/serializers/api_key_subscription.go ================================================ package serializers import ( "time" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/types/numeric" ) type ApiTokenUsageReq struct { ApiKey string `json:"api_key"` NumToken uint `json:"num_token"` Endpoint string `json:"endpoint"` NetworkID uint64 `json:"network_id"` } type ApiSubscriptionPackageResp struct { Name string `json:"name"` Description string `json:"description"` Price numeric.BigFloat `json:"price"` NetworkID uint64 `json:"network_id"` NumToken uint64 `json:"num_token"` Type models.PackageType `json:"type"` DurationDay uint `json:"duration_day"` } func NewApiSubscriptionPackageResp(m *models.ApiSubscriptionPackage) *ApiSubscriptionPackageResp { if m == nil { return nil } return &ApiSubscriptionPackageResp{ Name: m.Name, Description: m.Description, Price: m.Price, NetworkID: m.NetworkID, NumToken: m.NumToken, Type: m.Type, DurationDay: m.DurationDay, } } func NewApiSubscriptionPackageRespArr(arr []*models.ApiSubscriptionPackage) []*ApiSubscriptionPackageResp { resps := []*ApiSubscriptionPackageResp{} for _, m := range arr { resps = append(resps, NewApiSubscriptionPackageResp(m)) } return resps } type ApiSubscriptionKeyResp struct { NetworkID uint64 `json:"network_id"` UserAddress string `json:"user_address"` TwitterID string `json:"twitter_id"` TwitterInfoID uint `json:"twitter_info_id"` ApiKey string `json:"api_key"` PackageID uint `json:"package_id"` Package *ApiSubscriptionPackageResp `json:"package"` QuotaRemaining uint64 `json:"quota_remaining"` StartedAt *time.Time `json:"started_at"` ExpiresAt *time.Time `json:"expires_at"` DepositAddress string `json:"deposit_address"` } func NewApiSubscriptionKeyResp(m *models.ApiSubscriptionKey) *ApiSubscriptionKeyResp { if m == nil { return nil } return &ApiSubscriptionKeyResp{ NetworkID: m.NetworkID, UserAddress: m.UserAddress, TwitterID: m.TwitterID, TwitterInfoID: m.TwitterInfoID, ApiKey: m.ApiKey, PackageID: m.PackageID, Package: NewApiSubscriptionPackageResp(&m.Package), QuotaRemaining: m.QuotaRemaining, StartedAt: m.StartedAt, ExpiresAt: m.ExpiresAt, DepositAddress: m.DepositAddress, } } func NewApiSubscriptionKeyRespArr(arr []*models.ApiSubscriptionKey) []*ApiSubscriptionKeyResp { resps := []*ApiSubscriptionKeyResp{} for _, m := range arr { resps = append(resps, NewApiSubscriptionKeyResp(m)) } return resps } type ApiSubscriptionHistoryResp struct { NetworkID uint64 `json:"network_id"` UserAddress string `json:"user_address"` ApiKey string `json:"api_key"` PackageID uint `json:"package_id"` Package *ApiSubscriptionPackageResp `json:"package"` DepositAddress string `json:"deposit_address"` DepositStatus models.DepositStatus `json:"deposit_status"` TxHash string `json:"tx_hash"` NumToken uint64 `json:"num_token"` StartedAt *time.Time `json:"started_at"` ExpiresAt *time.Time `json:"expires_at"` } func NewApiSubscriptionHistoryResp(m *models.ApiSubscriptionHistory) *ApiSubscriptionHistoryResp { if m == nil { return nil } return &ApiSubscriptionHistoryResp{ NetworkID: m.NetworkID, UserAddress: m.UserAddress, ApiKey: m.ApiKey, PackageID: m.PackageID, Package: NewApiSubscriptionPackageResp(&m.Package), DepositAddress: m.DepositAddress, DepositStatus: m.DepositStatus, TxHash: m.TxHash, NumToken: m.NumToken, StartedAt: m.StartedAt, ExpiresAt: m.ExpiresAt, } } func NewApiSubscriptionHistoryRespArr(arr []*models.ApiSubscriptionHistory) []*ApiSubscriptionHistoryResp { resps := []*ApiSubscriptionHistoryResp{} for _, m := range arr { resps = append(resps, NewApiSubscriptionHistoryResp(m)) } return resps } type ApiSubscriptionUsageLogResp struct { ApiKey string `json:"api_key"` Endpoint string `json:"endpoint"` NumToken uint64 `json:"num_token"` } func NewApiSubscriptionUsageLogResp(m *models.ApiSubscriptionUsageLog) *ApiSubscriptionUsageLogResp { if m == nil { return nil } return &ApiSubscriptionUsageLogResp{ ApiKey: m.ApiKey, Endpoint: m.Endpoint, NumToken: m.NumToken, } } func NewApiSubscriptionUsageLogRespArr(arr []*models.ApiSubscriptionUsageLog) []*ApiSubscriptionUsageLogResp { resps := []*ApiSubscriptionUsageLogResp{} for _, m := range arr { resps = append(resps, NewApiSubscriptionUsageLogResp(m)) } return resps } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/serializers/external_wallet_serializers.go ================================================ package serializers import ( "time" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/types/numeric" ) type ExternalWalletResp struct { ApiKey string `json:"api_key"` Address string `json:"address"` } type ExternalWalletOrderReq struct { Action models.ExternalWalletOrderType `json:"action"` Mint string `json:"mint"` Amount float64 `json:"amount"` Destination string `json:"destination"` } type ExternalWalletOrderResp struct { ID uint `json:"id"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` ExternalWalletID uint `json:"external_wallet_id"` Type models.ExternalWalletOrderType `json:"type"` TokenAddress string `json:"token_address"` Destination string `json:"destination"` AmountIn numeric.BigFloat `json:"amount_in"` AmountOut numeric.BigFloat `json:"amount_out"` TxHash string `json:"tx_hash"` Status models.ExternalWalletOrderStatus `json:"status"` Error string `json:"error"` } func NewExternalWalletOrderResp(m *models.ExternalWalletOrder) *ExternalWalletOrderResp { if m == nil { return nil } resp := &ExternalWalletOrderResp{ ID: m.ID, CreatedAt: m.CreatedAt, UpdatedAt: m.UpdatedAt, ExternalWalletID: m.ExternalWalletID, Type: m.Type, TokenAddress: m.TokenAddress, Destination: m.Destination, AmountIn: m.AmountIn, AmountOut: m.AmountOut, TxHash: m.TxHash, Status: m.Status, Error: m.Error, } return resp } func NewExternalWalletOrderRespArr(arr []*models.ExternalWalletOrder) []*ExternalWalletOrderResp { resps := []*ExternalWalletOrderResp{} for _, m := range arr { resps = append(resps, NewExternalWalletOrderResp(m)) } return resps } type ExternalWalletTokenResp struct { ID uint `json:"id"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` Symbol string `json:"symbol"` Name string `json:"name"` TokenAddress string `json:"token_address"` Enabled bool `json:"enabled"` Decimals int `json:"decimals"` CoingeckoSlug string `json:"coingecko_slug"` } func NewExternalWalletTokenResp(m *models.ExternalWalletToken) *ExternalWalletTokenResp { if m == nil { return nil } resp := &ExternalWalletTokenResp{ ID: m.ID, CreatedAt: m.CreatedAt, UpdatedAt: m.UpdatedAt, Symbol: m.Symbol, Name: m.Name, TokenAddress: m.TokenAddress, Enabled: m.Enabled, Decimals: m.Decimals, CoingeckoSlug: m.CoingeckoSlug, } return resp } func NewExternalWalletTokenRespArr(arr []*models.ExternalWalletToken) []*ExternalWalletTokenResp { resps := []*ExternalWalletTokenResp{} for _, m := range arr { resps = append(resps, NewExternalWalletTokenResp(m)) } return resps } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/serializers/infer_req.go ================================================ package serializers import "github.com/sashabaranov/go-openai" type KnowledgeBaseInfoType string var KnowledgeBaseInfoTypePublic KnowledgeBaseInfoType = "public" var KnowledgeBaseInfoTypePrivate KnowledgeBaseInfoType = "private" type KnowledgeBaseInfo struct { Type KnowledgeBaseInfoType `json:"type"` Title string `json:"title"` FileDescription string `json:"file_description"` Creator string `json:"creator"` } type WakeupRequestMetadata struct { TwitterId string `json:"twitter_id"` TwitterUsername string `json:"twitter_username"` AgentContractId string `json:"agent_contract_id"` ChainId string `json:"chain_id"` SystemReminder string `json:"system_reminder"` Params ParamWakeupRequest `json:"params"` RefID string `json:"ref_id"` ListKnowledgeBase []*KnowledgeBaseInfo `json:"list_knowledge_base"` } type ParamWakeupRequest struct { QuoteUsername string `json:"quote_username"` } type ChatCompletionRequest struct { openai.ChatCompletionRequest `json:",inline"` ChainId uint64 `json:"chain_id"` UserAddress string `json:"user_address"` InternalServer bool `json:"internal_server"` MetaData *WakeupRequestMetadata `json:"meta_data"` } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/serializers/knowledge_serializers.go ================================================ package serializers import ( "time" "github.com/sashabaranov/go-openai" ) type CreateKnowledgeRequest struct { Name string `json:"name" form:"name"` Description string `json:"description" form:"description"` NetworkID uint64 `json:"network_id" form:"network_id"` AgentInfoId uint `json:"agent_info_id" form:"-"` Files []*File `json:"files" form:"files"` UserAddress string `json:"user_address" form:"-"` DepositAddress string `json:"-" form:"-"` ThumbnailUrl string `json:"thumbnail_url" form:"thumbnail_url"` SolanaDepositAddress string `json:"-" form:"-"` DomainUrl string `json:"domain_url" form:"domain_url"` } type UpdateKnowledgeRequest struct { Name string `json:"name" form:"name"` Description string `json:"description" form:"description"` NetworkID uint64 `json:"network_id"` UserAddress string `json:"user_address" form:"-"` Files []*File `json:"files" form:"files"` DomainUrl string `json:"domain_url" form:"domain_url"` } type File struct { FileUrl string `json:"file_url" form:"file_url"` FileName string `json:"file_name" form:"file_name"` FileSize uint `json:"file_size" form:"file_size"` KbFileId uint `json:"kb_file_id" form:"kb_file_id"` KnowledgeBaseId uint `json:"knowledge_base_id" form:"knowledge_base_id"` } type KnowledgeBase struct { ID uint `json:"id"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` Status int64 `json:"status"` UserAddress string `json:"user_address"` DepositAddress string `json:"deposit_address"` SolanaDepositAddress string `json:"solana_deposit_address"` DepositTxHash string `json:"deposit_tx_hash"` Name string `json:"name"` Description string `json:"description"` AgentInfoId uint `json:"agent_info_id"` ResultUrl string `json:"result_url"` NetworkID uint64 `json:"network_id"` Fee float64 `json:"fee"` KnowledgeBaseFiles []*KnowledgeBaseFile `json:"knowledge_base_files"` KBTokenContractAddress string `json:"kb_token_contract_address"` KBTokenID string `json:"kb_token_id"` KbId string `json:"kb_id"` ThumbnailUrl string `json:"thumbnail_url"` LastErrorMessage string `json:"last_error_message"` UsageFee float64 `json:"usage_fee"` UserCount int64 `json:"user_count"` UsageCount int64 `json:"usage_count"` ChargeMore float64 `json:"charge_more"` FilecoinHash string `json:"filecoin_hash"` DomainUrl string `json:"domain_url"` } type KnowledgeBaseFile struct { Id uint `json:"id"` KnowledgeBaseId uint `json:"knowledge_base_id"` FileUrl string `json:"file_url"` FileName string `json:"file_name"` FileSize uint `json:"file_size"` FilecoinHash string `json:"filecoin_hash"` Status int `json:"status"` LastErrorMessage string `json:"last_error_message"` } type AgentUseKnowledgeBaseRequest struct { AgentID string `json:"agent_id" form:"agent_id"` KnowledgeBaseID uint `json:"knowledge_base_id" form:"knowledge_base_id"` UserAddress string `json:"-"` } type RetrieveKnowledgeBaseRequest struct { Query string `json:"query"` TopK int `json:"top_k"` Kb []string `json:"kb"` Threshold float64 `json:"threshold"` } type RetrieveKnowledgeBaseResponse struct { Result []struct { Content string `json:"content"` Score float64 `json:"score"` Reference string `json:"reference"` } `json:"result"` Error interface{} `json:"error"` Status string `json:"status"` } type UpdateKnowledgeBaseWithSignatureRequest struct { KnowledgeBaseId string `json:"knowledge_base_id"` NetworkID string `json:"network_id"` // sysPrompt []byte, promptKey string, promptIdx *big.Int, randomNonce *big.Int, signature []byte HashData string `json:"hash_data"` PromptKeyData string `json:"prompt_key_data"` RandomNonceData string `json:"random_nonce_data"` SignatureData string `json:"signature_data"` //uint256 agentId, string uri, uint256 randomNonce, bytes signature /*HashUri string `json:"hash_uri"` RandomNonceUri string `json:"random_nonce_uri"` SignatureUri string `json:"signature_uri"`*/ } type RetrieveKnowledgeRequest struct { Prompt string `json:"prompt"` KbId string `json:"kb_id"` TopK int `json:"top_k"` Threshold float64 `json:"threshold"` Messages []openai.ChatCompletionMessage `json:"messages"` Stream *bool `json:"stream"` } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/serializers/launchpad_serializers.go ================================================ package serializers type TierReq struct { Tier string `json:"tier"` Message string `json:"message"` } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/serializers/mission_store.go ================================================ package serializers import ( "encoding/json" "time" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" ) type MissionParam struct { Name string `json:"name"` Type string `json:"type"` Description string `json:"description"` } type MissionStoreReq struct { ID uint `json:"id"` OwnerAddress string `json:"owner_address"` Name string `json:"name"` Description string `json:"description"` Prompt string `json:"prompt"` Price uint `json:"price"` DurationDay uint `json:"duration_day"` ToolList string `json:"tool_list"` Icon string `json:"icon"` OutputType string `json:"output_type"` Params []*MissionParam `json:"params"` } type MissionStoreRatingReq struct { HistoryID uint `json:"history_id"` UserAddress string `json:"user_address"` Rating float64 `json:"rating"` Comment string `json:"comment"` } type MissionStoreResp struct { ID uint `json:"id"` CreatedAt time.Time `json:"created_at"` Name string `json:"name"` Description string `json:"description"` UserPrompt string `json:"user_prompt"` Price uint `json:"price"` OwnerAddress string `json:"owner_address"` ToolList string `json:"tool_list"` DepositAddress string `json:"deposit_address"` DurationDay uint `json:"duration_day"` Rating float64 `json:"rating"` NumRating uint `json:"num_rating"` NumUsed uint `json:"num_used"` Icon string `json:"icon"` OutputType string `json:"output_type"` Params []*MissionParam `json:"params"` } type MissionStoreHistoryResp struct { ID uint `json:"id"` CreatedAt time.Time `json:"created_at"` UserAddress string `json:"user_address"` MissionStoreID uint `json:"mission_store_id"` MissionStore *MissionStoreResp `json:"mission_store"` TxHash string `json:"tx_hash"` EventId string `json:"event_id"` StartedAt *time.Time `json:"started_at"` ExpiresAt *time.Time `json:"expires_at"` IsRated bool `json:"is_rated"` } type MissionStoreRatingResp struct { ID uint `json:"id"` CreatedAt time.Time `json:"created_at"` UserAddress string `json:"user_address"` MissionStoreID uint `json:"mission_store_id"` MissionStore *MissionStoreResp `json:"mission_store"` Rating float64 `json:"rating"` Comment string `json:"comment"` } func NewMissionStoreResp(m *models.MissionStore) *MissionStoreResp { if m == nil { return nil } params := []*MissionParam{} if m.Params != "" { json.Unmarshal([]byte(m.Params), ¶ms) } return &MissionStoreResp{ ID: m.ID, CreatedAt: m.CreatedAt, Name: m.Name, Description: m.Description, UserPrompt: m.UserPrompt, Price: m.Price, OwnerAddress: m.OwnerAddress, ToolList: m.ToolList, Icon: m.Icon, Rating: m.Rating, NumRating: m.NumRating, NumUsed: m.NumUsed, OutputType: string(m.OutputType), Params: params, } } func NewMissionStoreHistoryResp(h *models.MissionStoreHistory) *MissionStoreHistoryResp { if h == nil { return nil } return &MissionStoreHistoryResp{ ID: h.ID, CreatedAt: h.CreatedAt, UserAddress: h.UserAddress, MissionStoreID: h.MissionStoreID, MissionStore: NewMissionStoreResp(h.MissionStore), TxHash: h.TxHash, EventId: h.EventId, StartedAt: h.StartedAt, ExpiresAt: h.ExpiresAt, IsRated: h.IsRated, } } func NewMissionStoreRatingResp(r *models.MissionStoreRating) *MissionStoreRatingResp { if r == nil { return nil } return &MissionStoreRatingResp{ ID: r.ID, CreatedAt: r.CreatedAt, UserAddress: r.UserAddress, MissionStoreID: r.MissionStoreID, MissionStore: NewMissionStoreResp(r.MissionStore), Rating: r.Rating, Comment: r.Comment, } } func NewMissionStoreRespArray(arr []*models.MissionStore) []*MissionStoreResp { resps := []*MissionStoreResp{} for _, m := range arr { resps = append(resps, NewMissionStoreResp(m)) } return resps } func NewMissionStoreHistoryRespArray(arr []*models.MissionStoreHistory) []*MissionStoreHistoryResp { resps := []*MissionStoreHistoryResp{} for _, h := range arr { resps = append(resps, NewMissionStoreHistoryResp(h)) } return resps } func NewMissionStoreRatingRespArray(arr []*models.MissionStoreRating) []*MissionStoreRatingResp { resps := []*MissionStoreRatingResp{} for _, r := range arr { resps = append(resps, NewMissionStoreRatingResp(r)) } return resps } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/serializers/preview_serializers.go ================================================ package serializers import ( "bytes" "encoding/json" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/sashabaranov/go-openai" "net/http" ) type PreviewRequest struct { Messages string `json:"messages"` AgentID *uint `json:"agent_id"` KbId *string `json:"kb_id"` ModelName *string `json:"model_name"` Stream bool `json:"stream"` } type HttpEventStreamResponse struct { Data []byte } func (ev HttpEventStreamResponse) ToOutPut() []byte { var byteBuffer bytes.Buffer byteBuffer.Write([]byte("data: ")) byteBuffer.Write(ev.Data) byteBuffer.Write([]byte("\n\n")) return byteBuffer.Bytes() } var DoneResponseStreamData, _ = json.Marshal(models.ChatCompletionStreamResponse{Message: "DONE", Code: http.StatusOK}) var FakeResponseStreamData, _ = json.Marshal(models.ChatCompletionStreamResponse{ Message: "", Code: http.StatusContinue, ChatCompletionStreamResponse: openai.ChatCompletionStreamResponse{ Choices: []openai.ChatCompletionStreamChoice{ openai.ChatCompletionStreamChoice{ Delta: openai.ChatCompletionStreamChoiceDelta{}, }, }, }, }) var TimeoutResponseStreamData, _ = json.Marshal(models.ChatCompletionStreamResponse{Message: "Timeout", Code: http.StatusGatewayTimeout}) /*type ChatCompletionStreamResponse struct { openai.ChatCompletionStreamResponse `json:",inline"` Message string `json:"message"` Code int `json:"code"` }*/ ================================================ FILE: agent-as-a-service/agent-orchestration/backend/serializers/pump_serializers.go ================================================ package serializers type PumpOrderResponse struct { Status int `json:"status"` Data PumpOrderData `json:"data"` Message string `json:"message"` } type PumpOrderData struct { Orders []PumpOrder `json:"orders"` Total int `json:"total"` } type PumpOrder struct { ID string `json:"id"` WalletID string `json:"wallet_id"` Type int `json:"type"` TokenAddress string `json:"token_address"` Destination string `json:"destination"` AmountIn string `json:"amount_in"` AmountOut string `json:"amount_out"` Txs []string `json:"txs"` Status int `json:"status"` Error string `json:"error"` ErrorRaw string `json:"error_raw"` CreatedAt string `json:"created_at"` UpdatedAt string `json:"updated_at"` } type PumpBalanceResponse struct { Status int `json:"status"` Data PumpBalanceData `json:"data"` Message string `json:"message"` } type PumpBalanceData struct { Amount string `json:"amount"` Tokens []PumpToken `json:"tokens"` } type PumpToken struct { Mint string `json:"mint"` Name string `json:"name"` Symbol string `json:"symbol"` Decimals int `json:"decimals"` Amount string `json:"amount"` } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/serializers/reqs.go ================================================ package serializers type SignatureReq struct { NetworkID uint64 `json:"network_id"` Address string `json:"address"` Timestamp int64 `json:"timestamp"` Message string `json:"message"` Signature string `json:"signature"` } type SignatureTimestampReq struct { Timestamp int64 `json:"timestamp"` Signature string `json:"signature"` } type BaseReq struct { NetworkID uint64 `json:"network_id"` Address string `json:"address"` } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/serializers/resps.go ================================================ package serializers type Resp struct { Result interface{} `json:"result"` Data interface{} `json:"data"` Error error `json:"error"` Count *uint `json:"count,omitempty"` } type APIResponse struct { Message string `json:"message,omitempty"` Error string `json:"error,omitempty"` Status int `json:"status"` Data interface{} `json:"data,omitempty"` } type RespExtra struct { Result interface{} `json:"result"` Extra interface{} `json:"extra"` Error error `json:"error"` Count *uint `json:"count,omitempty"` CountUnread *uint `json:"count_unread,omitempty"` } type RespChart struct { Result interface{} `json:"result"` Error error `json:"error"` TimeFrom uint `json:"TimeFrom"` TimeTo uint `json:"TimeTo"` } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/serializers/robot_serializers.go ================================================ package serializers import ( "math/big" "time" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/types/numeric" ) type RobotSaleWalletReq struct { ProjectID string `json:"project_id"` UserAddress string `json:"user_address"` } type RobotTokenTransferReq struct { ProjectID string `json:"project_id"` ReceiverAddress string `json:"receiver_address"` Amount float64 `json:"amount"` } type RobotSaleWalletResp struct { ProjectID string `json:"project_id"` UserAddress string `json:"user_address"` SOLAddress string `json:"sol_address"` SolBalance numeric.BigFloat `json:"sol_balance"` Ranking int `json:"ranking"` } func NewRobotSaleWalletResp(m *models.RobotSaleWallet) *RobotSaleWalletResp { return &RobotSaleWalletResp{ ProjectID: m.ProjectID, UserAddress: m.UserAddress, SOLAddress: m.SOLAddress, SolBalance: m.SOLBalance, Ranking: m.Ranking, } } func NewRobotSaleWalletRespList(lst []*models.RobotSaleWallet) []*RobotSaleWalletResp { ret := []*RobotSaleWalletResp{} for _, m := range lst { ret = append(ret, NewRobotSaleWalletResp(m)) } return ret } type RobotProjectResp struct { ProjectID string `json:"project_id"` TokenAddress string `json:"token_address"` TokenSymbol string `json:"token_symbol"` TokenName string `json:"token_name"` TokenSupply numeric.BigFloat `json:"token_supply"` TotalBalance numeric.BigFloat `json:"sol_balance"` SolPrice *big.Float `json:"sol_price"` } func NewRobotProjectResp(m *models.RobotProject) *RobotProjectResp { return &RobotProjectResp{ ProjectID: m.ProjectID, TokenAddress: m.TokenAddress, TokenSymbol: m.TokenSymbol, TokenName: m.TokenName, TokenSupply: m.TokenSupply, TotalBalance: m.TotalBalance, SolPrice: m.SolPrice, } } type RobotTokenTransferResp struct { ProjectID string `json:"project_id"` ReceiverAddress string `json:"receiver_address"` Amount numeric.BigFloat `json:"amount"` Status string `json:"status"` TxHash string `json:"tx_hash"` TransferAt *time.Time `json:"transfer_at"` } func NewRobotTokenTransferResp(m *models.RobotTokenTransfer) *RobotTokenTransferResp { return &RobotTokenTransferResp{ ProjectID: m.ProjectID, ReceiverAddress: m.ReceiverAddress, Amount: m.Amount, Status: m.Status, TxHash: m.TxHash, TransferAt: m.TransferAt, } } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/serializers/token_holder_serializers.go ================================================ package serializers import ( "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/types/numeric" ) type TokenHolderResp struct { ContractAddress string `json:"token_address"` Address string `json:"user_address"` UserName string `json:"user_name"` UserImageURL string `json:"user_image_url"` Balance string `json:"balance"` MemeName string `json:"meme_name"` MemeTicker string `json:"meme_ticker"` MemeImage string `json:"meme_image"` MemePrice numeric.BigFloat `json:"meme_price"` MemePriceUsd numeric.BigFloat `json:"meme_price_usd"` MemeBaseTokenSymbol string `json:"meme_base_token_symbol"` } func NewTokenHolderResp(m *models.Erc20Holder) *TokenHolderResp { if m == nil { return nil } resp := &TokenHolderResp{ Address: m.Address, Balance: m.Balance, ContractAddress: m.ContractAddress, UserName: m.UserName, UserImageURL: m.ImageURL, MemeName: m.MemeName, MemeTicker: m.MemeTicker, MemeImage: m.MemeImage, MemePrice: m.MemePrice, MemePriceUsd: m.MemePriceUsd, MemeBaseTokenSymbol: m.MemeBaseTokenSymbol, } return resp } func NewTokenHolderRespArray(arr []*models.Erc20Holder) []*TokenHolderResp { resps := []*TokenHolderResp{} for _, m := range arr { resps = append(resps, NewTokenHolderResp(m)) } return resps } type ShareHolderResp struct { NetworkID uint64 `json:"network_id"` ContractAddress string `json:"contract_address"` TokenID string `json:"token_id"` Address string `json:"address"` Balance string `json:"balance"` TotalBalance numeric.BigFloat `json:"total_balance"` TwitterID string `json:"twitter_id"` TwitterName string `json:"twitter_name"` TwitterUsername string `json:"twitter_username"` TwitterAvatar string `json:"twitter_avatar"` UserName string `json:"user_name"` Description string `json:"description"` ImageURL string `json:"image_url"` } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/serializers/user_serializers.go ================================================ package serializers import ( "encoding/json" "time" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" ) type UserProfileReq struct { Username string `json:"username"` Description string `json:"description"` ImageURL string `json:"image_url"` Social map[string]interface{} `json:"social"` } type UserResp struct { ID uint `json:"id"` CreatedAt time.Time `json:"created_at"` NetworkID uint64 `json:"network_id"` Address string `json:"address"` Username string `json:"username"` Description string `json:"description"` ImageURL string `json:"image_url"` Social map[string]interface{} `json:"social"` TwitterID string `json:"twitter_id"` TwitterAvatar string `json:"twitter_avatar"` TwitterUsername string `json:"twitter_username"` TwitterName string `json:"twitter_name"` } func NewUserResp(m *models.User) *UserResp { if m == nil { return nil } social := make(map[string]interface{}) json.Unmarshal([]byte(m.Social), &social) resp := &UserResp{ ID: m.ID, CreatedAt: m.CreatedAt, NetworkID: m.NetworkID, Address: m.Address, Username: m.Username, Description: m.Description, ImageURL: m.ImageURL, Social: social, TwitterID: m.TwitterID, TwitterAvatar: m.TwitterAvatar, TwitterUsername: m.TwitterUsername, TwitterName: m.TwitterName, } return resp } func NewUserRespArr(arr []*models.User) []*UserResp { resps := []*UserResp{} for _, m := range arr { resps = append(resps, NewUserResp(m)) } return resps } type InfraTwitterAppInfoResp struct { Address string `json:"address"` EaiBalance float64 `json:"eai_balance"` TotalRequest uint64 `json:"total_request"` RemainRequest uint64 `json:"remain_request"` ETHAddress string `json:"eth_address"` } func NewInfraTwitterAppInfoResp(m *models.InfraTwitterApp) *InfraTwitterAppInfoResp { if m == nil { return nil } balance, _ := m.EaiBalance.Float64() return &InfraTwitterAppInfoResp{ Address: m.Address, EaiBalance: balance, TotalRequest: m.TotalRequest, RemainRequest: m.RemainRequest, ETHAddress: m.ETHAddress, } } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/serializers/user_transaction.go ================================================ package serializers import ( "time" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/types/numeric" ) type UserTransactionResp struct { ID uint `json:"id"` CreatedAt time.Time `json:"created_at"` NetworkID uint64 `json:"network_id"` UserID uint `json:"user_id"` Type models.UserTransactionType `json:"type"` FromAddress string `json:"from_address"` ToAddress string `json:"to_address"` TxHash string `json:"tx_hash"` Amount numeric.BigFloat `json:"amount"` Status models.UserTransactionStatus `json:"status"` } func NewUserTransactionResp(m *models.UserTransaction) *UserTransactionResp { if m == nil { return nil } resp := &UserTransactionResp{ ID: m.ID, CreatedAt: m.CreatedAt, NetworkID: m.NetworkID, UserID: m.UserID, Type: m.Type, FromAddress: m.FromAddress, ToAddress: m.ToAddress, TxHash: m.TxHash, Amount: m.Amount, Status: m.Status, } return resp } func NewUserTransactionRespArry(arr []*models.UserTransaction) []*UserTransactionResp { resps := []*UserTransactionResp{} for _, m := range arr { resps = append(resps, NewUserTransactionResp(m)) } return resps } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/serializers/vibe_serializers.go ================================================ package serializers import ( "time" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" ) type AgentUserComment struct { ID uint `json:"id"` Comment string `json:"comment"` Rating float64 `json:"rating"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` UserAddress string `json:"user_address"` User *UserResp `json:"user"` AgentInfoID uint `json:"agent_info_id"` } func NewAgentUserComment(m *models.AgentUserComment) *AgentUserComment { return &AgentUserComment{ ID: m.ID, Comment: m.Comment, Rating: m.Rating, CreatedAt: m.CreatedAt, UpdatedAt: m.UpdatedAt, UserAddress: m.UserAddress, AgentInfoID: m.AgentInfoID, User: NewUserResp(m.User), } } func NewAgentUserCommentArray(arr []*models.AgentUserComment) []*AgentUserComment { resps := []*AgentUserComment{} for _, r := range arr { resps = append(resps, NewAgentUserComment(r)) } return resps } type VibeTokenDeployInfoResp struct { NonceHex string `json:"nonce_hex" swaggertype:"string" example:"1"` Name string `json:"name" swaggertype:"string" example:"My Token"` Symbol string `json:"symbol" swaggertype:"string" example:"MYT"` Creator string `json:"creator" swaggertype:"string" example:"0x123...abc"` LowerTick int64 `json:"lower_tick" swaggertype:"integer" example:"1000"` UpperTick int64 `json:"upper_tick" swaggertype:"integer" example:"2000"` Deadline int64 `json:"deadline" swaggertype:"integer" example:"1716153600"` Signature string `json:"signature" swaggertype:"string" example:"0x123...abc"` } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/server.go ================================================ package main import ( "context" "crypto/tls" "fmt" "log" "net/http" "os" "os/signal" "runtime/debug" "strings" "syscall" "time" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/apis" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/configs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/daos" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/databases" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/logger" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services" "github.com/gin-gonic/gin" "github.com/pkg/errors" "go.uber.org/zap" ) func init() { http.DefaultTransport.(*http.Transport).TLSClientConfig = &tls.Config{InsecureSkipVerify: true} } func main() { log.Println("Server is starting") conf := configs.GetConfig() logger.NewLogger("agents-ai-api", conf.Env, "", true) defer logger.Sync() defer func() { if err := recover(); err != nil { panicErr := errors.Wrap(errors.New("panic start server"), string(debug.Stack())) logger.Info( logger.LOGGER_API_APP_PANIC, "panic start server", zap.Error(panicErr), ) fmt.Println(err) fmt.Println(panicErr) return } }() jobEnabled := strings.ToLower(os.Getenv("JOB")) == "true" || os.Getenv("JOB") == "1" || conf.Job migrateDBMain := databases.MigrateDBMain if os.Getenv("DEV") == "true" || !jobEnabled { migrateDBMain = nil } if conf.Env == "local" { migrateDBMain = databases.MigrateDBMain } dbMain, err := databases.Init(conf.DbURL, migrateDBMain, 5, 20, conf.Debug) if err != nil { logger.Fatal("databases.Init", zap.Error(err)) } daos.InitDBConn( dbMain, ) s := services.NewService(conf) r := gin.New() srv := apis.NewServer( r, conf, s, ) srv.Routers() if conf.Port == 0 { conf.Port = 8080 } if jobEnabled { srv.RunJobs() // srv.RunTeleBotJob() } server := &http.Server{ Addr: fmt.Sprintf(":%d", conf.Port), Handler: r, } go func() { defer func() { if err := recover(); err != nil { debug.PrintStack() } }() if err := server.ListenAndServe(); err != nil && err != http.ErrServerClosed { log.Fatalf("listen: %s\n", err) } }() quit := make(chan os.Signal, 1) signal.Notify(quit, syscall.SIGINT, syscall.SIGTERM) <-quit log.Println("Shutdown Server ...") srv.DisableJobs() delayTs := 10 * time.Second if jobEnabled { delayTs = 30 * time.Second } if conf.Env == "dev" || conf.Env == "local" { delayTs = 0 * time.Second } ctx, cancel := context.WithTimeout(context.Background(), delayTs) defer cancel() if err := server.Shutdown(ctx); err != nil { log.Fatal("Server Shutdown:", err) } <-ctx.Done() log.Println("Server is down") } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/server_test.go ================================================ package main_test import ( "context" "crypto/tls" "encoding/json" "fmt" "net/http" "testing" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/configs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/daos" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/databases" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/logger" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services" ) var ts *services.Service func init() { http.DefaultTransport.(*http.Transport).TLSClientConfig = &tls.Config{InsecureSkipVerify: true} conf := configs.GetConfig() logger.NewLogger("agents-ai-api", conf.Env, "", true) defer logger.Sync() dbMain, err := databases.Init( conf.DbURL, nil, 1, 20, conf.Debug, ) if err != nil { panic(err) } daos.InitDBConn( dbMain, ) var ( s = services.NewService( conf, ) ) ts = s } func Test_JOB(t *testing.T) { fmt.Println( ts.JobCreateTokenInfo(context.Background()), ) // data, err := ts.ValidateTweetContentGenerateVideoWithLLM2(context.Background(), "man opens shirt and shows his fat belly") // fmt.Println(data, err) // ts.MemeEventsByTransaction(context.Background(), 56, "") // ts.AgentSnapshotPostCreate(context.Background(), 59166, "", "") // ts.JobScanAgentTwitterPostForTA(context.Background()) // ts.RetryAgentDeployToken(context.Background(), 51265) // ts.JobUpdateOffchainAutoOutputForMission(context.Background()) // ts.JobAgentTwitterPostTA(context.Background()) // ts.JobLuckyMoneyProcessUserReward(context.Background()) // fmt.Println( // // ts.DeployDAOTreasuryLogic(context.Background(), models.BASE_CHAIN_ID), // // ts.DeployDAOTreasuryAddress(context.Background(), models.BASE_CHAIN_ID), // // ts.AgentAddLiquidityDAOToken(context.Background(), 1), // // ts.CreateSOLAddress(context.Background()), // // ts.CreateETHAddress(context.Background()), // // ts.JobAgentTgeTransferDAOToken(context.Background()), // // ts.JobAgentAddLiquidityDAOToken(context.Background()), // // ts.DeployDAOTreasuryLogic(context.Background(), models.BASE_CHAIN_ID), // // ts.JobAgentTgeTransferDAOToken(context.Background()), // ) // select {} } func Test_UTIL(t *testing.T) { // ts.JobCreateTokenInfo(context.Background()) // resp := map[string]interface{}{ // "method": "getUserByUsername", // "params": map[string]interface{}{ // "username": "Uniswap", // }, // } // jsonString, _ := json.Marshal(resp) // fmt.Println(jsonString) ts.JobUpdateTrendingTokens(context.Background()) } func Test_OpenAI(t *testing.T) { ts.GetTelegramMessage(context.Background()) } func Test_SRV(t *testing.T) { // ts.TestCrawlDexScreener(context.Background()) // ts.JobRobotScanBalanceSOL(context.Background()) ts.CreateClankerTokenForVideoByPostID(context.Background(), 35944) } func Test_UpdateTokenPrice(t *testing.T) { ts.GenerateTokenInfoFromVideoPrompt(context.Background(), "Dancing characters in green frog hoodie in a grid", false) // ts.GenerateTokenInfoWithLLMV2(context.Background(), "Dancing characters in green frog hoodie in a grid", false) // ts.GetGifImageUrlFromTokenInfo("ABC", "ABC", "ABC") // ts.CreateTokenInfo(context.Background(), 14754) } func Test_IPFS(t *testing.T) { resp := map[string]any{ "name": "XXX", "description": "XXX Description ...", "symbol": "XXX", "image": "https://xxx.jpg", "animation_url": "https://xxx.mp4", "content": map[string]any{ "uri": "https://xxx.mp4", "mime": "video/mp4", }, } jsonString, _ := json.Marshal(resp) fmt.Println( ts.IpfsUploadDataForName(context.Background(), "data", jsonString), ) } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/aidojo/aidojo.go ================================================ package aidojo import ( "bytes" "encoding/json" "errors" "fmt" "io" "net/http" "net/url" "strconv" "strings" "time" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "go.mongodb.org/mongo-driver/bson/primitive" ) type AiDojoBackend struct { BaseURL string ApiKey string } type ChatResponse struct { Id string `json:"id"` Choices []*struct { Message *struct { Content string `json:"content"` } `json:"message"` } `json:"choices"` OnchainData struct { InferTx string `json:"infer_tx"` SubmitTx string `json:"submit_tx"` SeizeMinerTx string `json:"seize_miner_tx"` } `json:"onchain_data"` } func NewAiDojoBackend(baseUrl, apiKey string) *AiDojoBackend { return &AiDojoBackend{ BaseURL: baseUrl, ApiKey: apiKey, } } func (c *AiDojoBackend) postFormData(apiURL string, headers map[string]string, jsonObject map[string]interface{}, result interface{}) error { data := url.Values{} for key, val := range jsonObject { data.Set(key, fmt.Sprintf("%v", val)) } encodedData := data.Encode() req, err := http.NewRequest(http.MethodPost, apiURL, strings.NewReader(encodedData)) if err != nil { return err } req.Header.Add("Content-Type", "application/x-www-form-urlencoded") req.Header.Add("Content-Length", strconv.Itoa(len(data.Encode()))) req.Header.Add("Authorization", fmt.Sprintf("TK1 %s", c.ApiKey)) for k, v := range headers { req.Header.Add(k, v) } client := &http.Client{} resp, err := client.Do(req) if err != nil { return fmt.Errorf("failed request: %v", err) } if resp.StatusCode >= 300 { bodyBytes, err := io.ReadAll(resp.Body) if err != nil { return fmt.Errorf("http response bad status %d %s", resp.StatusCode, err.Error()) } return fmt.Errorf("http response bad status %d %s", resp.StatusCode, string(bodyBytes)) } if result != nil { return json.NewDecoder(resp.Body).Decode(result) } return nil } func (c *AiDojoBackend) postJSON(apiURL string, headers map[string]string, jsonObject interface{}, result interface{}) error { bodyBytes, err := json.Marshal(jsonObject) if err != nil { return err } req, err := http.NewRequest(http.MethodPost, apiURL, bytes.NewBuffer(bodyBytes)) if err != nil { return err } req.Header.Add("Content-Type", "application/json") for k, v := range headers { req.Header.Add(k, v) } client := &http.Client{} resp, err := client.Do(req) if err != nil { return fmt.Errorf("failed request: %v", err) } if resp.StatusCode >= 300 { bodyBytes, err := io.ReadAll(resp.Body) if err != nil { return fmt.Errorf("http response bad status %d %s", resp.StatusCode, err.Error()) } return fmt.Errorf("http response bad status %d %s", resp.StatusCode, string(bodyBytes)) } if result != nil { return json.NewDecoder(resp.Body).Decode(result) } return nil } func (c *AiDojoBackend) putJSON(apiURL string, headers map[string]string, jsonObject interface{}, result interface{}) error { bodyBytes, _ := json.Marshal(jsonObject) req, err := http.NewRequest(http.MethodPatch, apiURL, bytes.NewBuffer(bodyBytes)) if err != nil { return err } req.Header.Add("Content-Type", "application/json") for k, v := range headers { req.Header.Add(k, v) } client := &http.Client{} resp, err := client.Do(req) if err != nil { return fmt.Errorf("failed request: %v", err) } if resp.StatusCode >= 300 { bodyBytes, err := io.ReadAll(resp.Body) if err != nil { return fmt.Errorf("http response bad status %d %s", resp.StatusCode, err.Error()) } return fmt.Errorf("http response bad status %d %s", resp.StatusCode, string(bodyBytes)) } if result != nil { return json.NewDecoder(resp.Body).Decode(result) } return nil } func (c *AiDojoBackend) getJSON(url string, headers map[string]string, result interface{}) (int, error) { req, err := http.NewRequest(http.MethodGet, url, nil) if err != nil { return 0, fmt.Errorf("failed to create request: %v", err) } req.Header.Add("Content-Type", "application/json") // req.Header.Add("Authorization", fmt.Sprintf(`Bearer %s`, c.ApiKey)) for k, v := range headers { req.Header.Add(k, v) } client := &http.Client{} resp, err := client.Do(req) if err != nil { return 0, fmt.Errorf("failed request: %v", err) } if resp.StatusCode >= 300 { bodyBytes, err := io.ReadAll(resp.Body) if err != nil { return resp.StatusCode, fmt.Errorf("http response bad status %d %s", resp.StatusCode, err.Error()) } return resp.StatusCode, fmt.Errorf("http response bad status %d %s", resp.StatusCode, string(bodyBytes)) } if result != nil { return resp.StatusCode, json.NewDecoder(resp.Body).Decode(result) } return resp.StatusCode, nil } func (c *AiDojoBackend) getBytes(url string, headers map[string]string) ([]byte, error) { req, err := http.NewRequest(http.MethodGet, url, nil) if err != nil { return nil, fmt.Errorf("failed to create request: %v", err) } req.Header.Add("Content-Type", "application/json") for k, v := range headers { req.Header.Add(k, v) } client := &http.Client{} resp, err := client.Do(req) if err != nil { return nil, fmt.Errorf("failed request: %v", err) } bodyBytes, err := io.ReadAll(resp.Body) if err != nil { return nil, fmt.Errorf("http response bad status %d %s", resp.StatusCode, err.Error()) } if resp.StatusCode >= 300 { return nil, fmt.Errorf("http response bad status %d %s", resp.StatusCode, string(bodyBytes)) } return bodyBytes, nil } func (c *AiDojoBackend) LighthouseUpload(content string) (string, error) { var resp struct { Data string `json:"data"` } err := c.postJSON( fmt.Sprintf("%s/api/service/light-house/upload", c.BaseURL), map[string]string{ "Authorization": fmt.Sprintf("TK1 %s", c.ApiKey), }, map[string]string{ "content": content, }, &resp, ) if err != nil { return "", err } return resp.Data, nil } type AgentType int const ( AgentTypeNormal AgentType = 0 AgentTypeReasoningAgent AgentType = 1 ) type AgentMetadataRequest struct { TokenInfo struct { Name string `json:"name"` Symbol string `json:"symbol"` Address string `json:"address"` Chain string `json:"chain"` } `json:"token_info"` } func (c *AiDojoBackend) AgentBatchPromptItem(chainID, agentID string, outputMaxCharacter uint, agentType AgentType, toolset string, headSystemPrompt string, agentMetaData *AgentMetadataRequest, messages []*models.UserAgentInferDataItem, skipThough bool, toolList string) (string, error) { postData := map[string]interface{}{ "chain_id": chainID, "contract_agent_id": agentID, "output_max_character": outputMaxCharacter, "agent_type": agentType, "toolset": toolset, "twitter_snapshot": "", "head_system_prompt": headSystemPrompt, "messages": messages, "skip_though": skipThough, "agent_meta_data": agentMetaData, "tool_list": toolList, } var resp struct { Data struct { Id string `json:"id"` } `json:"data"` } err := c.postJSON( fmt.Sprintf("%s/api/agent/batch-prompt-item", c.BaseURL), map[string]string{ "Authorization": fmt.Sprintf("TK1 %s", c.ApiKey), }, postData, &resp, ) if err != nil { return "", err } if resp.Data.Id == "" { return "", errors.New("id not found") } return resp.Data.Id, nil } type AgentInscribeReq struct { Content string `json:"content"` MysqlID uint `json:"mysql_id"` TweetID string `json:"tweet_id"` AgentID uint `json:"agent_id"` Type string `json:"type"` CreatedAt time.Time `json:"created_at"` PostTweetAt time.Time `json:"post_tweet_at"` } func (c *AiDojoBackend) AgentBatchPromptItemOutput(inferId string) (string, string, error) { var resp struct { Data struct { Id string `json:"id"` PromptOutput string `json:"prompt_output"` InscribeTxHash string `json:"inscribe_tx_hash"` } `json:"data"` } _, err := c.getJSON( fmt.Sprintf("%s/api/agent/get-batch-item-output/%s", c.BaseURL, inferId), map[string]string{ "Authorization": fmt.Sprintf("TK1 %s", c.ApiKey), }, &resp, ) if err != nil { return "", "", err } if resp.Data.Id == "" { return "", "", errors.New("id not found") } return resp.Data.PromptOutput, resp.Data.InscribeTxHash, nil } func (c *AiDojoBackend) OffchainAgentOutput(inferId string) (string, error) { data, err := c.getBytes( fmt.Sprintf("%s/api/agent/offchain-auto-agent-request/%s", c.BaseURL, inferId), map[string]string{ "Authorization": fmt.Sprintf("TK1 %s", c.ApiKey), }, ) if err != nil { return "", err } return string(data), nil } func (c *AiDojoBackend) OffchainAutoAgentOutput(endpoint string, funId string, xToken string) (string, error) { data, err := c.getBytes( fmt.Sprintf(endpoint+"/async/get?id=%s", funId), map[string]string{ "x-token": xToken, }, ) if err != nil { return "", err } return string(data), nil } func (c *AiDojoBackend) AgentMintNft(chainID uint64, agentID string) error { postData := map[string]interface{}{ "agent_id": agentID, "chain_id": fmt.Sprintf("%d", chainID), } err := c.postJSON( fmt.Sprintf("%s/api/agent/mint?admin_key=eai2024", c.BaseURL), map[string]string{}, postData, nil, ) if err != nil { return err } return nil } func (c *AiDojoBackend) GetAgentPoolBalance(chainID string, nftIds []string) (map[string]string, error) { postData := map[string]interface{}{ "nft_ids": nftIds, "chain_id": chainID, } var resp struct { Data map[string]string `json:"data"` } err := c.postJSON( fmt.Sprintf("%s/api/agent/pool_balance", c.BaseURL), map[string]string{ "Authorization": fmt.Sprintf("TK1 %s", c.ApiKey), }, postData, &resp, ) if err != nil { return nil, err } return resp.Data, nil } func (c *AiDojoBackend) GetBitcoinTxHash(txHash string) (string, error) { var resp struct { Btc string `json:"btc"` } _, err := c.getJSON( fmt.Sprintf("https://webstat.shard-ai.l2aas.com/get-btctx?tc=%s", txHash), map[string]string{}, &resp, ) if err != nil { return "", err } return resp.Btc, nil } func (c *AiDojoBackend) AgentInscribe(postData *AgentInscribeReq) (string, error) { var resp struct { Data struct { Id string `json:"id"` } `json:"data"` } err := c.postJSON( fmt.Sprintf("%s/api/inscribe", c.BaseURL), map[string]string{ "Authorization": fmt.Sprintf("TK1 %s", c.ApiKey), }, postData, &resp, ) if err != nil { return "", err } if resp.Data.Id == "" { return "", errors.New("id not found") } return resp.Data.Id, nil } type GenerateImageResponse struct { Output *struct { Result string `json:"result"` } `json:"output"` } func (c AiDojoBackend) GenerateImage(systemContent, baseUrl string) (string, error) { bodyReq := map[string]interface{}{ "input": map[string]interface{}{ "prompt": systemContent, "steps": 10, "seed": time.Now().Unix(), }, } chatResp := "" bodyBytes, _ := json.Marshal(bodyReq) req, err := http.NewRequest("POST", baseUrl, bytes.NewBuffer(bodyBytes)) if err != nil { return chatResp, err } client := &http.Client{ Timeout: 20 * time.Second, } resp, err := client.Do(req) if err != nil { return chatResp, err } defer resp.Body.Close() body, err := io.ReadAll(resp.Body) if err != nil { return chatResp, err } m := GenerateImageResponse{} err = json.Unmarshal(body, &m) if err != nil { return chatResp, err } if m.Output != nil { chatResp = m.Output.Result } return chatResp, nil } type OffchainAutoAgentRequest struct { RequestInput string `bson:"request_input" json:"request_input"` Response string `bson:"response" json:"response"` ResponseId string `bson:"response_id" json:"response_id"` ResponseStatus int `bson:"response_status" json:"response_status"` Url string `bson:"url" json:"url"` Log string `bson:"log" json:"log"` AssistantID primitive.ObjectID `bson:"assistant_id" json:"assistant_id"` MissionID primitive.ObjectID `bson:"mission_id" json:"mission_id"` ContractAgentID string `bson:"contract_agent_id" json:"contract_agent_id"` ChainID string `bson:"chain_id" json:"chain_id"` Output string `json:"output" bson:"output"` BatchItemInput string `json:"batch_item_input" bson:"batch_item_input"` Toolset string `json:"toolset" bson:"toolset"` Task string `json:"task" bson:"task"` } // //// type ChainConfigsDetailResp struct { ChainId string `json:"chain_id"` SupportModelNames map[string]string `json:"support_model_names"` } type ChainConfigsResp struct { Data []*ChainConfigsDetailResp `json:"data"` } func (c *AiDojoBackend) GetChainConfigs() ([]*ChainConfigsDetailResp, error) { var resp ChainConfigsResp _, err := c.getJSON( fmt.Sprintf("%s/api/chain-config/list", c.BaseURL), map[string]string{}, &resp, ) if err != nil { return nil, err } return resp.Data, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/binds/agentfactory/AgentFactory.go ================================================ // Code generated - DO NOT EDIT. // This file is a generated binding and any manual changes will be lost. package agentfactory import ( "errors" "math/big" "strings" ethereum "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/event" ) // Reference imports to suppress errors if they are not otherwise used. var ( _ = errors.New _ = big.NewInt _ = strings.NewReader _ = ethereum.NotFound _ = bind.Bind _ = common.Big1 _ = types.BloomLookup _ = event.NewSubscription _ = abi.ConvertType ) // IAgentCodePointer is an auto generated low-level Go binding around an user-defined struct. type IAgentCodePointer struct { RetrieveAddress common.Address FileType uint8 FileName string } // AgentFactoryMetaData contains all meta data concerning the AgentFactory contract. var AgentFactoryMetaData = &bind.MetaData{ ABI: "[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"agentId\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"agent\",\"type\":\"address\"}],\"name\":\"AgentCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"ImplementationSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"agents\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"agentId\",\"type\":\"bytes32\"},{\"internalType\":\"string\",\"name\":\"agentName\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"agentVersion\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"codeLanguage\",\"type\":\"string\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"retrieveAddress\",\"type\":\"address\"},{\"internalType\":\"enumIAgent.FileType\",\"name\":\"fileType\",\"type\":\"uint8\"},{\"internalType\":\"string\",\"name\":\"fileName\",\"type\":\"string\"}],\"internalType\":\"structIAgent.CodePointer[]\",\"name\":\"pointers\",\"type\":\"tuple[]\"},{\"internalType\":\"address[]\",\"name\":\"depsAgents\",\"type\":\"address[]\"},{\"internalType\":\"address\",\"name\":\"agentOwner\",\"type\":\"address\"}],\"name\":\"createAgent\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"agent\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getImplementation\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"registrar\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"resolver\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"setImplementation\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", } // AgentFactoryABI is the input ABI used to generate the binding from. // Deprecated: Use AgentFactoryMetaData.ABI instead. var AgentFactoryABI = AgentFactoryMetaData.ABI // AgentFactory is an auto generated Go binding around an Ethereum contract. type AgentFactory struct { AgentFactoryCaller // Read-only binding to the contract AgentFactoryTransactor // Write-only binding to the contract AgentFactoryFilterer // Log filterer for contract events } // AgentFactoryCaller is an auto generated read-only Go binding around an Ethereum contract. type AgentFactoryCaller struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // AgentFactoryTransactor is an auto generated write-only Go binding around an Ethereum contract. type AgentFactoryTransactor struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // AgentFactoryFilterer is an auto generated log filtering Go binding around an Ethereum contract events. type AgentFactoryFilterer struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // AgentFactorySession is an auto generated Go binding around an Ethereum contract, // with pre-set call and transact options. type AgentFactorySession struct { Contract *AgentFactory // Generic contract binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // AgentFactoryCallerSession is an auto generated read-only Go binding around an Ethereum contract, // with pre-set call options. type AgentFactoryCallerSession struct { Contract *AgentFactoryCaller // Generic contract caller binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session } // AgentFactoryTransactorSession is an auto generated write-only Go binding around an Ethereum contract, // with pre-set transact options. type AgentFactoryTransactorSession struct { Contract *AgentFactoryTransactor // Generic contract transactor binding to set the session for TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // AgentFactoryRaw is an auto generated low-level Go binding around an Ethereum contract. type AgentFactoryRaw struct { Contract *AgentFactory // Generic contract binding to access the raw methods on } // AgentFactoryCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. type AgentFactoryCallerRaw struct { Contract *AgentFactoryCaller // Generic read-only contract binding to access the raw methods on } // AgentFactoryTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. type AgentFactoryTransactorRaw struct { Contract *AgentFactoryTransactor // Generic write-only contract binding to access the raw methods on } // NewAgentFactory creates a new instance of AgentFactory, bound to a specific deployed contract. func NewAgentFactory(address common.Address, backend bind.ContractBackend) (*AgentFactory, error) { contract, err := bindAgentFactory(address, backend, backend, backend) if err != nil { return nil, err } return &AgentFactory{AgentFactoryCaller: AgentFactoryCaller{contract: contract}, AgentFactoryTransactor: AgentFactoryTransactor{contract: contract}, AgentFactoryFilterer: AgentFactoryFilterer{contract: contract}}, nil } // NewAgentFactoryCaller creates a new read-only instance of AgentFactory, bound to a specific deployed contract. func NewAgentFactoryCaller(address common.Address, caller bind.ContractCaller) (*AgentFactoryCaller, error) { contract, err := bindAgentFactory(address, caller, nil, nil) if err != nil { return nil, err } return &AgentFactoryCaller{contract: contract}, nil } // NewAgentFactoryTransactor creates a new write-only instance of AgentFactory, bound to a specific deployed contract. func NewAgentFactoryTransactor(address common.Address, transactor bind.ContractTransactor) (*AgentFactoryTransactor, error) { contract, err := bindAgentFactory(address, nil, transactor, nil) if err != nil { return nil, err } return &AgentFactoryTransactor{contract: contract}, nil } // NewAgentFactoryFilterer creates a new log filterer instance of AgentFactory, bound to a specific deployed contract. func NewAgentFactoryFilterer(address common.Address, filterer bind.ContractFilterer) (*AgentFactoryFilterer, error) { contract, err := bindAgentFactory(address, nil, nil, filterer) if err != nil { return nil, err } return &AgentFactoryFilterer{contract: contract}, nil } // bindAgentFactory binds a generic wrapper to an already deployed contract. func bindAgentFactory(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { parsed, err := AgentFactoryMetaData.GetAbi() if err != nil { return nil, err } return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_AgentFactory *AgentFactoryRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _AgentFactory.Contract.AgentFactoryCaller.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_AgentFactory *AgentFactoryRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _AgentFactory.Contract.AgentFactoryTransactor.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_AgentFactory *AgentFactoryRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _AgentFactory.Contract.AgentFactoryTransactor.contract.Transact(opts, method, params...) } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_AgentFactory *AgentFactoryCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _AgentFactory.Contract.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_AgentFactory *AgentFactoryTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _AgentFactory.Contract.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_AgentFactory *AgentFactoryTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _AgentFactory.Contract.contract.Transact(opts, method, params...) } // Agents is a free data retrieval call binding the contract method 0x2e20ee18. // // Solidity: function agents(bytes32 ) view returns(address) func (_AgentFactory *AgentFactoryCaller) Agents(opts *bind.CallOpts, arg0 [32]byte) (common.Address, error) { var out []interface{} err := _AgentFactory.contract.Call(opts, &out, "agents", arg0) if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // Agents is a free data retrieval call binding the contract method 0x2e20ee18. // // Solidity: function agents(bytes32 ) view returns(address) func (_AgentFactory *AgentFactorySession) Agents(arg0 [32]byte) (common.Address, error) { return _AgentFactory.Contract.Agents(&_AgentFactory.CallOpts, arg0) } // Agents is a free data retrieval call binding the contract method 0x2e20ee18. // // Solidity: function agents(bytes32 ) view returns(address) func (_AgentFactory *AgentFactoryCallerSession) Agents(arg0 [32]byte) (common.Address, error) { return _AgentFactory.Contract.Agents(&_AgentFactory.CallOpts, arg0) } // GetImplementation is a free data retrieval call binding the contract method 0xaaf10f42. // // Solidity: function getImplementation() view returns(address) func (_AgentFactory *AgentFactoryCaller) GetImplementation(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _AgentFactory.contract.Call(opts, &out, "getImplementation") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // GetImplementation is a free data retrieval call binding the contract method 0xaaf10f42. // // Solidity: function getImplementation() view returns(address) func (_AgentFactory *AgentFactorySession) GetImplementation() (common.Address, error) { return _AgentFactory.Contract.GetImplementation(&_AgentFactory.CallOpts) } // GetImplementation is a free data retrieval call binding the contract method 0xaaf10f42. // // Solidity: function getImplementation() view returns(address) func (_AgentFactory *AgentFactoryCallerSession) GetImplementation() (common.Address, error) { return _AgentFactory.Contract.GetImplementation(&_AgentFactory.CallOpts) } // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. // // Solidity: function owner() view returns(address) func (_AgentFactory *AgentFactoryCaller) Owner(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _AgentFactory.contract.Call(opts, &out, "owner") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. // // Solidity: function owner() view returns(address) func (_AgentFactory *AgentFactorySession) Owner() (common.Address, error) { return _AgentFactory.Contract.Owner(&_AgentFactory.CallOpts) } // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. // // Solidity: function owner() view returns(address) func (_AgentFactory *AgentFactoryCallerSession) Owner() (common.Address, error) { return _AgentFactory.Contract.Owner(&_AgentFactory.CallOpts) } // CreateAgent is a paid mutator transaction binding the contract method 0x0d1f52ff. // // Solidity: function createAgent(bytes32 agentId, string agentName, string agentVersion, string codeLanguage, (address,uint8,string)[] pointers, address[] depsAgents, address agentOwner) returns(address agent) func (_AgentFactory *AgentFactoryTransactor) CreateAgent(opts *bind.TransactOpts, agentId [32]byte, agentName string, agentVersion string, codeLanguage string, pointers []IAgentCodePointer, depsAgents []common.Address, agentOwner common.Address) (*types.Transaction, error) { return _AgentFactory.contract.Transact(opts, "createAgent", agentId, agentName, agentVersion, codeLanguage, pointers, depsAgents, agentOwner) } // CreateAgent is a paid mutator transaction binding the contract method 0x0d1f52ff. // // Solidity: function createAgent(bytes32 agentId, string agentName, string agentVersion, string codeLanguage, (address,uint8,string)[] pointers, address[] depsAgents, address agentOwner) returns(address agent) func (_AgentFactory *AgentFactorySession) CreateAgent(agentId [32]byte, agentName string, agentVersion string, codeLanguage string, pointers []IAgentCodePointer, depsAgents []common.Address, agentOwner common.Address) (*types.Transaction, error) { return _AgentFactory.Contract.CreateAgent(&_AgentFactory.TransactOpts, agentId, agentName, agentVersion, codeLanguage, pointers, depsAgents, agentOwner) } // CreateAgent is a paid mutator transaction binding the contract method 0x0d1f52ff. // // Solidity: function createAgent(bytes32 agentId, string agentName, string agentVersion, string codeLanguage, (address,uint8,string)[] pointers, address[] depsAgents, address agentOwner) returns(address agent) func (_AgentFactory *AgentFactoryTransactorSession) CreateAgent(agentId [32]byte, agentName string, agentVersion string, codeLanguage string, pointers []IAgentCodePointer, depsAgents []common.Address, agentOwner common.Address) (*types.Transaction, error) { return _AgentFactory.Contract.CreateAgent(&_AgentFactory.TransactOpts, agentId, agentName, agentVersion, codeLanguage, pointers, depsAgents, agentOwner) } // Initialize is a paid mutator transaction binding the contract method 0xf8c8765e. // // Solidity: function initialize(address owner, address implementation, address registrar, address resolver) returns() func (_AgentFactory *AgentFactoryTransactor) Initialize(opts *bind.TransactOpts, owner common.Address, implementation common.Address, registrar common.Address, resolver common.Address) (*types.Transaction, error) { return _AgentFactory.contract.Transact(opts, "initialize", owner, implementation, registrar, resolver) } // Initialize is a paid mutator transaction binding the contract method 0xf8c8765e. // // Solidity: function initialize(address owner, address implementation, address registrar, address resolver) returns() func (_AgentFactory *AgentFactorySession) Initialize(owner common.Address, implementation common.Address, registrar common.Address, resolver common.Address) (*types.Transaction, error) { return _AgentFactory.Contract.Initialize(&_AgentFactory.TransactOpts, owner, implementation, registrar, resolver) } // Initialize is a paid mutator transaction binding the contract method 0xf8c8765e. // // Solidity: function initialize(address owner, address implementation, address registrar, address resolver) returns() func (_AgentFactory *AgentFactoryTransactorSession) Initialize(owner common.Address, implementation common.Address, registrar common.Address, resolver common.Address) (*types.Transaction, error) { return _AgentFactory.Contract.Initialize(&_AgentFactory.TransactOpts, owner, implementation, registrar, resolver) } // RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. // // Solidity: function renounceOwnership() returns() func (_AgentFactory *AgentFactoryTransactor) RenounceOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { return _AgentFactory.contract.Transact(opts, "renounceOwnership") } // RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. // // Solidity: function renounceOwnership() returns() func (_AgentFactory *AgentFactorySession) RenounceOwnership() (*types.Transaction, error) { return _AgentFactory.Contract.RenounceOwnership(&_AgentFactory.TransactOpts) } // RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. // // Solidity: function renounceOwnership() returns() func (_AgentFactory *AgentFactoryTransactorSession) RenounceOwnership() (*types.Transaction, error) { return _AgentFactory.Contract.RenounceOwnership(&_AgentFactory.TransactOpts) } // SetImplementation is a paid mutator transaction binding the contract method 0xd784d426. // // Solidity: function setImplementation(address implementation) returns() func (_AgentFactory *AgentFactoryTransactor) SetImplementation(opts *bind.TransactOpts, implementation common.Address) (*types.Transaction, error) { return _AgentFactory.contract.Transact(opts, "setImplementation", implementation) } // SetImplementation is a paid mutator transaction binding the contract method 0xd784d426. // // Solidity: function setImplementation(address implementation) returns() func (_AgentFactory *AgentFactorySession) SetImplementation(implementation common.Address) (*types.Transaction, error) { return _AgentFactory.Contract.SetImplementation(&_AgentFactory.TransactOpts, implementation) } // SetImplementation is a paid mutator transaction binding the contract method 0xd784d426. // // Solidity: function setImplementation(address implementation) returns() func (_AgentFactory *AgentFactoryTransactorSession) SetImplementation(implementation common.Address) (*types.Transaction, error) { return _AgentFactory.Contract.SetImplementation(&_AgentFactory.TransactOpts, implementation) } // TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. // // Solidity: function transferOwnership(address newOwner) returns() func (_AgentFactory *AgentFactoryTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) { return _AgentFactory.contract.Transact(opts, "transferOwnership", newOwner) } // TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. // // Solidity: function transferOwnership(address newOwner) returns() func (_AgentFactory *AgentFactorySession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { return _AgentFactory.Contract.TransferOwnership(&_AgentFactory.TransactOpts, newOwner) } // TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. // // Solidity: function transferOwnership(address newOwner) returns() func (_AgentFactory *AgentFactoryTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { return _AgentFactory.Contract.TransferOwnership(&_AgentFactory.TransactOpts, newOwner) } // AgentFactoryAgentCreatedIterator is returned from FilterAgentCreated and is used to iterate over the raw logs and unpacked data for AgentCreated events raised by the AgentFactory contract. type AgentFactoryAgentCreatedIterator struct { Event *AgentFactoryAgentCreated // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *AgentFactoryAgentCreatedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(AgentFactoryAgentCreated) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(AgentFactoryAgentCreated) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *AgentFactoryAgentCreatedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *AgentFactoryAgentCreatedIterator) Close() error { it.sub.Unsubscribe() return nil } // AgentFactoryAgentCreated represents a AgentCreated event raised by the AgentFactory contract. type AgentFactoryAgentCreated struct { AgentId [32]byte Agent common.Address Raw types.Log // Blockchain specific contextual infos } // FilterAgentCreated is a free log retrieval operation binding the contract event 0x7c96960a1ebd8cc753b10836ea25bd7c9c4f8cd43590db1e8b3648cb0ec4cc89. // // Solidity: event AgentCreated(bytes32 indexed agentId, address indexed agent) func (_AgentFactory *AgentFactoryFilterer) FilterAgentCreated(opts *bind.FilterOpts, agentId [][32]byte, agent []common.Address) (*AgentFactoryAgentCreatedIterator, error) { var agentIdRule []interface{} for _, agentIdItem := range agentId { agentIdRule = append(agentIdRule, agentIdItem) } var agentRule []interface{} for _, agentItem := range agent { agentRule = append(agentRule, agentItem) } logs, sub, err := _AgentFactory.contract.FilterLogs(opts, "AgentCreated", agentIdRule, agentRule) if err != nil { return nil, err } return &AgentFactoryAgentCreatedIterator{contract: _AgentFactory.contract, event: "AgentCreated", logs: logs, sub: sub}, nil } // WatchAgentCreated is a free log subscription operation binding the contract event 0x7c96960a1ebd8cc753b10836ea25bd7c9c4f8cd43590db1e8b3648cb0ec4cc89. // // Solidity: event AgentCreated(bytes32 indexed agentId, address indexed agent) func (_AgentFactory *AgentFactoryFilterer) WatchAgentCreated(opts *bind.WatchOpts, sink chan<- *AgentFactoryAgentCreated, agentId [][32]byte, agent []common.Address) (event.Subscription, error) { var agentIdRule []interface{} for _, agentIdItem := range agentId { agentIdRule = append(agentIdRule, agentIdItem) } var agentRule []interface{} for _, agentItem := range agent { agentRule = append(agentRule, agentItem) } logs, sub, err := _AgentFactory.contract.WatchLogs(opts, "AgentCreated", agentIdRule, agentRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(AgentFactoryAgentCreated) if err := _AgentFactory.contract.UnpackLog(event, "AgentCreated", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseAgentCreated is a log parse operation binding the contract event 0x7c96960a1ebd8cc753b10836ea25bd7c9c4f8cd43590db1e8b3648cb0ec4cc89. // // Solidity: event AgentCreated(bytes32 indexed agentId, address indexed agent) func (_AgentFactory *AgentFactoryFilterer) ParseAgentCreated(log types.Log) (*AgentFactoryAgentCreated, error) { event := new(AgentFactoryAgentCreated) if err := _AgentFactory.contract.UnpackLog(event, "AgentCreated", log); err != nil { return nil, err } event.Raw = log return event, nil } // AgentFactoryImplementationSetIterator is returned from FilterImplementationSet and is used to iterate over the raw logs and unpacked data for ImplementationSet events raised by the AgentFactory contract. type AgentFactoryImplementationSetIterator struct { Event *AgentFactoryImplementationSet // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *AgentFactoryImplementationSetIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(AgentFactoryImplementationSet) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(AgentFactoryImplementationSet) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *AgentFactoryImplementationSetIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *AgentFactoryImplementationSetIterator) Close() error { it.sub.Unsubscribe() return nil } // AgentFactoryImplementationSet represents a ImplementationSet event raised by the AgentFactory contract. type AgentFactoryImplementationSet struct { Implementation common.Address Raw types.Log // Blockchain specific contextual infos } // FilterImplementationSet is a free log retrieval operation binding the contract event 0xab64f92ab780ecbf4f3866f57cee465ff36c89450dcce20237ca7a8d81fb7d13. // // Solidity: event ImplementationSet(address indexed implementation) func (_AgentFactory *AgentFactoryFilterer) FilterImplementationSet(opts *bind.FilterOpts, implementation []common.Address) (*AgentFactoryImplementationSetIterator, error) { var implementationRule []interface{} for _, implementationItem := range implementation { implementationRule = append(implementationRule, implementationItem) } logs, sub, err := _AgentFactory.contract.FilterLogs(opts, "ImplementationSet", implementationRule) if err != nil { return nil, err } return &AgentFactoryImplementationSetIterator{contract: _AgentFactory.contract, event: "ImplementationSet", logs: logs, sub: sub}, nil } // WatchImplementationSet is a free log subscription operation binding the contract event 0xab64f92ab780ecbf4f3866f57cee465ff36c89450dcce20237ca7a8d81fb7d13. // // Solidity: event ImplementationSet(address indexed implementation) func (_AgentFactory *AgentFactoryFilterer) WatchImplementationSet(opts *bind.WatchOpts, sink chan<- *AgentFactoryImplementationSet, implementation []common.Address) (event.Subscription, error) { var implementationRule []interface{} for _, implementationItem := range implementation { implementationRule = append(implementationRule, implementationItem) } logs, sub, err := _AgentFactory.contract.WatchLogs(opts, "ImplementationSet", implementationRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(AgentFactoryImplementationSet) if err := _AgentFactory.contract.UnpackLog(event, "ImplementationSet", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseImplementationSet is a log parse operation binding the contract event 0xab64f92ab780ecbf4f3866f57cee465ff36c89450dcce20237ca7a8d81fb7d13. // // Solidity: event ImplementationSet(address indexed implementation) func (_AgentFactory *AgentFactoryFilterer) ParseImplementationSet(log types.Log) (*AgentFactoryImplementationSet, error) { event := new(AgentFactoryImplementationSet) if err := _AgentFactory.contract.UnpackLog(event, "ImplementationSet", log); err != nil { return nil, err } event.Raw = log return event, nil } // AgentFactoryInitializedIterator is returned from FilterInitialized and is used to iterate over the raw logs and unpacked data for Initialized events raised by the AgentFactory contract. type AgentFactoryInitializedIterator struct { Event *AgentFactoryInitialized // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *AgentFactoryInitializedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(AgentFactoryInitialized) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(AgentFactoryInitialized) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *AgentFactoryInitializedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *AgentFactoryInitializedIterator) Close() error { it.sub.Unsubscribe() return nil } // AgentFactoryInitialized represents a Initialized event raised by the AgentFactory contract. type AgentFactoryInitialized struct { Version uint8 Raw types.Log // Blockchain specific contextual infos } // FilterInitialized is a free log retrieval operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. // // Solidity: event Initialized(uint8 version) func (_AgentFactory *AgentFactoryFilterer) FilterInitialized(opts *bind.FilterOpts) (*AgentFactoryInitializedIterator, error) { logs, sub, err := _AgentFactory.contract.FilterLogs(opts, "Initialized") if err != nil { return nil, err } return &AgentFactoryInitializedIterator{contract: _AgentFactory.contract, event: "Initialized", logs: logs, sub: sub}, nil } // WatchInitialized is a free log subscription operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. // // Solidity: event Initialized(uint8 version) func (_AgentFactory *AgentFactoryFilterer) WatchInitialized(opts *bind.WatchOpts, sink chan<- *AgentFactoryInitialized) (event.Subscription, error) { logs, sub, err := _AgentFactory.contract.WatchLogs(opts, "Initialized") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(AgentFactoryInitialized) if err := _AgentFactory.contract.UnpackLog(event, "Initialized", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseInitialized is a log parse operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. // // Solidity: event Initialized(uint8 version) func (_AgentFactory *AgentFactoryFilterer) ParseInitialized(log types.Log) (*AgentFactoryInitialized, error) { event := new(AgentFactoryInitialized) if err := _AgentFactory.contract.UnpackLog(event, "Initialized", log); err != nil { return nil, err } event.Raw = log return event, nil } // AgentFactoryOwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the AgentFactory contract. type AgentFactoryOwnershipTransferredIterator struct { Event *AgentFactoryOwnershipTransferred // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *AgentFactoryOwnershipTransferredIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(AgentFactoryOwnershipTransferred) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(AgentFactoryOwnershipTransferred) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *AgentFactoryOwnershipTransferredIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *AgentFactoryOwnershipTransferredIterator) Close() error { it.sub.Unsubscribe() return nil } // AgentFactoryOwnershipTransferred represents a OwnershipTransferred event raised by the AgentFactory contract. type AgentFactoryOwnershipTransferred struct { PreviousOwner common.Address NewOwner common.Address Raw types.Log // Blockchain specific contextual infos } // FilterOwnershipTransferred is a free log retrieval operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. // // Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) func (_AgentFactory *AgentFactoryFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*AgentFactoryOwnershipTransferredIterator, error) { var previousOwnerRule []interface{} for _, previousOwnerItem := range previousOwner { previousOwnerRule = append(previousOwnerRule, previousOwnerItem) } var newOwnerRule []interface{} for _, newOwnerItem := range newOwner { newOwnerRule = append(newOwnerRule, newOwnerItem) } logs, sub, err := _AgentFactory.contract.FilterLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) if err != nil { return nil, err } return &AgentFactoryOwnershipTransferredIterator{contract: _AgentFactory.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil } // WatchOwnershipTransferred is a free log subscription operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. // // Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) func (_AgentFactory *AgentFactoryFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *AgentFactoryOwnershipTransferred, previousOwner []common.Address, newOwner []common.Address) (event.Subscription, error) { var previousOwnerRule []interface{} for _, previousOwnerItem := range previousOwner { previousOwnerRule = append(previousOwnerRule, previousOwnerItem) } var newOwnerRule []interface{} for _, newOwnerItem := range newOwner { newOwnerRule = append(newOwnerRule, newOwnerItem) } logs, sub, err := _AgentFactory.contract.WatchLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(AgentFactoryOwnershipTransferred) if err := _AgentFactory.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseOwnershipTransferred is a log parse operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. // // Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) func (_AgentFactory *AgentFactoryFilterer) ParseOwnershipTransferred(log types.Log) (*AgentFactoryOwnershipTransferred, error) { event := new(AgentFactoryOwnershipTransferred) if err := _AgentFactory.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { return nil, err } event.Raw = log return event, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/binds/agentfactory/AgentFactory.json ================================================ [ { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "bytes32", "name": "agentId", "type": "bytes32" }, { "indexed": true, "internalType": "address", "name": "agent", "type": "address" } ], "name": "AgentCreated", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "implementation", "type": "address" } ], "name": "ImplementationSet", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "uint8", "name": "version", "type": "uint8" } ], "name": "Initialized", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "previousOwner", "type": "address" }, { "indexed": true, "internalType": "address", "name": "newOwner", "type": "address" } ], "name": "OwnershipTransferred", "type": "event" }, { "inputs": [ { "internalType": "bytes32", "name": "", "type": "bytes32" } ], "name": "agents", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "bytes32", "name": "agentId", "type": "bytes32" }, { "internalType": "string", "name": "agentName", "type": "string" }, { "internalType": "string", "name": "agentVersion", "type": "string" }, { "internalType": "string", "name": "codeLanguage", "type": "string" }, { "components": [ { "internalType": "address", "name": "retrieveAddress", "type": "address" }, { "internalType": "enum IAgent.FileType", "name": "fileType", "type": "uint8" }, { "internalType": "string", "name": "fileName", "type": "string" } ], "internalType": "struct IAgent.CodePointer[]", "name": "pointers", "type": "tuple[]" }, { "internalType": "address[]", "name": "depsAgents", "type": "address[]" }, { "internalType": "address", "name": "agentOwner", "type": "address" } ], "name": "createAgent", "outputs": [ { "internalType": "address", "name": "agent", "type": "address" } ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "getImplementation", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "owner", "type": "address" }, { "internalType": "address", "name": "implementation", "type": "address" }, { "internalType": "address", "name": "registrar", "type": "address" }, { "internalType": "address", "name": "resolver", "type": "address" } ], "name": "initialize", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "owner", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "renounceOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "implementation", "type": "address" } ], "name": "setImplementation", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "newOwner", "type": "address" } ], "name": "transferOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" } ] ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/binds/agentfactory/abigen.sh ================================================ abigen --abi=AgentFactory.json --pkg=agentfactory --type AgentFactory --out=AgentFactory.go ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/binds/agentshares/AgentShares.go ================================================ // Code generated - DO NOT EDIT. // This file is a generated binding and any manual changes will be lost. package agentshares import ( "errors" "math/big" "strings" ethereum "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/event" ) // Reference imports to suppress errors if they are not otherwise used. var ( _ = errors.New _ = big.NewInt _ = strings.NewReader _ = ethereum.NotFound _ = bind.Bind _ = common.Big1 _ = types.BloomLookup _ = event.NewSubscription _ = abi.ConvertType ) // AgentSharesMetaData contains all meta data concerning the AgentShares contract. var AgentSharesMetaData = &bind.MetaData{ ABI: "[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"ApprovalForAll\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokenClaimed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"TokenDeployed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"trader\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"isBuy\",\"type\":\"bool\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"shareAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"ethAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"protocolAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"supply\",\"type\":\"uint256\"}],\"name\":\"Trade\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"ids\",\"type\":\"uint256[]\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\"}],\"name\":\"TransferBatch\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"TransferSingle\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"string\",\"name\":\"value\",\"type\":\"string\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"URI\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"accounts\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"ids\",\"type\":\"uint256[]\"}],\"name\":\"balanceOfBatch\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"baseToken\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"supplyMax\",\"type\":\"uint256\"}],\"name\":\"buyShares\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"}],\"name\":\"claimToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"symbol\",\"type\":\"string\"}],\"name\":\"deployToken\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"getBuyPrice\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"getBuyPriceAfterFee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getChainId\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"supply\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"getPrice\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"getSellPrice\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"getSellPriceAfterFee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_baseToken\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"name\":\"isApprovedForAll\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes[]\",\"name\":\"data\",\"type\":\"bytes[]\"}],\"name\":\"multicall\",\"outputs\":[{\"internalType\":\"bytes[]\",\"name\":\"results\",\"type\":\"bytes[]\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"protocolAdmin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"protocolFeeDestination\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"protocolFeePercent\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256[]\",\"name\":\"ids\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256[]\",\"name\":\"amounts\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"safeBatchTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"safeTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"supplyMin\",\"type\":\"uint256\"}],\"name\":\"sellShares\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"setApprovalForAll\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_feeDestination\",\"type\":\"address\"}],\"name\":\"setFeeDestination\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_protocolAdmin\",\"type\":\"address\"}],\"name\":\"setProtocolAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_feePercent\",\"type\":\"uint256\"}],\"name\":\"setProtocolFeePercent\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"tokenDeployed\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"tokenSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"tokens\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"uri\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", } // AgentSharesABI is the input ABI used to generate the binding from. // Deprecated: Use AgentSharesMetaData.ABI instead. var AgentSharesABI = AgentSharesMetaData.ABI // AgentShares is an auto generated Go binding around an Ethereum contract. type AgentShares struct { AgentSharesCaller // Read-only binding to the contract AgentSharesTransactor // Write-only binding to the contract AgentSharesFilterer // Log filterer for contract events } // AgentSharesCaller is an auto generated read-only Go binding around an Ethereum contract. type AgentSharesCaller struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // AgentSharesTransactor is an auto generated write-only Go binding around an Ethereum contract. type AgentSharesTransactor struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // AgentSharesFilterer is an auto generated log filtering Go binding around an Ethereum contract events. type AgentSharesFilterer struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // AgentSharesSession is an auto generated Go binding around an Ethereum contract, // with pre-set call and transact options. type AgentSharesSession struct { Contract *AgentShares // Generic contract binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // AgentSharesCallerSession is an auto generated read-only Go binding around an Ethereum contract, // with pre-set call options. type AgentSharesCallerSession struct { Contract *AgentSharesCaller // Generic contract caller binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session } // AgentSharesTransactorSession is an auto generated write-only Go binding around an Ethereum contract, // with pre-set transact options. type AgentSharesTransactorSession struct { Contract *AgentSharesTransactor // Generic contract transactor binding to set the session for TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // AgentSharesRaw is an auto generated low-level Go binding around an Ethereum contract. type AgentSharesRaw struct { Contract *AgentShares // Generic contract binding to access the raw methods on } // AgentSharesCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. type AgentSharesCallerRaw struct { Contract *AgentSharesCaller // Generic read-only contract binding to access the raw methods on } // AgentSharesTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. type AgentSharesTransactorRaw struct { Contract *AgentSharesTransactor // Generic write-only contract binding to access the raw methods on } // NewAgentShares creates a new instance of AgentShares, bound to a specific deployed contract. func NewAgentShares(address common.Address, backend bind.ContractBackend) (*AgentShares, error) { contract, err := bindAgentShares(address, backend, backend, backend) if err != nil { return nil, err } return &AgentShares{AgentSharesCaller: AgentSharesCaller{contract: contract}, AgentSharesTransactor: AgentSharesTransactor{contract: contract}, AgentSharesFilterer: AgentSharesFilterer{contract: contract}}, nil } // NewAgentSharesCaller creates a new read-only instance of AgentShares, bound to a specific deployed contract. func NewAgentSharesCaller(address common.Address, caller bind.ContractCaller) (*AgentSharesCaller, error) { contract, err := bindAgentShares(address, caller, nil, nil) if err != nil { return nil, err } return &AgentSharesCaller{contract: contract}, nil } // NewAgentSharesTransactor creates a new write-only instance of AgentShares, bound to a specific deployed contract. func NewAgentSharesTransactor(address common.Address, transactor bind.ContractTransactor) (*AgentSharesTransactor, error) { contract, err := bindAgentShares(address, nil, transactor, nil) if err != nil { return nil, err } return &AgentSharesTransactor{contract: contract}, nil } // NewAgentSharesFilterer creates a new log filterer instance of AgentShares, bound to a specific deployed contract. func NewAgentSharesFilterer(address common.Address, filterer bind.ContractFilterer) (*AgentSharesFilterer, error) { contract, err := bindAgentShares(address, nil, nil, filterer) if err != nil { return nil, err } return &AgentSharesFilterer{contract: contract}, nil } // bindAgentShares binds a generic wrapper to an already deployed contract. func bindAgentShares(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { parsed, err := AgentSharesMetaData.GetAbi() if err != nil { return nil, err } return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_AgentShares *AgentSharesRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _AgentShares.Contract.AgentSharesCaller.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_AgentShares *AgentSharesRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _AgentShares.Contract.AgentSharesTransactor.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_AgentShares *AgentSharesRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _AgentShares.Contract.AgentSharesTransactor.contract.Transact(opts, method, params...) } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_AgentShares *AgentSharesCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _AgentShares.Contract.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_AgentShares *AgentSharesTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _AgentShares.Contract.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_AgentShares *AgentSharesTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _AgentShares.Contract.contract.Transact(opts, method, params...) } // BalanceOf is a free data retrieval call binding the contract method 0x00fdd58e. // // Solidity: function balanceOf(address account, uint256 id) view returns(uint256) func (_AgentShares *AgentSharesCaller) BalanceOf(opts *bind.CallOpts, account common.Address, id *big.Int) (*big.Int, error) { var out []interface{} err := _AgentShares.contract.Call(opts, &out, "balanceOf", account, id) if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // BalanceOf is a free data retrieval call binding the contract method 0x00fdd58e. // // Solidity: function balanceOf(address account, uint256 id) view returns(uint256) func (_AgentShares *AgentSharesSession) BalanceOf(account common.Address, id *big.Int) (*big.Int, error) { return _AgentShares.Contract.BalanceOf(&_AgentShares.CallOpts, account, id) } // BalanceOf is a free data retrieval call binding the contract method 0x00fdd58e. // // Solidity: function balanceOf(address account, uint256 id) view returns(uint256) func (_AgentShares *AgentSharesCallerSession) BalanceOf(account common.Address, id *big.Int) (*big.Int, error) { return _AgentShares.Contract.BalanceOf(&_AgentShares.CallOpts, account, id) } // BalanceOfBatch is a free data retrieval call binding the contract method 0x4e1273f4. // // Solidity: function balanceOfBatch(address[] accounts, uint256[] ids) view returns(uint256[]) func (_AgentShares *AgentSharesCaller) BalanceOfBatch(opts *bind.CallOpts, accounts []common.Address, ids []*big.Int) ([]*big.Int, error) { var out []interface{} err := _AgentShares.contract.Call(opts, &out, "balanceOfBatch", accounts, ids) if err != nil { return *new([]*big.Int), err } out0 := *abi.ConvertType(out[0], new([]*big.Int)).(*[]*big.Int) return out0, err } // BalanceOfBatch is a free data retrieval call binding the contract method 0x4e1273f4. // // Solidity: function balanceOfBatch(address[] accounts, uint256[] ids) view returns(uint256[]) func (_AgentShares *AgentSharesSession) BalanceOfBatch(accounts []common.Address, ids []*big.Int) ([]*big.Int, error) { return _AgentShares.Contract.BalanceOfBatch(&_AgentShares.CallOpts, accounts, ids) } // BalanceOfBatch is a free data retrieval call binding the contract method 0x4e1273f4. // // Solidity: function balanceOfBatch(address[] accounts, uint256[] ids) view returns(uint256[]) func (_AgentShares *AgentSharesCallerSession) BalanceOfBatch(accounts []common.Address, ids []*big.Int) ([]*big.Int, error) { return _AgentShares.Contract.BalanceOfBatch(&_AgentShares.CallOpts, accounts, ids) } // BaseToken is a free data retrieval call binding the contract method 0xc55dae63. // // Solidity: function baseToken() view returns(address) func (_AgentShares *AgentSharesCaller) BaseToken(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _AgentShares.contract.Call(opts, &out, "baseToken") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // BaseToken is a free data retrieval call binding the contract method 0xc55dae63. // // Solidity: function baseToken() view returns(address) func (_AgentShares *AgentSharesSession) BaseToken() (common.Address, error) { return _AgentShares.Contract.BaseToken(&_AgentShares.CallOpts) } // BaseToken is a free data retrieval call binding the contract method 0xc55dae63. // // Solidity: function baseToken() view returns(address) func (_AgentShares *AgentSharesCallerSession) BaseToken() (common.Address, error) { return _AgentShares.Contract.BaseToken(&_AgentShares.CallOpts) } // GetBuyPrice is a free data retrieval call binding the contract method 0xc157253d. // // Solidity: function getBuyPrice(uint256 tokenId, uint256 amount) view returns(uint256) func (_AgentShares *AgentSharesCaller) GetBuyPrice(opts *bind.CallOpts, tokenId *big.Int, amount *big.Int) (*big.Int, error) { var out []interface{} err := _AgentShares.contract.Call(opts, &out, "getBuyPrice", tokenId, amount) if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // GetBuyPrice is a free data retrieval call binding the contract method 0xc157253d. // // Solidity: function getBuyPrice(uint256 tokenId, uint256 amount) view returns(uint256) func (_AgentShares *AgentSharesSession) GetBuyPrice(tokenId *big.Int, amount *big.Int) (*big.Int, error) { return _AgentShares.Contract.GetBuyPrice(&_AgentShares.CallOpts, tokenId, amount) } // GetBuyPrice is a free data retrieval call binding the contract method 0xc157253d. // // Solidity: function getBuyPrice(uint256 tokenId, uint256 amount) view returns(uint256) func (_AgentShares *AgentSharesCallerSession) GetBuyPrice(tokenId *big.Int, amount *big.Int) (*big.Int, error) { return _AgentShares.Contract.GetBuyPrice(&_AgentShares.CallOpts, tokenId, amount) } // GetBuyPriceAfterFee is a free data retrieval call binding the contract method 0x063a741f. // // Solidity: function getBuyPriceAfterFee(uint256 tokenId, uint256 amount) view returns(uint256) func (_AgentShares *AgentSharesCaller) GetBuyPriceAfterFee(opts *bind.CallOpts, tokenId *big.Int, amount *big.Int) (*big.Int, error) { var out []interface{} err := _AgentShares.contract.Call(opts, &out, "getBuyPriceAfterFee", tokenId, amount) if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // GetBuyPriceAfterFee is a free data retrieval call binding the contract method 0x063a741f. // // Solidity: function getBuyPriceAfterFee(uint256 tokenId, uint256 amount) view returns(uint256) func (_AgentShares *AgentSharesSession) GetBuyPriceAfterFee(tokenId *big.Int, amount *big.Int) (*big.Int, error) { return _AgentShares.Contract.GetBuyPriceAfterFee(&_AgentShares.CallOpts, tokenId, amount) } // GetBuyPriceAfterFee is a free data retrieval call binding the contract method 0x063a741f. // // Solidity: function getBuyPriceAfterFee(uint256 tokenId, uint256 amount) view returns(uint256) func (_AgentShares *AgentSharesCallerSession) GetBuyPriceAfterFee(tokenId *big.Int, amount *big.Int) (*big.Int, error) { return _AgentShares.Contract.GetBuyPriceAfterFee(&_AgentShares.CallOpts, tokenId, amount) } // GetChainId is a free data retrieval call binding the contract method 0x3408e470. // // Solidity: function getChainId() view returns(uint256 chainId) func (_AgentShares *AgentSharesCaller) GetChainId(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} err := _AgentShares.contract.Call(opts, &out, "getChainId") if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // GetChainId is a free data retrieval call binding the contract method 0x3408e470. // // Solidity: function getChainId() view returns(uint256 chainId) func (_AgentShares *AgentSharesSession) GetChainId() (*big.Int, error) { return _AgentShares.Contract.GetChainId(&_AgentShares.CallOpts) } // GetChainId is a free data retrieval call binding the contract method 0x3408e470. // // Solidity: function getChainId() view returns(uint256 chainId) func (_AgentShares *AgentSharesCallerSession) GetChainId() (*big.Int, error) { return _AgentShares.Contract.GetChainId(&_AgentShares.CallOpts) } // GetPrice is a free data retrieval call binding the contract method 0x5cf4ee91. // // Solidity: function getPrice(uint256 supply, uint256 amount) pure returns(uint256) func (_AgentShares *AgentSharesCaller) GetPrice(opts *bind.CallOpts, supply *big.Int, amount *big.Int) (*big.Int, error) { var out []interface{} err := _AgentShares.contract.Call(opts, &out, "getPrice", supply, amount) if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // GetPrice is a free data retrieval call binding the contract method 0x5cf4ee91. // // Solidity: function getPrice(uint256 supply, uint256 amount) pure returns(uint256) func (_AgentShares *AgentSharesSession) GetPrice(supply *big.Int, amount *big.Int) (*big.Int, error) { return _AgentShares.Contract.GetPrice(&_AgentShares.CallOpts, supply, amount) } // GetPrice is a free data retrieval call binding the contract method 0x5cf4ee91. // // Solidity: function getPrice(uint256 supply, uint256 amount) pure returns(uint256) func (_AgentShares *AgentSharesCallerSession) GetPrice(supply *big.Int, amount *big.Int) (*big.Int, error) { return _AgentShares.Contract.GetPrice(&_AgentShares.CallOpts, supply, amount) } // GetSellPrice is a free data retrieval call binding the contract method 0x9477d85d. // // Solidity: function getSellPrice(uint256 tokenId, uint256 amount) view returns(uint256) func (_AgentShares *AgentSharesCaller) GetSellPrice(opts *bind.CallOpts, tokenId *big.Int, amount *big.Int) (*big.Int, error) { var out []interface{} err := _AgentShares.contract.Call(opts, &out, "getSellPrice", tokenId, amount) if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // GetSellPrice is a free data retrieval call binding the contract method 0x9477d85d. // // Solidity: function getSellPrice(uint256 tokenId, uint256 amount) view returns(uint256) func (_AgentShares *AgentSharesSession) GetSellPrice(tokenId *big.Int, amount *big.Int) (*big.Int, error) { return _AgentShares.Contract.GetSellPrice(&_AgentShares.CallOpts, tokenId, amount) } // GetSellPrice is a free data retrieval call binding the contract method 0x9477d85d. // // Solidity: function getSellPrice(uint256 tokenId, uint256 amount) view returns(uint256) func (_AgentShares *AgentSharesCallerSession) GetSellPrice(tokenId *big.Int, amount *big.Int) (*big.Int, error) { return _AgentShares.Contract.GetSellPrice(&_AgentShares.CallOpts, tokenId, amount) } // GetSellPriceAfterFee is a free data retrieval call binding the contract method 0xcd9c7121. // // Solidity: function getSellPriceAfterFee(uint256 tokenId, uint256 amount) view returns(uint256) func (_AgentShares *AgentSharesCaller) GetSellPriceAfterFee(opts *bind.CallOpts, tokenId *big.Int, amount *big.Int) (*big.Int, error) { var out []interface{} err := _AgentShares.contract.Call(opts, &out, "getSellPriceAfterFee", tokenId, amount) if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // GetSellPriceAfterFee is a free data retrieval call binding the contract method 0xcd9c7121. // // Solidity: function getSellPriceAfterFee(uint256 tokenId, uint256 amount) view returns(uint256) func (_AgentShares *AgentSharesSession) GetSellPriceAfterFee(tokenId *big.Int, amount *big.Int) (*big.Int, error) { return _AgentShares.Contract.GetSellPriceAfterFee(&_AgentShares.CallOpts, tokenId, amount) } // GetSellPriceAfterFee is a free data retrieval call binding the contract method 0xcd9c7121. // // Solidity: function getSellPriceAfterFee(uint256 tokenId, uint256 amount) view returns(uint256) func (_AgentShares *AgentSharesCallerSession) GetSellPriceAfterFee(tokenId *big.Int, amount *big.Int) (*big.Int, error) { return _AgentShares.Contract.GetSellPriceAfterFee(&_AgentShares.CallOpts, tokenId, amount) } // IsApprovedForAll is a free data retrieval call binding the contract method 0xe985e9c5. // // Solidity: function isApprovedForAll(address account, address operator) view returns(bool) func (_AgentShares *AgentSharesCaller) IsApprovedForAll(opts *bind.CallOpts, account common.Address, operator common.Address) (bool, error) { var out []interface{} err := _AgentShares.contract.Call(opts, &out, "isApprovedForAll", account, operator) if err != nil { return *new(bool), err } out0 := *abi.ConvertType(out[0], new(bool)).(*bool) return out0, err } // IsApprovedForAll is a free data retrieval call binding the contract method 0xe985e9c5. // // Solidity: function isApprovedForAll(address account, address operator) view returns(bool) func (_AgentShares *AgentSharesSession) IsApprovedForAll(account common.Address, operator common.Address) (bool, error) { return _AgentShares.Contract.IsApprovedForAll(&_AgentShares.CallOpts, account, operator) } // IsApprovedForAll is a free data retrieval call binding the contract method 0xe985e9c5. // // Solidity: function isApprovedForAll(address account, address operator) view returns(bool) func (_AgentShares *AgentSharesCallerSession) IsApprovedForAll(account common.Address, operator common.Address) (bool, error) { return _AgentShares.Contract.IsApprovedForAll(&_AgentShares.CallOpts, account, operator) } // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. // // Solidity: function owner() view returns(address) func (_AgentShares *AgentSharesCaller) Owner(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _AgentShares.contract.Call(opts, &out, "owner") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. // // Solidity: function owner() view returns(address) func (_AgentShares *AgentSharesSession) Owner() (common.Address, error) { return _AgentShares.Contract.Owner(&_AgentShares.CallOpts) } // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. // // Solidity: function owner() view returns(address) func (_AgentShares *AgentSharesCallerSession) Owner() (common.Address, error) { return _AgentShares.Contract.Owner(&_AgentShares.CallOpts) } // ProtocolAdmin is a free data retrieval call binding the contract method 0x420f6861. // // Solidity: function protocolAdmin() view returns(address) func (_AgentShares *AgentSharesCaller) ProtocolAdmin(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _AgentShares.contract.Call(opts, &out, "protocolAdmin") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // ProtocolAdmin is a free data retrieval call binding the contract method 0x420f6861. // // Solidity: function protocolAdmin() view returns(address) func (_AgentShares *AgentSharesSession) ProtocolAdmin() (common.Address, error) { return _AgentShares.Contract.ProtocolAdmin(&_AgentShares.CallOpts) } // ProtocolAdmin is a free data retrieval call binding the contract method 0x420f6861. // // Solidity: function protocolAdmin() view returns(address) func (_AgentShares *AgentSharesCallerSession) ProtocolAdmin() (common.Address, error) { return _AgentShares.Contract.ProtocolAdmin(&_AgentShares.CallOpts) } // ProtocolFeeDestination is a free data retrieval call binding the contract method 0x4ce7957c. // // Solidity: function protocolFeeDestination() view returns(address) func (_AgentShares *AgentSharesCaller) ProtocolFeeDestination(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _AgentShares.contract.Call(opts, &out, "protocolFeeDestination") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // ProtocolFeeDestination is a free data retrieval call binding the contract method 0x4ce7957c. // // Solidity: function protocolFeeDestination() view returns(address) func (_AgentShares *AgentSharesSession) ProtocolFeeDestination() (common.Address, error) { return _AgentShares.Contract.ProtocolFeeDestination(&_AgentShares.CallOpts) } // ProtocolFeeDestination is a free data retrieval call binding the contract method 0x4ce7957c. // // Solidity: function protocolFeeDestination() view returns(address) func (_AgentShares *AgentSharesCallerSession) ProtocolFeeDestination() (common.Address, error) { return _AgentShares.Contract.ProtocolFeeDestination(&_AgentShares.CallOpts) } // ProtocolFeePercent is a free data retrieval call binding the contract method 0xd6e6eb9f. // // Solidity: function protocolFeePercent() view returns(uint256) func (_AgentShares *AgentSharesCaller) ProtocolFeePercent(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} err := _AgentShares.contract.Call(opts, &out, "protocolFeePercent") if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // ProtocolFeePercent is a free data retrieval call binding the contract method 0xd6e6eb9f. // // Solidity: function protocolFeePercent() view returns(uint256) func (_AgentShares *AgentSharesSession) ProtocolFeePercent() (*big.Int, error) { return _AgentShares.Contract.ProtocolFeePercent(&_AgentShares.CallOpts) } // ProtocolFeePercent is a free data retrieval call binding the contract method 0xd6e6eb9f. // // Solidity: function protocolFeePercent() view returns(uint256) func (_AgentShares *AgentSharesCallerSession) ProtocolFeePercent() (*big.Int, error) { return _AgentShares.Contract.ProtocolFeePercent(&_AgentShares.CallOpts) } // SupportsInterface is a free data retrieval call binding the contract method 0x01ffc9a7. // // Solidity: function supportsInterface(bytes4 interfaceId) view returns(bool) func (_AgentShares *AgentSharesCaller) SupportsInterface(opts *bind.CallOpts, interfaceId [4]byte) (bool, error) { var out []interface{} err := _AgentShares.contract.Call(opts, &out, "supportsInterface", interfaceId) if err != nil { return *new(bool), err } out0 := *abi.ConvertType(out[0], new(bool)).(*bool) return out0, err } // SupportsInterface is a free data retrieval call binding the contract method 0x01ffc9a7. // // Solidity: function supportsInterface(bytes4 interfaceId) view returns(bool) func (_AgentShares *AgentSharesSession) SupportsInterface(interfaceId [4]byte) (bool, error) { return _AgentShares.Contract.SupportsInterface(&_AgentShares.CallOpts, interfaceId) } // SupportsInterface is a free data retrieval call binding the contract method 0x01ffc9a7. // // Solidity: function supportsInterface(bytes4 interfaceId) view returns(bool) func (_AgentShares *AgentSharesCallerSession) SupportsInterface(interfaceId [4]byte) (bool, error) { return _AgentShares.Contract.SupportsInterface(&_AgentShares.CallOpts, interfaceId) } // TokenDeployed is a free data retrieval call binding the contract method 0x1039a12d. // // Solidity: function tokenDeployed() view returns(address) func (_AgentShares *AgentSharesCaller) TokenDeployed(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _AgentShares.contract.Call(opts, &out, "tokenDeployed") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // TokenDeployed is a free data retrieval call binding the contract method 0x1039a12d. // // Solidity: function tokenDeployed() view returns(address) func (_AgentShares *AgentSharesSession) TokenDeployed() (common.Address, error) { return _AgentShares.Contract.TokenDeployed(&_AgentShares.CallOpts) } // TokenDeployed is a free data retrieval call binding the contract method 0x1039a12d. // // Solidity: function tokenDeployed() view returns(address) func (_AgentShares *AgentSharesCallerSession) TokenDeployed() (common.Address, error) { return _AgentShares.Contract.TokenDeployed(&_AgentShares.CallOpts) } // TokenSupply is a free data retrieval call binding the contract method 0x2693ebf2. // // Solidity: function tokenSupply(uint256 ) view returns(uint256) func (_AgentShares *AgentSharesCaller) TokenSupply(opts *bind.CallOpts, arg0 *big.Int) (*big.Int, error) { var out []interface{} err := _AgentShares.contract.Call(opts, &out, "tokenSupply", arg0) if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // TokenSupply is a free data retrieval call binding the contract method 0x2693ebf2. // // Solidity: function tokenSupply(uint256 ) view returns(uint256) func (_AgentShares *AgentSharesSession) TokenSupply(arg0 *big.Int) (*big.Int, error) { return _AgentShares.Contract.TokenSupply(&_AgentShares.CallOpts, arg0) } // TokenSupply is a free data retrieval call binding the contract method 0x2693ebf2. // // Solidity: function tokenSupply(uint256 ) view returns(uint256) func (_AgentShares *AgentSharesCallerSession) TokenSupply(arg0 *big.Int) (*big.Int, error) { return _AgentShares.Contract.TokenSupply(&_AgentShares.CallOpts, arg0) } // Tokens is a free data retrieval call binding the contract method 0x4f64b2be. // // Solidity: function tokens(uint256 ) view returns(address) func (_AgentShares *AgentSharesCaller) Tokens(opts *bind.CallOpts, arg0 *big.Int) (common.Address, error) { var out []interface{} err := _AgentShares.contract.Call(opts, &out, "tokens", arg0) if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // Tokens is a free data retrieval call binding the contract method 0x4f64b2be. // // Solidity: function tokens(uint256 ) view returns(address) func (_AgentShares *AgentSharesSession) Tokens(arg0 *big.Int) (common.Address, error) { return _AgentShares.Contract.Tokens(&_AgentShares.CallOpts, arg0) } // Tokens is a free data retrieval call binding the contract method 0x4f64b2be. // // Solidity: function tokens(uint256 ) view returns(address) func (_AgentShares *AgentSharesCallerSession) Tokens(arg0 *big.Int) (common.Address, error) { return _AgentShares.Contract.Tokens(&_AgentShares.CallOpts, arg0) } // Uri is a free data retrieval call binding the contract method 0x0e89341c. // // Solidity: function uri(uint256 ) view returns(string) func (_AgentShares *AgentSharesCaller) Uri(opts *bind.CallOpts, arg0 *big.Int) (string, error) { var out []interface{} err := _AgentShares.contract.Call(opts, &out, "uri", arg0) if err != nil { return *new(string), err } out0 := *abi.ConvertType(out[0], new(string)).(*string) return out0, err } // Uri is a free data retrieval call binding the contract method 0x0e89341c. // // Solidity: function uri(uint256 ) view returns(string) func (_AgentShares *AgentSharesSession) Uri(arg0 *big.Int) (string, error) { return _AgentShares.Contract.Uri(&_AgentShares.CallOpts, arg0) } // Uri is a free data retrieval call binding the contract method 0x0e89341c. // // Solidity: function uri(uint256 ) view returns(string) func (_AgentShares *AgentSharesCallerSession) Uri(arg0 *big.Int) (string, error) { return _AgentShares.Contract.Uri(&_AgentShares.CallOpts, arg0) } // BuyShares is a paid mutator transaction binding the contract method 0x7aabf58a. // // Solidity: function buyShares(uint256 tokenId, uint256 amount, uint256 supplyMax) returns() func (_AgentShares *AgentSharesTransactor) BuyShares(opts *bind.TransactOpts, tokenId *big.Int, amount *big.Int, supplyMax *big.Int) (*types.Transaction, error) { return _AgentShares.contract.Transact(opts, "buyShares", tokenId, amount, supplyMax) } // BuyShares is a paid mutator transaction binding the contract method 0x7aabf58a. // // Solidity: function buyShares(uint256 tokenId, uint256 amount, uint256 supplyMax) returns() func (_AgentShares *AgentSharesSession) BuyShares(tokenId *big.Int, amount *big.Int, supplyMax *big.Int) (*types.Transaction, error) { return _AgentShares.Contract.BuyShares(&_AgentShares.TransactOpts, tokenId, amount, supplyMax) } // BuyShares is a paid mutator transaction binding the contract method 0x7aabf58a. // // Solidity: function buyShares(uint256 tokenId, uint256 amount, uint256 supplyMax) returns() func (_AgentShares *AgentSharesTransactorSession) BuyShares(tokenId *big.Int, amount *big.Int, supplyMax *big.Int) (*types.Transaction, error) { return _AgentShares.Contract.BuyShares(&_AgentShares.TransactOpts, tokenId, amount, supplyMax) } // ClaimToken is a paid mutator transaction binding the contract method 0xc49662c5. // // Solidity: function claimToken(uint256 tokenId, address user) returns() func (_AgentShares *AgentSharesTransactor) ClaimToken(opts *bind.TransactOpts, tokenId *big.Int, user common.Address) (*types.Transaction, error) { return _AgentShares.contract.Transact(opts, "claimToken", tokenId, user) } // ClaimToken is a paid mutator transaction binding the contract method 0xc49662c5. // // Solidity: function claimToken(uint256 tokenId, address user) returns() func (_AgentShares *AgentSharesSession) ClaimToken(tokenId *big.Int, user common.Address) (*types.Transaction, error) { return _AgentShares.Contract.ClaimToken(&_AgentShares.TransactOpts, tokenId, user) } // ClaimToken is a paid mutator transaction binding the contract method 0xc49662c5. // // Solidity: function claimToken(uint256 tokenId, address user) returns() func (_AgentShares *AgentSharesTransactorSession) ClaimToken(tokenId *big.Int, user common.Address) (*types.Transaction, error) { return _AgentShares.Contract.ClaimToken(&_AgentShares.TransactOpts, tokenId, user) } // DeployToken is a paid mutator transaction binding the contract method 0xda68ed12. // // Solidity: function deployToken(uint256 tokenId, string name, string symbol) returns(address) func (_AgentShares *AgentSharesTransactor) DeployToken(opts *bind.TransactOpts, tokenId *big.Int, name string, symbol string) (*types.Transaction, error) { return _AgentShares.contract.Transact(opts, "deployToken", tokenId, name, symbol) } // DeployToken is a paid mutator transaction binding the contract method 0xda68ed12. // // Solidity: function deployToken(uint256 tokenId, string name, string symbol) returns(address) func (_AgentShares *AgentSharesSession) DeployToken(tokenId *big.Int, name string, symbol string) (*types.Transaction, error) { return _AgentShares.Contract.DeployToken(&_AgentShares.TransactOpts, tokenId, name, symbol) } // DeployToken is a paid mutator transaction binding the contract method 0xda68ed12. // // Solidity: function deployToken(uint256 tokenId, string name, string symbol) returns(address) func (_AgentShares *AgentSharesTransactorSession) DeployToken(tokenId *big.Int, name string, symbol string) (*types.Transaction, error) { return _AgentShares.Contract.DeployToken(&_AgentShares.TransactOpts, tokenId, name, symbol) } // Initialize is a paid mutator transaction binding the contract method 0xc4d66de8. // // Solidity: function initialize(address _baseToken) returns() func (_AgentShares *AgentSharesTransactor) Initialize(opts *bind.TransactOpts, _baseToken common.Address) (*types.Transaction, error) { return _AgentShares.contract.Transact(opts, "initialize", _baseToken) } // Initialize is a paid mutator transaction binding the contract method 0xc4d66de8. // // Solidity: function initialize(address _baseToken) returns() func (_AgentShares *AgentSharesSession) Initialize(_baseToken common.Address) (*types.Transaction, error) { return _AgentShares.Contract.Initialize(&_AgentShares.TransactOpts, _baseToken) } // Initialize is a paid mutator transaction binding the contract method 0xc4d66de8. // // Solidity: function initialize(address _baseToken) returns() func (_AgentShares *AgentSharesTransactorSession) Initialize(_baseToken common.Address) (*types.Transaction, error) { return _AgentShares.Contract.Initialize(&_AgentShares.TransactOpts, _baseToken) } // Multicall is a paid mutator transaction binding the contract method 0xac9650d8. // // Solidity: function multicall(bytes[] data) payable returns(bytes[] results) func (_AgentShares *AgentSharesTransactor) Multicall(opts *bind.TransactOpts, data [][]byte) (*types.Transaction, error) { return _AgentShares.contract.Transact(opts, "multicall", data) } // Multicall is a paid mutator transaction binding the contract method 0xac9650d8. // // Solidity: function multicall(bytes[] data) payable returns(bytes[] results) func (_AgentShares *AgentSharesSession) Multicall(data [][]byte) (*types.Transaction, error) { return _AgentShares.Contract.Multicall(&_AgentShares.TransactOpts, data) } // Multicall is a paid mutator transaction binding the contract method 0xac9650d8. // // Solidity: function multicall(bytes[] data) payable returns(bytes[] results) func (_AgentShares *AgentSharesTransactorSession) Multicall(data [][]byte) (*types.Transaction, error) { return _AgentShares.Contract.Multicall(&_AgentShares.TransactOpts, data) } // RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. // // Solidity: function renounceOwnership() returns() func (_AgentShares *AgentSharesTransactor) RenounceOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { return _AgentShares.contract.Transact(opts, "renounceOwnership") } // RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. // // Solidity: function renounceOwnership() returns() func (_AgentShares *AgentSharesSession) RenounceOwnership() (*types.Transaction, error) { return _AgentShares.Contract.RenounceOwnership(&_AgentShares.TransactOpts) } // RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. // // Solidity: function renounceOwnership() returns() func (_AgentShares *AgentSharesTransactorSession) RenounceOwnership() (*types.Transaction, error) { return _AgentShares.Contract.RenounceOwnership(&_AgentShares.TransactOpts) } // SafeBatchTransferFrom is a paid mutator transaction binding the contract method 0x2eb2c2d6. // // Solidity: function safeBatchTransferFrom(address from, address to, uint256[] ids, uint256[] amounts, bytes data) returns() func (_AgentShares *AgentSharesTransactor) SafeBatchTransferFrom(opts *bind.TransactOpts, from common.Address, to common.Address, ids []*big.Int, amounts []*big.Int, data []byte) (*types.Transaction, error) { return _AgentShares.contract.Transact(opts, "safeBatchTransferFrom", from, to, ids, amounts, data) } // SafeBatchTransferFrom is a paid mutator transaction binding the contract method 0x2eb2c2d6. // // Solidity: function safeBatchTransferFrom(address from, address to, uint256[] ids, uint256[] amounts, bytes data) returns() func (_AgentShares *AgentSharesSession) SafeBatchTransferFrom(from common.Address, to common.Address, ids []*big.Int, amounts []*big.Int, data []byte) (*types.Transaction, error) { return _AgentShares.Contract.SafeBatchTransferFrom(&_AgentShares.TransactOpts, from, to, ids, amounts, data) } // SafeBatchTransferFrom is a paid mutator transaction binding the contract method 0x2eb2c2d6. // // Solidity: function safeBatchTransferFrom(address from, address to, uint256[] ids, uint256[] amounts, bytes data) returns() func (_AgentShares *AgentSharesTransactorSession) SafeBatchTransferFrom(from common.Address, to common.Address, ids []*big.Int, amounts []*big.Int, data []byte) (*types.Transaction, error) { return _AgentShares.Contract.SafeBatchTransferFrom(&_AgentShares.TransactOpts, from, to, ids, amounts, data) } // SafeTransferFrom is a paid mutator transaction binding the contract method 0xf242432a. // // Solidity: function safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes data) returns() func (_AgentShares *AgentSharesTransactor) SafeTransferFrom(opts *bind.TransactOpts, from common.Address, to common.Address, id *big.Int, amount *big.Int, data []byte) (*types.Transaction, error) { return _AgentShares.contract.Transact(opts, "safeTransferFrom", from, to, id, amount, data) } // SafeTransferFrom is a paid mutator transaction binding the contract method 0xf242432a. // // Solidity: function safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes data) returns() func (_AgentShares *AgentSharesSession) SafeTransferFrom(from common.Address, to common.Address, id *big.Int, amount *big.Int, data []byte) (*types.Transaction, error) { return _AgentShares.Contract.SafeTransferFrom(&_AgentShares.TransactOpts, from, to, id, amount, data) } // SafeTransferFrom is a paid mutator transaction binding the contract method 0xf242432a. // // Solidity: function safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes data) returns() func (_AgentShares *AgentSharesTransactorSession) SafeTransferFrom(from common.Address, to common.Address, id *big.Int, amount *big.Int, data []byte) (*types.Transaction, error) { return _AgentShares.Contract.SafeTransferFrom(&_AgentShares.TransactOpts, from, to, id, amount, data) } // SellShares is a paid mutator transaction binding the contract method 0xd67c6872. // // Solidity: function sellShares(uint256 tokenId, uint256 amount, uint256 supplyMin) returns() func (_AgentShares *AgentSharesTransactor) SellShares(opts *bind.TransactOpts, tokenId *big.Int, amount *big.Int, supplyMin *big.Int) (*types.Transaction, error) { return _AgentShares.contract.Transact(opts, "sellShares", tokenId, amount, supplyMin) } // SellShares is a paid mutator transaction binding the contract method 0xd67c6872. // // Solidity: function sellShares(uint256 tokenId, uint256 amount, uint256 supplyMin) returns() func (_AgentShares *AgentSharesSession) SellShares(tokenId *big.Int, amount *big.Int, supplyMin *big.Int) (*types.Transaction, error) { return _AgentShares.Contract.SellShares(&_AgentShares.TransactOpts, tokenId, amount, supplyMin) } // SellShares is a paid mutator transaction binding the contract method 0xd67c6872. // // Solidity: function sellShares(uint256 tokenId, uint256 amount, uint256 supplyMin) returns() func (_AgentShares *AgentSharesTransactorSession) SellShares(tokenId *big.Int, amount *big.Int, supplyMin *big.Int) (*types.Transaction, error) { return _AgentShares.Contract.SellShares(&_AgentShares.TransactOpts, tokenId, amount, supplyMin) } // SetApprovalForAll is a paid mutator transaction binding the contract method 0xa22cb465. // // Solidity: function setApprovalForAll(address operator, bool approved) returns() func (_AgentShares *AgentSharesTransactor) SetApprovalForAll(opts *bind.TransactOpts, operator common.Address, approved bool) (*types.Transaction, error) { return _AgentShares.contract.Transact(opts, "setApprovalForAll", operator, approved) } // SetApprovalForAll is a paid mutator transaction binding the contract method 0xa22cb465. // // Solidity: function setApprovalForAll(address operator, bool approved) returns() func (_AgentShares *AgentSharesSession) SetApprovalForAll(operator common.Address, approved bool) (*types.Transaction, error) { return _AgentShares.Contract.SetApprovalForAll(&_AgentShares.TransactOpts, operator, approved) } // SetApprovalForAll is a paid mutator transaction binding the contract method 0xa22cb465. // // Solidity: function setApprovalForAll(address operator, bool approved) returns() func (_AgentShares *AgentSharesTransactorSession) SetApprovalForAll(operator common.Address, approved bool) (*types.Transaction, error) { return _AgentShares.Contract.SetApprovalForAll(&_AgentShares.TransactOpts, operator, approved) } // SetFeeDestination is a paid mutator transaction binding the contract method 0xfbe53234. // // Solidity: function setFeeDestination(address _feeDestination) returns() func (_AgentShares *AgentSharesTransactor) SetFeeDestination(opts *bind.TransactOpts, _feeDestination common.Address) (*types.Transaction, error) { return _AgentShares.contract.Transact(opts, "setFeeDestination", _feeDestination) } // SetFeeDestination is a paid mutator transaction binding the contract method 0xfbe53234. // // Solidity: function setFeeDestination(address _feeDestination) returns() func (_AgentShares *AgentSharesSession) SetFeeDestination(_feeDestination common.Address) (*types.Transaction, error) { return _AgentShares.Contract.SetFeeDestination(&_AgentShares.TransactOpts, _feeDestination) } // SetFeeDestination is a paid mutator transaction binding the contract method 0xfbe53234. // // Solidity: function setFeeDestination(address _feeDestination) returns() func (_AgentShares *AgentSharesTransactorSession) SetFeeDestination(_feeDestination common.Address) (*types.Transaction, error) { return _AgentShares.Contract.SetFeeDestination(&_AgentShares.TransactOpts, _feeDestination) } // SetProtocolAdmin is a paid mutator transaction binding the contract method 0x9a09b285. // // Solidity: function setProtocolAdmin(address _protocolAdmin) returns() func (_AgentShares *AgentSharesTransactor) SetProtocolAdmin(opts *bind.TransactOpts, _protocolAdmin common.Address) (*types.Transaction, error) { return _AgentShares.contract.Transact(opts, "setProtocolAdmin", _protocolAdmin) } // SetProtocolAdmin is a paid mutator transaction binding the contract method 0x9a09b285. // // Solidity: function setProtocolAdmin(address _protocolAdmin) returns() func (_AgentShares *AgentSharesSession) SetProtocolAdmin(_protocolAdmin common.Address) (*types.Transaction, error) { return _AgentShares.Contract.SetProtocolAdmin(&_AgentShares.TransactOpts, _protocolAdmin) } // SetProtocolAdmin is a paid mutator transaction binding the contract method 0x9a09b285. // // Solidity: function setProtocolAdmin(address _protocolAdmin) returns() func (_AgentShares *AgentSharesTransactorSession) SetProtocolAdmin(_protocolAdmin common.Address) (*types.Transaction, error) { return _AgentShares.Contract.SetProtocolAdmin(&_AgentShares.TransactOpts, _protocolAdmin) } // SetProtocolFeePercent is a paid mutator transaction binding the contract method 0xa4983421. // // Solidity: function setProtocolFeePercent(uint256 _feePercent) returns() func (_AgentShares *AgentSharesTransactor) SetProtocolFeePercent(opts *bind.TransactOpts, _feePercent *big.Int) (*types.Transaction, error) { return _AgentShares.contract.Transact(opts, "setProtocolFeePercent", _feePercent) } // SetProtocolFeePercent is a paid mutator transaction binding the contract method 0xa4983421. // // Solidity: function setProtocolFeePercent(uint256 _feePercent) returns() func (_AgentShares *AgentSharesSession) SetProtocolFeePercent(_feePercent *big.Int) (*types.Transaction, error) { return _AgentShares.Contract.SetProtocolFeePercent(&_AgentShares.TransactOpts, _feePercent) } // SetProtocolFeePercent is a paid mutator transaction binding the contract method 0xa4983421. // // Solidity: function setProtocolFeePercent(uint256 _feePercent) returns() func (_AgentShares *AgentSharesTransactorSession) SetProtocolFeePercent(_feePercent *big.Int) (*types.Transaction, error) { return _AgentShares.Contract.SetProtocolFeePercent(&_AgentShares.TransactOpts, _feePercent) } // TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. // // Solidity: function transferOwnership(address newOwner) returns() func (_AgentShares *AgentSharesTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) { return _AgentShares.contract.Transact(opts, "transferOwnership", newOwner) } // TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. // // Solidity: function transferOwnership(address newOwner) returns() func (_AgentShares *AgentSharesSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { return _AgentShares.Contract.TransferOwnership(&_AgentShares.TransactOpts, newOwner) } // TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. // // Solidity: function transferOwnership(address newOwner) returns() func (_AgentShares *AgentSharesTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { return _AgentShares.Contract.TransferOwnership(&_AgentShares.TransactOpts, newOwner) } // AgentSharesApprovalForAllIterator is returned from FilterApprovalForAll and is used to iterate over the raw logs and unpacked data for ApprovalForAll events raised by the AgentShares contract. type AgentSharesApprovalForAllIterator struct { Event *AgentSharesApprovalForAll // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *AgentSharesApprovalForAllIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(AgentSharesApprovalForAll) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(AgentSharesApprovalForAll) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *AgentSharesApprovalForAllIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *AgentSharesApprovalForAllIterator) Close() error { it.sub.Unsubscribe() return nil } // AgentSharesApprovalForAll represents a ApprovalForAll event raised by the AgentShares contract. type AgentSharesApprovalForAll struct { Account common.Address Operator common.Address Approved bool Raw types.Log // Blockchain specific contextual infos } // FilterApprovalForAll is a free log retrieval operation binding the contract event 0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31. // // Solidity: event ApprovalForAll(address indexed account, address indexed operator, bool approved) func (_AgentShares *AgentSharesFilterer) FilterApprovalForAll(opts *bind.FilterOpts, account []common.Address, operator []common.Address) (*AgentSharesApprovalForAllIterator, error) { var accountRule []interface{} for _, accountItem := range account { accountRule = append(accountRule, accountItem) } var operatorRule []interface{} for _, operatorItem := range operator { operatorRule = append(operatorRule, operatorItem) } logs, sub, err := _AgentShares.contract.FilterLogs(opts, "ApprovalForAll", accountRule, operatorRule) if err != nil { return nil, err } return &AgentSharesApprovalForAllIterator{contract: _AgentShares.contract, event: "ApprovalForAll", logs: logs, sub: sub}, nil } // WatchApprovalForAll is a free log subscription operation binding the contract event 0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31. // // Solidity: event ApprovalForAll(address indexed account, address indexed operator, bool approved) func (_AgentShares *AgentSharesFilterer) WatchApprovalForAll(opts *bind.WatchOpts, sink chan<- *AgentSharesApprovalForAll, account []common.Address, operator []common.Address) (event.Subscription, error) { var accountRule []interface{} for _, accountItem := range account { accountRule = append(accountRule, accountItem) } var operatorRule []interface{} for _, operatorItem := range operator { operatorRule = append(operatorRule, operatorItem) } logs, sub, err := _AgentShares.contract.WatchLogs(opts, "ApprovalForAll", accountRule, operatorRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(AgentSharesApprovalForAll) if err := _AgentShares.contract.UnpackLog(event, "ApprovalForAll", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseApprovalForAll is a log parse operation binding the contract event 0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31. // // Solidity: event ApprovalForAll(address indexed account, address indexed operator, bool approved) func (_AgentShares *AgentSharesFilterer) ParseApprovalForAll(log types.Log) (*AgentSharesApprovalForAll, error) { event := new(AgentSharesApprovalForAll) if err := _AgentShares.contract.UnpackLog(event, "ApprovalForAll", log); err != nil { return nil, err } event.Raw = log return event, nil } // AgentSharesInitializedIterator is returned from FilterInitialized and is used to iterate over the raw logs and unpacked data for Initialized events raised by the AgentShares contract. type AgentSharesInitializedIterator struct { Event *AgentSharesInitialized // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *AgentSharesInitializedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(AgentSharesInitialized) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(AgentSharesInitialized) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *AgentSharesInitializedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *AgentSharesInitializedIterator) Close() error { it.sub.Unsubscribe() return nil } // AgentSharesInitialized represents a Initialized event raised by the AgentShares contract. type AgentSharesInitialized struct { Version uint8 Raw types.Log // Blockchain specific contextual infos } // FilterInitialized is a free log retrieval operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. // // Solidity: event Initialized(uint8 version) func (_AgentShares *AgentSharesFilterer) FilterInitialized(opts *bind.FilterOpts) (*AgentSharesInitializedIterator, error) { logs, sub, err := _AgentShares.contract.FilterLogs(opts, "Initialized") if err != nil { return nil, err } return &AgentSharesInitializedIterator{contract: _AgentShares.contract, event: "Initialized", logs: logs, sub: sub}, nil } // WatchInitialized is a free log subscription operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. // // Solidity: event Initialized(uint8 version) func (_AgentShares *AgentSharesFilterer) WatchInitialized(opts *bind.WatchOpts, sink chan<- *AgentSharesInitialized) (event.Subscription, error) { logs, sub, err := _AgentShares.contract.WatchLogs(opts, "Initialized") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(AgentSharesInitialized) if err := _AgentShares.contract.UnpackLog(event, "Initialized", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseInitialized is a log parse operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. // // Solidity: event Initialized(uint8 version) func (_AgentShares *AgentSharesFilterer) ParseInitialized(log types.Log) (*AgentSharesInitialized, error) { event := new(AgentSharesInitialized) if err := _AgentShares.contract.UnpackLog(event, "Initialized", log); err != nil { return nil, err } event.Raw = log return event, nil } // AgentSharesOwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the AgentShares contract. type AgentSharesOwnershipTransferredIterator struct { Event *AgentSharesOwnershipTransferred // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *AgentSharesOwnershipTransferredIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(AgentSharesOwnershipTransferred) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(AgentSharesOwnershipTransferred) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *AgentSharesOwnershipTransferredIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *AgentSharesOwnershipTransferredIterator) Close() error { it.sub.Unsubscribe() return nil } // AgentSharesOwnershipTransferred represents a OwnershipTransferred event raised by the AgentShares contract. type AgentSharesOwnershipTransferred struct { PreviousOwner common.Address NewOwner common.Address Raw types.Log // Blockchain specific contextual infos } // FilterOwnershipTransferred is a free log retrieval operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. // // Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) func (_AgentShares *AgentSharesFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*AgentSharesOwnershipTransferredIterator, error) { var previousOwnerRule []interface{} for _, previousOwnerItem := range previousOwner { previousOwnerRule = append(previousOwnerRule, previousOwnerItem) } var newOwnerRule []interface{} for _, newOwnerItem := range newOwner { newOwnerRule = append(newOwnerRule, newOwnerItem) } logs, sub, err := _AgentShares.contract.FilterLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) if err != nil { return nil, err } return &AgentSharesOwnershipTransferredIterator{contract: _AgentShares.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil } // WatchOwnershipTransferred is a free log subscription operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. // // Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) func (_AgentShares *AgentSharesFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *AgentSharesOwnershipTransferred, previousOwner []common.Address, newOwner []common.Address) (event.Subscription, error) { var previousOwnerRule []interface{} for _, previousOwnerItem := range previousOwner { previousOwnerRule = append(previousOwnerRule, previousOwnerItem) } var newOwnerRule []interface{} for _, newOwnerItem := range newOwner { newOwnerRule = append(newOwnerRule, newOwnerItem) } logs, sub, err := _AgentShares.contract.WatchLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(AgentSharesOwnershipTransferred) if err := _AgentShares.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseOwnershipTransferred is a log parse operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. // // Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) func (_AgentShares *AgentSharesFilterer) ParseOwnershipTransferred(log types.Log) (*AgentSharesOwnershipTransferred, error) { event := new(AgentSharesOwnershipTransferred) if err := _AgentShares.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { return nil, err } event.Raw = log return event, nil } // AgentSharesTokenClaimedIterator is returned from FilterTokenClaimed and is used to iterate over the raw logs and unpacked data for TokenClaimed events raised by the AgentShares contract. type AgentSharesTokenClaimedIterator struct { Event *AgentSharesTokenClaimed // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *AgentSharesTokenClaimedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(AgentSharesTokenClaimed) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(AgentSharesTokenClaimed) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *AgentSharesTokenClaimedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *AgentSharesTokenClaimedIterator) Close() error { it.sub.Unsubscribe() return nil } // AgentSharesTokenClaimed represents a TokenClaimed event raised by the AgentShares contract. type AgentSharesTokenClaimed struct { TokenId *big.Int Token common.Address User common.Address Amount *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterTokenClaimed is a free log retrieval operation binding the contract event 0xa0126cb27d0e7a0ae1b6240b529bbdaaa427fd657cc72b15acf3ddbac115b66e. // // Solidity: event TokenClaimed(uint256 indexed tokenId, address indexed token, address indexed user, uint256 amount) func (_AgentShares *AgentSharesFilterer) FilterTokenClaimed(opts *bind.FilterOpts, tokenId []*big.Int, token []common.Address, user []common.Address) (*AgentSharesTokenClaimedIterator, error) { var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } var tokenRule []interface{} for _, tokenItem := range token { tokenRule = append(tokenRule, tokenItem) } var userRule []interface{} for _, userItem := range user { userRule = append(userRule, userItem) } logs, sub, err := _AgentShares.contract.FilterLogs(opts, "TokenClaimed", tokenIdRule, tokenRule, userRule) if err != nil { return nil, err } return &AgentSharesTokenClaimedIterator{contract: _AgentShares.contract, event: "TokenClaimed", logs: logs, sub: sub}, nil } // WatchTokenClaimed is a free log subscription operation binding the contract event 0xa0126cb27d0e7a0ae1b6240b529bbdaaa427fd657cc72b15acf3ddbac115b66e. // // Solidity: event TokenClaimed(uint256 indexed tokenId, address indexed token, address indexed user, uint256 amount) func (_AgentShares *AgentSharesFilterer) WatchTokenClaimed(opts *bind.WatchOpts, sink chan<- *AgentSharesTokenClaimed, tokenId []*big.Int, token []common.Address, user []common.Address) (event.Subscription, error) { var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } var tokenRule []interface{} for _, tokenItem := range token { tokenRule = append(tokenRule, tokenItem) } var userRule []interface{} for _, userItem := range user { userRule = append(userRule, userItem) } logs, sub, err := _AgentShares.contract.WatchLogs(opts, "TokenClaimed", tokenIdRule, tokenRule, userRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(AgentSharesTokenClaimed) if err := _AgentShares.contract.UnpackLog(event, "TokenClaimed", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseTokenClaimed is a log parse operation binding the contract event 0xa0126cb27d0e7a0ae1b6240b529bbdaaa427fd657cc72b15acf3ddbac115b66e. // // Solidity: event TokenClaimed(uint256 indexed tokenId, address indexed token, address indexed user, uint256 amount) func (_AgentShares *AgentSharesFilterer) ParseTokenClaimed(log types.Log) (*AgentSharesTokenClaimed, error) { event := new(AgentSharesTokenClaimed) if err := _AgentShares.contract.UnpackLog(event, "TokenClaimed", log); err != nil { return nil, err } event.Raw = log return event, nil } // AgentSharesTokenDeployedIterator is returned from FilterTokenDeployed and is used to iterate over the raw logs and unpacked data for TokenDeployed events raised by the AgentShares contract. type AgentSharesTokenDeployedIterator struct { Event *AgentSharesTokenDeployed // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *AgentSharesTokenDeployedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(AgentSharesTokenDeployed) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(AgentSharesTokenDeployed) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *AgentSharesTokenDeployedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *AgentSharesTokenDeployedIterator) Close() error { it.sub.Unsubscribe() return nil } // AgentSharesTokenDeployed represents a TokenDeployed event raised by the AgentShares contract. type AgentSharesTokenDeployed struct { TokenId *big.Int Token common.Address Raw types.Log // Blockchain specific contextual infos } // FilterTokenDeployed is a free log retrieval operation binding the contract event 0xb0886d5b89c3540effacb4587a5c495172ace26a507fef96fb8ccb8376ae9df5. // // Solidity: event TokenDeployed(uint256 indexed tokenId, address indexed token) func (_AgentShares *AgentSharesFilterer) FilterTokenDeployed(opts *bind.FilterOpts, tokenId []*big.Int, token []common.Address) (*AgentSharesTokenDeployedIterator, error) { var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } var tokenRule []interface{} for _, tokenItem := range token { tokenRule = append(tokenRule, tokenItem) } logs, sub, err := _AgentShares.contract.FilterLogs(opts, "TokenDeployed", tokenIdRule, tokenRule) if err != nil { return nil, err } return &AgentSharesTokenDeployedIterator{contract: _AgentShares.contract, event: "TokenDeployed", logs: logs, sub: sub}, nil } // WatchTokenDeployed is a free log subscription operation binding the contract event 0xb0886d5b89c3540effacb4587a5c495172ace26a507fef96fb8ccb8376ae9df5. // // Solidity: event TokenDeployed(uint256 indexed tokenId, address indexed token) func (_AgentShares *AgentSharesFilterer) WatchTokenDeployed(opts *bind.WatchOpts, sink chan<- *AgentSharesTokenDeployed, tokenId []*big.Int, token []common.Address) (event.Subscription, error) { var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } var tokenRule []interface{} for _, tokenItem := range token { tokenRule = append(tokenRule, tokenItem) } logs, sub, err := _AgentShares.contract.WatchLogs(opts, "TokenDeployed", tokenIdRule, tokenRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(AgentSharesTokenDeployed) if err := _AgentShares.contract.UnpackLog(event, "TokenDeployed", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseTokenDeployed is a log parse operation binding the contract event 0xb0886d5b89c3540effacb4587a5c495172ace26a507fef96fb8ccb8376ae9df5. // // Solidity: event TokenDeployed(uint256 indexed tokenId, address indexed token) func (_AgentShares *AgentSharesFilterer) ParseTokenDeployed(log types.Log) (*AgentSharesTokenDeployed, error) { event := new(AgentSharesTokenDeployed) if err := _AgentShares.contract.UnpackLog(event, "TokenDeployed", log); err != nil { return nil, err } event.Raw = log return event, nil } // AgentSharesTradeIterator is returned from FilterTrade and is used to iterate over the raw logs and unpacked data for Trade events raised by the AgentShares contract. type AgentSharesTradeIterator struct { Event *AgentSharesTrade // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *AgentSharesTradeIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(AgentSharesTrade) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(AgentSharesTrade) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *AgentSharesTradeIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *AgentSharesTradeIterator) Close() error { it.sub.Unsubscribe() return nil } // AgentSharesTrade represents a Trade event raised by the AgentShares contract. type AgentSharesTrade struct { Trader common.Address TokenId *big.Int IsBuy bool ShareAmount *big.Int EthAmount *big.Int ProtocolAmount *big.Int Supply *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterTrade is a free log retrieval operation binding the contract event 0x12d0646903287d48eb117ac55a8bcc90d4357c4180221d5b33e83e73860440ec. // // Solidity: event Trade(address trader, uint256 tokenId, bool isBuy, uint256 shareAmount, uint256 ethAmount, uint256 protocolAmount, uint256 supply) func (_AgentShares *AgentSharesFilterer) FilterTrade(opts *bind.FilterOpts) (*AgentSharesTradeIterator, error) { logs, sub, err := _AgentShares.contract.FilterLogs(opts, "Trade") if err != nil { return nil, err } return &AgentSharesTradeIterator{contract: _AgentShares.contract, event: "Trade", logs: logs, sub: sub}, nil } // WatchTrade is a free log subscription operation binding the contract event 0x12d0646903287d48eb117ac55a8bcc90d4357c4180221d5b33e83e73860440ec. // // Solidity: event Trade(address trader, uint256 tokenId, bool isBuy, uint256 shareAmount, uint256 ethAmount, uint256 protocolAmount, uint256 supply) func (_AgentShares *AgentSharesFilterer) WatchTrade(opts *bind.WatchOpts, sink chan<- *AgentSharesTrade) (event.Subscription, error) { logs, sub, err := _AgentShares.contract.WatchLogs(opts, "Trade") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(AgentSharesTrade) if err := _AgentShares.contract.UnpackLog(event, "Trade", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseTrade is a log parse operation binding the contract event 0x12d0646903287d48eb117ac55a8bcc90d4357c4180221d5b33e83e73860440ec. // // Solidity: event Trade(address trader, uint256 tokenId, bool isBuy, uint256 shareAmount, uint256 ethAmount, uint256 protocolAmount, uint256 supply) func (_AgentShares *AgentSharesFilterer) ParseTrade(log types.Log) (*AgentSharesTrade, error) { event := new(AgentSharesTrade) if err := _AgentShares.contract.UnpackLog(event, "Trade", log); err != nil { return nil, err } event.Raw = log return event, nil } // AgentSharesTransferBatchIterator is returned from FilterTransferBatch and is used to iterate over the raw logs and unpacked data for TransferBatch events raised by the AgentShares contract. type AgentSharesTransferBatchIterator struct { Event *AgentSharesTransferBatch // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *AgentSharesTransferBatchIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(AgentSharesTransferBatch) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(AgentSharesTransferBatch) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *AgentSharesTransferBatchIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *AgentSharesTransferBatchIterator) Close() error { it.sub.Unsubscribe() return nil } // AgentSharesTransferBatch represents a TransferBatch event raised by the AgentShares contract. type AgentSharesTransferBatch struct { Operator common.Address From common.Address To common.Address Ids []*big.Int Values []*big.Int Raw types.Log // Blockchain specific contextual infos } // FilterTransferBatch is a free log retrieval operation binding the contract event 0x4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb. // // Solidity: event TransferBatch(address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] values) func (_AgentShares *AgentSharesFilterer) FilterTransferBatch(opts *bind.FilterOpts, operator []common.Address, from []common.Address, to []common.Address) (*AgentSharesTransferBatchIterator, error) { var operatorRule []interface{} for _, operatorItem := range operator { operatorRule = append(operatorRule, operatorItem) } var fromRule []interface{} for _, fromItem := range from { fromRule = append(fromRule, fromItem) } var toRule []interface{} for _, toItem := range to { toRule = append(toRule, toItem) } logs, sub, err := _AgentShares.contract.FilterLogs(opts, "TransferBatch", operatorRule, fromRule, toRule) if err != nil { return nil, err } return &AgentSharesTransferBatchIterator{contract: _AgentShares.contract, event: "TransferBatch", logs: logs, sub: sub}, nil } // WatchTransferBatch is a free log subscription operation binding the contract event 0x4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb. // // Solidity: event TransferBatch(address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] values) func (_AgentShares *AgentSharesFilterer) WatchTransferBatch(opts *bind.WatchOpts, sink chan<- *AgentSharesTransferBatch, operator []common.Address, from []common.Address, to []common.Address) (event.Subscription, error) { var operatorRule []interface{} for _, operatorItem := range operator { operatorRule = append(operatorRule, operatorItem) } var fromRule []interface{} for _, fromItem := range from { fromRule = append(fromRule, fromItem) } var toRule []interface{} for _, toItem := range to { toRule = append(toRule, toItem) } logs, sub, err := _AgentShares.contract.WatchLogs(opts, "TransferBatch", operatorRule, fromRule, toRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(AgentSharesTransferBatch) if err := _AgentShares.contract.UnpackLog(event, "TransferBatch", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseTransferBatch is a log parse operation binding the contract event 0x4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb. // // Solidity: event TransferBatch(address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] values) func (_AgentShares *AgentSharesFilterer) ParseTransferBatch(log types.Log) (*AgentSharesTransferBatch, error) { event := new(AgentSharesTransferBatch) if err := _AgentShares.contract.UnpackLog(event, "TransferBatch", log); err != nil { return nil, err } event.Raw = log return event, nil } // AgentSharesTransferSingleIterator is returned from FilterTransferSingle and is used to iterate over the raw logs and unpacked data for TransferSingle events raised by the AgentShares contract. type AgentSharesTransferSingleIterator struct { Event *AgentSharesTransferSingle // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *AgentSharesTransferSingleIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(AgentSharesTransferSingle) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(AgentSharesTransferSingle) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *AgentSharesTransferSingleIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *AgentSharesTransferSingleIterator) Close() error { it.sub.Unsubscribe() return nil } // AgentSharesTransferSingle represents a TransferSingle event raised by the AgentShares contract. type AgentSharesTransferSingle struct { Operator common.Address From common.Address To common.Address Id *big.Int Value *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterTransferSingle is a free log retrieval operation binding the contract event 0xc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62. // // Solidity: event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value) func (_AgentShares *AgentSharesFilterer) FilterTransferSingle(opts *bind.FilterOpts, operator []common.Address, from []common.Address, to []common.Address) (*AgentSharesTransferSingleIterator, error) { var operatorRule []interface{} for _, operatorItem := range operator { operatorRule = append(operatorRule, operatorItem) } var fromRule []interface{} for _, fromItem := range from { fromRule = append(fromRule, fromItem) } var toRule []interface{} for _, toItem := range to { toRule = append(toRule, toItem) } logs, sub, err := _AgentShares.contract.FilterLogs(opts, "TransferSingle", operatorRule, fromRule, toRule) if err != nil { return nil, err } return &AgentSharesTransferSingleIterator{contract: _AgentShares.contract, event: "TransferSingle", logs: logs, sub: sub}, nil } // WatchTransferSingle is a free log subscription operation binding the contract event 0xc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62. // // Solidity: event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value) func (_AgentShares *AgentSharesFilterer) WatchTransferSingle(opts *bind.WatchOpts, sink chan<- *AgentSharesTransferSingle, operator []common.Address, from []common.Address, to []common.Address) (event.Subscription, error) { var operatorRule []interface{} for _, operatorItem := range operator { operatorRule = append(operatorRule, operatorItem) } var fromRule []interface{} for _, fromItem := range from { fromRule = append(fromRule, fromItem) } var toRule []interface{} for _, toItem := range to { toRule = append(toRule, toItem) } logs, sub, err := _AgentShares.contract.WatchLogs(opts, "TransferSingle", operatorRule, fromRule, toRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(AgentSharesTransferSingle) if err := _AgentShares.contract.UnpackLog(event, "TransferSingle", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseTransferSingle is a log parse operation binding the contract event 0xc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62. // // Solidity: event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value) func (_AgentShares *AgentSharesFilterer) ParseTransferSingle(log types.Log) (*AgentSharesTransferSingle, error) { event := new(AgentSharesTransferSingle) if err := _AgentShares.contract.UnpackLog(event, "TransferSingle", log); err != nil { return nil, err } event.Raw = log return event, nil } // AgentSharesURIIterator is returned from FilterURI and is used to iterate over the raw logs and unpacked data for URI events raised by the AgentShares contract. type AgentSharesURIIterator struct { Event *AgentSharesURI // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *AgentSharesURIIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(AgentSharesURI) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(AgentSharesURI) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *AgentSharesURIIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *AgentSharesURIIterator) Close() error { it.sub.Unsubscribe() return nil } // AgentSharesURI represents a URI event raised by the AgentShares contract. type AgentSharesURI struct { Value string Id *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterURI is a free log retrieval operation binding the contract event 0x6bb7ff708619ba0610cba295a58592e0451dee2622938c8755667688daf3529b. // // Solidity: event URI(string value, uint256 indexed id) func (_AgentShares *AgentSharesFilterer) FilterURI(opts *bind.FilterOpts, id []*big.Int) (*AgentSharesURIIterator, error) { var idRule []interface{} for _, idItem := range id { idRule = append(idRule, idItem) } logs, sub, err := _AgentShares.contract.FilterLogs(opts, "URI", idRule) if err != nil { return nil, err } return &AgentSharesURIIterator{contract: _AgentShares.contract, event: "URI", logs: logs, sub: sub}, nil } // WatchURI is a free log subscription operation binding the contract event 0x6bb7ff708619ba0610cba295a58592e0451dee2622938c8755667688daf3529b. // // Solidity: event URI(string value, uint256 indexed id) func (_AgentShares *AgentSharesFilterer) WatchURI(opts *bind.WatchOpts, sink chan<- *AgentSharesURI, id []*big.Int) (event.Subscription, error) { var idRule []interface{} for _, idItem := range id { idRule = append(idRule, idItem) } logs, sub, err := _AgentShares.contract.WatchLogs(opts, "URI", idRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(AgentSharesURI) if err := _AgentShares.contract.UnpackLog(event, "URI", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseURI is a log parse operation binding the contract event 0x6bb7ff708619ba0610cba295a58592e0451dee2622938c8755667688daf3529b. // // Solidity: event URI(string value, uint256 indexed id) func (_AgentShares *AgentSharesFilterer) ParseURI(log types.Log) (*AgentSharesURI, error) { event := new(AgentSharesURI) if err := _AgentShares.contract.UnpackLog(event, "URI", log); err != nil { return nil, err } event.Raw = log return event, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/binds/agentshares/abi.json ================================================ [ { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "account", "type": "address" }, { "indexed": true, "internalType": "address", "name": "operator", "type": "address" }, { "indexed": false, "internalType": "bool", "name": "approved", "type": "bool" } ], "name": "ApprovalForAll", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "uint8", "name": "version", "type": "uint8" } ], "name": "Initialized", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "previousOwner", "type": "address" }, { "indexed": true, "internalType": "address", "name": "newOwner", "type": "address" } ], "name": "OwnershipTransferred", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "indexed": true, "internalType": "address", "name": "token", "type": "address" }, { "indexed": true, "internalType": "address", "name": "user", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" } ], "name": "TokenClaimed", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "indexed": true, "internalType": "address", "name": "token", "type": "address" } ], "name": "TokenDeployed", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "address", "name": "trader", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "indexed": false, "internalType": "bool", "name": "isBuy", "type": "bool" }, { "indexed": false, "internalType": "uint256", "name": "shareAmount", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "ethAmount", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "protocolAmount", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "supply", "type": "uint256" } ], "name": "Trade", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "operator", "type": "address" }, { "indexed": true, "internalType": "address", "name": "from", "type": "address" }, { "indexed": true, "internalType": "address", "name": "to", "type": "address" }, { "indexed": false, "internalType": "uint256[]", "name": "ids", "type": "uint256[]" }, { "indexed": false, "internalType": "uint256[]", "name": "values", "type": "uint256[]" } ], "name": "TransferBatch", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "operator", "type": "address" }, { "indexed": true, "internalType": "address", "name": "from", "type": "address" }, { "indexed": true, "internalType": "address", "name": "to", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "id", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "value", "type": "uint256" } ], "name": "TransferSingle", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "string", "name": "value", "type": "string" }, { "indexed": true, "internalType": "uint256", "name": "id", "type": "uint256" } ], "name": "URI", "type": "event" }, { "inputs": [ { "internalType": "address", "name": "account", "type": "address" }, { "internalType": "uint256", "name": "id", "type": "uint256" } ], "name": "balanceOf", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address[]", "name": "accounts", "type": "address[]" }, { "internalType": "uint256[]", "name": "ids", "type": "uint256[]" } ], "name": "balanceOfBatch", "outputs": [ { "internalType": "uint256[]", "name": "", "type": "uint256[]" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "baseToken", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "internalType": "uint256", "name": "amount", "type": "uint256" }, { "internalType": "uint256", "name": "supplyMax", "type": "uint256" } ], "name": "buyShares", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "internalType": "address", "name": "user", "type": "address" } ], "name": "claimToken", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "internalType": "string", "name": "name", "type": "string" }, { "internalType": "string", "name": "symbol", "type": "string" } ], "name": "deployToken", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "internalType": "uint256", "name": "amount", "type": "uint256" } ], "name": "getBuyPrice", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "internalType": "uint256", "name": "amount", "type": "uint256" } ], "name": "getBuyPriceAfterFee", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "getChainId", "outputs": [ { "internalType": "uint256", "name": "chainId", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "supply", "type": "uint256" }, { "internalType": "uint256", "name": "amount", "type": "uint256" } ], "name": "getPrice", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "pure", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "internalType": "uint256", "name": "amount", "type": "uint256" } ], "name": "getSellPrice", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "internalType": "uint256", "name": "amount", "type": "uint256" } ], "name": "getSellPriceAfterFee", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "_baseToken", "type": "address" } ], "name": "initialize", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "account", "type": "address" }, { "internalType": "address", "name": "operator", "type": "address" } ], "name": "isApprovedForAll", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "bytes[]", "name": "data", "type": "bytes[]" } ], "name": "multicall", "outputs": [ { "internalType": "bytes[]", "name": "results", "type": "bytes[]" } ], "stateMutability": "payable", "type": "function" }, { "inputs": [], "name": "owner", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "protocolAdmin", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "protocolFeeDestination", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "protocolFeePercent", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "renounceOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "from", "type": "address" }, { "internalType": "address", "name": "to", "type": "address" }, { "internalType": "uint256[]", "name": "ids", "type": "uint256[]" }, { "internalType": "uint256[]", "name": "amounts", "type": "uint256[]" }, { "internalType": "bytes", "name": "data", "type": "bytes" } ], "name": "safeBatchTransferFrom", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "from", "type": "address" }, { "internalType": "address", "name": "to", "type": "address" }, { "internalType": "uint256", "name": "id", "type": "uint256" }, { "internalType": "uint256", "name": "amount", "type": "uint256" }, { "internalType": "bytes", "name": "data", "type": "bytes" } ], "name": "safeTransferFrom", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "internalType": "uint256", "name": "amount", "type": "uint256" }, { "internalType": "uint256", "name": "supplyMin", "type": "uint256" } ], "name": "sellShares", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "operator", "type": "address" }, { "internalType": "bool", "name": "approved", "type": "bool" } ], "name": "setApprovalForAll", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "_feeDestination", "type": "address" } ], "name": "setFeeDestination", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "_protocolAdmin", "type": "address" } ], "name": "setProtocolAdmin", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "_feePercent", "type": "uint256" } ], "name": "setProtocolFeePercent", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "bytes4", "name": "interfaceId", "type": "bytes4" } ], "name": "supportsInterface", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "tokenDeployed", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "name": "tokenSupply", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "name": "tokens", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "newOwner", "type": "address" } ], "name": "transferOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "name": "uri", "outputs": [ { "internalType": "string", "name": "", "type": "string" } ], "stateMutability": "view", "type": "function" } ] ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/binds/agenttoken/AGENTToken.go ================================================ // Code generated - DO NOT EDIT. // This file is a generated binding and any manual changes will be lost. package agenttoken import ( "errors" "math/big" "strings" ethereum "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/event" ) // Reference imports to suppress errors if they are not otherwise used. var ( _ = errors.New _ = big.NewInt _ = strings.NewReader _ = ethereum.NotFound _ = bind.Bind _ = common.Big1 _ = types.BloomLookup _ = event.NewSubscription _ = abi.ConvertType ) // ERC20VotesCheckpoint is an auto generated low-level Go binding around an user-defined struct. type ERC20VotesCheckpoint struct { FromBlock uint32 Votes *big.Int } // AGENTTokenMetaData contains all meta data concerning the AGENTToken contract. var AGENTTokenMetaData = &bind.MetaData{ ABI: "[{\"inputs\":[{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"symbol\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"InvalidShortString\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"str\",\"type\":\"string\"}],\"name\":\"StringTooLong\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"delegator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"fromDelegate\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"toDelegate\",\"type\":\"address\"}],\"name\":\"DelegateChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"delegate\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"previousBalance\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newBalance\",\"type\":\"uint256\"}],\"name\":\"DelegateVotesChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"EIP712DomainChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"CLOCK_MODE\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"DOMAIN_SEPARATOR\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"pos\",\"type\":\"uint32\"}],\"name\":\"checkpoints\",\"outputs\":[{\"components\":[{\"internalType\":\"uint32\",\"name\":\"fromBlock\",\"type\":\"uint32\"},{\"internalType\":\"uint224\",\"name\":\"votes\",\"type\":\"uint224\"}],\"internalType\":\"structERC20Votes.Checkpoint\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"clock\",\"outputs\":[{\"internalType\":\"uint48\",\"name\":\"\",\"type\":\"uint48\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"subtractedValue\",\"type\":\"uint256\"}],\"name\":\"decreaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"delegatee\",\"type\":\"address\"}],\"name\":\"delegate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"delegatee\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiry\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"delegateBySig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"delegates\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"eip712Domain\",\"outputs\":[{\"internalType\":\"bytes1\",\"name\":\"fields\",\"type\":\"bytes1\"},{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"version\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"verifyingContract\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"salt\",\"type\":\"bytes32\"},{\"internalType\":\"uint256[]\",\"name\":\"extensions\",\"type\":\"uint256[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"timepoint\",\"type\":\"uint256\"}],\"name\":\"getPastTotalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"timepoint\",\"type\":\"uint256\"}],\"name\":\"getPastVotes\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"getVotes\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"addedValue\",\"type\":\"uint256\"}],\"name\":\"increaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"nonces\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"numCheckpoints\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"permit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", Bin: "0x6101608060405234620000e1576200318f9081380380926200002182620000fc565b823960808282019212620000e15780516001600160401b039290838111620000e15781620000519184016200017a565b9261018051908111620000e1576200006a92016200017a565b6101a0516101c051916001600160a01b0383168303620000e1576200008f93620001e0565b6040516120a09081620010cf823960805181611aa8015260a05181611b63015260c05181611a72015260e05181611af701526101005181611b1d015261012051816108040152610140518161082d0152f35b600080fd5b634e487b7160e01b600052604160045260246000fd5b601f01601f1916610160908101906001600160401b038211908210176200012257604052565b620000e6565b604081019081106001600160401b038211176200012257604052565b60405190620001538262000128565b565b60005b838110620001695750506000910152565b818101518382015260200162000158565b81601f82011215620000e15780516001600160401b0392838211620001225760405193601f8301601f19908116603f0116850190811185821017620001225760405281845260208284010111620000e157620001dd916020808501910162000155565b90565b939290604051620001f18162000128565b600195868252602080830193603160f81b8552825160018060401b03811162000122576200022c816200022660035462000351565b6200038e565b8299601f8211600114620002bd57908080620002699493620001539c9d600093620002b1575b501b916000199060031b1c191617600355620004f2565b6200027482620005e5565b610120526200028383620006f5565b61014052815191012060e052519020610100524660a052620002a462000874565b6080523060c05262000946565b88015192503862000252565b60036000529299919291601f198216907fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b9160005b8181106200033b5750918391620001539c9d96946200026996941062000321575b5050811b01600355620004f2565b87015160001960f88460031b161c19169055388062000313565b87830151845592850192918d01918d01620002f2565b90600182811c9216801562000383575b60208310146200036d57565b634e487b7160e01b600052602260045260246000fd5b91607f169162000361565b601f81116200039b575050565b6000906003825260208220906020601f850160051c83019410620003dc575b601f0160051c01915b828110620003d057505050565b818155600101620003c3565b9092508290620003ba565b601f8111620003f4575050565b6000906004825260208220906020601f850160051c8301941062000435575b601f0160051c01915b8281106200042957505050565b8181556001016200041c565b909250829062000413565b601f81116200044d575050565b6000906005825260208220906020601f850160051c830194106200048e575b601f0160051c01915b8281106200048257505050565b81815560010162000475565b90925082906200046c565b601f8111620004a6575050565b6000906006825260208220906020601f850160051c83019410620004e7575b601f0160051c01915b828110620004db57505050565b818155600101620004ce565b9092508290620004c5565b80519091906001600160401b03811162000122576200051e816200051860045462000351565b620003e7565b602080601f83116001146200055d575081929360009262000551575b50508160011b916000199060031b1c191617600455565b0151905038806200053a565b6004600052601f198316949091907f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b926000905b878210620005cc575050836001959610620005b2575b505050811b01600455565b015160001960f88460031b161c19169055388080620005a7565b8060018596829496860151815501950193019062000591565b90815160208082106000146200060357505090620001dd9062000805565b6001600160401b03821162000122576200062a826200062460055462000351565b62000440565b80601f83116001146200066a57508192936000926200065e575b50508160011b916000199060031b1c19161760055560ff90565b01519050388062000644565b6005600052601f198316949091907f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db0926000905b878210620006dc575050836001959610620006c2575b505050811b0160055560ff90565b015160001960f88460031b161c19169055388080620006b4565b806001859682949686015181550195019301906200069e565b90815160208082106000146200071357505090620001dd9062000805565b6001600160401b03821162000122576200073a826200073460065462000351565b62000499565b80601f83116001146200077a57508192936000926200076e575b50508160011b916000199060031b1c19161760065560ff90565b01519050388062000754565b6006600052601f198316949091907ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f926000905b878210620007ec575050836001959610620007d2575b505050811b0160065560ff90565b015160001960f88460031b161c19169055388080620007c4565b80600185968294968601518155019501930190620007ae565b601f8151116200083357602081519101516020821062000823571790565b6000198260200360031b1b161790565b6044604051809263305a27a960e01b82526020600483015262000866815180928160248601526020868601910162000155565b601f01601f19168101030190fd5b60e051610100516040519060208201927f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f8452604083015260608201524660808201523060a082015260a0815260c0810181811060018060401b03821117620001225760405251902090565b15620008e857565b60405162461bcd60e51b815260206004820152603060248201527f4552433230566f7465733a20746f74616c20737570706c79207269736b73206f60448201526f766572666c6f77696e6720766f74657360801b6064820152608490fd5b906001600160a01b0382168015620009f057600254828101809111620009ea57620009e693620009c8926200097b8593600255565b6001600160a01b038216600090815260208181526040808320805487019055518581527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9190a362000fa4565b600254620009e0906001600160e01b031015620008e0565b62000b55565b5050565b62000a35565b60405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606490fd5b634e487b7160e01b600052601160045260246000fd5b604080519192919081016001600160401b038111828210176200012257604052602081935463ffffffff81168352811c910152565b600b54906801000000000000000082101562000122576001820180600b5582101562000aee57600b600052805160209182015190911b63ffffffff191663ffffffff91909116177f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01db990910155565b634e487b7160e01b600052603260045260246000fd5b9081546801000000000000000081101562000122576001810180845581101562000aee57600092835260209283902082519284015190931b63ffffffff191663ffffffff9290921691909117910155565b600b549091811591821562000c9d5762000b6e62000144565b60008152600060208201525b602081015162000ba79062000b9f906001600160e01b03165b6001600160e01b031690565b9586620010b2565b9315908162000c76575b501562000c0e57620001539062000bf762000bcc8562000e6c565b600b600052917f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01db80190565b9063ffffffff82549181199060201b169116179055565b506200015362000c3762000c3162000c264362000ed6565b65ffffffffffff1690565b62000f3e565b62000c7062000c468562000e6c565b62000c6062000c5462000144565b63ffffffff9094168452565b6001600160e01b03166020830152565b62000a80565b5163ffffffff16905063ffffffff62000c9362000c264362000ed6565b9116143862000bb1565b600b60005262000cd57f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01db8820162000a4b565b62000a4b565b62000b7a565b90918154918215928360001462000ddf5762000cf662000144565b60008152600060208201525b602081015162000d289062000d20906001600160e01b031662000b93565b9687620010c0565b9415908162000db8575b501562000d5f5762000bf7620001539262000d4d8662000e6c565b92600019019060005260206000200190565b50620001539062000d7862000c3162000c264362000ed6565b9062000db262000d888662000e6c565b62000da262000d9662000144565b63ffffffff9095168552565b6001600160e01b03166020840152565b62000b04565b5163ffffffff16905063ffffffff62000dd562000c264362000ed6565b9116143862000d32565b62000df962000ccf60001983018460005260206000200190565b62000d02565b90918154918215928360001462000e4c5762000e1a62000144565b60008152600060208201525b602081015162000d289062000e44906001600160e01b031662000b93565b9687620010b2565b62000e6662000ccf60001983018460005260206000200190565b62000e26565b6001600160e01b039081811162000e81571690565b60405162461bcd60e51b815260206004820152602760248201527f53616665436173743a2076616c756520646f65736e27742066697420696e20326044820152663234206269747360c81b6064820152608490fd5b65ffffffffffff9081811162000eea571690565b60405162461bcd60e51b815260206004820152602660248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203460448201526538206269747360d01b6064820152608490fd5b63ffffffff9081811162000f50571690565b60405162461bcd60e51b815260206004820152602660248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203360448201526532206269747360d01b6064820152608490fd5b60096020527fec8156718a8372b1db44bb411437d0870f3e3790d4a08526d024ce1b0b668f6b546001600160a01b039182166000908152604081205483169392909116908184141580620010a8575b62000fff575b50505050565b82908262001067575b505050816200101a575b808062000ff9565b6001600160a01b0382166000908152600a602052604090206000805160206200316f833981519152916200104e9162000dff565b60408051928352602083019190915290a2388062001012565b6000805160206200316f83398151915291604082856200108e9452600a6020522062000cdb565b60408051928352602083019190915290a238818162001008565b5082151562000ff3565b908101809111620009ea5790565b908103908111620009ea579056fe6080604052600436101561001257600080fd5b60003560e01c806306fdde03146101a7578063095ea7b3146101a257806318160ddd1461019d57806323b872dd14610198578063313ce567146101935780633644e5151461018e57806339509351146101895780633a46b1a8146101845780634bf5d7e91461017f578063587cde1e1461017a5780635c19a95c146101755780636fcfff451461017057806370a082311461016b5780637ecebe001461016657806384b0196e146101615780638e539e8c1461015c57806391ddadf41461015757806395d89b41146101525780639ab24eb01461014d578063a457c2d714610148578063a9059cbb14610143578063c3cda5201461013e578063d505accf14610139578063dd62ed3e146101345763f1127ed81461012f57600080fd5b610f2c565b610ed4565b610d8e565b610c63565b610c1d565b610b6f565b610b0d565b610a66565b610a3a565b6108e1565b6107e9565b6107af565b610775565b61072d565b610709565b6106ce565b61061c565b6104c7565b61046f565b61044c565b610430565b610365565b610347565b610316565b610200565b919082519283825260005b8481106101d8575050826000602080949584010152601f8019910116010190565b6020818301810151848301820152016101b7565b9060206101fd9281815201906101ac565b90565b346102e5576000806003193601126102e257604051908060035461022381610fb3565b808552916001918083169081156102b8575060011461025d575b6102598561024d8187038261105c565b604051918291826101ec565b0390f35b9250600383527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b5b8284106102a057505050810160200161024d8261025961023d565b80546020858701810191909152909301928101610285565b8695506102599693506020925061024d94915060ff191682840152151560051b820101929361023d565b80fd5b600080fd5b600435906001600160a01b03821682036102e557565b602435906001600160a01b03821682036102e557565b346102e55760403660031901126102e55761033c6103326102ea565b6024359033611263565b602060405160018152f35b346102e55760003660031901126102e5576020600254604051908152f35b346102e55760603660031901126102e55761037e6102ea565b610386610300565b6001600160a01b0382166000908152600160209081526040808320338452909152902060443591905492600184016103cf575b6103c39350611155565b60405160018152602090f35b8284106103eb576103e6836103c395033383611263565b6103b9565b60405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606490fd5b346102e55760003660031901126102e557602060405160128152f35b346102e55760003660031901126102e5576020610467611a6f565b604051908152f35b346102e55760403660031901126102e5576104886102ea565b3360009081526001602090815260408083206001600160a01b038516845290915290205460243581018091116104c25761033c9133611263565b61107e565b346102e55760403660031901126102e5576104e06102ea565b602435906104ff65ffffffffffff6104f743611f52565b16831061143c565b6001600160a01b03166000908152600a60205260408120805492909183600581116105cb575b50905b8382106105765750508161054f575050602060005b6040516001600160e01b039091168152f35b61056a61057191602093600019019060005260206000200190565b5460201c90565b61053d565b90926105828185611d82565b90818363ffffffff6105a861059e848960005260206000200190565b5463ffffffff1690565b1611156105b9575050925b90610528565b9094506105c69150611094565b6105b3565b806105db6105e192969396611d97565b90611488565b908263ffffffff6105fc61059e858860005260206000200190565b16111561060c5750925b38610525565b935061061790611094565b610606565b346102e55760003660031901126102e5574365ffffffffffff61063e43611f52565b16036106895761025960405161065381611003565b601d81527f6d6f64653d626c6f636b6e756d6265722666726f6d3d64656661756c740000006020820152604051918291826101ec565b60405162461bcd60e51b815260206004820152601d60248201527f4552433230566f7465733a2062726f6b656e20636c6f636b206d6f64650000006044820152606490fd5b346102e55760203660031901126102e55760206001600160a01b03806106f26102ea565b166000526009825260406000205416604051908152f35b346102e55760203660031901126102e55761072b6107256102ea565b336114e1565b005b346102e55760203660031901126102e5576001600160a01b0361074e6102ea565b16600052600a6020526020610767604060002054611fb9565b63ffffffff60405191168152f35b346102e55760203660031901126102e5576001600160a01b036107966102ea565b1660005260006020526020604060002054604051908152f35b346102e55760203660031901126102e5576001600160a01b036107d06102ea565b1660005260076020526020604060002054604051908152f35b346102e5576000806003193601126102e257610893906108287f0000000000000000000000000000000000000000000000000000000000000000611baf565b6108517f0000000000000000000000000000000000000000000000000000000000000000611ca8565b916040519161085f83611024565b818352604051948594600f60f81b865261088560209360e08589015260e08801906101ac565b9086820360408801526101ac565b904660608601523060808601528260a086015284820360c08601528080855193848152019401925b8281106108ca57505050500390f35b8351855286955093810193928101926001016108bb565b346102e55760203660031901126102e55760043561091065ffffffffffff61090843611f52565b16821061143c565b600b5490600082600581116109d3575b50905b82821061097057828061093d575060405160008152602090f35b600b600052602090610571907f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01db80161056a565b909161097c8184611d82565b600b600052908263ffffffff6109b37f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01db9850161059e565b1611156109c35750915b90610923565b92506109ce90611094565b6109bd565b806105db6109e392959395611d97565b600b600052908263ffffffff610a1a7f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01db9850161059e565b161115610a2a5750915b38610920565b9250610a3590611094565b610a24565b346102e55760003660031901126102e5576020610a5643611f52565b65ffffffffffff60405191168152f35b346102e5576000806003193601126102e2576040519080600454610a8981610fb3565b808552916001918083169081156102b85750600114610ab2576102598561024d8187038261105c565b9250600483527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b5b828410610af557505050810160200161024d8261025961023d565b80546020858701810191909152909301928101610ada565b346102e55760203660031901126102e5576001600160a01b03610b2e6102ea565b16600052600a602052604060002080548015600014610b5557505060405160008152602090f35b602091610b669160001901906113ec565b5054811c61053d565b346102e55760403660031901126102e557610b886102ea565b60243590336000526001602052610bb58160406000209060018060a01b0316600052602052604060002090565b5491808310610bca576103c392039033611263565b60405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608490fd5b346102e55760403660031901126102e55761033c610c396102ea565b6024359033611155565b6064359060ff821682036102e557565b6084359060ff821682036102e557565b346102e55760c03660031901126102e557610c7c6102ea565b60443590602435610c8b610c43565b92804211610d4957610d1b610d449161072b9560405190610d0382610cf56020820195898b8860609194939260808201957fe48329057bfd03d55e49b547132e39cffd9c1820ad7b9d4c5307691425d15adf835260018060a01b0316602083015260408201520152565b03601f19810184528361105c565b610d1660a4359360843593519020611b89565b611889565b6001600160a01b0381166000908152600760205260409020805460018101909155909214611495565b6114e1565b60405162461bcd60e51b815260206004820152601d60248201527f4552433230566f7465733a207369676e617475726520657870697265640000006044820152606490fd5b346102e55760e03660031901126102e557610da76102ea565b610daf610300565b6044359060643592610dbf610c53565b93804211610e8f57610e77610e8a91610cf561072b97610e64610dfd8760018060a01b03166000526007602052604060002090815491600183019055565b604080517f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9602082019081526001600160a01b03808c1693830193909352918b166060820152608081018c905260a081019290925260c082019590955292839060e0820190565b610d1660c4359360a43593519020611b89565b6001600160a01b03838116911614611393565b611263565b60405162461bcd60e51b815260206004820152601d60248201527f45524332305065726d69743a206578706972656420646561646c696e650000006044820152606490fd5b346102e55760403660031901126102e5576020610f23610ef26102ea565b610efa610300565b6001600160a01b0391821660009081526001855260408082209290931681526020919091522090565b54604051908152f35b346102e55760403660031901126102e557610f456102ea565b63ffffffff60243581811681036102e557610f8f610f9591604094600060208751610f6f81611003565b82815201526001600160a01b03166000908152600a6020528590206113ec565b5061141a565b8251815190921682526020908101516001600160e01b031690820152f35b90600182811c92168015610fe3575b6020831014610fcd57565b634e487b7160e01b600052602260045260246000fd5b91607f1691610fc2565b634e487b7160e01b600052604160045260246000fd5b6040810190811067ffffffffffffffff82111761101f57604052565b610fed565b6020810190811067ffffffffffffffff82111761101f57604052565b60c0810190811067ffffffffffffffff82111761101f57604052565b90601f8019910116810190811067ffffffffffffffff82111761101f57604052565b634e487b7160e01b600052601160045260246000fd5b90600182018092116104c257565b156110a957565b60405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608490fd5b1561110157565b60405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608490fd5b6001600160a01b0392919083811680156112105761120e9483169061117b8215156110a2565b6001600160a01b03831660009081526020819052604090208590546111a2828210156110fa565b036111bf8460018060a01b03166000526000602052604060002090565b556001600160a01b0384166000908152602081815260409182902080548801905590518681527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9190a361201e565b565b60405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608490fd5b6001600160a01b0380821692919083156113425782169384156112f257806112dc7f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925946112c56112ed9560018060a01b03166000526001602052604060002090565b9060018060a01b0316600052602052604060002090565b556040519081529081906020820190565b0390a3565b60405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608490fd5b60405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608490fd5b1561139a57565b60405162461bcd60e51b815260206004820152601e60248201527f45524332305065726d69743a20696e76616c6964207369676e617475726500006044820152606490fd5b6040519061120e82611003565b80548210156114045760005260206000200190600090565b634e487b7160e01b600052603260045260246000fd5b9060405161142781611003565b602081935463ffffffff81168352811c910152565b1561144357565b60405162461bcd60e51b815260206004820152601960248201527f4552433230566f7465733a20667574757265206c6f6f6b7570000000000000006044820152606490fd5b919082039182116104c257565b1561149c57565b60405162461bcd60e51b815260206004820152601960248201527f4552433230566f7465733a20696e76616c6964206e6f6e6365000000000000006044820152606490fd5b61120e9160018060a01b038092166000928184526009602052806040852054168092856020527f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f60408720549660096020526040812094871694856bffffffffffffffffffffffff60a01b82541617905580a45b6001600160a01b03808316939291168084141580611768575b611579575b50505050565b806115e7575b508261158c575b80611573565b6001600160a01b03166000908152600a602052604090207fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a724916115ce916117d0565b60408051928352602083019190915290a2388080611586565b80600052600a6020527fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a72460406000208054801591826000146117455761162b6113df565b6000815260006020820152915b6020830151611657906001600160e01b03165b6001600160e01b031690565b926116628985612050565b94159081611722575b50156116c0576116936116aa9261168186611ee9565b92600019019060005260206000200190565b9063ffffffff82549181199060201b169116179055565b604080519182526020820192909252a23861157f565b5061171d906116e46116df6116d443611f52565b65ffffffffffff1690565b611fb9565b906117186116f186611ee9565b6117086116fc6113df565b63ffffffff9095168552565b6001600160e01b03166020840152565b611771565b6116aa565b5163ffffffff16905063ffffffff61173c6116d443611f52565b9116143861166b565b61176261175d60001984018360005260206000200190565b61141a565b91611638565b5082151561156e565b80546801000000000000000081101561101f57611793916001820181556113ec565b6117ba57815160209283015190921b63ffffffff191663ffffffff92909216919091179055565b634e487b7160e01b600052600060045260246000fd5b90918154918215928360001461186c576117e86113df565b60008152600060208201525b60208101516118169061180f906001600160e01b031661164b565b968761205d565b94159081611849575b50156118355761169361120e9261168186611ee9565b5061120e906116e46116df6116d443611f52565b5163ffffffff16905063ffffffff6118636116d443611f52565b9116143861181f565b61188461175d60001983018460005260206000200190565b6117f4565b916101fd9391611898936119e0565b9190916118c0565b600511156118aa57565b634e487b7160e01b600052602160045260246000fd5b6118c9816118a0565b806118d15750565b6118da816118a0565b600181036119275760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606490fd5b611930816118a0565b6002810361197d5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606490fd5b806119896003926118a0565b1461199057565b60405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608490fd5b9291907f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311611a635791608094939160ff602094604051948552168484015260408301526060820152600093849182805260015afa15611a565781516001600160a01b03811615611a50579190565b50600190565b50604051903d90823e3d90fd5b50505050600090600390565b307f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03161480611b60575b15611aca577f000000000000000000000000000000000000000000000000000000000000000090565b60405160208101907f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f82527f000000000000000000000000000000000000000000000000000000000000000060408201527f000000000000000000000000000000000000000000000000000000000000000060608201524660808201523060a082015260a08152611b5a81611040565b51902090565b507f00000000000000000000000000000000000000000000000000000000000000004614611aa1565b604290611b94611a6f565b906040519161190160f01b8352600283015260228201522090565b60ff8114611bed5760ff811690601f8211611bdb5760405191611bd183611003565b8252602082015290565b604051632cd44ac360e21b8152600490fd5b50604051600554816000611c0083610fb3565b80835292600190818116908115611c865750600114611c27575b506101fd9250038261105c565b6005600090815291507f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db05b848310611c6b57506101fd935050810160200138611c1a565b81935090816020925483858901015201910190918492611c52565b9050602092506101fd94915060ff191682840152151560051b82010138611c1a565b60ff8114611cca5760ff811690601f8211611bdb5760405191611bd183611003565b50604051600654816000611cdd83610fb3565b80835292600190818116908115611c865750600114611d0357506101fd9250038261105c565b6006600090815291507ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f5b848310611d4757506101fd935050810160200138611c1a565b81935090816020925483858901015201910190918492611d2e565b8115611d6c570490565b634e487b7160e01b600052601260045260246000fd5b90808216911860011c81018091116104c25790565b8015611ed15780611e6a611e63611e59611e4f611e45611e3b611e31611e2760016101fd9a6000908b60801c80611ec5575b508060401c80611eb8575b508060201c80611eab575b508060101c80611e9e575b508060081c80611e91575b508060041c80611e84575b508060021c80611e77575b50821c611e70575b811c1b611e20818b611d62565b0160011c90565b611e20818a611d62565b611e208189611d62565b611e208188611d62565b611e208187611d62565b611e208186611d62565b611e208185611d62565b8092611d62565b90611ed7565b8101611e13565b6002915091019038611e0b565b6004915091019038611e00565b6008915091019038611df5565b6010915091019038611dea565b6020915091019038611ddf565b6040915091019038611dd4565b91505060809038611dc9565b50600090565b9080821015611ee4575090565b905090565b6001600160e01b0390818111611efd571690565b60405162461bcd60e51b815260206004820152602760248201527f53616665436173743a2076616c756520646f65736e27742066697420696e20326044820152663234206269747360c81b6064820152608490fd5b65ffffffffffff90818111611f65571690565b60405162461bcd60e51b815260206004820152602660248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203460448201526538206269747360d01b6064820152608490fd5b63ffffffff90818111611fca571690565b60405162461bcd60e51b815260206004820152602660248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203360448201526532206269747360d01b6064820152608490fd5b6001600160a01b0390811660009081526009602052604080822054938316825290205461120e93929082169116611555565b9081039081116104c25790565b9081018091116104c2579056fea264697066735822122060ba8d67711c98c580391cc748e210eed7786b07953a7d220b4c3d62e4f63e0b64736f6c63430008130033dec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a724", } // AGENTTokenABI is the input ABI used to generate the binding from. // Deprecated: Use AGENTTokenMetaData.ABI instead. var AGENTTokenABI = AGENTTokenMetaData.ABI // AGENTTokenBin is the compiled bytecode used for deploying new contracts. // Deprecated: Use AGENTTokenMetaData.Bin instead. var AGENTTokenBin = AGENTTokenMetaData.Bin // DeployAGENTToken deploys a new Ethereum contract, binding an instance of AGENTToken to it. func DeployAGENTToken(auth *bind.TransactOpts, backend bind.ContractBackend, name string, symbol string, amount *big.Int, recipient common.Address) (common.Address, *types.Transaction, *AGENTToken, error) { parsed, err := AGENTTokenMetaData.GetAbi() if err != nil { return common.Address{}, nil, nil, err } if parsed == nil { return common.Address{}, nil, nil, errors.New("GetABI returned nil") } address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(AGENTTokenBin), backend, name, symbol, amount, recipient) if err != nil { return common.Address{}, nil, nil, err } return address, tx, &AGENTToken{AGENTTokenCaller: AGENTTokenCaller{contract: contract}, AGENTTokenTransactor: AGENTTokenTransactor{contract: contract}, AGENTTokenFilterer: AGENTTokenFilterer{contract: contract}}, nil } // AGENTToken is an auto generated Go binding around an Ethereum contract. type AGENTToken struct { AGENTTokenCaller // Read-only binding to the contract AGENTTokenTransactor // Write-only binding to the contract AGENTTokenFilterer // Log filterer for contract events } // AGENTTokenCaller is an auto generated read-only Go binding around an Ethereum contract. type AGENTTokenCaller struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // AGENTTokenTransactor is an auto generated write-only Go binding around an Ethereum contract. type AGENTTokenTransactor struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // AGENTTokenFilterer is an auto generated log filtering Go binding around an Ethereum contract events. type AGENTTokenFilterer struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // AGENTTokenSession is an auto generated Go binding around an Ethereum contract, // with pre-set call and transact options. type AGENTTokenSession struct { Contract *AGENTToken // Generic contract binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // AGENTTokenCallerSession is an auto generated read-only Go binding around an Ethereum contract, // with pre-set call options. type AGENTTokenCallerSession struct { Contract *AGENTTokenCaller // Generic contract caller binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session } // AGENTTokenTransactorSession is an auto generated write-only Go binding around an Ethereum contract, // with pre-set transact options. type AGENTTokenTransactorSession struct { Contract *AGENTTokenTransactor // Generic contract transactor binding to set the session for TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // AGENTTokenRaw is an auto generated low-level Go binding around an Ethereum contract. type AGENTTokenRaw struct { Contract *AGENTToken // Generic contract binding to access the raw methods on } // AGENTTokenCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. type AGENTTokenCallerRaw struct { Contract *AGENTTokenCaller // Generic read-only contract binding to access the raw methods on } // AGENTTokenTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. type AGENTTokenTransactorRaw struct { Contract *AGENTTokenTransactor // Generic write-only contract binding to access the raw methods on } // NewAGENTToken creates a new instance of AGENTToken, bound to a specific deployed contract. func NewAGENTToken(address common.Address, backend bind.ContractBackend) (*AGENTToken, error) { contract, err := bindAGENTToken(address, backend, backend, backend) if err != nil { return nil, err } return &AGENTToken{AGENTTokenCaller: AGENTTokenCaller{contract: contract}, AGENTTokenTransactor: AGENTTokenTransactor{contract: contract}, AGENTTokenFilterer: AGENTTokenFilterer{contract: contract}}, nil } // NewAGENTTokenCaller creates a new read-only instance of AGENTToken, bound to a specific deployed contract. func NewAGENTTokenCaller(address common.Address, caller bind.ContractCaller) (*AGENTTokenCaller, error) { contract, err := bindAGENTToken(address, caller, nil, nil) if err != nil { return nil, err } return &AGENTTokenCaller{contract: contract}, nil } // NewAGENTTokenTransactor creates a new write-only instance of AGENTToken, bound to a specific deployed contract. func NewAGENTTokenTransactor(address common.Address, transactor bind.ContractTransactor) (*AGENTTokenTransactor, error) { contract, err := bindAGENTToken(address, nil, transactor, nil) if err != nil { return nil, err } return &AGENTTokenTransactor{contract: contract}, nil } // NewAGENTTokenFilterer creates a new log filterer instance of AGENTToken, bound to a specific deployed contract. func NewAGENTTokenFilterer(address common.Address, filterer bind.ContractFilterer) (*AGENTTokenFilterer, error) { contract, err := bindAGENTToken(address, nil, nil, filterer) if err != nil { return nil, err } return &AGENTTokenFilterer{contract: contract}, nil } // bindAGENTToken binds a generic wrapper to an already deployed contract. func bindAGENTToken(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { parsed, err := AGENTTokenMetaData.GetAbi() if err != nil { return nil, err } return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_AGENTToken *AGENTTokenRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _AGENTToken.Contract.AGENTTokenCaller.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_AGENTToken *AGENTTokenRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _AGENTToken.Contract.AGENTTokenTransactor.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_AGENTToken *AGENTTokenRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _AGENTToken.Contract.AGENTTokenTransactor.contract.Transact(opts, method, params...) } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_AGENTToken *AGENTTokenCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _AGENTToken.Contract.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_AGENTToken *AGENTTokenTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _AGENTToken.Contract.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_AGENTToken *AGENTTokenTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _AGENTToken.Contract.contract.Transact(opts, method, params...) } // CLOCKMODE is a free data retrieval call binding the contract method 0x4bf5d7e9. // // Solidity: function CLOCK_MODE() view returns(string) func (_AGENTToken *AGENTTokenCaller) CLOCKMODE(opts *bind.CallOpts) (string, error) { var out []interface{} err := _AGENTToken.contract.Call(opts, &out, "CLOCK_MODE") if err != nil { return *new(string), err } out0 := *abi.ConvertType(out[0], new(string)).(*string) return out0, err } // CLOCKMODE is a free data retrieval call binding the contract method 0x4bf5d7e9. // // Solidity: function CLOCK_MODE() view returns(string) func (_AGENTToken *AGENTTokenSession) CLOCKMODE() (string, error) { return _AGENTToken.Contract.CLOCKMODE(&_AGENTToken.CallOpts) } // CLOCKMODE is a free data retrieval call binding the contract method 0x4bf5d7e9. // // Solidity: function CLOCK_MODE() view returns(string) func (_AGENTToken *AGENTTokenCallerSession) CLOCKMODE() (string, error) { return _AGENTToken.Contract.CLOCKMODE(&_AGENTToken.CallOpts) } // DOMAINSEPARATOR is a free data retrieval call binding the contract method 0x3644e515. // // Solidity: function DOMAIN_SEPARATOR() view returns(bytes32) func (_AGENTToken *AGENTTokenCaller) DOMAINSEPARATOR(opts *bind.CallOpts) ([32]byte, error) { var out []interface{} err := _AGENTToken.contract.Call(opts, &out, "DOMAIN_SEPARATOR") if err != nil { return *new([32]byte), err } out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) return out0, err } // DOMAINSEPARATOR is a free data retrieval call binding the contract method 0x3644e515. // // Solidity: function DOMAIN_SEPARATOR() view returns(bytes32) func (_AGENTToken *AGENTTokenSession) DOMAINSEPARATOR() ([32]byte, error) { return _AGENTToken.Contract.DOMAINSEPARATOR(&_AGENTToken.CallOpts) } // DOMAINSEPARATOR is a free data retrieval call binding the contract method 0x3644e515. // // Solidity: function DOMAIN_SEPARATOR() view returns(bytes32) func (_AGENTToken *AGENTTokenCallerSession) DOMAINSEPARATOR() ([32]byte, error) { return _AGENTToken.Contract.DOMAINSEPARATOR(&_AGENTToken.CallOpts) } // Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. // // Solidity: function allowance(address owner, address spender) view returns(uint256) func (_AGENTToken *AGENTTokenCaller) Allowance(opts *bind.CallOpts, owner common.Address, spender common.Address) (*big.Int, error) { var out []interface{} err := _AGENTToken.contract.Call(opts, &out, "allowance", owner, spender) if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. // // Solidity: function allowance(address owner, address spender) view returns(uint256) func (_AGENTToken *AGENTTokenSession) Allowance(owner common.Address, spender common.Address) (*big.Int, error) { return _AGENTToken.Contract.Allowance(&_AGENTToken.CallOpts, owner, spender) } // Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. // // Solidity: function allowance(address owner, address spender) view returns(uint256) func (_AGENTToken *AGENTTokenCallerSession) Allowance(owner common.Address, spender common.Address) (*big.Int, error) { return _AGENTToken.Contract.Allowance(&_AGENTToken.CallOpts, owner, spender) } // BalanceOf is a free data retrieval call binding the contract method 0x70a08231. // // Solidity: function balanceOf(address account) view returns(uint256) func (_AGENTToken *AGENTTokenCaller) BalanceOf(opts *bind.CallOpts, account common.Address) (*big.Int, error) { var out []interface{} err := _AGENTToken.contract.Call(opts, &out, "balanceOf", account) if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // BalanceOf is a free data retrieval call binding the contract method 0x70a08231. // // Solidity: function balanceOf(address account) view returns(uint256) func (_AGENTToken *AGENTTokenSession) BalanceOf(account common.Address) (*big.Int, error) { return _AGENTToken.Contract.BalanceOf(&_AGENTToken.CallOpts, account) } // BalanceOf is a free data retrieval call binding the contract method 0x70a08231. // // Solidity: function balanceOf(address account) view returns(uint256) func (_AGENTToken *AGENTTokenCallerSession) BalanceOf(account common.Address) (*big.Int, error) { return _AGENTToken.Contract.BalanceOf(&_AGENTToken.CallOpts, account) } // Checkpoints is a free data retrieval call binding the contract method 0xf1127ed8. // // Solidity: function checkpoints(address account, uint32 pos) view returns((uint32,uint224)) func (_AGENTToken *AGENTTokenCaller) Checkpoints(opts *bind.CallOpts, account common.Address, pos uint32) (ERC20VotesCheckpoint, error) { var out []interface{} err := _AGENTToken.contract.Call(opts, &out, "checkpoints", account, pos) if err != nil { return *new(ERC20VotesCheckpoint), err } out0 := *abi.ConvertType(out[0], new(ERC20VotesCheckpoint)).(*ERC20VotesCheckpoint) return out0, err } // Checkpoints is a free data retrieval call binding the contract method 0xf1127ed8. // // Solidity: function checkpoints(address account, uint32 pos) view returns((uint32,uint224)) func (_AGENTToken *AGENTTokenSession) Checkpoints(account common.Address, pos uint32) (ERC20VotesCheckpoint, error) { return _AGENTToken.Contract.Checkpoints(&_AGENTToken.CallOpts, account, pos) } // Checkpoints is a free data retrieval call binding the contract method 0xf1127ed8. // // Solidity: function checkpoints(address account, uint32 pos) view returns((uint32,uint224)) func (_AGENTToken *AGENTTokenCallerSession) Checkpoints(account common.Address, pos uint32) (ERC20VotesCheckpoint, error) { return _AGENTToken.Contract.Checkpoints(&_AGENTToken.CallOpts, account, pos) } // Clock is a free data retrieval call binding the contract method 0x91ddadf4. // // Solidity: function clock() view returns(uint48) func (_AGENTToken *AGENTTokenCaller) Clock(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} err := _AGENTToken.contract.Call(opts, &out, "clock") if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // Clock is a free data retrieval call binding the contract method 0x91ddadf4. // // Solidity: function clock() view returns(uint48) func (_AGENTToken *AGENTTokenSession) Clock() (*big.Int, error) { return _AGENTToken.Contract.Clock(&_AGENTToken.CallOpts) } // Clock is a free data retrieval call binding the contract method 0x91ddadf4. // // Solidity: function clock() view returns(uint48) func (_AGENTToken *AGENTTokenCallerSession) Clock() (*big.Int, error) { return _AGENTToken.Contract.Clock(&_AGENTToken.CallOpts) } // Decimals is a free data retrieval call binding the contract method 0x313ce567. // // Solidity: function decimals() view returns(uint8) func (_AGENTToken *AGENTTokenCaller) Decimals(opts *bind.CallOpts) (uint8, error) { var out []interface{} err := _AGENTToken.contract.Call(opts, &out, "decimals") if err != nil { return *new(uint8), err } out0 := *abi.ConvertType(out[0], new(uint8)).(*uint8) return out0, err } // Decimals is a free data retrieval call binding the contract method 0x313ce567. // // Solidity: function decimals() view returns(uint8) func (_AGENTToken *AGENTTokenSession) Decimals() (uint8, error) { return _AGENTToken.Contract.Decimals(&_AGENTToken.CallOpts) } // Decimals is a free data retrieval call binding the contract method 0x313ce567. // // Solidity: function decimals() view returns(uint8) func (_AGENTToken *AGENTTokenCallerSession) Decimals() (uint8, error) { return _AGENTToken.Contract.Decimals(&_AGENTToken.CallOpts) } // Delegates is a free data retrieval call binding the contract method 0x587cde1e. // // Solidity: function delegates(address account) view returns(address) func (_AGENTToken *AGENTTokenCaller) Delegates(opts *bind.CallOpts, account common.Address) (common.Address, error) { var out []interface{} err := _AGENTToken.contract.Call(opts, &out, "delegates", account) if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // Delegates is a free data retrieval call binding the contract method 0x587cde1e. // // Solidity: function delegates(address account) view returns(address) func (_AGENTToken *AGENTTokenSession) Delegates(account common.Address) (common.Address, error) { return _AGENTToken.Contract.Delegates(&_AGENTToken.CallOpts, account) } // Delegates is a free data retrieval call binding the contract method 0x587cde1e. // // Solidity: function delegates(address account) view returns(address) func (_AGENTToken *AGENTTokenCallerSession) Delegates(account common.Address) (common.Address, error) { return _AGENTToken.Contract.Delegates(&_AGENTToken.CallOpts, account) } // Eip712Domain is a free data retrieval call binding the contract method 0x84b0196e. // // Solidity: function eip712Domain() view returns(bytes1 fields, string name, string version, uint256 chainId, address verifyingContract, bytes32 salt, uint256[] extensions) func (_AGENTToken *AGENTTokenCaller) Eip712Domain(opts *bind.CallOpts) (struct { Fields [1]byte Name string Version string ChainId *big.Int VerifyingContract common.Address Salt [32]byte Extensions []*big.Int }, error) { var out []interface{} err := _AGENTToken.contract.Call(opts, &out, "eip712Domain") outstruct := new(struct { Fields [1]byte Name string Version string ChainId *big.Int VerifyingContract common.Address Salt [32]byte Extensions []*big.Int }) if err != nil { return *outstruct, err } outstruct.Fields = *abi.ConvertType(out[0], new([1]byte)).(*[1]byte) outstruct.Name = *abi.ConvertType(out[1], new(string)).(*string) outstruct.Version = *abi.ConvertType(out[2], new(string)).(*string) outstruct.ChainId = *abi.ConvertType(out[3], new(*big.Int)).(**big.Int) outstruct.VerifyingContract = *abi.ConvertType(out[4], new(common.Address)).(*common.Address) outstruct.Salt = *abi.ConvertType(out[5], new([32]byte)).(*[32]byte) outstruct.Extensions = *abi.ConvertType(out[6], new([]*big.Int)).(*[]*big.Int) return *outstruct, err } // Eip712Domain is a free data retrieval call binding the contract method 0x84b0196e. // // Solidity: function eip712Domain() view returns(bytes1 fields, string name, string version, uint256 chainId, address verifyingContract, bytes32 salt, uint256[] extensions) func (_AGENTToken *AGENTTokenSession) Eip712Domain() (struct { Fields [1]byte Name string Version string ChainId *big.Int VerifyingContract common.Address Salt [32]byte Extensions []*big.Int }, error) { return _AGENTToken.Contract.Eip712Domain(&_AGENTToken.CallOpts) } // Eip712Domain is a free data retrieval call binding the contract method 0x84b0196e. // // Solidity: function eip712Domain() view returns(bytes1 fields, string name, string version, uint256 chainId, address verifyingContract, bytes32 salt, uint256[] extensions) func (_AGENTToken *AGENTTokenCallerSession) Eip712Domain() (struct { Fields [1]byte Name string Version string ChainId *big.Int VerifyingContract common.Address Salt [32]byte Extensions []*big.Int }, error) { return _AGENTToken.Contract.Eip712Domain(&_AGENTToken.CallOpts) } // GetPastTotalSupply is a free data retrieval call binding the contract method 0x8e539e8c. // // Solidity: function getPastTotalSupply(uint256 timepoint) view returns(uint256) func (_AGENTToken *AGENTTokenCaller) GetPastTotalSupply(opts *bind.CallOpts, timepoint *big.Int) (*big.Int, error) { var out []interface{} err := _AGENTToken.contract.Call(opts, &out, "getPastTotalSupply", timepoint) if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // GetPastTotalSupply is a free data retrieval call binding the contract method 0x8e539e8c. // // Solidity: function getPastTotalSupply(uint256 timepoint) view returns(uint256) func (_AGENTToken *AGENTTokenSession) GetPastTotalSupply(timepoint *big.Int) (*big.Int, error) { return _AGENTToken.Contract.GetPastTotalSupply(&_AGENTToken.CallOpts, timepoint) } // GetPastTotalSupply is a free data retrieval call binding the contract method 0x8e539e8c. // // Solidity: function getPastTotalSupply(uint256 timepoint) view returns(uint256) func (_AGENTToken *AGENTTokenCallerSession) GetPastTotalSupply(timepoint *big.Int) (*big.Int, error) { return _AGENTToken.Contract.GetPastTotalSupply(&_AGENTToken.CallOpts, timepoint) } // GetPastVotes is a free data retrieval call binding the contract method 0x3a46b1a8. // // Solidity: function getPastVotes(address account, uint256 timepoint) view returns(uint256) func (_AGENTToken *AGENTTokenCaller) GetPastVotes(opts *bind.CallOpts, account common.Address, timepoint *big.Int) (*big.Int, error) { var out []interface{} err := _AGENTToken.contract.Call(opts, &out, "getPastVotes", account, timepoint) if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // GetPastVotes is a free data retrieval call binding the contract method 0x3a46b1a8. // // Solidity: function getPastVotes(address account, uint256 timepoint) view returns(uint256) func (_AGENTToken *AGENTTokenSession) GetPastVotes(account common.Address, timepoint *big.Int) (*big.Int, error) { return _AGENTToken.Contract.GetPastVotes(&_AGENTToken.CallOpts, account, timepoint) } // GetPastVotes is a free data retrieval call binding the contract method 0x3a46b1a8. // // Solidity: function getPastVotes(address account, uint256 timepoint) view returns(uint256) func (_AGENTToken *AGENTTokenCallerSession) GetPastVotes(account common.Address, timepoint *big.Int) (*big.Int, error) { return _AGENTToken.Contract.GetPastVotes(&_AGENTToken.CallOpts, account, timepoint) } // GetVotes is a free data retrieval call binding the contract method 0x9ab24eb0. // // Solidity: function getVotes(address account) view returns(uint256) func (_AGENTToken *AGENTTokenCaller) GetVotes(opts *bind.CallOpts, account common.Address) (*big.Int, error) { var out []interface{} err := _AGENTToken.contract.Call(opts, &out, "getVotes", account) if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // GetVotes is a free data retrieval call binding the contract method 0x9ab24eb0. // // Solidity: function getVotes(address account) view returns(uint256) func (_AGENTToken *AGENTTokenSession) GetVotes(account common.Address) (*big.Int, error) { return _AGENTToken.Contract.GetVotes(&_AGENTToken.CallOpts, account) } // GetVotes is a free data retrieval call binding the contract method 0x9ab24eb0. // // Solidity: function getVotes(address account) view returns(uint256) func (_AGENTToken *AGENTTokenCallerSession) GetVotes(account common.Address) (*big.Int, error) { return _AGENTToken.Contract.GetVotes(&_AGENTToken.CallOpts, account) } // Name is a free data retrieval call binding the contract method 0x06fdde03. // // Solidity: function name() view returns(string) func (_AGENTToken *AGENTTokenCaller) Name(opts *bind.CallOpts) (string, error) { var out []interface{} err := _AGENTToken.contract.Call(opts, &out, "name") if err != nil { return *new(string), err } out0 := *abi.ConvertType(out[0], new(string)).(*string) return out0, err } // Name is a free data retrieval call binding the contract method 0x06fdde03. // // Solidity: function name() view returns(string) func (_AGENTToken *AGENTTokenSession) Name() (string, error) { return _AGENTToken.Contract.Name(&_AGENTToken.CallOpts) } // Name is a free data retrieval call binding the contract method 0x06fdde03. // // Solidity: function name() view returns(string) func (_AGENTToken *AGENTTokenCallerSession) Name() (string, error) { return _AGENTToken.Contract.Name(&_AGENTToken.CallOpts) } // Nonces is a free data retrieval call binding the contract method 0x7ecebe00. // // Solidity: function nonces(address owner) view returns(uint256) func (_AGENTToken *AGENTTokenCaller) Nonces(opts *bind.CallOpts, owner common.Address) (*big.Int, error) { var out []interface{} err := _AGENTToken.contract.Call(opts, &out, "nonces", owner) if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // Nonces is a free data retrieval call binding the contract method 0x7ecebe00. // // Solidity: function nonces(address owner) view returns(uint256) func (_AGENTToken *AGENTTokenSession) Nonces(owner common.Address) (*big.Int, error) { return _AGENTToken.Contract.Nonces(&_AGENTToken.CallOpts, owner) } // Nonces is a free data retrieval call binding the contract method 0x7ecebe00. // // Solidity: function nonces(address owner) view returns(uint256) func (_AGENTToken *AGENTTokenCallerSession) Nonces(owner common.Address) (*big.Int, error) { return _AGENTToken.Contract.Nonces(&_AGENTToken.CallOpts, owner) } // NumCheckpoints is a free data retrieval call binding the contract method 0x6fcfff45. // // Solidity: function numCheckpoints(address account) view returns(uint32) func (_AGENTToken *AGENTTokenCaller) NumCheckpoints(opts *bind.CallOpts, account common.Address) (uint32, error) { var out []interface{} err := _AGENTToken.contract.Call(opts, &out, "numCheckpoints", account) if err != nil { return *new(uint32), err } out0 := *abi.ConvertType(out[0], new(uint32)).(*uint32) return out0, err } // NumCheckpoints is a free data retrieval call binding the contract method 0x6fcfff45. // // Solidity: function numCheckpoints(address account) view returns(uint32) func (_AGENTToken *AGENTTokenSession) NumCheckpoints(account common.Address) (uint32, error) { return _AGENTToken.Contract.NumCheckpoints(&_AGENTToken.CallOpts, account) } // NumCheckpoints is a free data retrieval call binding the contract method 0x6fcfff45. // // Solidity: function numCheckpoints(address account) view returns(uint32) func (_AGENTToken *AGENTTokenCallerSession) NumCheckpoints(account common.Address) (uint32, error) { return _AGENTToken.Contract.NumCheckpoints(&_AGENTToken.CallOpts, account) } // Symbol is a free data retrieval call binding the contract method 0x95d89b41. // // Solidity: function symbol() view returns(string) func (_AGENTToken *AGENTTokenCaller) Symbol(opts *bind.CallOpts) (string, error) { var out []interface{} err := _AGENTToken.contract.Call(opts, &out, "symbol") if err != nil { return *new(string), err } out0 := *abi.ConvertType(out[0], new(string)).(*string) return out0, err } // Symbol is a free data retrieval call binding the contract method 0x95d89b41. // // Solidity: function symbol() view returns(string) func (_AGENTToken *AGENTTokenSession) Symbol() (string, error) { return _AGENTToken.Contract.Symbol(&_AGENTToken.CallOpts) } // Symbol is a free data retrieval call binding the contract method 0x95d89b41. // // Solidity: function symbol() view returns(string) func (_AGENTToken *AGENTTokenCallerSession) Symbol() (string, error) { return _AGENTToken.Contract.Symbol(&_AGENTToken.CallOpts) } // TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. // // Solidity: function totalSupply() view returns(uint256) func (_AGENTToken *AGENTTokenCaller) TotalSupply(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} err := _AGENTToken.contract.Call(opts, &out, "totalSupply") if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. // // Solidity: function totalSupply() view returns(uint256) func (_AGENTToken *AGENTTokenSession) TotalSupply() (*big.Int, error) { return _AGENTToken.Contract.TotalSupply(&_AGENTToken.CallOpts) } // TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. // // Solidity: function totalSupply() view returns(uint256) func (_AGENTToken *AGENTTokenCallerSession) TotalSupply() (*big.Int, error) { return _AGENTToken.Contract.TotalSupply(&_AGENTToken.CallOpts) } // Approve is a paid mutator transaction binding the contract method 0x095ea7b3. // // Solidity: function approve(address spender, uint256 amount) returns(bool) func (_AGENTToken *AGENTTokenTransactor) Approve(opts *bind.TransactOpts, spender common.Address, amount *big.Int) (*types.Transaction, error) { return _AGENTToken.contract.Transact(opts, "approve", spender, amount) } // Approve is a paid mutator transaction binding the contract method 0x095ea7b3. // // Solidity: function approve(address spender, uint256 amount) returns(bool) func (_AGENTToken *AGENTTokenSession) Approve(spender common.Address, amount *big.Int) (*types.Transaction, error) { return _AGENTToken.Contract.Approve(&_AGENTToken.TransactOpts, spender, amount) } // Approve is a paid mutator transaction binding the contract method 0x095ea7b3. // // Solidity: function approve(address spender, uint256 amount) returns(bool) func (_AGENTToken *AGENTTokenTransactorSession) Approve(spender common.Address, amount *big.Int) (*types.Transaction, error) { return _AGENTToken.Contract.Approve(&_AGENTToken.TransactOpts, spender, amount) } // DecreaseAllowance is a paid mutator transaction binding the contract method 0xa457c2d7. // // Solidity: function decreaseAllowance(address spender, uint256 subtractedValue) returns(bool) func (_AGENTToken *AGENTTokenTransactor) DecreaseAllowance(opts *bind.TransactOpts, spender common.Address, subtractedValue *big.Int) (*types.Transaction, error) { return _AGENTToken.contract.Transact(opts, "decreaseAllowance", spender, subtractedValue) } // DecreaseAllowance is a paid mutator transaction binding the contract method 0xa457c2d7. // // Solidity: function decreaseAllowance(address spender, uint256 subtractedValue) returns(bool) func (_AGENTToken *AGENTTokenSession) DecreaseAllowance(spender common.Address, subtractedValue *big.Int) (*types.Transaction, error) { return _AGENTToken.Contract.DecreaseAllowance(&_AGENTToken.TransactOpts, spender, subtractedValue) } // DecreaseAllowance is a paid mutator transaction binding the contract method 0xa457c2d7. // // Solidity: function decreaseAllowance(address spender, uint256 subtractedValue) returns(bool) func (_AGENTToken *AGENTTokenTransactorSession) DecreaseAllowance(spender common.Address, subtractedValue *big.Int) (*types.Transaction, error) { return _AGENTToken.Contract.DecreaseAllowance(&_AGENTToken.TransactOpts, spender, subtractedValue) } // Delegate is a paid mutator transaction binding the contract method 0x5c19a95c. // // Solidity: function delegate(address delegatee) returns() func (_AGENTToken *AGENTTokenTransactor) Delegate(opts *bind.TransactOpts, delegatee common.Address) (*types.Transaction, error) { return _AGENTToken.contract.Transact(opts, "delegate", delegatee) } // Delegate is a paid mutator transaction binding the contract method 0x5c19a95c. // // Solidity: function delegate(address delegatee) returns() func (_AGENTToken *AGENTTokenSession) Delegate(delegatee common.Address) (*types.Transaction, error) { return _AGENTToken.Contract.Delegate(&_AGENTToken.TransactOpts, delegatee) } // Delegate is a paid mutator transaction binding the contract method 0x5c19a95c. // // Solidity: function delegate(address delegatee) returns() func (_AGENTToken *AGENTTokenTransactorSession) Delegate(delegatee common.Address) (*types.Transaction, error) { return _AGENTToken.Contract.Delegate(&_AGENTToken.TransactOpts, delegatee) } // DelegateBySig is a paid mutator transaction binding the contract method 0xc3cda520. // // Solidity: function delegateBySig(address delegatee, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) returns() func (_AGENTToken *AGENTTokenTransactor) DelegateBySig(opts *bind.TransactOpts, delegatee common.Address, nonce *big.Int, expiry *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _AGENTToken.contract.Transact(opts, "delegateBySig", delegatee, nonce, expiry, v, r, s) } // DelegateBySig is a paid mutator transaction binding the contract method 0xc3cda520. // // Solidity: function delegateBySig(address delegatee, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) returns() func (_AGENTToken *AGENTTokenSession) DelegateBySig(delegatee common.Address, nonce *big.Int, expiry *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _AGENTToken.Contract.DelegateBySig(&_AGENTToken.TransactOpts, delegatee, nonce, expiry, v, r, s) } // DelegateBySig is a paid mutator transaction binding the contract method 0xc3cda520. // // Solidity: function delegateBySig(address delegatee, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) returns() func (_AGENTToken *AGENTTokenTransactorSession) DelegateBySig(delegatee common.Address, nonce *big.Int, expiry *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _AGENTToken.Contract.DelegateBySig(&_AGENTToken.TransactOpts, delegatee, nonce, expiry, v, r, s) } // IncreaseAllowance is a paid mutator transaction binding the contract method 0x39509351. // // Solidity: function increaseAllowance(address spender, uint256 addedValue) returns(bool) func (_AGENTToken *AGENTTokenTransactor) IncreaseAllowance(opts *bind.TransactOpts, spender common.Address, addedValue *big.Int) (*types.Transaction, error) { return _AGENTToken.contract.Transact(opts, "increaseAllowance", spender, addedValue) } // IncreaseAllowance is a paid mutator transaction binding the contract method 0x39509351. // // Solidity: function increaseAllowance(address spender, uint256 addedValue) returns(bool) func (_AGENTToken *AGENTTokenSession) IncreaseAllowance(spender common.Address, addedValue *big.Int) (*types.Transaction, error) { return _AGENTToken.Contract.IncreaseAllowance(&_AGENTToken.TransactOpts, spender, addedValue) } // IncreaseAllowance is a paid mutator transaction binding the contract method 0x39509351. // // Solidity: function increaseAllowance(address spender, uint256 addedValue) returns(bool) func (_AGENTToken *AGENTTokenTransactorSession) IncreaseAllowance(spender common.Address, addedValue *big.Int) (*types.Transaction, error) { return _AGENTToken.Contract.IncreaseAllowance(&_AGENTToken.TransactOpts, spender, addedValue) } // Permit is a paid mutator transaction binding the contract method 0xd505accf. // // Solidity: function permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) returns() func (_AGENTToken *AGENTTokenTransactor) Permit(opts *bind.TransactOpts, owner common.Address, spender common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _AGENTToken.contract.Transact(opts, "permit", owner, spender, value, deadline, v, r, s) } // Permit is a paid mutator transaction binding the contract method 0xd505accf. // // Solidity: function permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) returns() func (_AGENTToken *AGENTTokenSession) Permit(owner common.Address, spender common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _AGENTToken.Contract.Permit(&_AGENTToken.TransactOpts, owner, spender, value, deadline, v, r, s) } // Permit is a paid mutator transaction binding the contract method 0xd505accf. // // Solidity: function permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) returns() func (_AGENTToken *AGENTTokenTransactorSession) Permit(owner common.Address, spender common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _AGENTToken.Contract.Permit(&_AGENTToken.TransactOpts, owner, spender, value, deadline, v, r, s) } // Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. // // Solidity: function transfer(address to, uint256 amount) returns(bool) func (_AGENTToken *AGENTTokenTransactor) Transfer(opts *bind.TransactOpts, to common.Address, amount *big.Int) (*types.Transaction, error) { return _AGENTToken.contract.Transact(opts, "transfer", to, amount) } // Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. // // Solidity: function transfer(address to, uint256 amount) returns(bool) func (_AGENTToken *AGENTTokenSession) Transfer(to common.Address, amount *big.Int) (*types.Transaction, error) { return _AGENTToken.Contract.Transfer(&_AGENTToken.TransactOpts, to, amount) } // Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. // // Solidity: function transfer(address to, uint256 amount) returns(bool) func (_AGENTToken *AGENTTokenTransactorSession) Transfer(to common.Address, amount *big.Int) (*types.Transaction, error) { return _AGENTToken.Contract.Transfer(&_AGENTToken.TransactOpts, to, amount) } // TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. // // Solidity: function transferFrom(address from, address to, uint256 amount) returns(bool) func (_AGENTToken *AGENTTokenTransactor) TransferFrom(opts *bind.TransactOpts, from common.Address, to common.Address, amount *big.Int) (*types.Transaction, error) { return _AGENTToken.contract.Transact(opts, "transferFrom", from, to, amount) } // TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. // // Solidity: function transferFrom(address from, address to, uint256 amount) returns(bool) func (_AGENTToken *AGENTTokenSession) TransferFrom(from common.Address, to common.Address, amount *big.Int) (*types.Transaction, error) { return _AGENTToken.Contract.TransferFrom(&_AGENTToken.TransactOpts, from, to, amount) } // TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. // // Solidity: function transferFrom(address from, address to, uint256 amount) returns(bool) func (_AGENTToken *AGENTTokenTransactorSession) TransferFrom(from common.Address, to common.Address, amount *big.Int) (*types.Transaction, error) { return _AGENTToken.Contract.TransferFrom(&_AGENTToken.TransactOpts, from, to, amount) } // AGENTTokenApprovalIterator is returned from FilterApproval and is used to iterate over the raw logs and unpacked data for Approval events raised by the AGENTToken contract. type AGENTTokenApprovalIterator struct { Event *AGENTTokenApproval // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *AGENTTokenApprovalIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(AGENTTokenApproval) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(AGENTTokenApproval) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *AGENTTokenApprovalIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *AGENTTokenApprovalIterator) Close() error { it.sub.Unsubscribe() return nil } // AGENTTokenApproval represents a Approval event raised by the AGENTToken contract. type AGENTTokenApproval struct { Owner common.Address Spender common.Address Value *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterApproval is a free log retrieval operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. // // Solidity: event Approval(address indexed owner, address indexed spender, uint256 value) func (_AGENTToken *AGENTTokenFilterer) FilterApproval(opts *bind.FilterOpts, owner []common.Address, spender []common.Address) (*AGENTTokenApprovalIterator, error) { var ownerRule []interface{} for _, ownerItem := range owner { ownerRule = append(ownerRule, ownerItem) } var spenderRule []interface{} for _, spenderItem := range spender { spenderRule = append(spenderRule, spenderItem) } logs, sub, err := _AGENTToken.contract.FilterLogs(opts, "Approval", ownerRule, spenderRule) if err != nil { return nil, err } return &AGENTTokenApprovalIterator{contract: _AGENTToken.contract, event: "Approval", logs: logs, sub: sub}, nil } // WatchApproval is a free log subscription operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. // // Solidity: event Approval(address indexed owner, address indexed spender, uint256 value) func (_AGENTToken *AGENTTokenFilterer) WatchApproval(opts *bind.WatchOpts, sink chan<- *AGENTTokenApproval, owner []common.Address, spender []common.Address) (event.Subscription, error) { var ownerRule []interface{} for _, ownerItem := range owner { ownerRule = append(ownerRule, ownerItem) } var spenderRule []interface{} for _, spenderItem := range spender { spenderRule = append(spenderRule, spenderItem) } logs, sub, err := _AGENTToken.contract.WatchLogs(opts, "Approval", ownerRule, spenderRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(AGENTTokenApproval) if err := _AGENTToken.contract.UnpackLog(event, "Approval", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseApproval is a log parse operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. // // Solidity: event Approval(address indexed owner, address indexed spender, uint256 value) func (_AGENTToken *AGENTTokenFilterer) ParseApproval(log types.Log) (*AGENTTokenApproval, error) { event := new(AGENTTokenApproval) if err := _AGENTToken.contract.UnpackLog(event, "Approval", log); err != nil { return nil, err } event.Raw = log return event, nil } // AGENTTokenDelegateChangedIterator is returned from FilterDelegateChanged and is used to iterate over the raw logs and unpacked data for DelegateChanged events raised by the AGENTToken contract. type AGENTTokenDelegateChangedIterator struct { Event *AGENTTokenDelegateChanged // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *AGENTTokenDelegateChangedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(AGENTTokenDelegateChanged) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(AGENTTokenDelegateChanged) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *AGENTTokenDelegateChangedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *AGENTTokenDelegateChangedIterator) Close() error { it.sub.Unsubscribe() return nil } // AGENTTokenDelegateChanged represents a DelegateChanged event raised by the AGENTToken contract. type AGENTTokenDelegateChanged struct { Delegator common.Address FromDelegate common.Address ToDelegate common.Address Raw types.Log // Blockchain specific contextual infos } // FilterDelegateChanged is a free log retrieval operation binding the contract event 0x3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f. // // Solidity: event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate) func (_AGENTToken *AGENTTokenFilterer) FilterDelegateChanged(opts *bind.FilterOpts, delegator []common.Address, fromDelegate []common.Address, toDelegate []common.Address) (*AGENTTokenDelegateChangedIterator, error) { var delegatorRule []interface{} for _, delegatorItem := range delegator { delegatorRule = append(delegatorRule, delegatorItem) } var fromDelegateRule []interface{} for _, fromDelegateItem := range fromDelegate { fromDelegateRule = append(fromDelegateRule, fromDelegateItem) } var toDelegateRule []interface{} for _, toDelegateItem := range toDelegate { toDelegateRule = append(toDelegateRule, toDelegateItem) } logs, sub, err := _AGENTToken.contract.FilterLogs(opts, "DelegateChanged", delegatorRule, fromDelegateRule, toDelegateRule) if err != nil { return nil, err } return &AGENTTokenDelegateChangedIterator{contract: _AGENTToken.contract, event: "DelegateChanged", logs: logs, sub: sub}, nil } // WatchDelegateChanged is a free log subscription operation binding the contract event 0x3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f. // // Solidity: event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate) func (_AGENTToken *AGENTTokenFilterer) WatchDelegateChanged(opts *bind.WatchOpts, sink chan<- *AGENTTokenDelegateChanged, delegator []common.Address, fromDelegate []common.Address, toDelegate []common.Address) (event.Subscription, error) { var delegatorRule []interface{} for _, delegatorItem := range delegator { delegatorRule = append(delegatorRule, delegatorItem) } var fromDelegateRule []interface{} for _, fromDelegateItem := range fromDelegate { fromDelegateRule = append(fromDelegateRule, fromDelegateItem) } var toDelegateRule []interface{} for _, toDelegateItem := range toDelegate { toDelegateRule = append(toDelegateRule, toDelegateItem) } logs, sub, err := _AGENTToken.contract.WatchLogs(opts, "DelegateChanged", delegatorRule, fromDelegateRule, toDelegateRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(AGENTTokenDelegateChanged) if err := _AGENTToken.contract.UnpackLog(event, "DelegateChanged", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseDelegateChanged is a log parse operation binding the contract event 0x3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f. // // Solidity: event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate) func (_AGENTToken *AGENTTokenFilterer) ParseDelegateChanged(log types.Log) (*AGENTTokenDelegateChanged, error) { event := new(AGENTTokenDelegateChanged) if err := _AGENTToken.contract.UnpackLog(event, "DelegateChanged", log); err != nil { return nil, err } event.Raw = log return event, nil } // AGENTTokenDelegateVotesChangedIterator is returned from FilterDelegateVotesChanged and is used to iterate over the raw logs and unpacked data for DelegateVotesChanged events raised by the AGENTToken contract. type AGENTTokenDelegateVotesChangedIterator struct { Event *AGENTTokenDelegateVotesChanged // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *AGENTTokenDelegateVotesChangedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(AGENTTokenDelegateVotesChanged) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(AGENTTokenDelegateVotesChanged) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *AGENTTokenDelegateVotesChangedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *AGENTTokenDelegateVotesChangedIterator) Close() error { it.sub.Unsubscribe() return nil } // AGENTTokenDelegateVotesChanged represents a DelegateVotesChanged event raised by the AGENTToken contract. type AGENTTokenDelegateVotesChanged struct { Delegate common.Address PreviousBalance *big.Int NewBalance *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterDelegateVotesChanged is a free log retrieval operation binding the contract event 0xdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a724. // // Solidity: event DelegateVotesChanged(address indexed delegate, uint256 previousBalance, uint256 newBalance) func (_AGENTToken *AGENTTokenFilterer) FilterDelegateVotesChanged(opts *bind.FilterOpts, delegate []common.Address) (*AGENTTokenDelegateVotesChangedIterator, error) { var delegateRule []interface{} for _, delegateItem := range delegate { delegateRule = append(delegateRule, delegateItem) } logs, sub, err := _AGENTToken.contract.FilterLogs(opts, "DelegateVotesChanged", delegateRule) if err != nil { return nil, err } return &AGENTTokenDelegateVotesChangedIterator{contract: _AGENTToken.contract, event: "DelegateVotesChanged", logs: logs, sub: sub}, nil } // WatchDelegateVotesChanged is a free log subscription operation binding the contract event 0xdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a724. // // Solidity: event DelegateVotesChanged(address indexed delegate, uint256 previousBalance, uint256 newBalance) func (_AGENTToken *AGENTTokenFilterer) WatchDelegateVotesChanged(opts *bind.WatchOpts, sink chan<- *AGENTTokenDelegateVotesChanged, delegate []common.Address) (event.Subscription, error) { var delegateRule []interface{} for _, delegateItem := range delegate { delegateRule = append(delegateRule, delegateItem) } logs, sub, err := _AGENTToken.contract.WatchLogs(opts, "DelegateVotesChanged", delegateRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(AGENTTokenDelegateVotesChanged) if err := _AGENTToken.contract.UnpackLog(event, "DelegateVotesChanged", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseDelegateVotesChanged is a log parse operation binding the contract event 0xdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a724. // // Solidity: event DelegateVotesChanged(address indexed delegate, uint256 previousBalance, uint256 newBalance) func (_AGENTToken *AGENTTokenFilterer) ParseDelegateVotesChanged(log types.Log) (*AGENTTokenDelegateVotesChanged, error) { event := new(AGENTTokenDelegateVotesChanged) if err := _AGENTToken.contract.UnpackLog(event, "DelegateVotesChanged", log); err != nil { return nil, err } event.Raw = log return event, nil } // AGENTTokenEIP712DomainChangedIterator is returned from FilterEIP712DomainChanged and is used to iterate over the raw logs and unpacked data for EIP712DomainChanged events raised by the AGENTToken contract. type AGENTTokenEIP712DomainChangedIterator struct { Event *AGENTTokenEIP712DomainChanged // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *AGENTTokenEIP712DomainChangedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(AGENTTokenEIP712DomainChanged) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(AGENTTokenEIP712DomainChanged) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *AGENTTokenEIP712DomainChangedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *AGENTTokenEIP712DomainChangedIterator) Close() error { it.sub.Unsubscribe() return nil } // AGENTTokenEIP712DomainChanged represents a EIP712DomainChanged event raised by the AGENTToken contract. type AGENTTokenEIP712DomainChanged struct { Raw types.Log // Blockchain specific contextual infos } // FilterEIP712DomainChanged is a free log retrieval operation binding the contract event 0x0a6387c9ea3628b88a633bb4f3b151770f70085117a15f9bf3787cda53f13d31. // // Solidity: event EIP712DomainChanged() func (_AGENTToken *AGENTTokenFilterer) FilterEIP712DomainChanged(opts *bind.FilterOpts) (*AGENTTokenEIP712DomainChangedIterator, error) { logs, sub, err := _AGENTToken.contract.FilterLogs(opts, "EIP712DomainChanged") if err != nil { return nil, err } return &AGENTTokenEIP712DomainChangedIterator{contract: _AGENTToken.contract, event: "EIP712DomainChanged", logs: logs, sub: sub}, nil } // WatchEIP712DomainChanged is a free log subscription operation binding the contract event 0x0a6387c9ea3628b88a633bb4f3b151770f70085117a15f9bf3787cda53f13d31. // // Solidity: event EIP712DomainChanged() func (_AGENTToken *AGENTTokenFilterer) WatchEIP712DomainChanged(opts *bind.WatchOpts, sink chan<- *AGENTTokenEIP712DomainChanged) (event.Subscription, error) { logs, sub, err := _AGENTToken.contract.WatchLogs(opts, "EIP712DomainChanged") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(AGENTTokenEIP712DomainChanged) if err := _AGENTToken.contract.UnpackLog(event, "EIP712DomainChanged", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseEIP712DomainChanged is a log parse operation binding the contract event 0x0a6387c9ea3628b88a633bb4f3b151770f70085117a15f9bf3787cda53f13d31. // // Solidity: event EIP712DomainChanged() func (_AGENTToken *AGENTTokenFilterer) ParseEIP712DomainChanged(log types.Log) (*AGENTTokenEIP712DomainChanged, error) { event := new(AGENTTokenEIP712DomainChanged) if err := _AGENTToken.contract.UnpackLog(event, "EIP712DomainChanged", log); err != nil { return nil, err } event.Raw = log return event, nil } // AGENTTokenTransferIterator is returned from FilterTransfer and is used to iterate over the raw logs and unpacked data for Transfer events raised by the AGENTToken contract. type AGENTTokenTransferIterator struct { Event *AGENTTokenTransfer // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *AGENTTokenTransferIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(AGENTTokenTransfer) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(AGENTTokenTransfer) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *AGENTTokenTransferIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *AGENTTokenTransferIterator) Close() error { it.sub.Unsubscribe() return nil } // AGENTTokenTransfer represents a Transfer event raised by the AGENTToken contract. type AGENTTokenTransfer struct { From common.Address To common.Address Value *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterTransfer is a free log retrieval operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. // // Solidity: event Transfer(address indexed from, address indexed to, uint256 value) func (_AGENTToken *AGENTTokenFilterer) FilterTransfer(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*AGENTTokenTransferIterator, error) { var fromRule []interface{} for _, fromItem := range from { fromRule = append(fromRule, fromItem) } var toRule []interface{} for _, toItem := range to { toRule = append(toRule, toItem) } logs, sub, err := _AGENTToken.contract.FilterLogs(opts, "Transfer", fromRule, toRule) if err != nil { return nil, err } return &AGENTTokenTransferIterator{contract: _AGENTToken.contract, event: "Transfer", logs: logs, sub: sub}, nil } // WatchTransfer is a free log subscription operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. // // Solidity: event Transfer(address indexed from, address indexed to, uint256 value) func (_AGENTToken *AGENTTokenFilterer) WatchTransfer(opts *bind.WatchOpts, sink chan<- *AGENTTokenTransfer, from []common.Address, to []common.Address) (event.Subscription, error) { var fromRule []interface{} for _, fromItem := range from { fromRule = append(fromRule, fromItem) } var toRule []interface{} for _, toItem := range to { toRule = append(toRule, toItem) } logs, sub, err := _AGENTToken.contract.WatchLogs(opts, "Transfer", fromRule, toRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(AGENTTokenTransfer) if err := _AGENTToken.contract.UnpackLog(event, "Transfer", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseTransfer is a log parse operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. // // Solidity: event Transfer(address indexed from, address indexed to, uint256 value) func (_AGENTToken *AGENTTokenFilterer) ParseTransfer(log types.Log) (*AGENTTokenTransfer, error) { event := new(AGENTTokenTransfer) if err := _AGENTToken.contract.UnpackLog(event, "Transfer", log); err != nil { return nil, err } event.Raw = log return event, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/binds/agentupgradeable/AgentUpgradeable.go ================================================ // Code generated - DO NOT EDIT. // This file is a generated binding and any manual changes will be lost. package agentupgradeable import ( "errors" "math/big" "strings" ethereum "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/event" ) // Reference imports to suppress errors if they are not otherwise used. var ( _ = errors.New _ = big.NewInt _ = strings.NewReader _ = ethereum.NotFound _ = bind.Bind _ = common.Big1 _ = types.BloomLookup _ = event.NewSubscription _ = abi.ConvertType ) // IAgentCodePointer is an auto generated low-level Go binding around an user-defined struct. type IAgentCodePointer struct { RetrieveAddress common.Address FileType uint8 FileName string } // AgentUpgradeableMetaData contains all meta data concerning the AgentUpgradeable contract. var AgentUpgradeableMetaData = &bind.MetaData{ ABI: "[{\"inputs\":[],\"name\":\"DigestAlreadyUsed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidData\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidVersion\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Unauthenticated\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddress\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"version\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"pIndex\",\"type\":\"uint256\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"retrieveAddress\",\"type\":\"address\"},{\"internalType\":\"enumIAgent.FileType\",\"name\":\"fileType\",\"type\":\"uint8\"},{\"internalType\":\"string\",\"name\":\"fileName\",\"type\":\"string\"}],\"indexed\":false,\"internalType\":\"structIAgent.CodePointer\",\"name\":\"newPointer\",\"type\":\"tuple\"}],\"name\":\"CodePointerCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"EIP712DomainChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"eip712Domain\",\"outputs\":[{\"internalType\":\"bytes1\",\"name\":\"fields\",\"type\":\"bytes1\"},{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"version\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"verifyingContract\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"salt\",\"type\":\"bytes32\"},{\"internalType\":\"uint256[]\",\"name\":\"extensions\",\"type\":\"uint256[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"}],\"name\":\"getAddressByENS\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"version\",\"type\":\"uint16\"}],\"name\":\"getAgentCode\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"code\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAgentName\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAgentOwner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getCodeLanguage\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getCurrentVersion\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"version\",\"type\":\"uint16\"}],\"name\":\"getDepsAgents\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"retrieveAddress\",\"type\":\"address\"},{\"internalType\":\"enumIAgent.FileType\",\"name\":\"fileType\",\"type\":\"uint8\"},{\"internalType\":\"string\",\"name\":\"fileName\",\"type\":\"string\"}],\"internalType\":\"structIAgent.CodePointer[]\",\"name\":\"pointers\",\"type\":\"tuple[]\"},{\"internalType\":\"address[]\",\"name\":\"depsAgents\",\"type\":\"address[]\"}],\"name\":\"getHashToSign\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"agentName\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"agentVersion\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"codeLanguage\",\"type\":\"string\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"retrieveAddress\",\"type\":\"address\"},{\"internalType\":\"enumIAgent.FileType\",\"name\":\"fileType\",\"type\":\"uint8\"},{\"internalType\":\"string\",\"name\":\"fileName\",\"type\":\"string\"}],\"internalType\":\"structIAgent.CodePointer[]\",\"name\":\"pointers\",\"type\":\"tuple[]\"},{\"internalType\":\"address[]\",\"name\":\"depsAgents\",\"type\":\"address[]\"},{\"internalType\":\"address\",\"name\":\"agentOwner\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"nameService\",\"type\":\"bytes\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"retrieveAddress\",\"type\":\"address\"},{\"internalType\":\"enumIAgent.FileType\",\"name\":\"fileType\",\"type\":\"uint8\"},{\"internalType\":\"string\",\"name\":\"fileName\",\"type\":\"string\"}],\"internalType\":\"structIAgent.CodePointer[]\",\"name\":\"pointers\",\"type\":\"tuple[]\"},{\"internalType\":\"address[]\",\"name\":\"depsAgents\",\"type\":\"address[]\"}],\"name\":\"publishAgentCode\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"retrieveAddress\",\"type\":\"address\"},{\"internalType\":\"enumIAgent.FileType\",\"name\":\"fileType\",\"type\":\"uint8\"},{\"internalType\":\"string\",\"name\":\"fileName\",\"type\":\"string\"}],\"internalType\":\"structIAgent.CodePointer[]\",\"name\":\"pointers\",\"type\":\"tuple[]\"},{\"internalType\":\"address[]\",\"name\":\"depsAgents\",\"type\":\"address[]\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"name\":\"publishAgentCodeWithSignature\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"registrar\",\"outputs\":[{\"internalType\":\"contractIBASERegistrarController\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"duration\",\"type\":\"uint256\"}],\"name\":\"renew\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"resolver\",\"outputs\":[{\"internalType\":\"contractIResolver\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", } // AgentUpgradeableABI is the input ABI used to generate the binding from. // Deprecated: Use AgentUpgradeableMetaData.ABI instead. var AgentUpgradeableABI = AgentUpgradeableMetaData.ABI // AgentUpgradeable is an auto generated Go binding around an Ethereum contract. type AgentUpgradeable struct { AgentUpgradeableCaller // Read-only binding to the contract AgentUpgradeableTransactor // Write-only binding to the contract AgentUpgradeableFilterer // Log filterer for contract events } // AgentUpgradeableCaller is an auto generated read-only Go binding around an Ethereum contract. type AgentUpgradeableCaller struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // AgentUpgradeableTransactor is an auto generated write-only Go binding around an Ethereum contract. type AgentUpgradeableTransactor struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // AgentUpgradeableFilterer is an auto generated log filtering Go binding around an Ethereum contract events. type AgentUpgradeableFilterer struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // AgentUpgradeableSession is an auto generated Go binding around an Ethereum contract, // with pre-set call and transact options. type AgentUpgradeableSession struct { Contract *AgentUpgradeable // Generic contract binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // AgentUpgradeableCallerSession is an auto generated read-only Go binding around an Ethereum contract, // with pre-set call options. type AgentUpgradeableCallerSession struct { Contract *AgentUpgradeableCaller // Generic contract caller binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session } // AgentUpgradeableTransactorSession is an auto generated write-only Go binding around an Ethereum contract, // with pre-set transact options. type AgentUpgradeableTransactorSession struct { Contract *AgentUpgradeableTransactor // Generic contract transactor binding to set the session for TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // AgentUpgradeableRaw is an auto generated low-level Go binding around an Ethereum contract. type AgentUpgradeableRaw struct { Contract *AgentUpgradeable // Generic contract binding to access the raw methods on } // AgentUpgradeableCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. type AgentUpgradeableCallerRaw struct { Contract *AgentUpgradeableCaller // Generic read-only contract binding to access the raw methods on } // AgentUpgradeableTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. type AgentUpgradeableTransactorRaw struct { Contract *AgentUpgradeableTransactor // Generic write-only contract binding to access the raw methods on } // NewAgentUpgradeable creates a new instance of AgentUpgradeable, bound to a specific deployed contract. func NewAgentUpgradeable(address common.Address, backend bind.ContractBackend) (*AgentUpgradeable, error) { contract, err := bindAgentUpgradeable(address, backend, backend, backend) if err != nil { return nil, err } return &AgentUpgradeable{AgentUpgradeableCaller: AgentUpgradeableCaller{contract: contract}, AgentUpgradeableTransactor: AgentUpgradeableTransactor{contract: contract}, AgentUpgradeableFilterer: AgentUpgradeableFilterer{contract: contract}}, nil } // NewAgentUpgradeableCaller creates a new read-only instance of AgentUpgradeable, bound to a specific deployed contract. func NewAgentUpgradeableCaller(address common.Address, caller bind.ContractCaller) (*AgentUpgradeableCaller, error) { contract, err := bindAgentUpgradeable(address, caller, nil, nil) if err != nil { return nil, err } return &AgentUpgradeableCaller{contract: contract}, nil } // NewAgentUpgradeableTransactor creates a new write-only instance of AgentUpgradeable, bound to a specific deployed contract. func NewAgentUpgradeableTransactor(address common.Address, transactor bind.ContractTransactor) (*AgentUpgradeableTransactor, error) { contract, err := bindAgentUpgradeable(address, nil, transactor, nil) if err != nil { return nil, err } return &AgentUpgradeableTransactor{contract: contract}, nil } // NewAgentUpgradeableFilterer creates a new log filterer instance of AgentUpgradeable, bound to a specific deployed contract. func NewAgentUpgradeableFilterer(address common.Address, filterer bind.ContractFilterer) (*AgentUpgradeableFilterer, error) { contract, err := bindAgentUpgradeable(address, nil, nil, filterer) if err != nil { return nil, err } return &AgentUpgradeableFilterer{contract: contract}, nil } // bindAgentUpgradeable binds a generic wrapper to an already deployed contract. func bindAgentUpgradeable(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { parsed, err := AgentUpgradeableMetaData.GetAbi() if err != nil { return nil, err } return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_AgentUpgradeable *AgentUpgradeableRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _AgentUpgradeable.Contract.AgentUpgradeableCaller.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_AgentUpgradeable *AgentUpgradeableRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _AgentUpgradeable.Contract.AgentUpgradeableTransactor.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_AgentUpgradeable *AgentUpgradeableRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _AgentUpgradeable.Contract.AgentUpgradeableTransactor.contract.Transact(opts, method, params...) } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_AgentUpgradeable *AgentUpgradeableCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _AgentUpgradeable.Contract.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_AgentUpgradeable *AgentUpgradeableTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _AgentUpgradeable.Contract.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_AgentUpgradeable *AgentUpgradeableTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _AgentUpgradeable.Contract.contract.Transact(opts, method, params...) } // Eip712Domain is a free data retrieval call binding the contract method 0x84b0196e. // // Solidity: function eip712Domain() view returns(bytes1 fields, string name, string version, uint256 chainId, address verifyingContract, bytes32 salt, uint256[] extensions) func (_AgentUpgradeable *AgentUpgradeableCaller) Eip712Domain(opts *bind.CallOpts) (struct { Fields [1]byte Name string Version string ChainId *big.Int VerifyingContract common.Address Salt [32]byte Extensions []*big.Int }, error) { var out []interface{} err := _AgentUpgradeable.contract.Call(opts, &out, "eip712Domain") outstruct := new(struct { Fields [1]byte Name string Version string ChainId *big.Int VerifyingContract common.Address Salt [32]byte Extensions []*big.Int }) if err != nil { return *outstruct, err } outstruct.Fields = *abi.ConvertType(out[0], new([1]byte)).(*[1]byte) outstruct.Name = *abi.ConvertType(out[1], new(string)).(*string) outstruct.Version = *abi.ConvertType(out[2], new(string)).(*string) outstruct.ChainId = *abi.ConvertType(out[3], new(*big.Int)).(**big.Int) outstruct.VerifyingContract = *abi.ConvertType(out[4], new(common.Address)).(*common.Address) outstruct.Salt = *abi.ConvertType(out[5], new([32]byte)).(*[32]byte) outstruct.Extensions = *abi.ConvertType(out[6], new([]*big.Int)).(*[]*big.Int) return *outstruct, err } // Eip712Domain is a free data retrieval call binding the contract method 0x84b0196e. // // Solidity: function eip712Domain() view returns(bytes1 fields, string name, string version, uint256 chainId, address verifyingContract, bytes32 salt, uint256[] extensions) func (_AgentUpgradeable *AgentUpgradeableSession) Eip712Domain() (struct { Fields [1]byte Name string Version string ChainId *big.Int VerifyingContract common.Address Salt [32]byte Extensions []*big.Int }, error) { return _AgentUpgradeable.Contract.Eip712Domain(&_AgentUpgradeable.CallOpts) } // Eip712Domain is a free data retrieval call binding the contract method 0x84b0196e. // // Solidity: function eip712Domain() view returns(bytes1 fields, string name, string version, uint256 chainId, address verifyingContract, bytes32 salt, uint256[] extensions) func (_AgentUpgradeable *AgentUpgradeableCallerSession) Eip712Domain() (struct { Fields [1]byte Name string Version string ChainId *big.Int VerifyingContract common.Address Salt [32]byte Extensions []*big.Int }, error) { return _AgentUpgradeable.Contract.Eip712Domain(&_AgentUpgradeable.CallOpts) } // GetAddressByENS is a free data retrieval call binding the contract method 0x306d41b7. // // Solidity: function getAddressByENS(string name) view returns(address) func (_AgentUpgradeable *AgentUpgradeableCaller) GetAddressByENS(opts *bind.CallOpts, name string) (common.Address, error) { var out []interface{} err := _AgentUpgradeable.contract.Call(opts, &out, "getAddressByENS", name) if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // GetAddressByENS is a free data retrieval call binding the contract method 0x306d41b7. // // Solidity: function getAddressByENS(string name) view returns(address) func (_AgentUpgradeable *AgentUpgradeableSession) GetAddressByENS(name string) (common.Address, error) { return _AgentUpgradeable.Contract.GetAddressByENS(&_AgentUpgradeable.CallOpts, name) } // GetAddressByENS is a free data retrieval call binding the contract method 0x306d41b7. // // Solidity: function getAddressByENS(string name) view returns(address) func (_AgentUpgradeable *AgentUpgradeableCallerSession) GetAddressByENS(name string) (common.Address, error) { return _AgentUpgradeable.Contract.GetAddressByENS(&_AgentUpgradeable.CallOpts, name) } // GetAgentCode is a free data retrieval call binding the contract method 0xc1f3dd3c. // // Solidity: function getAgentCode(uint16 version) view returns(string code) func (_AgentUpgradeable *AgentUpgradeableCaller) GetAgentCode(opts *bind.CallOpts, version uint16) (string, error) { var out []interface{} err := _AgentUpgradeable.contract.Call(opts, &out, "getAgentCode", version) if err != nil { return *new(string), err } out0 := *abi.ConvertType(out[0], new(string)).(*string) return out0, err } // GetAgentCode is a free data retrieval call binding the contract method 0xc1f3dd3c. // // Solidity: function getAgentCode(uint16 version) view returns(string code) func (_AgentUpgradeable *AgentUpgradeableSession) GetAgentCode(version uint16) (string, error) { return _AgentUpgradeable.Contract.GetAgentCode(&_AgentUpgradeable.CallOpts, version) } // GetAgentCode is a free data retrieval call binding the contract method 0xc1f3dd3c. // // Solidity: function getAgentCode(uint16 version) view returns(string code) func (_AgentUpgradeable *AgentUpgradeableCallerSession) GetAgentCode(version uint16) (string, error) { return _AgentUpgradeable.Contract.GetAgentCode(&_AgentUpgradeable.CallOpts, version) } // GetAgentName is a free data retrieval call binding the contract method 0x27c3d2bb. // // Solidity: function getAgentName() view returns(string) func (_AgentUpgradeable *AgentUpgradeableCaller) GetAgentName(opts *bind.CallOpts) (string, error) { var out []interface{} err := _AgentUpgradeable.contract.Call(opts, &out, "getAgentName") if err != nil { return *new(string), err } out0 := *abi.ConvertType(out[0], new(string)).(*string) return out0, err } // GetAgentName is a free data retrieval call binding the contract method 0x27c3d2bb. // // Solidity: function getAgentName() view returns(string) func (_AgentUpgradeable *AgentUpgradeableSession) GetAgentName() (string, error) { return _AgentUpgradeable.Contract.GetAgentName(&_AgentUpgradeable.CallOpts) } // GetAgentName is a free data retrieval call binding the contract method 0x27c3d2bb. // // Solidity: function getAgentName() view returns(string) func (_AgentUpgradeable *AgentUpgradeableCallerSession) GetAgentName() (string, error) { return _AgentUpgradeable.Contract.GetAgentName(&_AgentUpgradeable.CallOpts) } // GetAgentOwner is a free data retrieval call binding the contract method 0x3cce96ec. // // Solidity: function getAgentOwner() view returns(address) func (_AgentUpgradeable *AgentUpgradeableCaller) GetAgentOwner(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _AgentUpgradeable.contract.Call(opts, &out, "getAgentOwner") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // GetAgentOwner is a free data retrieval call binding the contract method 0x3cce96ec. // // Solidity: function getAgentOwner() view returns(address) func (_AgentUpgradeable *AgentUpgradeableSession) GetAgentOwner() (common.Address, error) { return _AgentUpgradeable.Contract.GetAgentOwner(&_AgentUpgradeable.CallOpts) } // GetAgentOwner is a free data retrieval call binding the contract method 0x3cce96ec. // // Solidity: function getAgentOwner() view returns(address) func (_AgentUpgradeable *AgentUpgradeableCallerSession) GetAgentOwner() (common.Address, error) { return _AgentUpgradeable.Contract.GetAgentOwner(&_AgentUpgradeable.CallOpts) } // GetCodeLanguage is a free data retrieval call binding the contract method 0x6681792d. // // Solidity: function getCodeLanguage() view returns(string) func (_AgentUpgradeable *AgentUpgradeableCaller) GetCodeLanguage(opts *bind.CallOpts) (string, error) { var out []interface{} err := _AgentUpgradeable.contract.Call(opts, &out, "getCodeLanguage") if err != nil { return *new(string), err } out0 := *abi.ConvertType(out[0], new(string)).(*string) return out0, err } // GetCodeLanguage is a free data retrieval call binding the contract method 0x6681792d. // // Solidity: function getCodeLanguage() view returns(string) func (_AgentUpgradeable *AgentUpgradeableSession) GetCodeLanguage() (string, error) { return _AgentUpgradeable.Contract.GetCodeLanguage(&_AgentUpgradeable.CallOpts) } // GetCodeLanguage is a free data retrieval call binding the contract method 0x6681792d. // // Solidity: function getCodeLanguage() view returns(string) func (_AgentUpgradeable *AgentUpgradeableCallerSession) GetCodeLanguage() (string, error) { return _AgentUpgradeable.Contract.GetCodeLanguage(&_AgentUpgradeable.CallOpts) } // GetCurrentVersion is a free data retrieval call binding the contract method 0xfabec44a. // // Solidity: function getCurrentVersion() view returns(uint16) func (_AgentUpgradeable *AgentUpgradeableCaller) GetCurrentVersion(opts *bind.CallOpts) (uint16, error) { var out []interface{} err := _AgentUpgradeable.contract.Call(opts, &out, "getCurrentVersion") if err != nil { return *new(uint16), err } out0 := *abi.ConvertType(out[0], new(uint16)).(*uint16) return out0, err } // GetCurrentVersion is a free data retrieval call binding the contract method 0xfabec44a. // // Solidity: function getCurrentVersion() view returns(uint16) func (_AgentUpgradeable *AgentUpgradeableSession) GetCurrentVersion() (uint16, error) { return _AgentUpgradeable.Contract.GetCurrentVersion(&_AgentUpgradeable.CallOpts) } // GetCurrentVersion is a free data retrieval call binding the contract method 0xfabec44a. // // Solidity: function getCurrentVersion() view returns(uint16) func (_AgentUpgradeable *AgentUpgradeableCallerSession) GetCurrentVersion() (uint16, error) { return _AgentUpgradeable.Contract.GetCurrentVersion(&_AgentUpgradeable.CallOpts) } // GetDepsAgents is a free data retrieval call binding the contract method 0xfa0d4179. // // Solidity: function getDepsAgents(uint16 version) view returns(address[]) func (_AgentUpgradeable *AgentUpgradeableCaller) GetDepsAgents(opts *bind.CallOpts, version uint16) ([]common.Address, error) { var out []interface{} err := _AgentUpgradeable.contract.Call(opts, &out, "getDepsAgents", version) if err != nil { return *new([]common.Address), err } out0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) return out0, err } // GetDepsAgents is a free data retrieval call binding the contract method 0xfa0d4179. // // Solidity: function getDepsAgents(uint16 version) view returns(address[]) func (_AgentUpgradeable *AgentUpgradeableSession) GetDepsAgents(version uint16) ([]common.Address, error) { return _AgentUpgradeable.Contract.GetDepsAgents(&_AgentUpgradeable.CallOpts, version) } // GetDepsAgents is a free data retrieval call binding the contract method 0xfa0d4179. // // Solidity: function getDepsAgents(uint16 version) view returns(address[]) func (_AgentUpgradeable *AgentUpgradeableCallerSession) GetDepsAgents(version uint16) ([]common.Address, error) { return _AgentUpgradeable.Contract.GetDepsAgents(&_AgentUpgradeable.CallOpts, version) } // GetHashToSign is a free data retrieval call binding the contract method 0x69d07dc2. // // Solidity: function getHashToSign((address,uint8,string)[] pointers, address[] depsAgents) view returns(bytes32) func (_AgentUpgradeable *AgentUpgradeableCaller) GetHashToSign(opts *bind.CallOpts, pointers []IAgentCodePointer, depsAgents []common.Address) ([32]byte, error) { var out []interface{} err := _AgentUpgradeable.contract.Call(opts, &out, "getHashToSign", pointers, depsAgents) if err != nil { return *new([32]byte), err } out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) return out0, err } // GetHashToSign is a free data retrieval call binding the contract method 0x69d07dc2. // // Solidity: function getHashToSign((address,uint8,string)[] pointers, address[] depsAgents) view returns(bytes32) func (_AgentUpgradeable *AgentUpgradeableSession) GetHashToSign(pointers []IAgentCodePointer, depsAgents []common.Address) ([32]byte, error) { return _AgentUpgradeable.Contract.GetHashToSign(&_AgentUpgradeable.CallOpts, pointers, depsAgents) } // GetHashToSign is a free data retrieval call binding the contract method 0x69d07dc2. // // Solidity: function getHashToSign((address,uint8,string)[] pointers, address[] depsAgents) view returns(bytes32) func (_AgentUpgradeable *AgentUpgradeableCallerSession) GetHashToSign(pointers []IAgentCodePointer, depsAgents []common.Address) ([32]byte, error) { return _AgentUpgradeable.Contract.GetHashToSign(&_AgentUpgradeable.CallOpts, pointers, depsAgents) } // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. // // Solidity: function owner() view returns(address) func (_AgentUpgradeable *AgentUpgradeableCaller) Owner(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _AgentUpgradeable.contract.Call(opts, &out, "owner") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. // // Solidity: function owner() view returns(address) func (_AgentUpgradeable *AgentUpgradeableSession) Owner() (common.Address, error) { return _AgentUpgradeable.Contract.Owner(&_AgentUpgradeable.CallOpts) } // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. // // Solidity: function owner() view returns(address) func (_AgentUpgradeable *AgentUpgradeableCallerSession) Owner() (common.Address, error) { return _AgentUpgradeable.Contract.Owner(&_AgentUpgradeable.CallOpts) } // Registrar is a free data retrieval call binding the contract method 0x2b20e397. // // Solidity: function registrar() view returns(address) func (_AgentUpgradeable *AgentUpgradeableCaller) Registrar(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _AgentUpgradeable.contract.Call(opts, &out, "registrar") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // Registrar is a free data retrieval call binding the contract method 0x2b20e397. // // Solidity: function registrar() view returns(address) func (_AgentUpgradeable *AgentUpgradeableSession) Registrar() (common.Address, error) { return _AgentUpgradeable.Contract.Registrar(&_AgentUpgradeable.CallOpts) } // Registrar is a free data retrieval call binding the contract method 0x2b20e397. // // Solidity: function registrar() view returns(address) func (_AgentUpgradeable *AgentUpgradeableCallerSession) Registrar() (common.Address, error) { return _AgentUpgradeable.Contract.Registrar(&_AgentUpgradeable.CallOpts) } // Resolver is a free data retrieval call binding the contract method 0x04f3bcec. // // Solidity: function resolver() view returns(address) func (_AgentUpgradeable *AgentUpgradeableCaller) Resolver(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _AgentUpgradeable.contract.Call(opts, &out, "resolver") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // Resolver is a free data retrieval call binding the contract method 0x04f3bcec. // // Solidity: function resolver() view returns(address) func (_AgentUpgradeable *AgentUpgradeableSession) Resolver() (common.Address, error) { return _AgentUpgradeable.Contract.Resolver(&_AgentUpgradeable.CallOpts) } // Resolver is a free data retrieval call binding the contract method 0x04f3bcec. // // Solidity: function resolver() view returns(address) func (_AgentUpgradeable *AgentUpgradeableCallerSession) Resolver() (common.Address, error) { return _AgentUpgradeable.Contract.Resolver(&_AgentUpgradeable.CallOpts) } // Initialize is a paid mutator transaction binding the contract method 0xcd4a6cbf. // // Solidity: function initialize(string agentName, string agentVersion, string codeLanguage, (address,uint8,string)[] pointers, address[] depsAgents, address agentOwner, bytes nameService) payable returns() func (_AgentUpgradeable *AgentUpgradeableTransactor) Initialize(opts *bind.TransactOpts, agentName string, agentVersion string, codeLanguage string, pointers []IAgentCodePointer, depsAgents []common.Address, agentOwner common.Address, nameService []byte) (*types.Transaction, error) { return _AgentUpgradeable.contract.Transact(opts, "initialize", agentName, agentVersion, codeLanguage, pointers, depsAgents, agentOwner, nameService) } // Initialize is a paid mutator transaction binding the contract method 0xcd4a6cbf. // // Solidity: function initialize(string agentName, string agentVersion, string codeLanguage, (address,uint8,string)[] pointers, address[] depsAgents, address agentOwner, bytes nameService) payable returns() func (_AgentUpgradeable *AgentUpgradeableSession) Initialize(agentName string, agentVersion string, codeLanguage string, pointers []IAgentCodePointer, depsAgents []common.Address, agentOwner common.Address, nameService []byte) (*types.Transaction, error) { return _AgentUpgradeable.Contract.Initialize(&_AgentUpgradeable.TransactOpts, agentName, agentVersion, codeLanguage, pointers, depsAgents, agentOwner, nameService) } // Initialize is a paid mutator transaction binding the contract method 0xcd4a6cbf. // // Solidity: function initialize(string agentName, string agentVersion, string codeLanguage, (address,uint8,string)[] pointers, address[] depsAgents, address agentOwner, bytes nameService) payable returns() func (_AgentUpgradeable *AgentUpgradeableTransactorSession) Initialize(agentName string, agentVersion string, codeLanguage string, pointers []IAgentCodePointer, depsAgents []common.Address, agentOwner common.Address, nameService []byte) (*types.Transaction, error) { return _AgentUpgradeable.Contract.Initialize(&_AgentUpgradeable.TransactOpts, agentName, agentVersion, codeLanguage, pointers, depsAgents, agentOwner, nameService) } // PublishAgentCode is a paid mutator transaction binding the contract method 0x89ffd55c. // // Solidity: function publishAgentCode((address,uint8,string)[] pointers, address[] depsAgents) returns(uint16) func (_AgentUpgradeable *AgentUpgradeableTransactor) PublishAgentCode(opts *bind.TransactOpts, pointers []IAgentCodePointer, depsAgents []common.Address) (*types.Transaction, error) { return _AgentUpgradeable.contract.Transact(opts, "publishAgentCode", pointers, depsAgents) } // PublishAgentCode is a paid mutator transaction binding the contract method 0x89ffd55c. // // Solidity: function publishAgentCode((address,uint8,string)[] pointers, address[] depsAgents) returns(uint16) func (_AgentUpgradeable *AgentUpgradeableSession) PublishAgentCode(pointers []IAgentCodePointer, depsAgents []common.Address) (*types.Transaction, error) { return _AgentUpgradeable.Contract.PublishAgentCode(&_AgentUpgradeable.TransactOpts, pointers, depsAgents) } // PublishAgentCode is a paid mutator transaction binding the contract method 0x89ffd55c. // // Solidity: function publishAgentCode((address,uint8,string)[] pointers, address[] depsAgents) returns(uint16) func (_AgentUpgradeable *AgentUpgradeableTransactorSession) PublishAgentCode(pointers []IAgentCodePointer, depsAgents []common.Address) (*types.Transaction, error) { return _AgentUpgradeable.Contract.PublishAgentCode(&_AgentUpgradeable.TransactOpts, pointers, depsAgents) } // PublishAgentCodeWithSignature is a paid mutator transaction binding the contract method 0x6c6ca629. // // Solidity: function publishAgentCodeWithSignature((address,uint8,string)[] pointers, address[] depsAgents, bytes signature) returns(uint16) func (_AgentUpgradeable *AgentUpgradeableTransactor) PublishAgentCodeWithSignature(opts *bind.TransactOpts, pointers []IAgentCodePointer, depsAgents []common.Address, signature []byte) (*types.Transaction, error) { return _AgentUpgradeable.contract.Transact(opts, "publishAgentCodeWithSignature", pointers, depsAgents, signature) } // PublishAgentCodeWithSignature is a paid mutator transaction binding the contract method 0x6c6ca629. // // Solidity: function publishAgentCodeWithSignature((address,uint8,string)[] pointers, address[] depsAgents, bytes signature) returns(uint16) func (_AgentUpgradeable *AgentUpgradeableSession) PublishAgentCodeWithSignature(pointers []IAgentCodePointer, depsAgents []common.Address, signature []byte) (*types.Transaction, error) { return _AgentUpgradeable.Contract.PublishAgentCodeWithSignature(&_AgentUpgradeable.TransactOpts, pointers, depsAgents, signature) } // PublishAgentCodeWithSignature is a paid mutator transaction binding the contract method 0x6c6ca629. // // Solidity: function publishAgentCodeWithSignature((address,uint8,string)[] pointers, address[] depsAgents, bytes signature) returns(uint16) func (_AgentUpgradeable *AgentUpgradeableTransactorSession) PublishAgentCodeWithSignature(pointers []IAgentCodePointer, depsAgents []common.Address, signature []byte) (*types.Transaction, error) { return _AgentUpgradeable.Contract.PublishAgentCodeWithSignature(&_AgentUpgradeable.TransactOpts, pointers, depsAgents, signature) } // Renew is a paid mutator transaction binding the contract method 0xacf1a841. // // Solidity: function renew(string name, uint256 duration) payable returns() func (_AgentUpgradeable *AgentUpgradeableTransactor) Renew(opts *bind.TransactOpts, name string, duration *big.Int) (*types.Transaction, error) { return _AgentUpgradeable.contract.Transact(opts, "renew", name, duration) } // Renew is a paid mutator transaction binding the contract method 0xacf1a841. // // Solidity: function renew(string name, uint256 duration) payable returns() func (_AgentUpgradeable *AgentUpgradeableSession) Renew(name string, duration *big.Int) (*types.Transaction, error) { return _AgentUpgradeable.Contract.Renew(&_AgentUpgradeable.TransactOpts, name, duration) } // Renew is a paid mutator transaction binding the contract method 0xacf1a841. // // Solidity: function renew(string name, uint256 duration) payable returns() func (_AgentUpgradeable *AgentUpgradeableTransactorSession) Renew(name string, duration *big.Int) (*types.Transaction, error) { return _AgentUpgradeable.Contract.Renew(&_AgentUpgradeable.TransactOpts, name, duration) } // RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. // // Solidity: function renounceOwnership() returns() func (_AgentUpgradeable *AgentUpgradeableTransactor) RenounceOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { return _AgentUpgradeable.contract.Transact(opts, "renounceOwnership") } // RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. // // Solidity: function renounceOwnership() returns() func (_AgentUpgradeable *AgentUpgradeableSession) RenounceOwnership() (*types.Transaction, error) { return _AgentUpgradeable.Contract.RenounceOwnership(&_AgentUpgradeable.TransactOpts) } // RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. // // Solidity: function renounceOwnership() returns() func (_AgentUpgradeable *AgentUpgradeableTransactorSession) RenounceOwnership() (*types.Transaction, error) { return _AgentUpgradeable.Contract.RenounceOwnership(&_AgentUpgradeable.TransactOpts) } // TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. // // Solidity: function transferOwnership(address newOwner) returns() func (_AgentUpgradeable *AgentUpgradeableTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) { return _AgentUpgradeable.contract.Transact(opts, "transferOwnership", newOwner) } // TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. // // Solidity: function transferOwnership(address newOwner) returns() func (_AgentUpgradeable *AgentUpgradeableSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { return _AgentUpgradeable.Contract.TransferOwnership(&_AgentUpgradeable.TransactOpts, newOwner) } // TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. // // Solidity: function transferOwnership(address newOwner) returns() func (_AgentUpgradeable *AgentUpgradeableTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { return _AgentUpgradeable.Contract.TransferOwnership(&_AgentUpgradeable.TransactOpts, newOwner) } // AgentUpgradeableCodePointerCreatedIterator is returned from FilterCodePointerCreated and is used to iterate over the raw logs and unpacked data for CodePointerCreated events raised by the AgentUpgradeable contract. type AgentUpgradeableCodePointerCreatedIterator struct { Event *AgentUpgradeableCodePointerCreated // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *AgentUpgradeableCodePointerCreatedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(AgentUpgradeableCodePointerCreated) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(AgentUpgradeableCodePointerCreated) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *AgentUpgradeableCodePointerCreatedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *AgentUpgradeableCodePointerCreatedIterator) Close() error { it.sub.Unsubscribe() return nil } // AgentUpgradeableCodePointerCreated represents a CodePointerCreated event raised by the AgentUpgradeable contract. type AgentUpgradeableCodePointerCreated struct { Version *big.Int PIndex *big.Int NewPointer IAgentCodePointer Raw types.Log // Blockchain specific contextual infos } // FilterCodePointerCreated is a free log retrieval operation binding the contract event 0x0c69de805f518c322126e1fa81f2e91d814412a2ad304638fcaed200bd7f43dc. // // Solidity: event CodePointerCreated(uint256 indexed version, uint256 indexed pIndex, (address,uint8,string) newPointer) func (_AgentUpgradeable *AgentUpgradeableFilterer) FilterCodePointerCreated(opts *bind.FilterOpts, version []*big.Int, pIndex []*big.Int) (*AgentUpgradeableCodePointerCreatedIterator, error) { var versionRule []interface{} for _, versionItem := range version { versionRule = append(versionRule, versionItem) } var pIndexRule []interface{} for _, pIndexItem := range pIndex { pIndexRule = append(pIndexRule, pIndexItem) } logs, sub, err := _AgentUpgradeable.contract.FilterLogs(opts, "CodePointerCreated", versionRule, pIndexRule) if err != nil { return nil, err } return &AgentUpgradeableCodePointerCreatedIterator{contract: _AgentUpgradeable.contract, event: "CodePointerCreated", logs: logs, sub: sub}, nil } // WatchCodePointerCreated is a free log subscription operation binding the contract event 0x0c69de805f518c322126e1fa81f2e91d814412a2ad304638fcaed200bd7f43dc. // // Solidity: event CodePointerCreated(uint256 indexed version, uint256 indexed pIndex, (address,uint8,string) newPointer) func (_AgentUpgradeable *AgentUpgradeableFilterer) WatchCodePointerCreated(opts *bind.WatchOpts, sink chan<- *AgentUpgradeableCodePointerCreated, version []*big.Int, pIndex []*big.Int) (event.Subscription, error) { var versionRule []interface{} for _, versionItem := range version { versionRule = append(versionRule, versionItem) } var pIndexRule []interface{} for _, pIndexItem := range pIndex { pIndexRule = append(pIndexRule, pIndexItem) } logs, sub, err := _AgentUpgradeable.contract.WatchLogs(opts, "CodePointerCreated", versionRule, pIndexRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(AgentUpgradeableCodePointerCreated) if err := _AgentUpgradeable.contract.UnpackLog(event, "CodePointerCreated", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseCodePointerCreated is a log parse operation binding the contract event 0x0c69de805f518c322126e1fa81f2e91d814412a2ad304638fcaed200bd7f43dc. // // Solidity: event CodePointerCreated(uint256 indexed version, uint256 indexed pIndex, (address,uint8,string) newPointer) func (_AgentUpgradeable *AgentUpgradeableFilterer) ParseCodePointerCreated(log types.Log) (*AgentUpgradeableCodePointerCreated, error) { event := new(AgentUpgradeableCodePointerCreated) if err := _AgentUpgradeable.contract.UnpackLog(event, "CodePointerCreated", log); err != nil { return nil, err } event.Raw = log return event, nil } // AgentUpgradeableEIP712DomainChangedIterator is returned from FilterEIP712DomainChanged and is used to iterate over the raw logs and unpacked data for EIP712DomainChanged events raised by the AgentUpgradeable contract. type AgentUpgradeableEIP712DomainChangedIterator struct { Event *AgentUpgradeableEIP712DomainChanged // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *AgentUpgradeableEIP712DomainChangedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(AgentUpgradeableEIP712DomainChanged) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(AgentUpgradeableEIP712DomainChanged) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *AgentUpgradeableEIP712DomainChangedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *AgentUpgradeableEIP712DomainChangedIterator) Close() error { it.sub.Unsubscribe() return nil } // AgentUpgradeableEIP712DomainChanged represents a EIP712DomainChanged event raised by the AgentUpgradeable contract. type AgentUpgradeableEIP712DomainChanged struct { Raw types.Log // Blockchain specific contextual infos } // FilterEIP712DomainChanged is a free log retrieval operation binding the contract event 0x0a6387c9ea3628b88a633bb4f3b151770f70085117a15f9bf3787cda53f13d31. // // Solidity: event EIP712DomainChanged() func (_AgentUpgradeable *AgentUpgradeableFilterer) FilterEIP712DomainChanged(opts *bind.FilterOpts) (*AgentUpgradeableEIP712DomainChangedIterator, error) { logs, sub, err := _AgentUpgradeable.contract.FilterLogs(opts, "EIP712DomainChanged") if err != nil { return nil, err } return &AgentUpgradeableEIP712DomainChangedIterator{contract: _AgentUpgradeable.contract, event: "EIP712DomainChanged", logs: logs, sub: sub}, nil } // WatchEIP712DomainChanged is a free log subscription operation binding the contract event 0x0a6387c9ea3628b88a633bb4f3b151770f70085117a15f9bf3787cda53f13d31. // // Solidity: event EIP712DomainChanged() func (_AgentUpgradeable *AgentUpgradeableFilterer) WatchEIP712DomainChanged(opts *bind.WatchOpts, sink chan<- *AgentUpgradeableEIP712DomainChanged) (event.Subscription, error) { logs, sub, err := _AgentUpgradeable.contract.WatchLogs(opts, "EIP712DomainChanged") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(AgentUpgradeableEIP712DomainChanged) if err := _AgentUpgradeable.contract.UnpackLog(event, "EIP712DomainChanged", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseEIP712DomainChanged is a log parse operation binding the contract event 0x0a6387c9ea3628b88a633bb4f3b151770f70085117a15f9bf3787cda53f13d31. // // Solidity: event EIP712DomainChanged() func (_AgentUpgradeable *AgentUpgradeableFilterer) ParseEIP712DomainChanged(log types.Log) (*AgentUpgradeableEIP712DomainChanged, error) { event := new(AgentUpgradeableEIP712DomainChanged) if err := _AgentUpgradeable.contract.UnpackLog(event, "EIP712DomainChanged", log); err != nil { return nil, err } event.Raw = log return event, nil } // AgentUpgradeableInitializedIterator is returned from FilterInitialized and is used to iterate over the raw logs and unpacked data for Initialized events raised by the AgentUpgradeable contract. type AgentUpgradeableInitializedIterator struct { Event *AgentUpgradeableInitialized // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *AgentUpgradeableInitializedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(AgentUpgradeableInitialized) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(AgentUpgradeableInitialized) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *AgentUpgradeableInitializedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *AgentUpgradeableInitializedIterator) Close() error { it.sub.Unsubscribe() return nil } // AgentUpgradeableInitialized represents a Initialized event raised by the AgentUpgradeable contract. type AgentUpgradeableInitialized struct { Version uint8 Raw types.Log // Blockchain specific contextual infos } // FilterInitialized is a free log retrieval operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. // // Solidity: event Initialized(uint8 version) func (_AgentUpgradeable *AgentUpgradeableFilterer) FilterInitialized(opts *bind.FilterOpts) (*AgentUpgradeableInitializedIterator, error) { logs, sub, err := _AgentUpgradeable.contract.FilterLogs(opts, "Initialized") if err != nil { return nil, err } return &AgentUpgradeableInitializedIterator{contract: _AgentUpgradeable.contract, event: "Initialized", logs: logs, sub: sub}, nil } // WatchInitialized is a free log subscription operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. // // Solidity: event Initialized(uint8 version) func (_AgentUpgradeable *AgentUpgradeableFilterer) WatchInitialized(opts *bind.WatchOpts, sink chan<- *AgentUpgradeableInitialized) (event.Subscription, error) { logs, sub, err := _AgentUpgradeable.contract.WatchLogs(opts, "Initialized") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(AgentUpgradeableInitialized) if err := _AgentUpgradeable.contract.UnpackLog(event, "Initialized", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseInitialized is a log parse operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. // // Solidity: event Initialized(uint8 version) func (_AgentUpgradeable *AgentUpgradeableFilterer) ParseInitialized(log types.Log) (*AgentUpgradeableInitialized, error) { event := new(AgentUpgradeableInitialized) if err := _AgentUpgradeable.contract.UnpackLog(event, "Initialized", log); err != nil { return nil, err } event.Raw = log return event, nil } // AgentUpgradeableOwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the AgentUpgradeable contract. type AgentUpgradeableOwnershipTransferredIterator struct { Event *AgentUpgradeableOwnershipTransferred // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *AgentUpgradeableOwnershipTransferredIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(AgentUpgradeableOwnershipTransferred) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(AgentUpgradeableOwnershipTransferred) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *AgentUpgradeableOwnershipTransferredIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *AgentUpgradeableOwnershipTransferredIterator) Close() error { it.sub.Unsubscribe() return nil } // AgentUpgradeableOwnershipTransferred represents a OwnershipTransferred event raised by the AgentUpgradeable contract. type AgentUpgradeableOwnershipTransferred struct { PreviousOwner common.Address NewOwner common.Address Raw types.Log // Blockchain specific contextual infos } // FilterOwnershipTransferred is a free log retrieval operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. // // Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) func (_AgentUpgradeable *AgentUpgradeableFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*AgentUpgradeableOwnershipTransferredIterator, error) { var previousOwnerRule []interface{} for _, previousOwnerItem := range previousOwner { previousOwnerRule = append(previousOwnerRule, previousOwnerItem) } var newOwnerRule []interface{} for _, newOwnerItem := range newOwner { newOwnerRule = append(newOwnerRule, newOwnerItem) } logs, sub, err := _AgentUpgradeable.contract.FilterLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) if err != nil { return nil, err } return &AgentUpgradeableOwnershipTransferredIterator{contract: _AgentUpgradeable.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil } // WatchOwnershipTransferred is a free log subscription operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. // // Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) func (_AgentUpgradeable *AgentUpgradeableFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *AgentUpgradeableOwnershipTransferred, previousOwner []common.Address, newOwner []common.Address) (event.Subscription, error) { var previousOwnerRule []interface{} for _, previousOwnerItem := range previousOwner { previousOwnerRule = append(previousOwnerRule, previousOwnerItem) } var newOwnerRule []interface{} for _, newOwnerItem := range newOwner { newOwnerRule = append(newOwnerRule, newOwnerItem) } logs, sub, err := _AgentUpgradeable.contract.WatchLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(AgentUpgradeableOwnershipTransferred) if err := _AgentUpgradeable.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseOwnershipTransferred is a log parse operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. // // Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) func (_AgentUpgradeable *AgentUpgradeableFilterer) ParseOwnershipTransferred(log types.Log) (*AgentUpgradeableOwnershipTransferred, error) { event := new(AgentUpgradeableOwnershipTransferred) if err := _AgentUpgradeable.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { return nil, err } event.Raw = log return event, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/binds/agentupgradeable/AgentUpgradeable.json ================================================ [ { "inputs": [], "name": "DigestAlreadyUsed", "type": "error" }, { "inputs": [], "name": "InvalidData", "type": "error" }, { "inputs": [], "name": "InvalidVersion", "type": "error" }, { "inputs": [], "name": "Unauthenticated", "type": "error" }, { "inputs": [], "name": "ZeroAddress", "type": "error" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "uint256", "name": "version", "type": "uint256" }, { "indexed": true, "internalType": "uint256", "name": "pIndex", "type": "uint256" }, { "components": [ { "internalType": "address", "name": "retrieveAddress", "type": "address" }, { "internalType": "enum IAgent.FileType", "name": "fileType", "type": "uint8" }, { "internalType": "string", "name": "fileName", "type": "string" } ], "indexed": false, "internalType": "struct IAgent.CodePointer", "name": "newPointer", "type": "tuple" } ], "name": "CodePointerCreated", "type": "event" }, { "anonymous": false, "inputs": [], "name": "EIP712DomainChanged", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "uint8", "name": "version", "type": "uint8" } ], "name": "Initialized", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "previousOwner", "type": "address" }, { "indexed": true, "internalType": "address", "name": "newOwner", "type": "address" } ], "name": "OwnershipTransferred", "type": "event" }, { "inputs": [], "name": "eip712Domain", "outputs": [ { "internalType": "bytes1", "name": "fields", "type": "bytes1" }, { "internalType": "string", "name": "name", "type": "string" }, { "internalType": "string", "name": "version", "type": "string" }, { "internalType": "uint256", "name": "chainId", "type": "uint256" }, { "internalType": "address", "name": "verifyingContract", "type": "address" }, { "internalType": "bytes32", "name": "salt", "type": "bytes32" }, { "internalType": "uint256[]", "name": "extensions", "type": "uint256[]" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "string", "name": "name", "type": "string" } ], "name": "getAddressByENS", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint16", "name": "version", "type": "uint16" } ], "name": "getAgentCode", "outputs": [ { "internalType": "string", "name": "code", "type": "string" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "getAgentName", "outputs": [ { "internalType": "string", "name": "", "type": "string" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "getAgentOwner", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "getCodeLanguage", "outputs": [ { "internalType": "string", "name": "", "type": "string" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "getCurrentVersion", "outputs": [ { "internalType": "uint16", "name": "", "type": "uint16" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint16", "name": "version", "type": "uint16" } ], "name": "getDepsAgents", "outputs": [ { "internalType": "address[]", "name": "", "type": "address[]" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "components": [ { "internalType": "address", "name": "retrieveAddress", "type": "address" }, { "internalType": "enum IAgent.FileType", "name": "fileType", "type": "uint8" }, { "internalType": "string", "name": "fileName", "type": "string" } ], "internalType": "struct IAgent.CodePointer[]", "name": "pointers", "type": "tuple[]" }, { "internalType": "address[]", "name": "depsAgents", "type": "address[]" } ], "name": "getHashToSign", "outputs": [ { "internalType": "bytes32", "name": "", "type": "bytes32" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "string", "name": "agentName", "type": "string" }, { "internalType": "string", "name": "agentVersion", "type": "string" }, { "internalType": "string", "name": "codeLanguage", "type": "string" }, { "components": [ { "internalType": "address", "name": "retrieveAddress", "type": "address" }, { "internalType": "enum IAgent.FileType", "name": "fileType", "type": "uint8" }, { "internalType": "string", "name": "fileName", "type": "string" } ], "internalType": "struct IAgent.CodePointer[]", "name": "pointers", "type": "tuple[]" }, { "internalType": "address[]", "name": "depsAgents", "type": "address[]" }, { "internalType": "address", "name": "agentOwner", "type": "address" }, { "internalType": "bytes", "name": "nameService", "type": "bytes" } ], "name": "initialize", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [], "name": "owner", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "components": [ { "internalType": "address", "name": "retrieveAddress", "type": "address" }, { "internalType": "enum IAgent.FileType", "name": "fileType", "type": "uint8" }, { "internalType": "string", "name": "fileName", "type": "string" } ], "internalType": "struct IAgent.CodePointer[]", "name": "pointers", "type": "tuple[]" }, { "internalType": "address[]", "name": "depsAgents", "type": "address[]" } ], "name": "publishAgentCode", "outputs": [ { "internalType": "uint16", "name": "", "type": "uint16" } ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "components": [ { "internalType": "address", "name": "retrieveAddress", "type": "address" }, { "internalType": "enum IAgent.FileType", "name": "fileType", "type": "uint8" }, { "internalType": "string", "name": "fileName", "type": "string" } ], "internalType": "struct IAgent.CodePointer[]", "name": "pointers", "type": "tuple[]" }, { "internalType": "address[]", "name": "depsAgents", "type": "address[]" }, { "internalType": "bytes", "name": "signature", "type": "bytes" } ], "name": "publishAgentCodeWithSignature", "outputs": [ { "internalType": "uint16", "name": "", "type": "uint16" } ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "registrar", "outputs": [ { "internalType": "contract IBASERegistrarController", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "string", "name": "name", "type": "string" }, { "internalType": "uint256", "name": "duration", "type": "uint256" } ], "name": "renew", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [], "name": "renounceOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "resolver", "outputs": [ { "internalType": "contract IResolver", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "newOwner", "type": "address" } ], "name": "transferOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" } ] ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/binds/agentupgradeable/abigen.sh ================================================ abigen --abi=AgentUpgradeable.json --pkg=agentupgradeable --type AgentUpgradeable --out=AgentUpgradeable.go ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/binds/aikb721/KB721.abi ================================================ [ { "inputs": [], "name": "InsufficientFunds", "type": "error" }, { "inputs": [], "name": "InvalidAgentData", "type": "error" }, { "inputs": [], "name": "InvalidAgentFee", "type": "error" }, { "inputs": [], "name": "InvalidAgentId", "type": "error" }, { "inputs": [], "name": "InvalidAgentPromptIndex", "type": "error" }, { "inputs": [], "name": "InvalidAgentURI", "type": "error" }, { "inputs": [], "name": "InvalidData", "type": "error" }, { "inputs": [], "name": "SignatureUsed", "type": "error" }, { "inputs": [], "name": "Unauthorized", "type": "error" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "uint256", "name": "agentId", "type": "uint256" }, { "indexed": false, "internalType": "bytes[]", "name": "sysPrompt", "type": "bytes[]" } ], "name": "AgentDataAddNew", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "uint256", "name": "agentId", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "promptIndex", "type": "uint256" }, { "indexed": false, "internalType": "bytes", "name": "oldSysPrompt", "type": "bytes" }, { "indexed": false, "internalType": "bytes", "name": "newSysPrompt", "type": "bytes" } ], "name": "AgentDataUpdate", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "uint256", "name": "agentId", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "fee", "type": "uint256" } ], "name": "AgentFeeUpdate", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "uint256", "name": "agentId", "type": "uint256" }, { "indexed": false, "internalType": "bytes[]", "name": "missions", "type": "bytes[]" } ], "name": "AgentMissionAddNew", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "uint256", "name": "agentId", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "missionIndex", "type": "uint256" }, { "indexed": false, "internalType": "bytes", "name": "oldSysMission", "type": "bytes" }, { "indexed": false, "internalType": "bytes", "name": "newSysMission", "type": "bytes" } ], "name": "AgentMissionUpdate", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "uint256", "name": "agentId", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "oldModelId", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "newModelId", "type": "uint256" } ], "name": "AgentModelIdUpdate", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "uint256", "name": "agentId", "type": "uint256" }, { "indexed": false, "internalType": "address", "name": "oldPromptScheduler", "type": "address" }, { "indexed": false, "internalType": "address", "name": "newOldPromptScheduler", "type": "address" } ], "name": "AgentPromptSchedulerdUpdate", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "uint256", "name": "agentId", "type": "uint256" }, { "indexed": false, "internalType": "string", "name": "uri", "type": "string" } ], "name": "AgentURIUpdate", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "owner", "type": "address" }, { "indexed": true, "internalType": "address", "name": "approved", "type": "address" }, { "indexed": true, "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "Approval", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "owner", "type": "address" }, { "indexed": true, "internalType": "address", "name": "operator", "type": "address" }, { "indexed": false, "internalType": "bool", "name": "approved", "type": "bool" } ], "name": "ApprovalForAll", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "uint256", "name": "_fromTokenId", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "_toTokenId", "type": "uint256" } ], "name": "BatchMetadataUpdate", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "indexed": true, "internalType": "address", "name": "caller", "type": "address" }, { "indexed": false, "internalType": "bytes", "name": "data", "type": "bytes" }, { "indexed": false, "internalType": "uint256", "name": "fee", "type": "uint256" }, { "indexed": false, "internalType": "string", "name": "externalData", "type": "string" }, { "indexed": false, "internalType": "uint256", "name": "inferenceId", "type": "uint256" } ], "name": "InferencePerformed", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "uint8", "name": "version", "type": "uint8" } ], "name": "Initialized", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "uint256", "name": "_tokenId", "type": "uint256" } ], "name": "MetadataUpdate", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "uint256", "name": "newValue", "type": "uint256" } ], "name": "MintPriceUpdate", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "indexed": false, "internalType": "string", "name": "uri", "type": "string" }, { "indexed": false, "internalType": "bytes", "name": "sysPrompt", "type": "bytes" }, { "indexed": false, "internalType": "uint256", "name": "fee", "type": "uint256" }, { "indexed": true, "internalType": "address", "name": "minter", "type": "address" } ], "name": "NewToken", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "previousOwner", "type": "address" }, { "indexed": true, "internalType": "address", "name": "newOwner", "type": "address" } ], "name": "OwnershipTransferred", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "address", "name": "account", "type": "address" } ], "name": "Paused", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "uint16", "name": "newValue", "type": "uint16" } ], "name": "RoyaltyPortionUpdate", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "address", "name": "newAddress", "type": "address" } ], "name": "RoyaltyReceiverUpdate", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "uint256", "name": "agentId", "type": "uint256" }, { "indexed": false, "internalType": "address", "name": "caller", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" } ], "name": "TopUpPoolBalance", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "from", "type": "address" }, { "indexed": true, "internalType": "address", "name": "to", "type": "address" }, { "indexed": true, "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "Transfer", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "address", "name": "account", "type": "address" } ], "name": "Unpaused", "type": "event" }, { "inputs": [], "name": "_gpuManager", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "nftId", "type": "uint256" } ], "name": "_poolBalance", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "nftId", "type": "address" }, { "internalType": "bytes32", "name": "signature", "type": "bytes32" } ], "name": "_signaturesUsed", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "agentId", "type": "uint256" }, { "internalType": "string", "name": "promptKey", "type": "string" }, { "internalType": "bytes", "name": "sysPrompt", "type": "bytes" } ], "name": "addNewAgentData", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "to", "type": "address" }, { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "approve", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "owner", "type": "address" } ], "name": "balanceOf", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "agentId", "type": "uint256" }, { "internalType": "bytes", "name": "missionData", "type": "bytes" } ], "name": "createMission", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "agentId", "type": "uint256" } ], "name": "dataOf", "outputs": [ { "internalType": "uint128", "name": "", "type": "uint128" }, { "internalType": "bool", "name": "", "type": "bool" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "agentId", "type": "uint256" } ], "name": "getAgentFee", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "owner", "type": "address" } ], "name": "getAgentIdByOwner", "outputs": [ { "internalType": "uint256[]", "name": "", "type": "uint256[]" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "agentId", "type": "uint256" }, { "internalType": "string", "name": "promptKey", "type": "string" } ], "name": "getAgentSystemPrompt", "outputs": [ { "internalType": "bytes[]", "name": "", "type": "bytes[]" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "getApproved", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "agentId", "type": "uint256" } ], "name": "getMissionIdsByAgentId", "outputs": [ { "internalType": "bytes[]", "name": "", "type": "bytes[]" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "string", "name": "name_", "type": "string" }, { "internalType": "string", "name": "symbol_", "type": "string" }, { "internalType": "uint256", "name": "mintPrice_", "type": "uint256" }, { "internalType": "address", "name": "royaltyReceiver_", "type": "address" }, { "internalType": "uint16", "name": "royaltyPortion_", "type": "uint16" }, { "internalType": "uint256", "name": "nextTokenId_", "type": "uint256" }, { "internalType": "address", "name": "gpuManager_", "type": "address" }, { "internalType": "contract IERC20", "name": "tokenFee_", "type": "address" } ], "name": "initialize", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "owner", "type": "address" }, { "internalType": "address", "name": "operator", "type": "address" } ], "name": "isApprovedForAll", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "to", "type": "address" }, { "internalType": "string", "name": "uri", "type": "string" }, { "internalType": "bytes", "name": "data", "type": "bytes" }, { "internalType": "uint256", "name": "fee", "type": "uint256" }, { "internalType": "string", "name": "promptKey", "type": "string" }, { "internalType": "address", "name": "promptScheduler", "type": "address" }, { "internalType": "uint32", "name": "modelId", "type": "uint32" } ], "name": "mint", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "name", "outputs": [ { "internalType": "string", "name": "", "type": "string" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "nextTokenId", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "owner", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "ownerOf", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "pause", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "paused", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "renounceOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "agentId", "type": "uint256" }, { "internalType": "bytes", "name": "fwdCalldata", "type": "bytes" }, { "internalType": "string", "name": "externalData", "type": "string" }, { "internalType": "string", "name": "promptKey", "type": "string" }, { "internalType": "uint256", "name": "feeAmount", "type": "uint256" } ], "name": "retrieve", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "agentId", "type": "uint256" }, { "internalType": "bytes", "name": "fwdCalldata", "type": "bytes" }, { "internalType": "string", "name": "externalData", "type": "string" }, { "internalType": "string", "name": "promptKey", "type": "string" }, { "internalType": "bool", "name": "flag", "type": "bool" }, { "internalType": "uint256", "name": "feeAmount", "type": "uint256" } ], "name": "retrieve", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "agentId", "type": "uint256" }, { "internalType": "uint256", "name": "salePrice", "type": "uint256" } ], "name": "royaltyInfo", "outputs": [ { "internalType": "address", "name": "", "type": "address" }, { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "royaltyPortion", "outputs": [ { "internalType": "uint16", "name": "", "type": "uint16" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "royaltyReceiver", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "from", "type": "address" }, { "internalType": "address", "name": "to", "type": "address" }, { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "safeTransferFrom", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "from", "type": "address" }, { "internalType": "address", "name": "to", "type": "address" }, { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "internalType": "bytes", "name": "data", "type": "bytes" } ], "name": "safeTransferFrom", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "operator", "type": "address" }, { "internalType": "bool", "name": "approved", "type": "bool" } ], "name": "setApprovalForAll", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "bytes4", "name": "interfaceId", "type": "bytes4" } ], "name": "supportsInterface", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "symbol", "outputs": [ { "internalType": "string", "name": "", "type": "string" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "index", "type": "uint256" } ], "name": "tokenByIndex", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "owner", "type": "address" }, { "internalType": "uint256", "name": "index", "type": "uint256" } ], "name": "tokenOfOwnerByIndex", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "_agentId", "type": "uint256" } ], "name": "tokenURI", "outputs": [ { "internalType": "string", "name": "", "type": "string" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "agentId", "type": "uint256" }, { "internalType": "uint256", "name": "amount", "type": "uint256" } ], "name": "topUpPoolBalance", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "totalSupply", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "from", "type": "address" }, { "internalType": "address", "name": "to", "type": "address" }, { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "transferFrom", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "newOwner", "type": "address" } ], "name": "transferOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "unpause", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "agentId", "type": "uint256" }, { "internalType": "bytes", "name": "sysPrompt", "type": "bytes" }, { "internalType": "string", "name": "promptKey", "type": "string" }, { "internalType": "uint256", "name": "promptIdx", "type": "uint256" } ], "name": "updateAgentData", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "agentId", "type": "uint256" }, { "internalType": "bytes", "name": "sysPrompt", "type": "bytes" }, { "internalType": "string", "name": "promptKey", "type": "string" }, { "internalType": "uint256", "name": "promptIdx", "type": "uint256" }, { "internalType": "uint256", "name": "randomNonce", "type": "uint256" }, { "internalType": "bytes", "name": "signature", "type": "bytes" } ], "name": "updateAgentDataWithSignature", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "agentId", "type": "uint256" }, { "internalType": "uint256", "name": "fee", "type": "uint256" } ], "name": "updateAgentFee", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "agentId", "type": "uint256" }, { "internalType": "uint32", "name": "newModelId", "type": "uint32" } ], "name": "updateAgentModelId", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "agentId", "type": "uint256" }, { "internalType": "string", "name": "uri", "type": "string" } ], "name": "updateAgentURI", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "agentId", "type": "uint256" }, { "internalType": "string", "name": "uri", "type": "string" }, { "internalType": "uint256", "name": "randomNonce", "type": "uint256" }, { "internalType": "bytes", "name": "signature", "type": "bytes" } ], "name": "updateAgentUriWithSignature", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "gpuManager", "type": "address" } ], "name": "updateGPUManager", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "mintPrice", "type": "uint256" } ], "name": "updateMintPrice", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint16", "name": "royaltyPortion", "type": "uint16" } ], "name": "updateRoyaltyPortion", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "royaltyReceiver", "type": "address" } ], "name": "updateRoyaltyReceiver", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "agentId", "type": "uint256" }, { "internalType": "address", "name": "newPromptScheduler", "type": "address" } ], "name": "updateSchedulePrompt", "outputs": [], "stateMutability": "nonpayable", "type": "function" } ] ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/binds/aikb721/kb_721.go ================================================ // Code generated - DO NOT EDIT. // This file is a generated binding and any manual changes will be lost. package aikb721 import ( "errors" "math/big" "strings" ethereum "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/event" ) // Reference imports to suppress errors if they are not otherwise used. var ( _ = errors.New _ = big.NewInt _ = strings.NewReader _ = ethereum.NotFound _ = bind.Bind _ = common.Big1 _ = types.BloomLookup _ = event.NewSubscription _ = abi.ConvertType ) // EternalAIKB721MetaData contains all meta data concerning the EternalAIKB721 contract. var EternalAIKB721MetaData = &bind.MetaData{ ABI: "[{\"inputs\":[],\"name\":\"InsufficientFunds\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidAgentData\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidAgentFee\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidAgentId\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidAgentPromptIndex\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidAgentURI\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidData\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"SignatureUsed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Unauthorized\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"agentId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes[]\",\"name\":\"sysPrompt\",\"type\":\"bytes[]\"}],\"name\":\"AgentDataAddNew\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"agentId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"promptIndex\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"oldSysPrompt\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"newSysPrompt\",\"type\":\"bytes\"}],\"name\":\"AgentDataUpdate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"agentId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"fee\",\"type\":\"uint256\"}],\"name\":\"AgentFeeUpdate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"agentId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes[]\",\"name\":\"missions\",\"type\":\"bytes[]\"}],\"name\":\"AgentMissionAddNew\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"agentId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"missionIndex\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"oldSysMission\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"newSysMission\",\"type\":\"bytes\"}],\"name\":\"AgentMissionUpdate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"agentId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldModelId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newModelId\",\"type\":\"uint256\"}],\"name\":\"AgentModelIdUpdate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"agentId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"oldPromptScheduler\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newOldPromptScheduler\",\"type\":\"address\"}],\"name\":\"AgentPromptSchedulerdUpdate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"agentId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"uri\",\"type\":\"string\"}],\"name\":\"AgentURIUpdate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"approved\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"ApprovalForAll\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_fromTokenId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_toTokenId\",\"type\":\"uint256\"}],\"name\":\"BatchMetadataUpdate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"fee\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"externalData\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"inferenceId\",\"type\":\"uint256\"}],\"name\":\"InferencePerformed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_tokenId\",\"type\":\"uint256\"}],\"name\":\"MetadataUpdate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newValue\",\"type\":\"uint256\"}],\"name\":\"MintPriceUpdate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"uri\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"sysPrompt\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"fee\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"minter\",\"type\":\"address\"}],\"name\":\"NewToken\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"Paused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"newValue\",\"type\":\"uint16\"}],\"name\":\"RoyaltyPortionUpdate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAddress\",\"type\":\"address\"}],\"name\":\"RoyaltyReceiverUpdate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"agentId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TopUpPoolBalance\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"Unpaused\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"_gpuManager\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"nftId\",\"type\":\"uint256\"}],\"name\":\"_poolBalance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"nftId\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"signature\",\"type\":\"bytes32\"}],\"name\":\"_signaturesUsed\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"agentId\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"promptKey\",\"type\":\"string\"},{\"internalType\":\"bytes\",\"name\":\"sysPrompt\",\"type\":\"bytes\"}],\"name\":\"addNewAgentData\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"agentId\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"missionData\",\"type\":\"bytes\"}],\"name\":\"createMission\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"agentId\",\"type\":\"uint256\"}],\"name\":\"dataOf\",\"outputs\":[{\"internalType\":\"uint128\",\"name\":\"\",\"type\":\"uint128\"},{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"agentId\",\"type\":\"uint256\"}],\"name\":\"getAgentFee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"getAgentIdByOwner\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"agentId\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"promptKey\",\"type\":\"string\"}],\"name\":\"getAgentSystemPrompt\",\"outputs\":[{\"internalType\":\"bytes[]\",\"name\":\"\",\"type\":\"bytes[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"getApproved\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"agentId\",\"type\":\"uint256\"}],\"name\":\"getMissionIdsByAgentId\",\"outputs\":[{\"internalType\":\"bytes[]\",\"name\":\"\",\"type\":\"bytes[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"name_\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"symbol_\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"mintPrice_\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"royaltyReceiver_\",\"type\":\"address\"},{\"internalType\":\"uint16\",\"name\":\"royaltyPortion_\",\"type\":\"uint16\"},{\"internalType\":\"uint256\",\"name\":\"nextTokenId_\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"gpuManager_\",\"type\":\"address\"},{\"internalType\":\"contractIERC20\",\"name\":\"tokenFee_\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"name\":\"isApprovedForAll\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"uri\",\"type\":\"string\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"fee\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"promptKey\",\"type\":\"string\"},{\"internalType\":\"address\",\"name\":\"promptScheduler\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"modelId\",\"type\":\"uint32\"}],\"name\":\"mint\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"nextTokenId\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"ownerOf\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"paused\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"agentId\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"fwdCalldata\",\"type\":\"bytes\"},{\"internalType\":\"string\",\"name\":\"externalData\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"promptKey\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"feeAmount\",\"type\":\"uint256\"}],\"name\":\"retrieve\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"agentId\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"fwdCalldata\",\"type\":\"bytes\"},{\"internalType\":\"string\",\"name\":\"externalData\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"promptKey\",\"type\":\"string\"},{\"internalType\":\"bool\",\"name\":\"flag\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"feeAmount\",\"type\":\"uint256\"}],\"name\":\"retrieve\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"agentId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"salePrice\",\"type\":\"uint256\"}],\"name\":\"royaltyInfo\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"royaltyPortion\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"royaltyReceiver\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"safeTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"safeTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"setApprovalForAll\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"}],\"name\":\"tokenByIndex\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"}],\"name\":\"tokenOfOwnerByIndex\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_agentId\",\"type\":\"uint256\"}],\"name\":\"tokenURI\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"agentId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"topUpPoolBalance\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"unpause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"agentId\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"sysPrompt\",\"type\":\"bytes\"},{\"internalType\":\"string\",\"name\":\"promptKey\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"promptIdx\",\"type\":\"uint256\"}],\"name\":\"updateAgentData\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"agentId\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"sysPrompt\",\"type\":\"bytes\"},{\"internalType\":\"string\",\"name\":\"promptKey\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"promptIdx\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"randomNonce\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"name\":\"updateAgentDataWithSignature\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"agentId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"fee\",\"type\":\"uint256\"}],\"name\":\"updateAgentFee\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"agentId\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"newModelId\",\"type\":\"uint32\"}],\"name\":\"updateAgentModelId\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"agentId\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"uri\",\"type\":\"string\"}],\"name\":\"updateAgentURI\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"agentId\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"uri\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"randomNonce\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"name\":\"updateAgentUriWithSignature\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"gpuManager\",\"type\":\"address\"}],\"name\":\"updateGPUManager\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"mintPrice\",\"type\":\"uint256\"}],\"name\":\"updateMintPrice\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"royaltyPortion\",\"type\":\"uint16\"}],\"name\":\"updateRoyaltyPortion\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"royaltyReceiver\",\"type\":\"address\"}],\"name\":\"updateRoyaltyReceiver\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"agentId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"newPromptScheduler\",\"type\":\"address\"}],\"name\":\"updateSchedulePrompt\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", } // EternalAIKB721ABI is the input ABI used to generate the binding from. // Deprecated: Use EternalAIKB721MetaData.ABI instead. var EternalAIKB721ABI = EternalAIKB721MetaData.ABI // EternalAIKB721 is an auto generated Go binding around an Ethereum contract. type EternalAIKB721 struct { EternalAIKB721Caller // Read-only binding to the contract EternalAIKB721Transactor // Write-only binding to the contract EternalAIKB721Filterer // Log filterer for contract events } // EternalAIKB721Caller is an auto generated read-only Go binding around an Ethereum contract. type EternalAIKB721Caller struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // EternalAIKB721Transactor is an auto generated write-only Go binding around an Ethereum contract. type EternalAIKB721Transactor struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // EternalAIKB721Filterer is an auto generated log filtering Go binding around an Ethereum contract events. type EternalAIKB721Filterer struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // EternalAIKB721Session is an auto generated Go binding around an Ethereum contract, // with pre-set call and transact options. type EternalAIKB721Session struct { Contract *EternalAIKB721 // Generic contract binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // EternalAIKB721CallerSession is an auto generated read-only Go binding around an Ethereum contract, // with pre-set call options. type EternalAIKB721CallerSession struct { Contract *EternalAIKB721Caller // Generic contract caller binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session } // EternalAIKB721TransactorSession is an auto generated write-only Go binding around an Ethereum contract, // with pre-set transact options. type EternalAIKB721TransactorSession struct { Contract *EternalAIKB721Transactor // Generic contract transactor binding to set the session for TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // EternalAIKB721Raw is an auto generated low-level Go binding around an Ethereum contract. type EternalAIKB721Raw struct { Contract *EternalAIKB721 // Generic contract binding to access the raw methods on } // EternalAIKB721CallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. type EternalAIKB721CallerRaw struct { Contract *EternalAIKB721Caller // Generic read-only contract binding to access the raw methods on } // EternalAIKB721TransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. type EternalAIKB721TransactorRaw struct { Contract *EternalAIKB721Transactor // Generic write-only contract binding to access the raw methods on } // NewEternalAIKB721 creates a new instance of EternalAIKB721, bound to a specific deployed contract. func NewEternalAIKB721(address common.Address, backend bind.ContractBackend) (*EternalAIKB721, error) { contract, err := bindEternalAIKB721(address, backend, backend, backend) if err != nil { return nil, err } return &EternalAIKB721{EternalAIKB721Caller: EternalAIKB721Caller{contract: contract}, EternalAIKB721Transactor: EternalAIKB721Transactor{contract: contract}, EternalAIKB721Filterer: EternalAIKB721Filterer{contract: contract}}, nil } // NewEternalAIKB721Caller creates a new read-only instance of EternalAIKB721, bound to a specific deployed contract. func NewEternalAIKB721Caller(address common.Address, caller bind.ContractCaller) (*EternalAIKB721Caller, error) { contract, err := bindEternalAIKB721(address, caller, nil, nil) if err != nil { return nil, err } return &EternalAIKB721Caller{contract: contract}, nil } // NewEternalAIKB721Transactor creates a new write-only instance of EternalAIKB721, bound to a specific deployed contract. func NewEternalAIKB721Transactor(address common.Address, transactor bind.ContractTransactor) (*EternalAIKB721Transactor, error) { contract, err := bindEternalAIKB721(address, nil, transactor, nil) if err != nil { return nil, err } return &EternalAIKB721Transactor{contract: contract}, nil } // NewEternalAIKB721Filterer creates a new log filterer instance of EternalAIKB721, bound to a specific deployed contract. func NewEternalAIKB721Filterer(address common.Address, filterer bind.ContractFilterer) (*EternalAIKB721Filterer, error) { contract, err := bindEternalAIKB721(address, nil, nil, filterer) if err != nil { return nil, err } return &EternalAIKB721Filterer{contract: contract}, nil } // bindEternalAIKB721 binds a generic wrapper to an already deployed contract. func bindEternalAIKB721(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { parsed, err := EternalAIKB721MetaData.GetAbi() if err != nil { return nil, err } return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_EternalAIKB721 *EternalAIKB721Raw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _EternalAIKB721.Contract.EternalAIKB721Caller.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_EternalAIKB721 *EternalAIKB721Raw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _EternalAIKB721.Contract.EternalAIKB721Transactor.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_EternalAIKB721 *EternalAIKB721Raw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _EternalAIKB721.Contract.EternalAIKB721Transactor.contract.Transact(opts, method, params...) } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_EternalAIKB721 *EternalAIKB721CallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _EternalAIKB721.Contract.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_EternalAIKB721 *EternalAIKB721TransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _EternalAIKB721.Contract.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_EternalAIKB721 *EternalAIKB721TransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _EternalAIKB721.Contract.contract.Transact(opts, method, params...) } // GpuManager is a free data retrieval call binding the contract method 0x08c147fd. // // Solidity: function _gpuManager() view returns(address) func (_EternalAIKB721 *EternalAIKB721Caller) GpuManager(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _EternalAIKB721.contract.Call(opts, &out, "_gpuManager") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // GpuManager is a free data retrieval call binding the contract method 0x08c147fd. // // Solidity: function _gpuManager() view returns(address) func (_EternalAIKB721 *EternalAIKB721Session) GpuManager() (common.Address, error) { return _EternalAIKB721.Contract.GpuManager(&_EternalAIKB721.CallOpts) } // GpuManager is a free data retrieval call binding the contract method 0x08c147fd. // // Solidity: function _gpuManager() view returns(address) func (_EternalAIKB721 *EternalAIKB721CallerSession) GpuManager() (common.Address, error) { return _EternalAIKB721.Contract.GpuManager(&_EternalAIKB721.CallOpts) } // PoolBalance is a free data retrieval call binding the contract method 0xf121000e. // // Solidity: function _poolBalance(uint256 nftId) view returns(uint256) func (_EternalAIKB721 *EternalAIKB721Caller) PoolBalance(opts *bind.CallOpts, nftId *big.Int) (*big.Int, error) { var out []interface{} err := _EternalAIKB721.contract.Call(opts, &out, "_poolBalance", nftId) if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // PoolBalance is a free data retrieval call binding the contract method 0xf121000e. // // Solidity: function _poolBalance(uint256 nftId) view returns(uint256) func (_EternalAIKB721 *EternalAIKB721Session) PoolBalance(nftId *big.Int) (*big.Int, error) { return _EternalAIKB721.Contract.PoolBalance(&_EternalAIKB721.CallOpts, nftId) } // PoolBalance is a free data retrieval call binding the contract method 0xf121000e. // // Solidity: function _poolBalance(uint256 nftId) view returns(uint256) func (_EternalAIKB721 *EternalAIKB721CallerSession) PoolBalance(nftId *big.Int) (*big.Int, error) { return _EternalAIKB721.Contract.PoolBalance(&_EternalAIKB721.CallOpts, nftId) } // SignaturesUsed is a free data retrieval call binding the contract method 0xc9070a92. // // Solidity: function _signaturesUsed(address nftId, bytes32 signature) view returns(bool) func (_EternalAIKB721 *EternalAIKB721Caller) SignaturesUsed(opts *bind.CallOpts, nftId common.Address, signature [32]byte) (bool, error) { var out []interface{} err := _EternalAIKB721.contract.Call(opts, &out, "_signaturesUsed", nftId, signature) if err != nil { return *new(bool), err } out0 := *abi.ConvertType(out[0], new(bool)).(*bool) return out0, err } // SignaturesUsed is a free data retrieval call binding the contract method 0xc9070a92. // // Solidity: function _signaturesUsed(address nftId, bytes32 signature) view returns(bool) func (_EternalAIKB721 *EternalAIKB721Session) SignaturesUsed(nftId common.Address, signature [32]byte) (bool, error) { return _EternalAIKB721.Contract.SignaturesUsed(&_EternalAIKB721.CallOpts, nftId, signature) } // SignaturesUsed is a free data retrieval call binding the contract method 0xc9070a92. // // Solidity: function _signaturesUsed(address nftId, bytes32 signature) view returns(bool) func (_EternalAIKB721 *EternalAIKB721CallerSession) SignaturesUsed(nftId common.Address, signature [32]byte) (bool, error) { return _EternalAIKB721.Contract.SignaturesUsed(&_EternalAIKB721.CallOpts, nftId, signature) } // BalanceOf is a free data retrieval call binding the contract method 0x70a08231. // // Solidity: function balanceOf(address owner) view returns(uint256) func (_EternalAIKB721 *EternalAIKB721Caller) BalanceOf(opts *bind.CallOpts, owner common.Address) (*big.Int, error) { var out []interface{} err := _EternalAIKB721.contract.Call(opts, &out, "balanceOf", owner) if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // BalanceOf is a free data retrieval call binding the contract method 0x70a08231. // // Solidity: function balanceOf(address owner) view returns(uint256) func (_EternalAIKB721 *EternalAIKB721Session) BalanceOf(owner common.Address) (*big.Int, error) { return _EternalAIKB721.Contract.BalanceOf(&_EternalAIKB721.CallOpts, owner) } // BalanceOf is a free data retrieval call binding the contract method 0x70a08231. // // Solidity: function balanceOf(address owner) view returns(uint256) func (_EternalAIKB721 *EternalAIKB721CallerSession) BalanceOf(owner common.Address) (*big.Int, error) { return _EternalAIKB721.Contract.BalanceOf(&_EternalAIKB721.CallOpts, owner) } // DataOf is a free data retrieval call binding the contract method 0x871caa98. // // Solidity: function dataOf(uint256 agentId) view returns(uint128, bool) func (_EternalAIKB721 *EternalAIKB721Caller) DataOf(opts *bind.CallOpts, agentId *big.Int) (*big.Int, bool, error) { var out []interface{} err := _EternalAIKB721.contract.Call(opts, &out, "dataOf", agentId) if err != nil { return *new(*big.Int), *new(bool), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) out1 := *abi.ConvertType(out[1], new(bool)).(*bool) return out0, out1, err } // DataOf is a free data retrieval call binding the contract method 0x871caa98. // // Solidity: function dataOf(uint256 agentId) view returns(uint128, bool) func (_EternalAIKB721 *EternalAIKB721Session) DataOf(agentId *big.Int) (*big.Int, bool, error) { return _EternalAIKB721.Contract.DataOf(&_EternalAIKB721.CallOpts, agentId) } // DataOf is a free data retrieval call binding the contract method 0x871caa98. // // Solidity: function dataOf(uint256 agentId) view returns(uint128, bool) func (_EternalAIKB721 *EternalAIKB721CallerSession) DataOf(agentId *big.Int) (*big.Int, bool, error) { return _EternalAIKB721.Contract.DataOf(&_EternalAIKB721.CallOpts, agentId) } // GetAgentFee is a free data retrieval call binding the contract method 0xed96f433. // // Solidity: function getAgentFee(uint256 agentId) view returns(uint256) func (_EternalAIKB721 *EternalAIKB721Caller) GetAgentFee(opts *bind.CallOpts, agentId *big.Int) (*big.Int, error) { var out []interface{} err := _EternalAIKB721.contract.Call(opts, &out, "getAgentFee", agentId) if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // GetAgentFee is a free data retrieval call binding the contract method 0xed96f433. // // Solidity: function getAgentFee(uint256 agentId) view returns(uint256) func (_EternalAIKB721 *EternalAIKB721Session) GetAgentFee(agentId *big.Int) (*big.Int, error) { return _EternalAIKB721.Contract.GetAgentFee(&_EternalAIKB721.CallOpts, agentId) } // GetAgentFee is a free data retrieval call binding the contract method 0xed96f433. // // Solidity: function getAgentFee(uint256 agentId) view returns(uint256) func (_EternalAIKB721 *EternalAIKB721CallerSession) GetAgentFee(agentId *big.Int) (*big.Int, error) { return _EternalAIKB721.Contract.GetAgentFee(&_EternalAIKB721.CallOpts, agentId) } // GetAgentIdByOwner is a free data retrieval call binding the contract method 0xae57a2d3. // // Solidity: function getAgentIdByOwner(address owner) view returns(uint256[]) func (_EternalAIKB721 *EternalAIKB721Caller) GetAgentIdByOwner(opts *bind.CallOpts, owner common.Address) ([]*big.Int, error) { var out []interface{} err := _EternalAIKB721.contract.Call(opts, &out, "getAgentIdByOwner", owner) if err != nil { return *new([]*big.Int), err } out0 := *abi.ConvertType(out[0], new([]*big.Int)).(*[]*big.Int) return out0, err } // GetAgentIdByOwner is a free data retrieval call binding the contract method 0xae57a2d3. // // Solidity: function getAgentIdByOwner(address owner) view returns(uint256[]) func (_EternalAIKB721 *EternalAIKB721Session) GetAgentIdByOwner(owner common.Address) ([]*big.Int, error) { return _EternalAIKB721.Contract.GetAgentIdByOwner(&_EternalAIKB721.CallOpts, owner) } // GetAgentIdByOwner is a free data retrieval call binding the contract method 0xae57a2d3. // // Solidity: function getAgentIdByOwner(address owner) view returns(uint256[]) func (_EternalAIKB721 *EternalAIKB721CallerSession) GetAgentIdByOwner(owner common.Address) ([]*big.Int, error) { return _EternalAIKB721.Contract.GetAgentIdByOwner(&_EternalAIKB721.CallOpts, owner) } // GetAgentSystemPrompt is a free data retrieval call binding the contract method 0x5a88fc7c. // // Solidity: function getAgentSystemPrompt(uint256 agentId, string promptKey) view returns(bytes[]) func (_EternalAIKB721 *EternalAIKB721Caller) GetAgentSystemPrompt(opts *bind.CallOpts, agentId *big.Int, promptKey string) ([][]byte, error) { var out []interface{} err := _EternalAIKB721.contract.Call(opts, &out, "getAgentSystemPrompt", agentId, promptKey) if err != nil { return *new([][]byte), err } out0 := *abi.ConvertType(out[0], new([][]byte)).(*[][]byte) return out0, err } // GetAgentSystemPrompt is a free data retrieval call binding the contract method 0x5a88fc7c. // // Solidity: function getAgentSystemPrompt(uint256 agentId, string promptKey) view returns(bytes[]) func (_EternalAIKB721 *EternalAIKB721Session) GetAgentSystemPrompt(agentId *big.Int, promptKey string) ([][]byte, error) { return _EternalAIKB721.Contract.GetAgentSystemPrompt(&_EternalAIKB721.CallOpts, agentId, promptKey) } // GetAgentSystemPrompt is a free data retrieval call binding the contract method 0x5a88fc7c. // // Solidity: function getAgentSystemPrompt(uint256 agentId, string promptKey) view returns(bytes[]) func (_EternalAIKB721 *EternalAIKB721CallerSession) GetAgentSystemPrompt(agentId *big.Int, promptKey string) ([][]byte, error) { return _EternalAIKB721.Contract.GetAgentSystemPrompt(&_EternalAIKB721.CallOpts, agentId, promptKey) } // GetApproved is a free data retrieval call binding the contract method 0x081812fc. // // Solidity: function getApproved(uint256 tokenId) view returns(address) func (_EternalAIKB721 *EternalAIKB721Caller) GetApproved(opts *bind.CallOpts, tokenId *big.Int) (common.Address, error) { var out []interface{} err := _EternalAIKB721.contract.Call(opts, &out, "getApproved", tokenId) if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // GetApproved is a free data retrieval call binding the contract method 0x081812fc. // // Solidity: function getApproved(uint256 tokenId) view returns(address) func (_EternalAIKB721 *EternalAIKB721Session) GetApproved(tokenId *big.Int) (common.Address, error) { return _EternalAIKB721.Contract.GetApproved(&_EternalAIKB721.CallOpts, tokenId) } // GetApproved is a free data retrieval call binding the contract method 0x081812fc. // // Solidity: function getApproved(uint256 tokenId) view returns(address) func (_EternalAIKB721 *EternalAIKB721CallerSession) GetApproved(tokenId *big.Int) (common.Address, error) { return _EternalAIKB721.Contract.GetApproved(&_EternalAIKB721.CallOpts, tokenId) } // GetMissionIdsByAgentId is a free data retrieval call binding the contract method 0x96694ad0. // // Solidity: function getMissionIdsByAgentId(uint256 agentId) view returns(bytes[]) func (_EternalAIKB721 *EternalAIKB721Caller) GetMissionIdsByAgentId(opts *bind.CallOpts, agentId *big.Int) ([][]byte, error) { var out []interface{} err := _EternalAIKB721.contract.Call(opts, &out, "getMissionIdsByAgentId", agentId) if err != nil { return *new([][]byte), err } out0 := *abi.ConvertType(out[0], new([][]byte)).(*[][]byte) return out0, err } // GetMissionIdsByAgentId is a free data retrieval call binding the contract method 0x96694ad0. // // Solidity: function getMissionIdsByAgentId(uint256 agentId) view returns(bytes[]) func (_EternalAIKB721 *EternalAIKB721Session) GetMissionIdsByAgentId(agentId *big.Int) ([][]byte, error) { return _EternalAIKB721.Contract.GetMissionIdsByAgentId(&_EternalAIKB721.CallOpts, agentId) } // GetMissionIdsByAgentId is a free data retrieval call binding the contract method 0x96694ad0. // // Solidity: function getMissionIdsByAgentId(uint256 agentId) view returns(bytes[]) func (_EternalAIKB721 *EternalAIKB721CallerSession) GetMissionIdsByAgentId(agentId *big.Int) ([][]byte, error) { return _EternalAIKB721.Contract.GetMissionIdsByAgentId(&_EternalAIKB721.CallOpts, agentId) } // IsApprovedForAll is a free data retrieval call binding the contract method 0xe985e9c5. // // Solidity: function isApprovedForAll(address owner, address operator) view returns(bool) func (_EternalAIKB721 *EternalAIKB721Caller) IsApprovedForAll(opts *bind.CallOpts, owner common.Address, operator common.Address) (bool, error) { var out []interface{} err := _EternalAIKB721.contract.Call(opts, &out, "isApprovedForAll", owner, operator) if err != nil { return *new(bool), err } out0 := *abi.ConvertType(out[0], new(bool)).(*bool) return out0, err } // IsApprovedForAll is a free data retrieval call binding the contract method 0xe985e9c5. // // Solidity: function isApprovedForAll(address owner, address operator) view returns(bool) func (_EternalAIKB721 *EternalAIKB721Session) IsApprovedForAll(owner common.Address, operator common.Address) (bool, error) { return _EternalAIKB721.Contract.IsApprovedForAll(&_EternalAIKB721.CallOpts, owner, operator) } // IsApprovedForAll is a free data retrieval call binding the contract method 0xe985e9c5. // // Solidity: function isApprovedForAll(address owner, address operator) view returns(bool) func (_EternalAIKB721 *EternalAIKB721CallerSession) IsApprovedForAll(owner common.Address, operator common.Address) (bool, error) { return _EternalAIKB721.Contract.IsApprovedForAll(&_EternalAIKB721.CallOpts, owner, operator) } // Name is a free data retrieval call binding the contract method 0x06fdde03. // // Solidity: function name() view returns(string) func (_EternalAIKB721 *EternalAIKB721Caller) Name(opts *bind.CallOpts) (string, error) { var out []interface{} err := _EternalAIKB721.contract.Call(opts, &out, "name") if err != nil { return *new(string), err } out0 := *abi.ConvertType(out[0], new(string)).(*string) return out0, err } // Name is a free data retrieval call binding the contract method 0x06fdde03. // // Solidity: function name() view returns(string) func (_EternalAIKB721 *EternalAIKB721Session) Name() (string, error) { return _EternalAIKB721.Contract.Name(&_EternalAIKB721.CallOpts) } // Name is a free data retrieval call binding the contract method 0x06fdde03. // // Solidity: function name() view returns(string) func (_EternalAIKB721 *EternalAIKB721CallerSession) Name() (string, error) { return _EternalAIKB721.Contract.Name(&_EternalAIKB721.CallOpts) } // NextTokenId is a free data retrieval call binding the contract method 0x75794a3c. // // Solidity: function nextTokenId() view returns(uint256) func (_EternalAIKB721 *EternalAIKB721Caller) NextTokenId(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} err := _EternalAIKB721.contract.Call(opts, &out, "nextTokenId") if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // NextTokenId is a free data retrieval call binding the contract method 0x75794a3c. // // Solidity: function nextTokenId() view returns(uint256) func (_EternalAIKB721 *EternalAIKB721Session) NextTokenId() (*big.Int, error) { return _EternalAIKB721.Contract.NextTokenId(&_EternalAIKB721.CallOpts) } // NextTokenId is a free data retrieval call binding the contract method 0x75794a3c. // // Solidity: function nextTokenId() view returns(uint256) func (_EternalAIKB721 *EternalAIKB721CallerSession) NextTokenId() (*big.Int, error) { return _EternalAIKB721.Contract.NextTokenId(&_EternalAIKB721.CallOpts) } // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. // // Solidity: function owner() view returns(address) func (_EternalAIKB721 *EternalAIKB721Caller) Owner(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _EternalAIKB721.contract.Call(opts, &out, "owner") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. // // Solidity: function owner() view returns(address) func (_EternalAIKB721 *EternalAIKB721Session) Owner() (common.Address, error) { return _EternalAIKB721.Contract.Owner(&_EternalAIKB721.CallOpts) } // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. // // Solidity: function owner() view returns(address) func (_EternalAIKB721 *EternalAIKB721CallerSession) Owner() (common.Address, error) { return _EternalAIKB721.Contract.Owner(&_EternalAIKB721.CallOpts) } // OwnerOf is a free data retrieval call binding the contract method 0x6352211e. // // Solidity: function ownerOf(uint256 tokenId) view returns(address) func (_EternalAIKB721 *EternalAIKB721Caller) OwnerOf(opts *bind.CallOpts, tokenId *big.Int) (common.Address, error) { var out []interface{} err := _EternalAIKB721.contract.Call(opts, &out, "ownerOf", tokenId) if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // OwnerOf is a free data retrieval call binding the contract method 0x6352211e. // // Solidity: function ownerOf(uint256 tokenId) view returns(address) func (_EternalAIKB721 *EternalAIKB721Session) OwnerOf(tokenId *big.Int) (common.Address, error) { return _EternalAIKB721.Contract.OwnerOf(&_EternalAIKB721.CallOpts, tokenId) } // OwnerOf is a free data retrieval call binding the contract method 0x6352211e. // // Solidity: function ownerOf(uint256 tokenId) view returns(address) func (_EternalAIKB721 *EternalAIKB721CallerSession) OwnerOf(tokenId *big.Int) (common.Address, error) { return _EternalAIKB721.Contract.OwnerOf(&_EternalAIKB721.CallOpts, tokenId) } // Paused is a free data retrieval call binding the contract method 0x5c975abb. // // Solidity: function paused() view returns(bool) func (_EternalAIKB721 *EternalAIKB721Caller) Paused(opts *bind.CallOpts) (bool, error) { var out []interface{} err := _EternalAIKB721.contract.Call(opts, &out, "paused") if err != nil { return *new(bool), err } out0 := *abi.ConvertType(out[0], new(bool)).(*bool) return out0, err } // Paused is a free data retrieval call binding the contract method 0x5c975abb. // // Solidity: function paused() view returns(bool) func (_EternalAIKB721 *EternalAIKB721Session) Paused() (bool, error) { return _EternalAIKB721.Contract.Paused(&_EternalAIKB721.CallOpts) } // Paused is a free data retrieval call binding the contract method 0x5c975abb. // // Solidity: function paused() view returns(bool) func (_EternalAIKB721 *EternalAIKB721CallerSession) Paused() (bool, error) { return _EternalAIKB721.Contract.Paused(&_EternalAIKB721.CallOpts) } // RoyaltyInfo is a free data retrieval call binding the contract method 0x2a55205a. // // Solidity: function royaltyInfo(uint256 agentId, uint256 salePrice) view returns(address, uint256) func (_EternalAIKB721 *EternalAIKB721Caller) RoyaltyInfo(opts *bind.CallOpts, agentId *big.Int, salePrice *big.Int) (common.Address, *big.Int, error) { var out []interface{} err := _EternalAIKB721.contract.Call(opts, &out, "royaltyInfo", agentId, salePrice) if err != nil { return *new(common.Address), *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) out1 := *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) return out0, out1, err } // RoyaltyInfo is a free data retrieval call binding the contract method 0x2a55205a. // // Solidity: function royaltyInfo(uint256 agentId, uint256 salePrice) view returns(address, uint256) func (_EternalAIKB721 *EternalAIKB721Session) RoyaltyInfo(agentId *big.Int, salePrice *big.Int) (common.Address, *big.Int, error) { return _EternalAIKB721.Contract.RoyaltyInfo(&_EternalAIKB721.CallOpts, agentId, salePrice) } // RoyaltyInfo is a free data retrieval call binding the contract method 0x2a55205a. // // Solidity: function royaltyInfo(uint256 agentId, uint256 salePrice) view returns(address, uint256) func (_EternalAIKB721 *EternalAIKB721CallerSession) RoyaltyInfo(agentId *big.Int, salePrice *big.Int) (common.Address, *big.Int, error) { return _EternalAIKB721.Contract.RoyaltyInfo(&_EternalAIKB721.CallOpts, agentId, salePrice) } // RoyaltyPortion is a free data retrieval call binding the contract method 0x11d7beb2. // // Solidity: function royaltyPortion() view returns(uint16) func (_EternalAIKB721 *EternalAIKB721Caller) RoyaltyPortion(opts *bind.CallOpts) (uint16, error) { var out []interface{} err := _EternalAIKB721.contract.Call(opts, &out, "royaltyPortion") if err != nil { return *new(uint16), err } out0 := *abi.ConvertType(out[0], new(uint16)).(*uint16) return out0, err } // RoyaltyPortion is a free data retrieval call binding the contract method 0x11d7beb2. // // Solidity: function royaltyPortion() view returns(uint16) func (_EternalAIKB721 *EternalAIKB721Session) RoyaltyPortion() (uint16, error) { return _EternalAIKB721.Contract.RoyaltyPortion(&_EternalAIKB721.CallOpts) } // RoyaltyPortion is a free data retrieval call binding the contract method 0x11d7beb2. // // Solidity: function royaltyPortion() view returns(uint16) func (_EternalAIKB721 *EternalAIKB721CallerSession) RoyaltyPortion() (uint16, error) { return _EternalAIKB721.Contract.RoyaltyPortion(&_EternalAIKB721.CallOpts) } // RoyaltyReceiver is a free data retrieval call binding the contract method 0x9fbc8713. // // Solidity: function royaltyReceiver() view returns(address) func (_EternalAIKB721 *EternalAIKB721Caller) RoyaltyReceiver(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _EternalAIKB721.contract.Call(opts, &out, "royaltyReceiver") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // RoyaltyReceiver is a free data retrieval call binding the contract method 0x9fbc8713. // // Solidity: function royaltyReceiver() view returns(address) func (_EternalAIKB721 *EternalAIKB721Session) RoyaltyReceiver() (common.Address, error) { return _EternalAIKB721.Contract.RoyaltyReceiver(&_EternalAIKB721.CallOpts) } // RoyaltyReceiver is a free data retrieval call binding the contract method 0x9fbc8713. // // Solidity: function royaltyReceiver() view returns(address) func (_EternalAIKB721 *EternalAIKB721CallerSession) RoyaltyReceiver() (common.Address, error) { return _EternalAIKB721.Contract.RoyaltyReceiver(&_EternalAIKB721.CallOpts) } // SupportsInterface is a free data retrieval call binding the contract method 0x01ffc9a7. // // Solidity: function supportsInterface(bytes4 interfaceId) view returns(bool) func (_EternalAIKB721 *EternalAIKB721Caller) SupportsInterface(opts *bind.CallOpts, interfaceId [4]byte) (bool, error) { var out []interface{} err := _EternalAIKB721.contract.Call(opts, &out, "supportsInterface", interfaceId) if err != nil { return *new(bool), err } out0 := *abi.ConvertType(out[0], new(bool)).(*bool) return out0, err } // SupportsInterface is a free data retrieval call binding the contract method 0x01ffc9a7. // // Solidity: function supportsInterface(bytes4 interfaceId) view returns(bool) func (_EternalAIKB721 *EternalAIKB721Session) SupportsInterface(interfaceId [4]byte) (bool, error) { return _EternalAIKB721.Contract.SupportsInterface(&_EternalAIKB721.CallOpts, interfaceId) } // SupportsInterface is a free data retrieval call binding the contract method 0x01ffc9a7. // // Solidity: function supportsInterface(bytes4 interfaceId) view returns(bool) func (_EternalAIKB721 *EternalAIKB721CallerSession) SupportsInterface(interfaceId [4]byte) (bool, error) { return _EternalAIKB721.Contract.SupportsInterface(&_EternalAIKB721.CallOpts, interfaceId) } // Symbol is a free data retrieval call binding the contract method 0x95d89b41. // // Solidity: function symbol() view returns(string) func (_EternalAIKB721 *EternalAIKB721Caller) Symbol(opts *bind.CallOpts) (string, error) { var out []interface{} err := _EternalAIKB721.contract.Call(opts, &out, "symbol") if err != nil { return *new(string), err } out0 := *abi.ConvertType(out[0], new(string)).(*string) return out0, err } // Symbol is a free data retrieval call binding the contract method 0x95d89b41. // // Solidity: function symbol() view returns(string) func (_EternalAIKB721 *EternalAIKB721Session) Symbol() (string, error) { return _EternalAIKB721.Contract.Symbol(&_EternalAIKB721.CallOpts) } // Symbol is a free data retrieval call binding the contract method 0x95d89b41. // // Solidity: function symbol() view returns(string) func (_EternalAIKB721 *EternalAIKB721CallerSession) Symbol() (string, error) { return _EternalAIKB721.Contract.Symbol(&_EternalAIKB721.CallOpts) } // TokenByIndex is a free data retrieval call binding the contract method 0x4f6ccce7. // // Solidity: function tokenByIndex(uint256 index) view returns(uint256) func (_EternalAIKB721 *EternalAIKB721Caller) TokenByIndex(opts *bind.CallOpts, index *big.Int) (*big.Int, error) { var out []interface{} err := _EternalAIKB721.contract.Call(opts, &out, "tokenByIndex", index) if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // TokenByIndex is a free data retrieval call binding the contract method 0x4f6ccce7. // // Solidity: function tokenByIndex(uint256 index) view returns(uint256) func (_EternalAIKB721 *EternalAIKB721Session) TokenByIndex(index *big.Int) (*big.Int, error) { return _EternalAIKB721.Contract.TokenByIndex(&_EternalAIKB721.CallOpts, index) } // TokenByIndex is a free data retrieval call binding the contract method 0x4f6ccce7. // // Solidity: function tokenByIndex(uint256 index) view returns(uint256) func (_EternalAIKB721 *EternalAIKB721CallerSession) TokenByIndex(index *big.Int) (*big.Int, error) { return _EternalAIKB721.Contract.TokenByIndex(&_EternalAIKB721.CallOpts, index) } // TokenOfOwnerByIndex is a free data retrieval call binding the contract method 0x2f745c59. // // Solidity: function tokenOfOwnerByIndex(address owner, uint256 index) view returns(uint256) func (_EternalAIKB721 *EternalAIKB721Caller) TokenOfOwnerByIndex(opts *bind.CallOpts, owner common.Address, index *big.Int) (*big.Int, error) { var out []interface{} err := _EternalAIKB721.contract.Call(opts, &out, "tokenOfOwnerByIndex", owner, index) if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // TokenOfOwnerByIndex is a free data retrieval call binding the contract method 0x2f745c59. // // Solidity: function tokenOfOwnerByIndex(address owner, uint256 index) view returns(uint256) func (_EternalAIKB721 *EternalAIKB721Session) TokenOfOwnerByIndex(owner common.Address, index *big.Int) (*big.Int, error) { return _EternalAIKB721.Contract.TokenOfOwnerByIndex(&_EternalAIKB721.CallOpts, owner, index) } // TokenOfOwnerByIndex is a free data retrieval call binding the contract method 0x2f745c59. // // Solidity: function tokenOfOwnerByIndex(address owner, uint256 index) view returns(uint256) func (_EternalAIKB721 *EternalAIKB721CallerSession) TokenOfOwnerByIndex(owner common.Address, index *big.Int) (*big.Int, error) { return _EternalAIKB721.Contract.TokenOfOwnerByIndex(&_EternalAIKB721.CallOpts, owner, index) } // TokenURI is a free data retrieval call binding the contract method 0xc87b56dd. // // Solidity: function tokenURI(uint256 _agentId) view returns(string) func (_EternalAIKB721 *EternalAIKB721Caller) TokenURI(opts *bind.CallOpts, _agentId *big.Int) (string, error) { var out []interface{} err := _EternalAIKB721.contract.Call(opts, &out, "tokenURI", _agentId) if err != nil { return *new(string), err } out0 := *abi.ConvertType(out[0], new(string)).(*string) return out0, err } // TokenURI is a free data retrieval call binding the contract method 0xc87b56dd. // // Solidity: function tokenURI(uint256 _agentId) view returns(string) func (_EternalAIKB721 *EternalAIKB721Session) TokenURI(_agentId *big.Int) (string, error) { return _EternalAIKB721.Contract.TokenURI(&_EternalAIKB721.CallOpts, _agentId) } // TokenURI is a free data retrieval call binding the contract method 0xc87b56dd. // // Solidity: function tokenURI(uint256 _agentId) view returns(string) func (_EternalAIKB721 *EternalAIKB721CallerSession) TokenURI(_agentId *big.Int) (string, error) { return _EternalAIKB721.Contract.TokenURI(&_EternalAIKB721.CallOpts, _agentId) } // TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. // // Solidity: function totalSupply() view returns(uint256) func (_EternalAIKB721 *EternalAIKB721Caller) TotalSupply(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} err := _EternalAIKB721.contract.Call(opts, &out, "totalSupply") if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. // // Solidity: function totalSupply() view returns(uint256) func (_EternalAIKB721 *EternalAIKB721Session) TotalSupply() (*big.Int, error) { return _EternalAIKB721.Contract.TotalSupply(&_EternalAIKB721.CallOpts) } // TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. // // Solidity: function totalSupply() view returns(uint256) func (_EternalAIKB721 *EternalAIKB721CallerSession) TotalSupply() (*big.Int, error) { return _EternalAIKB721.Contract.TotalSupply(&_EternalAIKB721.CallOpts) } // AddNewAgentData is a paid mutator transaction binding the contract method 0x413b0efa. // // Solidity: function addNewAgentData(uint256 agentId, string promptKey, bytes sysPrompt) returns() func (_EternalAIKB721 *EternalAIKB721Transactor) AddNewAgentData(opts *bind.TransactOpts, agentId *big.Int, promptKey string, sysPrompt []byte) (*types.Transaction, error) { return _EternalAIKB721.contract.Transact(opts, "addNewAgentData", agentId, promptKey, sysPrompt) } // AddNewAgentData is a paid mutator transaction binding the contract method 0x413b0efa. // // Solidity: function addNewAgentData(uint256 agentId, string promptKey, bytes sysPrompt) returns() func (_EternalAIKB721 *EternalAIKB721Session) AddNewAgentData(agentId *big.Int, promptKey string, sysPrompt []byte) (*types.Transaction, error) { return _EternalAIKB721.Contract.AddNewAgentData(&_EternalAIKB721.TransactOpts, agentId, promptKey, sysPrompt) } // AddNewAgentData is a paid mutator transaction binding the contract method 0x413b0efa. // // Solidity: function addNewAgentData(uint256 agentId, string promptKey, bytes sysPrompt) returns() func (_EternalAIKB721 *EternalAIKB721TransactorSession) AddNewAgentData(agentId *big.Int, promptKey string, sysPrompt []byte) (*types.Transaction, error) { return _EternalAIKB721.Contract.AddNewAgentData(&_EternalAIKB721.TransactOpts, agentId, promptKey, sysPrompt) } // Approve is a paid mutator transaction binding the contract method 0x095ea7b3. // // Solidity: function approve(address to, uint256 tokenId) returns() func (_EternalAIKB721 *EternalAIKB721Transactor) Approve(opts *bind.TransactOpts, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _EternalAIKB721.contract.Transact(opts, "approve", to, tokenId) } // Approve is a paid mutator transaction binding the contract method 0x095ea7b3. // // Solidity: function approve(address to, uint256 tokenId) returns() func (_EternalAIKB721 *EternalAIKB721Session) Approve(to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _EternalAIKB721.Contract.Approve(&_EternalAIKB721.TransactOpts, to, tokenId) } // Approve is a paid mutator transaction binding the contract method 0x095ea7b3. // // Solidity: function approve(address to, uint256 tokenId) returns() func (_EternalAIKB721 *EternalAIKB721TransactorSession) Approve(to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _EternalAIKB721.Contract.Approve(&_EternalAIKB721.TransactOpts, to, tokenId) } // CreateMission is a paid mutator transaction binding the contract method 0x6001ad44. // // Solidity: function createMission(uint256 agentId, bytes missionData) returns() func (_EternalAIKB721 *EternalAIKB721Transactor) CreateMission(opts *bind.TransactOpts, agentId *big.Int, missionData []byte) (*types.Transaction, error) { return _EternalAIKB721.contract.Transact(opts, "createMission", agentId, missionData) } // CreateMission is a paid mutator transaction binding the contract method 0x6001ad44. // // Solidity: function createMission(uint256 agentId, bytes missionData) returns() func (_EternalAIKB721 *EternalAIKB721Session) CreateMission(agentId *big.Int, missionData []byte) (*types.Transaction, error) { return _EternalAIKB721.Contract.CreateMission(&_EternalAIKB721.TransactOpts, agentId, missionData) } // CreateMission is a paid mutator transaction binding the contract method 0x6001ad44. // // Solidity: function createMission(uint256 agentId, bytes missionData) returns() func (_EternalAIKB721 *EternalAIKB721TransactorSession) CreateMission(agentId *big.Int, missionData []byte) (*types.Transaction, error) { return _EternalAIKB721.Contract.CreateMission(&_EternalAIKB721.TransactOpts, agentId, missionData) } // Initialize is a paid mutator transaction binding the contract method 0x1e18fb8c. // // Solidity: function initialize(string name_, string symbol_, uint256 mintPrice_, address royaltyReceiver_, uint16 royaltyPortion_, uint256 nextTokenId_, address gpuManager_, address tokenFee_) returns() func (_EternalAIKB721 *EternalAIKB721Transactor) Initialize(opts *bind.TransactOpts, name_ string, symbol_ string, mintPrice_ *big.Int, royaltyReceiver_ common.Address, royaltyPortion_ uint16, nextTokenId_ *big.Int, gpuManager_ common.Address, tokenFee_ common.Address) (*types.Transaction, error) { return _EternalAIKB721.contract.Transact(opts, "initialize", name_, symbol_, mintPrice_, royaltyReceiver_, royaltyPortion_, nextTokenId_, gpuManager_, tokenFee_) } // Initialize is a paid mutator transaction binding the contract method 0x1e18fb8c. // // Solidity: function initialize(string name_, string symbol_, uint256 mintPrice_, address royaltyReceiver_, uint16 royaltyPortion_, uint256 nextTokenId_, address gpuManager_, address tokenFee_) returns() func (_EternalAIKB721 *EternalAIKB721Session) Initialize(name_ string, symbol_ string, mintPrice_ *big.Int, royaltyReceiver_ common.Address, royaltyPortion_ uint16, nextTokenId_ *big.Int, gpuManager_ common.Address, tokenFee_ common.Address) (*types.Transaction, error) { return _EternalAIKB721.Contract.Initialize(&_EternalAIKB721.TransactOpts, name_, symbol_, mintPrice_, royaltyReceiver_, royaltyPortion_, nextTokenId_, gpuManager_, tokenFee_) } // Initialize is a paid mutator transaction binding the contract method 0x1e18fb8c. // // Solidity: function initialize(string name_, string symbol_, uint256 mintPrice_, address royaltyReceiver_, uint16 royaltyPortion_, uint256 nextTokenId_, address gpuManager_, address tokenFee_) returns() func (_EternalAIKB721 *EternalAIKB721TransactorSession) Initialize(name_ string, symbol_ string, mintPrice_ *big.Int, royaltyReceiver_ common.Address, royaltyPortion_ uint16, nextTokenId_ *big.Int, gpuManager_ common.Address, tokenFee_ common.Address) (*types.Transaction, error) { return _EternalAIKB721.Contract.Initialize(&_EternalAIKB721.TransactOpts, name_, symbol_, mintPrice_, royaltyReceiver_, royaltyPortion_, nextTokenId_, gpuManager_, tokenFee_) } // Mint is a paid mutator transaction binding the contract method 0xb8ea1693. // // Solidity: function mint(address to, string uri, bytes data, uint256 fee, string promptKey, address promptScheduler, uint32 modelId) returns(uint256) func (_EternalAIKB721 *EternalAIKB721Transactor) Mint(opts *bind.TransactOpts, to common.Address, uri string, data []byte, fee *big.Int, promptKey string, promptScheduler common.Address, modelId uint32) (*types.Transaction, error) { return _EternalAIKB721.contract.Transact(opts, "mint", to, uri, data, fee, promptKey, promptScheduler, modelId) } // Mint is a paid mutator transaction binding the contract method 0xb8ea1693. // // Solidity: function mint(address to, string uri, bytes data, uint256 fee, string promptKey, address promptScheduler, uint32 modelId) returns(uint256) func (_EternalAIKB721 *EternalAIKB721Session) Mint(to common.Address, uri string, data []byte, fee *big.Int, promptKey string, promptScheduler common.Address, modelId uint32) (*types.Transaction, error) { return _EternalAIKB721.Contract.Mint(&_EternalAIKB721.TransactOpts, to, uri, data, fee, promptKey, promptScheduler, modelId) } // Mint is a paid mutator transaction binding the contract method 0xb8ea1693. // // Solidity: function mint(address to, string uri, bytes data, uint256 fee, string promptKey, address promptScheduler, uint32 modelId) returns(uint256) func (_EternalAIKB721 *EternalAIKB721TransactorSession) Mint(to common.Address, uri string, data []byte, fee *big.Int, promptKey string, promptScheduler common.Address, modelId uint32) (*types.Transaction, error) { return _EternalAIKB721.Contract.Mint(&_EternalAIKB721.TransactOpts, to, uri, data, fee, promptKey, promptScheduler, modelId) } // Pause is a paid mutator transaction binding the contract method 0x8456cb59. // // Solidity: function pause() returns() func (_EternalAIKB721 *EternalAIKB721Transactor) Pause(opts *bind.TransactOpts) (*types.Transaction, error) { return _EternalAIKB721.contract.Transact(opts, "pause") } // Pause is a paid mutator transaction binding the contract method 0x8456cb59. // // Solidity: function pause() returns() func (_EternalAIKB721 *EternalAIKB721Session) Pause() (*types.Transaction, error) { return _EternalAIKB721.Contract.Pause(&_EternalAIKB721.TransactOpts) } // Pause is a paid mutator transaction binding the contract method 0x8456cb59. // // Solidity: function pause() returns() func (_EternalAIKB721 *EternalAIKB721TransactorSession) Pause() (*types.Transaction, error) { return _EternalAIKB721.Contract.Pause(&_EternalAIKB721.TransactOpts) } // RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. // // Solidity: function renounceOwnership() returns() func (_EternalAIKB721 *EternalAIKB721Transactor) RenounceOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { return _EternalAIKB721.contract.Transact(opts, "renounceOwnership") } // RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. // // Solidity: function renounceOwnership() returns() func (_EternalAIKB721 *EternalAIKB721Session) RenounceOwnership() (*types.Transaction, error) { return _EternalAIKB721.Contract.RenounceOwnership(&_EternalAIKB721.TransactOpts) } // RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. // // Solidity: function renounceOwnership() returns() func (_EternalAIKB721 *EternalAIKB721TransactorSession) RenounceOwnership() (*types.Transaction, error) { return _EternalAIKB721.Contract.RenounceOwnership(&_EternalAIKB721.TransactOpts) } // Retrieve is a paid mutator transaction binding the contract method 0xb81c45b3. // // Solidity: function retrieve(uint256 agentId, bytes fwdCalldata, string externalData, string promptKey, uint256 feeAmount) returns() func (_EternalAIKB721 *EternalAIKB721Transactor) Retrieve(opts *bind.TransactOpts, agentId *big.Int, fwdCalldata []byte, externalData string, promptKey string, feeAmount *big.Int) (*types.Transaction, error) { return _EternalAIKB721.contract.Transact(opts, "retrieve", agentId, fwdCalldata, externalData, promptKey, feeAmount) } // Retrieve is a paid mutator transaction binding the contract method 0xb81c45b3. // // Solidity: function retrieve(uint256 agentId, bytes fwdCalldata, string externalData, string promptKey, uint256 feeAmount) returns() func (_EternalAIKB721 *EternalAIKB721Session) Retrieve(agentId *big.Int, fwdCalldata []byte, externalData string, promptKey string, feeAmount *big.Int) (*types.Transaction, error) { return _EternalAIKB721.Contract.Retrieve(&_EternalAIKB721.TransactOpts, agentId, fwdCalldata, externalData, promptKey, feeAmount) } // Retrieve is a paid mutator transaction binding the contract method 0xb81c45b3. // // Solidity: function retrieve(uint256 agentId, bytes fwdCalldata, string externalData, string promptKey, uint256 feeAmount) returns() func (_EternalAIKB721 *EternalAIKB721TransactorSession) Retrieve(agentId *big.Int, fwdCalldata []byte, externalData string, promptKey string, feeAmount *big.Int) (*types.Transaction, error) { return _EternalAIKB721.Contract.Retrieve(&_EternalAIKB721.TransactOpts, agentId, fwdCalldata, externalData, promptKey, feeAmount) } // Retrieve0 is a paid mutator transaction binding the contract method 0xc405a6ab. // // Solidity: function retrieve(uint256 agentId, bytes fwdCalldata, string externalData, string promptKey, bool flag, uint256 feeAmount) returns() func (_EternalAIKB721 *EternalAIKB721Transactor) Retrieve0(opts *bind.TransactOpts, agentId *big.Int, fwdCalldata []byte, externalData string, promptKey string, flag bool, feeAmount *big.Int) (*types.Transaction, error) { return _EternalAIKB721.contract.Transact(opts, "retrieve0", agentId, fwdCalldata, externalData, promptKey, flag, feeAmount) } // Retrieve0 is a paid mutator transaction binding the contract method 0xc405a6ab. // // Solidity: function retrieve(uint256 agentId, bytes fwdCalldata, string externalData, string promptKey, bool flag, uint256 feeAmount) returns() func (_EternalAIKB721 *EternalAIKB721Session) Retrieve0(agentId *big.Int, fwdCalldata []byte, externalData string, promptKey string, flag bool, feeAmount *big.Int) (*types.Transaction, error) { return _EternalAIKB721.Contract.Retrieve0(&_EternalAIKB721.TransactOpts, agentId, fwdCalldata, externalData, promptKey, flag, feeAmount) } // Retrieve0 is a paid mutator transaction binding the contract method 0xc405a6ab. // // Solidity: function retrieve(uint256 agentId, bytes fwdCalldata, string externalData, string promptKey, bool flag, uint256 feeAmount) returns() func (_EternalAIKB721 *EternalAIKB721TransactorSession) Retrieve0(agentId *big.Int, fwdCalldata []byte, externalData string, promptKey string, flag bool, feeAmount *big.Int) (*types.Transaction, error) { return _EternalAIKB721.Contract.Retrieve0(&_EternalAIKB721.TransactOpts, agentId, fwdCalldata, externalData, promptKey, flag, feeAmount) } // SafeTransferFrom is a paid mutator transaction binding the contract method 0x42842e0e. // // Solidity: function safeTransferFrom(address from, address to, uint256 tokenId) returns() func (_EternalAIKB721 *EternalAIKB721Transactor) SafeTransferFrom(opts *bind.TransactOpts, from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _EternalAIKB721.contract.Transact(opts, "safeTransferFrom", from, to, tokenId) } // SafeTransferFrom is a paid mutator transaction binding the contract method 0x42842e0e. // // Solidity: function safeTransferFrom(address from, address to, uint256 tokenId) returns() func (_EternalAIKB721 *EternalAIKB721Session) SafeTransferFrom(from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _EternalAIKB721.Contract.SafeTransferFrom(&_EternalAIKB721.TransactOpts, from, to, tokenId) } // SafeTransferFrom is a paid mutator transaction binding the contract method 0x42842e0e. // // Solidity: function safeTransferFrom(address from, address to, uint256 tokenId) returns() func (_EternalAIKB721 *EternalAIKB721TransactorSession) SafeTransferFrom(from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _EternalAIKB721.Contract.SafeTransferFrom(&_EternalAIKB721.TransactOpts, from, to, tokenId) } // SafeTransferFrom0 is a paid mutator transaction binding the contract method 0xb88d4fde. // // Solidity: function safeTransferFrom(address from, address to, uint256 tokenId, bytes data) returns() func (_EternalAIKB721 *EternalAIKB721Transactor) SafeTransferFrom0(opts *bind.TransactOpts, from common.Address, to common.Address, tokenId *big.Int, data []byte) (*types.Transaction, error) { return _EternalAIKB721.contract.Transact(opts, "safeTransferFrom0", from, to, tokenId, data) } // SafeTransferFrom0 is a paid mutator transaction binding the contract method 0xb88d4fde. // // Solidity: function safeTransferFrom(address from, address to, uint256 tokenId, bytes data) returns() func (_EternalAIKB721 *EternalAIKB721Session) SafeTransferFrom0(from common.Address, to common.Address, tokenId *big.Int, data []byte) (*types.Transaction, error) { return _EternalAIKB721.Contract.SafeTransferFrom0(&_EternalAIKB721.TransactOpts, from, to, tokenId, data) } // SafeTransferFrom0 is a paid mutator transaction binding the contract method 0xb88d4fde. // // Solidity: function safeTransferFrom(address from, address to, uint256 tokenId, bytes data) returns() func (_EternalAIKB721 *EternalAIKB721TransactorSession) SafeTransferFrom0(from common.Address, to common.Address, tokenId *big.Int, data []byte) (*types.Transaction, error) { return _EternalAIKB721.Contract.SafeTransferFrom0(&_EternalAIKB721.TransactOpts, from, to, tokenId, data) } // SetApprovalForAll is a paid mutator transaction binding the contract method 0xa22cb465. // // Solidity: function setApprovalForAll(address operator, bool approved) returns() func (_EternalAIKB721 *EternalAIKB721Transactor) SetApprovalForAll(opts *bind.TransactOpts, operator common.Address, approved bool) (*types.Transaction, error) { return _EternalAIKB721.contract.Transact(opts, "setApprovalForAll", operator, approved) } // SetApprovalForAll is a paid mutator transaction binding the contract method 0xa22cb465. // // Solidity: function setApprovalForAll(address operator, bool approved) returns() func (_EternalAIKB721 *EternalAIKB721Session) SetApprovalForAll(operator common.Address, approved bool) (*types.Transaction, error) { return _EternalAIKB721.Contract.SetApprovalForAll(&_EternalAIKB721.TransactOpts, operator, approved) } // SetApprovalForAll is a paid mutator transaction binding the contract method 0xa22cb465. // // Solidity: function setApprovalForAll(address operator, bool approved) returns() func (_EternalAIKB721 *EternalAIKB721TransactorSession) SetApprovalForAll(operator common.Address, approved bool) (*types.Transaction, error) { return _EternalAIKB721.Contract.SetApprovalForAll(&_EternalAIKB721.TransactOpts, operator, approved) } // TopUpPoolBalance is a paid mutator transaction binding the contract method 0x67b611a0. // // Solidity: function topUpPoolBalance(uint256 agentId, uint256 amount) returns() func (_EternalAIKB721 *EternalAIKB721Transactor) TopUpPoolBalance(opts *bind.TransactOpts, agentId *big.Int, amount *big.Int) (*types.Transaction, error) { return _EternalAIKB721.contract.Transact(opts, "topUpPoolBalance", agentId, amount) } // TopUpPoolBalance is a paid mutator transaction binding the contract method 0x67b611a0. // // Solidity: function topUpPoolBalance(uint256 agentId, uint256 amount) returns() func (_EternalAIKB721 *EternalAIKB721Session) TopUpPoolBalance(agentId *big.Int, amount *big.Int) (*types.Transaction, error) { return _EternalAIKB721.Contract.TopUpPoolBalance(&_EternalAIKB721.TransactOpts, agentId, amount) } // TopUpPoolBalance is a paid mutator transaction binding the contract method 0x67b611a0. // // Solidity: function topUpPoolBalance(uint256 agentId, uint256 amount) returns() func (_EternalAIKB721 *EternalAIKB721TransactorSession) TopUpPoolBalance(agentId *big.Int, amount *big.Int) (*types.Transaction, error) { return _EternalAIKB721.Contract.TopUpPoolBalance(&_EternalAIKB721.TransactOpts, agentId, amount) } // TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. // // Solidity: function transferFrom(address from, address to, uint256 tokenId) returns() func (_EternalAIKB721 *EternalAIKB721Transactor) TransferFrom(opts *bind.TransactOpts, from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _EternalAIKB721.contract.Transact(opts, "transferFrom", from, to, tokenId) } // TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. // // Solidity: function transferFrom(address from, address to, uint256 tokenId) returns() func (_EternalAIKB721 *EternalAIKB721Session) TransferFrom(from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _EternalAIKB721.Contract.TransferFrom(&_EternalAIKB721.TransactOpts, from, to, tokenId) } // TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. // // Solidity: function transferFrom(address from, address to, uint256 tokenId) returns() func (_EternalAIKB721 *EternalAIKB721TransactorSession) TransferFrom(from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _EternalAIKB721.Contract.TransferFrom(&_EternalAIKB721.TransactOpts, from, to, tokenId) } // TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. // // Solidity: function transferOwnership(address newOwner) returns() func (_EternalAIKB721 *EternalAIKB721Transactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) { return _EternalAIKB721.contract.Transact(opts, "transferOwnership", newOwner) } // TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. // // Solidity: function transferOwnership(address newOwner) returns() func (_EternalAIKB721 *EternalAIKB721Session) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { return _EternalAIKB721.Contract.TransferOwnership(&_EternalAIKB721.TransactOpts, newOwner) } // TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. // // Solidity: function transferOwnership(address newOwner) returns() func (_EternalAIKB721 *EternalAIKB721TransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { return _EternalAIKB721.Contract.TransferOwnership(&_EternalAIKB721.TransactOpts, newOwner) } // Unpause is a paid mutator transaction binding the contract method 0x3f4ba83a. // // Solidity: function unpause() returns() func (_EternalAIKB721 *EternalAIKB721Transactor) Unpause(opts *bind.TransactOpts) (*types.Transaction, error) { return _EternalAIKB721.contract.Transact(opts, "unpause") } // Unpause is a paid mutator transaction binding the contract method 0x3f4ba83a. // // Solidity: function unpause() returns() func (_EternalAIKB721 *EternalAIKB721Session) Unpause() (*types.Transaction, error) { return _EternalAIKB721.Contract.Unpause(&_EternalAIKB721.TransactOpts) } // Unpause is a paid mutator transaction binding the contract method 0x3f4ba83a. // // Solidity: function unpause() returns() func (_EternalAIKB721 *EternalAIKB721TransactorSession) Unpause() (*types.Transaction, error) { return _EternalAIKB721.Contract.Unpause(&_EternalAIKB721.TransactOpts) } // UpdateAgentData is a paid mutator transaction binding the contract method 0xe96177c4. // // Solidity: function updateAgentData(uint256 agentId, bytes sysPrompt, string promptKey, uint256 promptIdx) returns() func (_EternalAIKB721 *EternalAIKB721Transactor) UpdateAgentData(opts *bind.TransactOpts, agentId *big.Int, sysPrompt []byte, promptKey string, promptIdx *big.Int) (*types.Transaction, error) { return _EternalAIKB721.contract.Transact(opts, "updateAgentData", agentId, sysPrompt, promptKey, promptIdx) } // UpdateAgentData is a paid mutator transaction binding the contract method 0xe96177c4. // // Solidity: function updateAgentData(uint256 agentId, bytes sysPrompt, string promptKey, uint256 promptIdx) returns() func (_EternalAIKB721 *EternalAIKB721Session) UpdateAgentData(agentId *big.Int, sysPrompt []byte, promptKey string, promptIdx *big.Int) (*types.Transaction, error) { return _EternalAIKB721.Contract.UpdateAgentData(&_EternalAIKB721.TransactOpts, agentId, sysPrompt, promptKey, promptIdx) } // UpdateAgentData is a paid mutator transaction binding the contract method 0xe96177c4. // // Solidity: function updateAgentData(uint256 agentId, bytes sysPrompt, string promptKey, uint256 promptIdx) returns() func (_EternalAIKB721 *EternalAIKB721TransactorSession) UpdateAgentData(agentId *big.Int, sysPrompt []byte, promptKey string, promptIdx *big.Int) (*types.Transaction, error) { return _EternalAIKB721.Contract.UpdateAgentData(&_EternalAIKB721.TransactOpts, agentId, sysPrompt, promptKey, promptIdx) } // UpdateAgentDataWithSignature is a paid mutator transaction binding the contract method 0x1c83fb2c. // // Solidity: function updateAgentDataWithSignature(uint256 agentId, bytes sysPrompt, string promptKey, uint256 promptIdx, uint256 randomNonce, bytes signature) returns() func (_EternalAIKB721 *EternalAIKB721Transactor) UpdateAgentDataWithSignature(opts *bind.TransactOpts, agentId *big.Int, sysPrompt []byte, promptKey string, promptIdx *big.Int, randomNonce *big.Int, signature []byte) (*types.Transaction, error) { return _EternalAIKB721.contract.Transact(opts, "updateAgentDataWithSignature", agentId, sysPrompt, promptKey, promptIdx, randomNonce, signature) } // UpdateAgentDataWithSignature is a paid mutator transaction binding the contract method 0x1c83fb2c. // // Solidity: function updateAgentDataWithSignature(uint256 agentId, bytes sysPrompt, string promptKey, uint256 promptIdx, uint256 randomNonce, bytes signature) returns() func (_EternalAIKB721 *EternalAIKB721Session) UpdateAgentDataWithSignature(agentId *big.Int, sysPrompt []byte, promptKey string, promptIdx *big.Int, randomNonce *big.Int, signature []byte) (*types.Transaction, error) { return _EternalAIKB721.Contract.UpdateAgentDataWithSignature(&_EternalAIKB721.TransactOpts, agentId, sysPrompt, promptKey, promptIdx, randomNonce, signature) } // UpdateAgentDataWithSignature is a paid mutator transaction binding the contract method 0x1c83fb2c. // // Solidity: function updateAgentDataWithSignature(uint256 agentId, bytes sysPrompt, string promptKey, uint256 promptIdx, uint256 randomNonce, bytes signature) returns() func (_EternalAIKB721 *EternalAIKB721TransactorSession) UpdateAgentDataWithSignature(agentId *big.Int, sysPrompt []byte, promptKey string, promptIdx *big.Int, randomNonce *big.Int, signature []byte) (*types.Transaction, error) { return _EternalAIKB721.Contract.UpdateAgentDataWithSignature(&_EternalAIKB721.TransactOpts, agentId, sysPrompt, promptKey, promptIdx, randomNonce, signature) } // UpdateAgentFee is a paid mutator transaction binding the contract method 0xb1fd1526. // // Solidity: function updateAgentFee(uint256 agentId, uint256 fee) returns() func (_EternalAIKB721 *EternalAIKB721Transactor) UpdateAgentFee(opts *bind.TransactOpts, agentId *big.Int, fee *big.Int) (*types.Transaction, error) { return _EternalAIKB721.contract.Transact(opts, "updateAgentFee", agentId, fee) } // UpdateAgentFee is a paid mutator transaction binding the contract method 0xb1fd1526. // // Solidity: function updateAgentFee(uint256 agentId, uint256 fee) returns() func (_EternalAIKB721 *EternalAIKB721Session) UpdateAgentFee(agentId *big.Int, fee *big.Int) (*types.Transaction, error) { return _EternalAIKB721.Contract.UpdateAgentFee(&_EternalAIKB721.TransactOpts, agentId, fee) } // UpdateAgentFee is a paid mutator transaction binding the contract method 0xb1fd1526. // // Solidity: function updateAgentFee(uint256 agentId, uint256 fee) returns() func (_EternalAIKB721 *EternalAIKB721TransactorSession) UpdateAgentFee(agentId *big.Int, fee *big.Int) (*types.Transaction, error) { return _EternalAIKB721.Contract.UpdateAgentFee(&_EternalAIKB721.TransactOpts, agentId, fee) } // UpdateAgentModelId is a paid mutator transaction binding the contract method 0x0ffc8cf4. // // Solidity: function updateAgentModelId(uint256 agentId, uint32 newModelId) returns() func (_EternalAIKB721 *EternalAIKB721Transactor) UpdateAgentModelId(opts *bind.TransactOpts, agentId *big.Int, newModelId uint32) (*types.Transaction, error) { return _EternalAIKB721.contract.Transact(opts, "updateAgentModelId", agentId, newModelId) } // UpdateAgentModelId is a paid mutator transaction binding the contract method 0x0ffc8cf4. // // Solidity: function updateAgentModelId(uint256 agentId, uint32 newModelId) returns() func (_EternalAIKB721 *EternalAIKB721Session) UpdateAgentModelId(agentId *big.Int, newModelId uint32) (*types.Transaction, error) { return _EternalAIKB721.Contract.UpdateAgentModelId(&_EternalAIKB721.TransactOpts, agentId, newModelId) } // UpdateAgentModelId is a paid mutator transaction binding the contract method 0x0ffc8cf4. // // Solidity: function updateAgentModelId(uint256 agentId, uint32 newModelId) returns() func (_EternalAIKB721 *EternalAIKB721TransactorSession) UpdateAgentModelId(agentId *big.Int, newModelId uint32) (*types.Transaction, error) { return _EternalAIKB721.Contract.UpdateAgentModelId(&_EternalAIKB721.TransactOpts, agentId, newModelId) } // UpdateAgentURI is a paid mutator transaction binding the contract method 0x6b595822. // // Solidity: function updateAgentURI(uint256 agentId, string uri) returns() func (_EternalAIKB721 *EternalAIKB721Transactor) UpdateAgentURI(opts *bind.TransactOpts, agentId *big.Int, uri string) (*types.Transaction, error) { return _EternalAIKB721.contract.Transact(opts, "updateAgentURI", agentId, uri) } // UpdateAgentURI is a paid mutator transaction binding the contract method 0x6b595822. // // Solidity: function updateAgentURI(uint256 agentId, string uri) returns() func (_EternalAIKB721 *EternalAIKB721Session) UpdateAgentURI(agentId *big.Int, uri string) (*types.Transaction, error) { return _EternalAIKB721.Contract.UpdateAgentURI(&_EternalAIKB721.TransactOpts, agentId, uri) } // UpdateAgentURI is a paid mutator transaction binding the contract method 0x6b595822. // // Solidity: function updateAgentURI(uint256 agentId, string uri) returns() func (_EternalAIKB721 *EternalAIKB721TransactorSession) UpdateAgentURI(agentId *big.Int, uri string) (*types.Transaction, error) { return _EternalAIKB721.Contract.UpdateAgentURI(&_EternalAIKB721.TransactOpts, agentId, uri) } // UpdateAgentUriWithSignature is a paid mutator transaction binding the contract method 0xf5888779. // // Solidity: function updateAgentUriWithSignature(uint256 agentId, string uri, uint256 randomNonce, bytes signature) returns() func (_EternalAIKB721 *EternalAIKB721Transactor) UpdateAgentUriWithSignature(opts *bind.TransactOpts, agentId *big.Int, uri string, randomNonce *big.Int, signature []byte) (*types.Transaction, error) { return _EternalAIKB721.contract.Transact(opts, "updateAgentUriWithSignature", agentId, uri, randomNonce, signature) } // UpdateAgentUriWithSignature is a paid mutator transaction binding the contract method 0xf5888779. // // Solidity: function updateAgentUriWithSignature(uint256 agentId, string uri, uint256 randomNonce, bytes signature) returns() func (_EternalAIKB721 *EternalAIKB721Session) UpdateAgentUriWithSignature(agentId *big.Int, uri string, randomNonce *big.Int, signature []byte) (*types.Transaction, error) { return _EternalAIKB721.Contract.UpdateAgentUriWithSignature(&_EternalAIKB721.TransactOpts, agentId, uri, randomNonce, signature) } // UpdateAgentUriWithSignature is a paid mutator transaction binding the contract method 0xf5888779. // // Solidity: function updateAgentUriWithSignature(uint256 agentId, string uri, uint256 randomNonce, bytes signature) returns() func (_EternalAIKB721 *EternalAIKB721TransactorSession) UpdateAgentUriWithSignature(agentId *big.Int, uri string, randomNonce *big.Int, signature []byte) (*types.Transaction, error) { return _EternalAIKB721.Contract.UpdateAgentUriWithSignature(&_EternalAIKB721.TransactOpts, agentId, uri, randomNonce, signature) } // UpdateGPUManager is a paid mutator transaction binding the contract method 0x88ee5fb2. // // Solidity: function updateGPUManager(address gpuManager) returns() func (_EternalAIKB721 *EternalAIKB721Transactor) UpdateGPUManager(opts *bind.TransactOpts, gpuManager common.Address) (*types.Transaction, error) { return _EternalAIKB721.contract.Transact(opts, "updateGPUManager", gpuManager) } // UpdateGPUManager is a paid mutator transaction binding the contract method 0x88ee5fb2. // // Solidity: function updateGPUManager(address gpuManager) returns() func (_EternalAIKB721 *EternalAIKB721Session) UpdateGPUManager(gpuManager common.Address) (*types.Transaction, error) { return _EternalAIKB721.Contract.UpdateGPUManager(&_EternalAIKB721.TransactOpts, gpuManager) } // UpdateGPUManager is a paid mutator transaction binding the contract method 0x88ee5fb2. // // Solidity: function updateGPUManager(address gpuManager) returns() func (_EternalAIKB721 *EternalAIKB721TransactorSession) UpdateGPUManager(gpuManager common.Address) (*types.Transaction, error) { return _EternalAIKB721.Contract.UpdateGPUManager(&_EternalAIKB721.TransactOpts, gpuManager) } // UpdateMintPrice is a paid mutator transaction binding the contract method 0x00728e46. // // Solidity: function updateMintPrice(uint256 mintPrice) returns() func (_EternalAIKB721 *EternalAIKB721Transactor) UpdateMintPrice(opts *bind.TransactOpts, mintPrice *big.Int) (*types.Transaction, error) { return _EternalAIKB721.contract.Transact(opts, "updateMintPrice", mintPrice) } // UpdateMintPrice is a paid mutator transaction binding the contract method 0x00728e46. // // Solidity: function updateMintPrice(uint256 mintPrice) returns() func (_EternalAIKB721 *EternalAIKB721Session) UpdateMintPrice(mintPrice *big.Int) (*types.Transaction, error) { return _EternalAIKB721.Contract.UpdateMintPrice(&_EternalAIKB721.TransactOpts, mintPrice) } // UpdateMintPrice is a paid mutator transaction binding the contract method 0x00728e46. // // Solidity: function updateMintPrice(uint256 mintPrice) returns() func (_EternalAIKB721 *EternalAIKB721TransactorSession) UpdateMintPrice(mintPrice *big.Int) (*types.Transaction, error) { return _EternalAIKB721.Contract.UpdateMintPrice(&_EternalAIKB721.TransactOpts, mintPrice) } // UpdateRoyaltyPortion is a paid mutator transaction binding the contract method 0x19e93993. // // Solidity: function updateRoyaltyPortion(uint16 royaltyPortion) returns() func (_EternalAIKB721 *EternalAIKB721Transactor) UpdateRoyaltyPortion(opts *bind.TransactOpts, royaltyPortion uint16) (*types.Transaction, error) { return _EternalAIKB721.contract.Transact(opts, "updateRoyaltyPortion", royaltyPortion) } // UpdateRoyaltyPortion is a paid mutator transaction binding the contract method 0x19e93993. // // Solidity: function updateRoyaltyPortion(uint16 royaltyPortion) returns() func (_EternalAIKB721 *EternalAIKB721Session) UpdateRoyaltyPortion(royaltyPortion uint16) (*types.Transaction, error) { return _EternalAIKB721.Contract.UpdateRoyaltyPortion(&_EternalAIKB721.TransactOpts, royaltyPortion) } // UpdateRoyaltyPortion is a paid mutator transaction binding the contract method 0x19e93993. // // Solidity: function updateRoyaltyPortion(uint16 royaltyPortion) returns() func (_EternalAIKB721 *EternalAIKB721TransactorSession) UpdateRoyaltyPortion(royaltyPortion uint16) (*types.Transaction, error) { return _EternalAIKB721.Contract.UpdateRoyaltyPortion(&_EternalAIKB721.TransactOpts, royaltyPortion) } // UpdateRoyaltyReceiver is a paid mutator transaction binding the contract method 0x29dc4d9b. // // Solidity: function updateRoyaltyReceiver(address royaltyReceiver) returns() func (_EternalAIKB721 *EternalAIKB721Transactor) UpdateRoyaltyReceiver(opts *bind.TransactOpts, royaltyReceiver common.Address) (*types.Transaction, error) { return _EternalAIKB721.contract.Transact(opts, "updateRoyaltyReceiver", royaltyReceiver) } // UpdateRoyaltyReceiver is a paid mutator transaction binding the contract method 0x29dc4d9b. // // Solidity: function updateRoyaltyReceiver(address royaltyReceiver) returns() func (_EternalAIKB721 *EternalAIKB721Session) UpdateRoyaltyReceiver(royaltyReceiver common.Address) (*types.Transaction, error) { return _EternalAIKB721.Contract.UpdateRoyaltyReceiver(&_EternalAIKB721.TransactOpts, royaltyReceiver) } // UpdateRoyaltyReceiver is a paid mutator transaction binding the contract method 0x29dc4d9b. // // Solidity: function updateRoyaltyReceiver(address royaltyReceiver) returns() func (_EternalAIKB721 *EternalAIKB721TransactorSession) UpdateRoyaltyReceiver(royaltyReceiver common.Address) (*types.Transaction, error) { return _EternalAIKB721.Contract.UpdateRoyaltyReceiver(&_EternalAIKB721.TransactOpts, royaltyReceiver) } // UpdateSchedulePrompt is a paid mutator transaction binding the contract method 0x1ddbc69a. // // Solidity: function updateSchedulePrompt(uint256 agentId, address newPromptScheduler) returns() func (_EternalAIKB721 *EternalAIKB721Transactor) UpdateSchedulePrompt(opts *bind.TransactOpts, agentId *big.Int, newPromptScheduler common.Address) (*types.Transaction, error) { return _EternalAIKB721.contract.Transact(opts, "updateSchedulePrompt", agentId, newPromptScheduler) } // UpdateSchedulePrompt is a paid mutator transaction binding the contract method 0x1ddbc69a. // // Solidity: function updateSchedulePrompt(uint256 agentId, address newPromptScheduler) returns() func (_EternalAIKB721 *EternalAIKB721Session) UpdateSchedulePrompt(agentId *big.Int, newPromptScheduler common.Address) (*types.Transaction, error) { return _EternalAIKB721.Contract.UpdateSchedulePrompt(&_EternalAIKB721.TransactOpts, agentId, newPromptScheduler) } // UpdateSchedulePrompt is a paid mutator transaction binding the contract method 0x1ddbc69a. // // Solidity: function updateSchedulePrompt(uint256 agentId, address newPromptScheduler) returns() func (_EternalAIKB721 *EternalAIKB721TransactorSession) UpdateSchedulePrompt(agentId *big.Int, newPromptScheduler common.Address) (*types.Transaction, error) { return _EternalAIKB721.Contract.UpdateSchedulePrompt(&_EternalAIKB721.TransactOpts, agentId, newPromptScheduler) } // EternalAIKB721AgentDataAddNewIterator is returned from FilterAgentDataAddNew and is used to iterate over the raw logs and unpacked data for AgentDataAddNew events raised by the EternalAIKB721 contract. type EternalAIKB721AgentDataAddNewIterator struct { Event *EternalAIKB721AgentDataAddNew // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *EternalAIKB721AgentDataAddNewIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(EternalAIKB721AgentDataAddNew) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(EternalAIKB721AgentDataAddNew) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *EternalAIKB721AgentDataAddNewIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *EternalAIKB721AgentDataAddNewIterator) Close() error { it.sub.Unsubscribe() return nil } // EternalAIKB721AgentDataAddNew represents a AgentDataAddNew event raised by the EternalAIKB721 contract. type EternalAIKB721AgentDataAddNew struct { AgentId *big.Int SysPrompt [][]byte Raw types.Log // Blockchain specific contextual infos } // FilterAgentDataAddNew is a free log retrieval operation binding the contract event 0xdebec4c58e3b7c5817893e50cb1f9e65b65978e8c89bb4407eb0109d5887b258. // // Solidity: event AgentDataAddNew(uint256 indexed agentId, bytes[] sysPrompt) func (_EternalAIKB721 *EternalAIKB721Filterer) FilterAgentDataAddNew(opts *bind.FilterOpts, agentId []*big.Int) (*EternalAIKB721AgentDataAddNewIterator, error) { var agentIdRule []interface{} for _, agentIdItem := range agentId { agentIdRule = append(agentIdRule, agentIdItem) } logs, sub, err := _EternalAIKB721.contract.FilterLogs(opts, "AgentDataAddNew", agentIdRule) if err != nil { return nil, err } return &EternalAIKB721AgentDataAddNewIterator{contract: _EternalAIKB721.contract, event: "AgentDataAddNew", logs: logs, sub: sub}, nil } // WatchAgentDataAddNew is a free log subscription operation binding the contract event 0xdebec4c58e3b7c5817893e50cb1f9e65b65978e8c89bb4407eb0109d5887b258. // // Solidity: event AgentDataAddNew(uint256 indexed agentId, bytes[] sysPrompt) func (_EternalAIKB721 *EternalAIKB721Filterer) WatchAgentDataAddNew(opts *bind.WatchOpts, sink chan<- *EternalAIKB721AgentDataAddNew, agentId []*big.Int) (event.Subscription, error) { var agentIdRule []interface{} for _, agentIdItem := range agentId { agentIdRule = append(agentIdRule, agentIdItem) } logs, sub, err := _EternalAIKB721.contract.WatchLogs(opts, "AgentDataAddNew", agentIdRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(EternalAIKB721AgentDataAddNew) if err := _EternalAIKB721.contract.UnpackLog(event, "AgentDataAddNew", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseAgentDataAddNew is a log parse operation binding the contract event 0xdebec4c58e3b7c5817893e50cb1f9e65b65978e8c89bb4407eb0109d5887b258. // // Solidity: event AgentDataAddNew(uint256 indexed agentId, bytes[] sysPrompt) func (_EternalAIKB721 *EternalAIKB721Filterer) ParseAgentDataAddNew(log types.Log) (*EternalAIKB721AgentDataAddNew, error) { event := new(EternalAIKB721AgentDataAddNew) if err := _EternalAIKB721.contract.UnpackLog(event, "AgentDataAddNew", log); err != nil { return nil, err } event.Raw = log return event, nil } // EternalAIKB721AgentDataUpdateIterator is returned from FilterAgentDataUpdate and is used to iterate over the raw logs and unpacked data for AgentDataUpdate events raised by the EternalAIKB721 contract. type EternalAIKB721AgentDataUpdateIterator struct { Event *EternalAIKB721AgentDataUpdate // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *EternalAIKB721AgentDataUpdateIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(EternalAIKB721AgentDataUpdate) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(EternalAIKB721AgentDataUpdate) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *EternalAIKB721AgentDataUpdateIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *EternalAIKB721AgentDataUpdateIterator) Close() error { it.sub.Unsubscribe() return nil } // EternalAIKB721AgentDataUpdate represents a AgentDataUpdate event raised by the EternalAIKB721 contract. type EternalAIKB721AgentDataUpdate struct { AgentId *big.Int PromptIndex *big.Int OldSysPrompt []byte NewSysPrompt []byte Raw types.Log // Blockchain specific contextual infos } // FilterAgentDataUpdate is a free log retrieval operation binding the contract event 0xe42abf7d4a793286da8cc1399cb577a1f5a0e133dfee371bb3a5abbdd77b011e. // // Solidity: event AgentDataUpdate(uint256 indexed agentId, uint256 promptIndex, bytes oldSysPrompt, bytes newSysPrompt) func (_EternalAIKB721 *EternalAIKB721Filterer) FilterAgentDataUpdate(opts *bind.FilterOpts, agentId []*big.Int) (*EternalAIKB721AgentDataUpdateIterator, error) { var agentIdRule []interface{} for _, agentIdItem := range agentId { agentIdRule = append(agentIdRule, agentIdItem) } logs, sub, err := _EternalAIKB721.contract.FilterLogs(opts, "AgentDataUpdate", agentIdRule) if err != nil { return nil, err } return &EternalAIKB721AgentDataUpdateIterator{contract: _EternalAIKB721.contract, event: "AgentDataUpdate", logs: logs, sub: sub}, nil } // WatchAgentDataUpdate is a free log subscription operation binding the contract event 0xe42abf7d4a793286da8cc1399cb577a1f5a0e133dfee371bb3a5abbdd77b011e. // // Solidity: event AgentDataUpdate(uint256 indexed agentId, uint256 promptIndex, bytes oldSysPrompt, bytes newSysPrompt) func (_EternalAIKB721 *EternalAIKB721Filterer) WatchAgentDataUpdate(opts *bind.WatchOpts, sink chan<- *EternalAIKB721AgentDataUpdate, agentId []*big.Int) (event.Subscription, error) { var agentIdRule []interface{} for _, agentIdItem := range agentId { agentIdRule = append(agentIdRule, agentIdItem) } logs, sub, err := _EternalAIKB721.contract.WatchLogs(opts, "AgentDataUpdate", agentIdRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(EternalAIKB721AgentDataUpdate) if err := _EternalAIKB721.contract.UnpackLog(event, "AgentDataUpdate", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseAgentDataUpdate is a log parse operation binding the contract event 0xe42abf7d4a793286da8cc1399cb577a1f5a0e133dfee371bb3a5abbdd77b011e. // // Solidity: event AgentDataUpdate(uint256 indexed agentId, uint256 promptIndex, bytes oldSysPrompt, bytes newSysPrompt) func (_EternalAIKB721 *EternalAIKB721Filterer) ParseAgentDataUpdate(log types.Log) (*EternalAIKB721AgentDataUpdate, error) { event := new(EternalAIKB721AgentDataUpdate) if err := _EternalAIKB721.contract.UnpackLog(event, "AgentDataUpdate", log); err != nil { return nil, err } event.Raw = log return event, nil } // EternalAIKB721AgentFeeUpdateIterator is returned from FilterAgentFeeUpdate and is used to iterate over the raw logs and unpacked data for AgentFeeUpdate events raised by the EternalAIKB721 contract. type EternalAIKB721AgentFeeUpdateIterator struct { Event *EternalAIKB721AgentFeeUpdate // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *EternalAIKB721AgentFeeUpdateIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(EternalAIKB721AgentFeeUpdate) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(EternalAIKB721AgentFeeUpdate) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *EternalAIKB721AgentFeeUpdateIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *EternalAIKB721AgentFeeUpdateIterator) Close() error { it.sub.Unsubscribe() return nil } // EternalAIKB721AgentFeeUpdate represents a AgentFeeUpdate event raised by the EternalAIKB721 contract. type EternalAIKB721AgentFeeUpdate struct { AgentId *big.Int Fee *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterAgentFeeUpdate is a free log retrieval operation binding the contract event 0xa08d8197034aee8915921dd8aa7d95cf711690dd77f0b676dded49b3f9a632d1. // // Solidity: event AgentFeeUpdate(uint256 indexed agentId, uint256 fee) func (_EternalAIKB721 *EternalAIKB721Filterer) FilterAgentFeeUpdate(opts *bind.FilterOpts, agentId []*big.Int) (*EternalAIKB721AgentFeeUpdateIterator, error) { var agentIdRule []interface{} for _, agentIdItem := range agentId { agentIdRule = append(agentIdRule, agentIdItem) } logs, sub, err := _EternalAIKB721.contract.FilterLogs(opts, "AgentFeeUpdate", agentIdRule) if err != nil { return nil, err } return &EternalAIKB721AgentFeeUpdateIterator{contract: _EternalAIKB721.contract, event: "AgentFeeUpdate", logs: logs, sub: sub}, nil } // WatchAgentFeeUpdate is a free log subscription operation binding the contract event 0xa08d8197034aee8915921dd8aa7d95cf711690dd77f0b676dded49b3f9a632d1. // // Solidity: event AgentFeeUpdate(uint256 indexed agentId, uint256 fee) func (_EternalAIKB721 *EternalAIKB721Filterer) WatchAgentFeeUpdate(opts *bind.WatchOpts, sink chan<- *EternalAIKB721AgentFeeUpdate, agentId []*big.Int) (event.Subscription, error) { var agentIdRule []interface{} for _, agentIdItem := range agentId { agentIdRule = append(agentIdRule, agentIdItem) } logs, sub, err := _EternalAIKB721.contract.WatchLogs(opts, "AgentFeeUpdate", agentIdRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(EternalAIKB721AgentFeeUpdate) if err := _EternalAIKB721.contract.UnpackLog(event, "AgentFeeUpdate", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseAgentFeeUpdate is a log parse operation binding the contract event 0xa08d8197034aee8915921dd8aa7d95cf711690dd77f0b676dded49b3f9a632d1. // // Solidity: event AgentFeeUpdate(uint256 indexed agentId, uint256 fee) func (_EternalAIKB721 *EternalAIKB721Filterer) ParseAgentFeeUpdate(log types.Log) (*EternalAIKB721AgentFeeUpdate, error) { event := new(EternalAIKB721AgentFeeUpdate) if err := _EternalAIKB721.contract.UnpackLog(event, "AgentFeeUpdate", log); err != nil { return nil, err } event.Raw = log return event, nil } // EternalAIKB721AgentMissionAddNewIterator is returned from FilterAgentMissionAddNew and is used to iterate over the raw logs and unpacked data for AgentMissionAddNew events raised by the EternalAIKB721 contract. type EternalAIKB721AgentMissionAddNewIterator struct { Event *EternalAIKB721AgentMissionAddNew // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *EternalAIKB721AgentMissionAddNewIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(EternalAIKB721AgentMissionAddNew) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(EternalAIKB721AgentMissionAddNew) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *EternalAIKB721AgentMissionAddNewIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *EternalAIKB721AgentMissionAddNewIterator) Close() error { it.sub.Unsubscribe() return nil } // EternalAIKB721AgentMissionAddNew represents a AgentMissionAddNew event raised by the EternalAIKB721 contract. type EternalAIKB721AgentMissionAddNew struct { AgentId *big.Int Missions [][]byte Raw types.Log // Blockchain specific contextual infos } // FilterAgentMissionAddNew is a free log retrieval operation binding the contract event 0x12ccdcc9c8e92b22004686225bd3df163c042e77b03eab4566800d40b5047f91. // // Solidity: event AgentMissionAddNew(uint256 indexed agentId, bytes[] missions) func (_EternalAIKB721 *EternalAIKB721Filterer) FilterAgentMissionAddNew(opts *bind.FilterOpts, agentId []*big.Int) (*EternalAIKB721AgentMissionAddNewIterator, error) { var agentIdRule []interface{} for _, agentIdItem := range agentId { agentIdRule = append(agentIdRule, agentIdItem) } logs, sub, err := _EternalAIKB721.contract.FilterLogs(opts, "AgentMissionAddNew", agentIdRule) if err != nil { return nil, err } return &EternalAIKB721AgentMissionAddNewIterator{contract: _EternalAIKB721.contract, event: "AgentMissionAddNew", logs: logs, sub: sub}, nil } // WatchAgentMissionAddNew is a free log subscription operation binding the contract event 0x12ccdcc9c8e92b22004686225bd3df163c042e77b03eab4566800d40b5047f91. // // Solidity: event AgentMissionAddNew(uint256 indexed agentId, bytes[] missions) func (_EternalAIKB721 *EternalAIKB721Filterer) WatchAgentMissionAddNew(opts *bind.WatchOpts, sink chan<- *EternalAIKB721AgentMissionAddNew, agentId []*big.Int) (event.Subscription, error) { var agentIdRule []interface{} for _, agentIdItem := range agentId { agentIdRule = append(agentIdRule, agentIdItem) } logs, sub, err := _EternalAIKB721.contract.WatchLogs(opts, "AgentMissionAddNew", agentIdRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(EternalAIKB721AgentMissionAddNew) if err := _EternalAIKB721.contract.UnpackLog(event, "AgentMissionAddNew", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseAgentMissionAddNew is a log parse operation binding the contract event 0x12ccdcc9c8e92b22004686225bd3df163c042e77b03eab4566800d40b5047f91. // // Solidity: event AgentMissionAddNew(uint256 indexed agentId, bytes[] missions) func (_EternalAIKB721 *EternalAIKB721Filterer) ParseAgentMissionAddNew(log types.Log) (*EternalAIKB721AgentMissionAddNew, error) { event := new(EternalAIKB721AgentMissionAddNew) if err := _EternalAIKB721.contract.UnpackLog(event, "AgentMissionAddNew", log); err != nil { return nil, err } event.Raw = log return event, nil } // EternalAIKB721AgentMissionUpdateIterator is returned from FilterAgentMissionUpdate and is used to iterate over the raw logs and unpacked data for AgentMissionUpdate events raised by the EternalAIKB721 contract. type EternalAIKB721AgentMissionUpdateIterator struct { Event *EternalAIKB721AgentMissionUpdate // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *EternalAIKB721AgentMissionUpdateIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(EternalAIKB721AgentMissionUpdate) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(EternalAIKB721AgentMissionUpdate) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *EternalAIKB721AgentMissionUpdateIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *EternalAIKB721AgentMissionUpdateIterator) Close() error { it.sub.Unsubscribe() return nil } // EternalAIKB721AgentMissionUpdate represents a AgentMissionUpdate event raised by the EternalAIKB721 contract. type EternalAIKB721AgentMissionUpdate struct { AgentId *big.Int MissionIndex *big.Int OldSysMission []byte NewSysMission []byte Raw types.Log // Blockchain specific contextual infos } // FilterAgentMissionUpdate is a free log retrieval operation binding the contract event 0x0a9b80bd675e3f5788f1a5da687efd147dbc4729245a7f300ce1074bbd535127. // // Solidity: event AgentMissionUpdate(uint256 indexed agentId, uint256 missionIndex, bytes oldSysMission, bytes newSysMission) func (_EternalAIKB721 *EternalAIKB721Filterer) FilterAgentMissionUpdate(opts *bind.FilterOpts, agentId []*big.Int) (*EternalAIKB721AgentMissionUpdateIterator, error) { var agentIdRule []interface{} for _, agentIdItem := range agentId { agentIdRule = append(agentIdRule, agentIdItem) } logs, sub, err := _EternalAIKB721.contract.FilterLogs(opts, "AgentMissionUpdate", agentIdRule) if err != nil { return nil, err } return &EternalAIKB721AgentMissionUpdateIterator{contract: _EternalAIKB721.contract, event: "AgentMissionUpdate", logs: logs, sub: sub}, nil } // WatchAgentMissionUpdate is a free log subscription operation binding the contract event 0x0a9b80bd675e3f5788f1a5da687efd147dbc4729245a7f300ce1074bbd535127. // // Solidity: event AgentMissionUpdate(uint256 indexed agentId, uint256 missionIndex, bytes oldSysMission, bytes newSysMission) func (_EternalAIKB721 *EternalAIKB721Filterer) WatchAgentMissionUpdate(opts *bind.WatchOpts, sink chan<- *EternalAIKB721AgentMissionUpdate, agentId []*big.Int) (event.Subscription, error) { var agentIdRule []interface{} for _, agentIdItem := range agentId { agentIdRule = append(agentIdRule, agentIdItem) } logs, sub, err := _EternalAIKB721.contract.WatchLogs(opts, "AgentMissionUpdate", agentIdRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(EternalAIKB721AgentMissionUpdate) if err := _EternalAIKB721.contract.UnpackLog(event, "AgentMissionUpdate", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseAgentMissionUpdate is a log parse operation binding the contract event 0x0a9b80bd675e3f5788f1a5da687efd147dbc4729245a7f300ce1074bbd535127. // // Solidity: event AgentMissionUpdate(uint256 indexed agentId, uint256 missionIndex, bytes oldSysMission, bytes newSysMission) func (_EternalAIKB721 *EternalAIKB721Filterer) ParseAgentMissionUpdate(log types.Log) (*EternalAIKB721AgentMissionUpdate, error) { event := new(EternalAIKB721AgentMissionUpdate) if err := _EternalAIKB721.contract.UnpackLog(event, "AgentMissionUpdate", log); err != nil { return nil, err } event.Raw = log return event, nil } // EternalAIKB721AgentModelIdUpdateIterator is returned from FilterAgentModelIdUpdate and is used to iterate over the raw logs and unpacked data for AgentModelIdUpdate events raised by the EternalAIKB721 contract. type EternalAIKB721AgentModelIdUpdateIterator struct { Event *EternalAIKB721AgentModelIdUpdate // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *EternalAIKB721AgentModelIdUpdateIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(EternalAIKB721AgentModelIdUpdate) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(EternalAIKB721AgentModelIdUpdate) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *EternalAIKB721AgentModelIdUpdateIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *EternalAIKB721AgentModelIdUpdateIterator) Close() error { it.sub.Unsubscribe() return nil } // EternalAIKB721AgentModelIdUpdate represents a AgentModelIdUpdate event raised by the EternalAIKB721 contract. type EternalAIKB721AgentModelIdUpdate struct { AgentId *big.Int OldModelId *big.Int NewModelId *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterAgentModelIdUpdate is a free log retrieval operation binding the contract event 0xe8662b9bac978d6b361a9cc824ecf5a8ea4cfb61ccbdd24dec6237ee9b7d7fa7. // // Solidity: event AgentModelIdUpdate(uint256 indexed agentId, uint256 oldModelId, uint256 newModelId) func (_EternalAIKB721 *EternalAIKB721Filterer) FilterAgentModelIdUpdate(opts *bind.FilterOpts, agentId []*big.Int) (*EternalAIKB721AgentModelIdUpdateIterator, error) { var agentIdRule []interface{} for _, agentIdItem := range agentId { agentIdRule = append(agentIdRule, agentIdItem) } logs, sub, err := _EternalAIKB721.contract.FilterLogs(opts, "AgentModelIdUpdate", agentIdRule) if err != nil { return nil, err } return &EternalAIKB721AgentModelIdUpdateIterator{contract: _EternalAIKB721.contract, event: "AgentModelIdUpdate", logs: logs, sub: sub}, nil } // WatchAgentModelIdUpdate is a free log subscription operation binding the contract event 0xe8662b9bac978d6b361a9cc824ecf5a8ea4cfb61ccbdd24dec6237ee9b7d7fa7. // // Solidity: event AgentModelIdUpdate(uint256 indexed agentId, uint256 oldModelId, uint256 newModelId) func (_EternalAIKB721 *EternalAIKB721Filterer) WatchAgentModelIdUpdate(opts *bind.WatchOpts, sink chan<- *EternalAIKB721AgentModelIdUpdate, agentId []*big.Int) (event.Subscription, error) { var agentIdRule []interface{} for _, agentIdItem := range agentId { agentIdRule = append(agentIdRule, agentIdItem) } logs, sub, err := _EternalAIKB721.contract.WatchLogs(opts, "AgentModelIdUpdate", agentIdRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(EternalAIKB721AgentModelIdUpdate) if err := _EternalAIKB721.contract.UnpackLog(event, "AgentModelIdUpdate", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseAgentModelIdUpdate is a log parse operation binding the contract event 0xe8662b9bac978d6b361a9cc824ecf5a8ea4cfb61ccbdd24dec6237ee9b7d7fa7. // // Solidity: event AgentModelIdUpdate(uint256 indexed agentId, uint256 oldModelId, uint256 newModelId) func (_EternalAIKB721 *EternalAIKB721Filterer) ParseAgentModelIdUpdate(log types.Log) (*EternalAIKB721AgentModelIdUpdate, error) { event := new(EternalAIKB721AgentModelIdUpdate) if err := _EternalAIKB721.contract.UnpackLog(event, "AgentModelIdUpdate", log); err != nil { return nil, err } event.Raw = log return event, nil } // EternalAIKB721AgentPromptSchedulerdUpdateIterator is returned from FilterAgentPromptSchedulerdUpdate and is used to iterate over the raw logs and unpacked data for AgentPromptSchedulerdUpdate events raised by the EternalAIKB721 contract. type EternalAIKB721AgentPromptSchedulerdUpdateIterator struct { Event *EternalAIKB721AgentPromptSchedulerdUpdate // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *EternalAIKB721AgentPromptSchedulerdUpdateIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(EternalAIKB721AgentPromptSchedulerdUpdate) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(EternalAIKB721AgentPromptSchedulerdUpdate) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *EternalAIKB721AgentPromptSchedulerdUpdateIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *EternalAIKB721AgentPromptSchedulerdUpdateIterator) Close() error { it.sub.Unsubscribe() return nil } // EternalAIKB721AgentPromptSchedulerdUpdate represents a AgentPromptSchedulerdUpdate event raised by the EternalAIKB721 contract. type EternalAIKB721AgentPromptSchedulerdUpdate struct { AgentId *big.Int OldPromptScheduler common.Address NewOldPromptScheduler common.Address Raw types.Log // Blockchain specific contextual infos } // FilterAgentPromptSchedulerdUpdate is a free log retrieval operation binding the contract event 0x668af5d324df41df4dbf51978e1caa591bcf48468550da656523572a47d9abbd. // // Solidity: event AgentPromptSchedulerdUpdate(uint256 indexed agentId, address oldPromptScheduler, address newOldPromptScheduler) func (_EternalAIKB721 *EternalAIKB721Filterer) FilterAgentPromptSchedulerdUpdate(opts *bind.FilterOpts, agentId []*big.Int) (*EternalAIKB721AgentPromptSchedulerdUpdateIterator, error) { var agentIdRule []interface{} for _, agentIdItem := range agentId { agentIdRule = append(agentIdRule, agentIdItem) } logs, sub, err := _EternalAIKB721.contract.FilterLogs(opts, "AgentPromptSchedulerdUpdate", agentIdRule) if err != nil { return nil, err } return &EternalAIKB721AgentPromptSchedulerdUpdateIterator{contract: _EternalAIKB721.contract, event: "AgentPromptSchedulerdUpdate", logs: logs, sub: sub}, nil } // WatchAgentPromptSchedulerdUpdate is a free log subscription operation binding the contract event 0x668af5d324df41df4dbf51978e1caa591bcf48468550da656523572a47d9abbd. // // Solidity: event AgentPromptSchedulerdUpdate(uint256 indexed agentId, address oldPromptScheduler, address newOldPromptScheduler) func (_EternalAIKB721 *EternalAIKB721Filterer) WatchAgentPromptSchedulerdUpdate(opts *bind.WatchOpts, sink chan<- *EternalAIKB721AgentPromptSchedulerdUpdate, agentId []*big.Int) (event.Subscription, error) { var agentIdRule []interface{} for _, agentIdItem := range agentId { agentIdRule = append(agentIdRule, agentIdItem) } logs, sub, err := _EternalAIKB721.contract.WatchLogs(opts, "AgentPromptSchedulerdUpdate", agentIdRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(EternalAIKB721AgentPromptSchedulerdUpdate) if err := _EternalAIKB721.contract.UnpackLog(event, "AgentPromptSchedulerdUpdate", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseAgentPromptSchedulerdUpdate is a log parse operation binding the contract event 0x668af5d324df41df4dbf51978e1caa591bcf48468550da656523572a47d9abbd. // // Solidity: event AgentPromptSchedulerdUpdate(uint256 indexed agentId, address oldPromptScheduler, address newOldPromptScheduler) func (_EternalAIKB721 *EternalAIKB721Filterer) ParseAgentPromptSchedulerdUpdate(log types.Log) (*EternalAIKB721AgentPromptSchedulerdUpdate, error) { event := new(EternalAIKB721AgentPromptSchedulerdUpdate) if err := _EternalAIKB721.contract.UnpackLog(event, "AgentPromptSchedulerdUpdate", log); err != nil { return nil, err } event.Raw = log return event, nil } // EternalAIKB721AgentURIUpdateIterator is returned from FilterAgentURIUpdate and is used to iterate over the raw logs and unpacked data for AgentURIUpdate events raised by the EternalAIKB721 contract. type EternalAIKB721AgentURIUpdateIterator struct { Event *EternalAIKB721AgentURIUpdate // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *EternalAIKB721AgentURIUpdateIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(EternalAIKB721AgentURIUpdate) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(EternalAIKB721AgentURIUpdate) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *EternalAIKB721AgentURIUpdateIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *EternalAIKB721AgentURIUpdateIterator) Close() error { it.sub.Unsubscribe() return nil } // EternalAIKB721AgentURIUpdate represents a AgentURIUpdate event raised by the EternalAIKB721 contract. type EternalAIKB721AgentURIUpdate struct { AgentId *big.Int Uri string Raw types.Log // Blockchain specific contextual infos } // FilterAgentURIUpdate is a free log retrieval operation binding the contract event 0x706a4e8eb2f354c7f4d96e5ea1984f36e72482629987edad78c9940ea037c362. // // Solidity: event AgentURIUpdate(uint256 indexed agentId, string uri) func (_EternalAIKB721 *EternalAIKB721Filterer) FilterAgentURIUpdate(opts *bind.FilterOpts, agentId []*big.Int) (*EternalAIKB721AgentURIUpdateIterator, error) { var agentIdRule []interface{} for _, agentIdItem := range agentId { agentIdRule = append(agentIdRule, agentIdItem) } logs, sub, err := _EternalAIKB721.contract.FilterLogs(opts, "AgentURIUpdate", agentIdRule) if err != nil { return nil, err } return &EternalAIKB721AgentURIUpdateIterator{contract: _EternalAIKB721.contract, event: "AgentURIUpdate", logs: logs, sub: sub}, nil } // WatchAgentURIUpdate is a free log subscription operation binding the contract event 0x706a4e8eb2f354c7f4d96e5ea1984f36e72482629987edad78c9940ea037c362. // // Solidity: event AgentURIUpdate(uint256 indexed agentId, string uri) func (_EternalAIKB721 *EternalAIKB721Filterer) WatchAgentURIUpdate(opts *bind.WatchOpts, sink chan<- *EternalAIKB721AgentURIUpdate, agentId []*big.Int) (event.Subscription, error) { var agentIdRule []interface{} for _, agentIdItem := range agentId { agentIdRule = append(agentIdRule, agentIdItem) } logs, sub, err := _EternalAIKB721.contract.WatchLogs(opts, "AgentURIUpdate", agentIdRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(EternalAIKB721AgentURIUpdate) if err := _EternalAIKB721.contract.UnpackLog(event, "AgentURIUpdate", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseAgentURIUpdate is a log parse operation binding the contract event 0x706a4e8eb2f354c7f4d96e5ea1984f36e72482629987edad78c9940ea037c362. // // Solidity: event AgentURIUpdate(uint256 indexed agentId, string uri) func (_EternalAIKB721 *EternalAIKB721Filterer) ParseAgentURIUpdate(log types.Log) (*EternalAIKB721AgentURIUpdate, error) { event := new(EternalAIKB721AgentURIUpdate) if err := _EternalAIKB721.contract.UnpackLog(event, "AgentURIUpdate", log); err != nil { return nil, err } event.Raw = log return event, nil } // EternalAIKB721ApprovalIterator is returned from FilterApproval and is used to iterate over the raw logs and unpacked data for Approval events raised by the EternalAIKB721 contract. type EternalAIKB721ApprovalIterator struct { Event *EternalAIKB721Approval // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *EternalAIKB721ApprovalIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(EternalAIKB721Approval) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(EternalAIKB721Approval) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *EternalAIKB721ApprovalIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *EternalAIKB721ApprovalIterator) Close() error { it.sub.Unsubscribe() return nil } // EternalAIKB721Approval represents a Approval event raised by the EternalAIKB721 contract. type EternalAIKB721Approval struct { Owner common.Address Approved common.Address TokenId *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterApproval is a free log retrieval operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. // // Solidity: event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId) func (_EternalAIKB721 *EternalAIKB721Filterer) FilterApproval(opts *bind.FilterOpts, owner []common.Address, approved []common.Address, tokenId []*big.Int) (*EternalAIKB721ApprovalIterator, error) { var ownerRule []interface{} for _, ownerItem := range owner { ownerRule = append(ownerRule, ownerItem) } var approvedRule []interface{} for _, approvedItem := range approved { approvedRule = append(approvedRule, approvedItem) } var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _EternalAIKB721.contract.FilterLogs(opts, "Approval", ownerRule, approvedRule, tokenIdRule) if err != nil { return nil, err } return &EternalAIKB721ApprovalIterator{contract: _EternalAIKB721.contract, event: "Approval", logs: logs, sub: sub}, nil } // WatchApproval is a free log subscription operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. // // Solidity: event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId) func (_EternalAIKB721 *EternalAIKB721Filterer) WatchApproval(opts *bind.WatchOpts, sink chan<- *EternalAIKB721Approval, owner []common.Address, approved []common.Address, tokenId []*big.Int) (event.Subscription, error) { var ownerRule []interface{} for _, ownerItem := range owner { ownerRule = append(ownerRule, ownerItem) } var approvedRule []interface{} for _, approvedItem := range approved { approvedRule = append(approvedRule, approvedItem) } var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _EternalAIKB721.contract.WatchLogs(opts, "Approval", ownerRule, approvedRule, tokenIdRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(EternalAIKB721Approval) if err := _EternalAIKB721.contract.UnpackLog(event, "Approval", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseApproval is a log parse operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. // // Solidity: event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId) func (_EternalAIKB721 *EternalAIKB721Filterer) ParseApproval(log types.Log) (*EternalAIKB721Approval, error) { event := new(EternalAIKB721Approval) if err := _EternalAIKB721.contract.UnpackLog(event, "Approval", log); err != nil { return nil, err } event.Raw = log return event, nil } // EternalAIKB721ApprovalForAllIterator is returned from FilterApprovalForAll and is used to iterate over the raw logs and unpacked data for ApprovalForAll events raised by the EternalAIKB721 contract. type EternalAIKB721ApprovalForAllIterator struct { Event *EternalAIKB721ApprovalForAll // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *EternalAIKB721ApprovalForAllIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(EternalAIKB721ApprovalForAll) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(EternalAIKB721ApprovalForAll) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *EternalAIKB721ApprovalForAllIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *EternalAIKB721ApprovalForAllIterator) Close() error { it.sub.Unsubscribe() return nil } // EternalAIKB721ApprovalForAll represents a ApprovalForAll event raised by the EternalAIKB721 contract. type EternalAIKB721ApprovalForAll struct { Owner common.Address Operator common.Address Approved bool Raw types.Log // Blockchain specific contextual infos } // FilterApprovalForAll is a free log retrieval operation binding the contract event 0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31. // // Solidity: event ApprovalForAll(address indexed owner, address indexed operator, bool approved) func (_EternalAIKB721 *EternalAIKB721Filterer) FilterApprovalForAll(opts *bind.FilterOpts, owner []common.Address, operator []common.Address) (*EternalAIKB721ApprovalForAllIterator, error) { var ownerRule []interface{} for _, ownerItem := range owner { ownerRule = append(ownerRule, ownerItem) } var operatorRule []interface{} for _, operatorItem := range operator { operatorRule = append(operatorRule, operatorItem) } logs, sub, err := _EternalAIKB721.contract.FilterLogs(opts, "ApprovalForAll", ownerRule, operatorRule) if err != nil { return nil, err } return &EternalAIKB721ApprovalForAllIterator{contract: _EternalAIKB721.contract, event: "ApprovalForAll", logs: logs, sub: sub}, nil } // WatchApprovalForAll is a free log subscription operation binding the contract event 0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31. // // Solidity: event ApprovalForAll(address indexed owner, address indexed operator, bool approved) func (_EternalAIKB721 *EternalAIKB721Filterer) WatchApprovalForAll(opts *bind.WatchOpts, sink chan<- *EternalAIKB721ApprovalForAll, owner []common.Address, operator []common.Address) (event.Subscription, error) { var ownerRule []interface{} for _, ownerItem := range owner { ownerRule = append(ownerRule, ownerItem) } var operatorRule []interface{} for _, operatorItem := range operator { operatorRule = append(operatorRule, operatorItem) } logs, sub, err := _EternalAIKB721.contract.WatchLogs(opts, "ApprovalForAll", ownerRule, operatorRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(EternalAIKB721ApprovalForAll) if err := _EternalAIKB721.contract.UnpackLog(event, "ApprovalForAll", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseApprovalForAll is a log parse operation binding the contract event 0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31. // // Solidity: event ApprovalForAll(address indexed owner, address indexed operator, bool approved) func (_EternalAIKB721 *EternalAIKB721Filterer) ParseApprovalForAll(log types.Log) (*EternalAIKB721ApprovalForAll, error) { event := new(EternalAIKB721ApprovalForAll) if err := _EternalAIKB721.contract.UnpackLog(event, "ApprovalForAll", log); err != nil { return nil, err } event.Raw = log return event, nil } // EternalAIKB721BatchMetadataUpdateIterator is returned from FilterBatchMetadataUpdate and is used to iterate over the raw logs and unpacked data for BatchMetadataUpdate events raised by the EternalAIKB721 contract. type EternalAIKB721BatchMetadataUpdateIterator struct { Event *EternalAIKB721BatchMetadataUpdate // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *EternalAIKB721BatchMetadataUpdateIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(EternalAIKB721BatchMetadataUpdate) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(EternalAIKB721BatchMetadataUpdate) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *EternalAIKB721BatchMetadataUpdateIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *EternalAIKB721BatchMetadataUpdateIterator) Close() error { it.sub.Unsubscribe() return nil } // EternalAIKB721BatchMetadataUpdate represents a BatchMetadataUpdate event raised by the EternalAIKB721 contract. type EternalAIKB721BatchMetadataUpdate struct { FromTokenId *big.Int ToTokenId *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterBatchMetadataUpdate is a free log retrieval operation binding the contract event 0x6bd5c950a8d8df17f772f5af37cb3655737899cbf903264b9795592da439661c. // // Solidity: event BatchMetadataUpdate(uint256 _fromTokenId, uint256 _toTokenId) func (_EternalAIKB721 *EternalAIKB721Filterer) FilterBatchMetadataUpdate(opts *bind.FilterOpts) (*EternalAIKB721BatchMetadataUpdateIterator, error) { logs, sub, err := _EternalAIKB721.contract.FilterLogs(opts, "BatchMetadataUpdate") if err != nil { return nil, err } return &EternalAIKB721BatchMetadataUpdateIterator{contract: _EternalAIKB721.contract, event: "BatchMetadataUpdate", logs: logs, sub: sub}, nil } // WatchBatchMetadataUpdate is a free log subscription operation binding the contract event 0x6bd5c950a8d8df17f772f5af37cb3655737899cbf903264b9795592da439661c. // // Solidity: event BatchMetadataUpdate(uint256 _fromTokenId, uint256 _toTokenId) func (_EternalAIKB721 *EternalAIKB721Filterer) WatchBatchMetadataUpdate(opts *bind.WatchOpts, sink chan<- *EternalAIKB721BatchMetadataUpdate) (event.Subscription, error) { logs, sub, err := _EternalAIKB721.contract.WatchLogs(opts, "BatchMetadataUpdate") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(EternalAIKB721BatchMetadataUpdate) if err := _EternalAIKB721.contract.UnpackLog(event, "BatchMetadataUpdate", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseBatchMetadataUpdate is a log parse operation binding the contract event 0x6bd5c950a8d8df17f772f5af37cb3655737899cbf903264b9795592da439661c. // // Solidity: event BatchMetadataUpdate(uint256 _fromTokenId, uint256 _toTokenId) func (_EternalAIKB721 *EternalAIKB721Filterer) ParseBatchMetadataUpdate(log types.Log) (*EternalAIKB721BatchMetadataUpdate, error) { event := new(EternalAIKB721BatchMetadataUpdate) if err := _EternalAIKB721.contract.UnpackLog(event, "BatchMetadataUpdate", log); err != nil { return nil, err } event.Raw = log return event, nil } // EternalAIKB721InferencePerformedIterator is returned from FilterInferencePerformed and is used to iterate over the raw logs and unpacked data for InferencePerformed events raised by the EternalAIKB721 contract. type EternalAIKB721InferencePerformedIterator struct { Event *EternalAIKB721InferencePerformed // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *EternalAIKB721InferencePerformedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(EternalAIKB721InferencePerformed) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(EternalAIKB721InferencePerformed) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *EternalAIKB721InferencePerformedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *EternalAIKB721InferencePerformedIterator) Close() error { it.sub.Unsubscribe() return nil } // EternalAIKB721InferencePerformed represents a InferencePerformed event raised by the EternalAIKB721 contract. type EternalAIKB721InferencePerformed struct { TokenId *big.Int Caller common.Address Data []byte Fee *big.Int ExternalData string InferenceId *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterInferencePerformed is a free log retrieval operation binding the contract event 0xcf35460eca25a0549d5eb14c712236d61c9a0bad90c834f996c5f2a98d332719. // // Solidity: event InferencePerformed(uint256 indexed tokenId, address indexed caller, bytes data, uint256 fee, string externalData, uint256 inferenceId) func (_EternalAIKB721 *EternalAIKB721Filterer) FilterInferencePerformed(opts *bind.FilterOpts, tokenId []*big.Int, caller []common.Address) (*EternalAIKB721InferencePerformedIterator, error) { var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } var callerRule []interface{} for _, callerItem := range caller { callerRule = append(callerRule, callerItem) } logs, sub, err := _EternalAIKB721.contract.FilterLogs(opts, "InferencePerformed", tokenIdRule, callerRule) if err != nil { return nil, err } return &EternalAIKB721InferencePerformedIterator{contract: _EternalAIKB721.contract, event: "InferencePerformed", logs: logs, sub: sub}, nil } // WatchInferencePerformed is a free log subscription operation binding the contract event 0xcf35460eca25a0549d5eb14c712236d61c9a0bad90c834f996c5f2a98d332719. // // Solidity: event InferencePerformed(uint256 indexed tokenId, address indexed caller, bytes data, uint256 fee, string externalData, uint256 inferenceId) func (_EternalAIKB721 *EternalAIKB721Filterer) WatchInferencePerformed(opts *bind.WatchOpts, sink chan<- *EternalAIKB721InferencePerformed, tokenId []*big.Int, caller []common.Address) (event.Subscription, error) { var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } var callerRule []interface{} for _, callerItem := range caller { callerRule = append(callerRule, callerItem) } logs, sub, err := _EternalAIKB721.contract.WatchLogs(opts, "InferencePerformed", tokenIdRule, callerRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(EternalAIKB721InferencePerformed) if err := _EternalAIKB721.contract.UnpackLog(event, "InferencePerformed", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseInferencePerformed is a log parse operation binding the contract event 0xcf35460eca25a0549d5eb14c712236d61c9a0bad90c834f996c5f2a98d332719. // // Solidity: event InferencePerformed(uint256 indexed tokenId, address indexed caller, bytes data, uint256 fee, string externalData, uint256 inferenceId) func (_EternalAIKB721 *EternalAIKB721Filterer) ParseInferencePerformed(log types.Log) (*EternalAIKB721InferencePerformed, error) { event := new(EternalAIKB721InferencePerformed) if err := _EternalAIKB721.contract.UnpackLog(event, "InferencePerformed", log); err != nil { return nil, err } event.Raw = log return event, nil } // EternalAIKB721InitializedIterator is returned from FilterInitialized and is used to iterate over the raw logs and unpacked data for Initialized events raised by the EternalAIKB721 contract. type EternalAIKB721InitializedIterator struct { Event *EternalAIKB721Initialized // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *EternalAIKB721InitializedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(EternalAIKB721Initialized) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(EternalAIKB721Initialized) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *EternalAIKB721InitializedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *EternalAIKB721InitializedIterator) Close() error { it.sub.Unsubscribe() return nil } // EternalAIKB721Initialized represents a Initialized event raised by the EternalAIKB721 contract. type EternalAIKB721Initialized struct { Version uint8 Raw types.Log // Blockchain specific contextual infos } // FilterInitialized is a free log retrieval operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. // // Solidity: event Initialized(uint8 version) func (_EternalAIKB721 *EternalAIKB721Filterer) FilterInitialized(opts *bind.FilterOpts) (*EternalAIKB721InitializedIterator, error) { logs, sub, err := _EternalAIKB721.contract.FilterLogs(opts, "Initialized") if err != nil { return nil, err } return &EternalAIKB721InitializedIterator{contract: _EternalAIKB721.contract, event: "Initialized", logs: logs, sub: sub}, nil } // WatchInitialized is a free log subscription operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. // // Solidity: event Initialized(uint8 version) func (_EternalAIKB721 *EternalAIKB721Filterer) WatchInitialized(opts *bind.WatchOpts, sink chan<- *EternalAIKB721Initialized) (event.Subscription, error) { logs, sub, err := _EternalAIKB721.contract.WatchLogs(opts, "Initialized") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(EternalAIKB721Initialized) if err := _EternalAIKB721.contract.UnpackLog(event, "Initialized", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseInitialized is a log parse operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. // // Solidity: event Initialized(uint8 version) func (_EternalAIKB721 *EternalAIKB721Filterer) ParseInitialized(log types.Log) (*EternalAIKB721Initialized, error) { event := new(EternalAIKB721Initialized) if err := _EternalAIKB721.contract.UnpackLog(event, "Initialized", log); err != nil { return nil, err } event.Raw = log return event, nil } // EternalAIKB721MetadataUpdateIterator is returned from FilterMetadataUpdate and is used to iterate over the raw logs and unpacked data for MetadataUpdate events raised by the EternalAIKB721 contract. type EternalAIKB721MetadataUpdateIterator struct { Event *EternalAIKB721MetadataUpdate // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *EternalAIKB721MetadataUpdateIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(EternalAIKB721MetadataUpdate) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(EternalAIKB721MetadataUpdate) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *EternalAIKB721MetadataUpdateIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *EternalAIKB721MetadataUpdateIterator) Close() error { it.sub.Unsubscribe() return nil } // EternalAIKB721MetadataUpdate represents a MetadataUpdate event raised by the EternalAIKB721 contract. type EternalAIKB721MetadataUpdate struct { TokenId *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterMetadataUpdate is a free log retrieval operation binding the contract event 0xf8e1a15aba9398e019f0b49df1a4fde98ee17ae345cb5f6b5e2c27f5033e8ce7. // // Solidity: event MetadataUpdate(uint256 _tokenId) func (_EternalAIKB721 *EternalAIKB721Filterer) FilterMetadataUpdate(opts *bind.FilterOpts) (*EternalAIKB721MetadataUpdateIterator, error) { logs, sub, err := _EternalAIKB721.contract.FilterLogs(opts, "MetadataUpdate") if err != nil { return nil, err } return &EternalAIKB721MetadataUpdateIterator{contract: _EternalAIKB721.contract, event: "MetadataUpdate", logs: logs, sub: sub}, nil } // WatchMetadataUpdate is a free log subscription operation binding the contract event 0xf8e1a15aba9398e019f0b49df1a4fde98ee17ae345cb5f6b5e2c27f5033e8ce7. // // Solidity: event MetadataUpdate(uint256 _tokenId) func (_EternalAIKB721 *EternalAIKB721Filterer) WatchMetadataUpdate(opts *bind.WatchOpts, sink chan<- *EternalAIKB721MetadataUpdate) (event.Subscription, error) { logs, sub, err := _EternalAIKB721.contract.WatchLogs(opts, "MetadataUpdate") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(EternalAIKB721MetadataUpdate) if err := _EternalAIKB721.contract.UnpackLog(event, "MetadataUpdate", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseMetadataUpdate is a log parse operation binding the contract event 0xf8e1a15aba9398e019f0b49df1a4fde98ee17ae345cb5f6b5e2c27f5033e8ce7. // // Solidity: event MetadataUpdate(uint256 _tokenId) func (_EternalAIKB721 *EternalAIKB721Filterer) ParseMetadataUpdate(log types.Log) (*EternalAIKB721MetadataUpdate, error) { event := new(EternalAIKB721MetadataUpdate) if err := _EternalAIKB721.contract.UnpackLog(event, "MetadataUpdate", log); err != nil { return nil, err } event.Raw = log return event, nil } // EternalAIKB721MintPriceUpdateIterator is returned from FilterMintPriceUpdate and is used to iterate over the raw logs and unpacked data for MintPriceUpdate events raised by the EternalAIKB721 contract. type EternalAIKB721MintPriceUpdateIterator struct { Event *EternalAIKB721MintPriceUpdate // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *EternalAIKB721MintPriceUpdateIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(EternalAIKB721MintPriceUpdate) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(EternalAIKB721MintPriceUpdate) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *EternalAIKB721MintPriceUpdateIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *EternalAIKB721MintPriceUpdateIterator) Close() error { it.sub.Unsubscribe() return nil } // EternalAIKB721MintPriceUpdate represents a MintPriceUpdate event raised by the EternalAIKB721 contract. type EternalAIKB721MintPriceUpdate struct { NewValue *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterMintPriceUpdate is a free log retrieval operation binding the contract event 0x23050b539195eebd064c1bec834445b7d028a20c345600e868a74d7ca93c5e86. // // Solidity: event MintPriceUpdate(uint256 newValue) func (_EternalAIKB721 *EternalAIKB721Filterer) FilterMintPriceUpdate(opts *bind.FilterOpts) (*EternalAIKB721MintPriceUpdateIterator, error) { logs, sub, err := _EternalAIKB721.contract.FilterLogs(opts, "MintPriceUpdate") if err != nil { return nil, err } return &EternalAIKB721MintPriceUpdateIterator{contract: _EternalAIKB721.contract, event: "MintPriceUpdate", logs: logs, sub: sub}, nil } // WatchMintPriceUpdate is a free log subscription operation binding the contract event 0x23050b539195eebd064c1bec834445b7d028a20c345600e868a74d7ca93c5e86. // // Solidity: event MintPriceUpdate(uint256 newValue) func (_EternalAIKB721 *EternalAIKB721Filterer) WatchMintPriceUpdate(opts *bind.WatchOpts, sink chan<- *EternalAIKB721MintPriceUpdate) (event.Subscription, error) { logs, sub, err := _EternalAIKB721.contract.WatchLogs(opts, "MintPriceUpdate") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(EternalAIKB721MintPriceUpdate) if err := _EternalAIKB721.contract.UnpackLog(event, "MintPriceUpdate", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseMintPriceUpdate is a log parse operation binding the contract event 0x23050b539195eebd064c1bec834445b7d028a20c345600e868a74d7ca93c5e86. // // Solidity: event MintPriceUpdate(uint256 newValue) func (_EternalAIKB721 *EternalAIKB721Filterer) ParseMintPriceUpdate(log types.Log) (*EternalAIKB721MintPriceUpdate, error) { event := new(EternalAIKB721MintPriceUpdate) if err := _EternalAIKB721.contract.UnpackLog(event, "MintPriceUpdate", log); err != nil { return nil, err } event.Raw = log return event, nil } // EternalAIKB721NewTokenIterator is returned from FilterNewToken and is used to iterate over the raw logs and unpacked data for NewToken events raised by the EternalAIKB721 contract. type EternalAIKB721NewTokenIterator struct { Event *EternalAIKB721NewToken // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *EternalAIKB721NewTokenIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(EternalAIKB721NewToken) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(EternalAIKB721NewToken) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *EternalAIKB721NewTokenIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *EternalAIKB721NewTokenIterator) Close() error { it.sub.Unsubscribe() return nil } // EternalAIKB721NewToken represents a NewToken event raised by the EternalAIKB721 contract. type EternalAIKB721NewToken struct { TokenId *big.Int Uri string SysPrompt []byte Fee *big.Int Minter common.Address Raw types.Log // Blockchain specific contextual infos } // FilterNewToken is a free log retrieval operation binding the contract event 0x61beab98a81083e3c0239c33e149bef1316ca78f15b9f29125039f5521a06d06. // // Solidity: event NewToken(uint256 indexed tokenId, string uri, bytes sysPrompt, uint256 fee, address indexed minter) func (_EternalAIKB721 *EternalAIKB721Filterer) FilterNewToken(opts *bind.FilterOpts, tokenId []*big.Int, minter []common.Address) (*EternalAIKB721NewTokenIterator, error) { var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } var minterRule []interface{} for _, minterItem := range minter { minterRule = append(minterRule, minterItem) } logs, sub, err := _EternalAIKB721.contract.FilterLogs(opts, "NewToken", tokenIdRule, minterRule) if err != nil { return nil, err } return &EternalAIKB721NewTokenIterator{contract: _EternalAIKB721.contract, event: "NewToken", logs: logs, sub: sub}, nil } // WatchNewToken is a free log subscription operation binding the contract event 0x61beab98a81083e3c0239c33e149bef1316ca78f15b9f29125039f5521a06d06. // // Solidity: event NewToken(uint256 indexed tokenId, string uri, bytes sysPrompt, uint256 fee, address indexed minter) func (_EternalAIKB721 *EternalAIKB721Filterer) WatchNewToken(opts *bind.WatchOpts, sink chan<- *EternalAIKB721NewToken, tokenId []*big.Int, minter []common.Address) (event.Subscription, error) { var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } var minterRule []interface{} for _, minterItem := range minter { minterRule = append(minterRule, minterItem) } logs, sub, err := _EternalAIKB721.contract.WatchLogs(opts, "NewToken", tokenIdRule, minterRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(EternalAIKB721NewToken) if err := _EternalAIKB721.contract.UnpackLog(event, "NewToken", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseNewToken is a log parse operation binding the contract event 0x61beab98a81083e3c0239c33e149bef1316ca78f15b9f29125039f5521a06d06. // // Solidity: event NewToken(uint256 indexed tokenId, string uri, bytes sysPrompt, uint256 fee, address indexed minter) func (_EternalAIKB721 *EternalAIKB721Filterer) ParseNewToken(log types.Log) (*EternalAIKB721NewToken, error) { event := new(EternalAIKB721NewToken) if err := _EternalAIKB721.contract.UnpackLog(event, "NewToken", log); err != nil { return nil, err } event.Raw = log return event, nil } // EternalAIKB721OwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the EternalAIKB721 contract. type EternalAIKB721OwnershipTransferredIterator struct { Event *EternalAIKB721OwnershipTransferred // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *EternalAIKB721OwnershipTransferredIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(EternalAIKB721OwnershipTransferred) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(EternalAIKB721OwnershipTransferred) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *EternalAIKB721OwnershipTransferredIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *EternalAIKB721OwnershipTransferredIterator) Close() error { it.sub.Unsubscribe() return nil } // EternalAIKB721OwnershipTransferred represents a OwnershipTransferred event raised by the EternalAIKB721 contract. type EternalAIKB721OwnershipTransferred struct { PreviousOwner common.Address NewOwner common.Address Raw types.Log // Blockchain specific contextual infos } // FilterOwnershipTransferred is a free log retrieval operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. // // Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) func (_EternalAIKB721 *EternalAIKB721Filterer) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*EternalAIKB721OwnershipTransferredIterator, error) { var previousOwnerRule []interface{} for _, previousOwnerItem := range previousOwner { previousOwnerRule = append(previousOwnerRule, previousOwnerItem) } var newOwnerRule []interface{} for _, newOwnerItem := range newOwner { newOwnerRule = append(newOwnerRule, newOwnerItem) } logs, sub, err := _EternalAIKB721.contract.FilterLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) if err != nil { return nil, err } return &EternalAIKB721OwnershipTransferredIterator{contract: _EternalAIKB721.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil } // WatchOwnershipTransferred is a free log subscription operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. // // Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) func (_EternalAIKB721 *EternalAIKB721Filterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *EternalAIKB721OwnershipTransferred, previousOwner []common.Address, newOwner []common.Address) (event.Subscription, error) { var previousOwnerRule []interface{} for _, previousOwnerItem := range previousOwner { previousOwnerRule = append(previousOwnerRule, previousOwnerItem) } var newOwnerRule []interface{} for _, newOwnerItem := range newOwner { newOwnerRule = append(newOwnerRule, newOwnerItem) } logs, sub, err := _EternalAIKB721.contract.WatchLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(EternalAIKB721OwnershipTransferred) if err := _EternalAIKB721.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseOwnershipTransferred is a log parse operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. // // Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) func (_EternalAIKB721 *EternalAIKB721Filterer) ParseOwnershipTransferred(log types.Log) (*EternalAIKB721OwnershipTransferred, error) { event := new(EternalAIKB721OwnershipTransferred) if err := _EternalAIKB721.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { return nil, err } event.Raw = log return event, nil } // EternalAIKB721PausedIterator is returned from FilterPaused and is used to iterate over the raw logs and unpacked data for Paused events raised by the EternalAIKB721 contract. type EternalAIKB721PausedIterator struct { Event *EternalAIKB721Paused // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *EternalAIKB721PausedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(EternalAIKB721Paused) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(EternalAIKB721Paused) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *EternalAIKB721PausedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *EternalAIKB721PausedIterator) Close() error { it.sub.Unsubscribe() return nil } // EternalAIKB721Paused represents a Paused event raised by the EternalAIKB721 contract. type EternalAIKB721Paused struct { Account common.Address Raw types.Log // Blockchain specific contextual infos } // FilterPaused is a free log retrieval operation binding the contract event 0x62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258. // // Solidity: event Paused(address account) func (_EternalAIKB721 *EternalAIKB721Filterer) FilterPaused(opts *bind.FilterOpts) (*EternalAIKB721PausedIterator, error) { logs, sub, err := _EternalAIKB721.contract.FilterLogs(opts, "Paused") if err != nil { return nil, err } return &EternalAIKB721PausedIterator{contract: _EternalAIKB721.contract, event: "Paused", logs: logs, sub: sub}, nil } // WatchPaused is a free log subscription operation binding the contract event 0x62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258. // // Solidity: event Paused(address account) func (_EternalAIKB721 *EternalAIKB721Filterer) WatchPaused(opts *bind.WatchOpts, sink chan<- *EternalAIKB721Paused) (event.Subscription, error) { logs, sub, err := _EternalAIKB721.contract.WatchLogs(opts, "Paused") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(EternalAIKB721Paused) if err := _EternalAIKB721.contract.UnpackLog(event, "Paused", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParsePaused is a log parse operation binding the contract event 0x62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258. // // Solidity: event Paused(address account) func (_EternalAIKB721 *EternalAIKB721Filterer) ParsePaused(log types.Log) (*EternalAIKB721Paused, error) { event := new(EternalAIKB721Paused) if err := _EternalAIKB721.contract.UnpackLog(event, "Paused", log); err != nil { return nil, err } event.Raw = log return event, nil } // EternalAIKB721RoyaltyPortionUpdateIterator is returned from FilterRoyaltyPortionUpdate and is used to iterate over the raw logs and unpacked data for RoyaltyPortionUpdate events raised by the EternalAIKB721 contract. type EternalAIKB721RoyaltyPortionUpdateIterator struct { Event *EternalAIKB721RoyaltyPortionUpdate // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *EternalAIKB721RoyaltyPortionUpdateIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(EternalAIKB721RoyaltyPortionUpdate) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(EternalAIKB721RoyaltyPortionUpdate) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *EternalAIKB721RoyaltyPortionUpdateIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *EternalAIKB721RoyaltyPortionUpdateIterator) Close() error { it.sub.Unsubscribe() return nil } // EternalAIKB721RoyaltyPortionUpdate represents a RoyaltyPortionUpdate event raised by the EternalAIKB721 contract. type EternalAIKB721RoyaltyPortionUpdate struct { NewValue uint16 Raw types.Log // Blockchain specific contextual infos } // FilterRoyaltyPortionUpdate is a free log retrieval operation binding the contract event 0xb1f3037624bd2d961f6d56696cc10ccc3a676db381e671b1bc58f0ab1f686dd5. // // Solidity: event RoyaltyPortionUpdate(uint16 newValue) func (_EternalAIKB721 *EternalAIKB721Filterer) FilterRoyaltyPortionUpdate(opts *bind.FilterOpts) (*EternalAIKB721RoyaltyPortionUpdateIterator, error) { logs, sub, err := _EternalAIKB721.contract.FilterLogs(opts, "RoyaltyPortionUpdate") if err != nil { return nil, err } return &EternalAIKB721RoyaltyPortionUpdateIterator{contract: _EternalAIKB721.contract, event: "RoyaltyPortionUpdate", logs: logs, sub: sub}, nil } // WatchRoyaltyPortionUpdate is a free log subscription operation binding the contract event 0xb1f3037624bd2d961f6d56696cc10ccc3a676db381e671b1bc58f0ab1f686dd5. // // Solidity: event RoyaltyPortionUpdate(uint16 newValue) func (_EternalAIKB721 *EternalAIKB721Filterer) WatchRoyaltyPortionUpdate(opts *bind.WatchOpts, sink chan<- *EternalAIKB721RoyaltyPortionUpdate) (event.Subscription, error) { logs, sub, err := _EternalAIKB721.contract.WatchLogs(opts, "RoyaltyPortionUpdate") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(EternalAIKB721RoyaltyPortionUpdate) if err := _EternalAIKB721.contract.UnpackLog(event, "RoyaltyPortionUpdate", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseRoyaltyPortionUpdate is a log parse operation binding the contract event 0xb1f3037624bd2d961f6d56696cc10ccc3a676db381e671b1bc58f0ab1f686dd5. // // Solidity: event RoyaltyPortionUpdate(uint16 newValue) func (_EternalAIKB721 *EternalAIKB721Filterer) ParseRoyaltyPortionUpdate(log types.Log) (*EternalAIKB721RoyaltyPortionUpdate, error) { event := new(EternalAIKB721RoyaltyPortionUpdate) if err := _EternalAIKB721.contract.UnpackLog(event, "RoyaltyPortionUpdate", log); err != nil { return nil, err } event.Raw = log return event, nil } // EternalAIKB721RoyaltyReceiverUpdateIterator is returned from FilterRoyaltyReceiverUpdate and is used to iterate over the raw logs and unpacked data for RoyaltyReceiverUpdate events raised by the EternalAIKB721 contract. type EternalAIKB721RoyaltyReceiverUpdateIterator struct { Event *EternalAIKB721RoyaltyReceiverUpdate // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *EternalAIKB721RoyaltyReceiverUpdateIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(EternalAIKB721RoyaltyReceiverUpdate) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(EternalAIKB721RoyaltyReceiverUpdate) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *EternalAIKB721RoyaltyReceiverUpdateIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *EternalAIKB721RoyaltyReceiverUpdateIterator) Close() error { it.sub.Unsubscribe() return nil } // EternalAIKB721RoyaltyReceiverUpdate represents a RoyaltyReceiverUpdate event raised by the EternalAIKB721 contract. type EternalAIKB721RoyaltyReceiverUpdate struct { NewAddress common.Address Raw types.Log // Blockchain specific contextual infos } // FilterRoyaltyReceiverUpdate is a free log retrieval operation binding the contract event 0xec6b72b10aed766af02b35918b55be261c89aaaa4c8add826471ce35ec7f97b3. // // Solidity: event RoyaltyReceiverUpdate(address newAddress) func (_EternalAIKB721 *EternalAIKB721Filterer) FilterRoyaltyReceiverUpdate(opts *bind.FilterOpts) (*EternalAIKB721RoyaltyReceiverUpdateIterator, error) { logs, sub, err := _EternalAIKB721.contract.FilterLogs(opts, "RoyaltyReceiverUpdate") if err != nil { return nil, err } return &EternalAIKB721RoyaltyReceiverUpdateIterator{contract: _EternalAIKB721.contract, event: "RoyaltyReceiverUpdate", logs: logs, sub: sub}, nil } // WatchRoyaltyReceiverUpdate is a free log subscription operation binding the contract event 0xec6b72b10aed766af02b35918b55be261c89aaaa4c8add826471ce35ec7f97b3. // // Solidity: event RoyaltyReceiverUpdate(address newAddress) func (_EternalAIKB721 *EternalAIKB721Filterer) WatchRoyaltyReceiverUpdate(opts *bind.WatchOpts, sink chan<- *EternalAIKB721RoyaltyReceiverUpdate) (event.Subscription, error) { logs, sub, err := _EternalAIKB721.contract.WatchLogs(opts, "RoyaltyReceiverUpdate") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(EternalAIKB721RoyaltyReceiverUpdate) if err := _EternalAIKB721.contract.UnpackLog(event, "RoyaltyReceiverUpdate", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseRoyaltyReceiverUpdate is a log parse operation binding the contract event 0xec6b72b10aed766af02b35918b55be261c89aaaa4c8add826471ce35ec7f97b3. // // Solidity: event RoyaltyReceiverUpdate(address newAddress) func (_EternalAIKB721 *EternalAIKB721Filterer) ParseRoyaltyReceiverUpdate(log types.Log) (*EternalAIKB721RoyaltyReceiverUpdate, error) { event := new(EternalAIKB721RoyaltyReceiverUpdate) if err := _EternalAIKB721.contract.UnpackLog(event, "RoyaltyReceiverUpdate", log); err != nil { return nil, err } event.Raw = log return event, nil } // EternalAIKB721TopUpPoolBalanceIterator is returned from FilterTopUpPoolBalance and is used to iterate over the raw logs and unpacked data for TopUpPoolBalance events raised by the EternalAIKB721 contract. type EternalAIKB721TopUpPoolBalanceIterator struct { Event *EternalAIKB721TopUpPoolBalance // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *EternalAIKB721TopUpPoolBalanceIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(EternalAIKB721TopUpPoolBalance) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(EternalAIKB721TopUpPoolBalance) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *EternalAIKB721TopUpPoolBalanceIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *EternalAIKB721TopUpPoolBalanceIterator) Close() error { it.sub.Unsubscribe() return nil } // EternalAIKB721TopUpPoolBalance represents a TopUpPoolBalance event raised by the EternalAIKB721 contract. type EternalAIKB721TopUpPoolBalance struct { AgentId *big.Int Caller common.Address Amount *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterTopUpPoolBalance is a free log retrieval operation binding the contract event 0xf7ee57effd30f2ab842c1d65fdcfa7d20c2fb2f967e9ac30acafecabf013ea4c. // // Solidity: event TopUpPoolBalance(uint256 agentId, address caller, uint256 amount) func (_EternalAIKB721 *EternalAIKB721Filterer) FilterTopUpPoolBalance(opts *bind.FilterOpts) (*EternalAIKB721TopUpPoolBalanceIterator, error) { logs, sub, err := _EternalAIKB721.contract.FilterLogs(opts, "TopUpPoolBalance") if err != nil { return nil, err } return &EternalAIKB721TopUpPoolBalanceIterator{contract: _EternalAIKB721.contract, event: "TopUpPoolBalance", logs: logs, sub: sub}, nil } // WatchTopUpPoolBalance is a free log subscription operation binding the contract event 0xf7ee57effd30f2ab842c1d65fdcfa7d20c2fb2f967e9ac30acafecabf013ea4c. // // Solidity: event TopUpPoolBalance(uint256 agentId, address caller, uint256 amount) func (_EternalAIKB721 *EternalAIKB721Filterer) WatchTopUpPoolBalance(opts *bind.WatchOpts, sink chan<- *EternalAIKB721TopUpPoolBalance) (event.Subscription, error) { logs, sub, err := _EternalAIKB721.contract.WatchLogs(opts, "TopUpPoolBalance") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(EternalAIKB721TopUpPoolBalance) if err := _EternalAIKB721.contract.UnpackLog(event, "TopUpPoolBalance", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseTopUpPoolBalance is a log parse operation binding the contract event 0xf7ee57effd30f2ab842c1d65fdcfa7d20c2fb2f967e9ac30acafecabf013ea4c. // // Solidity: event TopUpPoolBalance(uint256 agentId, address caller, uint256 amount) func (_EternalAIKB721 *EternalAIKB721Filterer) ParseTopUpPoolBalance(log types.Log) (*EternalAIKB721TopUpPoolBalance, error) { event := new(EternalAIKB721TopUpPoolBalance) if err := _EternalAIKB721.contract.UnpackLog(event, "TopUpPoolBalance", log); err != nil { return nil, err } event.Raw = log return event, nil } // EternalAIKB721TransferIterator is returned from FilterTransfer and is used to iterate over the raw logs and unpacked data for Transfer events raised by the EternalAIKB721 contract. type EternalAIKB721TransferIterator struct { Event *EternalAIKB721Transfer // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *EternalAIKB721TransferIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(EternalAIKB721Transfer) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(EternalAIKB721Transfer) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *EternalAIKB721TransferIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *EternalAIKB721TransferIterator) Close() error { it.sub.Unsubscribe() return nil } // EternalAIKB721Transfer represents a Transfer event raised by the EternalAIKB721 contract. type EternalAIKB721Transfer struct { From common.Address To common.Address TokenId *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterTransfer is a free log retrieval operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. // // Solidity: event Transfer(address indexed from, address indexed to, uint256 indexed tokenId) func (_EternalAIKB721 *EternalAIKB721Filterer) FilterTransfer(opts *bind.FilterOpts, from []common.Address, to []common.Address, tokenId []*big.Int) (*EternalAIKB721TransferIterator, error) { var fromRule []interface{} for _, fromItem := range from { fromRule = append(fromRule, fromItem) } var toRule []interface{} for _, toItem := range to { toRule = append(toRule, toItem) } var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _EternalAIKB721.contract.FilterLogs(opts, "Transfer", fromRule, toRule, tokenIdRule) if err != nil { return nil, err } return &EternalAIKB721TransferIterator{contract: _EternalAIKB721.contract, event: "Transfer", logs: logs, sub: sub}, nil } // WatchTransfer is a free log subscription operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. // // Solidity: event Transfer(address indexed from, address indexed to, uint256 indexed tokenId) func (_EternalAIKB721 *EternalAIKB721Filterer) WatchTransfer(opts *bind.WatchOpts, sink chan<- *EternalAIKB721Transfer, from []common.Address, to []common.Address, tokenId []*big.Int) (event.Subscription, error) { var fromRule []interface{} for _, fromItem := range from { fromRule = append(fromRule, fromItem) } var toRule []interface{} for _, toItem := range to { toRule = append(toRule, toItem) } var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _EternalAIKB721.contract.WatchLogs(opts, "Transfer", fromRule, toRule, tokenIdRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(EternalAIKB721Transfer) if err := _EternalAIKB721.contract.UnpackLog(event, "Transfer", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseTransfer is a log parse operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. // // Solidity: event Transfer(address indexed from, address indexed to, uint256 indexed tokenId) func (_EternalAIKB721 *EternalAIKB721Filterer) ParseTransfer(log types.Log) (*EternalAIKB721Transfer, error) { event := new(EternalAIKB721Transfer) if err := _EternalAIKB721.contract.UnpackLog(event, "Transfer", log); err != nil { return nil, err } event.Raw = log return event, nil } // EternalAIKB721UnpausedIterator is returned from FilterUnpaused and is used to iterate over the raw logs and unpacked data for Unpaused events raised by the EternalAIKB721 contract. type EternalAIKB721UnpausedIterator struct { Event *EternalAIKB721Unpaused // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *EternalAIKB721UnpausedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(EternalAIKB721Unpaused) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(EternalAIKB721Unpaused) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *EternalAIKB721UnpausedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *EternalAIKB721UnpausedIterator) Close() error { it.sub.Unsubscribe() return nil } // EternalAIKB721Unpaused represents a Unpaused event raised by the EternalAIKB721 contract. type EternalAIKB721Unpaused struct { Account common.Address Raw types.Log // Blockchain specific contextual infos } // FilterUnpaused is a free log retrieval operation binding the contract event 0x5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa. // // Solidity: event Unpaused(address account) func (_EternalAIKB721 *EternalAIKB721Filterer) FilterUnpaused(opts *bind.FilterOpts) (*EternalAIKB721UnpausedIterator, error) { logs, sub, err := _EternalAIKB721.contract.FilterLogs(opts, "Unpaused") if err != nil { return nil, err } return &EternalAIKB721UnpausedIterator{contract: _EternalAIKB721.contract, event: "Unpaused", logs: logs, sub: sub}, nil } // WatchUnpaused is a free log subscription operation binding the contract event 0x5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa. // // Solidity: event Unpaused(address account) func (_EternalAIKB721 *EternalAIKB721Filterer) WatchUnpaused(opts *bind.WatchOpts, sink chan<- *EternalAIKB721Unpaused) (event.Subscription, error) { logs, sub, err := _EternalAIKB721.contract.WatchLogs(opts, "Unpaused") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(EternalAIKB721Unpaused) if err := _EternalAIKB721.contract.UnpackLog(event, "Unpaused", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseUnpaused is a log parse operation binding the contract event 0x5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa. // // Solidity: event Unpaused(address account) func (_EternalAIKB721 *EternalAIKB721Filterer) ParseUnpaused(log types.Log) (*EternalAIKB721Unpaused, error) { event := new(EternalAIKB721Unpaused) if err := _EternalAIKB721.contract.UnpackLog(event, "Unpaused", log); err != nil { return nil, err } event.Raw = log return event, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/binds/apechainnonfungiblepositionmanager/NonfungiblePositionManager.go ================================================ // Code generated - DO NOT EDIT. // This file is a generated binding and any manual changes will be lost. package apechainnonfungiblepositionmanager import ( "errors" "math/big" "strings" ethereum "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/event" ) // Reference imports to suppress errors if they are not otherwise used. var ( _ = errors.New _ = big.NewInt _ = strings.NewReader _ = ethereum.NotFound _ = bind.Bind _ = common.Big1 _ = types.BloomLookup _ = event.NewSubscription _ = abi.ConvertType ) // INonfungiblePositionManagerCollectParams is an auto generated low-level Go binding around an user-defined struct. type INonfungiblePositionManagerCollectParams struct { TokenId *big.Int Recipient common.Address Amount0Max *big.Int Amount1Max *big.Int } // INonfungiblePositionManagerDecreaseLiquidityParams is an auto generated low-level Go binding around an user-defined struct. type INonfungiblePositionManagerDecreaseLiquidityParams struct { TokenId *big.Int Liquidity *big.Int Amount0Min *big.Int Amount1Min *big.Int Deadline *big.Int } // INonfungiblePositionManagerIncreaseLiquidityParams is an auto generated low-level Go binding around an user-defined struct. type INonfungiblePositionManagerIncreaseLiquidityParams struct { TokenId *big.Int Amount0Desired *big.Int Amount1Desired *big.Int Amount0Min *big.Int Amount1Min *big.Int Deadline *big.Int } // INonfungiblePositionManagerMintParams is an auto generated low-level Go binding around an user-defined struct. type INonfungiblePositionManagerMintParams struct { Token0 common.Address Token1 common.Address TickLower *big.Int TickUpper *big.Int Amount0Desired *big.Int Amount1Desired *big.Int Amount0Min *big.Int Amount1Min *big.Int Recipient common.Address Deadline *big.Int } // NonfungiblePositionManagerMetaData contains all meta data concerning the NonfungiblePositionManager contract. var NonfungiblePositionManagerMetaData = &bind.MetaData{ ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_factory\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_WNativeToken\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_tokenDescriptor_\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_poolDeployer\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"approved\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"ApprovalForAll\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"}],\"name\":\"Collect\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"liquidity\",\"type\":\"uint128\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"}],\"name\":\"DecreaseLiquidity\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"liquidity\",\"type\":\"uint128\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"actualLiquidity\",\"type\":\"uint128\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"name\":\"IncreaseLiquidity\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"DOMAIN_SEPARATOR\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"PERMIT_TYPEHASH\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"WNativeToken\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0Owed\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Owed\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"algebraMintCallback\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"baseURI\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"burn\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint128\",\"name\":\"amount0Max\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"amount1Max\",\"type\":\"uint128\"}],\"internalType\":\"structINonfungiblePositionManager.CollectParams\",\"name\":\"params\",\"type\":\"tuple\"}],\"name\":\"collect\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token0\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token1\",\"type\":\"address\"},{\"internalType\":\"uint160\",\"name\":\"sqrtPriceX96\",\"type\":\"uint160\"}],\"name\":\"createAndInitializePoolIfNecessary\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint128\",\"name\":\"liquidity\",\"type\":\"uint128\"},{\"internalType\":\"uint256\",\"name\":\"amount0Min\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Min\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"}],\"internalType\":\"structINonfungiblePositionManager.DecreaseLiquidityParams\",\"name\":\"params\",\"type\":\"tuple\"}],\"name\":\"decreaseLiquidity\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"factory\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"getApproved\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount0Desired\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Desired\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount0Min\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Min\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"}],\"internalType\":\"structINonfungiblePositionManager.IncreaseLiquidityParams\",\"name\":\"params\",\"type\":\"tuple\"}],\"name\":\"increaseLiquidity\",\"outputs\":[{\"internalType\":\"uint128\",\"name\":\"liquidity\",\"type\":\"uint128\"},{\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"name\":\"isApprovedForAll\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"token0\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token1\",\"type\":\"address\"},{\"internalType\":\"int24\",\"name\":\"tickLower\",\"type\":\"int24\"},{\"internalType\":\"int24\",\"name\":\"tickUpper\",\"type\":\"int24\"},{\"internalType\":\"uint256\",\"name\":\"amount0Desired\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Desired\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount0Min\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Min\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"}],\"internalType\":\"structINonfungiblePositionManager.MintParams\",\"name\":\"params\",\"type\":\"tuple\"}],\"name\":\"mint\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint128\",\"name\":\"liquidity\",\"type\":\"uint128\"},{\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes[]\",\"name\":\"data\",\"type\":\"bytes[]\"}],\"name\":\"multicall\",\"outputs\":[{\"internalType\":\"bytes[]\",\"name\":\"results\",\"type\":\"bytes[]\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"ownerOf\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"permit\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"poolDeployer\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"positions\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"nonce\",\"type\":\"uint96\"},{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token0\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token1\",\"type\":\"address\"},{\"internalType\":\"int24\",\"name\":\"tickLower\",\"type\":\"int24\"},{\"internalType\":\"int24\",\"name\":\"tickUpper\",\"type\":\"int24\"},{\"internalType\":\"uint128\",\"name\":\"liquidity\",\"type\":\"uint128\"},{\"internalType\":\"uint256\",\"name\":\"feeGrowthInside0LastX128\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"feeGrowthInside1LastX128\",\"type\":\"uint256\"},{\"internalType\":\"uint128\",\"name\":\"tokensOwed0\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"tokensOwed1\",\"type\":\"uint128\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"refundNativeToken\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"safeTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"safeTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"selfPermit\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiry\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"selfPermitAllowed\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiry\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"selfPermitAllowedIfNecessary\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"selfPermitIfNecessary\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"setApprovalForAll\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amountMinimum\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"}],\"name\":\"sweepToken\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"}],\"name\":\"tokenByIndex\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"}],\"name\":\"tokenOfOwnerByIndex\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"tokenURI\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountMinimum\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"}],\"name\":\"unwrapWNativeToken\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]", } // NonfungiblePositionManagerABI is the input ABI used to generate the binding from. // Deprecated: Use NonfungiblePositionManagerMetaData.ABI instead. var NonfungiblePositionManagerABI = NonfungiblePositionManagerMetaData.ABI // NonfungiblePositionManager is an auto generated Go binding around an Ethereum contract. type NonfungiblePositionManager struct { NonfungiblePositionManagerCaller // Read-only binding to the contract NonfungiblePositionManagerTransactor // Write-only binding to the contract NonfungiblePositionManagerFilterer // Log filterer for contract events } // NonfungiblePositionManagerCaller is an auto generated read-only Go binding around an Ethereum contract. type NonfungiblePositionManagerCaller struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // NonfungiblePositionManagerTransactor is an auto generated write-only Go binding around an Ethereum contract. type NonfungiblePositionManagerTransactor struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // NonfungiblePositionManagerFilterer is an auto generated log filtering Go binding around an Ethereum contract events. type NonfungiblePositionManagerFilterer struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // NonfungiblePositionManagerSession is an auto generated Go binding around an Ethereum contract, // with pre-set call and transact options. type NonfungiblePositionManagerSession struct { Contract *NonfungiblePositionManager // Generic contract binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // NonfungiblePositionManagerCallerSession is an auto generated read-only Go binding around an Ethereum contract, // with pre-set call options. type NonfungiblePositionManagerCallerSession struct { Contract *NonfungiblePositionManagerCaller // Generic contract caller binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session } // NonfungiblePositionManagerTransactorSession is an auto generated write-only Go binding around an Ethereum contract, // with pre-set transact options. type NonfungiblePositionManagerTransactorSession struct { Contract *NonfungiblePositionManagerTransactor // Generic contract transactor binding to set the session for TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // NonfungiblePositionManagerRaw is an auto generated low-level Go binding around an Ethereum contract. type NonfungiblePositionManagerRaw struct { Contract *NonfungiblePositionManager // Generic contract binding to access the raw methods on } // NonfungiblePositionManagerCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. type NonfungiblePositionManagerCallerRaw struct { Contract *NonfungiblePositionManagerCaller // Generic read-only contract binding to access the raw methods on } // NonfungiblePositionManagerTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. type NonfungiblePositionManagerTransactorRaw struct { Contract *NonfungiblePositionManagerTransactor // Generic write-only contract binding to access the raw methods on } // NewNonfungiblePositionManager creates a new instance of NonfungiblePositionManager, bound to a specific deployed contract. func NewNonfungiblePositionManager(address common.Address, backend bind.ContractBackend) (*NonfungiblePositionManager, error) { contract, err := bindNonfungiblePositionManager(address, backend, backend, backend) if err != nil { return nil, err } return &NonfungiblePositionManager{NonfungiblePositionManagerCaller: NonfungiblePositionManagerCaller{contract: contract}, NonfungiblePositionManagerTransactor: NonfungiblePositionManagerTransactor{contract: contract}, NonfungiblePositionManagerFilterer: NonfungiblePositionManagerFilterer{contract: contract}}, nil } // NewNonfungiblePositionManagerCaller creates a new read-only instance of NonfungiblePositionManager, bound to a specific deployed contract. func NewNonfungiblePositionManagerCaller(address common.Address, caller bind.ContractCaller) (*NonfungiblePositionManagerCaller, error) { contract, err := bindNonfungiblePositionManager(address, caller, nil, nil) if err != nil { return nil, err } return &NonfungiblePositionManagerCaller{contract: contract}, nil } // NewNonfungiblePositionManagerTransactor creates a new write-only instance of NonfungiblePositionManager, bound to a specific deployed contract. func NewNonfungiblePositionManagerTransactor(address common.Address, transactor bind.ContractTransactor) (*NonfungiblePositionManagerTransactor, error) { contract, err := bindNonfungiblePositionManager(address, nil, transactor, nil) if err != nil { return nil, err } return &NonfungiblePositionManagerTransactor{contract: contract}, nil } // NewNonfungiblePositionManagerFilterer creates a new log filterer instance of NonfungiblePositionManager, bound to a specific deployed contract. func NewNonfungiblePositionManagerFilterer(address common.Address, filterer bind.ContractFilterer) (*NonfungiblePositionManagerFilterer, error) { contract, err := bindNonfungiblePositionManager(address, nil, nil, filterer) if err != nil { return nil, err } return &NonfungiblePositionManagerFilterer{contract: contract}, nil } // bindNonfungiblePositionManager binds a generic wrapper to an already deployed contract. func bindNonfungiblePositionManager(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { parsed, err := NonfungiblePositionManagerMetaData.GetAbi() if err != nil { return nil, err } return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_NonfungiblePositionManager *NonfungiblePositionManagerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _NonfungiblePositionManager.Contract.NonfungiblePositionManagerCaller.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_NonfungiblePositionManager *NonfungiblePositionManagerRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.NonfungiblePositionManagerTransactor.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_NonfungiblePositionManager *NonfungiblePositionManagerRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.NonfungiblePositionManagerTransactor.contract.Transact(opts, method, params...) } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _NonfungiblePositionManager.Contract.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.contract.Transact(opts, method, params...) } // DOMAINSEPARATOR is a free data retrieval call binding the contract method 0x3644e515. // // Solidity: function DOMAIN_SEPARATOR() view returns(bytes32) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) DOMAINSEPARATOR(opts *bind.CallOpts) ([32]byte, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "DOMAIN_SEPARATOR") if err != nil { return *new([32]byte), err } out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) return out0, err } // DOMAINSEPARATOR is a free data retrieval call binding the contract method 0x3644e515. // // Solidity: function DOMAIN_SEPARATOR() view returns(bytes32) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) DOMAINSEPARATOR() ([32]byte, error) { return _NonfungiblePositionManager.Contract.DOMAINSEPARATOR(&_NonfungiblePositionManager.CallOpts) } // DOMAINSEPARATOR is a free data retrieval call binding the contract method 0x3644e515. // // Solidity: function DOMAIN_SEPARATOR() view returns(bytes32) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) DOMAINSEPARATOR() ([32]byte, error) { return _NonfungiblePositionManager.Contract.DOMAINSEPARATOR(&_NonfungiblePositionManager.CallOpts) } // PERMITTYPEHASH is a free data retrieval call binding the contract method 0x30adf81f. // // Solidity: function PERMIT_TYPEHASH() view returns(bytes32) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) PERMITTYPEHASH(opts *bind.CallOpts) ([32]byte, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "PERMIT_TYPEHASH") if err != nil { return *new([32]byte), err } out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) return out0, err } // PERMITTYPEHASH is a free data retrieval call binding the contract method 0x30adf81f. // // Solidity: function PERMIT_TYPEHASH() view returns(bytes32) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) PERMITTYPEHASH() ([32]byte, error) { return _NonfungiblePositionManager.Contract.PERMITTYPEHASH(&_NonfungiblePositionManager.CallOpts) } // PERMITTYPEHASH is a free data retrieval call binding the contract method 0x30adf81f. // // Solidity: function PERMIT_TYPEHASH() view returns(bytes32) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) PERMITTYPEHASH() ([32]byte, error) { return _NonfungiblePositionManager.Contract.PERMITTYPEHASH(&_NonfungiblePositionManager.CallOpts) } // WNativeToken is a free data retrieval call binding the contract method 0x8af3ac85. // // Solidity: function WNativeToken() view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) WNativeToken(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "WNativeToken") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // WNativeToken is a free data retrieval call binding the contract method 0x8af3ac85. // // Solidity: function WNativeToken() view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) WNativeToken() (common.Address, error) { return _NonfungiblePositionManager.Contract.WNativeToken(&_NonfungiblePositionManager.CallOpts) } // WNativeToken is a free data retrieval call binding the contract method 0x8af3ac85. // // Solidity: function WNativeToken() view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) WNativeToken() (common.Address, error) { return _NonfungiblePositionManager.Contract.WNativeToken(&_NonfungiblePositionManager.CallOpts) } // BalanceOf is a free data retrieval call binding the contract method 0x70a08231. // // Solidity: function balanceOf(address owner) view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) BalanceOf(opts *bind.CallOpts, owner common.Address) (*big.Int, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "balanceOf", owner) if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // BalanceOf is a free data retrieval call binding the contract method 0x70a08231. // // Solidity: function balanceOf(address owner) view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) BalanceOf(owner common.Address) (*big.Int, error) { return _NonfungiblePositionManager.Contract.BalanceOf(&_NonfungiblePositionManager.CallOpts, owner) } // BalanceOf is a free data retrieval call binding the contract method 0x70a08231. // // Solidity: function balanceOf(address owner) view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) BalanceOf(owner common.Address) (*big.Int, error) { return _NonfungiblePositionManager.Contract.BalanceOf(&_NonfungiblePositionManager.CallOpts, owner) } // BaseURI is a free data retrieval call binding the contract method 0x6c0360eb. // // Solidity: function baseURI() pure returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) BaseURI(opts *bind.CallOpts) (string, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "baseURI") if err != nil { return *new(string), err } out0 := *abi.ConvertType(out[0], new(string)).(*string) return out0, err } // BaseURI is a free data retrieval call binding the contract method 0x6c0360eb. // // Solidity: function baseURI() pure returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) BaseURI() (string, error) { return _NonfungiblePositionManager.Contract.BaseURI(&_NonfungiblePositionManager.CallOpts) } // BaseURI is a free data retrieval call binding the contract method 0x6c0360eb. // // Solidity: function baseURI() pure returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) BaseURI() (string, error) { return _NonfungiblePositionManager.Contract.BaseURI(&_NonfungiblePositionManager.CallOpts) } // Factory is a free data retrieval call binding the contract method 0xc45a0155. // // Solidity: function factory() view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) Factory(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "factory") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // Factory is a free data retrieval call binding the contract method 0xc45a0155. // // Solidity: function factory() view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Factory() (common.Address, error) { return _NonfungiblePositionManager.Contract.Factory(&_NonfungiblePositionManager.CallOpts) } // Factory is a free data retrieval call binding the contract method 0xc45a0155. // // Solidity: function factory() view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) Factory() (common.Address, error) { return _NonfungiblePositionManager.Contract.Factory(&_NonfungiblePositionManager.CallOpts) } // GetApproved is a free data retrieval call binding the contract method 0x081812fc. // // Solidity: function getApproved(uint256 tokenId) view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) GetApproved(opts *bind.CallOpts, tokenId *big.Int) (common.Address, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "getApproved", tokenId) if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // GetApproved is a free data retrieval call binding the contract method 0x081812fc. // // Solidity: function getApproved(uint256 tokenId) view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) GetApproved(tokenId *big.Int) (common.Address, error) { return _NonfungiblePositionManager.Contract.GetApproved(&_NonfungiblePositionManager.CallOpts, tokenId) } // GetApproved is a free data retrieval call binding the contract method 0x081812fc. // // Solidity: function getApproved(uint256 tokenId) view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) GetApproved(tokenId *big.Int) (common.Address, error) { return _NonfungiblePositionManager.Contract.GetApproved(&_NonfungiblePositionManager.CallOpts, tokenId) } // IsApprovedForAll is a free data retrieval call binding the contract method 0xe985e9c5. // // Solidity: function isApprovedForAll(address owner, address operator) view returns(bool) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) IsApprovedForAll(opts *bind.CallOpts, owner common.Address, operator common.Address) (bool, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "isApprovedForAll", owner, operator) if err != nil { return *new(bool), err } out0 := *abi.ConvertType(out[0], new(bool)).(*bool) return out0, err } // IsApprovedForAll is a free data retrieval call binding the contract method 0xe985e9c5. // // Solidity: function isApprovedForAll(address owner, address operator) view returns(bool) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) IsApprovedForAll(owner common.Address, operator common.Address) (bool, error) { return _NonfungiblePositionManager.Contract.IsApprovedForAll(&_NonfungiblePositionManager.CallOpts, owner, operator) } // IsApprovedForAll is a free data retrieval call binding the contract method 0xe985e9c5. // // Solidity: function isApprovedForAll(address owner, address operator) view returns(bool) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) IsApprovedForAll(owner common.Address, operator common.Address) (bool, error) { return _NonfungiblePositionManager.Contract.IsApprovedForAll(&_NonfungiblePositionManager.CallOpts, owner, operator) } // Name is a free data retrieval call binding the contract method 0x06fdde03. // // Solidity: function name() view returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) Name(opts *bind.CallOpts) (string, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "name") if err != nil { return *new(string), err } out0 := *abi.ConvertType(out[0], new(string)).(*string) return out0, err } // Name is a free data retrieval call binding the contract method 0x06fdde03. // // Solidity: function name() view returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Name() (string, error) { return _NonfungiblePositionManager.Contract.Name(&_NonfungiblePositionManager.CallOpts) } // Name is a free data retrieval call binding the contract method 0x06fdde03. // // Solidity: function name() view returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) Name() (string, error) { return _NonfungiblePositionManager.Contract.Name(&_NonfungiblePositionManager.CallOpts) } // OwnerOf is a free data retrieval call binding the contract method 0x6352211e. // // Solidity: function ownerOf(uint256 tokenId) view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) OwnerOf(opts *bind.CallOpts, tokenId *big.Int) (common.Address, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "ownerOf", tokenId) if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // OwnerOf is a free data retrieval call binding the contract method 0x6352211e. // // Solidity: function ownerOf(uint256 tokenId) view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) OwnerOf(tokenId *big.Int) (common.Address, error) { return _NonfungiblePositionManager.Contract.OwnerOf(&_NonfungiblePositionManager.CallOpts, tokenId) } // OwnerOf is a free data retrieval call binding the contract method 0x6352211e. // // Solidity: function ownerOf(uint256 tokenId) view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) OwnerOf(tokenId *big.Int) (common.Address, error) { return _NonfungiblePositionManager.Contract.OwnerOf(&_NonfungiblePositionManager.CallOpts, tokenId) } // PoolDeployer is a free data retrieval call binding the contract method 0x3119049a. // // Solidity: function poolDeployer() view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) PoolDeployer(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "poolDeployer") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // PoolDeployer is a free data retrieval call binding the contract method 0x3119049a. // // Solidity: function poolDeployer() view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) PoolDeployer() (common.Address, error) { return _NonfungiblePositionManager.Contract.PoolDeployer(&_NonfungiblePositionManager.CallOpts) } // PoolDeployer is a free data retrieval call binding the contract method 0x3119049a. // // Solidity: function poolDeployer() view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) PoolDeployer() (common.Address, error) { return _NonfungiblePositionManager.Contract.PoolDeployer(&_NonfungiblePositionManager.CallOpts) } // Positions is a free data retrieval call binding the contract method 0x99fbab88. // // Solidity: function positions(uint256 tokenId) view returns(uint96 nonce, address operator, address token0, address token1, int24 tickLower, int24 tickUpper, uint128 liquidity, uint256 feeGrowthInside0LastX128, uint256 feeGrowthInside1LastX128, uint128 tokensOwed0, uint128 tokensOwed1) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) Positions(opts *bind.CallOpts, tokenId *big.Int) (struct { Nonce *big.Int Operator common.Address Token0 common.Address Token1 common.Address TickLower *big.Int TickUpper *big.Int Liquidity *big.Int FeeGrowthInside0LastX128 *big.Int FeeGrowthInside1LastX128 *big.Int TokensOwed0 *big.Int TokensOwed1 *big.Int }, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "positions", tokenId) outstruct := new(struct { Nonce *big.Int Operator common.Address Token0 common.Address Token1 common.Address TickLower *big.Int TickUpper *big.Int Liquidity *big.Int FeeGrowthInside0LastX128 *big.Int FeeGrowthInside1LastX128 *big.Int TokensOwed0 *big.Int TokensOwed1 *big.Int }) if err != nil { return *outstruct, err } outstruct.Nonce = *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) outstruct.Operator = *abi.ConvertType(out[1], new(common.Address)).(*common.Address) outstruct.Token0 = *abi.ConvertType(out[2], new(common.Address)).(*common.Address) outstruct.Token1 = *abi.ConvertType(out[3], new(common.Address)).(*common.Address) outstruct.TickLower = *abi.ConvertType(out[4], new(*big.Int)).(**big.Int) outstruct.TickUpper = *abi.ConvertType(out[5], new(*big.Int)).(**big.Int) outstruct.Liquidity = *abi.ConvertType(out[6], new(*big.Int)).(**big.Int) outstruct.FeeGrowthInside0LastX128 = *abi.ConvertType(out[7], new(*big.Int)).(**big.Int) outstruct.FeeGrowthInside1LastX128 = *abi.ConvertType(out[8], new(*big.Int)).(**big.Int) outstruct.TokensOwed0 = *abi.ConvertType(out[9], new(*big.Int)).(**big.Int) outstruct.TokensOwed1 = *abi.ConvertType(out[10], new(*big.Int)).(**big.Int) return *outstruct, err } // Positions is a free data retrieval call binding the contract method 0x99fbab88. // // Solidity: function positions(uint256 tokenId) view returns(uint96 nonce, address operator, address token0, address token1, int24 tickLower, int24 tickUpper, uint128 liquidity, uint256 feeGrowthInside0LastX128, uint256 feeGrowthInside1LastX128, uint128 tokensOwed0, uint128 tokensOwed1) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Positions(tokenId *big.Int) (struct { Nonce *big.Int Operator common.Address Token0 common.Address Token1 common.Address TickLower *big.Int TickUpper *big.Int Liquidity *big.Int FeeGrowthInside0LastX128 *big.Int FeeGrowthInside1LastX128 *big.Int TokensOwed0 *big.Int TokensOwed1 *big.Int }, error) { return _NonfungiblePositionManager.Contract.Positions(&_NonfungiblePositionManager.CallOpts, tokenId) } // Positions is a free data retrieval call binding the contract method 0x99fbab88. // // Solidity: function positions(uint256 tokenId) view returns(uint96 nonce, address operator, address token0, address token1, int24 tickLower, int24 tickUpper, uint128 liquidity, uint256 feeGrowthInside0LastX128, uint256 feeGrowthInside1LastX128, uint128 tokensOwed0, uint128 tokensOwed1) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) Positions(tokenId *big.Int) (struct { Nonce *big.Int Operator common.Address Token0 common.Address Token1 common.Address TickLower *big.Int TickUpper *big.Int Liquidity *big.Int FeeGrowthInside0LastX128 *big.Int FeeGrowthInside1LastX128 *big.Int TokensOwed0 *big.Int TokensOwed1 *big.Int }, error) { return _NonfungiblePositionManager.Contract.Positions(&_NonfungiblePositionManager.CallOpts, tokenId) } // SupportsInterface is a free data retrieval call binding the contract method 0x01ffc9a7. // // Solidity: function supportsInterface(bytes4 interfaceId) view returns(bool) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) SupportsInterface(opts *bind.CallOpts, interfaceId [4]byte) (bool, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "supportsInterface", interfaceId) if err != nil { return *new(bool), err } out0 := *abi.ConvertType(out[0], new(bool)).(*bool) return out0, err } // SupportsInterface is a free data retrieval call binding the contract method 0x01ffc9a7. // // Solidity: function supportsInterface(bytes4 interfaceId) view returns(bool) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) SupportsInterface(interfaceId [4]byte) (bool, error) { return _NonfungiblePositionManager.Contract.SupportsInterface(&_NonfungiblePositionManager.CallOpts, interfaceId) } // SupportsInterface is a free data retrieval call binding the contract method 0x01ffc9a7. // // Solidity: function supportsInterface(bytes4 interfaceId) view returns(bool) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) SupportsInterface(interfaceId [4]byte) (bool, error) { return _NonfungiblePositionManager.Contract.SupportsInterface(&_NonfungiblePositionManager.CallOpts, interfaceId) } // Symbol is a free data retrieval call binding the contract method 0x95d89b41. // // Solidity: function symbol() view returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) Symbol(opts *bind.CallOpts) (string, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "symbol") if err != nil { return *new(string), err } out0 := *abi.ConvertType(out[0], new(string)).(*string) return out0, err } // Symbol is a free data retrieval call binding the contract method 0x95d89b41. // // Solidity: function symbol() view returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Symbol() (string, error) { return _NonfungiblePositionManager.Contract.Symbol(&_NonfungiblePositionManager.CallOpts) } // Symbol is a free data retrieval call binding the contract method 0x95d89b41. // // Solidity: function symbol() view returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) Symbol() (string, error) { return _NonfungiblePositionManager.Contract.Symbol(&_NonfungiblePositionManager.CallOpts) } // TokenByIndex is a free data retrieval call binding the contract method 0x4f6ccce7. // // Solidity: function tokenByIndex(uint256 index) view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) TokenByIndex(opts *bind.CallOpts, index *big.Int) (*big.Int, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "tokenByIndex", index) if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // TokenByIndex is a free data retrieval call binding the contract method 0x4f6ccce7. // // Solidity: function tokenByIndex(uint256 index) view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) TokenByIndex(index *big.Int) (*big.Int, error) { return _NonfungiblePositionManager.Contract.TokenByIndex(&_NonfungiblePositionManager.CallOpts, index) } // TokenByIndex is a free data retrieval call binding the contract method 0x4f6ccce7. // // Solidity: function tokenByIndex(uint256 index) view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) TokenByIndex(index *big.Int) (*big.Int, error) { return _NonfungiblePositionManager.Contract.TokenByIndex(&_NonfungiblePositionManager.CallOpts, index) } // TokenOfOwnerByIndex is a free data retrieval call binding the contract method 0x2f745c59. // // Solidity: function tokenOfOwnerByIndex(address owner, uint256 index) view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) TokenOfOwnerByIndex(opts *bind.CallOpts, owner common.Address, index *big.Int) (*big.Int, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "tokenOfOwnerByIndex", owner, index) if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // TokenOfOwnerByIndex is a free data retrieval call binding the contract method 0x2f745c59. // // Solidity: function tokenOfOwnerByIndex(address owner, uint256 index) view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) TokenOfOwnerByIndex(owner common.Address, index *big.Int) (*big.Int, error) { return _NonfungiblePositionManager.Contract.TokenOfOwnerByIndex(&_NonfungiblePositionManager.CallOpts, owner, index) } // TokenOfOwnerByIndex is a free data retrieval call binding the contract method 0x2f745c59. // // Solidity: function tokenOfOwnerByIndex(address owner, uint256 index) view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) TokenOfOwnerByIndex(owner common.Address, index *big.Int) (*big.Int, error) { return _NonfungiblePositionManager.Contract.TokenOfOwnerByIndex(&_NonfungiblePositionManager.CallOpts, owner, index) } // TokenURI is a free data retrieval call binding the contract method 0xc87b56dd. // // Solidity: function tokenURI(uint256 tokenId) view returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) TokenURI(opts *bind.CallOpts, tokenId *big.Int) (string, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "tokenURI", tokenId) if err != nil { return *new(string), err } out0 := *abi.ConvertType(out[0], new(string)).(*string) return out0, err } // TokenURI is a free data retrieval call binding the contract method 0xc87b56dd. // // Solidity: function tokenURI(uint256 tokenId) view returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) TokenURI(tokenId *big.Int) (string, error) { return _NonfungiblePositionManager.Contract.TokenURI(&_NonfungiblePositionManager.CallOpts, tokenId) } // TokenURI is a free data retrieval call binding the contract method 0xc87b56dd. // // Solidity: function tokenURI(uint256 tokenId) view returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) TokenURI(tokenId *big.Int) (string, error) { return _NonfungiblePositionManager.Contract.TokenURI(&_NonfungiblePositionManager.CallOpts, tokenId) } // TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. // // Solidity: function totalSupply() view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) TotalSupply(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "totalSupply") if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. // // Solidity: function totalSupply() view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) TotalSupply() (*big.Int, error) { return _NonfungiblePositionManager.Contract.TotalSupply(&_NonfungiblePositionManager.CallOpts) } // TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. // // Solidity: function totalSupply() view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) TotalSupply() (*big.Int, error) { return _NonfungiblePositionManager.Contract.TotalSupply(&_NonfungiblePositionManager.CallOpts) } // AlgebraMintCallback is a paid mutator transaction binding the contract method 0x3dd657c5. // // Solidity: function algebraMintCallback(uint256 amount0Owed, uint256 amount1Owed, bytes data) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) AlgebraMintCallback(opts *bind.TransactOpts, amount0Owed *big.Int, amount1Owed *big.Int, data []byte) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "algebraMintCallback", amount0Owed, amount1Owed, data) } // AlgebraMintCallback is a paid mutator transaction binding the contract method 0x3dd657c5. // // Solidity: function algebraMintCallback(uint256 amount0Owed, uint256 amount1Owed, bytes data) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) AlgebraMintCallback(amount0Owed *big.Int, amount1Owed *big.Int, data []byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.AlgebraMintCallback(&_NonfungiblePositionManager.TransactOpts, amount0Owed, amount1Owed, data) } // AlgebraMintCallback is a paid mutator transaction binding the contract method 0x3dd657c5. // // Solidity: function algebraMintCallback(uint256 amount0Owed, uint256 amount1Owed, bytes data) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) AlgebraMintCallback(amount0Owed *big.Int, amount1Owed *big.Int, data []byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.AlgebraMintCallback(&_NonfungiblePositionManager.TransactOpts, amount0Owed, amount1Owed, data) } // Approve is a paid mutator transaction binding the contract method 0x095ea7b3. // // Solidity: function approve(address to, uint256 tokenId) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) Approve(opts *bind.TransactOpts, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "approve", to, tokenId) } // Approve is a paid mutator transaction binding the contract method 0x095ea7b3. // // Solidity: function approve(address to, uint256 tokenId) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Approve(to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Approve(&_NonfungiblePositionManager.TransactOpts, to, tokenId) } // Approve is a paid mutator transaction binding the contract method 0x095ea7b3. // // Solidity: function approve(address to, uint256 tokenId) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) Approve(to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Approve(&_NonfungiblePositionManager.TransactOpts, to, tokenId) } // Burn is a paid mutator transaction binding the contract method 0x42966c68. // // Solidity: function burn(uint256 tokenId) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) Burn(opts *bind.TransactOpts, tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "burn", tokenId) } // Burn is a paid mutator transaction binding the contract method 0x42966c68. // // Solidity: function burn(uint256 tokenId) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Burn(tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Burn(&_NonfungiblePositionManager.TransactOpts, tokenId) } // Burn is a paid mutator transaction binding the contract method 0x42966c68. // // Solidity: function burn(uint256 tokenId) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) Burn(tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Burn(&_NonfungiblePositionManager.TransactOpts, tokenId) } // Collect is a paid mutator transaction binding the contract method 0xfc6f7865. // // Solidity: function collect((uint256,address,uint128,uint128) params) payable returns(uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) Collect(opts *bind.TransactOpts, params INonfungiblePositionManagerCollectParams) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "collect", params) } // Collect is a paid mutator transaction binding the contract method 0xfc6f7865. // // Solidity: function collect((uint256,address,uint128,uint128) params) payable returns(uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Collect(params INonfungiblePositionManagerCollectParams) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Collect(&_NonfungiblePositionManager.TransactOpts, params) } // Collect is a paid mutator transaction binding the contract method 0xfc6f7865. // // Solidity: function collect((uint256,address,uint128,uint128) params) payable returns(uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) Collect(params INonfungiblePositionManagerCollectParams) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Collect(&_NonfungiblePositionManager.TransactOpts, params) } // CreateAndInitializePoolIfNecessary is a paid mutator transaction binding the contract method 0x51246d6e. // // Solidity: function createAndInitializePoolIfNecessary(address token0, address token1, uint160 sqrtPriceX96) payable returns(address pool) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) CreateAndInitializePoolIfNecessary(opts *bind.TransactOpts, token0 common.Address, token1 common.Address, sqrtPriceX96 *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "createAndInitializePoolIfNecessary", token0, token1, sqrtPriceX96) } // CreateAndInitializePoolIfNecessary is a paid mutator transaction binding the contract method 0x51246d6e. // // Solidity: function createAndInitializePoolIfNecessary(address token0, address token1, uint160 sqrtPriceX96) payable returns(address pool) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) CreateAndInitializePoolIfNecessary(token0 common.Address, token1 common.Address, sqrtPriceX96 *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.CreateAndInitializePoolIfNecessary(&_NonfungiblePositionManager.TransactOpts, token0, token1, sqrtPriceX96) } // CreateAndInitializePoolIfNecessary is a paid mutator transaction binding the contract method 0x51246d6e. // // Solidity: function createAndInitializePoolIfNecessary(address token0, address token1, uint160 sqrtPriceX96) payable returns(address pool) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) CreateAndInitializePoolIfNecessary(token0 common.Address, token1 common.Address, sqrtPriceX96 *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.CreateAndInitializePoolIfNecessary(&_NonfungiblePositionManager.TransactOpts, token0, token1, sqrtPriceX96) } // DecreaseLiquidity is a paid mutator transaction binding the contract method 0x0c49ccbe. // // Solidity: function decreaseLiquidity((uint256,uint128,uint256,uint256,uint256) params) payable returns(uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) DecreaseLiquidity(opts *bind.TransactOpts, params INonfungiblePositionManagerDecreaseLiquidityParams) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "decreaseLiquidity", params) } // DecreaseLiquidity is a paid mutator transaction binding the contract method 0x0c49ccbe. // // Solidity: function decreaseLiquidity((uint256,uint128,uint256,uint256,uint256) params) payable returns(uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) DecreaseLiquidity(params INonfungiblePositionManagerDecreaseLiquidityParams) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.DecreaseLiquidity(&_NonfungiblePositionManager.TransactOpts, params) } // DecreaseLiquidity is a paid mutator transaction binding the contract method 0x0c49ccbe. // // Solidity: function decreaseLiquidity((uint256,uint128,uint256,uint256,uint256) params) payable returns(uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) DecreaseLiquidity(params INonfungiblePositionManagerDecreaseLiquidityParams) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.DecreaseLiquidity(&_NonfungiblePositionManager.TransactOpts, params) } // IncreaseLiquidity is a paid mutator transaction binding the contract method 0x219f5d17. // // Solidity: function increaseLiquidity((uint256,uint256,uint256,uint256,uint256,uint256) params) payable returns(uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) IncreaseLiquidity(opts *bind.TransactOpts, params INonfungiblePositionManagerIncreaseLiquidityParams) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "increaseLiquidity", params) } // IncreaseLiquidity is a paid mutator transaction binding the contract method 0x219f5d17. // // Solidity: function increaseLiquidity((uint256,uint256,uint256,uint256,uint256,uint256) params) payable returns(uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) IncreaseLiquidity(params INonfungiblePositionManagerIncreaseLiquidityParams) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.IncreaseLiquidity(&_NonfungiblePositionManager.TransactOpts, params) } // IncreaseLiquidity is a paid mutator transaction binding the contract method 0x219f5d17. // // Solidity: function increaseLiquidity((uint256,uint256,uint256,uint256,uint256,uint256) params) payable returns(uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) IncreaseLiquidity(params INonfungiblePositionManagerIncreaseLiquidityParams) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.IncreaseLiquidity(&_NonfungiblePositionManager.TransactOpts, params) } // Mint is a paid mutator transaction binding the contract method 0x9cc1a283. // // Solidity: function mint((address,address,int24,int24,uint256,uint256,uint256,uint256,address,uint256) params) payable returns(uint256 tokenId, uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) Mint(opts *bind.TransactOpts, params INonfungiblePositionManagerMintParams) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "mint", params) } // Mint is a paid mutator transaction binding the contract method 0x9cc1a283. // // Solidity: function mint((address,address,int24,int24,uint256,uint256,uint256,uint256,address,uint256) params) payable returns(uint256 tokenId, uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Mint(params INonfungiblePositionManagerMintParams) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Mint(&_NonfungiblePositionManager.TransactOpts, params) } // Mint is a paid mutator transaction binding the contract method 0x9cc1a283. // // Solidity: function mint((address,address,int24,int24,uint256,uint256,uint256,uint256,address,uint256) params) payable returns(uint256 tokenId, uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) Mint(params INonfungiblePositionManagerMintParams) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Mint(&_NonfungiblePositionManager.TransactOpts, params) } // Multicall is a paid mutator transaction binding the contract method 0xac9650d8. // // Solidity: function multicall(bytes[] data) payable returns(bytes[] results) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) Multicall(opts *bind.TransactOpts, data [][]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "multicall", data) } // Multicall is a paid mutator transaction binding the contract method 0xac9650d8. // // Solidity: function multicall(bytes[] data) payable returns(bytes[] results) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Multicall(data [][]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Multicall(&_NonfungiblePositionManager.TransactOpts, data) } // Multicall is a paid mutator transaction binding the contract method 0xac9650d8. // // Solidity: function multicall(bytes[] data) payable returns(bytes[] results) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) Multicall(data [][]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Multicall(&_NonfungiblePositionManager.TransactOpts, data) } // Permit is a paid mutator transaction binding the contract method 0x7ac2ff7b. // // Solidity: function permit(address spender, uint256 tokenId, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) Permit(opts *bind.TransactOpts, spender common.Address, tokenId *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "permit", spender, tokenId, deadline, v, r, s) } // Permit is a paid mutator transaction binding the contract method 0x7ac2ff7b. // // Solidity: function permit(address spender, uint256 tokenId, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Permit(spender common.Address, tokenId *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Permit(&_NonfungiblePositionManager.TransactOpts, spender, tokenId, deadline, v, r, s) } // Permit is a paid mutator transaction binding the contract method 0x7ac2ff7b. // // Solidity: function permit(address spender, uint256 tokenId, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) Permit(spender common.Address, tokenId *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Permit(&_NonfungiblePositionManager.TransactOpts, spender, tokenId, deadline, v, r, s) } // RefundNativeToken is a paid mutator transaction binding the contract method 0x41865270. // // Solidity: function refundNativeToken() payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) RefundNativeToken(opts *bind.TransactOpts) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "refundNativeToken") } // RefundNativeToken is a paid mutator transaction binding the contract method 0x41865270. // // Solidity: function refundNativeToken() payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) RefundNativeToken() (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.RefundNativeToken(&_NonfungiblePositionManager.TransactOpts) } // RefundNativeToken is a paid mutator transaction binding the contract method 0x41865270. // // Solidity: function refundNativeToken() payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) RefundNativeToken() (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.RefundNativeToken(&_NonfungiblePositionManager.TransactOpts) } // SafeTransferFrom is a paid mutator transaction binding the contract method 0x42842e0e. // // Solidity: function safeTransferFrom(address from, address to, uint256 tokenId) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) SafeTransferFrom(opts *bind.TransactOpts, from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "safeTransferFrom", from, to, tokenId) } // SafeTransferFrom is a paid mutator transaction binding the contract method 0x42842e0e. // // Solidity: function safeTransferFrom(address from, address to, uint256 tokenId) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) SafeTransferFrom(from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SafeTransferFrom(&_NonfungiblePositionManager.TransactOpts, from, to, tokenId) } // SafeTransferFrom is a paid mutator transaction binding the contract method 0x42842e0e. // // Solidity: function safeTransferFrom(address from, address to, uint256 tokenId) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) SafeTransferFrom(from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SafeTransferFrom(&_NonfungiblePositionManager.TransactOpts, from, to, tokenId) } // SafeTransferFrom0 is a paid mutator transaction binding the contract method 0xb88d4fde. // // Solidity: function safeTransferFrom(address from, address to, uint256 tokenId, bytes _data) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) SafeTransferFrom0(opts *bind.TransactOpts, from common.Address, to common.Address, tokenId *big.Int, _data []byte) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "safeTransferFrom0", from, to, tokenId, _data) } // SafeTransferFrom0 is a paid mutator transaction binding the contract method 0xb88d4fde. // // Solidity: function safeTransferFrom(address from, address to, uint256 tokenId, bytes _data) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) SafeTransferFrom0(from common.Address, to common.Address, tokenId *big.Int, _data []byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SafeTransferFrom0(&_NonfungiblePositionManager.TransactOpts, from, to, tokenId, _data) } // SafeTransferFrom0 is a paid mutator transaction binding the contract method 0xb88d4fde. // // Solidity: function safeTransferFrom(address from, address to, uint256 tokenId, bytes _data) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) SafeTransferFrom0(from common.Address, to common.Address, tokenId *big.Int, _data []byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SafeTransferFrom0(&_NonfungiblePositionManager.TransactOpts, from, to, tokenId, _data) } // SelfPermit is a paid mutator transaction binding the contract method 0xf3995c67. // // Solidity: function selfPermit(address token, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) SelfPermit(opts *bind.TransactOpts, token common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "selfPermit", token, value, deadline, v, r, s) } // SelfPermit is a paid mutator transaction binding the contract method 0xf3995c67. // // Solidity: function selfPermit(address token, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) SelfPermit(token common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SelfPermit(&_NonfungiblePositionManager.TransactOpts, token, value, deadline, v, r, s) } // SelfPermit is a paid mutator transaction binding the contract method 0xf3995c67. // // Solidity: function selfPermit(address token, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) SelfPermit(token common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SelfPermit(&_NonfungiblePositionManager.TransactOpts, token, value, deadline, v, r, s) } // SelfPermitAllowed is a paid mutator transaction binding the contract method 0x4659a494. // // Solidity: function selfPermitAllowed(address token, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) SelfPermitAllowed(opts *bind.TransactOpts, token common.Address, nonce *big.Int, expiry *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "selfPermitAllowed", token, nonce, expiry, v, r, s) } // SelfPermitAllowed is a paid mutator transaction binding the contract method 0x4659a494. // // Solidity: function selfPermitAllowed(address token, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) SelfPermitAllowed(token common.Address, nonce *big.Int, expiry *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SelfPermitAllowed(&_NonfungiblePositionManager.TransactOpts, token, nonce, expiry, v, r, s) } // SelfPermitAllowed is a paid mutator transaction binding the contract method 0x4659a494. // // Solidity: function selfPermitAllowed(address token, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) SelfPermitAllowed(token common.Address, nonce *big.Int, expiry *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SelfPermitAllowed(&_NonfungiblePositionManager.TransactOpts, token, nonce, expiry, v, r, s) } // SelfPermitAllowedIfNecessary is a paid mutator transaction binding the contract method 0xa4a78f0c. // // Solidity: function selfPermitAllowedIfNecessary(address token, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) SelfPermitAllowedIfNecessary(opts *bind.TransactOpts, token common.Address, nonce *big.Int, expiry *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "selfPermitAllowedIfNecessary", token, nonce, expiry, v, r, s) } // SelfPermitAllowedIfNecessary is a paid mutator transaction binding the contract method 0xa4a78f0c. // // Solidity: function selfPermitAllowedIfNecessary(address token, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) SelfPermitAllowedIfNecessary(token common.Address, nonce *big.Int, expiry *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SelfPermitAllowedIfNecessary(&_NonfungiblePositionManager.TransactOpts, token, nonce, expiry, v, r, s) } // SelfPermitAllowedIfNecessary is a paid mutator transaction binding the contract method 0xa4a78f0c. // // Solidity: function selfPermitAllowedIfNecessary(address token, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) SelfPermitAllowedIfNecessary(token common.Address, nonce *big.Int, expiry *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SelfPermitAllowedIfNecessary(&_NonfungiblePositionManager.TransactOpts, token, nonce, expiry, v, r, s) } // SelfPermitIfNecessary is a paid mutator transaction binding the contract method 0xc2e3140a. // // Solidity: function selfPermitIfNecessary(address token, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) SelfPermitIfNecessary(opts *bind.TransactOpts, token common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "selfPermitIfNecessary", token, value, deadline, v, r, s) } // SelfPermitIfNecessary is a paid mutator transaction binding the contract method 0xc2e3140a. // // Solidity: function selfPermitIfNecessary(address token, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) SelfPermitIfNecessary(token common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SelfPermitIfNecessary(&_NonfungiblePositionManager.TransactOpts, token, value, deadline, v, r, s) } // SelfPermitIfNecessary is a paid mutator transaction binding the contract method 0xc2e3140a. // // Solidity: function selfPermitIfNecessary(address token, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) SelfPermitIfNecessary(token common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SelfPermitIfNecessary(&_NonfungiblePositionManager.TransactOpts, token, value, deadline, v, r, s) } // SetApprovalForAll is a paid mutator transaction binding the contract method 0xa22cb465. // // Solidity: function setApprovalForAll(address operator, bool approved) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) SetApprovalForAll(opts *bind.TransactOpts, operator common.Address, approved bool) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "setApprovalForAll", operator, approved) } // SetApprovalForAll is a paid mutator transaction binding the contract method 0xa22cb465. // // Solidity: function setApprovalForAll(address operator, bool approved) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) SetApprovalForAll(operator common.Address, approved bool) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SetApprovalForAll(&_NonfungiblePositionManager.TransactOpts, operator, approved) } // SetApprovalForAll is a paid mutator transaction binding the contract method 0xa22cb465. // // Solidity: function setApprovalForAll(address operator, bool approved) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) SetApprovalForAll(operator common.Address, approved bool) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SetApprovalForAll(&_NonfungiblePositionManager.TransactOpts, operator, approved) } // SweepToken is a paid mutator transaction binding the contract method 0xdf2ab5bb. // // Solidity: function sweepToken(address token, uint256 amountMinimum, address recipient) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) SweepToken(opts *bind.TransactOpts, token common.Address, amountMinimum *big.Int, recipient common.Address) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "sweepToken", token, amountMinimum, recipient) } // SweepToken is a paid mutator transaction binding the contract method 0xdf2ab5bb. // // Solidity: function sweepToken(address token, uint256 amountMinimum, address recipient) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) SweepToken(token common.Address, amountMinimum *big.Int, recipient common.Address) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SweepToken(&_NonfungiblePositionManager.TransactOpts, token, amountMinimum, recipient) } // SweepToken is a paid mutator transaction binding the contract method 0xdf2ab5bb. // // Solidity: function sweepToken(address token, uint256 amountMinimum, address recipient) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) SweepToken(token common.Address, amountMinimum *big.Int, recipient common.Address) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SweepToken(&_NonfungiblePositionManager.TransactOpts, token, amountMinimum, recipient) } // TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. // // Solidity: function transferFrom(address from, address to, uint256 tokenId) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) TransferFrom(opts *bind.TransactOpts, from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "transferFrom", from, to, tokenId) } // TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. // // Solidity: function transferFrom(address from, address to, uint256 tokenId) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) TransferFrom(from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.TransferFrom(&_NonfungiblePositionManager.TransactOpts, from, to, tokenId) } // TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. // // Solidity: function transferFrom(address from, address to, uint256 tokenId) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) TransferFrom(from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.TransferFrom(&_NonfungiblePositionManager.TransactOpts, from, to, tokenId) } // UnwrapWNativeToken is a paid mutator transaction binding the contract method 0x69bc35b2. // // Solidity: function unwrapWNativeToken(uint256 amountMinimum, address recipient) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) UnwrapWNativeToken(opts *bind.TransactOpts, amountMinimum *big.Int, recipient common.Address) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "unwrapWNativeToken", amountMinimum, recipient) } // UnwrapWNativeToken is a paid mutator transaction binding the contract method 0x69bc35b2. // // Solidity: function unwrapWNativeToken(uint256 amountMinimum, address recipient) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) UnwrapWNativeToken(amountMinimum *big.Int, recipient common.Address) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.UnwrapWNativeToken(&_NonfungiblePositionManager.TransactOpts, amountMinimum, recipient) } // UnwrapWNativeToken is a paid mutator transaction binding the contract method 0x69bc35b2. // // Solidity: function unwrapWNativeToken(uint256 amountMinimum, address recipient) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) UnwrapWNativeToken(amountMinimum *big.Int, recipient common.Address) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.UnwrapWNativeToken(&_NonfungiblePositionManager.TransactOpts, amountMinimum, recipient) } // Receive is a paid mutator transaction binding the contract receive function. // // Solidity: receive() payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) Receive(opts *bind.TransactOpts) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.RawTransact(opts, nil) // calldata is disallowed for receive function } // Receive is a paid mutator transaction binding the contract receive function. // // Solidity: receive() payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Receive() (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Receive(&_NonfungiblePositionManager.TransactOpts) } // Receive is a paid mutator transaction binding the contract receive function. // // Solidity: receive() payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) Receive() (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Receive(&_NonfungiblePositionManager.TransactOpts) } // NonfungiblePositionManagerApprovalIterator is returned from FilterApproval and is used to iterate over the raw logs and unpacked data for Approval events raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerApprovalIterator struct { Event *NonfungiblePositionManagerApproval // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *NonfungiblePositionManagerApprovalIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerApproval) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerApproval) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *NonfungiblePositionManagerApprovalIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *NonfungiblePositionManagerApprovalIterator) Close() error { it.sub.Unsubscribe() return nil } // NonfungiblePositionManagerApproval represents a Approval event raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerApproval struct { Owner common.Address Approved common.Address TokenId *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterApproval is a free log retrieval operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. // // Solidity: event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) FilterApproval(opts *bind.FilterOpts, owner []common.Address, approved []common.Address, tokenId []*big.Int) (*NonfungiblePositionManagerApprovalIterator, error) { var ownerRule []interface{} for _, ownerItem := range owner { ownerRule = append(ownerRule, ownerItem) } var approvedRule []interface{} for _, approvedItem := range approved { approvedRule = append(approvedRule, approvedItem) } var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _NonfungiblePositionManager.contract.FilterLogs(opts, "Approval", ownerRule, approvedRule, tokenIdRule) if err != nil { return nil, err } return &NonfungiblePositionManagerApprovalIterator{contract: _NonfungiblePositionManager.contract, event: "Approval", logs: logs, sub: sub}, nil } // WatchApproval is a free log subscription operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. // // Solidity: event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) WatchApproval(opts *bind.WatchOpts, sink chan<- *NonfungiblePositionManagerApproval, owner []common.Address, approved []common.Address, tokenId []*big.Int) (event.Subscription, error) { var ownerRule []interface{} for _, ownerItem := range owner { ownerRule = append(ownerRule, ownerItem) } var approvedRule []interface{} for _, approvedItem := range approved { approvedRule = append(approvedRule, approvedItem) } var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _NonfungiblePositionManager.contract.WatchLogs(opts, "Approval", ownerRule, approvedRule, tokenIdRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(NonfungiblePositionManagerApproval) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "Approval", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseApproval is a log parse operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. // // Solidity: event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) ParseApproval(log types.Log) (*NonfungiblePositionManagerApproval, error) { event := new(NonfungiblePositionManagerApproval) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "Approval", log); err != nil { return nil, err } event.Raw = log return event, nil } // NonfungiblePositionManagerApprovalForAllIterator is returned from FilterApprovalForAll and is used to iterate over the raw logs and unpacked data for ApprovalForAll events raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerApprovalForAllIterator struct { Event *NonfungiblePositionManagerApprovalForAll // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *NonfungiblePositionManagerApprovalForAllIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerApprovalForAll) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerApprovalForAll) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *NonfungiblePositionManagerApprovalForAllIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *NonfungiblePositionManagerApprovalForAllIterator) Close() error { it.sub.Unsubscribe() return nil } // NonfungiblePositionManagerApprovalForAll represents a ApprovalForAll event raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerApprovalForAll struct { Owner common.Address Operator common.Address Approved bool Raw types.Log // Blockchain specific contextual infos } // FilterApprovalForAll is a free log retrieval operation binding the contract event 0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31. // // Solidity: event ApprovalForAll(address indexed owner, address indexed operator, bool approved) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) FilterApprovalForAll(opts *bind.FilterOpts, owner []common.Address, operator []common.Address) (*NonfungiblePositionManagerApprovalForAllIterator, error) { var ownerRule []interface{} for _, ownerItem := range owner { ownerRule = append(ownerRule, ownerItem) } var operatorRule []interface{} for _, operatorItem := range operator { operatorRule = append(operatorRule, operatorItem) } logs, sub, err := _NonfungiblePositionManager.contract.FilterLogs(opts, "ApprovalForAll", ownerRule, operatorRule) if err != nil { return nil, err } return &NonfungiblePositionManagerApprovalForAllIterator{contract: _NonfungiblePositionManager.contract, event: "ApprovalForAll", logs: logs, sub: sub}, nil } // WatchApprovalForAll is a free log subscription operation binding the contract event 0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31. // // Solidity: event ApprovalForAll(address indexed owner, address indexed operator, bool approved) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) WatchApprovalForAll(opts *bind.WatchOpts, sink chan<- *NonfungiblePositionManagerApprovalForAll, owner []common.Address, operator []common.Address) (event.Subscription, error) { var ownerRule []interface{} for _, ownerItem := range owner { ownerRule = append(ownerRule, ownerItem) } var operatorRule []interface{} for _, operatorItem := range operator { operatorRule = append(operatorRule, operatorItem) } logs, sub, err := _NonfungiblePositionManager.contract.WatchLogs(opts, "ApprovalForAll", ownerRule, operatorRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(NonfungiblePositionManagerApprovalForAll) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "ApprovalForAll", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseApprovalForAll is a log parse operation binding the contract event 0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31. // // Solidity: event ApprovalForAll(address indexed owner, address indexed operator, bool approved) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) ParseApprovalForAll(log types.Log) (*NonfungiblePositionManagerApprovalForAll, error) { event := new(NonfungiblePositionManagerApprovalForAll) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "ApprovalForAll", log); err != nil { return nil, err } event.Raw = log return event, nil } // NonfungiblePositionManagerCollectIterator is returned from FilterCollect and is used to iterate over the raw logs and unpacked data for Collect events raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerCollectIterator struct { Event *NonfungiblePositionManagerCollect // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *NonfungiblePositionManagerCollectIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerCollect) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerCollect) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *NonfungiblePositionManagerCollectIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *NonfungiblePositionManagerCollectIterator) Close() error { it.sub.Unsubscribe() return nil } // NonfungiblePositionManagerCollect represents a Collect event raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerCollect struct { TokenId *big.Int Recipient common.Address Amount0 *big.Int Amount1 *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterCollect is a free log retrieval operation binding the contract event 0x40d0efd1a53d60ecbf40971b9daf7dc90178c3aadc7aab1765632738fa8b8f01. // // Solidity: event Collect(uint256 indexed tokenId, address recipient, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) FilterCollect(opts *bind.FilterOpts, tokenId []*big.Int) (*NonfungiblePositionManagerCollectIterator, error) { var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _NonfungiblePositionManager.contract.FilterLogs(opts, "Collect", tokenIdRule) if err != nil { return nil, err } return &NonfungiblePositionManagerCollectIterator{contract: _NonfungiblePositionManager.contract, event: "Collect", logs: logs, sub: sub}, nil } // WatchCollect is a free log subscription operation binding the contract event 0x40d0efd1a53d60ecbf40971b9daf7dc90178c3aadc7aab1765632738fa8b8f01. // // Solidity: event Collect(uint256 indexed tokenId, address recipient, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) WatchCollect(opts *bind.WatchOpts, sink chan<- *NonfungiblePositionManagerCollect, tokenId []*big.Int) (event.Subscription, error) { var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _NonfungiblePositionManager.contract.WatchLogs(opts, "Collect", tokenIdRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(NonfungiblePositionManagerCollect) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "Collect", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseCollect is a log parse operation binding the contract event 0x40d0efd1a53d60ecbf40971b9daf7dc90178c3aadc7aab1765632738fa8b8f01. // // Solidity: event Collect(uint256 indexed tokenId, address recipient, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) ParseCollect(log types.Log) (*NonfungiblePositionManagerCollect, error) { event := new(NonfungiblePositionManagerCollect) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "Collect", log); err != nil { return nil, err } event.Raw = log return event, nil } // NonfungiblePositionManagerDecreaseLiquidityIterator is returned from FilterDecreaseLiquidity and is used to iterate over the raw logs and unpacked data for DecreaseLiquidity events raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerDecreaseLiquidityIterator struct { Event *NonfungiblePositionManagerDecreaseLiquidity // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *NonfungiblePositionManagerDecreaseLiquidityIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerDecreaseLiquidity) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerDecreaseLiquidity) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *NonfungiblePositionManagerDecreaseLiquidityIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *NonfungiblePositionManagerDecreaseLiquidityIterator) Close() error { it.sub.Unsubscribe() return nil } // NonfungiblePositionManagerDecreaseLiquidity represents a DecreaseLiquidity event raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerDecreaseLiquidity struct { TokenId *big.Int Liquidity *big.Int Amount0 *big.Int Amount1 *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterDecreaseLiquidity is a free log retrieval operation binding the contract event 0x26f6a048ee9138f2c0ce266f322cb99228e8d619ae2bff30c67f8dcf9d2377b4. // // Solidity: event DecreaseLiquidity(uint256 indexed tokenId, uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) FilterDecreaseLiquidity(opts *bind.FilterOpts, tokenId []*big.Int) (*NonfungiblePositionManagerDecreaseLiquidityIterator, error) { var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _NonfungiblePositionManager.contract.FilterLogs(opts, "DecreaseLiquidity", tokenIdRule) if err != nil { return nil, err } return &NonfungiblePositionManagerDecreaseLiquidityIterator{contract: _NonfungiblePositionManager.contract, event: "DecreaseLiquidity", logs: logs, sub: sub}, nil } // WatchDecreaseLiquidity is a free log subscription operation binding the contract event 0x26f6a048ee9138f2c0ce266f322cb99228e8d619ae2bff30c67f8dcf9d2377b4. // // Solidity: event DecreaseLiquidity(uint256 indexed tokenId, uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) WatchDecreaseLiquidity(opts *bind.WatchOpts, sink chan<- *NonfungiblePositionManagerDecreaseLiquidity, tokenId []*big.Int) (event.Subscription, error) { var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _NonfungiblePositionManager.contract.WatchLogs(opts, "DecreaseLiquidity", tokenIdRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(NonfungiblePositionManagerDecreaseLiquidity) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "DecreaseLiquidity", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseDecreaseLiquidity is a log parse operation binding the contract event 0x26f6a048ee9138f2c0ce266f322cb99228e8d619ae2bff30c67f8dcf9d2377b4. // // Solidity: event DecreaseLiquidity(uint256 indexed tokenId, uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) ParseDecreaseLiquidity(log types.Log) (*NonfungiblePositionManagerDecreaseLiquidity, error) { event := new(NonfungiblePositionManagerDecreaseLiquidity) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "DecreaseLiquidity", log); err != nil { return nil, err } event.Raw = log return event, nil } // NonfungiblePositionManagerIncreaseLiquidityIterator is returned from FilterIncreaseLiquidity and is used to iterate over the raw logs and unpacked data for IncreaseLiquidity events raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerIncreaseLiquidityIterator struct { Event *NonfungiblePositionManagerIncreaseLiquidity // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *NonfungiblePositionManagerIncreaseLiquidityIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerIncreaseLiquidity) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerIncreaseLiquidity) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *NonfungiblePositionManagerIncreaseLiquidityIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *NonfungiblePositionManagerIncreaseLiquidityIterator) Close() error { it.sub.Unsubscribe() return nil } // NonfungiblePositionManagerIncreaseLiquidity represents a IncreaseLiquidity event raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerIncreaseLiquidity struct { TokenId *big.Int Liquidity *big.Int ActualLiquidity *big.Int Amount0 *big.Int Amount1 *big.Int Pool common.Address Raw types.Log // Blockchain specific contextual infos } // FilterIncreaseLiquidity is a free log retrieval operation binding the contract event 0x8a82de7fe9b33e0e6bca0e26f5bd14a74f1164ffe236d50e0a36c3ea70f2b814. // // Solidity: event IncreaseLiquidity(uint256 indexed tokenId, uint128 liquidity, uint128 actualLiquidity, uint256 amount0, uint256 amount1, address pool) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) FilterIncreaseLiquidity(opts *bind.FilterOpts, tokenId []*big.Int) (*NonfungiblePositionManagerIncreaseLiquidityIterator, error) { var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _NonfungiblePositionManager.contract.FilterLogs(opts, "IncreaseLiquidity", tokenIdRule) if err != nil { return nil, err } return &NonfungiblePositionManagerIncreaseLiquidityIterator{contract: _NonfungiblePositionManager.contract, event: "IncreaseLiquidity", logs: logs, sub: sub}, nil } // WatchIncreaseLiquidity is a free log subscription operation binding the contract event 0x8a82de7fe9b33e0e6bca0e26f5bd14a74f1164ffe236d50e0a36c3ea70f2b814. // // Solidity: event IncreaseLiquidity(uint256 indexed tokenId, uint128 liquidity, uint128 actualLiquidity, uint256 amount0, uint256 amount1, address pool) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) WatchIncreaseLiquidity(opts *bind.WatchOpts, sink chan<- *NonfungiblePositionManagerIncreaseLiquidity, tokenId []*big.Int) (event.Subscription, error) { var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _NonfungiblePositionManager.contract.WatchLogs(opts, "IncreaseLiquidity", tokenIdRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(NonfungiblePositionManagerIncreaseLiquidity) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "IncreaseLiquidity", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseIncreaseLiquidity is a log parse operation binding the contract event 0x8a82de7fe9b33e0e6bca0e26f5bd14a74f1164ffe236d50e0a36c3ea70f2b814. // // Solidity: event IncreaseLiquidity(uint256 indexed tokenId, uint128 liquidity, uint128 actualLiquidity, uint256 amount0, uint256 amount1, address pool) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) ParseIncreaseLiquidity(log types.Log) (*NonfungiblePositionManagerIncreaseLiquidity, error) { event := new(NonfungiblePositionManagerIncreaseLiquidity) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "IncreaseLiquidity", log); err != nil { return nil, err } event.Raw = log return event, nil } // NonfungiblePositionManagerTransferIterator is returned from FilterTransfer and is used to iterate over the raw logs and unpacked data for Transfer events raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerTransferIterator struct { Event *NonfungiblePositionManagerTransfer // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *NonfungiblePositionManagerTransferIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerTransfer) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerTransfer) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *NonfungiblePositionManagerTransferIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *NonfungiblePositionManagerTransferIterator) Close() error { it.sub.Unsubscribe() return nil } // NonfungiblePositionManagerTransfer represents a Transfer event raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerTransfer struct { From common.Address To common.Address TokenId *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterTransfer is a free log retrieval operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. // // Solidity: event Transfer(address indexed from, address indexed to, uint256 indexed tokenId) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) FilterTransfer(opts *bind.FilterOpts, from []common.Address, to []common.Address, tokenId []*big.Int) (*NonfungiblePositionManagerTransferIterator, error) { var fromRule []interface{} for _, fromItem := range from { fromRule = append(fromRule, fromItem) } var toRule []interface{} for _, toItem := range to { toRule = append(toRule, toItem) } var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _NonfungiblePositionManager.contract.FilterLogs(opts, "Transfer", fromRule, toRule, tokenIdRule) if err != nil { return nil, err } return &NonfungiblePositionManagerTransferIterator{contract: _NonfungiblePositionManager.contract, event: "Transfer", logs: logs, sub: sub}, nil } // WatchTransfer is a free log subscription operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. // // Solidity: event Transfer(address indexed from, address indexed to, uint256 indexed tokenId) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) WatchTransfer(opts *bind.WatchOpts, sink chan<- *NonfungiblePositionManagerTransfer, from []common.Address, to []common.Address, tokenId []*big.Int) (event.Subscription, error) { var fromRule []interface{} for _, fromItem := range from { fromRule = append(fromRule, fromItem) } var toRule []interface{} for _, toItem := range to { toRule = append(toRule, toItem) } var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _NonfungiblePositionManager.contract.WatchLogs(opts, "Transfer", fromRule, toRule, tokenIdRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(NonfungiblePositionManagerTransfer) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "Transfer", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseTransfer is a log parse operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. // // Solidity: event Transfer(address indexed from, address indexed to, uint256 indexed tokenId) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) ParseTransfer(log types.Log) (*NonfungiblePositionManagerTransfer, error) { event := new(NonfungiblePositionManagerTransfer) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "Transfer", log); err != nil { return nil, err } event.Raw = log return event, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/binds/apechainnonfungiblepositionmanager/abi.json ================================================ [ { "inputs": [ { "internalType": "address", "name": "_factory", "type": "address" }, { "internalType": "address", "name": "_WNativeToken", "type": "address" }, { "internalType": "address", "name": "_tokenDescriptor_", "type": "address" }, { "internalType": "address", "name": "_poolDeployer", "type": "address" } ], "stateMutability": "nonpayable", "type": "constructor" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "owner", "type": "address" }, { "indexed": true, "internalType": "address", "name": "approved", "type": "address" }, { "indexed": true, "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "Approval", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "owner", "type": "address" }, { "indexed": true, "internalType": "address", "name": "operator", "type": "address" }, { "indexed": false, "internalType": "bool", "name": "approved", "type": "bool" } ], "name": "ApprovalForAll", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "indexed": false, "internalType": "address", "name": "recipient", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "amount0", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "amount1", "type": "uint256" } ], "name": "Collect", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "indexed": false, "internalType": "uint128", "name": "liquidity", "type": "uint128" }, { "indexed": false, "internalType": "uint256", "name": "amount0", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "amount1", "type": "uint256" } ], "name": "DecreaseLiquidity", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "indexed": false, "internalType": "uint128", "name": "liquidity", "type": "uint128" }, { "indexed": false, "internalType": "uint128", "name": "actualLiquidity", "type": "uint128" }, { "indexed": false, "internalType": "uint256", "name": "amount0", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "amount1", "type": "uint256" }, { "indexed": false, "internalType": "address", "name": "pool", "type": "address" } ], "name": "IncreaseLiquidity", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "from", "type": "address" }, { "indexed": true, "internalType": "address", "name": "to", "type": "address" }, { "indexed": true, "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "Transfer", "type": "event" }, { "inputs": [], "name": "DOMAIN_SEPARATOR", "outputs": [ { "internalType": "bytes32", "name": "", "type": "bytes32" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "PERMIT_TYPEHASH", "outputs": [ { "internalType": "bytes32", "name": "", "type": "bytes32" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "WNativeToken", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "amount0Owed", "type": "uint256" }, { "internalType": "uint256", "name": "amount1Owed", "type": "uint256" }, { "internalType": "bytes", "name": "data", "type": "bytes" } ], "name": "algebraMintCallback", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "to", "type": "address" }, { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "approve", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "owner", "type": "address" } ], "name": "balanceOf", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "baseURI", "outputs": [ { "internalType": "string", "name": "", "type": "string" } ], "stateMutability": "pure", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "burn", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "components": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "internalType": "address", "name": "recipient", "type": "address" }, { "internalType": "uint128", "name": "amount0Max", "type": "uint128" }, { "internalType": "uint128", "name": "amount1Max", "type": "uint128" } ], "internalType": "struct INonfungiblePositionManager.CollectParams", "name": "params", "type": "tuple" } ], "name": "collect", "outputs": [ { "internalType": "uint256", "name": "amount0", "type": "uint256" }, { "internalType": "uint256", "name": "amount1", "type": "uint256" } ], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "token0", "type": "address" }, { "internalType": "address", "name": "token1", "type": "address" }, { "internalType": "uint160", "name": "sqrtPriceX96", "type": "uint160" } ], "name": "createAndInitializePoolIfNecessary", "outputs": [ { "internalType": "address", "name": "pool", "type": "address" } ], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "components": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "internalType": "uint128", "name": "liquidity", "type": "uint128" }, { "internalType": "uint256", "name": "amount0Min", "type": "uint256" }, { "internalType": "uint256", "name": "amount1Min", "type": "uint256" }, { "internalType": "uint256", "name": "deadline", "type": "uint256" } ], "internalType": "struct INonfungiblePositionManager.DecreaseLiquidityParams", "name": "params", "type": "tuple" } ], "name": "decreaseLiquidity", "outputs": [ { "internalType": "uint256", "name": "amount0", "type": "uint256" }, { "internalType": "uint256", "name": "amount1", "type": "uint256" } ], "stateMutability": "payable", "type": "function" }, { "inputs": [], "name": "factory", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "getApproved", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "components": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "internalType": "uint256", "name": "amount0Desired", "type": "uint256" }, { "internalType": "uint256", "name": "amount1Desired", "type": "uint256" }, { "internalType": "uint256", "name": "amount0Min", "type": "uint256" }, { "internalType": "uint256", "name": "amount1Min", "type": "uint256" }, { "internalType": "uint256", "name": "deadline", "type": "uint256" } ], "internalType": "struct INonfungiblePositionManager.IncreaseLiquidityParams", "name": "params", "type": "tuple" } ], "name": "increaseLiquidity", "outputs": [ { "internalType": "uint128", "name": "liquidity", "type": "uint128" }, { "internalType": "uint256", "name": "amount0", "type": "uint256" }, { "internalType": "uint256", "name": "amount1", "type": "uint256" } ], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "owner", "type": "address" }, { "internalType": "address", "name": "operator", "type": "address" } ], "name": "isApprovedForAll", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "components": [ { "internalType": "address", "name": "token0", "type": "address" }, { "internalType": "address", "name": "token1", "type": "address" }, { "internalType": "int24", "name": "tickLower", "type": "int24" }, { "internalType": "int24", "name": "tickUpper", "type": "int24" }, { "internalType": "uint256", "name": "amount0Desired", "type": "uint256" }, { "internalType": "uint256", "name": "amount1Desired", "type": "uint256" }, { "internalType": "uint256", "name": "amount0Min", "type": "uint256" }, { "internalType": "uint256", "name": "amount1Min", "type": "uint256" }, { "internalType": "address", "name": "recipient", "type": "address" }, { "internalType": "uint256", "name": "deadline", "type": "uint256" } ], "internalType": "struct INonfungiblePositionManager.MintParams", "name": "params", "type": "tuple" } ], "name": "mint", "outputs": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "internalType": "uint128", "name": "liquidity", "type": "uint128" }, { "internalType": "uint256", "name": "amount0", "type": "uint256" }, { "internalType": "uint256", "name": "amount1", "type": "uint256" } ], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "bytes[]", "name": "data", "type": "bytes[]" } ], "name": "multicall", "outputs": [ { "internalType": "bytes[]", "name": "results", "type": "bytes[]" } ], "stateMutability": "payable", "type": "function" }, { "inputs": [], "name": "name", "outputs": [ { "internalType": "string", "name": "", "type": "string" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "ownerOf", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "spender", "type": "address" }, { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "internalType": "uint256", "name": "deadline", "type": "uint256" }, { "internalType": "uint8", "name": "v", "type": "uint8" }, { "internalType": "bytes32", "name": "r", "type": "bytes32" }, { "internalType": "bytes32", "name": "s", "type": "bytes32" } ], "name": "permit", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [], "name": "poolDeployer", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "positions", "outputs": [ { "internalType": "uint96", "name": "nonce", "type": "uint96" }, { "internalType": "address", "name": "operator", "type": "address" }, { "internalType": "address", "name": "token0", "type": "address" }, { "internalType": "address", "name": "token1", "type": "address" }, { "internalType": "int24", "name": "tickLower", "type": "int24" }, { "internalType": "int24", "name": "tickUpper", "type": "int24" }, { "internalType": "uint128", "name": "liquidity", "type": "uint128" }, { "internalType": "uint256", "name": "feeGrowthInside0LastX128", "type": "uint256" }, { "internalType": "uint256", "name": "feeGrowthInside1LastX128", "type": "uint256" }, { "internalType": "uint128", "name": "tokensOwed0", "type": "uint128" }, { "internalType": "uint128", "name": "tokensOwed1", "type": "uint128" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "refundNativeToken", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "from", "type": "address" }, { "internalType": "address", "name": "to", "type": "address" }, { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "safeTransferFrom", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "from", "type": "address" }, { "internalType": "address", "name": "to", "type": "address" }, { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "internalType": "bytes", "name": "_data", "type": "bytes" } ], "name": "safeTransferFrom", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "token", "type": "address" }, { "internalType": "uint256", "name": "value", "type": "uint256" }, { "internalType": "uint256", "name": "deadline", "type": "uint256" }, { "internalType": "uint8", "name": "v", "type": "uint8" }, { "internalType": "bytes32", "name": "r", "type": "bytes32" }, { "internalType": "bytes32", "name": "s", "type": "bytes32" } ], "name": "selfPermit", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "token", "type": "address" }, { "internalType": "uint256", "name": "nonce", "type": "uint256" }, { "internalType": "uint256", "name": "expiry", "type": "uint256" }, { "internalType": "uint8", "name": "v", "type": "uint8" }, { "internalType": "bytes32", "name": "r", "type": "bytes32" }, { "internalType": "bytes32", "name": "s", "type": "bytes32" } ], "name": "selfPermitAllowed", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "token", "type": "address" }, { "internalType": "uint256", "name": "nonce", "type": "uint256" }, { "internalType": "uint256", "name": "expiry", "type": "uint256" }, { "internalType": "uint8", "name": "v", "type": "uint8" }, { "internalType": "bytes32", "name": "r", "type": "bytes32" }, { "internalType": "bytes32", "name": "s", "type": "bytes32" } ], "name": "selfPermitAllowedIfNecessary", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "token", "type": "address" }, { "internalType": "uint256", "name": "value", "type": "uint256" }, { "internalType": "uint256", "name": "deadline", "type": "uint256" }, { "internalType": "uint8", "name": "v", "type": "uint8" }, { "internalType": "bytes32", "name": "r", "type": "bytes32" }, { "internalType": "bytes32", "name": "s", "type": "bytes32" } ], "name": "selfPermitIfNecessary", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "operator", "type": "address" }, { "internalType": "bool", "name": "approved", "type": "bool" } ], "name": "setApprovalForAll", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "bytes4", "name": "interfaceId", "type": "bytes4" } ], "name": "supportsInterface", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "token", "type": "address" }, { "internalType": "uint256", "name": "amountMinimum", "type": "uint256" }, { "internalType": "address", "name": "recipient", "type": "address" } ], "name": "sweepToken", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [], "name": "symbol", "outputs": [ { "internalType": "string", "name": "", "type": "string" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "index", "type": "uint256" } ], "name": "tokenByIndex", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "owner", "type": "address" }, { "internalType": "uint256", "name": "index", "type": "uint256" } ], "name": "tokenOfOwnerByIndex", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "tokenURI", "outputs": [ { "internalType": "string", "name": "", "type": "string" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "totalSupply", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "from", "type": "address" }, { "internalType": "address", "name": "to", "type": "address" }, { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "transferFrom", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "amountMinimum", "type": "uint256" }, { "internalType": "address", "name": "recipient", "type": "address" } ], "name": "unwrapWNativeToken", "outputs": [], "stateMutability": "payable", "type": "function" }, { "stateMutability": "payable", "type": "receive" } ] ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/binds/apechainpool/Pool.go ================================================ // Code generated - DO NOT EDIT. // This file is a generated binding and any manual changes will be lost. package apechainpool import ( "errors" "math/big" "strings" ethereum "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/event" ) // Reference imports to suppress errors if they are not otherwise used. var ( _ = errors.New _ = big.NewInt _ = strings.NewReader _ = ethereum.NotFound _ = bind.Bind _ = common.Big1 _ = types.BloomLookup _ = event.NewSubscription _ = abi.ConvertType ) // PoolMetaData contains all meta data concerning the Pool contract. var PoolMetaData = &bind.MetaData{ ABI: "[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"int24\",\"name\":\"bottomTick\",\"type\":\"int24\"},{\"indexed\":true,\"internalType\":\"int24\",\"name\":\"topTick\",\"type\":\"int24\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"liquidityAmount\",\"type\":\"uint128\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"}],\"name\":\"Burn\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"int24\",\"name\":\"bottomTick\",\"type\":\"int24\"},{\"indexed\":true,\"internalType\":\"int24\",\"name\":\"topTick\",\"type\":\"int24\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"amount0\",\"type\":\"uint128\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"amount1\",\"type\":\"uint128\"}],\"name\":\"Collect\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"communityFee0New\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"communityFee1New\",\"type\":\"uint8\"}],\"name\":\"CommunityFee\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"feeZto\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"feeOtz\",\"type\":\"uint16\"}],\"name\":\"Fee\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"paid0\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"paid1\",\"type\":\"uint256\"}],\"name\":\"Flash\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"virtualPoolAddress\",\"type\":\"address\"}],\"name\":\"Incentive\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint160\",\"name\":\"price\",\"type\":\"uint160\"},{\"indexed\":false,\"internalType\":\"int24\",\"name\":\"tick\",\"type\":\"int24\"}],\"name\":\"Initialize\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"liquidityCooldown\",\"type\":\"uint32\"}],\"name\":\"LiquidityCooldown\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"int24\",\"name\":\"bottomTick\",\"type\":\"int24\"},{\"indexed\":true,\"internalType\":\"int24\",\"name\":\"topTick\",\"type\":\"int24\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"liquidityAmount\",\"type\":\"uint128\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"}],\"name\":\"Mint\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"int256\",\"name\":\"amount0\",\"type\":\"int256\"},{\"indexed\":false,\"internalType\":\"int256\",\"name\":\"amount1\",\"type\":\"int256\"},{\"indexed\":false,\"internalType\":\"uint160\",\"name\":\"price\",\"type\":\"uint160\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"liquidity\",\"type\":\"uint128\"},{\"indexed\":false,\"internalType\":\"int24\",\"name\":\"tick\",\"type\":\"int24\"}],\"name\":\"Swap\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"int24\",\"name\":\"newTickSpacing\",\"type\":\"int24\"}],\"name\":\"TickSpacing\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"activeIncentive\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"int24\",\"name\":\"bottomTick\",\"type\":\"int24\"},{\"internalType\":\"int24\",\"name\":\"topTick\",\"type\":\"int24\"},{\"internalType\":\"uint128\",\"name\":\"amount\",\"type\":\"uint128\"}],\"name\":\"burn\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"int24\",\"name\":\"bottomTick\",\"type\":\"int24\"},{\"internalType\":\"int24\",\"name\":\"topTick\",\"type\":\"int24\"},{\"internalType\":\"uint128\",\"name\":\"amount0Requested\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"amount1Requested\",\"type\":\"uint128\"}],\"name\":\"collect\",\"outputs\":[{\"internalType\":\"uint128\",\"name\":\"amount0\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"amount1\",\"type\":\"uint128\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"dataStorageOperator\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"factory\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"flash\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"int24\",\"name\":\"bottomTick\",\"type\":\"int24\"},{\"internalType\":\"int24\",\"name\":\"topTick\",\"type\":\"int24\"}],\"name\":\"getInnerCumulatives\",\"outputs\":[{\"internalType\":\"int56\",\"name\":\"innerTickCumulative\",\"type\":\"int56\"},{\"internalType\":\"uint160\",\"name\":\"innerSecondsSpentPerLiquidity\",\"type\":\"uint160\"},{\"internalType\":\"uint32\",\"name\":\"innerSecondsSpent\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32[]\",\"name\":\"secondsAgos\",\"type\":\"uint32[]\"}],\"name\":\"getTimepoints\",\"outputs\":[{\"internalType\":\"int56[]\",\"name\":\"tickCumulatives\",\"type\":\"int56[]\"},{\"internalType\":\"uint160[]\",\"name\":\"secondsPerLiquidityCumulatives\",\"type\":\"uint160[]\"},{\"internalType\":\"uint112[]\",\"name\":\"volatilityCumulatives\",\"type\":\"uint112[]\"},{\"internalType\":\"uint256[]\",\"name\":\"volumePerAvgLiquiditys\",\"type\":\"uint256[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"globalState\",\"outputs\":[{\"internalType\":\"uint160\",\"name\":\"price\",\"type\":\"uint160\"},{\"internalType\":\"int24\",\"name\":\"tick\",\"type\":\"int24\"},{\"internalType\":\"uint16\",\"name\":\"feeZto\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"feeOtz\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"timepointIndex\",\"type\":\"uint16\"},{\"internalType\":\"uint8\",\"name\":\"communityFeeToken0\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"communityFeeToken1\",\"type\":\"uint8\"},{\"internalType\":\"bool\",\"name\":\"unlocked\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint160\",\"name\":\"initialPrice\",\"type\":\"uint160\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"liquidity\",\"outputs\":[{\"internalType\":\"uint128\",\"name\":\"\",\"type\":\"uint128\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"liquidityCooldown\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"maxLiquidityPerTick\",\"outputs\":[{\"internalType\":\"uint128\",\"name\":\"\",\"type\":\"uint128\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"int24\",\"name\":\"bottomTick\",\"type\":\"int24\"},{\"internalType\":\"int24\",\"name\":\"topTick\",\"type\":\"int24\"},{\"internalType\":\"uint128\",\"name\":\"liquidityDesired\",\"type\":\"uint128\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"mint\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"},{\"internalType\":\"uint128\",\"name\":\"liquidityActual\",\"type\":\"uint128\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"positions\",\"outputs\":[{\"internalType\":\"uint128\",\"name\":\"liquidity\",\"type\":\"uint128\"},{\"internalType\":\"uint32\",\"name\":\"lastLiquidityAddTimestamp\",\"type\":\"uint32\"},{\"internalType\":\"uint256\",\"name\":\"innerFeeGrowth0Token\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"innerFeeGrowth1Token\",\"type\":\"uint256\"},{\"internalType\":\"uint128\",\"name\":\"fees0\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"fees1\",\"type\":\"uint128\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"communityFee0\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"communityFee1\",\"type\":\"uint8\"}],\"name\":\"setCommunityFee\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"virtualPoolAddress\",\"type\":\"address\"}],\"name\":\"setIncentive\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"newLiquidityCooldown\",\"type\":\"uint32\"}],\"name\":\"setLiquidityCooldown\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"int24\",\"name\":\"newTickSpacing\",\"type\":\"int24\"}],\"name\":\"setTickSpacing\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"zeroToOne\",\"type\":\"bool\"},{\"internalType\":\"int256\",\"name\":\"amountRequired\",\"type\":\"int256\"},{\"internalType\":\"uint160\",\"name\":\"limitSqrtPrice\",\"type\":\"uint160\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"swap\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"amount0\",\"type\":\"int256\"},{\"internalType\":\"int256\",\"name\":\"amount1\",\"type\":\"int256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"zeroToOne\",\"type\":\"bool\"},{\"internalType\":\"int256\",\"name\":\"amountRequired\",\"type\":\"int256\"},{\"internalType\":\"uint160\",\"name\":\"limitSqrtPrice\",\"type\":\"uint160\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"swapSupportingFeeOnInputTokens\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"amount0\",\"type\":\"int256\"},{\"internalType\":\"int256\",\"name\":\"amount1\",\"type\":\"int256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"tickSpacing\",\"outputs\":[{\"internalType\":\"int24\",\"name\":\"\",\"type\":\"int24\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"int16\",\"name\":\"\",\"type\":\"int16\"}],\"name\":\"tickTable\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"int24\",\"name\":\"\",\"type\":\"int24\"}],\"name\":\"ticks\",\"outputs\":[{\"internalType\":\"uint128\",\"name\":\"liquidityTotal\",\"type\":\"uint128\"},{\"internalType\":\"int128\",\"name\":\"liquidityDelta\",\"type\":\"int128\"},{\"internalType\":\"uint256\",\"name\":\"outerFeeGrowth0Token\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"outerFeeGrowth1Token\",\"type\":\"uint256\"},{\"internalType\":\"int56\",\"name\":\"outerTickCumulative\",\"type\":\"int56\"},{\"internalType\":\"uint160\",\"name\":\"outerSecondsPerLiquidity\",\"type\":\"uint160\"},{\"internalType\":\"uint32\",\"name\":\"outerSecondsSpent\",\"type\":\"uint32\"},{\"internalType\":\"bool\",\"name\":\"initialized\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"}],\"name\":\"timepoints\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"initialized\",\"type\":\"bool\"},{\"internalType\":\"uint32\",\"name\":\"blockTimestamp\",\"type\":\"uint32\"},{\"internalType\":\"int56\",\"name\":\"tickCumulative\",\"type\":\"int56\"},{\"internalType\":\"uint160\",\"name\":\"secondsPerLiquidityCumulative\",\"type\":\"uint160\"},{\"internalType\":\"uint88\",\"name\":\"volatilityCumulative\",\"type\":\"uint88\"},{\"internalType\":\"int24\",\"name\":\"averageTick\",\"type\":\"int24\"},{\"internalType\":\"uint144\",\"name\":\"volumePerLiquidityCumulative\",\"type\":\"uint144\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"token0\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"token1\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalFeeGrowth0Token\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalFeeGrowth1Token\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", } // PoolABI is the input ABI used to generate the binding from. // Deprecated: Use PoolMetaData.ABI instead. var PoolABI = PoolMetaData.ABI // Pool is an auto generated Go binding around an Ethereum contract. type Pool struct { PoolCaller // Read-only binding to the contract PoolTransactor // Write-only binding to the contract PoolFilterer // Log filterer for contract events } // PoolCaller is an auto generated read-only Go binding around an Ethereum contract. type PoolCaller struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // PoolTransactor is an auto generated write-only Go binding around an Ethereum contract. type PoolTransactor struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // PoolFilterer is an auto generated log filtering Go binding around an Ethereum contract events. type PoolFilterer struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // PoolSession is an auto generated Go binding around an Ethereum contract, // with pre-set call and transact options. type PoolSession struct { Contract *Pool // Generic contract binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // PoolCallerSession is an auto generated read-only Go binding around an Ethereum contract, // with pre-set call options. type PoolCallerSession struct { Contract *PoolCaller // Generic contract caller binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session } // PoolTransactorSession is an auto generated write-only Go binding around an Ethereum contract, // with pre-set transact options. type PoolTransactorSession struct { Contract *PoolTransactor // Generic contract transactor binding to set the session for TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // PoolRaw is an auto generated low-level Go binding around an Ethereum contract. type PoolRaw struct { Contract *Pool // Generic contract binding to access the raw methods on } // PoolCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. type PoolCallerRaw struct { Contract *PoolCaller // Generic read-only contract binding to access the raw methods on } // PoolTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. type PoolTransactorRaw struct { Contract *PoolTransactor // Generic write-only contract binding to access the raw methods on } // NewPool creates a new instance of Pool, bound to a specific deployed contract. func NewPool(address common.Address, backend bind.ContractBackend) (*Pool, error) { contract, err := bindPool(address, backend, backend, backend) if err != nil { return nil, err } return &Pool{PoolCaller: PoolCaller{contract: contract}, PoolTransactor: PoolTransactor{contract: contract}, PoolFilterer: PoolFilterer{contract: contract}}, nil } // NewPoolCaller creates a new read-only instance of Pool, bound to a specific deployed contract. func NewPoolCaller(address common.Address, caller bind.ContractCaller) (*PoolCaller, error) { contract, err := bindPool(address, caller, nil, nil) if err != nil { return nil, err } return &PoolCaller{contract: contract}, nil } // NewPoolTransactor creates a new write-only instance of Pool, bound to a specific deployed contract. func NewPoolTransactor(address common.Address, transactor bind.ContractTransactor) (*PoolTransactor, error) { contract, err := bindPool(address, nil, transactor, nil) if err != nil { return nil, err } return &PoolTransactor{contract: contract}, nil } // NewPoolFilterer creates a new log filterer instance of Pool, bound to a specific deployed contract. func NewPoolFilterer(address common.Address, filterer bind.ContractFilterer) (*PoolFilterer, error) { contract, err := bindPool(address, nil, nil, filterer) if err != nil { return nil, err } return &PoolFilterer{contract: contract}, nil } // bindPool binds a generic wrapper to an already deployed contract. func bindPool(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { parsed, err := PoolMetaData.GetAbi() if err != nil { return nil, err } return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_Pool *PoolRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _Pool.Contract.PoolCaller.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_Pool *PoolRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _Pool.Contract.PoolTransactor.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_Pool *PoolRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _Pool.Contract.PoolTransactor.contract.Transact(opts, method, params...) } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_Pool *PoolCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _Pool.Contract.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_Pool *PoolTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _Pool.Contract.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_Pool *PoolTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _Pool.Contract.contract.Transact(opts, method, params...) } // ActiveIncentive is a free data retrieval call binding the contract method 0xfacb0eb1. // // Solidity: function activeIncentive() view returns(address) func (_Pool *PoolCaller) ActiveIncentive(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _Pool.contract.Call(opts, &out, "activeIncentive") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // ActiveIncentive is a free data retrieval call binding the contract method 0xfacb0eb1. // // Solidity: function activeIncentive() view returns(address) func (_Pool *PoolSession) ActiveIncentive() (common.Address, error) { return _Pool.Contract.ActiveIncentive(&_Pool.CallOpts) } // ActiveIncentive is a free data retrieval call binding the contract method 0xfacb0eb1. // // Solidity: function activeIncentive() view returns(address) func (_Pool *PoolCallerSession) ActiveIncentive() (common.Address, error) { return _Pool.Contract.ActiveIncentive(&_Pool.CallOpts) } // DataStorageOperator is a free data retrieval call binding the contract method 0x29047dfa. // // Solidity: function dataStorageOperator() view returns(address) func (_Pool *PoolCaller) DataStorageOperator(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _Pool.contract.Call(opts, &out, "dataStorageOperator") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // DataStorageOperator is a free data retrieval call binding the contract method 0x29047dfa. // // Solidity: function dataStorageOperator() view returns(address) func (_Pool *PoolSession) DataStorageOperator() (common.Address, error) { return _Pool.Contract.DataStorageOperator(&_Pool.CallOpts) } // DataStorageOperator is a free data retrieval call binding the contract method 0x29047dfa. // // Solidity: function dataStorageOperator() view returns(address) func (_Pool *PoolCallerSession) DataStorageOperator() (common.Address, error) { return _Pool.Contract.DataStorageOperator(&_Pool.CallOpts) } // Factory is a free data retrieval call binding the contract method 0xc45a0155. // // Solidity: function factory() view returns(address) func (_Pool *PoolCaller) Factory(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _Pool.contract.Call(opts, &out, "factory") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // Factory is a free data retrieval call binding the contract method 0xc45a0155. // // Solidity: function factory() view returns(address) func (_Pool *PoolSession) Factory() (common.Address, error) { return _Pool.Contract.Factory(&_Pool.CallOpts) } // Factory is a free data retrieval call binding the contract method 0xc45a0155. // // Solidity: function factory() view returns(address) func (_Pool *PoolCallerSession) Factory() (common.Address, error) { return _Pool.Contract.Factory(&_Pool.CallOpts) } // GetInnerCumulatives is a free data retrieval call binding the contract method 0x920c34e5. // // Solidity: function getInnerCumulatives(int24 bottomTick, int24 topTick) view returns(int56 innerTickCumulative, uint160 innerSecondsSpentPerLiquidity, uint32 innerSecondsSpent) func (_Pool *PoolCaller) GetInnerCumulatives(opts *bind.CallOpts, bottomTick *big.Int, topTick *big.Int) (struct { InnerTickCumulative *big.Int InnerSecondsSpentPerLiquidity *big.Int InnerSecondsSpent uint32 }, error) { var out []interface{} err := _Pool.contract.Call(opts, &out, "getInnerCumulatives", bottomTick, topTick) outstruct := new(struct { InnerTickCumulative *big.Int InnerSecondsSpentPerLiquidity *big.Int InnerSecondsSpent uint32 }) if err != nil { return *outstruct, err } outstruct.InnerTickCumulative = *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) outstruct.InnerSecondsSpentPerLiquidity = *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) outstruct.InnerSecondsSpent = *abi.ConvertType(out[2], new(uint32)).(*uint32) return *outstruct, err } // GetInnerCumulatives is a free data retrieval call binding the contract method 0x920c34e5. // // Solidity: function getInnerCumulatives(int24 bottomTick, int24 topTick) view returns(int56 innerTickCumulative, uint160 innerSecondsSpentPerLiquidity, uint32 innerSecondsSpent) func (_Pool *PoolSession) GetInnerCumulatives(bottomTick *big.Int, topTick *big.Int) (struct { InnerTickCumulative *big.Int InnerSecondsSpentPerLiquidity *big.Int InnerSecondsSpent uint32 }, error) { return _Pool.Contract.GetInnerCumulatives(&_Pool.CallOpts, bottomTick, topTick) } // GetInnerCumulatives is a free data retrieval call binding the contract method 0x920c34e5. // // Solidity: function getInnerCumulatives(int24 bottomTick, int24 topTick) view returns(int56 innerTickCumulative, uint160 innerSecondsSpentPerLiquidity, uint32 innerSecondsSpent) func (_Pool *PoolCallerSession) GetInnerCumulatives(bottomTick *big.Int, topTick *big.Int) (struct { InnerTickCumulative *big.Int InnerSecondsSpentPerLiquidity *big.Int InnerSecondsSpent uint32 }, error) { return _Pool.Contract.GetInnerCumulatives(&_Pool.CallOpts, bottomTick, topTick) } // GetTimepoints is a free data retrieval call binding the contract method 0x9d3a5241. // // Solidity: function getTimepoints(uint32[] secondsAgos) view returns(int56[] tickCumulatives, uint160[] secondsPerLiquidityCumulatives, uint112[] volatilityCumulatives, uint256[] volumePerAvgLiquiditys) func (_Pool *PoolCaller) GetTimepoints(opts *bind.CallOpts, secondsAgos []uint32) (struct { TickCumulatives []*big.Int SecondsPerLiquidityCumulatives []*big.Int VolatilityCumulatives []*big.Int VolumePerAvgLiquiditys []*big.Int }, error) { var out []interface{} err := _Pool.contract.Call(opts, &out, "getTimepoints", secondsAgos) outstruct := new(struct { TickCumulatives []*big.Int SecondsPerLiquidityCumulatives []*big.Int VolatilityCumulatives []*big.Int VolumePerAvgLiquiditys []*big.Int }) if err != nil { return *outstruct, err } outstruct.TickCumulatives = *abi.ConvertType(out[0], new([]*big.Int)).(*[]*big.Int) outstruct.SecondsPerLiquidityCumulatives = *abi.ConvertType(out[1], new([]*big.Int)).(*[]*big.Int) outstruct.VolatilityCumulatives = *abi.ConvertType(out[2], new([]*big.Int)).(*[]*big.Int) outstruct.VolumePerAvgLiquiditys = *abi.ConvertType(out[3], new([]*big.Int)).(*[]*big.Int) return *outstruct, err } // GetTimepoints is a free data retrieval call binding the contract method 0x9d3a5241. // // Solidity: function getTimepoints(uint32[] secondsAgos) view returns(int56[] tickCumulatives, uint160[] secondsPerLiquidityCumulatives, uint112[] volatilityCumulatives, uint256[] volumePerAvgLiquiditys) func (_Pool *PoolSession) GetTimepoints(secondsAgos []uint32) (struct { TickCumulatives []*big.Int SecondsPerLiquidityCumulatives []*big.Int VolatilityCumulatives []*big.Int VolumePerAvgLiquiditys []*big.Int }, error) { return _Pool.Contract.GetTimepoints(&_Pool.CallOpts, secondsAgos) } // GetTimepoints is a free data retrieval call binding the contract method 0x9d3a5241. // // Solidity: function getTimepoints(uint32[] secondsAgos) view returns(int56[] tickCumulatives, uint160[] secondsPerLiquidityCumulatives, uint112[] volatilityCumulatives, uint256[] volumePerAvgLiquiditys) func (_Pool *PoolCallerSession) GetTimepoints(secondsAgos []uint32) (struct { TickCumulatives []*big.Int SecondsPerLiquidityCumulatives []*big.Int VolatilityCumulatives []*big.Int VolumePerAvgLiquiditys []*big.Int }, error) { return _Pool.Contract.GetTimepoints(&_Pool.CallOpts, secondsAgos) } // GlobalState is a free data retrieval call binding the contract method 0xe76c01e4. // // Solidity: function globalState() view returns(uint160 price, int24 tick, uint16 feeZto, uint16 feeOtz, uint16 timepointIndex, uint8 communityFeeToken0, uint8 communityFeeToken1, bool unlocked) func (_Pool *PoolCaller) GlobalState(opts *bind.CallOpts) (struct { Price *big.Int Tick *big.Int FeeZto uint16 FeeOtz uint16 TimepointIndex uint16 CommunityFeeToken0 uint8 CommunityFeeToken1 uint8 Unlocked bool }, error) { var out []interface{} err := _Pool.contract.Call(opts, &out, "globalState") outstruct := new(struct { Price *big.Int Tick *big.Int FeeZto uint16 FeeOtz uint16 TimepointIndex uint16 CommunityFeeToken0 uint8 CommunityFeeToken1 uint8 Unlocked bool }) if err != nil { return *outstruct, err } outstruct.Price = *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) outstruct.Tick = *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) outstruct.FeeZto = *abi.ConvertType(out[2], new(uint16)).(*uint16) outstruct.FeeOtz = *abi.ConvertType(out[3], new(uint16)).(*uint16) outstruct.TimepointIndex = *abi.ConvertType(out[4], new(uint16)).(*uint16) outstruct.CommunityFeeToken0 = *abi.ConvertType(out[5], new(uint8)).(*uint8) outstruct.CommunityFeeToken1 = *abi.ConvertType(out[6], new(uint8)).(*uint8) outstruct.Unlocked = *abi.ConvertType(out[7], new(bool)).(*bool) return *outstruct, err } // GlobalState is a free data retrieval call binding the contract method 0xe76c01e4. // // Solidity: function globalState() view returns(uint160 price, int24 tick, uint16 feeZto, uint16 feeOtz, uint16 timepointIndex, uint8 communityFeeToken0, uint8 communityFeeToken1, bool unlocked) func (_Pool *PoolSession) GlobalState() (struct { Price *big.Int Tick *big.Int FeeZto uint16 FeeOtz uint16 TimepointIndex uint16 CommunityFeeToken0 uint8 CommunityFeeToken1 uint8 Unlocked bool }, error) { return _Pool.Contract.GlobalState(&_Pool.CallOpts) } // GlobalState is a free data retrieval call binding the contract method 0xe76c01e4. // // Solidity: function globalState() view returns(uint160 price, int24 tick, uint16 feeZto, uint16 feeOtz, uint16 timepointIndex, uint8 communityFeeToken0, uint8 communityFeeToken1, bool unlocked) func (_Pool *PoolCallerSession) GlobalState() (struct { Price *big.Int Tick *big.Int FeeZto uint16 FeeOtz uint16 TimepointIndex uint16 CommunityFeeToken0 uint8 CommunityFeeToken1 uint8 Unlocked bool }, error) { return _Pool.Contract.GlobalState(&_Pool.CallOpts) } // Liquidity is a free data retrieval call binding the contract method 0x1a686502. // // Solidity: function liquidity() view returns(uint128) func (_Pool *PoolCaller) Liquidity(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} err := _Pool.contract.Call(opts, &out, "liquidity") if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // Liquidity is a free data retrieval call binding the contract method 0x1a686502. // // Solidity: function liquidity() view returns(uint128) func (_Pool *PoolSession) Liquidity() (*big.Int, error) { return _Pool.Contract.Liquidity(&_Pool.CallOpts) } // Liquidity is a free data retrieval call binding the contract method 0x1a686502. // // Solidity: function liquidity() view returns(uint128) func (_Pool *PoolCallerSession) Liquidity() (*big.Int, error) { return _Pool.Contract.Liquidity(&_Pool.CallOpts) } // LiquidityCooldown is a free data retrieval call binding the contract method 0x17e25b3c. // // Solidity: function liquidityCooldown() view returns(uint32) func (_Pool *PoolCaller) LiquidityCooldown(opts *bind.CallOpts) (uint32, error) { var out []interface{} err := _Pool.contract.Call(opts, &out, "liquidityCooldown") if err != nil { return *new(uint32), err } out0 := *abi.ConvertType(out[0], new(uint32)).(*uint32) return out0, err } // LiquidityCooldown is a free data retrieval call binding the contract method 0x17e25b3c. // // Solidity: function liquidityCooldown() view returns(uint32) func (_Pool *PoolSession) LiquidityCooldown() (uint32, error) { return _Pool.Contract.LiquidityCooldown(&_Pool.CallOpts) } // LiquidityCooldown is a free data retrieval call binding the contract method 0x17e25b3c. // // Solidity: function liquidityCooldown() view returns(uint32) func (_Pool *PoolCallerSession) LiquidityCooldown() (uint32, error) { return _Pool.Contract.LiquidityCooldown(&_Pool.CallOpts) } // MaxLiquidityPerTick is a free data retrieval call binding the contract method 0x70cf754a. // // Solidity: function maxLiquidityPerTick() pure returns(uint128) func (_Pool *PoolCaller) MaxLiquidityPerTick(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} err := _Pool.contract.Call(opts, &out, "maxLiquidityPerTick") if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // MaxLiquidityPerTick is a free data retrieval call binding the contract method 0x70cf754a. // // Solidity: function maxLiquidityPerTick() pure returns(uint128) func (_Pool *PoolSession) MaxLiquidityPerTick() (*big.Int, error) { return _Pool.Contract.MaxLiquidityPerTick(&_Pool.CallOpts) } // MaxLiquidityPerTick is a free data retrieval call binding the contract method 0x70cf754a. // // Solidity: function maxLiquidityPerTick() pure returns(uint128) func (_Pool *PoolCallerSession) MaxLiquidityPerTick() (*big.Int, error) { return _Pool.Contract.MaxLiquidityPerTick(&_Pool.CallOpts) } // Positions is a free data retrieval call binding the contract method 0x514ea4bf. // // Solidity: function positions(bytes32 ) view returns(uint128 liquidity, uint32 lastLiquidityAddTimestamp, uint256 innerFeeGrowth0Token, uint256 innerFeeGrowth1Token, uint128 fees0, uint128 fees1) func (_Pool *PoolCaller) Positions(opts *bind.CallOpts, arg0 [32]byte) (struct { Liquidity *big.Int LastLiquidityAddTimestamp uint32 InnerFeeGrowth0Token *big.Int InnerFeeGrowth1Token *big.Int Fees0 *big.Int Fees1 *big.Int }, error) { var out []interface{} err := _Pool.contract.Call(opts, &out, "positions", arg0) outstruct := new(struct { Liquidity *big.Int LastLiquidityAddTimestamp uint32 InnerFeeGrowth0Token *big.Int InnerFeeGrowth1Token *big.Int Fees0 *big.Int Fees1 *big.Int }) if err != nil { return *outstruct, err } outstruct.Liquidity = *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) outstruct.LastLiquidityAddTimestamp = *abi.ConvertType(out[1], new(uint32)).(*uint32) outstruct.InnerFeeGrowth0Token = *abi.ConvertType(out[2], new(*big.Int)).(**big.Int) outstruct.InnerFeeGrowth1Token = *abi.ConvertType(out[3], new(*big.Int)).(**big.Int) outstruct.Fees0 = *abi.ConvertType(out[4], new(*big.Int)).(**big.Int) outstruct.Fees1 = *abi.ConvertType(out[5], new(*big.Int)).(**big.Int) return *outstruct, err } // Positions is a free data retrieval call binding the contract method 0x514ea4bf. // // Solidity: function positions(bytes32 ) view returns(uint128 liquidity, uint32 lastLiquidityAddTimestamp, uint256 innerFeeGrowth0Token, uint256 innerFeeGrowth1Token, uint128 fees0, uint128 fees1) func (_Pool *PoolSession) Positions(arg0 [32]byte) (struct { Liquidity *big.Int LastLiquidityAddTimestamp uint32 InnerFeeGrowth0Token *big.Int InnerFeeGrowth1Token *big.Int Fees0 *big.Int Fees1 *big.Int }, error) { return _Pool.Contract.Positions(&_Pool.CallOpts, arg0) } // Positions is a free data retrieval call binding the contract method 0x514ea4bf. // // Solidity: function positions(bytes32 ) view returns(uint128 liquidity, uint32 lastLiquidityAddTimestamp, uint256 innerFeeGrowth0Token, uint256 innerFeeGrowth1Token, uint128 fees0, uint128 fees1) func (_Pool *PoolCallerSession) Positions(arg0 [32]byte) (struct { Liquidity *big.Int LastLiquidityAddTimestamp uint32 InnerFeeGrowth0Token *big.Int InnerFeeGrowth1Token *big.Int Fees0 *big.Int Fees1 *big.Int }, error) { return _Pool.Contract.Positions(&_Pool.CallOpts, arg0) } // TickSpacing is a free data retrieval call binding the contract method 0xd0c93a7c. // // Solidity: function tickSpacing() view returns(int24) func (_Pool *PoolCaller) TickSpacing(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} err := _Pool.contract.Call(opts, &out, "tickSpacing") if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // TickSpacing is a free data retrieval call binding the contract method 0xd0c93a7c. // // Solidity: function tickSpacing() view returns(int24) func (_Pool *PoolSession) TickSpacing() (*big.Int, error) { return _Pool.Contract.TickSpacing(&_Pool.CallOpts) } // TickSpacing is a free data retrieval call binding the contract method 0xd0c93a7c. // // Solidity: function tickSpacing() view returns(int24) func (_Pool *PoolCallerSession) TickSpacing() (*big.Int, error) { return _Pool.Contract.TickSpacing(&_Pool.CallOpts) } // TickTable is a free data retrieval call binding the contract method 0xc677e3e0. // // Solidity: function tickTable(int16 ) view returns(uint256) func (_Pool *PoolCaller) TickTable(opts *bind.CallOpts, arg0 int16) (*big.Int, error) { var out []interface{} err := _Pool.contract.Call(opts, &out, "tickTable", arg0) if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // TickTable is a free data retrieval call binding the contract method 0xc677e3e0. // // Solidity: function tickTable(int16 ) view returns(uint256) func (_Pool *PoolSession) TickTable(arg0 int16) (*big.Int, error) { return _Pool.Contract.TickTable(&_Pool.CallOpts, arg0) } // TickTable is a free data retrieval call binding the contract method 0xc677e3e0. // // Solidity: function tickTable(int16 ) view returns(uint256) func (_Pool *PoolCallerSession) TickTable(arg0 int16) (*big.Int, error) { return _Pool.Contract.TickTable(&_Pool.CallOpts, arg0) } // Ticks is a free data retrieval call binding the contract method 0xf30dba93. // // Solidity: function ticks(int24 ) view returns(uint128 liquidityTotal, int128 liquidityDelta, uint256 outerFeeGrowth0Token, uint256 outerFeeGrowth1Token, int56 outerTickCumulative, uint160 outerSecondsPerLiquidity, uint32 outerSecondsSpent, bool initialized) func (_Pool *PoolCaller) Ticks(opts *bind.CallOpts, arg0 *big.Int) (struct { LiquidityTotal *big.Int LiquidityDelta *big.Int OuterFeeGrowth0Token *big.Int OuterFeeGrowth1Token *big.Int OuterTickCumulative *big.Int OuterSecondsPerLiquidity *big.Int OuterSecondsSpent uint32 Initialized bool }, error) { var out []interface{} err := _Pool.contract.Call(opts, &out, "ticks", arg0) outstruct := new(struct { LiquidityTotal *big.Int LiquidityDelta *big.Int OuterFeeGrowth0Token *big.Int OuterFeeGrowth1Token *big.Int OuterTickCumulative *big.Int OuterSecondsPerLiquidity *big.Int OuterSecondsSpent uint32 Initialized bool }) if err != nil { return *outstruct, err } outstruct.LiquidityTotal = *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) outstruct.LiquidityDelta = *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) outstruct.OuterFeeGrowth0Token = *abi.ConvertType(out[2], new(*big.Int)).(**big.Int) outstruct.OuterFeeGrowth1Token = *abi.ConvertType(out[3], new(*big.Int)).(**big.Int) outstruct.OuterTickCumulative = *abi.ConvertType(out[4], new(*big.Int)).(**big.Int) outstruct.OuterSecondsPerLiquidity = *abi.ConvertType(out[5], new(*big.Int)).(**big.Int) outstruct.OuterSecondsSpent = *abi.ConvertType(out[6], new(uint32)).(*uint32) outstruct.Initialized = *abi.ConvertType(out[7], new(bool)).(*bool) return *outstruct, err } // Ticks is a free data retrieval call binding the contract method 0xf30dba93. // // Solidity: function ticks(int24 ) view returns(uint128 liquidityTotal, int128 liquidityDelta, uint256 outerFeeGrowth0Token, uint256 outerFeeGrowth1Token, int56 outerTickCumulative, uint160 outerSecondsPerLiquidity, uint32 outerSecondsSpent, bool initialized) func (_Pool *PoolSession) Ticks(arg0 *big.Int) (struct { LiquidityTotal *big.Int LiquidityDelta *big.Int OuterFeeGrowth0Token *big.Int OuterFeeGrowth1Token *big.Int OuterTickCumulative *big.Int OuterSecondsPerLiquidity *big.Int OuterSecondsSpent uint32 Initialized bool }, error) { return _Pool.Contract.Ticks(&_Pool.CallOpts, arg0) } // Ticks is a free data retrieval call binding the contract method 0xf30dba93. // // Solidity: function ticks(int24 ) view returns(uint128 liquidityTotal, int128 liquidityDelta, uint256 outerFeeGrowth0Token, uint256 outerFeeGrowth1Token, int56 outerTickCumulative, uint160 outerSecondsPerLiquidity, uint32 outerSecondsSpent, bool initialized) func (_Pool *PoolCallerSession) Ticks(arg0 *big.Int) (struct { LiquidityTotal *big.Int LiquidityDelta *big.Int OuterFeeGrowth0Token *big.Int OuterFeeGrowth1Token *big.Int OuterTickCumulative *big.Int OuterSecondsPerLiquidity *big.Int OuterSecondsSpent uint32 Initialized bool }, error) { return _Pool.Contract.Ticks(&_Pool.CallOpts, arg0) } // Timepoints is a free data retrieval call binding the contract method 0x74eceae6. // // Solidity: function timepoints(uint256 index) view returns(bool initialized, uint32 blockTimestamp, int56 tickCumulative, uint160 secondsPerLiquidityCumulative, uint88 volatilityCumulative, int24 averageTick, uint144 volumePerLiquidityCumulative) func (_Pool *PoolCaller) Timepoints(opts *bind.CallOpts, index *big.Int) (struct { Initialized bool BlockTimestamp uint32 TickCumulative *big.Int SecondsPerLiquidityCumulative *big.Int VolatilityCumulative *big.Int AverageTick *big.Int VolumePerLiquidityCumulative *big.Int }, error) { var out []interface{} err := _Pool.contract.Call(opts, &out, "timepoints", index) outstruct := new(struct { Initialized bool BlockTimestamp uint32 TickCumulative *big.Int SecondsPerLiquidityCumulative *big.Int VolatilityCumulative *big.Int AverageTick *big.Int VolumePerLiquidityCumulative *big.Int }) if err != nil { return *outstruct, err } outstruct.Initialized = *abi.ConvertType(out[0], new(bool)).(*bool) outstruct.BlockTimestamp = *abi.ConvertType(out[1], new(uint32)).(*uint32) outstruct.TickCumulative = *abi.ConvertType(out[2], new(*big.Int)).(**big.Int) outstruct.SecondsPerLiquidityCumulative = *abi.ConvertType(out[3], new(*big.Int)).(**big.Int) outstruct.VolatilityCumulative = *abi.ConvertType(out[4], new(*big.Int)).(**big.Int) outstruct.AverageTick = *abi.ConvertType(out[5], new(*big.Int)).(**big.Int) outstruct.VolumePerLiquidityCumulative = *abi.ConvertType(out[6], new(*big.Int)).(**big.Int) return *outstruct, err } // Timepoints is a free data retrieval call binding the contract method 0x74eceae6. // // Solidity: function timepoints(uint256 index) view returns(bool initialized, uint32 blockTimestamp, int56 tickCumulative, uint160 secondsPerLiquidityCumulative, uint88 volatilityCumulative, int24 averageTick, uint144 volumePerLiquidityCumulative) func (_Pool *PoolSession) Timepoints(index *big.Int) (struct { Initialized bool BlockTimestamp uint32 TickCumulative *big.Int SecondsPerLiquidityCumulative *big.Int VolatilityCumulative *big.Int AverageTick *big.Int VolumePerLiquidityCumulative *big.Int }, error) { return _Pool.Contract.Timepoints(&_Pool.CallOpts, index) } // Timepoints is a free data retrieval call binding the contract method 0x74eceae6. // // Solidity: function timepoints(uint256 index) view returns(bool initialized, uint32 blockTimestamp, int56 tickCumulative, uint160 secondsPerLiquidityCumulative, uint88 volatilityCumulative, int24 averageTick, uint144 volumePerLiquidityCumulative) func (_Pool *PoolCallerSession) Timepoints(index *big.Int) (struct { Initialized bool BlockTimestamp uint32 TickCumulative *big.Int SecondsPerLiquidityCumulative *big.Int VolatilityCumulative *big.Int AverageTick *big.Int VolumePerLiquidityCumulative *big.Int }, error) { return _Pool.Contract.Timepoints(&_Pool.CallOpts, index) } // Token0 is a free data retrieval call binding the contract method 0x0dfe1681. // // Solidity: function token0() view returns(address) func (_Pool *PoolCaller) Token0(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _Pool.contract.Call(opts, &out, "token0") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // Token0 is a free data retrieval call binding the contract method 0x0dfe1681. // // Solidity: function token0() view returns(address) func (_Pool *PoolSession) Token0() (common.Address, error) { return _Pool.Contract.Token0(&_Pool.CallOpts) } // Token0 is a free data retrieval call binding the contract method 0x0dfe1681. // // Solidity: function token0() view returns(address) func (_Pool *PoolCallerSession) Token0() (common.Address, error) { return _Pool.Contract.Token0(&_Pool.CallOpts) } // Token1 is a free data retrieval call binding the contract method 0xd21220a7. // // Solidity: function token1() view returns(address) func (_Pool *PoolCaller) Token1(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _Pool.contract.Call(opts, &out, "token1") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // Token1 is a free data retrieval call binding the contract method 0xd21220a7. // // Solidity: function token1() view returns(address) func (_Pool *PoolSession) Token1() (common.Address, error) { return _Pool.Contract.Token1(&_Pool.CallOpts) } // Token1 is a free data retrieval call binding the contract method 0xd21220a7. // // Solidity: function token1() view returns(address) func (_Pool *PoolCallerSession) Token1() (common.Address, error) { return _Pool.Contract.Token1(&_Pool.CallOpts) } // TotalFeeGrowth0Token is a free data retrieval call binding the contract method 0x6378ae44. // // Solidity: function totalFeeGrowth0Token() view returns(uint256) func (_Pool *PoolCaller) TotalFeeGrowth0Token(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} err := _Pool.contract.Call(opts, &out, "totalFeeGrowth0Token") if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // TotalFeeGrowth0Token is a free data retrieval call binding the contract method 0x6378ae44. // // Solidity: function totalFeeGrowth0Token() view returns(uint256) func (_Pool *PoolSession) TotalFeeGrowth0Token() (*big.Int, error) { return _Pool.Contract.TotalFeeGrowth0Token(&_Pool.CallOpts) } // TotalFeeGrowth0Token is a free data retrieval call binding the contract method 0x6378ae44. // // Solidity: function totalFeeGrowth0Token() view returns(uint256) func (_Pool *PoolCallerSession) TotalFeeGrowth0Token() (*big.Int, error) { return _Pool.Contract.TotalFeeGrowth0Token(&_Pool.CallOpts) } // TotalFeeGrowth1Token is a free data retrieval call binding the contract method 0xecdecf42. // // Solidity: function totalFeeGrowth1Token() view returns(uint256) func (_Pool *PoolCaller) TotalFeeGrowth1Token(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} err := _Pool.contract.Call(opts, &out, "totalFeeGrowth1Token") if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // TotalFeeGrowth1Token is a free data retrieval call binding the contract method 0xecdecf42. // // Solidity: function totalFeeGrowth1Token() view returns(uint256) func (_Pool *PoolSession) TotalFeeGrowth1Token() (*big.Int, error) { return _Pool.Contract.TotalFeeGrowth1Token(&_Pool.CallOpts) } // TotalFeeGrowth1Token is a free data retrieval call binding the contract method 0xecdecf42. // // Solidity: function totalFeeGrowth1Token() view returns(uint256) func (_Pool *PoolCallerSession) TotalFeeGrowth1Token() (*big.Int, error) { return _Pool.Contract.TotalFeeGrowth1Token(&_Pool.CallOpts) } // Burn is a paid mutator transaction binding the contract method 0xa34123a7. // // Solidity: function burn(int24 bottomTick, int24 topTick, uint128 amount) returns(uint256 amount0, uint256 amount1) func (_Pool *PoolTransactor) Burn(opts *bind.TransactOpts, bottomTick *big.Int, topTick *big.Int, amount *big.Int) (*types.Transaction, error) { return _Pool.contract.Transact(opts, "burn", bottomTick, topTick, amount) } // Burn is a paid mutator transaction binding the contract method 0xa34123a7. // // Solidity: function burn(int24 bottomTick, int24 topTick, uint128 amount) returns(uint256 amount0, uint256 amount1) func (_Pool *PoolSession) Burn(bottomTick *big.Int, topTick *big.Int, amount *big.Int) (*types.Transaction, error) { return _Pool.Contract.Burn(&_Pool.TransactOpts, bottomTick, topTick, amount) } // Burn is a paid mutator transaction binding the contract method 0xa34123a7. // // Solidity: function burn(int24 bottomTick, int24 topTick, uint128 amount) returns(uint256 amount0, uint256 amount1) func (_Pool *PoolTransactorSession) Burn(bottomTick *big.Int, topTick *big.Int, amount *big.Int) (*types.Transaction, error) { return _Pool.Contract.Burn(&_Pool.TransactOpts, bottomTick, topTick, amount) } // Collect is a paid mutator transaction binding the contract method 0x4f1eb3d8. // // Solidity: function collect(address recipient, int24 bottomTick, int24 topTick, uint128 amount0Requested, uint128 amount1Requested) returns(uint128 amount0, uint128 amount1) func (_Pool *PoolTransactor) Collect(opts *bind.TransactOpts, recipient common.Address, bottomTick *big.Int, topTick *big.Int, amount0Requested *big.Int, amount1Requested *big.Int) (*types.Transaction, error) { return _Pool.contract.Transact(opts, "collect", recipient, bottomTick, topTick, amount0Requested, amount1Requested) } // Collect is a paid mutator transaction binding the contract method 0x4f1eb3d8. // // Solidity: function collect(address recipient, int24 bottomTick, int24 topTick, uint128 amount0Requested, uint128 amount1Requested) returns(uint128 amount0, uint128 amount1) func (_Pool *PoolSession) Collect(recipient common.Address, bottomTick *big.Int, topTick *big.Int, amount0Requested *big.Int, amount1Requested *big.Int) (*types.Transaction, error) { return _Pool.Contract.Collect(&_Pool.TransactOpts, recipient, bottomTick, topTick, amount0Requested, amount1Requested) } // Collect is a paid mutator transaction binding the contract method 0x4f1eb3d8. // // Solidity: function collect(address recipient, int24 bottomTick, int24 topTick, uint128 amount0Requested, uint128 amount1Requested) returns(uint128 amount0, uint128 amount1) func (_Pool *PoolTransactorSession) Collect(recipient common.Address, bottomTick *big.Int, topTick *big.Int, amount0Requested *big.Int, amount1Requested *big.Int) (*types.Transaction, error) { return _Pool.Contract.Collect(&_Pool.TransactOpts, recipient, bottomTick, topTick, amount0Requested, amount1Requested) } // Flash is a paid mutator transaction binding the contract method 0x490e6cbc. // // Solidity: function flash(address recipient, uint256 amount0, uint256 amount1, bytes data) returns() func (_Pool *PoolTransactor) Flash(opts *bind.TransactOpts, recipient common.Address, amount0 *big.Int, amount1 *big.Int, data []byte) (*types.Transaction, error) { return _Pool.contract.Transact(opts, "flash", recipient, amount0, amount1, data) } // Flash is a paid mutator transaction binding the contract method 0x490e6cbc. // // Solidity: function flash(address recipient, uint256 amount0, uint256 amount1, bytes data) returns() func (_Pool *PoolSession) Flash(recipient common.Address, amount0 *big.Int, amount1 *big.Int, data []byte) (*types.Transaction, error) { return _Pool.Contract.Flash(&_Pool.TransactOpts, recipient, amount0, amount1, data) } // Flash is a paid mutator transaction binding the contract method 0x490e6cbc. // // Solidity: function flash(address recipient, uint256 amount0, uint256 amount1, bytes data) returns() func (_Pool *PoolTransactorSession) Flash(recipient common.Address, amount0 *big.Int, amount1 *big.Int, data []byte) (*types.Transaction, error) { return _Pool.Contract.Flash(&_Pool.TransactOpts, recipient, amount0, amount1, data) } // Initialize is a paid mutator transaction binding the contract method 0xf637731d. // // Solidity: function initialize(uint160 initialPrice) returns() func (_Pool *PoolTransactor) Initialize(opts *bind.TransactOpts, initialPrice *big.Int) (*types.Transaction, error) { return _Pool.contract.Transact(opts, "initialize", initialPrice) } // Initialize is a paid mutator transaction binding the contract method 0xf637731d. // // Solidity: function initialize(uint160 initialPrice) returns() func (_Pool *PoolSession) Initialize(initialPrice *big.Int) (*types.Transaction, error) { return _Pool.Contract.Initialize(&_Pool.TransactOpts, initialPrice) } // Initialize is a paid mutator transaction binding the contract method 0xf637731d. // // Solidity: function initialize(uint160 initialPrice) returns() func (_Pool *PoolTransactorSession) Initialize(initialPrice *big.Int) (*types.Transaction, error) { return _Pool.Contract.Initialize(&_Pool.TransactOpts, initialPrice) } // Mint is a paid mutator transaction binding the contract method 0xaafe29c0. // // Solidity: function mint(address sender, address recipient, int24 bottomTick, int24 topTick, uint128 liquidityDesired, bytes data) returns(uint256 amount0, uint256 amount1, uint128 liquidityActual) func (_Pool *PoolTransactor) Mint(opts *bind.TransactOpts, sender common.Address, recipient common.Address, bottomTick *big.Int, topTick *big.Int, liquidityDesired *big.Int, data []byte) (*types.Transaction, error) { return _Pool.contract.Transact(opts, "mint", sender, recipient, bottomTick, topTick, liquidityDesired, data) } // Mint is a paid mutator transaction binding the contract method 0xaafe29c0. // // Solidity: function mint(address sender, address recipient, int24 bottomTick, int24 topTick, uint128 liquidityDesired, bytes data) returns(uint256 amount0, uint256 amount1, uint128 liquidityActual) func (_Pool *PoolSession) Mint(sender common.Address, recipient common.Address, bottomTick *big.Int, topTick *big.Int, liquidityDesired *big.Int, data []byte) (*types.Transaction, error) { return _Pool.Contract.Mint(&_Pool.TransactOpts, sender, recipient, bottomTick, topTick, liquidityDesired, data) } // Mint is a paid mutator transaction binding the contract method 0xaafe29c0. // // Solidity: function mint(address sender, address recipient, int24 bottomTick, int24 topTick, uint128 liquidityDesired, bytes data) returns(uint256 amount0, uint256 amount1, uint128 liquidityActual) func (_Pool *PoolTransactorSession) Mint(sender common.Address, recipient common.Address, bottomTick *big.Int, topTick *big.Int, liquidityDesired *big.Int, data []byte) (*types.Transaction, error) { return _Pool.Contract.Mint(&_Pool.TransactOpts, sender, recipient, bottomTick, topTick, liquidityDesired, data) } // SetCommunityFee is a paid mutator transaction binding the contract method 0x7c0112b7. // // Solidity: function setCommunityFee(uint8 communityFee0, uint8 communityFee1) returns() func (_Pool *PoolTransactor) SetCommunityFee(opts *bind.TransactOpts, communityFee0 uint8, communityFee1 uint8) (*types.Transaction, error) { return _Pool.contract.Transact(opts, "setCommunityFee", communityFee0, communityFee1) } // SetCommunityFee is a paid mutator transaction binding the contract method 0x7c0112b7. // // Solidity: function setCommunityFee(uint8 communityFee0, uint8 communityFee1) returns() func (_Pool *PoolSession) SetCommunityFee(communityFee0 uint8, communityFee1 uint8) (*types.Transaction, error) { return _Pool.Contract.SetCommunityFee(&_Pool.TransactOpts, communityFee0, communityFee1) } // SetCommunityFee is a paid mutator transaction binding the contract method 0x7c0112b7. // // Solidity: function setCommunityFee(uint8 communityFee0, uint8 communityFee1) returns() func (_Pool *PoolTransactorSession) SetCommunityFee(communityFee0 uint8, communityFee1 uint8) (*types.Transaction, error) { return _Pool.Contract.SetCommunityFee(&_Pool.TransactOpts, communityFee0, communityFee1) } // SetIncentive is a paid mutator transaction binding the contract method 0x7c1fe0c8. // // Solidity: function setIncentive(address virtualPoolAddress) returns() func (_Pool *PoolTransactor) SetIncentive(opts *bind.TransactOpts, virtualPoolAddress common.Address) (*types.Transaction, error) { return _Pool.contract.Transact(opts, "setIncentive", virtualPoolAddress) } // SetIncentive is a paid mutator transaction binding the contract method 0x7c1fe0c8. // // Solidity: function setIncentive(address virtualPoolAddress) returns() func (_Pool *PoolSession) SetIncentive(virtualPoolAddress common.Address) (*types.Transaction, error) { return _Pool.Contract.SetIncentive(&_Pool.TransactOpts, virtualPoolAddress) } // SetIncentive is a paid mutator transaction binding the contract method 0x7c1fe0c8. // // Solidity: function setIncentive(address virtualPoolAddress) returns() func (_Pool *PoolTransactorSession) SetIncentive(virtualPoolAddress common.Address) (*types.Transaction, error) { return _Pool.Contract.SetIncentive(&_Pool.TransactOpts, virtualPoolAddress) } // SetLiquidityCooldown is a paid mutator transaction binding the contract method 0x289fe9b0. // // Solidity: function setLiquidityCooldown(uint32 newLiquidityCooldown) returns() func (_Pool *PoolTransactor) SetLiquidityCooldown(opts *bind.TransactOpts, newLiquidityCooldown uint32) (*types.Transaction, error) { return _Pool.contract.Transact(opts, "setLiquidityCooldown", newLiquidityCooldown) } // SetLiquidityCooldown is a paid mutator transaction binding the contract method 0x289fe9b0. // // Solidity: function setLiquidityCooldown(uint32 newLiquidityCooldown) returns() func (_Pool *PoolSession) SetLiquidityCooldown(newLiquidityCooldown uint32) (*types.Transaction, error) { return _Pool.Contract.SetLiquidityCooldown(&_Pool.TransactOpts, newLiquidityCooldown) } // SetLiquidityCooldown is a paid mutator transaction binding the contract method 0x289fe9b0. // // Solidity: function setLiquidityCooldown(uint32 newLiquidityCooldown) returns() func (_Pool *PoolTransactorSession) SetLiquidityCooldown(newLiquidityCooldown uint32) (*types.Transaction, error) { return _Pool.Contract.SetLiquidityCooldown(&_Pool.TransactOpts, newLiquidityCooldown) } // SetTickSpacing is a paid mutator transaction binding the contract method 0xf085a610. // // Solidity: function setTickSpacing(int24 newTickSpacing) returns() func (_Pool *PoolTransactor) SetTickSpacing(opts *bind.TransactOpts, newTickSpacing *big.Int) (*types.Transaction, error) { return _Pool.contract.Transact(opts, "setTickSpacing", newTickSpacing) } // SetTickSpacing is a paid mutator transaction binding the contract method 0xf085a610. // // Solidity: function setTickSpacing(int24 newTickSpacing) returns() func (_Pool *PoolSession) SetTickSpacing(newTickSpacing *big.Int) (*types.Transaction, error) { return _Pool.Contract.SetTickSpacing(&_Pool.TransactOpts, newTickSpacing) } // SetTickSpacing is a paid mutator transaction binding the contract method 0xf085a610. // // Solidity: function setTickSpacing(int24 newTickSpacing) returns() func (_Pool *PoolTransactorSession) SetTickSpacing(newTickSpacing *big.Int) (*types.Transaction, error) { return _Pool.Contract.SetTickSpacing(&_Pool.TransactOpts, newTickSpacing) } // Swap is a paid mutator transaction binding the contract method 0x128acb08. // // Solidity: function swap(address recipient, bool zeroToOne, int256 amountRequired, uint160 limitSqrtPrice, bytes data) returns(int256 amount0, int256 amount1) func (_Pool *PoolTransactor) Swap(opts *bind.TransactOpts, recipient common.Address, zeroToOne bool, amountRequired *big.Int, limitSqrtPrice *big.Int, data []byte) (*types.Transaction, error) { return _Pool.contract.Transact(opts, "swap", recipient, zeroToOne, amountRequired, limitSqrtPrice, data) } // Swap is a paid mutator transaction binding the contract method 0x128acb08. // // Solidity: function swap(address recipient, bool zeroToOne, int256 amountRequired, uint160 limitSqrtPrice, bytes data) returns(int256 amount0, int256 amount1) func (_Pool *PoolSession) Swap(recipient common.Address, zeroToOne bool, amountRequired *big.Int, limitSqrtPrice *big.Int, data []byte) (*types.Transaction, error) { return _Pool.Contract.Swap(&_Pool.TransactOpts, recipient, zeroToOne, amountRequired, limitSqrtPrice, data) } // Swap is a paid mutator transaction binding the contract method 0x128acb08. // // Solidity: function swap(address recipient, bool zeroToOne, int256 amountRequired, uint160 limitSqrtPrice, bytes data) returns(int256 amount0, int256 amount1) func (_Pool *PoolTransactorSession) Swap(recipient common.Address, zeroToOne bool, amountRequired *big.Int, limitSqrtPrice *big.Int, data []byte) (*types.Transaction, error) { return _Pool.Contract.Swap(&_Pool.TransactOpts, recipient, zeroToOne, amountRequired, limitSqrtPrice, data) } // SwapSupportingFeeOnInputTokens is a paid mutator transaction binding the contract method 0x71334694. // // Solidity: function swapSupportingFeeOnInputTokens(address sender, address recipient, bool zeroToOne, int256 amountRequired, uint160 limitSqrtPrice, bytes data) returns(int256 amount0, int256 amount1) func (_Pool *PoolTransactor) SwapSupportingFeeOnInputTokens(opts *bind.TransactOpts, sender common.Address, recipient common.Address, zeroToOne bool, amountRequired *big.Int, limitSqrtPrice *big.Int, data []byte) (*types.Transaction, error) { return _Pool.contract.Transact(opts, "swapSupportingFeeOnInputTokens", sender, recipient, zeroToOne, amountRequired, limitSqrtPrice, data) } // SwapSupportingFeeOnInputTokens is a paid mutator transaction binding the contract method 0x71334694. // // Solidity: function swapSupportingFeeOnInputTokens(address sender, address recipient, bool zeroToOne, int256 amountRequired, uint160 limitSqrtPrice, bytes data) returns(int256 amount0, int256 amount1) func (_Pool *PoolSession) SwapSupportingFeeOnInputTokens(sender common.Address, recipient common.Address, zeroToOne bool, amountRequired *big.Int, limitSqrtPrice *big.Int, data []byte) (*types.Transaction, error) { return _Pool.Contract.SwapSupportingFeeOnInputTokens(&_Pool.TransactOpts, sender, recipient, zeroToOne, amountRequired, limitSqrtPrice, data) } // SwapSupportingFeeOnInputTokens is a paid mutator transaction binding the contract method 0x71334694. // // Solidity: function swapSupportingFeeOnInputTokens(address sender, address recipient, bool zeroToOne, int256 amountRequired, uint160 limitSqrtPrice, bytes data) returns(int256 amount0, int256 amount1) func (_Pool *PoolTransactorSession) SwapSupportingFeeOnInputTokens(sender common.Address, recipient common.Address, zeroToOne bool, amountRequired *big.Int, limitSqrtPrice *big.Int, data []byte) (*types.Transaction, error) { return _Pool.Contract.SwapSupportingFeeOnInputTokens(&_Pool.TransactOpts, sender, recipient, zeroToOne, amountRequired, limitSqrtPrice, data) } // PoolBurnIterator is returned from FilterBurn and is used to iterate over the raw logs and unpacked data for Burn events raised by the Pool contract. type PoolBurnIterator struct { Event *PoolBurn // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *PoolBurnIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(PoolBurn) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(PoolBurn) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *PoolBurnIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *PoolBurnIterator) Close() error { it.sub.Unsubscribe() return nil } // PoolBurn represents a Burn event raised by the Pool contract. type PoolBurn struct { Owner common.Address BottomTick *big.Int TopTick *big.Int LiquidityAmount *big.Int Amount0 *big.Int Amount1 *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterBurn is a free log retrieval operation binding the contract event 0x0c396cd989a39f4459b5fa1aed6a9a8dcdbc45908acfd67e028cd568da98982c. // // Solidity: event Burn(address indexed owner, int24 indexed bottomTick, int24 indexed topTick, uint128 liquidityAmount, uint256 amount0, uint256 amount1) func (_Pool *PoolFilterer) FilterBurn(opts *bind.FilterOpts, owner []common.Address, bottomTick []*big.Int, topTick []*big.Int) (*PoolBurnIterator, error) { var ownerRule []interface{} for _, ownerItem := range owner { ownerRule = append(ownerRule, ownerItem) } var bottomTickRule []interface{} for _, bottomTickItem := range bottomTick { bottomTickRule = append(bottomTickRule, bottomTickItem) } var topTickRule []interface{} for _, topTickItem := range topTick { topTickRule = append(topTickRule, topTickItem) } logs, sub, err := _Pool.contract.FilterLogs(opts, "Burn", ownerRule, bottomTickRule, topTickRule) if err != nil { return nil, err } return &PoolBurnIterator{contract: _Pool.contract, event: "Burn", logs: logs, sub: sub}, nil } // WatchBurn is a free log subscription operation binding the contract event 0x0c396cd989a39f4459b5fa1aed6a9a8dcdbc45908acfd67e028cd568da98982c. // // Solidity: event Burn(address indexed owner, int24 indexed bottomTick, int24 indexed topTick, uint128 liquidityAmount, uint256 amount0, uint256 amount1) func (_Pool *PoolFilterer) WatchBurn(opts *bind.WatchOpts, sink chan<- *PoolBurn, owner []common.Address, bottomTick []*big.Int, topTick []*big.Int) (event.Subscription, error) { var ownerRule []interface{} for _, ownerItem := range owner { ownerRule = append(ownerRule, ownerItem) } var bottomTickRule []interface{} for _, bottomTickItem := range bottomTick { bottomTickRule = append(bottomTickRule, bottomTickItem) } var topTickRule []interface{} for _, topTickItem := range topTick { topTickRule = append(topTickRule, topTickItem) } logs, sub, err := _Pool.contract.WatchLogs(opts, "Burn", ownerRule, bottomTickRule, topTickRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(PoolBurn) if err := _Pool.contract.UnpackLog(event, "Burn", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseBurn is a log parse operation binding the contract event 0x0c396cd989a39f4459b5fa1aed6a9a8dcdbc45908acfd67e028cd568da98982c. // // Solidity: event Burn(address indexed owner, int24 indexed bottomTick, int24 indexed topTick, uint128 liquidityAmount, uint256 amount0, uint256 amount1) func (_Pool *PoolFilterer) ParseBurn(log types.Log) (*PoolBurn, error) { event := new(PoolBurn) if err := _Pool.contract.UnpackLog(event, "Burn", log); err != nil { return nil, err } event.Raw = log return event, nil } // PoolCollectIterator is returned from FilterCollect and is used to iterate over the raw logs and unpacked data for Collect events raised by the Pool contract. type PoolCollectIterator struct { Event *PoolCollect // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *PoolCollectIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(PoolCollect) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(PoolCollect) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *PoolCollectIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *PoolCollectIterator) Close() error { it.sub.Unsubscribe() return nil } // PoolCollect represents a Collect event raised by the Pool contract. type PoolCollect struct { Owner common.Address Recipient common.Address BottomTick *big.Int TopTick *big.Int Amount0 *big.Int Amount1 *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterCollect is a free log retrieval operation binding the contract event 0x70935338e69775456a85ddef226c395fb668b63fa0115f5f20610b388e6ca9c0. // // Solidity: event Collect(address indexed owner, address recipient, int24 indexed bottomTick, int24 indexed topTick, uint128 amount0, uint128 amount1) func (_Pool *PoolFilterer) FilterCollect(opts *bind.FilterOpts, owner []common.Address, bottomTick []*big.Int, topTick []*big.Int) (*PoolCollectIterator, error) { var ownerRule []interface{} for _, ownerItem := range owner { ownerRule = append(ownerRule, ownerItem) } var bottomTickRule []interface{} for _, bottomTickItem := range bottomTick { bottomTickRule = append(bottomTickRule, bottomTickItem) } var topTickRule []interface{} for _, topTickItem := range topTick { topTickRule = append(topTickRule, topTickItem) } logs, sub, err := _Pool.contract.FilterLogs(opts, "Collect", ownerRule, bottomTickRule, topTickRule) if err != nil { return nil, err } return &PoolCollectIterator{contract: _Pool.contract, event: "Collect", logs: logs, sub: sub}, nil } // WatchCollect is a free log subscription operation binding the contract event 0x70935338e69775456a85ddef226c395fb668b63fa0115f5f20610b388e6ca9c0. // // Solidity: event Collect(address indexed owner, address recipient, int24 indexed bottomTick, int24 indexed topTick, uint128 amount0, uint128 amount1) func (_Pool *PoolFilterer) WatchCollect(opts *bind.WatchOpts, sink chan<- *PoolCollect, owner []common.Address, bottomTick []*big.Int, topTick []*big.Int) (event.Subscription, error) { var ownerRule []interface{} for _, ownerItem := range owner { ownerRule = append(ownerRule, ownerItem) } var bottomTickRule []interface{} for _, bottomTickItem := range bottomTick { bottomTickRule = append(bottomTickRule, bottomTickItem) } var topTickRule []interface{} for _, topTickItem := range topTick { topTickRule = append(topTickRule, topTickItem) } logs, sub, err := _Pool.contract.WatchLogs(opts, "Collect", ownerRule, bottomTickRule, topTickRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(PoolCollect) if err := _Pool.contract.UnpackLog(event, "Collect", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseCollect is a log parse operation binding the contract event 0x70935338e69775456a85ddef226c395fb668b63fa0115f5f20610b388e6ca9c0. // // Solidity: event Collect(address indexed owner, address recipient, int24 indexed bottomTick, int24 indexed topTick, uint128 amount0, uint128 amount1) func (_Pool *PoolFilterer) ParseCollect(log types.Log) (*PoolCollect, error) { event := new(PoolCollect) if err := _Pool.contract.UnpackLog(event, "Collect", log); err != nil { return nil, err } event.Raw = log return event, nil } // PoolCommunityFeeIterator is returned from FilterCommunityFee and is used to iterate over the raw logs and unpacked data for CommunityFee events raised by the Pool contract. type PoolCommunityFeeIterator struct { Event *PoolCommunityFee // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *PoolCommunityFeeIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(PoolCommunityFee) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(PoolCommunityFee) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *PoolCommunityFeeIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *PoolCommunityFeeIterator) Close() error { it.sub.Unsubscribe() return nil } // PoolCommunityFee represents a CommunityFee event raised by the Pool contract. type PoolCommunityFee struct { CommunityFee0New uint8 CommunityFee1New uint8 Raw types.Log // Blockchain specific contextual infos } // FilterCommunityFee is a free log retrieval operation binding the contract event 0x9e22b964b08e25c3aaa72102bb0071c089258fb82d51271a8ddf5c24921356ee. // // Solidity: event CommunityFee(uint8 communityFee0New, uint8 communityFee1New) func (_Pool *PoolFilterer) FilterCommunityFee(opts *bind.FilterOpts) (*PoolCommunityFeeIterator, error) { logs, sub, err := _Pool.contract.FilterLogs(opts, "CommunityFee") if err != nil { return nil, err } return &PoolCommunityFeeIterator{contract: _Pool.contract, event: "CommunityFee", logs: logs, sub: sub}, nil } // WatchCommunityFee is a free log subscription operation binding the contract event 0x9e22b964b08e25c3aaa72102bb0071c089258fb82d51271a8ddf5c24921356ee. // // Solidity: event CommunityFee(uint8 communityFee0New, uint8 communityFee1New) func (_Pool *PoolFilterer) WatchCommunityFee(opts *bind.WatchOpts, sink chan<- *PoolCommunityFee) (event.Subscription, error) { logs, sub, err := _Pool.contract.WatchLogs(opts, "CommunityFee") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(PoolCommunityFee) if err := _Pool.contract.UnpackLog(event, "CommunityFee", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseCommunityFee is a log parse operation binding the contract event 0x9e22b964b08e25c3aaa72102bb0071c089258fb82d51271a8ddf5c24921356ee. // // Solidity: event CommunityFee(uint8 communityFee0New, uint8 communityFee1New) func (_Pool *PoolFilterer) ParseCommunityFee(log types.Log) (*PoolCommunityFee, error) { event := new(PoolCommunityFee) if err := _Pool.contract.UnpackLog(event, "CommunityFee", log); err != nil { return nil, err } event.Raw = log return event, nil } // PoolFeeIterator is returned from FilterFee and is used to iterate over the raw logs and unpacked data for Fee events raised by the Pool contract. type PoolFeeIterator struct { Event *PoolFee // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *PoolFeeIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(PoolFee) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(PoolFee) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *PoolFeeIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *PoolFeeIterator) Close() error { it.sub.Unsubscribe() return nil } // PoolFee represents a Fee event raised by the Pool contract. type PoolFee struct { FeeZto uint16 FeeOtz uint16 Raw types.Log // Blockchain specific contextual infos } // FilterFee is a free log retrieval operation binding the contract event 0x8a89de70856bccec096661388f305b9a75f5f65cb0d8a0e1e803c39dabedb57f. // // Solidity: event Fee(uint16 feeZto, uint16 feeOtz) func (_Pool *PoolFilterer) FilterFee(opts *bind.FilterOpts) (*PoolFeeIterator, error) { logs, sub, err := _Pool.contract.FilterLogs(opts, "Fee") if err != nil { return nil, err } return &PoolFeeIterator{contract: _Pool.contract, event: "Fee", logs: logs, sub: sub}, nil } // WatchFee is a free log subscription operation binding the contract event 0x8a89de70856bccec096661388f305b9a75f5f65cb0d8a0e1e803c39dabedb57f. // // Solidity: event Fee(uint16 feeZto, uint16 feeOtz) func (_Pool *PoolFilterer) WatchFee(opts *bind.WatchOpts, sink chan<- *PoolFee) (event.Subscription, error) { logs, sub, err := _Pool.contract.WatchLogs(opts, "Fee") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(PoolFee) if err := _Pool.contract.UnpackLog(event, "Fee", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseFee is a log parse operation binding the contract event 0x8a89de70856bccec096661388f305b9a75f5f65cb0d8a0e1e803c39dabedb57f. // // Solidity: event Fee(uint16 feeZto, uint16 feeOtz) func (_Pool *PoolFilterer) ParseFee(log types.Log) (*PoolFee, error) { event := new(PoolFee) if err := _Pool.contract.UnpackLog(event, "Fee", log); err != nil { return nil, err } event.Raw = log return event, nil } // PoolFlashIterator is returned from FilterFlash and is used to iterate over the raw logs and unpacked data for Flash events raised by the Pool contract. type PoolFlashIterator struct { Event *PoolFlash // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *PoolFlashIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(PoolFlash) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(PoolFlash) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *PoolFlashIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *PoolFlashIterator) Close() error { it.sub.Unsubscribe() return nil } // PoolFlash represents a Flash event raised by the Pool contract. type PoolFlash struct { Sender common.Address Recipient common.Address Amount0 *big.Int Amount1 *big.Int Paid0 *big.Int Paid1 *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterFlash is a free log retrieval operation binding the contract event 0xbdbdb71d7860376ba52b25a5028beea23581364a40522f6bcfb86bb1f2dca633. // // Solidity: event Flash(address indexed sender, address indexed recipient, uint256 amount0, uint256 amount1, uint256 paid0, uint256 paid1) func (_Pool *PoolFilterer) FilterFlash(opts *bind.FilterOpts, sender []common.Address, recipient []common.Address) (*PoolFlashIterator, error) { var senderRule []interface{} for _, senderItem := range sender { senderRule = append(senderRule, senderItem) } var recipientRule []interface{} for _, recipientItem := range recipient { recipientRule = append(recipientRule, recipientItem) } logs, sub, err := _Pool.contract.FilterLogs(opts, "Flash", senderRule, recipientRule) if err != nil { return nil, err } return &PoolFlashIterator{contract: _Pool.contract, event: "Flash", logs: logs, sub: sub}, nil } // WatchFlash is a free log subscription operation binding the contract event 0xbdbdb71d7860376ba52b25a5028beea23581364a40522f6bcfb86bb1f2dca633. // // Solidity: event Flash(address indexed sender, address indexed recipient, uint256 amount0, uint256 amount1, uint256 paid0, uint256 paid1) func (_Pool *PoolFilterer) WatchFlash(opts *bind.WatchOpts, sink chan<- *PoolFlash, sender []common.Address, recipient []common.Address) (event.Subscription, error) { var senderRule []interface{} for _, senderItem := range sender { senderRule = append(senderRule, senderItem) } var recipientRule []interface{} for _, recipientItem := range recipient { recipientRule = append(recipientRule, recipientItem) } logs, sub, err := _Pool.contract.WatchLogs(opts, "Flash", senderRule, recipientRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(PoolFlash) if err := _Pool.contract.UnpackLog(event, "Flash", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseFlash is a log parse operation binding the contract event 0xbdbdb71d7860376ba52b25a5028beea23581364a40522f6bcfb86bb1f2dca633. // // Solidity: event Flash(address indexed sender, address indexed recipient, uint256 amount0, uint256 amount1, uint256 paid0, uint256 paid1) func (_Pool *PoolFilterer) ParseFlash(log types.Log) (*PoolFlash, error) { event := new(PoolFlash) if err := _Pool.contract.UnpackLog(event, "Flash", log); err != nil { return nil, err } event.Raw = log return event, nil } // PoolIncentiveIterator is returned from FilterIncentive and is used to iterate over the raw logs and unpacked data for Incentive events raised by the Pool contract. type PoolIncentiveIterator struct { Event *PoolIncentive // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *PoolIncentiveIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(PoolIncentive) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(PoolIncentive) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *PoolIncentiveIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *PoolIncentiveIterator) Close() error { it.sub.Unsubscribe() return nil } // PoolIncentive represents a Incentive event raised by the Pool contract. type PoolIncentive struct { VirtualPoolAddress common.Address Raw types.Log // Blockchain specific contextual infos } // FilterIncentive is a free log retrieval operation binding the contract event 0x915c5369e6580733735d1c2e30ca20dcaa395697a041033c9f35f80f53525e84. // // Solidity: event Incentive(address indexed virtualPoolAddress) func (_Pool *PoolFilterer) FilterIncentive(opts *bind.FilterOpts, virtualPoolAddress []common.Address) (*PoolIncentiveIterator, error) { var virtualPoolAddressRule []interface{} for _, virtualPoolAddressItem := range virtualPoolAddress { virtualPoolAddressRule = append(virtualPoolAddressRule, virtualPoolAddressItem) } logs, sub, err := _Pool.contract.FilterLogs(opts, "Incentive", virtualPoolAddressRule) if err != nil { return nil, err } return &PoolIncentiveIterator{contract: _Pool.contract, event: "Incentive", logs: logs, sub: sub}, nil } // WatchIncentive is a free log subscription operation binding the contract event 0x915c5369e6580733735d1c2e30ca20dcaa395697a041033c9f35f80f53525e84. // // Solidity: event Incentive(address indexed virtualPoolAddress) func (_Pool *PoolFilterer) WatchIncentive(opts *bind.WatchOpts, sink chan<- *PoolIncentive, virtualPoolAddress []common.Address) (event.Subscription, error) { var virtualPoolAddressRule []interface{} for _, virtualPoolAddressItem := range virtualPoolAddress { virtualPoolAddressRule = append(virtualPoolAddressRule, virtualPoolAddressItem) } logs, sub, err := _Pool.contract.WatchLogs(opts, "Incentive", virtualPoolAddressRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(PoolIncentive) if err := _Pool.contract.UnpackLog(event, "Incentive", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseIncentive is a log parse operation binding the contract event 0x915c5369e6580733735d1c2e30ca20dcaa395697a041033c9f35f80f53525e84. // // Solidity: event Incentive(address indexed virtualPoolAddress) func (_Pool *PoolFilterer) ParseIncentive(log types.Log) (*PoolIncentive, error) { event := new(PoolIncentive) if err := _Pool.contract.UnpackLog(event, "Incentive", log); err != nil { return nil, err } event.Raw = log return event, nil } // PoolInitializeIterator is returned from FilterInitialize and is used to iterate over the raw logs and unpacked data for Initialize events raised by the Pool contract. type PoolInitializeIterator struct { Event *PoolInitialize // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *PoolInitializeIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(PoolInitialize) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(PoolInitialize) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *PoolInitializeIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *PoolInitializeIterator) Close() error { it.sub.Unsubscribe() return nil } // PoolInitialize represents a Initialize event raised by the Pool contract. type PoolInitialize struct { Price *big.Int Tick *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterInitialize is a free log retrieval operation binding the contract event 0x98636036cb66a9c19a37435efc1e90142190214e8abeb821bdba3f2990dd4c95. // // Solidity: event Initialize(uint160 price, int24 tick) func (_Pool *PoolFilterer) FilterInitialize(opts *bind.FilterOpts) (*PoolInitializeIterator, error) { logs, sub, err := _Pool.contract.FilterLogs(opts, "Initialize") if err != nil { return nil, err } return &PoolInitializeIterator{contract: _Pool.contract, event: "Initialize", logs: logs, sub: sub}, nil } // WatchInitialize is a free log subscription operation binding the contract event 0x98636036cb66a9c19a37435efc1e90142190214e8abeb821bdba3f2990dd4c95. // // Solidity: event Initialize(uint160 price, int24 tick) func (_Pool *PoolFilterer) WatchInitialize(opts *bind.WatchOpts, sink chan<- *PoolInitialize) (event.Subscription, error) { logs, sub, err := _Pool.contract.WatchLogs(opts, "Initialize") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(PoolInitialize) if err := _Pool.contract.UnpackLog(event, "Initialize", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseInitialize is a log parse operation binding the contract event 0x98636036cb66a9c19a37435efc1e90142190214e8abeb821bdba3f2990dd4c95. // // Solidity: event Initialize(uint160 price, int24 tick) func (_Pool *PoolFilterer) ParseInitialize(log types.Log) (*PoolInitialize, error) { event := new(PoolInitialize) if err := _Pool.contract.UnpackLog(event, "Initialize", log); err != nil { return nil, err } event.Raw = log return event, nil } // PoolLiquidityCooldownIterator is returned from FilterLiquidityCooldown and is used to iterate over the raw logs and unpacked data for LiquidityCooldown events raised by the Pool contract. type PoolLiquidityCooldownIterator struct { Event *PoolLiquidityCooldown // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *PoolLiquidityCooldownIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(PoolLiquidityCooldown) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(PoolLiquidityCooldown) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *PoolLiquidityCooldownIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *PoolLiquidityCooldownIterator) Close() error { it.sub.Unsubscribe() return nil } // PoolLiquidityCooldown represents a LiquidityCooldown event raised by the Pool contract. type PoolLiquidityCooldown struct { LiquidityCooldown uint32 Raw types.Log // Blockchain specific contextual infos } // FilterLiquidityCooldown is a free log retrieval operation binding the contract event 0xb5e51602371b0e74f991b6e965cd7d32b4b14c7e6ede6d1298037650a0e1405f. // // Solidity: event LiquidityCooldown(uint32 liquidityCooldown) func (_Pool *PoolFilterer) FilterLiquidityCooldown(opts *bind.FilterOpts) (*PoolLiquidityCooldownIterator, error) { logs, sub, err := _Pool.contract.FilterLogs(opts, "LiquidityCooldown") if err != nil { return nil, err } return &PoolLiquidityCooldownIterator{contract: _Pool.contract, event: "LiquidityCooldown", logs: logs, sub: sub}, nil } // WatchLiquidityCooldown is a free log subscription operation binding the contract event 0xb5e51602371b0e74f991b6e965cd7d32b4b14c7e6ede6d1298037650a0e1405f. // // Solidity: event LiquidityCooldown(uint32 liquidityCooldown) func (_Pool *PoolFilterer) WatchLiquidityCooldown(opts *bind.WatchOpts, sink chan<- *PoolLiquidityCooldown) (event.Subscription, error) { logs, sub, err := _Pool.contract.WatchLogs(opts, "LiquidityCooldown") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(PoolLiquidityCooldown) if err := _Pool.contract.UnpackLog(event, "LiquidityCooldown", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseLiquidityCooldown is a log parse operation binding the contract event 0xb5e51602371b0e74f991b6e965cd7d32b4b14c7e6ede6d1298037650a0e1405f. // // Solidity: event LiquidityCooldown(uint32 liquidityCooldown) func (_Pool *PoolFilterer) ParseLiquidityCooldown(log types.Log) (*PoolLiquidityCooldown, error) { event := new(PoolLiquidityCooldown) if err := _Pool.contract.UnpackLog(event, "LiquidityCooldown", log); err != nil { return nil, err } event.Raw = log return event, nil } // PoolMintIterator is returned from FilterMint and is used to iterate over the raw logs and unpacked data for Mint events raised by the Pool contract. type PoolMintIterator struct { Event *PoolMint // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *PoolMintIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(PoolMint) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(PoolMint) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *PoolMintIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *PoolMintIterator) Close() error { it.sub.Unsubscribe() return nil } // PoolMint represents a Mint event raised by the Pool contract. type PoolMint struct { Sender common.Address Owner common.Address BottomTick *big.Int TopTick *big.Int LiquidityAmount *big.Int Amount0 *big.Int Amount1 *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterMint is a free log retrieval operation binding the contract event 0x7a53080ba414158be7ec69b987b5fb7d07dee101fe85488f0853ae16239d0bde. // // Solidity: event Mint(address sender, address indexed owner, int24 indexed bottomTick, int24 indexed topTick, uint128 liquidityAmount, uint256 amount0, uint256 amount1) func (_Pool *PoolFilterer) FilterMint(opts *bind.FilterOpts, owner []common.Address, bottomTick []*big.Int, topTick []*big.Int) (*PoolMintIterator, error) { var ownerRule []interface{} for _, ownerItem := range owner { ownerRule = append(ownerRule, ownerItem) } var bottomTickRule []interface{} for _, bottomTickItem := range bottomTick { bottomTickRule = append(bottomTickRule, bottomTickItem) } var topTickRule []interface{} for _, topTickItem := range topTick { topTickRule = append(topTickRule, topTickItem) } logs, sub, err := _Pool.contract.FilterLogs(opts, "Mint", ownerRule, bottomTickRule, topTickRule) if err != nil { return nil, err } return &PoolMintIterator{contract: _Pool.contract, event: "Mint", logs: logs, sub: sub}, nil } // WatchMint is a free log subscription operation binding the contract event 0x7a53080ba414158be7ec69b987b5fb7d07dee101fe85488f0853ae16239d0bde. // // Solidity: event Mint(address sender, address indexed owner, int24 indexed bottomTick, int24 indexed topTick, uint128 liquidityAmount, uint256 amount0, uint256 amount1) func (_Pool *PoolFilterer) WatchMint(opts *bind.WatchOpts, sink chan<- *PoolMint, owner []common.Address, bottomTick []*big.Int, topTick []*big.Int) (event.Subscription, error) { var ownerRule []interface{} for _, ownerItem := range owner { ownerRule = append(ownerRule, ownerItem) } var bottomTickRule []interface{} for _, bottomTickItem := range bottomTick { bottomTickRule = append(bottomTickRule, bottomTickItem) } var topTickRule []interface{} for _, topTickItem := range topTick { topTickRule = append(topTickRule, topTickItem) } logs, sub, err := _Pool.contract.WatchLogs(opts, "Mint", ownerRule, bottomTickRule, topTickRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(PoolMint) if err := _Pool.contract.UnpackLog(event, "Mint", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseMint is a log parse operation binding the contract event 0x7a53080ba414158be7ec69b987b5fb7d07dee101fe85488f0853ae16239d0bde. // // Solidity: event Mint(address sender, address indexed owner, int24 indexed bottomTick, int24 indexed topTick, uint128 liquidityAmount, uint256 amount0, uint256 amount1) func (_Pool *PoolFilterer) ParseMint(log types.Log) (*PoolMint, error) { event := new(PoolMint) if err := _Pool.contract.UnpackLog(event, "Mint", log); err != nil { return nil, err } event.Raw = log return event, nil } // PoolSwapIterator is returned from FilterSwap and is used to iterate over the raw logs and unpacked data for Swap events raised by the Pool contract. type PoolSwapIterator struct { Event *PoolSwap // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *PoolSwapIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(PoolSwap) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(PoolSwap) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *PoolSwapIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *PoolSwapIterator) Close() error { it.sub.Unsubscribe() return nil } // PoolSwap represents a Swap event raised by the Pool contract. type PoolSwap struct { Sender common.Address Recipient common.Address Amount0 *big.Int Amount1 *big.Int Price *big.Int Liquidity *big.Int Tick *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterSwap is a free log retrieval operation binding the contract event 0xc42079f94a6350d7e6235f29174924f928cc2ac818eb64fed8004e115fbcca67. // // Solidity: event Swap(address indexed sender, address indexed recipient, int256 amount0, int256 amount1, uint160 price, uint128 liquidity, int24 tick) func (_Pool *PoolFilterer) FilterSwap(opts *bind.FilterOpts, sender []common.Address, recipient []common.Address) (*PoolSwapIterator, error) { var senderRule []interface{} for _, senderItem := range sender { senderRule = append(senderRule, senderItem) } var recipientRule []interface{} for _, recipientItem := range recipient { recipientRule = append(recipientRule, recipientItem) } logs, sub, err := _Pool.contract.FilterLogs(opts, "Swap", senderRule, recipientRule) if err != nil { return nil, err } return &PoolSwapIterator{contract: _Pool.contract, event: "Swap", logs: logs, sub: sub}, nil } // WatchSwap is a free log subscription operation binding the contract event 0xc42079f94a6350d7e6235f29174924f928cc2ac818eb64fed8004e115fbcca67. // // Solidity: event Swap(address indexed sender, address indexed recipient, int256 amount0, int256 amount1, uint160 price, uint128 liquidity, int24 tick) func (_Pool *PoolFilterer) WatchSwap(opts *bind.WatchOpts, sink chan<- *PoolSwap, sender []common.Address, recipient []common.Address) (event.Subscription, error) { var senderRule []interface{} for _, senderItem := range sender { senderRule = append(senderRule, senderItem) } var recipientRule []interface{} for _, recipientItem := range recipient { recipientRule = append(recipientRule, recipientItem) } logs, sub, err := _Pool.contract.WatchLogs(opts, "Swap", senderRule, recipientRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(PoolSwap) if err := _Pool.contract.UnpackLog(event, "Swap", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseSwap is a log parse operation binding the contract event 0xc42079f94a6350d7e6235f29174924f928cc2ac818eb64fed8004e115fbcca67. // // Solidity: event Swap(address indexed sender, address indexed recipient, int256 amount0, int256 amount1, uint160 price, uint128 liquidity, int24 tick) func (_Pool *PoolFilterer) ParseSwap(log types.Log) (*PoolSwap, error) { event := new(PoolSwap) if err := _Pool.contract.UnpackLog(event, "Swap", log); err != nil { return nil, err } event.Raw = log return event, nil } // PoolTickSpacingIterator is returned from FilterTickSpacing and is used to iterate over the raw logs and unpacked data for TickSpacing events raised by the Pool contract. type PoolTickSpacingIterator struct { Event *PoolTickSpacing // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *PoolTickSpacingIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(PoolTickSpacing) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(PoolTickSpacing) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *PoolTickSpacingIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *PoolTickSpacingIterator) Close() error { it.sub.Unsubscribe() return nil } // PoolTickSpacing represents a TickSpacing event raised by the Pool contract. type PoolTickSpacing struct { NewTickSpacing *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterTickSpacing is a free log retrieval operation binding the contract event 0x01413b1d5d4c359e9a0daa7909ecda165f6e8c51fe2ff529d74b22a5a7c02645. // // Solidity: event TickSpacing(int24 newTickSpacing) func (_Pool *PoolFilterer) FilterTickSpacing(opts *bind.FilterOpts) (*PoolTickSpacingIterator, error) { logs, sub, err := _Pool.contract.FilterLogs(opts, "TickSpacing") if err != nil { return nil, err } return &PoolTickSpacingIterator{contract: _Pool.contract, event: "TickSpacing", logs: logs, sub: sub}, nil } // WatchTickSpacing is a free log subscription operation binding the contract event 0x01413b1d5d4c359e9a0daa7909ecda165f6e8c51fe2ff529d74b22a5a7c02645. // // Solidity: event TickSpacing(int24 newTickSpacing) func (_Pool *PoolFilterer) WatchTickSpacing(opts *bind.WatchOpts, sink chan<- *PoolTickSpacing) (event.Subscription, error) { logs, sub, err := _Pool.contract.WatchLogs(opts, "TickSpacing") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(PoolTickSpacing) if err := _Pool.contract.UnpackLog(event, "TickSpacing", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseTickSpacing is a log parse operation binding the contract event 0x01413b1d5d4c359e9a0daa7909ecda165f6e8c51fe2ff529d74b22a5a7c02645. // // Solidity: event TickSpacing(int24 newTickSpacing) func (_Pool *PoolFilterer) ParseTickSpacing(log types.Log) (*PoolTickSpacing, error) { event := new(PoolTickSpacing) if err := _Pool.contract.UnpackLog(event, "TickSpacing", log); err != nil { return nil, err } event.Raw = log return event, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/binds/apechainpool/abi.json ================================================ [ { "inputs": [], "stateMutability": "nonpayable", "type": "constructor" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "owner", "type": "address" }, { "indexed": true, "internalType": "int24", "name": "bottomTick", "type": "int24" }, { "indexed": true, "internalType": "int24", "name": "topTick", "type": "int24" }, { "indexed": false, "internalType": "uint128", "name": "liquidityAmount", "type": "uint128" }, { "indexed": false, "internalType": "uint256", "name": "amount0", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "amount1", "type": "uint256" } ], "name": "Burn", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "owner", "type": "address" }, { "indexed": false, "internalType": "address", "name": "recipient", "type": "address" }, { "indexed": true, "internalType": "int24", "name": "bottomTick", "type": "int24" }, { "indexed": true, "internalType": "int24", "name": "topTick", "type": "int24" }, { "indexed": false, "internalType": "uint128", "name": "amount0", "type": "uint128" }, { "indexed": false, "internalType": "uint128", "name": "amount1", "type": "uint128" } ], "name": "Collect", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "uint8", "name": "communityFee0New", "type": "uint8" }, { "indexed": false, "internalType": "uint8", "name": "communityFee1New", "type": "uint8" } ], "name": "CommunityFee", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "uint16", "name": "feeZto", "type": "uint16" }, { "indexed": false, "internalType": "uint16", "name": "feeOtz", "type": "uint16" } ], "name": "Fee", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "sender", "type": "address" }, { "indexed": true, "internalType": "address", "name": "recipient", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "amount0", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "amount1", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "paid0", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "paid1", "type": "uint256" } ], "name": "Flash", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "virtualPoolAddress", "type": "address" } ], "name": "Incentive", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "uint160", "name": "price", "type": "uint160" }, { "indexed": false, "internalType": "int24", "name": "tick", "type": "int24" } ], "name": "Initialize", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "uint32", "name": "liquidityCooldown", "type": "uint32" } ], "name": "LiquidityCooldown", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "address", "name": "sender", "type": "address" }, { "indexed": true, "internalType": "address", "name": "owner", "type": "address" }, { "indexed": true, "internalType": "int24", "name": "bottomTick", "type": "int24" }, { "indexed": true, "internalType": "int24", "name": "topTick", "type": "int24" }, { "indexed": false, "internalType": "uint128", "name": "liquidityAmount", "type": "uint128" }, { "indexed": false, "internalType": "uint256", "name": "amount0", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "amount1", "type": "uint256" } ], "name": "Mint", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "sender", "type": "address" }, { "indexed": true, "internalType": "address", "name": "recipient", "type": "address" }, { "indexed": false, "internalType": "int256", "name": "amount0", "type": "int256" }, { "indexed": false, "internalType": "int256", "name": "amount1", "type": "int256" }, { "indexed": false, "internalType": "uint160", "name": "price", "type": "uint160" }, { "indexed": false, "internalType": "uint128", "name": "liquidity", "type": "uint128" }, { "indexed": false, "internalType": "int24", "name": "tick", "type": "int24" } ], "name": "Swap", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "int24", "name": "newTickSpacing", "type": "int24" } ], "name": "TickSpacing", "type": "event" }, { "inputs": [], "name": "activeIncentive", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "int24", "name": "bottomTick", "type": "int24" }, { "internalType": "int24", "name": "topTick", "type": "int24" }, { "internalType": "uint128", "name": "amount", "type": "uint128" } ], "name": "burn", "outputs": [ { "internalType": "uint256", "name": "amount0", "type": "uint256" }, { "internalType": "uint256", "name": "amount1", "type": "uint256" } ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "recipient", "type": "address" }, { "internalType": "int24", "name": "bottomTick", "type": "int24" }, { "internalType": "int24", "name": "topTick", "type": "int24" }, { "internalType": "uint128", "name": "amount0Requested", "type": "uint128" }, { "internalType": "uint128", "name": "amount1Requested", "type": "uint128" } ], "name": "collect", "outputs": [ { "internalType": "uint128", "name": "amount0", "type": "uint128" }, { "internalType": "uint128", "name": "amount1", "type": "uint128" } ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "dataStorageOperator", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "factory", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "recipient", "type": "address" }, { "internalType": "uint256", "name": "amount0", "type": "uint256" }, { "internalType": "uint256", "name": "amount1", "type": "uint256" }, { "internalType": "bytes", "name": "data", "type": "bytes" } ], "name": "flash", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "int24", "name": "bottomTick", "type": "int24" }, { "internalType": "int24", "name": "topTick", "type": "int24" } ], "name": "getInnerCumulatives", "outputs": [ { "internalType": "int56", "name": "innerTickCumulative", "type": "int56" }, { "internalType": "uint160", "name": "innerSecondsSpentPerLiquidity", "type": "uint160" }, { "internalType": "uint32", "name": "innerSecondsSpent", "type": "uint32" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint32[]", "name": "secondsAgos", "type": "uint32[]" } ], "name": "getTimepoints", "outputs": [ { "internalType": "int56[]", "name": "tickCumulatives", "type": "int56[]" }, { "internalType": "uint160[]", "name": "secondsPerLiquidityCumulatives", "type": "uint160[]" }, { "internalType": "uint112[]", "name": "volatilityCumulatives", "type": "uint112[]" }, { "internalType": "uint256[]", "name": "volumePerAvgLiquiditys", "type": "uint256[]" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "globalState", "outputs": [ { "internalType": "uint160", "name": "price", "type": "uint160" }, { "internalType": "int24", "name": "tick", "type": "int24" }, { "internalType": "uint16", "name": "feeZto", "type": "uint16" }, { "internalType": "uint16", "name": "feeOtz", "type": "uint16" }, { "internalType": "uint16", "name": "timepointIndex", "type": "uint16" }, { "internalType": "uint8", "name": "communityFeeToken0", "type": "uint8" }, { "internalType": "uint8", "name": "communityFeeToken1", "type": "uint8" }, { "internalType": "bool", "name": "unlocked", "type": "bool" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint160", "name": "initialPrice", "type": "uint160" } ], "name": "initialize", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "liquidity", "outputs": [ { "internalType": "uint128", "name": "", "type": "uint128" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "liquidityCooldown", "outputs": [ { "internalType": "uint32", "name": "", "type": "uint32" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "maxLiquidityPerTick", "outputs": [ { "internalType": "uint128", "name": "", "type": "uint128" } ], "stateMutability": "pure", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "sender", "type": "address" }, { "internalType": "address", "name": "recipient", "type": "address" }, { "internalType": "int24", "name": "bottomTick", "type": "int24" }, { "internalType": "int24", "name": "topTick", "type": "int24" }, { "internalType": "uint128", "name": "liquidityDesired", "type": "uint128" }, { "internalType": "bytes", "name": "data", "type": "bytes" } ], "name": "mint", "outputs": [ { "internalType": "uint256", "name": "amount0", "type": "uint256" }, { "internalType": "uint256", "name": "amount1", "type": "uint256" }, { "internalType": "uint128", "name": "liquidityActual", "type": "uint128" } ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "bytes32", "name": "", "type": "bytes32" } ], "name": "positions", "outputs": [ { "internalType": "uint128", "name": "liquidity", "type": "uint128" }, { "internalType": "uint32", "name": "lastLiquidityAddTimestamp", "type": "uint32" }, { "internalType": "uint256", "name": "innerFeeGrowth0Token", "type": "uint256" }, { "internalType": "uint256", "name": "innerFeeGrowth1Token", "type": "uint256" }, { "internalType": "uint128", "name": "fees0", "type": "uint128" }, { "internalType": "uint128", "name": "fees1", "type": "uint128" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint8", "name": "communityFee0", "type": "uint8" }, { "internalType": "uint8", "name": "communityFee1", "type": "uint8" } ], "name": "setCommunityFee", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "virtualPoolAddress", "type": "address" } ], "name": "setIncentive", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint32", "name": "newLiquidityCooldown", "type": "uint32" } ], "name": "setLiquidityCooldown", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "int24", "name": "newTickSpacing", "type": "int24" } ], "name": "setTickSpacing", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "recipient", "type": "address" }, { "internalType": "bool", "name": "zeroToOne", "type": "bool" }, { "internalType": "int256", "name": "amountRequired", "type": "int256" }, { "internalType": "uint160", "name": "limitSqrtPrice", "type": "uint160" }, { "internalType": "bytes", "name": "data", "type": "bytes" } ], "name": "swap", "outputs": [ { "internalType": "int256", "name": "amount0", "type": "int256" }, { "internalType": "int256", "name": "amount1", "type": "int256" } ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "sender", "type": "address" }, { "internalType": "address", "name": "recipient", "type": "address" }, { "internalType": "bool", "name": "zeroToOne", "type": "bool" }, { "internalType": "int256", "name": "amountRequired", "type": "int256" }, { "internalType": "uint160", "name": "limitSqrtPrice", "type": "uint160" }, { "internalType": "bytes", "name": "data", "type": "bytes" } ], "name": "swapSupportingFeeOnInputTokens", "outputs": [ { "internalType": "int256", "name": "amount0", "type": "int256" }, { "internalType": "int256", "name": "amount1", "type": "int256" } ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "tickSpacing", "outputs": [ { "internalType": "int24", "name": "", "type": "int24" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "int16", "name": "", "type": "int16" } ], "name": "tickTable", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "int24", "name": "", "type": "int24" } ], "name": "ticks", "outputs": [ { "internalType": "uint128", "name": "liquidityTotal", "type": "uint128" }, { "internalType": "int128", "name": "liquidityDelta", "type": "int128" }, { "internalType": "uint256", "name": "outerFeeGrowth0Token", "type": "uint256" }, { "internalType": "uint256", "name": "outerFeeGrowth1Token", "type": "uint256" }, { "internalType": "int56", "name": "outerTickCumulative", "type": "int56" }, { "internalType": "uint160", "name": "outerSecondsPerLiquidity", "type": "uint160" }, { "internalType": "uint32", "name": "outerSecondsSpent", "type": "uint32" }, { "internalType": "bool", "name": "initialized", "type": "bool" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "index", "type": "uint256" } ], "name": "timepoints", "outputs": [ { "internalType": "bool", "name": "initialized", "type": "bool" }, { "internalType": "uint32", "name": "blockTimestamp", "type": "uint32" }, { "internalType": "int56", "name": "tickCumulative", "type": "int56" }, { "internalType": "uint160", "name": "secondsPerLiquidityCumulative", "type": "uint160" }, { "internalType": "uint88", "name": "volatilityCumulative", "type": "uint88" }, { "internalType": "int24", "name": "averageTick", "type": "int24" }, { "internalType": "uint144", "name": "volumePerLiquidityCumulative", "type": "uint144" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "token0", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "token1", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "totalFeeGrowth0Token", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "totalFeeGrowth1Token", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" } ] ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/binds/arbitrumfactory/Factory.go ================================================ // Code generated - DO NOT EDIT. // This file is a generated binding and any manual changes will be lost. package arbitrumfactory import ( "errors" "math/big" "strings" ethereum "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/event" ) // Reference imports to suppress errors if they are not otherwise used. var ( _ = errors.New _ = big.NewInt _ = strings.NewReader _ = ethereum.NotFound _ = bind.Bind _ = common.Big1 _ = types.BloomLookup _ = event.NewSubscription _ = abi.ConvertType ) // FactoryMetaData contains all meta data concerning the Factory contract. var FactoryMetaData = &bind.MetaData{ ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_poolDeployer\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_vaultAddress\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"newDefaultCommunityFee\",\"type\":\"uint8\"}],\"name\":\"DefaultCommunityFee\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newFarmingAddress\",\"type\":\"address\"}],\"name\":\"FarmingAddress\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"alpha1\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"alpha2\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"beta1\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"beta2\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"gamma1\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"gamma2\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"volumeBeta\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"volumeGamma\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"baseFee\",\"type\":\"uint16\"}],\"name\":\"FeeConfiguration\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"Owner\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"token0\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"token1\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"name\":\"Pool\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newVaultAddress\",\"type\":\"address\"}],\"name\":\"VaultAddress\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"baseFeeConfiguration\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"alpha1\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"alpha2\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"beta1\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"beta2\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"gamma1\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"gamma2\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"volumeBeta\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"volumeGamma\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"baseFee\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"tokenA\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenB\",\"type\":\"address\"}],\"name\":\"createPool\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"defaultCommunityFee\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"farmingAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"poolByPair\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"poolDeployer\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"alpha1\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"alpha2\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"beta1\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"beta2\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"gamma1\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"gamma2\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"volumeBeta\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"volumeGamma\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"baseFee\",\"type\":\"uint16\"}],\"name\":\"setBaseFeeConfiguration\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"newDefaultCommunityFee\",\"type\":\"uint8\"}],\"name\":\"setDefaultCommunityFee\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_farmingAddress\",\"type\":\"address\"}],\"name\":\"setFarmingAddress\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_owner\",\"type\":\"address\"}],\"name\":\"setOwner\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_vaultAddress\",\"type\":\"address\"}],\"name\":\"setVaultAddress\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"vaultAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", } // FactoryABI is the input ABI used to generate the binding from. // Deprecated: Use FactoryMetaData.ABI instead. var FactoryABI = FactoryMetaData.ABI // Factory is an auto generated Go binding around an Ethereum contract. type Factory struct { FactoryCaller // Read-only binding to the contract FactoryTransactor // Write-only binding to the contract FactoryFilterer // Log filterer for contract events } // FactoryCaller is an auto generated read-only Go binding around an Ethereum contract. type FactoryCaller struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // FactoryTransactor is an auto generated write-only Go binding around an Ethereum contract. type FactoryTransactor struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // FactoryFilterer is an auto generated log filtering Go binding around an Ethereum contract events. type FactoryFilterer struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // FactorySession is an auto generated Go binding around an Ethereum contract, // with pre-set call and transact options. type FactorySession struct { Contract *Factory // Generic contract binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // FactoryCallerSession is an auto generated read-only Go binding around an Ethereum contract, // with pre-set call options. type FactoryCallerSession struct { Contract *FactoryCaller // Generic contract caller binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session } // FactoryTransactorSession is an auto generated write-only Go binding around an Ethereum contract, // with pre-set transact options. type FactoryTransactorSession struct { Contract *FactoryTransactor // Generic contract transactor binding to set the session for TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // FactoryRaw is an auto generated low-level Go binding around an Ethereum contract. type FactoryRaw struct { Contract *Factory // Generic contract binding to access the raw methods on } // FactoryCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. type FactoryCallerRaw struct { Contract *FactoryCaller // Generic read-only contract binding to access the raw methods on } // FactoryTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. type FactoryTransactorRaw struct { Contract *FactoryTransactor // Generic write-only contract binding to access the raw methods on } // NewFactory creates a new instance of Factory, bound to a specific deployed contract. func NewFactory(address common.Address, backend bind.ContractBackend) (*Factory, error) { contract, err := bindFactory(address, backend, backend, backend) if err != nil { return nil, err } return &Factory{FactoryCaller: FactoryCaller{contract: contract}, FactoryTransactor: FactoryTransactor{contract: contract}, FactoryFilterer: FactoryFilterer{contract: contract}}, nil } // NewFactoryCaller creates a new read-only instance of Factory, bound to a specific deployed contract. func NewFactoryCaller(address common.Address, caller bind.ContractCaller) (*FactoryCaller, error) { contract, err := bindFactory(address, caller, nil, nil) if err != nil { return nil, err } return &FactoryCaller{contract: contract}, nil } // NewFactoryTransactor creates a new write-only instance of Factory, bound to a specific deployed contract. func NewFactoryTransactor(address common.Address, transactor bind.ContractTransactor) (*FactoryTransactor, error) { contract, err := bindFactory(address, nil, transactor, nil) if err != nil { return nil, err } return &FactoryTransactor{contract: contract}, nil } // NewFactoryFilterer creates a new log filterer instance of Factory, bound to a specific deployed contract. func NewFactoryFilterer(address common.Address, filterer bind.ContractFilterer) (*FactoryFilterer, error) { contract, err := bindFactory(address, nil, nil, filterer) if err != nil { return nil, err } return &FactoryFilterer{contract: contract}, nil } // bindFactory binds a generic wrapper to an already deployed contract. func bindFactory(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { parsed, err := FactoryMetaData.GetAbi() if err != nil { return nil, err } return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_Factory *FactoryRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _Factory.Contract.FactoryCaller.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_Factory *FactoryRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _Factory.Contract.FactoryTransactor.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_Factory *FactoryRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _Factory.Contract.FactoryTransactor.contract.Transact(opts, method, params...) } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_Factory *FactoryCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _Factory.Contract.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_Factory *FactoryTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _Factory.Contract.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_Factory *FactoryTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _Factory.Contract.contract.Transact(opts, method, params...) } // BaseFeeConfiguration is a free data retrieval call binding the contract method 0x9832853a. // // Solidity: function baseFeeConfiguration() view returns(uint16 alpha1, uint16 alpha2, uint32 beta1, uint32 beta2, uint16 gamma1, uint16 gamma2, uint32 volumeBeta, uint16 volumeGamma, uint16 baseFee) func (_Factory *FactoryCaller) BaseFeeConfiguration(opts *bind.CallOpts) (struct { Alpha1 uint16 Alpha2 uint16 Beta1 uint32 Beta2 uint32 Gamma1 uint16 Gamma2 uint16 VolumeBeta uint32 VolumeGamma uint16 BaseFee uint16 }, error) { var out []interface{} err := _Factory.contract.Call(opts, &out, "baseFeeConfiguration") outstruct := new(struct { Alpha1 uint16 Alpha2 uint16 Beta1 uint32 Beta2 uint32 Gamma1 uint16 Gamma2 uint16 VolumeBeta uint32 VolumeGamma uint16 BaseFee uint16 }) if err != nil { return *outstruct, err } outstruct.Alpha1 = *abi.ConvertType(out[0], new(uint16)).(*uint16) outstruct.Alpha2 = *abi.ConvertType(out[1], new(uint16)).(*uint16) outstruct.Beta1 = *abi.ConvertType(out[2], new(uint32)).(*uint32) outstruct.Beta2 = *abi.ConvertType(out[3], new(uint32)).(*uint32) outstruct.Gamma1 = *abi.ConvertType(out[4], new(uint16)).(*uint16) outstruct.Gamma2 = *abi.ConvertType(out[5], new(uint16)).(*uint16) outstruct.VolumeBeta = *abi.ConvertType(out[6], new(uint32)).(*uint32) outstruct.VolumeGamma = *abi.ConvertType(out[7], new(uint16)).(*uint16) outstruct.BaseFee = *abi.ConvertType(out[8], new(uint16)).(*uint16) return *outstruct, err } // BaseFeeConfiguration is a free data retrieval call binding the contract method 0x9832853a. // // Solidity: function baseFeeConfiguration() view returns(uint16 alpha1, uint16 alpha2, uint32 beta1, uint32 beta2, uint16 gamma1, uint16 gamma2, uint32 volumeBeta, uint16 volumeGamma, uint16 baseFee) func (_Factory *FactorySession) BaseFeeConfiguration() (struct { Alpha1 uint16 Alpha2 uint16 Beta1 uint32 Beta2 uint32 Gamma1 uint16 Gamma2 uint16 VolumeBeta uint32 VolumeGamma uint16 BaseFee uint16 }, error) { return _Factory.Contract.BaseFeeConfiguration(&_Factory.CallOpts) } // BaseFeeConfiguration is a free data retrieval call binding the contract method 0x9832853a. // // Solidity: function baseFeeConfiguration() view returns(uint16 alpha1, uint16 alpha2, uint32 beta1, uint32 beta2, uint16 gamma1, uint16 gamma2, uint32 volumeBeta, uint16 volumeGamma, uint16 baseFee) func (_Factory *FactoryCallerSession) BaseFeeConfiguration() (struct { Alpha1 uint16 Alpha2 uint16 Beta1 uint32 Beta2 uint32 Gamma1 uint16 Gamma2 uint16 VolumeBeta uint32 VolumeGamma uint16 BaseFee uint16 }, error) { return _Factory.Contract.BaseFeeConfiguration(&_Factory.CallOpts) } // DefaultCommunityFee is a free data retrieval call binding the contract method 0x2f8a39dd. // // Solidity: function defaultCommunityFee() view returns(uint8) func (_Factory *FactoryCaller) DefaultCommunityFee(opts *bind.CallOpts) (uint8, error) { var out []interface{} err := _Factory.contract.Call(opts, &out, "defaultCommunityFee") if err != nil { return *new(uint8), err } out0 := *abi.ConvertType(out[0], new(uint8)).(*uint8) return out0, err } // DefaultCommunityFee is a free data retrieval call binding the contract method 0x2f8a39dd. // // Solidity: function defaultCommunityFee() view returns(uint8) func (_Factory *FactorySession) DefaultCommunityFee() (uint8, error) { return _Factory.Contract.DefaultCommunityFee(&_Factory.CallOpts) } // DefaultCommunityFee is a free data retrieval call binding the contract method 0x2f8a39dd. // // Solidity: function defaultCommunityFee() view returns(uint8) func (_Factory *FactoryCallerSession) DefaultCommunityFee() (uint8, error) { return _Factory.Contract.DefaultCommunityFee(&_Factory.CallOpts) } // FarmingAddress is a free data retrieval call binding the contract method 0x8a2ade58. // // Solidity: function farmingAddress() view returns(address) func (_Factory *FactoryCaller) FarmingAddress(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _Factory.contract.Call(opts, &out, "farmingAddress") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // FarmingAddress is a free data retrieval call binding the contract method 0x8a2ade58. // // Solidity: function farmingAddress() view returns(address) func (_Factory *FactorySession) FarmingAddress() (common.Address, error) { return _Factory.Contract.FarmingAddress(&_Factory.CallOpts) } // FarmingAddress is a free data retrieval call binding the contract method 0x8a2ade58. // // Solidity: function farmingAddress() view returns(address) func (_Factory *FactoryCallerSession) FarmingAddress() (common.Address, error) { return _Factory.Contract.FarmingAddress(&_Factory.CallOpts) } // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. // // Solidity: function owner() view returns(address) func (_Factory *FactoryCaller) Owner(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _Factory.contract.Call(opts, &out, "owner") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. // // Solidity: function owner() view returns(address) func (_Factory *FactorySession) Owner() (common.Address, error) { return _Factory.Contract.Owner(&_Factory.CallOpts) } // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. // // Solidity: function owner() view returns(address) func (_Factory *FactoryCallerSession) Owner() (common.Address, error) { return _Factory.Contract.Owner(&_Factory.CallOpts) } // PoolByPair is a free data retrieval call binding the contract method 0xd9a641e1. // // Solidity: function poolByPair(address , address ) view returns(address) func (_Factory *FactoryCaller) PoolByPair(opts *bind.CallOpts, arg0 common.Address, arg1 common.Address) (common.Address, error) { var out []interface{} err := _Factory.contract.Call(opts, &out, "poolByPair", arg0, arg1) if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // PoolByPair is a free data retrieval call binding the contract method 0xd9a641e1. // // Solidity: function poolByPair(address , address ) view returns(address) func (_Factory *FactorySession) PoolByPair(arg0 common.Address, arg1 common.Address) (common.Address, error) { return _Factory.Contract.PoolByPair(&_Factory.CallOpts, arg0, arg1) } // PoolByPair is a free data retrieval call binding the contract method 0xd9a641e1. // // Solidity: function poolByPair(address , address ) view returns(address) func (_Factory *FactoryCallerSession) PoolByPair(arg0 common.Address, arg1 common.Address) (common.Address, error) { return _Factory.Contract.PoolByPair(&_Factory.CallOpts, arg0, arg1) } // PoolDeployer is a free data retrieval call binding the contract method 0x3119049a. // // Solidity: function poolDeployer() view returns(address) func (_Factory *FactoryCaller) PoolDeployer(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _Factory.contract.Call(opts, &out, "poolDeployer") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // PoolDeployer is a free data retrieval call binding the contract method 0x3119049a. // // Solidity: function poolDeployer() view returns(address) func (_Factory *FactorySession) PoolDeployer() (common.Address, error) { return _Factory.Contract.PoolDeployer(&_Factory.CallOpts) } // PoolDeployer is a free data retrieval call binding the contract method 0x3119049a. // // Solidity: function poolDeployer() view returns(address) func (_Factory *FactoryCallerSession) PoolDeployer() (common.Address, error) { return _Factory.Contract.PoolDeployer(&_Factory.CallOpts) } // VaultAddress is a free data retrieval call binding the contract method 0x430bf08a. // // Solidity: function vaultAddress() view returns(address) func (_Factory *FactoryCaller) VaultAddress(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _Factory.contract.Call(opts, &out, "vaultAddress") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // VaultAddress is a free data retrieval call binding the contract method 0x430bf08a. // // Solidity: function vaultAddress() view returns(address) func (_Factory *FactorySession) VaultAddress() (common.Address, error) { return _Factory.Contract.VaultAddress(&_Factory.CallOpts) } // VaultAddress is a free data retrieval call binding the contract method 0x430bf08a. // // Solidity: function vaultAddress() view returns(address) func (_Factory *FactoryCallerSession) VaultAddress() (common.Address, error) { return _Factory.Contract.VaultAddress(&_Factory.CallOpts) } // CreatePool is a paid mutator transaction binding the contract method 0xe3433615. // // Solidity: function createPool(address tokenA, address tokenB) returns(address pool) func (_Factory *FactoryTransactor) CreatePool(opts *bind.TransactOpts, tokenA common.Address, tokenB common.Address) (*types.Transaction, error) { return _Factory.contract.Transact(opts, "createPool", tokenA, tokenB) } // CreatePool is a paid mutator transaction binding the contract method 0xe3433615. // // Solidity: function createPool(address tokenA, address tokenB) returns(address pool) func (_Factory *FactorySession) CreatePool(tokenA common.Address, tokenB common.Address) (*types.Transaction, error) { return _Factory.Contract.CreatePool(&_Factory.TransactOpts, tokenA, tokenB) } // CreatePool is a paid mutator transaction binding the contract method 0xe3433615. // // Solidity: function createPool(address tokenA, address tokenB) returns(address pool) func (_Factory *FactoryTransactorSession) CreatePool(tokenA common.Address, tokenB common.Address) (*types.Transaction, error) { return _Factory.Contract.CreatePool(&_Factory.TransactOpts, tokenA, tokenB) } // SetBaseFeeConfiguration is a paid mutator transaction binding the contract method 0x5d6d7e93. // // Solidity: function setBaseFeeConfiguration(uint16 alpha1, uint16 alpha2, uint32 beta1, uint32 beta2, uint16 gamma1, uint16 gamma2, uint32 volumeBeta, uint16 volumeGamma, uint16 baseFee) returns() func (_Factory *FactoryTransactor) SetBaseFeeConfiguration(opts *bind.TransactOpts, alpha1 uint16, alpha2 uint16, beta1 uint32, beta2 uint32, gamma1 uint16, gamma2 uint16, volumeBeta uint32, volumeGamma uint16, baseFee uint16) (*types.Transaction, error) { return _Factory.contract.Transact(opts, "setBaseFeeConfiguration", alpha1, alpha2, beta1, beta2, gamma1, gamma2, volumeBeta, volumeGamma, baseFee) } // SetBaseFeeConfiguration is a paid mutator transaction binding the contract method 0x5d6d7e93. // // Solidity: function setBaseFeeConfiguration(uint16 alpha1, uint16 alpha2, uint32 beta1, uint32 beta2, uint16 gamma1, uint16 gamma2, uint32 volumeBeta, uint16 volumeGamma, uint16 baseFee) returns() func (_Factory *FactorySession) SetBaseFeeConfiguration(alpha1 uint16, alpha2 uint16, beta1 uint32, beta2 uint32, gamma1 uint16, gamma2 uint16, volumeBeta uint32, volumeGamma uint16, baseFee uint16) (*types.Transaction, error) { return _Factory.Contract.SetBaseFeeConfiguration(&_Factory.TransactOpts, alpha1, alpha2, beta1, beta2, gamma1, gamma2, volumeBeta, volumeGamma, baseFee) } // SetBaseFeeConfiguration is a paid mutator transaction binding the contract method 0x5d6d7e93. // // Solidity: function setBaseFeeConfiguration(uint16 alpha1, uint16 alpha2, uint32 beta1, uint32 beta2, uint16 gamma1, uint16 gamma2, uint32 volumeBeta, uint16 volumeGamma, uint16 baseFee) returns() func (_Factory *FactoryTransactorSession) SetBaseFeeConfiguration(alpha1 uint16, alpha2 uint16, beta1 uint32, beta2 uint32, gamma1 uint16, gamma2 uint16, volumeBeta uint32, volumeGamma uint16, baseFee uint16) (*types.Transaction, error) { return _Factory.Contract.SetBaseFeeConfiguration(&_Factory.TransactOpts, alpha1, alpha2, beta1, beta2, gamma1, gamma2, volumeBeta, volumeGamma, baseFee) } // SetDefaultCommunityFee is a paid mutator transaction binding the contract method 0x371e3521. // // Solidity: function setDefaultCommunityFee(uint8 newDefaultCommunityFee) returns() func (_Factory *FactoryTransactor) SetDefaultCommunityFee(opts *bind.TransactOpts, newDefaultCommunityFee uint8) (*types.Transaction, error) { return _Factory.contract.Transact(opts, "setDefaultCommunityFee", newDefaultCommunityFee) } // SetDefaultCommunityFee is a paid mutator transaction binding the contract method 0x371e3521. // // Solidity: function setDefaultCommunityFee(uint8 newDefaultCommunityFee) returns() func (_Factory *FactorySession) SetDefaultCommunityFee(newDefaultCommunityFee uint8) (*types.Transaction, error) { return _Factory.Contract.SetDefaultCommunityFee(&_Factory.TransactOpts, newDefaultCommunityFee) } // SetDefaultCommunityFee is a paid mutator transaction binding the contract method 0x371e3521. // // Solidity: function setDefaultCommunityFee(uint8 newDefaultCommunityFee) returns() func (_Factory *FactoryTransactorSession) SetDefaultCommunityFee(newDefaultCommunityFee uint8) (*types.Transaction, error) { return _Factory.Contract.SetDefaultCommunityFee(&_Factory.TransactOpts, newDefaultCommunityFee) } // SetFarmingAddress is a paid mutator transaction binding the contract method 0xb001f618. // // Solidity: function setFarmingAddress(address _farmingAddress) returns() func (_Factory *FactoryTransactor) SetFarmingAddress(opts *bind.TransactOpts, _farmingAddress common.Address) (*types.Transaction, error) { return _Factory.contract.Transact(opts, "setFarmingAddress", _farmingAddress) } // SetFarmingAddress is a paid mutator transaction binding the contract method 0xb001f618. // // Solidity: function setFarmingAddress(address _farmingAddress) returns() func (_Factory *FactorySession) SetFarmingAddress(_farmingAddress common.Address) (*types.Transaction, error) { return _Factory.Contract.SetFarmingAddress(&_Factory.TransactOpts, _farmingAddress) } // SetFarmingAddress is a paid mutator transaction binding the contract method 0xb001f618. // // Solidity: function setFarmingAddress(address _farmingAddress) returns() func (_Factory *FactoryTransactorSession) SetFarmingAddress(_farmingAddress common.Address) (*types.Transaction, error) { return _Factory.Contract.SetFarmingAddress(&_Factory.TransactOpts, _farmingAddress) } // SetOwner is a paid mutator transaction binding the contract method 0x13af4035. // // Solidity: function setOwner(address _owner) returns() func (_Factory *FactoryTransactor) SetOwner(opts *bind.TransactOpts, _owner common.Address) (*types.Transaction, error) { return _Factory.contract.Transact(opts, "setOwner", _owner) } // SetOwner is a paid mutator transaction binding the contract method 0x13af4035. // // Solidity: function setOwner(address _owner) returns() func (_Factory *FactorySession) SetOwner(_owner common.Address) (*types.Transaction, error) { return _Factory.Contract.SetOwner(&_Factory.TransactOpts, _owner) } // SetOwner is a paid mutator transaction binding the contract method 0x13af4035. // // Solidity: function setOwner(address _owner) returns() func (_Factory *FactoryTransactorSession) SetOwner(_owner common.Address) (*types.Transaction, error) { return _Factory.Contract.SetOwner(&_Factory.TransactOpts, _owner) } // SetVaultAddress is a paid mutator transaction binding the contract method 0x85535cc5. // // Solidity: function setVaultAddress(address _vaultAddress) returns() func (_Factory *FactoryTransactor) SetVaultAddress(opts *bind.TransactOpts, _vaultAddress common.Address) (*types.Transaction, error) { return _Factory.contract.Transact(opts, "setVaultAddress", _vaultAddress) } // SetVaultAddress is a paid mutator transaction binding the contract method 0x85535cc5. // // Solidity: function setVaultAddress(address _vaultAddress) returns() func (_Factory *FactorySession) SetVaultAddress(_vaultAddress common.Address) (*types.Transaction, error) { return _Factory.Contract.SetVaultAddress(&_Factory.TransactOpts, _vaultAddress) } // SetVaultAddress is a paid mutator transaction binding the contract method 0x85535cc5. // // Solidity: function setVaultAddress(address _vaultAddress) returns() func (_Factory *FactoryTransactorSession) SetVaultAddress(_vaultAddress common.Address) (*types.Transaction, error) { return _Factory.Contract.SetVaultAddress(&_Factory.TransactOpts, _vaultAddress) } // FactoryDefaultCommunityFeeIterator is returned from FilterDefaultCommunityFee and is used to iterate over the raw logs and unpacked data for DefaultCommunityFee events raised by the Factory contract. type FactoryDefaultCommunityFeeIterator struct { Event *FactoryDefaultCommunityFee // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *FactoryDefaultCommunityFeeIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(FactoryDefaultCommunityFee) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(FactoryDefaultCommunityFee) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *FactoryDefaultCommunityFeeIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *FactoryDefaultCommunityFeeIterator) Close() error { it.sub.Unsubscribe() return nil } // FactoryDefaultCommunityFee represents a DefaultCommunityFee event raised by the Factory contract. type FactoryDefaultCommunityFee struct { NewDefaultCommunityFee uint8 Raw types.Log // Blockchain specific contextual infos } // FilterDefaultCommunityFee is a free log retrieval operation binding the contract event 0x88cb5103fd9d88d417e72dc496030c71c65d1500548a9e9530e7d812b6a35558. // // Solidity: event DefaultCommunityFee(uint8 newDefaultCommunityFee) func (_Factory *FactoryFilterer) FilterDefaultCommunityFee(opts *bind.FilterOpts) (*FactoryDefaultCommunityFeeIterator, error) { logs, sub, err := _Factory.contract.FilterLogs(opts, "DefaultCommunityFee") if err != nil { return nil, err } return &FactoryDefaultCommunityFeeIterator{contract: _Factory.contract, event: "DefaultCommunityFee", logs: logs, sub: sub}, nil } // WatchDefaultCommunityFee is a free log subscription operation binding the contract event 0x88cb5103fd9d88d417e72dc496030c71c65d1500548a9e9530e7d812b6a35558. // // Solidity: event DefaultCommunityFee(uint8 newDefaultCommunityFee) func (_Factory *FactoryFilterer) WatchDefaultCommunityFee(opts *bind.WatchOpts, sink chan<- *FactoryDefaultCommunityFee) (event.Subscription, error) { logs, sub, err := _Factory.contract.WatchLogs(opts, "DefaultCommunityFee") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(FactoryDefaultCommunityFee) if err := _Factory.contract.UnpackLog(event, "DefaultCommunityFee", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseDefaultCommunityFee is a log parse operation binding the contract event 0x88cb5103fd9d88d417e72dc496030c71c65d1500548a9e9530e7d812b6a35558. // // Solidity: event DefaultCommunityFee(uint8 newDefaultCommunityFee) func (_Factory *FactoryFilterer) ParseDefaultCommunityFee(log types.Log) (*FactoryDefaultCommunityFee, error) { event := new(FactoryDefaultCommunityFee) if err := _Factory.contract.UnpackLog(event, "DefaultCommunityFee", log); err != nil { return nil, err } event.Raw = log return event, nil } // FactoryFarmingAddressIterator is returned from FilterFarmingAddress and is used to iterate over the raw logs and unpacked data for FarmingAddress events raised by the Factory contract. type FactoryFarmingAddressIterator struct { Event *FactoryFarmingAddress // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *FactoryFarmingAddressIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(FactoryFarmingAddress) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(FactoryFarmingAddress) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *FactoryFarmingAddressIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *FactoryFarmingAddressIterator) Close() error { it.sub.Unsubscribe() return nil } // FactoryFarmingAddress represents a FarmingAddress event raised by the Factory contract. type FactoryFarmingAddress struct { NewFarmingAddress common.Address Raw types.Log // Blockchain specific contextual infos } // FilterFarmingAddress is a free log retrieval operation binding the contract event 0x56b9e8342f530796ceed0d5529abdcdeae6e4f2ac1dc456ceb73bbda898e0cd3. // // Solidity: event FarmingAddress(address indexed newFarmingAddress) func (_Factory *FactoryFilterer) FilterFarmingAddress(opts *bind.FilterOpts, newFarmingAddress []common.Address) (*FactoryFarmingAddressIterator, error) { var newFarmingAddressRule []interface{} for _, newFarmingAddressItem := range newFarmingAddress { newFarmingAddressRule = append(newFarmingAddressRule, newFarmingAddressItem) } logs, sub, err := _Factory.contract.FilterLogs(opts, "FarmingAddress", newFarmingAddressRule) if err != nil { return nil, err } return &FactoryFarmingAddressIterator{contract: _Factory.contract, event: "FarmingAddress", logs: logs, sub: sub}, nil } // WatchFarmingAddress is a free log subscription operation binding the contract event 0x56b9e8342f530796ceed0d5529abdcdeae6e4f2ac1dc456ceb73bbda898e0cd3. // // Solidity: event FarmingAddress(address indexed newFarmingAddress) func (_Factory *FactoryFilterer) WatchFarmingAddress(opts *bind.WatchOpts, sink chan<- *FactoryFarmingAddress, newFarmingAddress []common.Address) (event.Subscription, error) { var newFarmingAddressRule []interface{} for _, newFarmingAddressItem := range newFarmingAddress { newFarmingAddressRule = append(newFarmingAddressRule, newFarmingAddressItem) } logs, sub, err := _Factory.contract.WatchLogs(opts, "FarmingAddress", newFarmingAddressRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(FactoryFarmingAddress) if err := _Factory.contract.UnpackLog(event, "FarmingAddress", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseFarmingAddress is a log parse operation binding the contract event 0x56b9e8342f530796ceed0d5529abdcdeae6e4f2ac1dc456ceb73bbda898e0cd3. // // Solidity: event FarmingAddress(address indexed newFarmingAddress) func (_Factory *FactoryFilterer) ParseFarmingAddress(log types.Log) (*FactoryFarmingAddress, error) { event := new(FactoryFarmingAddress) if err := _Factory.contract.UnpackLog(event, "FarmingAddress", log); err != nil { return nil, err } event.Raw = log return event, nil } // FactoryFeeConfigurationIterator is returned from FilterFeeConfiguration and is used to iterate over the raw logs and unpacked data for FeeConfiguration events raised by the Factory contract. type FactoryFeeConfigurationIterator struct { Event *FactoryFeeConfiguration // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *FactoryFeeConfigurationIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(FactoryFeeConfiguration) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(FactoryFeeConfiguration) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *FactoryFeeConfigurationIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *FactoryFeeConfigurationIterator) Close() error { it.sub.Unsubscribe() return nil } // FactoryFeeConfiguration represents a FeeConfiguration event raised by the Factory contract. type FactoryFeeConfiguration struct { Alpha1 uint16 Alpha2 uint16 Beta1 uint32 Beta2 uint32 Gamma1 uint16 Gamma2 uint16 VolumeBeta uint32 VolumeGamma uint16 BaseFee uint16 Raw types.Log // Blockchain specific contextual infos } // FilterFeeConfiguration is a free log retrieval operation binding the contract event 0x4035ab409f15e202f9f114632e1fb14a0552325955722be18503403e7f98730c. // // Solidity: event FeeConfiguration(uint16 alpha1, uint16 alpha2, uint32 beta1, uint32 beta2, uint16 gamma1, uint16 gamma2, uint32 volumeBeta, uint16 volumeGamma, uint16 baseFee) func (_Factory *FactoryFilterer) FilterFeeConfiguration(opts *bind.FilterOpts) (*FactoryFeeConfigurationIterator, error) { logs, sub, err := _Factory.contract.FilterLogs(opts, "FeeConfiguration") if err != nil { return nil, err } return &FactoryFeeConfigurationIterator{contract: _Factory.contract, event: "FeeConfiguration", logs: logs, sub: sub}, nil } // WatchFeeConfiguration is a free log subscription operation binding the contract event 0x4035ab409f15e202f9f114632e1fb14a0552325955722be18503403e7f98730c. // // Solidity: event FeeConfiguration(uint16 alpha1, uint16 alpha2, uint32 beta1, uint32 beta2, uint16 gamma1, uint16 gamma2, uint32 volumeBeta, uint16 volumeGamma, uint16 baseFee) func (_Factory *FactoryFilterer) WatchFeeConfiguration(opts *bind.WatchOpts, sink chan<- *FactoryFeeConfiguration) (event.Subscription, error) { logs, sub, err := _Factory.contract.WatchLogs(opts, "FeeConfiguration") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(FactoryFeeConfiguration) if err := _Factory.contract.UnpackLog(event, "FeeConfiguration", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseFeeConfiguration is a log parse operation binding the contract event 0x4035ab409f15e202f9f114632e1fb14a0552325955722be18503403e7f98730c. // // Solidity: event FeeConfiguration(uint16 alpha1, uint16 alpha2, uint32 beta1, uint32 beta2, uint16 gamma1, uint16 gamma2, uint32 volumeBeta, uint16 volumeGamma, uint16 baseFee) func (_Factory *FactoryFilterer) ParseFeeConfiguration(log types.Log) (*FactoryFeeConfiguration, error) { event := new(FactoryFeeConfiguration) if err := _Factory.contract.UnpackLog(event, "FeeConfiguration", log); err != nil { return nil, err } event.Raw = log return event, nil } // FactoryOwnerIterator is returned from FilterOwner and is used to iterate over the raw logs and unpacked data for Owner events raised by the Factory contract. type FactoryOwnerIterator struct { Event *FactoryOwner // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *FactoryOwnerIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(FactoryOwner) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(FactoryOwner) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *FactoryOwnerIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *FactoryOwnerIterator) Close() error { it.sub.Unsubscribe() return nil } // FactoryOwner represents a Owner event raised by the Factory contract. type FactoryOwner struct { NewOwner common.Address Raw types.Log // Blockchain specific contextual infos } // FilterOwner is a free log retrieval operation binding the contract event 0xa5e220c2c27d986cc8efeafa8f34ba6ea6bf96a34e146b29b6bdd8587771b130. // // Solidity: event Owner(address indexed newOwner) func (_Factory *FactoryFilterer) FilterOwner(opts *bind.FilterOpts, newOwner []common.Address) (*FactoryOwnerIterator, error) { var newOwnerRule []interface{} for _, newOwnerItem := range newOwner { newOwnerRule = append(newOwnerRule, newOwnerItem) } logs, sub, err := _Factory.contract.FilterLogs(opts, "Owner", newOwnerRule) if err != nil { return nil, err } return &FactoryOwnerIterator{contract: _Factory.contract, event: "Owner", logs: logs, sub: sub}, nil } // WatchOwner is a free log subscription operation binding the contract event 0xa5e220c2c27d986cc8efeafa8f34ba6ea6bf96a34e146b29b6bdd8587771b130. // // Solidity: event Owner(address indexed newOwner) func (_Factory *FactoryFilterer) WatchOwner(opts *bind.WatchOpts, sink chan<- *FactoryOwner, newOwner []common.Address) (event.Subscription, error) { var newOwnerRule []interface{} for _, newOwnerItem := range newOwner { newOwnerRule = append(newOwnerRule, newOwnerItem) } logs, sub, err := _Factory.contract.WatchLogs(opts, "Owner", newOwnerRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(FactoryOwner) if err := _Factory.contract.UnpackLog(event, "Owner", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseOwner is a log parse operation binding the contract event 0xa5e220c2c27d986cc8efeafa8f34ba6ea6bf96a34e146b29b6bdd8587771b130. // // Solidity: event Owner(address indexed newOwner) func (_Factory *FactoryFilterer) ParseOwner(log types.Log) (*FactoryOwner, error) { event := new(FactoryOwner) if err := _Factory.contract.UnpackLog(event, "Owner", log); err != nil { return nil, err } event.Raw = log return event, nil } // FactoryPoolIterator is returned from FilterPool and is used to iterate over the raw logs and unpacked data for Pool events raised by the Factory contract. type FactoryPoolIterator struct { Event *FactoryPool // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *FactoryPoolIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(FactoryPool) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(FactoryPool) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *FactoryPoolIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *FactoryPoolIterator) Close() error { it.sub.Unsubscribe() return nil } // FactoryPool represents a Pool event raised by the Factory contract. type FactoryPool struct { Token0 common.Address Token1 common.Address Pool common.Address Raw types.Log // Blockchain specific contextual infos } // FilterPool is a free log retrieval operation binding the contract event 0x91ccaa7a278130b65168c3a0c8d3bcae84cf5e43704342bd3ec0b59e59c036db. // // Solidity: event Pool(address indexed token0, address indexed token1, address pool) func (_Factory *FactoryFilterer) FilterPool(opts *bind.FilterOpts, token0 []common.Address, token1 []common.Address) (*FactoryPoolIterator, error) { var token0Rule []interface{} for _, token0Item := range token0 { token0Rule = append(token0Rule, token0Item) } var token1Rule []interface{} for _, token1Item := range token1 { token1Rule = append(token1Rule, token1Item) } logs, sub, err := _Factory.contract.FilterLogs(opts, "Pool", token0Rule, token1Rule) if err != nil { return nil, err } return &FactoryPoolIterator{contract: _Factory.contract, event: "Pool", logs: logs, sub: sub}, nil } // WatchPool is a free log subscription operation binding the contract event 0x91ccaa7a278130b65168c3a0c8d3bcae84cf5e43704342bd3ec0b59e59c036db. // // Solidity: event Pool(address indexed token0, address indexed token1, address pool) func (_Factory *FactoryFilterer) WatchPool(opts *bind.WatchOpts, sink chan<- *FactoryPool, token0 []common.Address, token1 []common.Address) (event.Subscription, error) { var token0Rule []interface{} for _, token0Item := range token0 { token0Rule = append(token0Rule, token0Item) } var token1Rule []interface{} for _, token1Item := range token1 { token1Rule = append(token1Rule, token1Item) } logs, sub, err := _Factory.contract.WatchLogs(opts, "Pool", token0Rule, token1Rule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(FactoryPool) if err := _Factory.contract.UnpackLog(event, "Pool", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParsePool is a log parse operation binding the contract event 0x91ccaa7a278130b65168c3a0c8d3bcae84cf5e43704342bd3ec0b59e59c036db. // // Solidity: event Pool(address indexed token0, address indexed token1, address pool) func (_Factory *FactoryFilterer) ParsePool(log types.Log) (*FactoryPool, error) { event := new(FactoryPool) if err := _Factory.contract.UnpackLog(event, "Pool", log); err != nil { return nil, err } event.Raw = log return event, nil } // FactoryVaultAddressIterator is returned from FilterVaultAddress and is used to iterate over the raw logs and unpacked data for VaultAddress events raised by the Factory contract. type FactoryVaultAddressIterator struct { Event *FactoryVaultAddress // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *FactoryVaultAddressIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(FactoryVaultAddress) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(FactoryVaultAddress) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *FactoryVaultAddressIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *FactoryVaultAddressIterator) Close() error { it.sub.Unsubscribe() return nil } // FactoryVaultAddress represents a VaultAddress event raised by the Factory contract. type FactoryVaultAddress struct { NewVaultAddress common.Address Raw types.Log // Blockchain specific contextual infos } // FilterVaultAddress is a free log retrieval operation binding the contract event 0xb9c265ae4414f501736ec5d4961edc3309e4385eb2ff3feeecb30fb36621dd83. // // Solidity: event VaultAddress(address indexed newVaultAddress) func (_Factory *FactoryFilterer) FilterVaultAddress(opts *bind.FilterOpts, newVaultAddress []common.Address) (*FactoryVaultAddressIterator, error) { var newVaultAddressRule []interface{} for _, newVaultAddressItem := range newVaultAddress { newVaultAddressRule = append(newVaultAddressRule, newVaultAddressItem) } logs, sub, err := _Factory.contract.FilterLogs(opts, "VaultAddress", newVaultAddressRule) if err != nil { return nil, err } return &FactoryVaultAddressIterator{contract: _Factory.contract, event: "VaultAddress", logs: logs, sub: sub}, nil } // WatchVaultAddress is a free log subscription operation binding the contract event 0xb9c265ae4414f501736ec5d4961edc3309e4385eb2ff3feeecb30fb36621dd83. // // Solidity: event VaultAddress(address indexed newVaultAddress) func (_Factory *FactoryFilterer) WatchVaultAddress(opts *bind.WatchOpts, sink chan<- *FactoryVaultAddress, newVaultAddress []common.Address) (event.Subscription, error) { var newVaultAddressRule []interface{} for _, newVaultAddressItem := range newVaultAddress { newVaultAddressRule = append(newVaultAddressRule, newVaultAddressItem) } logs, sub, err := _Factory.contract.WatchLogs(opts, "VaultAddress", newVaultAddressRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(FactoryVaultAddress) if err := _Factory.contract.UnpackLog(event, "VaultAddress", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseVaultAddress is a log parse operation binding the contract event 0xb9c265ae4414f501736ec5d4961edc3309e4385eb2ff3feeecb30fb36621dd83. // // Solidity: event VaultAddress(address indexed newVaultAddress) func (_Factory *FactoryFilterer) ParseVaultAddress(log types.Log) (*FactoryVaultAddress, error) { event := new(FactoryVaultAddress) if err := _Factory.contract.UnpackLog(event, "VaultAddress", log); err != nil { return nil, err } event.Raw = log return event, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/binds/arbitrumfactory/abi.json ================================================ [ { "inputs": [ { "internalType": "address", "name": "_poolDeployer", "type": "address" }, { "internalType": "address", "name": "_vaultAddress", "type": "address" } ], "stateMutability": "nonpayable", "type": "constructor" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "uint8", "name": "newDefaultCommunityFee", "type": "uint8" } ], "name": "DefaultCommunityFee", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "newFarmingAddress", "type": "address" } ], "name": "FarmingAddress", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "uint16", "name": "alpha1", "type": "uint16" }, { "indexed": false, "internalType": "uint16", "name": "alpha2", "type": "uint16" }, { "indexed": false, "internalType": "uint32", "name": "beta1", "type": "uint32" }, { "indexed": false, "internalType": "uint32", "name": "beta2", "type": "uint32" }, { "indexed": false, "internalType": "uint16", "name": "gamma1", "type": "uint16" }, { "indexed": false, "internalType": "uint16", "name": "gamma2", "type": "uint16" }, { "indexed": false, "internalType": "uint32", "name": "volumeBeta", "type": "uint32" }, { "indexed": false, "internalType": "uint16", "name": "volumeGamma", "type": "uint16" }, { "indexed": false, "internalType": "uint16", "name": "baseFee", "type": "uint16" } ], "name": "FeeConfiguration", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "newOwner", "type": "address" } ], "name": "Owner", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "token0", "type": "address" }, { "indexed": true, "internalType": "address", "name": "token1", "type": "address" }, { "indexed": false, "internalType": "address", "name": "pool", "type": "address" } ], "name": "Pool", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "newVaultAddress", "type": "address" } ], "name": "VaultAddress", "type": "event" }, { "inputs": [], "name": "baseFeeConfiguration", "outputs": [ { "internalType": "uint16", "name": "alpha1", "type": "uint16" }, { "internalType": "uint16", "name": "alpha2", "type": "uint16" }, { "internalType": "uint32", "name": "beta1", "type": "uint32" }, { "internalType": "uint32", "name": "beta2", "type": "uint32" }, { "internalType": "uint16", "name": "gamma1", "type": "uint16" }, { "internalType": "uint16", "name": "gamma2", "type": "uint16" }, { "internalType": "uint32", "name": "volumeBeta", "type": "uint32" }, { "internalType": "uint16", "name": "volumeGamma", "type": "uint16" }, { "internalType": "uint16", "name": "baseFee", "type": "uint16" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "tokenA", "type": "address" }, { "internalType": "address", "name": "tokenB", "type": "address" } ], "name": "createPool", "outputs": [ { "internalType": "address", "name": "pool", "type": "address" } ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "defaultCommunityFee", "outputs": [ { "internalType": "uint8", "name": "", "type": "uint8" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "farmingAddress", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "owner", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "", "type": "address" }, { "internalType": "address", "name": "", "type": "address" } ], "name": "poolByPair", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "poolDeployer", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint16", "name": "alpha1", "type": "uint16" }, { "internalType": "uint16", "name": "alpha2", "type": "uint16" }, { "internalType": "uint32", "name": "beta1", "type": "uint32" }, { "internalType": "uint32", "name": "beta2", "type": "uint32" }, { "internalType": "uint16", "name": "gamma1", "type": "uint16" }, { "internalType": "uint16", "name": "gamma2", "type": "uint16" }, { "internalType": "uint32", "name": "volumeBeta", "type": "uint32" }, { "internalType": "uint16", "name": "volumeGamma", "type": "uint16" }, { "internalType": "uint16", "name": "baseFee", "type": "uint16" } ], "name": "setBaseFeeConfiguration", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint8", "name": "newDefaultCommunityFee", "type": "uint8" } ], "name": "setDefaultCommunityFee", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "_farmingAddress", "type": "address" } ], "name": "setFarmingAddress", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "_owner", "type": "address" } ], "name": "setOwner", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "_vaultAddress", "type": "address" } ], "name": "setVaultAddress", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "vaultAddress", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" } ] ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/binds/arbitrumnonfungiblepositionmanager/NonfungiblePositionManager.go ================================================ // Code generated - DO NOT EDIT. // This file is a generated binding and any manual changes will be lost. package arbitrumnonfungiblepositionmanager import ( "errors" "math/big" "strings" ethereum "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/event" ) // Reference imports to suppress errors if they are not otherwise used. var ( _ = errors.New _ = big.NewInt _ = strings.NewReader _ = ethereum.NotFound _ = bind.Bind _ = common.Big1 _ = types.BloomLookup _ = event.NewSubscription _ = abi.ConvertType ) // INonfungiblePositionManagerCollectParams is an auto generated low-level Go binding around an user-defined struct. type INonfungiblePositionManagerCollectParams struct { TokenId *big.Int Recipient common.Address Amount0Max *big.Int Amount1Max *big.Int } // INonfungiblePositionManagerDecreaseLiquidityParams is an auto generated low-level Go binding around an user-defined struct. type INonfungiblePositionManagerDecreaseLiquidityParams struct { TokenId *big.Int Liquidity *big.Int Amount0Min *big.Int Amount1Min *big.Int Deadline *big.Int } // INonfungiblePositionManagerIncreaseLiquidityParams is an auto generated low-level Go binding around an user-defined struct. type INonfungiblePositionManagerIncreaseLiquidityParams struct { TokenId *big.Int Amount0Desired *big.Int Amount1Desired *big.Int Amount0Min *big.Int Amount1Min *big.Int Deadline *big.Int } // INonfungiblePositionManagerMintParams is an auto generated low-level Go binding around an user-defined struct. type INonfungiblePositionManagerMintParams struct { Token0 common.Address Token1 common.Address TickLower *big.Int TickUpper *big.Int Amount0Desired *big.Int Amount1Desired *big.Int Amount0Min *big.Int Amount1Min *big.Int Recipient common.Address Deadline *big.Int } // NonfungiblePositionManagerMetaData contains all meta data concerning the NonfungiblePositionManager contract. var NonfungiblePositionManagerMetaData = &bind.MetaData{ ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_factory\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_WNativeToken\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_tokenDescriptor_\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_poolDeployer\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"approved\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"ApprovalForAll\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"}],\"name\":\"Collect\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"liquidity\",\"type\":\"uint128\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"}],\"name\":\"DecreaseLiquidity\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"liquidity\",\"type\":\"uint128\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"actualLiquidity\",\"type\":\"uint128\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"name\":\"IncreaseLiquidity\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"DOMAIN_SEPARATOR\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"PERMIT_TYPEHASH\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"WNativeToken\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0Owed\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Owed\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"algebraMintCallback\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"baseURI\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"burn\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint128\",\"name\":\"amount0Max\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"amount1Max\",\"type\":\"uint128\"}],\"internalType\":\"structINonfungiblePositionManager.CollectParams\",\"name\":\"params\",\"type\":\"tuple\"}],\"name\":\"collect\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token0\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token1\",\"type\":\"address\"},{\"internalType\":\"uint160\",\"name\":\"sqrtPriceX96\",\"type\":\"uint160\"}],\"name\":\"createAndInitializePoolIfNecessary\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint128\",\"name\":\"liquidity\",\"type\":\"uint128\"},{\"internalType\":\"uint256\",\"name\":\"amount0Min\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Min\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"}],\"internalType\":\"structINonfungiblePositionManager.DecreaseLiquidityParams\",\"name\":\"params\",\"type\":\"tuple\"}],\"name\":\"decreaseLiquidity\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"factory\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"getApproved\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount0Desired\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Desired\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount0Min\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Min\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"}],\"internalType\":\"structINonfungiblePositionManager.IncreaseLiquidityParams\",\"name\":\"params\",\"type\":\"tuple\"}],\"name\":\"increaseLiquidity\",\"outputs\":[{\"internalType\":\"uint128\",\"name\":\"liquidity\",\"type\":\"uint128\"},{\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"name\":\"isApprovedForAll\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"token0\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token1\",\"type\":\"address\"},{\"internalType\":\"int24\",\"name\":\"tickLower\",\"type\":\"int24\"},{\"internalType\":\"int24\",\"name\":\"tickUpper\",\"type\":\"int24\"},{\"internalType\":\"uint256\",\"name\":\"amount0Desired\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Desired\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount0Min\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Min\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"}],\"internalType\":\"structINonfungiblePositionManager.MintParams\",\"name\":\"params\",\"type\":\"tuple\"}],\"name\":\"mint\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint128\",\"name\":\"liquidity\",\"type\":\"uint128\"},{\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes[]\",\"name\":\"data\",\"type\":\"bytes[]\"}],\"name\":\"multicall\",\"outputs\":[{\"internalType\":\"bytes[]\",\"name\":\"results\",\"type\":\"bytes[]\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"ownerOf\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"permit\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"poolDeployer\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"positions\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"nonce\",\"type\":\"uint96\"},{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token0\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token1\",\"type\":\"address\"},{\"internalType\":\"int24\",\"name\":\"tickLower\",\"type\":\"int24\"},{\"internalType\":\"int24\",\"name\":\"tickUpper\",\"type\":\"int24\"},{\"internalType\":\"uint128\",\"name\":\"liquidity\",\"type\":\"uint128\"},{\"internalType\":\"uint256\",\"name\":\"feeGrowthInside0LastX128\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"feeGrowthInside1LastX128\",\"type\":\"uint256\"},{\"internalType\":\"uint128\",\"name\":\"tokensOwed0\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"tokensOwed1\",\"type\":\"uint128\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"refundNativeToken\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"safeTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"safeTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"selfPermit\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiry\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"selfPermitAllowed\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiry\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"selfPermitAllowedIfNecessary\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"selfPermitIfNecessary\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"setApprovalForAll\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amountMinimum\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"}],\"name\":\"sweepToken\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"}],\"name\":\"tokenByIndex\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"}],\"name\":\"tokenOfOwnerByIndex\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"tokenURI\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountMinimum\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"}],\"name\":\"unwrapWNativeToken\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]", } // NonfungiblePositionManagerABI is the input ABI used to generate the binding from. // Deprecated: Use NonfungiblePositionManagerMetaData.ABI instead. var NonfungiblePositionManagerABI = NonfungiblePositionManagerMetaData.ABI // NonfungiblePositionManager is an auto generated Go binding around an Ethereum contract. type NonfungiblePositionManager struct { NonfungiblePositionManagerCaller // Read-only binding to the contract NonfungiblePositionManagerTransactor // Write-only binding to the contract NonfungiblePositionManagerFilterer // Log filterer for contract events } // NonfungiblePositionManagerCaller is an auto generated read-only Go binding around an Ethereum contract. type NonfungiblePositionManagerCaller struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // NonfungiblePositionManagerTransactor is an auto generated write-only Go binding around an Ethereum contract. type NonfungiblePositionManagerTransactor struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // NonfungiblePositionManagerFilterer is an auto generated log filtering Go binding around an Ethereum contract events. type NonfungiblePositionManagerFilterer struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // NonfungiblePositionManagerSession is an auto generated Go binding around an Ethereum contract, // with pre-set call and transact options. type NonfungiblePositionManagerSession struct { Contract *NonfungiblePositionManager // Generic contract binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // NonfungiblePositionManagerCallerSession is an auto generated read-only Go binding around an Ethereum contract, // with pre-set call options. type NonfungiblePositionManagerCallerSession struct { Contract *NonfungiblePositionManagerCaller // Generic contract caller binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session } // NonfungiblePositionManagerTransactorSession is an auto generated write-only Go binding around an Ethereum contract, // with pre-set transact options. type NonfungiblePositionManagerTransactorSession struct { Contract *NonfungiblePositionManagerTransactor // Generic contract transactor binding to set the session for TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // NonfungiblePositionManagerRaw is an auto generated low-level Go binding around an Ethereum contract. type NonfungiblePositionManagerRaw struct { Contract *NonfungiblePositionManager // Generic contract binding to access the raw methods on } // NonfungiblePositionManagerCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. type NonfungiblePositionManagerCallerRaw struct { Contract *NonfungiblePositionManagerCaller // Generic read-only contract binding to access the raw methods on } // NonfungiblePositionManagerTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. type NonfungiblePositionManagerTransactorRaw struct { Contract *NonfungiblePositionManagerTransactor // Generic write-only contract binding to access the raw methods on } // NewNonfungiblePositionManager creates a new instance of NonfungiblePositionManager, bound to a specific deployed contract. func NewNonfungiblePositionManager(address common.Address, backend bind.ContractBackend) (*NonfungiblePositionManager, error) { contract, err := bindNonfungiblePositionManager(address, backend, backend, backend) if err != nil { return nil, err } return &NonfungiblePositionManager{NonfungiblePositionManagerCaller: NonfungiblePositionManagerCaller{contract: contract}, NonfungiblePositionManagerTransactor: NonfungiblePositionManagerTransactor{contract: contract}, NonfungiblePositionManagerFilterer: NonfungiblePositionManagerFilterer{contract: contract}}, nil } // NewNonfungiblePositionManagerCaller creates a new read-only instance of NonfungiblePositionManager, bound to a specific deployed contract. func NewNonfungiblePositionManagerCaller(address common.Address, caller bind.ContractCaller) (*NonfungiblePositionManagerCaller, error) { contract, err := bindNonfungiblePositionManager(address, caller, nil, nil) if err != nil { return nil, err } return &NonfungiblePositionManagerCaller{contract: contract}, nil } // NewNonfungiblePositionManagerTransactor creates a new write-only instance of NonfungiblePositionManager, bound to a specific deployed contract. func NewNonfungiblePositionManagerTransactor(address common.Address, transactor bind.ContractTransactor) (*NonfungiblePositionManagerTransactor, error) { contract, err := bindNonfungiblePositionManager(address, nil, transactor, nil) if err != nil { return nil, err } return &NonfungiblePositionManagerTransactor{contract: contract}, nil } // NewNonfungiblePositionManagerFilterer creates a new log filterer instance of NonfungiblePositionManager, bound to a specific deployed contract. func NewNonfungiblePositionManagerFilterer(address common.Address, filterer bind.ContractFilterer) (*NonfungiblePositionManagerFilterer, error) { contract, err := bindNonfungiblePositionManager(address, nil, nil, filterer) if err != nil { return nil, err } return &NonfungiblePositionManagerFilterer{contract: contract}, nil } // bindNonfungiblePositionManager binds a generic wrapper to an already deployed contract. func bindNonfungiblePositionManager(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { parsed, err := NonfungiblePositionManagerMetaData.GetAbi() if err != nil { return nil, err } return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_NonfungiblePositionManager *NonfungiblePositionManagerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _NonfungiblePositionManager.Contract.NonfungiblePositionManagerCaller.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_NonfungiblePositionManager *NonfungiblePositionManagerRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.NonfungiblePositionManagerTransactor.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_NonfungiblePositionManager *NonfungiblePositionManagerRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.NonfungiblePositionManagerTransactor.contract.Transact(opts, method, params...) } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _NonfungiblePositionManager.Contract.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.contract.Transact(opts, method, params...) } // DOMAINSEPARATOR is a free data retrieval call binding the contract method 0x3644e515. // // Solidity: function DOMAIN_SEPARATOR() view returns(bytes32) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) DOMAINSEPARATOR(opts *bind.CallOpts) ([32]byte, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "DOMAIN_SEPARATOR") if err != nil { return *new([32]byte), err } out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) return out0, err } // DOMAINSEPARATOR is a free data retrieval call binding the contract method 0x3644e515. // // Solidity: function DOMAIN_SEPARATOR() view returns(bytes32) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) DOMAINSEPARATOR() ([32]byte, error) { return _NonfungiblePositionManager.Contract.DOMAINSEPARATOR(&_NonfungiblePositionManager.CallOpts) } // DOMAINSEPARATOR is a free data retrieval call binding the contract method 0x3644e515. // // Solidity: function DOMAIN_SEPARATOR() view returns(bytes32) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) DOMAINSEPARATOR() ([32]byte, error) { return _NonfungiblePositionManager.Contract.DOMAINSEPARATOR(&_NonfungiblePositionManager.CallOpts) } // PERMITTYPEHASH is a free data retrieval call binding the contract method 0x30adf81f. // // Solidity: function PERMIT_TYPEHASH() view returns(bytes32) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) PERMITTYPEHASH(opts *bind.CallOpts) ([32]byte, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "PERMIT_TYPEHASH") if err != nil { return *new([32]byte), err } out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) return out0, err } // PERMITTYPEHASH is a free data retrieval call binding the contract method 0x30adf81f. // // Solidity: function PERMIT_TYPEHASH() view returns(bytes32) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) PERMITTYPEHASH() ([32]byte, error) { return _NonfungiblePositionManager.Contract.PERMITTYPEHASH(&_NonfungiblePositionManager.CallOpts) } // PERMITTYPEHASH is a free data retrieval call binding the contract method 0x30adf81f. // // Solidity: function PERMIT_TYPEHASH() view returns(bytes32) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) PERMITTYPEHASH() ([32]byte, error) { return _NonfungiblePositionManager.Contract.PERMITTYPEHASH(&_NonfungiblePositionManager.CallOpts) } // WNativeToken is a free data retrieval call binding the contract method 0x8af3ac85. // // Solidity: function WNativeToken() view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) WNativeToken(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "WNativeToken") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // WNativeToken is a free data retrieval call binding the contract method 0x8af3ac85. // // Solidity: function WNativeToken() view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) WNativeToken() (common.Address, error) { return _NonfungiblePositionManager.Contract.WNativeToken(&_NonfungiblePositionManager.CallOpts) } // WNativeToken is a free data retrieval call binding the contract method 0x8af3ac85. // // Solidity: function WNativeToken() view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) WNativeToken() (common.Address, error) { return _NonfungiblePositionManager.Contract.WNativeToken(&_NonfungiblePositionManager.CallOpts) } // BalanceOf is a free data retrieval call binding the contract method 0x70a08231. // // Solidity: function balanceOf(address owner) view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) BalanceOf(opts *bind.CallOpts, owner common.Address) (*big.Int, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "balanceOf", owner) if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // BalanceOf is a free data retrieval call binding the contract method 0x70a08231. // // Solidity: function balanceOf(address owner) view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) BalanceOf(owner common.Address) (*big.Int, error) { return _NonfungiblePositionManager.Contract.BalanceOf(&_NonfungiblePositionManager.CallOpts, owner) } // BalanceOf is a free data retrieval call binding the contract method 0x70a08231. // // Solidity: function balanceOf(address owner) view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) BalanceOf(owner common.Address) (*big.Int, error) { return _NonfungiblePositionManager.Contract.BalanceOf(&_NonfungiblePositionManager.CallOpts, owner) } // BaseURI is a free data retrieval call binding the contract method 0x6c0360eb. // // Solidity: function baseURI() pure returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) BaseURI(opts *bind.CallOpts) (string, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "baseURI") if err != nil { return *new(string), err } out0 := *abi.ConvertType(out[0], new(string)).(*string) return out0, err } // BaseURI is a free data retrieval call binding the contract method 0x6c0360eb. // // Solidity: function baseURI() pure returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) BaseURI() (string, error) { return _NonfungiblePositionManager.Contract.BaseURI(&_NonfungiblePositionManager.CallOpts) } // BaseURI is a free data retrieval call binding the contract method 0x6c0360eb. // // Solidity: function baseURI() pure returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) BaseURI() (string, error) { return _NonfungiblePositionManager.Contract.BaseURI(&_NonfungiblePositionManager.CallOpts) } // Factory is a free data retrieval call binding the contract method 0xc45a0155. // // Solidity: function factory() view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) Factory(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "factory") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // Factory is a free data retrieval call binding the contract method 0xc45a0155. // // Solidity: function factory() view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Factory() (common.Address, error) { return _NonfungiblePositionManager.Contract.Factory(&_NonfungiblePositionManager.CallOpts) } // Factory is a free data retrieval call binding the contract method 0xc45a0155. // // Solidity: function factory() view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) Factory() (common.Address, error) { return _NonfungiblePositionManager.Contract.Factory(&_NonfungiblePositionManager.CallOpts) } // GetApproved is a free data retrieval call binding the contract method 0x081812fc. // // Solidity: function getApproved(uint256 tokenId) view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) GetApproved(opts *bind.CallOpts, tokenId *big.Int) (common.Address, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "getApproved", tokenId) if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // GetApproved is a free data retrieval call binding the contract method 0x081812fc. // // Solidity: function getApproved(uint256 tokenId) view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) GetApproved(tokenId *big.Int) (common.Address, error) { return _NonfungiblePositionManager.Contract.GetApproved(&_NonfungiblePositionManager.CallOpts, tokenId) } // GetApproved is a free data retrieval call binding the contract method 0x081812fc. // // Solidity: function getApproved(uint256 tokenId) view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) GetApproved(tokenId *big.Int) (common.Address, error) { return _NonfungiblePositionManager.Contract.GetApproved(&_NonfungiblePositionManager.CallOpts, tokenId) } // IsApprovedForAll is a free data retrieval call binding the contract method 0xe985e9c5. // // Solidity: function isApprovedForAll(address owner, address operator) view returns(bool) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) IsApprovedForAll(opts *bind.CallOpts, owner common.Address, operator common.Address) (bool, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "isApprovedForAll", owner, operator) if err != nil { return *new(bool), err } out0 := *abi.ConvertType(out[0], new(bool)).(*bool) return out0, err } // IsApprovedForAll is a free data retrieval call binding the contract method 0xe985e9c5. // // Solidity: function isApprovedForAll(address owner, address operator) view returns(bool) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) IsApprovedForAll(owner common.Address, operator common.Address) (bool, error) { return _NonfungiblePositionManager.Contract.IsApprovedForAll(&_NonfungiblePositionManager.CallOpts, owner, operator) } // IsApprovedForAll is a free data retrieval call binding the contract method 0xe985e9c5. // // Solidity: function isApprovedForAll(address owner, address operator) view returns(bool) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) IsApprovedForAll(owner common.Address, operator common.Address) (bool, error) { return _NonfungiblePositionManager.Contract.IsApprovedForAll(&_NonfungiblePositionManager.CallOpts, owner, operator) } // Name is a free data retrieval call binding the contract method 0x06fdde03. // // Solidity: function name() view returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) Name(opts *bind.CallOpts) (string, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "name") if err != nil { return *new(string), err } out0 := *abi.ConvertType(out[0], new(string)).(*string) return out0, err } // Name is a free data retrieval call binding the contract method 0x06fdde03. // // Solidity: function name() view returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Name() (string, error) { return _NonfungiblePositionManager.Contract.Name(&_NonfungiblePositionManager.CallOpts) } // Name is a free data retrieval call binding the contract method 0x06fdde03. // // Solidity: function name() view returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) Name() (string, error) { return _NonfungiblePositionManager.Contract.Name(&_NonfungiblePositionManager.CallOpts) } // OwnerOf is a free data retrieval call binding the contract method 0x6352211e. // // Solidity: function ownerOf(uint256 tokenId) view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) OwnerOf(opts *bind.CallOpts, tokenId *big.Int) (common.Address, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "ownerOf", tokenId) if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // OwnerOf is a free data retrieval call binding the contract method 0x6352211e. // // Solidity: function ownerOf(uint256 tokenId) view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) OwnerOf(tokenId *big.Int) (common.Address, error) { return _NonfungiblePositionManager.Contract.OwnerOf(&_NonfungiblePositionManager.CallOpts, tokenId) } // OwnerOf is a free data retrieval call binding the contract method 0x6352211e. // // Solidity: function ownerOf(uint256 tokenId) view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) OwnerOf(tokenId *big.Int) (common.Address, error) { return _NonfungiblePositionManager.Contract.OwnerOf(&_NonfungiblePositionManager.CallOpts, tokenId) } // PoolDeployer is a free data retrieval call binding the contract method 0x3119049a. // // Solidity: function poolDeployer() view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) PoolDeployer(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "poolDeployer") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // PoolDeployer is a free data retrieval call binding the contract method 0x3119049a. // // Solidity: function poolDeployer() view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) PoolDeployer() (common.Address, error) { return _NonfungiblePositionManager.Contract.PoolDeployer(&_NonfungiblePositionManager.CallOpts) } // PoolDeployer is a free data retrieval call binding the contract method 0x3119049a. // // Solidity: function poolDeployer() view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) PoolDeployer() (common.Address, error) { return _NonfungiblePositionManager.Contract.PoolDeployer(&_NonfungiblePositionManager.CallOpts) } // Positions is a free data retrieval call binding the contract method 0x99fbab88. // // Solidity: function positions(uint256 tokenId) view returns(uint96 nonce, address operator, address token0, address token1, int24 tickLower, int24 tickUpper, uint128 liquidity, uint256 feeGrowthInside0LastX128, uint256 feeGrowthInside1LastX128, uint128 tokensOwed0, uint128 tokensOwed1) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) Positions(opts *bind.CallOpts, tokenId *big.Int) (struct { Nonce *big.Int Operator common.Address Token0 common.Address Token1 common.Address TickLower *big.Int TickUpper *big.Int Liquidity *big.Int FeeGrowthInside0LastX128 *big.Int FeeGrowthInside1LastX128 *big.Int TokensOwed0 *big.Int TokensOwed1 *big.Int }, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "positions", tokenId) outstruct := new(struct { Nonce *big.Int Operator common.Address Token0 common.Address Token1 common.Address TickLower *big.Int TickUpper *big.Int Liquidity *big.Int FeeGrowthInside0LastX128 *big.Int FeeGrowthInside1LastX128 *big.Int TokensOwed0 *big.Int TokensOwed1 *big.Int }) if err != nil { return *outstruct, err } outstruct.Nonce = *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) outstruct.Operator = *abi.ConvertType(out[1], new(common.Address)).(*common.Address) outstruct.Token0 = *abi.ConvertType(out[2], new(common.Address)).(*common.Address) outstruct.Token1 = *abi.ConvertType(out[3], new(common.Address)).(*common.Address) outstruct.TickLower = *abi.ConvertType(out[4], new(*big.Int)).(**big.Int) outstruct.TickUpper = *abi.ConvertType(out[5], new(*big.Int)).(**big.Int) outstruct.Liquidity = *abi.ConvertType(out[6], new(*big.Int)).(**big.Int) outstruct.FeeGrowthInside0LastX128 = *abi.ConvertType(out[7], new(*big.Int)).(**big.Int) outstruct.FeeGrowthInside1LastX128 = *abi.ConvertType(out[8], new(*big.Int)).(**big.Int) outstruct.TokensOwed0 = *abi.ConvertType(out[9], new(*big.Int)).(**big.Int) outstruct.TokensOwed1 = *abi.ConvertType(out[10], new(*big.Int)).(**big.Int) return *outstruct, err } // Positions is a free data retrieval call binding the contract method 0x99fbab88. // // Solidity: function positions(uint256 tokenId) view returns(uint96 nonce, address operator, address token0, address token1, int24 tickLower, int24 tickUpper, uint128 liquidity, uint256 feeGrowthInside0LastX128, uint256 feeGrowthInside1LastX128, uint128 tokensOwed0, uint128 tokensOwed1) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Positions(tokenId *big.Int) (struct { Nonce *big.Int Operator common.Address Token0 common.Address Token1 common.Address TickLower *big.Int TickUpper *big.Int Liquidity *big.Int FeeGrowthInside0LastX128 *big.Int FeeGrowthInside1LastX128 *big.Int TokensOwed0 *big.Int TokensOwed1 *big.Int }, error) { return _NonfungiblePositionManager.Contract.Positions(&_NonfungiblePositionManager.CallOpts, tokenId) } // Positions is a free data retrieval call binding the contract method 0x99fbab88. // // Solidity: function positions(uint256 tokenId) view returns(uint96 nonce, address operator, address token0, address token1, int24 tickLower, int24 tickUpper, uint128 liquidity, uint256 feeGrowthInside0LastX128, uint256 feeGrowthInside1LastX128, uint128 tokensOwed0, uint128 tokensOwed1) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) Positions(tokenId *big.Int) (struct { Nonce *big.Int Operator common.Address Token0 common.Address Token1 common.Address TickLower *big.Int TickUpper *big.Int Liquidity *big.Int FeeGrowthInside0LastX128 *big.Int FeeGrowthInside1LastX128 *big.Int TokensOwed0 *big.Int TokensOwed1 *big.Int }, error) { return _NonfungiblePositionManager.Contract.Positions(&_NonfungiblePositionManager.CallOpts, tokenId) } // SupportsInterface is a free data retrieval call binding the contract method 0x01ffc9a7. // // Solidity: function supportsInterface(bytes4 interfaceId) view returns(bool) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) SupportsInterface(opts *bind.CallOpts, interfaceId [4]byte) (bool, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "supportsInterface", interfaceId) if err != nil { return *new(bool), err } out0 := *abi.ConvertType(out[0], new(bool)).(*bool) return out0, err } // SupportsInterface is a free data retrieval call binding the contract method 0x01ffc9a7. // // Solidity: function supportsInterface(bytes4 interfaceId) view returns(bool) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) SupportsInterface(interfaceId [4]byte) (bool, error) { return _NonfungiblePositionManager.Contract.SupportsInterface(&_NonfungiblePositionManager.CallOpts, interfaceId) } // SupportsInterface is a free data retrieval call binding the contract method 0x01ffc9a7. // // Solidity: function supportsInterface(bytes4 interfaceId) view returns(bool) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) SupportsInterface(interfaceId [4]byte) (bool, error) { return _NonfungiblePositionManager.Contract.SupportsInterface(&_NonfungiblePositionManager.CallOpts, interfaceId) } // Symbol is a free data retrieval call binding the contract method 0x95d89b41. // // Solidity: function symbol() view returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) Symbol(opts *bind.CallOpts) (string, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "symbol") if err != nil { return *new(string), err } out0 := *abi.ConvertType(out[0], new(string)).(*string) return out0, err } // Symbol is a free data retrieval call binding the contract method 0x95d89b41. // // Solidity: function symbol() view returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Symbol() (string, error) { return _NonfungiblePositionManager.Contract.Symbol(&_NonfungiblePositionManager.CallOpts) } // Symbol is a free data retrieval call binding the contract method 0x95d89b41. // // Solidity: function symbol() view returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) Symbol() (string, error) { return _NonfungiblePositionManager.Contract.Symbol(&_NonfungiblePositionManager.CallOpts) } // TokenByIndex is a free data retrieval call binding the contract method 0x4f6ccce7. // // Solidity: function tokenByIndex(uint256 index) view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) TokenByIndex(opts *bind.CallOpts, index *big.Int) (*big.Int, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "tokenByIndex", index) if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // TokenByIndex is a free data retrieval call binding the contract method 0x4f6ccce7. // // Solidity: function tokenByIndex(uint256 index) view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) TokenByIndex(index *big.Int) (*big.Int, error) { return _NonfungiblePositionManager.Contract.TokenByIndex(&_NonfungiblePositionManager.CallOpts, index) } // TokenByIndex is a free data retrieval call binding the contract method 0x4f6ccce7. // // Solidity: function tokenByIndex(uint256 index) view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) TokenByIndex(index *big.Int) (*big.Int, error) { return _NonfungiblePositionManager.Contract.TokenByIndex(&_NonfungiblePositionManager.CallOpts, index) } // TokenOfOwnerByIndex is a free data retrieval call binding the contract method 0x2f745c59. // // Solidity: function tokenOfOwnerByIndex(address owner, uint256 index) view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) TokenOfOwnerByIndex(opts *bind.CallOpts, owner common.Address, index *big.Int) (*big.Int, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "tokenOfOwnerByIndex", owner, index) if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // TokenOfOwnerByIndex is a free data retrieval call binding the contract method 0x2f745c59. // // Solidity: function tokenOfOwnerByIndex(address owner, uint256 index) view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) TokenOfOwnerByIndex(owner common.Address, index *big.Int) (*big.Int, error) { return _NonfungiblePositionManager.Contract.TokenOfOwnerByIndex(&_NonfungiblePositionManager.CallOpts, owner, index) } // TokenOfOwnerByIndex is a free data retrieval call binding the contract method 0x2f745c59. // // Solidity: function tokenOfOwnerByIndex(address owner, uint256 index) view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) TokenOfOwnerByIndex(owner common.Address, index *big.Int) (*big.Int, error) { return _NonfungiblePositionManager.Contract.TokenOfOwnerByIndex(&_NonfungiblePositionManager.CallOpts, owner, index) } // TokenURI is a free data retrieval call binding the contract method 0xc87b56dd. // // Solidity: function tokenURI(uint256 tokenId) view returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) TokenURI(opts *bind.CallOpts, tokenId *big.Int) (string, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "tokenURI", tokenId) if err != nil { return *new(string), err } out0 := *abi.ConvertType(out[0], new(string)).(*string) return out0, err } // TokenURI is a free data retrieval call binding the contract method 0xc87b56dd. // // Solidity: function tokenURI(uint256 tokenId) view returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) TokenURI(tokenId *big.Int) (string, error) { return _NonfungiblePositionManager.Contract.TokenURI(&_NonfungiblePositionManager.CallOpts, tokenId) } // TokenURI is a free data retrieval call binding the contract method 0xc87b56dd. // // Solidity: function tokenURI(uint256 tokenId) view returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) TokenURI(tokenId *big.Int) (string, error) { return _NonfungiblePositionManager.Contract.TokenURI(&_NonfungiblePositionManager.CallOpts, tokenId) } // TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. // // Solidity: function totalSupply() view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) TotalSupply(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "totalSupply") if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. // // Solidity: function totalSupply() view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) TotalSupply() (*big.Int, error) { return _NonfungiblePositionManager.Contract.TotalSupply(&_NonfungiblePositionManager.CallOpts) } // TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. // // Solidity: function totalSupply() view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) TotalSupply() (*big.Int, error) { return _NonfungiblePositionManager.Contract.TotalSupply(&_NonfungiblePositionManager.CallOpts) } // AlgebraMintCallback is a paid mutator transaction binding the contract method 0x3dd657c5. // // Solidity: function algebraMintCallback(uint256 amount0Owed, uint256 amount1Owed, bytes data) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) AlgebraMintCallback(opts *bind.TransactOpts, amount0Owed *big.Int, amount1Owed *big.Int, data []byte) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "algebraMintCallback", amount0Owed, amount1Owed, data) } // AlgebraMintCallback is a paid mutator transaction binding the contract method 0x3dd657c5. // // Solidity: function algebraMintCallback(uint256 amount0Owed, uint256 amount1Owed, bytes data) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) AlgebraMintCallback(amount0Owed *big.Int, amount1Owed *big.Int, data []byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.AlgebraMintCallback(&_NonfungiblePositionManager.TransactOpts, amount0Owed, amount1Owed, data) } // AlgebraMintCallback is a paid mutator transaction binding the contract method 0x3dd657c5. // // Solidity: function algebraMintCallback(uint256 amount0Owed, uint256 amount1Owed, bytes data) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) AlgebraMintCallback(amount0Owed *big.Int, amount1Owed *big.Int, data []byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.AlgebraMintCallback(&_NonfungiblePositionManager.TransactOpts, amount0Owed, amount1Owed, data) } // Approve is a paid mutator transaction binding the contract method 0x095ea7b3. // // Solidity: function approve(address to, uint256 tokenId) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) Approve(opts *bind.TransactOpts, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "approve", to, tokenId) } // Approve is a paid mutator transaction binding the contract method 0x095ea7b3. // // Solidity: function approve(address to, uint256 tokenId) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Approve(to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Approve(&_NonfungiblePositionManager.TransactOpts, to, tokenId) } // Approve is a paid mutator transaction binding the contract method 0x095ea7b3. // // Solidity: function approve(address to, uint256 tokenId) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) Approve(to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Approve(&_NonfungiblePositionManager.TransactOpts, to, tokenId) } // Burn is a paid mutator transaction binding the contract method 0x42966c68. // // Solidity: function burn(uint256 tokenId) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) Burn(opts *bind.TransactOpts, tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "burn", tokenId) } // Burn is a paid mutator transaction binding the contract method 0x42966c68. // // Solidity: function burn(uint256 tokenId) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Burn(tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Burn(&_NonfungiblePositionManager.TransactOpts, tokenId) } // Burn is a paid mutator transaction binding the contract method 0x42966c68. // // Solidity: function burn(uint256 tokenId) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) Burn(tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Burn(&_NonfungiblePositionManager.TransactOpts, tokenId) } // Collect is a paid mutator transaction binding the contract method 0xfc6f7865. // // Solidity: function collect((uint256,address,uint128,uint128) params) payable returns(uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) Collect(opts *bind.TransactOpts, params INonfungiblePositionManagerCollectParams) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "collect", params) } // Collect is a paid mutator transaction binding the contract method 0xfc6f7865. // // Solidity: function collect((uint256,address,uint128,uint128) params) payable returns(uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Collect(params INonfungiblePositionManagerCollectParams) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Collect(&_NonfungiblePositionManager.TransactOpts, params) } // Collect is a paid mutator transaction binding the contract method 0xfc6f7865. // // Solidity: function collect((uint256,address,uint128,uint128) params) payable returns(uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) Collect(params INonfungiblePositionManagerCollectParams) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Collect(&_NonfungiblePositionManager.TransactOpts, params) } // CreateAndInitializePoolIfNecessary is a paid mutator transaction binding the contract method 0x51246d6e. // // Solidity: function createAndInitializePoolIfNecessary(address token0, address token1, uint160 sqrtPriceX96) payable returns(address pool) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) CreateAndInitializePoolIfNecessary(opts *bind.TransactOpts, token0 common.Address, token1 common.Address, sqrtPriceX96 *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "createAndInitializePoolIfNecessary", token0, token1, sqrtPriceX96) } // CreateAndInitializePoolIfNecessary is a paid mutator transaction binding the contract method 0x51246d6e. // // Solidity: function createAndInitializePoolIfNecessary(address token0, address token1, uint160 sqrtPriceX96) payable returns(address pool) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) CreateAndInitializePoolIfNecessary(token0 common.Address, token1 common.Address, sqrtPriceX96 *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.CreateAndInitializePoolIfNecessary(&_NonfungiblePositionManager.TransactOpts, token0, token1, sqrtPriceX96) } // CreateAndInitializePoolIfNecessary is a paid mutator transaction binding the contract method 0x51246d6e. // // Solidity: function createAndInitializePoolIfNecessary(address token0, address token1, uint160 sqrtPriceX96) payable returns(address pool) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) CreateAndInitializePoolIfNecessary(token0 common.Address, token1 common.Address, sqrtPriceX96 *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.CreateAndInitializePoolIfNecessary(&_NonfungiblePositionManager.TransactOpts, token0, token1, sqrtPriceX96) } // DecreaseLiquidity is a paid mutator transaction binding the contract method 0x0c49ccbe. // // Solidity: function decreaseLiquidity((uint256,uint128,uint256,uint256,uint256) params) payable returns(uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) DecreaseLiquidity(opts *bind.TransactOpts, params INonfungiblePositionManagerDecreaseLiquidityParams) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "decreaseLiquidity", params) } // DecreaseLiquidity is a paid mutator transaction binding the contract method 0x0c49ccbe. // // Solidity: function decreaseLiquidity((uint256,uint128,uint256,uint256,uint256) params) payable returns(uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) DecreaseLiquidity(params INonfungiblePositionManagerDecreaseLiquidityParams) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.DecreaseLiquidity(&_NonfungiblePositionManager.TransactOpts, params) } // DecreaseLiquidity is a paid mutator transaction binding the contract method 0x0c49ccbe. // // Solidity: function decreaseLiquidity((uint256,uint128,uint256,uint256,uint256) params) payable returns(uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) DecreaseLiquidity(params INonfungiblePositionManagerDecreaseLiquidityParams) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.DecreaseLiquidity(&_NonfungiblePositionManager.TransactOpts, params) } // IncreaseLiquidity is a paid mutator transaction binding the contract method 0x219f5d17. // // Solidity: function increaseLiquidity((uint256,uint256,uint256,uint256,uint256,uint256) params) payable returns(uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) IncreaseLiquidity(opts *bind.TransactOpts, params INonfungiblePositionManagerIncreaseLiquidityParams) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "increaseLiquidity", params) } // IncreaseLiquidity is a paid mutator transaction binding the contract method 0x219f5d17. // // Solidity: function increaseLiquidity((uint256,uint256,uint256,uint256,uint256,uint256) params) payable returns(uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) IncreaseLiquidity(params INonfungiblePositionManagerIncreaseLiquidityParams) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.IncreaseLiquidity(&_NonfungiblePositionManager.TransactOpts, params) } // IncreaseLiquidity is a paid mutator transaction binding the contract method 0x219f5d17. // // Solidity: function increaseLiquidity((uint256,uint256,uint256,uint256,uint256,uint256) params) payable returns(uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) IncreaseLiquidity(params INonfungiblePositionManagerIncreaseLiquidityParams) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.IncreaseLiquidity(&_NonfungiblePositionManager.TransactOpts, params) } // Mint is a paid mutator transaction binding the contract method 0x9cc1a283. // // Solidity: function mint((address,address,int24,int24,uint256,uint256,uint256,uint256,address,uint256) params) payable returns(uint256 tokenId, uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) Mint(opts *bind.TransactOpts, params INonfungiblePositionManagerMintParams) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "mint", params) } // Mint is a paid mutator transaction binding the contract method 0x9cc1a283. // // Solidity: function mint((address,address,int24,int24,uint256,uint256,uint256,uint256,address,uint256) params) payable returns(uint256 tokenId, uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Mint(params INonfungiblePositionManagerMintParams) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Mint(&_NonfungiblePositionManager.TransactOpts, params) } // Mint is a paid mutator transaction binding the contract method 0x9cc1a283. // // Solidity: function mint((address,address,int24,int24,uint256,uint256,uint256,uint256,address,uint256) params) payable returns(uint256 tokenId, uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) Mint(params INonfungiblePositionManagerMintParams) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Mint(&_NonfungiblePositionManager.TransactOpts, params) } // Multicall is a paid mutator transaction binding the contract method 0xac9650d8. // // Solidity: function multicall(bytes[] data) payable returns(bytes[] results) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) Multicall(opts *bind.TransactOpts, data [][]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "multicall", data) } // Multicall is a paid mutator transaction binding the contract method 0xac9650d8. // // Solidity: function multicall(bytes[] data) payable returns(bytes[] results) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Multicall(data [][]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Multicall(&_NonfungiblePositionManager.TransactOpts, data) } // Multicall is a paid mutator transaction binding the contract method 0xac9650d8. // // Solidity: function multicall(bytes[] data) payable returns(bytes[] results) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) Multicall(data [][]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Multicall(&_NonfungiblePositionManager.TransactOpts, data) } // Permit is a paid mutator transaction binding the contract method 0x7ac2ff7b. // // Solidity: function permit(address spender, uint256 tokenId, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) Permit(opts *bind.TransactOpts, spender common.Address, tokenId *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "permit", spender, tokenId, deadline, v, r, s) } // Permit is a paid mutator transaction binding the contract method 0x7ac2ff7b. // // Solidity: function permit(address spender, uint256 tokenId, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Permit(spender common.Address, tokenId *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Permit(&_NonfungiblePositionManager.TransactOpts, spender, tokenId, deadline, v, r, s) } // Permit is a paid mutator transaction binding the contract method 0x7ac2ff7b. // // Solidity: function permit(address spender, uint256 tokenId, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) Permit(spender common.Address, tokenId *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Permit(&_NonfungiblePositionManager.TransactOpts, spender, tokenId, deadline, v, r, s) } // RefundNativeToken is a paid mutator transaction binding the contract method 0x41865270. // // Solidity: function refundNativeToken() payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) RefundNativeToken(opts *bind.TransactOpts) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "refundNativeToken") } // RefundNativeToken is a paid mutator transaction binding the contract method 0x41865270. // // Solidity: function refundNativeToken() payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) RefundNativeToken() (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.RefundNativeToken(&_NonfungiblePositionManager.TransactOpts) } // RefundNativeToken is a paid mutator transaction binding the contract method 0x41865270. // // Solidity: function refundNativeToken() payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) RefundNativeToken() (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.RefundNativeToken(&_NonfungiblePositionManager.TransactOpts) } // SafeTransferFrom is a paid mutator transaction binding the contract method 0x42842e0e. // // Solidity: function safeTransferFrom(address from, address to, uint256 tokenId) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) SafeTransferFrom(opts *bind.TransactOpts, from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "safeTransferFrom", from, to, tokenId) } // SafeTransferFrom is a paid mutator transaction binding the contract method 0x42842e0e. // // Solidity: function safeTransferFrom(address from, address to, uint256 tokenId) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) SafeTransferFrom(from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SafeTransferFrom(&_NonfungiblePositionManager.TransactOpts, from, to, tokenId) } // SafeTransferFrom is a paid mutator transaction binding the contract method 0x42842e0e. // // Solidity: function safeTransferFrom(address from, address to, uint256 tokenId) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) SafeTransferFrom(from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SafeTransferFrom(&_NonfungiblePositionManager.TransactOpts, from, to, tokenId) } // SafeTransferFrom0 is a paid mutator transaction binding the contract method 0xb88d4fde. // // Solidity: function safeTransferFrom(address from, address to, uint256 tokenId, bytes _data) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) SafeTransferFrom0(opts *bind.TransactOpts, from common.Address, to common.Address, tokenId *big.Int, _data []byte) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "safeTransferFrom0", from, to, tokenId, _data) } // SafeTransferFrom0 is a paid mutator transaction binding the contract method 0xb88d4fde. // // Solidity: function safeTransferFrom(address from, address to, uint256 tokenId, bytes _data) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) SafeTransferFrom0(from common.Address, to common.Address, tokenId *big.Int, _data []byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SafeTransferFrom0(&_NonfungiblePositionManager.TransactOpts, from, to, tokenId, _data) } // SafeTransferFrom0 is a paid mutator transaction binding the contract method 0xb88d4fde. // // Solidity: function safeTransferFrom(address from, address to, uint256 tokenId, bytes _data) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) SafeTransferFrom0(from common.Address, to common.Address, tokenId *big.Int, _data []byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SafeTransferFrom0(&_NonfungiblePositionManager.TransactOpts, from, to, tokenId, _data) } // SelfPermit is a paid mutator transaction binding the contract method 0xf3995c67. // // Solidity: function selfPermit(address token, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) SelfPermit(opts *bind.TransactOpts, token common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "selfPermit", token, value, deadline, v, r, s) } // SelfPermit is a paid mutator transaction binding the contract method 0xf3995c67. // // Solidity: function selfPermit(address token, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) SelfPermit(token common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SelfPermit(&_NonfungiblePositionManager.TransactOpts, token, value, deadline, v, r, s) } // SelfPermit is a paid mutator transaction binding the contract method 0xf3995c67. // // Solidity: function selfPermit(address token, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) SelfPermit(token common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SelfPermit(&_NonfungiblePositionManager.TransactOpts, token, value, deadline, v, r, s) } // SelfPermitAllowed is a paid mutator transaction binding the contract method 0x4659a494. // // Solidity: function selfPermitAllowed(address token, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) SelfPermitAllowed(opts *bind.TransactOpts, token common.Address, nonce *big.Int, expiry *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "selfPermitAllowed", token, nonce, expiry, v, r, s) } // SelfPermitAllowed is a paid mutator transaction binding the contract method 0x4659a494. // // Solidity: function selfPermitAllowed(address token, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) SelfPermitAllowed(token common.Address, nonce *big.Int, expiry *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SelfPermitAllowed(&_NonfungiblePositionManager.TransactOpts, token, nonce, expiry, v, r, s) } // SelfPermitAllowed is a paid mutator transaction binding the contract method 0x4659a494. // // Solidity: function selfPermitAllowed(address token, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) SelfPermitAllowed(token common.Address, nonce *big.Int, expiry *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SelfPermitAllowed(&_NonfungiblePositionManager.TransactOpts, token, nonce, expiry, v, r, s) } // SelfPermitAllowedIfNecessary is a paid mutator transaction binding the contract method 0xa4a78f0c. // // Solidity: function selfPermitAllowedIfNecessary(address token, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) SelfPermitAllowedIfNecessary(opts *bind.TransactOpts, token common.Address, nonce *big.Int, expiry *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "selfPermitAllowedIfNecessary", token, nonce, expiry, v, r, s) } // SelfPermitAllowedIfNecessary is a paid mutator transaction binding the contract method 0xa4a78f0c. // // Solidity: function selfPermitAllowedIfNecessary(address token, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) SelfPermitAllowedIfNecessary(token common.Address, nonce *big.Int, expiry *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SelfPermitAllowedIfNecessary(&_NonfungiblePositionManager.TransactOpts, token, nonce, expiry, v, r, s) } // SelfPermitAllowedIfNecessary is a paid mutator transaction binding the contract method 0xa4a78f0c. // // Solidity: function selfPermitAllowedIfNecessary(address token, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) SelfPermitAllowedIfNecessary(token common.Address, nonce *big.Int, expiry *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SelfPermitAllowedIfNecessary(&_NonfungiblePositionManager.TransactOpts, token, nonce, expiry, v, r, s) } // SelfPermitIfNecessary is a paid mutator transaction binding the contract method 0xc2e3140a. // // Solidity: function selfPermitIfNecessary(address token, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) SelfPermitIfNecessary(opts *bind.TransactOpts, token common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "selfPermitIfNecessary", token, value, deadline, v, r, s) } // SelfPermitIfNecessary is a paid mutator transaction binding the contract method 0xc2e3140a. // // Solidity: function selfPermitIfNecessary(address token, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) SelfPermitIfNecessary(token common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SelfPermitIfNecessary(&_NonfungiblePositionManager.TransactOpts, token, value, deadline, v, r, s) } // SelfPermitIfNecessary is a paid mutator transaction binding the contract method 0xc2e3140a. // // Solidity: function selfPermitIfNecessary(address token, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) SelfPermitIfNecessary(token common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SelfPermitIfNecessary(&_NonfungiblePositionManager.TransactOpts, token, value, deadline, v, r, s) } // SetApprovalForAll is a paid mutator transaction binding the contract method 0xa22cb465. // // Solidity: function setApprovalForAll(address operator, bool approved) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) SetApprovalForAll(opts *bind.TransactOpts, operator common.Address, approved bool) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "setApprovalForAll", operator, approved) } // SetApprovalForAll is a paid mutator transaction binding the contract method 0xa22cb465. // // Solidity: function setApprovalForAll(address operator, bool approved) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) SetApprovalForAll(operator common.Address, approved bool) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SetApprovalForAll(&_NonfungiblePositionManager.TransactOpts, operator, approved) } // SetApprovalForAll is a paid mutator transaction binding the contract method 0xa22cb465. // // Solidity: function setApprovalForAll(address operator, bool approved) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) SetApprovalForAll(operator common.Address, approved bool) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SetApprovalForAll(&_NonfungiblePositionManager.TransactOpts, operator, approved) } // SweepToken is a paid mutator transaction binding the contract method 0xdf2ab5bb. // // Solidity: function sweepToken(address token, uint256 amountMinimum, address recipient) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) SweepToken(opts *bind.TransactOpts, token common.Address, amountMinimum *big.Int, recipient common.Address) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "sweepToken", token, amountMinimum, recipient) } // SweepToken is a paid mutator transaction binding the contract method 0xdf2ab5bb. // // Solidity: function sweepToken(address token, uint256 amountMinimum, address recipient) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) SweepToken(token common.Address, amountMinimum *big.Int, recipient common.Address) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SweepToken(&_NonfungiblePositionManager.TransactOpts, token, amountMinimum, recipient) } // SweepToken is a paid mutator transaction binding the contract method 0xdf2ab5bb. // // Solidity: function sweepToken(address token, uint256 amountMinimum, address recipient) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) SweepToken(token common.Address, amountMinimum *big.Int, recipient common.Address) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SweepToken(&_NonfungiblePositionManager.TransactOpts, token, amountMinimum, recipient) } // TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. // // Solidity: function transferFrom(address from, address to, uint256 tokenId) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) TransferFrom(opts *bind.TransactOpts, from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "transferFrom", from, to, tokenId) } // TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. // // Solidity: function transferFrom(address from, address to, uint256 tokenId) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) TransferFrom(from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.TransferFrom(&_NonfungiblePositionManager.TransactOpts, from, to, tokenId) } // TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. // // Solidity: function transferFrom(address from, address to, uint256 tokenId) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) TransferFrom(from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.TransferFrom(&_NonfungiblePositionManager.TransactOpts, from, to, tokenId) } // UnwrapWNativeToken is a paid mutator transaction binding the contract method 0x69bc35b2. // // Solidity: function unwrapWNativeToken(uint256 amountMinimum, address recipient) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) UnwrapWNativeToken(opts *bind.TransactOpts, amountMinimum *big.Int, recipient common.Address) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "unwrapWNativeToken", amountMinimum, recipient) } // UnwrapWNativeToken is a paid mutator transaction binding the contract method 0x69bc35b2. // // Solidity: function unwrapWNativeToken(uint256 amountMinimum, address recipient) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) UnwrapWNativeToken(amountMinimum *big.Int, recipient common.Address) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.UnwrapWNativeToken(&_NonfungiblePositionManager.TransactOpts, amountMinimum, recipient) } // UnwrapWNativeToken is a paid mutator transaction binding the contract method 0x69bc35b2. // // Solidity: function unwrapWNativeToken(uint256 amountMinimum, address recipient) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) UnwrapWNativeToken(amountMinimum *big.Int, recipient common.Address) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.UnwrapWNativeToken(&_NonfungiblePositionManager.TransactOpts, amountMinimum, recipient) } // Receive is a paid mutator transaction binding the contract receive function. // // Solidity: receive() payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) Receive(opts *bind.TransactOpts) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.RawTransact(opts, nil) // calldata is disallowed for receive function } // Receive is a paid mutator transaction binding the contract receive function. // // Solidity: receive() payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Receive() (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Receive(&_NonfungiblePositionManager.TransactOpts) } // Receive is a paid mutator transaction binding the contract receive function. // // Solidity: receive() payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) Receive() (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Receive(&_NonfungiblePositionManager.TransactOpts) } // NonfungiblePositionManagerApprovalIterator is returned from FilterApproval and is used to iterate over the raw logs and unpacked data for Approval events raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerApprovalIterator struct { Event *NonfungiblePositionManagerApproval // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *NonfungiblePositionManagerApprovalIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerApproval) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerApproval) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *NonfungiblePositionManagerApprovalIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *NonfungiblePositionManagerApprovalIterator) Close() error { it.sub.Unsubscribe() return nil } // NonfungiblePositionManagerApproval represents a Approval event raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerApproval struct { Owner common.Address Approved common.Address TokenId *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterApproval is a free log retrieval operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. // // Solidity: event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) FilterApproval(opts *bind.FilterOpts, owner []common.Address, approved []common.Address, tokenId []*big.Int) (*NonfungiblePositionManagerApprovalIterator, error) { var ownerRule []interface{} for _, ownerItem := range owner { ownerRule = append(ownerRule, ownerItem) } var approvedRule []interface{} for _, approvedItem := range approved { approvedRule = append(approvedRule, approvedItem) } var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _NonfungiblePositionManager.contract.FilterLogs(opts, "Approval", ownerRule, approvedRule, tokenIdRule) if err != nil { return nil, err } return &NonfungiblePositionManagerApprovalIterator{contract: _NonfungiblePositionManager.contract, event: "Approval", logs: logs, sub: sub}, nil } // WatchApproval is a free log subscription operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. // // Solidity: event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) WatchApproval(opts *bind.WatchOpts, sink chan<- *NonfungiblePositionManagerApproval, owner []common.Address, approved []common.Address, tokenId []*big.Int) (event.Subscription, error) { var ownerRule []interface{} for _, ownerItem := range owner { ownerRule = append(ownerRule, ownerItem) } var approvedRule []interface{} for _, approvedItem := range approved { approvedRule = append(approvedRule, approvedItem) } var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _NonfungiblePositionManager.contract.WatchLogs(opts, "Approval", ownerRule, approvedRule, tokenIdRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(NonfungiblePositionManagerApproval) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "Approval", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseApproval is a log parse operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. // // Solidity: event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) ParseApproval(log types.Log) (*NonfungiblePositionManagerApproval, error) { event := new(NonfungiblePositionManagerApproval) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "Approval", log); err != nil { return nil, err } event.Raw = log return event, nil } // NonfungiblePositionManagerApprovalForAllIterator is returned from FilterApprovalForAll and is used to iterate over the raw logs and unpacked data for ApprovalForAll events raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerApprovalForAllIterator struct { Event *NonfungiblePositionManagerApprovalForAll // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *NonfungiblePositionManagerApprovalForAllIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerApprovalForAll) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerApprovalForAll) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *NonfungiblePositionManagerApprovalForAllIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *NonfungiblePositionManagerApprovalForAllIterator) Close() error { it.sub.Unsubscribe() return nil } // NonfungiblePositionManagerApprovalForAll represents a ApprovalForAll event raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerApprovalForAll struct { Owner common.Address Operator common.Address Approved bool Raw types.Log // Blockchain specific contextual infos } // FilterApprovalForAll is a free log retrieval operation binding the contract event 0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31. // // Solidity: event ApprovalForAll(address indexed owner, address indexed operator, bool approved) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) FilterApprovalForAll(opts *bind.FilterOpts, owner []common.Address, operator []common.Address) (*NonfungiblePositionManagerApprovalForAllIterator, error) { var ownerRule []interface{} for _, ownerItem := range owner { ownerRule = append(ownerRule, ownerItem) } var operatorRule []interface{} for _, operatorItem := range operator { operatorRule = append(operatorRule, operatorItem) } logs, sub, err := _NonfungiblePositionManager.contract.FilterLogs(opts, "ApprovalForAll", ownerRule, operatorRule) if err != nil { return nil, err } return &NonfungiblePositionManagerApprovalForAllIterator{contract: _NonfungiblePositionManager.contract, event: "ApprovalForAll", logs: logs, sub: sub}, nil } // WatchApprovalForAll is a free log subscription operation binding the contract event 0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31. // // Solidity: event ApprovalForAll(address indexed owner, address indexed operator, bool approved) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) WatchApprovalForAll(opts *bind.WatchOpts, sink chan<- *NonfungiblePositionManagerApprovalForAll, owner []common.Address, operator []common.Address) (event.Subscription, error) { var ownerRule []interface{} for _, ownerItem := range owner { ownerRule = append(ownerRule, ownerItem) } var operatorRule []interface{} for _, operatorItem := range operator { operatorRule = append(operatorRule, operatorItem) } logs, sub, err := _NonfungiblePositionManager.contract.WatchLogs(opts, "ApprovalForAll", ownerRule, operatorRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(NonfungiblePositionManagerApprovalForAll) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "ApprovalForAll", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseApprovalForAll is a log parse operation binding the contract event 0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31. // // Solidity: event ApprovalForAll(address indexed owner, address indexed operator, bool approved) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) ParseApprovalForAll(log types.Log) (*NonfungiblePositionManagerApprovalForAll, error) { event := new(NonfungiblePositionManagerApprovalForAll) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "ApprovalForAll", log); err != nil { return nil, err } event.Raw = log return event, nil } // NonfungiblePositionManagerCollectIterator is returned from FilterCollect and is used to iterate over the raw logs and unpacked data for Collect events raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerCollectIterator struct { Event *NonfungiblePositionManagerCollect // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *NonfungiblePositionManagerCollectIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerCollect) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerCollect) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *NonfungiblePositionManagerCollectIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *NonfungiblePositionManagerCollectIterator) Close() error { it.sub.Unsubscribe() return nil } // NonfungiblePositionManagerCollect represents a Collect event raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerCollect struct { TokenId *big.Int Recipient common.Address Amount0 *big.Int Amount1 *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterCollect is a free log retrieval operation binding the contract event 0x40d0efd1a53d60ecbf40971b9daf7dc90178c3aadc7aab1765632738fa8b8f01. // // Solidity: event Collect(uint256 indexed tokenId, address recipient, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) FilterCollect(opts *bind.FilterOpts, tokenId []*big.Int) (*NonfungiblePositionManagerCollectIterator, error) { var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _NonfungiblePositionManager.contract.FilterLogs(opts, "Collect", tokenIdRule) if err != nil { return nil, err } return &NonfungiblePositionManagerCollectIterator{contract: _NonfungiblePositionManager.contract, event: "Collect", logs: logs, sub: sub}, nil } // WatchCollect is a free log subscription operation binding the contract event 0x40d0efd1a53d60ecbf40971b9daf7dc90178c3aadc7aab1765632738fa8b8f01. // // Solidity: event Collect(uint256 indexed tokenId, address recipient, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) WatchCollect(opts *bind.WatchOpts, sink chan<- *NonfungiblePositionManagerCollect, tokenId []*big.Int) (event.Subscription, error) { var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _NonfungiblePositionManager.contract.WatchLogs(opts, "Collect", tokenIdRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(NonfungiblePositionManagerCollect) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "Collect", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseCollect is a log parse operation binding the contract event 0x40d0efd1a53d60ecbf40971b9daf7dc90178c3aadc7aab1765632738fa8b8f01. // // Solidity: event Collect(uint256 indexed tokenId, address recipient, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) ParseCollect(log types.Log) (*NonfungiblePositionManagerCollect, error) { event := new(NonfungiblePositionManagerCollect) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "Collect", log); err != nil { return nil, err } event.Raw = log return event, nil } // NonfungiblePositionManagerDecreaseLiquidityIterator is returned from FilterDecreaseLiquidity and is used to iterate over the raw logs and unpacked data for DecreaseLiquidity events raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerDecreaseLiquidityIterator struct { Event *NonfungiblePositionManagerDecreaseLiquidity // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *NonfungiblePositionManagerDecreaseLiquidityIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerDecreaseLiquidity) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerDecreaseLiquidity) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *NonfungiblePositionManagerDecreaseLiquidityIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *NonfungiblePositionManagerDecreaseLiquidityIterator) Close() error { it.sub.Unsubscribe() return nil } // NonfungiblePositionManagerDecreaseLiquidity represents a DecreaseLiquidity event raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerDecreaseLiquidity struct { TokenId *big.Int Liquidity *big.Int Amount0 *big.Int Amount1 *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterDecreaseLiquidity is a free log retrieval operation binding the contract event 0x26f6a048ee9138f2c0ce266f322cb99228e8d619ae2bff30c67f8dcf9d2377b4. // // Solidity: event DecreaseLiquidity(uint256 indexed tokenId, uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) FilterDecreaseLiquidity(opts *bind.FilterOpts, tokenId []*big.Int) (*NonfungiblePositionManagerDecreaseLiquidityIterator, error) { var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _NonfungiblePositionManager.contract.FilterLogs(opts, "DecreaseLiquidity", tokenIdRule) if err != nil { return nil, err } return &NonfungiblePositionManagerDecreaseLiquidityIterator{contract: _NonfungiblePositionManager.contract, event: "DecreaseLiquidity", logs: logs, sub: sub}, nil } // WatchDecreaseLiquidity is a free log subscription operation binding the contract event 0x26f6a048ee9138f2c0ce266f322cb99228e8d619ae2bff30c67f8dcf9d2377b4. // // Solidity: event DecreaseLiquidity(uint256 indexed tokenId, uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) WatchDecreaseLiquidity(opts *bind.WatchOpts, sink chan<- *NonfungiblePositionManagerDecreaseLiquidity, tokenId []*big.Int) (event.Subscription, error) { var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _NonfungiblePositionManager.contract.WatchLogs(opts, "DecreaseLiquidity", tokenIdRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(NonfungiblePositionManagerDecreaseLiquidity) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "DecreaseLiquidity", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseDecreaseLiquidity is a log parse operation binding the contract event 0x26f6a048ee9138f2c0ce266f322cb99228e8d619ae2bff30c67f8dcf9d2377b4. // // Solidity: event DecreaseLiquidity(uint256 indexed tokenId, uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) ParseDecreaseLiquidity(log types.Log) (*NonfungiblePositionManagerDecreaseLiquidity, error) { event := new(NonfungiblePositionManagerDecreaseLiquidity) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "DecreaseLiquidity", log); err != nil { return nil, err } event.Raw = log return event, nil } // NonfungiblePositionManagerIncreaseLiquidityIterator is returned from FilterIncreaseLiquidity and is used to iterate over the raw logs and unpacked data for IncreaseLiquidity events raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerIncreaseLiquidityIterator struct { Event *NonfungiblePositionManagerIncreaseLiquidity // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *NonfungiblePositionManagerIncreaseLiquidityIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerIncreaseLiquidity) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerIncreaseLiquidity) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *NonfungiblePositionManagerIncreaseLiquidityIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *NonfungiblePositionManagerIncreaseLiquidityIterator) Close() error { it.sub.Unsubscribe() return nil } // NonfungiblePositionManagerIncreaseLiquidity represents a IncreaseLiquidity event raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerIncreaseLiquidity struct { TokenId *big.Int Liquidity *big.Int ActualLiquidity *big.Int Amount0 *big.Int Amount1 *big.Int Pool common.Address Raw types.Log // Blockchain specific contextual infos } // FilterIncreaseLiquidity is a free log retrieval operation binding the contract event 0x8a82de7fe9b33e0e6bca0e26f5bd14a74f1164ffe236d50e0a36c3ea70f2b814. // // Solidity: event IncreaseLiquidity(uint256 indexed tokenId, uint128 liquidity, uint128 actualLiquidity, uint256 amount0, uint256 amount1, address pool) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) FilterIncreaseLiquidity(opts *bind.FilterOpts, tokenId []*big.Int) (*NonfungiblePositionManagerIncreaseLiquidityIterator, error) { var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _NonfungiblePositionManager.contract.FilterLogs(opts, "IncreaseLiquidity", tokenIdRule) if err != nil { return nil, err } return &NonfungiblePositionManagerIncreaseLiquidityIterator{contract: _NonfungiblePositionManager.contract, event: "IncreaseLiquidity", logs: logs, sub: sub}, nil } // WatchIncreaseLiquidity is a free log subscription operation binding the contract event 0x8a82de7fe9b33e0e6bca0e26f5bd14a74f1164ffe236d50e0a36c3ea70f2b814. // // Solidity: event IncreaseLiquidity(uint256 indexed tokenId, uint128 liquidity, uint128 actualLiquidity, uint256 amount0, uint256 amount1, address pool) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) WatchIncreaseLiquidity(opts *bind.WatchOpts, sink chan<- *NonfungiblePositionManagerIncreaseLiquidity, tokenId []*big.Int) (event.Subscription, error) { var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _NonfungiblePositionManager.contract.WatchLogs(opts, "IncreaseLiquidity", tokenIdRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(NonfungiblePositionManagerIncreaseLiquidity) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "IncreaseLiquidity", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseIncreaseLiquidity is a log parse operation binding the contract event 0x8a82de7fe9b33e0e6bca0e26f5bd14a74f1164ffe236d50e0a36c3ea70f2b814. // // Solidity: event IncreaseLiquidity(uint256 indexed tokenId, uint128 liquidity, uint128 actualLiquidity, uint256 amount0, uint256 amount1, address pool) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) ParseIncreaseLiquidity(log types.Log) (*NonfungiblePositionManagerIncreaseLiquidity, error) { event := new(NonfungiblePositionManagerIncreaseLiquidity) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "IncreaseLiquidity", log); err != nil { return nil, err } event.Raw = log return event, nil } // NonfungiblePositionManagerTransferIterator is returned from FilterTransfer and is used to iterate over the raw logs and unpacked data for Transfer events raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerTransferIterator struct { Event *NonfungiblePositionManagerTransfer // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *NonfungiblePositionManagerTransferIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerTransfer) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerTransfer) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *NonfungiblePositionManagerTransferIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *NonfungiblePositionManagerTransferIterator) Close() error { it.sub.Unsubscribe() return nil } // NonfungiblePositionManagerTransfer represents a Transfer event raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerTransfer struct { From common.Address To common.Address TokenId *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterTransfer is a free log retrieval operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. // // Solidity: event Transfer(address indexed from, address indexed to, uint256 indexed tokenId) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) FilterTransfer(opts *bind.FilterOpts, from []common.Address, to []common.Address, tokenId []*big.Int) (*NonfungiblePositionManagerTransferIterator, error) { var fromRule []interface{} for _, fromItem := range from { fromRule = append(fromRule, fromItem) } var toRule []interface{} for _, toItem := range to { toRule = append(toRule, toItem) } var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _NonfungiblePositionManager.contract.FilterLogs(opts, "Transfer", fromRule, toRule, tokenIdRule) if err != nil { return nil, err } return &NonfungiblePositionManagerTransferIterator{contract: _NonfungiblePositionManager.contract, event: "Transfer", logs: logs, sub: sub}, nil } // WatchTransfer is a free log subscription operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. // // Solidity: event Transfer(address indexed from, address indexed to, uint256 indexed tokenId) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) WatchTransfer(opts *bind.WatchOpts, sink chan<- *NonfungiblePositionManagerTransfer, from []common.Address, to []common.Address, tokenId []*big.Int) (event.Subscription, error) { var fromRule []interface{} for _, fromItem := range from { fromRule = append(fromRule, fromItem) } var toRule []interface{} for _, toItem := range to { toRule = append(toRule, toItem) } var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _NonfungiblePositionManager.contract.WatchLogs(opts, "Transfer", fromRule, toRule, tokenIdRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(NonfungiblePositionManagerTransfer) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "Transfer", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseTransfer is a log parse operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. // // Solidity: event Transfer(address indexed from, address indexed to, uint256 indexed tokenId) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) ParseTransfer(log types.Log) (*NonfungiblePositionManagerTransfer, error) { event := new(NonfungiblePositionManagerTransfer) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "Transfer", log); err != nil { return nil, err } event.Raw = log return event, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/binds/arbitrumnonfungiblepositionmanager/abi.json ================================================ [ { "inputs": [ { "internalType": "address", "name": "_factory", "type": "address" }, { "internalType": "address", "name": "_WNativeToken", "type": "address" }, { "internalType": "address", "name": "_tokenDescriptor_", "type": "address" }, { "internalType": "address", "name": "_poolDeployer", "type": "address" } ], "stateMutability": "nonpayable", "type": "constructor" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "owner", "type": "address" }, { "indexed": true, "internalType": "address", "name": "approved", "type": "address" }, { "indexed": true, "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "Approval", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "owner", "type": "address" }, { "indexed": true, "internalType": "address", "name": "operator", "type": "address" }, { "indexed": false, "internalType": "bool", "name": "approved", "type": "bool" } ], "name": "ApprovalForAll", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "indexed": false, "internalType": "address", "name": "recipient", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "amount0", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "amount1", "type": "uint256" } ], "name": "Collect", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "indexed": false, "internalType": "uint128", "name": "liquidity", "type": "uint128" }, { "indexed": false, "internalType": "uint256", "name": "amount0", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "amount1", "type": "uint256" } ], "name": "DecreaseLiquidity", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "indexed": false, "internalType": "uint128", "name": "liquidity", "type": "uint128" }, { "indexed": false, "internalType": "uint128", "name": "actualLiquidity", "type": "uint128" }, { "indexed": false, "internalType": "uint256", "name": "amount0", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "amount1", "type": "uint256" }, { "indexed": false, "internalType": "address", "name": "pool", "type": "address" } ], "name": "IncreaseLiquidity", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "from", "type": "address" }, { "indexed": true, "internalType": "address", "name": "to", "type": "address" }, { "indexed": true, "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "Transfer", "type": "event" }, { "inputs": [], "name": "DOMAIN_SEPARATOR", "outputs": [ { "internalType": "bytes32", "name": "", "type": "bytes32" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "PERMIT_TYPEHASH", "outputs": [ { "internalType": "bytes32", "name": "", "type": "bytes32" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "WNativeToken", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "amount0Owed", "type": "uint256" }, { "internalType": "uint256", "name": "amount1Owed", "type": "uint256" }, { "internalType": "bytes", "name": "data", "type": "bytes" } ], "name": "algebraMintCallback", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "to", "type": "address" }, { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "approve", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "owner", "type": "address" } ], "name": "balanceOf", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "baseURI", "outputs": [ { "internalType": "string", "name": "", "type": "string" } ], "stateMutability": "pure", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "burn", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "components": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "internalType": "address", "name": "recipient", "type": "address" }, { "internalType": "uint128", "name": "amount0Max", "type": "uint128" }, { "internalType": "uint128", "name": "amount1Max", "type": "uint128" } ], "internalType": "struct INonfungiblePositionManager.CollectParams", "name": "params", "type": "tuple" } ], "name": "collect", "outputs": [ { "internalType": "uint256", "name": "amount0", "type": "uint256" }, { "internalType": "uint256", "name": "amount1", "type": "uint256" } ], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "token0", "type": "address" }, { "internalType": "address", "name": "token1", "type": "address" }, { "internalType": "uint160", "name": "sqrtPriceX96", "type": "uint160" } ], "name": "createAndInitializePoolIfNecessary", "outputs": [ { "internalType": "address", "name": "pool", "type": "address" } ], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "components": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "internalType": "uint128", "name": "liquidity", "type": "uint128" }, { "internalType": "uint256", "name": "amount0Min", "type": "uint256" }, { "internalType": "uint256", "name": "amount1Min", "type": "uint256" }, { "internalType": "uint256", "name": "deadline", "type": "uint256" } ], "internalType": "struct INonfungiblePositionManager.DecreaseLiquidityParams", "name": "params", "type": "tuple" } ], "name": "decreaseLiquidity", "outputs": [ { "internalType": "uint256", "name": "amount0", "type": "uint256" }, { "internalType": "uint256", "name": "amount1", "type": "uint256" } ], "stateMutability": "payable", "type": "function" }, { "inputs": [], "name": "factory", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "getApproved", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "components": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "internalType": "uint256", "name": "amount0Desired", "type": "uint256" }, { "internalType": "uint256", "name": "amount1Desired", "type": "uint256" }, { "internalType": "uint256", "name": "amount0Min", "type": "uint256" }, { "internalType": "uint256", "name": "amount1Min", "type": "uint256" }, { "internalType": "uint256", "name": "deadline", "type": "uint256" } ], "internalType": "struct INonfungiblePositionManager.IncreaseLiquidityParams", "name": "params", "type": "tuple" } ], "name": "increaseLiquidity", "outputs": [ { "internalType": "uint128", "name": "liquidity", "type": "uint128" }, { "internalType": "uint256", "name": "amount0", "type": "uint256" }, { "internalType": "uint256", "name": "amount1", "type": "uint256" } ], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "owner", "type": "address" }, { "internalType": "address", "name": "operator", "type": "address" } ], "name": "isApprovedForAll", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "components": [ { "internalType": "address", "name": "token0", "type": "address" }, { "internalType": "address", "name": "token1", "type": "address" }, { "internalType": "int24", "name": "tickLower", "type": "int24" }, { "internalType": "int24", "name": "tickUpper", "type": "int24" }, { "internalType": "uint256", "name": "amount0Desired", "type": "uint256" }, { "internalType": "uint256", "name": "amount1Desired", "type": "uint256" }, { "internalType": "uint256", "name": "amount0Min", "type": "uint256" }, { "internalType": "uint256", "name": "amount1Min", "type": "uint256" }, { "internalType": "address", "name": "recipient", "type": "address" }, { "internalType": "uint256", "name": "deadline", "type": "uint256" } ], "internalType": "struct INonfungiblePositionManager.MintParams", "name": "params", "type": "tuple" } ], "name": "mint", "outputs": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "internalType": "uint128", "name": "liquidity", "type": "uint128" }, { "internalType": "uint256", "name": "amount0", "type": "uint256" }, { "internalType": "uint256", "name": "amount1", "type": "uint256" } ], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "bytes[]", "name": "data", "type": "bytes[]" } ], "name": "multicall", "outputs": [ { "internalType": "bytes[]", "name": "results", "type": "bytes[]" } ], "stateMutability": "payable", "type": "function" }, { "inputs": [], "name": "name", "outputs": [ { "internalType": "string", "name": "", "type": "string" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "ownerOf", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "spender", "type": "address" }, { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "internalType": "uint256", "name": "deadline", "type": "uint256" }, { "internalType": "uint8", "name": "v", "type": "uint8" }, { "internalType": "bytes32", "name": "r", "type": "bytes32" }, { "internalType": "bytes32", "name": "s", "type": "bytes32" } ], "name": "permit", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [], "name": "poolDeployer", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "positions", "outputs": [ { "internalType": "uint96", "name": "nonce", "type": "uint96" }, { "internalType": "address", "name": "operator", "type": "address" }, { "internalType": "address", "name": "token0", "type": "address" }, { "internalType": "address", "name": "token1", "type": "address" }, { "internalType": "int24", "name": "tickLower", "type": "int24" }, { "internalType": "int24", "name": "tickUpper", "type": "int24" }, { "internalType": "uint128", "name": "liquidity", "type": "uint128" }, { "internalType": "uint256", "name": "feeGrowthInside0LastX128", "type": "uint256" }, { "internalType": "uint256", "name": "feeGrowthInside1LastX128", "type": "uint256" }, { "internalType": "uint128", "name": "tokensOwed0", "type": "uint128" }, { "internalType": "uint128", "name": "tokensOwed1", "type": "uint128" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "refundNativeToken", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "from", "type": "address" }, { "internalType": "address", "name": "to", "type": "address" }, { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "safeTransferFrom", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "from", "type": "address" }, { "internalType": "address", "name": "to", "type": "address" }, { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "internalType": "bytes", "name": "_data", "type": "bytes" } ], "name": "safeTransferFrom", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "token", "type": "address" }, { "internalType": "uint256", "name": "value", "type": "uint256" }, { "internalType": "uint256", "name": "deadline", "type": "uint256" }, { "internalType": "uint8", "name": "v", "type": "uint8" }, { "internalType": "bytes32", "name": "r", "type": "bytes32" }, { "internalType": "bytes32", "name": "s", "type": "bytes32" } ], "name": "selfPermit", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "token", "type": "address" }, { "internalType": "uint256", "name": "nonce", "type": "uint256" }, { "internalType": "uint256", "name": "expiry", "type": "uint256" }, { "internalType": "uint8", "name": "v", "type": "uint8" }, { "internalType": "bytes32", "name": "r", "type": "bytes32" }, { "internalType": "bytes32", "name": "s", "type": "bytes32" } ], "name": "selfPermitAllowed", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "token", "type": "address" }, { "internalType": "uint256", "name": "nonce", "type": "uint256" }, { "internalType": "uint256", "name": "expiry", "type": "uint256" }, { "internalType": "uint8", "name": "v", "type": "uint8" }, { "internalType": "bytes32", "name": "r", "type": "bytes32" }, { "internalType": "bytes32", "name": "s", "type": "bytes32" } ], "name": "selfPermitAllowedIfNecessary", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "token", "type": "address" }, { "internalType": "uint256", "name": "value", "type": "uint256" }, { "internalType": "uint256", "name": "deadline", "type": "uint256" }, { "internalType": "uint8", "name": "v", "type": "uint8" }, { "internalType": "bytes32", "name": "r", "type": "bytes32" }, { "internalType": "bytes32", "name": "s", "type": "bytes32" } ], "name": "selfPermitIfNecessary", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "operator", "type": "address" }, { "internalType": "bool", "name": "approved", "type": "bool" } ], "name": "setApprovalForAll", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "bytes4", "name": "interfaceId", "type": "bytes4" } ], "name": "supportsInterface", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "token", "type": "address" }, { "internalType": "uint256", "name": "amountMinimum", "type": "uint256" }, { "internalType": "address", "name": "recipient", "type": "address" } ], "name": "sweepToken", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [], "name": "symbol", "outputs": [ { "internalType": "string", "name": "", "type": "string" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "index", "type": "uint256" } ], "name": "tokenByIndex", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "owner", "type": "address" }, { "internalType": "uint256", "name": "index", "type": "uint256" } ], "name": "tokenOfOwnerByIndex", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "tokenURI", "outputs": [ { "internalType": "string", "name": "", "type": "string" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "totalSupply", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "from", "type": "address" }, { "internalType": "address", "name": "to", "type": "address" }, { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "transferFrom", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "amountMinimum", "type": "uint256" }, { "internalType": "address", "name": "recipient", "type": "address" } ], "name": "unwrapWNativeToken", "outputs": [], "stateMutability": "payable", "type": "function" }, { "stateMutability": "payable", "type": "receive" } ] ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/binds/arbitrumpool/Pool.go ================================================ // Code generated - DO NOT EDIT. // This file is a generated binding and any manual changes will be lost. package arbitrumpool import ( "errors" "math/big" "strings" ethereum "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/event" ) // Reference imports to suppress errors if they are not otherwise used. var ( _ = errors.New _ = big.NewInt _ = strings.NewReader _ = ethereum.NotFound _ = bind.Bind _ = common.Big1 _ = types.BloomLookup _ = event.NewSubscription _ = abi.ConvertType ) // PoolMetaData contains all meta data concerning the Pool contract. var PoolMetaData = &bind.MetaData{ ABI: "[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"int24\",\"name\":\"bottomTick\",\"type\":\"int24\"},{\"indexed\":true,\"internalType\":\"int24\",\"name\":\"topTick\",\"type\":\"int24\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"liquidityAmount\",\"type\":\"uint128\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"}],\"name\":\"Burn\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"int24\",\"name\":\"bottomTick\",\"type\":\"int24\"},{\"indexed\":true,\"internalType\":\"int24\",\"name\":\"topTick\",\"type\":\"int24\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"amount0\",\"type\":\"uint128\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"amount1\",\"type\":\"uint128\"}],\"name\":\"Collect\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"communityFee0New\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"communityFee1New\",\"type\":\"uint8\"}],\"name\":\"CommunityFee\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"feeZto\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"feeOtz\",\"type\":\"uint16\"}],\"name\":\"Fee\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"paid0\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"paid1\",\"type\":\"uint256\"}],\"name\":\"Flash\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"virtualPoolAddress\",\"type\":\"address\"}],\"name\":\"Incentive\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint160\",\"name\":\"price\",\"type\":\"uint160\"},{\"indexed\":false,\"internalType\":\"int24\",\"name\":\"tick\",\"type\":\"int24\"}],\"name\":\"Initialize\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"liquidityCooldown\",\"type\":\"uint32\"}],\"name\":\"LiquidityCooldown\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"int24\",\"name\":\"bottomTick\",\"type\":\"int24\"},{\"indexed\":true,\"internalType\":\"int24\",\"name\":\"topTick\",\"type\":\"int24\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"liquidityAmount\",\"type\":\"uint128\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"}],\"name\":\"Mint\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"int256\",\"name\":\"amount0\",\"type\":\"int256\"},{\"indexed\":false,\"internalType\":\"int256\",\"name\":\"amount1\",\"type\":\"int256\"},{\"indexed\":false,\"internalType\":\"uint160\",\"name\":\"price\",\"type\":\"uint160\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"liquidity\",\"type\":\"uint128\"},{\"indexed\":false,\"internalType\":\"int24\",\"name\":\"tick\",\"type\":\"int24\"}],\"name\":\"Swap\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"int24\",\"name\":\"newTickSpacing\",\"type\":\"int24\"}],\"name\":\"TickSpacing\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"activeIncentive\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"int24\",\"name\":\"bottomTick\",\"type\":\"int24\"},{\"internalType\":\"int24\",\"name\":\"topTick\",\"type\":\"int24\"},{\"internalType\":\"uint128\",\"name\":\"amount\",\"type\":\"uint128\"}],\"name\":\"burn\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"int24\",\"name\":\"bottomTick\",\"type\":\"int24\"},{\"internalType\":\"int24\",\"name\":\"topTick\",\"type\":\"int24\"},{\"internalType\":\"uint128\",\"name\":\"amount0Requested\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"amount1Requested\",\"type\":\"uint128\"}],\"name\":\"collect\",\"outputs\":[{\"internalType\":\"uint128\",\"name\":\"amount0\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"amount1\",\"type\":\"uint128\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"dataStorageOperator\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"factory\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"flash\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"int24\",\"name\":\"bottomTick\",\"type\":\"int24\"},{\"internalType\":\"int24\",\"name\":\"topTick\",\"type\":\"int24\"}],\"name\":\"getInnerCumulatives\",\"outputs\":[{\"internalType\":\"int56\",\"name\":\"innerTickCumulative\",\"type\":\"int56\"},{\"internalType\":\"uint160\",\"name\":\"innerSecondsSpentPerLiquidity\",\"type\":\"uint160\"},{\"internalType\":\"uint32\",\"name\":\"innerSecondsSpent\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32[]\",\"name\":\"secondsAgos\",\"type\":\"uint32[]\"}],\"name\":\"getTimepoints\",\"outputs\":[{\"internalType\":\"int56[]\",\"name\":\"tickCumulatives\",\"type\":\"int56[]\"},{\"internalType\":\"uint160[]\",\"name\":\"secondsPerLiquidityCumulatives\",\"type\":\"uint160[]\"},{\"internalType\":\"uint112[]\",\"name\":\"volatilityCumulatives\",\"type\":\"uint112[]\"},{\"internalType\":\"uint256[]\",\"name\":\"volumePerAvgLiquiditys\",\"type\":\"uint256[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"globalState\",\"outputs\":[{\"internalType\":\"uint160\",\"name\":\"price\",\"type\":\"uint160\"},{\"internalType\":\"int24\",\"name\":\"tick\",\"type\":\"int24\"},{\"internalType\":\"uint16\",\"name\":\"feeZto\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"feeOtz\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"timepointIndex\",\"type\":\"uint16\"},{\"internalType\":\"uint8\",\"name\":\"communityFeeToken0\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"communityFeeToken1\",\"type\":\"uint8\"},{\"internalType\":\"bool\",\"name\":\"unlocked\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint160\",\"name\":\"initialPrice\",\"type\":\"uint160\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"liquidity\",\"outputs\":[{\"internalType\":\"uint128\",\"name\":\"\",\"type\":\"uint128\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"liquidityCooldown\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"maxLiquidityPerTick\",\"outputs\":[{\"internalType\":\"uint128\",\"name\":\"\",\"type\":\"uint128\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"int24\",\"name\":\"bottomTick\",\"type\":\"int24\"},{\"internalType\":\"int24\",\"name\":\"topTick\",\"type\":\"int24\"},{\"internalType\":\"uint128\",\"name\":\"liquidityDesired\",\"type\":\"uint128\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"mint\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"},{\"internalType\":\"uint128\",\"name\":\"liquidityActual\",\"type\":\"uint128\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"positions\",\"outputs\":[{\"internalType\":\"uint128\",\"name\":\"liquidity\",\"type\":\"uint128\"},{\"internalType\":\"uint32\",\"name\":\"lastLiquidityAddTimestamp\",\"type\":\"uint32\"},{\"internalType\":\"uint256\",\"name\":\"innerFeeGrowth0Token\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"innerFeeGrowth1Token\",\"type\":\"uint256\"},{\"internalType\":\"uint128\",\"name\":\"fees0\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"fees1\",\"type\":\"uint128\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"communityFee0\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"communityFee1\",\"type\":\"uint8\"}],\"name\":\"setCommunityFee\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"virtualPoolAddress\",\"type\":\"address\"}],\"name\":\"setIncentive\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"newLiquidityCooldown\",\"type\":\"uint32\"}],\"name\":\"setLiquidityCooldown\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"int24\",\"name\":\"newTickSpacing\",\"type\":\"int24\"}],\"name\":\"setTickSpacing\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"zeroToOne\",\"type\":\"bool\"},{\"internalType\":\"int256\",\"name\":\"amountRequired\",\"type\":\"int256\"},{\"internalType\":\"uint160\",\"name\":\"limitSqrtPrice\",\"type\":\"uint160\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"swap\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"amount0\",\"type\":\"int256\"},{\"internalType\":\"int256\",\"name\":\"amount1\",\"type\":\"int256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"zeroToOne\",\"type\":\"bool\"},{\"internalType\":\"int256\",\"name\":\"amountRequired\",\"type\":\"int256\"},{\"internalType\":\"uint160\",\"name\":\"limitSqrtPrice\",\"type\":\"uint160\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"swapSupportingFeeOnInputTokens\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"amount0\",\"type\":\"int256\"},{\"internalType\":\"int256\",\"name\":\"amount1\",\"type\":\"int256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"tickSpacing\",\"outputs\":[{\"internalType\":\"int24\",\"name\":\"\",\"type\":\"int24\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"int16\",\"name\":\"\",\"type\":\"int16\"}],\"name\":\"tickTable\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"int24\",\"name\":\"\",\"type\":\"int24\"}],\"name\":\"ticks\",\"outputs\":[{\"internalType\":\"uint128\",\"name\":\"liquidityTotal\",\"type\":\"uint128\"},{\"internalType\":\"int128\",\"name\":\"liquidityDelta\",\"type\":\"int128\"},{\"internalType\":\"uint256\",\"name\":\"outerFeeGrowth0Token\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"outerFeeGrowth1Token\",\"type\":\"uint256\"},{\"internalType\":\"int56\",\"name\":\"outerTickCumulative\",\"type\":\"int56\"},{\"internalType\":\"uint160\",\"name\":\"outerSecondsPerLiquidity\",\"type\":\"uint160\"},{\"internalType\":\"uint32\",\"name\":\"outerSecondsSpent\",\"type\":\"uint32\"},{\"internalType\":\"bool\",\"name\":\"initialized\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"}],\"name\":\"timepoints\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"initialized\",\"type\":\"bool\"},{\"internalType\":\"uint32\",\"name\":\"blockTimestamp\",\"type\":\"uint32\"},{\"internalType\":\"int56\",\"name\":\"tickCumulative\",\"type\":\"int56\"},{\"internalType\":\"uint160\",\"name\":\"secondsPerLiquidityCumulative\",\"type\":\"uint160\"},{\"internalType\":\"uint88\",\"name\":\"volatilityCumulative\",\"type\":\"uint88\"},{\"internalType\":\"int24\",\"name\":\"averageTick\",\"type\":\"int24\"},{\"internalType\":\"uint144\",\"name\":\"volumePerLiquidityCumulative\",\"type\":\"uint144\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"token0\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"token1\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalFeeGrowth0Token\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalFeeGrowth1Token\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", } // PoolABI is the input ABI used to generate the binding from. // Deprecated: Use PoolMetaData.ABI instead. var PoolABI = PoolMetaData.ABI // Pool is an auto generated Go binding around an Ethereum contract. type Pool struct { PoolCaller // Read-only binding to the contract PoolTransactor // Write-only binding to the contract PoolFilterer // Log filterer for contract events } // PoolCaller is an auto generated read-only Go binding around an Ethereum contract. type PoolCaller struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // PoolTransactor is an auto generated write-only Go binding around an Ethereum contract. type PoolTransactor struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // PoolFilterer is an auto generated log filtering Go binding around an Ethereum contract events. type PoolFilterer struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // PoolSession is an auto generated Go binding around an Ethereum contract, // with pre-set call and transact options. type PoolSession struct { Contract *Pool // Generic contract binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // PoolCallerSession is an auto generated read-only Go binding around an Ethereum contract, // with pre-set call options. type PoolCallerSession struct { Contract *PoolCaller // Generic contract caller binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session } // PoolTransactorSession is an auto generated write-only Go binding around an Ethereum contract, // with pre-set transact options. type PoolTransactorSession struct { Contract *PoolTransactor // Generic contract transactor binding to set the session for TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // PoolRaw is an auto generated low-level Go binding around an Ethereum contract. type PoolRaw struct { Contract *Pool // Generic contract binding to access the raw methods on } // PoolCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. type PoolCallerRaw struct { Contract *PoolCaller // Generic read-only contract binding to access the raw methods on } // PoolTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. type PoolTransactorRaw struct { Contract *PoolTransactor // Generic write-only contract binding to access the raw methods on } // NewPool creates a new instance of Pool, bound to a specific deployed contract. func NewPool(address common.Address, backend bind.ContractBackend) (*Pool, error) { contract, err := bindPool(address, backend, backend, backend) if err != nil { return nil, err } return &Pool{PoolCaller: PoolCaller{contract: contract}, PoolTransactor: PoolTransactor{contract: contract}, PoolFilterer: PoolFilterer{contract: contract}}, nil } // NewPoolCaller creates a new read-only instance of Pool, bound to a specific deployed contract. func NewPoolCaller(address common.Address, caller bind.ContractCaller) (*PoolCaller, error) { contract, err := bindPool(address, caller, nil, nil) if err != nil { return nil, err } return &PoolCaller{contract: contract}, nil } // NewPoolTransactor creates a new write-only instance of Pool, bound to a specific deployed contract. func NewPoolTransactor(address common.Address, transactor bind.ContractTransactor) (*PoolTransactor, error) { contract, err := bindPool(address, nil, transactor, nil) if err != nil { return nil, err } return &PoolTransactor{contract: contract}, nil } // NewPoolFilterer creates a new log filterer instance of Pool, bound to a specific deployed contract. func NewPoolFilterer(address common.Address, filterer bind.ContractFilterer) (*PoolFilterer, error) { contract, err := bindPool(address, nil, nil, filterer) if err != nil { return nil, err } return &PoolFilterer{contract: contract}, nil } // bindPool binds a generic wrapper to an already deployed contract. func bindPool(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { parsed, err := PoolMetaData.GetAbi() if err != nil { return nil, err } return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_Pool *PoolRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _Pool.Contract.PoolCaller.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_Pool *PoolRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _Pool.Contract.PoolTransactor.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_Pool *PoolRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _Pool.Contract.PoolTransactor.contract.Transact(opts, method, params...) } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_Pool *PoolCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _Pool.Contract.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_Pool *PoolTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _Pool.Contract.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_Pool *PoolTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _Pool.Contract.contract.Transact(opts, method, params...) } // ActiveIncentive is a free data retrieval call binding the contract method 0xfacb0eb1. // // Solidity: function activeIncentive() view returns(address) func (_Pool *PoolCaller) ActiveIncentive(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _Pool.contract.Call(opts, &out, "activeIncentive") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // ActiveIncentive is a free data retrieval call binding the contract method 0xfacb0eb1. // // Solidity: function activeIncentive() view returns(address) func (_Pool *PoolSession) ActiveIncentive() (common.Address, error) { return _Pool.Contract.ActiveIncentive(&_Pool.CallOpts) } // ActiveIncentive is a free data retrieval call binding the contract method 0xfacb0eb1. // // Solidity: function activeIncentive() view returns(address) func (_Pool *PoolCallerSession) ActiveIncentive() (common.Address, error) { return _Pool.Contract.ActiveIncentive(&_Pool.CallOpts) } // DataStorageOperator is a free data retrieval call binding the contract method 0x29047dfa. // // Solidity: function dataStorageOperator() view returns(address) func (_Pool *PoolCaller) DataStorageOperator(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _Pool.contract.Call(opts, &out, "dataStorageOperator") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // DataStorageOperator is a free data retrieval call binding the contract method 0x29047dfa. // // Solidity: function dataStorageOperator() view returns(address) func (_Pool *PoolSession) DataStorageOperator() (common.Address, error) { return _Pool.Contract.DataStorageOperator(&_Pool.CallOpts) } // DataStorageOperator is a free data retrieval call binding the contract method 0x29047dfa. // // Solidity: function dataStorageOperator() view returns(address) func (_Pool *PoolCallerSession) DataStorageOperator() (common.Address, error) { return _Pool.Contract.DataStorageOperator(&_Pool.CallOpts) } // Factory is a free data retrieval call binding the contract method 0xc45a0155. // // Solidity: function factory() view returns(address) func (_Pool *PoolCaller) Factory(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _Pool.contract.Call(opts, &out, "factory") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // Factory is a free data retrieval call binding the contract method 0xc45a0155. // // Solidity: function factory() view returns(address) func (_Pool *PoolSession) Factory() (common.Address, error) { return _Pool.Contract.Factory(&_Pool.CallOpts) } // Factory is a free data retrieval call binding the contract method 0xc45a0155. // // Solidity: function factory() view returns(address) func (_Pool *PoolCallerSession) Factory() (common.Address, error) { return _Pool.Contract.Factory(&_Pool.CallOpts) } // GetInnerCumulatives is a free data retrieval call binding the contract method 0x920c34e5. // // Solidity: function getInnerCumulatives(int24 bottomTick, int24 topTick) view returns(int56 innerTickCumulative, uint160 innerSecondsSpentPerLiquidity, uint32 innerSecondsSpent) func (_Pool *PoolCaller) GetInnerCumulatives(opts *bind.CallOpts, bottomTick *big.Int, topTick *big.Int) (struct { InnerTickCumulative *big.Int InnerSecondsSpentPerLiquidity *big.Int InnerSecondsSpent uint32 }, error) { var out []interface{} err := _Pool.contract.Call(opts, &out, "getInnerCumulatives", bottomTick, topTick) outstruct := new(struct { InnerTickCumulative *big.Int InnerSecondsSpentPerLiquidity *big.Int InnerSecondsSpent uint32 }) if err != nil { return *outstruct, err } outstruct.InnerTickCumulative = *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) outstruct.InnerSecondsSpentPerLiquidity = *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) outstruct.InnerSecondsSpent = *abi.ConvertType(out[2], new(uint32)).(*uint32) return *outstruct, err } // GetInnerCumulatives is a free data retrieval call binding the contract method 0x920c34e5. // // Solidity: function getInnerCumulatives(int24 bottomTick, int24 topTick) view returns(int56 innerTickCumulative, uint160 innerSecondsSpentPerLiquidity, uint32 innerSecondsSpent) func (_Pool *PoolSession) GetInnerCumulatives(bottomTick *big.Int, topTick *big.Int) (struct { InnerTickCumulative *big.Int InnerSecondsSpentPerLiquidity *big.Int InnerSecondsSpent uint32 }, error) { return _Pool.Contract.GetInnerCumulatives(&_Pool.CallOpts, bottomTick, topTick) } // GetInnerCumulatives is a free data retrieval call binding the contract method 0x920c34e5. // // Solidity: function getInnerCumulatives(int24 bottomTick, int24 topTick) view returns(int56 innerTickCumulative, uint160 innerSecondsSpentPerLiquidity, uint32 innerSecondsSpent) func (_Pool *PoolCallerSession) GetInnerCumulatives(bottomTick *big.Int, topTick *big.Int) (struct { InnerTickCumulative *big.Int InnerSecondsSpentPerLiquidity *big.Int InnerSecondsSpent uint32 }, error) { return _Pool.Contract.GetInnerCumulatives(&_Pool.CallOpts, bottomTick, topTick) } // GetTimepoints is a free data retrieval call binding the contract method 0x9d3a5241. // // Solidity: function getTimepoints(uint32[] secondsAgos) view returns(int56[] tickCumulatives, uint160[] secondsPerLiquidityCumulatives, uint112[] volatilityCumulatives, uint256[] volumePerAvgLiquiditys) func (_Pool *PoolCaller) GetTimepoints(opts *bind.CallOpts, secondsAgos []uint32) (struct { TickCumulatives []*big.Int SecondsPerLiquidityCumulatives []*big.Int VolatilityCumulatives []*big.Int VolumePerAvgLiquiditys []*big.Int }, error) { var out []interface{} err := _Pool.contract.Call(opts, &out, "getTimepoints", secondsAgos) outstruct := new(struct { TickCumulatives []*big.Int SecondsPerLiquidityCumulatives []*big.Int VolatilityCumulatives []*big.Int VolumePerAvgLiquiditys []*big.Int }) if err != nil { return *outstruct, err } outstruct.TickCumulatives = *abi.ConvertType(out[0], new([]*big.Int)).(*[]*big.Int) outstruct.SecondsPerLiquidityCumulatives = *abi.ConvertType(out[1], new([]*big.Int)).(*[]*big.Int) outstruct.VolatilityCumulatives = *abi.ConvertType(out[2], new([]*big.Int)).(*[]*big.Int) outstruct.VolumePerAvgLiquiditys = *abi.ConvertType(out[3], new([]*big.Int)).(*[]*big.Int) return *outstruct, err } // GetTimepoints is a free data retrieval call binding the contract method 0x9d3a5241. // // Solidity: function getTimepoints(uint32[] secondsAgos) view returns(int56[] tickCumulatives, uint160[] secondsPerLiquidityCumulatives, uint112[] volatilityCumulatives, uint256[] volumePerAvgLiquiditys) func (_Pool *PoolSession) GetTimepoints(secondsAgos []uint32) (struct { TickCumulatives []*big.Int SecondsPerLiquidityCumulatives []*big.Int VolatilityCumulatives []*big.Int VolumePerAvgLiquiditys []*big.Int }, error) { return _Pool.Contract.GetTimepoints(&_Pool.CallOpts, secondsAgos) } // GetTimepoints is a free data retrieval call binding the contract method 0x9d3a5241. // // Solidity: function getTimepoints(uint32[] secondsAgos) view returns(int56[] tickCumulatives, uint160[] secondsPerLiquidityCumulatives, uint112[] volatilityCumulatives, uint256[] volumePerAvgLiquiditys) func (_Pool *PoolCallerSession) GetTimepoints(secondsAgos []uint32) (struct { TickCumulatives []*big.Int SecondsPerLiquidityCumulatives []*big.Int VolatilityCumulatives []*big.Int VolumePerAvgLiquiditys []*big.Int }, error) { return _Pool.Contract.GetTimepoints(&_Pool.CallOpts, secondsAgos) } // GlobalState is a free data retrieval call binding the contract method 0xe76c01e4. // // Solidity: function globalState() view returns(uint160 price, int24 tick, uint16 feeZto, uint16 feeOtz, uint16 timepointIndex, uint8 communityFeeToken0, uint8 communityFeeToken1, bool unlocked) func (_Pool *PoolCaller) GlobalState(opts *bind.CallOpts) (struct { Price *big.Int Tick *big.Int FeeZto uint16 FeeOtz uint16 TimepointIndex uint16 CommunityFeeToken0 uint8 CommunityFeeToken1 uint8 Unlocked bool }, error) { var out []interface{} err := _Pool.contract.Call(opts, &out, "globalState") outstruct := new(struct { Price *big.Int Tick *big.Int FeeZto uint16 FeeOtz uint16 TimepointIndex uint16 CommunityFeeToken0 uint8 CommunityFeeToken1 uint8 Unlocked bool }) if err != nil { return *outstruct, err } outstruct.Price = *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) outstruct.Tick = *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) outstruct.FeeZto = *abi.ConvertType(out[2], new(uint16)).(*uint16) outstruct.FeeOtz = *abi.ConvertType(out[3], new(uint16)).(*uint16) outstruct.TimepointIndex = *abi.ConvertType(out[4], new(uint16)).(*uint16) outstruct.CommunityFeeToken0 = *abi.ConvertType(out[5], new(uint8)).(*uint8) outstruct.CommunityFeeToken1 = *abi.ConvertType(out[6], new(uint8)).(*uint8) outstruct.Unlocked = *abi.ConvertType(out[7], new(bool)).(*bool) return *outstruct, err } // GlobalState is a free data retrieval call binding the contract method 0xe76c01e4. // // Solidity: function globalState() view returns(uint160 price, int24 tick, uint16 feeZto, uint16 feeOtz, uint16 timepointIndex, uint8 communityFeeToken0, uint8 communityFeeToken1, bool unlocked) func (_Pool *PoolSession) GlobalState() (struct { Price *big.Int Tick *big.Int FeeZto uint16 FeeOtz uint16 TimepointIndex uint16 CommunityFeeToken0 uint8 CommunityFeeToken1 uint8 Unlocked bool }, error) { return _Pool.Contract.GlobalState(&_Pool.CallOpts) } // GlobalState is a free data retrieval call binding the contract method 0xe76c01e4. // // Solidity: function globalState() view returns(uint160 price, int24 tick, uint16 feeZto, uint16 feeOtz, uint16 timepointIndex, uint8 communityFeeToken0, uint8 communityFeeToken1, bool unlocked) func (_Pool *PoolCallerSession) GlobalState() (struct { Price *big.Int Tick *big.Int FeeZto uint16 FeeOtz uint16 TimepointIndex uint16 CommunityFeeToken0 uint8 CommunityFeeToken1 uint8 Unlocked bool }, error) { return _Pool.Contract.GlobalState(&_Pool.CallOpts) } // Liquidity is a free data retrieval call binding the contract method 0x1a686502. // // Solidity: function liquidity() view returns(uint128) func (_Pool *PoolCaller) Liquidity(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} err := _Pool.contract.Call(opts, &out, "liquidity") if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // Liquidity is a free data retrieval call binding the contract method 0x1a686502. // // Solidity: function liquidity() view returns(uint128) func (_Pool *PoolSession) Liquidity() (*big.Int, error) { return _Pool.Contract.Liquidity(&_Pool.CallOpts) } // Liquidity is a free data retrieval call binding the contract method 0x1a686502. // // Solidity: function liquidity() view returns(uint128) func (_Pool *PoolCallerSession) Liquidity() (*big.Int, error) { return _Pool.Contract.Liquidity(&_Pool.CallOpts) } // LiquidityCooldown is a free data retrieval call binding the contract method 0x17e25b3c. // // Solidity: function liquidityCooldown() view returns(uint32) func (_Pool *PoolCaller) LiquidityCooldown(opts *bind.CallOpts) (uint32, error) { var out []interface{} err := _Pool.contract.Call(opts, &out, "liquidityCooldown") if err != nil { return *new(uint32), err } out0 := *abi.ConvertType(out[0], new(uint32)).(*uint32) return out0, err } // LiquidityCooldown is a free data retrieval call binding the contract method 0x17e25b3c. // // Solidity: function liquidityCooldown() view returns(uint32) func (_Pool *PoolSession) LiquidityCooldown() (uint32, error) { return _Pool.Contract.LiquidityCooldown(&_Pool.CallOpts) } // LiquidityCooldown is a free data retrieval call binding the contract method 0x17e25b3c. // // Solidity: function liquidityCooldown() view returns(uint32) func (_Pool *PoolCallerSession) LiquidityCooldown() (uint32, error) { return _Pool.Contract.LiquidityCooldown(&_Pool.CallOpts) } // MaxLiquidityPerTick is a free data retrieval call binding the contract method 0x70cf754a. // // Solidity: function maxLiquidityPerTick() pure returns(uint128) func (_Pool *PoolCaller) MaxLiquidityPerTick(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} err := _Pool.contract.Call(opts, &out, "maxLiquidityPerTick") if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // MaxLiquidityPerTick is a free data retrieval call binding the contract method 0x70cf754a. // // Solidity: function maxLiquidityPerTick() pure returns(uint128) func (_Pool *PoolSession) MaxLiquidityPerTick() (*big.Int, error) { return _Pool.Contract.MaxLiquidityPerTick(&_Pool.CallOpts) } // MaxLiquidityPerTick is a free data retrieval call binding the contract method 0x70cf754a. // // Solidity: function maxLiquidityPerTick() pure returns(uint128) func (_Pool *PoolCallerSession) MaxLiquidityPerTick() (*big.Int, error) { return _Pool.Contract.MaxLiquidityPerTick(&_Pool.CallOpts) } // Positions is a free data retrieval call binding the contract method 0x514ea4bf. // // Solidity: function positions(bytes32 ) view returns(uint128 liquidity, uint32 lastLiquidityAddTimestamp, uint256 innerFeeGrowth0Token, uint256 innerFeeGrowth1Token, uint128 fees0, uint128 fees1) func (_Pool *PoolCaller) Positions(opts *bind.CallOpts, arg0 [32]byte) (struct { Liquidity *big.Int LastLiquidityAddTimestamp uint32 InnerFeeGrowth0Token *big.Int InnerFeeGrowth1Token *big.Int Fees0 *big.Int Fees1 *big.Int }, error) { var out []interface{} err := _Pool.contract.Call(opts, &out, "positions", arg0) outstruct := new(struct { Liquidity *big.Int LastLiquidityAddTimestamp uint32 InnerFeeGrowth0Token *big.Int InnerFeeGrowth1Token *big.Int Fees0 *big.Int Fees1 *big.Int }) if err != nil { return *outstruct, err } outstruct.Liquidity = *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) outstruct.LastLiquidityAddTimestamp = *abi.ConvertType(out[1], new(uint32)).(*uint32) outstruct.InnerFeeGrowth0Token = *abi.ConvertType(out[2], new(*big.Int)).(**big.Int) outstruct.InnerFeeGrowth1Token = *abi.ConvertType(out[3], new(*big.Int)).(**big.Int) outstruct.Fees0 = *abi.ConvertType(out[4], new(*big.Int)).(**big.Int) outstruct.Fees1 = *abi.ConvertType(out[5], new(*big.Int)).(**big.Int) return *outstruct, err } // Positions is a free data retrieval call binding the contract method 0x514ea4bf. // // Solidity: function positions(bytes32 ) view returns(uint128 liquidity, uint32 lastLiquidityAddTimestamp, uint256 innerFeeGrowth0Token, uint256 innerFeeGrowth1Token, uint128 fees0, uint128 fees1) func (_Pool *PoolSession) Positions(arg0 [32]byte) (struct { Liquidity *big.Int LastLiquidityAddTimestamp uint32 InnerFeeGrowth0Token *big.Int InnerFeeGrowth1Token *big.Int Fees0 *big.Int Fees1 *big.Int }, error) { return _Pool.Contract.Positions(&_Pool.CallOpts, arg0) } // Positions is a free data retrieval call binding the contract method 0x514ea4bf. // // Solidity: function positions(bytes32 ) view returns(uint128 liquidity, uint32 lastLiquidityAddTimestamp, uint256 innerFeeGrowth0Token, uint256 innerFeeGrowth1Token, uint128 fees0, uint128 fees1) func (_Pool *PoolCallerSession) Positions(arg0 [32]byte) (struct { Liquidity *big.Int LastLiquidityAddTimestamp uint32 InnerFeeGrowth0Token *big.Int InnerFeeGrowth1Token *big.Int Fees0 *big.Int Fees1 *big.Int }, error) { return _Pool.Contract.Positions(&_Pool.CallOpts, arg0) } // TickSpacing is a free data retrieval call binding the contract method 0xd0c93a7c. // // Solidity: function tickSpacing() view returns(int24) func (_Pool *PoolCaller) TickSpacing(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} err := _Pool.contract.Call(opts, &out, "tickSpacing") if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // TickSpacing is a free data retrieval call binding the contract method 0xd0c93a7c. // // Solidity: function tickSpacing() view returns(int24) func (_Pool *PoolSession) TickSpacing() (*big.Int, error) { return _Pool.Contract.TickSpacing(&_Pool.CallOpts) } // TickSpacing is a free data retrieval call binding the contract method 0xd0c93a7c. // // Solidity: function tickSpacing() view returns(int24) func (_Pool *PoolCallerSession) TickSpacing() (*big.Int, error) { return _Pool.Contract.TickSpacing(&_Pool.CallOpts) } // TickTable is a free data retrieval call binding the contract method 0xc677e3e0. // // Solidity: function tickTable(int16 ) view returns(uint256) func (_Pool *PoolCaller) TickTable(opts *bind.CallOpts, arg0 int16) (*big.Int, error) { var out []interface{} err := _Pool.contract.Call(opts, &out, "tickTable", arg0) if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // TickTable is a free data retrieval call binding the contract method 0xc677e3e0. // // Solidity: function tickTable(int16 ) view returns(uint256) func (_Pool *PoolSession) TickTable(arg0 int16) (*big.Int, error) { return _Pool.Contract.TickTable(&_Pool.CallOpts, arg0) } // TickTable is a free data retrieval call binding the contract method 0xc677e3e0. // // Solidity: function tickTable(int16 ) view returns(uint256) func (_Pool *PoolCallerSession) TickTable(arg0 int16) (*big.Int, error) { return _Pool.Contract.TickTable(&_Pool.CallOpts, arg0) } // Ticks is a free data retrieval call binding the contract method 0xf30dba93. // // Solidity: function ticks(int24 ) view returns(uint128 liquidityTotal, int128 liquidityDelta, uint256 outerFeeGrowth0Token, uint256 outerFeeGrowth1Token, int56 outerTickCumulative, uint160 outerSecondsPerLiquidity, uint32 outerSecondsSpent, bool initialized) func (_Pool *PoolCaller) Ticks(opts *bind.CallOpts, arg0 *big.Int) (struct { LiquidityTotal *big.Int LiquidityDelta *big.Int OuterFeeGrowth0Token *big.Int OuterFeeGrowth1Token *big.Int OuterTickCumulative *big.Int OuterSecondsPerLiquidity *big.Int OuterSecondsSpent uint32 Initialized bool }, error) { var out []interface{} err := _Pool.contract.Call(opts, &out, "ticks", arg0) outstruct := new(struct { LiquidityTotal *big.Int LiquidityDelta *big.Int OuterFeeGrowth0Token *big.Int OuterFeeGrowth1Token *big.Int OuterTickCumulative *big.Int OuterSecondsPerLiquidity *big.Int OuterSecondsSpent uint32 Initialized bool }) if err != nil { return *outstruct, err } outstruct.LiquidityTotal = *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) outstruct.LiquidityDelta = *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) outstruct.OuterFeeGrowth0Token = *abi.ConvertType(out[2], new(*big.Int)).(**big.Int) outstruct.OuterFeeGrowth1Token = *abi.ConvertType(out[3], new(*big.Int)).(**big.Int) outstruct.OuterTickCumulative = *abi.ConvertType(out[4], new(*big.Int)).(**big.Int) outstruct.OuterSecondsPerLiquidity = *abi.ConvertType(out[5], new(*big.Int)).(**big.Int) outstruct.OuterSecondsSpent = *abi.ConvertType(out[6], new(uint32)).(*uint32) outstruct.Initialized = *abi.ConvertType(out[7], new(bool)).(*bool) return *outstruct, err } // Ticks is a free data retrieval call binding the contract method 0xf30dba93. // // Solidity: function ticks(int24 ) view returns(uint128 liquidityTotal, int128 liquidityDelta, uint256 outerFeeGrowth0Token, uint256 outerFeeGrowth1Token, int56 outerTickCumulative, uint160 outerSecondsPerLiquidity, uint32 outerSecondsSpent, bool initialized) func (_Pool *PoolSession) Ticks(arg0 *big.Int) (struct { LiquidityTotal *big.Int LiquidityDelta *big.Int OuterFeeGrowth0Token *big.Int OuterFeeGrowth1Token *big.Int OuterTickCumulative *big.Int OuterSecondsPerLiquidity *big.Int OuterSecondsSpent uint32 Initialized bool }, error) { return _Pool.Contract.Ticks(&_Pool.CallOpts, arg0) } // Ticks is a free data retrieval call binding the contract method 0xf30dba93. // // Solidity: function ticks(int24 ) view returns(uint128 liquidityTotal, int128 liquidityDelta, uint256 outerFeeGrowth0Token, uint256 outerFeeGrowth1Token, int56 outerTickCumulative, uint160 outerSecondsPerLiquidity, uint32 outerSecondsSpent, bool initialized) func (_Pool *PoolCallerSession) Ticks(arg0 *big.Int) (struct { LiquidityTotal *big.Int LiquidityDelta *big.Int OuterFeeGrowth0Token *big.Int OuterFeeGrowth1Token *big.Int OuterTickCumulative *big.Int OuterSecondsPerLiquidity *big.Int OuterSecondsSpent uint32 Initialized bool }, error) { return _Pool.Contract.Ticks(&_Pool.CallOpts, arg0) } // Timepoints is a free data retrieval call binding the contract method 0x74eceae6. // // Solidity: function timepoints(uint256 index) view returns(bool initialized, uint32 blockTimestamp, int56 tickCumulative, uint160 secondsPerLiquidityCumulative, uint88 volatilityCumulative, int24 averageTick, uint144 volumePerLiquidityCumulative) func (_Pool *PoolCaller) Timepoints(opts *bind.CallOpts, index *big.Int) (struct { Initialized bool BlockTimestamp uint32 TickCumulative *big.Int SecondsPerLiquidityCumulative *big.Int VolatilityCumulative *big.Int AverageTick *big.Int VolumePerLiquidityCumulative *big.Int }, error) { var out []interface{} err := _Pool.contract.Call(opts, &out, "timepoints", index) outstruct := new(struct { Initialized bool BlockTimestamp uint32 TickCumulative *big.Int SecondsPerLiquidityCumulative *big.Int VolatilityCumulative *big.Int AverageTick *big.Int VolumePerLiquidityCumulative *big.Int }) if err != nil { return *outstruct, err } outstruct.Initialized = *abi.ConvertType(out[0], new(bool)).(*bool) outstruct.BlockTimestamp = *abi.ConvertType(out[1], new(uint32)).(*uint32) outstruct.TickCumulative = *abi.ConvertType(out[2], new(*big.Int)).(**big.Int) outstruct.SecondsPerLiquidityCumulative = *abi.ConvertType(out[3], new(*big.Int)).(**big.Int) outstruct.VolatilityCumulative = *abi.ConvertType(out[4], new(*big.Int)).(**big.Int) outstruct.AverageTick = *abi.ConvertType(out[5], new(*big.Int)).(**big.Int) outstruct.VolumePerLiquidityCumulative = *abi.ConvertType(out[6], new(*big.Int)).(**big.Int) return *outstruct, err } // Timepoints is a free data retrieval call binding the contract method 0x74eceae6. // // Solidity: function timepoints(uint256 index) view returns(bool initialized, uint32 blockTimestamp, int56 tickCumulative, uint160 secondsPerLiquidityCumulative, uint88 volatilityCumulative, int24 averageTick, uint144 volumePerLiquidityCumulative) func (_Pool *PoolSession) Timepoints(index *big.Int) (struct { Initialized bool BlockTimestamp uint32 TickCumulative *big.Int SecondsPerLiquidityCumulative *big.Int VolatilityCumulative *big.Int AverageTick *big.Int VolumePerLiquidityCumulative *big.Int }, error) { return _Pool.Contract.Timepoints(&_Pool.CallOpts, index) } // Timepoints is a free data retrieval call binding the contract method 0x74eceae6. // // Solidity: function timepoints(uint256 index) view returns(bool initialized, uint32 blockTimestamp, int56 tickCumulative, uint160 secondsPerLiquidityCumulative, uint88 volatilityCumulative, int24 averageTick, uint144 volumePerLiquidityCumulative) func (_Pool *PoolCallerSession) Timepoints(index *big.Int) (struct { Initialized bool BlockTimestamp uint32 TickCumulative *big.Int SecondsPerLiquidityCumulative *big.Int VolatilityCumulative *big.Int AverageTick *big.Int VolumePerLiquidityCumulative *big.Int }, error) { return _Pool.Contract.Timepoints(&_Pool.CallOpts, index) } // Token0 is a free data retrieval call binding the contract method 0x0dfe1681. // // Solidity: function token0() view returns(address) func (_Pool *PoolCaller) Token0(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _Pool.contract.Call(opts, &out, "token0") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // Token0 is a free data retrieval call binding the contract method 0x0dfe1681. // // Solidity: function token0() view returns(address) func (_Pool *PoolSession) Token0() (common.Address, error) { return _Pool.Contract.Token0(&_Pool.CallOpts) } // Token0 is a free data retrieval call binding the contract method 0x0dfe1681. // // Solidity: function token0() view returns(address) func (_Pool *PoolCallerSession) Token0() (common.Address, error) { return _Pool.Contract.Token0(&_Pool.CallOpts) } // Token1 is a free data retrieval call binding the contract method 0xd21220a7. // // Solidity: function token1() view returns(address) func (_Pool *PoolCaller) Token1(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _Pool.contract.Call(opts, &out, "token1") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // Token1 is a free data retrieval call binding the contract method 0xd21220a7. // // Solidity: function token1() view returns(address) func (_Pool *PoolSession) Token1() (common.Address, error) { return _Pool.Contract.Token1(&_Pool.CallOpts) } // Token1 is a free data retrieval call binding the contract method 0xd21220a7. // // Solidity: function token1() view returns(address) func (_Pool *PoolCallerSession) Token1() (common.Address, error) { return _Pool.Contract.Token1(&_Pool.CallOpts) } // TotalFeeGrowth0Token is a free data retrieval call binding the contract method 0x6378ae44. // // Solidity: function totalFeeGrowth0Token() view returns(uint256) func (_Pool *PoolCaller) TotalFeeGrowth0Token(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} err := _Pool.contract.Call(opts, &out, "totalFeeGrowth0Token") if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // TotalFeeGrowth0Token is a free data retrieval call binding the contract method 0x6378ae44. // // Solidity: function totalFeeGrowth0Token() view returns(uint256) func (_Pool *PoolSession) TotalFeeGrowth0Token() (*big.Int, error) { return _Pool.Contract.TotalFeeGrowth0Token(&_Pool.CallOpts) } // TotalFeeGrowth0Token is a free data retrieval call binding the contract method 0x6378ae44. // // Solidity: function totalFeeGrowth0Token() view returns(uint256) func (_Pool *PoolCallerSession) TotalFeeGrowth0Token() (*big.Int, error) { return _Pool.Contract.TotalFeeGrowth0Token(&_Pool.CallOpts) } // TotalFeeGrowth1Token is a free data retrieval call binding the contract method 0xecdecf42. // // Solidity: function totalFeeGrowth1Token() view returns(uint256) func (_Pool *PoolCaller) TotalFeeGrowth1Token(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} err := _Pool.contract.Call(opts, &out, "totalFeeGrowth1Token") if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // TotalFeeGrowth1Token is a free data retrieval call binding the contract method 0xecdecf42. // // Solidity: function totalFeeGrowth1Token() view returns(uint256) func (_Pool *PoolSession) TotalFeeGrowth1Token() (*big.Int, error) { return _Pool.Contract.TotalFeeGrowth1Token(&_Pool.CallOpts) } // TotalFeeGrowth1Token is a free data retrieval call binding the contract method 0xecdecf42. // // Solidity: function totalFeeGrowth1Token() view returns(uint256) func (_Pool *PoolCallerSession) TotalFeeGrowth1Token() (*big.Int, error) { return _Pool.Contract.TotalFeeGrowth1Token(&_Pool.CallOpts) } // Burn is a paid mutator transaction binding the contract method 0xa34123a7. // // Solidity: function burn(int24 bottomTick, int24 topTick, uint128 amount) returns(uint256 amount0, uint256 amount1) func (_Pool *PoolTransactor) Burn(opts *bind.TransactOpts, bottomTick *big.Int, topTick *big.Int, amount *big.Int) (*types.Transaction, error) { return _Pool.contract.Transact(opts, "burn", bottomTick, topTick, amount) } // Burn is a paid mutator transaction binding the contract method 0xa34123a7. // // Solidity: function burn(int24 bottomTick, int24 topTick, uint128 amount) returns(uint256 amount0, uint256 amount1) func (_Pool *PoolSession) Burn(bottomTick *big.Int, topTick *big.Int, amount *big.Int) (*types.Transaction, error) { return _Pool.Contract.Burn(&_Pool.TransactOpts, bottomTick, topTick, amount) } // Burn is a paid mutator transaction binding the contract method 0xa34123a7. // // Solidity: function burn(int24 bottomTick, int24 topTick, uint128 amount) returns(uint256 amount0, uint256 amount1) func (_Pool *PoolTransactorSession) Burn(bottomTick *big.Int, topTick *big.Int, amount *big.Int) (*types.Transaction, error) { return _Pool.Contract.Burn(&_Pool.TransactOpts, bottomTick, topTick, amount) } // Collect is a paid mutator transaction binding the contract method 0x4f1eb3d8. // // Solidity: function collect(address recipient, int24 bottomTick, int24 topTick, uint128 amount0Requested, uint128 amount1Requested) returns(uint128 amount0, uint128 amount1) func (_Pool *PoolTransactor) Collect(opts *bind.TransactOpts, recipient common.Address, bottomTick *big.Int, topTick *big.Int, amount0Requested *big.Int, amount1Requested *big.Int) (*types.Transaction, error) { return _Pool.contract.Transact(opts, "collect", recipient, bottomTick, topTick, amount0Requested, amount1Requested) } // Collect is a paid mutator transaction binding the contract method 0x4f1eb3d8. // // Solidity: function collect(address recipient, int24 bottomTick, int24 topTick, uint128 amount0Requested, uint128 amount1Requested) returns(uint128 amount0, uint128 amount1) func (_Pool *PoolSession) Collect(recipient common.Address, bottomTick *big.Int, topTick *big.Int, amount0Requested *big.Int, amount1Requested *big.Int) (*types.Transaction, error) { return _Pool.Contract.Collect(&_Pool.TransactOpts, recipient, bottomTick, topTick, amount0Requested, amount1Requested) } // Collect is a paid mutator transaction binding the contract method 0x4f1eb3d8. // // Solidity: function collect(address recipient, int24 bottomTick, int24 topTick, uint128 amount0Requested, uint128 amount1Requested) returns(uint128 amount0, uint128 amount1) func (_Pool *PoolTransactorSession) Collect(recipient common.Address, bottomTick *big.Int, topTick *big.Int, amount0Requested *big.Int, amount1Requested *big.Int) (*types.Transaction, error) { return _Pool.Contract.Collect(&_Pool.TransactOpts, recipient, bottomTick, topTick, amount0Requested, amount1Requested) } // Flash is a paid mutator transaction binding the contract method 0x490e6cbc. // // Solidity: function flash(address recipient, uint256 amount0, uint256 amount1, bytes data) returns() func (_Pool *PoolTransactor) Flash(opts *bind.TransactOpts, recipient common.Address, amount0 *big.Int, amount1 *big.Int, data []byte) (*types.Transaction, error) { return _Pool.contract.Transact(opts, "flash", recipient, amount0, amount1, data) } // Flash is a paid mutator transaction binding the contract method 0x490e6cbc. // // Solidity: function flash(address recipient, uint256 amount0, uint256 amount1, bytes data) returns() func (_Pool *PoolSession) Flash(recipient common.Address, amount0 *big.Int, amount1 *big.Int, data []byte) (*types.Transaction, error) { return _Pool.Contract.Flash(&_Pool.TransactOpts, recipient, amount0, amount1, data) } // Flash is a paid mutator transaction binding the contract method 0x490e6cbc. // // Solidity: function flash(address recipient, uint256 amount0, uint256 amount1, bytes data) returns() func (_Pool *PoolTransactorSession) Flash(recipient common.Address, amount0 *big.Int, amount1 *big.Int, data []byte) (*types.Transaction, error) { return _Pool.Contract.Flash(&_Pool.TransactOpts, recipient, amount0, amount1, data) } // Initialize is a paid mutator transaction binding the contract method 0xf637731d. // // Solidity: function initialize(uint160 initialPrice) returns() func (_Pool *PoolTransactor) Initialize(opts *bind.TransactOpts, initialPrice *big.Int) (*types.Transaction, error) { return _Pool.contract.Transact(opts, "initialize", initialPrice) } // Initialize is a paid mutator transaction binding the contract method 0xf637731d. // // Solidity: function initialize(uint160 initialPrice) returns() func (_Pool *PoolSession) Initialize(initialPrice *big.Int) (*types.Transaction, error) { return _Pool.Contract.Initialize(&_Pool.TransactOpts, initialPrice) } // Initialize is a paid mutator transaction binding the contract method 0xf637731d. // // Solidity: function initialize(uint160 initialPrice) returns() func (_Pool *PoolTransactorSession) Initialize(initialPrice *big.Int) (*types.Transaction, error) { return _Pool.Contract.Initialize(&_Pool.TransactOpts, initialPrice) } // Mint is a paid mutator transaction binding the contract method 0xaafe29c0. // // Solidity: function mint(address sender, address recipient, int24 bottomTick, int24 topTick, uint128 liquidityDesired, bytes data) returns(uint256 amount0, uint256 amount1, uint128 liquidityActual) func (_Pool *PoolTransactor) Mint(opts *bind.TransactOpts, sender common.Address, recipient common.Address, bottomTick *big.Int, topTick *big.Int, liquidityDesired *big.Int, data []byte) (*types.Transaction, error) { return _Pool.contract.Transact(opts, "mint", sender, recipient, bottomTick, topTick, liquidityDesired, data) } // Mint is a paid mutator transaction binding the contract method 0xaafe29c0. // // Solidity: function mint(address sender, address recipient, int24 bottomTick, int24 topTick, uint128 liquidityDesired, bytes data) returns(uint256 amount0, uint256 amount1, uint128 liquidityActual) func (_Pool *PoolSession) Mint(sender common.Address, recipient common.Address, bottomTick *big.Int, topTick *big.Int, liquidityDesired *big.Int, data []byte) (*types.Transaction, error) { return _Pool.Contract.Mint(&_Pool.TransactOpts, sender, recipient, bottomTick, topTick, liquidityDesired, data) } // Mint is a paid mutator transaction binding the contract method 0xaafe29c0. // // Solidity: function mint(address sender, address recipient, int24 bottomTick, int24 topTick, uint128 liquidityDesired, bytes data) returns(uint256 amount0, uint256 amount1, uint128 liquidityActual) func (_Pool *PoolTransactorSession) Mint(sender common.Address, recipient common.Address, bottomTick *big.Int, topTick *big.Int, liquidityDesired *big.Int, data []byte) (*types.Transaction, error) { return _Pool.Contract.Mint(&_Pool.TransactOpts, sender, recipient, bottomTick, topTick, liquidityDesired, data) } // SetCommunityFee is a paid mutator transaction binding the contract method 0x7c0112b7. // // Solidity: function setCommunityFee(uint8 communityFee0, uint8 communityFee1) returns() func (_Pool *PoolTransactor) SetCommunityFee(opts *bind.TransactOpts, communityFee0 uint8, communityFee1 uint8) (*types.Transaction, error) { return _Pool.contract.Transact(opts, "setCommunityFee", communityFee0, communityFee1) } // SetCommunityFee is a paid mutator transaction binding the contract method 0x7c0112b7. // // Solidity: function setCommunityFee(uint8 communityFee0, uint8 communityFee1) returns() func (_Pool *PoolSession) SetCommunityFee(communityFee0 uint8, communityFee1 uint8) (*types.Transaction, error) { return _Pool.Contract.SetCommunityFee(&_Pool.TransactOpts, communityFee0, communityFee1) } // SetCommunityFee is a paid mutator transaction binding the contract method 0x7c0112b7. // // Solidity: function setCommunityFee(uint8 communityFee0, uint8 communityFee1) returns() func (_Pool *PoolTransactorSession) SetCommunityFee(communityFee0 uint8, communityFee1 uint8) (*types.Transaction, error) { return _Pool.Contract.SetCommunityFee(&_Pool.TransactOpts, communityFee0, communityFee1) } // SetIncentive is a paid mutator transaction binding the contract method 0x7c1fe0c8. // // Solidity: function setIncentive(address virtualPoolAddress) returns() func (_Pool *PoolTransactor) SetIncentive(opts *bind.TransactOpts, virtualPoolAddress common.Address) (*types.Transaction, error) { return _Pool.contract.Transact(opts, "setIncentive", virtualPoolAddress) } // SetIncentive is a paid mutator transaction binding the contract method 0x7c1fe0c8. // // Solidity: function setIncentive(address virtualPoolAddress) returns() func (_Pool *PoolSession) SetIncentive(virtualPoolAddress common.Address) (*types.Transaction, error) { return _Pool.Contract.SetIncentive(&_Pool.TransactOpts, virtualPoolAddress) } // SetIncentive is a paid mutator transaction binding the contract method 0x7c1fe0c8. // // Solidity: function setIncentive(address virtualPoolAddress) returns() func (_Pool *PoolTransactorSession) SetIncentive(virtualPoolAddress common.Address) (*types.Transaction, error) { return _Pool.Contract.SetIncentive(&_Pool.TransactOpts, virtualPoolAddress) } // SetLiquidityCooldown is a paid mutator transaction binding the contract method 0x289fe9b0. // // Solidity: function setLiquidityCooldown(uint32 newLiquidityCooldown) returns() func (_Pool *PoolTransactor) SetLiquidityCooldown(opts *bind.TransactOpts, newLiquidityCooldown uint32) (*types.Transaction, error) { return _Pool.contract.Transact(opts, "setLiquidityCooldown", newLiquidityCooldown) } // SetLiquidityCooldown is a paid mutator transaction binding the contract method 0x289fe9b0. // // Solidity: function setLiquidityCooldown(uint32 newLiquidityCooldown) returns() func (_Pool *PoolSession) SetLiquidityCooldown(newLiquidityCooldown uint32) (*types.Transaction, error) { return _Pool.Contract.SetLiquidityCooldown(&_Pool.TransactOpts, newLiquidityCooldown) } // SetLiquidityCooldown is a paid mutator transaction binding the contract method 0x289fe9b0. // // Solidity: function setLiquidityCooldown(uint32 newLiquidityCooldown) returns() func (_Pool *PoolTransactorSession) SetLiquidityCooldown(newLiquidityCooldown uint32) (*types.Transaction, error) { return _Pool.Contract.SetLiquidityCooldown(&_Pool.TransactOpts, newLiquidityCooldown) } // SetTickSpacing is a paid mutator transaction binding the contract method 0xf085a610. // // Solidity: function setTickSpacing(int24 newTickSpacing) returns() func (_Pool *PoolTransactor) SetTickSpacing(opts *bind.TransactOpts, newTickSpacing *big.Int) (*types.Transaction, error) { return _Pool.contract.Transact(opts, "setTickSpacing", newTickSpacing) } // SetTickSpacing is a paid mutator transaction binding the contract method 0xf085a610. // // Solidity: function setTickSpacing(int24 newTickSpacing) returns() func (_Pool *PoolSession) SetTickSpacing(newTickSpacing *big.Int) (*types.Transaction, error) { return _Pool.Contract.SetTickSpacing(&_Pool.TransactOpts, newTickSpacing) } // SetTickSpacing is a paid mutator transaction binding the contract method 0xf085a610. // // Solidity: function setTickSpacing(int24 newTickSpacing) returns() func (_Pool *PoolTransactorSession) SetTickSpacing(newTickSpacing *big.Int) (*types.Transaction, error) { return _Pool.Contract.SetTickSpacing(&_Pool.TransactOpts, newTickSpacing) } // Swap is a paid mutator transaction binding the contract method 0x128acb08. // // Solidity: function swap(address recipient, bool zeroToOne, int256 amountRequired, uint160 limitSqrtPrice, bytes data) returns(int256 amount0, int256 amount1) func (_Pool *PoolTransactor) Swap(opts *bind.TransactOpts, recipient common.Address, zeroToOne bool, amountRequired *big.Int, limitSqrtPrice *big.Int, data []byte) (*types.Transaction, error) { return _Pool.contract.Transact(opts, "swap", recipient, zeroToOne, amountRequired, limitSqrtPrice, data) } // Swap is a paid mutator transaction binding the contract method 0x128acb08. // // Solidity: function swap(address recipient, bool zeroToOne, int256 amountRequired, uint160 limitSqrtPrice, bytes data) returns(int256 amount0, int256 amount1) func (_Pool *PoolSession) Swap(recipient common.Address, zeroToOne bool, amountRequired *big.Int, limitSqrtPrice *big.Int, data []byte) (*types.Transaction, error) { return _Pool.Contract.Swap(&_Pool.TransactOpts, recipient, zeroToOne, amountRequired, limitSqrtPrice, data) } // Swap is a paid mutator transaction binding the contract method 0x128acb08. // // Solidity: function swap(address recipient, bool zeroToOne, int256 amountRequired, uint160 limitSqrtPrice, bytes data) returns(int256 amount0, int256 amount1) func (_Pool *PoolTransactorSession) Swap(recipient common.Address, zeroToOne bool, amountRequired *big.Int, limitSqrtPrice *big.Int, data []byte) (*types.Transaction, error) { return _Pool.Contract.Swap(&_Pool.TransactOpts, recipient, zeroToOne, amountRequired, limitSqrtPrice, data) } // SwapSupportingFeeOnInputTokens is a paid mutator transaction binding the contract method 0x71334694. // // Solidity: function swapSupportingFeeOnInputTokens(address sender, address recipient, bool zeroToOne, int256 amountRequired, uint160 limitSqrtPrice, bytes data) returns(int256 amount0, int256 amount1) func (_Pool *PoolTransactor) SwapSupportingFeeOnInputTokens(opts *bind.TransactOpts, sender common.Address, recipient common.Address, zeroToOne bool, amountRequired *big.Int, limitSqrtPrice *big.Int, data []byte) (*types.Transaction, error) { return _Pool.contract.Transact(opts, "swapSupportingFeeOnInputTokens", sender, recipient, zeroToOne, amountRequired, limitSqrtPrice, data) } // SwapSupportingFeeOnInputTokens is a paid mutator transaction binding the contract method 0x71334694. // // Solidity: function swapSupportingFeeOnInputTokens(address sender, address recipient, bool zeroToOne, int256 amountRequired, uint160 limitSqrtPrice, bytes data) returns(int256 amount0, int256 amount1) func (_Pool *PoolSession) SwapSupportingFeeOnInputTokens(sender common.Address, recipient common.Address, zeroToOne bool, amountRequired *big.Int, limitSqrtPrice *big.Int, data []byte) (*types.Transaction, error) { return _Pool.Contract.SwapSupportingFeeOnInputTokens(&_Pool.TransactOpts, sender, recipient, zeroToOne, amountRequired, limitSqrtPrice, data) } // SwapSupportingFeeOnInputTokens is a paid mutator transaction binding the contract method 0x71334694. // // Solidity: function swapSupportingFeeOnInputTokens(address sender, address recipient, bool zeroToOne, int256 amountRequired, uint160 limitSqrtPrice, bytes data) returns(int256 amount0, int256 amount1) func (_Pool *PoolTransactorSession) SwapSupportingFeeOnInputTokens(sender common.Address, recipient common.Address, zeroToOne bool, amountRequired *big.Int, limitSqrtPrice *big.Int, data []byte) (*types.Transaction, error) { return _Pool.Contract.SwapSupportingFeeOnInputTokens(&_Pool.TransactOpts, sender, recipient, zeroToOne, amountRequired, limitSqrtPrice, data) } // PoolBurnIterator is returned from FilterBurn and is used to iterate over the raw logs and unpacked data for Burn events raised by the Pool contract. type PoolBurnIterator struct { Event *PoolBurn // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *PoolBurnIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(PoolBurn) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(PoolBurn) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *PoolBurnIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *PoolBurnIterator) Close() error { it.sub.Unsubscribe() return nil } // PoolBurn represents a Burn event raised by the Pool contract. type PoolBurn struct { Owner common.Address BottomTick *big.Int TopTick *big.Int LiquidityAmount *big.Int Amount0 *big.Int Amount1 *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterBurn is a free log retrieval operation binding the contract event 0x0c396cd989a39f4459b5fa1aed6a9a8dcdbc45908acfd67e028cd568da98982c. // // Solidity: event Burn(address indexed owner, int24 indexed bottomTick, int24 indexed topTick, uint128 liquidityAmount, uint256 amount0, uint256 amount1) func (_Pool *PoolFilterer) FilterBurn(opts *bind.FilterOpts, owner []common.Address, bottomTick []*big.Int, topTick []*big.Int) (*PoolBurnIterator, error) { var ownerRule []interface{} for _, ownerItem := range owner { ownerRule = append(ownerRule, ownerItem) } var bottomTickRule []interface{} for _, bottomTickItem := range bottomTick { bottomTickRule = append(bottomTickRule, bottomTickItem) } var topTickRule []interface{} for _, topTickItem := range topTick { topTickRule = append(topTickRule, topTickItem) } logs, sub, err := _Pool.contract.FilterLogs(opts, "Burn", ownerRule, bottomTickRule, topTickRule) if err != nil { return nil, err } return &PoolBurnIterator{contract: _Pool.contract, event: "Burn", logs: logs, sub: sub}, nil } // WatchBurn is a free log subscription operation binding the contract event 0x0c396cd989a39f4459b5fa1aed6a9a8dcdbc45908acfd67e028cd568da98982c. // // Solidity: event Burn(address indexed owner, int24 indexed bottomTick, int24 indexed topTick, uint128 liquidityAmount, uint256 amount0, uint256 amount1) func (_Pool *PoolFilterer) WatchBurn(opts *bind.WatchOpts, sink chan<- *PoolBurn, owner []common.Address, bottomTick []*big.Int, topTick []*big.Int) (event.Subscription, error) { var ownerRule []interface{} for _, ownerItem := range owner { ownerRule = append(ownerRule, ownerItem) } var bottomTickRule []interface{} for _, bottomTickItem := range bottomTick { bottomTickRule = append(bottomTickRule, bottomTickItem) } var topTickRule []interface{} for _, topTickItem := range topTick { topTickRule = append(topTickRule, topTickItem) } logs, sub, err := _Pool.contract.WatchLogs(opts, "Burn", ownerRule, bottomTickRule, topTickRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(PoolBurn) if err := _Pool.contract.UnpackLog(event, "Burn", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseBurn is a log parse operation binding the contract event 0x0c396cd989a39f4459b5fa1aed6a9a8dcdbc45908acfd67e028cd568da98982c. // // Solidity: event Burn(address indexed owner, int24 indexed bottomTick, int24 indexed topTick, uint128 liquidityAmount, uint256 amount0, uint256 amount1) func (_Pool *PoolFilterer) ParseBurn(log types.Log) (*PoolBurn, error) { event := new(PoolBurn) if err := _Pool.contract.UnpackLog(event, "Burn", log); err != nil { return nil, err } event.Raw = log return event, nil } // PoolCollectIterator is returned from FilterCollect and is used to iterate over the raw logs and unpacked data for Collect events raised by the Pool contract. type PoolCollectIterator struct { Event *PoolCollect // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *PoolCollectIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(PoolCollect) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(PoolCollect) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *PoolCollectIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *PoolCollectIterator) Close() error { it.sub.Unsubscribe() return nil } // PoolCollect represents a Collect event raised by the Pool contract. type PoolCollect struct { Owner common.Address Recipient common.Address BottomTick *big.Int TopTick *big.Int Amount0 *big.Int Amount1 *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterCollect is a free log retrieval operation binding the contract event 0x70935338e69775456a85ddef226c395fb668b63fa0115f5f20610b388e6ca9c0. // // Solidity: event Collect(address indexed owner, address recipient, int24 indexed bottomTick, int24 indexed topTick, uint128 amount0, uint128 amount1) func (_Pool *PoolFilterer) FilterCollect(opts *bind.FilterOpts, owner []common.Address, bottomTick []*big.Int, topTick []*big.Int) (*PoolCollectIterator, error) { var ownerRule []interface{} for _, ownerItem := range owner { ownerRule = append(ownerRule, ownerItem) } var bottomTickRule []interface{} for _, bottomTickItem := range bottomTick { bottomTickRule = append(bottomTickRule, bottomTickItem) } var topTickRule []interface{} for _, topTickItem := range topTick { topTickRule = append(topTickRule, topTickItem) } logs, sub, err := _Pool.contract.FilterLogs(opts, "Collect", ownerRule, bottomTickRule, topTickRule) if err != nil { return nil, err } return &PoolCollectIterator{contract: _Pool.contract, event: "Collect", logs: logs, sub: sub}, nil } // WatchCollect is a free log subscription operation binding the contract event 0x70935338e69775456a85ddef226c395fb668b63fa0115f5f20610b388e6ca9c0. // // Solidity: event Collect(address indexed owner, address recipient, int24 indexed bottomTick, int24 indexed topTick, uint128 amount0, uint128 amount1) func (_Pool *PoolFilterer) WatchCollect(opts *bind.WatchOpts, sink chan<- *PoolCollect, owner []common.Address, bottomTick []*big.Int, topTick []*big.Int) (event.Subscription, error) { var ownerRule []interface{} for _, ownerItem := range owner { ownerRule = append(ownerRule, ownerItem) } var bottomTickRule []interface{} for _, bottomTickItem := range bottomTick { bottomTickRule = append(bottomTickRule, bottomTickItem) } var topTickRule []interface{} for _, topTickItem := range topTick { topTickRule = append(topTickRule, topTickItem) } logs, sub, err := _Pool.contract.WatchLogs(opts, "Collect", ownerRule, bottomTickRule, topTickRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(PoolCollect) if err := _Pool.contract.UnpackLog(event, "Collect", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseCollect is a log parse operation binding the contract event 0x70935338e69775456a85ddef226c395fb668b63fa0115f5f20610b388e6ca9c0. // // Solidity: event Collect(address indexed owner, address recipient, int24 indexed bottomTick, int24 indexed topTick, uint128 amount0, uint128 amount1) func (_Pool *PoolFilterer) ParseCollect(log types.Log) (*PoolCollect, error) { event := new(PoolCollect) if err := _Pool.contract.UnpackLog(event, "Collect", log); err != nil { return nil, err } event.Raw = log return event, nil } // PoolCommunityFeeIterator is returned from FilterCommunityFee and is used to iterate over the raw logs and unpacked data for CommunityFee events raised by the Pool contract. type PoolCommunityFeeIterator struct { Event *PoolCommunityFee // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *PoolCommunityFeeIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(PoolCommunityFee) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(PoolCommunityFee) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *PoolCommunityFeeIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *PoolCommunityFeeIterator) Close() error { it.sub.Unsubscribe() return nil } // PoolCommunityFee represents a CommunityFee event raised by the Pool contract. type PoolCommunityFee struct { CommunityFee0New uint8 CommunityFee1New uint8 Raw types.Log // Blockchain specific contextual infos } // FilterCommunityFee is a free log retrieval operation binding the contract event 0x9e22b964b08e25c3aaa72102bb0071c089258fb82d51271a8ddf5c24921356ee. // // Solidity: event CommunityFee(uint8 communityFee0New, uint8 communityFee1New) func (_Pool *PoolFilterer) FilterCommunityFee(opts *bind.FilterOpts) (*PoolCommunityFeeIterator, error) { logs, sub, err := _Pool.contract.FilterLogs(opts, "CommunityFee") if err != nil { return nil, err } return &PoolCommunityFeeIterator{contract: _Pool.contract, event: "CommunityFee", logs: logs, sub: sub}, nil } // WatchCommunityFee is a free log subscription operation binding the contract event 0x9e22b964b08e25c3aaa72102bb0071c089258fb82d51271a8ddf5c24921356ee. // // Solidity: event CommunityFee(uint8 communityFee0New, uint8 communityFee1New) func (_Pool *PoolFilterer) WatchCommunityFee(opts *bind.WatchOpts, sink chan<- *PoolCommunityFee) (event.Subscription, error) { logs, sub, err := _Pool.contract.WatchLogs(opts, "CommunityFee") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(PoolCommunityFee) if err := _Pool.contract.UnpackLog(event, "CommunityFee", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseCommunityFee is a log parse operation binding the contract event 0x9e22b964b08e25c3aaa72102bb0071c089258fb82d51271a8ddf5c24921356ee. // // Solidity: event CommunityFee(uint8 communityFee0New, uint8 communityFee1New) func (_Pool *PoolFilterer) ParseCommunityFee(log types.Log) (*PoolCommunityFee, error) { event := new(PoolCommunityFee) if err := _Pool.contract.UnpackLog(event, "CommunityFee", log); err != nil { return nil, err } event.Raw = log return event, nil } // PoolFeeIterator is returned from FilterFee and is used to iterate over the raw logs and unpacked data for Fee events raised by the Pool contract. type PoolFeeIterator struct { Event *PoolFee // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *PoolFeeIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(PoolFee) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(PoolFee) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *PoolFeeIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *PoolFeeIterator) Close() error { it.sub.Unsubscribe() return nil } // PoolFee represents a Fee event raised by the Pool contract. type PoolFee struct { FeeZto uint16 FeeOtz uint16 Raw types.Log // Blockchain specific contextual infos } // FilterFee is a free log retrieval operation binding the contract event 0x8a89de70856bccec096661388f305b9a75f5f65cb0d8a0e1e803c39dabedb57f. // // Solidity: event Fee(uint16 feeZto, uint16 feeOtz) func (_Pool *PoolFilterer) FilterFee(opts *bind.FilterOpts) (*PoolFeeIterator, error) { logs, sub, err := _Pool.contract.FilterLogs(opts, "Fee") if err != nil { return nil, err } return &PoolFeeIterator{contract: _Pool.contract, event: "Fee", logs: logs, sub: sub}, nil } // WatchFee is a free log subscription operation binding the contract event 0x8a89de70856bccec096661388f305b9a75f5f65cb0d8a0e1e803c39dabedb57f. // // Solidity: event Fee(uint16 feeZto, uint16 feeOtz) func (_Pool *PoolFilterer) WatchFee(opts *bind.WatchOpts, sink chan<- *PoolFee) (event.Subscription, error) { logs, sub, err := _Pool.contract.WatchLogs(opts, "Fee") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(PoolFee) if err := _Pool.contract.UnpackLog(event, "Fee", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseFee is a log parse operation binding the contract event 0x8a89de70856bccec096661388f305b9a75f5f65cb0d8a0e1e803c39dabedb57f. // // Solidity: event Fee(uint16 feeZto, uint16 feeOtz) func (_Pool *PoolFilterer) ParseFee(log types.Log) (*PoolFee, error) { event := new(PoolFee) if err := _Pool.contract.UnpackLog(event, "Fee", log); err != nil { return nil, err } event.Raw = log return event, nil } // PoolFlashIterator is returned from FilterFlash and is used to iterate over the raw logs and unpacked data for Flash events raised by the Pool contract. type PoolFlashIterator struct { Event *PoolFlash // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *PoolFlashIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(PoolFlash) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(PoolFlash) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *PoolFlashIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *PoolFlashIterator) Close() error { it.sub.Unsubscribe() return nil } // PoolFlash represents a Flash event raised by the Pool contract. type PoolFlash struct { Sender common.Address Recipient common.Address Amount0 *big.Int Amount1 *big.Int Paid0 *big.Int Paid1 *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterFlash is a free log retrieval operation binding the contract event 0xbdbdb71d7860376ba52b25a5028beea23581364a40522f6bcfb86bb1f2dca633. // // Solidity: event Flash(address indexed sender, address indexed recipient, uint256 amount0, uint256 amount1, uint256 paid0, uint256 paid1) func (_Pool *PoolFilterer) FilterFlash(opts *bind.FilterOpts, sender []common.Address, recipient []common.Address) (*PoolFlashIterator, error) { var senderRule []interface{} for _, senderItem := range sender { senderRule = append(senderRule, senderItem) } var recipientRule []interface{} for _, recipientItem := range recipient { recipientRule = append(recipientRule, recipientItem) } logs, sub, err := _Pool.contract.FilterLogs(opts, "Flash", senderRule, recipientRule) if err != nil { return nil, err } return &PoolFlashIterator{contract: _Pool.contract, event: "Flash", logs: logs, sub: sub}, nil } // WatchFlash is a free log subscription operation binding the contract event 0xbdbdb71d7860376ba52b25a5028beea23581364a40522f6bcfb86bb1f2dca633. // // Solidity: event Flash(address indexed sender, address indexed recipient, uint256 amount0, uint256 amount1, uint256 paid0, uint256 paid1) func (_Pool *PoolFilterer) WatchFlash(opts *bind.WatchOpts, sink chan<- *PoolFlash, sender []common.Address, recipient []common.Address) (event.Subscription, error) { var senderRule []interface{} for _, senderItem := range sender { senderRule = append(senderRule, senderItem) } var recipientRule []interface{} for _, recipientItem := range recipient { recipientRule = append(recipientRule, recipientItem) } logs, sub, err := _Pool.contract.WatchLogs(opts, "Flash", senderRule, recipientRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(PoolFlash) if err := _Pool.contract.UnpackLog(event, "Flash", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseFlash is a log parse operation binding the contract event 0xbdbdb71d7860376ba52b25a5028beea23581364a40522f6bcfb86bb1f2dca633. // // Solidity: event Flash(address indexed sender, address indexed recipient, uint256 amount0, uint256 amount1, uint256 paid0, uint256 paid1) func (_Pool *PoolFilterer) ParseFlash(log types.Log) (*PoolFlash, error) { event := new(PoolFlash) if err := _Pool.contract.UnpackLog(event, "Flash", log); err != nil { return nil, err } event.Raw = log return event, nil } // PoolIncentiveIterator is returned from FilterIncentive and is used to iterate over the raw logs and unpacked data for Incentive events raised by the Pool contract. type PoolIncentiveIterator struct { Event *PoolIncentive // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *PoolIncentiveIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(PoolIncentive) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(PoolIncentive) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *PoolIncentiveIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *PoolIncentiveIterator) Close() error { it.sub.Unsubscribe() return nil } // PoolIncentive represents a Incentive event raised by the Pool contract. type PoolIncentive struct { VirtualPoolAddress common.Address Raw types.Log // Blockchain specific contextual infos } // FilterIncentive is a free log retrieval operation binding the contract event 0x915c5369e6580733735d1c2e30ca20dcaa395697a041033c9f35f80f53525e84. // // Solidity: event Incentive(address indexed virtualPoolAddress) func (_Pool *PoolFilterer) FilterIncentive(opts *bind.FilterOpts, virtualPoolAddress []common.Address) (*PoolIncentiveIterator, error) { var virtualPoolAddressRule []interface{} for _, virtualPoolAddressItem := range virtualPoolAddress { virtualPoolAddressRule = append(virtualPoolAddressRule, virtualPoolAddressItem) } logs, sub, err := _Pool.contract.FilterLogs(opts, "Incentive", virtualPoolAddressRule) if err != nil { return nil, err } return &PoolIncentiveIterator{contract: _Pool.contract, event: "Incentive", logs: logs, sub: sub}, nil } // WatchIncentive is a free log subscription operation binding the contract event 0x915c5369e6580733735d1c2e30ca20dcaa395697a041033c9f35f80f53525e84. // // Solidity: event Incentive(address indexed virtualPoolAddress) func (_Pool *PoolFilterer) WatchIncentive(opts *bind.WatchOpts, sink chan<- *PoolIncentive, virtualPoolAddress []common.Address) (event.Subscription, error) { var virtualPoolAddressRule []interface{} for _, virtualPoolAddressItem := range virtualPoolAddress { virtualPoolAddressRule = append(virtualPoolAddressRule, virtualPoolAddressItem) } logs, sub, err := _Pool.contract.WatchLogs(opts, "Incentive", virtualPoolAddressRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(PoolIncentive) if err := _Pool.contract.UnpackLog(event, "Incentive", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseIncentive is a log parse operation binding the contract event 0x915c5369e6580733735d1c2e30ca20dcaa395697a041033c9f35f80f53525e84. // // Solidity: event Incentive(address indexed virtualPoolAddress) func (_Pool *PoolFilterer) ParseIncentive(log types.Log) (*PoolIncentive, error) { event := new(PoolIncentive) if err := _Pool.contract.UnpackLog(event, "Incentive", log); err != nil { return nil, err } event.Raw = log return event, nil } // PoolInitializeIterator is returned from FilterInitialize and is used to iterate over the raw logs and unpacked data for Initialize events raised by the Pool contract. type PoolInitializeIterator struct { Event *PoolInitialize // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *PoolInitializeIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(PoolInitialize) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(PoolInitialize) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *PoolInitializeIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *PoolInitializeIterator) Close() error { it.sub.Unsubscribe() return nil } // PoolInitialize represents a Initialize event raised by the Pool contract. type PoolInitialize struct { Price *big.Int Tick *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterInitialize is a free log retrieval operation binding the contract event 0x98636036cb66a9c19a37435efc1e90142190214e8abeb821bdba3f2990dd4c95. // // Solidity: event Initialize(uint160 price, int24 tick) func (_Pool *PoolFilterer) FilterInitialize(opts *bind.FilterOpts) (*PoolInitializeIterator, error) { logs, sub, err := _Pool.contract.FilterLogs(opts, "Initialize") if err != nil { return nil, err } return &PoolInitializeIterator{contract: _Pool.contract, event: "Initialize", logs: logs, sub: sub}, nil } // WatchInitialize is a free log subscription operation binding the contract event 0x98636036cb66a9c19a37435efc1e90142190214e8abeb821bdba3f2990dd4c95. // // Solidity: event Initialize(uint160 price, int24 tick) func (_Pool *PoolFilterer) WatchInitialize(opts *bind.WatchOpts, sink chan<- *PoolInitialize) (event.Subscription, error) { logs, sub, err := _Pool.contract.WatchLogs(opts, "Initialize") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(PoolInitialize) if err := _Pool.contract.UnpackLog(event, "Initialize", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseInitialize is a log parse operation binding the contract event 0x98636036cb66a9c19a37435efc1e90142190214e8abeb821bdba3f2990dd4c95. // // Solidity: event Initialize(uint160 price, int24 tick) func (_Pool *PoolFilterer) ParseInitialize(log types.Log) (*PoolInitialize, error) { event := new(PoolInitialize) if err := _Pool.contract.UnpackLog(event, "Initialize", log); err != nil { return nil, err } event.Raw = log return event, nil } // PoolLiquidityCooldownIterator is returned from FilterLiquidityCooldown and is used to iterate over the raw logs and unpacked data for LiquidityCooldown events raised by the Pool contract. type PoolLiquidityCooldownIterator struct { Event *PoolLiquidityCooldown // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *PoolLiquidityCooldownIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(PoolLiquidityCooldown) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(PoolLiquidityCooldown) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *PoolLiquidityCooldownIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *PoolLiquidityCooldownIterator) Close() error { it.sub.Unsubscribe() return nil } // PoolLiquidityCooldown represents a LiquidityCooldown event raised by the Pool contract. type PoolLiquidityCooldown struct { LiquidityCooldown uint32 Raw types.Log // Blockchain specific contextual infos } // FilterLiquidityCooldown is a free log retrieval operation binding the contract event 0xb5e51602371b0e74f991b6e965cd7d32b4b14c7e6ede6d1298037650a0e1405f. // // Solidity: event LiquidityCooldown(uint32 liquidityCooldown) func (_Pool *PoolFilterer) FilterLiquidityCooldown(opts *bind.FilterOpts) (*PoolLiquidityCooldownIterator, error) { logs, sub, err := _Pool.contract.FilterLogs(opts, "LiquidityCooldown") if err != nil { return nil, err } return &PoolLiquidityCooldownIterator{contract: _Pool.contract, event: "LiquidityCooldown", logs: logs, sub: sub}, nil } // WatchLiquidityCooldown is a free log subscription operation binding the contract event 0xb5e51602371b0e74f991b6e965cd7d32b4b14c7e6ede6d1298037650a0e1405f. // // Solidity: event LiquidityCooldown(uint32 liquidityCooldown) func (_Pool *PoolFilterer) WatchLiquidityCooldown(opts *bind.WatchOpts, sink chan<- *PoolLiquidityCooldown) (event.Subscription, error) { logs, sub, err := _Pool.contract.WatchLogs(opts, "LiquidityCooldown") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(PoolLiquidityCooldown) if err := _Pool.contract.UnpackLog(event, "LiquidityCooldown", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseLiquidityCooldown is a log parse operation binding the contract event 0xb5e51602371b0e74f991b6e965cd7d32b4b14c7e6ede6d1298037650a0e1405f. // // Solidity: event LiquidityCooldown(uint32 liquidityCooldown) func (_Pool *PoolFilterer) ParseLiquidityCooldown(log types.Log) (*PoolLiquidityCooldown, error) { event := new(PoolLiquidityCooldown) if err := _Pool.contract.UnpackLog(event, "LiquidityCooldown", log); err != nil { return nil, err } event.Raw = log return event, nil } // PoolMintIterator is returned from FilterMint and is used to iterate over the raw logs and unpacked data for Mint events raised by the Pool contract. type PoolMintIterator struct { Event *PoolMint // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *PoolMintIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(PoolMint) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(PoolMint) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *PoolMintIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *PoolMintIterator) Close() error { it.sub.Unsubscribe() return nil } // PoolMint represents a Mint event raised by the Pool contract. type PoolMint struct { Sender common.Address Owner common.Address BottomTick *big.Int TopTick *big.Int LiquidityAmount *big.Int Amount0 *big.Int Amount1 *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterMint is a free log retrieval operation binding the contract event 0x7a53080ba414158be7ec69b987b5fb7d07dee101fe85488f0853ae16239d0bde. // // Solidity: event Mint(address sender, address indexed owner, int24 indexed bottomTick, int24 indexed topTick, uint128 liquidityAmount, uint256 amount0, uint256 amount1) func (_Pool *PoolFilterer) FilterMint(opts *bind.FilterOpts, owner []common.Address, bottomTick []*big.Int, topTick []*big.Int) (*PoolMintIterator, error) { var ownerRule []interface{} for _, ownerItem := range owner { ownerRule = append(ownerRule, ownerItem) } var bottomTickRule []interface{} for _, bottomTickItem := range bottomTick { bottomTickRule = append(bottomTickRule, bottomTickItem) } var topTickRule []interface{} for _, topTickItem := range topTick { topTickRule = append(topTickRule, topTickItem) } logs, sub, err := _Pool.contract.FilterLogs(opts, "Mint", ownerRule, bottomTickRule, topTickRule) if err != nil { return nil, err } return &PoolMintIterator{contract: _Pool.contract, event: "Mint", logs: logs, sub: sub}, nil } // WatchMint is a free log subscription operation binding the contract event 0x7a53080ba414158be7ec69b987b5fb7d07dee101fe85488f0853ae16239d0bde. // // Solidity: event Mint(address sender, address indexed owner, int24 indexed bottomTick, int24 indexed topTick, uint128 liquidityAmount, uint256 amount0, uint256 amount1) func (_Pool *PoolFilterer) WatchMint(opts *bind.WatchOpts, sink chan<- *PoolMint, owner []common.Address, bottomTick []*big.Int, topTick []*big.Int) (event.Subscription, error) { var ownerRule []interface{} for _, ownerItem := range owner { ownerRule = append(ownerRule, ownerItem) } var bottomTickRule []interface{} for _, bottomTickItem := range bottomTick { bottomTickRule = append(bottomTickRule, bottomTickItem) } var topTickRule []interface{} for _, topTickItem := range topTick { topTickRule = append(topTickRule, topTickItem) } logs, sub, err := _Pool.contract.WatchLogs(opts, "Mint", ownerRule, bottomTickRule, topTickRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(PoolMint) if err := _Pool.contract.UnpackLog(event, "Mint", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseMint is a log parse operation binding the contract event 0x7a53080ba414158be7ec69b987b5fb7d07dee101fe85488f0853ae16239d0bde. // // Solidity: event Mint(address sender, address indexed owner, int24 indexed bottomTick, int24 indexed topTick, uint128 liquidityAmount, uint256 amount0, uint256 amount1) func (_Pool *PoolFilterer) ParseMint(log types.Log) (*PoolMint, error) { event := new(PoolMint) if err := _Pool.contract.UnpackLog(event, "Mint", log); err != nil { return nil, err } event.Raw = log return event, nil } // PoolSwapIterator is returned from FilterSwap and is used to iterate over the raw logs and unpacked data for Swap events raised by the Pool contract. type PoolSwapIterator struct { Event *PoolSwap // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *PoolSwapIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(PoolSwap) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(PoolSwap) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *PoolSwapIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *PoolSwapIterator) Close() error { it.sub.Unsubscribe() return nil } // PoolSwap represents a Swap event raised by the Pool contract. type PoolSwap struct { Sender common.Address Recipient common.Address Amount0 *big.Int Amount1 *big.Int Price *big.Int Liquidity *big.Int Tick *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterSwap is a free log retrieval operation binding the contract event 0xc42079f94a6350d7e6235f29174924f928cc2ac818eb64fed8004e115fbcca67. // // Solidity: event Swap(address indexed sender, address indexed recipient, int256 amount0, int256 amount1, uint160 price, uint128 liquidity, int24 tick) func (_Pool *PoolFilterer) FilterSwap(opts *bind.FilterOpts, sender []common.Address, recipient []common.Address) (*PoolSwapIterator, error) { var senderRule []interface{} for _, senderItem := range sender { senderRule = append(senderRule, senderItem) } var recipientRule []interface{} for _, recipientItem := range recipient { recipientRule = append(recipientRule, recipientItem) } logs, sub, err := _Pool.contract.FilterLogs(opts, "Swap", senderRule, recipientRule) if err != nil { return nil, err } return &PoolSwapIterator{contract: _Pool.contract, event: "Swap", logs: logs, sub: sub}, nil } // WatchSwap is a free log subscription operation binding the contract event 0xc42079f94a6350d7e6235f29174924f928cc2ac818eb64fed8004e115fbcca67. // // Solidity: event Swap(address indexed sender, address indexed recipient, int256 amount0, int256 amount1, uint160 price, uint128 liquidity, int24 tick) func (_Pool *PoolFilterer) WatchSwap(opts *bind.WatchOpts, sink chan<- *PoolSwap, sender []common.Address, recipient []common.Address) (event.Subscription, error) { var senderRule []interface{} for _, senderItem := range sender { senderRule = append(senderRule, senderItem) } var recipientRule []interface{} for _, recipientItem := range recipient { recipientRule = append(recipientRule, recipientItem) } logs, sub, err := _Pool.contract.WatchLogs(opts, "Swap", senderRule, recipientRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(PoolSwap) if err := _Pool.contract.UnpackLog(event, "Swap", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseSwap is a log parse operation binding the contract event 0xc42079f94a6350d7e6235f29174924f928cc2ac818eb64fed8004e115fbcca67. // // Solidity: event Swap(address indexed sender, address indexed recipient, int256 amount0, int256 amount1, uint160 price, uint128 liquidity, int24 tick) func (_Pool *PoolFilterer) ParseSwap(log types.Log) (*PoolSwap, error) { event := new(PoolSwap) if err := _Pool.contract.UnpackLog(event, "Swap", log); err != nil { return nil, err } event.Raw = log return event, nil } // PoolTickSpacingIterator is returned from FilterTickSpacing and is used to iterate over the raw logs and unpacked data for TickSpacing events raised by the Pool contract. type PoolTickSpacingIterator struct { Event *PoolTickSpacing // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *PoolTickSpacingIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(PoolTickSpacing) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(PoolTickSpacing) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *PoolTickSpacingIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *PoolTickSpacingIterator) Close() error { it.sub.Unsubscribe() return nil } // PoolTickSpacing represents a TickSpacing event raised by the Pool contract. type PoolTickSpacing struct { NewTickSpacing *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterTickSpacing is a free log retrieval operation binding the contract event 0x01413b1d5d4c359e9a0daa7909ecda165f6e8c51fe2ff529d74b22a5a7c02645. // // Solidity: event TickSpacing(int24 newTickSpacing) func (_Pool *PoolFilterer) FilterTickSpacing(opts *bind.FilterOpts) (*PoolTickSpacingIterator, error) { logs, sub, err := _Pool.contract.FilterLogs(opts, "TickSpacing") if err != nil { return nil, err } return &PoolTickSpacingIterator{contract: _Pool.contract, event: "TickSpacing", logs: logs, sub: sub}, nil } // WatchTickSpacing is a free log subscription operation binding the contract event 0x01413b1d5d4c359e9a0daa7909ecda165f6e8c51fe2ff529d74b22a5a7c02645. // // Solidity: event TickSpacing(int24 newTickSpacing) func (_Pool *PoolFilterer) WatchTickSpacing(opts *bind.WatchOpts, sink chan<- *PoolTickSpacing) (event.Subscription, error) { logs, sub, err := _Pool.contract.WatchLogs(opts, "TickSpacing") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(PoolTickSpacing) if err := _Pool.contract.UnpackLog(event, "TickSpacing", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseTickSpacing is a log parse operation binding the contract event 0x01413b1d5d4c359e9a0daa7909ecda165f6e8c51fe2ff529d74b22a5a7c02645. // // Solidity: event TickSpacing(int24 newTickSpacing) func (_Pool *PoolFilterer) ParseTickSpacing(log types.Log) (*PoolTickSpacing, error) { event := new(PoolTickSpacing) if err := _Pool.contract.UnpackLog(event, "TickSpacing", log); err != nil { return nil, err } event.Raw = log return event, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/binds/arbitrumpool/abi.json ================================================ [ { "inputs": [], "stateMutability": "nonpayable", "type": "constructor" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "owner", "type": "address" }, { "indexed": true, "internalType": "int24", "name": "bottomTick", "type": "int24" }, { "indexed": true, "internalType": "int24", "name": "topTick", "type": "int24" }, { "indexed": false, "internalType": "uint128", "name": "liquidityAmount", "type": "uint128" }, { "indexed": false, "internalType": "uint256", "name": "amount0", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "amount1", "type": "uint256" } ], "name": "Burn", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "owner", "type": "address" }, { "indexed": false, "internalType": "address", "name": "recipient", "type": "address" }, { "indexed": true, "internalType": "int24", "name": "bottomTick", "type": "int24" }, { "indexed": true, "internalType": "int24", "name": "topTick", "type": "int24" }, { "indexed": false, "internalType": "uint128", "name": "amount0", "type": "uint128" }, { "indexed": false, "internalType": "uint128", "name": "amount1", "type": "uint128" } ], "name": "Collect", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "uint8", "name": "communityFee0New", "type": "uint8" }, { "indexed": false, "internalType": "uint8", "name": "communityFee1New", "type": "uint8" } ], "name": "CommunityFee", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "uint16", "name": "feeZto", "type": "uint16" }, { "indexed": false, "internalType": "uint16", "name": "feeOtz", "type": "uint16" } ], "name": "Fee", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "sender", "type": "address" }, { "indexed": true, "internalType": "address", "name": "recipient", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "amount0", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "amount1", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "paid0", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "paid1", "type": "uint256" } ], "name": "Flash", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "virtualPoolAddress", "type": "address" } ], "name": "Incentive", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "uint160", "name": "price", "type": "uint160" }, { "indexed": false, "internalType": "int24", "name": "tick", "type": "int24" } ], "name": "Initialize", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "uint32", "name": "liquidityCooldown", "type": "uint32" } ], "name": "LiquidityCooldown", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "address", "name": "sender", "type": "address" }, { "indexed": true, "internalType": "address", "name": "owner", "type": "address" }, { "indexed": true, "internalType": "int24", "name": "bottomTick", "type": "int24" }, { "indexed": true, "internalType": "int24", "name": "topTick", "type": "int24" }, { "indexed": false, "internalType": "uint128", "name": "liquidityAmount", "type": "uint128" }, { "indexed": false, "internalType": "uint256", "name": "amount0", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "amount1", "type": "uint256" } ], "name": "Mint", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "sender", "type": "address" }, { "indexed": true, "internalType": "address", "name": "recipient", "type": "address" }, { "indexed": false, "internalType": "int256", "name": "amount0", "type": "int256" }, { "indexed": false, "internalType": "int256", "name": "amount1", "type": "int256" }, { "indexed": false, "internalType": "uint160", "name": "price", "type": "uint160" }, { "indexed": false, "internalType": "uint128", "name": "liquidity", "type": "uint128" }, { "indexed": false, "internalType": "int24", "name": "tick", "type": "int24" } ], "name": "Swap", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "int24", "name": "newTickSpacing", "type": "int24" } ], "name": "TickSpacing", "type": "event" }, { "inputs": [], "name": "activeIncentive", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "int24", "name": "bottomTick", "type": "int24" }, { "internalType": "int24", "name": "topTick", "type": "int24" }, { "internalType": "uint128", "name": "amount", "type": "uint128" } ], "name": "burn", "outputs": [ { "internalType": "uint256", "name": "amount0", "type": "uint256" }, { "internalType": "uint256", "name": "amount1", "type": "uint256" } ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "recipient", "type": "address" }, { "internalType": "int24", "name": "bottomTick", "type": "int24" }, { "internalType": "int24", "name": "topTick", "type": "int24" }, { "internalType": "uint128", "name": "amount0Requested", "type": "uint128" }, { "internalType": "uint128", "name": "amount1Requested", "type": "uint128" } ], "name": "collect", "outputs": [ { "internalType": "uint128", "name": "amount0", "type": "uint128" }, { "internalType": "uint128", "name": "amount1", "type": "uint128" } ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "dataStorageOperator", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "factory", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "recipient", "type": "address" }, { "internalType": "uint256", "name": "amount0", "type": "uint256" }, { "internalType": "uint256", "name": "amount1", "type": "uint256" }, { "internalType": "bytes", "name": "data", "type": "bytes" } ], "name": "flash", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "int24", "name": "bottomTick", "type": "int24" }, { "internalType": "int24", "name": "topTick", "type": "int24" } ], "name": "getInnerCumulatives", "outputs": [ { "internalType": "int56", "name": "innerTickCumulative", "type": "int56" }, { "internalType": "uint160", "name": "innerSecondsSpentPerLiquidity", "type": "uint160" }, { "internalType": "uint32", "name": "innerSecondsSpent", "type": "uint32" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint32[]", "name": "secondsAgos", "type": "uint32[]" } ], "name": "getTimepoints", "outputs": [ { "internalType": "int56[]", "name": "tickCumulatives", "type": "int56[]" }, { "internalType": "uint160[]", "name": "secondsPerLiquidityCumulatives", "type": "uint160[]" }, { "internalType": "uint112[]", "name": "volatilityCumulatives", "type": "uint112[]" }, { "internalType": "uint256[]", "name": "volumePerAvgLiquiditys", "type": "uint256[]" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "globalState", "outputs": [ { "internalType": "uint160", "name": "price", "type": "uint160" }, { "internalType": "int24", "name": "tick", "type": "int24" }, { "internalType": "uint16", "name": "feeZto", "type": "uint16" }, { "internalType": "uint16", "name": "feeOtz", "type": "uint16" }, { "internalType": "uint16", "name": "timepointIndex", "type": "uint16" }, { "internalType": "uint8", "name": "communityFeeToken0", "type": "uint8" }, { "internalType": "uint8", "name": "communityFeeToken1", "type": "uint8" }, { "internalType": "bool", "name": "unlocked", "type": "bool" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint160", "name": "initialPrice", "type": "uint160" } ], "name": "initialize", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "liquidity", "outputs": [ { "internalType": "uint128", "name": "", "type": "uint128" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "liquidityCooldown", "outputs": [ { "internalType": "uint32", "name": "", "type": "uint32" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "maxLiquidityPerTick", "outputs": [ { "internalType": "uint128", "name": "", "type": "uint128" } ], "stateMutability": "pure", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "sender", "type": "address" }, { "internalType": "address", "name": "recipient", "type": "address" }, { "internalType": "int24", "name": "bottomTick", "type": "int24" }, { "internalType": "int24", "name": "topTick", "type": "int24" }, { "internalType": "uint128", "name": "liquidityDesired", "type": "uint128" }, { "internalType": "bytes", "name": "data", "type": "bytes" } ], "name": "mint", "outputs": [ { "internalType": "uint256", "name": "amount0", "type": "uint256" }, { "internalType": "uint256", "name": "amount1", "type": "uint256" }, { "internalType": "uint128", "name": "liquidityActual", "type": "uint128" } ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "bytes32", "name": "", "type": "bytes32" } ], "name": "positions", "outputs": [ { "internalType": "uint128", "name": "liquidity", "type": "uint128" }, { "internalType": "uint32", "name": "lastLiquidityAddTimestamp", "type": "uint32" }, { "internalType": "uint256", "name": "innerFeeGrowth0Token", "type": "uint256" }, { "internalType": "uint256", "name": "innerFeeGrowth1Token", "type": "uint256" }, { "internalType": "uint128", "name": "fees0", "type": "uint128" }, { "internalType": "uint128", "name": "fees1", "type": "uint128" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint8", "name": "communityFee0", "type": "uint8" }, { "internalType": "uint8", "name": "communityFee1", "type": "uint8" } ], "name": "setCommunityFee", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "virtualPoolAddress", "type": "address" } ], "name": "setIncentive", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint32", "name": "newLiquidityCooldown", "type": "uint32" } ], "name": "setLiquidityCooldown", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "int24", "name": "newTickSpacing", "type": "int24" } ], "name": "setTickSpacing", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "recipient", "type": "address" }, { "internalType": "bool", "name": "zeroToOne", "type": "bool" }, { "internalType": "int256", "name": "amountRequired", "type": "int256" }, { "internalType": "uint160", "name": "limitSqrtPrice", "type": "uint160" }, { "internalType": "bytes", "name": "data", "type": "bytes" } ], "name": "swap", "outputs": [ { "internalType": "int256", "name": "amount0", "type": "int256" }, { "internalType": "int256", "name": "amount1", "type": "int256" } ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "sender", "type": "address" }, { "internalType": "address", "name": "recipient", "type": "address" }, { "internalType": "bool", "name": "zeroToOne", "type": "bool" }, { "internalType": "int256", "name": "amountRequired", "type": "int256" }, { "internalType": "uint160", "name": "limitSqrtPrice", "type": "uint160" }, { "internalType": "bytes", "name": "data", "type": "bytes" } ], "name": "swapSupportingFeeOnInputTokens", "outputs": [ { "internalType": "int256", "name": "amount0", "type": "int256" }, { "internalType": "int256", "name": "amount1", "type": "int256" } ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "tickSpacing", "outputs": [ { "internalType": "int24", "name": "", "type": "int24" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "int16", "name": "", "type": "int16" } ], "name": "tickTable", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "int24", "name": "", "type": "int24" } ], "name": "ticks", "outputs": [ { "internalType": "uint128", "name": "liquidityTotal", "type": "uint128" }, { "internalType": "int128", "name": "liquidityDelta", "type": "int128" }, { "internalType": "uint256", "name": "outerFeeGrowth0Token", "type": "uint256" }, { "internalType": "uint256", "name": "outerFeeGrowth1Token", "type": "uint256" }, { "internalType": "int56", "name": "outerTickCumulative", "type": "int56" }, { "internalType": "uint160", "name": "outerSecondsPerLiquidity", "type": "uint160" }, { "internalType": "uint32", "name": "outerSecondsSpent", "type": "uint32" }, { "internalType": "bool", "name": "initialized", "type": "bool" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "index", "type": "uint256" } ], "name": "timepoints", "outputs": [ { "internalType": "bool", "name": "initialized", "type": "bool" }, { "internalType": "uint32", "name": "blockTimestamp", "type": "uint32" }, { "internalType": "int56", "name": "tickCumulative", "type": "int56" }, { "internalType": "uint160", "name": "secondsPerLiquidityCumulative", "type": "uint160" }, { "internalType": "uint88", "name": "volatilityCumulative", "type": "uint88" }, { "internalType": "int24", "name": "averageTick", "type": "int24" }, { "internalType": "uint144", "name": "volumePerLiquidityCumulative", "type": "uint144" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "token0", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "token1", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "totalFeeGrowth0Token", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "totalFeeGrowth1Token", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" } ] ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/binds/avaxnonfungiblepositionmanager/NonfungiblePositionManager.go ================================================ // Code generated - DO NOT EDIT. // This file is a generated binding and any manual changes will be lost. package avaxnonfungiblepositionmanager import ( "errors" "math/big" "strings" ethereum "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/event" ) // Reference imports to suppress errors if they are not otherwise used. var ( _ = errors.New _ = big.NewInt _ = strings.NewReader _ = ethereum.NotFound _ = bind.Bind _ = common.Big1 _ = types.BloomLookup _ = event.NewSubscription _ = abi.ConvertType ) // INonfungiblePositionManagerCollectParams is an auto generated low-level Go binding around an user-defined struct. type INonfungiblePositionManagerCollectParams struct { TokenId *big.Int Recipient common.Address Amount0Max *big.Int Amount1Max *big.Int } // INonfungiblePositionManagerDecreaseLiquidityParams is an auto generated low-level Go binding around an user-defined struct. type INonfungiblePositionManagerDecreaseLiquidityParams struct { TokenId *big.Int Liquidity *big.Int Amount0Min *big.Int Amount1Min *big.Int Deadline *big.Int } // INonfungiblePositionManagerIncreaseLiquidityParams is an auto generated low-level Go binding around an user-defined struct. type INonfungiblePositionManagerIncreaseLiquidityParams struct { TokenId *big.Int Amount0Desired *big.Int Amount1Desired *big.Int Amount0Min *big.Int Amount1Min *big.Int Deadline *big.Int } // INonfungiblePositionManagerMintParams is an auto generated low-level Go binding around an user-defined struct. type INonfungiblePositionManagerMintParams struct { Token0 common.Address Token1 common.Address Fee *big.Int TickLower *big.Int TickUpper *big.Int Amount0Desired *big.Int Amount1Desired *big.Int Amount0Min *big.Int Amount1Min *big.Int Recipient common.Address Deadline *big.Int } // NonfungiblePositionManagerMetaData contains all meta data concerning the NonfungiblePositionManager contract. var NonfungiblePositionManagerMetaData = &bind.MetaData{ ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_factory\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_WETH9\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_tokenDescriptor_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"approved\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"ApprovalForAll\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"}],\"name\":\"Collect\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"liquidity\",\"type\":\"uint128\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"}],\"name\":\"DecreaseLiquidity\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"liquidity\",\"type\":\"uint128\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"}],\"name\":\"IncreaseLiquidity\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"DOMAIN_SEPARATOR\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"PERMIT_TYPEHASH\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"WETH9\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"baseURI\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"burn\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint128\",\"name\":\"amount0Max\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"amount1Max\",\"type\":\"uint128\"}],\"internalType\":\"structINonfungiblePositionManager.CollectParams\",\"name\":\"params\",\"type\":\"tuple\"}],\"name\":\"collect\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token0\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token1\",\"type\":\"address\"},{\"internalType\":\"uint24\",\"name\":\"fee\",\"type\":\"uint24\"},{\"internalType\":\"uint160\",\"name\":\"sqrtPriceX96\",\"type\":\"uint160\"}],\"name\":\"createAndInitializePoolIfNecessary\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint128\",\"name\":\"liquidity\",\"type\":\"uint128\"},{\"internalType\":\"uint256\",\"name\":\"amount0Min\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Min\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"}],\"internalType\":\"structINonfungiblePositionManager.DecreaseLiquidityParams\",\"name\":\"params\",\"type\":\"tuple\"}],\"name\":\"decreaseLiquidity\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"factory\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"getApproved\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount0Desired\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Desired\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount0Min\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Min\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"}],\"internalType\":\"structINonfungiblePositionManager.IncreaseLiquidityParams\",\"name\":\"params\",\"type\":\"tuple\"}],\"name\":\"increaseLiquidity\",\"outputs\":[{\"internalType\":\"uint128\",\"name\":\"liquidity\",\"type\":\"uint128\"},{\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"name\":\"isApprovedForAll\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"token0\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token1\",\"type\":\"address\"},{\"internalType\":\"uint24\",\"name\":\"fee\",\"type\":\"uint24\"},{\"internalType\":\"int24\",\"name\":\"tickLower\",\"type\":\"int24\"},{\"internalType\":\"int24\",\"name\":\"tickUpper\",\"type\":\"int24\"},{\"internalType\":\"uint256\",\"name\":\"amount0Desired\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Desired\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount0Min\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Min\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"}],\"internalType\":\"structINonfungiblePositionManager.MintParams\",\"name\":\"params\",\"type\":\"tuple\"}],\"name\":\"mint\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint128\",\"name\":\"liquidity\",\"type\":\"uint128\"},{\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes[]\",\"name\":\"data\",\"type\":\"bytes[]\"}],\"name\":\"multicall\",\"outputs\":[{\"internalType\":\"bytes[]\",\"name\":\"results\",\"type\":\"bytes[]\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"ownerOf\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"permit\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"positions\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"nonce\",\"type\":\"uint96\"},{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token0\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token1\",\"type\":\"address\"},{\"internalType\":\"uint24\",\"name\":\"fee\",\"type\":\"uint24\"},{\"internalType\":\"int24\",\"name\":\"tickLower\",\"type\":\"int24\"},{\"internalType\":\"int24\",\"name\":\"tickUpper\",\"type\":\"int24\"},{\"internalType\":\"uint128\",\"name\":\"liquidity\",\"type\":\"uint128\"},{\"internalType\":\"uint256\",\"name\":\"feeGrowthInside0LastX128\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"feeGrowthInside1LastX128\",\"type\":\"uint256\"},{\"internalType\":\"uint128\",\"name\":\"tokensOwed0\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"tokensOwed1\",\"type\":\"uint128\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"refundETH\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"safeTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"safeTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"selfPermit\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiry\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"selfPermitAllowed\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiry\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"selfPermitAllowedIfNecessary\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"selfPermitIfNecessary\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"setApprovalForAll\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amountMinimum\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"}],\"name\":\"sweepToken\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"}],\"name\":\"tokenByIndex\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"}],\"name\":\"tokenOfOwnerByIndex\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"tokenURI\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0Owed\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Owed\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"uniswapV3MintCallback\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountMinimum\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"}],\"name\":\"unwrapWETH9\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]", } // NonfungiblePositionManagerABI is the input ABI used to generate the binding from. // Deprecated: Use NonfungiblePositionManagerMetaData.ABI instead. var NonfungiblePositionManagerABI = NonfungiblePositionManagerMetaData.ABI // NonfungiblePositionManager is an auto generated Go binding around an Ethereum contract. type NonfungiblePositionManager struct { NonfungiblePositionManagerCaller // Read-only binding to the contract NonfungiblePositionManagerTransactor // Write-only binding to the contract NonfungiblePositionManagerFilterer // Log filterer for contract events } // NonfungiblePositionManagerCaller is an auto generated read-only Go binding around an Ethereum contract. type NonfungiblePositionManagerCaller struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // NonfungiblePositionManagerTransactor is an auto generated write-only Go binding around an Ethereum contract. type NonfungiblePositionManagerTransactor struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // NonfungiblePositionManagerFilterer is an auto generated log filtering Go binding around an Ethereum contract events. type NonfungiblePositionManagerFilterer struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // NonfungiblePositionManagerSession is an auto generated Go binding around an Ethereum contract, // with pre-set call and transact options. type NonfungiblePositionManagerSession struct { Contract *NonfungiblePositionManager // Generic contract binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // NonfungiblePositionManagerCallerSession is an auto generated read-only Go binding around an Ethereum contract, // with pre-set call options. type NonfungiblePositionManagerCallerSession struct { Contract *NonfungiblePositionManagerCaller // Generic contract caller binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session } // NonfungiblePositionManagerTransactorSession is an auto generated write-only Go binding around an Ethereum contract, // with pre-set transact options. type NonfungiblePositionManagerTransactorSession struct { Contract *NonfungiblePositionManagerTransactor // Generic contract transactor binding to set the session for TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // NonfungiblePositionManagerRaw is an auto generated low-level Go binding around an Ethereum contract. type NonfungiblePositionManagerRaw struct { Contract *NonfungiblePositionManager // Generic contract binding to access the raw methods on } // NonfungiblePositionManagerCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. type NonfungiblePositionManagerCallerRaw struct { Contract *NonfungiblePositionManagerCaller // Generic read-only contract binding to access the raw methods on } // NonfungiblePositionManagerTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. type NonfungiblePositionManagerTransactorRaw struct { Contract *NonfungiblePositionManagerTransactor // Generic write-only contract binding to access the raw methods on } // NewNonfungiblePositionManager creates a new instance of NonfungiblePositionManager, bound to a specific deployed contract. func NewNonfungiblePositionManager(address common.Address, backend bind.ContractBackend) (*NonfungiblePositionManager, error) { contract, err := bindNonfungiblePositionManager(address, backend, backend, backend) if err != nil { return nil, err } return &NonfungiblePositionManager{NonfungiblePositionManagerCaller: NonfungiblePositionManagerCaller{contract: contract}, NonfungiblePositionManagerTransactor: NonfungiblePositionManagerTransactor{contract: contract}, NonfungiblePositionManagerFilterer: NonfungiblePositionManagerFilterer{contract: contract}}, nil } // NewNonfungiblePositionManagerCaller creates a new read-only instance of NonfungiblePositionManager, bound to a specific deployed contract. func NewNonfungiblePositionManagerCaller(address common.Address, caller bind.ContractCaller) (*NonfungiblePositionManagerCaller, error) { contract, err := bindNonfungiblePositionManager(address, caller, nil, nil) if err != nil { return nil, err } return &NonfungiblePositionManagerCaller{contract: contract}, nil } // NewNonfungiblePositionManagerTransactor creates a new write-only instance of NonfungiblePositionManager, bound to a specific deployed contract. func NewNonfungiblePositionManagerTransactor(address common.Address, transactor bind.ContractTransactor) (*NonfungiblePositionManagerTransactor, error) { contract, err := bindNonfungiblePositionManager(address, nil, transactor, nil) if err != nil { return nil, err } return &NonfungiblePositionManagerTransactor{contract: contract}, nil } // NewNonfungiblePositionManagerFilterer creates a new log filterer instance of NonfungiblePositionManager, bound to a specific deployed contract. func NewNonfungiblePositionManagerFilterer(address common.Address, filterer bind.ContractFilterer) (*NonfungiblePositionManagerFilterer, error) { contract, err := bindNonfungiblePositionManager(address, nil, nil, filterer) if err != nil { return nil, err } return &NonfungiblePositionManagerFilterer{contract: contract}, nil } // bindNonfungiblePositionManager binds a generic wrapper to an already deployed contract. func bindNonfungiblePositionManager(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { parsed, err := NonfungiblePositionManagerMetaData.GetAbi() if err != nil { return nil, err } return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_NonfungiblePositionManager *NonfungiblePositionManagerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _NonfungiblePositionManager.Contract.NonfungiblePositionManagerCaller.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_NonfungiblePositionManager *NonfungiblePositionManagerRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.NonfungiblePositionManagerTransactor.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_NonfungiblePositionManager *NonfungiblePositionManagerRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.NonfungiblePositionManagerTransactor.contract.Transact(opts, method, params...) } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _NonfungiblePositionManager.Contract.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.contract.Transact(opts, method, params...) } // DOMAINSEPARATOR is a free data retrieval call binding the contract method 0x3644e515. // // Solidity: function DOMAIN_SEPARATOR() view returns(bytes32) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) DOMAINSEPARATOR(opts *bind.CallOpts) ([32]byte, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "DOMAIN_SEPARATOR") if err != nil { return *new([32]byte), err } out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) return out0, err } // DOMAINSEPARATOR is a free data retrieval call binding the contract method 0x3644e515. // // Solidity: function DOMAIN_SEPARATOR() view returns(bytes32) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) DOMAINSEPARATOR() ([32]byte, error) { return _NonfungiblePositionManager.Contract.DOMAINSEPARATOR(&_NonfungiblePositionManager.CallOpts) } // DOMAINSEPARATOR is a free data retrieval call binding the contract method 0x3644e515. // // Solidity: function DOMAIN_SEPARATOR() view returns(bytes32) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) DOMAINSEPARATOR() ([32]byte, error) { return _NonfungiblePositionManager.Contract.DOMAINSEPARATOR(&_NonfungiblePositionManager.CallOpts) } // PERMITTYPEHASH is a free data retrieval call binding the contract method 0x30adf81f. // // Solidity: function PERMIT_TYPEHASH() view returns(bytes32) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) PERMITTYPEHASH(opts *bind.CallOpts) ([32]byte, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "PERMIT_TYPEHASH") if err != nil { return *new([32]byte), err } out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) return out0, err } // PERMITTYPEHASH is a free data retrieval call binding the contract method 0x30adf81f. // // Solidity: function PERMIT_TYPEHASH() view returns(bytes32) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) PERMITTYPEHASH() ([32]byte, error) { return _NonfungiblePositionManager.Contract.PERMITTYPEHASH(&_NonfungiblePositionManager.CallOpts) } // PERMITTYPEHASH is a free data retrieval call binding the contract method 0x30adf81f. // // Solidity: function PERMIT_TYPEHASH() view returns(bytes32) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) PERMITTYPEHASH() ([32]byte, error) { return _NonfungiblePositionManager.Contract.PERMITTYPEHASH(&_NonfungiblePositionManager.CallOpts) } // WETH9 is a free data retrieval call binding the contract method 0x4aa4a4fc. // // Solidity: function WETH9() view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) WETH9(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "WETH9") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // WETH9 is a free data retrieval call binding the contract method 0x4aa4a4fc. // // Solidity: function WETH9() view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) WETH9() (common.Address, error) { return _NonfungiblePositionManager.Contract.WETH9(&_NonfungiblePositionManager.CallOpts) } // WETH9 is a free data retrieval call binding the contract method 0x4aa4a4fc. // // Solidity: function WETH9() view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) WETH9() (common.Address, error) { return _NonfungiblePositionManager.Contract.WETH9(&_NonfungiblePositionManager.CallOpts) } // BalanceOf is a free data retrieval call binding the contract method 0x70a08231. // // Solidity: function balanceOf(address owner) view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) BalanceOf(opts *bind.CallOpts, owner common.Address) (*big.Int, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "balanceOf", owner) if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // BalanceOf is a free data retrieval call binding the contract method 0x70a08231. // // Solidity: function balanceOf(address owner) view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) BalanceOf(owner common.Address) (*big.Int, error) { return _NonfungiblePositionManager.Contract.BalanceOf(&_NonfungiblePositionManager.CallOpts, owner) } // BalanceOf is a free data retrieval call binding the contract method 0x70a08231. // // Solidity: function balanceOf(address owner) view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) BalanceOf(owner common.Address) (*big.Int, error) { return _NonfungiblePositionManager.Contract.BalanceOf(&_NonfungiblePositionManager.CallOpts, owner) } // BaseURI is a free data retrieval call binding the contract method 0x6c0360eb. // // Solidity: function baseURI() pure returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) BaseURI(opts *bind.CallOpts) (string, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "baseURI") if err != nil { return *new(string), err } out0 := *abi.ConvertType(out[0], new(string)).(*string) return out0, err } // BaseURI is a free data retrieval call binding the contract method 0x6c0360eb. // // Solidity: function baseURI() pure returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) BaseURI() (string, error) { return _NonfungiblePositionManager.Contract.BaseURI(&_NonfungiblePositionManager.CallOpts) } // BaseURI is a free data retrieval call binding the contract method 0x6c0360eb. // // Solidity: function baseURI() pure returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) BaseURI() (string, error) { return _NonfungiblePositionManager.Contract.BaseURI(&_NonfungiblePositionManager.CallOpts) } // Factory is a free data retrieval call binding the contract method 0xc45a0155. // // Solidity: function factory() view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) Factory(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "factory") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // Factory is a free data retrieval call binding the contract method 0xc45a0155. // // Solidity: function factory() view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Factory() (common.Address, error) { return _NonfungiblePositionManager.Contract.Factory(&_NonfungiblePositionManager.CallOpts) } // Factory is a free data retrieval call binding the contract method 0xc45a0155. // // Solidity: function factory() view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) Factory() (common.Address, error) { return _NonfungiblePositionManager.Contract.Factory(&_NonfungiblePositionManager.CallOpts) } // GetApproved is a free data retrieval call binding the contract method 0x081812fc. // // Solidity: function getApproved(uint256 tokenId) view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) GetApproved(opts *bind.CallOpts, tokenId *big.Int) (common.Address, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "getApproved", tokenId) if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // GetApproved is a free data retrieval call binding the contract method 0x081812fc. // // Solidity: function getApproved(uint256 tokenId) view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) GetApproved(tokenId *big.Int) (common.Address, error) { return _NonfungiblePositionManager.Contract.GetApproved(&_NonfungiblePositionManager.CallOpts, tokenId) } // GetApproved is a free data retrieval call binding the contract method 0x081812fc. // // Solidity: function getApproved(uint256 tokenId) view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) GetApproved(tokenId *big.Int) (common.Address, error) { return _NonfungiblePositionManager.Contract.GetApproved(&_NonfungiblePositionManager.CallOpts, tokenId) } // IsApprovedForAll is a free data retrieval call binding the contract method 0xe985e9c5. // // Solidity: function isApprovedForAll(address owner, address operator) view returns(bool) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) IsApprovedForAll(opts *bind.CallOpts, owner common.Address, operator common.Address) (bool, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "isApprovedForAll", owner, operator) if err != nil { return *new(bool), err } out0 := *abi.ConvertType(out[0], new(bool)).(*bool) return out0, err } // IsApprovedForAll is a free data retrieval call binding the contract method 0xe985e9c5. // // Solidity: function isApprovedForAll(address owner, address operator) view returns(bool) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) IsApprovedForAll(owner common.Address, operator common.Address) (bool, error) { return _NonfungiblePositionManager.Contract.IsApprovedForAll(&_NonfungiblePositionManager.CallOpts, owner, operator) } // IsApprovedForAll is a free data retrieval call binding the contract method 0xe985e9c5. // // Solidity: function isApprovedForAll(address owner, address operator) view returns(bool) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) IsApprovedForAll(owner common.Address, operator common.Address) (bool, error) { return _NonfungiblePositionManager.Contract.IsApprovedForAll(&_NonfungiblePositionManager.CallOpts, owner, operator) } // Name is a free data retrieval call binding the contract method 0x06fdde03. // // Solidity: function name() view returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) Name(opts *bind.CallOpts) (string, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "name") if err != nil { return *new(string), err } out0 := *abi.ConvertType(out[0], new(string)).(*string) return out0, err } // Name is a free data retrieval call binding the contract method 0x06fdde03. // // Solidity: function name() view returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Name() (string, error) { return _NonfungiblePositionManager.Contract.Name(&_NonfungiblePositionManager.CallOpts) } // Name is a free data retrieval call binding the contract method 0x06fdde03. // // Solidity: function name() view returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) Name() (string, error) { return _NonfungiblePositionManager.Contract.Name(&_NonfungiblePositionManager.CallOpts) } // OwnerOf is a free data retrieval call binding the contract method 0x6352211e. // // Solidity: function ownerOf(uint256 tokenId) view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) OwnerOf(opts *bind.CallOpts, tokenId *big.Int) (common.Address, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "ownerOf", tokenId) if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // OwnerOf is a free data retrieval call binding the contract method 0x6352211e. // // Solidity: function ownerOf(uint256 tokenId) view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) OwnerOf(tokenId *big.Int) (common.Address, error) { return _NonfungiblePositionManager.Contract.OwnerOf(&_NonfungiblePositionManager.CallOpts, tokenId) } // OwnerOf is a free data retrieval call binding the contract method 0x6352211e. // // Solidity: function ownerOf(uint256 tokenId) view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) OwnerOf(tokenId *big.Int) (common.Address, error) { return _NonfungiblePositionManager.Contract.OwnerOf(&_NonfungiblePositionManager.CallOpts, tokenId) } // Positions is a free data retrieval call binding the contract method 0x99fbab88. // // Solidity: function positions(uint256 tokenId) view returns(uint96 nonce, address operator, address token0, address token1, uint24 fee, int24 tickLower, int24 tickUpper, uint128 liquidity, uint256 feeGrowthInside0LastX128, uint256 feeGrowthInside1LastX128, uint128 tokensOwed0, uint128 tokensOwed1) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) Positions(opts *bind.CallOpts, tokenId *big.Int) (struct { Nonce *big.Int Operator common.Address Token0 common.Address Token1 common.Address Fee *big.Int TickLower *big.Int TickUpper *big.Int Liquidity *big.Int FeeGrowthInside0LastX128 *big.Int FeeGrowthInside1LastX128 *big.Int TokensOwed0 *big.Int TokensOwed1 *big.Int }, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "positions", tokenId) outstruct := new(struct { Nonce *big.Int Operator common.Address Token0 common.Address Token1 common.Address Fee *big.Int TickLower *big.Int TickUpper *big.Int Liquidity *big.Int FeeGrowthInside0LastX128 *big.Int FeeGrowthInside1LastX128 *big.Int TokensOwed0 *big.Int TokensOwed1 *big.Int }) if err != nil { return *outstruct, err } outstruct.Nonce = *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) outstruct.Operator = *abi.ConvertType(out[1], new(common.Address)).(*common.Address) outstruct.Token0 = *abi.ConvertType(out[2], new(common.Address)).(*common.Address) outstruct.Token1 = *abi.ConvertType(out[3], new(common.Address)).(*common.Address) outstruct.Fee = *abi.ConvertType(out[4], new(*big.Int)).(**big.Int) outstruct.TickLower = *abi.ConvertType(out[5], new(*big.Int)).(**big.Int) outstruct.TickUpper = *abi.ConvertType(out[6], new(*big.Int)).(**big.Int) outstruct.Liquidity = *abi.ConvertType(out[7], new(*big.Int)).(**big.Int) outstruct.FeeGrowthInside0LastX128 = *abi.ConvertType(out[8], new(*big.Int)).(**big.Int) outstruct.FeeGrowthInside1LastX128 = *abi.ConvertType(out[9], new(*big.Int)).(**big.Int) outstruct.TokensOwed0 = *abi.ConvertType(out[10], new(*big.Int)).(**big.Int) outstruct.TokensOwed1 = *abi.ConvertType(out[11], new(*big.Int)).(**big.Int) return *outstruct, err } // Positions is a free data retrieval call binding the contract method 0x99fbab88. // // Solidity: function positions(uint256 tokenId) view returns(uint96 nonce, address operator, address token0, address token1, uint24 fee, int24 tickLower, int24 tickUpper, uint128 liquidity, uint256 feeGrowthInside0LastX128, uint256 feeGrowthInside1LastX128, uint128 tokensOwed0, uint128 tokensOwed1) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Positions(tokenId *big.Int) (struct { Nonce *big.Int Operator common.Address Token0 common.Address Token1 common.Address Fee *big.Int TickLower *big.Int TickUpper *big.Int Liquidity *big.Int FeeGrowthInside0LastX128 *big.Int FeeGrowthInside1LastX128 *big.Int TokensOwed0 *big.Int TokensOwed1 *big.Int }, error) { return _NonfungiblePositionManager.Contract.Positions(&_NonfungiblePositionManager.CallOpts, tokenId) } // Positions is a free data retrieval call binding the contract method 0x99fbab88. // // Solidity: function positions(uint256 tokenId) view returns(uint96 nonce, address operator, address token0, address token1, uint24 fee, int24 tickLower, int24 tickUpper, uint128 liquidity, uint256 feeGrowthInside0LastX128, uint256 feeGrowthInside1LastX128, uint128 tokensOwed0, uint128 tokensOwed1) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) Positions(tokenId *big.Int) (struct { Nonce *big.Int Operator common.Address Token0 common.Address Token1 common.Address Fee *big.Int TickLower *big.Int TickUpper *big.Int Liquidity *big.Int FeeGrowthInside0LastX128 *big.Int FeeGrowthInside1LastX128 *big.Int TokensOwed0 *big.Int TokensOwed1 *big.Int }, error) { return _NonfungiblePositionManager.Contract.Positions(&_NonfungiblePositionManager.CallOpts, tokenId) } // SupportsInterface is a free data retrieval call binding the contract method 0x01ffc9a7. // // Solidity: function supportsInterface(bytes4 interfaceId) view returns(bool) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) SupportsInterface(opts *bind.CallOpts, interfaceId [4]byte) (bool, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "supportsInterface", interfaceId) if err != nil { return *new(bool), err } out0 := *abi.ConvertType(out[0], new(bool)).(*bool) return out0, err } // SupportsInterface is a free data retrieval call binding the contract method 0x01ffc9a7. // // Solidity: function supportsInterface(bytes4 interfaceId) view returns(bool) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) SupportsInterface(interfaceId [4]byte) (bool, error) { return _NonfungiblePositionManager.Contract.SupportsInterface(&_NonfungiblePositionManager.CallOpts, interfaceId) } // SupportsInterface is a free data retrieval call binding the contract method 0x01ffc9a7. // // Solidity: function supportsInterface(bytes4 interfaceId) view returns(bool) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) SupportsInterface(interfaceId [4]byte) (bool, error) { return _NonfungiblePositionManager.Contract.SupportsInterface(&_NonfungiblePositionManager.CallOpts, interfaceId) } // Symbol is a free data retrieval call binding the contract method 0x95d89b41. // // Solidity: function symbol() view returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) Symbol(opts *bind.CallOpts) (string, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "symbol") if err != nil { return *new(string), err } out0 := *abi.ConvertType(out[0], new(string)).(*string) return out0, err } // Symbol is a free data retrieval call binding the contract method 0x95d89b41. // // Solidity: function symbol() view returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Symbol() (string, error) { return _NonfungiblePositionManager.Contract.Symbol(&_NonfungiblePositionManager.CallOpts) } // Symbol is a free data retrieval call binding the contract method 0x95d89b41. // // Solidity: function symbol() view returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) Symbol() (string, error) { return _NonfungiblePositionManager.Contract.Symbol(&_NonfungiblePositionManager.CallOpts) } // TokenByIndex is a free data retrieval call binding the contract method 0x4f6ccce7. // // Solidity: function tokenByIndex(uint256 index) view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) TokenByIndex(opts *bind.CallOpts, index *big.Int) (*big.Int, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "tokenByIndex", index) if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // TokenByIndex is a free data retrieval call binding the contract method 0x4f6ccce7. // // Solidity: function tokenByIndex(uint256 index) view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) TokenByIndex(index *big.Int) (*big.Int, error) { return _NonfungiblePositionManager.Contract.TokenByIndex(&_NonfungiblePositionManager.CallOpts, index) } // TokenByIndex is a free data retrieval call binding the contract method 0x4f6ccce7. // // Solidity: function tokenByIndex(uint256 index) view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) TokenByIndex(index *big.Int) (*big.Int, error) { return _NonfungiblePositionManager.Contract.TokenByIndex(&_NonfungiblePositionManager.CallOpts, index) } // TokenOfOwnerByIndex is a free data retrieval call binding the contract method 0x2f745c59. // // Solidity: function tokenOfOwnerByIndex(address owner, uint256 index) view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) TokenOfOwnerByIndex(opts *bind.CallOpts, owner common.Address, index *big.Int) (*big.Int, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "tokenOfOwnerByIndex", owner, index) if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // TokenOfOwnerByIndex is a free data retrieval call binding the contract method 0x2f745c59. // // Solidity: function tokenOfOwnerByIndex(address owner, uint256 index) view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) TokenOfOwnerByIndex(owner common.Address, index *big.Int) (*big.Int, error) { return _NonfungiblePositionManager.Contract.TokenOfOwnerByIndex(&_NonfungiblePositionManager.CallOpts, owner, index) } // TokenOfOwnerByIndex is a free data retrieval call binding the contract method 0x2f745c59. // // Solidity: function tokenOfOwnerByIndex(address owner, uint256 index) view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) TokenOfOwnerByIndex(owner common.Address, index *big.Int) (*big.Int, error) { return _NonfungiblePositionManager.Contract.TokenOfOwnerByIndex(&_NonfungiblePositionManager.CallOpts, owner, index) } // TokenURI is a free data retrieval call binding the contract method 0xc87b56dd. // // Solidity: function tokenURI(uint256 tokenId) view returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) TokenURI(opts *bind.CallOpts, tokenId *big.Int) (string, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "tokenURI", tokenId) if err != nil { return *new(string), err } out0 := *abi.ConvertType(out[0], new(string)).(*string) return out0, err } // TokenURI is a free data retrieval call binding the contract method 0xc87b56dd. // // Solidity: function tokenURI(uint256 tokenId) view returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) TokenURI(tokenId *big.Int) (string, error) { return _NonfungiblePositionManager.Contract.TokenURI(&_NonfungiblePositionManager.CallOpts, tokenId) } // TokenURI is a free data retrieval call binding the contract method 0xc87b56dd. // // Solidity: function tokenURI(uint256 tokenId) view returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) TokenURI(tokenId *big.Int) (string, error) { return _NonfungiblePositionManager.Contract.TokenURI(&_NonfungiblePositionManager.CallOpts, tokenId) } // TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. // // Solidity: function totalSupply() view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) TotalSupply(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "totalSupply") if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. // // Solidity: function totalSupply() view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) TotalSupply() (*big.Int, error) { return _NonfungiblePositionManager.Contract.TotalSupply(&_NonfungiblePositionManager.CallOpts) } // TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. // // Solidity: function totalSupply() view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) TotalSupply() (*big.Int, error) { return _NonfungiblePositionManager.Contract.TotalSupply(&_NonfungiblePositionManager.CallOpts) } // Approve is a paid mutator transaction binding the contract method 0x095ea7b3. // // Solidity: function approve(address to, uint256 tokenId) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) Approve(opts *bind.TransactOpts, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "approve", to, tokenId) } // Approve is a paid mutator transaction binding the contract method 0x095ea7b3. // // Solidity: function approve(address to, uint256 tokenId) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Approve(to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Approve(&_NonfungiblePositionManager.TransactOpts, to, tokenId) } // Approve is a paid mutator transaction binding the contract method 0x095ea7b3. // // Solidity: function approve(address to, uint256 tokenId) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) Approve(to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Approve(&_NonfungiblePositionManager.TransactOpts, to, tokenId) } // Burn is a paid mutator transaction binding the contract method 0x42966c68. // // Solidity: function burn(uint256 tokenId) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) Burn(opts *bind.TransactOpts, tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "burn", tokenId) } // Burn is a paid mutator transaction binding the contract method 0x42966c68. // // Solidity: function burn(uint256 tokenId) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Burn(tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Burn(&_NonfungiblePositionManager.TransactOpts, tokenId) } // Burn is a paid mutator transaction binding the contract method 0x42966c68. // // Solidity: function burn(uint256 tokenId) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) Burn(tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Burn(&_NonfungiblePositionManager.TransactOpts, tokenId) } // Collect is a paid mutator transaction binding the contract method 0xfc6f7865. // // Solidity: function collect((uint256,address,uint128,uint128) params) payable returns(uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) Collect(opts *bind.TransactOpts, params INonfungiblePositionManagerCollectParams) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "collect", params) } // Collect is a paid mutator transaction binding the contract method 0xfc6f7865. // // Solidity: function collect((uint256,address,uint128,uint128) params) payable returns(uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Collect(params INonfungiblePositionManagerCollectParams) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Collect(&_NonfungiblePositionManager.TransactOpts, params) } // Collect is a paid mutator transaction binding the contract method 0xfc6f7865. // // Solidity: function collect((uint256,address,uint128,uint128) params) payable returns(uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) Collect(params INonfungiblePositionManagerCollectParams) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Collect(&_NonfungiblePositionManager.TransactOpts, params) } // CreateAndInitializePoolIfNecessary is a paid mutator transaction binding the contract method 0x13ead562. // // Solidity: function createAndInitializePoolIfNecessary(address token0, address token1, uint24 fee, uint160 sqrtPriceX96) payable returns(address pool) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) CreateAndInitializePoolIfNecessary(opts *bind.TransactOpts, token0 common.Address, token1 common.Address, fee *big.Int, sqrtPriceX96 *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "createAndInitializePoolIfNecessary", token0, token1, fee, sqrtPriceX96) } // CreateAndInitializePoolIfNecessary is a paid mutator transaction binding the contract method 0x13ead562. // // Solidity: function createAndInitializePoolIfNecessary(address token0, address token1, uint24 fee, uint160 sqrtPriceX96) payable returns(address pool) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) CreateAndInitializePoolIfNecessary(token0 common.Address, token1 common.Address, fee *big.Int, sqrtPriceX96 *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.CreateAndInitializePoolIfNecessary(&_NonfungiblePositionManager.TransactOpts, token0, token1, fee, sqrtPriceX96) } // CreateAndInitializePoolIfNecessary is a paid mutator transaction binding the contract method 0x13ead562. // // Solidity: function createAndInitializePoolIfNecessary(address token0, address token1, uint24 fee, uint160 sqrtPriceX96) payable returns(address pool) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) CreateAndInitializePoolIfNecessary(token0 common.Address, token1 common.Address, fee *big.Int, sqrtPriceX96 *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.CreateAndInitializePoolIfNecessary(&_NonfungiblePositionManager.TransactOpts, token0, token1, fee, sqrtPriceX96) } // DecreaseLiquidity is a paid mutator transaction binding the contract method 0x0c49ccbe. // // Solidity: function decreaseLiquidity((uint256,uint128,uint256,uint256,uint256) params) payable returns(uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) DecreaseLiquidity(opts *bind.TransactOpts, params INonfungiblePositionManagerDecreaseLiquidityParams) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "decreaseLiquidity", params) } // DecreaseLiquidity is a paid mutator transaction binding the contract method 0x0c49ccbe. // // Solidity: function decreaseLiquidity((uint256,uint128,uint256,uint256,uint256) params) payable returns(uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) DecreaseLiquidity(params INonfungiblePositionManagerDecreaseLiquidityParams) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.DecreaseLiquidity(&_NonfungiblePositionManager.TransactOpts, params) } // DecreaseLiquidity is a paid mutator transaction binding the contract method 0x0c49ccbe. // // Solidity: function decreaseLiquidity((uint256,uint128,uint256,uint256,uint256) params) payable returns(uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) DecreaseLiquidity(params INonfungiblePositionManagerDecreaseLiquidityParams) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.DecreaseLiquidity(&_NonfungiblePositionManager.TransactOpts, params) } // IncreaseLiquidity is a paid mutator transaction binding the contract method 0x219f5d17. // // Solidity: function increaseLiquidity((uint256,uint256,uint256,uint256,uint256,uint256) params) payable returns(uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) IncreaseLiquidity(opts *bind.TransactOpts, params INonfungiblePositionManagerIncreaseLiquidityParams) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "increaseLiquidity", params) } // IncreaseLiquidity is a paid mutator transaction binding the contract method 0x219f5d17. // // Solidity: function increaseLiquidity((uint256,uint256,uint256,uint256,uint256,uint256) params) payable returns(uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) IncreaseLiquidity(params INonfungiblePositionManagerIncreaseLiquidityParams) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.IncreaseLiquidity(&_NonfungiblePositionManager.TransactOpts, params) } // IncreaseLiquidity is a paid mutator transaction binding the contract method 0x219f5d17. // // Solidity: function increaseLiquidity((uint256,uint256,uint256,uint256,uint256,uint256) params) payable returns(uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) IncreaseLiquidity(params INonfungiblePositionManagerIncreaseLiquidityParams) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.IncreaseLiquidity(&_NonfungiblePositionManager.TransactOpts, params) } // Mint is a paid mutator transaction binding the contract method 0x88316456. // // Solidity: function mint((address,address,uint24,int24,int24,uint256,uint256,uint256,uint256,address,uint256) params) payable returns(uint256 tokenId, uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) Mint(opts *bind.TransactOpts, params INonfungiblePositionManagerMintParams) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "mint", params) } // Mint is a paid mutator transaction binding the contract method 0x88316456. // // Solidity: function mint((address,address,uint24,int24,int24,uint256,uint256,uint256,uint256,address,uint256) params) payable returns(uint256 tokenId, uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Mint(params INonfungiblePositionManagerMintParams) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Mint(&_NonfungiblePositionManager.TransactOpts, params) } // Mint is a paid mutator transaction binding the contract method 0x88316456. // // Solidity: function mint((address,address,uint24,int24,int24,uint256,uint256,uint256,uint256,address,uint256) params) payable returns(uint256 tokenId, uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) Mint(params INonfungiblePositionManagerMintParams) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Mint(&_NonfungiblePositionManager.TransactOpts, params) } // Multicall is a paid mutator transaction binding the contract method 0xac9650d8. // // Solidity: function multicall(bytes[] data) payable returns(bytes[] results) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) Multicall(opts *bind.TransactOpts, data [][]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "multicall", data) } // Multicall is a paid mutator transaction binding the contract method 0xac9650d8. // // Solidity: function multicall(bytes[] data) payable returns(bytes[] results) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Multicall(data [][]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Multicall(&_NonfungiblePositionManager.TransactOpts, data) } // Multicall is a paid mutator transaction binding the contract method 0xac9650d8. // // Solidity: function multicall(bytes[] data) payable returns(bytes[] results) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) Multicall(data [][]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Multicall(&_NonfungiblePositionManager.TransactOpts, data) } // Permit is a paid mutator transaction binding the contract method 0x7ac2ff7b. // // Solidity: function permit(address spender, uint256 tokenId, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) Permit(opts *bind.TransactOpts, spender common.Address, tokenId *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "permit", spender, tokenId, deadline, v, r, s) } // Permit is a paid mutator transaction binding the contract method 0x7ac2ff7b. // // Solidity: function permit(address spender, uint256 tokenId, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Permit(spender common.Address, tokenId *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Permit(&_NonfungiblePositionManager.TransactOpts, spender, tokenId, deadline, v, r, s) } // Permit is a paid mutator transaction binding the contract method 0x7ac2ff7b. // // Solidity: function permit(address spender, uint256 tokenId, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) Permit(spender common.Address, tokenId *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Permit(&_NonfungiblePositionManager.TransactOpts, spender, tokenId, deadline, v, r, s) } // RefundETH is a paid mutator transaction binding the contract method 0x12210e8a. // // Solidity: function refundETH() payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) RefundETH(opts *bind.TransactOpts) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "refundETH") } // RefundETH is a paid mutator transaction binding the contract method 0x12210e8a. // // Solidity: function refundETH() payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) RefundETH() (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.RefundETH(&_NonfungiblePositionManager.TransactOpts) } // RefundETH is a paid mutator transaction binding the contract method 0x12210e8a. // // Solidity: function refundETH() payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) RefundETH() (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.RefundETH(&_NonfungiblePositionManager.TransactOpts) } // SafeTransferFrom is a paid mutator transaction binding the contract method 0x42842e0e. // // Solidity: function safeTransferFrom(address from, address to, uint256 tokenId) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) SafeTransferFrom(opts *bind.TransactOpts, from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "safeTransferFrom", from, to, tokenId) } // SafeTransferFrom is a paid mutator transaction binding the contract method 0x42842e0e. // // Solidity: function safeTransferFrom(address from, address to, uint256 tokenId) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) SafeTransferFrom(from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SafeTransferFrom(&_NonfungiblePositionManager.TransactOpts, from, to, tokenId) } // SafeTransferFrom is a paid mutator transaction binding the contract method 0x42842e0e. // // Solidity: function safeTransferFrom(address from, address to, uint256 tokenId) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) SafeTransferFrom(from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SafeTransferFrom(&_NonfungiblePositionManager.TransactOpts, from, to, tokenId) } // SafeTransferFrom0 is a paid mutator transaction binding the contract method 0xb88d4fde. // // Solidity: function safeTransferFrom(address from, address to, uint256 tokenId, bytes _data) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) SafeTransferFrom0(opts *bind.TransactOpts, from common.Address, to common.Address, tokenId *big.Int, _data []byte) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "safeTransferFrom0", from, to, tokenId, _data) } // SafeTransferFrom0 is a paid mutator transaction binding the contract method 0xb88d4fde. // // Solidity: function safeTransferFrom(address from, address to, uint256 tokenId, bytes _data) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) SafeTransferFrom0(from common.Address, to common.Address, tokenId *big.Int, _data []byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SafeTransferFrom0(&_NonfungiblePositionManager.TransactOpts, from, to, tokenId, _data) } // SafeTransferFrom0 is a paid mutator transaction binding the contract method 0xb88d4fde. // // Solidity: function safeTransferFrom(address from, address to, uint256 tokenId, bytes _data) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) SafeTransferFrom0(from common.Address, to common.Address, tokenId *big.Int, _data []byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SafeTransferFrom0(&_NonfungiblePositionManager.TransactOpts, from, to, tokenId, _data) } // SelfPermit is a paid mutator transaction binding the contract method 0xf3995c67. // // Solidity: function selfPermit(address token, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) SelfPermit(opts *bind.TransactOpts, token common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "selfPermit", token, value, deadline, v, r, s) } // SelfPermit is a paid mutator transaction binding the contract method 0xf3995c67. // // Solidity: function selfPermit(address token, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) SelfPermit(token common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SelfPermit(&_NonfungiblePositionManager.TransactOpts, token, value, deadline, v, r, s) } // SelfPermit is a paid mutator transaction binding the contract method 0xf3995c67. // // Solidity: function selfPermit(address token, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) SelfPermit(token common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SelfPermit(&_NonfungiblePositionManager.TransactOpts, token, value, deadline, v, r, s) } // SelfPermitAllowed is a paid mutator transaction binding the contract method 0x4659a494. // // Solidity: function selfPermitAllowed(address token, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) SelfPermitAllowed(opts *bind.TransactOpts, token common.Address, nonce *big.Int, expiry *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "selfPermitAllowed", token, nonce, expiry, v, r, s) } // SelfPermitAllowed is a paid mutator transaction binding the contract method 0x4659a494. // // Solidity: function selfPermitAllowed(address token, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) SelfPermitAllowed(token common.Address, nonce *big.Int, expiry *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SelfPermitAllowed(&_NonfungiblePositionManager.TransactOpts, token, nonce, expiry, v, r, s) } // SelfPermitAllowed is a paid mutator transaction binding the contract method 0x4659a494. // // Solidity: function selfPermitAllowed(address token, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) SelfPermitAllowed(token common.Address, nonce *big.Int, expiry *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SelfPermitAllowed(&_NonfungiblePositionManager.TransactOpts, token, nonce, expiry, v, r, s) } // SelfPermitAllowedIfNecessary is a paid mutator transaction binding the contract method 0xa4a78f0c. // // Solidity: function selfPermitAllowedIfNecessary(address token, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) SelfPermitAllowedIfNecessary(opts *bind.TransactOpts, token common.Address, nonce *big.Int, expiry *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "selfPermitAllowedIfNecessary", token, nonce, expiry, v, r, s) } // SelfPermitAllowedIfNecessary is a paid mutator transaction binding the contract method 0xa4a78f0c. // // Solidity: function selfPermitAllowedIfNecessary(address token, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) SelfPermitAllowedIfNecessary(token common.Address, nonce *big.Int, expiry *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SelfPermitAllowedIfNecessary(&_NonfungiblePositionManager.TransactOpts, token, nonce, expiry, v, r, s) } // SelfPermitAllowedIfNecessary is a paid mutator transaction binding the contract method 0xa4a78f0c. // // Solidity: function selfPermitAllowedIfNecessary(address token, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) SelfPermitAllowedIfNecessary(token common.Address, nonce *big.Int, expiry *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SelfPermitAllowedIfNecessary(&_NonfungiblePositionManager.TransactOpts, token, nonce, expiry, v, r, s) } // SelfPermitIfNecessary is a paid mutator transaction binding the contract method 0xc2e3140a. // // Solidity: function selfPermitIfNecessary(address token, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) SelfPermitIfNecessary(opts *bind.TransactOpts, token common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "selfPermitIfNecessary", token, value, deadline, v, r, s) } // SelfPermitIfNecessary is a paid mutator transaction binding the contract method 0xc2e3140a. // // Solidity: function selfPermitIfNecessary(address token, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) SelfPermitIfNecessary(token common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SelfPermitIfNecessary(&_NonfungiblePositionManager.TransactOpts, token, value, deadline, v, r, s) } // SelfPermitIfNecessary is a paid mutator transaction binding the contract method 0xc2e3140a. // // Solidity: function selfPermitIfNecessary(address token, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) SelfPermitIfNecessary(token common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SelfPermitIfNecessary(&_NonfungiblePositionManager.TransactOpts, token, value, deadline, v, r, s) } // SetApprovalForAll is a paid mutator transaction binding the contract method 0xa22cb465. // // Solidity: function setApprovalForAll(address operator, bool approved) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) SetApprovalForAll(opts *bind.TransactOpts, operator common.Address, approved bool) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "setApprovalForAll", operator, approved) } // SetApprovalForAll is a paid mutator transaction binding the contract method 0xa22cb465. // // Solidity: function setApprovalForAll(address operator, bool approved) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) SetApprovalForAll(operator common.Address, approved bool) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SetApprovalForAll(&_NonfungiblePositionManager.TransactOpts, operator, approved) } // SetApprovalForAll is a paid mutator transaction binding the contract method 0xa22cb465. // // Solidity: function setApprovalForAll(address operator, bool approved) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) SetApprovalForAll(operator common.Address, approved bool) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SetApprovalForAll(&_NonfungiblePositionManager.TransactOpts, operator, approved) } // SweepToken is a paid mutator transaction binding the contract method 0xdf2ab5bb. // // Solidity: function sweepToken(address token, uint256 amountMinimum, address recipient) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) SweepToken(opts *bind.TransactOpts, token common.Address, amountMinimum *big.Int, recipient common.Address) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "sweepToken", token, amountMinimum, recipient) } // SweepToken is a paid mutator transaction binding the contract method 0xdf2ab5bb. // // Solidity: function sweepToken(address token, uint256 amountMinimum, address recipient) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) SweepToken(token common.Address, amountMinimum *big.Int, recipient common.Address) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SweepToken(&_NonfungiblePositionManager.TransactOpts, token, amountMinimum, recipient) } // SweepToken is a paid mutator transaction binding the contract method 0xdf2ab5bb. // // Solidity: function sweepToken(address token, uint256 amountMinimum, address recipient) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) SweepToken(token common.Address, amountMinimum *big.Int, recipient common.Address) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SweepToken(&_NonfungiblePositionManager.TransactOpts, token, amountMinimum, recipient) } // TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. // // Solidity: function transferFrom(address from, address to, uint256 tokenId) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) TransferFrom(opts *bind.TransactOpts, from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "transferFrom", from, to, tokenId) } // TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. // // Solidity: function transferFrom(address from, address to, uint256 tokenId) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) TransferFrom(from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.TransferFrom(&_NonfungiblePositionManager.TransactOpts, from, to, tokenId) } // TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. // // Solidity: function transferFrom(address from, address to, uint256 tokenId) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) TransferFrom(from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.TransferFrom(&_NonfungiblePositionManager.TransactOpts, from, to, tokenId) } // UniswapV3MintCallback is a paid mutator transaction binding the contract method 0xd3487997. // // Solidity: function uniswapV3MintCallback(uint256 amount0Owed, uint256 amount1Owed, bytes data) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) UniswapV3MintCallback(opts *bind.TransactOpts, amount0Owed *big.Int, amount1Owed *big.Int, data []byte) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "uniswapV3MintCallback", amount0Owed, amount1Owed, data) } // UniswapV3MintCallback is a paid mutator transaction binding the contract method 0xd3487997. // // Solidity: function uniswapV3MintCallback(uint256 amount0Owed, uint256 amount1Owed, bytes data) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) UniswapV3MintCallback(amount0Owed *big.Int, amount1Owed *big.Int, data []byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.UniswapV3MintCallback(&_NonfungiblePositionManager.TransactOpts, amount0Owed, amount1Owed, data) } // UniswapV3MintCallback is a paid mutator transaction binding the contract method 0xd3487997. // // Solidity: function uniswapV3MintCallback(uint256 amount0Owed, uint256 amount1Owed, bytes data) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) UniswapV3MintCallback(amount0Owed *big.Int, amount1Owed *big.Int, data []byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.UniswapV3MintCallback(&_NonfungiblePositionManager.TransactOpts, amount0Owed, amount1Owed, data) } // UnwrapWETH9 is a paid mutator transaction binding the contract method 0x49404b7c. // // Solidity: function unwrapWETH9(uint256 amountMinimum, address recipient) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) UnwrapWETH9(opts *bind.TransactOpts, amountMinimum *big.Int, recipient common.Address) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "unwrapWETH9", amountMinimum, recipient) } // UnwrapWETH9 is a paid mutator transaction binding the contract method 0x49404b7c. // // Solidity: function unwrapWETH9(uint256 amountMinimum, address recipient) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) UnwrapWETH9(amountMinimum *big.Int, recipient common.Address) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.UnwrapWETH9(&_NonfungiblePositionManager.TransactOpts, amountMinimum, recipient) } // UnwrapWETH9 is a paid mutator transaction binding the contract method 0x49404b7c. // // Solidity: function unwrapWETH9(uint256 amountMinimum, address recipient) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) UnwrapWETH9(amountMinimum *big.Int, recipient common.Address) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.UnwrapWETH9(&_NonfungiblePositionManager.TransactOpts, amountMinimum, recipient) } // Receive is a paid mutator transaction binding the contract receive function. // // Solidity: receive() payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) Receive(opts *bind.TransactOpts) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.RawTransact(opts, nil) // calldata is disallowed for receive function } // Receive is a paid mutator transaction binding the contract receive function. // // Solidity: receive() payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Receive() (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Receive(&_NonfungiblePositionManager.TransactOpts) } // Receive is a paid mutator transaction binding the contract receive function. // // Solidity: receive() payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) Receive() (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Receive(&_NonfungiblePositionManager.TransactOpts) } // NonfungiblePositionManagerApprovalIterator is returned from FilterApproval and is used to iterate over the raw logs and unpacked data for Approval events raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerApprovalIterator struct { Event *NonfungiblePositionManagerApproval // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *NonfungiblePositionManagerApprovalIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerApproval) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerApproval) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *NonfungiblePositionManagerApprovalIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *NonfungiblePositionManagerApprovalIterator) Close() error { it.sub.Unsubscribe() return nil } // NonfungiblePositionManagerApproval represents a Approval event raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerApproval struct { Owner common.Address Approved common.Address TokenId *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterApproval is a free log retrieval operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. // // Solidity: event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) FilterApproval(opts *bind.FilterOpts, owner []common.Address, approved []common.Address, tokenId []*big.Int) (*NonfungiblePositionManagerApprovalIterator, error) { var ownerRule []interface{} for _, ownerItem := range owner { ownerRule = append(ownerRule, ownerItem) } var approvedRule []interface{} for _, approvedItem := range approved { approvedRule = append(approvedRule, approvedItem) } var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _NonfungiblePositionManager.contract.FilterLogs(opts, "Approval", ownerRule, approvedRule, tokenIdRule) if err != nil { return nil, err } return &NonfungiblePositionManagerApprovalIterator{contract: _NonfungiblePositionManager.contract, event: "Approval", logs: logs, sub: sub}, nil } // WatchApproval is a free log subscription operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. // // Solidity: event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) WatchApproval(opts *bind.WatchOpts, sink chan<- *NonfungiblePositionManagerApproval, owner []common.Address, approved []common.Address, tokenId []*big.Int) (event.Subscription, error) { var ownerRule []interface{} for _, ownerItem := range owner { ownerRule = append(ownerRule, ownerItem) } var approvedRule []interface{} for _, approvedItem := range approved { approvedRule = append(approvedRule, approvedItem) } var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _NonfungiblePositionManager.contract.WatchLogs(opts, "Approval", ownerRule, approvedRule, tokenIdRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(NonfungiblePositionManagerApproval) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "Approval", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseApproval is a log parse operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. // // Solidity: event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) ParseApproval(log types.Log) (*NonfungiblePositionManagerApproval, error) { event := new(NonfungiblePositionManagerApproval) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "Approval", log); err != nil { return nil, err } event.Raw = log return event, nil } // NonfungiblePositionManagerApprovalForAllIterator is returned from FilterApprovalForAll and is used to iterate over the raw logs and unpacked data for ApprovalForAll events raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerApprovalForAllIterator struct { Event *NonfungiblePositionManagerApprovalForAll // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *NonfungiblePositionManagerApprovalForAllIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerApprovalForAll) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerApprovalForAll) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *NonfungiblePositionManagerApprovalForAllIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *NonfungiblePositionManagerApprovalForAllIterator) Close() error { it.sub.Unsubscribe() return nil } // NonfungiblePositionManagerApprovalForAll represents a ApprovalForAll event raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerApprovalForAll struct { Owner common.Address Operator common.Address Approved bool Raw types.Log // Blockchain specific contextual infos } // FilterApprovalForAll is a free log retrieval operation binding the contract event 0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31. // // Solidity: event ApprovalForAll(address indexed owner, address indexed operator, bool approved) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) FilterApprovalForAll(opts *bind.FilterOpts, owner []common.Address, operator []common.Address) (*NonfungiblePositionManagerApprovalForAllIterator, error) { var ownerRule []interface{} for _, ownerItem := range owner { ownerRule = append(ownerRule, ownerItem) } var operatorRule []interface{} for _, operatorItem := range operator { operatorRule = append(operatorRule, operatorItem) } logs, sub, err := _NonfungiblePositionManager.contract.FilterLogs(opts, "ApprovalForAll", ownerRule, operatorRule) if err != nil { return nil, err } return &NonfungiblePositionManagerApprovalForAllIterator{contract: _NonfungiblePositionManager.contract, event: "ApprovalForAll", logs: logs, sub: sub}, nil } // WatchApprovalForAll is a free log subscription operation binding the contract event 0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31. // // Solidity: event ApprovalForAll(address indexed owner, address indexed operator, bool approved) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) WatchApprovalForAll(opts *bind.WatchOpts, sink chan<- *NonfungiblePositionManagerApprovalForAll, owner []common.Address, operator []common.Address) (event.Subscription, error) { var ownerRule []interface{} for _, ownerItem := range owner { ownerRule = append(ownerRule, ownerItem) } var operatorRule []interface{} for _, operatorItem := range operator { operatorRule = append(operatorRule, operatorItem) } logs, sub, err := _NonfungiblePositionManager.contract.WatchLogs(opts, "ApprovalForAll", ownerRule, operatorRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(NonfungiblePositionManagerApprovalForAll) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "ApprovalForAll", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseApprovalForAll is a log parse operation binding the contract event 0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31. // // Solidity: event ApprovalForAll(address indexed owner, address indexed operator, bool approved) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) ParseApprovalForAll(log types.Log) (*NonfungiblePositionManagerApprovalForAll, error) { event := new(NonfungiblePositionManagerApprovalForAll) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "ApprovalForAll", log); err != nil { return nil, err } event.Raw = log return event, nil } // NonfungiblePositionManagerCollectIterator is returned from FilterCollect and is used to iterate over the raw logs and unpacked data for Collect events raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerCollectIterator struct { Event *NonfungiblePositionManagerCollect // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *NonfungiblePositionManagerCollectIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerCollect) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerCollect) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *NonfungiblePositionManagerCollectIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *NonfungiblePositionManagerCollectIterator) Close() error { it.sub.Unsubscribe() return nil } // NonfungiblePositionManagerCollect represents a Collect event raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerCollect struct { TokenId *big.Int Recipient common.Address Amount0 *big.Int Amount1 *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterCollect is a free log retrieval operation binding the contract event 0x40d0efd1a53d60ecbf40971b9daf7dc90178c3aadc7aab1765632738fa8b8f01. // // Solidity: event Collect(uint256 indexed tokenId, address recipient, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) FilterCollect(opts *bind.FilterOpts, tokenId []*big.Int) (*NonfungiblePositionManagerCollectIterator, error) { var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _NonfungiblePositionManager.contract.FilterLogs(opts, "Collect", tokenIdRule) if err != nil { return nil, err } return &NonfungiblePositionManagerCollectIterator{contract: _NonfungiblePositionManager.contract, event: "Collect", logs: logs, sub: sub}, nil } // WatchCollect is a free log subscription operation binding the contract event 0x40d0efd1a53d60ecbf40971b9daf7dc90178c3aadc7aab1765632738fa8b8f01. // // Solidity: event Collect(uint256 indexed tokenId, address recipient, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) WatchCollect(opts *bind.WatchOpts, sink chan<- *NonfungiblePositionManagerCollect, tokenId []*big.Int) (event.Subscription, error) { var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _NonfungiblePositionManager.contract.WatchLogs(opts, "Collect", tokenIdRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(NonfungiblePositionManagerCollect) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "Collect", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseCollect is a log parse operation binding the contract event 0x40d0efd1a53d60ecbf40971b9daf7dc90178c3aadc7aab1765632738fa8b8f01. // // Solidity: event Collect(uint256 indexed tokenId, address recipient, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) ParseCollect(log types.Log) (*NonfungiblePositionManagerCollect, error) { event := new(NonfungiblePositionManagerCollect) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "Collect", log); err != nil { return nil, err } event.Raw = log return event, nil } // NonfungiblePositionManagerDecreaseLiquidityIterator is returned from FilterDecreaseLiquidity and is used to iterate over the raw logs and unpacked data for DecreaseLiquidity events raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerDecreaseLiquidityIterator struct { Event *NonfungiblePositionManagerDecreaseLiquidity // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *NonfungiblePositionManagerDecreaseLiquidityIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerDecreaseLiquidity) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerDecreaseLiquidity) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *NonfungiblePositionManagerDecreaseLiquidityIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *NonfungiblePositionManagerDecreaseLiquidityIterator) Close() error { it.sub.Unsubscribe() return nil } // NonfungiblePositionManagerDecreaseLiquidity represents a DecreaseLiquidity event raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerDecreaseLiquidity struct { TokenId *big.Int Liquidity *big.Int Amount0 *big.Int Amount1 *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterDecreaseLiquidity is a free log retrieval operation binding the contract event 0x26f6a048ee9138f2c0ce266f322cb99228e8d619ae2bff30c67f8dcf9d2377b4. // // Solidity: event DecreaseLiquidity(uint256 indexed tokenId, uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) FilterDecreaseLiquidity(opts *bind.FilterOpts, tokenId []*big.Int) (*NonfungiblePositionManagerDecreaseLiquidityIterator, error) { var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _NonfungiblePositionManager.contract.FilterLogs(opts, "DecreaseLiquidity", tokenIdRule) if err != nil { return nil, err } return &NonfungiblePositionManagerDecreaseLiquidityIterator{contract: _NonfungiblePositionManager.contract, event: "DecreaseLiquidity", logs: logs, sub: sub}, nil } // WatchDecreaseLiquidity is a free log subscription operation binding the contract event 0x26f6a048ee9138f2c0ce266f322cb99228e8d619ae2bff30c67f8dcf9d2377b4. // // Solidity: event DecreaseLiquidity(uint256 indexed tokenId, uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) WatchDecreaseLiquidity(opts *bind.WatchOpts, sink chan<- *NonfungiblePositionManagerDecreaseLiquidity, tokenId []*big.Int) (event.Subscription, error) { var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _NonfungiblePositionManager.contract.WatchLogs(opts, "DecreaseLiquidity", tokenIdRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(NonfungiblePositionManagerDecreaseLiquidity) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "DecreaseLiquidity", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseDecreaseLiquidity is a log parse operation binding the contract event 0x26f6a048ee9138f2c0ce266f322cb99228e8d619ae2bff30c67f8dcf9d2377b4. // // Solidity: event DecreaseLiquidity(uint256 indexed tokenId, uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) ParseDecreaseLiquidity(log types.Log) (*NonfungiblePositionManagerDecreaseLiquidity, error) { event := new(NonfungiblePositionManagerDecreaseLiquidity) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "DecreaseLiquidity", log); err != nil { return nil, err } event.Raw = log return event, nil } // NonfungiblePositionManagerIncreaseLiquidityIterator is returned from FilterIncreaseLiquidity and is used to iterate over the raw logs and unpacked data for IncreaseLiquidity events raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerIncreaseLiquidityIterator struct { Event *NonfungiblePositionManagerIncreaseLiquidity // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *NonfungiblePositionManagerIncreaseLiquidityIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerIncreaseLiquidity) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerIncreaseLiquidity) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *NonfungiblePositionManagerIncreaseLiquidityIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *NonfungiblePositionManagerIncreaseLiquidityIterator) Close() error { it.sub.Unsubscribe() return nil } // NonfungiblePositionManagerIncreaseLiquidity represents a IncreaseLiquidity event raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerIncreaseLiquidity struct { TokenId *big.Int Liquidity *big.Int Amount0 *big.Int Amount1 *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterIncreaseLiquidity is a free log retrieval operation binding the contract event 0x3067048beee31b25b2f1681f88dac838c8bba36af25bfb2b7cf7473a5847e35f. // // Solidity: event IncreaseLiquidity(uint256 indexed tokenId, uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) FilterIncreaseLiquidity(opts *bind.FilterOpts, tokenId []*big.Int) (*NonfungiblePositionManagerIncreaseLiquidityIterator, error) { var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _NonfungiblePositionManager.contract.FilterLogs(opts, "IncreaseLiquidity", tokenIdRule) if err != nil { return nil, err } return &NonfungiblePositionManagerIncreaseLiquidityIterator{contract: _NonfungiblePositionManager.contract, event: "IncreaseLiquidity", logs: logs, sub: sub}, nil } // WatchIncreaseLiquidity is a free log subscription operation binding the contract event 0x3067048beee31b25b2f1681f88dac838c8bba36af25bfb2b7cf7473a5847e35f. // // Solidity: event IncreaseLiquidity(uint256 indexed tokenId, uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) WatchIncreaseLiquidity(opts *bind.WatchOpts, sink chan<- *NonfungiblePositionManagerIncreaseLiquidity, tokenId []*big.Int) (event.Subscription, error) { var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _NonfungiblePositionManager.contract.WatchLogs(opts, "IncreaseLiquidity", tokenIdRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(NonfungiblePositionManagerIncreaseLiquidity) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "IncreaseLiquidity", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseIncreaseLiquidity is a log parse operation binding the contract event 0x3067048beee31b25b2f1681f88dac838c8bba36af25bfb2b7cf7473a5847e35f. // // Solidity: event IncreaseLiquidity(uint256 indexed tokenId, uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) ParseIncreaseLiquidity(log types.Log) (*NonfungiblePositionManagerIncreaseLiquidity, error) { event := new(NonfungiblePositionManagerIncreaseLiquidity) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "IncreaseLiquidity", log); err != nil { return nil, err } event.Raw = log return event, nil } // NonfungiblePositionManagerTransferIterator is returned from FilterTransfer and is used to iterate over the raw logs and unpacked data for Transfer events raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerTransferIterator struct { Event *NonfungiblePositionManagerTransfer // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *NonfungiblePositionManagerTransferIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerTransfer) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerTransfer) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *NonfungiblePositionManagerTransferIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *NonfungiblePositionManagerTransferIterator) Close() error { it.sub.Unsubscribe() return nil } // NonfungiblePositionManagerTransfer represents a Transfer event raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerTransfer struct { From common.Address To common.Address TokenId *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterTransfer is a free log retrieval operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. // // Solidity: event Transfer(address indexed from, address indexed to, uint256 indexed tokenId) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) FilterTransfer(opts *bind.FilterOpts, from []common.Address, to []common.Address, tokenId []*big.Int) (*NonfungiblePositionManagerTransferIterator, error) { var fromRule []interface{} for _, fromItem := range from { fromRule = append(fromRule, fromItem) } var toRule []interface{} for _, toItem := range to { toRule = append(toRule, toItem) } var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _NonfungiblePositionManager.contract.FilterLogs(opts, "Transfer", fromRule, toRule, tokenIdRule) if err != nil { return nil, err } return &NonfungiblePositionManagerTransferIterator{contract: _NonfungiblePositionManager.contract, event: "Transfer", logs: logs, sub: sub}, nil } // WatchTransfer is a free log subscription operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. // // Solidity: event Transfer(address indexed from, address indexed to, uint256 indexed tokenId) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) WatchTransfer(opts *bind.WatchOpts, sink chan<- *NonfungiblePositionManagerTransfer, from []common.Address, to []common.Address, tokenId []*big.Int) (event.Subscription, error) { var fromRule []interface{} for _, fromItem := range from { fromRule = append(fromRule, fromItem) } var toRule []interface{} for _, toItem := range to { toRule = append(toRule, toItem) } var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _NonfungiblePositionManager.contract.WatchLogs(opts, "Transfer", fromRule, toRule, tokenIdRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(NonfungiblePositionManagerTransfer) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "Transfer", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseTransfer is a log parse operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. // // Solidity: event Transfer(address indexed from, address indexed to, uint256 indexed tokenId) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) ParseTransfer(log types.Log) (*NonfungiblePositionManagerTransfer, error) { event := new(NonfungiblePositionManagerTransfer) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "Transfer", log); err != nil { return nil, err } event.Raw = log return event, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/binds/avaxnonfungiblepositionmanager/abi.json ================================================ [ { "inputs": [ { "internalType": "address", "name": "_factory", "type": "address" }, { "internalType": "address", "name": "_WETH9", "type": "address" }, { "internalType": "address", "name": "_tokenDescriptor_", "type": "address" } ], "stateMutability": "nonpayable", "type": "constructor" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "owner", "type": "address" }, { "indexed": true, "internalType": "address", "name": "approved", "type": "address" }, { "indexed": true, "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "Approval", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "owner", "type": "address" }, { "indexed": true, "internalType": "address", "name": "operator", "type": "address" }, { "indexed": false, "internalType": "bool", "name": "approved", "type": "bool" } ], "name": "ApprovalForAll", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "indexed": false, "internalType": "address", "name": "recipient", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "amount0", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "amount1", "type": "uint256" } ], "name": "Collect", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "indexed": false, "internalType": "uint128", "name": "liquidity", "type": "uint128" }, { "indexed": false, "internalType": "uint256", "name": "amount0", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "amount1", "type": "uint256" } ], "name": "DecreaseLiquidity", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "indexed": false, "internalType": "uint128", "name": "liquidity", "type": "uint128" }, { "indexed": false, "internalType": "uint256", "name": "amount0", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "amount1", "type": "uint256" } ], "name": "IncreaseLiquidity", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "from", "type": "address" }, { "indexed": true, "internalType": "address", "name": "to", "type": "address" }, { "indexed": true, "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "Transfer", "type": "event" }, { "inputs": [], "name": "DOMAIN_SEPARATOR", "outputs": [ { "internalType": "bytes32", "name": "", "type": "bytes32" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "PERMIT_TYPEHASH", "outputs": [ { "internalType": "bytes32", "name": "", "type": "bytes32" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "WETH9", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "to", "type": "address" }, { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "approve", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "owner", "type": "address" } ], "name": "balanceOf", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "baseURI", "outputs": [ { "internalType": "string", "name": "", "type": "string" } ], "stateMutability": "pure", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "burn", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "components": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "internalType": "address", "name": "recipient", "type": "address" }, { "internalType": "uint128", "name": "amount0Max", "type": "uint128" }, { "internalType": "uint128", "name": "amount1Max", "type": "uint128" } ], "internalType": "struct INonfungiblePositionManager.CollectParams", "name": "params", "type": "tuple" } ], "name": "collect", "outputs": [ { "internalType": "uint256", "name": "amount0", "type": "uint256" }, { "internalType": "uint256", "name": "amount1", "type": "uint256" } ], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "token0", "type": "address" }, { "internalType": "address", "name": "token1", "type": "address" }, { "internalType": "uint24", "name": "fee", "type": "uint24" }, { "internalType": "uint160", "name": "sqrtPriceX96", "type": "uint160" } ], "name": "createAndInitializePoolIfNecessary", "outputs": [ { "internalType": "address", "name": "pool", "type": "address" } ], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "components": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "internalType": "uint128", "name": "liquidity", "type": "uint128" }, { "internalType": "uint256", "name": "amount0Min", "type": "uint256" }, { "internalType": "uint256", "name": "amount1Min", "type": "uint256" }, { "internalType": "uint256", "name": "deadline", "type": "uint256" } ], "internalType": "struct INonfungiblePositionManager.DecreaseLiquidityParams", "name": "params", "type": "tuple" } ], "name": "decreaseLiquidity", "outputs": [ { "internalType": "uint256", "name": "amount0", "type": "uint256" }, { "internalType": "uint256", "name": "amount1", "type": "uint256" } ], "stateMutability": "payable", "type": "function" }, { "inputs": [], "name": "factory", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "getApproved", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "components": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "internalType": "uint256", "name": "amount0Desired", "type": "uint256" }, { "internalType": "uint256", "name": "amount1Desired", "type": "uint256" }, { "internalType": "uint256", "name": "amount0Min", "type": "uint256" }, { "internalType": "uint256", "name": "amount1Min", "type": "uint256" }, { "internalType": "uint256", "name": "deadline", "type": "uint256" } ], "internalType": "struct INonfungiblePositionManager.IncreaseLiquidityParams", "name": "params", "type": "tuple" } ], "name": "increaseLiquidity", "outputs": [ { "internalType": "uint128", "name": "liquidity", "type": "uint128" }, { "internalType": "uint256", "name": "amount0", "type": "uint256" }, { "internalType": "uint256", "name": "amount1", "type": "uint256" } ], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "owner", "type": "address" }, { "internalType": "address", "name": "operator", "type": "address" } ], "name": "isApprovedForAll", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "components": [ { "internalType": "address", "name": "token0", "type": "address" }, { "internalType": "address", "name": "token1", "type": "address" }, { "internalType": "uint24", "name": "fee", "type": "uint24" }, { "internalType": "int24", "name": "tickLower", "type": "int24" }, { "internalType": "int24", "name": "tickUpper", "type": "int24" }, { "internalType": "uint256", "name": "amount0Desired", "type": "uint256" }, { "internalType": "uint256", "name": "amount1Desired", "type": "uint256" }, { "internalType": "uint256", "name": "amount0Min", "type": "uint256" }, { "internalType": "uint256", "name": "amount1Min", "type": "uint256" }, { "internalType": "address", "name": "recipient", "type": "address" }, { "internalType": "uint256", "name": "deadline", "type": "uint256" } ], "internalType": "struct INonfungiblePositionManager.MintParams", "name": "params", "type": "tuple" } ], "name": "mint", "outputs": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "internalType": "uint128", "name": "liquidity", "type": "uint128" }, { "internalType": "uint256", "name": "amount0", "type": "uint256" }, { "internalType": "uint256", "name": "amount1", "type": "uint256" } ], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "bytes[]", "name": "data", "type": "bytes[]" } ], "name": "multicall", "outputs": [ { "internalType": "bytes[]", "name": "results", "type": "bytes[]" } ], "stateMutability": "payable", "type": "function" }, { "inputs": [], "name": "name", "outputs": [ { "internalType": "string", "name": "", "type": "string" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "ownerOf", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "spender", "type": "address" }, { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "internalType": "uint256", "name": "deadline", "type": "uint256" }, { "internalType": "uint8", "name": "v", "type": "uint8" }, { "internalType": "bytes32", "name": "r", "type": "bytes32" }, { "internalType": "bytes32", "name": "s", "type": "bytes32" } ], "name": "permit", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "positions", "outputs": [ { "internalType": "uint96", "name": "nonce", "type": "uint96" }, { "internalType": "address", "name": "operator", "type": "address" }, { "internalType": "address", "name": "token0", "type": "address" }, { "internalType": "address", "name": "token1", "type": "address" }, { "internalType": "uint24", "name": "fee", "type": "uint24" }, { "internalType": "int24", "name": "tickLower", "type": "int24" }, { "internalType": "int24", "name": "tickUpper", "type": "int24" }, { "internalType": "uint128", "name": "liquidity", "type": "uint128" }, { "internalType": "uint256", "name": "feeGrowthInside0LastX128", "type": "uint256" }, { "internalType": "uint256", "name": "feeGrowthInside1LastX128", "type": "uint256" }, { "internalType": "uint128", "name": "tokensOwed0", "type": "uint128" }, { "internalType": "uint128", "name": "tokensOwed1", "type": "uint128" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "refundETH", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "from", "type": "address" }, { "internalType": "address", "name": "to", "type": "address" }, { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "safeTransferFrom", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "from", "type": "address" }, { "internalType": "address", "name": "to", "type": "address" }, { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "internalType": "bytes", "name": "_data", "type": "bytes" } ], "name": "safeTransferFrom", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "token", "type": "address" }, { "internalType": "uint256", "name": "value", "type": "uint256" }, { "internalType": "uint256", "name": "deadline", "type": "uint256" }, { "internalType": "uint8", "name": "v", "type": "uint8" }, { "internalType": "bytes32", "name": "r", "type": "bytes32" }, { "internalType": "bytes32", "name": "s", "type": "bytes32" } ], "name": "selfPermit", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "token", "type": "address" }, { "internalType": "uint256", "name": "nonce", "type": "uint256" }, { "internalType": "uint256", "name": "expiry", "type": "uint256" }, { "internalType": "uint8", "name": "v", "type": "uint8" }, { "internalType": "bytes32", "name": "r", "type": "bytes32" }, { "internalType": "bytes32", "name": "s", "type": "bytes32" } ], "name": "selfPermitAllowed", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "token", "type": "address" }, { "internalType": "uint256", "name": "nonce", "type": "uint256" }, { "internalType": "uint256", "name": "expiry", "type": "uint256" }, { "internalType": "uint8", "name": "v", "type": "uint8" }, { "internalType": "bytes32", "name": "r", "type": "bytes32" }, { "internalType": "bytes32", "name": "s", "type": "bytes32" } ], "name": "selfPermitAllowedIfNecessary", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "token", "type": "address" }, { "internalType": "uint256", "name": "value", "type": "uint256" }, { "internalType": "uint256", "name": "deadline", "type": "uint256" }, { "internalType": "uint8", "name": "v", "type": "uint8" }, { "internalType": "bytes32", "name": "r", "type": "bytes32" }, { "internalType": "bytes32", "name": "s", "type": "bytes32" } ], "name": "selfPermitIfNecessary", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "operator", "type": "address" }, { "internalType": "bool", "name": "approved", "type": "bool" } ], "name": "setApprovalForAll", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "bytes4", "name": "interfaceId", "type": "bytes4" } ], "name": "supportsInterface", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "token", "type": "address" }, { "internalType": "uint256", "name": "amountMinimum", "type": "uint256" }, { "internalType": "address", "name": "recipient", "type": "address" } ], "name": "sweepToken", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [], "name": "symbol", "outputs": [ { "internalType": "string", "name": "", "type": "string" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "index", "type": "uint256" } ], "name": "tokenByIndex", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "owner", "type": "address" }, { "internalType": "uint256", "name": "index", "type": "uint256" } ], "name": "tokenOfOwnerByIndex", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "tokenURI", "outputs": [ { "internalType": "string", "name": "", "type": "string" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "totalSupply", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "from", "type": "address" }, { "internalType": "address", "name": "to", "type": "address" }, { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "transferFrom", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "amount0Owed", "type": "uint256" }, { "internalType": "uint256", "name": "amount1Owed", "type": "uint256" }, { "internalType": "bytes", "name": "data", "type": "bytes" } ], "name": "uniswapV3MintCallback", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "amountMinimum", "type": "uint256" }, { "internalType": "address", "name": "recipient", "type": "address" } ], "name": "unwrapWETH9", "outputs": [], "stateMutability": "payable", "type": "function" }, { "stateMutability": "payable", "type": "receive" } ] ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/binds/basenonfungiblepositionmanager/NonfungiblePositionManager.go ================================================ // Code generated - DO NOT EDIT. // This file is a generated binding and any manual changes will be lost. package basenonfungiblepositionmanager import ( "errors" "math/big" "strings" ethereum "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/event" ) // Reference imports to suppress errors if they are not otherwise used. var ( _ = errors.New _ = big.NewInt _ = strings.NewReader _ = ethereum.NotFound _ = bind.Bind _ = common.Big1 _ = types.BloomLookup _ = event.NewSubscription _ = abi.ConvertType ) // INonfungiblePositionManagerCollectParams is an auto generated low-level Go binding around an user-defined struct. type INonfungiblePositionManagerCollectParams struct { TokenId *big.Int Recipient common.Address Amount0Max *big.Int Amount1Max *big.Int } // INonfungiblePositionManagerDecreaseLiquidityParams is an auto generated low-level Go binding around an user-defined struct. type INonfungiblePositionManagerDecreaseLiquidityParams struct { TokenId *big.Int Liquidity *big.Int Amount0Min *big.Int Amount1Min *big.Int Deadline *big.Int } // INonfungiblePositionManagerIncreaseLiquidityParams is an auto generated low-level Go binding around an user-defined struct. type INonfungiblePositionManagerIncreaseLiquidityParams struct { TokenId *big.Int Amount0Desired *big.Int Amount1Desired *big.Int Amount0Min *big.Int Amount1Min *big.Int Deadline *big.Int } // INonfungiblePositionManagerMintParams is an auto generated low-level Go binding around an user-defined struct. type INonfungiblePositionManagerMintParams struct { Token0 common.Address Token1 common.Address Fee *big.Int TickLower *big.Int TickUpper *big.Int Amount0Desired *big.Int Amount1Desired *big.Int Amount0Min *big.Int Amount1Min *big.Int Recipient common.Address Deadline *big.Int } // NonfungiblePositionManagerMetaData contains all meta data concerning the NonfungiblePositionManager contract. var NonfungiblePositionManagerMetaData = &bind.MetaData{ ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_factory\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_WETH9\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_tokenDescriptor_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"approved\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"ApprovalForAll\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"}],\"name\":\"Collect\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"liquidity\",\"type\":\"uint128\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"}],\"name\":\"DecreaseLiquidity\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"liquidity\",\"type\":\"uint128\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"}],\"name\":\"IncreaseLiquidity\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"DOMAIN_SEPARATOR\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"PERMIT_TYPEHASH\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"WETH9\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"baseURI\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"burn\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint128\",\"name\":\"amount0Max\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"amount1Max\",\"type\":\"uint128\"}],\"internalType\":\"structINonfungiblePositionManager.CollectParams\",\"name\":\"params\",\"type\":\"tuple\"}],\"name\":\"collect\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token0\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token1\",\"type\":\"address\"},{\"internalType\":\"uint24\",\"name\":\"fee\",\"type\":\"uint24\"},{\"internalType\":\"uint160\",\"name\":\"sqrtPriceX96\",\"type\":\"uint160\"}],\"name\":\"createAndInitializePoolIfNecessary\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint128\",\"name\":\"liquidity\",\"type\":\"uint128\"},{\"internalType\":\"uint256\",\"name\":\"amount0Min\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Min\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"}],\"internalType\":\"structINonfungiblePositionManager.DecreaseLiquidityParams\",\"name\":\"params\",\"type\":\"tuple\"}],\"name\":\"decreaseLiquidity\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"factory\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"getApproved\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount0Desired\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Desired\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount0Min\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Min\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"}],\"internalType\":\"structINonfungiblePositionManager.IncreaseLiquidityParams\",\"name\":\"params\",\"type\":\"tuple\"}],\"name\":\"increaseLiquidity\",\"outputs\":[{\"internalType\":\"uint128\",\"name\":\"liquidity\",\"type\":\"uint128\"},{\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"name\":\"isApprovedForAll\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"token0\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token1\",\"type\":\"address\"},{\"internalType\":\"uint24\",\"name\":\"fee\",\"type\":\"uint24\"},{\"internalType\":\"int24\",\"name\":\"tickLower\",\"type\":\"int24\"},{\"internalType\":\"int24\",\"name\":\"tickUpper\",\"type\":\"int24\"},{\"internalType\":\"uint256\",\"name\":\"amount0Desired\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Desired\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount0Min\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Min\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"}],\"internalType\":\"structINonfungiblePositionManager.MintParams\",\"name\":\"params\",\"type\":\"tuple\"}],\"name\":\"mint\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint128\",\"name\":\"liquidity\",\"type\":\"uint128\"},{\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes[]\",\"name\":\"data\",\"type\":\"bytes[]\"}],\"name\":\"multicall\",\"outputs\":[{\"internalType\":\"bytes[]\",\"name\":\"results\",\"type\":\"bytes[]\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"ownerOf\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"permit\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"positions\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"nonce\",\"type\":\"uint96\"},{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token0\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token1\",\"type\":\"address\"},{\"internalType\":\"uint24\",\"name\":\"fee\",\"type\":\"uint24\"},{\"internalType\":\"int24\",\"name\":\"tickLower\",\"type\":\"int24\"},{\"internalType\":\"int24\",\"name\":\"tickUpper\",\"type\":\"int24\"},{\"internalType\":\"uint128\",\"name\":\"liquidity\",\"type\":\"uint128\"},{\"internalType\":\"uint256\",\"name\":\"feeGrowthInside0LastX128\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"feeGrowthInside1LastX128\",\"type\":\"uint256\"},{\"internalType\":\"uint128\",\"name\":\"tokensOwed0\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"tokensOwed1\",\"type\":\"uint128\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"refundETH\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"safeTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"safeTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"selfPermit\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiry\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"selfPermitAllowed\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiry\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"selfPermitAllowedIfNecessary\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"selfPermitIfNecessary\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"setApprovalForAll\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amountMinimum\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"}],\"name\":\"sweepToken\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"}],\"name\":\"tokenByIndex\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"}],\"name\":\"tokenOfOwnerByIndex\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"tokenURI\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0Owed\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Owed\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"uniswapV3MintCallback\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountMinimum\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"}],\"name\":\"unwrapWETH9\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]", } // NonfungiblePositionManagerABI is the input ABI used to generate the binding from. // Deprecated: Use NonfungiblePositionManagerMetaData.ABI instead. var NonfungiblePositionManagerABI = NonfungiblePositionManagerMetaData.ABI // NonfungiblePositionManager is an auto generated Go binding around an Ethereum contract. type NonfungiblePositionManager struct { NonfungiblePositionManagerCaller // Read-only binding to the contract NonfungiblePositionManagerTransactor // Write-only binding to the contract NonfungiblePositionManagerFilterer // Log filterer for contract events } // NonfungiblePositionManagerCaller is an auto generated read-only Go binding around an Ethereum contract. type NonfungiblePositionManagerCaller struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // NonfungiblePositionManagerTransactor is an auto generated write-only Go binding around an Ethereum contract. type NonfungiblePositionManagerTransactor struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // NonfungiblePositionManagerFilterer is an auto generated log filtering Go binding around an Ethereum contract events. type NonfungiblePositionManagerFilterer struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // NonfungiblePositionManagerSession is an auto generated Go binding around an Ethereum contract, // with pre-set call and transact options. type NonfungiblePositionManagerSession struct { Contract *NonfungiblePositionManager // Generic contract binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // NonfungiblePositionManagerCallerSession is an auto generated read-only Go binding around an Ethereum contract, // with pre-set call options. type NonfungiblePositionManagerCallerSession struct { Contract *NonfungiblePositionManagerCaller // Generic contract caller binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session } // NonfungiblePositionManagerTransactorSession is an auto generated write-only Go binding around an Ethereum contract, // with pre-set transact options. type NonfungiblePositionManagerTransactorSession struct { Contract *NonfungiblePositionManagerTransactor // Generic contract transactor binding to set the session for TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // NonfungiblePositionManagerRaw is an auto generated low-level Go binding around an Ethereum contract. type NonfungiblePositionManagerRaw struct { Contract *NonfungiblePositionManager // Generic contract binding to access the raw methods on } // NonfungiblePositionManagerCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. type NonfungiblePositionManagerCallerRaw struct { Contract *NonfungiblePositionManagerCaller // Generic read-only contract binding to access the raw methods on } // NonfungiblePositionManagerTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. type NonfungiblePositionManagerTransactorRaw struct { Contract *NonfungiblePositionManagerTransactor // Generic write-only contract binding to access the raw methods on } // NewNonfungiblePositionManager creates a new instance of NonfungiblePositionManager, bound to a specific deployed contract. func NewNonfungiblePositionManager(address common.Address, backend bind.ContractBackend) (*NonfungiblePositionManager, error) { contract, err := bindNonfungiblePositionManager(address, backend, backend, backend) if err != nil { return nil, err } return &NonfungiblePositionManager{NonfungiblePositionManagerCaller: NonfungiblePositionManagerCaller{contract: contract}, NonfungiblePositionManagerTransactor: NonfungiblePositionManagerTransactor{contract: contract}, NonfungiblePositionManagerFilterer: NonfungiblePositionManagerFilterer{contract: contract}}, nil } // NewNonfungiblePositionManagerCaller creates a new read-only instance of NonfungiblePositionManager, bound to a specific deployed contract. func NewNonfungiblePositionManagerCaller(address common.Address, caller bind.ContractCaller) (*NonfungiblePositionManagerCaller, error) { contract, err := bindNonfungiblePositionManager(address, caller, nil, nil) if err != nil { return nil, err } return &NonfungiblePositionManagerCaller{contract: contract}, nil } // NewNonfungiblePositionManagerTransactor creates a new write-only instance of NonfungiblePositionManager, bound to a specific deployed contract. func NewNonfungiblePositionManagerTransactor(address common.Address, transactor bind.ContractTransactor) (*NonfungiblePositionManagerTransactor, error) { contract, err := bindNonfungiblePositionManager(address, nil, transactor, nil) if err != nil { return nil, err } return &NonfungiblePositionManagerTransactor{contract: contract}, nil } // NewNonfungiblePositionManagerFilterer creates a new log filterer instance of NonfungiblePositionManager, bound to a specific deployed contract. func NewNonfungiblePositionManagerFilterer(address common.Address, filterer bind.ContractFilterer) (*NonfungiblePositionManagerFilterer, error) { contract, err := bindNonfungiblePositionManager(address, nil, nil, filterer) if err != nil { return nil, err } return &NonfungiblePositionManagerFilterer{contract: contract}, nil } // bindNonfungiblePositionManager binds a generic wrapper to an already deployed contract. func bindNonfungiblePositionManager(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { parsed, err := NonfungiblePositionManagerMetaData.GetAbi() if err != nil { return nil, err } return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_NonfungiblePositionManager *NonfungiblePositionManagerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _NonfungiblePositionManager.Contract.NonfungiblePositionManagerCaller.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_NonfungiblePositionManager *NonfungiblePositionManagerRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.NonfungiblePositionManagerTransactor.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_NonfungiblePositionManager *NonfungiblePositionManagerRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.NonfungiblePositionManagerTransactor.contract.Transact(opts, method, params...) } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _NonfungiblePositionManager.Contract.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.contract.Transact(opts, method, params...) } // DOMAINSEPARATOR is a free data retrieval call binding the contract method 0x3644e515. // // Solidity: function DOMAIN_SEPARATOR() view returns(bytes32) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) DOMAINSEPARATOR(opts *bind.CallOpts) ([32]byte, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "DOMAIN_SEPARATOR") if err != nil { return *new([32]byte), err } out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) return out0, err } // DOMAINSEPARATOR is a free data retrieval call binding the contract method 0x3644e515. // // Solidity: function DOMAIN_SEPARATOR() view returns(bytes32) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) DOMAINSEPARATOR() ([32]byte, error) { return _NonfungiblePositionManager.Contract.DOMAINSEPARATOR(&_NonfungiblePositionManager.CallOpts) } // DOMAINSEPARATOR is a free data retrieval call binding the contract method 0x3644e515. // // Solidity: function DOMAIN_SEPARATOR() view returns(bytes32) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) DOMAINSEPARATOR() ([32]byte, error) { return _NonfungiblePositionManager.Contract.DOMAINSEPARATOR(&_NonfungiblePositionManager.CallOpts) } // PERMITTYPEHASH is a free data retrieval call binding the contract method 0x30adf81f. // // Solidity: function PERMIT_TYPEHASH() view returns(bytes32) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) PERMITTYPEHASH(opts *bind.CallOpts) ([32]byte, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "PERMIT_TYPEHASH") if err != nil { return *new([32]byte), err } out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) return out0, err } // PERMITTYPEHASH is a free data retrieval call binding the contract method 0x30adf81f. // // Solidity: function PERMIT_TYPEHASH() view returns(bytes32) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) PERMITTYPEHASH() ([32]byte, error) { return _NonfungiblePositionManager.Contract.PERMITTYPEHASH(&_NonfungiblePositionManager.CallOpts) } // PERMITTYPEHASH is a free data retrieval call binding the contract method 0x30adf81f. // // Solidity: function PERMIT_TYPEHASH() view returns(bytes32) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) PERMITTYPEHASH() ([32]byte, error) { return _NonfungiblePositionManager.Contract.PERMITTYPEHASH(&_NonfungiblePositionManager.CallOpts) } // WETH9 is a free data retrieval call binding the contract method 0x4aa4a4fc. // // Solidity: function WETH9() view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) WETH9(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "WETH9") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // WETH9 is a free data retrieval call binding the contract method 0x4aa4a4fc. // // Solidity: function WETH9() view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) WETH9() (common.Address, error) { return _NonfungiblePositionManager.Contract.WETH9(&_NonfungiblePositionManager.CallOpts) } // WETH9 is a free data retrieval call binding the contract method 0x4aa4a4fc. // // Solidity: function WETH9() view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) WETH9() (common.Address, error) { return _NonfungiblePositionManager.Contract.WETH9(&_NonfungiblePositionManager.CallOpts) } // BalanceOf is a free data retrieval call binding the contract method 0x70a08231. // // Solidity: function balanceOf(address owner) view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) BalanceOf(opts *bind.CallOpts, owner common.Address) (*big.Int, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "balanceOf", owner) if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // BalanceOf is a free data retrieval call binding the contract method 0x70a08231. // // Solidity: function balanceOf(address owner) view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) BalanceOf(owner common.Address) (*big.Int, error) { return _NonfungiblePositionManager.Contract.BalanceOf(&_NonfungiblePositionManager.CallOpts, owner) } // BalanceOf is a free data retrieval call binding the contract method 0x70a08231. // // Solidity: function balanceOf(address owner) view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) BalanceOf(owner common.Address) (*big.Int, error) { return _NonfungiblePositionManager.Contract.BalanceOf(&_NonfungiblePositionManager.CallOpts, owner) } // BaseURI is a free data retrieval call binding the contract method 0x6c0360eb. // // Solidity: function baseURI() pure returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) BaseURI(opts *bind.CallOpts) (string, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "baseURI") if err != nil { return *new(string), err } out0 := *abi.ConvertType(out[0], new(string)).(*string) return out0, err } // BaseURI is a free data retrieval call binding the contract method 0x6c0360eb. // // Solidity: function baseURI() pure returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) BaseURI() (string, error) { return _NonfungiblePositionManager.Contract.BaseURI(&_NonfungiblePositionManager.CallOpts) } // BaseURI is a free data retrieval call binding the contract method 0x6c0360eb. // // Solidity: function baseURI() pure returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) BaseURI() (string, error) { return _NonfungiblePositionManager.Contract.BaseURI(&_NonfungiblePositionManager.CallOpts) } // Factory is a free data retrieval call binding the contract method 0xc45a0155. // // Solidity: function factory() view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) Factory(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "factory") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // Factory is a free data retrieval call binding the contract method 0xc45a0155. // // Solidity: function factory() view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Factory() (common.Address, error) { return _NonfungiblePositionManager.Contract.Factory(&_NonfungiblePositionManager.CallOpts) } // Factory is a free data retrieval call binding the contract method 0xc45a0155. // // Solidity: function factory() view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) Factory() (common.Address, error) { return _NonfungiblePositionManager.Contract.Factory(&_NonfungiblePositionManager.CallOpts) } // GetApproved is a free data retrieval call binding the contract method 0x081812fc. // // Solidity: function getApproved(uint256 tokenId) view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) GetApproved(opts *bind.CallOpts, tokenId *big.Int) (common.Address, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "getApproved", tokenId) if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // GetApproved is a free data retrieval call binding the contract method 0x081812fc. // // Solidity: function getApproved(uint256 tokenId) view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) GetApproved(tokenId *big.Int) (common.Address, error) { return _NonfungiblePositionManager.Contract.GetApproved(&_NonfungiblePositionManager.CallOpts, tokenId) } // GetApproved is a free data retrieval call binding the contract method 0x081812fc. // // Solidity: function getApproved(uint256 tokenId) view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) GetApproved(tokenId *big.Int) (common.Address, error) { return _NonfungiblePositionManager.Contract.GetApproved(&_NonfungiblePositionManager.CallOpts, tokenId) } // IsApprovedForAll is a free data retrieval call binding the contract method 0xe985e9c5. // // Solidity: function isApprovedForAll(address owner, address operator) view returns(bool) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) IsApprovedForAll(opts *bind.CallOpts, owner common.Address, operator common.Address) (bool, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "isApprovedForAll", owner, operator) if err != nil { return *new(bool), err } out0 := *abi.ConvertType(out[0], new(bool)).(*bool) return out0, err } // IsApprovedForAll is a free data retrieval call binding the contract method 0xe985e9c5. // // Solidity: function isApprovedForAll(address owner, address operator) view returns(bool) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) IsApprovedForAll(owner common.Address, operator common.Address) (bool, error) { return _NonfungiblePositionManager.Contract.IsApprovedForAll(&_NonfungiblePositionManager.CallOpts, owner, operator) } // IsApprovedForAll is a free data retrieval call binding the contract method 0xe985e9c5. // // Solidity: function isApprovedForAll(address owner, address operator) view returns(bool) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) IsApprovedForAll(owner common.Address, operator common.Address) (bool, error) { return _NonfungiblePositionManager.Contract.IsApprovedForAll(&_NonfungiblePositionManager.CallOpts, owner, operator) } // Name is a free data retrieval call binding the contract method 0x06fdde03. // // Solidity: function name() view returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) Name(opts *bind.CallOpts) (string, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "name") if err != nil { return *new(string), err } out0 := *abi.ConvertType(out[0], new(string)).(*string) return out0, err } // Name is a free data retrieval call binding the contract method 0x06fdde03. // // Solidity: function name() view returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Name() (string, error) { return _NonfungiblePositionManager.Contract.Name(&_NonfungiblePositionManager.CallOpts) } // Name is a free data retrieval call binding the contract method 0x06fdde03. // // Solidity: function name() view returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) Name() (string, error) { return _NonfungiblePositionManager.Contract.Name(&_NonfungiblePositionManager.CallOpts) } // OwnerOf is a free data retrieval call binding the contract method 0x6352211e. // // Solidity: function ownerOf(uint256 tokenId) view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) OwnerOf(opts *bind.CallOpts, tokenId *big.Int) (common.Address, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "ownerOf", tokenId) if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // OwnerOf is a free data retrieval call binding the contract method 0x6352211e. // // Solidity: function ownerOf(uint256 tokenId) view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) OwnerOf(tokenId *big.Int) (common.Address, error) { return _NonfungiblePositionManager.Contract.OwnerOf(&_NonfungiblePositionManager.CallOpts, tokenId) } // OwnerOf is a free data retrieval call binding the contract method 0x6352211e. // // Solidity: function ownerOf(uint256 tokenId) view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) OwnerOf(tokenId *big.Int) (common.Address, error) { return _NonfungiblePositionManager.Contract.OwnerOf(&_NonfungiblePositionManager.CallOpts, tokenId) } // Positions is a free data retrieval call binding the contract method 0x99fbab88. // // Solidity: function positions(uint256 tokenId) view returns(uint96 nonce, address operator, address token0, address token1, uint24 fee, int24 tickLower, int24 tickUpper, uint128 liquidity, uint256 feeGrowthInside0LastX128, uint256 feeGrowthInside1LastX128, uint128 tokensOwed0, uint128 tokensOwed1) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) Positions(opts *bind.CallOpts, tokenId *big.Int) (struct { Nonce *big.Int Operator common.Address Token0 common.Address Token1 common.Address Fee *big.Int TickLower *big.Int TickUpper *big.Int Liquidity *big.Int FeeGrowthInside0LastX128 *big.Int FeeGrowthInside1LastX128 *big.Int TokensOwed0 *big.Int TokensOwed1 *big.Int }, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "positions", tokenId) outstruct := new(struct { Nonce *big.Int Operator common.Address Token0 common.Address Token1 common.Address Fee *big.Int TickLower *big.Int TickUpper *big.Int Liquidity *big.Int FeeGrowthInside0LastX128 *big.Int FeeGrowthInside1LastX128 *big.Int TokensOwed0 *big.Int TokensOwed1 *big.Int }) if err != nil { return *outstruct, err } outstruct.Nonce = *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) outstruct.Operator = *abi.ConvertType(out[1], new(common.Address)).(*common.Address) outstruct.Token0 = *abi.ConvertType(out[2], new(common.Address)).(*common.Address) outstruct.Token1 = *abi.ConvertType(out[3], new(common.Address)).(*common.Address) outstruct.Fee = *abi.ConvertType(out[4], new(*big.Int)).(**big.Int) outstruct.TickLower = *abi.ConvertType(out[5], new(*big.Int)).(**big.Int) outstruct.TickUpper = *abi.ConvertType(out[6], new(*big.Int)).(**big.Int) outstruct.Liquidity = *abi.ConvertType(out[7], new(*big.Int)).(**big.Int) outstruct.FeeGrowthInside0LastX128 = *abi.ConvertType(out[8], new(*big.Int)).(**big.Int) outstruct.FeeGrowthInside1LastX128 = *abi.ConvertType(out[9], new(*big.Int)).(**big.Int) outstruct.TokensOwed0 = *abi.ConvertType(out[10], new(*big.Int)).(**big.Int) outstruct.TokensOwed1 = *abi.ConvertType(out[11], new(*big.Int)).(**big.Int) return *outstruct, err } // Positions is a free data retrieval call binding the contract method 0x99fbab88. // // Solidity: function positions(uint256 tokenId) view returns(uint96 nonce, address operator, address token0, address token1, uint24 fee, int24 tickLower, int24 tickUpper, uint128 liquidity, uint256 feeGrowthInside0LastX128, uint256 feeGrowthInside1LastX128, uint128 tokensOwed0, uint128 tokensOwed1) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Positions(tokenId *big.Int) (struct { Nonce *big.Int Operator common.Address Token0 common.Address Token1 common.Address Fee *big.Int TickLower *big.Int TickUpper *big.Int Liquidity *big.Int FeeGrowthInside0LastX128 *big.Int FeeGrowthInside1LastX128 *big.Int TokensOwed0 *big.Int TokensOwed1 *big.Int }, error) { return _NonfungiblePositionManager.Contract.Positions(&_NonfungiblePositionManager.CallOpts, tokenId) } // Positions is a free data retrieval call binding the contract method 0x99fbab88. // // Solidity: function positions(uint256 tokenId) view returns(uint96 nonce, address operator, address token0, address token1, uint24 fee, int24 tickLower, int24 tickUpper, uint128 liquidity, uint256 feeGrowthInside0LastX128, uint256 feeGrowthInside1LastX128, uint128 tokensOwed0, uint128 tokensOwed1) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) Positions(tokenId *big.Int) (struct { Nonce *big.Int Operator common.Address Token0 common.Address Token1 common.Address Fee *big.Int TickLower *big.Int TickUpper *big.Int Liquidity *big.Int FeeGrowthInside0LastX128 *big.Int FeeGrowthInside1LastX128 *big.Int TokensOwed0 *big.Int TokensOwed1 *big.Int }, error) { return _NonfungiblePositionManager.Contract.Positions(&_NonfungiblePositionManager.CallOpts, tokenId) } // SupportsInterface is a free data retrieval call binding the contract method 0x01ffc9a7. // // Solidity: function supportsInterface(bytes4 interfaceId) view returns(bool) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) SupportsInterface(opts *bind.CallOpts, interfaceId [4]byte) (bool, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "supportsInterface", interfaceId) if err != nil { return *new(bool), err } out0 := *abi.ConvertType(out[0], new(bool)).(*bool) return out0, err } // SupportsInterface is a free data retrieval call binding the contract method 0x01ffc9a7. // // Solidity: function supportsInterface(bytes4 interfaceId) view returns(bool) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) SupportsInterface(interfaceId [4]byte) (bool, error) { return _NonfungiblePositionManager.Contract.SupportsInterface(&_NonfungiblePositionManager.CallOpts, interfaceId) } // SupportsInterface is a free data retrieval call binding the contract method 0x01ffc9a7. // // Solidity: function supportsInterface(bytes4 interfaceId) view returns(bool) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) SupportsInterface(interfaceId [4]byte) (bool, error) { return _NonfungiblePositionManager.Contract.SupportsInterface(&_NonfungiblePositionManager.CallOpts, interfaceId) } // Symbol is a free data retrieval call binding the contract method 0x95d89b41. // // Solidity: function symbol() view returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) Symbol(opts *bind.CallOpts) (string, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "symbol") if err != nil { return *new(string), err } out0 := *abi.ConvertType(out[0], new(string)).(*string) return out0, err } // Symbol is a free data retrieval call binding the contract method 0x95d89b41. // // Solidity: function symbol() view returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Symbol() (string, error) { return _NonfungiblePositionManager.Contract.Symbol(&_NonfungiblePositionManager.CallOpts) } // Symbol is a free data retrieval call binding the contract method 0x95d89b41. // // Solidity: function symbol() view returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) Symbol() (string, error) { return _NonfungiblePositionManager.Contract.Symbol(&_NonfungiblePositionManager.CallOpts) } // TokenByIndex is a free data retrieval call binding the contract method 0x4f6ccce7. // // Solidity: function tokenByIndex(uint256 index) view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) TokenByIndex(opts *bind.CallOpts, index *big.Int) (*big.Int, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "tokenByIndex", index) if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // TokenByIndex is a free data retrieval call binding the contract method 0x4f6ccce7. // // Solidity: function tokenByIndex(uint256 index) view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) TokenByIndex(index *big.Int) (*big.Int, error) { return _NonfungiblePositionManager.Contract.TokenByIndex(&_NonfungiblePositionManager.CallOpts, index) } // TokenByIndex is a free data retrieval call binding the contract method 0x4f6ccce7. // // Solidity: function tokenByIndex(uint256 index) view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) TokenByIndex(index *big.Int) (*big.Int, error) { return _NonfungiblePositionManager.Contract.TokenByIndex(&_NonfungiblePositionManager.CallOpts, index) } // TokenOfOwnerByIndex is a free data retrieval call binding the contract method 0x2f745c59. // // Solidity: function tokenOfOwnerByIndex(address owner, uint256 index) view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) TokenOfOwnerByIndex(opts *bind.CallOpts, owner common.Address, index *big.Int) (*big.Int, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "tokenOfOwnerByIndex", owner, index) if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // TokenOfOwnerByIndex is a free data retrieval call binding the contract method 0x2f745c59. // // Solidity: function tokenOfOwnerByIndex(address owner, uint256 index) view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) TokenOfOwnerByIndex(owner common.Address, index *big.Int) (*big.Int, error) { return _NonfungiblePositionManager.Contract.TokenOfOwnerByIndex(&_NonfungiblePositionManager.CallOpts, owner, index) } // TokenOfOwnerByIndex is a free data retrieval call binding the contract method 0x2f745c59. // // Solidity: function tokenOfOwnerByIndex(address owner, uint256 index) view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) TokenOfOwnerByIndex(owner common.Address, index *big.Int) (*big.Int, error) { return _NonfungiblePositionManager.Contract.TokenOfOwnerByIndex(&_NonfungiblePositionManager.CallOpts, owner, index) } // TokenURI is a free data retrieval call binding the contract method 0xc87b56dd. // // Solidity: function tokenURI(uint256 tokenId) view returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) TokenURI(opts *bind.CallOpts, tokenId *big.Int) (string, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "tokenURI", tokenId) if err != nil { return *new(string), err } out0 := *abi.ConvertType(out[0], new(string)).(*string) return out0, err } // TokenURI is a free data retrieval call binding the contract method 0xc87b56dd. // // Solidity: function tokenURI(uint256 tokenId) view returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) TokenURI(tokenId *big.Int) (string, error) { return _NonfungiblePositionManager.Contract.TokenURI(&_NonfungiblePositionManager.CallOpts, tokenId) } // TokenURI is a free data retrieval call binding the contract method 0xc87b56dd. // // Solidity: function tokenURI(uint256 tokenId) view returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) TokenURI(tokenId *big.Int) (string, error) { return _NonfungiblePositionManager.Contract.TokenURI(&_NonfungiblePositionManager.CallOpts, tokenId) } // TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. // // Solidity: function totalSupply() view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) TotalSupply(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "totalSupply") if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. // // Solidity: function totalSupply() view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) TotalSupply() (*big.Int, error) { return _NonfungiblePositionManager.Contract.TotalSupply(&_NonfungiblePositionManager.CallOpts) } // TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. // // Solidity: function totalSupply() view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) TotalSupply() (*big.Int, error) { return _NonfungiblePositionManager.Contract.TotalSupply(&_NonfungiblePositionManager.CallOpts) } // Approve is a paid mutator transaction binding the contract method 0x095ea7b3. // // Solidity: function approve(address to, uint256 tokenId) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) Approve(opts *bind.TransactOpts, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "approve", to, tokenId) } // Approve is a paid mutator transaction binding the contract method 0x095ea7b3. // // Solidity: function approve(address to, uint256 tokenId) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Approve(to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Approve(&_NonfungiblePositionManager.TransactOpts, to, tokenId) } // Approve is a paid mutator transaction binding the contract method 0x095ea7b3. // // Solidity: function approve(address to, uint256 tokenId) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) Approve(to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Approve(&_NonfungiblePositionManager.TransactOpts, to, tokenId) } // Burn is a paid mutator transaction binding the contract method 0x42966c68. // // Solidity: function burn(uint256 tokenId) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) Burn(opts *bind.TransactOpts, tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "burn", tokenId) } // Burn is a paid mutator transaction binding the contract method 0x42966c68. // // Solidity: function burn(uint256 tokenId) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Burn(tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Burn(&_NonfungiblePositionManager.TransactOpts, tokenId) } // Burn is a paid mutator transaction binding the contract method 0x42966c68. // // Solidity: function burn(uint256 tokenId) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) Burn(tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Burn(&_NonfungiblePositionManager.TransactOpts, tokenId) } // Collect is a paid mutator transaction binding the contract method 0xfc6f7865. // // Solidity: function collect((uint256,address,uint128,uint128) params) payable returns(uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) Collect(opts *bind.TransactOpts, params INonfungiblePositionManagerCollectParams) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "collect", params) } // Collect is a paid mutator transaction binding the contract method 0xfc6f7865. // // Solidity: function collect((uint256,address,uint128,uint128) params) payable returns(uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Collect(params INonfungiblePositionManagerCollectParams) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Collect(&_NonfungiblePositionManager.TransactOpts, params) } // Collect is a paid mutator transaction binding the contract method 0xfc6f7865. // // Solidity: function collect((uint256,address,uint128,uint128) params) payable returns(uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) Collect(params INonfungiblePositionManagerCollectParams) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Collect(&_NonfungiblePositionManager.TransactOpts, params) } // CreateAndInitializePoolIfNecessary is a paid mutator transaction binding the contract method 0x13ead562. // // Solidity: function createAndInitializePoolIfNecessary(address token0, address token1, uint24 fee, uint160 sqrtPriceX96) payable returns(address pool) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) CreateAndInitializePoolIfNecessary(opts *bind.TransactOpts, token0 common.Address, token1 common.Address, fee *big.Int, sqrtPriceX96 *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "createAndInitializePoolIfNecessary", token0, token1, fee, sqrtPriceX96) } // CreateAndInitializePoolIfNecessary is a paid mutator transaction binding the contract method 0x13ead562. // // Solidity: function createAndInitializePoolIfNecessary(address token0, address token1, uint24 fee, uint160 sqrtPriceX96) payable returns(address pool) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) CreateAndInitializePoolIfNecessary(token0 common.Address, token1 common.Address, fee *big.Int, sqrtPriceX96 *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.CreateAndInitializePoolIfNecessary(&_NonfungiblePositionManager.TransactOpts, token0, token1, fee, sqrtPriceX96) } // CreateAndInitializePoolIfNecessary is a paid mutator transaction binding the contract method 0x13ead562. // // Solidity: function createAndInitializePoolIfNecessary(address token0, address token1, uint24 fee, uint160 sqrtPriceX96) payable returns(address pool) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) CreateAndInitializePoolIfNecessary(token0 common.Address, token1 common.Address, fee *big.Int, sqrtPriceX96 *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.CreateAndInitializePoolIfNecessary(&_NonfungiblePositionManager.TransactOpts, token0, token1, fee, sqrtPriceX96) } // DecreaseLiquidity is a paid mutator transaction binding the contract method 0x0c49ccbe. // // Solidity: function decreaseLiquidity((uint256,uint128,uint256,uint256,uint256) params) payable returns(uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) DecreaseLiquidity(opts *bind.TransactOpts, params INonfungiblePositionManagerDecreaseLiquidityParams) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "decreaseLiquidity", params) } // DecreaseLiquidity is a paid mutator transaction binding the contract method 0x0c49ccbe. // // Solidity: function decreaseLiquidity((uint256,uint128,uint256,uint256,uint256) params) payable returns(uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) DecreaseLiquidity(params INonfungiblePositionManagerDecreaseLiquidityParams) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.DecreaseLiquidity(&_NonfungiblePositionManager.TransactOpts, params) } // DecreaseLiquidity is a paid mutator transaction binding the contract method 0x0c49ccbe. // // Solidity: function decreaseLiquidity((uint256,uint128,uint256,uint256,uint256) params) payable returns(uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) DecreaseLiquidity(params INonfungiblePositionManagerDecreaseLiquidityParams) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.DecreaseLiquidity(&_NonfungiblePositionManager.TransactOpts, params) } // IncreaseLiquidity is a paid mutator transaction binding the contract method 0x219f5d17. // // Solidity: function increaseLiquidity((uint256,uint256,uint256,uint256,uint256,uint256) params) payable returns(uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) IncreaseLiquidity(opts *bind.TransactOpts, params INonfungiblePositionManagerIncreaseLiquidityParams) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "increaseLiquidity", params) } // IncreaseLiquidity is a paid mutator transaction binding the contract method 0x219f5d17. // // Solidity: function increaseLiquidity((uint256,uint256,uint256,uint256,uint256,uint256) params) payable returns(uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) IncreaseLiquidity(params INonfungiblePositionManagerIncreaseLiquidityParams) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.IncreaseLiquidity(&_NonfungiblePositionManager.TransactOpts, params) } // IncreaseLiquidity is a paid mutator transaction binding the contract method 0x219f5d17. // // Solidity: function increaseLiquidity((uint256,uint256,uint256,uint256,uint256,uint256) params) payable returns(uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) IncreaseLiquidity(params INonfungiblePositionManagerIncreaseLiquidityParams) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.IncreaseLiquidity(&_NonfungiblePositionManager.TransactOpts, params) } // Mint is a paid mutator transaction binding the contract method 0x88316456. // // Solidity: function mint((address,address,uint24,int24,int24,uint256,uint256,uint256,uint256,address,uint256) params) payable returns(uint256 tokenId, uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) Mint(opts *bind.TransactOpts, params INonfungiblePositionManagerMintParams) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "mint", params) } // Mint is a paid mutator transaction binding the contract method 0x88316456. // // Solidity: function mint((address,address,uint24,int24,int24,uint256,uint256,uint256,uint256,address,uint256) params) payable returns(uint256 tokenId, uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Mint(params INonfungiblePositionManagerMintParams) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Mint(&_NonfungiblePositionManager.TransactOpts, params) } // Mint is a paid mutator transaction binding the contract method 0x88316456. // // Solidity: function mint((address,address,uint24,int24,int24,uint256,uint256,uint256,uint256,address,uint256) params) payable returns(uint256 tokenId, uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) Mint(params INonfungiblePositionManagerMintParams) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Mint(&_NonfungiblePositionManager.TransactOpts, params) } // Multicall is a paid mutator transaction binding the contract method 0xac9650d8. // // Solidity: function multicall(bytes[] data) payable returns(bytes[] results) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) Multicall(opts *bind.TransactOpts, data [][]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "multicall", data) } // Multicall is a paid mutator transaction binding the contract method 0xac9650d8. // // Solidity: function multicall(bytes[] data) payable returns(bytes[] results) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Multicall(data [][]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Multicall(&_NonfungiblePositionManager.TransactOpts, data) } // Multicall is a paid mutator transaction binding the contract method 0xac9650d8. // // Solidity: function multicall(bytes[] data) payable returns(bytes[] results) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) Multicall(data [][]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Multicall(&_NonfungiblePositionManager.TransactOpts, data) } // Permit is a paid mutator transaction binding the contract method 0x7ac2ff7b. // // Solidity: function permit(address spender, uint256 tokenId, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) Permit(opts *bind.TransactOpts, spender common.Address, tokenId *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "permit", spender, tokenId, deadline, v, r, s) } // Permit is a paid mutator transaction binding the contract method 0x7ac2ff7b. // // Solidity: function permit(address spender, uint256 tokenId, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Permit(spender common.Address, tokenId *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Permit(&_NonfungiblePositionManager.TransactOpts, spender, tokenId, deadline, v, r, s) } // Permit is a paid mutator transaction binding the contract method 0x7ac2ff7b. // // Solidity: function permit(address spender, uint256 tokenId, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) Permit(spender common.Address, tokenId *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Permit(&_NonfungiblePositionManager.TransactOpts, spender, tokenId, deadline, v, r, s) } // RefundETH is a paid mutator transaction binding the contract method 0x12210e8a. // // Solidity: function refundETH() payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) RefundETH(opts *bind.TransactOpts) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "refundETH") } // RefundETH is a paid mutator transaction binding the contract method 0x12210e8a. // // Solidity: function refundETH() payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) RefundETH() (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.RefundETH(&_NonfungiblePositionManager.TransactOpts) } // RefundETH is a paid mutator transaction binding the contract method 0x12210e8a. // // Solidity: function refundETH() payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) RefundETH() (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.RefundETH(&_NonfungiblePositionManager.TransactOpts) } // SafeTransferFrom is a paid mutator transaction binding the contract method 0x42842e0e. // // Solidity: function safeTransferFrom(address from, address to, uint256 tokenId) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) SafeTransferFrom(opts *bind.TransactOpts, from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "safeTransferFrom", from, to, tokenId) } // SafeTransferFrom is a paid mutator transaction binding the contract method 0x42842e0e. // // Solidity: function safeTransferFrom(address from, address to, uint256 tokenId) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) SafeTransferFrom(from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SafeTransferFrom(&_NonfungiblePositionManager.TransactOpts, from, to, tokenId) } // SafeTransferFrom is a paid mutator transaction binding the contract method 0x42842e0e. // // Solidity: function safeTransferFrom(address from, address to, uint256 tokenId) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) SafeTransferFrom(from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SafeTransferFrom(&_NonfungiblePositionManager.TransactOpts, from, to, tokenId) } // SafeTransferFrom0 is a paid mutator transaction binding the contract method 0xb88d4fde. // // Solidity: function safeTransferFrom(address from, address to, uint256 tokenId, bytes _data) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) SafeTransferFrom0(opts *bind.TransactOpts, from common.Address, to common.Address, tokenId *big.Int, _data []byte) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "safeTransferFrom0", from, to, tokenId, _data) } // SafeTransferFrom0 is a paid mutator transaction binding the contract method 0xb88d4fde. // // Solidity: function safeTransferFrom(address from, address to, uint256 tokenId, bytes _data) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) SafeTransferFrom0(from common.Address, to common.Address, tokenId *big.Int, _data []byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SafeTransferFrom0(&_NonfungiblePositionManager.TransactOpts, from, to, tokenId, _data) } // SafeTransferFrom0 is a paid mutator transaction binding the contract method 0xb88d4fde. // // Solidity: function safeTransferFrom(address from, address to, uint256 tokenId, bytes _data) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) SafeTransferFrom0(from common.Address, to common.Address, tokenId *big.Int, _data []byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SafeTransferFrom0(&_NonfungiblePositionManager.TransactOpts, from, to, tokenId, _data) } // SelfPermit is a paid mutator transaction binding the contract method 0xf3995c67. // // Solidity: function selfPermit(address token, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) SelfPermit(opts *bind.TransactOpts, token common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "selfPermit", token, value, deadline, v, r, s) } // SelfPermit is a paid mutator transaction binding the contract method 0xf3995c67. // // Solidity: function selfPermit(address token, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) SelfPermit(token common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SelfPermit(&_NonfungiblePositionManager.TransactOpts, token, value, deadline, v, r, s) } // SelfPermit is a paid mutator transaction binding the contract method 0xf3995c67. // // Solidity: function selfPermit(address token, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) SelfPermit(token common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SelfPermit(&_NonfungiblePositionManager.TransactOpts, token, value, deadline, v, r, s) } // SelfPermitAllowed is a paid mutator transaction binding the contract method 0x4659a494. // // Solidity: function selfPermitAllowed(address token, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) SelfPermitAllowed(opts *bind.TransactOpts, token common.Address, nonce *big.Int, expiry *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "selfPermitAllowed", token, nonce, expiry, v, r, s) } // SelfPermitAllowed is a paid mutator transaction binding the contract method 0x4659a494. // // Solidity: function selfPermitAllowed(address token, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) SelfPermitAllowed(token common.Address, nonce *big.Int, expiry *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SelfPermitAllowed(&_NonfungiblePositionManager.TransactOpts, token, nonce, expiry, v, r, s) } // SelfPermitAllowed is a paid mutator transaction binding the contract method 0x4659a494. // // Solidity: function selfPermitAllowed(address token, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) SelfPermitAllowed(token common.Address, nonce *big.Int, expiry *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SelfPermitAllowed(&_NonfungiblePositionManager.TransactOpts, token, nonce, expiry, v, r, s) } // SelfPermitAllowedIfNecessary is a paid mutator transaction binding the contract method 0xa4a78f0c. // // Solidity: function selfPermitAllowedIfNecessary(address token, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) SelfPermitAllowedIfNecessary(opts *bind.TransactOpts, token common.Address, nonce *big.Int, expiry *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "selfPermitAllowedIfNecessary", token, nonce, expiry, v, r, s) } // SelfPermitAllowedIfNecessary is a paid mutator transaction binding the contract method 0xa4a78f0c. // // Solidity: function selfPermitAllowedIfNecessary(address token, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) SelfPermitAllowedIfNecessary(token common.Address, nonce *big.Int, expiry *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SelfPermitAllowedIfNecessary(&_NonfungiblePositionManager.TransactOpts, token, nonce, expiry, v, r, s) } // SelfPermitAllowedIfNecessary is a paid mutator transaction binding the contract method 0xa4a78f0c. // // Solidity: function selfPermitAllowedIfNecessary(address token, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) SelfPermitAllowedIfNecessary(token common.Address, nonce *big.Int, expiry *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SelfPermitAllowedIfNecessary(&_NonfungiblePositionManager.TransactOpts, token, nonce, expiry, v, r, s) } // SelfPermitIfNecessary is a paid mutator transaction binding the contract method 0xc2e3140a. // // Solidity: function selfPermitIfNecessary(address token, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) SelfPermitIfNecessary(opts *bind.TransactOpts, token common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "selfPermitIfNecessary", token, value, deadline, v, r, s) } // SelfPermitIfNecessary is a paid mutator transaction binding the contract method 0xc2e3140a. // // Solidity: function selfPermitIfNecessary(address token, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) SelfPermitIfNecessary(token common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SelfPermitIfNecessary(&_NonfungiblePositionManager.TransactOpts, token, value, deadline, v, r, s) } // SelfPermitIfNecessary is a paid mutator transaction binding the contract method 0xc2e3140a. // // Solidity: function selfPermitIfNecessary(address token, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) SelfPermitIfNecessary(token common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SelfPermitIfNecessary(&_NonfungiblePositionManager.TransactOpts, token, value, deadline, v, r, s) } // SetApprovalForAll is a paid mutator transaction binding the contract method 0xa22cb465. // // Solidity: function setApprovalForAll(address operator, bool approved) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) SetApprovalForAll(opts *bind.TransactOpts, operator common.Address, approved bool) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "setApprovalForAll", operator, approved) } // SetApprovalForAll is a paid mutator transaction binding the contract method 0xa22cb465. // // Solidity: function setApprovalForAll(address operator, bool approved) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) SetApprovalForAll(operator common.Address, approved bool) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SetApprovalForAll(&_NonfungiblePositionManager.TransactOpts, operator, approved) } // SetApprovalForAll is a paid mutator transaction binding the contract method 0xa22cb465. // // Solidity: function setApprovalForAll(address operator, bool approved) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) SetApprovalForAll(operator common.Address, approved bool) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SetApprovalForAll(&_NonfungiblePositionManager.TransactOpts, operator, approved) } // SweepToken is a paid mutator transaction binding the contract method 0xdf2ab5bb. // // Solidity: function sweepToken(address token, uint256 amountMinimum, address recipient) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) SweepToken(opts *bind.TransactOpts, token common.Address, amountMinimum *big.Int, recipient common.Address) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "sweepToken", token, amountMinimum, recipient) } // SweepToken is a paid mutator transaction binding the contract method 0xdf2ab5bb. // // Solidity: function sweepToken(address token, uint256 amountMinimum, address recipient) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) SweepToken(token common.Address, amountMinimum *big.Int, recipient common.Address) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SweepToken(&_NonfungiblePositionManager.TransactOpts, token, amountMinimum, recipient) } // SweepToken is a paid mutator transaction binding the contract method 0xdf2ab5bb. // // Solidity: function sweepToken(address token, uint256 amountMinimum, address recipient) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) SweepToken(token common.Address, amountMinimum *big.Int, recipient common.Address) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SweepToken(&_NonfungiblePositionManager.TransactOpts, token, amountMinimum, recipient) } // TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. // // Solidity: function transferFrom(address from, address to, uint256 tokenId) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) TransferFrom(opts *bind.TransactOpts, from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "transferFrom", from, to, tokenId) } // TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. // // Solidity: function transferFrom(address from, address to, uint256 tokenId) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) TransferFrom(from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.TransferFrom(&_NonfungiblePositionManager.TransactOpts, from, to, tokenId) } // TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. // // Solidity: function transferFrom(address from, address to, uint256 tokenId) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) TransferFrom(from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.TransferFrom(&_NonfungiblePositionManager.TransactOpts, from, to, tokenId) } // UniswapV3MintCallback is a paid mutator transaction binding the contract method 0xd3487997. // // Solidity: function uniswapV3MintCallback(uint256 amount0Owed, uint256 amount1Owed, bytes data) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) UniswapV3MintCallback(opts *bind.TransactOpts, amount0Owed *big.Int, amount1Owed *big.Int, data []byte) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "uniswapV3MintCallback", amount0Owed, amount1Owed, data) } // UniswapV3MintCallback is a paid mutator transaction binding the contract method 0xd3487997. // // Solidity: function uniswapV3MintCallback(uint256 amount0Owed, uint256 amount1Owed, bytes data) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) UniswapV3MintCallback(amount0Owed *big.Int, amount1Owed *big.Int, data []byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.UniswapV3MintCallback(&_NonfungiblePositionManager.TransactOpts, amount0Owed, amount1Owed, data) } // UniswapV3MintCallback is a paid mutator transaction binding the contract method 0xd3487997. // // Solidity: function uniswapV3MintCallback(uint256 amount0Owed, uint256 amount1Owed, bytes data) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) UniswapV3MintCallback(amount0Owed *big.Int, amount1Owed *big.Int, data []byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.UniswapV3MintCallback(&_NonfungiblePositionManager.TransactOpts, amount0Owed, amount1Owed, data) } // UnwrapWETH9 is a paid mutator transaction binding the contract method 0x49404b7c. // // Solidity: function unwrapWETH9(uint256 amountMinimum, address recipient) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) UnwrapWETH9(opts *bind.TransactOpts, amountMinimum *big.Int, recipient common.Address) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "unwrapWETH9", amountMinimum, recipient) } // UnwrapWETH9 is a paid mutator transaction binding the contract method 0x49404b7c. // // Solidity: function unwrapWETH9(uint256 amountMinimum, address recipient) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) UnwrapWETH9(amountMinimum *big.Int, recipient common.Address) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.UnwrapWETH9(&_NonfungiblePositionManager.TransactOpts, amountMinimum, recipient) } // UnwrapWETH9 is a paid mutator transaction binding the contract method 0x49404b7c. // // Solidity: function unwrapWETH9(uint256 amountMinimum, address recipient) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) UnwrapWETH9(amountMinimum *big.Int, recipient common.Address) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.UnwrapWETH9(&_NonfungiblePositionManager.TransactOpts, amountMinimum, recipient) } // Receive is a paid mutator transaction binding the contract receive function. // // Solidity: receive() payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) Receive(opts *bind.TransactOpts) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.RawTransact(opts, nil) // calldata is disallowed for receive function } // Receive is a paid mutator transaction binding the contract receive function. // // Solidity: receive() payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Receive() (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Receive(&_NonfungiblePositionManager.TransactOpts) } // Receive is a paid mutator transaction binding the contract receive function. // // Solidity: receive() payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) Receive() (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Receive(&_NonfungiblePositionManager.TransactOpts) } // NonfungiblePositionManagerApprovalIterator is returned from FilterApproval and is used to iterate over the raw logs and unpacked data for Approval events raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerApprovalIterator struct { Event *NonfungiblePositionManagerApproval // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *NonfungiblePositionManagerApprovalIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerApproval) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerApproval) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *NonfungiblePositionManagerApprovalIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *NonfungiblePositionManagerApprovalIterator) Close() error { it.sub.Unsubscribe() return nil } // NonfungiblePositionManagerApproval represents a Approval event raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerApproval struct { Owner common.Address Approved common.Address TokenId *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterApproval is a free log retrieval operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. // // Solidity: event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) FilterApproval(opts *bind.FilterOpts, owner []common.Address, approved []common.Address, tokenId []*big.Int) (*NonfungiblePositionManagerApprovalIterator, error) { var ownerRule []interface{} for _, ownerItem := range owner { ownerRule = append(ownerRule, ownerItem) } var approvedRule []interface{} for _, approvedItem := range approved { approvedRule = append(approvedRule, approvedItem) } var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _NonfungiblePositionManager.contract.FilterLogs(opts, "Approval", ownerRule, approvedRule, tokenIdRule) if err != nil { return nil, err } return &NonfungiblePositionManagerApprovalIterator{contract: _NonfungiblePositionManager.contract, event: "Approval", logs: logs, sub: sub}, nil } // WatchApproval is a free log subscription operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. // // Solidity: event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) WatchApproval(opts *bind.WatchOpts, sink chan<- *NonfungiblePositionManagerApproval, owner []common.Address, approved []common.Address, tokenId []*big.Int) (event.Subscription, error) { var ownerRule []interface{} for _, ownerItem := range owner { ownerRule = append(ownerRule, ownerItem) } var approvedRule []interface{} for _, approvedItem := range approved { approvedRule = append(approvedRule, approvedItem) } var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _NonfungiblePositionManager.contract.WatchLogs(opts, "Approval", ownerRule, approvedRule, tokenIdRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(NonfungiblePositionManagerApproval) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "Approval", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseApproval is a log parse operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. // // Solidity: event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) ParseApproval(log types.Log) (*NonfungiblePositionManagerApproval, error) { event := new(NonfungiblePositionManagerApproval) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "Approval", log); err != nil { return nil, err } event.Raw = log return event, nil } // NonfungiblePositionManagerApprovalForAllIterator is returned from FilterApprovalForAll and is used to iterate over the raw logs and unpacked data for ApprovalForAll events raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerApprovalForAllIterator struct { Event *NonfungiblePositionManagerApprovalForAll // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *NonfungiblePositionManagerApprovalForAllIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerApprovalForAll) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerApprovalForAll) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *NonfungiblePositionManagerApprovalForAllIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *NonfungiblePositionManagerApprovalForAllIterator) Close() error { it.sub.Unsubscribe() return nil } // NonfungiblePositionManagerApprovalForAll represents a ApprovalForAll event raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerApprovalForAll struct { Owner common.Address Operator common.Address Approved bool Raw types.Log // Blockchain specific contextual infos } // FilterApprovalForAll is a free log retrieval operation binding the contract event 0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31. // // Solidity: event ApprovalForAll(address indexed owner, address indexed operator, bool approved) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) FilterApprovalForAll(opts *bind.FilterOpts, owner []common.Address, operator []common.Address) (*NonfungiblePositionManagerApprovalForAllIterator, error) { var ownerRule []interface{} for _, ownerItem := range owner { ownerRule = append(ownerRule, ownerItem) } var operatorRule []interface{} for _, operatorItem := range operator { operatorRule = append(operatorRule, operatorItem) } logs, sub, err := _NonfungiblePositionManager.contract.FilterLogs(opts, "ApprovalForAll", ownerRule, operatorRule) if err != nil { return nil, err } return &NonfungiblePositionManagerApprovalForAllIterator{contract: _NonfungiblePositionManager.contract, event: "ApprovalForAll", logs: logs, sub: sub}, nil } // WatchApprovalForAll is a free log subscription operation binding the contract event 0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31. // // Solidity: event ApprovalForAll(address indexed owner, address indexed operator, bool approved) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) WatchApprovalForAll(opts *bind.WatchOpts, sink chan<- *NonfungiblePositionManagerApprovalForAll, owner []common.Address, operator []common.Address) (event.Subscription, error) { var ownerRule []interface{} for _, ownerItem := range owner { ownerRule = append(ownerRule, ownerItem) } var operatorRule []interface{} for _, operatorItem := range operator { operatorRule = append(operatorRule, operatorItem) } logs, sub, err := _NonfungiblePositionManager.contract.WatchLogs(opts, "ApprovalForAll", ownerRule, operatorRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(NonfungiblePositionManagerApprovalForAll) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "ApprovalForAll", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseApprovalForAll is a log parse operation binding the contract event 0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31. // // Solidity: event ApprovalForAll(address indexed owner, address indexed operator, bool approved) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) ParseApprovalForAll(log types.Log) (*NonfungiblePositionManagerApprovalForAll, error) { event := new(NonfungiblePositionManagerApprovalForAll) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "ApprovalForAll", log); err != nil { return nil, err } event.Raw = log return event, nil } // NonfungiblePositionManagerCollectIterator is returned from FilterCollect and is used to iterate over the raw logs and unpacked data for Collect events raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerCollectIterator struct { Event *NonfungiblePositionManagerCollect // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *NonfungiblePositionManagerCollectIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerCollect) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerCollect) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *NonfungiblePositionManagerCollectIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *NonfungiblePositionManagerCollectIterator) Close() error { it.sub.Unsubscribe() return nil } // NonfungiblePositionManagerCollect represents a Collect event raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerCollect struct { TokenId *big.Int Recipient common.Address Amount0 *big.Int Amount1 *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterCollect is a free log retrieval operation binding the contract event 0x40d0efd1a53d60ecbf40971b9daf7dc90178c3aadc7aab1765632738fa8b8f01. // // Solidity: event Collect(uint256 indexed tokenId, address recipient, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) FilterCollect(opts *bind.FilterOpts, tokenId []*big.Int) (*NonfungiblePositionManagerCollectIterator, error) { var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _NonfungiblePositionManager.contract.FilterLogs(opts, "Collect", tokenIdRule) if err != nil { return nil, err } return &NonfungiblePositionManagerCollectIterator{contract: _NonfungiblePositionManager.contract, event: "Collect", logs: logs, sub: sub}, nil } // WatchCollect is a free log subscription operation binding the contract event 0x40d0efd1a53d60ecbf40971b9daf7dc90178c3aadc7aab1765632738fa8b8f01. // // Solidity: event Collect(uint256 indexed tokenId, address recipient, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) WatchCollect(opts *bind.WatchOpts, sink chan<- *NonfungiblePositionManagerCollect, tokenId []*big.Int) (event.Subscription, error) { var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _NonfungiblePositionManager.contract.WatchLogs(opts, "Collect", tokenIdRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(NonfungiblePositionManagerCollect) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "Collect", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseCollect is a log parse operation binding the contract event 0x40d0efd1a53d60ecbf40971b9daf7dc90178c3aadc7aab1765632738fa8b8f01. // // Solidity: event Collect(uint256 indexed tokenId, address recipient, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) ParseCollect(log types.Log) (*NonfungiblePositionManagerCollect, error) { event := new(NonfungiblePositionManagerCollect) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "Collect", log); err != nil { return nil, err } event.Raw = log return event, nil } // NonfungiblePositionManagerDecreaseLiquidityIterator is returned from FilterDecreaseLiquidity and is used to iterate over the raw logs and unpacked data for DecreaseLiquidity events raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerDecreaseLiquidityIterator struct { Event *NonfungiblePositionManagerDecreaseLiquidity // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *NonfungiblePositionManagerDecreaseLiquidityIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerDecreaseLiquidity) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerDecreaseLiquidity) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *NonfungiblePositionManagerDecreaseLiquidityIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *NonfungiblePositionManagerDecreaseLiquidityIterator) Close() error { it.sub.Unsubscribe() return nil } // NonfungiblePositionManagerDecreaseLiquidity represents a DecreaseLiquidity event raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerDecreaseLiquidity struct { TokenId *big.Int Liquidity *big.Int Amount0 *big.Int Amount1 *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterDecreaseLiquidity is a free log retrieval operation binding the contract event 0x26f6a048ee9138f2c0ce266f322cb99228e8d619ae2bff30c67f8dcf9d2377b4. // // Solidity: event DecreaseLiquidity(uint256 indexed tokenId, uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) FilterDecreaseLiquidity(opts *bind.FilterOpts, tokenId []*big.Int) (*NonfungiblePositionManagerDecreaseLiquidityIterator, error) { var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _NonfungiblePositionManager.contract.FilterLogs(opts, "DecreaseLiquidity", tokenIdRule) if err != nil { return nil, err } return &NonfungiblePositionManagerDecreaseLiquidityIterator{contract: _NonfungiblePositionManager.contract, event: "DecreaseLiquidity", logs: logs, sub: sub}, nil } // WatchDecreaseLiquidity is a free log subscription operation binding the contract event 0x26f6a048ee9138f2c0ce266f322cb99228e8d619ae2bff30c67f8dcf9d2377b4. // // Solidity: event DecreaseLiquidity(uint256 indexed tokenId, uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) WatchDecreaseLiquidity(opts *bind.WatchOpts, sink chan<- *NonfungiblePositionManagerDecreaseLiquidity, tokenId []*big.Int) (event.Subscription, error) { var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _NonfungiblePositionManager.contract.WatchLogs(opts, "DecreaseLiquidity", tokenIdRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(NonfungiblePositionManagerDecreaseLiquidity) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "DecreaseLiquidity", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseDecreaseLiquidity is a log parse operation binding the contract event 0x26f6a048ee9138f2c0ce266f322cb99228e8d619ae2bff30c67f8dcf9d2377b4. // // Solidity: event DecreaseLiquidity(uint256 indexed tokenId, uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) ParseDecreaseLiquidity(log types.Log) (*NonfungiblePositionManagerDecreaseLiquidity, error) { event := new(NonfungiblePositionManagerDecreaseLiquidity) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "DecreaseLiquidity", log); err != nil { return nil, err } event.Raw = log return event, nil } // NonfungiblePositionManagerIncreaseLiquidityIterator is returned from FilterIncreaseLiquidity and is used to iterate over the raw logs and unpacked data for IncreaseLiquidity events raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerIncreaseLiquidityIterator struct { Event *NonfungiblePositionManagerIncreaseLiquidity // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *NonfungiblePositionManagerIncreaseLiquidityIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerIncreaseLiquidity) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerIncreaseLiquidity) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *NonfungiblePositionManagerIncreaseLiquidityIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *NonfungiblePositionManagerIncreaseLiquidityIterator) Close() error { it.sub.Unsubscribe() return nil } // NonfungiblePositionManagerIncreaseLiquidity represents a IncreaseLiquidity event raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerIncreaseLiquidity struct { TokenId *big.Int Liquidity *big.Int Amount0 *big.Int Amount1 *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterIncreaseLiquidity is a free log retrieval operation binding the contract event 0x3067048beee31b25b2f1681f88dac838c8bba36af25bfb2b7cf7473a5847e35f. // // Solidity: event IncreaseLiquidity(uint256 indexed tokenId, uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) FilterIncreaseLiquidity(opts *bind.FilterOpts, tokenId []*big.Int) (*NonfungiblePositionManagerIncreaseLiquidityIterator, error) { var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _NonfungiblePositionManager.contract.FilterLogs(opts, "IncreaseLiquidity", tokenIdRule) if err != nil { return nil, err } return &NonfungiblePositionManagerIncreaseLiquidityIterator{contract: _NonfungiblePositionManager.contract, event: "IncreaseLiquidity", logs: logs, sub: sub}, nil } // WatchIncreaseLiquidity is a free log subscription operation binding the contract event 0x3067048beee31b25b2f1681f88dac838c8bba36af25bfb2b7cf7473a5847e35f. // // Solidity: event IncreaseLiquidity(uint256 indexed tokenId, uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) WatchIncreaseLiquidity(opts *bind.WatchOpts, sink chan<- *NonfungiblePositionManagerIncreaseLiquidity, tokenId []*big.Int) (event.Subscription, error) { var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _NonfungiblePositionManager.contract.WatchLogs(opts, "IncreaseLiquidity", tokenIdRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(NonfungiblePositionManagerIncreaseLiquidity) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "IncreaseLiquidity", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseIncreaseLiquidity is a log parse operation binding the contract event 0x3067048beee31b25b2f1681f88dac838c8bba36af25bfb2b7cf7473a5847e35f. // // Solidity: event IncreaseLiquidity(uint256 indexed tokenId, uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) ParseIncreaseLiquidity(log types.Log) (*NonfungiblePositionManagerIncreaseLiquidity, error) { event := new(NonfungiblePositionManagerIncreaseLiquidity) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "IncreaseLiquidity", log); err != nil { return nil, err } event.Raw = log return event, nil } // NonfungiblePositionManagerTransferIterator is returned from FilterTransfer and is used to iterate over the raw logs and unpacked data for Transfer events raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerTransferIterator struct { Event *NonfungiblePositionManagerTransfer // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *NonfungiblePositionManagerTransferIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerTransfer) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerTransfer) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *NonfungiblePositionManagerTransferIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *NonfungiblePositionManagerTransferIterator) Close() error { it.sub.Unsubscribe() return nil } // NonfungiblePositionManagerTransfer represents a Transfer event raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerTransfer struct { From common.Address To common.Address TokenId *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterTransfer is a free log retrieval operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. // // Solidity: event Transfer(address indexed from, address indexed to, uint256 indexed tokenId) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) FilterTransfer(opts *bind.FilterOpts, from []common.Address, to []common.Address, tokenId []*big.Int) (*NonfungiblePositionManagerTransferIterator, error) { var fromRule []interface{} for _, fromItem := range from { fromRule = append(fromRule, fromItem) } var toRule []interface{} for _, toItem := range to { toRule = append(toRule, toItem) } var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _NonfungiblePositionManager.contract.FilterLogs(opts, "Transfer", fromRule, toRule, tokenIdRule) if err != nil { return nil, err } return &NonfungiblePositionManagerTransferIterator{contract: _NonfungiblePositionManager.contract, event: "Transfer", logs: logs, sub: sub}, nil } // WatchTransfer is a free log subscription operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. // // Solidity: event Transfer(address indexed from, address indexed to, uint256 indexed tokenId) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) WatchTransfer(opts *bind.WatchOpts, sink chan<- *NonfungiblePositionManagerTransfer, from []common.Address, to []common.Address, tokenId []*big.Int) (event.Subscription, error) { var fromRule []interface{} for _, fromItem := range from { fromRule = append(fromRule, fromItem) } var toRule []interface{} for _, toItem := range to { toRule = append(toRule, toItem) } var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _NonfungiblePositionManager.contract.WatchLogs(opts, "Transfer", fromRule, toRule, tokenIdRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(NonfungiblePositionManagerTransfer) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "Transfer", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseTransfer is a log parse operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. // // Solidity: event Transfer(address indexed from, address indexed to, uint256 indexed tokenId) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) ParseTransfer(log types.Log) (*NonfungiblePositionManagerTransfer, error) { event := new(NonfungiblePositionManagerTransfer) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "Transfer", log); err != nil { return nil, err } event.Raw = log return event, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/binds/basenonfungiblepositionmanager/abi.json ================================================ [ { "inputs": [ { "internalType": "address", "name": "_factory", "type": "address" }, { "internalType": "address", "name": "_WETH9", "type": "address" }, { "internalType": "address", "name": "_tokenDescriptor_", "type": "address" } ], "stateMutability": "nonpayable", "type": "constructor" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "owner", "type": "address" }, { "indexed": true, "internalType": "address", "name": "approved", "type": "address" }, { "indexed": true, "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "Approval", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "owner", "type": "address" }, { "indexed": true, "internalType": "address", "name": "operator", "type": "address" }, { "indexed": false, "internalType": "bool", "name": "approved", "type": "bool" } ], "name": "ApprovalForAll", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "indexed": false, "internalType": "address", "name": "recipient", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "amount0", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "amount1", "type": "uint256" } ], "name": "Collect", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "indexed": false, "internalType": "uint128", "name": "liquidity", "type": "uint128" }, { "indexed": false, "internalType": "uint256", "name": "amount0", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "amount1", "type": "uint256" } ], "name": "DecreaseLiquidity", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "indexed": false, "internalType": "uint128", "name": "liquidity", "type": "uint128" }, { "indexed": false, "internalType": "uint256", "name": "amount0", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "amount1", "type": "uint256" } ], "name": "IncreaseLiquidity", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "from", "type": "address" }, { "indexed": true, "internalType": "address", "name": "to", "type": "address" }, { "indexed": true, "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "Transfer", "type": "event" }, { "inputs": [], "name": "DOMAIN_SEPARATOR", "outputs": [ { "internalType": "bytes32", "name": "", "type": "bytes32" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "PERMIT_TYPEHASH", "outputs": [ { "internalType": "bytes32", "name": "", "type": "bytes32" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "WETH9", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "to", "type": "address" }, { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "approve", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "owner", "type": "address" } ], "name": "balanceOf", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "baseURI", "outputs": [ { "internalType": "string", "name": "", "type": "string" } ], "stateMutability": "pure", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "burn", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "components": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "internalType": "address", "name": "recipient", "type": "address" }, { "internalType": "uint128", "name": "amount0Max", "type": "uint128" }, { "internalType": "uint128", "name": "amount1Max", "type": "uint128" } ], "internalType": "struct INonfungiblePositionManager.CollectParams", "name": "params", "type": "tuple" } ], "name": "collect", "outputs": [ { "internalType": "uint256", "name": "amount0", "type": "uint256" }, { "internalType": "uint256", "name": "amount1", "type": "uint256" } ], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "token0", "type": "address" }, { "internalType": "address", "name": "token1", "type": "address" }, { "internalType": "uint24", "name": "fee", "type": "uint24" }, { "internalType": "uint160", "name": "sqrtPriceX96", "type": "uint160" } ], "name": "createAndInitializePoolIfNecessary", "outputs": [ { "internalType": "address", "name": "pool", "type": "address" } ], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "components": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "internalType": "uint128", "name": "liquidity", "type": "uint128" }, { "internalType": "uint256", "name": "amount0Min", "type": "uint256" }, { "internalType": "uint256", "name": "amount1Min", "type": "uint256" }, { "internalType": "uint256", "name": "deadline", "type": "uint256" } ], "internalType": "struct INonfungiblePositionManager.DecreaseLiquidityParams", "name": "params", "type": "tuple" } ], "name": "decreaseLiquidity", "outputs": [ { "internalType": "uint256", "name": "amount0", "type": "uint256" }, { "internalType": "uint256", "name": "amount1", "type": "uint256" } ], "stateMutability": "payable", "type": "function" }, { "inputs": [], "name": "factory", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "getApproved", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "components": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "internalType": "uint256", "name": "amount0Desired", "type": "uint256" }, { "internalType": "uint256", "name": "amount1Desired", "type": "uint256" }, { "internalType": "uint256", "name": "amount0Min", "type": "uint256" }, { "internalType": "uint256", "name": "amount1Min", "type": "uint256" }, { "internalType": "uint256", "name": "deadline", "type": "uint256" } ], "internalType": "struct INonfungiblePositionManager.IncreaseLiquidityParams", "name": "params", "type": "tuple" } ], "name": "increaseLiquidity", "outputs": [ { "internalType": "uint128", "name": "liquidity", "type": "uint128" }, { "internalType": "uint256", "name": "amount0", "type": "uint256" }, { "internalType": "uint256", "name": "amount1", "type": "uint256" } ], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "owner", "type": "address" }, { "internalType": "address", "name": "operator", "type": "address" } ], "name": "isApprovedForAll", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "components": [ { "internalType": "address", "name": "token0", "type": "address" }, { "internalType": "address", "name": "token1", "type": "address" }, { "internalType": "uint24", "name": "fee", "type": "uint24" }, { "internalType": "int24", "name": "tickLower", "type": "int24" }, { "internalType": "int24", "name": "tickUpper", "type": "int24" }, { "internalType": "uint256", "name": "amount0Desired", "type": "uint256" }, { "internalType": "uint256", "name": "amount1Desired", "type": "uint256" }, { "internalType": "uint256", "name": "amount0Min", "type": "uint256" }, { "internalType": "uint256", "name": "amount1Min", "type": "uint256" }, { "internalType": "address", "name": "recipient", "type": "address" }, { "internalType": "uint256", "name": "deadline", "type": "uint256" } ], "internalType": "struct INonfungiblePositionManager.MintParams", "name": "params", "type": "tuple" } ], "name": "mint", "outputs": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "internalType": "uint128", "name": "liquidity", "type": "uint128" }, { "internalType": "uint256", "name": "amount0", "type": "uint256" }, { "internalType": "uint256", "name": "amount1", "type": "uint256" } ], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "bytes[]", "name": "data", "type": "bytes[]" } ], "name": "multicall", "outputs": [ { "internalType": "bytes[]", "name": "results", "type": "bytes[]" } ], "stateMutability": "payable", "type": "function" }, { "inputs": [], "name": "name", "outputs": [ { "internalType": "string", "name": "", "type": "string" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "ownerOf", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "spender", "type": "address" }, { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "internalType": "uint256", "name": "deadline", "type": "uint256" }, { "internalType": "uint8", "name": "v", "type": "uint8" }, { "internalType": "bytes32", "name": "r", "type": "bytes32" }, { "internalType": "bytes32", "name": "s", "type": "bytes32" } ], "name": "permit", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "positions", "outputs": [ { "internalType": "uint96", "name": "nonce", "type": "uint96" }, { "internalType": "address", "name": "operator", "type": "address" }, { "internalType": "address", "name": "token0", "type": "address" }, { "internalType": "address", "name": "token1", "type": "address" }, { "internalType": "uint24", "name": "fee", "type": "uint24" }, { "internalType": "int24", "name": "tickLower", "type": "int24" }, { "internalType": "int24", "name": "tickUpper", "type": "int24" }, { "internalType": "uint128", "name": "liquidity", "type": "uint128" }, { "internalType": "uint256", "name": "feeGrowthInside0LastX128", "type": "uint256" }, { "internalType": "uint256", "name": "feeGrowthInside1LastX128", "type": "uint256" }, { "internalType": "uint128", "name": "tokensOwed0", "type": "uint128" }, { "internalType": "uint128", "name": "tokensOwed1", "type": "uint128" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "refundETH", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "from", "type": "address" }, { "internalType": "address", "name": "to", "type": "address" }, { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "safeTransferFrom", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "from", "type": "address" }, { "internalType": "address", "name": "to", "type": "address" }, { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "internalType": "bytes", "name": "_data", "type": "bytes" } ], "name": "safeTransferFrom", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "token", "type": "address" }, { "internalType": "uint256", "name": "value", "type": "uint256" }, { "internalType": "uint256", "name": "deadline", "type": "uint256" }, { "internalType": "uint8", "name": "v", "type": "uint8" }, { "internalType": "bytes32", "name": "r", "type": "bytes32" }, { "internalType": "bytes32", "name": "s", "type": "bytes32" } ], "name": "selfPermit", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "token", "type": "address" }, { "internalType": "uint256", "name": "nonce", "type": "uint256" }, { "internalType": "uint256", "name": "expiry", "type": "uint256" }, { "internalType": "uint8", "name": "v", "type": "uint8" }, { "internalType": "bytes32", "name": "r", "type": "bytes32" }, { "internalType": "bytes32", "name": "s", "type": "bytes32" } ], "name": "selfPermitAllowed", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "token", "type": "address" }, { "internalType": "uint256", "name": "nonce", "type": "uint256" }, { "internalType": "uint256", "name": "expiry", "type": "uint256" }, { "internalType": "uint8", "name": "v", "type": "uint8" }, { "internalType": "bytes32", "name": "r", "type": "bytes32" }, { "internalType": "bytes32", "name": "s", "type": "bytes32" } ], "name": "selfPermitAllowedIfNecessary", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "token", "type": "address" }, { "internalType": "uint256", "name": "value", "type": "uint256" }, { "internalType": "uint256", "name": "deadline", "type": "uint256" }, { "internalType": "uint8", "name": "v", "type": "uint8" }, { "internalType": "bytes32", "name": "r", "type": "bytes32" }, { "internalType": "bytes32", "name": "s", "type": "bytes32" } ], "name": "selfPermitIfNecessary", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "operator", "type": "address" }, { "internalType": "bool", "name": "approved", "type": "bool" } ], "name": "setApprovalForAll", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "bytes4", "name": "interfaceId", "type": "bytes4" } ], "name": "supportsInterface", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "token", "type": "address" }, { "internalType": "uint256", "name": "amountMinimum", "type": "uint256" }, { "internalType": "address", "name": "recipient", "type": "address" } ], "name": "sweepToken", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [], "name": "symbol", "outputs": [ { "internalType": "string", "name": "", "type": "string" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "index", "type": "uint256" } ], "name": "tokenByIndex", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "owner", "type": "address" }, { "internalType": "uint256", "name": "index", "type": "uint256" } ], "name": "tokenOfOwnerByIndex", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "tokenURI", "outputs": [ { "internalType": "string", "name": "", "type": "string" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "totalSupply", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "from", "type": "address" }, { "internalType": "address", "name": "to", "type": "address" }, { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "transferFrom", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "amount0Owed", "type": "uint256" }, { "internalType": "uint256", "name": "amount1Owed", "type": "uint256" }, { "internalType": "bytes", "name": "data", "type": "bytes" } ], "name": "uniswapV3MintCallback", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "amountMinimum", "type": "uint256" }, { "internalType": "address", "name": "recipient", "type": "address" } ], "name": "unwrapWETH9", "outputs": [], "stateMutability": "payable", "type": "function" }, { "stateMutability": "payable", "type": "receive" } ] ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/binds/basequoterv2/QuoterV2.go ================================================ // Code generated - DO NOT EDIT. // This file is a generated binding and any manual changes will be lost. package basequoterv2 import ( "errors" "math/big" "strings" ethereum "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/event" ) // Reference imports to suppress errors if they are not otherwise used. var ( _ = errors.New _ = big.NewInt _ = strings.NewReader _ = ethereum.NotFound _ = bind.Bind _ = common.Big1 _ = types.BloomLookup _ = event.NewSubscription _ = abi.ConvertType ) // IQuoterV2QuoteExactInputSingleParams is an auto generated low-level Go binding around an user-defined struct. type IQuoterV2QuoteExactInputSingleParams struct { TokenIn common.Address TokenOut common.Address AmountIn *big.Int Fee *big.Int SqrtPriceLimitX96 *big.Int } // IQuoterV2QuoteExactOutputSingleParams is an auto generated low-level Go binding around an user-defined struct. type IQuoterV2QuoteExactOutputSingleParams struct { TokenIn common.Address TokenOut common.Address Amount *big.Int Fee *big.Int SqrtPriceLimitX96 *big.Int } // QuoterV2MetaData contains all meta data concerning the QuoterV2 contract. var QuoterV2MetaData = &bind.MetaData{ ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_factory\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_WETH9\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"WETH9\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"factory\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"path\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"amountIn\",\"type\":\"uint256\"}],\"name\":\"quoteExactInput\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amountOut\",\"type\":\"uint256\"},{\"internalType\":\"uint160[]\",\"name\":\"sqrtPriceX96AfterList\",\"type\":\"uint160[]\"},{\"internalType\":\"uint32[]\",\"name\":\"initializedTicksCrossedList\",\"type\":\"uint32[]\"},{\"internalType\":\"uint256\",\"name\":\"gasEstimate\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"tokenIn\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenOut\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amountIn\",\"type\":\"uint256\"},{\"internalType\":\"uint24\",\"name\":\"fee\",\"type\":\"uint24\"},{\"internalType\":\"uint160\",\"name\":\"sqrtPriceLimitX96\",\"type\":\"uint160\"}],\"internalType\":\"structIQuoterV2.QuoteExactInputSingleParams\",\"name\":\"params\",\"type\":\"tuple\"}],\"name\":\"quoteExactInputSingle\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amountOut\",\"type\":\"uint256\"},{\"internalType\":\"uint160\",\"name\":\"sqrtPriceX96After\",\"type\":\"uint160\"},{\"internalType\":\"uint32\",\"name\":\"initializedTicksCrossed\",\"type\":\"uint32\"},{\"internalType\":\"uint256\",\"name\":\"gasEstimate\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"path\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"amountOut\",\"type\":\"uint256\"}],\"name\":\"quoteExactOutput\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amountIn\",\"type\":\"uint256\"},{\"internalType\":\"uint160[]\",\"name\":\"sqrtPriceX96AfterList\",\"type\":\"uint160[]\"},{\"internalType\":\"uint32[]\",\"name\":\"initializedTicksCrossedList\",\"type\":\"uint32[]\"},{\"internalType\":\"uint256\",\"name\":\"gasEstimate\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"tokenIn\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenOut\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"uint24\",\"name\":\"fee\",\"type\":\"uint24\"},{\"internalType\":\"uint160\",\"name\":\"sqrtPriceLimitX96\",\"type\":\"uint160\"}],\"internalType\":\"structIQuoterV2.QuoteExactOutputSingleParams\",\"name\":\"params\",\"type\":\"tuple\"}],\"name\":\"quoteExactOutputSingle\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amountIn\",\"type\":\"uint256\"},{\"internalType\":\"uint160\",\"name\":\"sqrtPriceX96After\",\"type\":\"uint160\"},{\"internalType\":\"uint32\",\"name\":\"initializedTicksCrossed\",\"type\":\"uint32\"},{\"internalType\":\"uint256\",\"name\":\"gasEstimate\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"int256\",\"name\":\"amount0Delta\",\"type\":\"int256\"},{\"internalType\":\"int256\",\"name\":\"amount1Delta\",\"type\":\"int256\"},{\"internalType\":\"bytes\",\"name\":\"path\",\"type\":\"bytes\"}],\"name\":\"uniswapV3SwapCallback\",\"outputs\":[],\"stateMutability\":\"view\",\"type\":\"function\"}]", } // QuoterV2ABI is the input ABI used to generate the binding from. // Deprecated: Use QuoterV2MetaData.ABI instead. var QuoterV2ABI = QuoterV2MetaData.ABI // QuoterV2 is an auto generated Go binding around an Ethereum contract. type QuoterV2 struct { QuoterV2Caller // Read-only binding to the contract QuoterV2Transactor // Write-only binding to the contract QuoterV2Filterer // Log filterer for contract events } // QuoterV2Caller is an auto generated read-only Go binding around an Ethereum contract. type QuoterV2Caller struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // QuoterV2Transactor is an auto generated write-only Go binding around an Ethereum contract. type QuoterV2Transactor struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // QuoterV2Filterer is an auto generated log filtering Go binding around an Ethereum contract events. type QuoterV2Filterer struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // QuoterV2Session is an auto generated Go binding around an Ethereum contract, // with pre-set call and transact options. type QuoterV2Session struct { Contract *QuoterV2 // Generic contract binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // QuoterV2CallerSession is an auto generated read-only Go binding around an Ethereum contract, // with pre-set call options. type QuoterV2CallerSession struct { Contract *QuoterV2Caller // Generic contract caller binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session } // QuoterV2TransactorSession is an auto generated write-only Go binding around an Ethereum contract, // with pre-set transact options. type QuoterV2TransactorSession struct { Contract *QuoterV2Transactor // Generic contract transactor binding to set the session for TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // QuoterV2Raw is an auto generated low-level Go binding around an Ethereum contract. type QuoterV2Raw struct { Contract *QuoterV2 // Generic contract binding to access the raw methods on } // QuoterV2CallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. type QuoterV2CallerRaw struct { Contract *QuoterV2Caller // Generic read-only contract binding to access the raw methods on } // QuoterV2TransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. type QuoterV2TransactorRaw struct { Contract *QuoterV2Transactor // Generic write-only contract binding to access the raw methods on } // NewQuoterV2 creates a new instance of QuoterV2, bound to a specific deployed contract. func NewQuoterV2(address common.Address, backend bind.ContractBackend) (*QuoterV2, error) { contract, err := bindQuoterV2(address, backend, backend, backend) if err != nil { return nil, err } return &QuoterV2{QuoterV2Caller: QuoterV2Caller{contract: contract}, QuoterV2Transactor: QuoterV2Transactor{contract: contract}, QuoterV2Filterer: QuoterV2Filterer{contract: contract}}, nil } // NewQuoterV2Caller creates a new read-only instance of QuoterV2, bound to a specific deployed contract. func NewQuoterV2Caller(address common.Address, caller bind.ContractCaller) (*QuoterV2Caller, error) { contract, err := bindQuoterV2(address, caller, nil, nil) if err != nil { return nil, err } return &QuoterV2Caller{contract: contract}, nil } // NewQuoterV2Transactor creates a new write-only instance of QuoterV2, bound to a specific deployed contract. func NewQuoterV2Transactor(address common.Address, transactor bind.ContractTransactor) (*QuoterV2Transactor, error) { contract, err := bindQuoterV2(address, nil, transactor, nil) if err != nil { return nil, err } return &QuoterV2Transactor{contract: contract}, nil } // NewQuoterV2Filterer creates a new log filterer instance of QuoterV2, bound to a specific deployed contract. func NewQuoterV2Filterer(address common.Address, filterer bind.ContractFilterer) (*QuoterV2Filterer, error) { contract, err := bindQuoterV2(address, nil, nil, filterer) if err != nil { return nil, err } return &QuoterV2Filterer{contract: contract}, nil } // bindQuoterV2 binds a generic wrapper to an already deployed contract. func bindQuoterV2(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { parsed, err := QuoterV2MetaData.GetAbi() if err != nil { return nil, err } return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_QuoterV2 *QuoterV2Raw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _QuoterV2.Contract.QuoterV2Caller.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_QuoterV2 *QuoterV2Raw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _QuoterV2.Contract.QuoterV2Transactor.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_QuoterV2 *QuoterV2Raw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _QuoterV2.Contract.QuoterV2Transactor.contract.Transact(opts, method, params...) } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_QuoterV2 *QuoterV2CallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _QuoterV2.Contract.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_QuoterV2 *QuoterV2TransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _QuoterV2.Contract.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_QuoterV2 *QuoterV2TransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _QuoterV2.Contract.contract.Transact(opts, method, params...) } // WETH9 is a free data retrieval call binding the contract method 0x4aa4a4fc. // // Solidity: function WETH9() view returns(address) func (_QuoterV2 *QuoterV2Caller) WETH9(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _QuoterV2.contract.Call(opts, &out, "WETH9") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // WETH9 is a free data retrieval call binding the contract method 0x4aa4a4fc. // // Solidity: function WETH9() view returns(address) func (_QuoterV2 *QuoterV2Session) WETH9() (common.Address, error) { return _QuoterV2.Contract.WETH9(&_QuoterV2.CallOpts) } // WETH9 is a free data retrieval call binding the contract method 0x4aa4a4fc. // // Solidity: function WETH9() view returns(address) func (_QuoterV2 *QuoterV2CallerSession) WETH9() (common.Address, error) { return _QuoterV2.Contract.WETH9(&_QuoterV2.CallOpts) } // Factory is a free data retrieval call binding the contract method 0xc45a0155. // // Solidity: function factory() view returns(address) func (_QuoterV2 *QuoterV2Caller) Factory(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _QuoterV2.contract.Call(opts, &out, "factory") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // Factory is a free data retrieval call binding the contract method 0xc45a0155. // // Solidity: function factory() view returns(address) func (_QuoterV2 *QuoterV2Session) Factory() (common.Address, error) { return _QuoterV2.Contract.Factory(&_QuoterV2.CallOpts) } // Factory is a free data retrieval call binding the contract method 0xc45a0155. // // Solidity: function factory() view returns(address) func (_QuoterV2 *QuoterV2CallerSession) Factory() (common.Address, error) { return _QuoterV2.Contract.Factory(&_QuoterV2.CallOpts) } // UniswapV3SwapCallback is a free data retrieval call binding the contract method 0xfa461e33. // // Solidity: function uniswapV3SwapCallback(int256 amount0Delta, int256 amount1Delta, bytes path) view returns() func (_QuoterV2 *QuoterV2Caller) UniswapV3SwapCallback(opts *bind.CallOpts, amount0Delta *big.Int, amount1Delta *big.Int, path []byte) error { var out []interface{} err := _QuoterV2.contract.Call(opts, &out, "uniswapV3SwapCallback", amount0Delta, amount1Delta, path) if err != nil { return err } return err } // UniswapV3SwapCallback is a free data retrieval call binding the contract method 0xfa461e33. // // Solidity: function uniswapV3SwapCallback(int256 amount0Delta, int256 amount1Delta, bytes path) view returns() func (_QuoterV2 *QuoterV2Session) UniswapV3SwapCallback(amount0Delta *big.Int, amount1Delta *big.Int, path []byte) error { return _QuoterV2.Contract.UniswapV3SwapCallback(&_QuoterV2.CallOpts, amount0Delta, amount1Delta, path) } // UniswapV3SwapCallback is a free data retrieval call binding the contract method 0xfa461e33. // // Solidity: function uniswapV3SwapCallback(int256 amount0Delta, int256 amount1Delta, bytes path) view returns() func (_QuoterV2 *QuoterV2CallerSession) UniswapV3SwapCallback(amount0Delta *big.Int, amount1Delta *big.Int, path []byte) error { return _QuoterV2.Contract.UniswapV3SwapCallback(&_QuoterV2.CallOpts, amount0Delta, amount1Delta, path) } // QuoteExactInput is a paid mutator transaction binding the contract method 0xcdca1753. // // Solidity: function quoteExactInput(bytes path, uint256 amountIn) returns(uint256 amountOut, uint160[] sqrtPriceX96AfterList, uint32[] initializedTicksCrossedList, uint256 gasEstimate) func (_QuoterV2 *QuoterV2Transactor) QuoteExactInput(opts *bind.TransactOpts, path []byte, amountIn *big.Int) (*types.Transaction, error) { return _QuoterV2.contract.Transact(opts, "quoteExactInput", path, amountIn) } // QuoteExactInput is a paid mutator transaction binding the contract method 0xcdca1753. // // Solidity: function quoteExactInput(bytes path, uint256 amountIn) returns(uint256 amountOut, uint160[] sqrtPriceX96AfterList, uint32[] initializedTicksCrossedList, uint256 gasEstimate) func (_QuoterV2 *QuoterV2Session) QuoteExactInput(path []byte, amountIn *big.Int) (*types.Transaction, error) { return _QuoterV2.Contract.QuoteExactInput(&_QuoterV2.TransactOpts, path, amountIn) } // QuoteExactInput is a paid mutator transaction binding the contract method 0xcdca1753. // // Solidity: function quoteExactInput(bytes path, uint256 amountIn) returns(uint256 amountOut, uint160[] sqrtPriceX96AfterList, uint32[] initializedTicksCrossedList, uint256 gasEstimate) func (_QuoterV2 *QuoterV2TransactorSession) QuoteExactInput(path []byte, amountIn *big.Int) (*types.Transaction, error) { return _QuoterV2.Contract.QuoteExactInput(&_QuoterV2.TransactOpts, path, amountIn) } // QuoteExactInputSingle is a paid mutator transaction binding the contract method 0xc6a5026a. // // Solidity: function quoteExactInputSingle((address,address,uint256,uint24,uint160) params) returns(uint256 amountOut, uint160 sqrtPriceX96After, uint32 initializedTicksCrossed, uint256 gasEstimate) func (_QuoterV2 *QuoterV2Transactor) QuoteExactInputSingle(opts *bind.TransactOpts, params IQuoterV2QuoteExactInputSingleParams) (*types.Transaction, error) { return _QuoterV2.contract.Transact(opts, "quoteExactInputSingle", params) } // QuoteExactInputSingle is a paid mutator transaction binding the contract method 0xc6a5026a. // // Solidity: function quoteExactInputSingle((address,address,uint256,uint24,uint160) params) returns(uint256 amountOut, uint160 sqrtPriceX96After, uint32 initializedTicksCrossed, uint256 gasEstimate) func (_QuoterV2 *QuoterV2Session) QuoteExactInputSingle(params IQuoterV2QuoteExactInputSingleParams) (*types.Transaction, error) { return _QuoterV2.Contract.QuoteExactInputSingle(&_QuoterV2.TransactOpts, params) } // QuoteExactInputSingle is a paid mutator transaction binding the contract method 0xc6a5026a. // // Solidity: function quoteExactInputSingle((address,address,uint256,uint24,uint160) params) returns(uint256 amountOut, uint160 sqrtPriceX96After, uint32 initializedTicksCrossed, uint256 gasEstimate) func (_QuoterV2 *QuoterV2TransactorSession) QuoteExactInputSingle(params IQuoterV2QuoteExactInputSingleParams) (*types.Transaction, error) { return _QuoterV2.Contract.QuoteExactInputSingle(&_QuoterV2.TransactOpts, params) } // QuoteExactOutput is a paid mutator transaction binding the contract method 0x2f80bb1d. // // Solidity: function quoteExactOutput(bytes path, uint256 amountOut) returns(uint256 amountIn, uint160[] sqrtPriceX96AfterList, uint32[] initializedTicksCrossedList, uint256 gasEstimate) func (_QuoterV2 *QuoterV2Transactor) QuoteExactOutput(opts *bind.TransactOpts, path []byte, amountOut *big.Int) (*types.Transaction, error) { return _QuoterV2.contract.Transact(opts, "quoteExactOutput", path, amountOut) } // QuoteExactOutput is a paid mutator transaction binding the contract method 0x2f80bb1d. // // Solidity: function quoteExactOutput(bytes path, uint256 amountOut) returns(uint256 amountIn, uint160[] sqrtPriceX96AfterList, uint32[] initializedTicksCrossedList, uint256 gasEstimate) func (_QuoterV2 *QuoterV2Session) QuoteExactOutput(path []byte, amountOut *big.Int) (*types.Transaction, error) { return _QuoterV2.Contract.QuoteExactOutput(&_QuoterV2.TransactOpts, path, amountOut) } // QuoteExactOutput is a paid mutator transaction binding the contract method 0x2f80bb1d. // // Solidity: function quoteExactOutput(bytes path, uint256 amountOut) returns(uint256 amountIn, uint160[] sqrtPriceX96AfterList, uint32[] initializedTicksCrossedList, uint256 gasEstimate) func (_QuoterV2 *QuoterV2TransactorSession) QuoteExactOutput(path []byte, amountOut *big.Int) (*types.Transaction, error) { return _QuoterV2.Contract.QuoteExactOutput(&_QuoterV2.TransactOpts, path, amountOut) } // QuoteExactOutputSingle is a paid mutator transaction binding the contract method 0xbd21704a. // // Solidity: function quoteExactOutputSingle((address,address,uint256,uint24,uint160) params) returns(uint256 amountIn, uint160 sqrtPriceX96After, uint32 initializedTicksCrossed, uint256 gasEstimate) func (_QuoterV2 *QuoterV2Transactor) QuoteExactOutputSingle(opts *bind.TransactOpts, params IQuoterV2QuoteExactOutputSingleParams) (*types.Transaction, error) { return _QuoterV2.contract.Transact(opts, "quoteExactOutputSingle", params) } // QuoteExactOutputSingle is a paid mutator transaction binding the contract method 0xbd21704a. // // Solidity: function quoteExactOutputSingle((address,address,uint256,uint24,uint160) params) returns(uint256 amountIn, uint160 sqrtPriceX96After, uint32 initializedTicksCrossed, uint256 gasEstimate) func (_QuoterV2 *QuoterV2Session) QuoteExactOutputSingle(params IQuoterV2QuoteExactOutputSingleParams) (*types.Transaction, error) { return _QuoterV2.Contract.QuoteExactOutputSingle(&_QuoterV2.TransactOpts, params) } // QuoteExactOutputSingle is a paid mutator transaction binding the contract method 0xbd21704a. // // Solidity: function quoteExactOutputSingle((address,address,uint256,uint24,uint160) params) returns(uint256 amountIn, uint160 sqrtPriceX96After, uint32 initializedTicksCrossed, uint256 gasEstimate) func (_QuoterV2 *QuoterV2TransactorSession) QuoteExactOutputSingle(params IQuoterV2QuoteExactOutputSingleParams) (*types.Transaction, error) { return _QuoterV2.Contract.QuoteExactOutputSingle(&_QuoterV2.TransactOpts, params) } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/binds/basequoterv2/abi.json ================================================ [ { "inputs": [ { "internalType": "address", "name": "_factory", "type": "address" }, { "internalType": "address", "name": "_WETH9", "type": "address" } ], "stateMutability": "nonpayable", "type": "constructor" }, { "inputs": [], "name": "WETH9", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "factory", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "bytes", "name": "path", "type": "bytes" }, { "internalType": "uint256", "name": "amountIn", "type": "uint256" } ], "name": "quoteExactInput", "outputs": [ { "internalType": "uint256", "name": "amountOut", "type": "uint256" }, { "internalType": "uint160[]", "name": "sqrtPriceX96AfterList", "type": "uint160[]" }, { "internalType": "uint32[]", "name": "initializedTicksCrossedList", "type": "uint32[]" }, { "internalType": "uint256", "name": "gasEstimate", "type": "uint256" } ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "components": [ { "internalType": "address", "name": "tokenIn", "type": "address" }, { "internalType": "address", "name": "tokenOut", "type": "address" }, { "internalType": "uint256", "name": "amountIn", "type": "uint256" }, { "internalType": "uint24", "name": "fee", "type": "uint24" }, { "internalType": "uint160", "name": "sqrtPriceLimitX96", "type": "uint160" } ], "internalType": "struct IQuoterV2.QuoteExactInputSingleParams", "name": "params", "type": "tuple" } ], "name": "quoteExactInputSingle", "outputs": [ { "internalType": "uint256", "name": "amountOut", "type": "uint256" }, { "internalType": "uint160", "name": "sqrtPriceX96After", "type": "uint160" }, { "internalType": "uint32", "name": "initializedTicksCrossed", "type": "uint32" }, { "internalType": "uint256", "name": "gasEstimate", "type": "uint256" } ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "bytes", "name": "path", "type": "bytes" }, { "internalType": "uint256", "name": "amountOut", "type": "uint256" } ], "name": "quoteExactOutput", "outputs": [ { "internalType": "uint256", "name": "amountIn", "type": "uint256" }, { "internalType": "uint160[]", "name": "sqrtPriceX96AfterList", "type": "uint160[]" }, { "internalType": "uint32[]", "name": "initializedTicksCrossedList", "type": "uint32[]" }, { "internalType": "uint256", "name": "gasEstimate", "type": "uint256" } ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "components": [ { "internalType": "address", "name": "tokenIn", "type": "address" }, { "internalType": "address", "name": "tokenOut", "type": "address" }, { "internalType": "uint256", "name": "amount", "type": "uint256" }, { "internalType": "uint24", "name": "fee", "type": "uint24" }, { "internalType": "uint160", "name": "sqrtPriceLimitX96", "type": "uint160" } ], "internalType": "struct IQuoterV2.QuoteExactOutputSingleParams", "name": "params", "type": "tuple" } ], "name": "quoteExactOutputSingle", "outputs": [ { "internalType": "uint256", "name": "amountIn", "type": "uint256" }, { "internalType": "uint160", "name": "sqrtPriceX96After", "type": "uint160" }, { "internalType": "uint32", "name": "initializedTicksCrossed", "type": "uint32" }, { "internalType": "uint256", "name": "gasEstimate", "type": "uint256" } ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "int256", "name": "amount0Delta", "type": "int256" }, { "internalType": "int256", "name": "amount1Delta", "type": "int256" }, { "internalType": "bytes", "name": "path", "type": "bytes" } ], "name": "uniswapV3SwapCallback", "outputs": [], "stateMutability": "view", "type": "function" } ] ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/binds/basequoterv2/extras.go ================================================ package basequoterv2 import ( "math/big" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi/bind" ) func (_QuoterV2 *QuoterV2Transactor) QuoteExactInputSingleCall(opts *bind.CallOpts, params IQuoterV2QuoteExactInputSingleParams) (*big.Int, *big.Int, uint32, uint32, error) { var out []interface{} err := _QuoterV2.contract.Call(opts, &out, "quoteExactInputSingle", params) if err != nil { return new(big.Int), new(big.Int), 0, 0, err } amountOut := *abi.ConvertType(out[0], new(big.Int)).(*big.Int) sqrtPriceX96After := *abi.ConvertType(out[1], new(big.Int)).(*big.Int) initializedTicksCrossed := *abi.ConvertType(out[2], new(uint32)).(*uint32) gasEstimate := *abi.ConvertType(out[2], new(uint32)).(*uint32) return &amountOut, &sqrtPriceX96After, initializedTicksCrossed, gasEstimate, err } func (_QuoterV2 *QuoterV2Transactor) QuoteExactOutputSingleCall(opts *bind.CallOpts, params IQuoterV2QuoteExactOutputSingleParams) (*big.Int, *big.Int, uint32, uint32, error) { var out []interface{} err := _QuoterV2.contract.Call(opts, &out, "quoteExactOutputSingle", params) if err != nil { return new(big.Int), new(big.Int), 0, 0, err } amountIn := *abi.ConvertType(out[0], new(big.Int)).(*big.Int) sqrtPriceX96After := *abi.ConvertType(out[1], new(big.Int)).(*big.Int) initializedTicksCrossed := *abi.ConvertType(out[2], new(uint32)).(*uint32) gasEstimate := *abi.ConvertType(out[2], new(uint32)).(*uint32) return &amountIn, &sqrtPriceX96After, initializedTicksCrossed, gasEstimate, err } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/binds/baseswaprouter02/SwapRouter02.go ================================================ // Code generated - DO NOT EDIT. // This file is a generated binding and any manual changes will be lost. package baseswaprouter02 import ( "errors" "math/big" "strings" ethereum "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/event" ) // Reference imports to suppress errors if they are not otherwise used. var ( _ = errors.New _ = big.NewInt _ = strings.NewReader _ = ethereum.NotFound _ = bind.Bind _ = common.Big1 _ = types.BloomLookup _ = event.NewSubscription _ = abi.ConvertType ) // IApproveAndCallIncreaseLiquidityParams is an auto generated low-level Go binding around an user-defined struct. type IApproveAndCallIncreaseLiquidityParams struct { Token0 common.Address Token1 common.Address TokenId *big.Int Amount0Min *big.Int Amount1Min *big.Int } // IApproveAndCallMintParams is an auto generated low-level Go binding around an user-defined struct. type IApproveAndCallMintParams struct { Token0 common.Address Token1 common.Address Fee *big.Int TickLower *big.Int TickUpper *big.Int Amount0Min *big.Int Amount1Min *big.Int Recipient common.Address } // IV3SwapRouterExactInputParams is an auto generated low-level Go binding around an user-defined struct. type IV3SwapRouterExactInputParams struct { Path []byte Recipient common.Address AmountIn *big.Int AmountOutMinimum *big.Int } // IV3SwapRouterExactInputSingleParams is an auto generated low-level Go binding around an user-defined struct. type IV3SwapRouterExactInputSingleParams struct { TokenIn common.Address TokenOut common.Address Fee *big.Int Recipient common.Address AmountIn *big.Int AmountOutMinimum *big.Int SqrtPriceLimitX96 *big.Int } // IV3SwapRouterExactOutputParams is an auto generated low-level Go binding around an user-defined struct. type IV3SwapRouterExactOutputParams struct { Path []byte Recipient common.Address AmountOut *big.Int AmountInMaximum *big.Int } // IV3SwapRouterExactOutputSingleParams is an auto generated low-level Go binding around an user-defined struct. type IV3SwapRouterExactOutputSingleParams struct { TokenIn common.Address TokenOut common.Address Fee *big.Int Recipient common.Address AmountOut *big.Int AmountInMaximum *big.Int SqrtPriceLimitX96 *big.Int } // SwapRouter02MetaData contains all meta data concerning the SwapRouter02 contract. var SwapRouter02MetaData = &bind.MetaData{ ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_factoryV2\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"factoryV3\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_positionManager\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_WETH9\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"WETH9\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"approveMax\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"approveMaxMinusOne\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"approveZeroThenMax\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"approveZeroThenMaxMinusOne\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"callPositionManager\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"result\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes[]\",\"name\":\"paths\",\"type\":\"bytes[]\"},{\"internalType\":\"uint128[]\",\"name\":\"amounts\",\"type\":\"uint128[]\"},{\"internalType\":\"uint24\",\"name\":\"maximumTickDivergence\",\"type\":\"uint24\"},{\"internalType\":\"uint32\",\"name\":\"secondsAgo\",\"type\":\"uint32\"}],\"name\":\"checkOracleSlippage\",\"outputs\":[],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"path\",\"type\":\"bytes\"},{\"internalType\":\"uint24\",\"name\":\"maximumTickDivergence\",\"type\":\"uint24\"},{\"internalType\":\"uint32\",\"name\":\"secondsAgo\",\"type\":\"uint32\"}],\"name\":\"checkOracleSlippage\",\"outputs\":[],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes\",\"name\":\"path\",\"type\":\"bytes\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amountIn\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountOutMinimum\",\"type\":\"uint256\"}],\"internalType\":\"structIV3SwapRouter.ExactInputParams\",\"name\":\"params\",\"type\":\"tuple\"}],\"name\":\"exactInput\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amountOut\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"tokenIn\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenOut\",\"type\":\"address\"},{\"internalType\":\"uint24\",\"name\":\"fee\",\"type\":\"uint24\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amountIn\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountOutMinimum\",\"type\":\"uint256\"},{\"internalType\":\"uint160\",\"name\":\"sqrtPriceLimitX96\",\"type\":\"uint160\"}],\"internalType\":\"structIV3SwapRouter.ExactInputSingleParams\",\"name\":\"params\",\"type\":\"tuple\"}],\"name\":\"exactInputSingle\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amountOut\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes\",\"name\":\"path\",\"type\":\"bytes\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amountOut\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountInMaximum\",\"type\":\"uint256\"}],\"internalType\":\"structIV3SwapRouter.ExactOutputParams\",\"name\":\"params\",\"type\":\"tuple\"}],\"name\":\"exactOutput\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amountIn\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"tokenIn\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenOut\",\"type\":\"address\"},{\"internalType\":\"uint24\",\"name\":\"fee\",\"type\":\"uint24\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amountOut\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountInMaximum\",\"type\":\"uint256\"},{\"internalType\":\"uint160\",\"name\":\"sqrtPriceLimitX96\",\"type\":\"uint160\"}],\"internalType\":\"structIV3SwapRouter.ExactOutputSingleParams\",\"name\":\"params\",\"type\":\"tuple\"}],\"name\":\"exactOutputSingle\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amountIn\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"factory\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"factoryV2\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"getApprovalType\",\"outputs\":[{\"internalType\":\"enumIApproveAndCall.ApprovalType\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"token0\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token1\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount0Min\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Min\",\"type\":\"uint256\"}],\"internalType\":\"structIApproveAndCall.IncreaseLiquidityParams\",\"name\":\"params\",\"type\":\"tuple\"}],\"name\":\"increaseLiquidity\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"result\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"token0\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token1\",\"type\":\"address\"},{\"internalType\":\"uint24\",\"name\":\"fee\",\"type\":\"uint24\"},{\"internalType\":\"int24\",\"name\":\"tickLower\",\"type\":\"int24\"},{\"internalType\":\"int24\",\"name\":\"tickUpper\",\"type\":\"int24\"},{\"internalType\":\"uint256\",\"name\":\"amount0Min\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Min\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"}],\"internalType\":\"structIApproveAndCall.MintParams\",\"name\":\"params\",\"type\":\"tuple\"}],\"name\":\"mint\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"result\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"previousBlockhash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes[]\",\"name\":\"data\",\"type\":\"bytes[]\"}],\"name\":\"multicall\",\"outputs\":[{\"internalType\":\"bytes[]\",\"name\":\"\",\"type\":\"bytes[]\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"bytes[]\",\"name\":\"data\",\"type\":\"bytes[]\"}],\"name\":\"multicall\",\"outputs\":[{\"internalType\":\"bytes[]\",\"name\":\"\",\"type\":\"bytes[]\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes[]\",\"name\":\"data\",\"type\":\"bytes[]\"}],\"name\":\"multicall\",\"outputs\":[{\"internalType\":\"bytes[]\",\"name\":\"results\",\"type\":\"bytes[]\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"positionManager\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"pull\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"refundETH\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"selfPermit\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiry\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"selfPermitAllowed\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiry\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"selfPermitAllowedIfNecessary\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"selfPermitIfNecessary\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountIn\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountOutMin\",\"type\":\"uint256\"},{\"internalType\":\"address[]\",\"name\":\"path\",\"type\":\"address[]\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"swapExactTokensForTokens\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amountOut\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountOut\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountInMax\",\"type\":\"uint256\"},{\"internalType\":\"address[]\",\"name\":\"path\",\"type\":\"address[]\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"swapTokensForExactTokens\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amountIn\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amountMinimum\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"}],\"name\":\"sweepToken\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amountMinimum\",\"type\":\"uint256\"}],\"name\":\"sweepToken\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amountMinimum\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"feeBips\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"feeRecipient\",\"type\":\"address\"}],\"name\":\"sweepTokenWithFee\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amountMinimum\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"feeBips\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"feeRecipient\",\"type\":\"address\"}],\"name\":\"sweepTokenWithFee\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"int256\",\"name\":\"amount0Delta\",\"type\":\"int256\"},{\"internalType\":\"int256\",\"name\":\"amount1Delta\",\"type\":\"int256\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"uniswapV3SwapCallback\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountMinimum\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"}],\"name\":\"unwrapWETH9\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountMinimum\",\"type\":\"uint256\"}],\"name\":\"unwrapWETH9\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountMinimum\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"feeBips\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"feeRecipient\",\"type\":\"address\"}],\"name\":\"unwrapWETH9WithFee\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountMinimum\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"feeBips\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"feeRecipient\",\"type\":\"address\"}],\"name\":\"unwrapWETH9WithFee\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"wrapETH\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]", } // SwapRouter02ABI is the input ABI used to generate the binding from. // Deprecated: Use SwapRouter02MetaData.ABI instead. var SwapRouter02ABI = SwapRouter02MetaData.ABI // SwapRouter02 is an auto generated Go binding around an Ethereum contract. type SwapRouter02 struct { SwapRouter02Caller // Read-only binding to the contract SwapRouter02Transactor // Write-only binding to the contract SwapRouter02Filterer // Log filterer for contract events } // SwapRouter02Caller is an auto generated read-only Go binding around an Ethereum contract. type SwapRouter02Caller struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // SwapRouter02Transactor is an auto generated write-only Go binding around an Ethereum contract. type SwapRouter02Transactor struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // SwapRouter02Filterer is an auto generated log filtering Go binding around an Ethereum contract events. type SwapRouter02Filterer struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // SwapRouter02Session is an auto generated Go binding around an Ethereum contract, // with pre-set call and transact options. type SwapRouter02Session struct { Contract *SwapRouter02 // Generic contract binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // SwapRouter02CallerSession is an auto generated read-only Go binding around an Ethereum contract, // with pre-set call options. type SwapRouter02CallerSession struct { Contract *SwapRouter02Caller // Generic contract caller binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session } // SwapRouter02TransactorSession is an auto generated write-only Go binding around an Ethereum contract, // with pre-set transact options. type SwapRouter02TransactorSession struct { Contract *SwapRouter02Transactor // Generic contract transactor binding to set the session for TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // SwapRouter02Raw is an auto generated low-level Go binding around an Ethereum contract. type SwapRouter02Raw struct { Contract *SwapRouter02 // Generic contract binding to access the raw methods on } // SwapRouter02CallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. type SwapRouter02CallerRaw struct { Contract *SwapRouter02Caller // Generic read-only contract binding to access the raw methods on } // SwapRouter02TransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. type SwapRouter02TransactorRaw struct { Contract *SwapRouter02Transactor // Generic write-only contract binding to access the raw methods on } // NewSwapRouter02 creates a new instance of SwapRouter02, bound to a specific deployed contract. func NewSwapRouter02(address common.Address, backend bind.ContractBackend) (*SwapRouter02, error) { contract, err := bindSwapRouter02(address, backend, backend, backend) if err != nil { return nil, err } return &SwapRouter02{SwapRouter02Caller: SwapRouter02Caller{contract: contract}, SwapRouter02Transactor: SwapRouter02Transactor{contract: contract}, SwapRouter02Filterer: SwapRouter02Filterer{contract: contract}}, nil } // NewSwapRouter02Caller creates a new read-only instance of SwapRouter02, bound to a specific deployed contract. func NewSwapRouter02Caller(address common.Address, caller bind.ContractCaller) (*SwapRouter02Caller, error) { contract, err := bindSwapRouter02(address, caller, nil, nil) if err != nil { return nil, err } return &SwapRouter02Caller{contract: contract}, nil } // NewSwapRouter02Transactor creates a new write-only instance of SwapRouter02, bound to a specific deployed contract. func NewSwapRouter02Transactor(address common.Address, transactor bind.ContractTransactor) (*SwapRouter02Transactor, error) { contract, err := bindSwapRouter02(address, nil, transactor, nil) if err != nil { return nil, err } return &SwapRouter02Transactor{contract: contract}, nil } // NewSwapRouter02Filterer creates a new log filterer instance of SwapRouter02, bound to a specific deployed contract. func NewSwapRouter02Filterer(address common.Address, filterer bind.ContractFilterer) (*SwapRouter02Filterer, error) { contract, err := bindSwapRouter02(address, nil, nil, filterer) if err != nil { return nil, err } return &SwapRouter02Filterer{contract: contract}, nil } // bindSwapRouter02 binds a generic wrapper to an already deployed contract. func bindSwapRouter02(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { parsed, err := SwapRouter02MetaData.GetAbi() if err != nil { return nil, err } return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_SwapRouter02 *SwapRouter02Raw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _SwapRouter02.Contract.SwapRouter02Caller.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_SwapRouter02 *SwapRouter02Raw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _SwapRouter02.Contract.SwapRouter02Transactor.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_SwapRouter02 *SwapRouter02Raw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _SwapRouter02.Contract.SwapRouter02Transactor.contract.Transact(opts, method, params...) } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_SwapRouter02 *SwapRouter02CallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _SwapRouter02.Contract.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_SwapRouter02 *SwapRouter02TransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _SwapRouter02.Contract.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_SwapRouter02 *SwapRouter02TransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _SwapRouter02.Contract.contract.Transact(opts, method, params...) } // WETH9 is a free data retrieval call binding the contract method 0x4aa4a4fc. // // Solidity: function WETH9() view returns(address) func (_SwapRouter02 *SwapRouter02Caller) WETH9(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _SwapRouter02.contract.Call(opts, &out, "WETH9") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // WETH9 is a free data retrieval call binding the contract method 0x4aa4a4fc. // // Solidity: function WETH9() view returns(address) func (_SwapRouter02 *SwapRouter02Session) WETH9() (common.Address, error) { return _SwapRouter02.Contract.WETH9(&_SwapRouter02.CallOpts) } // WETH9 is a free data retrieval call binding the contract method 0x4aa4a4fc. // // Solidity: function WETH9() view returns(address) func (_SwapRouter02 *SwapRouter02CallerSession) WETH9() (common.Address, error) { return _SwapRouter02.Contract.WETH9(&_SwapRouter02.CallOpts) } // CheckOracleSlippage is a free data retrieval call binding the contract method 0xefdeed8e. // // Solidity: function checkOracleSlippage(bytes[] paths, uint128[] amounts, uint24 maximumTickDivergence, uint32 secondsAgo) view returns() func (_SwapRouter02 *SwapRouter02Caller) CheckOracleSlippage(opts *bind.CallOpts, paths [][]byte, amounts []*big.Int, maximumTickDivergence *big.Int, secondsAgo uint32) error { var out []interface{} err := _SwapRouter02.contract.Call(opts, &out, "checkOracleSlippage", paths, amounts, maximumTickDivergence, secondsAgo) if err != nil { return err } return err } // CheckOracleSlippage is a free data retrieval call binding the contract method 0xefdeed8e. // // Solidity: function checkOracleSlippage(bytes[] paths, uint128[] amounts, uint24 maximumTickDivergence, uint32 secondsAgo) view returns() func (_SwapRouter02 *SwapRouter02Session) CheckOracleSlippage(paths [][]byte, amounts []*big.Int, maximumTickDivergence *big.Int, secondsAgo uint32) error { return _SwapRouter02.Contract.CheckOracleSlippage(&_SwapRouter02.CallOpts, paths, amounts, maximumTickDivergence, secondsAgo) } // CheckOracleSlippage is a free data retrieval call binding the contract method 0xefdeed8e. // // Solidity: function checkOracleSlippage(bytes[] paths, uint128[] amounts, uint24 maximumTickDivergence, uint32 secondsAgo) view returns() func (_SwapRouter02 *SwapRouter02CallerSession) CheckOracleSlippage(paths [][]byte, amounts []*big.Int, maximumTickDivergence *big.Int, secondsAgo uint32) error { return _SwapRouter02.Contract.CheckOracleSlippage(&_SwapRouter02.CallOpts, paths, amounts, maximumTickDivergence, secondsAgo) } // CheckOracleSlippage0 is a free data retrieval call binding the contract method 0xf25801a7. // // Solidity: function checkOracleSlippage(bytes path, uint24 maximumTickDivergence, uint32 secondsAgo) view returns() func (_SwapRouter02 *SwapRouter02Caller) CheckOracleSlippage0(opts *bind.CallOpts, path []byte, maximumTickDivergence *big.Int, secondsAgo uint32) error { var out []interface{} err := _SwapRouter02.contract.Call(opts, &out, "checkOracleSlippage0", path, maximumTickDivergence, secondsAgo) if err != nil { return err } return err } // CheckOracleSlippage0 is a free data retrieval call binding the contract method 0xf25801a7. // // Solidity: function checkOracleSlippage(bytes path, uint24 maximumTickDivergence, uint32 secondsAgo) view returns() func (_SwapRouter02 *SwapRouter02Session) CheckOracleSlippage0(path []byte, maximumTickDivergence *big.Int, secondsAgo uint32) error { return _SwapRouter02.Contract.CheckOracleSlippage0(&_SwapRouter02.CallOpts, path, maximumTickDivergence, secondsAgo) } // CheckOracleSlippage0 is a free data retrieval call binding the contract method 0xf25801a7. // // Solidity: function checkOracleSlippage(bytes path, uint24 maximumTickDivergence, uint32 secondsAgo) view returns() func (_SwapRouter02 *SwapRouter02CallerSession) CheckOracleSlippage0(path []byte, maximumTickDivergence *big.Int, secondsAgo uint32) error { return _SwapRouter02.Contract.CheckOracleSlippage0(&_SwapRouter02.CallOpts, path, maximumTickDivergence, secondsAgo) } // Factory is a free data retrieval call binding the contract method 0xc45a0155. // // Solidity: function factory() view returns(address) func (_SwapRouter02 *SwapRouter02Caller) Factory(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _SwapRouter02.contract.Call(opts, &out, "factory") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // Factory is a free data retrieval call binding the contract method 0xc45a0155. // // Solidity: function factory() view returns(address) func (_SwapRouter02 *SwapRouter02Session) Factory() (common.Address, error) { return _SwapRouter02.Contract.Factory(&_SwapRouter02.CallOpts) } // Factory is a free data retrieval call binding the contract method 0xc45a0155. // // Solidity: function factory() view returns(address) func (_SwapRouter02 *SwapRouter02CallerSession) Factory() (common.Address, error) { return _SwapRouter02.Contract.Factory(&_SwapRouter02.CallOpts) } // FactoryV2 is a free data retrieval call binding the contract method 0x68e0d4e1. // // Solidity: function factoryV2() view returns(address) func (_SwapRouter02 *SwapRouter02Caller) FactoryV2(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _SwapRouter02.contract.Call(opts, &out, "factoryV2") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // FactoryV2 is a free data retrieval call binding the contract method 0x68e0d4e1. // // Solidity: function factoryV2() view returns(address) func (_SwapRouter02 *SwapRouter02Session) FactoryV2() (common.Address, error) { return _SwapRouter02.Contract.FactoryV2(&_SwapRouter02.CallOpts) } // FactoryV2 is a free data retrieval call binding the contract method 0x68e0d4e1. // // Solidity: function factoryV2() view returns(address) func (_SwapRouter02 *SwapRouter02CallerSession) FactoryV2() (common.Address, error) { return _SwapRouter02.Contract.FactoryV2(&_SwapRouter02.CallOpts) } // PositionManager is a free data retrieval call binding the contract method 0x791b98bc. // // Solidity: function positionManager() view returns(address) func (_SwapRouter02 *SwapRouter02Caller) PositionManager(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _SwapRouter02.contract.Call(opts, &out, "positionManager") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // PositionManager is a free data retrieval call binding the contract method 0x791b98bc. // // Solidity: function positionManager() view returns(address) func (_SwapRouter02 *SwapRouter02Session) PositionManager() (common.Address, error) { return _SwapRouter02.Contract.PositionManager(&_SwapRouter02.CallOpts) } // PositionManager is a free data retrieval call binding the contract method 0x791b98bc. // // Solidity: function positionManager() view returns(address) func (_SwapRouter02 *SwapRouter02CallerSession) PositionManager() (common.Address, error) { return _SwapRouter02.Contract.PositionManager(&_SwapRouter02.CallOpts) } // ApproveMax is a paid mutator transaction binding the contract method 0x571ac8b0. // // Solidity: function approveMax(address token) payable returns() func (_SwapRouter02 *SwapRouter02Transactor) ApproveMax(opts *bind.TransactOpts, token common.Address) (*types.Transaction, error) { return _SwapRouter02.contract.Transact(opts, "approveMax", token) } // ApproveMax is a paid mutator transaction binding the contract method 0x571ac8b0. // // Solidity: function approveMax(address token) payable returns() func (_SwapRouter02 *SwapRouter02Session) ApproveMax(token common.Address) (*types.Transaction, error) { return _SwapRouter02.Contract.ApproveMax(&_SwapRouter02.TransactOpts, token) } // ApproveMax is a paid mutator transaction binding the contract method 0x571ac8b0. // // Solidity: function approveMax(address token) payable returns() func (_SwapRouter02 *SwapRouter02TransactorSession) ApproveMax(token common.Address) (*types.Transaction, error) { return _SwapRouter02.Contract.ApproveMax(&_SwapRouter02.TransactOpts, token) } // ApproveMaxMinusOne is a paid mutator transaction binding the contract method 0xcab372ce. // // Solidity: function approveMaxMinusOne(address token) payable returns() func (_SwapRouter02 *SwapRouter02Transactor) ApproveMaxMinusOne(opts *bind.TransactOpts, token common.Address) (*types.Transaction, error) { return _SwapRouter02.contract.Transact(opts, "approveMaxMinusOne", token) } // ApproveMaxMinusOne is a paid mutator transaction binding the contract method 0xcab372ce. // // Solidity: function approveMaxMinusOne(address token) payable returns() func (_SwapRouter02 *SwapRouter02Session) ApproveMaxMinusOne(token common.Address) (*types.Transaction, error) { return _SwapRouter02.Contract.ApproveMaxMinusOne(&_SwapRouter02.TransactOpts, token) } // ApproveMaxMinusOne is a paid mutator transaction binding the contract method 0xcab372ce. // // Solidity: function approveMaxMinusOne(address token) payable returns() func (_SwapRouter02 *SwapRouter02TransactorSession) ApproveMaxMinusOne(token common.Address) (*types.Transaction, error) { return _SwapRouter02.Contract.ApproveMaxMinusOne(&_SwapRouter02.TransactOpts, token) } // ApproveZeroThenMax is a paid mutator transaction binding the contract method 0x639d71a9. // // Solidity: function approveZeroThenMax(address token) payable returns() func (_SwapRouter02 *SwapRouter02Transactor) ApproveZeroThenMax(opts *bind.TransactOpts, token common.Address) (*types.Transaction, error) { return _SwapRouter02.contract.Transact(opts, "approveZeroThenMax", token) } // ApproveZeroThenMax is a paid mutator transaction binding the contract method 0x639d71a9. // // Solidity: function approveZeroThenMax(address token) payable returns() func (_SwapRouter02 *SwapRouter02Session) ApproveZeroThenMax(token common.Address) (*types.Transaction, error) { return _SwapRouter02.Contract.ApproveZeroThenMax(&_SwapRouter02.TransactOpts, token) } // ApproveZeroThenMax is a paid mutator transaction binding the contract method 0x639d71a9. // // Solidity: function approveZeroThenMax(address token) payable returns() func (_SwapRouter02 *SwapRouter02TransactorSession) ApproveZeroThenMax(token common.Address) (*types.Transaction, error) { return _SwapRouter02.Contract.ApproveZeroThenMax(&_SwapRouter02.TransactOpts, token) } // ApproveZeroThenMaxMinusOne is a paid mutator transaction binding the contract method 0xab3fdd50. // // Solidity: function approveZeroThenMaxMinusOne(address token) payable returns() func (_SwapRouter02 *SwapRouter02Transactor) ApproveZeroThenMaxMinusOne(opts *bind.TransactOpts, token common.Address) (*types.Transaction, error) { return _SwapRouter02.contract.Transact(opts, "approveZeroThenMaxMinusOne", token) } // ApproveZeroThenMaxMinusOne is a paid mutator transaction binding the contract method 0xab3fdd50. // // Solidity: function approveZeroThenMaxMinusOne(address token) payable returns() func (_SwapRouter02 *SwapRouter02Session) ApproveZeroThenMaxMinusOne(token common.Address) (*types.Transaction, error) { return _SwapRouter02.Contract.ApproveZeroThenMaxMinusOne(&_SwapRouter02.TransactOpts, token) } // ApproveZeroThenMaxMinusOne is a paid mutator transaction binding the contract method 0xab3fdd50. // // Solidity: function approveZeroThenMaxMinusOne(address token) payable returns() func (_SwapRouter02 *SwapRouter02TransactorSession) ApproveZeroThenMaxMinusOne(token common.Address) (*types.Transaction, error) { return _SwapRouter02.Contract.ApproveZeroThenMaxMinusOne(&_SwapRouter02.TransactOpts, token) } // CallPositionManager is a paid mutator transaction binding the contract method 0xb3a2af13. // // Solidity: function callPositionManager(bytes data) payable returns(bytes result) func (_SwapRouter02 *SwapRouter02Transactor) CallPositionManager(opts *bind.TransactOpts, data []byte) (*types.Transaction, error) { return _SwapRouter02.contract.Transact(opts, "callPositionManager", data) } // CallPositionManager is a paid mutator transaction binding the contract method 0xb3a2af13. // // Solidity: function callPositionManager(bytes data) payable returns(bytes result) func (_SwapRouter02 *SwapRouter02Session) CallPositionManager(data []byte) (*types.Transaction, error) { return _SwapRouter02.Contract.CallPositionManager(&_SwapRouter02.TransactOpts, data) } // CallPositionManager is a paid mutator transaction binding the contract method 0xb3a2af13. // // Solidity: function callPositionManager(bytes data) payable returns(bytes result) func (_SwapRouter02 *SwapRouter02TransactorSession) CallPositionManager(data []byte) (*types.Transaction, error) { return _SwapRouter02.Contract.CallPositionManager(&_SwapRouter02.TransactOpts, data) } // ExactInput is a paid mutator transaction binding the contract method 0xb858183f. // // Solidity: function exactInput((bytes,address,uint256,uint256) params) payable returns(uint256 amountOut) func (_SwapRouter02 *SwapRouter02Transactor) ExactInput(opts *bind.TransactOpts, params IV3SwapRouterExactInputParams) (*types.Transaction, error) { return _SwapRouter02.contract.Transact(opts, "exactInput", params) } // ExactInput is a paid mutator transaction binding the contract method 0xb858183f. // // Solidity: function exactInput((bytes,address,uint256,uint256) params) payable returns(uint256 amountOut) func (_SwapRouter02 *SwapRouter02Session) ExactInput(params IV3SwapRouterExactInputParams) (*types.Transaction, error) { return _SwapRouter02.Contract.ExactInput(&_SwapRouter02.TransactOpts, params) } // ExactInput is a paid mutator transaction binding the contract method 0xb858183f. // // Solidity: function exactInput((bytes,address,uint256,uint256) params) payable returns(uint256 amountOut) func (_SwapRouter02 *SwapRouter02TransactorSession) ExactInput(params IV3SwapRouterExactInputParams) (*types.Transaction, error) { return _SwapRouter02.Contract.ExactInput(&_SwapRouter02.TransactOpts, params) } // ExactInputSingle is a paid mutator transaction binding the contract method 0x04e45aaf. // // Solidity: function exactInputSingle((address,address,uint24,address,uint256,uint256,uint160) params) payable returns(uint256 amountOut) func (_SwapRouter02 *SwapRouter02Transactor) ExactInputSingle(opts *bind.TransactOpts, params IV3SwapRouterExactInputSingleParams) (*types.Transaction, error) { return _SwapRouter02.contract.Transact(opts, "exactInputSingle", params) } // ExactInputSingle is a paid mutator transaction binding the contract method 0x04e45aaf. // // Solidity: function exactInputSingle((address,address,uint24,address,uint256,uint256,uint160) params) payable returns(uint256 amountOut) func (_SwapRouter02 *SwapRouter02Session) ExactInputSingle(params IV3SwapRouterExactInputSingleParams) (*types.Transaction, error) { return _SwapRouter02.Contract.ExactInputSingle(&_SwapRouter02.TransactOpts, params) } // ExactInputSingle is a paid mutator transaction binding the contract method 0x04e45aaf. // // Solidity: function exactInputSingle((address,address,uint24,address,uint256,uint256,uint160) params) payable returns(uint256 amountOut) func (_SwapRouter02 *SwapRouter02TransactorSession) ExactInputSingle(params IV3SwapRouterExactInputSingleParams) (*types.Transaction, error) { return _SwapRouter02.Contract.ExactInputSingle(&_SwapRouter02.TransactOpts, params) } // ExactOutput is a paid mutator transaction binding the contract method 0x09b81346. // // Solidity: function exactOutput((bytes,address,uint256,uint256) params) payable returns(uint256 amountIn) func (_SwapRouter02 *SwapRouter02Transactor) ExactOutput(opts *bind.TransactOpts, params IV3SwapRouterExactOutputParams) (*types.Transaction, error) { return _SwapRouter02.contract.Transact(opts, "exactOutput", params) } // ExactOutput is a paid mutator transaction binding the contract method 0x09b81346. // // Solidity: function exactOutput((bytes,address,uint256,uint256) params) payable returns(uint256 amountIn) func (_SwapRouter02 *SwapRouter02Session) ExactOutput(params IV3SwapRouterExactOutputParams) (*types.Transaction, error) { return _SwapRouter02.Contract.ExactOutput(&_SwapRouter02.TransactOpts, params) } // ExactOutput is a paid mutator transaction binding the contract method 0x09b81346. // // Solidity: function exactOutput((bytes,address,uint256,uint256) params) payable returns(uint256 amountIn) func (_SwapRouter02 *SwapRouter02TransactorSession) ExactOutput(params IV3SwapRouterExactOutputParams) (*types.Transaction, error) { return _SwapRouter02.Contract.ExactOutput(&_SwapRouter02.TransactOpts, params) } // ExactOutputSingle is a paid mutator transaction binding the contract method 0x5023b4df. // // Solidity: function exactOutputSingle((address,address,uint24,address,uint256,uint256,uint160) params) payable returns(uint256 amountIn) func (_SwapRouter02 *SwapRouter02Transactor) ExactOutputSingle(opts *bind.TransactOpts, params IV3SwapRouterExactOutputSingleParams) (*types.Transaction, error) { return _SwapRouter02.contract.Transact(opts, "exactOutputSingle", params) } // ExactOutputSingle is a paid mutator transaction binding the contract method 0x5023b4df. // // Solidity: function exactOutputSingle((address,address,uint24,address,uint256,uint256,uint160) params) payable returns(uint256 amountIn) func (_SwapRouter02 *SwapRouter02Session) ExactOutputSingle(params IV3SwapRouterExactOutputSingleParams) (*types.Transaction, error) { return _SwapRouter02.Contract.ExactOutputSingle(&_SwapRouter02.TransactOpts, params) } // ExactOutputSingle is a paid mutator transaction binding the contract method 0x5023b4df. // // Solidity: function exactOutputSingle((address,address,uint24,address,uint256,uint256,uint160) params) payable returns(uint256 amountIn) func (_SwapRouter02 *SwapRouter02TransactorSession) ExactOutputSingle(params IV3SwapRouterExactOutputSingleParams) (*types.Transaction, error) { return _SwapRouter02.Contract.ExactOutputSingle(&_SwapRouter02.TransactOpts, params) } // GetApprovalType is a paid mutator transaction binding the contract method 0xdee00f35. // // Solidity: function getApprovalType(address token, uint256 amount) returns(uint8) func (_SwapRouter02 *SwapRouter02Transactor) GetApprovalType(opts *bind.TransactOpts, token common.Address, amount *big.Int) (*types.Transaction, error) { return _SwapRouter02.contract.Transact(opts, "getApprovalType", token, amount) } // GetApprovalType is a paid mutator transaction binding the contract method 0xdee00f35. // // Solidity: function getApprovalType(address token, uint256 amount) returns(uint8) func (_SwapRouter02 *SwapRouter02Session) GetApprovalType(token common.Address, amount *big.Int) (*types.Transaction, error) { return _SwapRouter02.Contract.GetApprovalType(&_SwapRouter02.TransactOpts, token, amount) } // GetApprovalType is a paid mutator transaction binding the contract method 0xdee00f35. // // Solidity: function getApprovalType(address token, uint256 amount) returns(uint8) func (_SwapRouter02 *SwapRouter02TransactorSession) GetApprovalType(token common.Address, amount *big.Int) (*types.Transaction, error) { return _SwapRouter02.Contract.GetApprovalType(&_SwapRouter02.TransactOpts, token, amount) } // IncreaseLiquidity is a paid mutator transaction binding the contract method 0xf100b205. // // Solidity: function increaseLiquidity((address,address,uint256,uint256,uint256) params) payable returns(bytes result) func (_SwapRouter02 *SwapRouter02Transactor) IncreaseLiquidity(opts *bind.TransactOpts, params IApproveAndCallIncreaseLiquidityParams) (*types.Transaction, error) { return _SwapRouter02.contract.Transact(opts, "increaseLiquidity", params) } // IncreaseLiquidity is a paid mutator transaction binding the contract method 0xf100b205. // // Solidity: function increaseLiquidity((address,address,uint256,uint256,uint256) params) payable returns(bytes result) func (_SwapRouter02 *SwapRouter02Session) IncreaseLiquidity(params IApproveAndCallIncreaseLiquidityParams) (*types.Transaction, error) { return _SwapRouter02.Contract.IncreaseLiquidity(&_SwapRouter02.TransactOpts, params) } // IncreaseLiquidity is a paid mutator transaction binding the contract method 0xf100b205. // // Solidity: function increaseLiquidity((address,address,uint256,uint256,uint256) params) payable returns(bytes result) func (_SwapRouter02 *SwapRouter02TransactorSession) IncreaseLiquidity(params IApproveAndCallIncreaseLiquidityParams) (*types.Transaction, error) { return _SwapRouter02.Contract.IncreaseLiquidity(&_SwapRouter02.TransactOpts, params) } // Mint is a paid mutator transaction binding the contract method 0x11ed56c9. // // Solidity: function mint((address,address,uint24,int24,int24,uint256,uint256,address) params) payable returns(bytes result) func (_SwapRouter02 *SwapRouter02Transactor) Mint(opts *bind.TransactOpts, params IApproveAndCallMintParams) (*types.Transaction, error) { return _SwapRouter02.contract.Transact(opts, "mint", params) } // Mint is a paid mutator transaction binding the contract method 0x11ed56c9. // // Solidity: function mint((address,address,uint24,int24,int24,uint256,uint256,address) params) payable returns(bytes result) func (_SwapRouter02 *SwapRouter02Session) Mint(params IApproveAndCallMintParams) (*types.Transaction, error) { return _SwapRouter02.Contract.Mint(&_SwapRouter02.TransactOpts, params) } // Mint is a paid mutator transaction binding the contract method 0x11ed56c9. // // Solidity: function mint((address,address,uint24,int24,int24,uint256,uint256,address) params) payable returns(bytes result) func (_SwapRouter02 *SwapRouter02TransactorSession) Mint(params IApproveAndCallMintParams) (*types.Transaction, error) { return _SwapRouter02.Contract.Mint(&_SwapRouter02.TransactOpts, params) } // Multicall is a paid mutator transaction binding the contract method 0x1f0464d1. // // Solidity: function multicall(bytes32 previousBlockhash, bytes[] data) payable returns(bytes[]) func (_SwapRouter02 *SwapRouter02Transactor) Multicall(opts *bind.TransactOpts, previousBlockhash [32]byte, data [][]byte) (*types.Transaction, error) { return _SwapRouter02.contract.Transact(opts, "multicall", previousBlockhash, data) } // Multicall is a paid mutator transaction binding the contract method 0x1f0464d1. // // Solidity: function multicall(bytes32 previousBlockhash, bytes[] data) payable returns(bytes[]) func (_SwapRouter02 *SwapRouter02Session) Multicall(previousBlockhash [32]byte, data [][]byte) (*types.Transaction, error) { return _SwapRouter02.Contract.Multicall(&_SwapRouter02.TransactOpts, previousBlockhash, data) } // Multicall is a paid mutator transaction binding the contract method 0x1f0464d1. // // Solidity: function multicall(bytes32 previousBlockhash, bytes[] data) payable returns(bytes[]) func (_SwapRouter02 *SwapRouter02TransactorSession) Multicall(previousBlockhash [32]byte, data [][]byte) (*types.Transaction, error) { return _SwapRouter02.Contract.Multicall(&_SwapRouter02.TransactOpts, previousBlockhash, data) } // Multicall0 is a paid mutator transaction binding the contract method 0x5ae401dc. // // Solidity: function multicall(uint256 deadline, bytes[] data) payable returns(bytes[]) func (_SwapRouter02 *SwapRouter02Transactor) Multicall0(opts *bind.TransactOpts, deadline *big.Int, data [][]byte) (*types.Transaction, error) { return _SwapRouter02.contract.Transact(opts, "multicall0", deadline, data) } // Multicall0 is a paid mutator transaction binding the contract method 0x5ae401dc. // // Solidity: function multicall(uint256 deadline, bytes[] data) payable returns(bytes[]) func (_SwapRouter02 *SwapRouter02Session) Multicall0(deadline *big.Int, data [][]byte) (*types.Transaction, error) { return _SwapRouter02.Contract.Multicall0(&_SwapRouter02.TransactOpts, deadline, data) } // Multicall0 is a paid mutator transaction binding the contract method 0x5ae401dc. // // Solidity: function multicall(uint256 deadline, bytes[] data) payable returns(bytes[]) func (_SwapRouter02 *SwapRouter02TransactorSession) Multicall0(deadline *big.Int, data [][]byte) (*types.Transaction, error) { return _SwapRouter02.Contract.Multicall0(&_SwapRouter02.TransactOpts, deadline, data) } // Multicall1 is a paid mutator transaction binding the contract method 0xac9650d8. // // Solidity: function multicall(bytes[] data) payable returns(bytes[] results) func (_SwapRouter02 *SwapRouter02Transactor) Multicall1(opts *bind.TransactOpts, data [][]byte) (*types.Transaction, error) { return _SwapRouter02.contract.Transact(opts, "multicall1", data) } // Multicall1 is a paid mutator transaction binding the contract method 0xac9650d8. // // Solidity: function multicall(bytes[] data) payable returns(bytes[] results) func (_SwapRouter02 *SwapRouter02Session) Multicall1(data [][]byte) (*types.Transaction, error) { return _SwapRouter02.Contract.Multicall1(&_SwapRouter02.TransactOpts, data) } // Multicall1 is a paid mutator transaction binding the contract method 0xac9650d8. // // Solidity: function multicall(bytes[] data) payable returns(bytes[] results) func (_SwapRouter02 *SwapRouter02TransactorSession) Multicall1(data [][]byte) (*types.Transaction, error) { return _SwapRouter02.Contract.Multicall1(&_SwapRouter02.TransactOpts, data) } // Pull is a paid mutator transaction binding the contract method 0xf2d5d56b. // // Solidity: function pull(address token, uint256 value) payable returns() func (_SwapRouter02 *SwapRouter02Transactor) Pull(opts *bind.TransactOpts, token common.Address, value *big.Int) (*types.Transaction, error) { return _SwapRouter02.contract.Transact(opts, "pull", token, value) } // Pull is a paid mutator transaction binding the contract method 0xf2d5d56b. // // Solidity: function pull(address token, uint256 value) payable returns() func (_SwapRouter02 *SwapRouter02Session) Pull(token common.Address, value *big.Int) (*types.Transaction, error) { return _SwapRouter02.Contract.Pull(&_SwapRouter02.TransactOpts, token, value) } // Pull is a paid mutator transaction binding the contract method 0xf2d5d56b. // // Solidity: function pull(address token, uint256 value) payable returns() func (_SwapRouter02 *SwapRouter02TransactorSession) Pull(token common.Address, value *big.Int) (*types.Transaction, error) { return _SwapRouter02.Contract.Pull(&_SwapRouter02.TransactOpts, token, value) } // RefundETH is a paid mutator transaction binding the contract method 0x12210e8a. // // Solidity: function refundETH() payable returns() func (_SwapRouter02 *SwapRouter02Transactor) RefundETH(opts *bind.TransactOpts) (*types.Transaction, error) { return _SwapRouter02.contract.Transact(opts, "refundETH") } // RefundETH is a paid mutator transaction binding the contract method 0x12210e8a. // // Solidity: function refundETH() payable returns() func (_SwapRouter02 *SwapRouter02Session) RefundETH() (*types.Transaction, error) { return _SwapRouter02.Contract.RefundETH(&_SwapRouter02.TransactOpts) } // RefundETH is a paid mutator transaction binding the contract method 0x12210e8a. // // Solidity: function refundETH() payable returns() func (_SwapRouter02 *SwapRouter02TransactorSession) RefundETH() (*types.Transaction, error) { return _SwapRouter02.Contract.RefundETH(&_SwapRouter02.TransactOpts) } // SelfPermit is a paid mutator transaction binding the contract method 0xf3995c67. // // Solidity: function selfPermit(address token, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() func (_SwapRouter02 *SwapRouter02Transactor) SelfPermit(opts *bind.TransactOpts, token common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _SwapRouter02.contract.Transact(opts, "selfPermit", token, value, deadline, v, r, s) } // SelfPermit is a paid mutator transaction binding the contract method 0xf3995c67. // // Solidity: function selfPermit(address token, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() func (_SwapRouter02 *SwapRouter02Session) SelfPermit(token common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _SwapRouter02.Contract.SelfPermit(&_SwapRouter02.TransactOpts, token, value, deadline, v, r, s) } // SelfPermit is a paid mutator transaction binding the contract method 0xf3995c67. // // Solidity: function selfPermit(address token, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() func (_SwapRouter02 *SwapRouter02TransactorSession) SelfPermit(token common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _SwapRouter02.Contract.SelfPermit(&_SwapRouter02.TransactOpts, token, value, deadline, v, r, s) } // SelfPermitAllowed is a paid mutator transaction binding the contract method 0x4659a494. // // Solidity: function selfPermitAllowed(address token, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) payable returns() func (_SwapRouter02 *SwapRouter02Transactor) SelfPermitAllowed(opts *bind.TransactOpts, token common.Address, nonce *big.Int, expiry *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _SwapRouter02.contract.Transact(opts, "selfPermitAllowed", token, nonce, expiry, v, r, s) } // SelfPermitAllowed is a paid mutator transaction binding the contract method 0x4659a494. // // Solidity: function selfPermitAllowed(address token, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) payable returns() func (_SwapRouter02 *SwapRouter02Session) SelfPermitAllowed(token common.Address, nonce *big.Int, expiry *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _SwapRouter02.Contract.SelfPermitAllowed(&_SwapRouter02.TransactOpts, token, nonce, expiry, v, r, s) } // SelfPermitAllowed is a paid mutator transaction binding the contract method 0x4659a494. // // Solidity: function selfPermitAllowed(address token, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) payable returns() func (_SwapRouter02 *SwapRouter02TransactorSession) SelfPermitAllowed(token common.Address, nonce *big.Int, expiry *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _SwapRouter02.Contract.SelfPermitAllowed(&_SwapRouter02.TransactOpts, token, nonce, expiry, v, r, s) } // SelfPermitAllowedIfNecessary is a paid mutator transaction binding the contract method 0xa4a78f0c. // // Solidity: function selfPermitAllowedIfNecessary(address token, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) payable returns() func (_SwapRouter02 *SwapRouter02Transactor) SelfPermitAllowedIfNecessary(opts *bind.TransactOpts, token common.Address, nonce *big.Int, expiry *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _SwapRouter02.contract.Transact(opts, "selfPermitAllowedIfNecessary", token, nonce, expiry, v, r, s) } // SelfPermitAllowedIfNecessary is a paid mutator transaction binding the contract method 0xa4a78f0c. // // Solidity: function selfPermitAllowedIfNecessary(address token, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) payable returns() func (_SwapRouter02 *SwapRouter02Session) SelfPermitAllowedIfNecessary(token common.Address, nonce *big.Int, expiry *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _SwapRouter02.Contract.SelfPermitAllowedIfNecessary(&_SwapRouter02.TransactOpts, token, nonce, expiry, v, r, s) } // SelfPermitAllowedIfNecessary is a paid mutator transaction binding the contract method 0xa4a78f0c. // // Solidity: function selfPermitAllowedIfNecessary(address token, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) payable returns() func (_SwapRouter02 *SwapRouter02TransactorSession) SelfPermitAllowedIfNecessary(token common.Address, nonce *big.Int, expiry *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _SwapRouter02.Contract.SelfPermitAllowedIfNecessary(&_SwapRouter02.TransactOpts, token, nonce, expiry, v, r, s) } // SelfPermitIfNecessary is a paid mutator transaction binding the contract method 0xc2e3140a. // // Solidity: function selfPermitIfNecessary(address token, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() func (_SwapRouter02 *SwapRouter02Transactor) SelfPermitIfNecessary(opts *bind.TransactOpts, token common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _SwapRouter02.contract.Transact(opts, "selfPermitIfNecessary", token, value, deadline, v, r, s) } // SelfPermitIfNecessary is a paid mutator transaction binding the contract method 0xc2e3140a. // // Solidity: function selfPermitIfNecessary(address token, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() func (_SwapRouter02 *SwapRouter02Session) SelfPermitIfNecessary(token common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _SwapRouter02.Contract.SelfPermitIfNecessary(&_SwapRouter02.TransactOpts, token, value, deadline, v, r, s) } // SelfPermitIfNecessary is a paid mutator transaction binding the contract method 0xc2e3140a. // // Solidity: function selfPermitIfNecessary(address token, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() func (_SwapRouter02 *SwapRouter02TransactorSession) SelfPermitIfNecessary(token common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _SwapRouter02.Contract.SelfPermitIfNecessary(&_SwapRouter02.TransactOpts, token, value, deadline, v, r, s) } // SwapExactTokensForTokens is a paid mutator transaction binding the contract method 0x472b43f3. // // Solidity: function swapExactTokensForTokens(uint256 amountIn, uint256 amountOutMin, address[] path, address to) payable returns(uint256 amountOut) func (_SwapRouter02 *SwapRouter02Transactor) SwapExactTokensForTokens(opts *bind.TransactOpts, amountIn *big.Int, amountOutMin *big.Int, path []common.Address, to common.Address) (*types.Transaction, error) { return _SwapRouter02.contract.Transact(opts, "swapExactTokensForTokens", amountIn, amountOutMin, path, to) } // SwapExactTokensForTokens is a paid mutator transaction binding the contract method 0x472b43f3. // // Solidity: function swapExactTokensForTokens(uint256 amountIn, uint256 amountOutMin, address[] path, address to) payable returns(uint256 amountOut) func (_SwapRouter02 *SwapRouter02Session) SwapExactTokensForTokens(amountIn *big.Int, amountOutMin *big.Int, path []common.Address, to common.Address) (*types.Transaction, error) { return _SwapRouter02.Contract.SwapExactTokensForTokens(&_SwapRouter02.TransactOpts, amountIn, amountOutMin, path, to) } // SwapExactTokensForTokens is a paid mutator transaction binding the contract method 0x472b43f3. // // Solidity: function swapExactTokensForTokens(uint256 amountIn, uint256 amountOutMin, address[] path, address to) payable returns(uint256 amountOut) func (_SwapRouter02 *SwapRouter02TransactorSession) SwapExactTokensForTokens(amountIn *big.Int, amountOutMin *big.Int, path []common.Address, to common.Address) (*types.Transaction, error) { return _SwapRouter02.Contract.SwapExactTokensForTokens(&_SwapRouter02.TransactOpts, amountIn, amountOutMin, path, to) } // SwapTokensForExactTokens is a paid mutator transaction binding the contract method 0x42712a67. // // Solidity: function swapTokensForExactTokens(uint256 amountOut, uint256 amountInMax, address[] path, address to) payable returns(uint256 amountIn) func (_SwapRouter02 *SwapRouter02Transactor) SwapTokensForExactTokens(opts *bind.TransactOpts, amountOut *big.Int, amountInMax *big.Int, path []common.Address, to common.Address) (*types.Transaction, error) { return _SwapRouter02.contract.Transact(opts, "swapTokensForExactTokens", amountOut, amountInMax, path, to) } // SwapTokensForExactTokens is a paid mutator transaction binding the contract method 0x42712a67. // // Solidity: function swapTokensForExactTokens(uint256 amountOut, uint256 amountInMax, address[] path, address to) payable returns(uint256 amountIn) func (_SwapRouter02 *SwapRouter02Session) SwapTokensForExactTokens(amountOut *big.Int, amountInMax *big.Int, path []common.Address, to common.Address) (*types.Transaction, error) { return _SwapRouter02.Contract.SwapTokensForExactTokens(&_SwapRouter02.TransactOpts, amountOut, amountInMax, path, to) } // SwapTokensForExactTokens is a paid mutator transaction binding the contract method 0x42712a67. // // Solidity: function swapTokensForExactTokens(uint256 amountOut, uint256 amountInMax, address[] path, address to) payable returns(uint256 amountIn) func (_SwapRouter02 *SwapRouter02TransactorSession) SwapTokensForExactTokens(amountOut *big.Int, amountInMax *big.Int, path []common.Address, to common.Address) (*types.Transaction, error) { return _SwapRouter02.Contract.SwapTokensForExactTokens(&_SwapRouter02.TransactOpts, amountOut, amountInMax, path, to) } // SweepToken is a paid mutator transaction binding the contract method 0xdf2ab5bb. // // Solidity: function sweepToken(address token, uint256 amountMinimum, address recipient) payable returns() func (_SwapRouter02 *SwapRouter02Transactor) SweepToken(opts *bind.TransactOpts, token common.Address, amountMinimum *big.Int, recipient common.Address) (*types.Transaction, error) { return _SwapRouter02.contract.Transact(opts, "sweepToken", token, amountMinimum, recipient) } // SweepToken is a paid mutator transaction binding the contract method 0xdf2ab5bb. // // Solidity: function sweepToken(address token, uint256 amountMinimum, address recipient) payable returns() func (_SwapRouter02 *SwapRouter02Session) SweepToken(token common.Address, amountMinimum *big.Int, recipient common.Address) (*types.Transaction, error) { return _SwapRouter02.Contract.SweepToken(&_SwapRouter02.TransactOpts, token, amountMinimum, recipient) } // SweepToken is a paid mutator transaction binding the contract method 0xdf2ab5bb. // // Solidity: function sweepToken(address token, uint256 amountMinimum, address recipient) payable returns() func (_SwapRouter02 *SwapRouter02TransactorSession) SweepToken(token common.Address, amountMinimum *big.Int, recipient common.Address) (*types.Transaction, error) { return _SwapRouter02.Contract.SweepToken(&_SwapRouter02.TransactOpts, token, amountMinimum, recipient) } // SweepToken0 is a paid mutator transaction binding the contract method 0xe90a182f. // // Solidity: function sweepToken(address token, uint256 amountMinimum) payable returns() func (_SwapRouter02 *SwapRouter02Transactor) SweepToken0(opts *bind.TransactOpts, token common.Address, amountMinimum *big.Int) (*types.Transaction, error) { return _SwapRouter02.contract.Transact(opts, "sweepToken0", token, amountMinimum) } // SweepToken0 is a paid mutator transaction binding the contract method 0xe90a182f. // // Solidity: function sweepToken(address token, uint256 amountMinimum) payable returns() func (_SwapRouter02 *SwapRouter02Session) SweepToken0(token common.Address, amountMinimum *big.Int) (*types.Transaction, error) { return _SwapRouter02.Contract.SweepToken0(&_SwapRouter02.TransactOpts, token, amountMinimum) } // SweepToken0 is a paid mutator transaction binding the contract method 0xe90a182f. // // Solidity: function sweepToken(address token, uint256 amountMinimum) payable returns() func (_SwapRouter02 *SwapRouter02TransactorSession) SweepToken0(token common.Address, amountMinimum *big.Int) (*types.Transaction, error) { return _SwapRouter02.Contract.SweepToken0(&_SwapRouter02.TransactOpts, token, amountMinimum) } // SweepTokenWithFee is a paid mutator transaction binding the contract method 0x3068c554. // // Solidity: function sweepTokenWithFee(address token, uint256 amountMinimum, uint256 feeBips, address feeRecipient) payable returns() func (_SwapRouter02 *SwapRouter02Transactor) SweepTokenWithFee(opts *bind.TransactOpts, token common.Address, amountMinimum *big.Int, feeBips *big.Int, feeRecipient common.Address) (*types.Transaction, error) { return _SwapRouter02.contract.Transact(opts, "sweepTokenWithFee", token, amountMinimum, feeBips, feeRecipient) } // SweepTokenWithFee is a paid mutator transaction binding the contract method 0x3068c554. // // Solidity: function sweepTokenWithFee(address token, uint256 amountMinimum, uint256 feeBips, address feeRecipient) payable returns() func (_SwapRouter02 *SwapRouter02Session) SweepTokenWithFee(token common.Address, amountMinimum *big.Int, feeBips *big.Int, feeRecipient common.Address) (*types.Transaction, error) { return _SwapRouter02.Contract.SweepTokenWithFee(&_SwapRouter02.TransactOpts, token, amountMinimum, feeBips, feeRecipient) } // SweepTokenWithFee is a paid mutator transaction binding the contract method 0x3068c554. // // Solidity: function sweepTokenWithFee(address token, uint256 amountMinimum, uint256 feeBips, address feeRecipient) payable returns() func (_SwapRouter02 *SwapRouter02TransactorSession) SweepTokenWithFee(token common.Address, amountMinimum *big.Int, feeBips *big.Int, feeRecipient common.Address) (*types.Transaction, error) { return _SwapRouter02.Contract.SweepTokenWithFee(&_SwapRouter02.TransactOpts, token, amountMinimum, feeBips, feeRecipient) } // SweepTokenWithFee0 is a paid mutator transaction binding the contract method 0xe0e189a0. // // Solidity: function sweepTokenWithFee(address token, uint256 amountMinimum, address recipient, uint256 feeBips, address feeRecipient) payable returns() func (_SwapRouter02 *SwapRouter02Transactor) SweepTokenWithFee0(opts *bind.TransactOpts, token common.Address, amountMinimum *big.Int, recipient common.Address, feeBips *big.Int, feeRecipient common.Address) (*types.Transaction, error) { return _SwapRouter02.contract.Transact(opts, "sweepTokenWithFee0", token, amountMinimum, recipient, feeBips, feeRecipient) } // SweepTokenWithFee0 is a paid mutator transaction binding the contract method 0xe0e189a0. // // Solidity: function sweepTokenWithFee(address token, uint256 amountMinimum, address recipient, uint256 feeBips, address feeRecipient) payable returns() func (_SwapRouter02 *SwapRouter02Session) SweepTokenWithFee0(token common.Address, amountMinimum *big.Int, recipient common.Address, feeBips *big.Int, feeRecipient common.Address) (*types.Transaction, error) { return _SwapRouter02.Contract.SweepTokenWithFee0(&_SwapRouter02.TransactOpts, token, amountMinimum, recipient, feeBips, feeRecipient) } // SweepTokenWithFee0 is a paid mutator transaction binding the contract method 0xe0e189a0. // // Solidity: function sweepTokenWithFee(address token, uint256 amountMinimum, address recipient, uint256 feeBips, address feeRecipient) payable returns() func (_SwapRouter02 *SwapRouter02TransactorSession) SweepTokenWithFee0(token common.Address, amountMinimum *big.Int, recipient common.Address, feeBips *big.Int, feeRecipient common.Address) (*types.Transaction, error) { return _SwapRouter02.Contract.SweepTokenWithFee0(&_SwapRouter02.TransactOpts, token, amountMinimum, recipient, feeBips, feeRecipient) } // UniswapV3SwapCallback is a paid mutator transaction binding the contract method 0xfa461e33. // // Solidity: function uniswapV3SwapCallback(int256 amount0Delta, int256 amount1Delta, bytes _data) returns() func (_SwapRouter02 *SwapRouter02Transactor) UniswapV3SwapCallback(opts *bind.TransactOpts, amount0Delta *big.Int, amount1Delta *big.Int, _data []byte) (*types.Transaction, error) { return _SwapRouter02.contract.Transact(opts, "uniswapV3SwapCallback", amount0Delta, amount1Delta, _data) } // UniswapV3SwapCallback is a paid mutator transaction binding the contract method 0xfa461e33. // // Solidity: function uniswapV3SwapCallback(int256 amount0Delta, int256 amount1Delta, bytes _data) returns() func (_SwapRouter02 *SwapRouter02Session) UniswapV3SwapCallback(amount0Delta *big.Int, amount1Delta *big.Int, _data []byte) (*types.Transaction, error) { return _SwapRouter02.Contract.UniswapV3SwapCallback(&_SwapRouter02.TransactOpts, amount0Delta, amount1Delta, _data) } // UniswapV3SwapCallback is a paid mutator transaction binding the contract method 0xfa461e33. // // Solidity: function uniswapV3SwapCallback(int256 amount0Delta, int256 amount1Delta, bytes _data) returns() func (_SwapRouter02 *SwapRouter02TransactorSession) UniswapV3SwapCallback(amount0Delta *big.Int, amount1Delta *big.Int, _data []byte) (*types.Transaction, error) { return _SwapRouter02.Contract.UniswapV3SwapCallback(&_SwapRouter02.TransactOpts, amount0Delta, amount1Delta, _data) } // UnwrapWETH9 is a paid mutator transaction binding the contract method 0x49404b7c. // // Solidity: function unwrapWETH9(uint256 amountMinimum, address recipient) payable returns() func (_SwapRouter02 *SwapRouter02Transactor) UnwrapWETH9(opts *bind.TransactOpts, amountMinimum *big.Int, recipient common.Address) (*types.Transaction, error) { return _SwapRouter02.contract.Transact(opts, "unwrapWETH9", amountMinimum, recipient) } // UnwrapWETH9 is a paid mutator transaction binding the contract method 0x49404b7c. // // Solidity: function unwrapWETH9(uint256 amountMinimum, address recipient) payable returns() func (_SwapRouter02 *SwapRouter02Session) UnwrapWETH9(amountMinimum *big.Int, recipient common.Address) (*types.Transaction, error) { return _SwapRouter02.Contract.UnwrapWETH9(&_SwapRouter02.TransactOpts, amountMinimum, recipient) } // UnwrapWETH9 is a paid mutator transaction binding the contract method 0x49404b7c. // // Solidity: function unwrapWETH9(uint256 amountMinimum, address recipient) payable returns() func (_SwapRouter02 *SwapRouter02TransactorSession) UnwrapWETH9(amountMinimum *big.Int, recipient common.Address) (*types.Transaction, error) { return _SwapRouter02.Contract.UnwrapWETH9(&_SwapRouter02.TransactOpts, amountMinimum, recipient) } // UnwrapWETH90 is a paid mutator transaction binding the contract method 0x49616997. // // Solidity: function unwrapWETH9(uint256 amountMinimum) payable returns() func (_SwapRouter02 *SwapRouter02Transactor) UnwrapWETH90(opts *bind.TransactOpts, amountMinimum *big.Int) (*types.Transaction, error) { return _SwapRouter02.contract.Transact(opts, "unwrapWETH90", amountMinimum) } // UnwrapWETH90 is a paid mutator transaction binding the contract method 0x49616997. // // Solidity: function unwrapWETH9(uint256 amountMinimum) payable returns() func (_SwapRouter02 *SwapRouter02Session) UnwrapWETH90(amountMinimum *big.Int) (*types.Transaction, error) { return _SwapRouter02.Contract.UnwrapWETH90(&_SwapRouter02.TransactOpts, amountMinimum) } // UnwrapWETH90 is a paid mutator transaction binding the contract method 0x49616997. // // Solidity: function unwrapWETH9(uint256 amountMinimum) payable returns() func (_SwapRouter02 *SwapRouter02TransactorSession) UnwrapWETH90(amountMinimum *big.Int) (*types.Transaction, error) { return _SwapRouter02.Contract.UnwrapWETH90(&_SwapRouter02.TransactOpts, amountMinimum) } // UnwrapWETH9WithFee is a paid mutator transaction binding the contract method 0x9b2c0a37. // // Solidity: function unwrapWETH9WithFee(uint256 amountMinimum, address recipient, uint256 feeBips, address feeRecipient) payable returns() func (_SwapRouter02 *SwapRouter02Transactor) UnwrapWETH9WithFee(opts *bind.TransactOpts, amountMinimum *big.Int, recipient common.Address, feeBips *big.Int, feeRecipient common.Address) (*types.Transaction, error) { return _SwapRouter02.contract.Transact(opts, "unwrapWETH9WithFee", amountMinimum, recipient, feeBips, feeRecipient) } // UnwrapWETH9WithFee is a paid mutator transaction binding the contract method 0x9b2c0a37. // // Solidity: function unwrapWETH9WithFee(uint256 amountMinimum, address recipient, uint256 feeBips, address feeRecipient) payable returns() func (_SwapRouter02 *SwapRouter02Session) UnwrapWETH9WithFee(amountMinimum *big.Int, recipient common.Address, feeBips *big.Int, feeRecipient common.Address) (*types.Transaction, error) { return _SwapRouter02.Contract.UnwrapWETH9WithFee(&_SwapRouter02.TransactOpts, amountMinimum, recipient, feeBips, feeRecipient) } // UnwrapWETH9WithFee is a paid mutator transaction binding the contract method 0x9b2c0a37. // // Solidity: function unwrapWETH9WithFee(uint256 amountMinimum, address recipient, uint256 feeBips, address feeRecipient) payable returns() func (_SwapRouter02 *SwapRouter02TransactorSession) UnwrapWETH9WithFee(amountMinimum *big.Int, recipient common.Address, feeBips *big.Int, feeRecipient common.Address) (*types.Transaction, error) { return _SwapRouter02.Contract.UnwrapWETH9WithFee(&_SwapRouter02.TransactOpts, amountMinimum, recipient, feeBips, feeRecipient) } // UnwrapWETH9WithFee0 is a paid mutator transaction binding the contract method 0xd4ef38de. // // Solidity: function unwrapWETH9WithFee(uint256 amountMinimum, uint256 feeBips, address feeRecipient) payable returns() func (_SwapRouter02 *SwapRouter02Transactor) UnwrapWETH9WithFee0(opts *bind.TransactOpts, amountMinimum *big.Int, feeBips *big.Int, feeRecipient common.Address) (*types.Transaction, error) { return _SwapRouter02.contract.Transact(opts, "unwrapWETH9WithFee0", amountMinimum, feeBips, feeRecipient) } // UnwrapWETH9WithFee0 is a paid mutator transaction binding the contract method 0xd4ef38de. // // Solidity: function unwrapWETH9WithFee(uint256 amountMinimum, uint256 feeBips, address feeRecipient) payable returns() func (_SwapRouter02 *SwapRouter02Session) UnwrapWETH9WithFee0(amountMinimum *big.Int, feeBips *big.Int, feeRecipient common.Address) (*types.Transaction, error) { return _SwapRouter02.Contract.UnwrapWETH9WithFee0(&_SwapRouter02.TransactOpts, amountMinimum, feeBips, feeRecipient) } // UnwrapWETH9WithFee0 is a paid mutator transaction binding the contract method 0xd4ef38de. // // Solidity: function unwrapWETH9WithFee(uint256 amountMinimum, uint256 feeBips, address feeRecipient) payable returns() func (_SwapRouter02 *SwapRouter02TransactorSession) UnwrapWETH9WithFee0(amountMinimum *big.Int, feeBips *big.Int, feeRecipient common.Address) (*types.Transaction, error) { return _SwapRouter02.Contract.UnwrapWETH9WithFee0(&_SwapRouter02.TransactOpts, amountMinimum, feeBips, feeRecipient) } // WrapETH is a paid mutator transaction binding the contract method 0x1c58db4f. // // Solidity: function wrapETH(uint256 value) payable returns() func (_SwapRouter02 *SwapRouter02Transactor) WrapETH(opts *bind.TransactOpts, value *big.Int) (*types.Transaction, error) { return _SwapRouter02.contract.Transact(opts, "wrapETH", value) } // WrapETH is a paid mutator transaction binding the contract method 0x1c58db4f. // // Solidity: function wrapETH(uint256 value) payable returns() func (_SwapRouter02 *SwapRouter02Session) WrapETH(value *big.Int) (*types.Transaction, error) { return _SwapRouter02.Contract.WrapETH(&_SwapRouter02.TransactOpts, value) } // WrapETH is a paid mutator transaction binding the contract method 0x1c58db4f. // // Solidity: function wrapETH(uint256 value) payable returns() func (_SwapRouter02 *SwapRouter02TransactorSession) WrapETH(value *big.Int) (*types.Transaction, error) { return _SwapRouter02.Contract.WrapETH(&_SwapRouter02.TransactOpts, value) } // Receive is a paid mutator transaction binding the contract receive function. // // Solidity: receive() payable returns() func (_SwapRouter02 *SwapRouter02Transactor) Receive(opts *bind.TransactOpts) (*types.Transaction, error) { return _SwapRouter02.contract.RawTransact(opts, nil) // calldata is disallowed for receive function } // Receive is a paid mutator transaction binding the contract receive function. // // Solidity: receive() payable returns() func (_SwapRouter02 *SwapRouter02Session) Receive() (*types.Transaction, error) { return _SwapRouter02.Contract.Receive(&_SwapRouter02.TransactOpts) } // Receive is a paid mutator transaction binding the contract receive function. // // Solidity: receive() payable returns() func (_SwapRouter02 *SwapRouter02TransactorSession) Receive() (*types.Transaction, error) { return _SwapRouter02.Contract.Receive(&_SwapRouter02.TransactOpts) } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/binds/baseswaprouter02/abi.json ================================================ [ { "inputs": [ { "internalType": "address", "name": "_factoryV2", "type": "address" }, { "internalType": "address", "name": "factoryV3", "type": "address" }, { "internalType": "address", "name": "_positionManager", "type": "address" }, { "internalType": "address", "name": "_WETH9", "type": "address" } ], "stateMutability": "nonpayable", "type": "constructor" }, { "inputs": [], "name": "WETH9", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "token", "type": "address" } ], "name": "approveMax", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "token", "type": "address" } ], "name": "approveMaxMinusOne", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "token", "type": "address" } ], "name": "approveZeroThenMax", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "token", "type": "address" } ], "name": "approveZeroThenMaxMinusOne", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "bytes", "name": "data", "type": "bytes" } ], "name": "callPositionManager", "outputs": [ { "internalType": "bytes", "name": "result", "type": "bytes" } ], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "bytes[]", "name": "paths", "type": "bytes[]" }, { "internalType": "uint128[]", "name": "amounts", "type": "uint128[]" }, { "internalType": "uint24", "name": "maximumTickDivergence", "type": "uint24" }, { "internalType": "uint32", "name": "secondsAgo", "type": "uint32" } ], "name": "checkOracleSlippage", "outputs": [], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "bytes", "name": "path", "type": "bytes" }, { "internalType": "uint24", "name": "maximumTickDivergence", "type": "uint24" }, { "internalType": "uint32", "name": "secondsAgo", "type": "uint32" } ], "name": "checkOracleSlippage", "outputs": [], "stateMutability": "view", "type": "function" }, { "inputs": [ { "components": [ { "internalType": "bytes", "name": "path", "type": "bytes" }, { "internalType": "address", "name": "recipient", "type": "address" }, { "internalType": "uint256", "name": "amountIn", "type": "uint256" }, { "internalType": "uint256", "name": "amountOutMinimum", "type": "uint256" } ], "internalType": "struct IV3SwapRouter.ExactInputParams", "name": "params", "type": "tuple" } ], "name": "exactInput", "outputs": [ { "internalType": "uint256", "name": "amountOut", "type": "uint256" } ], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "components": [ { "internalType": "address", "name": "tokenIn", "type": "address" }, { "internalType": "address", "name": "tokenOut", "type": "address" }, { "internalType": "uint24", "name": "fee", "type": "uint24" }, { "internalType": "address", "name": "recipient", "type": "address" }, { "internalType": "uint256", "name": "amountIn", "type": "uint256" }, { "internalType": "uint256", "name": "amountOutMinimum", "type": "uint256" }, { "internalType": "uint160", "name": "sqrtPriceLimitX96", "type": "uint160" } ], "internalType": "struct IV3SwapRouter.ExactInputSingleParams", "name": "params", "type": "tuple" } ], "name": "exactInputSingle", "outputs": [ { "internalType": "uint256", "name": "amountOut", "type": "uint256" } ], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "components": [ { "internalType": "bytes", "name": "path", "type": "bytes" }, { "internalType": "address", "name": "recipient", "type": "address" }, { "internalType": "uint256", "name": "amountOut", "type": "uint256" }, { "internalType": "uint256", "name": "amountInMaximum", "type": "uint256" } ], "internalType": "struct IV3SwapRouter.ExactOutputParams", "name": "params", "type": "tuple" } ], "name": "exactOutput", "outputs": [ { "internalType": "uint256", "name": "amountIn", "type": "uint256" } ], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "components": [ { "internalType": "address", "name": "tokenIn", "type": "address" }, { "internalType": "address", "name": "tokenOut", "type": "address" }, { "internalType": "uint24", "name": "fee", "type": "uint24" }, { "internalType": "address", "name": "recipient", "type": "address" }, { "internalType": "uint256", "name": "amountOut", "type": "uint256" }, { "internalType": "uint256", "name": "amountInMaximum", "type": "uint256" }, { "internalType": "uint160", "name": "sqrtPriceLimitX96", "type": "uint160" } ], "internalType": "struct IV3SwapRouter.ExactOutputSingleParams", "name": "params", "type": "tuple" } ], "name": "exactOutputSingle", "outputs": [ { "internalType": "uint256", "name": "amountIn", "type": "uint256" } ], "stateMutability": "payable", "type": "function" }, { "inputs": [], "name": "factory", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "factoryV2", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "token", "type": "address" }, { "internalType": "uint256", "name": "amount", "type": "uint256" } ], "name": "getApprovalType", "outputs": [ { "internalType": "enum IApproveAndCall.ApprovalType", "name": "", "type": "uint8" } ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "components": [ { "internalType": "address", "name": "token0", "type": "address" }, { "internalType": "address", "name": "token1", "type": "address" }, { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "internalType": "uint256", "name": "amount0Min", "type": "uint256" }, { "internalType": "uint256", "name": "amount1Min", "type": "uint256" } ], "internalType": "struct IApproveAndCall.IncreaseLiquidityParams", "name": "params", "type": "tuple" } ], "name": "increaseLiquidity", "outputs": [ { "internalType": "bytes", "name": "result", "type": "bytes" } ], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "components": [ { "internalType": "address", "name": "token0", "type": "address" }, { "internalType": "address", "name": "token1", "type": "address" }, { "internalType": "uint24", "name": "fee", "type": "uint24" }, { "internalType": "int24", "name": "tickLower", "type": "int24" }, { "internalType": "int24", "name": "tickUpper", "type": "int24" }, { "internalType": "uint256", "name": "amount0Min", "type": "uint256" }, { "internalType": "uint256", "name": "amount1Min", "type": "uint256" }, { "internalType": "address", "name": "recipient", "type": "address" } ], "internalType": "struct IApproveAndCall.MintParams", "name": "params", "type": "tuple" } ], "name": "mint", "outputs": [ { "internalType": "bytes", "name": "result", "type": "bytes" } ], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "bytes32", "name": "previousBlockhash", "type": "bytes32" }, { "internalType": "bytes[]", "name": "data", "type": "bytes[]" } ], "name": "multicall", "outputs": [ { "internalType": "bytes[]", "name": "", "type": "bytes[]" } ], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "deadline", "type": "uint256" }, { "internalType": "bytes[]", "name": "data", "type": "bytes[]" } ], "name": "multicall", "outputs": [ { "internalType": "bytes[]", "name": "", "type": "bytes[]" } ], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "bytes[]", "name": "data", "type": "bytes[]" } ], "name": "multicall", "outputs": [ { "internalType": "bytes[]", "name": "results", "type": "bytes[]" } ], "stateMutability": "payable", "type": "function" }, { "inputs": [], "name": "positionManager", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "token", "type": "address" }, { "internalType": "uint256", "name": "value", "type": "uint256" } ], "name": "pull", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [], "name": "refundETH", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "token", "type": "address" }, { "internalType": "uint256", "name": "value", "type": "uint256" }, { "internalType": "uint256", "name": "deadline", "type": "uint256" }, { "internalType": "uint8", "name": "v", "type": "uint8" }, { "internalType": "bytes32", "name": "r", "type": "bytes32" }, { "internalType": "bytes32", "name": "s", "type": "bytes32" } ], "name": "selfPermit", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "token", "type": "address" }, { "internalType": "uint256", "name": "nonce", "type": "uint256" }, { "internalType": "uint256", "name": "expiry", "type": "uint256" }, { "internalType": "uint8", "name": "v", "type": "uint8" }, { "internalType": "bytes32", "name": "r", "type": "bytes32" }, { "internalType": "bytes32", "name": "s", "type": "bytes32" } ], "name": "selfPermitAllowed", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "token", "type": "address" }, { "internalType": "uint256", "name": "nonce", "type": "uint256" }, { "internalType": "uint256", "name": "expiry", "type": "uint256" }, { "internalType": "uint8", "name": "v", "type": "uint8" }, { "internalType": "bytes32", "name": "r", "type": "bytes32" }, { "internalType": "bytes32", "name": "s", "type": "bytes32" } ], "name": "selfPermitAllowedIfNecessary", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "token", "type": "address" }, { "internalType": "uint256", "name": "value", "type": "uint256" }, { "internalType": "uint256", "name": "deadline", "type": "uint256" }, { "internalType": "uint8", "name": "v", "type": "uint8" }, { "internalType": "bytes32", "name": "r", "type": "bytes32" }, { "internalType": "bytes32", "name": "s", "type": "bytes32" } ], "name": "selfPermitIfNecessary", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "amountIn", "type": "uint256" }, { "internalType": "uint256", "name": "amountOutMin", "type": "uint256" }, { "internalType": "address[]", "name": "path", "type": "address[]" }, { "internalType": "address", "name": "to", "type": "address" } ], "name": "swapExactTokensForTokens", "outputs": [ { "internalType": "uint256", "name": "amountOut", "type": "uint256" } ], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "amountOut", "type": "uint256" }, { "internalType": "uint256", "name": "amountInMax", "type": "uint256" }, { "internalType": "address[]", "name": "path", "type": "address[]" }, { "internalType": "address", "name": "to", "type": "address" } ], "name": "swapTokensForExactTokens", "outputs": [ { "internalType": "uint256", "name": "amountIn", "type": "uint256" } ], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "token", "type": "address" }, { "internalType": "uint256", "name": "amountMinimum", "type": "uint256" }, { "internalType": "address", "name": "recipient", "type": "address" } ], "name": "sweepToken", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "token", "type": "address" }, { "internalType": "uint256", "name": "amountMinimum", "type": "uint256" } ], "name": "sweepToken", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "token", "type": "address" }, { "internalType": "uint256", "name": "amountMinimum", "type": "uint256" }, { "internalType": "uint256", "name": "feeBips", "type": "uint256" }, { "internalType": "address", "name": "feeRecipient", "type": "address" } ], "name": "sweepTokenWithFee", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "token", "type": "address" }, { "internalType": "uint256", "name": "amountMinimum", "type": "uint256" }, { "internalType": "address", "name": "recipient", "type": "address" }, { "internalType": "uint256", "name": "feeBips", "type": "uint256" }, { "internalType": "address", "name": "feeRecipient", "type": "address" } ], "name": "sweepTokenWithFee", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "int256", "name": "amount0Delta", "type": "int256" }, { "internalType": "int256", "name": "amount1Delta", "type": "int256" }, { "internalType": "bytes", "name": "_data", "type": "bytes" } ], "name": "uniswapV3SwapCallback", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "amountMinimum", "type": "uint256" }, { "internalType": "address", "name": "recipient", "type": "address" } ], "name": "unwrapWETH9", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "amountMinimum", "type": "uint256" } ], "name": "unwrapWETH9", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "amountMinimum", "type": "uint256" }, { "internalType": "address", "name": "recipient", "type": "address" }, { "internalType": "uint256", "name": "feeBips", "type": "uint256" }, { "internalType": "address", "name": "feeRecipient", "type": "address" } ], "name": "unwrapWETH9WithFee", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "amountMinimum", "type": "uint256" }, { "internalType": "uint256", "name": "feeBips", "type": "uint256" }, { "internalType": "address", "name": "feeRecipient", "type": "address" } ], "name": "unwrapWETH9WithFee", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "value", "type": "uint256" } ], "name": "wrapETH", "outputs": [], "stateMutability": "payable", "type": "function" }, { "stateMutability": "payable", "type": "receive" } ] ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/binds/bridge/Bridge.go ================================================ // Code generated - DO NOT EDIT. // This file is a generated binding and any manual changes will be lost. package brigde import ( "errors" "math/big" "strings" ethereum "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/event" ) // Reference imports to suppress errors if they are not otherwise used. var ( _ = errors.New _ = big.NewInt _ = strings.NewReader _ = ethereum.NotFound _ = bind.Bind _ = common.Big1 _ = types.BloomLookup _ = event.NewSubscription ) // BrigdeMetaData contains all meta data concerning the Brigde contract. var BrigdeMetaData = &bind.MetaData{ ABI: "[{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"contractWrappedToken\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"burner\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"extddr\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"destChainId\",\"type\":\"uint256\"}],\"name\":\"BridgeToken\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"contractWrappedToken[]\",\"name\":\"tokens\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"recipients\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"amounts\",\"type\":\"uint256[]\"}],\"name\":\"Mint\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"contractWrappedToken\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"recipients\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"amounts\",\"type\":\"uint256[]\"}],\"name\":\"Mint\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"ETH_TOKEN\",\"outputs\":[{\"internalType\":\"contractIERC20\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"externalAddr\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"destChainId\",\"type\":\"uint256\"}],\"name\":\"bridgeToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"externalAddr\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"destChainId\",\"type\":\"uint256\"}],\"name\":\"bridgeToken\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"safeMultisigContractAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"chainIdEth_\",\"type\":\"uint256\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractWrappedToken[]\",\"name\":\"tokens\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"recipients\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"amounts\",\"type\":\"uint256[]\"}],\"name\":\"mint\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractWrappedToken\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"recipients\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"amounts\",\"type\":\"uint256[]\"}],\"name\":\"mint\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", } // BrigdeABI is the input ABI used to generate the binding from. // Deprecated: Use BrigdeMetaData.ABI instead. var BrigdeABI = BrigdeMetaData.ABI // Brigde is an auto generated Go binding around an Ethereum contract. type Brigde struct { BrigdeCaller // Read-only binding to the contract BrigdeTransactor // Write-only binding to the contract BrigdeFilterer // Log filterer for contract events } // BrigdeCaller is an auto generated read-only Go binding around an Ethereum contract. type BrigdeCaller struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // BrigdeTransactor is an auto generated write-only Go binding around an Ethereum contract. type BrigdeTransactor struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // BrigdeFilterer is an auto generated log filtering Go binding around an Ethereum contract events. type BrigdeFilterer struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // BrigdeSession is an auto generated Go binding around an Ethereum contract, // with pre-set call and transact options. type BrigdeSession struct { Contract *Brigde // Generic contract binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // BrigdeCallerSession is an auto generated read-only Go binding around an Ethereum contract, // with pre-set call options. type BrigdeCallerSession struct { Contract *BrigdeCaller // Generic contract caller binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session } // BrigdeTransactorSession is an auto generated write-only Go binding around an Ethereum contract, // with pre-set transact options. type BrigdeTransactorSession struct { Contract *BrigdeTransactor // Generic contract transactor binding to set the session for TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // BrigdeRaw is an auto generated low-level Go binding around an Ethereum contract. type BrigdeRaw struct { Contract *Brigde // Generic contract binding to access the raw methods on } // BrigdeCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. type BrigdeCallerRaw struct { Contract *BrigdeCaller // Generic read-only contract binding to access the raw methods on } // BrigdeTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. type BrigdeTransactorRaw struct { Contract *BrigdeTransactor // Generic write-only contract binding to access the raw methods on } // NewBrigde creates a new instance of Brigde, bound to a specific deployed contract. func NewBrigde(address common.Address, backend bind.ContractBackend) (*Brigde, error) { contract, err := bindBrigde(address, backend, backend, backend) if err != nil { return nil, err } return &Brigde{BrigdeCaller: BrigdeCaller{contract: contract}, BrigdeTransactor: BrigdeTransactor{contract: contract}, BrigdeFilterer: BrigdeFilterer{contract: contract}}, nil } // NewBrigdeCaller creates a new read-only instance of Brigde, bound to a specific deployed contract. func NewBrigdeCaller(address common.Address, caller bind.ContractCaller) (*BrigdeCaller, error) { contract, err := bindBrigde(address, caller, nil, nil) if err != nil { return nil, err } return &BrigdeCaller{contract: contract}, nil } // NewBrigdeTransactor creates a new write-only instance of Brigde, bound to a specific deployed contract. func NewBrigdeTransactor(address common.Address, transactor bind.ContractTransactor) (*BrigdeTransactor, error) { contract, err := bindBrigde(address, nil, transactor, nil) if err != nil { return nil, err } return &BrigdeTransactor{contract: contract}, nil } // NewBrigdeFilterer creates a new log filterer instance of Brigde, bound to a specific deployed contract. func NewBrigdeFilterer(address common.Address, filterer bind.ContractFilterer) (*BrigdeFilterer, error) { contract, err := bindBrigde(address, nil, nil, filterer) if err != nil { return nil, err } return &BrigdeFilterer{contract: contract}, nil } // bindBrigde binds a generic wrapper to an already deployed contract. func bindBrigde(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { parsed, err := abi.JSON(strings.NewReader(BrigdeABI)) if err != nil { return nil, err } return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_Brigde *BrigdeRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _Brigde.Contract.BrigdeCaller.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_Brigde *BrigdeRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _Brigde.Contract.BrigdeTransactor.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_Brigde *BrigdeRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _Brigde.Contract.BrigdeTransactor.contract.Transact(opts, method, params...) } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_Brigde *BrigdeCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _Brigde.Contract.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_Brigde *BrigdeTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _Brigde.Contract.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_Brigde *BrigdeTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _Brigde.Contract.contract.Transact(opts, method, params...) } // ETHTOKEN is a free data retrieval call binding the contract method 0x58bc8337. // // Solidity: function ETH_TOKEN() view returns(address) func (_Brigde *BrigdeCaller) ETHTOKEN(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _Brigde.contract.Call(opts, &out, "ETH_TOKEN") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // ETHTOKEN is a free data retrieval call binding the contract method 0x58bc8337. // // Solidity: function ETH_TOKEN() view returns(address) func (_Brigde *BrigdeSession) ETHTOKEN() (common.Address, error) { return _Brigde.Contract.ETHTOKEN(&_Brigde.CallOpts) } // ETHTOKEN is a free data retrieval call binding the contract method 0x58bc8337. // // Solidity: function ETH_TOKEN() view returns(address) func (_Brigde *BrigdeCallerSession) ETHTOKEN() (common.Address, error) { return _Brigde.Contract.ETHTOKEN(&_Brigde.CallOpts) } // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. // // Solidity: function owner() view returns(address) func (_Brigde *BrigdeCaller) Owner(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _Brigde.contract.Call(opts, &out, "owner") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. // // Solidity: function owner() view returns(address) func (_Brigde *BrigdeSession) Owner() (common.Address, error) { return _Brigde.Contract.Owner(&_Brigde.CallOpts) } // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. // // Solidity: function owner() view returns(address) func (_Brigde *BrigdeCallerSession) Owner() (common.Address, error) { return _Brigde.Contract.Owner(&_Brigde.CallOpts) } // BridgeToken is a paid mutator transaction binding the contract method 0x0e93b35c. // // Solidity: function bridgeToken(address token, uint256 amount, string externalAddr, uint256 destChainId) returns() func (_Brigde *BrigdeTransactor) BridgeToken(opts *bind.TransactOpts, token common.Address, amount *big.Int, externalAddr string, destChainId *big.Int) (*types.Transaction, error) { return _Brigde.contract.Transact(opts, "bridgeToken", token, amount, externalAddr, destChainId) } // BridgeToken is a paid mutator transaction binding the contract method 0x0e93b35c. // // Solidity: function bridgeToken(address token, uint256 amount, string externalAddr, uint256 destChainId) returns() func (_Brigde *BrigdeSession) BridgeToken(token common.Address, amount *big.Int, externalAddr string, destChainId *big.Int) (*types.Transaction, error) { return _Brigde.Contract.BridgeToken(&_Brigde.TransactOpts, token, amount, externalAddr, destChainId) } // BridgeToken is a paid mutator transaction binding the contract method 0x0e93b35c. // // Solidity: function bridgeToken(address token, uint256 amount, string externalAddr, uint256 destChainId) returns() func (_Brigde *BrigdeTransactorSession) BridgeToken(token common.Address, amount *big.Int, externalAddr string, destChainId *big.Int) (*types.Transaction, error) { return _Brigde.Contract.BridgeToken(&_Brigde.TransactOpts, token, amount, externalAddr, destChainId) } // BridgeToken0 is a paid mutator transaction binding the contract method 0xd4546d23. // // Solidity: function bridgeToken(string externalAddr, uint256 destChainId) payable returns() func (_Brigde *BrigdeTransactor) BridgeToken0(opts *bind.TransactOpts, externalAddr string, destChainId *big.Int) (*types.Transaction, error) { return _Brigde.contract.Transact(opts, "bridgeToken0", externalAddr, destChainId) } // BridgeToken0 is a paid mutator transaction binding the contract method 0xd4546d23. // // Solidity: function bridgeToken(string externalAddr, uint256 destChainId) payable returns() func (_Brigde *BrigdeSession) BridgeToken0(externalAddr string, destChainId *big.Int) (*types.Transaction, error) { return _Brigde.Contract.BridgeToken0(&_Brigde.TransactOpts, externalAddr, destChainId) } // BridgeToken0 is a paid mutator transaction binding the contract method 0xd4546d23. // // Solidity: function bridgeToken(string externalAddr, uint256 destChainId) payable returns() func (_Brigde *BrigdeTransactorSession) BridgeToken0(externalAddr string, destChainId *big.Int) (*types.Transaction, error) { return _Brigde.Contract.BridgeToken0(&_Brigde.TransactOpts, externalAddr, destChainId) } // Initialize is a paid mutator transaction binding the contract method 0xcd6dc687. // // Solidity: function initialize(address safeMultisigContractAddress, uint256 chainIdEth_) returns() func (_Brigde *BrigdeTransactor) Initialize(opts *bind.TransactOpts, safeMultisigContractAddress common.Address, chainIdEth_ *big.Int) (*types.Transaction, error) { return _Brigde.contract.Transact(opts, "initialize", safeMultisigContractAddress, chainIdEth_) } // Initialize is a paid mutator transaction binding the contract method 0xcd6dc687. // // Solidity: function initialize(address safeMultisigContractAddress, uint256 chainIdEth_) returns() func (_Brigde *BrigdeSession) Initialize(safeMultisigContractAddress common.Address, chainIdEth_ *big.Int) (*types.Transaction, error) { return _Brigde.Contract.Initialize(&_Brigde.TransactOpts, safeMultisigContractAddress, chainIdEth_) } // Initialize is a paid mutator transaction binding the contract method 0xcd6dc687. // // Solidity: function initialize(address safeMultisigContractAddress, uint256 chainIdEth_) returns() func (_Brigde *BrigdeTransactorSession) Initialize(safeMultisigContractAddress common.Address, chainIdEth_ *big.Int) (*types.Transaction, error) { return _Brigde.Contract.Initialize(&_Brigde.TransactOpts, safeMultisigContractAddress, chainIdEth_) } // Mint is a paid mutator transaction binding the contract method 0x5530f4a5. // // Solidity: function mint(address[] tokens, address[] recipients, uint256[] amounts) returns() func (_Brigde *BrigdeTransactor) Mint(opts *bind.TransactOpts, tokens []common.Address, recipients []common.Address, amounts []*big.Int) (*types.Transaction, error) { return _Brigde.contract.Transact(opts, "mint", tokens, recipients, amounts) } // Mint is a paid mutator transaction binding the contract method 0x5530f4a5. // // Solidity: function mint(address[] tokens, address[] recipients, uint256[] amounts) returns() func (_Brigde *BrigdeSession) Mint(tokens []common.Address, recipients []common.Address, amounts []*big.Int) (*types.Transaction, error) { return _Brigde.Contract.Mint(&_Brigde.TransactOpts, tokens, recipients, amounts) } // Mint is a paid mutator transaction binding the contract method 0x5530f4a5. // // Solidity: function mint(address[] tokens, address[] recipients, uint256[] amounts) returns() func (_Brigde *BrigdeTransactorSession) Mint(tokens []common.Address, recipients []common.Address, amounts []*big.Int) (*types.Transaction, error) { return _Brigde.Contract.Mint(&_Brigde.TransactOpts, tokens, recipients, amounts) } // Mint0 is a paid mutator transaction binding the contract method 0xa3bf277e. // // Solidity: function mint(address token, address[] recipients, uint256[] amounts) returns() func (_Brigde *BrigdeTransactor) Mint0(opts *bind.TransactOpts, token common.Address, recipients []common.Address, amounts []*big.Int) (*types.Transaction, error) { return _Brigde.contract.Transact(opts, "mint0", token, recipients, amounts) } // Mint0 is a paid mutator transaction binding the contract method 0xa3bf277e. // // Solidity: function mint(address token, address[] recipients, uint256[] amounts) returns() func (_Brigde *BrigdeSession) Mint0(token common.Address, recipients []common.Address, amounts []*big.Int) (*types.Transaction, error) { return _Brigde.Contract.Mint0(&_Brigde.TransactOpts, token, recipients, amounts) } // Mint0 is a paid mutator transaction binding the contract method 0xa3bf277e. // // Solidity: function mint(address token, address[] recipients, uint256[] amounts) returns() func (_Brigde *BrigdeTransactorSession) Mint0(token common.Address, recipients []common.Address, amounts []*big.Int) (*types.Transaction, error) { return _Brigde.Contract.Mint0(&_Brigde.TransactOpts, token, recipients, amounts) } // RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. // // Solidity: function renounceOwnership() returns() func (_Brigde *BrigdeTransactor) RenounceOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { return _Brigde.contract.Transact(opts, "renounceOwnership") } // RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. // // Solidity: function renounceOwnership() returns() func (_Brigde *BrigdeSession) RenounceOwnership() (*types.Transaction, error) { return _Brigde.Contract.RenounceOwnership(&_Brigde.TransactOpts) } // RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. // // Solidity: function renounceOwnership() returns() func (_Brigde *BrigdeTransactorSession) RenounceOwnership() (*types.Transaction, error) { return _Brigde.Contract.RenounceOwnership(&_Brigde.TransactOpts) } // TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. // // Solidity: function transferOwnership(address newOwner) returns() func (_Brigde *BrigdeTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) { return _Brigde.contract.Transact(opts, "transferOwnership", newOwner) } // TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. // // Solidity: function transferOwnership(address newOwner) returns() func (_Brigde *BrigdeSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { return _Brigde.Contract.TransferOwnership(&_Brigde.TransactOpts, newOwner) } // TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. // // Solidity: function transferOwnership(address newOwner) returns() func (_Brigde *BrigdeTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { return _Brigde.Contract.TransferOwnership(&_Brigde.TransactOpts, newOwner) } // BrigdeBridgeTokenIterator is returned from FilterBridgeToken and is used to iterate over the raw logs and unpacked data for BridgeToken events raised by the Brigde contract. type BrigdeBridgeTokenIterator struct { Event *BrigdeBridgeToken // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *BrigdeBridgeTokenIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(BrigdeBridgeToken) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(BrigdeBridgeToken) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *BrigdeBridgeTokenIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *BrigdeBridgeTokenIterator) Close() error { it.sub.Unsubscribe() return nil } // BrigdeBridgeToken represents a BridgeToken event raised by the Brigde contract. type BrigdeBridgeToken struct { Token common.Address Burner common.Address Amount *big.Int Extddr string DestChainId *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterBridgeToken is a free log retrieval operation binding the contract event 0xc28e54186544d7357308b86c8319edd275e0db552d62381cf49f827791845c61. // // Solidity: event BridgeToken(address token, address burner, uint256 amount, string extddr, uint256 destChainId) func (_Brigde *BrigdeFilterer) FilterBridgeToken(opts *bind.FilterOpts) (*BrigdeBridgeTokenIterator, error) { logs, sub, err := _Brigde.contract.FilterLogs(opts, "BridgeToken") if err != nil { return nil, err } return &BrigdeBridgeTokenIterator{contract: _Brigde.contract, event: "BridgeToken", logs: logs, sub: sub}, nil } // WatchBridgeToken is a free log subscription operation binding the contract event 0xc28e54186544d7357308b86c8319edd275e0db552d62381cf49f827791845c61. // // Solidity: event BridgeToken(address token, address burner, uint256 amount, string extddr, uint256 destChainId) func (_Brigde *BrigdeFilterer) WatchBridgeToken(opts *bind.WatchOpts, sink chan<- *BrigdeBridgeToken) (event.Subscription, error) { logs, sub, err := _Brigde.contract.WatchLogs(opts, "BridgeToken") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(BrigdeBridgeToken) if err := _Brigde.contract.UnpackLog(event, "BridgeToken", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseBridgeToken is a log parse operation binding the contract event 0xc28e54186544d7357308b86c8319edd275e0db552d62381cf49f827791845c61. // // Solidity: event BridgeToken(address token, address burner, uint256 amount, string extddr, uint256 destChainId) func (_Brigde *BrigdeFilterer) ParseBridgeToken(log types.Log) (*BrigdeBridgeToken, error) { event := new(BrigdeBridgeToken) if err := _Brigde.contract.UnpackLog(event, "BridgeToken", log); err != nil { return nil, err } event.Raw = log return event, nil } // BrigdeInitializedIterator is returned from FilterInitialized and is used to iterate over the raw logs and unpacked data for Initialized events raised by the Brigde contract. type BrigdeInitializedIterator struct { Event *BrigdeInitialized // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *BrigdeInitializedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(BrigdeInitialized) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(BrigdeInitialized) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *BrigdeInitializedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *BrigdeInitializedIterator) Close() error { it.sub.Unsubscribe() return nil } // BrigdeInitialized represents a Initialized event raised by the Brigde contract. type BrigdeInitialized struct { Version uint8 Raw types.Log // Blockchain specific contextual infos } // FilterInitialized is a free log retrieval operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. // // Solidity: event Initialized(uint8 version) func (_Brigde *BrigdeFilterer) FilterInitialized(opts *bind.FilterOpts) (*BrigdeInitializedIterator, error) { logs, sub, err := _Brigde.contract.FilterLogs(opts, "Initialized") if err != nil { return nil, err } return &BrigdeInitializedIterator{contract: _Brigde.contract, event: "Initialized", logs: logs, sub: sub}, nil } // WatchInitialized is a free log subscription operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. // // Solidity: event Initialized(uint8 version) func (_Brigde *BrigdeFilterer) WatchInitialized(opts *bind.WatchOpts, sink chan<- *BrigdeInitialized) (event.Subscription, error) { logs, sub, err := _Brigde.contract.WatchLogs(opts, "Initialized") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(BrigdeInitialized) if err := _Brigde.contract.UnpackLog(event, "Initialized", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseInitialized is a log parse operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. // // Solidity: event Initialized(uint8 version) func (_Brigde *BrigdeFilterer) ParseInitialized(log types.Log) (*BrigdeInitialized, error) { event := new(BrigdeInitialized) if err := _Brigde.contract.UnpackLog(event, "Initialized", log); err != nil { return nil, err } event.Raw = log return event, nil } // BrigdeMintIterator is returned from FilterMint and is used to iterate over the raw logs and unpacked data for Mint events raised by the Brigde contract. type BrigdeMintIterator struct { Event *BrigdeMint // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *BrigdeMintIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(BrigdeMint) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(BrigdeMint) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *BrigdeMintIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *BrigdeMintIterator) Close() error { it.sub.Unsubscribe() return nil } // BrigdeMint represents a Mint event raised by the Brigde contract. type BrigdeMint struct { Tokens []common.Address Recipients []common.Address Amounts []*big.Int Raw types.Log // Blockchain specific contextual infos } // FilterMint is a free log retrieval operation binding the contract event 0xe9914506df53b6ba40090fea5ed4edb71623a51062de3125c2dc65b23de6d05e. // // Solidity: event Mint(address[] tokens, address[] recipients, uint256[] amounts) func (_Brigde *BrigdeFilterer) FilterMint(opts *bind.FilterOpts) (*BrigdeMintIterator, error) { logs, sub, err := _Brigde.contract.FilterLogs(opts, "Mint") if err != nil { return nil, err } return &BrigdeMintIterator{contract: _Brigde.contract, event: "Mint", logs: logs, sub: sub}, nil } // WatchMint is a free log subscription operation binding the contract event 0xe9914506df53b6ba40090fea5ed4edb71623a51062de3125c2dc65b23de6d05e. // // Solidity: event Mint(address[] tokens, address[] recipients, uint256[] amounts) func (_Brigde *BrigdeFilterer) WatchMint(opts *bind.WatchOpts, sink chan<- *BrigdeMint) (event.Subscription, error) { logs, sub, err := _Brigde.contract.WatchLogs(opts, "Mint") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(BrigdeMint) if err := _Brigde.contract.UnpackLog(event, "Mint", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseMint is a log parse operation binding the contract event 0xe9914506df53b6ba40090fea5ed4edb71623a51062de3125c2dc65b23de6d05e. // // Solidity: event Mint(address[] tokens, address[] recipients, uint256[] amounts) func (_Brigde *BrigdeFilterer) ParseMint(log types.Log) (*BrigdeMint, error) { event := new(BrigdeMint) if err := _Brigde.contract.UnpackLog(event, "Mint", log); err != nil { return nil, err } event.Raw = log return event, nil } // BrigdeMint0Iterator is returned from FilterMint0 and is used to iterate over the raw logs and unpacked data for Mint0 events raised by the Brigde contract. type BrigdeMint0Iterator struct { Event *BrigdeMint0 // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *BrigdeMint0Iterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(BrigdeMint0) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(BrigdeMint0) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *BrigdeMint0Iterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *BrigdeMint0Iterator) Close() error { it.sub.Unsubscribe() return nil } // BrigdeMint0 represents a Mint0 event raised by the Brigde contract. type BrigdeMint0 struct { Token common.Address Recipients []common.Address Amounts []*big.Int Raw types.Log // Blockchain specific contextual infos } // FilterMint0 is a free log retrieval operation binding the contract event 0xa20ca4d8d83b89ff090c0ea7b3c3c600625d46681874e0c0d1e35a1d1d4964dd. // // Solidity: event Mint(address token, address[] recipients, uint256[] amounts) func (_Brigde *BrigdeFilterer) FilterMint0(opts *bind.FilterOpts) (*BrigdeMint0Iterator, error) { logs, sub, err := _Brigde.contract.FilterLogs(opts, "Mint0") if err != nil { return nil, err } return &BrigdeMint0Iterator{contract: _Brigde.contract, event: "Mint0", logs: logs, sub: sub}, nil } // WatchMint0 is a free log subscription operation binding the contract event 0xa20ca4d8d83b89ff090c0ea7b3c3c600625d46681874e0c0d1e35a1d1d4964dd. // // Solidity: event Mint(address token, address[] recipients, uint256[] amounts) func (_Brigde *BrigdeFilterer) WatchMint0(opts *bind.WatchOpts, sink chan<- *BrigdeMint0) (event.Subscription, error) { logs, sub, err := _Brigde.contract.WatchLogs(opts, "Mint0") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(BrigdeMint0) if err := _Brigde.contract.UnpackLog(event, "Mint0", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseMint0 is a log parse operation binding the contract event 0xa20ca4d8d83b89ff090c0ea7b3c3c600625d46681874e0c0d1e35a1d1d4964dd. // // Solidity: event Mint(address token, address[] recipients, uint256[] amounts) func (_Brigde *BrigdeFilterer) ParseMint0(log types.Log) (*BrigdeMint0, error) { event := new(BrigdeMint0) if err := _Brigde.contract.UnpackLog(event, "Mint0", log); err != nil { return nil, err } event.Raw = log return event, nil } // BrigdeOwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the Brigde contract. type BrigdeOwnershipTransferredIterator struct { Event *BrigdeOwnershipTransferred // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *BrigdeOwnershipTransferredIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(BrigdeOwnershipTransferred) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(BrigdeOwnershipTransferred) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *BrigdeOwnershipTransferredIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *BrigdeOwnershipTransferredIterator) Close() error { it.sub.Unsubscribe() return nil } // BrigdeOwnershipTransferred represents a OwnershipTransferred event raised by the Brigde contract. type BrigdeOwnershipTransferred struct { PreviousOwner common.Address NewOwner common.Address Raw types.Log // Blockchain specific contextual infos } // FilterOwnershipTransferred is a free log retrieval operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. // // Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) func (_Brigde *BrigdeFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*BrigdeOwnershipTransferredIterator, error) { var previousOwnerRule []interface{} for _, previousOwnerItem := range previousOwner { previousOwnerRule = append(previousOwnerRule, previousOwnerItem) } var newOwnerRule []interface{} for _, newOwnerItem := range newOwner { newOwnerRule = append(newOwnerRule, newOwnerItem) } logs, sub, err := _Brigde.contract.FilterLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) if err != nil { return nil, err } return &BrigdeOwnershipTransferredIterator{contract: _Brigde.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil } // WatchOwnershipTransferred is a free log subscription operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. // // Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) func (_Brigde *BrigdeFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *BrigdeOwnershipTransferred, previousOwner []common.Address, newOwner []common.Address) (event.Subscription, error) { var previousOwnerRule []interface{} for _, previousOwnerItem := range previousOwner { previousOwnerRule = append(previousOwnerRule, previousOwnerItem) } var newOwnerRule []interface{} for _, newOwnerItem := range newOwner { newOwnerRule = append(newOwnerRule, newOwnerItem) } logs, sub, err := _Brigde.contract.WatchLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(BrigdeOwnershipTransferred) if err := _Brigde.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseOwnershipTransferred is a log parse operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. // // Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) func (_Brigde *BrigdeFilterer) ParseOwnershipTransferred(log types.Log) (*BrigdeOwnershipTransferred, error) { event := new(BrigdeOwnershipTransferred) if err := _Brigde.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { return nil, err } event.Raw = log return event, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/binds/bscfactory/Factory.go ================================================ // Code generated - DO NOT EDIT. // This file is a generated binding and any manual changes will be lost. package bscfactory import ( "errors" "math/big" "strings" ethereum "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/event" ) // Reference imports to suppress errors if they are not otherwise used. var ( _ = errors.New _ = big.NewInt _ = strings.NewReader _ = ethereum.NotFound _ = bind.Bind _ = common.Big1 _ = types.BloomLookup _ = event.NewSubscription _ = abi.ConvertType ) // FactoryMetaData contains all meta data concerning the Factory contract. var FactoryMetaData = &bind.MetaData{ ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_poolDeployer\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint24\",\"name\":\"fee\",\"type\":\"uint24\"},{\"indexed\":true,\"internalType\":\"int24\",\"name\":\"tickSpacing\",\"type\":\"int24\"}],\"name\":\"FeeAmountEnabled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint24\",\"name\":\"fee\",\"type\":\"uint24\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"whitelistRequested\",\"type\":\"bool\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"enabled\",\"type\":\"bool\"}],\"name\":\"FeeAmountExtraInfoUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"oldOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnerChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"token0\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"token1\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint24\",\"name\":\"fee\",\"type\":\"uint24\"},{\"indexed\":false,\"internalType\":\"int24\",\"name\":\"tickSpacing\",\"type\":\"int24\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"name\":\"PoolCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"lmPoolDeployer\",\"type\":\"address\"}],\"name\":\"SetLmPoolDeployer\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"verified\",\"type\":\"bool\"}],\"name\":\"WhiteListAdded\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint128\",\"name\":\"amount0Requested\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"amount1Requested\",\"type\":\"uint128\"}],\"name\":\"collectProtocol\",\"outputs\":[{\"internalType\":\"uint128\",\"name\":\"amount0\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"amount1\",\"type\":\"uint128\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"tokenA\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenB\",\"type\":\"address\"},{\"internalType\":\"uint24\",\"name\":\"fee\",\"type\":\"uint24\"}],\"name\":\"createPool\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint24\",\"name\":\"fee\",\"type\":\"uint24\"},{\"internalType\":\"int24\",\"name\":\"tickSpacing\",\"type\":\"int24\"}],\"name\":\"enableFeeAmount\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint24\",\"name\":\"\",\"type\":\"uint24\"}],\"name\":\"feeAmountTickSpacing\",\"outputs\":[{\"internalType\":\"int24\",\"name\":\"\",\"type\":\"int24\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint24\",\"name\":\"\",\"type\":\"uint24\"}],\"name\":\"feeAmountTickSpacingExtraInfo\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"whitelistRequested\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"enabled\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint24\",\"name\":\"\",\"type\":\"uint24\"}],\"name\":\"getPool\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"lmPoolDeployer\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"poolDeployer\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint24\",\"name\":\"fee\",\"type\":\"uint24\"},{\"internalType\":\"bool\",\"name\":\"whitelistRequested\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"enabled\",\"type\":\"bool\"}],\"name\":\"setFeeAmountExtraInfo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"feeProtocol0\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"feeProtocol1\",\"type\":\"uint32\"}],\"name\":\"setFeeProtocol\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"lmPool\",\"type\":\"address\"}],\"name\":\"setLmPool\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_lmPoolDeployer\",\"type\":\"address\"}],\"name\":\"setLmPoolDeployer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_owner\",\"type\":\"address\"}],\"name\":\"setOwner\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"verified\",\"type\":\"bool\"}],\"name\":\"setWhiteListAddress\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", } // FactoryABI is the input ABI used to generate the binding from. // Deprecated: Use FactoryMetaData.ABI instead. var FactoryABI = FactoryMetaData.ABI // Factory is an auto generated Go binding around an Ethereum contract. type Factory struct { FactoryCaller // Read-only binding to the contract FactoryTransactor // Write-only binding to the contract FactoryFilterer // Log filterer for contract events } // FactoryCaller is an auto generated read-only Go binding around an Ethereum contract. type FactoryCaller struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // FactoryTransactor is an auto generated write-only Go binding around an Ethereum contract. type FactoryTransactor struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // FactoryFilterer is an auto generated log filtering Go binding around an Ethereum contract events. type FactoryFilterer struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // FactorySession is an auto generated Go binding around an Ethereum contract, // with pre-set call and transact options. type FactorySession struct { Contract *Factory // Generic contract binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // FactoryCallerSession is an auto generated read-only Go binding around an Ethereum contract, // with pre-set call options. type FactoryCallerSession struct { Contract *FactoryCaller // Generic contract caller binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session } // FactoryTransactorSession is an auto generated write-only Go binding around an Ethereum contract, // with pre-set transact options. type FactoryTransactorSession struct { Contract *FactoryTransactor // Generic contract transactor binding to set the session for TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // FactoryRaw is an auto generated low-level Go binding around an Ethereum contract. type FactoryRaw struct { Contract *Factory // Generic contract binding to access the raw methods on } // FactoryCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. type FactoryCallerRaw struct { Contract *FactoryCaller // Generic read-only contract binding to access the raw methods on } // FactoryTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. type FactoryTransactorRaw struct { Contract *FactoryTransactor // Generic write-only contract binding to access the raw methods on } // NewFactory creates a new instance of Factory, bound to a specific deployed contract. func NewFactory(address common.Address, backend bind.ContractBackend) (*Factory, error) { contract, err := bindFactory(address, backend, backend, backend) if err != nil { return nil, err } return &Factory{FactoryCaller: FactoryCaller{contract: contract}, FactoryTransactor: FactoryTransactor{contract: contract}, FactoryFilterer: FactoryFilterer{contract: contract}}, nil } // NewFactoryCaller creates a new read-only instance of Factory, bound to a specific deployed contract. func NewFactoryCaller(address common.Address, caller bind.ContractCaller) (*FactoryCaller, error) { contract, err := bindFactory(address, caller, nil, nil) if err != nil { return nil, err } return &FactoryCaller{contract: contract}, nil } // NewFactoryTransactor creates a new write-only instance of Factory, bound to a specific deployed contract. func NewFactoryTransactor(address common.Address, transactor bind.ContractTransactor) (*FactoryTransactor, error) { contract, err := bindFactory(address, nil, transactor, nil) if err != nil { return nil, err } return &FactoryTransactor{contract: contract}, nil } // NewFactoryFilterer creates a new log filterer instance of Factory, bound to a specific deployed contract. func NewFactoryFilterer(address common.Address, filterer bind.ContractFilterer) (*FactoryFilterer, error) { contract, err := bindFactory(address, nil, nil, filterer) if err != nil { return nil, err } return &FactoryFilterer{contract: contract}, nil } // bindFactory binds a generic wrapper to an already deployed contract. func bindFactory(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { parsed, err := FactoryMetaData.GetAbi() if err != nil { return nil, err } return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_Factory *FactoryRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _Factory.Contract.FactoryCaller.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_Factory *FactoryRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _Factory.Contract.FactoryTransactor.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_Factory *FactoryRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _Factory.Contract.FactoryTransactor.contract.Transact(opts, method, params...) } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_Factory *FactoryCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _Factory.Contract.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_Factory *FactoryTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _Factory.Contract.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_Factory *FactoryTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _Factory.Contract.contract.Transact(opts, method, params...) } // FeeAmountTickSpacing is a free data retrieval call binding the contract method 0x22afcccb. // // Solidity: function feeAmountTickSpacing(uint24 ) view returns(int24) func (_Factory *FactoryCaller) FeeAmountTickSpacing(opts *bind.CallOpts, arg0 *big.Int) (*big.Int, error) { var out []interface{} err := _Factory.contract.Call(opts, &out, "feeAmountTickSpacing", arg0) if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // FeeAmountTickSpacing is a free data retrieval call binding the contract method 0x22afcccb. // // Solidity: function feeAmountTickSpacing(uint24 ) view returns(int24) func (_Factory *FactorySession) FeeAmountTickSpacing(arg0 *big.Int) (*big.Int, error) { return _Factory.Contract.FeeAmountTickSpacing(&_Factory.CallOpts, arg0) } // FeeAmountTickSpacing is a free data retrieval call binding the contract method 0x22afcccb. // // Solidity: function feeAmountTickSpacing(uint24 ) view returns(int24) func (_Factory *FactoryCallerSession) FeeAmountTickSpacing(arg0 *big.Int) (*big.Int, error) { return _Factory.Contract.FeeAmountTickSpacing(&_Factory.CallOpts, arg0) } // FeeAmountTickSpacingExtraInfo is a free data retrieval call binding the contract method 0x88e8006d. // // Solidity: function feeAmountTickSpacingExtraInfo(uint24 ) view returns(bool whitelistRequested, bool enabled) func (_Factory *FactoryCaller) FeeAmountTickSpacingExtraInfo(opts *bind.CallOpts, arg0 *big.Int) (struct { WhitelistRequested bool Enabled bool }, error) { var out []interface{} err := _Factory.contract.Call(opts, &out, "feeAmountTickSpacingExtraInfo", arg0) outstruct := new(struct { WhitelistRequested bool Enabled bool }) if err != nil { return *outstruct, err } outstruct.WhitelistRequested = *abi.ConvertType(out[0], new(bool)).(*bool) outstruct.Enabled = *abi.ConvertType(out[1], new(bool)).(*bool) return *outstruct, err } // FeeAmountTickSpacingExtraInfo is a free data retrieval call binding the contract method 0x88e8006d. // // Solidity: function feeAmountTickSpacingExtraInfo(uint24 ) view returns(bool whitelistRequested, bool enabled) func (_Factory *FactorySession) FeeAmountTickSpacingExtraInfo(arg0 *big.Int) (struct { WhitelistRequested bool Enabled bool }, error) { return _Factory.Contract.FeeAmountTickSpacingExtraInfo(&_Factory.CallOpts, arg0) } // FeeAmountTickSpacingExtraInfo is a free data retrieval call binding the contract method 0x88e8006d. // // Solidity: function feeAmountTickSpacingExtraInfo(uint24 ) view returns(bool whitelistRequested, bool enabled) func (_Factory *FactoryCallerSession) FeeAmountTickSpacingExtraInfo(arg0 *big.Int) (struct { WhitelistRequested bool Enabled bool }, error) { return _Factory.Contract.FeeAmountTickSpacingExtraInfo(&_Factory.CallOpts, arg0) } // GetPool is a free data retrieval call binding the contract method 0x1698ee82. // // Solidity: function getPool(address , address , uint24 ) view returns(address) func (_Factory *FactoryCaller) GetPool(opts *bind.CallOpts, arg0 common.Address, arg1 common.Address, arg2 *big.Int) (common.Address, error) { var out []interface{} err := _Factory.contract.Call(opts, &out, "getPool", arg0, arg1, arg2) if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // GetPool is a free data retrieval call binding the contract method 0x1698ee82. // // Solidity: function getPool(address , address , uint24 ) view returns(address) func (_Factory *FactorySession) GetPool(arg0 common.Address, arg1 common.Address, arg2 *big.Int) (common.Address, error) { return _Factory.Contract.GetPool(&_Factory.CallOpts, arg0, arg1, arg2) } // GetPool is a free data retrieval call binding the contract method 0x1698ee82. // // Solidity: function getPool(address , address , uint24 ) view returns(address) func (_Factory *FactoryCallerSession) GetPool(arg0 common.Address, arg1 common.Address, arg2 *big.Int) (common.Address, error) { return _Factory.Contract.GetPool(&_Factory.CallOpts, arg0, arg1, arg2) } // LmPoolDeployer is a free data retrieval call binding the contract method 0x5e492ac8. // // Solidity: function lmPoolDeployer() view returns(address) func (_Factory *FactoryCaller) LmPoolDeployer(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _Factory.contract.Call(opts, &out, "lmPoolDeployer") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // LmPoolDeployer is a free data retrieval call binding the contract method 0x5e492ac8. // // Solidity: function lmPoolDeployer() view returns(address) func (_Factory *FactorySession) LmPoolDeployer() (common.Address, error) { return _Factory.Contract.LmPoolDeployer(&_Factory.CallOpts) } // LmPoolDeployer is a free data retrieval call binding the contract method 0x5e492ac8. // // Solidity: function lmPoolDeployer() view returns(address) func (_Factory *FactoryCallerSession) LmPoolDeployer() (common.Address, error) { return _Factory.Contract.LmPoolDeployer(&_Factory.CallOpts) } // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. // // Solidity: function owner() view returns(address) func (_Factory *FactoryCaller) Owner(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _Factory.contract.Call(opts, &out, "owner") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. // // Solidity: function owner() view returns(address) func (_Factory *FactorySession) Owner() (common.Address, error) { return _Factory.Contract.Owner(&_Factory.CallOpts) } // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. // // Solidity: function owner() view returns(address) func (_Factory *FactoryCallerSession) Owner() (common.Address, error) { return _Factory.Contract.Owner(&_Factory.CallOpts) } // PoolDeployer is a free data retrieval call binding the contract method 0x3119049a. // // Solidity: function poolDeployer() view returns(address) func (_Factory *FactoryCaller) PoolDeployer(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _Factory.contract.Call(opts, &out, "poolDeployer") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // PoolDeployer is a free data retrieval call binding the contract method 0x3119049a. // // Solidity: function poolDeployer() view returns(address) func (_Factory *FactorySession) PoolDeployer() (common.Address, error) { return _Factory.Contract.PoolDeployer(&_Factory.CallOpts) } // PoolDeployer is a free data retrieval call binding the contract method 0x3119049a. // // Solidity: function poolDeployer() view returns(address) func (_Factory *FactoryCallerSession) PoolDeployer() (common.Address, error) { return _Factory.Contract.PoolDeployer(&_Factory.CallOpts) } // CollectProtocol is a paid mutator transaction binding the contract method 0x43db87da. // // Solidity: function collectProtocol(address pool, address recipient, uint128 amount0Requested, uint128 amount1Requested) returns(uint128 amount0, uint128 amount1) func (_Factory *FactoryTransactor) CollectProtocol(opts *bind.TransactOpts, pool common.Address, recipient common.Address, amount0Requested *big.Int, amount1Requested *big.Int) (*types.Transaction, error) { return _Factory.contract.Transact(opts, "collectProtocol", pool, recipient, amount0Requested, amount1Requested) } // CollectProtocol is a paid mutator transaction binding the contract method 0x43db87da. // // Solidity: function collectProtocol(address pool, address recipient, uint128 amount0Requested, uint128 amount1Requested) returns(uint128 amount0, uint128 amount1) func (_Factory *FactorySession) CollectProtocol(pool common.Address, recipient common.Address, amount0Requested *big.Int, amount1Requested *big.Int) (*types.Transaction, error) { return _Factory.Contract.CollectProtocol(&_Factory.TransactOpts, pool, recipient, amount0Requested, amount1Requested) } // CollectProtocol is a paid mutator transaction binding the contract method 0x43db87da. // // Solidity: function collectProtocol(address pool, address recipient, uint128 amount0Requested, uint128 amount1Requested) returns(uint128 amount0, uint128 amount1) func (_Factory *FactoryTransactorSession) CollectProtocol(pool common.Address, recipient common.Address, amount0Requested *big.Int, amount1Requested *big.Int) (*types.Transaction, error) { return _Factory.Contract.CollectProtocol(&_Factory.TransactOpts, pool, recipient, amount0Requested, amount1Requested) } // CreatePool is a paid mutator transaction binding the contract method 0xa1671295. // // Solidity: function createPool(address tokenA, address tokenB, uint24 fee) returns(address pool) func (_Factory *FactoryTransactor) CreatePool(opts *bind.TransactOpts, tokenA common.Address, tokenB common.Address, fee *big.Int) (*types.Transaction, error) { return _Factory.contract.Transact(opts, "createPool", tokenA, tokenB, fee) } // CreatePool is a paid mutator transaction binding the contract method 0xa1671295. // // Solidity: function createPool(address tokenA, address tokenB, uint24 fee) returns(address pool) func (_Factory *FactorySession) CreatePool(tokenA common.Address, tokenB common.Address, fee *big.Int) (*types.Transaction, error) { return _Factory.Contract.CreatePool(&_Factory.TransactOpts, tokenA, tokenB, fee) } // CreatePool is a paid mutator transaction binding the contract method 0xa1671295. // // Solidity: function createPool(address tokenA, address tokenB, uint24 fee) returns(address pool) func (_Factory *FactoryTransactorSession) CreatePool(tokenA common.Address, tokenB common.Address, fee *big.Int) (*types.Transaction, error) { return _Factory.Contract.CreatePool(&_Factory.TransactOpts, tokenA, tokenB, fee) } // EnableFeeAmount is a paid mutator transaction binding the contract method 0x8a7c195f. // // Solidity: function enableFeeAmount(uint24 fee, int24 tickSpacing) returns() func (_Factory *FactoryTransactor) EnableFeeAmount(opts *bind.TransactOpts, fee *big.Int, tickSpacing *big.Int) (*types.Transaction, error) { return _Factory.contract.Transact(opts, "enableFeeAmount", fee, tickSpacing) } // EnableFeeAmount is a paid mutator transaction binding the contract method 0x8a7c195f. // // Solidity: function enableFeeAmount(uint24 fee, int24 tickSpacing) returns() func (_Factory *FactorySession) EnableFeeAmount(fee *big.Int, tickSpacing *big.Int) (*types.Transaction, error) { return _Factory.Contract.EnableFeeAmount(&_Factory.TransactOpts, fee, tickSpacing) } // EnableFeeAmount is a paid mutator transaction binding the contract method 0x8a7c195f. // // Solidity: function enableFeeAmount(uint24 fee, int24 tickSpacing) returns() func (_Factory *FactoryTransactorSession) EnableFeeAmount(fee *big.Int, tickSpacing *big.Int) (*types.Transaction, error) { return _Factory.Contract.EnableFeeAmount(&_Factory.TransactOpts, fee, tickSpacing) } // SetFeeAmountExtraInfo is a paid mutator transaction binding the contract method 0x8ff38e80. // // Solidity: function setFeeAmountExtraInfo(uint24 fee, bool whitelistRequested, bool enabled) returns() func (_Factory *FactoryTransactor) SetFeeAmountExtraInfo(opts *bind.TransactOpts, fee *big.Int, whitelistRequested bool, enabled bool) (*types.Transaction, error) { return _Factory.contract.Transact(opts, "setFeeAmountExtraInfo", fee, whitelistRequested, enabled) } // SetFeeAmountExtraInfo is a paid mutator transaction binding the contract method 0x8ff38e80. // // Solidity: function setFeeAmountExtraInfo(uint24 fee, bool whitelistRequested, bool enabled) returns() func (_Factory *FactorySession) SetFeeAmountExtraInfo(fee *big.Int, whitelistRequested bool, enabled bool) (*types.Transaction, error) { return _Factory.Contract.SetFeeAmountExtraInfo(&_Factory.TransactOpts, fee, whitelistRequested, enabled) } // SetFeeAmountExtraInfo is a paid mutator transaction binding the contract method 0x8ff38e80. // // Solidity: function setFeeAmountExtraInfo(uint24 fee, bool whitelistRequested, bool enabled) returns() func (_Factory *FactoryTransactorSession) SetFeeAmountExtraInfo(fee *big.Int, whitelistRequested bool, enabled bool) (*types.Transaction, error) { return _Factory.Contract.SetFeeAmountExtraInfo(&_Factory.TransactOpts, fee, whitelistRequested, enabled) } // SetFeeProtocol is a paid mutator transaction binding the contract method 0x7e8435e6. // // Solidity: function setFeeProtocol(address pool, uint32 feeProtocol0, uint32 feeProtocol1) returns() func (_Factory *FactoryTransactor) SetFeeProtocol(opts *bind.TransactOpts, pool common.Address, feeProtocol0 uint32, feeProtocol1 uint32) (*types.Transaction, error) { return _Factory.contract.Transact(opts, "setFeeProtocol", pool, feeProtocol0, feeProtocol1) } // SetFeeProtocol is a paid mutator transaction binding the contract method 0x7e8435e6. // // Solidity: function setFeeProtocol(address pool, uint32 feeProtocol0, uint32 feeProtocol1) returns() func (_Factory *FactorySession) SetFeeProtocol(pool common.Address, feeProtocol0 uint32, feeProtocol1 uint32) (*types.Transaction, error) { return _Factory.Contract.SetFeeProtocol(&_Factory.TransactOpts, pool, feeProtocol0, feeProtocol1) } // SetFeeProtocol is a paid mutator transaction binding the contract method 0x7e8435e6. // // Solidity: function setFeeProtocol(address pool, uint32 feeProtocol0, uint32 feeProtocol1) returns() func (_Factory *FactoryTransactorSession) SetFeeProtocol(pool common.Address, feeProtocol0 uint32, feeProtocol1 uint32) (*types.Transaction, error) { return _Factory.Contract.SetFeeProtocol(&_Factory.TransactOpts, pool, feeProtocol0, feeProtocol1) } // SetLmPool is a paid mutator transaction binding the contract method 0x11ff5e8d. // // Solidity: function setLmPool(address pool, address lmPool) returns() func (_Factory *FactoryTransactor) SetLmPool(opts *bind.TransactOpts, pool common.Address, lmPool common.Address) (*types.Transaction, error) { return _Factory.contract.Transact(opts, "setLmPool", pool, lmPool) } // SetLmPool is a paid mutator transaction binding the contract method 0x11ff5e8d. // // Solidity: function setLmPool(address pool, address lmPool) returns() func (_Factory *FactorySession) SetLmPool(pool common.Address, lmPool common.Address) (*types.Transaction, error) { return _Factory.Contract.SetLmPool(&_Factory.TransactOpts, pool, lmPool) } // SetLmPool is a paid mutator transaction binding the contract method 0x11ff5e8d. // // Solidity: function setLmPool(address pool, address lmPool) returns() func (_Factory *FactoryTransactorSession) SetLmPool(pool common.Address, lmPool common.Address) (*types.Transaction, error) { return _Factory.Contract.SetLmPool(&_Factory.TransactOpts, pool, lmPool) } // SetLmPoolDeployer is a paid mutator transaction binding the contract method 0x80d6a792. // // Solidity: function setLmPoolDeployer(address _lmPoolDeployer) returns() func (_Factory *FactoryTransactor) SetLmPoolDeployer(opts *bind.TransactOpts, _lmPoolDeployer common.Address) (*types.Transaction, error) { return _Factory.contract.Transact(opts, "setLmPoolDeployer", _lmPoolDeployer) } // SetLmPoolDeployer is a paid mutator transaction binding the contract method 0x80d6a792. // // Solidity: function setLmPoolDeployer(address _lmPoolDeployer) returns() func (_Factory *FactorySession) SetLmPoolDeployer(_lmPoolDeployer common.Address) (*types.Transaction, error) { return _Factory.Contract.SetLmPoolDeployer(&_Factory.TransactOpts, _lmPoolDeployer) } // SetLmPoolDeployer is a paid mutator transaction binding the contract method 0x80d6a792. // // Solidity: function setLmPoolDeployer(address _lmPoolDeployer) returns() func (_Factory *FactoryTransactorSession) SetLmPoolDeployer(_lmPoolDeployer common.Address) (*types.Transaction, error) { return _Factory.Contract.SetLmPoolDeployer(&_Factory.TransactOpts, _lmPoolDeployer) } // SetOwner is a paid mutator transaction binding the contract method 0x13af4035. // // Solidity: function setOwner(address _owner) returns() func (_Factory *FactoryTransactor) SetOwner(opts *bind.TransactOpts, _owner common.Address) (*types.Transaction, error) { return _Factory.contract.Transact(opts, "setOwner", _owner) } // SetOwner is a paid mutator transaction binding the contract method 0x13af4035. // // Solidity: function setOwner(address _owner) returns() func (_Factory *FactorySession) SetOwner(_owner common.Address) (*types.Transaction, error) { return _Factory.Contract.SetOwner(&_Factory.TransactOpts, _owner) } // SetOwner is a paid mutator transaction binding the contract method 0x13af4035. // // Solidity: function setOwner(address _owner) returns() func (_Factory *FactoryTransactorSession) SetOwner(_owner common.Address) (*types.Transaction, error) { return _Factory.Contract.SetOwner(&_Factory.TransactOpts, _owner) } // SetWhiteListAddress is a paid mutator transaction binding the contract method 0xe4a86a99. // // Solidity: function setWhiteListAddress(address user, bool verified) returns() func (_Factory *FactoryTransactor) SetWhiteListAddress(opts *bind.TransactOpts, user common.Address, verified bool) (*types.Transaction, error) { return _Factory.contract.Transact(opts, "setWhiteListAddress", user, verified) } // SetWhiteListAddress is a paid mutator transaction binding the contract method 0xe4a86a99. // // Solidity: function setWhiteListAddress(address user, bool verified) returns() func (_Factory *FactorySession) SetWhiteListAddress(user common.Address, verified bool) (*types.Transaction, error) { return _Factory.Contract.SetWhiteListAddress(&_Factory.TransactOpts, user, verified) } // SetWhiteListAddress is a paid mutator transaction binding the contract method 0xe4a86a99. // // Solidity: function setWhiteListAddress(address user, bool verified) returns() func (_Factory *FactoryTransactorSession) SetWhiteListAddress(user common.Address, verified bool) (*types.Transaction, error) { return _Factory.Contract.SetWhiteListAddress(&_Factory.TransactOpts, user, verified) } // FactoryFeeAmountEnabledIterator is returned from FilterFeeAmountEnabled and is used to iterate over the raw logs and unpacked data for FeeAmountEnabled events raised by the Factory contract. type FactoryFeeAmountEnabledIterator struct { Event *FactoryFeeAmountEnabled // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *FactoryFeeAmountEnabledIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(FactoryFeeAmountEnabled) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(FactoryFeeAmountEnabled) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *FactoryFeeAmountEnabledIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *FactoryFeeAmountEnabledIterator) Close() error { it.sub.Unsubscribe() return nil } // FactoryFeeAmountEnabled represents a FeeAmountEnabled event raised by the Factory contract. type FactoryFeeAmountEnabled struct { Fee *big.Int TickSpacing *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterFeeAmountEnabled is a free log retrieval operation binding the contract event 0xc66a3fdf07232cdd185febcc6579d408c241b47ae2f9907d84be655141eeaecc. // // Solidity: event FeeAmountEnabled(uint24 indexed fee, int24 indexed tickSpacing) func (_Factory *FactoryFilterer) FilterFeeAmountEnabled(opts *bind.FilterOpts, fee []*big.Int, tickSpacing []*big.Int) (*FactoryFeeAmountEnabledIterator, error) { var feeRule []interface{} for _, feeItem := range fee { feeRule = append(feeRule, feeItem) } var tickSpacingRule []interface{} for _, tickSpacingItem := range tickSpacing { tickSpacingRule = append(tickSpacingRule, tickSpacingItem) } logs, sub, err := _Factory.contract.FilterLogs(opts, "FeeAmountEnabled", feeRule, tickSpacingRule) if err != nil { return nil, err } return &FactoryFeeAmountEnabledIterator{contract: _Factory.contract, event: "FeeAmountEnabled", logs: logs, sub: sub}, nil } // WatchFeeAmountEnabled is a free log subscription operation binding the contract event 0xc66a3fdf07232cdd185febcc6579d408c241b47ae2f9907d84be655141eeaecc. // // Solidity: event FeeAmountEnabled(uint24 indexed fee, int24 indexed tickSpacing) func (_Factory *FactoryFilterer) WatchFeeAmountEnabled(opts *bind.WatchOpts, sink chan<- *FactoryFeeAmountEnabled, fee []*big.Int, tickSpacing []*big.Int) (event.Subscription, error) { var feeRule []interface{} for _, feeItem := range fee { feeRule = append(feeRule, feeItem) } var tickSpacingRule []interface{} for _, tickSpacingItem := range tickSpacing { tickSpacingRule = append(tickSpacingRule, tickSpacingItem) } logs, sub, err := _Factory.contract.WatchLogs(opts, "FeeAmountEnabled", feeRule, tickSpacingRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(FactoryFeeAmountEnabled) if err := _Factory.contract.UnpackLog(event, "FeeAmountEnabled", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseFeeAmountEnabled is a log parse operation binding the contract event 0xc66a3fdf07232cdd185febcc6579d408c241b47ae2f9907d84be655141eeaecc. // // Solidity: event FeeAmountEnabled(uint24 indexed fee, int24 indexed tickSpacing) func (_Factory *FactoryFilterer) ParseFeeAmountEnabled(log types.Log) (*FactoryFeeAmountEnabled, error) { event := new(FactoryFeeAmountEnabled) if err := _Factory.contract.UnpackLog(event, "FeeAmountEnabled", log); err != nil { return nil, err } event.Raw = log return event, nil } // FactoryFeeAmountExtraInfoUpdatedIterator is returned from FilterFeeAmountExtraInfoUpdated and is used to iterate over the raw logs and unpacked data for FeeAmountExtraInfoUpdated events raised by the Factory contract. type FactoryFeeAmountExtraInfoUpdatedIterator struct { Event *FactoryFeeAmountExtraInfoUpdated // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *FactoryFeeAmountExtraInfoUpdatedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(FactoryFeeAmountExtraInfoUpdated) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(FactoryFeeAmountExtraInfoUpdated) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *FactoryFeeAmountExtraInfoUpdatedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *FactoryFeeAmountExtraInfoUpdatedIterator) Close() error { it.sub.Unsubscribe() return nil } // FactoryFeeAmountExtraInfoUpdated represents a FeeAmountExtraInfoUpdated event raised by the Factory contract. type FactoryFeeAmountExtraInfoUpdated struct { Fee *big.Int WhitelistRequested bool Enabled bool Raw types.Log // Blockchain specific contextual infos } // FilterFeeAmountExtraInfoUpdated is a free log retrieval operation binding the contract event 0xed85b616dbfbc54d0f1180a7bd0f6e3bb645b269b234e7a9edcc269ef1443d88. // // Solidity: event FeeAmountExtraInfoUpdated(uint24 indexed fee, bool whitelistRequested, bool enabled) func (_Factory *FactoryFilterer) FilterFeeAmountExtraInfoUpdated(opts *bind.FilterOpts, fee []*big.Int) (*FactoryFeeAmountExtraInfoUpdatedIterator, error) { var feeRule []interface{} for _, feeItem := range fee { feeRule = append(feeRule, feeItem) } logs, sub, err := _Factory.contract.FilterLogs(opts, "FeeAmountExtraInfoUpdated", feeRule) if err != nil { return nil, err } return &FactoryFeeAmountExtraInfoUpdatedIterator{contract: _Factory.contract, event: "FeeAmountExtraInfoUpdated", logs: logs, sub: sub}, nil } // WatchFeeAmountExtraInfoUpdated is a free log subscription operation binding the contract event 0xed85b616dbfbc54d0f1180a7bd0f6e3bb645b269b234e7a9edcc269ef1443d88. // // Solidity: event FeeAmountExtraInfoUpdated(uint24 indexed fee, bool whitelistRequested, bool enabled) func (_Factory *FactoryFilterer) WatchFeeAmountExtraInfoUpdated(opts *bind.WatchOpts, sink chan<- *FactoryFeeAmountExtraInfoUpdated, fee []*big.Int) (event.Subscription, error) { var feeRule []interface{} for _, feeItem := range fee { feeRule = append(feeRule, feeItem) } logs, sub, err := _Factory.contract.WatchLogs(opts, "FeeAmountExtraInfoUpdated", feeRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(FactoryFeeAmountExtraInfoUpdated) if err := _Factory.contract.UnpackLog(event, "FeeAmountExtraInfoUpdated", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseFeeAmountExtraInfoUpdated is a log parse operation binding the contract event 0xed85b616dbfbc54d0f1180a7bd0f6e3bb645b269b234e7a9edcc269ef1443d88. // // Solidity: event FeeAmountExtraInfoUpdated(uint24 indexed fee, bool whitelistRequested, bool enabled) func (_Factory *FactoryFilterer) ParseFeeAmountExtraInfoUpdated(log types.Log) (*FactoryFeeAmountExtraInfoUpdated, error) { event := new(FactoryFeeAmountExtraInfoUpdated) if err := _Factory.contract.UnpackLog(event, "FeeAmountExtraInfoUpdated", log); err != nil { return nil, err } event.Raw = log return event, nil } // FactoryOwnerChangedIterator is returned from FilterOwnerChanged and is used to iterate over the raw logs and unpacked data for OwnerChanged events raised by the Factory contract. type FactoryOwnerChangedIterator struct { Event *FactoryOwnerChanged // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *FactoryOwnerChangedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(FactoryOwnerChanged) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(FactoryOwnerChanged) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *FactoryOwnerChangedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *FactoryOwnerChangedIterator) Close() error { it.sub.Unsubscribe() return nil } // FactoryOwnerChanged represents a OwnerChanged event raised by the Factory contract. type FactoryOwnerChanged struct { OldOwner common.Address NewOwner common.Address Raw types.Log // Blockchain specific contextual infos } // FilterOwnerChanged is a free log retrieval operation binding the contract event 0xb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c. // // Solidity: event OwnerChanged(address indexed oldOwner, address indexed newOwner) func (_Factory *FactoryFilterer) FilterOwnerChanged(opts *bind.FilterOpts, oldOwner []common.Address, newOwner []common.Address) (*FactoryOwnerChangedIterator, error) { var oldOwnerRule []interface{} for _, oldOwnerItem := range oldOwner { oldOwnerRule = append(oldOwnerRule, oldOwnerItem) } var newOwnerRule []interface{} for _, newOwnerItem := range newOwner { newOwnerRule = append(newOwnerRule, newOwnerItem) } logs, sub, err := _Factory.contract.FilterLogs(opts, "OwnerChanged", oldOwnerRule, newOwnerRule) if err != nil { return nil, err } return &FactoryOwnerChangedIterator{contract: _Factory.contract, event: "OwnerChanged", logs: logs, sub: sub}, nil } // WatchOwnerChanged is a free log subscription operation binding the contract event 0xb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c. // // Solidity: event OwnerChanged(address indexed oldOwner, address indexed newOwner) func (_Factory *FactoryFilterer) WatchOwnerChanged(opts *bind.WatchOpts, sink chan<- *FactoryOwnerChanged, oldOwner []common.Address, newOwner []common.Address) (event.Subscription, error) { var oldOwnerRule []interface{} for _, oldOwnerItem := range oldOwner { oldOwnerRule = append(oldOwnerRule, oldOwnerItem) } var newOwnerRule []interface{} for _, newOwnerItem := range newOwner { newOwnerRule = append(newOwnerRule, newOwnerItem) } logs, sub, err := _Factory.contract.WatchLogs(opts, "OwnerChanged", oldOwnerRule, newOwnerRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(FactoryOwnerChanged) if err := _Factory.contract.UnpackLog(event, "OwnerChanged", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseOwnerChanged is a log parse operation binding the contract event 0xb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c. // // Solidity: event OwnerChanged(address indexed oldOwner, address indexed newOwner) func (_Factory *FactoryFilterer) ParseOwnerChanged(log types.Log) (*FactoryOwnerChanged, error) { event := new(FactoryOwnerChanged) if err := _Factory.contract.UnpackLog(event, "OwnerChanged", log); err != nil { return nil, err } event.Raw = log return event, nil } // FactoryPoolCreatedIterator is returned from FilterPoolCreated and is used to iterate over the raw logs and unpacked data for PoolCreated events raised by the Factory contract. type FactoryPoolCreatedIterator struct { Event *FactoryPoolCreated // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *FactoryPoolCreatedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(FactoryPoolCreated) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(FactoryPoolCreated) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *FactoryPoolCreatedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *FactoryPoolCreatedIterator) Close() error { it.sub.Unsubscribe() return nil } // FactoryPoolCreated represents a PoolCreated event raised by the Factory contract. type FactoryPoolCreated struct { Token0 common.Address Token1 common.Address Fee *big.Int TickSpacing *big.Int Pool common.Address Raw types.Log // Blockchain specific contextual infos } // FilterPoolCreated is a free log retrieval operation binding the contract event 0x783cca1c0412dd0d695e784568c96da2e9c22ff989357a2e8b1d9b2b4e6b7118. // // Solidity: event PoolCreated(address indexed token0, address indexed token1, uint24 indexed fee, int24 tickSpacing, address pool) func (_Factory *FactoryFilterer) FilterPoolCreated(opts *bind.FilterOpts, token0 []common.Address, token1 []common.Address, fee []*big.Int) (*FactoryPoolCreatedIterator, error) { var token0Rule []interface{} for _, token0Item := range token0 { token0Rule = append(token0Rule, token0Item) } var token1Rule []interface{} for _, token1Item := range token1 { token1Rule = append(token1Rule, token1Item) } var feeRule []interface{} for _, feeItem := range fee { feeRule = append(feeRule, feeItem) } logs, sub, err := _Factory.contract.FilterLogs(opts, "PoolCreated", token0Rule, token1Rule, feeRule) if err != nil { return nil, err } return &FactoryPoolCreatedIterator{contract: _Factory.contract, event: "PoolCreated", logs: logs, sub: sub}, nil } // WatchPoolCreated is a free log subscription operation binding the contract event 0x783cca1c0412dd0d695e784568c96da2e9c22ff989357a2e8b1d9b2b4e6b7118. // // Solidity: event PoolCreated(address indexed token0, address indexed token1, uint24 indexed fee, int24 tickSpacing, address pool) func (_Factory *FactoryFilterer) WatchPoolCreated(opts *bind.WatchOpts, sink chan<- *FactoryPoolCreated, token0 []common.Address, token1 []common.Address, fee []*big.Int) (event.Subscription, error) { var token0Rule []interface{} for _, token0Item := range token0 { token0Rule = append(token0Rule, token0Item) } var token1Rule []interface{} for _, token1Item := range token1 { token1Rule = append(token1Rule, token1Item) } var feeRule []interface{} for _, feeItem := range fee { feeRule = append(feeRule, feeItem) } logs, sub, err := _Factory.contract.WatchLogs(opts, "PoolCreated", token0Rule, token1Rule, feeRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(FactoryPoolCreated) if err := _Factory.contract.UnpackLog(event, "PoolCreated", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParsePoolCreated is a log parse operation binding the contract event 0x783cca1c0412dd0d695e784568c96da2e9c22ff989357a2e8b1d9b2b4e6b7118. // // Solidity: event PoolCreated(address indexed token0, address indexed token1, uint24 indexed fee, int24 tickSpacing, address pool) func (_Factory *FactoryFilterer) ParsePoolCreated(log types.Log) (*FactoryPoolCreated, error) { event := new(FactoryPoolCreated) if err := _Factory.contract.UnpackLog(event, "PoolCreated", log); err != nil { return nil, err } event.Raw = log return event, nil } // FactorySetLmPoolDeployerIterator is returned from FilterSetLmPoolDeployer and is used to iterate over the raw logs and unpacked data for SetLmPoolDeployer events raised by the Factory contract. type FactorySetLmPoolDeployerIterator struct { Event *FactorySetLmPoolDeployer // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *FactorySetLmPoolDeployerIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(FactorySetLmPoolDeployer) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(FactorySetLmPoolDeployer) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *FactorySetLmPoolDeployerIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *FactorySetLmPoolDeployerIterator) Close() error { it.sub.Unsubscribe() return nil } // FactorySetLmPoolDeployer represents a SetLmPoolDeployer event raised by the Factory contract. type FactorySetLmPoolDeployer struct { LmPoolDeployer common.Address Raw types.Log // Blockchain specific contextual infos } // FilterSetLmPoolDeployer is a free log retrieval operation binding the contract event 0x4c912280cda47bed324de14f601d3f125a98254671772f3f1f491e50fa0ca407. // // Solidity: event SetLmPoolDeployer(address indexed lmPoolDeployer) func (_Factory *FactoryFilterer) FilterSetLmPoolDeployer(opts *bind.FilterOpts, lmPoolDeployer []common.Address) (*FactorySetLmPoolDeployerIterator, error) { var lmPoolDeployerRule []interface{} for _, lmPoolDeployerItem := range lmPoolDeployer { lmPoolDeployerRule = append(lmPoolDeployerRule, lmPoolDeployerItem) } logs, sub, err := _Factory.contract.FilterLogs(opts, "SetLmPoolDeployer", lmPoolDeployerRule) if err != nil { return nil, err } return &FactorySetLmPoolDeployerIterator{contract: _Factory.contract, event: "SetLmPoolDeployer", logs: logs, sub: sub}, nil } // WatchSetLmPoolDeployer is a free log subscription operation binding the contract event 0x4c912280cda47bed324de14f601d3f125a98254671772f3f1f491e50fa0ca407. // // Solidity: event SetLmPoolDeployer(address indexed lmPoolDeployer) func (_Factory *FactoryFilterer) WatchSetLmPoolDeployer(opts *bind.WatchOpts, sink chan<- *FactorySetLmPoolDeployer, lmPoolDeployer []common.Address) (event.Subscription, error) { var lmPoolDeployerRule []interface{} for _, lmPoolDeployerItem := range lmPoolDeployer { lmPoolDeployerRule = append(lmPoolDeployerRule, lmPoolDeployerItem) } logs, sub, err := _Factory.contract.WatchLogs(opts, "SetLmPoolDeployer", lmPoolDeployerRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(FactorySetLmPoolDeployer) if err := _Factory.contract.UnpackLog(event, "SetLmPoolDeployer", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseSetLmPoolDeployer is a log parse operation binding the contract event 0x4c912280cda47bed324de14f601d3f125a98254671772f3f1f491e50fa0ca407. // // Solidity: event SetLmPoolDeployer(address indexed lmPoolDeployer) func (_Factory *FactoryFilterer) ParseSetLmPoolDeployer(log types.Log) (*FactorySetLmPoolDeployer, error) { event := new(FactorySetLmPoolDeployer) if err := _Factory.contract.UnpackLog(event, "SetLmPoolDeployer", log); err != nil { return nil, err } event.Raw = log return event, nil } // FactoryWhiteListAddedIterator is returned from FilterWhiteListAdded and is used to iterate over the raw logs and unpacked data for WhiteListAdded events raised by the Factory contract. type FactoryWhiteListAddedIterator struct { Event *FactoryWhiteListAdded // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *FactoryWhiteListAddedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(FactoryWhiteListAdded) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(FactoryWhiteListAdded) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *FactoryWhiteListAddedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *FactoryWhiteListAddedIterator) Close() error { it.sub.Unsubscribe() return nil } // FactoryWhiteListAdded represents a WhiteListAdded event raised by the Factory contract. type FactoryWhiteListAdded struct { User common.Address Verified bool Raw types.Log // Blockchain specific contextual infos } // FilterWhiteListAdded is a free log retrieval operation binding the contract event 0xaec42ac7f1bb8651906ae6522f50a19429e124e8ea678ef59fd27750759288a2. // // Solidity: event WhiteListAdded(address indexed user, bool verified) func (_Factory *FactoryFilterer) FilterWhiteListAdded(opts *bind.FilterOpts, user []common.Address) (*FactoryWhiteListAddedIterator, error) { var userRule []interface{} for _, userItem := range user { userRule = append(userRule, userItem) } logs, sub, err := _Factory.contract.FilterLogs(opts, "WhiteListAdded", userRule) if err != nil { return nil, err } return &FactoryWhiteListAddedIterator{contract: _Factory.contract, event: "WhiteListAdded", logs: logs, sub: sub}, nil } // WatchWhiteListAdded is a free log subscription operation binding the contract event 0xaec42ac7f1bb8651906ae6522f50a19429e124e8ea678ef59fd27750759288a2. // // Solidity: event WhiteListAdded(address indexed user, bool verified) func (_Factory *FactoryFilterer) WatchWhiteListAdded(opts *bind.WatchOpts, sink chan<- *FactoryWhiteListAdded, user []common.Address) (event.Subscription, error) { var userRule []interface{} for _, userItem := range user { userRule = append(userRule, userItem) } logs, sub, err := _Factory.contract.WatchLogs(opts, "WhiteListAdded", userRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(FactoryWhiteListAdded) if err := _Factory.contract.UnpackLog(event, "WhiteListAdded", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseWhiteListAdded is a log parse operation binding the contract event 0xaec42ac7f1bb8651906ae6522f50a19429e124e8ea678ef59fd27750759288a2. // // Solidity: event WhiteListAdded(address indexed user, bool verified) func (_Factory *FactoryFilterer) ParseWhiteListAdded(log types.Log) (*FactoryWhiteListAdded, error) { event := new(FactoryWhiteListAdded) if err := _Factory.contract.UnpackLog(event, "WhiteListAdded", log); err != nil { return nil, err } event.Raw = log return event, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/binds/bscfactory/abi.json ================================================ [ { "inputs": [ { "internalType": "address", "name": "_poolDeployer", "type": "address" } ], "stateMutability": "nonpayable", "type": "constructor" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "uint24", "name": "fee", "type": "uint24" }, { "indexed": true, "internalType": "int24", "name": "tickSpacing", "type": "int24" } ], "name": "FeeAmountEnabled", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "uint24", "name": "fee", "type": "uint24" }, { "indexed": false, "internalType": "bool", "name": "whitelistRequested", "type": "bool" }, { "indexed": false, "internalType": "bool", "name": "enabled", "type": "bool" } ], "name": "FeeAmountExtraInfoUpdated", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "oldOwner", "type": "address" }, { "indexed": true, "internalType": "address", "name": "newOwner", "type": "address" } ], "name": "OwnerChanged", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "token0", "type": "address" }, { "indexed": true, "internalType": "address", "name": "token1", "type": "address" }, { "indexed": true, "internalType": "uint24", "name": "fee", "type": "uint24" }, { "indexed": false, "internalType": "int24", "name": "tickSpacing", "type": "int24" }, { "indexed": false, "internalType": "address", "name": "pool", "type": "address" } ], "name": "PoolCreated", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "lmPoolDeployer", "type": "address" } ], "name": "SetLmPoolDeployer", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "user", "type": "address" }, { "indexed": false, "internalType": "bool", "name": "verified", "type": "bool" } ], "name": "WhiteListAdded", "type": "event" }, { "inputs": [ { "internalType": "address", "name": "pool", "type": "address" }, { "internalType": "address", "name": "recipient", "type": "address" }, { "internalType": "uint128", "name": "amount0Requested", "type": "uint128" }, { "internalType": "uint128", "name": "amount1Requested", "type": "uint128" } ], "name": "collectProtocol", "outputs": [ { "internalType": "uint128", "name": "amount0", "type": "uint128" }, { "internalType": "uint128", "name": "amount1", "type": "uint128" } ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "tokenA", "type": "address" }, { "internalType": "address", "name": "tokenB", "type": "address" }, { "internalType": "uint24", "name": "fee", "type": "uint24" } ], "name": "createPool", "outputs": [ { "internalType": "address", "name": "pool", "type": "address" } ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint24", "name": "fee", "type": "uint24" }, { "internalType": "int24", "name": "tickSpacing", "type": "int24" } ], "name": "enableFeeAmount", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint24", "name": "", "type": "uint24" } ], "name": "feeAmountTickSpacing", "outputs": [ { "internalType": "int24", "name": "", "type": "int24" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint24", "name": "", "type": "uint24" } ], "name": "feeAmountTickSpacingExtraInfo", "outputs": [ { "internalType": "bool", "name": "whitelistRequested", "type": "bool" }, { "internalType": "bool", "name": "enabled", "type": "bool" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "", "type": "address" }, { "internalType": "address", "name": "", "type": "address" }, { "internalType": "uint24", "name": "", "type": "uint24" } ], "name": "getPool", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "lmPoolDeployer", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "owner", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "poolDeployer", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint24", "name": "fee", "type": "uint24" }, { "internalType": "bool", "name": "whitelistRequested", "type": "bool" }, { "internalType": "bool", "name": "enabled", "type": "bool" } ], "name": "setFeeAmountExtraInfo", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "pool", "type": "address" }, { "internalType": "uint32", "name": "feeProtocol0", "type": "uint32" }, { "internalType": "uint32", "name": "feeProtocol1", "type": "uint32" } ], "name": "setFeeProtocol", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "pool", "type": "address" }, { "internalType": "address", "name": "lmPool", "type": "address" } ], "name": "setLmPool", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "_lmPoolDeployer", "type": "address" } ], "name": "setLmPoolDeployer", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "_owner", "type": "address" } ], "name": "setOwner", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "user", "type": "address" }, { "internalType": "bool", "name": "verified", "type": "bool" } ], "name": "setWhiteListAddress", "outputs": [], "stateMutability": "nonpayable", "type": "function" } ] ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/binds/bscnonfungiblepositionmanager/NonfungiblePositionManager.go ================================================ // Code generated - DO NOT EDIT. // This file is a generated binding and any manual changes will be lost. package bscnonfungiblepositionmanager import ( "errors" "math/big" "strings" ethereum "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/event" ) // Reference imports to suppress errors if they are not otherwise used. var ( _ = errors.New _ = big.NewInt _ = strings.NewReader _ = ethereum.NotFound _ = bind.Bind _ = common.Big1 _ = types.BloomLookup _ = event.NewSubscription _ = abi.ConvertType ) // INonfungiblePositionManagerCollectParams is an auto generated low-level Go binding around an user-defined struct. type INonfungiblePositionManagerCollectParams struct { TokenId *big.Int Recipient common.Address Amount0Max *big.Int Amount1Max *big.Int } // INonfungiblePositionManagerDecreaseLiquidityParams is an auto generated low-level Go binding around an user-defined struct. type INonfungiblePositionManagerDecreaseLiquidityParams struct { TokenId *big.Int Liquidity *big.Int Amount0Min *big.Int Amount1Min *big.Int Deadline *big.Int } // INonfungiblePositionManagerIncreaseLiquidityParams is an auto generated low-level Go binding around an user-defined struct. type INonfungiblePositionManagerIncreaseLiquidityParams struct { TokenId *big.Int Amount0Desired *big.Int Amount1Desired *big.Int Amount0Min *big.Int Amount1Min *big.Int Deadline *big.Int } // INonfungiblePositionManagerMintParams is an auto generated low-level Go binding around an user-defined struct. type INonfungiblePositionManagerMintParams struct { Token0 common.Address Token1 common.Address Fee *big.Int TickLower *big.Int TickUpper *big.Int Amount0Desired *big.Int Amount1Desired *big.Int Amount0Min *big.Int Amount1Min *big.Int Recipient common.Address Deadline *big.Int } // NonfungiblePositionManagerMetaData contains all meta data concerning the NonfungiblePositionManager contract. var NonfungiblePositionManagerMetaData = &bind.MetaData{ ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_deployer\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_factory\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_WETH9\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_tokenDescriptor_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"approved\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"ApprovalForAll\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"}],\"name\":\"Collect\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"liquidity\",\"type\":\"uint128\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"}],\"name\":\"DecreaseLiquidity\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"liquidity\",\"type\":\"uint128\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"}],\"name\":\"IncreaseLiquidity\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"DOMAIN_SEPARATOR\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"PERMIT_TYPEHASH\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"WETH9\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"baseURI\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"burn\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint128\",\"name\":\"amount0Max\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"amount1Max\",\"type\":\"uint128\"}],\"internalType\":\"structINonfungiblePositionManager.CollectParams\",\"name\":\"params\",\"type\":\"tuple\"}],\"name\":\"collect\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token0\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token1\",\"type\":\"address\"},{\"internalType\":\"uint24\",\"name\":\"fee\",\"type\":\"uint24\"},{\"internalType\":\"uint160\",\"name\":\"sqrtPriceX96\",\"type\":\"uint160\"}],\"name\":\"createAndInitializePoolIfNecessary\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint128\",\"name\":\"liquidity\",\"type\":\"uint128\"},{\"internalType\":\"uint256\",\"name\":\"amount0Min\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Min\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"}],\"internalType\":\"structINonfungiblePositionManager.DecreaseLiquidityParams\",\"name\":\"params\",\"type\":\"tuple\"}],\"name\":\"decreaseLiquidity\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"deployer\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"factory\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"getApproved\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount0Desired\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Desired\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount0Min\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Min\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"}],\"internalType\":\"structINonfungiblePositionManager.IncreaseLiquidityParams\",\"name\":\"params\",\"type\":\"tuple\"}],\"name\":\"increaseLiquidity\",\"outputs\":[{\"internalType\":\"uint128\",\"name\":\"liquidity\",\"type\":\"uint128\"},{\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"name\":\"isApprovedForAll\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"token0\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token1\",\"type\":\"address\"},{\"internalType\":\"uint24\",\"name\":\"fee\",\"type\":\"uint24\"},{\"internalType\":\"int24\",\"name\":\"tickLower\",\"type\":\"int24\"},{\"internalType\":\"int24\",\"name\":\"tickUpper\",\"type\":\"int24\"},{\"internalType\":\"uint256\",\"name\":\"amount0Desired\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Desired\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount0Min\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Min\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"}],\"internalType\":\"structINonfungiblePositionManager.MintParams\",\"name\":\"params\",\"type\":\"tuple\"}],\"name\":\"mint\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint128\",\"name\":\"liquidity\",\"type\":\"uint128\"},{\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes[]\",\"name\":\"data\",\"type\":\"bytes[]\"}],\"name\":\"multicall\",\"outputs\":[{\"internalType\":\"bytes[]\",\"name\":\"results\",\"type\":\"bytes[]\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"ownerOf\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0Owed\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Owed\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"pancakeV3MintCallback\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"permit\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"positions\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"nonce\",\"type\":\"uint96\"},{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token0\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token1\",\"type\":\"address\"},{\"internalType\":\"uint24\",\"name\":\"fee\",\"type\":\"uint24\"},{\"internalType\":\"int24\",\"name\":\"tickLower\",\"type\":\"int24\"},{\"internalType\":\"int24\",\"name\":\"tickUpper\",\"type\":\"int24\"},{\"internalType\":\"uint128\",\"name\":\"liquidity\",\"type\":\"uint128\"},{\"internalType\":\"uint256\",\"name\":\"feeGrowthInside0LastX128\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"feeGrowthInside1LastX128\",\"type\":\"uint256\"},{\"internalType\":\"uint128\",\"name\":\"tokensOwed0\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"tokensOwed1\",\"type\":\"uint128\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"refundETH\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"safeTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"safeTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"selfPermit\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiry\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"selfPermitAllowed\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiry\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"selfPermitAllowedIfNecessary\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"selfPermitIfNecessary\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"setApprovalForAll\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amountMinimum\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"}],\"name\":\"sweepToken\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"}],\"name\":\"tokenByIndex\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"}],\"name\":\"tokenOfOwnerByIndex\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"tokenURI\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountMinimum\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"}],\"name\":\"unwrapWETH9\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]", } // NonfungiblePositionManagerABI is the input ABI used to generate the binding from. // Deprecated: Use NonfungiblePositionManagerMetaData.ABI instead. var NonfungiblePositionManagerABI = NonfungiblePositionManagerMetaData.ABI // NonfungiblePositionManager is an auto generated Go binding around an Ethereum contract. type NonfungiblePositionManager struct { NonfungiblePositionManagerCaller // Read-only binding to the contract NonfungiblePositionManagerTransactor // Write-only binding to the contract NonfungiblePositionManagerFilterer // Log filterer for contract events } // NonfungiblePositionManagerCaller is an auto generated read-only Go binding around an Ethereum contract. type NonfungiblePositionManagerCaller struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // NonfungiblePositionManagerTransactor is an auto generated write-only Go binding around an Ethereum contract. type NonfungiblePositionManagerTransactor struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // NonfungiblePositionManagerFilterer is an auto generated log filtering Go binding around an Ethereum contract events. type NonfungiblePositionManagerFilterer struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // NonfungiblePositionManagerSession is an auto generated Go binding around an Ethereum contract, // with pre-set call and transact options. type NonfungiblePositionManagerSession struct { Contract *NonfungiblePositionManager // Generic contract binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // NonfungiblePositionManagerCallerSession is an auto generated read-only Go binding around an Ethereum contract, // with pre-set call options. type NonfungiblePositionManagerCallerSession struct { Contract *NonfungiblePositionManagerCaller // Generic contract caller binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session } // NonfungiblePositionManagerTransactorSession is an auto generated write-only Go binding around an Ethereum contract, // with pre-set transact options. type NonfungiblePositionManagerTransactorSession struct { Contract *NonfungiblePositionManagerTransactor // Generic contract transactor binding to set the session for TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // NonfungiblePositionManagerRaw is an auto generated low-level Go binding around an Ethereum contract. type NonfungiblePositionManagerRaw struct { Contract *NonfungiblePositionManager // Generic contract binding to access the raw methods on } // NonfungiblePositionManagerCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. type NonfungiblePositionManagerCallerRaw struct { Contract *NonfungiblePositionManagerCaller // Generic read-only contract binding to access the raw methods on } // NonfungiblePositionManagerTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. type NonfungiblePositionManagerTransactorRaw struct { Contract *NonfungiblePositionManagerTransactor // Generic write-only contract binding to access the raw methods on } // NewNonfungiblePositionManager creates a new instance of NonfungiblePositionManager, bound to a specific deployed contract. func NewNonfungiblePositionManager(address common.Address, backend bind.ContractBackend) (*NonfungiblePositionManager, error) { contract, err := bindNonfungiblePositionManager(address, backend, backend, backend) if err != nil { return nil, err } return &NonfungiblePositionManager{NonfungiblePositionManagerCaller: NonfungiblePositionManagerCaller{contract: contract}, NonfungiblePositionManagerTransactor: NonfungiblePositionManagerTransactor{contract: contract}, NonfungiblePositionManagerFilterer: NonfungiblePositionManagerFilterer{contract: contract}}, nil } // NewNonfungiblePositionManagerCaller creates a new read-only instance of NonfungiblePositionManager, bound to a specific deployed contract. func NewNonfungiblePositionManagerCaller(address common.Address, caller bind.ContractCaller) (*NonfungiblePositionManagerCaller, error) { contract, err := bindNonfungiblePositionManager(address, caller, nil, nil) if err != nil { return nil, err } return &NonfungiblePositionManagerCaller{contract: contract}, nil } // NewNonfungiblePositionManagerTransactor creates a new write-only instance of NonfungiblePositionManager, bound to a specific deployed contract. func NewNonfungiblePositionManagerTransactor(address common.Address, transactor bind.ContractTransactor) (*NonfungiblePositionManagerTransactor, error) { contract, err := bindNonfungiblePositionManager(address, nil, transactor, nil) if err != nil { return nil, err } return &NonfungiblePositionManagerTransactor{contract: contract}, nil } // NewNonfungiblePositionManagerFilterer creates a new log filterer instance of NonfungiblePositionManager, bound to a specific deployed contract. func NewNonfungiblePositionManagerFilterer(address common.Address, filterer bind.ContractFilterer) (*NonfungiblePositionManagerFilterer, error) { contract, err := bindNonfungiblePositionManager(address, nil, nil, filterer) if err != nil { return nil, err } return &NonfungiblePositionManagerFilterer{contract: contract}, nil } // bindNonfungiblePositionManager binds a generic wrapper to an already deployed contract. func bindNonfungiblePositionManager(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { parsed, err := NonfungiblePositionManagerMetaData.GetAbi() if err != nil { return nil, err } return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_NonfungiblePositionManager *NonfungiblePositionManagerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _NonfungiblePositionManager.Contract.NonfungiblePositionManagerCaller.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_NonfungiblePositionManager *NonfungiblePositionManagerRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.NonfungiblePositionManagerTransactor.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_NonfungiblePositionManager *NonfungiblePositionManagerRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.NonfungiblePositionManagerTransactor.contract.Transact(opts, method, params...) } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _NonfungiblePositionManager.Contract.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.contract.Transact(opts, method, params...) } // DOMAINSEPARATOR is a free data retrieval call binding the contract method 0x3644e515. // // Solidity: function DOMAIN_SEPARATOR() view returns(bytes32) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) DOMAINSEPARATOR(opts *bind.CallOpts) ([32]byte, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "DOMAIN_SEPARATOR") if err != nil { return *new([32]byte), err } out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) return out0, err } // DOMAINSEPARATOR is a free data retrieval call binding the contract method 0x3644e515. // // Solidity: function DOMAIN_SEPARATOR() view returns(bytes32) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) DOMAINSEPARATOR() ([32]byte, error) { return _NonfungiblePositionManager.Contract.DOMAINSEPARATOR(&_NonfungiblePositionManager.CallOpts) } // DOMAINSEPARATOR is a free data retrieval call binding the contract method 0x3644e515. // // Solidity: function DOMAIN_SEPARATOR() view returns(bytes32) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) DOMAINSEPARATOR() ([32]byte, error) { return _NonfungiblePositionManager.Contract.DOMAINSEPARATOR(&_NonfungiblePositionManager.CallOpts) } // PERMITTYPEHASH is a free data retrieval call binding the contract method 0x30adf81f. // // Solidity: function PERMIT_TYPEHASH() view returns(bytes32) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) PERMITTYPEHASH(opts *bind.CallOpts) ([32]byte, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "PERMIT_TYPEHASH") if err != nil { return *new([32]byte), err } out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) return out0, err } // PERMITTYPEHASH is a free data retrieval call binding the contract method 0x30adf81f. // // Solidity: function PERMIT_TYPEHASH() view returns(bytes32) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) PERMITTYPEHASH() ([32]byte, error) { return _NonfungiblePositionManager.Contract.PERMITTYPEHASH(&_NonfungiblePositionManager.CallOpts) } // PERMITTYPEHASH is a free data retrieval call binding the contract method 0x30adf81f. // // Solidity: function PERMIT_TYPEHASH() view returns(bytes32) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) PERMITTYPEHASH() ([32]byte, error) { return _NonfungiblePositionManager.Contract.PERMITTYPEHASH(&_NonfungiblePositionManager.CallOpts) } // WETH9 is a free data retrieval call binding the contract method 0x4aa4a4fc. // // Solidity: function WETH9() view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) WETH9(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "WETH9") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // WETH9 is a free data retrieval call binding the contract method 0x4aa4a4fc. // // Solidity: function WETH9() view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) WETH9() (common.Address, error) { return _NonfungiblePositionManager.Contract.WETH9(&_NonfungiblePositionManager.CallOpts) } // WETH9 is a free data retrieval call binding the contract method 0x4aa4a4fc. // // Solidity: function WETH9() view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) WETH9() (common.Address, error) { return _NonfungiblePositionManager.Contract.WETH9(&_NonfungiblePositionManager.CallOpts) } // BalanceOf is a free data retrieval call binding the contract method 0x70a08231. // // Solidity: function balanceOf(address owner) view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) BalanceOf(opts *bind.CallOpts, owner common.Address) (*big.Int, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "balanceOf", owner) if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // BalanceOf is a free data retrieval call binding the contract method 0x70a08231. // // Solidity: function balanceOf(address owner) view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) BalanceOf(owner common.Address) (*big.Int, error) { return _NonfungiblePositionManager.Contract.BalanceOf(&_NonfungiblePositionManager.CallOpts, owner) } // BalanceOf is a free data retrieval call binding the contract method 0x70a08231. // // Solidity: function balanceOf(address owner) view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) BalanceOf(owner common.Address) (*big.Int, error) { return _NonfungiblePositionManager.Contract.BalanceOf(&_NonfungiblePositionManager.CallOpts, owner) } // BaseURI is a free data retrieval call binding the contract method 0x6c0360eb. // // Solidity: function baseURI() pure returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) BaseURI(opts *bind.CallOpts) (string, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "baseURI") if err != nil { return *new(string), err } out0 := *abi.ConvertType(out[0], new(string)).(*string) return out0, err } // BaseURI is a free data retrieval call binding the contract method 0x6c0360eb. // // Solidity: function baseURI() pure returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) BaseURI() (string, error) { return _NonfungiblePositionManager.Contract.BaseURI(&_NonfungiblePositionManager.CallOpts) } // BaseURI is a free data retrieval call binding the contract method 0x6c0360eb. // // Solidity: function baseURI() pure returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) BaseURI() (string, error) { return _NonfungiblePositionManager.Contract.BaseURI(&_NonfungiblePositionManager.CallOpts) } // Deployer is a free data retrieval call binding the contract method 0xd5f39488. // // Solidity: function deployer() view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) Deployer(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "deployer") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // Deployer is a free data retrieval call binding the contract method 0xd5f39488. // // Solidity: function deployer() view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Deployer() (common.Address, error) { return _NonfungiblePositionManager.Contract.Deployer(&_NonfungiblePositionManager.CallOpts) } // Deployer is a free data retrieval call binding the contract method 0xd5f39488. // // Solidity: function deployer() view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) Deployer() (common.Address, error) { return _NonfungiblePositionManager.Contract.Deployer(&_NonfungiblePositionManager.CallOpts) } // Factory is a free data retrieval call binding the contract method 0xc45a0155. // // Solidity: function factory() view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) Factory(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "factory") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // Factory is a free data retrieval call binding the contract method 0xc45a0155. // // Solidity: function factory() view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Factory() (common.Address, error) { return _NonfungiblePositionManager.Contract.Factory(&_NonfungiblePositionManager.CallOpts) } // Factory is a free data retrieval call binding the contract method 0xc45a0155. // // Solidity: function factory() view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) Factory() (common.Address, error) { return _NonfungiblePositionManager.Contract.Factory(&_NonfungiblePositionManager.CallOpts) } // GetApproved is a free data retrieval call binding the contract method 0x081812fc. // // Solidity: function getApproved(uint256 tokenId) view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) GetApproved(opts *bind.CallOpts, tokenId *big.Int) (common.Address, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "getApproved", tokenId) if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // GetApproved is a free data retrieval call binding the contract method 0x081812fc. // // Solidity: function getApproved(uint256 tokenId) view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) GetApproved(tokenId *big.Int) (common.Address, error) { return _NonfungiblePositionManager.Contract.GetApproved(&_NonfungiblePositionManager.CallOpts, tokenId) } // GetApproved is a free data retrieval call binding the contract method 0x081812fc. // // Solidity: function getApproved(uint256 tokenId) view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) GetApproved(tokenId *big.Int) (common.Address, error) { return _NonfungiblePositionManager.Contract.GetApproved(&_NonfungiblePositionManager.CallOpts, tokenId) } // IsApprovedForAll is a free data retrieval call binding the contract method 0xe985e9c5. // // Solidity: function isApprovedForAll(address owner, address operator) view returns(bool) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) IsApprovedForAll(opts *bind.CallOpts, owner common.Address, operator common.Address) (bool, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "isApprovedForAll", owner, operator) if err != nil { return *new(bool), err } out0 := *abi.ConvertType(out[0], new(bool)).(*bool) return out0, err } // IsApprovedForAll is a free data retrieval call binding the contract method 0xe985e9c5. // // Solidity: function isApprovedForAll(address owner, address operator) view returns(bool) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) IsApprovedForAll(owner common.Address, operator common.Address) (bool, error) { return _NonfungiblePositionManager.Contract.IsApprovedForAll(&_NonfungiblePositionManager.CallOpts, owner, operator) } // IsApprovedForAll is a free data retrieval call binding the contract method 0xe985e9c5. // // Solidity: function isApprovedForAll(address owner, address operator) view returns(bool) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) IsApprovedForAll(owner common.Address, operator common.Address) (bool, error) { return _NonfungiblePositionManager.Contract.IsApprovedForAll(&_NonfungiblePositionManager.CallOpts, owner, operator) } // Name is a free data retrieval call binding the contract method 0x06fdde03. // // Solidity: function name() view returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) Name(opts *bind.CallOpts) (string, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "name") if err != nil { return *new(string), err } out0 := *abi.ConvertType(out[0], new(string)).(*string) return out0, err } // Name is a free data retrieval call binding the contract method 0x06fdde03. // // Solidity: function name() view returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Name() (string, error) { return _NonfungiblePositionManager.Contract.Name(&_NonfungiblePositionManager.CallOpts) } // Name is a free data retrieval call binding the contract method 0x06fdde03. // // Solidity: function name() view returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) Name() (string, error) { return _NonfungiblePositionManager.Contract.Name(&_NonfungiblePositionManager.CallOpts) } // OwnerOf is a free data retrieval call binding the contract method 0x6352211e. // // Solidity: function ownerOf(uint256 tokenId) view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) OwnerOf(opts *bind.CallOpts, tokenId *big.Int) (common.Address, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "ownerOf", tokenId) if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // OwnerOf is a free data retrieval call binding the contract method 0x6352211e. // // Solidity: function ownerOf(uint256 tokenId) view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) OwnerOf(tokenId *big.Int) (common.Address, error) { return _NonfungiblePositionManager.Contract.OwnerOf(&_NonfungiblePositionManager.CallOpts, tokenId) } // OwnerOf is a free data retrieval call binding the contract method 0x6352211e. // // Solidity: function ownerOf(uint256 tokenId) view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) OwnerOf(tokenId *big.Int) (common.Address, error) { return _NonfungiblePositionManager.Contract.OwnerOf(&_NonfungiblePositionManager.CallOpts, tokenId) } // Positions is a free data retrieval call binding the contract method 0x99fbab88. // // Solidity: function positions(uint256 tokenId) view returns(uint96 nonce, address operator, address token0, address token1, uint24 fee, int24 tickLower, int24 tickUpper, uint128 liquidity, uint256 feeGrowthInside0LastX128, uint256 feeGrowthInside1LastX128, uint128 tokensOwed0, uint128 tokensOwed1) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) Positions(opts *bind.CallOpts, tokenId *big.Int) (struct { Nonce *big.Int Operator common.Address Token0 common.Address Token1 common.Address Fee *big.Int TickLower *big.Int TickUpper *big.Int Liquidity *big.Int FeeGrowthInside0LastX128 *big.Int FeeGrowthInside1LastX128 *big.Int TokensOwed0 *big.Int TokensOwed1 *big.Int }, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "positions", tokenId) outstruct := new(struct { Nonce *big.Int Operator common.Address Token0 common.Address Token1 common.Address Fee *big.Int TickLower *big.Int TickUpper *big.Int Liquidity *big.Int FeeGrowthInside0LastX128 *big.Int FeeGrowthInside1LastX128 *big.Int TokensOwed0 *big.Int TokensOwed1 *big.Int }) if err != nil { return *outstruct, err } outstruct.Nonce = *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) outstruct.Operator = *abi.ConvertType(out[1], new(common.Address)).(*common.Address) outstruct.Token0 = *abi.ConvertType(out[2], new(common.Address)).(*common.Address) outstruct.Token1 = *abi.ConvertType(out[3], new(common.Address)).(*common.Address) outstruct.Fee = *abi.ConvertType(out[4], new(*big.Int)).(**big.Int) outstruct.TickLower = *abi.ConvertType(out[5], new(*big.Int)).(**big.Int) outstruct.TickUpper = *abi.ConvertType(out[6], new(*big.Int)).(**big.Int) outstruct.Liquidity = *abi.ConvertType(out[7], new(*big.Int)).(**big.Int) outstruct.FeeGrowthInside0LastX128 = *abi.ConvertType(out[8], new(*big.Int)).(**big.Int) outstruct.FeeGrowthInside1LastX128 = *abi.ConvertType(out[9], new(*big.Int)).(**big.Int) outstruct.TokensOwed0 = *abi.ConvertType(out[10], new(*big.Int)).(**big.Int) outstruct.TokensOwed1 = *abi.ConvertType(out[11], new(*big.Int)).(**big.Int) return *outstruct, err } // Positions is a free data retrieval call binding the contract method 0x99fbab88. // // Solidity: function positions(uint256 tokenId) view returns(uint96 nonce, address operator, address token0, address token1, uint24 fee, int24 tickLower, int24 tickUpper, uint128 liquidity, uint256 feeGrowthInside0LastX128, uint256 feeGrowthInside1LastX128, uint128 tokensOwed0, uint128 tokensOwed1) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Positions(tokenId *big.Int) (struct { Nonce *big.Int Operator common.Address Token0 common.Address Token1 common.Address Fee *big.Int TickLower *big.Int TickUpper *big.Int Liquidity *big.Int FeeGrowthInside0LastX128 *big.Int FeeGrowthInside1LastX128 *big.Int TokensOwed0 *big.Int TokensOwed1 *big.Int }, error) { return _NonfungiblePositionManager.Contract.Positions(&_NonfungiblePositionManager.CallOpts, tokenId) } // Positions is a free data retrieval call binding the contract method 0x99fbab88. // // Solidity: function positions(uint256 tokenId) view returns(uint96 nonce, address operator, address token0, address token1, uint24 fee, int24 tickLower, int24 tickUpper, uint128 liquidity, uint256 feeGrowthInside0LastX128, uint256 feeGrowthInside1LastX128, uint128 tokensOwed0, uint128 tokensOwed1) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) Positions(tokenId *big.Int) (struct { Nonce *big.Int Operator common.Address Token0 common.Address Token1 common.Address Fee *big.Int TickLower *big.Int TickUpper *big.Int Liquidity *big.Int FeeGrowthInside0LastX128 *big.Int FeeGrowthInside1LastX128 *big.Int TokensOwed0 *big.Int TokensOwed1 *big.Int }, error) { return _NonfungiblePositionManager.Contract.Positions(&_NonfungiblePositionManager.CallOpts, tokenId) } // SupportsInterface is a free data retrieval call binding the contract method 0x01ffc9a7. // // Solidity: function supportsInterface(bytes4 interfaceId) view returns(bool) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) SupportsInterface(opts *bind.CallOpts, interfaceId [4]byte) (bool, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "supportsInterface", interfaceId) if err != nil { return *new(bool), err } out0 := *abi.ConvertType(out[0], new(bool)).(*bool) return out0, err } // SupportsInterface is a free data retrieval call binding the contract method 0x01ffc9a7. // // Solidity: function supportsInterface(bytes4 interfaceId) view returns(bool) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) SupportsInterface(interfaceId [4]byte) (bool, error) { return _NonfungiblePositionManager.Contract.SupportsInterface(&_NonfungiblePositionManager.CallOpts, interfaceId) } // SupportsInterface is a free data retrieval call binding the contract method 0x01ffc9a7. // // Solidity: function supportsInterface(bytes4 interfaceId) view returns(bool) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) SupportsInterface(interfaceId [4]byte) (bool, error) { return _NonfungiblePositionManager.Contract.SupportsInterface(&_NonfungiblePositionManager.CallOpts, interfaceId) } // Symbol is a free data retrieval call binding the contract method 0x95d89b41. // // Solidity: function symbol() view returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) Symbol(opts *bind.CallOpts) (string, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "symbol") if err != nil { return *new(string), err } out0 := *abi.ConvertType(out[0], new(string)).(*string) return out0, err } // Symbol is a free data retrieval call binding the contract method 0x95d89b41. // // Solidity: function symbol() view returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Symbol() (string, error) { return _NonfungiblePositionManager.Contract.Symbol(&_NonfungiblePositionManager.CallOpts) } // Symbol is a free data retrieval call binding the contract method 0x95d89b41. // // Solidity: function symbol() view returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) Symbol() (string, error) { return _NonfungiblePositionManager.Contract.Symbol(&_NonfungiblePositionManager.CallOpts) } // TokenByIndex is a free data retrieval call binding the contract method 0x4f6ccce7. // // Solidity: function tokenByIndex(uint256 index) view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) TokenByIndex(opts *bind.CallOpts, index *big.Int) (*big.Int, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "tokenByIndex", index) if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // TokenByIndex is a free data retrieval call binding the contract method 0x4f6ccce7. // // Solidity: function tokenByIndex(uint256 index) view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) TokenByIndex(index *big.Int) (*big.Int, error) { return _NonfungiblePositionManager.Contract.TokenByIndex(&_NonfungiblePositionManager.CallOpts, index) } // TokenByIndex is a free data retrieval call binding the contract method 0x4f6ccce7. // // Solidity: function tokenByIndex(uint256 index) view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) TokenByIndex(index *big.Int) (*big.Int, error) { return _NonfungiblePositionManager.Contract.TokenByIndex(&_NonfungiblePositionManager.CallOpts, index) } // TokenOfOwnerByIndex is a free data retrieval call binding the contract method 0x2f745c59. // // Solidity: function tokenOfOwnerByIndex(address owner, uint256 index) view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) TokenOfOwnerByIndex(opts *bind.CallOpts, owner common.Address, index *big.Int) (*big.Int, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "tokenOfOwnerByIndex", owner, index) if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // TokenOfOwnerByIndex is a free data retrieval call binding the contract method 0x2f745c59. // // Solidity: function tokenOfOwnerByIndex(address owner, uint256 index) view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) TokenOfOwnerByIndex(owner common.Address, index *big.Int) (*big.Int, error) { return _NonfungiblePositionManager.Contract.TokenOfOwnerByIndex(&_NonfungiblePositionManager.CallOpts, owner, index) } // TokenOfOwnerByIndex is a free data retrieval call binding the contract method 0x2f745c59. // // Solidity: function tokenOfOwnerByIndex(address owner, uint256 index) view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) TokenOfOwnerByIndex(owner common.Address, index *big.Int) (*big.Int, error) { return _NonfungiblePositionManager.Contract.TokenOfOwnerByIndex(&_NonfungiblePositionManager.CallOpts, owner, index) } // TokenURI is a free data retrieval call binding the contract method 0xc87b56dd. // // Solidity: function tokenURI(uint256 tokenId) view returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) TokenURI(opts *bind.CallOpts, tokenId *big.Int) (string, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "tokenURI", tokenId) if err != nil { return *new(string), err } out0 := *abi.ConvertType(out[0], new(string)).(*string) return out0, err } // TokenURI is a free data retrieval call binding the contract method 0xc87b56dd. // // Solidity: function tokenURI(uint256 tokenId) view returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) TokenURI(tokenId *big.Int) (string, error) { return _NonfungiblePositionManager.Contract.TokenURI(&_NonfungiblePositionManager.CallOpts, tokenId) } // TokenURI is a free data retrieval call binding the contract method 0xc87b56dd. // // Solidity: function tokenURI(uint256 tokenId) view returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) TokenURI(tokenId *big.Int) (string, error) { return _NonfungiblePositionManager.Contract.TokenURI(&_NonfungiblePositionManager.CallOpts, tokenId) } // TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. // // Solidity: function totalSupply() view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) TotalSupply(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "totalSupply") if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. // // Solidity: function totalSupply() view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) TotalSupply() (*big.Int, error) { return _NonfungiblePositionManager.Contract.TotalSupply(&_NonfungiblePositionManager.CallOpts) } // TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. // // Solidity: function totalSupply() view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) TotalSupply() (*big.Int, error) { return _NonfungiblePositionManager.Contract.TotalSupply(&_NonfungiblePositionManager.CallOpts) } // Approve is a paid mutator transaction binding the contract method 0x095ea7b3. // // Solidity: function approve(address to, uint256 tokenId) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) Approve(opts *bind.TransactOpts, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "approve", to, tokenId) } // Approve is a paid mutator transaction binding the contract method 0x095ea7b3. // // Solidity: function approve(address to, uint256 tokenId) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Approve(to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Approve(&_NonfungiblePositionManager.TransactOpts, to, tokenId) } // Approve is a paid mutator transaction binding the contract method 0x095ea7b3. // // Solidity: function approve(address to, uint256 tokenId) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) Approve(to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Approve(&_NonfungiblePositionManager.TransactOpts, to, tokenId) } // Burn is a paid mutator transaction binding the contract method 0x42966c68. // // Solidity: function burn(uint256 tokenId) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) Burn(opts *bind.TransactOpts, tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "burn", tokenId) } // Burn is a paid mutator transaction binding the contract method 0x42966c68. // // Solidity: function burn(uint256 tokenId) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Burn(tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Burn(&_NonfungiblePositionManager.TransactOpts, tokenId) } // Burn is a paid mutator transaction binding the contract method 0x42966c68. // // Solidity: function burn(uint256 tokenId) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) Burn(tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Burn(&_NonfungiblePositionManager.TransactOpts, tokenId) } // Collect is a paid mutator transaction binding the contract method 0xfc6f7865. // // Solidity: function collect((uint256,address,uint128,uint128) params) payable returns(uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) Collect(opts *bind.TransactOpts, params INonfungiblePositionManagerCollectParams) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "collect", params) } // Collect is a paid mutator transaction binding the contract method 0xfc6f7865. // // Solidity: function collect((uint256,address,uint128,uint128) params) payable returns(uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Collect(params INonfungiblePositionManagerCollectParams) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Collect(&_NonfungiblePositionManager.TransactOpts, params) } // Collect is a paid mutator transaction binding the contract method 0xfc6f7865. // // Solidity: function collect((uint256,address,uint128,uint128) params) payable returns(uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) Collect(params INonfungiblePositionManagerCollectParams) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Collect(&_NonfungiblePositionManager.TransactOpts, params) } // CreateAndInitializePoolIfNecessary is a paid mutator transaction binding the contract method 0x13ead562. // // Solidity: function createAndInitializePoolIfNecessary(address token0, address token1, uint24 fee, uint160 sqrtPriceX96) payable returns(address pool) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) CreateAndInitializePoolIfNecessary(opts *bind.TransactOpts, token0 common.Address, token1 common.Address, fee *big.Int, sqrtPriceX96 *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "createAndInitializePoolIfNecessary", token0, token1, fee, sqrtPriceX96) } // CreateAndInitializePoolIfNecessary is a paid mutator transaction binding the contract method 0x13ead562. // // Solidity: function createAndInitializePoolIfNecessary(address token0, address token1, uint24 fee, uint160 sqrtPriceX96) payable returns(address pool) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) CreateAndInitializePoolIfNecessary(token0 common.Address, token1 common.Address, fee *big.Int, sqrtPriceX96 *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.CreateAndInitializePoolIfNecessary(&_NonfungiblePositionManager.TransactOpts, token0, token1, fee, sqrtPriceX96) } // CreateAndInitializePoolIfNecessary is a paid mutator transaction binding the contract method 0x13ead562. // // Solidity: function createAndInitializePoolIfNecessary(address token0, address token1, uint24 fee, uint160 sqrtPriceX96) payable returns(address pool) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) CreateAndInitializePoolIfNecessary(token0 common.Address, token1 common.Address, fee *big.Int, sqrtPriceX96 *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.CreateAndInitializePoolIfNecessary(&_NonfungiblePositionManager.TransactOpts, token0, token1, fee, sqrtPriceX96) } // DecreaseLiquidity is a paid mutator transaction binding the contract method 0x0c49ccbe. // // Solidity: function decreaseLiquidity((uint256,uint128,uint256,uint256,uint256) params) payable returns(uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) DecreaseLiquidity(opts *bind.TransactOpts, params INonfungiblePositionManagerDecreaseLiquidityParams) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "decreaseLiquidity", params) } // DecreaseLiquidity is a paid mutator transaction binding the contract method 0x0c49ccbe. // // Solidity: function decreaseLiquidity((uint256,uint128,uint256,uint256,uint256) params) payable returns(uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) DecreaseLiquidity(params INonfungiblePositionManagerDecreaseLiquidityParams) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.DecreaseLiquidity(&_NonfungiblePositionManager.TransactOpts, params) } // DecreaseLiquidity is a paid mutator transaction binding the contract method 0x0c49ccbe. // // Solidity: function decreaseLiquidity((uint256,uint128,uint256,uint256,uint256) params) payable returns(uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) DecreaseLiquidity(params INonfungiblePositionManagerDecreaseLiquidityParams) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.DecreaseLiquidity(&_NonfungiblePositionManager.TransactOpts, params) } // IncreaseLiquidity is a paid mutator transaction binding the contract method 0x219f5d17. // // Solidity: function increaseLiquidity((uint256,uint256,uint256,uint256,uint256,uint256) params) payable returns(uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) IncreaseLiquidity(opts *bind.TransactOpts, params INonfungiblePositionManagerIncreaseLiquidityParams) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "increaseLiquidity", params) } // IncreaseLiquidity is a paid mutator transaction binding the contract method 0x219f5d17. // // Solidity: function increaseLiquidity((uint256,uint256,uint256,uint256,uint256,uint256) params) payable returns(uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) IncreaseLiquidity(params INonfungiblePositionManagerIncreaseLiquidityParams) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.IncreaseLiquidity(&_NonfungiblePositionManager.TransactOpts, params) } // IncreaseLiquidity is a paid mutator transaction binding the contract method 0x219f5d17. // // Solidity: function increaseLiquidity((uint256,uint256,uint256,uint256,uint256,uint256) params) payable returns(uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) IncreaseLiquidity(params INonfungiblePositionManagerIncreaseLiquidityParams) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.IncreaseLiquidity(&_NonfungiblePositionManager.TransactOpts, params) } // Mint is a paid mutator transaction binding the contract method 0x88316456. // // Solidity: function mint((address,address,uint24,int24,int24,uint256,uint256,uint256,uint256,address,uint256) params) payable returns(uint256 tokenId, uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) Mint(opts *bind.TransactOpts, params INonfungiblePositionManagerMintParams) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "mint", params) } // Mint is a paid mutator transaction binding the contract method 0x88316456. // // Solidity: function mint((address,address,uint24,int24,int24,uint256,uint256,uint256,uint256,address,uint256) params) payable returns(uint256 tokenId, uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Mint(params INonfungiblePositionManagerMintParams) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Mint(&_NonfungiblePositionManager.TransactOpts, params) } // Mint is a paid mutator transaction binding the contract method 0x88316456. // // Solidity: function mint((address,address,uint24,int24,int24,uint256,uint256,uint256,uint256,address,uint256) params) payable returns(uint256 tokenId, uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) Mint(params INonfungiblePositionManagerMintParams) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Mint(&_NonfungiblePositionManager.TransactOpts, params) } // Multicall is a paid mutator transaction binding the contract method 0xac9650d8. // // Solidity: function multicall(bytes[] data) payable returns(bytes[] results) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) Multicall(opts *bind.TransactOpts, data [][]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "multicall", data) } // Multicall is a paid mutator transaction binding the contract method 0xac9650d8. // // Solidity: function multicall(bytes[] data) payable returns(bytes[] results) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Multicall(data [][]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Multicall(&_NonfungiblePositionManager.TransactOpts, data) } // Multicall is a paid mutator transaction binding the contract method 0xac9650d8. // // Solidity: function multicall(bytes[] data) payable returns(bytes[] results) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) Multicall(data [][]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Multicall(&_NonfungiblePositionManager.TransactOpts, data) } // PancakeV3MintCallback is a paid mutator transaction binding the contract method 0x99eee9d0. // // Solidity: function pancakeV3MintCallback(uint256 amount0Owed, uint256 amount1Owed, bytes data) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) PancakeV3MintCallback(opts *bind.TransactOpts, amount0Owed *big.Int, amount1Owed *big.Int, data []byte) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "pancakeV3MintCallback", amount0Owed, amount1Owed, data) } // PancakeV3MintCallback is a paid mutator transaction binding the contract method 0x99eee9d0. // // Solidity: function pancakeV3MintCallback(uint256 amount0Owed, uint256 amount1Owed, bytes data) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) PancakeV3MintCallback(amount0Owed *big.Int, amount1Owed *big.Int, data []byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.PancakeV3MintCallback(&_NonfungiblePositionManager.TransactOpts, amount0Owed, amount1Owed, data) } // PancakeV3MintCallback is a paid mutator transaction binding the contract method 0x99eee9d0. // // Solidity: function pancakeV3MintCallback(uint256 amount0Owed, uint256 amount1Owed, bytes data) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) PancakeV3MintCallback(amount0Owed *big.Int, amount1Owed *big.Int, data []byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.PancakeV3MintCallback(&_NonfungiblePositionManager.TransactOpts, amount0Owed, amount1Owed, data) } // Permit is a paid mutator transaction binding the contract method 0x7ac2ff7b. // // Solidity: function permit(address spender, uint256 tokenId, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) Permit(opts *bind.TransactOpts, spender common.Address, tokenId *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "permit", spender, tokenId, deadline, v, r, s) } // Permit is a paid mutator transaction binding the contract method 0x7ac2ff7b. // // Solidity: function permit(address spender, uint256 tokenId, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Permit(spender common.Address, tokenId *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Permit(&_NonfungiblePositionManager.TransactOpts, spender, tokenId, deadline, v, r, s) } // Permit is a paid mutator transaction binding the contract method 0x7ac2ff7b. // // Solidity: function permit(address spender, uint256 tokenId, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) Permit(spender common.Address, tokenId *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Permit(&_NonfungiblePositionManager.TransactOpts, spender, tokenId, deadline, v, r, s) } // RefundETH is a paid mutator transaction binding the contract method 0x12210e8a. // // Solidity: function refundETH() payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) RefundETH(opts *bind.TransactOpts) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "refundETH") } // RefundETH is a paid mutator transaction binding the contract method 0x12210e8a. // // Solidity: function refundETH() payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) RefundETH() (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.RefundETH(&_NonfungiblePositionManager.TransactOpts) } // RefundETH is a paid mutator transaction binding the contract method 0x12210e8a. // // Solidity: function refundETH() payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) RefundETH() (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.RefundETH(&_NonfungiblePositionManager.TransactOpts) } // SafeTransferFrom is a paid mutator transaction binding the contract method 0x42842e0e. // // Solidity: function safeTransferFrom(address from, address to, uint256 tokenId) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) SafeTransferFrom(opts *bind.TransactOpts, from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "safeTransferFrom", from, to, tokenId) } // SafeTransferFrom is a paid mutator transaction binding the contract method 0x42842e0e. // // Solidity: function safeTransferFrom(address from, address to, uint256 tokenId) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) SafeTransferFrom(from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SafeTransferFrom(&_NonfungiblePositionManager.TransactOpts, from, to, tokenId) } // SafeTransferFrom is a paid mutator transaction binding the contract method 0x42842e0e. // // Solidity: function safeTransferFrom(address from, address to, uint256 tokenId) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) SafeTransferFrom(from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SafeTransferFrom(&_NonfungiblePositionManager.TransactOpts, from, to, tokenId) } // SafeTransferFrom0 is a paid mutator transaction binding the contract method 0xb88d4fde. // // Solidity: function safeTransferFrom(address from, address to, uint256 tokenId, bytes _data) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) SafeTransferFrom0(opts *bind.TransactOpts, from common.Address, to common.Address, tokenId *big.Int, _data []byte) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "safeTransferFrom0", from, to, tokenId, _data) } // SafeTransferFrom0 is a paid mutator transaction binding the contract method 0xb88d4fde. // // Solidity: function safeTransferFrom(address from, address to, uint256 tokenId, bytes _data) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) SafeTransferFrom0(from common.Address, to common.Address, tokenId *big.Int, _data []byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SafeTransferFrom0(&_NonfungiblePositionManager.TransactOpts, from, to, tokenId, _data) } // SafeTransferFrom0 is a paid mutator transaction binding the contract method 0xb88d4fde. // // Solidity: function safeTransferFrom(address from, address to, uint256 tokenId, bytes _data) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) SafeTransferFrom0(from common.Address, to common.Address, tokenId *big.Int, _data []byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SafeTransferFrom0(&_NonfungiblePositionManager.TransactOpts, from, to, tokenId, _data) } // SelfPermit is a paid mutator transaction binding the contract method 0xf3995c67. // // Solidity: function selfPermit(address token, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) SelfPermit(opts *bind.TransactOpts, token common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "selfPermit", token, value, deadline, v, r, s) } // SelfPermit is a paid mutator transaction binding the contract method 0xf3995c67. // // Solidity: function selfPermit(address token, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) SelfPermit(token common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SelfPermit(&_NonfungiblePositionManager.TransactOpts, token, value, deadline, v, r, s) } // SelfPermit is a paid mutator transaction binding the contract method 0xf3995c67. // // Solidity: function selfPermit(address token, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) SelfPermit(token common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SelfPermit(&_NonfungiblePositionManager.TransactOpts, token, value, deadline, v, r, s) } // SelfPermitAllowed is a paid mutator transaction binding the contract method 0x4659a494. // // Solidity: function selfPermitAllowed(address token, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) SelfPermitAllowed(opts *bind.TransactOpts, token common.Address, nonce *big.Int, expiry *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "selfPermitAllowed", token, nonce, expiry, v, r, s) } // SelfPermitAllowed is a paid mutator transaction binding the contract method 0x4659a494. // // Solidity: function selfPermitAllowed(address token, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) SelfPermitAllowed(token common.Address, nonce *big.Int, expiry *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SelfPermitAllowed(&_NonfungiblePositionManager.TransactOpts, token, nonce, expiry, v, r, s) } // SelfPermitAllowed is a paid mutator transaction binding the contract method 0x4659a494. // // Solidity: function selfPermitAllowed(address token, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) SelfPermitAllowed(token common.Address, nonce *big.Int, expiry *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SelfPermitAllowed(&_NonfungiblePositionManager.TransactOpts, token, nonce, expiry, v, r, s) } // SelfPermitAllowedIfNecessary is a paid mutator transaction binding the contract method 0xa4a78f0c. // // Solidity: function selfPermitAllowedIfNecessary(address token, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) SelfPermitAllowedIfNecessary(opts *bind.TransactOpts, token common.Address, nonce *big.Int, expiry *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "selfPermitAllowedIfNecessary", token, nonce, expiry, v, r, s) } // SelfPermitAllowedIfNecessary is a paid mutator transaction binding the contract method 0xa4a78f0c. // // Solidity: function selfPermitAllowedIfNecessary(address token, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) SelfPermitAllowedIfNecessary(token common.Address, nonce *big.Int, expiry *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SelfPermitAllowedIfNecessary(&_NonfungiblePositionManager.TransactOpts, token, nonce, expiry, v, r, s) } // SelfPermitAllowedIfNecessary is a paid mutator transaction binding the contract method 0xa4a78f0c. // // Solidity: function selfPermitAllowedIfNecessary(address token, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) SelfPermitAllowedIfNecessary(token common.Address, nonce *big.Int, expiry *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SelfPermitAllowedIfNecessary(&_NonfungiblePositionManager.TransactOpts, token, nonce, expiry, v, r, s) } // SelfPermitIfNecessary is a paid mutator transaction binding the contract method 0xc2e3140a. // // Solidity: function selfPermitIfNecessary(address token, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) SelfPermitIfNecessary(opts *bind.TransactOpts, token common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "selfPermitIfNecessary", token, value, deadline, v, r, s) } // SelfPermitIfNecessary is a paid mutator transaction binding the contract method 0xc2e3140a. // // Solidity: function selfPermitIfNecessary(address token, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) SelfPermitIfNecessary(token common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SelfPermitIfNecessary(&_NonfungiblePositionManager.TransactOpts, token, value, deadline, v, r, s) } // SelfPermitIfNecessary is a paid mutator transaction binding the contract method 0xc2e3140a. // // Solidity: function selfPermitIfNecessary(address token, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) SelfPermitIfNecessary(token common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SelfPermitIfNecessary(&_NonfungiblePositionManager.TransactOpts, token, value, deadline, v, r, s) } // SetApprovalForAll is a paid mutator transaction binding the contract method 0xa22cb465. // // Solidity: function setApprovalForAll(address operator, bool approved) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) SetApprovalForAll(opts *bind.TransactOpts, operator common.Address, approved bool) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "setApprovalForAll", operator, approved) } // SetApprovalForAll is a paid mutator transaction binding the contract method 0xa22cb465. // // Solidity: function setApprovalForAll(address operator, bool approved) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) SetApprovalForAll(operator common.Address, approved bool) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SetApprovalForAll(&_NonfungiblePositionManager.TransactOpts, operator, approved) } // SetApprovalForAll is a paid mutator transaction binding the contract method 0xa22cb465. // // Solidity: function setApprovalForAll(address operator, bool approved) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) SetApprovalForAll(operator common.Address, approved bool) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SetApprovalForAll(&_NonfungiblePositionManager.TransactOpts, operator, approved) } // SweepToken is a paid mutator transaction binding the contract method 0xdf2ab5bb. // // Solidity: function sweepToken(address token, uint256 amountMinimum, address recipient) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) SweepToken(opts *bind.TransactOpts, token common.Address, amountMinimum *big.Int, recipient common.Address) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "sweepToken", token, amountMinimum, recipient) } // SweepToken is a paid mutator transaction binding the contract method 0xdf2ab5bb. // // Solidity: function sweepToken(address token, uint256 amountMinimum, address recipient) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) SweepToken(token common.Address, amountMinimum *big.Int, recipient common.Address) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SweepToken(&_NonfungiblePositionManager.TransactOpts, token, amountMinimum, recipient) } // SweepToken is a paid mutator transaction binding the contract method 0xdf2ab5bb. // // Solidity: function sweepToken(address token, uint256 amountMinimum, address recipient) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) SweepToken(token common.Address, amountMinimum *big.Int, recipient common.Address) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SweepToken(&_NonfungiblePositionManager.TransactOpts, token, amountMinimum, recipient) } // TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. // // Solidity: function transferFrom(address from, address to, uint256 tokenId) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) TransferFrom(opts *bind.TransactOpts, from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "transferFrom", from, to, tokenId) } // TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. // // Solidity: function transferFrom(address from, address to, uint256 tokenId) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) TransferFrom(from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.TransferFrom(&_NonfungiblePositionManager.TransactOpts, from, to, tokenId) } // TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. // // Solidity: function transferFrom(address from, address to, uint256 tokenId) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) TransferFrom(from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.TransferFrom(&_NonfungiblePositionManager.TransactOpts, from, to, tokenId) } // UnwrapWETH9 is a paid mutator transaction binding the contract method 0x49404b7c. // // Solidity: function unwrapWETH9(uint256 amountMinimum, address recipient) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) UnwrapWETH9(opts *bind.TransactOpts, amountMinimum *big.Int, recipient common.Address) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "unwrapWETH9", amountMinimum, recipient) } // UnwrapWETH9 is a paid mutator transaction binding the contract method 0x49404b7c. // // Solidity: function unwrapWETH9(uint256 amountMinimum, address recipient) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) UnwrapWETH9(amountMinimum *big.Int, recipient common.Address) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.UnwrapWETH9(&_NonfungiblePositionManager.TransactOpts, amountMinimum, recipient) } // UnwrapWETH9 is a paid mutator transaction binding the contract method 0x49404b7c. // // Solidity: function unwrapWETH9(uint256 amountMinimum, address recipient) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) UnwrapWETH9(amountMinimum *big.Int, recipient common.Address) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.UnwrapWETH9(&_NonfungiblePositionManager.TransactOpts, amountMinimum, recipient) } // Receive is a paid mutator transaction binding the contract receive function. // // Solidity: receive() payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) Receive(opts *bind.TransactOpts) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.RawTransact(opts, nil) // calldata is disallowed for receive function } // Receive is a paid mutator transaction binding the contract receive function. // // Solidity: receive() payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Receive() (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Receive(&_NonfungiblePositionManager.TransactOpts) } // Receive is a paid mutator transaction binding the contract receive function. // // Solidity: receive() payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) Receive() (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Receive(&_NonfungiblePositionManager.TransactOpts) } // NonfungiblePositionManagerApprovalIterator is returned from FilterApproval and is used to iterate over the raw logs and unpacked data for Approval events raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerApprovalIterator struct { Event *NonfungiblePositionManagerApproval // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *NonfungiblePositionManagerApprovalIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerApproval) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerApproval) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *NonfungiblePositionManagerApprovalIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *NonfungiblePositionManagerApprovalIterator) Close() error { it.sub.Unsubscribe() return nil } // NonfungiblePositionManagerApproval represents a Approval event raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerApproval struct { Owner common.Address Approved common.Address TokenId *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterApproval is a free log retrieval operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. // // Solidity: event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) FilterApproval(opts *bind.FilterOpts, owner []common.Address, approved []common.Address, tokenId []*big.Int) (*NonfungiblePositionManagerApprovalIterator, error) { var ownerRule []interface{} for _, ownerItem := range owner { ownerRule = append(ownerRule, ownerItem) } var approvedRule []interface{} for _, approvedItem := range approved { approvedRule = append(approvedRule, approvedItem) } var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _NonfungiblePositionManager.contract.FilterLogs(opts, "Approval", ownerRule, approvedRule, tokenIdRule) if err != nil { return nil, err } return &NonfungiblePositionManagerApprovalIterator{contract: _NonfungiblePositionManager.contract, event: "Approval", logs: logs, sub: sub}, nil } // WatchApproval is a free log subscription operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. // // Solidity: event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) WatchApproval(opts *bind.WatchOpts, sink chan<- *NonfungiblePositionManagerApproval, owner []common.Address, approved []common.Address, tokenId []*big.Int) (event.Subscription, error) { var ownerRule []interface{} for _, ownerItem := range owner { ownerRule = append(ownerRule, ownerItem) } var approvedRule []interface{} for _, approvedItem := range approved { approvedRule = append(approvedRule, approvedItem) } var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _NonfungiblePositionManager.contract.WatchLogs(opts, "Approval", ownerRule, approvedRule, tokenIdRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(NonfungiblePositionManagerApproval) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "Approval", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseApproval is a log parse operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. // // Solidity: event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) ParseApproval(log types.Log) (*NonfungiblePositionManagerApproval, error) { event := new(NonfungiblePositionManagerApproval) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "Approval", log); err != nil { return nil, err } event.Raw = log return event, nil } // NonfungiblePositionManagerApprovalForAllIterator is returned from FilterApprovalForAll and is used to iterate over the raw logs and unpacked data for ApprovalForAll events raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerApprovalForAllIterator struct { Event *NonfungiblePositionManagerApprovalForAll // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *NonfungiblePositionManagerApprovalForAllIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerApprovalForAll) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerApprovalForAll) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *NonfungiblePositionManagerApprovalForAllIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *NonfungiblePositionManagerApprovalForAllIterator) Close() error { it.sub.Unsubscribe() return nil } // NonfungiblePositionManagerApprovalForAll represents a ApprovalForAll event raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerApprovalForAll struct { Owner common.Address Operator common.Address Approved bool Raw types.Log // Blockchain specific contextual infos } // FilterApprovalForAll is a free log retrieval operation binding the contract event 0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31. // // Solidity: event ApprovalForAll(address indexed owner, address indexed operator, bool approved) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) FilterApprovalForAll(opts *bind.FilterOpts, owner []common.Address, operator []common.Address) (*NonfungiblePositionManagerApprovalForAllIterator, error) { var ownerRule []interface{} for _, ownerItem := range owner { ownerRule = append(ownerRule, ownerItem) } var operatorRule []interface{} for _, operatorItem := range operator { operatorRule = append(operatorRule, operatorItem) } logs, sub, err := _NonfungiblePositionManager.contract.FilterLogs(opts, "ApprovalForAll", ownerRule, operatorRule) if err != nil { return nil, err } return &NonfungiblePositionManagerApprovalForAllIterator{contract: _NonfungiblePositionManager.contract, event: "ApprovalForAll", logs: logs, sub: sub}, nil } // WatchApprovalForAll is a free log subscription operation binding the contract event 0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31. // // Solidity: event ApprovalForAll(address indexed owner, address indexed operator, bool approved) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) WatchApprovalForAll(opts *bind.WatchOpts, sink chan<- *NonfungiblePositionManagerApprovalForAll, owner []common.Address, operator []common.Address) (event.Subscription, error) { var ownerRule []interface{} for _, ownerItem := range owner { ownerRule = append(ownerRule, ownerItem) } var operatorRule []interface{} for _, operatorItem := range operator { operatorRule = append(operatorRule, operatorItem) } logs, sub, err := _NonfungiblePositionManager.contract.WatchLogs(opts, "ApprovalForAll", ownerRule, operatorRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(NonfungiblePositionManagerApprovalForAll) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "ApprovalForAll", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseApprovalForAll is a log parse operation binding the contract event 0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31. // // Solidity: event ApprovalForAll(address indexed owner, address indexed operator, bool approved) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) ParseApprovalForAll(log types.Log) (*NonfungiblePositionManagerApprovalForAll, error) { event := new(NonfungiblePositionManagerApprovalForAll) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "ApprovalForAll", log); err != nil { return nil, err } event.Raw = log return event, nil } // NonfungiblePositionManagerCollectIterator is returned from FilterCollect and is used to iterate over the raw logs and unpacked data for Collect events raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerCollectIterator struct { Event *NonfungiblePositionManagerCollect // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *NonfungiblePositionManagerCollectIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerCollect) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerCollect) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *NonfungiblePositionManagerCollectIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *NonfungiblePositionManagerCollectIterator) Close() error { it.sub.Unsubscribe() return nil } // NonfungiblePositionManagerCollect represents a Collect event raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerCollect struct { TokenId *big.Int Recipient common.Address Amount0 *big.Int Amount1 *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterCollect is a free log retrieval operation binding the contract event 0x40d0efd1a53d60ecbf40971b9daf7dc90178c3aadc7aab1765632738fa8b8f01. // // Solidity: event Collect(uint256 indexed tokenId, address recipient, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) FilterCollect(opts *bind.FilterOpts, tokenId []*big.Int) (*NonfungiblePositionManagerCollectIterator, error) { var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _NonfungiblePositionManager.contract.FilterLogs(opts, "Collect", tokenIdRule) if err != nil { return nil, err } return &NonfungiblePositionManagerCollectIterator{contract: _NonfungiblePositionManager.contract, event: "Collect", logs: logs, sub: sub}, nil } // WatchCollect is a free log subscription operation binding the contract event 0x40d0efd1a53d60ecbf40971b9daf7dc90178c3aadc7aab1765632738fa8b8f01. // // Solidity: event Collect(uint256 indexed tokenId, address recipient, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) WatchCollect(opts *bind.WatchOpts, sink chan<- *NonfungiblePositionManagerCollect, tokenId []*big.Int) (event.Subscription, error) { var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _NonfungiblePositionManager.contract.WatchLogs(opts, "Collect", tokenIdRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(NonfungiblePositionManagerCollect) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "Collect", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseCollect is a log parse operation binding the contract event 0x40d0efd1a53d60ecbf40971b9daf7dc90178c3aadc7aab1765632738fa8b8f01. // // Solidity: event Collect(uint256 indexed tokenId, address recipient, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) ParseCollect(log types.Log) (*NonfungiblePositionManagerCollect, error) { event := new(NonfungiblePositionManagerCollect) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "Collect", log); err != nil { return nil, err } event.Raw = log return event, nil } // NonfungiblePositionManagerDecreaseLiquidityIterator is returned from FilterDecreaseLiquidity and is used to iterate over the raw logs and unpacked data for DecreaseLiquidity events raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerDecreaseLiquidityIterator struct { Event *NonfungiblePositionManagerDecreaseLiquidity // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *NonfungiblePositionManagerDecreaseLiquidityIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerDecreaseLiquidity) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerDecreaseLiquidity) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *NonfungiblePositionManagerDecreaseLiquidityIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *NonfungiblePositionManagerDecreaseLiquidityIterator) Close() error { it.sub.Unsubscribe() return nil } // NonfungiblePositionManagerDecreaseLiquidity represents a DecreaseLiquidity event raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerDecreaseLiquidity struct { TokenId *big.Int Liquidity *big.Int Amount0 *big.Int Amount1 *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterDecreaseLiquidity is a free log retrieval operation binding the contract event 0x26f6a048ee9138f2c0ce266f322cb99228e8d619ae2bff30c67f8dcf9d2377b4. // // Solidity: event DecreaseLiquidity(uint256 indexed tokenId, uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) FilterDecreaseLiquidity(opts *bind.FilterOpts, tokenId []*big.Int) (*NonfungiblePositionManagerDecreaseLiquidityIterator, error) { var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _NonfungiblePositionManager.contract.FilterLogs(opts, "DecreaseLiquidity", tokenIdRule) if err != nil { return nil, err } return &NonfungiblePositionManagerDecreaseLiquidityIterator{contract: _NonfungiblePositionManager.contract, event: "DecreaseLiquidity", logs: logs, sub: sub}, nil } // WatchDecreaseLiquidity is a free log subscription operation binding the contract event 0x26f6a048ee9138f2c0ce266f322cb99228e8d619ae2bff30c67f8dcf9d2377b4. // // Solidity: event DecreaseLiquidity(uint256 indexed tokenId, uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) WatchDecreaseLiquidity(opts *bind.WatchOpts, sink chan<- *NonfungiblePositionManagerDecreaseLiquidity, tokenId []*big.Int) (event.Subscription, error) { var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _NonfungiblePositionManager.contract.WatchLogs(opts, "DecreaseLiquidity", tokenIdRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(NonfungiblePositionManagerDecreaseLiquidity) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "DecreaseLiquidity", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseDecreaseLiquidity is a log parse operation binding the contract event 0x26f6a048ee9138f2c0ce266f322cb99228e8d619ae2bff30c67f8dcf9d2377b4. // // Solidity: event DecreaseLiquidity(uint256 indexed tokenId, uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) ParseDecreaseLiquidity(log types.Log) (*NonfungiblePositionManagerDecreaseLiquidity, error) { event := new(NonfungiblePositionManagerDecreaseLiquidity) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "DecreaseLiquidity", log); err != nil { return nil, err } event.Raw = log return event, nil } // NonfungiblePositionManagerIncreaseLiquidityIterator is returned from FilterIncreaseLiquidity and is used to iterate over the raw logs and unpacked data for IncreaseLiquidity events raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerIncreaseLiquidityIterator struct { Event *NonfungiblePositionManagerIncreaseLiquidity // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *NonfungiblePositionManagerIncreaseLiquidityIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerIncreaseLiquidity) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerIncreaseLiquidity) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *NonfungiblePositionManagerIncreaseLiquidityIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *NonfungiblePositionManagerIncreaseLiquidityIterator) Close() error { it.sub.Unsubscribe() return nil } // NonfungiblePositionManagerIncreaseLiquidity represents a IncreaseLiquidity event raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerIncreaseLiquidity struct { TokenId *big.Int Liquidity *big.Int Amount0 *big.Int Amount1 *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterIncreaseLiquidity is a free log retrieval operation binding the contract event 0x3067048beee31b25b2f1681f88dac838c8bba36af25bfb2b7cf7473a5847e35f. // // Solidity: event IncreaseLiquidity(uint256 indexed tokenId, uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) FilterIncreaseLiquidity(opts *bind.FilterOpts, tokenId []*big.Int) (*NonfungiblePositionManagerIncreaseLiquidityIterator, error) { var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _NonfungiblePositionManager.contract.FilterLogs(opts, "IncreaseLiquidity", tokenIdRule) if err != nil { return nil, err } return &NonfungiblePositionManagerIncreaseLiquidityIterator{contract: _NonfungiblePositionManager.contract, event: "IncreaseLiquidity", logs: logs, sub: sub}, nil } // WatchIncreaseLiquidity is a free log subscription operation binding the contract event 0x3067048beee31b25b2f1681f88dac838c8bba36af25bfb2b7cf7473a5847e35f. // // Solidity: event IncreaseLiquidity(uint256 indexed tokenId, uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) WatchIncreaseLiquidity(opts *bind.WatchOpts, sink chan<- *NonfungiblePositionManagerIncreaseLiquidity, tokenId []*big.Int) (event.Subscription, error) { var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _NonfungiblePositionManager.contract.WatchLogs(opts, "IncreaseLiquidity", tokenIdRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(NonfungiblePositionManagerIncreaseLiquidity) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "IncreaseLiquidity", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseIncreaseLiquidity is a log parse operation binding the contract event 0x3067048beee31b25b2f1681f88dac838c8bba36af25bfb2b7cf7473a5847e35f. // // Solidity: event IncreaseLiquidity(uint256 indexed tokenId, uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) ParseIncreaseLiquidity(log types.Log) (*NonfungiblePositionManagerIncreaseLiquidity, error) { event := new(NonfungiblePositionManagerIncreaseLiquidity) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "IncreaseLiquidity", log); err != nil { return nil, err } event.Raw = log return event, nil } // NonfungiblePositionManagerTransferIterator is returned from FilterTransfer and is used to iterate over the raw logs and unpacked data for Transfer events raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerTransferIterator struct { Event *NonfungiblePositionManagerTransfer // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *NonfungiblePositionManagerTransferIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerTransfer) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerTransfer) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *NonfungiblePositionManagerTransferIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *NonfungiblePositionManagerTransferIterator) Close() error { it.sub.Unsubscribe() return nil } // NonfungiblePositionManagerTransfer represents a Transfer event raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerTransfer struct { From common.Address To common.Address TokenId *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterTransfer is a free log retrieval operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. // // Solidity: event Transfer(address indexed from, address indexed to, uint256 indexed tokenId) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) FilterTransfer(opts *bind.FilterOpts, from []common.Address, to []common.Address, tokenId []*big.Int) (*NonfungiblePositionManagerTransferIterator, error) { var fromRule []interface{} for _, fromItem := range from { fromRule = append(fromRule, fromItem) } var toRule []interface{} for _, toItem := range to { toRule = append(toRule, toItem) } var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _NonfungiblePositionManager.contract.FilterLogs(opts, "Transfer", fromRule, toRule, tokenIdRule) if err != nil { return nil, err } return &NonfungiblePositionManagerTransferIterator{contract: _NonfungiblePositionManager.contract, event: "Transfer", logs: logs, sub: sub}, nil } // WatchTransfer is a free log subscription operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. // // Solidity: event Transfer(address indexed from, address indexed to, uint256 indexed tokenId) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) WatchTransfer(opts *bind.WatchOpts, sink chan<- *NonfungiblePositionManagerTransfer, from []common.Address, to []common.Address, tokenId []*big.Int) (event.Subscription, error) { var fromRule []interface{} for _, fromItem := range from { fromRule = append(fromRule, fromItem) } var toRule []interface{} for _, toItem := range to { toRule = append(toRule, toItem) } var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _NonfungiblePositionManager.contract.WatchLogs(opts, "Transfer", fromRule, toRule, tokenIdRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(NonfungiblePositionManagerTransfer) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "Transfer", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseTransfer is a log parse operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. // // Solidity: event Transfer(address indexed from, address indexed to, uint256 indexed tokenId) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) ParseTransfer(log types.Log) (*NonfungiblePositionManagerTransfer, error) { event := new(NonfungiblePositionManagerTransfer) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "Transfer", log); err != nil { return nil, err } event.Raw = log return event, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/binds/bscnonfungiblepositionmanager/abi.json ================================================ [ { "inputs": [ { "internalType": "address", "name": "_deployer", "type": "address" }, { "internalType": "address", "name": "_factory", "type": "address" }, { "internalType": "address", "name": "_WETH9", "type": "address" }, { "internalType": "address", "name": "_tokenDescriptor_", "type": "address" } ], "stateMutability": "nonpayable", "type": "constructor" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "owner", "type": "address" }, { "indexed": true, "internalType": "address", "name": "approved", "type": "address" }, { "indexed": true, "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "Approval", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "owner", "type": "address" }, { "indexed": true, "internalType": "address", "name": "operator", "type": "address" }, { "indexed": false, "internalType": "bool", "name": "approved", "type": "bool" } ], "name": "ApprovalForAll", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "indexed": false, "internalType": "address", "name": "recipient", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "amount0", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "amount1", "type": "uint256" } ], "name": "Collect", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "indexed": false, "internalType": "uint128", "name": "liquidity", "type": "uint128" }, { "indexed": false, "internalType": "uint256", "name": "amount0", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "amount1", "type": "uint256" } ], "name": "DecreaseLiquidity", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "indexed": false, "internalType": "uint128", "name": "liquidity", "type": "uint128" }, { "indexed": false, "internalType": "uint256", "name": "amount0", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "amount1", "type": "uint256" } ], "name": "IncreaseLiquidity", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "from", "type": "address" }, { "indexed": true, "internalType": "address", "name": "to", "type": "address" }, { "indexed": true, "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "Transfer", "type": "event" }, { "inputs": [], "name": "DOMAIN_SEPARATOR", "outputs": [ { "internalType": "bytes32", "name": "", "type": "bytes32" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "PERMIT_TYPEHASH", "outputs": [ { "internalType": "bytes32", "name": "", "type": "bytes32" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "WETH9", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "to", "type": "address" }, { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "approve", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "owner", "type": "address" } ], "name": "balanceOf", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "baseURI", "outputs": [ { "internalType": "string", "name": "", "type": "string" } ], "stateMutability": "pure", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "burn", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "components": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "internalType": "address", "name": "recipient", "type": "address" }, { "internalType": "uint128", "name": "amount0Max", "type": "uint128" }, { "internalType": "uint128", "name": "amount1Max", "type": "uint128" } ], "internalType": "struct INonfungiblePositionManager.CollectParams", "name": "params", "type": "tuple" } ], "name": "collect", "outputs": [ { "internalType": "uint256", "name": "amount0", "type": "uint256" }, { "internalType": "uint256", "name": "amount1", "type": "uint256" } ], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "token0", "type": "address" }, { "internalType": "address", "name": "token1", "type": "address" }, { "internalType": "uint24", "name": "fee", "type": "uint24" }, { "internalType": "uint160", "name": "sqrtPriceX96", "type": "uint160" } ], "name": "createAndInitializePoolIfNecessary", "outputs": [ { "internalType": "address", "name": "pool", "type": "address" } ], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "components": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "internalType": "uint128", "name": "liquidity", "type": "uint128" }, { "internalType": "uint256", "name": "amount0Min", "type": "uint256" }, { "internalType": "uint256", "name": "amount1Min", "type": "uint256" }, { "internalType": "uint256", "name": "deadline", "type": "uint256" } ], "internalType": "struct INonfungiblePositionManager.DecreaseLiquidityParams", "name": "params", "type": "tuple" } ], "name": "decreaseLiquidity", "outputs": [ { "internalType": "uint256", "name": "amount0", "type": "uint256" }, { "internalType": "uint256", "name": "amount1", "type": "uint256" } ], "stateMutability": "payable", "type": "function" }, { "inputs": [], "name": "deployer", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "factory", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "getApproved", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "components": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "internalType": "uint256", "name": "amount0Desired", "type": "uint256" }, { "internalType": "uint256", "name": "amount1Desired", "type": "uint256" }, { "internalType": "uint256", "name": "amount0Min", "type": "uint256" }, { "internalType": "uint256", "name": "amount1Min", "type": "uint256" }, { "internalType": "uint256", "name": "deadline", "type": "uint256" } ], "internalType": "struct INonfungiblePositionManager.IncreaseLiquidityParams", "name": "params", "type": "tuple" } ], "name": "increaseLiquidity", "outputs": [ { "internalType": "uint128", "name": "liquidity", "type": "uint128" }, { "internalType": "uint256", "name": "amount0", "type": "uint256" }, { "internalType": "uint256", "name": "amount1", "type": "uint256" } ], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "owner", "type": "address" }, { "internalType": "address", "name": "operator", "type": "address" } ], "name": "isApprovedForAll", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "components": [ { "internalType": "address", "name": "token0", "type": "address" }, { "internalType": "address", "name": "token1", "type": "address" }, { "internalType": "uint24", "name": "fee", "type": "uint24" }, { "internalType": "int24", "name": "tickLower", "type": "int24" }, { "internalType": "int24", "name": "tickUpper", "type": "int24" }, { "internalType": "uint256", "name": "amount0Desired", "type": "uint256" }, { "internalType": "uint256", "name": "amount1Desired", "type": "uint256" }, { "internalType": "uint256", "name": "amount0Min", "type": "uint256" }, { "internalType": "uint256", "name": "amount1Min", "type": "uint256" }, { "internalType": "address", "name": "recipient", "type": "address" }, { "internalType": "uint256", "name": "deadline", "type": "uint256" } ], "internalType": "struct INonfungiblePositionManager.MintParams", "name": "params", "type": "tuple" } ], "name": "mint", "outputs": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "internalType": "uint128", "name": "liquidity", "type": "uint128" }, { "internalType": "uint256", "name": "amount0", "type": "uint256" }, { "internalType": "uint256", "name": "amount1", "type": "uint256" } ], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "bytes[]", "name": "data", "type": "bytes[]" } ], "name": "multicall", "outputs": [ { "internalType": "bytes[]", "name": "results", "type": "bytes[]" } ], "stateMutability": "payable", "type": "function" }, { "inputs": [], "name": "name", "outputs": [ { "internalType": "string", "name": "", "type": "string" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "ownerOf", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "amount0Owed", "type": "uint256" }, { "internalType": "uint256", "name": "amount1Owed", "type": "uint256" }, { "internalType": "bytes", "name": "data", "type": "bytes" } ], "name": "pancakeV3MintCallback", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "spender", "type": "address" }, { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "internalType": "uint256", "name": "deadline", "type": "uint256" }, { "internalType": "uint8", "name": "v", "type": "uint8" }, { "internalType": "bytes32", "name": "r", "type": "bytes32" }, { "internalType": "bytes32", "name": "s", "type": "bytes32" } ], "name": "permit", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "positions", "outputs": [ { "internalType": "uint96", "name": "nonce", "type": "uint96" }, { "internalType": "address", "name": "operator", "type": "address" }, { "internalType": "address", "name": "token0", "type": "address" }, { "internalType": "address", "name": "token1", "type": "address" }, { "internalType": "uint24", "name": "fee", "type": "uint24" }, { "internalType": "int24", "name": "tickLower", "type": "int24" }, { "internalType": "int24", "name": "tickUpper", "type": "int24" }, { "internalType": "uint128", "name": "liquidity", "type": "uint128" }, { "internalType": "uint256", "name": "feeGrowthInside0LastX128", "type": "uint256" }, { "internalType": "uint256", "name": "feeGrowthInside1LastX128", "type": "uint256" }, { "internalType": "uint128", "name": "tokensOwed0", "type": "uint128" }, { "internalType": "uint128", "name": "tokensOwed1", "type": "uint128" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "refundETH", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "from", "type": "address" }, { "internalType": "address", "name": "to", "type": "address" }, { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "safeTransferFrom", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "from", "type": "address" }, { "internalType": "address", "name": "to", "type": "address" }, { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "internalType": "bytes", "name": "_data", "type": "bytes" } ], "name": "safeTransferFrom", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "token", "type": "address" }, { "internalType": "uint256", "name": "value", "type": "uint256" }, { "internalType": "uint256", "name": "deadline", "type": "uint256" }, { "internalType": "uint8", "name": "v", "type": "uint8" }, { "internalType": "bytes32", "name": "r", "type": "bytes32" }, { "internalType": "bytes32", "name": "s", "type": "bytes32" } ], "name": "selfPermit", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "token", "type": "address" }, { "internalType": "uint256", "name": "nonce", "type": "uint256" }, { "internalType": "uint256", "name": "expiry", "type": "uint256" }, { "internalType": "uint8", "name": "v", "type": "uint8" }, { "internalType": "bytes32", "name": "r", "type": "bytes32" }, { "internalType": "bytes32", "name": "s", "type": "bytes32" } ], "name": "selfPermitAllowed", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "token", "type": "address" }, { "internalType": "uint256", "name": "nonce", "type": "uint256" }, { "internalType": "uint256", "name": "expiry", "type": "uint256" }, { "internalType": "uint8", "name": "v", "type": "uint8" }, { "internalType": "bytes32", "name": "r", "type": "bytes32" }, { "internalType": "bytes32", "name": "s", "type": "bytes32" } ], "name": "selfPermitAllowedIfNecessary", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "token", "type": "address" }, { "internalType": "uint256", "name": "value", "type": "uint256" }, { "internalType": "uint256", "name": "deadline", "type": "uint256" }, { "internalType": "uint8", "name": "v", "type": "uint8" }, { "internalType": "bytes32", "name": "r", "type": "bytes32" }, { "internalType": "bytes32", "name": "s", "type": "bytes32" } ], "name": "selfPermitIfNecessary", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "operator", "type": "address" }, { "internalType": "bool", "name": "approved", "type": "bool" } ], "name": "setApprovalForAll", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "bytes4", "name": "interfaceId", "type": "bytes4" } ], "name": "supportsInterface", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "token", "type": "address" }, { "internalType": "uint256", "name": "amountMinimum", "type": "uint256" }, { "internalType": "address", "name": "recipient", "type": "address" } ], "name": "sweepToken", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [], "name": "symbol", "outputs": [ { "internalType": "string", "name": "", "type": "string" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "index", "type": "uint256" } ], "name": "tokenByIndex", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "owner", "type": "address" }, { "internalType": "uint256", "name": "index", "type": "uint256" } ], "name": "tokenOfOwnerByIndex", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "tokenURI", "outputs": [ { "internalType": "string", "name": "", "type": "string" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "totalSupply", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "from", "type": "address" }, { "internalType": "address", "name": "to", "type": "address" }, { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "transferFrom", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "amountMinimum", "type": "uint256" }, { "internalType": "address", "name": "recipient", "type": "address" } ], "name": "unwrapWETH9", "outputs": [], "stateMutability": "payable", "type": "function" }, { "stateMutability": "payable", "type": "receive" } ] ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/binds/bscpool/Pool.go ================================================ // Code generated - DO NOT EDIT. // This file is a generated binding and any manual changes will be lost. package bscpool import ( "errors" "math/big" "strings" ethereum "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/event" ) // Reference imports to suppress errors if they are not otherwise used. var ( _ = errors.New _ = big.NewInt _ = strings.NewReader _ = ethereum.NotFound _ = bind.Bind _ = common.Big1 _ = types.BloomLookup _ = event.NewSubscription _ = abi.ConvertType ) // PoolMetaData contains all meta data concerning the Pool contract. var PoolMetaData = &bind.MetaData{ ABI: "[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"int24\",\"name\":\"tickLower\",\"type\":\"int24\"},{\"indexed\":true,\"internalType\":\"int24\",\"name\":\"tickUpper\",\"type\":\"int24\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"amount\",\"type\":\"uint128\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"}],\"name\":\"Burn\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"int24\",\"name\":\"tickLower\",\"type\":\"int24\"},{\"indexed\":true,\"internalType\":\"int24\",\"name\":\"tickUpper\",\"type\":\"int24\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"amount0\",\"type\":\"uint128\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"amount1\",\"type\":\"uint128\"}],\"name\":\"Collect\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"amount0\",\"type\":\"uint128\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"amount1\",\"type\":\"uint128\"}],\"name\":\"CollectProtocol\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"paid0\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"paid1\",\"type\":\"uint256\"}],\"name\":\"Flash\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"observationCardinalityNextOld\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"observationCardinalityNextNew\",\"type\":\"uint16\"}],\"name\":\"IncreaseObservationCardinalityNext\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint160\",\"name\":\"sqrtPriceX96\",\"type\":\"uint160\"},{\"indexed\":false,\"internalType\":\"int24\",\"name\":\"tick\",\"type\":\"int24\"}],\"name\":\"Initialize\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"int24\",\"name\":\"tickLower\",\"type\":\"int24\"},{\"indexed\":true,\"internalType\":\"int24\",\"name\":\"tickUpper\",\"type\":\"int24\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"amount\",\"type\":\"uint128\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"}],\"name\":\"Mint\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"feeProtocol0Old\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"feeProtocol1Old\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"feeProtocol0New\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"feeProtocol1New\",\"type\":\"uint32\"}],\"name\":\"SetFeeProtocol\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"SetLmPoolEvent\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"int256\",\"name\":\"amount0\",\"type\":\"int256\"},{\"indexed\":false,\"internalType\":\"int256\",\"name\":\"amount1\",\"type\":\"int256\"},{\"indexed\":false,\"internalType\":\"uint160\",\"name\":\"sqrtPriceX96\",\"type\":\"uint160\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"liquidity\",\"type\":\"uint128\"},{\"indexed\":false,\"internalType\":\"int24\",\"name\":\"tick\",\"type\":\"int24\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"protocolFeesToken0\",\"type\":\"uint128\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"protocolFeesToken1\",\"type\":\"uint128\"}],\"name\":\"Swap\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"int24\",\"name\":\"tickLower\",\"type\":\"int24\"},{\"internalType\":\"int24\",\"name\":\"tickUpper\",\"type\":\"int24\"},{\"internalType\":\"uint128\",\"name\":\"amount\",\"type\":\"uint128\"}],\"name\":\"burn\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"int24\",\"name\":\"tickLower\",\"type\":\"int24\"},{\"internalType\":\"int24\",\"name\":\"tickUpper\",\"type\":\"int24\"},{\"internalType\":\"uint128\",\"name\":\"amount0Requested\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"amount1Requested\",\"type\":\"uint128\"}],\"name\":\"collect\",\"outputs\":[{\"internalType\":\"uint128\",\"name\":\"amount0\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"amount1\",\"type\":\"uint128\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint128\",\"name\":\"amount0Requested\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"amount1Requested\",\"type\":\"uint128\"}],\"name\":\"collectProtocol\",\"outputs\":[{\"internalType\":\"uint128\",\"name\":\"amount0\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"amount1\",\"type\":\"uint128\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"factory\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"fee\",\"outputs\":[{\"internalType\":\"uint24\",\"name\":\"\",\"type\":\"uint24\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"feeGrowthGlobal0X128\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"feeGrowthGlobal1X128\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"flash\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"observationCardinalityNext\",\"type\":\"uint16\"}],\"name\":\"increaseObservationCardinalityNext\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint160\",\"name\":\"sqrtPriceX96\",\"type\":\"uint160\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"liquidity\",\"outputs\":[{\"internalType\":\"uint128\",\"name\":\"\",\"type\":\"uint128\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"lmPool\",\"outputs\":[{\"internalType\":\"contractIPancakeV3LmPool\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"maxLiquidityPerTick\",\"outputs\":[{\"internalType\":\"uint128\",\"name\":\"\",\"type\":\"uint128\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"int24\",\"name\":\"tickLower\",\"type\":\"int24\"},{\"internalType\":\"int24\",\"name\":\"tickUpper\",\"type\":\"int24\"},{\"internalType\":\"uint128\",\"name\":\"amount\",\"type\":\"uint128\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"mint\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"observations\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"blockTimestamp\",\"type\":\"uint32\"},{\"internalType\":\"int56\",\"name\":\"tickCumulative\",\"type\":\"int56\"},{\"internalType\":\"uint160\",\"name\":\"secondsPerLiquidityCumulativeX128\",\"type\":\"uint160\"},{\"internalType\":\"bool\",\"name\":\"initialized\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32[]\",\"name\":\"secondsAgos\",\"type\":\"uint32[]\"}],\"name\":\"observe\",\"outputs\":[{\"internalType\":\"int56[]\",\"name\":\"tickCumulatives\",\"type\":\"int56[]\"},{\"internalType\":\"uint160[]\",\"name\":\"secondsPerLiquidityCumulativeX128s\",\"type\":\"uint160[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"positions\",\"outputs\":[{\"internalType\":\"uint128\",\"name\":\"liquidity\",\"type\":\"uint128\"},{\"internalType\":\"uint256\",\"name\":\"feeGrowthInside0LastX128\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"feeGrowthInside1LastX128\",\"type\":\"uint256\"},{\"internalType\":\"uint128\",\"name\":\"tokensOwed0\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"tokensOwed1\",\"type\":\"uint128\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"protocolFees\",\"outputs\":[{\"internalType\":\"uint128\",\"name\":\"token0\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"token1\",\"type\":\"uint128\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"feeProtocol0\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"feeProtocol1\",\"type\":\"uint32\"}],\"name\":\"setFeeProtocol\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_lmPool\",\"type\":\"address\"}],\"name\":\"setLmPool\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"slot0\",\"outputs\":[{\"internalType\":\"uint160\",\"name\":\"sqrtPriceX96\",\"type\":\"uint160\"},{\"internalType\":\"int24\",\"name\":\"tick\",\"type\":\"int24\"},{\"internalType\":\"uint16\",\"name\":\"observationIndex\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"observationCardinality\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"observationCardinalityNext\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"feeProtocol\",\"type\":\"uint32\"},{\"internalType\":\"bool\",\"name\":\"unlocked\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"int24\",\"name\":\"tickLower\",\"type\":\"int24\"},{\"internalType\":\"int24\",\"name\":\"tickUpper\",\"type\":\"int24\"}],\"name\":\"snapshotCumulativesInside\",\"outputs\":[{\"internalType\":\"int56\",\"name\":\"tickCumulativeInside\",\"type\":\"int56\"},{\"internalType\":\"uint160\",\"name\":\"secondsPerLiquidityInsideX128\",\"type\":\"uint160\"},{\"internalType\":\"uint32\",\"name\":\"secondsInside\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"zeroForOne\",\"type\":\"bool\"},{\"internalType\":\"int256\",\"name\":\"amountSpecified\",\"type\":\"int256\"},{\"internalType\":\"uint160\",\"name\":\"sqrtPriceLimitX96\",\"type\":\"uint160\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"swap\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"amount0\",\"type\":\"int256\"},{\"internalType\":\"int256\",\"name\":\"amount1\",\"type\":\"int256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"int16\",\"name\":\"\",\"type\":\"int16\"}],\"name\":\"tickBitmap\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"tickSpacing\",\"outputs\":[{\"internalType\":\"int24\",\"name\":\"\",\"type\":\"int24\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"int24\",\"name\":\"\",\"type\":\"int24\"}],\"name\":\"ticks\",\"outputs\":[{\"internalType\":\"uint128\",\"name\":\"liquidityGross\",\"type\":\"uint128\"},{\"internalType\":\"int128\",\"name\":\"liquidityNet\",\"type\":\"int128\"},{\"internalType\":\"uint256\",\"name\":\"feeGrowthOutside0X128\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"feeGrowthOutside1X128\",\"type\":\"uint256\"},{\"internalType\":\"int56\",\"name\":\"tickCumulativeOutside\",\"type\":\"int56\"},{\"internalType\":\"uint160\",\"name\":\"secondsPerLiquidityOutsideX128\",\"type\":\"uint160\"},{\"internalType\":\"uint32\",\"name\":\"secondsOutside\",\"type\":\"uint32\"},{\"internalType\":\"bool\",\"name\":\"initialized\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"token0\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"token1\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", } // PoolABI is the input ABI used to generate the binding from. // Deprecated: Use PoolMetaData.ABI instead. var PoolABI = PoolMetaData.ABI // Pool is an auto generated Go binding around an Ethereum contract. type Pool struct { PoolCaller // Read-only binding to the contract PoolTransactor // Write-only binding to the contract PoolFilterer // Log filterer for contract events } // PoolCaller is an auto generated read-only Go binding around an Ethereum contract. type PoolCaller struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // PoolTransactor is an auto generated write-only Go binding around an Ethereum contract. type PoolTransactor struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // PoolFilterer is an auto generated log filtering Go binding around an Ethereum contract events. type PoolFilterer struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // PoolSession is an auto generated Go binding around an Ethereum contract, // with pre-set call and transact options. type PoolSession struct { Contract *Pool // Generic contract binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // PoolCallerSession is an auto generated read-only Go binding around an Ethereum contract, // with pre-set call options. type PoolCallerSession struct { Contract *PoolCaller // Generic contract caller binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session } // PoolTransactorSession is an auto generated write-only Go binding around an Ethereum contract, // with pre-set transact options. type PoolTransactorSession struct { Contract *PoolTransactor // Generic contract transactor binding to set the session for TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // PoolRaw is an auto generated low-level Go binding around an Ethereum contract. type PoolRaw struct { Contract *Pool // Generic contract binding to access the raw methods on } // PoolCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. type PoolCallerRaw struct { Contract *PoolCaller // Generic read-only contract binding to access the raw methods on } // PoolTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. type PoolTransactorRaw struct { Contract *PoolTransactor // Generic write-only contract binding to access the raw methods on } // NewPool creates a new instance of Pool, bound to a specific deployed contract. func NewPool(address common.Address, backend bind.ContractBackend) (*Pool, error) { contract, err := bindPool(address, backend, backend, backend) if err != nil { return nil, err } return &Pool{PoolCaller: PoolCaller{contract: contract}, PoolTransactor: PoolTransactor{contract: contract}, PoolFilterer: PoolFilterer{contract: contract}}, nil } // NewPoolCaller creates a new read-only instance of Pool, bound to a specific deployed contract. func NewPoolCaller(address common.Address, caller bind.ContractCaller) (*PoolCaller, error) { contract, err := bindPool(address, caller, nil, nil) if err != nil { return nil, err } return &PoolCaller{contract: contract}, nil } // NewPoolTransactor creates a new write-only instance of Pool, bound to a specific deployed contract. func NewPoolTransactor(address common.Address, transactor bind.ContractTransactor) (*PoolTransactor, error) { contract, err := bindPool(address, nil, transactor, nil) if err != nil { return nil, err } return &PoolTransactor{contract: contract}, nil } // NewPoolFilterer creates a new log filterer instance of Pool, bound to a specific deployed contract. func NewPoolFilterer(address common.Address, filterer bind.ContractFilterer) (*PoolFilterer, error) { contract, err := bindPool(address, nil, nil, filterer) if err != nil { return nil, err } return &PoolFilterer{contract: contract}, nil } // bindPool binds a generic wrapper to an already deployed contract. func bindPool(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { parsed, err := PoolMetaData.GetAbi() if err != nil { return nil, err } return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_Pool *PoolRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _Pool.Contract.PoolCaller.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_Pool *PoolRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _Pool.Contract.PoolTransactor.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_Pool *PoolRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _Pool.Contract.PoolTransactor.contract.Transact(opts, method, params...) } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_Pool *PoolCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _Pool.Contract.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_Pool *PoolTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _Pool.Contract.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_Pool *PoolTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _Pool.Contract.contract.Transact(opts, method, params...) } // Factory is a free data retrieval call binding the contract method 0xc45a0155. // // Solidity: function factory() view returns(address) func (_Pool *PoolCaller) Factory(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _Pool.contract.Call(opts, &out, "factory") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // Factory is a free data retrieval call binding the contract method 0xc45a0155. // // Solidity: function factory() view returns(address) func (_Pool *PoolSession) Factory() (common.Address, error) { return _Pool.Contract.Factory(&_Pool.CallOpts) } // Factory is a free data retrieval call binding the contract method 0xc45a0155. // // Solidity: function factory() view returns(address) func (_Pool *PoolCallerSession) Factory() (common.Address, error) { return _Pool.Contract.Factory(&_Pool.CallOpts) } // Fee is a free data retrieval call binding the contract method 0xddca3f43. // // Solidity: function fee() view returns(uint24) func (_Pool *PoolCaller) Fee(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} err := _Pool.contract.Call(opts, &out, "fee") if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // Fee is a free data retrieval call binding the contract method 0xddca3f43. // // Solidity: function fee() view returns(uint24) func (_Pool *PoolSession) Fee() (*big.Int, error) { return _Pool.Contract.Fee(&_Pool.CallOpts) } // Fee is a free data retrieval call binding the contract method 0xddca3f43. // // Solidity: function fee() view returns(uint24) func (_Pool *PoolCallerSession) Fee() (*big.Int, error) { return _Pool.Contract.Fee(&_Pool.CallOpts) } // FeeGrowthGlobal0X128 is a free data retrieval call binding the contract method 0xf3058399. // // Solidity: function feeGrowthGlobal0X128() view returns(uint256) func (_Pool *PoolCaller) FeeGrowthGlobal0X128(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} err := _Pool.contract.Call(opts, &out, "feeGrowthGlobal0X128") if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // FeeGrowthGlobal0X128 is a free data retrieval call binding the contract method 0xf3058399. // // Solidity: function feeGrowthGlobal0X128() view returns(uint256) func (_Pool *PoolSession) FeeGrowthGlobal0X128() (*big.Int, error) { return _Pool.Contract.FeeGrowthGlobal0X128(&_Pool.CallOpts) } // FeeGrowthGlobal0X128 is a free data retrieval call binding the contract method 0xf3058399. // // Solidity: function feeGrowthGlobal0X128() view returns(uint256) func (_Pool *PoolCallerSession) FeeGrowthGlobal0X128() (*big.Int, error) { return _Pool.Contract.FeeGrowthGlobal0X128(&_Pool.CallOpts) } // FeeGrowthGlobal1X128 is a free data retrieval call binding the contract method 0x46141319. // // Solidity: function feeGrowthGlobal1X128() view returns(uint256) func (_Pool *PoolCaller) FeeGrowthGlobal1X128(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} err := _Pool.contract.Call(opts, &out, "feeGrowthGlobal1X128") if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // FeeGrowthGlobal1X128 is a free data retrieval call binding the contract method 0x46141319. // // Solidity: function feeGrowthGlobal1X128() view returns(uint256) func (_Pool *PoolSession) FeeGrowthGlobal1X128() (*big.Int, error) { return _Pool.Contract.FeeGrowthGlobal1X128(&_Pool.CallOpts) } // FeeGrowthGlobal1X128 is a free data retrieval call binding the contract method 0x46141319. // // Solidity: function feeGrowthGlobal1X128() view returns(uint256) func (_Pool *PoolCallerSession) FeeGrowthGlobal1X128() (*big.Int, error) { return _Pool.Contract.FeeGrowthGlobal1X128(&_Pool.CallOpts) } // Liquidity is a free data retrieval call binding the contract method 0x1a686502. // // Solidity: function liquidity() view returns(uint128) func (_Pool *PoolCaller) Liquidity(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} err := _Pool.contract.Call(opts, &out, "liquidity") if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // Liquidity is a free data retrieval call binding the contract method 0x1a686502. // // Solidity: function liquidity() view returns(uint128) func (_Pool *PoolSession) Liquidity() (*big.Int, error) { return _Pool.Contract.Liquidity(&_Pool.CallOpts) } // Liquidity is a free data retrieval call binding the contract method 0x1a686502. // // Solidity: function liquidity() view returns(uint128) func (_Pool *PoolCallerSession) Liquidity() (*big.Int, error) { return _Pool.Contract.Liquidity(&_Pool.CallOpts) } // LmPool is a free data retrieval call binding the contract method 0x540d4918. // // Solidity: function lmPool() view returns(address) func (_Pool *PoolCaller) LmPool(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _Pool.contract.Call(opts, &out, "lmPool") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // LmPool is a free data retrieval call binding the contract method 0x540d4918. // // Solidity: function lmPool() view returns(address) func (_Pool *PoolSession) LmPool() (common.Address, error) { return _Pool.Contract.LmPool(&_Pool.CallOpts) } // LmPool is a free data retrieval call binding the contract method 0x540d4918. // // Solidity: function lmPool() view returns(address) func (_Pool *PoolCallerSession) LmPool() (common.Address, error) { return _Pool.Contract.LmPool(&_Pool.CallOpts) } // MaxLiquidityPerTick is a free data retrieval call binding the contract method 0x70cf754a. // // Solidity: function maxLiquidityPerTick() view returns(uint128) func (_Pool *PoolCaller) MaxLiquidityPerTick(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} err := _Pool.contract.Call(opts, &out, "maxLiquidityPerTick") if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // MaxLiquidityPerTick is a free data retrieval call binding the contract method 0x70cf754a. // // Solidity: function maxLiquidityPerTick() view returns(uint128) func (_Pool *PoolSession) MaxLiquidityPerTick() (*big.Int, error) { return _Pool.Contract.MaxLiquidityPerTick(&_Pool.CallOpts) } // MaxLiquidityPerTick is a free data retrieval call binding the contract method 0x70cf754a. // // Solidity: function maxLiquidityPerTick() view returns(uint128) func (_Pool *PoolCallerSession) MaxLiquidityPerTick() (*big.Int, error) { return _Pool.Contract.MaxLiquidityPerTick(&_Pool.CallOpts) } // Observations is a free data retrieval call binding the contract method 0x252c09d7. // // Solidity: function observations(uint256 ) view returns(uint32 blockTimestamp, int56 tickCumulative, uint160 secondsPerLiquidityCumulativeX128, bool initialized) func (_Pool *PoolCaller) Observations(opts *bind.CallOpts, arg0 *big.Int) (struct { BlockTimestamp uint32 TickCumulative *big.Int SecondsPerLiquidityCumulativeX128 *big.Int Initialized bool }, error) { var out []interface{} err := _Pool.contract.Call(opts, &out, "observations", arg0) outstruct := new(struct { BlockTimestamp uint32 TickCumulative *big.Int SecondsPerLiquidityCumulativeX128 *big.Int Initialized bool }) if err != nil { return *outstruct, err } outstruct.BlockTimestamp = *abi.ConvertType(out[0], new(uint32)).(*uint32) outstruct.TickCumulative = *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) outstruct.SecondsPerLiquidityCumulativeX128 = *abi.ConvertType(out[2], new(*big.Int)).(**big.Int) outstruct.Initialized = *abi.ConvertType(out[3], new(bool)).(*bool) return *outstruct, err } // Observations is a free data retrieval call binding the contract method 0x252c09d7. // // Solidity: function observations(uint256 ) view returns(uint32 blockTimestamp, int56 tickCumulative, uint160 secondsPerLiquidityCumulativeX128, bool initialized) func (_Pool *PoolSession) Observations(arg0 *big.Int) (struct { BlockTimestamp uint32 TickCumulative *big.Int SecondsPerLiquidityCumulativeX128 *big.Int Initialized bool }, error) { return _Pool.Contract.Observations(&_Pool.CallOpts, arg0) } // Observations is a free data retrieval call binding the contract method 0x252c09d7. // // Solidity: function observations(uint256 ) view returns(uint32 blockTimestamp, int56 tickCumulative, uint160 secondsPerLiquidityCumulativeX128, bool initialized) func (_Pool *PoolCallerSession) Observations(arg0 *big.Int) (struct { BlockTimestamp uint32 TickCumulative *big.Int SecondsPerLiquidityCumulativeX128 *big.Int Initialized bool }, error) { return _Pool.Contract.Observations(&_Pool.CallOpts, arg0) } // Observe is a free data retrieval call binding the contract method 0x883bdbfd. // // Solidity: function observe(uint32[] secondsAgos) view returns(int56[] tickCumulatives, uint160[] secondsPerLiquidityCumulativeX128s) func (_Pool *PoolCaller) Observe(opts *bind.CallOpts, secondsAgos []uint32) (struct { TickCumulatives []*big.Int SecondsPerLiquidityCumulativeX128s []*big.Int }, error) { var out []interface{} err := _Pool.contract.Call(opts, &out, "observe", secondsAgos) outstruct := new(struct { TickCumulatives []*big.Int SecondsPerLiquidityCumulativeX128s []*big.Int }) if err != nil { return *outstruct, err } outstruct.TickCumulatives = *abi.ConvertType(out[0], new([]*big.Int)).(*[]*big.Int) outstruct.SecondsPerLiquidityCumulativeX128s = *abi.ConvertType(out[1], new([]*big.Int)).(*[]*big.Int) return *outstruct, err } // Observe is a free data retrieval call binding the contract method 0x883bdbfd. // // Solidity: function observe(uint32[] secondsAgos) view returns(int56[] tickCumulatives, uint160[] secondsPerLiquidityCumulativeX128s) func (_Pool *PoolSession) Observe(secondsAgos []uint32) (struct { TickCumulatives []*big.Int SecondsPerLiquidityCumulativeX128s []*big.Int }, error) { return _Pool.Contract.Observe(&_Pool.CallOpts, secondsAgos) } // Observe is a free data retrieval call binding the contract method 0x883bdbfd. // // Solidity: function observe(uint32[] secondsAgos) view returns(int56[] tickCumulatives, uint160[] secondsPerLiquidityCumulativeX128s) func (_Pool *PoolCallerSession) Observe(secondsAgos []uint32) (struct { TickCumulatives []*big.Int SecondsPerLiquidityCumulativeX128s []*big.Int }, error) { return _Pool.Contract.Observe(&_Pool.CallOpts, secondsAgos) } // Positions is a free data retrieval call binding the contract method 0x514ea4bf. // // Solidity: function positions(bytes32 ) view returns(uint128 liquidity, uint256 feeGrowthInside0LastX128, uint256 feeGrowthInside1LastX128, uint128 tokensOwed0, uint128 tokensOwed1) func (_Pool *PoolCaller) Positions(opts *bind.CallOpts, arg0 [32]byte) (struct { Liquidity *big.Int FeeGrowthInside0LastX128 *big.Int FeeGrowthInside1LastX128 *big.Int TokensOwed0 *big.Int TokensOwed1 *big.Int }, error) { var out []interface{} err := _Pool.contract.Call(opts, &out, "positions", arg0) outstruct := new(struct { Liquidity *big.Int FeeGrowthInside0LastX128 *big.Int FeeGrowthInside1LastX128 *big.Int TokensOwed0 *big.Int TokensOwed1 *big.Int }) if err != nil { return *outstruct, err } outstruct.Liquidity = *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) outstruct.FeeGrowthInside0LastX128 = *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) outstruct.FeeGrowthInside1LastX128 = *abi.ConvertType(out[2], new(*big.Int)).(**big.Int) outstruct.TokensOwed0 = *abi.ConvertType(out[3], new(*big.Int)).(**big.Int) outstruct.TokensOwed1 = *abi.ConvertType(out[4], new(*big.Int)).(**big.Int) return *outstruct, err } // Positions is a free data retrieval call binding the contract method 0x514ea4bf. // // Solidity: function positions(bytes32 ) view returns(uint128 liquidity, uint256 feeGrowthInside0LastX128, uint256 feeGrowthInside1LastX128, uint128 tokensOwed0, uint128 tokensOwed1) func (_Pool *PoolSession) Positions(arg0 [32]byte) (struct { Liquidity *big.Int FeeGrowthInside0LastX128 *big.Int FeeGrowthInside1LastX128 *big.Int TokensOwed0 *big.Int TokensOwed1 *big.Int }, error) { return _Pool.Contract.Positions(&_Pool.CallOpts, arg0) } // Positions is a free data retrieval call binding the contract method 0x514ea4bf. // // Solidity: function positions(bytes32 ) view returns(uint128 liquidity, uint256 feeGrowthInside0LastX128, uint256 feeGrowthInside1LastX128, uint128 tokensOwed0, uint128 tokensOwed1) func (_Pool *PoolCallerSession) Positions(arg0 [32]byte) (struct { Liquidity *big.Int FeeGrowthInside0LastX128 *big.Int FeeGrowthInside1LastX128 *big.Int TokensOwed0 *big.Int TokensOwed1 *big.Int }, error) { return _Pool.Contract.Positions(&_Pool.CallOpts, arg0) } // ProtocolFees is a free data retrieval call binding the contract method 0x1ad8b03b. // // Solidity: function protocolFees() view returns(uint128 token0, uint128 token1) func (_Pool *PoolCaller) ProtocolFees(opts *bind.CallOpts) (struct { Token0 *big.Int Token1 *big.Int }, error) { var out []interface{} err := _Pool.contract.Call(opts, &out, "protocolFees") outstruct := new(struct { Token0 *big.Int Token1 *big.Int }) if err != nil { return *outstruct, err } outstruct.Token0 = *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) outstruct.Token1 = *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) return *outstruct, err } // ProtocolFees is a free data retrieval call binding the contract method 0x1ad8b03b. // // Solidity: function protocolFees() view returns(uint128 token0, uint128 token1) func (_Pool *PoolSession) ProtocolFees() (struct { Token0 *big.Int Token1 *big.Int }, error) { return _Pool.Contract.ProtocolFees(&_Pool.CallOpts) } // ProtocolFees is a free data retrieval call binding the contract method 0x1ad8b03b. // // Solidity: function protocolFees() view returns(uint128 token0, uint128 token1) func (_Pool *PoolCallerSession) ProtocolFees() (struct { Token0 *big.Int Token1 *big.Int }, error) { return _Pool.Contract.ProtocolFees(&_Pool.CallOpts) } // Slot0 is a free data retrieval call binding the contract method 0x3850c7bd. // // Solidity: function slot0() view returns(uint160 sqrtPriceX96, int24 tick, uint16 observationIndex, uint16 observationCardinality, uint16 observationCardinalityNext, uint32 feeProtocol, bool unlocked) func (_Pool *PoolCaller) Slot0(opts *bind.CallOpts) (struct { SqrtPriceX96 *big.Int Tick *big.Int ObservationIndex uint16 ObservationCardinality uint16 ObservationCardinalityNext uint16 FeeProtocol uint32 Unlocked bool }, error) { var out []interface{} err := _Pool.contract.Call(opts, &out, "slot0") outstruct := new(struct { SqrtPriceX96 *big.Int Tick *big.Int ObservationIndex uint16 ObservationCardinality uint16 ObservationCardinalityNext uint16 FeeProtocol uint32 Unlocked bool }) if err != nil { return *outstruct, err } outstruct.SqrtPriceX96 = *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) outstruct.Tick = *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) outstruct.ObservationIndex = *abi.ConvertType(out[2], new(uint16)).(*uint16) outstruct.ObservationCardinality = *abi.ConvertType(out[3], new(uint16)).(*uint16) outstruct.ObservationCardinalityNext = *abi.ConvertType(out[4], new(uint16)).(*uint16) outstruct.FeeProtocol = *abi.ConvertType(out[5], new(uint32)).(*uint32) outstruct.Unlocked = *abi.ConvertType(out[6], new(bool)).(*bool) return *outstruct, err } // Slot0 is a free data retrieval call binding the contract method 0x3850c7bd. // // Solidity: function slot0() view returns(uint160 sqrtPriceX96, int24 tick, uint16 observationIndex, uint16 observationCardinality, uint16 observationCardinalityNext, uint32 feeProtocol, bool unlocked) func (_Pool *PoolSession) Slot0() (struct { SqrtPriceX96 *big.Int Tick *big.Int ObservationIndex uint16 ObservationCardinality uint16 ObservationCardinalityNext uint16 FeeProtocol uint32 Unlocked bool }, error) { return _Pool.Contract.Slot0(&_Pool.CallOpts) } // Slot0 is a free data retrieval call binding the contract method 0x3850c7bd. // // Solidity: function slot0() view returns(uint160 sqrtPriceX96, int24 tick, uint16 observationIndex, uint16 observationCardinality, uint16 observationCardinalityNext, uint32 feeProtocol, bool unlocked) func (_Pool *PoolCallerSession) Slot0() (struct { SqrtPriceX96 *big.Int Tick *big.Int ObservationIndex uint16 ObservationCardinality uint16 ObservationCardinalityNext uint16 FeeProtocol uint32 Unlocked bool }, error) { return _Pool.Contract.Slot0(&_Pool.CallOpts) } // SnapshotCumulativesInside is a free data retrieval call binding the contract method 0xa38807f2. // // Solidity: function snapshotCumulativesInside(int24 tickLower, int24 tickUpper) view returns(int56 tickCumulativeInside, uint160 secondsPerLiquidityInsideX128, uint32 secondsInside) func (_Pool *PoolCaller) SnapshotCumulativesInside(opts *bind.CallOpts, tickLower *big.Int, tickUpper *big.Int) (struct { TickCumulativeInside *big.Int SecondsPerLiquidityInsideX128 *big.Int SecondsInside uint32 }, error) { var out []interface{} err := _Pool.contract.Call(opts, &out, "snapshotCumulativesInside", tickLower, tickUpper) outstruct := new(struct { TickCumulativeInside *big.Int SecondsPerLiquidityInsideX128 *big.Int SecondsInside uint32 }) if err != nil { return *outstruct, err } outstruct.TickCumulativeInside = *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) outstruct.SecondsPerLiquidityInsideX128 = *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) outstruct.SecondsInside = *abi.ConvertType(out[2], new(uint32)).(*uint32) return *outstruct, err } // SnapshotCumulativesInside is a free data retrieval call binding the contract method 0xa38807f2. // // Solidity: function snapshotCumulativesInside(int24 tickLower, int24 tickUpper) view returns(int56 tickCumulativeInside, uint160 secondsPerLiquidityInsideX128, uint32 secondsInside) func (_Pool *PoolSession) SnapshotCumulativesInside(tickLower *big.Int, tickUpper *big.Int) (struct { TickCumulativeInside *big.Int SecondsPerLiquidityInsideX128 *big.Int SecondsInside uint32 }, error) { return _Pool.Contract.SnapshotCumulativesInside(&_Pool.CallOpts, tickLower, tickUpper) } // SnapshotCumulativesInside is a free data retrieval call binding the contract method 0xa38807f2. // // Solidity: function snapshotCumulativesInside(int24 tickLower, int24 tickUpper) view returns(int56 tickCumulativeInside, uint160 secondsPerLiquidityInsideX128, uint32 secondsInside) func (_Pool *PoolCallerSession) SnapshotCumulativesInside(tickLower *big.Int, tickUpper *big.Int) (struct { TickCumulativeInside *big.Int SecondsPerLiquidityInsideX128 *big.Int SecondsInside uint32 }, error) { return _Pool.Contract.SnapshotCumulativesInside(&_Pool.CallOpts, tickLower, tickUpper) } // TickBitmap is a free data retrieval call binding the contract method 0x5339c296. // // Solidity: function tickBitmap(int16 ) view returns(uint256) func (_Pool *PoolCaller) TickBitmap(opts *bind.CallOpts, arg0 int16) (*big.Int, error) { var out []interface{} err := _Pool.contract.Call(opts, &out, "tickBitmap", arg0) if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // TickBitmap is a free data retrieval call binding the contract method 0x5339c296. // // Solidity: function tickBitmap(int16 ) view returns(uint256) func (_Pool *PoolSession) TickBitmap(arg0 int16) (*big.Int, error) { return _Pool.Contract.TickBitmap(&_Pool.CallOpts, arg0) } // TickBitmap is a free data retrieval call binding the contract method 0x5339c296. // // Solidity: function tickBitmap(int16 ) view returns(uint256) func (_Pool *PoolCallerSession) TickBitmap(arg0 int16) (*big.Int, error) { return _Pool.Contract.TickBitmap(&_Pool.CallOpts, arg0) } // TickSpacing is a free data retrieval call binding the contract method 0xd0c93a7c. // // Solidity: function tickSpacing() view returns(int24) func (_Pool *PoolCaller) TickSpacing(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} err := _Pool.contract.Call(opts, &out, "tickSpacing") if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // TickSpacing is a free data retrieval call binding the contract method 0xd0c93a7c. // // Solidity: function tickSpacing() view returns(int24) func (_Pool *PoolSession) TickSpacing() (*big.Int, error) { return _Pool.Contract.TickSpacing(&_Pool.CallOpts) } // TickSpacing is a free data retrieval call binding the contract method 0xd0c93a7c. // // Solidity: function tickSpacing() view returns(int24) func (_Pool *PoolCallerSession) TickSpacing() (*big.Int, error) { return _Pool.Contract.TickSpacing(&_Pool.CallOpts) } // Ticks is a free data retrieval call binding the contract method 0xf30dba93. // // Solidity: function ticks(int24 ) view returns(uint128 liquidityGross, int128 liquidityNet, uint256 feeGrowthOutside0X128, uint256 feeGrowthOutside1X128, int56 tickCumulativeOutside, uint160 secondsPerLiquidityOutsideX128, uint32 secondsOutside, bool initialized) func (_Pool *PoolCaller) Ticks(opts *bind.CallOpts, arg0 *big.Int) (struct { LiquidityGross *big.Int LiquidityNet *big.Int FeeGrowthOutside0X128 *big.Int FeeGrowthOutside1X128 *big.Int TickCumulativeOutside *big.Int SecondsPerLiquidityOutsideX128 *big.Int SecondsOutside uint32 Initialized bool }, error) { var out []interface{} err := _Pool.contract.Call(opts, &out, "ticks", arg0) outstruct := new(struct { LiquidityGross *big.Int LiquidityNet *big.Int FeeGrowthOutside0X128 *big.Int FeeGrowthOutside1X128 *big.Int TickCumulativeOutside *big.Int SecondsPerLiquidityOutsideX128 *big.Int SecondsOutside uint32 Initialized bool }) if err != nil { return *outstruct, err } outstruct.LiquidityGross = *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) outstruct.LiquidityNet = *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) outstruct.FeeGrowthOutside0X128 = *abi.ConvertType(out[2], new(*big.Int)).(**big.Int) outstruct.FeeGrowthOutside1X128 = *abi.ConvertType(out[3], new(*big.Int)).(**big.Int) outstruct.TickCumulativeOutside = *abi.ConvertType(out[4], new(*big.Int)).(**big.Int) outstruct.SecondsPerLiquidityOutsideX128 = *abi.ConvertType(out[5], new(*big.Int)).(**big.Int) outstruct.SecondsOutside = *abi.ConvertType(out[6], new(uint32)).(*uint32) outstruct.Initialized = *abi.ConvertType(out[7], new(bool)).(*bool) return *outstruct, err } // Ticks is a free data retrieval call binding the contract method 0xf30dba93. // // Solidity: function ticks(int24 ) view returns(uint128 liquidityGross, int128 liquidityNet, uint256 feeGrowthOutside0X128, uint256 feeGrowthOutside1X128, int56 tickCumulativeOutside, uint160 secondsPerLiquidityOutsideX128, uint32 secondsOutside, bool initialized) func (_Pool *PoolSession) Ticks(arg0 *big.Int) (struct { LiquidityGross *big.Int LiquidityNet *big.Int FeeGrowthOutside0X128 *big.Int FeeGrowthOutside1X128 *big.Int TickCumulativeOutside *big.Int SecondsPerLiquidityOutsideX128 *big.Int SecondsOutside uint32 Initialized bool }, error) { return _Pool.Contract.Ticks(&_Pool.CallOpts, arg0) } // Ticks is a free data retrieval call binding the contract method 0xf30dba93. // // Solidity: function ticks(int24 ) view returns(uint128 liquidityGross, int128 liquidityNet, uint256 feeGrowthOutside0X128, uint256 feeGrowthOutside1X128, int56 tickCumulativeOutside, uint160 secondsPerLiquidityOutsideX128, uint32 secondsOutside, bool initialized) func (_Pool *PoolCallerSession) Ticks(arg0 *big.Int) (struct { LiquidityGross *big.Int LiquidityNet *big.Int FeeGrowthOutside0X128 *big.Int FeeGrowthOutside1X128 *big.Int TickCumulativeOutside *big.Int SecondsPerLiquidityOutsideX128 *big.Int SecondsOutside uint32 Initialized bool }, error) { return _Pool.Contract.Ticks(&_Pool.CallOpts, arg0) } // Token0 is a free data retrieval call binding the contract method 0x0dfe1681. // // Solidity: function token0() view returns(address) func (_Pool *PoolCaller) Token0(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _Pool.contract.Call(opts, &out, "token0") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // Token0 is a free data retrieval call binding the contract method 0x0dfe1681. // // Solidity: function token0() view returns(address) func (_Pool *PoolSession) Token0() (common.Address, error) { return _Pool.Contract.Token0(&_Pool.CallOpts) } // Token0 is a free data retrieval call binding the contract method 0x0dfe1681. // // Solidity: function token0() view returns(address) func (_Pool *PoolCallerSession) Token0() (common.Address, error) { return _Pool.Contract.Token0(&_Pool.CallOpts) } // Token1 is a free data retrieval call binding the contract method 0xd21220a7. // // Solidity: function token1() view returns(address) func (_Pool *PoolCaller) Token1(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _Pool.contract.Call(opts, &out, "token1") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // Token1 is a free data retrieval call binding the contract method 0xd21220a7. // // Solidity: function token1() view returns(address) func (_Pool *PoolSession) Token1() (common.Address, error) { return _Pool.Contract.Token1(&_Pool.CallOpts) } // Token1 is a free data retrieval call binding the contract method 0xd21220a7. // // Solidity: function token1() view returns(address) func (_Pool *PoolCallerSession) Token1() (common.Address, error) { return _Pool.Contract.Token1(&_Pool.CallOpts) } // Burn is a paid mutator transaction binding the contract method 0xa34123a7. // // Solidity: function burn(int24 tickLower, int24 tickUpper, uint128 amount) returns(uint256 amount0, uint256 amount1) func (_Pool *PoolTransactor) Burn(opts *bind.TransactOpts, tickLower *big.Int, tickUpper *big.Int, amount *big.Int) (*types.Transaction, error) { return _Pool.contract.Transact(opts, "burn", tickLower, tickUpper, amount) } // Burn is a paid mutator transaction binding the contract method 0xa34123a7. // // Solidity: function burn(int24 tickLower, int24 tickUpper, uint128 amount) returns(uint256 amount0, uint256 amount1) func (_Pool *PoolSession) Burn(tickLower *big.Int, tickUpper *big.Int, amount *big.Int) (*types.Transaction, error) { return _Pool.Contract.Burn(&_Pool.TransactOpts, tickLower, tickUpper, amount) } // Burn is a paid mutator transaction binding the contract method 0xa34123a7. // // Solidity: function burn(int24 tickLower, int24 tickUpper, uint128 amount) returns(uint256 amount0, uint256 amount1) func (_Pool *PoolTransactorSession) Burn(tickLower *big.Int, tickUpper *big.Int, amount *big.Int) (*types.Transaction, error) { return _Pool.Contract.Burn(&_Pool.TransactOpts, tickLower, tickUpper, amount) } // Collect is a paid mutator transaction binding the contract method 0x4f1eb3d8. // // Solidity: function collect(address recipient, int24 tickLower, int24 tickUpper, uint128 amount0Requested, uint128 amount1Requested) returns(uint128 amount0, uint128 amount1) func (_Pool *PoolTransactor) Collect(opts *bind.TransactOpts, recipient common.Address, tickLower *big.Int, tickUpper *big.Int, amount0Requested *big.Int, amount1Requested *big.Int) (*types.Transaction, error) { return _Pool.contract.Transact(opts, "collect", recipient, tickLower, tickUpper, amount0Requested, amount1Requested) } // Collect is a paid mutator transaction binding the contract method 0x4f1eb3d8. // // Solidity: function collect(address recipient, int24 tickLower, int24 tickUpper, uint128 amount0Requested, uint128 amount1Requested) returns(uint128 amount0, uint128 amount1) func (_Pool *PoolSession) Collect(recipient common.Address, tickLower *big.Int, tickUpper *big.Int, amount0Requested *big.Int, amount1Requested *big.Int) (*types.Transaction, error) { return _Pool.Contract.Collect(&_Pool.TransactOpts, recipient, tickLower, tickUpper, amount0Requested, amount1Requested) } // Collect is a paid mutator transaction binding the contract method 0x4f1eb3d8. // // Solidity: function collect(address recipient, int24 tickLower, int24 tickUpper, uint128 amount0Requested, uint128 amount1Requested) returns(uint128 amount0, uint128 amount1) func (_Pool *PoolTransactorSession) Collect(recipient common.Address, tickLower *big.Int, tickUpper *big.Int, amount0Requested *big.Int, amount1Requested *big.Int) (*types.Transaction, error) { return _Pool.Contract.Collect(&_Pool.TransactOpts, recipient, tickLower, tickUpper, amount0Requested, amount1Requested) } // CollectProtocol is a paid mutator transaction binding the contract method 0x85b66729. // // Solidity: function collectProtocol(address recipient, uint128 amount0Requested, uint128 amount1Requested) returns(uint128 amount0, uint128 amount1) func (_Pool *PoolTransactor) CollectProtocol(opts *bind.TransactOpts, recipient common.Address, amount0Requested *big.Int, amount1Requested *big.Int) (*types.Transaction, error) { return _Pool.contract.Transact(opts, "collectProtocol", recipient, amount0Requested, amount1Requested) } // CollectProtocol is a paid mutator transaction binding the contract method 0x85b66729. // // Solidity: function collectProtocol(address recipient, uint128 amount0Requested, uint128 amount1Requested) returns(uint128 amount0, uint128 amount1) func (_Pool *PoolSession) CollectProtocol(recipient common.Address, amount0Requested *big.Int, amount1Requested *big.Int) (*types.Transaction, error) { return _Pool.Contract.CollectProtocol(&_Pool.TransactOpts, recipient, amount0Requested, amount1Requested) } // CollectProtocol is a paid mutator transaction binding the contract method 0x85b66729. // // Solidity: function collectProtocol(address recipient, uint128 amount0Requested, uint128 amount1Requested) returns(uint128 amount0, uint128 amount1) func (_Pool *PoolTransactorSession) CollectProtocol(recipient common.Address, amount0Requested *big.Int, amount1Requested *big.Int) (*types.Transaction, error) { return _Pool.Contract.CollectProtocol(&_Pool.TransactOpts, recipient, amount0Requested, amount1Requested) } // Flash is a paid mutator transaction binding the contract method 0x490e6cbc. // // Solidity: function flash(address recipient, uint256 amount0, uint256 amount1, bytes data) returns() func (_Pool *PoolTransactor) Flash(opts *bind.TransactOpts, recipient common.Address, amount0 *big.Int, amount1 *big.Int, data []byte) (*types.Transaction, error) { return _Pool.contract.Transact(opts, "flash", recipient, amount0, amount1, data) } // Flash is a paid mutator transaction binding the contract method 0x490e6cbc. // // Solidity: function flash(address recipient, uint256 amount0, uint256 amount1, bytes data) returns() func (_Pool *PoolSession) Flash(recipient common.Address, amount0 *big.Int, amount1 *big.Int, data []byte) (*types.Transaction, error) { return _Pool.Contract.Flash(&_Pool.TransactOpts, recipient, amount0, amount1, data) } // Flash is a paid mutator transaction binding the contract method 0x490e6cbc. // // Solidity: function flash(address recipient, uint256 amount0, uint256 amount1, bytes data) returns() func (_Pool *PoolTransactorSession) Flash(recipient common.Address, amount0 *big.Int, amount1 *big.Int, data []byte) (*types.Transaction, error) { return _Pool.Contract.Flash(&_Pool.TransactOpts, recipient, amount0, amount1, data) } // IncreaseObservationCardinalityNext is a paid mutator transaction binding the contract method 0x32148f67. // // Solidity: function increaseObservationCardinalityNext(uint16 observationCardinalityNext) returns() func (_Pool *PoolTransactor) IncreaseObservationCardinalityNext(opts *bind.TransactOpts, observationCardinalityNext uint16) (*types.Transaction, error) { return _Pool.contract.Transact(opts, "increaseObservationCardinalityNext", observationCardinalityNext) } // IncreaseObservationCardinalityNext is a paid mutator transaction binding the contract method 0x32148f67. // // Solidity: function increaseObservationCardinalityNext(uint16 observationCardinalityNext) returns() func (_Pool *PoolSession) IncreaseObservationCardinalityNext(observationCardinalityNext uint16) (*types.Transaction, error) { return _Pool.Contract.IncreaseObservationCardinalityNext(&_Pool.TransactOpts, observationCardinalityNext) } // IncreaseObservationCardinalityNext is a paid mutator transaction binding the contract method 0x32148f67. // // Solidity: function increaseObservationCardinalityNext(uint16 observationCardinalityNext) returns() func (_Pool *PoolTransactorSession) IncreaseObservationCardinalityNext(observationCardinalityNext uint16) (*types.Transaction, error) { return _Pool.Contract.IncreaseObservationCardinalityNext(&_Pool.TransactOpts, observationCardinalityNext) } // Initialize is a paid mutator transaction binding the contract method 0xf637731d. // // Solidity: function initialize(uint160 sqrtPriceX96) returns() func (_Pool *PoolTransactor) Initialize(opts *bind.TransactOpts, sqrtPriceX96 *big.Int) (*types.Transaction, error) { return _Pool.contract.Transact(opts, "initialize", sqrtPriceX96) } // Initialize is a paid mutator transaction binding the contract method 0xf637731d. // // Solidity: function initialize(uint160 sqrtPriceX96) returns() func (_Pool *PoolSession) Initialize(sqrtPriceX96 *big.Int) (*types.Transaction, error) { return _Pool.Contract.Initialize(&_Pool.TransactOpts, sqrtPriceX96) } // Initialize is a paid mutator transaction binding the contract method 0xf637731d. // // Solidity: function initialize(uint160 sqrtPriceX96) returns() func (_Pool *PoolTransactorSession) Initialize(sqrtPriceX96 *big.Int) (*types.Transaction, error) { return _Pool.Contract.Initialize(&_Pool.TransactOpts, sqrtPriceX96) } // Mint is a paid mutator transaction binding the contract method 0x3c8a7d8d. // // Solidity: function mint(address recipient, int24 tickLower, int24 tickUpper, uint128 amount, bytes data) returns(uint256 amount0, uint256 amount1) func (_Pool *PoolTransactor) Mint(opts *bind.TransactOpts, recipient common.Address, tickLower *big.Int, tickUpper *big.Int, amount *big.Int, data []byte) (*types.Transaction, error) { return _Pool.contract.Transact(opts, "mint", recipient, tickLower, tickUpper, amount, data) } // Mint is a paid mutator transaction binding the contract method 0x3c8a7d8d. // // Solidity: function mint(address recipient, int24 tickLower, int24 tickUpper, uint128 amount, bytes data) returns(uint256 amount0, uint256 amount1) func (_Pool *PoolSession) Mint(recipient common.Address, tickLower *big.Int, tickUpper *big.Int, amount *big.Int, data []byte) (*types.Transaction, error) { return _Pool.Contract.Mint(&_Pool.TransactOpts, recipient, tickLower, tickUpper, amount, data) } // Mint is a paid mutator transaction binding the contract method 0x3c8a7d8d. // // Solidity: function mint(address recipient, int24 tickLower, int24 tickUpper, uint128 amount, bytes data) returns(uint256 amount0, uint256 amount1) func (_Pool *PoolTransactorSession) Mint(recipient common.Address, tickLower *big.Int, tickUpper *big.Int, amount *big.Int, data []byte) (*types.Transaction, error) { return _Pool.Contract.Mint(&_Pool.TransactOpts, recipient, tickLower, tickUpper, amount, data) } // SetFeeProtocol is a paid mutator transaction binding the contract method 0xb0d0d211. // // Solidity: function setFeeProtocol(uint32 feeProtocol0, uint32 feeProtocol1) returns() func (_Pool *PoolTransactor) SetFeeProtocol(opts *bind.TransactOpts, feeProtocol0 uint32, feeProtocol1 uint32) (*types.Transaction, error) { return _Pool.contract.Transact(opts, "setFeeProtocol", feeProtocol0, feeProtocol1) } // SetFeeProtocol is a paid mutator transaction binding the contract method 0xb0d0d211. // // Solidity: function setFeeProtocol(uint32 feeProtocol0, uint32 feeProtocol1) returns() func (_Pool *PoolSession) SetFeeProtocol(feeProtocol0 uint32, feeProtocol1 uint32) (*types.Transaction, error) { return _Pool.Contract.SetFeeProtocol(&_Pool.TransactOpts, feeProtocol0, feeProtocol1) } // SetFeeProtocol is a paid mutator transaction binding the contract method 0xb0d0d211. // // Solidity: function setFeeProtocol(uint32 feeProtocol0, uint32 feeProtocol1) returns() func (_Pool *PoolTransactorSession) SetFeeProtocol(feeProtocol0 uint32, feeProtocol1 uint32) (*types.Transaction, error) { return _Pool.Contract.SetFeeProtocol(&_Pool.TransactOpts, feeProtocol0, feeProtocol1) } // SetLmPool is a paid mutator transaction binding the contract method 0xcc7e7fa2. // // Solidity: function setLmPool(address _lmPool) returns() func (_Pool *PoolTransactor) SetLmPool(opts *bind.TransactOpts, _lmPool common.Address) (*types.Transaction, error) { return _Pool.contract.Transact(opts, "setLmPool", _lmPool) } // SetLmPool is a paid mutator transaction binding the contract method 0xcc7e7fa2. // // Solidity: function setLmPool(address _lmPool) returns() func (_Pool *PoolSession) SetLmPool(_lmPool common.Address) (*types.Transaction, error) { return _Pool.Contract.SetLmPool(&_Pool.TransactOpts, _lmPool) } // SetLmPool is a paid mutator transaction binding the contract method 0xcc7e7fa2. // // Solidity: function setLmPool(address _lmPool) returns() func (_Pool *PoolTransactorSession) SetLmPool(_lmPool common.Address) (*types.Transaction, error) { return _Pool.Contract.SetLmPool(&_Pool.TransactOpts, _lmPool) } // Swap is a paid mutator transaction binding the contract method 0x128acb08. // // Solidity: function swap(address recipient, bool zeroForOne, int256 amountSpecified, uint160 sqrtPriceLimitX96, bytes data) returns(int256 amount0, int256 amount1) func (_Pool *PoolTransactor) Swap(opts *bind.TransactOpts, recipient common.Address, zeroForOne bool, amountSpecified *big.Int, sqrtPriceLimitX96 *big.Int, data []byte) (*types.Transaction, error) { return _Pool.contract.Transact(opts, "swap", recipient, zeroForOne, amountSpecified, sqrtPriceLimitX96, data) } // Swap is a paid mutator transaction binding the contract method 0x128acb08. // // Solidity: function swap(address recipient, bool zeroForOne, int256 amountSpecified, uint160 sqrtPriceLimitX96, bytes data) returns(int256 amount0, int256 amount1) func (_Pool *PoolSession) Swap(recipient common.Address, zeroForOne bool, amountSpecified *big.Int, sqrtPriceLimitX96 *big.Int, data []byte) (*types.Transaction, error) { return _Pool.Contract.Swap(&_Pool.TransactOpts, recipient, zeroForOne, amountSpecified, sqrtPriceLimitX96, data) } // Swap is a paid mutator transaction binding the contract method 0x128acb08. // // Solidity: function swap(address recipient, bool zeroForOne, int256 amountSpecified, uint160 sqrtPriceLimitX96, bytes data) returns(int256 amount0, int256 amount1) func (_Pool *PoolTransactorSession) Swap(recipient common.Address, zeroForOne bool, amountSpecified *big.Int, sqrtPriceLimitX96 *big.Int, data []byte) (*types.Transaction, error) { return _Pool.Contract.Swap(&_Pool.TransactOpts, recipient, zeroForOne, amountSpecified, sqrtPriceLimitX96, data) } // PoolBurnIterator is returned from FilterBurn and is used to iterate over the raw logs and unpacked data for Burn events raised by the Pool contract. type PoolBurnIterator struct { Event *PoolBurn // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *PoolBurnIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(PoolBurn) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(PoolBurn) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *PoolBurnIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *PoolBurnIterator) Close() error { it.sub.Unsubscribe() return nil } // PoolBurn represents a Burn event raised by the Pool contract. type PoolBurn struct { Owner common.Address TickLower *big.Int TickUpper *big.Int Amount *big.Int Amount0 *big.Int Amount1 *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterBurn is a free log retrieval operation binding the contract event 0x0c396cd989a39f4459b5fa1aed6a9a8dcdbc45908acfd67e028cd568da98982c. // // Solidity: event Burn(address indexed owner, int24 indexed tickLower, int24 indexed tickUpper, uint128 amount, uint256 amount0, uint256 amount1) func (_Pool *PoolFilterer) FilterBurn(opts *bind.FilterOpts, owner []common.Address, tickLower []*big.Int, tickUpper []*big.Int) (*PoolBurnIterator, error) { var ownerRule []interface{} for _, ownerItem := range owner { ownerRule = append(ownerRule, ownerItem) } var tickLowerRule []interface{} for _, tickLowerItem := range tickLower { tickLowerRule = append(tickLowerRule, tickLowerItem) } var tickUpperRule []interface{} for _, tickUpperItem := range tickUpper { tickUpperRule = append(tickUpperRule, tickUpperItem) } logs, sub, err := _Pool.contract.FilterLogs(opts, "Burn", ownerRule, tickLowerRule, tickUpperRule) if err != nil { return nil, err } return &PoolBurnIterator{contract: _Pool.contract, event: "Burn", logs: logs, sub: sub}, nil } // WatchBurn is a free log subscription operation binding the contract event 0x0c396cd989a39f4459b5fa1aed6a9a8dcdbc45908acfd67e028cd568da98982c. // // Solidity: event Burn(address indexed owner, int24 indexed tickLower, int24 indexed tickUpper, uint128 amount, uint256 amount0, uint256 amount1) func (_Pool *PoolFilterer) WatchBurn(opts *bind.WatchOpts, sink chan<- *PoolBurn, owner []common.Address, tickLower []*big.Int, tickUpper []*big.Int) (event.Subscription, error) { var ownerRule []interface{} for _, ownerItem := range owner { ownerRule = append(ownerRule, ownerItem) } var tickLowerRule []interface{} for _, tickLowerItem := range tickLower { tickLowerRule = append(tickLowerRule, tickLowerItem) } var tickUpperRule []interface{} for _, tickUpperItem := range tickUpper { tickUpperRule = append(tickUpperRule, tickUpperItem) } logs, sub, err := _Pool.contract.WatchLogs(opts, "Burn", ownerRule, tickLowerRule, tickUpperRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(PoolBurn) if err := _Pool.contract.UnpackLog(event, "Burn", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseBurn is a log parse operation binding the contract event 0x0c396cd989a39f4459b5fa1aed6a9a8dcdbc45908acfd67e028cd568da98982c. // // Solidity: event Burn(address indexed owner, int24 indexed tickLower, int24 indexed tickUpper, uint128 amount, uint256 amount0, uint256 amount1) func (_Pool *PoolFilterer) ParseBurn(log types.Log) (*PoolBurn, error) { event := new(PoolBurn) if err := _Pool.contract.UnpackLog(event, "Burn", log); err != nil { return nil, err } event.Raw = log return event, nil } // PoolCollectIterator is returned from FilterCollect and is used to iterate over the raw logs and unpacked data for Collect events raised by the Pool contract. type PoolCollectIterator struct { Event *PoolCollect // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *PoolCollectIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(PoolCollect) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(PoolCollect) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *PoolCollectIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *PoolCollectIterator) Close() error { it.sub.Unsubscribe() return nil } // PoolCollect represents a Collect event raised by the Pool contract. type PoolCollect struct { Owner common.Address Recipient common.Address TickLower *big.Int TickUpper *big.Int Amount0 *big.Int Amount1 *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterCollect is a free log retrieval operation binding the contract event 0x70935338e69775456a85ddef226c395fb668b63fa0115f5f20610b388e6ca9c0. // // Solidity: event Collect(address indexed owner, address recipient, int24 indexed tickLower, int24 indexed tickUpper, uint128 amount0, uint128 amount1) func (_Pool *PoolFilterer) FilterCollect(opts *bind.FilterOpts, owner []common.Address, tickLower []*big.Int, tickUpper []*big.Int) (*PoolCollectIterator, error) { var ownerRule []interface{} for _, ownerItem := range owner { ownerRule = append(ownerRule, ownerItem) } var tickLowerRule []interface{} for _, tickLowerItem := range tickLower { tickLowerRule = append(tickLowerRule, tickLowerItem) } var tickUpperRule []interface{} for _, tickUpperItem := range tickUpper { tickUpperRule = append(tickUpperRule, tickUpperItem) } logs, sub, err := _Pool.contract.FilterLogs(opts, "Collect", ownerRule, tickLowerRule, tickUpperRule) if err != nil { return nil, err } return &PoolCollectIterator{contract: _Pool.contract, event: "Collect", logs: logs, sub: sub}, nil } // WatchCollect is a free log subscription operation binding the contract event 0x70935338e69775456a85ddef226c395fb668b63fa0115f5f20610b388e6ca9c0. // // Solidity: event Collect(address indexed owner, address recipient, int24 indexed tickLower, int24 indexed tickUpper, uint128 amount0, uint128 amount1) func (_Pool *PoolFilterer) WatchCollect(opts *bind.WatchOpts, sink chan<- *PoolCollect, owner []common.Address, tickLower []*big.Int, tickUpper []*big.Int) (event.Subscription, error) { var ownerRule []interface{} for _, ownerItem := range owner { ownerRule = append(ownerRule, ownerItem) } var tickLowerRule []interface{} for _, tickLowerItem := range tickLower { tickLowerRule = append(tickLowerRule, tickLowerItem) } var tickUpperRule []interface{} for _, tickUpperItem := range tickUpper { tickUpperRule = append(tickUpperRule, tickUpperItem) } logs, sub, err := _Pool.contract.WatchLogs(opts, "Collect", ownerRule, tickLowerRule, tickUpperRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(PoolCollect) if err := _Pool.contract.UnpackLog(event, "Collect", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseCollect is a log parse operation binding the contract event 0x70935338e69775456a85ddef226c395fb668b63fa0115f5f20610b388e6ca9c0. // // Solidity: event Collect(address indexed owner, address recipient, int24 indexed tickLower, int24 indexed tickUpper, uint128 amount0, uint128 amount1) func (_Pool *PoolFilterer) ParseCollect(log types.Log) (*PoolCollect, error) { event := new(PoolCollect) if err := _Pool.contract.UnpackLog(event, "Collect", log); err != nil { return nil, err } event.Raw = log return event, nil } // PoolCollectProtocolIterator is returned from FilterCollectProtocol and is used to iterate over the raw logs and unpacked data for CollectProtocol events raised by the Pool contract. type PoolCollectProtocolIterator struct { Event *PoolCollectProtocol // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *PoolCollectProtocolIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(PoolCollectProtocol) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(PoolCollectProtocol) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *PoolCollectProtocolIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *PoolCollectProtocolIterator) Close() error { it.sub.Unsubscribe() return nil } // PoolCollectProtocol represents a CollectProtocol event raised by the Pool contract. type PoolCollectProtocol struct { Sender common.Address Recipient common.Address Amount0 *big.Int Amount1 *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterCollectProtocol is a free log retrieval operation binding the contract event 0x596b573906218d3411850b26a6b437d6c4522fdb43d2d2386263f86d50b8b151. // // Solidity: event CollectProtocol(address indexed sender, address indexed recipient, uint128 amount0, uint128 amount1) func (_Pool *PoolFilterer) FilterCollectProtocol(opts *bind.FilterOpts, sender []common.Address, recipient []common.Address) (*PoolCollectProtocolIterator, error) { var senderRule []interface{} for _, senderItem := range sender { senderRule = append(senderRule, senderItem) } var recipientRule []interface{} for _, recipientItem := range recipient { recipientRule = append(recipientRule, recipientItem) } logs, sub, err := _Pool.contract.FilterLogs(opts, "CollectProtocol", senderRule, recipientRule) if err != nil { return nil, err } return &PoolCollectProtocolIterator{contract: _Pool.contract, event: "CollectProtocol", logs: logs, sub: sub}, nil } // WatchCollectProtocol is a free log subscription operation binding the contract event 0x596b573906218d3411850b26a6b437d6c4522fdb43d2d2386263f86d50b8b151. // // Solidity: event CollectProtocol(address indexed sender, address indexed recipient, uint128 amount0, uint128 amount1) func (_Pool *PoolFilterer) WatchCollectProtocol(opts *bind.WatchOpts, sink chan<- *PoolCollectProtocol, sender []common.Address, recipient []common.Address) (event.Subscription, error) { var senderRule []interface{} for _, senderItem := range sender { senderRule = append(senderRule, senderItem) } var recipientRule []interface{} for _, recipientItem := range recipient { recipientRule = append(recipientRule, recipientItem) } logs, sub, err := _Pool.contract.WatchLogs(opts, "CollectProtocol", senderRule, recipientRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(PoolCollectProtocol) if err := _Pool.contract.UnpackLog(event, "CollectProtocol", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseCollectProtocol is a log parse operation binding the contract event 0x596b573906218d3411850b26a6b437d6c4522fdb43d2d2386263f86d50b8b151. // // Solidity: event CollectProtocol(address indexed sender, address indexed recipient, uint128 amount0, uint128 amount1) func (_Pool *PoolFilterer) ParseCollectProtocol(log types.Log) (*PoolCollectProtocol, error) { event := new(PoolCollectProtocol) if err := _Pool.contract.UnpackLog(event, "CollectProtocol", log); err != nil { return nil, err } event.Raw = log return event, nil } // PoolFlashIterator is returned from FilterFlash and is used to iterate over the raw logs and unpacked data for Flash events raised by the Pool contract. type PoolFlashIterator struct { Event *PoolFlash // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *PoolFlashIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(PoolFlash) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(PoolFlash) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *PoolFlashIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *PoolFlashIterator) Close() error { it.sub.Unsubscribe() return nil } // PoolFlash represents a Flash event raised by the Pool contract. type PoolFlash struct { Sender common.Address Recipient common.Address Amount0 *big.Int Amount1 *big.Int Paid0 *big.Int Paid1 *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterFlash is a free log retrieval operation binding the contract event 0xbdbdb71d7860376ba52b25a5028beea23581364a40522f6bcfb86bb1f2dca633. // // Solidity: event Flash(address indexed sender, address indexed recipient, uint256 amount0, uint256 amount1, uint256 paid0, uint256 paid1) func (_Pool *PoolFilterer) FilterFlash(opts *bind.FilterOpts, sender []common.Address, recipient []common.Address) (*PoolFlashIterator, error) { var senderRule []interface{} for _, senderItem := range sender { senderRule = append(senderRule, senderItem) } var recipientRule []interface{} for _, recipientItem := range recipient { recipientRule = append(recipientRule, recipientItem) } logs, sub, err := _Pool.contract.FilterLogs(opts, "Flash", senderRule, recipientRule) if err != nil { return nil, err } return &PoolFlashIterator{contract: _Pool.contract, event: "Flash", logs: logs, sub: sub}, nil } // WatchFlash is a free log subscription operation binding the contract event 0xbdbdb71d7860376ba52b25a5028beea23581364a40522f6bcfb86bb1f2dca633. // // Solidity: event Flash(address indexed sender, address indexed recipient, uint256 amount0, uint256 amount1, uint256 paid0, uint256 paid1) func (_Pool *PoolFilterer) WatchFlash(opts *bind.WatchOpts, sink chan<- *PoolFlash, sender []common.Address, recipient []common.Address) (event.Subscription, error) { var senderRule []interface{} for _, senderItem := range sender { senderRule = append(senderRule, senderItem) } var recipientRule []interface{} for _, recipientItem := range recipient { recipientRule = append(recipientRule, recipientItem) } logs, sub, err := _Pool.contract.WatchLogs(opts, "Flash", senderRule, recipientRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(PoolFlash) if err := _Pool.contract.UnpackLog(event, "Flash", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseFlash is a log parse operation binding the contract event 0xbdbdb71d7860376ba52b25a5028beea23581364a40522f6bcfb86bb1f2dca633. // // Solidity: event Flash(address indexed sender, address indexed recipient, uint256 amount0, uint256 amount1, uint256 paid0, uint256 paid1) func (_Pool *PoolFilterer) ParseFlash(log types.Log) (*PoolFlash, error) { event := new(PoolFlash) if err := _Pool.contract.UnpackLog(event, "Flash", log); err != nil { return nil, err } event.Raw = log return event, nil } // PoolIncreaseObservationCardinalityNextIterator is returned from FilterIncreaseObservationCardinalityNext and is used to iterate over the raw logs and unpacked data for IncreaseObservationCardinalityNext events raised by the Pool contract. type PoolIncreaseObservationCardinalityNextIterator struct { Event *PoolIncreaseObservationCardinalityNext // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *PoolIncreaseObservationCardinalityNextIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(PoolIncreaseObservationCardinalityNext) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(PoolIncreaseObservationCardinalityNext) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *PoolIncreaseObservationCardinalityNextIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *PoolIncreaseObservationCardinalityNextIterator) Close() error { it.sub.Unsubscribe() return nil } // PoolIncreaseObservationCardinalityNext represents a IncreaseObservationCardinalityNext event raised by the Pool contract. type PoolIncreaseObservationCardinalityNext struct { ObservationCardinalityNextOld uint16 ObservationCardinalityNextNew uint16 Raw types.Log // Blockchain specific contextual infos } // FilterIncreaseObservationCardinalityNext is a free log retrieval operation binding the contract event 0xac49e518f90a358f652e4400164f05a5d8f7e35e7747279bc3a93dbf584e125a. // // Solidity: event IncreaseObservationCardinalityNext(uint16 observationCardinalityNextOld, uint16 observationCardinalityNextNew) func (_Pool *PoolFilterer) FilterIncreaseObservationCardinalityNext(opts *bind.FilterOpts) (*PoolIncreaseObservationCardinalityNextIterator, error) { logs, sub, err := _Pool.contract.FilterLogs(opts, "IncreaseObservationCardinalityNext") if err != nil { return nil, err } return &PoolIncreaseObservationCardinalityNextIterator{contract: _Pool.contract, event: "IncreaseObservationCardinalityNext", logs: logs, sub: sub}, nil } // WatchIncreaseObservationCardinalityNext is a free log subscription operation binding the contract event 0xac49e518f90a358f652e4400164f05a5d8f7e35e7747279bc3a93dbf584e125a. // // Solidity: event IncreaseObservationCardinalityNext(uint16 observationCardinalityNextOld, uint16 observationCardinalityNextNew) func (_Pool *PoolFilterer) WatchIncreaseObservationCardinalityNext(opts *bind.WatchOpts, sink chan<- *PoolIncreaseObservationCardinalityNext) (event.Subscription, error) { logs, sub, err := _Pool.contract.WatchLogs(opts, "IncreaseObservationCardinalityNext") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(PoolIncreaseObservationCardinalityNext) if err := _Pool.contract.UnpackLog(event, "IncreaseObservationCardinalityNext", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseIncreaseObservationCardinalityNext is a log parse operation binding the contract event 0xac49e518f90a358f652e4400164f05a5d8f7e35e7747279bc3a93dbf584e125a. // // Solidity: event IncreaseObservationCardinalityNext(uint16 observationCardinalityNextOld, uint16 observationCardinalityNextNew) func (_Pool *PoolFilterer) ParseIncreaseObservationCardinalityNext(log types.Log) (*PoolIncreaseObservationCardinalityNext, error) { event := new(PoolIncreaseObservationCardinalityNext) if err := _Pool.contract.UnpackLog(event, "IncreaseObservationCardinalityNext", log); err != nil { return nil, err } event.Raw = log return event, nil } // PoolInitializeIterator is returned from FilterInitialize and is used to iterate over the raw logs and unpacked data for Initialize events raised by the Pool contract. type PoolInitializeIterator struct { Event *PoolInitialize // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *PoolInitializeIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(PoolInitialize) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(PoolInitialize) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *PoolInitializeIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *PoolInitializeIterator) Close() error { it.sub.Unsubscribe() return nil } // PoolInitialize represents a Initialize event raised by the Pool contract. type PoolInitialize struct { SqrtPriceX96 *big.Int Tick *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterInitialize is a free log retrieval operation binding the contract event 0x98636036cb66a9c19a37435efc1e90142190214e8abeb821bdba3f2990dd4c95. // // Solidity: event Initialize(uint160 sqrtPriceX96, int24 tick) func (_Pool *PoolFilterer) FilterInitialize(opts *bind.FilterOpts) (*PoolInitializeIterator, error) { logs, sub, err := _Pool.contract.FilterLogs(opts, "Initialize") if err != nil { return nil, err } return &PoolInitializeIterator{contract: _Pool.contract, event: "Initialize", logs: logs, sub: sub}, nil } // WatchInitialize is a free log subscription operation binding the contract event 0x98636036cb66a9c19a37435efc1e90142190214e8abeb821bdba3f2990dd4c95. // // Solidity: event Initialize(uint160 sqrtPriceX96, int24 tick) func (_Pool *PoolFilterer) WatchInitialize(opts *bind.WatchOpts, sink chan<- *PoolInitialize) (event.Subscription, error) { logs, sub, err := _Pool.contract.WatchLogs(opts, "Initialize") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(PoolInitialize) if err := _Pool.contract.UnpackLog(event, "Initialize", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseInitialize is a log parse operation binding the contract event 0x98636036cb66a9c19a37435efc1e90142190214e8abeb821bdba3f2990dd4c95. // // Solidity: event Initialize(uint160 sqrtPriceX96, int24 tick) func (_Pool *PoolFilterer) ParseInitialize(log types.Log) (*PoolInitialize, error) { event := new(PoolInitialize) if err := _Pool.contract.UnpackLog(event, "Initialize", log); err != nil { return nil, err } event.Raw = log return event, nil } // PoolMintIterator is returned from FilterMint and is used to iterate over the raw logs and unpacked data for Mint events raised by the Pool contract. type PoolMintIterator struct { Event *PoolMint // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *PoolMintIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(PoolMint) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(PoolMint) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *PoolMintIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *PoolMintIterator) Close() error { it.sub.Unsubscribe() return nil } // PoolMint represents a Mint event raised by the Pool contract. type PoolMint struct { Sender common.Address Owner common.Address TickLower *big.Int TickUpper *big.Int Amount *big.Int Amount0 *big.Int Amount1 *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterMint is a free log retrieval operation binding the contract event 0x7a53080ba414158be7ec69b987b5fb7d07dee101fe85488f0853ae16239d0bde. // // Solidity: event Mint(address sender, address indexed owner, int24 indexed tickLower, int24 indexed tickUpper, uint128 amount, uint256 amount0, uint256 amount1) func (_Pool *PoolFilterer) FilterMint(opts *bind.FilterOpts, owner []common.Address, tickLower []*big.Int, tickUpper []*big.Int) (*PoolMintIterator, error) { var ownerRule []interface{} for _, ownerItem := range owner { ownerRule = append(ownerRule, ownerItem) } var tickLowerRule []interface{} for _, tickLowerItem := range tickLower { tickLowerRule = append(tickLowerRule, tickLowerItem) } var tickUpperRule []interface{} for _, tickUpperItem := range tickUpper { tickUpperRule = append(tickUpperRule, tickUpperItem) } logs, sub, err := _Pool.contract.FilterLogs(opts, "Mint", ownerRule, tickLowerRule, tickUpperRule) if err != nil { return nil, err } return &PoolMintIterator{contract: _Pool.contract, event: "Mint", logs: logs, sub: sub}, nil } // WatchMint is a free log subscription operation binding the contract event 0x7a53080ba414158be7ec69b987b5fb7d07dee101fe85488f0853ae16239d0bde. // // Solidity: event Mint(address sender, address indexed owner, int24 indexed tickLower, int24 indexed tickUpper, uint128 amount, uint256 amount0, uint256 amount1) func (_Pool *PoolFilterer) WatchMint(opts *bind.WatchOpts, sink chan<- *PoolMint, owner []common.Address, tickLower []*big.Int, tickUpper []*big.Int) (event.Subscription, error) { var ownerRule []interface{} for _, ownerItem := range owner { ownerRule = append(ownerRule, ownerItem) } var tickLowerRule []interface{} for _, tickLowerItem := range tickLower { tickLowerRule = append(tickLowerRule, tickLowerItem) } var tickUpperRule []interface{} for _, tickUpperItem := range tickUpper { tickUpperRule = append(tickUpperRule, tickUpperItem) } logs, sub, err := _Pool.contract.WatchLogs(opts, "Mint", ownerRule, tickLowerRule, tickUpperRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(PoolMint) if err := _Pool.contract.UnpackLog(event, "Mint", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseMint is a log parse operation binding the contract event 0x7a53080ba414158be7ec69b987b5fb7d07dee101fe85488f0853ae16239d0bde. // // Solidity: event Mint(address sender, address indexed owner, int24 indexed tickLower, int24 indexed tickUpper, uint128 amount, uint256 amount0, uint256 amount1) func (_Pool *PoolFilterer) ParseMint(log types.Log) (*PoolMint, error) { event := new(PoolMint) if err := _Pool.contract.UnpackLog(event, "Mint", log); err != nil { return nil, err } event.Raw = log return event, nil } // PoolSetFeeProtocolIterator is returned from FilterSetFeeProtocol and is used to iterate over the raw logs and unpacked data for SetFeeProtocol events raised by the Pool contract. type PoolSetFeeProtocolIterator struct { Event *PoolSetFeeProtocol // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *PoolSetFeeProtocolIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(PoolSetFeeProtocol) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(PoolSetFeeProtocol) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *PoolSetFeeProtocolIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *PoolSetFeeProtocolIterator) Close() error { it.sub.Unsubscribe() return nil } // PoolSetFeeProtocol represents a SetFeeProtocol event raised by the Pool contract. type PoolSetFeeProtocol struct { FeeProtocol0Old uint32 FeeProtocol1Old uint32 FeeProtocol0New uint32 FeeProtocol1New uint32 Raw types.Log // Blockchain specific contextual infos } // FilterSetFeeProtocol is a free log retrieval operation binding the contract event 0xb3159fed3ddfba67bae294599eafe2d0ec98c08bb38e0e5fb87d33154b6e05aa. // // Solidity: event SetFeeProtocol(uint32 feeProtocol0Old, uint32 feeProtocol1Old, uint32 feeProtocol0New, uint32 feeProtocol1New) func (_Pool *PoolFilterer) FilterSetFeeProtocol(opts *bind.FilterOpts) (*PoolSetFeeProtocolIterator, error) { logs, sub, err := _Pool.contract.FilterLogs(opts, "SetFeeProtocol") if err != nil { return nil, err } return &PoolSetFeeProtocolIterator{contract: _Pool.contract, event: "SetFeeProtocol", logs: logs, sub: sub}, nil } // WatchSetFeeProtocol is a free log subscription operation binding the contract event 0xb3159fed3ddfba67bae294599eafe2d0ec98c08bb38e0e5fb87d33154b6e05aa. // // Solidity: event SetFeeProtocol(uint32 feeProtocol0Old, uint32 feeProtocol1Old, uint32 feeProtocol0New, uint32 feeProtocol1New) func (_Pool *PoolFilterer) WatchSetFeeProtocol(opts *bind.WatchOpts, sink chan<- *PoolSetFeeProtocol) (event.Subscription, error) { logs, sub, err := _Pool.contract.WatchLogs(opts, "SetFeeProtocol") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(PoolSetFeeProtocol) if err := _Pool.contract.UnpackLog(event, "SetFeeProtocol", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseSetFeeProtocol is a log parse operation binding the contract event 0xb3159fed3ddfba67bae294599eafe2d0ec98c08bb38e0e5fb87d33154b6e05aa. // // Solidity: event SetFeeProtocol(uint32 feeProtocol0Old, uint32 feeProtocol1Old, uint32 feeProtocol0New, uint32 feeProtocol1New) func (_Pool *PoolFilterer) ParseSetFeeProtocol(log types.Log) (*PoolSetFeeProtocol, error) { event := new(PoolSetFeeProtocol) if err := _Pool.contract.UnpackLog(event, "SetFeeProtocol", log); err != nil { return nil, err } event.Raw = log return event, nil } // PoolSetLmPoolEventIterator is returned from FilterSetLmPoolEvent and is used to iterate over the raw logs and unpacked data for SetLmPoolEvent events raised by the Pool contract. type PoolSetLmPoolEventIterator struct { Event *PoolSetLmPoolEvent // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *PoolSetLmPoolEventIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(PoolSetLmPoolEvent) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(PoolSetLmPoolEvent) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *PoolSetLmPoolEventIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *PoolSetLmPoolEventIterator) Close() error { it.sub.Unsubscribe() return nil } // PoolSetLmPoolEvent represents a SetLmPoolEvent event raised by the Pool contract. type PoolSetLmPoolEvent struct { Addr common.Address Raw types.Log // Blockchain specific contextual infos } // FilterSetLmPoolEvent is a free log retrieval operation binding the contract event 0x29983690a85a11696ce8a357993744f8d5a74fde14653e517cc2f8608a7235e9. // // Solidity: event SetLmPoolEvent(address addr) func (_Pool *PoolFilterer) FilterSetLmPoolEvent(opts *bind.FilterOpts) (*PoolSetLmPoolEventIterator, error) { logs, sub, err := _Pool.contract.FilterLogs(opts, "SetLmPoolEvent") if err != nil { return nil, err } return &PoolSetLmPoolEventIterator{contract: _Pool.contract, event: "SetLmPoolEvent", logs: logs, sub: sub}, nil } // WatchSetLmPoolEvent is a free log subscription operation binding the contract event 0x29983690a85a11696ce8a357993744f8d5a74fde14653e517cc2f8608a7235e9. // // Solidity: event SetLmPoolEvent(address addr) func (_Pool *PoolFilterer) WatchSetLmPoolEvent(opts *bind.WatchOpts, sink chan<- *PoolSetLmPoolEvent) (event.Subscription, error) { logs, sub, err := _Pool.contract.WatchLogs(opts, "SetLmPoolEvent") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(PoolSetLmPoolEvent) if err := _Pool.contract.UnpackLog(event, "SetLmPoolEvent", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseSetLmPoolEvent is a log parse operation binding the contract event 0x29983690a85a11696ce8a357993744f8d5a74fde14653e517cc2f8608a7235e9. // // Solidity: event SetLmPoolEvent(address addr) func (_Pool *PoolFilterer) ParseSetLmPoolEvent(log types.Log) (*PoolSetLmPoolEvent, error) { event := new(PoolSetLmPoolEvent) if err := _Pool.contract.UnpackLog(event, "SetLmPoolEvent", log); err != nil { return nil, err } event.Raw = log return event, nil } // PoolSwapIterator is returned from FilterSwap and is used to iterate over the raw logs and unpacked data for Swap events raised by the Pool contract. type PoolSwapIterator struct { Event *PoolSwap // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *PoolSwapIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(PoolSwap) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(PoolSwap) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *PoolSwapIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *PoolSwapIterator) Close() error { it.sub.Unsubscribe() return nil } // PoolSwap represents a Swap event raised by the Pool contract. type PoolSwap struct { Sender common.Address Recipient common.Address Amount0 *big.Int Amount1 *big.Int SqrtPriceX96 *big.Int Liquidity *big.Int Tick *big.Int ProtocolFeesToken0 *big.Int ProtocolFeesToken1 *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterSwap is a free log retrieval operation binding the contract event 0x19b47279256b2a23a1665c810c8d55a1758940ee09377d4f8d26497a3577dc83. // // Solidity: event Swap(address indexed sender, address indexed recipient, int256 amount0, int256 amount1, uint160 sqrtPriceX96, uint128 liquidity, int24 tick, uint128 protocolFeesToken0, uint128 protocolFeesToken1) func (_Pool *PoolFilterer) FilterSwap(opts *bind.FilterOpts, sender []common.Address, recipient []common.Address) (*PoolSwapIterator, error) { var senderRule []interface{} for _, senderItem := range sender { senderRule = append(senderRule, senderItem) } var recipientRule []interface{} for _, recipientItem := range recipient { recipientRule = append(recipientRule, recipientItem) } logs, sub, err := _Pool.contract.FilterLogs(opts, "Swap", senderRule, recipientRule) if err != nil { return nil, err } return &PoolSwapIterator{contract: _Pool.contract, event: "Swap", logs: logs, sub: sub}, nil } // WatchSwap is a free log subscription operation binding the contract event 0x19b47279256b2a23a1665c810c8d55a1758940ee09377d4f8d26497a3577dc83. // // Solidity: event Swap(address indexed sender, address indexed recipient, int256 amount0, int256 amount1, uint160 sqrtPriceX96, uint128 liquidity, int24 tick, uint128 protocolFeesToken0, uint128 protocolFeesToken1) func (_Pool *PoolFilterer) WatchSwap(opts *bind.WatchOpts, sink chan<- *PoolSwap, sender []common.Address, recipient []common.Address) (event.Subscription, error) { var senderRule []interface{} for _, senderItem := range sender { senderRule = append(senderRule, senderItem) } var recipientRule []interface{} for _, recipientItem := range recipient { recipientRule = append(recipientRule, recipientItem) } logs, sub, err := _Pool.contract.WatchLogs(opts, "Swap", senderRule, recipientRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(PoolSwap) if err := _Pool.contract.UnpackLog(event, "Swap", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseSwap is a log parse operation binding the contract event 0x19b47279256b2a23a1665c810c8d55a1758940ee09377d4f8d26497a3577dc83. // // Solidity: event Swap(address indexed sender, address indexed recipient, int256 amount0, int256 amount1, uint160 sqrtPriceX96, uint128 liquidity, int24 tick, uint128 protocolFeesToken0, uint128 protocolFeesToken1) func (_Pool *PoolFilterer) ParseSwap(log types.Log) (*PoolSwap, error) { event := new(PoolSwap) if err := _Pool.contract.UnpackLog(event, "Swap", log); err != nil { return nil, err } event.Raw = log return event, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/binds/bscpool/abi.json ================================================ [ { "inputs": [], "stateMutability": "nonpayable", "type": "constructor" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "owner", "type": "address" }, { "indexed": true, "internalType": "int24", "name": "tickLower", "type": "int24" }, { "indexed": true, "internalType": "int24", "name": "tickUpper", "type": "int24" }, { "indexed": false, "internalType": "uint128", "name": "amount", "type": "uint128" }, { "indexed": false, "internalType": "uint256", "name": "amount0", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "amount1", "type": "uint256" } ], "name": "Burn", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "owner", "type": "address" }, { "indexed": false, "internalType": "address", "name": "recipient", "type": "address" }, { "indexed": true, "internalType": "int24", "name": "tickLower", "type": "int24" }, { "indexed": true, "internalType": "int24", "name": "tickUpper", "type": "int24" }, { "indexed": false, "internalType": "uint128", "name": "amount0", "type": "uint128" }, { "indexed": false, "internalType": "uint128", "name": "amount1", "type": "uint128" } ], "name": "Collect", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "sender", "type": "address" }, { "indexed": true, "internalType": "address", "name": "recipient", "type": "address" }, { "indexed": false, "internalType": "uint128", "name": "amount0", "type": "uint128" }, { "indexed": false, "internalType": "uint128", "name": "amount1", "type": "uint128" } ], "name": "CollectProtocol", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "sender", "type": "address" }, { "indexed": true, "internalType": "address", "name": "recipient", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "amount0", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "amount1", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "paid0", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "paid1", "type": "uint256" } ], "name": "Flash", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "uint16", "name": "observationCardinalityNextOld", "type": "uint16" }, { "indexed": false, "internalType": "uint16", "name": "observationCardinalityNextNew", "type": "uint16" } ], "name": "IncreaseObservationCardinalityNext", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "uint160", "name": "sqrtPriceX96", "type": "uint160" }, { "indexed": false, "internalType": "int24", "name": "tick", "type": "int24" } ], "name": "Initialize", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "address", "name": "sender", "type": "address" }, { "indexed": true, "internalType": "address", "name": "owner", "type": "address" }, { "indexed": true, "internalType": "int24", "name": "tickLower", "type": "int24" }, { "indexed": true, "internalType": "int24", "name": "tickUpper", "type": "int24" }, { "indexed": false, "internalType": "uint128", "name": "amount", "type": "uint128" }, { "indexed": false, "internalType": "uint256", "name": "amount0", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "amount1", "type": "uint256" } ], "name": "Mint", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "uint32", "name": "feeProtocol0Old", "type": "uint32" }, { "indexed": false, "internalType": "uint32", "name": "feeProtocol1Old", "type": "uint32" }, { "indexed": false, "internalType": "uint32", "name": "feeProtocol0New", "type": "uint32" }, { "indexed": false, "internalType": "uint32", "name": "feeProtocol1New", "type": "uint32" } ], "name": "SetFeeProtocol", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "address", "name": "addr", "type": "address" } ], "name": "SetLmPoolEvent", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "sender", "type": "address" }, { "indexed": true, "internalType": "address", "name": "recipient", "type": "address" }, { "indexed": false, "internalType": "int256", "name": "amount0", "type": "int256" }, { "indexed": false, "internalType": "int256", "name": "amount1", "type": "int256" }, { "indexed": false, "internalType": "uint160", "name": "sqrtPriceX96", "type": "uint160" }, { "indexed": false, "internalType": "uint128", "name": "liquidity", "type": "uint128" }, { "indexed": false, "internalType": "int24", "name": "tick", "type": "int24" }, { "indexed": false, "internalType": "uint128", "name": "protocolFeesToken0", "type": "uint128" }, { "indexed": false, "internalType": "uint128", "name": "protocolFeesToken1", "type": "uint128" } ], "name": "Swap", "type": "event" }, { "inputs": [ { "internalType": "int24", "name": "tickLower", "type": "int24" }, { "internalType": "int24", "name": "tickUpper", "type": "int24" }, { "internalType": "uint128", "name": "amount", "type": "uint128" } ], "name": "burn", "outputs": [ { "internalType": "uint256", "name": "amount0", "type": "uint256" }, { "internalType": "uint256", "name": "amount1", "type": "uint256" } ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "recipient", "type": "address" }, { "internalType": "int24", "name": "tickLower", "type": "int24" }, { "internalType": "int24", "name": "tickUpper", "type": "int24" }, { "internalType": "uint128", "name": "amount0Requested", "type": "uint128" }, { "internalType": "uint128", "name": "amount1Requested", "type": "uint128" } ], "name": "collect", "outputs": [ { "internalType": "uint128", "name": "amount0", "type": "uint128" }, { "internalType": "uint128", "name": "amount1", "type": "uint128" } ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "recipient", "type": "address" }, { "internalType": "uint128", "name": "amount0Requested", "type": "uint128" }, { "internalType": "uint128", "name": "amount1Requested", "type": "uint128" } ], "name": "collectProtocol", "outputs": [ { "internalType": "uint128", "name": "amount0", "type": "uint128" }, { "internalType": "uint128", "name": "amount1", "type": "uint128" } ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "factory", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "fee", "outputs": [ { "internalType": "uint24", "name": "", "type": "uint24" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "feeGrowthGlobal0X128", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "feeGrowthGlobal1X128", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "recipient", "type": "address" }, { "internalType": "uint256", "name": "amount0", "type": "uint256" }, { "internalType": "uint256", "name": "amount1", "type": "uint256" }, { "internalType": "bytes", "name": "data", "type": "bytes" } ], "name": "flash", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint16", "name": "observationCardinalityNext", "type": "uint16" } ], "name": "increaseObservationCardinalityNext", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint160", "name": "sqrtPriceX96", "type": "uint160" } ], "name": "initialize", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "liquidity", "outputs": [ { "internalType": "uint128", "name": "", "type": "uint128" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "lmPool", "outputs": [ { "internalType": "contract IPancakeV3LmPool", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "maxLiquidityPerTick", "outputs": [ { "internalType": "uint128", "name": "", "type": "uint128" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "recipient", "type": "address" }, { "internalType": "int24", "name": "tickLower", "type": "int24" }, { "internalType": "int24", "name": "tickUpper", "type": "int24" }, { "internalType": "uint128", "name": "amount", "type": "uint128" }, { "internalType": "bytes", "name": "data", "type": "bytes" } ], "name": "mint", "outputs": [ { "internalType": "uint256", "name": "amount0", "type": "uint256" }, { "internalType": "uint256", "name": "amount1", "type": "uint256" } ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "name": "observations", "outputs": [ { "internalType": "uint32", "name": "blockTimestamp", "type": "uint32" }, { "internalType": "int56", "name": "tickCumulative", "type": "int56" }, { "internalType": "uint160", "name": "secondsPerLiquidityCumulativeX128", "type": "uint160" }, { "internalType": "bool", "name": "initialized", "type": "bool" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint32[]", "name": "secondsAgos", "type": "uint32[]" } ], "name": "observe", "outputs": [ { "internalType": "int56[]", "name": "tickCumulatives", "type": "int56[]" }, { "internalType": "uint160[]", "name": "secondsPerLiquidityCumulativeX128s", "type": "uint160[]" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "bytes32", "name": "", "type": "bytes32" } ], "name": "positions", "outputs": [ { "internalType": "uint128", "name": "liquidity", "type": "uint128" }, { "internalType": "uint256", "name": "feeGrowthInside0LastX128", "type": "uint256" }, { "internalType": "uint256", "name": "feeGrowthInside1LastX128", "type": "uint256" }, { "internalType": "uint128", "name": "tokensOwed0", "type": "uint128" }, { "internalType": "uint128", "name": "tokensOwed1", "type": "uint128" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "protocolFees", "outputs": [ { "internalType": "uint128", "name": "token0", "type": "uint128" }, { "internalType": "uint128", "name": "token1", "type": "uint128" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint32", "name": "feeProtocol0", "type": "uint32" }, { "internalType": "uint32", "name": "feeProtocol1", "type": "uint32" } ], "name": "setFeeProtocol", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "_lmPool", "type": "address" } ], "name": "setLmPool", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "slot0", "outputs": [ { "internalType": "uint160", "name": "sqrtPriceX96", "type": "uint160" }, { "internalType": "int24", "name": "tick", "type": "int24" }, { "internalType": "uint16", "name": "observationIndex", "type": "uint16" }, { "internalType": "uint16", "name": "observationCardinality", "type": "uint16" }, { "internalType": "uint16", "name": "observationCardinalityNext", "type": "uint16" }, { "internalType": "uint32", "name": "feeProtocol", "type": "uint32" }, { "internalType": "bool", "name": "unlocked", "type": "bool" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "int24", "name": "tickLower", "type": "int24" }, { "internalType": "int24", "name": "tickUpper", "type": "int24" } ], "name": "snapshotCumulativesInside", "outputs": [ { "internalType": "int56", "name": "tickCumulativeInside", "type": "int56" }, { "internalType": "uint160", "name": "secondsPerLiquidityInsideX128", "type": "uint160" }, { "internalType": "uint32", "name": "secondsInside", "type": "uint32" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "recipient", "type": "address" }, { "internalType": "bool", "name": "zeroForOne", "type": "bool" }, { "internalType": "int256", "name": "amountSpecified", "type": "int256" }, { "internalType": "uint160", "name": "sqrtPriceLimitX96", "type": "uint160" }, { "internalType": "bytes", "name": "data", "type": "bytes" } ], "name": "swap", "outputs": [ { "internalType": "int256", "name": "amount0", "type": "int256" }, { "internalType": "int256", "name": "amount1", "type": "int256" } ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "int16", "name": "", "type": "int16" } ], "name": "tickBitmap", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "tickSpacing", "outputs": [ { "internalType": "int24", "name": "", "type": "int24" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "int24", "name": "", "type": "int24" } ], "name": "ticks", "outputs": [ { "internalType": "uint128", "name": "liquidityGross", "type": "uint128" }, { "internalType": "int128", "name": "liquidityNet", "type": "int128" }, { "internalType": "uint256", "name": "feeGrowthOutside0X128", "type": "uint256" }, { "internalType": "uint256", "name": "feeGrowthOutside1X128", "type": "uint256" }, { "internalType": "int56", "name": "tickCumulativeOutside", "type": "int56" }, { "internalType": "uint160", "name": "secondsPerLiquidityOutsideX128", "type": "uint160" }, { "internalType": "uint32", "name": "secondsOutside", "type": "uint32" }, { "internalType": "bool", "name": "initialized", "type": "bool" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "token0", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "token1", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" } ] ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/binds/celononfungiblepositionmanager/NonfungiblePositionManager.go ================================================ // Code generated - DO NOT EDIT. // This file is a generated binding and any manual changes will be lost. package celononfungiblepositionmanager import ( "errors" "math/big" "strings" ethereum "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/event" ) // Reference imports to suppress errors if they are not otherwise used. var ( _ = errors.New _ = big.NewInt _ = strings.NewReader _ = ethereum.NotFound _ = bind.Bind _ = common.Big1 _ = types.BloomLookup _ = event.NewSubscription _ = abi.ConvertType ) // INonfungiblePositionManagerCollectParams is an auto generated low-level Go binding around an user-defined struct. type INonfungiblePositionManagerCollectParams struct { TokenId *big.Int Recipient common.Address Amount0Max *big.Int Amount1Max *big.Int } // INonfungiblePositionManagerDecreaseLiquidityParams is an auto generated low-level Go binding around an user-defined struct. type INonfungiblePositionManagerDecreaseLiquidityParams struct { TokenId *big.Int Liquidity *big.Int Amount0Min *big.Int Amount1Min *big.Int Deadline *big.Int } // INonfungiblePositionManagerIncreaseLiquidityParams is an auto generated low-level Go binding around an user-defined struct. type INonfungiblePositionManagerIncreaseLiquidityParams struct { TokenId *big.Int Amount0Desired *big.Int Amount1Desired *big.Int Amount0Min *big.Int Amount1Min *big.Int Deadline *big.Int } // INonfungiblePositionManagerMintParams is an auto generated low-level Go binding around an user-defined struct. type INonfungiblePositionManagerMintParams struct { Token0 common.Address Token1 common.Address Fee *big.Int TickLower *big.Int TickUpper *big.Int Amount0Desired *big.Int Amount1Desired *big.Int Amount0Min *big.Int Amount1Min *big.Int Recipient common.Address Deadline *big.Int } // NonfungiblePositionManagerMetaData contains all meta data concerning the NonfungiblePositionManager contract. var NonfungiblePositionManagerMetaData = &bind.MetaData{ ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_factory\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_WETH9\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_tokenDescriptor_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"approved\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"ApprovalForAll\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"}],\"name\":\"Collect\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"liquidity\",\"type\":\"uint128\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"}],\"name\":\"DecreaseLiquidity\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"liquidity\",\"type\":\"uint128\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"}],\"name\":\"IncreaseLiquidity\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"DOMAIN_SEPARATOR\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"PERMIT_TYPEHASH\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"WETH9\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"baseURI\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"burn\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint128\",\"name\":\"amount0Max\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"amount1Max\",\"type\":\"uint128\"}],\"internalType\":\"structINonfungiblePositionManager.CollectParams\",\"name\":\"params\",\"type\":\"tuple\"}],\"name\":\"collect\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token0\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token1\",\"type\":\"address\"},{\"internalType\":\"uint24\",\"name\":\"fee\",\"type\":\"uint24\"},{\"internalType\":\"uint160\",\"name\":\"sqrtPriceX96\",\"type\":\"uint160\"}],\"name\":\"createAndInitializePoolIfNecessary\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint128\",\"name\":\"liquidity\",\"type\":\"uint128\"},{\"internalType\":\"uint256\",\"name\":\"amount0Min\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Min\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"}],\"internalType\":\"structINonfungiblePositionManager.DecreaseLiquidityParams\",\"name\":\"params\",\"type\":\"tuple\"}],\"name\":\"decreaseLiquidity\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"factory\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"getApproved\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount0Desired\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Desired\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount0Min\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Min\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"}],\"internalType\":\"structINonfungiblePositionManager.IncreaseLiquidityParams\",\"name\":\"params\",\"type\":\"tuple\"}],\"name\":\"increaseLiquidity\",\"outputs\":[{\"internalType\":\"uint128\",\"name\":\"liquidity\",\"type\":\"uint128\"},{\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"name\":\"isApprovedForAll\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"token0\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token1\",\"type\":\"address\"},{\"internalType\":\"uint24\",\"name\":\"fee\",\"type\":\"uint24\"},{\"internalType\":\"int24\",\"name\":\"tickLower\",\"type\":\"int24\"},{\"internalType\":\"int24\",\"name\":\"tickUpper\",\"type\":\"int24\"},{\"internalType\":\"uint256\",\"name\":\"amount0Desired\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Desired\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount0Min\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Min\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"}],\"internalType\":\"structINonfungiblePositionManager.MintParams\",\"name\":\"params\",\"type\":\"tuple\"}],\"name\":\"mint\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint128\",\"name\":\"liquidity\",\"type\":\"uint128\"},{\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes[]\",\"name\":\"data\",\"type\":\"bytes[]\"}],\"name\":\"multicall\",\"outputs\":[{\"internalType\":\"bytes[]\",\"name\":\"results\",\"type\":\"bytes[]\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"ownerOf\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"permit\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"positions\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"nonce\",\"type\":\"uint96\"},{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token0\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token1\",\"type\":\"address\"},{\"internalType\":\"uint24\",\"name\":\"fee\",\"type\":\"uint24\"},{\"internalType\":\"int24\",\"name\":\"tickLower\",\"type\":\"int24\"},{\"internalType\":\"int24\",\"name\":\"tickUpper\",\"type\":\"int24\"},{\"internalType\":\"uint128\",\"name\":\"liquidity\",\"type\":\"uint128\"},{\"internalType\":\"uint256\",\"name\":\"feeGrowthInside0LastX128\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"feeGrowthInside1LastX128\",\"type\":\"uint256\"},{\"internalType\":\"uint128\",\"name\":\"tokensOwed0\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"tokensOwed1\",\"type\":\"uint128\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"refundETH\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"safeTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"safeTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"selfPermit\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiry\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"selfPermitAllowed\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiry\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"selfPermitAllowedIfNecessary\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"selfPermitIfNecessary\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"setApprovalForAll\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amountMinimum\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"}],\"name\":\"sweepToken\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"}],\"name\":\"tokenByIndex\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"}],\"name\":\"tokenOfOwnerByIndex\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"tokenURI\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0Owed\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Owed\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"uniswapV3MintCallback\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountMinimum\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"}],\"name\":\"unwrapWETH9\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]", } // NonfungiblePositionManagerABI is the input ABI used to generate the binding from. // Deprecated: Use NonfungiblePositionManagerMetaData.ABI instead. var NonfungiblePositionManagerABI = NonfungiblePositionManagerMetaData.ABI // NonfungiblePositionManager is an auto generated Go binding around an Ethereum contract. type NonfungiblePositionManager struct { NonfungiblePositionManagerCaller // Read-only binding to the contract NonfungiblePositionManagerTransactor // Write-only binding to the contract NonfungiblePositionManagerFilterer // Log filterer for contract events } // NonfungiblePositionManagerCaller is an auto generated read-only Go binding around an Ethereum contract. type NonfungiblePositionManagerCaller struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // NonfungiblePositionManagerTransactor is an auto generated write-only Go binding around an Ethereum contract. type NonfungiblePositionManagerTransactor struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // NonfungiblePositionManagerFilterer is an auto generated log filtering Go binding around an Ethereum contract events. type NonfungiblePositionManagerFilterer struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // NonfungiblePositionManagerSession is an auto generated Go binding around an Ethereum contract, // with pre-set call and transact options. type NonfungiblePositionManagerSession struct { Contract *NonfungiblePositionManager // Generic contract binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // NonfungiblePositionManagerCallerSession is an auto generated read-only Go binding around an Ethereum contract, // with pre-set call options. type NonfungiblePositionManagerCallerSession struct { Contract *NonfungiblePositionManagerCaller // Generic contract caller binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session } // NonfungiblePositionManagerTransactorSession is an auto generated write-only Go binding around an Ethereum contract, // with pre-set transact options. type NonfungiblePositionManagerTransactorSession struct { Contract *NonfungiblePositionManagerTransactor // Generic contract transactor binding to set the session for TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // NonfungiblePositionManagerRaw is an auto generated low-level Go binding around an Ethereum contract. type NonfungiblePositionManagerRaw struct { Contract *NonfungiblePositionManager // Generic contract binding to access the raw methods on } // NonfungiblePositionManagerCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. type NonfungiblePositionManagerCallerRaw struct { Contract *NonfungiblePositionManagerCaller // Generic read-only contract binding to access the raw methods on } // NonfungiblePositionManagerTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. type NonfungiblePositionManagerTransactorRaw struct { Contract *NonfungiblePositionManagerTransactor // Generic write-only contract binding to access the raw methods on } // NewNonfungiblePositionManager creates a new instance of NonfungiblePositionManager, bound to a specific deployed contract. func NewNonfungiblePositionManager(address common.Address, backend bind.ContractBackend) (*NonfungiblePositionManager, error) { contract, err := bindNonfungiblePositionManager(address, backend, backend, backend) if err != nil { return nil, err } return &NonfungiblePositionManager{NonfungiblePositionManagerCaller: NonfungiblePositionManagerCaller{contract: contract}, NonfungiblePositionManagerTransactor: NonfungiblePositionManagerTransactor{contract: contract}, NonfungiblePositionManagerFilterer: NonfungiblePositionManagerFilterer{contract: contract}}, nil } // NewNonfungiblePositionManagerCaller creates a new read-only instance of NonfungiblePositionManager, bound to a specific deployed contract. func NewNonfungiblePositionManagerCaller(address common.Address, caller bind.ContractCaller) (*NonfungiblePositionManagerCaller, error) { contract, err := bindNonfungiblePositionManager(address, caller, nil, nil) if err != nil { return nil, err } return &NonfungiblePositionManagerCaller{contract: contract}, nil } // NewNonfungiblePositionManagerTransactor creates a new write-only instance of NonfungiblePositionManager, bound to a specific deployed contract. func NewNonfungiblePositionManagerTransactor(address common.Address, transactor bind.ContractTransactor) (*NonfungiblePositionManagerTransactor, error) { contract, err := bindNonfungiblePositionManager(address, nil, transactor, nil) if err != nil { return nil, err } return &NonfungiblePositionManagerTransactor{contract: contract}, nil } // NewNonfungiblePositionManagerFilterer creates a new log filterer instance of NonfungiblePositionManager, bound to a specific deployed contract. func NewNonfungiblePositionManagerFilterer(address common.Address, filterer bind.ContractFilterer) (*NonfungiblePositionManagerFilterer, error) { contract, err := bindNonfungiblePositionManager(address, nil, nil, filterer) if err != nil { return nil, err } return &NonfungiblePositionManagerFilterer{contract: contract}, nil } // bindNonfungiblePositionManager binds a generic wrapper to an already deployed contract. func bindNonfungiblePositionManager(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { parsed, err := NonfungiblePositionManagerMetaData.GetAbi() if err != nil { return nil, err } return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_NonfungiblePositionManager *NonfungiblePositionManagerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _NonfungiblePositionManager.Contract.NonfungiblePositionManagerCaller.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_NonfungiblePositionManager *NonfungiblePositionManagerRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.NonfungiblePositionManagerTransactor.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_NonfungiblePositionManager *NonfungiblePositionManagerRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.NonfungiblePositionManagerTransactor.contract.Transact(opts, method, params...) } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _NonfungiblePositionManager.Contract.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.contract.Transact(opts, method, params...) } // DOMAINSEPARATOR is a free data retrieval call binding the contract method 0x3644e515. // // Solidity: function DOMAIN_SEPARATOR() view returns(bytes32) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) DOMAINSEPARATOR(opts *bind.CallOpts) ([32]byte, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "DOMAIN_SEPARATOR") if err != nil { return *new([32]byte), err } out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) return out0, err } // DOMAINSEPARATOR is a free data retrieval call binding the contract method 0x3644e515. // // Solidity: function DOMAIN_SEPARATOR() view returns(bytes32) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) DOMAINSEPARATOR() ([32]byte, error) { return _NonfungiblePositionManager.Contract.DOMAINSEPARATOR(&_NonfungiblePositionManager.CallOpts) } // DOMAINSEPARATOR is a free data retrieval call binding the contract method 0x3644e515. // // Solidity: function DOMAIN_SEPARATOR() view returns(bytes32) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) DOMAINSEPARATOR() ([32]byte, error) { return _NonfungiblePositionManager.Contract.DOMAINSEPARATOR(&_NonfungiblePositionManager.CallOpts) } // PERMITTYPEHASH is a free data retrieval call binding the contract method 0x30adf81f. // // Solidity: function PERMIT_TYPEHASH() view returns(bytes32) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) PERMITTYPEHASH(opts *bind.CallOpts) ([32]byte, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "PERMIT_TYPEHASH") if err != nil { return *new([32]byte), err } out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) return out0, err } // PERMITTYPEHASH is a free data retrieval call binding the contract method 0x30adf81f. // // Solidity: function PERMIT_TYPEHASH() view returns(bytes32) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) PERMITTYPEHASH() ([32]byte, error) { return _NonfungiblePositionManager.Contract.PERMITTYPEHASH(&_NonfungiblePositionManager.CallOpts) } // PERMITTYPEHASH is a free data retrieval call binding the contract method 0x30adf81f. // // Solidity: function PERMIT_TYPEHASH() view returns(bytes32) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) PERMITTYPEHASH() ([32]byte, error) { return _NonfungiblePositionManager.Contract.PERMITTYPEHASH(&_NonfungiblePositionManager.CallOpts) } // WETH9 is a free data retrieval call binding the contract method 0x4aa4a4fc. // // Solidity: function WETH9() view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) WETH9(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "WETH9") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // WETH9 is a free data retrieval call binding the contract method 0x4aa4a4fc. // // Solidity: function WETH9() view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) WETH9() (common.Address, error) { return _NonfungiblePositionManager.Contract.WETH9(&_NonfungiblePositionManager.CallOpts) } // WETH9 is a free data retrieval call binding the contract method 0x4aa4a4fc. // // Solidity: function WETH9() view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) WETH9() (common.Address, error) { return _NonfungiblePositionManager.Contract.WETH9(&_NonfungiblePositionManager.CallOpts) } // BalanceOf is a free data retrieval call binding the contract method 0x70a08231. // // Solidity: function balanceOf(address owner) view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) BalanceOf(opts *bind.CallOpts, owner common.Address) (*big.Int, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "balanceOf", owner) if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // BalanceOf is a free data retrieval call binding the contract method 0x70a08231. // // Solidity: function balanceOf(address owner) view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) BalanceOf(owner common.Address) (*big.Int, error) { return _NonfungiblePositionManager.Contract.BalanceOf(&_NonfungiblePositionManager.CallOpts, owner) } // BalanceOf is a free data retrieval call binding the contract method 0x70a08231. // // Solidity: function balanceOf(address owner) view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) BalanceOf(owner common.Address) (*big.Int, error) { return _NonfungiblePositionManager.Contract.BalanceOf(&_NonfungiblePositionManager.CallOpts, owner) } // BaseURI is a free data retrieval call binding the contract method 0x6c0360eb. // // Solidity: function baseURI() pure returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) BaseURI(opts *bind.CallOpts) (string, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "baseURI") if err != nil { return *new(string), err } out0 := *abi.ConvertType(out[0], new(string)).(*string) return out0, err } // BaseURI is a free data retrieval call binding the contract method 0x6c0360eb. // // Solidity: function baseURI() pure returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) BaseURI() (string, error) { return _NonfungiblePositionManager.Contract.BaseURI(&_NonfungiblePositionManager.CallOpts) } // BaseURI is a free data retrieval call binding the contract method 0x6c0360eb. // // Solidity: function baseURI() pure returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) BaseURI() (string, error) { return _NonfungiblePositionManager.Contract.BaseURI(&_NonfungiblePositionManager.CallOpts) } // Factory is a free data retrieval call binding the contract method 0xc45a0155. // // Solidity: function factory() view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) Factory(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "factory") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // Factory is a free data retrieval call binding the contract method 0xc45a0155. // // Solidity: function factory() view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Factory() (common.Address, error) { return _NonfungiblePositionManager.Contract.Factory(&_NonfungiblePositionManager.CallOpts) } // Factory is a free data retrieval call binding the contract method 0xc45a0155. // // Solidity: function factory() view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) Factory() (common.Address, error) { return _NonfungiblePositionManager.Contract.Factory(&_NonfungiblePositionManager.CallOpts) } // GetApproved is a free data retrieval call binding the contract method 0x081812fc. // // Solidity: function getApproved(uint256 tokenId) view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) GetApproved(opts *bind.CallOpts, tokenId *big.Int) (common.Address, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "getApproved", tokenId) if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // GetApproved is a free data retrieval call binding the contract method 0x081812fc. // // Solidity: function getApproved(uint256 tokenId) view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) GetApproved(tokenId *big.Int) (common.Address, error) { return _NonfungiblePositionManager.Contract.GetApproved(&_NonfungiblePositionManager.CallOpts, tokenId) } // GetApproved is a free data retrieval call binding the contract method 0x081812fc. // // Solidity: function getApproved(uint256 tokenId) view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) GetApproved(tokenId *big.Int) (common.Address, error) { return _NonfungiblePositionManager.Contract.GetApproved(&_NonfungiblePositionManager.CallOpts, tokenId) } // IsApprovedForAll is a free data retrieval call binding the contract method 0xe985e9c5. // // Solidity: function isApprovedForAll(address owner, address operator) view returns(bool) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) IsApprovedForAll(opts *bind.CallOpts, owner common.Address, operator common.Address) (bool, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "isApprovedForAll", owner, operator) if err != nil { return *new(bool), err } out0 := *abi.ConvertType(out[0], new(bool)).(*bool) return out0, err } // IsApprovedForAll is a free data retrieval call binding the contract method 0xe985e9c5. // // Solidity: function isApprovedForAll(address owner, address operator) view returns(bool) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) IsApprovedForAll(owner common.Address, operator common.Address) (bool, error) { return _NonfungiblePositionManager.Contract.IsApprovedForAll(&_NonfungiblePositionManager.CallOpts, owner, operator) } // IsApprovedForAll is a free data retrieval call binding the contract method 0xe985e9c5. // // Solidity: function isApprovedForAll(address owner, address operator) view returns(bool) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) IsApprovedForAll(owner common.Address, operator common.Address) (bool, error) { return _NonfungiblePositionManager.Contract.IsApprovedForAll(&_NonfungiblePositionManager.CallOpts, owner, operator) } // Name is a free data retrieval call binding the contract method 0x06fdde03. // // Solidity: function name() view returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) Name(opts *bind.CallOpts) (string, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "name") if err != nil { return *new(string), err } out0 := *abi.ConvertType(out[0], new(string)).(*string) return out0, err } // Name is a free data retrieval call binding the contract method 0x06fdde03. // // Solidity: function name() view returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Name() (string, error) { return _NonfungiblePositionManager.Contract.Name(&_NonfungiblePositionManager.CallOpts) } // Name is a free data retrieval call binding the contract method 0x06fdde03. // // Solidity: function name() view returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) Name() (string, error) { return _NonfungiblePositionManager.Contract.Name(&_NonfungiblePositionManager.CallOpts) } // OwnerOf is a free data retrieval call binding the contract method 0x6352211e. // // Solidity: function ownerOf(uint256 tokenId) view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) OwnerOf(opts *bind.CallOpts, tokenId *big.Int) (common.Address, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "ownerOf", tokenId) if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // OwnerOf is a free data retrieval call binding the contract method 0x6352211e. // // Solidity: function ownerOf(uint256 tokenId) view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) OwnerOf(tokenId *big.Int) (common.Address, error) { return _NonfungiblePositionManager.Contract.OwnerOf(&_NonfungiblePositionManager.CallOpts, tokenId) } // OwnerOf is a free data retrieval call binding the contract method 0x6352211e. // // Solidity: function ownerOf(uint256 tokenId) view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) OwnerOf(tokenId *big.Int) (common.Address, error) { return _NonfungiblePositionManager.Contract.OwnerOf(&_NonfungiblePositionManager.CallOpts, tokenId) } // Positions is a free data retrieval call binding the contract method 0x99fbab88. // // Solidity: function positions(uint256 tokenId) view returns(uint96 nonce, address operator, address token0, address token1, uint24 fee, int24 tickLower, int24 tickUpper, uint128 liquidity, uint256 feeGrowthInside0LastX128, uint256 feeGrowthInside1LastX128, uint128 tokensOwed0, uint128 tokensOwed1) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) Positions(opts *bind.CallOpts, tokenId *big.Int) (struct { Nonce *big.Int Operator common.Address Token0 common.Address Token1 common.Address Fee *big.Int TickLower *big.Int TickUpper *big.Int Liquidity *big.Int FeeGrowthInside0LastX128 *big.Int FeeGrowthInside1LastX128 *big.Int TokensOwed0 *big.Int TokensOwed1 *big.Int }, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "positions", tokenId) outstruct := new(struct { Nonce *big.Int Operator common.Address Token0 common.Address Token1 common.Address Fee *big.Int TickLower *big.Int TickUpper *big.Int Liquidity *big.Int FeeGrowthInside0LastX128 *big.Int FeeGrowthInside1LastX128 *big.Int TokensOwed0 *big.Int TokensOwed1 *big.Int }) if err != nil { return *outstruct, err } outstruct.Nonce = *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) outstruct.Operator = *abi.ConvertType(out[1], new(common.Address)).(*common.Address) outstruct.Token0 = *abi.ConvertType(out[2], new(common.Address)).(*common.Address) outstruct.Token1 = *abi.ConvertType(out[3], new(common.Address)).(*common.Address) outstruct.Fee = *abi.ConvertType(out[4], new(*big.Int)).(**big.Int) outstruct.TickLower = *abi.ConvertType(out[5], new(*big.Int)).(**big.Int) outstruct.TickUpper = *abi.ConvertType(out[6], new(*big.Int)).(**big.Int) outstruct.Liquidity = *abi.ConvertType(out[7], new(*big.Int)).(**big.Int) outstruct.FeeGrowthInside0LastX128 = *abi.ConvertType(out[8], new(*big.Int)).(**big.Int) outstruct.FeeGrowthInside1LastX128 = *abi.ConvertType(out[9], new(*big.Int)).(**big.Int) outstruct.TokensOwed0 = *abi.ConvertType(out[10], new(*big.Int)).(**big.Int) outstruct.TokensOwed1 = *abi.ConvertType(out[11], new(*big.Int)).(**big.Int) return *outstruct, err } // Positions is a free data retrieval call binding the contract method 0x99fbab88. // // Solidity: function positions(uint256 tokenId) view returns(uint96 nonce, address operator, address token0, address token1, uint24 fee, int24 tickLower, int24 tickUpper, uint128 liquidity, uint256 feeGrowthInside0LastX128, uint256 feeGrowthInside1LastX128, uint128 tokensOwed0, uint128 tokensOwed1) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Positions(tokenId *big.Int) (struct { Nonce *big.Int Operator common.Address Token0 common.Address Token1 common.Address Fee *big.Int TickLower *big.Int TickUpper *big.Int Liquidity *big.Int FeeGrowthInside0LastX128 *big.Int FeeGrowthInside1LastX128 *big.Int TokensOwed0 *big.Int TokensOwed1 *big.Int }, error) { return _NonfungiblePositionManager.Contract.Positions(&_NonfungiblePositionManager.CallOpts, tokenId) } // Positions is a free data retrieval call binding the contract method 0x99fbab88. // // Solidity: function positions(uint256 tokenId) view returns(uint96 nonce, address operator, address token0, address token1, uint24 fee, int24 tickLower, int24 tickUpper, uint128 liquidity, uint256 feeGrowthInside0LastX128, uint256 feeGrowthInside1LastX128, uint128 tokensOwed0, uint128 tokensOwed1) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) Positions(tokenId *big.Int) (struct { Nonce *big.Int Operator common.Address Token0 common.Address Token1 common.Address Fee *big.Int TickLower *big.Int TickUpper *big.Int Liquidity *big.Int FeeGrowthInside0LastX128 *big.Int FeeGrowthInside1LastX128 *big.Int TokensOwed0 *big.Int TokensOwed1 *big.Int }, error) { return _NonfungiblePositionManager.Contract.Positions(&_NonfungiblePositionManager.CallOpts, tokenId) } // SupportsInterface is a free data retrieval call binding the contract method 0x01ffc9a7. // // Solidity: function supportsInterface(bytes4 interfaceId) view returns(bool) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) SupportsInterface(opts *bind.CallOpts, interfaceId [4]byte) (bool, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "supportsInterface", interfaceId) if err != nil { return *new(bool), err } out0 := *abi.ConvertType(out[0], new(bool)).(*bool) return out0, err } // SupportsInterface is a free data retrieval call binding the contract method 0x01ffc9a7. // // Solidity: function supportsInterface(bytes4 interfaceId) view returns(bool) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) SupportsInterface(interfaceId [4]byte) (bool, error) { return _NonfungiblePositionManager.Contract.SupportsInterface(&_NonfungiblePositionManager.CallOpts, interfaceId) } // SupportsInterface is a free data retrieval call binding the contract method 0x01ffc9a7. // // Solidity: function supportsInterface(bytes4 interfaceId) view returns(bool) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) SupportsInterface(interfaceId [4]byte) (bool, error) { return _NonfungiblePositionManager.Contract.SupportsInterface(&_NonfungiblePositionManager.CallOpts, interfaceId) } // Symbol is a free data retrieval call binding the contract method 0x95d89b41. // // Solidity: function symbol() view returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) Symbol(opts *bind.CallOpts) (string, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "symbol") if err != nil { return *new(string), err } out0 := *abi.ConvertType(out[0], new(string)).(*string) return out0, err } // Symbol is a free data retrieval call binding the contract method 0x95d89b41. // // Solidity: function symbol() view returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Symbol() (string, error) { return _NonfungiblePositionManager.Contract.Symbol(&_NonfungiblePositionManager.CallOpts) } // Symbol is a free data retrieval call binding the contract method 0x95d89b41. // // Solidity: function symbol() view returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) Symbol() (string, error) { return _NonfungiblePositionManager.Contract.Symbol(&_NonfungiblePositionManager.CallOpts) } // TokenByIndex is a free data retrieval call binding the contract method 0x4f6ccce7. // // Solidity: function tokenByIndex(uint256 index) view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) TokenByIndex(opts *bind.CallOpts, index *big.Int) (*big.Int, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "tokenByIndex", index) if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // TokenByIndex is a free data retrieval call binding the contract method 0x4f6ccce7. // // Solidity: function tokenByIndex(uint256 index) view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) TokenByIndex(index *big.Int) (*big.Int, error) { return _NonfungiblePositionManager.Contract.TokenByIndex(&_NonfungiblePositionManager.CallOpts, index) } // TokenByIndex is a free data retrieval call binding the contract method 0x4f6ccce7. // // Solidity: function tokenByIndex(uint256 index) view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) TokenByIndex(index *big.Int) (*big.Int, error) { return _NonfungiblePositionManager.Contract.TokenByIndex(&_NonfungiblePositionManager.CallOpts, index) } // TokenOfOwnerByIndex is a free data retrieval call binding the contract method 0x2f745c59. // // Solidity: function tokenOfOwnerByIndex(address owner, uint256 index) view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) TokenOfOwnerByIndex(opts *bind.CallOpts, owner common.Address, index *big.Int) (*big.Int, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "tokenOfOwnerByIndex", owner, index) if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // TokenOfOwnerByIndex is a free data retrieval call binding the contract method 0x2f745c59. // // Solidity: function tokenOfOwnerByIndex(address owner, uint256 index) view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) TokenOfOwnerByIndex(owner common.Address, index *big.Int) (*big.Int, error) { return _NonfungiblePositionManager.Contract.TokenOfOwnerByIndex(&_NonfungiblePositionManager.CallOpts, owner, index) } // TokenOfOwnerByIndex is a free data retrieval call binding the contract method 0x2f745c59. // // Solidity: function tokenOfOwnerByIndex(address owner, uint256 index) view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) TokenOfOwnerByIndex(owner common.Address, index *big.Int) (*big.Int, error) { return _NonfungiblePositionManager.Contract.TokenOfOwnerByIndex(&_NonfungiblePositionManager.CallOpts, owner, index) } // TokenURI is a free data retrieval call binding the contract method 0xc87b56dd. // // Solidity: function tokenURI(uint256 tokenId) view returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) TokenURI(opts *bind.CallOpts, tokenId *big.Int) (string, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "tokenURI", tokenId) if err != nil { return *new(string), err } out0 := *abi.ConvertType(out[0], new(string)).(*string) return out0, err } // TokenURI is a free data retrieval call binding the contract method 0xc87b56dd. // // Solidity: function tokenURI(uint256 tokenId) view returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) TokenURI(tokenId *big.Int) (string, error) { return _NonfungiblePositionManager.Contract.TokenURI(&_NonfungiblePositionManager.CallOpts, tokenId) } // TokenURI is a free data retrieval call binding the contract method 0xc87b56dd. // // Solidity: function tokenURI(uint256 tokenId) view returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) TokenURI(tokenId *big.Int) (string, error) { return _NonfungiblePositionManager.Contract.TokenURI(&_NonfungiblePositionManager.CallOpts, tokenId) } // TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. // // Solidity: function totalSupply() view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) TotalSupply(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "totalSupply") if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. // // Solidity: function totalSupply() view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) TotalSupply() (*big.Int, error) { return _NonfungiblePositionManager.Contract.TotalSupply(&_NonfungiblePositionManager.CallOpts) } // TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. // // Solidity: function totalSupply() view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) TotalSupply() (*big.Int, error) { return _NonfungiblePositionManager.Contract.TotalSupply(&_NonfungiblePositionManager.CallOpts) } // Approve is a paid mutator transaction binding the contract method 0x095ea7b3. // // Solidity: function approve(address to, uint256 tokenId) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) Approve(opts *bind.TransactOpts, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "approve", to, tokenId) } // Approve is a paid mutator transaction binding the contract method 0x095ea7b3. // // Solidity: function approve(address to, uint256 tokenId) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Approve(to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Approve(&_NonfungiblePositionManager.TransactOpts, to, tokenId) } // Approve is a paid mutator transaction binding the contract method 0x095ea7b3. // // Solidity: function approve(address to, uint256 tokenId) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) Approve(to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Approve(&_NonfungiblePositionManager.TransactOpts, to, tokenId) } // Burn is a paid mutator transaction binding the contract method 0x42966c68. // // Solidity: function burn(uint256 tokenId) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) Burn(opts *bind.TransactOpts, tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "burn", tokenId) } // Burn is a paid mutator transaction binding the contract method 0x42966c68. // // Solidity: function burn(uint256 tokenId) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Burn(tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Burn(&_NonfungiblePositionManager.TransactOpts, tokenId) } // Burn is a paid mutator transaction binding the contract method 0x42966c68. // // Solidity: function burn(uint256 tokenId) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) Burn(tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Burn(&_NonfungiblePositionManager.TransactOpts, tokenId) } // Collect is a paid mutator transaction binding the contract method 0xfc6f7865. // // Solidity: function collect((uint256,address,uint128,uint128) params) payable returns(uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) Collect(opts *bind.TransactOpts, params INonfungiblePositionManagerCollectParams) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "collect", params) } // Collect is a paid mutator transaction binding the contract method 0xfc6f7865. // // Solidity: function collect((uint256,address,uint128,uint128) params) payable returns(uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Collect(params INonfungiblePositionManagerCollectParams) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Collect(&_NonfungiblePositionManager.TransactOpts, params) } // Collect is a paid mutator transaction binding the contract method 0xfc6f7865. // // Solidity: function collect((uint256,address,uint128,uint128) params) payable returns(uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) Collect(params INonfungiblePositionManagerCollectParams) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Collect(&_NonfungiblePositionManager.TransactOpts, params) } // CreateAndInitializePoolIfNecessary is a paid mutator transaction binding the contract method 0x13ead562. // // Solidity: function createAndInitializePoolIfNecessary(address token0, address token1, uint24 fee, uint160 sqrtPriceX96) payable returns(address pool) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) CreateAndInitializePoolIfNecessary(opts *bind.TransactOpts, token0 common.Address, token1 common.Address, fee *big.Int, sqrtPriceX96 *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "createAndInitializePoolIfNecessary", token0, token1, fee, sqrtPriceX96) } // CreateAndInitializePoolIfNecessary is a paid mutator transaction binding the contract method 0x13ead562. // // Solidity: function createAndInitializePoolIfNecessary(address token0, address token1, uint24 fee, uint160 sqrtPriceX96) payable returns(address pool) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) CreateAndInitializePoolIfNecessary(token0 common.Address, token1 common.Address, fee *big.Int, sqrtPriceX96 *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.CreateAndInitializePoolIfNecessary(&_NonfungiblePositionManager.TransactOpts, token0, token1, fee, sqrtPriceX96) } // CreateAndInitializePoolIfNecessary is a paid mutator transaction binding the contract method 0x13ead562. // // Solidity: function createAndInitializePoolIfNecessary(address token0, address token1, uint24 fee, uint160 sqrtPriceX96) payable returns(address pool) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) CreateAndInitializePoolIfNecessary(token0 common.Address, token1 common.Address, fee *big.Int, sqrtPriceX96 *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.CreateAndInitializePoolIfNecessary(&_NonfungiblePositionManager.TransactOpts, token0, token1, fee, sqrtPriceX96) } // DecreaseLiquidity is a paid mutator transaction binding the contract method 0x0c49ccbe. // // Solidity: function decreaseLiquidity((uint256,uint128,uint256,uint256,uint256) params) payable returns(uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) DecreaseLiquidity(opts *bind.TransactOpts, params INonfungiblePositionManagerDecreaseLiquidityParams) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "decreaseLiquidity", params) } // DecreaseLiquidity is a paid mutator transaction binding the contract method 0x0c49ccbe. // // Solidity: function decreaseLiquidity((uint256,uint128,uint256,uint256,uint256) params) payable returns(uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) DecreaseLiquidity(params INonfungiblePositionManagerDecreaseLiquidityParams) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.DecreaseLiquidity(&_NonfungiblePositionManager.TransactOpts, params) } // DecreaseLiquidity is a paid mutator transaction binding the contract method 0x0c49ccbe. // // Solidity: function decreaseLiquidity((uint256,uint128,uint256,uint256,uint256) params) payable returns(uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) DecreaseLiquidity(params INonfungiblePositionManagerDecreaseLiquidityParams) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.DecreaseLiquidity(&_NonfungiblePositionManager.TransactOpts, params) } // IncreaseLiquidity is a paid mutator transaction binding the contract method 0x219f5d17. // // Solidity: function increaseLiquidity((uint256,uint256,uint256,uint256,uint256,uint256) params) payable returns(uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) IncreaseLiquidity(opts *bind.TransactOpts, params INonfungiblePositionManagerIncreaseLiquidityParams) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "increaseLiquidity", params) } // IncreaseLiquidity is a paid mutator transaction binding the contract method 0x219f5d17. // // Solidity: function increaseLiquidity((uint256,uint256,uint256,uint256,uint256,uint256) params) payable returns(uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) IncreaseLiquidity(params INonfungiblePositionManagerIncreaseLiquidityParams) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.IncreaseLiquidity(&_NonfungiblePositionManager.TransactOpts, params) } // IncreaseLiquidity is a paid mutator transaction binding the contract method 0x219f5d17. // // Solidity: function increaseLiquidity((uint256,uint256,uint256,uint256,uint256,uint256) params) payable returns(uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) IncreaseLiquidity(params INonfungiblePositionManagerIncreaseLiquidityParams) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.IncreaseLiquidity(&_NonfungiblePositionManager.TransactOpts, params) } // Mint is a paid mutator transaction binding the contract method 0x88316456. // // Solidity: function mint((address,address,uint24,int24,int24,uint256,uint256,uint256,uint256,address,uint256) params) payable returns(uint256 tokenId, uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) Mint(opts *bind.TransactOpts, params INonfungiblePositionManagerMintParams) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "mint", params) } // Mint is a paid mutator transaction binding the contract method 0x88316456. // // Solidity: function mint((address,address,uint24,int24,int24,uint256,uint256,uint256,uint256,address,uint256) params) payable returns(uint256 tokenId, uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Mint(params INonfungiblePositionManagerMintParams) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Mint(&_NonfungiblePositionManager.TransactOpts, params) } // Mint is a paid mutator transaction binding the contract method 0x88316456. // // Solidity: function mint((address,address,uint24,int24,int24,uint256,uint256,uint256,uint256,address,uint256) params) payable returns(uint256 tokenId, uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) Mint(params INonfungiblePositionManagerMintParams) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Mint(&_NonfungiblePositionManager.TransactOpts, params) } // Multicall is a paid mutator transaction binding the contract method 0xac9650d8. // // Solidity: function multicall(bytes[] data) payable returns(bytes[] results) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) Multicall(opts *bind.TransactOpts, data [][]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "multicall", data) } // Multicall is a paid mutator transaction binding the contract method 0xac9650d8. // // Solidity: function multicall(bytes[] data) payable returns(bytes[] results) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Multicall(data [][]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Multicall(&_NonfungiblePositionManager.TransactOpts, data) } // Multicall is a paid mutator transaction binding the contract method 0xac9650d8. // // Solidity: function multicall(bytes[] data) payable returns(bytes[] results) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) Multicall(data [][]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Multicall(&_NonfungiblePositionManager.TransactOpts, data) } // Permit is a paid mutator transaction binding the contract method 0x7ac2ff7b. // // Solidity: function permit(address spender, uint256 tokenId, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) Permit(opts *bind.TransactOpts, spender common.Address, tokenId *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "permit", spender, tokenId, deadline, v, r, s) } // Permit is a paid mutator transaction binding the contract method 0x7ac2ff7b. // // Solidity: function permit(address spender, uint256 tokenId, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Permit(spender common.Address, tokenId *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Permit(&_NonfungiblePositionManager.TransactOpts, spender, tokenId, deadline, v, r, s) } // Permit is a paid mutator transaction binding the contract method 0x7ac2ff7b. // // Solidity: function permit(address spender, uint256 tokenId, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) Permit(spender common.Address, tokenId *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Permit(&_NonfungiblePositionManager.TransactOpts, spender, tokenId, deadline, v, r, s) } // RefundETH is a paid mutator transaction binding the contract method 0x12210e8a. // // Solidity: function refundETH() payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) RefundETH(opts *bind.TransactOpts) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "refundETH") } // RefundETH is a paid mutator transaction binding the contract method 0x12210e8a. // // Solidity: function refundETH() payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) RefundETH() (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.RefundETH(&_NonfungiblePositionManager.TransactOpts) } // RefundETH is a paid mutator transaction binding the contract method 0x12210e8a. // // Solidity: function refundETH() payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) RefundETH() (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.RefundETH(&_NonfungiblePositionManager.TransactOpts) } // SafeTransferFrom is a paid mutator transaction binding the contract method 0x42842e0e. // // Solidity: function safeTransferFrom(address from, address to, uint256 tokenId) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) SafeTransferFrom(opts *bind.TransactOpts, from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "safeTransferFrom", from, to, tokenId) } // SafeTransferFrom is a paid mutator transaction binding the contract method 0x42842e0e. // // Solidity: function safeTransferFrom(address from, address to, uint256 tokenId) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) SafeTransferFrom(from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SafeTransferFrom(&_NonfungiblePositionManager.TransactOpts, from, to, tokenId) } // SafeTransferFrom is a paid mutator transaction binding the contract method 0x42842e0e. // // Solidity: function safeTransferFrom(address from, address to, uint256 tokenId) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) SafeTransferFrom(from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SafeTransferFrom(&_NonfungiblePositionManager.TransactOpts, from, to, tokenId) } // SafeTransferFrom0 is a paid mutator transaction binding the contract method 0xb88d4fde. // // Solidity: function safeTransferFrom(address from, address to, uint256 tokenId, bytes _data) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) SafeTransferFrom0(opts *bind.TransactOpts, from common.Address, to common.Address, tokenId *big.Int, _data []byte) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "safeTransferFrom0", from, to, tokenId, _data) } // SafeTransferFrom0 is a paid mutator transaction binding the contract method 0xb88d4fde. // // Solidity: function safeTransferFrom(address from, address to, uint256 tokenId, bytes _data) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) SafeTransferFrom0(from common.Address, to common.Address, tokenId *big.Int, _data []byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SafeTransferFrom0(&_NonfungiblePositionManager.TransactOpts, from, to, tokenId, _data) } // SafeTransferFrom0 is a paid mutator transaction binding the contract method 0xb88d4fde. // // Solidity: function safeTransferFrom(address from, address to, uint256 tokenId, bytes _data) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) SafeTransferFrom0(from common.Address, to common.Address, tokenId *big.Int, _data []byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SafeTransferFrom0(&_NonfungiblePositionManager.TransactOpts, from, to, tokenId, _data) } // SelfPermit is a paid mutator transaction binding the contract method 0xf3995c67. // // Solidity: function selfPermit(address token, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) SelfPermit(opts *bind.TransactOpts, token common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "selfPermit", token, value, deadline, v, r, s) } // SelfPermit is a paid mutator transaction binding the contract method 0xf3995c67. // // Solidity: function selfPermit(address token, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) SelfPermit(token common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SelfPermit(&_NonfungiblePositionManager.TransactOpts, token, value, deadline, v, r, s) } // SelfPermit is a paid mutator transaction binding the contract method 0xf3995c67. // // Solidity: function selfPermit(address token, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) SelfPermit(token common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SelfPermit(&_NonfungiblePositionManager.TransactOpts, token, value, deadline, v, r, s) } // SelfPermitAllowed is a paid mutator transaction binding the contract method 0x4659a494. // // Solidity: function selfPermitAllowed(address token, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) SelfPermitAllowed(opts *bind.TransactOpts, token common.Address, nonce *big.Int, expiry *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "selfPermitAllowed", token, nonce, expiry, v, r, s) } // SelfPermitAllowed is a paid mutator transaction binding the contract method 0x4659a494. // // Solidity: function selfPermitAllowed(address token, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) SelfPermitAllowed(token common.Address, nonce *big.Int, expiry *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SelfPermitAllowed(&_NonfungiblePositionManager.TransactOpts, token, nonce, expiry, v, r, s) } // SelfPermitAllowed is a paid mutator transaction binding the contract method 0x4659a494. // // Solidity: function selfPermitAllowed(address token, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) SelfPermitAllowed(token common.Address, nonce *big.Int, expiry *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SelfPermitAllowed(&_NonfungiblePositionManager.TransactOpts, token, nonce, expiry, v, r, s) } // SelfPermitAllowedIfNecessary is a paid mutator transaction binding the contract method 0xa4a78f0c. // // Solidity: function selfPermitAllowedIfNecessary(address token, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) SelfPermitAllowedIfNecessary(opts *bind.TransactOpts, token common.Address, nonce *big.Int, expiry *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "selfPermitAllowedIfNecessary", token, nonce, expiry, v, r, s) } // SelfPermitAllowedIfNecessary is a paid mutator transaction binding the contract method 0xa4a78f0c. // // Solidity: function selfPermitAllowedIfNecessary(address token, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) SelfPermitAllowedIfNecessary(token common.Address, nonce *big.Int, expiry *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SelfPermitAllowedIfNecessary(&_NonfungiblePositionManager.TransactOpts, token, nonce, expiry, v, r, s) } // SelfPermitAllowedIfNecessary is a paid mutator transaction binding the contract method 0xa4a78f0c. // // Solidity: function selfPermitAllowedIfNecessary(address token, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) SelfPermitAllowedIfNecessary(token common.Address, nonce *big.Int, expiry *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SelfPermitAllowedIfNecessary(&_NonfungiblePositionManager.TransactOpts, token, nonce, expiry, v, r, s) } // SelfPermitIfNecessary is a paid mutator transaction binding the contract method 0xc2e3140a. // // Solidity: function selfPermitIfNecessary(address token, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) SelfPermitIfNecessary(opts *bind.TransactOpts, token common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "selfPermitIfNecessary", token, value, deadline, v, r, s) } // SelfPermitIfNecessary is a paid mutator transaction binding the contract method 0xc2e3140a. // // Solidity: function selfPermitIfNecessary(address token, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) SelfPermitIfNecessary(token common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SelfPermitIfNecessary(&_NonfungiblePositionManager.TransactOpts, token, value, deadline, v, r, s) } // SelfPermitIfNecessary is a paid mutator transaction binding the contract method 0xc2e3140a. // // Solidity: function selfPermitIfNecessary(address token, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) SelfPermitIfNecessary(token common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SelfPermitIfNecessary(&_NonfungiblePositionManager.TransactOpts, token, value, deadline, v, r, s) } // SetApprovalForAll is a paid mutator transaction binding the contract method 0xa22cb465. // // Solidity: function setApprovalForAll(address operator, bool approved) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) SetApprovalForAll(opts *bind.TransactOpts, operator common.Address, approved bool) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "setApprovalForAll", operator, approved) } // SetApprovalForAll is a paid mutator transaction binding the contract method 0xa22cb465. // // Solidity: function setApprovalForAll(address operator, bool approved) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) SetApprovalForAll(operator common.Address, approved bool) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SetApprovalForAll(&_NonfungiblePositionManager.TransactOpts, operator, approved) } // SetApprovalForAll is a paid mutator transaction binding the contract method 0xa22cb465. // // Solidity: function setApprovalForAll(address operator, bool approved) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) SetApprovalForAll(operator common.Address, approved bool) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SetApprovalForAll(&_NonfungiblePositionManager.TransactOpts, operator, approved) } // SweepToken is a paid mutator transaction binding the contract method 0xdf2ab5bb. // // Solidity: function sweepToken(address token, uint256 amountMinimum, address recipient) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) SweepToken(opts *bind.TransactOpts, token common.Address, amountMinimum *big.Int, recipient common.Address) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "sweepToken", token, amountMinimum, recipient) } // SweepToken is a paid mutator transaction binding the contract method 0xdf2ab5bb. // // Solidity: function sweepToken(address token, uint256 amountMinimum, address recipient) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) SweepToken(token common.Address, amountMinimum *big.Int, recipient common.Address) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SweepToken(&_NonfungiblePositionManager.TransactOpts, token, amountMinimum, recipient) } // SweepToken is a paid mutator transaction binding the contract method 0xdf2ab5bb. // // Solidity: function sweepToken(address token, uint256 amountMinimum, address recipient) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) SweepToken(token common.Address, amountMinimum *big.Int, recipient common.Address) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SweepToken(&_NonfungiblePositionManager.TransactOpts, token, amountMinimum, recipient) } // TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. // // Solidity: function transferFrom(address from, address to, uint256 tokenId) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) TransferFrom(opts *bind.TransactOpts, from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "transferFrom", from, to, tokenId) } // TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. // // Solidity: function transferFrom(address from, address to, uint256 tokenId) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) TransferFrom(from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.TransferFrom(&_NonfungiblePositionManager.TransactOpts, from, to, tokenId) } // TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. // // Solidity: function transferFrom(address from, address to, uint256 tokenId) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) TransferFrom(from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.TransferFrom(&_NonfungiblePositionManager.TransactOpts, from, to, tokenId) } // UniswapV3MintCallback is a paid mutator transaction binding the contract method 0xd3487997. // // Solidity: function uniswapV3MintCallback(uint256 amount0Owed, uint256 amount1Owed, bytes data) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) UniswapV3MintCallback(opts *bind.TransactOpts, amount0Owed *big.Int, amount1Owed *big.Int, data []byte) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "uniswapV3MintCallback", amount0Owed, amount1Owed, data) } // UniswapV3MintCallback is a paid mutator transaction binding the contract method 0xd3487997. // // Solidity: function uniswapV3MintCallback(uint256 amount0Owed, uint256 amount1Owed, bytes data) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) UniswapV3MintCallback(amount0Owed *big.Int, amount1Owed *big.Int, data []byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.UniswapV3MintCallback(&_NonfungiblePositionManager.TransactOpts, amount0Owed, amount1Owed, data) } // UniswapV3MintCallback is a paid mutator transaction binding the contract method 0xd3487997. // // Solidity: function uniswapV3MintCallback(uint256 amount0Owed, uint256 amount1Owed, bytes data) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) UniswapV3MintCallback(amount0Owed *big.Int, amount1Owed *big.Int, data []byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.UniswapV3MintCallback(&_NonfungiblePositionManager.TransactOpts, amount0Owed, amount1Owed, data) } // UnwrapWETH9 is a paid mutator transaction binding the contract method 0x49404b7c. // // Solidity: function unwrapWETH9(uint256 amountMinimum, address recipient) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) UnwrapWETH9(opts *bind.TransactOpts, amountMinimum *big.Int, recipient common.Address) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "unwrapWETH9", amountMinimum, recipient) } // UnwrapWETH9 is a paid mutator transaction binding the contract method 0x49404b7c. // // Solidity: function unwrapWETH9(uint256 amountMinimum, address recipient) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) UnwrapWETH9(amountMinimum *big.Int, recipient common.Address) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.UnwrapWETH9(&_NonfungiblePositionManager.TransactOpts, amountMinimum, recipient) } // UnwrapWETH9 is a paid mutator transaction binding the contract method 0x49404b7c. // // Solidity: function unwrapWETH9(uint256 amountMinimum, address recipient) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) UnwrapWETH9(amountMinimum *big.Int, recipient common.Address) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.UnwrapWETH9(&_NonfungiblePositionManager.TransactOpts, amountMinimum, recipient) } // Receive is a paid mutator transaction binding the contract receive function. // // Solidity: receive() payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) Receive(opts *bind.TransactOpts) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.RawTransact(opts, nil) // calldata is disallowed for receive function } // Receive is a paid mutator transaction binding the contract receive function. // // Solidity: receive() payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Receive() (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Receive(&_NonfungiblePositionManager.TransactOpts) } // Receive is a paid mutator transaction binding the contract receive function. // // Solidity: receive() payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) Receive() (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Receive(&_NonfungiblePositionManager.TransactOpts) } // NonfungiblePositionManagerApprovalIterator is returned from FilterApproval and is used to iterate over the raw logs and unpacked data for Approval events raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerApprovalIterator struct { Event *NonfungiblePositionManagerApproval // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *NonfungiblePositionManagerApprovalIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerApproval) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerApproval) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *NonfungiblePositionManagerApprovalIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *NonfungiblePositionManagerApprovalIterator) Close() error { it.sub.Unsubscribe() return nil } // NonfungiblePositionManagerApproval represents a Approval event raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerApproval struct { Owner common.Address Approved common.Address TokenId *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterApproval is a free log retrieval operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. // // Solidity: event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) FilterApproval(opts *bind.FilterOpts, owner []common.Address, approved []common.Address, tokenId []*big.Int) (*NonfungiblePositionManagerApprovalIterator, error) { var ownerRule []interface{} for _, ownerItem := range owner { ownerRule = append(ownerRule, ownerItem) } var approvedRule []interface{} for _, approvedItem := range approved { approvedRule = append(approvedRule, approvedItem) } var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _NonfungiblePositionManager.contract.FilterLogs(opts, "Approval", ownerRule, approvedRule, tokenIdRule) if err != nil { return nil, err } return &NonfungiblePositionManagerApprovalIterator{contract: _NonfungiblePositionManager.contract, event: "Approval", logs: logs, sub: sub}, nil } // WatchApproval is a free log subscription operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. // // Solidity: event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) WatchApproval(opts *bind.WatchOpts, sink chan<- *NonfungiblePositionManagerApproval, owner []common.Address, approved []common.Address, tokenId []*big.Int) (event.Subscription, error) { var ownerRule []interface{} for _, ownerItem := range owner { ownerRule = append(ownerRule, ownerItem) } var approvedRule []interface{} for _, approvedItem := range approved { approvedRule = append(approvedRule, approvedItem) } var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _NonfungiblePositionManager.contract.WatchLogs(opts, "Approval", ownerRule, approvedRule, tokenIdRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(NonfungiblePositionManagerApproval) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "Approval", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseApproval is a log parse operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. // // Solidity: event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) ParseApproval(log types.Log) (*NonfungiblePositionManagerApproval, error) { event := new(NonfungiblePositionManagerApproval) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "Approval", log); err != nil { return nil, err } event.Raw = log return event, nil } // NonfungiblePositionManagerApprovalForAllIterator is returned from FilterApprovalForAll and is used to iterate over the raw logs and unpacked data for ApprovalForAll events raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerApprovalForAllIterator struct { Event *NonfungiblePositionManagerApprovalForAll // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *NonfungiblePositionManagerApprovalForAllIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerApprovalForAll) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerApprovalForAll) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *NonfungiblePositionManagerApprovalForAllIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *NonfungiblePositionManagerApprovalForAllIterator) Close() error { it.sub.Unsubscribe() return nil } // NonfungiblePositionManagerApprovalForAll represents a ApprovalForAll event raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerApprovalForAll struct { Owner common.Address Operator common.Address Approved bool Raw types.Log // Blockchain specific contextual infos } // FilterApprovalForAll is a free log retrieval operation binding the contract event 0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31. // // Solidity: event ApprovalForAll(address indexed owner, address indexed operator, bool approved) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) FilterApprovalForAll(opts *bind.FilterOpts, owner []common.Address, operator []common.Address) (*NonfungiblePositionManagerApprovalForAllIterator, error) { var ownerRule []interface{} for _, ownerItem := range owner { ownerRule = append(ownerRule, ownerItem) } var operatorRule []interface{} for _, operatorItem := range operator { operatorRule = append(operatorRule, operatorItem) } logs, sub, err := _NonfungiblePositionManager.contract.FilterLogs(opts, "ApprovalForAll", ownerRule, operatorRule) if err != nil { return nil, err } return &NonfungiblePositionManagerApprovalForAllIterator{contract: _NonfungiblePositionManager.contract, event: "ApprovalForAll", logs: logs, sub: sub}, nil } // WatchApprovalForAll is a free log subscription operation binding the contract event 0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31. // // Solidity: event ApprovalForAll(address indexed owner, address indexed operator, bool approved) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) WatchApprovalForAll(opts *bind.WatchOpts, sink chan<- *NonfungiblePositionManagerApprovalForAll, owner []common.Address, operator []common.Address) (event.Subscription, error) { var ownerRule []interface{} for _, ownerItem := range owner { ownerRule = append(ownerRule, ownerItem) } var operatorRule []interface{} for _, operatorItem := range operator { operatorRule = append(operatorRule, operatorItem) } logs, sub, err := _NonfungiblePositionManager.contract.WatchLogs(opts, "ApprovalForAll", ownerRule, operatorRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(NonfungiblePositionManagerApprovalForAll) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "ApprovalForAll", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseApprovalForAll is a log parse operation binding the contract event 0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31. // // Solidity: event ApprovalForAll(address indexed owner, address indexed operator, bool approved) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) ParseApprovalForAll(log types.Log) (*NonfungiblePositionManagerApprovalForAll, error) { event := new(NonfungiblePositionManagerApprovalForAll) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "ApprovalForAll", log); err != nil { return nil, err } event.Raw = log return event, nil } // NonfungiblePositionManagerCollectIterator is returned from FilterCollect and is used to iterate over the raw logs and unpacked data for Collect events raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerCollectIterator struct { Event *NonfungiblePositionManagerCollect // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *NonfungiblePositionManagerCollectIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerCollect) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerCollect) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *NonfungiblePositionManagerCollectIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *NonfungiblePositionManagerCollectIterator) Close() error { it.sub.Unsubscribe() return nil } // NonfungiblePositionManagerCollect represents a Collect event raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerCollect struct { TokenId *big.Int Recipient common.Address Amount0 *big.Int Amount1 *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterCollect is a free log retrieval operation binding the contract event 0x40d0efd1a53d60ecbf40971b9daf7dc90178c3aadc7aab1765632738fa8b8f01. // // Solidity: event Collect(uint256 indexed tokenId, address recipient, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) FilterCollect(opts *bind.FilterOpts, tokenId []*big.Int) (*NonfungiblePositionManagerCollectIterator, error) { var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _NonfungiblePositionManager.contract.FilterLogs(opts, "Collect", tokenIdRule) if err != nil { return nil, err } return &NonfungiblePositionManagerCollectIterator{contract: _NonfungiblePositionManager.contract, event: "Collect", logs: logs, sub: sub}, nil } // WatchCollect is a free log subscription operation binding the contract event 0x40d0efd1a53d60ecbf40971b9daf7dc90178c3aadc7aab1765632738fa8b8f01. // // Solidity: event Collect(uint256 indexed tokenId, address recipient, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) WatchCollect(opts *bind.WatchOpts, sink chan<- *NonfungiblePositionManagerCollect, tokenId []*big.Int) (event.Subscription, error) { var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _NonfungiblePositionManager.contract.WatchLogs(opts, "Collect", tokenIdRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(NonfungiblePositionManagerCollect) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "Collect", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseCollect is a log parse operation binding the contract event 0x40d0efd1a53d60ecbf40971b9daf7dc90178c3aadc7aab1765632738fa8b8f01. // // Solidity: event Collect(uint256 indexed tokenId, address recipient, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) ParseCollect(log types.Log) (*NonfungiblePositionManagerCollect, error) { event := new(NonfungiblePositionManagerCollect) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "Collect", log); err != nil { return nil, err } event.Raw = log return event, nil } // NonfungiblePositionManagerDecreaseLiquidityIterator is returned from FilterDecreaseLiquidity and is used to iterate over the raw logs and unpacked data for DecreaseLiquidity events raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerDecreaseLiquidityIterator struct { Event *NonfungiblePositionManagerDecreaseLiquidity // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *NonfungiblePositionManagerDecreaseLiquidityIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerDecreaseLiquidity) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerDecreaseLiquidity) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *NonfungiblePositionManagerDecreaseLiquidityIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *NonfungiblePositionManagerDecreaseLiquidityIterator) Close() error { it.sub.Unsubscribe() return nil } // NonfungiblePositionManagerDecreaseLiquidity represents a DecreaseLiquidity event raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerDecreaseLiquidity struct { TokenId *big.Int Liquidity *big.Int Amount0 *big.Int Amount1 *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterDecreaseLiquidity is a free log retrieval operation binding the contract event 0x26f6a048ee9138f2c0ce266f322cb99228e8d619ae2bff30c67f8dcf9d2377b4. // // Solidity: event DecreaseLiquidity(uint256 indexed tokenId, uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) FilterDecreaseLiquidity(opts *bind.FilterOpts, tokenId []*big.Int) (*NonfungiblePositionManagerDecreaseLiquidityIterator, error) { var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _NonfungiblePositionManager.contract.FilterLogs(opts, "DecreaseLiquidity", tokenIdRule) if err != nil { return nil, err } return &NonfungiblePositionManagerDecreaseLiquidityIterator{contract: _NonfungiblePositionManager.contract, event: "DecreaseLiquidity", logs: logs, sub: sub}, nil } // WatchDecreaseLiquidity is a free log subscription operation binding the contract event 0x26f6a048ee9138f2c0ce266f322cb99228e8d619ae2bff30c67f8dcf9d2377b4. // // Solidity: event DecreaseLiquidity(uint256 indexed tokenId, uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) WatchDecreaseLiquidity(opts *bind.WatchOpts, sink chan<- *NonfungiblePositionManagerDecreaseLiquidity, tokenId []*big.Int) (event.Subscription, error) { var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _NonfungiblePositionManager.contract.WatchLogs(opts, "DecreaseLiquidity", tokenIdRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(NonfungiblePositionManagerDecreaseLiquidity) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "DecreaseLiquidity", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseDecreaseLiquidity is a log parse operation binding the contract event 0x26f6a048ee9138f2c0ce266f322cb99228e8d619ae2bff30c67f8dcf9d2377b4. // // Solidity: event DecreaseLiquidity(uint256 indexed tokenId, uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) ParseDecreaseLiquidity(log types.Log) (*NonfungiblePositionManagerDecreaseLiquidity, error) { event := new(NonfungiblePositionManagerDecreaseLiquidity) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "DecreaseLiquidity", log); err != nil { return nil, err } event.Raw = log return event, nil } // NonfungiblePositionManagerIncreaseLiquidityIterator is returned from FilterIncreaseLiquidity and is used to iterate over the raw logs and unpacked data for IncreaseLiquidity events raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerIncreaseLiquidityIterator struct { Event *NonfungiblePositionManagerIncreaseLiquidity // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *NonfungiblePositionManagerIncreaseLiquidityIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerIncreaseLiquidity) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerIncreaseLiquidity) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *NonfungiblePositionManagerIncreaseLiquidityIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *NonfungiblePositionManagerIncreaseLiquidityIterator) Close() error { it.sub.Unsubscribe() return nil } // NonfungiblePositionManagerIncreaseLiquidity represents a IncreaseLiquidity event raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerIncreaseLiquidity struct { TokenId *big.Int Liquidity *big.Int Amount0 *big.Int Amount1 *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterIncreaseLiquidity is a free log retrieval operation binding the contract event 0x3067048beee31b25b2f1681f88dac838c8bba36af25bfb2b7cf7473a5847e35f. // // Solidity: event IncreaseLiquidity(uint256 indexed tokenId, uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) FilterIncreaseLiquidity(opts *bind.FilterOpts, tokenId []*big.Int) (*NonfungiblePositionManagerIncreaseLiquidityIterator, error) { var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _NonfungiblePositionManager.contract.FilterLogs(opts, "IncreaseLiquidity", tokenIdRule) if err != nil { return nil, err } return &NonfungiblePositionManagerIncreaseLiquidityIterator{contract: _NonfungiblePositionManager.contract, event: "IncreaseLiquidity", logs: logs, sub: sub}, nil } // WatchIncreaseLiquidity is a free log subscription operation binding the contract event 0x3067048beee31b25b2f1681f88dac838c8bba36af25bfb2b7cf7473a5847e35f. // // Solidity: event IncreaseLiquidity(uint256 indexed tokenId, uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) WatchIncreaseLiquidity(opts *bind.WatchOpts, sink chan<- *NonfungiblePositionManagerIncreaseLiquidity, tokenId []*big.Int) (event.Subscription, error) { var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _NonfungiblePositionManager.contract.WatchLogs(opts, "IncreaseLiquidity", tokenIdRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(NonfungiblePositionManagerIncreaseLiquidity) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "IncreaseLiquidity", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseIncreaseLiquidity is a log parse operation binding the contract event 0x3067048beee31b25b2f1681f88dac838c8bba36af25bfb2b7cf7473a5847e35f. // // Solidity: event IncreaseLiquidity(uint256 indexed tokenId, uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) ParseIncreaseLiquidity(log types.Log) (*NonfungiblePositionManagerIncreaseLiquidity, error) { event := new(NonfungiblePositionManagerIncreaseLiquidity) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "IncreaseLiquidity", log); err != nil { return nil, err } event.Raw = log return event, nil } // NonfungiblePositionManagerTransferIterator is returned from FilterTransfer and is used to iterate over the raw logs and unpacked data for Transfer events raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerTransferIterator struct { Event *NonfungiblePositionManagerTransfer // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *NonfungiblePositionManagerTransferIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerTransfer) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerTransfer) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *NonfungiblePositionManagerTransferIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *NonfungiblePositionManagerTransferIterator) Close() error { it.sub.Unsubscribe() return nil } // NonfungiblePositionManagerTransfer represents a Transfer event raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerTransfer struct { From common.Address To common.Address TokenId *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterTransfer is a free log retrieval operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. // // Solidity: event Transfer(address indexed from, address indexed to, uint256 indexed tokenId) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) FilterTransfer(opts *bind.FilterOpts, from []common.Address, to []common.Address, tokenId []*big.Int) (*NonfungiblePositionManagerTransferIterator, error) { var fromRule []interface{} for _, fromItem := range from { fromRule = append(fromRule, fromItem) } var toRule []interface{} for _, toItem := range to { toRule = append(toRule, toItem) } var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _NonfungiblePositionManager.contract.FilterLogs(opts, "Transfer", fromRule, toRule, tokenIdRule) if err != nil { return nil, err } return &NonfungiblePositionManagerTransferIterator{contract: _NonfungiblePositionManager.contract, event: "Transfer", logs: logs, sub: sub}, nil } // WatchTransfer is a free log subscription operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. // // Solidity: event Transfer(address indexed from, address indexed to, uint256 indexed tokenId) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) WatchTransfer(opts *bind.WatchOpts, sink chan<- *NonfungiblePositionManagerTransfer, from []common.Address, to []common.Address, tokenId []*big.Int) (event.Subscription, error) { var fromRule []interface{} for _, fromItem := range from { fromRule = append(fromRule, fromItem) } var toRule []interface{} for _, toItem := range to { toRule = append(toRule, toItem) } var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _NonfungiblePositionManager.contract.WatchLogs(opts, "Transfer", fromRule, toRule, tokenIdRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(NonfungiblePositionManagerTransfer) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "Transfer", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseTransfer is a log parse operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. // // Solidity: event Transfer(address indexed from, address indexed to, uint256 indexed tokenId) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) ParseTransfer(log types.Log) (*NonfungiblePositionManagerTransfer, error) { event := new(NonfungiblePositionManagerTransfer) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "Transfer", log); err != nil { return nil, err } event.Raw = log return event, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/binds/celononfungiblepositionmanager/abi.json ================================================ [ { "inputs": [ { "internalType": "address", "name": "_factory", "type": "address" }, { "internalType": "address", "name": "_WETH9", "type": "address" }, { "internalType": "address", "name": "_tokenDescriptor_", "type": "address" } ], "stateMutability": "nonpayable", "type": "constructor" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "owner", "type": "address" }, { "indexed": true, "internalType": "address", "name": "approved", "type": "address" }, { "indexed": true, "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "Approval", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "owner", "type": "address" }, { "indexed": true, "internalType": "address", "name": "operator", "type": "address" }, { "indexed": false, "internalType": "bool", "name": "approved", "type": "bool" } ], "name": "ApprovalForAll", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "indexed": false, "internalType": "address", "name": "recipient", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "amount0", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "amount1", "type": "uint256" } ], "name": "Collect", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "indexed": false, "internalType": "uint128", "name": "liquidity", "type": "uint128" }, { "indexed": false, "internalType": "uint256", "name": "amount0", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "amount1", "type": "uint256" } ], "name": "DecreaseLiquidity", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "indexed": false, "internalType": "uint128", "name": "liquidity", "type": "uint128" }, { "indexed": false, "internalType": "uint256", "name": "amount0", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "amount1", "type": "uint256" } ], "name": "IncreaseLiquidity", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "from", "type": "address" }, { "indexed": true, "internalType": "address", "name": "to", "type": "address" }, { "indexed": true, "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "Transfer", "type": "event" }, { "inputs": [], "name": "DOMAIN_SEPARATOR", "outputs": [ { "internalType": "bytes32", "name": "", "type": "bytes32" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "PERMIT_TYPEHASH", "outputs": [ { "internalType": "bytes32", "name": "", "type": "bytes32" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "WETH9", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "to", "type": "address" }, { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "approve", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "owner", "type": "address" } ], "name": "balanceOf", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "baseURI", "outputs": [ { "internalType": "string", "name": "", "type": "string" } ], "stateMutability": "pure", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "burn", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "components": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "internalType": "address", "name": "recipient", "type": "address" }, { "internalType": "uint128", "name": "amount0Max", "type": "uint128" }, { "internalType": "uint128", "name": "amount1Max", "type": "uint128" } ], "internalType": "struct INonfungiblePositionManager.CollectParams", "name": "params", "type": "tuple" } ], "name": "collect", "outputs": [ { "internalType": "uint256", "name": "amount0", "type": "uint256" }, { "internalType": "uint256", "name": "amount1", "type": "uint256" } ], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "token0", "type": "address" }, { "internalType": "address", "name": "token1", "type": "address" }, { "internalType": "uint24", "name": "fee", "type": "uint24" }, { "internalType": "uint160", "name": "sqrtPriceX96", "type": "uint160" } ], "name": "createAndInitializePoolIfNecessary", "outputs": [ { "internalType": "address", "name": "pool", "type": "address" } ], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "components": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "internalType": "uint128", "name": "liquidity", "type": "uint128" }, { "internalType": "uint256", "name": "amount0Min", "type": "uint256" }, { "internalType": "uint256", "name": "amount1Min", "type": "uint256" }, { "internalType": "uint256", "name": "deadline", "type": "uint256" } ], "internalType": "struct INonfungiblePositionManager.DecreaseLiquidityParams", "name": "params", "type": "tuple" } ], "name": "decreaseLiquidity", "outputs": [ { "internalType": "uint256", "name": "amount0", "type": "uint256" }, { "internalType": "uint256", "name": "amount1", "type": "uint256" } ], "stateMutability": "payable", "type": "function" }, { "inputs": [], "name": "factory", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "getApproved", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "components": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "internalType": "uint256", "name": "amount0Desired", "type": "uint256" }, { "internalType": "uint256", "name": "amount1Desired", "type": "uint256" }, { "internalType": "uint256", "name": "amount0Min", "type": "uint256" }, { "internalType": "uint256", "name": "amount1Min", "type": "uint256" }, { "internalType": "uint256", "name": "deadline", "type": "uint256" } ], "internalType": "struct INonfungiblePositionManager.IncreaseLiquidityParams", "name": "params", "type": "tuple" } ], "name": "increaseLiquidity", "outputs": [ { "internalType": "uint128", "name": "liquidity", "type": "uint128" }, { "internalType": "uint256", "name": "amount0", "type": "uint256" }, { "internalType": "uint256", "name": "amount1", "type": "uint256" } ], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "owner", "type": "address" }, { "internalType": "address", "name": "operator", "type": "address" } ], "name": "isApprovedForAll", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "components": [ { "internalType": "address", "name": "token0", "type": "address" }, { "internalType": "address", "name": "token1", "type": "address" }, { "internalType": "uint24", "name": "fee", "type": "uint24" }, { "internalType": "int24", "name": "tickLower", "type": "int24" }, { "internalType": "int24", "name": "tickUpper", "type": "int24" }, { "internalType": "uint256", "name": "amount0Desired", "type": "uint256" }, { "internalType": "uint256", "name": "amount1Desired", "type": "uint256" }, { "internalType": "uint256", "name": "amount0Min", "type": "uint256" }, { "internalType": "uint256", "name": "amount1Min", "type": "uint256" }, { "internalType": "address", "name": "recipient", "type": "address" }, { "internalType": "uint256", "name": "deadline", "type": "uint256" } ], "internalType": "struct INonfungiblePositionManager.MintParams", "name": "params", "type": "tuple" } ], "name": "mint", "outputs": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "internalType": "uint128", "name": "liquidity", "type": "uint128" }, { "internalType": "uint256", "name": "amount0", "type": "uint256" }, { "internalType": "uint256", "name": "amount1", "type": "uint256" } ], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "bytes[]", "name": "data", "type": "bytes[]" } ], "name": "multicall", "outputs": [ { "internalType": "bytes[]", "name": "results", "type": "bytes[]" } ], "stateMutability": "payable", "type": "function" }, { "inputs": [], "name": "name", "outputs": [ { "internalType": "string", "name": "", "type": "string" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "ownerOf", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "spender", "type": "address" }, { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "internalType": "uint256", "name": "deadline", "type": "uint256" }, { "internalType": "uint8", "name": "v", "type": "uint8" }, { "internalType": "bytes32", "name": "r", "type": "bytes32" }, { "internalType": "bytes32", "name": "s", "type": "bytes32" } ], "name": "permit", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "positions", "outputs": [ { "internalType": "uint96", "name": "nonce", "type": "uint96" }, { "internalType": "address", "name": "operator", "type": "address" }, { "internalType": "address", "name": "token0", "type": "address" }, { "internalType": "address", "name": "token1", "type": "address" }, { "internalType": "uint24", "name": "fee", "type": "uint24" }, { "internalType": "int24", "name": "tickLower", "type": "int24" }, { "internalType": "int24", "name": "tickUpper", "type": "int24" }, { "internalType": "uint128", "name": "liquidity", "type": "uint128" }, { "internalType": "uint256", "name": "feeGrowthInside0LastX128", "type": "uint256" }, { "internalType": "uint256", "name": "feeGrowthInside1LastX128", "type": "uint256" }, { "internalType": "uint128", "name": "tokensOwed0", "type": "uint128" }, { "internalType": "uint128", "name": "tokensOwed1", "type": "uint128" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "refundETH", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "from", "type": "address" }, { "internalType": "address", "name": "to", "type": "address" }, { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "safeTransferFrom", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "from", "type": "address" }, { "internalType": "address", "name": "to", "type": "address" }, { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "internalType": "bytes", "name": "_data", "type": "bytes" } ], "name": "safeTransferFrom", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "token", "type": "address" }, { "internalType": "uint256", "name": "value", "type": "uint256" }, { "internalType": "uint256", "name": "deadline", "type": "uint256" }, { "internalType": "uint8", "name": "v", "type": "uint8" }, { "internalType": "bytes32", "name": "r", "type": "bytes32" }, { "internalType": "bytes32", "name": "s", "type": "bytes32" } ], "name": "selfPermit", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "token", "type": "address" }, { "internalType": "uint256", "name": "nonce", "type": "uint256" }, { "internalType": "uint256", "name": "expiry", "type": "uint256" }, { "internalType": "uint8", "name": "v", "type": "uint8" }, { "internalType": "bytes32", "name": "r", "type": "bytes32" }, { "internalType": "bytes32", "name": "s", "type": "bytes32" } ], "name": "selfPermitAllowed", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "token", "type": "address" }, { "internalType": "uint256", "name": "nonce", "type": "uint256" }, { "internalType": "uint256", "name": "expiry", "type": "uint256" }, { "internalType": "uint8", "name": "v", "type": "uint8" }, { "internalType": "bytes32", "name": "r", "type": "bytes32" }, { "internalType": "bytes32", "name": "s", "type": "bytes32" } ], "name": "selfPermitAllowedIfNecessary", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "token", "type": "address" }, { "internalType": "uint256", "name": "value", "type": "uint256" }, { "internalType": "uint256", "name": "deadline", "type": "uint256" }, { "internalType": "uint8", "name": "v", "type": "uint8" }, { "internalType": "bytes32", "name": "r", "type": "bytes32" }, { "internalType": "bytes32", "name": "s", "type": "bytes32" } ], "name": "selfPermitIfNecessary", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "operator", "type": "address" }, { "internalType": "bool", "name": "approved", "type": "bool" } ], "name": "setApprovalForAll", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "bytes4", "name": "interfaceId", "type": "bytes4" } ], "name": "supportsInterface", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "token", "type": "address" }, { "internalType": "uint256", "name": "amountMinimum", "type": "uint256" }, { "internalType": "address", "name": "recipient", "type": "address" } ], "name": "sweepToken", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [], "name": "symbol", "outputs": [ { "internalType": "string", "name": "", "type": "string" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "index", "type": "uint256" } ], "name": "tokenByIndex", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "owner", "type": "address" }, { "internalType": "uint256", "name": "index", "type": "uint256" } ], "name": "tokenOfOwnerByIndex", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "tokenURI", "outputs": [ { "internalType": "string", "name": "", "type": "string" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "totalSupply", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "from", "type": "address" }, { "internalType": "address", "name": "to", "type": "address" }, { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "transferFrom", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "amount0Owed", "type": "uint256" }, { "internalType": "uint256", "name": "amount1Owed", "type": "uint256" }, { "internalType": "bytes", "name": "data", "type": "bytes" } ], "name": "uniswapV3MintCallback", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "amountMinimum", "type": "uint256" }, { "internalType": "address", "name": "recipient", "type": "address" } ], "name": "unwrapWETH9", "outputs": [], "stateMutability": "payable", "type": "function" }, { "stateMutability": "payable", "type": "receive" } ] ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/binds/celononfungiblepositionmanager/abigen.sh ================================================ abigen --abi=abi.json --pkg=celononfungiblepositionmanager --type NonfungiblePositionManager --out=NonfungiblePositionManager.go ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/binds/dagent721/Dagent721.go ================================================ // Code generated - DO NOT EDIT. // This file is a generated binding and any manual changes will be lost. package dagent721 import ( "errors" "math/big" "strings" ethereum "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/event" ) // Reference imports to suppress errors if they are not otherwise used. var ( _ = errors.New _ = big.NewInt _ = strings.NewReader _ = ethereum.NotFound _ = bind.Bind _ = common.Big1 _ = types.BloomLookup _ = event.NewSubscription _ = abi.ConvertType ) // Dagent721MetaData contains all meta data concerning the Dagent721 contract. var Dagent721MetaData = &bind.MetaData{ ABI: "[{\"inputs\":[],\"name\":\"InsufficientFunds\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidAgentData\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidAgentFee\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidAgentId\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidAgentPromptIndex\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidAgentURI\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidData\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"SignatureUsed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Unauthorized\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"agentId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes[]\",\"name\":\"sysPrompt\",\"type\":\"bytes[]\"}],\"name\":\"AgentDataAddNew\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"agentId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"promptIndex\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"oldSysPrompt\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"newSysPrompt\",\"type\":\"bytes\"}],\"name\":\"AgentDataUpdate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"agentId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"fee\",\"type\":\"uint256\"}],\"name\":\"AgentFeeUpdate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"agentId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes[]\",\"name\":\"missions\",\"type\":\"bytes[]\"}],\"name\":\"AgentMissionAddNew\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"agentId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"missionIndex\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"oldSysMission\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"newSysMission\",\"type\":\"bytes\"}],\"name\":\"AgentMissionUpdate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"agentId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldModelId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newModelId\",\"type\":\"uint256\"}],\"name\":\"AgentModelIdUpdate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"agentId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"oldPromptScheduler\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newOldPromptScheduler\",\"type\":\"address\"}],\"name\":\"AgentPromptSchedulerdUpdate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"agentId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"uri\",\"type\":\"string\"}],\"name\":\"AgentURIUpdate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"approved\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"ApprovalForAll\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_fromTokenId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_toTokenId\",\"type\":\"uint256\"}],\"name\":\"BatchMetadataUpdate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"fee\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"externalData\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"inferenceId\",\"type\":\"uint256\"}],\"name\":\"InferencePerformed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_tokenId\",\"type\":\"uint256\"}],\"name\":\"MetadataUpdate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newValue\",\"type\":\"uint256\"}],\"name\":\"MintPriceUpdate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"uri\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"sysPrompt\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"fee\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"minter\",\"type\":\"address\"}],\"name\":\"NewToken\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"Paused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"newValue\",\"type\":\"uint16\"}],\"name\":\"RoyaltyPortionUpdate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAddress\",\"type\":\"address\"}],\"name\":\"RoyaltyReceiverUpdate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"agentId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TopUpPoolBalance\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"Unpaused\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"_gpuManager\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"nftId\",\"type\":\"uint256\"}],\"name\":\"_poolBalance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"nftId\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"signature\",\"type\":\"bytes32\"}],\"name\":\"_signaturesUsed\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"agentId\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"promptKey\",\"type\":\"string\"},{\"internalType\":\"bytes\",\"name\":\"sysPrompt\",\"type\":\"bytes\"}],\"name\":\"addNewAgentData\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"agentId\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"missionData\",\"type\":\"bytes\"}],\"name\":\"createMission\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"agentId\",\"type\":\"uint256\"}],\"name\":\"dataOf\",\"outputs\":[{\"internalType\":\"uint128\",\"name\":\"\",\"type\":\"uint128\"},{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"agentId\",\"type\":\"uint256\"}],\"name\":\"getAgentFee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"getAgentIdByOwner\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"agentId\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"promptKey\",\"type\":\"string\"}],\"name\":\"getAgentSystemPrompt\",\"outputs\":[{\"internalType\":\"bytes[]\",\"name\":\"\",\"type\":\"bytes[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"getApproved\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"agentId\",\"type\":\"uint256\"}],\"name\":\"getMissionIdsByAgentId\",\"outputs\":[{\"internalType\":\"bytes[]\",\"name\":\"\",\"type\":\"bytes[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"agentId\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"fwdCalldata\",\"type\":\"bytes\"},{\"internalType\":\"string\",\"name\":\"externalData\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"promptKey\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"feeAmount\",\"type\":\"uint256\"}],\"name\":\"infer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"agentId\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"fwdCalldata\",\"type\":\"bytes\"},{\"internalType\":\"string\",\"name\":\"externalData\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"promptKey\",\"type\":\"string\"},{\"internalType\":\"bool\",\"name\":\"flag\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"feeAmount\",\"type\":\"uint256\"}],\"name\":\"infer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"name_\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"symbol_\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"mintPrice_\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"royaltyReceiver_\",\"type\":\"address\"},{\"internalType\":\"uint16\",\"name\":\"royaltyPortion_\",\"type\":\"uint16\"},{\"internalType\":\"uint256\",\"name\":\"nextTokenId_\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"gpuManager_\",\"type\":\"address\"},{\"internalType\":\"contractIERC20\",\"name\":\"tokenFee_\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"name\":\"isApprovedForAll\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"uri\",\"type\":\"string\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"fee\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"promptKey\",\"type\":\"string\"},{\"internalType\":\"address\",\"name\":\"promptScheduler\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"modelId\",\"type\":\"uint32\"}],\"name\":\"mint\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"mintPrice\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"nextTokenId\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"ownerOf\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"paused\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"agentId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"salePrice\",\"type\":\"uint256\"}],\"name\":\"royaltyInfo\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"royaltyPortion\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"royaltyReceiver\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"safeTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"safeTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"setApprovalForAll\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"}],\"name\":\"tokenByIndex\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"}],\"name\":\"tokenOfOwnerByIndex\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_agentId\",\"type\":\"uint256\"}],\"name\":\"tokenURI\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"agentId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"topUpPoolBalance\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"unpause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"agentId\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"sysPrompt\",\"type\":\"bytes\"},{\"internalType\":\"string\",\"name\":\"promptKey\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"promptIdx\",\"type\":\"uint256\"}],\"name\":\"updateAgentData\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"agentId\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"sysPrompt\",\"type\":\"bytes\"},{\"internalType\":\"string\",\"name\":\"promptKey\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"promptIdx\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"randomNonce\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"name\":\"updateAgentDataWithSignature\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"agentId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"fee\",\"type\":\"uint256\"}],\"name\":\"updateAgentFee\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"agentId\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"newModelId\",\"type\":\"uint32\"}],\"name\":\"updateAgentModelId\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"agentId\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"uri\",\"type\":\"string\"}],\"name\":\"updateAgentURI\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"agentId\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"uri\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"randomNonce\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"name\":\"updateAgentUriWithSignature\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"gpuManager\",\"type\":\"address\"}],\"name\":\"updateGPUManager\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"mintPrice\",\"type\":\"uint256\"}],\"name\":\"updateMintPrice\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"royaltyPortion\",\"type\":\"uint16\"}],\"name\":\"updateRoyaltyPortion\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"royaltyReceiver\",\"type\":\"address\"}],\"name\":\"updateRoyaltyReceiver\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"agentId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"newPromptScheduler\",\"type\":\"address\"}],\"name\":\"updateSchedulePrompt\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", } // Dagent721ABI is the input ABI used to generate the binding from. // Deprecated: Use Dagent721MetaData.ABI instead. var Dagent721ABI = Dagent721MetaData.ABI // Dagent721 is an auto generated Go binding around an Ethereum contract. type Dagent721 struct { Dagent721Caller // Read-only binding to the contract Dagent721Transactor // Write-only binding to the contract Dagent721Filterer // Log filterer for contract events } // Dagent721Caller is an auto generated read-only Go binding around an Ethereum contract. type Dagent721Caller struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // Dagent721Transactor is an auto generated write-only Go binding around an Ethereum contract. type Dagent721Transactor struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // Dagent721Filterer is an auto generated log filtering Go binding around an Ethereum contract events. type Dagent721Filterer struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // Dagent721Session is an auto generated Go binding around an Ethereum contract, // with pre-set call and transact options. type Dagent721Session struct { Contract *Dagent721 // Generic contract binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // Dagent721CallerSession is an auto generated read-only Go binding around an Ethereum contract, // with pre-set call options. type Dagent721CallerSession struct { Contract *Dagent721Caller // Generic contract caller binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session } // Dagent721TransactorSession is an auto generated write-only Go binding around an Ethereum contract, // with pre-set transact options. type Dagent721TransactorSession struct { Contract *Dagent721Transactor // Generic contract transactor binding to set the session for TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // Dagent721Raw is an auto generated low-level Go binding around an Ethereum contract. type Dagent721Raw struct { Contract *Dagent721 // Generic contract binding to access the raw methods on } // Dagent721CallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. type Dagent721CallerRaw struct { Contract *Dagent721Caller // Generic read-only contract binding to access the raw methods on } // Dagent721TransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. type Dagent721TransactorRaw struct { Contract *Dagent721Transactor // Generic write-only contract binding to access the raw methods on } // NewDagent721 creates a new instance of Dagent721, bound to a specific deployed contract. func NewDagent721(address common.Address, backend bind.ContractBackend) (*Dagent721, error) { contract, err := bindDagent721(address, backend, backend, backend) if err != nil { return nil, err } return &Dagent721{Dagent721Caller: Dagent721Caller{contract: contract}, Dagent721Transactor: Dagent721Transactor{contract: contract}, Dagent721Filterer: Dagent721Filterer{contract: contract}}, nil } // NewDagent721Caller creates a new read-only instance of Dagent721, bound to a specific deployed contract. func NewDagent721Caller(address common.Address, caller bind.ContractCaller) (*Dagent721Caller, error) { contract, err := bindDagent721(address, caller, nil, nil) if err != nil { return nil, err } return &Dagent721Caller{contract: contract}, nil } // NewDagent721Transactor creates a new write-only instance of Dagent721, bound to a specific deployed contract. func NewDagent721Transactor(address common.Address, transactor bind.ContractTransactor) (*Dagent721Transactor, error) { contract, err := bindDagent721(address, nil, transactor, nil) if err != nil { return nil, err } return &Dagent721Transactor{contract: contract}, nil } // NewDagent721Filterer creates a new log filterer instance of Dagent721, bound to a specific deployed contract. func NewDagent721Filterer(address common.Address, filterer bind.ContractFilterer) (*Dagent721Filterer, error) { contract, err := bindDagent721(address, nil, nil, filterer) if err != nil { return nil, err } return &Dagent721Filterer{contract: contract}, nil } // bindDagent721 binds a generic wrapper to an already deployed contract. func bindDagent721(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { parsed, err := Dagent721MetaData.GetAbi() if err != nil { return nil, err } return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_Dagent721 *Dagent721Raw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _Dagent721.Contract.Dagent721Caller.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_Dagent721 *Dagent721Raw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _Dagent721.Contract.Dagent721Transactor.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_Dagent721 *Dagent721Raw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _Dagent721.Contract.Dagent721Transactor.contract.Transact(opts, method, params...) } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_Dagent721 *Dagent721CallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _Dagent721.Contract.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_Dagent721 *Dagent721TransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _Dagent721.Contract.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_Dagent721 *Dagent721TransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _Dagent721.Contract.contract.Transact(opts, method, params...) } // GpuManager is a free data retrieval call binding the contract method 0x08c147fd. // // Solidity: function _gpuManager() view returns(address) func (_Dagent721 *Dagent721Caller) GpuManager(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _Dagent721.contract.Call(opts, &out, "_gpuManager") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // GpuManager is a free data retrieval call binding the contract method 0x08c147fd. // // Solidity: function _gpuManager() view returns(address) func (_Dagent721 *Dagent721Session) GpuManager() (common.Address, error) { return _Dagent721.Contract.GpuManager(&_Dagent721.CallOpts) } // GpuManager is a free data retrieval call binding the contract method 0x08c147fd. // // Solidity: function _gpuManager() view returns(address) func (_Dagent721 *Dagent721CallerSession) GpuManager() (common.Address, error) { return _Dagent721.Contract.GpuManager(&_Dagent721.CallOpts) } // PoolBalance is a free data retrieval call binding the contract method 0xf121000e. // // Solidity: function _poolBalance(uint256 nftId) view returns(uint256) func (_Dagent721 *Dagent721Caller) PoolBalance(opts *bind.CallOpts, nftId *big.Int) (*big.Int, error) { var out []interface{} err := _Dagent721.contract.Call(opts, &out, "_poolBalance", nftId) if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // PoolBalance is a free data retrieval call binding the contract method 0xf121000e. // // Solidity: function _poolBalance(uint256 nftId) view returns(uint256) func (_Dagent721 *Dagent721Session) PoolBalance(nftId *big.Int) (*big.Int, error) { return _Dagent721.Contract.PoolBalance(&_Dagent721.CallOpts, nftId) } // PoolBalance is a free data retrieval call binding the contract method 0xf121000e. // // Solidity: function _poolBalance(uint256 nftId) view returns(uint256) func (_Dagent721 *Dagent721CallerSession) PoolBalance(nftId *big.Int) (*big.Int, error) { return _Dagent721.Contract.PoolBalance(&_Dagent721.CallOpts, nftId) } // SignaturesUsed is a free data retrieval call binding the contract method 0xc9070a92. // // Solidity: function _signaturesUsed(address nftId, bytes32 signature) view returns(bool) func (_Dagent721 *Dagent721Caller) SignaturesUsed(opts *bind.CallOpts, nftId common.Address, signature [32]byte) (bool, error) { var out []interface{} err := _Dagent721.contract.Call(opts, &out, "_signaturesUsed", nftId, signature) if err != nil { return *new(bool), err } out0 := *abi.ConvertType(out[0], new(bool)).(*bool) return out0, err } // SignaturesUsed is a free data retrieval call binding the contract method 0xc9070a92. // // Solidity: function _signaturesUsed(address nftId, bytes32 signature) view returns(bool) func (_Dagent721 *Dagent721Session) SignaturesUsed(nftId common.Address, signature [32]byte) (bool, error) { return _Dagent721.Contract.SignaturesUsed(&_Dagent721.CallOpts, nftId, signature) } // SignaturesUsed is a free data retrieval call binding the contract method 0xc9070a92. // // Solidity: function _signaturesUsed(address nftId, bytes32 signature) view returns(bool) func (_Dagent721 *Dagent721CallerSession) SignaturesUsed(nftId common.Address, signature [32]byte) (bool, error) { return _Dagent721.Contract.SignaturesUsed(&_Dagent721.CallOpts, nftId, signature) } // BalanceOf is a free data retrieval call binding the contract method 0x70a08231. // // Solidity: function balanceOf(address owner) view returns(uint256) func (_Dagent721 *Dagent721Caller) BalanceOf(opts *bind.CallOpts, owner common.Address) (*big.Int, error) { var out []interface{} err := _Dagent721.contract.Call(opts, &out, "balanceOf", owner) if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // BalanceOf is a free data retrieval call binding the contract method 0x70a08231. // // Solidity: function balanceOf(address owner) view returns(uint256) func (_Dagent721 *Dagent721Session) BalanceOf(owner common.Address) (*big.Int, error) { return _Dagent721.Contract.BalanceOf(&_Dagent721.CallOpts, owner) } // BalanceOf is a free data retrieval call binding the contract method 0x70a08231. // // Solidity: function balanceOf(address owner) view returns(uint256) func (_Dagent721 *Dagent721CallerSession) BalanceOf(owner common.Address) (*big.Int, error) { return _Dagent721.Contract.BalanceOf(&_Dagent721.CallOpts, owner) } // DataOf is a free data retrieval call binding the contract method 0x871caa98. // // Solidity: function dataOf(uint256 agentId) view returns(uint128, bool) func (_Dagent721 *Dagent721Caller) DataOf(opts *bind.CallOpts, agentId *big.Int) (*big.Int, bool, error) { var out []interface{} err := _Dagent721.contract.Call(opts, &out, "dataOf", agentId) if err != nil { return *new(*big.Int), *new(bool), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) out1 := *abi.ConvertType(out[1], new(bool)).(*bool) return out0, out1, err } // DataOf is a free data retrieval call binding the contract method 0x871caa98. // // Solidity: function dataOf(uint256 agentId) view returns(uint128, bool) func (_Dagent721 *Dagent721Session) DataOf(agentId *big.Int) (*big.Int, bool, error) { return _Dagent721.Contract.DataOf(&_Dagent721.CallOpts, agentId) } // DataOf is a free data retrieval call binding the contract method 0x871caa98. // // Solidity: function dataOf(uint256 agentId) view returns(uint128, bool) func (_Dagent721 *Dagent721CallerSession) DataOf(agentId *big.Int) (*big.Int, bool, error) { return _Dagent721.Contract.DataOf(&_Dagent721.CallOpts, agentId) } // GetAgentFee is a free data retrieval call binding the contract method 0xed96f433. // // Solidity: function getAgentFee(uint256 agentId) view returns(uint256) func (_Dagent721 *Dagent721Caller) GetAgentFee(opts *bind.CallOpts, agentId *big.Int) (*big.Int, error) { var out []interface{} err := _Dagent721.contract.Call(opts, &out, "getAgentFee", agentId) if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // GetAgentFee is a free data retrieval call binding the contract method 0xed96f433. // // Solidity: function getAgentFee(uint256 agentId) view returns(uint256) func (_Dagent721 *Dagent721Session) GetAgentFee(agentId *big.Int) (*big.Int, error) { return _Dagent721.Contract.GetAgentFee(&_Dagent721.CallOpts, agentId) } // GetAgentFee is a free data retrieval call binding the contract method 0xed96f433. // // Solidity: function getAgentFee(uint256 agentId) view returns(uint256) func (_Dagent721 *Dagent721CallerSession) GetAgentFee(agentId *big.Int) (*big.Int, error) { return _Dagent721.Contract.GetAgentFee(&_Dagent721.CallOpts, agentId) } // GetAgentIdByOwner is a free data retrieval call binding the contract method 0xae57a2d3. // // Solidity: function getAgentIdByOwner(address owner) view returns(uint256[]) func (_Dagent721 *Dagent721Caller) GetAgentIdByOwner(opts *bind.CallOpts, owner common.Address) ([]*big.Int, error) { var out []interface{} err := _Dagent721.contract.Call(opts, &out, "getAgentIdByOwner", owner) if err != nil { return *new([]*big.Int), err } out0 := *abi.ConvertType(out[0], new([]*big.Int)).(*[]*big.Int) return out0, err } // GetAgentIdByOwner is a free data retrieval call binding the contract method 0xae57a2d3. // // Solidity: function getAgentIdByOwner(address owner) view returns(uint256[]) func (_Dagent721 *Dagent721Session) GetAgentIdByOwner(owner common.Address) ([]*big.Int, error) { return _Dagent721.Contract.GetAgentIdByOwner(&_Dagent721.CallOpts, owner) } // GetAgentIdByOwner is a free data retrieval call binding the contract method 0xae57a2d3. // // Solidity: function getAgentIdByOwner(address owner) view returns(uint256[]) func (_Dagent721 *Dagent721CallerSession) GetAgentIdByOwner(owner common.Address) ([]*big.Int, error) { return _Dagent721.Contract.GetAgentIdByOwner(&_Dagent721.CallOpts, owner) } // GetAgentSystemPrompt is a free data retrieval call binding the contract method 0x5a88fc7c. // // Solidity: function getAgentSystemPrompt(uint256 agentId, string promptKey) view returns(bytes[]) func (_Dagent721 *Dagent721Caller) GetAgentSystemPrompt(opts *bind.CallOpts, agentId *big.Int, promptKey string) ([][]byte, error) { var out []interface{} err := _Dagent721.contract.Call(opts, &out, "getAgentSystemPrompt", agentId, promptKey) if err != nil { return *new([][]byte), err } out0 := *abi.ConvertType(out[0], new([][]byte)).(*[][]byte) return out0, err } // GetAgentSystemPrompt is a free data retrieval call binding the contract method 0x5a88fc7c. // // Solidity: function getAgentSystemPrompt(uint256 agentId, string promptKey) view returns(bytes[]) func (_Dagent721 *Dagent721Session) GetAgentSystemPrompt(agentId *big.Int, promptKey string) ([][]byte, error) { return _Dagent721.Contract.GetAgentSystemPrompt(&_Dagent721.CallOpts, agentId, promptKey) } // GetAgentSystemPrompt is a free data retrieval call binding the contract method 0x5a88fc7c. // // Solidity: function getAgentSystemPrompt(uint256 agentId, string promptKey) view returns(bytes[]) func (_Dagent721 *Dagent721CallerSession) GetAgentSystemPrompt(agentId *big.Int, promptKey string) ([][]byte, error) { return _Dagent721.Contract.GetAgentSystemPrompt(&_Dagent721.CallOpts, agentId, promptKey) } // GetApproved is a free data retrieval call binding the contract method 0x081812fc. // // Solidity: function getApproved(uint256 tokenId) view returns(address) func (_Dagent721 *Dagent721Caller) GetApproved(opts *bind.CallOpts, tokenId *big.Int) (common.Address, error) { var out []interface{} err := _Dagent721.contract.Call(opts, &out, "getApproved", tokenId) if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // GetApproved is a free data retrieval call binding the contract method 0x081812fc. // // Solidity: function getApproved(uint256 tokenId) view returns(address) func (_Dagent721 *Dagent721Session) GetApproved(tokenId *big.Int) (common.Address, error) { return _Dagent721.Contract.GetApproved(&_Dagent721.CallOpts, tokenId) } // GetApproved is a free data retrieval call binding the contract method 0x081812fc. // // Solidity: function getApproved(uint256 tokenId) view returns(address) func (_Dagent721 *Dagent721CallerSession) GetApproved(tokenId *big.Int) (common.Address, error) { return _Dagent721.Contract.GetApproved(&_Dagent721.CallOpts, tokenId) } // GetMissionIdsByAgentId is a free data retrieval call binding the contract method 0x96694ad0. // // Solidity: function getMissionIdsByAgentId(uint256 agentId) view returns(bytes[]) func (_Dagent721 *Dagent721Caller) GetMissionIdsByAgentId(opts *bind.CallOpts, agentId *big.Int) ([][]byte, error) { var out []interface{} err := _Dagent721.contract.Call(opts, &out, "getMissionIdsByAgentId", agentId) if err != nil { return *new([][]byte), err } out0 := *abi.ConvertType(out[0], new([][]byte)).(*[][]byte) return out0, err } // GetMissionIdsByAgentId is a free data retrieval call binding the contract method 0x96694ad0. // // Solidity: function getMissionIdsByAgentId(uint256 agentId) view returns(bytes[]) func (_Dagent721 *Dagent721Session) GetMissionIdsByAgentId(agentId *big.Int) ([][]byte, error) { return _Dagent721.Contract.GetMissionIdsByAgentId(&_Dagent721.CallOpts, agentId) } // GetMissionIdsByAgentId is a free data retrieval call binding the contract method 0x96694ad0. // // Solidity: function getMissionIdsByAgentId(uint256 agentId) view returns(bytes[]) func (_Dagent721 *Dagent721CallerSession) GetMissionIdsByAgentId(agentId *big.Int) ([][]byte, error) { return _Dagent721.Contract.GetMissionIdsByAgentId(&_Dagent721.CallOpts, agentId) } // IsApprovedForAll is a free data retrieval call binding the contract method 0xe985e9c5. // // Solidity: function isApprovedForAll(address owner, address operator) view returns(bool) func (_Dagent721 *Dagent721Caller) IsApprovedForAll(opts *bind.CallOpts, owner common.Address, operator common.Address) (bool, error) { var out []interface{} err := _Dagent721.contract.Call(opts, &out, "isApprovedForAll", owner, operator) if err != nil { return *new(bool), err } out0 := *abi.ConvertType(out[0], new(bool)).(*bool) return out0, err } // IsApprovedForAll is a free data retrieval call binding the contract method 0xe985e9c5. // // Solidity: function isApprovedForAll(address owner, address operator) view returns(bool) func (_Dagent721 *Dagent721Session) IsApprovedForAll(owner common.Address, operator common.Address) (bool, error) { return _Dagent721.Contract.IsApprovedForAll(&_Dagent721.CallOpts, owner, operator) } // IsApprovedForAll is a free data retrieval call binding the contract method 0xe985e9c5. // // Solidity: function isApprovedForAll(address owner, address operator) view returns(bool) func (_Dagent721 *Dagent721CallerSession) IsApprovedForAll(owner common.Address, operator common.Address) (bool, error) { return _Dagent721.Contract.IsApprovedForAll(&_Dagent721.CallOpts, owner, operator) } // MintPrice is a free data retrieval call binding the contract method 0x6817c76c. // // Solidity: function mintPrice() view returns(uint256) func (_Dagent721 *Dagent721Caller) MintPrice(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} err := _Dagent721.contract.Call(opts, &out, "mintPrice") if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // MintPrice is a free data retrieval call binding the contract method 0x6817c76c. // // Solidity: function mintPrice() view returns(uint256) func (_Dagent721 *Dagent721Session) MintPrice() (*big.Int, error) { return _Dagent721.Contract.MintPrice(&_Dagent721.CallOpts) } // MintPrice is a free data retrieval call binding the contract method 0x6817c76c. // // Solidity: function mintPrice() view returns(uint256) func (_Dagent721 *Dagent721CallerSession) MintPrice() (*big.Int, error) { return _Dagent721.Contract.MintPrice(&_Dagent721.CallOpts) } // Name is a free data retrieval call binding the contract method 0x06fdde03. // // Solidity: function name() view returns(string) func (_Dagent721 *Dagent721Caller) Name(opts *bind.CallOpts) (string, error) { var out []interface{} err := _Dagent721.contract.Call(opts, &out, "name") if err != nil { return *new(string), err } out0 := *abi.ConvertType(out[0], new(string)).(*string) return out0, err } // Name is a free data retrieval call binding the contract method 0x06fdde03. // // Solidity: function name() view returns(string) func (_Dagent721 *Dagent721Session) Name() (string, error) { return _Dagent721.Contract.Name(&_Dagent721.CallOpts) } // Name is a free data retrieval call binding the contract method 0x06fdde03. // // Solidity: function name() view returns(string) func (_Dagent721 *Dagent721CallerSession) Name() (string, error) { return _Dagent721.Contract.Name(&_Dagent721.CallOpts) } // NextTokenId is a free data retrieval call binding the contract method 0x75794a3c. // // Solidity: function nextTokenId() view returns(uint256) func (_Dagent721 *Dagent721Caller) NextTokenId(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} err := _Dagent721.contract.Call(opts, &out, "nextTokenId") if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // NextTokenId is a free data retrieval call binding the contract method 0x75794a3c. // // Solidity: function nextTokenId() view returns(uint256) func (_Dagent721 *Dagent721Session) NextTokenId() (*big.Int, error) { return _Dagent721.Contract.NextTokenId(&_Dagent721.CallOpts) } // NextTokenId is a free data retrieval call binding the contract method 0x75794a3c. // // Solidity: function nextTokenId() view returns(uint256) func (_Dagent721 *Dagent721CallerSession) NextTokenId() (*big.Int, error) { return _Dagent721.Contract.NextTokenId(&_Dagent721.CallOpts) } // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. // // Solidity: function owner() view returns(address) func (_Dagent721 *Dagent721Caller) Owner(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _Dagent721.contract.Call(opts, &out, "owner") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. // // Solidity: function owner() view returns(address) func (_Dagent721 *Dagent721Session) Owner() (common.Address, error) { return _Dagent721.Contract.Owner(&_Dagent721.CallOpts) } // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. // // Solidity: function owner() view returns(address) func (_Dagent721 *Dagent721CallerSession) Owner() (common.Address, error) { return _Dagent721.Contract.Owner(&_Dagent721.CallOpts) } // OwnerOf is a free data retrieval call binding the contract method 0x6352211e. // // Solidity: function ownerOf(uint256 tokenId) view returns(address) func (_Dagent721 *Dagent721Caller) OwnerOf(opts *bind.CallOpts, tokenId *big.Int) (common.Address, error) { var out []interface{} err := _Dagent721.contract.Call(opts, &out, "ownerOf", tokenId) if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // OwnerOf is a free data retrieval call binding the contract method 0x6352211e. // // Solidity: function ownerOf(uint256 tokenId) view returns(address) func (_Dagent721 *Dagent721Session) OwnerOf(tokenId *big.Int) (common.Address, error) { return _Dagent721.Contract.OwnerOf(&_Dagent721.CallOpts, tokenId) } // OwnerOf is a free data retrieval call binding the contract method 0x6352211e. // // Solidity: function ownerOf(uint256 tokenId) view returns(address) func (_Dagent721 *Dagent721CallerSession) OwnerOf(tokenId *big.Int) (common.Address, error) { return _Dagent721.Contract.OwnerOf(&_Dagent721.CallOpts, tokenId) } // Paused is a free data retrieval call binding the contract method 0x5c975abb. // // Solidity: function paused() view returns(bool) func (_Dagent721 *Dagent721Caller) Paused(opts *bind.CallOpts) (bool, error) { var out []interface{} err := _Dagent721.contract.Call(opts, &out, "paused") if err != nil { return *new(bool), err } out0 := *abi.ConvertType(out[0], new(bool)).(*bool) return out0, err } // Paused is a free data retrieval call binding the contract method 0x5c975abb. // // Solidity: function paused() view returns(bool) func (_Dagent721 *Dagent721Session) Paused() (bool, error) { return _Dagent721.Contract.Paused(&_Dagent721.CallOpts) } // Paused is a free data retrieval call binding the contract method 0x5c975abb. // // Solidity: function paused() view returns(bool) func (_Dagent721 *Dagent721CallerSession) Paused() (bool, error) { return _Dagent721.Contract.Paused(&_Dagent721.CallOpts) } // RoyaltyInfo is a free data retrieval call binding the contract method 0x2a55205a. // // Solidity: function royaltyInfo(uint256 agentId, uint256 salePrice) view returns(address, uint256) func (_Dagent721 *Dagent721Caller) RoyaltyInfo(opts *bind.CallOpts, agentId *big.Int, salePrice *big.Int) (common.Address, *big.Int, error) { var out []interface{} err := _Dagent721.contract.Call(opts, &out, "royaltyInfo", agentId, salePrice) if err != nil { return *new(common.Address), *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) out1 := *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) return out0, out1, err } // RoyaltyInfo is a free data retrieval call binding the contract method 0x2a55205a. // // Solidity: function royaltyInfo(uint256 agentId, uint256 salePrice) view returns(address, uint256) func (_Dagent721 *Dagent721Session) RoyaltyInfo(agentId *big.Int, salePrice *big.Int) (common.Address, *big.Int, error) { return _Dagent721.Contract.RoyaltyInfo(&_Dagent721.CallOpts, agentId, salePrice) } // RoyaltyInfo is a free data retrieval call binding the contract method 0x2a55205a. // // Solidity: function royaltyInfo(uint256 agentId, uint256 salePrice) view returns(address, uint256) func (_Dagent721 *Dagent721CallerSession) RoyaltyInfo(agentId *big.Int, salePrice *big.Int) (common.Address, *big.Int, error) { return _Dagent721.Contract.RoyaltyInfo(&_Dagent721.CallOpts, agentId, salePrice) } // RoyaltyPortion is a free data retrieval call binding the contract method 0x11d7beb2. // // Solidity: function royaltyPortion() view returns(uint16) func (_Dagent721 *Dagent721Caller) RoyaltyPortion(opts *bind.CallOpts) (uint16, error) { var out []interface{} err := _Dagent721.contract.Call(opts, &out, "royaltyPortion") if err != nil { return *new(uint16), err } out0 := *abi.ConvertType(out[0], new(uint16)).(*uint16) return out0, err } // RoyaltyPortion is a free data retrieval call binding the contract method 0x11d7beb2. // // Solidity: function royaltyPortion() view returns(uint16) func (_Dagent721 *Dagent721Session) RoyaltyPortion() (uint16, error) { return _Dagent721.Contract.RoyaltyPortion(&_Dagent721.CallOpts) } // RoyaltyPortion is a free data retrieval call binding the contract method 0x11d7beb2. // // Solidity: function royaltyPortion() view returns(uint16) func (_Dagent721 *Dagent721CallerSession) RoyaltyPortion() (uint16, error) { return _Dagent721.Contract.RoyaltyPortion(&_Dagent721.CallOpts) } // RoyaltyReceiver is a free data retrieval call binding the contract method 0x9fbc8713. // // Solidity: function royaltyReceiver() view returns(address) func (_Dagent721 *Dagent721Caller) RoyaltyReceiver(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _Dagent721.contract.Call(opts, &out, "royaltyReceiver") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // RoyaltyReceiver is a free data retrieval call binding the contract method 0x9fbc8713. // // Solidity: function royaltyReceiver() view returns(address) func (_Dagent721 *Dagent721Session) RoyaltyReceiver() (common.Address, error) { return _Dagent721.Contract.RoyaltyReceiver(&_Dagent721.CallOpts) } // RoyaltyReceiver is a free data retrieval call binding the contract method 0x9fbc8713. // // Solidity: function royaltyReceiver() view returns(address) func (_Dagent721 *Dagent721CallerSession) RoyaltyReceiver() (common.Address, error) { return _Dagent721.Contract.RoyaltyReceiver(&_Dagent721.CallOpts) } // SupportsInterface is a free data retrieval call binding the contract method 0x01ffc9a7. // // Solidity: function supportsInterface(bytes4 interfaceId) view returns(bool) func (_Dagent721 *Dagent721Caller) SupportsInterface(opts *bind.CallOpts, interfaceId [4]byte) (bool, error) { var out []interface{} err := _Dagent721.contract.Call(opts, &out, "supportsInterface", interfaceId) if err != nil { return *new(bool), err } out0 := *abi.ConvertType(out[0], new(bool)).(*bool) return out0, err } // SupportsInterface is a free data retrieval call binding the contract method 0x01ffc9a7. // // Solidity: function supportsInterface(bytes4 interfaceId) view returns(bool) func (_Dagent721 *Dagent721Session) SupportsInterface(interfaceId [4]byte) (bool, error) { return _Dagent721.Contract.SupportsInterface(&_Dagent721.CallOpts, interfaceId) } // SupportsInterface is a free data retrieval call binding the contract method 0x01ffc9a7. // // Solidity: function supportsInterface(bytes4 interfaceId) view returns(bool) func (_Dagent721 *Dagent721CallerSession) SupportsInterface(interfaceId [4]byte) (bool, error) { return _Dagent721.Contract.SupportsInterface(&_Dagent721.CallOpts, interfaceId) } // Symbol is a free data retrieval call binding the contract method 0x95d89b41. // // Solidity: function symbol() view returns(string) func (_Dagent721 *Dagent721Caller) Symbol(opts *bind.CallOpts) (string, error) { var out []interface{} err := _Dagent721.contract.Call(opts, &out, "symbol") if err != nil { return *new(string), err } out0 := *abi.ConvertType(out[0], new(string)).(*string) return out0, err } // Symbol is a free data retrieval call binding the contract method 0x95d89b41. // // Solidity: function symbol() view returns(string) func (_Dagent721 *Dagent721Session) Symbol() (string, error) { return _Dagent721.Contract.Symbol(&_Dagent721.CallOpts) } // Symbol is a free data retrieval call binding the contract method 0x95d89b41. // // Solidity: function symbol() view returns(string) func (_Dagent721 *Dagent721CallerSession) Symbol() (string, error) { return _Dagent721.Contract.Symbol(&_Dagent721.CallOpts) } // TokenByIndex is a free data retrieval call binding the contract method 0x4f6ccce7. // // Solidity: function tokenByIndex(uint256 index) view returns(uint256) func (_Dagent721 *Dagent721Caller) TokenByIndex(opts *bind.CallOpts, index *big.Int) (*big.Int, error) { var out []interface{} err := _Dagent721.contract.Call(opts, &out, "tokenByIndex", index) if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // TokenByIndex is a free data retrieval call binding the contract method 0x4f6ccce7. // // Solidity: function tokenByIndex(uint256 index) view returns(uint256) func (_Dagent721 *Dagent721Session) TokenByIndex(index *big.Int) (*big.Int, error) { return _Dagent721.Contract.TokenByIndex(&_Dagent721.CallOpts, index) } // TokenByIndex is a free data retrieval call binding the contract method 0x4f6ccce7. // // Solidity: function tokenByIndex(uint256 index) view returns(uint256) func (_Dagent721 *Dagent721CallerSession) TokenByIndex(index *big.Int) (*big.Int, error) { return _Dagent721.Contract.TokenByIndex(&_Dagent721.CallOpts, index) } // TokenOfOwnerByIndex is a free data retrieval call binding the contract method 0x2f745c59. // // Solidity: function tokenOfOwnerByIndex(address owner, uint256 index) view returns(uint256) func (_Dagent721 *Dagent721Caller) TokenOfOwnerByIndex(opts *bind.CallOpts, owner common.Address, index *big.Int) (*big.Int, error) { var out []interface{} err := _Dagent721.contract.Call(opts, &out, "tokenOfOwnerByIndex", owner, index) if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // TokenOfOwnerByIndex is a free data retrieval call binding the contract method 0x2f745c59. // // Solidity: function tokenOfOwnerByIndex(address owner, uint256 index) view returns(uint256) func (_Dagent721 *Dagent721Session) TokenOfOwnerByIndex(owner common.Address, index *big.Int) (*big.Int, error) { return _Dagent721.Contract.TokenOfOwnerByIndex(&_Dagent721.CallOpts, owner, index) } // TokenOfOwnerByIndex is a free data retrieval call binding the contract method 0x2f745c59. // // Solidity: function tokenOfOwnerByIndex(address owner, uint256 index) view returns(uint256) func (_Dagent721 *Dagent721CallerSession) TokenOfOwnerByIndex(owner common.Address, index *big.Int) (*big.Int, error) { return _Dagent721.Contract.TokenOfOwnerByIndex(&_Dagent721.CallOpts, owner, index) } // TokenURI is a free data retrieval call binding the contract method 0xc87b56dd. // // Solidity: function tokenURI(uint256 _agentId) view returns(string) func (_Dagent721 *Dagent721Caller) TokenURI(opts *bind.CallOpts, _agentId *big.Int) (string, error) { var out []interface{} err := _Dagent721.contract.Call(opts, &out, "tokenURI", _agentId) if err != nil { return *new(string), err } out0 := *abi.ConvertType(out[0], new(string)).(*string) return out0, err } // TokenURI is a free data retrieval call binding the contract method 0xc87b56dd. // // Solidity: function tokenURI(uint256 _agentId) view returns(string) func (_Dagent721 *Dagent721Session) TokenURI(_agentId *big.Int) (string, error) { return _Dagent721.Contract.TokenURI(&_Dagent721.CallOpts, _agentId) } // TokenURI is a free data retrieval call binding the contract method 0xc87b56dd. // // Solidity: function tokenURI(uint256 _agentId) view returns(string) func (_Dagent721 *Dagent721CallerSession) TokenURI(_agentId *big.Int) (string, error) { return _Dagent721.Contract.TokenURI(&_Dagent721.CallOpts, _agentId) } // TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. // // Solidity: function totalSupply() view returns(uint256) func (_Dagent721 *Dagent721Caller) TotalSupply(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} err := _Dagent721.contract.Call(opts, &out, "totalSupply") if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. // // Solidity: function totalSupply() view returns(uint256) func (_Dagent721 *Dagent721Session) TotalSupply() (*big.Int, error) { return _Dagent721.Contract.TotalSupply(&_Dagent721.CallOpts) } // TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. // // Solidity: function totalSupply() view returns(uint256) func (_Dagent721 *Dagent721CallerSession) TotalSupply() (*big.Int, error) { return _Dagent721.Contract.TotalSupply(&_Dagent721.CallOpts) } // AddNewAgentData is a paid mutator transaction binding the contract method 0x413b0efa. // // Solidity: function addNewAgentData(uint256 agentId, string promptKey, bytes sysPrompt) returns() func (_Dagent721 *Dagent721Transactor) AddNewAgentData(opts *bind.TransactOpts, agentId *big.Int, promptKey string, sysPrompt []byte) (*types.Transaction, error) { return _Dagent721.contract.Transact(opts, "addNewAgentData", agentId, promptKey, sysPrompt) } // AddNewAgentData is a paid mutator transaction binding the contract method 0x413b0efa. // // Solidity: function addNewAgentData(uint256 agentId, string promptKey, bytes sysPrompt) returns() func (_Dagent721 *Dagent721Session) AddNewAgentData(agentId *big.Int, promptKey string, sysPrompt []byte) (*types.Transaction, error) { return _Dagent721.Contract.AddNewAgentData(&_Dagent721.TransactOpts, agentId, promptKey, sysPrompt) } // AddNewAgentData is a paid mutator transaction binding the contract method 0x413b0efa. // // Solidity: function addNewAgentData(uint256 agentId, string promptKey, bytes sysPrompt) returns() func (_Dagent721 *Dagent721TransactorSession) AddNewAgentData(agentId *big.Int, promptKey string, sysPrompt []byte) (*types.Transaction, error) { return _Dagent721.Contract.AddNewAgentData(&_Dagent721.TransactOpts, agentId, promptKey, sysPrompt) } // Approve is a paid mutator transaction binding the contract method 0x095ea7b3. // // Solidity: function approve(address to, uint256 tokenId) returns() func (_Dagent721 *Dagent721Transactor) Approve(opts *bind.TransactOpts, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _Dagent721.contract.Transact(opts, "approve", to, tokenId) } // Approve is a paid mutator transaction binding the contract method 0x095ea7b3. // // Solidity: function approve(address to, uint256 tokenId) returns() func (_Dagent721 *Dagent721Session) Approve(to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _Dagent721.Contract.Approve(&_Dagent721.TransactOpts, to, tokenId) } // Approve is a paid mutator transaction binding the contract method 0x095ea7b3. // // Solidity: function approve(address to, uint256 tokenId) returns() func (_Dagent721 *Dagent721TransactorSession) Approve(to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _Dagent721.Contract.Approve(&_Dagent721.TransactOpts, to, tokenId) } // CreateMission is a paid mutator transaction binding the contract method 0x6001ad44. // // Solidity: function createMission(uint256 agentId, bytes missionData) returns() func (_Dagent721 *Dagent721Transactor) CreateMission(opts *bind.TransactOpts, agentId *big.Int, missionData []byte) (*types.Transaction, error) { return _Dagent721.contract.Transact(opts, "createMission", agentId, missionData) } // CreateMission is a paid mutator transaction binding the contract method 0x6001ad44. // // Solidity: function createMission(uint256 agentId, bytes missionData) returns() func (_Dagent721 *Dagent721Session) CreateMission(agentId *big.Int, missionData []byte) (*types.Transaction, error) { return _Dagent721.Contract.CreateMission(&_Dagent721.TransactOpts, agentId, missionData) } // CreateMission is a paid mutator transaction binding the contract method 0x6001ad44. // // Solidity: function createMission(uint256 agentId, bytes missionData) returns() func (_Dagent721 *Dagent721TransactorSession) CreateMission(agentId *big.Int, missionData []byte) (*types.Transaction, error) { return _Dagent721.Contract.CreateMission(&_Dagent721.TransactOpts, agentId, missionData) } // Infer is a paid mutator transaction binding the contract method 0x3b8117fa. // // Solidity: function infer(uint256 agentId, bytes fwdCalldata, string externalData, string promptKey, uint256 feeAmount) returns() func (_Dagent721 *Dagent721Transactor) Infer(opts *bind.TransactOpts, agentId *big.Int, fwdCalldata []byte, externalData string, promptKey string, feeAmount *big.Int) (*types.Transaction, error) { return _Dagent721.contract.Transact(opts, "infer", agentId, fwdCalldata, externalData, promptKey, feeAmount) } // Infer is a paid mutator transaction binding the contract method 0x3b8117fa. // // Solidity: function infer(uint256 agentId, bytes fwdCalldata, string externalData, string promptKey, uint256 feeAmount) returns() func (_Dagent721 *Dagent721Session) Infer(agentId *big.Int, fwdCalldata []byte, externalData string, promptKey string, feeAmount *big.Int) (*types.Transaction, error) { return _Dagent721.Contract.Infer(&_Dagent721.TransactOpts, agentId, fwdCalldata, externalData, promptKey, feeAmount) } // Infer is a paid mutator transaction binding the contract method 0x3b8117fa. // // Solidity: function infer(uint256 agentId, bytes fwdCalldata, string externalData, string promptKey, uint256 feeAmount) returns() func (_Dagent721 *Dagent721TransactorSession) Infer(agentId *big.Int, fwdCalldata []byte, externalData string, promptKey string, feeAmount *big.Int) (*types.Transaction, error) { return _Dagent721.Contract.Infer(&_Dagent721.TransactOpts, agentId, fwdCalldata, externalData, promptKey, feeAmount) } // Infer0 is a paid mutator transaction binding the contract method 0xfa064b19. // // Solidity: function infer(uint256 agentId, bytes fwdCalldata, string externalData, string promptKey, bool flag, uint256 feeAmount) returns() func (_Dagent721 *Dagent721Transactor) Infer0(opts *bind.TransactOpts, agentId *big.Int, fwdCalldata []byte, externalData string, promptKey string, flag bool, feeAmount *big.Int) (*types.Transaction, error) { return _Dagent721.contract.Transact(opts, "infer0", agentId, fwdCalldata, externalData, promptKey, flag, feeAmount) } // Infer0 is a paid mutator transaction binding the contract method 0xfa064b19. // // Solidity: function infer(uint256 agentId, bytes fwdCalldata, string externalData, string promptKey, bool flag, uint256 feeAmount) returns() func (_Dagent721 *Dagent721Session) Infer0(agentId *big.Int, fwdCalldata []byte, externalData string, promptKey string, flag bool, feeAmount *big.Int) (*types.Transaction, error) { return _Dagent721.Contract.Infer0(&_Dagent721.TransactOpts, agentId, fwdCalldata, externalData, promptKey, flag, feeAmount) } // Infer0 is a paid mutator transaction binding the contract method 0xfa064b19. // // Solidity: function infer(uint256 agentId, bytes fwdCalldata, string externalData, string promptKey, bool flag, uint256 feeAmount) returns() func (_Dagent721 *Dagent721TransactorSession) Infer0(agentId *big.Int, fwdCalldata []byte, externalData string, promptKey string, flag bool, feeAmount *big.Int) (*types.Transaction, error) { return _Dagent721.Contract.Infer0(&_Dagent721.TransactOpts, agentId, fwdCalldata, externalData, promptKey, flag, feeAmount) } // Initialize is a paid mutator transaction binding the contract method 0x1e18fb8c. // // Solidity: function initialize(string name_, string symbol_, uint256 mintPrice_, address royaltyReceiver_, uint16 royaltyPortion_, uint256 nextTokenId_, address gpuManager_, address tokenFee_) returns() func (_Dagent721 *Dagent721Transactor) Initialize(opts *bind.TransactOpts, name_ string, symbol_ string, mintPrice_ *big.Int, royaltyReceiver_ common.Address, royaltyPortion_ uint16, nextTokenId_ *big.Int, gpuManager_ common.Address, tokenFee_ common.Address) (*types.Transaction, error) { return _Dagent721.contract.Transact(opts, "initialize", name_, symbol_, mintPrice_, royaltyReceiver_, royaltyPortion_, nextTokenId_, gpuManager_, tokenFee_) } // Initialize is a paid mutator transaction binding the contract method 0x1e18fb8c. // // Solidity: function initialize(string name_, string symbol_, uint256 mintPrice_, address royaltyReceiver_, uint16 royaltyPortion_, uint256 nextTokenId_, address gpuManager_, address tokenFee_) returns() func (_Dagent721 *Dagent721Session) Initialize(name_ string, symbol_ string, mintPrice_ *big.Int, royaltyReceiver_ common.Address, royaltyPortion_ uint16, nextTokenId_ *big.Int, gpuManager_ common.Address, tokenFee_ common.Address) (*types.Transaction, error) { return _Dagent721.Contract.Initialize(&_Dagent721.TransactOpts, name_, symbol_, mintPrice_, royaltyReceiver_, royaltyPortion_, nextTokenId_, gpuManager_, tokenFee_) } // Initialize is a paid mutator transaction binding the contract method 0x1e18fb8c. // // Solidity: function initialize(string name_, string symbol_, uint256 mintPrice_, address royaltyReceiver_, uint16 royaltyPortion_, uint256 nextTokenId_, address gpuManager_, address tokenFee_) returns() func (_Dagent721 *Dagent721TransactorSession) Initialize(name_ string, symbol_ string, mintPrice_ *big.Int, royaltyReceiver_ common.Address, royaltyPortion_ uint16, nextTokenId_ *big.Int, gpuManager_ common.Address, tokenFee_ common.Address) (*types.Transaction, error) { return _Dagent721.Contract.Initialize(&_Dagent721.TransactOpts, name_, symbol_, mintPrice_, royaltyReceiver_, royaltyPortion_, nextTokenId_, gpuManager_, tokenFee_) } // Mint is a paid mutator transaction binding the contract method 0xb8ea1693. // // Solidity: function mint(address to, string uri, bytes data, uint256 fee, string promptKey, address promptScheduler, uint32 modelId) returns(uint256) func (_Dagent721 *Dagent721Transactor) Mint(opts *bind.TransactOpts, to common.Address, uri string, data []byte, fee *big.Int, promptKey string, promptScheduler common.Address, modelId uint32) (*types.Transaction, error) { return _Dagent721.contract.Transact(opts, "mint", to, uri, data, fee, promptKey, promptScheduler, modelId) } // Mint is a paid mutator transaction binding the contract method 0xb8ea1693. // // Solidity: function mint(address to, string uri, bytes data, uint256 fee, string promptKey, address promptScheduler, uint32 modelId) returns(uint256) func (_Dagent721 *Dagent721Session) Mint(to common.Address, uri string, data []byte, fee *big.Int, promptKey string, promptScheduler common.Address, modelId uint32) (*types.Transaction, error) { return _Dagent721.Contract.Mint(&_Dagent721.TransactOpts, to, uri, data, fee, promptKey, promptScheduler, modelId) } // Mint is a paid mutator transaction binding the contract method 0xb8ea1693. // // Solidity: function mint(address to, string uri, bytes data, uint256 fee, string promptKey, address promptScheduler, uint32 modelId) returns(uint256) func (_Dagent721 *Dagent721TransactorSession) Mint(to common.Address, uri string, data []byte, fee *big.Int, promptKey string, promptScheduler common.Address, modelId uint32) (*types.Transaction, error) { return _Dagent721.Contract.Mint(&_Dagent721.TransactOpts, to, uri, data, fee, promptKey, promptScheduler, modelId) } // Pause is a paid mutator transaction binding the contract method 0x8456cb59. // // Solidity: function pause() returns() func (_Dagent721 *Dagent721Transactor) Pause(opts *bind.TransactOpts) (*types.Transaction, error) { return _Dagent721.contract.Transact(opts, "pause") } // Pause is a paid mutator transaction binding the contract method 0x8456cb59. // // Solidity: function pause() returns() func (_Dagent721 *Dagent721Session) Pause() (*types.Transaction, error) { return _Dagent721.Contract.Pause(&_Dagent721.TransactOpts) } // Pause is a paid mutator transaction binding the contract method 0x8456cb59. // // Solidity: function pause() returns() func (_Dagent721 *Dagent721TransactorSession) Pause() (*types.Transaction, error) { return _Dagent721.Contract.Pause(&_Dagent721.TransactOpts) } // RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. // // Solidity: function renounceOwnership() returns() func (_Dagent721 *Dagent721Transactor) RenounceOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { return _Dagent721.contract.Transact(opts, "renounceOwnership") } // RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. // // Solidity: function renounceOwnership() returns() func (_Dagent721 *Dagent721Session) RenounceOwnership() (*types.Transaction, error) { return _Dagent721.Contract.RenounceOwnership(&_Dagent721.TransactOpts) } // RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. // // Solidity: function renounceOwnership() returns() func (_Dagent721 *Dagent721TransactorSession) RenounceOwnership() (*types.Transaction, error) { return _Dagent721.Contract.RenounceOwnership(&_Dagent721.TransactOpts) } // SafeTransferFrom is a paid mutator transaction binding the contract method 0x42842e0e. // // Solidity: function safeTransferFrom(address from, address to, uint256 tokenId) returns() func (_Dagent721 *Dagent721Transactor) SafeTransferFrom(opts *bind.TransactOpts, from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _Dagent721.contract.Transact(opts, "safeTransferFrom", from, to, tokenId) } // SafeTransferFrom is a paid mutator transaction binding the contract method 0x42842e0e. // // Solidity: function safeTransferFrom(address from, address to, uint256 tokenId) returns() func (_Dagent721 *Dagent721Session) SafeTransferFrom(from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _Dagent721.Contract.SafeTransferFrom(&_Dagent721.TransactOpts, from, to, tokenId) } // SafeTransferFrom is a paid mutator transaction binding the contract method 0x42842e0e. // // Solidity: function safeTransferFrom(address from, address to, uint256 tokenId) returns() func (_Dagent721 *Dagent721TransactorSession) SafeTransferFrom(from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _Dagent721.Contract.SafeTransferFrom(&_Dagent721.TransactOpts, from, to, tokenId) } // SafeTransferFrom0 is a paid mutator transaction binding the contract method 0xb88d4fde. // // Solidity: function safeTransferFrom(address from, address to, uint256 tokenId, bytes data) returns() func (_Dagent721 *Dagent721Transactor) SafeTransferFrom0(opts *bind.TransactOpts, from common.Address, to common.Address, tokenId *big.Int, data []byte) (*types.Transaction, error) { return _Dagent721.contract.Transact(opts, "safeTransferFrom0", from, to, tokenId, data) } // SafeTransferFrom0 is a paid mutator transaction binding the contract method 0xb88d4fde. // // Solidity: function safeTransferFrom(address from, address to, uint256 tokenId, bytes data) returns() func (_Dagent721 *Dagent721Session) SafeTransferFrom0(from common.Address, to common.Address, tokenId *big.Int, data []byte) (*types.Transaction, error) { return _Dagent721.Contract.SafeTransferFrom0(&_Dagent721.TransactOpts, from, to, tokenId, data) } // SafeTransferFrom0 is a paid mutator transaction binding the contract method 0xb88d4fde. // // Solidity: function safeTransferFrom(address from, address to, uint256 tokenId, bytes data) returns() func (_Dagent721 *Dagent721TransactorSession) SafeTransferFrom0(from common.Address, to common.Address, tokenId *big.Int, data []byte) (*types.Transaction, error) { return _Dagent721.Contract.SafeTransferFrom0(&_Dagent721.TransactOpts, from, to, tokenId, data) } // SetApprovalForAll is a paid mutator transaction binding the contract method 0xa22cb465. // // Solidity: function setApprovalForAll(address operator, bool approved) returns() func (_Dagent721 *Dagent721Transactor) SetApprovalForAll(opts *bind.TransactOpts, operator common.Address, approved bool) (*types.Transaction, error) { return _Dagent721.contract.Transact(opts, "setApprovalForAll", operator, approved) } // SetApprovalForAll is a paid mutator transaction binding the contract method 0xa22cb465. // // Solidity: function setApprovalForAll(address operator, bool approved) returns() func (_Dagent721 *Dagent721Session) SetApprovalForAll(operator common.Address, approved bool) (*types.Transaction, error) { return _Dagent721.Contract.SetApprovalForAll(&_Dagent721.TransactOpts, operator, approved) } // SetApprovalForAll is a paid mutator transaction binding the contract method 0xa22cb465. // // Solidity: function setApprovalForAll(address operator, bool approved) returns() func (_Dagent721 *Dagent721TransactorSession) SetApprovalForAll(operator common.Address, approved bool) (*types.Transaction, error) { return _Dagent721.Contract.SetApprovalForAll(&_Dagent721.TransactOpts, operator, approved) } // TopUpPoolBalance is a paid mutator transaction binding the contract method 0x67b611a0. // // Solidity: function topUpPoolBalance(uint256 agentId, uint256 amount) returns() func (_Dagent721 *Dagent721Transactor) TopUpPoolBalance(opts *bind.TransactOpts, agentId *big.Int, amount *big.Int) (*types.Transaction, error) { return _Dagent721.contract.Transact(opts, "topUpPoolBalance", agentId, amount) } // TopUpPoolBalance is a paid mutator transaction binding the contract method 0x67b611a0. // // Solidity: function topUpPoolBalance(uint256 agentId, uint256 amount) returns() func (_Dagent721 *Dagent721Session) TopUpPoolBalance(agentId *big.Int, amount *big.Int) (*types.Transaction, error) { return _Dagent721.Contract.TopUpPoolBalance(&_Dagent721.TransactOpts, agentId, amount) } // TopUpPoolBalance is a paid mutator transaction binding the contract method 0x67b611a0. // // Solidity: function topUpPoolBalance(uint256 agentId, uint256 amount) returns() func (_Dagent721 *Dagent721TransactorSession) TopUpPoolBalance(agentId *big.Int, amount *big.Int) (*types.Transaction, error) { return _Dagent721.Contract.TopUpPoolBalance(&_Dagent721.TransactOpts, agentId, amount) } // TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. // // Solidity: function transferFrom(address from, address to, uint256 tokenId) returns() func (_Dagent721 *Dagent721Transactor) TransferFrom(opts *bind.TransactOpts, from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _Dagent721.contract.Transact(opts, "transferFrom", from, to, tokenId) } // TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. // // Solidity: function transferFrom(address from, address to, uint256 tokenId) returns() func (_Dagent721 *Dagent721Session) TransferFrom(from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _Dagent721.Contract.TransferFrom(&_Dagent721.TransactOpts, from, to, tokenId) } // TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. // // Solidity: function transferFrom(address from, address to, uint256 tokenId) returns() func (_Dagent721 *Dagent721TransactorSession) TransferFrom(from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _Dagent721.Contract.TransferFrom(&_Dagent721.TransactOpts, from, to, tokenId) } // TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. // // Solidity: function transferOwnership(address newOwner) returns() func (_Dagent721 *Dagent721Transactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) { return _Dagent721.contract.Transact(opts, "transferOwnership", newOwner) } // TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. // // Solidity: function transferOwnership(address newOwner) returns() func (_Dagent721 *Dagent721Session) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { return _Dagent721.Contract.TransferOwnership(&_Dagent721.TransactOpts, newOwner) } // TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. // // Solidity: function transferOwnership(address newOwner) returns() func (_Dagent721 *Dagent721TransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { return _Dagent721.Contract.TransferOwnership(&_Dagent721.TransactOpts, newOwner) } // Unpause is a paid mutator transaction binding the contract method 0x3f4ba83a. // // Solidity: function unpause() returns() func (_Dagent721 *Dagent721Transactor) Unpause(opts *bind.TransactOpts) (*types.Transaction, error) { return _Dagent721.contract.Transact(opts, "unpause") } // Unpause is a paid mutator transaction binding the contract method 0x3f4ba83a. // // Solidity: function unpause() returns() func (_Dagent721 *Dagent721Session) Unpause() (*types.Transaction, error) { return _Dagent721.Contract.Unpause(&_Dagent721.TransactOpts) } // Unpause is a paid mutator transaction binding the contract method 0x3f4ba83a. // // Solidity: function unpause() returns() func (_Dagent721 *Dagent721TransactorSession) Unpause() (*types.Transaction, error) { return _Dagent721.Contract.Unpause(&_Dagent721.TransactOpts) } // UpdateAgentData is a paid mutator transaction binding the contract method 0xe96177c4. // // Solidity: function updateAgentData(uint256 agentId, bytes sysPrompt, string promptKey, uint256 promptIdx) returns() func (_Dagent721 *Dagent721Transactor) UpdateAgentData(opts *bind.TransactOpts, agentId *big.Int, sysPrompt []byte, promptKey string, promptIdx *big.Int) (*types.Transaction, error) { return _Dagent721.contract.Transact(opts, "updateAgentData", agentId, sysPrompt, promptKey, promptIdx) } // UpdateAgentData is a paid mutator transaction binding the contract method 0xe96177c4. // // Solidity: function updateAgentData(uint256 agentId, bytes sysPrompt, string promptKey, uint256 promptIdx) returns() func (_Dagent721 *Dagent721Session) UpdateAgentData(agentId *big.Int, sysPrompt []byte, promptKey string, promptIdx *big.Int) (*types.Transaction, error) { return _Dagent721.Contract.UpdateAgentData(&_Dagent721.TransactOpts, agentId, sysPrompt, promptKey, promptIdx) } // UpdateAgentData is a paid mutator transaction binding the contract method 0xe96177c4. // // Solidity: function updateAgentData(uint256 agentId, bytes sysPrompt, string promptKey, uint256 promptIdx) returns() func (_Dagent721 *Dagent721TransactorSession) UpdateAgentData(agentId *big.Int, sysPrompt []byte, promptKey string, promptIdx *big.Int) (*types.Transaction, error) { return _Dagent721.Contract.UpdateAgentData(&_Dagent721.TransactOpts, agentId, sysPrompt, promptKey, promptIdx) } // UpdateAgentDataWithSignature is a paid mutator transaction binding the contract method 0x1c83fb2c. // // Solidity: function updateAgentDataWithSignature(uint256 agentId, bytes sysPrompt, string promptKey, uint256 promptIdx, uint256 randomNonce, bytes signature) returns() func (_Dagent721 *Dagent721Transactor) UpdateAgentDataWithSignature(opts *bind.TransactOpts, agentId *big.Int, sysPrompt []byte, promptKey string, promptIdx *big.Int, randomNonce *big.Int, signature []byte) (*types.Transaction, error) { return _Dagent721.contract.Transact(opts, "updateAgentDataWithSignature", agentId, sysPrompt, promptKey, promptIdx, randomNonce, signature) } // UpdateAgentDataWithSignature is a paid mutator transaction binding the contract method 0x1c83fb2c. // // Solidity: function updateAgentDataWithSignature(uint256 agentId, bytes sysPrompt, string promptKey, uint256 promptIdx, uint256 randomNonce, bytes signature) returns() func (_Dagent721 *Dagent721Session) UpdateAgentDataWithSignature(agentId *big.Int, sysPrompt []byte, promptKey string, promptIdx *big.Int, randomNonce *big.Int, signature []byte) (*types.Transaction, error) { return _Dagent721.Contract.UpdateAgentDataWithSignature(&_Dagent721.TransactOpts, agentId, sysPrompt, promptKey, promptIdx, randomNonce, signature) } // UpdateAgentDataWithSignature is a paid mutator transaction binding the contract method 0x1c83fb2c. // // Solidity: function updateAgentDataWithSignature(uint256 agentId, bytes sysPrompt, string promptKey, uint256 promptIdx, uint256 randomNonce, bytes signature) returns() func (_Dagent721 *Dagent721TransactorSession) UpdateAgentDataWithSignature(agentId *big.Int, sysPrompt []byte, promptKey string, promptIdx *big.Int, randomNonce *big.Int, signature []byte) (*types.Transaction, error) { return _Dagent721.Contract.UpdateAgentDataWithSignature(&_Dagent721.TransactOpts, agentId, sysPrompt, promptKey, promptIdx, randomNonce, signature) } // UpdateAgentFee is a paid mutator transaction binding the contract method 0xb1fd1526. // // Solidity: function updateAgentFee(uint256 agentId, uint256 fee) returns() func (_Dagent721 *Dagent721Transactor) UpdateAgentFee(opts *bind.TransactOpts, agentId *big.Int, fee *big.Int) (*types.Transaction, error) { return _Dagent721.contract.Transact(opts, "updateAgentFee", agentId, fee) } // UpdateAgentFee is a paid mutator transaction binding the contract method 0xb1fd1526. // // Solidity: function updateAgentFee(uint256 agentId, uint256 fee) returns() func (_Dagent721 *Dagent721Session) UpdateAgentFee(agentId *big.Int, fee *big.Int) (*types.Transaction, error) { return _Dagent721.Contract.UpdateAgentFee(&_Dagent721.TransactOpts, agentId, fee) } // UpdateAgentFee is a paid mutator transaction binding the contract method 0xb1fd1526. // // Solidity: function updateAgentFee(uint256 agentId, uint256 fee) returns() func (_Dagent721 *Dagent721TransactorSession) UpdateAgentFee(agentId *big.Int, fee *big.Int) (*types.Transaction, error) { return _Dagent721.Contract.UpdateAgentFee(&_Dagent721.TransactOpts, agentId, fee) } // UpdateAgentModelId is a paid mutator transaction binding the contract method 0x0ffc8cf4. // // Solidity: function updateAgentModelId(uint256 agentId, uint32 newModelId) returns() func (_Dagent721 *Dagent721Transactor) UpdateAgentModelId(opts *bind.TransactOpts, agentId *big.Int, newModelId uint32) (*types.Transaction, error) { return _Dagent721.contract.Transact(opts, "updateAgentModelId", agentId, newModelId) } // UpdateAgentModelId is a paid mutator transaction binding the contract method 0x0ffc8cf4. // // Solidity: function updateAgentModelId(uint256 agentId, uint32 newModelId) returns() func (_Dagent721 *Dagent721Session) UpdateAgentModelId(agentId *big.Int, newModelId uint32) (*types.Transaction, error) { return _Dagent721.Contract.UpdateAgentModelId(&_Dagent721.TransactOpts, agentId, newModelId) } // UpdateAgentModelId is a paid mutator transaction binding the contract method 0x0ffc8cf4. // // Solidity: function updateAgentModelId(uint256 agentId, uint32 newModelId) returns() func (_Dagent721 *Dagent721TransactorSession) UpdateAgentModelId(agentId *big.Int, newModelId uint32) (*types.Transaction, error) { return _Dagent721.Contract.UpdateAgentModelId(&_Dagent721.TransactOpts, agentId, newModelId) } // UpdateAgentURI is a paid mutator transaction binding the contract method 0x6b595822. // // Solidity: function updateAgentURI(uint256 agentId, string uri) returns() func (_Dagent721 *Dagent721Transactor) UpdateAgentURI(opts *bind.TransactOpts, agentId *big.Int, uri string) (*types.Transaction, error) { return _Dagent721.contract.Transact(opts, "updateAgentURI", agentId, uri) } // UpdateAgentURI is a paid mutator transaction binding the contract method 0x6b595822. // // Solidity: function updateAgentURI(uint256 agentId, string uri) returns() func (_Dagent721 *Dagent721Session) UpdateAgentURI(agentId *big.Int, uri string) (*types.Transaction, error) { return _Dagent721.Contract.UpdateAgentURI(&_Dagent721.TransactOpts, agentId, uri) } // UpdateAgentURI is a paid mutator transaction binding the contract method 0x6b595822. // // Solidity: function updateAgentURI(uint256 agentId, string uri) returns() func (_Dagent721 *Dagent721TransactorSession) UpdateAgentURI(agentId *big.Int, uri string) (*types.Transaction, error) { return _Dagent721.Contract.UpdateAgentURI(&_Dagent721.TransactOpts, agentId, uri) } // UpdateAgentUriWithSignature is a paid mutator transaction binding the contract method 0xf5888779. // // Solidity: function updateAgentUriWithSignature(uint256 agentId, string uri, uint256 randomNonce, bytes signature) returns() func (_Dagent721 *Dagent721Transactor) UpdateAgentUriWithSignature(opts *bind.TransactOpts, agentId *big.Int, uri string, randomNonce *big.Int, signature []byte) (*types.Transaction, error) { return _Dagent721.contract.Transact(opts, "updateAgentUriWithSignature", agentId, uri, randomNonce, signature) } // UpdateAgentUriWithSignature is a paid mutator transaction binding the contract method 0xf5888779. // // Solidity: function updateAgentUriWithSignature(uint256 agentId, string uri, uint256 randomNonce, bytes signature) returns() func (_Dagent721 *Dagent721Session) UpdateAgentUriWithSignature(agentId *big.Int, uri string, randomNonce *big.Int, signature []byte) (*types.Transaction, error) { return _Dagent721.Contract.UpdateAgentUriWithSignature(&_Dagent721.TransactOpts, agentId, uri, randomNonce, signature) } // UpdateAgentUriWithSignature is a paid mutator transaction binding the contract method 0xf5888779. // // Solidity: function updateAgentUriWithSignature(uint256 agentId, string uri, uint256 randomNonce, bytes signature) returns() func (_Dagent721 *Dagent721TransactorSession) UpdateAgentUriWithSignature(agentId *big.Int, uri string, randomNonce *big.Int, signature []byte) (*types.Transaction, error) { return _Dagent721.Contract.UpdateAgentUriWithSignature(&_Dagent721.TransactOpts, agentId, uri, randomNonce, signature) } // UpdateGPUManager is a paid mutator transaction binding the contract method 0x88ee5fb2. // // Solidity: function updateGPUManager(address gpuManager) returns() func (_Dagent721 *Dagent721Transactor) UpdateGPUManager(opts *bind.TransactOpts, gpuManager common.Address) (*types.Transaction, error) { return _Dagent721.contract.Transact(opts, "updateGPUManager", gpuManager) } // UpdateGPUManager is a paid mutator transaction binding the contract method 0x88ee5fb2. // // Solidity: function updateGPUManager(address gpuManager) returns() func (_Dagent721 *Dagent721Session) UpdateGPUManager(gpuManager common.Address) (*types.Transaction, error) { return _Dagent721.Contract.UpdateGPUManager(&_Dagent721.TransactOpts, gpuManager) } // UpdateGPUManager is a paid mutator transaction binding the contract method 0x88ee5fb2. // // Solidity: function updateGPUManager(address gpuManager) returns() func (_Dagent721 *Dagent721TransactorSession) UpdateGPUManager(gpuManager common.Address) (*types.Transaction, error) { return _Dagent721.Contract.UpdateGPUManager(&_Dagent721.TransactOpts, gpuManager) } // UpdateMintPrice is a paid mutator transaction binding the contract method 0x00728e46. // // Solidity: function updateMintPrice(uint256 mintPrice) returns() func (_Dagent721 *Dagent721Transactor) UpdateMintPrice(opts *bind.TransactOpts, mintPrice *big.Int) (*types.Transaction, error) { return _Dagent721.contract.Transact(opts, "updateMintPrice", mintPrice) } // UpdateMintPrice is a paid mutator transaction binding the contract method 0x00728e46. // // Solidity: function updateMintPrice(uint256 mintPrice) returns() func (_Dagent721 *Dagent721Session) UpdateMintPrice(mintPrice *big.Int) (*types.Transaction, error) { return _Dagent721.Contract.UpdateMintPrice(&_Dagent721.TransactOpts, mintPrice) } // UpdateMintPrice is a paid mutator transaction binding the contract method 0x00728e46. // // Solidity: function updateMintPrice(uint256 mintPrice) returns() func (_Dagent721 *Dagent721TransactorSession) UpdateMintPrice(mintPrice *big.Int) (*types.Transaction, error) { return _Dagent721.Contract.UpdateMintPrice(&_Dagent721.TransactOpts, mintPrice) } // UpdateRoyaltyPortion is a paid mutator transaction binding the contract method 0x19e93993. // // Solidity: function updateRoyaltyPortion(uint16 royaltyPortion) returns() func (_Dagent721 *Dagent721Transactor) UpdateRoyaltyPortion(opts *bind.TransactOpts, royaltyPortion uint16) (*types.Transaction, error) { return _Dagent721.contract.Transact(opts, "updateRoyaltyPortion", royaltyPortion) } // UpdateRoyaltyPortion is a paid mutator transaction binding the contract method 0x19e93993. // // Solidity: function updateRoyaltyPortion(uint16 royaltyPortion) returns() func (_Dagent721 *Dagent721Session) UpdateRoyaltyPortion(royaltyPortion uint16) (*types.Transaction, error) { return _Dagent721.Contract.UpdateRoyaltyPortion(&_Dagent721.TransactOpts, royaltyPortion) } // UpdateRoyaltyPortion is a paid mutator transaction binding the contract method 0x19e93993. // // Solidity: function updateRoyaltyPortion(uint16 royaltyPortion) returns() func (_Dagent721 *Dagent721TransactorSession) UpdateRoyaltyPortion(royaltyPortion uint16) (*types.Transaction, error) { return _Dagent721.Contract.UpdateRoyaltyPortion(&_Dagent721.TransactOpts, royaltyPortion) } // UpdateRoyaltyReceiver is a paid mutator transaction binding the contract method 0x29dc4d9b. // // Solidity: function updateRoyaltyReceiver(address royaltyReceiver) returns() func (_Dagent721 *Dagent721Transactor) UpdateRoyaltyReceiver(opts *bind.TransactOpts, royaltyReceiver common.Address) (*types.Transaction, error) { return _Dagent721.contract.Transact(opts, "updateRoyaltyReceiver", royaltyReceiver) } // UpdateRoyaltyReceiver is a paid mutator transaction binding the contract method 0x29dc4d9b. // // Solidity: function updateRoyaltyReceiver(address royaltyReceiver) returns() func (_Dagent721 *Dagent721Session) UpdateRoyaltyReceiver(royaltyReceiver common.Address) (*types.Transaction, error) { return _Dagent721.Contract.UpdateRoyaltyReceiver(&_Dagent721.TransactOpts, royaltyReceiver) } // UpdateRoyaltyReceiver is a paid mutator transaction binding the contract method 0x29dc4d9b. // // Solidity: function updateRoyaltyReceiver(address royaltyReceiver) returns() func (_Dagent721 *Dagent721TransactorSession) UpdateRoyaltyReceiver(royaltyReceiver common.Address) (*types.Transaction, error) { return _Dagent721.Contract.UpdateRoyaltyReceiver(&_Dagent721.TransactOpts, royaltyReceiver) } // UpdateSchedulePrompt is a paid mutator transaction binding the contract method 0x1ddbc69a. // // Solidity: function updateSchedulePrompt(uint256 agentId, address newPromptScheduler) returns() func (_Dagent721 *Dagent721Transactor) UpdateSchedulePrompt(opts *bind.TransactOpts, agentId *big.Int, newPromptScheduler common.Address) (*types.Transaction, error) { return _Dagent721.contract.Transact(opts, "updateSchedulePrompt", agentId, newPromptScheduler) } // UpdateSchedulePrompt is a paid mutator transaction binding the contract method 0x1ddbc69a. // // Solidity: function updateSchedulePrompt(uint256 agentId, address newPromptScheduler) returns() func (_Dagent721 *Dagent721Session) UpdateSchedulePrompt(agentId *big.Int, newPromptScheduler common.Address) (*types.Transaction, error) { return _Dagent721.Contract.UpdateSchedulePrompt(&_Dagent721.TransactOpts, agentId, newPromptScheduler) } // UpdateSchedulePrompt is a paid mutator transaction binding the contract method 0x1ddbc69a. // // Solidity: function updateSchedulePrompt(uint256 agentId, address newPromptScheduler) returns() func (_Dagent721 *Dagent721TransactorSession) UpdateSchedulePrompt(agentId *big.Int, newPromptScheduler common.Address) (*types.Transaction, error) { return _Dagent721.Contract.UpdateSchedulePrompt(&_Dagent721.TransactOpts, agentId, newPromptScheduler) } // Dagent721AgentDataAddNewIterator is returned from FilterAgentDataAddNew and is used to iterate over the raw logs and unpacked data for AgentDataAddNew events raised by the Dagent721 contract. type Dagent721AgentDataAddNewIterator struct { Event *Dagent721AgentDataAddNew // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *Dagent721AgentDataAddNewIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(Dagent721AgentDataAddNew) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(Dagent721AgentDataAddNew) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *Dagent721AgentDataAddNewIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *Dagent721AgentDataAddNewIterator) Close() error { it.sub.Unsubscribe() return nil } // Dagent721AgentDataAddNew represents a AgentDataAddNew event raised by the Dagent721 contract. type Dagent721AgentDataAddNew struct { AgentId *big.Int SysPrompt [][]byte Raw types.Log // Blockchain specific contextual infos } // FilterAgentDataAddNew is a free log retrieval operation binding the contract event 0xdebec4c58e3b7c5817893e50cb1f9e65b65978e8c89bb4407eb0109d5887b258. // // Solidity: event AgentDataAddNew(uint256 indexed agentId, bytes[] sysPrompt) func (_Dagent721 *Dagent721Filterer) FilterAgentDataAddNew(opts *bind.FilterOpts, agentId []*big.Int) (*Dagent721AgentDataAddNewIterator, error) { var agentIdRule []interface{} for _, agentIdItem := range agentId { agentIdRule = append(agentIdRule, agentIdItem) } logs, sub, err := _Dagent721.contract.FilterLogs(opts, "AgentDataAddNew", agentIdRule) if err != nil { return nil, err } return &Dagent721AgentDataAddNewIterator{contract: _Dagent721.contract, event: "AgentDataAddNew", logs: logs, sub: sub}, nil } // WatchAgentDataAddNew is a free log subscription operation binding the contract event 0xdebec4c58e3b7c5817893e50cb1f9e65b65978e8c89bb4407eb0109d5887b258. // // Solidity: event AgentDataAddNew(uint256 indexed agentId, bytes[] sysPrompt) func (_Dagent721 *Dagent721Filterer) WatchAgentDataAddNew(opts *bind.WatchOpts, sink chan<- *Dagent721AgentDataAddNew, agentId []*big.Int) (event.Subscription, error) { var agentIdRule []interface{} for _, agentIdItem := range agentId { agentIdRule = append(agentIdRule, agentIdItem) } logs, sub, err := _Dagent721.contract.WatchLogs(opts, "AgentDataAddNew", agentIdRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(Dagent721AgentDataAddNew) if err := _Dagent721.contract.UnpackLog(event, "AgentDataAddNew", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseAgentDataAddNew is a log parse operation binding the contract event 0xdebec4c58e3b7c5817893e50cb1f9e65b65978e8c89bb4407eb0109d5887b258. // // Solidity: event AgentDataAddNew(uint256 indexed agentId, bytes[] sysPrompt) func (_Dagent721 *Dagent721Filterer) ParseAgentDataAddNew(log types.Log) (*Dagent721AgentDataAddNew, error) { event := new(Dagent721AgentDataAddNew) if err := _Dagent721.contract.UnpackLog(event, "AgentDataAddNew", log); err != nil { return nil, err } event.Raw = log return event, nil } // Dagent721AgentDataUpdateIterator is returned from FilterAgentDataUpdate and is used to iterate over the raw logs and unpacked data for AgentDataUpdate events raised by the Dagent721 contract. type Dagent721AgentDataUpdateIterator struct { Event *Dagent721AgentDataUpdate // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *Dagent721AgentDataUpdateIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(Dagent721AgentDataUpdate) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(Dagent721AgentDataUpdate) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *Dagent721AgentDataUpdateIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *Dagent721AgentDataUpdateIterator) Close() error { it.sub.Unsubscribe() return nil } // Dagent721AgentDataUpdate represents a AgentDataUpdate event raised by the Dagent721 contract. type Dagent721AgentDataUpdate struct { AgentId *big.Int PromptIndex *big.Int OldSysPrompt []byte NewSysPrompt []byte Raw types.Log // Blockchain specific contextual infos } // FilterAgentDataUpdate is a free log retrieval operation binding the contract event 0xe42abf7d4a793286da8cc1399cb577a1f5a0e133dfee371bb3a5abbdd77b011e. // // Solidity: event AgentDataUpdate(uint256 indexed agentId, uint256 promptIndex, bytes oldSysPrompt, bytes newSysPrompt) func (_Dagent721 *Dagent721Filterer) FilterAgentDataUpdate(opts *bind.FilterOpts, agentId []*big.Int) (*Dagent721AgentDataUpdateIterator, error) { var agentIdRule []interface{} for _, agentIdItem := range agentId { agentIdRule = append(agentIdRule, agentIdItem) } logs, sub, err := _Dagent721.contract.FilterLogs(opts, "AgentDataUpdate", agentIdRule) if err != nil { return nil, err } return &Dagent721AgentDataUpdateIterator{contract: _Dagent721.contract, event: "AgentDataUpdate", logs: logs, sub: sub}, nil } // WatchAgentDataUpdate is a free log subscription operation binding the contract event 0xe42abf7d4a793286da8cc1399cb577a1f5a0e133dfee371bb3a5abbdd77b011e. // // Solidity: event AgentDataUpdate(uint256 indexed agentId, uint256 promptIndex, bytes oldSysPrompt, bytes newSysPrompt) func (_Dagent721 *Dagent721Filterer) WatchAgentDataUpdate(opts *bind.WatchOpts, sink chan<- *Dagent721AgentDataUpdate, agentId []*big.Int) (event.Subscription, error) { var agentIdRule []interface{} for _, agentIdItem := range agentId { agentIdRule = append(agentIdRule, agentIdItem) } logs, sub, err := _Dagent721.contract.WatchLogs(opts, "AgentDataUpdate", agentIdRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(Dagent721AgentDataUpdate) if err := _Dagent721.contract.UnpackLog(event, "AgentDataUpdate", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseAgentDataUpdate is a log parse operation binding the contract event 0xe42abf7d4a793286da8cc1399cb577a1f5a0e133dfee371bb3a5abbdd77b011e. // // Solidity: event AgentDataUpdate(uint256 indexed agentId, uint256 promptIndex, bytes oldSysPrompt, bytes newSysPrompt) func (_Dagent721 *Dagent721Filterer) ParseAgentDataUpdate(log types.Log) (*Dagent721AgentDataUpdate, error) { event := new(Dagent721AgentDataUpdate) if err := _Dagent721.contract.UnpackLog(event, "AgentDataUpdate", log); err != nil { return nil, err } event.Raw = log return event, nil } // Dagent721AgentFeeUpdateIterator is returned from FilterAgentFeeUpdate and is used to iterate over the raw logs and unpacked data for AgentFeeUpdate events raised by the Dagent721 contract. type Dagent721AgentFeeUpdateIterator struct { Event *Dagent721AgentFeeUpdate // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *Dagent721AgentFeeUpdateIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(Dagent721AgentFeeUpdate) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(Dagent721AgentFeeUpdate) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *Dagent721AgentFeeUpdateIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *Dagent721AgentFeeUpdateIterator) Close() error { it.sub.Unsubscribe() return nil } // Dagent721AgentFeeUpdate represents a AgentFeeUpdate event raised by the Dagent721 contract. type Dagent721AgentFeeUpdate struct { AgentId *big.Int Fee *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterAgentFeeUpdate is a free log retrieval operation binding the contract event 0xa08d8197034aee8915921dd8aa7d95cf711690dd77f0b676dded49b3f9a632d1. // // Solidity: event AgentFeeUpdate(uint256 indexed agentId, uint256 fee) func (_Dagent721 *Dagent721Filterer) FilterAgentFeeUpdate(opts *bind.FilterOpts, agentId []*big.Int) (*Dagent721AgentFeeUpdateIterator, error) { var agentIdRule []interface{} for _, agentIdItem := range agentId { agentIdRule = append(agentIdRule, agentIdItem) } logs, sub, err := _Dagent721.contract.FilterLogs(opts, "AgentFeeUpdate", agentIdRule) if err != nil { return nil, err } return &Dagent721AgentFeeUpdateIterator{contract: _Dagent721.contract, event: "AgentFeeUpdate", logs: logs, sub: sub}, nil } // WatchAgentFeeUpdate is a free log subscription operation binding the contract event 0xa08d8197034aee8915921dd8aa7d95cf711690dd77f0b676dded49b3f9a632d1. // // Solidity: event AgentFeeUpdate(uint256 indexed agentId, uint256 fee) func (_Dagent721 *Dagent721Filterer) WatchAgentFeeUpdate(opts *bind.WatchOpts, sink chan<- *Dagent721AgentFeeUpdate, agentId []*big.Int) (event.Subscription, error) { var agentIdRule []interface{} for _, agentIdItem := range agentId { agentIdRule = append(agentIdRule, agentIdItem) } logs, sub, err := _Dagent721.contract.WatchLogs(opts, "AgentFeeUpdate", agentIdRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(Dagent721AgentFeeUpdate) if err := _Dagent721.contract.UnpackLog(event, "AgentFeeUpdate", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseAgentFeeUpdate is a log parse operation binding the contract event 0xa08d8197034aee8915921dd8aa7d95cf711690dd77f0b676dded49b3f9a632d1. // // Solidity: event AgentFeeUpdate(uint256 indexed agentId, uint256 fee) func (_Dagent721 *Dagent721Filterer) ParseAgentFeeUpdate(log types.Log) (*Dagent721AgentFeeUpdate, error) { event := new(Dagent721AgentFeeUpdate) if err := _Dagent721.contract.UnpackLog(event, "AgentFeeUpdate", log); err != nil { return nil, err } event.Raw = log return event, nil } // Dagent721AgentMissionAddNewIterator is returned from FilterAgentMissionAddNew and is used to iterate over the raw logs and unpacked data for AgentMissionAddNew events raised by the Dagent721 contract. type Dagent721AgentMissionAddNewIterator struct { Event *Dagent721AgentMissionAddNew // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *Dagent721AgentMissionAddNewIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(Dagent721AgentMissionAddNew) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(Dagent721AgentMissionAddNew) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *Dagent721AgentMissionAddNewIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *Dagent721AgentMissionAddNewIterator) Close() error { it.sub.Unsubscribe() return nil } // Dagent721AgentMissionAddNew represents a AgentMissionAddNew event raised by the Dagent721 contract. type Dagent721AgentMissionAddNew struct { AgentId *big.Int Missions [][]byte Raw types.Log // Blockchain specific contextual infos } // FilterAgentMissionAddNew is a free log retrieval operation binding the contract event 0x12ccdcc9c8e92b22004686225bd3df163c042e77b03eab4566800d40b5047f91. // // Solidity: event AgentMissionAddNew(uint256 indexed agentId, bytes[] missions) func (_Dagent721 *Dagent721Filterer) FilterAgentMissionAddNew(opts *bind.FilterOpts, agentId []*big.Int) (*Dagent721AgentMissionAddNewIterator, error) { var agentIdRule []interface{} for _, agentIdItem := range agentId { agentIdRule = append(agentIdRule, agentIdItem) } logs, sub, err := _Dagent721.contract.FilterLogs(opts, "AgentMissionAddNew", agentIdRule) if err != nil { return nil, err } return &Dagent721AgentMissionAddNewIterator{contract: _Dagent721.contract, event: "AgentMissionAddNew", logs: logs, sub: sub}, nil } // WatchAgentMissionAddNew is a free log subscription operation binding the contract event 0x12ccdcc9c8e92b22004686225bd3df163c042e77b03eab4566800d40b5047f91. // // Solidity: event AgentMissionAddNew(uint256 indexed agentId, bytes[] missions) func (_Dagent721 *Dagent721Filterer) WatchAgentMissionAddNew(opts *bind.WatchOpts, sink chan<- *Dagent721AgentMissionAddNew, agentId []*big.Int) (event.Subscription, error) { var agentIdRule []interface{} for _, agentIdItem := range agentId { agentIdRule = append(agentIdRule, agentIdItem) } logs, sub, err := _Dagent721.contract.WatchLogs(opts, "AgentMissionAddNew", agentIdRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(Dagent721AgentMissionAddNew) if err := _Dagent721.contract.UnpackLog(event, "AgentMissionAddNew", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseAgentMissionAddNew is a log parse operation binding the contract event 0x12ccdcc9c8e92b22004686225bd3df163c042e77b03eab4566800d40b5047f91. // // Solidity: event AgentMissionAddNew(uint256 indexed agentId, bytes[] missions) func (_Dagent721 *Dagent721Filterer) ParseAgentMissionAddNew(log types.Log) (*Dagent721AgentMissionAddNew, error) { event := new(Dagent721AgentMissionAddNew) if err := _Dagent721.contract.UnpackLog(event, "AgentMissionAddNew", log); err != nil { return nil, err } event.Raw = log return event, nil } // Dagent721AgentMissionUpdateIterator is returned from FilterAgentMissionUpdate and is used to iterate over the raw logs and unpacked data for AgentMissionUpdate events raised by the Dagent721 contract. type Dagent721AgentMissionUpdateIterator struct { Event *Dagent721AgentMissionUpdate // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *Dagent721AgentMissionUpdateIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(Dagent721AgentMissionUpdate) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(Dagent721AgentMissionUpdate) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *Dagent721AgentMissionUpdateIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *Dagent721AgentMissionUpdateIterator) Close() error { it.sub.Unsubscribe() return nil } // Dagent721AgentMissionUpdate represents a AgentMissionUpdate event raised by the Dagent721 contract. type Dagent721AgentMissionUpdate struct { AgentId *big.Int MissionIndex *big.Int OldSysMission []byte NewSysMission []byte Raw types.Log // Blockchain specific contextual infos } // FilterAgentMissionUpdate is a free log retrieval operation binding the contract event 0x0a9b80bd675e3f5788f1a5da687efd147dbc4729245a7f300ce1074bbd535127. // // Solidity: event AgentMissionUpdate(uint256 indexed agentId, uint256 missionIndex, bytes oldSysMission, bytes newSysMission) func (_Dagent721 *Dagent721Filterer) FilterAgentMissionUpdate(opts *bind.FilterOpts, agentId []*big.Int) (*Dagent721AgentMissionUpdateIterator, error) { var agentIdRule []interface{} for _, agentIdItem := range agentId { agentIdRule = append(agentIdRule, agentIdItem) } logs, sub, err := _Dagent721.contract.FilterLogs(opts, "AgentMissionUpdate", agentIdRule) if err != nil { return nil, err } return &Dagent721AgentMissionUpdateIterator{contract: _Dagent721.contract, event: "AgentMissionUpdate", logs: logs, sub: sub}, nil } // WatchAgentMissionUpdate is a free log subscription operation binding the contract event 0x0a9b80bd675e3f5788f1a5da687efd147dbc4729245a7f300ce1074bbd535127. // // Solidity: event AgentMissionUpdate(uint256 indexed agentId, uint256 missionIndex, bytes oldSysMission, bytes newSysMission) func (_Dagent721 *Dagent721Filterer) WatchAgentMissionUpdate(opts *bind.WatchOpts, sink chan<- *Dagent721AgentMissionUpdate, agentId []*big.Int) (event.Subscription, error) { var agentIdRule []interface{} for _, agentIdItem := range agentId { agentIdRule = append(agentIdRule, agentIdItem) } logs, sub, err := _Dagent721.contract.WatchLogs(opts, "AgentMissionUpdate", agentIdRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(Dagent721AgentMissionUpdate) if err := _Dagent721.contract.UnpackLog(event, "AgentMissionUpdate", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseAgentMissionUpdate is a log parse operation binding the contract event 0x0a9b80bd675e3f5788f1a5da687efd147dbc4729245a7f300ce1074bbd535127. // // Solidity: event AgentMissionUpdate(uint256 indexed agentId, uint256 missionIndex, bytes oldSysMission, bytes newSysMission) func (_Dagent721 *Dagent721Filterer) ParseAgentMissionUpdate(log types.Log) (*Dagent721AgentMissionUpdate, error) { event := new(Dagent721AgentMissionUpdate) if err := _Dagent721.contract.UnpackLog(event, "AgentMissionUpdate", log); err != nil { return nil, err } event.Raw = log return event, nil } // Dagent721AgentModelIdUpdateIterator is returned from FilterAgentModelIdUpdate and is used to iterate over the raw logs and unpacked data for AgentModelIdUpdate events raised by the Dagent721 contract. type Dagent721AgentModelIdUpdateIterator struct { Event *Dagent721AgentModelIdUpdate // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *Dagent721AgentModelIdUpdateIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(Dagent721AgentModelIdUpdate) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(Dagent721AgentModelIdUpdate) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *Dagent721AgentModelIdUpdateIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *Dagent721AgentModelIdUpdateIterator) Close() error { it.sub.Unsubscribe() return nil } // Dagent721AgentModelIdUpdate represents a AgentModelIdUpdate event raised by the Dagent721 contract. type Dagent721AgentModelIdUpdate struct { AgentId *big.Int OldModelId *big.Int NewModelId *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterAgentModelIdUpdate is a free log retrieval operation binding the contract event 0xe8662b9bac978d6b361a9cc824ecf5a8ea4cfb61ccbdd24dec6237ee9b7d7fa7. // // Solidity: event AgentModelIdUpdate(uint256 indexed agentId, uint256 oldModelId, uint256 newModelId) func (_Dagent721 *Dagent721Filterer) FilterAgentModelIdUpdate(opts *bind.FilterOpts, agentId []*big.Int) (*Dagent721AgentModelIdUpdateIterator, error) { var agentIdRule []interface{} for _, agentIdItem := range agentId { agentIdRule = append(agentIdRule, agentIdItem) } logs, sub, err := _Dagent721.contract.FilterLogs(opts, "AgentModelIdUpdate", agentIdRule) if err != nil { return nil, err } return &Dagent721AgentModelIdUpdateIterator{contract: _Dagent721.contract, event: "AgentModelIdUpdate", logs: logs, sub: sub}, nil } // WatchAgentModelIdUpdate is a free log subscription operation binding the contract event 0xe8662b9bac978d6b361a9cc824ecf5a8ea4cfb61ccbdd24dec6237ee9b7d7fa7. // // Solidity: event AgentModelIdUpdate(uint256 indexed agentId, uint256 oldModelId, uint256 newModelId) func (_Dagent721 *Dagent721Filterer) WatchAgentModelIdUpdate(opts *bind.WatchOpts, sink chan<- *Dagent721AgentModelIdUpdate, agentId []*big.Int) (event.Subscription, error) { var agentIdRule []interface{} for _, agentIdItem := range agentId { agentIdRule = append(agentIdRule, agentIdItem) } logs, sub, err := _Dagent721.contract.WatchLogs(opts, "AgentModelIdUpdate", agentIdRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(Dagent721AgentModelIdUpdate) if err := _Dagent721.contract.UnpackLog(event, "AgentModelIdUpdate", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseAgentModelIdUpdate is a log parse operation binding the contract event 0xe8662b9bac978d6b361a9cc824ecf5a8ea4cfb61ccbdd24dec6237ee9b7d7fa7. // // Solidity: event AgentModelIdUpdate(uint256 indexed agentId, uint256 oldModelId, uint256 newModelId) func (_Dagent721 *Dagent721Filterer) ParseAgentModelIdUpdate(log types.Log) (*Dagent721AgentModelIdUpdate, error) { event := new(Dagent721AgentModelIdUpdate) if err := _Dagent721.contract.UnpackLog(event, "AgentModelIdUpdate", log); err != nil { return nil, err } event.Raw = log return event, nil } // Dagent721AgentPromptSchedulerdUpdateIterator is returned from FilterAgentPromptSchedulerdUpdate and is used to iterate over the raw logs and unpacked data for AgentPromptSchedulerdUpdate events raised by the Dagent721 contract. type Dagent721AgentPromptSchedulerdUpdateIterator struct { Event *Dagent721AgentPromptSchedulerdUpdate // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *Dagent721AgentPromptSchedulerdUpdateIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(Dagent721AgentPromptSchedulerdUpdate) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(Dagent721AgentPromptSchedulerdUpdate) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *Dagent721AgentPromptSchedulerdUpdateIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *Dagent721AgentPromptSchedulerdUpdateIterator) Close() error { it.sub.Unsubscribe() return nil } // Dagent721AgentPromptSchedulerdUpdate represents a AgentPromptSchedulerdUpdate event raised by the Dagent721 contract. type Dagent721AgentPromptSchedulerdUpdate struct { AgentId *big.Int OldPromptScheduler common.Address NewOldPromptScheduler common.Address Raw types.Log // Blockchain specific contextual infos } // FilterAgentPromptSchedulerdUpdate is a free log retrieval operation binding the contract event 0x668af5d324df41df4dbf51978e1caa591bcf48468550da656523572a47d9abbd. // // Solidity: event AgentPromptSchedulerdUpdate(uint256 indexed agentId, address oldPromptScheduler, address newOldPromptScheduler) func (_Dagent721 *Dagent721Filterer) FilterAgentPromptSchedulerdUpdate(opts *bind.FilterOpts, agentId []*big.Int) (*Dagent721AgentPromptSchedulerdUpdateIterator, error) { var agentIdRule []interface{} for _, agentIdItem := range agentId { agentIdRule = append(agentIdRule, agentIdItem) } logs, sub, err := _Dagent721.contract.FilterLogs(opts, "AgentPromptSchedulerdUpdate", agentIdRule) if err != nil { return nil, err } return &Dagent721AgentPromptSchedulerdUpdateIterator{contract: _Dagent721.contract, event: "AgentPromptSchedulerdUpdate", logs: logs, sub: sub}, nil } // WatchAgentPromptSchedulerdUpdate is a free log subscription operation binding the contract event 0x668af5d324df41df4dbf51978e1caa591bcf48468550da656523572a47d9abbd. // // Solidity: event AgentPromptSchedulerdUpdate(uint256 indexed agentId, address oldPromptScheduler, address newOldPromptScheduler) func (_Dagent721 *Dagent721Filterer) WatchAgentPromptSchedulerdUpdate(opts *bind.WatchOpts, sink chan<- *Dagent721AgentPromptSchedulerdUpdate, agentId []*big.Int) (event.Subscription, error) { var agentIdRule []interface{} for _, agentIdItem := range agentId { agentIdRule = append(agentIdRule, agentIdItem) } logs, sub, err := _Dagent721.contract.WatchLogs(opts, "AgentPromptSchedulerdUpdate", agentIdRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(Dagent721AgentPromptSchedulerdUpdate) if err := _Dagent721.contract.UnpackLog(event, "AgentPromptSchedulerdUpdate", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseAgentPromptSchedulerdUpdate is a log parse operation binding the contract event 0x668af5d324df41df4dbf51978e1caa591bcf48468550da656523572a47d9abbd. // // Solidity: event AgentPromptSchedulerdUpdate(uint256 indexed agentId, address oldPromptScheduler, address newOldPromptScheduler) func (_Dagent721 *Dagent721Filterer) ParseAgentPromptSchedulerdUpdate(log types.Log) (*Dagent721AgentPromptSchedulerdUpdate, error) { event := new(Dagent721AgentPromptSchedulerdUpdate) if err := _Dagent721.contract.UnpackLog(event, "AgentPromptSchedulerdUpdate", log); err != nil { return nil, err } event.Raw = log return event, nil } // Dagent721AgentURIUpdateIterator is returned from FilterAgentURIUpdate and is used to iterate over the raw logs and unpacked data for AgentURIUpdate events raised by the Dagent721 contract. type Dagent721AgentURIUpdateIterator struct { Event *Dagent721AgentURIUpdate // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *Dagent721AgentURIUpdateIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(Dagent721AgentURIUpdate) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(Dagent721AgentURIUpdate) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *Dagent721AgentURIUpdateIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *Dagent721AgentURIUpdateIterator) Close() error { it.sub.Unsubscribe() return nil } // Dagent721AgentURIUpdate represents a AgentURIUpdate event raised by the Dagent721 contract. type Dagent721AgentURIUpdate struct { AgentId *big.Int Uri string Raw types.Log // Blockchain specific contextual infos } // FilterAgentURIUpdate is a free log retrieval operation binding the contract event 0x706a4e8eb2f354c7f4d96e5ea1984f36e72482629987edad78c9940ea037c362. // // Solidity: event AgentURIUpdate(uint256 indexed agentId, string uri) func (_Dagent721 *Dagent721Filterer) FilterAgentURIUpdate(opts *bind.FilterOpts, agentId []*big.Int) (*Dagent721AgentURIUpdateIterator, error) { var agentIdRule []interface{} for _, agentIdItem := range agentId { agentIdRule = append(agentIdRule, agentIdItem) } logs, sub, err := _Dagent721.contract.FilterLogs(opts, "AgentURIUpdate", agentIdRule) if err != nil { return nil, err } return &Dagent721AgentURIUpdateIterator{contract: _Dagent721.contract, event: "AgentURIUpdate", logs: logs, sub: sub}, nil } // WatchAgentURIUpdate is a free log subscription operation binding the contract event 0x706a4e8eb2f354c7f4d96e5ea1984f36e72482629987edad78c9940ea037c362. // // Solidity: event AgentURIUpdate(uint256 indexed agentId, string uri) func (_Dagent721 *Dagent721Filterer) WatchAgentURIUpdate(opts *bind.WatchOpts, sink chan<- *Dagent721AgentURIUpdate, agentId []*big.Int) (event.Subscription, error) { var agentIdRule []interface{} for _, agentIdItem := range agentId { agentIdRule = append(agentIdRule, agentIdItem) } logs, sub, err := _Dagent721.contract.WatchLogs(opts, "AgentURIUpdate", agentIdRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(Dagent721AgentURIUpdate) if err := _Dagent721.contract.UnpackLog(event, "AgentURIUpdate", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseAgentURIUpdate is a log parse operation binding the contract event 0x706a4e8eb2f354c7f4d96e5ea1984f36e72482629987edad78c9940ea037c362. // // Solidity: event AgentURIUpdate(uint256 indexed agentId, string uri) func (_Dagent721 *Dagent721Filterer) ParseAgentURIUpdate(log types.Log) (*Dagent721AgentURIUpdate, error) { event := new(Dagent721AgentURIUpdate) if err := _Dagent721.contract.UnpackLog(event, "AgentURIUpdate", log); err != nil { return nil, err } event.Raw = log return event, nil } // Dagent721ApprovalIterator is returned from FilterApproval and is used to iterate over the raw logs and unpacked data for Approval events raised by the Dagent721 contract. type Dagent721ApprovalIterator struct { Event *Dagent721Approval // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *Dagent721ApprovalIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(Dagent721Approval) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(Dagent721Approval) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *Dagent721ApprovalIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *Dagent721ApprovalIterator) Close() error { it.sub.Unsubscribe() return nil } // Dagent721Approval represents a Approval event raised by the Dagent721 contract. type Dagent721Approval struct { Owner common.Address Approved common.Address TokenId *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterApproval is a free log retrieval operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. // // Solidity: event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId) func (_Dagent721 *Dagent721Filterer) FilterApproval(opts *bind.FilterOpts, owner []common.Address, approved []common.Address, tokenId []*big.Int) (*Dagent721ApprovalIterator, error) { var ownerRule []interface{} for _, ownerItem := range owner { ownerRule = append(ownerRule, ownerItem) } var approvedRule []interface{} for _, approvedItem := range approved { approvedRule = append(approvedRule, approvedItem) } var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _Dagent721.contract.FilterLogs(opts, "Approval", ownerRule, approvedRule, tokenIdRule) if err != nil { return nil, err } return &Dagent721ApprovalIterator{contract: _Dagent721.contract, event: "Approval", logs: logs, sub: sub}, nil } // WatchApproval is a free log subscription operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. // // Solidity: event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId) func (_Dagent721 *Dagent721Filterer) WatchApproval(opts *bind.WatchOpts, sink chan<- *Dagent721Approval, owner []common.Address, approved []common.Address, tokenId []*big.Int) (event.Subscription, error) { var ownerRule []interface{} for _, ownerItem := range owner { ownerRule = append(ownerRule, ownerItem) } var approvedRule []interface{} for _, approvedItem := range approved { approvedRule = append(approvedRule, approvedItem) } var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _Dagent721.contract.WatchLogs(opts, "Approval", ownerRule, approvedRule, tokenIdRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(Dagent721Approval) if err := _Dagent721.contract.UnpackLog(event, "Approval", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseApproval is a log parse operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. // // Solidity: event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId) func (_Dagent721 *Dagent721Filterer) ParseApproval(log types.Log) (*Dagent721Approval, error) { event := new(Dagent721Approval) if err := _Dagent721.contract.UnpackLog(event, "Approval", log); err != nil { return nil, err } event.Raw = log return event, nil } // Dagent721ApprovalForAllIterator is returned from FilterApprovalForAll and is used to iterate over the raw logs and unpacked data for ApprovalForAll events raised by the Dagent721 contract. type Dagent721ApprovalForAllIterator struct { Event *Dagent721ApprovalForAll // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *Dagent721ApprovalForAllIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(Dagent721ApprovalForAll) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(Dagent721ApprovalForAll) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *Dagent721ApprovalForAllIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *Dagent721ApprovalForAllIterator) Close() error { it.sub.Unsubscribe() return nil } // Dagent721ApprovalForAll represents a ApprovalForAll event raised by the Dagent721 contract. type Dagent721ApprovalForAll struct { Owner common.Address Operator common.Address Approved bool Raw types.Log // Blockchain specific contextual infos } // FilterApprovalForAll is a free log retrieval operation binding the contract event 0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31. // // Solidity: event ApprovalForAll(address indexed owner, address indexed operator, bool approved) func (_Dagent721 *Dagent721Filterer) FilterApprovalForAll(opts *bind.FilterOpts, owner []common.Address, operator []common.Address) (*Dagent721ApprovalForAllIterator, error) { var ownerRule []interface{} for _, ownerItem := range owner { ownerRule = append(ownerRule, ownerItem) } var operatorRule []interface{} for _, operatorItem := range operator { operatorRule = append(operatorRule, operatorItem) } logs, sub, err := _Dagent721.contract.FilterLogs(opts, "ApprovalForAll", ownerRule, operatorRule) if err != nil { return nil, err } return &Dagent721ApprovalForAllIterator{contract: _Dagent721.contract, event: "ApprovalForAll", logs: logs, sub: sub}, nil } // WatchApprovalForAll is a free log subscription operation binding the contract event 0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31. // // Solidity: event ApprovalForAll(address indexed owner, address indexed operator, bool approved) func (_Dagent721 *Dagent721Filterer) WatchApprovalForAll(opts *bind.WatchOpts, sink chan<- *Dagent721ApprovalForAll, owner []common.Address, operator []common.Address) (event.Subscription, error) { var ownerRule []interface{} for _, ownerItem := range owner { ownerRule = append(ownerRule, ownerItem) } var operatorRule []interface{} for _, operatorItem := range operator { operatorRule = append(operatorRule, operatorItem) } logs, sub, err := _Dagent721.contract.WatchLogs(opts, "ApprovalForAll", ownerRule, operatorRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(Dagent721ApprovalForAll) if err := _Dagent721.contract.UnpackLog(event, "ApprovalForAll", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseApprovalForAll is a log parse operation binding the contract event 0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31. // // Solidity: event ApprovalForAll(address indexed owner, address indexed operator, bool approved) func (_Dagent721 *Dagent721Filterer) ParseApprovalForAll(log types.Log) (*Dagent721ApprovalForAll, error) { event := new(Dagent721ApprovalForAll) if err := _Dagent721.contract.UnpackLog(event, "ApprovalForAll", log); err != nil { return nil, err } event.Raw = log return event, nil } // Dagent721BatchMetadataUpdateIterator is returned from FilterBatchMetadataUpdate and is used to iterate over the raw logs and unpacked data for BatchMetadataUpdate events raised by the Dagent721 contract. type Dagent721BatchMetadataUpdateIterator struct { Event *Dagent721BatchMetadataUpdate // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *Dagent721BatchMetadataUpdateIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(Dagent721BatchMetadataUpdate) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(Dagent721BatchMetadataUpdate) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *Dagent721BatchMetadataUpdateIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *Dagent721BatchMetadataUpdateIterator) Close() error { it.sub.Unsubscribe() return nil } // Dagent721BatchMetadataUpdate represents a BatchMetadataUpdate event raised by the Dagent721 contract. type Dagent721BatchMetadataUpdate struct { FromTokenId *big.Int ToTokenId *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterBatchMetadataUpdate is a free log retrieval operation binding the contract event 0x6bd5c950a8d8df17f772f5af37cb3655737899cbf903264b9795592da439661c. // // Solidity: event BatchMetadataUpdate(uint256 _fromTokenId, uint256 _toTokenId) func (_Dagent721 *Dagent721Filterer) FilterBatchMetadataUpdate(opts *bind.FilterOpts) (*Dagent721BatchMetadataUpdateIterator, error) { logs, sub, err := _Dagent721.contract.FilterLogs(opts, "BatchMetadataUpdate") if err != nil { return nil, err } return &Dagent721BatchMetadataUpdateIterator{contract: _Dagent721.contract, event: "BatchMetadataUpdate", logs: logs, sub: sub}, nil } // WatchBatchMetadataUpdate is a free log subscription operation binding the contract event 0x6bd5c950a8d8df17f772f5af37cb3655737899cbf903264b9795592da439661c. // // Solidity: event BatchMetadataUpdate(uint256 _fromTokenId, uint256 _toTokenId) func (_Dagent721 *Dagent721Filterer) WatchBatchMetadataUpdate(opts *bind.WatchOpts, sink chan<- *Dagent721BatchMetadataUpdate) (event.Subscription, error) { logs, sub, err := _Dagent721.contract.WatchLogs(opts, "BatchMetadataUpdate") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(Dagent721BatchMetadataUpdate) if err := _Dagent721.contract.UnpackLog(event, "BatchMetadataUpdate", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseBatchMetadataUpdate is a log parse operation binding the contract event 0x6bd5c950a8d8df17f772f5af37cb3655737899cbf903264b9795592da439661c. // // Solidity: event BatchMetadataUpdate(uint256 _fromTokenId, uint256 _toTokenId) func (_Dagent721 *Dagent721Filterer) ParseBatchMetadataUpdate(log types.Log) (*Dagent721BatchMetadataUpdate, error) { event := new(Dagent721BatchMetadataUpdate) if err := _Dagent721.contract.UnpackLog(event, "BatchMetadataUpdate", log); err != nil { return nil, err } event.Raw = log return event, nil } // Dagent721InferencePerformedIterator is returned from FilterInferencePerformed and is used to iterate over the raw logs and unpacked data for InferencePerformed events raised by the Dagent721 contract. type Dagent721InferencePerformedIterator struct { Event *Dagent721InferencePerformed // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *Dagent721InferencePerformedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(Dagent721InferencePerformed) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(Dagent721InferencePerformed) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *Dagent721InferencePerformedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *Dagent721InferencePerformedIterator) Close() error { it.sub.Unsubscribe() return nil } // Dagent721InferencePerformed represents a InferencePerformed event raised by the Dagent721 contract. type Dagent721InferencePerformed struct { TokenId *big.Int Caller common.Address Data []byte Fee *big.Int ExternalData string InferenceId *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterInferencePerformed is a free log retrieval operation binding the contract event 0xcf35460eca25a0549d5eb14c712236d61c9a0bad90c834f996c5f2a98d332719. // // Solidity: event InferencePerformed(uint256 indexed tokenId, address indexed caller, bytes data, uint256 fee, string externalData, uint256 inferenceId) func (_Dagent721 *Dagent721Filterer) FilterInferencePerformed(opts *bind.FilterOpts, tokenId []*big.Int, caller []common.Address) (*Dagent721InferencePerformedIterator, error) { var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } var callerRule []interface{} for _, callerItem := range caller { callerRule = append(callerRule, callerItem) } logs, sub, err := _Dagent721.contract.FilterLogs(opts, "InferencePerformed", tokenIdRule, callerRule) if err != nil { return nil, err } return &Dagent721InferencePerformedIterator{contract: _Dagent721.contract, event: "InferencePerformed", logs: logs, sub: sub}, nil } // WatchInferencePerformed is a free log subscription operation binding the contract event 0xcf35460eca25a0549d5eb14c712236d61c9a0bad90c834f996c5f2a98d332719. // // Solidity: event InferencePerformed(uint256 indexed tokenId, address indexed caller, bytes data, uint256 fee, string externalData, uint256 inferenceId) func (_Dagent721 *Dagent721Filterer) WatchInferencePerformed(opts *bind.WatchOpts, sink chan<- *Dagent721InferencePerformed, tokenId []*big.Int, caller []common.Address) (event.Subscription, error) { var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } var callerRule []interface{} for _, callerItem := range caller { callerRule = append(callerRule, callerItem) } logs, sub, err := _Dagent721.contract.WatchLogs(opts, "InferencePerformed", tokenIdRule, callerRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(Dagent721InferencePerformed) if err := _Dagent721.contract.UnpackLog(event, "InferencePerformed", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseInferencePerformed is a log parse operation binding the contract event 0xcf35460eca25a0549d5eb14c712236d61c9a0bad90c834f996c5f2a98d332719. // // Solidity: event InferencePerformed(uint256 indexed tokenId, address indexed caller, bytes data, uint256 fee, string externalData, uint256 inferenceId) func (_Dagent721 *Dagent721Filterer) ParseInferencePerformed(log types.Log) (*Dagent721InferencePerformed, error) { event := new(Dagent721InferencePerformed) if err := _Dagent721.contract.UnpackLog(event, "InferencePerformed", log); err != nil { return nil, err } event.Raw = log return event, nil } // Dagent721InitializedIterator is returned from FilterInitialized and is used to iterate over the raw logs and unpacked data for Initialized events raised by the Dagent721 contract. type Dagent721InitializedIterator struct { Event *Dagent721Initialized // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *Dagent721InitializedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(Dagent721Initialized) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(Dagent721Initialized) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *Dagent721InitializedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *Dagent721InitializedIterator) Close() error { it.sub.Unsubscribe() return nil } // Dagent721Initialized represents a Initialized event raised by the Dagent721 contract. type Dagent721Initialized struct { Version uint8 Raw types.Log // Blockchain specific contextual infos } // FilterInitialized is a free log retrieval operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. // // Solidity: event Initialized(uint8 version) func (_Dagent721 *Dagent721Filterer) FilterInitialized(opts *bind.FilterOpts) (*Dagent721InitializedIterator, error) { logs, sub, err := _Dagent721.contract.FilterLogs(opts, "Initialized") if err != nil { return nil, err } return &Dagent721InitializedIterator{contract: _Dagent721.contract, event: "Initialized", logs: logs, sub: sub}, nil } // WatchInitialized is a free log subscription operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. // // Solidity: event Initialized(uint8 version) func (_Dagent721 *Dagent721Filterer) WatchInitialized(opts *bind.WatchOpts, sink chan<- *Dagent721Initialized) (event.Subscription, error) { logs, sub, err := _Dagent721.contract.WatchLogs(opts, "Initialized") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(Dagent721Initialized) if err := _Dagent721.contract.UnpackLog(event, "Initialized", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseInitialized is a log parse operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. // // Solidity: event Initialized(uint8 version) func (_Dagent721 *Dagent721Filterer) ParseInitialized(log types.Log) (*Dagent721Initialized, error) { event := new(Dagent721Initialized) if err := _Dagent721.contract.UnpackLog(event, "Initialized", log); err != nil { return nil, err } event.Raw = log return event, nil } // Dagent721MetadataUpdateIterator is returned from FilterMetadataUpdate and is used to iterate over the raw logs and unpacked data for MetadataUpdate events raised by the Dagent721 contract. type Dagent721MetadataUpdateIterator struct { Event *Dagent721MetadataUpdate // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *Dagent721MetadataUpdateIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(Dagent721MetadataUpdate) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(Dagent721MetadataUpdate) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *Dagent721MetadataUpdateIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *Dagent721MetadataUpdateIterator) Close() error { it.sub.Unsubscribe() return nil } // Dagent721MetadataUpdate represents a MetadataUpdate event raised by the Dagent721 contract. type Dagent721MetadataUpdate struct { TokenId *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterMetadataUpdate is a free log retrieval operation binding the contract event 0xf8e1a15aba9398e019f0b49df1a4fde98ee17ae345cb5f6b5e2c27f5033e8ce7. // // Solidity: event MetadataUpdate(uint256 _tokenId) func (_Dagent721 *Dagent721Filterer) FilterMetadataUpdate(opts *bind.FilterOpts) (*Dagent721MetadataUpdateIterator, error) { logs, sub, err := _Dagent721.contract.FilterLogs(opts, "MetadataUpdate") if err != nil { return nil, err } return &Dagent721MetadataUpdateIterator{contract: _Dagent721.contract, event: "MetadataUpdate", logs: logs, sub: sub}, nil } // WatchMetadataUpdate is a free log subscription operation binding the contract event 0xf8e1a15aba9398e019f0b49df1a4fde98ee17ae345cb5f6b5e2c27f5033e8ce7. // // Solidity: event MetadataUpdate(uint256 _tokenId) func (_Dagent721 *Dagent721Filterer) WatchMetadataUpdate(opts *bind.WatchOpts, sink chan<- *Dagent721MetadataUpdate) (event.Subscription, error) { logs, sub, err := _Dagent721.contract.WatchLogs(opts, "MetadataUpdate") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(Dagent721MetadataUpdate) if err := _Dagent721.contract.UnpackLog(event, "MetadataUpdate", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseMetadataUpdate is a log parse operation binding the contract event 0xf8e1a15aba9398e019f0b49df1a4fde98ee17ae345cb5f6b5e2c27f5033e8ce7. // // Solidity: event MetadataUpdate(uint256 _tokenId) func (_Dagent721 *Dagent721Filterer) ParseMetadataUpdate(log types.Log) (*Dagent721MetadataUpdate, error) { event := new(Dagent721MetadataUpdate) if err := _Dagent721.contract.UnpackLog(event, "MetadataUpdate", log); err != nil { return nil, err } event.Raw = log return event, nil } // Dagent721MintPriceUpdateIterator is returned from FilterMintPriceUpdate and is used to iterate over the raw logs and unpacked data for MintPriceUpdate events raised by the Dagent721 contract. type Dagent721MintPriceUpdateIterator struct { Event *Dagent721MintPriceUpdate // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *Dagent721MintPriceUpdateIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(Dagent721MintPriceUpdate) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(Dagent721MintPriceUpdate) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *Dagent721MintPriceUpdateIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *Dagent721MintPriceUpdateIterator) Close() error { it.sub.Unsubscribe() return nil } // Dagent721MintPriceUpdate represents a MintPriceUpdate event raised by the Dagent721 contract. type Dagent721MintPriceUpdate struct { NewValue *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterMintPriceUpdate is a free log retrieval operation binding the contract event 0x23050b539195eebd064c1bec834445b7d028a20c345600e868a74d7ca93c5e86. // // Solidity: event MintPriceUpdate(uint256 newValue) func (_Dagent721 *Dagent721Filterer) FilterMintPriceUpdate(opts *bind.FilterOpts) (*Dagent721MintPriceUpdateIterator, error) { logs, sub, err := _Dagent721.contract.FilterLogs(opts, "MintPriceUpdate") if err != nil { return nil, err } return &Dagent721MintPriceUpdateIterator{contract: _Dagent721.contract, event: "MintPriceUpdate", logs: logs, sub: sub}, nil } // WatchMintPriceUpdate is a free log subscription operation binding the contract event 0x23050b539195eebd064c1bec834445b7d028a20c345600e868a74d7ca93c5e86. // // Solidity: event MintPriceUpdate(uint256 newValue) func (_Dagent721 *Dagent721Filterer) WatchMintPriceUpdate(opts *bind.WatchOpts, sink chan<- *Dagent721MintPriceUpdate) (event.Subscription, error) { logs, sub, err := _Dagent721.contract.WatchLogs(opts, "MintPriceUpdate") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(Dagent721MintPriceUpdate) if err := _Dagent721.contract.UnpackLog(event, "MintPriceUpdate", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseMintPriceUpdate is a log parse operation binding the contract event 0x23050b539195eebd064c1bec834445b7d028a20c345600e868a74d7ca93c5e86. // // Solidity: event MintPriceUpdate(uint256 newValue) func (_Dagent721 *Dagent721Filterer) ParseMintPriceUpdate(log types.Log) (*Dagent721MintPriceUpdate, error) { event := new(Dagent721MintPriceUpdate) if err := _Dagent721.contract.UnpackLog(event, "MintPriceUpdate", log); err != nil { return nil, err } event.Raw = log return event, nil } // Dagent721NewTokenIterator is returned from FilterNewToken and is used to iterate over the raw logs and unpacked data for NewToken events raised by the Dagent721 contract. type Dagent721NewTokenIterator struct { Event *Dagent721NewToken // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *Dagent721NewTokenIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(Dagent721NewToken) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(Dagent721NewToken) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *Dagent721NewTokenIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *Dagent721NewTokenIterator) Close() error { it.sub.Unsubscribe() return nil } // Dagent721NewToken represents a NewToken event raised by the Dagent721 contract. type Dagent721NewToken struct { TokenId *big.Int Uri string SysPrompt []byte Fee *big.Int Minter common.Address Raw types.Log // Blockchain specific contextual infos } // FilterNewToken is a free log retrieval operation binding the contract event 0x61beab98a81083e3c0239c33e149bef1316ca78f15b9f29125039f5521a06d06. // // Solidity: event NewToken(uint256 indexed tokenId, string uri, bytes sysPrompt, uint256 fee, address indexed minter) func (_Dagent721 *Dagent721Filterer) FilterNewToken(opts *bind.FilterOpts, tokenId []*big.Int, minter []common.Address) (*Dagent721NewTokenIterator, error) { var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } var minterRule []interface{} for _, minterItem := range minter { minterRule = append(minterRule, minterItem) } logs, sub, err := _Dagent721.contract.FilterLogs(opts, "NewToken", tokenIdRule, minterRule) if err != nil { return nil, err } return &Dagent721NewTokenIterator{contract: _Dagent721.contract, event: "NewToken", logs: logs, sub: sub}, nil } // WatchNewToken is a free log subscription operation binding the contract event 0x61beab98a81083e3c0239c33e149bef1316ca78f15b9f29125039f5521a06d06. // // Solidity: event NewToken(uint256 indexed tokenId, string uri, bytes sysPrompt, uint256 fee, address indexed minter) func (_Dagent721 *Dagent721Filterer) WatchNewToken(opts *bind.WatchOpts, sink chan<- *Dagent721NewToken, tokenId []*big.Int, minter []common.Address) (event.Subscription, error) { var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } var minterRule []interface{} for _, minterItem := range minter { minterRule = append(minterRule, minterItem) } logs, sub, err := _Dagent721.contract.WatchLogs(opts, "NewToken", tokenIdRule, minterRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(Dagent721NewToken) if err := _Dagent721.contract.UnpackLog(event, "NewToken", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseNewToken is a log parse operation binding the contract event 0x61beab98a81083e3c0239c33e149bef1316ca78f15b9f29125039f5521a06d06. // // Solidity: event NewToken(uint256 indexed tokenId, string uri, bytes sysPrompt, uint256 fee, address indexed minter) func (_Dagent721 *Dagent721Filterer) ParseNewToken(log types.Log) (*Dagent721NewToken, error) { event := new(Dagent721NewToken) if err := _Dagent721.contract.UnpackLog(event, "NewToken", log); err != nil { return nil, err } event.Raw = log return event, nil } // Dagent721OwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the Dagent721 contract. type Dagent721OwnershipTransferredIterator struct { Event *Dagent721OwnershipTransferred // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *Dagent721OwnershipTransferredIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(Dagent721OwnershipTransferred) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(Dagent721OwnershipTransferred) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *Dagent721OwnershipTransferredIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *Dagent721OwnershipTransferredIterator) Close() error { it.sub.Unsubscribe() return nil } // Dagent721OwnershipTransferred represents a OwnershipTransferred event raised by the Dagent721 contract. type Dagent721OwnershipTransferred struct { PreviousOwner common.Address NewOwner common.Address Raw types.Log // Blockchain specific contextual infos } // FilterOwnershipTransferred is a free log retrieval operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. // // Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) func (_Dagent721 *Dagent721Filterer) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*Dagent721OwnershipTransferredIterator, error) { var previousOwnerRule []interface{} for _, previousOwnerItem := range previousOwner { previousOwnerRule = append(previousOwnerRule, previousOwnerItem) } var newOwnerRule []interface{} for _, newOwnerItem := range newOwner { newOwnerRule = append(newOwnerRule, newOwnerItem) } logs, sub, err := _Dagent721.contract.FilterLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) if err != nil { return nil, err } return &Dagent721OwnershipTransferredIterator{contract: _Dagent721.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil } // WatchOwnershipTransferred is a free log subscription operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. // // Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) func (_Dagent721 *Dagent721Filterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *Dagent721OwnershipTransferred, previousOwner []common.Address, newOwner []common.Address) (event.Subscription, error) { var previousOwnerRule []interface{} for _, previousOwnerItem := range previousOwner { previousOwnerRule = append(previousOwnerRule, previousOwnerItem) } var newOwnerRule []interface{} for _, newOwnerItem := range newOwner { newOwnerRule = append(newOwnerRule, newOwnerItem) } logs, sub, err := _Dagent721.contract.WatchLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(Dagent721OwnershipTransferred) if err := _Dagent721.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseOwnershipTransferred is a log parse operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. // // Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) func (_Dagent721 *Dagent721Filterer) ParseOwnershipTransferred(log types.Log) (*Dagent721OwnershipTransferred, error) { event := new(Dagent721OwnershipTransferred) if err := _Dagent721.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { return nil, err } event.Raw = log return event, nil } // Dagent721PausedIterator is returned from FilterPaused and is used to iterate over the raw logs and unpacked data for Paused events raised by the Dagent721 contract. type Dagent721PausedIterator struct { Event *Dagent721Paused // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *Dagent721PausedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(Dagent721Paused) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(Dagent721Paused) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *Dagent721PausedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *Dagent721PausedIterator) Close() error { it.sub.Unsubscribe() return nil } // Dagent721Paused represents a Paused event raised by the Dagent721 contract. type Dagent721Paused struct { Account common.Address Raw types.Log // Blockchain specific contextual infos } // FilterPaused is a free log retrieval operation binding the contract event 0x62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258. // // Solidity: event Paused(address account) func (_Dagent721 *Dagent721Filterer) FilterPaused(opts *bind.FilterOpts) (*Dagent721PausedIterator, error) { logs, sub, err := _Dagent721.contract.FilterLogs(opts, "Paused") if err != nil { return nil, err } return &Dagent721PausedIterator{contract: _Dagent721.contract, event: "Paused", logs: logs, sub: sub}, nil } // WatchPaused is a free log subscription operation binding the contract event 0x62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258. // // Solidity: event Paused(address account) func (_Dagent721 *Dagent721Filterer) WatchPaused(opts *bind.WatchOpts, sink chan<- *Dagent721Paused) (event.Subscription, error) { logs, sub, err := _Dagent721.contract.WatchLogs(opts, "Paused") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(Dagent721Paused) if err := _Dagent721.contract.UnpackLog(event, "Paused", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParsePaused is a log parse operation binding the contract event 0x62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258. // // Solidity: event Paused(address account) func (_Dagent721 *Dagent721Filterer) ParsePaused(log types.Log) (*Dagent721Paused, error) { event := new(Dagent721Paused) if err := _Dagent721.contract.UnpackLog(event, "Paused", log); err != nil { return nil, err } event.Raw = log return event, nil } // Dagent721RoyaltyPortionUpdateIterator is returned from FilterRoyaltyPortionUpdate and is used to iterate over the raw logs and unpacked data for RoyaltyPortionUpdate events raised by the Dagent721 contract. type Dagent721RoyaltyPortionUpdateIterator struct { Event *Dagent721RoyaltyPortionUpdate // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *Dagent721RoyaltyPortionUpdateIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(Dagent721RoyaltyPortionUpdate) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(Dagent721RoyaltyPortionUpdate) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *Dagent721RoyaltyPortionUpdateIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *Dagent721RoyaltyPortionUpdateIterator) Close() error { it.sub.Unsubscribe() return nil } // Dagent721RoyaltyPortionUpdate represents a RoyaltyPortionUpdate event raised by the Dagent721 contract. type Dagent721RoyaltyPortionUpdate struct { NewValue uint16 Raw types.Log // Blockchain specific contextual infos } // FilterRoyaltyPortionUpdate is a free log retrieval operation binding the contract event 0xb1f3037624bd2d961f6d56696cc10ccc3a676db381e671b1bc58f0ab1f686dd5. // // Solidity: event RoyaltyPortionUpdate(uint16 newValue) func (_Dagent721 *Dagent721Filterer) FilterRoyaltyPortionUpdate(opts *bind.FilterOpts) (*Dagent721RoyaltyPortionUpdateIterator, error) { logs, sub, err := _Dagent721.contract.FilterLogs(opts, "RoyaltyPortionUpdate") if err != nil { return nil, err } return &Dagent721RoyaltyPortionUpdateIterator{contract: _Dagent721.contract, event: "RoyaltyPortionUpdate", logs: logs, sub: sub}, nil } // WatchRoyaltyPortionUpdate is a free log subscription operation binding the contract event 0xb1f3037624bd2d961f6d56696cc10ccc3a676db381e671b1bc58f0ab1f686dd5. // // Solidity: event RoyaltyPortionUpdate(uint16 newValue) func (_Dagent721 *Dagent721Filterer) WatchRoyaltyPortionUpdate(opts *bind.WatchOpts, sink chan<- *Dagent721RoyaltyPortionUpdate) (event.Subscription, error) { logs, sub, err := _Dagent721.contract.WatchLogs(opts, "RoyaltyPortionUpdate") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(Dagent721RoyaltyPortionUpdate) if err := _Dagent721.contract.UnpackLog(event, "RoyaltyPortionUpdate", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseRoyaltyPortionUpdate is a log parse operation binding the contract event 0xb1f3037624bd2d961f6d56696cc10ccc3a676db381e671b1bc58f0ab1f686dd5. // // Solidity: event RoyaltyPortionUpdate(uint16 newValue) func (_Dagent721 *Dagent721Filterer) ParseRoyaltyPortionUpdate(log types.Log) (*Dagent721RoyaltyPortionUpdate, error) { event := new(Dagent721RoyaltyPortionUpdate) if err := _Dagent721.contract.UnpackLog(event, "RoyaltyPortionUpdate", log); err != nil { return nil, err } event.Raw = log return event, nil } // Dagent721RoyaltyReceiverUpdateIterator is returned from FilterRoyaltyReceiverUpdate and is used to iterate over the raw logs and unpacked data for RoyaltyReceiverUpdate events raised by the Dagent721 contract. type Dagent721RoyaltyReceiverUpdateIterator struct { Event *Dagent721RoyaltyReceiverUpdate // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *Dagent721RoyaltyReceiverUpdateIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(Dagent721RoyaltyReceiverUpdate) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(Dagent721RoyaltyReceiverUpdate) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *Dagent721RoyaltyReceiverUpdateIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *Dagent721RoyaltyReceiverUpdateIterator) Close() error { it.sub.Unsubscribe() return nil } // Dagent721RoyaltyReceiverUpdate represents a RoyaltyReceiverUpdate event raised by the Dagent721 contract. type Dagent721RoyaltyReceiverUpdate struct { NewAddress common.Address Raw types.Log // Blockchain specific contextual infos } // FilterRoyaltyReceiverUpdate is a free log retrieval operation binding the contract event 0xec6b72b10aed766af02b35918b55be261c89aaaa4c8add826471ce35ec7f97b3. // // Solidity: event RoyaltyReceiverUpdate(address newAddress) func (_Dagent721 *Dagent721Filterer) FilterRoyaltyReceiverUpdate(opts *bind.FilterOpts) (*Dagent721RoyaltyReceiverUpdateIterator, error) { logs, sub, err := _Dagent721.contract.FilterLogs(opts, "RoyaltyReceiverUpdate") if err != nil { return nil, err } return &Dagent721RoyaltyReceiverUpdateIterator{contract: _Dagent721.contract, event: "RoyaltyReceiverUpdate", logs: logs, sub: sub}, nil } // WatchRoyaltyReceiverUpdate is a free log subscription operation binding the contract event 0xec6b72b10aed766af02b35918b55be261c89aaaa4c8add826471ce35ec7f97b3. // // Solidity: event RoyaltyReceiverUpdate(address newAddress) func (_Dagent721 *Dagent721Filterer) WatchRoyaltyReceiverUpdate(opts *bind.WatchOpts, sink chan<- *Dagent721RoyaltyReceiverUpdate) (event.Subscription, error) { logs, sub, err := _Dagent721.contract.WatchLogs(opts, "RoyaltyReceiverUpdate") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(Dagent721RoyaltyReceiverUpdate) if err := _Dagent721.contract.UnpackLog(event, "RoyaltyReceiverUpdate", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseRoyaltyReceiverUpdate is a log parse operation binding the contract event 0xec6b72b10aed766af02b35918b55be261c89aaaa4c8add826471ce35ec7f97b3. // // Solidity: event RoyaltyReceiverUpdate(address newAddress) func (_Dagent721 *Dagent721Filterer) ParseRoyaltyReceiverUpdate(log types.Log) (*Dagent721RoyaltyReceiverUpdate, error) { event := new(Dagent721RoyaltyReceiverUpdate) if err := _Dagent721.contract.UnpackLog(event, "RoyaltyReceiverUpdate", log); err != nil { return nil, err } event.Raw = log return event, nil } // Dagent721TopUpPoolBalanceIterator is returned from FilterTopUpPoolBalance and is used to iterate over the raw logs and unpacked data for TopUpPoolBalance events raised by the Dagent721 contract. type Dagent721TopUpPoolBalanceIterator struct { Event *Dagent721TopUpPoolBalance // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *Dagent721TopUpPoolBalanceIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(Dagent721TopUpPoolBalance) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(Dagent721TopUpPoolBalance) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *Dagent721TopUpPoolBalanceIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *Dagent721TopUpPoolBalanceIterator) Close() error { it.sub.Unsubscribe() return nil } // Dagent721TopUpPoolBalance represents a TopUpPoolBalance event raised by the Dagent721 contract. type Dagent721TopUpPoolBalance struct { AgentId *big.Int Caller common.Address Amount *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterTopUpPoolBalance is a free log retrieval operation binding the contract event 0xf7ee57effd30f2ab842c1d65fdcfa7d20c2fb2f967e9ac30acafecabf013ea4c. // // Solidity: event TopUpPoolBalance(uint256 agentId, address caller, uint256 amount) func (_Dagent721 *Dagent721Filterer) FilterTopUpPoolBalance(opts *bind.FilterOpts) (*Dagent721TopUpPoolBalanceIterator, error) { logs, sub, err := _Dagent721.contract.FilterLogs(opts, "TopUpPoolBalance") if err != nil { return nil, err } return &Dagent721TopUpPoolBalanceIterator{contract: _Dagent721.contract, event: "TopUpPoolBalance", logs: logs, sub: sub}, nil } // WatchTopUpPoolBalance is a free log subscription operation binding the contract event 0xf7ee57effd30f2ab842c1d65fdcfa7d20c2fb2f967e9ac30acafecabf013ea4c. // // Solidity: event TopUpPoolBalance(uint256 agentId, address caller, uint256 amount) func (_Dagent721 *Dagent721Filterer) WatchTopUpPoolBalance(opts *bind.WatchOpts, sink chan<- *Dagent721TopUpPoolBalance) (event.Subscription, error) { logs, sub, err := _Dagent721.contract.WatchLogs(opts, "TopUpPoolBalance") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(Dagent721TopUpPoolBalance) if err := _Dagent721.contract.UnpackLog(event, "TopUpPoolBalance", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseTopUpPoolBalance is a log parse operation binding the contract event 0xf7ee57effd30f2ab842c1d65fdcfa7d20c2fb2f967e9ac30acafecabf013ea4c. // // Solidity: event TopUpPoolBalance(uint256 agentId, address caller, uint256 amount) func (_Dagent721 *Dagent721Filterer) ParseTopUpPoolBalance(log types.Log) (*Dagent721TopUpPoolBalance, error) { event := new(Dagent721TopUpPoolBalance) if err := _Dagent721.contract.UnpackLog(event, "TopUpPoolBalance", log); err != nil { return nil, err } event.Raw = log return event, nil } // Dagent721TransferIterator is returned from FilterTransfer and is used to iterate over the raw logs and unpacked data for Transfer events raised by the Dagent721 contract. type Dagent721TransferIterator struct { Event *Dagent721Transfer // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *Dagent721TransferIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(Dagent721Transfer) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(Dagent721Transfer) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *Dagent721TransferIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *Dagent721TransferIterator) Close() error { it.sub.Unsubscribe() return nil } // Dagent721Transfer represents a Transfer event raised by the Dagent721 contract. type Dagent721Transfer struct { From common.Address To common.Address TokenId *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterTransfer is a free log retrieval operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. // // Solidity: event Transfer(address indexed from, address indexed to, uint256 indexed tokenId) func (_Dagent721 *Dagent721Filterer) FilterTransfer(opts *bind.FilterOpts, from []common.Address, to []common.Address, tokenId []*big.Int) (*Dagent721TransferIterator, error) { var fromRule []interface{} for _, fromItem := range from { fromRule = append(fromRule, fromItem) } var toRule []interface{} for _, toItem := range to { toRule = append(toRule, toItem) } var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _Dagent721.contract.FilterLogs(opts, "Transfer", fromRule, toRule, tokenIdRule) if err != nil { return nil, err } return &Dagent721TransferIterator{contract: _Dagent721.contract, event: "Transfer", logs: logs, sub: sub}, nil } // WatchTransfer is a free log subscription operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. // // Solidity: event Transfer(address indexed from, address indexed to, uint256 indexed tokenId) func (_Dagent721 *Dagent721Filterer) WatchTransfer(opts *bind.WatchOpts, sink chan<- *Dagent721Transfer, from []common.Address, to []common.Address, tokenId []*big.Int) (event.Subscription, error) { var fromRule []interface{} for _, fromItem := range from { fromRule = append(fromRule, fromItem) } var toRule []interface{} for _, toItem := range to { toRule = append(toRule, toItem) } var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _Dagent721.contract.WatchLogs(opts, "Transfer", fromRule, toRule, tokenIdRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(Dagent721Transfer) if err := _Dagent721.contract.UnpackLog(event, "Transfer", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseTransfer is a log parse operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. // // Solidity: event Transfer(address indexed from, address indexed to, uint256 indexed tokenId) func (_Dagent721 *Dagent721Filterer) ParseTransfer(log types.Log) (*Dagent721Transfer, error) { event := new(Dagent721Transfer) if err := _Dagent721.contract.UnpackLog(event, "Transfer", log); err != nil { return nil, err } event.Raw = log return event, nil } // Dagent721UnpausedIterator is returned from FilterUnpaused and is used to iterate over the raw logs and unpacked data for Unpaused events raised by the Dagent721 contract. type Dagent721UnpausedIterator struct { Event *Dagent721Unpaused // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *Dagent721UnpausedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(Dagent721Unpaused) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(Dagent721Unpaused) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *Dagent721UnpausedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *Dagent721UnpausedIterator) Close() error { it.sub.Unsubscribe() return nil } // Dagent721Unpaused represents a Unpaused event raised by the Dagent721 contract. type Dagent721Unpaused struct { Account common.Address Raw types.Log // Blockchain specific contextual infos } // FilterUnpaused is a free log retrieval operation binding the contract event 0x5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa. // // Solidity: event Unpaused(address account) func (_Dagent721 *Dagent721Filterer) FilterUnpaused(opts *bind.FilterOpts) (*Dagent721UnpausedIterator, error) { logs, sub, err := _Dagent721.contract.FilterLogs(opts, "Unpaused") if err != nil { return nil, err } return &Dagent721UnpausedIterator{contract: _Dagent721.contract, event: "Unpaused", logs: logs, sub: sub}, nil } // WatchUnpaused is a free log subscription operation binding the contract event 0x5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa. // // Solidity: event Unpaused(address account) func (_Dagent721 *Dagent721Filterer) WatchUnpaused(opts *bind.WatchOpts, sink chan<- *Dagent721Unpaused) (event.Subscription, error) { logs, sub, err := _Dagent721.contract.WatchLogs(opts, "Unpaused") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(Dagent721Unpaused) if err := _Dagent721.contract.UnpackLog(event, "Unpaused", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseUnpaused is a log parse operation binding the contract event 0x5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa. // // Solidity: event Unpaused(address account) func (_Dagent721 *Dagent721Filterer) ParseUnpaused(log types.Log) (*Dagent721Unpaused, error) { event := new(Dagent721Unpaused) if err := _Dagent721.contract.UnpackLog(event, "Unpaused", log); err != nil { return nil, err } event.Raw = log return event, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/binds/dagent721/abi.json ================================================ [ { "inputs": [], "name": "InsufficientFunds", "type": "error" }, { "inputs": [], "name": "InvalidAgentData", "type": "error" }, { "inputs": [], "name": "InvalidAgentFee", "type": "error" }, { "inputs": [], "name": "InvalidAgentId", "type": "error" }, { "inputs": [], "name": "InvalidAgentPromptIndex", "type": "error" }, { "inputs": [], "name": "InvalidAgentURI", "type": "error" }, { "inputs": [], "name": "InvalidData", "type": "error" }, { "inputs": [], "name": "SignatureUsed", "type": "error" }, { "inputs": [], "name": "Unauthorized", "type": "error" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "uint256", "name": "agentId", "type": "uint256" }, { "indexed": false, "internalType": "bytes[]", "name": "sysPrompt", "type": "bytes[]" } ], "name": "AgentDataAddNew", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "uint256", "name": "agentId", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "promptIndex", "type": "uint256" }, { "indexed": false, "internalType": "bytes", "name": "oldSysPrompt", "type": "bytes" }, { "indexed": false, "internalType": "bytes", "name": "newSysPrompt", "type": "bytes" } ], "name": "AgentDataUpdate", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "uint256", "name": "agentId", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "fee", "type": "uint256" } ], "name": "AgentFeeUpdate", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "uint256", "name": "agentId", "type": "uint256" }, { "indexed": false, "internalType": "bytes[]", "name": "missions", "type": "bytes[]" } ], "name": "AgentMissionAddNew", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "uint256", "name": "agentId", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "missionIndex", "type": "uint256" }, { "indexed": false, "internalType": "bytes", "name": "oldSysMission", "type": "bytes" }, { "indexed": false, "internalType": "bytes", "name": "newSysMission", "type": "bytes" } ], "name": "AgentMissionUpdate", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "uint256", "name": "agentId", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "oldModelId", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "newModelId", "type": "uint256" } ], "name": "AgentModelIdUpdate", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "uint256", "name": "agentId", "type": "uint256" }, { "indexed": false, "internalType": "address", "name": "oldPromptScheduler", "type": "address" }, { "indexed": false, "internalType": "address", "name": "newOldPromptScheduler", "type": "address" } ], "name": "AgentPromptSchedulerdUpdate", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "uint256", "name": "agentId", "type": "uint256" }, { "indexed": false, "internalType": "string", "name": "uri", "type": "string" } ], "name": "AgentURIUpdate", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "owner", "type": "address" }, { "indexed": true, "internalType": "address", "name": "approved", "type": "address" }, { "indexed": true, "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "Approval", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "owner", "type": "address" }, { "indexed": true, "internalType": "address", "name": "operator", "type": "address" }, { "indexed": false, "internalType": "bool", "name": "approved", "type": "bool" } ], "name": "ApprovalForAll", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "uint256", "name": "_fromTokenId", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "_toTokenId", "type": "uint256" } ], "name": "BatchMetadataUpdate", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "indexed": true, "internalType": "address", "name": "caller", "type": "address" }, { "indexed": false, "internalType": "bytes", "name": "data", "type": "bytes" }, { "indexed": false, "internalType": "uint256", "name": "fee", "type": "uint256" }, { "indexed": false, "internalType": "string", "name": "externalData", "type": "string" }, { "indexed": false, "internalType": "uint256", "name": "inferenceId", "type": "uint256" } ], "name": "InferencePerformed", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "uint8", "name": "version", "type": "uint8" } ], "name": "Initialized", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "uint256", "name": "_tokenId", "type": "uint256" } ], "name": "MetadataUpdate", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "uint256", "name": "newValue", "type": "uint256" } ], "name": "MintPriceUpdate", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "indexed": false, "internalType": "string", "name": "uri", "type": "string" }, { "indexed": false, "internalType": "bytes", "name": "sysPrompt", "type": "bytes" }, { "indexed": false, "internalType": "uint256", "name": "fee", "type": "uint256" }, { "indexed": true, "internalType": "address", "name": "minter", "type": "address" } ], "name": "NewToken", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "previousOwner", "type": "address" }, { "indexed": true, "internalType": "address", "name": "newOwner", "type": "address" } ], "name": "OwnershipTransferred", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "address", "name": "account", "type": "address" } ], "name": "Paused", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "uint16", "name": "newValue", "type": "uint16" } ], "name": "RoyaltyPortionUpdate", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "address", "name": "newAddress", "type": "address" } ], "name": "RoyaltyReceiverUpdate", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "uint256", "name": "agentId", "type": "uint256" }, { "indexed": false, "internalType": "address", "name": "caller", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" } ], "name": "TopUpPoolBalance", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "from", "type": "address" }, { "indexed": true, "internalType": "address", "name": "to", "type": "address" }, { "indexed": true, "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "Transfer", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "address", "name": "account", "type": "address" } ], "name": "Unpaused", "type": "event" }, { "inputs": [], "name": "_gpuManager", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "nftId", "type": "uint256" } ], "name": "_poolBalance", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "nftId", "type": "address" }, { "internalType": "bytes32", "name": "signature", "type": "bytes32" } ], "name": "_signaturesUsed", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "agentId", "type": "uint256" }, { "internalType": "string", "name": "promptKey", "type": "string" }, { "internalType": "bytes", "name": "sysPrompt", "type": "bytes" } ], "name": "addNewAgentData", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "to", "type": "address" }, { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "approve", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "owner", "type": "address" } ], "name": "balanceOf", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "agentId", "type": "uint256" }, { "internalType": "bytes", "name": "missionData", "type": "bytes" } ], "name": "createMission", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "agentId", "type": "uint256" } ], "name": "dataOf", "outputs": [ { "internalType": "uint128", "name": "", "type": "uint128" }, { "internalType": "bool", "name": "", "type": "bool" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "agentId", "type": "uint256" } ], "name": "getAgentFee", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "owner", "type": "address" } ], "name": "getAgentIdByOwner", "outputs": [ { "internalType": "uint256[]", "name": "", "type": "uint256[]" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "agentId", "type": "uint256" }, { "internalType": "string", "name": "promptKey", "type": "string" } ], "name": "getAgentSystemPrompt", "outputs": [ { "internalType": "bytes[]", "name": "", "type": "bytes[]" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "getApproved", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "agentId", "type": "uint256" } ], "name": "getMissionIdsByAgentId", "outputs": [ { "internalType": "bytes[]", "name": "", "type": "bytes[]" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "agentId", "type": "uint256" }, { "internalType": "bytes", "name": "fwdCalldata", "type": "bytes" }, { "internalType": "string", "name": "externalData", "type": "string" }, { "internalType": "string", "name": "promptKey", "type": "string" }, { "internalType": "uint256", "name": "feeAmount", "type": "uint256" } ], "name": "infer", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "agentId", "type": "uint256" }, { "internalType": "bytes", "name": "fwdCalldata", "type": "bytes" }, { "internalType": "string", "name": "externalData", "type": "string" }, { "internalType": "string", "name": "promptKey", "type": "string" }, { "internalType": "bool", "name": "flag", "type": "bool" }, { "internalType": "uint256", "name": "feeAmount", "type": "uint256" } ], "name": "infer", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "string", "name": "name_", "type": "string" }, { "internalType": "string", "name": "symbol_", "type": "string" }, { "internalType": "uint256", "name": "mintPrice_", "type": "uint256" }, { "internalType": "address", "name": "royaltyReceiver_", "type": "address" }, { "internalType": "uint16", "name": "royaltyPortion_", "type": "uint16" }, { "internalType": "uint256", "name": "nextTokenId_", "type": "uint256" }, { "internalType": "address", "name": "gpuManager_", "type": "address" }, { "internalType": "contract IERC20", "name": "tokenFee_", "type": "address" } ], "name": "initialize", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "owner", "type": "address" }, { "internalType": "address", "name": "operator", "type": "address" } ], "name": "isApprovedForAll", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "to", "type": "address" }, { "internalType": "string", "name": "uri", "type": "string" }, { "internalType": "bytes", "name": "data", "type": "bytes" }, { "internalType": "uint256", "name": "fee", "type": "uint256" }, { "internalType": "string", "name": "promptKey", "type": "string" }, { "internalType": "address", "name": "promptScheduler", "type": "address" }, { "internalType": "uint32", "name": "modelId", "type": "uint32" } ], "name": "mint", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "mintPrice", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "name", "outputs": [ { "internalType": "string", "name": "", "type": "string" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "nextTokenId", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "owner", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "ownerOf", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "pause", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "paused", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "renounceOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "agentId", "type": "uint256" }, { "internalType": "uint256", "name": "salePrice", "type": "uint256" } ], "name": "royaltyInfo", "outputs": [ { "internalType": "address", "name": "", "type": "address" }, { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "royaltyPortion", "outputs": [ { "internalType": "uint16", "name": "", "type": "uint16" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "royaltyReceiver", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "from", "type": "address" }, { "internalType": "address", "name": "to", "type": "address" }, { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "safeTransferFrom", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "from", "type": "address" }, { "internalType": "address", "name": "to", "type": "address" }, { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "internalType": "bytes", "name": "data", "type": "bytes" } ], "name": "safeTransferFrom", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "operator", "type": "address" }, { "internalType": "bool", "name": "approved", "type": "bool" } ], "name": "setApprovalForAll", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "bytes4", "name": "interfaceId", "type": "bytes4" } ], "name": "supportsInterface", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "symbol", "outputs": [ { "internalType": "string", "name": "", "type": "string" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "index", "type": "uint256" } ], "name": "tokenByIndex", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "owner", "type": "address" }, { "internalType": "uint256", "name": "index", "type": "uint256" } ], "name": "tokenOfOwnerByIndex", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "_agentId", "type": "uint256" } ], "name": "tokenURI", "outputs": [ { "internalType": "string", "name": "", "type": "string" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "agentId", "type": "uint256" }, { "internalType": "uint256", "name": "amount", "type": "uint256" } ], "name": "topUpPoolBalance", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "totalSupply", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "from", "type": "address" }, { "internalType": "address", "name": "to", "type": "address" }, { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "transferFrom", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "newOwner", "type": "address" } ], "name": "transferOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "unpause", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "agentId", "type": "uint256" }, { "internalType": "bytes", "name": "sysPrompt", "type": "bytes" }, { "internalType": "string", "name": "promptKey", "type": "string" }, { "internalType": "uint256", "name": "promptIdx", "type": "uint256" } ], "name": "updateAgentData", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "agentId", "type": "uint256" }, { "internalType": "bytes", "name": "sysPrompt", "type": "bytes" }, { "internalType": "string", "name": "promptKey", "type": "string" }, { "internalType": "uint256", "name": "promptIdx", "type": "uint256" }, { "internalType": "uint256", "name": "randomNonce", "type": "uint256" }, { "internalType": "bytes", "name": "signature", "type": "bytes" } ], "name": "updateAgentDataWithSignature", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "agentId", "type": "uint256" }, { "internalType": "uint256", "name": "fee", "type": "uint256" } ], "name": "updateAgentFee", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "agentId", "type": "uint256" }, { "internalType": "uint32", "name": "newModelId", "type": "uint32" } ], "name": "updateAgentModelId", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "agentId", "type": "uint256" }, { "internalType": "string", "name": "uri", "type": "string" } ], "name": "updateAgentURI", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "agentId", "type": "uint256" }, { "internalType": "string", "name": "uri", "type": "string" }, { "internalType": "uint256", "name": "randomNonce", "type": "uint256" }, { "internalType": "bytes", "name": "signature", "type": "bytes" } ], "name": "updateAgentUriWithSignature", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "gpuManager", "type": "address" } ], "name": "updateGPUManager", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "mintPrice", "type": "uint256" } ], "name": "updateMintPrice", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint16", "name": "royaltyPortion", "type": "uint16" } ], "name": "updateRoyaltyPortion", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "royaltyReceiver", "type": "address" } ], "name": "updateRoyaltyReceiver", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "agentId", "type": "uint256" }, { "internalType": "address", "name": "newPromptScheduler", "type": "address" } ], "name": "updateSchedulePrompt", "outputs": [], "stateMutability": "nonpayable", "type": "function" } ] ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/binds/daotoken/DAOToken.go ================================================ // Code generated - DO NOT EDIT. // This file is a generated binding and any manual changes will be lost. package daotoken import ( "errors" "math/big" "strings" ethereum "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/event" ) // Reference imports to suppress errors if they are not otherwise used. var ( _ = errors.New _ = big.NewInt _ = strings.NewReader _ = ethereum.NotFound _ = bind.Bind _ = common.Big1 _ = types.BloomLookup _ = event.NewSubscription _ = abi.ConvertType ) // ERC20VotesCheckpoint is an auto generated low-level Go binding around an user-defined struct. type ERC20VotesCheckpoint struct { FromBlock uint32 Votes *big.Int } // DAOTokenMetaData contains all meta data concerning the DAOToken contract. var DAOTokenMetaData = &bind.MetaData{ ABI: "[{\"inputs\":[{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"symbol\",\"type\":\"string\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"InvalidShortString\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"str\",\"type\":\"string\"}],\"name\":\"StringTooLong\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"delegator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"fromDelegate\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"toDelegate\",\"type\":\"address\"}],\"name\":\"DelegateChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"delegate\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"previousBalance\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newBalance\",\"type\":\"uint256\"}],\"name\":\"DelegateVotesChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"EIP712DomainChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"CLOCK_MODE\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"DOMAIN_SEPARATOR\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"pos\",\"type\":\"uint32\"}],\"name\":\"checkpoints\",\"outputs\":[{\"components\":[{\"internalType\":\"uint32\",\"name\":\"fromBlock\",\"type\":\"uint32\"},{\"internalType\":\"uint224\",\"name\":\"votes\",\"type\":\"uint224\"}],\"internalType\":\"structERC20Votes.Checkpoint\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"clock\",\"outputs\":[{\"internalType\":\"uint48\",\"name\":\"\",\"type\":\"uint48\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"subtractedValue\",\"type\":\"uint256\"}],\"name\":\"decreaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"delegatee\",\"type\":\"address\"}],\"name\":\"delegate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"delegatee\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiry\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"delegateBySig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"delegates\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"eip712Domain\",\"outputs\":[{\"internalType\":\"bytes1\",\"name\":\"fields\",\"type\":\"bytes1\"},{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"version\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"verifyingContract\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"salt\",\"type\":\"bytes32\"},{\"internalType\":\"uint256[]\",\"name\":\"extensions\",\"type\":\"uint256[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"timepoint\",\"type\":\"uint256\"}],\"name\":\"getPastTotalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"timepoint\",\"type\":\"uint256\"}],\"name\":\"getPastVotes\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"getVotes\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"addedValue\",\"type\":\"uint256\"}],\"name\":\"increaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"nonces\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"numCheckpoints\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"permit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", Bin: "0x6101608060405234620000c7576200319480380380916200002082620000e2565b833960408183019112620000c75781516001600160401b039290838111620000c757826200005091830162000160565b9161018051938411620000c75762000075936200006e920162000160565b90620001c6565b6040516120a09081620010d4823960805181611aa8015260a05181611b63015260c05181611a72015260e05181611af701526101005181611b1d015261012051816108040152610140518161082d0152f35b600080fd5b634e487b7160e01b600052604160045260246000fd5b601f01601f1916610160908101906001600160401b038211908210176200010857604052565b620000cc565b604081019081106001600160401b038211176200010857604052565b6040519062000139826200010e565b565b60005b8381106200014f5750506000910152565b81810151838201526020016200013e565b81601f82011215620000c75780516001600160401b0392838211620001085760405193601f8301601f19908116603f0116850190811185821017620001085760405281845260208284010111620000c757620001c391602080850191016200013b565b90565b9190604051620001d6816200010e565b600193848252602080830193603160f81b8552825160018060401b038111620001085762000211816200020b60035462000331565b6200036e565b8297601f8211600114620002a5578180916200024c95969798999a60009362000299575b501b916000199060031b1c191617600355620004d2565b6200025782620005c5565b610120526200026683620006d5565b61014052815191012060e052519020610100524660a0526200028762000854565b6080523060c052620001393362000926565b88015192503862000235565b6003600052601f198216989091907fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b9060005b8b81106200031b5750826200024c969798999a9b1062000301575b5050811b01600355620004d2565b87015160001960f88460031b161c191690553880620002f3565b87820151835591840191908601908601620002d8565b90600182811c9216801562000363575b60208310146200034d57565b634e487b7160e01b600052602260045260246000fd5b91607f169162000341565b601f81116200037b575050565b6000906003825260208220906020601f850160051c83019410620003bc575b601f0160051c01915b828110620003b057505050565b818155600101620003a3565b90925082906200039a565b601f8111620003d4575050565b6000906004825260208220906020601f850160051c8301941062000415575b601f0160051c01915b8281106200040957505050565b818155600101620003fc565b9092508290620003f3565b601f81116200042d575050565b6000906005825260208220906020601f850160051c830194106200046e575b601f0160051c01915b8281106200046257505050565b81815560010162000455565b90925082906200044c565b601f811162000486575050565b6000906006825260208220906020601f850160051c83019410620004c7575b601f0160051c01915b828110620004bb57505050565b818155600101620004ae565b9092508290620004a5565b80519091906001600160401b0381116200010857620004fe81620004f860045462000331565b620003c7565b602080601f83116001146200053d575081929360009262000531575b50508160011b916000199060031b1c191617600455565b0151905038806200051a565b6004600052601f198316949091907f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b926000905b878210620005ac57505083600195961062000592575b505050811b01600455565b015160001960f88460031b161c1916905538808062000587565b8060018596829496860151815501950193019062000571565b9081516020808210600014620005e357505090620001c390620007e5565b6001600160401b03821162000108576200060a826200060460055462000331565b62000420565b80601f83116001146200064a57508192936000926200063e575b50508160011b916000199060031b1c19161760055560ff90565b01519050388062000624565b6005600052601f198316949091907f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db0926000905b878210620006bc575050836001959610620006a2575b505050811b0160055560ff90565b015160001960f88460031b161c1916905538808062000694565b806001859682949686015181550195019301906200067e565b9081516020808210600014620006f357505090620001c390620007e5565b6001600160401b03821162000108576200071a826200071460065462000331565b62000479565b80601f83116001146200075a57508192936000926200074e575b50508160011b916000199060031b1c19161760065560ff90565b01519050388062000734565b6006600052601f198316949091907ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f926000905b878210620007cc575050836001959610620007b2575b505050811b0160065560ff90565b015160001960f88460031b161c19169055388080620007a4565b806001859682949686015181550195019301906200078e565b601f8151116200081357602081519101516020821062000803571790565b6000198260200360031b1b161790565b6044604051809263305a27a960e01b8252602060048301526200084681518092816024860152602086860191016200013b565b601f01601f19168101030190fd5b60e051610100516040519060208201927f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f8452604083015260608201524660808201523060a082015260a0815260c0810181811060018060401b03821117620001085760405251902090565b15620008c857565b60405162461bcd60e51b815260206004820152603060248201527f4552433230566f7465733a20746f74616c20737570706c79207269736b73206f60448201526f766572666c6f77696e6720766f74657360801b6064820152608490fd5b6001600160a01b038116908115620009f757600254916b033b2e3c9fd0803ce8000000808401809411620009f15762000962620009cb94600255565b6001600160a01b038316600090815260208190526040902090815401905560007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405180620009c281906b033b2e3c9fd0803ce8000000602083019252565b0390a362000fa5565b600254620009e3906001600160e01b031015620008c0565b620009ed62000b5c565b5050565b62000a3c565b60405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606490fd5b634e487b7160e01b600052601160045260246000fd5b604080519192919081016001600160401b038111828210176200010857604052602081935463ffffffff81168352811c910152565b600b54906801000000000000000082101562000108576001820180600b5582101562000af557600b600052805160209182015190911b63ffffffff191663ffffffff91909116177f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01db990910155565b634e487b7160e01b600052603260045260246000fd5b9081546801000000000000000081101562000108576001810180845581101562000af557600092835260209283902082519284015190931b63ffffffff191663ffffffff9290921691909117910155565b600b5490811590811562000ca35762000b746200012a565b6000815260006020820152925b602084015162000ba1906001600160e01b03165b6001600160e01b031690565b9362000bad856200109e565b9315908162000c7c575b501562000c1457620001399062000bfd62000bd28562000e6d565b600b600052917f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01db80190565b9063ffffffff82549181199060201b169116179055565b506200013962000c3d62000c3762000c2c4362000ed7565b65ffffffffffff1690565b62000f3f565b62000c7662000c4c8562000e6d565b62000c6662000c5a6200012a565b63ffffffff9094168452565b6001600160e01b03166020830152565b62000a87565b5163ffffffff16905063ffffffff62000c9962000c2c4362000ed7565b9116143862000bb7565b600b60005262000cdb7f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01db8840162000a52565b62000a52565b9262000b81565b805491821591821562000de25762000cf96200012a565b6000815260006020820152935b602085015162000d1f906001600160e01b031662000b95565b9462000d2b86620010b8565b9415908162000dbb575b501562000d625762000bfd620001399262000d508662000e6d565b92600019019060005260206000200190565b50620001399062000d7b62000c3762000c2c4362000ed7565b9062000db562000d8b8662000e6d565b62000da562000d996200012a565b63ffffffff9095168552565b6001600160e01b03166020840152565b62000b0b565b5163ffffffff16905063ffffffff62000dd862000c2c4362000ed7565b9116143862000d35565b62000dfc62000cd560001986018360005260206000200190565b9362000d06565b805491821591821562000e4c5762000e1a6200012a565b6000815260006020820152935b602085015162000e40906001600160e01b031662000b95565b9462000d2b866200109e565b62000e6662000cd560001986018360005260206000200190565b9362000e27565b6001600160e01b039081811162000e82571690565b60405162461bcd60e51b815260206004820152602760248201527f53616665436173743a2076616c756520646f65736e27742066697420696e20326044820152663234206269747360c81b6064820152608490fd5b65ffffffffffff9081811162000eeb571690565b60405162461bcd60e51b815260206004820152602660248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203460448201526538206269747360d01b6064820152608490fd5b63ffffffff9081811162000f51571690565b60405162461bcd60e51b815260206004820152602660248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203360448201526532206269747360d01b6064820152608490fd5b60096020527fec8156718a8372b1db44bb411437d0870f3e3790d4a08526d024ce1b0b668f6b546001600160a01b039182166000908152604081205483169290911690818314158062001095575b62000ffd57505050565b8162001056575b5050806200100f5750565b6001600160a01b0381166000908152600a602052604090206000805160206200317483398151915290620010439062000e03565b60408051928352602083019190915290a2565b6200107c60408284600080516020620031748339815191529452600a6020522062000ce2565b60408051928352602083019190915290a2388062001004565b50600162000ff3565b6b033b2e3c9fd0803ce80000008101809111620009f15790565b6b033b2e3c9fd0803ce7ffffff198101908111620009f1579056fe6080604052600436101561001257600080fd5b60003560e01c806306fdde03146101a7578063095ea7b3146101a257806318160ddd1461019d57806323b872dd14610198578063313ce567146101935780633644e5151461018e57806339509351146101895780633a46b1a8146101845780634bf5d7e91461017f578063587cde1e1461017a5780635c19a95c146101755780636fcfff451461017057806370a082311461016b5780637ecebe001461016657806384b0196e146101615780638e539e8c1461015c57806391ddadf41461015757806395d89b41146101525780639ab24eb01461014d578063a457c2d714610148578063a9059cbb14610143578063c3cda5201461013e578063d505accf14610139578063dd62ed3e146101345763f1127ed81461012f57600080fd5b610f2c565b610ed4565b610d8e565b610c63565b610c1d565b610b6f565b610b0d565b610a66565b610a3a565b6108e1565b6107e9565b6107af565b610775565b61072d565b610709565b6106ce565b61061c565b6104c7565b61046f565b61044c565b610430565b610365565b610347565b610316565b610200565b919082519283825260005b8481106101d8575050826000602080949584010152601f8019910116010190565b6020818301810151848301820152016101b7565b9060206101fd9281815201906101ac565b90565b346102e5576000806003193601126102e257604051908060035461022381610fb3565b808552916001918083169081156102b8575060011461025d575b6102598561024d8187038261105c565b604051918291826101ec565b0390f35b9250600383527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b5b8284106102a057505050810160200161024d8261025961023d565b80546020858701810191909152909301928101610285565b8695506102599693506020925061024d94915060ff191682840152151560051b820101929361023d565b80fd5b600080fd5b600435906001600160a01b03821682036102e557565b602435906001600160a01b03821682036102e557565b346102e55760403660031901126102e55761033c6103326102ea565b6024359033611263565b602060405160018152f35b346102e55760003660031901126102e5576020600254604051908152f35b346102e55760603660031901126102e55761037e6102ea565b610386610300565b6001600160a01b0382166000908152600160209081526040808320338452909152902060443591905492600184016103cf575b6103c39350611155565b60405160018152602090f35b8284106103eb576103e6836103c395033383611263565b6103b9565b60405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606490fd5b346102e55760003660031901126102e557602060405160128152f35b346102e55760003660031901126102e5576020610467611a6f565b604051908152f35b346102e55760403660031901126102e5576104886102ea565b3360009081526001602090815260408083206001600160a01b038516845290915290205460243581018091116104c25761033c9133611263565b61107e565b346102e55760403660031901126102e5576104e06102ea565b602435906104ff65ffffffffffff6104f743611f52565b16831061143c565b6001600160a01b03166000908152600a60205260408120805492909183600581116105cb575b50905b8382106105765750508161054f575050602060005b6040516001600160e01b039091168152f35b61056a61057191602093600019019060005260206000200190565b5460201c90565b61053d565b90926105828185611d82565b90818363ffffffff6105a861059e848960005260206000200190565b5463ffffffff1690565b1611156105b9575050925b90610528565b9094506105c69150611094565b6105b3565b806105db6105e192969396611d97565b90611488565b908263ffffffff6105fc61059e858860005260206000200190565b16111561060c5750925b38610525565b935061061790611094565b610606565b346102e55760003660031901126102e5574365ffffffffffff61063e43611f52565b16036106895761025960405161065381611003565b601d81527f6d6f64653d626c6f636b6e756d6265722666726f6d3d64656661756c740000006020820152604051918291826101ec565b60405162461bcd60e51b815260206004820152601d60248201527f4552433230566f7465733a2062726f6b656e20636c6f636b206d6f64650000006044820152606490fd5b346102e55760203660031901126102e55760206001600160a01b03806106f26102ea565b166000526009825260406000205416604051908152f35b346102e55760203660031901126102e55761072b6107256102ea565b336114e1565b005b346102e55760203660031901126102e5576001600160a01b0361074e6102ea565b16600052600a6020526020610767604060002054611fb9565b63ffffffff60405191168152f35b346102e55760203660031901126102e5576001600160a01b036107966102ea565b1660005260006020526020604060002054604051908152f35b346102e55760203660031901126102e5576001600160a01b036107d06102ea565b1660005260076020526020604060002054604051908152f35b346102e5576000806003193601126102e257610893906108287f0000000000000000000000000000000000000000000000000000000000000000611baf565b6108517f0000000000000000000000000000000000000000000000000000000000000000611ca8565b916040519161085f83611024565b818352604051948594600f60f81b865261088560209360e08589015260e08801906101ac565b9086820360408801526101ac565b904660608601523060808601528260a086015284820360c08601528080855193848152019401925b8281106108ca57505050500390f35b8351855286955093810193928101926001016108bb565b346102e55760203660031901126102e55760043561091065ffffffffffff61090843611f52565b16821061143c565b600b5490600082600581116109d3575b50905b82821061097057828061093d575060405160008152602090f35b600b600052602090610571907f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01db80161056a565b909161097c8184611d82565b600b600052908263ffffffff6109b37f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01db9850161059e565b1611156109c35750915b90610923565b92506109ce90611094565b6109bd565b806105db6109e392959395611d97565b600b600052908263ffffffff610a1a7f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01db9850161059e565b161115610a2a5750915b38610920565b9250610a3590611094565b610a24565b346102e55760003660031901126102e5576020610a5643611f52565b65ffffffffffff60405191168152f35b346102e5576000806003193601126102e2576040519080600454610a8981610fb3565b808552916001918083169081156102b85750600114610ab2576102598561024d8187038261105c565b9250600483527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b5b828410610af557505050810160200161024d8261025961023d565b80546020858701810191909152909301928101610ada565b346102e55760203660031901126102e5576001600160a01b03610b2e6102ea565b16600052600a602052604060002080548015600014610b5557505060405160008152602090f35b602091610b669160001901906113ec565b5054811c61053d565b346102e55760403660031901126102e557610b886102ea565b60243590336000526001602052610bb58160406000209060018060a01b0316600052602052604060002090565b5491808310610bca576103c392039033611263565b60405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608490fd5b346102e55760403660031901126102e55761033c610c396102ea565b6024359033611155565b6064359060ff821682036102e557565b6084359060ff821682036102e557565b346102e55760c03660031901126102e557610c7c6102ea565b60443590602435610c8b610c43565b92804211610d4957610d1b610d449161072b9560405190610d0382610cf56020820195898b8860609194939260808201957fe48329057bfd03d55e49b547132e39cffd9c1820ad7b9d4c5307691425d15adf835260018060a01b0316602083015260408201520152565b03601f19810184528361105c565b610d1660a4359360843593519020611b89565b611889565b6001600160a01b0381166000908152600760205260409020805460018101909155909214611495565b6114e1565b60405162461bcd60e51b815260206004820152601d60248201527f4552433230566f7465733a207369676e617475726520657870697265640000006044820152606490fd5b346102e55760e03660031901126102e557610da76102ea565b610daf610300565b6044359060643592610dbf610c53565b93804211610e8f57610e77610e8a91610cf561072b97610e64610dfd8760018060a01b03166000526007602052604060002090815491600183019055565b604080517f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9602082019081526001600160a01b03808c1693830193909352918b166060820152608081018c905260a081019290925260c082019590955292839060e0820190565b610d1660c4359360a43593519020611b89565b6001600160a01b03838116911614611393565b611263565b60405162461bcd60e51b815260206004820152601d60248201527f45524332305065726d69743a206578706972656420646561646c696e650000006044820152606490fd5b346102e55760403660031901126102e5576020610f23610ef26102ea565b610efa610300565b6001600160a01b0391821660009081526001855260408082209290931681526020919091522090565b54604051908152f35b346102e55760403660031901126102e557610f456102ea565b63ffffffff60243581811681036102e557610f8f610f9591604094600060208751610f6f81611003565b82815201526001600160a01b03166000908152600a6020528590206113ec565b5061141a565b8251815190921682526020908101516001600160e01b031690820152f35b90600182811c92168015610fe3575b6020831014610fcd57565b634e487b7160e01b600052602260045260246000fd5b91607f1691610fc2565b634e487b7160e01b600052604160045260246000fd5b6040810190811067ffffffffffffffff82111761101f57604052565b610fed565b6020810190811067ffffffffffffffff82111761101f57604052565b60c0810190811067ffffffffffffffff82111761101f57604052565b90601f8019910116810190811067ffffffffffffffff82111761101f57604052565b634e487b7160e01b600052601160045260246000fd5b90600182018092116104c257565b156110a957565b60405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608490fd5b1561110157565b60405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608490fd5b6001600160a01b0392919083811680156112105761120e9483169061117b8215156110a2565b6001600160a01b03831660009081526020819052604090208590546111a2828210156110fa565b036111bf8460018060a01b03166000526000602052604060002090565b556001600160a01b0384166000908152602081815260409182902080548801905590518681527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9190a361201e565b565b60405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608490fd5b6001600160a01b0380821692919083156113425782169384156112f257806112dc7f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925946112c56112ed9560018060a01b03166000526001602052604060002090565b9060018060a01b0316600052602052604060002090565b556040519081529081906020820190565b0390a3565b60405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608490fd5b60405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608490fd5b1561139a57565b60405162461bcd60e51b815260206004820152601e60248201527f45524332305065726d69743a20696e76616c6964207369676e617475726500006044820152606490fd5b6040519061120e82611003565b80548210156114045760005260206000200190600090565b634e487b7160e01b600052603260045260246000fd5b9060405161142781611003565b602081935463ffffffff81168352811c910152565b1561144357565b60405162461bcd60e51b815260206004820152601960248201527f4552433230566f7465733a20667574757265206c6f6f6b7570000000000000006044820152606490fd5b919082039182116104c257565b1561149c57565b60405162461bcd60e51b815260206004820152601960248201527f4552433230566f7465733a20696e76616c6964206e6f6e6365000000000000006044820152606490fd5b61120e9160018060a01b038092166000928184526009602052806040852054168092856020527f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f60408720549660096020526040812094871694856bffffffffffffffffffffffff60a01b82541617905580a45b6001600160a01b03808316939291168084141580611768575b611579575b50505050565b806115e7575b508261158c575b80611573565b6001600160a01b03166000908152600a602052604090207fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a724916115ce916117d0565b60408051928352602083019190915290a2388080611586565b80600052600a6020527fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a72460406000208054801591826000146117455761162b6113df565b6000815260006020820152915b6020830151611657906001600160e01b03165b6001600160e01b031690565b926116628985612050565b94159081611722575b50156116c0576116936116aa9261168186611ee9565b92600019019060005260206000200190565b9063ffffffff82549181199060201b169116179055565b604080519182526020820192909252a23861157f565b5061171d906116e46116df6116d443611f52565b65ffffffffffff1690565b611fb9565b906117186116f186611ee9565b6117086116fc6113df565b63ffffffff9095168552565b6001600160e01b03166020840152565b611771565b6116aa565b5163ffffffff16905063ffffffff61173c6116d443611f52565b9116143861166b565b61176261175d60001984018360005260206000200190565b61141a565b91611638565b5082151561156e565b80546801000000000000000081101561101f57611793916001820181556113ec565b6117ba57815160209283015190921b63ffffffff191663ffffffff92909216919091179055565b634e487b7160e01b600052600060045260246000fd5b90918154918215928360001461186c576117e86113df565b60008152600060208201525b60208101516118169061180f906001600160e01b031661164b565b968761205d565b94159081611849575b50156118355761169361120e9261168186611ee9565b5061120e906116e46116df6116d443611f52565b5163ffffffff16905063ffffffff6118636116d443611f52565b9116143861181f565b61188461175d60001983018460005260206000200190565b6117f4565b916101fd9391611898936119e0565b9190916118c0565b600511156118aa57565b634e487b7160e01b600052602160045260246000fd5b6118c9816118a0565b806118d15750565b6118da816118a0565b600181036119275760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606490fd5b611930816118a0565b6002810361197d5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606490fd5b806119896003926118a0565b1461199057565b60405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608490fd5b9291907f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311611a635791608094939160ff602094604051948552168484015260408301526060820152600093849182805260015afa15611a565781516001600160a01b03811615611a50579190565b50600190565b50604051903d90823e3d90fd5b50505050600090600390565b307f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03161480611b60575b15611aca577f000000000000000000000000000000000000000000000000000000000000000090565b60405160208101907f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f82527f000000000000000000000000000000000000000000000000000000000000000060408201527f000000000000000000000000000000000000000000000000000000000000000060608201524660808201523060a082015260a08152611b5a81611040565b51902090565b507f00000000000000000000000000000000000000000000000000000000000000004614611aa1565b604290611b94611a6f565b906040519161190160f01b8352600283015260228201522090565b60ff8114611bed5760ff811690601f8211611bdb5760405191611bd183611003565b8252602082015290565b604051632cd44ac360e21b8152600490fd5b50604051600554816000611c0083610fb3565b80835292600190818116908115611c865750600114611c27575b506101fd9250038261105c565b6005600090815291507f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db05b848310611c6b57506101fd935050810160200138611c1a565b81935090816020925483858901015201910190918492611c52565b9050602092506101fd94915060ff191682840152151560051b82010138611c1a565b60ff8114611cca5760ff811690601f8211611bdb5760405191611bd183611003565b50604051600654816000611cdd83610fb3565b80835292600190818116908115611c865750600114611d0357506101fd9250038261105c565b6006600090815291507ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f5b848310611d4757506101fd935050810160200138611c1a565b81935090816020925483858901015201910190918492611d2e565b8115611d6c570490565b634e487b7160e01b600052601260045260246000fd5b90808216911860011c81018091116104c25790565b8015611ed15780611e6a611e63611e59611e4f611e45611e3b611e31611e2760016101fd9a6000908b60801c80611ec5575b508060401c80611eb8575b508060201c80611eab575b508060101c80611e9e575b508060081c80611e91575b508060041c80611e84575b508060021c80611e77575b50821c611e70575b811c1b611e20818b611d62565b0160011c90565b611e20818a611d62565b611e208189611d62565b611e208188611d62565b611e208187611d62565b611e208186611d62565b611e208185611d62565b8092611d62565b90611ed7565b8101611e13565b6002915091019038611e0b565b6004915091019038611e00565b6008915091019038611df5565b6010915091019038611dea565b6020915091019038611ddf565b6040915091019038611dd4565b91505060809038611dc9565b50600090565b9080821015611ee4575090565b905090565b6001600160e01b0390818111611efd571690565b60405162461bcd60e51b815260206004820152602760248201527f53616665436173743a2076616c756520646f65736e27742066697420696e20326044820152663234206269747360c81b6064820152608490fd5b65ffffffffffff90818111611f65571690565b60405162461bcd60e51b815260206004820152602660248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203460448201526538206269747360d01b6064820152608490fd5b63ffffffff90818111611fca571690565b60405162461bcd60e51b815260206004820152602660248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203360448201526532206269747360d01b6064820152608490fd5b6001600160a01b0390811660009081526009602052604080822054938316825290205461120e93929082169116611555565b9081039081116104c25790565b9081018091116104c2579056fea2646970667358221220d461b5581fb88a442c92a03bef0da11de6fbf01ab2396372656b8fe983cf804b64736f6c63430008130033dec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a724", } // DAOTokenABI is the input ABI used to generate the binding from. // Deprecated: Use DAOTokenMetaData.ABI instead. var DAOTokenABI = DAOTokenMetaData.ABI // DAOTokenBin is the compiled bytecode used for deploying new contracts. // Deprecated: Use DAOTokenMetaData.Bin instead. var DAOTokenBin = DAOTokenMetaData.Bin // DeployDAOToken deploys a new Ethereum contract, binding an instance of DAOToken to it. func DeployDAOToken(auth *bind.TransactOpts, backend bind.ContractBackend, name string, symbol string) (common.Address, *types.Transaction, *DAOToken, error) { parsed, err := DAOTokenMetaData.GetAbi() if err != nil { return common.Address{}, nil, nil, err } if parsed == nil { return common.Address{}, nil, nil, errors.New("GetABI returned nil") } address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(DAOTokenBin), backend, name, symbol) if err != nil { return common.Address{}, nil, nil, err } return address, tx, &DAOToken{DAOTokenCaller: DAOTokenCaller{contract: contract}, DAOTokenTransactor: DAOTokenTransactor{contract: contract}, DAOTokenFilterer: DAOTokenFilterer{contract: contract}}, nil } // DAOToken is an auto generated Go binding around an Ethereum contract. type DAOToken struct { DAOTokenCaller // Read-only binding to the contract DAOTokenTransactor // Write-only binding to the contract DAOTokenFilterer // Log filterer for contract events } // DAOTokenCaller is an auto generated read-only Go binding around an Ethereum contract. type DAOTokenCaller struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // DAOTokenTransactor is an auto generated write-only Go binding around an Ethereum contract. type DAOTokenTransactor struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // DAOTokenFilterer is an auto generated log filtering Go binding around an Ethereum contract events. type DAOTokenFilterer struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // DAOTokenSession is an auto generated Go binding around an Ethereum contract, // with pre-set call and transact options. type DAOTokenSession struct { Contract *DAOToken // Generic contract binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // DAOTokenCallerSession is an auto generated read-only Go binding around an Ethereum contract, // with pre-set call options. type DAOTokenCallerSession struct { Contract *DAOTokenCaller // Generic contract caller binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session } // DAOTokenTransactorSession is an auto generated write-only Go binding around an Ethereum contract, // with pre-set transact options. type DAOTokenTransactorSession struct { Contract *DAOTokenTransactor // Generic contract transactor binding to set the session for TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // DAOTokenRaw is an auto generated low-level Go binding around an Ethereum contract. type DAOTokenRaw struct { Contract *DAOToken // Generic contract binding to access the raw methods on } // DAOTokenCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. type DAOTokenCallerRaw struct { Contract *DAOTokenCaller // Generic read-only contract binding to access the raw methods on } // DAOTokenTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. type DAOTokenTransactorRaw struct { Contract *DAOTokenTransactor // Generic write-only contract binding to access the raw methods on } // NewDAOToken creates a new instance of DAOToken, bound to a specific deployed contract. func NewDAOToken(address common.Address, backend bind.ContractBackend) (*DAOToken, error) { contract, err := bindDAOToken(address, backend, backend, backend) if err != nil { return nil, err } return &DAOToken{DAOTokenCaller: DAOTokenCaller{contract: contract}, DAOTokenTransactor: DAOTokenTransactor{contract: contract}, DAOTokenFilterer: DAOTokenFilterer{contract: contract}}, nil } // NewDAOTokenCaller creates a new read-only instance of DAOToken, bound to a specific deployed contract. func NewDAOTokenCaller(address common.Address, caller bind.ContractCaller) (*DAOTokenCaller, error) { contract, err := bindDAOToken(address, caller, nil, nil) if err != nil { return nil, err } return &DAOTokenCaller{contract: contract}, nil } // NewDAOTokenTransactor creates a new write-only instance of DAOToken, bound to a specific deployed contract. func NewDAOTokenTransactor(address common.Address, transactor bind.ContractTransactor) (*DAOTokenTransactor, error) { contract, err := bindDAOToken(address, nil, transactor, nil) if err != nil { return nil, err } return &DAOTokenTransactor{contract: contract}, nil } // NewDAOTokenFilterer creates a new log filterer instance of DAOToken, bound to a specific deployed contract. func NewDAOTokenFilterer(address common.Address, filterer bind.ContractFilterer) (*DAOTokenFilterer, error) { contract, err := bindDAOToken(address, nil, nil, filterer) if err != nil { return nil, err } return &DAOTokenFilterer{contract: contract}, nil } // bindDAOToken binds a generic wrapper to an already deployed contract. func bindDAOToken(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { parsed, err := DAOTokenMetaData.GetAbi() if err != nil { return nil, err } return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_DAOToken *DAOTokenRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _DAOToken.Contract.DAOTokenCaller.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_DAOToken *DAOTokenRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _DAOToken.Contract.DAOTokenTransactor.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_DAOToken *DAOTokenRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _DAOToken.Contract.DAOTokenTransactor.contract.Transact(opts, method, params...) } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_DAOToken *DAOTokenCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _DAOToken.Contract.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_DAOToken *DAOTokenTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _DAOToken.Contract.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_DAOToken *DAOTokenTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _DAOToken.Contract.contract.Transact(opts, method, params...) } // CLOCKMODE is a free data retrieval call binding the contract method 0x4bf5d7e9. // // Solidity: function CLOCK_MODE() view returns(string) func (_DAOToken *DAOTokenCaller) CLOCKMODE(opts *bind.CallOpts) (string, error) { var out []interface{} err := _DAOToken.contract.Call(opts, &out, "CLOCK_MODE") if err != nil { return *new(string), err } out0 := *abi.ConvertType(out[0], new(string)).(*string) return out0, err } // CLOCKMODE is a free data retrieval call binding the contract method 0x4bf5d7e9. // // Solidity: function CLOCK_MODE() view returns(string) func (_DAOToken *DAOTokenSession) CLOCKMODE() (string, error) { return _DAOToken.Contract.CLOCKMODE(&_DAOToken.CallOpts) } // CLOCKMODE is a free data retrieval call binding the contract method 0x4bf5d7e9. // // Solidity: function CLOCK_MODE() view returns(string) func (_DAOToken *DAOTokenCallerSession) CLOCKMODE() (string, error) { return _DAOToken.Contract.CLOCKMODE(&_DAOToken.CallOpts) } // DOMAINSEPARATOR is a free data retrieval call binding the contract method 0x3644e515. // // Solidity: function DOMAIN_SEPARATOR() view returns(bytes32) func (_DAOToken *DAOTokenCaller) DOMAINSEPARATOR(opts *bind.CallOpts) ([32]byte, error) { var out []interface{} err := _DAOToken.contract.Call(opts, &out, "DOMAIN_SEPARATOR") if err != nil { return *new([32]byte), err } out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) return out0, err } // DOMAINSEPARATOR is a free data retrieval call binding the contract method 0x3644e515. // // Solidity: function DOMAIN_SEPARATOR() view returns(bytes32) func (_DAOToken *DAOTokenSession) DOMAINSEPARATOR() ([32]byte, error) { return _DAOToken.Contract.DOMAINSEPARATOR(&_DAOToken.CallOpts) } // DOMAINSEPARATOR is a free data retrieval call binding the contract method 0x3644e515. // // Solidity: function DOMAIN_SEPARATOR() view returns(bytes32) func (_DAOToken *DAOTokenCallerSession) DOMAINSEPARATOR() ([32]byte, error) { return _DAOToken.Contract.DOMAINSEPARATOR(&_DAOToken.CallOpts) } // Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. // // Solidity: function allowance(address owner, address spender) view returns(uint256) func (_DAOToken *DAOTokenCaller) Allowance(opts *bind.CallOpts, owner common.Address, spender common.Address) (*big.Int, error) { var out []interface{} err := _DAOToken.contract.Call(opts, &out, "allowance", owner, spender) if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. // // Solidity: function allowance(address owner, address spender) view returns(uint256) func (_DAOToken *DAOTokenSession) Allowance(owner common.Address, spender common.Address) (*big.Int, error) { return _DAOToken.Contract.Allowance(&_DAOToken.CallOpts, owner, spender) } // Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. // // Solidity: function allowance(address owner, address spender) view returns(uint256) func (_DAOToken *DAOTokenCallerSession) Allowance(owner common.Address, spender common.Address) (*big.Int, error) { return _DAOToken.Contract.Allowance(&_DAOToken.CallOpts, owner, spender) } // BalanceOf is a free data retrieval call binding the contract method 0x70a08231. // // Solidity: function balanceOf(address account) view returns(uint256) func (_DAOToken *DAOTokenCaller) BalanceOf(opts *bind.CallOpts, account common.Address) (*big.Int, error) { var out []interface{} err := _DAOToken.contract.Call(opts, &out, "balanceOf", account) if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // BalanceOf is a free data retrieval call binding the contract method 0x70a08231. // // Solidity: function balanceOf(address account) view returns(uint256) func (_DAOToken *DAOTokenSession) BalanceOf(account common.Address) (*big.Int, error) { return _DAOToken.Contract.BalanceOf(&_DAOToken.CallOpts, account) } // BalanceOf is a free data retrieval call binding the contract method 0x70a08231. // // Solidity: function balanceOf(address account) view returns(uint256) func (_DAOToken *DAOTokenCallerSession) BalanceOf(account common.Address) (*big.Int, error) { return _DAOToken.Contract.BalanceOf(&_DAOToken.CallOpts, account) } // Checkpoints is a free data retrieval call binding the contract method 0xf1127ed8. // // Solidity: function checkpoints(address account, uint32 pos) view returns((uint32,uint224)) func (_DAOToken *DAOTokenCaller) Checkpoints(opts *bind.CallOpts, account common.Address, pos uint32) (ERC20VotesCheckpoint, error) { var out []interface{} err := _DAOToken.contract.Call(opts, &out, "checkpoints", account, pos) if err != nil { return *new(ERC20VotesCheckpoint), err } out0 := *abi.ConvertType(out[0], new(ERC20VotesCheckpoint)).(*ERC20VotesCheckpoint) return out0, err } // Checkpoints is a free data retrieval call binding the contract method 0xf1127ed8. // // Solidity: function checkpoints(address account, uint32 pos) view returns((uint32,uint224)) func (_DAOToken *DAOTokenSession) Checkpoints(account common.Address, pos uint32) (ERC20VotesCheckpoint, error) { return _DAOToken.Contract.Checkpoints(&_DAOToken.CallOpts, account, pos) } // Checkpoints is a free data retrieval call binding the contract method 0xf1127ed8. // // Solidity: function checkpoints(address account, uint32 pos) view returns((uint32,uint224)) func (_DAOToken *DAOTokenCallerSession) Checkpoints(account common.Address, pos uint32) (ERC20VotesCheckpoint, error) { return _DAOToken.Contract.Checkpoints(&_DAOToken.CallOpts, account, pos) } // Clock is a free data retrieval call binding the contract method 0x91ddadf4. // // Solidity: function clock() view returns(uint48) func (_DAOToken *DAOTokenCaller) Clock(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} err := _DAOToken.contract.Call(opts, &out, "clock") if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // Clock is a free data retrieval call binding the contract method 0x91ddadf4. // // Solidity: function clock() view returns(uint48) func (_DAOToken *DAOTokenSession) Clock() (*big.Int, error) { return _DAOToken.Contract.Clock(&_DAOToken.CallOpts) } // Clock is a free data retrieval call binding the contract method 0x91ddadf4. // // Solidity: function clock() view returns(uint48) func (_DAOToken *DAOTokenCallerSession) Clock() (*big.Int, error) { return _DAOToken.Contract.Clock(&_DAOToken.CallOpts) } // Decimals is a free data retrieval call binding the contract method 0x313ce567. // // Solidity: function decimals() view returns(uint8) func (_DAOToken *DAOTokenCaller) Decimals(opts *bind.CallOpts) (uint8, error) { var out []interface{} err := _DAOToken.contract.Call(opts, &out, "decimals") if err != nil { return *new(uint8), err } out0 := *abi.ConvertType(out[0], new(uint8)).(*uint8) return out0, err } // Decimals is a free data retrieval call binding the contract method 0x313ce567. // // Solidity: function decimals() view returns(uint8) func (_DAOToken *DAOTokenSession) Decimals() (uint8, error) { return _DAOToken.Contract.Decimals(&_DAOToken.CallOpts) } // Decimals is a free data retrieval call binding the contract method 0x313ce567. // // Solidity: function decimals() view returns(uint8) func (_DAOToken *DAOTokenCallerSession) Decimals() (uint8, error) { return _DAOToken.Contract.Decimals(&_DAOToken.CallOpts) } // Delegates is a free data retrieval call binding the contract method 0x587cde1e. // // Solidity: function delegates(address account) view returns(address) func (_DAOToken *DAOTokenCaller) Delegates(opts *bind.CallOpts, account common.Address) (common.Address, error) { var out []interface{} err := _DAOToken.contract.Call(opts, &out, "delegates", account) if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // Delegates is a free data retrieval call binding the contract method 0x587cde1e. // // Solidity: function delegates(address account) view returns(address) func (_DAOToken *DAOTokenSession) Delegates(account common.Address) (common.Address, error) { return _DAOToken.Contract.Delegates(&_DAOToken.CallOpts, account) } // Delegates is a free data retrieval call binding the contract method 0x587cde1e. // // Solidity: function delegates(address account) view returns(address) func (_DAOToken *DAOTokenCallerSession) Delegates(account common.Address) (common.Address, error) { return _DAOToken.Contract.Delegates(&_DAOToken.CallOpts, account) } // Eip712Domain is a free data retrieval call binding the contract method 0x84b0196e. // // Solidity: function eip712Domain() view returns(bytes1 fields, string name, string version, uint256 chainId, address verifyingContract, bytes32 salt, uint256[] extensions) func (_DAOToken *DAOTokenCaller) Eip712Domain(opts *bind.CallOpts) (struct { Fields [1]byte Name string Version string ChainId *big.Int VerifyingContract common.Address Salt [32]byte Extensions []*big.Int }, error) { var out []interface{} err := _DAOToken.contract.Call(opts, &out, "eip712Domain") outstruct := new(struct { Fields [1]byte Name string Version string ChainId *big.Int VerifyingContract common.Address Salt [32]byte Extensions []*big.Int }) if err != nil { return *outstruct, err } outstruct.Fields = *abi.ConvertType(out[0], new([1]byte)).(*[1]byte) outstruct.Name = *abi.ConvertType(out[1], new(string)).(*string) outstruct.Version = *abi.ConvertType(out[2], new(string)).(*string) outstruct.ChainId = *abi.ConvertType(out[3], new(*big.Int)).(**big.Int) outstruct.VerifyingContract = *abi.ConvertType(out[4], new(common.Address)).(*common.Address) outstruct.Salt = *abi.ConvertType(out[5], new([32]byte)).(*[32]byte) outstruct.Extensions = *abi.ConvertType(out[6], new([]*big.Int)).(*[]*big.Int) return *outstruct, err } // Eip712Domain is a free data retrieval call binding the contract method 0x84b0196e. // // Solidity: function eip712Domain() view returns(bytes1 fields, string name, string version, uint256 chainId, address verifyingContract, bytes32 salt, uint256[] extensions) func (_DAOToken *DAOTokenSession) Eip712Domain() (struct { Fields [1]byte Name string Version string ChainId *big.Int VerifyingContract common.Address Salt [32]byte Extensions []*big.Int }, error) { return _DAOToken.Contract.Eip712Domain(&_DAOToken.CallOpts) } // Eip712Domain is a free data retrieval call binding the contract method 0x84b0196e. // // Solidity: function eip712Domain() view returns(bytes1 fields, string name, string version, uint256 chainId, address verifyingContract, bytes32 salt, uint256[] extensions) func (_DAOToken *DAOTokenCallerSession) Eip712Domain() (struct { Fields [1]byte Name string Version string ChainId *big.Int VerifyingContract common.Address Salt [32]byte Extensions []*big.Int }, error) { return _DAOToken.Contract.Eip712Domain(&_DAOToken.CallOpts) } // GetPastTotalSupply is a free data retrieval call binding the contract method 0x8e539e8c. // // Solidity: function getPastTotalSupply(uint256 timepoint) view returns(uint256) func (_DAOToken *DAOTokenCaller) GetPastTotalSupply(opts *bind.CallOpts, timepoint *big.Int) (*big.Int, error) { var out []interface{} err := _DAOToken.contract.Call(opts, &out, "getPastTotalSupply", timepoint) if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // GetPastTotalSupply is a free data retrieval call binding the contract method 0x8e539e8c. // // Solidity: function getPastTotalSupply(uint256 timepoint) view returns(uint256) func (_DAOToken *DAOTokenSession) GetPastTotalSupply(timepoint *big.Int) (*big.Int, error) { return _DAOToken.Contract.GetPastTotalSupply(&_DAOToken.CallOpts, timepoint) } // GetPastTotalSupply is a free data retrieval call binding the contract method 0x8e539e8c. // // Solidity: function getPastTotalSupply(uint256 timepoint) view returns(uint256) func (_DAOToken *DAOTokenCallerSession) GetPastTotalSupply(timepoint *big.Int) (*big.Int, error) { return _DAOToken.Contract.GetPastTotalSupply(&_DAOToken.CallOpts, timepoint) } // GetPastVotes is a free data retrieval call binding the contract method 0x3a46b1a8. // // Solidity: function getPastVotes(address account, uint256 timepoint) view returns(uint256) func (_DAOToken *DAOTokenCaller) GetPastVotes(opts *bind.CallOpts, account common.Address, timepoint *big.Int) (*big.Int, error) { var out []interface{} err := _DAOToken.contract.Call(opts, &out, "getPastVotes", account, timepoint) if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // GetPastVotes is a free data retrieval call binding the contract method 0x3a46b1a8. // // Solidity: function getPastVotes(address account, uint256 timepoint) view returns(uint256) func (_DAOToken *DAOTokenSession) GetPastVotes(account common.Address, timepoint *big.Int) (*big.Int, error) { return _DAOToken.Contract.GetPastVotes(&_DAOToken.CallOpts, account, timepoint) } // GetPastVotes is a free data retrieval call binding the contract method 0x3a46b1a8. // // Solidity: function getPastVotes(address account, uint256 timepoint) view returns(uint256) func (_DAOToken *DAOTokenCallerSession) GetPastVotes(account common.Address, timepoint *big.Int) (*big.Int, error) { return _DAOToken.Contract.GetPastVotes(&_DAOToken.CallOpts, account, timepoint) } // GetVotes is a free data retrieval call binding the contract method 0x9ab24eb0. // // Solidity: function getVotes(address account) view returns(uint256) func (_DAOToken *DAOTokenCaller) GetVotes(opts *bind.CallOpts, account common.Address) (*big.Int, error) { var out []interface{} err := _DAOToken.contract.Call(opts, &out, "getVotes", account) if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // GetVotes is a free data retrieval call binding the contract method 0x9ab24eb0. // // Solidity: function getVotes(address account) view returns(uint256) func (_DAOToken *DAOTokenSession) GetVotes(account common.Address) (*big.Int, error) { return _DAOToken.Contract.GetVotes(&_DAOToken.CallOpts, account) } // GetVotes is a free data retrieval call binding the contract method 0x9ab24eb0. // // Solidity: function getVotes(address account) view returns(uint256) func (_DAOToken *DAOTokenCallerSession) GetVotes(account common.Address) (*big.Int, error) { return _DAOToken.Contract.GetVotes(&_DAOToken.CallOpts, account) } // Name is a free data retrieval call binding the contract method 0x06fdde03. // // Solidity: function name() view returns(string) func (_DAOToken *DAOTokenCaller) Name(opts *bind.CallOpts) (string, error) { var out []interface{} err := _DAOToken.contract.Call(opts, &out, "name") if err != nil { return *new(string), err } out0 := *abi.ConvertType(out[0], new(string)).(*string) return out0, err } // Name is a free data retrieval call binding the contract method 0x06fdde03. // // Solidity: function name() view returns(string) func (_DAOToken *DAOTokenSession) Name() (string, error) { return _DAOToken.Contract.Name(&_DAOToken.CallOpts) } // Name is a free data retrieval call binding the contract method 0x06fdde03. // // Solidity: function name() view returns(string) func (_DAOToken *DAOTokenCallerSession) Name() (string, error) { return _DAOToken.Contract.Name(&_DAOToken.CallOpts) } // Nonces is a free data retrieval call binding the contract method 0x7ecebe00. // // Solidity: function nonces(address owner) view returns(uint256) func (_DAOToken *DAOTokenCaller) Nonces(opts *bind.CallOpts, owner common.Address) (*big.Int, error) { var out []interface{} err := _DAOToken.contract.Call(opts, &out, "nonces", owner) if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // Nonces is a free data retrieval call binding the contract method 0x7ecebe00. // // Solidity: function nonces(address owner) view returns(uint256) func (_DAOToken *DAOTokenSession) Nonces(owner common.Address) (*big.Int, error) { return _DAOToken.Contract.Nonces(&_DAOToken.CallOpts, owner) } // Nonces is a free data retrieval call binding the contract method 0x7ecebe00. // // Solidity: function nonces(address owner) view returns(uint256) func (_DAOToken *DAOTokenCallerSession) Nonces(owner common.Address) (*big.Int, error) { return _DAOToken.Contract.Nonces(&_DAOToken.CallOpts, owner) } // NumCheckpoints is a free data retrieval call binding the contract method 0x6fcfff45. // // Solidity: function numCheckpoints(address account) view returns(uint32) func (_DAOToken *DAOTokenCaller) NumCheckpoints(opts *bind.CallOpts, account common.Address) (uint32, error) { var out []interface{} err := _DAOToken.contract.Call(opts, &out, "numCheckpoints", account) if err != nil { return *new(uint32), err } out0 := *abi.ConvertType(out[0], new(uint32)).(*uint32) return out0, err } // NumCheckpoints is a free data retrieval call binding the contract method 0x6fcfff45. // // Solidity: function numCheckpoints(address account) view returns(uint32) func (_DAOToken *DAOTokenSession) NumCheckpoints(account common.Address) (uint32, error) { return _DAOToken.Contract.NumCheckpoints(&_DAOToken.CallOpts, account) } // NumCheckpoints is a free data retrieval call binding the contract method 0x6fcfff45. // // Solidity: function numCheckpoints(address account) view returns(uint32) func (_DAOToken *DAOTokenCallerSession) NumCheckpoints(account common.Address) (uint32, error) { return _DAOToken.Contract.NumCheckpoints(&_DAOToken.CallOpts, account) } // Symbol is a free data retrieval call binding the contract method 0x95d89b41. // // Solidity: function symbol() view returns(string) func (_DAOToken *DAOTokenCaller) Symbol(opts *bind.CallOpts) (string, error) { var out []interface{} err := _DAOToken.contract.Call(opts, &out, "symbol") if err != nil { return *new(string), err } out0 := *abi.ConvertType(out[0], new(string)).(*string) return out0, err } // Symbol is a free data retrieval call binding the contract method 0x95d89b41. // // Solidity: function symbol() view returns(string) func (_DAOToken *DAOTokenSession) Symbol() (string, error) { return _DAOToken.Contract.Symbol(&_DAOToken.CallOpts) } // Symbol is a free data retrieval call binding the contract method 0x95d89b41. // // Solidity: function symbol() view returns(string) func (_DAOToken *DAOTokenCallerSession) Symbol() (string, error) { return _DAOToken.Contract.Symbol(&_DAOToken.CallOpts) } // TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. // // Solidity: function totalSupply() view returns(uint256) func (_DAOToken *DAOTokenCaller) TotalSupply(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} err := _DAOToken.contract.Call(opts, &out, "totalSupply") if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. // // Solidity: function totalSupply() view returns(uint256) func (_DAOToken *DAOTokenSession) TotalSupply() (*big.Int, error) { return _DAOToken.Contract.TotalSupply(&_DAOToken.CallOpts) } // TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. // // Solidity: function totalSupply() view returns(uint256) func (_DAOToken *DAOTokenCallerSession) TotalSupply() (*big.Int, error) { return _DAOToken.Contract.TotalSupply(&_DAOToken.CallOpts) } // Approve is a paid mutator transaction binding the contract method 0x095ea7b3. // // Solidity: function approve(address spender, uint256 amount) returns(bool) func (_DAOToken *DAOTokenTransactor) Approve(opts *bind.TransactOpts, spender common.Address, amount *big.Int) (*types.Transaction, error) { return _DAOToken.contract.Transact(opts, "approve", spender, amount) } // Approve is a paid mutator transaction binding the contract method 0x095ea7b3. // // Solidity: function approve(address spender, uint256 amount) returns(bool) func (_DAOToken *DAOTokenSession) Approve(spender common.Address, amount *big.Int) (*types.Transaction, error) { return _DAOToken.Contract.Approve(&_DAOToken.TransactOpts, spender, amount) } // Approve is a paid mutator transaction binding the contract method 0x095ea7b3. // // Solidity: function approve(address spender, uint256 amount) returns(bool) func (_DAOToken *DAOTokenTransactorSession) Approve(spender common.Address, amount *big.Int) (*types.Transaction, error) { return _DAOToken.Contract.Approve(&_DAOToken.TransactOpts, spender, amount) } // DecreaseAllowance is a paid mutator transaction binding the contract method 0xa457c2d7. // // Solidity: function decreaseAllowance(address spender, uint256 subtractedValue) returns(bool) func (_DAOToken *DAOTokenTransactor) DecreaseAllowance(opts *bind.TransactOpts, spender common.Address, subtractedValue *big.Int) (*types.Transaction, error) { return _DAOToken.contract.Transact(opts, "decreaseAllowance", spender, subtractedValue) } // DecreaseAllowance is a paid mutator transaction binding the contract method 0xa457c2d7. // // Solidity: function decreaseAllowance(address spender, uint256 subtractedValue) returns(bool) func (_DAOToken *DAOTokenSession) DecreaseAllowance(spender common.Address, subtractedValue *big.Int) (*types.Transaction, error) { return _DAOToken.Contract.DecreaseAllowance(&_DAOToken.TransactOpts, spender, subtractedValue) } // DecreaseAllowance is a paid mutator transaction binding the contract method 0xa457c2d7. // // Solidity: function decreaseAllowance(address spender, uint256 subtractedValue) returns(bool) func (_DAOToken *DAOTokenTransactorSession) DecreaseAllowance(spender common.Address, subtractedValue *big.Int) (*types.Transaction, error) { return _DAOToken.Contract.DecreaseAllowance(&_DAOToken.TransactOpts, spender, subtractedValue) } // Delegate is a paid mutator transaction binding the contract method 0x5c19a95c. // // Solidity: function delegate(address delegatee) returns() func (_DAOToken *DAOTokenTransactor) Delegate(opts *bind.TransactOpts, delegatee common.Address) (*types.Transaction, error) { return _DAOToken.contract.Transact(opts, "delegate", delegatee) } // Delegate is a paid mutator transaction binding the contract method 0x5c19a95c. // // Solidity: function delegate(address delegatee) returns() func (_DAOToken *DAOTokenSession) Delegate(delegatee common.Address) (*types.Transaction, error) { return _DAOToken.Contract.Delegate(&_DAOToken.TransactOpts, delegatee) } // Delegate is a paid mutator transaction binding the contract method 0x5c19a95c. // // Solidity: function delegate(address delegatee) returns() func (_DAOToken *DAOTokenTransactorSession) Delegate(delegatee common.Address) (*types.Transaction, error) { return _DAOToken.Contract.Delegate(&_DAOToken.TransactOpts, delegatee) } // DelegateBySig is a paid mutator transaction binding the contract method 0xc3cda520. // // Solidity: function delegateBySig(address delegatee, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) returns() func (_DAOToken *DAOTokenTransactor) DelegateBySig(opts *bind.TransactOpts, delegatee common.Address, nonce *big.Int, expiry *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _DAOToken.contract.Transact(opts, "delegateBySig", delegatee, nonce, expiry, v, r, s) } // DelegateBySig is a paid mutator transaction binding the contract method 0xc3cda520. // // Solidity: function delegateBySig(address delegatee, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) returns() func (_DAOToken *DAOTokenSession) DelegateBySig(delegatee common.Address, nonce *big.Int, expiry *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _DAOToken.Contract.DelegateBySig(&_DAOToken.TransactOpts, delegatee, nonce, expiry, v, r, s) } // DelegateBySig is a paid mutator transaction binding the contract method 0xc3cda520. // // Solidity: function delegateBySig(address delegatee, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) returns() func (_DAOToken *DAOTokenTransactorSession) DelegateBySig(delegatee common.Address, nonce *big.Int, expiry *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _DAOToken.Contract.DelegateBySig(&_DAOToken.TransactOpts, delegatee, nonce, expiry, v, r, s) } // IncreaseAllowance is a paid mutator transaction binding the contract method 0x39509351. // // Solidity: function increaseAllowance(address spender, uint256 addedValue) returns(bool) func (_DAOToken *DAOTokenTransactor) IncreaseAllowance(opts *bind.TransactOpts, spender common.Address, addedValue *big.Int) (*types.Transaction, error) { return _DAOToken.contract.Transact(opts, "increaseAllowance", spender, addedValue) } // IncreaseAllowance is a paid mutator transaction binding the contract method 0x39509351. // // Solidity: function increaseAllowance(address spender, uint256 addedValue) returns(bool) func (_DAOToken *DAOTokenSession) IncreaseAllowance(spender common.Address, addedValue *big.Int) (*types.Transaction, error) { return _DAOToken.Contract.IncreaseAllowance(&_DAOToken.TransactOpts, spender, addedValue) } // IncreaseAllowance is a paid mutator transaction binding the contract method 0x39509351. // // Solidity: function increaseAllowance(address spender, uint256 addedValue) returns(bool) func (_DAOToken *DAOTokenTransactorSession) IncreaseAllowance(spender common.Address, addedValue *big.Int) (*types.Transaction, error) { return _DAOToken.Contract.IncreaseAllowance(&_DAOToken.TransactOpts, spender, addedValue) } // Permit is a paid mutator transaction binding the contract method 0xd505accf. // // Solidity: function permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) returns() func (_DAOToken *DAOTokenTransactor) Permit(opts *bind.TransactOpts, owner common.Address, spender common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _DAOToken.contract.Transact(opts, "permit", owner, spender, value, deadline, v, r, s) } // Permit is a paid mutator transaction binding the contract method 0xd505accf. // // Solidity: function permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) returns() func (_DAOToken *DAOTokenSession) Permit(owner common.Address, spender common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _DAOToken.Contract.Permit(&_DAOToken.TransactOpts, owner, spender, value, deadline, v, r, s) } // Permit is a paid mutator transaction binding the contract method 0xd505accf. // // Solidity: function permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) returns() func (_DAOToken *DAOTokenTransactorSession) Permit(owner common.Address, spender common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _DAOToken.Contract.Permit(&_DAOToken.TransactOpts, owner, spender, value, deadline, v, r, s) } // Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. // // Solidity: function transfer(address to, uint256 amount) returns(bool) func (_DAOToken *DAOTokenTransactor) Transfer(opts *bind.TransactOpts, to common.Address, amount *big.Int) (*types.Transaction, error) { return _DAOToken.contract.Transact(opts, "transfer", to, amount) } // Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. // // Solidity: function transfer(address to, uint256 amount) returns(bool) func (_DAOToken *DAOTokenSession) Transfer(to common.Address, amount *big.Int) (*types.Transaction, error) { return _DAOToken.Contract.Transfer(&_DAOToken.TransactOpts, to, amount) } // Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. // // Solidity: function transfer(address to, uint256 amount) returns(bool) func (_DAOToken *DAOTokenTransactorSession) Transfer(to common.Address, amount *big.Int) (*types.Transaction, error) { return _DAOToken.Contract.Transfer(&_DAOToken.TransactOpts, to, amount) } // TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. // // Solidity: function transferFrom(address from, address to, uint256 amount) returns(bool) func (_DAOToken *DAOTokenTransactor) TransferFrom(opts *bind.TransactOpts, from common.Address, to common.Address, amount *big.Int) (*types.Transaction, error) { return _DAOToken.contract.Transact(opts, "transferFrom", from, to, amount) } // TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. // // Solidity: function transferFrom(address from, address to, uint256 amount) returns(bool) func (_DAOToken *DAOTokenSession) TransferFrom(from common.Address, to common.Address, amount *big.Int) (*types.Transaction, error) { return _DAOToken.Contract.TransferFrom(&_DAOToken.TransactOpts, from, to, amount) } // TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. // // Solidity: function transferFrom(address from, address to, uint256 amount) returns(bool) func (_DAOToken *DAOTokenTransactorSession) TransferFrom(from common.Address, to common.Address, amount *big.Int) (*types.Transaction, error) { return _DAOToken.Contract.TransferFrom(&_DAOToken.TransactOpts, from, to, amount) } // DAOTokenApprovalIterator is returned from FilterApproval and is used to iterate over the raw logs and unpacked data for Approval events raised by the DAOToken contract. type DAOTokenApprovalIterator struct { Event *DAOTokenApproval // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *DAOTokenApprovalIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(DAOTokenApproval) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(DAOTokenApproval) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *DAOTokenApprovalIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *DAOTokenApprovalIterator) Close() error { it.sub.Unsubscribe() return nil } // DAOTokenApproval represents a Approval event raised by the DAOToken contract. type DAOTokenApproval struct { Owner common.Address Spender common.Address Value *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterApproval is a free log retrieval operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. // // Solidity: event Approval(address indexed owner, address indexed spender, uint256 value) func (_DAOToken *DAOTokenFilterer) FilterApproval(opts *bind.FilterOpts, owner []common.Address, spender []common.Address) (*DAOTokenApprovalIterator, error) { var ownerRule []interface{} for _, ownerItem := range owner { ownerRule = append(ownerRule, ownerItem) } var spenderRule []interface{} for _, spenderItem := range spender { spenderRule = append(spenderRule, spenderItem) } logs, sub, err := _DAOToken.contract.FilterLogs(opts, "Approval", ownerRule, spenderRule) if err != nil { return nil, err } return &DAOTokenApprovalIterator{contract: _DAOToken.contract, event: "Approval", logs: logs, sub: sub}, nil } // WatchApproval is a free log subscription operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. // // Solidity: event Approval(address indexed owner, address indexed spender, uint256 value) func (_DAOToken *DAOTokenFilterer) WatchApproval(opts *bind.WatchOpts, sink chan<- *DAOTokenApproval, owner []common.Address, spender []common.Address) (event.Subscription, error) { var ownerRule []interface{} for _, ownerItem := range owner { ownerRule = append(ownerRule, ownerItem) } var spenderRule []interface{} for _, spenderItem := range spender { spenderRule = append(spenderRule, spenderItem) } logs, sub, err := _DAOToken.contract.WatchLogs(opts, "Approval", ownerRule, spenderRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(DAOTokenApproval) if err := _DAOToken.contract.UnpackLog(event, "Approval", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseApproval is a log parse operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. // // Solidity: event Approval(address indexed owner, address indexed spender, uint256 value) func (_DAOToken *DAOTokenFilterer) ParseApproval(log types.Log) (*DAOTokenApproval, error) { event := new(DAOTokenApproval) if err := _DAOToken.contract.UnpackLog(event, "Approval", log); err != nil { return nil, err } event.Raw = log return event, nil } // DAOTokenDelegateChangedIterator is returned from FilterDelegateChanged and is used to iterate over the raw logs and unpacked data for DelegateChanged events raised by the DAOToken contract. type DAOTokenDelegateChangedIterator struct { Event *DAOTokenDelegateChanged // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *DAOTokenDelegateChangedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(DAOTokenDelegateChanged) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(DAOTokenDelegateChanged) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *DAOTokenDelegateChangedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *DAOTokenDelegateChangedIterator) Close() error { it.sub.Unsubscribe() return nil } // DAOTokenDelegateChanged represents a DelegateChanged event raised by the DAOToken contract. type DAOTokenDelegateChanged struct { Delegator common.Address FromDelegate common.Address ToDelegate common.Address Raw types.Log // Blockchain specific contextual infos } // FilterDelegateChanged is a free log retrieval operation binding the contract event 0x3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f. // // Solidity: event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate) func (_DAOToken *DAOTokenFilterer) FilterDelegateChanged(opts *bind.FilterOpts, delegator []common.Address, fromDelegate []common.Address, toDelegate []common.Address) (*DAOTokenDelegateChangedIterator, error) { var delegatorRule []interface{} for _, delegatorItem := range delegator { delegatorRule = append(delegatorRule, delegatorItem) } var fromDelegateRule []interface{} for _, fromDelegateItem := range fromDelegate { fromDelegateRule = append(fromDelegateRule, fromDelegateItem) } var toDelegateRule []interface{} for _, toDelegateItem := range toDelegate { toDelegateRule = append(toDelegateRule, toDelegateItem) } logs, sub, err := _DAOToken.contract.FilterLogs(opts, "DelegateChanged", delegatorRule, fromDelegateRule, toDelegateRule) if err != nil { return nil, err } return &DAOTokenDelegateChangedIterator{contract: _DAOToken.contract, event: "DelegateChanged", logs: logs, sub: sub}, nil } // WatchDelegateChanged is a free log subscription operation binding the contract event 0x3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f. // // Solidity: event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate) func (_DAOToken *DAOTokenFilterer) WatchDelegateChanged(opts *bind.WatchOpts, sink chan<- *DAOTokenDelegateChanged, delegator []common.Address, fromDelegate []common.Address, toDelegate []common.Address) (event.Subscription, error) { var delegatorRule []interface{} for _, delegatorItem := range delegator { delegatorRule = append(delegatorRule, delegatorItem) } var fromDelegateRule []interface{} for _, fromDelegateItem := range fromDelegate { fromDelegateRule = append(fromDelegateRule, fromDelegateItem) } var toDelegateRule []interface{} for _, toDelegateItem := range toDelegate { toDelegateRule = append(toDelegateRule, toDelegateItem) } logs, sub, err := _DAOToken.contract.WatchLogs(opts, "DelegateChanged", delegatorRule, fromDelegateRule, toDelegateRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(DAOTokenDelegateChanged) if err := _DAOToken.contract.UnpackLog(event, "DelegateChanged", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseDelegateChanged is a log parse operation binding the contract event 0x3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f. // // Solidity: event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate) func (_DAOToken *DAOTokenFilterer) ParseDelegateChanged(log types.Log) (*DAOTokenDelegateChanged, error) { event := new(DAOTokenDelegateChanged) if err := _DAOToken.contract.UnpackLog(event, "DelegateChanged", log); err != nil { return nil, err } event.Raw = log return event, nil } // DAOTokenDelegateVotesChangedIterator is returned from FilterDelegateVotesChanged and is used to iterate over the raw logs and unpacked data for DelegateVotesChanged events raised by the DAOToken contract. type DAOTokenDelegateVotesChangedIterator struct { Event *DAOTokenDelegateVotesChanged // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *DAOTokenDelegateVotesChangedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(DAOTokenDelegateVotesChanged) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(DAOTokenDelegateVotesChanged) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *DAOTokenDelegateVotesChangedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *DAOTokenDelegateVotesChangedIterator) Close() error { it.sub.Unsubscribe() return nil } // DAOTokenDelegateVotesChanged represents a DelegateVotesChanged event raised by the DAOToken contract. type DAOTokenDelegateVotesChanged struct { Delegate common.Address PreviousBalance *big.Int NewBalance *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterDelegateVotesChanged is a free log retrieval operation binding the contract event 0xdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a724. // // Solidity: event DelegateVotesChanged(address indexed delegate, uint256 previousBalance, uint256 newBalance) func (_DAOToken *DAOTokenFilterer) FilterDelegateVotesChanged(opts *bind.FilterOpts, delegate []common.Address) (*DAOTokenDelegateVotesChangedIterator, error) { var delegateRule []interface{} for _, delegateItem := range delegate { delegateRule = append(delegateRule, delegateItem) } logs, sub, err := _DAOToken.contract.FilterLogs(opts, "DelegateVotesChanged", delegateRule) if err != nil { return nil, err } return &DAOTokenDelegateVotesChangedIterator{contract: _DAOToken.contract, event: "DelegateVotesChanged", logs: logs, sub: sub}, nil } // WatchDelegateVotesChanged is a free log subscription operation binding the contract event 0xdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a724. // // Solidity: event DelegateVotesChanged(address indexed delegate, uint256 previousBalance, uint256 newBalance) func (_DAOToken *DAOTokenFilterer) WatchDelegateVotesChanged(opts *bind.WatchOpts, sink chan<- *DAOTokenDelegateVotesChanged, delegate []common.Address) (event.Subscription, error) { var delegateRule []interface{} for _, delegateItem := range delegate { delegateRule = append(delegateRule, delegateItem) } logs, sub, err := _DAOToken.contract.WatchLogs(opts, "DelegateVotesChanged", delegateRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(DAOTokenDelegateVotesChanged) if err := _DAOToken.contract.UnpackLog(event, "DelegateVotesChanged", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseDelegateVotesChanged is a log parse operation binding the contract event 0xdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a724. // // Solidity: event DelegateVotesChanged(address indexed delegate, uint256 previousBalance, uint256 newBalance) func (_DAOToken *DAOTokenFilterer) ParseDelegateVotesChanged(log types.Log) (*DAOTokenDelegateVotesChanged, error) { event := new(DAOTokenDelegateVotesChanged) if err := _DAOToken.contract.UnpackLog(event, "DelegateVotesChanged", log); err != nil { return nil, err } event.Raw = log return event, nil } // DAOTokenEIP712DomainChangedIterator is returned from FilterEIP712DomainChanged and is used to iterate over the raw logs and unpacked data for EIP712DomainChanged events raised by the DAOToken contract. type DAOTokenEIP712DomainChangedIterator struct { Event *DAOTokenEIP712DomainChanged // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *DAOTokenEIP712DomainChangedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(DAOTokenEIP712DomainChanged) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(DAOTokenEIP712DomainChanged) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *DAOTokenEIP712DomainChangedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *DAOTokenEIP712DomainChangedIterator) Close() error { it.sub.Unsubscribe() return nil } // DAOTokenEIP712DomainChanged represents a EIP712DomainChanged event raised by the DAOToken contract. type DAOTokenEIP712DomainChanged struct { Raw types.Log // Blockchain specific contextual infos } // FilterEIP712DomainChanged is a free log retrieval operation binding the contract event 0x0a6387c9ea3628b88a633bb4f3b151770f70085117a15f9bf3787cda53f13d31. // // Solidity: event EIP712DomainChanged() func (_DAOToken *DAOTokenFilterer) FilterEIP712DomainChanged(opts *bind.FilterOpts) (*DAOTokenEIP712DomainChangedIterator, error) { logs, sub, err := _DAOToken.contract.FilterLogs(opts, "EIP712DomainChanged") if err != nil { return nil, err } return &DAOTokenEIP712DomainChangedIterator{contract: _DAOToken.contract, event: "EIP712DomainChanged", logs: logs, sub: sub}, nil } // WatchEIP712DomainChanged is a free log subscription operation binding the contract event 0x0a6387c9ea3628b88a633bb4f3b151770f70085117a15f9bf3787cda53f13d31. // // Solidity: event EIP712DomainChanged() func (_DAOToken *DAOTokenFilterer) WatchEIP712DomainChanged(opts *bind.WatchOpts, sink chan<- *DAOTokenEIP712DomainChanged) (event.Subscription, error) { logs, sub, err := _DAOToken.contract.WatchLogs(opts, "EIP712DomainChanged") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(DAOTokenEIP712DomainChanged) if err := _DAOToken.contract.UnpackLog(event, "EIP712DomainChanged", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseEIP712DomainChanged is a log parse operation binding the contract event 0x0a6387c9ea3628b88a633bb4f3b151770f70085117a15f9bf3787cda53f13d31. // // Solidity: event EIP712DomainChanged() func (_DAOToken *DAOTokenFilterer) ParseEIP712DomainChanged(log types.Log) (*DAOTokenEIP712DomainChanged, error) { event := new(DAOTokenEIP712DomainChanged) if err := _DAOToken.contract.UnpackLog(event, "EIP712DomainChanged", log); err != nil { return nil, err } event.Raw = log return event, nil } // DAOTokenTransferIterator is returned from FilterTransfer and is used to iterate over the raw logs and unpacked data for Transfer events raised by the DAOToken contract. type DAOTokenTransferIterator struct { Event *DAOTokenTransfer // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *DAOTokenTransferIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(DAOTokenTransfer) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(DAOTokenTransfer) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *DAOTokenTransferIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *DAOTokenTransferIterator) Close() error { it.sub.Unsubscribe() return nil } // DAOTokenTransfer represents a Transfer event raised by the DAOToken contract. type DAOTokenTransfer struct { From common.Address To common.Address Value *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterTransfer is a free log retrieval operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. // // Solidity: event Transfer(address indexed from, address indexed to, uint256 value) func (_DAOToken *DAOTokenFilterer) FilterTransfer(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*DAOTokenTransferIterator, error) { var fromRule []interface{} for _, fromItem := range from { fromRule = append(fromRule, fromItem) } var toRule []interface{} for _, toItem := range to { toRule = append(toRule, toItem) } logs, sub, err := _DAOToken.contract.FilterLogs(opts, "Transfer", fromRule, toRule) if err != nil { return nil, err } return &DAOTokenTransferIterator{contract: _DAOToken.contract, event: "Transfer", logs: logs, sub: sub}, nil } // WatchTransfer is a free log subscription operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. // // Solidity: event Transfer(address indexed from, address indexed to, uint256 value) func (_DAOToken *DAOTokenFilterer) WatchTransfer(opts *bind.WatchOpts, sink chan<- *DAOTokenTransfer, from []common.Address, to []common.Address) (event.Subscription, error) { var fromRule []interface{} for _, fromItem := range from { fromRule = append(fromRule, fromItem) } var toRule []interface{} for _, toItem := range to { toRule = append(toRule, toItem) } logs, sub, err := _DAOToken.contract.WatchLogs(opts, "Transfer", fromRule, toRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(DAOTokenTransfer) if err := _DAOToken.contract.UnpackLog(event, "Transfer", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseTransfer is a log parse operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. // // Solidity: event Transfer(address indexed from, address indexed to, uint256 value) func (_DAOToken *DAOTokenFilterer) ParseTransfer(log types.Log) (*DAOTokenTransfer, error) { event := new(DAOTokenTransfer) if err := _DAOToken.contract.UnpackLog(event, "Transfer", log); err != nil { return nil, err } event.Raw = log return event, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/binds/daotreasury/DAOTreasury.go ================================================ // Code generated - DO NOT EDIT. // This file is a generated binding and any manual changes will be lost. package daotreasury import ( "errors" "math/big" "strings" ethereum "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/event" ) // Reference imports to suppress errors if they are not otherwise used. var ( _ = errors.New _ = big.NewInt _ = strings.NewReader _ = ethereum.NotFound _ = bind.Bind _ = common.Big1 _ = types.BloomLookup _ = event.NewSubscription _ = abi.ConvertType ) // DAOTreasuryMetaData contains all meta data concerning the DAOTreasury contract. var DAOTreasuryMetaData = &bind.MetaData{ ABI: "[{\"inputs\":[],\"name\":\"R\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"T\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_daoToken\",\"type\":\"address\"}],\"name\":\"addLiqidity\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"baseFundBalance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"baseToken\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"cancelFund\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"daoToken\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"feeBalance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getChainId\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"governor\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_positionManager\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_baseToken\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes[]\",\"name\":\"data\",\"type\":\"bytes[]\"}],\"name\":\"multicall\",\"outputs\":[{\"internalType\":\"bytes[]\",\"name\":\"results\",\"type\":\"bytes[]\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"onERC721Received\",\"outputs\":[{\"internalType\":\"bytes4\",\"name\":\"\",\"type\":\"bytes4\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"poolV3\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"position0TokenId\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"position1TokenId\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"positionManager\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_settledFundBalance\",\"type\":\"uint256\"}],\"name\":\"settleFund\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"settledFundBalance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]", Bin: "0x6080806040523461001657611f3e908161001c8239f35b600080fdfe6080604052600436101561001b575b361561001957600080fd5b005b60003560e01c80630c340a241461015b5780630c9827df1461015657806314a8fc9714610151578063150b7a021461014c5780633408e47014610147578063485cc9551461014257806348ea59a81461013d5780634914b0301461013857806360b71d4e14610133578063715018a61461012e578063791b98bc146101295780638da5cb5b14610124578063ac9650d81461011f578063bb5df5541461011a578063c55dae6314610115578063c7d5120214610110578063e914fa121461010b578063f2fde38b14610106578063f68391d6146101015763fd90f6d40361000e57610d97565b610d79565b610ce8565b610c42565b610812565b6107e9565b6107cb565b6106c4565b6105f1565b6105c8565b610567565b610549565b610520565b610502565b610409565b6103ee565b610357565b6101a7565b610189565b346101845760003660031901126101845760c9546040516001600160a01b039091168152602090f35b600080fd5b3461018457600036600319011261018457602060cd54604051908152f35b34610184576020366003190112610184576004356101c3610dc0565b6101cf60d254156112dc565b60ce546040516370a0823160e01b8152306004820152916001600160a01b0390911690602083602481855afa9081156102ab576100199360009261026f575b5061024e610234826102256102699486101561131d565b61024061023b6102348761135c565b6064900490565b60d255565b6102498160d055565b611372565b6102578160d155565b6033546001600160a01b03169261134f565b91611c6f565b61026991925061023461029b61024e9260203d81116102a4575b61029381836102f8565b81019061130e565b9392505061020e565b503d610289565b61108b565b6001600160a01b0381160361018457565b634e487b7160e01b600052604160045260246000fd5b60a0810190811067ffffffffffffffff8211176102f357604052565b6102c1565b90601f8019910116810190811067ffffffffffffffff8211176102f357604052565b60405190610160820182811067ffffffffffffffff8211176102f357604052565b67ffffffffffffffff81116102f357601f01601f191660200190565b34610184576080366003190112610184576103736004356102b0565b61037e6024356102b0565b60643567ffffffffffffffff81116101845736602382011215610184578060040135906103aa8261033b565b916103b860405193846102f8565b8083523660248284010111610184576000928160246020940184830137010152604051630a85bd0160e11b8152602090f35b0390f35b34610184576000366003190112610184576020604051468152f35b3461018457604036600319011261018457600435610426816102b0565b610476602435610435816102b0565b6000549261045a60ff8560081c1615809581966104f4575b81156104d4575b5061100f565b8361046d600160ff196000541617600055565b6104bb57611116565b61047c57005b61048c61ff001960005416600055565b604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb384740249890602090a1005b6104cf61010061ff00196000541617600055565b611116565b303b159150816104e6575b5038610454565b6001915060ff1614386104df565b600160ff821610915061044d565b3461018457600036600319011261018457602060d154604051908152f35b346101845760003660031901126101845760cf546040516001600160a01b039091168152602090f35b3461018457600036600319011261018457602060d254604051908152f35b34610184576000806003193601126105c557610581610dc0565b603380546001600160a01b0319811690915581906001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b80fd5b346101845760003660031901126101845760ca546040516001600160a01b039091168152602090f35b34610184576000366003190112610184576033546040516001600160a01b039091168152602090f35b60005b83811061062d5750506000910152565b818101518382015260200161061d565b906020916106568151809281855285808601910161061a565b601f01601f1916010190565b602080820190808352835180925260408301928160408460051b8301019501936000915b8483106106965750505050505090565b90919293949584806106b4600193603f198682030187528a5161063d565b9801930193019194939290610686565b6020366003190112610184576004803567ffffffffffffffff918282116101845736602383011215610184578181013592831161018457602490818301928236918660051b0101116101845761071984610e79565b9360005b81811061073257604051806103ea8882610662565b600080610740838589610f03565b60409391610752855180938193610f4a565b0390305af490610760610f58565b9182901561078f5750509061078a916107798289610ffb565b526107848188610ffb565b50610ed9565b61071d565b86838792604482511061018457826107c793856107b29401518301019101610f88565b925162461bcd60e51b81529283928301610fea565b0390fd5b3461018457600036600319011261018457602060d054604051908152f35b346101845760003660031901126101845760ce546040516001600160a01b039091168152602090f35b34610184576020806003193601126101845760043590610831826102b0565b610839610dc0565b61084660d1541515611403565b60cf546001600160a01b03919061085f90831615611435565b60ce546001600160a01b031660cf80546001600160a01b0319166001600160a01b0386161790559282811692604080516318160ddd60e01b81528481600481895afa9081156102ab57600091610c25575b506108c86108c061023483611388565b303387611bb9565b6108d46102348261139e565b9060d054966108e761023460d15461139e565b90858a16119788600014610bee578786889a8c9561090587956113b4565b9061090f916113f9565b61091890611d84565b61093761092d6109969b61093c935b166118ed565b603c9060020b0590565b611467565b9c8d9761096861095c6109576109518c61147c565b9b611497565b61157d565b6001600160a01b031690565b9215610be3579061099b91969b5b60ca5461098d9061095c906001600160a01b031681565b9b8c8093611ccc565b611ccc565b87516309f56ab160e11b81526001600160a01b038d811660048301529485166024820152610bb86044820152911690921660648301528160848160008a5af180156102ab57610a0a91600091610bb6575b5060018060a01b03166001600160601b0360a01b60cb54161760cb55565b610a1261031a565b6001600160a01b0389168152956001600160a01b03831687890152610bb887860152620d89b31960608801526080998a880190610a51919060020b9052565b600060a0880181905260c088019190915260e0870181905261010080880191909152306101208089019190915291600019946101409486868b015287519a8d8c80634418b22b60e11b9d8e82526004820190610aac916114e4565b03818d5a90600091f19b8c156102ab578e9c610ad2918e600092610b96575b505060cc55565b610ada61031a565b6001600160a01b03909d168d526001600160a01b03909116908c0152610bb88b88015260020b60608b0152620d89b48a8a015260a08a0152600060c08a0181905260e08a0181905290890152309088015286015251808095819482526004820190610b44916114e4565b03915a90600091f19081156102ab5761001992600092610b66575b505060cd55565b610b859250803d10610b8f575b610b7d81836102f8565b8101906114b2565b5050503880610b5f565b503d610b73565b610bac9250803d10610b8f57610b7d81836102f8565b505050388e610acb565b610bd69150893d8b11610bdc575b610bce81836102f8565b8101906110cc565b386109ec565b503d610bc4565b9a61099b9190610976565b9187868b9a8995610bff87956113b4565b90610c09916113f9565b610c1290611d84565b61093761092d6109969b61093c93610927565b610c3c9150853d87116102a45761029381836102f8565b386108b0565b34610184576000806003193601126105c557610c5c610dc0565b610c6860d254156112dc565b60ce546040516370a0823160e01b8152306004820152906001600160a01b0316602082602481845afa9081156102ab57610cc5928492610cc8575b50610cb361023b6102348461135c565b6033546001600160a01b031690611c6f565b80f35b610ce191925060203d81116102a45761029381836102f8565b9038610ca3565b3461018457602036600319011261018457600435610d05816102b0565b610d0d610dc0565b6001600160a01b03811615610d255761001990610e18565b60405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608490fd5b3461018457600036600319011261018457602060cc54604051908152f35b346101845760003660031901126101845760cb546040516001600160a01b039091168152602090f35b6033546001600160a01b03163303610dd457565b606460405162461bcd60e51b815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b603380546001600160a01b039283166001600160a01b0319821681179092559091167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a3565b67ffffffffffffffff81116102f35760051b60200190565b90610e8382610e61565b610e9060405191826102f8565b8281528092610ea1601f1991610e61565b019060005b828110610eb257505050565b806060602080938501015201610ea6565b634e487b7160e01b600052601160045260246000fd5b6000198114610ee85760010190565b610ec3565b634e487b7160e01b600052603260045260246000fd5b9190811015610f455760051b81013590601e198136030182121561018457019081359167ffffffffffffffff8311610184576020018236038113610184579190565b610eed565b908092918237016000815290565b3d15610f83573d90610f698261033b565b91610f7760405193846102f8565b82523d6000602084013e565b606090565b6020818303126101845780519067ffffffffffffffff8211610184570181601f82011215610184578051610fbb8161033b565b92610fc960405194856102f8565b8184526020828401011161018457610fe7916020808501910161061a565b90565b906020610fe792818152019061063d565b8051821015610f455760209160051b010190565b1561101657565b60405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608490fd5b90816020910312610184575160ff811681036101845790565b6040513d6000823e3d90fd5b1561109e57565b60405162461bcd60e51b8152602060048201526006602482015265084a8889c62760d31b6044820152606490fd5b908160209103126101845751610fe7816102b0565b156110e857565b60405162461bcd60e51b81526020600482015260066024820152652826aba2272d60d11b6044820152606490fd5b9061111f61129d565b61112761128c565b60405163313ce56760e01b81526001600160a01b039260209182816004818789165afa80156102ab5760ff601291611169936000916111ff575b501614611097565b60405163c45a015560e01b81529180836004818589165afa9485156102ab576111e0956111c3946111a6936000926111e2575b50501615156110e1565b60018060a01b03166001600160601b0360a01b60ca54161760ca55565b60018060a01b03166001600160601b0360a01b60ce54161760ce55565b565b6111f89250803d10610bdc57610bce81836102f8565b388061119c565b61121f9150863d8811611225575b61121781836102f8565b810190611072565b38611161565b503d61120d565b1561123357565b60405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608490fd5b6111e060ff60005460081c1661122c565b6112b760ff60005460081c166112b28161122c565b61122c565b6112c033610e18565b6112d560ff60005460081c166112b28161122c565b6001606555565b156112e357565b606460405162461bcd60e51b81526020600482015260046024820152632321272d60e11b6044820152fd5b90816020910312610184575190565b1561132457565b60405162461bcd60e51b81526020600482015260036024820152622722a360e91b6044820152606490fd5b91908203918211610ee857565b90600582029180830460051490151715610ee857565b90605f820291808304605f1490151715610ee857565b90601482029180830460141490151715610ee857565b90600a820291808304600a1490151715610ee857565b90670de0b6b3a764000091828102928184041490151715610ee857565b634e487b7160e01b600052601260045260246000fd5b80156113f4576000190490565b6113d1565b81156113f4570490565b1561140a57565b606460405162461bcd60e51b8152602060048201526004602482015263232124ad60e11b6044820152fd5b1561143c57565b606460405162461bcd60e51b8152602060048201526004602482015263222a272d60e11b6044820152fd5b603c9060020b02908160020b918203610ee857565b60020b603c0190627fffff8213627fffff19831217610ee857565b60020b601e0190627fffff8213627fffff19831217610ee857565b91908260809103126101845781519160208101516001600160801b038116810361018457916060604083015192015190565b81516001600160a01b03168152610160810192916020818101516001600160a01b03169083015260408181015162ffffff169083015260608181015160020b9083015260808181015160020b9083015260a0818101519083015260c0808201519083015260e080820151908301526101008082015190830152610120808201516001600160a01b03169083015261014080910151910152565b60020b60008112156118e75780600003905b620d89e882116118d55760018216156118c3576001600160881b036ffffcb933bd6fad37aa2d162d1a5940015b1691600281166118a7575b6004811661188b575b6008811661186f575b60108116611853575b60208116611837575b6040811661181b575b608090818116611800575b61010081166117e5575b61020081166117ca575b61040081166117af575b6108008116611794575b6110008116611779575b612000811661175e575b6140008116611743575b6180008116611728575b62010000811661170d575b6202000081166116f3575b6204000081166116d9575b62080000166116be575b506000126116b0575b63ffffffff81166116a8576000905b60201c60ff91909116016001600160a01b031690565b600190611692565b6116b9906113e7565b611683565b6b048a170391f7dc42444e8fa26000929302901c919061167a565b6d2216e584f5fa1ea926041bedfe98909302811c92611670565b926e5d6af8dedb81196699c329225ee60402811c92611665565b926f09aa508b5b7a84e1c677de54f3e99bc902811c9261165a565b926f31be135f97d08fd981231505542fcfa602811c9261164f565b926f70d869a156d2a1b890bb3df62baf32f702811c92611645565b926fa9f746462d870fdf8a65dc1f90e061e502811c9261163b565b926fd097f3bdfd2022b8845ad8f792aa582502811c92611631565b926fe7159475a2c29b7443b29c7fa6e889d902811c92611627565b926ff3392b0822b70005940c7a398e4b70f302811c9261161d565b926ff987a7253ac413176f2b074cf7815e5402811c92611613565b926ffcbe86c7900a88aedcffc83b479aa3a402811c92611609565b926ffe5dee046a99a2a811c461f1969c305302811c926115ff565b916fff2ea16466c96a3843ec78b326b528610260801c916115f4565b916fff973b41fa98c081472e6896dfb254c00260801c916115eb565b916fffcb9843d60f6159c9db58835c9266440260801c916115e2565b916fffe5caca7e10e4e61c3624eaa0941cd00260801c916115d9565b916ffff2e50f5f656932ef12357cf3c7fdcc0260801c916115d0565b916ffff97272373d413259a46990580e213a0260801c916115c7565b6001600160881b03600160801b6115bc565b6040516315e4079d60e11b8152600490fd5b8061158f565b6001600160a01b038116906401000276a382101580611b84575b15611b7257640100000000600160c01b039060201b16806001600160801b03811160071b9181831c9267ffffffffffffffff841160061b93841c9363ffffffff851160051b94851c9461ffff861160041b95861c60ff9687821160031b91821c92600f841160021b93841c94600160038711811b96871c119617171717171717916080831015600014611b665750607e1982011c5b8002607f928392828493841c81841c1c800280851c81851c1c800280861c81861c1c800280871c81871c1c80029081881c82881c1c80029283891c84891c1c800294858a1c868a1c1c800296878b1c888b1c1c800298898c1c8a8c1c1c80029a8b8d1c8c821c1c8002809d1c8d821c1c8002809e81901c90821c1c80029e8f80911c911c1c800260cd1c6604000000000000169d60cc1c6608000000000000169c60cb1c6610000000000000169b60ca1c6620000000000000169a60c91c6640000000000000169960c81c6680000000000000169860c71c670100000000000000169760c61c670200000000000000169660c51c670400000000000000169560c41c670800000000000000169460c31c671000000000000000169360c21c672000000000000000169260c11c674000000000000000169160c01c6780000000000000001690607f190160401b1717171717171717171717171717693627a301d71055774c85026f028f6481ab7f045a5af012a19d003aa919810160801d60020b906fdb2df09e81959a81455e260799a0632f0160801d60020b91600090838314600014611b4a575050905090565b611b5661095c8561157d565b119050611b61575090565b905090565b905081607f031b61199c565b6040516324c070df60e11b8152600490fd5b5073fffd8963efd1fc6a506488495d951d5263988d268210611907565b90816020910312610184575180151581036101845790565b9091600080949381946040519160208301946323b872dd60e01b865260018060a01b038092166024850152166044830152606482015260648152611bfc816102d7565b51925af1611c08610f58565b81611c40575b5015611c1657565b60405162461bcd60e51b81526020600482015260026024820152612a2360f11b6044820152606490fd5b8051801592508215611c55575b505038611c0e565b611c689250602080918301019101611ba1565b3880611c4d565b60405163a9059cbb60e01b602082019081526001600160a01b03909316602482015260448082019490945292835260808301929167ffffffffffffffff8411838510176102f3576000809493819460405251925af1611c08610f58565b60405163095ea7b360e01b602082019081526001600160a01b0393909316602482015260001960448083019190915281526000928392918390611d106064826102f8565b51925af1611d1c610f58565b81611d55575b5015611d2a57565b60405162461bcd60e51b815260206004820152600360248201526229a0a360e91b6044820152606490fd5b8051801592508215611d6a575b505038611d22565b611d7d9250602080918301019101611ba1565b3880611d62565b8060601b600160601b91808204831490151715610ee857670de0b6b3a764000090048060601b918183041490151715610ee857610fe7908015611ef55780611e8e611e87611e7d611e73611e69611e5f611e55611e4b6001610fe79a6000908b60801c80611ee9575b508060401c80611edc575b508060201c80611ecf575b508060101c80611ec2575b508060081c80611eb5575b508060041c80611ea8575b508060021c80611e9b575b50821c611e94575b811c1b611e44818b6113f9565b0160011c90565b611e44818a6113f9565b611e4481896113f9565b611e4481886113f9565b611e4481876113f9565b611e4481866113f9565b611e4481856113f9565b80926113f9565b90611efb565b8101611e37565b6002915091019038611e2f565b6004915091019038611e24565b6008915091019038611e19565b6010915091019038611e0e565b6020915091019038611e03565b6040915091019038611df8565b91505060809038611ded565b50600090565b9080821015611b6157509056fea2646970667358221220de63ca869342821fc861475a0468185dc7f55ed1f76a8fee61f7171cb8b642df64736f6c63430008130033", } // DAOTreasuryABI is the input ABI used to generate the binding from. // Deprecated: Use DAOTreasuryMetaData.ABI instead. var DAOTreasuryABI = DAOTreasuryMetaData.ABI // DAOTreasuryBin is the compiled bytecode used for deploying new contracts. // Deprecated: Use DAOTreasuryMetaData.Bin instead. var DAOTreasuryBin = DAOTreasuryMetaData.Bin // DeployDAOTreasury deploys a new Ethereum contract, binding an instance of DAOTreasury to it. func DeployDAOTreasury(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *DAOTreasury, error) { parsed, err := DAOTreasuryMetaData.GetAbi() if err != nil { return common.Address{}, nil, nil, err } if parsed == nil { return common.Address{}, nil, nil, errors.New("GetABI returned nil") } address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(DAOTreasuryBin), backend) if err != nil { return common.Address{}, nil, nil, err } return address, tx, &DAOTreasury{DAOTreasuryCaller: DAOTreasuryCaller{contract: contract}, DAOTreasuryTransactor: DAOTreasuryTransactor{contract: contract}, DAOTreasuryFilterer: DAOTreasuryFilterer{contract: contract}}, nil } // DAOTreasury is an auto generated Go binding around an Ethereum contract. type DAOTreasury struct { DAOTreasuryCaller // Read-only binding to the contract DAOTreasuryTransactor // Write-only binding to the contract DAOTreasuryFilterer // Log filterer for contract events } // DAOTreasuryCaller is an auto generated read-only Go binding around an Ethereum contract. type DAOTreasuryCaller struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // DAOTreasuryTransactor is an auto generated write-only Go binding around an Ethereum contract. type DAOTreasuryTransactor struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // DAOTreasuryFilterer is an auto generated log filtering Go binding around an Ethereum contract events. type DAOTreasuryFilterer struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // DAOTreasurySession is an auto generated Go binding around an Ethereum contract, // with pre-set call and transact options. type DAOTreasurySession struct { Contract *DAOTreasury // Generic contract binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // DAOTreasuryCallerSession is an auto generated read-only Go binding around an Ethereum contract, // with pre-set call options. type DAOTreasuryCallerSession struct { Contract *DAOTreasuryCaller // Generic contract caller binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session } // DAOTreasuryTransactorSession is an auto generated write-only Go binding around an Ethereum contract, // with pre-set transact options. type DAOTreasuryTransactorSession struct { Contract *DAOTreasuryTransactor // Generic contract transactor binding to set the session for TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // DAOTreasuryRaw is an auto generated low-level Go binding around an Ethereum contract. type DAOTreasuryRaw struct { Contract *DAOTreasury // Generic contract binding to access the raw methods on } // DAOTreasuryCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. type DAOTreasuryCallerRaw struct { Contract *DAOTreasuryCaller // Generic read-only contract binding to access the raw methods on } // DAOTreasuryTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. type DAOTreasuryTransactorRaw struct { Contract *DAOTreasuryTransactor // Generic write-only contract binding to access the raw methods on } // NewDAOTreasury creates a new instance of DAOTreasury, bound to a specific deployed contract. func NewDAOTreasury(address common.Address, backend bind.ContractBackend) (*DAOTreasury, error) { contract, err := bindDAOTreasury(address, backend, backend, backend) if err != nil { return nil, err } return &DAOTreasury{DAOTreasuryCaller: DAOTreasuryCaller{contract: contract}, DAOTreasuryTransactor: DAOTreasuryTransactor{contract: contract}, DAOTreasuryFilterer: DAOTreasuryFilterer{contract: contract}}, nil } // NewDAOTreasuryCaller creates a new read-only instance of DAOTreasury, bound to a specific deployed contract. func NewDAOTreasuryCaller(address common.Address, caller bind.ContractCaller) (*DAOTreasuryCaller, error) { contract, err := bindDAOTreasury(address, caller, nil, nil) if err != nil { return nil, err } return &DAOTreasuryCaller{contract: contract}, nil } // NewDAOTreasuryTransactor creates a new write-only instance of DAOTreasury, bound to a specific deployed contract. func NewDAOTreasuryTransactor(address common.Address, transactor bind.ContractTransactor) (*DAOTreasuryTransactor, error) { contract, err := bindDAOTreasury(address, nil, transactor, nil) if err != nil { return nil, err } return &DAOTreasuryTransactor{contract: contract}, nil } // NewDAOTreasuryFilterer creates a new log filterer instance of DAOTreasury, bound to a specific deployed contract. func NewDAOTreasuryFilterer(address common.Address, filterer bind.ContractFilterer) (*DAOTreasuryFilterer, error) { contract, err := bindDAOTreasury(address, nil, nil, filterer) if err != nil { return nil, err } return &DAOTreasuryFilterer{contract: contract}, nil } // bindDAOTreasury binds a generic wrapper to an already deployed contract. func bindDAOTreasury(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { parsed, err := DAOTreasuryMetaData.GetAbi() if err != nil { return nil, err } return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_DAOTreasury *DAOTreasuryRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _DAOTreasury.Contract.DAOTreasuryCaller.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_DAOTreasury *DAOTreasuryRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _DAOTreasury.Contract.DAOTreasuryTransactor.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_DAOTreasury *DAOTreasuryRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _DAOTreasury.Contract.DAOTreasuryTransactor.contract.Transact(opts, method, params...) } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_DAOTreasury *DAOTreasuryCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _DAOTreasury.Contract.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_DAOTreasury *DAOTreasuryTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _DAOTreasury.Contract.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_DAOTreasury *DAOTreasuryTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _DAOTreasury.Contract.contract.Transact(opts, method, params...) } // BaseFundBalance is a free data retrieval call binding the contract method 0x48ea59a8. // // Solidity: function baseFundBalance() view returns(uint256) func (_DAOTreasury *DAOTreasuryCaller) BaseFundBalance(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} err := _DAOTreasury.contract.Call(opts, &out, "baseFundBalance") if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // BaseFundBalance is a free data retrieval call binding the contract method 0x48ea59a8. // // Solidity: function baseFundBalance() view returns(uint256) func (_DAOTreasury *DAOTreasurySession) BaseFundBalance() (*big.Int, error) { return _DAOTreasury.Contract.BaseFundBalance(&_DAOTreasury.CallOpts) } // BaseFundBalance is a free data retrieval call binding the contract method 0x48ea59a8. // // Solidity: function baseFundBalance() view returns(uint256) func (_DAOTreasury *DAOTreasuryCallerSession) BaseFundBalance() (*big.Int, error) { return _DAOTreasury.Contract.BaseFundBalance(&_DAOTreasury.CallOpts) } // BaseToken is a free data retrieval call binding the contract method 0xc55dae63. // // Solidity: function baseToken() view returns(address) func (_DAOTreasury *DAOTreasuryCaller) BaseToken(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _DAOTreasury.contract.Call(opts, &out, "baseToken") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // BaseToken is a free data retrieval call binding the contract method 0xc55dae63. // // Solidity: function baseToken() view returns(address) func (_DAOTreasury *DAOTreasurySession) BaseToken() (common.Address, error) { return _DAOTreasury.Contract.BaseToken(&_DAOTreasury.CallOpts) } // BaseToken is a free data retrieval call binding the contract method 0xc55dae63. // // Solidity: function baseToken() view returns(address) func (_DAOTreasury *DAOTreasuryCallerSession) BaseToken() (common.Address, error) { return _DAOTreasury.Contract.BaseToken(&_DAOTreasury.CallOpts) } // DaoToken is a free data retrieval call binding the contract method 0x4914b030. // // Solidity: function daoToken() view returns(address) func (_DAOTreasury *DAOTreasuryCaller) DaoToken(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _DAOTreasury.contract.Call(opts, &out, "daoToken") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // DaoToken is a free data retrieval call binding the contract method 0x4914b030. // // Solidity: function daoToken() view returns(address) func (_DAOTreasury *DAOTreasurySession) DaoToken() (common.Address, error) { return _DAOTreasury.Contract.DaoToken(&_DAOTreasury.CallOpts) } // DaoToken is a free data retrieval call binding the contract method 0x4914b030. // // Solidity: function daoToken() view returns(address) func (_DAOTreasury *DAOTreasuryCallerSession) DaoToken() (common.Address, error) { return _DAOTreasury.Contract.DaoToken(&_DAOTreasury.CallOpts) } // FeeBalance is a free data retrieval call binding the contract method 0x60b71d4e. // // Solidity: function feeBalance() view returns(uint256) func (_DAOTreasury *DAOTreasuryCaller) FeeBalance(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} err := _DAOTreasury.contract.Call(opts, &out, "feeBalance") if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // FeeBalance is a free data retrieval call binding the contract method 0x60b71d4e. // // Solidity: function feeBalance() view returns(uint256) func (_DAOTreasury *DAOTreasurySession) FeeBalance() (*big.Int, error) { return _DAOTreasury.Contract.FeeBalance(&_DAOTreasury.CallOpts) } // FeeBalance is a free data retrieval call binding the contract method 0x60b71d4e. // // Solidity: function feeBalance() view returns(uint256) func (_DAOTreasury *DAOTreasuryCallerSession) FeeBalance() (*big.Int, error) { return _DAOTreasury.Contract.FeeBalance(&_DAOTreasury.CallOpts) } // GetChainId is a free data retrieval call binding the contract method 0x3408e470. // // Solidity: function getChainId() view returns(uint256 chainId) func (_DAOTreasury *DAOTreasuryCaller) GetChainId(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} err := _DAOTreasury.contract.Call(opts, &out, "getChainId") if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // GetChainId is a free data retrieval call binding the contract method 0x3408e470. // // Solidity: function getChainId() view returns(uint256 chainId) func (_DAOTreasury *DAOTreasurySession) GetChainId() (*big.Int, error) { return _DAOTreasury.Contract.GetChainId(&_DAOTreasury.CallOpts) } // GetChainId is a free data retrieval call binding the contract method 0x3408e470. // // Solidity: function getChainId() view returns(uint256 chainId) func (_DAOTreasury *DAOTreasuryCallerSession) GetChainId() (*big.Int, error) { return _DAOTreasury.Contract.GetChainId(&_DAOTreasury.CallOpts) } // Governor is a free data retrieval call binding the contract method 0x0c340a24. // // Solidity: function governor() view returns(address) func (_DAOTreasury *DAOTreasuryCaller) Governor(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _DAOTreasury.contract.Call(opts, &out, "governor") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // Governor is a free data retrieval call binding the contract method 0x0c340a24. // // Solidity: function governor() view returns(address) func (_DAOTreasury *DAOTreasurySession) Governor() (common.Address, error) { return _DAOTreasury.Contract.Governor(&_DAOTreasury.CallOpts) } // Governor is a free data retrieval call binding the contract method 0x0c340a24. // // Solidity: function governor() view returns(address) func (_DAOTreasury *DAOTreasuryCallerSession) Governor() (common.Address, error) { return _DAOTreasury.Contract.Governor(&_DAOTreasury.CallOpts) } // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. // // Solidity: function owner() view returns(address) func (_DAOTreasury *DAOTreasuryCaller) Owner(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _DAOTreasury.contract.Call(opts, &out, "owner") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. // // Solidity: function owner() view returns(address) func (_DAOTreasury *DAOTreasurySession) Owner() (common.Address, error) { return _DAOTreasury.Contract.Owner(&_DAOTreasury.CallOpts) } // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. // // Solidity: function owner() view returns(address) func (_DAOTreasury *DAOTreasuryCallerSession) Owner() (common.Address, error) { return _DAOTreasury.Contract.Owner(&_DAOTreasury.CallOpts) } // PoolV3 is a free data retrieval call binding the contract method 0xfd90f6d4. // // Solidity: function poolV3() view returns(address) func (_DAOTreasury *DAOTreasuryCaller) PoolV3(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _DAOTreasury.contract.Call(opts, &out, "poolV3") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // PoolV3 is a free data retrieval call binding the contract method 0xfd90f6d4. // // Solidity: function poolV3() view returns(address) func (_DAOTreasury *DAOTreasurySession) PoolV3() (common.Address, error) { return _DAOTreasury.Contract.PoolV3(&_DAOTreasury.CallOpts) } // PoolV3 is a free data retrieval call binding the contract method 0xfd90f6d4. // // Solidity: function poolV3() view returns(address) func (_DAOTreasury *DAOTreasuryCallerSession) PoolV3() (common.Address, error) { return _DAOTreasury.Contract.PoolV3(&_DAOTreasury.CallOpts) } // Position0TokenId is a free data retrieval call binding the contract method 0xf68391d6. // // Solidity: function position0TokenId() view returns(uint256) func (_DAOTreasury *DAOTreasuryCaller) Position0TokenId(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} err := _DAOTreasury.contract.Call(opts, &out, "position0TokenId") if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // Position0TokenId is a free data retrieval call binding the contract method 0xf68391d6. // // Solidity: function position0TokenId() view returns(uint256) func (_DAOTreasury *DAOTreasurySession) Position0TokenId() (*big.Int, error) { return _DAOTreasury.Contract.Position0TokenId(&_DAOTreasury.CallOpts) } // Position0TokenId is a free data retrieval call binding the contract method 0xf68391d6. // // Solidity: function position0TokenId() view returns(uint256) func (_DAOTreasury *DAOTreasuryCallerSession) Position0TokenId() (*big.Int, error) { return _DAOTreasury.Contract.Position0TokenId(&_DAOTreasury.CallOpts) } // Position1TokenId is a free data retrieval call binding the contract method 0x0c9827df. // // Solidity: function position1TokenId() view returns(uint256) func (_DAOTreasury *DAOTreasuryCaller) Position1TokenId(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} err := _DAOTreasury.contract.Call(opts, &out, "position1TokenId") if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // Position1TokenId is a free data retrieval call binding the contract method 0x0c9827df. // // Solidity: function position1TokenId() view returns(uint256) func (_DAOTreasury *DAOTreasurySession) Position1TokenId() (*big.Int, error) { return _DAOTreasury.Contract.Position1TokenId(&_DAOTreasury.CallOpts) } // Position1TokenId is a free data retrieval call binding the contract method 0x0c9827df. // // Solidity: function position1TokenId() view returns(uint256) func (_DAOTreasury *DAOTreasuryCallerSession) Position1TokenId() (*big.Int, error) { return _DAOTreasury.Contract.Position1TokenId(&_DAOTreasury.CallOpts) } // PositionManager is a free data retrieval call binding the contract method 0x791b98bc. // // Solidity: function positionManager() view returns(address) func (_DAOTreasury *DAOTreasuryCaller) PositionManager(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _DAOTreasury.contract.Call(opts, &out, "positionManager") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // PositionManager is a free data retrieval call binding the contract method 0x791b98bc. // // Solidity: function positionManager() view returns(address) func (_DAOTreasury *DAOTreasurySession) PositionManager() (common.Address, error) { return _DAOTreasury.Contract.PositionManager(&_DAOTreasury.CallOpts) } // PositionManager is a free data retrieval call binding the contract method 0x791b98bc. // // Solidity: function positionManager() view returns(address) func (_DAOTreasury *DAOTreasuryCallerSession) PositionManager() (common.Address, error) { return _DAOTreasury.Contract.PositionManager(&_DAOTreasury.CallOpts) } // SettledFundBalance is a free data retrieval call binding the contract method 0xbb5df554. // // Solidity: function settledFundBalance() view returns(uint256) func (_DAOTreasury *DAOTreasuryCaller) SettledFundBalance(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} err := _DAOTreasury.contract.Call(opts, &out, "settledFundBalance") if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // SettledFundBalance is a free data retrieval call binding the contract method 0xbb5df554. // // Solidity: function settledFundBalance() view returns(uint256) func (_DAOTreasury *DAOTreasurySession) SettledFundBalance() (*big.Int, error) { return _DAOTreasury.Contract.SettledFundBalance(&_DAOTreasury.CallOpts) } // SettledFundBalance is a free data retrieval call binding the contract method 0xbb5df554. // // Solidity: function settledFundBalance() view returns(uint256) func (_DAOTreasury *DAOTreasuryCallerSession) SettledFundBalance() (*big.Int, error) { return _DAOTreasury.Contract.SettledFundBalance(&_DAOTreasury.CallOpts) } // AddLiqidity is a paid mutator transaction binding the contract method 0xc7d51202. // // Solidity: function addLiqidity(address _daoToken) returns() func (_DAOTreasury *DAOTreasuryTransactor) AddLiqidity(opts *bind.TransactOpts, _daoToken common.Address) (*types.Transaction, error) { return _DAOTreasury.contract.Transact(opts, "addLiqidity", _daoToken) } // AddLiqidity is a paid mutator transaction binding the contract method 0xc7d51202. // // Solidity: function addLiqidity(address _daoToken) returns() func (_DAOTreasury *DAOTreasurySession) AddLiqidity(_daoToken common.Address) (*types.Transaction, error) { return _DAOTreasury.Contract.AddLiqidity(&_DAOTreasury.TransactOpts, _daoToken) } // AddLiqidity is a paid mutator transaction binding the contract method 0xc7d51202. // // Solidity: function addLiqidity(address _daoToken) returns() func (_DAOTreasury *DAOTreasuryTransactorSession) AddLiqidity(_daoToken common.Address) (*types.Transaction, error) { return _DAOTreasury.Contract.AddLiqidity(&_DAOTreasury.TransactOpts, _daoToken) } // CancelFund is a paid mutator transaction binding the contract method 0xe914fa12. // // Solidity: function cancelFund() returns() func (_DAOTreasury *DAOTreasuryTransactor) CancelFund(opts *bind.TransactOpts) (*types.Transaction, error) { return _DAOTreasury.contract.Transact(opts, "cancelFund") } // CancelFund is a paid mutator transaction binding the contract method 0xe914fa12. // // Solidity: function cancelFund() returns() func (_DAOTreasury *DAOTreasurySession) CancelFund() (*types.Transaction, error) { return _DAOTreasury.Contract.CancelFund(&_DAOTreasury.TransactOpts) } // CancelFund is a paid mutator transaction binding the contract method 0xe914fa12. // // Solidity: function cancelFund() returns() func (_DAOTreasury *DAOTreasuryTransactorSession) CancelFund() (*types.Transaction, error) { return _DAOTreasury.Contract.CancelFund(&_DAOTreasury.TransactOpts) } // Initialize is a paid mutator transaction binding the contract method 0x485cc955. // // Solidity: function initialize(address _positionManager, address _baseToken) returns() func (_DAOTreasury *DAOTreasuryTransactor) Initialize(opts *bind.TransactOpts, _positionManager common.Address, _baseToken common.Address) (*types.Transaction, error) { return _DAOTreasury.contract.Transact(opts, "initialize", _positionManager, _baseToken) } // Initialize is a paid mutator transaction binding the contract method 0x485cc955. // // Solidity: function initialize(address _positionManager, address _baseToken) returns() func (_DAOTreasury *DAOTreasurySession) Initialize(_positionManager common.Address, _baseToken common.Address) (*types.Transaction, error) { return _DAOTreasury.Contract.Initialize(&_DAOTreasury.TransactOpts, _positionManager, _baseToken) } // Initialize is a paid mutator transaction binding the contract method 0x485cc955. // // Solidity: function initialize(address _positionManager, address _baseToken) returns() func (_DAOTreasury *DAOTreasuryTransactorSession) Initialize(_positionManager common.Address, _baseToken common.Address) (*types.Transaction, error) { return _DAOTreasury.Contract.Initialize(&_DAOTreasury.TransactOpts, _positionManager, _baseToken) } // Multicall is a paid mutator transaction binding the contract method 0xac9650d8. // // Solidity: function multicall(bytes[] data) payable returns(bytes[] results) func (_DAOTreasury *DAOTreasuryTransactor) Multicall(opts *bind.TransactOpts, data [][]byte) (*types.Transaction, error) { return _DAOTreasury.contract.Transact(opts, "multicall", data) } // Multicall is a paid mutator transaction binding the contract method 0xac9650d8. // // Solidity: function multicall(bytes[] data) payable returns(bytes[] results) func (_DAOTreasury *DAOTreasurySession) Multicall(data [][]byte) (*types.Transaction, error) { return _DAOTreasury.Contract.Multicall(&_DAOTreasury.TransactOpts, data) } // Multicall is a paid mutator transaction binding the contract method 0xac9650d8. // // Solidity: function multicall(bytes[] data) payable returns(bytes[] results) func (_DAOTreasury *DAOTreasuryTransactorSession) Multicall(data [][]byte) (*types.Transaction, error) { return _DAOTreasury.Contract.Multicall(&_DAOTreasury.TransactOpts, data) } // OnERC721Received is a paid mutator transaction binding the contract method 0x150b7a02. // // Solidity: function onERC721Received(address , address , uint256 , bytes ) returns(bytes4) func (_DAOTreasury *DAOTreasuryTransactor) OnERC721Received(opts *bind.TransactOpts, arg0 common.Address, arg1 common.Address, arg2 *big.Int, arg3 []byte) (*types.Transaction, error) { return _DAOTreasury.contract.Transact(opts, "onERC721Received", arg0, arg1, arg2, arg3) } // OnERC721Received is a paid mutator transaction binding the contract method 0x150b7a02. // // Solidity: function onERC721Received(address , address , uint256 , bytes ) returns(bytes4) func (_DAOTreasury *DAOTreasurySession) OnERC721Received(arg0 common.Address, arg1 common.Address, arg2 *big.Int, arg3 []byte) (*types.Transaction, error) { return _DAOTreasury.Contract.OnERC721Received(&_DAOTreasury.TransactOpts, arg0, arg1, arg2, arg3) } // OnERC721Received is a paid mutator transaction binding the contract method 0x150b7a02. // // Solidity: function onERC721Received(address , address , uint256 , bytes ) returns(bytes4) func (_DAOTreasury *DAOTreasuryTransactorSession) OnERC721Received(arg0 common.Address, arg1 common.Address, arg2 *big.Int, arg3 []byte) (*types.Transaction, error) { return _DAOTreasury.Contract.OnERC721Received(&_DAOTreasury.TransactOpts, arg0, arg1, arg2, arg3) } // RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. // // Solidity: function renounceOwnership() returns() func (_DAOTreasury *DAOTreasuryTransactor) RenounceOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { return _DAOTreasury.contract.Transact(opts, "renounceOwnership") } // RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. // // Solidity: function renounceOwnership() returns() func (_DAOTreasury *DAOTreasurySession) RenounceOwnership() (*types.Transaction, error) { return _DAOTreasury.Contract.RenounceOwnership(&_DAOTreasury.TransactOpts) } // RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. // // Solidity: function renounceOwnership() returns() func (_DAOTreasury *DAOTreasuryTransactorSession) RenounceOwnership() (*types.Transaction, error) { return _DAOTreasury.Contract.RenounceOwnership(&_DAOTreasury.TransactOpts) } // SettleFund is a paid mutator transaction binding the contract method 0x14a8fc97. // // Solidity: function settleFund(uint256 _settledFundBalance) returns() func (_DAOTreasury *DAOTreasuryTransactor) SettleFund(opts *bind.TransactOpts, _settledFundBalance *big.Int) (*types.Transaction, error) { return _DAOTreasury.contract.Transact(opts, "settleFund", _settledFundBalance) } // SettleFund is a paid mutator transaction binding the contract method 0x14a8fc97. // // Solidity: function settleFund(uint256 _settledFundBalance) returns() func (_DAOTreasury *DAOTreasurySession) SettleFund(_settledFundBalance *big.Int) (*types.Transaction, error) { return _DAOTreasury.Contract.SettleFund(&_DAOTreasury.TransactOpts, _settledFundBalance) } // SettleFund is a paid mutator transaction binding the contract method 0x14a8fc97. // // Solidity: function settleFund(uint256 _settledFundBalance) returns() func (_DAOTreasury *DAOTreasuryTransactorSession) SettleFund(_settledFundBalance *big.Int) (*types.Transaction, error) { return _DAOTreasury.Contract.SettleFund(&_DAOTreasury.TransactOpts, _settledFundBalance) } // TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. // // Solidity: function transferOwnership(address newOwner) returns() func (_DAOTreasury *DAOTreasuryTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) { return _DAOTreasury.contract.Transact(opts, "transferOwnership", newOwner) } // TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. // // Solidity: function transferOwnership(address newOwner) returns() func (_DAOTreasury *DAOTreasurySession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { return _DAOTreasury.Contract.TransferOwnership(&_DAOTreasury.TransactOpts, newOwner) } // TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. // // Solidity: function transferOwnership(address newOwner) returns() func (_DAOTreasury *DAOTreasuryTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { return _DAOTreasury.Contract.TransferOwnership(&_DAOTreasury.TransactOpts, newOwner) } // Receive is a paid mutator transaction binding the contract receive function. // // Solidity: receive() payable returns() func (_DAOTreasury *DAOTreasuryTransactor) Receive(opts *bind.TransactOpts) (*types.Transaction, error) { return _DAOTreasury.contract.RawTransact(opts, nil) // calldata is disallowed for receive function } // Receive is a paid mutator transaction binding the contract receive function. // // Solidity: receive() payable returns() func (_DAOTreasury *DAOTreasurySession) Receive() (*types.Transaction, error) { return _DAOTreasury.Contract.Receive(&_DAOTreasury.TransactOpts) } // Receive is a paid mutator transaction binding the contract receive function. // // Solidity: receive() payable returns() func (_DAOTreasury *DAOTreasuryTransactorSession) Receive() (*types.Transaction, error) { return _DAOTreasury.Contract.Receive(&_DAOTreasury.TransactOpts) } // DAOTreasuryInitializedIterator is returned from FilterInitialized and is used to iterate over the raw logs and unpacked data for Initialized events raised by the DAOTreasury contract. type DAOTreasuryInitializedIterator struct { Event *DAOTreasuryInitialized // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *DAOTreasuryInitializedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(DAOTreasuryInitialized) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(DAOTreasuryInitialized) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *DAOTreasuryInitializedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *DAOTreasuryInitializedIterator) Close() error { it.sub.Unsubscribe() return nil } // DAOTreasuryInitialized represents a Initialized event raised by the DAOTreasury contract. type DAOTreasuryInitialized struct { Version uint8 Raw types.Log // Blockchain specific contextual infos } // FilterInitialized is a free log retrieval operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. // // Solidity: event Initialized(uint8 version) func (_DAOTreasury *DAOTreasuryFilterer) FilterInitialized(opts *bind.FilterOpts) (*DAOTreasuryInitializedIterator, error) { logs, sub, err := _DAOTreasury.contract.FilterLogs(opts, "Initialized") if err != nil { return nil, err } return &DAOTreasuryInitializedIterator{contract: _DAOTreasury.contract, event: "Initialized", logs: logs, sub: sub}, nil } // WatchInitialized is a free log subscription operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. // // Solidity: event Initialized(uint8 version) func (_DAOTreasury *DAOTreasuryFilterer) WatchInitialized(opts *bind.WatchOpts, sink chan<- *DAOTreasuryInitialized) (event.Subscription, error) { logs, sub, err := _DAOTreasury.contract.WatchLogs(opts, "Initialized") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(DAOTreasuryInitialized) if err := _DAOTreasury.contract.UnpackLog(event, "Initialized", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseInitialized is a log parse operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. // // Solidity: event Initialized(uint8 version) func (_DAOTreasury *DAOTreasuryFilterer) ParseInitialized(log types.Log) (*DAOTreasuryInitialized, error) { event := new(DAOTreasuryInitialized) if err := _DAOTreasury.contract.UnpackLog(event, "Initialized", log); err != nil { return nil, err } event.Raw = log return event, nil } // DAOTreasuryOwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the DAOTreasury contract. type DAOTreasuryOwnershipTransferredIterator struct { Event *DAOTreasuryOwnershipTransferred // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *DAOTreasuryOwnershipTransferredIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(DAOTreasuryOwnershipTransferred) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(DAOTreasuryOwnershipTransferred) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *DAOTreasuryOwnershipTransferredIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *DAOTreasuryOwnershipTransferredIterator) Close() error { it.sub.Unsubscribe() return nil } // DAOTreasuryOwnershipTransferred represents a OwnershipTransferred event raised by the DAOTreasury contract. type DAOTreasuryOwnershipTransferred struct { PreviousOwner common.Address NewOwner common.Address Raw types.Log // Blockchain specific contextual infos } // FilterOwnershipTransferred is a free log retrieval operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. // // Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) func (_DAOTreasury *DAOTreasuryFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*DAOTreasuryOwnershipTransferredIterator, error) { var previousOwnerRule []interface{} for _, previousOwnerItem := range previousOwner { previousOwnerRule = append(previousOwnerRule, previousOwnerItem) } var newOwnerRule []interface{} for _, newOwnerItem := range newOwner { newOwnerRule = append(newOwnerRule, newOwnerItem) } logs, sub, err := _DAOTreasury.contract.FilterLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) if err != nil { return nil, err } return &DAOTreasuryOwnershipTransferredIterator{contract: _DAOTreasury.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil } // WatchOwnershipTransferred is a free log subscription operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. // // Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) func (_DAOTreasury *DAOTreasuryFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *DAOTreasuryOwnershipTransferred, previousOwner []common.Address, newOwner []common.Address) (event.Subscription, error) { var previousOwnerRule []interface{} for _, previousOwnerItem := range previousOwner { previousOwnerRule = append(previousOwnerRule, previousOwnerItem) } var newOwnerRule []interface{} for _, newOwnerItem := range newOwner { newOwnerRule = append(newOwnerRule, newOwnerItem) } logs, sub, err := _DAOTreasury.contract.WatchLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(DAOTreasuryOwnershipTransferred) if err := _DAOTreasury.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseOwnershipTransferred is a log parse operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. // // Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) func (_DAOTreasury *DAOTreasuryFilterer) ParseOwnershipTransferred(log types.Log) (*DAOTreasuryOwnershipTransferred, error) { event := new(DAOTreasuryOwnershipTransferred) if err := _DAOTreasury.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { return nil, err } event.Raw = log return event, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/binds/erc1155/ERC1155.go ================================================ // Code generated - DO NOT EDIT. // This file is a generated binding and any manual changes will be lost. package erc1155 import ( "errors" "math/big" "strings" ethereum "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/event" ) // Reference imports to suppress errors if they are not otherwise used. var ( _ = errors.New _ = big.NewInt _ = strings.NewReader _ = ethereum.NotFound _ = bind.Bind _ = common.Big1 _ = types.BloomLookup _ = event.NewSubscription _ = abi.ConvertType ) // ERC1155MetaData contains all meta data concerning the ERC1155 contract. var ERC1155MetaData = &bind.MetaData{ ABI: "[{\"inputs\":[{\"internalType\":\"string\",\"name\":\"uri_\",\"type\":\"string\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"ApprovalForAll\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"ids\",\"type\":\"uint256[]\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\"}],\"name\":\"TransferBatch\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"TransferSingle\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"string\",\"name\":\"value\",\"type\":\"string\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"URI\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"accounts\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"ids\",\"type\":\"uint256[]\"}],\"name\":\"balanceOfBatch\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"name\":\"isApprovedForAll\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256[]\",\"name\":\"ids\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256[]\",\"name\":\"amounts\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"safeBatchTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"safeTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"setApprovalForAll\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"uri\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", Bin: "0x0001000000000002000f0000000000020000008004000039000000400040043f00000000030100190000006003300270000001ed033001970000000100200190000000280000c13d000000040030008c000000470000413d000000000201043b000000e002200270000001f40020009c000000490000213d000001fa0020009c000000890000213d000001fd0020009c0000029f0000613d000001fe0020009c000000470000c13d000000240030008c000000470000413d0000000002000416000000000002004b000000470000c13d0000000401100370000000000201043b0000020700200198000000470000c13d0000000101000039000002240020009c000003410000613d000002250020009c000003410000613d000002260020009c000000000100c019000000800010043f0000020a01000041000007af0001042e0000000002000416000000000002004b000000470000c13d0000001f02300039000001ee022001970000008002200039000000400020043f0000001f0530018f000001ef063001980000008002600039000000380000613d000000000701034f000000007807043c0000000004840436000000000024004b000000340000c13d000000000005004b000000450000613d000000000161034f0000000304500210000000000502043300000000054501cf000000000545022f000000000101043b0000010004400089000000000141022f00000000014101cf000000000151019f0000000000120435000000200030008c000000700000813d0000000001000019000007b000010430000001f50020009c000001db0000213d000001f80020009c000002b30000613d000001f90020009c000000470000c13d000000440030008c000000470000413d0000000002000416000000000002004b000000470000c13d0000000402100370000000000202043b000b00000002001d000001ff0020009c000000470000213d0000002401100370000000000201043b000000000002004b0000000001000039000000010100c039000a00000002001d000000000012004b000000470000c13d00000000020004110000000b0020006c000003700000c13d0000020901000041000000800010043f0000002001000039000000840010043f0000002901000039000000a40010043f0000020c01000041000000c40010043f0000020d01000041000000e40010043f0000020e01000041000007b000010430000000800200043d000001f00020009c000000470000213d0000001f01200039000000000031004b0000000004000019000001f104008041000001f101100197000000000001004b0000000005000019000001f105004041000001f10010009c000000000504c019000000000005004b000000470000c13d00000080012000390000000001010433000001f00010009c000002370000a13d0000021a01000041000000000010043f0000004101000039000000040010043f0000021b01000041000007b000010430000001fb0020009c0000030c0000613d000001fc0020009c000000470000c13d000000a40030008c000000470000413d0000000002000416000000000002004b000000470000c13d0000000402100370000000000202043b000001ff0020009c000000470000213d0000002404100370000000000404043b000400000004001d000001ff0040009c000000470000213d0000004404100370000000000404043b000001f00040009c000000470000213d0000002305400039000000000035004b000000470000813d0000000405400039000000000551034f000000000605043b000001f00060009c000000830000213d00000005056002100000003f075000390000020f07700197000002000070009c000000830000213d0000008007700039000000400070043f000000800060043f00000024044000390000000005450019000000000035004b000000470000213d000000000006004b000000bd0000613d0000008006000039000000000741034f000000000707043b000000200660003900000000007604350000002004400039000000000054004b000000b60000413d0000006404100370000000000404043b000001f00040009c000000470000213d0000002305400039000000000035004b0000000006000019000001f106008041000001f105500197000000000005004b0000000007000019000001f107004041000001f10050009c000000000706c019000000000007004b000000470000c13d0000000405400039000000000551034f000000000505043b000001f00050009c000000830000213d00000005065002100000003f076000390000020f07700197000000400800043d0000000007780019000600000008001d000000000087004b00000000080000390000000108004039000001f00070009c000000830000213d0000000100800190000000830000c13d000000400070043f00000006070000290000000007570436000500000007001d00000024044000390000000006460019000000000036004b000000470000213d000000000005004b000000f10000613d0000000605000029000000000741034f000000000707043b000000200550003900000000007504350000002004400039000000000064004b000000ea0000413d0000008404100370000000000504043b000001f00050009c000000470000213d0000002304500039000000000034004b0000000006000019000001f106008041000001f104400197000000000004004b0000000007000019000001f107004041000001f10040009c000000000706c019000000000007004b000000470000c13d0000000406500039000000000461034f000000000404043b000001f00040009c000000830000213d0000001f0740003900000228077001970000003f077000390000022807700197000000400800043d0000000007780019000200000008001d000000000087004b00000000080000390000000108004039000001f00070009c000000830000213d0000000100800190000000830000c13d000000400070043f00000002070000290000000007470436000100000007001d00000000054500190000002405500039000000000035004b000000470000213d0000002003600039000000000331034f00000228054001980000001f0640018f0000000101500029000001280000613d000000000703034f0000000108000029000000007907043c0000000008980436000000000018004b000001240000c13d000000000006004b000001350000613d000000000353034f0000000305600210000000000601043300000000065601cf000000000656022f000000000303043b0000010005500089000000000353022f00000000035301cf000000000363019f000000000031043500000001014000290000000000010435000901ff0020019b0000000001000411000000090010006b000005480000c13d00000006010000290000000002010433000000800100043d000000000021004b000005670000c13d0000000402000029000301ff0020019c0000022d0000613d000000000001004b0000000601000029000005710000c13d000000400100043d000000400200003900000000022104360000004003100039000000800400043d00000000004304350000006003100039000000000004004b000001570000613d000000800500003900000000060000190000002005500039000000000705043300000000037304360000000106600039000000000046004b000001510000413d00000000041300490000000000420435000000060200002900000000040204330000000002430436000000000004004b000001660000613d000000000300001900000006050000290000002005500039000000000605043300000000026204360000000103300039000000000043004b000001600000413d0000000002120049000001ed0020009c000001ed020080410000006002200210000001ed0010009c000001ed010080410000004001100210000000000112019f0000000002000414000001ed0020009c000001ed02008041000000c002200210000000000121019f0000021e011001c70000800d0200003900000004030000390000021f0400004100000000050004110000000906000029000000030700002907ae07a40000040f0000000100200190000000470000613d00000204010000410000000000100443000000040100002900000004001004430000000001000414000001ed0010009c000001ed01008041000000c00110021000000205011001c7000080020200003907ae07a90000040f0000000100200190000005e20000613d000000000101043b000000000001004b000003a20000613d000000400300043d0000004401300039000000a002000039000000000021043500000024013000390000000902000029000000000021043500000220010000410000000000130435000000040130003900000000020004110000000000210435000000a401300039000000800200043d0000000000210435000b00000003001d000000c401300039000000000002004b000001a80000613d000000800300003900000000040000190000002003300039000000000503043300000000015104360000000104400039000000000024004b000001a20000413d0000000b030000290000000002310049000000040220008a00000064033000390000000000230435000000060200002900000000020204330000000001210436000000000002004b000001ba0000613d000000000300001900000006050000290000002005500039000000000405043300000000014104360000000103300039000000000023004b000001b40000413d0000000b030000290000000002310049000000040220008a00000084033000390000000000230435000000020200002900000000020204330000000001210436000000000002004b0000000106000029000001cd0000613d000000000300001900000000041300190000000005630019000000000505043300000000005404350000002003300039000000000023004b000001c60000413d0000000003120019000000000003043500000000030004140000000304000029000000040040008c000006340000c13d00000000050004150000000f0550008a00000005055002100000000003000031000000200030008c000000200400003900000000040340190000066a0000013d000001f60020009c000003230000613d000001f70020009c000000470000c13d000000a40030008c000000470000413d0000000002000416000000000002004b000000470000c13d0000000402100370000000000202043b000b00000002001d000001ff0020009c000000470000213d0000002402100370000000000202043b000a00000002001d000001ff0020009c000000470000213d0000006402100370000000000202043b000800000002001d0000004402100370000000000202043b000900000002001d0000008402100370000000000402043b000001f00040009c000000470000213d0000002302400039000000000032004b000000470000813d0000000405400039000000000251034f000000000202043b000001f00020009c000000830000213d0000001f0620003900000228066001970000003f066000390000022806600197000002000060009c000000830000213d0000008006600039000000400060043f000000800020043f00000000042400190000002404400039000000000034004b000000470000213d0000002003500039000000000331034f00000228042001980000001f0520018f000000a001400039000002190000613d000000a006000039000000000703034f000000007807043c0000000006860436000000000016004b000002150000c13d000000000005004b000002260000613d000000000343034f0000000304500210000000000501043300000000054501cf000000000545022f000000000303043b0000010004400089000000000343022f00000000034301cf000000000353019f0000000000310435000000a001200039000000000001043500000000020004110000000b0020006b000003cf0000c13d0000000a0000006b000003f70000c13d000000400100043d000000640210003900000221030000410000000000320435000000440210003900000222030000410000000000320435000000240210003900000025030000390000046c0000013d0000001f0410003900000228044001970000003f044000390000022804400197000000400600043d0000000004460019000000000064004b00000000050000390000000105004039000001f00040009c000000830000213d0000000100500190000000830000c13d0000008003300039000000400040043f000a00000006001d0000000004160436000b00000004001d000000a0022000390000000004210019000000000034004b000000470000213d000000000001004b0000000b06000029000002580000613d000000000300001900000000043600190000000005230019000000000505043300000000005404350000002003300039000000000013004b000002510000413d0000000a020000290000000001210019000000200110003900000000000104350000000004020433000001f00040009c000000830000213d0000000207000039000000000107041a000000010210019000000001031002700000007f0330618f0000001f0030008c00000000010000390000000101002039000000000012004b0000031d0000c13d000000200030008c0000028a0000413d000800000003001d000900000004001d000000000070043f0000000001000414000001ed0010009c000001ed01008041000000c001100210000001f2011001c7000080100200003907ae07a90000040f0000000100200190000000470000613d00000009040000290000001f024000390000000502200270000000200040008c0000000002004019000000000301043b00000008010000290000001f01100039000000050110027000000000011300190000000002230019000000000012004b00000002070000390000000b060000290000028a0000813d000000000002041b0000000102200039000000000012004b000002860000413d0000001f0040008c000003a40000a13d000900000004001d000000000070043f0000000001000414000001ed0010009c000001ed01008041000000c001100210000001f2011001c7000080100200003907ae07a90000040f0000000100200190000000470000613d00000009080000290000022802800198000000000101043b000003ae0000c13d00000020030000390000000a060000290000000207000039000003bc0000013d000000440030008c000000470000413d0000000002000416000000000002004b000000470000c13d0000000402100370000000000302043b000001ff0030009c000000470000213d0000002401100370000000000201043b000000000103001907ae07400000040f000000400200043d0000000000120435000001ed0020009c000001ed02008041000000400120021000000227011001c7000007af0001042e000000440030008c000000470000413d0000000002000416000000000002004b000000470000c13d0000000402100370000000000202043b000001f00020009c000000470000213d0000002304200039000000000034004b000000470000813d0000000404200039000000000441034f000000000504043b000001f00050009c000000830000213d00000005045002100000003f064000390000020f06600197000002000060009c000000830000213d0000008006600039000000400060043f000000800050043f00000024022000390000000004240019000000000034004b000000470000213d000000000005004b000002db0000613d000000a005000039000000000621034f000000000606043b000001ff0060009c000000470000213d00000000056504360000002002200039000000000042004b000002d30000413d0000002402100370000000000202043b000001f00020009c000000470000213d0000002304200039000000000034004b0000000005000019000001f105004041000001f104400197000000000004004b0000000006000019000001f106002041000001f10040009c000000000605c019000000000006004b000000470000613d0000000404200039000000000441034f000000000404043b000001f00040009c000000830000213d00000005054002100000003f065000390000020f06600197000000400700043d0000000006670019000800000007001d000000000076004b00000000070000390000000107004039000001f00060009c000000830000213d0000000100700190000000830000c13d000000400060043f00000008060000290000000006460436000700000006001d00000024022000390000000005250019000000000035004b000000470000213d000000000004004b0000042e0000c13d000000800200043d000000000002004b00000000020000190000043d0000613d000004630000013d000000240030008c000000470000413d0000000001000416000000000001004b000000470000c13d0000000203000039000000000203041a000000010520019000000001012002700000007f0410018f00000000010460190000001f0010008c00000000060000390000000106002039000000000662013f0000000100600190000003440000613d0000021a01000041000000000010043f0000002201000039000000040010043f0000021b01000041000007b000010430000000440030008c000000470000413d0000000002000416000000000002004b000000470000c13d0000000402100370000000000202043b000001ff0020009c000000470000213d0000002401100370000000000101043b000b00000001001d000001ff0010009c000000470000213d000000000020043f0000000101000039000000200010043f0000004002000039000000000100001907ae078f0000040f0000000b02000029000000000020043f000000200010043f0000000001000019000000400200003907ae078f0000040f000000000101041a000000ff001001900000000001000039000000010100c039000000800010043f0000020a01000041000007af0001042e000000800010043f000000000005004b0000034d0000c13d0000022901200197000000a00010043f000000000004004b000000c001000039000000a0010060390000035d0000013d000000000030043f000000020020008c000003520000813d000000a0010000390000035d0000013d000002230200004100000000040000190000000003040019000000000402041a000000a005300039000000000045043500000001022000390000002004300039000000000014004b000003540000413d000000c001300039000000800210008a000000800100003907ae07210000040f0000002001000039000000400200043d000b00000002001d0000000002120436000000800100003907ae070f0000040f0000000b020000290000000001210049000001ed0010009c000001ed010080410000006001100210000001ed0020009c000001ed020080410000004002200210000000000121019f000007af0001042e000000000020043f0000000101000039000000200010043f0000000001000414000001ed0010009c000001ed01008041000000c00110021000000201011001c7000080100200003907ae07a90000040f0000000100200190000000470000613d000000000101043b0000000b02000029000000000020043f000000200010043f0000000001000414000001ed0010009c000001ed01008041000000c00110021000000201011001c7000080100200003907ae07a90000040f0000000100200190000000470000613d000000000101043b000000000201041a00000229022001970000000a03000029000000000232019f000000000021041b000000400100043d0000000000310435000001ed0010009c000001ed0100804100000040011002100000000002000414000001ed0020009c000001ed02008041000000c002200210000000000112019f000001f2011001c70000800d0200003900000003030000390000020b0400004100000000050004110000000b0600002907ae07a40000040f0000000100200190000000470000613d0000000001000019000007af0001042e000000000004004b0000000001000019000003a80000613d000000000106043300000003024002100000022a0220027f0000022a02200167000000000221016f0000000101400210000003c80000013d000000010320008a00000005033002700000000004310019000000200300003900000001044000390000000a06000029000000020700003900000000056300190000000005050433000000000051041b00000020033000390000000101100039000000000041004b000003b50000c13d000000000082004b000003c60000813d0000000302800210000000f80220018f0000022a0220027f0000022a0220016700000000036300190000000003030433000000000223016f000000000021041b00000001010000390000000102800210000000000112019f000000000017041b000000200100003900000100001004430000012000000443000001f301000041000007af0001042e0000000b01000029000000000010043f0000000101000039000000200010043f0000000001000414000001ed0010009c000001ed01008041000000c00110021000000201011001c7000080100200003907ae07a90000040f0000000100200190000000470000613d000000000101043b0000000002000411000000000020043f000000200010043f0000000001000414000001ed0010009c000001ed01008041000000c00110021000000201011001c7000080100200003907ae07a90000040f0000000100200190000000470000613d000000000101043b000000000101041a000000ff001001900000022b0000c13d000000400100043d00000064021000390000021603000041000000000032043500000044021000390000021703000041000000000032043500000024021000390000002e030000390000046c0000013d000000400200043d000002020020009c000000830000213d0000004001200039000000400010043f00000020012000390000000903000029000000000031043500000001010000390000000000120435000000400200043d000002020020009c000000830000213d0000004003200039000000400030043f00000020032000390000000804000029000000000043043500000000001204350000000901000029000000000010043f000000200000043f0000000001000414000001ed0010009c000001ed01008041000000c00110021000000201011001c7000080100200003907ae07a90000040f0000000100200190000000470000613d000000000101043b0000000b02000029000000000020043f000000200010043f0000000001000414000001ed0010009c000001ed01008041000000c00110021000000201011001c7000080100200003907ae07a90000040f0000000100200190000000470000613d000000000101043b000000000101041a0007000800100074000004ac0000813d000000400100043d00000064021000390000021c03000041000000000032043500000044021000390000021d03000041000005440000013d0000000804000029000000000621034f000000000606043b000000200440003900000000006404350000002002200039000000000052004b0000042f0000413d00000008020000290000000002020433000000800400043d000000000024004b000004630000c13d000001f00020009c000000830000213d00000005042002100000003f054000390000021306500197000000400500043d000600000005001d0000000005560019000000000065004b00000000060000390000000106004039000001f00050009c000000830000213d0000000100600190000000830000c13d000000400050043f00000006050000290000000002250436000500000002001d0000001f0240018f000000000004004b000004580000613d000000000131034f00000005034000290000000504000029000000001501043c0000000004540436000000000034004b000004540000c13d000000000002004b000000800100043d000000000001004b000004770000c13d000000400200043d000b00000002001d00000020010000390000000002120436000000060100002907ae07330000040f000003660000013d000000400100043d00000064021000390000021003000041000000000032043500000044021000390000021103000041000000000032043500000024021000390000002903000039000000000032043500000209020000410000000000210435000000040210003900000020030000390000000000320435000001ed0010009c000001ed01008041000000400110021000000212011001c7000007b000010430000000000300001900000008010000290000000001010433000000000031004b000005dc0000a13d000a00000003001d0000000503300210000000a0013000390000000001010433000b01ff0010019c00008010020000390000053e0000613d000900000003001d00000007013000290000000001010433000000000010043f000000200000043f0000000001000414000001ed0010009c000001ed01008041000000c00110021000000201011001c707ae07a90000040f0000000100200190000000470000613d000000000101043b0000000b02000029000000000020043f000000200010043f0000000001000414000001ed0010009c000001ed01008041000000c00110021000000201011001c7000080100200003907ae07a90000040f0000000100200190000000470000613d000000060200002900000000020204330000000a03000029000000000032004b000005dc0000a13d00000009040000290000000502400029000000000101043b000000000101041a00000000001204350000000103300039000000800100043d000000000013004b000004780000413d0000045c0000013d0000000901000029000000000010043f000000200000043f0000000001000414000001ed0010009c000001ed01008041000000c00110021000000201011001c7000080100200003907ae07a90000040f0000000100200190000000470000613d000000000101043b0000000b02000029000000000020043f000000200010043f0000000001000414000001ed0010009c000001ed01008041000000c00110021000000201011001c7000080100200003907ae07a90000040f0000000100200190000000470000613d000000000101043b0000000702000029000000000021041b0000000901000029000000000010043f000000200000043f0000000001000414000001ed0010009c000001ed01008041000000c00110021000000201011001c7000080100200003907ae07a90000040f0000000100200190000000470000613d000000000101043b0000000a02000029000000000020043f000000200010043f0000000001000414000001ed0010009c000001ed01008041000000c00110021000000201011001c7000080100200003907ae07a90000040f0000000100200190000000470000613d000000000101043b000000000201041a000000080020002a000007090000413d00000008030000290000000002320019000000000021041b000000400100043d0000002002100039000000000032043500000009020000290000000000210435000001ed0010009c000001ed0100804100000040011002100000000002000414000001ed0020009c000001ed02008041000000c002200210000000000112019f00000201011001c70000800d020000390000000403000039000002030400004100000000050004110000000b060000290000000a0700002907ae07a40000040f0000000100200190000000470000613d000002040100004100000000001004430000000a0100002900000004001004430000000001000414000001ed0010009c000001ed01008041000000c00110021000000205011001c7000080020200003907ae07a90000040f0000000100200190000005e20000613d000000000101043b000000000001004b000003a20000613d000000400300043d0000008401300039000000a002000039000000000021043500000064013000390000000802000029000000000021043500000044013000390000000902000029000000000021043500000024013000390000000b02000029000000000021043500000206010000410000000000130435000000040130003900000000020004110000000000210435000000a402300039000000800100043d0000000000120435000700000003001d000000c402300039000000000001004b000005300000613d00000000030000190000000004230019000000a005300039000000000505043300000000005404350000002003300039000000000013004b000005290000413d0000000002210019000000000002043500000000020004140000000a03000029000000040030008c000005e30000c13d00000000050004150000000d0550008a00000005055002100000000003000031000000200030008c00000020040000390000000004034019000006170000013d000000400100043d00000064021000390000021403000041000000000032043500000044021000390000021503000041000000000032043500000024021000390000002a030000390000046c0000013d0000000901000029000000000010043f0000000101000039000000200010043f0000000001000414000001ed0010009c000001ed01008041000000c00110021000000201011001c7000080100200003907ae07a90000040f0000000100200190000000470000613d000000000101043b0000000002000411000000000020043f000000200010043f0000000001000414000001ed0010009c000001ed01008041000000c00110021000000201011001c7000080100200003907ae07a90000040f0000000100200190000000470000613d000000000101043b000000000101041a000000ff001001900000013b0000c13d000003ed0000013d000000400100043d000000640210003900000218030000410000000000320435000000440210003900000219030000410000000000320435000000240210003900000028030000390000046c0000013d00000000020000190000000001010433000000000021004b000005dc0000a13d000700000002001d0000000501200210000000a002100039000000000302043300000005011000290000000001010433000a00000001001d000b00000003001d000000000030043f000000200000043f0000000001000414000001ed0010009c000001ed01008041000000c00110021000000201011001c7000080100200003907ae07a90000040f0000000100200190000000470000613d000000000101043b0000000902000029000000000020043f000000200010043f0000000001000414000001ed0010009c000001ed01008041000000c00110021000000201011001c7000080100200003907ae07a90000040f0000000100200190000000470000613d000000000101043b000000000101041a0008000a00100074000004270000413d0000000b01000029000000000010043f000000200000043f0000000001000414000001ed0010009c000001ed01008041000000c00110021000000201011001c7000080100200003907ae07a90000040f0000000100200190000000470000613d000000000101043b0000000902000029000000000020043f000000200010043f0000000001000414000001ed0010009c000001ed01008041000000c00110021000000201011001c7000080100200003907ae07a90000040f0000000100200190000000470000613d000000000101043b0000000802000029000000000021041b0000000b01000029000000000010043f000000200000043f0000000001000414000001ed0010009c000001ed01008041000000c00110021000000201011001c7000080100200003907ae07a90000040f0000000100200190000000470000613d000000000101043b0000000302000029000000000020043f000000200010043f0000000001000414000001ed0010009c000001ed01008041000000c00110021000000201011001c7000080100200003907ae07a90000040f0000000100200190000000470000613d000000000101043b000000000201041a0000000a03000029000000000032001a000007090000413d0000000002320019000000000021041b00000007020000290000000102200039000000800100043d000000000012004b0000000601000029000005720000413d000001460000013d0000021a01000041000000000010043f0000003201000039000000040010043f0000021b01000041000007b000010430000000000001042f0000001f011000390000022801100197000000c401100039000001ed0010009c000001ed0100804100000060011002100000000703000029000001ed0030009c000001ed030080410000004003300210000000000131019f000001ed0020009c000001ed02008041000000c002200210000000000112019f0000000a0200002907ae07a40000040f00000000030100190000006003300270000001ed03300197000000200030008c000000200400003900000000040340190000001f0640018f00000020074001900000000705700029000006040000613d000000000801034f0000000709000029000000008a08043c0000000009a90436000000000059004b000006000000c13d000000000006004b000006110000613d000000000771034f0000000306600210000000000805043300000000086801cf000000000868022f000000000707043b0000010006600089000000000767022f00000000066701cf000000000686019f0000000000650435000000000003001f00000000050004150000000c0550008a00000005055002100000000100200190000006880000613d0000001f01400039000000600110018f0000000702100029000000000012004b000000000100003900000001010040390000000004020019000001f00020009c000000830000213d0000000100100190000000830000c13d000000400040043f000000200030008c000000470000413d000000070100002900000000010104330000020700100198000000470000c13d0000000502500270000000000201001f0000020801100197000002060010009c000003a20000613d0000020901000041000b00000004001d0000000000140435000000040140003907ae07740000040f000006dd0000013d0000001f0220003900000228022001970000000b0400002900000000014100490000000001210019000001ed0010009c000001ed010080410000006001100210000001ed0040009c000001ed0200004100000000020440190000004002200210000000000121019f000001ed0030009c000001ed03008041000000c002300210000000000112019f000000030200002907ae07a40000040f00000000030100190000006003300270000001ed03300197000000200030008c000000200400003900000000040340190000001f0640018f00000020074001900000000b05700029000006570000613d000000000801034f0000000b09000029000000008a08043c0000000009a90436000000000059004b000006530000c13d000000000006004b000006640000613d000000000771034f0000000306600210000000000805043300000000086801cf000000000868022f000000000707043b0000010006600089000000000767022f00000000066701cf000000000686019f0000000000650435000000000003001f00000000050004150000000e0550008a00000005055002100000000100200190000006a20000613d0000001f01400039000000600110018f0000000b02100029000000000012004b000000000100003900000001010040390000000004020019000001f00020009c000000830000213d0000000100100190000000830000c13d000000400040043f000000200030008c000000470000413d0000000b0100002900000000010104330000020700100198000000470000c13d0000000502500270000000000201001f0000020801100197000002200010009c000003a20000613d0000020901000041000a00000004001d0000000000140435000000040140003907ae07740000040f0000000a02000029000006de0000013d000000040230008c000006d70000413d000000000400043d0000020704400197000000000501043b0000020805500197000000000445019f000000000040043f000000440030008c000006d70000413d0000020804400197000002090040009c000006d70000c13d000000040510037000000228062001980000001f0720018f000000400400043d0000000001640019000006bb0000613d000000000805034f0000000009040019000000008a08043c0000000009a90436000000000019004b0000069d0000c13d000006bb0000013d000000040230008c000006d70000413d000000000400043d0000020704400197000000000501043b0000020805500197000000000445019f000000000040043f000000440030008c000006d70000413d0000020804400197000002090040009c000006d70000c13d000000040510037000000228062001980000001f0720018f000000400400043d0000000001640019000006bb0000613d000000000805034f0000000009040019000000008a08043c0000000009a90436000000000019004b000006b70000c13d000000000007004b000006c80000613d000000000565034f0000000306700210000000000701043300000000076701cf000000000767022f000000000505043b0000010006600089000000000565022f00000000056501cf000000000575019f00000000005104350000000005040433000001f00050009c000006d70000213d0000002401500039000000000031004b000006d70000213d00000000014500190000000003010433000001f00030009c000006d70000213d000000000224001900000000063100190000002006600039000000000026004b000006e70000a13d000000400200043d000b00000002001d00000209010000410000000000120435000000040120003907ae07810000040f0000000b020000290000000001210049000001ed0010009c000001ed010080410000006001100210000001ed0020009c000001ed020080410000004002200210000000000121019f000007b00001043000000000023500190000003f0220003900000228022001970000000004420019000000000024004b000000000200003900000001020040390000000003040019000001f00040009c000000830000213d0000000100200190000000830000c13d000000400030043f000000000001004b000006d70000613d00000209020000410000000004030019000b00000004001d0000000000240435000000040240003900000020030000390000000000320435000000240240003907ae070f0000040f0000000b020000290000000001210049000001ed0010009c000001ed01008041000001ed0020009c000001ed0200804100000060011002100000004002200210000000000121019f000007b0000104300000021a01000041000000000010043f0000001101000039000000040010043f0000021b01000041000007b00001043000000000430104340000000001320436000000000003004b0000071b0000613d000000000200001900000000052100190000000006240019000000000606043300000000006504350000002002200039000000000032004b000007140000413d000000000231001900000000000204350000001f0230003900000228022001970000000001210019000000000001042d0000001f0220003900000228022001970000000001120019000000000021004b00000000020000390000000102004039000001f00010009c0000072d0000213d00000001002001900000072d0000c13d000000400010043f000000000001042d0000021a01000041000000000010043f0000004101000039000000040010043f0000021b01000041000007b000010430000000000301001900000000040304330000000001420436000000000004004b0000073f0000613d00000000020000190000002003300039000000000503043300000000015104360000000102200039000000000042004b000007390000413d000000000001042d0001000000000002000101ff0010019c000007600000613d000000000020043f000000200000043f0000000001000414000001ed0010009c000001ed01008041000000c00110021000000201011001c7000080100200003907ae07a90000040f00000001002001900000075e0000613d000000000101043b0000000102000029000000000020043f000000200010043f0000000001000414000001ed0010009c000001ed01008041000000c00110021000000201011001c7000080100200003907ae07a90000040f00000001002001900000075e0000613d000000000101043b000000000101041a000000000001042d0000000001000019000007b000010430000000400100043d00000064021000390000021403000041000000000032043500000044021000390000021503000041000000000032043500000024021000390000002a03000039000000000032043500000209020000410000000000210435000000040210003900000020030000390000000000320435000001ed0010009c000001ed01008041000000400110021000000212011001c7000007b00001043000000060021000390000022b03000041000000000032043500000040021000390000022c030000410000000000320435000000200210003900000028030000390000000000320435000000200200003900000000002104350000008001100039000000000001042d00000060021000390000022d03000041000000000032043500000040021000390000022e030000410000000000320435000000200210003900000034030000390000000000320435000000200200003900000000002104350000008001100039000000000001042d000000000001042f000001ed0010009c000001ed010080410000004001100210000001ed0020009c000001ed020080410000006002200210000000000112019f0000000002000414000001ed0020009c000001ed02008041000000c002200210000000000112019f0000021e011001c7000080100200003907ae07a90000040f0000000100200190000007a20000613d000000000101043b000000000001042d0000000001000019000007b000010430000007a7002104210000000102000039000000000001042d0000000002000019000000000001042d000007ac002104230000000102000039000000000001042d0000000002000019000000000001042d000007ae00000432000007af0001042e000007b00001043000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffff00000000000000000000000000000000000000000000000000000001ffffffe000000000000000000000000000000000000000000000000000000000ffffffe0000000000000000000000000000000000000000000000000ffffffffffffffff800000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000200000000000000000000000000000000200000000000000000000000000000040000001000000000000000000000000000000000000000000000000000000000000000000000000004e1273f300000000000000000000000000000000000000000000000000000000e985e9c400000000000000000000000000000000000000000000000000000000e985e9c500000000000000000000000000000000000000000000000000000000f242432a000000000000000000000000000000000000000000000000000000004e1273f400000000000000000000000000000000000000000000000000000000a22cb465000000000000000000000000000000000000000000000000000000000e89341b000000000000000000000000000000000000000000000000000000000e89341c000000000000000000000000000000000000000000000000000000002eb2c2d60000000000000000000000000000000000000000000000000000000000fdd58e0000000000000000000000000000000000000000000000000000000001ffc9a7000000000000000000000000ffffffffffffffffffffffffffffffffffffffff000000000000000000000000000000000000000000000000ffffffffffffff7f0200000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffbfc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f621806aa1896bbf26568e884a7374b41e002500962caba6a15023a8d90e8508b830200000200000000000000000000000000000024000000000000000000000000f23a6e610000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000000008c379a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000080000000000000000017307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31455243313135353a2073657474696e6720617070726f76616c2073746174757320666f722073656c66000000000000000000000000000000000000000000000000000000000000000000000000000000000000840000008000000000000000007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0206d69736d617463680000000000000000000000000000000000000000000000455243313135353a206163636f756e747320616e6420696473206c656e677468000000000000000000000000000000000000008400000000000000000000000000000000000000000000000000000000000000000000003fffffffffffffffe0616c6964206f776e657200000000000000000000000000000000000000000000455243313135353a2061646472657373207a65726f206973206e6f74206120766572206f7220617070726f766564000000000000000000000000000000000000455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e6d69736d61746368000000000000000000000000000000000000000000000000455243313135353a2069647320616e6420616d6f756e7473206c656e677468204e487b7100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002400000000000000000000000072207472616e7366657200000000000000000000000000000000000000000000455243313135353a20696e73756666696369656e742062616c616e636520666f02000000000000000000000000000000000000000000000000000000000000004a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fbbc197c81000000000000000000000000000000000000000000000000000000006472657373000000000000000000000000000000000000000000000000000000455243313135353a207472616e7366657220746f20746865207a65726f206164405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace01ffc9a7000000000000000000000000000000000000000000000000000000000e89341c00000000000000000000000000000000000000000000000000000000d9b67a26000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6420746f6b656e73000000000000000000000000000000000000000000000000455243313135353a204552433131353552656365697665722072656a65637465526563656976657220696d706c656d656e746572000000000000000000000000455243313135353a207472616e7366657220746f206e6f6e2d455243313135350000000000000000000000000000000000000000000000000000000000000000c082a490cd113e69c47dd08e4fb1aa8f054f102e3e81a043593bf1343529d719", } // ERC1155ABI is the input ABI used to generate the binding from. // Deprecated: Use ERC1155MetaData.ABI instead. var ERC1155ABI = ERC1155MetaData.ABI // ERC1155Bin is the compiled bytecode used for deploying new contracts. // Deprecated: Use ERC1155MetaData.Bin instead. var ERC1155Bin = ERC1155MetaData.Bin // DeployERC1155 deploys a new Ethereum contract, binding an instance of ERC1155 to it. func DeployERC1155(auth *bind.TransactOpts, backend bind.ContractBackend, uri_ string) (common.Address, *types.Transaction, *ERC1155, error) { parsed, err := ERC1155MetaData.GetAbi() if err != nil { return common.Address{}, nil, nil, err } if parsed == nil { return common.Address{}, nil, nil, errors.New("GetABI returned nil") } address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(ERC1155Bin), backend, uri_) if err != nil { return common.Address{}, nil, nil, err } return address, tx, &ERC1155{ERC1155Caller: ERC1155Caller{contract: contract}, ERC1155Transactor: ERC1155Transactor{contract: contract}, ERC1155Filterer: ERC1155Filterer{contract: contract}}, nil } // ERC1155 is an auto generated Go binding around an Ethereum contract. type ERC1155 struct { ERC1155Caller // Read-only binding to the contract ERC1155Transactor // Write-only binding to the contract ERC1155Filterer // Log filterer for contract events } // ERC1155Caller is an auto generated read-only Go binding around an Ethereum contract. type ERC1155Caller struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // ERC1155Transactor is an auto generated write-only Go binding around an Ethereum contract. type ERC1155Transactor struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // ERC1155Filterer is an auto generated log filtering Go binding around an Ethereum contract events. type ERC1155Filterer struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // ERC1155Session is an auto generated Go binding around an Ethereum contract, // with pre-set call and transact options. type ERC1155Session struct { Contract *ERC1155 // Generic contract binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // ERC1155CallerSession is an auto generated read-only Go binding around an Ethereum contract, // with pre-set call options. type ERC1155CallerSession struct { Contract *ERC1155Caller // Generic contract caller binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session } // ERC1155TransactorSession is an auto generated write-only Go binding around an Ethereum contract, // with pre-set transact options. type ERC1155TransactorSession struct { Contract *ERC1155Transactor // Generic contract transactor binding to set the session for TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // ERC1155Raw is an auto generated low-level Go binding around an Ethereum contract. type ERC1155Raw struct { Contract *ERC1155 // Generic contract binding to access the raw methods on } // ERC1155CallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. type ERC1155CallerRaw struct { Contract *ERC1155Caller // Generic read-only contract binding to access the raw methods on } // ERC1155TransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. type ERC1155TransactorRaw struct { Contract *ERC1155Transactor // Generic write-only contract binding to access the raw methods on } // NewERC1155 creates a new instance of ERC1155, bound to a specific deployed contract. func NewERC1155(address common.Address, backend bind.ContractBackend) (*ERC1155, error) { contract, err := bindERC1155(address, backend, backend, backend) if err != nil { return nil, err } return &ERC1155{ERC1155Caller: ERC1155Caller{contract: contract}, ERC1155Transactor: ERC1155Transactor{contract: contract}, ERC1155Filterer: ERC1155Filterer{contract: contract}}, nil } // NewERC1155Caller creates a new read-only instance of ERC1155, bound to a specific deployed contract. func NewERC1155Caller(address common.Address, caller bind.ContractCaller) (*ERC1155Caller, error) { contract, err := bindERC1155(address, caller, nil, nil) if err != nil { return nil, err } return &ERC1155Caller{contract: contract}, nil } // NewERC1155Transactor creates a new write-only instance of ERC1155, bound to a specific deployed contract. func NewERC1155Transactor(address common.Address, transactor bind.ContractTransactor) (*ERC1155Transactor, error) { contract, err := bindERC1155(address, nil, transactor, nil) if err != nil { return nil, err } return &ERC1155Transactor{contract: contract}, nil } // NewERC1155Filterer creates a new log filterer instance of ERC1155, bound to a specific deployed contract. func NewERC1155Filterer(address common.Address, filterer bind.ContractFilterer) (*ERC1155Filterer, error) { contract, err := bindERC1155(address, nil, nil, filterer) if err != nil { return nil, err } return &ERC1155Filterer{contract: contract}, nil } // bindERC1155 binds a generic wrapper to an already deployed contract. func bindERC1155(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { parsed, err := ERC1155MetaData.GetAbi() if err != nil { return nil, err } return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_ERC1155 *ERC1155Raw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _ERC1155.Contract.ERC1155Caller.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_ERC1155 *ERC1155Raw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _ERC1155.Contract.ERC1155Transactor.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_ERC1155 *ERC1155Raw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _ERC1155.Contract.ERC1155Transactor.contract.Transact(opts, method, params...) } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_ERC1155 *ERC1155CallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _ERC1155.Contract.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_ERC1155 *ERC1155TransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _ERC1155.Contract.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_ERC1155 *ERC1155TransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _ERC1155.Contract.contract.Transact(opts, method, params...) } // BalanceOf is a free data retrieval call binding the contract method 0x00fdd58e. // // Solidity: function balanceOf(address account, uint256 id) view returns(uint256) func (_ERC1155 *ERC1155Caller) BalanceOf(opts *bind.CallOpts, account common.Address, id *big.Int) (*big.Int, error) { var out []interface{} err := _ERC1155.contract.Call(opts, &out, "balanceOf", account, id) if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // BalanceOf is a free data retrieval call binding the contract method 0x00fdd58e. // // Solidity: function balanceOf(address account, uint256 id) view returns(uint256) func (_ERC1155 *ERC1155Session) BalanceOf(account common.Address, id *big.Int) (*big.Int, error) { return _ERC1155.Contract.BalanceOf(&_ERC1155.CallOpts, account, id) } // BalanceOf is a free data retrieval call binding the contract method 0x00fdd58e. // // Solidity: function balanceOf(address account, uint256 id) view returns(uint256) func (_ERC1155 *ERC1155CallerSession) BalanceOf(account common.Address, id *big.Int) (*big.Int, error) { return _ERC1155.Contract.BalanceOf(&_ERC1155.CallOpts, account, id) } // BalanceOfBatch is a free data retrieval call binding the contract method 0x4e1273f4. // // Solidity: function balanceOfBatch(address[] accounts, uint256[] ids) view returns(uint256[]) func (_ERC1155 *ERC1155Caller) BalanceOfBatch(opts *bind.CallOpts, accounts []common.Address, ids []*big.Int) ([]*big.Int, error) { var out []interface{} err := _ERC1155.contract.Call(opts, &out, "balanceOfBatch", accounts, ids) if err != nil { return *new([]*big.Int), err } out0 := *abi.ConvertType(out[0], new([]*big.Int)).(*[]*big.Int) return out0, err } // BalanceOfBatch is a free data retrieval call binding the contract method 0x4e1273f4. // // Solidity: function balanceOfBatch(address[] accounts, uint256[] ids) view returns(uint256[]) func (_ERC1155 *ERC1155Session) BalanceOfBatch(accounts []common.Address, ids []*big.Int) ([]*big.Int, error) { return _ERC1155.Contract.BalanceOfBatch(&_ERC1155.CallOpts, accounts, ids) } // BalanceOfBatch is a free data retrieval call binding the contract method 0x4e1273f4. // // Solidity: function balanceOfBatch(address[] accounts, uint256[] ids) view returns(uint256[]) func (_ERC1155 *ERC1155CallerSession) BalanceOfBatch(accounts []common.Address, ids []*big.Int) ([]*big.Int, error) { return _ERC1155.Contract.BalanceOfBatch(&_ERC1155.CallOpts, accounts, ids) } // IsApprovedForAll is a free data retrieval call binding the contract method 0xe985e9c5. // // Solidity: function isApprovedForAll(address account, address operator) view returns(bool) func (_ERC1155 *ERC1155Caller) IsApprovedForAll(opts *bind.CallOpts, account common.Address, operator common.Address) (bool, error) { var out []interface{} err := _ERC1155.contract.Call(opts, &out, "isApprovedForAll", account, operator) if err != nil { return *new(bool), err } out0 := *abi.ConvertType(out[0], new(bool)).(*bool) return out0, err } // IsApprovedForAll is a free data retrieval call binding the contract method 0xe985e9c5. // // Solidity: function isApprovedForAll(address account, address operator) view returns(bool) func (_ERC1155 *ERC1155Session) IsApprovedForAll(account common.Address, operator common.Address) (bool, error) { return _ERC1155.Contract.IsApprovedForAll(&_ERC1155.CallOpts, account, operator) } // IsApprovedForAll is a free data retrieval call binding the contract method 0xe985e9c5. // // Solidity: function isApprovedForAll(address account, address operator) view returns(bool) func (_ERC1155 *ERC1155CallerSession) IsApprovedForAll(account common.Address, operator common.Address) (bool, error) { return _ERC1155.Contract.IsApprovedForAll(&_ERC1155.CallOpts, account, operator) } // SupportsInterface is a free data retrieval call binding the contract method 0x01ffc9a7. // // Solidity: function supportsInterface(bytes4 interfaceId) view returns(bool) func (_ERC1155 *ERC1155Caller) SupportsInterface(opts *bind.CallOpts, interfaceId [4]byte) (bool, error) { var out []interface{} err := _ERC1155.contract.Call(opts, &out, "supportsInterface", interfaceId) if err != nil { return *new(bool), err } out0 := *abi.ConvertType(out[0], new(bool)).(*bool) return out0, err } // SupportsInterface is a free data retrieval call binding the contract method 0x01ffc9a7. // // Solidity: function supportsInterface(bytes4 interfaceId) view returns(bool) func (_ERC1155 *ERC1155Session) SupportsInterface(interfaceId [4]byte) (bool, error) { return _ERC1155.Contract.SupportsInterface(&_ERC1155.CallOpts, interfaceId) } // SupportsInterface is a free data retrieval call binding the contract method 0x01ffc9a7. // // Solidity: function supportsInterface(bytes4 interfaceId) view returns(bool) func (_ERC1155 *ERC1155CallerSession) SupportsInterface(interfaceId [4]byte) (bool, error) { return _ERC1155.Contract.SupportsInterface(&_ERC1155.CallOpts, interfaceId) } // Uri is a free data retrieval call binding the contract method 0x0e89341c. // // Solidity: function uri(uint256 ) view returns(string) func (_ERC1155 *ERC1155Caller) Uri(opts *bind.CallOpts, arg0 *big.Int) (string, error) { var out []interface{} err := _ERC1155.contract.Call(opts, &out, "uri", arg0) if err != nil { return *new(string), err } out0 := *abi.ConvertType(out[0], new(string)).(*string) return out0, err } // Uri is a free data retrieval call binding the contract method 0x0e89341c. // // Solidity: function uri(uint256 ) view returns(string) func (_ERC1155 *ERC1155Session) Uri(arg0 *big.Int) (string, error) { return _ERC1155.Contract.Uri(&_ERC1155.CallOpts, arg0) } // Uri is a free data retrieval call binding the contract method 0x0e89341c. // // Solidity: function uri(uint256 ) view returns(string) func (_ERC1155 *ERC1155CallerSession) Uri(arg0 *big.Int) (string, error) { return _ERC1155.Contract.Uri(&_ERC1155.CallOpts, arg0) } // SafeBatchTransferFrom is a paid mutator transaction binding the contract method 0x2eb2c2d6. // // Solidity: function safeBatchTransferFrom(address from, address to, uint256[] ids, uint256[] amounts, bytes data) returns() func (_ERC1155 *ERC1155Transactor) SafeBatchTransferFrom(opts *bind.TransactOpts, from common.Address, to common.Address, ids []*big.Int, amounts []*big.Int, data []byte) (*types.Transaction, error) { return _ERC1155.contract.Transact(opts, "safeBatchTransferFrom", from, to, ids, amounts, data) } // SafeBatchTransferFrom is a paid mutator transaction binding the contract method 0x2eb2c2d6. // // Solidity: function safeBatchTransferFrom(address from, address to, uint256[] ids, uint256[] amounts, bytes data) returns() func (_ERC1155 *ERC1155Session) SafeBatchTransferFrom(from common.Address, to common.Address, ids []*big.Int, amounts []*big.Int, data []byte) (*types.Transaction, error) { return _ERC1155.Contract.SafeBatchTransferFrom(&_ERC1155.TransactOpts, from, to, ids, amounts, data) } // SafeBatchTransferFrom is a paid mutator transaction binding the contract method 0x2eb2c2d6. // // Solidity: function safeBatchTransferFrom(address from, address to, uint256[] ids, uint256[] amounts, bytes data) returns() func (_ERC1155 *ERC1155TransactorSession) SafeBatchTransferFrom(from common.Address, to common.Address, ids []*big.Int, amounts []*big.Int, data []byte) (*types.Transaction, error) { return _ERC1155.Contract.SafeBatchTransferFrom(&_ERC1155.TransactOpts, from, to, ids, amounts, data) } // SafeTransferFrom is a paid mutator transaction binding the contract method 0xf242432a. // // Solidity: function safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes data) returns() func (_ERC1155 *ERC1155Transactor) SafeTransferFrom(opts *bind.TransactOpts, from common.Address, to common.Address, id *big.Int, amount *big.Int, data []byte) (*types.Transaction, error) { return _ERC1155.contract.Transact(opts, "safeTransferFrom", from, to, id, amount, data) } // SafeTransferFrom is a paid mutator transaction binding the contract method 0xf242432a. // // Solidity: function safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes data) returns() func (_ERC1155 *ERC1155Session) SafeTransferFrom(from common.Address, to common.Address, id *big.Int, amount *big.Int, data []byte) (*types.Transaction, error) { return _ERC1155.Contract.SafeTransferFrom(&_ERC1155.TransactOpts, from, to, id, amount, data) } // SafeTransferFrom is a paid mutator transaction binding the contract method 0xf242432a. // // Solidity: function safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes data) returns() func (_ERC1155 *ERC1155TransactorSession) SafeTransferFrom(from common.Address, to common.Address, id *big.Int, amount *big.Int, data []byte) (*types.Transaction, error) { return _ERC1155.Contract.SafeTransferFrom(&_ERC1155.TransactOpts, from, to, id, amount, data) } // SetApprovalForAll is a paid mutator transaction binding the contract method 0xa22cb465. // // Solidity: function setApprovalForAll(address operator, bool approved) returns() func (_ERC1155 *ERC1155Transactor) SetApprovalForAll(opts *bind.TransactOpts, operator common.Address, approved bool) (*types.Transaction, error) { return _ERC1155.contract.Transact(opts, "setApprovalForAll", operator, approved) } // SetApprovalForAll is a paid mutator transaction binding the contract method 0xa22cb465. // // Solidity: function setApprovalForAll(address operator, bool approved) returns() func (_ERC1155 *ERC1155Session) SetApprovalForAll(operator common.Address, approved bool) (*types.Transaction, error) { return _ERC1155.Contract.SetApprovalForAll(&_ERC1155.TransactOpts, operator, approved) } // SetApprovalForAll is a paid mutator transaction binding the contract method 0xa22cb465. // // Solidity: function setApprovalForAll(address operator, bool approved) returns() func (_ERC1155 *ERC1155TransactorSession) SetApprovalForAll(operator common.Address, approved bool) (*types.Transaction, error) { return _ERC1155.Contract.SetApprovalForAll(&_ERC1155.TransactOpts, operator, approved) } // ERC1155ApprovalForAllIterator is returned from FilterApprovalForAll and is used to iterate over the raw logs and unpacked data for ApprovalForAll events raised by the ERC1155 contract. type ERC1155ApprovalForAllIterator struct { Event *ERC1155ApprovalForAll // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *ERC1155ApprovalForAllIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(ERC1155ApprovalForAll) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(ERC1155ApprovalForAll) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *ERC1155ApprovalForAllIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *ERC1155ApprovalForAllIterator) Close() error { it.sub.Unsubscribe() return nil } // ERC1155ApprovalForAll represents a ApprovalForAll event raised by the ERC1155 contract. type ERC1155ApprovalForAll struct { Account common.Address Operator common.Address Approved bool Raw types.Log // Blockchain specific contextual infos } // FilterApprovalForAll is a free log retrieval operation binding the contract event 0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31. // // Solidity: event ApprovalForAll(address indexed account, address indexed operator, bool approved) func (_ERC1155 *ERC1155Filterer) FilterApprovalForAll(opts *bind.FilterOpts, account []common.Address, operator []common.Address) (*ERC1155ApprovalForAllIterator, error) { var accountRule []interface{} for _, accountItem := range account { accountRule = append(accountRule, accountItem) } var operatorRule []interface{} for _, operatorItem := range operator { operatorRule = append(operatorRule, operatorItem) } logs, sub, err := _ERC1155.contract.FilterLogs(opts, "ApprovalForAll", accountRule, operatorRule) if err != nil { return nil, err } return &ERC1155ApprovalForAllIterator{contract: _ERC1155.contract, event: "ApprovalForAll", logs: logs, sub: sub}, nil } // WatchApprovalForAll is a free log subscription operation binding the contract event 0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31. // // Solidity: event ApprovalForAll(address indexed account, address indexed operator, bool approved) func (_ERC1155 *ERC1155Filterer) WatchApprovalForAll(opts *bind.WatchOpts, sink chan<- *ERC1155ApprovalForAll, account []common.Address, operator []common.Address) (event.Subscription, error) { var accountRule []interface{} for _, accountItem := range account { accountRule = append(accountRule, accountItem) } var operatorRule []interface{} for _, operatorItem := range operator { operatorRule = append(operatorRule, operatorItem) } logs, sub, err := _ERC1155.contract.WatchLogs(opts, "ApprovalForAll", accountRule, operatorRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(ERC1155ApprovalForAll) if err := _ERC1155.contract.UnpackLog(event, "ApprovalForAll", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseApprovalForAll is a log parse operation binding the contract event 0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31. // // Solidity: event ApprovalForAll(address indexed account, address indexed operator, bool approved) func (_ERC1155 *ERC1155Filterer) ParseApprovalForAll(log types.Log) (*ERC1155ApprovalForAll, error) { event := new(ERC1155ApprovalForAll) if err := _ERC1155.contract.UnpackLog(event, "ApprovalForAll", log); err != nil { return nil, err } event.Raw = log return event, nil } // ERC1155TransferBatchIterator is returned from FilterTransferBatch and is used to iterate over the raw logs and unpacked data for TransferBatch events raised by the ERC1155 contract. type ERC1155TransferBatchIterator struct { Event *ERC1155TransferBatch // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *ERC1155TransferBatchIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(ERC1155TransferBatch) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(ERC1155TransferBatch) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *ERC1155TransferBatchIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *ERC1155TransferBatchIterator) Close() error { it.sub.Unsubscribe() return nil } // ERC1155TransferBatch represents a TransferBatch event raised by the ERC1155 contract. type ERC1155TransferBatch struct { Operator common.Address From common.Address To common.Address Ids []*big.Int Values []*big.Int Raw types.Log // Blockchain specific contextual infos } // FilterTransferBatch is a free log retrieval operation binding the contract event 0x4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb. // // Solidity: event TransferBatch(address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] values) func (_ERC1155 *ERC1155Filterer) FilterTransferBatch(opts *bind.FilterOpts, operator []common.Address, from []common.Address, to []common.Address) (*ERC1155TransferBatchIterator, error) { var operatorRule []interface{} for _, operatorItem := range operator { operatorRule = append(operatorRule, operatorItem) } var fromRule []interface{} for _, fromItem := range from { fromRule = append(fromRule, fromItem) } var toRule []interface{} for _, toItem := range to { toRule = append(toRule, toItem) } logs, sub, err := _ERC1155.contract.FilterLogs(opts, "TransferBatch", operatorRule, fromRule, toRule) if err != nil { return nil, err } return &ERC1155TransferBatchIterator{contract: _ERC1155.contract, event: "TransferBatch", logs: logs, sub: sub}, nil } // WatchTransferBatch is a free log subscription operation binding the contract event 0x4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb. // // Solidity: event TransferBatch(address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] values) func (_ERC1155 *ERC1155Filterer) WatchTransferBatch(opts *bind.WatchOpts, sink chan<- *ERC1155TransferBatch, operator []common.Address, from []common.Address, to []common.Address) (event.Subscription, error) { var operatorRule []interface{} for _, operatorItem := range operator { operatorRule = append(operatorRule, operatorItem) } var fromRule []interface{} for _, fromItem := range from { fromRule = append(fromRule, fromItem) } var toRule []interface{} for _, toItem := range to { toRule = append(toRule, toItem) } logs, sub, err := _ERC1155.contract.WatchLogs(opts, "TransferBatch", operatorRule, fromRule, toRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(ERC1155TransferBatch) if err := _ERC1155.contract.UnpackLog(event, "TransferBatch", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseTransferBatch is a log parse operation binding the contract event 0x4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb. // // Solidity: event TransferBatch(address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] values) func (_ERC1155 *ERC1155Filterer) ParseTransferBatch(log types.Log) (*ERC1155TransferBatch, error) { event := new(ERC1155TransferBatch) if err := _ERC1155.contract.UnpackLog(event, "TransferBatch", log); err != nil { return nil, err } event.Raw = log return event, nil } // ERC1155TransferSingleIterator is returned from FilterTransferSingle and is used to iterate over the raw logs and unpacked data for TransferSingle events raised by the ERC1155 contract. type ERC1155TransferSingleIterator struct { Event *ERC1155TransferSingle // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *ERC1155TransferSingleIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(ERC1155TransferSingle) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(ERC1155TransferSingle) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *ERC1155TransferSingleIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *ERC1155TransferSingleIterator) Close() error { it.sub.Unsubscribe() return nil } // ERC1155TransferSingle represents a TransferSingle event raised by the ERC1155 contract. type ERC1155TransferSingle struct { Operator common.Address From common.Address To common.Address Id *big.Int Value *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterTransferSingle is a free log retrieval operation binding the contract event 0xc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62. // // Solidity: event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value) func (_ERC1155 *ERC1155Filterer) FilterTransferSingle(opts *bind.FilterOpts, operator []common.Address, from []common.Address, to []common.Address) (*ERC1155TransferSingleIterator, error) { var operatorRule []interface{} for _, operatorItem := range operator { operatorRule = append(operatorRule, operatorItem) } var fromRule []interface{} for _, fromItem := range from { fromRule = append(fromRule, fromItem) } var toRule []interface{} for _, toItem := range to { toRule = append(toRule, toItem) } logs, sub, err := _ERC1155.contract.FilterLogs(opts, "TransferSingle", operatorRule, fromRule, toRule) if err != nil { return nil, err } return &ERC1155TransferSingleIterator{contract: _ERC1155.contract, event: "TransferSingle", logs: logs, sub: sub}, nil } // WatchTransferSingle is a free log subscription operation binding the contract event 0xc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62. // // Solidity: event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value) func (_ERC1155 *ERC1155Filterer) WatchTransferSingle(opts *bind.WatchOpts, sink chan<- *ERC1155TransferSingle, operator []common.Address, from []common.Address, to []common.Address) (event.Subscription, error) { var operatorRule []interface{} for _, operatorItem := range operator { operatorRule = append(operatorRule, operatorItem) } var fromRule []interface{} for _, fromItem := range from { fromRule = append(fromRule, fromItem) } var toRule []interface{} for _, toItem := range to { toRule = append(toRule, toItem) } logs, sub, err := _ERC1155.contract.WatchLogs(opts, "TransferSingle", operatorRule, fromRule, toRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(ERC1155TransferSingle) if err := _ERC1155.contract.UnpackLog(event, "TransferSingle", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseTransferSingle is a log parse operation binding the contract event 0xc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62. // // Solidity: event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value) func (_ERC1155 *ERC1155Filterer) ParseTransferSingle(log types.Log) (*ERC1155TransferSingle, error) { event := new(ERC1155TransferSingle) if err := _ERC1155.contract.UnpackLog(event, "TransferSingle", log); err != nil { return nil, err } event.Raw = log return event, nil } // ERC1155URIIterator is returned from FilterURI and is used to iterate over the raw logs and unpacked data for URI events raised by the ERC1155 contract. type ERC1155URIIterator struct { Event *ERC1155URI // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *ERC1155URIIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(ERC1155URI) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(ERC1155URI) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *ERC1155URIIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *ERC1155URIIterator) Close() error { it.sub.Unsubscribe() return nil } // ERC1155URI represents a URI event raised by the ERC1155 contract. type ERC1155URI struct { Value string Id *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterURI is a free log retrieval operation binding the contract event 0x6bb7ff708619ba0610cba295a58592e0451dee2622938c8755667688daf3529b. // // Solidity: event URI(string value, uint256 indexed id) func (_ERC1155 *ERC1155Filterer) FilterURI(opts *bind.FilterOpts, id []*big.Int) (*ERC1155URIIterator, error) { var idRule []interface{} for _, idItem := range id { idRule = append(idRule, idItem) } logs, sub, err := _ERC1155.contract.FilterLogs(opts, "URI", idRule) if err != nil { return nil, err } return &ERC1155URIIterator{contract: _ERC1155.contract, event: "URI", logs: logs, sub: sub}, nil } // WatchURI is a free log subscription operation binding the contract event 0x6bb7ff708619ba0610cba295a58592e0451dee2622938c8755667688daf3529b. // // Solidity: event URI(string value, uint256 indexed id) func (_ERC1155 *ERC1155Filterer) WatchURI(opts *bind.WatchOpts, sink chan<- *ERC1155URI, id []*big.Int) (event.Subscription, error) { var idRule []interface{} for _, idItem := range id { idRule = append(idRule, idItem) } logs, sub, err := _ERC1155.contract.WatchLogs(opts, "URI", idRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(ERC1155URI) if err := _ERC1155.contract.UnpackLog(event, "URI", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseURI is a log parse operation binding the contract event 0x6bb7ff708619ba0610cba295a58592e0451dee2622938c8755667688daf3529b. // // Solidity: event URI(string value, uint256 indexed id) func (_ERC1155 *ERC1155Filterer) ParseURI(log types.Log) (*ERC1155URI, error) { event := new(ERC1155URI) if err := _ERC1155.contract.UnpackLog(event, "URI", log); err != nil { return nil, err } event.Raw = log return event, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/binds/erc20/erc20.go ================================================ // Code generated - DO NOT EDIT. // This file is a generated binding and any manual changes will be lost. package erc20 import ( "errors" "math/big" "strings" ethereum "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/event" ) // Reference imports to suppress errors if they are not otherwise used. var ( _ = errors.New _ = big.NewInt _ = strings.NewReader _ = ethereum.NotFound _ = bind.Bind _ = common.Big1 _ = types.BloomLookup _ = event.NewSubscription ) // Erc20MetaData contains all meta data concerning the Erc20 contract. var Erc20MetaData = &bind.MetaData{ ABI: "[{\"inputs\":[{\"internalType\":\"string\",\"name\":\"name_\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"symbol_\",\"type\":\"string\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"addedValue\",\"type\":\"uint256\"}],\"name\":\"increaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"subtractedValue\",\"type\":\"uint256\"}],\"name\":\"decreaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"dst\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"wad\",\"type\":\"uint256\"}],\"name\":\"Deposit\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"src\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"wad\",\"type\":\"uint256\"}],\"name\":\"Withdrawal\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"mint\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", } // Erc20ABI is the input ABI used to generate the binding from. // Deprecated: Use Erc20MetaData.ABI instead. var Erc20ABI = Erc20MetaData.ABI // Erc20 is an auto generated Go binding around an Ethereum contract. type Erc20 struct { Erc20Caller // Read-only binding to the contract Erc20Transactor // Write-only binding to the contract Erc20Filterer // Log filterer for contract events } // Erc20Caller is an auto generated read-only Go binding around an Ethereum contract. type Erc20Caller struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // Erc20Transactor is an auto generated write-only Go binding around an Ethereum contract. type Erc20Transactor struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // Erc20Filterer is an auto generated log filtering Go binding around an Ethereum contract events. type Erc20Filterer struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // Erc20Session is an auto generated Go binding around an Ethereum contract, // with pre-set call and transact options. type Erc20Session struct { Contract *Erc20 // Generic contract binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // Erc20CallerSession is an auto generated read-only Go binding around an Ethereum contract, // with pre-set call options. type Erc20CallerSession struct { Contract *Erc20Caller // Generic contract caller binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session } // Erc20TransactorSession is an auto generated write-only Go binding around an Ethereum contract, // with pre-set transact options. type Erc20TransactorSession struct { Contract *Erc20Transactor // Generic contract transactor binding to set the session for TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // Erc20Raw is an auto generated low-level Go binding around an Ethereum contract. type Erc20Raw struct { Contract *Erc20 // Generic contract binding to access the raw methods on } // Erc20CallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. type Erc20CallerRaw struct { Contract *Erc20Caller // Generic read-only contract binding to access the raw methods on } // Erc20TransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. type Erc20TransactorRaw struct { Contract *Erc20Transactor // Generic write-only contract binding to access the raw methods on } // NewErc20 creates a new instance of Erc20, bound to a specific deployed contract. func NewErc20(address common.Address, backend bind.ContractBackend) (*Erc20, error) { contract, err := bindErc20(address, backend, backend, backend) if err != nil { return nil, err } return &Erc20{Erc20Caller: Erc20Caller{contract: contract}, Erc20Transactor: Erc20Transactor{contract: contract}, Erc20Filterer: Erc20Filterer{contract: contract}}, nil } // NewErc20Caller creates a new read-only instance of Erc20, bound to a specific deployed contract. func NewErc20Caller(address common.Address, caller bind.ContractCaller) (*Erc20Caller, error) { contract, err := bindErc20(address, caller, nil, nil) if err != nil { return nil, err } return &Erc20Caller{contract: contract}, nil } // NewErc20Transactor creates a new write-only instance of Erc20, bound to a specific deployed contract. func NewErc20Transactor(address common.Address, transactor bind.ContractTransactor) (*Erc20Transactor, error) { contract, err := bindErc20(address, nil, transactor, nil) if err != nil { return nil, err } return &Erc20Transactor{contract: contract}, nil } // NewErc20Filterer creates a new log filterer instance of Erc20, bound to a specific deployed contract. func NewErc20Filterer(address common.Address, filterer bind.ContractFilterer) (*Erc20Filterer, error) { contract, err := bindErc20(address, nil, nil, filterer) if err != nil { return nil, err } return &Erc20Filterer{contract: contract}, nil } // bindErc20 binds a generic wrapper to an already deployed contract. func bindErc20(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { parsed, err := abi.JSON(strings.NewReader(Erc20ABI)) if err != nil { return nil, err } return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_Erc20 *Erc20Raw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _Erc20.Contract.Erc20Caller.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_Erc20 *Erc20Raw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _Erc20.Contract.Erc20Transactor.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_Erc20 *Erc20Raw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _Erc20.Contract.Erc20Transactor.contract.Transact(opts, method, params...) } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_Erc20 *Erc20CallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _Erc20.Contract.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_Erc20 *Erc20TransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _Erc20.Contract.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_Erc20 *Erc20TransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _Erc20.Contract.contract.Transact(opts, method, params...) } // Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. // // Solidity: function allowance(address owner, address spender) view returns(uint256) func (_Erc20 *Erc20Caller) Allowance(opts *bind.CallOpts, owner common.Address, spender common.Address) (*big.Int, error) { var out []interface{} err := _Erc20.contract.Call(opts, &out, "allowance", owner, spender) if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. // // Solidity: function allowance(address owner, address spender) view returns(uint256) func (_Erc20 *Erc20Session) Allowance(owner common.Address, spender common.Address) (*big.Int, error) { return _Erc20.Contract.Allowance(&_Erc20.CallOpts, owner, spender) } // Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. // // Solidity: function allowance(address owner, address spender) view returns(uint256) func (_Erc20 *Erc20CallerSession) Allowance(owner common.Address, spender common.Address) (*big.Int, error) { return _Erc20.Contract.Allowance(&_Erc20.CallOpts, owner, spender) } // BalanceOf is a free data retrieval call binding the contract method 0x70a08231. // // Solidity: function balanceOf(address account) view returns(uint256) func (_Erc20 *Erc20Caller) BalanceOf(opts *bind.CallOpts, account common.Address) (*big.Int, error) { var out []interface{} err := _Erc20.contract.Call(opts, &out, "balanceOf", account) if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // BalanceOf is a free data retrieval call binding the contract method 0x70a08231. // // Solidity: function balanceOf(address account) view returns(uint256) func (_Erc20 *Erc20Session) BalanceOf(account common.Address) (*big.Int, error) { return _Erc20.Contract.BalanceOf(&_Erc20.CallOpts, account) } // BalanceOf is a free data retrieval call binding the contract method 0x70a08231. // // Solidity: function balanceOf(address account) view returns(uint256) func (_Erc20 *Erc20CallerSession) BalanceOf(account common.Address) (*big.Int, error) { return _Erc20.Contract.BalanceOf(&_Erc20.CallOpts, account) } // Decimals is a free data retrieval call binding the contract method 0x313ce567. // // Solidity: function decimals() view returns(uint8) func (_Erc20 *Erc20Caller) Decimals(opts *bind.CallOpts) (uint8, error) { var out []interface{} err := _Erc20.contract.Call(opts, &out, "decimals") if err != nil { return *new(uint8), err } out0 := *abi.ConvertType(out[0], new(uint8)).(*uint8) return out0, err } // Decimals is a free data retrieval call binding the contract method 0x313ce567. // // Solidity: function decimals() view returns(uint8) func (_Erc20 *Erc20Session) Decimals() (uint8, error) { return _Erc20.Contract.Decimals(&_Erc20.CallOpts) } // Decimals is a free data retrieval call binding the contract method 0x313ce567. // // Solidity: function decimals() view returns(uint8) func (_Erc20 *Erc20CallerSession) Decimals() (uint8, error) { return _Erc20.Contract.Decimals(&_Erc20.CallOpts) } // Name is a free data retrieval call binding the contract method 0x06fdde03. // // Solidity: function name() view returns(string) func (_Erc20 *Erc20Caller) Name(opts *bind.CallOpts) (string, error) { var out []interface{} err := _Erc20.contract.Call(opts, &out, "name") if err != nil { return *new(string), err } out0 := *abi.ConvertType(out[0], new(string)).(*string) return out0, err } // Name is a free data retrieval call binding the contract method 0x06fdde03. // // Solidity: function name() view returns(string) func (_Erc20 *Erc20Session) Name() (string, error) { return _Erc20.Contract.Name(&_Erc20.CallOpts) } // Name is a free data retrieval call binding the contract method 0x06fdde03. // // Solidity: function name() view returns(string) func (_Erc20 *Erc20CallerSession) Name() (string, error) { return _Erc20.Contract.Name(&_Erc20.CallOpts) } // Symbol is a free data retrieval call binding the contract method 0x95d89b41. // // Solidity: function symbol() view returns(string) func (_Erc20 *Erc20Caller) Symbol(opts *bind.CallOpts) (string, error) { var out []interface{} err := _Erc20.contract.Call(opts, &out, "symbol") if err != nil { return *new(string), err } out0 := *abi.ConvertType(out[0], new(string)).(*string) return out0, err } // Symbol is a free data retrieval call binding the contract method 0x95d89b41. // // Solidity: function symbol() view returns(string) func (_Erc20 *Erc20Session) Symbol() (string, error) { return _Erc20.Contract.Symbol(&_Erc20.CallOpts) } // Symbol is a free data retrieval call binding the contract method 0x95d89b41. // // Solidity: function symbol() view returns(string) func (_Erc20 *Erc20CallerSession) Symbol() (string, error) { return _Erc20.Contract.Symbol(&_Erc20.CallOpts) } // TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. // // Solidity: function totalSupply() view returns(uint256) func (_Erc20 *Erc20Caller) TotalSupply(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} err := _Erc20.contract.Call(opts, &out, "totalSupply") if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. // // Solidity: function totalSupply() view returns(uint256) func (_Erc20 *Erc20Session) TotalSupply() (*big.Int, error) { return _Erc20.Contract.TotalSupply(&_Erc20.CallOpts) } // TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. // // Solidity: function totalSupply() view returns(uint256) func (_Erc20 *Erc20CallerSession) TotalSupply() (*big.Int, error) { return _Erc20.Contract.TotalSupply(&_Erc20.CallOpts) } // Approve is a paid mutator transaction binding the contract method 0x095ea7b3. // // Solidity: function approve(address spender, uint256 amount) returns(bool) func (_Erc20 *Erc20Transactor) Approve(opts *bind.TransactOpts, spender common.Address, amount *big.Int) (*types.Transaction, error) { return _Erc20.contract.Transact(opts, "approve", spender, amount) } // Approve is a paid mutator transaction binding the contract method 0x095ea7b3. // // Solidity: function approve(address spender, uint256 amount) returns(bool) func (_Erc20 *Erc20Session) Approve(spender common.Address, amount *big.Int) (*types.Transaction, error) { return _Erc20.Contract.Approve(&_Erc20.TransactOpts, spender, amount) } // Approve is a paid mutator transaction binding the contract method 0x095ea7b3. // // Solidity: function approve(address spender, uint256 amount) returns(bool) func (_Erc20 *Erc20TransactorSession) Approve(spender common.Address, amount *big.Int) (*types.Transaction, error) { return _Erc20.Contract.Approve(&_Erc20.TransactOpts, spender, amount) } // DecreaseAllowance is a paid mutator transaction binding the contract method 0xa457c2d7. // // Solidity: function decreaseAllowance(address spender, uint256 subtractedValue) returns(bool) func (_Erc20 *Erc20Transactor) DecreaseAllowance(opts *bind.TransactOpts, spender common.Address, subtractedValue *big.Int) (*types.Transaction, error) { return _Erc20.contract.Transact(opts, "decreaseAllowance", spender, subtractedValue) } // DecreaseAllowance is a paid mutator transaction binding the contract method 0xa457c2d7. // // Solidity: function decreaseAllowance(address spender, uint256 subtractedValue) returns(bool) func (_Erc20 *Erc20Session) DecreaseAllowance(spender common.Address, subtractedValue *big.Int) (*types.Transaction, error) { return _Erc20.Contract.DecreaseAllowance(&_Erc20.TransactOpts, spender, subtractedValue) } // DecreaseAllowance is a paid mutator transaction binding the contract method 0xa457c2d7. // // Solidity: function decreaseAllowance(address spender, uint256 subtractedValue) returns(bool) func (_Erc20 *Erc20TransactorSession) DecreaseAllowance(spender common.Address, subtractedValue *big.Int) (*types.Transaction, error) { return _Erc20.Contract.DecreaseAllowance(&_Erc20.TransactOpts, spender, subtractedValue) } // IncreaseAllowance is a paid mutator transaction binding the contract method 0x39509351. // // Solidity: function increaseAllowance(address spender, uint256 addedValue) returns(bool) func (_Erc20 *Erc20Transactor) IncreaseAllowance(opts *bind.TransactOpts, spender common.Address, addedValue *big.Int) (*types.Transaction, error) { return _Erc20.contract.Transact(opts, "increaseAllowance", spender, addedValue) } // IncreaseAllowance is a paid mutator transaction binding the contract method 0x39509351. // // Solidity: function increaseAllowance(address spender, uint256 addedValue) returns(bool) func (_Erc20 *Erc20Session) IncreaseAllowance(spender common.Address, addedValue *big.Int) (*types.Transaction, error) { return _Erc20.Contract.IncreaseAllowance(&_Erc20.TransactOpts, spender, addedValue) } // IncreaseAllowance is a paid mutator transaction binding the contract method 0x39509351. // // Solidity: function increaseAllowance(address spender, uint256 addedValue) returns(bool) func (_Erc20 *Erc20TransactorSession) IncreaseAllowance(spender common.Address, addedValue *big.Int) (*types.Transaction, error) { return _Erc20.Contract.IncreaseAllowance(&_Erc20.TransactOpts, spender, addedValue) } // Mint is a paid mutator transaction binding the contract method 0x40c10f19. // // Solidity: function mint(address account, uint256 amount) returns() func (_Erc20 *Erc20Transactor) Mint(opts *bind.TransactOpts, account common.Address, amount *big.Int) (*types.Transaction, error) { return _Erc20.contract.Transact(opts, "mint", account, amount) } // Mint is a paid mutator transaction binding the contract method 0x40c10f19. // // Solidity: function mint(address account, uint256 amount) returns() func (_Erc20 *Erc20Session) Mint(account common.Address, amount *big.Int) (*types.Transaction, error) { return _Erc20.Contract.Mint(&_Erc20.TransactOpts, account, amount) } // Mint is a paid mutator transaction binding the contract method 0x40c10f19. // // Solidity: function mint(address account, uint256 amount) returns() func (_Erc20 *Erc20TransactorSession) Mint(account common.Address, amount *big.Int) (*types.Transaction, error) { return _Erc20.Contract.Mint(&_Erc20.TransactOpts, account, amount) } // Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. // // Solidity: function transfer(address recipient, uint256 amount) returns(bool) func (_Erc20 *Erc20Transactor) Transfer(opts *bind.TransactOpts, recipient common.Address, amount *big.Int) (*types.Transaction, error) { return _Erc20.contract.Transact(opts, "transfer", recipient, amount) } // Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. // // Solidity: function transfer(address recipient, uint256 amount) returns(bool) func (_Erc20 *Erc20Session) Transfer(recipient common.Address, amount *big.Int) (*types.Transaction, error) { return _Erc20.Contract.Transfer(&_Erc20.TransactOpts, recipient, amount) } // Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. // // Solidity: function transfer(address recipient, uint256 amount) returns(bool) func (_Erc20 *Erc20TransactorSession) Transfer(recipient common.Address, amount *big.Int) (*types.Transaction, error) { return _Erc20.Contract.Transfer(&_Erc20.TransactOpts, recipient, amount) } // TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. // // Solidity: function transferFrom(address sender, address recipient, uint256 amount) returns(bool) func (_Erc20 *Erc20Transactor) TransferFrom(opts *bind.TransactOpts, sender common.Address, recipient common.Address, amount *big.Int) (*types.Transaction, error) { return _Erc20.contract.Transact(opts, "transferFrom", sender, recipient, amount) } // TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. // // Solidity: function transferFrom(address sender, address recipient, uint256 amount) returns(bool) func (_Erc20 *Erc20Session) TransferFrom(sender common.Address, recipient common.Address, amount *big.Int) (*types.Transaction, error) { return _Erc20.Contract.TransferFrom(&_Erc20.TransactOpts, sender, recipient, amount) } // TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. // // Solidity: function transferFrom(address sender, address recipient, uint256 amount) returns(bool) func (_Erc20 *Erc20TransactorSession) TransferFrom(sender common.Address, recipient common.Address, amount *big.Int) (*types.Transaction, error) { return _Erc20.Contract.TransferFrom(&_Erc20.TransactOpts, sender, recipient, amount) } // Erc20ApprovalIterator is returned from FilterApproval and is used to iterate over the raw logs and unpacked data for Approval events raised by the Erc20 contract. type Erc20ApprovalIterator struct { Event *Erc20Approval // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *Erc20ApprovalIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(Erc20Approval) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(Erc20Approval) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *Erc20ApprovalIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *Erc20ApprovalIterator) Close() error { it.sub.Unsubscribe() return nil } // Erc20Approval represents a Approval event raised by the Erc20 contract. type Erc20Approval struct { Owner common.Address Spender common.Address Value *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterApproval is a free log retrieval operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. // // Solidity: event Approval(address indexed owner, address indexed spender, uint256 value) func (_Erc20 *Erc20Filterer) FilterApproval(opts *bind.FilterOpts, owner []common.Address, spender []common.Address) (*Erc20ApprovalIterator, error) { var ownerRule []interface{} for _, ownerItem := range owner { ownerRule = append(ownerRule, ownerItem) } var spenderRule []interface{} for _, spenderItem := range spender { spenderRule = append(spenderRule, spenderItem) } logs, sub, err := _Erc20.contract.FilterLogs(opts, "Approval", ownerRule, spenderRule) if err != nil { return nil, err } return &Erc20ApprovalIterator{contract: _Erc20.contract, event: "Approval", logs: logs, sub: sub}, nil } // WatchApproval is a free log subscription operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. // // Solidity: event Approval(address indexed owner, address indexed spender, uint256 value) func (_Erc20 *Erc20Filterer) WatchApproval(opts *bind.WatchOpts, sink chan<- *Erc20Approval, owner []common.Address, spender []common.Address) (event.Subscription, error) { var ownerRule []interface{} for _, ownerItem := range owner { ownerRule = append(ownerRule, ownerItem) } var spenderRule []interface{} for _, spenderItem := range spender { spenderRule = append(spenderRule, spenderItem) } logs, sub, err := _Erc20.contract.WatchLogs(opts, "Approval", ownerRule, spenderRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(Erc20Approval) if err := _Erc20.contract.UnpackLog(event, "Approval", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseApproval is a log parse operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. // // Solidity: event Approval(address indexed owner, address indexed spender, uint256 value) func (_Erc20 *Erc20Filterer) ParseApproval(log types.Log) (*Erc20Approval, error) { event := new(Erc20Approval) if err := _Erc20.contract.UnpackLog(event, "Approval", log); err != nil { return nil, err } event.Raw = log return event, nil } // Erc20DepositIterator is returned from FilterDeposit and is used to iterate over the raw logs and unpacked data for Deposit events raised by the Erc20 contract. type Erc20DepositIterator struct { Event *Erc20Deposit // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *Erc20DepositIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(Erc20Deposit) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(Erc20Deposit) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *Erc20DepositIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *Erc20DepositIterator) Close() error { it.sub.Unsubscribe() return nil } // Erc20Deposit represents a Deposit event raised by the Erc20 contract. type Erc20Deposit struct { Dst common.Address Wad *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterDeposit is a free log retrieval operation binding the contract event 0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c. // // Solidity: event Deposit(address indexed dst, uint256 wad) func (_Erc20 *Erc20Filterer) FilterDeposit(opts *bind.FilterOpts, dst []common.Address) (*Erc20DepositIterator, error) { var dstRule []interface{} for _, dstItem := range dst { dstRule = append(dstRule, dstItem) } logs, sub, err := _Erc20.contract.FilterLogs(opts, "Deposit", dstRule) if err != nil { return nil, err } return &Erc20DepositIterator{contract: _Erc20.contract, event: "Deposit", logs: logs, sub: sub}, nil } // WatchDeposit is a free log subscription operation binding the contract event 0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c. // // Solidity: event Deposit(address indexed dst, uint256 wad) func (_Erc20 *Erc20Filterer) WatchDeposit(opts *bind.WatchOpts, sink chan<- *Erc20Deposit, dst []common.Address) (event.Subscription, error) { var dstRule []interface{} for _, dstItem := range dst { dstRule = append(dstRule, dstItem) } logs, sub, err := _Erc20.contract.WatchLogs(opts, "Deposit", dstRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(Erc20Deposit) if err := _Erc20.contract.UnpackLog(event, "Deposit", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseDeposit is a log parse operation binding the contract event 0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c. // // Solidity: event Deposit(address indexed dst, uint256 wad) func (_Erc20 *Erc20Filterer) ParseDeposit(log types.Log) (*Erc20Deposit, error) { event := new(Erc20Deposit) if err := _Erc20.contract.UnpackLog(event, "Deposit", log); err != nil { return nil, err } event.Raw = log return event, nil } // Erc20TransferIterator is returned from FilterTransfer and is used to iterate over the raw logs and unpacked data for Transfer events raised by the Erc20 contract. type Erc20TransferIterator struct { Event *Erc20Transfer // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *Erc20TransferIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(Erc20Transfer) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(Erc20Transfer) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *Erc20TransferIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *Erc20TransferIterator) Close() error { it.sub.Unsubscribe() return nil } // Erc20Transfer represents a Transfer event raised by the Erc20 contract. type Erc20Transfer struct { From common.Address To common.Address Value *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterTransfer is a free log retrieval operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. // // Solidity: event Transfer(address indexed from, address indexed to, uint256 value) func (_Erc20 *Erc20Filterer) FilterTransfer(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*Erc20TransferIterator, error) { var fromRule []interface{} for _, fromItem := range from { fromRule = append(fromRule, fromItem) } var toRule []interface{} for _, toItem := range to { toRule = append(toRule, toItem) } logs, sub, err := _Erc20.contract.FilterLogs(opts, "Transfer", fromRule, toRule) if err != nil { return nil, err } return &Erc20TransferIterator{contract: _Erc20.contract, event: "Transfer", logs: logs, sub: sub}, nil } // WatchTransfer is a free log subscription operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. // // Solidity: event Transfer(address indexed from, address indexed to, uint256 value) func (_Erc20 *Erc20Filterer) WatchTransfer(opts *bind.WatchOpts, sink chan<- *Erc20Transfer, from []common.Address, to []common.Address) (event.Subscription, error) { var fromRule []interface{} for _, fromItem := range from { fromRule = append(fromRule, fromItem) } var toRule []interface{} for _, toItem := range to { toRule = append(toRule, toItem) } logs, sub, err := _Erc20.contract.WatchLogs(opts, "Transfer", fromRule, toRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(Erc20Transfer) if err := _Erc20.contract.UnpackLog(event, "Transfer", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseTransfer is a log parse operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. // // Solidity: event Transfer(address indexed from, address indexed to, uint256 value) func (_Erc20 *Erc20Filterer) ParseTransfer(log types.Log) (*Erc20Transfer, error) { event := new(Erc20Transfer) if err := _Erc20.contract.UnpackLog(event, "Transfer", log); err != nil { return nil, err } event.Raw = log return event, nil } // Erc20WithdrawalIterator is returned from FilterWithdrawal and is used to iterate over the raw logs and unpacked data for Withdrawal events raised by the Erc20 contract. type Erc20WithdrawalIterator struct { Event *Erc20Withdrawal // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *Erc20WithdrawalIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(Erc20Withdrawal) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(Erc20Withdrawal) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *Erc20WithdrawalIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *Erc20WithdrawalIterator) Close() error { it.sub.Unsubscribe() return nil } // Erc20Withdrawal represents a Withdrawal event raised by the Erc20 contract. type Erc20Withdrawal struct { Src common.Address Wad *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterWithdrawal is a free log retrieval operation binding the contract event 0x7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65. // // Solidity: event Withdrawal(address indexed src, uint256 wad) func (_Erc20 *Erc20Filterer) FilterWithdrawal(opts *bind.FilterOpts, src []common.Address) (*Erc20WithdrawalIterator, error) { var srcRule []interface{} for _, srcItem := range src { srcRule = append(srcRule, srcItem) } logs, sub, err := _Erc20.contract.FilterLogs(opts, "Withdrawal", srcRule) if err != nil { return nil, err } return &Erc20WithdrawalIterator{contract: _Erc20.contract, event: "Withdrawal", logs: logs, sub: sub}, nil } // WatchWithdrawal is a free log subscription operation binding the contract event 0x7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65. // // Solidity: event Withdrawal(address indexed src, uint256 wad) func (_Erc20 *Erc20Filterer) WatchWithdrawal(opts *bind.WatchOpts, sink chan<- *Erc20Withdrawal, src []common.Address) (event.Subscription, error) { var srcRule []interface{} for _, srcItem := range src { srcRule = append(srcRule, srcItem) } logs, sub, err := _Erc20.contract.WatchLogs(opts, "Withdrawal", srcRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(Erc20Withdrawal) if err := _Erc20.contract.UnpackLog(event, "Withdrawal", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseWithdrawal is a log parse operation binding the contract event 0x7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65. // // Solidity: event Withdrawal(address indexed src, uint256 wad) func (_Erc20 *Erc20Filterer) ParseWithdrawal(log types.Log) (*Erc20Withdrawal, error) { event := new(Erc20Withdrawal) if err := _Erc20.contract.UnpackLog(event, "Withdrawal", log); err != nil { return nil, err } event.Raw = log return event, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/binds/erc20realworldagent/ERC20RealWorldAgent.go ================================================ // Code generated - DO NOT EDIT. // This file is a generated binding and any manual changes will be lost. package erc20realworldagent import ( "errors" "math/big" "strings" ethereum "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/event" ) // Reference imports to suppress errors if they are not otherwise used. var ( _ = errors.New _ = big.NewInt _ = strings.NewReader _ = ethereum.NotFound _ = bind.Bind _ = common.Big1 _ = types.BloomLookup _ = event.NewSubscription _ = abi.ConvertType ) // ERC20VotesCheckpoint is an auto generated low-level Go binding around an user-defined struct. type ERC20VotesCheckpoint struct { FromBlock uint32 Votes *big.Int } // IRealWorldAgentRequest is an auto generated low-level Go binding around an user-defined struct. type IRealWorldAgentRequest struct { Uuid [32]byte Creator common.Address Timeout uint32 Status uint8 Data []byte Result []byte } // ERC20RealWorldAgentMetaData contains all meta data concerning the ERC20RealWorldAgent contract. var ERC20RealWorldAgentMetaData = &bind.MetaData{ ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"name_\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"symbol_\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"amount_\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"recipient_\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"minFeeToUse_\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"timeout_\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"tokenFee_\",\"type\":\"address\",\"internalType\":\"contractIERC20\"},{\"name\":\"worker_\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"CLOCK_MODE\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"DOMAIN_SEPARATOR\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"act\",\"inputs\":[{\"name\":\"uuid\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"executeData\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"act\",\"inputs\":[{\"name\":\"uuid\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"data\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"allowance\",\"inputs\":[{\"name\":\"owner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"spender\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"approve\",\"inputs\":[{\"name\":\"spender\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"balanceOf\",\"inputs\":[{\"name\":\"account\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"checkpoints\",\"inputs\":[{\"name\":\"account\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"pos\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structERC20Votes.Checkpoint\",\"components\":[{\"name\":\"fromBlock\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"votes\",\"type\":\"uint224\",\"internalType\":\"uint224\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"clock\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint48\",\"internalType\":\"uint48\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"decimals\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint8\",\"internalType\":\"uint8\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"decreaseAllowance\",\"inputs\":[{\"name\":\"spender\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"subtractedValue\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"delegate\",\"inputs\":[{\"name\":\"delegatee\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"delegateBySig\",\"inputs\":[{\"name\":\"delegatee\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"nonce\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"expiry\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"v\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"r\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"s\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"delegates\",\"inputs\":[{\"name\":\"account\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"eip712Domain\",\"inputs\":[],\"outputs\":[{\"name\":\"fields\",\"type\":\"bytes1\",\"internalType\":\"bytes1\"},{\"name\":\"name\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"version\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"chainId\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"verifyingContract\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"salt\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"extensions\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getActId\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getHashToSign\",\"inputs\":[{\"name\":\"uuid\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"data\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getMinFeeToUse\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getPastTotalSupply\",\"inputs\":[{\"name\":\"timepoint\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getPastVotes\",\"inputs\":[{\"name\":\"account\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"timepoint\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getRequest\",\"inputs\":[{\"name\":\"actId\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIRealWorldAgent.Request\",\"components\":[{\"name\":\"uuid\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"creator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"timeout\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"status\",\"type\":\"uint8\",\"internalType\":\"enumIRealWorldAgent.RequestStatus\"},{\"name\":\"data\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"result\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getResultById\",\"inputs\":[{\"name\":\"uuid\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getVotes\",\"inputs\":[{\"name\":\"account\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"increaseAllowance\",\"inputs\":[{\"name\":\"spender\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"addedValue\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"name\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"nonces\",\"inputs\":[{\"name\":\"owner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"numCheckpoints\",\"inputs\":[{\"name\":\"account\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"owner\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"permit\",\"inputs\":[{\"name\":\"owner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"spender\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"value\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"deadline\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"v\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"r\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"s\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"renounceOwnership\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setMinFeeToUse\",\"inputs\":[{\"name\":\"minFeeToUse_\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setTimeout\",\"inputs\":[{\"name\":\"timeout_\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setTokenFee\",\"inputs\":[{\"name\":\"tokenFee_\",\"type\":\"address\",\"internalType\":\"contractIERC20\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setWorker\",\"inputs\":[{\"name\":\"newWorker\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"submitSolution\",\"inputs\":[{\"name\":\"actId\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"result\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"symbol\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"totalSupply\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"transfer\",\"inputs\":[{\"name\":\"to\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"transferFrom\",\"inputs\":[{\"name\":\"from\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"to\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"transferOwnership\",\"inputs\":[{\"name\":\"newOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"withdrawFeeToken\",\"inputs\":[{\"name\":\"to\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"Approval\",\"inputs\":[{\"name\":\"owner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"spender\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"value\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"DelegateChanged\",\"inputs\":[{\"name\":\"delegator\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"fromDelegate\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"toDelegate\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"DelegateVotesChanged\",\"inputs\":[{\"name\":\"delegate\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"previousBalance\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"newBalance\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"EIP712DomainChanged\",\"inputs\":[],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ExecutionRequested\",\"inputs\":[{\"name\":\"actId\",\"type\":\"uint256\",\"indexed\":true,\"internalType\":\"uint256\"},{\"name\":\"uuid\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"creator\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"data\",\"type\":\"bytes\",\"indexed\":false,\"internalType\":\"bytes\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OwnershipTransferred\",\"inputs\":[{\"name\":\"previousOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"newOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"SolutionSubmitted\",\"inputs\":[{\"name\":\"actId\",\"type\":\"uint256\",\"indexed\":true,\"internalType\":\"uint256\"},{\"name\":\"processor\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"result\",\"type\":\"bytes\",\"indexed\":false,\"internalType\":\"bytes\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Transfer\",\"inputs\":[{\"name\":\"from\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"to\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"value\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"WorkerUpdated\",\"inputs\":[{\"name\":\"oldWorker\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"newWorker\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"DuplicateUuid\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InsufficientBalance\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidAmount\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidExternalDataLength\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidRequestStatus\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidShortString\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidSignature\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidUuid\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"StringTooLong\",\"inputs\":[{\"name\":\"str\",\"type\":\"string\",\"internalType\":\"string\"}]},{\"type\":\"error\",\"name\":\"Timeout\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"Unauthorized\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"ZeroAddress\",\"inputs\":[]}]", Bin: "0x6101606040523461010957614208803803809161001b82610121565b610160396101008161016001911261010957610160516001600160401b038111610109578161004d9161016001610181565b6101805190916001600160401b0382116101095761006e9161016001610181565b906101a051916101c051610081816101d6565b6101e051610200519163ffffffff83168303610109576100b8956100a66102206101e7565b946100b26102406101e7565b966101f2565b6040516131f79081610fd1823960805181612522015260a051816125df015260c051816124ec015260e051816125710152610100518161259701526101205181610a0601526101405181610a2f0152f35b5f80fd5b634e487b7160e01b5f52604160045260245ffd5b610160601f91909101601f19168101906001600160401b0382119082101761014857604052565b61010d565b601f909101601f19168101906001600160401b0382119082101761014857604052565b6040519061017f60408361014d565b565b81601f82011215610109578051906001600160401b03821161014857604051926101b5601f8401601f19166020018561014d565b8284526020838301011161010957815f9260208093018386015e8301015290565b6001600160a01b0381160361010957565b519061017f826101d6565b979697959391959492946040519061020b60408361014d565b60018252603160f81b6020830190815281519093906001600160401b038111610148576102428161023d600354610405565b61043d565b6020601f8211600114610369579461030c9461017f9c9d98946102926102e79561028a866103379c976103599f9c5f9161035e575b508160011b915f199060031b1c19161790565b6003556104dc565b61029b33610825565b6102a4816105e0565b610120526102b1826106d5565b610140526020815191012060e052519020610100524660a0526102d26107c7565b6080523060c0526102e2876105c1565b600d55565b6010805463ffffffff60a01b191660a09290921b63ffffffff60a01b16919091179055565b6103155f600e55565b601280546001600160a01b0319166001600160a01b0392909216919091179055565b601080546001600160a01b0319166001600160a01b0392909216919091179055565b6108d2565b90508501515f610277565b60035f52601f198216907fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b915f5b8181106103ed57509461029261017f9e9f9a96956001866103599e9b9661030c9b966103379e996102e79b106103d5575b5050811b016003556104dc565b8601515f1960f88460031b161c191690555f806103c8565b9192602060018192868a015181550194019201610397565b90600182811c92168015610433575b602083101461041f57565b634e487b7160e01b5f52602260045260245ffd5b91607f1691610414565b601f8111610449575050565b60035f5260205f20906020601f840160051c83019310610483575b601f0160051c01905b818110610478575050565b5f815560010161046d565b9091508190610464565b601f821161049a57505050565b5f5260205f20906020601f840160051c830193106104d2575b601f0160051c01905b8181106104c7575050565b5f81556001016104bc565b90915081906104b3565b80519091906001600160401b03811161014857610505816104fe600454610405565b600461048d565b602092601f821160011461054557610535929382915f9261053a575b50508160011b915f199060031b1c19161790565b600455565b015190505f80610521565b60045f52601f198216937f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b915f5b8681106105a95750836001959610610591575b505050811b01600455565b01515f1960f88460031b161c191690555f8080610586565b91926020600181928685015181550194019201610573565b6001600160a01b0316156105d157565b63d92e233d60e01b5f5260045ffd5b908151602081105f146105fb5750906105f8906109b6565b90565b6001600160401b0381116101485761061f81610618600654610405565b600661048d565b602092601f82116001146106565761064e929382915f9261053a5750508160011b915f199060031b1c19161790565b60065560ff90565b60065f52601f198216937ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f915f5b8681106106bd57508360019596106106a5575b505050811b0160065560ff90565b01515f1960f88460031b161c191690555f8080610697565b91926020600181928685015181550194019201610684565b908151602081105f146106ed5750906105f8906109b6565b6001600160401b038111610148576107118161070a600754610405565b600761048d565b602092601f821160011461074857610740929382915f9261053a5750508160011b915f199060031b1c19161790565b60075560ff90565b60075f52601f198216937fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c688915f5b8681106107af5750836001959610610797575b505050811b0160075560ff90565b01515f1960f88460031b161c191690555f8080610789565b91926020600181928685015181550194019201610776565b60e051610100516040519060208201927f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f8452604083015260608201524660808201523060a082015260a0815261081f60c08261014d565b51902090565b600580546001600160a01b039283166001600160a01b0319821681179092559091167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3565b1561087457565b60405162461bcd60e51b815260206004820152603060248201527f4552433230566f7465733a20746f74616c20737570706c79207269736b73206f60448201526f766572666c6f77696e6720766f74657360801b6064820152608490fd5b906001600160a01b03821680156109715760025482810180911161096c576109689361094d926109028593600255565b6001600160a01b0382165f90815260208181526040808320805487019055518581527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9190a3610e3d565b600254610963906001600160e01b03101561086d565b610acb565b5050565b610a21565b60405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606490fd5b601f8151116109e15760208151910151602082106109d2571790565b5f198260200360031b1b161790565b604460209160405192839163305a27a960e01b83528160048401528051918291826024860152018484015e5f828201840152601f01601f19168101030190fd5b634e487b7160e01b5f52601160045260245ffd5b604080519192919081016001600160401b0381118282101761014857604052602081935463ffffffff81168352811c910152565b908154680100000000000000008110156101485760018101808455811015610ab7575f92835260209283902082519284015190931b63ffffffff191663ffffffff9290921691909117910155565b634e487b7160e01b5f52603260045260245ffd5b600c5490918115918215610be457610ae1610170565b5f81525f60208201525b6020810151610b1790610b0e906001600160e01b03165b6001600160e01b031690565b95866001610f91565b93159081610bc1575b5015610b645761017f90610b4d610b3685610dce565b600c5f52915f5160206141c85f395f51905f520190565b9063ffffffff82549181199060201b169116179055565b5061017f610b87610b82610b7743610f25565b65ffffffffffff1690565b610d66565b610bba610b9385610dce565b610baa610b9e610170565b63ffffffff9094168452565b6001600160e01b03166020830152565b600c610a69565b5163ffffffff16905063ffffffff610bdb610b7743610f25565b9116145f610b20565b600c5f52610c055f5160206141c85f395f51905f528201610a35565b610a35565b610aeb565b9091815491821592835f14610ced57610c21610170565b5f81525f60208201525b6020810151610c4f90610c46906001600160e01b0316610b02565b96876002610f91565b94159081610cca575b5015610c7d57610b4d61017f92610c6e86610dce565b925f1901905f5260205f200190565b5061017f90610c91610b82610b7743610f25565b90610cc5610c9e86610dce565b610cb5610ca9610170565b63ffffffff9095168552565b6001600160e01b03166020840152565b610a69565b5163ffffffff16905063ffffffff610ce4610b7743610f25565b9116145f610c58565b610d02610c005f198301845f5260205f200190565b610c2b565b9091815491821592835f14610d4c57610d1e610170565b5f81525f60208201525b6020810151610c4f90610d43906001600160e01b0316610b02565b96876001610f91565b610d61610c005f198301845f5260205f200190565b610d28565b63ffffffff8111610d7a5763ffffffff1690565b60405162461bcd60e51b815260206004820152602660248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203360448201526532206269747360d01b6064820152608490fd5b6001600160e01b038111610de8576001600160e01b031690565b60405162461bcd60e51b815260206004820152602760248201527f53616665436173743a2076616c756520646f65736e27742066697420696e20326044820152663234206269747360c81b6064820152608490fd5b600a6020527f13da86008ba1c6922daee3e07db95305ef49ebced9f5467a0b8613fcc6b343e3546001600160a01b039182165f908152604090205482169291168281141580610f1c575b610e9057505050565b80610ee2575b5081610ea0575050565b6001600160a01b0382165f908152600b602052604090205f5160206141e85f395f51905f5291610ecf91610d07565b60408051928352602083019190915290a2565b805f52600b6020525f5160206141e85f395f51905f52610f058360405f20610c0a565b60408051928352602083019190915290a25f610e96565b50811515610e87565b65ffffffffffff8111610f3d5765ffffffffffff1690565b60405162461bcd60e51b815260206004820152602660248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203460448201526538206269747360d01b6064820152608490fd5b91909180600114610fc357600214610fb757634e487b7160e01b5f52605160045260245ffd5b810390811161096c5790565b50810180911161096c579056fe60806040526004361015610011575f80fd5b5f3560e01c806306fdde03146102a4578063095ea7b31461029f57806318160ddd1461029a5780631af09a2b1461029557806323b872dd14610290578063241da1c01461028b578063313ce567146102865780633644e51514610281578063365bec7f1461027c57806339509351146102775780633a46b1a8146102725780634bf5d7e91461026d578063587cde1e146102685780635c19a95c146102635780636fcfff451461025e57806370a0823114610259578063715018a6146102545780637ecebe001461024f57806384b0196e1461024a5780638da5cb5b146102455780638e539e8c1461024057806391ddadf41461023b57806395d89b41146102365780639aa474ed146102315780639ab24eb01461022c578063a457c2d714610227578063a9059cbb14610222578063af5e3be01461021d578063b2ef14e314610218578063c26f6d4414610213578063c3cda5201461020e578063c58343ef14610209578063d19834fc14610204578063d505accf146101ff578063dc80d104146101fa578063dd62ed3e146101f5578063e0839ca1146101f0578063e84dee6b146101eb578063f1127ed8146101e6578063f2fde38b146101e15763fea5ef99146101dc575f80fd5b611923565b611853565b6117ce565b6116ad565b61166e565b611513565b6114c5565b61136f565b6112e4565b6111f4565b61102e565b610f99565b610ecf565b610eae565b610e84565b610dd6565b610d54565b610d37565b610c92565b610c67565b610b13565b610aeb565b6109ee565b6109b3565b610958565b61091e565b6108d5565b6108ad565b61086a565b6107b7565b61066a565b61060b565b6105a0565b61057e565b610563565b610510565b61043f565b610422565b610405565b6103d0565b6102e1565b805180835260209291819084018484015e5f828201840152601f01601f1916010190565b9060206102de9281815201906102a9565b90565b346103bb575f3660031901126103bb576040515f600354610301816119ba565b80845290600181169081156103975750600114610339575b61033583610329818503826115c1565b604051918291826102cd565b0390f35b60035f9081527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b939250905b80821061037d57509091508101602001610329610319565b919260018160209254838588010152019101909291610365565b60ff191660208086019190915291151560051b840190910191506103299050610319565b5f80fd5b6001600160a01b038116036103bb57565b346103bb5760403660031901126103bb576103fa6004356103f0816103bf565b602435903361217f565b602060405160018152f35b346103bb575f3660031901126103bb576020600254604051908152f35b346103bb575f3660031901126103bb576020600e54604051908152f35b346103bb5760603660031901126103bb5760043561045c816103bf565b602435610468816103bf565b6001600160a01b0382165f9081526001602081815260408084203385529091529091205492604435929184016104af575b6104a39350612364565b60405160018152602090f35b8284106104cb576104c6836104a39503338361217f565b610499565b60405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606490fd5b346103bb5760203660031901126103bb5760043561052d816103bf565b610535612472565b6001600160a01b0316610547816124ca565b6bffffffffffffffffffffffff60a01b60125416176012555f80f35b346103bb575f3660031901126103bb57602060405160128152f35b346103bb575f3660031901126103bb5760206105986124e9565b604051908152f35b346103bb5760203660031901126103bb57600435805f52600f60205260405f2054156105fc575f52600f60205260405f20545f5260116020526103356105f5610329600360405f2001604051928380926119f2565b03826115c1565b6341ba517160e11b5f5260045ffd5b346103bb5760403660031901126103bb57600435610628816103bf565b602435335f5260016020526106508260405f209060018060a01b03165f5260205260405f2090565b54908101809111610665576103fa913361217f565b61197e565b346103bb5760403660031901126103bb57600435610687816103bf565b602435906106a665ffffffffffff61069e43612770565b168310611a8e565b6001600160a01b03165f908152600b6020526040812080549290918360058111610768575b50905b838210610719575050816106f557505060205f5b6040516001600160e01b03919091168152f35b61070d610714916020935f1901905f5260205f200190565b5460201c90565b6106e2565b90926107258185612a2e565b908263ffffffff61074861073e85885f5260205f200190565b5463ffffffff1690565b1611156107585750925b906106ce565b935061076390611992565b610752565b8061077861077e929693966128bb565b906119ad565b908263ffffffff61079761073e85885f5260205f200190565b1611156107a75750925b5f6106cb565b93506107b290611992565b6107a1565b346103bb575f3660031901126103bb574365ffffffffffff6107d843612770565b1603610825576103356040516107ef6040826115c1565b601d81527f6d6f64653d626c6f636b6e756d6265722666726f6d3d64656661756c740000006020820152604051918291826102cd565b60405162461bcd60e51b815260206004820152601d60248201527f4552433230566f7465733a2062726f6b656e20636c6f636b206d6f64650000006044820152606490fd5b346103bb5760203660031901126103bb57600435610887816103bf565b60018060a01b03165f52600a602052602060018060a01b0360405f205416604051908152f35b346103bb5760203660031901126103bb576108d36004356108cd816103bf565b33612605565b005b346103bb5760203660031901126103bb576004356108f2816103bf565b60018060a01b03165f52600b602052602061091060405f2054612678565b63ffffffff60405191168152f35b346103bb5760203660031901126103bb5760043561093b816103bf565b60018060a01b03165f525f602052602060405f2054604051908152f35b346103bb575f3660031901126103bb57610970612472565b600580546001600160a01b031981169091555f906001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a3005b346103bb5760203660031901126103bb576004356109d0816103bf565b60018060a01b03165f526008602052602060405f2054604051908152f35b346103bb575f3660031901126103bb57610a92610a2a7f00000000000000000000000000000000000000000000000000000000000000006126e0565b610a537f0000000000000000000000000000000000000000000000000000000000000000612739565b6020604051610a6282826115c1565b5f815281610aa081830194601f198301368737604051978897600f60f81b895260e0858a015260e08901906102a9565b9087820360408901526102a9565b914660608701523060808701525f60a087015285830360c087015251918281520192915f5b828110610ad457505050500390f35b835185528695509381019392810192600101610ac5565b346103bb575f3660031901126103bb576005546040516001600160a01b039091168152602090f35b346103bb5760203660031901126103bb57600435610b4265ffffffffffff610b3a43612770565b168210611a8e565b600c54905f8260058111610c01575b50905b828210610b9f578280610b6d57506040515f8152602090f35b600c5f52602090610714907fdf6966c971051c3d54ec59162606531493a51404a002842f56009d7e5cf4a8c60161070d565b9091610bab8184612a2e565b600c5f52908263ffffffff610be17fdf6966c971051c3d54ec59162606531493a51404a002842f56009d7e5cf4a8c7850161073e565b161115610bf15750915b90610b54565b9250610bfc90611992565b610beb565b80610778610c11929593956128bb565b600c5f52908263ffffffff610c477fdf6966c971051c3d54ec59162606531493a51404a002842f56009d7e5cf4a8c7850161073e565b161115610c575750915b5f610b51565b9250610c6290611992565b610c51565b346103bb575f3660031901126103bb576020610c8243612770565b65ffffffffffff60405191168152f35b346103bb575f3660031901126103bb576040515f600454610cb2816119ba565b80845290600181169081156103975750600114610cd95761033583610329818503826115c1565b60045f9081527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b939250905b808210610d1d57509091508101602001610329610319565b919260018160209254838588010152019101909291610d05565b346103bb575f3660031901126103bb576020600d54604051908152f35b346103bb5760203660031901126103bb57600435610d71816103bf565b6001600160a01b03165f818152600b60205260409020549081610daf5750506103355f5b6040516001600160e01b0390911681529081906020820190565b61033591610dcc915f52600b60205260405f20905f190190611ada565b505460201c610d95565b346103bb5760403660031901126103bb57600435610df3816103bf565b60243590335f526001602052610e1c8160405f209060018060a01b03165f5260205260405f2090565b5491808310610e31576104a39203903361217f565b60405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608490fd5b346103bb5760403660031901126103bb576103fa600435610ea4816103bf565b6024359033612364565b346103bb5760203660031901126103bb57600435610eca612472565b600d55005b346103bb5760403660031901126103bb57600435610eec816103bf565b602435610ef7612472565b8015610f8a576012546040516370a0823160e01b81523060048201526001600160a01b039091169290602081602481875afa908115610f85575f91610f56575b508211610f47576108d3926127dc565b631e9acf1760e31b5f5260045ffd5b610f78915060203d602011610f7e575b610f7081836115c1565b810190611b03565b5f610f37565b503d610f66565b611b12565b63162908e360e11b5f5260045ffd5b346103bb5760203660031901126103bb57600435610fb6816103bf565b610fbe612472565b610fc7816124ca565b6010546001600160a01b0391821691829082167f98b88aa89cb5f247008e613dc8529d633ab05a62f7120c07ebcfcdd852fc2a8d5f80a36001600160a01b03191617601055005b6064359060ff821682036103bb57565b6084359060ff821682036103bb57565b346103bb5760c03660031901126103bb5760043561104b816103bf565b6044359060243561105a61100e565b6084359360a435814211611117576108d395611112936110e5876110cf6110dd6110ea976040519283918c60208401968760609194939260808201957fe48329057bfd03d55e49b547132e39cffd9c1820ad7b9d4c5307691425d15adf835260018060a01b0316602083015260408201520152565b03601f1981018352826115c1565b51902061281c565b612842565b6001600160a01b0381165f908152600860205260409020805460018101909155909214611b1d565b612605565b60405162461bcd60e51b815260206004820152601d60248201527f4552433230566f7465733a207369676e617475726520657870697265640000006044820152606490fd5b634e487b7160e01b5f52602160045260245ffd5b6004111561117a57565b61115c565b90602082528051602083015260018060a01b03602082015116604083015263ffffffff6040820151166060830152606081015191600483101561117a576102de92608082015260a06111df608084015160c08385015260e08401906102a9565b9201519060c0601f19828503019101526102a9565b346103bb5760203660031901126103bb57600435606060a060405161121881611586565b5f81525f60208201525f60408201525f8382015282608082015201525f52601160205261033560405f206112a660036040519261125484611586565b8054845260018101546001600160a01b038116602086015260a081901c63ffffffff16604086015261128f9060c01c60ff1660608601611b69565b61129b60028201611a73565b608085015201611a73565b60a08201526040519182918261117f565b9181601f840112156103bb578235916001600160401b0383116103bb57602083818601950101116103bb57565b346103bb5760403660031901126103bb576004356024356001600160401b0381116103bb576113179036906004016112b7565b909160418210611360576040198201828111610665576103359361134a61134361135095848185611b75565b369161161d565b92611fe7565b6040519081529081906020820190565b63099f6dd560e31b5f5260045ffd5b346103bb5760e03660031901126103bb5760043561138c816103bf565b602435611398816103bf565b60443590606435926113a861101e565b60a4359460c43581421161146d576108d396611468936110e586896110dd8a6110cf611455996113f18660018060a01b03165f52600860205260405f2090815491600183019055565b604051958694602086019889919260a093969594919660c08401977f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98552600180871b03166020850152600180861b03166040840152606083015260808201520152565b6001600160a01b03838116911614611b8d565b61217f565b60405162461bcd60e51b815260206004820152601d60248201527f45524332305065726d69743a206578706972656420646561646c696e650000006044820152606490fd5b6024359063ffffffff821682036103bb57565b346103bb5760203660031901126103bb5760043563ffffffff811681036103bb576114ee612472565b6010805463ffffffff60a01b191660a09290921b63ffffffff60a01b16919091179055005b346103bb5760403660031901126103bb576020611569600435611535816103bf565b60243590611542826103bf565b60018060a01b03165f526001835260405f209060018060a01b03165f5260205260405f2090565b54604051908152f35b634e487b7160e01b5f52604160045260245ffd5b60c081019081106001600160401b038211176115a157604052565b611572565b604081019081106001600160401b038211176115a157604052565b90601f801991011681019081106001600160401b038211176115a157604052565b604051906115f160c0836115c1565b565b604051906115f16040836115c1565b6001600160401b0381116115a157601f01601f191660200190565b92919261162982611602565b9161163760405193846115c1565b8294818452818301116103bb578281602093845f960137010152565b9080601f830112156103bb578160206102de9335910161161d565b346103bb5760403660031901126103bb576004356024356001600160401b0381116103bb576020916116a7610598923690600401611653565b90611bd9565b346103bb5760403660031901126103bb576004356024356001600160401b0381116103bb576116e09036906004016112b7565b6116f48392935f52601160205260405f2090565b60018101908154600161170b8260ff9060c01c1690565b61171481611170565b036117bf576117309060a01c63ffffffff165b63ffffffff1690565b42116117b0576010546001600160a01b031633036117a25761176d92600361175a92019586611c78565b805460ff60c01b1916600160c11b179055565b7f847d58c674038bb7f3ec4f6bbd97d64a3da0f3db4312900c67a2778f0b2840ba6040518061179d339582611d64565b0390a3005b6282b42960e81b5f5260045ffd5b63055e18ff60e31b5f5260045ffd5b632efb6afd60e01b5f5260045ffd5b346103bb5760403660031901126103bb57604061182f6118296004356117f3816103bf565b6117fb6114b2565b905f6020865161180a816115a6565b82815201526001600160a01b03165f908152600b602052849020611ada565b50611d75565b8151815163ffffffff1681526020918201516001600160e01b031691810191909152f35b346103bb5760203660031901126103bb57600435611870816103bf565b611878612472565b6001600160a01b038116156118cf57600580546001600160a01b039283166001600160a01b0319821681179092559091167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3005b60405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608490fd5b346103bb5760603660031901126103bb576004356024356001600160401b0381116103bb576119569036906004016112b7565b9091604435916001600160401b0383116103bb5760209361134a610598943690600401611653565b634e487b7160e01b5f52601160045260245ffd5b906001820180921161066557565b9190820180921161066557565b9190820391821161066557565b90600182811c921680156119e8575b60208310146119d457565b634e487b7160e01b5f52602260045260245ffd5b91607f16916119c9565b5f9291815491611a01836119ba565b8083529260018116908115611a565750600114611a1d57505050565b5f9081526020812093945091925b838310611a3c575060209250010190565b600181602092949394548385870101520191019190611a2b565b915050602093945060ff929192191683830152151560051b010190565b906115f1611a8792604051938480926119f2565b03836115c1565b15611a9557565b60405162461bcd60e51b815260206004820152601960248201527f4552433230566f7465733a20667574757265206c6f6f6b7570000000000000006044820152606490fd5b8054821015611aef575f5260205f2001905f90565b634e487b7160e01b5f52603260045260245ffd5b908160209103126103bb575190565b6040513d5f823e3d90fd5b15611b2457565b60405162461bcd60e51b815260206004820152601960248201527f4552433230566f7465733a20696e76616c6964206e6f6e6365000000000000006044820152606490fd5b600482101561117a5752565b909392938483116103bb5784116103bb578101920390565b15611b9457565b60405162461bcd60e51b815260206004820152601e60248201527f45524332305065726d69743a20696e76616c6964207369676e617475726500006044820152606490fd5b6102de91602081519101206040519060208201927fbf842cb9fe7273c2aac2391f36077927eaae4fffb9d035401f660ed5e6aef4bd845260408301526060820152606081526110dd6080826115c1565b601f8211611c3657505050565b5f5260205f20906020601f840160051c83019310611c6e575b601f0160051c01905b818110611c63575050565b5f8155600101611c58565b9091508190611c4f565b9092916001600160401b0381116115a157611c9d81611c9784546119ba565b84611c29565b5f601f8211600114611cdb578190611ccc9394955f92611cd0575b50508160011b915f199060031b1c19161790565b9055565b013590505f80611cb8565b601f19821694611cee845f5260205f2090565b915f5b878110611d28575083600195969710611d0f575b505050811b019055565b01355f19600384901b60f8161c191690555f8080611d05565b90926020600181928686013581550194019101611cf1565b90600481101561117a57815460ff60c01b191660c09190911b60ff60c01b16179055565b9060206102de9281815201906119f2565b90604051611d82816115a6565b602081935463ffffffff81168352811c910152565b5f1981146106655760010190565b90918060409360208452816020850152848401375f828201840152601f01601f1916010190565b60405190611ddb6020836115c1565b5f808352366020840137565b91909182516001600160401b0381116115a157611e0881611c9784546119ba565b6020601f8211600114611e42578190611ccc9394955f92611e375750508160011b915f199060031b1c19161790565b015190505f80611cb8565b601f19821690611e55845f5260205f2090565b915f5b818110611e8e57509583600195969710611e7657505050811b019055565b01515f1960f88460031b161c191690555f8080611d05565b9192602060018192868b015181550194019201611e58565b81518155602082015160018201805460408501516001600160a01b039093166001600160c01b03199091161760a09290921b63ffffffff60a01b169190911781556060830151919291600481101561117a57611f0191611d40565b6002820160808201518051906001600160401b0382116115a157611f2f82611f2985546119ba565b85611c29565b602090601f8311600114611f745792611f688360a0946115f19897946003975f92611e375750508160011b915f199060031b1c19161790565b90555b01519101611de7565b90601f19831691611f88855f5260205f2090565b925f5b818110611fcf5750936115f1979693600396936001938360a09810611fb8575b505050811b019055611f6b565b01515f1983891b60f8161c191690555f8080611fab565b92936020600181928786015181550195019301611f8b565b90611ffa825f52600f60205260405f2090565b546121705761206161200d600e54611d97565b9461201786600e55565b8561202a855f52600f60205260405f2090565b55600d5480612145575b5061204961204336878661161d565b85611bd9565b602082015190606060408401519301515f1a90612842565b906001600160a01b038216908115612136576102de946121159285887f9096741026bdd638bcc5cb995f0f00b4574b81f120a23c4a7086347116bf58a1604051806120ad878983611da5565b0390a46121096120d56117276120cf61172760105463ffffffff9060a01c1690565b426119a0565b6120fc6120e0611dcc565b966120e96115e2565b9889526001600160a01b03166020890152565b63ffffffff166040870152565b60016060860152611343565b608083015260a0820152612131835f52601160205260405f2090565b611ea6565b638baa579f60e01b5f5260045ffd5b60125461216a91906001600160a01b03166010546001600160a01b0316903390612859565b5f612034565b63339f7ff560e01b5f5260045ffd5b6001600160a01b03811691908215612260576001600160a01b03821693841561221057806121fa7f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925946121e561220b9560018060a01b03165f52600160205260405f2090565b9060018060a01b03165f5260205260405f2090565b556040519081529081906020820190565b0390a3565b60405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608490fd5b60405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608490fd5b156122b857565b60405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608490fd5b1561231057565b60405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608490fd5b6001600160a01b038116929190831561241f576115f1936001600160a01b038316906123918215156122b1565b6001600160a01b0383165f9081526020819052604090208590546123b782821015612309565b036123d18460018060a01b03165f525f60205260405f2090565b556001600160a01b0384165f908152602081815260409182902080548801905590518681527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9190a3612f2e565b60405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608490fd5b6005546001600160a01b0316330361248657565b606460405162461bcd60e51b815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b6001600160a01b0316156124da57565b63d92e233d60e01b5f5260045ffd5b307f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031614806125dc575b15612544577f000000000000000000000000000000000000000000000000000000000000000090565b60405160208101907f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f82527f000000000000000000000000000000000000000000000000000000000000000060408201527f000000000000000000000000000000000000000000000000000000000000000060608201524660808201523060a082015260a081526125d660c0826115c1565b51902090565b507f0000000000000000000000000000000000000000000000000000000000000000461461251b565b6001600160a01b039081165f818152600a60208181526040808420805485845291852054939092528686166001600160a01b0319821681179092556115f19692959294921692909183917f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f9080a4612a43565b63ffffffff811161268c5763ffffffff1690565b60405162461bcd60e51b815260206004820152602660248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203360448201526532206269747360d01b6064820152608490fd5b60ff81146127265760ff811690601f821161271757604051916127046040846115c1565b6020808452838101919036833783525290565b632cd44ac360e21b5f5260045ffd5b506040516102de816105f58160066119f2565b60ff811461275d5760ff811690601f821161271757604051916127046040846115c1565b506040516102de816105f58160076119f2565b65ffffffffffff81116127885765ffffffffffff1690565b60405162461bcd60e51b815260206004820152602660248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203460448201526538206269747360d01b6064820152608490fd5b60405163a9059cbb60e01b60208201526001600160a01b0390921660248301526044808301939093529181526115f1916128176064836115c1565b612ccc565b6042906128276124e9565b906040519161190160f01b8352600283015260228201522090565b916102de939161285193612d84565b919091612e09565b6040516323b872dd60e01b60208201526001600160a01b0392831660248201529290911660448301526064808301939093529181526115f1916128176084836115c1565b81156128a7570490565b634e487b7160e01b5f52601260045260245ffd5b8015612a29576102de906129bf6129b86129ae6129a461299a61299061298661297c600161296a5f8b608081901c80612a1b575b50806128fe6129609260401c90565b80612a0e575b5061290f8160201c90565b80612a01575b506129208160101c90565b806129f4575b506129318160081c90565b806129e7575b506129428160041c90565b806129da575b506129538160021c90565b806129cd575b5060011c90565b6129c55760011c90565b1b612975818b61289d565b0160011c90565b612975818a61289d565b612975818961289d565b612975818861289d565b612975818761289d565b612975818661289d565b612975818561289d565b809261289d565b90612f5f565b820160011c90565b600291509201915f612959565b600491509201915f612948565b600891509201915f612937565b601091509201915f612926565b602091509201915f612915565b604091509201915f612904565b6080925090506129606128ef565b505f90565b90808216911860011c81018091116106655790565b6001600160a01b03808316939291168084141580612c4c575b612a67575b50505050565b80612ad4575b5082612a7a575b80612a61565b6001600160a01b03165f908152600b602052604090207fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a72491612abb91612fcd565b60408051928352602083019190915290a25f8080612a74565b805f52600b6020527fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a72460405f208054801591825f14612c2c57612b156115f3565b5f81525f6020820152915b6020830151612b3f906001600160e01b03165b6001600160e01b031690565b92612b4c89856002613182565b94159081612c09575b5015612ba757612b7a612b9192612b6b86613082565b925f1901905f5260205f200190565b9063ffffffff82549181199060201b169116179055565b604080519182526020820192909252a25f612a6d565b50612c0490612bcb612bc6612bbb43612770565b65ffffffffffff1690565b612678565b90612bff612bd886613082565b612bef612be36115f3565b63ffffffff9095168552565b6001600160e01b03166020840152565b612f71565b612b91565b5163ffffffff16905063ffffffff612c23612bbb43612770565b9116145f612b55565b612c46612c415f198401835f5260205f200190565b611d75565b91612b20565b50821515612a5c565b908160209103126103bb575180151581036103bb5790565b15612c7457565b60405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608490fd5b6115f191612d4e9160018060a01b03165f8060405193612ced6040866115c1565b602085527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564602086015260208151910182855af13d15612d7c573d91612d3283611602565b92612d4060405194856115c1565b83523d5f602085013e6130f1565b8051908115918215612d62575b5050612c6d565b612d759250602080918301019101612c55565b5f80612d5b565b6060916130f1565b7f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08411612df4576020935f9360ff60809460405194855216868401526040830152606082015282805260015afa15610f85575f516001600160a01b03811615612dec57905f90565b505f90600190565b505050505f90600390565b6005111561117a57565b612e1281612dff565b80612e1a5750565b612e2381612dff565b60018103612e755760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015280606481015b0390fd5b612e7e81612dff565b60028103612ecb5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606490fd5b80612ed7600392612dff565b14612ede57565b60405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608490fd5b6001600160a01b039081165f908152600a60205260408082205493831682529020546115f193929082169116612a43565b9080821015612f6c575090565b905090565b8054680100000000000000008110156115a157612f9391600182018155611ada565b612fba57815160209283015190921b63ffffffff191663ffffffff92909216919091179055565b634e487b7160e01b5f525f60045260245ffd5b9091815491821592835f1461306857612fe46115f3565b5f81525f60208201525b602081015161301290613009906001600160e01b0316612b33565b96876001613182565b94159081613045575b501561303157612b7a6115f192612b6b86613082565b506115f190612bcb612bc6612bbb43612770565b5163ffffffff16905063ffffffff61305f612bbb43612770565b9116145f61301b565b61307d612c415f198301845f5260205f200190565b612fee565b6001600160e01b03811161309c576001600160e01b031690565b60405162461bcd60e51b815260206004820152602760248201527f53616665436173743a2076616c756520646f65736e27742066697420696e20326044820152663234206269747360c81b6064820152608490fd5b919290156131535750815115613105575090565b3b1561310e5790565b60405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606490fd5b8251909150156131665750805190602001fd5b60405162461bcd60e51b8152908190612e7190600483016102cd565b919091806001146131b4576002146131a857634e487b7160e01b5f52605160045260245ffd5b81039081116106655790565b508101809111610665579056fea264697066735822122064cab481df6b1a587bc18db83939d82743228c3be79f2f76ddf28c4b7c97dc9f64736f6c634300081c0033df6966c971051c3d54ec59162606531493a51404a002842f56009d7e5cf4a8c6dec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a724", } // ERC20RealWorldAgentABI is the input ABI used to generate the binding from. // Deprecated: Use ERC20RealWorldAgentMetaData.ABI instead. var ERC20RealWorldAgentABI = ERC20RealWorldAgentMetaData.ABI // ERC20RealWorldAgentBin is the compiled bytecode used for deploying new contracts. // Deprecated: Use ERC20RealWorldAgentMetaData.Bin instead. var ERC20RealWorldAgentBin = ERC20RealWorldAgentMetaData.Bin // DeployERC20RealWorldAgent deploys a new Ethereum contract, binding an instance of ERC20RealWorldAgent to it. func DeployERC20RealWorldAgent(auth *bind.TransactOpts, backend bind.ContractBackend, name_ string, symbol_ string, amount_ *big.Int, recipient_ common.Address, minFeeToUse_ *big.Int, timeout_ uint32, tokenFee_ common.Address, worker_ common.Address) (common.Address, *types.Transaction, *ERC20RealWorldAgent, error) { parsed, err := ERC20RealWorldAgentMetaData.GetAbi() if err != nil { return common.Address{}, nil, nil, err } if parsed == nil { return common.Address{}, nil, nil, errors.New("GetABI returned nil") } address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(ERC20RealWorldAgentBin), backend, name_, symbol_, amount_, recipient_, minFeeToUse_, timeout_, tokenFee_, worker_) if err != nil { return common.Address{}, nil, nil, err } return address, tx, &ERC20RealWorldAgent{ERC20RealWorldAgentCaller: ERC20RealWorldAgentCaller{contract: contract}, ERC20RealWorldAgentTransactor: ERC20RealWorldAgentTransactor{contract: contract}, ERC20RealWorldAgentFilterer: ERC20RealWorldAgentFilterer{contract: contract}}, nil } // ERC20RealWorldAgent is an auto generated Go binding around an Ethereum contract. type ERC20RealWorldAgent struct { ERC20RealWorldAgentCaller // Read-only binding to the contract ERC20RealWorldAgentTransactor // Write-only binding to the contract ERC20RealWorldAgentFilterer // Log filterer for contract events } // ERC20RealWorldAgentCaller is an auto generated read-only Go binding around an Ethereum contract. type ERC20RealWorldAgentCaller struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // ERC20RealWorldAgentTransactor is an auto generated write-only Go binding around an Ethereum contract. type ERC20RealWorldAgentTransactor struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // ERC20RealWorldAgentFilterer is an auto generated log filtering Go binding around an Ethereum contract events. type ERC20RealWorldAgentFilterer struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // ERC20RealWorldAgentSession is an auto generated Go binding around an Ethereum contract, // with pre-set call and transact options. type ERC20RealWorldAgentSession struct { Contract *ERC20RealWorldAgent // Generic contract binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // ERC20RealWorldAgentCallerSession is an auto generated read-only Go binding around an Ethereum contract, // with pre-set call options. type ERC20RealWorldAgentCallerSession struct { Contract *ERC20RealWorldAgentCaller // Generic contract caller binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session } // ERC20RealWorldAgentTransactorSession is an auto generated write-only Go binding around an Ethereum contract, // with pre-set transact options. type ERC20RealWorldAgentTransactorSession struct { Contract *ERC20RealWorldAgentTransactor // Generic contract transactor binding to set the session for TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // ERC20RealWorldAgentRaw is an auto generated low-level Go binding around an Ethereum contract. type ERC20RealWorldAgentRaw struct { Contract *ERC20RealWorldAgent // Generic contract binding to access the raw methods on } // ERC20RealWorldAgentCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. type ERC20RealWorldAgentCallerRaw struct { Contract *ERC20RealWorldAgentCaller // Generic read-only contract binding to access the raw methods on } // ERC20RealWorldAgentTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. type ERC20RealWorldAgentTransactorRaw struct { Contract *ERC20RealWorldAgentTransactor // Generic write-only contract binding to access the raw methods on } // NewERC20RealWorldAgent creates a new instance of ERC20RealWorldAgent, bound to a specific deployed contract. func NewERC20RealWorldAgent(address common.Address, backend bind.ContractBackend) (*ERC20RealWorldAgent, error) { contract, err := bindERC20RealWorldAgent(address, backend, backend, backend) if err != nil { return nil, err } return &ERC20RealWorldAgent{ERC20RealWorldAgentCaller: ERC20RealWorldAgentCaller{contract: contract}, ERC20RealWorldAgentTransactor: ERC20RealWorldAgentTransactor{contract: contract}, ERC20RealWorldAgentFilterer: ERC20RealWorldAgentFilterer{contract: contract}}, nil } // NewERC20RealWorldAgentCaller creates a new read-only instance of ERC20RealWorldAgent, bound to a specific deployed contract. func NewERC20RealWorldAgentCaller(address common.Address, caller bind.ContractCaller) (*ERC20RealWorldAgentCaller, error) { contract, err := bindERC20RealWorldAgent(address, caller, nil, nil) if err != nil { return nil, err } return &ERC20RealWorldAgentCaller{contract: contract}, nil } // NewERC20RealWorldAgentTransactor creates a new write-only instance of ERC20RealWorldAgent, bound to a specific deployed contract. func NewERC20RealWorldAgentTransactor(address common.Address, transactor bind.ContractTransactor) (*ERC20RealWorldAgentTransactor, error) { contract, err := bindERC20RealWorldAgent(address, nil, transactor, nil) if err != nil { return nil, err } return &ERC20RealWorldAgentTransactor{contract: contract}, nil } // NewERC20RealWorldAgentFilterer creates a new log filterer instance of ERC20RealWorldAgent, bound to a specific deployed contract. func NewERC20RealWorldAgentFilterer(address common.Address, filterer bind.ContractFilterer) (*ERC20RealWorldAgentFilterer, error) { contract, err := bindERC20RealWorldAgent(address, nil, nil, filterer) if err != nil { return nil, err } return &ERC20RealWorldAgentFilterer{contract: contract}, nil } // bindERC20RealWorldAgent binds a generic wrapper to an already deployed contract. func bindERC20RealWorldAgent(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { parsed, err := ERC20RealWorldAgentMetaData.GetAbi() if err != nil { return nil, err } return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_ERC20RealWorldAgent *ERC20RealWorldAgentRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _ERC20RealWorldAgent.Contract.ERC20RealWorldAgentCaller.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_ERC20RealWorldAgent *ERC20RealWorldAgentRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _ERC20RealWorldAgent.Contract.ERC20RealWorldAgentTransactor.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_ERC20RealWorldAgent *ERC20RealWorldAgentRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _ERC20RealWorldAgent.Contract.ERC20RealWorldAgentTransactor.contract.Transact(opts, method, params...) } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_ERC20RealWorldAgent *ERC20RealWorldAgentCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _ERC20RealWorldAgent.Contract.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_ERC20RealWorldAgent *ERC20RealWorldAgentTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _ERC20RealWorldAgent.Contract.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_ERC20RealWorldAgent *ERC20RealWorldAgentTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _ERC20RealWorldAgent.Contract.contract.Transact(opts, method, params...) } // CLOCKMODE is a free data retrieval call binding the contract method 0x4bf5d7e9. // // Solidity: function CLOCK_MODE() view returns(string) func (_ERC20RealWorldAgent *ERC20RealWorldAgentCaller) CLOCKMODE(opts *bind.CallOpts) (string, error) { var out []interface{} err := _ERC20RealWorldAgent.contract.Call(opts, &out, "CLOCK_MODE") if err != nil { return *new(string), err } out0 := *abi.ConvertType(out[0], new(string)).(*string) return out0, err } // CLOCKMODE is a free data retrieval call binding the contract method 0x4bf5d7e9. // // Solidity: function CLOCK_MODE() view returns(string) func (_ERC20RealWorldAgent *ERC20RealWorldAgentSession) CLOCKMODE() (string, error) { return _ERC20RealWorldAgent.Contract.CLOCKMODE(&_ERC20RealWorldAgent.CallOpts) } // CLOCKMODE is a free data retrieval call binding the contract method 0x4bf5d7e9. // // Solidity: function CLOCK_MODE() view returns(string) func (_ERC20RealWorldAgent *ERC20RealWorldAgentCallerSession) CLOCKMODE() (string, error) { return _ERC20RealWorldAgent.Contract.CLOCKMODE(&_ERC20RealWorldAgent.CallOpts) } // DOMAINSEPARATOR is a free data retrieval call binding the contract method 0x3644e515. // // Solidity: function DOMAIN_SEPARATOR() view returns(bytes32) func (_ERC20RealWorldAgent *ERC20RealWorldAgentCaller) DOMAINSEPARATOR(opts *bind.CallOpts) ([32]byte, error) { var out []interface{} err := _ERC20RealWorldAgent.contract.Call(opts, &out, "DOMAIN_SEPARATOR") if err != nil { return *new([32]byte), err } out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) return out0, err } // DOMAINSEPARATOR is a free data retrieval call binding the contract method 0x3644e515. // // Solidity: function DOMAIN_SEPARATOR() view returns(bytes32) func (_ERC20RealWorldAgent *ERC20RealWorldAgentSession) DOMAINSEPARATOR() ([32]byte, error) { return _ERC20RealWorldAgent.Contract.DOMAINSEPARATOR(&_ERC20RealWorldAgent.CallOpts) } // DOMAINSEPARATOR is a free data retrieval call binding the contract method 0x3644e515. // // Solidity: function DOMAIN_SEPARATOR() view returns(bytes32) func (_ERC20RealWorldAgent *ERC20RealWorldAgentCallerSession) DOMAINSEPARATOR() ([32]byte, error) { return _ERC20RealWorldAgent.Contract.DOMAINSEPARATOR(&_ERC20RealWorldAgent.CallOpts) } // Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. // // Solidity: function allowance(address owner, address spender) view returns(uint256) func (_ERC20RealWorldAgent *ERC20RealWorldAgentCaller) Allowance(opts *bind.CallOpts, owner common.Address, spender common.Address) (*big.Int, error) { var out []interface{} err := _ERC20RealWorldAgent.contract.Call(opts, &out, "allowance", owner, spender) if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. // // Solidity: function allowance(address owner, address spender) view returns(uint256) func (_ERC20RealWorldAgent *ERC20RealWorldAgentSession) Allowance(owner common.Address, spender common.Address) (*big.Int, error) { return _ERC20RealWorldAgent.Contract.Allowance(&_ERC20RealWorldAgent.CallOpts, owner, spender) } // Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. // // Solidity: function allowance(address owner, address spender) view returns(uint256) func (_ERC20RealWorldAgent *ERC20RealWorldAgentCallerSession) Allowance(owner common.Address, spender common.Address) (*big.Int, error) { return _ERC20RealWorldAgent.Contract.Allowance(&_ERC20RealWorldAgent.CallOpts, owner, spender) } // BalanceOf is a free data retrieval call binding the contract method 0x70a08231. // // Solidity: function balanceOf(address account) view returns(uint256) func (_ERC20RealWorldAgent *ERC20RealWorldAgentCaller) BalanceOf(opts *bind.CallOpts, account common.Address) (*big.Int, error) { var out []interface{} err := _ERC20RealWorldAgent.contract.Call(opts, &out, "balanceOf", account) if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // BalanceOf is a free data retrieval call binding the contract method 0x70a08231. // // Solidity: function balanceOf(address account) view returns(uint256) func (_ERC20RealWorldAgent *ERC20RealWorldAgentSession) BalanceOf(account common.Address) (*big.Int, error) { return _ERC20RealWorldAgent.Contract.BalanceOf(&_ERC20RealWorldAgent.CallOpts, account) } // BalanceOf is a free data retrieval call binding the contract method 0x70a08231. // // Solidity: function balanceOf(address account) view returns(uint256) func (_ERC20RealWorldAgent *ERC20RealWorldAgentCallerSession) BalanceOf(account common.Address) (*big.Int, error) { return _ERC20RealWorldAgent.Contract.BalanceOf(&_ERC20RealWorldAgent.CallOpts, account) } // Checkpoints is a free data retrieval call binding the contract method 0xf1127ed8. // // Solidity: function checkpoints(address account, uint32 pos) view returns((uint32,uint224)) func (_ERC20RealWorldAgent *ERC20RealWorldAgentCaller) Checkpoints(opts *bind.CallOpts, account common.Address, pos uint32) (ERC20VotesCheckpoint, error) { var out []interface{} err := _ERC20RealWorldAgent.contract.Call(opts, &out, "checkpoints", account, pos) if err != nil { return *new(ERC20VotesCheckpoint), err } out0 := *abi.ConvertType(out[0], new(ERC20VotesCheckpoint)).(*ERC20VotesCheckpoint) return out0, err } // Checkpoints is a free data retrieval call binding the contract method 0xf1127ed8. // // Solidity: function checkpoints(address account, uint32 pos) view returns((uint32,uint224)) func (_ERC20RealWorldAgent *ERC20RealWorldAgentSession) Checkpoints(account common.Address, pos uint32) (ERC20VotesCheckpoint, error) { return _ERC20RealWorldAgent.Contract.Checkpoints(&_ERC20RealWorldAgent.CallOpts, account, pos) } // Checkpoints is a free data retrieval call binding the contract method 0xf1127ed8. // // Solidity: function checkpoints(address account, uint32 pos) view returns((uint32,uint224)) func (_ERC20RealWorldAgent *ERC20RealWorldAgentCallerSession) Checkpoints(account common.Address, pos uint32) (ERC20VotesCheckpoint, error) { return _ERC20RealWorldAgent.Contract.Checkpoints(&_ERC20RealWorldAgent.CallOpts, account, pos) } // Clock is a free data retrieval call binding the contract method 0x91ddadf4. // // Solidity: function clock() view returns(uint48) func (_ERC20RealWorldAgent *ERC20RealWorldAgentCaller) Clock(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} err := _ERC20RealWorldAgent.contract.Call(opts, &out, "clock") if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // Clock is a free data retrieval call binding the contract method 0x91ddadf4. // // Solidity: function clock() view returns(uint48) func (_ERC20RealWorldAgent *ERC20RealWorldAgentSession) Clock() (*big.Int, error) { return _ERC20RealWorldAgent.Contract.Clock(&_ERC20RealWorldAgent.CallOpts) } // Clock is a free data retrieval call binding the contract method 0x91ddadf4. // // Solidity: function clock() view returns(uint48) func (_ERC20RealWorldAgent *ERC20RealWorldAgentCallerSession) Clock() (*big.Int, error) { return _ERC20RealWorldAgent.Contract.Clock(&_ERC20RealWorldAgent.CallOpts) } // Decimals is a free data retrieval call binding the contract method 0x313ce567. // // Solidity: function decimals() view returns(uint8) func (_ERC20RealWorldAgent *ERC20RealWorldAgentCaller) Decimals(opts *bind.CallOpts) (uint8, error) { var out []interface{} err := _ERC20RealWorldAgent.contract.Call(opts, &out, "decimals") if err != nil { return *new(uint8), err } out0 := *abi.ConvertType(out[0], new(uint8)).(*uint8) return out0, err } // Decimals is a free data retrieval call binding the contract method 0x313ce567. // // Solidity: function decimals() view returns(uint8) func (_ERC20RealWorldAgent *ERC20RealWorldAgentSession) Decimals() (uint8, error) { return _ERC20RealWorldAgent.Contract.Decimals(&_ERC20RealWorldAgent.CallOpts) } // Decimals is a free data retrieval call binding the contract method 0x313ce567. // // Solidity: function decimals() view returns(uint8) func (_ERC20RealWorldAgent *ERC20RealWorldAgentCallerSession) Decimals() (uint8, error) { return _ERC20RealWorldAgent.Contract.Decimals(&_ERC20RealWorldAgent.CallOpts) } // Delegates is a free data retrieval call binding the contract method 0x587cde1e. // // Solidity: function delegates(address account) view returns(address) func (_ERC20RealWorldAgent *ERC20RealWorldAgentCaller) Delegates(opts *bind.CallOpts, account common.Address) (common.Address, error) { var out []interface{} err := _ERC20RealWorldAgent.contract.Call(opts, &out, "delegates", account) if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // Delegates is a free data retrieval call binding the contract method 0x587cde1e. // // Solidity: function delegates(address account) view returns(address) func (_ERC20RealWorldAgent *ERC20RealWorldAgentSession) Delegates(account common.Address) (common.Address, error) { return _ERC20RealWorldAgent.Contract.Delegates(&_ERC20RealWorldAgent.CallOpts, account) } // Delegates is a free data retrieval call binding the contract method 0x587cde1e. // // Solidity: function delegates(address account) view returns(address) func (_ERC20RealWorldAgent *ERC20RealWorldAgentCallerSession) Delegates(account common.Address) (common.Address, error) { return _ERC20RealWorldAgent.Contract.Delegates(&_ERC20RealWorldAgent.CallOpts, account) } // Eip712Domain is a free data retrieval call binding the contract method 0x84b0196e. // // Solidity: function eip712Domain() view returns(bytes1 fields, string name, string version, uint256 chainId, address verifyingContract, bytes32 salt, uint256[] extensions) func (_ERC20RealWorldAgent *ERC20RealWorldAgentCaller) Eip712Domain(opts *bind.CallOpts) (struct { Fields [1]byte Name string Version string ChainId *big.Int VerifyingContract common.Address Salt [32]byte Extensions []*big.Int }, error) { var out []interface{} err := _ERC20RealWorldAgent.contract.Call(opts, &out, "eip712Domain") outstruct := new(struct { Fields [1]byte Name string Version string ChainId *big.Int VerifyingContract common.Address Salt [32]byte Extensions []*big.Int }) if err != nil { return *outstruct, err } outstruct.Fields = *abi.ConvertType(out[0], new([1]byte)).(*[1]byte) outstruct.Name = *abi.ConvertType(out[1], new(string)).(*string) outstruct.Version = *abi.ConvertType(out[2], new(string)).(*string) outstruct.ChainId = *abi.ConvertType(out[3], new(*big.Int)).(**big.Int) outstruct.VerifyingContract = *abi.ConvertType(out[4], new(common.Address)).(*common.Address) outstruct.Salt = *abi.ConvertType(out[5], new([32]byte)).(*[32]byte) outstruct.Extensions = *abi.ConvertType(out[6], new([]*big.Int)).(*[]*big.Int) return *outstruct, err } // Eip712Domain is a free data retrieval call binding the contract method 0x84b0196e. // // Solidity: function eip712Domain() view returns(bytes1 fields, string name, string version, uint256 chainId, address verifyingContract, bytes32 salt, uint256[] extensions) func (_ERC20RealWorldAgent *ERC20RealWorldAgentSession) Eip712Domain() (struct { Fields [1]byte Name string Version string ChainId *big.Int VerifyingContract common.Address Salt [32]byte Extensions []*big.Int }, error) { return _ERC20RealWorldAgent.Contract.Eip712Domain(&_ERC20RealWorldAgent.CallOpts) } // Eip712Domain is a free data retrieval call binding the contract method 0x84b0196e. // // Solidity: function eip712Domain() view returns(bytes1 fields, string name, string version, uint256 chainId, address verifyingContract, bytes32 salt, uint256[] extensions) func (_ERC20RealWorldAgent *ERC20RealWorldAgentCallerSession) Eip712Domain() (struct { Fields [1]byte Name string Version string ChainId *big.Int VerifyingContract common.Address Salt [32]byte Extensions []*big.Int }, error) { return _ERC20RealWorldAgent.Contract.Eip712Domain(&_ERC20RealWorldAgent.CallOpts) } // GetActId is a free data retrieval call binding the contract method 0x1af09a2b. // // Solidity: function getActId() view returns(uint256) func (_ERC20RealWorldAgent *ERC20RealWorldAgentCaller) GetActId(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} err := _ERC20RealWorldAgent.contract.Call(opts, &out, "getActId") if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // GetActId is a free data retrieval call binding the contract method 0x1af09a2b. // // Solidity: function getActId() view returns(uint256) func (_ERC20RealWorldAgent *ERC20RealWorldAgentSession) GetActId() (*big.Int, error) { return _ERC20RealWorldAgent.Contract.GetActId(&_ERC20RealWorldAgent.CallOpts) } // GetActId is a free data retrieval call binding the contract method 0x1af09a2b. // // Solidity: function getActId() view returns(uint256) func (_ERC20RealWorldAgent *ERC20RealWorldAgentCallerSession) GetActId() (*big.Int, error) { return _ERC20RealWorldAgent.Contract.GetActId(&_ERC20RealWorldAgent.CallOpts) } // GetHashToSign is a free data retrieval call binding the contract method 0xe0839ca1. // // Solidity: function getHashToSign(bytes32 uuid, bytes data) view returns(bytes32) func (_ERC20RealWorldAgent *ERC20RealWorldAgentCaller) GetHashToSign(opts *bind.CallOpts, uuid [32]byte, data []byte) ([32]byte, error) { var out []interface{} err := _ERC20RealWorldAgent.contract.Call(opts, &out, "getHashToSign", uuid, data) if err != nil { return *new([32]byte), err } out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) return out0, err } // GetHashToSign is a free data retrieval call binding the contract method 0xe0839ca1. // // Solidity: function getHashToSign(bytes32 uuid, bytes data) view returns(bytes32) func (_ERC20RealWorldAgent *ERC20RealWorldAgentSession) GetHashToSign(uuid [32]byte, data []byte) ([32]byte, error) { return _ERC20RealWorldAgent.Contract.GetHashToSign(&_ERC20RealWorldAgent.CallOpts, uuid, data) } // GetHashToSign is a free data retrieval call binding the contract method 0xe0839ca1. // // Solidity: function getHashToSign(bytes32 uuid, bytes data) view returns(bytes32) func (_ERC20RealWorldAgent *ERC20RealWorldAgentCallerSession) GetHashToSign(uuid [32]byte, data []byte) ([32]byte, error) { return _ERC20RealWorldAgent.Contract.GetHashToSign(&_ERC20RealWorldAgent.CallOpts, uuid, data) } // GetMinFeeToUse is a free data retrieval call binding the contract method 0x9aa474ed. // // Solidity: function getMinFeeToUse() view returns(uint256) func (_ERC20RealWorldAgent *ERC20RealWorldAgentCaller) GetMinFeeToUse(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} err := _ERC20RealWorldAgent.contract.Call(opts, &out, "getMinFeeToUse") if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // GetMinFeeToUse is a free data retrieval call binding the contract method 0x9aa474ed. // // Solidity: function getMinFeeToUse() view returns(uint256) func (_ERC20RealWorldAgent *ERC20RealWorldAgentSession) GetMinFeeToUse() (*big.Int, error) { return _ERC20RealWorldAgent.Contract.GetMinFeeToUse(&_ERC20RealWorldAgent.CallOpts) } // GetMinFeeToUse is a free data retrieval call binding the contract method 0x9aa474ed. // // Solidity: function getMinFeeToUse() view returns(uint256) func (_ERC20RealWorldAgent *ERC20RealWorldAgentCallerSession) GetMinFeeToUse() (*big.Int, error) { return _ERC20RealWorldAgent.Contract.GetMinFeeToUse(&_ERC20RealWorldAgent.CallOpts) } // GetPastTotalSupply is a free data retrieval call binding the contract method 0x8e539e8c. // // Solidity: function getPastTotalSupply(uint256 timepoint) view returns(uint256) func (_ERC20RealWorldAgent *ERC20RealWorldAgentCaller) GetPastTotalSupply(opts *bind.CallOpts, timepoint *big.Int) (*big.Int, error) { var out []interface{} err := _ERC20RealWorldAgent.contract.Call(opts, &out, "getPastTotalSupply", timepoint) if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // GetPastTotalSupply is a free data retrieval call binding the contract method 0x8e539e8c. // // Solidity: function getPastTotalSupply(uint256 timepoint) view returns(uint256) func (_ERC20RealWorldAgent *ERC20RealWorldAgentSession) GetPastTotalSupply(timepoint *big.Int) (*big.Int, error) { return _ERC20RealWorldAgent.Contract.GetPastTotalSupply(&_ERC20RealWorldAgent.CallOpts, timepoint) } // GetPastTotalSupply is a free data retrieval call binding the contract method 0x8e539e8c. // // Solidity: function getPastTotalSupply(uint256 timepoint) view returns(uint256) func (_ERC20RealWorldAgent *ERC20RealWorldAgentCallerSession) GetPastTotalSupply(timepoint *big.Int) (*big.Int, error) { return _ERC20RealWorldAgent.Contract.GetPastTotalSupply(&_ERC20RealWorldAgent.CallOpts, timepoint) } // GetPastVotes is a free data retrieval call binding the contract method 0x3a46b1a8. // // Solidity: function getPastVotes(address account, uint256 timepoint) view returns(uint256) func (_ERC20RealWorldAgent *ERC20RealWorldAgentCaller) GetPastVotes(opts *bind.CallOpts, account common.Address, timepoint *big.Int) (*big.Int, error) { var out []interface{} err := _ERC20RealWorldAgent.contract.Call(opts, &out, "getPastVotes", account, timepoint) if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // GetPastVotes is a free data retrieval call binding the contract method 0x3a46b1a8. // // Solidity: function getPastVotes(address account, uint256 timepoint) view returns(uint256) func (_ERC20RealWorldAgent *ERC20RealWorldAgentSession) GetPastVotes(account common.Address, timepoint *big.Int) (*big.Int, error) { return _ERC20RealWorldAgent.Contract.GetPastVotes(&_ERC20RealWorldAgent.CallOpts, account, timepoint) } // GetPastVotes is a free data retrieval call binding the contract method 0x3a46b1a8. // // Solidity: function getPastVotes(address account, uint256 timepoint) view returns(uint256) func (_ERC20RealWorldAgent *ERC20RealWorldAgentCallerSession) GetPastVotes(account common.Address, timepoint *big.Int) (*big.Int, error) { return _ERC20RealWorldAgent.Contract.GetPastVotes(&_ERC20RealWorldAgent.CallOpts, account, timepoint) } // GetRequest is a free data retrieval call binding the contract method 0xc58343ef. // // Solidity: function getRequest(uint256 actId) view returns((bytes32,address,uint32,uint8,bytes,bytes)) func (_ERC20RealWorldAgent *ERC20RealWorldAgentCaller) GetRequest(opts *bind.CallOpts, actId *big.Int) (IRealWorldAgentRequest, error) { var out []interface{} err := _ERC20RealWorldAgent.contract.Call(opts, &out, "getRequest", actId) if err != nil { return *new(IRealWorldAgentRequest), err } out0 := *abi.ConvertType(out[0], new(IRealWorldAgentRequest)).(*IRealWorldAgentRequest) return out0, err } // GetRequest is a free data retrieval call binding the contract method 0xc58343ef. // // Solidity: function getRequest(uint256 actId) view returns((bytes32,address,uint32,uint8,bytes,bytes)) func (_ERC20RealWorldAgent *ERC20RealWorldAgentSession) GetRequest(actId *big.Int) (IRealWorldAgentRequest, error) { return _ERC20RealWorldAgent.Contract.GetRequest(&_ERC20RealWorldAgent.CallOpts, actId) } // GetRequest is a free data retrieval call binding the contract method 0xc58343ef. // // Solidity: function getRequest(uint256 actId) view returns((bytes32,address,uint32,uint8,bytes,bytes)) func (_ERC20RealWorldAgent *ERC20RealWorldAgentCallerSession) GetRequest(actId *big.Int) (IRealWorldAgentRequest, error) { return _ERC20RealWorldAgent.Contract.GetRequest(&_ERC20RealWorldAgent.CallOpts, actId) } // GetResultById is a free data retrieval call binding the contract method 0x365bec7f. // // Solidity: function getResultById(bytes32 uuid) view returns(bytes) func (_ERC20RealWorldAgent *ERC20RealWorldAgentCaller) GetResultById(opts *bind.CallOpts, uuid [32]byte) ([]byte, error) { var out []interface{} err := _ERC20RealWorldAgent.contract.Call(opts, &out, "getResultById", uuid) if err != nil { return *new([]byte), err } out0 := *abi.ConvertType(out[0], new([]byte)).(*[]byte) return out0, err } // GetResultById is a free data retrieval call binding the contract method 0x365bec7f. // // Solidity: function getResultById(bytes32 uuid) view returns(bytes) func (_ERC20RealWorldAgent *ERC20RealWorldAgentSession) GetResultById(uuid [32]byte) ([]byte, error) { return _ERC20RealWorldAgent.Contract.GetResultById(&_ERC20RealWorldAgent.CallOpts, uuid) } // GetResultById is a free data retrieval call binding the contract method 0x365bec7f. // // Solidity: function getResultById(bytes32 uuid) view returns(bytes) func (_ERC20RealWorldAgent *ERC20RealWorldAgentCallerSession) GetResultById(uuid [32]byte) ([]byte, error) { return _ERC20RealWorldAgent.Contract.GetResultById(&_ERC20RealWorldAgent.CallOpts, uuid) } // GetVotes is a free data retrieval call binding the contract method 0x9ab24eb0. // // Solidity: function getVotes(address account) view returns(uint256) func (_ERC20RealWorldAgent *ERC20RealWorldAgentCaller) GetVotes(opts *bind.CallOpts, account common.Address) (*big.Int, error) { var out []interface{} err := _ERC20RealWorldAgent.contract.Call(opts, &out, "getVotes", account) if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // GetVotes is a free data retrieval call binding the contract method 0x9ab24eb0. // // Solidity: function getVotes(address account) view returns(uint256) func (_ERC20RealWorldAgent *ERC20RealWorldAgentSession) GetVotes(account common.Address) (*big.Int, error) { return _ERC20RealWorldAgent.Contract.GetVotes(&_ERC20RealWorldAgent.CallOpts, account) } // GetVotes is a free data retrieval call binding the contract method 0x9ab24eb0. // // Solidity: function getVotes(address account) view returns(uint256) func (_ERC20RealWorldAgent *ERC20RealWorldAgentCallerSession) GetVotes(account common.Address) (*big.Int, error) { return _ERC20RealWorldAgent.Contract.GetVotes(&_ERC20RealWorldAgent.CallOpts, account) } // Name is a free data retrieval call binding the contract method 0x06fdde03. // // Solidity: function name() view returns(string) func (_ERC20RealWorldAgent *ERC20RealWorldAgentCaller) Name(opts *bind.CallOpts) (string, error) { var out []interface{} err := _ERC20RealWorldAgent.contract.Call(opts, &out, "name") if err != nil { return *new(string), err } out0 := *abi.ConvertType(out[0], new(string)).(*string) return out0, err } // Name is a free data retrieval call binding the contract method 0x06fdde03. // // Solidity: function name() view returns(string) func (_ERC20RealWorldAgent *ERC20RealWorldAgentSession) Name() (string, error) { return _ERC20RealWorldAgent.Contract.Name(&_ERC20RealWorldAgent.CallOpts) } // Name is a free data retrieval call binding the contract method 0x06fdde03. // // Solidity: function name() view returns(string) func (_ERC20RealWorldAgent *ERC20RealWorldAgentCallerSession) Name() (string, error) { return _ERC20RealWorldAgent.Contract.Name(&_ERC20RealWorldAgent.CallOpts) } // Nonces is a free data retrieval call binding the contract method 0x7ecebe00. // // Solidity: function nonces(address owner) view returns(uint256) func (_ERC20RealWorldAgent *ERC20RealWorldAgentCaller) Nonces(opts *bind.CallOpts, owner common.Address) (*big.Int, error) { var out []interface{} err := _ERC20RealWorldAgent.contract.Call(opts, &out, "nonces", owner) if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // Nonces is a free data retrieval call binding the contract method 0x7ecebe00. // // Solidity: function nonces(address owner) view returns(uint256) func (_ERC20RealWorldAgent *ERC20RealWorldAgentSession) Nonces(owner common.Address) (*big.Int, error) { return _ERC20RealWorldAgent.Contract.Nonces(&_ERC20RealWorldAgent.CallOpts, owner) } // Nonces is a free data retrieval call binding the contract method 0x7ecebe00. // // Solidity: function nonces(address owner) view returns(uint256) func (_ERC20RealWorldAgent *ERC20RealWorldAgentCallerSession) Nonces(owner common.Address) (*big.Int, error) { return _ERC20RealWorldAgent.Contract.Nonces(&_ERC20RealWorldAgent.CallOpts, owner) } // NumCheckpoints is a free data retrieval call binding the contract method 0x6fcfff45. // // Solidity: function numCheckpoints(address account) view returns(uint32) func (_ERC20RealWorldAgent *ERC20RealWorldAgentCaller) NumCheckpoints(opts *bind.CallOpts, account common.Address) (uint32, error) { var out []interface{} err := _ERC20RealWorldAgent.contract.Call(opts, &out, "numCheckpoints", account) if err != nil { return *new(uint32), err } out0 := *abi.ConvertType(out[0], new(uint32)).(*uint32) return out0, err } // NumCheckpoints is a free data retrieval call binding the contract method 0x6fcfff45. // // Solidity: function numCheckpoints(address account) view returns(uint32) func (_ERC20RealWorldAgent *ERC20RealWorldAgentSession) NumCheckpoints(account common.Address) (uint32, error) { return _ERC20RealWorldAgent.Contract.NumCheckpoints(&_ERC20RealWorldAgent.CallOpts, account) } // NumCheckpoints is a free data retrieval call binding the contract method 0x6fcfff45. // // Solidity: function numCheckpoints(address account) view returns(uint32) func (_ERC20RealWorldAgent *ERC20RealWorldAgentCallerSession) NumCheckpoints(account common.Address) (uint32, error) { return _ERC20RealWorldAgent.Contract.NumCheckpoints(&_ERC20RealWorldAgent.CallOpts, account) } // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. // // Solidity: function owner() view returns(address) func (_ERC20RealWorldAgent *ERC20RealWorldAgentCaller) Owner(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _ERC20RealWorldAgent.contract.Call(opts, &out, "owner") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. // // Solidity: function owner() view returns(address) func (_ERC20RealWorldAgent *ERC20RealWorldAgentSession) Owner() (common.Address, error) { return _ERC20RealWorldAgent.Contract.Owner(&_ERC20RealWorldAgent.CallOpts) } // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. // // Solidity: function owner() view returns(address) func (_ERC20RealWorldAgent *ERC20RealWorldAgentCallerSession) Owner() (common.Address, error) { return _ERC20RealWorldAgent.Contract.Owner(&_ERC20RealWorldAgent.CallOpts) } // Symbol is a free data retrieval call binding the contract method 0x95d89b41. // // Solidity: function symbol() view returns(string) func (_ERC20RealWorldAgent *ERC20RealWorldAgentCaller) Symbol(opts *bind.CallOpts) (string, error) { var out []interface{} err := _ERC20RealWorldAgent.contract.Call(opts, &out, "symbol") if err != nil { return *new(string), err } out0 := *abi.ConvertType(out[0], new(string)).(*string) return out0, err } // Symbol is a free data retrieval call binding the contract method 0x95d89b41. // // Solidity: function symbol() view returns(string) func (_ERC20RealWorldAgent *ERC20RealWorldAgentSession) Symbol() (string, error) { return _ERC20RealWorldAgent.Contract.Symbol(&_ERC20RealWorldAgent.CallOpts) } // Symbol is a free data retrieval call binding the contract method 0x95d89b41. // // Solidity: function symbol() view returns(string) func (_ERC20RealWorldAgent *ERC20RealWorldAgentCallerSession) Symbol() (string, error) { return _ERC20RealWorldAgent.Contract.Symbol(&_ERC20RealWorldAgent.CallOpts) } // TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. // // Solidity: function totalSupply() view returns(uint256) func (_ERC20RealWorldAgent *ERC20RealWorldAgentCaller) TotalSupply(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} err := _ERC20RealWorldAgent.contract.Call(opts, &out, "totalSupply") if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. // // Solidity: function totalSupply() view returns(uint256) func (_ERC20RealWorldAgent *ERC20RealWorldAgentSession) TotalSupply() (*big.Int, error) { return _ERC20RealWorldAgent.Contract.TotalSupply(&_ERC20RealWorldAgent.CallOpts) } // TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. // // Solidity: function totalSupply() view returns(uint256) func (_ERC20RealWorldAgent *ERC20RealWorldAgentCallerSession) TotalSupply() (*big.Int, error) { return _ERC20RealWorldAgent.Contract.TotalSupply(&_ERC20RealWorldAgent.CallOpts) } // Act is a paid mutator transaction binding the contract method 0xd19834fc. // // Solidity: function act(bytes32 uuid, bytes executeData) returns(uint256) func (_ERC20RealWorldAgent *ERC20RealWorldAgentTransactor) Act(opts *bind.TransactOpts, uuid [32]byte, executeData []byte) (*types.Transaction, error) { return _ERC20RealWorldAgent.contract.Transact(opts, "act", uuid, executeData) } // Act is a paid mutator transaction binding the contract method 0xd19834fc. // // Solidity: function act(bytes32 uuid, bytes executeData) returns(uint256) func (_ERC20RealWorldAgent *ERC20RealWorldAgentSession) Act(uuid [32]byte, executeData []byte) (*types.Transaction, error) { return _ERC20RealWorldAgent.Contract.Act(&_ERC20RealWorldAgent.TransactOpts, uuid, executeData) } // Act is a paid mutator transaction binding the contract method 0xd19834fc. // // Solidity: function act(bytes32 uuid, bytes executeData) returns(uint256) func (_ERC20RealWorldAgent *ERC20RealWorldAgentTransactorSession) Act(uuid [32]byte, executeData []byte) (*types.Transaction, error) { return _ERC20RealWorldAgent.Contract.Act(&_ERC20RealWorldAgent.TransactOpts, uuid, executeData) } // Act0 is a paid mutator transaction binding the contract method 0xfea5ef99. // // Solidity: function act(bytes32 uuid, bytes data, bytes signature) returns(uint256) func (_ERC20RealWorldAgent *ERC20RealWorldAgentTransactor) Act0(opts *bind.TransactOpts, uuid [32]byte, data []byte, signature []byte) (*types.Transaction, error) { return _ERC20RealWorldAgent.contract.Transact(opts, "act0", uuid, data, signature) } // Act0 is a paid mutator transaction binding the contract method 0xfea5ef99. // // Solidity: function act(bytes32 uuid, bytes data, bytes signature) returns(uint256) func (_ERC20RealWorldAgent *ERC20RealWorldAgentSession) Act0(uuid [32]byte, data []byte, signature []byte) (*types.Transaction, error) { return _ERC20RealWorldAgent.Contract.Act0(&_ERC20RealWorldAgent.TransactOpts, uuid, data, signature) } // Act0 is a paid mutator transaction binding the contract method 0xfea5ef99. // // Solidity: function act(bytes32 uuid, bytes data, bytes signature) returns(uint256) func (_ERC20RealWorldAgent *ERC20RealWorldAgentTransactorSession) Act0(uuid [32]byte, data []byte, signature []byte) (*types.Transaction, error) { return _ERC20RealWorldAgent.Contract.Act0(&_ERC20RealWorldAgent.TransactOpts, uuid, data, signature) } // Approve is a paid mutator transaction binding the contract method 0x095ea7b3. // // Solidity: function approve(address spender, uint256 amount) returns(bool) func (_ERC20RealWorldAgent *ERC20RealWorldAgentTransactor) Approve(opts *bind.TransactOpts, spender common.Address, amount *big.Int) (*types.Transaction, error) { return _ERC20RealWorldAgent.contract.Transact(opts, "approve", spender, amount) } // Approve is a paid mutator transaction binding the contract method 0x095ea7b3. // // Solidity: function approve(address spender, uint256 amount) returns(bool) func (_ERC20RealWorldAgent *ERC20RealWorldAgentSession) Approve(spender common.Address, amount *big.Int) (*types.Transaction, error) { return _ERC20RealWorldAgent.Contract.Approve(&_ERC20RealWorldAgent.TransactOpts, spender, amount) } // Approve is a paid mutator transaction binding the contract method 0x095ea7b3. // // Solidity: function approve(address spender, uint256 amount) returns(bool) func (_ERC20RealWorldAgent *ERC20RealWorldAgentTransactorSession) Approve(spender common.Address, amount *big.Int) (*types.Transaction, error) { return _ERC20RealWorldAgent.Contract.Approve(&_ERC20RealWorldAgent.TransactOpts, spender, amount) } // DecreaseAllowance is a paid mutator transaction binding the contract method 0xa457c2d7. // // Solidity: function decreaseAllowance(address spender, uint256 subtractedValue) returns(bool) func (_ERC20RealWorldAgent *ERC20RealWorldAgentTransactor) DecreaseAllowance(opts *bind.TransactOpts, spender common.Address, subtractedValue *big.Int) (*types.Transaction, error) { return _ERC20RealWorldAgent.contract.Transact(opts, "decreaseAllowance", spender, subtractedValue) } // DecreaseAllowance is a paid mutator transaction binding the contract method 0xa457c2d7. // // Solidity: function decreaseAllowance(address spender, uint256 subtractedValue) returns(bool) func (_ERC20RealWorldAgent *ERC20RealWorldAgentSession) DecreaseAllowance(spender common.Address, subtractedValue *big.Int) (*types.Transaction, error) { return _ERC20RealWorldAgent.Contract.DecreaseAllowance(&_ERC20RealWorldAgent.TransactOpts, spender, subtractedValue) } // DecreaseAllowance is a paid mutator transaction binding the contract method 0xa457c2d7. // // Solidity: function decreaseAllowance(address spender, uint256 subtractedValue) returns(bool) func (_ERC20RealWorldAgent *ERC20RealWorldAgentTransactorSession) DecreaseAllowance(spender common.Address, subtractedValue *big.Int) (*types.Transaction, error) { return _ERC20RealWorldAgent.Contract.DecreaseAllowance(&_ERC20RealWorldAgent.TransactOpts, spender, subtractedValue) } // Delegate is a paid mutator transaction binding the contract method 0x5c19a95c. // // Solidity: function delegate(address delegatee) returns() func (_ERC20RealWorldAgent *ERC20RealWorldAgentTransactor) Delegate(opts *bind.TransactOpts, delegatee common.Address) (*types.Transaction, error) { return _ERC20RealWorldAgent.contract.Transact(opts, "delegate", delegatee) } // Delegate is a paid mutator transaction binding the contract method 0x5c19a95c. // // Solidity: function delegate(address delegatee) returns() func (_ERC20RealWorldAgent *ERC20RealWorldAgentSession) Delegate(delegatee common.Address) (*types.Transaction, error) { return _ERC20RealWorldAgent.Contract.Delegate(&_ERC20RealWorldAgent.TransactOpts, delegatee) } // Delegate is a paid mutator transaction binding the contract method 0x5c19a95c. // // Solidity: function delegate(address delegatee) returns() func (_ERC20RealWorldAgent *ERC20RealWorldAgentTransactorSession) Delegate(delegatee common.Address) (*types.Transaction, error) { return _ERC20RealWorldAgent.Contract.Delegate(&_ERC20RealWorldAgent.TransactOpts, delegatee) } // DelegateBySig is a paid mutator transaction binding the contract method 0xc3cda520. // // Solidity: function delegateBySig(address delegatee, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) returns() func (_ERC20RealWorldAgent *ERC20RealWorldAgentTransactor) DelegateBySig(opts *bind.TransactOpts, delegatee common.Address, nonce *big.Int, expiry *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _ERC20RealWorldAgent.contract.Transact(opts, "delegateBySig", delegatee, nonce, expiry, v, r, s) } // DelegateBySig is a paid mutator transaction binding the contract method 0xc3cda520. // // Solidity: function delegateBySig(address delegatee, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) returns() func (_ERC20RealWorldAgent *ERC20RealWorldAgentSession) DelegateBySig(delegatee common.Address, nonce *big.Int, expiry *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _ERC20RealWorldAgent.Contract.DelegateBySig(&_ERC20RealWorldAgent.TransactOpts, delegatee, nonce, expiry, v, r, s) } // DelegateBySig is a paid mutator transaction binding the contract method 0xc3cda520. // // Solidity: function delegateBySig(address delegatee, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) returns() func (_ERC20RealWorldAgent *ERC20RealWorldAgentTransactorSession) DelegateBySig(delegatee common.Address, nonce *big.Int, expiry *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _ERC20RealWorldAgent.Contract.DelegateBySig(&_ERC20RealWorldAgent.TransactOpts, delegatee, nonce, expiry, v, r, s) } // IncreaseAllowance is a paid mutator transaction binding the contract method 0x39509351. // // Solidity: function increaseAllowance(address spender, uint256 addedValue) returns(bool) func (_ERC20RealWorldAgent *ERC20RealWorldAgentTransactor) IncreaseAllowance(opts *bind.TransactOpts, spender common.Address, addedValue *big.Int) (*types.Transaction, error) { return _ERC20RealWorldAgent.contract.Transact(opts, "increaseAllowance", spender, addedValue) } // IncreaseAllowance is a paid mutator transaction binding the contract method 0x39509351. // // Solidity: function increaseAllowance(address spender, uint256 addedValue) returns(bool) func (_ERC20RealWorldAgent *ERC20RealWorldAgentSession) IncreaseAllowance(spender common.Address, addedValue *big.Int) (*types.Transaction, error) { return _ERC20RealWorldAgent.Contract.IncreaseAllowance(&_ERC20RealWorldAgent.TransactOpts, spender, addedValue) } // IncreaseAllowance is a paid mutator transaction binding the contract method 0x39509351. // // Solidity: function increaseAllowance(address spender, uint256 addedValue) returns(bool) func (_ERC20RealWorldAgent *ERC20RealWorldAgentTransactorSession) IncreaseAllowance(spender common.Address, addedValue *big.Int) (*types.Transaction, error) { return _ERC20RealWorldAgent.Contract.IncreaseAllowance(&_ERC20RealWorldAgent.TransactOpts, spender, addedValue) } // Permit is a paid mutator transaction binding the contract method 0xd505accf. // // Solidity: function permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) returns() func (_ERC20RealWorldAgent *ERC20RealWorldAgentTransactor) Permit(opts *bind.TransactOpts, owner common.Address, spender common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _ERC20RealWorldAgent.contract.Transact(opts, "permit", owner, spender, value, deadline, v, r, s) } // Permit is a paid mutator transaction binding the contract method 0xd505accf. // // Solidity: function permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) returns() func (_ERC20RealWorldAgent *ERC20RealWorldAgentSession) Permit(owner common.Address, spender common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _ERC20RealWorldAgent.Contract.Permit(&_ERC20RealWorldAgent.TransactOpts, owner, spender, value, deadline, v, r, s) } // Permit is a paid mutator transaction binding the contract method 0xd505accf. // // Solidity: function permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) returns() func (_ERC20RealWorldAgent *ERC20RealWorldAgentTransactorSession) Permit(owner common.Address, spender common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _ERC20RealWorldAgent.Contract.Permit(&_ERC20RealWorldAgent.TransactOpts, owner, spender, value, deadline, v, r, s) } // RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. // // Solidity: function renounceOwnership() returns() func (_ERC20RealWorldAgent *ERC20RealWorldAgentTransactor) RenounceOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { return _ERC20RealWorldAgent.contract.Transact(opts, "renounceOwnership") } // RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. // // Solidity: function renounceOwnership() returns() func (_ERC20RealWorldAgent *ERC20RealWorldAgentSession) RenounceOwnership() (*types.Transaction, error) { return _ERC20RealWorldAgent.Contract.RenounceOwnership(&_ERC20RealWorldAgent.TransactOpts) } // RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. // // Solidity: function renounceOwnership() returns() func (_ERC20RealWorldAgent *ERC20RealWorldAgentTransactorSession) RenounceOwnership() (*types.Transaction, error) { return _ERC20RealWorldAgent.Contract.RenounceOwnership(&_ERC20RealWorldAgent.TransactOpts) } // SetMinFeeToUse is a paid mutator transaction binding the contract method 0xaf5e3be0. // // Solidity: function setMinFeeToUse(uint256 minFeeToUse_) returns() func (_ERC20RealWorldAgent *ERC20RealWorldAgentTransactor) SetMinFeeToUse(opts *bind.TransactOpts, minFeeToUse_ *big.Int) (*types.Transaction, error) { return _ERC20RealWorldAgent.contract.Transact(opts, "setMinFeeToUse", minFeeToUse_) } // SetMinFeeToUse is a paid mutator transaction binding the contract method 0xaf5e3be0. // // Solidity: function setMinFeeToUse(uint256 minFeeToUse_) returns() func (_ERC20RealWorldAgent *ERC20RealWorldAgentSession) SetMinFeeToUse(minFeeToUse_ *big.Int) (*types.Transaction, error) { return _ERC20RealWorldAgent.Contract.SetMinFeeToUse(&_ERC20RealWorldAgent.TransactOpts, minFeeToUse_) } // SetMinFeeToUse is a paid mutator transaction binding the contract method 0xaf5e3be0. // // Solidity: function setMinFeeToUse(uint256 minFeeToUse_) returns() func (_ERC20RealWorldAgent *ERC20RealWorldAgentTransactorSession) SetMinFeeToUse(minFeeToUse_ *big.Int) (*types.Transaction, error) { return _ERC20RealWorldAgent.Contract.SetMinFeeToUse(&_ERC20RealWorldAgent.TransactOpts, minFeeToUse_) } // SetTimeout is a paid mutator transaction binding the contract method 0xdc80d104. // // Solidity: function setTimeout(uint32 timeout_) returns() func (_ERC20RealWorldAgent *ERC20RealWorldAgentTransactor) SetTimeout(opts *bind.TransactOpts, timeout_ uint32) (*types.Transaction, error) { return _ERC20RealWorldAgent.contract.Transact(opts, "setTimeout", timeout_) } // SetTimeout is a paid mutator transaction binding the contract method 0xdc80d104. // // Solidity: function setTimeout(uint32 timeout_) returns() func (_ERC20RealWorldAgent *ERC20RealWorldAgentSession) SetTimeout(timeout_ uint32) (*types.Transaction, error) { return _ERC20RealWorldAgent.Contract.SetTimeout(&_ERC20RealWorldAgent.TransactOpts, timeout_) } // SetTimeout is a paid mutator transaction binding the contract method 0xdc80d104. // // Solidity: function setTimeout(uint32 timeout_) returns() func (_ERC20RealWorldAgent *ERC20RealWorldAgentTransactorSession) SetTimeout(timeout_ uint32) (*types.Transaction, error) { return _ERC20RealWorldAgent.Contract.SetTimeout(&_ERC20RealWorldAgent.TransactOpts, timeout_) } // SetTokenFee is a paid mutator transaction binding the contract method 0x241da1c0. // // Solidity: function setTokenFee(address tokenFee_) returns() func (_ERC20RealWorldAgent *ERC20RealWorldAgentTransactor) SetTokenFee(opts *bind.TransactOpts, tokenFee_ common.Address) (*types.Transaction, error) { return _ERC20RealWorldAgent.contract.Transact(opts, "setTokenFee", tokenFee_) } // SetTokenFee is a paid mutator transaction binding the contract method 0x241da1c0. // // Solidity: function setTokenFee(address tokenFee_) returns() func (_ERC20RealWorldAgent *ERC20RealWorldAgentSession) SetTokenFee(tokenFee_ common.Address) (*types.Transaction, error) { return _ERC20RealWorldAgent.Contract.SetTokenFee(&_ERC20RealWorldAgent.TransactOpts, tokenFee_) } // SetTokenFee is a paid mutator transaction binding the contract method 0x241da1c0. // // Solidity: function setTokenFee(address tokenFee_) returns() func (_ERC20RealWorldAgent *ERC20RealWorldAgentTransactorSession) SetTokenFee(tokenFee_ common.Address) (*types.Transaction, error) { return _ERC20RealWorldAgent.Contract.SetTokenFee(&_ERC20RealWorldAgent.TransactOpts, tokenFee_) } // SetWorker is a paid mutator transaction binding the contract method 0xc26f6d44. // // Solidity: function setWorker(address newWorker) returns() func (_ERC20RealWorldAgent *ERC20RealWorldAgentTransactor) SetWorker(opts *bind.TransactOpts, newWorker common.Address) (*types.Transaction, error) { return _ERC20RealWorldAgent.contract.Transact(opts, "setWorker", newWorker) } // SetWorker is a paid mutator transaction binding the contract method 0xc26f6d44. // // Solidity: function setWorker(address newWorker) returns() func (_ERC20RealWorldAgent *ERC20RealWorldAgentSession) SetWorker(newWorker common.Address) (*types.Transaction, error) { return _ERC20RealWorldAgent.Contract.SetWorker(&_ERC20RealWorldAgent.TransactOpts, newWorker) } // SetWorker is a paid mutator transaction binding the contract method 0xc26f6d44. // // Solidity: function setWorker(address newWorker) returns() func (_ERC20RealWorldAgent *ERC20RealWorldAgentTransactorSession) SetWorker(newWorker common.Address) (*types.Transaction, error) { return _ERC20RealWorldAgent.Contract.SetWorker(&_ERC20RealWorldAgent.TransactOpts, newWorker) } // SubmitSolution is a paid mutator transaction binding the contract method 0xe84dee6b. // // Solidity: function submitSolution(uint256 actId, bytes result) returns() func (_ERC20RealWorldAgent *ERC20RealWorldAgentTransactor) SubmitSolution(opts *bind.TransactOpts, actId *big.Int, result []byte) (*types.Transaction, error) { return _ERC20RealWorldAgent.contract.Transact(opts, "submitSolution", actId, result) } // SubmitSolution is a paid mutator transaction binding the contract method 0xe84dee6b. // // Solidity: function submitSolution(uint256 actId, bytes result) returns() func (_ERC20RealWorldAgent *ERC20RealWorldAgentSession) SubmitSolution(actId *big.Int, result []byte) (*types.Transaction, error) { return _ERC20RealWorldAgent.Contract.SubmitSolution(&_ERC20RealWorldAgent.TransactOpts, actId, result) } // SubmitSolution is a paid mutator transaction binding the contract method 0xe84dee6b. // // Solidity: function submitSolution(uint256 actId, bytes result) returns() func (_ERC20RealWorldAgent *ERC20RealWorldAgentTransactorSession) SubmitSolution(actId *big.Int, result []byte) (*types.Transaction, error) { return _ERC20RealWorldAgent.Contract.SubmitSolution(&_ERC20RealWorldAgent.TransactOpts, actId, result) } // Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. // // Solidity: function transfer(address to, uint256 amount) returns(bool) func (_ERC20RealWorldAgent *ERC20RealWorldAgentTransactor) Transfer(opts *bind.TransactOpts, to common.Address, amount *big.Int) (*types.Transaction, error) { return _ERC20RealWorldAgent.contract.Transact(opts, "transfer", to, amount) } // Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. // // Solidity: function transfer(address to, uint256 amount) returns(bool) func (_ERC20RealWorldAgent *ERC20RealWorldAgentSession) Transfer(to common.Address, amount *big.Int) (*types.Transaction, error) { return _ERC20RealWorldAgent.Contract.Transfer(&_ERC20RealWorldAgent.TransactOpts, to, amount) } // Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. // // Solidity: function transfer(address to, uint256 amount) returns(bool) func (_ERC20RealWorldAgent *ERC20RealWorldAgentTransactorSession) Transfer(to common.Address, amount *big.Int) (*types.Transaction, error) { return _ERC20RealWorldAgent.Contract.Transfer(&_ERC20RealWorldAgent.TransactOpts, to, amount) } // TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. // // Solidity: function transferFrom(address from, address to, uint256 amount) returns(bool) func (_ERC20RealWorldAgent *ERC20RealWorldAgentTransactor) TransferFrom(opts *bind.TransactOpts, from common.Address, to common.Address, amount *big.Int) (*types.Transaction, error) { return _ERC20RealWorldAgent.contract.Transact(opts, "transferFrom", from, to, amount) } // TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. // // Solidity: function transferFrom(address from, address to, uint256 amount) returns(bool) func (_ERC20RealWorldAgent *ERC20RealWorldAgentSession) TransferFrom(from common.Address, to common.Address, amount *big.Int) (*types.Transaction, error) { return _ERC20RealWorldAgent.Contract.TransferFrom(&_ERC20RealWorldAgent.TransactOpts, from, to, amount) } // TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. // // Solidity: function transferFrom(address from, address to, uint256 amount) returns(bool) func (_ERC20RealWorldAgent *ERC20RealWorldAgentTransactorSession) TransferFrom(from common.Address, to common.Address, amount *big.Int) (*types.Transaction, error) { return _ERC20RealWorldAgent.Contract.TransferFrom(&_ERC20RealWorldAgent.TransactOpts, from, to, amount) } // TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. // // Solidity: function transferOwnership(address newOwner) returns() func (_ERC20RealWorldAgent *ERC20RealWorldAgentTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) { return _ERC20RealWorldAgent.contract.Transact(opts, "transferOwnership", newOwner) } // TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. // // Solidity: function transferOwnership(address newOwner) returns() func (_ERC20RealWorldAgent *ERC20RealWorldAgentSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { return _ERC20RealWorldAgent.Contract.TransferOwnership(&_ERC20RealWorldAgent.TransactOpts, newOwner) } // TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. // // Solidity: function transferOwnership(address newOwner) returns() func (_ERC20RealWorldAgent *ERC20RealWorldAgentTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { return _ERC20RealWorldAgent.Contract.TransferOwnership(&_ERC20RealWorldAgent.TransactOpts, newOwner) } // WithdrawFeeToken is a paid mutator transaction binding the contract method 0xb2ef14e3. // // Solidity: function withdrawFeeToken(address to, uint256 amount) returns() func (_ERC20RealWorldAgent *ERC20RealWorldAgentTransactor) WithdrawFeeToken(opts *bind.TransactOpts, to common.Address, amount *big.Int) (*types.Transaction, error) { return _ERC20RealWorldAgent.contract.Transact(opts, "withdrawFeeToken", to, amount) } // WithdrawFeeToken is a paid mutator transaction binding the contract method 0xb2ef14e3. // // Solidity: function withdrawFeeToken(address to, uint256 amount) returns() func (_ERC20RealWorldAgent *ERC20RealWorldAgentSession) WithdrawFeeToken(to common.Address, amount *big.Int) (*types.Transaction, error) { return _ERC20RealWorldAgent.Contract.WithdrawFeeToken(&_ERC20RealWorldAgent.TransactOpts, to, amount) } // WithdrawFeeToken is a paid mutator transaction binding the contract method 0xb2ef14e3. // // Solidity: function withdrawFeeToken(address to, uint256 amount) returns() func (_ERC20RealWorldAgent *ERC20RealWorldAgentTransactorSession) WithdrawFeeToken(to common.Address, amount *big.Int) (*types.Transaction, error) { return _ERC20RealWorldAgent.Contract.WithdrawFeeToken(&_ERC20RealWorldAgent.TransactOpts, to, amount) } // ERC20RealWorldAgentApprovalIterator is returned from FilterApproval and is used to iterate over the raw logs and unpacked data for Approval events raised by the ERC20RealWorldAgent contract. type ERC20RealWorldAgentApprovalIterator struct { Event *ERC20RealWorldAgentApproval // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *ERC20RealWorldAgentApprovalIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(ERC20RealWorldAgentApproval) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(ERC20RealWorldAgentApproval) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *ERC20RealWorldAgentApprovalIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *ERC20RealWorldAgentApprovalIterator) Close() error { it.sub.Unsubscribe() return nil } // ERC20RealWorldAgentApproval represents a Approval event raised by the ERC20RealWorldAgent contract. type ERC20RealWorldAgentApproval struct { Owner common.Address Spender common.Address Value *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterApproval is a free log retrieval operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. // // Solidity: event Approval(address indexed owner, address indexed spender, uint256 value) func (_ERC20RealWorldAgent *ERC20RealWorldAgentFilterer) FilterApproval(opts *bind.FilterOpts, owner []common.Address, spender []common.Address) (*ERC20RealWorldAgentApprovalIterator, error) { var ownerRule []interface{} for _, ownerItem := range owner { ownerRule = append(ownerRule, ownerItem) } var spenderRule []interface{} for _, spenderItem := range spender { spenderRule = append(spenderRule, spenderItem) } logs, sub, err := _ERC20RealWorldAgent.contract.FilterLogs(opts, "Approval", ownerRule, spenderRule) if err != nil { return nil, err } return &ERC20RealWorldAgentApprovalIterator{contract: _ERC20RealWorldAgent.contract, event: "Approval", logs: logs, sub: sub}, nil } // WatchApproval is a free log subscription operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. // // Solidity: event Approval(address indexed owner, address indexed spender, uint256 value) func (_ERC20RealWorldAgent *ERC20RealWorldAgentFilterer) WatchApproval(opts *bind.WatchOpts, sink chan<- *ERC20RealWorldAgentApproval, owner []common.Address, spender []common.Address) (event.Subscription, error) { var ownerRule []interface{} for _, ownerItem := range owner { ownerRule = append(ownerRule, ownerItem) } var spenderRule []interface{} for _, spenderItem := range spender { spenderRule = append(spenderRule, spenderItem) } logs, sub, err := _ERC20RealWorldAgent.contract.WatchLogs(opts, "Approval", ownerRule, spenderRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(ERC20RealWorldAgentApproval) if err := _ERC20RealWorldAgent.contract.UnpackLog(event, "Approval", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseApproval is a log parse operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. // // Solidity: event Approval(address indexed owner, address indexed spender, uint256 value) func (_ERC20RealWorldAgent *ERC20RealWorldAgentFilterer) ParseApproval(log types.Log) (*ERC20RealWorldAgentApproval, error) { event := new(ERC20RealWorldAgentApproval) if err := _ERC20RealWorldAgent.contract.UnpackLog(event, "Approval", log); err != nil { return nil, err } event.Raw = log return event, nil } // ERC20RealWorldAgentDelegateChangedIterator is returned from FilterDelegateChanged and is used to iterate over the raw logs and unpacked data for DelegateChanged events raised by the ERC20RealWorldAgent contract. type ERC20RealWorldAgentDelegateChangedIterator struct { Event *ERC20RealWorldAgentDelegateChanged // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *ERC20RealWorldAgentDelegateChangedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(ERC20RealWorldAgentDelegateChanged) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(ERC20RealWorldAgentDelegateChanged) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *ERC20RealWorldAgentDelegateChangedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *ERC20RealWorldAgentDelegateChangedIterator) Close() error { it.sub.Unsubscribe() return nil } // ERC20RealWorldAgentDelegateChanged represents a DelegateChanged event raised by the ERC20RealWorldAgent contract. type ERC20RealWorldAgentDelegateChanged struct { Delegator common.Address FromDelegate common.Address ToDelegate common.Address Raw types.Log // Blockchain specific contextual infos } // FilterDelegateChanged is a free log retrieval operation binding the contract event 0x3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f. // // Solidity: event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate) func (_ERC20RealWorldAgent *ERC20RealWorldAgentFilterer) FilterDelegateChanged(opts *bind.FilterOpts, delegator []common.Address, fromDelegate []common.Address, toDelegate []common.Address) (*ERC20RealWorldAgentDelegateChangedIterator, error) { var delegatorRule []interface{} for _, delegatorItem := range delegator { delegatorRule = append(delegatorRule, delegatorItem) } var fromDelegateRule []interface{} for _, fromDelegateItem := range fromDelegate { fromDelegateRule = append(fromDelegateRule, fromDelegateItem) } var toDelegateRule []interface{} for _, toDelegateItem := range toDelegate { toDelegateRule = append(toDelegateRule, toDelegateItem) } logs, sub, err := _ERC20RealWorldAgent.contract.FilterLogs(opts, "DelegateChanged", delegatorRule, fromDelegateRule, toDelegateRule) if err != nil { return nil, err } return &ERC20RealWorldAgentDelegateChangedIterator{contract: _ERC20RealWorldAgent.contract, event: "DelegateChanged", logs: logs, sub: sub}, nil } // WatchDelegateChanged is a free log subscription operation binding the contract event 0x3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f. // // Solidity: event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate) func (_ERC20RealWorldAgent *ERC20RealWorldAgentFilterer) WatchDelegateChanged(opts *bind.WatchOpts, sink chan<- *ERC20RealWorldAgentDelegateChanged, delegator []common.Address, fromDelegate []common.Address, toDelegate []common.Address) (event.Subscription, error) { var delegatorRule []interface{} for _, delegatorItem := range delegator { delegatorRule = append(delegatorRule, delegatorItem) } var fromDelegateRule []interface{} for _, fromDelegateItem := range fromDelegate { fromDelegateRule = append(fromDelegateRule, fromDelegateItem) } var toDelegateRule []interface{} for _, toDelegateItem := range toDelegate { toDelegateRule = append(toDelegateRule, toDelegateItem) } logs, sub, err := _ERC20RealWorldAgent.contract.WatchLogs(opts, "DelegateChanged", delegatorRule, fromDelegateRule, toDelegateRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(ERC20RealWorldAgentDelegateChanged) if err := _ERC20RealWorldAgent.contract.UnpackLog(event, "DelegateChanged", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseDelegateChanged is a log parse operation binding the contract event 0x3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f. // // Solidity: event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate) func (_ERC20RealWorldAgent *ERC20RealWorldAgentFilterer) ParseDelegateChanged(log types.Log) (*ERC20RealWorldAgentDelegateChanged, error) { event := new(ERC20RealWorldAgentDelegateChanged) if err := _ERC20RealWorldAgent.contract.UnpackLog(event, "DelegateChanged", log); err != nil { return nil, err } event.Raw = log return event, nil } // ERC20RealWorldAgentDelegateVotesChangedIterator is returned from FilterDelegateVotesChanged and is used to iterate over the raw logs and unpacked data for DelegateVotesChanged events raised by the ERC20RealWorldAgent contract. type ERC20RealWorldAgentDelegateVotesChangedIterator struct { Event *ERC20RealWorldAgentDelegateVotesChanged // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *ERC20RealWorldAgentDelegateVotesChangedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(ERC20RealWorldAgentDelegateVotesChanged) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(ERC20RealWorldAgentDelegateVotesChanged) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *ERC20RealWorldAgentDelegateVotesChangedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *ERC20RealWorldAgentDelegateVotesChangedIterator) Close() error { it.sub.Unsubscribe() return nil } // ERC20RealWorldAgentDelegateVotesChanged represents a DelegateVotesChanged event raised by the ERC20RealWorldAgent contract. type ERC20RealWorldAgentDelegateVotesChanged struct { Delegate common.Address PreviousBalance *big.Int NewBalance *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterDelegateVotesChanged is a free log retrieval operation binding the contract event 0xdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a724. // // Solidity: event DelegateVotesChanged(address indexed delegate, uint256 previousBalance, uint256 newBalance) func (_ERC20RealWorldAgent *ERC20RealWorldAgentFilterer) FilterDelegateVotesChanged(opts *bind.FilterOpts, delegate []common.Address) (*ERC20RealWorldAgentDelegateVotesChangedIterator, error) { var delegateRule []interface{} for _, delegateItem := range delegate { delegateRule = append(delegateRule, delegateItem) } logs, sub, err := _ERC20RealWorldAgent.contract.FilterLogs(opts, "DelegateVotesChanged", delegateRule) if err != nil { return nil, err } return &ERC20RealWorldAgentDelegateVotesChangedIterator{contract: _ERC20RealWorldAgent.contract, event: "DelegateVotesChanged", logs: logs, sub: sub}, nil } // WatchDelegateVotesChanged is a free log subscription operation binding the contract event 0xdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a724. // // Solidity: event DelegateVotesChanged(address indexed delegate, uint256 previousBalance, uint256 newBalance) func (_ERC20RealWorldAgent *ERC20RealWorldAgentFilterer) WatchDelegateVotesChanged(opts *bind.WatchOpts, sink chan<- *ERC20RealWorldAgentDelegateVotesChanged, delegate []common.Address) (event.Subscription, error) { var delegateRule []interface{} for _, delegateItem := range delegate { delegateRule = append(delegateRule, delegateItem) } logs, sub, err := _ERC20RealWorldAgent.contract.WatchLogs(opts, "DelegateVotesChanged", delegateRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(ERC20RealWorldAgentDelegateVotesChanged) if err := _ERC20RealWorldAgent.contract.UnpackLog(event, "DelegateVotesChanged", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseDelegateVotesChanged is a log parse operation binding the contract event 0xdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a724. // // Solidity: event DelegateVotesChanged(address indexed delegate, uint256 previousBalance, uint256 newBalance) func (_ERC20RealWorldAgent *ERC20RealWorldAgentFilterer) ParseDelegateVotesChanged(log types.Log) (*ERC20RealWorldAgentDelegateVotesChanged, error) { event := new(ERC20RealWorldAgentDelegateVotesChanged) if err := _ERC20RealWorldAgent.contract.UnpackLog(event, "DelegateVotesChanged", log); err != nil { return nil, err } event.Raw = log return event, nil } // ERC20RealWorldAgentEIP712DomainChangedIterator is returned from FilterEIP712DomainChanged and is used to iterate over the raw logs and unpacked data for EIP712DomainChanged events raised by the ERC20RealWorldAgent contract. type ERC20RealWorldAgentEIP712DomainChangedIterator struct { Event *ERC20RealWorldAgentEIP712DomainChanged // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *ERC20RealWorldAgentEIP712DomainChangedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(ERC20RealWorldAgentEIP712DomainChanged) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(ERC20RealWorldAgentEIP712DomainChanged) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *ERC20RealWorldAgentEIP712DomainChangedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *ERC20RealWorldAgentEIP712DomainChangedIterator) Close() error { it.sub.Unsubscribe() return nil } // ERC20RealWorldAgentEIP712DomainChanged represents a EIP712DomainChanged event raised by the ERC20RealWorldAgent contract. type ERC20RealWorldAgentEIP712DomainChanged struct { Raw types.Log // Blockchain specific contextual infos } // FilterEIP712DomainChanged is a free log retrieval operation binding the contract event 0x0a6387c9ea3628b88a633bb4f3b151770f70085117a15f9bf3787cda53f13d31. // // Solidity: event EIP712DomainChanged() func (_ERC20RealWorldAgent *ERC20RealWorldAgentFilterer) FilterEIP712DomainChanged(opts *bind.FilterOpts) (*ERC20RealWorldAgentEIP712DomainChangedIterator, error) { logs, sub, err := _ERC20RealWorldAgent.contract.FilterLogs(opts, "EIP712DomainChanged") if err != nil { return nil, err } return &ERC20RealWorldAgentEIP712DomainChangedIterator{contract: _ERC20RealWorldAgent.contract, event: "EIP712DomainChanged", logs: logs, sub: sub}, nil } // WatchEIP712DomainChanged is a free log subscription operation binding the contract event 0x0a6387c9ea3628b88a633bb4f3b151770f70085117a15f9bf3787cda53f13d31. // // Solidity: event EIP712DomainChanged() func (_ERC20RealWorldAgent *ERC20RealWorldAgentFilterer) WatchEIP712DomainChanged(opts *bind.WatchOpts, sink chan<- *ERC20RealWorldAgentEIP712DomainChanged) (event.Subscription, error) { logs, sub, err := _ERC20RealWorldAgent.contract.WatchLogs(opts, "EIP712DomainChanged") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(ERC20RealWorldAgentEIP712DomainChanged) if err := _ERC20RealWorldAgent.contract.UnpackLog(event, "EIP712DomainChanged", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseEIP712DomainChanged is a log parse operation binding the contract event 0x0a6387c9ea3628b88a633bb4f3b151770f70085117a15f9bf3787cda53f13d31. // // Solidity: event EIP712DomainChanged() func (_ERC20RealWorldAgent *ERC20RealWorldAgentFilterer) ParseEIP712DomainChanged(log types.Log) (*ERC20RealWorldAgentEIP712DomainChanged, error) { event := new(ERC20RealWorldAgentEIP712DomainChanged) if err := _ERC20RealWorldAgent.contract.UnpackLog(event, "EIP712DomainChanged", log); err != nil { return nil, err } event.Raw = log return event, nil } // ERC20RealWorldAgentExecutionRequestedIterator is returned from FilterExecutionRequested and is used to iterate over the raw logs and unpacked data for ExecutionRequested events raised by the ERC20RealWorldAgent contract. type ERC20RealWorldAgentExecutionRequestedIterator struct { Event *ERC20RealWorldAgentExecutionRequested // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *ERC20RealWorldAgentExecutionRequestedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(ERC20RealWorldAgentExecutionRequested) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(ERC20RealWorldAgentExecutionRequested) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *ERC20RealWorldAgentExecutionRequestedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *ERC20RealWorldAgentExecutionRequestedIterator) Close() error { it.sub.Unsubscribe() return nil } // ERC20RealWorldAgentExecutionRequested represents a ExecutionRequested event raised by the ERC20RealWorldAgent contract. type ERC20RealWorldAgentExecutionRequested struct { ActId *big.Int Uuid [32]byte Creator common.Address Data []byte Raw types.Log // Blockchain specific contextual infos } // FilterExecutionRequested is a free log retrieval operation binding the contract event 0x9096741026bdd638bcc5cb995f0f00b4574b81f120a23c4a7086347116bf58a1. // // Solidity: event ExecutionRequested(uint256 indexed actId, bytes32 indexed uuid, address indexed creator, bytes data) func (_ERC20RealWorldAgent *ERC20RealWorldAgentFilterer) FilterExecutionRequested(opts *bind.FilterOpts, actId []*big.Int, uuid [][32]byte, creator []common.Address) (*ERC20RealWorldAgentExecutionRequestedIterator, error) { var actIdRule []interface{} for _, actIdItem := range actId { actIdRule = append(actIdRule, actIdItem) } var uuidRule []interface{} for _, uuidItem := range uuid { uuidRule = append(uuidRule, uuidItem) } var creatorRule []interface{} for _, creatorItem := range creator { creatorRule = append(creatorRule, creatorItem) } logs, sub, err := _ERC20RealWorldAgent.contract.FilterLogs(opts, "ExecutionRequested", actIdRule, uuidRule, creatorRule) if err != nil { return nil, err } return &ERC20RealWorldAgentExecutionRequestedIterator{contract: _ERC20RealWorldAgent.contract, event: "ExecutionRequested", logs: logs, sub: sub}, nil } // WatchExecutionRequested is a free log subscription operation binding the contract event 0x9096741026bdd638bcc5cb995f0f00b4574b81f120a23c4a7086347116bf58a1. // // Solidity: event ExecutionRequested(uint256 indexed actId, bytes32 indexed uuid, address indexed creator, bytes data) func (_ERC20RealWorldAgent *ERC20RealWorldAgentFilterer) WatchExecutionRequested(opts *bind.WatchOpts, sink chan<- *ERC20RealWorldAgentExecutionRequested, actId []*big.Int, uuid [][32]byte, creator []common.Address) (event.Subscription, error) { var actIdRule []interface{} for _, actIdItem := range actId { actIdRule = append(actIdRule, actIdItem) } var uuidRule []interface{} for _, uuidItem := range uuid { uuidRule = append(uuidRule, uuidItem) } var creatorRule []interface{} for _, creatorItem := range creator { creatorRule = append(creatorRule, creatorItem) } logs, sub, err := _ERC20RealWorldAgent.contract.WatchLogs(opts, "ExecutionRequested", actIdRule, uuidRule, creatorRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(ERC20RealWorldAgentExecutionRequested) if err := _ERC20RealWorldAgent.contract.UnpackLog(event, "ExecutionRequested", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseExecutionRequested is a log parse operation binding the contract event 0x9096741026bdd638bcc5cb995f0f00b4574b81f120a23c4a7086347116bf58a1. // // Solidity: event ExecutionRequested(uint256 indexed actId, bytes32 indexed uuid, address indexed creator, bytes data) func (_ERC20RealWorldAgent *ERC20RealWorldAgentFilterer) ParseExecutionRequested(log types.Log) (*ERC20RealWorldAgentExecutionRequested, error) { event := new(ERC20RealWorldAgentExecutionRequested) if err := _ERC20RealWorldAgent.contract.UnpackLog(event, "ExecutionRequested", log); err != nil { return nil, err } event.Raw = log return event, nil } // ERC20RealWorldAgentOwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the ERC20RealWorldAgent contract. type ERC20RealWorldAgentOwnershipTransferredIterator struct { Event *ERC20RealWorldAgentOwnershipTransferred // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *ERC20RealWorldAgentOwnershipTransferredIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(ERC20RealWorldAgentOwnershipTransferred) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(ERC20RealWorldAgentOwnershipTransferred) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *ERC20RealWorldAgentOwnershipTransferredIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *ERC20RealWorldAgentOwnershipTransferredIterator) Close() error { it.sub.Unsubscribe() return nil } // ERC20RealWorldAgentOwnershipTransferred represents a OwnershipTransferred event raised by the ERC20RealWorldAgent contract. type ERC20RealWorldAgentOwnershipTransferred struct { PreviousOwner common.Address NewOwner common.Address Raw types.Log // Blockchain specific contextual infos } // FilterOwnershipTransferred is a free log retrieval operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. // // Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) func (_ERC20RealWorldAgent *ERC20RealWorldAgentFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*ERC20RealWorldAgentOwnershipTransferredIterator, error) { var previousOwnerRule []interface{} for _, previousOwnerItem := range previousOwner { previousOwnerRule = append(previousOwnerRule, previousOwnerItem) } var newOwnerRule []interface{} for _, newOwnerItem := range newOwner { newOwnerRule = append(newOwnerRule, newOwnerItem) } logs, sub, err := _ERC20RealWorldAgent.contract.FilterLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) if err != nil { return nil, err } return &ERC20RealWorldAgentOwnershipTransferredIterator{contract: _ERC20RealWorldAgent.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil } // WatchOwnershipTransferred is a free log subscription operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. // // Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) func (_ERC20RealWorldAgent *ERC20RealWorldAgentFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *ERC20RealWorldAgentOwnershipTransferred, previousOwner []common.Address, newOwner []common.Address) (event.Subscription, error) { var previousOwnerRule []interface{} for _, previousOwnerItem := range previousOwner { previousOwnerRule = append(previousOwnerRule, previousOwnerItem) } var newOwnerRule []interface{} for _, newOwnerItem := range newOwner { newOwnerRule = append(newOwnerRule, newOwnerItem) } logs, sub, err := _ERC20RealWorldAgent.contract.WatchLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(ERC20RealWorldAgentOwnershipTransferred) if err := _ERC20RealWorldAgent.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseOwnershipTransferred is a log parse operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. // // Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) func (_ERC20RealWorldAgent *ERC20RealWorldAgentFilterer) ParseOwnershipTransferred(log types.Log) (*ERC20RealWorldAgentOwnershipTransferred, error) { event := new(ERC20RealWorldAgentOwnershipTransferred) if err := _ERC20RealWorldAgent.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { return nil, err } event.Raw = log return event, nil } // ERC20RealWorldAgentSolutionSubmittedIterator is returned from FilterSolutionSubmitted and is used to iterate over the raw logs and unpacked data for SolutionSubmitted events raised by the ERC20RealWorldAgent contract. type ERC20RealWorldAgentSolutionSubmittedIterator struct { Event *ERC20RealWorldAgentSolutionSubmitted // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *ERC20RealWorldAgentSolutionSubmittedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(ERC20RealWorldAgentSolutionSubmitted) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(ERC20RealWorldAgentSolutionSubmitted) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *ERC20RealWorldAgentSolutionSubmittedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *ERC20RealWorldAgentSolutionSubmittedIterator) Close() error { it.sub.Unsubscribe() return nil } // ERC20RealWorldAgentSolutionSubmitted represents a SolutionSubmitted event raised by the ERC20RealWorldAgent contract. type ERC20RealWorldAgentSolutionSubmitted struct { ActId *big.Int Processor common.Address Result []byte Raw types.Log // Blockchain specific contextual infos } // FilterSolutionSubmitted is a free log retrieval operation binding the contract event 0x847d58c674038bb7f3ec4f6bbd97d64a3da0f3db4312900c67a2778f0b2840ba. // // Solidity: event SolutionSubmitted(uint256 indexed actId, address indexed processor, bytes result) func (_ERC20RealWorldAgent *ERC20RealWorldAgentFilterer) FilterSolutionSubmitted(opts *bind.FilterOpts, actId []*big.Int, processor []common.Address) (*ERC20RealWorldAgentSolutionSubmittedIterator, error) { var actIdRule []interface{} for _, actIdItem := range actId { actIdRule = append(actIdRule, actIdItem) } var processorRule []interface{} for _, processorItem := range processor { processorRule = append(processorRule, processorItem) } logs, sub, err := _ERC20RealWorldAgent.contract.FilterLogs(opts, "SolutionSubmitted", actIdRule, processorRule) if err != nil { return nil, err } return &ERC20RealWorldAgentSolutionSubmittedIterator{contract: _ERC20RealWorldAgent.contract, event: "SolutionSubmitted", logs: logs, sub: sub}, nil } // WatchSolutionSubmitted is a free log subscription operation binding the contract event 0x847d58c674038bb7f3ec4f6bbd97d64a3da0f3db4312900c67a2778f0b2840ba. // // Solidity: event SolutionSubmitted(uint256 indexed actId, address indexed processor, bytes result) func (_ERC20RealWorldAgent *ERC20RealWorldAgentFilterer) WatchSolutionSubmitted(opts *bind.WatchOpts, sink chan<- *ERC20RealWorldAgentSolutionSubmitted, actId []*big.Int, processor []common.Address) (event.Subscription, error) { var actIdRule []interface{} for _, actIdItem := range actId { actIdRule = append(actIdRule, actIdItem) } var processorRule []interface{} for _, processorItem := range processor { processorRule = append(processorRule, processorItem) } logs, sub, err := _ERC20RealWorldAgent.contract.WatchLogs(opts, "SolutionSubmitted", actIdRule, processorRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(ERC20RealWorldAgentSolutionSubmitted) if err := _ERC20RealWorldAgent.contract.UnpackLog(event, "SolutionSubmitted", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseSolutionSubmitted is a log parse operation binding the contract event 0x847d58c674038bb7f3ec4f6bbd97d64a3da0f3db4312900c67a2778f0b2840ba. // // Solidity: event SolutionSubmitted(uint256 indexed actId, address indexed processor, bytes result) func (_ERC20RealWorldAgent *ERC20RealWorldAgentFilterer) ParseSolutionSubmitted(log types.Log) (*ERC20RealWorldAgentSolutionSubmitted, error) { event := new(ERC20RealWorldAgentSolutionSubmitted) if err := _ERC20RealWorldAgent.contract.UnpackLog(event, "SolutionSubmitted", log); err != nil { return nil, err } event.Raw = log return event, nil } // ERC20RealWorldAgentTransferIterator is returned from FilterTransfer and is used to iterate over the raw logs and unpacked data for Transfer events raised by the ERC20RealWorldAgent contract. type ERC20RealWorldAgentTransferIterator struct { Event *ERC20RealWorldAgentTransfer // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *ERC20RealWorldAgentTransferIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(ERC20RealWorldAgentTransfer) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(ERC20RealWorldAgentTransfer) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *ERC20RealWorldAgentTransferIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *ERC20RealWorldAgentTransferIterator) Close() error { it.sub.Unsubscribe() return nil } // ERC20RealWorldAgentTransfer represents a Transfer event raised by the ERC20RealWorldAgent contract. type ERC20RealWorldAgentTransfer struct { From common.Address To common.Address Value *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterTransfer is a free log retrieval operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. // // Solidity: event Transfer(address indexed from, address indexed to, uint256 value) func (_ERC20RealWorldAgent *ERC20RealWorldAgentFilterer) FilterTransfer(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*ERC20RealWorldAgentTransferIterator, error) { var fromRule []interface{} for _, fromItem := range from { fromRule = append(fromRule, fromItem) } var toRule []interface{} for _, toItem := range to { toRule = append(toRule, toItem) } logs, sub, err := _ERC20RealWorldAgent.contract.FilterLogs(opts, "Transfer", fromRule, toRule) if err != nil { return nil, err } return &ERC20RealWorldAgentTransferIterator{contract: _ERC20RealWorldAgent.contract, event: "Transfer", logs: logs, sub: sub}, nil } // WatchTransfer is a free log subscription operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. // // Solidity: event Transfer(address indexed from, address indexed to, uint256 value) func (_ERC20RealWorldAgent *ERC20RealWorldAgentFilterer) WatchTransfer(opts *bind.WatchOpts, sink chan<- *ERC20RealWorldAgentTransfer, from []common.Address, to []common.Address) (event.Subscription, error) { var fromRule []interface{} for _, fromItem := range from { fromRule = append(fromRule, fromItem) } var toRule []interface{} for _, toItem := range to { toRule = append(toRule, toItem) } logs, sub, err := _ERC20RealWorldAgent.contract.WatchLogs(opts, "Transfer", fromRule, toRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(ERC20RealWorldAgentTransfer) if err := _ERC20RealWorldAgent.contract.UnpackLog(event, "Transfer", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseTransfer is a log parse operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. // // Solidity: event Transfer(address indexed from, address indexed to, uint256 value) func (_ERC20RealWorldAgent *ERC20RealWorldAgentFilterer) ParseTransfer(log types.Log) (*ERC20RealWorldAgentTransfer, error) { event := new(ERC20RealWorldAgentTransfer) if err := _ERC20RealWorldAgent.contract.UnpackLog(event, "Transfer", log); err != nil { return nil, err } event.Raw = log return event, nil } // ERC20RealWorldAgentWorkerUpdatedIterator is returned from FilterWorkerUpdated and is used to iterate over the raw logs and unpacked data for WorkerUpdated events raised by the ERC20RealWorldAgent contract. type ERC20RealWorldAgentWorkerUpdatedIterator struct { Event *ERC20RealWorldAgentWorkerUpdated // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *ERC20RealWorldAgentWorkerUpdatedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(ERC20RealWorldAgentWorkerUpdated) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(ERC20RealWorldAgentWorkerUpdated) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *ERC20RealWorldAgentWorkerUpdatedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *ERC20RealWorldAgentWorkerUpdatedIterator) Close() error { it.sub.Unsubscribe() return nil } // ERC20RealWorldAgentWorkerUpdated represents a WorkerUpdated event raised by the ERC20RealWorldAgent contract. type ERC20RealWorldAgentWorkerUpdated struct { OldWorker common.Address NewWorker common.Address Raw types.Log // Blockchain specific contextual infos } // FilterWorkerUpdated is a free log retrieval operation binding the contract event 0x98b88aa89cb5f247008e613dc8529d633ab05a62f7120c07ebcfcdd852fc2a8d. // // Solidity: event WorkerUpdated(address indexed oldWorker, address indexed newWorker) func (_ERC20RealWorldAgent *ERC20RealWorldAgentFilterer) FilterWorkerUpdated(opts *bind.FilterOpts, oldWorker []common.Address, newWorker []common.Address) (*ERC20RealWorldAgentWorkerUpdatedIterator, error) { var oldWorkerRule []interface{} for _, oldWorkerItem := range oldWorker { oldWorkerRule = append(oldWorkerRule, oldWorkerItem) } var newWorkerRule []interface{} for _, newWorkerItem := range newWorker { newWorkerRule = append(newWorkerRule, newWorkerItem) } logs, sub, err := _ERC20RealWorldAgent.contract.FilterLogs(opts, "WorkerUpdated", oldWorkerRule, newWorkerRule) if err != nil { return nil, err } return &ERC20RealWorldAgentWorkerUpdatedIterator{contract: _ERC20RealWorldAgent.contract, event: "WorkerUpdated", logs: logs, sub: sub}, nil } // WatchWorkerUpdated is a free log subscription operation binding the contract event 0x98b88aa89cb5f247008e613dc8529d633ab05a62f7120c07ebcfcdd852fc2a8d. // // Solidity: event WorkerUpdated(address indexed oldWorker, address indexed newWorker) func (_ERC20RealWorldAgent *ERC20RealWorldAgentFilterer) WatchWorkerUpdated(opts *bind.WatchOpts, sink chan<- *ERC20RealWorldAgentWorkerUpdated, oldWorker []common.Address, newWorker []common.Address) (event.Subscription, error) { var oldWorkerRule []interface{} for _, oldWorkerItem := range oldWorker { oldWorkerRule = append(oldWorkerRule, oldWorkerItem) } var newWorkerRule []interface{} for _, newWorkerItem := range newWorker { newWorkerRule = append(newWorkerRule, newWorkerItem) } logs, sub, err := _ERC20RealWorldAgent.contract.WatchLogs(opts, "WorkerUpdated", oldWorkerRule, newWorkerRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(ERC20RealWorldAgentWorkerUpdated) if err := _ERC20RealWorldAgent.contract.UnpackLog(event, "WorkerUpdated", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseWorkerUpdated is a log parse operation binding the contract event 0x98b88aa89cb5f247008e613dc8529d633ab05a62f7120c07ebcfcdd852fc2a8d. // // Solidity: event WorkerUpdated(address indexed oldWorker, address indexed newWorker) func (_ERC20RealWorldAgent *ERC20RealWorldAgentFilterer) ParseWorkerUpdated(log types.Log) (*ERC20RealWorldAgentWorkerUpdated, error) { event := new(ERC20RealWorldAgentWorkerUpdated) if err := _ERC20RealWorldAgent.contract.UnpackLog(event, "WorkerUpdated", log); err != nil { return nil, err } event.Raw = log return event, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/binds/erc20realworldagent/ERC20RealWorldAgent.json ================================================ { "abi": [ { "type": "constructor", "inputs": [ { "name": "name_", "type": "string", "internalType": "string" }, { "name": "symbol_", "type": "string", "internalType": "string" }, { "name": "amount_", "type": "uint256", "internalType": "uint256" }, { "name": "recipient_", "type": "address", "internalType": "address" }, { "name": "minFeeToUse_", "type": "uint256", "internalType": "uint256" }, { "name": "timeout_", "type": "uint32", "internalType": "uint32" }, { "name": "tokenFee_", "type": "address", "internalType": "contract IERC20" }, { "name": "worker_", "type": "address", "internalType": "address" } ], "stateMutability": "nonpayable" }, { "type": "function", "name": "CLOCK_MODE", "inputs": [], "outputs": [ { "name": "", "type": "string", "internalType": "string" } ], "stateMutability": "view" }, { "type": "function", "name": "DOMAIN_SEPARATOR", "inputs": [], "outputs": [ { "name": "", "type": "bytes32", "internalType": "bytes32" } ], "stateMutability": "view" }, { "type": "function", "name": "act", "inputs": [ { "name": "uuid", "type": "bytes32", "internalType": "bytes32" }, { "name": "executeData", "type": "bytes", "internalType": "bytes" } ], "outputs": [ { "name": "", "type": "uint256", "internalType": "uint256" } ], "stateMutability": "nonpayable" }, { "type": "function", "name": "act", "inputs": [ { "name": "uuid", "type": "bytes32", "internalType": "bytes32" }, { "name": "data", "type": "bytes", "internalType": "bytes" }, { "name": "signature", "type": "bytes", "internalType": "bytes" } ], "outputs": [ { "name": "", "type": "uint256", "internalType": "uint256" } ], "stateMutability": "nonpayable" }, { "type": "function", "name": "allowance", "inputs": [ { "name": "owner", "type": "address", "internalType": "address" }, { "name": "spender", "type": "address", "internalType": "address" } ], "outputs": [ { "name": "", "type": "uint256", "internalType": "uint256" } ], "stateMutability": "view" }, { "type": "function", "name": "approve", "inputs": [ { "name": "spender", "type": "address", "internalType": "address" }, { "name": "amount", "type": "uint256", "internalType": "uint256" } ], "outputs": [ { "name": "", "type": "bool", "internalType": "bool" } ], "stateMutability": "nonpayable" }, { "type": "function", "name": "balanceOf", "inputs": [ { "name": "account", "type": "address", "internalType": "address" } ], "outputs": [ { "name": "", "type": "uint256", "internalType": "uint256" } ], "stateMutability": "view" }, { "type": "function", "name": "checkpoints", "inputs": [ { "name": "account", "type": "address", "internalType": "address" }, { "name": "pos", "type": "uint32", "internalType": "uint32" } ], "outputs": [ { "name": "", "type": "tuple", "internalType": "struct ERC20Votes.Checkpoint", "components": [ { "name": "fromBlock", "type": "uint32", "internalType": "uint32" }, { "name": "votes", "type": "uint224", "internalType": "uint224" } ] } ], "stateMutability": "view" }, { "type": "function", "name": "clock", "inputs": [], "outputs": [ { "name": "", "type": "uint48", "internalType": "uint48" } ], "stateMutability": "view" }, { "type": "function", "name": "decimals", "inputs": [], "outputs": [ { "name": "", "type": "uint8", "internalType": "uint8" } ], "stateMutability": "view" }, { "type": "function", "name": "decreaseAllowance", "inputs": [ { "name": "spender", "type": "address", "internalType": "address" }, { "name": "subtractedValue", "type": "uint256", "internalType": "uint256" } ], "outputs": [ { "name": "", "type": "bool", "internalType": "bool" } ], "stateMutability": "nonpayable" }, { "type": "function", "name": "delegate", "inputs": [ { "name": "delegatee", "type": "address", "internalType": "address" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "delegateBySig", "inputs": [ { "name": "delegatee", "type": "address", "internalType": "address" }, { "name": "nonce", "type": "uint256", "internalType": "uint256" }, { "name": "expiry", "type": "uint256", "internalType": "uint256" }, { "name": "v", "type": "uint8", "internalType": "uint8" }, { "name": "r", "type": "bytes32", "internalType": "bytes32" }, { "name": "s", "type": "bytes32", "internalType": "bytes32" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "delegates", "inputs": [ { "name": "account", "type": "address", "internalType": "address" } ], "outputs": [ { "name": "", "type": "address", "internalType": "address" } ], "stateMutability": "view" }, { "type": "function", "name": "eip712Domain", "inputs": [], "outputs": [ { "name": "fields", "type": "bytes1", "internalType": "bytes1" }, { "name": "name", "type": "string", "internalType": "string" }, { "name": "version", "type": "string", "internalType": "string" }, { "name": "chainId", "type": "uint256", "internalType": "uint256" }, { "name": "verifyingContract", "type": "address", "internalType": "address" }, { "name": "salt", "type": "bytes32", "internalType": "bytes32" }, { "name": "extensions", "type": "uint256[]", "internalType": "uint256[]" } ], "stateMutability": "view" }, { "type": "function", "name": "getActId", "inputs": [], "outputs": [ { "name": "", "type": "uint256", "internalType": "uint256" } ], "stateMutability": "view" }, { "type": "function", "name": "getHashToSign", "inputs": [ { "name": "uuid", "type": "bytes32", "internalType": "bytes32" }, { "name": "data", "type": "bytes", "internalType": "bytes" } ], "outputs": [ { "name": "", "type": "bytes32", "internalType": "bytes32" } ], "stateMutability": "view" }, { "type": "function", "name": "getMinFeeToUse", "inputs": [], "outputs": [ { "name": "", "type": "uint256", "internalType": "uint256" } ], "stateMutability": "view" }, { "type": "function", "name": "getPastTotalSupply", "inputs": [ { "name": "timepoint", "type": "uint256", "internalType": "uint256" } ], "outputs": [ { "name": "", "type": "uint256", "internalType": "uint256" } ], "stateMutability": "view" }, { "type": "function", "name": "getPastVotes", "inputs": [ { "name": "account", "type": "address", "internalType": "address" }, { "name": "timepoint", "type": "uint256", "internalType": "uint256" } ], "outputs": [ { "name": "", "type": "uint256", "internalType": "uint256" } ], "stateMutability": "view" }, { "type": "function", "name": "getRequest", "inputs": [ { "name": "actId", "type": "uint256", "internalType": "uint256" } ], "outputs": [ { "name": "", "type": "tuple", "internalType": "struct IRealWorldAgent.Request", "components": [ { "name": "uuid", "type": "bytes32", "internalType": "bytes32" }, { "name": "creator", "type": "address", "internalType": "address" }, { "name": "timeout", "type": "uint32", "internalType": "uint32" }, { "name": "status", "type": "uint8", "internalType": "enum IRealWorldAgent.RequestStatus" }, { "name": "data", "type": "bytes", "internalType": "bytes" }, { "name": "result", "type": "bytes", "internalType": "bytes" } ] } ], "stateMutability": "view" }, { "type": "function", "name": "getResultById", "inputs": [ { "name": "uuid", "type": "bytes32", "internalType": "bytes32" } ], "outputs": [ { "name": "", "type": "bytes", "internalType": "bytes" } ], "stateMutability": "view" }, { "type": "function", "name": "getVotes", "inputs": [ { "name": "account", "type": "address", "internalType": "address" } ], "outputs": [ { "name": "", "type": "uint256", "internalType": "uint256" } ], "stateMutability": "view" }, { "type": "function", "name": "increaseAllowance", "inputs": [ { "name": "spender", "type": "address", "internalType": "address" }, { "name": "addedValue", "type": "uint256", "internalType": "uint256" } ], "outputs": [ { "name": "", "type": "bool", "internalType": "bool" } ], "stateMutability": "nonpayable" }, { "type": "function", "name": "name", "inputs": [], "outputs": [ { "name": "", "type": "string", "internalType": "string" } ], "stateMutability": "view" }, { "type": "function", "name": "nonces", "inputs": [ { "name": "owner", "type": "address", "internalType": "address" } ], "outputs": [ { "name": "", "type": "uint256", "internalType": "uint256" } ], "stateMutability": "view" }, { "type": "function", "name": "numCheckpoints", "inputs": [ { "name": "account", "type": "address", "internalType": "address" } ], "outputs": [ { "name": "", "type": "uint32", "internalType": "uint32" } ], "stateMutability": "view" }, { "type": "function", "name": "owner", "inputs": [], "outputs": [ { "name": "", "type": "address", "internalType": "address" } ], "stateMutability": "view" }, { "type": "function", "name": "permit", "inputs": [ { "name": "owner", "type": "address", "internalType": "address" }, { "name": "spender", "type": "address", "internalType": "address" }, { "name": "value", "type": "uint256", "internalType": "uint256" }, { "name": "deadline", "type": "uint256", "internalType": "uint256" }, { "name": "v", "type": "uint8", "internalType": "uint8" }, { "name": "r", "type": "bytes32", "internalType": "bytes32" }, { "name": "s", "type": "bytes32", "internalType": "bytes32" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "renounceOwnership", "inputs": [], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "setMinFeeToUse", "inputs": [ { "name": "minFeeToUse_", "type": "uint256", "internalType": "uint256" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "setTimeout", "inputs": [ { "name": "timeout_", "type": "uint32", "internalType": "uint32" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "setTokenFee", "inputs": [ { "name": "tokenFee_", "type": "address", "internalType": "contract IERC20" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "setWorker", "inputs": [ { "name": "newWorker", "type": "address", "internalType": "address" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "submitSolution", "inputs": [ { "name": "actId", "type": "uint256", "internalType": "uint256" }, { "name": "result", "type": "bytes", "internalType": "bytes" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "symbol", "inputs": [], "outputs": [ { "name": "", "type": "string", "internalType": "string" } ], "stateMutability": "view" }, { "type": "function", "name": "totalSupply", "inputs": [], "outputs": [ { "name": "", "type": "uint256", "internalType": "uint256" } ], "stateMutability": "view" }, { "type": "function", "name": "transfer", "inputs": [ { "name": "to", "type": "address", "internalType": "address" }, { "name": "amount", "type": "uint256", "internalType": "uint256" } ], "outputs": [ { "name": "", "type": "bool", "internalType": "bool" } ], "stateMutability": "nonpayable" }, { "type": "function", "name": "transferFrom", "inputs": [ { "name": "from", "type": "address", "internalType": "address" }, { "name": "to", "type": "address", "internalType": "address" }, { "name": "amount", "type": "uint256", "internalType": "uint256" } ], "outputs": [ { "name": "", "type": "bool", "internalType": "bool" } ], "stateMutability": "nonpayable" }, { "type": "function", "name": "transferOwnership", "inputs": [ { "name": "newOwner", "type": "address", "internalType": "address" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "withdrawFeeToken", "inputs": [ { "name": "to", "type": "address", "internalType": "address" }, { "name": "amount", "type": "uint256", "internalType": "uint256" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "event", "name": "Approval", "inputs": [ { "name": "owner", "type": "address", "indexed": true, "internalType": "address" }, { "name": "spender", "type": "address", "indexed": true, "internalType": "address" }, { "name": "value", "type": "uint256", "indexed": false, "internalType": "uint256" } ], "anonymous": false }, { "type": "event", "name": "DelegateChanged", "inputs": [ { "name": "delegator", "type": "address", "indexed": true, "internalType": "address" }, { "name": "fromDelegate", "type": "address", "indexed": true, "internalType": "address" }, { "name": "toDelegate", "type": "address", "indexed": true, "internalType": "address" } ], "anonymous": false }, { "type": "event", "name": "DelegateVotesChanged", "inputs": [ { "name": "delegate", "type": "address", "indexed": true, "internalType": "address" }, { "name": "previousBalance", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "newBalance", "type": "uint256", "indexed": false, "internalType": "uint256" } ], "anonymous": false }, { "type": "event", "name": "EIP712DomainChanged", "inputs": [], "anonymous": false }, { "type": "event", "name": "ExecutionRequested", "inputs": [ { "name": "actId", "type": "uint256", "indexed": true, "internalType": "uint256" }, { "name": "uuid", "type": "bytes32", "indexed": true, "internalType": "bytes32" }, { "name": "creator", "type": "address", "indexed": true, "internalType": "address" }, { "name": "data", "type": "bytes", "indexed": false, "internalType": "bytes" } ], "anonymous": false }, { "type": "event", "name": "OwnershipTransferred", "inputs": [ { "name": "previousOwner", "type": "address", "indexed": true, "internalType": "address" }, { "name": "newOwner", "type": "address", "indexed": true, "internalType": "address" } ], "anonymous": false }, { "type": "event", "name": "SolutionSubmitted", "inputs": [ { "name": "actId", "type": "uint256", "indexed": true, "internalType": "uint256" }, { "name": "processor", "type": "address", "indexed": true, "internalType": "address" }, { "name": "result", "type": "bytes", "indexed": false, "internalType": "bytes" } ], "anonymous": false }, { "type": "event", "name": "Transfer", "inputs": [ { "name": "from", "type": "address", "indexed": true, "internalType": "address" }, { "name": "to", "type": "address", "indexed": true, "internalType": "address" }, { "name": "value", "type": "uint256", "indexed": false, "internalType": "uint256" } ], "anonymous": false }, { "type": "event", "name": "WorkerUpdated", "inputs": [ { "name": "oldWorker", "type": "address", "indexed": true, "internalType": "address" }, { "name": "newWorker", "type": "address", "indexed": true, "internalType": "address" } ], "anonymous": false }, { "type": "error", "name": "DuplicateUuid", "inputs": [] }, { "type": "error", "name": "InsufficientBalance", "inputs": [] }, { "type": "error", "name": "InvalidAmount", "inputs": [] }, { "type": "error", "name": "InvalidExternalDataLength", "inputs": [] }, { "type": "error", "name": "InvalidRequestStatus", "inputs": [] }, { "type": "error", "name": "InvalidShortString", "inputs": [] }, { "type": "error", "name": "InvalidSignature", "inputs": [] }, { "type": "error", "name": "InvalidUuid", "inputs": [] }, { "type": "error", "name": "StringTooLong", "inputs": [ { "name": "str", "type": "string", "internalType": "string" } ] }, { "type": "error", "name": "Timeout", "inputs": [] }, { "type": "error", "name": "Unauthorized", "inputs": [] }, { "type": "error", "name": "ZeroAddress", "inputs": [] } ], "bytecode": { "object": "0x6101606040523461010957614208803803809161001b82610121565b610160396101008161016001911261010957610160516001600160401b038111610109578161004d9161016001610181565b6101805190916001600160401b0382116101095761006e9161016001610181565b906101a051916101c051610081816101d6565b6101e051610200519163ffffffff83168303610109576100b8956100a66102206101e7565b946100b26102406101e7565b966101f2565b6040516131f79081610fd1823960805181612522015260a051816125df015260c051816124ec015260e051816125710152610100518161259701526101205181610a0601526101405181610a2f0152f35b5f80fd5b634e487b7160e01b5f52604160045260245ffd5b610160601f91909101601f19168101906001600160401b0382119082101761014857604052565b61010d565b601f909101601f19168101906001600160401b0382119082101761014857604052565b6040519061017f60408361014d565b565b81601f82011215610109578051906001600160401b03821161014857604051926101b5601f8401601f19166020018561014d565b8284526020838301011161010957815f9260208093018386015e8301015290565b6001600160a01b0381160361010957565b519061017f826101d6565b979697959391959492946040519061020b60408361014d565b60018252603160f81b6020830190815281519093906001600160401b038111610148576102428161023d600354610405565b61043d565b6020601f8211600114610369579461030c9461017f9c9d98946102926102e79561028a866103379c976103599f9c5f9161035e575b508160011b915f199060031b1c19161790565b6003556104dc565b61029b33610825565b6102a4816105e0565b610120526102b1826106d5565b610140526020815191012060e052519020610100524660a0526102d26107c7565b6080523060c0526102e2876105c1565b600d55565b6010805463ffffffff60a01b191660a09290921b63ffffffff60a01b16919091179055565b6103155f600e55565b601280546001600160a01b0319166001600160a01b0392909216919091179055565b601080546001600160a01b0319166001600160a01b0392909216919091179055565b6108d2565b90508501515f610277565b60035f52601f198216907fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b915f5b8181106103ed57509461029261017f9e9f9a96956001866103599e9b9661030c9b966103379e996102e79b106103d5575b5050811b016003556104dc565b8601515f1960f88460031b161c191690555f806103c8565b9192602060018192868a015181550194019201610397565b90600182811c92168015610433575b602083101461041f57565b634e487b7160e01b5f52602260045260245ffd5b91607f1691610414565b601f8111610449575050565b60035f5260205f20906020601f840160051c83019310610483575b601f0160051c01905b818110610478575050565b5f815560010161046d565b9091508190610464565b601f821161049a57505050565b5f5260205f20906020601f840160051c830193106104d2575b601f0160051c01905b8181106104c7575050565b5f81556001016104bc565b90915081906104b3565b80519091906001600160401b03811161014857610505816104fe600454610405565b600461048d565b602092601f821160011461054557610535929382915f9261053a575b50508160011b915f199060031b1c19161790565b600455565b015190505f80610521565b60045f52601f198216937f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b915f5b8681106105a95750836001959610610591575b505050811b01600455565b01515f1960f88460031b161c191690555f8080610586565b91926020600181928685015181550194019201610573565b6001600160a01b0316156105d157565b63d92e233d60e01b5f5260045ffd5b908151602081105f146105fb5750906105f8906109b6565b90565b6001600160401b0381116101485761061f81610618600654610405565b600661048d565b602092601f82116001146106565761064e929382915f9261053a5750508160011b915f199060031b1c19161790565b60065560ff90565b60065f52601f198216937ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f915f5b8681106106bd57508360019596106106a5575b505050811b0160065560ff90565b01515f1960f88460031b161c191690555f8080610697565b91926020600181928685015181550194019201610684565b908151602081105f146106ed5750906105f8906109b6565b6001600160401b038111610148576107118161070a600754610405565b600761048d565b602092601f821160011461074857610740929382915f9261053a5750508160011b915f199060031b1c19161790565b60075560ff90565b60075f52601f198216937fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c688915f5b8681106107af5750836001959610610797575b505050811b0160075560ff90565b01515f1960f88460031b161c191690555f8080610789565b91926020600181928685015181550194019201610776565b60e051610100516040519060208201927f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f8452604083015260608201524660808201523060a082015260a0815261081f60c08261014d565b51902090565b600580546001600160a01b039283166001600160a01b0319821681179092559091167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3565b1561087457565b60405162461bcd60e51b815260206004820152603060248201527f4552433230566f7465733a20746f74616c20737570706c79207269736b73206f60448201526f766572666c6f77696e6720766f74657360801b6064820152608490fd5b906001600160a01b03821680156109715760025482810180911161096c576109689361094d926109028593600255565b6001600160a01b0382165f90815260208181526040808320805487019055518581527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9190a3610e3d565b600254610963906001600160e01b03101561086d565b610acb565b5050565b610a21565b60405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606490fd5b601f8151116109e15760208151910151602082106109d2571790565b5f198260200360031b1b161790565b604460209160405192839163305a27a960e01b83528160048401528051918291826024860152018484015e5f828201840152601f01601f19168101030190fd5b634e487b7160e01b5f52601160045260245ffd5b604080519192919081016001600160401b0381118282101761014857604052602081935463ffffffff81168352811c910152565b908154680100000000000000008110156101485760018101808455811015610ab7575f92835260209283902082519284015190931b63ffffffff191663ffffffff9290921691909117910155565b634e487b7160e01b5f52603260045260245ffd5b600c5490918115918215610be457610ae1610170565b5f81525f60208201525b6020810151610b1790610b0e906001600160e01b03165b6001600160e01b031690565b95866001610f91565b93159081610bc1575b5015610b645761017f90610b4d610b3685610dce565b600c5f52915f5160206141c85f395f51905f520190565b9063ffffffff82549181199060201b169116179055565b5061017f610b87610b82610b7743610f25565b65ffffffffffff1690565b610d66565b610bba610b9385610dce565b610baa610b9e610170565b63ffffffff9094168452565b6001600160e01b03166020830152565b600c610a69565b5163ffffffff16905063ffffffff610bdb610b7743610f25565b9116145f610b20565b600c5f52610c055f5160206141c85f395f51905f528201610a35565b610a35565b610aeb565b9091815491821592835f14610ced57610c21610170565b5f81525f60208201525b6020810151610c4f90610c46906001600160e01b0316610b02565b96876002610f91565b94159081610cca575b5015610c7d57610b4d61017f92610c6e86610dce565b925f1901905f5260205f200190565b5061017f90610c91610b82610b7743610f25565b90610cc5610c9e86610dce565b610cb5610ca9610170565b63ffffffff9095168552565b6001600160e01b03166020840152565b610a69565b5163ffffffff16905063ffffffff610ce4610b7743610f25565b9116145f610c58565b610d02610c005f198301845f5260205f200190565b610c2b565b9091815491821592835f14610d4c57610d1e610170565b5f81525f60208201525b6020810151610c4f90610d43906001600160e01b0316610b02565b96876001610f91565b610d61610c005f198301845f5260205f200190565b610d28565b63ffffffff8111610d7a5763ffffffff1690565b60405162461bcd60e51b815260206004820152602660248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203360448201526532206269747360d01b6064820152608490fd5b6001600160e01b038111610de8576001600160e01b031690565b60405162461bcd60e51b815260206004820152602760248201527f53616665436173743a2076616c756520646f65736e27742066697420696e20326044820152663234206269747360c81b6064820152608490fd5b600a6020527f13da86008ba1c6922daee3e07db95305ef49ebced9f5467a0b8613fcc6b343e3546001600160a01b039182165f908152604090205482169291168281141580610f1c575b610e9057505050565b80610ee2575b5081610ea0575050565b6001600160a01b0382165f908152600b602052604090205f5160206141e85f395f51905f5291610ecf91610d07565b60408051928352602083019190915290a2565b805f52600b6020525f5160206141e85f395f51905f52610f058360405f20610c0a565b60408051928352602083019190915290a25f610e96565b50811515610e87565b65ffffffffffff8111610f3d5765ffffffffffff1690565b60405162461bcd60e51b815260206004820152602660248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203460448201526538206269747360d01b6064820152608490fd5b91909180600114610fc357600214610fb757634e487b7160e01b5f52605160045260245ffd5b810390811161096c5790565b50810180911161096c579056fe60806040526004361015610011575f80fd5b5f3560e01c806306fdde03146102a4578063095ea7b31461029f57806318160ddd1461029a5780631af09a2b1461029557806323b872dd14610290578063241da1c01461028b578063313ce567146102865780633644e51514610281578063365bec7f1461027c57806339509351146102775780633a46b1a8146102725780634bf5d7e91461026d578063587cde1e146102685780635c19a95c146102635780636fcfff451461025e57806370a0823114610259578063715018a6146102545780637ecebe001461024f57806384b0196e1461024a5780638da5cb5b146102455780638e539e8c1461024057806391ddadf41461023b57806395d89b41146102365780639aa474ed146102315780639ab24eb01461022c578063a457c2d714610227578063a9059cbb14610222578063af5e3be01461021d578063b2ef14e314610218578063c26f6d4414610213578063c3cda5201461020e578063c58343ef14610209578063d19834fc14610204578063d505accf146101ff578063dc80d104146101fa578063dd62ed3e146101f5578063e0839ca1146101f0578063e84dee6b146101eb578063f1127ed8146101e6578063f2fde38b146101e15763fea5ef99146101dc575f80fd5b611923565b611853565b6117ce565b6116ad565b61166e565b611513565b6114c5565b61136f565b6112e4565b6111f4565b61102e565b610f99565b610ecf565b610eae565b610e84565b610dd6565b610d54565b610d37565b610c92565b610c67565b610b13565b610aeb565b6109ee565b6109b3565b610958565b61091e565b6108d5565b6108ad565b61086a565b6107b7565b61066a565b61060b565b6105a0565b61057e565b610563565b610510565b61043f565b610422565b610405565b6103d0565b6102e1565b805180835260209291819084018484015e5f828201840152601f01601f1916010190565b9060206102de9281815201906102a9565b90565b346103bb575f3660031901126103bb576040515f600354610301816119ba565b80845290600181169081156103975750600114610339575b61033583610329818503826115c1565b604051918291826102cd565b0390f35b60035f9081527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b939250905b80821061037d57509091508101602001610329610319565b919260018160209254838588010152019101909291610365565b60ff191660208086019190915291151560051b840190910191506103299050610319565b5f80fd5b6001600160a01b038116036103bb57565b346103bb5760403660031901126103bb576103fa6004356103f0816103bf565b602435903361217f565b602060405160018152f35b346103bb575f3660031901126103bb576020600254604051908152f35b346103bb575f3660031901126103bb576020600e54604051908152f35b346103bb5760603660031901126103bb5760043561045c816103bf565b602435610468816103bf565b6001600160a01b0382165f9081526001602081815260408084203385529091529091205492604435929184016104af575b6104a39350612364565b60405160018152602090f35b8284106104cb576104c6836104a39503338361217f565b610499565b60405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606490fd5b346103bb5760203660031901126103bb5760043561052d816103bf565b610535612472565b6001600160a01b0316610547816124ca565b6bffffffffffffffffffffffff60a01b60125416176012555f80f35b346103bb575f3660031901126103bb57602060405160128152f35b346103bb575f3660031901126103bb5760206105986124e9565b604051908152f35b346103bb5760203660031901126103bb57600435805f52600f60205260405f2054156105fc575f52600f60205260405f20545f5260116020526103356105f5610329600360405f2001604051928380926119f2565b03826115c1565b6341ba517160e11b5f5260045ffd5b346103bb5760403660031901126103bb57600435610628816103bf565b602435335f5260016020526106508260405f209060018060a01b03165f5260205260405f2090565b54908101809111610665576103fa913361217f565b61197e565b346103bb5760403660031901126103bb57600435610687816103bf565b602435906106a665ffffffffffff61069e43612770565b168310611a8e565b6001600160a01b03165f908152600b6020526040812080549290918360058111610768575b50905b838210610719575050816106f557505060205f5b6040516001600160e01b03919091168152f35b61070d610714916020935f1901905f5260205f200190565b5460201c90565b6106e2565b90926107258185612a2e565b908263ffffffff61074861073e85885f5260205f200190565b5463ffffffff1690565b1611156107585750925b906106ce565b935061076390611992565b610752565b8061077861077e929693966128bb565b906119ad565b908263ffffffff61079761073e85885f5260205f200190565b1611156107a75750925b5f6106cb565b93506107b290611992565b6107a1565b346103bb575f3660031901126103bb574365ffffffffffff6107d843612770565b1603610825576103356040516107ef6040826115c1565b601d81527f6d6f64653d626c6f636b6e756d6265722666726f6d3d64656661756c740000006020820152604051918291826102cd565b60405162461bcd60e51b815260206004820152601d60248201527f4552433230566f7465733a2062726f6b656e20636c6f636b206d6f64650000006044820152606490fd5b346103bb5760203660031901126103bb57600435610887816103bf565b60018060a01b03165f52600a602052602060018060a01b0360405f205416604051908152f35b346103bb5760203660031901126103bb576108d36004356108cd816103bf565b33612605565b005b346103bb5760203660031901126103bb576004356108f2816103bf565b60018060a01b03165f52600b602052602061091060405f2054612678565b63ffffffff60405191168152f35b346103bb5760203660031901126103bb5760043561093b816103bf565b60018060a01b03165f525f602052602060405f2054604051908152f35b346103bb575f3660031901126103bb57610970612472565b600580546001600160a01b031981169091555f906001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a3005b346103bb5760203660031901126103bb576004356109d0816103bf565b60018060a01b03165f526008602052602060405f2054604051908152f35b346103bb575f3660031901126103bb57610a92610a2a7f00000000000000000000000000000000000000000000000000000000000000006126e0565b610a537f0000000000000000000000000000000000000000000000000000000000000000612739565b6020604051610a6282826115c1565b5f815281610aa081830194601f198301368737604051978897600f60f81b895260e0858a015260e08901906102a9565b9087820360408901526102a9565b914660608701523060808701525f60a087015285830360c087015251918281520192915f5b828110610ad457505050500390f35b835185528695509381019392810192600101610ac5565b346103bb575f3660031901126103bb576005546040516001600160a01b039091168152602090f35b346103bb5760203660031901126103bb57600435610b4265ffffffffffff610b3a43612770565b168210611a8e565b600c54905f8260058111610c01575b50905b828210610b9f578280610b6d57506040515f8152602090f35b600c5f52602090610714907fdf6966c971051c3d54ec59162606531493a51404a002842f56009d7e5cf4a8c60161070d565b9091610bab8184612a2e565b600c5f52908263ffffffff610be17fdf6966c971051c3d54ec59162606531493a51404a002842f56009d7e5cf4a8c7850161073e565b161115610bf15750915b90610b54565b9250610bfc90611992565b610beb565b80610778610c11929593956128bb565b600c5f52908263ffffffff610c477fdf6966c971051c3d54ec59162606531493a51404a002842f56009d7e5cf4a8c7850161073e565b161115610c575750915b5f610b51565b9250610c6290611992565b610c51565b346103bb575f3660031901126103bb576020610c8243612770565b65ffffffffffff60405191168152f35b346103bb575f3660031901126103bb576040515f600454610cb2816119ba565b80845290600181169081156103975750600114610cd95761033583610329818503826115c1565b60045f9081527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b939250905b808210610d1d57509091508101602001610329610319565b919260018160209254838588010152019101909291610d05565b346103bb575f3660031901126103bb576020600d54604051908152f35b346103bb5760203660031901126103bb57600435610d71816103bf565b6001600160a01b03165f818152600b60205260409020549081610daf5750506103355f5b6040516001600160e01b0390911681529081906020820190565b61033591610dcc915f52600b60205260405f20905f190190611ada565b505460201c610d95565b346103bb5760403660031901126103bb57600435610df3816103bf565b60243590335f526001602052610e1c8160405f209060018060a01b03165f5260205260405f2090565b5491808310610e31576104a39203903361217f565b60405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608490fd5b346103bb5760403660031901126103bb576103fa600435610ea4816103bf565b6024359033612364565b346103bb5760203660031901126103bb57600435610eca612472565b600d55005b346103bb5760403660031901126103bb57600435610eec816103bf565b602435610ef7612472565b8015610f8a576012546040516370a0823160e01b81523060048201526001600160a01b039091169290602081602481875afa908115610f85575f91610f56575b508211610f47576108d3926127dc565b631e9acf1760e31b5f5260045ffd5b610f78915060203d602011610f7e575b610f7081836115c1565b810190611b03565b5f610f37565b503d610f66565b611b12565b63162908e360e11b5f5260045ffd5b346103bb5760203660031901126103bb57600435610fb6816103bf565b610fbe612472565b610fc7816124ca565b6010546001600160a01b0391821691829082167f98b88aa89cb5f247008e613dc8529d633ab05a62f7120c07ebcfcdd852fc2a8d5f80a36001600160a01b03191617601055005b6064359060ff821682036103bb57565b6084359060ff821682036103bb57565b346103bb5760c03660031901126103bb5760043561104b816103bf565b6044359060243561105a61100e565b6084359360a435814211611117576108d395611112936110e5876110cf6110dd6110ea976040519283918c60208401968760609194939260808201957fe48329057bfd03d55e49b547132e39cffd9c1820ad7b9d4c5307691425d15adf835260018060a01b0316602083015260408201520152565b03601f1981018352826115c1565b51902061281c565b612842565b6001600160a01b0381165f908152600860205260409020805460018101909155909214611b1d565b612605565b60405162461bcd60e51b815260206004820152601d60248201527f4552433230566f7465733a207369676e617475726520657870697265640000006044820152606490fd5b634e487b7160e01b5f52602160045260245ffd5b6004111561117a57565b61115c565b90602082528051602083015260018060a01b03602082015116604083015263ffffffff6040820151166060830152606081015191600483101561117a576102de92608082015260a06111df608084015160c08385015260e08401906102a9565b9201519060c0601f19828503019101526102a9565b346103bb5760203660031901126103bb57600435606060a060405161121881611586565b5f81525f60208201525f60408201525f8382015282608082015201525f52601160205261033560405f206112a660036040519261125484611586565b8054845260018101546001600160a01b038116602086015260a081901c63ffffffff16604086015261128f9060c01c60ff1660608601611b69565b61129b60028201611a73565b608085015201611a73565b60a08201526040519182918261117f565b9181601f840112156103bb578235916001600160401b0383116103bb57602083818601950101116103bb57565b346103bb5760403660031901126103bb576004356024356001600160401b0381116103bb576113179036906004016112b7565b909160418210611360576040198201828111610665576103359361134a61134361135095848185611b75565b369161161d565b92611fe7565b6040519081529081906020820190565b63099f6dd560e31b5f5260045ffd5b346103bb5760e03660031901126103bb5760043561138c816103bf565b602435611398816103bf565b60443590606435926113a861101e565b60a4359460c43581421161146d576108d396611468936110e586896110dd8a6110cf611455996113f18660018060a01b03165f52600860205260405f2090815491600183019055565b604051958694602086019889919260a093969594919660c08401977f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98552600180871b03166020850152600180861b03166040840152606083015260808201520152565b6001600160a01b03838116911614611b8d565b61217f565b60405162461bcd60e51b815260206004820152601d60248201527f45524332305065726d69743a206578706972656420646561646c696e650000006044820152606490fd5b6024359063ffffffff821682036103bb57565b346103bb5760203660031901126103bb5760043563ffffffff811681036103bb576114ee612472565b6010805463ffffffff60a01b191660a09290921b63ffffffff60a01b16919091179055005b346103bb5760403660031901126103bb576020611569600435611535816103bf565b60243590611542826103bf565b60018060a01b03165f526001835260405f209060018060a01b03165f5260205260405f2090565b54604051908152f35b634e487b7160e01b5f52604160045260245ffd5b60c081019081106001600160401b038211176115a157604052565b611572565b604081019081106001600160401b038211176115a157604052565b90601f801991011681019081106001600160401b038211176115a157604052565b604051906115f160c0836115c1565b565b604051906115f16040836115c1565b6001600160401b0381116115a157601f01601f191660200190565b92919261162982611602565b9161163760405193846115c1565b8294818452818301116103bb578281602093845f960137010152565b9080601f830112156103bb578160206102de9335910161161d565b346103bb5760403660031901126103bb576004356024356001600160401b0381116103bb576020916116a7610598923690600401611653565b90611bd9565b346103bb5760403660031901126103bb576004356024356001600160401b0381116103bb576116e09036906004016112b7565b6116f48392935f52601160205260405f2090565b60018101908154600161170b8260ff9060c01c1690565b61171481611170565b036117bf576117309060a01c63ffffffff165b63ffffffff1690565b42116117b0576010546001600160a01b031633036117a25761176d92600361175a92019586611c78565b805460ff60c01b1916600160c11b179055565b7f847d58c674038bb7f3ec4f6bbd97d64a3da0f3db4312900c67a2778f0b2840ba6040518061179d339582611d64565b0390a3005b6282b42960e81b5f5260045ffd5b63055e18ff60e31b5f5260045ffd5b632efb6afd60e01b5f5260045ffd5b346103bb5760403660031901126103bb57604061182f6118296004356117f3816103bf565b6117fb6114b2565b905f6020865161180a816115a6565b82815201526001600160a01b03165f908152600b602052849020611ada565b50611d75565b8151815163ffffffff1681526020918201516001600160e01b031691810191909152f35b346103bb5760203660031901126103bb57600435611870816103bf565b611878612472565b6001600160a01b038116156118cf57600580546001600160a01b039283166001600160a01b0319821681179092559091167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3005b60405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608490fd5b346103bb5760603660031901126103bb576004356024356001600160401b0381116103bb576119569036906004016112b7565b9091604435916001600160401b0383116103bb5760209361134a610598943690600401611653565b634e487b7160e01b5f52601160045260245ffd5b906001820180921161066557565b9190820180921161066557565b9190820391821161066557565b90600182811c921680156119e8575b60208310146119d457565b634e487b7160e01b5f52602260045260245ffd5b91607f16916119c9565b5f9291815491611a01836119ba565b8083529260018116908115611a565750600114611a1d57505050565b5f9081526020812093945091925b838310611a3c575060209250010190565b600181602092949394548385870101520191019190611a2b565b915050602093945060ff929192191683830152151560051b010190565b906115f1611a8792604051938480926119f2565b03836115c1565b15611a9557565b60405162461bcd60e51b815260206004820152601960248201527f4552433230566f7465733a20667574757265206c6f6f6b7570000000000000006044820152606490fd5b8054821015611aef575f5260205f2001905f90565b634e487b7160e01b5f52603260045260245ffd5b908160209103126103bb575190565b6040513d5f823e3d90fd5b15611b2457565b60405162461bcd60e51b815260206004820152601960248201527f4552433230566f7465733a20696e76616c6964206e6f6e6365000000000000006044820152606490fd5b600482101561117a5752565b909392938483116103bb5784116103bb578101920390565b15611b9457565b60405162461bcd60e51b815260206004820152601e60248201527f45524332305065726d69743a20696e76616c6964207369676e617475726500006044820152606490fd5b6102de91602081519101206040519060208201927fbf842cb9fe7273c2aac2391f36077927eaae4fffb9d035401f660ed5e6aef4bd845260408301526060820152606081526110dd6080826115c1565b601f8211611c3657505050565b5f5260205f20906020601f840160051c83019310611c6e575b601f0160051c01905b818110611c63575050565b5f8155600101611c58565b9091508190611c4f565b9092916001600160401b0381116115a157611c9d81611c9784546119ba565b84611c29565b5f601f8211600114611cdb578190611ccc9394955f92611cd0575b50508160011b915f199060031b1c19161790565b9055565b013590505f80611cb8565b601f19821694611cee845f5260205f2090565b915f5b878110611d28575083600195969710611d0f575b505050811b019055565b01355f19600384901b60f8161c191690555f8080611d05565b90926020600181928686013581550194019101611cf1565b90600481101561117a57815460ff60c01b191660c09190911b60ff60c01b16179055565b9060206102de9281815201906119f2565b90604051611d82816115a6565b602081935463ffffffff81168352811c910152565b5f1981146106655760010190565b90918060409360208452816020850152848401375f828201840152601f01601f1916010190565b60405190611ddb6020836115c1565b5f808352366020840137565b91909182516001600160401b0381116115a157611e0881611c9784546119ba565b6020601f8211600114611e42578190611ccc9394955f92611e375750508160011b915f199060031b1c19161790565b015190505f80611cb8565b601f19821690611e55845f5260205f2090565b915f5b818110611e8e57509583600195969710611e7657505050811b019055565b01515f1960f88460031b161c191690555f8080611d05565b9192602060018192868b015181550194019201611e58565b81518155602082015160018201805460408501516001600160a01b039093166001600160c01b03199091161760a09290921b63ffffffff60a01b169190911781556060830151919291600481101561117a57611f0191611d40565b6002820160808201518051906001600160401b0382116115a157611f2f82611f2985546119ba565b85611c29565b602090601f8311600114611f745792611f688360a0946115f19897946003975f92611e375750508160011b915f199060031b1c19161790565b90555b01519101611de7565b90601f19831691611f88855f5260205f2090565b925f5b818110611fcf5750936115f1979693600396936001938360a09810611fb8575b505050811b019055611f6b565b01515f1983891b60f8161c191690555f8080611fab565b92936020600181928786015181550195019301611f8b565b90611ffa825f52600f60205260405f2090565b546121705761206161200d600e54611d97565b9461201786600e55565b8561202a855f52600f60205260405f2090565b55600d5480612145575b5061204961204336878661161d565b85611bd9565b602082015190606060408401519301515f1a90612842565b906001600160a01b038216908115612136576102de946121159285887f9096741026bdd638bcc5cb995f0f00b4574b81f120a23c4a7086347116bf58a1604051806120ad878983611da5565b0390a46121096120d56117276120cf61172760105463ffffffff9060a01c1690565b426119a0565b6120fc6120e0611dcc565b966120e96115e2565b9889526001600160a01b03166020890152565b63ffffffff166040870152565b60016060860152611343565b608083015260a0820152612131835f52601160205260405f2090565b611ea6565b638baa579f60e01b5f5260045ffd5b60125461216a91906001600160a01b03166010546001600160a01b0316903390612859565b5f612034565b63339f7ff560e01b5f5260045ffd5b6001600160a01b03811691908215612260576001600160a01b03821693841561221057806121fa7f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925946121e561220b9560018060a01b03165f52600160205260405f2090565b9060018060a01b03165f5260205260405f2090565b556040519081529081906020820190565b0390a3565b60405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608490fd5b60405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608490fd5b156122b857565b60405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608490fd5b1561231057565b60405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608490fd5b6001600160a01b038116929190831561241f576115f1936001600160a01b038316906123918215156122b1565b6001600160a01b0383165f9081526020819052604090208590546123b782821015612309565b036123d18460018060a01b03165f525f60205260405f2090565b556001600160a01b0384165f908152602081815260409182902080548801905590518681527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9190a3612f2e565b60405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608490fd5b6005546001600160a01b0316330361248657565b606460405162461bcd60e51b815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b6001600160a01b0316156124da57565b63d92e233d60e01b5f5260045ffd5b307f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031614806125dc575b15612544577f000000000000000000000000000000000000000000000000000000000000000090565b60405160208101907f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f82527f000000000000000000000000000000000000000000000000000000000000000060408201527f000000000000000000000000000000000000000000000000000000000000000060608201524660808201523060a082015260a081526125d660c0826115c1565b51902090565b507f0000000000000000000000000000000000000000000000000000000000000000461461251b565b6001600160a01b039081165f818152600a60208181526040808420805485845291852054939092528686166001600160a01b0319821681179092556115f19692959294921692909183917f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f9080a4612a43565b63ffffffff811161268c5763ffffffff1690565b60405162461bcd60e51b815260206004820152602660248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203360448201526532206269747360d01b6064820152608490fd5b60ff81146127265760ff811690601f821161271757604051916127046040846115c1565b6020808452838101919036833783525290565b632cd44ac360e21b5f5260045ffd5b506040516102de816105f58160066119f2565b60ff811461275d5760ff811690601f821161271757604051916127046040846115c1565b506040516102de816105f58160076119f2565b65ffffffffffff81116127885765ffffffffffff1690565b60405162461bcd60e51b815260206004820152602660248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203460448201526538206269747360d01b6064820152608490fd5b60405163a9059cbb60e01b60208201526001600160a01b0390921660248301526044808301939093529181526115f1916128176064836115c1565b612ccc565b6042906128276124e9565b906040519161190160f01b8352600283015260228201522090565b916102de939161285193612d84565b919091612e09565b6040516323b872dd60e01b60208201526001600160a01b0392831660248201529290911660448301526064808301939093529181526115f1916128176084836115c1565b81156128a7570490565b634e487b7160e01b5f52601260045260245ffd5b8015612a29576102de906129bf6129b86129ae6129a461299a61299061298661297c600161296a5f8b608081901c80612a1b575b50806128fe6129609260401c90565b80612a0e575b5061290f8160201c90565b80612a01575b506129208160101c90565b806129f4575b506129318160081c90565b806129e7575b506129428160041c90565b806129da575b506129538160021c90565b806129cd575b5060011c90565b6129c55760011c90565b1b612975818b61289d565b0160011c90565b612975818a61289d565b612975818961289d565b612975818861289d565b612975818761289d565b612975818661289d565b612975818561289d565b809261289d565b90612f5f565b820160011c90565b600291509201915f612959565b600491509201915f612948565b600891509201915f612937565b601091509201915f612926565b602091509201915f612915565b604091509201915f612904565b6080925090506129606128ef565b505f90565b90808216911860011c81018091116106655790565b6001600160a01b03808316939291168084141580612c4c575b612a67575b50505050565b80612ad4575b5082612a7a575b80612a61565b6001600160a01b03165f908152600b602052604090207fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a72491612abb91612fcd565b60408051928352602083019190915290a25f8080612a74565b805f52600b6020527fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a72460405f208054801591825f14612c2c57612b156115f3565b5f81525f6020820152915b6020830151612b3f906001600160e01b03165b6001600160e01b031690565b92612b4c89856002613182565b94159081612c09575b5015612ba757612b7a612b9192612b6b86613082565b925f1901905f5260205f200190565b9063ffffffff82549181199060201b169116179055565b604080519182526020820192909252a25f612a6d565b50612c0490612bcb612bc6612bbb43612770565b65ffffffffffff1690565b612678565b90612bff612bd886613082565b612bef612be36115f3565b63ffffffff9095168552565b6001600160e01b03166020840152565b612f71565b612b91565b5163ffffffff16905063ffffffff612c23612bbb43612770565b9116145f612b55565b612c46612c415f198401835f5260205f200190565b611d75565b91612b20565b50821515612a5c565b908160209103126103bb575180151581036103bb5790565b15612c7457565b60405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608490fd5b6115f191612d4e9160018060a01b03165f8060405193612ced6040866115c1565b602085527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564602086015260208151910182855af13d15612d7c573d91612d3283611602565b92612d4060405194856115c1565b83523d5f602085013e6130f1565b8051908115918215612d62575b5050612c6d565b612d759250602080918301019101612c55565b5f80612d5b565b6060916130f1565b7f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08411612df4576020935f9360ff60809460405194855216868401526040830152606082015282805260015afa15610f85575f516001600160a01b03811615612dec57905f90565b505f90600190565b505050505f90600390565b6005111561117a57565b612e1281612dff565b80612e1a5750565b612e2381612dff565b60018103612e755760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015280606481015b0390fd5b612e7e81612dff565b60028103612ecb5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606490fd5b80612ed7600392612dff565b14612ede57565b60405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608490fd5b6001600160a01b039081165f908152600a60205260408082205493831682529020546115f193929082169116612a43565b9080821015612f6c575090565b905090565b8054680100000000000000008110156115a157612f9391600182018155611ada565b612fba57815160209283015190921b63ffffffff191663ffffffff92909216919091179055565b634e487b7160e01b5f525f60045260245ffd5b9091815491821592835f1461306857612fe46115f3565b5f81525f60208201525b602081015161301290613009906001600160e01b0316612b33565b96876001613182565b94159081613045575b501561303157612b7a6115f192612b6b86613082565b506115f190612bcb612bc6612bbb43612770565b5163ffffffff16905063ffffffff61305f612bbb43612770565b9116145f61301b565b61307d612c415f198301845f5260205f200190565b612fee565b6001600160e01b03811161309c576001600160e01b031690565b60405162461bcd60e51b815260206004820152602760248201527f53616665436173743a2076616c756520646f65736e27742066697420696e20326044820152663234206269747360c81b6064820152608490fd5b919290156131535750815115613105575090565b3b1561310e5790565b60405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606490fd5b8251909150156131665750805190602001fd5b60405162461bcd60e51b8152908190612e7190600483016102cd565b919091806001146131b4576002146131a857634e487b7160e01b5f52605160045260245ffd5b81039081116106655790565b508101809111610665579056fea264697066735822122064cab481df6b1a587bc18db83939d82743228c3be79f2f76ddf28c4b7c97dc9f64736f6c634300081c0033df6966c971051c3d54ec59162606531493a51404a002842f56009d7e5cf4a8c6dec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a724", "sourceMap": "356:1061:23:-:0;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;-1:-1:-1;;;;;356:1061:23;;;;;;;;;;:::i;:::-;;;;;-1:-1:-1;;;;;356:1061:23;;;;;;;;;:::i;:::-;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;:::i;:::-;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;356:1061:23;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;356:1061:23;;;;-1:-1:-1;;;;;356:1061:23;;;;;;;;;;:::o;:::-;;:::i;:::-;;;;;-1:-1:-1;;356:1061:23;;;;-1:-1:-1;;;;;356:1061:23;;;;;;;;;;:::o;:::-;;;;;;;;:::i;:::-;:::o;:::-;;;;;;;;;;;;-1:-1:-1;;;;;356:1061:23;;;;;;;;;;;-1:-1:-1;;356:1061:23;;;;;:::i;:::-;;;;;;;;;;;;;-1:-1:-1;356:1061:23;;;;;;;;;;;;;;:::o;:::-;-1:-1:-1;;;;;356:1061:23;;;;;:::o;:::-;;;;;;:::i;441:408::-;;;;;;;;;;;356:1061;;;;;;;:::i;:::-;;;;-1:-1:-1;;;356:1061:23;;;;;;;;;;;-1:-1:-1;;;;;356:1061:23;;;;;;;2046:13:79;356:1061:23;;:::i;:::-;;:::i;:::-;;;;;;;;;;1059:19:25;356:1061:23;1013:6;356:1061;;;;;1022:27:25;356:1061:23;;;1112:21:25;356:1061:23;;1143:17:25;356:1061:23;;-1:-1:-1;356:1061:23;;;;;;;;;;;;;;;;;;;;;2046:13:79;356:1061:23;;:::i;:::-;955:12:74;734:10:88;955:12:74;:::i;:::-;3251:45:94;;;:::i;:::-;3243:53;;3317:51;;;:::i;:::-;3306:62;;356:1061:23;;;;;3392:22:94;3378:36;;356:1061:23;3441:25:94;;3424:42;;3494:13;3477:30;;3542:23;;:::i;:::-;3517:48;;3597:4;3575:27;;1003:7:25;;;:::i;:::-;1022:27;356:1061:23;;1022:27:25;1059:19;356:1061:23;;-1:-1:-1;;;;356:1061:23;;;;;;-1:-1:-1;;;356:1061:23;;;;;;;;1059:19:25;1088:14;356:1061:23;1088:14:25;356:1061:23;;1088:14:25;1112:21;356:1061:23;;-1:-1:-1;;;;;;356:1061:23;-1:-1:-1;;;;;356:1061:23;;;;;;;;;;;1112:21:25;1059:19;356:1061:23;;-1:-1:-1;;;;;;356:1061:23;-1:-1:-1;;;;;356:1061:23;;;;;;;;;;;1143:17:25;1013:6:23;:::i;356:1061::-;;;;;;;;;;2046:13:79;356:1061:23;;-1:-1:-1;;356:1061:23;;;;;-1:-1:-1;356:1061:23;;;;;;;;;1013:6;356:1061;;;;;;;1143:17:25;356:1061:23;;;1059:19:25;356:1061:23;;1112:21:25;356:1061:23;;1022:27:25;356:1061:23;;;;;;;;;;2046:13:79;356:1061:23;;:::i;:::-;;;;;;;;2046:13:79;356:1061:23;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;:::-;2046:13:79;-1:-1:-1;356:1061:23;;-1:-1:-1;356:1061:23;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;:::-;-1:-1:-1;356:1061:23;;;;;;;;;-1:-1:-1;356:1061:23;;;;;;;;;;;;;:::o;:::-;-1:-1:-1;356:1061:23;;-1:-1:-1;356:1061:23;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;:::-;-1:-1:-1;356:1061:23;;;;;;;;;-1:-1:-1;356:1061:23;;;;;;;;;;-1:-1:-1;;;;;356:1061:23;;;;;;;2069:17:79;356:1061:23;;:::i;:::-;2069:17:79;356:1061:23;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2069:17:79;356:1061:23;:::o;:::-;;;;-1:-1:-1;356:1061:23;;;;;2069:17:79;356:1061:23;;-1:-1:-1;;356:1061:23;;;;;;;;;;;;;;;;;;;;;;;;;;;2069:17:79;356:1061:23;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5139:115:25;-1:-1:-1;;;;;356:1061:23;5207:18:25;5203:44;;5139:115::o;5203:44::-;5234:13;;;5223:1;5234:13;;5223:1;5234:13;2895:341:90;;356:1061:23;;3040:2:90;3018:24;;3014:216;3040:2;;;3065:20;;;;;:::i;:::-;3058:27;:::o;3014:216::-;-1:-1:-1;;;;;356:1061:23;;;;;;;3282:13:94;356:1061:23;;:::i;:::-;3282:13:94;356:1061:23;:::i;:::-;3040:2:90;356:1061:23;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3282:13:94;356:1061:23;1371:66:90;3176:43;:::o;356:1061:23:-;3282:13:94;356:1061:23;;-1:-1:-1;;356:1061:23;;;;;;;;;;;;;;;;;;;;;;;;;;;3282:13:94;356:1061:23;1371:66:90;3176:43;:::o;356:1061:23:-;;;;;;;;;;;;;;;;;;;;;;;3040:2:90;356:1061:23;;;;;;;;;;;;;;;;2895:341:90;;356:1061:23;;3040:2:90;3018:24;;3014:216;3040:2;;;3065:20;;;;;:::i;3014:216::-;-1:-1:-1;;;;;356:1061:23;;;;;;;3351:16:94;356:1061:23;;:::i;:::-;3351:16:94;356:1061:23;:::i;:::-;3040:2:90;356:1061:23;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3351:16:94;356:1061:23;1371:66:90;3176:43;:::o;356:1061:23:-;3351:16:94;356:1061:23;;-1:-1:-1;;356:1061:23;;;;;;;;;;;;;;;;;;;;;;;;;;;3351:16:94;356:1061:23;1371:66:90;3176:43;:::o;356:1061:23:-;;;;;;;;;;;;;;;;;;;;;;;3040:2:90;356:1061:23;;;;;;;;;;;;;;;;3963:180:94;4077:11;1929:95;4090:14;1929:95;356:1061:23;;4054:81:94;;;;1929:95;;;;356:1061:23;1929:95:94;;;;;;;4106:13;1929:95;;;;4129:4;1929:95;;;;;4054:81;;;;;;:::i;:::-;356:1061:23;4044:92:94;;3963:180;:::o;2426:187:74:-;2518:6;356:1061:23;;-1:-1:-1;;;;;356:1061:23;;;-1:-1:-1;;;;;;356:1061:23;;;;;;;;;;2566:40:74;-1:-1:-1;;2566:40:74;2426:187::o;356:1061:23:-;;;;:::o;:::-;;;-1:-1:-1;;;356:1061:23;;;;;;;;;;;;;;;;;-1:-1:-1;;;356:1061:23;;;;;;;7332:285:82;;-1:-1:-1;;;;;356:1061:23;;8603:21:79;;356:1061:23;;8731:22:79;356:1061:23;;;;;;;;;7555:55:82;8731:22:79;1401:6:23;8731:22:79;;;;;356:1061:23;;8731:22:79;-1:-1:-1;;;;;356:1061:23;;8622:1:79;356:1061:23;;;;;;;;;;;;;;;;;;1929:95:94;;;8952:37:79;;356:1061:23;8952:37:79;1401:6:23;:::i;:::-;8731:22:79;356:1061:23;7454:90:82;;-1:-1:-1;;;;;;7462:29:82;7454:90;:::i;:::-;7555:55;:::i;:::-;7332:285;;:::o;356:1061:23:-;;:::i;:::-;;;-1:-1:-1;;;356:1061:23;;;;;;;;;;;;;;;;;;;;1689:286:90;1835:2;356:1061:23;;1821:16:90;1817:72;;356:1061:23;;;;;1929:95:94;356:1061:23;;;;;1930:36:90;1689:286;:::o;356:1061:23:-;;;;;;;;;;1930:36:90;1689:286;:::o;1817:72::-;356:1061:23;;;;;1860:18:90;;;;;;;;;;;;356:1061:23;;;;;;;;;;;;;;;;-1:-1:-1;356:1061:23;;;;;;1835:2:90;356:1061:23;-1:-1:-1;;356:1061:23;;;1860:18:90;;;;356:1061:23;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;356:1061:23;;;;;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;356:1061:23;;;;;;;;;;;;;;;;;-1:-1:-1;;356:1061:23;;;;;;;;;;;;;:::o;:::-;;;;-1:-1:-1;356:1061:23;;;;;-1:-1:-1;356:1061:23;9420:768:82;7572:23;356:1061:23;9420:768:82;;9727:8;;;:59;;;;356:1061:23;;:::i;:::-;;;;;9738:16:82;;;356:1061:23;9727:59:82;9813:13;;;356:1061:23;9852:20:82;;9801:25;;-1:-1:-1;;;;;356:1061:23;;-1:-1:-1;;;;;356:1061:23;;;9801:25:82;9852:20;;7597:4;9852:20;:::i;:::-;9891:7;;:39;;;;9727:59;-1:-1:-1;9887:285:82;;;9950:67;9988:29;9950;9988;;;:::i;:::-;7572:23;356:1061:23;10663:110:82;356:1061:23;-1:-1:-1;;;;;;;;;;;10663:110:82;;10540:239;9950:29;356:1061:23;;;;;;;;;;;;;;;;;9887:285:82;1915:12;10056:101;10090:26;;1897:31;1915:12;1897:31;:::i;:::-;356:1061:23;;;;10090:26:82;;:::i;:::-;10067:89;10125:29;;;:::i;:::-;10067:89;356:1061:23;;:::i;:::-;;;;;;;;10067:89:82;-1:-1:-1;;;;;356:1061:23;9813:13:82;10067:89;;356:1061:23;;10067:89:82;7572:23;10056:101;:::i;9891:39::-;356:1061:23;;;;-1:-1:-1;356:1061:23;9902:28:82;1897:31;1915:12;1897:31;:::i;9902:28::-;356:1061:23;;9902:28:82;9891:39;;;9727:59;7572:23;356:1061:23;10663:110:82;356:1061:23;-1:-1:-1;;;;;;;;;;;10663:110:82;;356:1061:23;:::i;9757:29:82:-;356:1061:23;:::i;:::-;9727:59:82;;9420:768;;;356:1061:23;;9727:8:82;;;:59;;;;;;356:1061:23;;:::i;:::-;;;;;9738:16:82;;;356:1061:23;9727:59:82;9813:13;;;356:1061:23;9852:20:82;;9801:25;;-1:-1:-1;;;;;356:1061:23;;;9801:25:82;9852:20;;9065:9;9852:20;:::i;:::-;9891:7;;:39;;;;9727:59;-1:-1:-1;9887:285:82;;;9950:29;:67;9988:29;;;;:::i;:::-;356:1061:23;;;;9950:29:82;10663:110;;;;;;10540:239;;9887:285;1915:12;10056:101;1915:12;10090:26;;1897:31;1915:12;1897:31;:::i;10090:26::-;10125:29;10067:89;10125:29;;;:::i;:::-;10067:89;356:1061:23;;:::i;:::-;;;;;;;;10067:89:82;-1:-1:-1;;;;;356:1061:23;9813:13:82;10067:89;;356:1061:23;;10067:89:82;10056:101;:::i;9891:39::-;356:1061:23;;;;-1:-1:-1;356:1061:23;9902:28:82;1897:31;1915:12;1897:31;:::i;9902:28::-;356:1061:23;;9902:28:82;9891:39;;;9727:59;356:1061:23;9757:29:82;356:1061:23;;;;9757:29:82;10663:110;;;;;;10540:239;;356:1061:23;9727:59:82;;9420:768;;;356:1061:23;;9727:8:82;;;:59;;;;;;356:1061:23;;:::i;:::-;;;;;9738:16:82;;;356:1061:23;9727:59:82;9813:13;;;356:1061:23;9852:20:82;;9801:25;;-1:-1:-1;;;;;356:1061:23;;;9801:25:82;9852:20;;9300:4;9852:20;:::i;9727:59::-;356:1061:23;9757:29:82;356:1061:23;;;;9757:29:82;10663:110;;;;;;10540:239;;356:1061:23;9727:59:82;;15264:187:96;356:1061:23;15346:25:96;;356:1061:23;;;;15264:187:96;:::o;356:1061:23:-;;;-1:-1:-1;;;356:1061:23;;;;;;;;;;;;;;;;;-1:-1:-1;;;356:1061:23;;;;;;;2836:192:96;-1:-1:-1;;;;;2920:26:96;;356:1061:23;;-1:-1:-1;;;;;356:1061:23;;2836:192:96:o;356:1061:23:-;;;-1:-1:-1;;;356:1061:23;;;;;;;;;;;;;;;;;-1:-1:-1;;;356:1061:23;;;;;;;8036:224:82;2938:10;356:1061:23;;;;-1:-1:-1;;;;;356:1061:23;;;;;;;;;;;;;;8036:224:82;356:1061:23;8907:10:82;;;;;:24;;8036:224;8903:505;;8036:224;;;:::o;8903:505::-;8951:17;8947:221;;8903:505;9186:17;;9182:216;;8036:224;;:::o;9182:216::-;-1:-1:-1;;;;;356:1061:23;;;;;;9281:12:82;356:1061:23;;;;;-1:-1:-1;;;;;;;;;;;9336:47:82;9264:49;;;:::i;:::-;356:1061:23;;;1929:95:94;;;356:1061:23;;;1929:95:94;;;;356:1061:23;9336:47:82;7332:285::o;8947:221::-;356:1061:23;;;9046:12:82;356:1061:23;;-1:-1:-1;;;;;;;;;;;9029:54:82;356:1061:23;;;;9029:54:82;:::i;:::-;356:1061:23;;;1929:95:94;;;356:1061:23;;;1929:95:94;;;;356:1061:23;9106:47:82;8947:221;;;8907:24;8921:10;;;;8907:24;;14240:187:96;356:1061:23;14322:25:96;;356:1061:23;;;;14240:187:96;:::o;356:1061:23:-;;;-1:-1:-1;;;356:1061:23;;;;;;;;;;;;;;;;;-1:-1:-1;;;356:1061:23;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;;:::o", "linkReferences": {} }, "deployedBytecode": { "object": "0x60806040526004361015610011575f80fd5b5f3560e01c806306fdde03146102a4578063095ea7b31461029f57806318160ddd1461029a5780631af09a2b1461029557806323b872dd14610290578063241da1c01461028b578063313ce567146102865780633644e51514610281578063365bec7f1461027c57806339509351146102775780633a46b1a8146102725780634bf5d7e91461026d578063587cde1e146102685780635c19a95c146102635780636fcfff451461025e57806370a0823114610259578063715018a6146102545780637ecebe001461024f57806384b0196e1461024a5780638da5cb5b146102455780638e539e8c1461024057806391ddadf41461023b57806395d89b41146102365780639aa474ed146102315780639ab24eb01461022c578063a457c2d714610227578063a9059cbb14610222578063af5e3be01461021d578063b2ef14e314610218578063c26f6d4414610213578063c3cda5201461020e578063c58343ef14610209578063d19834fc14610204578063d505accf146101ff578063dc80d104146101fa578063dd62ed3e146101f5578063e0839ca1146101f0578063e84dee6b146101eb578063f1127ed8146101e6578063f2fde38b146101e15763fea5ef99146101dc575f80fd5b611923565b611853565b6117ce565b6116ad565b61166e565b611513565b6114c5565b61136f565b6112e4565b6111f4565b61102e565b610f99565b610ecf565b610eae565b610e84565b610dd6565b610d54565b610d37565b610c92565b610c67565b610b13565b610aeb565b6109ee565b6109b3565b610958565b61091e565b6108d5565b6108ad565b61086a565b6107b7565b61066a565b61060b565b6105a0565b61057e565b610563565b610510565b61043f565b610422565b610405565b6103d0565b6102e1565b805180835260209291819084018484015e5f828201840152601f01601f1916010190565b9060206102de9281815201906102a9565b90565b346103bb575f3660031901126103bb576040515f600354610301816119ba565b80845290600181169081156103975750600114610339575b61033583610329818503826115c1565b604051918291826102cd565b0390f35b60035f9081527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b939250905b80821061037d57509091508101602001610329610319565b919260018160209254838588010152019101909291610365565b60ff191660208086019190915291151560051b840190910191506103299050610319565b5f80fd5b6001600160a01b038116036103bb57565b346103bb5760403660031901126103bb576103fa6004356103f0816103bf565b602435903361217f565b602060405160018152f35b346103bb575f3660031901126103bb576020600254604051908152f35b346103bb575f3660031901126103bb576020600e54604051908152f35b346103bb5760603660031901126103bb5760043561045c816103bf565b602435610468816103bf565b6001600160a01b0382165f9081526001602081815260408084203385529091529091205492604435929184016104af575b6104a39350612364565b60405160018152602090f35b8284106104cb576104c6836104a39503338361217f565b610499565b60405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606490fd5b346103bb5760203660031901126103bb5760043561052d816103bf565b610535612472565b6001600160a01b0316610547816124ca565b6bffffffffffffffffffffffff60a01b60125416176012555f80f35b346103bb575f3660031901126103bb57602060405160128152f35b346103bb575f3660031901126103bb5760206105986124e9565b604051908152f35b346103bb5760203660031901126103bb57600435805f52600f60205260405f2054156105fc575f52600f60205260405f20545f5260116020526103356105f5610329600360405f2001604051928380926119f2565b03826115c1565b6341ba517160e11b5f5260045ffd5b346103bb5760403660031901126103bb57600435610628816103bf565b602435335f5260016020526106508260405f209060018060a01b03165f5260205260405f2090565b54908101809111610665576103fa913361217f565b61197e565b346103bb5760403660031901126103bb57600435610687816103bf565b602435906106a665ffffffffffff61069e43612770565b168310611a8e565b6001600160a01b03165f908152600b6020526040812080549290918360058111610768575b50905b838210610719575050816106f557505060205f5b6040516001600160e01b03919091168152f35b61070d610714916020935f1901905f5260205f200190565b5460201c90565b6106e2565b90926107258185612a2e565b908263ffffffff61074861073e85885f5260205f200190565b5463ffffffff1690565b1611156107585750925b906106ce565b935061076390611992565b610752565b8061077861077e929693966128bb565b906119ad565b908263ffffffff61079761073e85885f5260205f200190565b1611156107a75750925b5f6106cb565b93506107b290611992565b6107a1565b346103bb575f3660031901126103bb574365ffffffffffff6107d843612770565b1603610825576103356040516107ef6040826115c1565b601d81527f6d6f64653d626c6f636b6e756d6265722666726f6d3d64656661756c740000006020820152604051918291826102cd565b60405162461bcd60e51b815260206004820152601d60248201527f4552433230566f7465733a2062726f6b656e20636c6f636b206d6f64650000006044820152606490fd5b346103bb5760203660031901126103bb57600435610887816103bf565b60018060a01b03165f52600a602052602060018060a01b0360405f205416604051908152f35b346103bb5760203660031901126103bb576108d36004356108cd816103bf565b33612605565b005b346103bb5760203660031901126103bb576004356108f2816103bf565b60018060a01b03165f52600b602052602061091060405f2054612678565b63ffffffff60405191168152f35b346103bb5760203660031901126103bb5760043561093b816103bf565b60018060a01b03165f525f602052602060405f2054604051908152f35b346103bb575f3660031901126103bb57610970612472565b600580546001600160a01b031981169091555f906001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a3005b346103bb5760203660031901126103bb576004356109d0816103bf565b60018060a01b03165f526008602052602060405f2054604051908152f35b346103bb575f3660031901126103bb57610a92610a2a7f00000000000000000000000000000000000000000000000000000000000000006126e0565b610a537f0000000000000000000000000000000000000000000000000000000000000000612739565b6020604051610a6282826115c1565b5f815281610aa081830194601f198301368737604051978897600f60f81b895260e0858a015260e08901906102a9565b9087820360408901526102a9565b914660608701523060808701525f60a087015285830360c087015251918281520192915f5b828110610ad457505050500390f35b835185528695509381019392810192600101610ac5565b346103bb575f3660031901126103bb576005546040516001600160a01b039091168152602090f35b346103bb5760203660031901126103bb57600435610b4265ffffffffffff610b3a43612770565b168210611a8e565b600c54905f8260058111610c01575b50905b828210610b9f578280610b6d57506040515f8152602090f35b600c5f52602090610714907fdf6966c971051c3d54ec59162606531493a51404a002842f56009d7e5cf4a8c60161070d565b9091610bab8184612a2e565b600c5f52908263ffffffff610be17fdf6966c971051c3d54ec59162606531493a51404a002842f56009d7e5cf4a8c7850161073e565b161115610bf15750915b90610b54565b9250610bfc90611992565b610beb565b80610778610c11929593956128bb565b600c5f52908263ffffffff610c477fdf6966c971051c3d54ec59162606531493a51404a002842f56009d7e5cf4a8c7850161073e565b161115610c575750915b5f610b51565b9250610c6290611992565b610c51565b346103bb575f3660031901126103bb576020610c8243612770565b65ffffffffffff60405191168152f35b346103bb575f3660031901126103bb576040515f600454610cb2816119ba565b80845290600181169081156103975750600114610cd95761033583610329818503826115c1565b60045f9081527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b939250905b808210610d1d57509091508101602001610329610319565b919260018160209254838588010152019101909291610d05565b346103bb575f3660031901126103bb576020600d54604051908152f35b346103bb5760203660031901126103bb57600435610d71816103bf565b6001600160a01b03165f818152600b60205260409020549081610daf5750506103355f5b6040516001600160e01b0390911681529081906020820190565b61033591610dcc915f52600b60205260405f20905f190190611ada565b505460201c610d95565b346103bb5760403660031901126103bb57600435610df3816103bf565b60243590335f526001602052610e1c8160405f209060018060a01b03165f5260205260405f2090565b5491808310610e31576104a39203903361217f565b60405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608490fd5b346103bb5760403660031901126103bb576103fa600435610ea4816103bf565b6024359033612364565b346103bb5760203660031901126103bb57600435610eca612472565b600d55005b346103bb5760403660031901126103bb57600435610eec816103bf565b602435610ef7612472565b8015610f8a576012546040516370a0823160e01b81523060048201526001600160a01b039091169290602081602481875afa908115610f85575f91610f56575b508211610f47576108d3926127dc565b631e9acf1760e31b5f5260045ffd5b610f78915060203d602011610f7e575b610f7081836115c1565b810190611b03565b5f610f37565b503d610f66565b611b12565b63162908e360e11b5f5260045ffd5b346103bb5760203660031901126103bb57600435610fb6816103bf565b610fbe612472565b610fc7816124ca565b6010546001600160a01b0391821691829082167f98b88aa89cb5f247008e613dc8529d633ab05a62f7120c07ebcfcdd852fc2a8d5f80a36001600160a01b03191617601055005b6064359060ff821682036103bb57565b6084359060ff821682036103bb57565b346103bb5760c03660031901126103bb5760043561104b816103bf565b6044359060243561105a61100e565b6084359360a435814211611117576108d395611112936110e5876110cf6110dd6110ea976040519283918c60208401968760609194939260808201957fe48329057bfd03d55e49b547132e39cffd9c1820ad7b9d4c5307691425d15adf835260018060a01b0316602083015260408201520152565b03601f1981018352826115c1565b51902061281c565b612842565b6001600160a01b0381165f908152600860205260409020805460018101909155909214611b1d565b612605565b60405162461bcd60e51b815260206004820152601d60248201527f4552433230566f7465733a207369676e617475726520657870697265640000006044820152606490fd5b634e487b7160e01b5f52602160045260245ffd5b6004111561117a57565b61115c565b90602082528051602083015260018060a01b03602082015116604083015263ffffffff6040820151166060830152606081015191600483101561117a576102de92608082015260a06111df608084015160c08385015260e08401906102a9565b9201519060c0601f19828503019101526102a9565b346103bb5760203660031901126103bb57600435606060a060405161121881611586565b5f81525f60208201525f60408201525f8382015282608082015201525f52601160205261033560405f206112a660036040519261125484611586565b8054845260018101546001600160a01b038116602086015260a081901c63ffffffff16604086015261128f9060c01c60ff1660608601611b69565b61129b60028201611a73565b608085015201611a73565b60a08201526040519182918261117f565b9181601f840112156103bb578235916001600160401b0383116103bb57602083818601950101116103bb57565b346103bb5760403660031901126103bb576004356024356001600160401b0381116103bb576113179036906004016112b7565b909160418210611360576040198201828111610665576103359361134a61134361135095848185611b75565b369161161d565b92611fe7565b6040519081529081906020820190565b63099f6dd560e31b5f5260045ffd5b346103bb5760e03660031901126103bb5760043561138c816103bf565b602435611398816103bf565b60443590606435926113a861101e565b60a4359460c43581421161146d576108d396611468936110e586896110dd8a6110cf611455996113f18660018060a01b03165f52600860205260405f2090815491600183019055565b604051958694602086019889919260a093969594919660c08401977f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98552600180871b03166020850152600180861b03166040840152606083015260808201520152565b6001600160a01b03838116911614611b8d565b61217f565b60405162461bcd60e51b815260206004820152601d60248201527f45524332305065726d69743a206578706972656420646561646c696e650000006044820152606490fd5b6024359063ffffffff821682036103bb57565b346103bb5760203660031901126103bb5760043563ffffffff811681036103bb576114ee612472565b6010805463ffffffff60a01b191660a09290921b63ffffffff60a01b16919091179055005b346103bb5760403660031901126103bb576020611569600435611535816103bf565b60243590611542826103bf565b60018060a01b03165f526001835260405f209060018060a01b03165f5260205260405f2090565b54604051908152f35b634e487b7160e01b5f52604160045260245ffd5b60c081019081106001600160401b038211176115a157604052565b611572565b604081019081106001600160401b038211176115a157604052565b90601f801991011681019081106001600160401b038211176115a157604052565b604051906115f160c0836115c1565b565b604051906115f16040836115c1565b6001600160401b0381116115a157601f01601f191660200190565b92919261162982611602565b9161163760405193846115c1565b8294818452818301116103bb578281602093845f960137010152565b9080601f830112156103bb578160206102de9335910161161d565b346103bb5760403660031901126103bb576004356024356001600160401b0381116103bb576020916116a7610598923690600401611653565b90611bd9565b346103bb5760403660031901126103bb576004356024356001600160401b0381116103bb576116e09036906004016112b7565b6116f48392935f52601160205260405f2090565b60018101908154600161170b8260ff9060c01c1690565b61171481611170565b036117bf576117309060a01c63ffffffff165b63ffffffff1690565b42116117b0576010546001600160a01b031633036117a25761176d92600361175a92019586611c78565b805460ff60c01b1916600160c11b179055565b7f847d58c674038bb7f3ec4f6bbd97d64a3da0f3db4312900c67a2778f0b2840ba6040518061179d339582611d64565b0390a3005b6282b42960e81b5f5260045ffd5b63055e18ff60e31b5f5260045ffd5b632efb6afd60e01b5f5260045ffd5b346103bb5760403660031901126103bb57604061182f6118296004356117f3816103bf565b6117fb6114b2565b905f6020865161180a816115a6565b82815201526001600160a01b03165f908152600b602052849020611ada565b50611d75565b8151815163ffffffff1681526020918201516001600160e01b031691810191909152f35b346103bb5760203660031901126103bb57600435611870816103bf565b611878612472565b6001600160a01b038116156118cf57600580546001600160a01b039283166001600160a01b0319821681179092559091167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3005b60405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608490fd5b346103bb5760603660031901126103bb576004356024356001600160401b0381116103bb576119569036906004016112b7565b9091604435916001600160401b0383116103bb5760209361134a610598943690600401611653565b634e487b7160e01b5f52601160045260245ffd5b906001820180921161066557565b9190820180921161066557565b9190820391821161066557565b90600182811c921680156119e8575b60208310146119d457565b634e487b7160e01b5f52602260045260245ffd5b91607f16916119c9565b5f9291815491611a01836119ba565b8083529260018116908115611a565750600114611a1d57505050565b5f9081526020812093945091925b838310611a3c575060209250010190565b600181602092949394548385870101520191019190611a2b565b915050602093945060ff929192191683830152151560051b010190565b906115f1611a8792604051938480926119f2565b03836115c1565b15611a9557565b60405162461bcd60e51b815260206004820152601960248201527f4552433230566f7465733a20667574757265206c6f6f6b7570000000000000006044820152606490fd5b8054821015611aef575f5260205f2001905f90565b634e487b7160e01b5f52603260045260245ffd5b908160209103126103bb575190565b6040513d5f823e3d90fd5b15611b2457565b60405162461bcd60e51b815260206004820152601960248201527f4552433230566f7465733a20696e76616c6964206e6f6e6365000000000000006044820152606490fd5b600482101561117a5752565b909392938483116103bb5784116103bb578101920390565b15611b9457565b60405162461bcd60e51b815260206004820152601e60248201527f45524332305065726d69743a20696e76616c6964207369676e617475726500006044820152606490fd5b6102de91602081519101206040519060208201927fbf842cb9fe7273c2aac2391f36077927eaae4fffb9d035401f660ed5e6aef4bd845260408301526060820152606081526110dd6080826115c1565b601f8211611c3657505050565b5f5260205f20906020601f840160051c83019310611c6e575b601f0160051c01905b818110611c63575050565b5f8155600101611c58565b9091508190611c4f565b9092916001600160401b0381116115a157611c9d81611c9784546119ba565b84611c29565b5f601f8211600114611cdb578190611ccc9394955f92611cd0575b50508160011b915f199060031b1c19161790565b9055565b013590505f80611cb8565b601f19821694611cee845f5260205f2090565b915f5b878110611d28575083600195969710611d0f575b505050811b019055565b01355f19600384901b60f8161c191690555f8080611d05565b90926020600181928686013581550194019101611cf1565b90600481101561117a57815460ff60c01b191660c09190911b60ff60c01b16179055565b9060206102de9281815201906119f2565b90604051611d82816115a6565b602081935463ffffffff81168352811c910152565b5f1981146106655760010190565b90918060409360208452816020850152848401375f828201840152601f01601f1916010190565b60405190611ddb6020836115c1565b5f808352366020840137565b91909182516001600160401b0381116115a157611e0881611c9784546119ba565b6020601f8211600114611e42578190611ccc9394955f92611e375750508160011b915f199060031b1c19161790565b015190505f80611cb8565b601f19821690611e55845f5260205f2090565b915f5b818110611e8e57509583600195969710611e7657505050811b019055565b01515f1960f88460031b161c191690555f8080611d05565b9192602060018192868b015181550194019201611e58565b81518155602082015160018201805460408501516001600160a01b039093166001600160c01b03199091161760a09290921b63ffffffff60a01b169190911781556060830151919291600481101561117a57611f0191611d40565b6002820160808201518051906001600160401b0382116115a157611f2f82611f2985546119ba565b85611c29565b602090601f8311600114611f745792611f688360a0946115f19897946003975f92611e375750508160011b915f199060031b1c19161790565b90555b01519101611de7565b90601f19831691611f88855f5260205f2090565b925f5b818110611fcf5750936115f1979693600396936001938360a09810611fb8575b505050811b019055611f6b565b01515f1983891b60f8161c191690555f8080611fab565b92936020600181928786015181550195019301611f8b565b90611ffa825f52600f60205260405f2090565b546121705761206161200d600e54611d97565b9461201786600e55565b8561202a855f52600f60205260405f2090565b55600d5480612145575b5061204961204336878661161d565b85611bd9565b602082015190606060408401519301515f1a90612842565b906001600160a01b038216908115612136576102de946121159285887f9096741026bdd638bcc5cb995f0f00b4574b81f120a23c4a7086347116bf58a1604051806120ad878983611da5565b0390a46121096120d56117276120cf61172760105463ffffffff9060a01c1690565b426119a0565b6120fc6120e0611dcc565b966120e96115e2565b9889526001600160a01b03166020890152565b63ffffffff166040870152565b60016060860152611343565b608083015260a0820152612131835f52601160205260405f2090565b611ea6565b638baa579f60e01b5f5260045ffd5b60125461216a91906001600160a01b03166010546001600160a01b0316903390612859565b5f612034565b63339f7ff560e01b5f5260045ffd5b6001600160a01b03811691908215612260576001600160a01b03821693841561221057806121fa7f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925946121e561220b9560018060a01b03165f52600160205260405f2090565b9060018060a01b03165f5260205260405f2090565b556040519081529081906020820190565b0390a3565b60405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608490fd5b60405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608490fd5b156122b857565b60405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608490fd5b1561231057565b60405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608490fd5b6001600160a01b038116929190831561241f576115f1936001600160a01b038316906123918215156122b1565b6001600160a01b0383165f9081526020819052604090208590546123b782821015612309565b036123d18460018060a01b03165f525f60205260405f2090565b556001600160a01b0384165f908152602081815260409182902080548801905590518681527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9190a3612f2e565b60405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608490fd5b6005546001600160a01b0316330361248657565b606460405162461bcd60e51b815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b6001600160a01b0316156124da57565b63d92e233d60e01b5f5260045ffd5b307f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031614806125dc575b15612544577f000000000000000000000000000000000000000000000000000000000000000090565b60405160208101907f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f82527f000000000000000000000000000000000000000000000000000000000000000060408201527f000000000000000000000000000000000000000000000000000000000000000060608201524660808201523060a082015260a081526125d660c0826115c1565b51902090565b507f0000000000000000000000000000000000000000000000000000000000000000461461251b565b6001600160a01b039081165f818152600a60208181526040808420805485845291852054939092528686166001600160a01b0319821681179092556115f19692959294921692909183917f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f9080a4612a43565b63ffffffff811161268c5763ffffffff1690565b60405162461bcd60e51b815260206004820152602660248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203360448201526532206269747360d01b6064820152608490fd5b60ff81146127265760ff811690601f821161271757604051916127046040846115c1565b6020808452838101919036833783525290565b632cd44ac360e21b5f5260045ffd5b506040516102de816105f58160066119f2565b60ff811461275d5760ff811690601f821161271757604051916127046040846115c1565b506040516102de816105f58160076119f2565b65ffffffffffff81116127885765ffffffffffff1690565b60405162461bcd60e51b815260206004820152602660248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203460448201526538206269747360d01b6064820152608490fd5b60405163a9059cbb60e01b60208201526001600160a01b0390921660248301526044808301939093529181526115f1916128176064836115c1565b612ccc565b6042906128276124e9565b906040519161190160f01b8352600283015260228201522090565b916102de939161285193612d84565b919091612e09565b6040516323b872dd60e01b60208201526001600160a01b0392831660248201529290911660448301526064808301939093529181526115f1916128176084836115c1565b81156128a7570490565b634e487b7160e01b5f52601260045260245ffd5b8015612a29576102de906129bf6129b86129ae6129a461299a61299061298661297c600161296a5f8b608081901c80612a1b575b50806128fe6129609260401c90565b80612a0e575b5061290f8160201c90565b80612a01575b506129208160101c90565b806129f4575b506129318160081c90565b806129e7575b506129428160041c90565b806129da575b506129538160021c90565b806129cd575b5060011c90565b6129c55760011c90565b1b612975818b61289d565b0160011c90565b612975818a61289d565b612975818961289d565b612975818861289d565b612975818761289d565b612975818661289d565b612975818561289d565b809261289d565b90612f5f565b820160011c90565b600291509201915f612959565b600491509201915f612948565b600891509201915f612937565b601091509201915f612926565b602091509201915f612915565b604091509201915f612904565b6080925090506129606128ef565b505f90565b90808216911860011c81018091116106655790565b6001600160a01b03808316939291168084141580612c4c575b612a67575b50505050565b80612ad4575b5082612a7a575b80612a61565b6001600160a01b03165f908152600b602052604090207fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a72491612abb91612fcd565b60408051928352602083019190915290a25f8080612a74565b805f52600b6020527fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a72460405f208054801591825f14612c2c57612b156115f3565b5f81525f6020820152915b6020830151612b3f906001600160e01b03165b6001600160e01b031690565b92612b4c89856002613182565b94159081612c09575b5015612ba757612b7a612b9192612b6b86613082565b925f1901905f5260205f200190565b9063ffffffff82549181199060201b169116179055565b604080519182526020820192909252a25f612a6d565b50612c0490612bcb612bc6612bbb43612770565b65ffffffffffff1690565b612678565b90612bff612bd886613082565b612bef612be36115f3565b63ffffffff9095168552565b6001600160e01b03166020840152565b612f71565b612b91565b5163ffffffff16905063ffffffff612c23612bbb43612770565b9116145f612b55565b612c46612c415f198401835f5260205f200190565b611d75565b91612b20565b50821515612a5c565b908160209103126103bb575180151581036103bb5790565b15612c7457565b60405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608490fd5b6115f191612d4e9160018060a01b03165f8060405193612ced6040866115c1565b602085527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564602086015260208151910182855af13d15612d7c573d91612d3283611602565b92612d4060405194856115c1565b83523d5f602085013e6130f1565b8051908115918215612d62575b5050612c6d565b612d759250602080918301019101612c55565b5f80612d5b565b6060916130f1565b7f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08411612df4576020935f9360ff60809460405194855216868401526040830152606082015282805260015afa15610f85575f516001600160a01b03811615612dec57905f90565b505f90600190565b505050505f90600390565b6005111561117a57565b612e1281612dff565b80612e1a5750565b612e2381612dff565b60018103612e755760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015280606481015b0390fd5b612e7e81612dff565b60028103612ecb5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606490fd5b80612ed7600392612dff565b14612ede57565b60405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608490fd5b6001600160a01b039081165f908152600a60205260408082205493831682529020546115f193929082169116612a43565b9080821015612f6c575090565b905090565b8054680100000000000000008110156115a157612f9391600182018155611ada565b612fba57815160209283015190921b63ffffffff191663ffffffff92909216919091179055565b634e487b7160e01b5f525f60045260245ffd5b9091815491821592835f1461306857612fe46115f3565b5f81525f60208201525b602081015161301290613009906001600160e01b0316612b33565b96876001613182565b94159081613045575b501561303157612b7a6115f192612b6b86613082565b506115f190612bcb612bc6612bbb43612770565b5163ffffffff16905063ffffffff61305f612bbb43612770565b9116145f61301b565b61307d612c415f198301845f5260205f200190565b612fee565b6001600160e01b03811161309c576001600160e01b031690565b60405162461bcd60e51b815260206004820152602760248201527f53616665436173743a2076616c756520646f65736e27742066697420696e20326044820152663234206269747360c81b6064820152608490fd5b919290156131535750815115613105575090565b3b1561310e5790565b60405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606490fd5b8251909150156131665750805190602001fd5b60405162461bcd60e51b8152908190612e7190600483016102cd565b919091806001146131b4576002146131a857634e487b7160e01b5f52605160045260245ffd5b81039081116106655790565b508101809111610665579056fea264697066735822122064cab481df6b1a587bc18db83939d82743228c3be79f2f76ddf28c4b7c97dc9f64736f6c634300081c0033", "sourceMap": "356:1061:23:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;:::i;:::-;;:::i;:::-;;:::i;:::-;;:::i;:::-;;:::i;:::-;;:::i;:::-;;:::i;:::-;;:::i;:::-;;:::i;:::-;;:::i;:::-;;:::i;:::-;;:::i;:::-;;:::i;:::-;;:::i;:::-;;:::i;:::-;;:::i;:::-;;:::i;:::-;;:::i;:::-;;:::i;:::-;;:::i;:::-;;:::i;:::-;;:::i;:::-;;:::i;:::-;;:::i;:::-;;:::i;:::-;;:::i;:::-;;:::i;:::-;;:::i;:::-;;:::i;:::-;;:::i;:::-;;:::i;:::-;;:::i;:::-;;:::i;:::-;;:::i;:::-;;:::i;:::-;;:::i;:::-;;:::i;:::-;;:::i;:::-;;:::i;:::-;;;;;;;;;;;;;;;;;-1:-1:-1;356:1061:23;;;;;;;;-1:-1:-1;;356:1061:23;;;;:::o;:::-;;;;;;;;;;;:::i;:::-;;:::o;:::-;;;;;;-1:-1:-1;;356:1061:23;;;;;;;2244:5:79;356:1061:23;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;:::i;:::-;;;;;2244:5:79;356:1061:23;;;;;;;-1:-1:-1;356:1061:23;;;;;;;-1:-1:-1;356:1061:23;;-1:-1:-1;356:1061:23;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;356:1061:23;;;;;;;;;;;;;;;;;;;;-1:-1:-1;356:1061:23;;-1:-1:-1;356:1061:23;;;;;;;-1:-1:-1;;;;;356:1061:23;;;;;:::o;:::-;;;;;;-1:-1:-1;;356:1061:23;;;;4606:6:79;356:1061:23;;;;;:::i;:::-;;;734:10:88;;4606:6:79;:::i;:::-;356:1061:23;;;4630:4:79;356:1061:23;;;;;;;;;-1:-1:-1;;356:1061:23;;;;;3342:12:79;356:1061:23;;;;;;;;;;;;;-1:-1:-1;;356:1061:23;;;;;4518:10:25;356:1061:23;;;;;;;;;;;;;-1:-1:-1;;356:1061:23;;;;;;;;;:::i;:::-;;;;;;:::i;:::-;-1:-1:-1;;;;;356:1061:23;;-1:-1:-1;356:1061:23;;;;;;;;;;;;734:10:88;356:1061:23;;;;;;;;;;;;;;11244:37:79;;11240:243;;356:1061:23;5424:6:79;;;;:::i;:::-;356:1061:23;;4102:11:79;356:1061:23;;;;;11240:243:79;11305:26;;;356:1061:23;;11432:25:79;356:1061:23;5424:6:79;356:1061:23;;734:10:88;11432:25:79;;:::i;:::-;11240:243;;356:1061:23;;;-1:-1:-1;;;356:1061:23;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;356:1061:23;;;;;;;;;:::i;:::-;1063:62:74;;:::i;:::-;-1:-1:-1;;;;;356:1061:23;813:4:25;356:1061:23;813:4:25;:::i;:::-;356:1061:23;;;3735:21:25;356:1061:23;;;3735:21:25;356:1061:23;-1:-1:-1;356:1061:23;;;;;;;;-1:-1:-1;;356:1061:23;;;;;;;3186:2:79;356:1061:23;;;;;;;;;-1:-1:-1;;356:1061:23;;;;;2922:20:81;;:::i;:::-;356:1061:23;;;;;;;;;;;;-1:-1:-1;;356:1061:23;;;;;;;-1:-1:-1;356:1061:23;4349:6:25;356:1061:23;;;-1:-1:-1;356:1061:23;;4349:17:25;4345:43;;-1:-1:-1;356:1061:23;4349:6:25;356:1061:23;;;-1:-1:-1;356:1061:23;;-1:-1:-1;356:1061:23;4406:9:25;356:1061:23;;;;;4406:30:25;356:1061:23;-1:-1:-1;356:1061:23;4406:30:25;356:1061:23;;;;;;;:::i;:::-;;;;:::i;4345:43:25:-;4375:13;;;-1:-1:-1;4375:13:25;356:1061:23;-1:-1:-1;4375:13:25;356:1061:23;;;;;;-1:-1:-1;;356:1061:23;;;;;;;;;:::i;:::-;;;734:10:88;-1:-1:-1;356:1061:23;4102:11:79;356:1061:23;;4102:27:79;356:1061:23;;-1:-1:-1;356:1061:23;;;;;;;;;;;;;;;;;4102:27:79;356:1061:23;;;;;;;;;6021:38:79;734:10:88;;6021:38:79;:::i;356:1061:23:-;;:::i;:::-;;;;;;-1:-1:-1;;356:1061:23;;;;;;;;;:::i;:::-;;;1915:12:82;3581:57;356:1061:23;1897:31:82;1915:12;1897:31;:::i;:::-;356:1061:23;3589:19:82;;3581:57;:::i;:::-;-1:-1:-1;;;;;356:1061:23;-1:-1:-1;356:1061:23;;;3674:12:82;356:1061:23;;;;;;;;;;;5603:1:82;5594:10;;5590:242;;356:1061:23;5842:242:82;;5849:10;;;;;;-1:-1:-1;;6125:9:82;;;:52;;356:1061:23;-1:-1:-1;6125:52:82;356:1061:23;;-1:-1:-1;;;;;356:1061:23;;;;;;;6125:52:82;6141:30;:36;11264:17:79;356:1061:23;11264:17:79;;;356:1061:23;6141:30:82;10663:110;;;;;;10540:239;;6141:30;356:1061:23;;;;;6141:36:82;6125:52;;5842:242;5889:23;;;;;;:::i;:::-;5930:25;;356:1061:23;5930:35:82;:25;;;10663:110;;;;;;10540:239;;5930:25;356:1061:23;;;;;5930:35:82;356:1061:23;5930:47:82;;;;5997:10;5926:148;;5842:242;;;5926:148;6052:7;;;;;:::i;:::-;5926:148;;5590:242;5643:17;;5634:26;5643:17;;;;;:::i;:::-;5634:26;;:::i;:::-;5678:25;;356:1061:23;5678:35:82;:25;;;10663:110;;;;;;10540:239;;5678:35;356:1061:23;5678:47:82;3655:52;;;5745:10;5674:148;;5590:242;;;5674:148;5800:7;;;;;:::i;:::-;5674:148;;356:1061:23;;;;;;-1:-1:-1;;356:1061:23;;;;1915:12:82;356:1061:23;1897:31:82;1915:12;1897:31;:::i;:::-;356:1061:23;2189:23:82;356:1061:23;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;:::i;:::-;;;-1:-1:-1;;;356:1061:23;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;356:1061:23;;;;;;;;;:::i;:::-;;;;;;;-1:-1:-1;356:1061:23;2938:10:82;356:1061:23;;;;;;;;;-1:-1:-1;356:1061:23;;;;;;;;;;;;;;;-1:-1:-1;;356:1061:23;;;;6370:9:82;356:1061:23;;;;;:::i;:::-;734:10:88;6370:9:82;:::i;:::-;356:1061:23;;;;;;;-1:-1:-1;;356:1061:23;;;;;;;;;:::i;:::-;;;;;;;-1:-1:-1;356:1061:23;2714:12:82;356:1061:23;;;2696:47:82;356:1061:23;-1:-1:-1;356:1061:23;;2696:47:82;:::i;:::-;356:1061:23;;;;;;;;;;;;;;-1:-1:-1;;356:1061:23;;;;;;;;;:::i;:::-;;;;;;;-1:-1:-1;356:1061:23;-1:-1:-1;356:1061:23;;;;-1:-1:-1;356:1061:23;;;;;;;;;;;;;;-1:-1:-1;;356:1061:23;;;;1063:62:74;;:::i;:::-;2518:6;356:1061:23;;-1:-1:-1;;;;;;356:1061:23;;;;;;;-1:-1:-1;;;;;356:1061:23;2566:40:74;356:1061:23;;2566:40:74;356:1061:23;;;;;;;-1:-1:-1;;356:1061:23;;;;;;;;;:::i;:::-;;;;;;;-1:-1:-1;356:1061:23;2698:7:81;356:1061:23;;;;-1:-1:-1;356:1061:23;;;;;;;;;;;;;;-1:-1:-1;;356:1061:23;;;;;5427:41:94;:5;:41;:::i;:::-;5482:47;:8;:47;:::i;:::-;356:1061:23;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;:::i;:::-;5543:13:94;;356:1061:23;;;;5578:4:94;356:1061:23;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;356:1061:23;;;;;;;;;;;;;;;;;;-1:-1:-1;;356:1061:23;;;;1273:6:74;356:1061:23;;;-1:-1:-1;;;;;356:1061:23;;;;;;;;;;;;;;-1:-1:-1;;356:1061:23;;;;;;4080:57:82;356:1061:23;1897:31:82;1915:12;1897:31;:::i;:::-;356:1061:23;4088:19:82;;4080:57;:::i;:::-;4173:23;356:1061:23;5533:15:82;-1:-1:-1;5558:21:82;5603:1;5594:10;;5590:242;;356:1061:23;5842:242:82;;5849:10;;;;;;6125:52;:9;;;-1:-1:-1;356:1061:23;;-1:-1:-1;356:1061:23;;;;;6125:52:82;4173:23;11264:17:79;10663:110:82;356:1061:23;;6141:36:82;;10663:110;;6141:30;10540:239;5842:242;5889:23;;;;;;:::i;:::-;4173;10663:110;;5930:25;;356:1061:23;5930:35:82;10663:110;;;5930:25;10540:239;5930:35;356:1061:23;5930:47:82;;;;5997:10;5926:148;;5842:242;;;5926:148;6052:7;;;;;:::i;:::-;5926:148;;5590:242;5643:17;;5634:26;5643:17;;;;;:::i;5634:26::-;4173:23;10663:110;;5678:25;;356:1061:23;5678:35:82;10663:110;;;5678:25;10540:239;5678:35;356:1061:23;5678:47:82;;;;5745:10;5674:148;;5590:242;;;5674:148;5800:7;;;;;:::i;:::-;5674:148;;356:1061:23;;;;;;-1:-1:-1;;356:1061:23;;;;;1897:31:82;1915:12;1897:31;:::i;:::-;356:1061:23;;;;;;;;;;;;;;-1:-1:-1;;356:1061:23;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;-1:-1:-1;356:1061:23;;;;;;;-1:-1:-1;356:1061:23;;-1:-1:-1;356:1061:23;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;356:1061:23;;;;;4736:12:25;356:1061:23;;;;;;;;;;;;;-1:-1:-1;;356:1061:23;;;;;;;;;:::i;:::-;-1:-1:-1;;;;;356:1061:23;-1:-1:-1;356:1061:23;;;3149:12:82;356:1061:23;;;;;;;3218:8:82;;;:51;;356:1061:23;-1:-1:-1;3218:51:82;356:1061:23;;-1:-1:-1;;;;;356:1061:23;;;;;;;;;;;;;3218:51:82;356:1061:23;;3233:30:82;356:1061:23;-1:-1:-1;356:1061:23;3149:12:82;356:1061:23;;;-1:-1:-1;356:1061:23;11264:17:79;;;356:1061:23;3233:30:82;;:::i;:::-;356:1061:23;;;;3218:51:82;;356:1061:23;;;;;;-1:-1:-1;;356:1061:23;;;;;;;;;:::i;:::-;;;734:10:88;;-1:-1:-1;356:1061:23;4102:11:79;356:1061:23;;4102:27:79;356:1061:23;;-1:-1:-1;356:1061:23;;;;;;;;;;;;;;;;;4102:27:79;356:1061:23;6792:35:79;;;;356:1061:23;;6928:34:79;356:1061:23;;734:10:88;;6928:34:79;:::i;356:1061:23:-;;;-1:-1:-1;;;356:1061:23;;;;;;;;;;;;;;;;;-1:-1:-1;;;356:1061:23;;;;;;;;;;;;;-1:-1:-1;;356:1061:23;;;;3894:6:79;356:1061:23;;;;;:::i;:::-;;;734:10:88;;3894:6:79;:::i;356:1061:23:-;;;;;;-1:-1:-1;;356:1061:23;;;;;;1063:62:74;;:::i;:::-;3844:27:25;356:1061:23;;;;;;;;-1:-1:-1;;356:1061:23;;;;;;;;;:::i;:::-;;;1063:62:74;;:::i;:::-;4069:11:25;;4065:39;;4127:9;356:1061:23;;;-1:-1:-1;;;4127:34:25;;4155:4;356:1061:23;4127:34:25;;356:1061:23;-1:-1:-1;;;;;356:1061:23;;;;4127:19:25;356:1061:23;;;;;4127:34:25;;;;;;;-1:-1:-1;4127:34:25;;;356:1061:23;4118:43:25;;;4114:89;;4241:6;;;:::i;4114:89::-;4182:21;;;-1:-1:-1;4182:21:25;356:1061:23;-1:-1:-1;4182:21:25;4127:34;;;;356:1061:23;4127:34:25;356:1061:23;4127:34:25;;;;;;;;:::i;:::-;;;;;:::i;:::-;;;;;;;;;;;:::i;4065:39::-;4089:15;;;-1:-1:-1;4089:15:25;356:1061:23;-1:-1:-1;4089:15:25;356:1061:23;;;;;;-1:-1:-1;;356:1061:23;;;;;;;;;:::i;:::-;1063:62:74;;:::i;:::-;813:4:25;;;:::i;:::-;3557:7;356:1061:23;-1:-1:-1;;;;;356:1061:23;;;;;;;;3543:33:25;-1:-1:-1;;3543:33:25;-1:-1:-1;;;;;;356:1061:23;;3557:7:25;356:1061:23;;;;;;;;;;;;;:::o;:::-;;;;;;;;;;;:::o;:::-;;;;;;-1:-1:-1;;356:1061:23;;;;;;;;;:::i;:::-;;;;;;;;:::i;:::-;;;;;;6664:15:82;;:25;356:1061:23;;7021:9:82;356:1061:23;6929:64:82;356:1061:23;6777:87:82;356:1061:23;6804:58:82;;6750:169;356:1061:23;;;6804:58:82;;;;356:1061:23;6804:58:82;;;;1439:71;;;;;;;;356:1061:23;1439:71:82;356:1061:23;;;;;;;;1439:71:82;;;356:1061:23;1439:71:82;;;356:1061:23;1439:71:82;356:1061:23;1439:71:82;6804:58;;356:1061:23;;6804:58:82;;;;;;:::i;:::-;356:1061:23;6794:69:82;;6777:87;:::i;:::-;6750:169;:::i;:::-;-1:-1:-1;;;;;356:1061:23;;-1:-1:-1;356:1061:23;;;3200:7:81;356:1061:23;;;;;;;;;;;;;6946:17:82;;6937:26;6929:64;:::i;:::-;7021:9;:::i;356:1061:23:-;;;-1:-1:-1;;;356:1061:23;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;356:1061:23;;;:::o;:::-;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;:::i;:::-;;;;;;-1:-1:-1;;356:1061:23;;;;;;;;;;;;;:::i;:::-;-1:-1:-1;356:1061:23;;-1:-1:-1;356:1061:23;;;;-1:-1:-1;356:1061:23;;;;-1:-1:-1;356:1061:23;;;;;;;;;;;-1:-1:-1;356:1061:23;4632:9:25;356:1061:23;;;;-1:-1:-1;356:1061:23;;;;;;;;;:::i;:::-;;;;;;;;;-1:-1:-1;;;;;356:1061:23;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;-1:-1:-1;;;;;356:1061:23;;;;;;;;;;;;;;;:::o;:::-;;;;;;-1:-1:-1;;356:1061:23;;;;;;;;-1:-1:-1;;;;;356:1061:23;;;;;;;;;;;:::i;:::-;1415:15:25;;1428:2;1415:15;;1411:55;;-1:-1:-1;;356:1061:23;;;;;;;;;;1565:31:25;1614:26;356:1061:23;1565:31:25;;;;:::i;:::-;356:1061:23;;;:::i;:::-;1614:26:25;;:::i;:::-;356:1061:23;;;;;;;;;;;;;1411:55:25;1439:27;;;-1:-1:-1;1439:27:25;356:1061:23;-1:-1:-1;1439:27:25;356:1061:23;;;;;;-1:-1:-1;;356:1061:23;;;;;;;;;:::i;:::-;;;;;;:::i;:::-;;;;;;;;;:::i;:::-;;;;;;2139:15:81;;:27;356:1061:23;;2536:5:81;2294:16;2442:58;2294:16;2348:28;2294:16;;2242:79;2294:16;2242:79;2404:28;2294:16;;;356:1061:23;;;;;;-1:-1:-1;356:1061:23;3200:7:81;356:1061:23;;;-1:-1:-1;356:1061:23;;;;;1050:1:89;356:1061:23;;;;3080:203:81;2294:16;356:1061:23;;2242:79:81;;;356:1061:23;2242:79:81;;;;1125:95;;;;;;;;;;;;356:1061:23;1125:95:81;356:1061:23;;;;;;;;1125:95:81;;;356:1061:23;;;;;;;1125:95:81;;;356:1061:23;1125:95:81;;;356:1061:23;1125:95:81;;;356:1061:23;1125:95:81;356:1061:23;1125:95:81;2404:28;-1:-1:-1;;;;;356:1061:23;;;;;2450:15:81;2442:58;:::i;:::-;2536:5;:::i;356:1061:23:-;;;-1:-1:-1;;;356:1061:23;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;-1:-1:-1;;356:1061:23;;;;;;;;;;;;;1063:62:74;;:::i;:::-;3950:19:25;356:1061:23;;-1:-1:-1;;;;356:1061:23;;;;;;-1:-1:-1;;;356:1061:23;;;;;;;;;;;;;;-1:-1:-1;;356:1061:23;;;;;4102:27:79;356:1061:23;;;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;-1:-1:-1;356:1061:23;4102:11:79;356:1061:23;;;-1:-1:-1;356:1061:23;;;;;;;;;;;;;;;;;4102:27:79;356:1061:23;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;356:1061:23;;;;;;;:::o;:::-;;:::i;:::-;;;;;;;-1:-1:-1;;;;;356:1061:23;;;;;;;:::o;:::-;;;;;;;;;;;;;-1:-1:-1;;;;;356:1061:23;;;;;;;:::o;:::-;;;;;;;;:::i;:::-;:::o;:::-;;;;;;;;:::i;:::-;-1:-1:-1;;;;;356:1061:23;;;;;;-1:-1:-1;;356:1061:23;;;;:::o;:::-;;;;;;;:::i;:::-;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;-1:-1:-1;356:1061:23;;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;-1:-1:-1;;356:1061:23;;;;;;;;-1:-1:-1;;;;;356:1061:23;;;;;;;;;;;;;;:::i;:::-;;;:::i;:::-;;;;;;-1:-1:-1;;356:1061:23;;;;;;;;-1:-1:-1;;;;;356:1061:23;;;;;;;;;;;:::i;:::-;3032:16:25;;;;356:1061:23;;3032:9:25;356:1061:23;;;;;;;3032:16:25;3062:14;;;356:1061:23;;;3062:14:25;356:1061:23;;;;;;;;;;;;;:::i;:::-;3062:39:25;3058:86;;3158:33;;356:1061:23;;;;;;;;;3158:33:25;:15;:33;3154:55;;3237:7;356:1061:23;-1:-1:-1;;;;;356:1061:23;3223:10:25;:21;3219:48;;3311:39;3278:14;;356:1061:23;3278:14:25;;356:1061:23;;;:::i;:::-;;;-1:-1:-1;;;;356:1061:23;-1:-1:-1;;;356:1061:23;;;;3311:39:25;3366:52;356:1061:23;;3223:10:25;3366:52;3223:10;3366:52;;;:::i;:::-;;;;356:1061:23;3219:48:25;3253:14;;;-1:-1:-1;3253:14:25;356:1061:23;-1:-1:-1;3253:14:25;3154:55;3200:9;;;-1:-1:-1;3200:9:25;356:1061:23;-1:-1:-1;3200:9:25;3058:86;3122:22;;;-1:-1:-1;3122:22:25;356:1061:23;-1:-1:-1;3122:22:25;356:1061:23;;;;;;-1:-1:-1;;356:1061:23;;;;;;2493:26:82;356:1061:23;;;;;:::i;:::-;;;:::i;:::-;;-1:-1:-1;356:1061:23;;;;;;:::i;:::-;;;;;;-1:-1:-1;;;;;356:1061:23;-1:-1:-1;356:1061:23;;;2493:12:82;356:1061:23;;;;;2493:26:82;:::i;:::-;356:1061:23;;:::i;:::-;;;;;;;;;;;;;;-1:-1:-1;;;;;356:1061:23;;;;;;;;;;;;;;;-1:-1:-1;;356:1061:23;;;;;;;;;:::i;:::-;1063:62:74;;:::i;:::-;-1:-1:-1;;;;;356:1061:23;;2162:22:74;356:1061:23;;2518:6:74;356:1061:23;;-1:-1:-1;;;;;356:1061:23;;;-1:-1:-1;;;;;;356:1061:23;;;;;;;;;;2566:40:74;-1:-1:-1;;2566:40:74;356:1061:23;;;;-1:-1:-1;;;356:1061:23;;;;;;;;;;;;;;;;;-1:-1:-1;;;356:1061:23;;;;;;;;;;;;;-1:-1:-1;;356:1061:23;;;;;;;;-1:-1:-1;;;;;356:1061:23;;;;;;;;;;;:::i;:::-;;;;;;-1:-1:-1;;;;;356:1061:23;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;5806:1:82;356:1061:23;;;;;;;:::o;:::-;;;;;;;;;;:::o;:::-;;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;:::o;:::-;-1:-1:-1;356:1061:23;;;;;;;;-1:-1:-1;356:1061:23;;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;;;;:::i;:::-;;;;:::i;:::-;;;;:::o;:::-;;;-1:-1:-1;;;356:1061:23;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;356:1061:23;;-1:-1:-1;356:1061:23;;;-1:-1:-1;356:1061:23;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;;1439:71:82;;;;:::o;:::-;356:1061:23;;-1:-1:-1;;;1439:71:82;;;;;;;;;;;356:1061:23;1439:71:82;356:1061:23;;;1439:71:82;;;;356:1061:23;;;;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;:::o;1125:95:81:-;;;;:::o;:::-;356:1061:23;;-1:-1:-1;;;1125:95:81;;;;;;;;;;;356:1061:23;1125:95:81;356:1061:23;;;1125:95:81;;;;4761:372:25;5098:28;4761:372;356:1061:23;;;;;5041:15:25;356:1061:23;;4931:139:25;356:1061:23;4931:139:25;;356:1061:23;4959:42:25;356:1061:23;;;;;;;;;;;4931:139:25;;;;;;:::i;356:1061:23:-;;;;;;;;;:::o;:::-;-1:-1:-1;356:1061:23;;-1:-1:-1;356:1061:23;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;:::-;-1:-1:-1;356:1061:23;;;;;;;;;-1:-1:-1;356:1061:23;;;;;;;;-1:-1:-1;;;;;356:1061:23;;;;;;;;;;:::i;:::-;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;11264:17:79;;;356:1061:23;;;;;;;;;;;;:::o;:::-;;;;-1:-1:-1;356:1061:23;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;-1:-1:-1;;356:1061:23;;;;;;;;;;;11264:17:79;;;356:1061:23;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;356:1061:23;;;;;;-1:-1:-1;;;356:1061:23;;;;:::o;:::-;;;;;;;;;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;;;;;;;;:::o;:::-;-1:-1:-1;;356:1061:23;;;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;356:1061:23;;;;:::o;:::-;;;;;;;;:::i;:::-;1810:1:25;356:1061:23;;;;;;;;:::o;:::-;;;;;;-1:-1:-1;;;;;356:1061:23;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;11264:17:79;;;356:1061:23;;;;;;;;;;;;;-1:-1:-1;356:1061:23;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;11264:17:79;;356:1061:23;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;356:1061:23;;;-1:-1:-1;;;;;;356:1061:23;;;;;;;;;-1:-1:-1;;;356:1061:23;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;-1:-1:-1;;;;;356:1061:23;;;;;;;;;;:::i;:::-;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;356:1061:23;;;;;;;;11264:17:79;;;356:1061:23;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;-1:-1:-1;356:1061:23;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;356:1061:23;;;;;;;;;;11264:17:79;;;356:1061:23;;;;;;;;;;;;;;;;;;;;;;1653:1266:25;;1794:12;;356:1061:23;;1794:6:25;356:1061:23;;;;;;;1794:12:25;356:1061:23;1790:45:25;;2447:35;1861:12;;356:1061:23;1861:12:25;:::i;:::-;;;;;356:1061:23;;1861:12:25;1883;;;356:1061:23;;1794:6:25;356:1061:23;;;;;;;1883:12:25;356:1061:23;1970:12:25;356:1061:23;1970:16:25;1966:108;;1653:1266;356:1061:23;2171:25:25;356:1061:23;;;;;:::i;:::-;2171:25:25;;:::i;:::-;2262:158;;;;;;;;;;;;;-1:-1:-1;2262:158:25;2447:35;;:::i;:::-;356:1061:23;-1:-1:-1;;;;;356:1061:23;;;2496:20:25;;2492:51;;356:1061:23;;;;;;2559:45:25;2262:158;356:1061:23;2559:45:25;;;;;;:::i;:::-;;;;2659:230;2767:34;2774:26;;356:1061:23;2792:8:25;356:1061:23;;;;;;;;2774:26:25;:15;:26;:::i;2767:34::-;2659:230;2823:12;;:::i;:::-;356:1061:23;;;:::i;:::-;;;;-1:-1:-1;;;;;356:1061:23;2262:158:25;2659:230;;356:1061:23;;2659:230:25;356:1061:23;;2262:158:25;2659:230;;356:1061:23;;2659:230:25;2857:21;2262:158;2659:230;;356:1061:23;2659:230:25;356:1061:23;;2659:230:25;;;356:1061:23;2659:230:25;;;356:1061:23;2640:16:25;;356:1061:23;;3032:9:25;356:1061:23;;;;;;;2640:16:25;356:1061:23;:::i;2492:51:25:-;2525:18;;;-1:-1:-1;2525:18:25;;-1:-1:-1;2525:18:25;1966:108;2002:9;356:1061:23;2050:12:25;;356:1061:23;-1:-1:-1;;;;;356:1061:23;2041:7:25;356:1061:23;-1:-1:-1;;;;;356:1061:23;2029:10:25;;2050:12;;:::i;:::-;1966:108;;;1790:45;1820:15;;;-1:-1:-1;1820:15:25;;-1:-1:-1;1820:15:25;10457:340:79;-1:-1:-1;;;;;356:1061:23;;;10457:340:79;10558:19;;356:1061:23;;-1:-1:-1;;;;;356:1061:23;;;10636:21:79;;356:1061:23;;10707:18:79;:27;10758:32;10707:18;;10758:32;10707:18;356:1061:23;;;;;;;;10707:11:79;356:1061:23;;;;;;;10707:18:79;356:1061:23;;;;;;;;;;;;;;;;10707:27:79;356:1061:23;;;;;;;;;;;;;;10758:32:79;;;;10457:340::o;356:1061:23:-;;;-1:-1:-1;;;356:1061:23;;;;;;;;;;;;;;;;;-1:-1:-1;;;356:1061:23;;;;;;;;;;-1:-1:-1;;;356:1061:23;;;;;;;;;;;;;;;;;-1:-1:-1;;;356:1061:23;;;;;;;;;;;:::o;:::-;;;-1:-1:-1;;;356:1061:23;;;;;;;;;;;;;;;;;-1:-1:-1;;;356:1061:23;;;;;;;;;;;:::o;:::-;;;-1:-1:-1;;;356:1061:23;;;;;;;;;;;;;;;;;-1:-1:-1;;;356:1061:23;;;;;;;7456:788:79;-1:-1:-1;;;;;356:1061:23;;;7456:788:79;;7552:18;;356:1061:23;;1401:6;;-1:-1:-1;;;;;356:1061:23;;;7622:64:79;7630:16;;;7622:64;:::i;:::-;-1:-1:-1;;;;;356:1061:23;;7568:1:79;356:1061:23;;;;;;;;;;7768:15:79;;356:1061:23;7793:72:79;7801:21;;;;7793:72;:::i;:::-;356:1061:23;7899:15:79;;356:1061:23;;;;;;7568:1:79;356:1061:23;7568:1:79;356:1061:23;;;7568:1:79;356:1061:23;;;7899:15:79;356:1061:23;-1:-1:-1;;;;;356:1061:23;;7568:1:79;356:1061:23;;;;;;;;;;;;;;;;;;;;;;;8163:26:79;;356:1061:23;8163:26:79;1401:6:23;:::i;356:1061::-;;;-1:-1:-1;;;356:1061:23;;;;;;;;;;;;;;;;;-1:-1:-1;;;356:1061:23;;;;;;;1359:130:74;1273:6;356:1061:23;-1:-1:-1;;;;;356:1061:23;734:10:88;1422:23:74;356:1061:23;;1359:130:74:o;356:1061:23:-;;;;;;;;;;;;;;;;;;;;;;;;;5139:115:25;-1:-1:-1;;;;;356:1061:23;5207:18:25;5203:44;;5139:115::o;5203:44::-;5234:13;;;5223:1;5234:13;;5223:1;5234:13;3695:262:94;3779:4;3788:11;-1:-1:-1;;;;;356:1061:23;3771:28:94;;:63;;3695:262;3767:184;;;3857:22;3850:29;:::o;3767:184::-;356:1061:23;;4054:81:94;;;356:1061:23;1929:95:94;356:1061:23;;4077:11:94;356:1061:23;1929:95:94;;356:1061:23;4090:14:94;1929:95;;;356:1061:23;4106:13:94;1929:95;;;356:1061:23;3779:4:94;1929:95;;;356:1061:23;1929:95:94;4054:81;;;;;;:::i;:::-;356:1061:23;4044:92:94;;3910:30;:::o;3771:63::-;3820:14;;3803:13;:31;3771:63;;8431:380:82;-1:-1:-1;;;;;356:1061:23;;;-1:-1:-1;356:1061:23;;;2938:10:82;356:1061:23;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;356:1061:23;;;;;;;8787:16:82;;356:1061:23;;;;;;;;;;;8677:54:82;;-1:-1:-1;8677:54:82;8787:16;:::i;15264:187:96:-;356:1061:23;15346:25:96;;356:1061:23;;;;15264:187:96;:::o;356:1061:23:-;;;-1:-1:-1;;;356:1061:23;;;;;;;;;;;;;;;;;-1:-1:-1;;;356:1061:23;;;;;;;3367:268:90;1371:66;3490:47;;1371:66;;;2633:40;;2687:11;2696:2;2687:11;;2683:69;;356:1061:23;;;;;;;:::i;:::-;2292:2:90;356:1061:23;;;;;;;;;;;2348:90:90;;;3553:22;:::o;2683:69::-;2721:20;;;-1:-1:-1;2721:20:90;;-1:-1:-1;2721:20:90;3486:143;356:1061:23;;;1371:66:90;;;;5454:13:94;1371:66:90;:::i;3367:268::-;1371:66;3490:47;;1371:66;;;2633:40;;2687:11;2696:2;2687:11;;2683:69;;356:1061:23;;;;;;;:::i;3486:143:90:-;356:1061:23;;;1371:66:90;;;;5512:16:94;1371:66:90;:::i;14240:187:96:-;356:1061:23;14322:25:96;;356:1061:23;;;;14240:187:96;:::o;356:1061:23:-;;;-1:-1:-1;;;356:1061:23;;;;;;;;;;;;;;;;;-1:-1:-1;;;356:1061:23;;;;;;;941:175:86;356:1061:23;;-1:-1:-1;;;1050:58:86;;;;-1:-1:-1;;;;;356:1061:23;;;1050:58:86;;;356:1061:23;;;;;;;;;1050:58:86;;;;;;;356:1061:23;1050:58:86;:::i;:::-;;:::i;4768:165:94:-;8496:231:93;4768:165:94;4893:20;;:::i;:::-;8496:231:93;;;;-1:-1:-1;;;8496:231:93;;;;;;;;;;;4768:165:94;:::o;6598:232:93:-;;6791:5;6598:232;;6744:25;6598:232;6744:25;:::i;:::-;6791:5;;;;:::i;1355:203:86:-;356:1061:23;;-1:-1:-1;;;1482:68:86;;;;-1:-1:-1;;;;;356:1061:23;;;1482:68:86;;;356:1061:23;;;;;;;;;;;;;;;;;1482:68:86;;;;;;;356:1061:23;1482:68:86;:::i;356:1061:23:-;;;;;;;:::o;:::-;;;;;;;;;;;;6530:1642:95;6601:6;;6597:45;;8132:23;;8144:10;8085:26;8036;7987;7938;7889;7840;7791;9526:1;7344:12;356:1061:23;7344:7:95;356:1061:23;;;;8760:16:95;8756:99;;6530:1642;8872:11;;;9517:10;8872:11;356:1061:23;;;;8872:11:95;:15;8868:96;;6530:1642;8981:11;;;356:1061:23;;;;8981:11:95;:15;8977:96;;6530:1642;9090:11;;;356:1061:23;;;;9090:11:95;:15;9086:96;;6530:1642;9199:10;;;356:1061:23;;;;9199:10:95;:14;9195:93;;6530:1642;9305:10;;;356:1061:23;;;;9305:10:95;:14;9301:93;;6530:1642;9411:10;;;356:1061:23;;;;9411:10:95;:14;9407:93;;6530:1642;9517:10;356:1061:23;;;;9517:10:95;9513:64;;356:1061:23;;;;7344:12:95;356:1061:23;7801:10:95;;;;:::i;:::-;356:1061:23;;;;;7791:26:95;7850:10;;;;:::i;7840:26::-;7899:10;;;;:::i;7889:26::-;7948:10;;;;:::i;7938:26::-;7997:10;;;;:::i;7987:26::-;8046:10;;;;:::i;8036:26::-;8095:10;;;;:::i;8085:26::-;8144:10;;;:::i;:::-;8132:23;;:::i;9513:64::-;356:1061:23;;;;;;9407:93:95;9420:1;9445:11;;356:1061:23;;9407:93:95;;;;9301;9314:1;9339:11;;356:1061:23;;9301:93:95;;;;9195;9208:1;9233:11;;356:1061:23;;9195:93:95;;;;9086:96;9099:2;9125:12;;356:1061:23;;9086:96:95;;;;8977;8990:2;9016:12;;356:1061:23;;8977:96:95;;;;8868;8881:2;8907:12;;356:1061:23;;8868:96:95;;;;8756:99;8769:3;;-1:-1:-1;8796:13:95;-1:-1:-1;9517:10:95;8756:99;;6597:45;6623:8;356:1061:23;6623:8:95;:::o;805:153::-;;931:5;;;941;;356:1061:23;;;;;;;;;805:153:95;:::o;8817:597:82:-;-1:-1:-1;;;;;356:1061:23;;;;8817:597:82;;356:1061:23;8907:10:82;;;;;:24;;8817:597;8903:505;;8817:597;;;;;:::o;8903:505::-;8951:17;8947:221;;8903:505;9186:17;;9182:216;;8903:505;;;;9182:216;-1:-1:-1;;;;;356:1061:23;;;;;9281:12:82;356:1061:23;;;;;9336:47:82;;9264:49;;;:::i;:::-;356:1061:23;;;;;;;;;;;;;;9336:47:82;9182:216;;;;;8947:221;356:1061:23;8966:1:82;356:1061:23;9046:12:82;356:1061:23;;9106:47:82;356:1061:23;8966:1:82;356:1061:23;;;9727:8:82;;:59;;;;;;356:1061:23;;:::i;:::-;-1:-1:-1;356:1061:23;;-1:-1:-1;9738:16:82;;;356:1061:23;9727:59:82;;9813:13;;;356:1061:23;9801:25:82;;-1:-1:-1;;;;;356:1061:23;;-1:-1:-1;;;;;356:1061:23;;;9801:25:82;9852:20;;;;9065:9;9852:20;:::i;:::-;9891:7;;:39;;;;9727:59;-1:-1:-1;9887:285:82;;;9950:29;:67;9988:29;;;;:::i;:::-;11264:17:79;;;356:1061:23;9950:29:82;10663:110;;;;;;10540:239;;9950:29;356:1061:23;;;;;;;;;;;;;;;;;9950:67:82;356:1061:23;;;;;;;;;;;;;9106:47:82;8947:221;;;9887:285;1915:12;10056:101;1915:12;10090:26;;1897:31;1915:12;1897:31;:::i;:::-;356:1061:23;;;;10090:26:82;;:::i;:::-;10125:29;10067:89;10125:29;;;:::i;:::-;10067:89;356:1061:23;;:::i;:::-;;;;;;;;10067:89:82;-1:-1:-1;;;;;356:1061:23;9813:13:82;10067:89;;356:1061:23;;10067:89:82;10056:101;:::i;:::-;9887:285;;9891:39;356:1061:23;;;;-1:-1:-1;356:1061:23;9902:28:82;1897:31;1915:12;1897:31;:::i;9902:28::-;356:1061:23;;9902:28:82;9891:39;;;9727:59;356:1061:23;9757:29:82;11264:17:79;;356:1061:23;;9757:29:82;10663:110;;;;;;10540:239;;9757:29;356:1061:23;:::i;:::-;9727:59:82;;;8907:24;8921:10;;;;8907:24;;356:1061:23;;;;;;;;;;;;;;;;;;:::o;:::-;;;;:::o;:::-;;;-1:-1:-1;;;356:1061:23;;;;;;;;;;;;;;;;;-1:-1:-1;;;356:1061:23;;;;;;;5196:642:86;5720:111;5196:642;5535:69:87;5196:642:86;356:1061:23;;;;;;-1:-1:-1;356:1061:23;;;;;;;;:::i;:::-;;;;;;;;;;5487:31:87;;;;;;;;356:1061:23;;;;;;;;;:::i;:::-;;;;;;;;:::i;:::-;;;;-1:-1:-1;356:1061:23;;;;5535:69:87;:::i;:::-;356:1061:23;;5728:22:86;;;:56;;;;;356:1061:23;5720:111:86;;;:::i;5728:56::-;5754:30;;;356:1061:23;5754:30:86;;;;;;;;:::i;:::-;5728:56;;;;356:1061:23;;;5535:69:87;:::i;5009:1456:93:-;6021:66;6008:79;;6004:161;;356:1061:23;;-1:-1:-1;356:1061:23;;;;;;;;;;;;;;;;;;;;;;6276:24:93;;;;;;;;;-1:-1:-1;6276:24:93;-1:-1:-1;;;;;356:1061:23;;6314:20:93;6310:101;;6421:37;-1:-1:-1;5009:1456:93;:::o;6310:101::-;6350:50;-1:-1:-1;6350:50:93;6276:24;6350:50;:::o;6004:161::-;6103:51;;;;6119:1;6103:51;6123:30;6103:51;:::o;356:1061:23:-;;-1:-1:-1;356:1061:23;;;:::o;570:511:93:-;356:1061:23;;;:::i;:::-;638:29:93;;;683:7;:::o;634:441::-;356:1061:23;;;:::i;:::-;743:29:93;734:38;;743:29;;356:1061:23;;-1:-1:-1;;;788:34:93;;356:1061:23;788:34:93;;;356:1061:23;;;;;;;;;;;;;;;788:34:93;;;;730:345;356:1061:23;;;:::i;:::-;852:35:93;843:44;;852:35;;356:1061:23;;-1:-1:-1;;;903:41:93;;356:1061:23;903:41:93;;;356:1061:23;;;;;;;;;;;;;788:34:93;839:236;356:1061:23;;974:30:93;356:1061:23;;:::i;:::-;965:39:93;961:114;;570:511::o;961:114::-;356:1061:23;;-1:-1:-1;;;1020:44:93;;356:1061:23;1020:44:93;;;356:1061:23;;;;;;;;;;;-1:-1:-1;;;356:1061:23;;;;;;788:34:93;8036:224:82;-1:-1:-1;;;;;356:1061:23;;;-1:-1:-1;356:1061:23;;;2938:10:82;356:1061:23;;;;;;;;;;;;;;;8246:6:82;;8036:224;356:1061:23;;;;;8246:6:82;:::i;588:104:95:-;;672:5;;;;;;:13;588:104;:::o;672:13::-;;;588:104;:::o;356:1061:23:-;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;-1:-1:-1;;356:1061:23;;;;;;;;;;;;:::o;:::-;;;;;;;;;;;;9420:768:82;;;356:1061:23;;9727:8:82;;;:59;;;;;;356:1061:23;;:::i;:::-;;;;;9738:16:82;;;356:1061:23;9727:59:82;9813:13;;;356:1061:23;9852:20:82;;9801:25;;-1:-1:-1;;;;;356:1061:23;;;9801:25:82;9852:20;;9300:4;9852:20;:::i;:::-;9891:7;;:39;;;;9727:59;-1:-1:-1;9887:285:82;;;9950:29;:67;9988:29;;;;:::i;9887:285::-;1915:12;10056:101;1915:12;10090:26;;1897:31;1915:12;1897:31;:::i;9891:39::-;356:1061:23;;;;-1:-1:-1;356:1061:23;9902:28:82;1897:31;1915:12;1897:31;:::i;9902:28::-;356:1061:23;;9902:28:82;9891:39;;;9727:59;356:1061:23;9757:29:82;11264:17:79;;356:1061:23;;9757:29:82;10663:110;;;;;;10540:239;;356:1061:23;9727:59:82;;2836:192:96;-1:-1:-1;;;;;2920:26:96;;356:1061:23;;-1:-1:-1;;;;;356:1061:23;;2836:192:96:o;356:1061:23:-;;;-1:-1:-1;;;356:1061:23;;;;;;;;;;;;;;;;;-1:-1:-1;;;356:1061:23;;;;;;;7671:628:87;;;;7875:418;;;356:1061:23;;;7906:22:87;7902:286;;8201:17;;:::o;7902:286::-;1702:19;:23;356:1061:23;;8201:17:87;:::o;356:1061:23:-;;;-1:-1:-1;;;356:1061:23;;;;;;;;;;;;;;;;;;;;7875:418:87;356:1061:23;;;;-1:-1:-1;8980:21:87;:17;;9152:142;;;;;;;8976:379;356:1061:23;;-1:-1:-1;;;9324:20:87;;356:1061:23;;;9324:20:87;;;;;;:::i;356:1061:23:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;;:::o", "linkReferences": {}, "immutableReferences": { "19959": [ { "start": 9506, "length": 32 } ], "19961": [ { "start": 9695, "length": 32 } ], "19963": [ { "start": 9452, "length": 32 } ], "19965": [ { "start": 9585, "length": 32 } ], "19967": [ { "start": 9623, "length": 32 } ], "19970": [ { "start": 2566, "length": 32 } ], "19973": [ { "start": 2607, "length": 32 } ] } }, "methodIdentifiers": { "CLOCK_MODE()": "4bf5d7e9", "DOMAIN_SEPARATOR()": "3644e515", "act(bytes32,bytes)": "d19834fc", "act(bytes32,bytes,bytes)": "fea5ef99", "allowance(address,address)": "dd62ed3e", "approve(address,uint256)": "095ea7b3", "balanceOf(address)": "70a08231", "checkpoints(address,uint32)": "f1127ed8", "clock()": "91ddadf4", "decimals()": "313ce567", "decreaseAllowance(address,uint256)": "a457c2d7", "delegate(address)": "5c19a95c", "delegateBySig(address,uint256,uint256,uint8,bytes32,bytes32)": "c3cda520", "delegates(address)": "587cde1e", "eip712Domain()": "84b0196e", "getActId()": "1af09a2b", "getHashToSign(bytes32,bytes)": "e0839ca1", "getMinFeeToUse()": "9aa474ed", "getPastTotalSupply(uint256)": "8e539e8c", "getPastVotes(address,uint256)": "3a46b1a8", "getRequest(uint256)": "c58343ef", "getResultById(bytes32)": "365bec7f", "getVotes(address)": "9ab24eb0", "increaseAllowance(address,uint256)": "39509351", "name()": "06fdde03", "nonces(address)": "7ecebe00", "numCheckpoints(address)": "6fcfff45", "owner()": "8da5cb5b", "permit(address,address,uint256,uint256,uint8,bytes32,bytes32)": "d505accf", "renounceOwnership()": "715018a6", "setMinFeeToUse(uint256)": "af5e3be0", "setTimeout(uint32)": "dc80d104", "setTokenFee(address)": "241da1c0", "setWorker(address)": "c26f6d44", "submitSolution(uint256,bytes)": "e84dee6b", "symbol()": "95d89b41", "totalSupply()": "18160ddd", "transfer(address,uint256)": "a9059cbb", "transferFrom(address,address,uint256)": "23b872dd", "transferOwnership(address)": "f2fde38b", "withdrawFeeToken(address,uint256)": "b2ef14e3" }, "rawMetadata": "{\"compiler\":{\"version\":\"0.8.28+commit.7893614a\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"string\",\"name\":\"name_\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"symbol_\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"amount_\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"recipient_\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"minFeeToUse_\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timeout_\",\"type\":\"uint32\"},{\"internalType\":\"contract IERC20\",\"name\":\"tokenFee_\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"worker_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"DuplicateUuid\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InsufficientBalance\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidAmount\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidExternalDataLength\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidRequestStatus\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidShortString\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidSignature\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidUuid\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"str\",\"type\":\"string\"}],\"name\":\"StringTooLong\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Timeout\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Unauthorized\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddress\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"delegator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"fromDelegate\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"toDelegate\",\"type\":\"address\"}],\"name\":\"DelegateChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"delegate\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"previousBalance\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newBalance\",\"type\":\"uint256\"}],\"name\":\"DelegateVotesChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"EIP712DomainChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"actId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"uuid\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"creator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"ExecutionRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"actId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"processor\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"result\",\"type\":\"bytes\"}],\"name\":\"SolutionSubmitted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"oldWorker\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newWorker\",\"type\":\"address\"}],\"name\":\"WorkerUpdated\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"CLOCK_MODE\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"DOMAIN_SEPARATOR\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"uuid\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"executeData\",\"type\":\"bytes\"}],\"name\":\"act\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"uuid\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"name\":\"act\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"pos\",\"type\":\"uint32\"}],\"name\":\"checkpoints\",\"outputs\":[{\"components\":[{\"internalType\":\"uint32\",\"name\":\"fromBlock\",\"type\":\"uint32\"},{\"internalType\":\"uint224\",\"name\":\"votes\",\"type\":\"uint224\"}],\"internalType\":\"struct ERC20Votes.Checkpoint\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"clock\",\"outputs\":[{\"internalType\":\"uint48\",\"name\":\"\",\"type\":\"uint48\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"subtractedValue\",\"type\":\"uint256\"}],\"name\":\"decreaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"delegatee\",\"type\":\"address\"}],\"name\":\"delegate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"delegatee\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiry\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"delegateBySig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"delegates\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"eip712Domain\",\"outputs\":[{\"internalType\":\"bytes1\",\"name\":\"fields\",\"type\":\"bytes1\"},{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"version\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"verifyingContract\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"salt\",\"type\":\"bytes32\"},{\"internalType\":\"uint256[]\",\"name\":\"extensions\",\"type\":\"uint256[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getActId\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"uuid\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"getHashToSign\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getMinFeeToUse\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"timepoint\",\"type\":\"uint256\"}],\"name\":\"getPastTotalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"timepoint\",\"type\":\"uint256\"}],\"name\":\"getPastVotes\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"actId\",\"type\":\"uint256\"}],\"name\":\"getRequest\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"uuid\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"creator\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"timeout\",\"type\":\"uint32\"},{\"internalType\":\"enum IRealWorldAgent.RequestStatus\",\"name\":\"status\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"result\",\"type\":\"bytes\"}],\"internalType\":\"struct IRealWorldAgent.Request\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"uuid\",\"type\":\"bytes32\"}],\"name\":\"getResultById\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"getVotes\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"addedValue\",\"type\":\"uint256\"}],\"name\":\"increaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"nonces\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"numCheckpoints\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"permit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"minFeeToUse_\",\"type\":\"uint256\"}],\"name\":\"setMinFeeToUse\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"timeout_\",\"type\":\"uint32\"}],\"name\":\"setTimeout\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"tokenFee_\",\"type\":\"address\"}],\"name\":\"setTokenFee\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newWorker\",\"type\":\"address\"}],\"name\":\"setWorker\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"actId\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"result\",\"type\":\"bytes\"}],\"name\":\"submitSolution\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"withdrawFeeToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"events\":{\"Approval(address,address,uint256)\":{\"details\":\"Emitted when the allowance of a `spender` for an `owner` is set by a call to {approve}. `value` is the new allowance.\"},\"DelegateChanged(address,address,address)\":{\"details\":\"Emitted when an account changes their delegate.\"},\"DelegateVotesChanged(address,uint256,uint256)\":{\"details\":\"Emitted when a token transfer or delegate change results in changes to a delegate's number of votes.\"},\"EIP712DomainChanged()\":{\"details\":\"MAY be emitted to signal that the domain could have changed.\"},\"Transfer(address,address,uint256)\":{\"details\":\"Emitted when `value` tokens are moved from one account (`from`) to another (`to`). Note that `value` may be zero.\"}},\"kind\":\"dev\",\"methods\":{\"CLOCK_MODE()\":{\"details\":\"Description of the clock\"},\"DOMAIN_SEPARATOR()\":{\"details\":\"Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\"},\"allowance(address,address)\":{\"details\":\"See {IERC20-allowance}.\"},\"approve(address,uint256)\":{\"details\":\"See {IERC20-approve}. NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on `transferFrom`. This is semantically equivalent to an infinite approval. Requirements: - `spender` cannot be the zero address.\"},\"balanceOf(address)\":{\"details\":\"See {IERC20-balanceOf}.\"},\"checkpoints(address,uint32)\":{\"details\":\"Get the `pos`-th checkpoint for `account`.\"},\"clock()\":{\"details\":\"Clock used for flagging checkpoints. Can be overridden to implement timestamp based checkpoints (and voting).\"},\"decimals()\":{\"details\":\"Returns the number of decimals used to get its user representation. For example, if `decimals` equals `2`, a balance of `505` tokens should be displayed to a user as `5.05` (`505 / 10 ** 2`). Tokens usually opt for a value of 18, imitating the relationship between Ether and Wei. This is the default value returned by this function, unless it's overridden. NOTE: This information is only used for _display_ purposes: it in no way affects any of the arithmetic of the contract, including {IERC20-balanceOf} and {IERC20-transfer}.\"},\"decreaseAllowance(address,uint256)\":{\"details\":\"Atomically decreases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address. - `spender` must have allowance for the caller of at least `subtractedValue`.\"},\"delegate(address)\":{\"details\":\"Delegate votes from the sender to `delegatee`.\"},\"delegateBySig(address,uint256,uint256,uint8,bytes32,bytes32)\":{\"details\":\"Delegates votes from signer to `delegatee`\"},\"delegates(address)\":{\"details\":\"Get the address `account` is currently delegating to.\"},\"eip712Domain()\":{\"details\":\"See {EIP-5267}. _Available since v4.9._\"},\"getMinFeeToUse()\":{\"returns\":{\"_0\":\"The minimum fee required to use the agent.\"}},\"getPastTotalSupply(uint256)\":{\"details\":\"Retrieve the `totalSupply` at the end of `timepoint`. Note, this value is the sum of all balances. It is NOT the sum of all the delegated votes! Requirements: - `timepoint` must be in the past\"},\"getPastVotes(address,uint256)\":{\"details\":\"Retrieve the number of votes for `account` at the end of `timepoint`. Requirements: - `timepoint` must be in the past\"},\"getResultById(bytes32)\":{\"params\":{\"uuid\":\"The uuid of the execution to retrieve the result for.\"},\"returns\":{\"_0\":\"The result of the execution.\"}},\"getVotes(address)\":{\"details\":\"Gets the current votes balance for `account`\"},\"increaseAllowance(address,uint256)\":{\"details\":\"Atomically increases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address.\"},\"name()\":{\"details\":\"Returns the name of the token.\"},\"nonces(address)\":{\"details\":\"Returns the current nonce for `owner`. This value must be included whenever a signature is generated for {permit}. Every successful call to {permit} increases ``owner``'s nonce by one. This prevents a signature from being used multiple times.\"},\"numCheckpoints(address)\":{\"details\":\"Get number of checkpoints for `account`.\"},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"permit(address,address,uint256,uint256,uint8,bytes32,bytes32)\":{\"details\":\"Sets `value` as the allowance of `spender` over ``owner``'s tokens, given ``owner``'s signed approval. IMPORTANT: The same issues {IERC20-approve} has related to transaction ordering also apply here. Emits an {Approval} event. Requirements: - `spender` cannot be the zero address. - `deadline` must be a timestamp in the future. - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner` over the EIP712-formatted function arguments. - the signature must use ``owner``'s current nonce (see {nonces}). For more information on the signature format, see the https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP section]. CAUTION: See Security Considerations above.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner.\"},\"symbol()\":{\"details\":\"Returns the symbol of the token, usually a shorter version of the name.\"},\"totalSupply()\":{\"details\":\"See {IERC20-totalSupply}.\"},\"transfer(address,uint256)\":{\"details\":\"See {IERC20-transfer}. Requirements: - `to` cannot be the zero address. - the caller must have a balance of at least `amount`.\"},\"transferFrom(address,address,uint256)\":{\"details\":\"See {IERC20-transferFrom}. Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {ERC20}. NOTE: Does not update the allowance if the current allowance is the maximum `uint256`. Requirements: - `from` and `to` cannot be the zero address. - `from` must have a balance of at least `amount`. - the caller must have allowance for ``from``'s tokens of at least `amount`.\"},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"getMinFeeToUse()\":{\"notice\":\"Retrieves the minimum fee required to use agent.\"},\"getResultById(bytes32)\":{\"notice\":\"Retrieves the result of an execution by its uuid.\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/real-world-agent/ERC20RealWorldAgent.sol\":\"ERC20RealWorldAgent\"},\"evmVersion\":\"cancun\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[\":@matterlabs/=node_modules/@matterlabs/\",\":@openzeppelin/=node_modules/@openzeppelin/\",\":@prb/=node_modules/@prb/\",\":eth-gas-reporter/=node_modules/eth-gas-reporter/\",\":forge-std/=lib/forge-std/src/\",\":hardhat-deploy/=node_modules/hardhat-deploy/\",\":hardhat/=node_modules/hardhat/\",\":solady/=node_modules/solady/\",\":solmate/=node_modules/solmate/\"],\"viaIR\":true},\"sources\":{\"contracts/real-world-agent/ERC20RealWorldAgent.sol\":{\"keccak256\":\"0xb047f971c19d2f5b449575893c4851cd5bd35a1cf5f01c5858dd704ef6b68dcf\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://93d8003de95cb77ee7cfc5e89f17e8be7850d1ee2b97d81d7d3de6b379209bda\",\"dweb:/ipfs/QmfP17xgQgvGVa1cmS9KS9ZHoAfPUBVRpYw16Ey76VH8uX\"]},\"contracts/real-world-agent/IRealWorldAgent.sol\":{\"keccak256\":\"0x691c24964487cb9c8658b97feaa84562e9816184d41d24e4b2020708fd933d84\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://e5f3ee5ffece65f8bbef36a54267320f41ef21ceaec82daf1718f54e9d9c9c87\",\"dweb:/ipfs/QmU3v97MTNm4fD9BdWgjqmPi4PWzojzFJCkPRCEdCGhAez\"]},\"contracts/real-world-agent/RealWorldAgent.sol\":{\"keccak256\":\"0xbd9df6076cbc633dfc24ee0aa4fe67c79594d0bc83f5b3b8606f506a1e3ebbf1\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://8ee52633e6e215c15cf3b3cca744319896b0d6fb7bb8592e2e64c3caf05fa38d\",\"dweb:/ipfs/QmdBY9RrvamzyZLaoX6bqpkNhfLAtrjmc4wBHABTfhFuFN\"]},\"node_modules/@openzeppelin/contracts/access/Ownable.sol\":{\"keccak256\":\"0xba43b97fba0d32eb4254f6a5a297b39a19a247082a02d6e69349e071e2946218\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://fc980984badf3984b6303b377711220e067722bbd6a135b24669ff5069ef9f32\",\"dweb:/ipfs/QmPHXMSXj99XjSVM21YsY6aNtLLjLVXDbyN76J5HQYvvrz\"]},\"node_modules/@openzeppelin/contracts/governance/utils/IVotes.sol\":{\"keccak256\":\"0x1618ddebe73377660f6da71afcba35d5ac4c4600918b3a381d9c6f37eba613eb\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://666c8d7c62478b55e082f1835275b7acfc1595491998df6d67183ff2c70eab96\",\"dweb:/ipfs/QmVXmnXfxNaLhoX283dqyKJ8DJbF5thUd9sMuRoFpNMwr7\"]},\"node_modules/@openzeppelin/contracts/interfaces/IERC5267.sol\":{\"keccak256\":\"0xac6c2efc64baccbde4904ae18ed45139c9aa8cff96d6888344d1e4d2eb8b659f\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://6e416a280c610b6b7a5f158e4a41aacfaec01ef14d5d1de13b46be9e090265fc\",\"dweb:/ipfs/QmYZP2KrdyccBbhLZT42auhvBTMkwiwUS3V6HWb42rbwbG\"]},\"node_modules/@openzeppelin/contracts/interfaces/IERC5805.sol\":{\"keccak256\":\"0xfc12b717f6a2cd0d67adc8700097d4464d37f18ce933d4fc9c948ab6aec35e80\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://82386e69ebe902a2edfd4f8a5ecbeaeb2e00f6cc6481a973729e974373fb492e\",\"dweb:/ipfs/QmSXg4wBMBd83mQvkekT1GsiRX2Qyv5gvrqzv5qJx2M7Kc\"]},\"node_modules/@openzeppelin/contracts/interfaces/IERC6372.sol\":{\"keccak256\":\"0xcaea9aeda3816ba872358c828f4f01455c22ae48ced49c4c7d72bd74176c09b9\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://16ff22d8df5aee94510ee43d361b6147caef164941a684cedcb75be44f351fe6\",\"dweb:/ipfs/QmaCCwMdHVdPApuEJHLZapSJyA7mp5dAugpma3VUzWGd8E\"]},\"node_modules/@openzeppelin/contracts/token/ERC20/ERC20.sol\":{\"keccak256\":\"0xa56ca923f70c1748830700250b19c61b70db9a683516dc5e216694a50445d99c\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://cac938788bc4be12101e59d45588b4e059579f4e61062e1cda8d6b06c0191b15\",\"dweb:/ipfs/QmV2JKCyjTVH3rkWNrfdJRhAT7tZ3usAN2XcnD4h53Mvih\"]},\"node_modules/@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"keccak256\":\"0x287b55befed2961a7eabd7d7b1b2839cbca8a5b80ef8dcbb25ed3d4c2002c305\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://bd39944e8fc06be6dbe2dd1d8449b5336e23c6a7ba3e8e9ae5ae0f37f35283f5\",\"dweb:/ipfs/QmPV3FGYjVwvKSgAXKUN3r9T9GwniZz83CxBpM7vyj2G53\"]},\"node_modules/@openzeppelin/contracts/token/ERC20/extensions/ERC20Permit.sol\":{\"keccak256\":\"0xbb16110ffe0b625944fe7dd97adcf1158e514185c956a5628bc09be90d606174\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://b5b412e554a4dd37a50f89ffcd7b9a6ef2ae5064f37619f89343b23d58ce89ca\",\"dweb:/ipfs/QmPWMdBvdFk8WBVv625wd1Ar7aehnBWtj1XfFRrRL5KpxJ\"]},\"node_modules/@openzeppelin/contracts/token/ERC20/extensions/ERC20Votes.sol\":{\"keccak256\":\"0x4e560f86662b6f72ab76122fff53317677154f14bac4a80dbd46a54172b3abfa\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://ca5c2518d247417cb01164f04eff57b7e87b5346bc03478ada916f26117aa7fd\",\"dweb:/ipfs/QmVgK66XGZCiH9x4mhqejKUTujtu68DyE6KrYi6MPuaHRJ\"]},\"node_modules/@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\":{\"keccak256\":\"0x8de418a5503946cabe331f35fe242d3201a73f67f77aaeb7110acb1f30423aca\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://5a376d3dda2cb70536c0a45c208b29b34ac560c4cb4f513a42079f96ba47d2dd\",\"dweb:/ipfs/QmZQg6gn1sUpM8wHzwNvSnihumUCAhxD119MpXeKp8B9s8\"]},\"node_modules/@openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol\":{\"keccak256\":\"0xb264c03a3442eb37a68ad620cefd1182766b58bee6cec40343480392d6b14d69\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://28879d01fd22c07b44f006612775f8577defbe459cb01685c5e25cd518c91a71\",\"dweb:/ipfs/QmVgfkwv2Fxw6hhTcDUZhE7NkoSKjab3ipM7UaRbt6uXb5\"]},\"node_modules/@openzeppelin/contracts/token/ERC20/extensions/draft-ERC20Permit.sol\":{\"keccak256\":\"0xbe43b6f1e04b5215939f1a76fa612c275b75948f6e7bf25808fb91e99444a33f\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://86d672d9a23f3502472f6827af8e8116a6412b28c234dcfcb201413055cb0159\",\"dweb:/ipfs/Qmcts6GvEMHuyikwDHtcTdTW4SVP1k66KpUMRcCovWbLN8\"]},\"node_modules/@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\":{\"keccak256\":\"0xabefac93435967b4d36a4fabcbdbb918d1f0b7ae3c3d85bc30923b326c927ed1\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://9d213d3befca47da33f6db0310826bcdb148299805c10d77175ecfe1d06a9a68\",\"dweb:/ipfs/QmRgCn6SP1hbBkExUADFuDo8xkT4UU47yjNF5FhCeRbQmS\"]},\"node_modules/@openzeppelin/contracts/utils/Address.sol\":{\"keccak256\":\"0x006dd67219697fe68d7fbfdea512e7c4cb64a43565ed86171d67e844982da6fa\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://2455248c8ddd9cc6a7af76a13973cddf222072427e7b0e2a7d1aff345145e931\",\"dweb:/ipfs/QmfYjnjRbWqYpuxurqveE6HtzsY1Xx323J428AKQgtBJZm\"]},\"node_modules/@openzeppelin/contracts/utils/Context.sol\":{\"keccak256\":\"0xa92e4fa126feb6907daa0513ddd816b2eb91f30a808de54f63c17d0e162c3439\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://a367861093b74443b137564d3f3c472f70bcf114739e62059c939f25e315706c\",\"dweb:/ipfs/Qmd7JMpcxD9RuQjK3uM3EzJUgSqdN8vzp8eytEiuwxQJ6h\"]},\"node_modules/@openzeppelin/contracts/utils/Counters.sol\":{\"keccak256\":\"0xf0018c2440fbe238dd3a8732fa8e17a0f9dce84d31451dc8a32f6d62b349c9f1\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://59e1c62884d55b70f3ae5432b44bb3166ad71ae3acd19c57ab6ddc3c87c325ee\",\"dweb:/ipfs/QmezuXg5GK5oeA4F91EZhozBFekhq5TD966bHPH18cCqhu\"]},\"node_modules/@openzeppelin/contracts/utils/ShortStrings.sol\":{\"keccak256\":\"0xc0e310c163edf15db45d4ff938113ab357f94fa86e61ea8e790853c4d2e13256\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://04db5bc05dcb05ba1f6ca2dfbead17adc8a2e2f911aa80b05e7a36d9eaf96516\",\"dweb:/ipfs/QmVkfHZbXVBUPsTopueCn3qGJX8aEjahFF3Fn4NcygLNm5\"]},\"node_modules/@openzeppelin/contracts/utils/StorageSlot.sol\":{\"keccak256\":\"0xf09e68aa0dc6722a25bc46490e8d48ed864466d17313b8a0b254c36b54e49899\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://e26daf81e2252dc1fe1ce0e4b55c2eb7c6d1ee84ae6558d1a9554432ea1d32da\",\"dweb:/ipfs/Qmb1UANWiWq5pCKbmHSu772hd4nt374dVaghGmwSVNuk8Q\"]},\"node_modules/@openzeppelin/contracts/utils/Strings.sol\":{\"keccak256\":\"0x3088eb2868e8d13d89d16670b5f8612c4ab9ff8956272837d8e90106c59c14a0\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://b81d9ff6559ea5c47fc573e17ece6d9ba5d6839e213e6ebc3b4c5c8fe4199d7f\",\"dweb:/ipfs/QmPCW1bFisUzJkyjroY3yipwfism9RRCigCcK1hbXtVM8n\"]},\"node_modules/@openzeppelin/contracts/utils/cryptography/ECDSA.sol\":{\"keccak256\":\"0x809bc3edb4bcbef8263fa616c1b60ee0004b50a8a1bfa164d8f57fd31f520c58\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://8b93a1e39a4a19eba1600b92c96f435442db88cac91e315c8291547a2a7bcfe2\",\"dweb:/ipfs/QmTm34KVe6uZBZwq8dZDNWwPcm24qBJdxqL3rPxBJ4LrMv\"]},\"node_modules/@openzeppelin/contracts/utils/cryptography/EIP712.sol\":{\"keccak256\":\"0x8432884527a7ad91e6eed1cfc5a0811ae2073e5bca107bd0ca442e9236b03dbd\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://e3aa0eadab7aafcf91a95684765f778f64386f0368de88522ce873c21385278a\",\"dweb:/ipfs/QmPfaVAqWgH1QsT3dHVuL6jwMZbVKdoP8w1PvpiPT2FPWd\"]},\"node_modules/@openzeppelin/contracts/utils/math/Math.sol\":{\"keccak256\":\"0xe4455ac1eb7fc497bb7402579e7b4d64d928b846fce7d2b6fde06d366f21c2b3\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://cc8841b3cd48ad125e2f46323c8bad3aa0e88e399ec62acb9e57efa7e7c8058c\",\"dweb:/ipfs/QmSqE4mXHA2BXW58deDbXE8MTcsL5JSKNDbm23sVQxRLPS\"]},\"node_modules/@openzeppelin/contracts/utils/math/SafeCast.sol\":{\"keccak256\":\"0x52a8cfb0f5239d11b457dcdd1b326992ef672714ca8da71a157255bddd13f3ad\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://495145362c7ff1c9ca88c58bbbbcb412e3c2004406647412394486552ff6c278\",\"dweb:/ipfs/QmNNCeng6d5eRPDn6tkWSQhjE39XWfQEfjA63rRwHmr1iH\"]},\"node_modules/@openzeppelin/contracts/utils/math/SignedMath.sol\":{\"keccak256\":\"0xf92515413956f529d95977adc9b0567d583c6203fc31ab1c23824c35187e3ddc\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://c50fcc459e49a9858b6d8ad5f911295cb7c9ab57567845a250bf0153f84a95c7\",\"dweb:/ipfs/QmcEW85JRzvDkQggxiBBLVAasXWdkhEysqypj9EaB6H2g6\"]}},\"version\":1}", "metadata": { "compiler": { "version": "0.8.28+commit.7893614a" }, "language": "Solidity", "output": { "abi": [ { "inputs": [ { "internalType": "string", "name": "name_", "type": "string" }, { "internalType": "string", "name": "symbol_", "type": "string" }, { "internalType": "uint256", "name": "amount_", "type": "uint256" }, { "internalType": "address", "name": "recipient_", "type": "address" }, { "internalType": "uint256", "name": "minFeeToUse_", "type": "uint256" }, { "internalType": "uint32", "name": "timeout_", "type": "uint32" }, { "internalType": "contract IERC20", "name": "tokenFee_", "type": "address" }, { "internalType": "address", "name": "worker_", "type": "address" } ], "stateMutability": "nonpayable", "type": "constructor" }, { "inputs": [], "type": "error", "name": "DuplicateUuid" }, { "inputs": [], "type": "error", "name": "InsufficientBalance" }, { "inputs": [], "type": "error", "name": "InvalidAmount" }, { "inputs": [], "type": "error", "name": "InvalidExternalDataLength" }, { "inputs": [], "type": "error", "name": "InvalidRequestStatus" }, { "inputs": [], "type": "error", "name": "InvalidShortString" }, { "inputs": [], "type": "error", "name": "InvalidSignature" }, { "inputs": [], "type": "error", "name": "InvalidUuid" }, { "inputs": [ { "internalType": "string", "name": "str", "type": "string" } ], "type": "error", "name": "StringTooLong" }, { "inputs": [], "type": "error", "name": "Timeout" }, { "inputs": [], "type": "error", "name": "Unauthorized" }, { "inputs": [], "type": "error", "name": "ZeroAddress" }, { "inputs": [ { "internalType": "address", "name": "owner", "type": "address", "indexed": true }, { "internalType": "address", "name": "spender", "type": "address", "indexed": true }, { "internalType": "uint256", "name": "value", "type": "uint256", "indexed": false } ], "type": "event", "name": "Approval", "anonymous": false }, { "inputs": [ { "internalType": "address", "name": "delegator", "type": "address", "indexed": true }, { "internalType": "address", "name": "fromDelegate", "type": "address", "indexed": true }, { "internalType": "address", "name": "toDelegate", "type": "address", "indexed": true } ], "type": "event", "name": "DelegateChanged", "anonymous": false }, { "inputs": [ { "internalType": "address", "name": "delegate", "type": "address", "indexed": true }, { "internalType": "uint256", "name": "previousBalance", "type": "uint256", "indexed": false }, { "internalType": "uint256", "name": "newBalance", "type": "uint256", "indexed": false } ], "type": "event", "name": "DelegateVotesChanged", "anonymous": false }, { "inputs": [], "type": "event", "name": "EIP712DomainChanged", "anonymous": false }, { "inputs": [ { "internalType": "uint256", "name": "actId", "type": "uint256", "indexed": true }, { "internalType": "bytes32", "name": "uuid", "type": "bytes32", "indexed": true }, { "internalType": "address", "name": "creator", "type": "address", "indexed": true }, { "internalType": "bytes", "name": "data", "type": "bytes", "indexed": false } ], "type": "event", "name": "ExecutionRequested", "anonymous": false }, { "inputs": [ { "internalType": "address", "name": "previousOwner", "type": "address", "indexed": true }, { "internalType": "address", "name": "newOwner", "type": "address", "indexed": true } ], "type": "event", "name": "OwnershipTransferred", "anonymous": false }, { "inputs": [ { "internalType": "uint256", "name": "actId", "type": "uint256", "indexed": true }, { "internalType": "address", "name": "processor", "type": "address", "indexed": true }, { "internalType": "bytes", "name": "result", "type": "bytes", "indexed": false } ], "type": "event", "name": "SolutionSubmitted", "anonymous": false }, { "inputs": [ { "internalType": "address", "name": "from", "type": "address", "indexed": true }, { "internalType": "address", "name": "to", "type": "address", "indexed": true }, { "internalType": "uint256", "name": "value", "type": "uint256", "indexed": false } ], "type": "event", "name": "Transfer", "anonymous": false }, { "inputs": [ { "internalType": "address", "name": "oldWorker", "type": "address", "indexed": true }, { "internalType": "address", "name": "newWorker", "type": "address", "indexed": true } ], "type": "event", "name": "WorkerUpdated", "anonymous": false }, { "inputs": [], "stateMutability": "view", "type": "function", "name": "CLOCK_MODE", "outputs": [ { "internalType": "string", "name": "", "type": "string" } ] }, { "inputs": [], "stateMutability": "view", "type": "function", "name": "DOMAIN_SEPARATOR", "outputs": [ { "internalType": "bytes32", "name": "", "type": "bytes32" } ] }, { "inputs": [ { "internalType": "bytes32", "name": "uuid", "type": "bytes32" }, { "internalType": "bytes", "name": "executeData", "type": "bytes" } ], "stateMutability": "nonpayable", "type": "function", "name": "act", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ] }, { "inputs": [ { "internalType": "bytes32", "name": "uuid", "type": "bytes32" }, { "internalType": "bytes", "name": "data", "type": "bytes" }, { "internalType": "bytes", "name": "signature", "type": "bytes" } ], "stateMutability": "nonpayable", "type": "function", "name": "act", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ] }, { "inputs": [ { "internalType": "address", "name": "owner", "type": "address" }, { "internalType": "address", "name": "spender", "type": "address" } ], "stateMutability": "view", "type": "function", "name": "allowance", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ] }, { "inputs": [ { "internalType": "address", "name": "spender", "type": "address" }, { "internalType": "uint256", "name": "amount", "type": "uint256" } ], "stateMutability": "nonpayable", "type": "function", "name": "approve", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ] }, { "inputs": [ { "internalType": "address", "name": "account", "type": "address" } ], "stateMutability": "view", "type": "function", "name": "balanceOf", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ] }, { "inputs": [ { "internalType": "address", "name": "account", "type": "address" }, { "internalType": "uint32", "name": "pos", "type": "uint32" } ], "stateMutability": "view", "type": "function", "name": "checkpoints", "outputs": [ { "internalType": "struct ERC20Votes.Checkpoint", "name": "", "type": "tuple", "components": [ { "internalType": "uint32", "name": "fromBlock", "type": "uint32" }, { "internalType": "uint224", "name": "votes", "type": "uint224" } ] } ] }, { "inputs": [], "stateMutability": "view", "type": "function", "name": "clock", "outputs": [ { "internalType": "uint48", "name": "", "type": "uint48" } ] }, { "inputs": [], "stateMutability": "view", "type": "function", "name": "decimals", "outputs": [ { "internalType": "uint8", "name": "", "type": "uint8" } ] }, { "inputs": [ { "internalType": "address", "name": "spender", "type": "address" }, { "internalType": "uint256", "name": "subtractedValue", "type": "uint256" } ], "stateMutability": "nonpayable", "type": "function", "name": "decreaseAllowance", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ] }, { "inputs": [ { "internalType": "address", "name": "delegatee", "type": "address" } ], "stateMutability": "nonpayable", "type": "function", "name": "delegate" }, { "inputs": [ { "internalType": "address", "name": "delegatee", "type": "address" }, { "internalType": "uint256", "name": "nonce", "type": "uint256" }, { "internalType": "uint256", "name": "expiry", "type": "uint256" }, { "internalType": "uint8", "name": "v", "type": "uint8" }, { "internalType": "bytes32", "name": "r", "type": "bytes32" }, { "internalType": "bytes32", "name": "s", "type": "bytes32" } ], "stateMutability": "nonpayable", "type": "function", "name": "delegateBySig" }, { "inputs": [ { "internalType": "address", "name": "account", "type": "address" } ], "stateMutability": "view", "type": "function", "name": "delegates", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ] }, { "inputs": [], "stateMutability": "view", "type": "function", "name": "eip712Domain", "outputs": [ { "internalType": "bytes1", "name": "fields", "type": "bytes1" }, { "internalType": "string", "name": "name", "type": "string" }, { "internalType": "string", "name": "version", "type": "string" }, { "internalType": "uint256", "name": "chainId", "type": "uint256" }, { "internalType": "address", "name": "verifyingContract", "type": "address" }, { "internalType": "bytes32", "name": "salt", "type": "bytes32" }, { "internalType": "uint256[]", "name": "extensions", "type": "uint256[]" } ] }, { "inputs": [], "stateMutability": "view", "type": "function", "name": "getActId", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ] }, { "inputs": [ { "internalType": "bytes32", "name": "uuid", "type": "bytes32" }, { "internalType": "bytes", "name": "data", "type": "bytes" } ], "stateMutability": "view", "type": "function", "name": "getHashToSign", "outputs": [ { "internalType": "bytes32", "name": "", "type": "bytes32" } ] }, { "inputs": [], "stateMutability": "view", "type": "function", "name": "getMinFeeToUse", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ] }, { "inputs": [ { "internalType": "uint256", "name": "timepoint", "type": "uint256" } ], "stateMutability": "view", "type": "function", "name": "getPastTotalSupply", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ] }, { "inputs": [ { "internalType": "address", "name": "account", "type": "address" }, { "internalType": "uint256", "name": "timepoint", "type": "uint256" } ], "stateMutability": "view", "type": "function", "name": "getPastVotes", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ] }, { "inputs": [ { "internalType": "uint256", "name": "actId", "type": "uint256" } ], "stateMutability": "view", "type": "function", "name": "getRequest", "outputs": [ { "internalType": "struct IRealWorldAgent.Request", "name": "", "type": "tuple", "components": [ { "internalType": "bytes32", "name": "uuid", "type": "bytes32" }, { "internalType": "address", "name": "creator", "type": "address" }, { "internalType": "uint32", "name": "timeout", "type": "uint32" }, { "internalType": "enum IRealWorldAgent.RequestStatus", "name": "status", "type": "uint8" }, { "internalType": "bytes", "name": "data", "type": "bytes" }, { "internalType": "bytes", "name": "result", "type": "bytes" } ] } ] }, { "inputs": [ { "internalType": "bytes32", "name": "uuid", "type": "bytes32" } ], "stateMutability": "view", "type": "function", "name": "getResultById", "outputs": [ { "internalType": "bytes", "name": "", "type": "bytes" } ] }, { "inputs": [ { "internalType": "address", "name": "account", "type": "address" } ], "stateMutability": "view", "type": "function", "name": "getVotes", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ] }, { "inputs": [ { "internalType": "address", "name": "spender", "type": "address" }, { "internalType": "uint256", "name": "addedValue", "type": "uint256" } ], "stateMutability": "nonpayable", "type": "function", "name": "increaseAllowance", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ] }, { "inputs": [], "stateMutability": "view", "type": "function", "name": "name", "outputs": [ { "internalType": "string", "name": "", "type": "string" } ] }, { "inputs": [ { "internalType": "address", "name": "owner", "type": "address" } ], "stateMutability": "view", "type": "function", "name": "nonces", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ] }, { "inputs": [ { "internalType": "address", "name": "account", "type": "address" } ], "stateMutability": "view", "type": "function", "name": "numCheckpoints", "outputs": [ { "internalType": "uint32", "name": "", "type": "uint32" } ] }, { "inputs": [], "stateMutability": "view", "type": "function", "name": "owner", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ] }, { "inputs": [ { "internalType": "address", "name": "owner", "type": "address" }, { "internalType": "address", "name": "spender", "type": "address" }, { "internalType": "uint256", "name": "value", "type": "uint256" }, { "internalType": "uint256", "name": "deadline", "type": "uint256" }, { "internalType": "uint8", "name": "v", "type": "uint8" }, { "internalType": "bytes32", "name": "r", "type": "bytes32" }, { "internalType": "bytes32", "name": "s", "type": "bytes32" } ], "stateMutability": "nonpayable", "type": "function", "name": "permit" }, { "inputs": [], "stateMutability": "nonpayable", "type": "function", "name": "renounceOwnership" }, { "inputs": [ { "internalType": "uint256", "name": "minFeeToUse_", "type": "uint256" } ], "stateMutability": "nonpayable", "type": "function", "name": "setMinFeeToUse" }, { "inputs": [ { "internalType": "uint32", "name": "timeout_", "type": "uint32" } ], "stateMutability": "nonpayable", "type": "function", "name": "setTimeout" }, { "inputs": [ { "internalType": "contract IERC20", "name": "tokenFee_", "type": "address" } ], "stateMutability": "nonpayable", "type": "function", "name": "setTokenFee" }, { "inputs": [ { "internalType": "address", "name": "newWorker", "type": "address" } ], "stateMutability": "nonpayable", "type": "function", "name": "setWorker" }, { "inputs": [ { "internalType": "uint256", "name": "actId", "type": "uint256" }, { "internalType": "bytes", "name": "result", "type": "bytes" } ], "stateMutability": "nonpayable", "type": "function", "name": "submitSolution" }, { "inputs": [], "stateMutability": "view", "type": "function", "name": "symbol", "outputs": [ { "internalType": "string", "name": "", "type": "string" } ] }, { "inputs": [], "stateMutability": "view", "type": "function", "name": "totalSupply", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ] }, { "inputs": [ { "internalType": "address", "name": "to", "type": "address" }, { "internalType": "uint256", "name": "amount", "type": "uint256" } ], "stateMutability": "nonpayable", "type": "function", "name": "transfer", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ] }, { "inputs": [ { "internalType": "address", "name": "from", "type": "address" }, { "internalType": "address", "name": "to", "type": "address" }, { "internalType": "uint256", "name": "amount", "type": "uint256" } ], "stateMutability": "nonpayable", "type": "function", "name": "transferFrom", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ] }, { "inputs": [ { "internalType": "address", "name": "newOwner", "type": "address" } ], "stateMutability": "nonpayable", "type": "function", "name": "transferOwnership" }, { "inputs": [ { "internalType": "address", "name": "to", "type": "address" }, { "internalType": "uint256", "name": "amount", "type": "uint256" } ], "stateMutability": "nonpayable", "type": "function", "name": "withdrawFeeToken" } ], "devdoc": { "kind": "dev", "methods": { "CLOCK_MODE()": { "details": "Description of the clock" }, "DOMAIN_SEPARATOR()": { "details": "Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}." }, "allowance(address,address)": { "details": "See {IERC20-allowance}." }, "approve(address,uint256)": { "details": "See {IERC20-approve}. NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on `transferFrom`. This is semantically equivalent to an infinite approval. Requirements: - `spender` cannot be the zero address." }, "balanceOf(address)": { "details": "See {IERC20-balanceOf}." }, "checkpoints(address,uint32)": { "details": "Get the `pos`-th checkpoint for `account`." }, "clock()": { "details": "Clock used for flagging checkpoints. Can be overridden to implement timestamp based checkpoints (and voting)." }, "decimals()": { "details": "Returns the number of decimals used to get its user representation. For example, if `decimals` equals `2`, a balance of `505` tokens should be displayed to a user as `5.05` (`505 / 10 ** 2`). Tokens usually opt for a value of 18, imitating the relationship between Ether and Wei. This is the default value returned by this function, unless it's overridden. NOTE: This information is only used for _display_ purposes: it in no way affects any of the arithmetic of the contract, including {IERC20-balanceOf} and {IERC20-transfer}." }, "decreaseAllowance(address,uint256)": { "details": "Atomically decreases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address. - `spender` must have allowance for the caller of at least `subtractedValue`." }, "delegate(address)": { "details": "Delegate votes from the sender to `delegatee`." }, "delegateBySig(address,uint256,uint256,uint8,bytes32,bytes32)": { "details": "Delegates votes from signer to `delegatee`" }, "delegates(address)": { "details": "Get the address `account` is currently delegating to." }, "eip712Domain()": { "details": "See {EIP-5267}. _Available since v4.9._" }, "getMinFeeToUse()": { "returns": { "_0": "The minimum fee required to use the agent." } }, "getPastTotalSupply(uint256)": { "details": "Retrieve the `totalSupply` at the end of `timepoint`. Note, this value is the sum of all balances. It is NOT the sum of all the delegated votes! Requirements: - `timepoint` must be in the past" }, "getPastVotes(address,uint256)": { "details": "Retrieve the number of votes for `account` at the end of `timepoint`. Requirements: - `timepoint` must be in the past" }, "getResultById(bytes32)": { "params": { "uuid": "The uuid of the execution to retrieve the result for." }, "returns": { "_0": "The result of the execution." } }, "getVotes(address)": { "details": "Gets the current votes balance for `account`" }, "increaseAllowance(address,uint256)": { "details": "Atomically increases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address." }, "name()": { "details": "Returns the name of the token." }, "nonces(address)": { "details": "Returns the current nonce for `owner`. This value must be included whenever a signature is generated for {permit}. Every successful call to {permit} increases ``owner``'s nonce by one. This prevents a signature from being used multiple times." }, "numCheckpoints(address)": { "details": "Get number of checkpoints for `account`." }, "owner()": { "details": "Returns the address of the current owner." }, "permit(address,address,uint256,uint256,uint8,bytes32,bytes32)": { "details": "Sets `value` as the allowance of `spender` over ``owner``'s tokens, given ``owner``'s signed approval. IMPORTANT: The same issues {IERC20-approve} has related to transaction ordering also apply here. Emits an {Approval} event. Requirements: - `spender` cannot be the zero address. - `deadline` must be a timestamp in the future. - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner` over the EIP712-formatted function arguments. - the signature must use ``owner``'s current nonce (see {nonces}). For more information on the signature format, see the https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP section]. CAUTION: See Security Considerations above." }, "renounceOwnership()": { "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner." }, "symbol()": { "details": "Returns the symbol of the token, usually a shorter version of the name." }, "totalSupply()": { "details": "See {IERC20-totalSupply}." }, "transfer(address,uint256)": { "details": "See {IERC20-transfer}. Requirements: - `to` cannot be the zero address. - the caller must have a balance of at least `amount`." }, "transferFrom(address,address,uint256)": { "details": "See {IERC20-transferFrom}. Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {ERC20}. NOTE: Does not update the allowance if the current allowance is the maximum `uint256`. Requirements: - `from` and `to` cannot be the zero address. - `from` must have a balance of at least `amount`. - the caller must have allowance for ``from``'s tokens of at least `amount`." }, "transferOwnership(address)": { "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." } }, "version": 1 }, "userdoc": { "kind": "user", "methods": { "getMinFeeToUse()": { "notice": "Retrieves the minimum fee required to use agent." }, "getResultById(bytes32)": { "notice": "Retrieves the result of an execution by its uuid." } }, "version": 1 } }, "settings": { "remappings": [ "@matterlabs/=node_modules/@matterlabs/", "@openzeppelin/=node_modules/@openzeppelin/", "@prb/=node_modules/@prb/", "eth-gas-reporter/=node_modules/eth-gas-reporter/", "forge-std/=lib/forge-std/src/", "hardhat-deploy/=node_modules/hardhat-deploy/", "hardhat/=node_modules/hardhat/", "solady/=node_modules/solady/", "solmate/=node_modules/solmate/" ], "optimizer": { "enabled": true, "runs": 200 }, "metadata": { "bytecodeHash": "ipfs" }, "compilationTarget": { "contracts/real-world-agent/ERC20RealWorldAgent.sol": "ERC20RealWorldAgent" }, "evmVersion": "cancun", "libraries": {}, "viaIR": true }, "sources": { "contracts/real-world-agent/ERC20RealWorldAgent.sol": { "keccak256": "0xb047f971c19d2f5b449575893c4851cd5bd35a1cf5f01c5858dd704ef6b68dcf", "urls": [ "bzz-raw://93d8003de95cb77ee7cfc5e89f17e8be7850d1ee2b97d81d7d3de6b379209bda", "dweb:/ipfs/QmfP17xgQgvGVa1cmS9KS9ZHoAfPUBVRpYw16Ey76VH8uX" ], "license": "MIT" }, "contracts/real-world-agent/IRealWorldAgent.sol": { "keccak256": "0x691c24964487cb9c8658b97feaa84562e9816184d41d24e4b2020708fd933d84", "urls": [ "bzz-raw://e5f3ee5ffece65f8bbef36a54267320f41ef21ceaec82daf1718f54e9d9c9c87", "dweb:/ipfs/QmU3v97MTNm4fD9BdWgjqmPi4PWzojzFJCkPRCEdCGhAez" ], "license": "MIT" }, "contracts/real-world-agent/RealWorldAgent.sol": { "keccak256": "0xbd9df6076cbc633dfc24ee0aa4fe67c79594d0bc83f5b3b8606f506a1e3ebbf1", "urls": [ "bzz-raw://8ee52633e6e215c15cf3b3cca744319896b0d6fb7bb8592e2e64c3caf05fa38d", "dweb:/ipfs/QmdBY9RrvamzyZLaoX6bqpkNhfLAtrjmc4wBHABTfhFuFN" ], "license": "MIT" }, "node_modules/@openzeppelin/contracts/access/Ownable.sol": { "keccak256": "0xba43b97fba0d32eb4254f6a5a297b39a19a247082a02d6e69349e071e2946218", "urls": [ "bzz-raw://fc980984badf3984b6303b377711220e067722bbd6a135b24669ff5069ef9f32", "dweb:/ipfs/QmPHXMSXj99XjSVM21YsY6aNtLLjLVXDbyN76J5HQYvvrz" ], "license": "MIT" }, "node_modules/@openzeppelin/contracts/governance/utils/IVotes.sol": { "keccak256": "0x1618ddebe73377660f6da71afcba35d5ac4c4600918b3a381d9c6f37eba613eb", "urls": [ "bzz-raw://666c8d7c62478b55e082f1835275b7acfc1595491998df6d67183ff2c70eab96", "dweb:/ipfs/QmVXmnXfxNaLhoX283dqyKJ8DJbF5thUd9sMuRoFpNMwr7" ], "license": "MIT" }, "node_modules/@openzeppelin/contracts/interfaces/IERC5267.sol": { "keccak256": "0xac6c2efc64baccbde4904ae18ed45139c9aa8cff96d6888344d1e4d2eb8b659f", "urls": [ "bzz-raw://6e416a280c610b6b7a5f158e4a41aacfaec01ef14d5d1de13b46be9e090265fc", "dweb:/ipfs/QmYZP2KrdyccBbhLZT42auhvBTMkwiwUS3V6HWb42rbwbG" ], "license": "MIT" }, "node_modules/@openzeppelin/contracts/interfaces/IERC5805.sol": { "keccak256": "0xfc12b717f6a2cd0d67adc8700097d4464d37f18ce933d4fc9c948ab6aec35e80", "urls": [ "bzz-raw://82386e69ebe902a2edfd4f8a5ecbeaeb2e00f6cc6481a973729e974373fb492e", "dweb:/ipfs/QmSXg4wBMBd83mQvkekT1GsiRX2Qyv5gvrqzv5qJx2M7Kc" ], "license": "MIT" }, "node_modules/@openzeppelin/contracts/interfaces/IERC6372.sol": { "keccak256": "0xcaea9aeda3816ba872358c828f4f01455c22ae48ced49c4c7d72bd74176c09b9", "urls": [ "bzz-raw://16ff22d8df5aee94510ee43d361b6147caef164941a684cedcb75be44f351fe6", "dweb:/ipfs/QmaCCwMdHVdPApuEJHLZapSJyA7mp5dAugpma3VUzWGd8E" ], "license": "MIT" }, "node_modules/@openzeppelin/contracts/token/ERC20/ERC20.sol": { "keccak256": "0xa56ca923f70c1748830700250b19c61b70db9a683516dc5e216694a50445d99c", "urls": [ "bzz-raw://cac938788bc4be12101e59d45588b4e059579f4e61062e1cda8d6b06c0191b15", "dweb:/ipfs/QmV2JKCyjTVH3rkWNrfdJRhAT7tZ3usAN2XcnD4h53Mvih" ], "license": "MIT" }, "node_modules/@openzeppelin/contracts/token/ERC20/IERC20.sol": { "keccak256": "0x287b55befed2961a7eabd7d7b1b2839cbca8a5b80ef8dcbb25ed3d4c2002c305", "urls": [ "bzz-raw://bd39944e8fc06be6dbe2dd1d8449b5336e23c6a7ba3e8e9ae5ae0f37f35283f5", "dweb:/ipfs/QmPV3FGYjVwvKSgAXKUN3r9T9GwniZz83CxBpM7vyj2G53" ], "license": "MIT" }, "node_modules/@openzeppelin/contracts/token/ERC20/extensions/ERC20Permit.sol": { "keccak256": "0xbb16110ffe0b625944fe7dd97adcf1158e514185c956a5628bc09be90d606174", "urls": [ "bzz-raw://b5b412e554a4dd37a50f89ffcd7b9a6ef2ae5064f37619f89343b23d58ce89ca", "dweb:/ipfs/QmPWMdBvdFk8WBVv625wd1Ar7aehnBWtj1XfFRrRL5KpxJ" ], "license": "MIT" }, "node_modules/@openzeppelin/contracts/token/ERC20/extensions/ERC20Votes.sol": { "keccak256": "0x4e560f86662b6f72ab76122fff53317677154f14bac4a80dbd46a54172b3abfa", "urls": [ "bzz-raw://ca5c2518d247417cb01164f04eff57b7e87b5346bc03478ada916f26117aa7fd", "dweb:/ipfs/QmVgK66XGZCiH9x4mhqejKUTujtu68DyE6KrYi6MPuaHRJ" ], "license": "MIT" }, "node_modules/@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol": { "keccak256": "0x8de418a5503946cabe331f35fe242d3201a73f67f77aaeb7110acb1f30423aca", "urls": [ "bzz-raw://5a376d3dda2cb70536c0a45c208b29b34ac560c4cb4f513a42079f96ba47d2dd", "dweb:/ipfs/QmZQg6gn1sUpM8wHzwNvSnihumUCAhxD119MpXeKp8B9s8" ], "license": "MIT" }, "node_modules/@openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol": { "keccak256": "0xb264c03a3442eb37a68ad620cefd1182766b58bee6cec40343480392d6b14d69", "urls": [ "bzz-raw://28879d01fd22c07b44f006612775f8577defbe459cb01685c5e25cd518c91a71", "dweb:/ipfs/QmVgfkwv2Fxw6hhTcDUZhE7NkoSKjab3ipM7UaRbt6uXb5" ], "license": "MIT" }, "node_modules/@openzeppelin/contracts/token/ERC20/extensions/draft-ERC20Permit.sol": { "keccak256": "0xbe43b6f1e04b5215939f1a76fa612c275b75948f6e7bf25808fb91e99444a33f", "urls": [ "bzz-raw://86d672d9a23f3502472f6827af8e8116a6412b28c234dcfcb201413055cb0159", "dweb:/ipfs/Qmcts6GvEMHuyikwDHtcTdTW4SVP1k66KpUMRcCovWbLN8" ], "license": "MIT" }, "node_modules/@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol": { "keccak256": "0xabefac93435967b4d36a4fabcbdbb918d1f0b7ae3c3d85bc30923b326c927ed1", "urls": [ "bzz-raw://9d213d3befca47da33f6db0310826bcdb148299805c10d77175ecfe1d06a9a68", "dweb:/ipfs/QmRgCn6SP1hbBkExUADFuDo8xkT4UU47yjNF5FhCeRbQmS" ], "license": "MIT" }, "node_modules/@openzeppelin/contracts/utils/Address.sol": { "keccak256": "0x006dd67219697fe68d7fbfdea512e7c4cb64a43565ed86171d67e844982da6fa", "urls": [ "bzz-raw://2455248c8ddd9cc6a7af76a13973cddf222072427e7b0e2a7d1aff345145e931", "dweb:/ipfs/QmfYjnjRbWqYpuxurqveE6HtzsY1Xx323J428AKQgtBJZm" ], "license": "MIT" }, "node_modules/@openzeppelin/contracts/utils/Context.sol": { "keccak256": "0xa92e4fa126feb6907daa0513ddd816b2eb91f30a808de54f63c17d0e162c3439", "urls": [ "bzz-raw://a367861093b74443b137564d3f3c472f70bcf114739e62059c939f25e315706c", "dweb:/ipfs/Qmd7JMpcxD9RuQjK3uM3EzJUgSqdN8vzp8eytEiuwxQJ6h" ], "license": "MIT" }, "node_modules/@openzeppelin/contracts/utils/Counters.sol": { "keccak256": "0xf0018c2440fbe238dd3a8732fa8e17a0f9dce84d31451dc8a32f6d62b349c9f1", "urls": [ "bzz-raw://59e1c62884d55b70f3ae5432b44bb3166ad71ae3acd19c57ab6ddc3c87c325ee", "dweb:/ipfs/QmezuXg5GK5oeA4F91EZhozBFekhq5TD966bHPH18cCqhu" ], "license": "MIT" }, "node_modules/@openzeppelin/contracts/utils/ShortStrings.sol": { "keccak256": "0xc0e310c163edf15db45d4ff938113ab357f94fa86e61ea8e790853c4d2e13256", "urls": [ "bzz-raw://04db5bc05dcb05ba1f6ca2dfbead17adc8a2e2f911aa80b05e7a36d9eaf96516", "dweb:/ipfs/QmVkfHZbXVBUPsTopueCn3qGJX8aEjahFF3Fn4NcygLNm5" ], "license": "MIT" }, "node_modules/@openzeppelin/contracts/utils/StorageSlot.sol": { "keccak256": "0xf09e68aa0dc6722a25bc46490e8d48ed864466d17313b8a0b254c36b54e49899", "urls": [ "bzz-raw://e26daf81e2252dc1fe1ce0e4b55c2eb7c6d1ee84ae6558d1a9554432ea1d32da", "dweb:/ipfs/Qmb1UANWiWq5pCKbmHSu772hd4nt374dVaghGmwSVNuk8Q" ], "license": "MIT" }, "node_modules/@openzeppelin/contracts/utils/Strings.sol": { "keccak256": "0x3088eb2868e8d13d89d16670b5f8612c4ab9ff8956272837d8e90106c59c14a0", "urls": [ "bzz-raw://b81d9ff6559ea5c47fc573e17ece6d9ba5d6839e213e6ebc3b4c5c8fe4199d7f", "dweb:/ipfs/QmPCW1bFisUzJkyjroY3yipwfism9RRCigCcK1hbXtVM8n" ], "license": "MIT" }, "node_modules/@openzeppelin/contracts/utils/cryptography/ECDSA.sol": { "keccak256": "0x809bc3edb4bcbef8263fa616c1b60ee0004b50a8a1bfa164d8f57fd31f520c58", "urls": [ "bzz-raw://8b93a1e39a4a19eba1600b92c96f435442db88cac91e315c8291547a2a7bcfe2", "dweb:/ipfs/QmTm34KVe6uZBZwq8dZDNWwPcm24qBJdxqL3rPxBJ4LrMv" ], "license": "MIT" }, "node_modules/@openzeppelin/contracts/utils/cryptography/EIP712.sol": { "keccak256": "0x8432884527a7ad91e6eed1cfc5a0811ae2073e5bca107bd0ca442e9236b03dbd", "urls": [ "bzz-raw://e3aa0eadab7aafcf91a95684765f778f64386f0368de88522ce873c21385278a", "dweb:/ipfs/QmPfaVAqWgH1QsT3dHVuL6jwMZbVKdoP8w1PvpiPT2FPWd" ], "license": "MIT" }, "node_modules/@openzeppelin/contracts/utils/math/Math.sol": { "keccak256": "0xe4455ac1eb7fc497bb7402579e7b4d64d928b846fce7d2b6fde06d366f21c2b3", "urls": [ "bzz-raw://cc8841b3cd48ad125e2f46323c8bad3aa0e88e399ec62acb9e57efa7e7c8058c", "dweb:/ipfs/QmSqE4mXHA2BXW58deDbXE8MTcsL5JSKNDbm23sVQxRLPS" ], "license": "MIT" }, "node_modules/@openzeppelin/contracts/utils/math/SafeCast.sol": { "keccak256": "0x52a8cfb0f5239d11b457dcdd1b326992ef672714ca8da71a157255bddd13f3ad", "urls": [ "bzz-raw://495145362c7ff1c9ca88c58bbbbcb412e3c2004406647412394486552ff6c278", "dweb:/ipfs/QmNNCeng6d5eRPDn6tkWSQhjE39XWfQEfjA63rRwHmr1iH" ], "license": "MIT" }, "node_modules/@openzeppelin/contracts/utils/math/SignedMath.sol": { "keccak256": "0xf92515413956f529d95977adc9b0567d583c6203fc31ab1c23824c35187e3ddc", "urls": [ "bzz-raw://c50fcc459e49a9858b6d8ad5f911295cb7c9ab57567845a250bf0153f84a95c7", "dweb:/ipfs/QmcEW85JRzvDkQggxiBBLVAasXWdkhEysqypj9EaB6H2g6" ], "license": "MIT" } }, "version": 1 }, "id": 23 } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/binds/erc20realworldagent/abigen.sh ================================================ jq ".abi" ERC20RealWorldAgent.json > ERC20RealWorldAgent.abi jq -r ".bytecode.object" ERC20RealWorldAgent.json > ERC20RealWorldAgent.bin abigen --bin=ERC20RealWorldAgent.bin --abi=ERC20RealWorldAgent.abi --pkg=erc20realworldagent --type ERC20RealWorldAgent --out=ERC20RealWorldAgent.go rm ERC20RealWorldAgent.abi rm ERC20RealWorldAgent.bin ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/binds/erc20utilityagent/ERC20UtilityAgent.go ================================================ // Code generated - DO NOT EDIT. // This file is a generated binding and any manual changes will be lost. package erc20utilityagent import ( "errors" "math/big" "strings" ethereum "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/event" ) // Reference imports to suppress errors if they are not otherwise used. var ( _ = errors.New _ = big.NewInt _ = strings.NewReader _ = ethereum.NotFound _ = bind.Bind _ = common.Big1 _ = types.BloomLookup _ = event.NewSubscription _ = abi.ConvertType ) // BytecodeSlice is an auto generated low-level Go binding around an user-defined struct. type BytecodeSlice struct { Pointer common.Address Start uint32 End uint32 } // ERC20VotesCheckpoint is an auto generated low-level Go binding around an user-defined struct. type ERC20VotesCheckpoint struct { FromBlock uint32 Votes *big.Int } // File is an auto generated low-level Go binding around an user-defined struct. type File struct { Size *big.Int Slices []BytecodeSlice } // IUtilityAgentStorageInfo is an auto generated low-level Go binding around an user-defined struct. type IUtilityAgentStorageInfo struct { ContractAddress common.Address Filename string } // ERC20UtilityAgentMetaData contains all meta data concerning the ERC20UtilityAgent contract. var ERC20UtilityAgentMetaData = &bind.MetaData{ ABI: "[{\"inputs\":[{\"internalType\":\"string\",\"name\":\"name_\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"symbol_\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"amount_\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"recipient_\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"systemPrompt_\",\"type\":\"string\"},{\"internalType\":\"bytes\",\"name\":\"storageInfo_\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"DuplicateUuid\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidData\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidShortString\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"str\",\"type\":\"string\"}],\"name\":\"StringTooLong\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddress\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"delegator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"fromDelegate\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"toDelegate\",\"type\":\"address\"}],\"name\":\"DelegateChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"delegate\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"previousBalance\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newBalance\",\"type\":\"uint256\"}],\"name\":\"DelegateVotesChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"EIP712DomainChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"uuid\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"inferId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"fowardData\",\"type\":\"bytes\"}],\"name\":\"ForwardPerformed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"hybridModel\",\"type\":\"address\"}],\"name\":\"ModelUpdate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"uuid\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"inferId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"executionData\",\"type\":\"bytes\"}],\"name\":\"PromptPerformed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"promptScheduler\",\"type\":\"address\"}],\"name\":\"PromptSchedulerUpdate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"string\",\"name\":\"newSystemPrompt\",\"type\":\"string\"}],\"name\":\"SystemPromptUpdate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"CLOCK_MODE\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"DOMAIN_SEPARATOR\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"pos\",\"type\":\"uint32\"}],\"name\":\"checkpoints\",\"outputs\":[{\"components\":[{\"internalType\":\"uint32\",\"name\":\"fromBlock\",\"type\":\"uint32\"},{\"internalType\":\"uint224\",\"name\":\"votes\",\"type\":\"uint224\"}],\"internalType\":\"structERC20Votes.Checkpoint\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"clock\",\"outputs\":[{\"internalType\":\"uint48\",\"name\":\"\",\"type\":\"uint48\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"subtractedValue\",\"type\":\"uint256\"}],\"name\":\"decreaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"delegatee\",\"type\":\"address\"}],\"name\":\"delegate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"delegatee\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiry\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"delegateBySig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"delegates\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"eip712Domain\",\"outputs\":[{\"internalType\":\"bytes1\",\"name\":\"fields\",\"type\":\"bytes1\"},{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"version\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"verifyingContract\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"salt\",\"type\":\"bytes32\"},{\"internalType\":\"uint256[]\",\"name\":\"extensions\",\"type\":\"uint256[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"fetchCode\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"logic\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"uuid\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"dstAgent\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"request\",\"type\":\"bytes\"}],\"name\":\"forward\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"dstActionId\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getFileStorageChunkInfo\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"size\",\"type\":\"uint256\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"pointer\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"start\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"end\",\"type\":\"uint32\"}],\"internalType\":\"structBytecodeSlice[]\",\"name\":\"slices\",\"type\":\"tuple[]\"}],\"internalType\":\"structFile\",\"name\":\"file\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"timepoint\",\"type\":\"uint256\"}],\"name\":\"getPastTotalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"timepoint\",\"type\":\"uint256\"}],\"name\":\"getPastVotes\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"getResultById\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"uuid\",\"type\":\"bytes32\"}],\"name\":\"getResultById\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getStorageInfo\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"contractAddress\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"filename\",\"type\":\"string\"}],\"internalType\":\"structIUtilityAgent.StorageInfo\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getStorageMode\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getSystemPrompt\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"getVotes\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"addedValue\",\"type\":\"uint256\"}],\"name\":\"increaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"nonces\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"numCheckpoints\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"permit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"request\",\"type\":\"bytes\"}],\"name\":\"prompt\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"uuid\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"request\",\"type\":\"bytes\"}],\"name\":\"prompt\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"filename\",\"type\":\"string\"}],\"name\":\"updateFileName\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"systemPrompt\",\"type\":\"string\"}],\"name\":\"updateSystemPrompt\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", Bin: "0x610180604052346200008257620000266200001962000193565b949390939291926200024a565b6040516141509081620015348239608051816130f5015260a051816131b0015260c051816130c6015260e051816131440152610100518161316a01526101205181611347015261014051816113710152610160518161068a0152f35b600080fd5b634e487b7160e01b600052604160045260246000fd5b604081019081106001600160401b03821117620000b957604052565b62000087565b601f909101601f19168101906001600160401b03821190821017620000b957604052565b60405190620000f2826200009d565b565b60005b838110620001085750506000910152565b8181015183820152602001620000f7565b81601f82011215620000825780516001600160401b038111620000b9576040519262000150601f8301601f191660200185620000bf565b818452602082840101116200008257620001719160208085019101620000f4565b90565b6001600160a01b038116036200008257565b5190620000f28262000174565b620056a48038038060405192620001ab8285620000bf565b8339810160c082820312620000825781516001600160401b0390818111620000825782620001db91850162000119565b6020840151828111620000825783620001f691860162000119565b946040850151946200020b6060820162000186565b9460808201518581116200008257816200022791840162000119565b9460a0830151908111620000825762000241920162000119565b91959493929190565b9594909193956040516200025e816200009d565b6001808252603160f81b6020808401918252845190969194926001600160401b038211620000b9576200029e826200029860035462000411565b6200044e565b8790601f831160011462000371575092620002f26200034c979693620002e984620000f29e9f979562000346999660009162000365575b508160011b916000199060031b1c19161790565b60035562000670565b620002fd8162000a50565b610120526200030c8262000b5d565b6101405287815191012060e052519020610100524660a0526200032e62000c6a565b6080523060c052620003403362000a07565b6200076b565b6200087b565b6200035662000859565b80519101206101605262000d3c565b905085015138620002d5565b600360005290601f1983167fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b926000905b828210620003f957505093600184620000f29e9f9794620002f294620003469a976200034c9d9c9910620003df575b5050811b0160035562000670565b86015160001960f88460031b161c191690553880620003d1565b87840151855593840193928b0192908b0190620003a2565b90600182811c9216801562000443575b60208310146200042d57565b634e487b7160e01b600052602260045260246000fd5b91607f169162000421565b601f81116200045b575050565b60009060036000526020600020906020601f850160051c830194106200049e575b601f0160051c01915b8281106200049257505050565b81815560010162000485565b90925082906200047c565b601f8111620004b6575050565b60009060046000526020600020906020601f850160051c83019410620004f9575b601f0160051c01915b828110620004ed57505050565b818155600101620004e0565b9092508290620004d7565b601f811162000511575050565b600090600d6000526020600020906020601f850160051c8301941062000554575b601f0160051c01915b8281106200054857505050565b8181556001016200053b565b909250829062000532565b601f81116200056c575050565b600090600f6000526020600020906020601f850160051c83019410620005af575b601f0160051c01915b828110620005a357505050565b81815560010162000596565b90925082906200058d565b601f8111620005c7575050565b60009060056000526020600020906020601f850160051c830194106200060a575b601f0160051c01915b828110620005fe57505050565b818155600101620005f1565b9092508290620005e8565b601f811162000622575050565b60009060066000526020600020906020601f850160051c8301941062000665575b601f0160051c01915b8281106200065957505050565b8181556001016200064c565b909250829062000643565b80519091906001600160401b038111620000b9576200069c816200069660045462000411565b620004a9565b602080601f8311600114620006e357508190620006d29394600092620006d7575b50508160011b916000199060031b1c19161790565b600455565b015190503880620006bd565b6004600052601f198316949091907f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b926000905b8782106200075257505083600195961062000738575b505050811b01600455565b015160001960f88460031b161c191690553880806200072d565b8060018596829496860151815501950193019062000717565b80519091906001600160401b038111620000b957620007978162000791600d5462000411565b62000504565b602080601f8311600114620007d157508190620007cc9394600092620006d75750508160011b916000199060031b1c19161790565b600d55565b600d600052601f198316949091907fd7b6990105719101dabeb77144f2a3385c8033acd3af97e9423a695e81ad1eb5926000905b8782106200084057505083600195961062000826575b505050811b01600d55565b015160001960f88460031b161c191690553880806200081b565b8060018596829496860151815501950193019062000805565b6040519062000868826200009d565b60048252636970667360e01b6020830152565b906014825110620009f5578151820191602060408285031262000082578082015193620008a88562000174565b60408301516001600160401b0393848211620000825783620008d4928162000913950192010162000119565b9460018060a01b03168583604051620008ed816200009d565b8381520152600e80546001600160a01b0319166001600160a01b03909216919091179055565b8351918211620000b95762000935826200092f600f5462000411565b6200055f565b80601f83116001146200096d57508190620009689394600092620006d75750508160011b916000199060031b1c19161790565b600f55565b600f600052601f198316949091907f8d1108e10bcb7c27dddfc02ed9d693a074039d026cf4ea4240b40f7d581ac802926000905b878210620009dc575050836001959610620009c2575b505050811b01600f55565b015160001960f88460031b161c19169055388080620009b7565b80600185968294968601518155019501930190620009a1565b604051635cb045db60e01b8152600490fd5b600c80546001600160a01b039283166001600160a01b0319821681179092559091167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a3565b908151602080821060001462000a6e57505090620001719062000e2b565b6001600160401b038211620000b95762000a958262000a8f60055462000411565b620005ba565b602090601f831160011462000ad25750819062000aca9394600092620006d75750508160011b916000199060031b1c19161790565b60055560ff90565b6005600052601f198316949091907f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db0926000905b87821062000b4457505083600195961062000b2a575b505050811b0160055560ff90565b015160001960f88460031b161c1916905538808062000b1c565b8060018596829496860151815501950193019062000b06565b908151602080821060001462000b7b57505090620001719062000e2b565b6001600160401b038211620000b95762000ba28262000b9c60065462000411565b62000615565b602090601f831160011462000bdf5750819062000bd79394600092620006d75750508160011b916000199060031b1c19161790565b60065560ff90565b6006600052601f198316949091907ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f926000905b87821062000c5157505083600195961062000c37575b505050811b0160065560ff90565b015160001960f88460031b161c1916905538808062000c29565b8060018596829496860151815501950193019062000c13565b60e051610100516040519060208201927f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f8452604083015260608201524660808201523060a082015260a0815260c0810181811060018060401b03821117620000b95760405251902090565b1562000cde57565b60405162461bcd60e51b815260206004820152603060248201527f4552433230566f7465733a20746f74616c20737570706c79207269736b73206f60448201526f766572666c6f77696e6720766f74657360801b6064820152608490fd5b906001600160a01b038216801562000de65760025482810180911162000de05762000ddc9362000dbe9262000d718593600255565b6001600160a01b038216600090815260208181526040808320805487019055518581527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9190a3620013a1565b60025462000dd6906001600160e01b03101562000cd6565b62000fba565b5050565b62000e9a565b60405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606490fd5b601f81511162000e5957602081519101516020821062000e49571790565b6000198260200360031b1b161790565b6044604051809263305a27a960e01b82526020600483015262000e8c8151809281602486015260208686019101620000f4565b601f01601f19168101030190fd5b634e487b7160e01b600052601160045260246000fd5b604080519192919081016001600160401b03811182821017620000b957604052602081935463ffffffff81168352811c910152565b600b549068010000000000000000821015620000b9576001820180600b5582101562000f5357600b600052805160209182015190911b63ffffffff191663ffffffff91909116177f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01db990910155565b634e487b7160e01b600052603260045260246000fd5b90815468010000000000000000811015620000b9576001810180845581101562000f5357600092835260209283902082519284015190931b63ffffffff191663ffffffff9290921691909117910155565b600b5490918115918215620011025762000fd3620000e3565b60008152600060208201525b60208101516200100c9062001004906001600160e01b03165b6001600160e01b031690565b958662001517565b93159081620010db575b50156200107357620000f2906200105c620010318562001337565b600b600052917f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01db80190565b9063ffffffff82549181199060201b169116179055565b50620000f26200109c620010966200108b43620014af565b65ffffffffffff1690565b620012d1565b620010d5620010ab8562001337565b620010c5620010b9620000e3565b63ffffffff9094168452565b6001600160e01b03166020830152565b62000ee5565b5163ffffffff16905063ffffffff620010f86200108b43620014af565b9116143862001016565b600b6000526200113a7f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01db8820162000eb0565b62000eb0565b62000fdf565b90918154918215928360001462001244576200115b620000e3565b60008152600060208201525b60208101516200118d9062001185906001600160e01b031662000ff8565b968762001525565b941590816200121d575b5015620011c4576200105c620000f292620011b28662001337565b92600019019060005260206000200190565b50620000f290620011dd620010966200108b43620014af565b9062001217620011ed8662001337565b62001207620011fb620000e3565b63ffffffff9095168552565b6001600160e01b03166020840152565b62000f69565b5163ffffffff16905063ffffffff6200123a6200108b43620014af565b9116143862001197565b6200125e6200113460001983018460005260206000200190565b62001167565b909181549182159283600014620012b1576200127f620000e3565b60008152600060208201525b60208101516200118d90620012a9906001600160e01b031662000ff8565b968762001517565b620012cb6200113460001983018460005260206000200190565b6200128b565b63ffffffff90818111620012e3571690565b60405162461bcd60e51b815260206004820152602660248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203360448201526532206269747360d01b6064820152608490fd5b6001600160e01b03908181116200134c571690565b60405162461bcd60e51b815260206004820152602760248201527f53616665436173743a2076616c756520646f65736e27742066697420696e20326044820152663234206269747360c81b6064820152608490fd5b60096020527fec8156718a8372b1db44bb411437d0870f3e3790d4a08526d024ce1b0b668f6b546001600160a01b039182166000908152604081205483169392909116908184141580620014a5575b620013fc575b50505050565b82908262001464575b5050508162001417575b8080620013f6565b6001600160a01b0382166000908152600a6020526040902060008051602062005684833981519152916200144b9162001264565b60408051928352602083019190915290a238806200140f565b6000805160206200568483398151915291604082856200148b9452600a6020522062001140565b60408051928352602083019190915290a238818162001405565b50821515620013f0565b65ffffffffffff90818111620014c3571690565b60405162461bcd60e51b815260206004820152602660248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203460448201526538206269747360d01b6064820152608490fd5b90810180911162000de05790565b90810390811162000de0579056fe6080604052600436101561001257600080fd5b60003560e01c806306fdde031461029257806307679a641461028d57806308112bdf1461026a578063095ea7b31461028857806318160ddd146102835780631d959e5d1461027e57806323b872dd14610279578063313ce567146102745780633644e5151461026f578063365bec7f1461026a57806339509351146102655780633a46b1a814610260578063481622f91461025b5780634bf5d7e914610256578063587cde1e146102515780635c19a95c1461024c5780636fcfff451461024757806370a0823114610242578063715018a61461023d57806376a3002914610238578063793042c9146102335780637ecebe001461022e57806384b0196e146102295780638da5cb5b146102245780638e539e8c1461021f57806391ddadf41461021a57806395d89b41146102155780639ab24eb014610210578063a457c2d71461020b578063a9059cbb14610206578063b213c50814610201578063be16d94a146101fc578063c3cda520146101f7578063d505accf146101f2578063dd62ed3e146101ed578063e702c420146101e8578063f1127ed8146101e3578063f2fde38b146101de578063f514b5b8146101d95763f73eb6f3146101d457600080fd5b612440565b6121a2565b612069565b611fa2565b611ef0565b611e53565b611ca8565b611b05565b611a7b565b6119ac565b6118da565b6117cb565b61171c565b611656565b61160c565b611495565b611443565b61130e565b6112a5565b61124f565b611081565b610e2f565b610dc6565b610d4f565b610d09565b610c9e565b610bb5565b610b67565b6109b6565b610928565b610501565b6108e7565b6108ad565b61075b565b610649565b61060d565b6105ba565b61043b565b610311565b60005b8381106102aa5750506000910152565b818101518382015260200161029a565b907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f6020936102f681518092818752878088019101610297565b0116010190565b90602061030e9281815201906102ba565b90565b34610436576000807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261043357604051908060035490610353826125e7565b808552916020916001918281169081156103e85750600114610390575b61038c8661038081880382610f72565b604051918291826102fd565b0390f35b9350600384527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b5b8385106103d5575050505081016020016103808261038c38610370565b80548686018401529382019381016103b8565b87965061038c979450602093506103809592507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0091501682840152151560051b820101929338610370565b80fd5b600080fd5b34610436576000807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610433576040519080600d549061047d826125e7565b808552916020916001918281169081156103e857506001146104a95761038c8661038081880382610f72565b9350600d84527fd7b6990105719101dabeb77144f2a3385c8033acd3af97e9423a695e81ad1eb55b8385106104ee575050505081016020016103808261038c38610370565b80548686018401529382019381016104d1565b34610436576020807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261043657604051908082528181606051808284015260005b818110610584575060008382018301830152601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820101030190f35b60808101518682018401840152859350849201610545565b73ffffffffffffffffffffffffffffffffffffffff81160361043657565b346104365760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610436576106026004356105f88161059c565b6024359033612b90565b602060405160018152f35b346104365760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610436576020600254604051908152f35b34610436576000807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610433576106816128a9565b602081519101207f0000000000000000000000000000000000000000000000000000000000000000146000146106bd575061038c61038061270d565b600e5473ffffffffffffffffffffffffffffffffffffffff16908060405180937fe0876aa8000000000000000000000000000000000000000000000000000000008252818061070e60048201612829565b03915afa80156107565761038c928261072e9392610733575b5050612d4f565b610380565b61074f92503d8091833e6107478183610f72565b81019061273d565b3880610727565b612838565b346104365760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610436576004356107968161059c565b6024356107a28161059c565b6044359073ffffffffffffffffffffffffffffffffffffffff831660005260016020526107f33360406000209073ffffffffffffffffffffffffffffffffffffffff16600052602052604060002090565b54927fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8403610833575b6108279350612f33565b60405160018152602090f35b82841061084f5761084a8361082795033383612b90565b61081d565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152fd5b346104365760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261043657602060405160128152f35b346104365760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126104365760206109206130af565b604051908152f35b346104365760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610436576004356109638161059c565b33600052600160205261099a8160406000209073ffffffffffffffffffffffffffffffffffffffff16600052602052604060002090565b5460243581018091116109b1576106029133612b90565b61259d565b346104365760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610436576004356109f18161059c565b73ffffffffffffffffffffffffffffffffffffffff60243591610a2565ffffffffffff610a1d43613593565b168410612844565b16600052600a602052604060002080549160008360058111610b16575b50905b838210610ac557505081610a80575050602060005b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff60405191168152f35b610ab9610ac0917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff602094019060005260206000200190565b5460201c90565b610a5a565b9092610ad18185613924565b908263ffffffff610af6610aec858860005260206000200190565b5463ffffffff1690565b161115610b065750925b90610a45565b9350610b11906125cc565b610b00565b80610b26610b2c929693966137e4565b906125da565b908263ffffffff610b47610aec858860005260206000200190565b161115610b575750925b38610a42565b9350610b62906125cc565b610b51565b346104365760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126104365761038c610ba16128a9565b6040519182916020835260208301906102ba565b346104365760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610436574365ffffffffffff610bf543613593565b1603610c405761038c604051610c0a81610efd565b601d81527f6d6f64653d626c6f636b6e756d6265722666726f6d3d64656661756c740000006020820152604051918291826102fd565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f4552433230566f7465733a2062726f6b656e20636c6f636b206d6f64650000006044820152fd5b346104365760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610436576020600435610cdb8161059c565b73ffffffffffffffffffffffffffffffffffffffff8091166000526009825260406000205416604051908152f35b346104365760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261043657610d4d600435610d478161059c565b336131d6565b005b346104365760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126104365773ffffffffffffffffffffffffffffffffffffffff600435610d9f8161059c565b16600052600a6020526020610db8604060002054613287565b63ffffffff60405191168152f35b346104365760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126104365773ffffffffffffffffffffffffffffffffffffffff600435610e168161059c565b1660005260006020526020604060002054604051908152f35b34610436576000807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261043357610e6761331c565b8073ffffffffffffffffffffffffffffffffffffffff600c547fffffffffffffffffffffffff00000000000000000000000000000000000000008116600c55167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040810190811067ffffffffffffffff821117610f1957604052565b610ece565b6060810190811067ffffffffffffffff821117610f1957604052565b6020810190811067ffffffffffffffff821117610f1957604052565b60c0810190811067ffffffffffffffff821117610f1957604052565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff821117610f1957604052565b60405190610fc082610efd565b565b92919267ffffffffffffffff8211610f19576040519161100a60207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8401160184610f72565b829481845281830111610436578281602093846000960137010152565b60207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc820112610436576004359067ffffffffffffffff821161043657806023830112156104365781602461030e93600401359101610fc2565b346104365761108f36611027565b61109761331c565b805167ffffffffffffffff8111610f19576110bc816110b7600d546125e7565b612939565b602080601f831160011461114e57509161112f8261113e937fdf5a31f32f865da404304d8e717e689823eab72d259d756d85fc552ef9ac78d895600091611143575b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8260011b9260031b1c19161790565b600d55604051918291826102fd565b0390a1005b9050830151386110fe565b600d600052907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe083167fd7b6990105719101dabeb77144f2a3385c8033acd3af97e9423a695e81ad1eb5926000905b82821061121c575050927fdf5a31f32f865da404304d8e717e689823eab72d259d756d85fc552ef9ac78d894926001928261113e96106111e5575b5050811b01600d55610380565b8401517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60f88460031b161c1916905538806111d8565b80600185968294968a0151815501950193019061119d565b9080601f830112156104365781602061030e93359101610fc2565b60207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126104365760043567ffffffffffffffff811161043657611299903690600401611234565b50602060405160008152f35b346104365760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126104365773ffffffffffffffffffffffffffffffffffffffff6004356112f58161059c565b1660005260076020526020604060002054604051908152f35b34610436576000807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610433576113e69061136b7f000000000000000000000000000000000000000000000000000000000000000061339b565b906113957f00000000000000000000000000000000000000000000000000000000000000006134d3565b90604051916113a383610f3a565b8183526113f46020916040519687967f0f00000000000000000000000000000000000000000000000000000000000000885260e0602089015260e08801906102ba565b9086820360408801526102ba565b904660608601523060808601528260a086015284820360c0860152602080855193848152019401925b82811061142c57505050500390f35b83518552869550938101939281019260010161141d565b346104365760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261043657602073ffffffffffffffffffffffffffffffffffffffff600c5416604051908152f35b346104365760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610436576004356114e265ffffffffffff6114da43613593565b168210612844565b600b5490600082600581116115a5575b50905b82821061154257828061150f575060405160008152602090f35b600b600052602090610ac0907f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01db801610ab9565b909161154e8184613924565b600b600052908263ffffffff6115857f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01db98501610aec565b1611156115955750915b906114f5565b92506115a0906125cc565b61158f565b80610b266115b5929593956137e4565b600b600052908263ffffffff6115ec7f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01db98501610aec565b1611156115fc5750915b386114f2565b9250611607906125cc565b6115f6565b346104365760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261043657602061164643613593565b65ffffffffffff60405191168152f35b34610436576000807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261043357604051908060045490611698826125e7565b808552916020916001918281169081156103e857506001146116c45761038c8661038081880382610f72565b9350600484527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b5b838510611709575050505081016020016103808261038c38610370565b80548686018401529382019381016116ec565b346104365760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126104365773ffffffffffffffffffffffffffffffffffffffff60043561176c8161059c565b16600052600a60205260406000208054801560001461179357505060405160008152602090f35b6020917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6117c2920190612a1d565b5054811c610a5a565b346104365760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610436576004356118068161059c565b602435903360005260016020526118418160406000209073ffffffffffffffffffffffffffffffffffffffff16600052602052604060002090565b54918083106118565761082792039033612b90565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760448201527f207a65726f0000000000000000000000000000000000000000000000000000006064820152fd5b346104365760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610436576106026004356119188161059c565b6024359033612f33565b906020908183526060918060608501928051828701520151938160806040926040808201528751809652019501936000915b8483106119645750505050505090565b8551805173ffffffffffffffffffffffffffffffffffffffff1688528085015163ffffffff908116898701529082015116878201529581019594830194600190920191611954565b34610436576000807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610433576119e4612a64565b5073ffffffffffffffffffffffffffffffffffffffff600e54168160405180927fe0876aa8000000000000000000000000000000000000000000000000000000008252602060048301528180611a3c6024820161263a565b03915afa908115610756578261038c9392611a60575b505060405191829182611922565b611a7492503d8091833e6107478183610f72565b3880611a52565b60407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126104365760243567ffffffffffffffff8082116104365736602383011215610436578160040135908111610436573691016024011161043657602060405160008152f35b6064359060ff8216820361043657565b6084359060ff8216820361043657565b346104365760c07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261043657600435611b408161059c565b60443590602435611b4f611ae5565b92804211611c4a57611c0b611c4591610d4d9560405190611bf382611bc76020820195898b8860609194939273ffffffffffffffffffffffffffffffffffffffff60808301967fe48329057bfd03d55e49b547132e39cffd9c1820ad7b9d4c5307691425d15adf845216602083015260408201520152565b037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08101845283610f72565b611c0660a435936084359351902061362a565b61366b565b91611c3f8373ffffffffffffffffffffffffffffffffffffffff166000526007602052604060002090815491600183019055565b14612a7e565b6131d6565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f4552433230566f7465733a207369676e617475726520657870697265640000006044820152fd5b346104365760e07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261043657600435611ce38161059c565b602435611cef8161059c565b6044359060643592611cff611af5565b93804211611df557611dd0611df091611bc7610d4d97611dbd611d4b8773ffffffffffffffffffffffffffffffffffffffff166000526007602052604060002090815491600183019055565b9360405193849160208301968c8c8c8a91959493909260a09360c08401977f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9855273ffffffffffffffffffffffffffffffffffffffff8092166020860152166040840152606083015260808201520152565b611c0660c4359360a4359351902061362a565b73ffffffffffffffffffffffffffffffffffffffff808416911614612ae3565b612b90565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f45524332305065726d69743a206578706972656420646561646c696e650000006044820152fd5b346104365760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610436576020611ee7600435611e938161059c565b73ffffffffffffffffffffffffffffffffffffffff60243591611eb58361059c565b166000526001835260406000209073ffffffffffffffffffffffffffffffffffffffff16600052602052604060002090565b54604051908152f35b346104365760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261043657611f27612a64565b50604051611f3481610efd565b73ffffffffffffffffffffffffffffffffffffffff9081600e5416815261038c604051611f6b81611f648161263a565b0382610f72565b6020830190815260405193849360208552511660208401525160408084015260608301906102ba565b63ffffffff81160361043657565b346104365760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261043657604061203361202d600435611fe58161059c565b73ffffffffffffffffffffffffffffffffffffffff6024359161200783611f94565b60006020875161201681610efd565b828152015216600052600a60205283600020612a1d565b50612b48565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff602083519263ffffffff81511684520151166020820152f35b346104365760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610436576004356120a48161059c565b6120ac61331c565b73ffffffffffffffffffffffffffffffffffffffff80911690811561211e57600c54827fffffffffffffffffffffffff0000000000000000000000000000000000000000821617600c55167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a3005b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152fd5b60607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610436576004356024356121db8161059c565b67ffffffffffffffff90604435828111610436576121fd903690600401611234565b9273ffffffffffffffffffffffffffffffffffffffff938461224661222c846000526010602052604060002090565b5473ffffffffffffffffffffffffffffffffffffffff1690565b166124165761225490613699565b91602060405180967fbe16d94a00000000000000000000000000000000000000000000000000000000825281600081612291898960048401612b79565b039286165af19384156107565761038c956000956123d9575b508492916122ef612396926122dc6122c0610fb3565b73ffffffffffffffffffffffffffffffffffffffff9094168452565b851667ffffffffffffffff166020830152565b612303836000526010602052604060002090565b815181547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff9190911617815590602001517fffffffff0000000000000000ffffffffffffffffffffffffffffffffffffffff7bffffffffffffffff000000000000000000000000000000000000000083549260a01b169116179055565b7f103ab115fdd2f05d2720873cd21aeff07c1206de37259cdeb99463da9ff512e0604051806123c63396826102fd565b0390a46040519081529081906020820190565b6122ef95509161240561239692949360203d60201161240f575b6123fd8183610f72565b810190612b6a565b95509192906122aa565b503d6123f3565b60046040517f339f7ff5000000000000000000000000000000000000000000000000000000008152fd5b346104365761244e36611027565b61245661331c565b805167ffffffffffffffff8111610f195761247b81612476600f546125e7565b6129ab565b602080601f83116001146124da575081906124ca936000926124cf575b50507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8260011b9260031b1c19161790565b600f55005b015190503880612498565b907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe083169361252b600f6000527f8d1108e10bcb7c27dddfc02ed9d693a074039d026cf4ea4240b40f7d581ac80290565b926000905b868210612585575050836001951061254e575b505050811b01600f55005b01517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60f88460031b161c19169055388080612543565b80600185968294968601518155019501930190612530565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b90600182018092116109b157565b919082039182116109b157565b90600182811c92168015612630575b602083101461260157565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b91607f16916125f6565b600f546000929161264a826125e7565b808252916020906001908181169081156126c9575060011461266d575b50505050565b92939450600f6000527f8d1108e10bcb7c27dddfc02ed9d693a074039d026cf4ea4240b40f7d581ac802926000935b8585106126b6575050506020925001019038808080612667565b805485850184015293820193810161269c565b91505060209495507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0091509291921683830152151560051b01019038808080612667565b60405190610fc08261271e8161263a565b0383610f72565b67ffffffffffffffff8111610f195760051b60200190565b6020808284031261043657815167ffffffffffffffff9283821161043657019260409283858303126104365783519461277586610efd565b8051865283810151918211610436570181601f820112156104365780519161279c83612725565b946127a981519687610f72565b8386528486019185606080960285010193818511610436578601925b8484106127d85750505050505082015290565b85848303126104365786869184516127ef81610f1e565b86516127fa8161059c565b81528287015161280981611f94565b838201528587015161281a81611f94565b868201528152019301926127c5565b602061030e918181520161263a565b6040513d6000823e3d90fd5b1561284b57565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f4552433230566f7465733a20667574757265206c6f6f6b7570000000000000006044820152fd5b600e5473ffffffffffffffffffffffffffffffffffffffff1615612900576040516128d381610efd565b600281527f6673000000000000000000000000000000000000000000000000000000000000602082015290565b60405161290c81610efd565b600481527f6970667300000000000000000000000000000000000000000000000000000000602082015290565b601f8111612945575050565b600090600d6000527fd7b6990105719101dabeb77144f2a3385c8033acd3af97e9423a695e81ad1eb5906020601f850160051c830194106129a1575b601f0160051c01915b82811061299657505050565b81815560010161298a565b9092508290612981565b601f81116129b7575050565b600090600f6000527f8d1108e10bcb7c27dddfc02ed9d693a074039d026cf4ea4240b40f7d581ac802906020601f850160051c83019410612a13575b601f0160051c01915b828110612a0857505050565b8181556001016129fc565b90925082906129f3565b8054821015612a355760005260206000200190600090565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60405190612a7182610efd565b6060602083600081520152565b15612a8557565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f4552433230566f7465733a20696e76616c6964206e6f6e6365000000000000006044820152fd5b15612aea57565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f45524332305065726d69743a20696e76616c6964207369676e617475726500006044820152fd5b90604051612b5581610efd565b602081935463ffffffff81168352811c910152565b90816020910312610436575190565b60409061030e9392815281602082015201906102ba565b9073ffffffffffffffffffffffffffffffffffffffff91828116928315612ccc578216938415612c485780612c327f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92594612c0d612c439573ffffffffffffffffffffffffffffffffffffffff166000526001602052604060002090565b9073ffffffffffffffffffffffffffffffffffffffff16600052602052604060002090565b556040519081529081906020820190565b0390a3565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f20616464726560448201527f73730000000000000000000000000000000000000000000000000000000000006064820152fd5b60846040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460448201527f72657373000000000000000000000000000000000000000000000000000000006064820152fd5b906020809201518051906020916040805195600080945b848610612da557505050505050601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe091828101855201168201604052565b909192939495838760051b8301015180518686830151920151813b808211612de6575082849392600195938e930394859301903c0196019493929190612d66565b9260849387937f86d14d89000000000000000000000000000000000000000000000000000000008552600452602452604452606452fd5b15612e2457565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201527f65737300000000000000000000000000000000000000000000000000000000006064820152fd5b15612eaf57565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206260448201527f616c616e636500000000000000000000000000000000000000000000000000006064820152fd5b919073ffffffffffffffffffffffffffffffffffffffff92838116801561302b57610fc094831690612f66821515612e1d565b84612f918473ffffffffffffffffffffffffffffffffffffffff166000526000602052604060002090565b54612f9e82821015612ea8565b03612fc98473ffffffffffffffffffffffffffffffffffffffff166000526000602052604060002090565b55612ff48473ffffffffffffffffffffffffffffffffffffffff166000526000602052604060002090565b8054860190556040518581527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90602090a3613e61565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f20616460448201527f64726573730000000000000000000000000000000000000000000000000000006064820152fd5b73ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000163014806131ad575b15613117577f000000000000000000000000000000000000000000000000000000000000000090565b60405160208101907f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f82527f000000000000000000000000000000000000000000000000000000000000000060408201527f000000000000000000000000000000000000000000000000000000000000000060608201524660808201523060a082015260a081526131a781610f56565b51902090565b507f000000000000000000000000000000000000000000000000000000000000000046146130ee565b610fc09173ffffffffffffffffffffffffffffffffffffffff80921660008181526009602052836040822054168092826020527f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f604084205496600960205261327d87604087209073ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffff0000000000000000000000000000000000000000825416179055565b86169380a4613939565b63ffffffff90818111613298571690565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203360448201527f32206269747300000000000000000000000000000000000000000000000000006064820152fd5b73ffffffffffffffffffffffffffffffffffffffff600c5416330361333d57565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b60ff81146133f15760ff811690601f82116133c757604051916133bd83610efd565b8252602082015290565b60046040517fb3512b0c000000000000000000000000000000000000000000000000000000008152fd5b50604051600554816000613404836125e7565b80835292602090600190818116908115613490575060011461342f575b505061030e92500382610f72565b91509260056000527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db0936000925b828410613478575061030e9450505081016020013880613421565b8554878501830152948501948694509281019261345d565b90506020935061030e9592507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0091501682840152151560051b8201013880613421565b60ff81146134f55760ff811690601f82116133c757604051916133bd83610efd565b50604051600654816000613508836125e7565b80835292602090600190818116908115613490575060011461353257505061030e92500382610f72565b91509260066000527ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f936000925b82841061357b575061030e9450505081016020013880613421565b85548785018301529485019486945092810192613560565b65ffffffffffff908181116135a6571690565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203460448201527f38206269747300000000000000000000000000000000000000000000000000006064820152fd5b6042906136356130af565b90604051917f19010000000000000000000000000000000000000000000000000000000000008352600283015260228201522090565b9161030e939161367a93613c10565b919091613cd8565b9061369560209282815194859201610297565b0190565b60405190816020600090600d54906136b0826125e7565b916001908181169081156137645750600114613703575b5050506136d79061030e93613682565b037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08101835282610f72565b90919250600d6000527fd7b6990105719101dabeb77144f2a3385c8033acd3af97e9423a695e81ad1eb5906000915b84831061374e57505050508101602001826136d761030e6136c7565b8054888401850152879550918301918101613732565b6136d795506020935061030e979492507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0091501682860152801515028401019181946136c7565b81156137b5570490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b801561391e57806138b76138b06138a661389c61389261388861387e613874600161030e9a6000908b60801c80613912575b508060401c80613905575b508060201c806138f8575b508060101c806138eb575b508060081c806138de575b508060041c806138d1575b508060021c806138c4575b50821c6138bd575b811c1b61386d818b6137ab565b0160011c90565b61386d818a6137ab565b61386d81896137ab565b61386d81886137ab565b61386d81876137ab565b61386d81866137ab565b61386d81856137ab565b80926137ab565b90613ea2565b8101613860565b6002915091019038613858565b600491509101903861384d565b6008915091019038613842565b6010915091019038613837565b602091509101903861382c565b6040915091019038613821565b91505060809038613816565b50600090565b90808216911860011c81018091116109b15790565b919073ffffffffffffffffffffffffffffffffffffffff80821693168381141580613c07575b6139695750505050565b806139e9575b508261397c575b80612667565b7fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a724916139cb6139d09273ffffffffffffffffffffffffffffffffffffffff16600052600a602052604060002090565b613f47565b60408051928352602083019190915290a2388080613976565b80600052600a6020527fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a7246040600020805480159182600014613bc657613a2d610fb3565b6000815260006020820152915b613a87613a6660208501517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1690565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1690565b92613a928985614100565b94159081613ba3575b5015613b2c57613ae1613b16927fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff613ad287614053565b93019060005260206000200190565b9063ffffffff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000000083549260201b169116179055565b604080519182526020820192909252a23861396f565b50613b9e90613b50613b4b613b4043613593565b65ffffffffffff1690565b613287565b90613b99613b5d86614053565b613b74613b68610fb3565b63ffffffff9095168552565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff166020840152565b613eb4565b613b16565b5163ffffffff16905063ffffffff613bbd613b4043613593565b91161438613a9b565b613c01613bfc7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff84018360005260206000200190565b612b48565b91613a3a565b5082151561395f565b9291907f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311613c935791608094939160ff602094604051948552168484015260408301526060820152600093849182805260015afa1561075657815173ffffffffffffffffffffffffffffffffffffffff811615613c8d579190565b50600190565b50505050600090600390565b60051115613ca957565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b613ce181613c9f565b80613ce95750565b613cf281613c9f565b60018103613d59576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606490fd5b613d6281613c9f565b60028103613dc9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606490fd5b80613dd5600392613c9f565b14613ddc57565b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608490fd5b90610fc0929173ffffffffffffffffffffffffffffffffffffffff809116600052600960205280806040600020541692166000526040600020541690613939565b9080821015613eaf575090565b905090565b805468010000000000000000811015610f1957613ed691600182018155612a1d565b613f1857815160209283015190921b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000001663ffffffff92909216919091179055565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052600060045260246000fd5b90918154918215928360001461401857613f5f610fb3565b60008152600060208201525b613fa1613f9a613a6660208401517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1690565b968761410d565b94159081613ff5575b5015613fe157613ae1610fc0927fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff613ad287614053565b50610fc090613b50613b4b613b4043613593565b5163ffffffff16905063ffffffff61400f613b4043613593565b91161438613faa565b61404e613bfc7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff83018460005260206000200190565b613f6b565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff9081811161407c571690565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602760248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203260448201527f32342062697473000000000000000000000000000000000000000000000000006064820152fd5b9081039081116109b15790565b9081018091116109b1579056fea2646970667358221220a1b72293258911740432ead70acaf62f4438edf3508dc718e0cda2266a0bd55964736f6c63430008160033dec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a724", } // ERC20UtilityAgentABI is the input ABI used to generate the binding from. // Deprecated: Use ERC20UtilityAgentMetaData.ABI instead. var ERC20UtilityAgentABI = ERC20UtilityAgentMetaData.ABI // ERC20UtilityAgentBin is the compiled bytecode used for deploying new contracts. // Deprecated: Use ERC20UtilityAgentMetaData.Bin instead. var ERC20UtilityAgentBin = ERC20UtilityAgentMetaData.Bin // DeployERC20UtilityAgent deploys a new Ethereum contract, binding an instance of ERC20UtilityAgent to it. func DeployERC20UtilityAgent(auth *bind.TransactOpts, backend bind.ContractBackend, name_ string, symbol_ string, amount_ *big.Int, recipient_ common.Address, systemPrompt_ string, storageInfo_ []byte) (common.Address, *types.Transaction, *ERC20UtilityAgent, error) { parsed, err := ERC20UtilityAgentMetaData.GetAbi() if err != nil { return common.Address{}, nil, nil, err } if parsed == nil { return common.Address{}, nil, nil, errors.New("GetABI returned nil") } address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(ERC20UtilityAgentBin), backend, name_, symbol_, amount_, recipient_, systemPrompt_, storageInfo_) if err != nil { return common.Address{}, nil, nil, err } return address, tx, &ERC20UtilityAgent{ERC20UtilityAgentCaller: ERC20UtilityAgentCaller{contract: contract}, ERC20UtilityAgentTransactor: ERC20UtilityAgentTransactor{contract: contract}, ERC20UtilityAgentFilterer: ERC20UtilityAgentFilterer{contract: contract}}, nil } // ERC20UtilityAgent is an auto generated Go binding around an Ethereum contract. type ERC20UtilityAgent struct { ERC20UtilityAgentCaller // Read-only binding to the contract ERC20UtilityAgentTransactor // Write-only binding to the contract ERC20UtilityAgentFilterer // Log filterer for contract events } // ERC20UtilityAgentCaller is an auto generated read-only Go binding around an Ethereum contract. type ERC20UtilityAgentCaller struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // ERC20UtilityAgentTransactor is an auto generated write-only Go binding around an Ethereum contract. type ERC20UtilityAgentTransactor struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // ERC20UtilityAgentFilterer is an auto generated log filtering Go binding around an Ethereum contract events. type ERC20UtilityAgentFilterer struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // ERC20UtilityAgentSession is an auto generated Go binding around an Ethereum contract, // with pre-set call and transact options. type ERC20UtilityAgentSession struct { Contract *ERC20UtilityAgent // Generic contract binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // ERC20UtilityAgentCallerSession is an auto generated read-only Go binding around an Ethereum contract, // with pre-set call options. type ERC20UtilityAgentCallerSession struct { Contract *ERC20UtilityAgentCaller // Generic contract caller binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session } // ERC20UtilityAgentTransactorSession is an auto generated write-only Go binding around an Ethereum contract, // with pre-set transact options. type ERC20UtilityAgentTransactorSession struct { Contract *ERC20UtilityAgentTransactor // Generic contract transactor binding to set the session for TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // ERC20UtilityAgentRaw is an auto generated low-level Go binding around an Ethereum contract. type ERC20UtilityAgentRaw struct { Contract *ERC20UtilityAgent // Generic contract binding to access the raw methods on } // ERC20UtilityAgentCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. type ERC20UtilityAgentCallerRaw struct { Contract *ERC20UtilityAgentCaller // Generic read-only contract binding to access the raw methods on } // ERC20UtilityAgentTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. type ERC20UtilityAgentTransactorRaw struct { Contract *ERC20UtilityAgentTransactor // Generic write-only contract binding to access the raw methods on } // NewERC20UtilityAgent creates a new instance of ERC20UtilityAgent, bound to a specific deployed contract. func NewERC20UtilityAgent(address common.Address, backend bind.ContractBackend) (*ERC20UtilityAgent, error) { contract, err := bindERC20UtilityAgent(address, backend, backend, backend) if err != nil { return nil, err } return &ERC20UtilityAgent{ERC20UtilityAgentCaller: ERC20UtilityAgentCaller{contract: contract}, ERC20UtilityAgentTransactor: ERC20UtilityAgentTransactor{contract: contract}, ERC20UtilityAgentFilterer: ERC20UtilityAgentFilterer{contract: contract}}, nil } // NewERC20UtilityAgentCaller creates a new read-only instance of ERC20UtilityAgent, bound to a specific deployed contract. func NewERC20UtilityAgentCaller(address common.Address, caller bind.ContractCaller) (*ERC20UtilityAgentCaller, error) { contract, err := bindERC20UtilityAgent(address, caller, nil, nil) if err != nil { return nil, err } return &ERC20UtilityAgentCaller{contract: contract}, nil } // NewERC20UtilityAgentTransactor creates a new write-only instance of ERC20UtilityAgent, bound to a specific deployed contract. func NewERC20UtilityAgentTransactor(address common.Address, transactor bind.ContractTransactor) (*ERC20UtilityAgentTransactor, error) { contract, err := bindERC20UtilityAgent(address, nil, transactor, nil) if err != nil { return nil, err } return &ERC20UtilityAgentTransactor{contract: contract}, nil } // NewERC20UtilityAgentFilterer creates a new log filterer instance of ERC20UtilityAgent, bound to a specific deployed contract. func NewERC20UtilityAgentFilterer(address common.Address, filterer bind.ContractFilterer) (*ERC20UtilityAgentFilterer, error) { contract, err := bindERC20UtilityAgent(address, nil, nil, filterer) if err != nil { return nil, err } return &ERC20UtilityAgentFilterer{contract: contract}, nil } // bindERC20UtilityAgent binds a generic wrapper to an already deployed contract. func bindERC20UtilityAgent(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { parsed, err := ERC20UtilityAgentMetaData.GetAbi() if err != nil { return nil, err } return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_ERC20UtilityAgent *ERC20UtilityAgentRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _ERC20UtilityAgent.Contract.ERC20UtilityAgentCaller.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_ERC20UtilityAgent *ERC20UtilityAgentRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _ERC20UtilityAgent.Contract.ERC20UtilityAgentTransactor.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_ERC20UtilityAgent *ERC20UtilityAgentRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _ERC20UtilityAgent.Contract.ERC20UtilityAgentTransactor.contract.Transact(opts, method, params...) } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_ERC20UtilityAgent *ERC20UtilityAgentCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _ERC20UtilityAgent.Contract.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_ERC20UtilityAgent *ERC20UtilityAgentTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _ERC20UtilityAgent.Contract.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_ERC20UtilityAgent *ERC20UtilityAgentTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _ERC20UtilityAgent.Contract.contract.Transact(opts, method, params...) } // CLOCKMODE is a free data retrieval call binding the contract method 0x4bf5d7e9. // // Solidity: function CLOCK_MODE() view returns(string) func (_ERC20UtilityAgent *ERC20UtilityAgentCaller) CLOCKMODE(opts *bind.CallOpts) (string, error) { var out []interface{} err := _ERC20UtilityAgent.contract.Call(opts, &out, "CLOCK_MODE") if err != nil { return *new(string), err } out0 := *abi.ConvertType(out[0], new(string)).(*string) return out0, err } // CLOCKMODE is a free data retrieval call binding the contract method 0x4bf5d7e9. // // Solidity: function CLOCK_MODE() view returns(string) func (_ERC20UtilityAgent *ERC20UtilityAgentSession) CLOCKMODE() (string, error) { return _ERC20UtilityAgent.Contract.CLOCKMODE(&_ERC20UtilityAgent.CallOpts) } // CLOCKMODE is a free data retrieval call binding the contract method 0x4bf5d7e9. // // Solidity: function CLOCK_MODE() view returns(string) func (_ERC20UtilityAgent *ERC20UtilityAgentCallerSession) CLOCKMODE() (string, error) { return _ERC20UtilityAgent.Contract.CLOCKMODE(&_ERC20UtilityAgent.CallOpts) } // DOMAINSEPARATOR is a free data retrieval call binding the contract method 0x3644e515. // // Solidity: function DOMAIN_SEPARATOR() view returns(bytes32) func (_ERC20UtilityAgent *ERC20UtilityAgentCaller) DOMAINSEPARATOR(opts *bind.CallOpts) ([32]byte, error) { var out []interface{} err := _ERC20UtilityAgent.contract.Call(opts, &out, "DOMAIN_SEPARATOR") if err != nil { return *new([32]byte), err } out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) return out0, err } // DOMAINSEPARATOR is a free data retrieval call binding the contract method 0x3644e515. // // Solidity: function DOMAIN_SEPARATOR() view returns(bytes32) func (_ERC20UtilityAgent *ERC20UtilityAgentSession) DOMAINSEPARATOR() ([32]byte, error) { return _ERC20UtilityAgent.Contract.DOMAINSEPARATOR(&_ERC20UtilityAgent.CallOpts) } // DOMAINSEPARATOR is a free data retrieval call binding the contract method 0x3644e515. // // Solidity: function DOMAIN_SEPARATOR() view returns(bytes32) func (_ERC20UtilityAgent *ERC20UtilityAgentCallerSession) DOMAINSEPARATOR() ([32]byte, error) { return _ERC20UtilityAgent.Contract.DOMAINSEPARATOR(&_ERC20UtilityAgent.CallOpts) } // Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. // // Solidity: function allowance(address owner, address spender) view returns(uint256) func (_ERC20UtilityAgent *ERC20UtilityAgentCaller) Allowance(opts *bind.CallOpts, owner common.Address, spender common.Address) (*big.Int, error) { var out []interface{} err := _ERC20UtilityAgent.contract.Call(opts, &out, "allowance", owner, spender) if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. // // Solidity: function allowance(address owner, address spender) view returns(uint256) func (_ERC20UtilityAgent *ERC20UtilityAgentSession) Allowance(owner common.Address, spender common.Address) (*big.Int, error) { return _ERC20UtilityAgent.Contract.Allowance(&_ERC20UtilityAgent.CallOpts, owner, spender) } // Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. // // Solidity: function allowance(address owner, address spender) view returns(uint256) func (_ERC20UtilityAgent *ERC20UtilityAgentCallerSession) Allowance(owner common.Address, spender common.Address) (*big.Int, error) { return _ERC20UtilityAgent.Contract.Allowance(&_ERC20UtilityAgent.CallOpts, owner, spender) } // BalanceOf is a free data retrieval call binding the contract method 0x70a08231. // // Solidity: function balanceOf(address account) view returns(uint256) func (_ERC20UtilityAgent *ERC20UtilityAgentCaller) BalanceOf(opts *bind.CallOpts, account common.Address) (*big.Int, error) { var out []interface{} err := _ERC20UtilityAgent.contract.Call(opts, &out, "balanceOf", account) if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // BalanceOf is a free data retrieval call binding the contract method 0x70a08231. // // Solidity: function balanceOf(address account) view returns(uint256) func (_ERC20UtilityAgent *ERC20UtilityAgentSession) BalanceOf(account common.Address) (*big.Int, error) { return _ERC20UtilityAgent.Contract.BalanceOf(&_ERC20UtilityAgent.CallOpts, account) } // BalanceOf is a free data retrieval call binding the contract method 0x70a08231. // // Solidity: function balanceOf(address account) view returns(uint256) func (_ERC20UtilityAgent *ERC20UtilityAgentCallerSession) BalanceOf(account common.Address) (*big.Int, error) { return _ERC20UtilityAgent.Contract.BalanceOf(&_ERC20UtilityAgent.CallOpts, account) } // Checkpoints is a free data retrieval call binding the contract method 0xf1127ed8. // // Solidity: function checkpoints(address account, uint32 pos) view returns((uint32,uint224)) func (_ERC20UtilityAgent *ERC20UtilityAgentCaller) Checkpoints(opts *bind.CallOpts, account common.Address, pos uint32) (ERC20VotesCheckpoint, error) { var out []interface{} err := _ERC20UtilityAgent.contract.Call(opts, &out, "checkpoints", account, pos) if err != nil { return *new(ERC20VotesCheckpoint), err } out0 := *abi.ConvertType(out[0], new(ERC20VotesCheckpoint)).(*ERC20VotesCheckpoint) return out0, err } // Checkpoints is a free data retrieval call binding the contract method 0xf1127ed8. // // Solidity: function checkpoints(address account, uint32 pos) view returns((uint32,uint224)) func (_ERC20UtilityAgent *ERC20UtilityAgentSession) Checkpoints(account common.Address, pos uint32) (ERC20VotesCheckpoint, error) { return _ERC20UtilityAgent.Contract.Checkpoints(&_ERC20UtilityAgent.CallOpts, account, pos) } // Checkpoints is a free data retrieval call binding the contract method 0xf1127ed8. // // Solidity: function checkpoints(address account, uint32 pos) view returns((uint32,uint224)) func (_ERC20UtilityAgent *ERC20UtilityAgentCallerSession) Checkpoints(account common.Address, pos uint32) (ERC20VotesCheckpoint, error) { return _ERC20UtilityAgent.Contract.Checkpoints(&_ERC20UtilityAgent.CallOpts, account, pos) } // Clock is a free data retrieval call binding the contract method 0x91ddadf4. // // Solidity: function clock() view returns(uint48) func (_ERC20UtilityAgent *ERC20UtilityAgentCaller) Clock(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} err := _ERC20UtilityAgent.contract.Call(opts, &out, "clock") if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // Clock is a free data retrieval call binding the contract method 0x91ddadf4. // // Solidity: function clock() view returns(uint48) func (_ERC20UtilityAgent *ERC20UtilityAgentSession) Clock() (*big.Int, error) { return _ERC20UtilityAgent.Contract.Clock(&_ERC20UtilityAgent.CallOpts) } // Clock is a free data retrieval call binding the contract method 0x91ddadf4. // // Solidity: function clock() view returns(uint48) func (_ERC20UtilityAgent *ERC20UtilityAgentCallerSession) Clock() (*big.Int, error) { return _ERC20UtilityAgent.Contract.Clock(&_ERC20UtilityAgent.CallOpts) } // Decimals is a free data retrieval call binding the contract method 0x313ce567. // // Solidity: function decimals() view returns(uint8) func (_ERC20UtilityAgent *ERC20UtilityAgentCaller) Decimals(opts *bind.CallOpts) (uint8, error) { var out []interface{} err := _ERC20UtilityAgent.contract.Call(opts, &out, "decimals") if err != nil { return *new(uint8), err } out0 := *abi.ConvertType(out[0], new(uint8)).(*uint8) return out0, err } // Decimals is a free data retrieval call binding the contract method 0x313ce567. // // Solidity: function decimals() view returns(uint8) func (_ERC20UtilityAgent *ERC20UtilityAgentSession) Decimals() (uint8, error) { return _ERC20UtilityAgent.Contract.Decimals(&_ERC20UtilityAgent.CallOpts) } // Decimals is a free data retrieval call binding the contract method 0x313ce567. // // Solidity: function decimals() view returns(uint8) func (_ERC20UtilityAgent *ERC20UtilityAgentCallerSession) Decimals() (uint8, error) { return _ERC20UtilityAgent.Contract.Decimals(&_ERC20UtilityAgent.CallOpts) } // Delegates is a free data retrieval call binding the contract method 0x587cde1e. // // Solidity: function delegates(address account) view returns(address) func (_ERC20UtilityAgent *ERC20UtilityAgentCaller) Delegates(opts *bind.CallOpts, account common.Address) (common.Address, error) { var out []interface{} err := _ERC20UtilityAgent.contract.Call(opts, &out, "delegates", account) if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // Delegates is a free data retrieval call binding the contract method 0x587cde1e. // // Solidity: function delegates(address account) view returns(address) func (_ERC20UtilityAgent *ERC20UtilityAgentSession) Delegates(account common.Address) (common.Address, error) { return _ERC20UtilityAgent.Contract.Delegates(&_ERC20UtilityAgent.CallOpts, account) } // Delegates is a free data retrieval call binding the contract method 0x587cde1e. // // Solidity: function delegates(address account) view returns(address) func (_ERC20UtilityAgent *ERC20UtilityAgentCallerSession) Delegates(account common.Address) (common.Address, error) { return _ERC20UtilityAgent.Contract.Delegates(&_ERC20UtilityAgent.CallOpts, account) } // Eip712Domain is a free data retrieval call binding the contract method 0x84b0196e. // // Solidity: function eip712Domain() view returns(bytes1 fields, string name, string version, uint256 chainId, address verifyingContract, bytes32 salt, uint256[] extensions) func (_ERC20UtilityAgent *ERC20UtilityAgentCaller) Eip712Domain(opts *bind.CallOpts) (struct { Fields [1]byte Name string Version string ChainId *big.Int VerifyingContract common.Address Salt [32]byte Extensions []*big.Int }, error) { var out []interface{} err := _ERC20UtilityAgent.contract.Call(opts, &out, "eip712Domain") outstruct := new(struct { Fields [1]byte Name string Version string ChainId *big.Int VerifyingContract common.Address Salt [32]byte Extensions []*big.Int }) if err != nil { return *outstruct, err } outstruct.Fields = *abi.ConvertType(out[0], new([1]byte)).(*[1]byte) outstruct.Name = *abi.ConvertType(out[1], new(string)).(*string) outstruct.Version = *abi.ConvertType(out[2], new(string)).(*string) outstruct.ChainId = *abi.ConvertType(out[3], new(*big.Int)).(**big.Int) outstruct.VerifyingContract = *abi.ConvertType(out[4], new(common.Address)).(*common.Address) outstruct.Salt = *abi.ConvertType(out[5], new([32]byte)).(*[32]byte) outstruct.Extensions = *abi.ConvertType(out[6], new([]*big.Int)).(*[]*big.Int) return *outstruct, err } // Eip712Domain is a free data retrieval call binding the contract method 0x84b0196e. // // Solidity: function eip712Domain() view returns(bytes1 fields, string name, string version, uint256 chainId, address verifyingContract, bytes32 salt, uint256[] extensions) func (_ERC20UtilityAgent *ERC20UtilityAgentSession) Eip712Domain() (struct { Fields [1]byte Name string Version string ChainId *big.Int VerifyingContract common.Address Salt [32]byte Extensions []*big.Int }, error) { return _ERC20UtilityAgent.Contract.Eip712Domain(&_ERC20UtilityAgent.CallOpts) } // Eip712Domain is a free data retrieval call binding the contract method 0x84b0196e. // // Solidity: function eip712Domain() view returns(bytes1 fields, string name, string version, uint256 chainId, address verifyingContract, bytes32 salt, uint256[] extensions) func (_ERC20UtilityAgent *ERC20UtilityAgentCallerSession) Eip712Domain() (struct { Fields [1]byte Name string Version string ChainId *big.Int VerifyingContract common.Address Salt [32]byte Extensions []*big.Int }, error) { return _ERC20UtilityAgent.Contract.Eip712Domain(&_ERC20UtilityAgent.CallOpts) } // FetchCode is a free data retrieval call binding the contract method 0x1d959e5d. // // Solidity: function fetchCode() view returns(string logic) func (_ERC20UtilityAgent *ERC20UtilityAgentCaller) FetchCode(opts *bind.CallOpts) (string, error) { var out []interface{} err := _ERC20UtilityAgent.contract.Call(opts, &out, "fetchCode") if err != nil { return *new(string), err } out0 := *abi.ConvertType(out[0], new(string)).(*string) return out0, err } // FetchCode is a free data retrieval call binding the contract method 0x1d959e5d. // // Solidity: function fetchCode() view returns(string logic) func (_ERC20UtilityAgent *ERC20UtilityAgentSession) FetchCode() (string, error) { return _ERC20UtilityAgent.Contract.FetchCode(&_ERC20UtilityAgent.CallOpts) } // FetchCode is a free data retrieval call binding the contract method 0x1d959e5d. // // Solidity: function fetchCode() view returns(string logic) func (_ERC20UtilityAgent *ERC20UtilityAgentCallerSession) FetchCode() (string, error) { return _ERC20UtilityAgent.Contract.FetchCode(&_ERC20UtilityAgent.CallOpts) } // GetFileStorageChunkInfo is a free data retrieval call binding the contract method 0xb213c508. // // Solidity: function getFileStorageChunkInfo() view returns((uint256,(address,uint32,uint32)[]) file) func (_ERC20UtilityAgent *ERC20UtilityAgentCaller) GetFileStorageChunkInfo(opts *bind.CallOpts) (File, error) { var out []interface{} err := _ERC20UtilityAgent.contract.Call(opts, &out, "getFileStorageChunkInfo") if err != nil { return *new(File), err } out0 := *abi.ConvertType(out[0], new(File)).(*File) return out0, err } // GetFileStorageChunkInfo is a free data retrieval call binding the contract method 0xb213c508. // // Solidity: function getFileStorageChunkInfo() view returns((uint256,(address,uint32,uint32)[]) file) func (_ERC20UtilityAgent *ERC20UtilityAgentSession) GetFileStorageChunkInfo() (File, error) { return _ERC20UtilityAgent.Contract.GetFileStorageChunkInfo(&_ERC20UtilityAgent.CallOpts) } // GetFileStorageChunkInfo is a free data retrieval call binding the contract method 0xb213c508. // // Solidity: function getFileStorageChunkInfo() view returns((uint256,(address,uint32,uint32)[]) file) func (_ERC20UtilityAgent *ERC20UtilityAgentCallerSession) GetFileStorageChunkInfo() (File, error) { return _ERC20UtilityAgent.Contract.GetFileStorageChunkInfo(&_ERC20UtilityAgent.CallOpts) } // GetPastTotalSupply is a free data retrieval call binding the contract method 0x8e539e8c. // // Solidity: function getPastTotalSupply(uint256 timepoint) view returns(uint256) func (_ERC20UtilityAgent *ERC20UtilityAgentCaller) GetPastTotalSupply(opts *bind.CallOpts, timepoint *big.Int) (*big.Int, error) { var out []interface{} err := _ERC20UtilityAgent.contract.Call(opts, &out, "getPastTotalSupply", timepoint) if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // GetPastTotalSupply is a free data retrieval call binding the contract method 0x8e539e8c. // // Solidity: function getPastTotalSupply(uint256 timepoint) view returns(uint256) func (_ERC20UtilityAgent *ERC20UtilityAgentSession) GetPastTotalSupply(timepoint *big.Int) (*big.Int, error) { return _ERC20UtilityAgent.Contract.GetPastTotalSupply(&_ERC20UtilityAgent.CallOpts, timepoint) } // GetPastTotalSupply is a free data retrieval call binding the contract method 0x8e539e8c. // // Solidity: function getPastTotalSupply(uint256 timepoint) view returns(uint256) func (_ERC20UtilityAgent *ERC20UtilityAgentCallerSession) GetPastTotalSupply(timepoint *big.Int) (*big.Int, error) { return _ERC20UtilityAgent.Contract.GetPastTotalSupply(&_ERC20UtilityAgent.CallOpts, timepoint) } // GetPastVotes is a free data retrieval call binding the contract method 0x3a46b1a8. // // Solidity: function getPastVotes(address account, uint256 timepoint) view returns(uint256) func (_ERC20UtilityAgent *ERC20UtilityAgentCaller) GetPastVotes(opts *bind.CallOpts, account common.Address, timepoint *big.Int) (*big.Int, error) { var out []interface{} err := _ERC20UtilityAgent.contract.Call(opts, &out, "getPastVotes", account, timepoint) if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // GetPastVotes is a free data retrieval call binding the contract method 0x3a46b1a8. // // Solidity: function getPastVotes(address account, uint256 timepoint) view returns(uint256) func (_ERC20UtilityAgent *ERC20UtilityAgentSession) GetPastVotes(account common.Address, timepoint *big.Int) (*big.Int, error) { return _ERC20UtilityAgent.Contract.GetPastVotes(&_ERC20UtilityAgent.CallOpts, account, timepoint) } // GetPastVotes is a free data retrieval call binding the contract method 0x3a46b1a8. // // Solidity: function getPastVotes(address account, uint256 timepoint) view returns(uint256) func (_ERC20UtilityAgent *ERC20UtilityAgentCallerSession) GetPastVotes(account common.Address, timepoint *big.Int) (*big.Int, error) { return _ERC20UtilityAgent.Contract.GetPastVotes(&_ERC20UtilityAgent.CallOpts, account, timepoint) } // GetResultById is a free data retrieval call binding the contract method 0x08112bdf. // // Solidity: function getResultById(uint256 id) view returns(bytes) func (_ERC20UtilityAgent *ERC20UtilityAgentCaller) GetResultById(opts *bind.CallOpts, id *big.Int) ([]byte, error) { var out []interface{} err := _ERC20UtilityAgent.contract.Call(opts, &out, "getResultById", id) if err != nil { return *new([]byte), err } out0 := *abi.ConvertType(out[0], new([]byte)).(*[]byte) return out0, err } // GetResultById is a free data retrieval call binding the contract method 0x08112bdf. // // Solidity: function getResultById(uint256 id) view returns(bytes) func (_ERC20UtilityAgent *ERC20UtilityAgentSession) GetResultById(id *big.Int) ([]byte, error) { return _ERC20UtilityAgent.Contract.GetResultById(&_ERC20UtilityAgent.CallOpts, id) } // GetResultById is a free data retrieval call binding the contract method 0x08112bdf. // // Solidity: function getResultById(uint256 id) view returns(bytes) func (_ERC20UtilityAgent *ERC20UtilityAgentCallerSession) GetResultById(id *big.Int) ([]byte, error) { return _ERC20UtilityAgent.Contract.GetResultById(&_ERC20UtilityAgent.CallOpts, id) } // GetResultById0 is a free data retrieval call binding the contract method 0x365bec7f. // // Solidity: function getResultById(bytes32 uuid) view returns(bytes) func (_ERC20UtilityAgent *ERC20UtilityAgentCaller) GetResultById0(opts *bind.CallOpts, uuid [32]byte) ([]byte, error) { var out []interface{} err := _ERC20UtilityAgent.contract.Call(opts, &out, "getResultById0", uuid) if err != nil { return *new([]byte), err } out0 := *abi.ConvertType(out[0], new([]byte)).(*[]byte) return out0, err } // GetResultById0 is a free data retrieval call binding the contract method 0x365bec7f. // // Solidity: function getResultById(bytes32 uuid) view returns(bytes) func (_ERC20UtilityAgent *ERC20UtilityAgentSession) GetResultById0(uuid [32]byte) ([]byte, error) { return _ERC20UtilityAgent.Contract.GetResultById0(&_ERC20UtilityAgent.CallOpts, uuid) } // GetResultById0 is a free data retrieval call binding the contract method 0x365bec7f. // // Solidity: function getResultById(bytes32 uuid) view returns(bytes) func (_ERC20UtilityAgent *ERC20UtilityAgentCallerSession) GetResultById0(uuid [32]byte) ([]byte, error) { return _ERC20UtilityAgent.Contract.GetResultById0(&_ERC20UtilityAgent.CallOpts, uuid) } // GetStorageInfo is a free data retrieval call binding the contract method 0xe702c420. // // Solidity: function getStorageInfo() view returns((address,string)) func (_ERC20UtilityAgent *ERC20UtilityAgentCaller) GetStorageInfo(opts *bind.CallOpts) (IUtilityAgentStorageInfo, error) { var out []interface{} err := _ERC20UtilityAgent.contract.Call(opts, &out, "getStorageInfo") if err != nil { return *new(IUtilityAgentStorageInfo), err } out0 := *abi.ConvertType(out[0], new(IUtilityAgentStorageInfo)).(*IUtilityAgentStorageInfo) return out0, err } // GetStorageInfo is a free data retrieval call binding the contract method 0xe702c420. // // Solidity: function getStorageInfo() view returns((address,string)) func (_ERC20UtilityAgent *ERC20UtilityAgentSession) GetStorageInfo() (IUtilityAgentStorageInfo, error) { return _ERC20UtilityAgent.Contract.GetStorageInfo(&_ERC20UtilityAgent.CallOpts) } // GetStorageInfo is a free data retrieval call binding the contract method 0xe702c420. // // Solidity: function getStorageInfo() view returns((address,string)) func (_ERC20UtilityAgent *ERC20UtilityAgentCallerSession) GetStorageInfo() (IUtilityAgentStorageInfo, error) { return _ERC20UtilityAgent.Contract.GetStorageInfo(&_ERC20UtilityAgent.CallOpts) } // GetStorageMode is a free data retrieval call binding the contract method 0x481622f9. // // Solidity: function getStorageMode() view returns(string) func (_ERC20UtilityAgent *ERC20UtilityAgentCaller) GetStorageMode(opts *bind.CallOpts) (string, error) { var out []interface{} err := _ERC20UtilityAgent.contract.Call(opts, &out, "getStorageMode") if err != nil { return *new(string), err } out0 := *abi.ConvertType(out[0], new(string)).(*string) return out0, err } // GetStorageMode is a free data retrieval call binding the contract method 0x481622f9. // // Solidity: function getStorageMode() view returns(string) func (_ERC20UtilityAgent *ERC20UtilityAgentSession) GetStorageMode() (string, error) { return _ERC20UtilityAgent.Contract.GetStorageMode(&_ERC20UtilityAgent.CallOpts) } // GetStorageMode is a free data retrieval call binding the contract method 0x481622f9. // // Solidity: function getStorageMode() view returns(string) func (_ERC20UtilityAgent *ERC20UtilityAgentCallerSession) GetStorageMode() (string, error) { return _ERC20UtilityAgent.Contract.GetStorageMode(&_ERC20UtilityAgent.CallOpts) } // GetSystemPrompt is a free data retrieval call binding the contract method 0x07679a64. // // Solidity: function getSystemPrompt() view returns(string) func (_ERC20UtilityAgent *ERC20UtilityAgentCaller) GetSystemPrompt(opts *bind.CallOpts) (string, error) { var out []interface{} err := _ERC20UtilityAgent.contract.Call(opts, &out, "getSystemPrompt") if err != nil { return *new(string), err } out0 := *abi.ConvertType(out[0], new(string)).(*string) return out0, err } // GetSystemPrompt is a free data retrieval call binding the contract method 0x07679a64. // // Solidity: function getSystemPrompt() view returns(string) func (_ERC20UtilityAgent *ERC20UtilityAgentSession) GetSystemPrompt() (string, error) { return _ERC20UtilityAgent.Contract.GetSystemPrompt(&_ERC20UtilityAgent.CallOpts) } // GetSystemPrompt is a free data retrieval call binding the contract method 0x07679a64. // // Solidity: function getSystemPrompt() view returns(string) func (_ERC20UtilityAgent *ERC20UtilityAgentCallerSession) GetSystemPrompt() (string, error) { return _ERC20UtilityAgent.Contract.GetSystemPrompt(&_ERC20UtilityAgent.CallOpts) } // GetVotes is a free data retrieval call binding the contract method 0x9ab24eb0. // // Solidity: function getVotes(address account) view returns(uint256) func (_ERC20UtilityAgent *ERC20UtilityAgentCaller) GetVotes(opts *bind.CallOpts, account common.Address) (*big.Int, error) { var out []interface{} err := _ERC20UtilityAgent.contract.Call(opts, &out, "getVotes", account) if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // GetVotes is a free data retrieval call binding the contract method 0x9ab24eb0. // // Solidity: function getVotes(address account) view returns(uint256) func (_ERC20UtilityAgent *ERC20UtilityAgentSession) GetVotes(account common.Address) (*big.Int, error) { return _ERC20UtilityAgent.Contract.GetVotes(&_ERC20UtilityAgent.CallOpts, account) } // GetVotes is a free data retrieval call binding the contract method 0x9ab24eb0. // // Solidity: function getVotes(address account) view returns(uint256) func (_ERC20UtilityAgent *ERC20UtilityAgentCallerSession) GetVotes(account common.Address) (*big.Int, error) { return _ERC20UtilityAgent.Contract.GetVotes(&_ERC20UtilityAgent.CallOpts, account) } // Name is a free data retrieval call binding the contract method 0x06fdde03. // // Solidity: function name() view returns(string) func (_ERC20UtilityAgent *ERC20UtilityAgentCaller) Name(opts *bind.CallOpts) (string, error) { var out []interface{} err := _ERC20UtilityAgent.contract.Call(opts, &out, "name") if err != nil { return *new(string), err } out0 := *abi.ConvertType(out[0], new(string)).(*string) return out0, err } // Name is a free data retrieval call binding the contract method 0x06fdde03. // // Solidity: function name() view returns(string) func (_ERC20UtilityAgent *ERC20UtilityAgentSession) Name() (string, error) { return _ERC20UtilityAgent.Contract.Name(&_ERC20UtilityAgent.CallOpts) } // Name is a free data retrieval call binding the contract method 0x06fdde03. // // Solidity: function name() view returns(string) func (_ERC20UtilityAgent *ERC20UtilityAgentCallerSession) Name() (string, error) { return _ERC20UtilityAgent.Contract.Name(&_ERC20UtilityAgent.CallOpts) } // Nonces is a free data retrieval call binding the contract method 0x7ecebe00. // // Solidity: function nonces(address owner) view returns(uint256) func (_ERC20UtilityAgent *ERC20UtilityAgentCaller) Nonces(opts *bind.CallOpts, owner common.Address) (*big.Int, error) { var out []interface{} err := _ERC20UtilityAgent.contract.Call(opts, &out, "nonces", owner) if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // Nonces is a free data retrieval call binding the contract method 0x7ecebe00. // // Solidity: function nonces(address owner) view returns(uint256) func (_ERC20UtilityAgent *ERC20UtilityAgentSession) Nonces(owner common.Address) (*big.Int, error) { return _ERC20UtilityAgent.Contract.Nonces(&_ERC20UtilityAgent.CallOpts, owner) } // Nonces is a free data retrieval call binding the contract method 0x7ecebe00. // // Solidity: function nonces(address owner) view returns(uint256) func (_ERC20UtilityAgent *ERC20UtilityAgentCallerSession) Nonces(owner common.Address) (*big.Int, error) { return _ERC20UtilityAgent.Contract.Nonces(&_ERC20UtilityAgent.CallOpts, owner) } // NumCheckpoints is a free data retrieval call binding the contract method 0x6fcfff45. // // Solidity: function numCheckpoints(address account) view returns(uint32) func (_ERC20UtilityAgent *ERC20UtilityAgentCaller) NumCheckpoints(opts *bind.CallOpts, account common.Address) (uint32, error) { var out []interface{} err := _ERC20UtilityAgent.contract.Call(opts, &out, "numCheckpoints", account) if err != nil { return *new(uint32), err } out0 := *abi.ConvertType(out[0], new(uint32)).(*uint32) return out0, err } // NumCheckpoints is a free data retrieval call binding the contract method 0x6fcfff45. // // Solidity: function numCheckpoints(address account) view returns(uint32) func (_ERC20UtilityAgent *ERC20UtilityAgentSession) NumCheckpoints(account common.Address) (uint32, error) { return _ERC20UtilityAgent.Contract.NumCheckpoints(&_ERC20UtilityAgent.CallOpts, account) } // NumCheckpoints is a free data retrieval call binding the contract method 0x6fcfff45. // // Solidity: function numCheckpoints(address account) view returns(uint32) func (_ERC20UtilityAgent *ERC20UtilityAgentCallerSession) NumCheckpoints(account common.Address) (uint32, error) { return _ERC20UtilityAgent.Contract.NumCheckpoints(&_ERC20UtilityAgent.CallOpts, account) } // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. // // Solidity: function owner() view returns(address) func (_ERC20UtilityAgent *ERC20UtilityAgentCaller) Owner(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _ERC20UtilityAgent.contract.Call(opts, &out, "owner") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. // // Solidity: function owner() view returns(address) func (_ERC20UtilityAgent *ERC20UtilityAgentSession) Owner() (common.Address, error) { return _ERC20UtilityAgent.Contract.Owner(&_ERC20UtilityAgent.CallOpts) } // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. // // Solidity: function owner() view returns(address) func (_ERC20UtilityAgent *ERC20UtilityAgentCallerSession) Owner() (common.Address, error) { return _ERC20UtilityAgent.Contract.Owner(&_ERC20UtilityAgent.CallOpts) } // Symbol is a free data retrieval call binding the contract method 0x95d89b41. // // Solidity: function symbol() view returns(string) func (_ERC20UtilityAgent *ERC20UtilityAgentCaller) Symbol(opts *bind.CallOpts) (string, error) { var out []interface{} err := _ERC20UtilityAgent.contract.Call(opts, &out, "symbol") if err != nil { return *new(string), err } out0 := *abi.ConvertType(out[0], new(string)).(*string) return out0, err } // Symbol is a free data retrieval call binding the contract method 0x95d89b41. // // Solidity: function symbol() view returns(string) func (_ERC20UtilityAgent *ERC20UtilityAgentSession) Symbol() (string, error) { return _ERC20UtilityAgent.Contract.Symbol(&_ERC20UtilityAgent.CallOpts) } // Symbol is a free data retrieval call binding the contract method 0x95d89b41. // // Solidity: function symbol() view returns(string) func (_ERC20UtilityAgent *ERC20UtilityAgentCallerSession) Symbol() (string, error) { return _ERC20UtilityAgent.Contract.Symbol(&_ERC20UtilityAgent.CallOpts) } // TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. // // Solidity: function totalSupply() view returns(uint256) func (_ERC20UtilityAgent *ERC20UtilityAgentCaller) TotalSupply(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} err := _ERC20UtilityAgent.contract.Call(opts, &out, "totalSupply") if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. // // Solidity: function totalSupply() view returns(uint256) func (_ERC20UtilityAgent *ERC20UtilityAgentSession) TotalSupply() (*big.Int, error) { return _ERC20UtilityAgent.Contract.TotalSupply(&_ERC20UtilityAgent.CallOpts) } // TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. // // Solidity: function totalSupply() view returns(uint256) func (_ERC20UtilityAgent *ERC20UtilityAgentCallerSession) TotalSupply() (*big.Int, error) { return _ERC20UtilityAgent.Contract.TotalSupply(&_ERC20UtilityAgent.CallOpts) } // Approve is a paid mutator transaction binding the contract method 0x095ea7b3. // // Solidity: function approve(address spender, uint256 amount) returns(bool) func (_ERC20UtilityAgent *ERC20UtilityAgentTransactor) Approve(opts *bind.TransactOpts, spender common.Address, amount *big.Int) (*types.Transaction, error) { return _ERC20UtilityAgent.contract.Transact(opts, "approve", spender, amount) } // Approve is a paid mutator transaction binding the contract method 0x095ea7b3. // // Solidity: function approve(address spender, uint256 amount) returns(bool) func (_ERC20UtilityAgent *ERC20UtilityAgentSession) Approve(spender common.Address, amount *big.Int) (*types.Transaction, error) { return _ERC20UtilityAgent.Contract.Approve(&_ERC20UtilityAgent.TransactOpts, spender, amount) } // Approve is a paid mutator transaction binding the contract method 0x095ea7b3. // // Solidity: function approve(address spender, uint256 amount) returns(bool) func (_ERC20UtilityAgent *ERC20UtilityAgentTransactorSession) Approve(spender common.Address, amount *big.Int) (*types.Transaction, error) { return _ERC20UtilityAgent.Contract.Approve(&_ERC20UtilityAgent.TransactOpts, spender, amount) } // DecreaseAllowance is a paid mutator transaction binding the contract method 0xa457c2d7. // // Solidity: function decreaseAllowance(address spender, uint256 subtractedValue) returns(bool) func (_ERC20UtilityAgent *ERC20UtilityAgentTransactor) DecreaseAllowance(opts *bind.TransactOpts, spender common.Address, subtractedValue *big.Int) (*types.Transaction, error) { return _ERC20UtilityAgent.contract.Transact(opts, "decreaseAllowance", spender, subtractedValue) } // DecreaseAllowance is a paid mutator transaction binding the contract method 0xa457c2d7. // // Solidity: function decreaseAllowance(address spender, uint256 subtractedValue) returns(bool) func (_ERC20UtilityAgent *ERC20UtilityAgentSession) DecreaseAllowance(spender common.Address, subtractedValue *big.Int) (*types.Transaction, error) { return _ERC20UtilityAgent.Contract.DecreaseAllowance(&_ERC20UtilityAgent.TransactOpts, spender, subtractedValue) } // DecreaseAllowance is a paid mutator transaction binding the contract method 0xa457c2d7. // // Solidity: function decreaseAllowance(address spender, uint256 subtractedValue) returns(bool) func (_ERC20UtilityAgent *ERC20UtilityAgentTransactorSession) DecreaseAllowance(spender common.Address, subtractedValue *big.Int) (*types.Transaction, error) { return _ERC20UtilityAgent.Contract.DecreaseAllowance(&_ERC20UtilityAgent.TransactOpts, spender, subtractedValue) } // Delegate is a paid mutator transaction binding the contract method 0x5c19a95c. // // Solidity: function delegate(address delegatee) returns() func (_ERC20UtilityAgent *ERC20UtilityAgentTransactor) Delegate(opts *bind.TransactOpts, delegatee common.Address) (*types.Transaction, error) { return _ERC20UtilityAgent.contract.Transact(opts, "delegate", delegatee) } // Delegate is a paid mutator transaction binding the contract method 0x5c19a95c. // // Solidity: function delegate(address delegatee) returns() func (_ERC20UtilityAgent *ERC20UtilityAgentSession) Delegate(delegatee common.Address) (*types.Transaction, error) { return _ERC20UtilityAgent.Contract.Delegate(&_ERC20UtilityAgent.TransactOpts, delegatee) } // Delegate is a paid mutator transaction binding the contract method 0x5c19a95c. // // Solidity: function delegate(address delegatee) returns() func (_ERC20UtilityAgent *ERC20UtilityAgentTransactorSession) Delegate(delegatee common.Address) (*types.Transaction, error) { return _ERC20UtilityAgent.Contract.Delegate(&_ERC20UtilityAgent.TransactOpts, delegatee) } // DelegateBySig is a paid mutator transaction binding the contract method 0xc3cda520. // // Solidity: function delegateBySig(address delegatee, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) returns() func (_ERC20UtilityAgent *ERC20UtilityAgentTransactor) DelegateBySig(opts *bind.TransactOpts, delegatee common.Address, nonce *big.Int, expiry *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _ERC20UtilityAgent.contract.Transact(opts, "delegateBySig", delegatee, nonce, expiry, v, r, s) } // DelegateBySig is a paid mutator transaction binding the contract method 0xc3cda520. // // Solidity: function delegateBySig(address delegatee, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) returns() func (_ERC20UtilityAgent *ERC20UtilityAgentSession) DelegateBySig(delegatee common.Address, nonce *big.Int, expiry *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _ERC20UtilityAgent.Contract.DelegateBySig(&_ERC20UtilityAgent.TransactOpts, delegatee, nonce, expiry, v, r, s) } // DelegateBySig is a paid mutator transaction binding the contract method 0xc3cda520. // // Solidity: function delegateBySig(address delegatee, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) returns() func (_ERC20UtilityAgent *ERC20UtilityAgentTransactorSession) DelegateBySig(delegatee common.Address, nonce *big.Int, expiry *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _ERC20UtilityAgent.Contract.DelegateBySig(&_ERC20UtilityAgent.TransactOpts, delegatee, nonce, expiry, v, r, s) } // Forward is a paid mutator transaction binding the contract method 0xf514b5b8. // // Solidity: function forward(bytes32 uuid, address dstAgent, bytes request) payable returns(uint256 dstActionId) func (_ERC20UtilityAgent *ERC20UtilityAgentTransactor) Forward(opts *bind.TransactOpts, uuid [32]byte, dstAgent common.Address, request []byte) (*types.Transaction, error) { return _ERC20UtilityAgent.contract.Transact(opts, "forward", uuid, dstAgent, request) } // Forward is a paid mutator transaction binding the contract method 0xf514b5b8. // // Solidity: function forward(bytes32 uuid, address dstAgent, bytes request) payable returns(uint256 dstActionId) func (_ERC20UtilityAgent *ERC20UtilityAgentSession) Forward(uuid [32]byte, dstAgent common.Address, request []byte) (*types.Transaction, error) { return _ERC20UtilityAgent.Contract.Forward(&_ERC20UtilityAgent.TransactOpts, uuid, dstAgent, request) } // Forward is a paid mutator transaction binding the contract method 0xf514b5b8. // // Solidity: function forward(bytes32 uuid, address dstAgent, bytes request) payable returns(uint256 dstActionId) func (_ERC20UtilityAgent *ERC20UtilityAgentTransactorSession) Forward(uuid [32]byte, dstAgent common.Address, request []byte) (*types.Transaction, error) { return _ERC20UtilityAgent.Contract.Forward(&_ERC20UtilityAgent.TransactOpts, uuid, dstAgent, request) } // IncreaseAllowance is a paid mutator transaction binding the contract method 0x39509351. // // Solidity: function increaseAllowance(address spender, uint256 addedValue) returns(bool) func (_ERC20UtilityAgent *ERC20UtilityAgentTransactor) IncreaseAllowance(opts *bind.TransactOpts, spender common.Address, addedValue *big.Int) (*types.Transaction, error) { return _ERC20UtilityAgent.contract.Transact(opts, "increaseAllowance", spender, addedValue) } // IncreaseAllowance is a paid mutator transaction binding the contract method 0x39509351. // // Solidity: function increaseAllowance(address spender, uint256 addedValue) returns(bool) func (_ERC20UtilityAgent *ERC20UtilityAgentSession) IncreaseAllowance(spender common.Address, addedValue *big.Int) (*types.Transaction, error) { return _ERC20UtilityAgent.Contract.IncreaseAllowance(&_ERC20UtilityAgent.TransactOpts, spender, addedValue) } // IncreaseAllowance is a paid mutator transaction binding the contract method 0x39509351. // // Solidity: function increaseAllowance(address spender, uint256 addedValue) returns(bool) func (_ERC20UtilityAgent *ERC20UtilityAgentTransactorSession) IncreaseAllowance(spender common.Address, addedValue *big.Int) (*types.Transaction, error) { return _ERC20UtilityAgent.Contract.IncreaseAllowance(&_ERC20UtilityAgent.TransactOpts, spender, addedValue) } // Permit is a paid mutator transaction binding the contract method 0xd505accf. // // Solidity: function permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) returns() func (_ERC20UtilityAgent *ERC20UtilityAgentTransactor) Permit(opts *bind.TransactOpts, owner common.Address, spender common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _ERC20UtilityAgent.contract.Transact(opts, "permit", owner, spender, value, deadline, v, r, s) } // Permit is a paid mutator transaction binding the contract method 0xd505accf. // // Solidity: function permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) returns() func (_ERC20UtilityAgent *ERC20UtilityAgentSession) Permit(owner common.Address, spender common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _ERC20UtilityAgent.Contract.Permit(&_ERC20UtilityAgent.TransactOpts, owner, spender, value, deadline, v, r, s) } // Permit is a paid mutator transaction binding the contract method 0xd505accf. // // Solidity: function permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) returns() func (_ERC20UtilityAgent *ERC20UtilityAgentTransactorSession) Permit(owner common.Address, spender common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _ERC20UtilityAgent.Contract.Permit(&_ERC20UtilityAgent.TransactOpts, owner, spender, value, deadline, v, r, s) } // Prompt is a paid mutator transaction binding the contract method 0x793042c9. // // Solidity: function prompt(bytes request) payable returns(uint256) func (_ERC20UtilityAgent *ERC20UtilityAgentTransactor) Prompt(opts *bind.TransactOpts, request []byte) (*types.Transaction, error) { return _ERC20UtilityAgent.contract.Transact(opts, "prompt", request) } // Prompt is a paid mutator transaction binding the contract method 0x793042c9. // // Solidity: function prompt(bytes request) payable returns(uint256) func (_ERC20UtilityAgent *ERC20UtilityAgentSession) Prompt(request []byte) (*types.Transaction, error) { return _ERC20UtilityAgent.Contract.Prompt(&_ERC20UtilityAgent.TransactOpts, request) } // Prompt is a paid mutator transaction binding the contract method 0x793042c9. // // Solidity: function prompt(bytes request) payable returns(uint256) func (_ERC20UtilityAgent *ERC20UtilityAgentTransactorSession) Prompt(request []byte) (*types.Transaction, error) { return _ERC20UtilityAgent.Contract.Prompt(&_ERC20UtilityAgent.TransactOpts, request) } // Prompt0 is a paid mutator transaction binding the contract method 0xbe16d94a. // // Solidity: function prompt(bytes32 uuid, bytes request) payable returns(uint256) func (_ERC20UtilityAgent *ERC20UtilityAgentTransactor) Prompt0(opts *bind.TransactOpts, uuid [32]byte, request []byte) (*types.Transaction, error) { return _ERC20UtilityAgent.contract.Transact(opts, "prompt0", uuid, request) } // Prompt0 is a paid mutator transaction binding the contract method 0xbe16d94a. // // Solidity: function prompt(bytes32 uuid, bytes request) payable returns(uint256) func (_ERC20UtilityAgent *ERC20UtilityAgentSession) Prompt0(uuid [32]byte, request []byte) (*types.Transaction, error) { return _ERC20UtilityAgent.Contract.Prompt0(&_ERC20UtilityAgent.TransactOpts, uuid, request) } // Prompt0 is a paid mutator transaction binding the contract method 0xbe16d94a. // // Solidity: function prompt(bytes32 uuid, bytes request) payable returns(uint256) func (_ERC20UtilityAgent *ERC20UtilityAgentTransactorSession) Prompt0(uuid [32]byte, request []byte) (*types.Transaction, error) { return _ERC20UtilityAgent.Contract.Prompt0(&_ERC20UtilityAgent.TransactOpts, uuid, request) } // RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. // // Solidity: function renounceOwnership() returns() func (_ERC20UtilityAgent *ERC20UtilityAgentTransactor) RenounceOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { return _ERC20UtilityAgent.contract.Transact(opts, "renounceOwnership") } // RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. // // Solidity: function renounceOwnership() returns() func (_ERC20UtilityAgent *ERC20UtilityAgentSession) RenounceOwnership() (*types.Transaction, error) { return _ERC20UtilityAgent.Contract.RenounceOwnership(&_ERC20UtilityAgent.TransactOpts) } // RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. // // Solidity: function renounceOwnership() returns() func (_ERC20UtilityAgent *ERC20UtilityAgentTransactorSession) RenounceOwnership() (*types.Transaction, error) { return _ERC20UtilityAgent.Contract.RenounceOwnership(&_ERC20UtilityAgent.TransactOpts) } // Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. // // Solidity: function transfer(address to, uint256 amount) returns(bool) func (_ERC20UtilityAgent *ERC20UtilityAgentTransactor) Transfer(opts *bind.TransactOpts, to common.Address, amount *big.Int) (*types.Transaction, error) { return _ERC20UtilityAgent.contract.Transact(opts, "transfer", to, amount) } // Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. // // Solidity: function transfer(address to, uint256 amount) returns(bool) func (_ERC20UtilityAgent *ERC20UtilityAgentSession) Transfer(to common.Address, amount *big.Int) (*types.Transaction, error) { return _ERC20UtilityAgent.Contract.Transfer(&_ERC20UtilityAgent.TransactOpts, to, amount) } // Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. // // Solidity: function transfer(address to, uint256 amount) returns(bool) func (_ERC20UtilityAgent *ERC20UtilityAgentTransactorSession) Transfer(to common.Address, amount *big.Int) (*types.Transaction, error) { return _ERC20UtilityAgent.Contract.Transfer(&_ERC20UtilityAgent.TransactOpts, to, amount) } // TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. // // Solidity: function transferFrom(address from, address to, uint256 amount) returns(bool) func (_ERC20UtilityAgent *ERC20UtilityAgentTransactor) TransferFrom(opts *bind.TransactOpts, from common.Address, to common.Address, amount *big.Int) (*types.Transaction, error) { return _ERC20UtilityAgent.contract.Transact(opts, "transferFrom", from, to, amount) } // TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. // // Solidity: function transferFrom(address from, address to, uint256 amount) returns(bool) func (_ERC20UtilityAgent *ERC20UtilityAgentSession) TransferFrom(from common.Address, to common.Address, amount *big.Int) (*types.Transaction, error) { return _ERC20UtilityAgent.Contract.TransferFrom(&_ERC20UtilityAgent.TransactOpts, from, to, amount) } // TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. // // Solidity: function transferFrom(address from, address to, uint256 amount) returns(bool) func (_ERC20UtilityAgent *ERC20UtilityAgentTransactorSession) TransferFrom(from common.Address, to common.Address, amount *big.Int) (*types.Transaction, error) { return _ERC20UtilityAgent.Contract.TransferFrom(&_ERC20UtilityAgent.TransactOpts, from, to, amount) } // TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. // // Solidity: function transferOwnership(address newOwner) returns() func (_ERC20UtilityAgent *ERC20UtilityAgentTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) { return _ERC20UtilityAgent.contract.Transact(opts, "transferOwnership", newOwner) } // TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. // // Solidity: function transferOwnership(address newOwner) returns() func (_ERC20UtilityAgent *ERC20UtilityAgentSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { return _ERC20UtilityAgent.Contract.TransferOwnership(&_ERC20UtilityAgent.TransactOpts, newOwner) } // TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. // // Solidity: function transferOwnership(address newOwner) returns() func (_ERC20UtilityAgent *ERC20UtilityAgentTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { return _ERC20UtilityAgent.Contract.TransferOwnership(&_ERC20UtilityAgent.TransactOpts, newOwner) } // UpdateFileName is a paid mutator transaction binding the contract method 0xf73eb6f3. // // Solidity: function updateFileName(string filename) returns() func (_ERC20UtilityAgent *ERC20UtilityAgentTransactor) UpdateFileName(opts *bind.TransactOpts, filename string) (*types.Transaction, error) { return _ERC20UtilityAgent.contract.Transact(opts, "updateFileName", filename) } // UpdateFileName is a paid mutator transaction binding the contract method 0xf73eb6f3. // // Solidity: function updateFileName(string filename) returns() func (_ERC20UtilityAgent *ERC20UtilityAgentSession) UpdateFileName(filename string) (*types.Transaction, error) { return _ERC20UtilityAgent.Contract.UpdateFileName(&_ERC20UtilityAgent.TransactOpts, filename) } // UpdateFileName is a paid mutator transaction binding the contract method 0xf73eb6f3. // // Solidity: function updateFileName(string filename) returns() func (_ERC20UtilityAgent *ERC20UtilityAgentTransactorSession) UpdateFileName(filename string) (*types.Transaction, error) { return _ERC20UtilityAgent.Contract.UpdateFileName(&_ERC20UtilityAgent.TransactOpts, filename) } // UpdateSystemPrompt is a paid mutator transaction binding the contract method 0x76a30029. // // Solidity: function updateSystemPrompt(string systemPrompt) returns() func (_ERC20UtilityAgent *ERC20UtilityAgentTransactor) UpdateSystemPrompt(opts *bind.TransactOpts, systemPrompt string) (*types.Transaction, error) { return _ERC20UtilityAgent.contract.Transact(opts, "updateSystemPrompt", systemPrompt) } // UpdateSystemPrompt is a paid mutator transaction binding the contract method 0x76a30029. // // Solidity: function updateSystemPrompt(string systemPrompt) returns() func (_ERC20UtilityAgent *ERC20UtilityAgentSession) UpdateSystemPrompt(systemPrompt string) (*types.Transaction, error) { return _ERC20UtilityAgent.Contract.UpdateSystemPrompt(&_ERC20UtilityAgent.TransactOpts, systemPrompt) } // UpdateSystemPrompt is a paid mutator transaction binding the contract method 0x76a30029. // // Solidity: function updateSystemPrompt(string systemPrompt) returns() func (_ERC20UtilityAgent *ERC20UtilityAgentTransactorSession) UpdateSystemPrompt(systemPrompt string) (*types.Transaction, error) { return _ERC20UtilityAgent.Contract.UpdateSystemPrompt(&_ERC20UtilityAgent.TransactOpts, systemPrompt) } // ERC20UtilityAgentApprovalIterator is returned from FilterApproval and is used to iterate over the raw logs and unpacked data for Approval events raised by the ERC20UtilityAgent contract. type ERC20UtilityAgentApprovalIterator struct { Event *ERC20UtilityAgentApproval // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *ERC20UtilityAgentApprovalIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(ERC20UtilityAgentApproval) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(ERC20UtilityAgentApproval) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *ERC20UtilityAgentApprovalIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *ERC20UtilityAgentApprovalIterator) Close() error { it.sub.Unsubscribe() return nil } // ERC20UtilityAgentApproval represents a Approval event raised by the ERC20UtilityAgent contract. type ERC20UtilityAgentApproval struct { Owner common.Address Spender common.Address Value *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterApproval is a free log retrieval operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. // // Solidity: event Approval(address indexed owner, address indexed spender, uint256 value) func (_ERC20UtilityAgent *ERC20UtilityAgentFilterer) FilterApproval(opts *bind.FilterOpts, owner []common.Address, spender []common.Address) (*ERC20UtilityAgentApprovalIterator, error) { var ownerRule []interface{} for _, ownerItem := range owner { ownerRule = append(ownerRule, ownerItem) } var spenderRule []interface{} for _, spenderItem := range spender { spenderRule = append(spenderRule, spenderItem) } logs, sub, err := _ERC20UtilityAgent.contract.FilterLogs(opts, "Approval", ownerRule, spenderRule) if err != nil { return nil, err } return &ERC20UtilityAgentApprovalIterator{contract: _ERC20UtilityAgent.contract, event: "Approval", logs: logs, sub: sub}, nil } // WatchApproval is a free log subscription operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. // // Solidity: event Approval(address indexed owner, address indexed spender, uint256 value) func (_ERC20UtilityAgent *ERC20UtilityAgentFilterer) WatchApproval(opts *bind.WatchOpts, sink chan<- *ERC20UtilityAgentApproval, owner []common.Address, spender []common.Address) (event.Subscription, error) { var ownerRule []interface{} for _, ownerItem := range owner { ownerRule = append(ownerRule, ownerItem) } var spenderRule []interface{} for _, spenderItem := range spender { spenderRule = append(spenderRule, spenderItem) } logs, sub, err := _ERC20UtilityAgent.contract.WatchLogs(opts, "Approval", ownerRule, spenderRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(ERC20UtilityAgentApproval) if err := _ERC20UtilityAgent.contract.UnpackLog(event, "Approval", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseApproval is a log parse operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. // // Solidity: event Approval(address indexed owner, address indexed spender, uint256 value) func (_ERC20UtilityAgent *ERC20UtilityAgentFilterer) ParseApproval(log types.Log) (*ERC20UtilityAgentApproval, error) { event := new(ERC20UtilityAgentApproval) if err := _ERC20UtilityAgent.contract.UnpackLog(event, "Approval", log); err != nil { return nil, err } event.Raw = log return event, nil } // ERC20UtilityAgentDelegateChangedIterator is returned from FilterDelegateChanged and is used to iterate over the raw logs and unpacked data for DelegateChanged events raised by the ERC20UtilityAgent contract. type ERC20UtilityAgentDelegateChangedIterator struct { Event *ERC20UtilityAgentDelegateChanged // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *ERC20UtilityAgentDelegateChangedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(ERC20UtilityAgentDelegateChanged) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(ERC20UtilityAgentDelegateChanged) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *ERC20UtilityAgentDelegateChangedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *ERC20UtilityAgentDelegateChangedIterator) Close() error { it.sub.Unsubscribe() return nil } // ERC20UtilityAgentDelegateChanged represents a DelegateChanged event raised by the ERC20UtilityAgent contract. type ERC20UtilityAgentDelegateChanged struct { Delegator common.Address FromDelegate common.Address ToDelegate common.Address Raw types.Log // Blockchain specific contextual infos } // FilterDelegateChanged is a free log retrieval operation binding the contract event 0x3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f. // // Solidity: event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate) func (_ERC20UtilityAgent *ERC20UtilityAgentFilterer) FilterDelegateChanged(opts *bind.FilterOpts, delegator []common.Address, fromDelegate []common.Address, toDelegate []common.Address) (*ERC20UtilityAgentDelegateChangedIterator, error) { var delegatorRule []interface{} for _, delegatorItem := range delegator { delegatorRule = append(delegatorRule, delegatorItem) } var fromDelegateRule []interface{} for _, fromDelegateItem := range fromDelegate { fromDelegateRule = append(fromDelegateRule, fromDelegateItem) } var toDelegateRule []interface{} for _, toDelegateItem := range toDelegate { toDelegateRule = append(toDelegateRule, toDelegateItem) } logs, sub, err := _ERC20UtilityAgent.contract.FilterLogs(opts, "DelegateChanged", delegatorRule, fromDelegateRule, toDelegateRule) if err != nil { return nil, err } return &ERC20UtilityAgentDelegateChangedIterator{contract: _ERC20UtilityAgent.contract, event: "DelegateChanged", logs: logs, sub: sub}, nil } // WatchDelegateChanged is a free log subscription operation binding the contract event 0x3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f. // // Solidity: event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate) func (_ERC20UtilityAgent *ERC20UtilityAgentFilterer) WatchDelegateChanged(opts *bind.WatchOpts, sink chan<- *ERC20UtilityAgentDelegateChanged, delegator []common.Address, fromDelegate []common.Address, toDelegate []common.Address) (event.Subscription, error) { var delegatorRule []interface{} for _, delegatorItem := range delegator { delegatorRule = append(delegatorRule, delegatorItem) } var fromDelegateRule []interface{} for _, fromDelegateItem := range fromDelegate { fromDelegateRule = append(fromDelegateRule, fromDelegateItem) } var toDelegateRule []interface{} for _, toDelegateItem := range toDelegate { toDelegateRule = append(toDelegateRule, toDelegateItem) } logs, sub, err := _ERC20UtilityAgent.contract.WatchLogs(opts, "DelegateChanged", delegatorRule, fromDelegateRule, toDelegateRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(ERC20UtilityAgentDelegateChanged) if err := _ERC20UtilityAgent.contract.UnpackLog(event, "DelegateChanged", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseDelegateChanged is a log parse operation binding the contract event 0x3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f. // // Solidity: event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate) func (_ERC20UtilityAgent *ERC20UtilityAgentFilterer) ParseDelegateChanged(log types.Log) (*ERC20UtilityAgentDelegateChanged, error) { event := new(ERC20UtilityAgentDelegateChanged) if err := _ERC20UtilityAgent.contract.UnpackLog(event, "DelegateChanged", log); err != nil { return nil, err } event.Raw = log return event, nil } // ERC20UtilityAgentDelegateVotesChangedIterator is returned from FilterDelegateVotesChanged and is used to iterate over the raw logs and unpacked data for DelegateVotesChanged events raised by the ERC20UtilityAgent contract. type ERC20UtilityAgentDelegateVotesChangedIterator struct { Event *ERC20UtilityAgentDelegateVotesChanged // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *ERC20UtilityAgentDelegateVotesChangedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(ERC20UtilityAgentDelegateVotesChanged) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(ERC20UtilityAgentDelegateVotesChanged) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *ERC20UtilityAgentDelegateVotesChangedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *ERC20UtilityAgentDelegateVotesChangedIterator) Close() error { it.sub.Unsubscribe() return nil } // ERC20UtilityAgentDelegateVotesChanged represents a DelegateVotesChanged event raised by the ERC20UtilityAgent contract. type ERC20UtilityAgentDelegateVotesChanged struct { Delegate common.Address PreviousBalance *big.Int NewBalance *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterDelegateVotesChanged is a free log retrieval operation binding the contract event 0xdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a724. // // Solidity: event DelegateVotesChanged(address indexed delegate, uint256 previousBalance, uint256 newBalance) func (_ERC20UtilityAgent *ERC20UtilityAgentFilterer) FilterDelegateVotesChanged(opts *bind.FilterOpts, delegate []common.Address) (*ERC20UtilityAgentDelegateVotesChangedIterator, error) { var delegateRule []interface{} for _, delegateItem := range delegate { delegateRule = append(delegateRule, delegateItem) } logs, sub, err := _ERC20UtilityAgent.contract.FilterLogs(opts, "DelegateVotesChanged", delegateRule) if err != nil { return nil, err } return &ERC20UtilityAgentDelegateVotesChangedIterator{contract: _ERC20UtilityAgent.contract, event: "DelegateVotesChanged", logs: logs, sub: sub}, nil } // WatchDelegateVotesChanged is a free log subscription operation binding the contract event 0xdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a724. // // Solidity: event DelegateVotesChanged(address indexed delegate, uint256 previousBalance, uint256 newBalance) func (_ERC20UtilityAgent *ERC20UtilityAgentFilterer) WatchDelegateVotesChanged(opts *bind.WatchOpts, sink chan<- *ERC20UtilityAgentDelegateVotesChanged, delegate []common.Address) (event.Subscription, error) { var delegateRule []interface{} for _, delegateItem := range delegate { delegateRule = append(delegateRule, delegateItem) } logs, sub, err := _ERC20UtilityAgent.contract.WatchLogs(opts, "DelegateVotesChanged", delegateRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(ERC20UtilityAgentDelegateVotesChanged) if err := _ERC20UtilityAgent.contract.UnpackLog(event, "DelegateVotesChanged", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseDelegateVotesChanged is a log parse operation binding the contract event 0xdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a724. // // Solidity: event DelegateVotesChanged(address indexed delegate, uint256 previousBalance, uint256 newBalance) func (_ERC20UtilityAgent *ERC20UtilityAgentFilterer) ParseDelegateVotesChanged(log types.Log) (*ERC20UtilityAgentDelegateVotesChanged, error) { event := new(ERC20UtilityAgentDelegateVotesChanged) if err := _ERC20UtilityAgent.contract.UnpackLog(event, "DelegateVotesChanged", log); err != nil { return nil, err } event.Raw = log return event, nil } // ERC20UtilityAgentEIP712DomainChangedIterator is returned from FilterEIP712DomainChanged and is used to iterate over the raw logs and unpacked data for EIP712DomainChanged events raised by the ERC20UtilityAgent contract. type ERC20UtilityAgentEIP712DomainChangedIterator struct { Event *ERC20UtilityAgentEIP712DomainChanged // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *ERC20UtilityAgentEIP712DomainChangedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(ERC20UtilityAgentEIP712DomainChanged) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(ERC20UtilityAgentEIP712DomainChanged) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *ERC20UtilityAgentEIP712DomainChangedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *ERC20UtilityAgentEIP712DomainChangedIterator) Close() error { it.sub.Unsubscribe() return nil } // ERC20UtilityAgentEIP712DomainChanged represents a EIP712DomainChanged event raised by the ERC20UtilityAgent contract. type ERC20UtilityAgentEIP712DomainChanged struct { Raw types.Log // Blockchain specific contextual infos } // FilterEIP712DomainChanged is a free log retrieval operation binding the contract event 0x0a6387c9ea3628b88a633bb4f3b151770f70085117a15f9bf3787cda53f13d31. // // Solidity: event EIP712DomainChanged() func (_ERC20UtilityAgent *ERC20UtilityAgentFilterer) FilterEIP712DomainChanged(opts *bind.FilterOpts) (*ERC20UtilityAgentEIP712DomainChangedIterator, error) { logs, sub, err := _ERC20UtilityAgent.contract.FilterLogs(opts, "EIP712DomainChanged") if err != nil { return nil, err } return &ERC20UtilityAgentEIP712DomainChangedIterator{contract: _ERC20UtilityAgent.contract, event: "EIP712DomainChanged", logs: logs, sub: sub}, nil } // WatchEIP712DomainChanged is a free log subscription operation binding the contract event 0x0a6387c9ea3628b88a633bb4f3b151770f70085117a15f9bf3787cda53f13d31. // // Solidity: event EIP712DomainChanged() func (_ERC20UtilityAgent *ERC20UtilityAgentFilterer) WatchEIP712DomainChanged(opts *bind.WatchOpts, sink chan<- *ERC20UtilityAgentEIP712DomainChanged) (event.Subscription, error) { logs, sub, err := _ERC20UtilityAgent.contract.WatchLogs(opts, "EIP712DomainChanged") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(ERC20UtilityAgentEIP712DomainChanged) if err := _ERC20UtilityAgent.contract.UnpackLog(event, "EIP712DomainChanged", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseEIP712DomainChanged is a log parse operation binding the contract event 0x0a6387c9ea3628b88a633bb4f3b151770f70085117a15f9bf3787cda53f13d31. // // Solidity: event EIP712DomainChanged() func (_ERC20UtilityAgent *ERC20UtilityAgentFilterer) ParseEIP712DomainChanged(log types.Log) (*ERC20UtilityAgentEIP712DomainChanged, error) { event := new(ERC20UtilityAgentEIP712DomainChanged) if err := _ERC20UtilityAgent.contract.UnpackLog(event, "EIP712DomainChanged", log); err != nil { return nil, err } event.Raw = log return event, nil } // ERC20UtilityAgentForwardPerformedIterator is returned from FilterForwardPerformed and is used to iterate over the raw logs and unpacked data for ForwardPerformed events raised by the ERC20UtilityAgent contract. type ERC20UtilityAgentForwardPerformedIterator struct { Event *ERC20UtilityAgentForwardPerformed // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *ERC20UtilityAgentForwardPerformedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(ERC20UtilityAgentForwardPerformed) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(ERC20UtilityAgentForwardPerformed) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *ERC20UtilityAgentForwardPerformedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *ERC20UtilityAgentForwardPerformedIterator) Close() error { it.sub.Unsubscribe() return nil } // ERC20UtilityAgentForwardPerformed represents a ForwardPerformed event raised by the ERC20UtilityAgent contract. type ERC20UtilityAgentForwardPerformed struct { Uuid [32]byte InferId *big.Int Caller common.Address FowardData []byte Raw types.Log // Blockchain specific contextual infos } // FilterForwardPerformed is a free log retrieval operation binding the contract event 0x103ab115fdd2f05d2720873cd21aeff07c1206de37259cdeb99463da9ff512e0. // // Solidity: event ForwardPerformed(bytes32 indexed uuid, uint256 indexed inferId, address indexed caller, bytes fowardData) func (_ERC20UtilityAgent *ERC20UtilityAgentFilterer) FilterForwardPerformed(opts *bind.FilterOpts, uuid [][32]byte, inferId []*big.Int, caller []common.Address) (*ERC20UtilityAgentForwardPerformedIterator, error) { var uuidRule []interface{} for _, uuidItem := range uuid { uuidRule = append(uuidRule, uuidItem) } var inferIdRule []interface{} for _, inferIdItem := range inferId { inferIdRule = append(inferIdRule, inferIdItem) } var callerRule []interface{} for _, callerItem := range caller { callerRule = append(callerRule, callerItem) } logs, sub, err := _ERC20UtilityAgent.contract.FilterLogs(opts, "ForwardPerformed", uuidRule, inferIdRule, callerRule) if err != nil { return nil, err } return &ERC20UtilityAgentForwardPerformedIterator{contract: _ERC20UtilityAgent.contract, event: "ForwardPerformed", logs: logs, sub: sub}, nil } // WatchForwardPerformed is a free log subscription operation binding the contract event 0x103ab115fdd2f05d2720873cd21aeff07c1206de37259cdeb99463da9ff512e0. // // Solidity: event ForwardPerformed(bytes32 indexed uuid, uint256 indexed inferId, address indexed caller, bytes fowardData) func (_ERC20UtilityAgent *ERC20UtilityAgentFilterer) WatchForwardPerformed(opts *bind.WatchOpts, sink chan<- *ERC20UtilityAgentForwardPerformed, uuid [][32]byte, inferId []*big.Int, caller []common.Address) (event.Subscription, error) { var uuidRule []interface{} for _, uuidItem := range uuid { uuidRule = append(uuidRule, uuidItem) } var inferIdRule []interface{} for _, inferIdItem := range inferId { inferIdRule = append(inferIdRule, inferIdItem) } var callerRule []interface{} for _, callerItem := range caller { callerRule = append(callerRule, callerItem) } logs, sub, err := _ERC20UtilityAgent.contract.WatchLogs(opts, "ForwardPerformed", uuidRule, inferIdRule, callerRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(ERC20UtilityAgentForwardPerformed) if err := _ERC20UtilityAgent.contract.UnpackLog(event, "ForwardPerformed", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseForwardPerformed is a log parse operation binding the contract event 0x103ab115fdd2f05d2720873cd21aeff07c1206de37259cdeb99463da9ff512e0. // // Solidity: event ForwardPerformed(bytes32 indexed uuid, uint256 indexed inferId, address indexed caller, bytes fowardData) func (_ERC20UtilityAgent *ERC20UtilityAgentFilterer) ParseForwardPerformed(log types.Log) (*ERC20UtilityAgentForwardPerformed, error) { event := new(ERC20UtilityAgentForwardPerformed) if err := _ERC20UtilityAgent.contract.UnpackLog(event, "ForwardPerformed", log); err != nil { return nil, err } event.Raw = log return event, nil } // ERC20UtilityAgentModelUpdateIterator is returned from FilterModelUpdate and is used to iterate over the raw logs and unpacked data for ModelUpdate events raised by the ERC20UtilityAgent contract. type ERC20UtilityAgentModelUpdateIterator struct { Event *ERC20UtilityAgentModelUpdate // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *ERC20UtilityAgentModelUpdateIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(ERC20UtilityAgentModelUpdate) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(ERC20UtilityAgentModelUpdate) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *ERC20UtilityAgentModelUpdateIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *ERC20UtilityAgentModelUpdateIterator) Close() error { it.sub.Unsubscribe() return nil } // ERC20UtilityAgentModelUpdate represents a ModelUpdate event raised by the ERC20UtilityAgent contract. type ERC20UtilityAgentModelUpdate struct { HybridModel common.Address Raw types.Log // Blockchain specific contextual infos } // FilterModelUpdate is a free log retrieval operation binding the contract event 0x9e53d9893c64d113368e7309f92b28e4c2f58b339f6e7878fa0d519851c0041e. // // Solidity: event ModelUpdate(address hybridModel) func (_ERC20UtilityAgent *ERC20UtilityAgentFilterer) FilterModelUpdate(opts *bind.FilterOpts) (*ERC20UtilityAgentModelUpdateIterator, error) { logs, sub, err := _ERC20UtilityAgent.contract.FilterLogs(opts, "ModelUpdate") if err != nil { return nil, err } return &ERC20UtilityAgentModelUpdateIterator{contract: _ERC20UtilityAgent.contract, event: "ModelUpdate", logs: logs, sub: sub}, nil } // WatchModelUpdate is a free log subscription operation binding the contract event 0x9e53d9893c64d113368e7309f92b28e4c2f58b339f6e7878fa0d519851c0041e. // // Solidity: event ModelUpdate(address hybridModel) func (_ERC20UtilityAgent *ERC20UtilityAgentFilterer) WatchModelUpdate(opts *bind.WatchOpts, sink chan<- *ERC20UtilityAgentModelUpdate) (event.Subscription, error) { logs, sub, err := _ERC20UtilityAgent.contract.WatchLogs(opts, "ModelUpdate") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(ERC20UtilityAgentModelUpdate) if err := _ERC20UtilityAgent.contract.UnpackLog(event, "ModelUpdate", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseModelUpdate is a log parse operation binding the contract event 0x9e53d9893c64d113368e7309f92b28e4c2f58b339f6e7878fa0d519851c0041e. // // Solidity: event ModelUpdate(address hybridModel) func (_ERC20UtilityAgent *ERC20UtilityAgentFilterer) ParseModelUpdate(log types.Log) (*ERC20UtilityAgentModelUpdate, error) { event := new(ERC20UtilityAgentModelUpdate) if err := _ERC20UtilityAgent.contract.UnpackLog(event, "ModelUpdate", log); err != nil { return nil, err } event.Raw = log return event, nil } // ERC20UtilityAgentOwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the ERC20UtilityAgent contract. type ERC20UtilityAgentOwnershipTransferredIterator struct { Event *ERC20UtilityAgentOwnershipTransferred // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *ERC20UtilityAgentOwnershipTransferredIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(ERC20UtilityAgentOwnershipTransferred) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(ERC20UtilityAgentOwnershipTransferred) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *ERC20UtilityAgentOwnershipTransferredIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *ERC20UtilityAgentOwnershipTransferredIterator) Close() error { it.sub.Unsubscribe() return nil } // ERC20UtilityAgentOwnershipTransferred represents a OwnershipTransferred event raised by the ERC20UtilityAgent contract. type ERC20UtilityAgentOwnershipTransferred struct { PreviousOwner common.Address NewOwner common.Address Raw types.Log // Blockchain specific contextual infos } // FilterOwnershipTransferred is a free log retrieval operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. // // Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) func (_ERC20UtilityAgent *ERC20UtilityAgentFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*ERC20UtilityAgentOwnershipTransferredIterator, error) { var previousOwnerRule []interface{} for _, previousOwnerItem := range previousOwner { previousOwnerRule = append(previousOwnerRule, previousOwnerItem) } var newOwnerRule []interface{} for _, newOwnerItem := range newOwner { newOwnerRule = append(newOwnerRule, newOwnerItem) } logs, sub, err := _ERC20UtilityAgent.contract.FilterLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) if err != nil { return nil, err } return &ERC20UtilityAgentOwnershipTransferredIterator{contract: _ERC20UtilityAgent.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil } // WatchOwnershipTransferred is a free log subscription operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. // // Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) func (_ERC20UtilityAgent *ERC20UtilityAgentFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *ERC20UtilityAgentOwnershipTransferred, previousOwner []common.Address, newOwner []common.Address) (event.Subscription, error) { var previousOwnerRule []interface{} for _, previousOwnerItem := range previousOwner { previousOwnerRule = append(previousOwnerRule, previousOwnerItem) } var newOwnerRule []interface{} for _, newOwnerItem := range newOwner { newOwnerRule = append(newOwnerRule, newOwnerItem) } logs, sub, err := _ERC20UtilityAgent.contract.WatchLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(ERC20UtilityAgentOwnershipTransferred) if err := _ERC20UtilityAgent.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseOwnershipTransferred is a log parse operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. // // Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) func (_ERC20UtilityAgent *ERC20UtilityAgentFilterer) ParseOwnershipTransferred(log types.Log) (*ERC20UtilityAgentOwnershipTransferred, error) { event := new(ERC20UtilityAgentOwnershipTransferred) if err := _ERC20UtilityAgent.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { return nil, err } event.Raw = log return event, nil } // ERC20UtilityAgentPromptPerformedIterator is returned from FilterPromptPerformed and is used to iterate over the raw logs and unpacked data for PromptPerformed events raised by the ERC20UtilityAgent contract. type ERC20UtilityAgentPromptPerformedIterator struct { Event *ERC20UtilityAgentPromptPerformed // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *ERC20UtilityAgentPromptPerformedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(ERC20UtilityAgentPromptPerformed) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(ERC20UtilityAgentPromptPerformed) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *ERC20UtilityAgentPromptPerformedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *ERC20UtilityAgentPromptPerformedIterator) Close() error { it.sub.Unsubscribe() return nil } // ERC20UtilityAgentPromptPerformed represents a PromptPerformed event raised by the ERC20UtilityAgent contract. type ERC20UtilityAgentPromptPerformed struct { Uuid [32]byte InferId *big.Int Caller common.Address ExecutionData []byte Raw types.Log // Blockchain specific contextual infos } // FilterPromptPerformed is a free log retrieval operation binding the contract event 0x71f71bde9af581324eb3d6c8f96ecf2d5af870ec81503e21f44ed8dd3574f99e. // // Solidity: event PromptPerformed(bytes32 indexed uuid, uint256 indexed inferId, address indexed caller, bytes executionData) func (_ERC20UtilityAgent *ERC20UtilityAgentFilterer) FilterPromptPerformed(opts *bind.FilterOpts, uuid [][32]byte, inferId []*big.Int, caller []common.Address) (*ERC20UtilityAgentPromptPerformedIterator, error) { var uuidRule []interface{} for _, uuidItem := range uuid { uuidRule = append(uuidRule, uuidItem) } var inferIdRule []interface{} for _, inferIdItem := range inferId { inferIdRule = append(inferIdRule, inferIdItem) } var callerRule []interface{} for _, callerItem := range caller { callerRule = append(callerRule, callerItem) } logs, sub, err := _ERC20UtilityAgent.contract.FilterLogs(opts, "PromptPerformed", uuidRule, inferIdRule, callerRule) if err != nil { return nil, err } return &ERC20UtilityAgentPromptPerformedIterator{contract: _ERC20UtilityAgent.contract, event: "PromptPerformed", logs: logs, sub: sub}, nil } // WatchPromptPerformed is a free log subscription operation binding the contract event 0x71f71bde9af581324eb3d6c8f96ecf2d5af870ec81503e21f44ed8dd3574f99e. // // Solidity: event PromptPerformed(bytes32 indexed uuid, uint256 indexed inferId, address indexed caller, bytes executionData) func (_ERC20UtilityAgent *ERC20UtilityAgentFilterer) WatchPromptPerformed(opts *bind.WatchOpts, sink chan<- *ERC20UtilityAgentPromptPerformed, uuid [][32]byte, inferId []*big.Int, caller []common.Address) (event.Subscription, error) { var uuidRule []interface{} for _, uuidItem := range uuid { uuidRule = append(uuidRule, uuidItem) } var inferIdRule []interface{} for _, inferIdItem := range inferId { inferIdRule = append(inferIdRule, inferIdItem) } var callerRule []interface{} for _, callerItem := range caller { callerRule = append(callerRule, callerItem) } logs, sub, err := _ERC20UtilityAgent.contract.WatchLogs(opts, "PromptPerformed", uuidRule, inferIdRule, callerRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(ERC20UtilityAgentPromptPerformed) if err := _ERC20UtilityAgent.contract.UnpackLog(event, "PromptPerformed", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParsePromptPerformed is a log parse operation binding the contract event 0x71f71bde9af581324eb3d6c8f96ecf2d5af870ec81503e21f44ed8dd3574f99e. // // Solidity: event PromptPerformed(bytes32 indexed uuid, uint256 indexed inferId, address indexed caller, bytes executionData) func (_ERC20UtilityAgent *ERC20UtilityAgentFilterer) ParsePromptPerformed(log types.Log) (*ERC20UtilityAgentPromptPerformed, error) { event := new(ERC20UtilityAgentPromptPerformed) if err := _ERC20UtilityAgent.contract.UnpackLog(event, "PromptPerformed", log); err != nil { return nil, err } event.Raw = log return event, nil } // ERC20UtilityAgentPromptSchedulerUpdateIterator is returned from FilterPromptSchedulerUpdate and is used to iterate over the raw logs and unpacked data for PromptSchedulerUpdate events raised by the ERC20UtilityAgent contract. type ERC20UtilityAgentPromptSchedulerUpdateIterator struct { Event *ERC20UtilityAgentPromptSchedulerUpdate // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *ERC20UtilityAgentPromptSchedulerUpdateIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(ERC20UtilityAgentPromptSchedulerUpdate) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(ERC20UtilityAgentPromptSchedulerUpdate) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *ERC20UtilityAgentPromptSchedulerUpdateIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *ERC20UtilityAgentPromptSchedulerUpdateIterator) Close() error { it.sub.Unsubscribe() return nil } // ERC20UtilityAgentPromptSchedulerUpdate represents a PromptSchedulerUpdate event raised by the ERC20UtilityAgent contract. type ERC20UtilityAgentPromptSchedulerUpdate struct { PromptScheduler common.Address Raw types.Log // Blockchain specific contextual infos } // FilterPromptSchedulerUpdate is a free log retrieval operation binding the contract event 0x667557d852582e84e7de441f650ea0aacbb7de26e3485436e0c27ba8d19a79f1. // // Solidity: event PromptSchedulerUpdate(address promptScheduler) func (_ERC20UtilityAgent *ERC20UtilityAgentFilterer) FilterPromptSchedulerUpdate(opts *bind.FilterOpts) (*ERC20UtilityAgentPromptSchedulerUpdateIterator, error) { logs, sub, err := _ERC20UtilityAgent.contract.FilterLogs(opts, "PromptSchedulerUpdate") if err != nil { return nil, err } return &ERC20UtilityAgentPromptSchedulerUpdateIterator{contract: _ERC20UtilityAgent.contract, event: "PromptSchedulerUpdate", logs: logs, sub: sub}, nil } // WatchPromptSchedulerUpdate is a free log subscription operation binding the contract event 0x667557d852582e84e7de441f650ea0aacbb7de26e3485436e0c27ba8d19a79f1. // // Solidity: event PromptSchedulerUpdate(address promptScheduler) func (_ERC20UtilityAgent *ERC20UtilityAgentFilterer) WatchPromptSchedulerUpdate(opts *bind.WatchOpts, sink chan<- *ERC20UtilityAgentPromptSchedulerUpdate) (event.Subscription, error) { logs, sub, err := _ERC20UtilityAgent.contract.WatchLogs(opts, "PromptSchedulerUpdate") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(ERC20UtilityAgentPromptSchedulerUpdate) if err := _ERC20UtilityAgent.contract.UnpackLog(event, "PromptSchedulerUpdate", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParsePromptSchedulerUpdate is a log parse operation binding the contract event 0x667557d852582e84e7de441f650ea0aacbb7de26e3485436e0c27ba8d19a79f1. // // Solidity: event PromptSchedulerUpdate(address promptScheduler) func (_ERC20UtilityAgent *ERC20UtilityAgentFilterer) ParsePromptSchedulerUpdate(log types.Log) (*ERC20UtilityAgentPromptSchedulerUpdate, error) { event := new(ERC20UtilityAgentPromptSchedulerUpdate) if err := _ERC20UtilityAgent.contract.UnpackLog(event, "PromptSchedulerUpdate", log); err != nil { return nil, err } event.Raw = log return event, nil } // ERC20UtilityAgentSystemPromptUpdateIterator is returned from FilterSystemPromptUpdate and is used to iterate over the raw logs and unpacked data for SystemPromptUpdate events raised by the ERC20UtilityAgent contract. type ERC20UtilityAgentSystemPromptUpdateIterator struct { Event *ERC20UtilityAgentSystemPromptUpdate // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *ERC20UtilityAgentSystemPromptUpdateIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(ERC20UtilityAgentSystemPromptUpdate) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(ERC20UtilityAgentSystemPromptUpdate) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *ERC20UtilityAgentSystemPromptUpdateIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *ERC20UtilityAgentSystemPromptUpdateIterator) Close() error { it.sub.Unsubscribe() return nil } // ERC20UtilityAgentSystemPromptUpdate represents a SystemPromptUpdate event raised by the ERC20UtilityAgent contract. type ERC20UtilityAgentSystemPromptUpdate struct { NewSystemPrompt string Raw types.Log // Blockchain specific contextual infos } // FilterSystemPromptUpdate is a free log retrieval operation binding the contract event 0xdf5a31f32f865da404304d8e717e689823eab72d259d756d85fc552ef9ac78d8. // // Solidity: event SystemPromptUpdate(string newSystemPrompt) func (_ERC20UtilityAgent *ERC20UtilityAgentFilterer) FilterSystemPromptUpdate(opts *bind.FilterOpts) (*ERC20UtilityAgentSystemPromptUpdateIterator, error) { logs, sub, err := _ERC20UtilityAgent.contract.FilterLogs(opts, "SystemPromptUpdate") if err != nil { return nil, err } return &ERC20UtilityAgentSystemPromptUpdateIterator{contract: _ERC20UtilityAgent.contract, event: "SystemPromptUpdate", logs: logs, sub: sub}, nil } // WatchSystemPromptUpdate is a free log subscription operation binding the contract event 0xdf5a31f32f865da404304d8e717e689823eab72d259d756d85fc552ef9ac78d8. // // Solidity: event SystemPromptUpdate(string newSystemPrompt) func (_ERC20UtilityAgent *ERC20UtilityAgentFilterer) WatchSystemPromptUpdate(opts *bind.WatchOpts, sink chan<- *ERC20UtilityAgentSystemPromptUpdate) (event.Subscription, error) { logs, sub, err := _ERC20UtilityAgent.contract.WatchLogs(opts, "SystemPromptUpdate") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(ERC20UtilityAgentSystemPromptUpdate) if err := _ERC20UtilityAgent.contract.UnpackLog(event, "SystemPromptUpdate", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseSystemPromptUpdate is a log parse operation binding the contract event 0xdf5a31f32f865da404304d8e717e689823eab72d259d756d85fc552ef9ac78d8. // // Solidity: event SystemPromptUpdate(string newSystemPrompt) func (_ERC20UtilityAgent *ERC20UtilityAgentFilterer) ParseSystemPromptUpdate(log types.Log) (*ERC20UtilityAgentSystemPromptUpdate, error) { event := new(ERC20UtilityAgentSystemPromptUpdate) if err := _ERC20UtilityAgent.contract.UnpackLog(event, "SystemPromptUpdate", log); err != nil { return nil, err } event.Raw = log return event, nil } // ERC20UtilityAgentTransferIterator is returned from FilterTransfer and is used to iterate over the raw logs and unpacked data for Transfer events raised by the ERC20UtilityAgent contract. type ERC20UtilityAgentTransferIterator struct { Event *ERC20UtilityAgentTransfer // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *ERC20UtilityAgentTransferIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(ERC20UtilityAgentTransfer) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(ERC20UtilityAgentTransfer) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *ERC20UtilityAgentTransferIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *ERC20UtilityAgentTransferIterator) Close() error { it.sub.Unsubscribe() return nil } // ERC20UtilityAgentTransfer represents a Transfer event raised by the ERC20UtilityAgent contract. type ERC20UtilityAgentTransfer struct { From common.Address To common.Address Value *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterTransfer is a free log retrieval operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. // // Solidity: event Transfer(address indexed from, address indexed to, uint256 value) func (_ERC20UtilityAgent *ERC20UtilityAgentFilterer) FilterTransfer(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*ERC20UtilityAgentTransferIterator, error) { var fromRule []interface{} for _, fromItem := range from { fromRule = append(fromRule, fromItem) } var toRule []interface{} for _, toItem := range to { toRule = append(toRule, toItem) } logs, sub, err := _ERC20UtilityAgent.contract.FilterLogs(opts, "Transfer", fromRule, toRule) if err != nil { return nil, err } return &ERC20UtilityAgentTransferIterator{contract: _ERC20UtilityAgent.contract, event: "Transfer", logs: logs, sub: sub}, nil } // WatchTransfer is a free log subscription operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. // // Solidity: event Transfer(address indexed from, address indexed to, uint256 value) func (_ERC20UtilityAgent *ERC20UtilityAgentFilterer) WatchTransfer(opts *bind.WatchOpts, sink chan<- *ERC20UtilityAgentTransfer, from []common.Address, to []common.Address) (event.Subscription, error) { var fromRule []interface{} for _, fromItem := range from { fromRule = append(fromRule, fromItem) } var toRule []interface{} for _, toItem := range to { toRule = append(toRule, toItem) } logs, sub, err := _ERC20UtilityAgent.contract.WatchLogs(opts, "Transfer", fromRule, toRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(ERC20UtilityAgentTransfer) if err := _ERC20UtilityAgent.contract.UnpackLog(event, "Transfer", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseTransfer is a log parse operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. // // Solidity: event Transfer(address indexed from, address indexed to, uint256 value) func (_ERC20UtilityAgent *ERC20UtilityAgentFilterer) ParseTransfer(log types.Log) (*ERC20UtilityAgentTransfer, error) { event := new(ERC20UtilityAgentTransfer) if err := _ERC20UtilityAgent.contract.UnpackLog(event, "Transfer", log); err != nil { return nil, err } event.Raw = log return event, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/binds/erc20utilityagent/ERC20UtilityAgent.json ================================================ { "_format": "hh-sol-artifact-1", "contractName": "ERC20UtilityAgent", "sourceName": "contracts/utility-agent/ERC20UtilityAgent.sol", "abi": [ { "inputs": [ { "internalType": "string", "name": "name_", "type": "string" }, { "internalType": "string", "name": "symbol_", "type": "string" }, { "internalType": "uint256", "name": "amount_", "type": "uint256" }, { "internalType": "address", "name": "recipient_", "type": "address" }, { "internalType": "string", "name": "systemPrompt_", "type": "string" }, { "internalType": "bytes", "name": "storageInfo_", "type": "bytes" } ], "stateMutability": "nonpayable", "type": "constructor" }, { "inputs": [], "name": "DuplicateUuid", "type": "error" }, { "inputs": [], "name": "InvalidData", "type": "error" }, { "inputs": [], "name": "InvalidShortString", "type": "error" }, { "inputs": [ { "internalType": "string", "name": "str", "type": "string" } ], "name": "StringTooLong", "type": "error" }, { "inputs": [], "name": "ZeroAddress", "type": "error" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "owner", "type": "address" }, { "indexed": true, "internalType": "address", "name": "spender", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "value", "type": "uint256" } ], "name": "Approval", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "delegator", "type": "address" }, { "indexed": true, "internalType": "address", "name": "fromDelegate", "type": "address" }, { "indexed": true, "internalType": "address", "name": "toDelegate", "type": "address" } ], "name": "DelegateChanged", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "delegate", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "previousBalance", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "newBalance", "type": "uint256" } ], "name": "DelegateVotesChanged", "type": "event" }, { "anonymous": false, "inputs": [], "name": "EIP712DomainChanged", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "bytes32", "name": "uuid", "type": "bytes32" }, { "indexed": true, "internalType": "uint256", "name": "inferId", "type": "uint256" }, { "indexed": true, "internalType": "address", "name": "caller", "type": "address" }, { "indexed": false, "internalType": "bytes", "name": "fowardData", "type": "bytes" } ], "name": "ForwardPerformed", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "address", "name": "hybridModel", "type": "address" } ], "name": "ModelUpdate", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "previousOwner", "type": "address" }, { "indexed": true, "internalType": "address", "name": "newOwner", "type": "address" } ], "name": "OwnershipTransferred", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "bytes32", "name": "uuid", "type": "bytes32" }, { "indexed": true, "internalType": "uint256", "name": "inferId", "type": "uint256" }, { "indexed": true, "internalType": "address", "name": "caller", "type": "address" }, { "indexed": false, "internalType": "bytes", "name": "executionData", "type": "bytes" } ], "name": "PromptPerformed", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "address", "name": "promptScheduler", "type": "address" } ], "name": "PromptSchedulerUpdate", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "string", "name": "newSystemPrompt", "type": "string" } ], "name": "SystemPromptUpdate", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "from", "type": "address" }, { "indexed": true, "internalType": "address", "name": "to", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "value", "type": "uint256" } ], "name": "Transfer", "type": "event" }, { "inputs": [], "name": "CLOCK_MODE", "outputs": [ { "internalType": "string", "name": "", "type": "string" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "DOMAIN_SEPARATOR", "outputs": [ { "internalType": "bytes32", "name": "", "type": "bytes32" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "owner", "type": "address" }, { "internalType": "address", "name": "spender", "type": "address" } ], "name": "allowance", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "spender", "type": "address" }, { "internalType": "uint256", "name": "amount", "type": "uint256" } ], "name": "approve", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "account", "type": "address" } ], "name": "balanceOf", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "account", "type": "address" }, { "internalType": "uint32", "name": "pos", "type": "uint32" } ], "name": "checkpoints", "outputs": [ { "components": [ { "internalType": "uint32", "name": "fromBlock", "type": "uint32" }, { "internalType": "uint224", "name": "votes", "type": "uint224" } ], "internalType": "struct ERC20Votes.Checkpoint", "name": "", "type": "tuple" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "clock", "outputs": [ { "internalType": "uint48", "name": "", "type": "uint48" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "decimals", "outputs": [ { "internalType": "uint8", "name": "", "type": "uint8" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "spender", "type": "address" }, { "internalType": "uint256", "name": "subtractedValue", "type": "uint256" } ], "name": "decreaseAllowance", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "delegatee", "type": "address" } ], "name": "delegate", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "delegatee", "type": "address" }, { "internalType": "uint256", "name": "nonce", "type": "uint256" }, { "internalType": "uint256", "name": "expiry", "type": "uint256" }, { "internalType": "uint8", "name": "v", "type": "uint8" }, { "internalType": "bytes32", "name": "r", "type": "bytes32" }, { "internalType": "bytes32", "name": "s", "type": "bytes32" } ], "name": "delegateBySig", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "account", "type": "address" } ], "name": "delegates", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "eip712Domain", "outputs": [ { "internalType": "bytes1", "name": "fields", "type": "bytes1" }, { "internalType": "string", "name": "name", "type": "string" }, { "internalType": "string", "name": "version", "type": "string" }, { "internalType": "uint256", "name": "chainId", "type": "uint256" }, { "internalType": "address", "name": "verifyingContract", "type": "address" }, { "internalType": "bytes32", "name": "salt", "type": "bytes32" }, { "internalType": "uint256[]", "name": "extensions", "type": "uint256[]" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "fetchCode", "outputs": [ { "internalType": "string", "name": "logic", "type": "string" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "bytes32", "name": "uuid", "type": "bytes32" }, { "internalType": "address", "name": "dstAgent", "type": "address" }, { "internalType": "bytes", "name": "request", "type": "bytes" } ], "name": "forward", "outputs": [ { "internalType": "uint256", "name": "dstActionId", "type": "uint256" } ], "stateMutability": "payable", "type": "function" }, { "inputs": [], "name": "getFileStorageChunkInfo", "outputs": [ { "components": [ { "internalType": "uint256", "name": "size", "type": "uint256" }, { "components": [ { "internalType": "address", "name": "pointer", "type": "address" }, { "internalType": "uint32", "name": "start", "type": "uint32" }, { "internalType": "uint32", "name": "end", "type": "uint32" } ], "internalType": "struct BytecodeSlice[]", "name": "slices", "type": "tuple[]" } ], "internalType": "struct File", "name": "file", "type": "tuple" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "timepoint", "type": "uint256" } ], "name": "getPastTotalSupply", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "account", "type": "address" }, { "internalType": "uint256", "name": "timepoint", "type": "uint256" } ], "name": "getPastVotes", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "id", "type": "uint256" } ], "name": "getResultById", "outputs": [ { "internalType": "bytes", "name": "", "type": "bytes" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "bytes32", "name": "uuid", "type": "bytes32" } ], "name": "getResultById", "outputs": [ { "internalType": "bytes", "name": "", "type": "bytes" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "getStorageInfo", "outputs": [ { "components": [ { "internalType": "address", "name": "contractAddress", "type": "address" }, { "internalType": "string", "name": "filename", "type": "string" } ], "internalType": "struct IUtilityAgent.StorageInfo", "name": "", "type": "tuple" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "getStorageMode", "outputs": [ { "internalType": "string", "name": "", "type": "string" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "getSystemPrompt", "outputs": [ { "internalType": "string", "name": "", "type": "string" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "account", "type": "address" } ], "name": "getVotes", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "spender", "type": "address" }, { "internalType": "uint256", "name": "addedValue", "type": "uint256" } ], "name": "increaseAllowance", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "name", "outputs": [ { "internalType": "string", "name": "", "type": "string" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "owner", "type": "address" } ], "name": "nonces", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "account", "type": "address" } ], "name": "numCheckpoints", "outputs": [ { "internalType": "uint32", "name": "", "type": "uint32" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "owner", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "owner", "type": "address" }, { "internalType": "address", "name": "spender", "type": "address" }, { "internalType": "uint256", "name": "value", "type": "uint256" }, { "internalType": "uint256", "name": "deadline", "type": "uint256" }, { "internalType": "uint8", "name": "v", "type": "uint8" }, { "internalType": "bytes32", "name": "r", "type": "bytes32" }, { "internalType": "bytes32", "name": "s", "type": "bytes32" } ], "name": "permit", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "bytes", "name": "request", "type": "bytes" } ], "name": "prompt", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "bytes32", "name": "uuid", "type": "bytes32" }, { "internalType": "bytes", "name": "request", "type": "bytes" } ], "name": "prompt", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "payable", "type": "function" }, { "inputs": [], "name": "renounceOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "symbol", "outputs": [ { "internalType": "string", "name": "", "type": "string" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "totalSupply", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "to", "type": "address" }, { "internalType": "uint256", "name": "amount", "type": "uint256" } ], "name": "transfer", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "from", "type": "address" }, { "internalType": "address", "name": "to", "type": "address" }, { "internalType": "uint256", "name": "amount", "type": "uint256" } ], "name": "transferFrom", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "newOwner", "type": "address" } ], "name": "transferOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "string", "name": "filename", "type": "string" } ], "name": "updateFileName", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "string", "name": "systemPrompt", "type": "string" } ], "name": "updateSystemPrompt", "outputs": [], "stateMutability": "nonpayable", "type": "function" } ], "bytecode": "0x610180604052346200008257620000266200001962000193565b949390939291926200024a565b6040516141509081620015348239608051816130f5015260a051816131b0015260c051816130c6015260e051816131440152610100518161316a01526101205181611347015261014051816113710152610160518161068a0152f35b600080fd5b634e487b7160e01b600052604160045260246000fd5b604081019081106001600160401b03821117620000b957604052565b62000087565b601f909101601f19168101906001600160401b03821190821017620000b957604052565b60405190620000f2826200009d565b565b60005b838110620001085750506000910152565b8181015183820152602001620000f7565b81601f82011215620000825780516001600160401b038111620000b9576040519262000150601f8301601f191660200185620000bf565b818452602082840101116200008257620001719160208085019101620000f4565b90565b6001600160a01b038116036200008257565b5190620000f28262000174565b620056a48038038060405192620001ab8285620000bf565b8339810160c082820312620000825781516001600160401b0390818111620000825782620001db91850162000119565b6020840151828111620000825783620001f691860162000119565b946040850151946200020b6060820162000186565b9460808201518581116200008257816200022791840162000119565b9460a0830151908111620000825762000241920162000119565b91959493929190565b9594909193956040516200025e816200009d565b6001808252603160f81b6020808401918252845190969194926001600160401b038211620000b9576200029e826200029860035462000411565b6200044e565b8790601f831160011462000371575092620002f26200034c979693620002e984620000f29e9f979562000346999660009162000365575b508160011b916000199060031b1c19161790565b60035562000670565b620002fd8162000a50565b610120526200030c8262000b5d565b6101405287815191012060e052519020610100524660a0526200032e62000c6a565b6080523060c052620003403362000a07565b6200076b565b6200087b565b6200035662000859565b80519101206101605262000d3c565b905085015138620002d5565b600360005290601f1983167fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b926000905b828210620003f957505093600184620000f29e9f9794620002f294620003469a976200034c9d9c9910620003df575b5050811b0160035562000670565b86015160001960f88460031b161c191690553880620003d1565b87840151855593840193928b0192908b0190620003a2565b90600182811c9216801562000443575b60208310146200042d57565b634e487b7160e01b600052602260045260246000fd5b91607f169162000421565b601f81116200045b575050565b60009060036000526020600020906020601f850160051c830194106200049e575b601f0160051c01915b8281106200049257505050565b81815560010162000485565b90925082906200047c565b601f8111620004b6575050565b60009060046000526020600020906020601f850160051c83019410620004f9575b601f0160051c01915b828110620004ed57505050565b818155600101620004e0565b9092508290620004d7565b601f811162000511575050565b600090600d6000526020600020906020601f850160051c8301941062000554575b601f0160051c01915b8281106200054857505050565b8181556001016200053b565b909250829062000532565b601f81116200056c575050565b600090600f6000526020600020906020601f850160051c83019410620005af575b601f0160051c01915b828110620005a357505050565b81815560010162000596565b90925082906200058d565b601f8111620005c7575050565b60009060056000526020600020906020601f850160051c830194106200060a575b601f0160051c01915b828110620005fe57505050565b818155600101620005f1565b9092508290620005e8565b601f811162000622575050565b60009060066000526020600020906020601f850160051c8301941062000665575b601f0160051c01915b8281106200065957505050565b8181556001016200064c565b909250829062000643565b80519091906001600160401b038111620000b9576200069c816200069660045462000411565b620004a9565b602080601f8311600114620006e357508190620006d29394600092620006d7575b50508160011b916000199060031b1c19161790565b600455565b015190503880620006bd565b6004600052601f198316949091907f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b926000905b8782106200075257505083600195961062000738575b505050811b01600455565b015160001960f88460031b161c191690553880806200072d565b8060018596829496860151815501950193019062000717565b80519091906001600160401b038111620000b957620007978162000791600d5462000411565b62000504565b602080601f8311600114620007d157508190620007cc9394600092620006d75750508160011b916000199060031b1c19161790565b600d55565b600d600052601f198316949091907fd7b6990105719101dabeb77144f2a3385c8033acd3af97e9423a695e81ad1eb5926000905b8782106200084057505083600195961062000826575b505050811b01600d55565b015160001960f88460031b161c191690553880806200081b565b8060018596829496860151815501950193019062000805565b6040519062000868826200009d565b60048252636970667360e01b6020830152565b906014825110620009f5578151820191602060408285031262000082578082015193620008a88562000174565b60408301516001600160401b0393848211620000825783620008d4928162000913950192010162000119565b9460018060a01b03168583604051620008ed816200009d565b8381520152600e80546001600160a01b0319166001600160a01b03909216919091179055565b8351918211620000b95762000935826200092f600f5462000411565b6200055f565b80601f83116001146200096d57508190620009689394600092620006d75750508160011b916000199060031b1c19161790565b600f55565b600f600052601f198316949091907f8d1108e10bcb7c27dddfc02ed9d693a074039d026cf4ea4240b40f7d581ac802926000905b878210620009dc575050836001959610620009c2575b505050811b01600f55565b015160001960f88460031b161c19169055388080620009b7565b80600185968294968601518155019501930190620009a1565b604051635cb045db60e01b8152600490fd5b600c80546001600160a01b039283166001600160a01b0319821681179092559091167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a3565b908151602080821060001462000a6e57505090620001719062000e2b565b6001600160401b038211620000b95762000a958262000a8f60055462000411565b620005ba565b602090601f831160011462000ad25750819062000aca9394600092620006d75750508160011b916000199060031b1c19161790565b60055560ff90565b6005600052601f198316949091907f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db0926000905b87821062000b4457505083600195961062000b2a575b505050811b0160055560ff90565b015160001960f88460031b161c1916905538808062000b1c565b8060018596829496860151815501950193019062000b06565b908151602080821060001462000b7b57505090620001719062000e2b565b6001600160401b038211620000b95762000ba28262000b9c60065462000411565b62000615565b602090601f831160011462000bdf5750819062000bd79394600092620006d75750508160011b916000199060031b1c19161790565b60065560ff90565b6006600052601f198316949091907ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f926000905b87821062000c5157505083600195961062000c37575b505050811b0160065560ff90565b015160001960f88460031b161c1916905538808062000c29565b8060018596829496860151815501950193019062000c13565b60e051610100516040519060208201927f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f8452604083015260608201524660808201523060a082015260a0815260c0810181811060018060401b03821117620000b95760405251902090565b1562000cde57565b60405162461bcd60e51b815260206004820152603060248201527f4552433230566f7465733a20746f74616c20737570706c79207269736b73206f60448201526f766572666c6f77696e6720766f74657360801b6064820152608490fd5b906001600160a01b038216801562000de65760025482810180911162000de05762000ddc9362000dbe9262000d718593600255565b6001600160a01b038216600090815260208181526040808320805487019055518581527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9190a3620013a1565b60025462000dd6906001600160e01b03101562000cd6565b62000fba565b5050565b62000e9a565b60405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606490fd5b601f81511162000e5957602081519101516020821062000e49571790565b6000198260200360031b1b161790565b6044604051809263305a27a960e01b82526020600483015262000e8c8151809281602486015260208686019101620000f4565b601f01601f19168101030190fd5b634e487b7160e01b600052601160045260246000fd5b604080519192919081016001600160401b03811182821017620000b957604052602081935463ffffffff81168352811c910152565b600b549068010000000000000000821015620000b9576001820180600b5582101562000f5357600b600052805160209182015190911b63ffffffff191663ffffffff91909116177f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01db990910155565b634e487b7160e01b600052603260045260246000fd5b90815468010000000000000000811015620000b9576001810180845581101562000f5357600092835260209283902082519284015190931b63ffffffff191663ffffffff9290921691909117910155565b600b5490918115918215620011025762000fd3620000e3565b60008152600060208201525b60208101516200100c9062001004906001600160e01b03165b6001600160e01b031690565b958662001517565b93159081620010db575b50156200107357620000f2906200105c620010318562001337565b600b600052917f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01db80190565b9063ffffffff82549181199060201b169116179055565b50620000f26200109c620010966200108b43620014af565b65ffffffffffff1690565b620012d1565b620010d5620010ab8562001337565b620010c5620010b9620000e3565b63ffffffff9094168452565b6001600160e01b03166020830152565b62000ee5565b5163ffffffff16905063ffffffff620010f86200108b43620014af565b9116143862001016565b600b6000526200113a7f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01db8820162000eb0565b62000eb0565b62000fdf565b90918154918215928360001462001244576200115b620000e3565b60008152600060208201525b60208101516200118d9062001185906001600160e01b031662000ff8565b968762001525565b941590816200121d575b5015620011c4576200105c620000f292620011b28662001337565b92600019019060005260206000200190565b50620000f290620011dd620010966200108b43620014af565b9062001217620011ed8662001337565b62001207620011fb620000e3565b63ffffffff9095168552565b6001600160e01b03166020840152565b62000f69565b5163ffffffff16905063ffffffff6200123a6200108b43620014af565b9116143862001197565b6200125e6200113460001983018460005260206000200190565b62001167565b909181549182159283600014620012b1576200127f620000e3565b60008152600060208201525b60208101516200118d90620012a9906001600160e01b031662000ff8565b968762001517565b620012cb6200113460001983018460005260206000200190565b6200128b565b63ffffffff90818111620012e3571690565b60405162461bcd60e51b815260206004820152602660248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203360448201526532206269747360d01b6064820152608490fd5b6001600160e01b03908181116200134c571690565b60405162461bcd60e51b815260206004820152602760248201527f53616665436173743a2076616c756520646f65736e27742066697420696e20326044820152663234206269747360c81b6064820152608490fd5b60096020527fec8156718a8372b1db44bb411437d0870f3e3790d4a08526d024ce1b0b668f6b546001600160a01b039182166000908152604081205483169392909116908184141580620014a5575b620013fc575b50505050565b82908262001464575b5050508162001417575b8080620013f6565b6001600160a01b0382166000908152600a6020526040902060008051602062005684833981519152916200144b9162001264565b60408051928352602083019190915290a238806200140f565b6000805160206200568483398151915291604082856200148b9452600a6020522062001140565b60408051928352602083019190915290a238818162001405565b50821515620013f0565b65ffffffffffff90818111620014c3571690565b60405162461bcd60e51b815260206004820152602660248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203460448201526538206269747360d01b6064820152608490fd5b90810180911162000de05790565b90810390811162000de0579056fe6080604052600436101561001257600080fd5b60003560e01c806306fdde031461029257806307679a641461028d57806308112bdf1461026a578063095ea7b31461028857806318160ddd146102835780631d959e5d1461027e57806323b872dd14610279578063313ce567146102745780633644e5151461026f578063365bec7f1461026a57806339509351146102655780633a46b1a814610260578063481622f91461025b5780634bf5d7e914610256578063587cde1e146102515780635c19a95c1461024c5780636fcfff451461024757806370a0823114610242578063715018a61461023d57806376a3002914610238578063793042c9146102335780637ecebe001461022e57806384b0196e146102295780638da5cb5b146102245780638e539e8c1461021f57806391ddadf41461021a57806395d89b41146102155780639ab24eb014610210578063a457c2d71461020b578063a9059cbb14610206578063b213c50814610201578063be16d94a146101fc578063c3cda520146101f7578063d505accf146101f2578063dd62ed3e146101ed578063e702c420146101e8578063f1127ed8146101e3578063f2fde38b146101de578063f514b5b8146101d95763f73eb6f3146101d457600080fd5b612440565b6121a2565b612069565b611fa2565b611ef0565b611e53565b611ca8565b611b05565b611a7b565b6119ac565b6118da565b6117cb565b61171c565b611656565b61160c565b611495565b611443565b61130e565b6112a5565b61124f565b611081565b610e2f565b610dc6565b610d4f565b610d09565b610c9e565b610bb5565b610b67565b6109b6565b610928565b610501565b6108e7565b6108ad565b61075b565b610649565b61060d565b6105ba565b61043b565b610311565b60005b8381106102aa5750506000910152565b818101518382015260200161029a565b907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f6020936102f681518092818752878088019101610297565b0116010190565b90602061030e9281815201906102ba565b90565b34610436576000807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261043357604051908060035490610353826125e7565b808552916020916001918281169081156103e85750600114610390575b61038c8661038081880382610f72565b604051918291826102fd565b0390f35b9350600384527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b5b8385106103d5575050505081016020016103808261038c38610370565b80548686018401529382019381016103b8565b87965061038c979450602093506103809592507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0091501682840152151560051b820101929338610370565b80fd5b600080fd5b34610436576000807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610433576040519080600d549061047d826125e7565b808552916020916001918281169081156103e857506001146104a95761038c8661038081880382610f72565b9350600d84527fd7b6990105719101dabeb77144f2a3385c8033acd3af97e9423a695e81ad1eb55b8385106104ee575050505081016020016103808261038c38610370565b80548686018401529382019381016104d1565b34610436576020807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261043657604051908082528181606051808284015260005b818110610584575060008382018301830152601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820101030190f35b60808101518682018401840152859350849201610545565b73ffffffffffffffffffffffffffffffffffffffff81160361043657565b346104365760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610436576106026004356105f88161059c565b6024359033612b90565b602060405160018152f35b346104365760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610436576020600254604051908152f35b34610436576000807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610433576106816128a9565b602081519101207f0000000000000000000000000000000000000000000000000000000000000000146000146106bd575061038c61038061270d565b600e5473ffffffffffffffffffffffffffffffffffffffff16908060405180937fe0876aa8000000000000000000000000000000000000000000000000000000008252818061070e60048201612829565b03915afa80156107565761038c928261072e9392610733575b5050612d4f565b610380565b61074f92503d8091833e6107478183610f72565b81019061273d565b3880610727565b612838565b346104365760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610436576004356107968161059c565b6024356107a28161059c565b6044359073ffffffffffffffffffffffffffffffffffffffff831660005260016020526107f33360406000209073ffffffffffffffffffffffffffffffffffffffff16600052602052604060002090565b54927fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8403610833575b6108279350612f33565b60405160018152602090f35b82841061084f5761084a8361082795033383612b90565b61081d565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152fd5b346104365760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261043657602060405160128152f35b346104365760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126104365760206109206130af565b604051908152f35b346104365760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610436576004356109638161059c565b33600052600160205261099a8160406000209073ffffffffffffffffffffffffffffffffffffffff16600052602052604060002090565b5460243581018091116109b1576106029133612b90565b61259d565b346104365760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610436576004356109f18161059c565b73ffffffffffffffffffffffffffffffffffffffff60243591610a2565ffffffffffff610a1d43613593565b168410612844565b16600052600a602052604060002080549160008360058111610b16575b50905b838210610ac557505081610a80575050602060005b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff60405191168152f35b610ab9610ac0917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff602094019060005260206000200190565b5460201c90565b610a5a565b9092610ad18185613924565b908263ffffffff610af6610aec858860005260206000200190565b5463ffffffff1690565b161115610b065750925b90610a45565b9350610b11906125cc565b610b00565b80610b26610b2c929693966137e4565b906125da565b908263ffffffff610b47610aec858860005260206000200190565b161115610b575750925b38610a42565b9350610b62906125cc565b610b51565b346104365760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126104365761038c610ba16128a9565b6040519182916020835260208301906102ba565b346104365760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610436574365ffffffffffff610bf543613593565b1603610c405761038c604051610c0a81610efd565b601d81527f6d6f64653d626c6f636b6e756d6265722666726f6d3d64656661756c740000006020820152604051918291826102fd565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f4552433230566f7465733a2062726f6b656e20636c6f636b206d6f64650000006044820152fd5b346104365760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610436576020600435610cdb8161059c565b73ffffffffffffffffffffffffffffffffffffffff8091166000526009825260406000205416604051908152f35b346104365760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261043657610d4d600435610d478161059c565b336131d6565b005b346104365760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126104365773ffffffffffffffffffffffffffffffffffffffff600435610d9f8161059c565b16600052600a6020526020610db8604060002054613287565b63ffffffff60405191168152f35b346104365760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126104365773ffffffffffffffffffffffffffffffffffffffff600435610e168161059c565b1660005260006020526020604060002054604051908152f35b34610436576000807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261043357610e6761331c565b8073ffffffffffffffffffffffffffffffffffffffff600c547fffffffffffffffffffffffff00000000000000000000000000000000000000008116600c55167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040810190811067ffffffffffffffff821117610f1957604052565b610ece565b6060810190811067ffffffffffffffff821117610f1957604052565b6020810190811067ffffffffffffffff821117610f1957604052565b60c0810190811067ffffffffffffffff821117610f1957604052565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff821117610f1957604052565b60405190610fc082610efd565b565b92919267ffffffffffffffff8211610f19576040519161100a60207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8401160184610f72565b829481845281830111610436578281602093846000960137010152565b60207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc820112610436576004359067ffffffffffffffff821161043657806023830112156104365781602461030e93600401359101610fc2565b346104365761108f36611027565b61109761331c565b805167ffffffffffffffff8111610f19576110bc816110b7600d546125e7565b612939565b602080601f831160011461114e57509161112f8261113e937fdf5a31f32f865da404304d8e717e689823eab72d259d756d85fc552ef9ac78d895600091611143575b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8260011b9260031b1c19161790565b600d55604051918291826102fd565b0390a1005b9050830151386110fe565b600d600052907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe083167fd7b6990105719101dabeb77144f2a3385c8033acd3af97e9423a695e81ad1eb5926000905b82821061121c575050927fdf5a31f32f865da404304d8e717e689823eab72d259d756d85fc552ef9ac78d894926001928261113e96106111e5575b5050811b01600d55610380565b8401517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60f88460031b161c1916905538806111d8565b80600185968294968a0151815501950193019061119d565b9080601f830112156104365781602061030e93359101610fc2565b60207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126104365760043567ffffffffffffffff811161043657611299903690600401611234565b50602060405160008152f35b346104365760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126104365773ffffffffffffffffffffffffffffffffffffffff6004356112f58161059c565b1660005260076020526020604060002054604051908152f35b34610436576000807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610433576113e69061136b7f000000000000000000000000000000000000000000000000000000000000000061339b565b906113957f00000000000000000000000000000000000000000000000000000000000000006134d3565b90604051916113a383610f3a565b8183526113f46020916040519687967f0f00000000000000000000000000000000000000000000000000000000000000885260e0602089015260e08801906102ba565b9086820360408801526102ba565b904660608601523060808601528260a086015284820360c0860152602080855193848152019401925b82811061142c57505050500390f35b83518552869550938101939281019260010161141d565b346104365760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261043657602073ffffffffffffffffffffffffffffffffffffffff600c5416604051908152f35b346104365760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610436576004356114e265ffffffffffff6114da43613593565b168210612844565b600b5490600082600581116115a5575b50905b82821061154257828061150f575060405160008152602090f35b600b600052602090610ac0907f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01db801610ab9565b909161154e8184613924565b600b600052908263ffffffff6115857f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01db98501610aec565b1611156115955750915b906114f5565b92506115a0906125cc565b61158f565b80610b266115b5929593956137e4565b600b600052908263ffffffff6115ec7f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01db98501610aec565b1611156115fc5750915b386114f2565b9250611607906125cc565b6115f6565b346104365760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261043657602061164643613593565b65ffffffffffff60405191168152f35b34610436576000807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261043357604051908060045490611698826125e7565b808552916020916001918281169081156103e857506001146116c45761038c8661038081880382610f72565b9350600484527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b5b838510611709575050505081016020016103808261038c38610370565b80548686018401529382019381016116ec565b346104365760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126104365773ffffffffffffffffffffffffffffffffffffffff60043561176c8161059c565b16600052600a60205260406000208054801560001461179357505060405160008152602090f35b6020917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6117c2920190612a1d565b5054811c610a5a565b346104365760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610436576004356118068161059c565b602435903360005260016020526118418160406000209073ffffffffffffffffffffffffffffffffffffffff16600052602052604060002090565b54918083106118565761082792039033612b90565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760448201527f207a65726f0000000000000000000000000000000000000000000000000000006064820152fd5b346104365760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610436576106026004356119188161059c565b6024359033612f33565b906020908183526060918060608501928051828701520151938160806040926040808201528751809652019501936000915b8483106119645750505050505090565b8551805173ffffffffffffffffffffffffffffffffffffffff1688528085015163ffffffff908116898701529082015116878201529581019594830194600190920191611954565b34610436576000807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610433576119e4612a64565b5073ffffffffffffffffffffffffffffffffffffffff600e54168160405180927fe0876aa8000000000000000000000000000000000000000000000000000000008252602060048301528180611a3c6024820161263a565b03915afa908115610756578261038c9392611a60575b505060405191829182611922565b611a7492503d8091833e6107478183610f72565b3880611a52565b60407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126104365760243567ffffffffffffffff8082116104365736602383011215610436578160040135908111610436573691016024011161043657602060405160008152f35b6064359060ff8216820361043657565b6084359060ff8216820361043657565b346104365760c07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261043657600435611b408161059c565b60443590602435611b4f611ae5565b92804211611c4a57611c0b611c4591610d4d9560405190611bf382611bc76020820195898b8860609194939273ffffffffffffffffffffffffffffffffffffffff60808301967fe48329057bfd03d55e49b547132e39cffd9c1820ad7b9d4c5307691425d15adf845216602083015260408201520152565b037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08101845283610f72565b611c0660a435936084359351902061362a565b61366b565b91611c3f8373ffffffffffffffffffffffffffffffffffffffff166000526007602052604060002090815491600183019055565b14612a7e565b6131d6565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f4552433230566f7465733a207369676e617475726520657870697265640000006044820152fd5b346104365760e07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261043657600435611ce38161059c565b602435611cef8161059c565b6044359060643592611cff611af5565b93804211611df557611dd0611df091611bc7610d4d97611dbd611d4b8773ffffffffffffffffffffffffffffffffffffffff166000526007602052604060002090815491600183019055565b9360405193849160208301968c8c8c8a91959493909260a09360c08401977f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9855273ffffffffffffffffffffffffffffffffffffffff8092166020860152166040840152606083015260808201520152565b611c0660c4359360a4359351902061362a565b73ffffffffffffffffffffffffffffffffffffffff808416911614612ae3565b612b90565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f45524332305065726d69743a206578706972656420646561646c696e650000006044820152fd5b346104365760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610436576020611ee7600435611e938161059c565b73ffffffffffffffffffffffffffffffffffffffff60243591611eb58361059c565b166000526001835260406000209073ffffffffffffffffffffffffffffffffffffffff16600052602052604060002090565b54604051908152f35b346104365760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261043657611f27612a64565b50604051611f3481610efd565b73ffffffffffffffffffffffffffffffffffffffff9081600e5416815261038c604051611f6b81611f648161263a565b0382610f72565b6020830190815260405193849360208552511660208401525160408084015260608301906102ba565b63ffffffff81160361043657565b346104365760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261043657604061203361202d600435611fe58161059c565b73ffffffffffffffffffffffffffffffffffffffff6024359161200783611f94565b60006020875161201681610efd565b828152015216600052600a60205283600020612a1d565b50612b48565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff602083519263ffffffff81511684520151166020820152f35b346104365760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610436576004356120a48161059c565b6120ac61331c565b73ffffffffffffffffffffffffffffffffffffffff80911690811561211e57600c54827fffffffffffffffffffffffff0000000000000000000000000000000000000000821617600c55167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a3005b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152fd5b60607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610436576004356024356121db8161059c565b67ffffffffffffffff90604435828111610436576121fd903690600401611234565b9273ffffffffffffffffffffffffffffffffffffffff938461224661222c846000526010602052604060002090565b5473ffffffffffffffffffffffffffffffffffffffff1690565b166124165761225490613699565b91602060405180967fbe16d94a00000000000000000000000000000000000000000000000000000000825281600081612291898960048401612b79565b039286165af19384156107565761038c956000956123d9575b508492916122ef612396926122dc6122c0610fb3565b73ffffffffffffffffffffffffffffffffffffffff9094168452565b851667ffffffffffffffff166020830152565b612303836000526010602052604060002090565b815181547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff9190911617815590602001517fffffffff0000000000000000ffffffffffffffffffffffffffffffffffffffff7bffffffffffffffff000000000000000000000000000000000000000083549260a01b169116179055565b7f103ab115fdd2f05d2720873cd21aeff07c1206de37259cdeb99463da9ff512e0604051806123c63396826102fd565b0390a46040519081529081906020820190565b6122ef95509161240561239692949360203d60201161240f575b6123fd8183610f72565b810190612b6a565b95509192906122aa565b503d6123f3565b60046040517f339f7ff5000000000000000000000000000000000000000000000000000000008152fd5b346104365761244e36611027565b61245661331c565b805167ffffffffffffffff8111610f195761247b81612476600f546125e7565b6129ab565b602080601f83116001146124da575081906124ca936000926124cf575b50507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8260011b9260031b1c19161790565b600f55005b015190503880612498565b907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe083169361252b600f6000527f8d1108e10bcb7c27dddfc02ed9d693a074039d026cf4ea4240b40f7d581ac80290565b926000905b868210612585575050836001951061254e575b505050811b01600f55005b01517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60f88460031b161c19169055388080612543565b80600185968294968601518155019501930190612530565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b90600182018092116109b157565b919082039182116109b157565b90600182811c92168015612630575b602083101461260157565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b91607f16916125f6565b600f546000929161264a826125e7565b808252916020906001908181169081156126c9575060011461266d575b50505050565b92939450600f6000527f8d1108e10bcb7c27dddfc02ed9d693a074039d026cf4ea4240b40f7d581ac802926000935b8585106126b6575050506020925001019038808080612667565b805485850184015293820193810161269c565b91505060209495507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0091509291921683830152151560051b01019038808080612667565b60405190610fc08261271e8161263a565b0383610f72565b67ffffffffffffffff8111610f195760051b60200190565b6020808284031261043657815167ffffffffffffffff9283821161043657019260409283858303126104365783519461277586610efd565b8051865283810151918211610436570181601f820112156104365780519161279c83612725565b946127a981519687610f72565b8386528486019185606080960285010193818511610436578601925b8484106127d85750505050505082015290565b85848303126104365786869184516127ef81610f1e565b86516127fa8161059c565b81528287015161280981611f94565b838201528587015161281a81611f94565b868201528152019301926127c5565b602061030e918181520161263a565b6040513d6000823e3d90fd5b1561284b57565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f4552433230566f7465733a20667574757265206c6f6f6b7570000000000000006044820152fd5b600e5473ffffffffffffffffffffffffffffffffffffffff1615612900576040516128d381610efd565b600281527f6673000000000000000000000000000000000000000000000000000000000000602082015290565b60405161290c81610efd565b600481527f6970667300000000000000000000000000000000000000000000000000000000602082015290565b601f8111612945575050565b600090600d6000527fd7b6990105719101dabeb77144f2a3385c8033acd3af97e9423a695e81ad1eb5906020601f850160051c830194106129a1575b601f0160051c01915b82811061299657505050565b81815560010161298a565b9092508290612981565b601f81116129b7575050565b600090600f6000527f8d1108e10bcb7c27dddfc02ed9d693a074039d026cf4ea4240b40f7d581ac802906020601f850160051c83019410612a13575b601f0160051c01915b828110612a0857505050565b8181556001016129fc565b90925082906129f3565b8054821015612a355760005260206000200190600090565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60405190612a7182610efd565b6060602083600081520152565b15612a8557565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f4552433230566f7465733a20696e76616c6964206e6f6e6365000000000000006044820152fd5b15612aea57565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f45524332305065726d69743a20696e76616c6964207369676e617475726500006044820152fd5b90604051612b5581610efd565b602081935463ffffffff81168352811c910152565b90816020910312610436575190565b60409061030e9392815281602082015201906102ba565b9073ffffffffffffffffffffffffffffffffffffffff91828116928315612ccc578216938415612c485780612c327f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92594612c0d612c439573ffffffffffffffffffffffffffffffffffffffff166000526001602052604060002090565b9073ffffffffffffffffffffffffffffffffffffffff16600052602052604060002090565b556040519081529081906020820190565b0390a3565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f20616464726560448201527f73730000000000000000000000000000000000000000000000000000000000006064820152fd5b60846040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460448201527f72657373000000000000000000000000000000000000000000000000000000006064820152fd5b906020809201518051906020916040805195600080945b848610612da557505050505050601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe091828101855201168201604052565b909192939495838760051b8301015180518686830151920151813b808211612de6575082849392600195938e930394859301903c0196019493929190612d66565b9260849387937f86d14d89000000000000000000000000000000000000000000000000000000008552600452602452604452606452fd5b15612e2457565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201527f65737300000000000000000000000000000000000000000000000000000000006064820152fd5b15612eaf57565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206260448201527f616c616e636500000000000000000000000000000000000000000000000000006064820152fd5b919073ffffffffffffffffffffffffffffffffffffffff92838116801561302b57610fc094831690612f66821515612e1d565b84612f918473ffffffffffffffffffffffffffffffffffffffff166000526000602052604060002090565b54612f9e82821015612ea8565b03612fc98473ffffffffffffffffffffffffffffffffffffffff166000526000602052604060002090565b55612ff48473ffffffffffffffffffffffffffffffffffffffff166000526000602052604060002090565b8054860190556040518581527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90602090a3613e61565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f20616460448201527f64726573730000000000000000000000000000000000000000000000000000006064820152fd5b73ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000163014806131ad575b15613117577f000000000000000000000000000000000000000000000000000000000000000090565b60405160208101907f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f82527f000000000000000000000000000000000000000000000000000000000000000060408201527f000000000000000000000000000000000000000000000000000000000000000060608201524660808201523060a082015260a081526131a781610f56565b51902090565b507f000000000000000000000000000000000000000000000000000000000000000046146130ee565b610fc09173ffffffffffffffffffffffffffffffffffffffff80921660008181526009602052836040822054168092826020527f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f604084205496600960205261327d87604087209073ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffff0000000000000000000000000000000000000000825416179055565b86169380a4613939565b63ffffffff90818111613298571690565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203360448201527f32206269747300000000000000000000000000000000000000000000000000006064820152fd5b73ffffffffffffffffffffffffffffffffffffffff600c5416330361333d57565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b60ff81146133f15760ff811690601f82116133c757604051916133bd83610efd565b8252602082015290565b60046040517fb3512b0c000000000000000000000000000000000000000000000000000000008152fd5b50604051600554816000613404836125e7565b80835292602090600190818116908115613490575060011461342f575b505061030e92500382610f72565b91509260056000527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db0936000925b828410613478575061030e9450505081016020013880613421565b8554878501830152948501948694509281019261345d565b90506020935061030e9592507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0091501682840152151560051b8201013880613421565b60ff81146134f55760ff811690601f82116133c757604051916133bd83610efd565b50604051600654816000613508836125e7565b80835292602090600190818116908115613490575060011461353257505061030e92500382610f72565b91509260066000527ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f936000925b82841061357b575061030e9450505081016020013880613421565b85548785018301529485019486945092810192613560565b65ffffffffffff908181116135a6571690565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203460448201527f38206269747300000000000000000000000000000000000000000000000000006064820152fd5b6042906136356130af565b90604051917f19010000000000000000000000000000000000000000000000000000000000008352600283015260228201522090565b9161030e939161367a93613c10565b919091613cd8565b9061369560209282815194859201610297565b0190565b60405190816020600090600d54906136b0826125e7565b916001908181169081156137645750600114613703575b5050506136d79061030e93613682565b037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08101835282610f72565b90919250600d6000527fd7b6990105719101dabeb77144f2a3385c8033acd3af97e9423a695e81ad1eb5906000915b84831061374e57505050508101602001826136d761030e6136c7565b8054888401850152879550918301918101613732565b6136d795506020935061030e979492507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0091501682860152801515028401019181946136c7565b81156137b5570490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b801561391e57806138b76138b06138a661389c61389261388861387e613874600161030e9a6000908b60801c80613912575b508060401c80613905575b508060201c806138f8575b508060101c806138eb575b508060081c806138de575b508060041c806138d1575b508060021c806138c4575b50821c6138bd575b811c1b61386d818b6137ab565b0160011c90565b61386d818a6137ab565b61386d81896137ab565b61386d81886137ab565b61386d81876137ab565b61386d81866137ab565b61386d81856137ab565b80926137ab565b90613ea2565b8101613860565b6002915091019038613858565b600491509101903861384d565b6008915091019038613842565b6010915091019038613837565b602091509101903861382c565b6040915091019038613821565b91505060809038613816565b50600090565b90808216911860011c81018091116109b15790565b919073ffffffffffffffffffffffffffffffffffffffff80821693168381141580613c07575b6139695750505050565b806139e9575b508261397c575b80612667565b7fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a724916139cb6139d09273ffffffffffffffffffffffffffffffffffffffff16600052600a602052604060002090565b613f47565b60408051928352602083019190915290a2388080613976565b80600052600a6020527fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a7246040600020805480159182600014613bc657613a2d610fb3565b6000815260006020820152915b613a87613a6660208501517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1690565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1690565b92613a928985614100565b94159081613ba3575b5015613b2c57613ae1613b16927fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff613ad287614053565b93019060005260206000200190565b9063ffffffff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000000083549260201b169116179055565b604080519182526020820192909252a23861396f565b50613b9e90613b50613b4b613b4043613593565b65ffffffffffff1690565b613287565b90613b99613b5d86614053565b613b74613b68610fb3565b63ffffffff9095168552565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff166020840152565b613eb4565b613b16565b5163ffffffff16905063ffffffff613bbd613b4043613593565b91161438613a9b565b613c01613bfc7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff84018360005260206000200190565b612b48565b91613a3a565b5082151561395f565b9291907f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311613c935791608094939160ff602094604051948552168484015260408301526060820152600093849182805260015afa1561075657815173ffffffffffffffffffffffffffffffffffffffff811615613c8d579190565b50600190565b50505050600090600390565b60051115613ca957565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b613ce181613c9f565b80613ce95750565b613cf281613c9f565b60018103613d59576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606490fd5b613d6281613c9f565b60028103613dc9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606490fd5b80613dd5600392613c9f565b14613ddc57565b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608490fd5b90610fc0929173ffffffffffffffffffffffffffffffffffffffff809116600052600960205280806040600020541692166000526040600020541690613939565b9080821015613eaf575090565b905090565b805468010000000000000000811015610f1957613ed691600182018155612a1d565b613f1857815160209283015190921b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000001663ffffffff92909216919091179055565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052600060045260246000fd5b90918154918215928360001461401857613f5f610fb3565b60008152600060208201525b613fa1613f9a613a6660208401517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1690565b968761410d565b94159081613ff5575b5015613fe157613ae1610fc0927fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff613ad287614053565b50610fc090613b50613b4b613b4043613593565b5163ffffffff16905063ffffffff61400f613b4043613593565b91161438613faa565b61404e613bfc7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff83018460005260206000200190565b613f6b565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff9081811161407c571690565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602760248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203260448201527f32342062697473000000000000000000000000000000000000000000000000006064820152fd5b9081039081116109b15790565b9081018091116109b1579056fea2646970667358221220a1b72293258911740432ead70acaf62f4438edf3508dc718e0cda2266a0bd55964736f6c63430008160033dec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a724", "deployedBytecode": "0x6080604052600436101561001257600080fd5b60003560e01c806306fdde031461029257806307679a641461028d57806308112bdf1461026a578063095ea7b31461028857806318160ddd146102835780631d959e5d1461027e57806323b872dd14610279578063313ce567146102745780633644e5151461026f578063365bec7f1461026a57806339509351146102655780633a46b1a814610260578063481622f91461025b5780634bf5d7e914610256578063587cde1e146102515780635c19a95c1461024c5780636fcfff451461024757806370a0823114610242578063715018a61461023d57806376a3002914610238578063793042c9146102335780637ecebe001461022e57806384b0196e146102295780638da5cb5b146102245780638e539e8c1461021f57806391ddadf41461021a57806395d89b41146102155780639ab24eb014610210578063a457c2d71461020b578063a9059cbb14610206578063b213c50814610201578063be16d94a146101fc578063c3cda520146101f7578063d505accf146101f2578063dd62ed3e146101ed578063e702c420146101e8578063f1127ed8146101e3578063f2fde38b146101de578063f514b5b8146101d95763f73eb6f3146101d457600080fd5b612440565b6121a2565b612069565b611fa2565b611ef0565b611e53565b611ca8565b611b05565b611a7b565b6119ac565b6118da565b6117cb565b61171c565b611656565b61160c565b611495565b611443565b61130e565b6112a5565b61124f565b611081565b610e2f565b610dc6565b610d4f565b610d09565b610c9e565b610bb5565b610b67565b6109b6565b610928565b610501565b6108e7565b6108ad565b61075b565b610649565b61060d565b6105ba565b61043b565b610311565b60005b8381106102aa5750506000910152565b818101518382015260200161029a565b907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f6020936102f681518092818752878088019101610297565b0116010190565b90602061030e9281815201906102ba565b90565b34610436576000807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261043357604051908060035490610353826125e7565b808552916020916001918281169081156103e85750600114610390575b61038c8661038081880382610f72565b604051918291826102fd565b0390f35b9350600384527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b5b8385106103d5575050505081016020016103808261038c38610370565b80548686018401529382019381016103b8565b87965061038c979450602093506103809592507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0091501682840152151560051b820101929338610370565b80fd5b600080fd5b34610436576000807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610433576040519080600d549061047d826125e7565b808552916020916001918281169081156103e857506001146104a95761038c8661038081880382610f72565b9350600d84527fd7b6990105719101dabeb77144f2a3385c8033acd3af97e9423a695e81ad1eb55b8385106104ee575050505081016020016103808261038c38610370565b80548686018401529382019381016104d1565b34610436576020807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261043657604051908082528181606051808284015260005b818110610584575060008382018301830152601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820101030190f35b60808101518682018401840152859350849201610545565b73ffffffffffffffffffffffffffffffffffffffff81160361043657565b346104365760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610436576106026004356105f88161059c565b6024359033612b90565b602060405160018152f35b346104365760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610436576020600254604051908152f35b34610436576000807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610433576106816128a9565b602081519101207f0000000000000000000000000000000000000000000000000000000000000000146000146106bd575061038c61038061270d565b600e5473ffffffffffffffffffffffffffffffffffffffff16908060405180937fe0876aa8000000000000000000000000000000000000000000000000000000008252818061070e60048201612829565b03915afa80156107565761038c928261072e9392610733575b5050612d4f565b610380565b61074f92503d8091833e6107478183610f72565b81019061273d565b3880610727565b612838565b346104365760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610436576004356107968161059c565b6024356107a28161059c565b6044359073ffffffffffffffffffffffffffffffffffffffff831660005260016020526107f33360406000209073ffffffffffffffffffffffffffffffffffffffff16600052602052604060002090565b54927fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8403610833575b6108279350612f33565b60405160018152602090f35b82841061084f5761084a8361082795033383612b90565b61081d565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152fd5b346104365760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261043657602060405160128152f35b346104365760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126104365760206109206130af565b604051908152f35b346104365760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610436576004356109638161059c565b33600052600160205261099a8160406000209073ffffffffffffffffffffffffffffffffffffffff16600052602052604060002090565b5460243581018091116109b1576106029133612b90565b61259d565b346104365760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610436576004356109f18161059c565b73ffffffffffffffffffffffffffffffffffffffff60243591610a2565ffffffffffff610a1d43613593565b168410612844565b16600052600a602052604060002080549160008360058111610b16575b50905b838210610ac557505081610a80575050602060005b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff60405191168152f35b610ab9610ac0917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff602094019060005260206000200190565b5460201c90565b610a5a565b9092610ad18185613924565b908263ffffffff610af6610aec858860005260206000200190565b5463ffffffff1690565b161115610b065750925b90610a45565b9350610b11906125cc565b610b00565b80610b26610b2c929693966137e4565b906125da565b908263ffffffff610b47610aec858860005260206000200190565b161115610b575750925b38610a42565b9350610b62906125cc565b610b51565b346104365760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126104365761038c610ba16128a9565b6040519182916020835260208301906102ba565b346104365760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610436574365ffffffffffff610bf543613593565b1603610c405761038c604051610c0a81610efd565b601d81527f6d6f64653d626c6f636b6e756d6265722666726f6d3d64656661756c740000006020820152604051918291826102fd565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f4552433230566f7465733a2062726f6b656e20636c6f636b206d6f64650000006044820152fd5b346104365760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610436576020600435610cdb8161059c565b73ffffffffffffffffffffffffffffffffffffffff8091166000526009825260406000205416604051908152f35b346104365760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261043657610d4d600435610d478161059c565b336131d6565b005b346104365760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126104365773ffffffffffffffffffffffffffffffffffffffff600435610d9f8161059c565b16600052600a6020526020610db8604060002054613287565b63ffffffff60405191168152f35b346104365760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126104365773ffffffffffffffffffffffffffffffffffffffff600435610e168161059c565b1660005260006020526020604060002054604051908152f35b34610436576000807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261043357610e6761331c565b8073ffffffffffffffffffffffffffffffffffffffff600c547fffffffffffffffffffffffff00000000000000000000000000000000000000008116600c55167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040810190811067ffffffffffffffff821117610f1957604052565b610ece565b6060810190811067ffffffffffffffff821117610f1957604052565b6020810190811067ffffffffffffffff821117610f1957604052565b60c0810190811067ffffffffffffffff821117610f1957604052565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff821117610f1957604052565b60405190610fc082610efd565b565b92919267ffffffffffffffff8211610f19576040519161100a60207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8401160184610f72565b829481845281830111610436578281602093846000960137010152565b60207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc820112610436576004359067ffffffffffffffff821161043657806023830112156104365781602461030e93600401359101610fc2565b346104365761108f36611027565b61109761331c565b805167ffffffffffffffff8111610f19576110bc816110b7600d546125e7565b612939565b602080601f831160011461114e57509161112f8261113e937fdf5a31f32f865da404304d8e717e689823eab72d259d756d85fc552ef9ac78d895600091611143575b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8260011b9260031b1c19161790565b600d55604051918291826102fd565b0390a1005b9050830151386110fe565b600d600052907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe083167fd7b6990105719101dabeb77144f2a3385c8033acd3af97e9423a695e81ad1eb5926000905b82821061121c575050927fdf5a31f32f865da404304d8e717e689823eab72d259d756d85fc552ef9ac78d894926001928261113e96106111e5575b5050811b01600d55610380565b8401517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60f88460031b161c1916905538806111d8565b80600185968294968a0151815501950193019061119d565b9080601f830112156104365781602061030e93359101610fc2565b60207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126104365760043567ffffffffffffffff811161043657611299903690600401611234565b50602060405160008152f35b346104365760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126104365773ffffffffffffffffffffffffffffffffffffffff6004356112f58161059c565b1660005260076020526020604060002054604051908152f35b34610436576000807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610433576113e69061136b7f000000000000000000000000000000000000000000000000000000000000000061339b565b906113957f00000000000000000000000000000000000000000000000000000000000000006134d3565b90604051916113a383610f3a565b8183526113f46020916040519687967f0f00000000000000000000000000000000000000000000000000000000000000885260e0602089015260e08801906102ba565b9086820360408801526102ba565b904660608601523060808601528260a086015284820360c0860152602080855193848152019401925b82811061142c57505050500390f35b83518552869550938101939281019260010161141d565b346104365760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261043657602073ffffffffffffffffffffffffffffffffffffffff600c5416604051908152f35b346104365760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610436576004356114e265ffffffffffff6114da43613593565b168210612844565b600b5490600082600581116115a5575b50905b82821061154257828061150f575060405160008152602090f35b600b600052602090610ac0907f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01db801610ab9565b909161154e8184613924565b600b600052908263ffffffff6115857f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01db98501610aec565b1611156115955750915b906114f5565b92506115a0906125cc565b61158f565b80610b266115b5929593956137e4565b600b600052908263ffffffff6115ec7f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01db98501610aec565b1611156115fc5750915b386114f2565b9250611607906125cc565b6115f6565b346104365760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261043657602061164643613593565b65ffffffffffff60405191168152f35b34610436576000807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261043357604051908060045490611698826125e7565b808552916020916001918281169081156103e857506001146116c45761038c8661038081880382610f72565b9350600484527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b5b838510611709575050505081016020016103808261038c38610370565b80548686018401529382019381016116ec565b346104365760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126104365773ffffffffffffffffffffffffffffffffffffffff60043561176c8161059c565b16600052600a60205260406000208054801560001461179357505060405160008152602090f35b6020917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6117c2920190612a1d565b5054811c610a5a565b346104365760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610436576004356118068161059c565b602435903360005260016020526118418160406000209073ffffffffffffffffffffffffffffffffffffffff16600052602052604060002090565b54918083106118565761082792039033612b90565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760448201527f207a65726f0000000000000000000000000000000000000000000000000000006064820152fd5b346104365760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610436576106026004356119188161059c565b6024359033612f33565b906020908183526060918060608501928051828701520151938160806040926040808201528751809652019501936000915b8483106119645750505050505090565b8551805173ffffffffffffffffffffffffffffffffffffffff1688528085015163ffffffff908116898701529082015116878201529581019594830194600190920191611954565b34610436576000807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610433576119e4612a64565b5073ffffffffffffffffffffffffffffffffffffffff600e54168160405180927fe0876aa8000000000000000000000000000000000000000000000000000000008252602060048301528180611a3c6024820161263a565b03915afa908115610756578261038c9392611a60575b505060405191829182611922565b611a7492503d8091833e6107478183610f72565b3880611a52565b60407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126104365760243567ffffffffffffffff8082116104365736602383011215610436578160040135908111610436573691016024011161043657602060405160008152f35b6064359060ff8216820361043657565b6084359060ff8216820361043657565b346104365760c07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261043657600435611b408161059c565b60443590602435611b4f611ae5565b92804211611c4a57611c0b611c4591610d4d9560405190611bf382611bc76020820195898b8860609194939273ffffffffffffffffffffffffffffffffffffffff60808301967fe48329057bfd03d55e49b547132e39cffd9c1820ad7b9d4c5307691425d15adf845216602083015260408201520152565b037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08101845283610f72565b611c0660a435936084359351902061362a565b61366b565b91611c3f8373ffffffffffffffffffffffffffffffffffffffff166000526007602052604060002090815491600183019055565b14612a7e565b6131d6565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f4552433230566f7465733a207369676e617475726520657870697265640000006044820152fd5b346104365760e07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261043657600435611ce38161059c565b602435611cef8161059c565b6044359060643592611cff611af5565b93804211611df557611dd0611df091611bc7610d4d97611dbd611d4b8773ffffffffffffffffffffffffffffffffffffffff166000526007602052604060002090815491600183019055565b9360405193849160208301968c8c8c8a91959493909260a09360c08401977f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9855273ffffffffffffffffffffffffffffffffffffffff8092166020860152166040840152606083015260808201520152565b611c0660c4359360a4359351902061362a565b73ffffffffffffffffffffffffffffffffffffffff808416911614612ae3565b612b90565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f45524332305065726d69743a206578706972656420646561646c696e650000006044820152fd5b346104365760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610436576020611ee7600435611e938161059c565b73ffffffffffffffffffffffffffffffffffffffff60243591611eb58361059c565b166000526001835260406000209073ffffffffffffffffffffffffffffffffffffffff16600052602052604060002090565b54604051908152f35b346104365760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261043657611f27612a64565b50604051611f3481610efd565b73ffffffffffffffffffffffffffffffffffffffff9081600e5416815261038c604051611f6b81611f648161263a565b0382610f72565b6020830190815260405193849360208552511660208401525160408084015260608301906102ba565b63ffffffff81160361043657565b346104365760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261043657604061203361202d600435611fe58161059c565b73ffffffffffffffffffffffffffffffffffffffff6024359161200783611f94565b60006020875161201681610efd565b828152015216600052600a60205283600020612a1d565b50612b48565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff602083519263ffffffff81511684520151166020820152f35b346104365760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610436576004356120a48161059c565b6120ac61331c565b73ffffffffffffffffffffffffffffffffffffffff80911690811561211e57600c54827fffffffffffffffffffffffff0000000000000000000000000000000000000000821617600c55167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a3005b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152fd5b60607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610436576004356024356121db8161059c565b67ffffffffffffffff90604435828111610436576121fd903690600401611234565b9273ffffffffffffffffffffffffffffffffffffffff938461224661222c846000526010602052604060002090565b5473ffffffffffffffffffffffffffffffffffffffff1690565b166124165761225490613699565b91602060405180967fbe16d94a00000000000000000000000000000000000000000000000000000000825281600081612291898960048401612b79565b039286165af19384156107565761038c956000956123d9575b508492916122ef612396926122dc6122c0610fb3565b73ffffffffffffffffffffffffffffffffffffffff9094168452565b851667ffffffffffffffff166020830152565b612303836000526010602052604060002090565b815181547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff9190911617815590602001517fffffffff0000000000000000ffffffffffffffffffffffffffffffffffffffff7bffffffffffffffff000000000000000000000000000000000000000083549260a01b169116179055565b7f103ab115fdd2f05d2720873cd21aeff07c1206de37259cdeb99463da9ff512e0604051806123c63396826102fd565b0390a46040519081529081906020820190565b6122ef95509161240561239692949360203d60201161240f575b6123fd8183610f72565b810190612b6a565b95509192906122aa565b503d6123f3565b60046040517f339f7ff5000000000000000000000000000000000000000000000000000000008152fd5b346104365761244e36611027565b61245661331c565b805167ffffffffffffffff8111610f195761247b81612476600f546125e7565b6129ab565b602080601f83116001146124da575081906124ca936000926124cf575b50507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8260011b9260031b1c19161790565b600f55005b015190503880612498565b907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe083169361252b600f6000527f8d1108e10bcb7c27dddfc02ed9d693a074039d026cf4ea4240b40f7d581ac80290565b926000905b868210612585575050836001951061254e575b505050811b01600f55005b01517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60f88460031b161c19169055388080612543565b80600185968294968601518155019501930190612530565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b90600182018092116109b157565b919082039182116109b157565b90600182811c92168015612630575b602083101461260157565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b91607f16916125f6565b600f546000929161264a826125e7565b808252916020906001908181169081156126c9575060011461266d575b50505050565b92939450600f6000527f8d1108e10bcb7c27dddfc02ed9d693a074039d026cf4ea4240b40f7d581ac802926000935b8585106126b6575050506020925001019038808080612667565b805485850184015293820193810161269c565b91505060209495507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0091509291921683830152151560051b01019038808080612667565b60405190610fc08261271e8161263a565b0383610f72565b67ffffffffffffffff8111610f195760051b60200190565b6020808284031261043657815167ffffffffffffffff9283821161043657019260409283858303126104365783519461277586610efd565b8051865283810151918211610436570181601f820112156104365780519161279c83612725565b946127a981519687610f72565b8386528486019185606080960285010193818511610436578601925b8484106127d85750505050505082015290565b85848303126104365786869184516127ef81610f1e565b86516127fa8161059c565b81528287015161280981611f94565b838201528587015161281a81611f94565b868201528152019301926127c5565b602061030e918181520161263a565b6040513d6000823e3d90fd5b1561284b57565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f4552433230566f7465733a20667574757265206c6f6f6b7570000000000000006044820152fd5b600e5473ffffffffffffffffffffffffffffffffffffffff1615612900576040516128d381610efd565b600281527f6673000000000000000000000000000000000000000000000000000000000000602082015290565b60405161290c81610efd565b600481527f6970667300000000000000000000000000000000000000000000000000000000602082015290565b601f8111612945575050565b600090600d6000527fd7b6990105719101dabeb77144f2a3385c8033acd3af97e9423a695e81ad1eb5906020601f850160051c830194106129a1575b601f0160051c01915b82811061299657505050565b81815560010161298a565b9092508290612981565b601f81116129b7575050565b600090600f6000527f8d1108e10bcb7c27dddfc02ed9d693a074039d026cf4ea4240b40f7d581ac802906020601f850160051c83019410612a13575b601f0160051c01915b828110612a0857505050565b8181556001016129fc565b90925082906129f3565b8054821015612a355760005260206000200190600090565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60405190612a7182610efd565b6060602083600081520152565b15612a8557565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f4552433230566f7465733a20696e76616c6964206e6f6e6365000000000000006044820152fd5b15612aea57565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f45524332305065726d69743a20696e76616c6964207369676e617475726500006044820152fd5b90604051612b5581610efd565b602081935463ffffffff81168352811c910152565b90816020910312610436575190565b60409061030e9392815281602082015201906102ba565b9073ffffffffffffffffffffffffffffffffffffffff91828116928315612ccc578216938415612c485780612c327f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92594612c0d612c439573ffffffffffffffffffffffffffffffffffffffff166000526001602052604060002090565b9073ffffffffffffffffffffffffffffffffffffffff16600052602052604060002090565b556040519081529081906020820190565b0390a3565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f20616464726560448201527f73730000000000000000000000000000000000000000000000000000000000006064820152fd5b60846040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460448201527f72657373000000000000000000000000000000000000000000000000000000006064820152fd5b906020809201518051906020916040805195600080945b848610612da557505050505050601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe091828101855201168201604052565b909192939495838760051b8301015180518686830151920151813b808211612de6575082849392600195938e930394859301903c0196019493929190612d66565b9260849387937f86d14d89000000000000000000000000000000000000000000000000000000008552600452602452604452606452fd5b15612e2457565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201527f65737300000000000000000000000000000000000000000000000000000000006064820152fd5b15612eaf57565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206260448201527f616c616e636500000000000000000000000000000000000000000000000000006064820152fd5b919073ffffffffffffffffffffffffffffffffffffffff92838116801561302b57610fc094831690612f66821515612e1d565b84612f918473ffffffffffffffffffffffffffffffffffffffff166000526000602052604060002090565b54612f9e82821015612ea8565b03612fc98473ffffffffffffffffffffffffffffffffffffffff166000526000602052604060002090565b55612ff48473ffffffffffffffffffffffffffffffffffffffff166000526000602052604060002090565b8054860190556040518581527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90602090a3613e61565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f20616460448201527f64726573730000000000000000000000000000000000000000000000000000006064820152fd5b73ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000163014806131ad575b15613117577f000000000000000000000000000000000000000000000000000000000000000090565b60405160208101907f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f82527f000000000000000000000000000000000000000000000000000000000000000060408201527f000000000000000000000000000000000000000000000000000000000000000060608201524660808201523060a082015260a081526131a781610f56565b51902090565b507f000000000000000000000000000000000000000000000000000000000000000046146130ee565b610fc09173ffffffffffffffffffffffffffffffffffffffff80921660008181526009602052836040822054168092826020527f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f604084205496600960205261327d87604087209073ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffff0000000000000000000000000000000000000000825416179055565b86169380a4613939565b63ffffffff90818111613298571690565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203360448201527f32206269747300000000000000000000000000000000000000000000000000006064820152fd5b73ffffffffffffffffffffffffffffffffffffffff600c5416330361333d57565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b60ff81146133f15760ff811690601f82116133c757604051916133bd83610efd565b8252602082015290565b60046040517fb3512b0c000000000000000000000000000000000000000000000000000000008152fd5b50604051600554816000613404836125e7565b80835292602090600190818116908115613490575060011461342f575b505061030e92500382610f72565b91509260056000527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db0936000925b828410613478575061030e9450505081016020013880613421565b8554878501830152948501948694509281019261345d565b90506020935061030e9592507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0091501682840152151560051b8201013880613421565b60ff81146134f55760ff811690601f82116133c757604051916133bd83610efd565b50604051600654816000613508836125e7565b80835292602090600190818116908115613490575060011461353257505061030e92500382610f72565b91509260066000527ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f936000925b82841061357b575061030e9450505081016020013880613421565b85548785018301529485019486945092810192613560565b65ffffffffffff908181116135a6571690565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203460448201527f38206269747300000000000000000000000000000000000000000000000000006064820152fd5b6042906136356130af565b90604051917f19010000000000000000000000000000000000000000000000000000000000008352600283015260228201522090565b9161030e939161367a93613c10565b919091613cd8565b9061369560209282815194859201610297565b0190565b60405190816020600090600d54906136b0826125e7565b916001908181169081156137645750600114613703575b5050506136d79061030e93613682565b037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08101835282610f72565b90919250600d6000527fd7b6990105719101dabeb77144f2a3385c8033acd3af97e9423a695e81ad1eb5906000915b84831061374e57505050508101602001826136d761030e6136c7565b8054888401850152879550918301918101613732565b6136d795506020935061030e979492507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0091501682860152801515028401019181946136c7565b81156137b5570490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b801561391e57806138b76138b06138a661389c61389261388861387e613874600161030e9a6000908b60801c80613912575b508060401c80613905575b508060201c806138f8575b508060101c806138eb575b508060081c806138de575b508060041c806138d1575b508060021c806138c4575b50821c6138bd575b811c1b61386d818b6137ab565b0160011c90565b61386d818a6137ab565b61386d81896137ab565b61386d81886137ab565b61386d81876137ab565b61386d81866137ab565b61386d81856137ab565b80926137ab565b90613ea2565b8101613860565b6002915091019038613858565b600491509101903861384d565b6008915091019038613842565b6010915091019038613837565b602091509101903861382c565b6040915091019038613821565b91505060809038613816565b50600090565b90808216911860011c81018091116109b15790565b919073ffffffffffffffffffffffffffffffffffffffff80821693168381141580613c07575b6139695750505050565b806139e9575b508261397c575b80612667565b7fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a724916139cb6139d09273ffffffffffffffffffffffffffffffffffffffff16600052600a602052604060002090565b613f47565b60408051928352602083019190915290a2388080613976565b80600052600a6020527fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a7246040600020805480159182600014613bc657613a2d610fb3565b6000815260006020820152915b613a87613a6660208501517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1690565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1690565b92613a928985614100565b94159081613ba3575b5015613b2c57613ae1613b16927fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff613ad287614053565b93019060005260206000200190565b9063ffffffff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000000083549260201b169116179055565b604080519182526020820192909252a23861396f565b50613b9e90613b50613b4b613b4043613593565b65ffffffffffff1690565b613287565b90613b99613b5d86614053565b613b74613b68610fb3565b63ffffffff9095168552565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff166020840152565b613eb4565b613b16565b5163ffffffff16905063ffffffff613bbd613b4043613593565b91161438613a9b565b613c01613bfc7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff84018360005260206000200190565b612b48565b91613a3a565b5082151561395f565b9291907f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311613c935791608094939160ff602094604051948552168484015260408301526060820152600093849182805260015afa1561075657815173ffffffffffffffffffffffffffffffffffffffff811615613c8d579190565b50600190565b50505050600090600390565b60051115613ca957565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b613ce181613c9f565b80613ce95750565b613cf281613c9f565b60018103613d59576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606490fd5b613d6281613c9f565b60028103613dc9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606490fd5b80613dd5600392613c9f565b14613ddc57565b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608490fd5b90610fc0929173ffffffffffffffffffffffffffffffffffffffff809116600052600960205280806040600020541692166000526040600020541690613939565b9080821015613eaf575090565b905090565b805468010000000000000000811015610f1957613ed691600182018155612a1d565b613f1857815160209283015190921b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000001663ffffffff92909216919091179055565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052600060045260246000fd5b90918154918215928360001461401857613f5f610fb3565b60008152600060208201525b613fa1613f9a613a6660208401517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1690565b968761410d565b94159081613ff5575b5015613fe157613ae1610fc0927fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff613ad287614053565b50610fc090613b50613b4b613b4043613593565b5163ffffffff16905063ffffffff61400f613b4043613593565b91161438613faa565b61404e613bfc7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff83018460005260206000200190565b613f6b565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff9081811161407c571690565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602760248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203260448201527f32342062697473000000000000000000000000000000000000000000000000006064820152fd5b9081039081116109b15790565b9081018091116109b1579056fea2646970667358221220a1b72293258911740432ead70acaf62f4438edf3508dc718e0cda2266a0bd55964736f6c63430008160033", "linkReferences": {}, "deployedLinkReferences": {} } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/binds/erc20utilityagent/abigen.sh ================================================ jq ".abi" ERC20UtilityAgent.json > ERC20UtilityAgent.abi jq -r ".bytecode" ERC20UtilityAgent.json > ERC20UtilityAgent.bin abigen --bin=ERC20UtilityAgent.bin --abi=ERC20UtilityAgent.abi --pkg=erc20utilityagent --type ERC20UtilityAgent --out=ERC20UtilityAgent.go rm ERC20UtilityAgent.abi rm ERC20UtilityAgent.bin ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/binds/erc721/erc721.go ================================================ // Code generated - DO NOT EDIT. // This file is a generated binding and any manual changes will be lost. package erc721 import ( "errors" "math/big" "strings" ethereum "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/event" ) // Reference imports to suppress errors if they are not otherwise used. var ( _ = errors.New _ = big.NewInt _ = strings.NewReader _ = ethereum.NotFound _ = bind.Bind _ = common.Big1 _ = types.BloomLookup _ = event.NewSubscription ) // Erc721MetaData contains all meta data concerning the Erc721 contract. var Erc721MetaData = &bind.MetaData{ ABI: "[{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"mint\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"safeTransferFrom\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"safeTransferFrom\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"setApprovalForAll\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"approved\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"ApprovalForAll\",\"type\":\"event\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"getApproved\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"name\":\"isApprovedForAll\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"ownerOf\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"}]", } // Erc721ABI is the input ABI used to generate the binding from. // Deprecated: Use Erc721MetaData.ABI instead. var Erc721ABI = Erc721MetaData.ABI // Erc721 is an auto generated Go binding around an Ethereum contract. type Erc721 struct { Erc721Caller // Read-only binding to the contract Erc721Transactor // Write-only binding to the contract Erc721Filterer // Log filterer for contract events } // Erc721Caller is an auto generated read-only Go binding around an Ethereum contract. type Erc721Caller struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // Erc721Transactor is an auto generated write-only Go binding around an Ethereum contract. type Erc721Transactor struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // Erc721Filterer is an auto generated log filtering Go binding around an Ethereum contract events. type Erc721Filterer struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // Erc721Session is an auto generated Go binding around an Ethereum contract, // with pre-set call and transact options. type Erc721Session struct { Contract *Erc721 // Generic contract binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // Erc721CallerSession is an auto generated read-only Go binding around an Ethereum contract, // with pre-set call options. type Erc721CallerSession struct { Contract *Erc721Caller // Generic contract caller binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session } // Erc721TransactorSession is an auto generated write-only Go binding around an Ethereum contract, // with pre-set transact options. type Erc721TransactorSession struct { Contract *Erc721Transactor // Generic contract transactor binding to set the session for TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // Erc721Raw is an auto generated low-level Go binding around an Ethereum contract. type Erc721Raw struct { Contract *Erc721 // Generic contract binding to access the raw methods on } // Erc721CallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. type Erc721CallerRaw struct { Contract *Erc721Caller // Generic read-only contract binding to access the raw methods on } // Erc721TransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. type Erc721TransactorRaw struct { Contract *Erc721Transactor // Generic write-only contract binding to access the raw methods on } // NewErc721 creates a new instance of Erc721, bound to a specific deployed contract. func NewErc721(address common.Address, backend bind.ContractBackend) (*Erc721, error) { contract, err := bindErc721(address, backend, backend, backend) if err != nil { return nil, err } return &Erc721{Erc721Caller: Erc721Caller{contract: contract}, Erc721Transactor: Erc721Transactor{contract: contract}, Erc721Filterer: Erc721Filterer{contract: contract}}, nil } // NewErc721Caller creates a new read-only instance of Erc721, bound to a specific deployed contract. func NewErc721Caller(address common.Address, caller bind.ContractCaller) (*Erc721Caller, error) { contract, err := bindErc721(address, caller, nil, nil) if err != nil { return nil, err } return &Erc721Caller{contract: contract}, nil } // NewErc721Transactor creates a new write-only instance of Erc721, bound to a specific deployed contract. func NewErc721Transactor(address common.Address, transactor bind.ContractTransactor) (*Erc721Transactor, error) { contract, err := bindErc721(address, nil, transactor, nil) if err != nil { return nil, err } return &Erc721Transactor{contract: contract}, nil } // NewErc721Filterer creates a new log filterer instance of Erc721, bound to a specific deployed contract. func NewErc721Filterer(address common.Address, filterer bind.ContractFilterer) (*Erc721Filterer, error) { contract, err := bindErc721(address, nil, nil, filterer) if err != nil { return nil, err } return &Erc721Filterer{contract: contract}, nil } // bindErc721 binds a generic wrapper to an already deployed contract. func bindErc721(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { parsed, err := abi.JSON(strings.NewReader(Erc721ABI)) if err != nil { return nil, err } return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_Erc721 *Erc721Raw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _Erc721.Contract.Erc721Caller.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_Erc721 *Erc721Raw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _Erc721.Contract.Erc721Transactor.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_Erc721 *Erc721Raw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _Erc721.Contract.Erc721Transactor.contract.Transact(opts, method, params...) } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_Erc721 *Erc721CallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _Erc721.Contract.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_Erc721 *Erc721TransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _Erc721.Contract.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_Erc721 *Erc721TransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _Erc721.Contract.contract.Transact(opts, method, params...) } // BalanceOf is a free data retrieval call binding the contract method 0x70a08231. // // Solidity: function balanceOf(address owner) view returns(uint256) func (_Erc721 *Erc721Caller) BalanceOf(opts *bind.CallOpts, owner common.Address) (*big.Int, error) { var out []interface{} err := _Erc721.contract.Call(opts, &out, "balanceOf", owner) if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // BalanceOf is a free data retrieval call binding the contract method 0x70a08231. // // Solidity: function balanceOf(address owner) view returns(uint256) func (_Erc721 *Erc721Session) BalanceOf(owner common.Address) (*big.Int, error) { return _Erc721.Contract.BalanceOf(&_Erc721.CallOpts, owner) } // BalanceOf is a free data retrieval call binding the contract method 0x70a08231. // // Solidity: function balanceOf(address owner) view returns(uint256) func (_Erc721 *Erc721CallerSession) BalanceOf(owner common.Address) (*big.Int, error) { return _Erc721.Contract.BalanceOf(&_Erc721.CallOpts, owner) } // GetApproved is a free data retrieval call binding the contract method 0x081812fc. // // Solidity: function getApproved(uint256 tokenId) view returns(address) func (_Erc721 *Erc721Caller) GetApproved(opts *bind.CallOpts, tokenId *big.Int) (common.Address, error) { var out []interface{} err := _Erc721.contract.Call(opts, &out, "getApproved", tokenId) if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // GetApproved is a free data retrieval call binding the contract method 0x081812fc. // // Solidity: function getApproved(uint256 tokenId) view returns(address) func (_Erc721 *Erc721Session) GetApproved(tokenId *big.Int) (common.Address, error) { return _Erc721.Contract.GetApproved(&_Erc721.CallOpts, tokenId) } // GetApproved is a free data retrieval call binding the contract method 0x081812fc. // // Solidity: function getApproved(uint256 tokenId) view returns(address) func (_Erc721 *Erc721CallerSession) GetApproved(tokenId *big.Int) (common.Address, error) { return _Erc721.Contract.GetApproved(&_Erc721.CallOpts, tokenId) } // IsApprovedForAll is a free data retrieval call binding the contract method 0xe985e9c5. // // Solidity: function isApprovedForAll(address owner, address operator) view returns(bool) func (_Erc721 *Erc721Caller) IsApprovedForAll(opts *bind.CallOpts, owner common.Address, operator common.Address) (bool, error) { var out []interface{} err := _Erc721.contract.Call(opts, &out, "isApprovedForAll", owner, operator) if err != nil { return *new(bool), err } out0 := *abi.ConvertType(out[0], new(bool)).(*bool) return out0, err } // IsApprovedForAll is a free data retrieval call binding the contract method 0xe985e9c5. // // Solidity: function isApprovedForAll(address owner, address operator) view returns(bool) func (_Erc721 *Erc721Session) IsApprovedForAll(owner common.Address, operator common.Address) (bool, error) { return _Erc721.Contract.IsApprovedForAll(&_Erc721.CallOpts, owner, operator) } // IsApprovedForAll is a free data retrieval call binding the contract method 0xe985e9c5. // // Solidity: function isApprovedForAll(address owner, address operator) view returns(bool) func (_Erc721 *Erc721CallerSession) IsApprovedForAll(owner common.Address, operator common.Address) (bool, error) { return _Erc721.Contract.IsApprovedForAll(&_Erc721.CallOpts, owner, operator) } // OwnerOf is a free data retrieval call binding the contract method 0x6352211e. // // Solidity: function ownerOf(uint256 tokenId) view returns(address) func (_Erc721 *Erc721Caller) OwnerOf(opts *bind.CallOpts, tokenId *big.Int) (common.Address, error) { var out []interface{} err := _Erc721.contract.Call(opts, &out, "ownerOf", tokenId) if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // OwnerOf is a free data retrieval call binding the contract method 0x6352211e. // // Solidity: function ownerOf(uint256 tokenId) view returns(address) func (_Erc721 *Erc721Session) OwnerOf(tokenId *big.Int) (common.Address, error) { return _Erc721.Contract.OwnerOf(&_Erc721.CallOpts, tokenId) } // OwnerOf is a free data retrieval call binding the contract method 0x6352211e. // // Solidity: function ownerOf(uint256 tokenId) view returns(address) func (_Erc721 *Erc721CallerSession) OwnerOf(tokenId *big.Int) (common.Address, error) { return _Erc721.Contract.OwnerOf(&_Erc721.CallOpts, tokenId) } // SupportsInterface is a free data retrieval call binding the contract method 0x01ffc9a7. // // Solidity: function supportsInterface(bytes4 interfaceId) view returns(bool) func (_Erc721 *Erc721Caller) SupportsInterface(opts *bind.CallOpts, interfaceId [4]byte) (bool, error) { var out []interface{} err := _Erc721.contract.Call(opts, &out, "supportsInterface", interfaceId) if err != nil { return *new(bool), err } out0 := *abi.ConvertType(out[0], new(bool)).(*bool) return out0, err } // SupportsInterface is a free data retrieval call binding the contract method 0x01ffc9a7. // // Solidity: function supportsInterface(bytes4 interfaceId) view returns(bool) func (_Erc721 *Erc721Session) SupportsInterface(interfaceId [4]byte) (bool, error) { return _Erc721.Contract.SupportsInterface(&_Erc721.CallOpts, interfaceId) } // SupportsInterface is a free data retrieval call binding the contract method 0x01ffc9a7. // // Solidity: function supportsInterface(bytes4 interfaceId) view returns(bool) func (_Erc721 *Erc721CallerSession) SupportsInterface(interfaceId [4]byte) (bool, error) { return _Erc721.Contract.SupportsInterface(&_Erc721.CallOpts, interfaceId) } // Approve is a paid mutator transaction binding the contract method 0x095ea7b3. // // Solidity: function approve(address to, uint256 tokenId) returns() func (_Erc721 *Erc721Transactor) Approve(opts *bind.TransactOpts, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _Erc721.contract.Transact(opts, "approve", to, tokenId) } // Approve is a paid mutator transaction binding the contract method 0x095ea7b3. // // Solidity: function approve(address to, uint256 tokenId) returns() func (_Erc721 *Erc721Session) Approve(to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _Erc721.Contract.Approve(&_Erc721.TransactOpts, to, tokenId) } // Approve is a paid mutator transaction binding the contract method 0x095ea7b3. // // Solidity: function approve(address to, uint256 tokenId) returns() func (_Erc721 *Erc721TransactorSession) Approve(to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _Erc721.Contract.Approve(&_Erc721.TransactOpts, to, tokenId) } // Mint is a paid mutator transaction binding the contract method 0x40c10f19. // // Solidity: function mint(address to, uint256 tokenId) returns() func (_Erc721 *Erc721Transactor) Mint(opts *bind.TransactOpts, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _Erc721.contract.Transact(opts, "mint", to, tokenId) } // Mint is a paid mutator transaction binding the contract method 0x40c10f19. // // Solidity: function mint(address to, uint256 tokenId) returns() func (_Erc721 *Erc721Session) Mint(to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _Erc721.Contract.Mint(&_Erc721.TransactOpts, to, tokenId) } // Mint is a paid mutator transaction binding the contract method 0x40c10f19. // // Solidity: function mint(address to, uint256 tokenId) returns() func (_Erc721 *Erc721TransactorSession) Mint(to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _Erc721.Contract.Mint(&_Erc721.TransactOpts, to, tokenId) } // SafeTransferFrom is a paid mutator transaction binding the contract method 0x42842e0e. // // Solidity: function safeTransferFrom(address from, address to, uint256 tokenId) returns() func (_Erc721 *Erc721Transactor) SafeTransferFrom(opts *bind.TransactOpts, from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _Erc721.contract.Transact(opts, "safeTransferFrom", from, to, tokenId) } // SafeTransferFrom is a paid mutator transaction binding the contract method 0x42842e0e. // // Solidity: function safeTransferFrom(address from, address to, uint256 tokenId) returns() func (_Erc721 *Erc721Session) SafeTransferFrom(from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _Erc721.Contract.SafeTransferFrom(&_Erc721.TransactOpts, from, to, tokenId) } // SafeTransferFrom is a paid mutator transaction binding the contract method 0x42842e0e. // // Solidity: function safeTransferFrom(address from, address to, uint256 tokenId) returns() func (_Erc721 *Erc721TransactorSession) SafeTransferFrom(from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _Erc721.Contract.SafeTransferFrom(&_Erc721.TransactOpts, from, to, tokenId) } // SafeTransferFrom0 is a paid mutator transaction binding the contract method 0xb88d4fde. // // Solidity: function safeTransferFrom(address from, address to, uint256 tokenId, bytes _data) returns() func (_Erc721 *Erc721Transactor) SafeTransferFrom0(opts *bind.TransactOpts, from common.Address, to common.Address, tokenId *big.Int, _data []byte) (*types.Transaction, error) { return _Erc721.contract.Transact(opts, "safeTransferFrom0", from, to, tokenId, _data) } // SafeTransferFrom0 is a paid mutator transaction binding the contract method 0xb88d4fde. // // Solidity: function safeTransferFrom(address from, address to, uint256 tokenId, bytes _data) returns() func (_Erc721 *Erc721Session) SafeTransferFrom0(from common.Address, to common.Address, tokenId *big.Int, _data []byte) (*types.Transaction, error) { return _Erc721.Contract.SafeTransferFrom0(&_Erc721.TransactOpts, from, to, tokenId, _data) } // SafeTransferFrom0 is a paid mutator transaction binding the contract method 0xb88d4fde. // // Solidity: function safeTransferFrom(address from, address to, uint256 tokenId, bytes _data) returns() func (_Erc721 *Erc721TransactorSession) SafeTransferFrom0(from common.Address, to common.Address, tokenId *big.Int, _data []byte) (*types.Transaction, error) { return _Erc721.Contract.SafeTransferFrom0(&_Erc721.TransactOpts, from, to, tokenId, _data) } // SetApprovalForAll is a paid mutator transaction binding the contract method 0xa22cb465. // // Solidity: function setApprovalForAll(address to, bool approved) returns() func (_Erc721 *Erc721Transactor) SetApprovalForAll(opts *bind.TransactOpts, to common.Address, approved bool) (*types.Transaction, error) { return _Erc721.contract.Transact(opts, "setApprovalForAll", to, approved) } // SetApprovalForAll is a paid mutator transaction binding the contract method 0xa22cb465. // // Solidity: function setApprovalForAll(address to, bool approved) returns() func (_Erc721 *Erc721Session) SetApprovalForAll(to common.Address, approved bool) (*types.Transaction, error) { return _Erc721.Contract.SetApprovalForAll(&_Erc721.TransactOpts, to, approved) } // SetApprovalForAll is a paid mutator transaction binding the contract method 0xa22cb465. // // Solidity: function setApprovalForAll(address to, bool approved) returns() func (_Erc721 *Erc721TransactorSession) SetApprovalForAll(to common.Address, approved bool) (*types.Transaction, error) { return _Erc721.Contract.SetApprovalForAll(&_Erc721.TransactOpts, to, approved) } // TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. // // Solidity: function transferFrom(address from, address to, uint256 tokenId) returns() func (_Erc721 *Erc721Transactor) TransferFrom(opts *bind.TransactOpts, from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _Erc721.contract.Transact(opts, "transferFrom", from, to, tokenId) } // TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. // // Solidity: function transferFrom(address from, address to, uint256 tokenId) returns() func (_Erc721 *Erc721Session) TransferFrom(from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _Erc721.Contract.TransferFrom(&_Erc721.TransactOpts, from, to, tokenId) } // TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. // // Solidity: function transferFrom(address from, address to, uint256 tokenId) returns() func (_Erc721 *Erc721TransactorSession) TransferFrom(from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _Erc721.Contract.TransferFrom(&_Erc721.TransactOpts, from, to, tokenId) } // Erc721ApprovalIterator is returned from FilterApproval and is used to iterate over the raw logs and unpacked data for Approval events raised by the Erc721 contract. type Erc721ApprovalIterator struct { Event *Erc721Approval // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *Erc721ApprovalIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(Erc721Approval) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(Erc721Approval) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *Erc721ApprovalIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *Erc721ApprovalIterator) Close() error { it.sub.Unsubscribe() return nil } // Erc721Approval represents a Approval event raised by the Erc721 contract. type Erc721Approval struct { Owner common.Address Approved common.Address TokenId *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterApproval is a free log retrieval operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. // // Solidity: event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId) func (_Erc721 *Erc721Filterer) FilterApproval(opts *bind.FilterOpts, owner []common.Address, approved []common.Address, tokenId []*big.Int) (*Erc721ApprovalIterator, error) { var ownerRule []interface{} for _, ownerItem := range owner { ownerRule = append(ownerRule, ownerItem) } var approvedRule []interface{} for _, approvedItem := range approved { approvedRule = append(approvedRule, approvedItem) } var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _Erc721.contract.FilterLogs(opts, "Approval", ownerRule, approvedRule, tokenIdRule) if err != nil { return nil, err } return &Erc721ApprovalIterator{contract: _Erc721.contract, event: "Approval", logs: logs, sub: sub}, nil } // WatchApproval is a free log subscription operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. // // Solidity: event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId) func (_Erc721 *Erc721Filterer) WatchApproval(opts *bind.WatchOpts, sink chan<- *Erc721Approval, owner []common.Address, approved []common.Address, tokenId []*big.Int) (event.Subscription, error) { var ownerRule []interface{} for _, ownerItem := range owner { ownerRule = append(ownerRule, ownerItem) } var approvedRule []interface{} for _, approvedItem := range approved { approvedRule = append(approvedRule, approvedItem) } var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _Erc721.contract.WatchLogs(opts, "Approval", ownerRule, approvedRule, tokenIdRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(Erc721Approval) if err := _Erc721.contract.UnpackLog(event, "Approval", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseApproval is a log parse operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. // // Solidity: event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId) func (_Erc721 *Erc721Filterer) ParseApproval(log types.Log) (*Erc721Approval, error) { event := new(Erc721Approval) if err := _Erc721.contract.UnpackLog(event, "Approval", log); err != nil { return nil, err } event.Raw = log return event, nil } // Erc721ApprovalForAllIterator is returned from FilterApprovalForAll and is used to iterate over the raw logs and unpacked data for ApprovalForAll events raised by the Erc721 contract. type Erc721ApprovalForAllIterator struct { Event *Erc721ApprovalForAll // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *Erc721ApprovalForAllIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(Erc721ApprovalForAll) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(Erc721ApprovalForAll) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *Erc721ApprovalForAllIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *Erc721ApprovalForAllIterator) Close() error { it.sub.Unsubscribe() return nil } // Erc721ApprovalForAll represents a ApprovalForAll event raised by the Erc721 contract. type Erc721ApprovalForAll struct { Owner common.Address Operator common.Address Approved bool Raw types.Log // Blockchain specific contextual infos } // FilterApprovalForAll is a free log retrieval operation binding the contract event 0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31. // // Solidity: event ApprovalForAll(address indexed owner, address indexed operator, bool approved) func (_Erc721 *Erc721Filterer) FilterApprovalForAll(opts *bind.FilterOpts, owner []common.Address, operator []common.Address) (*Erc721ApprovalForAllIterator, error) { var ownerRule []interface{} for _, ownerItem := range owner { ownerRule = append(ownerRule, ownerItem) } var operatorRule []interface{} for _, operatorItem := range operator { operatorRule = append(operatorRule, operatorItem) } logs, sub, err := _Erc721.contract.FilterLogs(opts, "ApprovalForAll", ownerRule, operatorRule) if err != nil { return nil, err } return &Erc721ApprovalForAllIterator{contract: _Erc721.contract, event: "ApprovalForAll", logs: logs, sub: sub}, nil } // WatchApprovalForAll is a free log subscription operation binding the contract event 0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31. // // Solidity: event ApprovalForAll(address indexed owner, address indexed operator, bool approved) func (_Erc721 *Erc721Filterer) WatchApprovalForAll(opts *bind.WatchOpts, sink chan<- *Erc721ApprovalForAll, owner []common.Address, operator []common.Address) (event.Subscription, error) { var ownerRule []interface{} for _, ownerItem := range owner { ownerRule = append(ownerRule, ownerItem) } var operatorRule []interface{} for _, operatorItem := range operator { operatorRule = append(operatorRule, operatorItem) } logs, sub, err := _Erc721.contract.WatchLogs(opts, "ApprovalForAll", ownerRule, operatorRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(Erc721ApprovalForAll) if err := _Erc721.contract.UnpackLog(event, "ApprovalForAll", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseApprovalForAll is a log parse operation binding the contract event 0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31. // // Solidity: event ApprovalForAll(address indexed owner, address indexed operator, bool approved) func (_Erc721 *Erc721Filterer) ParseApprovalForAll(log types.Log) (*Erc721ApprovalForAll, error) { event := new(Erc721ApprovalForAll) if err := _Erc721.contract.UnpackLog(event, "ApprovalForAll", log); err != nil { return nil, err } event.Raw = log return event, nil } // Erc721TransferIterator is returned from FilterTransfer and is used to iterate over the raw logs and unpacked data for Transfer events raised by the Erc721 contract. type Erc721TransferIterator struct { Event *Erc721Transfer // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *Erc721TransferIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(Erc721Transfer) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(Erc721Transfer) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *Erc721TransferIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *Erc721TransferIterator) Close() error { it.sub.Unsubscribe() return nil } // Erc721Transfer represents a Transfer event raised by the Erc721 contract. type Erc721Transfer struct { From common.Address To common.Address TokenId *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterTransfer is a free log retrieval operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. // // Solidity: event Transfer(address indexed from, address indexed to, uint256 indexed tokenId) func (_Erc721 *Erc721Filterer) FilterTransfer(opts *bind.FilterOpts, from []common.Address, to []common.Address, tokenId []*big.Int) (*Erc721TransferIterator, error) { var fromRule []interface{} for _, fromItem := range from { fromRule = append(fromRule, fromItem) } var toRule []interface{} for _, toItem := range to { toRule = append(toRule, toItem) } var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _Erc721.contract.FilterLogs(opts, "Transfer", fromRule, toRule, tokenIdRule) if err != nil { return nil, err } return &Erc721TransferIterator{contract: _Erc721.contract, event: "Transfer", logs: logs, sub: sub}, nil } // WatchTransfer is a free log subscription operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. // // Solidity: event Transfer(address indexed from, address indexed to, uint256 indexed tokenId) func (_Erc721 *Erc721Filterer) WatchTransfer(opts *bind.WatchOpts, sink chan<- *Erc721Transfer, from []common.Address, to []common.Address, tokenId []*big.Int) (event.Subscription, error) { var fromRule []interface{} for _, fromItem := range from { fromRule = append(fromRule, fromItem) } var toRule []interface{} for _, toItem := range to { toRule = append(toRule, toItem) } var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _Erc721.contract.WatchLogs(opts, "Transfer", fromRule, toRule, tokenIdRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(Erc721Transfer) if err := _Erc721.contract.UnpackLog(event, "Transfer", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseTransfer is a log parse operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. // // Solidity: event Transfer(address indexed from, address indexed to, uint256 indexed tokenId) func (_Erc721 *Erc721Filterer) ParseTransfer(log types.Log) (*Erc721Transfer, error) { event := new(Erc721Transfer) if err := _Erc721.contract.UnpackLog(event, "Transfer", log); err != nil { return nil, err } event.Raw = log return event, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/binds/ethereumnonfungiblepositionmanager/NonfungiblePositionManager.go ================================================ // Code generated - DO NOT EDIT. // This file is a generated binding and any manual changes will be lost. package ethereumnonfungiblepositionmanager import ( "errors" "math/big" "strings" ethereum "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/event" ) // Reference imports to suppress errors if they are not otherwise used. var ( _ = errors.New _ = big.NewInt _ = strings.NewReader _ = ethereum.NotFound _ = bind.Bind _ = common.Big1 _ = types.BloomLookup _ = event.NewSubscription _ = abi.ConvertType ) // INonfungiblePositionManagerCollectParams is an auto generated low-level Go binding around an user-defined struct. type INonfungiblePositionManagerCollectParams struct { TokenId *big.Int Recipient common.Address Amount0Max *big.Int Amount1Max *big.Int } // INonfungiblePositionManagerDecreaseLiquidityParams is an auto generated low-level Go binding around an user-defined struct. type INonfungiblePositionManagerDecreaseLiquidityParams struct { TokenId *big.Int Liquidity *big.Int Amount0Min *big.Int Amount1Min *big.Int Deadline *big.Int } // INonfungiblePositionManagerIncreaseLiquidityParams is an auto generated low-level Go binding around an user-defined struct. type INonfungiblePositionManagerIncreaseLiquidityParams struct { TokenId *big.Int Amount0Desired *big.Int Amount1Desired *big.Int Amount0Min *big.Int Amount1Min *big.Int Deadline *big.Int } // INonfungiblePositionManagerMintParams is an auto generated low-level Go binding around an user-defined struct. type INonfungiblePositionManagerMintParams struct { Token0 common.Address Token1 common.Address Fee *big.Int TickLower *big.Int TickUpper *big.Int Amount0Desired *big.Int Amount1Desired *big.Int Amount0Min *big.Int Amount1Min *big.Int Recipient common.Address Deadline *big.Int } // NonfungiblePositionManagerMetaData contains all meta data concerning the NonfungiblePositionManager contract. var NonfungiblePositionManagerMetaData = &bind.MetaData{ ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_factory\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_WETH9\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_tokenDescriptor_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"approved\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"ApprovalForAll\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"}],\"name\":\"Collect\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"liquidity\",\"type\":\"uint128\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"}],\"name\":\"DecreaseLiquidity\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"liquidity\",\"type\":\"uint128\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"}],\"name\":\"IncreaseLiquidity\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"DOMAIN_SEPARATOR\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"PERMIT_TYPEHASH\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"WETH9\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"baseURI\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"burn\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint128\",\"name\":\"amount0Max\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"amount1Max\",\"type\":\"uint128\"}],\"internalType\":\"structINonfungiblePositionManager.CollectParams\",\"name\":\"params\",\"type\":\"tuple\"}],\"name\":\"collect\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token0\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token1\",\"type\":\"address\"},{\"internalType\":\"uint24\",\"name\":\"fee\",\"type\":\"uint24\"},{\"internalType\":\"uint160\",\"name\":\"sqrtPriceX96\",\"type\":\"uint160\"}],\"name\":\"createAndInitializePoolIfNecessary\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint128\",\"name\":\"liquidity\",\"type\":\"uint128\"},{\"internalType\":\"uint256\",\"name\":\"amount0Min\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Min\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"}],\"internalType\":\"structINonfungiblePositionManager.DecreaseLiquidityParams\",\"name\":\"params\",\"type\":\"tuple\"}],\"name\":\"decreaseLiquidity\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"factory\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"getApproved\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount0Desired\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Desired\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount0Min\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Min\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"}],\"internalType\":\"structINonfungiblePositionManager.IncreaseLiquidityParams\",\"name\":\"params\",\"type\":\"tuple\"}],\"name\":\"increaseLiquidity\",\"outputs\":[{\"internalType\":\"uint128\",\"name\":\"liquidity\",\"type\":\"uint128\"},{\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"name\":\"isApprovedForAll\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"token0\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token1\",\"type\":\"address\"},{\"internalType\":\"uint24\",\"name\":\"fee\",\"type\":\"uint24\"},{\"internalType\":\"int24\",\"name\":\"tickLower\",\"type\":\"int24\"},{\"internalType\":\"int24\",\"name\":\"tickUpper\",\"type\":\"int24\"},{\"internalType\":\"uint256\",\"name\":\"amount0Desired\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Desired\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount0Min\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Min\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"}],\"internalType\":\"structINonfungiblePositionManager.MintParams\",\"name\":\"params\",\"type\":\"tuple\"}],\"name\":\"mint\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint128\",\"name\":\"liquidity\",\"type\":\"uint128\"},{\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes[]\",\"name\":\"data\",\"type\":\"bytes[]\"}],\"name\":\"multicall\",\"outputs\":[{\"internalType\":\"bytes[]\",\"name\":\"results\",\"type\":\"bytes[]\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"ownerOf\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"permit\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"positions\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"nonce\",\"type\":\"uint96\"},{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token0\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token1\",\"type\":\"address\"},{\"internalType\":\"uint24\",\"name\":\"fee\",\"type\":\"uint24\"},{\"internalType\":\"int24\",\"name\":\"tickLower\",\"type\":\"int24\"},{\"internalType\":\"int24\",\"name\":\"tickUpper\",\"type\":\"int24\"},{\"internalType\":\"uint128\",\"name\":\"liquidity\",\"type\":\"uint128\"},{\"internalType\":\"uint256\",\"name\":\"feeGrowthInside0LastX128\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"feeGrowthInside1LastX128\",\"type\":\"uint256\"},{\"internalType\":\"uint128\",\"name\":\"tokensOwed0\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"tokensOwed1\",\"type\":\"uint128\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"refundETH\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"safeTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"safeTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"selfPermit\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiry\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"selfPermitAllowed\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiry\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"selfPermitAllowedIfNecessary\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"selfPermitIfNecessary\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"setApprovalForAll\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amountMinimum\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"}],\"name\":\"sweepToken\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"}],\"name\":\"tokenByIndex\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"}],\"name\":\"tokenOfOwnerByIndex\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"tokenURI\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0Owed\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Owed\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"uniswapV3MintCallback\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountMinimum\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"}],\"name\":\"unwrapWETH9\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]", } // NonfungiblePositionManagerABI is the input ABI used to generate the binding from. // Deprecated: Use NonfungiblePositionManagerMetaData.ABI instead. var NonfungiblePositionManagerABI = NonfungiblePositionManagerMetaData.ABI // NonfungiblePositionManager is an auto generated Go binding around an Ethereum contract. type NonfungiblePositionManager struct { NonfungiblePositionManagerCaller // Read-only binding to the contract NonfungiblePositionManagerTransactor // Write-only binding to the contract NonfungiblePositionManagerFilterer // Log filterer for contract events } // NonfungiblePositionManagerCaller is an auto generated read-only Go binding around an Ethereum contract. type NonfungiblePositionManagerCaller struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // NonfungiblePositionManagerTransactor is an auto generated write-only Go binding around an Ethereum contract. type NonfungiblePositionManagerTransactor struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // NonfungiblePositionManagerFilterer is an auto generated log filtering Go binding around an Ethereum contract events. type NonfungiblePositionManagerFilterer struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // NonfungiblePositionManagerSession is an auto generated Go binding around an Ethereum contract, // with pre-set call and transact options. type NonfungiblePositionManagerSession struct { Contract *NonfungiblePositionManager // Generic contract binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // NonfungiblePositionManagerCallerSession is an auto generated read-only Go binding around an Ethereum contract, // with pre-set call options. type NonfungiblePositionManagerCallerSession struct { Contract *NonfungiblePositionManagerCaller // Generic contract caller binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session } // NonfungiblePositionManagerTransactorSession is an auto generated write-only Go binding around an Ethereum contract, // with pre-set transact options. type NonfungiblePositionManagerTransactorSession struct { Contract *NonfungiblePositionManagerTransactor // Generic contract transactor binding to set the session for TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // NonfungiblePositionManagerRaw is an auto generated low-level Go binding around an Ethereum contract. type NonfungiblePositionManagerRaw struct { Contract *NonfungiblePositionManager // Generic contract binding to access the raw methods on } // NonfungiblePositionManagerCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. type NonfungiblePositionManagerCallerRaw struct { Contract *NonfungiblePositionManagerCaller // Generic read-only contract binding to access the raw methods on } // NonfungiblePositionManagerTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. type NonfungiblePositionManagerTransactorRaw struct { Contract *NonfungiblePositionManagerTransactor // Generic write-only contract binding to access the raw methods on } // NewNonfungiblePositionManager creates a new instance of NonfungiblePositionManager, bound to a specific deployed contract. func NewNonfungiblePositionManager(address common.Address, backend bind.ContractBackend) (*NonfungiblePositionManager, error) { contract, err := bindNonfungiblePositionManager(address, backend, backend, backend) if err != nil { return nil, err } return &NonfungiblePositionManager{NonfungiblePositionManagerCaller: NonfungiblePositionManagerCaller{contract: contract}, NonfungiblePositionManagerTransactor: NonfungiblePositionManagerTransactor{contract: contract}, NonfungiblePositionManagerFilterer: NonfungiblePositionManagerFilterer{contract: contract}}, nil } // NewNonfungiblePositionManagerCaller creates a new read-only instance of NonfungiblePositionManager, bound to a specific deployed contract. func NewNonfungiblePositionManagerCaller(address common.Address, caller bind.ContractCaller) (*NonfungiblePositionManagerCaller, error) { contract, err := bindNonfungiblePositionManager(address, caller, nil, nil) if err != nil { return nil, err } return &NonfungiblePositionManagerCaller{contract: contract}, nil } // NewNonfungiblePositionManagerTransactor creates a new write-only instance of NonfungiblePositionManager, bound to a specific deployed contract. func NewNonfungiblePositionManagerTransactor(address common.Address, transactor bind.ContractTransactor) (*NonfungiblePositionManagerTransactor, error) { contract, err := bindNonfungiblePositionManager(address, nil, transactor, nil) if err != nil { return nil, err } return &NonfungiblePositionManagerTransactor{contract: contract}, nil } // NewNonfungiblePositionManagerFilterer creates a new log filterer instance of NonfungiblePositionManager, bound to a specific deployed contract. func NewNonfungiblePositionManagerFilterer(address common.Address, filterer bind.ContractFilterer) (*NonfungiblePositionManagerFilterer, error) { contract, err := bindNonfungiblePositionManager(address, nil, nil, filterer) if err != nil { return nil, err } return &NonfungiblePositionManagerFilterer{contract: contract}, nil } // bindNonfungiblePositionManager binds a generic wrapper to an already deployed contract. func bindNonfungiblePositionManager(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { parsed, err := NonfungiblePositionManagerMetaData.GetAbi() if err != nil { return nil, err } return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_NonfungiblePositionManager *NonfungiblePositionManagerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _NonfungiblePositionManager.Contract.NonfungiblePositionManagerCaller.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_NonfungiblePositionManager *NonfungiblePositionManagerRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.NonfungiblePositionManagerTransactor.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_NonfungiblePositionManager *NonfungiblePositionManagerRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.NonfungiblePositionManagerTransactor.contract.Transact(opts, method, params...) } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _NonfungiblePositionManager.Contract.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.contract.Transact(opts, method, params...) } // DOMAINSEPARATOR is a free data retrieval call binding the contract method 0x3644e515. // // Solidity: function DOMAIN_SEPARATOR() view returns(bytes32) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) DOMAINSEPARATOR(opts *bind.CallOpts) ([32]byte, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "DOMAIN_SEPARATOR") if err != nil { return *new([32]byte), err } out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) return out0, err } // DOMAINSEPARATOR is a free data retrieval call binding the contract method 0x3644e515. // // Solidity: function DOMAIN_SEPARATOR() view returns(bytes32) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) DOMAINSEPARATOR() ([32]byte, error) { return _NonfungiblePositionManager.Contract.DOMAINSEPARATOR(&_NonfungiblePositionManager.CallOpts) } // DOMAINSEPARATOR is a free data retrieval call binding the contract method 0x3644e515. // // Solidity: function DOMAIN_SEPARATOR() view returns(bytes32) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) DOMAINSEPARATOR() ([32]byte, error) { return _NonfungiblePositionManager.Contract.DOMAINSEPARATOR(&_NonfungiblePositionManager.CallOpts) } // PERMITTYPEHASH is a free data retrieval call binding the contract method 0x30adf81f. // // Solidity: function PERMIT_TYPEHASH() view returns(bytes32) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) PERMITTYPEHASH(opts *bind.CallOpts) ([32]byte, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "PERMIT_TYPEHASH") if err != nil { return *new([32]byte), err } out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) return out0, err } // PERMITTYPEHASH is a free data retrieval call binding the contract method 0x30adf81f. // // Solidity: function PERMIT_TYPEHASH() view returns(bytes32) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) PERMITTYPEHASH() ([32]byte, error) { return _NonfungiblePositionManager.Contract.PERMITTYPEHASH(&_NonfungiblePositionManager.CallOpts) } // PERMITTYPEHASH is a free data retrieval call binding the contract method 0x30adf81f. // // Solidity: function PERMIT_TYPEHASH() view returns(bytes32) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) PERMITTYPEHASH() ([32]byte, error) { return _NonfungiblePositionManager.Contract.PERMITTYPEHASH(&_NonfungiblePositionManager.CallOpts) } // WETH9 is a free data retrieval call binding the contract method 0x4aa4a4fc. // // Solidity: function WETH9() view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) WETH9(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "WETH9") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // WETH9 is a free data retrieval call binding the contract method 0x4aa4a4fc. // // Solidity: function WETH9() view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) WETH9() (common.Address, error) { return _NonfungiblePositionManager.Contract.WETH9(&_NonfungiblePositionManager.CallOpts) } // WETH9 is a free data retrieval call binding the contract method 0x4aa4a4fc. // // Solidity: function WETH9() view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) WETH9() (common.Address, error) { return _NonfungiblePositionManager.Contract.WETH9(&_NonfungiblePositionManager.CallOpts) } // BalanceOf is a free data retrieval call binding the contract method 0x70a08231. // // Solidity: function balanceOf(address owner) view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) BalanceOf(opts *bind.CallOpts, owner common.Address) (*big.Int, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "balanceOf", owner) if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // BalanceOf is a free data retrieval call binding the contract method 0x70a08231. // // Solidity: function balanceOf(address owner) view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) BalanceOf(owner common.Address) (*big.Int, error) { return _NonfungiblePositionManager.Contract.BalanceOf(&_NonfungiblePositionManager.CallOpts, owner) } // BalanceOf is a free data retrieval call binding the contract method 0x70a08231. // // Solidity: function balanceOf(address owner) view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) BalanceOf(owner common.Address) (*big.Int, error) { return _NonfungiblePositionManager.Contract.BalanceOf(&_NonfungiblePositionManager.CallOpts, owner) } // BaseURI is a free data retrieval call binding the contract method 0x6c0360eb. // // Solidity: function baseURI() pure returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) BaseURI(opts *bind.CallOpts) (string, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "baseURI") if err != nil { return *new(string), err } out0 := *abi.ConvertType(out[0], new(string)).(*string) return out0, err } // BaseURI is a free data retrieval call binding the contract method 0x6c0360eb. // // Solidity: function baseURI() pure returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) BaseURI() (string, error) { return _NonfungiblePositionManager.Contract.BaseURI(&_NonfungiblePositionManager.CallOpts) } // BaseURI is a free data retrieval call binding the contract method 0x6c0360eb. // // Solidity: function baseURI() pure returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) BaseURI() (string, error) { return _NonfungiblePositionManager.Contract.BaseURI(&_NonfungiblePositionManager.CallOpts) } // Factory is a free data retrieval call binding the contract method 0xc45a0155. // // Solidity: function factory() view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) Factory(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "factory") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // Factory is a free data retrieval call binding the contract method 0xc45a0155. // // Solidity: function factory() view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Factory() (common.Address, error) { return _NonfungiblePositionManager.Contract.Factory(&_NonfungiblePositionManager.CallOpts) } // Factory is a free data retrieval call binding the contract method 0xc45a0155. // // Solidity: function factory() view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) Factory() (common.Address, error) { return _NonfungiblePositionManager.Contract.Factory(&_NonfungiblePositionManager.CallOpts) } // GetApproved is a free data retrieval call binding the contract method 0x081812fc. // // Solidity: function getApproved(uint256 tokenId) view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) GetApproved(opts *bind.CallOpts, tokenId *big.Int) (common.Address, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "getApproved", tokenId) if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // GetApproved is a free data retrieval call binding the contract method 0x081812fc. // // Solidity: function getApproved(uint256 tokenId) view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) GetApproved(tokenId *big.Int) (common.Address, error) { return _NonfungiblePositionManager.Contract.GetApproved(&_NonfungiblePositionManager.CallOpts, tokenId) } // GetApproved is a free data retrieval call binding the contract method 0x081812fc. // // Solidity: function getApproved(uint256 tokenId) view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) GetApproved(tokenId *big.Int) (common.Address, error) { return _NonfungiblePositionManager.Contract.GetApproved(&_NonfungiblePositionManager.CallOpts, tokenId) } // IsApprovedForAll is a free data retrieval call binding the contract method 0xe985e9c5. // // Solidity: function isApprovedForAll(address owner, address operator) view returns(bool) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) IsApprovedForAll(opts *bind.CallOpts, owner common.Address, operator common.Address) (bool, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "isApprovedForAll", owner, operator) if err != nil { return *new(bool), err } out0 := *abi.ConvertType(out[0], new(bool)).(*bool) return out0, err } // IsApprovedForAll is a free data retrieval call binding the contract method 0xe985e9c5. // // Solidity: function isApprovedForAll(address owner, address operator) view returns(bool) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) IsApprovedForAll(owner common.Address, operator common.Address) (bool, error) { return _NonfungiblePositionManager.Contract.IsApprovedForAll(&_NonfungiblePositionManager.CallOpts, owner, operator) } // IsApprovedForAll is a free data retrieval call binding the contract method 0xe985e9c5. // // Solidity: function isApprovedForAll(address owner, address operator) view returns(bool) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) IsApprovedForAll(owner common.Address, operator common.Address) (bool, error) { return _NonfungiblePositionManager.Contract.IsApprovedForAll(&_NonfungiblePositionManager.CallOpts, owner, operator) } // Name is a free data retrieval call binding the contract method 0x06fdde03. // // Solidity: function name() view returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) Name(opts *bind.CallOpts) (string, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "name") if err != nil { return *new(string), err } out0 := *abi.ConvertType(out[0], new(string)).(*string) return out0, err } // Name is a free data retrieval call binding the contract method 0x06fdde03. // // Solidity: function name() view returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Name() (string, error) { return _NonfungiblePositionManager.Contract.Name(&_NonfungiblePositionManager.CallOpts) } // Name is a free data retrieval call binding the contract method 0x06fdde03. // // Solidity: function name() view returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) Name() (string, error) { return _NonfungiblePositionManager.Contract.Name(&_NonfungiblePositionManager.CallOpts) } // OwnerOf is a free data retrieval call binding the contract method 0x6352211e. // // Solidity: function ownerOf(uint256 tokenId) view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) OwnerOf(opts *bind.CallOpts, tokenId *big.Int) (common.Address, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "ownerOf", tokenId) if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // OwnerOf is a free data retrieval call binding the contract method 0x6352211e. // // Solidity: function ownerOf(uint256 tokenId) view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) OwnerOf(tokenId *big.Int) (common.Address, error) { return _NonfungiblePositionManager.Contract.OwnerOf(&_NonfungiblePositionManager.CallOpts, tokenId) } // OwnerOf is a free data retrieval call binding the contract method 0x6352211e. // // Solidity: function ownerOf(uint256 tokenId) view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) OwnerOf(tokenId *big.Int) (common.Address, error) { return _NonfungiblePositionManager.Contract.OwnerOf(&_NonfungiblePositionManager.CallOpts, tokenId) } // Positions is a free data retrieval call binding the contract method 0x99fbab88. // // Solidity: function positions(uint256 tokenId) view returns(uint96 nonce, address operator, address token0, address token1, uint24 fee, int24 tickLower, int24 tickUpper, uint128 liquidity, uint256 feeGrowthInside0LastX128, uint256 feeGrowthInside1LastX128, uint128 tokensOwed0, uint128 tokensOwed1) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) Positions(opts *bind.CallOpts, tokenId *big.Int) (struct { Nonce *big.Int Operator common.Address Token0 common.Address Token1 common.Address Fee *big.Int TickLower *big.Int TickUpper *big.Int Liquidity *big.Int FeeGrowthInside0LastX128 *big.Int FeeGrowthInside1LastX128 *big.Int TokensOwed0 *big.Int TokensOwed1 *big.Int }, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "positions", tokenId) outstruct := new(struct { Nonce *big.Int Operator common.Address Token0 common.Address Token1 common.Address Fee *big.Int TickLower *big.Int TickUpper *big.Int Liquidity *big.Int FeeGrowthInside0LastX128 *big.Int FeeGrowthInside1LastX128 *big.Int TokensOwed0 *big.Int TokensOwed1 *big.Int }) if err != nil { return *outstruct, err } outstruct.Nonce = *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) outstruct.Operator = *abi.ConvertType(out[1], new(common.Address)).(*common.Address) outstruct.Token0 = *abi.ConvertType(out[2], new(common.Address)).(*common.Address) outstruct.Token1 = *abi.ConvertType(out[3], new(common.Address)).(*common.Address) outstruct.Fee = *abi.ConvertType(out[4], new(*big.Int)).(**big.Int) outstruct.TickLower = *abi.ConvertType(out[5], new(*big.Int)).(**big.Int) outstruct.TickUpper = *abi.ConvertType(out[6], new(*big.Int)).(**big.Int) outstruct.Liquidity = *abi.ConvertType(out[7], new(*big.Int)).(**big.Int) outstruct.FeeGrowthInside0LastX128 = *abi.ConvertType(out[8], new(*big.Int)).(**big.Int) outstruct.FeeGrowthInside1LastX128 = *abi.ConvertType(out[9], new(*big.Int)).(**big.Int) outstruct.TokensOwed0 = *abi.ConvertType(out[10], new(*big.Int)).(**big.Int) outstruct.TokensOwed1 = *abi.ConvertType(out[11], new(*big.Int)).(**big.Int) return *outstruct, err } // Positions is a free data retrieval call binding the contract method 0x99fbab88. // // Solidity: function positions(uint256 tokenId) view returns(uint96 nonce, address operator, address token0, address token1, uint24 fee, int24 tickLower, int24 tickUpper, uint128 liquidity, uint256 feeGrowthInside0LastX128, uint256 feeGrowthInside1LastX128, uint128 tokensOwed0, uint128 tokensOwed1) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Positions(tokenId *big.Int) (struct { Nonce *big.Int Operator common.Address Token0 common.Address Token1 common.Address Fee *big.Int TickLower *big.Int TickUpper *big.Int Liquidity *big.Int FeeGrowthInside0LastX128 *big.Int FeeGrowthInside1LastX128 *big.Int TokensOwed0 *big.Int TokensOwed1 *big.Int }, error) { return _NonfungiblePositionManager.Contract.Positions(&_NonfungiblePositionManager.CallOpts, tokenId) } // Positions is a free data retrieval call binding the contract method 0x99fbab88. // // Solidity: function positions(uint256 tokenId) view returns(uint96 nonce, address operator, address token0, address token1, uint24 fee, int24 tickLower, int24 tickUpper, uint128 liquidity, uint256 feeGrowthInside0LastX128, uint256 feeGrowthInside1LastX128, uint128 tokensOwed0, uint128 tokensOwed1) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) Positions(tokenId *big.Int) (struct { Nonce *big.Int Operator common.Address Token0 common.Address Token1 common.Address Fee *big.Int TickLower *big.Int TickUpper *big.Int Liquidity *big.Int FeeGrowthInside0LastX128 *big.Int FeeGrowthInside1LastX128 *big.Int TokensOwed0 *big.Int TokensOwed1 *big.Int }, error) { return _NonfungiblePositionManager.Contract.Positions(&_NonfungiblePositionManager.CallOpts, tokenId) } // SupportsInterface is a free data retrieval call binding the contract method 0x01ffc9a7. // // Solidity: function supportsInterface(bytes4 interfaceId) view returns(bool) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) SupportsInterface(opts *bind.CallOpts, interfaceId [4]byte) (bool, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "supportsInterface", interfaceId) if err != nil { return *new(bool), err } out0 := *abi.ConvertType(out[0], new(bool)).(*bool) return out0, err } // SupportsInterface is a free data retrieval call binding the contract method 0x01ffc9a7. // // Solidity: function supportsInterface(bytes4 interfaceId) view returns(bool) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) SupportsInterface(interfaceId [4]byte) (bool, error) { return _NonfungiblePositionManager.Contract.SupportsInterface(&_NonfungiblePositionManager.CallOpts, interfaceId) } // SupportsInterface is a free data retrieval call binding the contract method 0x01ffc9a7. // // Solidity: function supportsInterface(bytes4 interfaceId) view returns(bool) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) SupportsInterface(interfaceId [4]byte) (bool, error) { return _NonfungiblePositionManager.Contract.SupportsInterface(&_NonfungiblePositionManager.CallOpts, interfaceId) } // Symbol is a free data retrieval call binding the contract method 0x95d89b41. // // Solidity: function symbol() view returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) Symbol(opts *bind.CallOpts) (string, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "symbol") if err != nil { return *new(string), err } out0 := *abi.ConvertType(out[0], new(string)).(*string) return out0, err } // Symbol is a free data retrieval call binding the contract method 0x95d89b41. // // Solidity: function symbol() view returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Symbol() (string, error) { return _NonfungiblePositionManager.Contract.Symbol(&_NonfungiblePositionManager.CallOpts) } // Symbol is a free data retrieval call binding the contract method 0x95d89b41. // // Solidity: function symbol() view returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) Symbol() (string, error) { return _NonfungiblePositionManager.Contract.Symbol(&_NonfungiblePositionManager.CallOpts) } // TokenByIndex is a free data retrieval call binding the contract method 0x4f6ccce7. // // Solidity: function tokenByIndex(uint256 index) view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) TokenByIndex(opts *bind.CallOpts, index *big.Int) (*big.Int, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "tokenByIndex", index) if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // TokenByIndex is a free data retrieval call binding the contract method 0x4f6ccce7. // // Solidity: function tokenByIndex(uint256 index) view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) TokenByIndex(index *big.Int) (*big.Int, error) { return _NonfungiblePositionManager.Contract.TokenByIndex(&_NonfungiblePositionManager.CallOpts, index) } // TokenByIndex is a free data retrieval call binding the contract method 0x4f6ccce7. // // Solidity: function tokenByIndex(uint256 index) view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) TokenByIndex(index *big.Int) (*big.Int, error) { return _NonfungiblePositionManager.Contract.TokenByIndex(&_NonfungiblePositionManager.CallOpts, index) } // TokenOfOwnerByIndex is a free data retrieval call binding the contract method 0x2f745c59. // // Solidity: function tokenOfOwnerByIndex(address owner, uint256 index) view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) TokenOfOwnerByIndex(opts *bind.CallOpts, owner common.Address, index *big.Int) (*big.Int, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "tokenOfOwnerByIndex", owner, index) if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // TokenOfOwnerByIndex is a free data retrieval call binding the contract method 0x2f745c59. // // Solidity: function tokenOfOwnerByIndex(address owner, uint256 index) view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) TokenOfOwnerByIndex(owner common.Address, index *big.Int) (*big.Int, error) { return _NonfungiblePositionManager.Contract.TokenOfOwnerByIndex(&_NonfungiblePositionManager.CallOpts, owner, index) } // TokenOfOwnerByIndex is a free data retrieval call binding the contract method 0x2f745c59. // // Solidity: function tokenOfOwnerByIndex(address owner, uint256 index) view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) TokenOfOwnerByIndex(owner common.Address, index *big.Int) (*big.Int, error) { return _NonfungiblePositionManager.Contract.TokenOfOwnerByIndex(&_NonfungiblePositionManager.CallOpts, owner, index) } // TokenURI is a free data retrieval call binding the contract method 0xc87b56dd. // // Solidity: function tokenURI(uint256 tokenId) view returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) TokenURI(opts *bind.CallOpts, tokenId *big.Int) (string, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "tokenURI", tokenId) if err != nil { return *new(string), err } out0 := *abi.ConvertType(out[0], new(string)).(*string) return out0, err } // TokenURI is a free data retrieval call binding the contract method 0xc87b56dd. // // Solidity: function tokenURI(uint256 tokenId) view returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) TokenURI(tokenId *big.Int) (string, error) { return _NonfungiblePositionManager.Contract.TokenURI(&_NonfungiblePositionManager.CallOpts, tokenId) } // TokenURI is a free data retrieval call binding the contract method 0xc87b56dd. // // Solidity: function tokenURI(uint256 tokenId) view returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) TokenURI(tokenId *big.Int) (string, error) { return _NonfungiblePositionManager.Contract.TokenURI(&_NonfungiblePositionManager.CallOpts, tokenId) } // TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. // // Solidity: function totalSupply() view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) TotalSupply(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "totalSupply") if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. // // Solidity: function totalSupply() view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) TotalSupply() (*big.Int, error) { return _NonfungiblePositionManager.Contract.TotalSupply(&_NonfungiblePositionManager.CallOpts) } // TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. // // Solidity: function totalSupply() view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) TotalSupply() (*big.Int, error) { return _NonfungiblePositionManager.Contract.TotalSupply(&_NonfungiblePositionManager.CallOpts) } // Approve is a paid mutator transaction binding the contract method 0x095ea7b3. // // Solidity: function approve(address to, uint256 tokenId) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) Approve(opts *bind.TransactOpts, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "approve", to, tokenId) } // Approve is a paid mutator transaction binding the contract method 0x095ea7b3. // // Solidity: function approve(address to, uint256 tokenId) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Approve(to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Approve(&_NonfungiblePositionManager.TransactOpts, to, tokenId) } // Approve is a paid mutator transaction binding the contract method 0x095ea7b3. // // Solidity: function approve(address to, uint256 tokenId) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) Approve(to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Approve(&_NonfungiblePositionManager.TransactOpts, to, tokenId) } // Burn is a paid mutator transaction binding the contract method 0x42966c68. // // Solidity: function burn(uint256 tokenId) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) Burn(opts *bind.TransactOpts, tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "burn", tokenId) } // Burn is a paid mutator transaction binding the contract method 0x42966c68. // // Solidity: function burn(uint256 tokenId) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Burn(tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Burn(&_NonfungiblePositionManager.TransactOpts, tokenId) } // Burn is a paid mutator transaction binding the contract method 0x42966c68. // // Solidity: function burn(uint256 tokenId) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) Burn(tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Burn(&_NonfungiblePositionManager.TransactOpts, tokenId) } // Collect is a paid mutator transaction binding the contract method 0xfc6f7865. // // Solidity: function collect((uint256,address,uint128,uint128) params) payable returns(uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) Collect(opts *bind.TransactOpts, params INonfungiblePositionManagerCollectParams) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "collect", params) } // Collect is a paid mutator transaction binding the contract method 0xfc6f7865. // // Solidity: function collect((uint256,address,uint128,uint128) params) payable returns(uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Collect(params INonfungiblePositionManagerCollectParams) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Collect(&_NonfungiblePositionManager.TransactOpts, params) } // Collect is a paid mutator transaction binding the contract method 0xfc6f7865. // // Solidity: function collect((uint256,address,uint128,uint128) params) payable returns(uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) Collect(params INonfungiblePositionManagerCollectParams) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Collect(&_NonfungiblePositionManager.TransactOpts, params) } // CreateAndInitializePoolIfNecessary is a paid mutator transaction binding the contract method 0x13ead562. // // Solidity: function createAndInitializePoolIfNecessary(address token0, address token1, uint24 fee, uint160 sqrtPriceX96) payable returns(address pool) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) CreateAndInitializePoolIfNecessary(opts *bind.TransactOpts, token0 common.Address, token1 common.Address, fee *big.Int, sqrtPriceX96 *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "createAndInitializePoolIfNecessary", token0, token1, fee, sqrtPriceX96) } // CreateAndInitializePoolIfNecessary is a paid mutator transaction binding the contract method 0x13ead562. // // Solidity: function createAndInitializePoolIfNecessary(address token0, address token1, uint24 fee, uint160 sqrtPriceX96) payable returns(address pool) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) CreateAndInitializePoolIfNecessary(token0 common.Address, token1 common.Address, fee *big.Int, sqrtPriceX96 *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.CreateAndInitializePoolIfNecessary(&_NonfungiblePositionManager.TransactOpts, token0, token1, fee, sqrtPriceX96) } // CreateAndInitializePoolIfNecessary is a paid mutator transaction binding the contract method 0x13ead562. // // Solidity: function createAndInitializePoolIfNecessary(address token0, address token1, uint24 fee, uint160 sqrtPriceX96) payable returns(address pool) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) CreateAndInitializePoolIfNecessary(token0 common.Address, token1 common.Address, fee *big.Int, sqrtPriceX96 *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.CreateAndInitializePoolIfNecessary(&_NonfungiblePositionManager.TransactOpts, token0, token1, fee, sqrtPriceX96) } // DecreaseLiquidity is a paid mutator transaction binding the contract method 0x0c49ccbe. // // Solidity: function decreaseLiquidity((uint256,uint128,uint256,uint256,uint256) params) payable returns(uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) DecreaseLiquidity(opts *bind.TransactOpts, params INonfungiblePositionManagerDecreaseLiquidityParams) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "decreaseLiquidity", params) } // DecreaseLiquidity is a paid mutator transaction binding the contract method 0x0c49ccbe. // // Solidity: function decreaseLiquidity((uint256,uint128,uint256,uint256,uint256) params) payable returns(uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) DecreaseLiquidity(params INonfungiblePositionManagerDecreaseLiquidityParams) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.DecreaseLiquidity(&_NonfungiblePositionManager.TransactOpts, params) } // DecreaseLiquidity is a paid mutator transaction binding the contract method 0x0c49ccbe. // // Solidity: function decreaseLiquidity((uint256,uint128,uint256,uint256,uint256) params) payable returns(uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) DecreaseLiquidity(params INonfungiblePositionManagerDecreaseLiquidityParams) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.DecreaseLiquidity(&_NonfungiblePositionManager.TransactOpts, params) } // IncreaseLiquidity is a paid mutator transaction binding the contract method 0x219f5d17. // // Solidity: function increaseLiquidity((uint256,uint256,uint256,uint256,uint256,uint256) params) payable returns(uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) IncreaseLiquidity(opts *bind.TransactOpts, params INonfungiblePositionManagerIncreaseLiquidityParams) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "increaseLiquidity", params) } // IncreaseLiquidity is a paid mutator transaction binding the contract method 0x219f5d17. // // Solidity: function increaseLiquidity((uint256,uint256,uint256,uint256,uint256,uint256) params) payable returns(uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) IncreaseLiquidity(params INonfungiblePositionManagerIncreaseLiquidityParams) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.IncreaseLiquidity(&_NonfungiblePositionManager.TransactOpts, params) } // IncreaseLiquidity is a paid mutator transaction binding the contract method 0x219f5d17. // // Solidity: function increaseLiquidity((uint256,uint256,uint256,uint256,uint256,uint256) params) payable returns(uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) IncreaseLiquidity(params INonfungiblePositionManagerIncreaseLiquidityParams) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.IncreaseLiquidity(&_NonfungiblePositionManager.TransactOpts, params) } // Mint is a paid mutator transaction binding the contract method 0x88316456. // // Solidity: function mint((address,address,uint24,int24,int24,uint256,uint256,uint256,uint256,address,uint256) params) payable returns(uint256 tokenId, uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) Mint(opts *bind.TransactOpts, params INonfungiblePositionManagerMintParams) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "mint", params) } // Mint is a paid mutator transaction binding the contract method 0x88316456. // // Solidity: function mint((address,address,uint24,int24,int24,uint256,uint256,uint256,uint256,address,uint256) params) payable returns(uint256 tokenId, uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Mint(params INonfungiblePositionManagerMintParams) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Mint(&_NonfungiblePositionManager.TransactOpts, params) } // Mint is a paid mutator transaction binding the contract method 0x88316456. // // Solidity: function mint((address,address,uint24,int24,int24,uint256,uint256,uint256,uint256,address,uint256) params) payable returns(uint256 tokenId, uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) Mint(params INonfungiblePositionManagerMintParams) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Mint(&_NonfungiblePositionManager.TransactOpts, params) } // Multicall is a paid mutator transaction binding the contract method 0xac9650d8. // // Solidity: function multicall(bytes[] data) payable returns(bytes[] results) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) Multicall(opts *bind.TransactOpts, data [][]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "multicall", data) } // Multicall is a paid mutator transaction binding the contract method 0xac9650d8. // // Solidity: function multicall(bytes[] data) payable returns(bytes[] results) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Multicall(data [][]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Multicall(&_NonfungiblePositionManager.TransactOpts, data) } // Multicall is a paid mutator transaction binding the contract method 0xac9650d8. // // Solidity: function multicall(bytes[] data) payable returns(bytes[] results) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) Multicall(data [][]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Multicall(&_NonfungiblePositionManager.TransactOpts, data) } // Permit is a paid mutator transaction binding the contract method 0x7ac2ff7b. // // Solidity: function permit(address spender, uint256 tokenId, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) Permit(opts *bind.TransactOpts, spender common.Address, tokenId *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "permit", spender, tokenId, deadline, v, r, s) } // Permit is a paid mutator transaction binding the contract method 0x7ac2ff7b. // // Solidity: function permit(address spender, uint256 tokenId, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Permit(spender common.Address, tokenId *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Permit(&_NonfungiblePositionManager.TransactOpts, spender, tokenId, deadline, v, r, s) } // Permit is a paid mutator transaction binding the contract method 0x7ac2ff7b. // // Solidity: function permit(address spender, uint256 tokenId, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) Permit(spender common.Address, tokenId *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Permit(&_NonfungiblePositionManager.TransactOpts, spender, tokenId, deadline, v, r, s) } // RefundETH is a paid mutator transaction binding the contract method 0x12210e8a. // // Solidity: function refundETH() payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) RefundETH(opts *bind.TransactOpts) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "refundETH") } // RefundETH is a paid mutator transaction binding the contract method 0x12210e8a. // // Solidity: function refundETH() payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) RefundETH() (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.RefundETH(&_NonfungiblePositionManager.TransactOpts) } // RefundETH is a paid mutator transaction binding the contract method 0x12210e8a. // // Solidity: function refundETH() payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) RefundETH() (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.RefundETH(&_NonfungiblePositionManager.TransactOpts) } // SafeTransferFrom is a paid mutator transaction binding the contract method 0x42842e0e. // // Solidity: function safeTransferFrom(address from, address to, uint256 tokenId) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) SafeTransferFrom(opts *bind.TransactOpts, from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "safeTransferFrom", from, to, tokenId) } // SafeTransferFrom is a paid mutator transaction binding the contract method 0x42842e0e. // // Solidity: function safeTransferFrom(address from, address to, uint256 tokenId) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) SafeTransferFrom(from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SafeTransferFrom(&_NonfungiblePositionManager.TransactOpts, from, to, tokenId) } // SafeTransferFrom is a paid mutator transaction binding the contract method 0x42842e0e. // // Solidity: function safeTransferFrom(address from, address to, uint256 tokenId) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) SafeTransferFrom(from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SafeTransferFrom(&_NonfungiblePositionManager.TransactOpts, from, to, tokenId) } // SafeTransferFrom0 is a paid mutator transaction binding the contract method 0xb88d4fde. // // Solidity: function safeTransferFrom(address from, address to, uint256 tokenId, bytes _data) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) SafeTransferFrom0(opts *bind.TransactOpts, from common.Address, to common.Address, tokenId *big.Int, _data []byte) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "safeTransferFrom0", from, to, tokenId, _data) } // SafeTransferFrom0 is a paid mutator transaction binding the contract method 0xb88d4fde. // // Solidity: function safeTransferFrom(address from, address to, uint256 tokenId, bytes _data) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) SafeTransferFrom0(from common.Address, to common.Address, tokenId *big.Int, _data []byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SafeTransferFrom0(&_NonfungiblePositionManager.TransactOpts, from, to, tokenId, _data) } // SafeTransferFrom0 is a paid mutator transaction binding the contract method 0xb88d4fde. // // Solidity: function safeTransferFrom(address from, address to, uint256 tokenId, bytes _data) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) SafeTransferFrom0(from common.Address, to common.Address, tokenId *big.Int, _data []byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SafeTransferFrom0(&_NonfungiblePositionManager.TransactOpts, from, to, tokenId, _data) } // SelfPermit is a paid mutator transaction binding the contract method 0xf3995c67. // // Solidity: function selfPermit(address token, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) SelfPermit(opts *bind.TransactOpts, token common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "selfPermit", token, value, deadline, v, r, s) } // SelfPermit is a paid mutator transaction binding the contract method 0xf3995c67. // // Solidity: function selfPermit(address token, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) SelfPermit(token common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SelfPermit(&_NonfungiblePositionManager.TransactOpts, token, value, deadline, v, r, s) } // SelfPermit is a paid mutator transaction binding the contract method 0xf3995c67. // // Solidity: function selfPermit(address token, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) SelfPermit(token common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SelfPermit(&_NonfungiblePositionManager.TransactOpts, token, value, deadline, v, r, s) } // SelfPermitAllowed is a paid mutator transaction binding the contract method 0x4659a494. // // Solidity: function selfPermitAllowed(address token, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) SelfPermitAllowed(opts *bind.TransactOpts, token common.Address, nonce *big.Int, expiry *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "selfPermitAllowed", token, nonce, expiry, v, r, s) } // SelfPermitAllowed is a paid mutator transaction binding the contract method 0x4659a494. // // Solidity: function selfPermitAllowed(address token, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) SelfPermitAllowed(token common.Address, nonce *big.Int, expiry *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SelfPermitAllowed(&_NonfungiblePositionManager.TransactOpts, token, nonce, expiry, v, r, s) } // SelfPermitAllowed is a paid mutator transaction binding the contract method 0x4659a494. // // Solidity: function selfPermitAllowed(address token, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) SelfPermitAllowed(token common.Address, nonce *big.Int, expiry *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SelfPermitAllowed(&_NonfungiblePositionManager.TransactOpts, token, nonce, expiry, v, r, s) } // SelfPermitAllowedIfNecessary is a paid mutator transaction binding the contract method 0xa4a78f0c. // // Solidity: function selfPermitAllowedIfNecessary(address token, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) SelfPermitAllowedIfNecessary(opts *bind.TransactOpts, token common.Address, nonce *big.Int, expiry *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "selfPermitAllowedIfNecessary", token, nonce, expiry, v, r, s) } // SelfPermitAllowedIfNecessary is a paid mutator transaction binding the contract method 0xa4a78f0c. // // Solidity: function selfPermitAllowedIfNecessary(address token, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) SelfPermitAllowedIfNecessary(token common.Address, nonce *big.Int, expiry *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SelfPermitAllowedIfNecessary(&_NonfungiblePositionManager.TransactOpts, token, nonce, expiry, v, r, s) } // SelfPermitAllowedIfNecessary is a paid mutator transaction binding the contract method 0xa4a78f0c. // // Solidity: function selfPermitAllowedIfNecessary(address token, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) SelfPermitAllowedIfNecessary(token common.Address, nonce *big.Int, expiry *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SelfPermitAllowedIfNecessary(&_NonfungiblePositionManager.TransactOpts, token, nonce, expiry, v, r, s) } // SelfPermitIfNecessary is a paid mutator transaction binding the contract method 0xc2e3140a. // // Solidity: function selfPermitIfNecessary(address token, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) SelfPermitIfNecessary(opts *bind.TransactOpts, token common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "selfPermitIfNecessary", token, value, deadline, v, r, s) } // SelfPermitIfNecessary is a paid mutator transaction binding the contract method 0xc2e3140a. // // Solidity: function selfPermitIfNecessary(address token, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) SelfPermitIfNecessary(token common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SelfPermitIfNecessary(&_NonfungiblePositionManager.TransactOpts, token, value, deadline, v, r, s) } // SelfPermitIfNecessary is a paid mutator transaction binding the contract method 0xc2e3140a. // // Solidity: function selfPermitIfNecessary(address token, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) SelfPermitIfNecessary(token common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SelfPermitIfNecessary(&_NonfungiblePositionManager.TransactOpts, token, value, deadline, v, r, s) } // SetApprovalForAll is a paid mutator transaction binding the contract method 0xa22cb465. // // Solidity: function setApprovalForAll(address operator, bool approved) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) SetApprovalForAll(opts *bind.TransactOpts, operator common.Address, approved bool) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "setApprovalForAll", operator, approved) } // SetApprovalForAll is a paid mutator transaction binding the contract method 0xa22cb465. // // Solidity: function setApprovalForAll(address operator, bool approved) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) SetApprovalForAll(operator common.Address, approved bool) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SetApprovalForAll(&_NonfungiblePositionManager.TransactOpts, operator, approved) } // SetApprovalForAll is a paid mutator transaction binding the contract method 0xa22cb465. // // Solidity: function setApprovalForAll(address operator, bool approved) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) SetApprovalForAll(operator common.Address, approved bool) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SetApprovalForAll(&_NonfungiblePositionManager.TransactOpts, operator, approved) } // SweepToken is a paid mutator transaction binding the contract method 0xdf2ab5bb. // // Solidity: function sweepToken(address token, uint256 amountMinimum, address recipient) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) SweepToken(opts *bind.TransactOpts, token common.Address, amountMinimum *big.Int, recipient common.Address) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "sweepToken", token, amountMinimum, recipient) } // SweepToken is a paid mutator transaction binding the contract method 0xdf2ab5bb. // // Solidity: function sweepToken(address token, uint256 amountMinimum, address recipient) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) SweepToken(token common.Address, amountMinimum *big.Int, recipient common.Address) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SweepToken(&_NonfungiblePositionManager.TransactOpts, token, amountMinimum, recipient) } // SweepToken is a paid mutator transaction binding the contract method 0xdf2ab5bb. // // Solidity: function sweepToken(address token, uint256 amountMinimum, address recipient) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) SweepToken(token common.Address, amountMinimum *big.Int, recipient common.Address) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SweepToken(&_NonfungiblePositionManager.TransactOpts, token, amountMinimum, recipient) } // TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. // // Solidity: function transferFrom(address from, address to, uint256 tokenId) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) TransferFrom(opts *bind.TransactOpts, from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "transferFrom", from, to, tokenId) } // TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. // // Solidity: function transferFrom(address from, address to, uint256 tokenId) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) TransferFrom(from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.TransferFrom(&_NonfungiblePositionManager.TransactOpts, from, to, tokenId) } // TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. // // Solidity: function transferFrom(address from, address to, uint256 tokenId) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) TransferFrom(from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.TransferFrom(&_NonfungiblePositionManager.TransactOpts, from, to, tokenId) } // UniswapV3MintCallback is a paid mutator transaction binding the contract method 0xd3487997. // // Solidity: function uniswapV3MintCallback(uint256 amount0Owed, uint256 amount1Owed, bytes data) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) UniswapV3MintCallback(opts *bind.TransactOpts, amount0Owed *big.Int, amount1Owed *big.Int, data []byte) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "uniswapV3MintCallback", amount0Owed, amount1Owed, data) } // UniswapV3MintCallback is a paid mutator transaction binding the contract method 0xd3487997. // // Solidity: function uniswapV3MintCallback(uint256 amount0Owed, uint256 amount1Owed, bytes data) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) UniswapV3MintCallback(amount0Owed *big.Int, amount1Owed *big.Int, data []byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.UniswapV3MintCallback(&_NonfungiblePositionManager.TransactOpts, amount0Owed, amount1Owed, data) } // UniswapV3MintCallback is a paid mutator transaction binding the contract method 0xd3487997. // // Solidity: function uniswapV3MintCallback(uint256 amount0Owed, uint256 amount1Owed, bytes data) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) UniswapV3MintCallback(amount0Owed *big.Int, amount1Owed *big.Int, data []byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.UniswapV3MintCallback(&_NonfungiblePositionManager.TransactOpts, amount0Owed, amount1Owed, data) } // UnwrapWETH9 is a paid mutator transaction binding the contract method 0x49404b7c. // // Solidity: function unwrapWETH9(uint256 amountMinimum, address recipient) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) UnwrapWETH9(opts *bind.TransactOpts, amountMinimum *big.Int, recipient common.Address) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "unwrapWETH9", amountMinimum, recipient) } // UnwrapWETH9 is a paid mutator transaction binding the contract method 0x49404b7c. // // Solidity: function unwrapWETH9(uint256 amountMinimum, address recipient) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) UnwrapWETH9(amountMinimum *big.Int, recipient common.Address) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.UnwrapWETH9(&_NonfungiblePositionManager.TransactOpts, amountMinimum, recipient) } // UnwrapWETH9 is a paid mutator transaction binding the contract method 0x49404b7c. // // Solidity: function unwrapWETH9(uint256 amountMinimum, address recipient) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) UnwrapWETH9(amountMinimum *big.Int, recipient common.Address) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.UnwrapWETH9(&_NonfungiblePositionManager.TransactOpts, amountMinimum, recipient) } // Receive is a paid mutator transaction binding the contract receive function. // // Solidity: receive() payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) Receive(opts *bind.TransactOpts) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.RawTransact(opts, nil) // calldata is disallowed for receive function } // Receive is a paid mutator transaction binding the contract receive function. // // Solidity: receive() payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Receive() (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Receive(&_NonfungiblePositionManager.TransactOpts) } // Receive is a paid mutator transaction binding the contract receive function. // // Solidity: receive() payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) Receive() (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Receive(&_NonfungiblePositionManager.TransactOpts) } // NonfungiblePositionManagerApprovalIterator is returned from FilterApproval and is used to iterate over the raw logs and unpacked data for Approval events raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerApprovalIterator struct { Event *NonfungiblePositionManagerApproval // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *NonfungiblePositionManagerApprovalIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerApproval) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerApproval) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *NonfungiblePositionManagerApprovalIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *NonfungiblePositionManagerApprovalIterator) Close() error { it.sub.Unsubscribe() return nil } // NonfungiblePositionManagerApproval represents a Approval event raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerApproval struct { Owner common.Address Approved common.Address TokenId *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterApproval is a free log retrieval operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. // // Solidity: event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) FilterApproval(opts *bind.FilterOpts, owner []common.Address, approved []common.Address, tokenId []*big.Int) (*NonfungiblePositionManagerApprovalIterator, error) { var ownerRule []interface{} for _, ownerItem := range owner { ownerRule = append(ownerRule, ownerItem) } var approvedRule []interface{} for _, approvedItem := range approved { approvedRule = append(approvedRule, approvedItem) } var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _NonfungiblePositionManager.contract.FilterLogs(opts, "Approval", ownerRule, approvedRule, tokenIdRule) if err != nil { return nil, err } return &NonfungiblePositionManagerApprovalIterator{contract: _NonfungiblePositionManager.contract, event: "Approval", logs: logs, sub: sub}, nil } // WatchApproval is a free log subscription operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. // // Solidity: event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) WatchApproval(opts *bind.WatchOpts, sink chan<- *NonfungiblePositionManagerApproval, owner []common.Address, approved []common.Address, tokenId []*big.Int) (event.Subscription, error) { var ownerRule []interface{} for _, ownerItem := range owner { ownerRule = append(ownerRule, ownerItem) } var approvedRule []interface{} for _, approvedItem := range approved { approvedRule = append(approvedRule, approvedItem) } var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _NonfungiblePositionManager.contract.WatchLogs(opts, "Approval", ownerRule, approvedRule, tokenIdRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(NonfungiblePositionManagerApproval) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "Approval", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseApproval is a log parse operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. // // Solidity: event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) ParseApproval(log types.Log) (*NonfungiblePositionManagerApproval, error) { event := new(NonfungiblePositionManagerApproval) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "Approval", log); err != nil { return nil, err } event.Raw = log return event, nil } // NonfungiblePositionManagerApprovalForAllIterator is returned from FilterApprovalForAll and is used to iterate over the raw logs and unpacked data for ApprovalForAll events raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerApprovalForAllIterator struct { Event *NonfungiblePositionManagerApprovalForAll // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *NonfungiblePositionManagerApprovalForAllIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerApprovalForAll) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerApprovalForAll) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *NonfungiblePositionManagerApprovalForAllIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *NonfungiblePositionManagerApprovalForAllIterator) Close() error { it.sub.Unsubscribe() return nil } // NonfungiblePositionManagerApprovalForAll represents a ApprovalForAll event raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerApprovalForAll struct { Owner common.Address Operator common.Address Approved bool Raw types.Log // Blockchain specific contextual infos } // FilterApprovalForAll is a free log retrieval operation binding the contract event 0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31. // // Solidity: event ApprovalForAll(address indexed owner, address indexed operator, bool approved) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) FilterApprovalForAll(opts *bind.FilterOpts, owner []common.Address, operator []common.Address) (*NonfungiblePositionManagerApprovalForAllIterator, error) { var ownerRule []interface{} for _, ownerItem := range owner { ownerRule = append(ownerRule, ownerItem) } var operatorRule []interface{} for _, operatorItem := range operator { operatorRule = append(operatorRule, operatorItem) } logs, sub, err := _NonfungiblePositionManager.contract.FilterLogs(opts, "ApprovalForAll", ownerRule, operatorRule) if err != nil { return nil, err } return &NonfungiblePositionManagerApprovalForAllIterator{contract: _NonfungiblePositionManager.contract, event: "ApprovalForAll", logs: logs, sub: sub}, nil } // WatchApprovalForAll is a free log subscription operation binding the contract event 0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31. // // Solidity: event ApprovalForAll(address indexed owner, address indexed operator, bool approved) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) WatchApprovalForAll(opts *bind.WatchOpts, sink chan<- *NonfungiblePositionManagerApprovalForAll, owner []common.Address, operator []common.Address) (event.Subscription, error) { var ownerRule []interface{} for _, ownerItem := range owner { ownerRule = append(ownerRule, ownerItem) } var operatorRule []interface{} for _, operatorItem := range operator { operatorRule = append(operatorRule, operatorItem) } logs, sub, err := _NonfungiblePositionManager.contract.WatchLogs(opts, "ApprovalForAll", ownerRule, operatorRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(NonfungiblePositionManagerApprovalForAll) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "ApprovalForAll", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseApprovalForAll is a log parse operation binding the contract event 0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31. // // Solidity: event ApprovalForAll(address indexed owner, address indexed operator, bool approved) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) ParseApprovalForAll(log types.Log) (*NonfungiblePositionManagerApprovalForAll, error) { event := new(NonfungiblePositionManagerApprovalForAll) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "ApprovalForAll", log); err != nil { return nil, err } event.Raw = log return event, nil } // NonfungiblePositionManagerCollectIterator is returned from FilterCollect and is used to iterate over the raw logs and unpacked data for Collect events raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerCollectIterator struct { Event *NonfungiblePositionManagerCollect // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *NonfungiblePositionManagerCollectIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerCollect) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerCollect) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *NonfungiblePositionManagerCollectIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *NonfungiblePositionManagerCollectIterator) Close() error { it.sub.Unsubscribe() return nil } // NonfungiblePositionManagerCollect represents a Collect event raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerCollect struct { TokenId *big.Int Recipient common.Address Amount0 *big.Int Amount1 *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterCollect is a free log retrieval operation binding the contract event 0x40d0efd1a53d60ecbf40971b9daf7dc90178c3aadc7aab1765632738fa8b8f01. // // Solidity: event Collect(uint256 indexed tokenId, address recipient, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) FilterCollect(opts *bind.FilterOpts, tokenId []*big.Int) (*NonfungiblePositionManagerCollectIterator, error) { var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _NonfungiblePositionManager.contract.FilterLogs(opts, "Collect", tokenIdRule) if err != nil { return nil, err } return &NonfungiblePositionManagerCollectIterator{contract: _NonfungiblePositionManager.contract, event: "Collect", logs: logs, sub: sub}, nil } // WatchCollect is a free log subscription operation binding the contract event 0x40d0efd1a53d60ecbf40971b9daf7dc90178c3aadc7aab1765632738fa8b8f01. // // Solidity: event Collect(uint256 indexed tokenId, address recipient, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) WatchCollect(opts *bind.WatchOpts, sink chan<- *NonfungiblePositionManagerCollect, tokenId []*big.Int) (event.Subscription, error) { var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _NonfungiblePositionManager.contract.WatchLogs(opts, "Collect", tokenIdRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(NonfungiblePositionManagerCollect) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "Collect", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseCollect is a log parse operation binding the contract event 0x40d0efd1a53d60ecbf40971b9daf7dc90178c3aadc7aab1765632738fa8b8f01. // // Solidity: event Collect(uint256 indexed tokenId, address recipient, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) ParseCollect(log types.Log) (*NonfungiblePositionManagerCollect, error) { event := new(NonfungiblePositionManagerCollect) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "Collect", log); err != nil { return nil, err } event.Raw = log return event, nil } // NonfungiblePositionManagerDecreaseLiquidityIterator is returned from FilterDecreaseLiquidity and is used to iterate over the raw logs and unpacked data for DecreaseLiquidity events raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerDecreaseLiquidityIterator struct { Event *NonfungiblePositionManagerDecreaseLiquidity // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *NonfungiblePositionManagerDecreaseLiquidityIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerDecreaseLiquidity) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerDecreaseLiquidity) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *NonfungiblePositionManagerDecreaseLiquidityIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *NonfungiblePositionManagerDecreaseLiquidityIterator) Close() error { it.sub.Unsubscribe() return nil } // NonfungiblePositionManagerDecreaseLiquidity represents a DecreaseLiquidity event raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerDecreaseLiquidity struct { TokenId *big.Int Liquidity *big.Int Amount0 *big.Int Amount1 *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterDecreaseLiquidity is a free log retrieval operation binding the contract event 0x26f6a048ee9138f2c0ce266f322cb99228e8d619ae2bff30c67f8dcf9d2377b4. // // Solidity: event DecreaseLiquidity(uint256 indexed tokenId, uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) FilterDecreaseLiquidity(opts *bind.FilterOpts, tokenId []*big.Int) (*NonfungiblePositionManagerDecreaseLiquidityIterator, error) { var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _NonfungiblePositionManager.contract.FilterLogs(opts, "DecreaseLiquidity", tokenIdRule) if err != nil { return nil, err } return &NonfungiblePositionManagerDecreaseLiquidityIterator{contract: _NonfungiblePositionManager.contract, event: "DecreaseLiquidity", logs: logs, sub: sub}, nil } // WatchDecreaseLiquidity is a free log subscription operation binding the contract event 0x26f6a048ee9138f2c0ce266f322cb99228e8d619ae2bff30c67f8dcf9d2377b4. // // Solidity: event DecreaseLiquidity(uint256 indexed tokenId, uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) WatchDecreaseLiquidity(opts *bind.WatchOpts, sink chan<- *NonfungiblePositionManagerDecreaseLiquidity, tokenId []*big.Int) (event.Subscription, error) { var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _NonfungiblePositionManager.contract.WatchLogs(opts, "DecreaseLiquidity", tokenIdRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(NonfungiblePositionManagerDecreaseLiquidity) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "DecreaseLiquidity", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseDecreaseLiquidity is a log parse operation binding the contract event 0x26f6a048ee9138f2c0ce266f322cb99228e8d619ae2bff30c67f8dcf9d2377b4. // // Solidity: event DecreaseLiquidity(uint256 indexed tokenId, uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) ParseDecreaseLiquidity(log types.Log) (*NonfungiblePositionManagerDecreaseLiquidity, error) { event := new(NonfungiblePositionManagerDecreaseLiquidity) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "DecreaseLiquidity", log); err != nil { return nil, err } event.Raw = log return event, nil } // NonfungiblePositionManagerIncreaseLiquidityIterator is returned from FilterIncreaseLiquidity and is used to iterate over the raw logs and unpacked data for IncreaseLiquidity events raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerIncreaseLiquidityIterator struct { Event *NonfungiblePositionManagerIncreaseLiquidity // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *NonfungiblePositionManagerIncreaseLiquidityIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerIncreaseLiquidity) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerIncreaseLiquidity) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *NonfungiblePositionManagerIncreaseLiquidityIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *NonfungiblePositionManagerIncreaseLiquidityIterator) Close() error { it.sub.Unsubscribe() return nil } // NonfungiblePositionManagerIncreaseLiquidity represents a IncreaseLiquidity event raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerIncreaseLiquidity struct { TokenId *big.Int Liquidity *big.Int Amount0 *big.Int Amount1 *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterIncreaseLiquidity is a free log retrieval operation binding the contract event 0x3067048beee31b25b2f1681f88dac838c8bba36af25bfb2b7cf7473a5847e35f. // // Solidity: event IncreaseLiquidity(uint256 indexed tokenId, uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) FilterIncreaseLiquidity(opts *bind.FilterOpts, tokenId []*big.Int) (*NonfungiblePositionManagerIncreaseLiquidityIterator, error) { var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _NonfungiblePositionManager.contract.FilterLogs(opts, "IncreaseLiquidity", tokenIdRule) if err != nil { return nil, err } return &NonfungiblePositionManagerIncreaseLiquidityIterator{contract: _NonfungiblePositionManager.contract, event: "IncreaseLiquidity", logs: logs, sub: sub}, nil } // WatchIncreaseLiquidity is a free log subscription operation binding the contract event 0x3067048beee31b25b2f1681f88dac838c8bba36af25bfb2b7cf7473a5847e35f. // // Solidity: event IncreaseLiquidity(uint256 indexed tokenId, uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) WatchIncreaseLiquidity(opts *bind.WatchOpts, sink chan<- *NonfungiblePositionManagerIncreaseLiquidity, tokenId []*big.Int) (event.Subscription, error) { var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _NonfungiblePositionManager.contract.WatchLogs(opts, "IncreaseLiquidity", tokenIdRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(NonfungiblePositionManagerIncreaseLiquidity) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "IncreaseLiquidity", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseIncreaseLiquidity is a log parse operation binding the contract event 0x3067048beee31b25b2f1681f88dac838c8bba36af25bfb2b7cf7473a5847e35f. // // Solidity: event IncreaseLiquidity(uint256 indexed tokenId, uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) ParseIncreaseLiquidity(log types.Log) (*NonfungiblePositionManagerIncreaseLiquidity, error) { event := new(NonfungiblePositionManagerIncreaseLiquidity) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "IncreaseLiquidity", log); err != nil { return nil, err } event.Raw = log return event, nil } // NonfungiblePositionManagerTransferIterator is returned from FilterTransfer and is used to iterate over the raw logs and unpacked data for Transfer events raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerTransferIterator struct { Event *NonfungiblePositionManagerTransfer // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *NonfungiblePositionManagerTransferIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerTransfer) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerTransfer) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *NonfungiblePositionManagerTransferIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *NonfungiblePositionManagerTransferIterator) Close() error { it.sub.Unsubscribe() return nil } // NonfungiblePositionManagerTransfer represents a Transfer event raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerTransfer struct { From common.Address To common.Address TokenId *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterTransfer is a free log retrieval operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. // // Solidity: event Transfer(address indexed from, address indexed to, uint256 indexed tokenId) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) FilterTransfer(opts *bind.FilterOpts, from []common.Address, to []common.Address, tokenId []*big.Int) (*NonfungiblePositionManagerTransferIterator, error) { var fromRule []interface{} for _, fromItem := range from { fromRule = append(fromRule, fromItem) } var toRule []interface{} for _, toItem := range to { toRule = append(toRule, toItem) } var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _NonfungiblePositionManager.contract.FilterLogs(opts, "Transfer", fromRule, toRule, tokenIdRule) if err != nil { return nil, err } return &NonfungiblePositionManagerTransferIterator{contract: _NonfungiblePositionManager.contract, event: "Transfer", logs: logs, sub: sub}, nil } // WatchTransfer is a free log subscription operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. // // Solidity: event Transfer(address indexed from, address indexed to, uint256 indexed tokenId) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) WatchTransfer(opts *bind.WatchOpts, sink chan<- *NonfungiblePositionManagerTransfer, from []common.Address, to []common.Address, tokenId []*big.Int) (event.Subscription, error) { var fromRule []interface{} for _, fromItem := range from { fromRule = append(fromRule, fromItem) } var toRule []interface{} for _, toItem := range to { toRule = append(toRule, toItem) } var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _NonfungiblePositionManager.contract.WatchLogs(opts, "Transfer", fromRule, toRule, tokenIdRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(NonfungiblePositionManagerTransfer) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "Transfer", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseTransfer is a log parse operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. // // Solidity: event Transfer(address indexed from, address indexed to, uint256 indexed tokenId) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) ParseTransfer(log types.Log) (*NonfungiblePositionManagerTransfer, error) { event := new(NonfungiblePositionManagerTransfer) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "Transfer", log); err != nil { return nil, err } event.Raw = log return event, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/binds/ethereumnonfungiblepositionmanager/abi.json ================================================ [ { "inputs": [ { "internalType": "address", "name": "_factory", "type": "address" }, { "internalType": "address", "name": "_WETH9", "type": "address" }, { "internalType": "address", "name": "_tokenDescriptor_", "type": "address" } ], "stateMutability": "nonpayable", "type": "constructor" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "owner", "type": "address" }, { "indexed": true, "internalType": "address", "name": "approved", "type": "address" }, { "indexed": true, "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "Approval", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "owner", "type": "address" }, { "indexed": true, "internalType": "address", "name": "operator", "type": "address" }, { "indexed": false, "internalType": "bool", "name": "approved", "type": "bool" } ], "name": "ApprovalForAll", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "indexed": false, "internalType": "address", "name": "recipient", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "amount0", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "amount1", "type": "uint256" } ], "name": "Collect", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "indexed": false, "internalType": "uint128", "name": "liquidity", "type": "uint128" }, { "indexed": false, "internalType": "uint256", "name": "amount0", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "amount1", "type": "uint256" } ], "name": "DecreaseLiquidity", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "indexed": false, "internalType": "uint128", "name": "liquidity", "type": "uint128" }, { "indexed": false, "internalType": "uint256", "name": "amount0", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "amount1", "type": "uint256" } ], "name": "IncreaseLiquidity", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "from", "type": "address" }, { "indexed": true, "internalType": "address", "name": "to", "type": "address" }, { "indexed": true, "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "Transfer", "type": "event" }, { "inputs": [], "name": "DOMAIN_SEPARATOR", "outputs": [ { "internalType": "bytes32", "name": "", "type": "bytes32" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "PERMIT_TYPEHASH", "outputs": [ { "internalType": "bytes32", "name": "", "type": "bytes32" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "WETH9", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "to", "type": "address" }, { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "approve", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "owner", "type": "address" } ], "name": "balanceOf", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "baseURI", "outputs": [ { "internalType": "string", "name": "", "type": "string" } ], "stateMutability": "pure", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "burn", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "components": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "internalType": "address", "name": "recipient", "type": "address" }, { "internalType": "uint128", "name": "amount0Max", "type": "uint128" }, { "internalType": "uint128", "name": "amount1Max", "type": "uint128" } ], "internalType": "struct INonfungiblePositionManager.CollectParams", "name": "params", "type": "tuple" } ], "name": "collect", "outputs": [ { "internalType": "uint256", "name": "amount0", "type": "uint256" }, { "internalType": "uint256", "name": "amount1", "type": "uint256" } ], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "token0", "type": "address" }, { "internalType": "address", "name": "token1", "type": "address" }, { "internalType": "uint24", "name": "fee", "type": "uint24" }, { "internalType": "uint160", "name": "sqrtPriceX96", "type": "uint160" } ], "name": "createAndInitializePoolIfNecessary", "outputs": [ { "internalType": "address", "name": "pool", "type": "address" } ], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "components": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "internalType": "uint128", "name": "liquidity", "type": "uint128" }, { "internalType": "uint256", "name": "amount0Min", "type": "uint256" }, { "internalType": "uint256", "name": "amount1Min", "type": "uint256" }, { "internalType": "uint256", "name": "deadline", "type": "uint256" } ], "internalType": "struct INonfungiblePositionManager.DecreaseLiquidityParams", "name": "params", "type": "tuple" } ], "name": "decreaseLiquidity", "outputs": [ { "internalType": "uint256", "name": "amount0", "type": "uint256" }, { "internalType": "uint256", "name": "amount1", "type": "uint256" } ], "stateMutability": "payable", "type": "function" }, { "inputs": [], "name": "factory", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "getApproved", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "components": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "internalType": "uint256", "name": "amount0Desired", "type": "uint256" }, { "internalType": "uint256", "name": "amount1Desired", "type": "uint256" }, { "internalType": "uint256", "name": "amount0Min", "type": "uint256" }, { "internalType": "uint256", "name": "amount1Min", "type": "uint256" }, { "internalType": "uint256", "name": "deadline", "type": "uint256" } ], "internalType": "struct INonfungiblePositionManager.IncreaseLiquidityParams", "name": "params", "type": "tuple" } ], "name": "increaseLiquidity", "outputs": [ { "internalType": "uint128", "name": "liquidity", "type": "uint128" }, { "internalType": "uint256", "name": "amount0", "type": "uint256" }, { "internalType": "uint256", "name": "amount1", "type": "uint256" } ], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "owner", "type": "address" }, { "internalType": "address", "name": "operator", "type": "address" } ], "name": "isApprovedForAll", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "components": [ { "internalType": "address", "name": "token0", "type": "address" }, { "internalType": "address", "name": "token1", "type": "address" }, { "internalType": "uint24", "name": "fee", "type": "uint24" }, { "internalType": "int24", "name": "tickLower", "type": "int24" }, { "internalType": "int24", "name": "tickUpper", "type": "int24" }, { "internalType": "uint256", "name": "amount0Desired", "type": "uint256" }, { "internalType": "uint256", "name": "amount1Desired", "type": "uint256" }, { "internalType": "uint256", "name": "amount0Min", "type": "uint256" }, { "internalType": "uint256", "name": "amount1Min", "type": "uint256" }, { "internalType": "address", "name": "recipient", "type": "address" }, { "internalType": "uint256", "name": "deadline", "type": "uint256" } ], "internalType": "struct INonfungiblePositionManager.MintParams", "name": "params", "type": "tuple" } ], "name": "mint", "outputs": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "internalType": "uint128", "name": "liquidity", "type": "uint128" }, { "internalType": "uint256", "name": "amount0", "type": "uint256" }, { "internalType": "uint256", "name": "amount1", "type": "uint256" } ], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "bytes[]", "name": "data", "type": "bytes[]" } ], "name": "multicall", "outputs": [ { "internalType": "bytes[]", "name": "results", "type": "bytes[]" } ], "stateMutability": "payable", "type": "function" }, { "inputs": [], "name": "name", "outputs": [ { "internalType": "string", "name": "", "type": "string" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "ownerOf", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "spender", "type": "address" }, { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "internalType": "uint256", "name": "deadline", "type": "uint256" }, { "internalType": "uint8", "name": "v", "type": "uint8" }, { "internalType": "bytes32", "name": "r", "type": "bytes32" }, { "internalType": "bytes32", "name": "s", "type": "bytes32" } ], "name": "permit", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "positions", "outputs": [ { "internalType": "uint96", "name": "nonce", "type": "uint96" }, { "internalType": "address", "name": "operator", "type": "address" }, { "internalType": "address", "name": "token0", "type": "address" }, { "internalType": "address", "name": "token1", "type": "address" }, { "internalType": "uint24", "name": "fee", "type": "uint24" }, { "internalType": "int24", "name": "tickLower", "type": "int24" }, { "internalType": "int24", "name": "tickUpper", "type": "int24" }, { "internalType": "uint128", "name": "liquidity", "type": "uint128" }, { "internalType": "uint256", "name": "feeGrowthInside0LastX128", "type": "uint256" }, { "internalType": "uint256", "name": "feeGrowthInside1LastX128", "type": "uint256" }, { "internalType": "uint128", "name": "tokensOwed0", "type": "uint128" }, { "internalType": "uint128", "name": "tokensOwed1", "type": "uint128" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "refundETH", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "from", "type": "address" }, { "internalType": "address", "name": "to", "type": "address" }, { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "safeTransferFrom", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "from", "type": "address" }, { "internalType": "address", "name": "to", "type": "address" }, { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "internalType": "bytes", "name": "_data", "type": "bytes" } ], "name": "safeTransferFrom", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "token", "type": "address" }, { "internalType": "uint256", "name": "value", "type": "uint256" }, { "internalType": "uint256", "name": "deadline", "type": "uint256" }, { "internalType": "uint8", "name": "v", "type": "uint8" }, { "internalType": "bytes32", "name": "r", "type": "bytes32" }, { "internalType": "bytes32", "name": "s", "type": "bytes32" } ], "name": "selfPermit", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "token", "type": "address" }, { "internalType": "uint256", "name": "nonce", "type": "uint256" }, { "internalType": "uint256", "name": "expiry", "type": "uint256" }, { "internalType": "uint8", "name": "v", "type": "uint8" }, { "internalType": "bytes32", "name": "r", "type": "bytes32" }, { "internalType": "bytes32", "name": "s", "type": "bytes32" } ], "name": "selfPermitAllowed", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "token", "type": "address" }, { "internalType": "uint256", "name": "nonce", "type": "uint256" }, { "internalType": "uint256", "name": "expiry", "type": "uint256" }, { "internalType": "uint8", "name": "v", "type": "uint8" }, { "internalType": "bytes32", "name": "r", "type": "bytes32" }, { "internalType": "bytes32", "name": "s", "type": "bytes32" } ], "name": "selfPermitAllowedIfNecessary", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "token", "type": "address" }, { "internalType": "uint256", "name": "value", "type": "uint256" }, { "internalType": "uint256", "name": "deadline", "type": "uint256" }, { "internalType": "uint8", "name": "v", "type": "uint8" }, { "internalType": "bytes32", "name": "r", "type": "bytes32" }, { "internalType": "bytes32", "name": "s", "type": "bytes32" } ], "name": "selfPermitIfNecessary", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "operator", "type": "address" }, { "internalType": "bool", "name": "approved", "type": "bool" } ], "name": "setApprovalForAll", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "bytes4", "name": "interfaceId", "type": "bytes4" } ], "name": "supportsInterface", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "token", "type": "address" }, { "internalType": "uint256", "name": "amountMinimum", "type": "uint256" }, { "internalType": "address", "name": "recipient", "type": "address" } ], "name": "sweepToken", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [], "name": "symbol", "outputs": [ { "internalType": "string", "name": "", "type": "string" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "index", "type": "uint256" } ], "name": "tokenByIndex", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "owner", "type": "address" }, { "internalType": "uint256", "name": "index", "type": "uint256" } ], "name": "tokenOfOwnerByIndex", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "tokenURI", "outputs": [ { "internalType": "string", "name": "", "type": "string" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "totalSupply", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "from", "type": "address" }, { "internalType": "address", "name": "to", "type": "address" }, { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "transferFrom", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "amount0Owed", "type": "uint256" }, { "internalType": "uint256", "name": "amount1Owed", "type": "uint256" }, { "internalType": "bytes", "name": "data", "type": "bytes" } ], "name": "uniswapV3MintCallback", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "amountMinimum", "type": "uint256" }, { "internalType": "address", "name": "recipient", "type": "address" } ], "name": "unwrapWETH9", "outputs": [], "stateMutability": "payable", "type": "function" }, { "stateMutability": "payable", "type": "receive" } ] ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/binds/filestore/FileStore.json ================================================ [ { "inputs": [ { "internalType": "address", "name": "_deployer", "type": "address" } ], "stateMutability": "nonpayable", "type": "constructor" }, { "inputs": [], "name": "FileEmpty", "type": "error" }, { "inputs": [ { "internalType": "string", "name": "filename", "type": "string" } ], "name": "FileNotFound", "type": "error" }, { "inputs": [ { "internalType": "string", "name": "filename", "type": "string" } ], "name": "FilenameExists", "type": "error" }, { "inputs": [ { "internalType": "address", "name": "pointer", "type": "address" } ], "name": "InvalidPointer", "type": "error" }, { "inputs": [ { "internalType": "address", "name": "pointer", "type": "address" }, { "internalType": "uint32", "name": "start", "type": "uint32" }, { "internalType": "uint32", "name": "end", "type": "uint32" } ], "name": "SliceEmpty", "type": "error" }, { "inputs": [ { "internalType": "address", "name": "pointer", "type": "address" }, { "internalType": "uint32", "name": "codeSize", "type": "uint32" }, { "internalType": "uint32", "name": "sliceStart", "type": "uint32" }, { "internalType": "uint32", "name": "sliceEnd", "type": "uint32" } ], "name": "SliceOutOfBounds", "type": "error" }, { "inputs": [ { "internalType": "address", "name": "expectedPointer", "type": "address" }, { "internalType": "address", "name": "actualPointer", "type": "address" } ], "name": "UnexpectedPointer", "type": "error" }, { "anonymous": false, "inputs": [], "name": "Deployed", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "string", "name": "indexedFilename", "type": "string" }, { "indexed": true, "internalType": "address", "name": "pointer", "type": "address" }, { "indexed": false, "internalType": "string", "name": "filename", "type": "string" }, { "indexed": false, "internalType": "uint256", "name": "size", "type": "uint256" }, { "indexed": false, "internalType": "bytes", "name": "metadata", "type": "bytes" } ], "name": "FileCreated", "type": "event" }, { "inputs": [ { "internalType": "string", "name": "filename", "type": "string" }, { "internalType": "string", "name": "contents", "type": "string" } ], "name": "createFile", "outputs": [ { "internalType": "address", "name": "pointer", "type": "address" }, { "components": [ { "internalType": "uint256", "name": "size", "type": "uint256" }, { "components": [ { "internalType": "address", "name": "pointer", "type": "address" }, { "internalType": "uint32", "name": "start", "type": "uint32" }, { "internalType": "uint32", "name": "end", "type": "uint32" } ], "internalType": "struct BytecodeSlice[]", "name": "slices", "type": "tuple[]" } ], "internalType": "struct File", "name": "file", "type": "tuple" } ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "string", "name": "filename", "type": "string" }, { "internalType": "string", "name": "contents", "type": "string" }, { "internalType": "bytes", "name": "metadata", "type": "bytes" } ], "name": "createFile", "outputs": [ { "internalType": "address", "name": "pointer", "type": "address" }, { "components": [ { "internalType": "uint256", "name": "size", "type": "uint256" }, { "components": [ { "internalType": "address", "name": "pointer", "type": "address" }, { "internalType": "uint32", "name": "start", "type": "uint32" }, { "internalType": "uint32", "name": "end", "type": "uint32" } ], "internalType": "struct BytecodeSlice[]", "name": "slices", "type": "tuple[]" } ], "internalType": "struct File", "name": "file", "type": "tuple" } ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "string", "name": "filename", "type": "string" }, { "internalType": "string[]", "name": "chunks", "type": "string[]" }, { "internalType": "bytes", "name": "metadata", "type": "bytes" } ], "name": "createFileFromChunks", "outputs": [ { "internalType": "address", "name": "pointer", "type": "address" }, { "components": [ { "internalType": "uint256", "name": "size", "type": "uint256" }, { "components": [ { "internalType": "address", "name": "pointer", "type": "address" }, { "internalType": "uint32", "name": "start", "type": "uint32" }, { "internalType": "uint32", "name": "end", "type": "uint32" } ], "internalType": "struct BytecodeSlice[]", "name": "slices", "type": "tuple[]" } ], "internalType": "struct File", "name": "file", "type": "tuple" } ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "string", "name": "filename", "type": "string" }, { "internalType": "string[]", "name": "chunks", "type": "string[]" } ], "name": "createFileFromChunks", "outputs": [ { "internalType": "address", "name": "pointer", "type": "address" }, { "components": [ { "internalType": "uint256", "name": "size", "type": "uint256" }, { "components": [ { "internalType": "address", "name": "pointer", "type": "address" }, { "internalType": "uint32", "name": "start", "type": "uint32" }, { "internalType": "uint32", "name": "end", "type": "uint32" } ], "internalType": "struct BytecodeSlice[]", "name": "slices", "type": "tuple[]" } ], "internalType": "struct File", "name": "file", "type": "tuple" } ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "string", "name": "filename", "type": "string" }, { "internalType": "address[]", "name": "pointers", "type": "address[]" }, { "internalType": "bytes", "name": "metadata", "type": "bytes" } ], "name": "createFileFromPointers", "outputs": [ { "internalType": "address", "name": "pointer", "type": "address" }, { "components": [ { "internalType": "uint256", "name": "size", "type": "uint256" }, { "components": [ { "internalType": "address", "name": "pointer", "type": "address" }, { "internalType": "uint32", "name": "start", "type": "uint32" }, { "internalType": "uint32", "name": "end", "type": "uint32" } ], "internalType": "struct BytecodeSlice[]", "name": "slices", "type": "tuple[]" } ], "internalType": "struct File", "name": "file", "type": "tuple" } ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "string", "name": "filename", "type": "string" }, { "internalType": "address[]", "name": "pointers", "type": "address[]" } ], "name": "createFileFromPointers", "outputs": [ { "internalType": "address", "name": "pointer", "type": "address" }, { "components": [ { "internalType": "uint256", "name": "size", "type": "uint256" }, { "components": [ { "internalType": "address", "name": "pointer", "type": "address" }, { "internalType": "uint32", "name": "start", "type": "uint32" }, { "internalType": "uint32", "name": "end", "type": "uint32" } ], "internalType": "struct BytecodeSlice[]", "name": "slices", "type": "tuple[]" } ], "internalType": "struct File", "name": "file", "type": "tuple" } ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "string", "name": "filename", "type": "string" }, { "components": [ { "internalType": "address", "name": "pointer", "type": "address" }, { "internalType": "uint32", "name": "start", "type": "uint32" }, { "internalType": "uint32", "name": "end", "type": "uint32" } ], "internalType": "struct BytecodeSlice[]", "name": "slices", "type": "tuple[]" }, { "internalType": "bytes", "name": "metadata", "type": "bytes" } ], "name": "createFileFromSlices", "outputs": [ { "internalType": "address", "name": "pointer", "type": "address" }, { "components": [ { "internalType": "uint256", "name": "size", "type": "uint256" }, { "components": [ { "internalType": "address", "name": "pointer", "type": "address" }, { "internalType": "uint32", "name": "start", "type": "uint32" }, { "internalType": "uint32", "name": "end", "type": "uint32" } ], "internalType": "struct BytecodeSlice[]", "name": "slices", "type": "tuple[]" } ], "internalType": "struct File", "name": "file", "type": "tuple" } ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "string", "name": "filename", "type": "string" }, { "components": [ { "internalType": "address", "name": "pointer", "type": "address" }, { "internalType": "uint32", "name": "start", "type": "uint32" }, { "internalType": "uint32", "name": "end", "type": "uint32" } ], "internalType": "struct BytecodeSlice[]", "name": "slices", "type": "tuple[]" } ], "name": "createFileFromSlices", "outputs": [ { "internalType": "address", "name": "pointer", "type": "address" }, { "components": [ { "internalType": "uint256", "name": "size", "type": "uint256" }, { "components": [ { "internalType": "address", "name": "pointer", "type": "address" }, { "internalType": "uint32", "name": "start", "type": "uint32" }, { "internalType": "uint32", "name": "end", "type": "uint32" } ], "internalType": "struct BytecodeSlice[]", "name": "slices", "type": "tuple[]" } ], "internalType": "struct File", "name": "file", "type": "tuple" } ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "deployer", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "string", "name": "filename", "type": "string" } ], "name": "fileExists", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "string", "name": "filename", "type": "string" } ], "name": "files", "outputs": [ { "internalType": "address", "name": "pointer", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "string", "name": "filename", "type": "string" } ], "name": "getFile", "outputs": [ { "components": [ { "internalType": "uint256", "name": "size", "type": "uint256" }, { "components": [ { "internalType": "address", "name": "pointer", "type": "address" }, { "internalType": "uint32", "name": "start", "type": "uint32" }, { "internalType": "uint32", "name": "end", "type": "uint32" } ], "internalType": "struct BytecodeSlice[]", "name": "slices", "type": "tuple[]" } ], "internalType": "struct File", "name": "file", "type": "tuple" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "string", "name": "filename", "type": "string" } ], "name": "getPointer", "outputs": [ { "internalType": "address", "name": "pointer", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "string", "name": "filename", "type": "string" } ], "name": "readFile", "outputs": [ { "internalType": "string", "name": "contents", "type": "string" } ], "stateMutability": "view", "type": "function" } ] ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/binds/gpumanager/GPUManagerr.go ================================================ // Code generated - DO NOT EDIT. // This file is a generated binding and any manual changes will be lost. package gpumanager import ( "errors" "math/big" "strings" ethereum "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/event" ) // Reference imports to suppress errors if they are not otherwise used. var ( _ = errors.New _ = big.NewInt _ = strings.NewReader _ = ethereum.NotFound _ = bind.Bind _ = common.Big1 _ = types.BloomLookup _ = event.NewSubscription _ = abi.ConvertType ) // IGPUManagerModel is an auto generated low-level Go binding around an user-defined struct. type IGPUManagerModel struct { MinimumFee *big.Int Tier uint32 } // IGPUManagerUnstakeRequest is an auto generated low-level Go binding around an user-defined struct. type IGPUManagerUnstakeRequest struct { Stake *big.Int UnlockAt *big.Int } // GPUManagerMetaData contains all meta data concerning the GPUManager contract. var GPUManagerMetaData = &bind.MetaData{ ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"value\",\"type\":\"address\"}],\"name\":\"AddressSet_DuplicatedValue\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"value\",\"type\":\"address\"}],\"name\":\"AddressSet_ValueNotFound\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"AlreadyRegistered\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FailedTransfer\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FeeTooLow\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidAddress\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidBlockValue\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidMiner\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidModel\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidTier\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidValue\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"MinerInDeactivationTime\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotEnoughMiners\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotRegistered\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"SameModelAddress\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"StakeTooLow\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"StillBeingLocked\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Uint256Set_DuplicatedValue\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Uint256Set_ValueNotFound\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroValue\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldBlocks\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newBlocks\",\"type\":\"uint256\"}],\"name\":\"BlocksPerEpoch\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"oldPercent\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"newPercent\",\"type\":\"uint16\"}],\"name\":\"FinePercentageUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"miner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint32\",\"name\":\"modelId\",\"type\":\"uint32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"treasury\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"fine\",\"type\":\"uint256\"}],\"name\":\"FraudulentMinerPenalized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldValue\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newValue\",\"type\":\"uint256\"}],\"name\":\"MinFeeToUseUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"miner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint32\",\"name\":\"modelId\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint40\",\"name\":\"activeTime\",\"type\":\"uint40\"}],\"name\":\"MinerDeactivated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"miner\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"MinerExtraStake\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"miner\",\"type\":\"address\"}],\"name\":\"MinerJoin\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"miner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint16\",\"name\":\"tier\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"MinerRegistration\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"miner\",\"type\":\"address\"}],\"name\":\"MinerUnregistration\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"miner\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"stake\",\"type\":\"uint256\"}],\"name\":\"MinerUnstake\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint32\",\"name\":\"modelId\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"minimumFee\",\"type\":\"uint256\"}],\"name\":\"ModelMinimumFeeUpdate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint32\",\"name\":\"modelId\",\"type\":\"uint32\"},{\"indexed\":true,\"internalType\":\"uint16\",\"name\":\"tier\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"minimumFee\",\"type\":\"uint256\"}],\"name\":\"ModelRegistration\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint32\",\"name\":\"modelId\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"tier\",\"type\":\"uint32\"}],\"name\":\"ModelTierUpdate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint32\",\"name\":\"modelId\",\"type\":\"uint32\"}],\"name\":\"ModelUnregistration\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"Paused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint40\",\"name\":\"oldDuration\",\"type\":\"uint40\"},{\"indexed\":false,\"internalType\":\"uint40\",\"name\":\"newDuration\",\"type\":\"uint40\"}],\"name\":\"PenaltyDurationUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"miner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint32\",\"name\":\"modelId\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"restake\",\"type\":\"uint256\"}],\"name\":\"Restake\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"worker\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"RewardClaim\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldReward\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newReward\",\"type\":\"uint256\"}],\"name\":\"RewardPerEpoch\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"Unpaused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldDelayTime\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newDelayTime\",\"type\":\"uint256\"}],\"name\":\"UnstakeDelayTime\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"_blocksPerEpoch\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"_currentEpoch\",\"outputs\":[{\"internalType\":\"uint40\",\"name\":\"\",\"type\":\"uint40\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"_finePercentage\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"_lastBlock\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"_maximumTier\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"_minFeeToUse\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"_minerMinimumStake\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"_minerUnstakeRequests\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"stake\",\"type\":\"uint256\"},{\"internalType\":\"uint40\",\"name\":\"unlockAt\",\"type\":\"uint40\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"_miners\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"stake\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"modelId\",\"type\":\"uint32\"},{\"internalType\":\"uint40\",\"name\":\"lastClaimedEpoch\",\"type\":\"uint40\"},{\"internalType\":\"uint40\",\"name\":\"activeTime\",\"type\":\"uint40\"},{\"internalType\":\"uint16\",\"name\":\"tier\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"_modelCollection\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"name\":\"_models\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"minimumFee\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"tier\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"_penaltyDuration\",\"outputs\":[{\"internalType\":\"uint40\",\"name\":\"\",\"type\":\"uint40\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"_promptScheduler\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"_rewardInEpoch\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"perfReward\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"epochReward\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"totalTaskCompleted\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"totalMiner\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"_rewardPerEpoch\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"_treasury\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"_unstakeDelayTime\",\"outputs\":[{\"internalType\":\"uint40\",\"name\":\"\",\"type\":\"uint40\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"_wEAIToken\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"miner\",\"type\":\"address\"}],\"name\":\"claimReward\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"miner\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"modelId\",\"type\":\"uint32\"}],\"name\":\"forceChangeModelForMiner\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAllMinerUnstakeRequests\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"unstakeAddresses\",\"type\":\"address[]\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"stake\",\"type\":\"uint256\"},{\"internalType\":\"uint40\",\"name\":\"unlockAt\",\"type\":\"uint40\"}],\"internalType\":\"structIGPUManager.UnstakeRequest[]\",\"name\":\"unstakeRequests\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"modelId\",\"type\":\"uint32\"}],\"name\":\"getMinFeeToUse\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getMinerAddresses\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"modelId\",\"type\":\"uint32\"}],\"name\":\"getMinerAddressesOfModel\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getModelIds\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"modelId\",\"type\":\"uint32\"}],\"name\":\"getModelInfo\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"minimumFee\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"tier\",\"type\":\"uint32\"}],\"internalType\":\"structIGPUManager.Model\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getNOMiner\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"wEAIAmt\",\"type\":\"uint256\"}],\"name\":\"increaseMinerStake\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"wEAIToken_\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"modelCollection_\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"treasury_\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"minerMinimumStake_\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"blocksPerEpoch_\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"rewardPerEpoch_\",\"type\":\"uint256\"},{\"internalType\":\"uint40\",\"name\":\"unstakeDelayTime_\",\"type\":\"uint40\"},{\"internalType\":\"uint40\",\"name\":\"penaltyDuration_\",\"type\":\"uint40\"},{\"internalType\":\"uint16\",\"name\":\"finePercentage_\",\"type\":\"uint16\"},{\"internalType\":\"uint256\",\"name\":\"minFeeToUse_\",\"type\":\"uint256\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"modelId\",\"type\":\"uint32\"}],\"name\":\"isActiveModel\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"joinForMinting\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"miner\",\"type\":\"address\"}],\"name\":\"multiplier\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"paused\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"tier\",\"type\":\"uint16\"}],\"name\":\"registerMiner\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"tier\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"modelId\",\"type\":\"uint32\"}],\"name\":\"registerMiner\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"modelId\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"tier\",\"type\":\"uint16\"},{\"internalType\":\"uint256\",\"name\":\"minimumFee\",\"type\":\"uint256\"}],\"name\":\"registerModel\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"tier\",\"type\":\"uint16\"}],\"name\":\"restakeForMiner\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"miner\",\"type\":\"address\"}],\"name\":\"rewardToClaim\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"blocks\",\"type\":\"uint256\"}],\"name\":\"setBlocksPerEpoch\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"newPercentage\",\"type\":\"uint16\"}],\"name\":\"setFinePercentage\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"minFee\",\"type\":\"uint256\"}],\"name\":\"setMinFeeToUse\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_minerMinimumStake\",\"type\":\"uint256\"}],\"name\":\"setMinerMinimumStake\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"newReward\",\"type\":\"uint256\"}],\"name\":\"setNewRewardInEpoch\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint40\",\"name\":\"duration\",\"type\":\"uint40\"}],\"name\":\"setPenaltyDuration\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newPromptScheduler\",\"type\":\"address\"}],\"name\":\"setPromptSchedulerAddress\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint40\",\"name\":\"delayTime\",\"type\":\"uint40\"}],\"name\":\"setUnstakeDelayTime\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"wEAIToken\",\"type\":\"address\"}],\"name\":\"setWEAIAddress\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"miner\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"isFined\",\"type\":\"bool\"}],\"name\":\"slashMiner\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"unregisterMiner\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"modelId\",\"type\":\"uint32\"}],\"name\":\"unregisterModel\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"unstakeForMiner\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"updateEpoch\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"modelId\",\"type\":\"uint32\"},{\"internalType\":\"uint256\",\"name\":\"minimumFee\",\"type\":\"uint256\"}],\"name\":\"updateModelMinimumFee\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"modelId\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"tier\",\"type\":\"uint32\"}],\"name\":\"updateModelTier\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"miner\",\"type\":\"address\"}],\"name\":\"validateMiner\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"modelId\",\"type\":\"uint32\"},{\"internalType\":\"uint256\",\"name\":\"minersRequired\",\"type\":\"uint256\"}],\"name\":\"validateModelAndChooseRandomMiner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]", } // GPUManagerABI is the input ABI used to generate the binding from. // Deprecated: Use GPUManagerMetaData.ABI instead. var GPUManagerABI = GPUManagerMetaData.ABI // GPUManager is an auto generated Go binding around an Ethereum contract. type GPUManager struct { GPUManagerCaller // Read-only binding to the contract GPUManagerTransactor // Write-only binding to the contract GPUManagerFilterer // Log filterer for contract events } // GPUManagerCaller is an auto generated read-only Go binding around an Ethereum contract. type GPUManagerCaller struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // GPUManagerTransactor is an auto generated write-only Go binding around an Ethereum contract. type GPUManagerTransactor struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // GPUManagerFilterer is an auto generated log filtering Go binding around an Ethereum contract events. type GPUManagerFilterer struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // GPUManagerSession is an auto generated Go binding around an Ethereum contract, // with pre-set call and transact options. type GPUManagerSession struct { Contract *GPUManager // Generic contract binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // GPUManagerCallerSession is an auto generated read-only Go binding around an Ethereum contract, // with pre-set call options. type GPUManagerCallerSession struct { Contract *GPUManagerCaller // Generic contract caller binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session } // GPUManagerTransactorSession is an auto generated write-only Go binding around an Ethereum contract, // with pre-set transact options. type GPUManagerTransactorSession struct { Contract *GPUManagerTransactor // Generic contract transactor binding to set the session for TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // GPUManagerRaw is an auto generated low-level Go binding around an Ethereum contract. type GPUManagerRaw struct { Contract *GPUManager // Generic contract binding to access the raw methods on } // GPUManagerCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. type GPUManagerCallerRaw struct { Contract *GPUManagerCaller // Generic read-only contract binding to access the raw methods on } // GPUManagerTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. type GPUManagerTransactorRaw struct { Contract *GPUManagerTransactor // Generic write-only contract binding to access the raw methods on } // NewGPUManager creates a new instance of GPUManager, bound to a specific deployed contract. func NewGPUManager(address common.Address, backend bind.ContractBackend) (*GPUManager, error) { contract, err := bindGPUManager(address, backend, backend, backend) if err != nil { return nil, err } return &GPUManager{GPUManagerCaller: GPUManagerCaller{contract: contract}, GPUManagerTransactor: GPUManagerTransactor{contract: contract}, GPUManagerFilterer: GPUManagerFilterer{contract: contract}}, nil } // NewGPUManagerCaller creates a new read-only instance of GPUManager, bound to a specific deployed contract. func NewGPUManagerCaller(address common.Address, caller bind.ContractCaller) (*GPUManagerCaller, error) { contract, err := bindGPUManager(address, caller, nil, nil) if err != nil { return nil, err } return &GPUManagerCaller{contract: contract}, nil } // NewGPUManagerTransactor creates a new write-only instance of GPUManager, bound to a specific deployed contract. func NewGPUManagerTransactor(address common.Address, transactor bind.ContractTransactor) (*GPUManagerTransactor, error) { contract, err := bindGPUManager(address, nil, transactor, nil) if err != nil { return nil, err } return &GPUManagerTransactor{contract: contract}, nil } // NewGPUManagerFilterer creates a new log filterer instance of GPUManager, bound to a specific deployed contract. func NewGPUManagerFilterer(address common.Address, filterer bind.ContractFilterer) (*GPUManagerFilterer, error) { contract, err := bindGPUManager(address, nil, nil, filterer) if err != nil { return nil, err } return &GPUManagerFilterer{contract: contract}, nil } // bindGPUManager binds a generic wrapper to an already deployed contract. func bindGPUManager(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { parsed, err := GPUManagerMetaData.GetAbi() if err != nil { return nil, err } return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_GPUManager *GPUManagerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _GPUManager.Contract.GPUManagerCaller.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_GPUManager *GPUManagerRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _GPUManager.Contract.GPUManagerTransactor.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_GPUManager *GPUManagerRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _GPUManager.Contract.GPUManagerTransactor.contract.Transact(opts, method, params...) } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_GPUManager *GPUManagerCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _GPUManager.Contract.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_GPUManager *GPUManagerTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _GPUManager.Contract.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_GPUManager *GPUManagerTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _GPUManager.Contract.contract.Transact(opts, method, params...) } // BlocksPerEpoch is a free data retrieval call binding the contract method 0xb2424e3f. // // Solidity: function _blocksPerEpoch() view returns(uint256) func (_GPUManager *GPUManagerCaller) BlocksPerEpoch(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} err := _GPUManager.contract.Call(opts, &out, "_blocksPerEpoch") if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // BlocksPerEpoch is a free data retrieval call binding the contract method 0xb2424e3f. // // Solidity: function _blocksPerEpoch() view returns(uint256) func (_GPUManager *GPUManagerSession) BlocksPerEpoch() (*big.Int, error) { return _GPUManager.Contract.BlocksPerEpoch(&_GPUManager.CallOpts) } // BlocksPerEpoch is a free data retrieval call binding the contract method 0xb2424e3f. // // Solidity: function _blocksPerEpoch() view returns(uint256) func (_GPUManager *GPUManagerCallerSession) BlocksPerEpoch() (*big.Int, error) { return _GPUManager.Contract.BlocksPerEpoch(&_GPUManager.CallOpts) } // CurrentEpoch is a free data retrieval call binding the contract method 0x4c98e243. // // Solidity: function _currentEpoch() view returns(uint40) func (_GPUManager *GPUManagerCaller) CurrentEpoch(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} err := _GPUManager.contract.Call(opts, &out, "_currentEpoch") if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // CurrentEpoch is a free data retrieval call binding the contract method 0x4c98e243. // // Solidity: function _currentEpoch() view returns(uint40) func (_GPUManager *GPUManagerSession) CurrentEpoch() (*big.Int, error) { return _GPUManager.Contract.CurrentEpoch(&_GPUManager.CallOpts) } // CurrentEpoch is a free data retrieval call binding the contract method 0x4c98e243. // // Solidity: function _currentEpoch() view returns(uint40) func (_GPUManager *GPUManagerCallerSession) CurrentEpoch() (*big.Int, error) { return _GPUManager.Contract.CurrentEpoch(&_GPUManager.CallOpts) } // FinePercentage is a free data retrieval call binding the contract method 0x92cdf038. // // Solidity: function _finePercentage() view returns(uint16) func (_GPUManager *GPUManagerCaller) FinePercentage(opts *bind.CallOpts) (uint16, error) { var out []interface{} err := _GPUManager.contract.Call(opts, &out, "_finePercentage") if err != nil { return *new(uint16), err } out0 := *abi.ConvertType(out[0], new(uint16)).(*uint16) return out0, err } // FinePercentage is a free data retrieval call binding the contract method 0x92cdf038. // // Solidity: function _finePercentage() view returns(uint16) func (_GPUManager *GPUManagerSession) FinePercentage() (uint16, error) { return _GPUManager.Contract.FinePercentage(&_GPUManager.CallOpts) } // FinePercentage is a free data retrieval call binding the contract method 0x92cdf038. // // Solidity: function _finePercentage() view returns(uint16) func (_GPUManager *GPUManagerCallerSession) FinePercentage() (uint16, error) { return _GPUManager.Contract.FinePercentage(&_GPUManager.CallOpts) } // LastBlock is a free data retrieval call binding the contract method 0xf712b279. // // Solidity: function _lastBlock() view returns(uint256) func (_GPUManager *GPUManagerCaller) LastBlock(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} err := _GPUManager.contract.Call(opts, &out, "_lastBlock") if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // LastBlock is a free data retrieval call binding the contract method 0xf712b279. // // Solidity: function _lastBlock() view returns(uint256) func (_GPUManager *GPUManagerSession) LastBlock() (*big.Int, error) { return _GPUManager.Contract.LastBlock(&_GPUManager.CallOpts) } // LastBlock is a free data retrieval call binding the contract method 0xf712b279. // // Solidity: function _lastBlock() view returns(uint256) func (_GPUManager *GPUManagerCallerSession) LastBlock() (*big.Int, error) { return _GPUManager.Contract.LastBlock(&_GPUManager.CallOpts) } // MaximumTier is a free data retrieval call binding the contract method 0x88f12044. // // Solidity: function _maximumTier() view returns(uint16) func (_GPUManager *GPUManagerCaller) MaximumTier(opts *bind.CallOpts) (uint16, error) { var out []interface{} err := _GPUManager.contract.Call(opts, &out, "_maximumTier") if err != nil { return *new(uint16), err } out0 := *abi.ConvertType(out[0], new(uint16)).(*uint16) return out0, err } // MaximumTier is a free data retrieval call binding the contract method 0x88f12044. // // Solidity: function _maximumTier() view returns(uint16) func (_GPUManager *GPUManagerSession) MaximumTier() (uint16, error) { return _GPUManager.Contract.MaximumTier(&_GPUManager.CallOpts) } // MaximumTier is a free data retrieval call binding the contract method 0x88f12044. // // Solidity: function _maximumTier() view returns(uint16) func (_GPUManager *GPUManagerCallerSession) MaximumTier() (uint16, error) { return _GPUManager.Contract.MaximumTier(&_GPUManager.CallOpts) } // MinFeeToUse is a free data retrieval call binding the contract method 0xf6a74d05. // // Solidity: function _minFeeToUse() view returns(uint256) func (_GPUManager *GPUManagerCaller) MinFeeToUse(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} err := _GPUManager.contract.Call(opts, &out, "_minFeeToUse") if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // MinFeeToUse is a free data retrieval call binding the contract method 0xf6a74d05. // // Solidity: function _minFeeToUse() view returns(uint256) func (_GPUManager *GPUManagerSession) MinFeeToUse() (*big.Int, error) { return _GPUManager.Contract.MinFeeToUse(&_GPUManager.CallOpts) } // MinFeeToUse is a free data retrieval call binding the contract method 0xf6a74d05. // // Solidity: function _minFeeToUse() view returns(uint256) func (_GPUManager *GPUManagerCallerSession) MinFeeToUse() (*big.Int, error) { return _GPUManager.Contract.MinFeeToUse(&_GPUManager.CallOpts) } // MinerMinimumStake is a free data retrieval call binding the contract method 0xc5fc548d. // // Solidity: function _minerMinimumStake() view returns(uint256) func (_GPUManager *GPUManagerCaller) MinerMinimumStake(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} err := _GPUManager.contract.Call(opts, &out, "_minerMinimumStake") if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // MinerMinimumStake is a free data retrieval call binding the contract method 0xc5fc548d. // // Solidity: function _minerMinimumStake() view returns(uint256) func (_GPUManager *GPUManagerSession) MinerMinimumStake() (*big.Int, error) { return _GPUManager.Contract.MinerMinimumStake(&_GPUManager.CallOpts) } // MinerMinimumStake is a free data retrieval call binding the contract method 0xc5fc548d. // // Solidity: function _minerMinimumStake() view returns(uint256) func (_GPUManager *GPUManagerCallerSession) MinerMinimumStake() (*big.Int, error) { return _GPUManager.Contract.MinerMinimumStake(&_GPUManager.CallOpts) } // MinerUnstakeRequests is a free data retrieval call binding the contract method 0x54eb2d2a. // // Solidity: function _minerUnstakeRequests(address ) view returns(uint256 stake, uint40 unlockAt) func (_GPUManager *GPUManagerCaller) MinerUnstakeRequests(opts *bind.CallOpts, arg0 common.Address) (struct { Stake *big.Int UnlockAt *big.Int }, error) { var out []interface{} err := _GPUManager.contract.Call(opts, &out, "_minerUnstakeRequests", arg0) outstruct := new(struct { Stake *big.Int UnlockAt *big.Int }) if err != nil { return *outstruct, err } outstruct.Stake = *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) outstruct.UnlockAt = *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) return *outstruct, err } // MinerUnstakeRequests is a free data retrieval call binding the contract method 0x54eb2d2a. // // Solidity: function _minerUnstakeRequests(address ) view returns(uint256 stake, uint40 unlockAt) func (_GPUManager *GPUManagerSession) MinerUnstakeRequests(arg0 common.Address) (struct { Stake *big.Int UnlockAt *big.Int }, error) { return _GPUManager.Contract.MinerUnstakeRequests(&_GPUManager.CallOpts, arg0) } // MinerUnstakeRequests is a free data retrieval call binding the contract method 0x54eb2d2a. // // Solidity: function _minerUnstakeRequests(address ) view returns(uint256 stake, uint40 unlockAt) func (_GPUManager *GPUManagerCallerSession) MinerUnstakeRequests(arg0 common.Address) (struct { Stake *big.Int UnlockAt *big.Int }, error) { return _GPUManager.Contract.MinerUnstakeRequests(&_GPUManager.CallOpts, arg0) } // Miners is a free data retrieval call binding the contract method 0xb1a976ef. // // Solidity: function _miners(address ) view returns(uint256 stake, uint32 modelId, uint40 lastClaimedEpoch, uint40 activeTime, uint16 tier) func (_GPUManager *GPUManagerCaller) Miners(opts *bind.CallOpts, arg0 common.Address) (struct { Stake *big.Int ModelId uint32 LastClaimedEpoch *big.Int ActiveTime *big.Int Tier uint16 }, error) { var out []interface{} err := _GPUManager.contract.Call(opts, &out, "_miners", arg0) outstruct := new(struct { Stake *big.Int ModelId uint32 LastClaimedEpoch *big.Int ActiveTime *big.Int Tier uint16 }) if err != nil { return *outstruct, err } outstruct.Stake = *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) outstruct.ModelId = *abi.ConvertType(out[1], new(uint32)).(*uint32) outstruct.LastClaimedEpoch = *abi.ConvertType(out[2], new(*big.Int)).(**big.Int) outstruct.ActiveTime = *abi.ConvertType(out[3], new(*big.Int)).(**big.Int) outstruct.Tier = *abi.ConvertType(out[4], new(uint16)).(*uint16) return *outstruct, err } // Miners is a free data retrieval call binding the contract method 0xb1a976ef. // // Solidity: function _miners(address ) view returns(uint256 stake, uint32 modelId, uint40 lastClaimedEpoch, uint40 activeTime, uint16 tier) func (_GPUManager *GPUManagerSession) Miners(arg0 common.Address) (struct { Stake *big.Int ModelId uint32 LastClaimedEpoch *big.Int ActiveTime *big.Int Tier uint16 }, error) { return _GPUManager.Contract.Miners(&_GPUManager.CallOpts, arg0) } // Miners is a free data retrieval call binding the contract method 0xb1a976ef. // // Solidity: function _miners(address ) view returns(uint256 stake, uint32 modelId, uint40 lastClaimedEpoch, uint40 activeTime, uint16 tier) func (_GPUManager *GPUManagerCallerSession) Miners(arg0 common.Address) (struct { Stake *big.Int ModelId uint32 LastClaimedEpoch *big.Int ActiveTime *big.Int Tier uint16 }, error) { return _GPUManager.Contract.Miners(&_GPUManager.CallOpts, arg0) } // ModelCollection is a free data retrieval call binding the contract method 0x1c49c2d6. // // Solidity: function _modelCollection() view returns(address) func (_GPUManager *GPUManagerCaller) ModelCollection(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _GPUManager.contract.Call(opts, &out, "_modelCollection") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // ModelCollection is a free data retrieval call binding the contract method 0x1c49c2d6. // // Solidity: function _modelCollection() view returns(address) func (_GPUManager *GPUManagerSession) ModelCollection() (common.Address, error) { return _GPUManager.Contract.ModelCollection(&_GPUManager.CallOpts) } // ModelCollection is a free data retrieval call binding the contract method 0x1c49c2d6. // // Solidity: function _modelCollection() view returns(address) func (_GPUManager *GPUManagerCallerSession) ModelCollection() (common.Address, error) { return _GPUManager.Contract.ModelCollection(&_GPUManager.CallOpts) } // Models is a free data retrieval call binding the contract method 0x55f89085. // // Solidity: function _models(uint32 ) view returns(uint256 minimumFee, uint32 tier) func (_GPUManager *GPUManagerCaller) Models(opts *bind.CallOpts, arg0 uint32) (struct { MinimumFee *big.Int Tier uint32 }, error) { var out []interface{} err := _GPUManager.contract.Call(opts, &out, "_models", arg0) outstruct := new(struct { MinimumFee *big.Int Tier uint32 }) if err != nil { return *outstruct, err } outstruct.MinimumFee = *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) outstruct.Tier = *abi.ConvertType(out[1], new(uint32)).(*uint32) return *outstruct, err } // Models is a free data retrieval call binding the contract method 0x55f89085. // // Solidity: function _models(uint32 ) view returns(uint256 minimumFee, uint32 tier) func (_GPUManager *GPUManagerSession) Models(arg0 uint32) (struct { MinimumFee *big.Int Tier uint32 }, error) { return _GPUManager.Contract.Models(&_GPUManager.CallOpts, arg0) } // Models is a free data retrieval call binding the contract method 0x55f89085. // // Solidity: function _models(uint32 ) view returns(uint256 minimumFee, uint32 tier) func (_GPUManager *GPUManagerCallerSession) Models(arg0 uint32) (struct { MinimumFee *big.Int Tier uint32 }, error) { return _GPUManager.Contract.Models(&_GPUManager.CallOpts, arg0) } // PenaltyDuration is a free data retrieval call binding the contract method 0xab692134. // // Solidity: function _penaltyDuration() view returns(uint40) func (_GPUManager *GPUManagerCaller) PenaltyDuration(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} err := _GPUManager.contract.Call(opts, &out, "_penaltyDuration") if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // PenaltyDuration is a free data retrieval call binding the contract method 0xab692134. // // Solidity: function _penaltyDuration() view returns(uint40) func (_GPUManager *GPUManagerSession) PenaltyDuration() (*big.Int, error) { return _GPUManager.Contract.PenaltyDuration(&_GPUManager.CallOpts) } // PenaltyDuration is a free data retrieval call binding the contract method 0xab692134. // // Solidity: function _penaltyDuration() view returns(uint40) func (_GPUManager *GPUManagerCallerSession) PenaltyDuration() (*big.Int, error) { return _GPUManager.Contract.PenaltyDuration(&_GPUManager.CallOpts) } // PromptScheduler is a free data retrieval call binding the contract method 0x25abc002. // // Solidity: function _promptScheduler() view returns(address) func (_GPUManager *GPUManagerCaller) PromptScheduler(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _GPUManager.contract.Call(opts, &out, "_promptScheduler") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // PromptScheduler is a free data retrieval call binding the contract method 0x25abc002. // // Solidity: function _promptScheduler() view returns(address) func (_GPUManager *GPUManagerSession) PromptScheduler() (common.Address, error) { return _GPUManager.Contract.PromptScheduler(&_GPUManager.CallOpts) } // PromptScheduler is a free data retrieval call binding the contract method 0x25abc002. // // Solidity: function _promptScheduler() view returns(address) func (_GPUManager *GPUManagerCallerSession) PromptScheduler() (common.Address, error) { return _GPUManager.Contract.PromptScheduler(&_GPUManager.CallOpts) } // RewardInEpoch is a free data retrieval call binding the contract method 0xa662f84d. // // Solidity: function _rewardInEpoch(uint256 ) view returns(uint256 perfReward, uint256 epochReward, uint256 totalTaskCompleted, uint256 totalMiner) func (_GPUManager *GPUManagerCaller) RewardInEpoch(opts *bind.CallOpts, arg0 *big.Int) (struct { PerfReward *big.Int EpochReward *big.Int TotalTaskCompleted *big.Int TotalMiner *big.Int }, error) { var out []interface{} err := _GPUManager.contract.Call(opts, &out, "_rewardInEpoch", arg0) outstruct := new(struct { PerfReward *big.Int EpochReward *big.Int TotalTaskCompleted *big.Int TotalMiner *big.Int }) if err != nil { return *outstruct, err } outstruct.PerfReward = *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) outstruct.EpochReward = *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) outstruct.TotalTaskCompleted = *abi.ConvertType(out[2], new(*big.Int)).(**big.Int) outstruct.TotalMiner = *abi.ConvertType(out[3], new(*big.Int)).(**big.Int) return *outstruct, err } // RewardInEpoch is a free data retrieval call binding the contract method 0xa662f84d. // // Solidity: function _rewardInEpoch(uint256 ) view returns(uint256 perfReward, uint256 epochReward, uint256 totalTaskCompleted, uint256 totalMiner) func (_GPUManager *GPUManagerSession) RewardInEpoch(arg0 *big.Int) (struct { PerfReward *big.Int EpochReward *big.Int TotalTaskCompleted *big.Int TotalMiner *big.Int }, error) { return _GPUManager.Contract.RewardInEpoch(&_GPUManager.CallOpts, arg0) } // RewardInEpoch is a free data retrieval call binding the contract method 0xa662f84d. // // Solidity: function _rewardInEpoch(uint256 ) view returns(uint256 perfReward, uint256 epochReward, uint256 totalTaskCompleted, uint256 totalMiner) func (_GPUManager *GPUManagerCallerSession) RewardInEpoch(arg0 *big.Int) (struct { PerfReward *big.Int EpochReward *big.Int TotalTaskCompleted *big.Int TotalMiner *big.Int }, error) { return _GPUManager.Contract.RewardInEpoch(&_GPUManager.CallOpts, arg0) } // RewardPerEpoch is a free data retrieval call binding the contract method 0x62423112. // // Solidity: function _rewardPerEpoch() view returns(uint256) func (_GPUManager *GPUManagerCaller) RewardPerEpoch(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} err := _GPUManager.contract.Call(opts, &out, "_rewardPerEpoch") if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // RewardPerEpoch is a free data retrieval call binding the contract method 0x62423112. // // Solidity: function _rewardPerEpoch() view returns(uint256) func (_GPUManager *GPUManagerSession) RewardPerEpoch() (*big.Int, error) { return _GPUManager.Contract.RewardPerEpoch(&_GPUManager.CallOpts) } // RewardPerEpoch is a free data retrieval call binding the contract method 0x62423112. // // Solidity: function _rewardPerEpoch() view returns(uint256) func (_GPUManager *GPUManagerCallerSession) RewardPerEpoch() (*big.Int, error) { return _GPUManager.Contract.RewardPerEpoch(&_GPUManager.CallOpts) } // Treasury is a free data retrieval call binding the contract method 0xe319a3d9. // // Solidity: function _treasury() view returns(address) func (_GPUManager *GPUManagerCaller) Treasury(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _GPUManager.contract.Call(opts, &out, "_treasury") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // Treasury is a free data retrieval call binding the contract method 0xe319a3d9. // // Solidity: function _treasury() view returns(address) func (_GPUManager *GPUManagerSession) Treasury() (common.Address, error) { return _GPUManager.Contract.Treasury(&_GPUManager.CallOpts) } // Treasury is a free data retrieval call binding the contract method 0xe319a3d9. // // Solidity: function _treasury() view returns(address) func (_GPUManager *GPUManagerCallerSession) Treasury() (common.Address, error) { return _GPUManager.Contract.Treasury(&_GPUManager.CallOpts) } // UnstakeDelayTime is a free data retrieval call binding the contract method 0x72b1f3e4. // // Solidity: function _unstakeDelayTime() view returns(uint40) func (_GPUManager *GPUManagerCaller) UnstakeDelayTime(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} err := _GPUManager.contract.Call(opts, &out, "_unstakeDelayTime") if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // UnstakeDelayTime is a free data retrieval call binding the contract method 0x72b1f3e4. // // Solidity: function _unstakeDelayTime() view returns(uint40) func (_GPUManager *GPUManagerSession) UnstakeDelayTime() (*big.Int, error) { return _GPUManager.Contract.UnstakeDelayTime(&_GPUManager.CallOpts) } // UnstakeDelayTime is a free data retrieval call binding the contract method 0x72b1f3e4. // // Solidity: function _unstakeDelayTime() view returns(uint40) func (_GPUManager *GPUManagerCallerSession) UnstakeDelayTime() (*big.Int, error) { return _GPUManager.Contract.UnstakeDelayTime(&_GPUManager.CallOpts) } // WEAIToken is a free data retrieval call binding the contract method 0x871c15b1. // // Solidity: function _wEAIToken() view returns(address) func (_GPUManager *GPUManagerCaller) WEAIToken(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _GPUManager.contract.Call(opts, &out, "_wEAIToken") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // WEAIToken is a free data retrieval call binding the contract method 0x871c15b1. // // Solidity: function _wEAIToken() view returns(address) func (_GPUManager *GPUManagerSession) WEAIToken() (common.Address, error) { return _GPUManager.Contract.WEAIToken(&_GPUManager.CallOpts) } // WEAIToken is a free data retrieval call binding the contract method 0x871c15b1. // // Solidity: function _wEAIToken() view returns(address) func (_GPUManager *GPUManagerCallerSession) WEAIToken() (common.Address, error) { return _GPUManager.Contract.WEAIToken(&_GPUManager.CallOpts) } // GetAllMinerUnstakeRequests is a free data retrieval call binding the contract method 0x9280f078. // // Solidity: function getAllMinerUnstakeRequests() view returns(address[] unstakeAddresses, (uint256,uint40)[] unstakeRequests) func (_GPUManager *GPUManagerCaller) GetAllMinerUnstakeRequests(opts *bind.CallOpts) (struct { UnstakeAddresses []common.Address UnstakeRequests []IGPUManagerUnstakeRequest }, error) { var out []interface{} err := _GPUManager.contract.Call(opts, &out, "getAllMinerUnstakeRequests") outstruct := new(struct { UnstakeAddresses []common.Address UnstakeRequests []IGPUManagerUnstakeRequest }) if err != nil { return *outstruct, err } outstruct.UnstakeAddresses = *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) outstruct.UnstakeRequests = *abi.ConvertType(out[1], new([]IGPUManagerUnstakeRequest)).(*[]IGPUManagerUnstakeRequest) return *outstruct, err } // GetAllMinerUnstakeRequests is a free data retrieval call binding the contract method 0x9280f078. // // Solidity: function getAllMinerUnstakeRequests() view returns(address[] unstakeAddresses, (uint256,uint40)[] unstakeRequests) func (_GPUManager *GPUManagerSession) GetAllMinerUnstakeRequests() (struct { UnstakeAddresses []common.Address UnstakeRequests []IGPUManagerUnstakeRequest }, error) { return _GPUManager.Contract.GetAllMinerUnstakeRequests(&_GPUManager.CallOpts) } // GetAllMinerUnstakeRequests is a free data retrieval call binding the contract method 0x9280f078. // // Solidity: function getAllMinerUnstakeRequests() view returns(address[] unstakeAddresses, (uint256,uint40)[] unstakeRequests) func (_GPUManager *GPUManagerCallerSession) GetAllMinerUnstakeRequests() (struct { UnstakeAddresses []common.Address UnstakeRequests []IGPUManagerUnstakeRequest }, error) { return _GPUManager.Contract.GetAllMinerUnstakeRequests(&_GPUManager.CallOpts) } // GetMinFeeToUse is a free data retrieval call binding the contract method 0x963a0278. // // Solidity: function getMinFeeToUse(uint32 modelId) view returns(uint256) func (_GPUManager *GPUManagerCaller) GetMinFeeToUse(opts *bind.CallOpts, modelId uint32) (*big.Int, error) { var out []interface{} err := _GPUManager.contract.Call(opts, &out, "getMinFeeToUse", modelId) if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // GetMinFeeToUse is a free data retrieval call binding the contract method 0x963a0278. // // Solidity: function getMinFeeToUse(uint32 modelId) view returns(uint256) func (_GPUManager *GPUManagerSession) GetMinFeeToUse(modelId uint32) (*big.Int, error) { return _GPUManager.Contract.GetMinFeeToUse(&_GPUManager.CallOpts, modelId) } // GetMinFeeToUse is a free data retrieval call binding the contract method 0x963a0278. // // Solidity: function getMinFeeToUse(uint32 modelId) view returns(uint256) func (_GPUManager *GPUManagerCallerSession) GetMinFeeToUse(modelId uint32) (*big.Int, error) { return _GPUManager.Contract.GetMinFeeToUse(&_GPUManager.CallOpts, modelId) } // GetMinerAddresses is a free data retrieval call binding the contract method 0xe8d6f2f1. // // Solidity: function getMinerAddresses() view returns(address[]) func (_GPUManager *GPUManagerCaller) GetMinerAddresses(opts *bind.CallOpts) ([]common.Address, error) { var out []interface{} err := _GPUManager.contract.Call(opts, &out, "getMinerAddresses") if err != nil { return *new([]common.Address), err } out0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) return out0, err } // GetMinerAddresses is a free data retrieval call binding the contract method 0xe8d6f2f1. // // Solidity: function getMinerAddresses() view returns(address[]) func (_GPUManager *GPUManagerSession) GetMinerAddresses() ([]common.Address, error) { return _GPUManager.Contract.GetMinerAddresses(&_GPUManager.CallOpts) } // GetMinerAddresses is a free data retrieval call binding the contract method 0xe8d6f2f1. // // Solidity: function getMinerAddresses() view returns(address[]) func (_GPUManager *GPUManagerCallerSession) GetMinerAddresses() ([]common.Address, error) { return _GPUManager.Contract.GetMinerAddresses(&_GPUManager.CallOpts) } // GetMinerAddressesOfModel is a free data retrieval call binding the contract method 0xa5f85cc8. // // Solidity: function getMinerAddressesOfModel(uint32 modelId) view returns(address[]) func (_GPUManager *GPUManagerCaller) GetMinerAddressesOfModel(opts *bind.CallOpts, modelId uint32) ([]common.Address, error) { var out []interface{} err := _GPUManager.contract.Call(opts, &out, "getMinerAddressesOfModel", modelId) if err != nil { return *new([]common.Address), err } out0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) return out0, err } // GetMinerAddressesOfModel is a free data retrieval call binding the contract method 0xa5f85cc8. // // Solidity: function getMinerAddressesOfModel(uint32 modelId) view returns(address[]) func (_GPUManager *GPUManagerSession) GetMinerAddressesOfModel(modelId uint32) ([]common.Address, error) { return _GPUManager.Contract.GetMinerAddressesOfModel(&_GPUManager.CallOpts, modelId) } // GetMinerAddressesOfModel is a free data retrieval call binding the contract method 0xa5f85cc8. // // Solidity: function getMinerAddressesOfModel(uint32 modelId) view returns(address[]) func (_GPUManager *GPUManagerCallerSession) GetMinerAddressesOfModel(modelId uint32) ([]common.Address, error) { return _GPUManager.Contract.GetMinerAddressesOfModel(&_GPUManager.CallOpts, modelId) } // GetModelIds is a free data retrieval call binding the contract method 0x84881115. // // Solidity: function getModelIds() view returns(uint256[]) func (_GPUManager *GPUManagerCaller) GetModelIds(opts *bind.CallOpts) ([]*big.Int, error) { var out []interface{} err := _GPUManager.contract.Call(opts, &out, "getModelIds") if err != nil { return *new([]*big.Int), err } out0 := *abi.ConvertType(out[0], new([]*big.Int)).(*[]*big.Int) return out0, err } // GetModelIds is a free data retrieval call binding the contract method 0x84881115. // // Solidity: function getModelIds() view returns(uint256[]) func (_GPUManager *GPUManagerSession) GetModelIds() ([]*big.Int, error) { return _GPUManager.Contract.GetModelIds(&_GPUManager.CallOpts) } // GetModelIds is a free data retrieval call binding the contract method 0x84881115. // // Solidity: function getModelIds() view returns(uint256[]) func (_GPUManager *GPUManagerCallerSession) GetModelIds() ([]*big.Int, error) { return _GPUManager.Contract.GetModelIds(&_GPUManager.CallOpts) } // GetModelInfo is a free data retrieval call binding the contract method 0x77495c20. // // Solidity: function getModelInfo(uint32 modelId) view returns((uint256,uint32)) func (_GPUManager *GPUManagerCaller) GetModelInfo(opts *bind.CallOpts, modelId uint32) (IGPUManagerModel, error) { var out []interface{} err := _GPUManager.contract.Call(opts, &out, "getModelInfo", modelId) if err != nil { return *new(IGPUManagerModel), err } out0 := *abi.ConvertType(out[0], new(IGPUManagerModel)).(*IGPUManagerModel) return out0, err } // GetModelInfo is a free data retrieval call binding the contract method 0x77495c20. // // Solidity: function getModelInfo(uint32 modelId) view returns((uint256,uint32)) func (_GPUManager *GPUManagerSession) GetModelInfo(modelId uint32) (IGPUManagerModel, error) { return _GPUManager.Contract.GetModelInfo(&_GPUManager.CallOpts, modelId) } // GetModelInfo is a free data retrieval call binding the contract method 0x77495c20. // // Solidity: function getModelInfo(uint32 modelId) view returns((uint256,uint32)) func (_GPUManager *GPUManagerCallerSession) GetModelInfo(modelId uint32) (IGPUManagerModel, error) { return _GPUManager.Contract.GetModelInfo(&_GPUManager.CallOpts, modelId) } // GetNOMiner is a free data retrieval call binding the contract method 0xd2d89be8. // // Solidity: function getNOMiner() view returns(uint256) func (_GPUManager *GPUManagerCaller) GetNOMiner(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} err := _GPUManager.contract.Call(opts, &out, "getNOMiner") if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // GetNOMiner is a free data retrieval call binding the contract method 0xd2d89be8. // // Solidity: function getNOMiner() view returns(uint256) func (_GPUManager *GPUManagerSession) GetNOMiner() (*big.Int, error) { return _GPUManager.Contract.GetNOMiner(&_GPUManager.CallOpts) } // GetNOMiner is a free data retrieval call binding the contract method 0xd2d89be8. // // Solidity: function getNOMiner() view returns(uint256) func (_GPUManager *GPUManagerCallerSession) GetNOMiner() (*big.Int, error) { return _GPUManager.Contract.GetNOMiner(&_GPUManager.CallOpts) } // IsActiveModel is a free data retrieval call binding the contract method 0xbce2845a. // // Solidity: function isActiveModel(uint32 modelId) view returns(bool) func (_GPUManager *GPUManagerCaller) IsActiveModel(opts *bind.CallOpts, modelId uint32) (bool, error) { var out []interface{} err := _GPUManager.contract.Call(opts, &out, "isActiveModel", modelId) if err != nil { return *new(bool), err } out0 := *abi.ConvertType(out[0], new(bool)).(*bool) return out0, err } // IsActiveModel is a free data retrieval call binding the contract method 0xbce2845a. // // Solidity: function isActiveModel(uint32 modelId) view returns(bool) func (_GPUManager *GPUManagerSession) IsActiveModel(modelId uint32) (bool, error) { return _GPUManager.Contract.IsActiveModel(&_GPUManager.CallOpts, modelId) } // IsActiveModel is a free data retrieval call binding the contract method 0xbce2845a. // // Solidity: function isActiveModel(uint32 modelId) view returns(bool) func (_GPUManager *GPUManagerCallerSession) IsActiveModel(modelId uint32) (bool, error) { return _GPUManager.Contract.IsActiveModel(&_GPUManager.CallOpts, modelId) } // Multiplier is a free data retrieval call binding the contract method 0xa9b3f8b7. // // Solidity: function multiplier(address miner) view returns(uint256) func (_GPUManager *GPUManagerCaller) Multiplier(opts *bind.CallOpts, miner common.Address) (*big.Int, error) { var out []interface{} err := _GPUManager.contract.Call(opts, &out, "multiplier", miner) if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // Multiplier is a free data retrieval call binding the contract method 0xa9b3f8b7. // // Solidity: function multiplier(address miner) view returns(uint256) func (_GPUManager *GPUManagerSession) Multiplier(miner common.Address) (*big.Int, error) { return _GPUManager.Contract.Multiplier(&_GPUManager.CallOpts, miner) } // Multiplier is a free data retrieval call binding the contract method 0xa9b3f8b7. // // Solidity: function multiplier(address miner) view returns(uint256) func (_GPUManager *GPUManagerCallerSession) Multiplier(miner common.Address) (*big.Int, error) { return _GPUManager.Contract.Multiplier(&_GPUManager.CallOpts, miner) } // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. // // Solidity: function owner() view returns(address) func (_GPUManager *GPUManagerCaller) Owner(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _GPUManager.contract.Call(opts, &out, "owner") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. // // Solidity: function owner() view returns(address) func (_GPUManager *GPUManagerSession) Owner() (common.Address, error) { return _GPUManager.Contract.Owner(&_GPUManager.CallOpts) } // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. // // Solidity: function owner() view returns(address) func (_GPUManager *GPUManagerCallerSession) Owner() (common.Address, error) { return _GPUManager.Contract.Owner(&_GPUManager.CallOpts) } // Paused is a free data retrieval call binding the contract method 0x5c975abb. // // Solidity: function paused() view returns(bool) func (_GPUManager *GPUManagerCaller) Paused(opts *bind.CallOpts) (bool, error) { var out []interface{} err := _GPUManager.contract.Call(opts, &out, "paused") if err != nil { return *new(bool), err } out0 := *abi.ConvertType(out[0], new(bool)).(*bool) return out0, err } // Paused is a free data retrieval call binding the contract method 0x5c975abb. // // Solidity: function paused() view returns(bool) func (_GPUManager *GPUManagerSession) Paused() (bool, error) { return _GPUManager.Contract.Paused(&_GPUManager.CallOpts) } // Paused is a free data retrieval call binding the contract method 0x5c975abb. // // Solidity: function paused() view returns(bool) func (_GPUManager *GPUManagerCallerSession) Paused() (bool, error) { return _GPUManager.Contract.Paused(&_GPUManager.CallOpts) } // ClaimReward is a paid mutator transaction binding the contract method 0xd279c191. // // Solidity: function claimReward(address miner) returns() func (_GPUManager *GPUManagerTransactor) ClaimReward(opts *bind.TransactOpts, miner common.Address) (*types.Transaction, error) { return _GPUManager.contract.Transact(opts, "claimReward", miner) } // ClaimReward is a paid mutator transaction binding the contract method 0xd279c191. // // Solidity: function claimReward(address miner) returns() func (_GPUManager *GPUManagerSession) ClaimReward(miner common.Address) (*types.Transaction, error) { return _GPUManager.Contract.ClaimReward(&_GPUManager.TransactOpts, miner) } // ClaimReward is a paid mutator transaction binding the contract method 0xd279c191. // // Solidity: function claimReward(address miner) returns() func (_GPUManager *GPUManagerTransactorSession) ClaimReward(miner common.Address) (*types.Transaction, error) { return _GPUManager.Contract.ClaimReward(&_GPUManager.TransactOpts, miner) } // ForceChangeModelForMiner is a paid mutator transaction binding the contract method 0x49f5ef62. // // Solidity: function forceChangeModelForMiner(address miner, uint32 modelId) returns() func (_GPUManager *GPUManagerTransactor) ForceChangeModelForMiner(opts *bind.TransactOpts, miner common.Address, modelId uint32) (*types.Transaction, error) { return _GPUManager.contract.Transact(opts, "forceChangeModelForMiner", miner, modelId) } // ForceChangeModelForMiner is a paid mutator transaction binding the contract method 0x49f5ef62. // // Solidity: function forceChangeModelForMiner(address miner, uint32 modelId) returns() func (_GPUManager *GPUManagerSession) ForceChangeModelForMiner(miner common.Address, modelId uint32) (*types.Transaction, error) { return _GPUManager.Contract.ForceChangeModelForMiner(&_GPUManager.TransactOpts, miner, modelId) } // ForceChangeModelForMiner is a paid mutator transaction binding the contract method 0x49f5ef62. // // Solidity: function forceChangeModelForMiner(address miner, uint32 modelId) returns() func (_GPUManager *GPUManagerTransactorSession) ForceChangeModelForMiner(miner common.Address, modelId uint32) (*types.Transaction, error) { return _GPUManager.Contract.ForceChangeModelForMiner(&_GPUManager.TransactOpts, miner, modelId) } // IncreaseMinerStake is a paid mutator transaction binding the contract method 0xb1d1a56b. // // Solidity: function increaseMinerStake(uint256 wEAIAmt) returns() func (_GPUManager *GPUManagerTransactor) IncreaseMinerStake(opts *bind.TransactOpts, wEAIAmt *big.Int) (*types.Transaction, error) { return _GPUManager.contract.Transact(opts, "increaseMinerStake", wEAIAmt) } // IncreaseMinerStake is a paid mutator transaction binding the contract method 0xb1d1a56b. // // Solidity: function increaseMinerStake(uint256 wEAIAmt) returns() func (_GPUManager *GPUManagerSession) IncreaseMinerStake(wEAIAmt *big.Int) (*types.Transaction, error) { return _GPUManager.Contract.IncreaseMinerStake(&_GPUManager.TransactOpts, wEAIAmt) } // IncreaseMinerStake is a paid mutator transaction binding the contract method 0xb1d1a56b. // // Solidity: function increaseMinerStake(uint256 wEAIAmt) returns() func (_GPUManager *GPUManagerTransactorSession) IncreaseMinerStake(wEAIAmt *big.Int) (*types.Transaction, error) { return _GPUManager.Contract.IncreaseMinerStake(&_GPUManager.TransactOpts, wEAIAmt) } // Initialize is a paid mutator transaction binding the contract method 0x04bb771f. // // Solidity: function initialize(address wEAIToken_, address modelCollection_, address treasury_, uint256 minerMinimumStake_, uint256 blocksPerEpoch_, uint256 rewardPerEpoch_, uint40 unstakeDelayTime_, uint40 penaltyDuration_, uint16 finePercentage_, uint256 minFeeToUse_) returns() func (_GPUManager *GPUManagerTransactor) Initialize(opts *bind.TransactOpts, wEAIToken_ common.Address, modelCollection_ common.Address, treasury_ common.Address, minerMinimumStake_ *big.Int, blocksPerEpoch_ *big.Int, rewardPerEpoch_ *big.Int, unstakeDelayTime_ *big.Int, penaltyDuration_ *big.Int, finePercentage_ uint16, minFeeToUse_ *big.Int) (*types.Transaction, error) { return _GPUManager.contract.Transact(opts, "initialize", wEAIToken_, modelCollection_, treasury_, minerMinimumStake_, blocksPerEpoch_, rewardPerEpoch_, unstakeDelayTime_, penaltyDuration_, finePercentage_, minFeeToUse_) } // Initialize is a paid mutator transaction binding the contract method 0x04bb771f. // // Solidity: function initialize(address wEAIToken_, address modelCollection_, address treasury_, uint256 minerMinimumStake_, uint256 blocksPerEpoch_, uint256 rewardPerEpoch_, uint40 unstakeDelayTime_, uint40 penaltyDuration_, uint16 finePercentage_, uint256 minFeeToUse_) returns() func (_GPUManager *GPUManagerSession) Initialize(wEAIToken_ common.Address, modelCollection_ common.Address, treasury_ common.Address, minerMinimumStake_ *big.Int, blocksPerEpoch_ *big.Int, rewardPerEpoch_ *big.Int, unstakeDelayTime_ *big.Int, penaltyDuration_ *big.Int, finePercentage_ uint16, minFeeToUse_ *big.Int) (*types.Transaction, error) { return _GPUManager.Contract.Initialize(&_GPUManager.TransactOpts, wEAIToken_, modelCollection_, treasury_, minerMinimumStake_, blocksPerEpoch_, rewardPerEpoch_, unstakeDelayTime_, penaltyDuration_, finePercentage_, minFeeToUse_) } // Initialize is a paid mutator transaction binding the contract method 0x04bb771f. // // Solidity: function initialize(address wEAIToken_, address modelCollection_, address treasury_, uint256 minerMinimumStake_, uint256 blocksPerEpoch_, uint256 rewardPerEpoch_, uint40 unstakeDelayTime_, uint40 penaltyDuration_, uint16 finePercentage_, uint256 minFeeToUse_) returns() func (_GPUManager *GPUManagerTransactorSession) Initialize(wEAIToken_ common.Address, modelCollection_ common.Address, treasury_ common.Address, minerMinimumStake_ *big.Int, blocksPerEpoch_ *big.Int, rewardPerEpoch_ *big.Int, unstakeDelayTime_ *big.Int, penaltyDuration_ *big.Int, finePercentage_ uint16, minFeeToUse_ *big.Int) (*types.Transaction, error) { return _GPUManager.Contract.Initialize(&_GPUManager.TransactOpts, wEAIToken_, modelCollection_, treasury_, minerMinimumStake_, blocksPerEpoch_, rewardPerEpoch_, unstakeDelayTime_, penaltyDuration_, finePercentage_, minFeeToUse_) } // JoinForMinting is a paid mutator transaction binding the contract method 0x1a8ef584. // // Solidity: function joinForMinting() returns() func (_GPUManager *GPUManagerTransactor) JoinForMinting(opts *bind.TransactOpts) (*types.Transaction, error) { return _GPUManager.contract.Transact(opts, "joinForMinting") } // JoinForMinting is a paid mutator transaction binding the contract method 0x1a8ef584. // // Solidity: function joinForMinting() returns() func (_GPUManager *GPUManagerSession) JoinForMinting() (*types.Transaction, error) { return _GPUManager.Contract.JoinForMinting(&_GPUManager.TransactOpts) } // JoinForMinting is a paid mutator transaction binding the contract method 0x1a8ef584. // // Solidity: function joinForMinting() returns() func (_GPUManager *GPUManagerTransactorSession) JoinForMinting() (*types.Transaction, error) { return _GPUManager.Contract.JoinForMinting(&_GPUManager.TransactOpts) } // RegisterMiner is a paid mutator transaction binding the contract method 0x1fdadcb7. // // Solidity: function registerMiner(uint16 tier) returns() func (_GPUManager *GPUManagerTransactor) RegisterMiner(opts *bind.TransactOpts, tier uint16) (*types.Transaction, error) { return _GPUManager.contract.Transact(opts, "registerMiner", tier) } // RegisterMiner is a paid mutator transaction binding the contract method 0x1fdadcb7. // // Solidity: function registerMiner(uint16 tier) returns() func (_GPUManager *GPUManagerSession) RegisterMiner(tier uint16) (*types.Transaction, error) { return _GPUManager.Contract.RegisterMiner(&_GPUManager.TransactOpts, tier) } // RegisterMiner is a paid mutator transaction binding the contract method 0x1fdadcb7. // // Solidity: function registerMiner(uint16 tier) returns() func (_GPUManager *GPUManagerTransactorSession) RegisterMiner(tier uint16) (*types.Transaction, error) { return _GPUManager.Contract.RegisterMiner(&_GPUManager.TransactOpts, tier) } // RegisterMiner0 is a paid mutator transaction binding the contract method 0x70423c2a. // // Solidity: function registerMiner(uint16 tier, uint32 modelId) returns() func (_GPUManager *GPUManagerTransactor) RegisterMiner0(opts *bind.TransactOpts, tier uint16, modelId uint32) (*types.Transaction, error) { return _GPUManager.contract.Transact(opts, "registerMiner0", tier, modelId) } // RegisterMiner0 is a paid mutator transaction binding the contract method 0x70423c2a. // // Solidity: function registerMiner(uint16 tier, uint32 modelId) returns() func (_GPUManager *GPUManagerSession) RegisterMiner0(tier uint16, modelId uint32) (*types.Transaction, error) { return _GPUManager.Contract.RegisterMiner0(&_GPUManager.TransactOpts, tier, modelId) } // RegisterMiner0 is a paid mutator transaction binding the contract method 0x70423c2a. // // Solidity: function registerMiner(uint16 tier, uint32 modelId) returns() func (_GPUManager *GPUManagerTransactorSession) RegisterMiner0(tier uint16, modelId uint32) (*types.Transaction, error) { return _GPUManager.Contract.RegisterMiner0(&_GPUManager.TransactOpts, tier, modelId) } // RegisterModel is a paid mutator transaction binding the contract method 0x88184775. // // Solidity: function registerModel(uint32 modelId, uint16 tier, uint256 minimumFee) returns() func (_GPUManager *GPUManagerTransactor) RegisterModel(opts *bind.TransactOpts, modelId uint32, tier uint16, minimumFee *big.Int) (*types.Transaction, error) { return _GPUManager.contract.Transact(opts, "registerModel", modelId, tier, minimumFee) } // RegisterModel is a paid mutator transaction binding the contract method 0x88184775. // // Solidity: function registerModel(uint32 modelId, uint16 tier, uint256 minimumFee) returns() func (_GPUManager *GPUManagerSession) RegisterModel(modelId uint32, tier uint16, minimumFee *big.Int) (*types.Transaction, error) { return _GPUManager.Contract.RegisterModel(&_GPUManager.TransactOpts, modelId, tier, minimumFee) } // RegisterModel is a paid mutator transaction binding the contract method 0x88184775. // // Solidity: function registerModel(uint32 modelId, uint16 tier, uint256 minimumFee) returns() func (_GPUManager *GPUManagerTransactorSession) RegisterModel(modelId uint32, tier uint16, minimumFee *big.Int) (*types.Transaction, error) { return _GPUManager.Contract.RegisterModel(&_GPUManager.TransactOpts, modelId, tier, minimumFee) } // RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. // // Solidity: function renounceOwnership() returns() func (_GPUManager *GPUManagerTransactor) RenounceOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { return _GPUManager.contract.Transact(opts, "renounceOwnership") } // RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. // // Solidity: function renounceOwnership() returns() func (_GPUManager *GPUManagerSession) RenounceOwnership() (*types.Transaction, error) { return _GPUManager.Contract.RenounceOwnership(&_GPUManager.TransactOpts) } // RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. // // Solidity: function renounceOwnership() returns() func (_GPUManager *GPUManagerTransactorSession) RenounceOwnership() (*types.Transaction, error) { return _GPUManager.Contract.RenounceOwnership(&_GPUManager.TransactOpts) } // RestakeForMiner is a paid mutator transaction binding the contract method 0x4fb9bc1e. // // Solidity: function restakeForMiner(uint16 tier) returns() func (_GPUManager *GPUManagerTransactor) RestakeForMiner(opts *bind.TransactOpts, tier uint16) (*types.Transaction, error) { return _GPUManager.contract.Transact(opts, "restakeForMiner", tier) } // RestakeForMiner is a paid mutator transaction binding the contract method 0x4fb9bc1e. // // Solidity: function restakeForMiner(uint16 tier) returns() func (_GPUManager *GPUManagerSession) RestakeForMiner(tier uint16) (*types.Transaction, error) { return _GPUManager.Contract.RestakeForMiner(&_GPUManager.TransactOpts, tier) } // RestakeForMiner is a paid mutator transaction binding the contract method 0x4fb9bc1e. // // Solidity: function restakeForMiner(uint16 tier) returns() func (_GPUManager *GPUManagerTransactorSession) RestakeForMiner(tier uint16) (*types.Transaction, error) { return _GPUManager.Contract.RestakeForMiner(&_GPUManager.TransactOpts, tier) } // RewardToClaim is a paid mutator transaction binding the contract method 0x674a63b9. // // Solidity: function rewardToClaim(address miner) returns(uint256) func (_GPUManager *GPUManagerTransactor) RewardToClaim(opts *bind.TransactOpts, miner common.Address) (*types.Transaction, error) { return _GPUManager.contract.Transact(opts, "rewardToClaim", miner) } // RewardToClaim is a paid mutator transaction binding the contract method 0x674a63b9. // // Solidity: function rewardToClaim(address miner) returns(uint256) func (_GPUManager *GPUManagerSession) RewardToClaim(miner common.Address) (*types.Transaction, error) { return _GPUManager.Contract.RewardToClaim(&_GPUManager.TransactOpts, miner) } // RewardToClaim is a paid mutator transaction binding the contract method 0x674a63b9. // // Solidity: function rewardToClaim(address miner) returns(uint256) func (_GPUManager *GPUManagerTransactorSession) RewardToClaim(miner common.Address) (*types.Transaction, error) { return _GPUManager.Contract.RewardToClaim(&_GPUManager.TransactOpts, miner) } // SetBlocksPerEpoch is a paid mutator transaction binding the contract method 0x034438b0. // // Solidity: function setBlocksPerEpoch(uint256 blocks) returns() func (_GPUManager *GPUManagerTransactor) SetBlocksPerEpoch(opts *bind.TransactOpts, blocks *big.Int) (*types.Transaction, error) { return _GPUManager.contract.Transact(opts, "setBlocksPerEpoch", blocks) } // SetBlocksPerEpoch is a paid mutator transaction binding the contract method 0x034438b0. // // Solidity: function setBlocksPerEpoch(uint256 blocks) returns() func (_GPUManager *GPUManagerSession) SetBlocksPerEpoch(blocks *big.Int) (*types.Transaction, error) { return _GPUManager.Contract.SetBlocksPerEpoch(&_GPUManager.TransactOpts, blocks) } // SetBlocksPerEpoch is a paid mutator transaction binding the contract method 0x034438b0. // // Solidity: function setBlocksPerEpoch(uint256 blocks) returns() func (_GPUManager *GPUManagerTransactorSession) SetBlocksPerEpoch(blocks *big.Int) (*types.Transaction, error) { return _GPUManager.Contract.SetBlocksPerEpoch(&_GPUManager.TransactOpts, blocks) } // SetFinePercentage is a paid mutator transaction binding the contract method 0x431a4457. // // Solidity: function setFinePercentage(uint16 newPercentage) returns() func (_GPUManager *GPUManagerTransactor) SetFinePercentage(opts *bind.TransactOpts, newPercentage uint16) (*types.Transaction, error) { return _GPUManager.contract.Transact(opts, "setFinePercentage", newPercentage) } // SetFinePercentage is a paid mutator transaction binding the contract method 0x431a4457. // // Solidity: function setFinePercentage(uint16 newPercentage) returns() func (_GPUManager *GPUManagerSession) SetFinePercentage(newPercentage uint16) (*types.Transaction, error) { return _GPUManager.Contract.SetFinePercentage(&_GPUManager.TransactOpts, newPercentage) } // SetFinePercentage is a paid mutator transaction binding the contract method 0x431a4457. // // Solidity: function setFinePercentage(uint16 newPercentage) returns() func (_GPUManager *GPUManagerTransactorSession) SetFinePercentage(newPercentage uint16) (*types.Transaction, error) { return _GPUManager.Contract.SetFinePercentage(&_GPUManager.TransactOpts, newPercentage) } // SetMinFeeToUse is a paid mutator transaction binding the contract method 0xaf5e3be0. // // Solidity: function setMinFeeToUse(uint256 minFee) returns() func (_GPUManager *GPUManagerTransactor) SetMinFeeToUse(opts *bind.TransactOpts, minFee *big.Int) (*types.Transaction, error) { return _GPUManager.contract.Transact(opts, "setMinFeeToUse", minFee) } // SetMinFeeToUse is a paid mutator transaction binding the contract method 0xaf5e3be0. // // Solidity: function setMinFeeToUse(uint256 minFee) returns() func (_GPUManager *GPUManagerSession) SetMinFeeToUse(minFee *big.Int) (*types.Transaction, error) { return _GPUManager.Contract.SetMinFeeToUse(&_GPUManager.TransactOpts, minFee) } // SetMinFeeToUse is a paid mutator transaction binding the contract method 0xaf5e3be0. // // Solidity: function setMinFeeToUse(uint256 minFee) returns() func (_GPUManager *GPUManagerTransactorSession) SetMinFeeToUse(minFee *big.Int) (*types.Transaction, error) { return _GPUManager.Contract.SetMinFeeToUse(&_GPUManager.TransactOpts, minFee) } // SetMinerMinimumStake is a paid mutator transaction binding the contract method 0xe69d5b98. // // Solidity: function setMinerMinimumStake(uint256 _minerMinimumStake) returns() func (_GPUManager *GPUManagerTransactor) SetMinerMinimumStake(opts *bind.TransactOpts, _minerMinimumStake *big.Int) (*types.Transaction, error) { return _GPUManager.contract.Transact(opts, "setMinerMinimumStake", _minerMinimumStake) } // SetMinerMinimumStake is a paid mutator transaction binding the contract method 0xe69d5b98. // // Solidity: function setMinerMinimumStake(uint256 _minerMinimumStake) returns() func (_GPUManager *GPUManagerSession) SetMinerMinimumStake(_minerMinimumStake *big.Int) (*types.Transaction, error) { return _GPUManager.Contract.SetMinerMinimumStake(&_GPUManager.TransactOpts, _minerMinimumStake) } // SetMinerMinimumStake is a paid mutator transaction binding the contract method 0xe69d5b98. // // Solidity: function setMinerMinimumStake(uint256 _minerMinimumStake) returns() func (_GPUManager *GPUManagerTransactorSession) SetMinerMinimumStake(_minerMinimumStake *big.Int) (*types.Transaction, error) { return _GPUManager.Contract.SetMinerMinimumStake(&_GPUManager.TransactOpts, _minerMinimumStake) } // SetNewRewardInEpoch is a paid mutator transaction binding the contract method 0xe32bd90c. // // Solidity: function setNewRewardInEpoch(uint256 newReward) returns() func (_GPUManager *GPUManagerTransactor) SetNewRewardInEpoch(opts *bind.TransactOpts, newReward *big.Int) (*types.Transaction, error) { return _GPUManager.contract.Transact(opts, "setNewRewardInEpoch", newReward) } // SetNewRewardInEpoch is a paid mutator transaction binding the contract method 0xe32bd90c. // // Solidity: function setNewRewardInEpoch(uint256 newReward) returns() func (_GPUManager *GPUManagerSession) SetNewRewardInEpoch(newReward *big.Int) (*types.Transaction, error) { return _GPUManager.Contract.SetNewRewardInEpoch(&_GPUManager.TransactOpts, newReward) } // SetNewRewardInEpoch is a paid mutator transaction binding the contract method 0xe32bd90c. // // Solidity: function setNewRewardInEpoch(uint256 newReward) returns() func (_GPUManager *GPUManagerTransactorSession) SetNewRewardInEpoch(newReward *big.Int) (*types.Transaction, error) { return _GPUManager.Contract.SetNewRewardInEpoch(&_GPUManager.TransactOpts, newReward) } // SetPenaltyDuration is a paid mutator transaction binding the contract method 0x885b050f. // // Solidity: function setPenaltyDuration(uint40 duration) returns() func (_GPUManager *GPUManagerTransactor) SetPenaltyDuration(opts *bind.TransactOpts, duration *big.Int) (*types.Transaction, error) { return _GPUManager.contract.Transact(opts, "setPenaltyDuration", duration) } // SetPenaltyDuration is a paid mutator transaction binding the contract method 0x885b050f. // // Solidity: function setPenaltyDuration(uint40 duration) returns() func (_GPUManager *GPUManagerSession) SetPenaltyDuration(duration *big.Int) (*types.Transaction, error) { return _GPUManager.Contract.SetPenaltyDuration(&_GPUManager.TransactOpts, duration) } // SetPenaltyDuration is a paid mutator transaction binding the contract method 0x885b050f. // // Solidity: function setPenaltyDuration(uint40 duration) returns() func (_GPUManager *GPUManagerTransactorSession) SetPenaltyDuration(duration *big.Int) (*types.Transaction, error) { return _GPUManager.Contract.SetPenaltyDuration(&_GPUManager.TransactOpts, duration) } // SetPromptSchedulerAddress is a paid mutator transaction binding the contract method 0x00f19f45. // // Solidity: function setPromptSchedulerAddress(address newPromptScheduler) returns() func (_GPUManager *GPUManagerTransactor) SetPromptSchedulerAddress(opts *bind.TransactOpts, newPromptScheduler common.Address) (*types.Transaction, error) { return _GPUManager.contract.Transact(opts, "setPromptSchedulerAddress", newPromptScheduler) } // SetPromptSchedulerAddress is a paid mutator transaction binding the contract method 0x00f19f45. // // Solidity: function setPromptSchedulerAddress(address newPromptScheduler) returns() func (_GPUManager *GPUManagerSession) SetPromptSchedulerAddress(newPromptScheduler common.Address) (*types.Transaction, error) { return _GPUManager.Contract.SetPromptSchedulerAddress(&_GPUManager.TransactOpts, newPromptScheduler) } // SetPromptSchedulerAddress is a paid mutator transaction binding the contract method 0x00f19f45. // // Solidity: function setPromptSchedulerAddress(address newPromptScheduler) returns() func (_GPUManager *GPUManagerTransactorSession) SetPromptSchedulerAddress(newPromptScheduler common.Address) (*types.Transaction, error) { return _GPUManager.Contract.SetPromptSchedulerAddress(&_GPUManager.TransactOpts, newPromptScheduler) } // SetUnstakeDelayTime is a paid mutator transaction binding the contract method 0x466ca9f9. // // Solidity: function setUnstakeDelayTime(uint40 delayTime) returns() func (_GPUManager *GPUManagerTransactor) SetUnstakeDelayTime(opts *bind.TransactOpts, delayTime *big.Int) (*types.Transaction, error) { return _GPUManager.contract.Transact(opts, "setUnstakeDelayTime", delayTime) } // SetUnstakeDelayTime is a paid mutator transaction binding the contract method 0x466ca9f9. // // Solidity: function setUnstakeDelayTime(uint40 delayTime) returns() func (_GPUManager *GPUManagerSession) SetUnstakeDelayTime(delayTime *big.Int) (*types.Transaction, error) { return _GPUManager.Contract.SetUnstakeDelayTime(&_GPUManager.TransactOpts, delayTime) } // SetUnstakeDelayTime is a paid mutator transaction binding the contract method 0x466ca9f9. // // Solidity: function setUnstakeDelayTime(uint40 delayTime) returns() func (_GPUManager *GPUManagerTransactorSession) SetUnstakeDelayTime(delayTime *big.Int) (*types.Transaction, error) { return _GPUManager.Contract.SetUnstakeDelayTime(&_GPUManager.TransactOpts, delayTime) } // SetWEAIAddress is a paid mutator transaction binding the contract method 0x7362323c. // // Solidity: function setWEAIAddress(address wEAIToken) returns() func (_GPUManager *GPUManagerTransactor) SetWEAIAddress(opts *bind.TransactOpts, wEAIToken common.Address) (*types.Transaction, error) { return _GPUManager.contract.Transact(opts, "setWEAIAddress", wEAIToken) } // SetWEAIAddress is a paid mutator transaction binding the contract method 0x7362323c. // // Solidity: function setWEAIAddress(address wEAIToken) returns() func (_GPUManager *GPUManagerSession) SetWEAIAddress(wEAIToken common.Address) (*types.Transaction, error) { return _GPUManager.Contract.SetWEAIAddress(&_GPUManager.TransactOpts, wEAIToken) } // SetWEAIAddress is a paid mutator transaction binding the contract method 0x7362323c. // // Solidity: function setWEAIAddress(address wEAIToken) returns() func (_GPUManager *GPUManagerTransactorSession) SetWEAIAddress(wEAIToken common.Address) (*types.Transaction, error) { return _GPUManager.Contract.SetWEAIAddress(&_GPUManager.TransactOpts, wEAIToken) } // SlashMiner is a paid mutator transaction binding the contract method 0x969ceab4. // // Solidity: function slashMiner(address miner, bool isFined) returns() func (_GPUManager *GPUManagerTransactor) SlashMiner(opts *bind.TransactOpts, miner common.Address, isFined bool) (*types.Transaction, error) { return _GPUManager.contract.Transact(opts, "slashMiner", miner, isFined) } // SlashMiner is a paid mutator transaction binding the contract method 0x969ceab4. // // Solidity: function slashMiner(address miner, bool isFined) returns() func (_GPUManager *GPUManagerSession) SlashMiner(miner common.Address, isFined bool) (*types.Transaction, error) { return _GPUManager.Contract.SlashMiner(&_GPUManager.TransactOpts, miner, isFined) } // SlashMiner is a paid mutator transaction binding the contract method 0x969ceab4. // // Solidity: function slashMiner(address miner, bool isFined) returns() func (_GPUManager *GPUManagerTransactorSession) SlashMiner(miner common.Address, isFined bool) (*types.Transaction, error) { return _GPUManager.Contract.SlashMiner(&_GPUManager.TransactOpts, miner, isFined) } // TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. // // Solidity: function transferOwnership(address newOwner) returns() func (_GPUManager *GPUManagerTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) { return _GPUManager.contract.Transact(opts, "transferOwnership", newOwner) } // TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. // // Solidity: function transferOwnership(address newOwner) returns() func (_GPUManager *GPUManagerSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { return _GPUManager.Contract.TransferOwnership(&_GPUManager.TransactOpts, newOwner) } // TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. // // Solidity: function transferOwnership(address newOwner) returns() func (_GPUManager *GPUManagerTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { return _GPUManager.Contract.TransferOwnership(&_GPUManager.TransactOpts, newOwner) } // UnregisterMiner is a paid mutator transaction binding the contract method 0x656a1b20. // // Solidity: function unregisterMiner() returns() func (_GPUManager *GPUManagerTransactor) UnregisterMiner(opts *bind.TransactOpts) (*types.Transaction, error) { return _GPUManager.contract.Transact(opts, "unregisterMiner") } // UnregisterMiner is a paid mutator transaction binding the contract method 0x656a1b20. // // Solidity: function unregisterMiner() returns() func (_GPUManager *GPUManagerSession) UnregisterMiner() (*types.Transaction, error) { return _GPUManager.Contract.UnregisterMiner(&_GPUManager.TransactOpts) } // UnregisterMiner is a paid mutator transaction binding the contract method 0x656a1b20. // // Solidity: function unregisterMiner() returns() func (_GPUManager *GPUManagerTransactorSession) UnregisterMiner() (*types.Transaction, error) { return _GPUManager.Contract.UnregisterMiner(&_GPUManager.TransactOpts) } // UnregisterModel is a paid mutator transaction binding the contract method 0x781f1453. // // Solidity: function unregisterModel(uint32 modelId) returns() func (_GPUManager *GPUManagerTransactor) UnregisterModel(opts *bind.TransactOpts, modelId uint32) (*types.Transaction, error) { return _GPUManager.contract.Transact(opts, "unregisterModel", modelId) } // UnregisterModel is a paid mutator transaction binding the contract method 0x781f1453. // // Solidity: function unregisterModel(uint32 modelId) returns() func (_GPUManager *GPUManagerSession) UnregisterModel(modelId uint32) (*types.Transaction, error) { return _GPUManager.Contract.UnregisterModel(&_GPUManager.TransactOpts, modelId) } // UnregisterModel is a paid mutator transaction binding the contract method 0x781f1453. // // Solidity: function unregisterModel(uint32 modelId) returns() func (_GPUManager *GPUManagerTransactorSession) UnregisterModel(modelId uint32) (*types.Transaction, error) { return _GPUManager.Contract.UnregisterModel(&_GPUManager.TransactOpts, modelId) } // UnstakeForMiner is a paid mutator transaction binding the contract method 0x73df250d. // // Solidity: function unstakeForMiner() returns() func (_GPUManager *GPUManagerTransactor) UnstakeForMiner(opts *bind.TransactOpts) (*types.Transaction, error) { return _GPUManager.contract.Transact(opts, "unstakeForMiner") } // UnstakeForMiner is a paid mutator transaction binding the contract method 0x73df250d. // // Solidity: function unstakeForMiner() returns() func (_GPUManager *GPUManagerSession) UnstakeForMiner() (*types.Transaction, error) { return _GPUManager.Contract.UnstakeForMiner(&_GPUManager.TransactOpts) } // UnstakeForMiner is a paid mutator transaction binding the contract method 0x73df250d. // // Solidity: function unstakeForMiner() returns() func (_GPUManager *GPUManagerTransactorSession) UnstakeForMiner() (*types.Transaction, error) { return _GPUManager.Contract.UnstakeForMiner(&_GPUManager.TransactOpts) } // UpdateEpoch is a paid mutator transaction binding the contract method 0x36f4fb02. // // Solidity: function updateEpoch() returns() func (_GPUManager *GPUManagerTransactor) UpdateEpoch(opts *bind.TransactOpts) (*types.Transaction, error) { return _GPUManager.contract.Transact(opts, "updateEpoch") } // UpdateEpoch is a paid mutator transaction binding the contract method 0x36f4fb02. // // Solidity: function updateEpoch() returns() func (_GPUManager *GPUManagerSession) UpdateEpoch() (*types.Transaction, error) { return _GPUManager.Contract.UpdateEpoch(&_GPUManager.TransactOpts) } // UpdateEpoch is a paid mutator transaction binding the contract method 0x36f4fb02. // // Solidity: function updateEpoch() returns() func (_GPUManager *GPUManagerTransactorSession) UpdateEpoch() (*types.Transaction, error) { return _GPUManager.Contract.UpdateEpoch(&_GPUManager.TransactOpts) } // UpdateModelMinimumFee is a paid mutator transaction binding the contract method 0x13ee7dbc. // // Solidity: function updateModelMinimumFee(uint32 modelId, uint256 minimumFee) returns() func (_GPUManager *GPUManagerTransactor) UpdateModelMinimumFee(opts *bind.TransactOpts, modelId uint32, minimumFee *big.Int) (*types.Transaction, error) { return _GPUManager.contract.Transact(opts, "updateModelMinimumFee", modelId, minimumFee) } // UpdateModelMinimumFee is a paid mutator transaction binding the contract method 0x13ee7dbc. // // Solidity: function updateModelMinimumFee(uint32 modelId, uint256 minimumFee) returns() func (_GPUManager *GPUManagerSession) UpdateModelMinimumFee(modelId uint32, minimumFee *big.Int) (*types.Transaction, error) { return _GPUManager.Contract.UpdateModelMinimumFee(&_GPUManager.TransactOpts, modelId, minimumFee) } // UpdateModelMinimumFee is a paid mutator transaction binding the contract method 0x13ee7dbc. // // Solidity: function updateModelMinimumFee(uint32 modelId, uint256 minimumFee) returns() func (_GPUManager *GPUManagerTransactorSession) UpdateModelMinimumFee(modelId uint32, minimumFee *big.Int) (*types.Transaction, error) { return _GPUManager.Contract.UpdateModelMinimumFee(&_GPUManager.TransactOpts, modelId, minimumFee) } // UpdateModelTier is a paid mutator transaction binding the contract method 0xfdf22bc8. // // Solidity: function updateModelTier(uint32 modelId, uint32 tier) returns() func (_GPUManager *GPUManagerTransactor) UpdateModelTier(opts *bind.TransactOpts, modelId uint32, tier uint32) (*types.Transaction, error) { return _GPUManager.contract.Transact(opts, "updateModelTier", modelId, tier) } // UpdateModelTier is a paid mutator transaction binding the contract method 0xfdf22bc8. // // Solidity: function updateModelTier(uint32 modelId, uint32 tier) returns() func (_GPUManager *GPUManagerSession) UpdateModelTier(modelId uint32, tier uint32) (*types.Transaction, error) { return _GPUManager.Contract.UpdateModelTier(&_GPUManager.TransactOpts, modelId, tier) } // UpdateModelTier is a paid mutator transaction binding the contract method 0xfdf22bc8. // // Solidity: function updateModelTier(uint32 modelId, uint32 tier) returns() func (_GPUManager *GPUManagerTransactorSession) UpdateModelTier(modelId uint32, tier uint32) (*types.Transaction, error) { return _GPUManager.Contract.UpdateModelTier(&_GPUManager.TransactOpts, modelId, tier) } // ValidateMiner is a paid mutator transaction binding the contract method 0xdfecce6f. // // Solidity: function validateMiner(address miner) returns() func (_GPUManager *GPUManagerTransactor) ValidateMiner(opts *bind.TransactOpts, miner common.Address) (*types.Transaction, error) { return _GPUManager.contract.Transact(opts, "validateMiner", miner) } // ValidateMiner is a paid mutator transaction binding the contract method 0xdfecce6f. // // Solidity: function validateMiner(address miner) returns() func (_GPUManager *GPUManagerSession) ValidateMiner(miner common.Address) (*types.Transaction, error) { return _GPUManager.Contract.ValidateMiner(&_GPUManager.TransactOpts, miner) } // ValidateMiner is a paid mutator transaction binding the contract method 0xdfecce6f. // // Solidity: function validateMiner(address miner) returns() func (_GPUManager *GPUManagerTransactorSession) ValidateMiner(miner common.Address) (*types.Transaction, error) { return _GPUManager.Contract.ValidateMiner(&_GPUManager.TransactOpts, miner) } // ValidateModelAndChooseRandomMiner is a paid mutator transaction binding the contract method 0xe13f220e. // // Solidity: function validateModelAndChooseRandomMiner(uint32 modelId, uint256 minersRequired) returns(address, uint256) func (_GPUManager *GPUManagerTransactor) ValidateModelAndChooseRandomMiner(opts *bind.TransactOpts, modelId uint32, minersRequired *big.Int) (*types.Transaction, error) { return _GPUManager.contract.Transact(opts, "validateModelAndChooseRandomMiner", modelId, minersRequired) } // ValidateModelAndChooseRandomMiner is a paid mutator transaction binding the contract method 0xe13f220e. // // Solidity: function validateModelAndChooseRandomMiner(uint32 modelId, uint256 minersRequired) returns(address, uint256) func (_GPUManager *GPUManagerSession) ValidateModelAndChooseRandomMiner(modelId uint32, minersRequired *big.Int) (*types.Transaction, error) { return _GPUManager.Contract.ValidateModelAndChooseRandomMiner(&_GPUManager.TransactOpts, modelId, minersRequired) } // ValidateModelAndChooseRandomMiner is a paid mutator transaction binding the contract method 0xe13f220e. // // Solidity: function validateModelAndChooseRandomMiner(uint32 modelId, uint256 minersRequired) returns(address, uint256) func (_GPUManager *GPUManagerTransactorSession) ValidateModelAndChooseRandomMiner(modelId uint32, minersRequired *big.Int) (*types.Transaction, error) { return _GPUManager.Contract.ValidateModelAndChooseRandomMiner(&_GPUManager.TransactOpts, modelId, minersRequired) } // Receive is a paid mutator transaction binding the contract receive function. // // Solidity: receive() payable returns() func (_GPUManager *GPUManagerTransactor) Receive(opts *bind.TransactOpts) (*types.Transaction, error) { return _GPUManager.contract.RawTransact(opts, nil) // calldata is disallowed for receive function } // Receive is a paid mutator transaction binding the contract receive function. // // Solidity: receive() payable returns() func (_GPUManager *GPUManagerSession) Receive() (*types.Transaction, error) { return _GPUManager.Contract.Receive(&_GPUManager.TransactOpts) } // Receive is a paid mutator transaction binding the contract receive function. // // Solidity: receive() payable returns() func (_GPUManager *GPUManagerTransactorSession) Receive() (*types.Transaction, error) { return _GPUManager.Contract.Receive(&_GPUManager.TransactOpts) } // GPUManagerBlocksPerEpochIterator is returned from FilterBlocksPerEpoch and is used to iterate over the raw logs and unpacked data for BlocksPerEpoch events raised by the GPUManager contract. type GPUManagerBlocksPerEpochIterator struct { Event *GPUManagerBlocksPerEpoch // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *GPUManagerBlocksPerEpochIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(GPUManagerBlocksPerEpoch) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(GPUManagerBlocksPerEpoch) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *GPUManagerBlocksPerEpochIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *GPUManagerBlocksPerEpochIterator) Close() error { it.sub.Unsubscribe() return nil } // GPUManagerBlocksPerEpoch represents a BlocksPerEpoch event raised by the GPUManager contract. type GPUManagerBlocksPerEpoch struct { OldBlocks *big.Int NewBlocks *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterBlocksPerEpoch is a free log retrieval operation binding the contract event 0x3179ee2c3011a36d6d80a4b422f208df28ef9493d1d9ce1555b3116bd26ddb3d. // // Solidity: event BlocksPerEpoch(uint256 oldBlocks, uint256 newBlocks) func (_GPUManager *GPUManagerFilterer) FilterBlocksPerEpoch(opts *bind.FilterOpts) (*GPUManagerBlocksPerEpochIterator, error) { logs, sub, err := _GPUManager.contract.FilterLogs(opts, "BlocksPerEpoch") if err != nil { return nil, err } return &GPUManagerBlocksPerEpochIterator{contract: _GPUManager.contract, event: "BlocksPerEpoch", logs: logs, sub: sub}, nil } // WatchBlocksPerEpoch is a free log subscription operation binding the contract event 0x3179ee2c3011a36d6d80a4b422f208df28ef9493d1d9ce1555b3116bd26ddb3d. // // Solidity: event BlocksPerEpoch(uint256 oldBlocks, uint256 newBlocks) func (_GPUManager *GPUManagerFilterer) WatchBlocksPerEpoch(opts *bind.WatchOpts, sink chan<- *GPUManagerBlocksPerEpoch) (event.Subscription, error) { logs, sub, err := _GPUManager.contract.WatchLogs(opts, "BlocksPerEpoch") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(GPUManagerBlocksPerEpoch) if err := _GPUManager.contract.UnpackLog(event, "BlocksPerEpoch", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseBlocksPerEpoch is a log parse operation binding the contract event 0x3179ee2c3011a36d6d80a4b422f208df28ef9493d1d9ce1555b3116bd26ddb3d. // // Solidity: event BlocksPerEpoch(uint256 oldBlocks, uint256 newBlocks) func (_GPUManager *GPUManagerFilterer) ParseBlocksPerEpoch(log types.Log) (*GPUManagerBlocksPerEpoch, error) { event := new(GPUManagerBlocksPerEpoch) if err := _GPUManager.contract.UnpackLog(event, "BlocksPerEpoch", log); err != nil { return nil, err } event.Raw = log return event, nil } // GPUManagerFinePercentageUpdatedIterator is returned from FilterFinePercentageUpdated and is used to iterate over the raw logs and unpacked data for FinePercentageUpdated events raised by the GPUManager contract. type GPUManagerFinePercentageUpdatedIterator struct { Event *GPUManagerFinePercentageUpdated // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *GPUManagerFinePercentageUpdatedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(GPUManagerFinePercentageUpdated) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(GPUManagerFinePercentageUpdated) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *GPUManagerFinePercentageUpdatedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *GPUManagerFinePercentageUpdatedIterator) Close() error { it.sub.Unsubscribe() return nil } // GPUManagerFinePercentageUpdated represents a FinePercentageUpdated event raised by the GPUManager contract. type GPUManagerFinePercentageUpdated struct { OldPercent uint16 NewPercent uint16 Raw types.Log // Blockchain specific contextual infos } // FilterFinePercentageUpdated is a free log retrieval operation binding the contract event 0xcf2ba21ec685fb1baf4b5e5df96fd2da47ab299e7d95e586c7898f114b6c1269. // // Solidity: event FinePercentageUpdated(uint16 oldPercent, uint16 newPercent) func (_GPUManager *GPUManagerFilterer) FilterFinePercentageUpdated(opts *bind.FilterOpts) (*GPUManagerFinePercentageUpdatedIterator, error) { logs, sub, err := _GPUManager.contract.FilterLogs(opts, "FinePercentageUpdated") if err != nil { return nil, err } return &GPUManagerFinePercentageUpdatedIterator{contract: _GPUManager.contract, event: "FinePercentageUpdated", logs: logs, sub: sub}, nil } // WatchFinePercentageUpdated is a free log subscription operation binding the contract event 0xcf2ba21ec685fb1baf4b5e5df96fd2da47ab299e7d95e586c7898f114b6c1269. // // Solidity: event FinePercentageUpdated(uint16 oldPercent, uint16 newPercent) func (_GPUManager *GPUManagerFilterer) WatchFinePercentageUpdated(opts *bind.WatchOpts, sink chan<- *GPUManagerFinePercentageUpdated) (event.Subscription, error) { logs, sub, err := _GPUManager.contract.WatchLogs(opts, "FinePercentageUpdated") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(GPUManagerFinePercentageUpdated) if err := _GPUManager.contract.UnpackLog(event, "FinePercentageUpdated", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseFinePercentageUpdated is a log parse operation binding the contract event 0xcf2ba21ec685fb1baf4b5e5df96fd2da47ab299e7d95e586c7898f114b6c1269. // // Solidity: event FinePercentageUpdated(uint16 oldPercent, uint16 newPercent) func (_GPUManager *GPUManagerFilterer) ParseFinePercentageUpdated(log types.Log) (*GPUManagerFinePercentageUpdated, error) { event := new(GPUManagerFinePercentageUpdated) if err := _GPUManager.contract.UnpackLog(event, "FinePercentageUpdated", log); err != nil { return nil, err } event.Raw = log return event, nil } // GPUManagerFraudulentMinerPenalizedIterator is returned from FilterFraudulentMinerPenalized and is used to iterate over the raw logs and unpacked data for FraudulentMinerPenalized events raised by the GPUManager contract. type GPUManagerFraudulentMinerPenalizedIterator struct { Event *GPUManagerFraudulentMinerPenalized // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *GPUManagerFraudulentMinerPenalizedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(GPUManagerFraudulentMinerPenalized) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(GPUManagerFraudulentMinerPenalized) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *GPUManagerFraudulentMinerPenalizedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *GPUManagerFraudulentMinerPenalizedIterator) Close() error { it.sub.Unsubscribe() return nil } // GPUManagerFraudulentMinerPenalized represents a FraudulentMinerPenalized event raised by the GPUManager contract. type GPUManagerFraudulentMinerPenalized struct { Miner common.Address ModelId uint32 Treasury common.Address Fine *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterFraudulentMinerPenalized is a free log retrieval operation binding the contract event 0x396ee931f435c63405d255f5e0d31a0d1a1f6b57d59ef9559155464a15b13593. // // Solidity: event FraudulentMinerPenalized(address indexed miner, uint32 indexed modelId, address indexed treasury, uint256 fine) func (_GPUManager *GPUManagerFilterer) FilterFraudulentMinerPenalized(opts *bind.FilterOpts, miner []common.Address, modelId []uint32, treasury []common.Address) (*GPUManagerFraudulentMinerPenalizedIterator, error) { var minerRule []interface{} for _, minerItem := range miner { minerRule = append(minerRule, minerItem) } var modelIdRule []interface{} for _, modelIdItem := range modelId { modelIdRule = append(modelIdRule, modelIdItem) } var treasuryRule []interface{} for _, treasuryItem := range treasury { treasuryRule = append(treasuryRule, treasuryItem) } logs, sub, err := _GPUManager.contract.FilterLogs(opts, "FraudulentMinerPenalized", minerRule, modelIdRule, treasuryRule) if err != nil { return nil, err } return &GPUManagerFraudulentMinerPenalizedIterator{contract: _GPUManager.contract, event: "FraudulentMinerPenalized", logs: logs, sub: sub}, nil } // WatchFraudulentMinerPenalized is a free log subscription operation binding the contract event 0x396ee931f435c63405d255f5e0d31a0d1a1f6b57d59ef9559155464a15b13593. // // Solidity: event FraudulentMinerPenalized(address indexed miner, uint32 indexed modelId, address indexed treasury, uint256 fine) func (_GPUManager *GPUManagerFilterer) WatchFraudulentMinerPenalized(opts *bind.WatchOpts, sink chan<- *GPUManagerFraudulentMinerPenalized, miner []common.Address, modelId []uint32, treasury []common.Address) (event.Subscription, error) { var minerRule []interface{} for _, minerItem := range miner { minerRule = append(minerRule, minerItem) } var modelIdRule []interface{} for _, modelIdItem := range modelId { modelIdRule = append(modelIdRule, modelIdItem) } var treasuryRule []interface{} for _, treasuryItem := range treasury { treasuryRule = append(treasuryRule, treasuryItem) } logs, sub, err := _GPUManager.contract.WatchLogs(opts, "FraudulentMinerPenalized", minerRule, modelIdRule, treasuryRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(GPUManagerFraudulentMinerPenalized) if err := _GPUManager.contract.UnpackLog(event, "FraudulentMinerPenalized", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseFraudulentMinerPenalized is a log parse operation binding the contract event 0x396ee931f435c63405d255f5e0d31a0d1a1f6b57d59ef9559155464a15b13593. // // Solidity: event FraudulentMinerPenalized(address indexed miner, uint32 indexed modelId, address indexed treasury, uint256 fine) func (_GPUManager *GPUManagerFilterer) ParseFraudulentMinerPenalized(log types.Log) (*GPUManagerFraudulentMinerPenalized, error) { event := new(GPUManagerFraudulentMinerPenalized) if err := _GPUManager.contract.UnpackLog(event, "FraudulentMinerPenalized", log); err != nil { return nil, err } event.Raw = log return event, nil } // GPUManagerInitializedIterator is returned from FilterInitialized and is used to iterate over the raw logs and unpacked data for Initialized events raised by the GPUManager contract. type GPUManagerInitializedIterator struct { Event *GPUManagerInitialized // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *GPUManagerInitializedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(GPUManagerInitialized) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(GPUManagerInitialized) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *GPUManagerInitializedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *GPUManagerInitializedIterator) Close() error { it.sub.Unsubscribe() return nil } // GPUManagerInitialized represents a Initialized event raised by the GPUManager contract. type GPUManagerInitialized struct { Version uint8 Raw types.Log // Blockchain specific contextual infos } // FilterInitialized is a free log retrieval operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. // // Solidity: event Initialized(uint8 version) func (_GPUManager *GPUManagerFilterer) FilterInitialized(opts *bind.FilterOpts) (*GPUManagerInitializedIterator, error) { logs, sub, err := _GPUManager.contract.FilterLogs(opts, "Initialized") if err != nil { return nil, err } return &GPUManagerInitializedIterator{contract: _GPUManager.contract, event: "Initialized", logs: logs, sub: sub}, nil } // WatchInitialized is a free log subscription operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. // // Solidity: event Initialized(uint8 version) func (_GPUManager *GPUManagerFilterer) WatchInitialized(opts *bind.WatchOpts, sink chan<- *GPUManagerInitialized) (event.Subscription, error) { logs, sub, err := _GPUManager.contract.WatchLogs(opts, "Initialized") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(GPUManagerInitialized) if err := _GPUManager.contract.UnpackLog(event, "Initialized", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseInitialized is a log parse operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. // // Solidity: event Initialized(uint8 version) func (_GPUManager *GPUManagerFilterer) ParseInitialized(log types.Log) (*GPUManagerInitialized, error) { event := new(GPUManagerInitialized) if err := _GPUManager.contract.UnpackLog(event, "Initialized", log); err != nil { return nil, err } event.Raw = log return event, nil } // GPUManagerMinFeeToUseUpdatedIterator is returned from FilterMinFeeToUseUpdated and is used to iterate over the raw logs and unpacked data for MinFeeToUseUpdated events raised by the GPUManager contract. type GPUManagerMinFeeToUseUpdatedIterator struct { Event *GPUManagerMinFeeToUseUpdated // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *GPUManagerMinFeeToUseUpdatedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(GPUManagerMinFeeToUseUpdated) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(GPUManagerMinFeeToUseUpdated) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *GPUManagerMinFeeToUseUpdatedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *GPUManagerMinFeeToUseUpdatedIterator) Close() error { it.sub.Unsubscribe() return nil } // GPUManagerMinFeeToUseUpdated represents a MinFeeToUseUpdated event raised by the GPUManager contract. type GPUManagerMinFeeToUseUpdated struct { OldValue *big.Int NewValue *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterMinFeeToUseUpdated is a free log retrieval operation binding the contract event 0x37bba2c63397e7d89baa40e3d0c29e309913eb87b9691bacb16dba509fad523c. // // Solidity: event MinFeeToUseUpdated(uint256 oldValue, uint256 newValue) func (_GPUManager *GPUManagerFilterer) FilterMinFeeToUseUpdated(opts *bind.FilterOpts) (*GPUManagerMinFeeToUseUpdatedIterator, error) { logs, sub, err := _GPUManager.contract.FilterLogs(opts, "MinFeeToUseUpdated") if err != nil { return nil, err } return &GPUManagerMinFeeToUseUpdatedIterator{contract: _GPUManager.contract, event: "MinFeeToUseUpdated", logs: logs, sub: sub}, nil } // WatchMinFeeToUseUpdated is a free log subscription operation binding the contract event 0x37bba2c63397e7d89baa40e3d0c29e309913eb87b9691bacb16dba509fad523c. // // Solidity: event MinFeeToUseUpdated(uint256 oldValue, uint256 newValue) func (_GPUManager *GPUManagerFilterer) WatchMinFeeToUseUpdated(opts *bind.WatchOpts, sink chan<- *GPUManagerMinFeeToUseUpdated) (event.Subscription, error) { logs, sub, err := _GPUManager.contract.WatchLogs(opts, "MinFeeToUseUpdated") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(GPUManagerMinFeeToUseUpdated) if err := _GPUManager.contract.UnpackLog(event, "MinFeeToUseUpdated", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseMinFeeToUseUpdated is a log parse operation binding the contract event 0x37bba2c63397e7d89baa40e3d0c29e309913eb87b9691bacb16dba509fad523c. // // Solidity: event MinFeeToUseUpdated(uint256 oldValue, uint256 newValue) func (_GPUManager *GPUManagerFilterer) ParseMinFeeToUseUpdated(log types.Log) (*GPUManagerMinFeeToUseUpdated, error) { event := new(GPUManagerMinFeeToUseUpdated) if err := _GPUManager.contract.UnpackLog(event, "MinFeeToUseUpdated", log); err != nil { return nil, err } event.Raw = log return event, nil } // GPUManagerMinerDeactivatedIterator is returned from FilterMinerDeactivated and is used to iterate over the raw logs and unpacked data for MinerDeactivated events raised by the GPUManager contract. type GPUManagerMinerDeactivatedIterator struct { Event *GPUManagerMinerDeactivated // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *GPUManagerMinerDeactivatedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(GPUManagerMinerDeactivated) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(GPUManagerMinerDeactivated) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *GPUManagerMinerDeactivatedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *GPUManagerMinerDeactivatedIterator) Close() error { it.sub.Unsubscribe() return nil } // GPUManagerMinerDeactivated represents a MinerDeactivated event raised by the GPUManager contract. type GPUManagerMinerDeactivated struct { Miner common.Address ModelId uint32 ActiveTime *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterMinerDeactivated is a free log retrieval operation binding the contract event 0x6e4a7233a3b583018e3a3d018e76ad619bab8ad6e8fe05e12cb83ec1fa75d85e. // // Solidity: event MinerDeactivated(address indexed miner, uint32 indexed modelId, uint40 activeTime) func (_GPUManager *GPUManagerFilterer) FilterMinerDeactivated(opts *bind.FilterOpts, miner []common.Address, modelId []uint32) (*GPUManagerMinerDeactivatedIterator, error) { var minerRule []interface{} for _, minerItem := range miner { minerRule = append(minerRule, minerItem) } var modelIdRule []interface{} for _, modelIdItem := range modelId { modelIdRule = append(modelIdRule, modelIdItem) } logs, sub, err := _GPUManager.contract.FilterLogs(opts, "MinerDeactivated", minerRule, modelIdRule) if err != nil { return nil, err } return &GPUManagerMinerDeactivatedIterator{contract: _GPUManager.contract, event: "MinerDeactivated", logs: logs, sub: sub}, nil } // WatchMinerDeactivated is a free log subscription operation binding the contract event 0x6e4a7233a3b583018e3a3d018e76ad619bab8ad6e8fe05e12cb83ec1fa75d85e. // // Solidity: event MinerDeactivated(address indexed miner, uint32 indexed modelId, uint40 activeTime) func (_GPUManager *GPUManagerFilterer) WatchMinerDeactivated(opts *bind.WatchOpts, sink chan<- *GPUManagerMinerDeactivated, miner []common.Address, modelId []uint32) (event.Subscription, error) { var minerRule []interface{} for _, minerItem := range miner { minerRule = append(minerRule, minerItem) } var modelIdRule []interface{} for _, modelIdItem := range modelId { modelIdRule = append(modelIdRule, modelIdItem) } logs, sub, err := _GPUManager.contract.WatchLogs(opts, "MinerDeactivated", minerRule, modelIdRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(GPUManagerMinerDeactivated) if err := _GPUManager.contract.UnpackLog(event, "MinerDeactivated", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseMinerDeactivated is a log parse operation binding the contract event 0x6e4a7233a3b583018e3a3d018e76ad619bab8ad6e8fe05e12cb83ec1fa75d85e. // // Solidity: event MinerDeactivated(address indexed miner, uint32 indexed modelId, uint40 activeTime) func (_GPUManager *GPUManagerFilterer) ParseMinerDeactivated(log types.Log) (*GPUManagerMinerDeactivated, error) { event := new(GPUManagerMinerDeactivated) if err := _GPUManager.contract.UnpackLog(event, "MinerDeactivated", log); err != nil { return nil, err } event.Raw = log return event, nil } // GPUManagerMinerExtraStakeIterator is returned from FilterMinerExtraStake and is used to iterate over the raw logs and unpacked data for MinerExtraStake events raised by the GPUManager contract. type GPUManagerMinerExtraStakeIterator struct { Event *GPUManagerMinerExtraStake // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *GPUManagerMinerExtraStakeIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(GPUManagerMinerExtraStake) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(GPUManagerMinerExtraStake) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *GPUManagerMinerExtraStakeIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *GPUManagerMinerExtraStakeIterator) Close() error { it.sub.Unsubscribe() return nil } // GPUManagerMinerExtraStake represents a MinerExtraStake event raised by the GPUManager contract. type GPUManagerMinerExtraStake struct { Miner common.Address Value *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterMinerExtraStake is a free log retrieval operation binding the contract event 0x3d236e8f743e932a32c84d3114ce3e7ee0b75225cb3b39f72faac62495fd21c1. // // Solidity: event MinerExtraStake(address indexed miner, uint256 value) func (_GPUManager *GPUManagerFilterer) FilterMinerExtraStake(opts *bind.FilterOpts, miner []common.Address) (*GPUManagerMinerExtraStakeIterator, error) { var minerRule []interface{} for _, minerItem := range miner { minerRule = append(minerRule, minerItem) } logs, sub, err := _GPUManager.contract.FilterLogs(opts, "MinerExtraStake", minerRule) if err != nil { return nil, err } return &GPUManagerMinerExtraStakeIterator{contract: _GPUManager.contract, event: "MinerExtraStake", logs: logs, sub: sub}, nil } // WatchMinerExtraStake is a free log subscription operation binding the contract event 0x3d236e8f743e932a32c84d3114ce3e7ee0b75225cb3b39f72faac62495fd21c1. // // Solidity: event MinerExtraStake(address indexed miner, uint256 value) func (_GPUManager *GPUManagerFilterer) WatchMinerExtraStake(opts *bind.WatchOpts, sink chan<- *GPUManagerMinerExtraStake, miner []common.Address) (event.Subscription, error) { var minerRule []interface{} for _, minerItem := range miner { minerRule = append(minerRule, minerItem) } logs, sub, err := _GPUManager.contract.WatchLogs(opts, "MinerExtraStake", minerRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(GPUManagerMinerExtraStake) if err := _GPUManager.contract.UnpackLog(event, "MinerExtraStake", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseMinerExtraStake is a log parse operation binding the contract event 0x3d236e8f743e932a32c84d3114ce3e7ee0b75225cb3b39f72faac62495fd21c1. // // Solidity: event MinerExtraStake(address indexed miner, uint256 value) func (_GPUManager *GPUManagerFilterer) ParseMinerExtraStake(log types.Log) (*GPUManagerMinerExtraStake, error) { event := new(GPUManagerMinerExtraStake) if err := _GPUManager.contract.UnpackLog(event, "MinerExtraStake", log); err != nil { return nil, err } event.Raw = log return event, nil } // GPUManagerMinerJoinIterator is returned from FilterMinerJoin and is used to iterate over the raw logs and unpacked data for MinerJoin events raised by the GPUManager contract. type GPUManagerMinerJoinIterator struct { Event *GPUManagerMinerJoin // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *GPUManagerMinerJoinIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(GPUManagerMinerJoin) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(GPUManagerMinerJoin) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *GPUManagerMinerJoinIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *GPUManagerMinerJoinIterator) Close() error { it.sub.Unsubscribe() return nil } // GPUManagerMinerJoin represents a MinerJoin event raised by the GPUManager contract. type GPUManagerMinerJoin struct { Miner common.Address Raw types.Log // Blockchain specific contextual infos } // FilterMinerJoin is a free log retrieval operation binding the contract event 0xb7041987154996ed34981c2bc6fbafd4b1fcab9964486d7cc386f0d8abcc5446. // // Solidity: event MinerJoin(address indexed miner) func (_GPUManager *GPUManagerFilterer) FilterMinerJoin(opts *bind.FilterOpts, miner []common.Address) (*GPUManagerMinerJoinIterator, error) { var minerRule []interface{} for _, minerItem := range miner { minerRule = append(minerRule, minerItem) } logs, sub, err := _GPUManager.contract.FilterLogs(opts, "MinerJoin", minerRule) if err != nil { return nil, err } return &GPUManagerMinerJoinIterator{contract: _GPUManager.contract, event: "MinerJoin", logs: logs, sub: sub}, nil } // WatchMinerJoin is a free log subscription operation binding the contract event 0xb7041987154996ed34981c2bc6fbafd4b1fcab9964486d7cc386f0d8abcc5446. // // Solidity: event MinerJoin(address indexed miner) func (_GPUManager *GPUManagerFilterer) WatchMinerJoin(opts *bind.WatchOpts, sink chan<- *GPUManagerMinerJoin, miner []common.Address) (event.Subscription, error) { var minerRule []interface{} for _, minerItem := range miner { minerRule = append(minerRule, minerItem) } logs, sub, err := _GPUManager.contract.WatchLogs(opts, "MinerJoin", minerRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(GPUManagerMinerJoin) if err := _GPUManager.contract.UnpackLog(event, "MinerJoin", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseMinerJoin is a log parse operation binding the contract event 0xb7041987154996ed34981c2bc6fbafd4b1fcab9964486d7cc386f0d8abcc5446. // // Solidity: event MinerJoin(address indexed miner) func (_GPUManager *GPUManagerFilterer) ParseMinerJoin(log types.Log) (*GPUManagerMinerJoin, error) { event := new(GPUManagerMinerJoin) if err := _GPUManager.contract.UnpackLog(event, "MinerJoin", log); err != nil { return nil, err } event.Raw = log return event, nil } // GPUManagerMinerRegistrationIterator is returned from FilterMinerRegistration and is used to iterate over the raw logs and unpacked data for MinerRegistration events raised by the GPUManager contract. type GPUManagerMinerRegistrationIterator struct { Event *GPUManagerMinerRegistration // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *GPUManagerMinerRegistrationIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(GPUManagerMinerRegistration) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(GPUManagerMinerRegistration) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *GPUManagerMinerRegistrationIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *GPUManagerMinerRegistrationIterator) Close() error { it.sub.Unsubscribe() return nil } // GPUManagerMinerRegistration represents a MinerRegistration event raised by the GPUManager contract. type GPUManagerMinerRegistration struct { Miner common.Address Tier uint16 Value *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterMinerRegistration is a free log retrieval operation binding the contract event 0x55e488821080f3f5cdf6088b02793df0d26f40053a70b6154347d2ac313015a1. // // Solidity: event MinerRegistration(address indexed miner, uint16 indexed tier, uint256 value) func (_GPUManager *GPUManagerFilterer) FilterMinerRegistration(opts *bind.FilterOpts, miner []common.Address, tier []uint16) (*GPUManagerMinerRegistrationIterator, error) { var minerRule []interface{} for _, minerItem := range miner { minerRule = append(minerRule, minerItem) } var tierRule []interface{} for _, tierItem := range tier { tierRule = append(tierRule, tierItem) } logs, sub, err := _GPUManager.contract.FilterLogs(opts, "MinerRegistration", minerRule, tierRule) if err != nil { return nil, err } return &GPUManagerMinerRegistrationIterator{contract: _GPUManager.contract, event: "MinerRegistration", logs: logs, sub: sub}, nil } // WatchMinerRegistration is a free log subscription operation binding the contract event 0x55e488821080f3f5cdf6088b02793df0d26f40053a70b6154347d2ac313015a1. // // Solidity: event MinerRegistration(address indexed miner, uint16 indexed tier, uint256 value) func (_GPUManager *GPUManagerFilterer) WatchMinerRegistration(opts *bind.WatchOpts, sink chan<- *GPUManagerMinerRegistration, miner []common.Address, tier []uint16) (event.Subscription, error) { var minerRule []interface{} for _, minerItem := range miner { minerRule = append(minerRule, minerItem) } var tierRule []interface{} for _, tierItem := range tier { tierRule = append(tierRule, tierItem) } logs, sub, err := _GPUManager.contract.WatchLogs(opts, "MinerRegistration", minerRule, tierRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(GPUManagerMinerRegistration) if err := _GPUManager.contract.UnpackLog(event, "MinerRegistration", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseMinerRegistration is a log parse operation binding the contract event 0x55e488821080f3f5cdf6088b02793df0d26f40053a70b6154347d2ac313015a1. // // Solidity: event MinerRegistration(address indexed miner, uint16 indexed tier, uint256 value) func (_GPUManager *GPUManagerFilterer) ParseMinerRegistration(log types.Log) (*GPUManagerMinerRegistration, error) { event := new(GPUManagerMinerRegistration) if err := _GPUManager.contract.UnpackLog(event, "MinerRegistration", log); err != nil { return nil, err } event.Raw = log return event, nil } // GPUManagerMinerUnregistrationIterator is returned from FilterMinerUnregistration and is used to iterate over the raw logs and unpacked data for MinerUnregistration events raised by the GPUManager contract. type GPUManagerMinerUnregistrationIterator struct { Event *GPUManagerMinerUnregistration // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *GPUManagerMinerUnregistrationIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(GPUManagerMinerUnregistration) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(GPUManagerMinerUnregistration) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *GPUManagerMinerUnregistrationIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *GPUManagerMinerUnregistrationIterator) Close() error { it.sub.Unsubscribe() return nil } // GPUManagerMinerUnregistration represents a MinerUnregistration event raised by the GPUManager contract. type GPUManagerMinerUnregistration struct { Miner common.Address Raw types.Log // Blockchain specific contextual infos } // FilterMinerUnregistration is a free log retrieval operation binding the contract event 0x8f54596d72781f60dbf7dad7e576f06ce17bbda0bdf384463f7734f85f51498e. // // Solidity: event MinerUnregistration(address indexed miner) func (_GPUManager *GPUManagerFilterer) FilterMinerUnregistration(opts *bind.FilterOpts, miner []common.Address) (*GPUManagerMinerUnregistrationIterator, error) { var minerRule []interface{} for _, minerItem := range miner { minerRule = append(minerRule, minerItem) } logs, sub, err := _GPUManager.contract.FilterLogs(opts, "MinerUnregistration", minerRule) if err != nil { return nil, err } return &GPUManagerMinerUnregistrationIterator{contract: _GPUManager.contract, event: "MinerUnregistration", logs: logs, sub: sub}, nil } // WatchMinerUnregistration is a free log subscription operation binding the contract event 0x8f54596d72781f60dbf7dad7e576f06ce17bbda0bdf384463f7734f85f51498e. // // Solidity: event MinerUnregistration(address indexed miner) func (_GPUManager *GPUManagerFilterer) WatchMinerUnregistration(opts *bind.WatchOpts, sink chan<- *GPUManagerMinerUnregistration, miner []common.Address) (event.Subscription, error) { var minerRule []interface{} for _, minerItem := range miner { minerRule = append(minerRule, minerItem) } logs, sub, err := _GPUManager.contract.WatchLogs(opts, "MinerUnregistration", minerRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(GPUManagerMinerUnregistration) if err := _GPUManager.contract.UnpackLog(event, "MinerUnregistration", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseMinerUnregistration is a log parse operation binding the contract event 0x8f54596d72781f60dbf7dad7e576f06ce17bbda0bdf384463f7734f85f51498e. // // Solidity: event MinerUnregistration(address indexed miner) func (_GPUManager *GPUManagerFilterer) ParseMinerUnregistration(log types.Log) (*GPUManagerMinerUnregistration, error) { event := new(GPUManagerMinerUnregistration) if err := _GPUManager.contract.UnpackLog(event, "MinerUnregistration", log); err != nil { return nil, err } event.Raw = log return event, nil } // GPUManagerMinerUnstakeIterator is returned from FilterMinerUnstake and is used to iterate over the raw logs and unpacked data for MinerUnstake events raised by the GPUManager contract. type GPUManagerMinerUnstakeIterator struct { Event *GPUManagerMinerUnstake // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *GPUManagerMinerUnstakeIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(GPUManagerMinerUnstake) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(GPUManagerMinerUnstake) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *GPUManagerMinerUnstakeIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *GPUManagerMinerUnstakeIterator) Close() error { it.sub.Unsubscribe() return nil } // GPUManagerMinerUnstake represents a MinerUnstake event raised by the GPUManager contract. type GPUManagerMinerUnstake struct { Miner common.Address Stake *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterMinerUnstake is a free log retrieval operation binding the contract event 0x1051154647682075e7cc0645853209e75208cb5acd862fc83f7fd0fcaa9624b4. // // Solidity: event MinerUnstake(address indexed miner, uint256 stake) func (_GPUManager *GPUManagerFilterer) FilterMinerUnstake(opts *bind.FilterOpts, miner []common.Address) (*GPUManagerMinerUnstakeIterator, error) { var minerRule []interface{} for _, minerItem := range miner { minerRule = append(minerRule, minerItem) } logs, sub, err := _GPUManager.contract.FilterLogs(opts, "MinerUnstake", minerRule) if err != nil { return nil, err } return &GPUManagerMinerUnstakeIterator{contract: _GPUManager.contract, event: "MinerUnstake", logs: logs, sub: sub}, nil } // WatchMinerUnstake is a free log subscription operation binding the contract event 0x1051154647682075e7cc0645853209e75208cb5acd862fc83f7fd0fcaa9624b4. // // Solidity: event MinerUnstake(address indexed miner, uint256 stake) func (_GPUManager *GPUManagerFilterer) WatchMinerUnstake(opts *bind.WatchOpts, sink chan<- *GPUManagerMinerUnstake, miner []common.Address) (event.Subscription, error) { var minerRule []interface{} for _, minerItem := range miner { minerRule = append(minerRule, minerItem) } logs, sub, err := _GPUManager.contract.WatchLogs(opts, "MinerUnstake", minerRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(GPUManagerMinerUnstake) if err := _GPUManager.contract.UnpackLog(event, "MinerUnstake", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseMinerUnstake is a log parse operation binding the contract event 0x1051154647682075e7cc0645853209e75208cb5acd862fc83f7fd0fcaa9624b4. // // Solidity: event MinerUnstake(address indexed miner, uint256 stake) func (_GPUManager *GPUManagerFilterer) ParseMinerUnstake(log types.Log) (*GPUManagerMinerUnstake, error) { event := new(GPUManagerMinerUnstake) if err := _GPUManager.contract.UnpackLog(event, "MinerUnstake", log); err != nil { return nil, err } event.Raw = log return event, nil } // GPUManagerModelMinimumFeeUpdateIterator is returned from FilterModelMinimumFeeUpdate and is used to iterate over the raw logs and unpacked data for ModelMinimumFeeUpdate events raised by the GPUManager contract. type GPUManagerModelMinimumFeeUpdateIterator struct { Event *GPUManagerModelMinimumFeeUpdate // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *GPUManagerModelMinimumFeeUpdateIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(GPUManagerModelMinimumFeeUpdate) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(GPUManagerModelMinimumFeeUpdate) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *GPUManagerModelMinimumFeeUpdateIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *GPUManagerModelMinimumFeeUpdateIterator) Close() error { it.sub.Unsubscribe() return nil } // GPUManagerModelMinimumFeeUpdate represents a ModelMinimumFeeUpdate event raised by the GPUManager contract. type GPUManagerModelMinimumFeeUpdate struct { ModelId uint32 MinimumFee *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterModelMinimumFeeUpdate is a free log retrieval operation binding the contract event 0x32fdbd4cff3135e1bb0ae98bb593ee0c78a48a5e92e80ccf8a8ab6e72b21ffb9. // // Solidity: event ModelMinimumFeeUpdate(uint32 indexed modelId, uint256 minimumFee) func (_GPUManager *GPUManagerFilterer) FilterModelMinimumFeeUpdate(opts *bind.FilterOpts, modelId []uint32) (*GPUManagerModelMinimumFeeUpdateIterator, error) { var modelIdRule []interface{} for _, modelIdItem := range modelId { modelIdRule = append(modelIdRule, modelIdItem) } logs, sub, err := _GPUManager.contract.FilterLogs(opts, "ModelMinimumFeeUpdate", modelIdRule) if err != nil { return nil, err } return &GPUManagerModelMinimumFeeUpdateIterator{contract: _GPUManager.contract, event: "ModelMinimumFeeUpdate", logs: logs, sub: sub}, nil } // WatchModelMinimumFeeUpdate is a free log subscription operation binding the contract event 0x32fdbd4cff3135e1bb0ae98bb593ee0c78a48a5e92e80ccf8a8ab6e72b21ffb9. // // Solidity: event ModelMinimumFeeUpdate(uint32 indexed modelId, uint256 minimumFee) func (_GPUManager *GPUManagerFilterer) WatchModelMinimumFeeUpdate(opts *bind.WatchOpts, sink chan<- *GPUManagerModelMinimumFeeUpdate, modelId []uint32) (event.Subscription, error) { var modelIdRule []interface{} for _, modelIdItem := range modelId { modelIdRule = append(modelIdRule, modelIdItem) } logs, sub, err := _GPUManager.contract.WatchLogs(opts, "ModelMinimumFeeUpdate", modelIdRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(GPUManagerModelMinimumFeeUpdate) if err := _GPUManager.contract.UnpackLog(event, "ModelMinimumFeeUpdate", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseModelMinimumFeeUpdate is a log parse operation binding the contract event 0x32fdbd4cff3135e1bb0ae98bb593ee0c78a48a5e92e80ccf8a8ab6e72b21ffb9. // // Solidity: event ModelMinimumFeeUpdate(uint32 indexed modelId, uint256 minimumFee) func (_GPUManager *GPUManagerFilterer) ParseModelMinimumFeeUpdate(log types.Log) (*GPUManagerModelMinimumFeeUpdate, error) { event := new(GPUManagerModelMinimumFeeUpdate) if err := _GPUManager.contract.UnpackLog(event, "ModelMinimumFeeUpdate", log); err != nil { return nil, err } event.Raw = log return event, nil } // GPUManagerModelRegistrationIterator is returned from FilterModelRegistration and is used to iterate over the raw logs and unpacked data for ModelRegistration events raised by the GPUManager contract. type GPUManagerModelRegistrationIterator struct { Event *GPUManagerModelRegistration // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *GPUManagerModelRegistrationIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(GPUManagerModelRegistration) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(GPUManagerModelRegistration) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *GPUManagerModelRegistrationIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *GPUManagerModelRegistrationIterator) Close() error { it.sub.Unsubscribe() return nil } // GPUManagerModelRegistration represents a ModelRegistration event raised by the GPUManager contract. type GPUManagerModelRegistration struct { ModelId uint32 Tier uint16 MinimumFee *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterModelRegistration is a free log retrieval operation binding the contract event 0xbf8d4447fa6c121c179656152534cb5032c1ce50f747e90c56580bec25583d81. // // Solidity: event ModelRegistration(uint32 indexed modelId, uint16 indexed tier, uint256 minimumFee) func (_GPUManager *GPUManagerFilterer) FilterModelRegistration(opts *bind.FilterOpts, modelId []uint32, tier []uint16) (*GPUManagerModelRegistrationIterator, error) { var modelIdRule []interface{} for _, modelIdItem := range modelId { modelIdRule = append(modelIdRule, modelIdItem) } var tierRule []interface{} for _, tierItem := range tier { tierRule = append(tierRule, tierItem) } logs, sub, err := _GPUManager.contract.FilterLogs(opts, "ModelRegistration", modelIdRule, tierRule) if err != nil { return nil, err } return &GPUManagerModelRegistrationIterator{contract: _GPUManager.contract, event: "ModelRegistration", logs: logs, sub: sub}, nil } // WatchModelRegistration is a free log subscription operation binding the contract event 0xbf8d4447fa6c121c179656152534cb5032c1ce50f747e90c56580bec25583d81. // // Solidity: event ModelRegistration(uint32 indexed modelId, uint16 indexed tier, uint256 minimumFee) func (_GPUManager *GPUManagerFilterer) WatchModelRegistration(opts *bind.WatchOpts, sink chan<- *GPUManagerModelRegistration, modelId []uint32, tier []uint16) (event.Subscription, error) { var modelIdRule []interface{} for _, modelIdItem := range modelId { modelIdRule = append(modelIdRule, modelIdItem) } var tierRule []interface{} for _, tierItem := range tier { tierRule = append(tierRule, tierItem) } logs, sub, err := _GPUManager.contract.WatchLogs(opts, "ModelRegistration", modelIdRule, tierRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(GPUManagerModelRegistration) if err := _GPUManager.contract.UnpackLog(event, "ModelRegistration", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseModelRegistration is a log parse operation binding the contract event 0xbf8d4447fa6c121c179656152534cb5032c1ce50f747e90c56580bec25583d81. // // Solidity: event ModelRegistration(uint32 indexed modelId, uint16 indexed tier, uint256 minimumFee) func (_GPUManager *GPUManagerFilterer) ParseModelRegistration(log types.Log) (*GPUManagerModelRegistration, error) { event := new(GPUManagerModelRegistration) if err := _GPUManager.contract.UnpackLog(event, "ModelRegistration", log); err != nil { return nil, err } event.Raw = log return event, nil } // GPUManagerModelTierUpdateIterator is returned from FilterModelTierUpdate and is used to iterate over the raw logs and unpacked data for ModelTierUpdate events raised by the GPUManager contract. type GPUManagerModelTierUpdateIterator struct { Event *GPUManagerModelTierUpdate // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *GPUManagerModelTierUpdateIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(GPUManagerModelTierUpdate) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(GPUManagerModelTierUpdate) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *GPUManagerModelTierUpdateIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *GPUManagerModelTierUpdateIterator) Close() error { it.sub.Unsubscribe() return nil } // GPUManagerModelTierUpdate represents a ModelTierUpdate event raised by the GPUManager contract. type GPUManagerModelTierUpdate struct { ModelId uint32 Tier uint32 Raw types.Log // Blockchain specific contextual infos } // FilterModelTierUpdate is a free log retrieval operation binding the contract event 0x4ecbcd19e308970fa368644f223de37bf9800e203349b5873d83970277c30356. // // Solidity: event ModelTierUpdate(uint32 indexed modelId, uint32 tier) func (_GPUManager *GPUManagerFilterer) FilterModelTierUpdate(opts *bind.FilterOpts, modelId []uint32) (*GPUManagerModelTierUpdateIterator, error) { var modelIdRule []interface{} for _, modelIdItem := range modelId { modelIdRule = append(modelIdRule, modelIdItem) } logs, sub, err := _GPUManager.contract.FilterLogs(opts, "ModelTierUpdate", modelIdRule) if err != nil { return nil, err } return &GPUManagerModelTierUpdateIterator{contract: _GPUManager.contract, event: "ModelTierUpdate", logs: logs, sub: sub}, nil } // WatchModelTierUpdate is a free log subscription operation binding the contract event 0x4ecbcd19e308970fa368644f223de37bf9800e203349b5873d83970277c30356. // // Solidity: event ModelTierUpdate(uint32 indexed modelId, uint32 tier) func (_GPUManager *GPUManagerFilterer) WatchModelTierUpdate(opts *bind.WatchOpts, sink chan<- *GPUManagerModelTierUpdate, modelId []uint32) (event.Subscription, error) { var modelIdRule []interface{} for _, modelIdItem := range modelId { modelIdRule = append(modelIdRule, modelIdItem) } logs, sub, err := _GPUManager.contract.WatchLogs(opts, "ModelTierUpdate", modelIdRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(GPUManagerModelTierUpdate) if err := _GPUManager.contract.UnpackLog(event, "ModelTierUpdate", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseModelTierUpdate is a log parse operation binding the contract event 0x4ecbcd19e308970fa368644f223de37bf9800e203349b5873d83970277c30356. // // Solidity: event ModelTierUpdate(uint32 indexed modelId, uint32 tier) func (_GPUManager *GPUManagerFilterer) ParseModelTierUpdate(log types.Log) (*GPUManagerModelTierUpdate, error) { event := new(GPUManagerModelTierUpdate) if err := _GPUManager.contract.UnpackLog(event, "ModelTierUpdate", log); err != nil { return nil, err } event.Raw = log return event, nil } // GPUManagerModelUnregistrationIterator is returned from FilterModelUnregistration and is used to iterate over the raw logs and unpacked data for ModelUnregistration events raised by the GPUManager contract. type GPUManagerModelUnregistrationIterator struct { Event *GPUManagerModelUnregistration // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *GPUManagerModelUnregistrationIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(GPUManagerModelUnregistration) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(GPUManagerModelUnregistration) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *GPUManagerModelUnregistrationIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *GPUManagerModelUnregistrationIterator) Close() error { it.sub.Unsubscribe() return nil } // GPUManagerModelUnregistration represents a ModelUnregistration event raised by the GPUManager contract. type GPUManagerModelUnregistration struct { ModelId uint32 Raw types.Log // Blockchain specific contextual infos } // FilterModelUnregistration is a free log retrieval operation binding the contract event 0x543408e7ce45c07531e494b8909d4d1b9dea7a8d8f5907b4673949a90fc56ba2. // // Solidity: event ModelUnregistration(uint32 indexed modelId) func (_GPUManager *GPUManagerFilterer) FilterModelUnregistration(opts *bind.FilterOpts, modelId []uint32) (*GPUManagerModelUnregistrationIterator, error) { var modelIdRule []interface{} for _, modelIdItem := range modelId { modelIdRule = append(modelIdRule, modelIdItem) } logs, sub, err := _GPUManager.contract.FilterLogs(opts, "ModelUnregistration", modelIdRule) if err != nil { return nil, err } return &GPUManagerModelUnregistrationIterator{contract: _GPUManager.contract, event: "ModelUnregistration", logs: logs, sub: sub}, nil } // WatchModelUnregistration is a free log subscription operation binding the contract event 0x543408e7ce45c07531e494b8909d4d1b9dea7a8d8f5907b4673949a90fc56ba2. // // Solidity: event ModelUnregistration(uint32 indexed modelId) func (_GPUManager *GPUManagerFilterer) WatchModelUnregistration(opts *bind.WatchOpts, sink chan<- *GPUManagerModelUnregistration, modelId []uint32) (event.Subscription, error) { var modelIdRule []interface{} for _, modelIdItem := range modelId { modelIdRule = append(modelIdRule, modelIdItem) } logs, sub, err := _GPUManager.contract.WatchLogs(opts, "ModelUnregistration", modelIdRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(GPUManagerModelUnregistration) if err := _GPUManager.contract.UnpackLog(event, "ModelUnregistration", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseModelUnregistration is a log parse operation binding the contract event 0x543408e7ce45c07531e494b8909d4d1b9dea7a8d8f5907b4673949a90fc56ba2. // // Solidity: event ModelUnregistration(uint32 indexed modelId) func (_GPUManager *GPUManagerFilterer) ParseModelUnregistration(log types.Log) (*GPUManagerModelUnregistration, error) { event := new(GPUManagerModelUnregistration) if err := _GPUManager.contract.UnpackLog(event, "ModelUnregistration", log); err != nil { return nil, err } event.Raw = log return event, nil } // GPUManagerOwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the GPUManager contract. type GPUManagerOwnershipTransferredIterator struct { Event *GPUManagerOwnershipTransferred // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *GPUManagerOwnershipTransferredIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(GPUManagerOwnershipTransferred) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(GPUManagerOwnershipTransferred) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *GPUManagerOwnershipTransferredIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *GPUManagerOwnershipTransferredIterator) Close() error { it.sub.Unsubscribe() return nil } // GPUManagerOwnershipTransferred represents a OwnershipTransferred event raised by the GPUManager contract. type GPUManagerOwnershipTransferred struct { PreviousOwner common.Address NewOwner common.Address Raw types.Log // Blockchain specific contextual infos } // FilterOwnershipTransferred is a free log retrieval operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. // // Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) func (_GPUManager *GPUManagerFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*GPUManagerOwnershipTransferredIterator, error) { var previousOwnerRule []interface{} for _, previousOwnerItem := range previousOwner { previousOwnerRule = append(previousOwnerRule, previousOwnerItem) } var newOwnerRule []interface{} for _, newOwnerItem := range newOwner { newOwnerRule = append(newOwnerRule, newOwnerItem) } logs, sub, err := _GPUManager.contract.FilterLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) if err != nil { return nil, err } return &GPUManagerOwnershipTransferredIterator{contract: _GPUManager.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil } // WatchOwnershipTransferred is a free log subscription operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. // // Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) func (_GPUManager *GPUManagerFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *GPUManagerOwnershipTransferred, previousOwner []common.Address, newOwner []common.Address) (event.Subscription, error) { var previousOwnerRule []interface{} for _, previousOwnerItem := range previousOwner { previousOwnerRule = append(previousOwnerRule, previousOwnerItem) } var newOwnerRule []interface{} for _, newOwnerItem := range newOwner { newOwnerRule = append(newOwnerRule, newOwnerItem) } logs, sub, err := _GPUManager.contract.WatchLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(GPUManagerOwnershipTransferred) if err := _GPUManager.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseOwnershipTransferred is a log parse operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. // // Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) func (_GPUManager *GPUManagerFilterer) ParseOwnershipTransferred(log types.Log) (*GPUManagerOwnershipTransferred, error) { event := new(GPUManagerOwnershipTransferred) if err := _GPUManager.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { return nil, err } event.Raw = log return event, nil } // GPUManagerPausedIterator is returned from FilterPaused and is used to iterate over the raw logs and unpacked data for Paused events raised by the GPUManager contract. type GPUManagerPausedIterator struct { Event *GPUManagerPaused // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *GPUManagerPausedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(GPUManagerPaused) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(GPUManagerPaused) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *GPUManagerPausedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *GPUManagerPausedIterator) Close() error { it.sub.Unsubscribe() return nil } // GPUManagerPaused represents a Paused event raised by the GPUManager contract. type GPUManagerPaused struct { Account common.Address Raw types.Log // Blockchain specific contextual infos } // FilterPaused is a free log retrieval operation binding the contract event 0x62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258. // // Solidity: event Paused(address account) func (_GPUManager *GPUManagerFilterer) FilterPaused(opts *bind.FilterOpts) (*GPUManagerPausedIterator, error) { logs, sub, err := _GPUManager.contract.FilterLogs(opts, "Paused") if err != nil { return nil, err } return &GPUManagerPausedIterator{contract: _GPUManager.contract, event: "Paused", logs: logs, sub: sub}, nil } // WatchPaused is a free log subscription operation binding the contract event 0x62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258. // // Solidity: event Paused(address account) func (_GPUManager *GPUManagerFilterer) WatchPaused(opts *bind.WatchOpts, sink chan<- *GPUManagerPaused) (event.Subscription, error) { logs, sub, err := _GPUManager.contract.WatchLogs(opts, "Paused") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(GPUManagerPaused) if err := _GPUManager.contract.UnpackLog(event, "Paused", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParsePaused is a log parse operation binding the contract event 0x62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258. // // Solidity: event Paused(address account) func (_GPUManager *GPUManagerFilterer) ParsePaused(log types.Log) (*GPUManagerPaused, error) { event := new(GPUManagerPaused) if err := _GPUManager.contract.UnpackLog(event, "Paused", log); err != nil { return nil, err } event.Raw = log return event, nil } // GPUManagerPenaltyDurationUpdatedIterator is returned from FilterPenaltyDurationUpdated and is used to iterate over the raw logs and unpacked data for PenaltyDurationUpdated events raised by the GPUManager contract. type GPUManagerPenaltyDurationUpdatedIterator struct { Event *GPUManagerPenaltyDurationUpdated // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *GPUManagerPenaltyDurationUpdatedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(GPUManagerPenaltyDurationUpdated) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(GPUManagerPenaltyDurationUpdated) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *GPUManagerPenaltyDurationUpdatedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *GPUManagerPenaltyDurationUpdatedIterator) Close() error { it.sub.Unsubscribe() return nil } // GPUManagerPenaltyDurationUpdated represents a PenaltyDurationUpdated event raised by the GPUManager contract. type GPUManagerPenaltyDurationUpdated struct { OldDuration *big.Int NewDuration *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterPenaltyDurationUpdated is a free log retrieval operation binding the contract event 0xf7a437a25c636d2b29d0ba34f0f6870af14f44478eff2ac852f36030f2e2924e. // // Solidity: event PenaltyDurationUpdated(uint40 oldDuration, uint40 newDuration) func (_GPUManager *GPUManagerFilterer) FilterPenaltyDurationUpdated(opts *bind.FilterOpts) (*GPUManagerPenaltyDurationUpdatedIterator, error) { logs, sub, err := _GPUManager.contract.FilterLogs(opts, "PenaltyDurationUpdated") if err != nil { return nil, err } return &GPUManagerPenaltyDurationUpdatedIterator{contract: _GPUManager.contract, event: "PenaltyDurationUpdated", logs: logs, sub: sub}, nil } // WatchPenaltyDurationUpdated is a free log subscription operation binding the contract event 0xf7a437a25c636d2b29d0ba34f0f6870af14f44478eff2ac852f36030f2e2924e. // // Solidity: event PenaltyDurationUpdated(uint40 oldDuration, uint40 newDuration) func (_GPUManager *GPUManagerFilterer) WatchPenaltyDurationUpdated(opts *bind.WatchOpts, sink chan<- *GPUManagerPenaltyDurationUpdated) (event.Subscription, error) { logs, sub, err := _GPUManager.contract.WatchLogs(opts, "PenaltyDurationUpdated") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(GPUManagerPenaltyDurationUpdated) if err := _GPUManager.contract.UnpackLog(event, "PenaltyDurationUpdated", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParsePenaltyDurationUpdated is a log parse operation binding the contract event 0xf7a437a25c636d2b29d0ba34f0f6870af14f44478eff2ac852f36030f2e2924e. // // Solidity: event PenaltyDurationUpdated(uint40 oldDuration, uint40 newDuration) func (_GPUManager *GPUManagerFilterer) ParsePenaltyDurationUpdated(log types.Log) (*GPUManagerPenaltyDurationUpdated, error) { event := new(GPUManagerPenaltyDurationUpdated) if err := _GPUManager.contract.UnpackLog(event, "PenaltyDurationUpdated", log); err != nil { return nil, err } event.Raw = log return event, nil } // GPUManagerRestakeIterator is returned from FilterRestake and is used to iterate over the raw logs and unpacked data for Restake events raised by the GPUManager contract. type GPUManagerRestakeIterator struct { Event *GPUManagerRestake // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *GPUManagerRestakeIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(GPUManagerRestake) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(GPUManagerRestake) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *GPUManagerRestakeIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *GPUManagerRestakeIterator) Close() error { it.sub.Unsubscribe() return nil } // GPUManagerRestake represents a Restake event raised by the GPUManager contract. type GPUManagerRestake struct { Miner common.Address ModelId uint32 Restake *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterRestake is a free log retrieval operation binding the contract event 0xd71961af2f46a633dc473cc0dda9e08783282fdb38c8f90482a143eb63b039e0. // // Solidity: event Restake(address indexed miner, uint32 indexed modelId, uint256 restake) func (_GPUManager *GPUManagerFilterer) FilterRestake(opts *bind.FilterOpts, miner []common.Address, modelId []uint32) (*GPUManagerRestakeIterator, error) { var minerRule []interface{} for _, minerItem := range miner { minerRule = append(minerRule, minerItem) } var modelIdRule []interface{} for _, modelIdItem := range modelId { modelIdRule = append(modelIdRule, modelIdItem) } logs, sub, err := _GPUManager.contract.FilterLogs(opts, "Restake", minerRule, modelIdRule) if err != nil { return nil, err } return &GPUManagerRestakeIterator{contract: _GPUManager.contract, event: "Restake", logs: logs, sub: sub}, nil } // WatchRestake is a free log subscription operation binding the contract event 0xd71961af2f46a633dc473cc0dda9e08783282fdb38c8f90482a143eb63b039e0. // // Solidity: event Restake(address indexed miner, uint32 indexed modelId, uint256 restake) func (_GPUManager *GPUManagerFilterer) WatchRestake(opts *bind.WatchOpts, sink chan<- *GPUManagerRestake, miner []common.Address, modelId []uint32) (event.Subscription, error) { var minerRule []interface{} for _, minerItem := range miner { minerRule = append(minerRule, minerItem) } var modelIdRule []interface{} for _, modelIdItem := range modelId { modelIdRule = append(modelIdRule, modelIdItem) } logs, sub, err := _GPUManager.contract.WatchLogs(opts, "Restake", minerRule, modelIdRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(GPUManagerRestake) if err := _GPUManager.contract.UnpackLog(event, "Restake", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseRestake is a log parse operation binding the contract event 0xd71961af2f46a633dc473cc0dda9e08783282fdb38c8f90482a143eb63b039e0. // // Solidity: event Restake(address indexed miner, uint32 indexed modelId, uint256 restake) func (_GPUManager *GPUManagerFilterer) ParseRestake(log types.Log) (*GPUManagerRestake, error) { event := new(GPUManagerRestake) if err := _GPUManager.contract.UnpackLog(event, "Restake", log); err != nil { return nil, err } event.Raw = log return event, nil } // GPUManagerRewardClaimIterator is returned from FilterRewardClaim and is used to iterate over the raw logs and unpacked data for RewardClaim events raised by the GPUManager contract. type GPUManagerRewardClaimIterator struct { Event *GPUManagerRewardClaim // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *GPUManagerRewardClaimIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(GPUManagerRewardClaim) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(GPUManagerRewardClaim) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *GPUManagerRewardClaimIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *GPUManagerRewardClaimIterator) Close() error { it.sub.Unsubscribe() return nil } // GPUManagerRewardClaim represents a RewardClaim event raised by the GPUManager contract. type GPUManagerRewardClaim struct { Worker common.Address Value *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterRewardClaim is a free log retrieval operation binding the contract event 0x75690555e75b04e280e646889defdcbefd8401507e5394d1173fd84290944c29. // // Solidity: event RewardClaim(address indexed worker, uint256 value) func (_GPUManager *GPUManagerFilterer) FilterRewardClaim(opts *bind.FilterOpts, worker []common.Address) (*GPUManagerRewardClaimIterator, error) { var workerRule []interface{} for _, workerItem := range worker { workerRule = append(workerRule, workerItem) } logs, sub, err := _GPUManager.contract.FilterLogs(opts, "RewardClaim", workerRule) if err != nil { return nil, err } return &GPUManagerRewardClaimIterator{contract: _GPUManager.contract, event: "RewardClaim", logs: logs, sub: sub}, nil } // WatchRewardClaim is a free log subscription operation binding the contract event 0x75690555e75b04e280e646889defdcbefd8401507e5394d1173fd84290944c29. // // Solidity: event RewardClaim(address indexed worker, uint256 value) func (_GPUManager *GPUManagerFilterer) WatchRewardClaim(opts *bind.WatchOpts, sink chan<- *GPUManagerRewardClaim, worker []common.Address) (event.Subscription, error) { var workerRule []interface{} for _, workerItem := range worker { workerRule = append(workerRule, workerItem) } logs, sub, err := _GPUManager.contract.WatchLogs(opts, "RewardClaim", workerRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(GPUManagerRewardClaim) if err := _GPUManager.contract.UnpackLog(event, "RewardClaim", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseRewardClaim is a log parse operation binding the contract event 0x75690555e75b04e280e646889defdcbefd8401507e5394d1173fd84290944c29. // // Solidity: event RewardClaim(address indexed worker, uint256 value) func (_GPUManager *GPUManagerFilterer) ParseRewardClaim(log types.Log) (*GPUManagerRewardClaim, error) { event := new(GPUManagerRewardClaim) if err := _GPUManager.contract.UnpackLog(event, "RewardClaim", log); err != nil { return nil, err } event.Raw = log return event, nil } // GPUManagerRewardPerEpochIterator is returned from FilterRewardPerEpoch and is used to iterate over the raw logs and unpacked data for RewardPerEpoch events raised by the GPUManager contract. type GPUManagerRewardPerEpochIterator struct { Event *GPUManagerRewardPerEpoch // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *GPUManagerRewardPerEpochIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(GPUManagerRewardPerEpoch) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(GPUManagerRewardPerEpoch) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *GPUManagerRewardPerEpochIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *GPUManagerRewardPerEpochIterator) Close() error { it.sub.Unsubscribe() return nil } // GPUManagerRewardPerEpoch represents a RewardPerEpoch event raised by the GPUManager contract. type GPUManagerRewardPerEpoch struct { OldReward *big.Int NewReward *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterRewardPerEpoch is a free log retrieval operation binding the contract event 0x3d731857045dfa7982ed8ff308eeda54c7e156ba99609db02c50b4485f64c463. // // Solidity: event RewardPerEpoch(uint256 oldReward, uint256 newReward) func (_GPUManager *GPUManagerFilterer) FilterRewardPerEpoch(opts *bind.FilterOpts) (*GPUManagerRewardPerEpochIterator, error) { logs, sub, err := _GPUManager.contract.FilterLogs(opts, "RewardPerEpoch") if err != nil { return nil, err } return &GPUManagerRewardPerEpochIterator{contract: _GPUManager.contract, event: "RewardPerEpoch", logs: logs, sub: sub}, nil } // WatchRewardPerEpoch is a free log subscription operation binding the contract event 0x3d731857045dfa7982ed8ff308eeda54c7e156ba99609db02c50b4485f64c463. // // Solidity: event RewardPerEpoch(uint256 oldReward, uint256 newReward) func (_GPUManager *GPUManagerFilterer) WatchRewardPerEpoch(opts *bind.WatchOpts, sink chan<- *GPUManagerRewardPerEpoch) (event.Subscription, error) { logs, sub, err := _GPUManager.contract.WatchLogs(opts, "RewardPerEpoch") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(GPUManagerRewardPerEpoch) if err := _GPUManager.contract.UnpackLog(event, "RewardPerEpoch", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseRewardPerEpoch is a log parse operation binding the contract event 0x3d731857045dfa7982ed8ff308eeda54c7e156ba99609db02c50b4485f64c463. // // Solidity: event RewardPerEpoch(uint256 oldReward, uint256 newReward) func (_GPUManager *GPUManagerFilterer) ParseRewardPerEpoch(log types.Log) (*GPUManagerRewardPerEpoch, error) { event := new(GPUManagerRewardPerEpoch) if err := _GPUManager.contract.UnpackLog(event, "RewardPerEpoch", log); err != nil { return nil, err } event.Raw = log return event, nil } // GPUManagerUnpausedIterator is returned from FilterUnpaused and is used to iterate over the raw logs and unpacked data for Unpaused events raised by the GPUManager contract. type GPUManagerUnpausedIterator struct { Event *GPUManagerUnpaused // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *GPUManagerUnpausedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(GPUManagerUnpaused) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(GPUManagerUnpaused) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *GPUManagerUnpausedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *GPUManagerUnpausedIterator) Close() error { it.sub.Unsubscribe() return nil } // GPUManagerUnpaused represents a Unpaused event raised by the GPUManager contract. type GPUManagerUnpaused struct { Account common.Address Raw types.Log // Blockchain specific contextual infos } // FilterUnpaused is a free log retrieval operation binding the contract event 0x5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa. // // Solidity: event Unpaused(address account) func (_GPUManager *GPUManagerFilterer) FilterUnpaused(opts *bind.FilterOpts) (*GPUManagerUnpausedIterator, error) { logs, sub, err := _GPUManager.contract.FilterLogs(opts, "Unpaused") if err != nil { return nil, err } return &GPUManagerUnpausedIterator{contract: _GPUManager.contract, event: "Unpaused", logs: logs, sub: sub}, nil } // WatchUnpaused is a free log subscription operation binding the contract event 0x5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa. // // Solidity: event Unpaused(address account) func (_GPUManager *GPUManagerFilterer) WatchUnpaused(opts *bind.WatchOpts, sink chan<- *GPUManagerUnpaused) (event.Subscription, error) { logs, sub, err := _GPUManager.contract.WatchLogs(opts, "Unpaused") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(GPUManagerUnpaused) if err := _GPUManager.contract.UnpackLog(event, "Unpaused", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseUnpaused is a log parse operation binding the contract event 0x5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa. // // Solidity: event Unpaused(address account) func (_GPUManager *GPUManagerFilterer) ParseUnpaused(log types.Log) (*GPUManagerUnpaused, error) { event := new(GPUManagerUnpaused) if err := _GPUManager.contract.UnpackLog(event, "Unpaused", log); err != nil { return nil, err } event.Raw = log return event, nil } // GPUManagerUnstakeDelayTimeIterator is returned from FilterUnstakeDelayTime and is used to iterate over the raw logs and unpacked data for UnstakeDelayTime events raised by the GPUManager contract. type GPUManagerUnstakeDelayTimeIterator struct { Event *GPUManagerUnstakeDelayTime // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *GPUManagerUnstakeDelayTimeIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(GPUManagerUnstakeDelayTime) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(GPUManagerUnstakeDelayTime) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *GPUManagerUnstakeDelayTimeIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *GPUManagerUnstakeDelayTimeIterator) Close() error { it.sub.Unsubscribe() return nil } // GPUManagerUnstakeDelayTime represents a UnstakeDelayTime event raised by the GPUManager contract. type GPUManagerUnstakeDelayTime struct { OldDelayTime *big.Int NewDelayTime *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterUnstakeDelayTime is a free log retrieval operation binding the contract event 0xdf63c46e5024e57c66aafc6698e317c78589c870dca694678c89dd379c5fd490. // // Solidity: event UnstakeDelayTime(uint256 oldDelayTime, uint256 newDelayTime) func (_GPUManager *GPUManagerFilterer) FilterUnstakeDelayTime(opts *bind.FilterOpts) (*GPUManagerUnstakeDelayTimeIterator, error) { logs, sub, err := _GPUManager.contract.FilterLogs(opts, "UnstakeDelayTime") if err != nil { return nil, err } return &GPUManagerUnstakeDelayTimeIterator{contract: _GPUManager.contract, event: "UnstakeDelayTime", logs: logs, sub: sub}, nil } // WatchUnstakeDelayTime is a free log subscription operation binding the contract event 0xdf63c46e5024e57c66aafc6698e317c78589c870dca694678c89dd379c5fd490. // // Solidity: event UnstakeDelayTime(uint256 oldDelayTime, uint256 newDelayTime) func (_GPUManager *GPUManagerFilterer) WatchUnstakeDelayTime(opts *bind.WatchOpts, sink chan<- *GPUManagerUnstakeDelayTime) (event.Subscription, error) { logs, sub, err := _GPUManager.contract.WatchLogs(opts, "UnstakeDelayTime") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(GPUManagerUnstakeDelayTime) if err := _GPUManager.contract.UnpackLog(event, "UnstakeDelayTime", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseUnstakeDelayTime is a log parse operation binding the contract event 0xdf63c46e5024e57c66aafc6698e317c78589c870dca694678c89dd379c5fd490. // // Solidity: event UnstakeDelayTime(uint256 oldDelayTime, uint256 newDelayTime) func (_GPUManager *GPUManagerFilterer) ParseUnstakeDelayTime(log types.Log) (*GPUManagerUnstakeDelayTime, error) { event := new(GPUManagerUnstakeDelayTime) if err := _GPUManager.contract.UnpackLog(event, "UnstakeDelayTime", log); err != nil { return nil, err } event.Raw = log return event, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/binds/gpumanager/abi.json ================================================ [ { "inputs": [ { "internalType": "address", "name": "value", "type": "address" } ], "name": "AddressSet_DuplicatedValue", "type": "error" }, { "inputs": [ { "internalType": "address", "name": "value", "type": "address" } ], "name": "AddressSet_ValueNotFound", "type": "error" }, { "inputs": [], "name": "AlreadyRegistered", "type": "error" }, { "inputs": [], "name": "FailedTransfer", "type": "error" }, { "inputs": [], "name": "FeeTooLow", "type": "error" }, { "inputs": [], "name": "InvalidAddress", "type": "error" }, { "inputs": [], "name": "InvalidBlockValue", "type": "error" }, { "inputs": [], "name": "InvalidMiner", "type": "error" }, { "inputs": [], "name": "InvalidModel", "type": "error" }, { "inputs": [], "name": "InvalidTier", "type": "error" }, { "inputs": [], "name": "InvalidValue", "type": "error" }, { "inputs": [], "name": "MinerInDeactivationTime", "type": "error" }, { "inputs": [], "name": "NotEnoughMiners", "type": "error" }, { "inputs": [], "name": "NotRegistered", "type": "error" }, { "inputs": [], "name": "SameModelAddress", "type": "error" }, { "inputs": [], "name": "StakeTooLow", "type": "error" }, { "inputs": [], "name": "StillBeingLocked", "type": "error" }, { "inputs": [ { "internalType": "uint256", "name": "value", "type": "uint256" } ], "name": "Uint256Set_DuplicatedValue", "type": "error" }, { "inputs": [ { "internalType": "uint256", "name": "value", "type": "uint256" } ], "name": "Uint256Set_ValueNotFound", "type": "error" }, { "inputs": [], "name": "ZeroValue", "type": "error" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "uint256", "name": "oldBlocks", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "newBlocks", "type": "uint256" } ], "name": "BlocksPerEpoch", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "uint16", "name": "oldPercent", "type": "uint16" }, { "indexed": false, "internalType": "uint16", "name": "newPercent", "type": "uint16" } ], "name": "FinePercentageUpdated", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "miner", "type": "address" }, { "indexed": true, "internalType": "uint32", "name": "modelId", "type": "uint32" }, { "indexed": true, "internalType": "address", "name": "treasury", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "fine", "type": "uint256" } ], "name": "FraudulentMinerPenalized", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "uint8", "name": "version", "type": "uint8" } ], "name": "Initialized", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "uint256", "name": "oldValue", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "newValue", "type": "uint256" } ], "name": "MinFeeToUseUpdated", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "miner", "type": "address" }, { "indexed": true, "internalType": "uint32", "name": "modelId", "type": "uint32" }, { "indexed": false, "internalType": "uint40", "name": "activeTime", "type": "uint40" } ], "name": "MinerDeactivated", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "miner", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "value", "type": "uint256" } ], "name": "MinerExtraStake", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "miner", "type": "address" } ], "name": "MinerJoin", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "miner", "type": "address" }, { "indexed": true, "internalType": "uint16", "name": "tier", "type": "uint16" }, { "indexed": false, "internalType": "uint256", "name": "value", "type": "uint256" } ], "name": "MinerRegistration", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "miner", "type": "address" } ], "name": "MinerUnregistration", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "miner", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "stake", "type": "uint256" } ], "name": "MinerUnstake", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "uint32", "name": "modelId", "type": "uint32" }, { "indexed": false, "internalType": "uint256", "name": "minimumFee", "type": "uint256" } ], "name": "ModelMinimumFeeUpdate", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "uint32", "name": "modelId", "type": "uint32" }, { "indexed": true, "internalType": "uint16", "name": "tier", "type": "uint16" }, { "indexed": false, "internalType": "uint256", "name": "minimumFee", "type": "uint256" } ], "name": "ModelRegistration", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "uint32", "name": "modelId", "type": "uint32" }, { "indexed": false, "internalType": "uint32", "name": "tier", "type": "uint32" } ], "name": "ModelTierUpdate", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "uint32", "name": "modelId", "type": "uint32" } ], "name": "ModelUnregistration", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "previousOwner", "type": "address" }, { "indexed": true, "internalType": "address", "name": "newOwner", "type": "address" } ], "name": "OwnershipTransferred", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "address", "name": "account", "type": "address" } ], "name": "Paused", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "uint40", "name": "oldDuration", "type": "uint40" }, { "indexed": false, "internalType": "uint40", "name": "newDuration", "type": "uint40" } ], "name": "PenaltyDurationUpdated", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "miner", "type": "address" }, { "indexed": true, "internalType": "uint32", "name": "modelId", "type": "uint32" }, { "indexed": false, "internalType": "uint256", "name": "restake", "type": "uint256" } ], "name": "Restake", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "worker", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "value", "type": "uint256" } ], "name": "RewardClaim", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "uint256", "name": "oldReward", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "newReward", "type": "uint256" } ], "name": "RewardPerEpoch", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "address", "name": "account", "type": "address" } ], "name": "Unpaused", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "uint256", "name": "oldDelayTime", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "newDelayTime", "type": "uint256" } ], "name": "UnstakeDelayTime", "type": "event" }, { "inputs": [], "name": "_blocksPerEpoch", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "_currentEpoch", "outputs": [ { "internalType": "uint40", "name": "", "type": "uint40" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "_finePercentage", "outputs": [ { "internalType": "uint16", "name": "", "type": "uint16" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "_lastBlock", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "_maximumTier", "outputs": [ { "internalType": "uint16", "name": "", "type": "uint16" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "_minFeeToUse", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "_minerMinimumStake", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "", "type": "address" } ], "name": "_minerUnstakeRequests", "outputs": [ { "internalType": "uint256", "name": "stake", "type": "uint256" }, { "internalType": "uint40", "name": "unlockAt", "type": "uint40" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "", "type": "address" } ], "name": "_miners", "outputs": [ { "internalType": "uint256", "name": "stake", "type": "uint256" }, { "internalType": "uint32", "name": "modelId", "type": "uint32" }, { "internalType": "uint40", "name": "lastClaimedEpoch", "type": "uint40" }, { "internalType": "uint40", "name": "activeTime", "type": "uint40" }, { "internalType": "uint16", "name": "tier", "type": "uint16" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "_modelCollection", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint32", "name": "", "type": "uint32" } ], "name": "_models", "outputs": [ { "internalType": "uint256", "name": "minimumFee", "type": "uint256" }, { "internalType": "uint32", "name": "tier", "type": "uint32" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "_penaltyDuration", "outputs": [ { "internalType": "uint40", "name": "", "type": "uint40" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "_promptScheduler", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "name": "_rewardInEpoch", "outputs": [ { "internalType": "uint256", "name": "perfReward", "type": "uint256" }, { "internalType": "uint256", "name": "epochReward", "type": "uint256" }, { "internalType": "uint256", "name": "totalTaskCompleted", "type": "uint256" }, { "internalType": "uint256", "name": "totalMiner", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "_rewardPerEpoch", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "_treasury", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "_unstakeDelayTime", "outputs": [ { "internalType": "uint40", "name": "", "type": "uint40" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "_wEAIToken", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "miner", "type": "address" } ], "name": "claimReward", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "miner", "type": "address" }, { "internalType": "uint32", "name": "modelId", "type": "uint32" } ], "name": "forceChangeModelForMiner", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "getAllMinerUnstakeRequests", "outputs": [ { "internalType": "address[]", "name": "unstakeAddresses", "type": "address[]" }, { "components": [ { "internalType": "uint256", "name": "stake", "type": "uint256" }, { "internalType": "uint40", "name": "unlockAt", "type": "uint40" } ], "internalType": "struct IGPUManager.UnstakeRequest[]", "name": "unstakeRequests", "type": "tuple[]" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint32", "name": "modelId", "type": "uint32" } ], "name": "getMinFeeToUse", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "getMinerAddresses", "outputs": [ { "internalType": "address[]", "name": "", "type": "address[]" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint32", "name": "modelId", "type": "uint32" } ], "name": "getMinerAddressesOfModel", "outputs": [ { "internalType": "address[]", "name": "", "type": "address[]" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "getModelIds", "outputs": [ { "internalType": "uint256[]", "name": "", "type": "uint256[]" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint32", "name": "modelId", "type": "uint32" } ], "name": "getModelInfo", "outputs": [ { "components": [ { "internalType": "uint256", "name": "minimumFee", "type": "uint256" }, { "internalType": "uint32", "name": "tier", "type": "uint32" } ], "internalType": "struct IGPUManager.Model", "name": "", "type": "tuple" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "getNOMiner", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "wEAIAmt", "type": "uint256" } ], "name": "increaseMinerStake", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "wEAIToken_", "type": "address" }, { "internalType": "address", "name": "modelCollection_", "type": "address" }, { "internalType": "address", "name": "treasury_", "type": "address" }, { "internalType": "uint256", "name": "minerMinimumStake_", "type": "uint256" }, { "internalType": "uint256", "name": "blocksPerEpoch_", "type": "uint256" }, { "internalType": "uint256", "name": "rewardPerEpoch_", "type": "uint256" }, { "internalType": "uint40", "name": "unstakeDelayTime_", "type": "uint40" }, { "internalType": "uint40", "name": "penaltyDuration_", "type": "uint40" }, { "internalType": "uint16", "name": "finePercentage_", "type": "uint16" }, { "internalType": "uint256", "name": "minFeeToUse_", "type": "uint256" } ], "name": "initialize", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint32", "name": "modelId", "type": "uint32" } ], "name": "isActiveModel", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "joinForMinting", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "miner", "type": "address" } ], "name": "multiplier", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "owner", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "paused", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint16", "name": "tier", "type": "uint16" } ], "name": "registerMiner", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint16", "name": "tier", "type": "uint16" }, { "internalType": "uint32", "name": "modelId", "type": "uint32" } ], "name": "registerMiner", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint32", "name": "modelId", "type": "uint32" }, { "internalType": "uint16", "name": "tier", "type": "uint16" }, { "internalType": "uint256", "name": "minimumFee", "type": "uint256" } ], "name": "registerModel", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "renounceOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint16", "name": "tier", "type": "uint16" } ], "name": "restakeForMiner", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "miner", "type": "address" } ], "name": "rewardToClaim", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "blocks", "type": "uint256" } ], "name": "setBlocksPerEpoch", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint16", "name": "newPercentage", "type": "uint16" } ], "name": "setFinePercentage", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "minFee", "type": "uint256" } ], "name": "setMinFeeToUse", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "_minerMinimumStake", "type": "uint256" } ], "name": "setMinerMinimumStake", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "newReward", "type": "uint256" } ], "name": "setNewRewardInEpoch", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint40", "name": "duration", "type": "uint40" } ], "name": "setPenaltyDuration", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "newPromptScheduler", "type": "address" } ], "name": "setPromptSchedulerAddress", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint40", "name": "delayTime", "type": "uint40" } ], "name": "setUnstakeDelayTime", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "wEAIToken", "type": "address" } ], "name": "setWEAIAddress", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "miner", "type": "address" }, { "internalType": "bool", "name": "isFined", "type": "bool" } ], "name": "slashMiner", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "newOwner", "type": "address" } ], "name": "transferOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "unregisterMiner", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint32", "name": "modelId", "type": "uint32" } ], "name": "unregisterModel", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "unstakeForMiner", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "updateEpoch", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint32", "name": "modelId", "type": "uint32" }, { "internalType": "uint256", "name": "minimumFee", "type": "uint256" } ], "name": "updateModelMinimumFee", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint32", "name": "modelId", "type": "uint32" }, { "internalType": "uint32", "name": "tier", "type": "uint32" } ], "name": "updateModelTier", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "miner", "type": "address" } ], "name": "validateMiner", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint32", "name": "modelId", "type": "uint32" }, { "internalType": "uint256", "name": "minersRequired", "type": "uint256" } ], "name": "validateModelAndChooseRandomMiner", "outputs": [ { "internalType": "address", "name": "", "type": "address" }, { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "nonpayable", "type": "function" }, { "stateMutability": "payable", "type": "receive" } ] ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/binds/iagenttokendeployer/IAGENTTokenDeployer.go ================================================ // Code generated - DO NOT EDIT. // This file is a generated binding and any manual changes will be lost. package iagenttokendeployer import ( "errors" "math/big" "strings" ethereum "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/event" ) // Reference imports to suppress errors if they are not otherwise used. var ( _ = errors.New _ = big.NewInt _ = strings.NewReader _ = ethereum.NotFound _ = bind.Bind _ = common.Big1 _ = types.BloomLookup _ = event.NewSubscription _ = abi.ConvertType ) // IAGENTTokenDeployerMetaData contains all meta data concerning the IAGENTTokenDeployer contract. var IAGENTTokenDeployerMetaData = &bind.MetaData{ ABI: "[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"salt\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"AGENTTokenCreated\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"callWithValue\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"salt\",\"type\":\"bytes32\"},{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"symbol\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"createToken\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"salt\",\"type\":\"bytes32\"}],\"name\":\"getToken\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes[]\",\"name\":\"data\",\"type\":\"bytes[]\"}],\"name\":\"multicall\",\"outputs\":[{\"internalType\":\"bytes[]\",\"name\":\"results\",\"type\":\"bytes[]\"}],\"stateMutability\":\"payable\",\"type\":\"function\"}]", } // IAGENTTokenDeployerABI is the input ABI used to generate the binding from. // Deprecated: Use IAGENTTokenDeployerMetaData.ABI instead. var IAGENTTokenDeployerABI = IAGENTTokenDeployerMetaData.ABI // IAGENTTokenDeployer is an auto generated Go binding around an Ethereum contract. type IAGENTTokenDeployer struct { IAGENTTokenDeployerCaller // Read-only binding to the contract IAGENTTokenDeployerTransactor // Write-only binding to the contract IAGENTTokenDeployerFilterer // Log filterer for contract events } // IAGENTTokenDeployerCaller is an auto generated read-only Go binding around an Ethereum contract. type IAGENTTokenDeployerCaller struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // IAGENTTokenDeployerTransactor is an auto generated write-only Go binding around an Ethereum contract. type IAGENTTokenDeployerTransactor struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // IAGENTTokenDeployerFilterer is an auto generated log filtering Go binding around an Ethereum contract events. type IAGENTTokenDeployerFilterer struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // IAGENTTokenDeployerSession is an auto generated Go binding around an Ethereum contract, // with pre-set call and transact options. type IAGENTTokenDeployerSession struct { Contract *IAGENTTokenDeployer // Generic contract binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // IAGENTTokenDeployerCallerSession is an auto generated read-only Go binding around an Ethereum contract, // with pre-set call options. type IAGENTTokenDeployerCallerSession struct { Contract *IAGENTTokenDeployerCaller // Generic contract caller binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session } // IAGENTTokenDeployerTransactorSession is an auto generated write-only Go binding around an Ethereum contract, // with pre-set transact options. type IAGENTTokenDeployerTransactorSession struct { Contract *IAGENTTokenDeployerTransactor // Generic contract transactor binding to set the session for TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // IAGENTTokenDeployerRaw is an auto generated low-level Go binding around an Ethereum contract. type IAGENTTokenDeployerRaw struct { Contract *IAGENTTokenDeployer // Generic contract binding to access the raw methods on } // IAGENTTokenDeployerCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. type IAGENTTokenDeployerCallerRaw struct { Contract *IAGENTTokenDeployerCaller // Generic read-only contract binding to access the raw methods on } // IAGENTTokenDeployerTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. type IAGENTTokenDeployerTransactorRaw struct { Contract *IAGENTTokenDeployerTransactor // Generic write-only contract binding to access the raw methods on } // NewIAGENTTokenDeployer creates a new instance of IAGENTTokenDeployer, bound to a specific deployed contract. func NewIAGENTTokenDeployer(address common.Address, backend bind.ContractBackend) (*IAGENTTokenDeployer, error) { contract, err := bindIAGENTTokenDeployer(address, backend, backend, backend) if err != nil { return nil, err } return &IAGENTTokenDeployer{IAGENTTokenDeployerCaller: IAGENTTokenDeployerCaller{contract: contract}, IAGENTTokenDeployerTransactor: IAGENTTokenDeployerTransactor{contract: contract}, IAGENTTokenDeployerFilterer: IAGENTTokenDeployerFilterer{contract: contract}}, nil } // NewIAGENTTokenDeployerCaller creates a new read-only instance of IAGENTTokenDeployer, bound to a specific deployed contract. func NewIAGENTTokenDeployerCaller(address common.Address, caller bind.ContractCaller) (*IAGENTTokenDeployerCaller, error) { contract, err := bindIAGENTTokenDeployer(address, caller, nil, nil) if err != nil { return nil, err } return &IAGENTTokenDeployerCaller{contract: contract}, nil } // NewIAGENTTokenDeployerTransactor creates a new write-only instance of IAGENTTokenDeployer, bound to a specific deployed contract. func NewIAGENTTokenDeployerTransactor(address common.Address, transactor bind.ContractTransactor) (*IAGENTTokenDeployerTransactor, error) { contract, err := bindIAGENTTokenDeployer(address, nil, transactor, nil) if err != nil { return nil, err } return &IAGENTTokenDeployerTransactor{contract: contract}, nil } // NewIAGENTTokenDeployerFilterer creates a new log filterer instance of IAGENTTokenDeployer, bound to a specific deployed contract. func NewIAGENTTokenDeployerFilterer(address common.Address, filterer bind.ContractFilterer) (*IAGENTTokenDeployerFilterer, error) { contract, err := bindIAGENTTokenDeployer(address, nil, nil, filterer) if err != nil { return nil, err } return &IAGENTTokenDeployerFilterer{contract: contract}, nil } // bindIAGENTTokenDeployer binds a generic wrapper to an already deployed contract. func bindIAGENTTokenDeployer(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { parsed, err := IAGENTTokenDeployerMetaData.GetAbi() if err != nil { return nil, err } return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_IAGENTTokenDeployer *IAGENTTokenDeployerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _IAGENTTokenDeployer.Contract.IAGENTTokenDeployerCaller.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_IAGENTTokenDeployer *IAGENTTokenDeployerRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _IAGENTTokenDeployer.Contract.IAGENTTokenDeployerTransactor.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_IAGENTTokenDeployer *IAGENTTokenDeployerRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _IAGENTTokenDeployer.Contract.IAGENTTokenDeployerTransactor.contract.Transact(opts, method, params...) } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_IAGENTTokenDeployer *IAGENTTokenDeployerCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _IAGENTTokenDeployer.Contract.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_IAGENTTokenDeployer *IAGENTTokenDeployerTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _IAGENTTokenDeployer.Contract.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_IAGENTTokenDeployer *IAGENTTokenDeployerTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _IAGENTTokenDeployer.Contract.contract.Transact(opts, method, params...) } // GetToken is a free data retrieval call binding the contract method 0x155bf4e2. // // Solidity: function getToken(bytes32 salt) view returns(address) func (_IAGENTTokenDeployer *IAGENTTokenDeployerCaller) GetToken(opts *bind.CallOpts, salt [32]byte) (common.Address, error) { var out []interface{} err := _IAGENTTokenDeployer.contract.Call(opts, &out, "getToken", salt) if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // GetToken is a free data retrieval call binding the contract method 0x155bf4e2. // // Solidity: function getToken(bytes32 salt) view returns(address) func (_IAGENTTokenDeployer *IAGENTTokenDeployerSession) GetToken(salt [32]byte) (common.Address, error) { return _IAGENTTokenDeployer.Contract.GetToken(&_IAGENTTokenDeployer.CallOpts, salt) } // GetToken is a free data retrieval call binding the contract method 0x155bf4e2. // // Solidity: function getToken(bytes32 salt) view returns(address) func (_IAGENTTokenDeployer *IAGENTTokenDeployerCallerSession) GetToken(salt [32]byte) (common.Address, error) { return _IAGENTTokenDeployer.Contract.GetToken(&_IAGENTTokenDeployer.CallOpts, salt) } // CallWithValue is a paid mutator transaction binding the contract method 0x04ac018a. // // Solidity: function callWithValue(address target, bytes data, uint256 value) payable returns(bytes) func (_IAGENTTokenDeployer *IAGENTTokenDeployerTransactor) CallWithValue(opts *bind.TransactOpts, target common.Address, data []byte, value *big.Int) (*types.Transaction, error) { return _IAGENTTokenDeployer.contract.Transact(opts, "callWithValue", target, data, value) } // CallWithValue is a paid mutator transaction binding the contract method 0x04ac018a. // // Solidity: function callWithValue(address target, bytes data, uint256 value) payable returns(bytes) func (_IAGENTTokenDeployer *IAGENTTokenDeployerSession) CallWithValue(target common.Address, data []byte, value *big.Int) (*types.Transaction, error) { return _IAGENTTokenDeployer.Contract.CallWithValue(&_IAGENTTokenDeployer.TransactOpts, target, data, value) } // CallWithValue is a paid mutator transaction binding the contract method 0x04ac018a. // // Solidity: function callWithValue(address target, bytes data, uint256 value) payable returns(bytes) func (_IAGENTTokenDeployer *IAGENTTokenDeployerTransactorSession) CallWithValue(target common.Address, data []byte, value *big.Int) (*types.Transaction, error) { return _IAGENTTokenDeployer.Contract.CallWithValue(&_IAGENTTokenDeployer.TransactOpts, target, data, value) } // CreateToken is a paid mutator transaction binding the contract method 0x0f99f157. // // Solidity: function createToken(bytes32 salt, string name, string symbol, uint256 amount) payable returns(address) func (_IAGENTTokenDeployer *IAGENTTokenDeployerTransactor) CreateToken(opts *bind.TransactOpts, salt [32]byte, name string, symbol string, amount *big.Int) (*types.Transaction, error) { return _IAGENTTokenDeployer.contract.Transact(opts, "createToken", salt, name, symbol, amount) } // CreateToken is a paid mutator transaction binding the contract method 0x0f99f157. // // Solidity: function createToken(bytes32 salt, string name, string symbol, uint256 amount) payable returns(address) func (_IAGENTTokenDeployer *IAGENTTokenDeployerSession) CreateToken(salt [32]byte, name string, symbol string, amount *big.Int) (*types.Transaction, error) { return _IAGENTTokenDeployer.Contract.CreateToken(&_IAGENTTokenDeployer.TransactOpts, salt, name, symbol, amount) } // CreateToken is a paid mutator transaction binding the contract method 0x0f99f157. // // Solidity: function createToken(bytes32 salt, string name, string symbol, uint256 amount) payable returns(address) func (_IAGENTTokenDeployer *IAGENTTokenDeployerTransactorSession) CreateToken(salt [32]byte, name string, symbol string, amount *big.Int) (*types.Transaction, error) { return _IAGENTTokenDeployer.Contract.CreateToken(&_IAGENTTokenDeployer.TransactOpts, salt, name, symbol, amount) } // Multicall is a paid mutator transaction binding the contract method 0xac9650d8. // // Solidity: function multicall(bytes[] data) payable returns(bytes[] results) func (_IAGENTTokenDeployer *IAGENTTokenDeployerTransactor) Multicall(opts *bind.TransactOpts, data [][]byte) (*types.Transaction, error) { return _IAGENTTokenDeployer.contract.Transact(opts, "multicall", data) } // Multicall is a paid mutator transaction binding the contract method 0xac9650d8. // // Solidity: function multicall(bytes[] data) payable returns(bytes[] results) func (_IAGENTTokenDeployer *IAGENTTokenDeployerSession) Multicall(data [][]byte) (*types.Transaction, error) { return _IAGENTTokenDeployer.Contract.Multicall(&_IAGENTTokenDeployer.TransactOpts, data) } // Multicall is a paid mutator transaction binding the contract method 0xac9650d8. // // Solidity: function multicall(bytes[] data) payable returns(bytes[] results) func (_IAGENTTokenDeployer *IAGENTTokenDeployerTransactorSession) Multicall(data [][]byte) (*types.Transaction, error) { return _IAGENTTokenDeployer.Contract.Multicall(&_IAGENTTokenDeployer.TransactOpts, data) } // IAGENTTokenDeployerAGENTTokenCreatedIterator is returned from FilterAGENTTokenCreated and is used to iterate over the raw logs and unpacked data for AGENTTokenCreated events raised by the IAGENTTokenDeployer contract. type IAGENTTokenDeployerAGENTTokenCreatedIterator struct { Event *IAGENTTokenDeployerAGENTTokenCreated // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *IAGENTTokenDeployerAGENTTokenCreatedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(IAGENTTokenDeployerAGENTTokenCreated) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(IAGENTTokenDeployerAGENTTokenCreated) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *IAGENTTokenDeployerAGENTTokenCreatedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *IAGENTTokenDeployerAGENTTokenCreatedIterator) Close() error { it.sub.Unsubscribe() return nil } // IAGENTTokenDeployerAGENTTokenCreated represents a AGENTTokenCreated event raised by the IAGENTTokenDeployer contract. type IAGENTTokenDeployerAGENTTokenCreated struct { Salt [32]byte Token common.Address Raw types.Log // Blockchain specific contextual infos } // FilterAGENTTokenCreated is a free log retrieval operation binding the contract event 0xb1ed6fee395fd3653fcafe0c34960115183da0ce5e99275b123893359ab04dc2. // // Solidity: event AGENTTokenCreated(bytes32 indexed salt, address indexed token) func (_IAGENTTokenDeployer *IAGENTTokenDeployerFilterer) FilterAGENTTokenCreated(opts *bind.FilterOpts, salt [][32]byte, token []common.Address) (*IAGENTTokenDeployerAGENTTokenCreatedIterator, error) { var saltRule []interface{} for _, saltItem := range salt { saltRule = append(saltRule, saltItem) } var tokenRule []interface{} for _, tokenItem := range token { tokenRule = append(tokenRule, tokenItem) } logs, sub, err := _IAGENTTokenDeployer.contract.FilterLogs(opts, "AGENTTokenCreated", saltRule, tokenRule) if err != nil { return nil, err } return &IAGENTTokenDeployerAGENTTokenCreatedIterator{contract: _IAGENTTokenDeployer.contract, event: "AGENTTokenCreated", logs: logs, sub: sub}, nil } // WatchAGENTTokenCreated is a free log subscription operation binding the contract event 0xb1ed6fee395fd3653fcafe0c34960115183da0ce5e99275b123893359ab04dc2. // // Solidity: event AGENTTokenCreated(bytes32 indexed salt, address indexed token) func (_IAGENTTokenDeployer *IAGENTTokenDeployerFilterer) WatchAGENTTokenCreated(opts *bind.WatchOpts, sink chan<- *IAGENTTokenDeployerAGENTTokenCreated, salt [][32]byte, token []common.Address) (event.Subscription, error) { var saltRule []interface{} for _, saltItem := range salt { saltRule = append(saltRule, saltItem) } var tokenRule []interface{} for _, tokenItem := range token { tokenRule = append(tokenRule, tokenItem) } logs, sub, err := _IAGENTTokenDeployer.contract.WatchLogs(opts, "AGENTTokenCreated", saltRule, tokenRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(IAGENTTokenDeployerAGENTTokenCreated) if err := _IAGENTTokenDeployer.contract.UnpackLog(event, "AGENTTokenCreated", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseAGENTTokenCreated is a log parse operation binding the contract event 0xb1ed6fee395fd3653fcafe0c34960115183da0ce5e99275b123893359ab04dc2. // // Solidity: event AGENTTokenCreated(bytes32 indexed salt, address indexed token) func (_IAGENTTokenDeployer *IAGENTTokenDeployerFilterer) ParseAGENTTokenCreated(log types.Log) (*IAGENTTokenDeployerAGENTTokenCreated, error) { event := new(IAGENTTokenDeployerAGENTTokenCreated) if err := _IAGENTTokenDeployer.contract.UnpackLog(event, "AGENTTokenCreated", log); err != nil { return nil, err } event.Raw = log return event, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/binds/ihybridmodel/IHybridModel.go ================================================ // Code generated - DO NOT EDIT. // This file is a generated binding and any manual changes will be lost. package ihybridmodel import ( "errors" "math/big" "strings" ethereum "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/event" ) // Reference imports to suppress errors if they are not otherwise used. var ( _ = errors.New _ = big.NewInt _ = strings.NewReader _ = ethereum.NotFound _ = bind.Bind _ = common.Big1 _ = types.BloomLookup _ = event.NewSubscription _ = abi.ConvertType ) // IHybridModelMetaData contains all meta data concerning the IHybridModel contract. var IHybridModelMetaData = &bind.MetaData{ ABI: "[{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"infer\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"referenceId\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"}]", } // IHybridModelABI is the input ABI used to generate the binding from. // Deprecated: Use IHybridModelMetaData.ABI instead. var IHybridModelABI = IHybridModelMetaData.ABI // IHybridModel is an auto generated Go binding around an Ethereum contract. type IHybridModel struct { IHybridModelCaller // Read-only binding to the contract IHybridModelTransactor // Write-only binding to the contract IHybridModelFilterer // Log filterer for contract events } // IHybridModelCaller is an auto generated read-only Go binding around an Ethereum contract. type IHybridModelCaller struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // IHybridModelTransactor is an auto generated write-only Go binding around an Ethereum contract. type IHybridModelTransactor struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // IHybridModelFilterer is an auto generated log filtering Go binding around an Ethereum contract events. type IHybridModelFilterer struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // IHybridModelSession is an auto generated Go binding around an Ethereum contract, // with pre-set call and transact options. type IHybridModelSession struct { Contract *IHybridModel // Generic contract binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // IHybridModelCallerSession is an auto generated read-only Go binding around an Ethereum contract, // with pre-set call options. type IHybridModelCallerSession struct { Contract *IHybridModelCaller // Generic contract caller binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session } // IHybridModelTransactorSession is an auto generated write-only Go binding around an Ethereum contract, // with pre-set transact options. type IHybridModelTransactorSession struct { Contract *IHybridModelTransactor // Generic contract transactor binding to set the session for TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // IHybridModelRaw is an auto generated low-level Go binding around an Ethereum contract. type IHybridModelRaw struct { Contract *IHybridModel // Generic contract binding to access the raw methods on } // IHybridModelCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. type IHybridModelCallerRaw struct { Contract *IHybridModelCaller // Generic read-only contract binding to access the raw methods on } // IHybridModelTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. type IHybridModelTransactorRaw struct { Contract *IHybridModelTransactor // Generic write-only contract binding to access the raw methods on } // NewIHybridModel creates a new instance of IHybridModel, bound to a specific deployed contract. func NewIHybridModel(address common.Address, backend bind.ContractBackend) (*IHybridModel, error) { contract, err := bindIHybridModel(address, backend, backend, backend) if err != nil { return nil, err } return &IHybridModel{IHybridModelCaller: IHybridModelCaller{contract: contract}, IHybridModelTransactor: IHybridModelTransactor{contract: contract}, IHybridModelFilterer: IHybridModelFilterer{contract: contract}}, nil } // NewIHybridModelCaller creates a new read-only instance of IHybridModel, bound to a specific deployed contract. func NewIHybridModelCaller(address common.Address, caller bind.ContractCaller) (*IHybridModelCaller, error) { contract, err := bindIHybridModel(address, caller, nil, nil) if err != nil { return nil, err } return &IHybridModelCaller{contract: contract}, nil } // NewIHybridModelTransactor creates a new write-only instance of IHybridModel, bound to a specific deployed contract. func NewIHybridModelTransactor(address common.Address, transactor bind.ContractTransactor) (*IHybridModelTransactor, error) { contract, err := bindIHybridModel(address, nil, transactor, nil) if err != nil { return nil, err } return &IHybridModelTransactor{contract: contract}, nil } // NewIHybridModelFilterer creates a new log filterer instance of IHybridModel, bound to a specific deployed contract. func NewIHybridModelFilterer(address common.Address, filterer bind.ContractFilterer) (*IHybridModelFilterer, error) { contract, err := bindIHybridModel(address, nil, nil, filterer) if err != nil { return nil, err } return &IHybridModelFilterer{contract: contract}, nil } // bindIHybridModel binds a generic wrapper to an already deployed contract. func bindIHybridModel(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { parsed, err := IHybridModelMetaData.GetAbi() if err != nil { return nil, err } return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_IHybridModel *IHybridModelRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _IHybridModel.Contract.IHybridModelCaller.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_IHybridModel *IHybridModelRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _IHybridModel.Contract.IHybridModelTransactor.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_IHybridModel *IHybridModelRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _IHybridModel.Contract.IHybridModelTransactor.contract.Transact(opts, method, params...) } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_IHybridModel *IHybridModelCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _IHybridModel.Contract.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_IHybridModel *IHybridModelTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _IHybridModel.Contract.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_IHybridModel *IHybridModelTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _IHybridModel.Contract.contract.Transact(opts, method, params...) } // Infer is a paid mutator transaction binding the contract method 0x67e950a8. // // Solidity: function infer(bytes _data) payable returns(uint256 referenceId) func (_IHybridModel *IHybridModelTransactor) Infer(opts *bind.TransactOpts, _data []byte) (*types.Transaction, error) { return _IHybridModel.contract.Transact(opts, "infer", _data) } // Infer is a paid mutator transaction binding the contract method 0x67e950a8. // // Solidity: function infer(bytes _data) payable returns(uint256 referenceId) func (_IHybridModel *IHybridModelSession) Infer(_data []byte) (*types.Transaction, error) { return _IHybridModel.Contract.Infer(&_IHybridModel.TransactOpts, _data) } // Infer is a paid mutator transaction binding the contract method 0x67e950a8. // // Solidity: function infer(bytes _data) payable returns(uint256 referenceId) func (_IHybridModel *IHybridModelTransactorSession) Infer(_data []byte) (*types.Transaction, error) { return _IHybridModel.Contract.Infer(&_IHybridModel.TransactOpts, _data) } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/binds/imagehub/ImageHub.go ================================================ // Code generated - DO NOT EDIT. // This file is a generated binding and any manual changes will be lost. package imagehub import ( "errors" "math/big" "strings" ethereum "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/event" ) // Reference imports to suppress errors if they are not otherwise used. var ( _ = errors.New _ = big.NewInt _ = strings.NewReader _ = ethereum.NotFound _ = bind.Bind _ = common.Big1 _ = types.BloomLookup _ = event.NewSubscription _ = abi.ConvertType ) // ImageHubMetaData contains all meta data concerning the ImageHub contract. var ImageHubMetaData = &bind.MetaData{ ABI: "[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"creator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"imageId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"fee\",\"type\":\"uint256\"}],\"name\":\"ImageTipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"creator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"duration\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"expiredAt\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"fee\",\"type\":\"uint256\"}],\"name\":\"SubscriptionCharged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"creator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"duration\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"price\",\"type\":\"uint256\"}],\"name\":\"SubscriptionPriceUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"creator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"duration\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"price\",\"type\":\"uint256\"}],\"name\":\"SubscriptionRegistered\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"creator\",\"type\":\"address\"}],\"name\":\"chargeSubscription\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getChainId\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"WEAI\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes[]\",\"name\":\"data\",\"type\":\"bytes[]\"}],\"name\":\"multicall\",\"outputs\":[{\"internalType\":\"bytes[]\",\"name\":\"results\",\"type\":\"bytes[]\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"creator\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"duration\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"price\",\"type\":\"uint256\"}],\"name\":\"registerSubscription\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"creator\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"imageId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transferImageTip\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"duration\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"price\",\"type\":\"uint256\"}],\"name\":\"updateSubscriptionPrice\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", Bin: "0x0004000000000002000b000000000002000000000301034f000000000103001900000060011002700000026e0010019d0000026e04100197000300000043035500020000000303550000000100200190000000800c000039000000240000c13d0000004000c0043f000000040040008c000005130000413d000000000103043b000000e001100270000002700010009c0000002d0000213d000002770010009c000000520000a13d000002780010009c000000960000613d000002790010009c000000b00000613d0000027a0010009c000005130000c13d0000000001000416000000000001004b000005130000c13d0000003301000039000000000101041a0000027d01100197000000800010043f000002a301000041000009b50001042e0000004000c0043f0000000001000416000000000001004b000005130000c13d0000002001000039000001000010044300000120000004430000026f01000041000009b50001042e000002710010009c000000710000a13d000002720010009c000000c90000613d000002730010009c000001220000613d000002740010009c000005130000c13d000000240040008c000005130000413d0000000001000416000000000001004b000005130000c13d0000000401300370000000000101043b0000027d0010009c000005130000213d0000003302000039000000000202041a0000027d022001970000000003000411000000000032004b000001980000c13d000000000001004b000001db0000c13d0000027e01000041000000800010043f0000002001000039000000840010043f0000002601000039000000a40010043f0000027f01000041000000c40010043f0000028001000041000000e40010043f0000028101000041000009b6000104300000027b0010009c000001700000613d0000027c0010009c000005130000c13d000000440040008c000005130000413d0000000001000416000000000001004b000005130000c13d0000002401300370000000000401043b0000000401300370000000000301043b0000006501000039000000000201041a000000020020008c0000018e0000613d0000000202000039000000000021041b000000000003004b000001cf0000c13d0000027e01000041000000800010043f0000002001000039000000840010043f0000000f01000039000000a40010043f000002a101000041000000c40010043f000002a501000041000009b600010430000002750010009c0000017d0000613d000002760010009c000005130000c13d000000240040008c000005130000413d0000000401300370000000000101043b000500000001001d000002900010009c000005130000213d00000005010000290000002301100039000000000041004b000005130000813d00000005010000290000000401100039000000000113034f000000000f01043b0000029000f0009c000005130000213d0000000502f002100000000501000029000800240010003d0000000801200029000000000041004b000005130000213d0000003f012000390000029101100197000002920010009c0000032a0000a13d0000029401000041000000000010043f0000004101000039000000040010043f0000029501000041000009b600010430000000640040008c000005130000413d0000000401300370000000000501043b0000027d0050009c000005130000213d0000004401300370000000000601043b0000006501000039000000000201041a000000020020008c0000018e0000613d0000000202000039000000000021041b000000000006004b000001de0000c13d0000027e01000041000000800010043f0000002001000039000000840010043f0000000d01000039000000a40010043f000002b401000041000000c40010043f000002a501000041000009b6000104300000000001000416000000000001004b000005130000c13d0000003301000039000000000201041a0000027d052001970000000003000411000000000035004b000001980000c13d0000028902200197000000000021041b00000000010004140000026e0010009c0000026e01008041000000c0011002100000028a011001c70000800d0200003900000003030000390000028b04000041000000000600001909b409a50000040f0000000100200190000005130000613d0000000001000019000009b50001042e000000240040008c000005130000413d0000000001000416000000000001004b000005130000c13d0000000401300370000000000401043b0000027d0040009c000005130000213d00000000020004150000000a0220008a0000000502200210000000000300041a0000ff0001300190000800000004001d000001a10000c13d0000000002000415000000090220008a0000000502200210000000ff00300190000001a10000c13d000002b80130019700000001011001bf000002b90110019700000100011001bf0000000002000019000000000010041b0000ff0000100190000001c50000613d000700000002001d00000000010004110000027d061001970000003301000039000000000201041a0000028903200197000000000363019f000000000031041b00000000010004140000027d052001970000026e0010009c0000026e01008041000000c0011002100000028a011001c70000800d0200003900000003030000390000028b0400004109b409a50000040f00000008050000290000000100200190000005130000613d000000000100041a0000ff00001001900000000706000029000001c50000613d00000001030000390000006502000039000000000032041b0000009702000039000000000402041a0000028904400197000000000454019f000000000042041b0000009802000039000000000402041a00000289044001970000000005000411000000000454019f000000000042041b000000000006004b000000c70000c13d000002b901100197000000000010041b000000400100043d00000000003104350000026e0010009c0000026e01008041000000400110021000000000020004140000026e0020009c0000026e02008041000000c002200210000000000112019f0000028c011001c70000800d020000390000028d0400004109b409a50000040f0000000100200190000000c70000c13d000005130000013d000000840040008c000005130000413d0000000001000416000000000001004b000005130000c13d0000000401300370000000000401043b0000027d0040009c000005130000213d0000002401300370000000000501043b0000027d0050009c000005130000213d0000006401300370000000000601043b0000004401300370000000000301043b0000006501000039000000000201041a000000020020008c0000018e0000613d000500000003001d000600000006001d0000000202000039000000000021041b000000000040043f0000009a01000039000000200010043f00000000010004140000026e0010009c0000026e01008041000000c00110021000000282011001c70000801002000039000700000004001d000800000005001d09b409aa0000040f00000008030000290000000100200190000005130000613d000000000101043b000000000030043f000000200010043f00000000010004140000026e0010009c0000026e01008041000000c00110021000000282011001c7000080100200003909b409aa0000040f000000080600002900000007050000290000000100200190000005130000613d000000000101043b00000001021000390000000504000029000000000042041b00000002011000390000000603000029000000000031041b000000400100043d0000002002100039000000000032043500000000004104350000026e0010009c0000026e01008041000000400110021000000000020004140000026e0020009c0000026e02008041000000c002200210000000000112019f00000282011001c70000800d02000039000000030300003900000283040000410000030b0000013d0000000001000416000000000001004b000005130000c13d0000800b01000039000000040300003900000000040004150000000b0440008a0000000504400210000002b70200004109b4098e0000040f000000800010043f000002a301000041000009b50001042e000000440040008c000005130000413d0000000001000416000000000001004b000005130000c13d0000000401300370000000000401043b0000027d0040009c000005130000213d0000002401300370000000000301043b0000027d0030009c000005130000213d0000006501000039000000000201041a000000020020008c0000029b0000c13d0000027e01000041000000800010043f0000002001000039000000840010043f0000001f01000039000000a40010043f000002b601000041000000c40010043f000002a501000041000009b6000104300000027e01000041000000800010043f0000002001000039000000840010043f000000a40010043f000002a401000041000000c40010043f000002a501000041000009b600010430000600000003001d000700000002001d000500000001001d000002840100004100000000001004430000000001000410000000040010044300000000010004140000026e0010009c0000026e01008041000000c00110021000000285011001c7000080020200003909b409aa0000040f0000000100200190000006150000613d000000000101043b000000000001004b000003130000c13d0000000601000029000000ff0110018f000000010010008c00000007010000290000000501100270000000000100003f000000010100603f000003160000c13d000000000200041a000002b80120019700000001011001bf000000050000006b000000e00000613d0000000102000039000000000010041b0000ff0000100190000000e60000c13d000000400100043d00000064021000390000028e03000041000000000032043500000044021000390000028f03000041000000000032043500000024021000390000002b030000390000031f0000013d000000000004004b000002da0000c13d0000027e01000041000000800010043f0000002001000039000000840010043f0000000c01000039000000a40010043f000002a201000041000000c40010043f000002a501000041000009b60001043009b406c30000040f0000000001000019000009b50001042e000002ba0060009c000000000106001900000000010060190000000a211000c900000080031002700000008002200210000000000232019f0000029b031001970000029c2420012a0000008002200210000000000232019f0000029c034000d1000000000023004b000000010440208a0000029c0240019700000000022100190000000a016000c9000000000212004b00000000030000390000000103004039000000000232004b000003410000c13d000000640110011a000600000001001d000800000006001d000500000005001d0000009701000039000000000101041a000700000001001d000002a60100004100000000001004430000000001000410000000040010044300000000010004140000026e0010009c0000026e01008041000000c00110021000000285011001c70000800a0200003909b409aa0000040f0000000100200190000006150000613d000000000500041100000007020000290000027d06200197000000000101043b0000000804000029000000000041004b000004070000813d000000400200043d0000002001200039000002aa0300004100000000003104350000006401200039000000000041043500000000010004100000027d01100197000000440320003900000000001304350000027d015001970000002403200039000000000013043500000064010000390000000000120435000002ab0020009c000000900000813d000000a001200039000000400010043f000700000006001d000000000106001909b408800000040f00000008050000290000000606000029000000000065004b000004f90000613d00040000006500510000009701000039000000000101041a0000027d021001970000000701000029000000000021004b000004e50000c13d00000284020000410000000000200443000700000001001d000000040010044300000000010004140000026e0010009c0000026e01008041000000c00110021000000285011001c7000080020200003909b409aa0000040f0000000100200190000006150000613d000000000101043b000000000001004b000005130000613d000000400200043d000002ad010000410000000001120436000200000001001d000300000002001d00000004012000390000000402000029000000000021043500000000010004140000000702000029000000040020008c0000025d0000613d00000003020000290000026e0020009c0000026e0200804100000040022002100000026e0010009c0000026e01008041000000c001100210000000000121019f00000295011001c7000000070200002909b409a50000040f000000000301001900000060033002700001026e0030019d000300000001035500000001002001900000061f0000613d0000000301000029000002900010009c000000900000213d0000000301000029000000400010043f000002ae0010009c000000900000213d0000000201000029000000400010043f0000000301000029000000000001043500000000010004140000000502000029000000040020008c000006460000c13d000000010100003200000008050000290000000606000029000004f90000613d000002900010009c000000900000213d0000001f03100039000002bb033001970000003f03300039000002bb04300197000000400300043d0000000004430019000000000034004b00000000050000390000000105004039000002900040009c000000900000213d0000000100500190000000900000c13d000000400040043f0000000005130436000002bb021001980000001f0310018f000000000125001900000003040003670000028b0000613d000000000604034f000000006706043c0000000005750436000000000015004b000002870000c13d000000000003004b00000008050000290000000606000029000004f90000613d000000000224034f0000000303300210000000000401043300000000043401cf000000000434022f000000000202043b0000010003300089000000000232022f00000000023201cf000000000242019f0000000000210435000004f90000013d0000000202000039000000000021041b000000000040043f0000009a01000039000000200010043f00000000010004140000026e0010009c0000026e01008041000000c00110021000000282011001c70000801002000039000700000004001d000800000003001d09b409aa0000040f00000008030000290000000100200190000005130000613d000000000101043b000000000030043f000000200010043f00000000010004140000026e0010009c0000026e01008041000000c00110021000000282011001c7000080100200003909b409aa0000040f00000008030000290000000100200190000005130000613d000000000201043b000000000102041a000000000001004b000002cf0000613d000500000001001d000600000002001d0000029701000041000000000010044300000000010004140000026e0010009c0000026e01008041000000c00110021000000298011001c70000800b0200003909b409aa0000040f0000000100200190000006150000613d000000000101043b000000050010006b00000008030000290000000602000029000004860000813d0000000201200039000000000101041a000000000001004b000004550000c13d000000400100043d0000004402100039000002a203000041000000000032043500000024021000390000000c030000390000048c0000013d000800000003001d000700000004001d0000000001000411000000000010043f0000009901000039000000200010043f00000000010004140000026e0010009c0000026e01008041000000c00110021000000282011001c7000080100200003909b409aa0000040f0000000100200190000005130000613d000000000101043b0000000802000029000000000020043f000000200010043f00000000010004140000026e0010009c0000026e01008041000000c00110021000000282011001c7000080100200003909b409aa0000040f0000000100200190000005130000613d000000000101043b0000000703000029000000000031041b000000400100043d00000020021000390000000000320435000000080200002900000000002104350000026e0010009c0000026e01008041000000400110021000000000020004140000026e0020009c0000026e02008041000000c002200210000000000112019f00000282011001c70000800d020000390000000203000039000002b504000041000000000500041109b409a50000040f0000000100200190000005130000613d00000001010000390000006502000039000000000012041b0000000001000019000009b50001042e00000007010000290000000501100270000000000100003f000000400100043d00000064021000390000028603000041000000000032043500000044021000390000028703000041000000000032043500000024021000390000002e0300003900000000003204350000027e0200004100000000002104350000000402100039000000200300003900000000003204350000026e0010009c0000026e01008041000000400110021000000288011001c7000009b6000104300000008001100039000000400010043f0000008000f0043f00000000000f004b0000034d0000c13d00000020020000390000000003210436000000800200043d0000000000230435000000400310003900000005042002100000000006340019000000000002004b000004390000c13d00000000021600490000026e0020009c0000026e0200804100000060022002100000026e0010009c0000026e010080410000004001100210000000000112019f000009b50001042e000000640020008c000003f60000413d0000027e01000041000000800010043f0000002001000039000000840010043f0000001501000039000000a40010043f0000029e01000041000000c40010043f000002a501000041000009b600010430000000000143034f00000060070000390000000005000019000000a00650003900000000007604350000002005500039000000000025004b000003500000413d000000200e00008a000000000600001900040000000f001d000000050540006a000700000006001d0000000506600210000600000006001d0000000802600029000000000223034f000000000202043b000000430550008a00000293065001970000029307200197000000000867013f000000000067004b00000000060000190000029306004041000000000052004b00000000050000190000029305008041000002930080009c000000000605c019000000000006004b000005130000c13d0000000805200029000000000253034f000000000d02043b0000029000d0009c000005130000213d0000000006d40049000000200550003900000293076001970000029308500197000000000978013f000000000078004b00000000070000190000029307004041000000000065004b00000000060000190000029306002041000002930090009c000000000706c019000000000007004b000005130000c13d000000000753034f0000000008ed0170000000400500043d00000000068500190000038c0000613d000000000907034f000000000a050019000000009b09043c000000000aba043600000000006a004b000003880000c13d0000001f09d00190000003990000613d000000000787034f0000000308900210000000000906043300000000098901cf000000000989022f000000000707043b0000010008800089000000000787022f00000000078701cf000000000797019f00000000007604350000000006d50019000000000006043500000000060004140000000002000410000000040020008c000003a50000c13d00000001060000310000000102000039000000000006004b0000006005000039000003bf0000c13d000003e50000013d0000026e00d0009c0000026e0d0080410000006001d002100000026e0050009c0000026e050080410000004003500210000000000113019f0000026e0060009c0000026e06008041000000c003600210000000000113019f09b409af0000040f000000040f000029000000200e00008a000000800c00003900000000040000310000000203000367000000010220018f0003000000010355000000000501001900000060055002700001026e0050019d0000026e06500197000000000006004b0000006005000039000003e50000613d000002900060009c000000900000213d0000001f056000390000000005e5016f0000003f055000390000000007e5016f000000400500043d0000000007750019000000000057004b00000000080000390000000108004039000002900070009c000000900000213d0000000100800190000000900000c13d000000400070043f00000000096504360000000008e601700000000007890019000003d80000613d000000000a01034f00000000ab0a043c0000000009b90436000000000079004b000003d40000c13d0000001f06600190000003e50000613d000000000881034f0000000306600210000000000907043300000000096901cf000000000969022f000000000808043b0000010006600089000000000868022f00000000066801cf000000000696019f0000000000670435000000000002004b000004970000613d000000800200043d0000000706000029000000000062004b000004800000a13d0000000602000029000000a0022000390000000000520435000000800200043d000000000062004b000004800000a13d00000001066000390000000000f6004b000003580000413d000000400100043d0000032f0000013d000000643060011a0000000a033000c9000000643030011a000000000131004b000000010220408a0000000201100270000000fe02200210000000000112019f0000029d011000d1000000000061004b000001f50000a13d0000029401000041000000000010043f0000001101000039000000040010043f0000029501000041000009b60001043000000284010000410000000000100443000700000006001d000000040060044300000000010004140000026e0010009c0000026e01008041000000c00110021000000285011001c7000080020200003909b409aa0000040f0000000100200190000006150000613d000000000101043b000000000001004b000005130000613d000000400200043d000002a701000041000400000002001d000000000012043500000000010004140000000702000029000000040020008c000004330000613d00000004020000290000026e0020009c0000026e0200804100000040022002100000026e0010009c0000026e01008041000000c001100210000000000121019f000002a8011001c7000080090200003900000008030000290000000704000029000000000500001909b409a50000040f000000000301001900000060033002700001026e0030019d000300000001035500000001002001900000059d0000613d0000000401000029000002900010009c000000900000213d0000000401000029000000400010043f000002250000013d0000000005000019000004430000013d0000001f08700039000002bb088001970000000007670019000000000007043500000000066800190000000105500039000000000025004b000003380000813d0000000007160049000000400770008a0000000003730436000000200cc0003900000000070c043300000000870704340000000006760436000000000007004b0000043b0000613d0000000009000019000000000a690019000000000b980019000000000b0b04330000000000ba04350000002009900039000000000079004b0000044d0000413d0000043b0000013d000400000001001d000600000002001d0000000101200039000000000101041a000500000001001d000000000030043f0000009901000039000000200010043f00000000010004140000026e0010009c0000026e01008041000000c00110021000000282011001c7000080100200003909b409aa0000040f0000000100200190000005130000613d000000000101043b0000000502000029000000000020043f000000200010043f00000000010004140000026e0010009c0000026e01008041000000c00110021000000282011001c7000080100200003909b409aa0000040f0000000100200190000005130000613d000000000101043b000000000101041a000000040010006b000002d30000c13d000000050000006b000005bc0000c13d000000400100043d0000004402100039000002a103000041000000000032043500000024021000390000000f030000390000048c0000013d0000029401000041000000000010043f0000003201000039000000040010043f0000029501000041000009b600010430000000400100043d0000004402100039000002990300004100000000003204350000002402100039000000100300003900000000003204350000027e0200004100000000002104350000000402100039000000200300003900000000003204350000026e0010009c0000026e0100804100000040011002100000029a011001c7000009b6000104300000000001050433000000440010008c000005130000413d00000004015000390000000001010433000002960010009c000005130000213d000000200010008c000005130000413d00000024025000390000000003020433000002900030009c000005130000213d000000000421001900000000012300190000001f02100039000000000042004b0000000003000019000002930300804100000293022001970000029305400197000000000652013f000000000052004b00000000020000190000029302004041000002930060009c000000000203c019000000000002004b000005130000c13d0000000031010434000002900010009c000000900000213d0000001f021000390000000002e2016f0000003f022000390000000005e2016f000000400200043d0000000005520019000000000025004b00000000060000390000000106004039000002900050009c000000900000213d0000000100600190000000900000c13d000000400050043f00000000051204360000000006310019000000000046004b000005130000213d000000000001004b000004d30000613d000000000400001900000000065400190000000007340019000000000707043300000000007604350000002004400039000000000014004b000004cc0000413d000000000115001900000000000104350000027e01000041000000400300043d000800000003001d0000000000130435000000040130003909b4086b0000040f000000080200002900000000012100490000026e0010009c0000026e0100804100000060011002100000026e0020009c0000026e020080410000004002200210000000000121019f000009b600010430000000400200043d0000002004200039000002ac03000041000000000034043500000044032000390000000404000029000000000043043500000024042000390000000503000029000000000034043500000044030000390000000000320435000002920020009c000000900000213d0000008003200039000000400030043f000700000001001d09b408800000040f00000008050000290000000606000029000000000006004b000005150000c13d00000024010000390000000201100367000000000701043b000000400100043d0000002002100039000000000062043500000000005104350000026e0010009c0000026e01008041000000400110021000000000020004140000026e0020009c0000026e02008041000000c002200210000000000112019f00000282011001c70000800d020000390000000403000039000002b3040000410000000005000411000000050600002909b409a50000040f00000001002001900000030e0000c13d0000000001000019000009b6000104300000009801000039000000000101041a0004027d0010019b0000009701000039000000000101041a0000027d01100197000000070010006b000005880000c13d000002840100004100000000001004430000000701000029000000040010044300000000010004140000026e0010009c0000026e01008041000000c00110021000000285011001c7000080020200003909b409aa0000040f0000000100200190000006150000613d000000000101043b000000000001004b000005130000613d000000400200043d000002ad010000410000000001120436000200000001001d000300000002001d00000004012000390000000602000029000000000021043500000000010004140000000702000029000000040020008c0000054a0000613d00000003020000290000026e0020009c0000026e0200804100000040022002100000026e0010009c0000026e01008041000000c001100210000000000121019f00000295011001c7000000070200002909b409a50000040f000000000301001900000060033002700001026e0030019d00030000000103550000000100200190000006390000613d0000000301000029000002900010009c000000900000213d0000000301000029000000400010043f000002ae0010009c000000900000213d0000000201000029000000400010043f0000000301000029000000000001043500000000010004140000000402000029000000040020008c0000065a0000c13d000000010100003200000008050000290000000606000029000004fb0000613d000002900010009c000000900000213d0000001f03100039000002bb033001970000003f03300039000002bb04300197000000400300043d0000000004430019000000000034004b00000000050000390000000105004039000002900040009c000000900000213d0000000100500190000000900000c13d000000400040043f0000000005130436000002bb021001980000001f0310018f00000000012500190000000304000367000005780000613d000000000604034f000000006706043c0000000005750436000000000015004b000005740000c13d000000000003004b00000008050000290000000606000029000004fb0000613d000000000224034f0000000303300210000000000401043300000000043401cf000000000434022f000000000202043b0000010003300089000000000232022f00000000023201cf000000000242019f0000000000210435000004fb0000013d000000400200043d0000002001200039000002ac03000041000000000031043500000044012000390000000603000029000000000031043500000024012000390000000403000029000000000031043500000044010000390000000000120435000002920020009c0000000701000029000000900000213d0000008003200039000000400030043f09b408800000040f00000008050000290000000606000029000004fb0000013d0000026e033001970000001f0530018f000002a906300198000000400200043d0000000004620019000005a90000613d000000000701034f0000000008020019000000007907043c0000000008980436000000000048004b000005a50000c13d000000000005004b000005b60000613d000000000161034f0000000305500210000000000604043300000000065601cf000000000656022f000000000101043b0000010005500089000000000151022f00000000015101cf000000000161019f000000000014043500000060013002100000026e0020009c0000026e020080410000004002200210000000000112019f000009b6000104300000000405000029000002ba0050009c000000000105001900000000010060190000000a211000c900000080031002700000008002200210000000000232019f0000029b031001970000029c2420012a0000008002200210000000000232019f0000029c034000d1000000000023004b000000010440208a0000029c0240019700000000022100190000000a015000c9000000000212004b00000000030000390000000103004039000000000232004b000006160000c13d00030064001001220000029701000041000000000010044300000000010004140000026e0010009c0000026e01008041000000c00110021000000298011001c70000800b0200003909b409aa0000040f0000000100200190000006150000613d000000000101043b000000050010002a000004010000413d0000000403000029000300030000002d000000030230006a000100000002001d0000000504100029000200000004001d0000009701000039000000000101041a0000000602000029000000000042041b0000027d01100197000600000001001d000000070200002909b406d80000040f00000006010000290000000802000029000000010300002909b407780000040f0000009801000039000000000101041a0000027d021001970000000601000029000000030300002909b407780000040f000000400100043d000000600210003900000003030000290000000000320435000000400210003900000004030000290000000000320435000000200210003900000002030000290000000000320435000000050200002900000000002104350000026e0010009c0000026e01008041000000400110021000000000020004140000026e0020009c0000026e02008041000000c002200210000000000112019f0000029f011001c70000800d020000390000000303000039000002a004000041000000070500002900000008060000290000030b0000013d000000000001042f000000640020008c0000062c0000413d000000400100043d00000044021000390000029e030000410000000000320435000000240210003900000015030000390000048c0000013d0000026e033001970000001f0530018f000002a906300198000000400200043d0000000004620019000005a90000613d000000000701034f0000000008020019000000007907043c0000000008980436000000000048004b000006270000c13d000005a90000013d0000000404000029000000643040011a0000000a033000c9000000643030011a000000000131004b000000010220408a0000000201100270000000fe02200210000000000112019f0003029d001000d5000000030040006b000004010000213d000005d40000013d0000026e033001970000001f0530018f000002a906300198000000400200043d0000000004620019000005a90000613d000000000701034f0000000008020019000000007907043c0000000008980436000000000048004b000006410000c13d000005a90000013d0000026e0010009c0000026e01008041000000c0011002100000028a011001c7000080090200003900000004030000290000000504000029000000000500001909b409a50000040f0003000000010355000000000301001900000060033002700001026e0030019d0000026e03300198000006770000c13d000000010020019000000008050000290000000606000029000004f90000c13d0000066d0000013d0000026e0010009c0000026e01008041000000c0011002100000028a011001c7000080090200003900000006030000290000000404000029000000000500001909b409a50000040f0003000000010355000000000301001900000060033002700001026e0030019d0000026e033001980000069d0000c13d000000010020019000000008050000290000000606000029000004fb0000c13d000000400100043d0000006402100039000002b10300004100000000003204350000004402100039000002b2030000410000000000320435000000240210003900000034030000390000031f0000013d0000001f04300039000002af044001970000003f04400039000002b004400197000000400500043d0000000004450019000000000054004b00000000060000390000000106004039000002900040009c000000900000213d0000000100600190000000900000c13d000000400040043f0000001f0430018f0000000006350436000002a90530019800000000035600190000068f0000613d000000000701034f000000007807043c0000000006860436000000000036004b0000068b0000c13d000000000004004b000006550000613d000000000151034f0000000304400210000000000503043300000000054501cf000000000545022f000000000101043b0000010004400089000000000141022f00000000014101cf000000000151019f0000000000130435000006550000013d0000001f04300039000002af044001970000003f04400039000002b004400197000000400500043d0000000004450019000000000054004b00000000060000390000000106004039000002900040009c000000900000213d0000000100600190000000900000c13d000000400040043f0000001f0430018f0000000006350436000002a9053001980000000003560019000006b50000613d000000000701034f000000007807043c0000000006860436000000000036004b000006b10000c13d000000000004004b000006690000613d000000000151034f0000000304400210000000000503043300000000054501cf000000000545022f000000000101043b0000010004400089000000000141022f00000000014101cf000000000151019f0000000000130435000006690000013d0000027d061001970000003301000039000000000201041a0000028903200197000000000363019f000000000031041b00000000010004140000027d052001970000026e0010009c0000026e01008041000000c0011002100000028a011001c70000800d0200003900000003030000390000028b0400004109b409a50000040f0000000100200190000006d60000613d000000000001042d0000000001000019000009b60001043000030000000000020000000006020019000000000003004b0000071f0000613d00000000070004100000027d011001970000009702000039000000000202041a0000027d02200197000000000021004b0000070c0000c13d000100000006001d000200000002001d000300000003001d000002a6010000410000000000100443000000040070044300000000010004140000026e0010009c0000026e01008041000000c00110021000000285011001c70000800a0200003909b409aa0000040f0000000100200190000007560000613d000000000101043b0000000304000029000000000041004b0000000105000029000007200000813d000000400200043d0000002001200039000002aa0300004100000000003104350000006401200039000000000041043500000000010004100000027d01100197000000440320003900000000001304350000027d015001970000002403200039000000000013043500000064010000390000000000120435000002ab0020009c000007500000813d000000a001200039000000400010043f00000002010000290000071e0000013d000000400200043d0000002005200039000002aa040000410000000000450435000000640420003900000000003404350000027d03700197000000440420003900000000003404350000027d036001970000002404200039000000000034043500000064030000390000000000320435000002bc0020009c000007500000213d000000a003200039000000400030043f09b408800000040f000000000001042d000002840100004100000000001004430000000201000029000000040010044300000000010004140000026e0010009c0000026e01008041000000c00110021000000285011001c7000080020200003909b409aa0000040f0000000100200190000007560000613d000000000101043b000000000001004b0000000303000029000007570000613d000000400200043d000002a701000041000000000012043500000000010004140000000204000029000000040040008c0000074c0000613d0000026e0020009c000100000002001d0000026e02000041000000010200402900000040022002100000026e0010009c0000026e01008041000000c001100210000000000121019f000002a8011001c70000800902000039000000000500001909b409a50000040f000000000301001900000060033002700001026e0030019d000300000001035500000001002001900000000102000029000007590000613d000002900020009c000007500000213d000000400020043f000000000001042d0000029401000041000000000010043f0000004101000039000000040010043f0000029501000041000009b600010430000000000001042f0000000001000019000009b6000104300000026e033001970000001f0530018f000002a906300198000000400200043d0000000004620019000007650000613d000000000701034f0000000008020019000000007907043c0000000008980436000000000048004b000007610000c13d000000000005004b000007720000613d000000000161034f0000000305500210000000000604043300000000065601cf000000000656022f000000000101043b0000010005500089000000000151022f00000000015101cf000000000161019f000000000014043500000060013002100000026e0020009c0000026e020080410000004002200210000000000112019f000009b60001043000040000000000020000000005020019000000000003004b0000082e0000613d0000027d011001970000009702000039000000000202041a0000027d02200197000000000021004b000007e90000c13d000400000003001d000200000005001d00000284010000410000000000100443000300000002001d000000040020044300000000010004140000026e0010009c0000026e01008041000000c00110021000000285011001c7000080020200003909b409aa0000040f0000000100200190000008350000613d000000000101043b000000000001004b0000000403000029000008360000613d000000400500043d000002ad0100004100000000061504360000000401500039000000000031043500000000010004140000000302000029000000040020008c000007b30000613d0000026e0050009c0000026e03000041000000000305401900000040033002100000026e0010009c0000026e01008041000000c001100210000000000131019f00000295011001c7000300000005001d000100000006001d09b409a50000040f000000010600002900000003050000290000000403000029000000000401001900000060044002700001026e0040019d00030000000103550000000100200190000008380000613d000002900050009c00000002040000290000082f0000213d000000400050043f000002ae0050009c0000082f0000213d000000400060043f00000000000504350000000001000414000000040040008c000007fa0000c13d00000001010000320000082e0000613d000002bd0010009c0000082f0000813d0000001f03100039000002bb033001970000003f03300039000002bb04300197000000400300043d0000000004430019000000000034004b00000000050000390000000105004039000002900040009c0000082f0000213d00000001005001900000082f0000c13d000000400040043f0000000005130436000002bb021001980000001f0310018f00000000012500190000000304000367000007db0000613d000000000604034f000000006706043c0000000005750436000000000015004b000007d70000c13d000000000003004b0000082e0000613d000000000224034f0000000303300210000000000401043300000000043401cf000000000434022f000000000202043b0000010003300089000000000232022f00000000023201cf000000000242019f0000000000210435000000000001042d000000400200043d0000002006200039000002ac040000410000000000460435000000440420003900000000003404350000027d035001970000002404200039000000000034043500000044030000390000000000320435000002920020009c0000082f0000213d0000008003200039000000400030043f09b408800000040f000000000001042d0000026e0010009c0000026e01008041000000c0011002100000028a011001c70000800902000039000000000500001909b409a50000040f0003000000010355000000000301001900000060033002700001026e0030019d0000026e033001980000082c0000613d0000001f04300039000002af044001970000003f04400039000002b004400197000000400500043d0000000004450019000000000054004b00000000060000390000000106004039000002900040009c0000082f0000213d00000001006001900000082f0000c13d000000400040043f0000001f0430018f0000000006350436000002a90530019800000000035600190000081f0000613d000000000701034f000000007807043c0000000006860436000000000036004b0000081b0000c13d000000000004004b0000082c0000613d000000000151034f0000000304400210000000000503043300000000054501cf000000000545022f000000000101043b0000010004400089000000000141022f00000000014101cf000000000151019f00000000001304350000000100200190000008570000613d000000000001042d0000029401000041000000000010043f0000004101000039000000040010043f0000029501000041000009b600010430000000000001042f0000000001000019000009b6000104300000026e034001970000001f0530018f000002a906300198000000400200043d0000000004620019000008440000613d000000000701034f0000000008020019000000007907043c0000000008980436000000000048004b000008400000c13d000000000005004b000008510000613d000000000161034f0000000305500210000000000604043300000000065601cf000000000656022f000000000101043b0000010005500089000000000151022f00000000015101cf000000000161019f000000000014043500000060013002100000026e0020009c0000026e020080410000004002200210000000000112019f000009b600010430000000400100043d0000006402100039000002b10300004100000000003204350000004402100039000002b20300004100000000003204350000002402100039000000340300003900000000003204350000027e0200004100000000002104350000000402100039000000200300003900000000003204350000026e0010009c0000026e01008041000000400110021000000288011001c7000009b60001043000000020030000390000000004310436000000003202043400000000002404350000004001100039000000000002004b0000087a0000613d000000000400001900000000051400190000000006430019000000000606043300000000006504350000002004400039000000000024004b000008730000413d000000000312001900000000000304350000001f02200039000002bb022001970000000001120019000000000001042d0004000000000002000000400400043d000002be0040009c000009440000813d0000027d051001970000004001400039000000400010043f0000002001400039000002bf0300004100000000003104350000002001000039000000000014043500000000230204340000000001000414000000040050008c000008bb0000c13d0000000101000032000008f70000613d000002900010009c000009440000213d0000001f03100039000002bb033001970000003f03300039000002bb03300197000000400a00043d00000000033a00190000000000a3004b00000000040000390000000104004039000002900030009c000009440000213d0000000100400190000009440000c13d000000400030043f00000000051a0436000002bb021001980000001f0310018f00000000012500190000000304000367000008ad0000613d000000000604034f000000006706043c0000000005750436000000000015004b000008a90000c13d000000000003004b000008f80000613d000000000224034f0000000303300210000000000401043300000000043401cf000000000434022f000000000202043b0000010003300089000000000232022f00000000023201cf000000000242019f0000000000210435000008f80000013d000200000004001d0000026e0030009c0000026e0300804100000060033002100000026e0020009c0000026e020080410000004002200210000000000223019f0000026e0010009c0000026e01008041000000c001100210000000000112019f000100000005001d000000000205001909b409a50000040f0003000000010355000000000301001900000060033002700001026e0030019d0000026e043001980000090f0000613d0000001f03400039000002af033001970000003f03300039000002b003300197000000400a00043d00000000033a00190000000000a3004b00000000050000390000000105004039000002900030009c000009440000213d0000000100500190000009440000c13d000000400030043f0000001f0540018f00000000034a0436000002a9064001980000000004630019000008e90000613d000000000701034f0000000008030019000000007907043c0000000008980436000000000048004b000008e50000c13d000000000005004b000009110000613d000000000161034f0000000305500210000000000604043300000000065601cf000000000656022f000000000101043b0000010005500089000000000151022f00000000015101cf000000000161019f0000000000140435000009110000013d000000600a0000390000000002000415000000040220008a000000050220021000000000010a0433000000000001004b000009190000c13d00020000000a001d000002840100004100000000001004430000000401000039000000040010044300000000010004140000026e0010009c0000026e01008041000000c00110021000000285011001c7000080020200003909b409aa0000040f0000000100200190000009730000613d0000000002000415000000040220008a0000092c0000013d000000600a000039000000800300003900000000010a04330000000100200190000009600000613d0000000002000415000000030220008a0000000502200210000000000001004b0000091c0000613d000000050220027000000000020a001f000009360000013d00020000000a001d000002840100004100000000001004430000000101000029000000040010044300000000010004140000026e0010009c0000026e01008041000000c00110021000000285011001c7000080020200003909b409aa0000040f0000000100200190000009730000613d0000000002000415000000030220008a0000000502200210000000000101043b000000000001004b000000020a000029000009740000613d00000000010a0433000000050220027000000000020a001f000000000001004b000009430000613d000002960010009c0000094a0000213d000000200010008c0000094a0000413d0000002001a000390000000001010433000000000001004b0000000002000039000000010200c039000000000021004b0000094a0000c13d000000000001004b0000094c0000613d000000000001042d0000029401000041000000000010043f0000004101000039000000040010043f0000029501000041000009b6000104300000000001000019000009b600010430000000400100043d0000006402100039000002c00300004100000000003204350000004402100039000002c103000041000000000032043500000024021000390000002a0300003900000000003204350000027e0200004100000000002104350000000402100039000000200300003900000000003204350000026e0010009c0000026e01008041000000400110021000000288011001c7000009b600010430000000000001004b000009850000c13d000000400200043d000100000002001d0000027e0100004100000000001204350000000401200039000000020200002909b4086b0000040f000000010200002900000000012100490000026e0010009c0000026e0100804100000060011002100000026e0020009c0000026e020080410000004002200210000000000121019f000009b600010430000000000001042f000000400100043d0000004402100039000002c203000041000000000032043500000024021000390000001d0300003900000000003204350000027e0200004100000000002104350000000402100039000000200300003900000000003204350000026e0010009c0000026e0100804100000040011002100000029a011001c7000009b6000104300000026e0030009c0000026e0300804100000040023002100000026e0010009c0000026e010080410000006001100210000000000121019f000009b600010430000000000001042f00000000050100190000000000200443000000040030008c000009950000a13d0000000501400270000000000101003100000004001004430000026e0030009c0000026e03008041000000600130021000000000020004140000026e0020009c0000026e02008041000000c002200210000000000112019f000002c3011001c7000000000205001909b409aa0000040f0000000100200190000009a40000613d000000000101043b000000000001042d000000000001042f000009a8002104210000000102000039000000000001042d0000000002000019000000000001042d000009ad002104230000000102000039000000000001042d0000000002000019000000000001042d000009b2002104250000000102000039000000000001042d0000000002000019000000000001042d000009b400000432000009b50001042e000009b600010430000000000000000000000000000000000000000000000000000000000000000000000000ffffffff000000020000000000000000000000000000004000000100000000000000000000000000000000000000000000000000000000000000000000000000ac884ab600000000000000000000000000000000000000000000000000000000c4d66de700000000000000000000000000000000000000000000000000000000c4d66de800000000000000000000000000000000000000000000000000000000e34e3b7e00000000000000000000000000000000000000000000000000000000f2fde38b00000000000000000000000000000000000000000000000000000000ac884ab700000000000000000000000000000000000000000000000000000000ac9650d8000000000000000000000000000000000000000000000000000000006fc563bd000000000000000000000000000000000000000000000000000000006fc563be00000000000000000000000000000000000000000000000000000000715018a6000000000000000000000000000000000000000000000000000000008da5cb5b000000000000000000000000000000000000000000000000000000003408e47000000000000000000000000000000000000000000000000000000000667e9660000000000000000000000000ffffffffffffffffffffffffffffffffffffffff08c379a0000000000000000000000000000000000000000000000000000000004f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000840000008000000000000000000200000000000000000000000000000000000040000000000000000000000000e1b67d1786c6125e949791ee25291c8dc38b471ae947bf8c65433da2f31149bf1806aa1896bbf26568e884a7374b41e002500962caba6a15023a8d90e8508b830200000200000000000000000000000000000024000000000000000000000000647920696e697469616c697a6564000000000000000000000000000000000000496e697469616c697a61626c653a20636f6e747261637420697320616c7265610000000000000000000000000000000000000084000000000000000000000000ffffffffffffffffffffffff000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000008be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e002000000000000000000000000000000000000200000000000000000000000007f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024986e697469616c697a696e67000000000000000000000000000000000000000000496e697469616c697a61626c653a20636f6e7472616374206973206e6f742069000000000000000000000000000000000000000000000000ffffffffffffffff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0000000000000000000000000000000000000000000000000ffffffffffffff7f80000000000000000000000000000000000000000000000000000000000000004e487b710000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000240000000000000000000000007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff796b89b91644bc98cd93958e4c9038275d622183e25ac5af08cc6b5d955391320200000200000000000000000000000000000004000000000000000000000000657870697265644174496e76616c696400000000000000000000000000000000000000000000000000000000000000000000006400000000000000000000000000000000000000000000000000000000fffffffffffffffffffffffffffffffe00000000000000000000000000000000ffffffffffffffffffffffffffffffff5c28f5c28f5c28f5c28f5c28f5c28f5c28f5c28f5c28f5c28f5c28f5c28f5c294d6174683a206d756c446976206f766572666c6f77000000000000000000000002000000000000000000000000000000000000800000000000000000000000000bc8ce05a473cd40acc9b6689277d1b7c59ff62cb5491e8ec926bddb9e365a366475726174696f6e496e76616c696400000000000000000000000000000000007072696365496e76616c6964000000000000000000000000000000000000000000000000000000000000000000000000000000200000008000000000000000004f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657200000000000000000000000000000000000000640000008000000000000000009cc7f708afc65944829bd487b90b72536b1951864fbfc14e125fc972a6507f39d0e30db000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffe023b872dd00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffff60a9059cbb000000000000000000000000000000000000000000000000000000002e1a7d4d00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffdf00000000000000000000000000000000000000000000000000000001ffffffe000000000000000000000000000000000000000000000000000000003ffffffe020454149207472616e73666572206661696c65640000000000000000000000005472616e7366657248656c7065723a3a736166655472616e736665724541493a9d239c3ad6158bc2f486c3310d25622c5250fa11f60eb415f1d5b848ac0d145e616d6f756e74496e76616c696400000000000000000000000000000000000000ab7a1a256e1a3e6eefe1e11e862d92b2a9efd3ab45a0a0b3d330687f42021ec05265656e7472616e637947756172643a207265656e7472616e742063616c6c009a8a0592ac89c5ad3bc6df8224c17b485976f597df104ee20d0df415241f670bffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0000000000000000000000000000000000000000000000000ffffffffffffff5f0000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000ffffffffffffffc05361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65646f742073756363656564000000000000000000000000000000000000000000005361666545524332303a204552433230206f7065726174696f6e20646964206e416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000000200000200000000000000000000000000000000000000000000000000000000de14a8fc32d474b5e3e61d465a693896db72f6fd51831902e6a397c868333666", } // ImageHubABI is the input ABI used to generate the binding from. // Deprecated: Use ImageHubMetaData.ABI instead. var ImageHubABI = ImageHubMetaData.ABI // ImageHubBin is the compiled bytecode used for deploying new contracts. // Deprecated: Use ImageHubMetaData.Bin instead. var ImageHubBin = ImageHubMetaData.Bin // DeployImageHub deploys a new Ethereum contract, binding an instance of ImageHub to it. func DeployImageHub(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *ImageHub, error) { parsed, err := ImageHubMetaData.GetAbi() if err != nil { return common.Address{}, nil, nil, err } if parsed == nil { return common.Address{}, nil, nil, errors.New("GetABI returned nil") } address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(ImageHubBin), backend) if err != nil { return common.Address{}, nil, nil, err } return address, tx, &ImageHub{ImageHubCaller: ImageHubCaller{contract: contract}, ImageHubTransactor: ImageHubTransactor{contract: contract}, ImageHubFilterer: ImageHubFilterer{contract: contract}}, nil } // ImageHub is an auto generated Go binding around an Ethereum contract. type ImageHub struct { ImageHubCaller // Read-only binding to the contract ImageHubTransactor // Write-only binding to the contract ImageHubFilterer // Log filterer for contract events } // ImageHubCaller is an auto generated read-only Go binding around an Ethereum contract. type ImageHubCaller struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // ImageHubTransactor is an auto generated write-only Go binding around an Ethereum contract. type ImageHubTransactor struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // ImageHubFilterer is an auto generated log filtering Go binding around an Ethereum contract events. type ImageHubFilterer struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // ImageHubSession is an auto generated Go binding around an Ethereum contract, // with pre-set call and transact options. type ImageHubSession struct { Contract *ImageHub // Generic contract binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // ImageHubCallerSession is an auto generated read-only Go binding around an Ethereum contract, // with pre-set call options. type ImageHubCallerSession struct { Contract *ImageHubCaller // Generic contract caller binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session } // ImageHubTransactorSession is an auto generated write-only Go binding around an Ethereum contract, // with pre-set transact options. type ImageHubTransactorSession struct { Contract *ImageHubTransactor // Generic contract transactor binding to set the session for TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // ImageHubRaw is an auto generated low-level Go binding around an Ethereum contract. type ImageHubRaw struct { Contract *ImageHub // Generic contract binding to access the raw methods on } // ImageHubCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. type ImageHubCallerRaw struct { Contract *ImageHubCaller // Generic read-only contract binding to access the raw methods on } // ImageHubTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. type ImageHubTransactorRaw struct { Contract *ImageHubTransactor // Generic write-only contract binding to access the raw methods on } // NewImageHub creates a new instance of ImageHub, bound to a specific deployed contract. func NewImageHub(address common.Address, backend bind.ContractBackend) (*ImageHub, error) { contract, err := bindImageHub(address, backend, backend, backend) if err != nil { return nil, err } return &ImageHub{ImageHubCaller: ImageHubCaller{contract: contract}, ImageHubTransactor: ImageHubTransactor{contract: contract}, ImageHubFilterer: ImageHubFilterer{contract: contract}}, nil } // NewImageHubCaller creates a new read-only instance of ImageHub, bound to a specific deployed contract. func NewImageHubCaller(address common.Address, caller bind.ContractCaller) (*ImageHubCaller, error) { contract, err := bindImageHub(address, caller, nil, nil) if err != nil { return nil, err } return &ImageHubCaller{contract: contract}, nil } // NewImageHubTransactor creates a new write-only instance of ImageHub, bound to a specific deployed contract. func NewImageHubTransactor(address common.Address, transactor bind.ContractTransactor) (*ImageHubTransactor, error) { contract, err := bindImageHub(address, nil, transactor, nil) if err != nil { return nil, err } return &ImageHubTransactor{contract: contract}, nil } // NewImageHubFilterer creates a new log filterer instance of ImageHub, bound to a specific deployed contract. func NewImageHubFilterer(address common.Address, filterer bind.ContractFilterer) (*ImageHubFilterer, error) { contract, err := bindImageHub(address, nil, nil, filterer) if err != nil { return nil, err } return &ImageHubFilterer{contract: contract}, nil } // bindImageHub binds a generic wrapper to an already deployed contract. func bindImageHub(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { parsed, err := ImageHubMetaData.GetAbi() if err != nil { return nil, err } return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_ImageHub *ImageHubRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _ImageHub.Contract.ImageHubCaller.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_ImageHub *ImageHubRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _ImageHub.Contract.ImageHubTransactor.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_ImageHub *ImageHubRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _ImageHub.Contract.ImageHubTransactor.contract.Transact(opts, method, params...) } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_ImageHub *ImageHubCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _ImageHub.Contract.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_ImageHub *ImageHubTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _ImageHub.Contract.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_ImageHub *ImageHubTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _ImageHub.Contract.contract.Transact(opts, method, params...) } // GetChainId is a free data retrieval call binding the contract method 0x3408e470. // // Solidity: function getChainId() view returns(uint256 chainId) func (_ImageHub *ImageHubCaller) GetChainId(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} err := _ImageHub.contract.Call(opts, &out, "getChainId") if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // GetChainId is a free data retrieval call binding the contract method 0x3408e470. // // Solidity: function getChainId() view returns(uint256 chainId) func (_ImageHub *ImageHubSession) GetChainId() (*big.Int, error) { return _ImageHub.Contract.GetChainId(&_ImageHub.CallOpts) } // GetChainId is a free data retrieval call binding the contract method 0x3408e470. // // Solidity: function getChainId() view returns(uint256 chainId) func (_ImageHub *ImageHubCallerSession) GetChainId() (*big.Int, error) { return _ImageHub.Contract.GetChainId(&_ImageHub.CallOpts) } // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. // // Solidity: function owner() view returns(address) func (_ImageHub *ImageHubCaller) Owner(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _ImageHub.contract.Call(opts, &out, "owner") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. // // Solidity: function owner() view returns(address) func (_ImageHub *ImageHubSession) Owner() (common.Address, error) { return _ImageHub.Contract.Owner(&_ImageHub.CallOpts) } // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. // // Solidity: function owner() view returns(address) func (_ImageHub *ImageHubCallerSession) Owner() (common.Address, error) { return _ImageHub.Contract.Owner(&_ImageHub.CallOpts) } // ChargeSubscription is a paid mutator transaction binding the contract method 0xac884ab7. // // Solidity: function chargeSubscription(address user, address creator) returns() func (_ImageHub *ImageHubTransactor) ChargeSubscription(opts *bind.TransactOpts, user common.Address, creator common.Address) (*types.Transaction, error) { return _ImageHub.contract.Transact(opts, "chargeSubscription", user, creator) } // ChargeSubscription is a paid mutator transaction binding the contract method 0xac884ab7. // // Solidity: function chargeSubscription(address user, address creator) returns() func (_ImageHub *ImageHubSession) ChargeSubscription(user common.Address, creator common.Address) (*types.Transaction, error) { return _ImageHub.Contract.ChargeSubscription(&_ImageHub.TransactOpts, user, creator) } // ChargeSubscription is a paid mutator transaction binding the contract method 0xac884ab7. // // Solidity: function chargeSubscription(address user, address creator) returns() func (_ImageHub *ImageHubTransactorSession) ChargeSubscription(user common.Address, creator common.Address) (*types.Transaction, error) { return _ImageHub.Contract.ChargeSubscription(&_ImageHub.TransactOpts, user, creator) } // Initialize is a paid mutator transaction binding the contract method 0xc4d66de8. // // Solidity: function initialize(address WEAI) returns() func (_ImageHub *ImageHubTransactor) Initialize(opts *bind.TransactOpts, WEAI common.Address) (*types.Transaction, error) { return _ImageHub.contract.Transact(opts, "initialize", WEAI) } // Initialize is a paid mutator transaction binding the contract method 0xc4d66de8. // // Solidity: function initialize(address WEAI) returns() func (_ImageHub *ImageHubSession) Initialize(WEAI common.Address) (*types.Transaction, error) { return _ImageHub.Contract.Initialize(&_ImageHub.TransactOpts, WEAI) } // Initialize is a paid mutator transaction binding the contract method 0xc4d66de8. // // Solidity: function initialize(address WEAI) returns() func (_ImageHub *ImageHubTransactorSession) Initialize(WEAI common.Address) (*types.Transaction, error) { return _ImageHub.Contract.Initialize(&_ImageHub.TransactOpts, WEAI) } // Multicall is a paid mutator transaction binding the contract method 0xac9650d8. // // Solidity: function multicall(bytes[] data) payable returns(bytes[] results) func (_ImageHub *ImageHubTransactor) Multicall(opts *bind.TransactOpts, data [][]byte) (*types.Transaction, error) { return _ImageHub.contract.Transact(opts, "multicall", data) } // Multicall is a paid mutator transaction binding the contract method 0xac9650d8. // // Solidity: function multicall(bytes[] data) payable returns(bytes[] results) func (_ImageHub *ImageHubSession) Multicall(data [][]byte) (*types.Transaction, error) { return _ImageHub.Contract.Multicall(&_ImageHub.TransactOpts, data) } // Multicall is a paid mutator transaction binding the contract method 0xac9650d8. // // Solidity: function multicall(bytes[] data) payable returns(bytes[] results) func (_ImageHub *ImageHubTransactorSession) Multicall(data [][]byte) (*types.Transaction, error) { return _ImageHub.Contract.Multicall(&_ImageHub.TransactOpts, data) } // RegisterSubscription is a paid mutator transaction binding the contract method 0xe34e3b7e. // // Solidity: function registerSubscription(address user, address creator, uint256 duration, uint256 price) returns() func (_ImageHub *ImageHubTransactor) RegisterSubscription(opts *bind.TransactOpts, user common.Address, creator common.Address, duration *big.Int, price *big.Int) (*types.Transaction, error) { return _ImageHub.contract.Transact(opts, "registerSubscription", user, creator, duration, price) } // RegisterSubscription is a paid mutator transaction binding the contract method 0xe34e3b7e. // // Solidity: function registerSubscription(address user, address creator, uint256 duration, uint256 price) returns() func (_ImageHub *ImageHubSession) RegisterSubscription(user common.Address, creator common.Address, duration *big.Int, price *big.Int) (*types.Transaction, error) { return _ImageHub.Contract.RegisterSubscription(&_ImageHub.TransactOpts, user, creator, duration, price) } // RegisterSubscription is a paid mutator transaction binding the contract method 0xe34e3b7e. // // Solidity: function registerSubscription(address user, address creator, uint256 duration, uint256 price) returns() func (_ImageHub *ImageHubTransactorSession) RegisterSubscription(user common.Address, creator common.Address, duration *big.Int, price *big.Int) (*types.Transaction, error) { return _ImageHub.Contract.RegisterSubscription(&_ImageHub.TransactOpts, user, creator, duration, price) } // RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. // // Solidity: function renounceOwnership() returns() func (_ImageHub *ImageHubTransactor) RenounceOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { return _ImageHub.contract.Transact(opts, "renounceOwnership") } // RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. // // Solidity: function renounceOwnership() returns() func (_ImageHub *ImageHubSession) RenounceOwnership() (*types.Transaction, error) { return _ImageHub.Contract.RenounceOwnership(&_ImageHub.TransactOpts) } // RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. // // Solidity: function renounceOwnership() returns() func (_ImageHub *ImageHubTransactorSession) RenounceOwnership() (*types.Transaction, error) { return _ImageHub.Contract.RenounceOwnership(&_ImageHub.TransactOpts) } // TransferImageTip is a paid mutator transaction binding the contract method 0x6fc563be. // // Solidity: function transferImageTip(address creator, uint256 imageId, uint256 amount) payable returns() func (_ImageHub *ImageHubTransactor) TransferImageTip(opts *bind.TransactOpts, creator common.Address, imageId *big.Int, amount *big.Int) (*types.Transaction, error) { return _ImageHub.contract.Transact(opts, "transferImageTip", creator, imageId, amount) } // TransferImageTip is a paid mutator transaction binding the contract method 0x6fc563be. // // Solidity: function transferImageTip(address creator, uint256 imageId, uint256 amount) payable returns() func (_ImageHub *ImageHubSession) TransferImageTip(creator common.Address, imageId *big.Int, amount *big.Int) (*types.Transaction, error) { return _ImageHub.Contract.TransferImageTip(&_ImageHub.TransactOpts, creator, imageId, amount) } // TransferImageTip is a paid mutator transaction binding the contract method 0x6fc563be. // // Solidity: function transferImageTip(address creator, uint256 imageId, uint256 amount) payable returns() func (_ImageHub *ImageHubTransactorSession) TransferImageTip(creator common.Address, imageId *big.Int, amount *big.Int) (*types.Transaction, error) { return _ImageHub.Contract.TransferImageTip(&_ImageHub.TransactOpts, creator, imageId, amount) } // TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. // // Solidity: function transferOwnership(address newOwner) returns() func (_ImageHub *ImageHubTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) { return _ImageHub.contract.Transact(opts, "transferOwnership", newOwner) } // TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. // // Solidity: function transferOwnership(address newOwner) returns() func (_ImageHub *ImageHubSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { return _ImageHub.Contract.TransferOwnership(&_ImageHub.TransactOpts, newOwner) } // TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. // // Solidity: function transferOwnership(address newOwner) returns() func (_ImageHub *ImageHubTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { return _ImageHub.Contract.TransferOwnership(&_ImageHub.TransactOpts, newOwner) } // UpdateSubscriptionPrice is a paid mutator transaction binding the contract method 0x667e9660. // // Solidity: function updateSubscriptionPrice(uint256 duration, uint256 price) returns() func (_ImageHub *ImageHubTransactor) UpdateSubscriptionPrice(opts *bind.TransactOpts, duration *big.Int, price *big.Int) (*types.Transaction, error) { return _ImageHub.contract.Transact(opts, "updateSubscriptionPrice", duration, price) } // UpdateSubscriptionPrice is a paid mutator transaction binding the contract method 0x667e9660. // // Solidity: function updateSubscriptionPrice(uint256 duration, uint256 price) returns() func (_ImageHub *ImageHubSession) UpdateSubscriptionPrice(duration *big.Int, price *big.Int) (*types.Transaction, error) { return _ImageHub.Contract.UpdateSubscriptionPrice(&_ImageHub.TransactOpts, duration, price) } // UpdateSubscriptionPrice is a paid mutator transaction binding the contract method 0x667e9660. // // Solidity: function updateSubscriptionPrice(uint256 duration, uint256 price) returns() func (_ImageHub *ImageHubTransactorSession) UpdateSubscriptionPrice(duration *big.Int, price *big.Int) (*types.Transaction, error) { return _ImageHub.Contract.UpdateSubscriptionPrice(&_ImageHub.TransactOpts, duration, price) } // ImageHubImageTipTransferredIterator is returned from FilterImageTipTransferred and is used to iterate over the raw logs and unpacked data for ImageTipTransferred events raised by the ImageHub contract. type ImageHubImageTipTransferredIterator struct { Event *ImageHubImageTipTransferred // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *ImageHubImageTipTransferredIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(ImageHubImageTipTransferred) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(ImageHubImageTipTransferred) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *ImageHubImageTipTransferredIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *ImageHubImageTipTransferredIterator) Close() error { it.sub.Unsubscribe() return nil } // ImageHubImageTipTransferred represents a ImageTipTransferred event raised by the ImageHub contract. type ImageHubImageTipTransferred struct { User common.Address Creator common.Address ImageId *big.Int Amount *big.Int Fee *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterImageTipTransferred is a free log retrieval operation binding the contract event 0x9d239c3ad6158bc2f486c3310d25622c5250fa11f60eb415f1d5b848ac0d145e. // // Solidity: event ImageTipTransferred(address indexed user, address indexed creator, uint256 indexed imageId, uint256 amount, uint256 fee) func (_ImageHub *ImageHubFilterer) FilterImageTipTransferred(opts *bind.FilterOpts, user []common.Address, creator []common.Address, imageId []*big.Int) (*ImageHubImageTipTransferredIterator, error) { var userRule []interface{} for _, userItem := range user { userRule = append(userRule, userItem) } var creatorRule []interface{} for _, creatorItem := range creator { creatorRule = append(creatorRule, creatorItem) } var imageIdRule []interface{} for _, imageIdItem := range imageId { imageIdRule = append(imageIdRule, imageIdItem) } logs, sub, err := _ImageHub.contract.FilterLogs(opts, "ImageTipTransferred", userRule, creatorRule, imageIdRule) if err != nil { return nil, err } return &ImageHubImageTipTransferredIterator{contract: _ImageHub.contract, event: "ImageTipTransferred", logs: logs, sub: sub}, nil } // WatchImageTipTransferred is a free log subscription operation binding the contract event 0x9d239c3ad6158bc2f486c3310d25622c5250fa11f60eb415f1d5b848ac0d145e. // // Solidity: event ImageTipTransferred(address indexed user, address indexed creator, uint256 indexed imageId, uint256 amount, uint256 fee) func (_ImageHub *ImageHubFilterer) WatchImageTipTransferred(opts *bind.WatchOpts, sink chan<- *ImageHubImageTipTransferred, user []common.Address, creator []common.Address, imageId []*big.Int) (event.Subscription, error) { var userRule []interface{} for _, userItem := range user { userRule = append(userRule, userItem) } var creatorRule []interface{} for _, creatorItem := range creator { creatorRule = append(creatorRule, creatorItem) } var imageIdRule []interface{} for _, imageIdItem := range imageId { imageIdRule = append(imageIdRule, imageIdItem) } logs, sub, err := _ImageHub.contract.WatchLogs(opts, "ImageTipTransferred", userRule, creatorRule, imageIdRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(ImageHubImageTipTransferred) if err := _ImageHub.contract.UnpackLog(event, "ImageTipTransferred", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseImageTipTransferred is a log parse operation binding the contract event 0x9d239c3ad6158bc2f486c3310d25622c5250fa11f60eb415f1d5b848ac0d145e. // // Solidity: event ImageTipTransferred(address indexed user, address indexed creator, uint256 indexed imageId, uint256 amount, uint256 fee) func (_ImageHub *ImageHubFilterer) ParseImageTipTransferred(log types.Log) (*ImageHubImageTipTransferred, error) { event := new(ImageHubImageTipTransferred) if err := _ImageHub.contract.UnpackLog(event, "ImageTipTransferred", log); err != nil { return nil, err } event.Raw = log return event, nil } // ImageHubInitializedIterator is returned from FilterInitialized and is used to iterate over the raw logs and unpacked data for Initialized events raised by the ImageHub contract. type ImageHubInitializedIterator struct { Event *ImageHubInitialized // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *ImageHubInitializedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(ImageHubInitialized) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(ImageHubInitialized) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *ImageHubInitializedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *ImageHubInitializedIterator) Close() error { it.sub.Unsubscribe() return nil } // ImageHubInitialized represents a Initialized event raised by the ImageHub contract. type ImageHubInitialized struct { Version uint8 Raw types.Log // Blockchain specific contextual infos } // FilterInitialized is a free log retrieval operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. // // Solidity: event Initialized(uint8 version) func (_ImageHub *ImageHubFilterer) FilterInitialized(opts *bind.FilterOpts) (*ImageHubInitializedIterator, error) { logs, sub, err := _ImageHub.contract.FilterLogs(opts, "Initialized") if err != nil { return nil, err } return &ImageHubInitializedIterator{contract: _ImageHub.contract, event: "Initialized", logs: logs, sub: sub}, nil } // WatchInitialized is a free log subscription operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. // // Solidity: event Initialized(uint8 version) func (_ImageHub *ImageHubFilterer) WatchInitialized(opts *bind.WatchOpts, sink chan<- *ImageHubInitialized) (event.Subscription, error) { logs, sub, err := _ImageHub.contract.WatchLogs(opts, "Initialized") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(ImageHubInitialized) if err := _ImageHub.contract.UnpackLog(event, "Initialized", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseInitialized is a log parse operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. // // Solidity: event Initialized(uint8 version) func (_ImageHub *ImageHubFilterer) ParseInitialized(log types.Log) (*ImageHubInitialized, error) { event := new(ImageHubInitialized) if err := _ImageHub.contract.UnpackLog(event, "Initialized", log); err != nil { return nil, err } event.Raw = log return event, nil } // ImageHubOwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the ImageHub contract. type ImageHubOwnershipTransferredIterator struct { Event *ImageHubOwnershipTransferred // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *ImageHubOwnershipTransferredIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(ImageHubOwnershipTransferred) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(ImageHubOwnershipTransferred) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *ImageHubOwnershipTransferredIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *ImageHubOwnershipTransferredIterator) Close() error { it.sub.Unsubscribe() return nil } // ImageHubOwnershipTransferred represents a OwnershipTransferred event raised by the ImageHub contract. type ImageHubOwnershipTransferred struct { PreviousOwner common.Address NewOwner common.Address Raw types.Log // Blockchain specific contextual infos } // FilterOwnershipTransferred is a free log retrieval operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. // // Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) func (_ImageHub *ImageHubFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*ImageHubOwnershipTransferredIterator, error) { var previousOwnerRule []interface{} for _, previousOwnerItem := range previousOwner { previousOwnerRule = append(previousOwnerRule, previousOwnerItem) } var newOwnerRule []interface{} for _, newOwnerItem := range newOwner { newOwnerRule = append(newOwnerRule, newOwnerItem) } logs, sub, err := _ImageHub.contract.FilterLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) if err != nil { return nil, err } return &ImageHubOwnershipTransferredIterator{contract: _ImageHub.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil } // WatchOwnershipTransferred is a free log subscription operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. // // Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) func (_ImageHub *ImageHubFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *ImageHubOwnershipTransferred, previousOwner []common.Address, newOwner []common.Address) (event.Subscription, error) { var previousOwnerRule []interface{} for _, previousOwnerItem := range previousOwner { previousOwnerRule = append(previousOwnerRule, previousOwnerItem) } var newOwnerRule []interface{} for _, newOwnerItem := range newOwner { newOwnerRule = append(newOwnerRule, newOwnerItem) } logs, sub, err := _ImageHub.contract.WatchLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(ImageHubOwnershipTransferred) if err := _ImageHub.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseOwnershipTransferred is a log parse operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. // // Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) func (_ImageHub *ImageHubFilterer) ParseOwnershipTransferred(log types.Log) (*ImageHubOwnershipTransferred, error) { event := new(ImageHubOwnershipTransferred) if err := _ImageHub.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { return nil, err } event.Raw = log return event, nil } // ImageHubSubscriptionChargedIterator is returned from FilterSubscriptionCharged and is used to iterate over the raw logs and unpacked data for SubscriptionCharged events raised by the ImageHub contract. type ImageHubSubscriptionChargedIterator struct { Event *ImageHubSubscriptionCharged // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *ImageHubSubscriptionChargedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(ImageHubSubscriptionCharged) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(ImageHubSubscriptionCharged) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *ImageHubSubscriptionChargedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *ImageHubSubscriptionChargedIterator) Close() error { it.sub.Unsubscribe() return nil } // ImageHubSubscriptionCharged represents a SubscriptionCharged event raised by the ImageHub contract. type ImageHubSubscriptionCharged struct { User common.Address Creator common.Address Duration *big.Int ExpiredAt *big.Int Amount *big.Int Fee *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterSubscriptionCharged is a free log retrieval operation binding the contract event 0x0bc8ce05a473cd40acc9b6689277d1b7c59ff62cb5491e8ec926bddb9e365a36. // // Solidity: event SubscriptionCharged(address indexed user, address indexed creator, uint256 duration, uint256 expiredAt, uint256 amount, uint256 fee) func (_ImageHub *ImageHubFilterer) FilterSubscriptionCharged(opts *bind.FilterOpts, user []common.Address, creator []common.Address) (*ImageHubSubscriptionChargedIterator, error) { var userRule []interface{} for _, userItem := range user { userRule = append(userRule, userItem) } var creatorRule []interface{} for _, creatorItem := range creator { creatorRule = append(creatorRule, creatorItem) } logs, sub, err := _ImageHub.contract.FilterLogs(opts, "SubscriptionCharged", userRule, creatorRule) if err != nil { return nil, err } return &ImageHubSubscriptionChargedIterator{contract: _ImageHub.contract, event: "SubscriptionCharged", logs: logs, sub: sub}, nil } // WatchSubscriptionCharged is a free log subscription operation binding the contract event 0x0bc8ce05a473cd40acc9b6689277d1b7c59ff62cb5491e8ec926bddb9e365a36. // // Solidity: event SubscriptionCharged(address indexed user, address indexed creator, uint256 duration, uint256 expiredAt, uint256 amount, uint256 fee) func (_ImageHub *ImageHubFilterer) WatchSubscriptionCharged(opts *bind.WatchOpts, sink chan<- *ImageHubSubscriptionCharged, user []common.Address, creator []common.Address) (event.Subscription, error) { var userRule []interface{} for _, userItem := range user { userRule = append(userRule, userItem) } var creatorRule []interface{} for _, creatorItem := range creator { creatorRule = append(creatorRule, creatorItem) } logs, sub, err := _ImageHub.contract.WatchLogs(opts, "SubscriptionCharged", userRule, creatorRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(ImageHubSubscriptionCharged) if err := _ImageHub.contract.UnpackLog(event, "SubscriptionCharged", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseSubscriptionCharged is a log parse operation binding the contract event 0x0bc8ce05a473cd40acc9b6689277d1b7c59ff62cb5491e8ec926bddb9e365a36. // // Solidity: event SubscriptionCharged(address indexed user, address indexed creator, uint256 duration, uint256 expiredAt, uint256 amount, uint256 fee) func (_ImageHub *ImageHubFilterer) ParseSubscriptionCharged(log types.Log) (*ImageHubSubscriptionCharged, error) { event := new(ImageHubSubscriptionCharged) if err := _ImageHub.contract.UnpackLog(event, "SubscriptionCharged", log); err != nil { return nil, err } event.Raw = log return event, nil } // ImageHubSubscriptionPriceUpdatedIterator is returned from FilterSubscriptionPriceUpdated and is used to iterate over the raw logs and unpacked data for SubscriptionPriceUpdated events raised by the ImageHub contract. type ImageHubSubscriptionPriceUpdatedIterator struct { Event *ImageHubSubscriptionPriceUpdated // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *ImageHubSubscriptionPriceUpdatedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(ImageHubSubscriptionPriceUpdated) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(ImageHubSubscriptionPriceUpdated) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *ImageHubSubscriptionPriceUpdatedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *ImageHubSubscriptionPriceUpdatedIterator) Close() error { it.sub.Unsubscribe() return nil } // ImageHubSubscriptionPriceUpdated represents a SubscriptionPriceUpdated event raised by the ImageHub contract. type ImageHubSubscriptionPriceUpdated struct { Creator common.Address Duration *big.Int Price *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterSubscriptionPriceUpdated is a free log retrieval operation binding the contract event 0xab7a1a256e1a3e6eefe1e11e862d92b2a9efd3ab45a0a0b3d330687f42021ec0. // // Solidity: event SubscriptionPriceUpdated(address indexed creator, uint256 duration, uint256 price) func (_ImageHub *ImageHubFilterer) FilterSubscriptionPriceUpdated(opts *bind.FilterOpts, creator []common.Address) (*ImageHubSubscriptionPriceUpdatedIterator, error) { var creatorRule []interface{} for _, creatorItem := range creator { creatorRule = append(creatorRule, creatorItem) } logs, sub, err := _ImageHub.contract.FilterLogs(opts, "SubscriptionPriceUpdated", creatorRule) if err != nil { return nil, err } return &ImageHubSubscriptionPriceUpdatedIterator{contract: _ImageHub.contract, event: "SubscriptionPriceUpdated", logs: logs, sub: sub}, nil } // WatchSubscriptionPriceUpdated is a free log subscription operation binding the contract event 0xab7a1a256e1a3e6eefe1e11e862d92b2a9efd3ab45a0a0b3d330687f42021ec0. // // Solidity: event SubscriptionPriceUpdated(address indexed creator, uint256 duration, uint256 price) func (_ImageHub *ImageHubFilterer) WatchSubscriptionPriceUpdated(opts *bind.WatchOpts, sink chan<- *ImageHubSubscriptionPriceUpdated, creator []common.Address) (event.Subscription, error) { var creatorRule []interface{} for _, creatorItem := range creator { creatorRule = append(creatorRule, creatorItem) } logs, sub, err := _ImageHub.contract.WatchLogs(opts, "SubscriptionPriceUpdated", creatorRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(ImageHubSubscriptionPriceUpdated) if err := _ImageHub.contract.UnpackLog(event, "SubscriptionPriceUpdated", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseSubscriptionPriceUpdated is a log parse operation binding the contract event 0xab7a1a256e1a3e6eefe1e11e862d92b2a9efd3ab45a0a0b3d330687f42021ec0. // // Solidity: event SubscriptionPriceUpdated(address indexed creator, uint256 duration, uint256 price) func (_ImageHub *ImageHubFilterer) ParseSubscriptionPriceUpdated(log types.Log) (*ImageHubSubscriptionPriceUpdated, error) { event := new(ImageHubSubscriptionPriceUpdated) if err := _ImageHub.contract.UnpackLog(event, "SubscriptionPriceUpdated", log); err != nil { return nil, err } event.Raw = log return event, nil } // ImageHubSubscriptionRegisteredIterator is returned from FilterSubscriptionRegistered and is used to iterate over the raw logs and unpacked data for SubscriptionRegistered events raised by the ImageHub contract. type ImageHubSubscriptionRegisteredIterator struct { Event *ImageHubSubscriptionRegistered // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *ImageHubSubscriptionRegisteredIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(ImageHubSubscriptionRegistered) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(ImageHubSubscriptionRegistered) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *ImageHubSubscriptionRegisteredIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *ImageHubSubscriptionRegisteredIterator) Close() error { it.sub.Unsubscribe() return nil } // ImageHubSubscriptionRegistered represents a SubscriptionRegistered event raised by the ImageHub contract. type ImageHubSubscriptionRegistered struct { User common.Address Creator common.Address Duration *big.Int Price *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterSubscriptionRegistered is a free log retrieval operation binding the contract event 0xe1b67d1786c6125e949791ee25291c8dc38b471ae947bf8c65433da2f31149bf. // // Solidity: event SubscriptionRegistered(address indexed user, address indexed creator, uint256 duration, uint256 price) func (_ImageHub *ImageHubFilterer) FilterSubscriptionRegistered(opts *bind.FilterOpts, user []common.Address, creator []common.Address) (*ImageHubSubscriptionRegisteredIterator, error) { var userRule []interface{} for _, userItem := range user { userRule = append(userRule, userItem) } var creatorRule []interface{} for _, creatorItem := range creator { creatorRule = append(creatorRule, creatorItem) } logs, sub, err := _ImageHub.contract.FilterLogs(opts, "SubscriptionRegistered", userRule, creatorRule) if err != nil { return nil, err } return &ImageHubSubscriptionRegisteredIterator{contract: _ImageHub.contract, event: "SubscriptionRegistered", logs: logs, sub: sub}, nil } // WatchSubscriptionRegistered is a free log subscription operation binding the contract event 0xe1b67d1786c6125e949791ee25291c8dc38b471ae947bf8c65433da2f31149bf. // // Solidity: event SubscriptionRegistered(address indexed user, address indexed creator, uint256 duration, uint256 price) func (_ImageHub *ImageHubFilterer) WatchSubscriptionRegistered(opts *bind.WatchOpts, sink chan<- *ImageHubSubscriptionRegistered, user []common.Address, creator []common.Address) (event.Subscription, error) { var userRule []interface{} for _, userItem := range user { userRule = append(userRule, userItem) } var creatorRule []interface{} for _, creatorItem := range creator { creatorRule = append(creatorRule, creatorItem) } logs, sub, err := _ImageHub.contract.WatchLogs(opts, "SubscriptionRegistered", userRule, creatorRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(ImageHubSubscriptionRegistered) if err := _ImageHub.contract.UnpackLog(event, "SubscriptionRegistered", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseSubscriptionRegistered is a log parse operation binding the contract event 0xe1b67d1786c6125e949791ee25291c8dc38b471ae947bf8c65433da2f31149bf. // // Solidity: event SubscriptionRegistered(address indexed user, address indexed creator, uint256 duration, uint256 price) func (_ImageHub *ImageHubFilterer) ParseSubscriptionRegistered(log types.Log) (*ImageHubSubscriptionRegistered, error) { event := new(ImageHubSubscriptionRegistered) if err := _ImageHub.contract.UnpackLog(event, "SubscriptionRegistered", log); err != nil { return nil, err } event.Raw = log return event, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/binds/isystempromptmanager/ISystemPromptManager.go ================================================ // Code generated - DO NOT EDIT. // This file is a generated binding and any manual changes will be lost. package isystempromptmanager import ( "errors" "math/big" "strings" ethereum "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/event" ) // Reference imports to suppress errors if they are not otherwise used. var ( _ = errors.New _ = big.NewInt _ = strings.NewReader _ = ethereum.NotFound _ = bind.Bind _ = common.Big1 _ = types.BloomLookup _ = event.NewSubscription _ = abi.ConvertType ) // ISystemPromptManagerTokenMetaData is an auto generated low-level Go binding around an user-defined struct. type ISystemPromptManagerTokenMetaData struct { Fee *big.Int SysPrompts [][]byte } // SystemPromptManagerMetaData contains all meta data concerning the SystemPromptManager contract. var SystemPromptManagerMetaData = &bind.MetaData{ ABI: "[{\"inputs\":[],\"name\":\"AlreadyMinted\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Authorized\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FailedTransfer\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FailedTransfer\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InsufficientFunds\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidNFTData\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidSignature\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Unauthorized\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"agentId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes[]\",\"name\":\"sysPrompt\",\"type\":\"bytes[]\"}],\"name\":\"AgentDataAddNew\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"agentId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"promptIndex\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"oldSysPrompt\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"newSysPrompt\",\"type\":\"bytes\"}],\"name\":\"AgentDataUpdate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"agentId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"fee\",\"type\":\"uint256\"}],\"name\":\"AgentFeeUpdate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"agentId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"uri\",\"type\":\"string\"}],\"name\":\"AgentURIUpdate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"approved\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"ApprovalForAll\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_fromTokenId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_toTokenId\",\"type\":\"uint256\"}],\"name\":\"BatchMetadataUpdate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"EIP712DomainChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"claimer\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"FeesClaimed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"fee\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"externalData\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"inferenceId\",\"type\":\"uint256\"}],\"name\":\"InferencePerformed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"ManagerAuthorization\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"ManagerDeauthorization\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_tokenId\",\"type\":\"uint256\"}],\"name\":\"MetadataUpdate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newValue\",\"type\":\"uint256\"}],\"name\":\"MintPriceUpdate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"uri\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"sysPrompt\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"fee\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"minter\",\"type\":\"address\"}],\"name\":\"NewToken\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"Paused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"newValue\",\"type\":\"uint16\"}],\"name\":\"RoyaltyPortionUpdate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAddress\",\"type\":\"address\"}],\"name\":\"RoyaltyReceiverUpdate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"agentId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TopUpPoolBalance\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"Unpaused\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_agentId\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_sysPrompt\",\"type\":\"bytes\"}],\"name\":\"addNewAgentData\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_account\",\"type\":\"address\"}],\"name\":\"authorizeManager\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"claimFee\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_agentId\",\"type\":\"uint256\"}],\"name\":\"dataOf\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"fee\",\"type\":\"uint256\"},{\"internalType\":\"bytes[]\",\"name\":\"sysPrompts\",\"type\":\"bytes[]\"}],\"internalType\":\"structISystemPromptManager.TokenMetaData\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_account\",\"type\":\"address\"}],\"name\":\"deauthorizeManager\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"nftOwner\",\"type\":\"address\"}],\"name\":\"earnedFees\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"eip712Domain\",\"outputs\":[{\"internalType\":\"bytes1\",\"name\":\"fields\",\"type\":\"bytes1\"},{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"version\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"verifyingContract\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"salt\",\"type\":\"bytes32\"},{\"internalType\":\"uint256[]\",\"name\":\"extensions\",\"type\":\"uint256[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_agentId\",\"type\":\"uint256\"}],\"name\":\"getAgentFee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_agentId\",\"type\":\"uint256\"}],\"name\":\"getAgentSystemPrompt\",\"outputs\":[{\"internalType\":\"bytes[]\",\"name\":\"\",\"type\":\"bytes[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"getApproved\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"_uri\",\"type\":\"string\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"_fee\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"_manager\",\"type\":\"address\"}],\"name\":\"getHashToSign\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"hybridModel\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_agentId\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_calldata\",\"type\":\"bytes\"},{\"internalType\":\"string\",\"name\":\"_externalData\",\"type\":\"string\"}],\"name\":\"infer\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_name\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"_symbol\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"_mintPrice\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"_royaltyReceiver\",\"type\":\"address\"},{\"internalType\":\"uint16\",\"name\":\"_royaltyPortion\",\"type\":\"uint16\"},{\"internalType\":\"uint256\",\"name\":\"_nextTokenId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"_hybridModel\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_workerHub\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"name\":\"isApprovedForAll\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"isManager\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"_uri\",\"type\":\"string\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"_fee\",\"type\":\"uint256\"}],\"name\":\"mint\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"_uri\",\"type\":\"string\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"_fee\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"_manager\",\"type\":\"address\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"mintBySignature\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"mintPrice\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"nextTokenId\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"ownerOf\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"paused\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"nftId\",\"type\":\"uint256\"}],\"name\":\"poolBalance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_agentId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_salePrice\",\"type\":\"uint256\"}],\"name\":\"royaltyInfo\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"royaltyPortion\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"royaltyReceiver\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"safeTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"safeTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"setApprovalForAll\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_hybridModel\",\"type\":\"address\"}],\"name\":\"setHybridModel\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"_interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"}],\"name\":\"tokenByIndex\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"}],\"name\":\"tokenOfOwnerByIndex\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_agentId\",\"type\":\"uint256\"}],\"name\":\"tokenURI\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_agentId\",\"type\":\"uint256\"}],\"name\":\"topUpPoolBalance\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"unpause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_agentId\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_sysPrompt\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"_promptIdx\",\"type\":\"uint256\"}],\"name\":\"updateAgentData\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_agentId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_fee\",\"type\":\"uint256\"}],\"name\":\"updateAgentFee\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_agentId\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"_uri\",\"type\":\"string\"}],\"name\":\"updateAgentURI\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_mintPrice\",\"type\":\"uint256\"}],\"name\":\"updateMintPrice\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"_royaltyPortion\",\"type\":\"uint16\"}],\"name\":\"updateRoyaltyPortion\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_royaltyReceiver\",\"type\":\"address\"}],\"name\":\"updateRoyaltyReceiver\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"version\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_value\",\"type\":\"uint256\"}],\"name\":\"withdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]", } // SystemPromptManagerABI is the input ABI used to generate the binding from. // Deprecated: Use SystemPromptManagerMetaData.ABI instead. var SystemPromptManagerABI = SystemPromptManagerMetaData.ABI // SystemPromptManager is an auto generated Go binding around an Ethereum contract. type SystemPromptManager struct { SystemPromptManagerCaller // Read-only binding to the contract SystemPromptManagerTransactor // Write-only binding to the contract SystemPromptManagerFilterer // Log filterer for contract events } // SystemPromptManagerCaller is an auto generated read-only Go binding around an Ethereum contract. type SystemPromptManagerCaller struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // SystemPromptManagerTransactor is an auto generated write-only Go binding around an Ethereum contract. type SystemPromptManagerTransactor struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // SystemPromptManagerFilterer is an auto generated log filtering Go binding around an Ethereum contract events. type SystemPromptManagerFilterer struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // SystemPromptManagerSession is an auto generated Go binding around an Ethereum contract, // with pre-set call and transact options. type SystemPromptManagerSession struct { Contract *SystemPromptManager // Generic contract binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // SystemPromptManagerCallerSession is an auto generated read-only Go binding around an Ethereum contract, // with pre-set call options. type SystemPromptManagerCallerSession struct { Contract *SystemPromptManagerCaller // Generic contract caller binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session } // SystemPromptManagerTransactorSession is an auto generated write-only Go binding around an Ethereum contract, // with pre-set transact options. type SystemPromptManagerTransactorSession struct { Contract *SystemPromptManagerTransactor // Generic contract transactor binding to set the session for TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // SystemPromptManagerRaw is an auto generated low-level Go binding around an Ethereum contract. type SystemPromptManagerRaw struct { Contract *SystemPromptManager // Generic contract binding to access the raw methods on } // SystemPromptManagerCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. type SystemPromptManagerCallerRaw struct { Contract *SystemPromptManagerCaller // Generic read-only contract binding to access the raw methods on } // SystemPromptManagerTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. type SystemPromptManagerTransactorRaw struct { Contract *SystemPromptManagerTransactor // Generic write-only contract binding to access the raw methods on } // NewSystemPromptManager creates a new instance of SystemPromptManager, bound to a specific deployed contract. func NewSystemPromptManager(address common.Address, backend bind.ContractBackend) (*SystemPromptManager, error) { contract, err := bindSystemPromptManager(address, backend, backend, backend) if err != nil { return nil, err } return &SystemPromptManager{SystemPromptManagerCaller: SystemPromptManagerCaller{contract: contract}, SystemPromptManagerTransactor: SystemPromptManagerTransactor{contract: contract}, SystemPromptManagerFilterer: SystemPromptManagerFilterer{contract: contract}}, nil } // NewSystemPromptManagerCaller creates a new read-only instance of SystemPromptManager, bound to a specific deployed contract. func NewSystemPromptManagerCaller(address common.Address, caller bind.ContractCaller) (*SystemPromptManagerCaller, error) { contract, err := bindSystemPromptManager(address, caller, nil, nil) if err != nil { return nil, err } return &SystemPromptManagerCaller{contract: contract}, nil } // NewSystemPromptManagerTransactor creates a new write-only instance of SystemPromptManager, bound to a specific deployed contract. func NewSystemPromptManagerTransactor(address common.Address, transactor bind.ContractTransactor) (*SystemPromptManagerTransactor, error) { contract, err := bindSystemPromptManager(address, nil, transactor, nil) if err != nil { return nil, err } return &SystemPromptManagerTransactor{contract: contract}, nil } // NewSystemPromptManagerFilterer creates a new log filterer instance of SystemPromptManager, bound to a specific deployed contract. func NewSystemPromptManagerFilterer(address common.Address, filterer bind.ContractFilterer) (*SystemPromptManagerFilterer, error) { contract, err := bindSystemPromptManager(address, nil, nil, filterer) if err != nil { return nil, err } return &SystemPromptManagerFilterer{contract: contract}, nil } // bindSystemPromptManager binds a generic wrapper to an already deployed contract. func bindSystemPromptManager(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { parsed, err := SystemPromptManagerMetaData.GetAbi() if err != nil { return nil, err } return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_SystemPromptManager *SystemPromptManagerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _SystemPromptManager.Contract.SystemPromptManagerCaller.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_SystemPromptManager *SystemPromptManagerRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _SystemPromptManager.Contract.SystemPromptManagerTransactor.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_SystemPromptManager *SystemPromptManagerRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _SystemPromptManager.Contract.SystemPromptManagerTransactor.contract.Transact(opts, method, params...) } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_SystemPromptManager *SystemPromptManagerCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _SystemPromptManager.Contract.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_SystemPromptManager *SystemPromptManagerTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _SystemPromptManager.Contract.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_SystemPromptManager *SystemPromptManagerTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _SystemPromptManager.Contract.contract.Transact(opts, method, params...) } // BalanceOf is a free data retrieval call binding the contract method 0x70a08231. // // Solidity: function balanceOf(address owner) view returns(uint256) func (_SystemPromptManager *SystemPromptManagerCaller) BalanceOf(opts *bind.CallOpts, owner common.Address) (*big.Int, error) { var out []interface{} err := _SystemPromptManager.contract.Call(opts, &out, "balanceOf", owner) if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // BalanceOf is a free data retrieval call binding the contract method 0x70a08231. // // Solidity: function balanceOf(address owner) view returns(uint256) func (_SystemPromptManager *SystemPromptManagerSession) BalanceOf(owner common.Address) (*big.Int, error) { return _SystemPromptManager.Contract.BalanceOf(&_SystemPromptManager.CallOpts, owner) } // BalanceOf is a free data retrieval call binding the contract method 0x70a08231. // // Solidity: function balanceOf(address owner) view returns(uint256) func (_SystemPromptManager *SystemPromptManagerCallerSession) BalanceOf(owner common.Address) (*big.Int, error) { return _SystemPromptManager.Contract.BalanceOf(&_SystemPromptManager.CallOpts, owner) } // DataOf is a free data retrieval call binding the contract method 0x871caa98. // // Solidity: function dataOf(uint256 _agentId) view returns((uint256,bytes[])) func (_SystemPromptManager *SystemPromptManagerCaller) DataOf(opts *bind.CallOpts, _agentId *big.Int) (ISystemPromptManagerTokenMetaData, error) { var out []interface{} err := _SystemPromptManager.contract.Call(opts, &out, "dataOf", _agentId) if err != nil { return *new(ISystemPromptManagerTokenMetaData), err } out0 := *abi.ConvertType(out[0], new(ISystemPromptManagerTokenMetaData)).(*ISystemPromptManagerTokenMetaData) return out0, err } // DataOf is a free data retrieval call binding the contract method 0x871caa98. // // Solidity: function dataOf(uint256 _agentId) view returns((uint256,bytes[])) func (_SystemPromptManager *SystemPromptManagerSession) DataOf(_agentId *big.Int) (ISystemPromptManagerTokenMetaData, error) { return _SystemPromptManager.Contract.DataOf(&_SystemPromptManager.CallOpts, _agentId) } // DataOf is a free data retrieval call binding the contract method 0x871caa98. // // Solidity: function dataOf(uint256 _agentId) view returns((uint256,bytes[])) func (_SystemPromptManager *SystemPromptManagerCallerSession) DataOf(_agentId *big.Int) (ISystemPromptManagerTokenMetaData, error) { return _SystemPromptManager.Contract.DataOf(&_SystemPromptManager.CallOpts, _agentId) } // EarnedFees is a free data retrieval call binding the contract method 0xfeb7219d. // // Solidity: function earnedFees(address nftOwner) view returns(uint256) func (_SystemPromptManager *SystemPromptManagerCaller) EarnedFees(opts *bind.CallOpts, nftOwner common.Address) (*big.Int, error) { var out []interface{} err := _SystemPromptManager.contract.Call(opts, &out, "earnedFees", nftOwner) if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // EarnedFees is a free data retrieval call binding the contract method 0xfeb7219d. // // Solidity: function earnedFees(address nftOwner) view returns(uint256) func (_SystemPromptManager *SystemPromptManagerSession) EarnedFees(nftOwner common.Address) (*big.Int, error) { return _SystemPromptManager.Contract.EarnedFees(&_SystemPromptManager.CallOpts, nftOwner) } // EarnedFees is a free data retrieval call binding the contract method 0xfeb7219d. // // Solidity: function earnedFees(address nftOwner) view returns(uint256) func (_SystemPromptManager *SystemPromptManagerCallerSession) EarnedFees(nftOwner common.Address) (*big.Int, error) { return _SystemPromptManager.Contract.EarnedFees(&_SystemPromptManager.CallOpts, nftOwner) } // Eip712Domain is a free data retrieval call binding the contract method 0x84b0196e. // // Solidity: function eip712Domain() view returns(bytes1 fields, string name, string version, uint256 chainId, address verifyingContract, bytes32 salt, uint256[] extensions) func (_SystemPromptManager *SystemPromptManagerCaller) Eip712Domain(opts *bind.CallOpts) (struct { Fields [1]byte Name string Version string ChainId *big.Int VerifyingContract common.Address Salt [32]byte Extensions []*big.Int }, error) { var out []interface{} err := _SystemPromptManager.contract.Call(opts, &out, "eip712Domain") outstruct := new(struct { Fields [1]byte Name string Version string ChainId *big.Int VerifyingContract common.Address Salt [32]byte Extensions []*big.Int }) if err != nil { return *outstruct, err } outstruct.Fields = *abi.ConvertType(out[0], new([1]byte)).(*[1]byte) outstruct.Name = *abi.ConvertType(out[1], new(string)).(*string) outstruct.Version = *abi.ConvertType(out[2], new(string)).(*string) outstruct.ChainId = *abi.ConvertType(out[3], new(*big.Int)).(**big.Int) outstruct.VerifyingContract = *abi.ConvertType(out[4], new(common.Address)).(*common.Address) outstruct.Salt = *abi.ConvertType(out[5], new([32]byte)).(*[32]byte) outstruct.Extensions = *abi.ConvertType(out[6], new([]*big.Int)).(*[]*big.Int) return *outstruct, err } // Eip712Domain is a free data retrieval call binding the contract method 0x84b0196e. // // Solidity: function eip712Domain() view returns(bytes1 fields, string name, string version, uint256 chainId, address verifyingContract, bytes32 salt, uint256[] extensions) func (_SystemPromptManager *SystemPromptManagerSession) Eip712Domain() (struct { Fields [1]byte Name string Version string ChainId *big.Int VerifyingContract common.Address Salt [32]byte Extensions []*big.Int }, error) { return _SystemPromptManager.Contract.Eip712Domain(&_SystemPromptManager.CallOpts) } // Eip712Domain is a free data retrieval call binding the contract method 0x84b0196e. // // Solidity: function eip712Domain() view returns(bytes1 fields, string name, string version, uint256 chainId, address verifyingContract, bytes32 salt, uint256[] extensions) func (_SystemPromptManager *SystemPromptManagerCallerSession) Eip712Domain() (struct { Fields [1]byte Name string Version string ChainId *big.Int VerifyingContract common.Address Salt [32]byte Extensions []*big.Int }, error) { return _SystemPromptManager.Contract.Eip712Domain(&_SystemPromptManager.CallOpts) } // GetAgentFee is a free data retrieval call binding the contract method 0xed96f433. // // Solidity: function getAgentFee(uint256 _agentId) view returns(uint256) func (_SystemPromptManager *SystemPromptManagerCaller) GetAgentFee(opts *bind.CallOpts, _agentId *big.Int) (*big.Int, error) { var out []interface{} err := _SystemPromptManager.contract.Call(opts, &out, "getAgentFee", _agentId) if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // GetAgentFee is a free data retrieval call binding the contract method 0xed96f433. // // Solidity: function getAgentFee(uint256 _agentId) view returns(uint256) func (_SystemPromptManager *SystemPromptManagerSession) GetAgentFee(_agentId *big.Int) (*big.Int, error) { return _SystemPromptManager.Contract.GetAgentFee(&_SystemPromptManager.CallOpts, _agentId) } // GetAgentFee is a free data retrieval call binding the contract method 0xed96f433. // // Solidity: function getAgentFee(uint256 _agentId) view returns(uint256) func (_SystemPromptManager *SystemPromptManagerCallerSession) GetAgentFee(_agentId *big.Int) (*big.Int, error) { return _SystemPromptManager.Contract.GetAgentFee(&_SystemPromptManager.CallOpts, _agentId) } // GetAgentSystemPrompt is a free data retrieval call binding the contract method 0xf325f3f1. // // Solidity: function getAgentSystemPrompt(uint256 _agentId) view returns(bytes[]) func (_SystemPromptManager *SystemPromptManagerCaller) GetAgentSystemPrompt(opts *bind.CallOpts, _agentId *big.Int) ([][]byte, error) { var out []interface{} err := _SystemPromptManager.contract.Call(opts, &out, "getAgentSystemPrompt", _agentId) if err != nil { return *new([][]byte), err } out0 := *abi.ConvertType(out[0], new([][]byte)).(*[][]byte) return out0, err } // GetAgentSystemPrompt is a free data retrieval call binding the contract method 0xf325f3f1. // // Solidity: function getAgentSystemPrompt(uint256 _agentId) view returns(bytes[]) func (_SystemPromptManager *SystemPromptManagerSession) GetAgentSystemPrompt(_agentId *big.Int) ([][]byte, error) { return _SystemPromptManager.Contract.GetAgentSystemPrompt(&_SystemPromptManager.CallOpts, _agentId) } // GetAgentSystemPrompt is a free data retrieval call binding the contract method 0xf325f3f1. // // Solidity: function getAgentSystemPrompt(uint256 _agentId) view returns(bytes[]) func (_SystemPromptManager *SystemPromptManagerCallerSession) GetAgentSystemPrompt(_agentId *big.Int) ([][]byte, error) { return _SystemPromptManager.Contract.GetAgentSystemPrompt(&_SystemPromptManager.CallOpts, _agentId) } // GetApproved is a free data retrieval call binding the contract method 0x081812fc. // // Solidity: function getApproved(uint256 tokenId) view returns(address) func (_SystemPromptManager *SystemPromptManagerCaller) GetApproved(opts *bind.CallOpts, tokenId *big.Int) (common.Address, error) { var out []interface{} err := _SystemPromptManager.contract.Call(opts, &out, "getApproved", tokenId) if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // GetApproved is a free data retrieval call binding the contract method 0x081812fc. // // Solidity: function getApproved(uint256 tokenId) view returns(address) func (_SystemPromptManager *SystemPromptManagerSession) GetApproved(tokenId *big.Int) (common.Address, error) { return _SystemPromptManager.Contract.GetApproved(&_SystemPromptManager.CallOpts, tokenId) } // GetApproved is a free data retrieval call binding the contract method 0x081812fc. // // Solidity: function getApproved(uint256 tokenId) view returns(address) func (_SystemPromptManager *SystemPromptManagerCallerSession) GetApproved(tokenId *big.Int) (common.Address, error) { return _SystemPromptManager.Contract.GetApproved(&_SystemPromptManager.CallOpts, tokenId) } // GetHashToSign is a free data retrieval call binding the contract method 0x68cfcc9a. // // Solidity: function getHashToSign(address _to, string _uri, bytes _data, uint256 _fee, address _manager) view returns(bytes32) func (_SystemPromptManager *SystemPromptManagerCaller) GetHashToSign(opts *bind.CallOpts, _to common.Address, _uri string, _data []byte, _fee *big.Int, _manager common.Address) ([32]byte, error) { var out []interface{} err := _SystemPromptManager.contract.Call(opts, &out, "getHashToSign", _to, _uri, _data, _fee, _manager) if err != nil { return *new([32]byte), err } out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) return out0, err } // GetHashToSign is a free data retrieval call binding the contract method 0x68cfcc9a. // // Solidity: function getHashToSign(address _to, string _uri, bytes _data, uint256 _fee, address _manager) view returns(bytes32) func (_SystemPromptManager *SystemPromptManagerSession) GetHashToSign(_to common.Address, _uri string, _data []byte, _fee *big.Int, _manager common.Address) ([32]byte, error) { return _SystemPromptManager.Contract.GetHashToSign(&_SystemPromptManager.CallOpts, _to, _uri, _data, _fee, _manager) } // GetHashToSign is a free data retrieval call binding the contract method 0x68cfcc9a. // // Solidity: function getHashToSign(address _to, string _uri, bytes _data, uint256 _fee, address _manager) view returns(bytes32) func (_SystemPromptManager *SystemPromptManagerCallerSession) GetHashToSign(_to common.Address, _uri string, _data []byte, _fee *big.Int, _manager common.Address) ([32]byte, error) { return _SystemPromptManager.Contract.GetHashToSign(&_SystemPromptManager.CallOpts, _to, _uri, _data, _fee, _manager) } // HybridModel is a free data retrieval call binding the contract method 0x5eb2364c. // // Solidity: function hybridModel() view returns(address) func (_SystemPromptManager *SystemPromptManagerCaller) HybridModel(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _SystemPromptManager.contract.Call(opts, &out, "hybridModel") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // HybridModel is a free data retrieval call binding the contract method 0x5eb2364c. // // Solidity: function hybridModel() view returns(address) func (_SystemPromptManager *SystemPromptManagerSession) HybridModel() (common.Address, error) { return _SystemPromptManager.Contract.HybridModel(&_SystemPromptManager.CallOpts) } // HybridModel is a free data retrieval call binding the contract method 0x5eb2364c. // // Solidity: function hybridModel() view returns(address) func (_SystemPromptManager *SystemPromptManagerCallerSession) HybridModel() (common.Address, error) { return _SystemPromptManager.Contract.HybridModel(&_SystemPromptManager.CallOpts) } // IsApprovedForAll is a free data retrieval call binding the contract method 0xe985e9c5. // // Solidity: function isApprovedForAll(address owner, address operator) view returns(bool) func (_SystemPromptManager *SystemPromptManagerCaller) IsApprovedForAll(opts *bind.CallOpts, owner common.Address, operator common.Address) (bool, error) { var out []interface{} err := _SystemPromptManager.contract.Call(opts, &out, "isApprovedForAll", owner, operator) if err != nil { return *new(bool), err } out0 := *abi.ConvertType(out[0], new(bool)).(*bool) return out0, err } // IsApprovedForAll is a free data retrieval call binding the contract method 0xe985e9c5. // // Solidity: function isApprovedForAll(address owner, address operator) view returns(bool) func (_SystemPromptManager *SystemPromptManagerSession) IsApprovedForAll(owner common.Address, operator common.Address) (bool, error) { return _SystemPromptManager.Contract.IsApprovedForAll(&_SystemPromptManager.CallOpts, owner, operator) } // IsApprovedForAll is a free data retrieval call binding the contract method 0xe985e9c5. // // Solidity: function isApprovedForAll(address owner, address operator) view returns(bool) func (_SystemPromptManager *SystemPromptManagerCallerSession) IsApprovedForAll(owner common.Address, operator common.Address) (bool, error) { return _SystemPromptManager.Contract.IsApprovedForAll(&_SystemPromptManager.CallOpts, owner, operator) } // IsManager is a free data retrieval call binding the contract method 0xf3ae2415. // // Solidity: function isManager(address ) view returns(bool) func (_SystemPromptManager *SystemPromptManagerCaller) IsManager(opts *bind.CallOpts, arg0 common.Address) (bool, error) { var out []interface{} err := _SystemPromptManager.contract.Call(opts, &out, "isManager", arg0) if err != nil { return *new(bool), err } out0 := *abi.ConvertType(out[0], new(bool)).(*bool) return out0, err } // IsManager is a free data retrieval call binding the contract method 0xf3ae2415. // // Solidity: function isManager(address ) view returns(bool) func (_SystemPromptManager *SystemPromptManagerSession) IsManager(arg0 common.Address) (bool, error) { return _SystemPromptManager.Contract.IsManager(&_SystemPromptManager.CallOpts, arg0) } // IsManager is a free data retrieval call binding the contract method 0xf3ae2415. // // Solidity: function isManager(address ) view returns(bool) func (_SystemPromptManager *SystemPromptManagerCallerSession) IsManager(arg0 common.Address) (bool, error) { return _SystemPromptManager.Contract.IsManager(&_SystemPromptManager.CallOpts, arg0) } // MintPrice is a free data retrieval call binding the contract method 0x6817c76c. // // Solidity: function mintPrice() view returns(uint256) func (_SystemPromptManager *SystemPromptManagerCaller) MintPrice(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} err := _SystemPromptManager.contract.Call(opts, &out, "mintPrice") if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // MintPrice is a free data retrieval call binding the contract method 0x6817c76c. // // Solidity: function mintPrice() view returns(uint256) func (_SystemPromptManager *SystemPromptManagerSession) MintPrice() (*big.Int, error) { return _SystemPromptManager.Contract.MintPrice(&_SystemPromptManager.CallOpts) } // MintPrice is a free data retrieval call binding the contract method 0x6817c76c. // // Solidity: function mintPrice() view returns(uint256) func (_SystemPromptManager *SystemPromptManagerCallerSession) MintPrice() (*big.Int, error) { return _SystemPromptManager.Contract.MintPrice(&_SystemPromptManager.CallOpts) } // Name is a free data retrieval call binding the contract method 0x06fdde03. // // Solidity: function name() view returns(string) func (_SystemPromptManager *SystemPromptManagerCaller) Name(opts *bind.CallOpts) (string, error) { var out []interface{} err := _SystemPromptManager.contract.Call(opts, &out, "name") if err != nil { return *new(string), err } out0 := *abi.ConvertType(out[0], new(string)).(*string) return out0, err } // Name is a free data retrieval call binding the contract method 0x06fdde03. // // Solidity: function name() view returns(string) func (_SystemPromptManager *SystemPromptManagerSession) Name() (string, error) { return _SystemPromptManager.Contract.Name(&_SystemPromptManager.CallOpts) } // Name is a free data retrieval call binding the contract method 0x06fdde03. // // Solidity: function name() view returns(string) func (_SystemPromptManager *SystemPromptManagerCallerSession) Name() (string, error) { return _SystemPromptManager.Contract.Name(&_SystemPromptManager.CallOpts) } // NextTokenId is a free data retrieval call binding the contract method 0x75794a3c. // // Solidity: function nextTokenId() view returns(uint256) func (_SystemPromptManager *SystemPromptManagerCaller) NextTokenId(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} err := _SystemPromptManager.contract.Call(opts, &out, "nextTokenId") if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // NextTokenId is a free data retrieval call binding the contract method 0x75794a3c. // // Solidity: function nextTokenId() view returns(uint256) func (_SystemPromptManager *SystemPromptManagerSession) NextTokenId() (*big.Int, error) { return _SystemPromptManager.Contract.NextTokenId(&_SystemPromptManager.CallOpts) } // NextTokenId is a free data retrieval call binding the contract method 0x75794a3c. // // Solidity: function nextTokenId() view returns(uint256) func (_SystemPromptManager *SystemPromptManagerCallerSession) NextTokenId() (*big.Int, error) { return _SystemPromptManager.Contract.NextTokenId(&_SystemPromptManager.CallOpts) } // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. // // Solidity: function owner() view returns(address) func (_SystemPromptManager *SystemPromptManagerCaller) Owner(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _SystemPromptManager.contract.Call(opts, &out, "owner") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. // // Solidity: function owner() view returns(address) func (_SystemPromptManager *SystemPromptManagerSession) Owner() (common.Address, error) { return _SystemPromptManager.Contract.Owner(&_SystemPromptManager.CallOpts) } // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. // // Solidity: function owner() view returns(address) func (_SystemPromptManager *SystemPromptManagerCallerSession) Owner() (common.Address, error) { return _SystemPromptManager.Contract.Owner(&_SystemPromptManager.CallOpts) } // OwnerOf is a free data retrieval call binding the contract method 0x6352211e. // // Solidity: function ownerOf(uint256 tokenId) view returns(address) func (_SystemPromptManager *SystemPromptManagerCaller) OwnerOf(opts *bind.CallOpts, tokenId *big.Int) (common.Address, error) { var out []interface{} err := _SystemPromptManager.contract.Call(opts, &out, "ownerOf", tokenId) if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // OwnerOf is a free data retrieval call binding the contract method 0x6352211e. // // Solidity: function ownerOf(uint256 tokenId) view returns(address) func (_SystemPromptManager *SystemPromptManagerSession) OwnerOf(tokenId *big.Int) (common.Address, error) { return _SystemPromptManager.Contract.OwnerOf(&_SystemPromptManager.CallOpts, tokenId) } // OwnerOf is a free data retrieval call binding the contract method 0x6352211e. // // Solidity: function ownerOf(uint256 tokenId) view returns(address) func (_SystemPromptManager *SystemPromptManagerCallerSession) OwnerOf(tokenId *big.Int) (common.Address, error) { return _SystemPromptManager.Contract.OwnerOf(&_SystemPromptManager.CallOpts, tokenId) } // Paused is a free data retrieval call binding the contract method 0x5c975abb. // // Solidity: function paused() view returns(bool) func (_SystemPromptManager *SystemPromptManagerCaller) Paused(opts *bind.CallOpts) (bool, error) { var out []interface{} err := _SystemPromptManager.contract.Call(opts, &out, "paused") if err != nil { return *new(bool), err } out0 := *abi.ConvertType(out[0], new(bool)).(*bool) return out0, err } // Paused is a free data retrieval call binding the contract method 0x5c975abb. // // Solidity: function paused() view returns(bool) func (_SystemPromptManager *SystemPromptManagerSession) Paused() (bool, error) { return _SystemPromptManager.Contract.Paused(&_SystemPromptManager.CallOpts) } // Paused is a free data retrieval call binding the contract method 0x5c975abb. // // Solidity: function paused() view returns(bool) func (_SystemPromptManager *SystemPromptManagerCallerSession) Paused() (bool, error) { return _SystemPromptManager.Contract.Paused(&_SystemPromptManager.CallOpts) } // PoolBalance is a free data retrieval call binding the contract method 0x6a6d964e. // // Solidity: function poolBalance(uint256 nftId) view returns(uint256) func (_SystemPromptManager *SystemPromptManagerCaller) PoolBalance(opts *bind.CallOpts, nftId *big.Int) (*big.Int, error) { var out []interface{} err := _SystemPromptManager.contract.Call(opts, &out, "poolBalance", nftId) if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // PoolBalance is a free data retrieval call binding the contract method 0x6a6d964e. // // Solidity: function poolBalance(uint256 nftId) view returns(uint256) func (_SystemPromptManager *SystemPromptManagerSession) PoolBalance(nftId *big.Int) (*big.Int, error) { return _SystemPromptManager.Contract.PoolBalance(&_SystemPromptManager.CallOpts, nftId) } // PoolBalance is a free data retrieval call binding the contract method 0x6a6d964e. // // Solidity: function poolBalance(uint256 nftId) view returns(uint256) func (_SystemPromptManager *SystemPromptManagerCallerSession) PoolBalance(nftId *big.Int) (*big.Int, error) { return _SystemPromptManager.Contract.PoolBalance(&_SystemPromptManager.CallOpts, nftId) } // RoyaltyInfo is a free data retrieval call binding the contract method 0x2a55205a. // // Solidity: function royaltyInfo(uint256 _agentId, uint256 _salePrice) view returns(address, uint256) func (_SystemPromptManager *SystemPromptManagerCaller) RoyaltyInfo(opts *bind.CallOpts, _agentId *big.Int, _salePrice *big.Int) (common.Address, *big.Int, error) { var out []interface{} err := _SystemPromptManager.contract.Call(opts, &out, "royaltyInfo", _agentId, _salePrice) if err != nil { return *new(common.Address), *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) out1 := *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) return out0, out1, err } // RoyaltyInfo is a free data retrieval call binding the contract method 0x2a55205a. // // Solidity: function royaltyInfo(uint256 _agentId, uint256 _salePrice) view returns(address, uint256) func (_SystemPromptManager *SystemPromptManagerSession) RoyaltyInfo(_agentId *big.Int, _salePrice *big.Int) (common.Address, *big.Int, error) { return _SystemPromptManager.Contract.RoyaltyInfo(&_SystemPromptManager.CallOpts, _agentId, _salePrice) } // RoyaltyInfo is a free data retrieval call binding the contract method 0x2a55205a. // // Solidity: function royaltyInfo(uint256 _agentId, uint256 _salePrice) view returns(address, uint256) func (_SystemPromptManager *SystemPromptManagerCallerSession) RoyaltyInfo(_agentId *big.Int, _salePrice *big.Int) (common.Address, *big.Int, error) { return _SystemPromptManager.Contract.RoyaltyInfo(&_SystemPromptManager.CallOpts, _agentId, _salePrice) } // RoyaltyPortion is a free data retrieval call binding the contract method 0x11d7beb2. // // Solidity: function royaltyPortion() view returns(uint16) func (_SystemPromptManager *SystemPromptManagerCaller) RoyaltyPortion(opts *bind.CallOpts) (uint16, error) { var out []interface{} err := _SystemPromptManager.contract.Call(opts, &out, "royaltyPortion") if err != nil { return *new(uint16), err } out0 := *abi.ConvertType(out[0], new(uint16)).(*uint16) return out0, err } // RoyaltyPortion is a free data retrieval call binding the contract method 0x11d7beb2. // // Solidity: function royaltyPortion() view returns(uint16) func (_SystemPromptManager *SystemPromptManagerSession) RoyaltyPortion() (uint16, error) { return _SystemPromptManager.Contract.RoyaltyPortion(&_SystemPromptManager.CallOpts) } // RoyaltyPortion is a free data retrieval call binding the contract method 0x11d7beb2. // // Solidity: function royaltyPortion() view returns(uint16) func (_SystemPromptManager *SystemPromptManagerCallerSession) RoyaltyPortion() (uint16, error) { return _SystemPromptManager.Contract.RoyaltyPortion(&_SystemPromptManager.CallOpts) } // RoyaltyReceiver is a free data retrieval call binding the contract method 0x9fbc8713. // // Solidity: function royaltyReceiver() view returns(address) func (_SystemPromptManager *SystemPromptManagerCaller) RoyaltyReceiver(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _SystemPromptManager.contract.Call(opts, &out, "royaltyReceiver") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // RoyaltyReceiver is a free data retrieval call binding the contract method 0x9fbc8713. // // Solidity: function royaltyReceiver() view returns(address) func (_SystemPromptManager *SystemPromptManagerSession) RoyaltyReceiver() (common.Address, error) { return _SystemPromptManager.Contract.RoyaltyReceiver(&_SystemPromptManager.CallOpts) } // RoyaltyReceiver is a free data retrieval call binding the contract method 0x9fbc8713. // // Solidity: function royaltyReceiver() view returns(address) func (_SystemPromptManager *SystemPromptManagerCallerSession) RoyaltyReceiver() (common.Address, error) { return _SystemPromptManager.Contract.RoyaltyReceiver(&_SystemPromptManager.CallOpts) } // SupportsInterface is a free data retrieval call binding the contract method 0x01ffc9a7. // // Solidity: function supportsInterface(bytes4 _interfaceId) view returns(bool) func (_SystemPromptManager *SystemPromptManagerCaller) SupportsInterface(opts *bind.CallOpts, _interfaceId [4]byte) (bool, error) { var out []interface{} err := _SystemPromptManager.contract.Call(opts, &out, "supportsInterface", _interfaceId) if err != nil { return *new(bool), err } out0 := *abi.ConvertType(out[0], new(bool)).(*bool) return out0, err } // SupportsInterface is a free data retrieval call binding the contract method 0x01ffc9a7. // // Solidity: function supportsInterface(bytes4 _interfaceId) view returns(bool) func (_SystemPromptManager *SystemPromptManagerSession) SupportsInterface(_interfaceId [4]byte) (bool, error) { return _SystemPromptManager.Contract.SupportsInterface(&_SystemPromptManager.CallOpts, _interfaceId) } // SupportsInterface is a free data retrieval call binding the contract method 0x01ffc9a7. // // Solidity: function supportsInterface(bytes4 _interfaceId) view returns(bool) func (_SystemPromptManager *SystemPromptManagerCallerSession) SupportsInterface(_interfaceId [4]byte) (bool, error) { return _SystemPromptManager.Contract.SupportsInterface(&_SystemPromptManager.CallOpts, _interfaceId) } // Symbol is a free data retrieval call binding the contract method 0x95d89b41. // // Solidity: function symbol() view returns(string) func (_SystemPromptManager *SystemPromptManagerCaller) Symbol(opts *bind.CallOpts) (string, error) { var out []interface{} err := _SystemPromptManager.contract.Call(opts, &out, "symbol") if err != nil { return *new(string), err } out0 := *abi.ConvertType(out[0], new(string)).(*string) return out0, err } // Symbol is a free data retrieval call binding the contract method 0x95d89b41. // // Solidity: function symbol() view returns(string) func (_SystemPromptManager *SystemPromptManagerSession) Symbol() (string, error) { return _SystemPromptManager.Contract.Symbol(&_SystemPromptManager.CallOpts) } // Symbol is a free data retrieval call binding the contract method 0x95d89b41. // // Solidity: function symbol() view returns(string) func (_SystemPromptManager *SystemPromptManagerCallerSession) Symbol() (string, error) { return _SystemPromptManager.Contract.Symbol(&_SystemPromptManager.CallOpts) } // TokenByIndex is a free data retrieval call binding the contract method 0x4f6ccce7. // // Solidity: function tokenByIndex(uint256 index) view returns(uint256) func (_SystemPromptManager *SystemPromptManagerCaller) TokenByIndex(opts *bind.CallOpts, index *big.Int) (*big.Int, error) { var out []interface{} err := _SystemPromptManager.contract.Call(opts, &out, "tokenByIndex", index) if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // TokenByIndex is a free data retrieval call binding the contract method 0x4f6ccce7. // // Solidity: function tokenByIndex(uint256 index) view returns(uint256) func (_SystemPromptManager *SystemPromptManagerSession) TokenByIndex(index *big.Int) (*big.Int, error) { return _SystemPromptManager.Contract.TokenByIndex(&_SystemPromptManager.CallOpts, index) } // TokenByIndex is a free data retrieval call binding the contract method 0x4f6ccce7. // // Solidity: function tokenByIndex(uint256 index) view returns(uint256) func (_SystemPromptManager *SystemPromptManagerCallerSession) TokenByIndex(index *big.Int) (*big.Int, error) { return _SystemPromptManager.Contract.TokenByIndex(&_SystemPromptManager.CallOpts, index) } // TokenOfOwnerByIndex is a free data retrieval call binding the contract method 0x2f745c59. // // Solidity: function tokenOfOwnerByIndex(address owner, uint256 index) view returns(uint256) func (_SystemPromptManager *SystemPromptManagerCaller) TokenOfOwnerByIndex(opts *bind.CallOpts, owner common.Address, index *big.Int) (*big.Int, error) { var out []interface{} err := _SystemPromptManager.contract.Call(opts, &out, "tokenOfOwnerByIndex", owner, index) if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // TokenOfOwnerByIndex is a free data retrieval call binding the contract method 0x2f745c59. // // Solidity: function tokenOfOwnerByIndex(address owner, uint256 index) view returns(uint256) func (_SystemPromptManager *SystemPromptManagerSession) TokenOfOwnerByIndex(owner common.Address, index *big.Int) (*big.Int, error) { return _SystemPromptManager.Contract.TokenOfOwnerByIndex(&_SystemPromptManager.CallOpts, owner, index) } // TokenOfOwnerByIndex is a free data retrieval call binding the contract method 0x2f745c59. // // Solidity: function tokenOfOwnerByIndex(address owner, uint256 index) view returns(uint256) func (_SystemPromptManager *SystemPromptManagerCallerSession) TokenOfOwnerByIndex(owner common.Address, index *big.Int) (*big.Int, error) { return _SystemPromptManager.Contract.TokenOfOwnerByIndex(&_SystemPromptManager.CallOpts, owner, index) } // TokenURI is a free data retrieval call binding the contract method 0xc87b56dd. // // Solidity: function tokenURI(uint256 _agentId) view returns(string) func (_SystemPromptManager *SystemPromptManagerCaller) TokenURI(opts *bind.CallOpts, _agentId *big.Int) (string, error) { var out []interface{} err := _SystemPromptManager.contract.Call(opts, &out, "tokenURI", _agentId) if err != nil { return *new(string), err } out0 := *abi.ConvertType(out[0], new(string)).(*string) return out0, err } // TokenURI is a free data retrieval call binding the contract method 0xc87b56dd. // // Solidity: function tokenURI(uint256 _agentId) view returns(string) func (_SystemPromptManager *SystemPromptManagerSession) TokenURI(_agentId *big.Int) (string, error) { return _SystemPromptManager.Contract.TokenURI(&_SystemPromptManager.CallOpts, _agentId) } // TokenURI is a free data retrieval call binding the contract method 0xc87b56dd. // // Solidity: function tokenURI(uint256 _agentId) view returns(string) func (_SystemPromptManager *SystemPromptManagerCallerSession) TokenURI(_agentId *big.Int) (string, error) { return _SystemPromptManager.Contract.TokenURI(&_SystemPromptManager.CallOpts, _agentId) } // TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. // // Solidity: function totalSupply() view returns(uint256) func (_SystemPromptManager *SystemPromptManagerCaller) TotalSupply(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} err := _SystemPromptManager.contract.Call(opts, &out, "totalSupply") if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. // // Solidity: function totalSupply() view returns(uint256) func (_SystemPromptManager *SystemPromptManagerSession) TotalSupply() (*big.Int, error) { return _SystemPromptManager.Contract.TotalSupply(&_SystemPromptManager.CallOpts) } // TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. // // Solidity: function totalSupply() view returns(uint256) func (_SystemPromptManager *SystemPromptManagerCallerSession) TotalSupply() (*big.Int, error) { return _SystemPromptManager.Contract.TotalSupply(&_SystemPromptManager.CallOpts) } // Version is a free data retrieval call binding the contract method 0x54fd4d50. // // Solidity: function version() pure returns(string) func (_SystemPromptManager *SystemPromptManagerCaller) Version(opts *bind.CallOpts) (string, error) { var out []interface{} err := _SystemPromptManager.contract.Call(opts, &out, "version") if err != nil { return *new(string), err } out0 := *abi.ConvertType(out[0], new(string)).(*string) return out0, err } // Version is a free data retrieval call binding the contract method 0x54fd4d50. // // Solidity: function version() pure returns(string) func (_SystemPromptManager *SystemPromptManagerSession) Version() (string, error) { return _SystemPromptManager.Contract.Version(&_SystemPromptManager.CallOpts) } // Version is a free data retrieval call binding the contract method 0x54fd4d50. // // Solidity: function version() pure returns(string) func (_SystemPromptManager *SystemPromptManagerCallerSession) Version() (string, error) { return _SystemPromptManager.Contract.Version(&_SystemPromptManager.CallOpts) } // AddNewAgentData is a paid mutator transaction binding the contract method 0x9f10cc66. // // Solidity: function addNewAgentData(uint256 _agentId, bytes _sysPrompt) returns() func (_SystemPromptManager *SystemPromptManagerTransactor) AddNewAgentData(opts *bind.TransactOpts, _agentId *big.Int, _sysPrompt []byte) (*types.Transaction, error) { return _SystemPromptManager.contract.Transact(opts, "addNewAgentData", _agentId, _sysPrompt) } // AddNewAgentData is a paid mutator transaction binding the contract method 0x9f10cc66. // // Solidity: function addNewAgentData(uint256 _agentId, bytes _sysPrompt) returns() func (_SystemPromptManager *SystemPromptManagerSession) AddNewAgentData(_agentId *big.Int, _sysPrompt []byte) (*types.Transaction, error) { return _SystemPromptManager.Contract.AddNewAgentData(&_SystemPromptManager.TransactOpts, _agentId, _sysPrompt) } // AddNewAgentData is a paid mutator transaction binding the contract method 0x9f10cc66. // // Solidity: function addNewAgentData(uint256 _agentId, bytes _sysPrompt) returns() func (_SystemPromptManager *SystemPromptManagerTransactorSession) AddNewAgentData(_agentId *big.Int, _sysPrompt []byte) (*types.Transaction, error) { return _SystemPromptManager.Contract.AddNewAgentData(&_SystemPromptManager.TransactOpts, _agentId, _sysPrompt) } // Approve is a paid mutator transaction binding the contract method 0x095ea7b3. // // Solidity: function approve(address to, uint256 tokenId) returns() func (_SystemPromptManager *SystemPromptManagerTransactor) Approve(opts *bind.TransactOpts, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _SystemPromptManager.contract.Transact(opts, "approve", to, tokenId) } // Approve is a paid mutator transaction binding the contract method 0x095ea7b3. // // Solidity: function approve(address to, uint256 tokenId) returns() func (_SystemPromptManager *SystemPromptManagerSession) Approve(to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _SystemPromptManager.Contract.Approve(&_SystemPromptManager.TransactOpts, to, tokenId) } // Approve is a paid mutator transaction binding the contract method 0x095ea7b3. // // Solidity: function approve(address to, uint256 tokenId) returns() func (_SystemPromptManager *SystemPromptManagerTransactorSession) Approve(to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _SystemPromptManager.Contract.Approve(&_SystemPromptManager.TransactOpts, to, tokenId) } // AuthorizeManager is a paid mutator transaction binding the contract method 0x267c8507. // // Solidity: function authorizeManager(address _account) returns() func (_SystemPromptManager *SystemPromptManagerTransactor) AuthorizeManager(opts *bind.TransactOpts, _account common.Address) (*types.Transaction, error) { return _SystemPromptManager.contract.Transact(opts, "authorizeManager", _account) } // AuthorizeManager is a paid mutator transaction binding the contract method 0x267c8507. // // Solidity: function authorizeManager(address _account) returns() func (_SystemPromptManager *SystemPromptManagerSession) AuthorizeManager(_account common.Address) (*types.Transaction, error) { return _SystemPromptManager.Contract.AuthorizeManager(&_SystemPromptManager.TransactOpts, _account) } // AuthorizeManager is a paid mutator transaction binding the contract method 0x267c8507. // // Solidity: function authorizeManager(address _account) returns() func (_SystemPromptManager *SystemPromptManagerTransactorSession) AuthorizeManager(_account common.Address) (*types.Transaction, error) { return _SystemPromptManager.Contract.AuthorizeManager(&_SystemPromptManager.TransactOpts, _account) } // ClaimFee is a paid mutator transaction binding the contract method 0x99d32fc4. // // Solidity: function claimFee() returns() func (_SystemPromptManager *SystemPromptManagerTransactor) ClaimFee(opts *bind.TransactOpts) (*types.Transaction, error) { return _SystemPromptManager.contract.Transact(opts, "claimFee") } // ClaimFee is a paid mutator transaction binding the contract method 0x99d32fc4. // // Solidity: function claimFee() returns() func (_SystemPromptManager *SystemPromptManagerSession) ClaimFee() (*types.Transaction, error) { return _SystemPromptManager.Contract.ClaimFee(&_SystemPromptManager.TransactOpts) } // ClaimFee is a paid mutator transaction binding the contract method 0x99d32fc4. // // Solidity: function claimFee() returns() func (_SystemPromptManager *SystemPromptManagerTransactorSession) ClaimFee() (*types.Transaction, error) { return _SystemPromptManager.Contract.ClaimFee(&_SystemPromptManager.TransactOpts) } // DeauthorizeManager is a paid mutator transaction binding the contract method 0x0305ea01. // // Solidity: function deauthorizeManager(address _account) returns() func (_SystemPromptManager *SystemPromptManagerTransactor) DeauthorizeManager(opts *bind.TransactOpts, _account common.Address) (*types.Transaction, error) { return _SystemPromptManager.contract.Transact(opts, "deauthorizeManager", _account) } // DeauthorizeManager is a paid mutator transaction binding the contract method 0x0305ea01. // // Solidity: function deauthorizeManager(address _account) returns() func (_SystemPromptManager *SystemPromptManagerSession) DeauthorizeManager(_account common.Address) (*types.Transaction, error) { return _SystemPromptManager.Contract.DeauthorizeManager(&_SystemPromptManager.TransactOpts, _account) } // DeauthorizeManager is a paid mutator transaction binding the contract method 0x0305ea01. // // Solidity: function deauthorizeManager(address _account) returns() func (_SystemPromptManager *SystemPromptManagerTransactorSession) DeauthorizeManager(_account common.Address) (*types.Transaction, error) { return _SystemPromptManager.Contract.DeauthorizeManager(&_SystemPromptManager.TransactOpts, _account) } // Infer is a paid mutator transaction binding the contract method 0x566a9951. // // Solidity: function infer(uint256 _agentId, bytes _calldata, string _externalData) payable returns() func (_SystemPromptManager *SystemPromptManagerTransactor) Infer(opts *bind.TransactOpts, _agentId *big.Int, _calldata []byte, _externalData string) (*types.Transaction, error) { return _SystemPromptManager.contract.Transact(opts, "infer", _agentId, _calldata, _externalData) } // Infer is a paid mutator transaction binding the contract method 0x566a9951. // // Solidity: function infer(uint256 _agentId, bytes _calldata, string _externalData) payable returns() func (_SystemPromptManager *SystemPromptManagerSession) Infer(_agentId *big.Int, _calldata []byte, _externalData string) (*types.Transaction, error) { return _SystemPromptManager.Contract.Infer(&_SystemPromptManager.TransactOpts, _agentId, _calldata, _externalData) } // Infer is a paid mutator transaction binding the contract method 0x566a9951. // // Solidity: function infer(uint256 _agentId, bytes _calldata, string _externalData) payable returns() func (_SystemPromptManager *SystemPromptManagerTransactorSession) Infer(_agentId *big.Int, _calldata []byte, _externalData string) (*types.Transaction, error) { return _SystemPromptManager.Contract.Infer(&_SystemPromptManager.TransactOpts, _agentId, _calldata, _externalData) } // Initialize is a paid mutator transaction binding the contract method 0x1e18fb8c. // // Solidity: function initialize(string _name, string _symbol, uint256 _mintPrice, address _royaltyReceiver, uint16 _royaltyPortion, uint256 _nextTokenId, address _hybridModel, address _workerHub) returns() func (_SystemPromptManager *SystemPromptManagerTransactor) Initialize(opts *bind.TransactOpts, _name string, _symbol string, _mintPrice *big.Int, _royaltyReceiver common.Address, _royaltyPortion uint16, _nextTokenId *big.Int, _hybridModel common.Address, _workerHub common.Address) (*types.Transaction, error) { return _SystemPromptManager.contract.Transact(opts, "initialize", _name, _symbol, _mintPrice, _royaltyReceiver, _royaltyPortion, _nextTokenId, _hybridModel, _workerHub) } // Initialize is a paid mutator transaction binding the contract method 0x1e18fb8c. // // Solidity: function initialize(string _name, string _symbol, uint256 _mintPrice, address _royaltyReceiver, uint16 _royaltyPortion, uint256 _nextTokenId, address _hybridModel, address _workerHub) returns() func (_SystemPromptManager *SystemPromptManagerSession) Initialize(_name string, _symbol string, _mintPrice *big.Int, _royaltyReceiver common.Address, _royaltyPortion uint16, _nextTokenId *big.Int, _hybridModel common.Address, _workerHub common.Address) (*types.Transaction, error) { return _SystemPromptManager.Contract.Initialize(&_SystemPromptManager.TransactOpts, _name, _symbol, _mintPrice, _royaltyReceiver, _royaltyPortion, _nextTokenId, _hybridModel, _workerHub) } // Initialize is a paid mutator transaction binding the contract method 0x1e18fb8c. // // Solidity: function initialize(string _name, string _symbol, uint256 _mintPrice, address _royaltyReceiver, uint16 _royaltyPortion, uint256 _nextTokenId, address _hybridModel, address _workerHub) returns() func (_SystemPromptManager *SystemPromptManagerTransactorSession) Initialize(_name string, _symbol string, _mintPrice *big.Int, _royaltyReceiver common.Address, _royaltyPortion uint16, _nextTokenId *big.Int, _hybridModel common.Address, _workerHub common.Address) (*types.Transaction, error) { return _SystemPromptManager.Contract.Initialize(&_SystemPromptManager.TransactOpts, _name, _symbol, _mintPrice, _royaltyReceiver, _royaltyPortion, _nextTokenId, _hybridModel, _workerHub) } // Mint is a paid mutator transaction binding the contract method 0xcc216aca. // // Solidity: function mint(address _to, string _uri, bytes _data, uint256 _fee) payable returns(uint256) func (_SystemPromptManager *SystemPromptManagerTransactor) Mint(opts *bind.TransactOpts, _to common.Address, _uri string, _data []byte, _fee *big.Int) (*types.Transaction, error) { return _SystemPromptManager.contract.Transact(opts, "mint", _to, _uri, _data, _fee) } // Mint is a paid mutator transaction binding the contract method 0xcc216aca. // // Solidity: function mint(address _to, string _uri, bytes _data, uint256 _fee) payable returns(uint256) func (_SystemPromptManager *SystemPromptManagerSession) Mint(_to common.Address, _uri string, _data []byte, _fee *big.Int) (*types.Transaction, error) { return _SystemPromptManager.Contract.Mint(&_SystemPromptManager.TransactOpts, _to, _uri, _data, _fee) } // Mint is a paid mutator transaction binding the contract method 0xcc216aca. // // Solidity: function mint(address _to, string _uri, bytes _data, uint256 _fee) payable returns(uint256) func (_SystemPromptManager *SystemPromptManagerTransactorSession) Mint(_to common.Address, _uri string, _data []byte, _fee *big.Int) (*types.Transaction, error) { return _SystemPromptManager.Contract.Mint(&_SystemPromptManager.TransactOpts, _to, _uri, _data, _fee) } // MintBySignature is a paid mutator transaction binding the contract method 0x53ec32b7. // // Solidity: function mintBySignature(address _to, string _uri, bytes _data, uint256 _fee, address _manager, uint8 v, bytes32 r, bytes32 s) returns(uint256) func (_SystemPromptManager *SystemPromptManagerTransactor) MintBySignature(opts *bind.TransactOpts, _to common.Address, _uri string, _data []byte, _fee *big.Int, _manager common.Address, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _SystemPromptManager.contract.Transact(opts, "mintBySignature", _to, _uri, _data, _fee, _manager, v, r, s) } // MintBySignature is a paid mutator transaction binding the contract method 0x53ec32b7. // // Solidity: function mintBySignature(address _to, string _uri, bytes _data, uint256 _fee, address _manager, uint8 v, bytes32 r, bytes32 s) returns(uint256) func (_SystemPromptManager *SystemPromptManagerSession) MintBySignature(_to common.Address, _uri string, _data []byte, _fee *big.Int, _manager common.Address, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _SystemPromptManager.Contract.MintBySignature(&_SystemPromptManager.TransactOpts, _to, _uri, _data, _fee, _manager, v, r, s) } // MintBySignature is a paid mutator transaction binding the contract method 0x53ec32b7. // // Solidity: function mintBySignature(address _to, string _uri, bytes _data, uint256 _fee, address _manager, uint8 v, bytes32 r, bytes32 s) returns(uint256) func (_SystemPromptManager *SystemPromptManagerTransactorSession) MintBySignature(_to common.Address, _uri string, _data []byte, _fee *big.Int, _manager common.Address, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _SystemPromptManager.Contract.MintBySignature(&_SystemPromptManager.TransactOpts, _to, _uri, _data, _fee, _manager, v, r, s) } // Pause is a paid mutator transaction binding the contract method 0x8456cb59. // // Solidity: function pause() returns() func (_SystemPromptManager *SystemPromptManagerTransactor) Pause(opts *bind.TransactOpts) (*types.Transaction, error) { return _SystemPromptManager.contract.Transact(opts, "pause") } // Pause is a paid mutator transaction binding the contract method 0x8456cb59. // // Solidity: function pause() returns() func (_SystemPromptManager *SystemPromptManagerSession) Pause() (*types.Transaction, error) { return _SystemPromptManager.Contract.Pause(&_SystemPromptManager.TransactOpts) } // Pause is a paid mutator transaction binding the contract method 0x8456cb59. // // Solidity: function pause() returns() func (_SystemPromptManager *SystemPromptManagerTransactorSession) Pause() (*types.Transaction, error) { return _SystemPromptManager.Contract.Pause(&_SystemPromptManager.TransactOpts) } // RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. // // Solidity: function renounceOwnership() returns() func (_SystemPromptManager *SystemPromptManagerTransactor) RenounceOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { return _SystemPromptManager.contract.Transact(opts, "renounceOwnership") } // RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. // // Solidity: function renounceOwnership() returns() func (_SystemPromptManager *SystemPromptManagerSession) RenounceOwnership() (*types.Transaction, error) { return _SystemPromptManager.Contract.RenounceOwnership(&_SystemPromptManager.TransactOpts) } // RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. // // Solidity: function renounceOwnership() returns() func (_SystemPromptManager *SystemPromptManagerTransactorSession) RenounceOwnership() (*types.Transaction, error) { return _SystemPromptManager.Contract.RenounceOwnership(&_SystemPromptManager.TransactOpts) } // SafeTransferFrom is a paid mutator transaction binding the contract method 0x42842e0e. // // Solidity: function safeTransferFrom(address from, address to, uint256 tokenId) returns() func (_SystemPromptManager *SystemPromptManagerTransactor) SafeTransferFrom(opts *bind.TransactOpts, from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _SystemPromptManager.contract.Transact(opts, "safeTransferFrom", from, to, tokenId) } // SafeTransferFrom is a paid mutator transaction binding the contract method 0x42842e0e. // // Solidity: function safeTransferFrom(address from, address to, uint256 tokenId) returns() func (_SystemPromptManager *SystemPromptManagerSession) SafeTransferFrom(from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _SystemPromptManager.Contract.SafeTransferFrom(&_SystemPromptManager.TransactOpts, from, to, tokenId) } // SafeTransferFrom is a paid mutator transaction binding the contract method 0x42842e0e. // // Solidity: function safeTransferFrom(address from, address to, uint256 tokenId) returns() func (_SystemPromptManager *SystemPromptManagerTransactorSession) SafeTransferFrom(from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _SystemPromptManager.Contract.SafeTransferFrom(&_SystemPromptManager.TransactOpts, from, to, tokenId) } // SafeTransferFrom0 is a paid mutator transaction binding the contract method 0xb88d4fde. // // Solidity: function safeTransferFrom(address from, address to, uint256 tokenId, bytes data) returns() func (_SystemPromptManager *SystemPromptManagerTransactor) SafeTransferFrom0(opts *bind.TransactOpts, from common.Address, to common.Address, tokenId *big.Int, data []byte) (*types.Transaction, error) { return _SystemPromptManager.contract.Transact(opts, "safeTransferFrom0", from, to, tokenId, data) } // SafeTransferFrom0 is a paid mutator transaction binding the contract method 0xb88d4fde. // // Solidity: function safeTransferFrom(address from, address to, uint256 tokenId, bytes data) returns() func (_SystemPromptManager *SystemPromptManagerSession) SafeTransferFrom0(from common.Address, to common.Address, tokenId *big.Int, data []byte) (*types.Transaction, error) { return _SystemPromptManager.Contract.SafeTransferFrom0(&_SystemPromptManager.TransactOpts, from, to, tokenId, data) } // SafeTransferFrom0 is a paid mutator transaction binding the contract method 0xb88d4fde. // // Solidity: function safeTransferFrom(address from, address to, uint256 tokenId, bytes data) returns() func (_SystemPromptManager *SystemPromptManagerTransactorSession) SafeTransferFrom0(from common.Address, to common.Address, tokenId *big.Int, data []byte) (*types.Transaction, error) { return _SystemPromptManager.Contract.SafeTransferFrom0(&_SystemPromptManager.TransactOpts, from, to, tokenId, data) } // SetApprovalForAll is a paid mutator transaction binding the contract method 0xa22cb465. // // Solidity: function setApprovalForAll(address operator, bool approved) returns() func (_SystemPromptManager *SystemPromptManagerTransactor) SetApprovalForAll(opts *bind.TransactOpts, operator common.Address, approved bool) (*types.Transaction, error) { return _SystemPromptManager.contract.Transact(opts, "setApprovalForAll", operator, approved) } // SetApprovalForAll is a paid mutator transaction binding the contract method 0xa22cb465. // // Solidity: function setApprovalForAll(address operator, bool approved) returns() func (_SystemPromptManager *SystemPromptManagerSession) SetApprovalForAll(operator common.Address, approved bool) (*types.Transaction, error) { return _SystemPromptManager.Contract.SetApprovalForAll(&_SystemPromptManager.TransactOpts, operator, approved) } // SetApprovalForAll is a paid mutator transaction binding the contract method 0xa22cb465. // // Solidity: function setApprovalForAll(address operator, bool approved) returns() func (_SystemPromptManager *SystemPromptManagerTransactorSession) SetApprovalForAll(operator common.Address, approved bool) (*types.Transaction, error) { return _SystemPromptManager.Contract.SetApprovalForAll(&_SystemPromptManager.TransactOpts, operator, approved) } // SetHybridModel is a paid mutator transaction binding the contract method 0xe645f296. // // Solidity: function setHybridModel(address _hybridModel) returns() func (_SystemPromptManager *SystemPromptManagerTransactor) SetHybridModel(opts *bind.TransactOpts, _hybridModel common.Address) (*types.Transaction, error) { return _SystemPromptManager.contract.Transact(opts, "setHybridModel", _hybridModel) } // SetHybridModel is a paid mutator transaction binding the contract method 0xe645f296. // // Solidity: function setHybridModel(address _hybridModel) returns() func (_SystemPromptManager *SystemPromptManagerSession) SetHybridModel(_hybridModel common.Address) (*types.Transaction, error) { return _SystemPromptManager.Contract.SetHybridModel(&_SystemPromptManager.TransactOpts, _hybridModel) } // SetHybridModel is a paid mutator transaction binding the contract method 0xe645f296. // // Solidity: function setHybridModel(address _hybridModel) returns() func (_SystemPromptManager *SystemPromptManagerTransactorSession) SetHybridModel(_hybridModel common.Address) (*types.Transaction, error) { return _SystemPromptManager.Contract.SetHybridModel(&_SystemPromptManager.TransactOpts, _hybridModel) } // TopUpPoolBalance is a paid mutator transaction binding the contract method 0xc82cd94b. // // Solidity: function topUpPoolBalance(uint256 _agentId) payable returns() func (_SystemPromptManager *SystemPromptManagerTransactor) TopUpPoolBalance(opts *bind.TransactOpts, _agentId *big.Int) (*types.Transaction, error) { return _SystemPromptManager.contract.Transact(opts, "topUpPoolBalance", _agentId) } // TopUpPoolBalance is a paid mutator transaction binding the contract method 0xc82cd94b. // // Solidity: function topUpPoolBalance(uint256 _agentId) payable returns() func (_SystemPromptManager *SystemPromptManagerSession) TopUpPoolBalance(_agentId *big.Int) (*types.Transaction, error) { return _SystemPromptManager.Contract.TopUpPoolBalance(&_SystemPromptManager.TransactOpts, _agentId) } // TopUpPoolBalance is a paid mutator transaction binding the contract method 0xc82cd94b. // // Solidity: function topUpPoolBalance(uint256 _agentId) payable returns() func (_SystemPromptManager *SystemPromptManagerTransactorSession) TopUpPoolBalance(_agentId *big.Int) (*types.Transaction, error) { return _SystemPromptManager.Contract.TopUpPoolBalance(&_SystemPromptManager.TransactOpts, _agentId) } // TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. // // Solidity: function transferFrom(address from, address to, uint256 tokenId) returns() func (_SystemPromptManager *SystemPromptManagerTransactor) TransferFrom(opts *bind.TransactOpts, from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _SystemPromptManager.contract.Transact(opts, "transferFrom", from, to, tokenId) } // TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. // // Solidity: function transferFrom(address from, address to, uint256 tokenId) returns() func (_SystemPromptManager *SystemPromptManagerSession) TransferFrom(from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _SystemPromptManager.Contract.TransferFrom(&_SystemPromptManager.TransactOpts, from, to, tokenId) } // TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. // // Solidity: function transferFrom(address from, address to, uint256 tokenId) returns() func (_SystemPromptManager *SystemPromptManagerTransactorSession) TransferFrom(from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _SystemPromptManager.Contract.TransferFrom(&_SystemPromptManager.TransactOpts, from, to, tokenId) } // TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. // // Solidity: function transferOwnership(address newOwner) returns() func (_SystemPromptManager *SystemPromptManagerTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) { return _SystemPromptManager.contract.Transact(opts, "transferOwnership", newOwner) } // TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. // // Solidity: function transferOwnership(address newOwner) returns() func (_SystemPromptManager *SystemPromptManagerSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { return _SystemPromptManager.Contract.TransferOwnership(&_SystemPromptManager.TransactOpts, newOwner) } // TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. // // Solidity: function transferOwnership(address newOwner) returns() func (_SystemPromptManager *SystemPromptManagerTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { return _SystemPromptManager.Contract.TransferOwnership(&_SystemPromptManager.TransactOpts, newOwner) } // Unpause is a paid mutator transaction binding the contract method 0x3f4ba83a. // // Solidity: function unpause() returns() func (_SystemPromptManager *SystemPromptManagerTransactor) Unpause(opts *bind.TransactOpts) (*types.Transaction, error) { return _SystemPromptManager.contract.Transact(opts, "unpause") } // Unpause is a paid mutator transaction binding the contract method 0x3f4ba83a. // // Solidity: function unpause() returns() func (_SystemPromptManager *SystemPromptManagerSession) Unpause() (*types.Transaction, error) { return _SystemPromptManager.Contract.Unpause(&_SystemPromptManager.TransactOpts) } // Unpause is a paid mutator transaction binding the contract method 0x3f4ba83a. // // Solidity: function unpause() returns() func (_SystemPromptManager *SystemPromptManagerTransactorSession) Unpause() (*types.Transaction, error) { return _SystemPromptManager.Contract.Unpause(&_SystemPromptManager.TransactOpts) } // UpdateAgentData is a paid mutator transaction binding the contract method 0xed82c9e0. // // Solidity: function updateAgentData(uint256 _agentId, bytes _sysPrompt, uint256 _promptIdx) returns() func (_SystemPromptManager *SystemPromptManagerTransactor) UpdateAgentData(opts *bind.TransactOpts, _agentId *big.Int, _sysPrompt []byte, _promptIdx *big.Int) (*types.Transaction, error) { return _SystemPromptManager.contract.Transact(opts, "updateAgentData", _agentId, _sysPrompt, _promptIdx) } // UpdateAgentData is a paid mutator transaction binding the contract method 0xed82c9e0. // // Solidity: function updateAgentData(uint256 _agentId, bytes _sysPrompt, uint256 _promptIdx) returns() func (_SystemPromptManager *SystemPromptManagerSession) UpdateAgentData(_agentId *big.Int, _sysPrompt []byte, _promptIdx *big.Int) (*types.Transaction, error) { return _SystemPromptManager.Contract.UpdateAgentData(&_SystemPromptManager.TransactOpts, _agentId, _sysPrompt, _promptIdx) } // UpdateAgentData is a paid mutator transaction binding the contract method 0xed82c9e0. // // Solidity: function updateAgentData(uint256 _agentId, bytes _sysPrompt, uint256 _promptIdx) returns() func (_SystemPromptManager *SystemPromptManagerTransactorSession) UpdateAgentData(_agentId *big.Int, _sysPrompt []byte, _promptIdx *big.Int) (*types.Transaction, error) { return _SystemPromptManager.Contract.UpdateAgentData(&_SystemPromptManager.TransactOpts, _agentId, _sysPrompt, _promptIdx) } // UpdateAgentFee is a paid mutator transaction binding the contract method 0xb1fd1526. // // Solidity: function updateAgentFee(uint256 _agentId, uint256 _fee) returns() func (_SystemPromptManager *SystemPromptManagerTransactor) UpdateAgentFee(opts *bind.TransactOpts, _agentId *big.Int, _fee *big.Int) (*types.Transaction, error) { return _SystemPromptManager.contract.Transact(opts, "updateAgentFee", _agentId, _fee) } // UpdateAgentFee is a paid mutator transaction binding the contract method 0xb1fd1526. // // Solidity: function updateAgentFee(uint256 _agentId, uint256 _fee) returns() func (_SystemPromptManager *SystemPromptManagerSession) UpdateAgentFee(_agentId *big.Int, _fee *big.Int) (*types.Transaction, error) { return _SystemPromptManager.Contract.UpdateAgentFee(&_SystemPromptManager.TransactOpts, _agentId, _fee) } // UpdateAgentFee is a paid mutator transaction binding the contract method 0xb1fd1526. // // Solidity: function updateAgentFee(uint256 _agentId, uint256 _fee) returns() func (_SystemPromptManager *SystemPromptManagerTransactorSession) UpdateAgentFee(_agentId *big.Int, _fee *big.Int) (*types.Transaction, error) { return _SystemPromptManager.Contract.UpdateAgentFee(&_SystemPromptManager.TransactOpts, _agentId, _fee) } // UpdateAgentURI is a paid mutator transaction binding the contract method 0x6b595822. // // Solidity: function updateAgentURI(uint256 _agentId, string _uri) returns() func (_SystemPromptManager *SystemPromptManagerTransactor) UpdateAgentURI(opts *bind.TransactOpts, _agentId *big.Int, _uri string) (*types.Transaction, error) { return _SystemPromptManager.contract.Transact(opts, "updateAgentURI", _agentId, _uri) } // UpdateAgentURI is a paid mutator transaction binding the contract method 0x6b595822. // // Solidity: function updateAgentURI(uint256 _agentId, string _uri) returns() func (_SystemPromptManager *SystemPromptManagerSession) UpdateAgentURI(_agentId *big.Int, _uri string) (*types.Transaction, error) { return _SystemPromptManager.Contract.UpdateAgentURI(&_SystemPromptManager.TransactOpts, _agentId, _uri) } // UpdateAgentURI is a paid mutator transaction binding the contract method 0x6b595822. // // Solidity: function updateAgentURI(uint256 _agentId, string _uri) returns() func (_SystemPromptManager *SystemPromptManagerTransactorSession) UpdateAgentURI(_agentId *big.Int, _uri string) (*types.Transaction, error) { return _SystemPromptManager.Contract.UpdateAgentURI(&_SystemPromptManager.TransactOpts, _agentId, _uri) } // UpdateMintPrice is a paid mutator transaction binding the contract method 0x00728e46. // // Solidity: function updateMintPrice(uint256 _mintPrice) returns() func (_SystemPromptManager *SystemPromptManagerTransactor) UpdateMintPrice(opts *bind.TransactOpts, _mintPrice *big.Int) (*types.Transaction, error) { return _SystemPromptManager.contract.Transact(opts, "updateMintPrice", _mintPrice) } // UpdateMintPrice is a paid mutator transaction binding the contract method 0x00728e46. // // Solidity: function updateMintPrice(uint256 _mintPrice) returns() func (_SystemPromptManager *SystemPromptManagerSession) UpdateMintPrice(_mintPrice *big.Int) (*types.Transaction, error) { return _SystemPromptManager.Contract.UpdateMintPrice(&_SystemPromptManager.TransactOpts, _mintPrice) } // UpdateMintPrice is a paid mutator transaction binding the contract method 0x00728e46. // // Solidity: function updateMintPrice(uint256 _mintPrice) returns() func (_SystemPromptManager *SystemPromptManagerTransactorSession) UpdateMintPrice(_mintPrice *big.Int) (*types.Transaction, error) { return _SystemPromptManager.Contract.UpdateMintPrice(&_SystemPromptManager.TransactOpts, _mintPrice) } // UpdateRoyaltyPortion is a paid mutator transaction binding the contract method 0x19e93993. // // Solidity: function updateRoyaltyPortion(uint16 _royaltyPortion) returns() func (_SystemPromptManager *SystemPromptManagerTransactor) UpdateRoyaltyPortion(opts *bind.TransactOpts, _royaltyPortion uint16) (*types.Transaction, error) { return _SystemPromptManager.contract.Transact(opts, "updateRoyaltyPortion", _royaltyPortion) } // UpdateRoyaltyPortion is a paid mutator transaction binding the contract method 0x19e93993. // // Solidity: function updateRoyaltyPortion(uint16 _royaltyPortion) returns() func (_SystemPromptManager *SystemPromptManagerSession) UpdateRoyaltyPortion(_royaltyPortion uint16) (*types.Transaction, error) { return _SystemPromptManager.Contract.UpdateRoyaltyPortion(&_SystemPromptManager.TransactOpts, _royaltyPortion) } // UpdateRoyaltyPortion is a paid mutator transaction binding the contract method 0x19e93993. // // Solidity: function updateRoyaltyPortion(uint16 _royaltyPortion) returns() func (_SystemPromptManager *SystemPromptManagerTransactorSession) UpdateRoyaltyPortion(_royaltyPortion uint16) (*types.Transaction, error) { return _SystemPromptManager.Contract.UpdateRoyaltyPortion(&_SystemPromptManager.TransactOpts, _royaltyPortion) } // UpdateRoyaltyReceiver is a paid mutator transaction binding the contract method 0x29dc4d9b. // // Solidity: function updateRoyaltyReceiver(address _royaltyReceiver) returns() func (_SystemPromptManager *SystemPromptManagerTransactor) UpdateRoyaltyReceiver(opts *bind.TransactOpts, _royaltyReceiver common.Address) (*types.Transaction, error) { return _SystemPromptManager.contract.Transact(opts, "updateRoyaltyReceiver", _royaltyReceiver) } // UpdateRoyaltyReceiver is a paid mutator transaction binding the contract method 0x29dc4d9b. // // Solidity: function updateRoyaltyReceiver(address _royaltyReceiver) returns() func (_SystemPromptManager *SystemPromptManagerSession) UpdateRoyaltyReceiver(_royaltyReceiver common.Address) (*types.Transaction, error) { return _SystemPromptManager.Contract.UpdateRoyaltyReceiver(&_SystemPromptManager.TransactOpts, _royaltyReceiver) } // UpdateRoyaltyReceiver is a paid mutator transaction binding the contract method 0x29dc4d9b. // // Solidity: function updateRoyaltyReceiver(address _royaltyReceiver) returns() func (_SystemPromptManager *SystemPromptManagerTransactorSession) UpdateRoyaltyReceiver(_royaltyReceiver common.Address) (*types.Transaction, error) { return _SystemPromptManager.Contract.UpdateRoyaltyReceiver(&_SystemPromptManager.TransactOpts, _royaltyReceiver) } // Withdraw is a paid mutator transaction binding the contract method 0xf3fef3a3. // // Solidity: function withdraw(address _to, uint256 _value) returns() func (_SystemPromptManager *SystemPromptManagerTransactor) Withdraw(opts *bind.TransactOpts, _to common.Address, _value *big.Int) (*types.Transaction, error) { return _SystemPromptManager.contract.Transact(opts, "withdraw", _to, _value) } // Withdraw is a paid mutator transaction binding the contract method 0xf3fef3a3. // // Solidity: function withdraw(address _to, uint256 _value) returns() func (_SystemPromptManager *SystemPromptManagerSession) Withdraw(_to common.Address, _value *big.Int) (*types.Transaction, error) { return _SystemPromptManager.Contract.Withdraw(&_SystemPromptManager.TransactOpts, _to, _value) } // Withdraw is a paid mutator transaction binding the contract method 0xf3fef3a3. // // Solidity: function withdraw(address _to, uint256 _value) returns() func (_SystemPromptManager *SystemPromptManagerTransactorSession) Withdraw(_to common.Address, _value *big.Int) (*types.Transaction, error) { return _SystemPromptManager.Contract.Withdraw(&_SystemPromptManager.TransactOpts, _to, _value) } // Receive is a paid mutator transaction binding the contract receive function. // // Solidity: receive() payable returns() func (_SystemPromptManager *SystemPromptManagerTransactor) Receive(opts *bind.TransactOpts) (*types.Transaction, error) { return _SystemPromptManager.contract.RawTransact(opts, nil) // calldata is disallowed for receive function } // Receive is a paid mutator transaction binding the contract receive function. // // Solidity: receive() payable returns() func (_SystemPromptManager *SystemPromptManagerSession) Receive() (*types.Transaction, error) { return _SystemPromptManager.Contract.Receive(&_SystemPromptManager.TransactOpts) } // Receive is a paid mutator transaction binding the contract receive function. // // Solidity: receive() payable returns() func (_SystemPromptManager *SystemPromptManagerTransactorSession) Receive() (*types.Transaction, error) { return _SystemPromptManager.Contract.Receive(&_SystemPromptManager.TransactOpts) } // SystemPromptManagerAgentDataAddNewIterator is returned from FilterAgentDataAddNew and is used to iterate over the raw logs and unpacked data for AgentDataAddNew events raised by the SystemPromptManager contract. type SystemPromptManagerAgentDataAddNewIterator struct { Event *SystemPromptManagerAgentDataAddNew // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *SystemPromptManagerAgentDataAddNewIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(SystemPromptManagerAgentDataAddNew) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(SystemPromptManagerAgentDataAddNew) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *SystemPromptManagerAgentDataAddNewIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *SystemPromptManagerAgentDataAddNewIterator) Close() error { it.sub.Unsubscribe() return nil } // SystemPromptManagerAgentDataAddNew represents a AgentDataAddNew event raised by the SystemPromptManager contract. type SystemPromptManagerAgentDataAddNew struct { AgentId *big.Int SysPrompt [][]byte Raw types.Log // Blockchain specific contextual infos } // FilterAgentDataAddNew is a free log retrieval operation binding the contract event 0xdebec4c58e3b7c5817893e50cb1f9e65b65978e8c89bb4407eb0109d5887b258. // // Solidity: event AgentDataAddNew(uint256 indexed agentId, bytes[] sysPrompt) func (_SystemPromptManager *SystemPromptManagerFilterer) FilterAgentDataAddNew(opts *bind.FilterOpts, agentId []*big.Int) (*SystemPromptManagerAgentDataAddNewIterator, error) { var agentIdRule []interface{} for _, agentIdItem := range agentId { agentIdRule = append(agentIdRule, agentIdItem) } logs, sub, err := _SystemPromptManager.contract.FilterLogs(opts, "AgentDataAddNew", agentIdRule) if err != nil { return nil, err } return &SystemPromptManagerAgentDataAddNewIterator{contract: _SystemPromptManager.contract, event: "AgentDataAddNew", logs: logs, sub: sub}, nil } // WatchAgentDataAddNew is a free log subscription operation binding the contract event 0xdebec4c58e3b7c5817893e50cb1f9e65b65978e8c89bb4407eb0109d5887b258. // // Solidity: event AgentDataAddNew(uint256 indexed agentId, bytes[] sysPrompt) func (_SystemPromptManager *SystemPromptManagerFilterer) WatchAgentDataAddNew(opts *bind.WatchOpts, sink chan<- *SystemPromptManagerAgentDataAddNew, agentId []*big.Int) (event.Subscription, error) { var agentIdRule []interface{} for _, agentIdItem := range agentId { agentIdRule = append(agentIdRule, agentIdItem) } logs, sub, err := _SystemPromptManager.contract.WatchLogs(opts, "AgentDataAddNew", agentIdRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(SystemPromptManagerAgentDataAddNew) if err := _SystemPromptManager.contract.UnpackLog(event, "AgentDataAddNew", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseAgentDataAddNew is a log parse operation binding the contract event 0xdebec4c58e3b7c5817893e50cb1f9e65b65978e8c89bb4407eb0109d5887b258. // // Solidity: event AgentDataAddNew(uint256 indexed agentId, bytes[] sysPrompt) func (_SystemPromptManager *SystemPromptManagerFilterer) ParseAgentDataAddNew(log types.Log) (*SystemPromptManagerAgentDataAddNew, error) { event := new(SystemPromptManagerAgentDataAddNew) if err := _SystemPromptManager.contract.UnpackLog(event, "AgentDataAddNew", log); err != nil { return nil, err } event.Raw = log return event, nil } // SystemPromptManagerAgentDataUpdateIterator is returned from FilterAgentDataUpdate and is used to iterate over the raw logs and unpacked data for AgentDataUpdate events raised by the SystemPromptManager contract. type SystemPromptManagerAgentDataUpdateIterator struct { Event *SystemPromptManagerAgentDataUpdate // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *SystemPromptManagerAgentDataUpdateIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(SystemPromptManagerAgentDataUpdate) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(SystemPromptManagerAgentDataUpdate) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *SystemPromptManagerAgentDataUpdateIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *SystemPromptManagerAgentDataUpdateIterator) Close() error { it.sub.Unsubscribe() return nil } // SystemPromptManagerAgentDataUpdate represents a AgentDataUpdate event raised by the SystemPromptManager contract. type SystemPromptManagerAgentDataUpdate struct { AgentId *big.Int PromptIndex *big.Int OldSysPrompt []byte NewSysPrompt []byte Raw types.Log // Blockchain specific contextual infos } // FilterAgentDataUpdate is a free log retrieval operation binding the contract event 0xe42abf7d4a793286da8cc1399cb577a1f5a0e133dfee371bb3a5abbdd77b011e. // // Solidity: event AgentDataUpdate(uint256 indexed agentId, uint256 promptIndex, bytes oldSysPrompt, bytes newSysPrompt) func (_SystemPromptManager *SystemPromptManagerFilterer) FilterAgentDataUpdate(opts *bind.FilterOpts, agentId []*big.Int) (*SystemPromptManagerAgentDataUpdateIterator, error) { var agentIdRule []interface{} for _, agentIdItem := range agentId { agentIdRule = append(agentIdRule, agentIdItem) } logs, sub, err := _SystemPromptManager.contract.FilterLogs(opts, "AgentDataUpdate", agentIdRule) if err != nil { return nil, err } return &SystemPromptManagerAgentDataUpdateIterator{contract: _SystemPromptManager.contract, event: "AgentDataUpdate", logs: logs, sub: sub}, nil } // WatchAgentDataUpdate is a free log subscription operation binding the contract event 0xe42abf7d4a793286da8cc1399cb577a1f5a0e133dfee371bb3a5abbdd77b011e. // // Solidity: event AgentDataUpdate(uint256 indexed agentId, uint256 promptIndex, bytes oldSysPrompt, bytes newSysPrompt) func (_SystemPromptManager *SystemPromptManagerFilterer) WatchAgentDataUpdate(opts *bind.WatchOpts, sink chan<- *SystemPromptManagerAgentDataUpdate, agentId []*big.Int) (event.Subscription, error) { var agentIdRule []interface{} for _, agentIdItem := range agentId { agentIdRule = append(agentIdRule, agentIdItem) } logs, sub, err := _SystemPromptManager.contract.WatchLogs(opts, "AgentDataUpdate", agentIdRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(SystemPromptManagerAgentDataUpdate) if err := _SystemPromptManager.contract.UnpackLog(event, "AgentDataUpdate", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseAgentDataUpdate is a log parse operation binding the contract event 0xe42abf7d4a793286da8cc1399cb577a1f5a0e133dfee371bb3a5abbdd77b011e. // // Solidity: event AgentDataUpdate(uint256 indexed agentId, uint256 promptIndex, bytes oldSysPrompt, bytes newSysPrompt) func (_SystemPromptManager *SystemPromptManagerFilterer) ParseAgentDataUpdate(log types.Log) (*SystemPromptManagerAgentDataUpdate, error) { event := new(SystemPromptManagerAgentDataUpdate) if err := _SystemPromptManager.contract.UnpackLog(event, "AgentDataUpdate", log); err != nil { return nil, err } event.Raw = log return event, nil } // SystemPromptManagerAgentFeeUpdateIterator is returned from FilterAgentFeeUpdate and is used to iterate over the raw logs and unpacked data for AgentFeeUpdate events raised by the SystemPromptManager contract. type SystemPromptManagerAgentFeeUpdateIterator struct { Event *SystemPromptManagerAgentFeeUpdate // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *SystemPromptManagerAgentFeeUpdateIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(SystemPromptManagerAgentFeeUpdate) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(SystemPromptManagerAgentFeeUpdate) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *SystemPromptManagerAgentFeeUpdateIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *SystemPromptManagerAgentFeeUpdateIterator) Close() error { it.sub.Unsubscribe() return nil } // SystemPromptManagerAgentFeeUpdate represents a AgentFeeUpdate event raised by the SystemPromptManager contract. type SystemPromptManagerAgentFeeUpdate struct { AgentId *big.Int Fee *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterAgentFeeUpdate is a free log retrieval operation binding the contract event 0xa08d8197034aee8915921dd8aa7d95cf711690dd77f0b676dded49b3f9a632d1. // // Solidity: event AgentFeeUpdate(uint256 indexed agentId, uint256 fee) func (_SystemPromptManager *SystemPromptManagerFilterer) FilterAgentFeeUpdate(opts *bind.FilterOpts, agentId []*big.Int) (*SystemPromptManagerAgentFeeUpdateIterator, error) { var agentIdRule []interface{} for _, agentIdItem := range agentId { agentIdRule = append(agentIdRule, agentIdItem) } logs, sub, err := _SystemPromptManager.contract.FilterLogs(opts, "AgentFeeUpdate", agentIdRule) if err != nil { return nil, err } return &SystemPromptManagerAgentFeeUpdateIterator{contract: _SystemPromptManager.contract, event: "AgentFeeUpdate", logs: logs, sub: sub}, nil } // WatchAgentFeeUpdate is a free log subscription operation binding the contract event 0xa08d8197034aee8915921dd8aa7d95cf711690dd77f0b676dded49b3f9a632d1. // // Solidity: event AgentFeeUpdate(uint256 indexed agentId, uint256 fee) func (_SystemPromptManager *SystemPromptManagerFilterer) WatchAgentFeeUpdate(opts *bind.WatchOpts, sink chan<- *SystemPromptManagerAgentFeeUpdate, agentId []*big.Int) (event.Subscription, error) { var agentIdRule []interface{} for _, agentIdItem := range agentId { agentIdRule = append(agentIdRule, agentIdItem) } logs, sub, err := _SystemPromptManager.contract.WatchLogs(opts, "AgentFeeUpdate", agentIdRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(SystemPromptManagerAgentFeeUpdate) if err := _SystemPromptManager.contract.UnpackLog(event, "AgentFeeUpdate", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseAgentFeeUpdate is a log parse operation binding the contract event 0xa08d8197034aee8915921dd8aa7d95cf711690dd77f0b676dded49b3f9a632d1. // // Solidity: event AgentFeeUpdate(uint256 indexed agentId, uint256 fee) func (_SystemPromptManager *SystemPromptManagerFilterer) ParseAgentFeeUpdate(log types.Log) (*SystemPromptManagerAgentFeeUpdate, error) { event := new(SystemPromptManagerAgentFeeUpdate) if err := _SystemPromptManager.contract.UnpackLog(event, "AgentFeeUpdate", log); err != nil { return nil, err } event.Raw = log return event, nil } // SystemPromptManagerAgentURIUpdateIterator is returned from FilterAgentURIUpdate and is used to iterate over the raw logs and unpacked data for AgentURIUpdate events raised by the SystemPromptManager contract. type SystemPromptManagerAgentURIUpdateIterator struct { Event *SystemPromptManagerAgentURIUpdate // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *SystemPromptManagerAgentURIUpdateIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(SystemPromptManagerAgentURIUpdate) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(SystemPromptManagerAgentURIUpdate) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *SystemPromptManagerAgentURIUpdateIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *SystemPromptManagerAgentURIUpdateIterator) Close() error { it.sub.Unsubscribe() return nil } // SystemPromptManagerAgentURIUpdate represents a AgentURIUpdate event raised by the SystemPromptManager contract. type SystemPromptManagerAgentURIUpdate struct { AgentId *big.Int Uri string Raw types.Log // Blockchain specific contextual infos } // FilterAgentURIUpdate is a free log retrieval operation binding the contract event 0x706a4e8eb2f354c7f4d96e5ea1984f36e72482629987edad78c9940ea037c362. // // Solidity: event AgentURIUpdate(uint256 indexed agentId, string uri) func (_SystemPromptManager *SystemPromptManagerFilterer) FilterAgentURIUpdate(opts *bind.FilterOpts, agentId []*big.Int) (*SystemPromptManagerAgentURIUpdateIterator, error) { var agentIdRule []interface{} for _, agentIdItem := range agentId { agentIdRule = append(agentIdRule, agentIdItem) } logs, sub, err := _SystemPromptManager.contract.FilterLogs(opts, "AgentURIUpdate", agentIdRule) if err != nil { return nil, err } return &SystemPromptManagerAgentURIUpdateIterator{contract: _SystemPromptManager.contract, event: "AgentURIUpdate", logs: logs, sub: sub}, nil } // WatchAgentURIUpdate is a free log subscription operation binding the contract event 0x706a4e8eb2f354c7f4d96e5ea1984f36e72482629987edad78c9940ea037c362. // // Solidity: event AgentURIUpdate(uint256 indexed agentId, string uri) func (_SystemPromptManager *SystemPromptManagerFilterer) WatchAgentURIUpdate(opts *bind.WatchOpts, sink chan<- *SystemPromptManagerAgentURIUpdate, agentId []*big.Int) (event.Subscription, error) { var agentIdRule []interface{} for _, agentIdItem := range agentId { agentIdRule = append(agentIdRule, agentIdItem) } logs, sub, err := _SystemPromptManager.contract.WatchLogs(opts, "AgentURIUpdate", agentIdRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(SystemPromptManagerAgentURIUpdate) if err := _SystemPromptManager.contract.UnpackLog(event, "AgentURIUpdate", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseAgentURIUpdate is a log parse operation binding the contract event 0x706a4e8eb2f354c7f4d96e5ea1984f36e72482629987edad78c9940ea037c362. // // Solidity: event AgentURIUpdate(uint256 indexed agentId, string uri) func (_SystemPromptManager *SystemPromptManagerFilterer) ParseAgentURIUpdate(log types.Log) (*SystemPromptManagerAgentURIUpdate, error) { event := new(SystemPromptManagerAgentURIUpdate) if err := _SystemPromptManager.contract.UnpackLog(event, "AgentURIUpdate", log); err != nil { return nil, err } event.Raw = log return event, nil } // SystemPromptManagerApprovalIterator is returned from FilterApproval and is used to iterate over the raw logs and unpacked data for Approval events raised by the SystemPromptManager contract. type SystemPromptManagerApprovalIterator struct { Event *SystemPromptManagerApproval // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *SystemPromptManagerApprovalIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(SystemPromptManagerApproval) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(SystemPromptManagerApproval) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *SystemPromptManagerApprovalIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *SystemPromptManagerApprovalIterator) Close() error { it.sub.Unsubscribe() return nil } // SystemPromptManagerApproval represents a Approval event raised by the SystemPromptManager contract. type SystemPromptManagerApproval struct { Owner common.Address Approved common.Address TokenId *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterApproval is a free log retrieval operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. // // Solidity: event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId) func (_SystemPromptManager *SystemPromptManagerFilterer) FilterApproval(opts *bind.FilterOpts, owner []common.Address, approved []common.Address, tokenId []*big.Int) (*SystemPromptManagerApprovalIterator, error) { var ownerRule []interface{} for _, ownerItem := range owner { ownerRule = append(ownerRule, ownerItem) } var approvedRule []interface{} for _, approvedItem := range approved { approvedRule = append(approvedRule, approvedItem) } var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _SystemPromptManager.contract.FilterLogs(opts, "Approval", ownerRule, approvedRule, tokenIdRule) if err != nil { return nil, err } return &SystemPromptManagerApprovalIterator{contract: _SystemPromptManager.contract, event: "Approval", logs: logs, sub: sub}, nil } // WatchApproval is a free log subscription operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. // // Solidity: event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId) func (_SystemPromptManager *SystemPromptManagerFilterer) WatchApproval(opts *bind.WatchOpts, sink chan<- *SystemPromptManagerApproval, owner []common.Address, approved []common.Address, tokenId []*big.Int) (event.Subscription, error) { var ownerRule []interface{} for _, ownerItem := range owner { ownerRule = append(ownerRule, ownerItem) } var approvedRule []interface{} for _, approvedItem := range approved { approvedRule = append(approvedRule, approvedItem) } var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _SystemPromptManager.contract.WatchLogs(opts, "Approval", ownerRule, approvedRule, tokenIdRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(SystemPromptManagerApproval) if err := _SystemPromptManager.contract.UnpackLog(event, "Approval", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseApproval is a log parse operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. // // Solidity: event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId) func (_SystemPromptManager *SystemPromptManagerFilterer) ParseApproval(log types.Log) (*SystemPromptManagerApproval, error) { event := new(SystemPromptManagerApproval) if err := _SystemPromptManager.contract.UnpackLog(event, "Approval", log); err != nil { return nil, err } event.Raw = log return event, nil } // SystemPromptManagerApprovalForAllIterator is returned from FilterApprovalForAll and is used to iterate over the raw logs and unpacked data for ApprovalForAll events raised by the SystemPromptManager contract. type SystemPromptManagerApprovalForAllIterator struct { Event *SystemPromptManagerApprovalForAll // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *SystemPromptManagerApprovalForAllIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(SystemPromptManagerApprovalForAll) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(SystemPromptManagerApprovalForAll) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *SystemPromptManagerApprovalForAllIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *SystemPromptManagerApprovalForAllIterator) Close() error { it.sub.Unsubscribe() return nil } // SystemPromptManagerApprovalForAll represents a ApprovalForAll event raised by the SystemPromptManager contract. type SystemPromptManagerApprovalForAll struct { Owner common.Address Operator common.Address Approved bool Raw types.Log // Blockchain specific contextual infos } // FilterApprovalForAll is a free log retrieval operation binding the contract event 0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31. // // Solidity: event ApprovalForAll(address indexed owner, address indexed operator, bool approved) func (_SystemPromptManager *SystemPromptManagerFilterer) FilterApprovalForAll(opts *bind.FilterOpts, owner []common.Address, operator []common.Address) (*SystemPromptManagerApprovalForAllIterator, error) { var ownerRule []interface{} for _, ownerItem := range owner { ownerRule = append(ownerRule, ownerItem) } var operatorRule []interface{} for _, operatorItem := range operator { operatorRule = append(operatorRule, operatorItem) } logs, sub, err := _SystemPromptManager.contract.FilterLogs(opts, "ApprovalForAll", ownerRule, operatorRule) if err != nil { return nil, err } return &SystemPromptManagerApprovalForAllIterator{contract: _SystemPromptManager.contract, event: "ApprovalForAll", logs: logs, sub: sub}, nil } // WatchApprovalForAll is a free log subscription operation binding the contract event 0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31. // // Solidity: event ApprovalForAll(address indexed owner, address indexed operator, bool approved) func (_SystemPromptManager *SystemPromptManagerFilterer) WatchApprovalForAll(opts *bind.WatchOpts, sink chan<- *SystemPromptManagerApprovalForAll, owner []common.Address, operator []common.Address) (event.Subscription, error) { var ownerRule []interface{} for _, ownerItem := range owner { ownerRule = append(ownerRule, ownerItem) } var operatorRule []interface{} for _, operatorItem := range operator { operatorRule = append(operatorRule, operatorItem) } logs, sub, err := _SystemPromptManager.contract.WatchLogs(opts, "ApprovalForAll", ownerRule, operatorRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(SystemPromptManagerApprovalForAll) if err := _SystemPromptManager.contract.UnpackLog(event, "ApprovalForAll", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseApprovalForAll is a log parse operation binding the contract event 0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31. // // Solidity: event ApprovalForAll(address indexed owner, address indexed operator, bool approved) func (_SystemPromptManager *SystemPromptManagerFilterer) ParseApprovalForAll(log types.Log) (*SystemPromptManagerApprovalForAll, error) { event := new(SystemPromptManagerApprovalForAll) if err := _SystemPromptManager.contract.UnpackLog(event, "ApprovalForAll", log); err != nil { return nil, err } event.Raw = log return event, nil } // SystemPromptManagerBatchMetadataUpdateIterator is returned from FilterBatchMetadataUpdate and is used to iterate over the raw logs and unpacked data for BatchMetadataUpdate events raised by the SystemPromptManager contract. type SystemPromptManagerBatchMetadataUpdateIterator struct { Event *SystemPromptManagerBatchMetadataUpdate // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *SystemPromptManagerBatchMetadataUpdateIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(SystemPromptManagerBatchMetadataUpdate) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(SystemPromptManagerBatchMetadataUpdate) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *SystemPromptManagerBatchMetadataUpdateIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *SystemPromptManagerBatchMetadataUpdateIterator) Close() error { it.sub.Unsubscribe() return nil } // SystemPromptManagerBatchMetadataUpdate represents a BatchMetadataUpdate event raised by the SystemPromptManager contract. type SystemPromptManagerBatchMetadataUpdate struct { FromTokenId *big.Int ToTokenId *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterBatchMetadataUpdate is a free log retrieval operation binding the contract event 0x6bd5c950a8d8df17f772f5af37cb3655737899cbf903264b9795592da439661c. // // Solidity: event BatchMetadataUpdate(uint256 _fromTokenId, uint256 _toTokenId) func (_SystemPromptManager *SystemPromptManagerFilterer) FilterBatchMetadataUpdate(opts *bind.FilterOpts) (*SystemPromptManagerBatchMetadataUpdateIterator, error) { logs, sub, err := _SystemPromptManager.contract.FilterLogs(opts, "BatchMetadataUpdate") if err != nil { return nil, err } return &SystemPromptManagerBatchMetadataUpdateIterator{contract: _SystemPromptManager.contract, event: "BatchMetadataUpdate", logs: logs, sub: sub}, nil } // WatchBatchMetadataUpdate is a free log subscription operation binding the contract event 0x6bd5c950a8d8df17f772f5af37cb3655737899cbf903264b9795592da439661c. // // Solidity: event BatchMetadataUpdate(uint256 _fromTokenId, uint256 _toTokenId) func (_SystemPromptManager *SystemPromptManagerFilterer) WatchBatchMetadataUpdate(opts *bind.WatchOpts, sink chan<- *SystemPromptManagerBatchMetadataUpdate) (event.Subscription, error) { logs, sub, err := _SystemPromptManager.contract.WatchLogs(opts, "BatchMetadataUpdate") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(SystemPromptManagerBatchMetadataUpdate) if err := _SystemPromptManager.contract.UnpackLog(event, "BatchMetadataUpdate", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseBatchMetadataUpdate is a log parse operation binding the contract event 0x6bd5c950a8d8df17f772f5af37cb3655737899cbf903264b9795592da439661c. // // Solidity: event BatchMetadataUpdate(uint256 _fromTokenId, uint256 _toTokenId) func (_SystemPromptManager *SystemPromptManagerFilterer) ParseBatchMetadataUpdate(log types.Log) (*SystemPromptManagerBatchMetadataUpdate, error) { event := new(SystemPromptManagerBatchMetadataUpdate) if err := _SystemPromptManager.contract.UnpackLog(event, "BatchMetadataUpdate", log); err != nil { return nil, err } event.Raw = log return event, nil } // SystemPromptManagerEIP712DomainChangedIterator is returned from FilterEIP712DomainChanged and is used to iterate over the raw logs and unpacked data for EIP712DomainChanged events raised by the SystemPromptManager contract. type SystemPromptManagerEIP712DomainChangedIterator struct { Event *SystemPromptManagerEIP712DomainChanged // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *SystemPromptManagerEIP712DomainChangedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(SystemPromptManagerEIP712DomainChanged) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(SystemPromptManagerEIP712DomainChanged) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *SystemPromptManagerEIP712DomainChangedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *SystemPromptManagerEIP712DomainChangedIterator) Close() error { it.sub.Unsubscribe() return nil } // SystemPromptManagerEIP712DomainChanged represents a EIP712DomainChanged event raised by the SystemPromptManager contract. type SystemPromptManagerEIP712DomainChanged struct { Raw types.Log // Blockchain specific contextual infos } // FilterEIP712DomainChanged is a free log retrieval operation binding the contract event 0x0a6387c9ea3628b88a633bb4f3b151770f70085117a15f9bf3787cda53f13d31. // // Solidity: event EIP712DomainChanged() func (_SystemPromptManager *SystemPromptManagerFilterer) FilterEIP712DomainChanged(opts *bind.FilterOpts) (*SystemPromptManagerEIP712DomainChangedIterator, error) { logs, sub, err := _SystemPromptManager.contract.FilterLogs(opts, "EIP712DomainChanged") if err != nil { return nil, err } return &SystemPromptManagerEIP712DomainChangedIterator{contract: _SystemPromptManager.contract, event: "EIP712DomainChanged", logs: logs, sub: sub}, nil } // WatchEIP712DomainChanged is a free log subscription operation binding the contract event 0x0a6387c9ea3628b88a633bb4f3b151770f70085117a15f9bf3787cda53f13d31. // // Solidity: event EIP712DomainChanged() func (_SystemPromptManager *SystemPromptManagerFilterer) WatchEIP712DomainChanged(opts *bind.WatchOpts, sink chan<- *SystemPromptManagerEIP712DomainChanged) (event.Subscription, error) { logs, sub, err := _SystemPromptManager.contract.WatchLogs(opts, "EIP712DomainChanged") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(SystemPromptManagerEIP712DomainChanged) if err := _SystemPromptManager.contract.UnpackLog(event, "EIP712DomainChanged", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseEIP712DomainChanged is a log parse operation binding the contract event 0x0a6387c9ea3628b88a633bb4f3b151770f70085117a15f9bf3787cda53f13d31. // // Solidity: event EIP712DomainChanged() func (_SystemPromptManager *SystemPromptManagerFilterer) ParseEIP712DomainChanged(log types.Log) (*SystemPromptManagerEIP712DomainChanged, error) { event := new(SystemPromptManagerEIP712DomainChanged) if err := _SystemPromptManager.contract.UnpackLog(event, "EIP712DomainChanged", log); err != nil { return nil, err } event.Raw = log return event, nil } // SystemPromptManagerFeesClaimedIterator is returned from FilterFeesClaimed and is used to iterate over the raw logs and unpacked data for FeesClaimed events raised by the SystemPromptManager contract. type SystemPromptManagerFeesClaimedIterator struct { Event *SystemPromptManagerFeesClaimed // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *SystemPromptManagerFeesClaimedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(SystemPromptManagerFeesClaimed) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(SystemPromptManagerFeesClaimed) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *SystemPromptManagerFeesClaimedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *SystemPromptManagerFeesClaimedIterator) Close() error { it.sub.Unsubscribe() return nil } // SystemPromptManagerFeesClaimed represents a FeesClaimed event raised by the SystemPromptManager contract. type SystemPromptManagerFeesClaimed struct { Claimer common.Address Amount *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterFeesClaimed is a free log retrieval operation binding the contract event 0x9493e5bbe4e8e0ac67284469a2d677403d0378a85a59e341d3abc433d0d9a209. // // Solidity: event FeesClaimed(address indexed claimer, uint256 amount) func (_SystemPromptManager *SystemPromptManagerFilterer) FilterFeesClaimed(opts *bind.FilterOpts, claimer []common.Address) (*SystemPromptManagerFeesClaimedIterator, error) { var claimerRule []interface{} for _, claimerItem := range claimer { claimerRule = append(claimerRule, claimerItem) } logs, sub, err := _SystemPromptManager.contract.FilterLogs(opts, "FeesClaimed", claimerRule) if err != nil { return nil, err } return &SystemPromptManagerFeesClaimedIterator{contract: _SystemPromptManager.contract, event: "FeesClaimed", logs: logs, sub: sub}, nil } // WatchFeesClaimed is a free log subscription operation binding the contract event 0x9493e5bbe4e8e0ac67284469a2d677403d0378a85a59e341d3abc433d0d9a209. // // Solidity: event FeesClaimed(address indexed claimer, uint256 amount) func (_SystemPromptManager *SystemPromptManagerFilterer) WatchFeesClaimed(opts *bind.WatchOpts, sink chan<- *SystemPromptManagerFeesClaimed, claimer []common.Address) (event.Subscription, error) { var claimerRule []interface{} for _, claimerItem := range claimer { claimerRule = append(claimerRule, claimerItem) } logs, sub, err := _SystemPromptManager.contract.WatchLogs(opts, "FeesClaimed", claimerRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(SystemPromptManagerFeesClaimed) if err := _SystemPromptManager.contract.UnpackLog(event, "FeesClaimed", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseFeesClaimed is a log parse operation binding the contract event 0x9493e5bbe4e8e0ac67284469a2d677403d0378a85a59e341d3abc433d0d9a209. // // Solidity: event FeesClaimed(address indexed claimer, uint256 amount) func (_SystemPromptManager *SystemPromptManagerFilterer) ParseFeesClaimed(log types.Log) (*SystemPromptManagerFeesClaimed, error) { event := new(SystemPromptManagerFeesClaimed) if err := _SystemPromptManager.contract.UnpackLog(event, "FeesClaimed", log); err != nil { return nil, err } event.Raw = log return event, nil } // SystemPromptManagerInferencePerformedIterator is returned from FilterInferencePerformed and is used to iterate over the raw logs and unpacked data for InferencePerformed events raised by the SystemPromptManager contract. type SystemPromptManagerInferencePerformedIterator struct { Event *SystemPromptManagerInferencePerformed // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *SystemPromptManagerInferencePerformedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(SystemPromptManagerInferencePerformed) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(SystemPromptManagerInferencePerformed) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *SystemPromptManagerInferencePerformedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *SystemPromptManagerInferencePerformedIterator) Close() error { it.sub.Unsubscribe() return nil } // SystemPromptManagerInferencePerformed represents a InferencePerformed event raised by the SystemPromptManager contract. type SystemPromptManagerInferencePerformed struct { TokenId *big.Int Caller common.Address Data []byte Fee *big.Int ExternalData string InferenceId *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterInferencePerformed is a free log retrieval operation binding the contract event 0xcf35460eca25a0549d5eb14c712236d61c9a0bad90c834f996c5f2a98d332719. // // Solidity: event InferencePerformed(uint256 indexed tokenId, address indexed caller, bytes data, uint256 fee, string externalData, uint256 inferenceId) func (_SystemPromptManager *SystemPromptManagerFilterer) FilterInferencePerformed(opts *bind.FilterOpts, tokenId []*big.Int, caller []common.Address) (*SystemPromptManagerInferencePerformedIterator, error) { var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } var callerRule []interface{} for _, callerItem := range caller { callerRule = append(callerRule, callerItem) } logs, sub, err := _SystemPromptManager.contract.FilterLogs(opts, "InferencePerformed", tokenIdRule, callerRule) if err != nil { return nil, err } return &SystemPromptManagerInferencePerformedIterator{contract: _SystemPromptManager.contract, event: "InferencePerformed", logs: logs, sub: sub}, nil } // WatchInferencePerformed is a free log subscription operation binding the contract event 0xcf35460eca25a0549d5eb14c712236d61c9a0bad90c834f996c5f2a98d332719. // // Solidity: event InferencePerformed(uint256 indexed tokenId, address indexed caller, bytes data, uint256 fee, string externalData, uint256 inferenceId) func (_SystemPromptManager *SystemPromptManagerFilterer) WatchInferencePerformed(opts *bind.WatchOpts, sink chan<- *SystemPromptManagerInferencePerformed, tokenId []*big.Int, caller []common.Address) (event.Subscription, error) { var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } var callerRule []interface{} for _, callerItem := range caller { callerRule = append(callerRule, callerItem) } logs, sub, err := _SystemPromptManager.contract.WatchLogs(opts, "InferencePerformed", tokenIdRule, callerRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(SystemPromptManagerInferencePerformed) if err := _SystemPromptManager.contract.UnpackLog(event, "InferencePerformed", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseInferencePerformed is a log parse operation binding the contract event 0xcf35460eca25a0549d5eb14c712236d61c9a0bad90c834f996c5f2a98d332719. // // Solidity: event InferencePerformed(uint256 indexed tokenId, address indexed caller, bytes data, uint256 fee, string externalData, uint256 inferenceId) func (_SystemPromptManager *SystemPromptManagerFilterer) ParseInferencePerformed(log types.Log) (*SystemPromptManagerInferencePerformed, error) { event := new(SystemPromptManagerInferencePerformed) if err := _SystemPromptManager.contract.UnpackLog(event, "InferencePerformed", log); err != nil { return nil, err } event.Raw = log return event, nil } // SystemPromptManagerInitializedIterator is returned from FilterInitialized and is used to iterate over the raw logs and unpacked data for Initialized events raised by the SystemPromptManager contract. type SystemPromptManagerInitializedIterator struct { Event *SystemPromptManagerInitialized // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *SystemPromptManagerInitializedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(SystemPromptManagerInitialized) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(SystemPromptManagerInitialized) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *SystemPromptManagerInitializedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *SystemPromptManagerInitializedIterator) Close() error { it.sub.Unsubscribe() return nil } // SystemPromptManagerInitialized represents a Initialized event raised by the SystemPromptManager contract. type SystemPromptManagerInitialized struct { Version uint8 Raw types.Log // Blockchain specific contextual infos } // FilterInitialized is a free log retrieval operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. // // Solidity: event Initialized(uint8 version) func (_SystemPromptManager *SystemPromptManagerFilterer) FilterInitialized(opts *bind.FilterOpts) (*SystemPromptManagerInitializedIterator, error) { logs, sub, err := _SystemPromptManager.contract.FilterLogs(opts, "Initialized") if err != nil { return nil, err } return &SystemPromptManagerInitializedIterator{contract: _SystemPromptManager.contract, event: "Initialized", logs: logs, sub: sub}, nil } // WatchInitialized is a free log subscription operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. // // Solidity: event Initialized(uint8 version) func (_SystemPromptManager *SystemPromptManagerFilterer) WatchInitialized(opts *bind.WatchOpts, sink chan<- *SystemPromptManagerInitialized) (event.Subscription, error) { logs, sub, err := _SystemPromptManager.contract.WatchLogs(opts, "Initialized") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(SystemPromptManagerInitialized) if err := _SystemPromptManager.contract.UnpackLog(event, "Initialized", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseInitialized is a log parse operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. // // Solidity: event Initialized(uint8 version) func (_SystemPromptManager *SystemPromptManagerFilterer) ParseInitialized(log types.Log) (*SystemPromptManagerInitialized, error) { event := new(SystemPromptManagerInitialized) if err := _SystemPromptManager.contract.UnpackLog(event, "Initialized", log); err != nil { return nil, err } event.Raw = log return event, nil } // SystemPromptManagerManagerAuthorizationIterator is returned from FilterManagerAuthorization and is used to iterate over the raw logs and unpacked data for ManagerAuthorization events raised by the SystemPromptManager contract. type SystemPromptManagerManagerAuthorizationIterator struct { Event *SystemPromptManagerManagerAuthorization // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *SystemPromptManagerManagerAuthorizationIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(SystemPromptManagerManagerAuthorization) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(SystemPromptManagerManagerAuthorization) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *SystemPromptManagerManagerAuthorizationIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *SystemPromptManagerManagerAuthorizationIterator) Close() error { it.sub.Unsubscribe() return nil } // SystemPromptManagerManagerAuthorization represents a ManagerAuthorization event raised by the SystemPromptManager contract. type SystemPromptManagerManagerAuthorization struct { Account common.Address Raw types.Log // Blockchain specific contextual infos } // FilterManagerAuthorization is a free log retrieval operation binding the contract event 0x3fbc8e71624117c0dc0fcdbe40685681cecc7c3c43de81a686cda4b61c78e35b. // // Solidity: event ManagerAuthorization(address indexed account) func (_SystemPromptManager *SystemPromptManagerFilterer) FilterManagerAuthorization(opts *bind.FilterOpts, account []common.Address) (*SystemPromptManagerManagerAuthorizationIterator, error) { var accountRule []interface{} for _, accountItem := range account { accountRule = append(accountRule, accountItem) } logs, sub, err := _SystemPromptManager.contract.FilterLogs(opts, "ManagerAuthorization", accountRule) if err != nil { return nil, err } return &SystemPromptManagerManagerAuthorizationIterator{contract: _SystemPromptManager.contract, event: "ManagerAuthorization", logs: logs, sub: sub}, nil } // WatchManagerAuthorization is a free log subscription operation binding the contract event 0x3fbc8e71624117c0dc0fcdbe40685681cecc7c3c43de81a686cda4b61c78e35b. // // Solidity: event ManagerAuthorization(address indexed account) func (_SystemPromptManager *SystemPromptManagerFilterer) WatchManagerAuthorization(opts *bind.WatchOpts, sink chan<- *SystemPromptManagerManagerAuthorization, account []common.Address) (event.Subscription, error) { var accountRule []interface{} for _, accountItem := range account { accountRule = append(accountRule, accountItem) } logs, sub, err := _SystemPromptManager.contract.WatchLogs(opts, "ManagerAuthorization", accountRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(SystemPromptManagerManagerAuthorization) if err := _SystemPromptManager.contract.UnpackLog(event, "ManagerAuthorization", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseManagerAuthorization is a log parse operation binding the contract event 0x3fbc8e71624117c0dc0fcdbe40685681cecc7c3c43de81a686cda4b61c78e35b. // // Solidity: event ManagerAuthorization(address indexed account) func (_SystemPromptManager *SystemPromptManagerFilterer) ParseManagerAuthorization(log types.Log) (*SystemPromptManagerManagerAuthorization, error) { event := new(SystemPromptManagerManagerAuthorization) if err := _SystemPromptManager.contract.UnpackLog(event, "ManagerAuthorization", log); err != nil { return nil, err } event.Raw = log return event, nil } // SystemPromptManagerManagerDeauthorizationIterator is returned from FilterManagerDeauthorization and is used to iterate over the raw logs and unpacked data for ManagerDeauthorization events raised by the SystemPromptManager contract. type SystemPromptManagerManagerDeauthorizationIterator struct { Event *SystemPromptManagerManagerDeauthorization // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *SystemPromptManagerManagerDeauthorizationIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(SystemPromptManagerManagerDeauthorization) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(SystemPromptManagerManagerDeauthorization) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *SystemPromptManagerManagerDeauthorizationIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *SystemPromptManagerManagerDeauthorizationIterator) Close() error { it.sub.Unsubscribe() return nil } // SystemPromptManagerManagerDeauthorization represents a ManagerDeauthorization event raised by the SystemPromptManager contract. type SystemPromptManagerManagerDeauthorization struct { Account common.Address Raw types.Log // Blockchain specific contextual infos } // FilterManagerDeauthorization is a free log retrieval operation binding the contract event 0x20c29af9eb3de2601188ceae57a4075ba3593ce15d4142aef070ac53d389356c. // // Solidity: event ManagerDeauthorization(address indexed account) func (_SystemPromptManager *SystemPromptManagerFilterer) FilterManagerDeauthorization(opts *bind.FilterOpts, account []common.Address) (*SystemPromptManagerManagerDeauthorizationIterator, error) { var accountRule []interface{} for _, accountItem := range account { accountRule = append(accountRule, accountItem) } logs, sub, err := _SystemPromptManager.contract.FilterLogs(opts, "ManagerDeauthorization", accountRule) if err != nil { return nil, err } return &SystemPromptManagerManagerDeauthorizationIterator{contract: _SystemPromptManager.contract, event: "ManagerDeauthorization", logs: logs, sub: sub}, nil } // WatchManagerDeauthorization is a free log subscription operation binding the contract event 0x20c29af9eb3de2601188ceae57a4075ba3593ce15d4142aef070ac53d389356c. // // Solidity: event ManagerDeauthorization(address indexed account) func (_SystemPromptManager *SystemPromptManagerFilterer) WatchManagerDeauthorization(opts *bind.WatchOpts, sink chan<- *SystemPromptManagerManagerDeauthorization, account []common.Address) (event.Subscription, error) { var accountRule []interface{} for _, accountItem := range account { accountRule = append(accountRule, accountItem) } logs, sub, err := _SystemPromptManager.contract.WatchLogs(opts, "ManagerDeauthorization", accountRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(SystemPromptManagerManagerDeauthorization) if err := _SystemPromptManager.contract.UnpackLog(event, "ManagerDeauthorization", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseManagerDeauthorization is a log parse operation binding the contract event 0x20c29af9eb3de2601188ceae57a4075ba3593ce15d4142aef070ac53d389356c. // // Solidity: event ManagerDeauthorization(address indexed account) func (_SystemPromptManager *SystemPromptManagerFilterer) ParseManagerDeauthorization(log types.Log) (*SystemPromptManagerManagerDeauthorization, error) { event := new(SystemPromptManagerManagerDeauthorization) if err := _SystemPromptManager.contract.UnpackLog(event, "ManagerDeauthorization", log); err != nil { return nil, err } event.Raw = log return event, nil } // SystemPromptManagerMetadataUpdateIterator is returned from FilterMetadataUpdate and is used to iterate over the raw logs and unpacked data for MetadataUpdate events raised by the SystemPromptManager contract. type SystemPromptManagerMetadataUpdateIterator struct { Event *SystemPromptManagerMetadataUpdate // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *SystemPromptManagerMetadataUpdateIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(SystemPromptManagerMetadataUpdate) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(SystemPromptManagerMetadataUpdate) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *SystemPromptManagerMetadataUpdateIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *SystemPromptManagerMetadataUpdateIterator) Close() error { it.sub.Unsubscribe() return nil } // SystemPromptManagerMetadataUpdate represents a MetadataUpdate event raised by the SystemPromptManager contract. type SystemPromptManagerMetadataUpdate struct { TokenId *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterMetadataUpdate is a free log retrieval operation binding the contract event 0xf8e1a15aba9398e019f0b49df1a4fde98ee17ae345cb5f6b5e2c27f5033e8ce7. // // Solidity: event MetadataUpdate(uint256 _tokenId) func (_SystemPromptManager *SystemPromptManagerFilterer) FilterMetadataUpdate(opts *bind.FilterOpts) (*SystemPromptManagerMetadataUpdateIterator, error) { logs, sub, err := _SystemPromptManager.contract.FilterLogs(opts, "MetadataUpdate") if err != nil { return nil, err } return &SystemPromptManagerMetadataUpdateIterator{contract: _SystemPromptManager.contract, event: "MetadataUpdate", logs: logs, sub: sub}, nil } // WatchMetadataUpdate is a free log subscription operation binding the contract event 0xf8e1a15aba9398e019f0b49df1a4fde98ee17ae345cb5f6b5e2c27f5033e8ce7. // // Solidity: event MetadataUpdate(uint256 _tokenId) func (_SystemPromptManager *SystemPromptManagerFilterer) WatchMetadataUpdate(opts *bind.WatchOpts, sink chan<- *SystemPromptManagerMetadataUpdate) (event.Subscription, error) { logs, sub, err := _SystemPromptManager.contract.WatchLogs(opts, "MetadataUpdate") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(SystemPromptManagerMetadataUpdate) if err := _SystemPromptManager.contract.UnpackLog(event, "MetadataUpdate", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseMetadataUpdate is a log parse operation binding the contract event 0xf8e1a15aba9398e019f0b49df1a4fde98ee17ae345cb5f6b5e2c27f5033e8ce7. // // Solidity: event MetadataUpdate(uint256 _tokenId) func (_SystemPromptManager *SystemPromptManagerFilterer) ParseMetadataUpdate(log types.Log) (*SystemPromptManagerMetadataUpdate, error) { event := new(SystemPromptManagerMetadataUpdate) if err := _SystemPromptManager.contract.UnpackLog(event, "MetadataUpdate", log); err != nil { return nil, err } event.Raw = log return event, nil } // SystemPromptManagerMintPriceUpdateIterator is returned from FilterMintPriceUpdate and is used to iterate over the raw logs and unpacked data for MintPriceUpdate events raised by the SystemPromptManager contract. type SystemPromptManagerMintPriceUpdateIterator struct { Event *SystemPromptManagerMintPriceUpdate // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *SystemPromptManagerMintPriceUpdateIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(SystemPromptManagerMintPriceUpdate) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(SystemPromptManagerMintPriceUpdate) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *SystemPromptManagerMintPriceUpdateIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *SystemPromptManagerMintPriceUpdateIterator) Close() error { it.sub.Unsubscribe() return nil } // SystemPromptManagerMintPriceUpdate represents a MintPriceUpdate event raised by the SystemPromptManager contract. type SystemPromptManagerMintPriceUpdate struct { NewValue *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterMintPriceUpdate is a free log retrieval operation binding the contract event 0x23050b539195eebd064c1bec834445b7d028a20c345600e868a74d7ca93c5e86. // // Solidity: event MintPriceUpdate(uint256 newValue) func (_SystemPromptManager *SystemPromptManagerFilterer) FilterMintPriceUpdate(opts *bind.FilterOpts) (*SystemPromptManagerMintPriceUpdateIterator, error) { logs, sub, err := _SystemPromptManager.contract.FilterLogs(opts, "MintPriceUpdate") if err != nil { return nil, err } return &SystemPromptManagerMintPriceUpdateIterator{contract: _SystemPromptManager.contract, event: "MintPriceUpdate", logs: logs, sub: sub}, nil } // WatchMintPriceUpdate is a free log subscription operation binding the contract event 0x23050b539195eebd064c1bec834445b7d028a20c345600e868a74d7ca93c5e86. // // Solidity: event MintPriceUpdate(uint256 newValue) func (_SystemPromptManager *SystemPromptManagerFilterer) WatchMintPriceUpdate(opts *bind.WatchOpts, sink chan<- *SystemPromptManagerMintPriceUpdate) (event.Subscription, error) { logs, sub, err := _SystemPromptManager.contract.WatchLogs(opts, "MintPriceUpdate") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(SystemPromptManagerMintPriceUpdate) if err := _SystemPromptManager.contract.UnpackLog(event, "MintPriceUpdate", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseMintPriceUpdate is a log parse operation binding the contract event 0x23050b539195eebd064c1bec834445b7d028a20c345600e868a74d7ca93c5e86. // // Solidity: event MintPriceUpdate(uint256 newValue) func (_SystemPromptManager *SystemPromptManagerFilterer) ParseMintPriceUpdate(log types.Log) (*SystemPromptManagerMintPriceUpdate, error) { event := new(SystemPromptManagerMintPriceUpdate) if err := _SystemPromptManager.contract.UnpackLog(event, "MintPriceUpdate", log); err != nil { return nil, err } event.Raw = log return event, nil } // SystemPromptManagerNewTokenIterator is returned from FilterNewToken and is used to iterate over the raw logs and unpacked data for NewToken events raised by the SystemPromptManager contract. type SystemPromptManagerNewTokenIterator struct { Event *SystemPromptManagerNewToken // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *SystemPromptManagerNewTokenIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(SystemPromptManagerNewToken) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(SystemPromptManagerNewToken) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *SystemPromptManagerNewTokenIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *SystemPromptManagerNewTokenIterator) Close() error { it.sub.Unsubscribe() return nil } // SystemPromptManagerNewToken represents a NewToken event raised by the SystemPromptManager contract. type SystemPromptManagerNewToken struct { TokenId *big.Int Uri string SysPrompt []byte Fee *big.Int Minter common.Address Raw types.Log // Blockchain specific contextual infos } // FilterNewToken is a free log retrieval operation binding the contract event 0x61beab98a81083e3c0239c33e149bef1316ca78f15b9f29125039f5521a06d06. // // Solidity: event NewToken(uint256 indexed tokenId, string uri, bytes sysPrompt, uint256 fee, address indexed minter) func (_SystemPromptManager *SystemPromptManagerFilterer) FilterNewToken(opts *bind.FilterOpts, tokenId []*big.Int, minter []common.Address) (*SystemPromptManagerNewTokenIterator, error) { var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } var minterRule []interface{} for _, minterItem := range minter { minterRule = append(minterRule, minterItem) } logs, sub, err := _SystemPromptManager.contract.FilterLogs(opts, "NewToken", tokenIdRule, minterRule) if err != nil { return nil, err } return &SystemPromptManagerNewTokenIterator{contract: _SystemPromptManager.contract, event: "NewToken", logs: logs, sub: sub}, nil } // WatchNewToken is a free log subscription operation binding the contract event 0x61beab98a81083e3c0239c33e149bef1316ca78f15b9f29125039f5521a06d06. // // Solidity: event NewToken(uint256 indexed tokenId, string uri, bytes sysPrompt, uint256 fee, address indexed minter) func (_SystemPromptManager *SystemPromptManagerFilterer) WatchNewToken(opts *bind.WatchOpts, sink chan<- *SystemPromptManagerNewToken, tokenId []*big.Int, minter []common.Address) (event.Subscription, error) { var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } var minterRule []interface{} for _, minterItem := range minter { minterRule = append(minterRule, minterItem) } logs, sub, err := _SystemPromptManager.contract.WatchLogs(opts, "NewToken", tokenIdRule, minterRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(SystemPromptManagerNewToken) if err := _SystemPromptManager.contract.UnpackLog(event, "NewToken", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseNewToken is a log parse operation binding the contract event 0x61beab98a81083e3c0239c33e149bef1316ca78f15b9f29125039f5521a06d06. // // Solidity: event NewToken(uint256 indexed tokenId, string uri, bytes sysPrompt, uint256 fee, address indexed minter) func (_SystemPromptManager *SystemPromptManagerFilterer) ParseNewToken(log types.Log) (*SystemPromptManagerNewToken, error) { event := new(SystemPromptManagerNewToken) if err := _SystemPromptManager.contract.UnpackLog(event, "NewToken", log); err != nil { return nil, err } event.Raw = log return event, nil } // SystemPromptManagerOwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the SystemPromptManager contract. type SystemPromptManagerOwnershipTransferredIterator struct { Event *SystemPromptManagerOwnershipTransferred // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *SystemPromptManagerOwnershipTransferredIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(SystemPromptManagerOwnershipTransferred) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(SystemPromptManagerOwnershipTransferred) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *SystemPromptManagerOwnershipTransferredIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *SystemPromptManagerOwnershipTransferredIterator) Close() error { it.sub.Unsubscribe() return nil } // SystemPromptManagerOwnershipTransferred represents a OwnershipTransferred event raised by the SystemPromptManager contract. type SystemPromptManagerOwnershipTransferred struct { PreviousOwner common.Address NewOwner common.Address Raw types.Log // Blockchain specific contextual infos } // FilterOwnershipTransferred is a free log retrieval operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. // // Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) func (_SystemPromptManager *SystemPromptManagerFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*SystemPromptManagerOwnershipTransferredIterator, error) { var previousOwnerRule []interface{} for _, previousOwnerItem := range previousOwner { previousOwnerRule = append(previousOwnerRule, previousOwnerItem) } var newOwnerRule []interface{} for _, newOwnerItem := range newOwner { newOwnerRule = append(newOwnerRule, newOwnerItem) } logs, sub, err := _SystemPromptManager.contract.FilterLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) if err != nil { return nil, err } return &SystemPromptManagerOwnershipTransferredIterator{contract: _SystemPromptManager.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil } // WatchOwnershipTransferred is a free log subscription operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. // // Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) func (_SystemPromptManager *SystemPromptManagerFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *SystemPromptManagerOwnershipTransferred, previousOwner []common.Address, newOwner []common.Address) (event.Subscription, error) { var previousOwnerRule []interface{} for _, previousOwnerItem := range previousOwner { previousOwnerRule = append(previousOwnerRule, previousOwnerItem) } var newOwnerRule []interface{} for _, newOwnerItem := range newOwner { newOwnerRule = append(newOwnerRule, newOwnerItem) } logs, sub, err := _SystemPromptManager.contract.WatchLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(SystemPromptManagerOwnershipTransferred) if err := _SystemPromptManager.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseOwnershipTransferred is a log parse operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. // // Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) func (_SystemPromptManager *SystemPromptManagerFilterer) ParseOwnershipTransferred(log types.Log) (*SystemPromptManagerOwnershipTransferred, error) { event := new(SystemPromptManagerOwnershipTransferred) if err := _SystemPromptManager.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { return nil, err } event.Raw = log return event, nil } // SystemPromptManagerPausedIterator is returned from FilterPaused and is used to iterate over the raw logs and unpacked data for Paused events raised by the SystemPromptManager contract. type SystemPromptManagerPausedIterator struct { Event *SystemPromptManagerPaused // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *SystemPromptManagerPausedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(SystemPromptManagerPaused) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(SystemPromptManagerPaused) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *SystemPromptManagerPausedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *SystemPromptManagerPausedIterator) Close() error { it.sub.Unsubscribe() return nil } // SystemPromptManagerPaused represents a Paused event raised by the SystemPromptManager contract. type SystemPromptManagerPaused struct { Account common.Address Raw types.Log // Blockchain specific contextual infos } // FilterPaused is a free log retrieval operation binding the contract event 0x62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258. // // Solidity: event Paused(address account) func (_SystemPromptManager *SystemPromptManagerFilterer) FilterPaused(opts *bind.FilterOpts) (*SystemPromptManagerPausedIterator, error) { logs, sub, err := _SystemPromptManager.contract.FilterLogs(opts, "Paused") if err != nil { return nil, err } return &SystemPromptManagerPausedIterator{contract: _SystemPromptManager.contract, event: "Paused", logs: logs, sub: sub}, nil } // WatchPaused is a free log subscription operation binding the contract event 0x62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258. // // Solidity: event Paused(address account) func (_SystemPromptManager *SystemPromptManagerFilterer) WatchPaused(opts *bind.WatchOpts, sink chan<- *SystemPromptManagerPaused) (event.Subscription, error) { logs, sub, err := _SystemPromptManager.contract.WatchLogs(opts, "Paused") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(SystemPromptManagerPaused) if err := _SystemPromptManager.contract.UnpackLog(event, "Paused", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParsePaused is a log parse operation binding the contract event 0x62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258. // // Solidity: event Paused(address account) func (_SystemPromptManager *SystemPromptManagerFilterer) ParsePaused(log types.Log) (*SystemPromptManagerPaused, error) { event := new(SystemPromptManagerPaused) if err := _SystemPromptManager.contract.UnpackLog(event, "Paused", log); err != nil { return nil, err } event.Raw = log return event, nil } // SystemPromptManagerRoyaltyPortionUpdateIterator is returned from FilterRoyaltyPortionUpdate and is used to iterate over the raw logs and unpacked data for RoyaltyPortionUpdate events raised by the SystemPromptManager contract. type SystemPromptManagerRoyaltyPortionUpdateIterator struct { Event *SystemPromptManagerRoyaltyPortionUpdate // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *SystemPromptManagerRoyaltyPortionUpdateIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(SystemPromptManagerRoyaltyPortionUpdate) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(SystemPromptManagerRoyaltyPortionUpdate) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *SystemPromptManagerRoyaltyPortionUpdateIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *SystemPromptManagerRoyaltyPortionUpdateIterator) Close() error { it.sub.Unsubscribe() return nil } // SystemPromptManagerRoyaltyPortionUpdate represents a RoyaltyPortionUpdate event raised by the SystemPromptManager contract. type SystemPromptManagerRoyaltyPortionUpdate struct { NewValue uint16 Raw types.Log // Blockchain specific contextual infos } // FilterRoyaltyPortionUpdate is a free log retrieval operation binding the contract event 0xb1f3037624bd2d961f6d56696cc10ccc3a676db381e671b1bc58f0ab1f686dd5. // // Solidity: event RoyaltyPortionUpdate(uint16 newValue) func (_SystemPromptManager *SystemPromptManagerFilterer) FilterRoyaltyPortionUpdate(opts *bind.FilterOpts) (*SystemPromptManagerRoyaltyPortionUpdateIterator, error) { logs, sub, err := _SystemPromptManager.contract.FilterLogs(opts, "RoyaltyPortionUpdate") if err != nil { return nil, err } return &SystemPromptManagerRoyaltyPortionUpdateIterator{contract: _SystemPromptManager.contract, event: "RoyaltyPortionUpdate", logs: logs, sub: sub}, nil } // WatchRoyaltyPortionUpdate is a free log subscription operation binding the contract event 0xb1f3037624bd2d961f6d56696cc10ccc3a676db381e671b1bc58f0ab1f686dd5. // // Solidity: event RoyaltyPortionUpdate(uint16 newValue) func (_SystemPromptManager *SystemPromptManagerFilterer) WatchRoyaltyPortionUpdate(opts *bind.WatchOpts, sink chan<- *SystemPromptManagerRoyaltyPortionUpdate) (event.Subscription, error) { logs, sub, err := _SystemPromptManager.contract.WatchLogs(opts, "RoyaltyPortionUpdate") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(SystemPromptManagerRoyaltyPortionUpdate) if err := _SystemPromptManager.contract.UnpackLog(event, "RoyaltyPortionUpdate", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseRoyaltyPortionUpdate is a log parse operation binding the contract event 0xb1f3037624bd2d961f6d56696cc10ccc3a676db381e671b1bc58f0ab1f686dd5. // // Solidity: event RoyaltyPortionUpdate(uint16 newValue) func (_SystemPromptManager *SystemPromptManagerFilterer) ParseRoyaltyPortionUpdate(log types.Log) (*SystemPromptManagerRoyaltyPortionUpdate, error) { event := new(SystemPromptManagerRoyaltyPortionUpdate) if err := _SystemPromptManager.contract.UnpackLog(event, "RoyaltyPortionUpdate", log); err != nil { return nil, err } event.Raw = log return event, nil } // SystemPromptManagerRoyaltyReceiverUpdateIterator is returned from FilterRoyaltyReceiverUpdate and is used to iterate over the raw logs and unpacked data for RoyaltyReceiverUpdate events raised by the SystemPromptManager contract. type SystemPromptManagerRoyaltyReceiverUpdateIterator struct { Event *SystemPromptManagerRoyaltyReceiverUpdate // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *SystemPromptManagerRoyaltyReceiverUpdateIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(SystemPromptManagerRoyaltyReceiverUpdate) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(SystemPromptManagerRoyaltyReceiverUpdate) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *SystemPromptManagerRoyaltyReceiverUpdateIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *SystemPromptManagerRoyaltyReceiverUpdateIterator) Close() error { it.sub.Unsubscribe() return nil } // SystemPromptManagerRoyaltyReceiverUpdate represents a RoyaltyReceiverUpdate event raised by the SystemPromptManager contract. type SystemPromptManagerRoyaltyReceiverUpdate struct { NewAddress common.Address Raw types.Log // Blockchain specific contextual infos } // FilterRoyaltyReceiverUpdate is a free log retrieval operation binding the contract event 0xec6b72b10aed766af02b35918b55be261c89aaaa4c8add826471ce35ec7f97b3. // // Solidity: event RoyaltyReceiverUpdate(address newAddress) func (_SystemPromptManager *SystemPromptManagerFilterer) FilterRoyaltyReceiverUpdate(opts *bind.FilterOpts) (*SystemPromptManagerRoyaltyReceiverUpdateIterator, error) { logs, sub, err := _SystemPromptManager.contract.FilterLogs(opts, "RoyaltyReceiverUpdate") if err != nil { return nil, err } return &SystemPromptManagerRoyaltyReceiverUpdateIterator{contract: _SystemPromptManager.contract, event: "RoyaltyReceiverUpdate", logs: logs, sub: sub}, nil } // WatchRoyaltyReceiverUpdate is a free log subscription operation binding the contract event 0xec6b72b10aed766af02b35918b55be261c89aaaa4c8add826471ce35ec7f97b3. // // Solidity: event RoyaltyReceiverUpdate(address newAddress) func (_SystemPromptManager *SystemPromptManagerFilterer) WatchRoyaltyReceiverUpdate(opts *bind.WatchOpts, sink chan<- *SystemPromptManagerRoyaltyReceiverUpdate) (event.Subscription, error) { logs, sub, err := _SystemPromptManager.contract.WatchLogs(opts, "RoyaltyReceiverUpdate") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(SystemPromptManagerRoyaltyReceiverUpdate) if err := _SystemPromptManager.contract.UnpackLog(event, "RoyaltyReceiverUpdate", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseRoyaltyReceiverUpdate is a log parse operation binding the contract event 0xec6b72b10aed766af02b35918b55be261c89aaaa4c8add826471ce35ec7f97b3. // // Solidity: event RoyaltyReceiverUpdate(address newAddress) func (_SystemPromptManager *SystemPromptManagerFilterer) ParseRoyaltyReceiverUpdate(log types.Log) (*SystemPromptManagerRoyaltyReceiverUpdate, error) { event := new(SystemPromptManagerRoyaltyReceiverUpdate) if err := _SystemPromptManager.contract.UnpackLog(event, "RoyaltyReceiverUpdate", log); err != nil { return nil, err } event.Raw = log return event, nil } // SystemPromptManagerTopUpPoolBalanceIterator is returned from FilterTopUpPoolBalance and is used to iterate over the raw logs and unpacked data for TopUpPoolBalance events raised by the SystemPromptManager contract. type SystemPromptManagerTopUpPoolBalanceIterator struct { Event *SystemPromptManagerTopUpPoolBalance // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *SystemPromptManagerTopUpPoolBalanceIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(SystemPromptManagerTopUpPoolBalance) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(SystemPromptManagerTopUpPoolBalance) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *SystemPromptManagerTopUpPoolBalanceIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *SystemPromptManagerTopUpPoolBalanceIterator) Close() error { it.sub.Unsubscribe() return nil } // SystemPromptManagerTopUpPoolBalance represents a TopUpPoolBalance event raised by the SystemPromptManager contract. type SystemPromptManagerTopUpPoolBalance struct { AgentId *big.Int Caller common.Address Amount *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterTopUpPoolBalance is a free log retrieval operation binding the contract event 0xf7ee57effd30f2ab842c1d65fdcfa7d20c2fb2f967e9ac30acafecabf013ea4c. // // Solidity: event TopUpPoolBalance(uint256 agentId, address caller, uint256 amount) func (_SystemPromptManager *SystemPromptManagerFilterer) FilterTopUpPoolBalance(opts *bind.FilterOpts) (*SystemPromptManagerTopUpPoolBalanceIterator, error) { logs, sub, err := _SystemPromptManager.contract.FilterLogs(opts, "TopUpPoolBalance") if err != nil { return nil, err } return &SystemPromptManagerTopUpPoolBalanceIterator{contract: _SystemPromptManager.contract, event: "TopUpPoolBalance", logs: logs, sub: sub}, nil } // WatchTopUpPoolBalance is a free log subscription operation binding the contract event 0xf7ee57effd30f2ab842c1d65fdcfa7d20c2fb2f967e9ac30acafecabf013ea4c. // // Solidity: event TopUpPoolBalance(uint256 agentId, address caller, uint256 amount) func (_SystemPromptManager *SystemPromptManagerFilterer) WatchTopUpPoolBalance(opts *bind.WatchOpts, sink chan<- *SystemPromptManagerTopUpPoolBalance) (event.Subscription, error) { logs, sub, err := _SystemPromptManager.contract.WatchLogs(opts, "TopUpPoolBalance") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(SystemPromptManagerTopUpPoolBalance) if err := _SystemPromptManager.contract.UnpackLog(event, "TopUpPoolBalance", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseTopUpPoolBalance is a log parse operation binding the contract event 0xf7ee57effd30f2ab842c1d65fdcfa7d20c2fb2f967e9ac30acafecabf013ea4c. // // Solidity: event TopUpPoolBalance(uint256 agentId, address caller, uint256 amount) func (_SystemPromptManager *SystemPromptManagerFilterer) ParseTopUpPoolBalance(log types.Log) (*SystemPromptManagerTopUpPoolBalance, error) { event := new(SystemPromptManagerTopUpPoolBalance) if err := _SystemPromptManager.contract.UnpackLog(event, "TopUpPoolBalance", log); err != nil { return nil, err } event.Raw = log return event, nil } // SystemPromptManagerTransferIterator is returned from FilterTransfer and is used to iterate over the raw logs and unpacked data for Transfer events raised by the SystemPromptManager contract. type SystemPromptManagerTransferIterator struct { Event *SystemPromptManagerTransfer // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *SystemPromptManagerTransferIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(SystemPromptManagerTransfer) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(SystemPromptManagerTransfer) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *SystemPromptManagerTransferIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *SystemPromptManagerTransferIterator) Close() error { it.sub.Unsubscribe() return nil } // SystemPromptManagerTransfer represents a Transfer event raised by the SystemPromptManager contract. type SystemPromptManagerTransfer struct { From common.Address To common.Address TokenId *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterTransfer is a free log retrieval operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. // // Solidity: event Transfer(address indexed from, address indexed to, uint256 indexed tokenId) func (_SystemPromptManager *SystemPromptManagerFilterer) FilterTransfer(opts *bind.FilterOpts, from []common.Address, to []common.Address, tokenId []*big.Int) (*SystemPromptManagerTransferIterator, error) { var fromRule []interface{} for _, fromItem := range from { fromRule = append(fromRule, fromItem) } var toRule []interface{} for _, toItem := range to { toRule = append(toRule, toItem) } var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _SystemPromptManager.contract.FilterLogs(opts, "Transfer", fromRule, toRule, tokenIdRule) if err != nil { return nil, err } return &SystemPromptManagerTransferIterator{contract: _SystemPromptManager.contract, event: "Transfer", logs: logs, sub: sub}, nil } // WatchTransfer is a free log subscription operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. // // Solidity: event Transfer(address indexed from, address indexed to, uint256 indexed tokenId) func (_SystemPromptManager *SystemPromptManagerFilterer) WatchTransfer(opts *bind.WatchOpts, sink chan<- *SystemPromptManagerTransfer, from []common.Address, to []common.Address, tokenId []*big.Int) (event.Subscription, error) { var fromRule []interface{} for _, fromItem := range from { fromRule = append(fromRule, fromItem) } var toRule []interface{} for _, toItem := range to { toRule = append(toRule, toItem) } var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _SystemPromptManager.contract.WatchLogs(opts, "Transfer", fromRule, toRule, tokenIdRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(SystemPromptManagerTransfer) if err := _SystemPromptManager.contract.UnpackLog(event, "Transfer", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseTransfer is a log parse operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. // // Solidity: event Transfer(address indexed from, address indexed to, uint256 indexed tokenId) func (_SystemPromptManager *SystemPromptManagerFilterer) ParseTransfer(log types.Log) (*SystemPromptManagerTransfer, error) { event := new(SystemPromptManagerTransfer) if err := _SystemPromptManager.contract.UnpackLog(event, "Transfer", log); err != nil { return nil, err } event.Raw = log return event, nil } // SystemPromptManagerUnpausedIterator is returned from FilterUnpaused and is used to iterate over the raw logs and unpacked data for Unpaused events raised by the SystemPromptManager contract. type SystemPromptManagerUnpausedIterator struct { Event *SystemPromptManagerUnpaused // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *SystemPromptManagerUnpausedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(SystemPromptManagerUnpaused) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(SystemPromptManagerUnpaused) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *SystemPromptManagerUnpausedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *SystemPromptManagerUnpausedIterator) Close() error { it.sub.Unsubscribe() return nil } // SystemPromptManagerUnpaused represents a Unpaused event raised by the SystemPromptManager contract. type SystemPromptManagerUnpaused struct { Account common.Address Raw types.Log // Blockchain specific contextual infos } // FilterUnpaused is a free log retrieval operation binding the contract event 0x5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa. // // Solidity: event Unpaused(address account) func (_SystemPromptManager *SystemPromptManagerFilterer) FilterUnpaused(opts *bind.FilterOpts) (*SystemPromptManagerUnpausedIterator, error) { logs, sub, err := _SystemPromptManager.contract.FilterLogs(opts, "Unpaused") if err != nil { return nil, err } return &SystemPromptManagerUnpausedIterator{contract: _SystemPromptManager.contract, event: "Unpaused", logs: logs, sub: sub}, nil } // WatchUnpaused is a free log subscription operation binding the contract event 0x5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa. // // Solidity: event Unpaused(address account) func (_SystemPromptManager *SystemPromptManagerFilterer) WatchUnpaused(opts *bind.WatchOpts, sink chan<- *SystemPromptManagerUnpaused) (event.Subscription, error) { logs, sub, err := _SystemPromptManager.contract.WatchLogs(opts, "Unpaused") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(SystemPromptManagerUnpaused) if err := _SystemPromptManager.contract.UnpackLog(event, "Unpaused", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseUnpaused is a log parse operation binding the contract event 0x5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa. // // Solidity: event Unpaused(address account) func (_SystemPromptManager *SystemPromptManagerFilterer) ParseUnpaused(log types.Log) (*SystemPromptManagerUnpaused, error) { event := new(SystemPromptManagerUnpaused) if err := _SystemPromptManager.contract.UnpackLog(event, "Unpaused", log); err != nil { return nil, err } event.Raw = log return event, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/binds/iv3swaprouter/IV3SwapRouter.go ================================================ // Code generated - DO NOT EDIT. // This file is a generated binding and any manual changes will be lost. package iv3swaprouter import ( "errors" "math/big" "strings" ethereum "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/event" ) // Reference imports to suppress errors if they are not otherwise used. var ( _ = errors.New _ = big.NewInt _ = strings.NewReader _ = ethereum.NotFound _ = bind.Bind _ = common.Big1 _ = types.BloomLookup _ = event.NewSubscription _ = abi.ConvertType ) // IV3SwapRouterExactInputSingleParams is an auto generated low-level Go binding around an user-defined struct. type IV3SwapRouterExactInputSingleParams struct { TokenIn common.Address TokenOut common.Address Fee *big.Int Recipient common.Address AmountIn *big.Int AmountOutMinimum *big.Int SqrtPriceLimitX96 *big.Int } // IV3SwapRouterMetaData contains all meta data concerning the IV3SwapRouter contract. var IV3SwapRouterMetaData = &bind.MetaData{ ABI: "[{\"inputs\":[],\"name\":\"WETH9\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"tokenIn\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenOut\",\"type\":\"address\"},{\"internalType\":\"uint24\",\"name\":\"fee\",\"type\":\"uint24\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amountIn\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountOutMinimum\",\"type\":\"uint256\"},{\"internalType\":\"uint160\",\"name\":\"sqrtPriceLimitX96\",\"type\":\"uint160\"}],\"internalType\":\"structIV3SwapRouter.ExactInputSingleParams\",\"name\":\"params\",\"type\":\"tuple\"}],\"name\":\"exactInputSingle\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amountOut\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes[]\",\"name\":\"data\",\"type\":\"bytes[]\"}],\"name\":\"multicall\",\"outputs\":[{\"internalType\":\"bytes[]\",\"name\":\"results\",\"type\":\"bytes[]\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"refundETH\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amountMinimum\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"}],\"name\":\"sweepToken\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountMinimum\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"}],\"name\":\"unwrapWETH9\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"}]", } // IV3SwapRouterABI is the input ABI used to generate the binding from. // Deprecated: Use IV3SwapRouterMetaData.ABI instead. var IV3SwapRouterABI = IV3SwapRouterMetaData.ABI // IV3SwapRouter is an auto generated Go binding around an Ethereum contract. type IV3SwapRouter struct { IV3SwapRouterCaller // Read-only binding to the contract IV3SwapRouterTransactor // Write-only binding to the contract IV3SwapRouterFilterer // Log filterer for contract events } // IV3SwapRouterCaller is an auto generated read-only Go binding around an Ethereum contract. type IV3SwapRouterCaller struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // IV3SwapRouterTransactor is an auto generated write-only Go binding around an Ethereum contract. type IV3SwapRouterTransactor struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // IV3SwapRouterFilterer is an auto generated log filtering Go binding around an Ethereum contract events. type IV3SwapRouterFilterer struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // IV3SwapRouterSession is an auto generated Go binding around an Ethereum contract, // with pre-set call and transact options. type IV3SwapRouterSession struct { Contract *IV3SwapRouter // Generic contract binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // IV3SwapRouterCallerSession is an auto generated read-only Go binding around an Ethereum contract, // with pre-set call options. type IV3SwapRouterCallerSession struct { Contract *IV3SwapRouterCaller // Generic contract caller binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session } // IV3SwapRouterTransactorSession is an auto generated write-only Go binding around an Ethereum contract, // with pre-set transact options. type IV3SwapRouterTransactorSession struct { Contract *IV3SwapRouterTransactor // Generic contract transactor binding to set the session for TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // IV3SwapRouterRaw is an auto generated low-level Go binding around an Ethereum contract. type IV3SwapRouterRaw struct { Contract *IV3SwapRouter // Generic contract binding to access the raw methods on } // IV3SwapRouterCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. type IV3SwapRouterCallerRaw struct { Contract *IV3SwapRouterCaller // Generic read-only contract binding to access the raw methods on } // IV3SwapRouterTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. type IV3SwapRouterTransactorRaw struct { Contract *IV3SwapRouterTransactor // Generic write-only contract binding to access the raw methods on } // NewIV3SwapRouter creates a new instance of IV3SwapRouter, bound to a specific deployed contract. func NewIV3SwapRouter(address common.Address, backend bind.ContractBackend) (*IV3SwapRouter, error) { contract, err := bindIV3SwapRouter(address, backend, backend, backend) if err != nil { return nil, err } return &IV3SwapRouter{IV3SwapRouterCaller: IV3SwapRouterCaller{contract: contract}, IV3SwapRouterTransactor: IV3SwapRouterTransactor{contract: contract}, IV3SwapRouterFilterer: IV3SwapRouterFilterer{contract: contract}}, nil } // NewIV3SwapRouterCaller creates a new read-only instance of IV3SwapRouter, bound to a specific deployed contract. func NewIV3SwapRouterCaller(address common.Address, caller bind.ContractCaller) (*IV3SwapRouterCaller, error) { contract, err := bindIV3SwapRouter(address, caller, nil, nil) if err != nil { return nil, err } return &IV3SwapRouterCaller{contract: contract}, nil } // NewIV3SwapRouterTransactor creates a new write-only instance of IV3SwapRouter, bound to a specific deployed contract. func NewIV3SwapRouterTransactor(address common.Address, transactor bind.ContractTransactor) (*IV3SwapRouterTransactor, error) { contract, err := bindIV3SwapRouter(address, nil, transactor, nil) if err != nil { return nil, err } return &IV3SwapRouterTransactor{contract: contract}, nil } // NewIV3SwapRouterFilterer creates a new log filterer instance of IV3SwapRouter, bound to a specific deployed contract. func NewIV3SwapRouterFilterer(address common.Address, filterer bind.ContractFilterer) (*IV3SwapRouterFilterer, error) { contract, err := bindIV3SwapRouter(address, nil, nil, filterer) if err != nil { return nil, err } return &IV3SwapRouterFilterer{contract: contract}, nil } // bindIV3SwapRouter binds a generic wrapper to an already deployed contract. func bindIV3SwapRouter(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { parsed, err := IV3SwapRouterMetaData.GetAbi() if err != nil { return nil, err } return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_IV3SwapRouter *IV3SwapRouterRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _IV3SwapRouter.Contract.IV3SwapRouterCaller.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_IV3SwapRouter *IV3SwapRouterRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _IV3SwapRouter.Contract.IV3SwapRouterTransactor.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_IV3SwapRouter *IV3SwapRouterRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _IV3SwapRouter.Contract.IV3SwapRouterTransactor.contract.Transact(opts, method, params...) } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_IV3SwapRouter *IV3SwapRouterCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _IV3SwapRouter.Contract.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_IV3SwapRouter *IV3SwapRouterTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _IV3SwapRouter.Contract.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_IV3SwapRouter *IV3SwapRouterTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _IV3SwapRouter.Contract.contract.Transact(opts, method, params...) } // WETH9 is a free data retrieval call binding the contract method 0x4aa4a4fc. // // Solidity: function WETH9() view returns(address) func (_IV3SwapRouter *IV3SwapRouterCaller) WETH9(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _IV3SwapRouter.contract.Call(opts, &out, "WETH9") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // WETH9 is a free data retrieval call binding the contract method 0x4aa4a4fc. // // Solidity: function WETH9() view returns(address) func (_IV3SwapRouter *IV3SwapRouterSession) WETH9() (common.Address, error) { return _IV3SwapRouter.Contract.WETH9(&_IV3SwapRouter.CallOpts) } // WETH9 is a free data retrieval call binding the contract method 0x4aa4a4fc. // // Solidity: function WETH9() view returns(address) func (_IV3SwapRouter *IV3SwapRouterCallerSession) WETH9() (common.Address, error) { return _IV3SwapRouter.Contract.WETH9(&_IV3SwapRouter.CallOpts) } // ExactInputSingle is a paid mutator transaction binding the contract method 0x04e45aaf. // // Solidity: function exactInputSingle((address,address,uint24,address,uint256,uint256,uint160) params) payable returns(uint256 amountOut) func (_IV3SwapRouter *IV3SwapRouterTransactor) ExactInputSingle(opts *bind.TransactOpts, params IV3SwapRouterExactInputSingleParams) (*types.Transaction, error) { return _IV3SwapRouter.contract.Transact(opts, "exactInputSingle", params) } // ExactInputSingle is a paid mutator transaction binding the contract method 0x04e45aaf. // // Solidity: function exactInputSingle((address,address,uint24,address,uint256,uint256,uint160) params) payable returns(uint256 amountOut) func (_IV3SwapRouter *IV3SwapRouterSession) ExactInputSingle(params IV3SwapRouterExactInputSingleParams) (*types.Transaction, error) { return _IV3SwapRouter.Contract.ExactInputSingle(&_IV3SwapRouter.TransactOpts, params) } // ExactInputSingle is a paid mutator transaction binding the contract method 0x04e45aaf. // // Solidity: function exactInputSingle((address,address,uint24,address,uint256,uint256,uint160) params) payable returns(uint256 amountOut) func (_IV3SwapRouter *IV3SwapRouterTransactorSession) ExactInputSingle(params IV3SwapRouterExactInputSingleParams) (*types.Transaction, error) { return _IV3SwapRouter.Contract.ExactInputSingle(&_IV3SwapRouter.TransactOpts, params) } // Multicall is a paid mutator transaction binding the contract method 0xac9650d8. // // Solidity: function multicall(bytes[] data) payable returns(bytes[] results) func (_IV3SwapRouter *IV3SwapRouterTransactor) Multicall(opts *bind.TransactOpts, data [][]byte) (*types.Transaction, error) { return _IV3SwapRouter.contract.Transact(opts, "multicall", data) } // Multicall is a paid mutator transaction binding the contract method 0xac9650d8. // // Solidity: function multicall(bytes[] data) payable returns(bytes[] results) func (_IV3SwapRouter *IV3SwapRouterSession) Multicall(data [][]byte) (*types.Transaction, error) { return _IV3SwapRouter.Contract.Multicall(&_IV3SwapRouter.TransactOpts, data) } // Multicall is a paid mutator transaction binding the contract method 0xac9650d8. // // Solidity: function multicall(bytes[] data) payable returns(bytes[] results) func (_IV3SwapRouter *IV3SwapRouterTransactorSession) Multicall(data [][]byte) (*types.Transaction, error) { return _IV3SwapRouter.Contract.Multicall(&_IV3SwapRouter.TransactOpts, data) } // RefundETH is a paid mutator transaction binding the contract method 0x12210e8a. // // Solidity: function refundETH() payable returns() func (_IV3SwapRouter *IV3SwapRouterTransactor) RefundETH(opts *bind.TransactOpts) (*types.Transaction, error) { return _IV3SwapRouter.contract.Transact(opts, "refundETH") } // RefundETH is a paid mutator transaction binding the contract method 0x12210e8a. // // Solidity: function refundETH() payable returns() func (_IV3SwapRouter *IV3SwapRouterSession) RefundETH() (*types.Transaction, error) { return _IV3SwapRouter.Contract.RefundETH(&_IV3SwapRouter.TransactOpts) } // RefundETH is a paid mutator transaction binding the contract method 0x12210e8a. // // Solidity: function refundETH() payable returns() func (_IV3SwapRouter *IV3SwapRouterTransactorSession) RefundETH() (*types.Transaction, error) { return _IV3SwapRouter.Contract.RefundETH(&_IV3SwapRouter.TransactOpts) } // SweepToken is a paid mutator transaction binding the contract method 0xdf2ab5bb. // // Solidity: function sweepToken(address token, uint256 amountMinimum, address recipient) payable returns() func (_IV3SwapRouter *IV3SwapRouterTransactor) SweepToken(opts *bind.TransactOpts, token common.Address, amountMinimum *big.Int, recipient common.Address) (*types.Transaction, error) { return _IV3SwapRouter.contract.Transact(opts, "sweepToken", token, amountMinimum, recipient) } // SweepToken is a paid mutator transaction binding the contract method 0xdf2ab5bb. // // Solidity: function sweepToken(address token, uint256 amountMinimum, address recipient) payable returns() func (_IV3SwapRouter *IV3SwapRouterSession) SweepToken(token common.Address, amountMinimum *big.Int, recipient common.Address) (*types.Transaction, error) { return _IV3SwapRouter.Contract.SweepToken(&_IV3SwapRouter.TransactOpts, token, amountMinimum, recipient) } // SweepToken is a paid mutator transaction binding the contract method 0xdf2ab5bb. // // Solidity: function sweepToken(address token, uint256 amountMinimum, address recipient) payable returns() func (_IV3SwapRouter *IV3SwapRouterTransactorSession) SweepToken(token common.Address, amountMinimum *big.Int, recipient common.Address) (*types.Transaction, error) { return _IV3SwapRouter.Contract.SweepToken(&_IV3SwapRouter.TransactOpts, token, amountMinimum, recipient) } // UnwrapWETH9 is a paid mutator transaction binding the contract method 0x49404b7c. // // Solidity: function unwrapWETH9(uint256 amountMinimum, address recipient) payable returns() func (_IV3SwapRouter *IV3SwapRouterTransactor) UnwrapWETH9(opts *bind.TransactOpts, amountMinimum *big.Int, recipient common.Address) (*types.Transaction, error) { return _IV3SwapRouter.contract.Transact(opts, "unwrapWETH9", amountMinimum, recipient) } // UnwrapWETH9 is a paid mutator transaction binding the contract method 0x49404b7c. // // Solidity: function unwrapWETH9(uint256 amountMinimum, address recipient) payable returns() func (_IV3SwapRouter *IV3SwapRouterSession) UnwrapWETH9(amountMinimum *big.Int, recipient common.Address) (*types.Transaction, error) { return _IV3SwapRouter.Contract.UnwrapWETH9(&_IV3SwapRouter.TransactOpts, amountMinimum, recipient) } // UnwrapWETH9 is a paid mutator transaction binding the contract method 0x49404b7c. // // Solidity: function unwrapWETH9(uint256 amountMinimum, address recipient) payable returns() func (_IV3SwapRouter *IV3SwapRouterTransactorSession) UnwrapWETH9(amountMinimum *big.Int, recipient common.Address) (*types.Transaction, error) { return _IV3SwapRouter.Contract.UnwrapWETH9(&_IV3SwapRouter.TransactOpts, amountMinimum, recipient) } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/binds/iworkerhub/workerhub.go ================================================ // Code generated - DO NOT EDIT. // This file is a generated binding and any manual changes will be lost. package iworkerhub import ( "errors" "math/big" "strings" ethereum "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/event" ) // Reference imports to suppress errors if they are not otherwise used. var ( _ = errors.New _ = big.NewInt _ = strings.NewReader _ = ethereum.NotFound _ = bind.Bind _ = common.Big1 _ = types.BloomLookup _ = event.NewSubscription _ = abi.ConvertType ) // IWorkerHubAssignment is an auto generated low-level Go binding around an user-defined struct. type IWorkerHubAssignment struct { InferenceId *big.Int Commitment [32]byte Digest [32]byte RevealNonce *big.Int Worker common.Address Role uint8 Vote uint8 Output []byte } // IWorkerHubAssignmentInfo is an auto generated low-level Go binding around an user-defined struct. type IWorkerHubAssignmentInfo struct { AssignmentId *big.Int InferenceId *big.Int Value *big.Int Input []byte ModelAddress common.Address Creator common.Address SubmitTimeout *big.Int CommitTimeout *big.Int RevealTimeout *big.Int } // IWorkerHubDAOTokenPercentage is an auto generated low-level Go binding around an user-defined struct. type IWorkerHubDAOTokenPercentage struct { MinerPercentage uint16 UserPercentage uint16 ReferrerPercentage uint16 RefereePercentage uint16 L2OwnerPercentage uint16 } // IWorkerHubDAOTokenReceiverInfor is an auto generated low-level Go binding around an user-defined struct. type IWorkerHubDAOTokenReceiverInfor struct { Receiver common.Address Amount *big.Int Role uint8 } // IWorkerHubInference is an auto generated low-level Go binding around an user-defined struct. type IWorkerHubInference struct { Assignments []*big.Int Input []byte Value *big.Int FeeL2 *big.Int FeeTreasury *big.Int ModelAddress common.Address SubmitTimeout *big.Int CommitTimeout *big.Int RevealTimeout *big.Int Status uint8 Creator common.Address ProcessedMiner common.Address Referrer common.Address } // IWorkerHubUnstakeRequest is an auto generated low-level Go binding around an user-defined struct. type IWorkerHubUnstakeRequest struct { Stake *big.Int UnlockAt *big.Int } // IWorkerHubWorker is an auto generated low-level Go binding around an user-defined struct. type IWorkerHubWorker struct { Stake *big.Int Commitment *big.Int ModelAddress common.Address LastClaimedEpoch *big.Int ActiveTime *big.Int Tier uint16 } // IWorkerHubWorkerInfo is an auto generated low-level Go binding around an user-defined struct. type IWorkerHubWorkerInfo struct { WorkerAddress common.Address Stake *big.Int Commitment *big.Int ModelAddress common.Address LastClaimedEpoch *big.Int ActiveTime *big.Int Tier uint16 } // IWorkerHubMetaData contains all meta data concerning the IWorkerHub contract. var IWorkerHubMetaData = &bind.MetaData{ ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"value\",\"type\":\"address\"}],\"name\":\"AddressSet_DuplicatedValue\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"value\",\"type\":\"address\"}],\"name\":\"AddressSet_ValueNotFound\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"AlreadyCommitted\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"AlreadyRegistered\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"AlreadyRevealed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"AlreadySubmitted\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"value\",\"type\":\"bytes32\"}],\"name\":\"Bytes32Set_DuplicatedValue\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"CommitTimeout\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FailedTransfer\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FeeTooLow\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InferMustBeSolvingState\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidBlockValue\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidCommitment\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidData\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidInferenceStatus\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidMiner\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidModel\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidNonce\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidReveal\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidRole\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidTier\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"MinerInDeactivationTime\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"MiningSessionEnded\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"MiningSessionNotEnded\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotCommitted\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotEnoughMiners\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotRegistered\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NullStake\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RevealTimeout\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"StakeTooLow\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"StillBeingLocked\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Uint256Set_DuplicatedValue\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Unauthorized\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ValidatingSessionNotEnded\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroValue\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldBlocks\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newBlocks\",\"type\":\"uint256\"}],\"name\":\"BlocksPerEpoch\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldTime\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newTime\",\"type\":\"uint256\"}],\"name\":\"CommitDuration\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"miner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"assigmentId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"commitment\",\"type\":\"bytes32\"}],\"name\":\"CommitmentSubmission\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"inferenceId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"modelAddress\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"enumIWorkerHub.DAOTokenReceiverRole\",\"name\":\"role\",\"type\":\"uint8\"}],\"indexed\":false,\"internalType\":\"structIWorkerHub.DAOTokenReceiverInfor[]\",\"name\":\"receivers\",\"type\":\"tuple[]\"}],\"name\":\"DAOTokenMintedV2\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"uint16\",\"name\":\"minerPercentage\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"userPercentage\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"referrerPercentage\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"refereePercentage\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"l2OwnerPercentage\",\"type\":\"uint16\"}],\"indexed\":false,\"internalType\":\"structIWorkerHub.DAOTokenPercentage\",\"name\":\"oldValue\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint16\",\"name\":\"minerPercentage\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"userPercentage\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"referrerPercentage\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"refereePercentage\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"l2OwnerPercentage\",\"type\":\"uint16\"}],\"indexed\":false,\"internalType\":\"structIWorkerHub.DAOTokenPercentage\",\"name\":\"newValue\",\"type\":\"tuple\"}],\"name\":\"DAOTokenPercentageUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldValue\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newValue\",\"type\":\"uint256\"}],\"name\":\"DAOTokenRewardUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"oldAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAddress\",\"type\":\"address\"}],\"name\":\"DAOTokenUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"oldPercent\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"newPercent\",\"type\":\"uint16\"}],\"name\":\"FinePercentageUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"miner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"modelAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"treasury\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"fine\",\"type\":\"uint256\"}],\"name\":\"FraudulentMinerPenalized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"inferenceId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"enumIWorkerHub.InferenceStatus\",\"name\":\"newStatus\",\"type\":\"uint8\"}],\"name\":\"InferenceStatusUpdate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"oldAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAddress\",\"type\":\"address\"}],\"name\":\"L2OwnerUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldValue\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newValue\",\"type\":\"uint256\"}],\"name\":\"MinFeeToUseUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"miner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"modelAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint40\",\"name\":\"activeTime\",\"type\":\"uint40\"}],\"name\":\"MinerDeactivated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"miner\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"MinerExtraStake\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"miner\",\"type\":\"address\"}],\"name\":\"MinerJoin\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"miner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint16\",\"name\":\"tier\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"MinerRegistration\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"assignmentId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"inferenceId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"miner\",\"type\":\"address\"}],\"name\":\"MinerRoleSeized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"miner\",\"type\":\"address\"}],\"name\":\"MinerUnregistration\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"miner\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"stake\",\"type\":\"uint256\"}],\"name\":\"MinerUnstake\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint40\",\"name\":\"newValue\",\"type\":\"uint40\"}],\"name\":\"MiningTimeLimitUpdate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"model\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"minimumFee\",\"type\":\"uint256\"}],\"name\":\"ModelMinimumFeeUpdate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"model\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint16\",\"name\":\"tier\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"minimumFee\",\"type\":\"uint256\"}],\"name\":\"ModelRegistration\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"model\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"tier\",\"type\":\"uint32\"}],\"name\":\"ModelTierUpdate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"model\",\"type\":\"address\"}],\"name\":\"ModelUnregistration\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"assignmentId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"inferenceId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"miner\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint40\",\"name\":\"expiredAt\",\"type\":\"uint40\"}],\"name\":\"NewAssignment\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"inferenceId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"model\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"creator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"originInferenceId\",\"type\":\"uint256\"}],\"name\":\"NewInference\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"inferenceId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"model\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"creator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"originInferenceId\",\"type\":\"uint256\"}],\"name\":\"NewScoringInference\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"Paused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint40\",\"name\":\"oldDuration\",\"type\":\"uint40\"},{\"indexed\":false,\"internalType\":\"uint40\",\"name\":\"newDuration\",\"type\":\"uint40\"}],\"name\":\"PenaltyDurationUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"miner\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"restake\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"model\",\"type\":\"address\"}],\"name\":\"Restake\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldTime\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newTime\",\"type\":\"uint256\"}],\"name\":\"RevealDuration\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"miner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"assigmentId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint40\",\"name\":\"nonce\",\"type\":\"uint40\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"output\",\"type\":\"bytes\"}],\"name\":\"RevealSubmission\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"worker\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"RewardClaim\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldReward\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newReward\",\"type\":\"uint256\"}],\"name\":\"RewardPerEpoch\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"miner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"assigmentId\",\"type\":\"uint256\"}],\"name\":\"SolutionSubmission\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"assignmentId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"StreamedData\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldTime\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newTime\",\"type\":\"uint256\"}],\"name\":\"SubmitDuration\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"inferenceId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"creator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"TopUpInfer\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"treasury\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"treasuryFee\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"L2OwnerAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"L2OwnerFee\",\"type\":\"uint256\"}],\"name\":\"TransferFee\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"oldAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAddress\",\"type\":\"address\"}],\"name\":\"TreasuryAddressUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"Unpaused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldDelayTime\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newDelayTime\",\"type\":\"uint256\"}],\"name\":\"UnstakeDelayTime\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"assignmentNumber\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"assignments\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"inferenceId\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"commitment\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"digest\",\"type\":\"bytes32\"},{\"internalType\":\"uint40\",\"name\":\"revealNonce\",\"type\":\"uint40\"},{\"internalType\":\"address\",\"name\":\"worker\",\"type\":\"address\"},{\"internalType\":\"enumIWorkerHub.AssignmentRole\",\"name\":\"role\",\"type\":\"uint8\"},{\"internalType\":\"enumIWorkerHub.Vote\",\"name\":\"vote\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"output\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"blocksPerEpoch\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_miner\",\"type\":\"address\"}],\"name\":\"claimReward\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_assignId\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"_commitment\",\"type\":\"bytes32\"}],\"name\":\"commit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"commitDuration\",\"outputs\":[{\"internalType\":\"uint40\",\"name\":\"\",\"type\":\"uint40\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"currentEpoch\",\"outputs\":[{\"internalType\":\"uint40\",\"name\":\"\",\"type\":\"uint40\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"inferId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"daoReceiversInfo\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"enumIWorkerHub.DAOTokenReceiverRole\",\"name\":\"role\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"daoToken\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"daoTokenPercentage\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"minerPercentage\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"userPercentage\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"referrerPercentage\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"refereePercentage\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"l2OwnerPercentage\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"daoTokenReward\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"feeL2Percentage\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"feeRatioMinerValidator\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"feeTreasuryPercentage\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"finePercentage\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_miner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_modelAddress\",\"type\":\"address\"}],\"name\":\"forceChangeModelForMiner\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"startId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"count\",\"type\":\"uint256\"}],\"name\":\"getAllAssignments\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"inferenceId\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"commitment\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"digest\",\"type\":\"bytes32\"},{\"internalType\":\"uint40\",\"name\":\"revealNonce\",\"type\":\"uint40\"},{\"internalType\":\"address\",\"name\":\"worker\",\"type\":\"address\"},{\"internalType\":\"enumIWorkerHub.AssignmentRole\",\"name\":\"role\",\"type\":\"uint8\"},{\"internalType\":\"enumIWorkerHub.Vote\",\"name\":\"vote\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"output\",\"type\":\"bytes\"}],\"internalType\":\"structIWorkerHub.Assignment[]\",\"name\":\"assignmentData\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"startId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"count\",\"type\":\"uint256\"}],\"name\":\"getAllInferences\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256[]\",\"name\":\"assignments\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes\",\"name\":\"input\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"feeL2\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"feeTreasury\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"modelAddress\",\"type\":\"address\"},{\"internalType\":\"uint40\",\"name\":\"submitTimeout\",\"type\":\"uint40\"},{\"internalType\":\"uint40\",\"name\":\"commitTimeout\",\"type\":\"uint40\"},{\"internalType\":\"uint40\",\"name\":\"revealTimeout\",\"type\":\"uint40\"},{\"internalType\":\"enumIWorkerHub.InferenceStatus\",\"name\":\"status\",\"type\":\"uint8\"},{\"internalType\":\"address\",\"name\":\"creator\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"processedMiner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"referrer\",\"type\":\"address\"}],\"internalType\":\"structIWorkerHub.Inference[]\",\"name\":\"inferenceData\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAllMinerUnstakeRequests\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"unstakeAddresses\",\"type\":\"address[]\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"stake\",\"type\":\"uint256\"},{\"internalType\":\"uint40\",\"name\":\"unlockAt\",\"type\":\"uint40\"}],\"internalType\":\"structIWorkerHub.UnstakeRequest[]\",\"name\":\"unstakeRequests\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAllMiners\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"stake\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"commitment\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"modelAddress\",\"type\":\"address\"},{\"internalType\":\"uint40\",\"name\":\"lastClaimedEpoch\",\"type\":\"uint40\"},{\"internalType\":\"uint40\",\"name\":\"activeTime\",\"type\":\"uint40\"},{\"internalType\":\"uint16\",\"name\":\"tier\",\"type\":\"uint16\"}],\"internalType\":\"structIWorkerHub.Worker[]\",\"name\":\"minerData\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_inferId\",\"type\":\"uint256\"}],\"name\":\"getAssignmentByInferenceId\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"inferenceId\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"commitment\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"digest\",\"type\":\"bytes32\"},{\"internalType\":\"uint40\",\"name\":\"revealNonce\",\"type\":\"uint40\"},{\"internalType\":\"address\",\"name\":\"worker\",\"type\":\"address\"},{\"internalType\":\"enumIWorkerHub.AssignmentRole\",\"name\":\"role\",\"type\":\"uint8\"},{\"internalType\":\"enumIWorkerHub.Vote\",\"name\":\"vote\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"output\",\"type\":\"bytes\"}],\"internalType\":\"structIWorkerHub.Assignment[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_minerAddr\",\"type\":\"address\"}],\"name\":\"getAssignmentByMiner\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"assignmentId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"inferenceId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"input\",\"type\":\"bytes\"},{\"internalType\":\"address\",\"name\":\"modelAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"creator\",\"type\":\"address\"},{\"internalType\":\"uint40\",\"name\":\"submitTimeout\",\"type\":\"uint40\"},{\"internalType\":\"uint40\",\"name\":\"commitTimeout\",\"type\":\"uint40\"},{\"internalType\":\"uint40\",\"name\":\"revealTimeout\",\"type\":\"uint40\"}],\"internalType\":\"structIWorkerHub.AssignmentInfo[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_inferenceId\",\"type\":\"uint256\"}],\"name\":\"getInferenceInfo\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256[]\",\"name\":\"assignments\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes\",\"name\":\"input\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"feeL2\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"feeTreasury\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"modelAddress\",\"type\":\"address\"},{\"internalType\":\"uint40\",\"name\":\"submitTimeout\",\"type\":\"uint40\"},{\"internalType\":\"uint40\",\"name\":\"commitTimeout\",\"type\":\"uint40\"},{\"internalType\":\"uint40\",\"name\":\"revealTimeout\",\"type\":\"uint40\"},{\"internalType\":\"enumIWorkerHub.InferenceStatus\",\"name\":\"status\",\"type\":\"uint8\"},{\"internalType\":\"address\",\"name\":\"creator\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"processedMiner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"referrer\",\"type\":\"address\"}],\"internalType\":\"structIWorkerHub.Inference\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_modelAddress\",\"type\":\"address\"}],\"name\":\"getMinFeeToUse\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getMinerAddresses\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_model\",\"type\":\"address\"}],\"name\":\"getMinerAddressesOfModel\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getMiners\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"workerAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"stake\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"commitment\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"modelAddress\",\"type\":\"address\"},{\"internalType\":\"uint40\",\"name\":\"lastClaimedEpoch\",\"type\":\"uint40\"},{\"internalType\":\"uint40\",\"name\":\"activeTime\",\"type\":\"uint40\"},{\"internalType\":\"uint16\",\"name\":\"tier\",\"type\":\"uint16\"}],\"internalType\":\"structIWorkerHub.WorkerInfo[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_inferenceId\",\"type\":\"uint256\"}],\"name\":\"getMintingAssignmentsOfInference\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"assignmentId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"inferenceId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"input\",\"type\":\"bytes\"},{\"internalType\":\"address\",\"name\":\"modelAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"creator\",\"type\":\"address\"},{\"internalType\":\"uint40\",\"name\":\"submitTimeout\",\"type\":\"uint40\"},{\"internalType\":\"uint40\",\"name\":\"commitTimeout\",\"type\":\"uint40\"},{\"internalType\":\"uint40\",\"name\":\"revealTimeout\",\"type\":\"uint40\"}],\"internalType\":\"structIWorkerHub.AssignmentInfo[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getModelAddresses\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getNOMiner\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_assignmentId\",\"type\":\"uint256\"}],\"name\":\"getRoleByAssigmentId\",\"outputs\":[{\"internalType\":\"enumIWorkerHub.AssignmentRole\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"wEAIAmt\",\"type\":\"uint256\"}],\"name\":\"increaseMinerStake\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_input\",\"type\":\"bytes\"},{\"internalType\":\"address\",\"name\":\"_creator\",\"type\":\"address\"}],\"name\":\"infer\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"originInferId\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_input\",\"type\":\"bytes\"},{\"internalType\":\"address\",\"name\":\"_creator\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"callback\",\"type\":\"address\"}],\"name\":\"inferWithCallback\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"inferenceId\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"inferenceNumber\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_l2Owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_treasury\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_daoToken\",\"type\":\"address\"},{\"internalType\":\"uint16\",\"name\":\"_feeL2Percentage\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"_feeTreasuryPercentage\",\"type\":\"uint16\"},{\"internalType\":\"uint256\",\"name\":\"_minerMinimumStake\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"_minerRequirement\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"_blocksPerEpoch\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_rewardPerEpoch\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_duration\",\"type\":\"uint256\"},{\"internalType\":\"uint16\",\"name\":\"_finePercentage\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"_feeRatioMinerValidor\",\"type\":\"uint16\"},{\"internalType\":\"uint256\",\"name\":\"_minFeeToUse\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_daoTokenReward\",\"type\":\"uint256\"},{\"components\":[{\"internalType\":\"uint16\",\"name\":\"minerPercentage\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"userPercentage\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"referrerPercentage\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"refereePercentage\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"l2OwnerPercentage\",\"type\":\"uint16\"}],\"internalType\":\"structIWorkerHub.DAOTokenPercentage\",\"name\":\"_daoTokenPercentage\",\"type\":\"tuple\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_assignmentId\",\"type\":\"uint256\"}],\"name\":\"isAssignmentPending\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"isReferrer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"joinForMinting\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"l2Owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"lastBlock\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"maximumTier\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"minFeeToUse\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"minerMinimumStake\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"minerRequirement\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"minerUnstakeRequests\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"stake\",\"type\":\"uint256\"},{\"internalType\":\"uint40\",\"name\":\"unlockAt\",\"type\":\"uint40\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"miners\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"stake\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"commitment\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"modelAddress\",\"type\":\"address\"},{\"internalType\":\"uint40\",\"name\":\"lastClaimedEpoch\",\"type\":\"uint40\"},{\"internalType\":\"uint40\",\"name\":\"activeTime\",\"type\":\"uint40\"},{\"internalType\":\"uint16\",\"name\":\"tier\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"modelScoring\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"models\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"minimumFee\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"tier\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_miner\",\"type\":\"address\"}],\"name\":\"multiplier\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"paused\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"penaltyDuration\",\"outputs\":[{\"internalType\":\"uint40\",\"name\":\"\",\"type\":\"uint40\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"tier\",\"type\":\"uint16\"},{\"internalType\":\"uint256\",\"name\":\"wEAIAmt\",\"type\":\"uint256\"}],\"name\":\"registerMiner\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_model\",\"type\":\"address\"},{\"internalType\":\"uint16\",\"name\":\"_tier\",\"type\":\"uint16\"},{\"internalType\":\"uint256\",\"name\":\"_minimumFee\",\"type\":\"uint256\"}],\"name\":\"registerModel\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_referrer\",\"type\":\"address\"}],\"name\":\"registerReferrer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"_referrers\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"_referees\",\"type\":\"address[]\"}],\"name\":\"registerReferrer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_inferenceId\",\"type\":\"uint256\"}],\"name\":\"resolveInference\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"tier\",\"type\":\"uint16\"}],\"name\":\"restakeForMiner\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"result\",\"type\":\"bytes\"}],\"name\":\"resultReceived\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_originInferId\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_result\",\"type\":\"bytes\"}],\"name\":\"resultReceived\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_assignId\",\"type\":\"uint256\"},{\"internalType\":\"uint40\",\"name\":\"_nonce\",\"type\":\"uint40\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"reveal\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"revealDuration\",\"outputs\":[{\"internalType\":\"uint40\",\"name\":\"\",\"type\":\"uint40\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"rewardInEpoch\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"perfReward\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"epochReward\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"totalTaskCompleted\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"totalMiner\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"rewardPerEpoch\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_miner\",\"type\":\"address\"}],\"name\":\"rewardToClaim\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_assignmentId\",\"type\":\"uint256\"}],\"name\":\"seizeMinerRole\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_blocks\",\"type\":\"uint256\"}],\"name\":\"setBlocksPerEpoch\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint40\",\"name\":\"_newCommitDuration\",\"type\":\"uint40\"}],\"name\":\"setCommitDuration\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_daoTokenAddress\",\"type\":\"address\"}],\"name\":\"setDAOToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint16\",\"name\":\"minerPercentage\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"userPercentage\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"referrerPercentage\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"refereePercentage\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"l2OwnerPercentage\",\"type\":\"uint16\"}],\"internalType\":\"structIWorkerHub.DAOTokenPercentage\",\"name\":\"_daoTokenPercentage\",\"type\":\"tuple\"}],\"name\":\"setDAOTokenPercentage\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_newDAOTokenReward\",\"type\":\"uint256\"}],\"name\":\"setDAOTokenReward\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"_newRatio\",\"type\":\"uint16\"}],\"name\":\"setFeeRatioMinerValidator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"_finePercentage\",\"type\":\"uint16\"}],\"name\":\"setFinePercentage\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_l2OwnerAddress\",\"type\":\"address\"}],\"name\":\"setL2Owner\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_minFeeToUse\",\"type\":\"uint256\"}],\"name\":\"setMinFeeToUse\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_minerMinimumStake\",\"type\":\"uint256\"}],\"name\":\"setMinerMinimumStake\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_newRewardAmount\",\"type\":\"uint256\"}],\"name\":\"setNewRewardInEpoch\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint40\",\"name\":\"_penaltyDuration\",\"type\":\"uint40\"}],\"name\":\"setPenaltyDuration\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint40\",\"name\":\"_newRevealDuration\",\"type\":\"uint40\"}],\"name\":\"setRevealDuration\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_workerHubScoring\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_modelScoring\",\"type\":\"address\"}],\"name\":\"setScoringInfo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint40\",\"name\":\"_newSubmitDuration\",\"type\":\"uint40\"}],\"name\":\"setSubmitDuration\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_treasuryAddress\",\"type\":\"address\"}],\"name\":\"setTreasuryAddress\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint40\",\"name\":\"_newUnstakeDelayTime\",\"type\":\"uint40\"}],\"name\":\"setUnstakDelayTime\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_miner\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"_isFined\",\"type\":\"bool\"}],\"name\":\"slashMiner\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_assignmentId\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"streamData\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"submitDuration\",\"outputs\":[{\"internalType\":\"uint40\",\"name\":\"\",\"type\":\"uint40\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_assigmentId\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"submitSolution\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_inferenceId\",\"type\":\"uint256\"}],\"name\":\"topUpInfer\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"treasury\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"unpause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"unregisterMiner\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_model\",\"type\":\"address\"}],\"name\":\"unregisterModel\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"unstakeDelayTime\",\"outputs\":[{\"internalType\":\"uint40\",\"name\":\"\",\"type\":\"uint40\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"unstakeForMiner\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_model\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_minimumFee\",\"type\":\"uint256\"}],\"name\":\"updateModelMinimumFee\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_model\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"_tier\",\"type\":\"uint32\"}],\"name\":\"updateModelTier\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bool\",\"name\":\"_isReferred\",\"type\":\"bool\"}],\"name\":\"validateDAOSupplyIncrease\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"notReachedLimit\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"version\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"inferId\",\"type\":\"uint256\"}],\"name\":\"votingInfo\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"totalCommit\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"totalReveal\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"wEAI\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"workerHubScoring\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]", } // IWorkerHubABI is the input ABI used to generate the binding from. // Deprecated: Use IWorkerHubMetaData.ABI instead. var IWorkerHubABI = IWorkerHubMetaData.ABI // IWorkerHub is an auto generated Go binding around an Ethereum contract. type IWorkerHub struct { IWorkerHubCaller // Read-only binding to the contract IWorkerHubTransactor // Write-only binding to the contract IWorkerHubFilterer // Log filterer for contract events } // IWorkerHubCaller is an auto generated read-only Go binding around an Ethereum contract. type IWorkerHubCaller struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // IWorkerHubTransactor is an auto generated write-only Go binding around an Ethereum contract. type IWorkerHubTransactor struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // IWorkerHubFilterer is an auto generated log filtering Go binding around an Ethereum contract events. type IWorkerHubFilterer struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // IWorkerHubSession is an auto generated Go binding around an Ethereum contract, // with pre-set call and transact options. type IWorkerHubSession struct { Contract *IWorkerHub // Generic contract binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // IWorkerHubCallerSession is an auto generated read-only Go binding around an Ethereum contract, // with pre-set call options. type IWorkerHubCallerSession struct { Contract *IWorkerHubCaller // Generic contract caller binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session } // IWorkerHubTransactorSession is an auto generated write-only Go binding around an Ethereum contract, // with pre-set transact options. type IWorkerHubTransactorSession struct { Contract *IWorkerHubTransactor // Generic contract transactor binding to set the session for TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // IWorkerHubRaw is an auto generated low-level Go binding around an Ethereum contract. type IWorkerHubRaw struct { Contract *IWorkerHub // Generic contract binding to access the raw methods on } // IWorkerHubCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. type IWorkerHubCallerRaw struct { Contract *IWorkerHubCaller // Generic read-only contract binding to access the raw methods on } // IWorkerHubTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. type IWorkerHubTransactorRaw struct { Contract *IWorkerHubTransactor // Generic write-only contract binding to access the raw methods on } // NewIWorkerHub creates a new instance of IWorkerHub, bound to a specific deployed contract. func NewIWorkerHub(address common.Address, backend bind.ContractBackend) (*IWorkerHub, error) { contract, err := bindIWorkerHub(address, backend, backend, backend) if err != nil { return nil, err } return &IWorkerHub{IWorkerHubCaller: IWorkerHubCaller{contract: contract}, IWorkerHubTransactor: IWorkerHubTransactor{contract: contract}, IWorkerHubFilterer: IWorkerHubFilterer{contract: contract}}, nil } // NewIWorkerHubCaller creates a new read-only instance of IWorkerHub, bound to a specific deployed contract. func NewIWorkerHubCaller(address common.Address, caller bind.ContractCaller) (*IWorkerHubCaller, error) { contract, err := bindIWorkerHub(address, caller, nil, nil) if err != nil { return nil, err } return &IWorkerHubCaller{contract: contract}, nil } // NewIWorkerHubTransactor creates a new write-only instance of IWorkerHub, bound to a specific deployed contract. func NewIWorkerHubTransactor(address common.Address, transactor bind.ContractTransactor) (*IWorkerHubTransactor, error) { contract, err := bindIWorkerHub(address, nil, transactor, nil) if err != nil { return nil, err } return &IWorkerHubTransactor{contract: contract}, nil } // NewIWorkerHubFilterer creates a new log filterer instance of IWorkerHub, bound to a specific deployed contract. func NewIWorkerHubFilterer(address common.Address, filterer bind.ContractFilterer) (*IWorkerHubFilterer, error) { contract, err := bindIWorkerHub(address, nil, nil, filterer) if err != nil { return nil, err } return &IWorkerHubFilterer{contract: contract}, nil } // bindIWorkerHub binds a generic wrapper to an already deployed contract. func bindIWorkerHub(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { parsed, err := IWorkerHubMetaData.GetAbi() if err != nil { return nil, err } return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_IWorkerHub *IWorkerHubRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _IWorkerHub.Contract.IWorkerHubCaller.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_IWorkerHub *IWorkerHubRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _IWorkerHub.Contract.IWorkerHubTransactor.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_IWorkerHub *IWorkerHubRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _IWorkerHub.Contract.IWorkerHubTransactor.contract.Transact(opts, method, params...) } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_IWorkerHub *IWorkerHubCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _IWorkerHub.Contract.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_IWorkerHub *IWorkerHubTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _IWorkerHub.Contract.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_IWorkerHub *IWorkerHubTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _IWorkerHub.Contract.contract.Transact(opts, method, params...) } // AssignmentNumber is a free data retrieval call binding the contract method 0x6973d3f2. // // Solidity: function assignmentNumber() view returns(uint256) func (_IWorkerHub *IWorkerHubCaller) AssignmentNumber(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} err := _IWorkerHub.contract.Call(opts, &out, "assignmentNumber") if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // AssignmentNumber is a free data retrieval call binding the contract method 0x6973d3f2. // // Solidity: function assignmentNumber() view returns(uint256) func (_IWorkerHub *IWorkerHubSession) AssignmentNumber() (*big.Int, error) { return _IWorkerHub.Contract.AssignmentNumber(&_IWorkerHub.CallOpts) } // AssignmentNumber is a free data retrieval call binding the contract method 0x6973d3f2. // // Solidity: function assignmentNumber() view returns(uint256) func (_IWorkerHub *IWorkerHubCallerSession) AssignmentNumber() (*big.Int, error) { return _IWorkerHub.Contract.AssignmentNumber(&_IWorkerHub.CallOpts) } // Assignments is a free data retrieval call binding the contract method 0x4e50c75c. // // Solidity: function assignments(uint256 ) view returns(uint256 inferenceId, bytes32 commitment, bytes32 digest, uint40 revealNonce, address worker, uint8 role, uint8 vote, bytes output) func (_IWorkerHub *IWorkerHubCaller) Assignments(opts *bind.CallOpts, arg0 *big.Int) (struct { InferenceId *big.Int Commitment [32]byte Digest [32]byte RevealNonce *big.Int Worker common.Address Role uint8 Vote uint8 Output []byte }, error) { var out []interface{} err := _IWorkerHub.contract.Call(opts, &out, "assignments", arg0) outstruct := new(struct { InferenceId *big.Int Commitment [32]byte Digest [32]byte RevealNonce *big.Int Worker common.Address Role uint8 Vote uint8 Output []byte }) if err != nil { return *outstruct, err } outstruct.InferenceId = *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) outstruct.Commitment = *abi.ConvertType(out[1], new([32]byte)).(*[32]byte) outstruct.Digest = *abi.ConvertType(out[2], new([32]byte)).(*[32]byte) outstruct.RevealNonce = *abi.ConvertType(out[3], new(*big.Int)).(**big.Int) outstruct.Worker = *abi.ConvertType(out[4], new(common.Address)).(*common.Address) outstruct.Role = *abi.ConvertType(out[5], new(uint8)).(*uint8) outstruct.Vote = *abi.ConvertType(out[6], new(uint8)).(*uint8) outstruct.Output = *abi.ConvertType(out[7], new([]byte)).(*[]byte) return *outstruct, err } // Assignments is a free data retrieval call binding the contract method 0x4e50c75c. // // Solidity: function assignments(uint256 ) view returns(uint256 inferenceId, bytes32 commitment, bytes32 digest, uint40 revealNonce, address worker, uint8 role, uint8 vote, bytes output) func (_IWorkerHub *IWorkerHubSession) Assignments(arg0 *big.Int) (struct { InferenceId *big.Int Commitment [32]byte Digest [32]byte RevealNonce *big.Int Worker common.Address Role uint8 Vote uint8 Output []byte }, error) { return _IWorkerHub.Contract.Assignments(&_IWorkerHub.CallOpts, arg0) } // Assignments is a free data retrieval call binding the contract method 0x4e50c75c. // // Solidity: function assignments(uint256 ) view returns(uint256 inferenceId, bytes32 commitment, bytes32 digest, uint40 revealNonce, address worker, uint8 role, uint8 vote, bytes output) func (_IWorkerHub *IWorkerHubCallerSession) Assignments(arg0 *big.Int) (struct { InferenceId *big.Int Commitment [32]byte Digest [32]byte RevealNonce *big.Int Worker common.Address Role uint8 Vote uint8 Output []byte }, error) { return _IWorkerHub.Contract.Assignments(&_IWorkerHub.CallOpts, arg0) } // BlocksPerEpoch is a free data retrieval call binding the contract method 0xf0682054. // // Solidity: function blocksPerEpoch() view returns(uint256) func (_IWorkerHub *IWorkerHubCaller) BlocksPerEpoch(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} err := _IWorkerHub.contract.Call(opts, &out, "blocksPerEpoch") if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // BlocksPerEpoch is a free data retrieval call binding the contract method 0xf0682054. // // Solidity: function blocksPerEpoch() view returns(uint256) func (_IWorkerHub *IWorkerHubSession) BlocksPerEpoch() (*big.Int, error) { return _IWorkerHub.Contract.BlocksPerEpoch(&_IWorkerHub.CallOpts) } // BlocksPerEpoch is a free data retrieval call binding the contract method 0xf0682054. // // Solidity: function blocksPerEpoch() view returns(uint256) func (_IWorkerHub *IWorkerHubCallerSession) BlocksPerEpoch() (*big.Int, error) { return _IWorkerHub.Contract.BlocksPerEpoch(&_IWorkerHub.CallOpts) } // CommitDuration is a free data retrieval call binding the contract method 0x6f833811. // // Solidity: function commitDuration() view returns(uint40) func (_IWorkerHub *IWorkerHubCaller) CommitDuration(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} err := _IWorkerHub.contract.Call(opts, &out, "commitDuration") if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // CommitDuration is a free data retrieval call binding the contract method 0x6f833811. // // Solidity: function commitDuration() view returns(uint40) func (_IWorkerHub *IWorkerHubSession) CommitDuration() (*big.Int, error) { return _IWorkerHub.Contract.CommitDuration(&_IWorkerHub.CallOpts) } // CommitDuration is a free data retrieval call binding the contract method 0x6f833811. // // Solidity: function commitDuration() view returns(uint40) func (_IWorkerHub *IWorkerHubCallerSession) CommitDuration() (*big.Int, error) { return _IWorkerHub.Contract.CommitDuration(&_IWorkerHub.CallOpts) } // CurrentEpoch is a free data retrieval call binding the contract method 0x76671808. // // Solidity: function currentEpoch() view returns(uint40) func (_IWorkerHub *IWorkerHubCaller) CurrentEpoch(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} err := _IWorkerHub.contract.Call(opts, &out, "currentEpoch") if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // CurrentEpoch is a free data retrieval call binding the contract method 0x76671808. // // Solidity: function currentEpoch() view returns(uint40) func (_IWorkerHub *IWorkerHubSession) CurrentEpoch() (*big.Int, error) { return _IWorkerHub.Contract.CurrentEpoch(&_IWorkerHub.CallOpts) } // CurrentEpoch is a free data retrieval call binding the contract method 0x76671808. // // Solidity: function currentEpoch() view returns(uint40) func (_IWorkerHub *IWorkerHubCallerSession) CurrentEpoch() (*big.Int, error) { return _IWorkerHub.Contract.CurrentEpoch(&_IWorkerHub.CallOpts) } // DaoReceiversInfo is a free data retrieval call binding the contract method 0x61d52cf7. // // Solidity: function daoReceiversInfo(uint256 inferId, uint256 ) view returns(address receiver, uint256 amount, uint8 role) func (_IWorkerHub *IWorkerHubCaller) DaoReceiversInfo(opts *bind.CallOpts, inferId *big.Int, arg1 *big.Int) (struct { Receiver common.Address Amount *big.Int Role uint8 }, error) { var out []interface{} err := _IWorkerHub.contract.Call(opts, &out, "daoReceiversInfo", inferId, arg1) outstruct := new(struct { Receiver common.Address Amount *big.Int Role uint8 }) if err != nil { return *outstruct, err } outstruct.Receiver = *abi.ConvertType(out[0], new(common.Address)).(*common.Address) outstruct.Amount = *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) outstruct.Role = *abi.ConvertType(out[2], new(uint8)).(*uint8) return *outstruct, err } // DaoReceiversInfo is a free data retrieval call binding the contract method 0x61d52cf7. // // Solidity: function daoReceiversInfo(uint256 inferId, uint256 ) view returns(address receiver, uint256 amount, uint8 role) func (_IWorkerHub *IWorkerHubSession) DaoReceiversInfo(inferId *big.Int, arg1 *big.Int) (struct { Receiver common.Address Amount *big.Int Role uint8 }, error) { return _IWorkerHub.Contract.DaoReceiversInfo(&_IWorkerHub.CallOpts, inferId, arg1) } // DaoReceiversInfo is a free data retrieval call binding the contract method 0x61d52cf7. // // Solidity: function daoReceiversInfo(uint256 inferId, uint256 ) view returns(address receiver, uint256 amount, uint8 role) func (_IWorkerHub *IWorkerHubCallerSession) DaoReceiversInfo(inferId *big.Int, arg1 *big.Int) (struct { Receiver common.Address Amount *big.Int Role uint8 }, error) { return _IWorkerHub.Contract.DaoReceiversInfo(&_IWorkerHub.CallOpts, inferId, arg1) } // DaoToken is a free data retrieval call binding the contract method 0x4914b030. // // Solidity: function daoToken() view returns(address) func (_IWorkerHub *IWorkerHubCaller) DaoToken(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _IWorkerHub.contract.Call(opts, &out, "daoToken") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // DaoToken is a free data retrieval call binding the contract method 0x4914b030. // // Solidity: function daoToken() view returns(address) func (_IWorkerHub *IWorkerHubSession) DaoToken() (common.Address, error) { return _IWorkerHub.Contract.DaoToken(&_IWorkerHub.CallOpts) } // DaoToken is a free data retrieval call binding the contract method 0x4914b030. // // Solidity: function daoToken() view returns(address) func (_IWorkerHub *IWorkerHubCallerSession) DaoToken() (common.Address, error) { return _IWorkerHub.Contract.DaoToken(&_IWorkerHub.CallOpts) } // DaoTokenPercentage is a free data retrieval call binding the contract method 0xff5db406. // // Solidity: function daoTokenPercentage() view returns(uint16 minerPercentage, uint16 userPercentage, uint16 referrerPercentage, uint16 refereePercentage, uint16 l2OwnerPercentage) func (_IWorkerHub *IWorkerHubCaller) DaoTokenPercentage(opts *bind.CallOpts) (struct { MinerPercentage uint16 UserPercentage uint16 ReferrerPercentage uint16 RefereePercentage uint16 L2OwnerPercentage uint16 }, error) { var out []interface{} err := _IWorkerHub.contract.Call(opts, &out, "daoTokenPercentage") outstruct := new(struct { MinerPercentage uint16 UserPercentage uint16 ReferrerPercentage uint16 RefereePercentage uint16 L2OwnerPercentage uint16 }) if err != nil { return *outstruct, err } outstruct.MinerPercentage = *abi.ConvertType(out[0], new(uint16)).(*uint16) outstruct.UserPercentage = *abi.ConvertType(out[1], new(uint16)).(*uint16) outstruct.ReferrerPercentage = *abi.ConvertType(out[2], new(uint16)).(*uint16) outstruct.RefereePercentage = *abi.ConvertType(out[3], new(uint16)).(*uint16) outstruct.L2OwnerPercentage = *abi.ConvertType(out[4], new(uint16)).(*uint16) return *outstruct, err } // DaoTokenPercentage is a free data retrieval call binding the contract method 0xff5db406. // // Solidity: function daoTokenPercentage() view returns(uint16 minerPercentage, uint16 userPercentage, uint16 referrerPercentage, uint16 refereePercentage, uint16 l2OwnerPercentage) func (_IWorkerHub *IWorkerHubSession) DaoTokenPercentage() (struct { MinerPercentage uint16 UserPercentage uint16 ReferrerPercentage uint16 RefereePercentage uint16 L2OwnerPercentage uint16 }, error) { return _IWorkerHub.Contract.DaoTokenPercentage(&_IWorkerHub.CallOpts) } // DaoTokenPercentage is a free data retrieval call binding the contract method 0xff5db406. // // Solidity: function daoTokenPercentage() view returns(uint16 minerPercentage, uint16 userPercentage, uint16 referrerPercentage, uint16 refereePercentage, uint16 l2OwnerPercentage) func (_IWorkerHub *IWorkerHubCallerSession) DaoTokenPercentage() (struct { MinerPercentage uint16 UserPercentage uint16 ReferrerPercentage uint16 RefereePercentage uint16 L2OwnerPercentage uint16 }, error) { return _IWorkerHub.Contract.DaoTokenPercentage(&_IWorkerHub.CallOpts) } // DaoTokenReward is a free data retrieval call binding the contract method 0x0940c392. // // Solidity: function daoTokenReward() view returns(uint256) func (_IWorkerHub *IWorkerHubCaller) DaoTokenReward(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} err := _IWorkerHub.contract.Call(opts, &out, "daoTokenReward") if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // DaoTokenReward is a free data retrieval call binding the contract method 0x0940c392. // // Solidity: function daoTokenReward() view returns(uint256) func (_IWorkerHub *IWorkerHubSession) DaoTokenReward() (*big.Int, error) { return _IWorkerHub.Contract.DaoTokenReward(&_IWorkerHub.CallOpts) } // DaoTokenReward is a free data retrieval call binding the contract method 0x0940c392. // // Solidity: function daoTokenReward() view returns(uint256) func (_IWorkerHub *IWorkerHubCallerSession) DaoTokenReward() (*big.Int, error) { return _IWorkerHub.Contract.DaoTokenReward(&_IWorkerHub.CallOpts) } // FeeL2Percentage is a free data retrieval call binding the contract method 0x39d2e296. // // Solidity: function feeL2Percentage() view returns(uint16) func (_IWorkerHub *IWorkerHubCaller) FeeL2Percentage(opts *bind.CallOpts) (uint16, error) { var out []interface{} err := _IWorkerHub.contract.Call(opts, &out, "feeL2Percentage") if err != nil { return *new(uint16), err } out0 := *abi.ConvertType(out[0], new(uint16)).(*uint16) return out0, err } // FeeL2Percentage is a free data retrieval call binding the contract method 0x39d2e296. // // Solidity: function feeL2Percentage() view returns(uint16) func (_IWorkerHub *IWorkerHubSession) FeeL2Percentage() (uint16, error) { return _IWorkerHub.Contract.FeeL2Percentage(&_IWorkerHub.CallOpts) } // FeeL2Percentage is a free data retrieval call binding the contract method 0x39d2e296. // // Solidity: function feeL2Percentage() view returns(uint16) func (_IWorkerHub *IWorkerHubCallerSession) FeeL2Percentage() (uint16, error) { return _IWorkerHub.Contract.FeeL2Percentage(&_IWorkerHub.CallOpts) } // FeeRatioMinerValidator is a free data retrieval call binding the contract method 0x50eac7c8. // // Solidity: function feeRatioMinerValidator() view returns(uint16) func (_IWorkerHub *IWorkerHubCaller) FeeRatioMinerValidator(opts *bind.CallOpts) (uint16, error) { var out []interface{} err := _IWorkerHub.contract.Call(opts, &out, "feeRatioMinerValidator") if err != nil { return *new(uint16), err } out0 := *abi.ConvertType(out[0], new(uint16)).(*uint16) return out0, err } // FeeRatioMinerValidator is a free data retrieval call binding the contract method 0x50eac7c8. // // Solidity: function feeRatioMinerValidator() view returns(uint16) func (_IWorkerHub *IWorkerHubSession) FeeRatioMinerValidator() (uint16, error) { return _IWorkerHub.Contract.FeeRatioMinerValidator(&_IWorkerHub.CallOpts) } // FeeRatioMinerValidator is a free data retrieval call binding the contract method 0x50eac7c8. // // Solidity: function feeRatioMinerValidator() view returns(uint16) func (_IWorkerHub *IWorkerHubCallerSession) FeeRatioMinerValidator() (uint16, error) { return _IWorkerHub.Contract.FeeRatioMinerValidator(&_IWorkerHub.CallOpts) } // FeeTreasuryPercentage is a free data retrieval call binding the contract method 0x09c83b4f. // // Solidity: function feeTreasuryPercentage() view returns(uint16) func (_IWorkerHub *IWorkerHubCaller) FeeTreasuryPercentage(opts *bind.CallOpts) (uint16, error) { var out []interface{} err := _IWorkerHub.contract.Call(opts, &out, "feeTreasuryPercentage") if err != nil { return *new(uint16), err } out0 := *abi.ConvertType(out[0], new(uint16)).(*uint16) return out0, err } // FeeTreasuryPercentage is a free data retrieval call binding the contract method 0x09c83b4f. // // Solidity: function feeTreasuryPercentage() view returns(uint16) func (_IWorkerHub *IWorkerHubSession) FeeTreasuryPercentage() (uint16, error) { return _IWorkerHub.Contract.FeeTreasuryPercentage(&_IWorkerHub.CallOpts) } // FeeTreasuryPercentage is a free data retrieval call binding the contract method 0x09c83b4f. // // Solidity: function feeTreasuryPercentage() view returns(uint16) func (_IWorkerHub *IWorkerHubCallerSession) FeeTreasuryPercentage() (uint16, error) { return _IWorkerHub.Contract.FeeTreasuryPercentage(&_IWorkerHub.CallOpts) } // FinePercentage is a free data retrieval call binding the contract method 0x74172795. // // Solidity: function finePercentage() view returns(uint16) func (_IWorkerHub *IWorkerHubCaller) FinePercentage(opts *bind.CallOpts) (uint16, error) { var out []interface{} err := _IWorkerHub.contract.Call(opts, &out, "finePercentage") if err != nil { return *new(uint16), err } out0 := *abi.ConvertType(out[0], new(uint16)).(*uint16) return out0, err } // FinePercentage is a free data retrieval call binding the contract method 0x74172795. // // Solidity: function finePercentage() view returns(uint16) func (_IWorkerHub *IWorkerHubSession) FinePercentage() (uint16, error) { return _IWorkerHub.Contract.FinePercentage(&_IWorkerHub.CallOpts) } // FinePercentage is a free data retrieval call binding the contract method 0x74172795. // // Solidity: function finePercentage() view returns(uint16) func (_IWorkerHub *IWorkerHubCallerSession) FinePercentage() (uint16, error) { return _IWorkerHub.Contract.FinePercentage(&_IWorkerHub.CallOpts) } // GetAllAssignments is a free data retrieval call binding the contract method 0x16d0a88f. // // Solidity: function getAllAssignments(uint256 startId, uint256 count) view returns((uint256,bytes32,bytes32,uint40,address,uint8,uint8,bytes)[] assignmentData) func (_IWorkerHub *IWorkerHubCaller) GetAllAssignments(opts *bind.CallOpts, startId *big.Int, count *big.Int) ([]IWorkerHubAssignment, error) { var out []interface{} err := _IWorkerHub.contract.Call(opts, &out, "getAllAssignments", startId, count) if err != nil { return *new([]IWorkerHubAssignment), err } out0 := *abi.ConvertType(out[0], new([]IWorkerHubAssignment)).(*[]IWorkerHubAssignment) return out0, err } // GetAllAssignments is a free data retrieval call binding the contract method 0x16d0a88f. // // Solidity: function getAllAssignments(uint256 startId, uint256 count) view returns((uint256,bytes32,bytes32,uint40,address,uint8,uint8,bytes)[] assignmentData) func (_IWorkerHub *IWorkerHubSession) GetAllAssignments(startId *big.Int, count *big.Int) ([]IWorkerHubAssignment, error) { return _IWorkerHub.Contract.GetAllAssignments(&_IWorkerHub.CallOpts, startId, count) } // GetAllAssignments is a free data retrieval call binding the contract method 0x16d0a88f. // // Solidity: function getAllAssignments(uint256 startId, uint256 count) view returns((uint256,bytes32,bytes32,uint40,address,uint8,uint8,bytes)[] assignmentData) func (_IWorkerHub *IWorkerHubCallerSession) GetAllAssignments(startId *big.Int, count *big.Int) ([]IWorkerHubAssignment, error) { return _IWorkerHub.Contract.GetAllAssignments(&_IWorkerHub.CallOpts, startId, count) } // GetAllInferences is a free data retrieval call binding the contract method 0xf1ea45e3. // // Solidity: function getAllInferences(uint256 startId, uint256 count) view returns((uint256[],bytes,uint256,uint256,uint256,address,uint40,uint40,uint40,uint8,address,address,address)[] inferenceData) func (_IWorkerHub *IWorkerHubCaller) GetAllInferences(opts *bind.CallOpts, startId *big.Int, count *big.Int) ([]IWorkerHubInference, error) { var out []interface{} err := _IWorkerHub.contract.Call(opts, &out, "getAllInferences", startId, count) if err != nil { return *new([]IWorkerHubInference), err } out0 := *abi.ConvertType(out[0], new([]IWorkerHubInference)).(*[]IWorkerHubInference) return out0, err } // GetAllInferences is a free data retrieval call binding the contract method 0xf1ea45e3. // // Solidity: function getAllInferences(uint256 startId, uint256 count) view returns((uint256[],bytes,uint256,uint256,uint256,address,uint40,uint40,uint40,uint8,address,address,address)[] inferenceData) func (_IWorkerHub *IWorkerHubSession) GetAllInferences(startId *big.Int, count *big.Int) ([]IWorkerHubInference, error) { return _IWorkerHub.Contract.GetAllInferences(&_IWorkerHub.CallOpts, startId, count) } // GetAllInferences is a free data retrieval call binding the contract method 0xf1ea45e3. // // Solidity: function getAllInferences(uint256 startId, uint256 count) view returns((uint256[],bytes,uint256,uint256,uint256,address,uint40,uint40,uint40,uint8,address,address,address)[] inferenceData) func (_IWorkerHub *IWorkerHubCallerSession) GetAllInferences(startId *big.Int, count *big.Int) ([]IWorkerHubInference, error) { return _IWorkerHub.Contract.GetAllInferences(&_IWorkerHub.CallOpts, startId, count) } // GetAllMinerUnstakeRequests is a free data retrieval call binding the contract method 0x9280f078. // // Solidity: function getAllMinerUnstakeRequests() view returns(address[] unstakeAddresses, (uint256,uint40)[] unstakeRequests) func (_IWorkerHub *IWorkerHubCaller) GetAllMinerUnstakeRequests(opts *bind.CallOpts) (struct { UnstakeAddresses []common.Address UnstakeRequests []IWorkerHubUnstakeRequest }, error) { var out []interface{} err := _IWorkerHub.contract.Call(opts, &out, "getAllMinerUnstakeRequests") outstruct := new(struct { UnstakeAddresses []common.Address UnstakeRequests []IWorkerHubUnstakeRequest }) if err != nil { return *outstruct, err } outstruct.UnstakeAddresses = *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) outstruct.UnstakeRequests = *abi.ConvertType(out[1], new([]IWorkerHubUnstakeRequest)).(*[]IWorkerHubUnstakeRequest) return *outstruct, err } // GetAllMinerUnstakeRequests is a free data retrieval call binding the contract method 0x9280f078. // // Solidity: function getAllMinerUnstakeRequests() view returns(address[] unstakeAddresses, (uint256,uint40)[] unstakeRequests) func (_IWorkerHub *IWorkerHubSession) GetAllMinerUnstakeRequests() (struct { UnstakeAddresses []common.Address UnstakeRequests []IWorkerHubUnstakeRequest }, error) { return _IWorkerHub.Contract.GetAllMinerUnstakeRequests(&_IWorkerHub.CallOpts) } // GetAllMinerUnstakeRequests is a free data retrieval call binding the contract method 0x9280f078. // // Solidity: function getAllMinerUnstakeRequests() view returns(address[] unstakeAddresses, (uint256,uint40)[] unstakeRequests) func (_IWorkerHub *IWorkerHubCallerSession) GetAllMinerUnstakeRequests() (struct { UnstakeAddresses []common.Address UnstakeRequests []IWorkerHubUnstakeRequest }, error) { return _IWorkerHub.Contract.GetAllMinerUnstakeRequests(&_IWorkerHub.CallOpts) } // GetAllMiners is a free data retrieval call binding the contract method 0x4b17bf30. // // Solidity: function getAllMiners() view returns((uint256,uint256,address,uint40,uint40,uint16)[] minerData) func (_IWorkerHub *IWorkerHubCaller) GetAllMiners(opts *bind.CallOpts) ([]IWorkerHubWorker, error) { var out []interface{} err := _IWorkerHub.contract.Call(opts, &out, "getAllMiners") if err != nil { return *new([]IWorkerHubWorker), err } out0 := *abi.ConvertType(out[0], new([]IWorkerHubWorker)).(*[]IWorkerHubWorker) return out0, err } // GetAllMiners is a free data retrieval call binding the contract method 0x4b17bf30. // // Solidity: function getAllMiners() view returns((uint256,uint256,address,uint40,uint40,uint16)[] minerData) func (_IWorkerHub *IWorkerHubSession) GetAllMiners() ([]IWorkerHubWorker, error) { return _IWorkerHub.Contract.GetAllMiners(&_IWorkerHub.CallOpts) } // GetAllMiners is a free data retrieval call binding the contract method 0x4b17bf30. // // Solidity: function getAllMiners() view returns((uint256,uint256,address,uint40,uint40,uint16)[] minerData) func (_IWorkerHub *IWorkerHubCallerSession) GetAllMiners() ([]IWorkerHubWorker, error) { return _IWorkerHub.Contract.GetAllMiners(&_IWorkerHub.CallOpts) } // GetAssignmentByInferenceId is a free data retrieval call binding the contract method 0x19a9dc71. // // Solidity: function getAssignmentByInferenceId(uint256 _inferId) view returns((uint256,bytes32,bytes32,uint40,address,uint8,uint8,bytes)[]) func (_IWorkerHub *IWorkerHubCaller) GetAssignmentByInferenceId(opts *bind.CallOpts, _inferId *big.Int) ([]IWorkerHubAssignment, error) { var out []interface{} err := _IWorkerHub.contract.Call(opts, &out, "getAssignmentByInferenceId", _inferId) if err != nil { return *new([]IWorkerHubAssignment), err } out0 := *abi.ConvertType(out[0], new([]IWorkerHubAssignment)).(*[]IWorkerHubAssignment) return out0, err } // GetAssignmentByInferenceId is a free data retrieval call binding the contract method 0x19a9dc71. // // Solidity: function getAssignmentByInferenceId(uint256 _inferId) view returns((uint256,bytes32,bytes32,uint40,address,uint8,uint8,bytes)[]) func (_IWorkerHub *IWorkerHubSession) GetAssignmentByInferenceId(_inferId *big.Int) ([]IWorkerHubAssignment, error) { return _IWorkerHub.Contract.GetAssignmentByInferenceId(&_IWorkerHub.CallOpts, _inferId) } // GetAssignmentByInferenceId is a free data retrieval call binding the contract method 0x19a9dc71. // // Solidity: function getAssignmentByInferenceId(uint256 _inferId) view returns((uint256,bytes32,bytes32,uint40,address,uint8,uint8,bytes)[]) func (_IWorkerHub *IWorkerHubCallerSession) GetAssignmentByInferenceId(_inferId *big.Int) ([]IWorkerHubAssignment, error) { return _IWorkerHub.Contract.GetAssignmentByInferenceId(&_IWorkerHub.CallOpts, _inferId) } // GetAssignmentByMiner is a free data retrieval call binding the contract method 0x5937e5ed. // // Solidity: function getAssignmentByMiner(address _minerAddr) view returns((uint256,uint256,uint256,bytes,address,address,uint40,uint40,uint40)[]) func (_IWorkerHub *IWorkerHubCaller) GetAssignmentByMiner(opts *bind.CallOpts, _minerAddr common.Address) ([]IWorkerHubAssignmentInfo, error) { var out []interface{} err := _IWorkerHub.contract.Call(opts, &out, "getAssignmentByMiner", _minerAddr) if err != nil { return *new([]IWorkerHubAssignmentInfo), err } out0 := *abi.ConvertType(out[0], new([]IWorkerHubAssignmentInfo)).(*[]IWorkerHubAssignmentInfo) return out0, err } // GetAssignmentByMiner is a free data retrieval call binding the contract method 0x5937e5ed. // // Solidity: function getAssignmentByMiner(address _minerAddr) view returns((uint256,uint256,uint256,bytes,address,address,uint40,uint40,uint40)[]) func (_IWorkerHub *IWorkerHubSession) GetAssignmentByMiner(_minerAddr common.Address) ([]IWorkerHubAssignmentInfo, error) { return _IWorkerHub.Contract.GetAssignmentByMiner(&_IWorkerHub.CallOpts, _minerAddr) } // GetAssignmentByMiner is a free data retrieval call binding the contract method 0x5937e5ed. // // Solidity: function getAssignmentByMiner(address _minerAddr) view returns((uint256,uint256,uint256,bytes,address,address,uint40,uint40,uint40)[]) func (_IWorkerHub *IWorkerHubCallerSession) GetAssignmentByMiner(_minerAddr common.Address) ([]IWorkerHubAssignmentInfo, error) { return _IWorkerHub.Contract.GetAssignmentByMiner(&_IWorkerHub.CallOpts, _minerAddr) } // GetInferenceInfo is a free data retrieval call binding the contract method 0x08c05903. // // Solidity: function getInferenceInfo(uint256 _inferenceId) view returns((uint256[],bytes,uint256,uint256,uint256,address,uint40,uint40,uint40,uint8,address,address,address)) func (_IWorkerHub *IWorkerHubCaller) GetInferenceInfo(opts *bind.CallOpts, _inferenceId *big.Int) (IWorkerHubInference, error) { var out []interface{} err := _IWorkerHub.contract.Call(opts, &out, "getInferenceInfo", _inferenceId) if err != nil { return *new(IWorkerHubInference), err } out0 := *abi.ConvertType(out[0], new(IWorkerHubInference)).(*IWorkerHubInference) return out0, err } // GetInferenceInfo is a free data retrieval call binding the contract method 0x08c05903. // // Solidity: function getInferenceInfo(uint256 _inferenceId) view returns((uint256[],bytes,uint256,uint256,uint256,address,uint40,uint40,uint40,uint8,address,address,address)) func (_IWorkerHub *IWorkerHubSession) GetInferenceInfo(_inferenceId *big.Int) (IWorkerHubInference, error) { return _IWorkerHub.Contract.GetInferenceInfo(&_IWorkerHub.CallOpts, _inferenceId) } // GetInferenceInfo is a free data retrieval call binding the contract method 0x08c05903. // // Solidity: function getInferenceInfo(uint256 _inferenceId) view returns((uint256[],bytes,uint256,uint256,uint256,address,uint40,uint40,uint40,uint8,address,address,address)) func (_IWorkerHub *IWorkerHubCallerSession) GetInferenceInfo(_inferenceId *big.Int) (IWorkerHubInference, error) { return _IWorkerHub.Contract.GetInferenceInfo(&_IWorkerHub.CallOpts, _inferenceId) } // GetMinFeeToUse is a free data retrieval call binding the contract method 0xafc1fce7. // // Solidity: function getMinFeeToUse(address _modelAddress) view returns(uint256) func (_IWorkerHub *IWorkerHubCaller) GetMinFeeToUse(opts *bind.CallOpts, _modelAddress common.Address) (*big.Int, error) { var out []interface{} err := _IWorkerHub.contract.Call(opts, &out, "getMinFeeToUse", _modelAddress) if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // GetMinFeeToUse is a free data retrieval call binding the contract method 0xafc1fce7. // // Solidity: function getMinFeeToUse(address _modelAddress) view returns(uint256) func (_IWorkerHub *IWorkerHubSession) GetMinFeeToUse(_modelAddress common.Address) (*big.Int, error) { return _IWorkerHub.Contract.GetMinFeeToUse(&_IWorkerHub.CallOpts, _modelAddress) } // GetMinFeeToUse is a free data retrieval call binding the contract method 0xafc1fce7. // // Solidity: function getMinFeeToUse(address _modelAddress) view returns(uint256) func (_IWorkerHub *IWorkerHubCallerSession) GetMinFeeToUse(_modelAddress common.Address) (*big.Int, error) { return _IWorkerHub.Contract.GetMinFeeToUse(&_IWorkerHub.CallOpts, _modelAddress) } // GetMinerAddresses is a free data retrieval call binding the contract method 0xe8d6f2f1. // // Solidity: function getMinerAddresses() view returns(address[]) func (_IWorkerHub *IWorkerHubCaller) GetMinerAddresses(opts *bind.CallOpts) ([]common.Address, error) { var out []interface{} err := _IWorkerHub.contract.Call(opts, &out, "getMinerAddresses") if err != nil { return *new([]common.Address), err } out0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) return out0, err } // GetMinerAddresses is a free data retrieval call binding the contract method 0xe8d6f2f1. // // Solidity: function getMinerAddresses() view returns(address[]) func (_IWorkerHub *IWorkerHubSession) GetMinerAddresses() ([]common.Address, error) { return _IWorkerHub.Contract.GetMinerAddresses(&_IWorkerHub.CallOpts) } // GetMinerAddresses is a free data retrieval call binding the contract method 0xe8d6f2f1. // // Solidity: function getMinerAddresses() view returns(address[]) func (_IWorkerHub *IWorkerHubCallerSession) GetMinerAddresses() ([]common.Address, error) { return _IWorkerHub.Contract.GetMinerAddresses(&_IWorkerHub.CallOpts) } // GetMinerAddressesOfModel is a free data retrieval call binding the contract method 0x47253baa. // // Solidity: function getMinerAddressesOfModel(address _model) view returns(address[]) func (_IWorkerHub *IWorkerHubCaller) GetMinerAddressesOfModel(opts *bind.CallOpts, _model common.Address) ([]common.Address, error) { var out []interface{} err := _IWorkerHub.contract.Call(opts, &out, "getMinerAddressesOfModel", _model) if err != nil { return *new([]common.Address), err } out0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) return out0, err } // GetMinerAddressesOfModel is a free data retrieval call binding the contract method 0x47253baa. // // Solidity: function getMinerAddressesOfModel(address _model) view returns(address[]) func (_IWorkerHub *IWorkerHubSession) GetMinerAddressesOfModel(_model common.Address) ([]common.Address, error) { return _IWorkerHub.Contract.GetMinerAddressesOfModel(&_IWorkerHub.CallOpts, _model) } // GetMinerAddressesOfModel is a free data retrieval call binding the contract method 0x47253baa. // // Solidity: function getMinerAddressesOfModel(address _model) view returns(address[]) func (_IWorkerHub *IWorkerHubCallerSession) GetMinerAddressesOfModel(_model common.Address) ([]common.Address, error) { return _IWorkerHub.Contract.GetMinerAddressesOfModel(&_IWorkerHub.CallOpts, _model) } // GetMiners is a free data retrieval call binding the contract method 0x1633da6e. // // Solidity: function getMiners() view returns((address,uint256,uint256,address,uint40,uint40,uint16)[]) func (_IWorkerHub *IWorkerHubCaller) GetMiners(opts *bind.CallOpts) ([]IWorkerHubWorkerInfo, error) { var out []interface{} err := _IWorkerHub.contract.Call(opts, &out, "getMiners") if err != nil { return *new([]IWorkerHubWorkerInfo), err } out0 := *abi.ConvertType(out[0], new([]IWorkerHubWorkerInfo)).(*[]IWorkerHubWorkerInfo) return out0, err } // GetMiners is a free data retrieval call binding the contract method 0x1633da6e. // // Solidity: function getMiners() view returns((address,uint256,uint256,address,uint40,uint40,uint16)[]) func (_IWorkerHub *IWorkerHubSession) GetMiners() ([]IWorkerHubWorkerInfo, error) { return _IWorkerHub.Contract.GetMiners(&_IWorkerHub.CallOpts) } // GetMiners is a free data retrieval call binding the contract method 0x1633da6e. // // Solidity: function getMiners() view returns((address,uint256,uint256,address,uint40,uint40,uint16)[]) func (_IWorkerHub *IWorkerHubCallerSession) GetMiners() ([]IWorkerHubWorkerInfo, error) { return _IWorkerHub.Contract.GetMiners(&_IWorkerHub.CallOpts) } // GetMintingAssignmentsOfInference is a free data retrieval call binding the contract method 0x5eec7b20. // // Solidity: function getMintingAssignmentsOfInference(uint256 _inferenceId) view returns((uint256,uint256,uint256,bytes,address,address,uint40,uint40,uint40)[]) func (_IWorkerHub *IWorkerHubCaller) GetMintingAssignmentsOfInference(opts *bind.CallOpts, _inferenceId *big.Int) ([]IWorkerHubAssignmentInfo, error) { var out []interface{} err := _IWorkerHub.contract.Call(opts, &out, "getMintingAssignmentsOfInference", _inferenceId) if err != nil { return *new([]IWorkerHubAssignmentInfo), err } out0 := *abi.ConvertType(out[0], new([]IWorkerHubAssignmentInfo)).(*[]IWorkerHubAssignmentInfo) return out0, err } // GetMintingAssignmentsOfInference is a free data retrieval call binding the contract method 0x5eec7b20. // // Solidity: function getMintingAssignmentsOfInference(uint256 _inferenceId) view returns((uint256,uint256,uint256,bytes,address,address,uint40,uint40,uint40)[]) func (_IWorkerHub *IWorkerHubSession) GetMintingAssignmentsOfInference(_inferenceId *big.Int) ([]IWorkerHubAssignmentInfo, error) { return _IWorkerHub.Contract.GetMintingAssignmentsOfInference(&_IWorkerHub.CallOpts, _inferenceId) } // GetMintingAssignmentsOfInference is a free data retrieval call binding the contract method 0x5eec7b20. // // Solidity: function getMintingAssignmentsOfInference(uint256 _inferenceId) view returns((uint256,uint256,uint256,bytes,address,address,uint40,uint40,uint40)[]) func (_IWorkerHub *IWorkerHubCallerSession) GetMintingAssignmentsOfInference(_inferenceId *big.Int) ([]IWorkerHubAssignmentInfo, error) { return _IWorkerHub.Contract.GetMintingAssignmentsOfInference(&_IWorkerHub.CallOpts, _inferenceId) } // GetModelAddresses is a free data retrieval call binding the contract method 0x9ae49cd3. // // Solidity: function getModelAddresses() view returns(address[]) func (_IWorkerHub *IWorkerHubCaller) GetModelAddresses(opts *bind.CallOpts) ([]common.Address, error) { var out []interface{} err := _IWorkerHub.contract.Call(opts, &out, "getModelAddresses") if err != nil { return *new([]common.Address), err } out0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) return out0, err } // GetModelAddresses is a free data retrieval call binding the contract method 0x9ae49cd3. // // Solidity: function getModelAddresses() view returns(address[]) func (_IWorkerHub *IWorkerHubSession) GetModelAddresses() ([]common.Address, error) { return _IWorkerHub.Contract.GetModelAddresses(&_IWorkerHub.CallOpts) } // GetModelAddresses is a free data retrieval call binding the contract method 0x9ae49cd3. // // Solidity: function getModelAddresses() view returns(address[]) func (_IWorkerHub *IWorkerHubCallerSession) GetModelAddresses() ([]common.Address, error) { return _IWorkerHub.Contract.GetModelAddresses(&_IWorkerHub.CallOpts) } // GetNOMiner is a free data retrieval call binding the contract method 0xd2d89be8. // // Solidity: function getNOMiner() view returns(uint256) func (_IWorkerHub *IWorkerHubCaller) GetNOMiner(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} err := _IWorkerHub.contract.Call(opts, &out, "getNOMiner") if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // GetNOMiner is a free data retrieval call binding the contract method 0xd2d89be8. // // Solidity: function getNOMiner() view returns(uint256) func (_IWorkerHub *IWorkerHubSession) GetNOMiner() (*big.Int, error) { return _IWorkerHub.Contract.GetNOMiner(&_IWorkerHub.CallOpts) } // GetNOMiner is a free data retrieval call binding the contract method 0xd2d89be8. // // Solidity: function getNOMiner() view returns(uint256) func (_IWorkerHub *IWorkerHubCallerSession) GetNOMiner() (*big.Int, error) { return _IWorkerHub.Contract.GetNOMiner(&_IWorkerHub.CallOpts) } // GetRoleByAssigmentId is a free data retrieval call binding the contract method 0xca0c80fc. // // Solidity: function getRoleByAssigmentId(uint256 _assignmentId) view returns(uint8) func (_IWorkerHub *IWorkerHubCaller) GetRoleByAssigmentId(opts *bind.CallOpts, _assignmentId *big.Int) (uint8, error) { var out []interface{} err := _IWorkerHub.contract.Call(opts, &out, "getRoleByAssigmentId", _assignmentId) if err != nil { return *new(uint8), err } out0 := *abi.ConvertType(out[0], new(uint8)).(*uint8) return out0, err } // GetRoleByAssigmentId is a free data retrieval call binding the contract method 0xca0c80fc. // // Solidity: function getRoleByAssigmentId(uint256 _assignmentId) view returns(uint8) func (_IWorkerHub *IWorkerHubSession) GetRoleByAssigmentId(_assignmentId *big.Int) (uint8, error) { return _IWorkerHub.Contract.GetRoleByAssigmentId(&_IWorkerHub.CallOpts, _assignmentId) } // GetRoleByAssigmentId is a free data retrieval call binding the contract method 0xca0c80fc. // // Solidity: function getRoleByAssigmentId(uint256 _assignmentId) view returns(uint8) func (_IWorkerHub *IWorkerHubCallerSession) GetRoleByAssigmentId(_assignmentId *big.Int) (uint8, error) { return _IWorkerHub.Contract.GetRoleByAssigmentId(&_IWorkerHub.CallOpts, _assignmentId) } // InferenceNumber is a free data retrieval call binding the contract method 0xf80dca98. // // Solidity: function inferenceNumber() view returns(uint256) func (_IWorkerHub *IWorkerHubCaller) InferenceNumber(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} err := _IWorkerHub.contract.Call(opts, &out, "inferenceNumber") if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // InferenceNumber is a free data retrieval call binding the contract method 0xf80dca98. // // Solidity: function inferenceNumber() view returns(uint256) func (_IWorkerHub *IWorkerHubSession) InferenceNumber() (*big.Int, error) { return _IWorkerHub.Contract.InferenceNumber(&_IWorkerHub.CallOpts) } // InferenceNumber is a free data retrieval call binding the contract method 0xf80dca98. // // Solidity: function inferenceNumber() view returns(uint256) func (_IWorkerHub *IWorkerHubCallerSession) InferenceNumber() (*big.Int, error) { return _IWorkerHub.Contract.InferenceNumber(&_IWorkerHub.CallOpts) } // IsAssignmentPending is a free data retrieval call binding the contract method 0x57a38def. // // Solidity: function isAssignmentPending(uint256 _assignmentId) view returns(bool) func (_IWorkerHub *IWorkerHubCaller) IsAssignmentPending(opts *bind.CallOpts, _assignmentId *big.Int) (bool, error) { var out []interface{} err := _IWorkerHub.contract.Call(opts, &out, "isAssignmentPending", _assignmentId) if err != nil { return *new(bool), err } out0 := *abi.ConvertType(out[0], new(bool)).(*bool) return out0, err } // IsAssignmentPending is a free data retrieval call binding the contract method 0x57a38def. // // Solidity: function isAssignmentPending(uint256 _assignmentId) view returns(bool) func (_IWorkerHub *IWorkerHubSession) IsAssignmentPending(_assignmentId *big.Int) (bool, error) { return _IWorkerHub.Contract.IsAssignmentPending(&_IWorkerHub.CallOpts, _assignmentId) } // IsAssignmentPending is a free data retrieval call binding the contract method 0x57a38def. // // Solidity: function isAssignmentPending(uint256 _assignmentId) view returns(bool) func (_IWorkerHub *IWorkerHubCallerSession) IsAssignmentPending(_assignmentId *big.Int) (bool, error) { return _IWorkerHub.Contract.IsAssignmentPending(&_IWorkerHub.CallOpts, _assignmentId) } // IsReferrer is a free data retrieval call binding the contract method 0xd64d6968. // // Solidity: function isReferrer(address ) view returns(bool) func (_IWorkerHub *IWorkerHubCaller) IsReferrer(opts *bind.CallOpts, arg0 common.Address) (bool, error) { var out []interface{} err := _IWorkerHub.contract.Call(opts, &out, "isReferrer", arg0) if err != nil { return *new(bool), err } out0 := *abi.ConvertType(out[0], new(bool)).(*bool) return out0, err } // IsReferrer is a free data retrieval call binding the contract method 0xd64d6968. // // Solidity: function isReferrer(address ) view returns(bool) func (_IWorkerHub *IWorkerHubSession) IsReferrer(arg0 common.Address) (bool, error) { return _IWorkerHub.Contract.IsReferrer(&_IWorkerHub.CallOpts, arg0) } // IsReferrer is a free data retrieval call binding the contract method 0xd64d6968. // // Solidity: function isReferrer(address ) view returns(bool) func (_IWorkerHub *IWorkerHubCallerSession) IsReferrer(arg0 common.Address) (bool, error) { return _IWorkerHub.Contract.IsReferrer(&_IWorkerHub.CallOpts, arg0) } // L2Owner is a free data retrieval call binding the contract method 0xf003a0c5. // // Solidity: function l2Owner() view returns(address) func (_IWorkerHub *IWorkerHubCaller) L2Owner(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _IWorkerHub.contract.Call(opts, &out, "l2Owner") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // L2Owner is a free data retrieval call binding the contract method 0xf003a0c5. // // Solidity: function l2Owner() view returns(address) func (_IWorkerHub *IWorkerHubSession) L2Owner() (common.Address, error) { return _IWorkerHub.Contract.L2Owner(&_IWorkerHub.CallOpts) } // L2Owner is a free data retrieval call binding the contract method 0xf003a0c5. // // Solidity: function l2Owner() view returns(address) func (_IWorkerHub *IWorkerHubCallerSession) L2Owner() (common.Address, error) { return _IWorkerHub.Contract.L2Owner(&_IWorkerHub.CallOpts) } // LastBlock is a free data retrieval call binding the contract method 0x806b984f. // // Solidity: function lastBlock() view returns(uint256) func (_IWorkerHub *IWorkerHubCaller) LastBlock(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} err := _IWorkerHub.contract.Call(opts, &out, "lastBlock") if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // LastBlock is a free data retrieval call binding the contract method 0x806b984f. // // Solidity: function lastBlock() view returns(uint256) func (_IWorkerHub *IWorkerHubSession) LastBlock() (*big.Int, error) { return _IWorkerHub.Contract.LastBlock(&_IWorkerHub.CallOpts) } // LastBlock is a free data retrieval call binding the contract method 0x806b984f. // // Solidity: function lastBlock() view returns(uint256) func (_IWorkerHub *IWorkerHubCallerSession) LastBlock() (*big.Int, error) { return _IWorkerHub.Contract.LastBlock(&_IWorkerHub.CallOpts) } // MaximumTier is a free data retrieval call binding the contract method 0x0716187f. // // Solidity: function maximumTier() view returns(uint16) func (_IWorkerHub *IWorkerHubCaller) MaximumTier(opts *bind.CallOpts) (uint16, error) { var out []interface{} err := _IWorkerHub.contract.Call(opts, &out, "maximumTier") if err != nil { return *new(uint16), err } out0 := *abi.ConvertType(out[0], new(uint16)).(*uint16) return out0, err } // MaximumTier is a free data retrieval call binding the contract method 0x0716187f. // // Solidity: function maximumTier() view returns(uint16) func (_IWorkerHub *IWorkerHubSession) MaximumTier() (uint16, error) { return _IWorkerHub.Contract.MaximumTier(&_IWorkerHub.CallOpts) } // MaximumTier is a free data retrieval call binding the contract method 0x0716187f. // // Solidity: function maximumTier() view returns(uint16) func (_IWorkerHub *IWorkerHubCallerSession) MaximumTier() (uint16, error) { return _IWorkerHub.Contract.MaximumTier(&_IWorkerHub.CallOpts) } // MinFeeToUse is a free data retrieval call binding the contract method 0x2a1a8ca8. // // Solidity: function minFeeToUse() view returns(uint256) func (_IWorkerHub *IWorkerHubCaller) MinFeeToUse(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} err := _IWorkerHub.contract.Call(opts, &out, "minFeeToUse") if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // MinFeeToUse is a free data retrieval call binding the contract method 0x2a1a8ca8. // // Solidity: function minFeeToUse() view returns(uint256) func (_IWorkerHub *IWorkerHubSession) MinFeeToUse() (*big.Int, error) { return _IWorkerHub.Contract.MinFeeToUse(&_IWorkerHub.CallOpts) } // MinFeeToUse is a free data retrieval call binding the contract method 0x2a1a8ca8. // // Solidity: function minFeeToUse() view returns(uint256) func (_IWorkerHub *IWorkerHubCallerSession) MinFeeToUse() (*big.Int, error) { return _IWorkerHub.Contract.MinFeeToUse(&_IWorkerHub.CallOpts) } // MinerMinimumStake is a free data retrieval call binding the contract method 0x3304f456. // // Solidity: function minerMinimumStake() view returns(uint256) func (_IWorkerHub *IWorkerHubCaller) MinerMinimumStake(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} err := _IWorkerHub.contract.Call(opts, &out, "minerMinimumStake") if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // MinerMinimumStake is a free data retrieval call binding the contract method 0x3304f456. // // Solidity: function minerMinimumStake() view returns(uint256) func (_IWorkerHub *IWorkerHubSession) MinerMinimumStake() (*big.Int, error) { return _IWorkerHub.Contract.MinerMinimumStake(&_IWorkerHub.CallOpts) } // MinerMinimumStake is a free data retrieval call binding the contract method 0x3304f456. // // Solidity: function minerMinimumStake() view returns(uint256) func (_IWorkerHub *IWorkerHubCallerSession) MinerMinimumStake() (*big.Int, error) { return _IWorkerHub.Contract.MinerMinimumStake(&_IWorkerHub.CallOpts) } // MinerRequirement is a free data retrieval call binding the contract method 0xdd9b9766. // // Solidity: function minerRequirement() view returns(uint8) func (_IWorkerHub *IWorkerHubCaller) MinerRequirement(opts *bind.CallOpts) (uint8, error) { var out []interface{} err := _IWorkerHub.contract.Call(opts, &out, "minerRequirement") if err != nil { return *new(uint8), err } out0 := *abi.ConvertType(out[0], new(uint8)).(*uint8) return out0, err } // MinerRequirement is a free data retrieval call binding the contract method 0xdd9b9766. // // Solidity: function minerRequirement() view returns(uint8) func (_IWorkerHub *IWorkerHubSession) MinerRequirement() (uint8, error) { return _IWorkerHub.Contract.MinerRequirement(&_IWorkerHub.CallOpts) } // MinerRequirement is a free data retrieval call binding the contract method 0xdd9b9766. // // Solidity: function minerRequirement() view returns(uint8) func (_IWorkerHub *IWorkerHubCallerSession) MinerRequirement() (uint8, error) { return _IWorkerHub.Contract.MinerRequirement(&_IWorkerHub.CallOpts) } // MinerUnstakeRequests is a free data retrieval call binding the contract method 0x191a54d8. // // Solidity: function minerUnstakeRequests(address ) view returns(uint256 stake, uint40 unlockAt) func (_IWorkerHub *IWorkerHubCaller) MinerUnstakeRequests(opts *bind.CallOpts, arg0 common.Address) (struct { Stake *big.Int UnlockAt *big.Int }, error) { var out []interface{} err := _IWorkerHub.contract.Call(opts, &out, "minerUnstakeRequests", arg0) outstruct := new(struct { Stake *big.Int UnlockAt *big.Int }) if err != nil { return *outstruct, err } outstruct.Stake = *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) outstruct.UnlockAt = *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) return *outstruct, err } // MinerUnstakeRequests is a free data retrieval call binding the contract method 0x191a54d8. // // Solidity: function minerUnstakeRequests(address ) view returns(uint256 stake, uint40 unlockAt) func (_IWorkerHub *IWorkerHubSession) MinerUnstakeRequests(arg0 common.Address) (struct { Stake *big.Int UnlockAt *big.Int }, error) { return _IWorkerHub.Contract.MinerUnstakeRequests(&_IWorkerHub.CallOpts, arg0) } // MinerUnstakeRequests is a free data retrieval call binding the contract method 0x191a54d8. // // Solidity: function minerUnstakeRequests(address ) view returns(uint256 stake, uint40 unlockAt) func (_IWorkerHub *IWorkerHubCallerSession) MinerUnstakeRequests(arg0 common.Address) (struct { Stake *big.Int UnlockAt *big.Int }, error) { return _IWorkerHub.Contract.MinerUnstakeRequests(&_IWorkerHub.CallOpts, arg0) } // Miners is a free data retrieval call binding the contract method 0x648ec7b9. // // Solidity: function miners(address ) view returns(uint256 stake, uint256 commitment, address modelAddress, uint40 lastClaimedEpoch, uint40 activeTime, uint16 tier) func (_IWorkerHub *IWorkerHubCaller) Miners(opts *bind.CallOpts, arg0 common.Address) (struct { Stake *big.Int Commitment *big.Int ModelAddress common.Address LastClaimedEpoch *big.Int ActiveTime *big.Int Tier uint16 }, error) { var out []interface{} err := _IWorkerHub.contract.Call(opts, &out, "miners", arg0) outstruct := new(struct { Stake *big.Int Commitment *big.Int ModelAddress common.Address LastClaimedEpoch *big.Int ActiveTime *big.Int Tier uint16 }) if err != nil { return *outstruct, err } outstruct.Stake = *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) outstruct.Commitment = *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) outstruct.ModelAddress = *abi.ConvertType(out[2], new(common.Address)).(*common.Address) outstruct.LastClaimedEpoch = *abi.ConvertType(out[3], new(*big.Int)).(**big.Int) outstruct.ActiveTime = *abi.ConvertType(out[4], new(*big.Int)).(**big.Int) outstruct.Tier = *abi.ConvertType(out[5], new(uint16)).(*uint16) return *outstruct, err } // Miners is a free data retrieval call binding the contract method 0x648ec7b9. // // Solidity: function miners(address ) view returns(uint256 stake, uint256 commitment, address modelAddress, uint40 lastClaimedEpoch, uint40 activeTime, uint16 tier) func (_IWorkerHub *IWorkerHubSession) Miners(arg0 common.Address) (struct { Stake *big.Int Commitment *big.Int ModelAddress common.Address LastClaimedEpoch *big.Int ActiveTime *big.Int Tier uint16 }, error) { return _IWorkerHub.Contract.Miners(&_IWorkerHub.CallOpts, arg0) } // Miners is a free data retrieval call binding the contract method 0x648ec7b9. // // Solidity: function miners(address ) view returns(uint256 stake, uint256 commitment, address modelAddress, uint40 lastClaimedEpoch, uint40 activeTime, uint16 tier) func (_IWorkerHub *IWorkerHubCallerSession) Miners(arg0 common.Address) (struct { Stake *big.Int Commitment *big.Int ModelAddress common.Address LastClaimedEpoch *big.Int ActiveTime *big.Int Tier uint16 }, error) { return _IWorkerHub.Contract.Miners(&_IWorkerHub.CallOpts, arg0) } // ModelScoring is a free data retrieval call binding the contract method 0xfe0503c0. // // Solidity: function modelScoring() view returns(address) func (_IWorkerHub *IWorkerHubCaller) ModelScoring(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _IWorkerHub.contract.Call(opts, &out, "modelScoring") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // ModelScoring is a free data retrieval call binding the contract method 0xfe0503c0. // // Solidity: function modelScoring() view returns(address) func (_IWorkerHub *IWorkerHubSession) ModelScoring() (common.Address, error) { return _IWorkerHub.Contract.ModelScoring(&_IWorkerHub.CallOpts) } // ModelScoring is a free data retrieval call binding the contract method 0xfe0503c0. // // Solidity: function modelScoring() view returns(address) func (_IWorkerHub *IWorkerHubCallerSession) ModelScoring() (common.Address, error) { return _IWorkerHub.Contract.ModelScoring(&_IWorkerHub.CallOpts) } // Models is a free data retrieval call binding the contract method 0x54917f83. // // Solidity: function models(address ) view returns(uint256 minimumFee, uint32 tier) func (_IWorkerHub *IWorkerHubCaller) Models(opts *bind.CallOpts, arg0 common.Address) (struct { MinimumFee *big.Int Tier uint32 }, error) { var out []interface{} err := _IWorkerHub.contract.Call(opts, &out, "models", arg0) outstruct := new(struct { MinimumFee *big.Int Tier uint32 }) if err != nil { return *outstruct, err } outstruct.MinimumFee = *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) outstruct.Tier = *abi.ConvertType(out[1], new(uint32)).(*uint32) return *outstruct, err } // Models is a free data retrieval call binding the contract method 0x54917f83. // // Solidity: function models(address ) view returns(uint256 minimumFee, uint32 tier) func (_IWorkerHub *IWorkerHubSession) Models(arg0 common.Address) (struct { MinimumFee *big.Int Tier uint32 }, error) { return _IWorkerHub.Contract.Models(&_IWorkerHub.CallOpts, arg0) } // Models is a free data retrieval call binding the contract method 0x54917f83. // // Solidity: function models(address ) view returns(uint256 minimumFee, uint32 tier) func (_IWorkerHub *IWorkerHubCallerSession) Models(arg0 common.Address) (struct { MinimumFee *big.Int Tier uint32 }, error) { return _IWorkerHub.Contract.Models(&_IWorkerHub.CallOpts, arg0) } // Multiplier is a free data retrieval call binding the contract method 0xa9b3f8b7. // // Solidity: function multiplier(address _miner) view returns(uint256) func (_IWorkerHub *IWorkerHubCaller) Multiplier(opts *bind.CallOpts, _miner common.Address) (*big.Int, error) { var out []interface{} err := _IWorkerHub.contract.Call(opts, &out, "multiplier", _miner) if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // Multiplier is a free data retrieval call binding the contract method 0xa9b3f8b7. // // Solidity: function multiplier(address _miner) view returns(uint256) func (_IWorkerHub *IWorkerHubSession) Multiplier(_miner common.Address) (*big.Int, error) { return _IWorkerHub.Contract.Multiplier(&_IWorkerHub.CallOpts, _miner) } // Multiplier is a free data retrieval call binding the contract method 0xa9b3f8b7. // // Solidity: function multiplier(address _miner) view returns(uint256) func (_IWorkerHub *IWorkerHubCallerSession) Multiplier(_miner common.Address) (*big.Int, error) { return _IWorkerHub.Contract.Multiplier(&_IWorkerHub.CallOpts, _miner) } // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. // // Solidity: function owner() view returns(address) func (_IWorkerHub *IWorkerHubCaller) Owner(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _IWorkerHub.contract.Call(opts, &out, "owner") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. // // Solidity: function owner() view returns(address) func (_IWorkerHub *IWorkerHubSession) Owner() (common.Address, error) { return _IWorkerHub.Contract.Owner(&_IWorkerHub.CallOpts) } // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. // // Solidity: function owner() view returns(address) func (_IWorkerHub *IWorkerHubCallerSession) Owner() (common.Address, error) { return _IWorkerHub.Contract.Owner(&_IWorkerHub.CallOpts) } // Paused is a free data retrieval call binding the contract method 0x5c975abb. // // Solidity: function paused() view returns(bool) func (_IWorkerHub *IWorkerHubCaller) Paused(opts *bind.CallOpts) (bool, error) { var out []interface{} err := _IWorkerHub.contract.Call(opts, &out, "paused") if err != nil { return *new(bool), err } out0 := *abi.ConvertType(out[0], new(bool)).(*bool) return out0, err } // Paused is a free data retrieval call binding the contract method 0x5c975abb. // // Solidity: function paused() view returns(bool) func (_IWorkerHub *IWorkerHubSession) Paused() (bool, error) { return _IWorkerHub.Contract.Paused(&_IWorkerHub.CallOpts) } // Paused is a free data retrieval call binding the contract method 0x5c975abb. // // Solidity: function paused() view returns(bool) func (_IWorkerHub *IWorkerHubCallerSession) Paused() (bool, error) { return _IWorkerHub.Contract.Paused(&_IWorkerHub.CallOpts) } // PenaltyDuration is a free data retrieval call binding the contract method 0x5aa1326c. // // Solidity: function penaltyDuration() view returns(uint40) func (_IWorkerHub *IWorkerHubCaller) PenaltyDuration(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} err := _IWorkerHub.contract.Call(opts, &out, "penaltyDuration") if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // PenaltyDuration is a free data retrieval call binding the contract method 0x5aa1326c. // // Solidity: function penaltyDuration() view returns(uint40) func (_IWorkerHub *IWorkerHubSession) PenaltyDuration() (*big.Int, error) { return _IWorkerHub.Contract.PenaltyDuration(&_IWorkerHub.CallOpts) } // PenaltyDuration is a free data retrieval call binding the contract method 0x5aa1326c. // // Solidity: function penaltyDuration() view returns(uint40) func (_IWorkerHub *IWorkerHubCallerSession) PenaltyDuration() (*big.Int, error) { return _IWorkerHub.Contract.PenaltyDuration(&_IWorkerHub.CallOpts) } // RevealDuration is a free data retrieval call binding the contract method 0x886a6de1. // // Solidity: function revealDuration() view returns(uint40) func (_IWorkerHub *IWorkerHubCaller) RevealDuration(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} err := _IWorkerHub.contract.Call(opts, &out, "revealDuration") if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // RevealDuration is a free data retrieval call binding the contract method 0x886a6de1. // // Solidity: function revealDuration() view returns(uint40) func (_IWorkerHub *IWorkerHubSession) RevealDuration() (*big.Int, error) { return _IWorkerHub.Contract.RevealDuration(&_IWorkerHub.CallOpts) } // RevealDuration is a free data retrieval call binding the contract method 0x886a6de1. // // Solidity: function revealDuration() view returns(uint40) func (_IWorkerHub *IWorkerHubCallerSession) RevealDuration() (*big.Int, error) { return _IWorkerHub.Contract.RevealDuration(&_IWorkerHub.CallOpts) } // RewardInEpoch is a free data retrieval call binding the contract method 0x652ff159. // // Solidity: function rewardInEpoch(uint256 ) view returns(uint256 perfReward, uint256 epochReward, uint256 totalTaskCompleted, uint256 totalMiner) func (_IWorkerHub *IWorkerHubCaller) RewardInEpoch(opts *bind.CallOpts, arg0 *big.Int) (struct { PerfReward *big.Int EpochReward *big.Int TotalTaskCompleted *big.Int TotalMiner *big.Int }, error) { var out []interface{} err := _IWorkerHub.contract.Call(opts, &out, "rewardInEpoch", arg0) outstruct := new(struct { PerfReward *big.Int EpochReward *big.Int TotalTaskCompleted *big.Int TotalMiner *big.Int }) if err != nil { return *outstruct, err } outstruct.PerfReward = *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) outstruct.EpochReward = *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) outstruct.TotalTaskCompleted = *abi.ConvertType(out[2], new(*big.Int)).(**big.Int) outstruct.TotalMiner = *abi.ConvertType(out[3], new(*big.Int)).(**big.Int) return *outstruct, err } // RewardInEpoch is a free data retrieval call binding the contract method 0x652ff159. // // Solidity: function rewardInEpoch(uint256 ) view returns(uint256 perfReward, uint256 epochReward, uint256 totalTaskCompleted, uint256 totalMiner) func (_IWorkerHub *IWorkerHubSession) RewardInEpoch(arg0 *big.Int) (struct { PerfReward *big.Int EpochReward *big.Int TotalTaskCompleted *big.Int TotalMiner *big.Int }, error) { return _IWorkerHub.Contract.RewardInEpoch(&_IWorkerHub.CallOpts, arg0) } // RewardInEpoch is a free data retrieval call binding the contract method 0x652ff159. // // Solidity: function rewardInEpoch(uint256 ) view returns(uint256 perfReward, uint256 epochReward, uint256 totalTaskCompleted, uint256 totalMiner) func (_IWorkerHub *IWorkerHubCallerSession) RewardInEpoch(arg0 *big.Int) (struct { PerfReward *big.Int EpochReward *big.Int TotalTaskCompleted *big.Int TotalMiner *big.Int }, error) { return _IWorkerHub.Contract.RewardInEpoch(&_IWorkerHub.CallOpts, arg0) } // RewardPerEpoch is a free data retrieval call binding the contract method 0x84449a9d. // // Solidity: function rewardPerEpoch() view returns(uint256) func (_IWorkerHub *IWorkerHubCaller) RewardPerEpoch(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} err := _IWorkerHub.contract.Call(opts, &out, "rewardPerEpoch") if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // RewardPerEpoch is a free data retrieval call binding the contract method 0x84449a9d. // // Solidity: function rewardPerEpoch() view returns(uint256) func (_IWorkerHub *IWorkerHubSession) RewardPerEpoch() (*big.Int, error) { return _IWorkerHub.Contract.RewardPerEpoch(&_IWorkerHub.CallOpts) } // RewardPerEpoch is a free data retrieval call binding the contract method 0x84449a9d. // // Solidity: function rewardPerEpoch() view returns(uint256) func (_IWorkerHub *IWorkerHubCallerSession) RewardPerEpoch() (*big.Int, error) { return _IWorkerHub.Contract.RewardPerEpoch(&_IWorkerHub.CallOpts) } // SubmitDuration is a free data retrieval call binding the contract method 0xcc56b6f8. // // Solidity: function submitDuration() view returns(uint40) func (_IWorkerHub *IWorkerHubCaller) SubmitDuration(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} err := _IWorkerHub.contract.Call(opts, &out, "submitDuration") if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // SubmitDuration is a free data retrieval call binding the contract method 0xcc56b6f8. // // Solidity: function submitDuration() view returns(uint40) func (_IWorkerHub *IWorkerHubSession) SubmitDuration() (*big.Int, error) { return _IWorkerHub.Contract.SubmitDuration(&_IWorkerHub.CallOpts) } // SubmitDuration is a free data retrieval call binding the contract method 0xcc56b6f8. // // Solidity: function submitDuration() view returns(uint40) func (_IWorkerHub *IWorkerHubCallerSession) SubmitDuration() (*big.Int, error) { return _IWorkerHub.Contract.SubmitDuration(&_IWorkerHub.CallOpts) } // Treasury is a free data retrieval call binding the contract method 0x61d027b3. // // Solidity: function treasury() view returns(address) func (_IWorkerHub *IWorkerHubCaller) Treasury(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _IWorkerHub.contract.Call(opts, &out, "treasury") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // Treasury is a free data retrieval call binding the contract method 0x61d027b3. // // Solidity: function treasury() view returns(address) func (_IWorkerHub *IWorkerHubSession) Treasury() (common.Address, error) { return _IWorkerHub.Contract.Treasury(&_IWorkerHub.CallOpts) } // Treasury is a free data retrieval call binding the contract method 0x61d027b3. // // Solidity: function treasury() view returns(address) func (_IWorkerHub *IWorkerHubCallerSession) Treasury() (common.Address, error) { return _IWorkerHub.Contract.Treasury(&_IWorkerHub.CallOpts) } // UnstakeDelayTime is a free data retrieval call binding the contract method 0xe4fefd65. // // Solidity: function unstakeDelayTime() view returns(uint40) func (_IWorkerHub *IWorkerHubCaller) UnstakeDelayTime(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} err := _IWorkerHub.contract.Call(opts, &out, "unstakeDelayTime") if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // UnstakeDelayTime is a free data retrieval call binding the contract method 0xe4fefd65. // // Solidity: function unstakeDelayTime() view returns(uint40) func (_IWorkerHub *IWorkerHubSession) UnstakeDelayTime() (*big.Int, error) { return _IWorkerHub.Contract.UnstakeDelayTime(&_IWorkerHub.CallOpts) } // UnstakeDelayTime is a free data retrieval call binding the contract method 0xe4fefd65. // // Solidity: function unstakeDelayTime() view returns(uint40) func (_IWorkerHub *IWorkerHubCallerSession) UnstakeDelayTime() (*big.Int, error) { return _IWorkerHub.Contract.UnstakeDelayTime(&_IWorkerHub.CallOpts) } // ValidateDAOSupplyIncrease is a free data retrieval call binding the contract method 0xd7acb1ea. // // Solidity: function validateDAOSupplyIncrease(bool _isReferred) view returns(bool notReachedLimit) func (_IWorkerHub *IWorkerHubCaller) ValidateDAOSupplyIncrease(opts *bind.CallOpts, _isReferred bool) (bool, error) { var out []interface{} err := _IWorkerHub.contract.Call(opts, &out, "validateDAOSupplyIncrease", _isReferred) if err != nil { return *new(bool), err } out0 := *abi.ConvertType(out[0], new(bool)).(*bool) return out0, err } // ValidateDAOSupplyIncrease is a free data retrieval call binding the contract method 0xd7acb1ea. // // Solidity: function validateDAOSupplyIncrease(bool _isReferred) view returns(bool notReachedLimit) func (_IWorkerHub *IWorkerHubSession) ValidateDAOSupplyIncrease(_isReferred bool) (bool, error) { return _IWorkerHub.Contract.ValidateDAOSupplyIncrease(&_IWorkerHub.CallOpts, _isReferred) } // ValidateDAOSupplyIncrease is a free data retrieval call binding the contract method 0xd7acb1ea. // // Solidity: function validateDAOSupplyIncrease(bool _isReferred) view returns(bool notReachedLimit) func (_IWorkerHub *IWorkerHubCallerSession) ValidateDAOSupplyIncrease(_isReferred bool) (bool, error) { return _IWorkerHub.Contract.ValidateDAOSupplyIncrease(&_IWorkerHub.CallOpts, _isReferred) } // Version is a free data retrieval call binding the contract method 0x54fd4d50. // // Solidity: function version() pure returns(string) func (_IWorkerHub *IWorkerHubCaller) Version(opts *bind.CallOpts) (string, error) { var out []interface{} err := _IWorkerHub.contract.Call(opts, &out, "version") if err != nil { return *new(string), err } out0 := *abi.ConvertType(out[0], new(string)).(*string) return out0, err } // Version is a free data retrieval call binding the contract method 0x54fd4d50. // // Solidity: function version() pure returns(string) func (_IWorkerHub *IWorkerHubSession) Version() (string, error) { return _IWorkerHub.Contract.Version(&_IWorkerHub.CallOpts) } // Version is a free data retrieval call binding the contract method 0x54fd4d50. // // Solidity: function version() pure returns(string) func (_IWorkerHub *IWorkerHubCallerSession) Version() (string, error) { return _IWorkerHub.Contract.Version(&_IWorkerHub.CallOpts) } // VotingInfo is a free data retrieval call binding the contract method 0xe5309a66. // // Solidity: function votingInfo(uint256 inferId) view returns(uint8 totalCommit, uint8 totalReveal) func (_IWorkerHub *IWorkerHubCaller) VotingInfo(opts *bind.CallOpts, inferId *big.Int) (struct { TotalCommit uint8 TotalReveal uint8 }, error) { var out []interface{} err := _IWorkerHub.contract.Call(opts, &out, "votingInfo", inferId) outstruct := new(struct { TotalCommit uint8 TotalReveal uint8 }) if err != nil { return *outstruct, err } outstruct.TotalCommit = *abi.ConvertType(out[0], new(uint8)).(*uint8) outstruct.TotalReveal = *abi.ConvertType(out[1], new(uint8)).(*uint8) return *outstruct, err } // VotingInfo is a free data retrieval call binding the contract method 0xe5309a66. // // Solidity: function votingInfo(uint256 inferId) view returns(uint8 totalCommit, uint8 totalReveal) func (_IWorkerHub *IWorkerHubSession) VotingInfo(inferId *big.Int) (struct { TotalCommit uint8 TotalReveal uint8 }, error) { return _IWorkerHub.Contract.VotingInfo(&_IWorkerHub.CallOpts, inferId) } // VotingInfo is a free data retrieval call binding the contract method 0xe5309a66. // // Solidity: function votingInfo(uint256 inferId) view returns(uint8 totalCommit, uint8 totalReveal) func (_IWorkerHub *IWorkerHubCallerSession) VotingInfo(inferId *big.Int) (struct { TotalCommit uint8 TotalReveal uint8 }, error) { return _IWorkerHub.Contract.VotingInfo(&_IWorkerHub.CallOpts, inferId) } // WEAI is a free data retrieval call binding the contract method 0x0dc7df53. // // Solidity: function wEAI() view returns(address) func (_IWorkerHub *IWorkerHubCaller) WEAI(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _IWorkerHub.contract.Call(opts, &out, "wEAI") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // WEAI is a free data retrieval call binding the contract method 0x0dc7df53. // // Solidity: function wEAI() view returns(address) func (_IWorkerHub *IWorkerHubSession) WEAI() (common.Address, error) { return _IWorkerHub.Contract.WEAI(&_IWorkerHub.CallOpts) } // WEAI is a free data retrieval call binding the contract method 0x0dc7df53. // // Solidity: function wEAI() view returns(address) func (_IWorkerHub *IWorkerHubCallerSession) WEAI() (common.Address, error) { return _IWorkerHub.Contract.WEAI(&_IWorkerHub.CallOpts) } // WorkerHubScoring is a free data retrieval call binding the contract method 0x2b426301. // // Solidity: function workerHubScoring() view returns(address) func (_IWorkerHub *IWorkerHubCaller) WorkerHubScoring(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _IWorkerHub.contract.Call(opts, &out, "workerHubScoring") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // WorkerHubScoring is a free data retrieval call binding the contract method 0x2b426301. // // Solidity: function workerHubScoring() view returns(address) func (_IWorkerHub *IWorkerHubSession) WorkerHubScoring() (common.Address, error) { return _IWorkerHub.Contract.WorkerHubScoring(&_IWorkerHub.CallOpts) } // WorkerHubScoring is a free data retrieval call binding the contract method 0x2b426301. // // Solidity: function workerHubScoring() view returns(address) func (_IWorkerHub *IWorkerHubCallerSession) WorkerHubScoring() (common.Address, error) { return _IWorkerHub.Contract.WorkerHubScoring(&_IWorkerHub.CallOpts) } // ClaimReward is a paid mutator transaction binding the contract method 0xd279c191. // // Solidity: function claimReward(address _miner) returns() func (_IWorkerHub *IWorkerHubTransactor) ClaimReward(opts *bind.TransactOpts, _miner common.Address) (*types.Transaction, error) { return _IWorkerHub.contract.Transact(opts, "claimReward", _miner) } // ClaimReward is a paid mutator transaction binding the contract method 0xd279c191. // // Solidity: function claimReward(address _miner) returns() func (_IWorkerHub *IWorkerHubSession) ClaimReward(_miner common.Address) (*types.Transaction, error) { return _IWorkerHub.Contract.ClaimReward(&_IWorkerHub.TransactOpts, _miner) } // ClaimReward is a paid mutator transaction binding the contract method 0xd279c191. // // Solidity: function claimReward(address _miner) returns() func (_IWorkerHub *IWorkerHubTransactorSession) ClaimReward(_miner common.Address) (*types.Transaction, error) { return _IWorkerHub.Contract.ClaimReward(&_IWorkerHub.TransactOpts, _miner) } // Commit is a paid mutator transaction binding the contract method 0xf2f03877. // // Solidity: function commit(uint256 _assignId, bytes32 _commitment) returns() func (_IWorkerHub *IWorkerHubTransactor) Commit(opts *bind.TransactOpts, _assignId *big.Int, _commitment [32]byte) (*types.Transaction, error) { return _IWorkerHub.contract.Transact(opts, "commit", _assignId, _commitment) } // Commit is a paid mutator transaction binding the contract method 0xf2f03877. // // Solidity: function commit(uint256 _assignId, bytes32 _commitment) returns() func (_IWorkerHub *IWorkerHubSession) Commit(_assignId *big.Int, _commitment [32]byte) (*types.Transaction, error) { return _IWorkerHub.Contract.Commit(&_IWorkerHub.TransactOpts, _assignId, _commitment) } // Commit is a paid mutator transaction binding the contract method 0xf2f03877. // // Solidity: function commit(uint256 _assignId, bytes32 _commitment) returns() func (_IWorkerHub *IWorkerHubTransactorSession) Commit(_assignId *big.Int, _commitment [32]byte) (*types.Transaction, error) { return _IWorkerHub.Contract.Commit(&_IWorkerHub.TransactOpts, _assignId, _commitment) } // ForceChangeModelForMiner is a paid mutator transaction binding the contract method 0x339d0f78. // // Solidity: function forceChangeModelForMiner(address _miner, address _modelAddress) returns() func (_IWorkerHub *IWorkerHubTransactor) ForceChangeModelForMiner(opts *bind.TransactOpts, _miner common.Address, _modelAddress common.Address) (*types.Transaction, error) { return _IWorkerHub.contract.Transact(opts, "forceChangeModelForMiner", _miner, _modelAddress) } // ForceChangeModelForMiner is a paid mutator transaction binding the contract method 0x339d0f78. // // Solidity: function forceChangeModelForMiner(address _miner, address _modelAddress) returns() func (_IWorkerHub *IWorkerHubSession) ForceChangeModelForMiner(_miner common.Address, _modelAddress common.Address) (*types.Transaction, error) { return _IWorkerHub.Contract.ForceChangeModelForMiner(&_IWorkerHub.TransactOpts, _miner, _modelAddress) } // ForceChangeModelForMiner is a paid mutator transaction binding the contract method 0x339d0f78. // // Solidity: function forceChangeModelForMiner(address _miner, address _modelAddress) returns() func (_IWorkerHub *IWorkerHubTransactorSession) ForceChangeModelForMiner(_miner common.Address, _modelAddress common.Address) (*types.Transaction, error) { return _IWorkerHub.Contract.ForceChangeModelForMiner(&_IWorkerHub.TransactOpts, _miner, _modelAddress) } // IncreaseMinerStake is a paid mutator transaction binding the contract method 0xb1d1a56b. // // Solidity: function increaseMinerStake(uint256 wEAIAmt) returns() func (_IWorkerHub *IWorkerHubTransactor) IncreaseMinerStake(opts *bind.TransactOpts, wEAIAmt *big.Int) (*types.Transaction, error) { return _IWorkerHub.contract.Transact(opts, "increaseMinerStake", wEAIAmt) } // IncreaseMinerStake is a paid mutator transaction binding the contract method 0xb1d1a56b. // // Solidity: function increaseMinerStake(uint256 wEAIAmt) returns() func (_IWorkerHub *IWorkerHubSession) IncreaseMinerStake(wEAIAmt *big.Int) (*types.Transaction, error) { return _IWorkerHub.Contract.IncreaseMinerStake(&_IWorkerHub.TransactOpts, wEAIAmt) } // IncreaseMinerStake is a paid mutator transaction binding the contract method 0xb1d1a56b. // // Solidity: function increaseMinerStake(uint256 wEAIAmt) returns() func (_IWorkerHub *IWorkerHubTransactorSession) IncreaseMinerStake(wEAIAmt *big.Int) (*types.Transaction, error) { return _IWorkerHub.Contract.IncreaseMinerStake(&_IWorkerHub.TransactOpts, wEAIAmt) } // Infer is a paid mutator transaction binding the contract method 0xd9844458. // // Solidity: function infer(bytes _input, address _creator) payable returns(uint256) func (_IWorkerHub *IWorkerHubTransactor) Infer(opts *bind.TransactOpts, _input []byte, _creator common.Address) (*types.Transaction, error) { return _IWorkerHub.contract.Transact(opts, "infer", _input, _creator) } // Infer is a paid mutator transaction binding the contract method 0xd9844458. // // Solidity: function infer(bytes _input, address _creator) payable returns(uint256) func (_IWorkerHub *IWorkerHubSession) Infer(_input []byte, _creator common.Address) (*types.Transaction, error) { return _IWorkerHub.Contract.Infer(&_IWorkerHub.TransactOpts, _input, _creator) } // Infer is a paid mutator transaction binding the contract method 0xd9844458. // // Solidity: function infer(bytes _input, address _creator) payable returns(uint256) func (_IWorkerHub *IWorkerHubTransactorSession) Infer(_input []byte, _creator common.Address) (*types.Transaction, error) { return _IWorkerHub.Contract.Infer(&_IWorkerHub.TransactOpts, _input, _creator) } // InferWithCallback is a paid mutator transaction binding the contract method 0xb8cfec3d. // // Solidity: function inferWithCallback(uint256 originInferId, bytes _input, address _creator, address callback) payable returns(uint256 inferenceId) func (_IWorkerHub *IWorkerHubTransactor) InferWithCallback(opts *bind.TransactOpts, originInferId *big.Int, _input []byte, _creator common.Address, callback common.Address) (*types.Transaction, error) { return _IWorkerHub.contract.Transact(opts, "inferWithCallback", originInferId, _input, _creator, callback) } // InferWithCallback is a paid mutator transaction binding the contract method 0xb8cfec3d. // // Solidity: function inferWithCallback(uint256 originInferId, bytes _input, address _creator, address callback) payable returns(uint256 inferenceId) func (_IWorkerHub *IWorkerHubSession) InferWithCallback(originInferId *big.Int, _input []byte, _creator common.Address, callback common.Address) (*types.Transaction, error) { return _IWorkerHub.Contract.InferWithCallback(&_IWorkerHub.TransactOpts, originInferId, _input, _creator, callback) } // InferWithCallback is a paid mutator transaction binding the contract method 0xb8cfec3d. // // Solidity: function inferWithCallback(uint256 originInferId, bytes _input, address _creator, address callback) payable returns(uint256 inferenceId) func (_IWorkerHub *IWorkerHubTransactorSession) InferWithCallback(originInferId *big.Int, _input []byte, _creator common.Address, callback common.Address) (*types.Transaction, error) { return _IWorkerHub.Contract.InferWithCallback(&_IWorkerHub.TransactOpts, originInferId, _input, _creator, callback) } // Initialize is a paid mutator transaction binding the contract method 0xe2f32c82. // // Solidity: function initialize(address _l2Owner, address _treasury, address _daoToken, uint16 _feeL2Percentage, uint16 _feeTreasuryPercentage, uint256 _minerMinimumStake, uint8 _minerRequirement, uint256 _blocksPerEpoch, uint256 _rewardPerEpoch, uint256 _duration, uint16 _finePercentage, uint16 _feeRatioMinerValidor, uint256 _minFeeToUse, uint256 _daoTokenReward, (uint16,uint16,uint16,uint16,uint16) _daoTokenPercentage) returns() func (_IWorkerHub *IWorkerHubTransactor) Initialize(opts *bind.TransactOpts, _l2Owner common.Address, _treasury common.Address, _daoToken common.Address, _feeL2Percentage uint16, _feeTreasuryPercentage uint16, _minerMinimumStake *big.Int, _minerRequirement uint8, _blocksPerEpoch *big.Int, _rewardPerEpoch *big.Int, _duration *big.Int, _finePercentage uint16, _feeRatioMinerValidor uint16, _minFeeToUse *big.Int, _daoTokenReward *big.Int, _daoTokenPercentage IWorkerHubDAOTokenPercentage) (*types.Transaction, error) { return _IWorkerHub.contract.Transact(opts, "initialize", _l2Owner, _treasury, _daoToken, _feeL2Percentage, _feeTreasuryPercentage, _minerMinimumStake, _minerRequirement, _blocksPerEpoch, _rewardPerEpoch, _duration, _finePercentage, _feeRatioMinerValidor, _minFeeToUse, _daoTokenReward, _daoTokenPercentage) } // Initialize is a paid mutator transaction binding the contract method 0xe2f32c82. // // Solidity: function initialize(address _l2Owner, address _treasury, address _daoToken, uint16 _feeL2Percentage, uint16 _feeTreasuryPercentage, uint256 _minerMinimumStake, uint8 _minerRequirement, uint256 _blocksPerEpoch, uint256 _rewardPerEpoch, uint256 _duration, uint16 _finePercentage, uint16 _feeRatioMinerValidor, uint256 _minFeeToUse, uint256 _daoTokenReward, (uint16,uint16,uint16,uint16,uint16) _daoTokenPercentage) returns() func (_IWorkerHub *IWorkerHubSession) Initialize(_l2Owner common.Address, _treasury common.Address, _daoToken common.Address, _feeL2Percentage uint16, _feeTreasuryPercentage uint16, _minerMinimumStake *big.Int, _minerRequirement uint8, _blocksPerEpoch *big.Int, _rewardPerEpoch *big.Int, _duration *big.Int, _finePercentage uint16, _feeRatioMinerValidor uint16, _minFeeToUse *big.Int, _daoTokenReward *big.Int, _daoTokenPercentage IWorkerHubDAOTokenPercentage) (*types.Transaction, error) { return _IWorkerHub.Contract.Initialize(&_IWorkerHub.TransactOpts, _l2Owner, _treasury, _daoToken, _feeL2Percentage, _feeTreasuryPercentage, _minerMinimumStake, _minerRequirement, _blocksPerEpoch, _rewardPerEpoch, _duration, _finePercentage, _feeRatioMinerValidor, _minFeeToUse, _daoTokenReward, _daoTokenPercentage) } // Initialize is a paid mutator transaction binding the contract method 0xe2f32c82. // // Solidity: function initialize(address _l2Owner, address _treasury, address _daoToken, uint16 _feeL2Percentage, uint16 _feeTreasuryPercentage, uint256 _minerMinimumStake, uint8 _minerRequirement, uint256 _blocksPerEpoch, uint256 _rewardPerEpoch, uint256 _duration, uint16 _finePercentage, uint16 _feeRatioMinerValidor, uint256 _minFeeToUse, uint256 _daoTokenReward, (uint16,uint16,uint16,uint16,uint16) _daoTokenPercentage) returns() func (_IWorkerHub *IWorkerHubTransactorSession) Initialize(_l2Owner common.Address, _treasury common.Address, _daoToken common.Address, _feeL2Percentage uint16, _feeTreasuryPercentage uint16, _minerMinimumStake *big.Int, _minerRequirement uint8, _blocksPerEpoch *big.Int, _rewardPerEpoch *big.Int, _duration *big.Int, _finePercentage uint16, _feeRatioMinerValidor uint16, _minFeeToUse *big.Int, _daoTokenReward *big.Int, _daoTokenPercentage IWorkerHubDAOTokenPercentage) (*types.Transaction, error) { return _IWorkerHub.Contract.Initialize(&_IWorkerHub.TransactOpts, _l2Owner, _treasury, _daoToken, _feeL2Percentage, _feeTreasuryPercentage, _minerMinimumStake, _minerRequirement, _blocksPerEpoch, _rewardPerEpoch, _duration, _finePercentage, _feeRatioMinerValidor, _minFeeToUse, _daoTokenReward, _daoTokenPercentage) } // JoinForMinting is a paid mutator transaction binding the contract method 0x1a8ef584. // // Solidity: function joinForMinting() returns() func (_IWorkerHub *IWorkerHubTransactor) JoinForMinting(opts *bind.TransactOpts) (*types.Transaction, error) { return _IWorkerHub.contract.Transact(opts, "joinForMinting") } // JoinForMinting is a paid mutator transaction binding the contract method 0x1a8ef584. // // Solidity: function joinForMinting() returns() func (_IWorkerHub *IWorkerHubSession) JoinForMinting() (*types.Transaction, error) { return _IWorkerHub.Contract.JoinForMinting(&_IWorkerHub.TransactOpts) } // JoinForMinting is a paid mutator transaction binding the contract method 0x1a8ef584. // // Solidity: function joinForMinting() returns() func (_IWorkerHub *IWorkerHubTransactorSession) JoinForMinting() (*types.Transaction, error) { return _IWorkerHub.Contract.JoinForMinting(&_IWorkerHub.TransactOpts) } // Pause is a paid mutator transaction binding the contract method 0x8456cb59. // // Solidity: function pause() returns() func (_IWorkerHub *IWorkerHubTransactor) Pause(opts *bind.TransactOpts) (*types.Transaction, error) { return _IWorkerHub.contract.Transact(opts, "pause") } // Pause is a paid mutator transaction binding the contract method 0x8456cb59. // // Solidity: function pause() returns() func (_IWorkerHub *IWorkerHubSession) Pause() (*types.Transaction, error) { return _IWorkerHub.Contract.Pause(&_IWorkerHub.TransactOpts) } // Pause is a paid mutator transaction binding the contract method 0x8456cb59. // // Solidity: function pause() returns() func (_IWorkerHub *IWorkerHubTransactorSession) Pause() (*types.Transaction, error) { return _IWorkerHub.Contract.Pause(&_IWorkerHub.TransactOpts) } // RegisterMiner is a paid mutator transaction binding the contract method 0x668133e3. // // Solidity: function registerMiner(uint16 tier, uint256 wEAIAmt) returns() func (_IWorkerHub *IWorkerHubTransactor) RegisterMiner(opts *bind.TransactOpts, tier uint16, wEAIAmt *big.Int) (*types.Transaction, error) { return _IWorkerHub.contract.Transact(opts, "registerMiner", tier, wEAIAmt) } // RegisterMiner is a paid mutator transaction binding the contract method 0x668133e3. // // Solidity: function registerMiner(uint16 tier, uint256 wEAIAmt) returns() func (_IWorkerHub *IWorkerHubSession) RegisterMiner(tier uint16, wEAIAmt *big.Int) (*types.Transaction, error) { return _IWorkerHub.Contract.RegisterMiner(&_IWorkerHub.TransactOpts, tier, wEAIAmt) } // RegisterMiner is a paid mutator transaction binding the contract method 0x668133e3. // // Solidity: function registerMiner(uint16 tier, uint256 wEAIAmt) returns() func (_IWorkerHub *IWorkerHubTransactorSession) RegisterMiner(tier uint16, wEAIAmt *big.Int) (*types.Transaction, error) { return _IWorkerHub.Contract.RegisterMiner(&_IWorkerHub.TransactOpts, tier, wEAIAmt) } // RegisterModel is a paid mutator transaction binding the contract method 0xa8d6d3d1. // // Solidity: function registerModel(address _model, uint16 _tier, uint256 _minimumFee) returns() func (_IWorkerHub *IWorkerHubTransactor) RegisterModel(opts *bind.TransactOpts, _model common.Address, _tier uint16, _minimumFee *big.Int) (*types.Transaction, error) { return _IWorkerHub.contract.Transact(opts, "registerModel", _model, _tier, _minimumFee) } // RegisterModel is a paid mutator transaction binding the contract method 0xa8d6d3d1. // // Solidity: function registerModel(address _model, uint16 _tier, uint256 _minimumFee) returns() func (_IWorkerHub *IWorkerHubSession) RegisterModel(_model common.Address, _tier uint16, _minimumFee *big.Int) (*types.Transaction, error) { return _IWorkerHub.Contract.RegisterModel(&_IWorkerHub.TransactOpts, _model, _tier, _minimumFee) } // RegisterModel is a paid mutator transaction binding the contract method 0xa8d6d3d1. // // Solidity: function registerModel(address _model, uint16 _tier, uint256 _minimumFee) returns() func (_IWorkerHub *IWorkerHubTransactorSession) RegisterModel(_model common.Address, _tier uint16, _minimumFee *big.Int) (*types.Transaction, error) { return _IWorkerHub.Contract.RegisterModel(&_IWorkerHub.TransactOpts, _model, _tier, _minimumFee) } // RegisterReferrer is a paid mutator transaction binding the contract method 0x9ea7685a. // // Solidity: function registerReferrer(address _referrer) returns() func (_IWorkerHub *IWorkerHubTransactor) RegisterReferrer(opts *bind.TransactOpts, _referrer common.Address) (*types.Transaction, error) { return _IWorkerHub.contract.Transact(opts, "registerReferrer", _referrer) } // RegisterReferrer is a paid mutator transaction binding the contract method 0x9ea7685a. // // Solidity: function registerReferrer(address _referrer) returns() func (_IWorkerHub *IWorkerHubSession) RegisterReferrer(_referrer common.Address) (*types.Transaction, error) { return _IWorkerHub.Contract.RegisterReferrer(&_IWorkerHub.TransactOpts, _referrer) } // RegisterReferrer is a paid mutator transaction binding the contract method 0x9ea7685a. // // Solidity: function registerReferrer(address _referrer) returns() func (_IWorkerHub *IWorkerHubTransactorSession) RegisterReferrer(_referrer common.Address) (*types.Transaction, error) { return _IWorkerHub.Contract.RegisterReferrer(&_IWorkerHub.TransactOpts, _referrer) } // RegisterReferrer0 is a paid mutator transaction binding the contract method 0xc41bf665. // // Solidity: function registerReferrer(address[] _referrers, address[] _referees) returns() func (_IWorkerHub *IWorkerHubTransactor) RegisterReferrer0(opts *bind.TransactOpts, _referrers []common.Address, _referees []common.Address) (*types.Transaction, error) { return _IWorkerHub.contract.Transact(opts, "registerReferrer0", _referrers, _referees) } // RegisterReferrer0 is a paid mutator transaction binding the contract method 0xc41bf665. // // Solidity: function registerReferrer(address[] _referrers, address[] _referees) returns() func (_IWorkerHub *IWorkerHubSession) RegisterReferrer0(_referrers []common.Address, _referees []common.Address) (*types.Transaction, error) { return _IWorkerHub.Contract.RegisterReferrer0(&_IWorkerHub.TransactOpts, _referrers, _referees) } // RegisterReferrer0 is a paid mutator transaction binding the contract method 0xc41bf665. // // Solidity: function registerReferrer(address[] _referrers, address[] _referees) returns() func (_IWorkerHub *IWorkerHubTransactorSession) RegisterReferrer0(_referrers []common.Address, _referees []common.Address) (*types.Transaction, error) { return _IWorkerHub.Contract.RegisterReferrer0(&_IWorkerHub.TransactOpts, _referrers, _referees) } // RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. // // Solidity: function renounceOwnership() returns() func (_IWorkerHub *IWorkerHubTransactor) RenounceOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { return _IWorkerHub.contract.Transact(opts, "renounceOwnership") } // RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. // // Solidity: function renounceOwnership() returns() func (_IWorkerHub *IWorkerHubSession) RenounceOwnership() (*types.Transaction, error) { return _IWorkerHub.Contract.RenounceOwnership(&_IWorkerHub.TransactOpts) } // RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. // // Solidity: function renounceOwnership() returns() func (_IWorkerHub *IWorkerHubTransactorSession) RenounceOwnership() (*types.Transaction, error) { return _IWorkerHub.Contract.RenounceOwnership(&_IWorkerHub.TransactOpts) } // ResolveInference is a paid mutator transaction binding the contract method 0x6029e786. // // Solidity: function resolveInference(uint256 _inferenceId) returns() func (_IWorkerHub *IWorkerHubTransactor) ResolveInference(opts *bind.TransactOpts, _inferenceId *big.Int) (*types.Transaction, error) { return _IWorkerHub.contract.Transact(opts, "resolveInference", _inferenceId) } // ResolveInference is a paid mutator transaction binding the contract method 0x6029e786. // // Solidity: function resolveInference(uint256 _inferenceId) returns() func (_IWorkerHub *IWorkerHubSession) ResolveInference(_inferenceId *big.Int) (*types.Transaction, error) { return _IWorkerHub.Contract.ResolveInference(&_IWorkerHub.TransactOpts, _inferenceId) } // ResolveInference is a paid mutator transaction binding the contract method 0x6029e786. // // Solidity: function resolveInference(uint256 _inferenceId) returns() func (_IWorkerHub *IWorkerHubTransactorSession) ResolveInference(_inferenceId *big.Int) (*types.Transaction, error) { return _IWorkerHub.Contract.ResolveInference(&_IWorkerHub.TransactOpts, _inferenceId) } // RestakeForMiner is a paid mutator transaction binding the contract method 0x4fb9bc1e. // // Solidity: function restakeForMiner(uint16 tier) returns() func (_IWorkerHub *IWorkerHubTransactor) RestakeForMiner(opts *bind.TransactOpts, tier uint16) (*types.Transaction, error) { return _IWorkerHub.contract.Transact(opts, "restakeForMiner", tier) } // RestakeForMiner is a paid mutator transaction binding the contract method 0x4fb9bc1e. // // Solidity: function restakeForMiner(uint16 tier) returns() func (_IWorkerHub *IWorkerHubSession) RestakeForMiner(tier uint16) (*types.Transaction, error) { return _IWorkerHub.Contract.RestakeForMiner(&_IWorkerHub.TransactOpts, tier) } // RestakeForMiner is a paid mutator transaction binding the contract method 0x4fb9bc1e. // // Solidity: function restakeForMiner(uint16 tier) returns() func (_IWorkerHub *IWorkerHubTransactorSession) RestakeForMiner(tier uint16) (*types.Transaction, error) { return _IWorkerHub.Contract.RestakeForMiner(&_IWorkerHub.TransactOpts, tier) } // ResultReceived is a paid mutator transaction binding the contract method 0xc3477018. // // Solidity: function resultReceived(bytes result) returns() func (_IWorkerHub *IWorkerHubTransactor) ResultReceived(opts *bind.TransactOpts, result []byte) (*types.Transaction, error) { return _IWorkerHub.contract.Transact(opts, "resultReceived", result) } // ResultReceived is a paid mutator transaction binding the contract method 0xc3477018. // // Solidity: function resultReceived(bytes result) returns() func (_IWorkerHub *IWorkerHubSession) ResultReceived(result []byte) (*types.Transaction, error) { return _IWorkerHub.Contract.ResultReceived(&_IWorkerHub.TransactOpts, result) } // ResultReceived is a paid mutator transaction binding the contract method 0xc3477018. // // Solidity: function resultReceived(bytes result) returns() func (_IWorkerHub *IWorkerHubTransactorSession) ResultReceived(result []byte) (*types.Transaction, error) { return _IWorkerHub.Contract.ResultReceived(&_IWorkerHub.TransactOpts, result) } // ResultReceived0 is a paid mutator transaction binding the contract method 0xd2a554e7. // // Solidity: function resultReceived(uint256 _originInferId, bytes _result) returns() func (_IWorkerHub *IWorkerHubTransactor) ResultReceived0(opts *bind.TransactOpts, _originInferId *big.Int, _result []byte) (*types.Transaction, error) { return _IWorkerHub.contract.Transact(opts, "resultReceived0", _originInferId, _result) } // ResultReceived0 is a paid mutator transaction binding the contract method 0xd2a554e7. // // Solidity: function resultReceived(uint256 _originInferId, bytes _result) returns() func (_IWorkerHub *IWorkerHubSession) ResultReceived0(_originInferId *big.Int, _result []byte) (*types.Transaction, error) { return _IWorkerHub.Contract.ResultReceived0(&_IWorkerHub.TransactOpts, _originInferId, _result) } // ResultReceived0 is a paid mutator transaction binding the contract method 0xd2a554e7. // // Solidity: function resultReceived(uint256 _originInferId, bytes _result) returns() func (_IWorkerHub *IWorkerHubTransactorSession) ResultReceived0(_originInferId *big.Int, _result []byte) (*types.Transaction, error) { return _IWorkerHub.Contract.ResultReceived0(&_IWorkerHub.TransactOpts, _originInferId, _result) } // Reveal is a paid mutator transaction binding the contract method 0x121a301d. // // Solidity: function reveal(uint256 _assignId, uint40 _nonce, bytes _data) returns() func (_IWorkerHub *IWorkerHubTransactor) Reveal(opts *bind.TransactOpts, _assignId *big.Int, _nonce *big.Int, _data []byte) (*types.Transaction, error) { return _IWorkerHub.contract.Transact(opts, "reveal", _assignId, _nonce, _data) } // Reveal is a paid mutator transaction binding the contract method 0x121a301d. // // Solidity: function reveal(uint256 _assignId, uint40 _nonce, bytes _data) returns() func (_IWorkerHub *IWorkerHubSession) Reveal(_assignId *big.Int, _nonce *big.Int, _data []byte) (*types.Transaction, error) { return _IWorkerHub.Contract.Reveal(&_IWorkerHub.TransactOpts, _assignId, _nonce, _data) } // Reveal is a paid mutator transaction binding the contract method 0x121a301d. // // Solidity: function reveal(uint256 _assignId, uint40 _nonce, bytes _data) returns() func (_IWorkerHub *IWorkerHubTransactorSession) Reveal(_assignId *big.Int, _nonce *big.Int, _data []byte) (*types.Transaction, error) { return _IWorkerHub.Contract.Reveal(&_IWorkerHub.TransactOpts, _assignId, _nonce, _data) } // RewardToClaim is a paid mutator transaction binding the contract method 0x674a63b9. // // Solidity: function rewardToClaim(address _miner) returns(uint256) func (_IWorkerHub *IWorkerHubTransactor) RewardToClaim(opts *bind.TransactOpts, _miner common.Address) (*types.Transaction, error) { return _IWorkerHub.contract.Transact(opts, "rewardToClaim", _miner) } // RewardToClaim is a paid mutator transaction binding the contract method 0x674a63b9. // // Solidity: function rewardToClaim(address _miner) returns(uint256) func (_IWorkerHub *IWorkerHubSession) RewardToClaim(_miner common.Address) (*types.Transaction, error) { return _IWorkerHub.Contract.RewardToClaim(&_IWorkerHub.TransactOpts, _miner) } // RewardToClaim is a paid mutator transaction binding the contract method 0x674a63b9. // // Solidity: function rewardToClaim(address _miner) returns(uint256) func (_IWorkerHub *IWorkerHubTransactorSession) RewardToClaim(_miner common.Address) (*types.Transaction, error) { return _IWorkerHub.Contract.RewardToClaim(&_IWorkerHub.TransactOpts, _miner) } // SeizeMinerRole is a paid mutator transaction binding the contract method 0xffbc6661. // // Solidity: function seizeMinerRole(uint256 _assignmentId) returns() func (_IWorkerHub *IWorkerHubTransactor) SeizeMinerRole(opts *bind.TransactOpts, _assignmentId *big.Int) (*types.Transaction, error) { return _IWorkerHub.contract.Transact(opts, "seizeMinerRole", _assignmentId) } // SeizeMinerRole is a paid mutator transaction binding the contract method 0xffbc6661. // // Solidity: function seizeMinerRole(uint256 _assignmentId) returns() func (_IWorkerHub *IWorkerHubSession) SeizeMinerRole(_assignmentId *big.Int) (*types.Transaction, error) { return _IWorkerHub.Contract.SeizeMinerRole(&_IWorkerHub.TransactOpts, _assignmentId) } // SeizeMinerRole is a paid mutator transaction binding the contract method 0xffbc6661. // // Solidity: function seizeMinerRole(uint256 _assignmentId) returns() func (_IWorkerHub *IWorkerHubTransactorSession) SeizeMinerRole(_assignmentId *big.Int) (*types.Transaction, error) { return _IWorkerHub.Contract.SeizeMinerRole(&_IWorkerHub.TransactOpts, _assignmentId) } // SetBlocksPerEpoch is a paid mutator transaction binding the contract method 0x034438b0. // // Solidity: function setBlocksPerEpoch(uint256 _blocks) returns() func (_IWorkerHub *IWorkerHubTransactor) SetBlocksPerEpoch(opts *bind.TransactOpts, _blocks *big.Int) (*types.Transaction, error) { return _IWorkerHub.contract.Transact(opts, "setBlocksPerEpoch", _blocks) } // SetBlocksPerEpoch is a paid mutator transaction binding the contract method 0x034438b0. // // Solidity: function setBlocksPerEpoch(uint256 _blocks) returns() func (_IWorkerHub *IWorkerHubSession) SetBlocksPerEpoch(_blocks *big.Int) (*types.Transaction, error) { return _IWorkerHub.Contract.SetBlocksPerEpoch(&_IWorkerHub.TransactOpts, _blocks) } // SetBlocksPerEpoch is a paid mutator transaction binding the contract method 0x034438b0. // // Solidity: function setBlocksPerEpoch(uint256 _blocks) returns() func (_IWorkerHub *IWorkerHubTransactorSession) SetBlocksPerEpoch(_blocks *big.Int) (*types.Transaction, error) { return _IWorkerHub.Contract.SetBlocksPerEpoch(&_IWorkerHub.TransactOpts, _blocks) } // SetCommitDuration is a paid mutator transaction binding the contract method 0x54b18651. // // Solidity: function setCommitDuration(uint40 _newCommitDuration) returns() func (_IWorkerHub *IWorkerHubTransactor) SetCommitDuration(opts *bind.TransactOpts, _newCommitDuration *big.Int) (*types.Transaction, error) { return _IWorkerHub.contract.Transact(opts, "setCommitDuration", _newCommitDuration) } // SetCommitDuration is a paid mutator transaction binding the contract method 0x54b18651. // // Solidity: function setCommitDuration(uint40 _newCommitDuration) returns() func (_IWorkerHub *IWorkerHubSession) SetCommitDuration(_newCommitDuration *big.Int) (*types.Transaction, error) { return _IWorkerHub.Contract.SetCommitDuration(&_IWorkerHub.TransactOpts, _newCommitDuration) } // SetCommitDuration is a paid mutator transaction binding the contract method 0x54b18651. // // Solidity: function setCommitDuration(uint40 _newCommitDuration) returns() func (_IWorkerHub *IWorkerHubTransactorSession) SetCommitDuration(_newCommitDuration *big.Int) (*types.Transaction, error) { return _IWorkerHub.Contract.SetCommitDuration(&_IWorkerHub.TransactOpts, _newCommitDuration) } // SetDAOToken is a paid mutator transaction binding the contract method 0x70a52354. // // Solidity: function setDAOToken(address _daoTokenAddress) returns() func (_IWorkerHub *IWorkerHubTransactor) SetDAOToken(opts *bind.TransactOpts, _daoTokenAddress common.Address) (*types.Transaction, error) { return _IWorkerHub.contract.Transact(opts, "setDAOToken", _daoTokenAddress) } // SetDAOToken is a paid mutator transaction binding the contract method 0x70a52354. // // Solidity: function setDAOToken(address _daoTokenAddress) returns() func (_IWorkerHub *IWorkerHubSession) SetDAOToken(_daoTokenAddress common.Address) (*types.Transaction, error) { return _IWorkerHub.Contract.SetDAOToken(&_IWorkerHub.TransactOpts, _daoTokenAddress) } // SetDAOToken is a paid mutator transaction binding the contract method 0x70a52354. // // Solidity: function setDAOToken(address _daoTokenAddress) returns() func (_IWorkerHub *IWorkerHubTransactorSession) SetDAOToken(_daoTokenAddress common.Address) (*types.Transaction, error) { return _IWorkerHub.Contract.SetDAOToken(&_IWorkerHub.TransactOpts, _daoTokenAddress) } // SetDAOTokenPercentage is a paid mutator transaction binding the contract method 0x3860ce68. // // Solidity: function setDAOTokenPercentage((uint16,uint16,uint16,uint16,uint16) _daoTokenPercentage) returns() func (_IWorkerHub *IWorkerHubTransactor) SetDAOTokenPercentage(opts *bind.TransactOpts, _daoTokenPercentage IWorkerHubDAOTokenPercentage) (*types.Transaction, error) { return _IWorkerHub.contract.Transact(opts, "setDAOTokenPercentage", _daoTokenPercentage) } // SetDAOTokenPercentage is a paid mutator transaction binding the contract method 0x3860ce68. // // Solidity: function setDAOTokenPercentage((uint16,uint16,uint16,uint16,uint16) _daoTokenPercentage) returns() func (_IWorkerHub *IWorkerHubSession) SetDAOTokenPercentage(_daoTokenPercentage IWorkerHubDAOTokenPercentage) (*types.Transaction, error) { return _IWorkerHub.Contract.SetDAOTokenPercentage(&_IWorkerHub.TransactOpts, _daoTokenPercentage) } // SetDAOTokenPercentage is a paid mutator transaction binding the contract method 0x3860ce68. // // Solidity: function setDAOTokenPercentage((uint16,uint16,uint16,uint16,uint16) _daoTokenPercentage) returns() func (_IWorkerHub *IWorkerHubTransactorSession) SetDAOTokenPercentage(_daoTokenPercentage IWorkerHubDAOTokenPercentage) (*types.Transaction, error) { return _IWorkerHub.Contract.SetDAOTokenPercentage(&_IWorkerHub.TransactOpts, _daoTokenPercentage) } // SetDAOTokenReward is a paid mutator transaction binding the contract method 0x76e7ffae. // // Solidity: function setDAOTokenReward(uint256 _newDAOTokenReward) returns() func (_IWorkerHub *IWorkerHubTransactor) SetDAOTokenReward(opts *bind.TransactOpts, _newDAOTokenReward *big.Int) (*types.Transaction, error) { return _IWorkerHub.contract.Transact(opts, "setDAOTokenReward", _newDAOTokenReward) } // SetDAOTokenReward is a paid mutator transaction binding the contract method 0x76e7ffae. // // Solidity: function setDAOTokenReward(uint256 _newDAOTokenReward) returns() func (_IWorkerHub *IWorkerHubSession) SetDAOTokenReward(_newDAOTokenReward *big.Int) (*types.Transaction, error) { return _IWorkerHub.Contract.SetDAOTokenReward(&_IWorkerHub.TransactOpts, _newDAOTokenReward) } // SetDAOTokenReward is a paid mutator transaction binding the contract method 0x76e7ffae. // // Solidity: function setDAOTokenReward(uint256 _newDAOTokenReward) returns() func (_IWorkerHub *IWorkerHubTransactorSession) SetDAOTokenReward(_newDAOTokenReward *big.Int) (*types.Transaction, error) { return _IWorkerHub.Contract.SetDAOTokenReward(&_IWorkerHub.TransactOpts, _newDAOTokenReward) } // SetFeeRatioMinerValidator is a paid mutator transaction binding the contract method 0xafa82609. // // Solidity: function setFeeRatioMinerValidator(uint16 _newRatio) returns() func (_IWorkerHub *IWorkerHubTransactor) SetFeeRatioMinerValidator(opts *bind.TransactOpts, _newRatio uint16) (*types.Transaction, error) { return _IWorkerHub.contract.Transact(opts, "setFeeRatioMinerValidator", _newRatio) } // SetFeeRatioMinerValidator is a paid mutator transaction binding the contract method 0xafa82609. // // Solidity: function setFeeRatioMinerValidator(uint16 _newRatio) returns() func (_IWorkerHub *IWorkerHubSession) SetFeeRatioMinerValidator(_newRatio uint16) (*types.Transaction, error) { return _IWorkerHub.Contract.SetFeeRatioMinerValidator(&_IWorkerHub.TransactOpts, _newRatio) } // SetFeeRatioMinerValidator is a paid mutator transaction binding the contract method 0xafa82609. // // Solidity: function setFeeRatioMinerValidator(uint16 _newRatio) returns() func (_IWorkerHub *IWorkerHubTransactorSession) SetFeeRatioMinerValidator(_newRatio uint16) (*types.Transaction, error) { return _IWorkerHub.Contract.SetFeeRatioMinerValidator(&_IWorkerHub.TransactOpts, _newRatio) } // SetFinePercentage is a paid mutator transaction binding the contract method 0x431a4457. // // Solidity: function setFinePercentage(uint16 _finePercentage) returns() func (_IWorkerHub *IWorkerHubTransactor) SetFinePercentage(opts *bind.TransactOpts, _finePercentage uint16) (*types.Transaction, error) { return _IWorkerHub.contract.Transact(opts, "setFinePercentage", _finePercentage) } // SetFinePercentage is a paid mutator transaction binding the contract method 0x431a4457. // // Solidity: function setFinePercentage(uint16 _finePercentage) returns() func (_IWorkerHub *IWorkerHubSession) SetFinePercentage(_finePercentage uint16) (*types.Transaction, error) { return _IWorkerHub.Contract.SetFinePercentage(&_IWorkerHub.TransactOpts, _finePercentage) } // SetFinePercentage is a paid mutator transaction binding the contract method 0x431a4457. // // Solidity: function setFinePercentage(uint16 _finePercentage) returns() func (_IWorkerHub *IWorkerHubTransactorSession) SetFinePercentage(_finePercentage uint16) (*types.Transaction, error) { return _IWorkerHub.Contract.SetFinePercentage(&_IWorkerHub.TransactOpts, _finePercentage) } // SetL2Owner is a paid mutator transaction binding the contract method 0xb530c110. // // Solidity: function setL2Owner(address _l2OwnerAddress) returns() func (_IWorkerHub *IWorkerHubTransactor) SetL2Owner(opts *bind.TransactOpts, _l2OwnerAddress common.Address) (*types.Transaction, error) { return _IWorkerHub.contract.Transact(opts, "setL2Owner", _l2OwnerAddress) } // SetL2Owner is a paid mutator transaction binding the contract method 0xb530c110. // // Solidity: function setL2Owner(address _l2OwnerAddress) returns() func (_IWorkerHub *IWorkerHubSession) SetL2Owner(_l2OwnerAddress common.Address) (*types.Transaction, error) { return _IWorkerHub.Contract.SetL2Owner(&_IWorkerHub.TransactOpts, _l2OwnerAddress) } // SetL2Owner is a paid mutator transaction binding the contract method 0xb530c110. // // Solidity: function setL2Owner(address _l2OwnerAddress) returns() func (_IWorkerHub *IWorkerHubTransactorSession) SetL2Owner(_l2OwnerAddress common.Address) (*types.Transaction, error) { return _IWorkerHub.Contract.SetL2Owner(&_IWorkerHub.TransactOpts, _l2OwnerAddress) } // SetMinFeeToUse is a paid mutator transaction binding the contract method 0xaf5e3be0. // // Solidity: function setMinFeeToUse(uint256 _minFeeToUse) returns() func (_IWorkerHub *IWorkerHubTransactor) SetMinFeeToUse(opts *bind.TransactOpts, _minFeeToUse *big.Int) (*types.Transaction, error) { return _IWorkerHub.contract.Transact(opts, "setMinFeeToUse", _minFeeToUse) } // SetMinFeeToUse is a paid mutator transaction binding the contract method 0xaf5e3be0. // // Solidity: function setMinFeeToUse(uint256 _minFeeToUse) returns() func (_IWorkerHub *IWorkerHubSession) SetMinFeeToUse(_minFeeToUse *big.Int) (*types.Transaction, error) { return _IWorkerHub.Contract.SetMinFeeToUse(&_IWorkerHub.TransactOpts, _minFeeToUse) } // SetMinFeeToUse is a paid mutator transaction binding the contract method 0xaf5e3be0. // // Solidity: function setMinFeeToUse(uint256 _minFeeToUse) returns() func (_IWorkerHub *IWorkerHubTransactorSession) SetMinFeeToUse(_minFeeToUse *big.Int) (*types.Transaction, error) { return _IWorkerHub.Contract.SetMinFeeToUse(&_IWorkerHub.TransactOpts, _minFeeToUse) } // SetMinerMinimumStake is a paid mutator transaction binding the contract method 0xe69d5b98. // // Solidity: function setMinerMinimumStake(uint256 _minerMinimumStake) returns() func (_IWorkerHub *IWorkerHubTransactor) SetMinerMinimumStake(opts *bind.TransactOpts, _minerMinimumStake *big.Int) (*types.Transaction, error) { return _IWorkerHub.contract.Transact(opts, "setMinerMinimumStake", _minerMinimumStake) } // SetMinerMinimumStake is a paid mutator transaction binding the contract method 0xe69d5b98. // // Solidity: function setMinerMinimumStake(uint256 _minerMinimumStake) returns() func (_IWorkerHub *IWorkerHubSession) SetMinerMinimumStake(_minerMinimumStake *big.Int) (*types.Transaction, error) { return _IWorkerHub.Contract.SetMinerMinimumStake(&_IWorkerHub.TransactOpts, _minerMinimumStake) } // SetMinerMinimumStake is a paid mutator transaction binding the contract method 0xe69d5b98. // // Solidity: function setMinerMinimumStake(uint256 _minerMinimumStake) returns() func (_IWorkerHub *IWorkerHubTransactorSession) SetMinerMinimumStake(_minerMinimumStake *big.Int) (*types.Transaction, error) { return _IWorkerHub.Contract.SetMinerMinimumStake(&_IWorkerHub.TransactOpts, _minerMinimumStake) } // SetNewRewardInEpoch is a paid mutator transaction binding the contract method 0xe32bd90c. // // Solidity: function setNewRewardInEpoch(uint256 _newRewardAmount) returns() func (_IWorkerHub *IWorkerHubTransactor) SetNewRewardInEpoch(opts *bind.TransactOpts, _newRewardAmount *big.Int) (*types.Transaction, error) { return _IWorkerHub.contract.Transact(opts, "setNewRewardInEpoch", _newRewardAmount) } // SetNewRewardInEpoch is a paid mutator transaction binding the contract method 0xe32bd90c. // // Solidity: function setNewRewardInEpoch(uint256 _newRewardAmount) returns() func (_IWorkerHub *IWorkerHubSession) SetNewRewardInEpoch(_newRewardAmount *big.Int) (*types.Transaction, error) { return _IWorkerHub.Contract.SetNewRewardInEpoch(&_IWorkerHub.TransactOpts, _newRewardAmount) } // SetNewRewardInEpoch is a paid mutator transaction binding the contract method 0xe32bd90c. // // Solidity: function setNewRewardInEpoch(uint256 _newRewardAmount) returns() func (_IWorkerHub *IWorkerHubTransactorSession) SetNewRewardInEpoch(_newRewardAmount *big.Int) (*types.Transaction, error) { return _IWorkerHub.Contract.SetNewRewardInEpoch(&_IWorkerHub.TransactOpts, _newRewardAmount) } // SetPenaltyDuration is a paid mutator transaction binding the contract method 0x885b050f. // // Solidity: function setPenaltyDuration(uint40 _penaltyDuration) returns() func (_IWorkerHub *IWorkerHubTransactor) SetPenaltyDuration(opts *bind.TransactOpts, _penaltyDuration *big.Int) (*types.Transaction, error) { return _IWorkerHub.contract.Transact(opts, "setPenaltyDuration", _penaltyDuration) } // SetPenaltyDuration is a paid mutator transaction binding the contract method 0x885b050f. // // Solidity: function setPenaltyDuration(uint40 _penaltyDuration) returns() func (_IWorkerHub *IWorkerHubSession) SetPenaltyDuration(_penaltyDuration *big.Int) (*types.Transaction, error) { return _IWorkerHub.Contract.SetPenaltyDuration(&_IWorkerHub.TransactOpts, _penaltyDuration) } // SetPenaltyDuration is a paid mutator transaction binding the contract method 0x885b050f. // // Solidity: function setPenaltyDuration(uint40 _penaltyDuration) returns() func (_IWorkerHub *IWorkerHubTransactorSession) SetPenaltyDuration(_penaltyDuration *big.Int) (*types.Transaction, error) { return _IWorkerHub.Contract.SetPenaltyDuration(&_IWorkerHub.TransactOpts, _penaltyDuration) } // SetRevealDuration is a paid mutator transaction binding the contract method 0x1eb9a99a. // // Solidity: function setRevealDuration(uint40 _newRevealDuration) returns() func (_IWorkerHub *IWorkerHubTransactor) SetRevealDuration(opts *bind.TransactOpts, _newRevealDuration *big.Int) (*types.Transaction, error) { return _IWorkerHub.contract.Transact(opts, "setRevealDuration", _newRevealDuration) } // SetRevealDuration is a paid mutator transaction binding the contract method 0x1eb9a99a. // // Solidity: function setRevealDuration(uint40 _newRevealDuration) returns() func (_IWorkerHub *IWorkerHubSession) SetRevealDuration(_newRevealDuration *big.Int) (*types.Transaction, error) { return _IWorkerHub.Contract.SetRevealDuration(&_IWorkerHub.TransactOpts, _newRevealDuration) } // SetRevealDuration is a paid mutator transaction binding the contract method 0x1eb9a99a. // // Solidity: function setRevealDuration(uint40 _newRevealDuration) returns() func (_IWorkerHub *IWorkerHubTransactorSession) SetRevealDuration(_newRevealDuration *big.Int) (*types.Transaction, error) { return _IWorkerHub.Contract.SetRevealDuration(&_IWorkerHub.TransactOpts, _newRevealDuration) } // SetScoringInfo is a paid mutator transaction binding the contract method 0x0d425ea5. // // Solidity: function setScoringInfo(address _workerHubScoring, address _modelScoring) returns() func (_IWorkerHub *IWorkerHubTransactor) SetScoringInfo(opts *bind.TransactOpts, _workerHubScoring common.Address, _modelScoring common.Address) (*types.Transaction, error) { return _IWorkerHub.contract.Transact(opts, "setScoringInfo", _workerHubScoring, _modelScoring) } // SetScoringInfo is a paid mutator transaction binding the contract method 0x0d425ea5. // // Solidity: function setScoringInfo(address _workerHubScoring, address _modelScoring) returns() func (_IWorkerHub *IWorkerHubSession) SetScoringInfo(_workerHubScoring common.Address, _modelScoring common.Address) (*types.Transaction, error) { return _IWorkerHub.Contract.SetScoringInfo(&_IWorkerHub.TransactOpts, _workerHubScoring, _modelScoring) } // SetScoringInfo is a paid mutator transaction binding the contract method 0x0d425ea5. // // Solidity: function setScoringInfo(address _workerHubScoring, address _modelScoring) returns() func (_IWorkerHub *IWorkerHubTransactorSession) SetScoringInfo(_workerHubScoring common.Address, _modelScoring common.Address) (*types.Transaction, error) { return _IWorkerHub.Contract.SetScoringInfo(&_IWorkerHub.TransactOpts, _workerHubScoring, _modelScoring) } // SetSubmitDuration is a paid mutator transaction binding the contract method 0x6f643736. // // Solidity: function setSubmitDuration(uint40 _newSubmitDuration) returns() func (_IWorkerHub *IWorkerHubTransactor) SetSubmitDuration(opts *bind.TransactOpts, _newSubmitDuration *big.Int) (*types.Transaction, error) { return _IWorkerHub.contract.Transact(opts, "setSubmitDuration", _newSubmitDuration) } // SetSubmitDuration is a paid mutator transaction binding the contract method 0x6f643736. // // Solidity: function setSubmitDuration(uint40 _newSubmitDuration) returns() func (_IWorkerHub *IWorkerHubSession) SetSubmitDuration(_newSubmitDuration *big.Int) (*types.Transaction, error) { return _IWorkerHub.Contract.SetSubmitDuration(&_IWorkerHub.TransactOpts, _newSubmitDuration) } // SetSubmitDuration is a paid mutator transaction binding the contract method 0x6f643736. // // Solidity: function setSubmitDuration(uint40 _newSubmitDuration) returns() func (_IWorkerHub *IWorkerHubTransactorSession) SetSubmitDuration(_newSubmitDuration *big.Int) (*types.Transaction, error) { return _IWorkerHub.Contract.SetSubmitDuration(&_IWorkerHub.TransactOpts, _newSubmitDuration) } // SetTreasuryAddress is a paid mutator transaction binding the contract method 0x6605bfda. // // Solidity: function setTreasuryAddress(address _treasuryAddress) returns() func (_IWorkerHub *IWorkerHubTransactor) SetTreasuryAddress(opts *bind.TransactOpts, _treasuryAddress common.Address) (*types.Transaction, error) { return _IWorkerHub.contract.Transact(opts, "setTreasuryAddress", _treasuryAddress) } // SetTreasuryAddress is a paid mutator transaction binding the contract method 0x6605bfda. // // Solidity: function setTreasuryAddress(address _treasuryAddress) returns() func (_IWorkerHub *IWorkerHubSession) SetTreasuryAddress(_treasuryAddress common.Address) (*types.Transaction, error) { return _IWorkerHub.Contract.SetTreasuryAddress(&_IWorkerHub.TransactOpts, _treasuryAddress) } // SetTreasuryAddress is a paid mutator transaction binding the contract method 0x6605bfda. // // Solidity: function setTreasuryAddress(address _treasuryAddress) returns() func (_IWorkerHub *IWorkerHubTransactorSession) SetTreasuryAddress(_treasuryAddress common.Address) (*types.Transaction, error) { return _IWorkerHub.Contract.SetTreasuryAddress(&_IWorkerHub.TransactOpts, _treasuryAddress) } // SetUnstakDelayTime is a paid mutator transaction binding the contract method 0x351b2b33. // // Solidity: function setUnstakDelayTime(uint40 _newUnstakeDelayTime) returns() func (_IWorkerHub *IWorkerHubTransactor) SetUnstakDelayTime(opts *bind.TransactOpts, _newUnstakeDelayTime *big.Int) (*types.Transaction, error) { return _IWorkerHub.contract.Transact(opts, "setUnstakDelayTime", _newUnstakeDelayTime) } // SetUnstakDelayTime is a paid mutator transaction binding the contract method 0x351b2b33. // // Solidity: function setUnstakDelayTime(uint40 _newUnstakeDelayTime) returns() func (_IWorkerHub *IWorkerHubSession) SetUnstakDelayTime(_newUnstakeDelayTime *big.Int) (*types.Transaction, error) { return _IWorkerHub.Contract.SetUnstakDelayTime(&_IWorkerHub.TransactOpts, _newUnstakeDelayTime) } // SetUnstakDelayTime is a paid mutator transaction binding the contract method 0x351b2b33. // // Solidity: function setUnstakDelayTime(uint40 _newUnstakeDelayTime) returns() func (_IWorkerHub *IWorkerHubTransactorSession) SetUnstakDelayTime(_newUnstakeDelayTime *big.Int) (*types.Transaction, error) { return _IWorkerHub.Contract.SetUnstakDelayTime(&_IWorkerHub.TransactOpts, _newUnstakeDelayTime) } // SlashMiner is a paid mutator transaction binding the contract method 0x969ceab4. // // Solidity: function slashMiner(address _miner, bool _isFined) returns() func (_IWorkerHub *IWorkerHubTransactor) SlashMiner(opts *bind.TransactOpts, _miner common.Address, _isFined bool) (*types.Transaction, error) { return _IWorkerHub.contract.Transact(opts, "slashMiner", _miner, _isFined) } // SlashMiner is a paid mutator transaction binding the contract method 0x969ceab4. // // Solidity: function slashMiner(address _miner, bool _isFined) returns() func (_IWorkerHub *IWorkerHubSession) SlashMiner(_miner common.Address, _isFined bool) (*types.Transaction, error) { return _IWorkerHub.Contract.SlashMiner(&_IWorkerHub.TransactOpts, _miner, _isFined) } // SlashMiner is a paid mutator transaction binding the contract method 0x969ceab4. // // Solidity: function slashMiner(address _miner, bool _isFined) returns() func (_IWorkerHub *IWorkerHubTransactorSession) SlashMiner(_miner common.Address, _isFined bool) (*types.Transaction, error) { return _IWorkerHub.Contract.SlashMiner(&_IWorkerHub.TransactOpts, _miner, _isFined) } // StreamData is a paid mutator transaction binding the contract method 0x020e3011. // // Solidity: function streamData(uint256 _assignmentId, bytes _data) returns() func (_IWorkerHub *IWorkerHubTransactor) StreamData(opts *bind.TransactOpts, _assignmentId *big.Int, _data []byte) (*types.Transaction, error) { return _IWorkerHub.contract.Transact(opts, "streamData", _assignmentId, _data) } // StreamData is a paid mutator transaction binding the contract method 0x020e3011. // // Solidity: function streamData(uint256 _assignmentId, bytes _data) returns() func (_IWorkerHub *IWorkerHubSession) StreamData(_assignmentId *big.Int, _data []byte) (*types.Transaction, error) { return _IWorkerHub.Contract.StreamData(&_IWorkerHub.TransactOpts, _assignmentId, _data) } // StreamData is a paid mutator transaction binding the contract method 0x020e3011. // // Solidity: function streamData(uint256 _assignmentId, bytes _data) returns() func (_IWorkerHub *IWorkerHubTransactorSession) StreamData(_assignmentId *big.Int, _data []byte) (*types.Transaction, error) { return _IWorkerHub.Contract.StreamData(&_IWorkerHub.TransactOpts, _assignmentId, _data) } // SubmitSolution is a paid mutator transaction binding the contract method 0xe84dee6b. // // Solidity: function submitSolution(uint256 _assigmentId, bytes _data) returns() func (_IWorkerHub *IWorkerHubTransactor) SubmitSolution(opts *bind.TransactOpts, _assigmentId *big.Int, _data []byte) (*types.Transaction, error) { return _IWorkerHub.contract.Transact(opts, "submitSolution", _assigmentId, _data) } // SubmitSolution is a paid mutator transaction binding the contract method 0xe84dee6b. // // Solidity: function submitSolution(uint256 _assigmentId, bytes _data) returns() func (_IWorkerHub *IWorkerHubSession) SubmitSolution(_assigmentId *big.Int, _data []byte) (*types.Transaction, error) { return _IWorkerHub.Contract.SubmitSolution(&_IWorkerHub.TransactOpts, _assigmentId, _data) } // SubmitSolution is a paid mutator transaction binding the contract method 0xe84dee6b. // // Solidity: function submitSolution(uint256 _assigmentId, bytes _data) returns() func (_IWorkerHub *IWorkerHubTransactorSession) SubmitSolution(_assigmentId *big.Int, _data []byte) (*types.Transaction, error) { return _IWorkerHub.Contract.SubmitSolution(&_IWorkerHub.TransactOpts, _assigmentId, _data) } // TopUpInfer is a paid mutator transaction binding the contract method 0xe9bd0e26. // // Solidity: function topUpInfer(uint256 _inferenceId) payable returns() func (_IWorkerHub *IWorkerHubTransactor) TopUpInfer(opts *bind.TransactOpts, _inferenceId *big.Int) (*types.Transaction, error) { return _IWorkerHub.contract.Transact(opts, "topUpInfer", _inferenceId) } // TopUpInfer is a paid mutator transaction binding the contract method 0xe9bd0e26. // // Solidity: function topUpInfer(uint256 _inferenceId) payable returns() func (_IWorkerHub *IWorkerHubSession) TopUpInfer(_inferenceId *big.Int) (*types.Transaction, error) { return _IWorkerHub.Contract.TopUpInfer(&_IWorkerHub.TransactOpts, _inferenceId) } // TopUpInfer is a paid mutator transaction binding the contract method 0xe9bd0e26. // // Solidity: function topUpInfer(uint256 _inferenceId) payable returns() func (_IWorkerHub *IWorkerHubTransactorSession) TopUpInfer(_inferenceId *big.Int) (*types.Transaction, error) { return _IWorkerHub.Contract.TopUpInfer(&_IWorkerHub.TransactOpts, _inferenceId) } // TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. // // Solidity: function transferOwnership(address newOwner) returns() func (_IWorkerHub *IWorkerHubTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) { return _IWorkerHub.contract.Transact(opts, "transferOwnership", newOwner) } // TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. // // Solidity: function transferOwnership(address newOwner) returns() func (_IWorkerHub *IWorkerHubSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { return _IWorkerHub.Contract.TransferOwnership(&_IWorkerHub.TransactOpts, newOwner) } // TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. // // Solidity: function transferOwnership(address newOwner) returns() func (_IWorkerHub *IWorkerHubTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { return _IWorkerHub.Contract.TransferOwnership(&_IWorkerHub.TransactOpts, newOwner) } // Unpause is a paid mutator transaction binding the contract method 0x3f4ba83a. // // Solidity: function unpause() returns() func (_IWorkerHub *IWorkerHubTransactor) Unpause(opts *bind.TransactOpts) (*types.Transaction, error) { return _IWorkerHub.contract.Transact(opts, "unpause") } // Unpause is a paid mutator transaction binding the contract method 0x3f4ba83a. // // Solidity: function unpause() returns() func (_IWorkerHub *IWorkerHubSession) Unpause() (*types.Transaction, error) { return _IWorkerHub.Contract.Unpause(&_IWorkerHub.TransactOpts) } // Unpause is a paid mutator transaction binding the contract method 0x3f4ba83a. // // Solidity: function unpause() returns() func (_IWorkerHub *IWorkerHubTransactorSession) Unpause() (*types.Transaction, error) { return _IWorkerHub.Contract.Unpause(&_IWorkerHub.TransactOpts) } // UnregisterMiner is a paid mutator transaction binding the contract method 0x656a1b20. // // Solidity: function unregisterMiner() returns() func (_IWorkerHub *IWorkerHubTransactor) UnregisterMiner(opts *bind.TransactOpts) (*types.Transaction, error) { return _IWorkerHub.contract.Transact(opts, "unregisterMiner") } // UnregisterMiner is a paid mutator transaction binding the contract method 0x656a1b20. // // Solidity: function unregisterMiner() returns() func (_IWorkerHub *IWorkerHubSession) UnregisterMiner() (*types.Transaction, error) { return _IWorkerHub.Contract.UnregisterMiner(&_IWorkerHub.TransactOpts) } // UnregisterMiner is a paid mutator transaction binding the contract method 0x656a1b20. // // Solidity: function unregisterMiner() returns() func (_IWorkerHub *IWorkerHubTransactorSession) UnregisterMiner() (*types.Transaction, error) { return _IWorkerHub.Contract.UnregisterMiner(&_IWorkerHub.TransactOpts) } // UnregisterModel is a paid mutator transaction binding the contract method 0xdb2dab1d. // // Solidity: function unregisterModel(address _model) returns() func (_IWorkerHub *IWorkerHubTransactor) UnregisterModel(opts *bind.TransactOpts, _model common.Address) (*types.Transaction, error) { return _IWorkerHub.contract.Transact(opts, "unregisterModel", _model) } // UnregisterModel is a paid mutator transaction binding the contract method 0xdb2dab1d. // // Solidity: function unregisterModel(address _model) returns() func (_IWorkerHub *IWorkerHubSession) UnregisterModel(_model common.Address) (*types.Transaction, error) { return _IWorkerHub.Contract.UnregisterModel(&_IWorkerHub.TransactOpts, _model) } // UnregisterModel is a paid mutator transaction binding the contract method 0xdb2dab1d. // // Solidity: function unregisterModel(address _model) returns() func (_IWorkerHub *IWorkerHubTransactorSession) UnregisterModel(_model common.Address) (*types.Transaction, error) { return _IWorkerHub.Contract.UnregisterModel(&_IWorkerHub.TransactOpts, _model) } // UnstakeForMiner is a paid mutator transaction binding the contract method 0x73df250d. // // Solidity: function unstakeForMiner() returns() func (_IWorkerHub *IWorkerHubTransactor) UnstakeForMiner(opts *bind.TransactOpts) (*types.Transaction, error) { return _IWorkerHub.contract.Transact(opts, "unstakeForMiner") } // UnstakeForMiner is a paid mutator transaction binding the contract method 0x73df250d. // // Solidity: function unstakeForMiner() returns() func (_IWorkerHub *IWorkerHubSession) UnstakeForMiner() (*types.Transaction, error) { return _IWorkerHub.Contract.UnstakeForMiner(&_IWorkerHub.TransactOpts) } // UnstakeForMiner is a paid mutator transaction binding the contract method 0x73df250d. // // Solidity: function unstakeForMiner() returns() func (_IWorkerHub *IWorkerHubTransactorSession) UnstakeForMiner() (*types.Transaction, error) { return _IWorkerHub.Contract.UnstakeForMiner(&_IWorkerHub.TransactOpts) } // UpdateModelMinimumFee is a paid mutator transaction binding the contract method 0xb74cd194. // // Solidity: function updateModelMinimumFee(address _model, uint256 _minimumFee) returns() func (_IWorkerHub *IWorkerHubTransactor) UpdateModelMinimumFee(opts *bind.TransactOpts, _model common.Address, _minimumFee *big.Int) (*types.Transaction, error) { return _IWorkerHub.contract.Transact(opts, "updateModelMinimumFee", _model, _minimumFee) } // UpdateModelMinimumFee is a paid mutator transaction binding the contract method 0xb74cd194. // // Solidity: function updateModelMinimumFee(address _model, uint256 _minimumFee) returns() func (_IWorkerHub *IWorkerHubSession) UpdateModelMinimumFee(_model common.Address, _minimumFee *big.Int) (*types.Transaction, error) { return _IWorkerHub.Contract.UpdateModelMinimumFee(&_IWorkerHub.TransactOpts, _model, _minimumFee) } // UpdateModelMinimumFee is a paid mutator transaction binding the contract method 0xb74cd194. // // Solidity: function updateModelMinimumFee(address _model, uint256 _minimumFee) returns() func (_IWorkerHub *IWorkerHubTransactorSession) UpdateModelMinimumFee(_model common.Address, _minimumFee *big.Int) (*types.Transaction, error) { return _IWorkerHub.Contract.UpdateModelMinimumFee(&_IWorkerHub.TransactOpts, _model, _minimumFee) } // UpdateModelTier is a paid mutator transaction binding the contract method 0x0738a9bb. // // Solidity: function updateModelTier(address _model, uint32 _tier) returns() func (_IWorkerHub *IWorkerHubTransactor) UpdateModelTier(opts *bind.TransactOpts, _model common.Address, _tier uint32) (*types.Transaction, error) { return _IWorkerHub.contract.Transact(opts, "updateModelTier", _model, _tier) } // UpdateModelTier is a paid mutator transaction binding the contract method 0x0738a9bb. // // Solidity: function updateModelTier(address _model, uint32 _tier) returns() func (_IWorkerHub *IWorkerHubSession) UpdateModelTier(_model common.Address, _tier uint32) (*types.Transaction, error) { return _IWorkerHub.Contract.UpdateModelTier(&_IWorkerHub.TransactOpts, _model, _tier) } // UpdateModelTier is a paid mutator transaction binding the contract method 0x0738a9bb. // // Solidity: function updateModelTier(address _model, uint32 _tier) returns() func (_IWorkerHub *IWorkerHubTransactorSession) UpdateModelTier(_model common.Address, _tier uint32) (*types.Transaction, error) { return _IWorkerHub.Contract.UpdateModelTier(&_IWorkerHub.TransactOpts, _model, _tier) } // Receive is a paid mutator transaction binding the contract receive function. // // Solidity: receive() payable returns() func (_IWorkerHub *IWorkerHubTransactor) Receive(opts *bind.TransactOpts) (*types.Transaction, error) { return _IWorkerHub.contract.RawTransact(opts, nil) // calldata is disallowed for receive function } // Receive is a paid mutator transaction binding the contract receive function. // // Solidity: receive() payable returns() func (_IWorkerHub *IWorkerHubSession) Receive() (*types.Transaction, error) { return _IWorkerHub.Contract.Receive(&_IWorkerHub.TransactOpts) } // Receive is a paid mutator transaction binding the contract receive function. // // Solidity: receive() payable returns() func (_IWorkerHub *IWorkerHubTransactorSession) Receive() (*types.Transaction, error) { return _IWorkerHub.Contract.Receive(&_IWorkerHub.TransactOpts) } // IWorkerHubBlocksPerEpochIterator is returned from FilterBlocksPerEpoch and is used to iterate over the raw logs and unpacked data for BlocksPerEpoch events raised by the IWorkerHub contract. type IWorkerHubBlocksPerEpochIterator struct { Event *IWorkerHubBlocksPerEpoch // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *IWorkerHubBlocksPerEpochIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(IWorkerHubBlocksPerEpoch) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(IWorkerHubBlocksPerEpoch) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *IWorkerHubBlocksPerEpochIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *IWorkerHubBlocksPerEpochIterator) Close() error { it.sub.Unsubscribe() return nil } // IWorkerHubBlocksPerEpoch represents a BlocksPerEpoch event raised by the IWorkerHub contract. type IWorkerHubBlocksPerEpoch struct { OldBlocks *big.Int NewBlocks *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterBlocksPerEpoch is a free log retrieval operation binding the contract event 0x3179ee2c3011a36d6d80a4b422f208df28ef9493d1d9ce1555b3116bd26ddb3d. // // Solidity: event BlocksPerEpoch(uint256 oldBlocks, uint256 newBlocks) func (_IWorkerHub *IWorkerHubFilterer) FilterBlocksPerEpoch(opts *bind.FilterOpts) (*IWorkerHubBlocksPerEpochIterator, error) { logs, sub, err := _IWorkerHub.contract.FilterLogs(opts, "BlocksPerEpoch") if err != nil { return nil, err } return &IWorkerHubBlocksPerEpochIterator{contract: _IWorkerHub.contract, event: "BlocksPerEpoch", logs: logs, sub: sub}, nil } // WatchBlocksPerEpoch is a free log subscription operation binding the contract event 0x3179ee2c3011a36d6d80a4b422f208df28ef9493d1d9ce1555b3116bd26ddb3d. // // Solidity: event BlocksPerEpoch(uint256 oldBlocks, uint256 newBlocks) func (_IWorkerHub *IWorkerHubFilterer) WatchBlocksPerEpoch(opts *bind.WatchOpts, sink chan<- *IWorkerHubBlocksPerEpoch) (event.Subscription, error) { logs, sub, err := _IWorkerHub.contract.WatchLogs(opts, "BlocksPerEpoch") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(IWorkerHubBlocksPerEpoch) if err := _IWorkerHub.contract.UnpackLog(event, "BlocksPerEpoch", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseBlocksPerEpoch is a log parse operation binding the contract event 0x3179ee2c3011a36d6d80a4b422f208df28ef9493d1d9ce1555b3116bd26ddb3d. // // Solidity: event BlocksPerEpoch(uint256 oldBlocks, uint256 newBlocks) func (_IWorkerHub *IWorkerHubFilterer) ParseBlocksPerEpoch(log types.Log) (*IWorkerHubBlocksPerEpoch, error) { event := new(IWorkerHubBlocksPerEpoch) if err := _IWorkerHub.contract.UnpackLog(event, "BlocksPerEpoch", log); err != nil { return nil, err } event.Raw = log return event, nil } // IWorkerHubCommitDurationIterator is returned from FilterCommitDuration and is used to iterate over the raw logs and unpacked data for CommitDuration events raised by the IWorkerHub contract. type IWorkerHubCommitDurationIterator struct { Event *IWorkerHubCommitDuration // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *IWorkerHubCommitDurationIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(IWorkerHubCommitDuration) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(IWorkerHubCommitDuration) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *IWorkerHubCommitDurationIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *IWorkerHubCommitDurationIterator) Close() error { it.sub.Unsubscribe() return nil } // IWorkerHubCommitDuration represents a CommitDuration event raised by the IWorkerHub contract. type IWorkerHubCommitDuration struct { OldTime *big.Int NewTime *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterCommitDuration is a free log retrieval operation binding the contract event 0xc9bc20c9ff07142c58c480090e116ebe561a42316260069d619782bb38faf619. // // Solidity: event CommitDuration(uint256 oldTime, uint256 newTime) func (_IWorkerHub *IWorkerHubFilterer) FilterCommitDuration(opts *bind.FilterOpts) (*IWorkerHubCommitDurationIterator, error) { logs, sub, err := _IWorkerHub.contract.FilterLogs(opts, "CommitDuration") if err != nil { return nil, err } return &IWorkerHubCommitDurationIterator{contract: _IWorkerHub.contract, event: "CommitDuration", logs: logs, sub: sub}, nil } // WatchCommitDuration is a free log subscription operation binding the contract event 0xc9bc20c9ff07142c58c480090e116ebe561a42316260069d619782bb38faf619. // // Solidity: event CommitDuration(uint256 oldTime, uint256 newTime) func (_IWorkerHub *IWorkerHubFilterer) WatchCommitDuration(opts *bind.WatchOpts, sink chan<- *IWorkerHubCommitDuration) (event.Subscription, error) { logs, sub, err := _IWorkerHub.contract.WatchLogs(opts, "CommitDuration") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(IWorkerHubCommitDuration) if err := _IWorkerHub.contract.UnpackLog(event, "CommitDuration", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseCommitDuration is a log parse operation binding the contract event 0xc9bc20c9ff07142c58c480090e116ebe561a42316260069d619782bb38faf619. // // Solidity: event CommitDuration(uint256 oldTime, uint256 newTime) func (_IWorkerHub *IWorkerHubFilterer) ParseCommitDuration(log types.Log) (*IWorkerHubCommitDuration, error) { event := new(IWorkerHubCommitDuration) if err := _IWorkerHub.contract.UnpackLog(event, "CommitDuration", log); err != nil { return nil, err } event.Raw = log return event, nil } // IWorkerHubCommitmentSubmissionIterator is returned from FilterCommitmentSubmission and is used to iterate over the raw logs and unpacked data for CommitmentSubmission events raised by the IWorkerHub contract. type IWorkerHubCommitmentSubmissionIterator struct { Event *IWorkerHubCommitmentSubmission // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *IWorkerHubCommitmentSubmissionIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(IWorkerHubCommitmentSubmission) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(IWorkerHubCommitmentSubmission) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *IWorkerHubCommitmentSubmissionIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *IWorkerHubCommitmentSubmissionIterator) Close() error { it.sub.Unsubscribe() return nil } // IWorkerHubCommitmentSubmission represents a CommitmentSubmission event raised by the IWorkerHub contract. type IWorkerHubCommitmentSubmission struct { Miner common.Address AssigmentId *big.Int Commitment [32]byte Raw types.Log // Blockchain specific contextual infos } // FilterCommitmentSubmission is a free log retrieval operation binding the contract event 0x47a3511bbb68bfcf0b476106b3a5a5d5b8d7eb4205a28d6424a40fb19d9afa5b. // // Solidity: event CommitmentSubmission(address indexed miner, uint256 indexed assigmentId, bytes32 commitment) func (_IWorkerHub *IWorkerHubFilterer) FilterCommitmentSubmission(opts *bind.FilterOpts, miner []common.Address, assigmentId []*big.Int) (*IWorkerHubCommitmentSubmissionIterator, error) { var minerRule []interface{} for _, minerItem := range miner { minerRule = append(minerRule, minerItem) } var assigmentIdRule []interface{} for _, assigmentIdItem := range assigmentId { assigmentIdRule = append(assigmentIdRule, assigmentIdItem) } logs, sub, err := _IWorkerHub.contract.FilterLogs(opts, "CommitmentSubmission", minerRule, assigmentIdRule) if err != nil { return nil, err } return &IWorkerHubCommitmentSubmissionIterator{contract: _IWorkerHub.contract, event: "CommitmentSubmission", logs: logs, sub: sub}, nil } // WatchCommitmentSubmission is a free log subscription operation binding the contract event 0x47a3511bbb68bfcf0b476106b3a5a5d5b8d7eb4205a28d6424a40fb19d9afa5b. // // Solidity: event CommitmentSubmission(address indexed miner, uint256 indexed assigmentId, bytes32 commitment) func (_IWorkerHub *IWorkerHubFilterer) WatchCommitmentSubmission(opts *bind.WatchOpts, sink chan<- *IWorkerHubCommitmentSubmission, miner []common.Address, assigmentId []*big.Int) (event.Subscription, error) { var minerRule []interface{} for _, minerItem := range miner { minerRule = append(minerRule, minerItem) } var assigmentIdRule []interface{} for _, assigmentIdItem := range assigmentId { assigmentIdRule = append(assigmentIdRule, assigmentIdItem) } logs, sub, err := _IWorkerHub.contract.WatchLogs(opts, "CommitmentSubmission", minerRule, assigmentIdRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(IWorkerHubCommitmentSubmission) if err := _IWorkerHub.contract.UnpackLog(event, "CommitmentSubmission", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseCommitmentSubmission is a log parse operation binding the contract event 0x47a3511bbb68bfcf0b476106b3a5a5d5b8d7eb4205a28d6424a40fb19d9afa5b. // // Solidity: event CommitmentSubmission(address indexed miner, uint256 indexed assigmentId, bytes32 commitment) func (_IWorkerHub *IWorkerHubFilterer) ParseCommitmentSubmission(log types.Log) (*IWorkerHubCommitmentSubmission, error) { event := new(IWorkerHubCommitmentSubmission) if err := _IWorkerHub.contract.UnpackLog(event, "CommitmentSubmission", log); err != nil { return nil, err } event.Raw = log return event, nil } // IWorkerHubDAOTokenMintedV2Iterator is returned from FilterDAOTokenMintedV2 and is used to iterate over the raw logs and unpacked data for DAOTokenMintedV2 events raised by the IWorkerHub contract. type IWorkerHubDAOTokenMintedV2Iterator struct { Event *IWorkerHubDAOTokenMintedV2 // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *IWorkerHubDAOTokenMintedV2Iterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(IWorkerHubDAOTokenMintedV2) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(IWorkerHubDAOTokenMintedV2) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *IWorkerHubDAOTokenMintedV2Iterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *IWorkerHubDAOTokenMintedV2Iterator) Close() error { it.sub.Unsubscribe() return nil } // IWorkerHubDAOTokenMintedV2 represents a DAOTokenMintedV2 event raised by the IWorkerHub contract. type IWorkerHubDAOTokenMintedV2 struct { ChainId *big.Int InferenceId *big.Int ModelAddress common.Address Receivers []IWorkerHubDAOTokenReceiverInfor Raw types.Log // Blockchain specific contextual infos } // FilterDAOTokenMintedV2 is a free log retrieval operation binding the contract event 0x2faa16bd9d858bdbd007d15bb6ae06ff3f238c90433800dafb4c0f7e3f07a241. // // Solidity: event DAOTokenMintedV2(uint256 chainId, uint256 inferenceId, address modelAddress, (address,uint256,uint8)[] receivers) func (_IWorkerHub *IWorkerHubFilterer) FilterDAOTokenMintedV2(opts *bind.FilterOpts) (*IWorkerHubDAOTokenMintedV2Iterator, error) { logs, sub, err := _IWorkerHub.contract.FilterLogs(opts, "DAOTokenMintedV2") if err != nil { return nil, err } return &IWorkerHubDAOTokenMintedV2Iterator{contract: _IWorkerHub.contract, event: "DAOTokenMintedV2", logs: logs, sub: sub}, nil } // WatchDAOTokenMintedV2 is a free log subscription operation binding the contract event 0x2faa16bd9d858bdbd007d15bb6ae06ff3f238c90433800dafb4c0f7e3f07a241. // // Solidity: event DAOTokenMintedV2(uint256 chainId, uint256 inferenceId, address modelAddress, (address,uint256,uint8)[] receivers) func (_IWorkerHub *IWorkerHubFilterer) WatchDAOTokenMintedV2(opts *bind.WatchOpts, sink chan<- *IWorkerHubDAOTokenMintedV2) (event.Subscription, error) { logs, sub, err := _IWorkerHub.contract.WatchLogs(opts, "DAOTokenMintedV2") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(IWorkerHubDAOTokenMintedV2) if err := _IWorkerHub.contract.UnpackLog(event, "DAOTokenMintedV2", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseDAOTokenMintedV2 is a log parse operation binding the contract event 0x2faa16bd9d858bdbd007d15bb6ae06ff3f238c90433800dafb4c0f7e3f07a241. // // Solidity: event DAOTokenMintedV2(uint256 chainId, uint256 inferenceId, address modelAddress, (address,uint256,uint8)[] receivers) func (_IWorkerHub *IWorkerHubFilterer) ParseDAOTokenMintedV2(log types.Log) (*IWorkerHubDAOTokenMintedV2, error) { event := new(IWorkerHubDAOTokenMintedV2) if err := _IWorkerHub.contract.UnpackLog(event, "DAOTokenMintedV2", log); err != nil { return nil, err } event.Raw = log return event, nil } // IWorkerHubDAOTokenPercentageUpdatedIterator is returned from FilterDAOTokenPercentageUpdated and is used to iterate over the raw logs and unpacked data for DAOTokenPercentageUpdated events raised by the IWorkerHub contract. type IWorkerHubDAOTokenPercentageUpdatedIterator struct { Event *IWorkerHubDAOTokenPercentageUpdated // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *IWorkerHubDAOTokenPercentageUpdatedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(IWorkerHubDAOTokenPercentageUpdated) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(IWorkerHubDAOTokenPercentageUpdated) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *IWorkerHubDAOTokenPercentageUpdatedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *IWorkerHubDAOTokenPercentageUpdatedIterator) Close() error { it.sub.Unsubscribe() return nil } // IWorkerHubDAOTokenPercentageUpdated represents a DAOTokenPercentageUpdated event raised by the IWorkerHub contract. type IWorkerHubDAOTokenPercentageUpdated struct { OldValue IWorkerHubDAOTokenPercentage NewValue IWorkerHubDAOTokenPercentage Raw types.Log // Blockchain specific contextual infos } // FilterDAOTokenPercentageUpdated is a free log retrieval operation binding the contract event 0xe217c132ca1c9e392a91d1b2eaeb42b77b8ff74a61c75974d05ffbbe6e00a16a. // // Solidity: event DAOTokenPercentageUpdated((uint16,uint16,uint16,uint16,uint16) oldValue, (uint16,uint16,uint16,uint16,uint16) newValue) func (_IWorkerHub *IWorkerHubFilterer) FilterDAOTokenPercentageUpdated(opts *bind.FilterOpts) (*IWorkerHubDAOTokenPercentageUpdatedIterator, error) { logs, sub, err := _IWorkerHub.contract.FilterLogs(opts, "DAOTokenPercentageUpdated") if err != nil { return nil, err } return &IWorkerHubDAOTokenPercentageUpdatedIterator{contract: _IWorkerHub.contract, event: "DAOTokenPercentageUpdated", logs: logs, sub: sub}, nil } // WatchDAOTokenPercentageUpdated is a free log subscription operation binding the contract event 0xe217c132ca1c9e392a91d1b2eaeb42b77b8ff74a61c75974d05ffbbe6e00a16a. // // Solidity: event DAOTokenPercentageUpdated((uint16,uint16,uint16,uint16,uint16) oldValue, (uint16,uint16,uint16,uint16,uint16) newValue) func (_IWorkerHub *IWorkerHubFilterer) WatchDAOTokenPercentageUpdated(opts *bind.WatchOpts, sink chan<- *IWorkerHubDAOTokenPercentageUpdated) (event.Subscription, error) { logs, sub, err := _IWorkerHub.contract.WatchLogs(opts, "DAOTokenPercentageUpdated") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(IWorkerHubDAOTokenPercentageUpdated) if err := _IWorkerHub.contract.UnpackLog(event, "DAOTokenPercentageUpdated", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseDAOTokenPercentageUpdated is a log parse operation binding the contract event 0xe217c132ca1c9e392a91d1b2eaeb42b77b8ff74a61c75974d05ffbbe6e00a16a. // // Solidity: event DAOTokenPercentageUpdated((uint16,uint16,uint16,uint16,uint16) oldValue, (uint16,uint16,uint16,uint16,uint16) newValue) func (_IWorkerHub *IWorkerHubFilterer) ParseDAOTokenPercentageUpdated(log types.Log) (*IWorkerHubDAOTokenPercentageUpdated, error) { event := new(IWorkerHubDAOTokenPercentageUpdated) if err := _IWorkerHub.contract.UnpackLog(event, "DAOTokenPercentageUpdated", log); err != nil { return nil, err } event.Raw = log return event, nil } // IWorkerHubDAOTokenRewardUpdatedIterator is returned from FilterDAOTokenRewardUpdated and is used to iterate over the raw logs and unpacked data for DAOTokenRewardUpdated events raised by the IWorkerHub contract. type IWorkerHubDAOTokenRewardUpdatedIterator struct { Event *IWorkerHubDAOTokenRewardUpdated // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *IWorkerHubDAOTokenRewardUpdatedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(IWorkerHubDAOTokenRewardUpdated) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(IWorkerHubDAOTokenRewardUpdated) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *IWorkerHubDAOTokenRewardUpdatedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *IWorkerHubDAOTokenRewardUpdatedIterator) Close() error { it.sub.Unsubscribe() return nil } // IWorkerHubDAOTokenRewardUpdated represents a DAOTokenRewardUpdated event raised by the IWorkerHub contract. type IWorkerHubDAOTokenRewardUpdated struct { OldValue *big.Int NewValue *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterDAOTokenRewardUpdated is a free log retrieval operation binding the contract event 0x454d79b61f30800ce19615c79c4f9a1eb892ed9372cf95ba71cbd2345f8fa9aa. // // Solidity: event DAOTokenRewardUpdated(uint256 oldValue, uint256 newValue) func (_IWorkerHub *IWorkerHubFilterer) FilterDAOTokenRewardUpdated(opts *bind.FilterOpts) (*IWorkerHubDAOTokenRewardUpdatedIterator, error) { logs, sub, err := _IWorkerHub.contract.FilterLogs(opts, "DAOTokenRewardUpdated") if err != nil { return nil, err } return &IWorkerHubDAOTokenRewardUpdatedIterator{contract: _IWorkerHub.contract, event: "DAOTokenRewardUpdated", logs: logs, sub: sub}, nil } // WatchDAOTokenRewardUpdated is a free log subscription operation binding the contract event 0x454d79b61f30800ce19615c79c4f9a1eb892ed9372cf95ba71cbd2345f8fa9aa. // // Solidity: event DAOTokenRewardUpdated(uint256 oldValue, uint256 newValue) func (_IWorkerHub *IWorkerHubFilterer) WatchDAOTokenRewardUpdated(opts *bind.WatchOpts, sink chan<- *IWorkerHubDAOTokenRewardUpdated) (event.Subscription, error) { logs, sub, err := _IWorkerHub.contract.WatchLogs(opts, "DAOTokenRewardUpdated") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(IWorkerHubDAOTokenRewardUpdated) if err := _IWorkerHub.contract.UnpackLog(event, "DAOTokenRewardUpdated", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseDAOTokenRewardUpdated is a log parse operation binding the contract event 0x454d79b61f30800ce19615c79c4f9a1eb892ed9372cf95ba71cbd2345f8fa9aa. // // Solidity: event DAOTokenRewardUpdated(uint256 oldValue, uint256 newValue) func (_IWorkerHub *IWorkerHubFilterer) ParseDAOTokenRewardUpdated(log types.Log) (*IWorkerHubDAOTokenRewardUpdated, error) { event := new(IWorkerHubDAOTokenRewardUpdated) if err := _IWorkerHub.contract.UnpackLog(event, "DAOTokenRewardUpdated", log); err != nil { return nil, err } event.Raw = log return event, nil } // IWorkerHubDAOTokenUpdatedIterator is returned from FilterDAOTokenUpdated and is used to iterate over the raw logs and unpacked data for DAOTokenUpdated events raised by the IWorkerHub contract. type IWorkerHubDAOTokenUpdatedIterator struct { Event *IWorkerHubDAOTokenUpdated // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *IWorkerHubDAOTokenUpdatedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(IWorkerHubDAOTokenUpdated) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(IWorkerHubDAOTokenUpdated) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *IWorkerHubDAOTokenUpdatedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *IWorkerHubDAOTokenUpdatedIterator) Close() error { it.sub.Unsubscribe() return nil } // IWorkerHubDAOTokenUpdated represents a DAOTokenUpdated event raised by the IWorkerHub contract. type IWorkerHubDAOTokenUpdated struct { OldAddress common.Address NewAddress common.Address Raw types.Log // Blockchain specific contextual infos } // FilterDAOTokenUpdated is a free log retrieval operation binding the contract event 0x518cc1a1508767ac2e92e88727dbf2ace68f44768b3684e0ad2305f6db0cd8da. // // Solidity: event DAOTokenUpdated(address oldAddress, address newAddress) func (_IWorkerHub *IWorkerHubFilterer) FilterDAOTokenUpdated(opts *bind.FilterOpts) (*IWorkerHubDAOTokenUpdatedIterator, error) { logs, sub, err := _IWorkerHub.contract.FilterLogs(opts, "DAOTokenUpdated") if err != nil { return nil, err } return &IWorkerHubDAOTokenUpdatedIterator{contract: _IWorkerHub.contract, event: "DAOTokenUpdated", logs: logs, sub: sub}, nil } // WatchDAOTokenUpdated is a free log subscription operation binding the contract event 0x518cc1a1508767ac2e92e88727dbf2ace68f44768b3684e0ad2305f6db0cd8da. // // Solidity: event DAOTokenUpdated(address oldAddress, address newAddress) func (_IWorkerHub *IWorkerHubFilterer) WatchDAOTokenUpdated(opts *bind.WatchOpts, sink chan<- *IWorkerHubDAOTokenUpdated) (event.Subscription, error) { logs, sub, err := _IWorkerHub.contract.WatchLogs(opts, "DAOTokenUpdated") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(IWorkerHubDAOTokenUpdated) if err := _IWorkerHub.contract.UnpackLog(event, "DAOTokenUpdated", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseDAOTokenUpdated is a log parse operation binding the contract event 0x518cc1a1508767ac2e92e88727dbf2ace68f44768b3684e0ad2305f6db0cd8da. // // Solidity: event DAOTokenUpdated(address oldAddress, address newAddress) func (_IWorkerHub *IWorkerHubFilterer) ParseDAOTokenUpdated(log types.Log) (*IWorkerHubDAOTokenUpdated, error) { event := new(IWorkerHubDAOTokenUpdated) if err := _IWorkerHub.contract.UnpackLog(event, "DAOTokenUpdated", log); err != nil { return nil, err } event.Raw = log return event, nil } // IWorkerHubFinePercentageUpdatedIterator is returned from FilterFinePercentageUpdated and is used to iterate over the raw logs and unpacked data for FinePercentageUpdated events raised by the IWorkerHub contract. type IWorkerHubFinePercentageUpdatedIterator struct { Event *IWorkerHubFinePercentageUpdated // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *IWorkerHubFinePercentageUpdatedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(IWorkerHubFinePercentageUpdated) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(IWorkerHubFinePercentageUpdated) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *IWorkerHubFinePercentageUpdatedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *IWorkerHubFinePercentageUpdatedIterator) Close() error { it.sub.Unsubscribe() return nil } // IWorkerHubFinePercentageUpdated represents a FinePercentageUpdated event raised by the IWorkerHub contract. type IWorkerHubFinePercentageUpdated struct { OldPercent uint16 NewPercent uint16 Raw types.Log // Blockchain specific contextual infos } // FilterFinePercentageUpdated is a free log retrieval operation binding the contract event 0xcf2ba21ec685fb1baf4b5e5df96fd2da47ab299e7d95e586c7898f114b6c1269. // // Solidity: event FinePercentageUpdated(uint16 oldPercent, uint16 newPercent) func (_IWorkerHub *IWorkerHubFilterer) FilterFinePercentageUpdated(opts *bind.FilterOpts) (*IWorkerHubFinePercentageUpdatedIterator, error) { logs, sub, err := _IWorkerHub.contract.FilterLogs(opts, "FinePercentageUpdated") if err != nil { return nil, err } return &IWorkerHubFinePercentageUpdatedIterator{contract: _IWorkerHub.contract, event: "FinePercentageUpdated", logs: logs, sub: sub}, nil } // WatchFinePercentageUpdated is a free log subscription operation binding the contract event 0xcf2ba21ec685fb1baf4b5e5df96fd2da47ab299e7d95e586c7898f114b6c1269. // // Solidity: event FinePercentageUpdated(uint16 oldPercent, uint16 newPercent) func (_IWorkerHub *IWorkerHubFilterer) WatchFinePercentageUpdated(opts *bind.WatchOpts, sink chan<- *IWorkerHubFinePercentageUpdated) (event.Subscription, error) { logs, sub, err := _IWorkerHub.contract.WatchLogs(opts, "FinePercentageUpdated") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(IWorkerHubFinePercentageUpdated) if err := _IWorkerHub.contract.UnpackLog(event, "FinePercentageUpdated", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseFinePercentageUpdated is a log parse operation binding the contract event 0xcf2ba21ec685fb1baf4b5e5df96fd2da47ab299e7d95e586c7898f114b6c1269. // // Solidity: event FinePercentageUpdated(uint16 oldPercent, uint16 newPercent) func (_IWorkerHub *IWorkerHubFilterer) ParseFinePercentageUpdated(log types.Log) (*IWorkerHubFinePercentageUpdated, error) { event := new(IWorkerHubFinePercentageUpdated) if err := _IWorkerHub.contract.UnpackLog(event, "FinePercentageUpdated", log); err != nil { return nil, err } event.Raw = log return event, nil } // IWorkerHubFraudulentMinerPenalizedIterator is returned from FilterFraudulentMinerPenalized and is used to iterate over the raw logs and unpacked data for FraudulentMinerPenalized events raised by the IWorkerHub contract. type IWorkerHubFraudulentMinerPenalizedIterator struct { Event *IWorkerHubFraudulentMinerPenalized // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *IWorkerHubFraudulentMinerPenalizedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(IWorkerHubFraudulentMinerPenalized) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(IWorkerHubFraudulentMinerPenalized) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *IWorkerHubFraudulentMinerPenalizedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *IWorkerHubFraudulentMinerPenalizedIterator) Close() error { it.sub.Unsubscribe() return nil } // IWorkerHubFraudulentMinerPenalized represents a FraudulentMinerPenalized event raised by the IWorkerHub contract. type IWorkerHubFraudulentMinerPenalized struct { Miner common.Address ModelAddress common.Address Treasury common.Address Fine *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterFraudulentMinerPenalized is a free log retrieval operation binding the contract event 0x63a49f9cdfcfe1fddc8bd7a881449dc97b664e888be5c2fdee7ca4a70b447e43. // // Solidity: event FraudulentMinerPenalized(address indexed miner, address indexed modelAddress, address indexed treasury, uint256 fine) func (_IWorkerHub *IWorkerHubFilterer) FilterFraudulentMinerPenalized(opts *bind.FilterOpts, miner []common.Address, modelAddress []common.Address, treasury []common.Address) (*IWorkerHubFraudulentMinerPenalizedIterator, error) { var minerRule []interface{} for _, minerItem := range miner { minerRule = append(minerRule, minerItem) } var modelAddressRule []interface{} for _, modelAddressItem := range modelAddress { modelAddressRule = append(modelAddressRule, modelAddressItem) } var treasuryRule []interface{} for _, treasuryItem := range treasury { treasuryRule = append(treasuryRule, treasuryItem) } logs, sub, err := _IWorkerHub.contract.FilterLogs(opts, "FraudulentMinerPenalized", minerRule, modelAddressRule, treasuryRule) if err != nil { return nil, err } return &IWorkerHubFraudulentMinerPenalizedIterator{contract: _IWorkerHub.contract, event: "FraudulentMinerPenalized", logs: logs, sub: sub}, nil } // WatchFraudulentMinerPenalized is a free log subscription operation binding the contract event 0x63a49f9cdfcfe1fddc8bd7a881449dc97b664e888be5c2fdee7ca4a70b447e43. // // Solidity: event FraudulentMinerPenalized(address indexed miner, address indexed modelAddress, address indexed treasury, uint256 fine) func (_IWorkerHub *IWorkerHubFilterer) WatchFraudulentMinerPenalized(opts *bind.WatchOpts, sink chan<- *IWorkerHubFraudulentMinerPenalized, miner []common.Address, modelAddress []common.Address, treasury []common.Address) (event.Subscription, error) { var minerRule []interface{} for _, minerItem := range miner { minerRule = append(minerRule, minerItem) } var modelAddressRule []interface{} for _, modelAddressItem := range modelAddress { modelAddressRule = append(modelAddressRule, modelAddressItem) } var treasuryRule []interface{} for _, treasuryItem := range treasury { treasuryRule = append(treasuryRule, treasuryItem) } logs, sub, err := _IWorkerHub.contract.WatchLogs(opts, "FraudulentMinerPenalized", minerRule, modelAddressRule, treasuryRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(IWorkerHubFraudulentMinerPenalized) if err := _IWorkerHub.contract.UnpackLog(event, "FraudulentMinerPenalized", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseFraudulentMinerPenalized is a log parse operation binding the contract event 0x63a49f9cdfcfe1fddc8bd7a881449dc97b664e888be5c2fdee7ca4a70b447e43. // // Solidity: event FraudulentMinerPenalized(address indexed miner, address indexed modelAddress, address indexed treasury, uint256 fine) func (_IWorkerHub *IWorkerHubFilterer) ParseFraudulentMinerPenalized(log types.Log) (*IWorkerHubFraudulentMinerPenalized, error) { event := new(IWorkerHubFraudulentMinerPenalized) if err := _IWorkerHub.contract.UnpackLog(event, "FraudulentMinerPenalized", log); err != nil { return nil, err } event.Raw = log return event, nil } // IWorkerHubInferenceStatusUpdateIterator is returned from FilterInferenceStatusUpdate and is used to iterate over the raw logs and unpacked data for InferenceStatusUpdate events raised by the IWorkerHub contract. type IWorkerHubInferenceStatusUpdateIterator struct { Event *IWorkerHubInferenceStatusUpdate // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *IWorkerHubInferenceStatusUpdateIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(IWorkerHubInferenceStatusUpdate) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(IWorkerHubInferenceStatusUpdate) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *IWorkerHubInferenceStatusUpdateIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *IWorkerHubInferenceStatusUpdateIterator) Close() error { it.sub.Unsubscribe() return nil } // IWorkerHubInferenceStatusUpdate represents a InferenceStatusUpdate event raised by the IWorkerHub contract. type IWorkerHubInferenceStatusUpdate struct { InferenceId *big.Int NewStatus uint8 Raw types.Log // Blockchain specific contextual infos } // FilterInferenceStatusUpdate is a free log retrieval operation binding the contract event 0xbc645ece538d7606c8ac26de30aef5fbd0ed2ee0c945f4e5d860da3e62781d50. // // Solidity: event InferenceStatusUpdate(uint256 indexed inferenceId, uint8 newStatus) func (_IWorkerHub *IWorkerHubFilterer) FilterInferenceStatusUpdate(opts *bind.FilterOpts, inferenceId []*big.Int) (*IWorkerHubInferenceStatusUpdateIterator, error) { var inferenceIdRule []interface{} for _, inferenceIdItem := range inferenceId { inferenceIdRule = append(inferenceIdRule, inferenceIdItem) } logs, sub, err := _IWorkerHub.contract.FilterLogs(opts, "InferenceStatusUpdate", inferenceIdRule) if err != nil { return nil, err } return &IWorkerHubInferenceStatusUpdateIterator{contract: _IWorkerHub.contract, event: "InferenceStatusUpdate", logs: logs, sub: sub}, nil } // WatchInferenceStatusUpdate is a free log subscription operation binding the contract event 0xbc645ece538d7606c8ac26de30aef5fbd0ed2ee0c945f4e5d860da3e62781d50. // // Solidity: event InferenceStatusUpdate(uint256 indexed inferenceId, uint8 newStatus) func (_IWorkerHub *IWorkerHubFilterer) WatchInferenceStatusUpdate(opts *bind.WatchOpts, sink chan<- *IWorkerHubInferenceStatusUpdate, inferenceId []*big.Int) (event.Subscription, error) { var inferenceIdRule []interface{} for _, inferenceIdItem := range inferenceId { inferenceIdRule = append(inferenceIdRule, inferenceIdItem) } logs, sub, err := _IWorkerHub.contract.WatchLogs(opts, "InferenceStatusUpdate", inferenceIdRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(IWorkerHubInferenceStatusUpdate) if err := _IWorkerHub.contract.UnpackLog(event, "InferenceStatusUpdate", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseInferenceStatusUpdate is a log parse operation binding the contract event 0xbc645ece538d7606c8ac26de30aef5fbd0ed2ee0c945f4e5d860da3e62781d50. // // Solidity: event InferenceStatusUpdate(uint256 indexed inferenceId, uint8 newStatus) func (_IWorkerHub *IWorkerHubFilterer) ParseInferenceStatusUpdate(log types.Log) (*IWorkerHubInferenceStatusUpdate, error) { event := new(IWorkerHubInferenceStatusUpdate) if err := _IWorkerHub.contract.UnpackLog(event, "InferenceStatusUpdate", log); err != nil { return nil, err } event.Raw = log return event, nil } // IWorkerHubInitializedIterator is returned from FilterInitialized and is used to iterate over the raw logs and unpacked data for Initialized events raised by the IWorkerHub contract. type IWorkerHubInitializedIterator struct { Event *IWorkerHubInitialized // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *IWorkerHubInitializedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(IWorkerHubInitialized) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(IWorkerHubInitialized) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *IWorkerHubInitializedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *IWorkerHubInitializedIterator) Close() error { it.sub.Unsubscribe() return nil } // IWorkerHubInitialized represents a Initialized event raised by the IWorkerHub contract. type IWorkerHubInitialized struct { Version uint8 Raw types.Log // Blockchain specific contextual infos } // FilterInitialized is a free log retrieval operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. // // Solidity: event Initialized(uint8 version) func (_IWorkerHub *IWorkerHubFilterer) FilterInitialized(opts *bind.FilterOpts) (*IWorkerHubInitializedIterator, error) { logs, sub, err := _IWorkerHub.contract.FilterLogs(opts, "Initialized") if err != nil { return nil, err } return &IWorkerHubInitializedIterator{contract: _IWorkerHub.contract, event: "Initialized", logs: logs, sub: sub}, nil } // WatchInitialized is a free log subscription operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. // // Solidity: event Initialized(uint8 version) func (_IWorkerHub *IWorkerHubFilterer) WatchInitialized(opts *bind.WatchOpts, sink chan<- *IWorkerHubInitialized) (event.Subscription, error) { logs, sub, err := _IWorkerHub.contract.WatchLogs(opts, "Initialized") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(IWorkerHubInitialized) if err := _IWorkerHub.contract.UnpackLog(event, "Initialized", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseInitialized is a log parse operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. // // Solidity: event Initialized(uint8 version) func (_IWorkerHub *IWorkerHubFilterer) ParseInitialized(log types.Log) (*IWorkerHubInitialized, error) { event := new(IWorkerHubInitialized) if err := _IWorkerHub.contract.UnpackLog(event, "Initialized", log); err != nil { return nil, err } event.Raw = log return event, nil } // IWorkerHubL2OwnerUpdatedIterator is returned from FilterL2OwnerUpdated and is used to iterate over the raw logs and unpacked data for L2OwnerUpdated events raised by the IWorkerHub contract. type IWorkerHubL2OwnerUpdatedIterator struct { Event *IWorkerHubL2OwnerUpdated // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *IWorkerHubL2OwnerUpdatedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(IWorkerHubL2OwnerUpdated) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(IWorkerHubL2OwnerUpdated) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *IWorkerHubL2OwnerUpdatedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *IWorkerHubL2OwnerUpdatedIterator) Close() error { it.sub.Unsubscribe() return nil } // IWorkerHubL2OwnerUpdated represents a L2OwnerUpdated event raised by the IWorkerHub contract. type IWorkerHubL2OwnerUpdated struct { OldAddress common.Address NewAddress common.Address Raw types.Log // Blockchain specific contextual infos } // FilterL2OwnerUpdated is a free log retrieval operation binding the contract event 0x3cfa9fea14972d7cbbd0fddda517d4467bd2863f1d28e76fa4e0fe230a7bf274. // // Solidity: event L2OwnerUpdated(address oldAddress, address newAddress) func (_IWorkerHub *IWorkerHubFilterer) FilterL2OwnerUpdated(opts *bind.FilterOpts) (*IWorkerHubL2OwnerUpdatedIterator, error) { logs, sub, err := _IWorkerHub.contract.FilterLogs(opts, "L2OwnerUpdated") if err != nil { return nil, err } return &IWorkerHubL2OwnerUpdatedIterator{contract: _IWorkerHub.contract, event: "L2OwnerUpdated", logs: logs, sub: sub}, nil } // WatchL2OwnerUpdated is a free log subscription operation binding the contract event 0x3cfa9fea14972d7cbbd0fddda517d4467bd2863f1d28e76fa4e0fe230a7bf274. // // Solidity: event L2OwnerUpdated(address oldAddress, address newAddress) func (_IWorkerHub *IWorkerHubFilterer) WatchL2OwnerUpdated(opts *bind.WatchOpts, sink chan<- *IWorkerHubL2OwnerUpdated) (event.Subscription, error) { logs, sub, err := _IWorkerHub.contract.WatchLogs(opts, "L2OwnerUpdated") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(IWorkerHubL2OwnerUpdated) if err := _IWorkerHub.contract.UnpackLog(event, "L2OwnerUpdated", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseL2OwnerUpdated is a log parse operation binding the contract event 0x3cfa9fea14972d7cbbd0fddda517d4467bd2863f1d28e76fa4e0fe230a7bf274. // // Solidity: event L2OwnerUpdated(address oldAddress, address newAddress) func (_IWorkerHub *IWorkerHubFilterer) ParseL2OwnerUpdated(log types.Log) (*IWorkerHubL2OwnerUpdated, error) { event := new(IWorkerHubL2OwnerUpdated) if err := _IWorkerHub.contract.UnpackLog(event, "L2OwnerUpdated", log); err != nil { return nil, err } event.Raw = log return event, nil } // IWorkerHubMinFeeToUseUpdatedIterator is returned from FilterMinFeeToUseUpdated and is used to iterate over the raw logs and unpacked data for MinFeeToUseUpdated events raised by the IWorkerHub contract. type IWorkerHubMinFeeToUseUpdatedIterator struct { Event *IWorkerHubMinFeeToUseUpdated // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *IWorkerHubMinFeeToUseUpdatedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(IWorkerHubMinFeeToUseUpdated) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(IWorkerHubMinFeeToUseUpdated) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *IWorkerHubMinFeeToUseUpdatedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *IWorkerHubMinFeeToUseUpdatedIterator) Close() error { it.sub.Unsubscribe() return nil } // IWorkerHubMinFeeToUseUpdated represents a MinFeeToUseUpdated event raised by the IWorkerHub contract. type IWorkerHubMinFeeToUseUpdated struct { OldValue *big.Int NewValue *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterMinFeeToUseUpdated is a free log retrieval operation binding the contract event 0x37bba2c63397e7d89baa40e3d0c29e309913eb87b9691bacb16dba509fad523c. // // Solidity: event MinFeeToUseUpdated(uint256 oldValue, uint256 newValue) func (_IWorkerHub *IWorkerHubFilterer) FilterMinFeeToUseUpdated(opts *bind.FilterOpts) (*IWorkerHubMinFeeToUseUpdatedIterator, error) { logs, sub, err := _IWorkerHub.contract.FilterLogs(opts, "MinFeeToUseUpdated") if err != nil { return nil, err } return &IWorkerHubMinFeeToUseUpdatedIterator{contract: _IWorkerHub.contract, event: "MinFeeToUseUpdated", logs: logs, sub: sub}, nil } // WatchMinFeeToUseUpdated is a free log subscription operation binding the contract event 0x37bba2c63397e7d89baa40e3d0c29e309913eb87b9691bacb16dba509fad523c. // // Solidity: event MinFeeToUseUpdated(uint256 oldValue, uint256 newValue) func (_IWorkerHub *IWorkerHubFilterer) WatchMinFeeToUseUpdated(opts *bind.WatchOpts, sink chan<- *IWorkerHubMinFeeToUseUpdated) (event.Subscription, error) { logs, sub, err := _IWorkerHub.contract.WatchLogs(opts, "MinFeeToUseUpdated") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(IWorkerHubMinFeeToUseUpdated) if err := _IWorkerHub.contract.UnpackLog(event, "MinFeeToUseUpdated", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseMinFeeToUseUpdated is a log parse operation binding the contract event 0x37bba2c63397e7d89baa40e3d0c29e309913eb87b9691bacb16dba509fad523c. // // Solidity: event MinFeeToUseUpdated(uint256 oldValue, uint256 newValue) func (_IWorkerHub *IWorkerHubFilterer) ParseMinFeeToUseUpdated(log types.Log) (*IWorkerHubMinFeeToUseUpdated, error) { event := new(IWorkerHubMinFeeToUseUpdated) if err := _IWorkerHub.contract.UnpackLog(event, "MinFeeToUseUpdated", log); err != nil { return nil, err } event.Raw = log return event, nil } // IWorkerHubMinerDeactivatedIterator is returned from FilterMinerDeactivated and is used to iterate over the raw logs and unpacked data for MinerDeactivated events raised by the IWorkerHub contract. type IWorkerHubMinerDeactivatedIterator struct { Event *IWorkerHubMinerDeactivated // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *IWorkerHubMinerDeactivatedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(IWorkerHubMinerDeactivated) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(IWorkerHubMinerDeactivated) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *IWorkerHubMinerDeactivatedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *IWorkerHubMinerDeactivatedIterator) Close() error { it.sub.Unsubscribe() return nil } // IWorkerHubMinerDeactivated represents a MinerDeactivated event raised by the IWorkerHub contract. type IWorkerHubMinerDeactivated struct { Miner common.Address ModelAddress common.Address ActiveTime *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterMinerDeactivated is a free log retrieval operation binding the contract event 0x9335a7723b09748526d22902742e96812ad183ab52d86c2030fe407ff626e50d. // // Solidity: event MinerDeactivated(address indexed miner, address indexed modelAddress, uint40 activeTime) func (_IWorkerHub *IWorkerHubFilterer) FilterMinerDeactivated(opts *bind.FilterOpts, miner []common.Address, modelAddress []common.Address) (*IWorkerHubMinerDeactivatedIterator, error) { var minerRule []interface{} for _, minerItem := range miner { minerRule = append(minerRule, minerItem) } var modelAddressRule []interface{} for _, modelAddressItem := range modelAddress { modelAddressRule = append(modelAddressRule, modelAddressItem) } logs, sub, err := _IWorkerHub.contract.FilterLogs(opts, "MinerDeactivated", minerRule, modelAddressRule) if err != nil { return nil, err } return &IWorkerHubMinerDeactivatedIterator{contract: _IWorkerHub.contract, event: "MinerDeactivated", logs: logs, sub: sub}, nil } // WatchMinerDeactivated is a free log subscription operation binding the contract event 0x9335a7723b09748526d22902742e96812ad183ab52d86c2030fe407ff626e50d. // // Solidity: event MinerDeactivated(address indexed miner, address indexed modelAddress, uint40 activeTime) func (_IWorkerHub *IWorkerHubFilterer) WatchMinerDeactivated(opts *bind.WatchOpts, sink chan<- *IWorkerHubMinerDeactivated, miner []common.Address, modelAddress []common.Address) (event.Subscription, error) { var minerRule []interface{} for _, minerItem := range miner { minerRule = append(minerRule, minerItem) } var modelAddressRule []interface{} for _, modelAddressItem := range modelAddress { modelAddressRule = append(modelAddressRule, modelAddressItem) } logs, sub, err := _IWorkerHub.contract.WatchLogs(opts, "MinerDeactivated", minerRule, modelAddressRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(IWorkerHubMinerDeactivated) if err := _IWorkerHub.contract.UnpackLog(event, "MinerDeactivated", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseMinerDeactivated is a log parse operation binding the contract event 0x9335a7723b09748526d22902742e96812ad183ab52d86c2030fe407ff626e50d. // // Solidity: event MinerDeactivated(address indexed miner, address indexed modelAddress, uint40 activeTime) func (_IWorkerHub *IWorkerHubFilterer) ParseMinerDeactivated(log types.Log) (*IWorkerHubMinerDeactivated, error) { event := new(IWorkerHubMinerDeactivated) if err := _IWorkerHub.contract.UnpackLog(event, "MinerDeactivated", log); err != nil { return nil, err } event.Raw = log return event, nil } // IWorkerHubMinerExtraStakeIterator is returned from FilterMinerExtraStake and is used to iterate over the raw logs and unpacked data for MinerExtraStake events raised by the IWorkerHub contract. type IWorkerHubMinerExtraStakeIterator struct { Event *IWorkerHubMinerExtraStake // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *IWorkerHubMinerExtraStakeIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(IWorkerHubMinerExtraStake) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(IWorkerHubMinerExtraStake) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *IWorkerHubMinerExtraStakeIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *IWorkerHubMinerExtraStakeIterator) Close() error { it.sub.Unsubscribe() return nil } // IWorkerHubMinerExtraStake represents a MinerExtraStake event raised by the IWorkerHub contract. type IWorkerHubMinerExtraStake struct { Miner common.Address Value *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterMinerExtraStake is a free log retrieval operation binding the contract event 0x3d236e8f743e932a32c84d3114ce3e7ee0b75225cb3b39f72faac62495fd21c1. // // Solidity: event MinerExtraStake(address indexed miner, uint256 value) func (_IWorkerHub *IWorkerHubFilterer) FilterMinerExtraStake(opts *bind.FilterOpts, miner []common.Address) (*IWorkerHubMinerExtraStakeIterator, error) { var minerRule []interface{} for _, minerItem := range miner { minerRule = append(minerRule, minerItem) } logs, sub, err := _IWorkerHub.contract.FilterLogs(opts, "MinerExtraStake", minerRule) if err != nil { return nil, err } return &IWorkerHubMinerExtraStakeIterator{contract: _IWorkerHub.contract, event: "MinerExtraStake", logs: logs, sub: sub}, nil } // WatchMinerExtraStake is a free log subscription operation binding the contract event 0x3d236e8f743e932a32c84d3114ce3e7ee0b75225cb3b39f72faac62495fd21c1. // // Solidity: event MinerExtraStake(address indexed miner, uint256 value) func (_IWorkerHub *IWorkerHubFilterer) WatchMinerExtraStake(opts *bind.WatchOpts, sink chan<- *IWorkerHubMinerExtraStake, miner []common.Address) (event.Subscription, error) { var minerRule []interface{} for _, minerItem := range miner { minerRule = append(minerRule, minerItem) } logs, sub, err := _IWorkerHub.contract.WatchLogs(opts, "MinerExtraStake", minerRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(IWorkerHubMinerExtraStake) if err := _IWorkerHub.contract.UnpackLog(event, "MinerExtraStake", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseMinerExtraStake is a log parse operation binding the contract event 0x3d236e8f743e932a32c84d3114ce3e7ee0b75225cb3b39f72faac62495fd21c1. // // Solidity: event MinerExtraStake(address indexed miner, uint256 value) func (_IWorkerHub *IWorkerHubFilterer) ParseMinerExtraStake(log types.Log) (*IWorkerHubMinerExtraStake, error) { event := new(IWorkerHubMinerExtraStake) if err := _IWorkerHub.contract.UnpackLog(event, "MinerExtraStake", log); err != nil { return nil, err } event.Raw = log return event, nil } // IWorkerHubMinerJoinIterator is returned from FilterMinerJoin and is used to iterate over the raw logs and unpacked data for MinerJoin events raised by the IWorkerHub contract. type IWorkerHubMinerJoinIterator struct { Event *IWorkerHubMinerJoin // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *IWorkerHubMinerJoinIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(IWorkerHubMinerJoin) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(IWorkerHubMinerJoin) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *IWorkerHubMinerJoinIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *IWorkerHubMinerJoinIterator) Close() error { it.sub.Unsubscribe() return nil } // IWorkerHubMinerJoin represents a MinerJoin event raised by the IWorkerHub contract. type IWorkerHubMinerJoin struct { Miner common.Address Raw types.Log // Blockchain specific contextual infos } // FilterMinerJoin is a free log retrieval operation binding the contract event 0xb7041987154996ed34981c2bc6fbafd4b1fcab9964486d7cc386f0d8abcc5446. // // Solidity: event MinerJoin(address indexed miner) func (_IWorkerHub *IWorkerHubFilterer) FilterMinerJoin(opts *bind.FilterOpts, miner []common.Address) (*IWorkerHubMinerJoinIterator, error) { var minerRule []interface{} for _, minerItem := range miner { minerRule = append(minerRule, minerItem) } logs, sub, err := _IWorkerHub.contract.FilterLogs(opts, "MinerJoin", minerRule) if err != nil { return nil, err } return &IWorkerHubMinerJoinIterator{contract: _IWorkerHub.contract, event: "MinerJoin", logs: logs, sub: sub}, nil } // WatchMinerJoin is a free log subscription operation binding the contract event 0xb7041987154996ed34981c2bc6fbafd4b1fcab9964486d7cc386f0d8abcc5446. // // Solidity: event MinerJoin(address indexed miner) func (_IWorkerHub *IWorkerHubFilterer) WatchMinerJoin(opts *bind.WatchOpts, sink chan<- *IWorkerHubMinerJoin, miner []common.Address) (event.Subscription, error) { var minerRule []interface{} for _, minerItem := range miner { minerRule = append(minerRule, minerItem) } logs, sub, err := _IWorkerHub.contract.WatchLogs(opts, "MinerJoin", minerRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(IWorkerHubMinerJoin) if err := _IWorkerHub.contract.UnpackLog(event, "MinerJoin", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseMinerJoin is a log parse operation binding the contract event 0xb7041987154996ed34981c2bc6fbafd4b1fcab9964486d7cc386f0d8abcc5446. // // Solidity: event MinerJoin(address indexed miner) func (_IWorkerHub *IWorkerHubFilterer) ParseMinerJoin(log types.Log) (*IWorkerHubMinerJoin, error) { event := new(IWorkerHubMinerJoin) if err := _IWorkerHub.contract.UnpackLog(event, "MinerJoin", log); err != nil { return nil, err } event.Raw = log return event, nil } // IWorkerHubMinerRegistrationIterator is returned from FilterMinerRegistration and is used to iterate over the raw logs and unpacked data for MinerRegistration events raised by the IWorkerHub contract. type IWorkerHubMinerRegistrationIterator struct { Event *IWorkerHubMinerRegistration // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *IWorkerHubMinerRegistrationIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(IWorkerHubMinerRegistration) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(IWorkerHubMinerRegistration) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *IWorkerHubMinerRegistrationIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *IWorkerHubMinerRegistrationIterator) Close() error { it.sub.Unsubscribe() return nil } // IWorkerHubMinerRegistration represents a MinerRegistration event raised by the IWorkerHub contract. type IWorkerHubMinerRegistration struct { Miner common.Address Tier uint16 Value *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterMinerRegistration is a free log retrieval operation binding the contract event 0x55e488821080f3f5cdf6088b02793df0d26f40053a70b6154347d2ac313015a1. // // Solidity: event MinerRegistration(address indexed miner, uint16 indexed tier, uint256 value) func (_IWorkerHub *IWorkerHubFilterer) FilterMinerRegistration(opts *bind.FilterOpts, miner []common.Address, tier []uint16) (*IWorkerHubMinerRegistrationIterator, error) { var minerRule []interface{} for _, minerItem := range miner { minerRule = append(minerRule, minerItem) } var tierRule []interface{} for _, tierItem := range tier { tierRule = append(tierRule, tierItem) } logs, sub, err := _IWorkerHub.contract.FilterLogs(opts, "MinerRegistration", minerRule, tierRule) if err != nil { return nil, err } return &IWorkerHubMinerRegistrationIterator{contract: _IWorkerHub.contract, event: "MinerRegistration", logs: logs, sub: sub}, nil } // WatchMinerRegistration is a free log subscription operation binding the contract event 0x55e488821080f3f5cdf6088b02793df0d26f40053a70b6154347d2ac313015a1. // // Solidity: event MinerRegistration(address indexed miner, uint16 indexed tier, uint256 value) func (_IWorkerHub *IWorkerHubFilterer) WatchMinerRegistration(opts *bind.WatchOpts, sink chan<- *IWorkerHubMinerRegistration, miner []common.Address, tier []uint16) (event.Subscription, error) { var minerRule []interface{} for _, minerItem := range miner { minerRule = append(minerRule, minerItem) } var tierRule []interface{} for _, tierItem := range tier { tierRule = append(tierRule, tierItem) } logs, sub, err := _IWorkerHub.contract.WatchLogs(opts, "MinerRegistration", minerRule, tierRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(IWorkerHubMinerRegistration) if err := _IWorkerHub.contract.UnpackLog(event, "MinerRegistration", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseMinerRegistration is a log parse operation binding the contract event 0x55e488821080f3f5cdf6088b02793df0d26f40053a70b6154347d2ac313015a1. // // Solidity: event MinerRegistration(address indexed miner, uint16 indexed tier, uint256 value) func (_IWorkerHub *IWorkerHubFilterer) ParseMinerRegistration(log types.Log) (*IWorkerHubMinerRegistration, error) { event := new(IWorkerHubMinerRegistration) if err := _IWorkerHub.contract.UnpackLog(event, "MinerRegistration", log); err != nil { return nil, err } event.Raw = log return event, nil } // IWorkerHubMinerRoleSeizedIterator is returned from FilterMinerRoleSeized and is used to iterate over the raw logs and unpacked data for MinerRoleSeized events raised by the IWorkerHub contract. type IWorkerHubMinerRoleSeizedIterator struct { Event *IWorkerHubMinerRoleSeized // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *IWorkerHubMinerRoleSeizedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(IWorkerHubMinerRoleSeized) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(IWorkerHubMinerRoleSeized) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *IWorkerHubMinerRoleSeizedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *IWorkerHubMinerRoleSeizedIterator) Close() error { it.sub.Unsubscribe() return nil } // IWorkerHubMinerRoleSeized represents a MinerRoleSeized event raised by the IWorkerHub contract. type IWorkerHubMinerRoleSeized struct { AssignmentId *big.Int InferenceId *big.Int Miner common.Address Raw types.Log // Blockchain specific contextual infos } // FilterMinerRoleSeized is a free log retrieval operation binding the contract event 0x3d4f35957f03b76084f29d7c66d573fcec3d2e4bbc2844549e44bc1aed4c6c24. // // Solidity: event MinerRoleSeized(uint256 indexed assignmentId, uint256 indexed inferenceId, address indexed miner) func (_IWorkerHub *IWorkerHubFilterer) FilterMinerRoleSeized(opts *bind.FilterOpts, assignmentId []*big.Int, inferenceId []*big.Int, miner []common.Address) (*IWorkerHubMinerRoleSeizedIterator, error) { var assignmentIdRule []interface{} for _, assignmentIdItem := range assignmentId { assignmentIdRule = append(assignmentIdRule, assignmentIdItem) } var inferenceIdRule []interface{} for _, inferenceIdItem := range inferenceId { inferenceIdRule = append(inferenceIdRule, inferenceIdItem) } var minerRule []interface{} for _, minerItem := range miner { minerRule = append(minerRule, minerItem) } logs, sub, err := _IWorkerHub.contract.FilterLogs(opts, "MinerRoleSeized", assignmentIdRule, inferenceIdRule, minerRule) if err != nil { return nil, err } return &IWorkerHubMinerRoleSeizedIterator{contract: _IWorkerHub.contract, event: "MinerRoleSeized", logs: logs, sub: sub}, nil } // WatchMinerRoleSeized is a free log subscription operation binding the contract event 0x3d4f35957f03b76084f29d7c66d573fcec3d2e4bbc2844549e44bc1aed4c6c24. // // Solidity: event MinerRoleSeized(uint256 indexed assignmentId, uint256 indexed inferenceId, address indexed miner) func (_IWorkerHub *IWorkerHubFilterer) WatchMinerRoleSeized(opts *bind.WatchOpts, sink chan<- *IWorkerHubMinerRoleSeized, assignmentId []*big.Int, inferenceId []*big.Int, miner []common.Address) (event.Subscription, error) { var assignmentIdRule []interface{} for _, assignmentIdItem := range assignmentId { assignmentIdRule = append(assignmentIdRule, assignmentIdItem) } var inferenceIdRule []interface{} for _, inferenceIdItem := range inferenceId { inferenceIdRule = append(inferenceIdRule, inferenceIdItem) } var minerRule []interface{} for _, minerItem := range miner { minerRule = append(minerRule, minerItem) } logs, sub, err := _IWorkerHub.contract.WatchLogs(opts, "MinerRoleSeized", assignmentIdRule, inferenceIdRule, minerRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(IWorkerHubMinerRoleSeized) if err := _IWorkerHub.contract.UnpackLog(event, "MinerRoleSeized", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseMinerRoleSeized is a log parse operation binding the contract event 0x3d4f35957f03b76084f29d7c66d573fcec3d2e4bbc2844549e44bc1aed4c6c24. // // Solidity: event MinerRoleSeized(uint256 indexed assignmentId, uint256 indexed inferenceId, address indexed miner) func (_IWorkerHub *IWorkerHubFilterer) ParseMinerRoleSeized(log types.Log) (*IWorkerHubMinerRoleSeized, error) { event := new(IWorkerHubMinerRoleSeized) if err := _IWorkerHub.contract.UnpackLog(event, "MinerRoleSeized", log); err != nil { return nil, err } event.Raw = log return event, nil } // IWorkerHubMinerUnregistrationIterator is returned from FilterMinerUnregistration and is used to iterate over the raw logs and unpacked data for MinerUnregistration events raised by the IWorkerHub contract. type IWorkerHubMinerUnregistrationIterator struct { Event *IWorkerHubMinerUnregistration // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *IWorkerHubMinerUnregistrationIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(IWorkerHubMinerUnregistration) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(IWorkerHubMinerUnregistration) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *IWorkerHubMinerUnregistrationIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *IWorkerHubMinerUnregistrationIterator) Close() error { it.sub.Unsubscribe() return nil } // IWorkerHubMinerUnregistration represents a MinerUnregistration event raised by the IWorkerHub contract. type IWorkerHubMinerUnregistration struct { Miner common.Address Raw types.Log // Blockchain specific contextual infos } // FilterMinerUnregistration is a free log retrieval operation binding the contract event 0x8f54596d72781f60dbf7dad7e576f06ce17bbda0bdf384463f7734f85f51498e. // // Solidity: event MinerUnregistration(address indexed miner) func (_IWorkerHub *IWorkerHubFilterer) FilterMinerUnregistration(opts *bind.FilterOpts, miner []common.Address) (*IWorkerHubMinerUnregistrationIterator, error) { var minerRule []interface{} for _, minerItem := range miner { minerRule = append(minerRule, minerItem) } logs, sub, err := _IWorkerHub.contract.FilterLogs(opts, "MinerUnregistration", minerRule) if err != nil { return nil, err } return &IWorkerHubMinerUnregistrationIterator{contract: _IWorkerHub.contract, event: "MinerUnregistration", logs: logs, sub: sub}, nil } // WatchMinerUnregistration is a free log subscription operation binding the contract event 0x8f54596d72781f60dbf7dad7e576f06ce17bbda0bdf384463f7734f85f51498e. // // Solidity: event MinerUnregistration(address indexed miner) func (_IWorkerHub *IWorkerHubFilterer) WatchMinerUnregistration(opts *bind.WatchOpts, sink chan<- *IWorkerHubMinerUnregistration, miner []common.Address) (event.Subscription, error) { var minerRule []interface{} for _, minerItem := range miner { minerRule = append(minerRule, minerItem) } logs, sub, err := _IWorkerHub.contract.WatchLogs(opts, "MinerUnregistration", minerRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(IWorkerHubMinerUnregistration) if err := _IWorkerHub.contract.UnpackLog(event, "MinerUnregistration", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseMinerUnregistration is a log parse operation binding the contract event 0x8f54596d72781f60dbf7dad7e576f06ce17bbda0bdf384463f7734f85f51498e. // // Solidity: event MinerUnregistration(address indexed miner) func (_IWorkerHub *IWorkerHubFilterer) ParseMinerUnregistration(log types.Log) (*IWorkerHubMinerUnregistration, error) { event := new(IWorkerHubMinerUnregistration) if err := _IWorkerHub.contract.UnpackLog(event, "MinerUnregistration", log); err != nil { return nil, err } event.Raw = log return event, nil } // IWorkerHubMinerUnstakeIterator is returned from FilterMinerUnstake and is used to iterate over the raw logs and unpacked data for MinerUnstake events raised by the IWorkerHub contract. type IWorkerHubMinerUnstakeIterator struct { Event *IWorkerHubMinerUnstake // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *IWorkerHubMinerUnstakeIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(IWorkerHubMinerUnstake) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(IWorkerHubMinerUnstake) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *IWorkerHubMinerUnstakeIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *IWorkerHubMinerUnstakeIterator) Close() error { it.sub.Unsubscribe() return nil } // IWorkerHubMinerUnstake represents a MinerUnstake event raised by the IWorkerHub contract. type IWorkerHubMinerUnstake struct { Miner common.Address Stake *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterMinerUnstake is a free log retrieval operation binding the contract event 0x1051154647682075e7cc0645853209e75208cb5acd862fc83f7fd0fcaa9624b4. // // Solidity: event MinerUnstake(address indexed miner, uint256 stake) func (_IWorkerHub *IWorkerHubFilterer) FilterMinerUnstake(opts *bind.FilterOpts, miner []common.Address) (*IWorkerHubMinerUnstakeIterator, error) { var minerRule []interface{} for _, minerItem := range miner { minerRule = append(minerRule, minerItem) } logs, sub, err := _IWorkerHub.contract.FilterLogs(opts, "MinerUnstake", minerRule) if err != nil { return nil, err } return &IWorkerHubMinerUnstakeIterator{contract: _IWorkerHub.contract, event: "MinerUnstake", logs: logs, sub: sub}, nil } // WatchMinerUnstake is a free log subscription operation binding the contract event 0x1051154647682075e7cc0645853209e75208cb5acd862fc83f7fd0fcaa9624b4. // // Solidity: event MinerUnstake(address indexed miner, uint256 stake) func (_IWorkerHub *IWorkerHubFilterer) WatchMinerUnstake(opts *bind.WatchOpts, sink chan<- *IWorkerHubMinerUnstake, miner []common.Address) (event.Subscription, error) { var minerRule []interface{} for _, minerItem := range miner { minerRule = append(minerRule, minerItem) } logs, sub, err := _IWorkerHub.contract.WatchLogs(opts, "MinerUnstake", minerRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(IWorkerHubMinerUnstake) if err := _IWorkerHub.contract.UnpackLog(event, "MinerUnstake", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseMinerUnstake is a log parse operation binding the contract event 0x1051154647682075e7cc0645853209e75208cb5acd862fc83f7fd0fcaa9624b4. // // Solidity: event MinerUnstake(address indexed miner, uint256 stake) func (_IWorkerHub *IWorkerHubFilterer) ParseMinerUnstake(log types.Log) (*IWorkerHubMinerUnstake, error) { event := new(IWorkerHubMinerUnstake) if err := _IWorkerHub.contract.UnpackLog(event, "MinerUnstake", log); err != nil { return nil, err } event.Raw = log return event, nil } // IWorkerHubMiningTimeLimitUpdateIterator is returned from FilterMiningTimeLimitUpdate and is used to iterate over the raw logs and unpacked data for MiningTimeLimitUpdate events raised by the IWorkerHub contract. type IWorkerHubMiningTimeLimitUpdateIterator struct { Event *IWorkerHubMiningTimeLimitUpdate // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *IWorkerHubMiningTimeLimitUpdateIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(IWorkerHubMiningTimeLimitUpdate) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(IWorkerHubMiningTimeLimitUpdate) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *IWorkerHubMiningTimeLimitUpdateIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *IWorkerHubMiningTimeLimitUpdateIterator) Close() error { it.sub.Unsubscribe() return nil } // IWorkerHubMiningTimeLimitUpdate represents a MiningTimeLimitUpdate event raised by the IWorkerHub contract. type IWorkerHubMiningTimeLimitUpdate struct { NewValue *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterMiningTimeLimitUpdate is a free log retrieval operation binding the contract event 0xd223a90576ecd9f418b264c3465ab13fad46f62b72bf17dca91af5dc8b7e55a8. // // Solidity: event MiningTimeLimitUpdate(uint40 newValue) func (_IWorkerHub *IWorkerHubFilterer) FilterMiningTimeLimitUpdate(opts *bind.FilterOpts) (*IWorkerHubMiningTimeLimitUpdateIterator, error) { logs, sub, err := _IWorkerHub.contract.FilterLogs(opts, "MiningTimeLimitUpdate") if err != nil { return nil, err } return &IWorkerHubMiningTimeLimitUpdateIterator{contract: _IWorkerHub.contract, event: "MiningTimeLimitUpdate", logs: logs, sub: sub}, nil } // WatchMiningTimeLimitUpdate is a free log subscription operation binding the contract event 0xd223a90576ecd9f418b264c3465ab13fad46f62b72bf17dca91af5dc8b7e55a8. // // Solidity: event MiningTimeLimitUpdate(uint40 newValue) func (_IWorkerHub *IWorkerHubFilterer) WatchMiningTimeLimitUpdate(opts *bind.WatchOpts, sink chan<- *IWorkerHubMiningTimeLimitUpdate) (event.Subscription, error) { logs, sub, err := _IWorkerHub.contract.WatchLogs(opts, "MiningTimeLimitUpdate") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(IWorkerHubMiningTimeLimitUpdate) if err := _IWorkerHub.contract.UnpackLog(event, "MiningTimeLimitUpdate", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseMiningTimeLimitUpdate is a log parse operation binding the contract event 0xd223a90576ecd9f418b264c3465ab13fad46f62b72bf17dca91af5dc8b7e55a8. // // Solidity: event MiningTimeLimitUpdate(uint40 newValue) func (_IWorkerHub *IWorkerHubFilterer) ParseMiningTimeLimitUpdate(log types.Log) (*IWorkerHubMiningTimeLimitUpdate, error) { event := new(IWorkerHubMiningTimeLimitUpdate) if err := _IWorkerHub.contract.UnpackLog(event, "MiningTimeLimitUpdate", log); err != nil { return nil, err } event.Raw = log return event, nil } // IWorkerHubModelMinimumFeeUpdateIterator is returned from FilterModelMinimumFeeUpdate and is used to iterate over the raw logs and unpacked data for ModelMinimumFeeUpdate events raised by the IWorkerHub contract. type IWorkerHubModelMinimumFeeUpdateIterator struct { Event *IWorkerHubModelMinimumFeeUpdate // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *IWorkerHubModelMinimumFeeUpdateIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(IWorkerHubModelMinimumFeeUpdate) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(IWorkerHubModelMinimumFeeUpdate) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *IWorkerHubModelMinimumFeeUpdateIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *IWorkerHubModelMinimumFeeUpdateIterator) Close() error { it.sub.Unsubscribe() return nil } // IWorkerHubModelMinimumFeeUpdate represents a ModelMinimumFeeUpdate event raised by the IWorkerHub contract. type IWorkerHubModelMinimumFeeUpdate struct { Model common.Address MinimumFee *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterModelMinimumFeeUpdate is a free log retrieval operation binding the contract event 0x923b5fe9c9974b3c93e434ae744faaa60ec86513c02614da5c8d9c51eda2bdd7. // // Solidity: event ModelMinimumFeeUpdate(address indexed model, uint256 minimumFee) func (_IWorkerHub *IWorkerHubFilterer) FilterModelMinimumFeeUpdate(opts *bind.FilterOpts, model []common.Address) (*IWorkerHubModelMinimumFeeUpdateIterator, error) { var modelRule []interface{} for _, modelItem := range model { modelRule = append(modelRule, modelItem) } logs, sub, err := _IWorkerHub.contract.FilterLogs(opts, "ModelMinimumFeeUpdate", modelRule) if err != nil { return nil, err } return &IWorkerHubModelMinimumFeeUpdateIterator{contract: _IWorkerHub.contract, event: "ModelMinimumFeeUpdate", logs: logs, sub: sub}, nil } // WatchModelMinimumFeeUpdate is a free log subscription operation binding the contract event 0x923b5fe9c9974b3c93e434ae744faaa60ec86513c02614da5c8d9c51eda2bdd7. // // Solidity: event ModelMinimumFeeUpdate(address indexed model, uint256 minimumFee) func (_IWorkerHub *IWorkerHubFilterer) WatchModelMinimumFeeUpdate(opts *bind.WatchOpts, sink chan<- *IWorkerHubModelMinimumFeeUpdate, model []common.Address) (event.Subscription, error) { var modelRule []interface{} for _, modelItem := range model { modelRule = append(modelRule, modelItem) } logs, sub, err := _IWorkerHub.contract.WatchLogs(opts, "ModelMinimumFeeUpdate", modelRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(IWorkerHubModelMinimumFeeUpdate) if err := _IWorkerHub.contract.UnpackLog(event, "ModelMinimumFeeUpdate", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseModelMinimumFeeUpdate is a log parse operation binding the contract event 0x923b5fe9c9974b3c93e434ae744faaa60ec86513c02614da5c8d9c51eda2bdd7. // // Solidity: event ModelMinimumFeeUpdate(address indexed model, uint256 minimumFee) func (_IWorkerHub *IWorkerHubFilterer) ParseModelMinimumFeeUpdate(log types.Log) (*IWorkerHubModelMinimumFeeUpdate, error) { event := new(IWorkerHubModelMinimumFeeUpdate) if err := _IWorkerHub.contract.UnpackLog(event, "ModelMinimumFeeUpdate", log); err != nil { return nil, err } event.Raw = log return event, nil } // IWorkerHubModelRegistrationIterator is returned from FilterModelRegistration and is used to iterate over the raw logs and unpacked data for ModelRegistration events raised by the IWorkerHub contract. type IWorkerHubModelRegistrationIterator struct { Event *IWorkerHubModelRegistration // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *IWorkerHubModelRegistrationIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(IWorkerHubModelRegistration) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(IWorkerHubModelRegistration) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *IWorkerHubModelRegistrationIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *IWorkerHubModelRegistrationIterator) Close() error { it.sub.Unsubscribe() return nil } // IWorkerHubModelRegistration represents a ModelRegistration event raised by the IWorkerHub contract. type IWorkerHubModelRegistration struct { Model common.Address Tier uint16 MinimumFee *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterModelRegistration is a free log retrieval operation binding the contract event 0x7041913a4cb21c28c931da9d9e4b5ed0ad84e47fcf2a65527f03c438d534ed5c. // // Solidity: event ModelRegistration(address indexed model, uint16 indexed tier, uint256 minimumFee) func (_IWorkerHub *IWorkerHubFilterer) FilterModelRegistration(opts *bind.FilterOpts, model []common.Address, tier []uint16) (*IWorkerHubModelRegistrationIterator, error) { var modelRule []interface{} for _, modelItem := range model { modelRule = append(modelRule, modelItem) } var tierRule []interface{} for _, tierItem := range tier { tierRule = append(tierRule, tierItem) } logs, sub, err := _IWorkerHub.contract.FilterLogs(opts, "ModelRegistration", modelRule, tierRule) if err != nil { return nil, err } return &IWorkerHubModelRegistrationIterator{contract: _IWorkerHub.contract, event: "ModelRegistration", logs: logs, sub: sub}, nil } // WatchModelRegistration is a free log subscription operation binding the contract event 0x7041913a4cb21c28c931da9d9e4b5ed0ad84e47fcf2a65527f03c438d534ed5c. // // Solidity: event ModelRegistration(address indexed model, uint16 indexed tier, uint256 minimumFee) func (_IWorkerHub *IWorkerHubFilterer) WatchModelRegistration(opts *bind.WatchOpts, sink chan<- *IWorkerHubModelRegistration, model []common.Address, tier []uint16) (event.Subscription, error) { var modelRule []interface{} for _, modelItem := range model { modelRule = append(modelRule, modelItem) } var tierRule []interface{} for _, tierItem := range tier { tierRule = append(tierRule, tierItem) } logs, sub, err := _IWorkerHub.contract.WatchLogs(opts, "ModelRegistration", modelRule, tierRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(IWorkerHubModelRegistration) if err := _IWorkerHub.contract.UnpackLog(event, "ModelRegistration", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseModelRegistration is a log parse operation binding the contract event 0x7041913a4cb21c28c931da9d9e4b5ed0ad84e47fcf2a65527f03c438d534ed5c. // // Solidity: event ModelRegistration(address indexed model, uint16 indexed tier, uint256 minimumFee) func (_IWorkerHub *IWorkerHubFilterer) ParseModelRegistration(log types.Log) (*IWorkerHubModelRegistration, error) { event := new(IWorkerHubModelRegistration) if err := _IWorkerHub.contract.UnpackLog(event, "ModelRegistration", log); err != nil { return nil, err } event.Raw = log return event, nil } // IWorkerHubModelTierUpdateIterator is returned from FilterModelTierUpdate and is used to iterate over the raw logs and unpacked data for ModelTierUpdate events raised by the IWorkerHub contract. type IWorkerHubModelTierUpdateIterator struct { Event *IWorkerHubModelTierUpdate // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *IWorkerHubModelTierUpdateIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(IWorkerHubModelTierUpdate) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(IWorkerHubModelTierUpdate) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *IWorkerHubModelTierUpdateIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *IWorkerHubModelTierUpdateIterator) Close() error { it.sub.Unsubscribe() return nil } // IWorkerHubModelTierUpdate represents a ModelTierUpdate event raised by the IWorkerHub contract. type IWorkerHubModelTierUpdate struct { Model common.Address Tier uint32 Raw types.Log // Blockchain specific contextual infos } // FilterModelTierUpdate is a free log retrieval operation binding the contract event 0x64905396482bb1067a551077143915c77b512b1cfea5db34c903943c1c2a5a15. // // Solidity: event ModelTierUpdate(address indexed model, uint32 tier) func (_IWorkerHub *IWorkerHubFilterer) FilterModelTierUpdate(opts *bind.FilterOpts, model []common.Address) (*IWorkerHubModelTierUpdateIterator, error) { var modelRule []interface{} for _, modelItem := range model { modelRule = append(modelRule, modelItem) } logs, sub, err := _IWorkerHub.contract.FilterLogs(opts, "ModelTierUpdate", modelRule) if err != nil { return nil, err } return &IWorkerHubModelTierUpdateIterator{contract: _IWorkerHub.contract, event: "ModelTierUpdate", logs: logs, sub: sub}, nil } // WatchModelTierUpdate is a free log subscription operation binding the contract event 0x64905396482bb1067a551077143915c77b512b1cfea5db34c903943c1c2a5a15. // // Solidity: event ModelTierUpdate(address indexed model, uint32 tier) func (_IWorkerHub *IWorkerHubFilterer) WatchModelTierUpdate(opts *bind.WatchOpts, sink chan<- *IWorkerHubModelTierUpdate, model []common.Address) (event.Subscription, error) { var modelRule []interface{} for _, modelItem := range model { modelRule = append(modelRule, modelItem) } logs, sub, err := _IWorkerHub.contract.WatchLogs(opts, "ModelTierUpdate", modelRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(IWorkerHubModelTierUpdate) if err := _IWorkerHub.contract.UnpackLog(event, "ModelTierUpdate", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseModelTierUpdate is a log parse operation binding the contract event 0x64905396482bb1067a551077143915c77b512b1cfea5db34c903943c1c2a5a15. // // Solidity: event ModelTierUpdate(address indexed model, uint32 tier) func (_IWorkerHub *IWorkerHubFilterer) ParseModelTierUpdate(log types.Log) (*IWorkerHubModelTierUpdate, error) { event := new(IWorkerHubModelTierUpdate) if err := _IWorkerHub.contract.UnpackLog(event, "ModelTierUpdate", log); err != nil { return nil, err } event.Raw = log return event, nil } // IWorkerHubModelUnregistrationIterator is returned from FilterModelUnregistration and is used to iterate over the raw logs and unpacked data for ModelUnregistration events raised by the IWorkerHub contract. type IWorkerHubModelUnregistrationIterator struct { Event *IWorkerHubModelUnregistration // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *IWorkerHubModelUnregistrationIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(IWorkerHubModelUnregistration) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(IWorkerHubModelUnregistration) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *IWorkerHubModelUnregistrationIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *IWorkerHubModelUnregistrationIterator) Close() error { it.sub.Unsubscribe() return nil } // IWorkerHubModelUnregistration represents a ModelUnregistration event raised by the IWorkerHub contract. type IWorkerHubModelUnregistration struct { Model common.Address Raw types.Log // Blockchain specific contextual infos } // FilterModelUnregistration is a free log retrieval operation binding the contract event 0x68180f49300b9177ab3b88d3f909a002abeb9c2f769543a93234ca68333582d7. // // Solidity: event ModelUnregistration(address indexed model) func (_IWorkerHub *IWorkerHubFilterer) FilterModelUnregistration(opts *bind.FilterOpts, model []common.Address) (*IWorkerHubModelUnregistrationIterator, error) { var modelRule []interface{} for _, modelItem := range model { modelRule = append(modelRule, modelItem) } logs, sub, err := _IWorkerHub.contract.FilterLogs(opts, "ModelUnregistration", modelRule) if err != nil { return nil, err } return &IWorkerHubModelUnregistrationIterator{contract: _IWorkerHub.contract, event: "ModelUnregistration", logs: logs, sub: sub}, nil } // WatchModelUnregistration is a free log subscription operation binding the contract event 0x68180f49300b9177ab3b88d3f909a002abeb9c2f769543a93234ca68333582d7. // // Solidity: event ModelUnregistration(address indexed model) func (_IWorkerHub *IWorkerHubFilterer) WatchModelUnregistration(opts *bind.WatchOpts, sink chan<- *IWorkerHubModelUnregistration, model []common.Address) (event.Subscription, error) { var modelRule []interface{} for _, modelItem := range model { modelRule = append(modelRule, modelItem) } logs, sub, err := _IWorkerHub.contract.WatchLogs(opts, "ModelUnregistration", modelRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(IWorkerHubModelUnregistration) if err := _IWorkerHub.contract.UnpackLog(event, "ModelUnregistration", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseModelUnregistration is a log parse operation binding the contract event 0x68180f49300b9177ab3b88d3f909a002abeb9c2f769543a93234ca68333582d7. // // Solidity: event ModelUnregistration(address indexed model) func (_IWorkerHub *IWorkerHubFilterer) ParseModelUnregistration(log types.Log) (*IWorkerHubModelUnregistration, error) { event := new(IWorkerHubModelUnregistration) if err := _IWorkerHub.contract.UnpackLog(event, "ModelUnregistration", log); err != nil { return nil, err } event.Raw = log return event, nil } // IWorkerHubNewAssignmentIterator is returned from FilterNewAssignment and is used to iterate over the raw logs and unpacked data for NewAssignment events raised by the IWorkerHub contract. type IWorkerHubNewAssignmentIterator struct { Event *IWorkerHubNewAssignment // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *IWorkerHubNewAssignmentIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(IWorkerHubNewAssignment) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(IWorkerHubNewAssignment) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *IWorkerHubNewAssignmentIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *IWorkerHubNewAssignmentIterator) Close() error { it.sub.Unsubscribe() return nil } // IWorkerHubNewAssignment represents a NewAssignment event raised by the IWorkerHub contract. type IWorkerHubNewAssignment struct { AssignmentId *big.Int InferenceId *big.Int Miner common.Address ExpiredAt *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterNewAssignment is a free log retrieval operation binding the contract event 0x53cc8b652f33c56dac5f1c97a284cc971e7adcb8abe9454b0853f076c6deb7d5. // // Solidity: event NewAssignment(uint256 indexed assignmentId, uint256 indexed inferenceId, address indexed miner, uint40 expiredAt) func (_IWorkerHub *IWorkerHubFilterer) FilterNewAssignment(opts *bind.FilterOpts, assignmentId []*big.Int, inferenceId []*big.Int, miner []common.Address) (*IWorkerHubNewAssignmentIterator, error) { var assignmentIdRule []interface{} for _, assignmentIdItem := range assignmentId { assignmentIdRule = append(assignmentIdRule, assignmentIdItem) } var inferenceIdRule []interface{} for _, inferenceIdItem := range inferenceId { inferenceIdRule = append(inferenceIdRule, inferenceIdItem) } var minerRule []interface{} for _, minerItem := range miner { minerRule = append(minerRule, minerItem) } logs, sub, err := _IWorkerHub.contract.FilterLogs(opts, "NewAssignment", assignmentIdRule, inferenceIdRule, minerRule) if err != nil { return nil, err } return &IWorkerHubNewAssignmentIterator{contract: _IWorkerHub.contract, event: "NewAssignment", logs: logs, sub: sub}, nil } // WatchNewAssignment is a free log subscription operation binding the contract event 0x53cc8b652f33c56dac5f1c97a284cc971e7adcb8abe9454b0853f076c6deb7d5. // // Solidity: event NewAssignment(uint256 indexed assignmentId, uint256 indexed inferenceId, address indexed miner, uint40 expiredAt) func (_IWorkerHub *IWorkerHubFilterer) WatchNewAssignment(opts *bind.WatchOpts, sink chan<- *IWorkerHubNewAssignment, assignmentId []*big.Int, inferenceId []*big.Int, miner []common.Address) (event.Subscription, error) { var assignmentIdRule []interface{} for _, assignmentIdItem := range assignmentId { assignmentIdRule = append(assignmentIdRule, assignmentIdItem) } var inferenceIdRule []interface{} for _, inferenceIdItem := range inferenceId { inferenceIdRule = append(inferenceIdRule, inferenceIdItem) } var minerRule []interface{} for _, minerItem := range miner { minerRule = append(minerRule, minerItem) } logs, sub, err := _IWorkerHub.contract.WatchLogs(opts, "NewAssignment", assignmentIdRule, inferenceIdRule, minerRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(IWorkerHubNewAssignment) if err := _IWorkerHub.contract.UnpackLog(event, "NewAssignment", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseNewAssignment is a log parse operation binding the contract event 0x53cc8b652f33c56dac5f1c97a284cc971e7adcb8abe9454b0853f076c6deb7d5. // // Solidity: event NewAssignment(uint256 indexed assignmentId, uint256 indexed inferenceId, address indexed miner, uint40 expiredAt) func (_IWorkerHub *IWorkerHubFilterer) ParseNewAssignment(log types.Log) (*IWorkerHubNewAssignment, error) { event := new(IWorkerHubNewAssignment) if err := _IWorkerHub.contract.UnpackLog(event, "NewAssignment", log); err != nil { return nil, err } event.Raw = log return event, nil } // IWorkerHubNewInferenceIterator is returned from FilterNewInference and is used to iterate over the raw logs and unpacked data for NewInference events raised by the IWorkerHub contract. type IWorkerHubNewInferenceIterator struct { Event *IWorkerHubNewInference // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *IWorkerHubNewInferenceIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(IWorkerHubNewInference) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(IWorkerHubNewInference) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *IWorkerHubNewInferenceIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *IWorkerHubNewInferenceIterator) Close() error { it.sub.Unsubscribe() return nil } // IWorkerHubNewInference represents a NewInference event raised by the IWorkerHub contract. type IWorkerHubNewInference struct { InferenceId *big.Int Model common.Address Creator common.Address Value *big.Int OriginInferenceId *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterNewInference is a free log retrieval operation binding the contract event 0x08a84d7fb7cd1557f228c827b9280f44d1a157c3256fe453b687a7b9d51c6a5b. // // Solidity: event NewInference(uint256 indexed inferenceId, address indexed model, address indexed creator, uint256 value, uint256 originInferenceId) func (_IWorkerHub *IWorkerHubFilterer) FilterNewInference(opts *bind.FilterOpts, inferenceId []*big.Int, model []common.Address, creator []common.Address) (*IWorkerHubNewInferenceIterator, error) { var inferenceIdRule []interface{} for _, inferenceIdItem := range inferenceId { inferenceIdRule = append(inferenceIdRule, inferenceIdItem) } var modelRule []interface{} for _, modelItem := range model { modelRule = append(modelRule, modelItem) } var creatorRule []interface{} for _, creatorItem := range creator { creatorRule = append(creatorRule, creatorItem) } logs, sub, err := _IWorkerHub.contract.FilterLogs(opts, "NewInference", inferenceIdRule, modelRule, creatorRule) if err != nil { return nil, err } return &IWorkerHubNewInferenceIterator{contract: _IWorkerHub.contract, event: "NewInference", logs: logs, sub: sub}, nil } // WatchNewInference is a free log subscription operation binding the contract event 0x08a84d7fb7cd1557f228c827b9280f44d1a157c3256fe453b687a7b9d51c6a5b. // // Solidity: event NewInference(uint256 indexed inferenceId, address indexed model, address indexed creator, uint256 value, uint256 originInferenceId) func (_IWorkerHub *IWorkerHubFilterer) WatchNewInference(opts *bind.WatchOpts, sink chan<- *IWorkerHubNewInference, inferenceId []*big.Int, model []common.Address, creator []common.Address) (event.Subscription, error) { var inferenceIdRule []interface{} for _, inferenceIdItem := range inferenceId { inferenceIdRule = append(inferenceIdRule, inferenceIdItem) } var modelRule []interface{} for _, modelItem := range model { modelRule = append(modelRule, modelItem) } var creatorRule []interface{} for _, creatorItem := range creator { creatorRule = append(creatorRule, creatorItem) } logs, sub, err := _IWorkerHub.contract.WatchLogs(opts, "NewInference", inferenceIdRule, modelRule, creatorRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(IWorkerHubNewInference) if err := _IWorkerHub.contract.UnpackLog(event, "NewInference", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseNewInference is a log parse operation binding the contract event 0x08a84d7fb7cd1557f228c827b9280f44d1a157c3256fe453b687a7b9d51c6a5b. // // Solidity: event NewInference(uint256 indexed inferenceId, address indexed model, address indexed creator, uint256 value, uint256 originInferenceId) func (_IWorkerHub *IWorkerHubFilterer) ParseNewInference(log types.Log) (*IWorkerHubNewInference, error) { event := new(IWorkerHubNewInference) if err := _IWorkerHub.contract.UnpackLog(event, "NewInference", log); err != nil { return nil, err } event.Raw = log return event, nil } // IWorkerHubNewScoringInferenceIterator is returned from FilterNewScoringInference and is used to iterate over the raw logs and unpacked data for NewScoringInference events raised by the IWorkerHub contract. type IWorkerHubNewScoringInferenceIterator struct { Event *IWorkerHubNewScoringInference // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *IWorkerHubNewScoringInferenceIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(IWorkerHubNewScoringInference) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(IWorkerHubNewScoringInference) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *IWorkerHubNewScoringInferenceIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *IWorkerHubNewScoringInferenceIterator) Close() error { it.sub.Unsubscribe() return nil } // IWorkerHubNewScoringInference represents a NewScoringInference event raised by the IWorkerHub contract. type IWorkerHubNewScoringInference struct { InferenceId *big.Int Model common.Address Creator common.Address Value *big.Int OriginInferenceId *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterNewScoringInference is a free log retrieval operation binding the contract event 0x3ec54c04f8c304e8caa7314d1ac4d34bff1c57151f207745b19e6d8f0a579ea9. // // Solidity: event NewScoringInference(uint256 indexed inferenceId, address indexed model, address indexed creator, uint256 value, uint256 originInferenceId) func (_IWorkerHub *IWorkerHubFilterer) FilterNewScoringInference(opts *bind.FilterOpts, inferenceId []*big.Int, model []common.Address, creator []common.Address) (*IWorkerHubNewScoringInferenceIterator, error) { var inferenceIdRule []interface{} for _, inferenceIdItem := range inferenceId { inferenceIdRule = append(inferenceIdRule, inferenceIdItem) } var modelRule []interface{} for _, modelItem := range model { modelRule = append(modelRule, modelItem) } var creatorRule []interface{} for _, creatorItem := range creator { creatorRule = append(creatorRule, creatorItem) } logs, sub, err := _IWorkerHub.contract.FilterLogs(opts, "NewScoringInference", inferenceIdRule, modelRule, creatorRule) if err != nil { return nil, err } return &IWorkerHubNewScoringInferenceIterator{contract: _IWorkerHub.contract, event: "NewScoringInference", logs: logs, sub: sub}, nil } // WatchNewScoringInference is a free log subscription operation binding the contract event 0x3ec54c04f8c304e8caa7314d1ac4d34bff1c57151f207745b19e6d8f0a579ea9. // // Solidity: event NewScoringInference(uint256 indexed inferenceId, address indexed model, address indexed creator, uint256 value, uint256 originInferenceId) func (_IWorkerHub *IWorkerHubFilterer) WatchNewScoringInference(opts *bind.WatchOpts, sink chan<- *IWorkerHubNewScoringInference, inferenceId []*big.Int, model []common.Address, creator []common.Address) (event.Subscription, error) { var inferenceIdRule []interface{} for _, inferenceIdItem := range inferenceId { inferenceIdRule = append(inferenceIdRule, inferenceIdItem) } var modelRule []interface{} for _, modelItem := range model { modelRule = append(modelRule, modelItem) } var creatorRule []interface{} for _, creatorItem := range creator { creatorRule = append(creatorRule, creatorItem) } logs, sub, err := _IWorkerHub.contract.WatchLogs(opts, "NewScoringInference", inferenceIdRule, modelRule, creatorRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(IWorkerHubNewScoringInference) if err := _IWorkerHub.contract.UnpackLog(event, "NewScoringInference", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseNewScoringInference is a log parse operation binding the contract event 0x3ec54c04f8c304e8caa7314d1ac4d34bff1c57151f207745b19e6d8f0a579ea9. // // Solidity: event NewScoringInference(uint256 indexed inferenceId, address indexed model, address indexed creator, uint256 value, uint256 originInferenceId) func (_IWorkerHub *IWorkerHubFilterer) ParseNewScoringInference(log types.Log) (*IWorkerHubNewScoringInference, error) { event := new(IWorkerHubNewScoringInference) if err := _IWorkerHub.contract.UnpackLog(event, "NewScoringInference", log); err != nil { return nil, err } event.Raw = log return event, nil } // IWorkerHubOwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the IWorkerHub contract. type IWorkerHubOwnershipTransferredIterator struct { Event *IWorkerHubOwnershipTransferred // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *IWorkerHubOwnershipTransferredIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(IWorkerHubOwnershipTransferred) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(IWorkerHubOwnershipTransferred) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *IWorkerHubOwnershipTransferredIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *IWorkerHubOwnershipTransferredIterator) Close() error { it.sub.Unsubscribe() return nil } // IWorkerHubOwnershipTransferred represents a OwnershipTransferred event raised by the IWorkerHub contract. type IWorkerHubOwnershipTransferred struct { PreviousOwner common.Address NewOwner common.Address Raw types.Log // Blockchain specific contextual infos } // FilterOwnershipTransferred is a free log retrieval operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. // // Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) func (_IWorkerHub *IWorkerHubFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*IWorkerHubOwnershipTransferredIterator, error) { var previousOwnerRule []interface{} for _, previousOwnerItem := range previousOwner { previousOwnerRule = append(previousOwnerRule, previousOwnerItem) } var newOwnerRule []interface{} for _, newOwnerItem := range newOwner { newOwnerRule = append(newOwnerRule, newOwnerItem) } logs, sub, err := _IWorkerHub.contract.FilterLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) if err != nil { return nil, err } return &IWorkerHubOwnershipTransferredIterator{contract: _IWorkerHub.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil } // WatchOwnershipTransferred is a free log subscription operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. // // Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) func (_IWorkerHub *IWorkerHubFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *IWorkerHubOwnershipTransferred, previousOwner []common.Address, newOwner []common.Address) (event.Subscription, error) { var previousOwnerRule []interface{} for _, previousOwnerItem := range previousOwner { previousOwnerRule = append(previousOwnerRule, previousOwnerItem) } var newOwnerRule []interface{} for _, newOwnerItem := range newOwner { newOwnerRule = append(newOwnerRule, newOwnerItem) } logs, sub, err := _IWorkerHub.contract.WatchLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(IWorkerHubOwnershipTransferred) if err := _IWorkerHub.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseOwnershipTransferred is a log parse operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. // // Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) func (_IWorkerHub *IWorkerHubFilterer) ParseOwnershipTransferred(log types.Log) (*IWorkerHubOwnershipTransferred, error) { event := new(IWorkerHubOwnershipTransferred) if err := _IWorkerHub.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { return nil, err } event.Raw = log return event, nil } // IWorkerHubPausedIterator is returned from FilterPaused and is used to iterate over the raw logs and unpacked data for Paused events raised by the IWorkerHub contract. type IWorkerHubPausedIterator struct { Event *IWorkerHubPaused // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *IWorkerHubPausedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(IWorkerHubPaused) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(IWorkerHubPaused) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *IWorkerHubPausedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *IWorkerHubPausedIterator) Close() error { it.sub.Unsubscribe() return nil } // IWorkerHubPaused represents a Paused event raised by the IWorkerHub contract. type IWorkerHubPaused struct { Account common.Address Raw types.Log // Blockchain specific contextual infos } // FilterPaused is a free log retrieval operation binding the contract event 0x62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258. // // Solidity: event Paused(address account) func (_IWorkerHub *IWorkerHubFilterer) FilterPaused(opts *bind.FilterOpts) (*IWorkerHubPausedIterator, error) { logs, sub, err := _IWorkerHub.contract.FilterLogs(opts, "Paused") if err != nil { return nil, err } return &IWorkerHubPausedIterator{contract: _IWorkerHub.contract, event: "Paused", logs: logs, sub: sub}, nil } // WatchPaused is a free log subscription operation binding the contract event 0x62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258. // // Solidity: event Paused(address account) func (_IWorkerHub *IWorkerHubFilterer) WatchPaused(opts *bind.WatchOpts, sink chan<- *IWorkerHubPaused) (event.Subscription, error) { logs, sub, err := _IWorkerHub.contract.WatchLogs(opts, "Paused") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(IWorkerHubPaused) if err := _IWorkerHub.contract.UnpackLog(event, "Paused", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParsePaused is a log parse operation binding the contract event 0x62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258. // // Solidity: event Paused(address account) func (_IWorkerHub *IWorkerHubFilterer) ParsePaused(log types.Log) (*IWorkerHubPaused, error) { event := new(IWorkerHubPaused) if err := _IWorkerHub.contract.UnpackLog(event, "Paused", log); err != nil { return nil, err } event.Raw = log return event, nil } // IWorkerHubPenaltyDurationUpdatedIterator is returned from FilterPenaltyDurationUpdated and is used to iterate over the raw logs and unpacked data for PenaltyDurationUpdated events raised by the IWorkerHub contract. type IWorkerHubPenaltyDurationUpdatedIterator struct { Event *IWorkerHubPenaltyDurationUpdated // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *IWorkerHubPenaltyDurationUpdatedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(IWorkerHubPenaltyDurationUpdated) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(IWorkerHubPenaltyDurationUpdated) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *IWorkerHubPenaltyDurationUpdatedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *IWorkerHubPenaltyDurationUpdatedIterator) Close() error { it.sub.Unsubscribe() return nil } // IWorkerHubPenaltyDurationUpdated represents a PenaltyDurationUpdated event raised by the IWorkerHub contract. type IWorkerHubPenaltyDurationUpdated struct { OldDuration *big.Int NewDuration *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterPenaltyDurationUpdated is a free log retrieval operation binding the contract event 0xf7a437a25c636d2b29d0ba34f0f6870af14f44478eff2ac852f36030f2e2924e. // // Solidity: event PenaltyDurationUpdated(uint40 oldDuration, uint40 newDuration) func (_IWorkerHub *IWorkerHubFilterer) FilterPenaltyDurationUpdated(opts *bind.FilterOpts) (*IWorkerHubPenaltyDurationUpdatedIterator, error) { logs, sub, err := _IWorkerHub.contract.FilterLogs(opts, "PenaltyDurationUpdated") if err != nil { return nil, err } return &IWorkerHubPenaltyDurationUpdatedIterator{contract: _IWorkerHub.contract, event: "PenaltyDurationUpdated", logs: logs, sub: sub}, nil } // WatchPenaltyDurationUpdated is a free log subscription operation binding the contract event 0xf7a437a25c636d2b29d0ba34f0f6870af14f44478eff2ac852f36030f2e2924e. // // Solidity: event PenaltyDurationUpdated(uint40 oldDuration, uint40 newDuration) func (_IWorkerHub *IWorkerHubFilterer) WatchPenaltyDurationUpdated(opts *bind.WatchOpts, sink chan<- *IWorkerHubPenaltyDurationUpdated) (event.Subscription, error) { logs, sub, err := _IWorkerHub.contract.WatchLogs(opts, "PenaltyDurationUpdated") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(IWorkerHubPenaltyDurationUpdated) if err := _IWorkerHub.contract.UnpackLog(event, "PenaltyDurationUpdated", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParsePenaltyDurationUpdated is a log parse operation binding the contract event 0xf7a437a25c636d2b29d0ba34f0f6870af14f44478eff2ac852f36030f2e2924e. // // Solidity: event PenaltyDurationUpdated(uint40 oldDuration, uint40 newDuration) func (_IWorkerHub *IWorkerHubFilterer) ParsePenaltyDurationUpdated(log types.Log) (*IWorkerHubPenaltyDurationUpdated, error) { event := new(IWorkerHubPenaltyDurationUpdated) if err := _IWorkerHub.contract.UnpackLog(event, "PenaltyDurationUpdated", log); err != nil { return nil, err } event.Raw = log return event, nil } // IWorkerHubRestakeIterator is returned from FilterRestake and is used to iterate over the raw logs and unpacked data for Restake events raised by the IWorkerHub contract. type IWorkerHubRestakeIterator struct { Event *IWorkerHubRestake // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *IWorkerHubRestakeIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(IWorkerHubRestake) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(IWorkerHubRestake) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *IWorkerHubRestakeIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *IWorkerHubRestakeIterator) Close() error { it.sub.Unsubscribe() return nil } // IWorkerHubRestake represents a Restake event raised by the IWorkerHub contract. type IWorkerHubRestake struct { Miner common.Address Restake *big.Int Model common.Address Raw types.Log // Blockchain specific contextual infos } // FilterRestake is a free log retrieval operation binding the contract event 0x5f8a19f664e489b0ebcc62ec24b1bde029195fbb4af60118cecf0e16d6d95b2d. // // Solidity: event Restake(address indexed miner, uint256 restake, address indexed model) func (_IWorkerHub *IWorkerHubFilterer) FilterRestake(opts *bind.FilterOpts, miner []common.Address, model []common.Address) (*IWorkerHubRestakeIterator, error) { var minerRule []interface{} for _, minerItem := range miner { minerRule = append(minerRule, minerItem) } var modelRule []interface{} for _, modelItem := range model { modelRule = append(modelRule, modelItem) } logs, sub, err := _IWorkerHub.contract.FilterLogs(opts, "Restake", minerRule, modelRule) if err != nil { return nil, err } return &IWorkerHubRestakeIterator{contract: _IWorkerHub.contract, event: "Restake", logs: logs, sub: sub}, nil } // WatchRestake is a free log subscription operation binding the contract event 0x5f8a19f664e489b0ebcc62ec24b1bde029195fbb4af60118cecf0e16d6d95b2d. // // Solidity: event Restake(address indexed miner, uint256 restake, address indexed model) func (_IWorkerHub *IWorkerHubFilterer) WatchRestake(opts *bind.WatchOpts, sink chan<- *IWorkerHubRestake, miner []common.Address, model []common.Address) (event.Subscription, error) { var minerRule []interface{} for _, minerItem := range miner { minerRule = append(minerRule, minerItem) } var modelRule []interface{} for _, modelItem := range model { modelRule = append(modelRule, modelItem) } logs, sub, err := _IWorkerHub.contract.WatchLogs(opts, "Restake", minerRule, modelRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(IWorkerHubRestake) if err := _IWorkerHub.contract.UnpackLog(event, "Restake", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseRestake is a log parse operation binding the contract event 0x5f8a19f664e489b0ebcc62ec24b1bde029195fbb4af60118cecf0e16d6d95b2d. // // Solidity: event Restake(address indexed miner, uint256 restake, address indexed model) func (_IWorkerHub *IWorkerHubFilterer) ParseRestake(log types.Log) (*IWorkerHubRestake, error) { event := new(IWorkerHubRestake) if err := _IWorkerHub.contract.UnpackLog(event, "Restake", log); err != nil { return nil, err } event.Raw = log return event, nil } // IWorkerHubRevealDurationIterator is returned from FilterRevealDuration and is used to iterate over the raw logs and unpacked data for RevealDuration events raised by the IWorkerHub contract. type IWorkerHubRevealDurationIterator struct { Event *IWorkerHubRevealDuration // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *IWorkerHubRevealDurationIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(IWorkerHubRevealDuration) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(IWorkerHubRevealDuration) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *IWorkerHubRevealDurationIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *IWorkerHubRevealDurationIterator) Close() error { it.sub.Unsubscribe() return nil } // IWorkerHubRevealDuration represents a RevealDuration event raised by the IWorkerHub contract. type IWorkerHubRevealDuration struct { OldTime *big.Int NewTime *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterRevealDuration is a free log retrieval operation binding the contract event 0xacb24019039b4d00193b2be5c85ea8ed6bd6747ed79f7d1e5a6d9384282b4a9d. // // Solidity: event RevealDuration(uint256 oldTime, uint256 newTime) func (_IWorkerHub *IWorkerHubFilterer) FilterRevealDuration(opts *bind.FilterOpts) (*IWorkerHubRevealDurationIterator, error) { logs, sub, err := _IWorkerHub.contract.FilterLogs(opts, "RevealDuration") if err != nil { return nil, err } return &IWorkerHubRevealDurationIterator{contract: _IWorkerHub.contract, event: "RevealDuration", logs: logs, sub: sub}, nil } // WatchRevealDuration is a free log subscription operation binding the contract event 0xacb24019039b4d00193b2be5c85ea8ed6bd6747ed79f7d1e5a6d9384282b4a9d. // // Solidity: event RevealDuration(uint256 oldTime, uint256 newTime) func (_IWorkerHub *IWorkerHubFilterer) WatchRevealDuration(opts *bind.WatchOpts, sink chan<- *IWorkerHubRevealDuration) (event.Subscription, error) { logs, sub, err := _IWorkerHub.contract.WatchLogs(opts, "RevealDuration") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(IWorkerHubRevealDuration) if err := _IWorkerHub.contract.UnpackLog(event, "RevealDuration", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseRevealDuration is a log parse operation binding the contract event 0xacb24019039b4d00193b2be5c85ea8ed6bd6747ed79f7d1e5a6d9384282b4a9d. // // Solidity: event RevealDuration(uint256 oldTime, uint256 newTime) func (_IWorkerHub *IWorkerHubFilterer) ParseRevealDuration(log types.Log) (*IWorkerHubRevealDuration, error) { event := new(IWorkerHubRevealDuration) if err := _IWorkerHub.contract.UnpackLog(event, "RevealDuration", log); err != nil { return nil, err } event.Raw = log return event, nil } // IWorkerHubRevealSubmissionIterator is returned from FilterRevealSubmission and is used to iterate over the raw logs and unpacked data for RevealSubmission events raised by the IWorkerHub contract. type IWorkerHubRevealSubmissionIterator struct { Event *IWorkerHubRevealSubmission // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *IWorkerHubRevealSubmissionIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(IWorkerHubRevealSubmission) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(IWorkerHubRevealSubmission) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *IWorkerHubRevealSubmissionIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *IWorkerHubRevealSubmissionIterator) Close() error { it.sub.Unsubscribe() return nil } // IWorkerHubRevealSubmission represents a RevealSubmission event raised by the IWorkerHub contract. type IWorkerHubRevealSubmission struct { Miner common.Address AssigmentId *big.Int Nonce *big.Int Output []byte Raw types.Log // Blockchain specific contextual infos } // FilterRevealSubmission is a free log retrieval operation binding the contract event 0xf7e30468a493d9e17158c0dbe51bcfa190627e3fdede3c9284827c22dfc41700. // // Solidity: event RevealSubmission(address indexed miner, uint256 indexed assigmentId, uint40 nonce, bytes output) func (_IWorkerHub *IWorkerHubFilterer) FilterRevealSubmission(opts *bind.FilterOpts, miner []common.Address, assigmentId []*big.Int) (*IWorkerHubRevealSubmissionIterator, error) { var minerRule []interface{} for _, minerItem := range miner { minerRule = append(minerRule, minerItem) } var assigmentIdRule []interface{} for _, assigmentIdItem := range assigmentId { assigmentIdRule = append(assigmentIdRule, assigmentIdItem) } logs, sub, err := _IWorkerHub.contract.FilterLogs(opts, "RevealSubmission", minerRule, assigmentIdRule) if err != nil { return nil, err } return &IWorkerHubRevealSubmissionIterator{contract: _IWorkerHub.contract, event: "RevealSubmission", logs: logs, sub: sub}, nil } // WatchRevealSubmission is a free log subscription operation binding the contract event 0xf7e30468a493d9e17158c0dbe51bcfa190627e3fdede3c9284827c22dfc41700. // // Solidity: event RevealSubmission(address indexed miner, uint256 indexed assigmentId, uint40 nonce, bytes output) func (_IWorkerHub *IWorkerHubFilterer) WatchRevealSubmission(opts *bind.WatchOpts, sink chan<- *IWorkerHubRevealSubmission, miner []common.Address, assigmentId []*big.Int) (event.Subscription, error) { var minerRule []interface{} for _, minerItem := range miner { minerRule = append(minerRule, minerItem) } var assigmentIdRule []interface{} for _, assigmentIdItem := range assigmentId { assigmentIdRule = append(assigmentIdRule, assigmentIdItem) } logs, sub, err := _IWorkerHub.contract.WatchLogs(opts, "RevealSubmission", minerRule, assigmentIdRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(IWorkerHubRevealSubmission) if err := _IWorkerHub.contract.UnpackLog(event, "RevealSubmission", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseRevealSubmission is a log parse operation binding the contract event 0xf7e30468a493d9e17158c0dbe51bcfa190627e3fdede3c9284827c22dfc41700. // // Solidity: event RevealSubmission(address indexed miner, uint256 indexed assigmentId, uint40 nonce, bytes output) func (_IWorkerHub *IWorkerHubFilterer) ParseRevealSubmission(log types.Log) (*IWorkerHubRevealSubmission, error) { event := new(IWorkerHubRevealSubmission) if err := _IWorkerHub.contract.UnpackLog(event, "RevealSubmission", log); err != nil { return nil, err } event.Raw = log return event, nil } // IWorkerHubRewardClaimIterator is returned from FilterRewardClaim and is used to iterate over the raw logs and unpacked data for RewardClaim events raised by the IWorkerHub contract. type IWorkerHubRewardClaimIterator struct { Event *IWorkerHubRewardClaim // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *IWorkerHubRewardClaimIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(IWorkerHubRewardClaim) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(IWorkerHubRewardClaim) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *IWorkerHubRewardClaimIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *IWorkerHubRewardClaimIterator) Close() error { it.sub.Unsubscribe() return nil } // IWorkerHubRewardClaim represents a RewardClaim event raised by the IWorkerHub contract. type IWorkerHubRewardClaim struct { Worker common.Address Value *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterRewardClaim is a free log retrieval operation binding the contract event 0x75690555e75b04e280e646889defdcbefd8401507e5394d1173fd84290944c29. // // Solidity: event RewardClaim(address indexed worker, uint256 value) func (_IWorkerHub *IWorkerHubFilterer) FilterRewardClaim(opts *bind.FilterOpts, worker []common.Address) (*IWorkerHubRewardClaimIterator, error) { var workerRule []interface{} for _, workerItem := range worker { workerRule = append(workerRule, workerItem) } logs, sub, err := _IWorkerHub.contract.FilterLogs(opts, "RewardClaim", workerRule) if err != nil { return nil, err } return &IWorkerHubRewardClaimIterator{contract: _IWorkerHub.contract, event: "RewardClaim", logs: logs, sub: sub}, nil } // WatchRewardClaim is a free log subscription operation binding the contract event 0x75690555e75b04e280e646889defdcbefd8401507e5394d1173fd84290944c29. // // Solidity: event RewardClaim(address indexed worker, uint256 value) func (_IWorkerHub *IWorkerHubFilterer) WatchRewardClaim(opts *bind.WatchOpts, sink chan<- *IWorkerHubRewardClaim, worker []common.Address) (event.Subscription, error) { var workerRule []interface{} for _, workerItem := range worker { workerRule = append(workerRule, workerItem) } logs, sub, err := _IWorkerHub.contract.WatchLogs(opts, "RewardClaim", workerRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(IWorkerHubRewardClaim) if err := _IWorkerHub.contract.UnpackLog(event, "RewardClaim", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseRewardClaim is a log parse operation binding the contract event 0x75690555e75b04e280e646889defdcbefd8401507e5394d1173fd84290944c29. // // Solidity: event RewardClaim(address indexed worker, uint256 value) func (_IWorkerHub *IWorkerHubFilterer) ParseRewardClaim(log types.Log) (*IWorkerHubRewardClaim, error) { event := new(IWorkerHubRewardClaim) if err := _IWorkerHub.contract.UnpackLog(event, "RewardClaim", log); err != nil { return nil, err } event.Raw = log return event, nil } // IWorkerHubRewardPerEpochIterator is returned from FilterRewardPerEpoch and is used to iterate over the raw logs and unpacked data for RewardPerEpoch events raised by the IWorkerHub contract. type IWorkerHubRewardPerEpochIterator struct { Event *IWorkerHubRewardPerEpoch // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *IWorkerHubRewardPerEpochIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(IWorkerHubRewardPerEpoch) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(IWorkerHubRewardPerEpoch) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *IWorkerHubRewardPerEpochIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *IWorkerHubRewardPerEpochIterator) Close() error { it.sub.Unsubscribe() return nil } // IWorkerHubRewardPerEpoch represents a RewardPerEpoch event raised by the IWorkerHub contract. type IWorkerHubRewardPerEpoch struct { OldReward *big.Int NewReward *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterRewardPerEpoch is a free log retrieval operation binding the contract event 0x3d731857045dfa7982ed8ff308eeda54c7e156ba99609db02c50b4485f64c463. // // Solidity: event RewardPerEpoch(uint256 oldReward, uint256 newReward) func (_IWorkerHub *IWorkerHubFilterer) FilterRewardPerEpoch(opts *bind.FilterOpts) (*IWorkerHubRewardPerEpochIterator, error) { logs, sub, err := _IWorkerHub.contract.FilterLogs(opts, "RewardPerEpoch") if err != nil { return nil, err } return &IWorkerHubRewardPerEpochIterator{contract: _IWorkerHub.contract, event: "RewardPerEpoch", logs: logs, sub: sub}, nil } // WatchRewardPerEpoch is a free log subscription operation binding the contract event 0x3d731857045dfa7982ed8ff308eeda54c7e156ba99609db02c50b4485f64c463. // // Solidity: event RewardPerEpoch(uint256 oldReward, uint256 newReward) func (_IWorkerHub *IWorkerHubFilterer) WatchRewardPerEpoch(opts *bind.WatchOpts, sink chan<- *IWorkerHubRewardPerEpoch) (event.Subscription, error) { logs, sub, err := _IWorkerHub.contract.WatchLogs(opts, "RewardPerEpoch") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(IWorkerHubRewardPerEpoch) if err := _IWorkerHub.contract.UnpackLog(event, "RewardPerEpoch", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseRewardPerEpoch is a log parse operation binding the contract event 0x3d731857045dfa7982ed8ff308eeda54c7e156ba99609db02c50b4485f64c463. // // Solidity: event RewardPerEpoch(uint256 oldReward, uint256 newReward) func (_IWorkerHub *IWorkerHubFilterer) ParseRewardPerEpoch(log types.Log) (*IWorkerHubRewardPerEpoch, error) { event := new(IWorkerHubRewardPerEpoch) if err := _IWorkerHub.contract.UnpackLog(event, "RewardPerEpoch", log); err != nil { return nil, err } event.Raw = log return event, nil } // IWorkerHubSolutionSubmissionIterator is returned from FilterSolutionSubmission and is used to iterate over the raw logs and unpacked data for SolutionSubmission events raised by the IWorkerHub contract. type IWorkerHubSolutionSubmissionIterator struct { Event *IWorkerHubSolutionSubmission // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *IWorkerHubSolutionSubmissionIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(IWorkerHubSolutionSubmission) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(IWorkerHubSolutionSubmission) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *IWorkerHubSolutionSubmissionIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *IWorkerHubSolutionSubmissionIterator) Close() error { it.sub.Unsubscribe() return nil } // IWorkerHubSolutionSubmission represents a SolutionSubmission event raised by the IWorkerHub contract. type IWorkerHubSolutionSubmission struct { Miner common.Address AssigmentId *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterSolutionSubmission is a free log retrieval operation binding the contract event 0x9f669b92b9cbc7611f7ab6c77db07a424051c777433e21bd90f1bdf940096dd9. // // Solidity: event SolutionSubmission(address indexed miner, uint256 indexed assigmentId) func (_IWorkerHub *IWorkerHubFilterer) FilterSolutionSubmission(opts *bind.FilterOpts, miner []common.Address, assigmentId []*big.Int) (*IWorkerHubSolutionSubmissionIterator, error) { var minerRule []interface{} for _, minerItem := range miner { minerRule = append(minerRule, minerItem) } var assigmentIdRule []interface{} for _, assigmentIdItem := range assigmentId { assigmentIdRule = append(assigmentIdRule, assigmentIdItem) } logs, sub, err := _IWorkerHub.contract.FilterLogs(opts, "SolutionSubmission", minerRule, assigmentIdRule) if err != nil { return nil, err } return &IWorkerHubSolutionSubmissionIterator{contract: _IWorkerHub.contract, event: "SolutionSubmission", logs: logs, sub: sub}, nil } // WatchSolutionSubmission is a free log subscription operation binding the contract event 0x9f669b92b9cbc7611f7ab6c77db07a424051c777433e21bd90f1bdf940096dd9. // // Solidity: event SolutionSubmission(address indexed miner, uint256 indexed assigmentId) func (_IWorkerHub *IWorkerHubFilterer) WatchSolutionSubmission(opts *bind.WatchOpts, sink chan<- *IWorkerHubSolutionSubmission, miner []common.Address, assigmentId []*big.Int) (event.Subscription, error) { var minerRule []interface{} for _, minerItem := range miner { minerRule = append(minerRule, minerItem) } var assigmentIdRule []interface{} for _, assigmentIdItem := range assigmentId { assigmentIdRule = append(assigmentIdRule, assigmentIdItem) } logs, sub, err := _IWorkerHub.contract.WatchLogs(opts, "SolutionSubmission", minerRule, assigmentIdRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(IWorkerHubSolutionSubmission) if err := _IWorkerHub.contract.UnpackLog(event, "SolutionSubmission", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseSolutionSubmission is a log parse operation binding the contract event 0x9f669b92b9cbc7611f7ab6c77db07a424051c777433e21bd90f1bdf940096dd9. // // Solidity: event SolutionSubmission(address indexed miner, uint256 indexed assigmentId) func (_IWorkerHub *IWorkerHubFilterer) ParseSolutionSubmission(log types.Log) (*IWorkerHubSolutionSubmission, error) { event := new(IWorkerHubSolutionSubmission) if err := _IWorkerHub.contract.UnpackLog(event, "SolutionSubmission", log); err != nil { return nil, err } event.Raw = log return event, nil } // IWorkerHubStreamedDataIterator is returned from FilterStreamedData and is used to iterate over the raw logs and unpacked data for StreamedData events raised by the IWorkerHub contract. type IWorkerHubStreamedDataIterator struct { Event *IWorkerHubStreamedData // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *IWorkerHubStreamedDataIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(IWorkerHubStreamedData) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(IWorkerHubStreamedData) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *IWorkerHubStreamedDataIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *IWorkerHubStreamedDataIterator) Close() error { it.sub.Unsubscribe() return nil } // IWorkerHubStreamedData represents a StreamedData event raised by the IWorkerHub contract. type IWorkerHubStreamedData struct { AssignmentId *big.Int Data []byte Raw types.Log // Blockchain specific contextual infos } // FilterStreamedData is a free log retrieval operation binding the contract event 0x23cfaa418b5f569ff36b152a9fd02ee3ccddaa5f7eed570e777a30353b68dc38. // // Solidity: event StreamedData(uint256 indexed assignmentId, bytes data) func (_IWorkerHub *IWorkerHubFilterer) FilterStreamedData(opts *bind.FilterOpts, assignmentId []*big.Int) (*IWorkerHubStreamedDataIterator, error) { var assignmentIdRule []interface{} for _, assignmentIdItem := range assignmentId { assignmentIdRule = append(assignmentIdRule, assignmentIdItem) } logs, sub, err := _IWorkerHub.contract.FilterLogs(opts, "StreamedData", assignmentIdRule) if err != nil { return nil, err } return &IWorkerHubStreamedDataIterator{contract: _IWorkerHub.contract, event: "StreamedData", logs: logs, sub: sub}, nil } // WatchStreamedData is a free log subscription operation binding the contract event 0x23cfaa418b5f569ff36b152a9fd02ee3ccddaa5f7eed570e777a30353b68dc38. // // Solidity: event StreamedData(uint256 indexed assignmentId, bytes data) func (_IWorkerHub *IWorkerHubFilterer) WatchStreamedData(opts *bind.WatchOpts, sink chan<- *IWorkerHubStreamedData, assignmentId []*big.Int) (event.Subscription, error) { var assignmentIdRule []interface{} for _, assignmentIdItem := range assignmentId { assignmentIdRule = append(assignmentIdRule, assignmentIdItem) } logs, sub, err := _IWorkerHub.contract.WatchLogs(opts, "StreamedData", assignmentIdRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(IWorkerHubStreamedData) if err := _IWorkerHub.contract.UnpackLog(event, "StreamedData", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseStreamedData is a log parse operation binding the contract event 0x23cfaa418b5f569ff36b152a9fd02ee3ccddaa5f7eed570e777a30353b68dc38. // // Solidity: event StreamedData(uint256 indexed assignmentId, bytes data) func (_IWorkerHub *IWorkerHubFilterer) ParseStreamedData(log types.Log) (*IWorkerHubStreamedData, error) { event := new(IWorkerHubStreamedData) if err := _IWorkerHub.contract.UnpackLog(event, "StreamedData", log); err != nil { return nil, err } event.Raw = log return event, nil } // IWorkerHubSubmitDurationIterator is returned from FilterSubmitDuration and is used to iterate over the raw logs and unpacked data for SubmitDuration events raised by the IWorkerHub contract. type IWorkerHubSubmitDurationIterator struct { Event *IWorkerHubSubmitDuration // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *IWorkerHubSubmitDurationIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(IWorkerHubSubmitDuration) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(IWorkerHubSubmitDuration) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *IWorkerHubSubmitDurationIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *IWorkerHubSubmitDurationIterator) Close() error { it.sub.Unsubscribe() return nil } // IWorkerHubSubmitDuration represents a SubmitDuration event raised by the IWorkerHub contract. type IWorkerHubSubmitDuration struct { OldTime *big.Int NewTime *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterSubmitDuration is a free log retrieval operation binding the contract event 0x8c0ac957fb32132ec541e9495c4fe8f1d9fdb4dd19a02e7144659d4b382064f3. // // Solidity: event SubmitDuration(uint256 oldTime, uint256 newTime) func (_IWorkerHub *IWorkerHubFilterer) FilterSubmitDuration(opts *bind.FilterOpts) (*IWorkerHubSubmitDurationIterator, error) { logs, sub, err := _IWorkerHub.contract.FilterLogs(opts, "SubmitDuration") if err != nil { return nil, err } return &IWorkerHubSubmitDurationIterator{contract: _IWorkerHub.contract, event: "SubmitDuration", logs: logs, sub: sub}, nil } // WatchSubmitDuration is a free log subscription operation binding the contract event 0x8c0ac957fb32132ec541e9495c4fe8f1d9fdb4dd19a02e7144659d4b382064f3. // // Solidity: event SubmitDuration(uint256 oldTime, uint256 newTime) func (_IWorkerHub *IWorkerHubFilterer) WatchSubmitDuration(opts *bind.WatchOpts, sink chan<- *IWorkerHubSubmitDuration) (event.Subscription, error) { logs, sub, err := _IWorkerHub.contract.WatchLogs(opts, "SubmitDuration") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(IWorkerHubSubmitDuration) if err := _IWorkerHub.contract.UnpackLog(event, "SubmitDuration", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseSubmitDuration is a log parse operation binding the contract event 0x8c0ac957fb32132ec541e9495c4fe8f1d9fdb4dd19a02e7144659d4b382064f3. // // Solidity: event SubmitDuration(uint256 oldTime, uint256 newTime) func (_IWorkerHub *IWorkerHubFilterer) ParseSubmitDuration(log types.Log) (*IWorkerHubSubmitDuration, error) { event := new(IWorkerHubSubmitDuration) if err := _IWorkerHub.contract.UnpackLog(event, "SubmitDuration", log); err != nil { return nil, err } event.Raw = log return event, nil } // IWorkerHubTopUpInferIterator is returned from FilterTopUpInfer and is used to iterate over the raw logs and unpacked data for TopUpInfer events raised by the IWorkerHub contract. type IWorkerHubTopUpInferIterator struct { Event *IWorkerHubTopUpInfer // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *IWorkerHubTopUpInferIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(IWorkerHubTopUpInfer) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(IWorkerHubTopUpInfer) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *IWorkerHubTopUpInferIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *IWorkerHubTopUpInferIterator) Close() error { it.sub.Unsubscribe() return nil } // IWorkerHubTopUpInfer represents a TopUpInfer event raised by the IWorkerHub contract. type IWorkerHubTopUpInfer struct { InferenceId *big.Int Creator common.Address Value *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterTopUpInfer is a free log retrieval operation binding the contract event 0xe3154336ce264fe53bcfaedafded1428a28ae47b19b3d7a82e5d5ecde0960a57. // // Solidity: event TopUpInfer(uint256 indexed inferenceId, address indexed creator, uint256 value) func (_IWorkerHub *IWorkerHubFilterer) FilterTopUpInfer(opts *bind.FilterOpts, inferenceId []*big.Int, creator []common.Address) (*IWorkerHubTopUpInferIterator, error) { var inferenceIdRule []interface{} for _, inferenceIdItem := range inferenceId { inferenceIdRule = append(inferenceIdRule, inferenceIdItem) } var creatorRule []interface{} for _, creatorItem := range creator { creatorRule = append(creatorRule, creatorItem) } logs, sub, err := _IWorkerHub.contract.FilterLogs(opts, "TopUpInfer", inferenceIdRule, creatorRule) if err != nil { return nil, err } return &IWorkerHubTopUpInferIterator{contract: _IWorkerHub.contract, event: "TopUpInfer", logs: logs, sub: sub}, nil } // WatchTopUpInfer is a free log subscription operation binding the contract event 0xe3154336ce264fe53bcfaedafded1428a28ae47b19b3d7a82e5d5ecde0960a57. // // Solidity: event TopUpInfer(uint256 indexed inferenceId, address indexed creator, uint256 value) func (_IWorkerHub *IWorkerHubFilterer) WatchTopUpInfer(opts *bind.WatchOpts, sink chan<- *IWorkerHubTopUpInfer, inferenceId []*big.Int, creator []common.Address) (event.Subscription, error) { var inferenceIdRule []interface{} for _, inferenceIdItem := range inferenceId { inferenceIdRule = append(inferenceIdRule, inferenceIdItem) } var creatorRule []interface{} for _, creatorItem := range creator { creatorRule = append(creatorRule, creatorItem) } logs, sub, err := _IWorkerHub.contract.WatchLogs(opts, "TopUpInfer", inferenceIdRule, creatorRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(IWorkerHubTopUpInfer) if err := _IWorkerHub.contract.UnpackLog(event, "TopUpInfer", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseTopUpInfer is a log parse operation binding the contract event 0xe3154336ce264fe53bcfaedafded1428a28ae47b19b3d7a82e5d5ecde0960a57. // // Solidity: event TopUpInfer(uint256 indexed inferenceId, address indexed creator, uint256 value) func (_IWorkerHub *IWorkerHubFilterer) ParseTopUpInfer(log types.Log) (*IWorkerHubTopUpInfer, error) { event := new(IWorkerHubTopUpInfer) if err := _IWorkerHub.contract.UnpackLog(event, "TopUpInfer", log); err != nil { return nil, err } event.Raw = log return event, nil } // IWorkerHubTransferFeeIterator is returned from FilterTransferFee and is used to iterate over the raw logs and unpacked data for TransferFee events raised by the IWorkerHub contract. type IWorkerHubTransferFeeIterator struct { Event *IWorkerHubTransferFee // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *IWorkerHubTransferFeeIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(IWorkerHubTransferFee) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(IWorkerHubTransferFee) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *IWorkerHubTransferFeeIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *IWorkerHubTransferFeeIterator) Close() error { it.sub.Unsubscribe() return nil } // IWorkerHubTransferFee represents a TransferFee event raised by the IWorkerHub contract. type IWorkerHubTransferFee struct { Treasury common.Address TreasuryFee *big.Int L2OwnerAddress common.Address L2OwnerFee *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterTransferFee is a free log retrieval operation binding the contract event 0x782aada659bac972b342fea00dfc27389e876bece89a9eb635bd5a2c544e8a6b. // // Solidity: event TransferFee(address indexed treasury, uint256 treasuryFee, address L2OwnerAddress, uint256 L2OwnerFee) func (_IWorkerHub *IWorkerHubFilterer) FilterTransferFee(opts *bind.FilterOpts, treasury []common.Address) (*IWorkerHubTransferFeeIterator, error) { var treasuryRule []interface{} for _, treasuryItem := range treasury { treasuryRule = append(treasuryRule, treasuryItem) } logs, sub, err := _IWorkerHub.contract.FilterLogs(opts, "TransferFee", treasuryRule) if err != nil { return nil, err } return &IWorkerHubTransferFeeIterator{contract: _IWorkerHub.contract, event: "TransferFee", logs: logs, sub: sub}, nil } // WatchTransferFee is a free log subscription operation binding the contract event 0x782aada659bac972b342fea00dfc27389e876bece89a9eb635bd5a2c544e8a6b. // // Solidity: event TransferFee(address indexed treasury, uint256 treasuryFee, address L2OwnerAddress, uint256 L2OwnerFee) func (_IWorkerHub *IWorkerHubFilterer) WatchTransferFee(opts *bind.WatchOpts, sink chan<- *IWorkerHubTransferFee, treasury []common.Address) (event.Subscription, error) { var treasuryRule []interface{} for _, treasuryItem := range treasury { treasuryRule = append(treasuryRule, treasuryItem) } logs, sub, err := _IWorkerHub.contract.WatchLogs(opts, "TransferFee", treasuryRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(IWorkerHubTransferFee) if err := _IWorkerHub.contract.UnpackLog(event, "TransferFee", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseTransferFee is a log parse operation binding the contract event 0x782aada659bac972b342fea00dfc27389e876bece89a9eb635bd5a2c544e8a6b. // // Solidity: event TransferFee(address indexed treasury, uint256 treasuryFee, address L2OwnerAddress, uint256 L2OwnerFee) func (_IWorkerHub *IWorkerHubFilterer) ParseTransferFee(log types.Log) (*IWorkerHubTransferFee, error) { event := new(IWorkerHubTransferFee) if err := _IWorkerHub.contract.UnpackLog(event, "TransferFee", log); err != nil { return nil, err } event.Raw = log return event, nil } // IWorkerHubTreasuryAddressUpdatedIterator is returned from FilterTreasuryAddressUpdated and is used to iterate over the raw logs and unpacked data for TreasuryAddressUpdated events raised by the IWorkerHub contract. type IWorkerHubTreasuryAddressUpdatedIterator struct { Event *IWorkerHubTreasuryAddressUpdated // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *IWorkerHubTreasuryAddressUpdatedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(IWorkerHubTreasuryAddressUpdated) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(IWorkerHubTreasuryAddressUpdated) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *IWorkerHubTreasuryAddressUpdatedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *IWorkerHubTreasuryAddressUpdatedIterator) Close() error { it.sub.Unsubscribe() return nil } // IWorkerHubTreasuryAddressUpdated represents a TreasuryAddressUpdated event raised by the IWorkerHub contract. type IWorkerHubTreasuryAddressUpdated struct { OldAddress common.Address NewAddress common.Address Raw types.Log // Blockchain specific contextual infos } // FilterTreasuryAddressUpdated is a free log retrieval operation binding the contract event 0x430359a6d97ced2b6f93c77a91e7ce9dfd43252eb91e916adba170485cd8a6a4. // // Solidity: event TreasuryAddressUpdated(address oldAddress, address newAddress) func (_IWorkerHub *IWorkerHubFilterer) FilterTreasuryAddressUpdated(opts *bind.FilterOpts) (*IWorkerHubTreasuryAddressUpdatedIterator, error) { logs, sub, err := _IWorkerHub.contract.FilterLogs(opts, "TreasuryAddressUpdated") if err != nil { return nil, err } return &IWorkerHubTreasuryAddressUpdatedIterator{contract: _IWorkerHub.contract, event: "TreasuryAddressUpdated", logs: logs, sub: sub}, nil } // WatchTreasuryAddressUpdated is a free log subscription operation binding the contract event 0x430359a6d97ced2b6f93c77a91e7ce9dfd43252eb91e916adba170485cd8a6a4. // // Solidity: event TreasuryAddressUpdated(address oldAddress, address newAddress) func (_IWorkerHub *IWorkerHubFilterer) WatchTreasuryAddressUpdated(opts *bind.WatchOpts, sink chan<- *IWorkerHubTreasuryAddressUpdated) (event.Subscription, error) { logs, sub, err := _IWorkerHub.contract.WatchLogs(opts, "TreasuryAddressUpdated") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(IWorkerHubTreasuryAddressUpdated) if err := _IWorkerHub.contract.UnpackLog(event, "TreasuryAddressUpdated", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseTreasuryAddressUpdated is a log parse operation binding the contract event 0x430359a6d97ced2b6f93c77a91e7ce9dfd43252eb91e916adba170485cd8a6a4. // // Solidity: event TreasuryAddressUpdated(address oldAddress, address newAddress) func (_IWorkerHub *IWorkerHubFilterer) ParseTreasuryAddressUpdated(log types.Log) (*IWorkerHubTreasuryAddressUpdated, error) { event := new(IWorkerHubTreasuryAddressUpdated) if err := _IWorkerHub.contract.UnpackLog(event, "TreasuryAddressUpdated", log); err != nil { return nil, err } event.Raw = log return event, nil } // IWorkerHubUnpausedIterator is returned from FilterUnpaused and is used to iterate over the raw logs and unpacked data for Unpaused events raised by the IWorkerHub contract. type IWorkerHubUnpausedIterator struct { Event *IWorkerHubUnpaused // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *IWorkerHubUnpausedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(IWorkerHubUnpaused) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(IWorkerHubUnpaused) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *IWorkerHubUnpausedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *IWorkerHubUnpausedIterator) Close() error { it.sub.Unsubscribe() return nil } // IWorkerHubUnpaused represents a Unpaused event raised by the IWorkerHub contract. type IWorkerHubUnpaused struct { Account common.Address Raw types.Log // Blockchain specific contextual infos } // FilterUnpaused is a free log retrieval operation binding the contract event 0x5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa. // // Solidity: event Unpaused(address account) func (_IWorkerHub *IWorkerHubFilterer) FilterUnpaused(opts *bind.FilterOpts) (*IWorkerHubUnpausedIterator, error) { logs, sub, err := _IWorkerHub.contract.FilterLogs(opts, "Unpaused") if err != nil { return nil, err } return &IWorkerHubUnpausedIterator{contract: _IWorkerHub.contract, event: "Unpaused", logs: logs, sub: sub}, nil } // WatchUnpaused is a free log subscription operation binding the contract event 0x5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa. // // Solidity: event Unpaused(address account) func (_IWorkerHub *IWorkerHubFilterer) WatchUnpaused(opts *bind.WatchOpts, sink chan<- *IWorkerHubUnpaused) (event.Subscription, error) { logs, sub, err := _IWorkerHub.contract.WatchLogs(opts, "Unpaused") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(IWorkerHubUnpaused) if err := _IWorkerHub.contract.UnpackLog(event, "Unpaused", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseUnpaused is a log parse operation binding the contract event 0x5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa. // // Solidity: event Unpaused(address account) func (_IWorkerHub *IWorkerHubFilterer) ParseUnpaused(log types.Log) (*IWorkerHubUnpaused, error) { event := new(IWorkerHubUnpaused) if err := _IWorkerHub.contract.UnpackLog(event, "Unpaused", log); err != nil { return nil, err } event.Raw = log return event, nil } // IWorkerHubUnstakeDelayTimeIterator is returned from FilterUnstakeDelayTime and is used to iterate over the raw logs and unpacked data for UnstakeDelayTime events raised by the IWorkerHub contract. type IWorkerHubUnstakeDelayTimeIterator struct { Event *IWorkerHubUnstakeDelayTime // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *IWorkerHubUnstakeDelayTimeIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(IWorkerHubUnstakeDelayTime) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(IWorkerHubUnstakeDelayTime) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *IWorkerHubUnstakeDelayTimeIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *IWorkerHubUnstakeDelayTimeIterator) Close() error { it.sub.Unsubscribe() return nil } // IWorkerHubUnstakeDelayTime represents a UnstakeDelayTime event raised by the IWorkerHub contract. type IWorkerHubUnstakeDelayTime struct { OldDelayTime *big.Int NewDelayTime *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterUnstakeDelayTime is a free log retrieval operation binding the contract event 0xdf63c46e5024e57c66aafc6698e317c78589c870dca694678c89dd379c5fd490. // // Solidity: event UnstakeDelayTime(uint256 oldDelayTime, uint256 newDelayTime) func (_IWorkerHub *IWorkerHubFilterer) FilterUnstakeDelayTime(opts *bind.FilterOpts) (*IWorkerHubUnstakeDelayTimeIterator, error) { logs, sub, err := _IWorkerHub.contract.FilterLogs(opts, "UnstakeDelayTime") if err != nil { return nil, err } return &IWorkerHubUnstakeDelayTimeIterator{contract: _IWorkerHub.contract, event: "UnstakeDelayTime", logs: logs, sub: sub}, nil } // WatchUnstakeDelayTime is a free log subscription operation binding the contract event 0xdf63c46e5024e57c66aafc6698e317c78589c870dca694678c89dd379c5fd490. // // Solidity: event UnstakeDelayTime(uint256 oldDelayTime, uint256 newDelayTime) func (_IWorkerHub *IWorkerHubFilterer) WatchUnstakeDelayTime(opts *bind.WatchOpts, sink chan<- *IWorkerHubUnstakeDelayTime) (event.Subscription, error) { logs, sub, err := _IWorkerHub.contract.WatchLogs(opts, "UnstakeDelayTime") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(IWorkerHubUnstakeDelayTime) if err := _IWorkerHub.contract.UnpackLog(event, "UnstakeDelayTime", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseUnstakeDelayTime is a log parse operation binding the contract event 0xdf63c46e5024e57c66aafc6698e317c78589c870dca694678c89dd379c5fd490. // // Solidity: event UnstakeDelayTime(uint256 oldDelayTime, uint256 newDelayTime) func (_IWorkerHub *IWorkerHubFilterer) ParseUnstakeDelayTime(log types.Log) (*IWorkerHubUnstakeDelayTime, error) { event := new(IWorkerHubUnstakeDelayTime) if err := _IWorkerHub.contract.UnpackLog(event, "UnstakeDelayTime", log); err != nil { return nil, err } event.Raw = log return event, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/binds/memenonfungiblepositionmanager/NonfungiblePositionManager.go ================================================ // Code generated - DO NOT EDIT. // This file is a generated binding and any manual changes will be lost. package memenonfungiblepositionmanager import ( "errors" "math/big" "strings" ethereum "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/event" ) // Reference imports to suppress errors if they are not otherwise used. var ( _ = errors.New _ = big.NewInt _ = strings.NewReader _ = ethereum.NotFound _ = bind.Bind _ = common.Big1 _ = types.BloomLookup _ = event.NewSubscription _ = abi.ConvertType ) // INonfungiblePositionManagerMintParams is an auto generated low-level Go binding around an user-defined struct. type INonfungiblePositionManagerMintParams struct { Token0 common.Address Token1 common.Address Fee *big.Int TickLower *big.Int TickUpper *big.Int Amount0Desired *big.Int Amount1Desired *big.Int Amount0Min *big.Int Amount1Min *big.Int Recipient common.Address Deadline *big.Int } // UniswapV3BrokerCollectParams is an auto generated low-level Go binding around an user-defined struct. type UniswapV3BrokerCollectParams struct { TokenId *big.Int Recipient common.Address Amount0Max *big.Int Amount1Max *big.Int } // UniswapV3BrokerDecreaseLiquidityParams is an auto generated low-level Go binding around an user-defined struct. type UniswapV3BrokerDecreaseLiquidityParams struct { TokenId *big.Int Liquidity *big.Int Amount0Min *big.Int Amount1Min *big.Int Deadline *big.Int } // UniswapV3BrokerIncreaseLiquidityParams is an auto generated low-level Go binding around an user-defined struct. type UniswapV3BrokerIncreaseLiquidityParams struct { TokenId *big.Int Amount0Desired *big.Int Amount1Desired *big.Int Amount0Min *big.Int Amount1Min *big.Int Deadline *big.Int } // NonfungiblePositionManagerMetaData contains all meta data concerning the NonfungiblePositionManager contract. var NonfungiblePositionManagerMetaData = &bind.MetaData{ ABI: "[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"approved\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"ApprovalForAll\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"}],\"name\":\"Collect\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"liquidity\",\"type\":\"uint128\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"}],\"name\":\"DecreaseLiquidity\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"liquidity\",\"type\":\"uint128\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"}],\"name\":\"IncreaseLiquidity\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"DOMAIN_SEPARATOR\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"PERMIT_TYPEHASH\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"WETH\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"baseURI\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"burn\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint128\",\"name\":\"amount0Max\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"amount1Max\",\"type\":\"uint128\"}],\"internalType\":\"structUniswapV3Broker.CollectParams\",\"name\":\"params\",\"type\":\"tuple\"}],\"name\":\"collect\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token0\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token1\",\"type\":\"address\"},{\"internalType\":\"uint24\",\"name\":\"fee\",\"type\":\"uint24\"},{\"internalType\":\"uint160\",\"name\":\"sqrtPriceX96\",\"type\":\"uint160\"}],\"name\":\"createAndInitializePoolIfNecessary\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint128\",\"name\":\"liquidity\",\"type\":\"uint128\"},{\"internalType\":\"uint256\",\"name\":\"amount0Min\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Min\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"}],\"internalType\":\"structUniswapV3Broker.DecreaseLiquidityParams\",\"name\":\"params\",\"type\":\"tuple\"}],\"name\":\"decreaseLiquidity\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"factory\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"getApproved\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount0Desired\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Desired\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount0Min\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Min\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"}],\"internalType\":\"structUniswapV3Broker.IncreaseLiquidityParams\",\"name\":\"params\",\"type\":\"tuple\"}],\"name\":\"increaseLiquidity\",\"outputs\":[{\"internalType\":\"uint128\",\"name\":\"liquidity\",\"type\":\"uint128\"},{\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_factory\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_WETH\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_tokenDescriptor_\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"name\":\"isApprovedForAll\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"token0\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token1\",\"type\":\"address\"},{\"internalType\":\"uint24\",\"name\":\"fee\",\"type\":\"uint24\"},{\"internalType\":\"int24\",\"name\":\"tickLower\",\"type\":\"int24\"},{\"internalType\":\"int24\",\"name\":\"tickUpper\",\"type\":\"int24\"},{\"internalType\":\"uint256\",\"name\":\"amount0Desired\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Desired\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount0Min\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Min\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"}],\"internalType\":\"structINonfungiblePositionManager.MintParams\",\"name\":\"params\",\"type\":\"tuple\"}],\"name\":\"mint\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint128\",\"name\":\"liquidity\",\"type\":\"uint128\"},{\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes[]\",\"name\":\"data\",\"type\":\"bytes[]\"}],\"name\":\"multicall\",\"outputs\":[{\"internalType\":\"bytes[]\",\"name\":\"results\",\"type\":\"bytes[]\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"ownerOf\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"permit\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"positions\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"nonce\",\"type\":\"uint96\"},{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token0\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token1\",\"type\":\"address\"},{\"internalType\":\"uint24\",\"name\":\"fee\",\"type\":\"uint24\"},{\"internalType\":\"int24\",\"name\":\"tickLower\",\"type\":\"int24\"},{\"internalType\":\"int24\",\"name\":\"tickUpper\",\"type\":\"int24\"},{\"internalType\":\"uint128\",\"name\":\"liquidity\",\"type\":\"uint128\"},{\"internalType\":\"uint256\",\"name\":\"feeGrowthInside0LastX128\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"feeGrowthInside1LastX128\",\"type\":\"uint256\"},{\"internalType\":\"uint128\",\"name\":\"tokensOwed0\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"tokensOwed1\",\"type\":\"uint128\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"refundETH\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"safeTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"safeTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"selfPermit\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiry\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"selfPermitAllowed\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiry\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"selfPermitAllowedIfNecessary\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"selfPermitIfNecessary\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"setApprovalForAll\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"WETHArg\",\"type\":\"address\"}],\"name\":\"setWETH\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amountMinimum\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"}],\"name\":\"sweepToken\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"tokenURI\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0Owed\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Owed\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"uniswapV3MintCallback\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountMinimum\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"}],\"name\":\"unwrapWETH\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]", } // NonfungiblePositionManagerABI is the input ABI used to generate the binding from. // Deprecated: Use NonfungiblePositionManagerMetaData.ABI instead. var NonfungiblePositionManagerABI = NonfungiblePositionManagerMetaData.ABI // NonfungiblePositionManager is an auto generated Go binding around an Ethereum contract. type NonfungiblePositionManager struct { NonfungiblePositionManagerCaller // Read-only binding to the contract NonfungiblePositionManagerTransactor // Write-only binding to the contract NonfungiblePositionManagerFilterer // Log filterer for contract events } // NonfungiblePositionManagerCaller is an auto generated read-only Go binding around an Ethereum contract. type NonfungiblePositionManagerCaller struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // NonfungiblePositionManagerTransactor is an auto generated write-only Go binding around an Ethereum contract. type NonfungiblePositionManagerTransactor struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // NonfungiblePositionManagerFilterer is an auto generated log filtering Go binding around an Ethereum contract events. type NonfungiblePositionManagerFilterer struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // NonfungiblePositionManagerSession is an auto generated Go binding around an Ethereum contract, // with pre-set call and transact options. type NonfungiblePositionManagerSession struct { Contract *NonfungiblePositionManager // Generic contract binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // NonfungiblePositionManagerCallerSession is an auto generated read-only Go binding around an Ethereum contract, // with pre-set call options. type NonfungiblePositionManagerCallerSession struct { Contract *NonfungiblePositionManagerCaller // Generic contract caller binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session } // NonfungiblePositionManagerTransactorSession is an auto generated write-only Go binding around an Ethereum contract, // with pre-set transact options. type NonfungiblePositionManagerTransactorSession struct { Contract *NonfungiblePositionManagerTransactor // Generic contract transactor binding to set the session for TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // NonfungiblePositionManagerRaw is an auto generated low-level Go binding around an Ethereum contract. type NonfungiblePositionManagerRaw struct { Contract *NonfungiblePositionManager // Generic contract binding to access the raw methods on } // NonfungiblePositionManagerCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. type NonfungiblePositionManagerCallerRaw struct { Contract *NonfungiblePositionManagerCaller // Generic read-only contract binding to access the raw methods on } // NonfungiblePositionManagerTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. type NonfungiblePositionManagerTransactorRaw struct { Contract *NonfungiblePositionManagerTransactor // Generic write-only contract binding to access the raw methods on } // NewNonfungiblePositionManager creates a new instance of NonfungiblePositionManager, bound to a specific deployed contract. func NewNonfungiblePositionManager(address common.Address, backend bind.ContractBackend) (*NonfungiblePositionManager, error) { contract, err := bindNonfungiblePositionManager(address, backend, backend, backend) if err != nil { return nil, err } return &NonfungiblePositionManager{NonfungiblePositionManagerCaller: NonfungiblePositionManagerCaller{contract: contract}, NonfungiblePositionManagerTransactor: NonfungiblePositionManagerTransactor{contract: contract}, NonfungiblePositionManagerFilterer: NonfungiblePositionManagerFilterer{contract: contract}}, nil } // NewNonfungiblePositionManagerCaller creates a new read-only instance of NonfungiblePositionManager, bound to a specific deployed contract. func NewNonfungiblePositionManagerCaller(address common.Address, caller bind.ContractCaller) (*NonfungiblePositionManagerCaller, error) { contract, err := bindNonfungiblePositionManager(address, caller, nil, nil) if err != nil { return nil, err } return &NonfungiblePositionManagerCaller{contract: contract}, nil } // NewNonfungiblePositionManagerTransactor creates a new write-only instance of NonfungiblePositionManager, bound to a specific deployed contract. func NewNonfungiblePositionManagerTransactor(address common.Address, transactor bind.ContractTransactor) (*NonfungiblePositionManagerTransactor, error) { contract, err := bindNonfungiblePositionManager(address, nil, transactor, nil) if err != nil { return nil, err } return &NonfungiblePositionManagerTransactor{contract: contract}, nil } // NewNonfungiblePositionManagerFilterer creates a new log filterer instance of NonfungiblePositionManager, bound to a specific deployed contract. func NewNonfungiblePositionManagerFilterer(address common.Address, filterer bind.ContractFilterer) (*NonfungiblePositionManagerFilterer, error) { contract, err := bindNonfungiblePositionManager(address, nil, nil, filterer) if err != nil { return nil, err } return &NonfungiblePositionManagerFilterer{contract: contract}, nil } // bindNonfungiblePositionManager binds a generic wrapper to an already deployed contract. func bindNonfungiblePositionManager(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { parsed, err := NonfungiblePositionManagerMetaData.GetAbi() if err != nil { return nil, err } return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_NonfungiblePositionManager *NonfungiblePositionManagerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _NonfungiblePositionManager.Contract.NonfungiblePositionManagerCaller.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_NonfungiblePositionManager *NonfungiblePositionManagerRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.NonfungiblePositionManagerTransactor.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_NonfungiblePositionManager *NonfungiblePositionManagerRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.NonfungiblePositionManagerTransactor.contract.Transact(opts, method, params...) } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _NonfungiblePositionManager.Contract.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.contract.Transact(opts, method, params...) } // DOMAINSEPARATOR is a free data retrieval call binding the contract method 0x3644e515. // // Solidity: function DOMAIN_SEPARATOR() view returns(bytes32) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) DOMAINSEPARATOR(opts *bind.CallOpts) ([32]byte, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "DOMAIN_SEPARATOR") if err != nil { return *new([32]byte), err } out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) return out0, err } // DOMAINSEPARATOR is a free data retrieval call binding the contract method 0x3644e515. // // Solidity: function DOMAIN_SEPARATOR() view returns(bytes32) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) DOMAINSEPARATOR() ([32]byte, error) { return _NonfungiblePositionManager.Contract.DOMAINSEPARATOR(&_NonfungiblePositionManager.CallOpts) } // DOMAINSEPARATOR is a free data retrieval call binding the contract method 0x3644e515. // // Solidity: function DOMAIN_SEPARATOR() view returns(bytes32) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) DOMAINSEPARATOR() ([32]byte, error) { return _NonfungiblePositionManager.Contract.DOMAINSEPARATOR(&_NonfungiblePositionManager.CallOpts) } // PERMITTYPEHASH is a free data retrieval call binding the contract method 0x30adf81f. // // Solidity: function PERMIT_TYPEHASH() view returns(bytes32) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) PERMITTYPEHASH(opts *bind.CallOpts) ([32]byte, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "PERMIT_TYPEHASH") if err != nil { return *new([32]byte), err } out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) return out0, err } // PERMITTYPEHASH is a free data retrieval call binding the contract method 0x30adf81f. // // Solidity: function PERMIT_TYPEHASH() view returns(bytes32) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) PERMITTYPEHASH() ([32]byte, error) { return _NonfungiblePositionManager.Contract.PERMITTYPEHASH(&_NonfungiblePositionManager.CallOpts) } // PERMITTYPEHASH is a free data retrieval call binding the contract method 0x30adf81f. // // Solidity: function PERMIT_TYPEHASH() view returns(bytes32) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) PERMITTYPEHASH() ([32]byte, error) { return _NonfungiblePositionManager.Contract.PERMITTYPEHASH(&_NonfungiblePositionManager.CallOpts) } // WETH is a free data retrieval call binding the contract method 0xad5c4648. // // Solidity: function WETH() view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) WETH(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "WETH") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // WETH is a free data retrieval call binding the contract method 0xad5c4648. // // Solidity: function WETH() view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) WETH() (common.Address, error) { return _NonfungiblePositionManager.Contract.WETH(&_NonfungiblePositionManager.CallOpts) } // WETH is a free data retrieval call binding the contract method 0xad5c4648. // // Solidity: function WETH() view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) WETH() (common.Address, error) { return _NonfungiblePositionManager.Contract.WETH(&_NonfungiblePositionManager.CallOpts) } // BalanceOf is a free data retrieval call binding the contract method 0x70a08231. // // Solidity: function balanceOf(address owner) view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) BalanceOf(opts *bind.CallOpts, owner common.Address) (*big.Int, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "balanceOf", owner) if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // BalanceOf is a free data retrieval call binding the contract method 0x70a08231. // // Solidity: function balanceOf(address owner) view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) BalanceOf(owner common.Address) (*big.Int, error) { return _NonfungiblePositionManager.Contract.BalanceOf(&_NonfungiblePositionManager.CallOpts, owner) } // BalanceOf is a free data retrieval call binding the contract method 0x70a08231. // // Solidity: function balanceOf(address owner) view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) BalanceOf(owner common.Address) (*big.Int, error) { return _NonfungiblePositionManager.Contract.BalanceOf(&_NonfungiblePositionManager.CallOpts, owner) } // BaseURI is a free data retrieval call binding the contract method 0x6c0360eb. // // Solidity: function baseURI() pure returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) BaseURI(opts *bind.CallOpts) (string, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "baseURI") if err != nil { return *new(string), err } out0 := *abi.ConvertType(out[0], new(string)).(*string) return out0, err } // BaseURI is a free data retrieval call binding the contract method 0x6c0360eb. // // Solidity: function baseURI() pure returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) BaseURI() (string, error) { return _NonfungiblePositionManager.Contract.BaseURI(&_NonfungiblePositionManager.CallOpts) } // BaseURI is a free data retrieval call binding the contract method 0x6c0360eb. // // Solidity: function baseURI() pure returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) BaseURI() (string, error) { return _NonfungiblePositionManager.Contract.BaseURI(&_NonfungiblePositionManager.CallOpts) } // Factory is a free data retrieval call binding the contract method 0xc45a0155. // // Solidity: function factory() view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) Factory(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "factory") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // Factory is a free data retrieval call binding the contract method 0xc45a0155. // // Solidity: function factory() view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Factory() (common.Address, error) { return _NonfungiblePositionManager.Contract.Factory(&_NonfungiblePositionManager.CallOpts) } // Factory is a free data retrieval call binding the contract method 0xc45a0155. // // Solidity: function factory() view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) Factory() (common.Address, error) { return _NonfungiblePositionManager.Contract.Factory(&_NonfungiblePositionManager.CallOpts) } // GetApproved is a free data retrieval call binding the contract method 0x081812fc. // // Solidity: function getApproved(uint256 tokenId) view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) GetApproved(opts *bind.CallOpts, tokenId *big.Int) (common.Address, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "getApproved", tokenId) if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // GetApproved is a free data retrieval call binding the contract method 0x081812fc. // // Solidity: function getApproved(uint256 tokenId) view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) GetApproved(tokenId *big.Int) (common.Address, error) { return _NonfungiblePositionManager.Contract.GetApproved(&_NonfungiblePositionManager.CallOpts, tokenId) } // GetApproved is a free data retrieval call binding the contract method 0x081812fc. // // Solidity: function getApproved(uint256 tokenId) view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) GetApproved(tokenId *big.Int) (common.Address, error) { return _NonfungiblePositionManager.Contract.GetApproved(&_NonfungiblePositionManager.CallOpts, tokenId) } // IsApprovedForAll is a free data retrieval call binding the contract method 0xe985e9c5. // // Solidity: function isApprovedForAll(address owner, address operator) view returns(bool) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) IsApprovedForAll(opts *bind.CallOpts, owner common.Address, operator common.Address) (bool, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "isApprovedForAll", owner, operator) if err != nil { return *new(bool), err } out0 := *abi.ConvertType(out[0], new(bool)).(*bool) return out0, err } // IsApprovedForAll is a free data retrieval call binding the contract method 0xe985e9c5. // // Solidity: function isApprovedForAll(address owner, address operator) view returns(bool) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) IsApprovedForAll(owner common.Address, operator common.Address) (bool, error) { return _NonfungiblePositionManager.Contract.IsApprovedForAll(&_NonfungiblePositionManager.CallOpts, owner, operator) } // IsApprovedForAll is a free data retrieval call binding the contract method 0xe985e9c5. // // Solidity: function isApprovedForAll(address owner, address operator) view returns(bool) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) IsApprovedForAll(owner common.Address, operator common.Address) (bool, error) { return _NonfungiblePositionManager.Contract.IsApprovedForAll(&_NonfungiblePositionManager.CallOpts, owner, operator) } // Name is a free data retrieval call binding the contract method 0x06fdde03. // // Solidity: function name() view returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) Name(opts *bind.CallOpts) (string, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "name") if err != nil { return *new(string), err } out0 := *abi.ConvertType(out[0], new(string)).(*string) return out0, err } // Name is a free data retrieval call binding the contract method 0x06fdde03. // // Solidity: function name() view returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Name() (string, error) { return _NonfungiblePositionManager.Contract.Name(&_NonfungiblePositionManager.CallOpts) } // Name is a free data retrieval call binding the contract method 0x06fdde03. // // Solidity: function name() view returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) Name() (string, error) { return _NonfungiblePositionManager.Contract.Name(&_NonfungiblePositionManager.CallOpts) } // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. // // Solidity: function owner() view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) Owner(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "owner") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. // // Solidity: function owner() view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Owner() (common.Address, error) { return _NonfungiblePositionManager.Contract.Owner(&_NonfungiblePositionManager.CallOpts) } // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. // // Solidity: function owner() view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) Owner() (common.Address, error) { return _NonfungiblePositionManager.Contract.Owner(&_NonfungiblePositionManager.CallOpts) } // OwnerOf is a free data retrieval call binding the contract method 0x6352211e. // // Solidity: function ownerOf(uint256 tokenId) view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) OwnerOf(opts *bind.CallOpts, tokenId *big.Int) (common.Address, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "ownerOf", tokenId) if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // OwnerOf is a free data retrieval call binding the contract method 0x6352211e. // // Solidity: function ownerOf(uint256 tokenId) view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) OwnerOf(tokenId *big.Int) (common.Address, error) { return _NonfungiblePositionManager.Contract.OwnerOf(&_NonfungiblePositionManager.CallOpts, tokenId) } // OwnerOf is a free data retrieval call binding the contract method 0x6352211e. // // Solidity: function ownerOf(uint256 tokenId) view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) OwnerOf(tokenId *big.Int) (common.Address, error) { return _NonfungiblePositionManager.Contract.OwnerOf(&_NonfungiblePositionManager.CallOpts, tokenId) } // Positions is a free data retrieval call binding the contract method 0x99fbab88. // // Solidity: function positions(uint256 tokenId) view returns(uint96 nonce, address operator, address token0, address token1, uint24 fee, int24 tickLower, int24 tickUpper, uint128 liquidity, uint256 feeGrowthInside0LastX128, uint256 feeGrowthInside1LastX128, uint128 tokensOwed0, uint128 tokensOwed1) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) Positions(opts *bind.CallOpts, tokenId *big.Int) (struct { Nonce *big.Int Operator common.Address Token0 common.Address Token1 common.Address Fee *big.Int TickLower *big.Int TickUpper *big.Int Liquidity *big.Int FeeGrowthInside0LastX128 *big.Int FeeGrowthInside1LastX128 *big.Int TokensOwed0 *big.Int TokensOwed1 *big.Int }, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "positions", tokenId) outstruct := new(struct { Nonce *big.Int Operator common.Address Token0 common.Address Token1 common.Address Fee *big.Int TickLower *big.Int TickUpper *big.Int Liquidity *big.Int FeeGrowthInside0LastX128 *big.Int FeeGrowthInside1LastX128 *big.Int TokensOwed0 *big.Int TokensOwed1 *big.Int }) if err != nil { return *outstruct, err } outstruct.Nonce = *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) outstruct.Operator = *abi.ConvertType(out[1], new(common.Address)).(*common.Address) outstruct.Token0 = *abi.ConvertType(out[2], new(common.Address)).(*common.Address) outstruct.Token1 = *abi.ConvertType(out[3], new(common.Address)).(*common.Address) outstruct.Fee = *abi.ConvertType(out[4], new(*big.Int)).(**big.Int) outstruct.TickLower = *abi.ConvertType(out[5], new(*big.Int)).(**big.Int) outstruct.TickUpper = *abi.ConvertType(out[6], new(*big.Int)).(**big.Int) outstruct.Liquidity = *abi.ConvertType(out[7], new(*big.Int)).(**big.Int) outstruct.FeeGrowthInside0LastX128 = *abi.ConvertType(out[8], new(*big.Int)).(**big.Int) outstruct.FeeGrowthInside1LastX128 = *abi.ConvertType(out[9], new(*big.Int)).(**big.Int) outstruct.TokensOwed0 = *abi.ConvertType(out[10], new(*big.Int)).(**big.Int) outstruct.TokensOwed1 = *abi.ConvertType(out[11], new(*big.Int)).(**big.Int) return *outstruct, err } // Positions is a free data retrieval call binding the contract method 0x99fbab88. // // Solidity: function positions(uint256 tokenId) view returns(uint96 nonce, address operator, address token0, address token1, uint24 fee, int24 tickLower, int24 tickUpper, uint128 liquidity, uint256 feeGrowthInside0LastX128, uint256 feeGrowthInside1LastX128, uint128 tokensOwed0, uint128 tokensOwed1) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Positions(tokenId *big.Int) (struct { Nonce *big.Int Operator common.Address Token0 common.Address Token1 common.Address Fee *big.Int TickLower *big.Int TickUpper *big.Int Liquidity *big.Int FeeGrowthInside0LastX128 *big.Int FeeGrowthInside1LastX128 *big.Int TokensOwed0 *big.Int TokensOwed1 *big.Int }, error) { return _NonfungiblePositionManager.Contract.Positions(&_NonfungiblePositionManager.CallOpts, tokenId) } // Positions is a free data retrieval call binding the contract method 0x99fbab88. // // Solidity: function positions(uint256 tokenId) view returns(uint96 nonce, address operator, address token0, address token1, uint24 fee, int24 tickLower, int24 tickUpper, uint128 liquidity, uint256 feeGrowthInside0LastX128, uint256 feeGrowthInside1LastX128, uint128 tokensOwed0, uint128 tokensOwed1) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) Positions(tokenId *big.Int) (struct { Nonce *big.Int Operator common.Address Token0 common.Address Token1 common.Address Fee *big.Int TickLower *big.Int TickUpper *big.Int Liquidity *big.Int FeeGrowthInside0LastX128 *big.Int FeeGrowthInside1LastX128 *big.Int TokensOwed0 *big.Int TokensOwed1 *big.Int }, error) { return _NonfungiblePositionManager.Contract.Positions(&_NonfungiblePositionManager.CallOpts, tokenId) } // SupportsInterface is a free data retrieval call binding the contract method 0x01ffc9a7. // // Solidity: function supportsInterface(bytes4 interfaceId) view returns(bool) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) SupportsInterface(opts *bind.CallOpts, interfaceId [4]byte) (bool, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "supportsInterface", interfaceId) if err != nil { return *new(bool), err } out0 := *abi.ConvertType(out[0], new(bool)).(*bool) return out0, err } // SupportsInterface is a free data retrieval call binding the contract method 0x01ffc9a7. // // Solidity: function supportsInterface(bytes4 interfaceId) view returns(bool) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) SupportsInterface(interfaceId [4]byte) (bool, error) { return _NonfungiblePositionManager.Contract.SupportsInterface(&_NonfungiblePositionManager.CallOpts, interfaceId) } // SupportsInterface is a free data retrieval call binding the contract method 0x01ffc9a7. // // Solidity: function supportsInterface(bytes4 interfaceId) view returns(bool) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) SupportsInterface(interfaceId [4]byte) (bool, error) { return _NonfungiblePositionManager.Contract.SupportsInterface(&_NonfungiblePositionManager.CallOpts, interfaceId) } // Symbol is a free data retrieval call binding the contract method 0x95d89b41. // // Solidity: function symbol() view returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) Symbol(opts *bind.CallOpts) (string, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "symbol") if err != nil { return *new(string), err } out0 := *abi.ConvertType(out[0], new(string)).(*string) return out0, err } // Symbol is a free data retrieval call binding the contract method 0x95d89b41. // // Solidity: function symbol() view returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Symbol() (string, error) { return _NonfungiblePositionManager.Contract.Symbol(&_NonfungiblePositionManager.CallOpts) } // Symbol is a free data retrieval call binding the contract method 0x95d89b41. // // Solidity: function symbol() view returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) Symbol() (string, error) { return _NonfungiblePositionManager.Contract.Symbol(&_NonfungiblePositionManager.CallOpts) } // TokenURI is a free data retrieval call binding the contract method 0xc87b56dd. // // Solidity: function tokenURI(uint256 tokenId) view returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) TokenURI(opts *bind.CallOpts, tokenId *big.Int) (string, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "tokenURI", tokenId) if err != nil { return *new(string), err } out0 := *abi.ConvertType(out[0], new(string)).(*string) return out0, err } // TokenURI is a free data retrieval call binding the contract method 0xc87b56dd. // // Solidity: function tokenURI(uint256 tokenId) view returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) TokenURI(tokenId *big.Int) (string, error) { return _NonfungiblePositionManager.Contract.TokenURI(&_NonfungiblePositionManager.CallOpts, tokenId) } // TokenURI is a free data retrieval call binding the contract method 0xc87b56dd. // // Solidity: function tokenURI(uint256 tokenId) view returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) TokenURI(tokenId *big.Int) (string, error) { return _NonfungiblePositionManager.Contract.TokenURI(&_NonfungiblePositionManager.CallOpts, tokenId) } // Approve is a paid mutator transaction binding the contract method 0x095ea7b3. // // Solidity: function approve(address to, uint256 tokenId) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) Approve(opts *bind.TransactOpts, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "approve", to, tokenId) } // Approve is a paid mutator transaction binding the contract method 0x095ea7b3. // // Solidity: function approve(address to, uint256 tokenId) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Approve(to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Approve(&_NonfungiblePositionManager.TransactOpts, to, tokenId) } // Approve is a paid mutator transaction binding the contract method 0x095ea7b3. // // Solidity: function approve(address to, uint256 tokenId) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) Approve(to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Approve(&_NonfungiblePositionManager.TransactOpts, to, tokenId) } // Burn is a paid mutator transaction binding the contract method 0x42966c68. // // Solidity: function burn(uint256 tokenId) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) Burn(opts *bind.TransactOpts, tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "burn", tokenId) } // Burn is a paid mutator transaction binding the contract method 0x42966c68. // // Solidity: function burn(uint256 tokenId) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Burn(tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Burn(&_NonfungiblePositionManager.TransactOpts, tokenId) } // Burn is a paid mutator transaction binding the contract method 0x42966c68. // // Solidity: function burn(uint256 tokenId) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) Burn(tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Burn(&_NonfungiblePositionManager.TransactOpts, tokenId) } // Collect is a paid mutator transaction binding the contract method 0xfc6f7865. // // Solidity: function collect((uint256,address,uint128,uint128) params) payable returns(uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) Collect(opts *bind.TransactOpts, params UniswapV3BrokerCollectParams) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "collect", params) } // Collect is a paid mutator transaction binding the contract method 0xfc6f7865. // // Solidity: function collect((uint256,address,uint128,uint128) params) payable returns(uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Collect(params UniswapV3BrokerCollectParams) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Collect(&_NonfungiblePositionManager.TransactOpts, params) } // Collect is a paid mutator transaction binding the contract method 0xfc6f7865. // // Solidity: function collect((uint256,address,uint128,uint128) params) payable returns(uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) Collect(params UniswapV3BrokerCollectParams) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Collect(&_NonfungiblePositionManager.TransactOpts, params) } // CreateAndInitializePoolIfNecessary is a paid mutator transaction binding the contract method 0x13ead562. // // Solidity: function createAndInitializePoolIfNecessary(address token0, address token1, uint24 fee, uint160 sqrtPriceX96) payable returns(address pool) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) CreateAndInitializePoolIfNecessary(opts *bind.TransactOpts, token0 common.Address, token1 common.Address, fee *big.Int, sqrtPriceX96 *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "createAndInitializePoolIfNecessary", token0, token1, fee, sqrtPriceX96) } // CreateAndInitializePoolIfNecessary is a paid mutator transaction binding the contract method 0x13ead562. // // Solidity: function createAndInitializePoolIfNecessary(address token0, address token1, uint24 fee, uint160 sqrtPriceX96) payable returns(address pool) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) CreateAndInitializePoolIfNecessary(token0 common.Address, token1 common.Address, fee *big.Int, sqrtPriceX96 *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.CreateAndInitializePoolIfNecessary(&_NonfungiblePositionManager.TransactOpts, token0, token1, fee, sqrtPriceX96) } // CreateAndInitializePoolIfNecessary is a paid mutator transaction binding the contract method 0x13ead562. // // Solidity: function createAndInitializePoolIfNecessary(address token0, address token1, uint24 fee, uint160 sqrtPriceX96) payable returns(address pool) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) CreateAndInitializePoolIfNecessary(token0 common.Address, token1 common.Address, fee *big.Int, sqrtPriceX96 *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.CreateAndInitializePoolIfNecessary(&_NonfungiblePositionManager.TransactOpts, token0, token1, fee, sqrtPriceX96) } // DecreaseLiquidity is a paid mutator transaction binding the contract method 0x0c49ccbe. // // Solidity: function decreaseLiquidity((uint256,uint128,uint256,uint256,uint256) params) payable returns(uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) DecreaseLiquidity(opts *bind.TransactOpts, params UniswapV3BrokerDecreaseLiquidityParams) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "decreaseLiquidity", params) } // DecreaseLiquidity is a paid mutator transaction binding the contract method 0x0c49ccbe. // // Solidity: function decreaseLiquidity((uint256,uint128,uint256,uint256,uint256) params) payable returns(uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) DecreaseLiquidity(params UniswapV3BrokerDecreaseLiquidityParams) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.DecreaseLiquidity(&_NonfungiblePositionManager.TransactOpts, params) } // DecreaseLiquidity is a paid mutator transaction binding the contract method 0x0c49ccbe. // // Solidity: function decreaseLiquidity((uint256,uint128,uint256,uint256,uint256) params) payable returns(uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) DecreaseLiquidity(params UniswapV3BrokerDecreaseLiquidityParams) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.DecreaseLiquidity(&_NonfungiblePositionManager.TransactOpts, params) } // IncreaseLiquidity is a paid mutator transaction binding the contract method 0x219f5d17. // // Solidity: function increaseLiquidity((uint256,uint256,uint256,uint256,uint256,uint256) params) payable returns(uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) IncreaseLiquidity(opts *bind.TransactOpts, params UniswapV3BrokerIncreaseLiquidityParams) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "increaseLiquidity", params) } // IncreaseLiquidity is a paid mutator transaction binding the contract method 0x219f5d17. // // Solidity: function increaseLiquidity((uint256,uint256,uint256,uint256,uint256,uint256) params) payable returns(uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) IncreaseLiquidity(params UniswapV3BrokerIncreaseLiquidityParams) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.IncreaseLiquidity(&_NonfungiblePositionManager.TransactOpts, params) } // IncreaseLiquidity is a paid mutator transaction binding the contract method 0x219f5d17. // // Solidity: function increaseLiquidity((uint256,uint256,uint256,uint256,uint256,uint256) params) payable returns(uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) IncreaseLiquidity(params UniswapV3BrokerIncreaseLiquidityParams) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.IncreaseLiquidity(&_NonfungiblePositionManager.TransactOpts, params) } // Initialize is a paid mutator transaction binding the contract method 0xc0c53b8b. // // Solidity: function initialize(address _factory, address _WETH, address _tokenDescriptor_) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) Initialize(opts *bind.TransactOpts, _factory common.Address, _WETH common.Address, _tokenDescriptor_ common.Address) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "initialize", _factory, _WETH, _tokenDescriptor_) } // Initialize is a paid mutator transaction binding the contract method 0xc0c53b8b. // // Solidity: function initialize(address _factory, address _WETH, address _tokenDescriptor_) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Initialize(_factory common.Address, _WETH common.Address, _tokenDescriptor_ common.Address) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Initialize(&_NonfungiblePositionManager.TransactOpts, _factory, _WETH, _tokenDescriptor_) } // Initialize is a paid mutator transaction binding the contract method 0xc0c53b8b. // // Solidity: function initialize(address _factory, address _WETH, address _tokenDescriptor_) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) Initialize(_factory common.Address, _WETH common.Address, _tokenDescriptor_ common.Address) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Initialize(&_NonfungiblePositionManager.TransactOpts, _factory, _WETH, _tokenDescriptor_) } // Mint is a paid mutator transaction binding the contract method 0x88316456. // // Solidity: function mint((address,address,uint24,int24,int24,uint256,uint256,uint256,uint256,address,uint256) params) payable returns(uint256 tokenId, uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) Mint(opts *bind.TransactOpts, params INonfungiblePositionManagerMintParams) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "mint", params) } // Mint is a paid mutator transaction binding the contract method 0x88316456. // // Solidity: function mint((address,address,uint24,int24,int24,uint256,uint256,uint256,uint256,address,uint256) params) payable returns(uint256 tokenId, uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Mint(params INonfungiblePositionManagerMintParams) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Mint(&_NonfungiblePositionManager.TransactOpts, params) } // Mint is a paid mutator transaction binding the contract method 0x88316456. // // Solidity: function mint((address,address,uint24,int24,int24,uint256,uint256,uint256,uint256,address,uint256) params) payable returns(uint256 tokenId, uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) Mint(params INonfungiblePositionManagerMintParams) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Mint(&_NonfungiblePositionManager.TransactOpts, params) } // Multicall is a paid mutator transaction binding the contract method 0xac9650d8. // // Solidity: function multicall(bytes[] data) payable returns(bytes[] results) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) Multicall(opts *bind.TransactOpts, data [][]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "multicall", data) } // Multicall is a paid mutator transaction binding the contract method 0xac9650d8. // // Solidity: function multicall(bytes[] data) payable returns(bytes[] results) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Multicall(data [][]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Multicall(&_NonfungiblePositionManager.TransactOpts, data) } // Multicall is a paid mutator transaction binding the contract method 0xac9650d8. // // Solidity: function multicall(bytes[] data) payable returns(bytes[] results) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) Multicall(data [][]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Multicall(&_NonfungiblePositionManager.TransactOpts, data) } // Permit is a paid mutator transaction binding the contract method 0x7ac2ff7b. // // Solidity: function permit(address spender, uint256 tokenId, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) Permit(opts *bind.TransactOpts, spender common.Address, tokenId *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "permit", spender, tokenId, deadline, v, r, s) } // Permit is a paid mutator transaction binding the contract method 0x7ac2ff7b. // // Solidity: function permit(address spender, uint256 tokenId, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Permit(spender common.Address, tokenId *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Permit(&_NonfungiblePositionManager.TransactOpts, spender, tokenId, deadline, v, r, s) } // Permit is a paid mutator transaction binding the contract method 0x7ac2ff7b. // // Solidity: function permit(address spender, uint256 tokenId, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) Permit(spender common.Address, tokenId *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Permit(&_NonfungiblePositionManager.TransactOpts, spender, tokenId, deadline, v, r, s) } // RefundETH is a paid mutator transaction binding the contract method 0x12210e8a. // // Solidity: function refundETH() payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) RefundETH(opts *bind.TransactOpts) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "refundETH") } // RefundETH is a paid mutator transaction binding the contract method 0x12210e8a. // // Solidity: function refundETH() payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) RefundETH() (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.RefundETH(&_NonfungiblePositionManager.TransactOpts) } // RefundETH is a paid mutator transaction binding the contract method 0x12210e8a. // // Solidity: function refundETH() payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) RefundETH() (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.RefundETH(&_NonfungiblePositionManager.TransactOpts) } // RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. // // Solidity: function renounceOwnership() returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) RenounceOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "renounceOwnership") } // RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. // // Solidity: function renounceOwnership() returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) RenounceOwnership() (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.RenounceOwnership(&_NonfungiblePositionManager.TransactOpts) } // RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. // // Solidity: function renounceOwnership() returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) RenounceOwnership() (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.RenounceOwnership(&_NonfungiblePositionManager.TransactOpts) } // SafeTransferFrom is a paid mutator transaction binding the contract method 0x42842e0e. // // Solidity: function safeTransferFrom(address from, address to, uint256 tokenId) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) SafeTransferFrom(opts *bind.TransactOpts, from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "safeTransferFrom", from, to, tokenId) } // SafeTransferFrom is a paid mutator transaction binding the contract method 0x42842e0e. // // Solidity: function safeTransferFrom(address from, address to, uint256 tokenId) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) SafeTransferFrom(from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SafeTransferFrom(&_NonfungiblePositionManager.TransactOpts, from, to, tokenId) } // SafeTransferFrom is a paid mutator transaction binding the contract method 0x42842e0e. // // Solidity: function safeTransferFrom(address from, address to, uint256 tokenId) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) SafeTransferFrom(from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SafeTransferFrom(&_NonfungiblePositionManager.TransactOpts, from, to, tokenId) } // SafeTransferFrom0 is a paid mutator transaction binding the contract method 0xb88d4fde. // // Solidity: function safeTransferFrom(address from, address to, uint256 tokenId, bytes data) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) SafeTransferFrom0(opts *bind.TransactOpts, from common.Address, to common.Address, tokenId *big.Int, data []byte) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "safeTransferFrom0", from, to, tokenId, data) } // SafeTransferFrom0 is a paid mutator transaction binding the contract method 0xb88d4fde. // // Solidity: function safeTransferFrom(address from, address to, uint256 tokenId, bytes data) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) SafeTransferFrom0(from common.Address, to common.Address, tokenId *big.Int, data []byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SafeTransferFrom0(&_NonfungiblePositionManager.TransactOpts, from, to, tokenId, data) } // SafeTransferFrom0 is a paid mutator transaction binding the contract method 0xb88d4fde. // // Solidity: function safeTransferFrom(address from, address to, uint256 tokenId, bytes data) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) SafeTransferFrom0(from common.Address, to common.Address, tokenId *big.Int, data []byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SafeTransferFrom0(&_NonfungiblePositionManager.TransactOpts, from, to, tokenId, data) } // SelfPermit is a paid mutator transaction binding the contract method 0xf3995c67. // // Solidity: function selfPermit(address token, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) SelfPermit(opts *bind.TransactOpts, token common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "selfPermit", token, value, deadline, v, r, s) } // SelfPermit is a paid mutator transaction binding the contract method 0xf3995c67. // // Solidity: function selfPermit(address token, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) SelfPermit(token common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SelfPermit(&_NonfungiblePositionManager.TransactOpts, token, value, deadline, v, r, s) } // SelfPermit is a paid mutator transaction binding the contract method 0xf3995c67. // // Solidity: function selfPermit(address token, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) SelfPermit(token common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SelfPermit(&_NonfungiblePositionManager.TransactOpts, token, value, deadline, v, r, s) } // SelfPermitAllowed is a paid mutator transaction binding the contract method 0x4659a494. // // Solidity: function selfPermitAllowed(address token, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) SelfPermitAllowed(opts *bind.TransactOpts, token common.Address, nonce *big.Int, expiry *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "selfPermitAllowed", token, nonce, expiry, v, r, s) } // SelfPermitAllowed is a paid mutator transaction binding the contract method 0x4659a494. // // Solidity: function selfPermitAllowed(address token, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) SelfPermitAllowed(token common.Address, nonce *big.Int, expiry *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SelfPermitAllowed(&_NonfungiblePositionManager.TransactOpts, token, nonce, expiry, v, r, s) } // SelfPermitAllowed is a paid mutator transaction binding the contract method 0x4659a494. // // Solidity: function selfPermitAllowed(address token, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) SelfPermitAllowed(token common.Address, nonce *big.Int, expiry *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SelfPermitAllowed(&_NonfungiblePositionManager.TransactOpts, token, nonce, expiry, v, r, s) } // SelfPermitAllowedIfNecessary is a paid mutator transaction binding the contract method 0xa4a78f0c. // // Solidity: function selfPermitAllowedIfNecessary(address token, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) SelfPermitAllowedIfNecessary(opts *bind.TransactOpts, token common.Address, nonce *big.Int, expiry *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "selfPermitAllowedIfNecessary", token, nonce, expiry, v, r, s) } // SelfPermitAllowedIfNecessary is a paid mutator transaction binding the contract method 0xa4a78f0c. // // Solidity: function selfPermitAllowedIfNecessary(address token, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) SelfPermitAllowedIfNecessary(token common.Address, nonce *big.Int, expiry *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SelfPermitAllowedIfNecessary(&_NonfungiblePositionManager.TransactOpts, token, nonce, expiry, v, r, s) } // SelfPermitAllowedIfNecessary is a paid mutator transaction binding the contract method 0xa4a78f0c. // // Solidity: function selfPermitAllowedIfNecessary(address token, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) SelfPermitAllowedIfNecessary(token common.Address, nonce *big.Int, expiry *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SelfPermitAllowedIfNecessary(&_NonfungiblePositionManager.TransactOpts, token, nonce, expiry, v, r, s) } // SelfPermitIfNecessary is a paid mutator transaction binding the contract method 0xc2e3140a. // // Solidity: function selfPermitIfNecessary(address token, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) SelfPermitIfNecessary(opts *bind.TransactOpts, token common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "selfPermitIfNecessary", token, value, deadline, v, r, s) } // SelfPermitIfNecessary is a paid mutator transaction binding the contract method 0xc2e3140a. // // Solidity: function selfPermitIfNecessary(address token, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) SelfPermitIfNecessary(token common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SelfPermitIfNecessary(&_NonfungiblePositionManager.TransactOpts, token, value, deadline, v, r, s) } // SelfPermitIfNecessary is a paid mutator transaction binding the contract method 0xc2e3140a. // // Solidity: function selfPermitIfNecessary(address token, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) SelfPermitIfNecessary(token common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SelfPermitIfNecessary(&_NonfungiblePositionManager.TransactOpts, token, value, deadline, v, r, s) } // SetApprovalForAll is a paid mutator transaction binding the contract method 0xa22cb465. // // Solidity: function setApprovalForAll(address operator, bool approved) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) SetApprovalForAll(opts *bind.TransactOpts, operator common.Address, approved bool) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "setApprovalForAll", operator, approved) } // SetApprovalForAll is a paid mutator transaction binding the contract method 0xa22cb465. // // Solidity: function setApprovalForAll(address operator, bool approved) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) SetApprovalForAll(operator common.Address, approved bool) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SetApprovalForAll(&_NonfungiblePositionManager.TransactOpts, operator, approved) } // SetApprovalForAll is a paid mutator transaction binding the contract method 0xa22cb465. // // Solidity: function setApprovalForAll(address operator, bool approved) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) SetApprovalForAll(operator common.Address, approved bool) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SetApprovalForAll(&_NonfungiblePositionManager.TransactOpts, operator, approved) } // SetWETH is a paid mutator transaction binding the contract method 0x5b769f3c. // // Solidity: function setWETH(address WETHArg) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) SetWETH(opts *bind.TransactOpts, WETHArg common.Address) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "setWETH", WETHArg) } // SetWETH is a paid mutator transaction binding the contract method 0x5b769f3c. // // Solidity: function setWETH(address WETHArg) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) SetWETH(WETHArg common.Address) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SetWETH(&_NonfungiblePositionManager.TransactOpts, WETHArg) } // SetWETH is a paid mutator transaction binding the contract method 0x5b769f3c. // // Solidity: function setWETH(address WETHArg) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) SetWETH(WETHArg common.Address) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SetWETH(&_NonfungiblePositionManager.TransactOpts, WETHArg) } // SweepToken is a paid mutator transaction binding the contract method 0xdf2ab5bb. // // Solidity: function sweepToken(address token, uint256 amountMinimum, address recipient) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) SweepToken(opts *bind.TransactOpts, token common.Address, amountMinimum *big.Int, recipient common.Address) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "sweepToken", token, amountMinimum, recipient) } // SweepToken is a paid mutator transaction binding the contract method 0xdf2ab5bb. // // Solidity: function sweepToken(address token, uint256 amountMinimum, address recipient) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) SweepToken(token common.Address, amountMinimum *big.Int, recipient common.Address) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SweepToken(&_NonfungiblePositionManager.TransactOpts, token, amountMinimum, recipient) } // SweepToken is a paid mutator transaction binding the contract method 0xdf2ab5bb. // // Solidity: function sweepToken(address token, uint256 amountMinimum, address recipient) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) SweepToken(token common.Address, amountMinimum *big.Int, recipient common.Address) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SweepToken(&_NonfungiblePositionManager.TransactOpts, token, amountMinimum, recipient) } // TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. // // Solidity: function transferFrom(address from, address to, uint256 tokenId) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) TransferFrom(opts *bind.TransactOpts, from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "transferFrom", from, to, tokenId) } // TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. // // Solidity: function transferFrom(address from, address to, uint256 tokenId) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) TransferFrom(from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.TransferFrom(&_NonfungiblePositionManager.TransactOpts, from, to, tokenId) } // TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. // // Solidity: function transferFrom(address from, address to, uint256 tokenId) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) TransferFrom(from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.TransferFrom(&_NonfungiblePositionManager.TransactOpts, from, to, tokenId) } // TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. // // Solidity: function transferOwnership(address newOwner) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "transferOwnership", newOwner) } // TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. // // Solidity: function transferOwnership(address newOwner) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.TransferOwnership(&_NonfungiblePositionManager.TransactOpts, newOwner) } // TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. // // Solidity: function transferOwnership(address newOwner) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.TransferOwnership(&_NonfungiblePositionManager.TransactOpts, newOwner) } // UniswapV3MintCallback is a paid mutator transaction binding the contract method 0xd3487997. // // Solidity: function uniswapV3MintCallback(uint256 amount0Owed, uint256 amount1Owed, bytes data) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) UniswapV3MintCallback(opts *bind.TransactOpts, amount0Owed *big.Int, amount1Owed *big.Int, data []byte) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "uniswapV3MintCallback", amount0Owed, amount1Owed, data) } // UniswapV3MintCallback is a paid mutator transaction binding the contract method 0xd3487997. // // Solidity: function uniswapV3MintCallback(uint256 amount0Owed, uint256 amount1Owed, bytes data) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) UniswapV3MintCallback(amount0Owed *big.Int, amount1Owed *big.Int, data []byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.UniswapV3MintCallback(&_NonfungiblePositionManager.TransactOpts, amount0Owed, amount1Owed, data) } // UniswapV3MintCallback is a paid mutator transaction binding the contract method 0xd3487997. // // Solidity: function uniswapV3MintCallback(uint256 amount0Owed, uint256 amount1Owed, bytes data) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) UniswapV3MintCallback(amount0Owed *big.Int, amount1Owed *big.Int, data []byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.UniswapV3MintCallback(&_NonfungiblePositionManager.TransactOpts, amount0Owed, amount1Owed, data) } // UnwrapWETH is a paid mutator transaction binding the contract method 0xe16d9ce5. // // Solidity: function unwrapWETH(uint256 amountMinimum, address recipient) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) UnwrapWETH(opts *bind.TransactOpts, amountMinimum *big.Int, recipient common.Address) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "unwrapWETH", amountMinimum, recipient) } // UnwrapWETH is a paid mutator transaction binding the contract method 0xe16d9ce5. // // Solidity: function unwrapWETH(uint256 amountMinimum, address recipient) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) UnwrapWETH(amountMinimum *big.Int, recipient common.Address) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.UnwrapWETH(&_NonfungiblePositionManager.TransactOpts, amountMinimum, recipient) } // UnwrapWETH is a paid mutator transaction binding the contract method 0xe16d9ce5. // // Solidity: function unwrapWETH(uint256 amountMinimum, address recipient) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) UnwrapWETH(amountMinimum *big.Int, recipient common.Address) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.UnwrapWETH(&_NonfungiblePositionManager.TransactOpts, amountMinimum, recipient) } // Receive is a paid mutator transaction binding the contract receive function. // // Solidity: receive() payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) Receive(opts *bind.TransactOpts) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.RawTransact(opts, nil) // calldata is disallowed for receive function } // Receive is a paid mutator transaction binding the contract receive function. // // Solidity: receive() payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Receive() (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Receive(&_NonfungiblePositionManager.TransactOpts) } // Receive is a paid mutator transaction binding the contract receive function. // // Solidity: receive() payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) Receive() (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Receive(&_NonfungiblePositionManager.TransactOpts) } // NonfungiblePositionManagerApprovalIterator is returned from FilterApproval and is used to iterate over the raw logs and unpacked data for Approval events raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerApprovalIterator struct { Event *NonfungiblePositionManagerApproval // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *NonfungiblePositionManagerApprovalIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerApproval) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerApproval) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *NonfungiblePositionManagerApprovalIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *NonfungiblePositionManagerApprovalIterator) Close() error { it.sub.Unsubscribe() return nil } // NonfungiblePositionManagerApproval represents a Approval event raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerApproval struct { Owner common.Address Approved common.Address TokenId *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterApproval is a free log retrieval operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. // // Solidity: event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) FilterApproval(opts *bind.FilterOpts, owner []common.Address, approved []common.Address, tokenId []*big.Int) (*NonfungiblePositionManagerApprovalIterator, error) { var ownerRule []interface{} for _, ownerItem := range owner { ownerRule = append(ownerRule, ownerItem) } var approvedRule []interface{} for _, approvedItem := range approved { approvedRule = append(approvedRule, approvedItem) } var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _NonfungiblePositionManager.contract.FilterLogs(opts, "Approval", ownerRule, approvedRule, tokenIdRule) if err != nil { return nil, err } return &NonfungiblePositionManagerApprovalIterator{contract: _NonfungiblePositionManager.contract, event: "Approval", logs: logs, sub: sub}, nil } // WatchApproval is a free log subscription operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. // // Solidity: event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) WatchApproval(opts *bind.WatchOpts, sink chan<- *NonfungiblePositionManagerApproval, owner []common.Address, approved []common.Address, tokenId []*big.Int) (event.Subscription, error) { var ownerRule []interface{} for _, ownerItem := range owner { ownerRule = append(ownerRule, ownerItem) } var approvedRule []interface{} for _, approvedItem := range approved { approvedRule = append(approvedRule, approvedItem) } var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _NonfungiblePositionManager.contract.WatchLogs(opts, "Approval", ownerRule, approvedRule, tokenIdRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(NonfungiblePositionManagerApproval) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "Approval", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseApproval is a log parse operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. // // Solidity: event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) ParseApproval(log types.Log) (*NonfungiblePositionManagerApproval, error) { event := new(NonfungiblePositionManagerApproval) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "Approval", log); err != nil { return nil, err } event.Raw = log return event, nil } // NonfungiblePositionManagerApprovalForAllIterator is returned from FilterApprovalForAll and is used to iterate over the raw logs and unpacked data for ApprovalForAll events raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerApprovalForAllIterator struct { Event *NonfungiblePositionManagerApprovalForAll // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *NonfungiblePositionManagerApprovalForAllIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerApprovalForAll) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerApprovalForAll) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *NonfungiblePositionManagerApprovalForAllIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *NonfungiblePositionManagerApprovalForAllIterator) Close() error { it.sub.Unsubscribe() return nil } // NonfungiblePositionManagerApprovalForAll represents a ApprovalForAll event raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerApprovalForAll struct { Owner common.Address Operator common.Address Approved bool Raw types.Log // Blockchain specific contextual infos } // FilterApprovalForAll is a free log retrieval operation binding the contract event 0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31. // // Solidity: event ApprovalForAll(address indexed owner, address indexed operator, bool approved) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) FilterApprovalForAll(opts *bind.FilterOpts, owner []common.Address, operator []common.Address) (*NonfungiblePositionManagerApprovalForAllIterator, error) { var ownerRule []interface{} for _, ownerItem := range owner { ownerRule = append(ownerRule, ownerItem) } var operatorRule []interface{} for _, operatorItem := range operator { operatorRule = append(operatorRule, operatorItem) } logs, sub, err := _NonfungiblePositionManager.contract.FilterLogs(opts, "ApprovalForAll", ownerRule, operatorRule) if err != nil { return nil, err } return &NonfungiblePositionManagerApprovalForAllIterator{contract: _NonfungiblePositionManager.contract, event: "ApprovalForAll", logs: logs, sub: sub}, nil } // WatchApprovalForAll is a free log subscription operation binding the contract event 0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31. // // Solidity: event ApprovalForAll(address indexed owner, address indexed operator, bool approved) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) WatchApprovalForAll(opts *bind.WatchOpts, sink chan<- *NonfungiblePositionManagerApprovalForAll, owner []common.Address, operator []common.Address) (event.Subscription, error) { var ownerRule []interface{} for _, ownerItem := range owner { ownerRule = append(ownerRule, ownerItem) } var operatorRule []interface{} for _, operatorItem := range operator { operatorRule = append(operatorRule, operatorItem) } logs, sub, err := _NonfungiblePositionManager.contract.WatchLogs(opts, "ApprovalForAll", ownerRule, operatorRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(NonfungiblePositionManagerApprovalForAll) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "ApprovalForAll", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseApprovalForAll is a log parse operation binding the contract event 0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31. // // Solidity: event ApprovalForAll(address indexed owner, address indexed operator, bool approved) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) ParseApprovalForAll(log types.Log) (*NonfungiblePositionManagerApprovalForAll, error) { event := new(NonfungiblePositionManagerApprovalForAll) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "ApprovalForAll", log); err != nil { return nil, err } event.Raw = log return event, nil } // NonfungiblePositionManagerCollectIterator is returned from FilterCollect and is used to iterate over the raw logs and unpacked data for Collect events raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerCollectIterator struct { Event *NonfungiblePositionManagerCollect // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *NonfungiblePositionManagerCollectIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerCollect) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerCollect) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *NonfungiblePositionManagerCollectIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *NonfungiblePositionManagerCollectIterator) Close() error { it.sub.Unsubscribe() return nil } // NonfungiblePositionManagerCollect represents a Collect event raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerCollect struct { TokenId *big.Int Recipient common.Address Amount0 *big.Int Amount1 *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterCollect is a free log retrieval operation binding the contract event 0x40d0efd1a53d60ecbf40971b9daf7dc90178c3aadc7aab1765632738fa8b8f01. // // Solidity: event Collect(uint256 indexed tokenId, address recipient, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) FilterCollect(opts *bind.FilterOpts, tokenId []*big.Int) (*NonfungiblePositionManagerCollectIterator, error) { var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _NonfungiblePositionManager.contract.FilterLogs(opts, "Collect", tokenIdRule) if err != nil { return nil, err } return &NonfungiblePositionManagerCollectIterator{contract: _NonfungiblePositionManager.contract, event: "Collect", logs: logs, sub: sub}, nil } // WatchCollect is a free log subscription operation binding the contract event 0x40d0efd1a53d60ecbf40971b9daf7dc90178c3aadc7aab1765632738fa8b8f01. // // Solidity: event Collect(uint256 indexed tokenId, address recipient, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) WatchCollect(opts *bind.WatchOpts, sink chan<- *NonfungiblePositionManagerCollect, tokenId []*big.Int) (event.Subscription, error) { var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _NonfungiblePositionManager.contract.WatchLogs(opts, "Collect", tokenIdRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(NonfungiblePositionManagerCollect) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "Collect", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseCollect is a log parse operation binding the contract event 0x40d0efd1a53d60ecbf40971b9daf7dc90178c3aadc7aab1765632738fa8b8f01. // // Solidity: event Collect(uint256 indexed tokenId, address recipient, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) ParseCollect(log types.Log) (*NonfungiblePositionManagerCollect, error) { event := new(NonfungiblePositionManagerCollect) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "Collect", log); err != nil { return nil, err } event.Raw = log return event, nil } // NonfungiblePositionManagerDecreaseLiquidityIterator is returned from FilterDecreaseLiquidity and is used to iterate over the raw logs and unpacked data for DecreaseLiquidity events raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerDecreaseLiquidityIterator struct { Event *NonfungiblePositionManagerDecreaseLiquidity // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *NonfungiblePositionManagerDecreaseLiquidityIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerDecreaseLiquidity) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerDecreaseLiquidity) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *NonfungiblePositionManagerDecreaseLiquidityIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *NonfungiblePositionManagerDecreaseLiquidityIterator) Close() error { it.sub.Unsubscribe() return nil } // NonfungiblePositionManagerDecreaseLiquidity represents a DecreaseLiquidity event raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerDecreaseLiquidity struct { TokenId *big.Int Liquidity *big.Int Amount0 *big.Int Amount1 *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterDecreaseLiquidity is a free log retrieval operation binding the contract event 0x26f6a048ee9138f2c0ce266f322cb99228e8d619ae2bff30c67f8dcf9d2377b4. // // Solidity: event DecreaseLiquidity(uint256 indexed tokenId, uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) FilterDecreaseLiquidity(opts *bind.FilterOpts, tokenId []*big.Int) (*NonfungiblePositionManagerDecreaseLiquidityIterator, error) { var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _NonfungiblePositionManager.contract.FilterLogs(opts, "DecreaseLiquidity", tokenIdRule) if err != nil { return nil, err } return &NonfungiblePositionManagerDecreaseLiquidityIterator{contract: _NonfungiblePositionManager.contract, event: "DecreaseLiquidity", logs: logs, sub: sub}, nil } // WatchDecreaseLiquidity is a free log subscription operation binding the contract event 0x26f6a048ee9138f2c0ce266f322cb99228e8d619ae2bff30c67f8dcf9d2377b4. // // Solidity: event DecreaseLiquidity(uint256 indexed tokenId, uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) WatchDecreaseLiquidity(opts *bind.WatchOpts, sink chan<- *NonfungiblePositionManagerDecreaseLiquidity, tokenId []*big.Int) (event.Subscription, error) { var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _NonfungiblePositionManager.contract.WatchLogs(opts, "DecreaseLiquidity", tokenIdRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(NonfungiblePositionManagerDecreaseLiquidity) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "DecreaseLiquidity", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseDecreaseLiquidity is a log parse operation binding the contract event 0x26f6a048ee9138f2c0ce266f322cb99228e8d619ae2bff30c67f8dcf9d2377b4. // // Solidity: event DecreaseLiquidity(uint256 indexed tokenId, uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) ParseDecreaseLiquidity(log types.Log) (*NonfungiblePositionManagerDecreaseLiquidity, error) { event := new(NonfungiblePositionManagerDecreaseLiquidity) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "DecreaseLiquidity", log); err != nil { return nil, err } event.Raw = log return event, nil } // NonfungiblePositionManagerIncreaseLiquidityIterator is returned from FilterIncreaseLiquidity and is used to iterate over the raw logs and unpacked data for IncreaseLiquidity events raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerIncreaseLiquidityIterator struct { Event *NonfungiblePositionManagerIncreaseLiquidity // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *NonfungiblePositionManagerIncreaseLiquidityIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerIncreaseLiquidity) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerIncreaseLiquidity) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *NonfungiblePositionManagerIncreaseLiquidityIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *NonfungiblePositionManagerIncreaseLiquidityIterator) Close() error { it.sub.Unsubscribe() return nil } // NonfungiblePositionManagerIncreaseLiquidity represents a IncreaseLiquidity event raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerIncreaseLiquidity struct { TokenId *big.Int Liquidity *big.Int Amount0 *big.Int Amount1 *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterIncreaseLiquidity is a free log retrieval operation binding the contract event 0x3067048beee31b25b2f1681f88dac838c8bba36af25bfb2b7cf7473a5847e35f. // // Solidity: event IncreaseLiquidity(uint256 indexed tokenId, uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) FilterIncreaseLiquidity(opts *bind.FilterOpts, tokenId []*big.Int) (*NonfungiblePositionManagerIncreaseLiquidityIterator, error) { var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _NonfungiblePositionManager.contract.FilterLogs(opts, "IncreaseLiquidity", tokenIdRule) if err != nil { return nil, err } return &NonfungiblePositionManagerIncreaseLiquidityIterator{contract: _NonfungiblePositionManager.contract, event: "IncreaseLiquidity", logs: logs, sub: sub}, nil } // WatchIncreaseLiquidity is a free log subscription operation binding the contract event 0x3067048beee31b25b2f1681f88dac838c8bba36af25bfb2b7cf7473a5847e35f. // // Solidity: event IncreaseLiquidity(uint256 indexed tokenId, uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) WatchIncreaseLiquidity(opts *bind.WatchOpts, sink chan<- *NonfungiblePositionManagerIncreaseLiquidity, tokenId []*big.Int) (event.Subscription, error) { var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _NonfungiblePositionManager.contract.WatchLogs(opts, "IncreaseLiquidity", tokenIdRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(NonfungiblePositionManagerIncreaseLiquidity) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "IncreaseLiquidity", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseIncreaseLiquidity is a log parse operation binding the contract event 0x3067048beee31b25b2f1681f88dac838c8bba36af25bfb2b7cf7473a5847e35f. // // Solidity: event IncreaseLiquidity(uint256 indexed tokenId, uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) ParseIncreaseLiquidity(log types.Log) (*NonfungiblePositionManagerIncreaseLiquidity, error) { event := new(NonfungiblePositionManagerIncreaseLiquidity) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "IncreaseLiquidity", log); err != nil { return nil, err } event.Raw = log return event, nil } // NonfungiblePositionManagerInitializedIterator is returned from FilterInitialized and is used to iterate over the raw logs and unpacked data for Initialized events raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerInitializedIterator struct { Event *NonfungiblePositionManagerInitialized // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *NonfungiblePositionManagerInitializedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerInitialized) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerInitialized) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *NonfungiblePositionManagerInitializedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *NonfungiblePositionManagerInitializedIterator) Close() error { it.sub.Unsubscribe() return nil } // NonfungiblePositionManagerInitialized represents a Initialized event raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerInitialized struct { Version uint8 Raw types.Log // Blockchain specific contextual infos } // FilterInitialized is a free log retrieval operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. // // Solidity: event Initialized(uint8 version) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) FilterInitialized(opts *bind.FilterOpts) (*NonfungiblePositionManagerInitializedIterator, error) { logs, sub, err := _NonfungiblePositionManager.contract.FilterLogs(opts, "Initialized") if err != nil { return nil, err } return &NonfungiblePositionManagerInitializedIterator{contract: _NonfungiblePositionManager.contract, event: "Initialized", logs: logs, sub: sub}, nil } // WatchInitialized is a free log subscription operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. // // Solidity: event Initialized(uint8 version) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) WatchInitialized(opts *bind.WatchOpts, sink chan<- *NonfungiblePositionManagerInitialized) (event.Subscription, error) { logs, sub, err := _NonfungiblePositionManager.contract.WatchLogs(opts, "Initialized") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(NonfungiblePositionManagerInitialized) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "Initialized", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseInitialized is a log parse operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. // // Solidity: event Initialized(uint8 version) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) ParseInitialized(log types.Log) (*NonfungiblePositionManagerInitialized, error) { event := new(NonfungiblePositionManagerInitialized) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "Initialized", log); err != nil { return nil, err } event.Raw = log return event, nil } // NonfungiblePositionManagerOwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerOwnershipTransferredIterator struct { Event *NonfungiblePositionManagerOwnershipTransferred // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *NonfungiblePositionManagerOwnershipTransferredIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerOwnershipTransferred) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerOwnershipTransferred) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *NonfungiblePositionManagerOwnershipTransferredIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *NonfungiblePositionManagerOwnershipTransferredIterator) Close() error { it.sub.Unsubscribe() return nil } // NonfungiblePositionManagerOwnershipTransferred represents a OwnershipTransferred event raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerOwnershipTransferred struct { PreviousOwner common.Address NewOwner common.Address Raw types.Log // Blockchain specific contextual infos } // FilterOwnershipTransferred is a free log retrieval operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. // // Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*NonfungiblePositionManagerOwnershipTransferredIterator, error) { var previousOwnerRule []interface{} for _, previousOwnerItem := range previousOwner { previousOwnerRule = append(previousOwnerRule, previousOwnerItem) } var newOwnerRule []interface{} for _, newOwnerItem := range newOwner { newOwnerRule = append(newOwnerRule, newOwnerItem) } logs, sub, err := _NonfungiblePositionManager.contract.FilterLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) if err != nil { return nil, err } return &NonfungiblePositionManagerOwnershipTransferredIterator{contract: _NonfungiblePositionManager.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil } // WatchOwnershipTransferred is a free log subscription operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. // // Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *NonfungiblePositionManagerOwnershipTransferred, previousOwner []common.Address, newOwner []common.Address) (event.Subscription, error) { var previousOwnerRule []interface{} for _, previousOwnerItem := range previousOwner { previousOwnerRule = append(previousOwnerRule, previousOwnerItem) } var newOwnerRule []interface{} for _, newOwnerItem := range newOwner { newOwnerRule = append(newOwnerRule, newOwnerItem) } logs, sub, err := _NonfungiblePositionManager.contract.WatchLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(NonfungiblePositionManagerOwnershipTransferred) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseOwnershipTransferred is a log parse operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. // // Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) ParseOwnershipTransferred(log types.Log) (*NonfungiblePositionManagerOwnershipTransferred, error) { event := new(NonfungiblePositionManagerOwnershipTransferred) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { return nil, err } event.Raw = log return event, nil } // NonfungiblePositionManagerTransferIterator is returned from FilterTransfer and is used to iterate over the raw logs and unpacked data for Transfer events raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerTransferIterator struct { Event *NonfungiblePositionManagerTransfer // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *NonfungiblePositionManagerTransferIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerTransfer) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerTransfer) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *NonfungiblePositionManagerTransferIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *NonfungiblePositionManagerTransferIterator) Close() error { it.sub.Unsubscribe() return nil } // NonfungiblePositionManagerTransfer represents a Transfer event raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerTransfer struct { From common.Address To common.Address TokenId *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterTransfer is a free log retrieval operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. // // Solidity: event Transfer(address indexed from, address indexed to, uint256 indexed tokenId) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) FilterTransfer(opts *bind.FilterOpts, from []common.Address, to []common.Address, tokenId []*big.Int) (*NonfungiblePositionManagerTransferIterator, error) { var fromRule []interface{} for _, fromItem := range from { fromRule = append(fromRule, fromItem) } var toRule []interface{} for _, toItem := range to { toRule = append(toRule, toItem) } var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _NonfungiblePositionManager.contract.FilterLogs(opts, "Transfer", fromRule, toRule, tokenIdRule) if err != nil { return nil, err } return &NonfungiblePositionManagerTransferIterator{contract: _NonfungiblePositionManager.contract, event: "Transfer", logs: logs, sub: sub}, nil } // WatchTransfer is a free log subscription operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. // // Solidity: event Transfer(address indexed from, address indexed to, uint256 indexed tokenId) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) WatchTransfer(opts *bind.WatchOpts, sink chan<- *NonfungiblePositionManagerTransfer, from []common.Address, to []common.Address, tokenId []*big.Int) (event.Subscription, error) { var fromRule []interface{} for _, fromItem := range from { fromRule = append(fromRule, fromItem) } var toRule []interface{} for _, toItem := range to { toRule = append(toRule, toItem) } var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _NonfungiblePositionManager.contract.WatchLogs(opts, "Transfer", fromRule, toRule, tokenIdRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(NonfungiblePositionManagerTransfer) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "Transfer", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseTransfer is a log parse operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. // // Solidity: event Transfer(address indexed from, address indexed to, uint256 indexed tokenId) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) ParseTransfer(log types.Log) (*NonfungiblePositionManagerTransfer, error) { event := new(NonfungiblePositionManagerTransfer) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "Transfer", log); err != nil { return nil, err } event.Raw = log return event, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/binds/memenonfungiblepositionmanager/abi.json ================================================ [ { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "owner", "type": "address" }, { "indexed": true, "internalType": "address", "name": "approved", "type": "address" }, { "indexed": true, "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "Approval", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "owner", "type": "address" }, { "indexed": true, "internalType": "address", "name": "operator", "type": "address" }, { "indexed": false, "internalType": "bool", "name": "approved", "type": "bool" } ], "name": "ApprovalForAll", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "indexed": false, "internalType": "address", "name": "recipient", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "amount0", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "amount1", "type": "uint256" } ], "name": "Collect", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "indexed": false, "internalType": "uint128", "name": "liquidity", "type": "uint128" }, { "indexed": false, "internalType": "uint256", "name": "amount0", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "amount1", "type": "uint256" } ], "name": "DecreaseLiquidity", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "indexed": false, "internalType": "uint128", "name": "liquidity", "type": "uint128" }, { "indexed": false, "internalType": "uint256", "name": "amount0", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "amount1", "type": "uint256" } ], "name": "IncreaseLiquidity", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "uint8", "name": "version", "type": "uint8" } ], "name": "Initialized", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "previousOwner", "type": "address" }, { "indexed": true, "internalType": "address", "name": "newOwner", "type": "address" } ], "name": "OwnershipTransferred", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "from", "type": "address" }, { "indexed": true, "internalType": "address", "name": "to", "type": "address" }, { "indexed": true, "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "Transfer", "type": "event" }, { "inputs": [], "name": "DOMAIN_SEPARATOR", "outputs": [ { "internalType": "bytes32", "name": "", "type": "bytes32" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "PERMIT_TYPEHASH", "outputs": [ { "internalType": "bytes32", "name": "", "type": "bytes32" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "WETH", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "to", "type": "address" }, { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "approve", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "owner", "type": "address" } ], "name": "balanceOf", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "baseURI", "outputs": [ { "internalType": "string", "name": "", "type": "string" } ], "stateMutability": "pure", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "burn", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "components": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "internalType": "address", "name": "recipient", "type": "address" }, { "internalType": "uint128", "name": "amount0Max", "type": "uint128" }, { "internalType": "uint128", "name": "amount1Max", "type": "uint128" } ], "internalType": "struct UniswapV3Broker.CollectParams", "name": "params", "type": "tuple" } ], "name": "collect", "outputs": [ { "internalType": "uint256", "name": "amount0", "type": "uint256" }, { "internalType": "uint256", "name": "amount1", "type": "uint256" } ], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "token0", "type": "address" }, { "internalType": "address", "name": "token1", "type": "address" }, { "internalType": "uint24", "name": "fee", "type": "uint24" }, { "internalType": "uint160", "name": "sqrtPriceX96", "type": "uint160" } ], "name": "createAndInitializePoolIfNecessary", "outputs": [ { "internalType": "address", "name": "pool", "type": "address" } ], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "components": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "internalType": "uint128", "name": "liquidity", "type": "uint128" }, { "internalType": "uint256", "name": "amount0Min", "type": "uint256" }, { "internalType": "uint256", "name": "amount1Min", "type": "uint256" }, { "internalType": "uint256", "name": "deadline", "type": "uint256" } ], "internalType": "struct UniswapV3Broker.DecreaseLiquidityParams", "name": "params", "type": "tuple" } ], "name": "decreaseLiquidity", "outputs": [ { "internalType": "uint256", "name": "amount0", "type": "uint256" }, { "internalType": "uint256", "name": "amount1", "type": "uint256" } ], "stateMutability": "payable", "type": "function" }, { "inputs": [], "name": "factory", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "getApproved", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "components": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "internalType": "uint256", "name": "amount0Desired", "type": "uint256" }, { "internalType": "uint256", "name": "amount1Desired", "type": "uint256" }, { "internalType": "uint256", "name": "amount0Min", "type": "uint256" }, { "internalType": "uint256", "name": "amount1Min", "type": "uint256" }, { "internalType": "uint256", "name": "deadline", "type": "uint256" } ], "internalType": "struct UniswapV3Broker.IncreaseLiquidityParams", "name": "params", "type": "tuple" } ], "name": "increaseLiquidity", "outputs": [ { "internalType": "uint128", "name": "liquidity", "type": "uint128" }, { "internalType": "uint256", "name": "amount0", "type": "uint256" }, { "internalType": "uint256", "name": "amount1", "type": "uint256" } ], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "_factory", "type": "address" }, { "internalType": "address", "name": "_WETH", "type": "address" }, { "internalType": "address", "name": "_tokenDescriptor_", "type": "address" } ], "name": "initialize", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "owner", "type": "address" }, { "internalType": "address", "name": "operator", "type": "address" } ], "name": "isApprovedForAll", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "components": [ { "internalType": "address", "name": "token0", "type": "address" }, { "internalType": "address", "name": "token1", "type": "address" }, { "internalType": "uint24", "name": "fee", "type": "uint24" }, { "internalType": "int24", "name": "tickLower", "type": "int24" }, { "internalType": "int24", "name": "tickUpper", "type": "int24" }, { "internalType": "uint256", "name": "amount0Desired", "type": "uint256" }, { "internalType": "uint256", "name": "amount1Desired", "type": "uint256" }, { "internalType": "uint256", "name": "amount0Min", "type": "uint256" }, { "internalType": "uint256", "name": "amount1Min", "type": "uint256" }, { "internalType": "address", "name": "recipient", "type": "address" }, { "internalType": "uint256", "name": "deadline", "type": "uint256" } ], "internalType": "struct INonfungiblePositionManager.MintParams", "name": "params", "type": "tuple" } ], "name": "mint", "outputs": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "internalType": "uint128", "name": "liquidity", "type": "uint128" }, { "internalType": "uint256", "name": "amount0", "type": "uint256" }, { "internalType": "uint256", "name": "amount1", "type": "uint256" } ], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "bytes[]", "name": "data", "type": "bytes[]" } ], "name": "multicall", "outputs": [ { "internalType": "bytes[]", "name": "results", "type": "bytes[]" } ], "stateMutability": "payable", "type": "function" }, { "inputs": [], "name": "name", "outputs": [ { "internalType": "string", "name": "", "type": "string" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "owner", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "ownerOf", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "spender", "type": "address" }, { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "internalType": "uint256", "name": "deadline", "type": "uint256" }, { "internalType": "uint8", "name": "v", "type": "uint8" }, { "internalType": "bytes32", "name": "r", "type": "bytes32" }, { "internalType": "bytes32", "name": "s", "type": "bytes32" } ], "name": "permit", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "positions", "outputs": [ { "internalType": "uint96", "name": "nonce", "type": "uint96" }, { "internalType": "address", "name": "operator", "type": "address" }, { "internalType": "address", "name": "token0", "type": "address" }, { "internalType": "address", "name": "token1", "type": "address" }, { "internalType": "uint24", "name": "fee", "type": "uint24" }, { "internalType": "int24", "name": "tickLower", "type": "int24" }, { "internalType": "int24", "name": "tickUpper", "type": "int24" }, { "internalType": "uint128", "name": "liquidity", "type": "uint128" }, { "internalType": "uint256", "name": "feeGrowthInside0LastX128", "type": "uint256" }, { "internalType": "uint256", "name": "feeGrowthInside1LastX128", "type": "uint256" }, { "internalType": "uint128", "name": "tokensOwed0", "type": "uint128" }, { "internalType": "uint128", "name": "tokensOwed1", "type": "uint128" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "refundETH", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [], "name": "renounceOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "from", "type": "address" }, { "internalType": "address", "name": "to", "type": "address" }, { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "safeTransferFrom", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "from", "type": "address" }, { "internalType": "address", "name": "to", "type": "address" }, { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "internalType": "bytes", "name": "data", "type": "bytes" } ], "name": "safeTransferFrom", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "token", "type": "address" }, { "internalType": "uint256", "name": "value", "type": "uint256" }, { "internalType": "uint256", "name": "deadline", "type": "uint256" }, { "internalType": "uint8", "name": "v", "type": "uint8" }, { "internalType": "bytes32", "name": "r", "type": "bytes32" }, { "internalType": "bytes32", "name": "s", "type": "bytes32" } ], "name": "selfPermit", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "token", "type": "address" }, { "internalType": "uint256", "name": "nonce", "type": "uint256" }, { "internalType": "uint256", "name": "expiry", "type": "uint256" }, { "internalType": "uint8", "name": "v", "type": "uint8" }, { "internalType": "bytes32", "name": "r", "type": "bytes32" }, { "internalType": "bytes32", "name": "s", "type": "bytes32" } ], "name": "selfPermitAllowed", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "token", "type": "address" }, { "internalType": "uint256", "name": "nonce", "type": "uint256" }, { "internalType": "uint256", "name": "expiry", "type": "uint256" }, { "internalType": "uint8", "name": "v", "type": "uint8" }, { "internalType": "bytes32", "name": "r", "type": "bytes32" }, { "internalType": "bytes32", "name": "s", "type": "bytes32" } ], "name": "selfPermitAllowedIfNecessary", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "token", "type": "address" }, { "internalType": "uint256", "name": "value", "type": "uint256" }, { "internalType": "uint256", "name": "deadline", "type": "uint256" }, { "internalType": "uint8", "name": "v", "type": "uint8" }, { "internalType": "bytes32", "name": "r", "type": "bytes32" }, { "internalType": "bytes32", "name": "s", "type": "bytes32" } ], "name": "selfPermitIfNecessary", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "operator", "type": "address" }, { "internalType": "bool", "name": "approved", "type": "bool" } ], "name": "setApprovalForAll", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "WETHArg", "type": "address" } ], "name": "setWETH", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "bytes4", "name": "interfaceId", "type": "bytes4" } ], "name": "supportsInterface", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "token", "type": "address" }, { "internalType": "uint256", "name": "amountMinimum", "type": "uint256" }, { "internalType": "address", "name": "recipient", "type": "address" } ], "name": "sweepToken", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [], "name": "symbol", "outputs": [ { "internalType": "string", "name": "", "type": "string" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "tokenURI", "outputs": [ { "internalType": "string", "name": "", "type": "string" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "from", "type": "address" }, { "internalType": "address", "name": "to", "type": "address" }, { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "transferFrom", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "newOwner", "type": "address" } ], "name": "transferOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "amount0Owed", "type": "uint256" }, { "internalType": "uint256", "name": "amount1Owed", "type": "uint256" }, { "internalType": "bytes", "name": "data", "type": "bytes" } ], "name": "uniswapV3MintCallback", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "amountMinimum", "type": "uint256" }, { "internalType": "address", "name": "recipient", "type": "address" } ], "name": "unwrapWETH", "outputs": [], "stateMutability": "payable", "type": "function" }, { "stateMutability": "payable", "type": "receive" } ] ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/binds/memequoter/QuoterV2.go ================================================ // Code generated - DO NOT EDIT. // This file is a generated binding and any manual changes will be lost. package memequoter import ( "errors" "math/big" "strings" ethereum "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/event" ) // Reference imports to suppress errors if they are not otherwise used. var ( _ = errors.New _ = big.NewInt _ = strings.NewReader _ = ethereum.NotFound _ = bind.Bind _ = common.Big1 _ = types.BloomLookup _ = event.NewSubscription _ = abi.ConvertType ) // IQuoterV2QuoteExactInputSingleParams is an auto generated low-level Go binding around an user-defined struct. type IQuoterV2QuoteExactInputSingleParams struct { TokenIn common.Address TokenOut common.Address AmountIn *big.Int Fee *big.Int SqrtPriceLimitX96 *big.Int } // IQuoterV2QuoteExactOutputSingleParams is an auto generated low-level Go binding around an user-defined struct. type IQuoterV2QuoteExactOutputSingleParams struct { TokenIn common.Address TokenOut common.Address Amount *big.Int Fee *big.Int SqrtPriceLimitX96 *big.Int } // QuoterV2MetaData contains all meta data concerning the QuoterV2 contract. var QuoterV2MetaData = &bind.MetaData{ ABI: "[{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"WETH\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"factory\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_factory\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_WETH\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"path\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"amountIn\",\"type\":\"uint256\"}],\"name\":\"quoteExactInput\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amountOut\",\"type\":\"uint256\"},{\"internalType\":\"uint160[]\",\"name\":\"sqrtPriceX96AfterList\",\"type\":\"uint160[]\"},{\"internalType\":\"uint32[]\",\"name\":\"initializedTicksCrossedList\",\"type\":\"uint32[]\"},{\"internalType\":\"uint256\",\"name\":\"gasEstimate\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"tokenIn\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenOut\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amountIn\",\"type\":\"uint256\"},{\"internalType\":\"uint24\",\"name\":\"fee\",\"type\":\"uint24\"},{\"internalType\":\"uint160\",\"name\":\"sqrtPriceLimitX96\",\"type\":\"uint160\"}],\"internalType\":\"structIQuoterV2.QuoteExactInputSingleParams\",\"name\":\"params\",\"type\":\"tuple\"}],\"name\":\"quoteExactInputSingle\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amountOut\",\"type\":\"uint256\"},{\"internalType\":\"uint160\",\"name\":\"sqrtPriceX96After\",\"type\":\"uint160\"},{\"internalType\":\"uint32\",\"name\":\"initializedTicksCrossed\",\"type\":\"uint32\"},{\"internalType\":\"uint256\",\"name\":\"gasEstimate\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"path\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"amountOut\",\"type\":\"uint256\"}],\"name\":\"quoteExactOutput\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amountIn\",\"type\":\"uint256\"},{\"internalType\":\"uint160[]\",\"name\":\"sqrtPriceX96AfterList\",\"type\":\"uint160[]\"},{\"internalType\":\"uint32[]\",\"name\":\"initializedTicksCrossedList\",\"type\":\"uint32[]\"},{\"internalType\":\"uint256\",\"name\":\"gasEstimate\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"tokenIn\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenOut\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"uint24\",\"name\":\"fee\",\"type\":\"uint24\"},{\"internalType\":\"uint160\",\"name\":\"sqrtPriceLimitX96\",\"type\":\"uint160\"}],\"internalType\":\"structIQuoterV2.QuoteExactOutputSingleParams\",\"name\":\"params\",\"type\":\"tuple\"}],\"name\":\"quoteExactOutputSingle\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amountIn\",\"type\":\"uint256\"},{\"internalType\":\"uint160\",\"name\":\"sqrtPriceX96After\",\"type\":\"uint160\"},{\"internalType\":\"uint32\",\"name\":\"initializedTicksCrossed\",\"type\":\"uint32\"},{\"internalType\":\"uint256\",\"name\":\"gasEstimate\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"WETHArg\",\"type\":\"address\"}],\"name\":\"setWETH\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"int256\",\"name\":\"amount0Delta\",\"type\":\"int256\"},{\"internalType\":\"int256\",\"name\":\"amount1Delta\",\"type\":\"int256\"},{\"internalType\":\"bytes\",\"name\":\"path\",\"type\":\"bytes\"}],\"name\":\"uniswapV3SwapCallback\",\"outputs\":[],\"stateMutability\":\"view\",\"type\":\"function\"}]", Bin: "0x6080806040523461001657611c50908161001c8239f35b600080fdfe6080604052600436101561001257600080fd5b60003560e01c80632f80bb1d146100d7578063485cc955146100d25780635b769f3c146100cd578063715018a6146100c85780638da5cb5b146100c3578063ad5c4648146100be578063bd21704a146100b9578063c45a0155146100b4578063c6a5026a146100af578063cdca1753146100aa578063f2fde38b146100a55763fa461e33146100a057600080fd5b61066a565b6105d7565b6105bd565b610598565b61056f565b610515565b610484565b61045b565b6103fa565b6103b3565b6102ba565b61027b565b634e487b7160e01b600052604160045260246000fd5b60a0810190811067ffffffffffffffff82111761010e57604052565b6100dc565b6060810190811067ffffffffffffffff82111761010e57604052565b90601f8019910116810190811067ffffffffffffffff82111761010e57604052565b67ffffffffffffffff811161010e57601f01601f191660200190565b81601f820112156101b45780359061018482610151565b92610192604051948561012f565b828452602083830101116101b457816000926020809301838601378301015290565b600080fd5b60406003198201126101b4576004359067ffffffffffffffff82116101b4576101e49160040161016d565b9060243590565b94939290916080860192865260209260808488015281518091528360a0880192019060005b81811061025e57505050858103604087015282808351928381520192019260005b8281106102445750505060609150930152565b845163ffffffff1684529381019392810192600101610231565b82516001600160a01b031684529285019291850191600101610210565b346101b4576102a561029561028f366101b9565b90611281565b90604094929451948594856101eb565b0390f35b6001600160a01b038116036101b457565b346101b45760403660031901126101b4576004356102d7816102a9565b6103276024356102e6816102a9565b6000549261030b60ff8560081c1615809581966103a5575b8115610385575b5061089e565b8361031e600160ff196000541617600055565b61036c57610901565b61032d57005b61033d61ff001960005416600055565b604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb384740249890602090a1005b61038061010061ff00196000541617600055565b610901565b303b15915081610397575b5038610305565b6001915060ff161438610390565b600160ff82161091506102fe565b346101b45760203660031901126101b4576004356103d0816102a9565b6103d86107fd565b606680546001600160a01b0319166001600160a01b0392909216919091179055005b346101b457600080600319360112610458576104146107fd565b603380546001600160a01b0319811690915581906001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b80fd5b346101b45760003660031901126101b4576033546040516001600160a01b039091168152602090f35b346101b45760003660031901126101b4576066546040516001600160a01b039091168152602090f35b60a09060031901126101b457604051906104c6826100f2565b816004356104d3816102a9565b81526024356104e1816102a9565b6020820152604435604082015260643562ffffff811681036101b4576060820152608060843591610511836102a9565b0152565b346101b45760a03660031901126101b4576102a561053a610535366104ad565b611144565b604080519485526001600160a01b03909316602085015263ffffffff9091169183019190915260608201529081906080820190565b346101b45760003660031901126101b4576065546040516001600160a01b039091168152602090f35b346101b45760a03660031901126101b4576102a561053a6105b8366104ad565b610c12565b346101b4576102a56102956105d1366101b9565b90611033565b346101b45760203660031901126101b4576004356105f4816102a9565b6105fc6107fd565b6001600160a01b038116156106165761061490610855565b005b60405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608490fd5b346101b45760603660031901126101b45760443560243560043567ffffffffffffffff83116101b4576106a26004933690850161016d565b6000906106c2828413918280156107f4575b6106bd90610a4b565b611394565b919590926106e28385896106dd60655460018060a01b031690565b611346565b50156107c95761071260e0926106fa61071e93610a68565b976001600160a01b0380871690821610979590610b13565b6001600160a01b031690565b60405196878092633850c7bd851b82525afa9283156107c4576060958394610789575b501561075a575060405192835260208301526040820152fd5b9260675480610778575b505060405192835260208301526040820152fd5b6107829114610a4b565b3880610764565b9093506107ae91925060e03d81116107bd575b6107a6818361012f565b810190610a9b565b50505050509190919238610741565b503d61079c565b610b07565b9361071260e0926107dc61071e93610a68565b976001600160a01b0381811690871610979590610b13565b508386136106b4565b6033546001600160a01b0316330361081157565b606460405162461bcd60e51b815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b603380546001600160a01b039283166001600160a01b0319821681179092559091167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a3565b156108a557565b60405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608490fd5b6000549161092460ff8460081c1615809481956103a5578115610385575061089e565b82610937600160ff196000541617600055565b6109d2575b61095660ff60005460081c16610951816109eb565b6109eb565b61095f33610855565b60018060a01b0390816bffffffffffffffffffffffff60a01b93168360655416176065551690606654161760665561099357565b6109a361ff001960005416600055565b604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb384740249890602090a1565b6109e661010061ff00196000541617600055565b61093c565b156109f257565b60405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608490fd5b156101b457565b634e487b7160e01b600052601160045260246000fd5b600160ff1b8114610a795760000390565b610a52565b51908160020b82036101b457565b519061ffff821682036101b457565b908160e09103126101b4578051610ab1816102a9565b91610abe60208301610a7e565b91610acb60408201610a8c565b91610ad860608301610a8c565b91610ae560808201610a8c565b9160a082015160ff811681036101b45760c09092015180151581036101b45790565b6040513d6000823e3d90fd5b6065546001600160a01b0393610b379391851692610b31929061157f565b906115f0565b1690565b91908260409103126101b4576020825192015190565b60005b838110610b645750506000910152565b8181015183820152602001610b54565b90602091610b8d81518092818552858086019101610b51565b601f01601f1916010190565b6001600160a01b039182168152911515602083015260408201929092529116606082015260a060808201819052610bd292910190610b74565b90565b3d15610c00573d90610be682610151565b91610bf4604051938461012f565b82523d6000602084013e565b606090565b91908203918211610a7957565b80516020820180516060840180516000969591946001600160a01b03948894859485949293859392891690891681811093610c54929062ffffff165b91610b13565b975a996040948594610d15610c6b87870151610ddd565b60808701519094906001600160a01b03165b808716610dca57508215610da457610d07610cc5610cb7610cad6401000276a45b9a5b516001600160a01b031690565b935162ffffff1690565b9b516001600160a01b031690565b89519b8c93602085019192602b936bffffffffffffffffffffffff19809360601b16845262ffffff60e81b9060e81b16601484015260601b1660178201520190565b03601f1981018a528961012f565b610d35865198899687958694630251596160e31b86523060048701610b99565b03928b165af19182610d79575b5050610d7257505050610d6a929350610d64610d5c610bd5565b925a90610c05565b91610dec565b929391929091565b9250925092565b81610d9892903d10610d9d575b610d90818361012f565b810190610b3b565b610d42565b503d610d86565b610d07610cc5610cb7610cad73fffd8963efd1fc6a506488495d951d5263988d25610c9e565b610cc5610cb7610cad610d07939a610ca0565b600160ff1b8110156101b45790565b604051633850c7bd60e01b815291939192919060e0846004816001600160a01b0389165afa9384156107c457600094610ec8575b5080805160608103610e54575050610e4481602080610e4d94518301019101610f5f565b9195909661172b565b9293929190565b604411610e9057610e74816024806004610e8c9501518301019101610eef565b60405162461bcd60e51b815291829160048301610f4e565b0390fd5b60405162461bcd60e51b815260206004820152601060248201526f2ab732bc3832b1ba32b21032b93937b960811b6044820152606490fd5b610ee191945060e03d81116107bd576107a6818361012f565b505050505090509238610e20565b6020818303126101b45780519067ffffffffffffffff82116101b4570181601f820112156101b4578051610f2281610151565b92610f30604051948561012f565b818452602082840101116101b457610bd29160208085019101610b51565b906020610bd2928181520190610b74565b908160609103126101b457805191610bd260406020840151610f80816102a9565b9301610a7e565b67ffffffffffffffff811161010e5760051b60200190565b90610fa982610f87565b610fb6604051918261012f565b8281528092610fc7601f1991610f87565b0190602036910137565b8051821015610fe55760209160051b010190565b634e487b7160e01b600052603260045260246000fd5b90601f8201809211610a7957565b6017019081601711610a7957565b91908201809211610a7957565b6000198114610a795760010190565b91906110c56110ba926000948561105161104c83611380565b610f9f565b96826110f66110f06110d46110e961106c61104c8e99611380565b9a869c8d915b62ffffff61107f89611394565b91604094919490815195611092876100f2565b6001600160a01b03918216875216602086015284015216606082015260808101899052610c12565b95929d90938c610fd1565b6001600160a01b039091169052565b6110de8d8d610fd1565b9063ffffffff169052565b8895611017565b98611024565b9560428251101560001461113a57509061111286949392611453565b93976110c59693949093919290916110f6916110f0916110d4916110e991906110ba90611072565b9897955050505050565b80516020820180516060840180516000969587956001600160a01b039594861690861681811095889586958695946111d59492939261118a9290919062ffffff16610c4e565b9860808501809b826111a2835160018060a01b031690565b161561126f575b5a9a6040968796610c7d6111c76111c28a8d0151610ddd565b610a68565b95516001600160a01b031690565b6111f5865198899687958694630251596160e31b86523060048701610b99565b03928c165af19182611254575b505061124b57505050610d6a93945061123861071261122a611222610bd5565b935a90610c05565b94516001600160a01b031690565b610dec576112466000606755565b610dec565b93509350939050565b8161126a92903d10610d9d57610d90818361012f565b611202565b61127c6040880151606755565b6111a9565b91906110c56110ba926000948561129a61104c83611380565b96826113026110f06110d46110e96112b561104c8e99611380565b9a869c8d915b62ffffff6112c889611394565b9193906040908151956112da876100f2565b6001600160a01b03918216875216602086015284015216606082015260808101899052611144565b9560428251101560001461113a57509061131e86949392611453565b93976110c5969394909391929091611302916110f0916110d4916110e991906110ba906112bb565b6001600160a01b039361135f939192610b31929061157f565b168033036101b45790565b634e487b7160e01b600052601260045260246000fd5b516013198101908111610a79576017900490565b906113a360148351101561140f565b602082015160601c9160178151106113d35760376017820151916113cb602b8251101561140f565b015160601c91565b60405162461bcd60e51b8152602060048201526014602482015273746f55696e7432345f6f75744f66426f756e647360601b6044820152606490fd5b1561141657565b60405162461bcd60e51b8152602060048201526015602482015274746f416464726573735f6f75744f66426f756e647360581b6044820152606490fd5b80516016199182820190828211610a79576114788261147181610ffb565b1015611502565b611486601761147184611009565b61149b815161149484611009565b111561153f565b601783036114b85750505050604051600081526020810160405290565b601760405194601f8416801560051b9182828901019687010193010101905b8084106114ef5750508252601f01601f191660405290565b90928351815260208091019301906114d7565b1561150957565b60405162461bcd60e51b815260206004820152600e60248201526d736c6963655f6f766572666c6f7760901b6044820152606490fd5b1561154657565b60405162461bcd60e51b8152602060048201526011602482015270736c6963655f6f75744f66426f756e647360781b6044820152606490fd5b9162ffffff9160006040805161159481610113565b8281526020810183905201526001600160a01b0390808216858316116115d5575b81604051956115c387610113565b16855216602084015216604082015290565b936115b5565b908160209103126101b45751610bd2816102a9565b8151602083015191926001600160a01b03928316918316828110156101b45760209362ffffff6040606494015116956040519687958694630b4c774160e11b8652600486015260248501526044840152165afa9081156107c457600091611655575090565b610bd2915060203d8111611676575b61166e818361012f565b8101906115db565b503d611664565b908160209103126101b457610bd290610a7e565b60020b9060020b9081156116b457627fffff198114600019831416610a79570590565b61136a565b9060020b9081156116b45760020b0790565b908160209103126101b4575190565b60ff1660ff039060ff8211610a7957565b91909163ffffffff80809416911601918211610a7957565b60010b617fff8114610a795760010190565b63ffffffff9081166000190191908211610a7957565b6040516334324e9f60e21b8152909392600092916020816004816001600160a01b038a165afa80156107c45761177161177d9161178393600091611bc8575b5085611691565b60020b60081d60020b90565b60010b90565b6040516334324e9f60e21b81526020816004816001600160a01b038b165afa80156107c4576117c26117cd916117d393600091611ba9575b5086611691565b6101009060020b0790565b60ff1690565b6040516334324e9f60e21b81529095906020816004816001600160a01b038c165afa80156107c45761177161177d9161181493600091611ba9575086611691565b6040516334324e9f60e21b81529093906020816004816001600160a01b038d165afa80156107c4576117c26117cd9161185693600091611b8a575b5084611691565b60405163299ce14b60e11b8152600186900b60048201529093906020816024816001600160a01b038e165afa9081156107c457600091611b6b575b50600160ff86161b1615159586611b07575b86611af6575b60405163299ce14b60e11b8152600183900b60048201526020816024816001600160a01b038f165afa9081156107c457600091611ad7575b50600160ff8b161b1615159283611a63575b83611a51575b50508460010b8160010b90808212918215611a31575b505015611a265796939293969590965b60ff60001991161b5b8360010b8760010b136119f9578360010b8760010b146119dc575b60405163299ce14b60e11b8152600188900b6004820152916020836024816001600160a01b038e165afa80156107c45761199161199e93611998926119a4966000916119ad575b5016611be7565b61ffff1690565b906116eb565b95611703565b94600019611928565b6119cf915060203d6020116119d5575b6119c7818361012f565b8101906116cb565b3861198a565b503d6119bd565b6119f36119e8866116da565b60ff60001991161c90565b16611943565b5095945095505050611a16575b611a0d5790565b610bd290611715565b90611a2090611715565b90611a06565b90969395909261191f565b14905080611a41575b388061190f565b5060ff841660ff89161115611a3a565b600290810b91900b12915038806118f9565b6040516334324e9f60e21b81529093506020816004816001600160a01b038f165afa80156107c457611a9e91600091611aa8575b50826116b9565b60020b15926118f3565b611aca915060203d602011611ad0575b611ac2818361012f565b81019061167d565b38611a97565b503d611ab8565b611af0915060203d6020116119d5576119c7818361012f565b386118e1565b95508160020b8660020b13956118a9565b6040516334324e9f60e21b81529096506020816004816001600160a01b038e165afa80156107c457611b4291600091611b4c575b50836116b9565b60020b15956118a3565b611b65915060203d602011611ad057611ac2818361012f565b38611b3b565b611b84915060203d6020116119d5576119c7818361012f565b38611891565b611ba3915060203d602011611ad057611ac2818361012f565b3861184f565b611bc2915060203d602011611ad057611ac2818361012f565b386117bb565b611be1915060203d602011611ad057611ac2818361012f565b3861176a565b806000915b611bf4575090565b9061ffff809116908114610a795760010190600019810190808211610a79571680611bec56fea26469706673582212201b23cc68907f9e734d464818991239120a21043c25109f73414959d76fa268c564736f6c63430008130033", } // QuoterV2ABI is the input ABI used to generate the binding from. // Deprecated: Use QuoterV2MetaData.ABI instead. var QuoterV2ABI = QuoterV2MetaData.ABI // QuoterV2Bin is the compiled bytecode used for deploying new contracts. // Deprecated: Use QuoterV2MetaData.Bin instead. var QuoterV2Bin = QuoterV2MetaData.Bin // DeployQuoterV2 deploys a new Ethereum contract, binding an instance of QuoterV2 to it. func DeployQuoterV2(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *QuoterV2, error) { parsed, err := QuoterV2MetaData.GetAbi() if err != nil { return common.Address{}, nil, nil, err } if parsed == nil { return common.Address{}, nil, nil, errors.New("GetABI returned nil") } address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(QuoterV2Bin), backend) if err != nil { return common.Address{}, nil, nil, err } return address, tx, &QuoterV2{QuoterV2Caller: QuoterV2Caller{contract: contract}, QuoterV2Transactor: QuoterV2Transactor{contract: contract}, QuoterV2Filterer: QuoterV2Filterer{contract: contract}}, nil } // QuoterV2 is an auto generated Go binding around an Ethereum contract. type QuoterV2 struct { QuoterV2Caller // Read-only binding to the contract QuoterV2Transactor // Write-only binding to the contract QuoterV2Filterer // Log filterer for contract events } // QuoterV2Caller is an auto generated read-only Go binding around an Ethereum contract. type QuoterV2Caller struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // QuoterV2Transactor is an auto generated write-only Go binding around an Ethereum contract. type QuoterV2Transactor struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // QuoterV2Filterer is an auto generated log filtering Go binding around an Ethereum contract events. type QuoterV2Filterer struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // QuoterV2Session is an auto generated Go binding around an Ethereum contract, // with pre-set call and transact options. type QuoterV2Session struct { Contract *QuoterV2 // Generic contract binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // QuoterV2CallerSession is an auto generated read-only Go binding around an Ethereum contract, // with pre-set call options. type QuoterV2CallerSession struct { Contract *QuoterV2Caller // Generic contract caller binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session } // QuoterV2TransactorSession is an auto generated write-only Go binding around an Ethereum contract, // with pre-set transact options. type QuoterV2TransactorSession struct { Contract *QuoterV2Transactor // Generic contract transactor binding to set the session for TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // QuoterV2Raw is an auto generated low-level Go binding around an Ethereum contract. type QuoterV2Raw struct { Contract *QuoterV2 // Generic contract binding to access the raw methods on } // QuoterV2CallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. type QuoterV2CallerRaw struct { Contract *QuoterV2Caller // Generic read-only contract binding to access the raw methods on } // QuoterV2TransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. type QuoterV2TransactorRaw struct { Contract *QuoterV2Transactor // Generic write-only contract binding to access the raw methods on } // NewQuoterV2 creates a new instance of QuoterV2, bound to a specific deployed contract. func NewQuoterV2(address common.Address, backend bind.ContractBackend) (*QuoterV2, error) { contract, err := bindQuoterV2(address, backend, backend, backend) if err != nil { return nil, err } return &QuoterV2{QuoterV2Caller: QuoterV2Caller{contract: contract}, QuoterV2Transactor: QuoterV2Transactor{contract: contract}, QuoterV2Filterer: QuoterV2Filterer{contract: contract}}, nil } // NewQuoterV2Caller creates a new read-only instance of QuoterV2, bound to a specific deployed contract. func NewQuoterV2Caller(address common.Address, caller bind.ContractCaller) (*QuoterV2Caller, error) { contract, err := bindQuoterV2(address, caller, nil, nil) if err != nil { return nil, err } return &QuoterV2Caller{contract: contract}, nil } // NewQuoterV2Transactor creates a new write-only instance of QuoterV2, bound to a specific deployed contract. func NewQuoterV2Transactor(address common.Address, transactor bind.ContractTransactor) (*QuoterV2Transactor, error) { contract, err := bindQuoterV2(address, nil, transactor, nil) if err != nil { return nil, err } return &QuoterV2Transactor{contract: contract}, nil } // NewQuoterV2Filterer creates a new log filterer instance of QuoterV2, bound to a specific deployed contract. func NewQuoterV2Filterer(address common.Address, filterer bind.ContractFilterer) (*QuoterV2Filterer, error) { contract, err := bindQuoterV2(address, nil, nil, filterer) if err != nil { return nil, err } return &QuoterV2Filterer{contract: contract}, nil } // bindQuoterV2 binds a generic wrapper to an already deployed contract. func bindQuoterV2(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { parsed, err := QuoterV2MetaData.GetAbi() if err != nil { return nil, err } return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_QuoterV2 *QuoterV2Raw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _QuoterV2.Contract.QuoterV2Caller.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_QuoterV2 *QuoterV2Raw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _QuoterV2.Contract.QuoterV2Transactor.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_QuoterV2 *QuoterV2Raw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _QuoterV2.Contract.QuoterV2Transactor.contract.Transact(opts, method, params...) } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_QuoterV2 *QuoterV2CallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _QuoterV2.Contract.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_QuoterV2 *QuoterV2TransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _QuoterV2.Contract.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_QuoterV2 *QuoterV2TransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _QuoterV2.Contract.contract.Transact(opts, method, params...) } // WETH is a free data retrieval call binding the contract method 0xad5c4648. // // Solidity: function WETH() view returns(address) func (_QuoterV2 *QuoterV2Caller) WETH(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _QuoterV2.contract.Call(opts, &out, "WETH") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // WETH is a free data retrieval call binding the contract method 0xad5c4648. // // Solidity: function WETH() view returns(address) func (_QuoterV2 *QuoterV2Session) WETH() (common.Address, error) { return _QuoterV2.Contract.WETH(&_QuoterV2.CallOpts) } // WETH is a free data retrieval call binding the contract method 0xad5c4648. // // Solidity: function WETH() view returns(address) func (_QuoterV2 *QuoterV2CallerSession) WETH() (common.Address, error) { return _QuoterV2.Contract.WETH(&_QuoterV2.CallOpts) } // Factory is a free data retrieval call binding the contract method 0xc45a0155. // // Solidity: function factory() view returns(address) func (_QuoterV2 *QuoterV2Caller) Factory(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _QuoterV2.contract.Call(opts, &out, "factory") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // Factory is a free data retrieval call binding the contract method 0xc45a0155. // // Solidity: function factory() view returns(address) func (_QuoterV2 *QuoterV2Session) Factory() (common.Address, error) { return _QuoterV2.Contract.Factory(&_QuoterV2.CallOpts) } // Factory is a free data retrieval call binding the contract method 0xc45a0155. // // Solidity: function factory() view returns(address) func (_QuoterV2 *QuoterV2CallerSession) Factory() (common.Address, error) { return _QuoterV2.Contract.Factory(&_QuoterV2.CallOpts) } // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. // // Solidity: function owner() view returns(address) func (_QuoterV2 *QuoterV2Caller) Owner(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _QuoterV2.contract.Call(opts, &out, "owner") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. // // Solidity: function owner() view returns(address) func (_QuoterV2 *QuoterV2Session) Owner() (common.Address, error) { return _QuoterV2.Contract.Owner(&_QuoterV2.CallOpts) } // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. // // Solidity: function owner() view returns(address) func (_QuoterV2 *QuoterV2CallerSession) Owner() (common.Address, error) { return _QuoterV2.Contract.Owner(&_QuoterV2.CallOpts) } // UniswapV3SwapCallback is a free data retrieval call binding the contract method 0xfa461e33. // // Solidity: function uniswapV3SwapCallback(int256 amount0Delta, int256 amount1Delta, bytes path) view returns() func (_QuoterV2 *QuoterV2Caller) UniswapV3SwapCallback(opts *bind.CallOpts, amount0Delta *big.Int, amount1Delta *big.Int, path []byte) error { var out []interface{} err := _QuoterV2.contract.Call(opts, &out, "uniswapV3SwapCallback", amount0Delta, amount1Delta, path) if err != nil { return err } return err } // UniswapV3SwapCallback is a free data retrieval call binding the contract method 0xfa461e33. // // Solidity: function uniswapV3SwapCallback(int256 amount0Delta, int256 amount1Delta, bytes path) view returns() func (_QuoterV2 *QuoterV2Session) UniswapV3SwapCallback(amount0Delta *big.Int, amount1Delta *big.Int, path []byte) error { return _QuoterV2.Contract.UniswapV3SwapCallback(&_QuoterV2.CallOpts, amount0Delta, amount1Delta, path) } // UniswapV3SwapCallback is a free data retrieval call binding the contract method 0xfa461e33. // // Solidity: function uniswapV3SwapCallback(int256 amount0Delta, int256 amount1Delta, bytes path) view returns() func (_QuoterV2 *QuoterV2CallerSession) UniswapV3SwapCallback(amount0Delta *big.Int, amount1Delta *big.Int, path []byte) error { return _QuoterV2.Contract.UniswapV3SwapCallback(&_QuoterV2.CallOpts, amount0Delta, amount1Delta, path) } // Initialize is a paid mutator transaction binding the contract method 0x485cc955. // // Solidity: function initialize(address _factory, address _WETH) returns() func (_QuoterV2 *QuoterV2Transactor) Initialize(opts *bind.TransactOpts, _factory common.Address, _WETH common.Address) (*types.Transaction, error) { return _QuoterV2.contract.Transact(opts, "initialize", _factory, _WETH) } // Initialize is a paid mutator transaction binding the contract method 0x485cc955. // // Solidity: function initialize(address _factory, address _WETH) returns() func (_QuoterV2 *QuoterV2Session) Initialize(_factory common.Address, _WETH common.Address) (*types.Transaction, error) { return _QuoterV2.Contract.Initialize(&_QuoterV2.TransactOpts, _factory, _WETH) } // Initialize is a paid mutator transaction binding the contract method 0x485cc955. // // Solidity: function initialize(address _factory, address _WETH) returns() func (_QuoterV2 *QuoterV2TransactorSession) Initialize(_factory common.Address, _WETH common.Address) (*types.Transaction, error) { return _QuoterV2.Contract.Initialize(&_QuoterV2.TransactOpts, _factory, _WETH) } // QuoteExactInput is a paid mutator transaction binding the contract method 0xcdca1753. // // Solidity: function quoteExactInput(bytes path, uint256 amountIn) returns(uint256 amountOut, uint160[] sqrtPriceX96AfterList, uint32[] initializedTicksCrossedList, uint256 gasEstimate) func (_QuoterV2 *QuoterV2Transactor) QuoteExactInput(opts *bind.TransactOpts, path []byte, amountIn *big.Int) (*types.Transaction, error) { return _QuoterV2.contract.Transact(opts, "quoteExactInput", path, amountIn) } // QuoteExactInput is a paid mutator transaction binding the contract method 0xcdca1753. // // Solidity: function quoteExactInput(bytes path, uint256 amountIn) returns(uint256 amountOut, uint160[] sqrtPriceX96AfterList, uint32[] initializedTicksCrossedList, uint256 gasEstimate) func (_QuoterV2 *QuoterV2Session) QuoteExactInput(path []byte, amountIn *big.Int) (*types.Transaction, error) { return _QuoterV2.Contract.QuoteExactInput(&_QuoterV2.TransactOpts, path, amountIn) } // QuoteExactInput is a paid mutator transaction binding the contract method 0xcdca1753. // // Solidity: function quoteExactInput(bytes path, uint256 amountIn) returns(uint256 amountOut, uint160[] sqrtPriceX96AfterList, uint32[] initializedTicksCrossedList, uint256 gasEstimate) func (_QuoterV2 *QuoterV2TransactorSession) QuoteExactInput(path []byte, amountIn *big.Int) (*types.Transaction, error) { return _QuoterV2.Contract.QuoteExactInput(&_QuoterV2.TransactOpts, path, amountIn) } // QuoteExactInputSingle is a paid mutator transaction binding the contract method 0xc6a5026a. // // Solidity: function quoteExactInputSingle((address,address,uint256,uint24,uint160) params) returns(uint256 amountOut, uint160 sqrtPriceX96After, uint32 initializedTicksCrossed, uint256 gasEstimate) func (_QuoterV2 *QuoterV2Transactor) QuoteExactInputSingle(opts *bind.TransactOpts, params IQuoterV2QuoteExactInputSingleParams) (*types.Transaction, error) { return _QuoterV2.contract.Transact(opts, "quoteExactInputSingle", params) } // QuoteExactInputSingle is a paid mutator transaction binding the contract method 0xc6a5026a. // // Solidity: function quoteExactInputSingle((address,address,uint256,uint24,uint160) params) returns(uint256 amountOut, uint160 sqrtPriceX96After, uint32 initializedTicksCrossed, uint256 gasEstimate) func (_QuoterV2 *QuoterV2Session) QuoteExactInputSingle(params IQuoterV2QuoteExactInputSingleParams) (*types.Transaction, error) { return _QuoterV2.Contract.QuoteExactInputSingle(&_QuoterV2.TransactOpts, params) } // QuoteExactInputSingle is a paid mutator transaction binding the contract method 0xc6a5026a. // // Solidity: function quoteExactInputSingle((address,address,uint256,uint24,uint160) params) returns(uint256 amountOut, uint160 sqrtPriceX96After, uint32 initializedTicksCrossed, uint256 gasEstimate) func (_QuoterV2 *QuoterV2TransactorSession) QuoteExactInputSingle(params IQuoterV2QuoteExactInputSingleParams) (*types.Transaction, error) { return _QuoterV2.Contract.QuoteExactInputSingle(&_QuoterV2.TransactOpts, params) } // QuoteExactOutput is a paid mutator transaction binding the contract method 0x2f80bb1d. // // Solidity: function quoteExactOutput(bytes path, uint256 amountOut) returns(uint256 amountIn, uint160[] sqrtPriceX96AfterList, uint32[] initializedTicksCrossedList, uint256 gasEstimate) func (_QuoterV2 *QuoterV2Transactor) QuoteExactOutput(opts *bind.TransactOpts, path []byte, amountOut *big.Int) (*types.Transaction, error) { return _QuoterV2.contract.Transact(opts, "quoteExactOutput", path, amountOut) } // QuoteExactOutput is a paid mutator transaction binding the contract method 0x2f80bb1d. // // Solidity: function quoteExactOutput(bytes path, uint256 amountOut) returns(uint256 amountIn, uint160[] sqrtPriceX96AfterList, uint32[] initializedTicksCrossedList, uint256 gasEstimate) func (_QuoterV2 *QuoterV2Session) QuoteExactOutput(path []byte, amountOut *big.Int) (*types.Transaction, error) { return _QuoterV2.Contract.QuoteExactOutput(&_QuoterV2.TransactOpts, path, amountOut) } // QuoteExactOutput is a paid mutator transaction binding the contract method 0x2f80bb1d. // // Solidity: function quoteExactOutput(bytes path, uint256 amountOut) returns(uint256 amountIn, uint160[] sqrtPriceX96AfterList, uint32[] initializedTicksCrossedList, uint256 gasEstimate) func (_QuoterV2 *QuoterV2TransactorSession) QuoteExactOutput(path []byte, amountOut *big.Int) (*types.Transaction, error) { return _QuoterV2.Contract.QuoteExactOutput(&_QuoterV2.TransactOpts, path, amountOut) } // QuoteExactOutputSingle is a paid mutator transaction binding the contract method 0xbd21704a. // // Solidity: function quoteExactOutputSingle((address,address,uint256,uint24,uint160) params) returns(uint256 amountIn, uint160 sqrtPriceX96After, uint32 initializedTicksCrossed, uint256 gasEstimate) func (_QuoterV2 *QuoterV2Transactor) QuoteExactOutputSingle(opts *bind.TransactOpts, params IQuoterV2QuoteExactOutputSingleParams) (*types.Transaction, error) { return _QuoterV2.contract.Transact(opts, "quoteExactOutputSingle", params) } // QuoteExactOutputSingle is a paid mutator transaction binding the contract method 0xbd21704a. // // Solidity: function quoteExactOutputSingle((address,address,uint256,uint24,uint160) params) returns(uint256 amountIn, uint160 sqrtPriceX96After, uint32 initializedTicksCrossed, uint256 gasEstimate) func (_QuoterV2 *QuoterV2Session) QuoteExactOutputSingle(params IQuoterV2QuoteExactOutputSingleParams) (*types.Transaction, error) { return _QuoterV2.Contract.QuoteExactOutputSingle(&_QuoterV2.TransactOpts, params) } // QuoteExactOutputSingle is a paid mutator transaction binding the contract method 0xbd21704a. // // Solidity: function quoteExactOutputSingle((address,address,uint256,uint24,uint160) params) returns(uint256 amountIn, uint160 sqrtPriceX96After, uint32 initializedTicksCrossed, uint256 gasEstimate) func (_QuoterV2 *QuoterV2TransactorSession) QuoteExactOutputSingle(params IQuoterV2QuoteExactOutputSingleParams) (*types.Transaction, error) { return _QuoterV2.Contract.QuoteExactOutputSingle(&_QuoterV2.TransactOpts, params) } // RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. // // Solidity: function renounceOwnership() returns() func (_QuoterV2 *QuoterV2Transactor) RenounceOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { return _QuoterV2.contract.Transact(opts, "renounceOwnership") } // RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. // // Solidity: function renounceOwnership() returns() func (_QuoterV2 *QuoterV2Session) RenounceOwnership() (*types.Transaction, error) { return _QuoterV2.Contract.RenounceOwnership(&_QuoterV2.TransactOpts) } // RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. // // Solidity: function renounceOwnership() returns() func (_QuoterV2 *QuoterV2TransactorSession) RenounceOwnership() (*types.Transaction, error) { return _QuoterV2.Contract.RenounceOwnership(&_QuoterV2.TransactOpts) } // SetWETH is a paid mutator transaction binding the contract method 0x5b769f3c. // // Solidity: function setWETH(address WETHArg) returns() func (_QuoterV2 *QuoterV2Transactor) SetWETH(opts *bind.TransactOpts, WETHArg common.Address) (*types.Transaction, error) { return _QuoterV2.contract.Transact(opts, "setWETH", WETHArg) } // SetWETH is a paid mutator transaction binding the contract method 0x5b769f3c. // // Solidity: function setWETH(address WETHArg) returns() func (_QuoterV2 *QuoterV2Session) SetWETH(WETHArg common.Address) (*types.Transaction, error) { return _QuoterV2.Contract.SetWETH(&_QuoterV2.TransactOpts, WETHArg) } // SetWETH is a paid mutator transaction binding the contract method 0x5b769f3c. // // Solidity: function setWETH(address WETHArg) returns() func (_QuoterV2 *QuoterV2TransactorSession) SetWETH(WETHArg common.Address) (*types.Transaction, error) { return _QuoterV2.Contract.SetWETH(&_QuoterV2.TransactOpts, WETHArg) } // TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. // // Solidity: function transferOwnership(address newOwner) returns() func (_QuoterV2 *QuoterV2Transactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) { return _QuoterV2.contract.Transact(opts, "transferOwnership", newOwner) } // TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. // // Solidity: function transferOwnership(address newOwner) returns() func (_QuoterV2 *QuoterV2Session) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { return _QuoterV2.Contract.TransferOwnership(&_QuoterV2.TransactOpts, newOwner) } // TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. // // Solidity: function transferOwnership(address newOwner) returns() func (_QuoterV2 *QuoterV2TransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { return _QuoterV2.Contract.TransferOwnership(&_QuoterV2.TransactOpts, newOwner) } // QuoterV2InitializedIterator is returned from FilterInitialized and is used to iterate over the raw logs and unpacked data for Initialized events raised by the QuoterV2 contract. type QuoterV2InitializedIterator struct { Event *QuoterV2Initialized // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *QuoterV2InitializedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(QuoterV2Initialized) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(QuoterV2Initialized) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *QuoterV2InitializedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *QuoterV2InitializedIterator) Close() error { it.sub.Unsubscribe() return nil } // QuoterV2Initialized represents a Initialized event raised by the QuoterV2 contract. type QuoterV2Initialized struct { Version uint8 Raw types.Log // Blockchain specific contextual infos } // FilterInitialized is a free log retrieval operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. // // Solidity: event Initialized(uint8 version) func (_QuoterV2 *QuoterV2Filterer) FilterInitialized(opts *bind.FilterOpts) (*QuoterV2InitializedIterator, error) { logs, sub, err := _QuoterV2.contract.FilterLogs(opts, "Initialized") if err != nil { return nil, err } return &QuoterV2InitializedIterator{contract: _QuoterV2.contract, event: "Initialized", logs: logs, sub: sub}, nil } // WatchInitialized is a free log subscription operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. // // Solidity: event Initialized(uint8 version) func (_QuoterV2 *QuoterV2Filterer) WatchInitialized(opts *bind.WatchOpts, sink chan<- *QuoterV2Initialized) (event.Subscription, error) { logs, sub, err := _QuoterV2.contract.WatchLogs(opts, "Initialized") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(QuoterV2Initialized) if err := _QuoterV2.contract.UnpackLog(event, "Initialized", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseInitialized is a log parse operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. // // Solidity: event Initialized(uint8 version) func (_QuoterV2 *QuoterV2Filterer) ParseInitialized(log types.Log) (*QuoterV2Initialized, error) { event := new(QuoterV2Initialized) if err := _QuoterV2.contract.UnpackLog(event, "Initialized", log); err != nil { return nil, err } event.Raw = log return event, nil } // QuoterV2OwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the QuoterV2 contract. type QuoterV2OwnershipTransferredIterator struct { Event *QuoterV2OwnershipTransferred // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *QuoterV2OwnershipTransferredIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(QuoterV2OwnershipTransferred) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(QuoterV2OwnershipTransferred) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *QuoterV2OwnershipTransferredIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *QuoterV2OwnershipTransferredIterator) Close() error { it.sub.Unsubscribe() return nil } // QuoterV2OwnershipTransferred represents a OwnershipTransferred event raised by the QuoterV2 contract. type QuoterV2OwnershipTransferred struct { PreviousOwner common.Address NewOwner common.Address Raw types.Log // Blockchain specific contextual infos } // FilterOwnershipTransferred is a free log retrieval operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. // // Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) func (_QuoterV2 *QuoterV2Filterer) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*QuoterV2OwnershipTransferredIterator, error) { var previousOwnerRule []interface{} for _, previousOwnerItem := range previousOwner { previousOwnerRule = append(previousOwnerRule, previousOwnerItem) } var newOwnerRule []interface{} for _, newOwnerItem := range newOwner { newOwnerRule = append(newOwnerRule, newOwnerItem) } logs, sub, err := _QuoterV2.contract.FilterLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) if err != nil { return nil, err } return &QuoterV2OwnershipTransferredIterator{contract: _QuoterV2.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil } // WatchOwnershipTransferred is a free log subscription operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. // // Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) func (_QuoterV2 *QuoterV2Filterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *QuoterV2OwnershipTransferred, previousOwner []common.Address, newOwner []common.Address) (event.Subscription, error) { var previousOwnerRule []interface{} for _, previousOwnerItem := range previousOwner { previousOwnerRule = append(previousOwnerRule, previousOwnerItem) } var newOwnerRule []interface{} for _, newOwnerItem := range newOwner { newOwnerRule = append(newOwnerRule, newOwnerItem) } logs, sub, err := _QuoterV2.contract.WatchLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(QuoterV2OwnershipTransferred) if err := _QuoterV2.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseOwnershipTransferred is a log parse operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. // // Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) func (_QuoterV2 *QuoterV2Filterer) ParseOwnershipTransferred(log types.Log) (*QuoterV2OwnershipTransferred, error) { event := new(QuoterV2OwnershipTransferred) if err := _QuoterV2.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { return nil, err } event.Raw = log return event, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/binds/memequoter/extras.go ================================================ package memequoter import ( "math/big" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi/bind" ) func (_QuoterV2 *QuoterV2Transactor) QuoteExactInputSingleCall(opts *bind.CallOpts, params IQuoterV2QuoteExactInputSingleParams) (*big.Int, *big.Int, uint32, uint32, error) { var out []interface{} err := _QuoterV2.contract.Call(opts, &out, "quoteExactInputSingle", params) if err != nil { return new(big.Int), new(big.Int), 0, 0, err } amountOut := *abi.ConvertType(out[0], new(big.Int)).(*big.Int) sqrtPriceX96After := *abi.ConvertType(out[1], new(big.Int)).(*big.Int) initializedTicksCrossed := *abi.ConvertType(out[2], new(uint32)).(*uint32) gasEstimate := *abi.ConvertType(out[2], new(uint32)).(*uint32) return &amountOut, &sqrtPriceX96After, initializedTicksCrossed, gasEstimate, err } func (_QuoterV2 *QuoterV2Transactor) QuoteExactOutputSingleCall(opts *bind.CallOpts, params IQuoterV2QuoteExactOutputSingleParams) (*big.Int, *big.Int, uint32, uint32, error) { var out []interface{} err := _QuoterV2.contract.Call(opts, &out, "quoteExactOutputSingle", params) if err != nil { return new(big.Int), new(big.Int), 0, 0, err } amountIn := *abi.ConvertType(out[0], new(big.Int)).(*big.Int) sqrtPriceX96After := *abi.ConvertType(out[1], new(big.Int)).(*big.Int) initializedTicksCrossed := *abi.ConvertType(out[2], new(uint32)).(*uint32) gasEstimate := *abi.ConvertType(out[2], new(uint32)).(*uint32) return &amountIn, &sqrtPriceX96After, initializedTicksCrossed, gasEstimate, err } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/binds/memeswaprouter/SwapRouter.go ================================================ // Code generated - DO NOT EDIT. // This file is a generated binding and any manual changes will be lost. package memeswaprouter import ( "errors" "math/big" "strings" ethereum "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/event" ) // Reference imports to suppress errors if they are not otherwise used. var ( _ = errors.New _ = big.NewInt _ = strings.NewReader _ = ethereum.NotFound _ = bind.Bind _ = common.Big1 _ = types.BloomLookup _ = event.NewSubscription _ = abi.ConvertType ) // ISwapRouterExactInputParams is an auto generated low-level Go binding around an user-defined struct. type ISwapRouterExactInputParams struct { Path []byte Recipient common.Address Deadline *big.Int AmountIn *big.Int AmountOutMinimum *big.Int } // ISwapRouterExactInputSingleParams is an auto generated low-level Go binding around an user-defined struct. type ISwapRouterExactInputSingleParams struct { TokenIn common.Address TokenOut common.Address Fee *big.Int Recipient common.Address Deadline *big.Int AmountIn *big.Int AmountOutMinimum *big.Int SqrtPriceLimitX96 *big.Int } // ISwapRouterExactOutputParams is an auto generated low-level Go binding around an user-defined struct. type ISwapRouterExactOutputParams struct { Path []byte Recipient common.Address Deadline *big.Int AmountOut *big.Int AmountInMaximum *big.Int } // ISwapRouterExactOutputSingleParams is an auto generated low-level Go binding around an user-defined struct. type ISwapRouterExactOutputSingleParams struct { TokenIn common.Address TokenOut common.Address Fee *big.Int Recipient common.Address Deadline *big.Int AmountOut *big.Int AmountInMaximum *big.Int SqrtPriceLimitX96 *big.Int } // SwapRouterMetaData contains all meta data concerning the SwapRouter contract. var SwapRouterMetaData = &bind.MetaData{ ABI: "[{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"WETH\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes\",\"name\":\"path\",\"type\":\"bytes\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountIn\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountOutMinimum\",\"type\":\"uint256\"}],\"internalType\":\"structISwapRouter.ExactInputParams\",\"name\":\"params\",\"type\":\"tuple\"}],\"name\":\"exactInput\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amountOut\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"tokenIn\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenOut\",\"type\":\"address\"},{\"internalType\":\"uint24\",\"name\":\"fee\",\"type\":\"uint24\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountIn\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountOutMinimum\",\"type\":\"uint256\"},{\"internalType\":\"uint160\",\"name\":\"sqrtPriceLimitX96\",\"type\":\"uint160\"}],\"internalType\":\"structISwapRouter.ExactInputSingleParams\",\"name\":\"params\",\"type\":\"tuple\"}],\"name\":\"exactInputSingle\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amountOut\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes\",\"name\":\"path\",\"type\":\"bytes\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountOut\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountInMaximum\",\"type\":\"uint256\"}],\"internalType\":\"structISwapRouter.ExactOutputParams\",\"name\":\"params\",\"type\":\"tuple\"}],\"name\":\"exactOutput\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amountIn\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"tokenIn\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenOut\",\"type\":\"address\"},{\"internalType\":\"uint24\",\"name\":\"fee\",\"type\":\"uint24\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountOut\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountInMaximum\",\"type\":\"uint256\"},{\"internalType\":\"uint160\",\"name\":\"sqrtPriceLimitX96\",\"type\":\"uint160\"}],\"internalType\":\"structISwapRouter.ExactOutputSingleParams\",\"name\":\"params\",\"type\":\"tuple\"}],\"name\":\"exactOutputSingle\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amountIn\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"factory\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_factory\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_WETH\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes[]\",\"name\":\"data\",\"type\":\"bytes[]\"}],\"name\":\"multicall\",\"outputs\":[{\"internalType\":\"bytes[]\",\"name\":\"results\",\"type\":\"bytes[]\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"refundETH\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"selfPermit\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiry\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"selfPermitAllowed\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiry\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"selfPermitAllowedIfNecessary\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"selfPermitIfNecessary\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"WETHArg\",\"type\":\"address\"}],\"name\":\"setWETH\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amountMinimum\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"}],\"name\":\"sweepToken\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amountMinimum\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"feeBips\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"feeRecipient\",\"type\":\"address\"}],\"name\":\"sweepTokenWithFee\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"int256\",\"name\":\"amount0Delta\",\"type\":\"int256\"},{\"internalType\":\"int256\",\"name\":\"amount1Delta\",\"type\":\"int256\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"uniswapV3SwapCallback\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountMinimum\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"}],\"name\":\"unwrapWETH\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountMinimum\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"feeBips\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"feeRecipient\",\"type\":\"address\"}],\"name\":\"unwrapWETHWithFee\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]", Bin: "0x6080806040523461001c576000196067556124a990816100228239f35b600080fdfe60806040526004361015610023575b361561001957600080fd5b610021611bc0565b005b60003560e01c806312210e8a146101835780632135ac891461017e578063414bf389146101795780634659a49414610174578063485cc9551461016f5780635b769f3c1461016a578063715018a6146101655780638da5cb5b14610160578063a4a78f0c1461015b578063ac9650d814610156578063ad5c464814610151578063c04b8d591461014c578063c2e3140a14610147578063c45a015514610142578063db3e21981461013d578063df2ab5bb14610138578063e0e189a014610133578063e16d9ce51461012e578063f28c049814610129578063f2fde38b14610124578063f3995c671461011f5763fa461e330361000e57610f86565b610f6e565b610edd565b610e2b565b610d46565b610c57565b610bbf565b610b14565b610aeb565b610a72565b6109e0565b610898565b610792565b61066d565b610644565b6105e3565b61059c565b6104a3565b61048b565b610349565b6101c6565b610198565b600091031261019357565b600080fd5b600036600319011261019357476101ab57005b610021473361240d565b6001600160a01b0381160361019357565b6080366003190112610193576024356101de816101b5565b606435906044356101ee836101b5565b8015158061032c575b610200906111d1565b60665461022390610217906001600160a01b031681565b6001600160a01b031690565b6040516370a0823160e01b8152306004820152909390602081602481885afa9081156102f9576000916102fe575b50610260600435821015611c13565b8061026757005b843b1561019357604051632e1a7d4d60e01b815260048101829052946000908690602490829084905af19485156102f9576102b36102ca946102bb92610021986102e0575b5083611dfd565b612710900490565b9182806102d0575b5050611df0565b9061240d565b6102d99161240d565b38826102c3565b806102ed6102f3926108d7565b80610188565b386102ac565b611362565b61031f915060203d8111610325575b6103178183610940565b810190611c04565b38610251565b503d61030d565b5060648111156101f7565b61010090600319011261019357600490565b6101003660031901126101935761044e61036236610337565b6103726080820135421115611239565b61043e60c06104336060840135610388816101b5565b60e0850135610396816101b5565b8535916103a2836101b5565b6104146103b16040890161127b565b9361040660208a01356103c3816101b5565b604051968793602085019192602b936bffffffffffffffffffffffff19809360601b16845262ffffff60e81b9060e81b16601484015260601b1660178201520190565b03601f198101855284610940565b60405192610421846108ef565b835233602084015260a08701356114a3565b92013582101561128b565b6040519081529081906020820190565b0390f35b60c09060031901126101935760043561046a816101b5565b90602435906044359060643560ff8116810361019357906084359060a43590565b61002161049736610452565b94939093929192611ec2565b34610193576040366003190112610193576004356104c0816101b5565b6105106024356104cf816101b5565b600054926104f460ff8560081c16158095819661058e575b811561056e575b5061116e565b83610507600160ff196000541617600055565b61055557611a76565b61051657005b61052661ff001960005416600055565b604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb384740249890602090a1005b61056961010061ff00196000541617600055565b611a76565b303b15915081610580575b50386104ee565b6001915060ff161438610579565b600160ff82161091506104e7565b34610193576020366003190112610193576004356105b9816101b5565b6105c16110cd565b606680546001600160a01b0319166001600160a01b0392909216919091179055005b3461019357600080600319360112610641576105fd6110cd565b603380546001600160a01b0319811690915581906001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b80fd5b34610193576000366003190112610193576033546040516001600160a01b039091168152602090f35b61067636610452565b604051636eb1769f60e11b81523360048201523060248201529094919391906020816044816001600160a01b038b165afa9081156102f9576000916106ca575b50600019116106c157005b61002195611ec2565b6106e2915060203d8111610325576103178183610940565b386106b6565b60005b8381106106fb5750506000910152565b81810151838201526020016106eb565b90602091610724815180928185528580860191016106e8565b601f01601f1916010190565b602080820190808352835180925260408301928160408460051b8301019501936000915b8483106107645750505050505090565b9091929394958480610782600193603f198682030187528a5161070b565b9801930193019194939290610754565b602036600319011261019357600480356001600160401b03918282116101935736602383011215610193578181013592831161019357602490818301928236918660051b010111610193576107e684611926565b9360005b8181106107ff576040518061044e8882610730565b60008061080d838589611995565b6040939161081f8551809381936119b5565b0390305af49061082d6119c3565b9182901561085c57505090610857916108468289611a62565b526108518188611a62565b50611970565b6107ea565b8683879260448251106101935782610894938561087f94015183010191016119f3565b925162461bcd60e51b81529283928301611a51565b0390fd5b34610193576000366003190112610193576066546040516001600160a01b039091168152602090f35b634e487b7160e01b600052604160045260246000fd5b6001600160401b0381116108ea57604052565b6108c1565b604081019081106001600160401b038211176108ea57604052565b60a081019081106001600160401b038211176108ea57604052565b606081019081106001600160401b038211176108ea57604052565b90601f801991011681019081106001600160401b038211176108ea57604052565b6040519061096e826108ef565b565b6001600160401b0381116108ea57601f01601f191660200190565b92919261099782610970565b916109a56040519384610940565b829481845281830111610193578281602093846000960137010152565b9080601f83011215610193578160206109dd9335910161098b565b90565b600319602036820112610193576004356001600160401b03918282116101935760a090823603011261019357604051610a188161090a565b816004013592831161019357608461043e92610a3d61044e95600436918401016109c2565b83526024810135610a4d816101b5565b602084015260448101356040840152606481013560608401520135608082015261158e565b610a7b36610452565b604051636eb1769f60e11b81523360048201523060248201529094919391906020816044816001600160a01b038b165afa80156102f9578291600091610acd575b5010610ac457005b61002195611e4c565b610ae5915060203d8111610325576103178183610940565b38610abc565b34610193576000366003190112610193576065546040516001600160a01b039091168152602090f35b6101003660031901126101935761044e610b2d36610337565b610b3d6080820135421115611239565b610bb460c0610ba96060840135610b53816101b5565b60e0850135610b61816101b5565b602086013591610b70836101b5565b610b8e610b7f6040890161127b565b9361040689356103c3816101b5565b610b96610961565b92835233602084015260a087013561175a565b92013582111561189c565b60001960675561043e565b606036600319011261019357600435610bd7816101b5565b604435610be3816101b5565b6040516370a0823160e01b8152306004820152906020826024816001600160a01b0387165afa9182156102f957600092610c37575b50610c27602435831015611c53565b81610c2e57005b6100219261235b565b610c5091925060203d8111610325576103178183610940565b9038610c18565b60a036600319011261019357600435610c6f816101b5565b60443590610c7c826101b5565b60843591606435610c8c846101b5565b80151580610d3b575b610c9e906111d1565b6040516370a0823160e01b8152306004820152936020856024816001600160a01b0388165afa9485156102f957600095610d1b575b50610ce2602435861015611c53565b84610ce957005b84610cfd6102b3610d0b9461002198611dfd565b918280610d11575050611df0565b9161235b565b6102d9918761235b565b610d3491955060203d8111610325576103178183610940565b9338610cd3565b506064811115610c95565b604036600319011261019357602435610d5e816101b5565b606654610d7590610217906001600160a01b031681565b6040516370a0823160e01b81523060048201529091602082602481865afa9182156102f957600092610e0b575b50610db1600435831015611c13565b81610db857005b823b1561019357604051632e1a7d4d60e01b815260048101839052926000908490602490829084905af19283156102f95761002193610df8575b5061240d565b806102ed610e05926108d7565b38610df2565b610e2491925060203d8111610325576103178183610940565b9038610da2565b600319602036820112610193576004356001600160401b0381116101935760a08160040192823603011261019357610eb3610ea161044e93610e736044850135421115611239565b610e8b602485013591610e85836101b5565b806118dd565b929060405193610e9a856108ef565b369161098b565b82523360208301526064840135611638565b50610ec7608460675492013582111561189c565b6000196067556040519081529081906020820190565b3461019357602036600319011261019357600435610efa816101b5565b610f026110cd565b6001600160a01b03811615610f1a5761002190611125565b60405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608490fd5b610021610f7a36610452565b94939093929192611e4c565b34610193576060366003190112610193576044356024356004356001600160401b038084116101935736602385011215610193578360040135908111610193578301602401923684116101935761101f610ff96000956024878613948580156110c4575b610ff3906111d1565b016111d8565b936110048551611f73565b606554929591949192859087906001600160a01b0316611f33565b50156110ae57506001600160a01b03818116908316105b1561105c57506020929092015161105992906001600160a01b03165b3391611cac565b80f35b905061106c835160429051101590565b1561108e57509061108a9161108182516120fa565b82523390611638565b5080f35b6110526020611059946110a085606755565b01516001600160a01b031690565b92506001600160a01b0382811690821610611036565b50888813610fea565b6033546001600160a01b031633036110e157565b606460405162461bcd60e51b815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b603380546001600160a01b039283166001600160a01b0319821681179092559091167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a3565b1561117557565b60405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608490fd5b1561019357565b906020828203126101935781356001600160401b03928382116101935701604081830312610193576040519261120d846108ef565b8135908111610193576020926112249183016109c2565b83520135611231816101b5565b602082015290565b1561124057565b60405162461bcd60e51b8152602060048201526013602482015272151c985b9cd858dd1a5bdb881d1bdbc81bdb19606a1b6044820152606490fd5b3562ffffff811681036101935790565b1561129257565b60405162461bcd60e51b8152602060048201526013602482015272151bdbc81b1a5d1d1b19481c9958d95a5d9959606a1b6044820152606490fd5b634e487b7160e01b600052601160045260246000fd5b6020815260406112fe8351826020850152606084019061070b565b6020909301516001600160a01b031691015290565b9190826040910312610193576020825192015190565b6001600160a01b039182168152911515602083015260408201929092529116606082015260a0608082018190526109dd9291019061070b565b6040513d6000823e3d90fd5b600160ff1b811461137f5760000390565b6112cd565b61021792916040916001600160a01b038083161561149b575b60006113c86113c26113af8851611f73565b909a9195808c16908716109a8b96611566565b93611557565b93828214611477576114196113ef6113fd6401000276a4995b8951928391602083016112e3565b03601f198101835282610940565b8751630251596160e31b81529889978896879560048701611329565b03925af19081156102f9576109dd926000918293611445575b501561143e575061136e565b905061136e565b909250611469915060403d8111611470575b6114618183610940565b810190611313565b9138611432565b503d611457565b6114196113ef6113fd73fffd8963efd1fc6a506488495d951d5263988d25996113e1565b30925061139d565b6114e593926040926001600160a01b039291610217916000918582161561154f575b6114eb6114d28951611f73565b89829d939892168a8916109c8d98611566565b95611557565b95811615831461153f575082821461151c576114196113ef6113fd6401000276a45b998951928391602083016112e3565b6114196113ef6113fd73fffd8963efd1fc6a506488495d951d5263988d2561150d565b6113ef6113fd61141992996113e1565b3091506114c5565b600160ff1b8110156101935790565b6065546001600160a01b039361158a939185169261158492906121a6565b90612217565b1690565b61159e6040820151421115611239565b6000335b8251906115ec60428351101591606086019384518460001461161c576115e76115cb3093612032565b936115d4610961565b9485526001600160a01b03166020850152565b611384565b80925260001461160957503061160283516120fa565b83526115a2565b6109dd915060809092015182101561128b565b60208801516115e7906115cb906001600160a01b031693612032565b919291906001600160a01b039081811615611753575b6040906116716102176116618851611f73565b9190968082169088161096611566565b83600061168561168088611557565b61136e565b9382821461172f576116c76113ef6116ab6401000276a49c8951928391602083016112e3565b8751630251596160e31b81529b8c978896879560048701611329565b03925af19081156102f957600094859261170c575b50156116f857906116ef61096e9261136e565b935b93146111d1565b929061170661096e9261136e565b936116f1565b909450611727915060403d8111611470576114618183610940565b9093386116dc565b6116c76113ef6116ab73fffd8963efd1fc6a506488495d951d5263988d259c6113e1565b503061164e565b919392919061179a906040906001600160a01b039081811615611895575b61021760006117878851611f73565b8287168288161098899590939092611566565b926117a761168089611557565b948b16159a8b83146118855750828214611862576117f66113ef6117da6401000276a45b9b8951928391602083016112e3565b8751630251596160e31b81529a8b978896879560048701611329565b03925af19081156102f957600093849261183f575b501561182f5761181a9061136e565b915b93611825575050565b61096e91146111d1565b916118399061136e565b9161181c565b90935061185a915060403d8111611470576114618183610940565b90923861180b565b6117f66113ef6117da73fffd8963efd1fc6a506488495d951d5263988d256117cb565b6113ef6117da6117f6929b6113e1565b5030611778565b156118a357565b60405162461bcd60e51b8152602060048201526012602482015271151bdbc81b5d58da081c995c5d595cdd195960721b6044820152606490fd5b903590601e198136030182121561019357018035906001600160401b0382116101935760200191813603831361019357565b6001600160401b0381116108ea5760051b60200190565b906119308261190f565b61193d6040519182610940565b828152809261194e601f199161190f565b019060005b82811061195f57505050565b806060602080938501015201611953565b600019811461137f5760010190565b634e487b7160e01b600052603260045260246000fd5b908210156119b0576119ac9160051b8101906118dd565b9091565b61197f565b908092918237016000815290565b3d156119ee573d906119d482610970565b916119e26040519384610940565b82523d6000602084013e565b606090565b602081830312610193578051906001600160401b038211610193570181601f82011215610193578051611a2581610970565b92611a336040519485610940565b81845260208284010111610193576109dd91602080850191016106e8565b9060206109dd92818152019061070b565b80518210156119b05760209160051b010190565b60005491611a9960ff8460081c16158094819561058e57811561056e575061116e565b82611aac600160ff196000541617600055565b611b47575b611acb60ff60005460081c16611ac681611b60565b611b60565b611ad433611125565b60018060a01b0390816bffffffffffffffffffffffff60a01b931683606554161760655516906066541617606655611b0857565b611b1861ff001960005416600055565b604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb384740249890602090a1565b611b5b61010061ff00196000541617600055565b611ab1565b15611b6757565b60405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608490fd5b6066546001600160a01b03163303611bd457565b60405162461bcd60e51b815260206004820152600860248201526709cdee840ae8aa8960c31b6044820152606490fd5b90816020910312610193575190565b15611c1a57565b60405162461bcd60e51b8152602060048201526011602482015270092dce6eaccccd2c6d2cadce840ae8aa89607b1b6044820152606490fd5b15611c5a57565b60405162461bcd60e51b815260206004820152601260248201527124b739bab33334b1b4b2b73a103a37b5b2b760711b6044820152606490fd5b90816020910312610193575180151581036101935790565b6066549093929190611cc6906001600160a01b0316610217565b6001600160a01b03908582161480611de6575b15611dcb57505060665491925090611cfb90610217906001600160a01b031681565b803b156101935760008391600460405180968193630d0e30db60e41b83525af19182156102f957611d7d93602093611db8575b50606654611d4690610217906001600160a01b031681565b60405163a9059cbb60e01b81526001600160a01b039092166004830152602482019290925292839190829060009082906044820190565b03925af180156102f957611d8e5750565b611dae9060203d8111611db1575b611da68183610940565b810190611c94565b50565b503d611d9c565b806102ed611dc5926108d7565b38611d2e565b81163003611ddd575061096e9261235b565b61096e936122a4565b5083471015611cd9565b9190820391821161137f57565b600092918115918215611e14575b50501561019357565b908092945081029081049081831485171561137f5793611e3657143880611e0b565b634e487b7160e01b600052601260045260246000fd5b92946001600160a01b0390931693919291843b156101935760009460e493869260ff604051998a98899763d505accf60e01b89523360048a01523060248a01526044890152606488015216608486015260a485015260c48401525af180156102f957611eb55750565b806102ed61096e926108d7565b92946001600160a01b0390931693919291843b156101935760009461010493869260ff604051998a9889976323f2ebc360e21b89523360048a01523060248a015260448901526064880152600160848801521660a486015260c485015260e48401525af180156102f957611eb55750565b6001600160a01b0393611f4c93919261158492906121a6565b168033036101935790565b90601f820180921161137f57565b601701908160171161137f57565b90611f82601483511015611fee565b602082015160601c916017815110611fb2576037601782015191611faa602b82511015611fee565b015160601c91565b60405162461bcd60e51b8152602060048201526014602482015273746f55696e7432345f6f75744f66426f756e647360601b6044820152606490fd5b15611ff557565b60405162461bcd60e51b8152602060048201526015602482015274746f416464726573735f6f75744f66426f756e647360581b6044820152606490fd5b612040602b825110156120ba565b60405190600b8083019101603683015b80831061206a575050602b8252601f01601f191660405290565b9091825181526020809101920190612050565b1561208457565b60405162461bcd60e51b815260206004820152600e60248201526d736c6963655f6f766572666c6f7760901b6044820152606490fd5b156120c157565b60405162461bcd60e51b8152602060048201526011602482015270736c6963655f6f75744f66426f756e647360781b6044820152606490fd5b8051601619918282019082821161137f5761211f8261211881611f57565b101561207d565b61212d601761211884611f65565b612142815161213b84611f65565b11156120ba565b8161215c5750505050604051600081526020810160405290565b601760405194601f8416801560051b9182828901019687010193010101905b8084106121935750508252601f01601f191660405290565b909283518152602080910193019061217b565b9162ffffff916000604080516121bb81610925565b8281526020810183905201526001600160a01b0390808216858316116121fc575b81604051956121ea87610925565b16855216602084015216604082015290565b936121dc565b9081602091031261019357516109dd816101b5565b8151602083015191926001600160a01b03928316918316828110156101935760209362ffffff6040606494015116956040519687958694630b4c774160e11b8652600486015260248501526044840152165afa9081156102f95760009161227c575090565b6109dd915060203d811161229d575b6122958183610940565b810190612202565b503d61228b565b9091600080949381946040519160208301946323b872dd60e01b865260018060a01b0380921660248501521660448301526064820152606481526122e78161090a565b51925af16122f36119c3565b8161232c575b501561230157565b60405162461bcd60e51b815260206004820152600360248201526229aa2360e91b6044820152606490fd5b8051801592508215612341575b5050386122f9565b6123549250602080918301019101611c94565b3880612339565b60405163a9059cbb60e01b602082019081526001600160a01b0390931660248201526044810193909352600092839290839061239a81606481016113ef565b51925af16123a66119c3565b816123de575b50156123b457565b60405162461bcd60e51b815260206004820152600260248201526114d560f21b6044820152606490fd5b80518015925082156123f3575b5050386123ac565b6124069250602080918301019101611c94565b38806123eb565b60405160208101908082106001600160401b038311176108ea576000938493848094938194604052525af16124406119c3565b501561244857565b60405162461bcd60e51b815260206004820152600360248201526253544560e81b6044820152606490fdfea2646970667358221220fedc74cc9a8b56d98385c190d3c76a16fe5e399e1979676f679dbb23e6fc875c64736f6c63430008130033", } // SwapRouterABI is the input ABI used to generate the binding from. // Deprecated: Use SwapRouterMetaData.ABI instead. var SwapRouterABI = SwapRouterMetaData.ABI // SwapRouterBin is the compiled bytecode used for deploying new contracts. // Deprecated: Use SwapRouterMetaData.Bin instead. var SwapRouterBin = SwapRouterMetaData.Bin // DeploySwapRouter deploys a new Ethereum contract, binding an instance of SwapRouter to it. func DeploySwapRouter(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *SwapRouter, error) { parsed, err := SwapRouterMetaData.GetAbi() if err != nil { return common.Address{}, nil, nil, err } if parsed == nil { return common.Address{}, nil, nil, errors.New("GetABI returned nil") } address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(SwapRouterBin), backend) if err != nil { return common.Address{}, nil, nil, err } return address, tx, &SwapRouter{SwapRouterCaller: SwapRouterCaller{contract: contract}, SwapRouterTransactor: SwapRouterTransactor{contract: contract}, SwapRouterFilterer: SwapRouterFilterer{contract: contract}}, nil } // SwapRouter is an auto generated Go binding around an Ethereum contract. type SwapRouter struct { SwapRouterCaller // Read-only binding to the contract SwapRouterTransactor // Write-only binding to the contract SwapRouterFilterer // Log filterer for contract events } // SwapRouterCaller is an auto generated read-only Go binding around an Ethereum contract. type SwapRouterCaller struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // SwapRouterTransactor is an auto generated write-only Go binding around an Ethereum contract. type SwapRouterTransactor struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // SwapRouterFilterer is an auto generated log filtering Go binding around an Ethereum contract events. type SwapRouterFilterer struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // SwapRouterSession is an auto generated Go binding around an Ethereum contract, // with pre-set call and transact options. type SwapRouterSession struct { Contract *SwapRouter // Generic contract binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // SwapRouterCallerSession is an auto generated read-only Go binding around an Ethereum contract, // with pre-set call options. type SwapRouterCallerSession struct { Contract *SwapRouterCaller // Generic contract caller binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session } // SwapRouterTransactorSession is an auto generated write-only Go binding around an Ethereum contract, // with pre-set transact options. type SwapRouterTransactorSession struct { Contract *SwapRouterTransactor // Generic contract transactor binding to set the session for TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // SwapRouterRaw is an auto generated low-level Go binding around an Ethereum contract. type SwapRouterRaw struct { Contract *SwapRouter // Generic contract binding to access the raw methods on } // SwapRouterCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. type SwapRouterCallerRaw struct { Contract *SwapRouterCaller // Generic read-only contract binding to access the raw methods on } // SwapRouterTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. type SwapRouterTransactorRaw struct { Contract *SwapRouterTransactor // Generic write-only contract binding to access the raw methods on } // NewSwapRouter creates a new instance of SwapRouter, bound to a specific deployed contract. func NewSwapRouter(address common.Address, backend bind.ContractBackend) (*SwapRouter, error) { contract, err := bindSwapRouter(address, backend, backend, backend) if err != nil { return nil, err } return &SwapRouter{SwapRouterCaller: SwapRouterCaller{contract: contract}, SwapRouterTransactor: SwapRouterTransactor{contract: contract}, SwapRouterFilterer: SwapRouterFilterer{contract: contract}}, nil } // NewSwapRouterCaller creates a new read-only instance of SwapRouter, bound to a specific deployed contract. func NewSwapRouterCaller(address common.Address, caller bind.ContractCaller) (*SwapRouterCaller, error) { contract, err := bindSwapRouter(address, caller, nil, nil) if err != nil { return nil, err } return &SwapRouterCaller{contract: contract}, nil } // NewSwapRouterTransactor creates a new write-only instance of SwapRouter, bound to a specific deployed contract. func NewSwapRouterTransactor(address common.Address, transactor bind.ContractTransactor) (*SwapRouterTransactor, error) { contract, err := bindSwapRouter(address, nil, transactor, nil) if err != nil { return nil, err } return &SwapRouterTransactor{contract: contract}, nil } // NewSwapRouterFilterer creates a new log filterer instance of SwapRouter, bound to a specific deployed contract. func NewSwapRouterFilterer(address common.Address, filterer bind.ContractFilterer) (*SwapRouterFilterer, error) { contract, err := bindSwapRouter(address, nil, nil, filterer) if err != nil { return nil, err } return &SwapRouterFilterer{contract: contract}, nil } // bindSwapRouter binds a generic wrapper to an already deployed contract. func bindSwapRouter(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { parsed, err := SwapRouterMetaData.GetAbi() if err != nil { return nil, err } return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_SwapRouter *SwapRouterRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _SwapRouter.Contract.SwapRouterCaller.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_SwapRouter *SwapRouterRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _SwapRouter.Contract.SwapRouterTransactor.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_SwapRouter *SwapRouterRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _SwapRouter.Contract.SwapRouterTransactor.contract.Transact(opts, method, params...) } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_SwapRouter *SwapRouterCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _SwapRouter.Contract.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_SwapRouter *SwapRouterTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _SwapRouter.Contract.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_SwapRouter *SwapRouterTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _SwapRouter.Contract.contract.Transact(opts, method, params...) } // WETH is a free data retrieval call binding the contract method 0xad5c4648. // // Solidity: function WETH() view returns(address) func (_SwapRouter *SwapRouterCaller) WETH(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _SwapRouter.contract.Call(opts, &out, "WETH") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // WETH is a free data retrieval call binding the contract method 0xad5c4648. // // Solidity: function WETH() view returns(address) func (_SwapRouter *SwapRouterSession) WETH() (common.Address, error) { return _SwapRouter.Contract.WETH(&_SwapRouter.CallOpts) } // WETH is a free data retrieval call binding the contract method 0xad5c4648. // // Solidity: function WETH() view returns(address) func (_SwapRouter *SwapRouterCallerSession) WETH() (common.Address, error) { return _SwapRouter.Contract.WETH(&_SwapRouter.CallOpts) } // Factory is a free data retrieval call binding the contract method 0xc45a0155. // // Solidity: function factory() view returns(address) func (_SwapRouter *SwapRouterCaller) Factory(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _SwapRouter.contract.Call(opts, &out, "factory") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // Factory is a free data retrieval call binding the contract method 0xc45a0155. // // Solidity: function factory() view returns(address) func (_SwapRouter *SwapRouterSession) Factory() (common.Address, error) { return _SwapRouter.Contract.Factory(&_SwapRouter.CallOpts) } // Factory is a free data retrieval call binding the contract method 0xc45a0155. // // Solidity: function factory() view returns(address) func (_SwapRouter *SwapRouterCallerSession) Factory() (common.Address, error) { return _SwapRouter.Contract.Factory(&_SwapRouter.CallOpts) } // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. // // Solidity: function owner() view returns(address) func (_SwapRouter *SwapRouterCaller) Owner(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _SwapRouter.contract.Call(opts, &out, "owner") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. // // Solidity: function owner() view returns(address) func (_SwapRouter *SwapRouterSession) Owner() (common.Address, error) { return _SwapRouter.Contract.Owner(&_SwapRouter.CallOpts) } // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. // // Solidity: function owner() view returns(address) func (_SwapRouter *SwapRouterCallerSession) Owner() (common.Address, error) { return _SwapRouter.Contract.Owner(&_SwapRouter.CallOpts) } // ExactInput is a paid mutator transaction binding the contract method 0xc04b8d59. // // Solidity: function exactInput((bytes,address,uint256,uint256,uint256) params) payable returns(uint256 amountOut) func (_SwapRouter *SwapRouterTransactor) ExactInput(opts *bind.TransactOpts, params ISwapRouterExactInputParams) (*types.Transaction, error) { return _SwapRouter.contract.Transact(opts, "exactInput", params) } // ExactInput is a paid mutator transaction binding the contract method 0xc04b8d59. // // Solidity: function exactInput((bytes,address,uint256,uint256,uint256) params) payable returns(uint256 amountOut) func (_SwapRouter *SwapRouterSession) ExactInput(params ISwapRouterExactInputParams) (*types.Transaction, error) { return _SwapRouter.Contract.ExactInput(&_SwapRouter.TransactOpts, params) } // ExactInput is a paid mutator transaction binding the contract method 0xc04b8d59. // // Solidity: function exactInput((bytes,address,uint256,uint256,uint256) params) payable returns(uint256 amountOut) func (_SwapRouter *SwapRouterTransactorSession) ExactInput(params ISwapRouterExactInputParams) (*types.Transaction, error) { return _SwapRouter.Contract.ExactInput(&_SwapRouter.TransactOpts, params) } // ExactInputSingle is a paid mutator transaction binding the contract method 0x414bf389. // // Solidity: function exactInputSingle((address,address,uint24,address,uint256,uint256,uint256,uint160) params) payable returns(uint256 amountOut) func (_SwapRouter *SwapRouterTransactor) ExactInputSingle(opts *bind.TransactOpts, params ISwapRouterExactInputSingleParams) (*types.Transaction, error) { return _SwapRouter.contract.Transact(opts, "exactInputSingle", params) } // ExactInputSingle is a paid mutator transaction binding the contract method 0x414bf389. // // Solidity: function exactInputSingle((address,address,uint24,address,uint256,uint256,uint256,uint160) params) payable returns(uint256 amountOut) func (_SwapRouter *SwapRouterSession) ExactInputSingle(params ISwapRouterExactInputSingleParams) (*types.Transaction, error) { return _SwapRouter.Contract.ExactInputSingle(&_SwapRouter.TransactOpts, params) } // ExactInputSingle is a paid mutator transaction binding the contract method 0x414bf389. // // Solidity: function exactInputSingle((address,address,uint24,address,uint256,uint256,uint256,uint160) params) payable returns(uint256 amountOut) func (_SwapRouter *SwapRouterTransactorSession) ExactInputSingle(params ISwapRouterExactInputSingleParams) (*types.Transaction, error) { return _SwapRouter.Contract.ExactInputSingle(&_SwapRouter.TransactOpts, params) } // ExactOutput is a paid mutator transaction binding the contract method 0xf28c0498. // // Solidity: function exactOutput((bytes,address,uint256,uint256,uint256) params) payable returns(uint256 amountIn) func (_SwapRouter *SwapRouterTransactor) ExactOutput(opts *bind.TransactOpts, params ISwapRouterExactOutputParams) (*types.Transaction, error) { return _SwapRouter.contract.Transact(opts, "exactOutput", params) } // ExactOutput is a paid mutator transaction binding the contract method 0xf28c0498. // // Solidity: function exactOutput((bytes,address,uint256,uint256,uint256) params) payable returns(uint256 amountIn) func (_SwapRouter *SwapRouterSession) ExactOutput(params ISwapRouterExactOutputParams) (*types.Transaction, error) { return _SwapRouter.Contract.ExactOutput(&_SwapRouter.TransactOpts, params) } // ExactOutput is a paid mutator transaction binding the contract method 0xf28c0498. // // Solidity: function exactOutput((bytes,address,uint256,uint256,uint256) params) payable returns(uint256 amountIn) func (_SwapRouter *SwapRouterTransactorSession) ExactOutput(params ISwapRouterExactOutputParams) (*types.Transaction, error) { return _SwapRouter.Contract.ExactOutput(&_SwapRouter.TransactOpts, params) } // ExactOutputSingle is a paid mutator transaction binding the contract method 0xdb3e2198. // // Solidity: function exactOutputSingle((address,address,uint24,address,uint256,uint256,uint256,uint160) params) payable returns(uint256 amountIn) func (_SwapRouter *SwapRouterTransactor) ExactOutputSingle(opts *bind.TransactOpts, params ISwapRouterExactOutputSingleParams) (*types.Transaction, error) { return _SwapRouter.contract.Transact(opts, "exactOutputSingle", params) } // ExactOutputSingle is a paid mutator transaction binding the contract method 0xdb3e2198. // // Solidity: function exactOutputSingle((address,address,uint24,address,uint256,uint256,uint256,uint160) params) payable returns(uint256 amountIn) func (_SwapRouter *SwapRouterSession) ExactOutputSingle(params ISwapRouterExactOutputSingleParams) (*types.Transaction, error) { return _SwapRouter.Contract.ExactOutputSingle(&_SwapRouter.TransactOpts, params) } // ExactOutputSingle is a paid mutator transaction binding the contract method 0xdb3e2198. // // Solidity: function exactOutputSingle((address,address,uint24,address,uint256,uint256,uint256,uint160) params) payable returns(uint256 amountIn) func (_SwapRouter *SwapRouterTransactorSession) ExactOutputSingle(params ISwapRouterExactOutputSingleParams) (*types.Transaction, error) { return _SwapRouter.Contract.ExactOutputSingle(&_SwapRouter.TransactOpts, params) } // Initialize is a paid mutator transaction binding the contract method 0x485cc955. // // Solidity: function initialize(address _factory, address _WETH) returns() func (_SwapRouter *SwapRouterTransactor) Initialize(opts *bind.TransactOpts, _factory common.Address, _WETH common.Address) (*types.Transaction, error) { return _SwapRouter.contract.Transact(opts, "initialize", _factory, _WETH) } // Initialize is a paid mutator transaction binding the contract method 0x485cc955. // // Solidity: function initialize(address _factory, address _WETH) returns() func (_SwapRouter *SwapRouterSession) Initialize(_factory common.Address, _WETH common.Address) (*types.Transaction, error) { return _SwapRouter.Contract.Initialize(&_SwapRouter.TransactOpts, _factory, _WETH) } // Initialize is a paid mutator transaction binding the contract method 0x485cc955. // // Solidity: function initialize(address _factory, address _WETH) returns() func (_SwapRouter *SwapRouterTransactorSession) Initialize(_factory common.Address, _WETH common.Address) (*types.Transaction, error) { return _SwapRouter.Contract.Initialize(&_SwapRouter.TransactOpts, _factory, _WETH) } // Multicall is a paid mutator transaction binding the contract method 0xac9650d8. // // Solidity: function multicall(bytes[] data) payable returns(bytes[] results) func (_SwapRouter *SwapRouterTransactor) Multicall(opts *bind.TransactOpts, data [][]byte) (*types.Transaction, error) { return _SwapRouter.contract.Transact(opts, "multicall", data) } // Multicall is a paid mutator transaction binding the contract method 0xac9650d8. // // Solidity: function multicall(bytes[] data) payable returns(bytes[] results) func (_SwapRouter *SwapRouterSession) Multicall(data [][]byte) (*types.Transaction, error) { return _SwapRouter.Contract.Multicall(&_SwapRouter.TransactOpts, data) } // Multicall is a paid mutator transaction binding the contract method 0xac9650d8. // // Solidity: function multicall(bytes[] data) payable returns(bytes[] results) func (_SwapRouter *SwapRouterTransactorSession) Multicall(data [][]byte) (*types.Transaction, error) { return _SwapRouter.Contract.Multicall(&_SwapRouter.TransactOpts, data) } // RefundETH is a paid mutator transaction binding the contract method 0x12210e8a. // // Solidity: function refundETH() payable returns() func (_SwapRouter *SwapRouterTransactor) RefundETH(opts *bind.TransactOpts) (*types.Transaction, error) { return _SwapRouter.contract.Transact(opts, "refundETH") } // RefundETH is a paid mutator transaction binding the contract method 0x12210e8a. // // Solidity: function refundETH() payable returns() func (_SwapRouter *SwapRouterSession) RefundETH() (*types.Transaction, error) { return _SwapRouter.Contract.RefundETH(&_SwapRouter.TransactOpts) } // RefundETH is a paid mutator transaction binding the contract method 0x12210e8a. // // Solidity: function refundETH() payable returns() func (_SwapRouter *SwapRouterTransactorSession) RefundETH() (*types.Transaction, error) { return _SwapRouter.Contract.RefundETH(&_SwapRouter.TransactOpts) } // RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. // // Solidity: function renounceOwnership() returns() func (_SwapRouter *SwapRouterTransactor) RenounceOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { return _SwapRouter.contract.Transact(opts, "renounceOwnership") } // RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. // // Solidity: function renounceOwnership() returns() func (_SwapRouter *SwapRouterSession) RenounceOwnership() (*types.Transaction, error) { return _SwapRouter.Contract.RenounceOwnership(&_SwapRouter.TransactOpts) } // RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. // // Solidity: function renounceOwnership() returns() func (_SwapRouter *SwapRouterTransactorSession) RenounceOwnership() (*types.Transaction, error) { return _SwapRouter.Contract.RenounceOwnership(&_SwapRouter.TransactOpts) } // SelfPermit is a paid mutator transaction binding the contract method 0xf3995c67. // // Solidity: function selfPermit(address token, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() func (_SwapRouter *SwapRouterTransactor) SelfPermit(opts *bind.TransactOpts, token common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _SwapRouter.contract.Transact(opts, "selfPermit", token, value, deadline, v, r, s) } // SelfPermit is a paid mutator transaction binding the contract method 0xf3995c67. // // Solidity: function selfPermit(address token, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() func (_SwapRouter *SwapRouterSession) SelfPermit(token common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _SwapRouter.Contract.SelfPermit(&_SwapRouter.TransactOpts, token, value, deadline, v, r, s) } // SelfPermit is a paid mutator transaction binding the contract method 0xf3995c67. // // Solidity: function selfPermit(address token, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() func (_SwapRouter *SwapRouterTransactorSession) SelfPermit(token common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _SwapRouter.Contract.SelfPermit(&_SwapRouter.TransactOpts, token, value, deadline, v, r, s) } // SelfPermitAllowed is a paid mutator transaction binding the contract method 0x4659a494. // // Solidity: function selfPermitAllowed(address token, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) payable returns() func (_SwapRouter *SwapRouterTransactor) SelfPermitAllowed(opts *bind.TransactOpts, token common.Address, nonce *big.Int, expiry *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _SwapRouter.contract.Transact(opts, "selfPermitAllowed", token, nonce, expiry, v, r, s) } // SelfPermitAllowed is a paid mutator transaction binding the contract method 0x4659a494. // // Solidity: function selfPermitAllowed(address token, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) payable returns() func (_SwapRouter *SwapRouterSession) SelfPermitAllowed(token common.Address, nonce *big.Int, expiry *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _SwapRouter.Contract.SelfPermitAllowed(&_SwapRouter.TransactOpts, token, nonce, expiry, v, r, s) } // SelfPermitAllowed is a paid mutator transaction binding the contract method 0x4659a494. // // Solidity: function selfPermitAllowed(address token, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) payable returns() func (_SwapRouter *SwapRouterTransactorSession) SelfPermitAllowed(token common.Address, nonce *big.Int, expiry *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _SwapRouter.Contract.SelfPermitAllowed(&_SwapRouter.TransactOpts, token, nonce, expiry, v, r, s) } // SelfPermitAllowedIfNecessary is a paid mutator transaction binding the contract method 0xa4a78f0c. // // Solidity: function selfPermitAllowedIfNecessary(address token, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) payable returns() func (_SwapRouter *SwapRouterTransactor) SelfPermitAllowedIfNecessary(opts *bind.TransactOpts, token common.Address, nonce *big.Int, expiry *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _SwapRouter.contract.Transact(opts, "selfPermitAllowedIfNecessary", token, nonce, expiry, v, r, s) } // SelfPermitAllowedIfNecessary is a paid mutator transaction binding the contract method 0xa4a78f0c. // // Solidity: function selfPermitAllowedIfNecessary(address token, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) payable returns() func (_SwapRouter *SwapRouterSession) SelfPermitAllowedIfNecessary(token common.Address, nonce *big.Int, expiry *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _SwapRouter.Contract.SelfPermitAllowedIfNecessary(&_SwapRouter.TransactOpts, token, nonce, expiry, v, r, s) } // SelfPermitAllowedIfNecessary is a paid mutator transaction binding the contract method 0xa4a78f0c. // // Solidity: function selfPermitAllowedIfNecessary(address token, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) payable returns() func (_SwapRouter *SwapRouterTransactorSession) SelfPermitAllowedIfNecessary(token common.Address, nonce *big.Int, expiry *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _SwapRouter.Contract.SelfPermitAllowedIfNecessary(&_SwapRouter.TransactOpts, token, nonce, expiry, v, r, s) } // SelfPermitIfNecessary is a paid mutator transaction binding the contract method 0xc2e3140a. // // Solidity: function selfPermitIfNecessary(address token, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() func (_SwapRouter *SwapRouterTransactor) SelfPermitIfNecessary(opts *bind.TransactOpts, token common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _SwapRouter.contract.Transact(opts, "selfPermitIfNecessary", token, value, deadline, v, r, s) } // SelfPermitIfNecessary is a paid mutator transaction binding the contract method 0xc2e3140a. // // Solidity: function selfPermitIfNecessary(address token, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() func (_SwapRouter *SwapRouterSession) SelfPermitIfNecessary(token common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _SwapRouter.Contract.SelfPermitIfNecessary(&_SwapRouter.TransactOpts, token, value, deadline, v, r, s) } // SelfPermitIfNecessary is a paid mutator transaction binding the contract method 0xc2e3140a. // // Solidity: function selfPermitIfNecessary(address token, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() func (_SwapRouter *SwapRouterTransactorSession) SelfPermitIfNecessary(token common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _SwapRouter.Contract.SelfPermitIfNecessary(&_SwapRouter.TransactOpts, token, value, deadline, v, r, s) } // SetWETH is a paid mutator transaction binding the contract method 0x5b769f3c. // // Solidity: function setWETH(address WETHArg) returns() func (_SwapRouter *SwapRouterTransactor) SetWETH(opts *bind.TransactOpts, WETHArg common.Address) (*types.Transaction, error) { return _SwapRouter.contract.Transact(opts, "setWETH", WETHArg) } // SetWETH is a paid mutator transaction binding the contract method 0x5b769f3c. // // Solidity: function setWETH(address WETHArg) returns() func (_SwapRouter *SwapRouterSession) SetWETH(WETHArg common.Address) (*types.Transaction, error) { return _SwapRouter.Contract.SetWETH(&_SwapRouter.TransactOpts, WETHArg) } // SetWETH is a paid mutator transaction binding the contract method 0x5b769f3c. // // Solidity: function setWETH(address WETHArg) returns() func (_SwapRouter *SwapRouterTransactorSession) SetWETH(WETHArg common.Address) (*types.Transaction, error) { return _SwapRouter.Contract.SetWETH(&_SwapRouter.TransactOpts, WETHArg) } // SweepToken is a paid mutator transaction binding the contract method 0xdf2ab5bb. // // Solidity: function sweepToken(address token, uint256 amountMinimum, address recipient) payable returns() func (_SwapRouter *SwapRouterTransactor) SweepToken(opts *bind.TransactOpts, token common.Address, amountMinimum *big.Int, recipient common.Address) (*types.Transaction, error) { return _SwapRouter.contract.Transact(opts, "sweepToken", token, amountMinimum, recipient) } // SweepToken is a paid mutator transaction binding the contract method 0xdf2ab5bb. // // Solidity: function sweepToken(address token, uint256 amountMinimum, address recipient) payable returns() func (_SwapRouter *SwapRouterSession) SweepToken(token common.Address, amountMinimum *big.Int, recipient common.Address) (*types.Transaction, error) { return _SwapRouter.Contract.SweepToken(&_SwapRouter.TransactOpts, token, amountMinimum, recipient) } // SweepToken is a paid mutator transaction binding the contract method 0xdf2ab5bb. // // Solidity: function sweepToken(address token, uint256 amountMinimum, address recipient) payable returns() func (_SwapRouter *SwapRouterTransactorSession) SweepToken(token common.Address, amountMinimum *big.Int, recipient common.Address) (*types.Transaction, error) { return _SwapRouter.Contract.SweepToken(&_SwapRouter.TransactOpts, token, amountMinimum, recipient) } // SweepTokenWithFee is a paid mutator transaction binding the contract method 0xe0e189a0. // // Solidity: function sweepTokenWithFee(address token, uint256 amountMinimum, address recipient, uint256 feeBips, address feeRecipient) payable returns() func (_SwapRouter *SwapRouterTransactor) SweepTokenWithFee(opts *bind.TransactOpts, token common.Address, amountMinimum *big.Int, recipient common.Address, feeBips *big.Int, feeRecipient common.Address) (*types.Transaction, error) { return _SwapRouter.contract.Transact(opts, "sweepTokenWithFee", token, amountMinimum, recipient, feeBips, feeRecipient) } // SweepTokenWithFee is a paid mutator transaction binding the contract method 0xe0e189a0. // // Solidity: function sweepTokenWithFee(address token, uint256 amountMinimum, address recipient, uint256 feeBips, address feeRecipient) payable returns() func (_SwapRouter *SwapRouterSession) SweepTokenWithFee(token common.Address, amountMinimum *big.Int, recipient common.Address, feeBips *big.Int, feeRecipient common.Address) (*types.Transaction, error) { return _SwapRouter.Contract.SweepTokenWithFee(&_SwapRouter.TransactOpts, token, amountMinimum, recipient, feeBips, feeRecipient) } // SweepTokenWithFee is a paid mutator transaction binding the contract method 0xe0e189a0. // // Solidity: function sweepTokenWithFee(address token, uint256 amountMinimum, address recipient, uint256 feeBips, address feeRecipient) payable returns() func (_SwapRouter *SwapRouterTransactorSession) SweepTokenWithFee(token common.Address, amountMinimum *big.Int, recipient common.Address, feeBips *big.Int, feeRecipient common.Address) (*types.Transaction, error) { return _SwapRouter.Contract.SweepTokenWithFee(&_SwapRouter.TransactOpts, token, amountMinimum, recipient, feeBips, feeRecipient) } // TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. // // Solidity: function transferOwnership(address newOwner) returns() func (_SwapRouter *SwapRouterTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) { return _SwapRouter.contract.Transact(opts, "transferOwnership", newOwner) } // TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. // // Solidity: function transferOwnership(address newOwner) returns() func (_SwapRouter *SwapRouterSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { return _SwapRouter.Contract.TransferOwnership(&_SwapRouter.TransactOpts, newOwner) } // TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. // // Solidity: function transferOwnership(address newOwner) returns() func (_SwapRouter *SwapRouterTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { return _SwapRouter.Contract.TransferOwnership(&_SwapRouter.TransactOpts, newOwner) } // UniswapV3SwapCallback is a paid mutator transaction binding the contract method 0xfa461e33. // // Solidity: function uniswapV3SwapCallback(int256 amount0Delta, int256 amount1Delta, bytes _data) returns() func (_SwapRouter *SwapRouterTransactor) UniswapV3SwapCallback(opts *bind.TransactOpts, amount0Delta *big.Int, amount1Delta *big.Int, _data []byte) (*types.Transaction, error) { return _SwapRouter.contract.Transact(opts, "uniswapV3SwapCallback", amount0Delta, amount1Delta, _data) } // UniswapV3SwapCallback is a paid mutator transaction binding the contract method 0xfa461e33. // // Solidity: function uniswapV3SwapCallback(int256 amount0Delta, int256 amount1Delta, bytes _data) returns() func (_SwapRouter *SwapRouterSession) UniswapV3SwapCallback(amount0Delta *big.Int, amount1Delta *big.Int, _data []byte) (*types.Transaction, error) { return _SwapRouter.Contract.UniswapV3SwapCallback(&_SwapRouter.TransactOpts, amount0Delta, amount1Delta, _data) } // UniswapV3SwapCallback is a paid mutator transaction binding the contract method 0xfa461e33. // // Solidity: function uniswapV3SwapCallback(int256 amount0Delta, int256 amount1Delta, bytes _data) returns() func (_SwapRouter *SwapRouterTransactorSession) UniswapV3SwapCallback(amount0Delta *big.Int, amount1Delta *big.Int, _data []byte) (*types.Transaction, error) { return _SwapRouter.Contract.UniswapV3SwapCallback(&_SwapRouter.TransactOpts, amount0Delta, amount1Delta, _data) } // UnwrapWETH is a paid mutator transaction binding the contract method 0xe16d9ce5. // // Solidity: function unwrapWETH(uint256 amountMinimum, address recipient) payable returns() func (_SwapRouter *SwapRouterTransactor) UnwrapWETH(opts *bind.TransactOpts, amountMinimum *big.Int, recipient common.Address) (*types.Transaction, error) { return _SwapRouter.contract.Transact(opts, "unwrapWETH", amountMinimum, recipient) } // UnwrapWETH is a paid mutator transaction binding the contract method 0xe16d9ce5. // // Solidity: function unwrapWETH(uint256 amountMinimum, address recipient) payable returns() func (_SwapRouter *SwapRouterSession) UnwrapWETH(amountMinimum *big.Int, recipient common.Address) (*types.Transaction, error) { return _SwapRouter.Contract.UnwrapWETH(&_SwapRouter.TransactOpts, amountMinimum, recipient) } // UnwrapWETH is a paid mutator transaction binding the contract method 0xe16d9ce5. // // Solidity: function unwrapWETH(uint256 amountMinimum, address recipient) payable returns() func (_SwapRouter *SwapRouterTransactorSession) UnwrapWETH(amountMinimum *big.Int, recipient common.Address) (*types.Transaction, error) { return _SwapRouter.Contract.UnwrapWETH(&_SwapRouter.TransactOpts, amountMinimum, recipient) } // UnwrapWETHWithFee is a paid mutator transaction binding the contract method 0x2135ac89. // // Solidity: function unwrapWETHWithFee(uint256 amountMinimum, address recipient, uint256 feeBips, address feeRecipient) payable returns() func (_SwapRouter *SwapRouterTransactor) UnwrapWETHWithFee(opts *bind.TransactOpts, amountMinimum *big.Int, recipient common.Address, feeBips *big.Int, feeRecipient common.Address) (*types.Transaction, error) { return _SwapRouter.contract.Transact(opts, "unwrapWETHWithFee", amountMinimum, recipient, feeBips, feeRecipient) } // UnwrapWETHWithFee is a paid mutator transaction binding the contract method 0x2135ac89. // // Solidity: function unwrapWETHWithFee(uint256 amountMinimum, address recipient, uint256 feeBips, address feeRecipient) payable returns() func (_SwapRouter *SwapRouterSession) UnwrapWETHWithFee(amountMinimum *big.Int, recipient common.Address, feeBips *big.Int, feeRecipient common.Address) (*types.Transaction, error) { return _SwapRouter.Contract.UnwrapWETHWithFee(&_SwapRouter.TransactOpts, amountMinimum, recipient, feeBips, feeRecipient) } // UnwrapWETHWithFee is a paid mutator transaction binding the contract method 0x2135ac89. // // Solidity: function unwrapWETHWithFee(uint256 amountMinimum, address recipient, uint256 feeBips, address feeRecipient) payable returns() func (_SwapRouter *SwapRouterTransactorSession) UnwrapWETHWithFee(amountMinimum *big.Int, recipient common.Address, feeBips *big.Int, feeRecipient common.Address) (*types.Transaction, error) { return _SwapRouter.Contract.UnwrapWETHWithFee(&_SwapRouter.TransactOpts, amountMinimum, recipient, feeBips, feeRecipient) } // Receive is a paid mutator transaction binding the contract receive function. // // Solidity: receive() payable returns() func (_SwapRouter *SwapRouterTransactor) Receive(opts *bind.TransactOpts) (*types.Transaction, error) { return _SwapRouter.contract.RawTransact(opts, nil) // calldata is disallowed for receive function } // Receive is a paid mutator transaction binding the contract receive function. // // Solidity: receive() payable returns() func (_SwapRouter *SwapRouterSession) Receive() (*types.Transaction, error) { return _SwapRouter.Contract.Receive(&_SwapRouter.TransactOpts) } // Receive is a paid mutator transaction binding the contract receive function. // // Solidity: receive() payable returns() func (_SwapRouter *SwapRouterTransactorSession) Receive() (*types.Transaction, error) { return _SwapRouter.Contract.Receive(&_SwapRouter.TransactOpts) } // SwapRouterInitializedIterator is returned from FilterInitialized and is used to iterate over the raw logs and unpacked data for Initialized events raised by the SwapRouter contract. type SwapRouterInitializedIterator struct { Event *SwapRouterInitialized // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *SwapRouterInitializedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(SwapRouterInitialized) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(SwapRouterInitialized) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *SwapRouterInitializedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *SwapRouterInitializedIterator) Close() error { it.sub.Unsubscribe() return nil } // SwapRouterInitialized represents a Initialized event raised by the SwapRouter contract. type SwapRouterInitialized struct { Version uint8 Raw types.Log // Blockchain specific contextual infos } // FilterInitialized is a free log retrieval operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. // // Solidity: event Initialized(uint8 version) func (_SwapRouter *SwapRouterFilterer) FilterInitialized(opts *bind.FilterOpts) (*SwapRouterInitializedIterator, error) { logs, sub, err := _SwapRouter.contract.FilterLogs(opts, "Initialized") if err != nil { return nil, err } return &SwapRouterInitializedIterator{contract: _SwapRouter.contract, event: "Initialized", logs: logs, sub: sub}, nil } // WatchInitialized is a free log subscription operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. // // Solidity: event Initialized(uint8 version) func (_SwapRouter *SwapRouterFilterer) WatchInitialized(opts *bind.WatchOpts, sink chan<- *SwapRouterInitialized) (event.Subscription, error) { logs, sub, err := _SwapRouter.contract.WatchLogs(opts, "Initialized") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(SwapRouterInitialized) if err := _SwapRouter.contract.UnpackLog(event, "Initialized", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseInitialized is a log parse operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. // // Solidity: event Initialized(uint8 version) func (_SwapRouter *SwapRouterFilterer) ParseInitialized(log types.Log) (*SwapRouterInitialized, error) { event := new(SwapRouterInitialized) if err := _SwapRouter.contract.UnpackLog(event, "Initialized", log); err != nil { return nil, err } event.Raw = log return event, nil } // SwapRouterOwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the SwapRouter contract. type SwapRouterOwnershipTransferredIterator struct { Event *SwapRouterOwnershipTransferred // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *SwapRouterOwnershipTransferredIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(SwapRouterOwnershipTransferred) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(SwapRouterOwnershipTransferred) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *SwapRouterOwnershipTransferredIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *SwapRouterOwnershipTransferredIterator) Close() error { it.sub.Unsubscribe() return nil } // SwapRouterOwnershipTransferred represents a OwnershipTransferred event raised by the SwapRouter contract. type SwapRouterOwnershipTransferred struct { PreviousOwner common.Address NewOwner common.Address Raw types.Log // Blockchain specific contextual infos } // FilterOwnershipTransferred is a free log retrieval operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. // // Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) func (_SwapRouter *SwapRouterFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*SwapRouterOwnershipTransferredIterator, error) { var previousOwnerRule []interface{} for _, previousOwnerItem := range previousOwner { previousOwnerRule = append(previousOwnerRule, previousOwnerItem) } var newOwnerRule []interface{} for _, newOwnerItem := range newOwner { newOwnerRule = append(newOwnerRule, newOwnerItem) } logs, sub, err := _SwapRouter.contract.FilterLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) if err != nil { return nil, err } return &SwapRouterOwnershipTransferredIterator{contract: _SwapRouter.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil } // WatchOwnershipTransferred is a free log subscription operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. // // Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) func (_SwapRouter *SwapRouterFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *SwapRouterOwnershipTransferred, previousOwner []common.Address, newOwner []common.Address) (event.Subscription, error) { var previousOwnerRule []interface{} for _, previousOwnerItem := range previousOwner { previousOwnerRule = append(previousOwnerRule, previousOwnerItem) } var newOwnerRule []interface{} for _, newOwnerItem := range newOwner { newOwnerRule = append(newOwnerRule, newOwnerItem) } logs, sub, err := _SwapRouter.contract.WatchLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(SwapRouterOwnershipTransferred) if err := _SwapRouter.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseOwnershipTransferred is a log parse operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. // // Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) func (_SwapRouter *SwapRouterFilterer) ParseOwnershipTransferred(log types.Log) (*SwapRouterOwnershipTransferred, error) { event := new(SwapRouterOwnershipTransferred) if err := _SwapRouter.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { return nil, err } event.Raw = log return event, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/binds/multisend/MultiSend.go ================================================ // Code generated - DO NOT EDIT. // This file is a generated binding and any manual changes will be lost. package multisend import ( "errors" "math/big" "strings" ethereum "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/event" ) // Reference imports to suppress errors if they are not otherwise used. var ( _ = errors.New _ = big.NewInt _ = strings.NewReader _ = ethereum.NotFound _ = bind.Bind _ = common.Big1 _ = types.BloomLookup _ = event.NewSubscription _ = abi.ConvertType ) // MultiSendSend is an auto generated low-level Go binding around an user-defined struct. type MultiSendSend struct { Token common.Address To common.Address Amount *big.Int } // MultiSendMetaData contains all meta data concerning the MultiSend contract. var MultiSendMetaData = &bind.MetaData{ ABI: "[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_token\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"_addresses\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"_amounts\",\"type\":\"uint256[]\"}],\"name\":\"multiERC20Transfer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"internalType\":\"structMultiSend.Send[]\",\"name\":\"sends\",\"type\":\"tuple[]\"}],\"name\":\"multiSend\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"withdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]", Bin: "0x6080806040523461005b5760008054336001600160a01b0319821681178355916001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09080a36108c590816100618239f35b600080fdfe60406080815260049081361015610020575b5050361561001e57600080fd5b005b600091823560e01c806335a21728146103e757806369328dec14610331578063715018a6146102d75780638da5cb5b146102ab578063ee15882b146101345763f2fde38b1461006f5750610011565b3461013057602036600319011261013057610088610490565b906100916104dc565b6001600160a01b039182169283156100de57505082546001600160a01b0319811683178455167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08380a380f35b906020608492519162461bcd60e51b8352820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152fd5b8280fd5b50602092836003193601126102a85767ffffffffffffffff8235818111610130573660238201121561013057808401359182116101305760249283820191843691606086020101116102a85791908280925b8084106101d7575050505034036101a05750505160018152f35b60649360149293519362461bcd60e51b8552840152820152731b5a5cdb585d18da081cd95b9908185b5bdd5b9d60621b6044820152fd5b9293919290916001600160a01b03806101f96101f4888689610559565b61057f565b16610266575061022b6102178a610211888689610559565b0161057f565b89610223888689610559565b01359061083b565b87610237868487610559565b013581018091116102545761024c9094610534565b929190610186565b634e487b7160e01b8352601187528583fd5b946102a361024c929661027d6101f484878a610559565b1661028d8c61021185888b610559565b8b61029985888b610559565b0135913390610593565b610534565b80fd5b5050346102d357816003193601126102d357905490516001600160a01b039091168152602090f35b5080fd5b83346102a857806003193601126102a8576102f06104dc565b80546001600160a01b03198116825581906001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b509190346102d35760603660031901126102d35761034d610490565b60243591604435916001600160a01b0380841692918385036103e3576103716104dc565b1690816103895750505061038692935061083b565b80f35b809294919350519363a9059cbb60e01b60208601526024850152604484015260448352608083019083821067ffffffffffffffff8311176103d05761038694955052610604565b634e487b7160e01b855260418652602485fd5b8680fd5b8382346102d35760603660031901126102d357610402610490565b9067ffffffffffffffff60243581811161048c5761042390369084016104ab565b9190926044359182116104885761043f919493943691016104ab565b6001600160a01b03909316929091855b81811061045a578680f35b806102a361046f6101f461048394868b61082b565b61047a83878961082b565b35903389610593565b61044f565b8580fd5b8480fd5b600435906001600160a01b03821682036104a657565b600080fd5b9181601f840112156104a65782359167ffffffffffffffff83116104a6576020808501948460051b0101116104a657565b6000546001600160a01b031633036104f057565b606460405162461bcd60e51b815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b60001981146105435760010190565b634e487b7160e01b600052601160045260246000fd5b9190811015610569576060020190565b634e487b7160e01b600052603260045260246000fd5b356001600160a01b03811681036104a65790565b6040516323b872dd60e01b60208201526001600160a01b03928316602482015292909116604483015260648083019390935291815260a081019181831067ffffffffffffffff8411176105ee576105ec92604052610604565b565b634e487b7160e01b600052604160045260246000fd5b60018060a01b031690604051604081019080821067ffffffffffffffff8311176105ee57610676916040526020938482527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564858301526000808587829751910182855af161067061070c565b91610757565b8051918215918483156106e8575b5050509050156106915750565b6084906040519062461bcd60e51b82526004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152fd5b9193818094500103126102d3578201519081151582036102a8575080388084610684565b3d156107525767ffffffffffffffff903d8281116105ee5760405192601f8201601f19908116603f01168401908111848210176105ee5760405282523d6000602084013e565b606090565b919290156107b9575081511561076b575090565b3b156107745790565b60405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606490fd5b8251909150156107cc5750805190602001fd5b6040519062461bcd60e51b82528160208060048301528251908160248401526000935b828510610812575050604492506000838284010152601f80199101168101030190fd5b84810182015186860160440152938101938593506107ef565b91908110156105695760051b0190565b600080809381935af161084c61070c565b501561085457565b60405162461bcd60e51b81526020600482015260136024820152721d1c985b9cd9995c88195d1a0819985a5b1959606a1b6044820152606490fdfea26469706673582212204e76d9ede77380337a919bdbe4566fcfd7e3dd9d0dd6b7f5258b4cdf2a86958964736f6c63430008130033", } // MultiSendABI is the input ABI used to generate the binding from. // Deprecated: Use MultiSendMetaData.ABI instead. var MultiSendABI = MultiSendMetaData.ABI // MultiSendBin is the compiled bytecode used for deploying new contracts. // Deprecated: Use MultiSendMetaData.Bin instead. var MultiSendBin = MultiSendMetaData.Bin // DeployMultiSend deploys a new Ethereum contract, binding an instance of MultiSend to it. func DeployMultiSend(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *MultiSend, error) { parsed, err := MultiSendMetaData.GetAbi() if err != nil { return common.Address{}, nil, nil, err } if parsed == nil { return common.Address{}, nil, nil, errors.New("GetABI returned nil") } address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(MultiSendBin), backend) if err != nil { return common.Address{}, nil, nil, err } return address, tx, &MultiSend{MultiSendCaller: MultiSendCaller{contract: contract}, MultiSendTransactor: MultiSendTransactor{contract: contract}, MultiSendFilterer: MultiSendFilterer{contract: contract}}, nil } // MultiSend is an auto generated Go binding around an Ethereum contract. type MultiSend struct { MultiSendCaller // Read-only binding to the contract MultiSendTransactor // Write-only binding to the contract MultiSendFilterer // Log filterer for contract events } // MultiSendCaller is an auto generated read-only Go binding around an Ethereum contract. type MultiSendCaller struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // MultiSendTransactor is an auto generated write-only Go binding around an Ethereum contract. type MultiSendTransactor struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // MultiSendFilterer is an auto generated log filtering Go binding around an Ethereum contract events. type MultiSendFilterer struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // MultiSendSession is an auto generated Go binding around an Ethereum contract, // with pre-set call and transact options. type MultiSendSession struct { Contract *MultiSend // Generic contract binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // MultiSendCallerSession is an auto generated read-only Go binding around an Ethereum contract, // with pre-set call options. type MultiSendCallerSession struct { Contract *MultiSendCaller // Generic contract caller binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session } // MultiSendTransactorSession is an auto generated write-only Go binding around an Ethereum contract, // with pre-set transact options. type MultiSendTransactorSession struct { Contract *MultiSendTransactor // Generic contract transactor binding to set the session for TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // MultiSendRaw is an auto generated low-level Go binding around an Ethereum contract. type MultiSendRaw struct { Contract *MultiSend // Generic contract binding to access the raw methods on } // MultiSendCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. type MultiSendCallerRaw struct { Contract *MultiSendCaller // Generic read-only contract binding to access the raw methods on } // MultiSendTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. type MultiSendTransactorRaw struct { Contract *MultiSendTransactor // Generic write-only contract binding to access the raw methods on } // NewMultiSend creates a new instance of MultiSend, bound to a specific deployed contract. func NewMultiSend(address common.Address, backend bind.ContractBackend) (*MultiSend, error) { contract, err := bindMultiSend(address, backend, backend, backend) if err != nil { return nil, err } return &MultiSend{MultiSendCaller: MultiSendCaller{contract: contract}, MultiSendTransactor: MultiSendTransactor{contract: contract}, MultiSendFilterer: MultiSendFilterer{contract: contract}}, nil } // NewMultiSendCaller creates a new read-only instance of MultiSend, bound to a specific deployed contract. func NewMultiSendCaller(address common.Address, caller bind.ContractCaller) (*MultiSendCaller, error) { contract, err := bindMultiSend(address, caller, nil, nil) if err != nil { return nil, err } return &MultiSendCaller{contract: contract}, nil } // NewMultiSendTransactor creates a new write-only instance of MultiSend, bound to a specific deployed contract. func NewMultiSendTransactor(address common.Address, transactor bind.ContractTransactor) (*MultiSendTransactor, error) { contract, err := bindMultiSend(address, nil, transactor, nil) if err != nil { return nil, err } return &MultiSendTransactor{contract: contract}, nil } // NewMultiSendFilterer creates a new log filterer instance of MultiSend, bound to a specific deployed contract. func NewMultiSendFilterer(address common.Address, filterer bind.ContractFilterer) (*MultiSendFilterer, error) { contract, err := bindMultiSend(address, nil, nil, filterer) if err != nil { return nil, err } return &MultiSendFilterer{contract: contract}, nil } // bindMultiSend binds a generic wrapper to an already deployed contract. func bindMultiSend(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { parsed, err := MultiSendMetaData.GetAbi() if err != nil { return nil, err } return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_MultiSend *MultiSendRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _MultiSend.Contract.MultiSendCaller.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_MultiSend *MultiSendRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _MultiSend.Contract.MultiSendTransactor.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_MultiSend *MultiSendRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _MultiSend.Contract.MultiSendTransactor.contract.Transact(opts, method, params...) } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_MultiSend *MultiSendCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _MultiSend.Contract.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_MultiSend *MultiSendTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _MultiSend.Contract.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_MultiSend *MultiSendTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _MultiSend.Contract.contract.Transact(opts, method, params...) } // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. // // Solidity: function owner() view returns(address) func (_MultiSend *MultiSendCaller) Owner(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _MultiSend.contract.Call(opts, &out, "owner") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. // // Solidity: function owner() view returns(address) func (_MultiSend *MultiSendSession) Owner() (common.Address, error) { return _MultiSend.Contract.Owner(&_MultiSend.CallOpts) } // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. // // Solidity: function owner() view returns(address) func (_MultiSend *MultiSendCallerSession) Owner() (common.Address, error) { return _MultiSend.Contract.Owner(&_MultiSend.CallOpts) } // MultiERC20Transfer is a paid mutator transaction binding the contract method 0x35a21728. // // Solidity: function multiERC20Transfer(address _token, address[] _addresses, uint256[] _amounts) returns() func (_MultiSend *MultiSendTransactor) MultiERC20Transfer(opts *bind.TransactOpts, _token common.Address, _addresses []common.Address, _amounts []*big.Int) (*types.Transaction, error) { return _MultiSend.contract.Transact(opts, "multiERC20Transfer", _token, _addresses, _amounts) } // MultiERC20Transfer is a paid mutator transaction binding the contract method 0x35a21728. // // Solidity: function multiERC20Transfer(address _token, address[] _addresses, uint256[] _amounts) returns() func (_MultiSend *MultiSendSession) MultiERC20Transfer(_token common.Address, _addresses []common.Address, _amounts []*big.Int) (*types.Transaction, error) { return _MultiSend.Contract.MultiERC20Transfer(&_MultiSend.TransactOpts, _token, _addresses, _amounts) } // MultiERC20Transfer is a paid mutator transaction binding the contract method 0x35a21728. // // Solidity: function multiERC20Transfer(address _token, address[] _addresses, uint256[] _amounts) returns() func (_MultiSend *MultiSendTransactorSession) MultiERC20Transfer(_token common.Address, _addresses []common.Address, _amounts []*big.Int) (*types.Transaction, error) { return _MultiSend.Contract.MultiERC20Transfer(&_MultiSend.TransactOpts, _token, _addresses, _amounts) } // MultiSend is a paid mutator transaction binding the contract method 0xee15882b. // // Solidity: function multiSend((address,address,uint256)[] sends) payable returns(bool) func (_MultiSend *MultiSendTransactor) MultiSend(opts *bind.TransactOpts, sends []MultiSendSend) (*types.Transaction, error) { return _MultiSend.contract.Transact(opts, "multiSend", sends) } // MultiSend is a paid mutator transaction binding the contract method 0xee15882b. // // Solidity: function multiSend((address,address,uint256)[] sends) payable returns(bool) func (_MultiSend *MultiSendSession) MultiSend(sends []MultiSendSend) (*types.Transaction, error) { return _MultiSend.Contract.MultiSend(&_MultiSend.TransactOpts, sends) } // MultiSend is a paid mutator transaction binding the contract method 0xee15882b. // // Solidity: function multiSend((address,address,uint256)[] sends) payable returns(bool) func (_MultiSend *MultiSendTransactorSession) MultiSend(sends []MultiSendSend) (*types.Transaction, error) { return _MultiSend.Contract.MultiSend(&_MultiSend.TransactOpts, sends) } // RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. // // Solidity: function renounceOwnership() returns() func (_MultiSend *MultiSendTransactor) RenounceOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { return _MultiSend.contract.Transact(opts, "renounceOwnership") } // RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. // // Solidity: function renounceOwnership() returns() func (_MultiSend *MultiSendSession) RenounceOwnership() (*types.Transaction, error) { return _MultiSend.Contract.RenounceOwnership(&_MultiSend.TransactOpts) } // RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. // // Solidity: function renounceOwnership() returns() func (_MultiSend *MultiSendTransactorSession) RenounceOwnership() (*types.Transaction, error) { return _MultiSend.Contract.RenounceOwnership(&_MultiSend.TransactOpts) } // TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. // // Solidity: function transferOwnership(address newOwner) returns() func (_MultiSend *MultiSendTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) { return _MultiSend.contract.Transact(opts, "transferOwnership", newOwner) } // TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. // // Solidity: function transferOwnership(address newOwner) returns() func (_MultiSend *MultiSendSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { return _MultiSend.Contract.TransferOwnership(&_MultiSend.TransactOpts, newOwner) } // TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. // // Solidity: function transferOwnership(address newOwner) returns() func (_MultiSend *MultiSendTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { return _MultiSend.Contract.TransferOwnership(&_MultiSend.TransactOpts, newOwner) } // Withdraw is a paid mutator transaction binding the contract method 0x69328dec. // // Solidity: function withdraw(address token, uint256 amount, address to) returns() func (_MultiSend *MultiSendTransactor) Withdraw(opts *bind.TransactOpts, token common.Address, amount *big.Int, to common.Address) (*types.Transaction, error) { return _MultiSend.contract.Transact(opts, "withdraw", token, amount, to) } // Withdraw is a paid mutator transaction binding the contract method 0x69328dec. // // Solidity: function withdraw(address token, uint256 amount, address to) returns() func (_MultiSend *MultiSendSession) Withdraw(token common.Address, amount *big.Int, to common.Address) (*types.Transaction, error) { return _MultiSend.Contract.Withdraw(&_MultiSend.TransactOpts, token, amount, to) } // Withdraw is a paid mutator transaction binding the contract method 0x69328dec. // // Solidity: function withdraw(address token, uint256 amount, address to) returns() func (_MultiSend *MultiSendTransactorSession) Withdraw(token common.Address, amount *big.Int, to common.Address) (*types.Transaction, error) { return _MultiSend.Contract.Withdraw(&_MultiSend.TransactOpts, token, amount, to) } // Receive is a paid mutator transaction binding the contract receive function. // // Solidity: receive() payable returns() func (_MultiSend *MultiSendTransactor) Receive(opts *bind.TransactOpts) (*types.Transaction, error) { return _MultiSend.contract.RawTransact(opts, nil) // calldata is disallowed for receive function } // Receive is a paid mutator transaction binding the contract receive function. // // Solidity: receive() payable returns() func (_MultiSend *MultiSendSession) Receive() (*types.Transaction, error) { return _MultiSend.Contract.Receive(&_MultiSend.TransactOpts) } // Receive is a paid mutator transaction binding the contract receive function. // // Solidity: receive() payable returns() func (_MultiSend *MultiSendTransactorSession) Receive() (*types.Transaction, error) { return _MultiSend.Contract.Receive(&_MultiSend.TransactOpts) } // MultiSendOwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the MultiSend contract. type MultiSendOwnershipTransferredIterator struct { Event *MultiSendOwnershipTransferred // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *MultiSendOwnershipTransferredIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(MultiSendOwnershipTransferred) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(MultiSendOwnershipTransferred) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *MultiSendOwnershipTransferredIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *MultiSendOwnershipTransferredIterator) Close() error { it.sub.Unsubscribe() return nil } // MultiSendOwnershipTransferred represents a OwnershipTransferred event raised by the MultiSend contract. type MultiSendOwnershipTransferred struct { PreviousOwner common.Address NewOwner common.Address Raw types.Log // Blockchain specific contextual infos } // FilterOwnershipTransferred is a free log retrieval operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. // // Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) func (_MultiSend *MultiSendFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*MultiSendOwnershipTransferredIterator, error) { var previousOwnerRule []interface{} for _, previousOwnerItem := range previousOwner { previousOwnerRule = append(previousOwnerRule, previousOwnerItem) } var newOwnerRule []interface{} for _, newOwnerItem := range newOwner { newOwnerRule = append(newOwnerRule, newOwnerItem) } logs, sub, err := _MultiSend.contract.FilterLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) if err != nil { return nil, err } return &MultiSendOwnershipTransferredIterator{contract: _MultiSend.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil } // WatchOwnershipTransferred is a free log subscription operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. // // Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) func (_MultiSend *MultiSendFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *MultiSendOwnershipTransferred, previousOwner []common.Address, newOwner []common.Address) (event.Subscription, error) { var previousOwnerRule []interface{} for _, previousOwnerItem := range previousOwner { previousOwnerRule = append(previousOwnerRule, previousOwnerItem) } var newOwnerRule []interface{} for _, newOwnerItem := range newOwner { newOwnerRule = append(newOwnerRule, newOwnerItem) } logs, sub, err := _MultiSend.contract.WatchLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(MultiSendOwnershipTransferred) if err := _MultiSend.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseOwnershipTransferred is a log parse operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. // // Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) func (_MultiSend *MultiSendFilterer) ParseOwnershipTransferred(log types.Log) (*MultiSendOwnershipTransferred, error) { event := new(MultiSendOwnershipTransferred) if err := _MultiSend.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { return nil, err } event.Raw = log return event, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/binds/orderpayment/OrderPayment.go ================================================ // Code generated - DO NOT EDIT. // This file is a generated binding and any manual changes will be lost. package orderpayment import ( "errors" "math/big" "strings" ethereum "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/event" ) // Reference imports to suppress errors if they are not otherwise used. var ( _ = errors.New _ = big.NewInt _ = strings.NewReader _ = ethereum.NotFound _ = bind.Bind _ = common.Big1 _ = types.BloomLookup _ = event.NewSubscription _ = abi.ConvertType ) // OrderpaymentMetaData contains all meta data concerning the Orderpayment contract. var OrderpaymentMetaData = &bind.MetaData{ ABI: "[{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"orderId\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"buyer\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"seller\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"OrderPaid\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"baseToken\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getChainId\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_baseToken\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes[]\",\"name\":\"data\",\"type\":\"bytes[]\"}],\"name\":\"multicall\",\"outputs\":[{\"internalType\":\"bytes[]\",\"name\":\"results\",\"type\":\"bytes[]\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"orderIds\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"orderId\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"seller\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"payOrder\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", } // OrderpaymentABI is the input ABI used to generate the binding from. // Deprecated: Use OrderpaymentMetaData.ABI instead. var OrderpaymentABI = OrderpaymentMetaData.ABI // Orderpayment is an auto generated Go binding around an Ethereum contract. type Orderpayment struct { OrderpaymentCaller // Read-only binding to the contract OrderpaymentTransactor // Write-only binding to the contract OrderpaymentFilterer // Log filterer for contract events } // OrderpaymentCaller is an auto generated read-only Go binding around an Ethereum contract. type OrderpaymentCaller struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // OrderpaymentTransactor is an auto generated write-only Go binding around an Ethereum contract. type OrderpaymentTransactor struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // OrderpaymentFilterer is an auto generated log filtering Go binding around an Ethereum contract events. type OrderpaymentFilterer struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // OrderpaymentSession is an auto generated Go binding around an Ethereum contract, // with pre-set call and transact options. type OrderpaymentSession struct { Contract *Orderpayment // Generic contract binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // OrderpaymentCallerSession is an auto generated read-only Go binding around an Ethereum contract, // with pre-set call options. type OrderpaymentCallerSession struct { Contract *OrderpaymentCaller // Generic contract caller binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session } // OrderpaymentTransactorSession is an auto generated write-only Go binding around an Ethereum contract, // with pre-set transact options. type OrderpaymentTransactorSession struct { Contract *OrderpaymentTransactor // Generic contract transactor binding to set the session for TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // OrderpaymentRaw is an auto generated low-level Go binding around an Ethereum contract. type OrderpaymentRaw struct { Contract *Orderpayment // Generic contract binding to access the raw methods on } // OrderpaymentCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. type OrderpaymentCallerRaw struct { Contract *OrderpaymentCaller // Generic read-only contract binding to access the raw methods on } // OrderpaymentTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. type OrderpaymentTransactorRaw struct { Contract *OrderpaymentTransactor // Generic write-only contract binding to access the raw methods on } // NewOrderpayment creates a new instance of Orderpayment, bound to a specific deployed contract. func NewOrderpayment(address common.Address, backend bind.ContractBackend) (*Orderpayment, error) { contract, err := bindOrderpayment(address, backend, backend, backend) if err != nil { return nil, err } return &Orderpayment{OrderpaymentCaller: OrderpaymentCaller{contract: contract}, OrderpaymentTransactor: OrderpaymentTransactor{contract: contract}, OrderpaymentFilterer: OrderpaymentFilterer{contract: contract}}, nil } // NewOrderpaymentCaller creates a new read-only instance of Orderpayment, bound to a specific deployed contract. func NewOrderpaymentCaller(address common.Address, caller bind.ContractCaller) (*OrderpaymentCaller, error) { contract, err := bindOrderpayment(address, caller, nil, nil) if err != nil { return nil, err } return &OrderpaymentCaller{contract: contract}, nil } // NewOrderpaymentTransactor creates a new write-only instance of Orderpayment, bound to a specific deployed contract. func NewOrderpaymentTransactor(address common.Address, transactor bind.ContractTransactor) (*OrderpaymentTransactor, error) { contract, err := bindOrderpayment(address, nil, transactor, nil) if err != nil { return nil, err } return &OrderpaymentTransactor{contract: contract}, nil } // NewOrderpaymentFilterer creates a new log filterer instance of Orderpayment, bound to a specific deployed contract. func NewOrderpaymentFilterer(address common.Address, filterer bind.ContractFilterer) (*OrderpaymentFilterer, error) { contract, err := bindOrderpayment(address, nil, nil, filterer) if err != nil { return nil, err } return &OrderpaymentFilterer{contract: contract}, nil } // bindOrderpayment binds a generic wrapper to an already deployed contract. func bindOrderpayment(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { parsed, err := OrderpaymentMetaData.GetAbi() if err != nil { return nil, err } return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_Orderpayment *OrderpaymentRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _Orderpayment.Contract.OrderpaymentCaller.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_Orderpayment *OrderpaymentRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _Orderpayment.Contract.OrderpaymentTransactor.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_Orderpayment *OrderpaymentRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _Orderpayment.Contract.OrderpaymentTransactor.contract.Transact(opts, method, params...) } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_Orderpayment *OrderpaymentCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _Orderpayment.Contract.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_Orderpayment *OrderpaymentTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _Orderpayment.Contract.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_Orderpayment *OrderpaymentTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _Orderpayment.Contract.contract.Transact(opts, method, params...) } // BaseToken is a free data retrieval call binding the contract method 0xc55dae63. // // Solidity: function baseToken() view returns(address) func (_Orderpayment *OrderpaymentCaller) BaseToken(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _Orderpayment.contract.Call(opts, &out, "baseToken") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // BaseToken is a free data retrieval call binding the contract method 0xc55dae63. // // Solidity: function baseToken() view returns(address) func (_Orderpayment *OrderpaymentSession) BaseToken() (common.Address, error) { return _Orderpayment.Contract.BaseToken(&_Orderpayment.CallOpts) } // BaseToken is a free data retrieval call binding the contract method 0xc55dae63. // // Solidity: function baseToken() view returns(address) func (_Orderpayment *OrderpaymentCallerSession) BaseToken() (common.Address, error) { return _Orderpayment.Contract.BaseToken(&_Orderpayment.CallOpts) } // GetChainId is a free data retrieval call binding the contract method 0x3408e470. // // Solidity: function getChainId() view returns(uint256 chainId) func (_Orderpayment *OrderpaymentCaller) GetChainId(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} err := _Orderpayment.contract.Call(opts, &out, "getChainId") if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // GetChainId is a free data retrieval call binding the contract method 0x3408e470. // // Solidity: function getChainId() view returns(uint256 chainId) func (_Orderpayment *OrderpaymentSession) GetChainId() (*big.Int, error) { return _Orderpayment.Contract.GetChainId(&_Orderpayment.CallOpts) } // GetChainId is a free data retrieval call binding the contract method 0x3408e470. // // Solidity: function getChainId() view returns(uint256 chainId) func (_Orderpayment *OrderpaymentCallerSession) GetChainId() (*big.Int, error) { return _Orderpayment.Contract.GetChainId(&_Orderpayment.CallOpts) } // OrderIds is a free data retrieval call binding the contract method 0xf13886ec. // // Solidity: function orderIds(bytes32 ) view returns(bool) func (_Orderpayment *OrderpaymentCaller) OrderIds(opts *bind.CallOpts, arg0 [32]byte) (bool, error) { var out []interface{} err := _Orderpayment.contract.Call(opts, &out, "orderIds", arg0) if err != nil { return *new(bool), err } out0 := *abi.ConvertType(out[0], new(bool)).(*bool) return out0, err } // OrderIds is a free data retrieval call binding the contract method 0xf13886ec. // // Solidity: function orderIds(bytes32 ) view returns(bool) func (_Orderpayment *OrderpaymentSession) OrderIds(arg0 [32]byte) (bool, error) { return _Orderpayment.Contract.OrderIds(&_Orderpayment.CallOpts, arg0) } // OrderIds is a free data retrieval call binding the contract method 0xf13886ec. // // Solidity: function orderIds(bytes32 ) view returns(bool) func (_Orderpayment *OrderpaymentCallerSession) OrderIds(arg0 [32]byte) (bool, error) { return _Orderpayment.Contract.OrderIds(&_Orderpayment.CallOpts, arg0) } // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. // // Solidity: function owner() view returns(address) func (_Orderpayment *OrderpaymentCaller) Owner(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _Orderpayment.contract.Call(opts, &out, "owner") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. // // Solidity: function owner() view returns(address) func (_Orderpayment *OrderpaymentSession) Owner() (common.Address, error) { return _Orderpayment.Contract.Owner(&_Orderpayment.CallOpts) } // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. // // Solidity: function owner() view returns(address) func (_Orderpayment *OrderpaymentCallerSession) Owner() (common.Address, error) { return _Orderpayment.Contract.Owner(&_Orderpayment.CallOpts) } // Initialize is a paid mutator transaction binding the contract method 0xc4d66de8. // // Solidity: function initialize(address _baseToken) returns() func (_Orderpayment *OrderpaymentTransactor) Initialize(opts *bind.TransactOpts, _baseToken common.Address) (*types.Transaction, error) { return _Orderpayment.contract.Transact(opts, "initialize", _baseToken) } // Initialize is a paid mutator transaction binding the contract method 0xc4d66de8. // // Solidity: function initialize(address _baseToken) returns() func (_Orderpayment *OrderpaymentSession) Initialize(_baseToken common.Address) (*types.Transaction, error) { return _Orderpayment.Contract.Initialize(&_Orderpayment.TransactOpts, _baseToken) } // Initialize is a paid mutator transaction binding the contract method 0xc4d66de8. // // Solidity: function initialize(address _baseToken) returns() func (_Orderpayment *OrderpaymentTransactorSession) Initialize(_baseToken common.Address) (*types.Transaction, error) { return _Orderpayment.Contract.Initialize(&_Orderpayment.TransactOpts, _baseToken) } // Multicall is a paid mutator transaction binding the contract method 0xac9650d8. // // Solidity: function multicall(bytes[] data) payable returns(bytes[] results) func (_Orderpayment *OrderpaymentTransactor) Multicall(opts *bind.TransactOpts, data [][]byte) (*types.Transaction, error) { return _Orderpayment.contract.Transact(opts, "multicall", data) } // Multicall is a paid mutator transaction binding the contract method 0xac9650d8. // // Solidity: function multicall(bytes[] data) payable returns(bytes[] results) func (_Orderpayment *OrderpaymentSession) Multicall(data [][]byte) (*types.Transaction, error) { return _Orderpayment.Contract.Multicall(&_Orderpayment.TransactOpts, data) } // Multicall is a paid mutator transaction binding the contract method 0xac9650d8. // // Solidity: function multicall(bytes[] data) payable returns(bytes[] results) func (_Orderpayment *OrderpaymentTransactorSession) Multicall(data [][]byte) (*types.Transaction, error) { return _Orderpayment.Contract.Multicall(&_Orderpayment.TransactOpts, data) } // PayOrder is a paid mutator transaction binding the contract method 0x7473df4c. // // Solidity: function payOrder(bytes32 orderId, address seller, uint256 amount) returns() func (_Orderpayment *OrderpaymentTransactor) PayOrder(opts *bind.TransactOpts, orderId [32]byte, seller common.Address, amount *big.Int) (*types.Transaction, error) { return _Orderpayment.contract.Transact(opts, "payOrder", orderId, seller, amount) } // PayOrder is a paid mutator transaction binding the contract method 0x7473df4c. // // Solidity: function payOrder(bytes32 orderId, address seller, uint256 amount) returns() func (_Orderpayment *OrderpaymentSession) PayOrder(orderId [32]byte, seller common.Address, amount *big.Int) (*types.Transaction, error) { return _Orderpayment.Contract.PayOrder(&_Orderpayment.TransactOpts, orderId, seller, amount) } // PayOrder is a paid mutator transaction binding the contract method 0x7473df4c. // // Solidity: function payOrder(bytes32 orderId, address seller, uint256 amount) returns() func (_Orderpayment *OrderpaymentTransactorSession) PayOrder(orderId [32]byte, seller common.Address, amount *big.Int) (*types.Transaction, error) { return _Orderpayment.Contract.PayOrder(&_Orderpayment.TransactOpts, orderId, seller, amount) } // RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. // // Solidity: function renounceOwnership() returns() func (_Orderpayment *OrderpaymentTransactor) RenounceOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { return _Orderpayment.contract.Transact(opts, "renounceOwnership") } // RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. // // Solidity: function renounceOwnership() returns() func (_Orderpayment *OrderpaymentSession) RenounceOwnership() (*types.Transaction, error) { return _Orderpayment.Contract.RenounceOwnership(&_Orderpayment.TransactOpts) } // RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. // // Solidity: function renounceOwnership() returns() func (_Orderpayment *OrderpaymentTransactorSession) RenounceOwnership() (*types.Transaction, error) { return _Orderpayment.Contract.RenounceOwnership(&_Orderpayment.TransactOpts) } // TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. // // Solidity: function transferOwnership(address newOwner) returns() func (_Orderpayment *OrderpaymentTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) { return _Orderpayment.contract.Transact(opts, "transferOwnership", newOwner) } // TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. // // Solidity: function transferOwnership(address newOwner) returns() func (_Orderpayment *OrderpaymentSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { return _Orderpayment.Contract.TransferOwnership(&_Orderpayment.TransactOpts, newOwner) } // TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. // // Solidity: function transferOwnership(address newOwner) returns() func (_Orderpayment *OrderpaymentTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { return _Orderpayment.Contract.TransferOwnership(&_Orderpayment.TransactOpts, newOwner) } // OrderpaymentInitializedIterator is returned from FilterInitialized and is used to iterate over the raw logs and unpacked data for Initialized events raised by the Orderpayment contract. type OrderpaymentInitializedIterator struct { Event *OrderpaymentInitialized // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *OrderpaymentInitializedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(OrderpaymentInitialized) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(OrderpaymentInitialized) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *OrderpaymentInitializedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *OrderpaymentInitializedIterator) Close() error { it.sub.Unsubscribe() return nil } // OrderpaymentInitialized represents a Initialized event raised by the Orderpayment contract. type OrderpaymentInitialized struct { Version uint8 Raw types.Log // Blockchain specific contextual infos } // FilterInitialized is a free log retrieval operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. // // Solidity: event Initialized(uint8 version) func (_Orderpayment *OrderpaymentFilterer) FilterInitialized(opts *bind.FilterOpts) (*OrderpaymentInitializedIterator, error) { logs, sub, err := _Orderpayment.contract.FilterLogs(opts, "Initialized") if err != nil { return nil, err } return &OrderpaymentInitializedIterator{contract: _Orderpayment.contract, event: "Initialized", logs: logs, sub: sub}, nil } // WatchInitialized is a free log subscription operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. // // Solidity: event Initialized(uint8 version) func (_Orderpayment *OrderpaymentFilterer) WatchInitialized(opts *bind.WatchOpts, sink chan<- *OrderpaymentInitialized) (event.Subscription, error) { logs, sub, err := _Orderpayment.contract.WatchLogs(opts, "Initialized") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(OrderpaymentInitialized) if err := _Orderpayment.contract.UnpackLog(event, "Initialized", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseInitialized is a log parse operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. // // Solidity: event Initialized(uint8 version) func (_Orderpayment *OrderpaymentFilterer) ParseInitialized(log types.Log) (*OrderpaymentInitialized, error) { event := new(OrderpaymentInitialized) if err := _Orderpayment.contract.UnpackLog(event, "Initialized", log); err != nil { return nil, err } event.Raw = log return event, nil } // OrderpaymentOrderPaidIterator is returned from FilterOrderPaid and is used to iterate over the raw logs and unpacked data for OrderPaid events raised by the Orderpayment contract. type OrderpaymentOrderPaidIterator struct { Event *OrderpaymentOrderPaid // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *OrderpaymentOrderPaidIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(OrderpaymentOrderPaid) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(OrderpaymentOrderPaid) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *OrderpaymentOrderPaidIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *OrderpaymentOrderPaidIterator) Close() error { it.sub.Unsubscribe() return nil } // OrderpaymentOrderPaid represents a OrderPaid event raised by the Orderpayment contract. type OrderpaymentOrderPaid struct { OrderId [32]byte Buyer common.Address Seller common.Address Amount *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterOrderPaid is a free log retrieval operation binding the contract event 0xc2522570932e6dff27df2e5c31cfd70be3653d564375e29575d4360aafca4eb5. // // Solidity: event OrderPaid(bytes32 indexed orderId, address indexed buyer, address indexed seller, uint256 amount) func (_Orderpayment *OrderpaymentFilterer) FilterOrderPaid(opts *bind.FilterOpts, orderId [][32]byte, buyer []common.Address, seller []common.Address) (*OrderpaymentOrderPaidIterator, error) { var orderIdRule []interface{} for _, orderIdItem := range orderId { orderIdRule = append(orderIdRule, orderIdItem) } var buyerRule []interface{} for _, buyerItem := range buyer { buyerRule = append(buyerRule, buyerItem) } var sellerRule []interface{} for _, sellerItem := range seller { sellerRule = append(sellerRule, sellerItem) } logs, sub, err := _Orderpayment.contract.FilterLogs(opts, "OrderPaid", orderIdRule, buyerRule, sellerRule) if err != nil { return nil, err } return &OrderpaymentOrderPaidIterator{contract: _Orderpayment.contract, event: "OrderPaid", logs: logs, sub: sub}, nil } // WatchOrderPaid is a free log subscription operation binding the contract event 0xc2522570932e6dff27df2e5c31cfd70be3653d564375e29575d4360aafca4eb5. // // Solidity: event OrderPaid(bytes32 indexed orderId, address indexed buyer, address indexed seller, uint256 amount) func (_Orderpayment *OrderpaymentFilterer) WatchOrderPaid(opts *bind.WatchOpts, sink chan<- *OrderpaymentOrderPaid, orderId [][32]byte, buyer []common.Address, seller []common.Address) (event.Subscription, error) { var orderIdRule []interface{} for _, orderIdItem := range orderId { orderIdRule = append(orderIdRule, orderIdItem) } var buyerRule []interface{} for _, buyerItem := range buyer { buyerRule = append(buyerRule, buyerItem) } var sellerRule []interface{} for _, sellerItem := range seller { sellerRule = append(sellerRule, sellerItem) } logs, sub, err := _Orderpayment.contract.WatchLogs(opts, "OrderPaid", orderIdRule, buyerRule, sellerRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(OrderpaymentOrderPaid) if err := _Orderpayment.contract.UnpackLog(event, "OrderPaid", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseOrderPaid is a log parse operation binding the contract event 0xc2522570932e6dff27df2e5c31cfd70be3653d564375e29575d4360aafca4eb5. // // Solidity: event OrderPaid(bytes32 indexed orderId, address indexed buyer, address indexed seller, uint256 amount) func (_Orderpayment *OrderpaymentFilterer) ParseOrderPaid(log types.Log) (*OrderpaymentOrderPaid, error) { event := new(OrderpaymentOrderPaid) if err := _Orderpayment.contract.UnpackLog(event, "OrderPaid", log); err != nil { return nil, err } event.Raw = log return event, nil } // OrderpaymentOwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the Orderpayment contract. type OrderpaymentOwnershipTransferredIterator struct { Event *OrderpaymentOwnershipTransferred // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *OrderpaymentOwnershipTransferredIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(OrderpaymentOwnershipTransferred) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(OrderpaymentOwnershipTransferred) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *OrderpaymentOwnershipTransferredIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *OrderpaymentOwnershipTransferredIterator) Close() error { it.sub.Unsubscribe() return nil } // OrderpaymentOwnershipTransferred represents a OwnershipTransferred event raised by the Orderpayment contract. type OrderpaymentOwnershipTransferred struct { PreviousOwner common.Address NewOwner common.Address Raw types.Log // Blockchain specific contextual infos } // FilterOwnershipTransferred is a free log retrieval operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. // // Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) func (_Orderpayment *OrderpaymentFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*OrderpaymentOwnershipTransferredIterator, error) { var previousOwnerRule []interface{} for _, previousOwnerItem := range previousOwner { previousOwnerRule = append(previousOwnerRule, previousOwnerItem) } var newOwnerRule []interface{} for _, newOwnerItem := range newOwner { newOwnerRule = append(newOwnerRule, newOwnerItem) } logs, sub, err := _Orderpayment.contract.FilterLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) if err != nil { return nil, err } return &OrderpaymentOwnershipTransferredIterator{contract: _Orderpayment.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil } // WatchOwnershipTransferred is a free log subscription operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. // // Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) func (_Orderpayment *OrderpaymentFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *OrderpaymentOwnershipTransferred, previousOwner []common.Address, newOwner []common.Address) (event.Subscription, error) { var previousOwnerRule []interface{} for _, previousOwnerItem := range previousOwner { previousOwnerRule = append(previousOwnerRule, previousOwnerItem) } var newOwnerRule []interface{} for _, newOwnerItem := range newOwner { newOwnerRule = append(newOwnerRule, newOwnerItem) } logs, sub, err := _Orderpayment.contract.WatchLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(OrderpaymentOwnershipTransferred) if err := _Orderpayment.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseOwnershipTransferred is a log parse operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. // // Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) func (_Orderpayment *OrderpaymentFilterer) ParseOwnershipTransferred(log types.Log) (*OrderpaymentOwnershipTransferred, error) { event := new(OrderpaymentOwnershipTransferred) if err := _Orderpayment.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { return nil, err } event.Raw = log return event, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/binds/orderpayment/abi.json ================================================ [ { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "uint8", "name": "version", "type": "uint8" } ], "name": "Initialized", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "bytes32", "name": "orderId", "type": "bytes32" }, { "indexed": true, "internalType": "address", "name": "buyer", "type": "address" }, { "indexed": true, "internalType": "address", "name": "seller", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" } ], "name": "OrderPaid", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "previousOwner", "type": "address" }, { "indexed": true, "internalType": "address", "name": "newOwner", "type": "address" } ], "name": "OwnershipTransferred", "type": "event" }, { "inputs": [], "name": "baseToken", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "getChainId", "outputs": [ { "internalType": "uint256", "name": "chainId", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "_baseToken", "type": "address" } ], "name": "initialize", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "bytes[]", "name": "data", "type": "bytes[]" } ], "name": "multicall", "outputs": [ { "internalType": "bytes[]", "name": "results", "type": "bytes[]" } ], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "bytes32", "name": "", "type": "bytes32" } ], "name": "orderIds", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "owner", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "bytes32", "name": "orderId", "type": "bytes32" }, { "internalType": "address", "name": "seller", "type": "address" }, { "internalType": "uint256", "name": "amount", "type": "uint256" } ], "name": "payOrder", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "renounceOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "newOwner", "type": "address" } ], "name": "transferOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" } ] ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/binds/polygonnonfungiblepositionmanager/NonfungiblePositionManager.go ================================================ // Code generated - DO NOT EDIT. // This file is a generated binding and any manual changes will be lost. package polygonnonfungiblepositionmanager import ( "errors" "math/big" "strings" ethereum "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/event" ) // Reference imports to suppress errors if they are not otherwise used. var ( _ = errors.New _ = big.NewInt _ = strings.NewReader _ = ethereum.NotFound _ = bind.Bind _ = common.Big1 _ = types.BloomLookup _ = event.NewSubscription _ = abi.ConvertType ) // INonfungiblePositionManagerCollectParams is an auto generated low-level Go binding around an user-defined struct. type INonfungiblePositionManagerCollectParams struct { TokenId *big.Int Recipient common.Address Amount0Max *big.Int Amount1Max *big.Int } // INonfungiblePositionManagerDecreaseLiquidityParams is an auto generated low-level Go binding around an user-defined struct. type INonfungiblePositionManagerDecreaseLiquidityParams struct { TokenId *big.Int Liquidity *big.Int Amount0Min *big.Int Amount1Min *big.Int Deadline *big.Int } // INonfungiblePositionManagerIncreaseLiquidityParams is an auto generated low-level Go binding around an user-defined struct. type INonfungiblePositionManagerIncreaseLiquidityParams struct { TokenId *big.Int Amount0Desired *big.Int Amount1Desired *big.Int Amount0Min *big.Int Amount1Min *big.Int Deadline *big.Int } // INonfungiblePositionManagerMintParams is an auto generated low-level Go binding around an user-defined struct. type INonfungiblePositionManagerMintParams struct { Token0 common.Address Token1 common.Address Fee *big.Int TickLower *big.Int TickUpper *big.Int Amount0Desired *big.Int Amount1Desired *big.Int Amount0Min *big.Int Amount1Min *big.Int Recipient common.Address Deadline *big.Int } // NonfungiblePositionManagerMetaData contains all meta data concerning the NonfungiblePositionManager contract. var NonfungiblePositionManagerMetaData = &bind.MetaData{ ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_factory\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_WETH9\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_tokenDescriptor_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"approved\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"ApprovalForAll\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"}],\"name\":\"Collect\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"liquidity\",\"type\":\"uint128\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"}],\"name\":\"DecreaseLiquidity\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"liquidity\",\"type\":\"uint128\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"}],\"name\":\"IncreaseLiquidity\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"DOMAIN_SEPARATOR\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"PERMIT_TYPEHASH\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"WETH9\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"baseURI\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"burn\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint128\",\"name\":\"amount0Max\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"amount1Max\",\"type\":\"uint128\"}],\"internalType\":\"structINonfungiblePositionManager.CollectParams\",\"name\":\"params\",\"type\":\"tuple\"}],\"name\":\"collect\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token0\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token1\",\"type\":\"address\"},{\"internalType\":\"uint24\",\"name\":\"fee\",\"type\":\"uint24\"},{\"internalType\":\"uint160\",\"name\":\"sqrtPriceX96\",\"type\":\"uint160\"}],\"name\":\"createAndInitializePoolIfNecessary\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint128\",\"name\":\"liquidity\",\"type\":\"uint128\"},{\"internalType\":\"uint256\",\"name\":\"amount0Min\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Min\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"}],\"internalType\":\"structINonfungiblePositionManager.DecreaseLiquidityParams\",\"name\":\"params\",\"type\":\"tuple\"}],\"name\":\"decreaseLiquidity\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"factory\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"getApproved\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount0Desired\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Desired\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount0Min\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Min\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"}],\"internalType\":\"structINonfungiblePositionManager.IncreaseLiquidityParams\",\"name\":\"params\",\"type\":\"tuple\"}],\"name\":\"increaseLiquidity\",\"outputs\":[{\"internalType\":\"uint128\",\"name\":\"liquidity\",\"type\":\"uint128\"},{\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"name\":\"isApprovedForAll\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"token0\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token1\",\"type\":\"address\"},{\"internalType\":\"uint24\",\"name\":\"fee\",\"type\":\"uint24\"},{\"internalType\":\"int24\",\"name\":\"tickLower\",\"type\":\"int24\"},{\"internalType\":\"int24\",\"name\":\"tickUpper\",\"type\":\"int24\"},{\"internalType\":\"uint256\",\"name\":\"amount0Desired\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Desired\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount0Min\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Min\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"}],\"internalType\":\"structINonfungiblePositionManager.MintParams\",\"name\":\"params\",\"type\":\"tuple\"}],\"name\":\"mint\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint128\",\"name\":\"liquidity\",\"type\":\"uint128\"},{\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes[]\",\"name\":\"data\",\"type\":\"bytes[]\"}],\"name\":\"multicall\",\"outputs\":[{\"internalType\":\"bytes[]\",\"name\":\"results\",\"type\":\"bytes[]\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"ownerOf\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"permit\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"positions\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"nonce\",\"type\":\"uint96\"},{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token0\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token1\",\"type\":\"address\"},{\"internalType\":\"uint24\",\"name\":\"fee\",\"type\":\"uint24\"},{\"internalType\":\"int24\",\"name\":\"tickLower\",\"type\":\"int24\"},{\"internalType\":\"int24\",\"name\":\"tickUpper\",\"type\":\"int24\"},{\"internalType\":\"uint128\",\"name\":\"liquidity\",\"type\":\"uint128\"},{\"internalType\":\"uint256\",\"name\":\"feeGrowthInside0LastX128\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"feeGrowthInside1LastX128\",\"type\":\"uint256\"},{\"internalType\":\"uint128\",\"name\":\"tokensOwed0\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"tokensOwed1\",\"type\":\"uint128\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"refundETH\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"safeTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"safeTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"selfPermit\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiry\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"selfPermitAllowed\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiry\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"selfPermitAllowedIfNecessary\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"selfPermitIfNecessary\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"setApprovalForAll\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amountMinimum\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"}],\"name\":\"sweepToken\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"}],\"name\":\"tokenByIndex\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"}],\"name\":\"tokenOfOwnerByIndex\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"tokenURI\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0Owed\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Owed\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"uniswapV3MintCallback\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountMinimum\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"}],\"name\":\"unwrapWETH9\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]", } // NonfungiblePositionManagerABI is the input ABI used to generate the binding from. // Deprecated: Use NonfungiblePositionManagerMetaData.ABI instead. var NonfungiblePositionManagerABI = NonfungiblePositionManagerMetaData.ABI // NonfungiblePositionManager is an auto generated Go binding around an Ethereum contract. type NonfungiblePositionManager struct { NonfungiblePositionManagerCaller // Read-only binding to the contract NonfungiblePositionManagerTransactor // Write-only binding to the contract NonfungiblePositionManagerFilterer // Log filterer for contract events } // NonfungiblePositionManagerCaller is an auto generated read-only Go binding around an Ethereum contract. type NonfungiblePositionManagerCaller struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // NonfungiblePositionManagerTransactor is an auto generated write-only Go binding around an Ethereum contract. type NonfungiblePositionManagerTransactor struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // NonfungiblePositionManagerFilterer is an auto generated log filtering Go binding around an Ethereum contract events. type NonfungiblePositionManagerFilterer struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // NonfungiblePositionManagerSession is an auto generated Go binding around an Ethereum contract, // with pre-set call and transact options. type NonfungiblePositionManagerSession struct { Contract *NonfungiblePositionManager // Generic contract binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // NonfungiblePositionManagerCallerSession is an auto generated read-only Go binding around an Ethereum contract, // with pre-set call options. type NonfungiblePositionManagerCallerSession struct { Contract *NonfungiblePositionManagerCaller // Generic contract caller binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session } // NonfungiblePositionManagerTransactorSession is an auto generated write-only Go binding around an Ethereum contract, // with pre-set transact options. type NonfungiblePositionManagerTransactorSession struct { Contract *NonfungiblePositionManagerTransactor // Generic contract transactor binding to set the session for TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // NonfungiblePositionManagerRaw is an auto generated low-level Go binding around an Ethereum contract. type NonfungiblePositionManagerRaw struct { Contract *NonfungiblePositionManager // Generic contract binding to access the raw methods on } // NonfungiblePositionManagerCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. type NonfungiblePositionManagerCallerRaw struct { Contract *NonfungiblePositionManagerCaller // Generic read-only contract binding to access the raw methods on } // NonfungiblePositionManagerTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. type NonfungiblePositionManagerTransactorRaw struct { Contract *NonfungiblePositionManagerTransactor // Generic write-only contract binding to access the raw methods on } // NewNonfungiblePositionManager creates a new instance of NonfungiblePositionManager, bound to a specific deployed contract. func NewNonfungiblePositionManager(address common.Address, backend bind.ContractBackend) (*NonfungiblePositionManager, error) { contract, err := bindNonfungiblePositionManager(address, backend, backend, backend) if err != nil { return nil, err } return &NonfungiblePositionManager{NonfungiblePositionManagerCaller: NonfungiblePositionManagerCaller{contract: contract}, NonfungiblePositionManagerTransactor: NonfungiblePositionManagerTransactor{contract: contract}, NonfungiblePositionManagerFilterer: NonfungiblePositionManagerFilterer{contract: contract}}, nil } // NewNonfungiblePositionManagerCaller creates a new read-only instance of NonfungiblePositionManager, bound to a specific deployed contract. func NewNonfungiblePositionManagerCaller(address common.Address, caller bind.ContractCaller) (*NonfungiblePositionManagerCaller, error) { contract, err := bindNonfungiblePositionManager(address, caller, nil, nil) if err != nil { return nil, err } return &NonfungiblePositionManagerCaller{contract: contract}, nil } // NewNonfungiblePositionManagerTransactor creates a new write-only instance of NonfungiblePositionManager, bound to a specific deployed contract. func NewNonfungiblePositionManagerTransactor(address common.Address, transactor bind.ContractTransactor) (*NonfungiblePositionManagerTransactor, error) { contract, err := bindNonfungiblePositionManager(address, nil, transactor, nil) if err != nil { return nil, err } return &NonfungiblePositionManagerTransactor{contract: contract}, nil } // NewNonfungiblePositionManagerFilterer creates a new log filterer instance of NonfungiblePositionManager, bound to a specific deployed contract. func NewNonfungiblePositionManagerFilterer(address common.Address, filterer bind.ContractFilterer) (*NonfungiblePositionManagerFilterer, error) { contract, err := bindNonfungiblePositionManager(address, nil, nil, filterer) if err != nil { return nil, err } return &NonfungiblePositionManagerFilterer{contract: contract}, nil } // bindNonfungiblePositionManager binds a generic wrapper to an already deployed contract. func bindNonfungiblePositionManager(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { parsed, err := NonfungiblePositionManagerMetaData.GetAbi() if err != nil { return nil, err } return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_NonfungiblePositionManager *NonfungiblePositionManagerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _NonfungiblePositionManager.Contract.NonfungiblePositionManagerCaller.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_NonfungiblePositionManager *NonfungiblePositionManagerRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.NonfungiblePositionManagerTransactor.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_NonfungiblePositionManager *NonfungiblePositionManagerRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.NonfungiblePositionManagerTransactor.contract.Transact(opts, method, params...) } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _NonfungiblePositionManager.Contract.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.contract.Transact(opts, method, params...) } // DOMAINSEPARATOR is a free data retrieval call binding the contract method 0x3644e515. // // Solidity: function DOMAIN_SEPARATOR() view returns(bytes32) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) DOMAINSEPARATOR(opts *bind.CallOpts) ([32]byte, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "DOMAIN_SEPARATOR") if err != nil { return *new([32]byte), err } out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) return out0, err } // DOMAINSEPARATOR is a free data retrieval call binding the contract method 0x3644e515. // // Solidity: function DOMAIN_SEPARATOR() view returns(bytes32) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) DOMAINSEPARATOR() ([32]byte, error) { return _NonfungiblePositionManager.Contract.DOMAINSEPARATOR(&_NonfungiblePositionManager.CallOpts) } // DOMAINSEPARATOR is a free data retrieval call binding the contract method 0x3644e515. // // Solidity: function DOMAIN_SEPARATOR() view returns(bytes32) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) DOMAINSEPARATOR() ([32]byte, error) { return _NonfungiblePositionManager.Contract.DOMAINSEPARATOR(&_NonfungiblePositionManager.CallOpts) } // PERMITTYPEHASH is a free data retrieval call binding the contract method 0x30adf81f. // // Solidity: function PERMIT_TYPEHASH() view returns(bytes32) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) PERMITTYPEHASH(opts *bind.CallOpts) ([32]byte, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "PERMIT_TYPEHASH") if err != nil { return *new([32]byte), err } out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) return out0, err } // PERMITTYPEHASH is a free data retrieval call binding the contract method 0x30adf81f. // // Solidity: function PERMIT_TYPEHASH() view returns(bytes32) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) PERMITTYPEHASH() ([32]byte, error) { return _NonfungiblePositionManager.Contract.PERMITTYPEHASH(&_NonfungiblePositionManager.CallOpts) } // PERMITTYPEHASH is a free data retrieval call binding the contract method 0x30adf81f. // // Solidity: function PERMIT_TYPEHASH() view returns(bytes32) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) PERMITTYPEHASH() ([32]byte, error) { return _NonfungiblePositionManager.Contract.PERMITTYPEHASH(&_NonfungiblePositionManager.CallOpts) } // WETH9 is a free data retrieval call binding the contract method 0x4aa4a4fc. // // Solidity: function WETH9() view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) WETH9(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "WETH9") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // WETH9 is a free data retrieval call binding the contract method 0x4aa4a4fc. // // Solidity: function WETH9() view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) WETH9() (common.Address, error) { return _NonfungiblePositionManager.Contract.WETH9(&_NonfungiblePositionManager.CallOpts) } // WETH9 is a free data retrieval call binding the contract method 0x4aa4a4fc. // // Solidity: function WETH9() view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) WETH9() (common.Address, error) { return _NonfungiblePositionManager.Contract.WETH9(&_NonfungiblePositionManager.CallOpts) } // BalanceOf is a free data retrieval call binding the contract method 0x70a08231. // // Solidity: function balanceOf(address owner) view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) BalanceOf(opts *bind.CallOpts, owner common.Address) (*big.Int, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "balanceOf", owner) if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // BalanceOf is a free data retrieval call binding the contract method 0x70a08231. // // Solidity: function balanceOf(address owner) view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) BalanceOf(owner common.Address) (*big.Int, error) { return _NonfungiblePositionManager.Contract.BalanceOf(&_NonfungiblePositionManager.CallOpts, owner) } // BalanceOf is a free data retrieval call binding the contract method 0x70a08231. // // Solidity: function balanceOf(address owner) view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) BalanceOf(owner common.Address) (*big.Int, error) { return _NonfungiblePositionManager.Contract.BalanceOf(&_NonfungiblePositionManager.CallOpts, owner) } // BaseURI is a free data retrieval call binding the contract method 0x6c0360eb. // // Solidity: function baseURI() pure returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) BaseURI(opts *bind.CallOpts) (string, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "baseURI") if err != nil { return *new(string), err } out0 := *abi.ConvertType(out[0], new(string)).(*string) return out0, err } // BaseURI is a free data retrieval call binding the contract method 0x6c0360eb. // // Solidity: function baseURI() pure returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) BaseURI() (string, error) { return _NonfungiblePositionManager.Contract.BaseURI(&_NonfungiblePositionManager.CallOpts) } // BaseURI is a free data retrieval call binding the contract method 0x6c0360eb. // // Solidity: function baseURI() pure returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) BaseURI() (string, error) { return _NonfungiblePositionManager.Contract.BaseURI(&_NonfungiblePositionManager.CallOpts) } // Factory is a free data retrieval call binding the contract method 0xc45a0155. // // Solidity: function factory() view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) Factory(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "factory") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // Factory is a free data retrieval call binding the contract method 0xc45a0155. // // Solidity: function factory() view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Factory() (common.Address, error) { return _NonfungiblePositionManager.Contract.Factory(&_NonfungiblePositionManager.CallOpts) } // Factory is a free data retrieval call binding the contract method 0xc45a0155. // // Solidity: function factory() view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) Factory() (common.Address, error) { return _NonfungiblePositionManager.Contract.Factory(&_NonfungiblePositionManager.CallOpts) } // GetApproved is a free data retrieval call binding the contract method 0x081812fc. // // Solidity: function getApproved(uint256 tokenId) view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) GetApproved(opts *bind.CallOpts, tokenId *big.Int) (common.Address, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "getApproved", tokenId) if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // GetApproved is a free data retrieval call binding the contract method 0x081812fc. // // Solidity: function getApproved(uint256 tokenId) view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) GetApproved(tokenId *big.Int) (common.Address, error) { return _NonfungiblePositionManager.Contract.GetApproved(&_NonfungiblePositionManager.CallOpts, tokenId) } // GetApproved is a free data retrieval call binding the contract method 0x081812fc. // // Solidity: function getApproved(uint256 tokenId) view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) GetApproved(tokenId *big.Int) (common.Address, error) { return _NonfungiblePositionManager.Contract.GetApproved(&_NonfungiblePositionManager.CallOpts, tokenId) } // IsApprovedForAll is a free data retrieval call binding the contract method 0xe985e9c5. // // Solidity: function isApprovedForAll(address owner, address operator) view returns(bool) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) IsApprovedForAll(opts *bind.CallOpts, owner common.Address, operator common.Address) (bool, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "isApprovedForAll", owner, operator) if err != nil { return *new(bool), err } out0 := *abi.ConvertType(out[0], new(bool)).(*bool) return out0, err } // IsApprovedForAll is a free data retrieval call binding the contract method 0xe985e9c5. // // Solidity: function isApprovedForAll(address owner, address operator) view returns(bool) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) IsApprovedForAll(owner common.Address, operator common.Address) (bool, error) { return _NonfungiblePositionManager.Contract.IsApprovedForAll(&_NonfungiblePositionManager.CallOpts, owner, operator) } // IsApprovedForAll is a free data retrieval call binding the contract method 0xe985e9c5. // // Solidity: function isApprovedForAll(address owner, address operator) view returns(bool) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) IsApprovedForAll(owner common.Address, operator common.Address) (bool, error) { return _NonfungiblePositionManager.Contract.IsApprovedForAll(&_NonfungiblePositionManager.CallOpts, owner, operator) } // Name is a free data retrieval call binding the contract method 0x06fdde03. // // Solidity: function name() view returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) Name(opts *bind.CallOpts) (string, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "name") if err != nil { return *new(string), err } out0 := *abi.ConvertType(out[0], new(string)).(*string) return out0, err } // Name is a free data retrieval call binding the contract method 0x06fdde03. // // Solidity: function name() view returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Name() (string, error) { return _NonfungiblePositionManager.Contract.Name(&_NonfungiblePositionManager.CallOpts) } // Name is a free data retrieval call binding the contract method 0x06fdde03. // // Solidity: function name() view returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) Name() (string, error) { return _NonfungiblePositionManager.Contract.Name(&_NonfungiblePositionManager.CallOpts) } // OwnerOf is a free data retrieval call binding the contract method 0x6352211e. // // Solidity: function ownerOf(uint256 tokenId) view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) OwnerOf(opts *bind.CallOpts, tokenId *big.Int) (common.Address, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "ownerOf", tokenId) if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // OwnerOf is a free data retrieval call binding the contract method 0x6352211e. // // Solidity: function ownerOf(uint256 tokenId) view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) OwnerOf(tokenId *big.Int) (common.Address, error) { return _NonfungiblePositionManager.Contract.OwnerOf(&_NonfungiblePositionManager.CallOpts, tokenId) } // OwnerOf is a free data retrieval call binding the contract method 0x6352211e. // // Solidity: function ownerOf(uint256 tokenId) view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) OwnerOf(tokenId *big.Int) (common.Address, error) { return _NonfungiblePositionManager.Contract.OwnerOf(&_NonfungiblePositionManager.CallOpts, tokenId) } // Positions is a free data retrieval call binding the contract method 0x99fbab88. // // Solidity: function positions(uint256 tokenId) view returns(uint96 nonce, address operator, address token0, address token1, uint24 fee, int24 tickLower, int24 tickUpper, uint128 liquidity, uint256 feeGrowthInside0LastX128, uint256 feeGrowthInside1LastX128, uint128 tokensOwed0, uint128 tokensOwed1) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) Positions(opts *bind.CallOpts, tokenId *big.Int) (struct { Nonce *big.Int Operator common.Address Token0 common.Address Token1 common.Address Fee *big.Int TickLower *big.Int TickUpper *big.Int Liquidity *big.Int FeeGrowthInside0LastX128 *big.Int FeeGrowthInside1LastX128 *big.Int TokensOwed0 *big.Int TokensOwed1 *big.Int }, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "positions", tokenId) outstruct := new(struct { Nonce *big.Int Operator common.Address Token0 common.Address Token1 common.Address Fee *big.Int TickLower *big.Int TickUpper *big.Int Liquidity *big.Int FeeGrowthInside0LastX128 *big.Int FeeGrowthInside1LastX128 *big.Int TokensOwed0 *big.Int TokensOwed1 *big.Int }) if err != nil { return *outstruct, err } outstruct.Nonce = *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) outstruct.Operator = *abi.ConvertType(out[1], new(common.Address)).(*common.Address) outstruct.Token0 = *abi.ConvertType(out[2], new(common.Address)).(*common.Address) outstruct.Token1 = *abi.ConvertType(out[3], new(common.Address)).(*common.Address) outstruct.Fee = *abi.ConvertType(out[4], new(*big.Int)).(**big.Int) outstruct.TickLower = *abi.ConvertType(out[5], new(*big.Int)).(**big.Int) outstruct.TickUpper = *abi.ConvertType(out[6], new(*big.Int)).(**big.Int) outstruct.Liquidity = *abi.ConvertType(out[7], new(*big.Int)).(**big.Int) outstruct.FeeGrowthInside0LastX128 = *abi.ConvertType(out[8], new(*big.Int)).(**big.Int) outstruct.FeeGrowthInside1LastX128 = *abi.ConvertType(out[9], new(*big.Int)).(**big.Int) outstruct.TokensOwed0 = *abi.ConvertType(out[10], new(*big.Int)).(**big.Int) outstruct.TokensOwed1 = *abi.ConvertType(out[11], new(*big.Int)).(**big.Int) return *outstruct, err } // Positions is a free data retrieval call binding the contract method 0x99fbab88. // // Solidity: function positions(uint256 tokenId) view returns(uint96 nonce, address operator, address token0, address token1, uint24 fee, int24 tickLower, int24 tickUpper, uint128 liquidity, uint256 feeGrowthInside0LastX128, uint256 feeGrowthInside1LastX128, uint128 tokensOwed0, uint128 tokensOwed1) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Positions(tokenId *big.Int) (struct { Nonce *big.Int Operator common.Address Token0 common.Address Token1 common.Address Fee *big.Int TickLower *big.Int TickUpper *big.Int Liquidity *big.Int FeeGrowthInside0LastX128 *big.Int FeeGrowthInside1LastX128 *big.Int TokensOwed0 *big.Int TokensOwed1 *big.Int }, error) { return _NonfungiblePositionManager.Contract.Positions(&_NonfungiblePositionManager.CallOpts, tokenId) } // Positions is a free data retrieval call binding the contract method 0x99fbab88. // // Solidity: function positions(uint256 tokenId) view returns(uint96 nonce, address operator, address token0, address token1, uint24 fee, int24 tickLower, int24 tickUpper, uint128 liquidity, uint256 feeGrowthInside0LastX128, uint256 feeGrowthInside1LastX128, uint128 tokensOwed0, uint128 tokensOwed1) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) Positions(tokenId *big.Int) (struct { Nonce *big.Int Operator common.Address Token0 common.Address Token1 common.Address Fee *big.Int TickLower *big.Int TickUpper *big.Int Liquidity *big.Int FeeGrowthInside0LastX128 *big.Int FeeGrowthInside1LastX128 *big.Int TokensOwed0 *big.Int TokensOwed1 *big.Int }, error) { return _NonfungiblePositionManager.Contract.Positions(&_NonfungiblePositionManager.CallOpts, tokenId) } // SupportsInterface is a free data retrieval call binding the contract method 0x01ffc9a7. // // Solidity: function supportsInterface(bytes4 interfaceId) view returns(bool) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) SupportsInterface(opts *bind.CallOpts, interfaceId [4]byte) (bool, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "supportsInterface", interfaceId) if err != nil { return *new(bool), err } out0 := *abi.ConvertType(out[0], new(bool)).(*bool) return out0, err } // SupportsInterface is a free data retrieval call binding the contract method 0x01ffc9a7. // // Solidity: function supportsInterface(bytes4 interfaceId) view returns(bool) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) SupportsInterface(interfaceId [4]byte) (bool, error) { return _NonfungiblePositionManager.Contract.SupportsInterface(&_NonfungiblePositionManager.CallOpts, interfaceId) } // SupportsInterface is a free data retrieval call binding the contract method 0x01ffc9a7. // // Solidity: function supportsInterface(bytes4 interfaceId) view returns(bool) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) SupportsInterface(interfaceId [4]byte) (bool, error) { return _NonfungiblePositionManager.Contract.SupportsInterface(&_NonfungiblePositionManager.CallOpts, interfaceId) } // Symbol is a free data retrieval call binding the contract method 0x95d89b41. // // Solidity: function symbol() view returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) Symbol(opts *bind.CallOpts) (string, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "symbol") if err != nil { return *new(string), err } out0 := *abi.ConvertType(out[0], new(string)).(*string) return out0, err } // Symbol is a free data retrieval call binding the contract method 0x95d89b41. // // Solidity: function symbol() view returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Symbol() (string, error) { return _NonfungiblePositionManager.Contract.Symbol(&_NonfungiblePositionManager.CallOpts) } // Symbol is a free data retrieval call binding the contract method 0x95d89b41. // // Solidity: function symbol() view returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) Symbol() (string, error) { return _NonfungiblePositionManager.Contract.Symbol(&_NonfungiblePositionManager.CallOpts) } // TokenByIndex is a free data retrieval call binding the contract method 0x4f6ccce7. // // Solidity: function tokenByIndex(uint256 index) view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) TokenByIndex(opts *bind.CallOpts, index *big.Int) (*big.Int, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "tokenByIndex", index) if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // TokenByIndex is a free data retrieval call binding the contract method 0x4f6ccce7. // // Solidity: function tokenByIndex(uint256 index) view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) TokenByIndex(index *big.Int) (*big.Int, error) { return _NonfungiblePositionManager.Contract.TokenByIndex(&_NonfungiblePositionManager.CallOpts, index) } // TokenByIndex is a free data retrieval call binding the contract method 0x4f6ccce7. // // Solidity: function tokenByIndex(uint256 index) view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) TokenByIndex(index *big.Int) (*big.Int, error) { return _NonfungiblePositionManager.Contract.TokenByIndex(&_NonfungiblePositionManager.CallOpts, index) } // TokenOfOwnerByIndex is a free data retrieval call binding the contract method 0x2f745c59. // // Solidity: function tokenOfOwnerByIndex(address owner, uint256 index) view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) TokenOfOwnerByIndex(opts *bind.CallOpts, owner common.Address, index *big.Int) (*big.Int, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "tokenOfOwnerByIndex", owner, index) if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // TokenOfOwnerByIndex is a free data retrieval call binding the contract method 0x2f745c59. // // Solidity: function tokenOfOwnerByIndex(address owner, uint256 index) view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) TokenOfOwnerByIndex(owner common.Address, index *big.Int) (*big.Int, error) { return _NonfungiblePositionManager.Contract.TokenOfOwnerByIndex(&_NonfungiblePositionManager.CallOpts, owner, index) } // TokenOfOwnerByIndex is a free data retrieval call binding the contract method 0x2f745c59. // // Solidity: function tokenOfOwnerByIndex(address owner, uint256 index) view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) TokenOfOwnerByIndex(owner common.Address, index *big.Int) (*big.Int, error) { return _NonfungiblePositionManager.Contract.TokenOfOwnerByIndex(&_NonfungiblePositionManager.CallOpts, owner, index) } // TokenURI is a free data retrieval call binding the contract method 0xc87b56dd. // // Solidity: function tokenURI(uint256 tokenId) view returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) TokenURI(opts *bind.CallOpts, tokenId *big.Int) (string, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "tokenURI", tokenId) if err != nil { return *new(string), err } out0 := *abi.ConvertType(out[0], new(string)).(*string) return out0, err } // TokenURI is a free data retrieval call binding the contract method 0xc87b56dd. // // Solidity: function tokenURI(uint256 tokenId) view returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) TokenURI(tokenId *big.Int) (string, error) { return _NonfungiblePositionManager.Contract.TokenURI(&_NonfungiblePositionManager.CallOpts, tokenId) } // TokenURI is a free data retrieval call binding the contract method 0xc87b56dd. // // Solidity: function tokenURI(uint256 tokenId) view returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) TokenURI(tokenId *big.Int) (string, error) { return _NonfungiblePositionManager.Contract.TokenURI(&_NonfungiblePositionManager.CallOpts, tokenId) } // TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. // // Solidity: function totalSupply() view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) TotalSupply(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "totalSupply") if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. // // Solidity: function totalSupply() view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) TotalSupply() (*big.Int, error) { return _NonfungiblePositionManager.Contract.TotalSupply(&_NonfungiblePositionManager.CallOpts) } // TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. // // Solidity: function totalSupply() view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) TotalSupply() (*big.Int, error) { return _NonfungiblePositionManager.Contract.TotalSupply(&_NonfungiblePositionManager.CallOpts) } // Approve is a paid mutator transaction binding the contract method 0x095ea7b3. // // Solidity: function approve(address to, uint256 tokenId) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) Approve(opts *bind.TransactOpts, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "approve", to, tokenId) } // Approve is a paid mutator transaction binding the contract method 0x095ea7b3. // // Solidity: function approve(address to, uint256 tokenId) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Approve(to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Approve(&_NonfungiblePositionManager.TransactOpts, to, tokenId) } // Approve is a paid mutator transaction binding the contract method 0x095ea7b3. // // Solidity: function approve(address to, uint256 tokenId) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) Approve(to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Approve(&_NonfungiblePositionManager.TransactOpts, to, tokenId) } // Burn is a paid mutator transaction binding the contract method 0x42966c68. // // Solidity: function burn(uint256 tokenId) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) Burn(opts *bind.TransactOpts, tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "burn", tokenId) } // Burn is a paid mutator transaction binding the contract method 0x42966c68. // // Solidity: function burn(uint256 tokenId) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Burn(tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Burn(&_NonfungiblePositionManager.TransactOpts, tokenId) } // Burn is a paid mutator transaction binding the contract method 0x42966c68. // // Solidity: function burn(uint256 tokenId) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) Burn(tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Burn(&_NonfungiblePositionManager.TransactOpts, tokenId) } // Collect is a paid mutator transaction binding the contract method 0xfc6f7865. // // Solidity: function collect((uint256,address,uint128,uint128) params) payable returns(uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) Collect(opts *bind.TransactOpts, params INonfungiblePositionManagerCollectParams) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "collect", params) } // Collect is a paid mutator transaction binding the contract method 0xfc6f7865. // // Solidity: function collect((uint256,address,uint128,uint128) params) payable returns(uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Collect(params INonfungiblePositionManagerCollectParams) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Collect(&_NonfungiblePositionManager.TransactOpts, params) } // Collect is a paid mutator transaction binding the contract method 0xfc6f7865. // // Solidity: function collect((uint256,address,uint128,uint128) params) payable returns(uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) Collect(params INonfungiblePositionManagerCollectParams) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Collect(&_NonfungiblePositionManager.TransactOpts, params) } // CreateAndInitializePoolIfNecessary is a paid mutator transaction binding the contract method 0x13ead562. // // Solidity: function createAndInitializePoolIfNecessary(address token0, address token1, uint24 fee, uint160 sqrtPriceX96) payable returns(address pool) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) CreateAndInitializePoolIfNecessary(opts *bind.TransactOpts, token0 common.Address, token1 common.Address, fee *big.Int, sqrtPriceX96 *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "createAndInitializePoolIfNecessary", token0, token1, fee, sqrtPriceX96) } // CreateAndInitializePoolIfNecessary is a paid mutator transaction binding the contract method 0x13ead562. // // Solidity: function createAndInitializePoolIfNecessary(address token0, address token1, uint24 fee, uint160 sqrtPriceX96) payable returns(address pool) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) CreateAndInitializePoolIfNecessary(token0 common.Address, token1 common.Address, fee *big.Int, sqrtPriceX96 *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.CreateAndInitializePoolIfNecessary(&_NonfungiblePositionManager.TransactOpts, token0, token1, fee, sqrtPriceX96) } // CreateAndInitializePoolIfNecessary is a paid mutator transaction binding the contract method 0x13ead562. // // Solidity: function createAndInitializePoolIfNecessary(address token0, address token1, uint24 fee, uint160 sqrtPriceX96) payable returns(address pool) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) CreateAndInitializePoolIfNecessary(token0 common.Address, token1 common.Address, fee *big.Int, sqrtPriceX96 *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.CreateAndInitializePoolIfNecessary(&_NonfungiblePositionManager.TransactOpts, token0, token1, fee, sqrtPriceX96) } // DecreaseLiquidity is a paid mutator transaction binding the contract method 0x0c49ccbe. // // Solidity: function decreaseLiquidity((uint256,uint128,uint256,uint256,uint256) params) payable returns(uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) DecreaseLiquidity(opts *bind.TransactOpts, params INonfungiblePositionManagerDecreaseLiquidityParams) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "decreaseLiquidity", params) } // DecreaseLiquidity is a paid mutator transaction binding the contract method 0x0c49ccbe. // // Solidity: function decreaseLiquidity((uint256,uint128,uint256,uint256,uint256) params) payable returns(uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) DecreaseLiquidity(params INonfungiblePositionManagerDecreaseLiquidityParams) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.DecreaseLiquidity(&_NonfungiblePositionManager.TransactOpts, params) } // DecreaseLiquidity is a paid mutator transaction binding the contract method 0x0c49ccbe. // // Solidity: function decreaseLiquidity((uint256,uint128,uint256,uint256,uint256) params) payable returns(uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) DecreaseLiquidity(params INonfungiblePositionManagerDecreaseLiquidityParams) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.DecreaseLiquidity(&_NonfungiblePositionManager.TransactOpts, params) } // IncreaseLiquidity is a paid mutator transaction binding the contract method 0x219f5d17. // // Solidity: function increaseLiquidity((uint256,uint256,uint256,uint256,uint256,uint256) params) payable returns(uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) IncreaseLiquidity(opts *bind.TransactOpts, params INonfungiblePositionManagerIncreaseLiquidityParams) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "increaseLiquidity", params) } // IncreaseLiquidity is a paid mutator transaction binding the contract method 0x219f5d17. // // Solidity: function increaseLiquidity((uint256,uint256,uint256,uint256,uint256,uint256) params) payable returns(uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) IncreaseLiquidity(params INonfungiblePositionManagerIncreaseLiquidityParams) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.IncreaseLiquidity(&_NonfungiblePositionManager.TransactOpts, params) } // IncreaseLiquidity is a paid mutator transaction binding the contract method 0x219f5d17. // // Solidity: function increaseLiquidity((uint256,uint256,uint256,uint256,uint256,uint256) params) payable returns(uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) IncreaseLiquidity(params INonfungiblePositionManagerIncreaseLiquidityParams) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.IncreaseLiquidity(&_NonfungiblePositionManager.TransactOpts, params) } // Mint is a paid mutator transaction binding the contract method 0x88316456. // // Solidity: function mint((address,address,uint24,int24,int24,uint256,uint256,uint256,uint256,address,uint256) params) payable returns(uint256 tokenId, uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) Mint(opts *bind.TransactOpts, params INonfungiblePositionManagerMintParams) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "mint", params) } // Mint is a paid mutator transaction binding the contract method 0x88316456. // // Solidity: function mint((address,address,uint24,int24,int24,uint256,uint256,uint256,uint256,address,uint256) params) payable returns(uint256 tokenId, uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Mint(params INonfungiblePositionManagerMintParams) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Mint(&_NonfungiblePositionManager.TransactOpts, params) } // Mint is a paid mutator transaction binding the contract method 0x88316456. // // Solidity: function mint((address,address,uint24,int24,int24,uint256,uint256,uint256,uint256,address,uint256) params) payable returns(uint256 tokenId, uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) Mint(params INonfungiblePositionManagerMintParams) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Mint(&_NonfungiblePositionManager.TransactOpts, params) } // Multicall is a paid mutator transaction binding the contract method 0xac9650d8. // // Solidity: function multicall(bytes[] data) payable returns(bytes[] results) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) Multicall(opts *bind.TransactOpts, data [][]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "multicall", data) } // Multicall is a paid mutator transaction binding the contract method 0xac9650d8. // // Solidity: function multicall(bytes[] data) payable returns(bytes[] results) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Multicall(data [][]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Multicall(&_NonfungiblePositionManager.TransactOpts, data) } // Multicall is a paid mutator transaction binding the contract method 0xac9650d8. // // Solidity: function multicall(bytes[] data) payable returns(bytes[] results) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) Multicall(data [][]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Multicall(&_NonfungiblePositionManager.TransactOpts, data) } // Permit is a paid mutator transaction binding the contract method 0x7ac2ff7b. // // Solidity: function permit(address spender, uint256 tokenId, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) Permit(opts *bind.TransactOpts, spender common.Address, tokenId *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "permit", spender, tokenId, deadline, v, r, s) } // Permit is a paid mutator transaction binding the contract method 0x7ac2ff7b. // // Solidity: function permit(address spender, uint256 tokenId, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Permit(spender common.Address, tokenId *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Permit(&_NonfungiblePositionManager.TransactOpts, spender, tokenId, deadline, v, r, s) } // Permit is a paid mutator transaction binding the contract method 0x7ac2ff7b. // // Solidity: function permit(address spender, uint256 tokenId, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) Permit(spender common.Address, tokenId *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Permit(&_NonfungiblePositionManager.TransactOpts, spender, tokenId, deadline, v, r, s) } // RefundETH is a paid mutator transaction binding the contract method 0x12210e8a. // // Solidity: function refundETH() payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) RefundETH(opts *bind.TransactOpts) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "refundETH") } // RefundETH is a paid mutator transaction binding the contract method 0x12210e8a. // // Solidity: function refundETH() payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) RefundETH() (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.RefundETH(&_NonfungiblePositionManager.TransactOpts) } // RefundETH is a paid mutator transaction binding the contract method 0x12210e8a. // // Solidity: function refundETH() payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) RefundETH() (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.RefundETH(&_NonfungiblePositionManager.TransactOpts) } // SafeTransferFrom is a paid mutator transaction binding the contract method 0x42842e0e. // // Solidity: function safeTransferFrom(address from, address to, uint256 tokenId) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) SafeTransferFrom(opts *bind.TransactOpts, from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "safeTransferFrom", from, to, tokenId) } // SafeTransferFrom is a paid mutator transaction binding the contract method 0x42842e0e. // // Solidity: function safeTransferFrom(address from, address to, uint256 tokenId) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) SafeTransferFrom(from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SafeTransferFrom(&_NonfungiblePositionManager.TransactOpts, from, to, tokenId) } // SafeTransferFrom is a paid mutator transaction binding the contract method 0x42842e0e. // // Solidity: function safeTransferFrom(address from, address to, uint256 tokenId) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) SafeTransferFrom(from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SafeTransferFrom(&_NonfungiblePositionManager.TransactOpts, from, to, tokenId) } // SafeTransferFrom0 is a paid mutator transaction binding the contract method 0xb88d4fde. // // Solidity: function safeTransferFrom(address from, address to, uint256 tokenId, bytes _data) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) SafeTransferFrom0(opts *bind.TransactOpts, from common.Address, to common.Address, tokenId *big.Int, _data []byte) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "safeTransferFrom0", from, to, tokenId, _data) } // SafeTransferFrom0 is a paid mutator transaction binding the contract method 0xb88d4fde. // // Solidity: function safeTransferFrom(address from, address to, uint256 tokenId, bytes _data) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) SafeTransferFrom0(from common.Address, to common.Address, tokenId *big.Int, _data []byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SafeTransferFrom0(&_NonfungiblePositionManager.TransactOpts, from, to, tokenId, _data) } // SafeTransferFrom0 is a paid mutator transaction binding the contract method 0xb88d4fde. // // Solidity: function safeTransferFrom(address from, address to, uint256 tokenId, bytes _data) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) SafeTransferFrom0(from common.Address, to common.Address, tokenId *big.Int, _data []byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SafeTransferFrom0(&_NonfungiblePositionManager.TransactOpts, from, to, tokenId, _data) } // SelfPermit is a paid mutator transaction binding the contract method 0xf3995c67. // // Solidity: function selfPermit(address token, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) SelfPermit(opts *bind.TransactOpts, token common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "selfPermit", token, value, deadline, v, r, s) } // SelfPermit is a paid mutator transaction binding the contract method 0xf3995c67. // // Solidity: function selfPermit(address token, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) SelfPermit(token common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SelfPermit(&_NonfungiblePositionManager.TransactOpts, token, value, deadline, v, r, s) } // SelfPermit is a paid mutator transaction binding the contract method 0xf3995c67. // // Solidity: function selfPermit(address token, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) SelfPermit(token common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SelfPermit(&_NonfungiblePositionManager.TransactOpts, token, value, deadline, v, r, s) } // SelfPermitAllowed is a paid mutator transaction binding the contract method 0x4659a494. // // Solidity: function selfPermitAllowed(address token, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) SelfPermitAllowed(opts *bind.TransactOpts, token common.Address, nonce *big.Int, expiry *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "selfPermitAllowed", token, nonce, expiry, v, r, s) } // SelfPermitAllowed is a paid mutator transaction binding the contract method 0x4659a494. // // Solidity: function selfPermitAllowed(address token, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) SelfPermitAllowed(token common.Address, nonce *big.Int, expiry *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SelfPermitAllowed(&_NonfungiblePositionManager.TransactOpts, token, nonce, expiry, v, r, s) } // SelfPermitAllowed is a paid mutator transaction binding the contract method 0x4659a494. // // Solidity: function selfPermitAllowed(address token, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) SelfPermitAllowed(token common.Address, nonce *big.Int, expiry *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SelfPermitAllowed(&_NonfungiblePositionManager.TransactOpts, token, nonce, expiry, v, r, s) } // SelfPermitAllowedIfNecessary is a paid mutator transaction binding the contract method 0xa4a78f0c. // // Solidity: function selfPermitAllowedIfNecessary(address token, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) SelfPermitAllowedIfNecessary(opts *bind.TransactOpts, token common.Address, nonce *big.Int, expiry *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "selfPermitAllowedIfNecessary", token, nonce, expiry, v, r, s) } // SelfPermitAllowedIfNecessary is a paid mutator transaction binding the contract method 0xa4a78f0c. // // Solidity: function selfPermitAllowedIfNecessary(address token, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) SelfPermitAllowedIfNecessary(token common.Address, nonce *big.Int, expiry *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SelfPermitAllowedIfNecessary(&_NonfungiblePositionManager.TransactOpts, token, nonce, expiry, v, r, s) } // SelfPermitAllowedIfNecessary is a paid mutator transaction binding the contract method 0xa4a78f0c. // // Solidity: function selfPermitAllowedIfNecessary(address token, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) SelfPermitAllowedIfNecessary(token common.Address, nonce *big.Int, expiry *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SelfPermitAllowedIfNecessary(&_NonfungiblePositionManager.TransactOpts, token, nonce, expiry, v, r, s) } // SelfPermitIfNecessary is a paid mutator transaction binding the contract method 0xc2e3140a. // // Solidity: function selfPermitIfNecessary(address token, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) SelfPermitIfNecessary(opts *bind.TransactOpts, token common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "selfPermitIfNecessary", token, value, deadline, v, r, s) } // SelfPermitIfNecessary is a paid mutator transaction binding the contract method 0xc2e3140a. // // Solidity: function selfPermitIfNecessary(address token, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) SelfPermitIfNecessary(token common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SelfPermitIfNecessary(&_NonfungiblePositionManager.TransactOpts, token, value, deadline, v, r, s) } // SelfPermitIfNecessary is a paid mutator transaction binding the contract method 0xc2e3140a. // // Solidity: function selfPermitIfNecessary(address token, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) SelfPermitIfNecessary(token common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SelfPermitIfNecessary(&_NonfungiblePositionManager.TransactOpts, token, value, deadline, v, r, s) } // SetApprovalForAll is a paid mutator transaction binding the contract method 0xa22cb465. // // Solidity: function setApprovalForAll(address operator, bool approved) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) SetApprovalForAll(opts *bind.TransactOpts, operator common.Address, approved bool) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "setApprovalForAll", operator, approved) } // SetApprovalForAll is a paid mutator transaction binding the contract method 0xa22cb465. // // Solidity: function setApprovalForAll(address operator, bool approved) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) SetApprovalForAll(operator common.Address, approved bool) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SetApprovalForAll(&_NonfungiblePositionManager.TransactOpts, operator, approved) } // SetApprovalForAll is a paid mutator transaction binding the contract method 0xa22cb465. // // Solidity: function setApprovalForAll(address operator, bool approved) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) SetApprovalForAll(operator common.Address, approved bool) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SetApprovalForAll(&_NonfungiblePositionManager.TransactOpts, operator, approved) } // SweepToken is a paid mutator transaction binding the contract method 0xdf2ab5bb. // // Solidity: function sweepToken(address token, uint256 amountMinimum, address recipient) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) SweepToken(opts *bind.TransactOpts, token common.Address, amountMinimum *big.Int, recipient common.Address) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "sweepToken", token, amountMinimum, recipient) } // SweepToken is a paid mutator transaction binding the contract method 0xdf2ab5bb. // // Solidity: function sweepToken(address token, uint256 amountMinimum, address recipient) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) SweepToken(token common.Address, amountMinimum *big.Int, recipient common.Address) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SweepToken(&_NonfungiblePositionManager.TransactOpts, token, amountMinimum, recipient) } // SweepToken is a paid mutator transaction binding the contract method 0xdf2ab5bb. // // Solidity: function sweepToken(address token, uint256 amountMinimum, address recipient) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) SweepToken(token common.Address, amountMinimum *big.Int, recipient common.Address) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SweepToken(&_NonfungiblePositionManager.TransactOpts, token, amountMinimum, recipient) } // TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. // // Solidity: function transferFrom(address from, address to, uint256 tokenId) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) TransferFrom(opts *bind.TransactOpts, from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "transferFrom", from, to, tokenId) } // TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. // // Solidity: function transferFrom(address from, address to, uint256 tokenId) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) TransferFrom(from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.TransferFrom(&_NonfungiblePositionManager.TransactOpts, from, to, tokenId) } // TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. // // Solidity: function transferFrom(address from, address to, uint256 tokenId) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) TransferFrom(from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.TransferFrom(&_NonfungiblePositionManager.TransactOpts, from, to, tokenId) } // UniswapV3MintCallback is a paid mutator transaction binding the contract method 0xd3487997. // // Solidity: function uniswapV3MintCallback(uint256 amount0Owed, uint256 amount1Owed, bytes data) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) UniswapV3MintCallback(opts *bind.TransactOpts, amount0Owed *big.Int, amount1Owed *big.Int, data []byte) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "uniswapV3MintCallback", amount0Owed, amount1Owed, data) } // UniswapV3MintCallback is a paid mutator transaction binding the contract method 0xd3487997. // // Solidity: function uniswapV3MintCallback(uint256 amount0Owed, uint256 amount1Owed, bytes data) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) UniswapV3MintCallback(amount0Owed *big.Int, amount1Owed *big.Int, data []byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.UniswapV3MintCallback(&_NonfungiblePositionManager.TransactOpts, amount0Owed, amount1Owed, data) } // UniswapV3MintCallback is a paid mutator transaction binding the contract method 0xd3487997. // // Solidity: function uniswapV3MintCallback(uint256 amount0Owed, uint256 amount1Owed, bytes data) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) UniswapV3MintCallback(amount0Owed *big.Int, amount1Owed *big.Int, data []byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.UniswapV3MintCallback(&_NonfungiblePositionManager.TransactOpts, amount0Owed, amount1Owed, data) } // UnwrapWETH9 is a paid mutator transaction binding the contract method 0x49404b7c. // // Solidity: function unwrapWETH9(uint256 amountMinimum, address recipient) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) UnwrapWETH9(opts *bind.TransactOpts, amountMinimum *big.Int, recipient common.Address) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "unwrapWETH9", amountMinimum, recipient) } // UnwrapWETH9 is a paid mutator transaction binding the contract method 0x49404b7c. // // Solidity: function unwrapWETH9(uint256 amountMinimum, address recipient) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) UnwrapWETH9(amountMinimum *big.Int, recipient common.Address) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.UnwrapWETH9(&_NonfungiblePositionManager.TransactOpts, amountMinimum, recipient) } // UnwrapWETH9 is a paid mutator transaction binding the contract method 0x49404b7c. // // Solidity: function unwrapWETH9(uint256 amountMinimum, address recipient) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) UnwrapWETH9(amountMinimum *big.Int, recipient common.Address) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.UnwrapWETH9(&_NonfungiblePositionManager.TransactOpts, amountMinimum, recipient) } // Receive is a paid mutator transaction binding the contract receive function. // // Solidity: receive() payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) Receive(opts *bind.TransactOpts) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.RawTransact(opts, nil) // calldata is disallowed for receive function } // Receive is a paid mutator transaction binding the contract receive function. // // Solidity: receive() payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Receive() (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Receive(&_NonfungiblePositionManager.TransactOpts) } // Receive is a paid mutator transaction binding the contract receive function. // // Solidity: receive() payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) Receive() (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Receive(&_NonfungiblePositionManager.TransactOpts) } // NonfungiblePositionManagerApprovalIterator is returned from FilterApproval and is used to iterate over the raw logs and unpacked data for Approval events raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerApprovalIterator struct { Event *NonfungiblePositionManagerApproval // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *NonfungiblePositionManagerApprovalIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerApproval) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerApproval) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *NonfungiblePositionManagerApprovalIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *NonfungiblePositionManagerApprovalIterator) Close() error { it.sub.Unsubscribe() return nil } // NonfungiblePositionManagerApproval represents a Approval event raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerApproval struct { Owner common.Address Approved common.Address TokenId *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterApproval is a free log retrieval operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. // // Solidity: event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) FilterApproval(opts *bind.FilterOpts, owner []common.Address, approved []common.Address, tokenId []*big.Int) (*NonfungiblePositionManagerApprovalIterator, error) { var ownerRule []interface{} for _, ownerItem := range owner { ownerRule = append(ownerRule, ownerItem) } var approvedRule []interface{} for _, approvedItem := range approved { approvedRule = append(approvedRule, approvedItem) } var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _NonfungiblePositionManager.contract.FilterLogs(opts, "Approval", ownerRule, approvedRule, tokenIdRule) if err != nil { return nil, err } return &NonfungiblePositionManagerApprovalIterator{contract: _NonfungiblePositionManager.contract, event: "Approval", logs: logs, sub: sub}, nil } // WatchApproval is a free log subscription operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. // // Solidity: event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) WatchApproval(opts *bind.WatchOpts, sink chan<- *NonfungiblePositionManagerApproval, owner []common.Address, approved []common.Address, tokenId []*big.Int) (event.Subscription, error) { var ownerRule []interface{} for _, ownerItem := range owner { ownerRule = append(ownerRule, ownerItem) } var approvedRule []interface{} for _, approvedItem := range approved { approvedRule = append(approvedRule, approvedItem) } var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _NonfungiblePositionManager.contract.WatchLogs(opts, "Approval", ownerRule, approvedRule, tokenIdRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(NonfungiblePositionManagerApproval) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "Approval", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseApproval is a log parse operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. // // Solidity: event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) ParseApproval(log types.Log) (*NonfungiblePositionManagerApproval, error) { event := new(NonfungiblePositionManagerApproval) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "Approval", log); err != nil { return nil, err } event.Raw = log return event, nil } // NonfungiblePositionManagerApprovalForAllIterator is returned from FilterApprovalForAll and is used to iterate over the raw logs and unpacked data for ApprovalForAll events raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerApprovalForAllIterator struct { Event *NonfungiblePositionManagerApprovalForAll // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *NonfungiblePositionManagerApprovalForAllIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerApprovalForAll) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerApprovalForAll) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *NonfungiblePositionManagerApprovalForAllIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *NonfungiblePositionManagerApprovalForAllIterator) Close() error { it.sub.Unsubscribe() return nil } // NonfungiblePositionManagerApprovalForAll represents a ApprovalForAll event raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerApprovalForAll struct { Owner common.Address Operator common.Address Approved bool Raw types.Log // Blockchain specific contextual infos } // FilterApprovalForAll is a free log retrieval operation binding the contract event 0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31. // // Solidity: event ApprovalForAll(address indexed owner, address indexed operator, bool approved) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) FilterApprovalForAll(opts *bind.FilterOpts, owner []common.Address, operator []common.Address) (*NonfungiblePositionManagerApprovalForAllIterator, error) { var ownerRule []interface{} for _, ownerItem := range owner { ownerRule = append(ownerRule, ownerItem) } var operatorRule []interface{} for _, operatorItem := range operator { operatorRule = append(operatorRule, operatorItem) } logs, sub, err := _NonfungiblePositionManager.contract.FilterLogs(opts, "ApprovalForAll", ownerRule, operatorRule) if err != nil { return nil, err } return &NonfungiblePositionManagerApprovalForAllIterator{contract: _NonfungiblePositionManager.contract, event: "ApprovalForAll", logs: logs, sub: sub}, nil } // WatchApprovalForAll is a free log subscription operation binding the contract event 0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31. // // Solidity: event ApprovalForAll(address indexed owner, address indexed operator, bool approved) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) WatchApprovalForAll(opts *bind.WatchOpts, sink chan<- *NonfungiblePositionManagerApprovalForAll, owner []common.Address, operator []common.Address) (event.Subscription, error) { var ownerRule []interface{} for _, ownerItem := range owner { ownerRule = append(ownerRule, ownerItem) } var operatorRule []interface{} for _, operatorItem := range operator { operatorRule = append(operatorRule, operatorItem) } logs, sub, err := _NonfungiblePositionManager.contract.WatchLogs(opts, "ApprovalForAll", ownerRule, operatorRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(NonfungiblePositionManagerApprovalForAll) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "ApprovalForAll", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseApprovalForAll is a log parse operation binding the contract event 0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31. // // Solidity: event ApprovalForAll(address indexed owner, address indexed operator, bool approved) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) ParseApprovalForAll(log types.Log) (*NonfungiblePositionManagerApprovalForAll, error) { event := new(NonfungiblePositionManagerApprovalForAll) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "ApprovalForAll", log); err != nil { return nil, err } event.Raw = log return event, nil } // NonfungiblePositionManagerCollectIterator is returned from FilterCollect and is used to iterate over the raw logs and unpacked data for Collect events raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerCollectIterator struct { Event *NonfungiblePositionManagerCollect // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *NonfungiblePositionManagerCollectIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerCollect) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerCollect) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *NonfungiblePositionManagerCollectIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *NonfungiblePositionManagerCollectIterator) Close() error { it.sub.Unsubscribe() return nil } // NonfungiblePositionManagerCollect represents a Collect event raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerCollect struct { TokenId *big.Int Recipient common.Address Amount0 *big.Int Amount1 *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterCollect is a free log retrieval operation binding the contract event 0x40d0efd1a53d60ecbf40971b9daf7dc90178c3aadc7aab1765632738fa8b8f01. // // Solidity: event Collect(uint256 indexed tokenId, address recipient, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) FilterCollect(opts *bind.FilterOpts, tokenId []*big.Int) (*NonfungiblePositionManagerCollectIterator, error) { var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _NonfungiblePositionManager.contract.FilterLogs(opts, "Collect", tokenIdRule) if err != nil { return nil, err } return &NonfungiblePositionManagerCollectIterator{contract: _NonfungiblePositionManager.contract, event: "Collect", logs: logs, sub: sub}, nil } // WatchCollect is a free log subscription operation binding the contract event 0x40d0efd1a53d60ecbf40971b9daf7dc90178c3aadc7aab1765632738fa8b8f01. // // Solidity: event Collect(uint256 indexed tokenId, address recipient, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) WatchCollect(opts *bind.WatchOpts, sink chan<- *NonfungiblePositionManagerCollect, tokenId []*big.Int) (event.Subscription, error) { var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _NonfungiblePositionManager.contract.WatchLogs(opts, "Collect", tokenIdRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(NonfungiblePositionManagerCollect) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "Collect", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseCollect is a log parse operation binding the contract event 0x40d0efd1a53d60ecbf40971b9daf7dc90178c3aadc7aab1765632738fa8b8f01. // // Solidity: event Collect(uint256 indexed tokenId, address recipient, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) ParseCollect(log types.Log) (*NonfungiblePositionManagerCollect, error) { event := new(NonfungiblePositionManagerCollect) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "Collect", log); err != nil { return nil, err } event.Raw = log return event, nil } // NonfungiblePositionManagerDecreaseLiquidityIterator is returned from FilterDecreaseLiquidity and is used to iterate over the raw logs and unpacked data for DecreaseLiquidity events raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerDecreaseLiquidityIterator struct { Event *NonfungiblePositionManagerDecreaseLiquidity // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *NonfungiblePositionManagerDecreaseLiquidityIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerDecreaseLiquidity) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerDecreaseLiquidity) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *NonfungiblePositionManagerDecreaseLiquidityIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *NonfungiblePositionManagerDecreaseLiquidityIterator) Close() error { it.sub.Unsubscribe() return nil } // NonfungiblePositionManagerDecreaseLiquidity represents a DecreaseLiquidity event raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerDecreaseLiquidity struct { TokenId *big.Int Liquidity *big.Int Amount0 *big.Int Amount1 *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterDecreaseLiquidity is a free log retrieval operation binding the contract event 0x26f6a048ee9138f2c0ce266f322cb99228e8d619ae2bff30c67f8dcf9d2377b4. // // Solidity: event DecreaseLiquidity(uint256 indexed tokenId, uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) FilterDecreaseLiquidity(opts *bind.FilterOpts, tokenId []*big.Int) (*NonfungiblePositionManagerDecreaseLiquidityIterator, error) { var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _NonfungiblePositionManager.contract.FilterLogs(opts, "DecreaseLiquidity", tokenIdRule) if err != nil { return nil, err } return &NonfungiblePositionManagerDecreaseLiquidityIterator{contract: _NonfungiblePositionManager.contract, event: "DecreaseLiquidity", logs: logs, sub: sub}, nil } // WatchDecreaseLiquidity is a free log subscription operation binding the contract event 0x26f6a048ee9138f2c0ce266f322cb99228e8d619ae2bff30c67f8dcf9d2377b4. // // Solidity: event DecreaseLiquidity(uint256 indexed tokenId, uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) WatchDecreaseLiquidity(opts *bind.WatchOpts, sink chan<- *NonfungiblePositionManagerDecreaseLiquidity, tokenId []*big.Int) (event.Subscription, error) { var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _NonfungiblePositionManager.contract.WatchLogs(opts, "DecreaseLiquidity", tokenIdRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(NonfungiblePositionManagerDecreaseLiquidity) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "DecreaseLiquidity", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseDecreaseLiquidity is a log parse operation binding the contract event 0x26f6a048ee9138f2c0ce266f322cb99228e8d619ae2bff30c67f8dcf9d2377b4. // // Solidity: event DecreaseLiquidity(uint256 indexed tokenId, uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) ParseDecreaseLiquidity(log types.Log) (*NonfungiblePositionManagerDecreaseLiquidity, error) { event := new(NonfungiblePositionManagerDecreaseLiquidity) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "DecreaseLiquidity", log); err != nil { return nil, err } event.Raw = log return event, nil } // NonfungiblePositionManagerIncreaseLiquidityIterator is returned from FilterIncreaseLiquidity and is used to iterate over the raw logs and unpacked data for IncreaseLiquidity events raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerIncreaseLiquidityIterator struct { Event *NonfungiblePositionManagerIncreaseLiquidity // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *NonfungiblePositionManagerIncreaseLiquidityIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerIncreaseLiquidity) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerIncreaseLiquidity) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *NonfungiblePositionManagerIncreaseLiquidityIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *NonfungiblePositionManagerIncreaseLiquidityIterator) Close() error { it.sub.Unsubscribe() return nil } // NonfungiblePositionManagerIncreaseLiquidity represents a IncreaseLiquidity event raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerIncreaseLiquidity struct { TokenId *big.Int Liquidity *big.Int Amount0 *big.Int Amount1 *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterIncreaseLiquidity is a free log retrieval operation binding the contract event 0x3067048beee31b25b2f1681f88dac838c8bba36af25bfb2b7cf7473a5847e35f. // // Solidity: event IncreaseLiquidity(uint256 indexed tokenId, uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) FilterIncreaseLiquidity(opts *bind.FilterOpts, tokenId []*big.Int) (*NonfungiblePositionManagerIncreaseLiquidityIterator, error) { var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _NonfungiblePositionManager.contract.FilterLogs(opts, "IncreaseLiquidity", tokenIdRule) if err != nil { return nil, err } return &NonfungiblePositionManagerIncreaseLiquidityIterator{contract: _NonfungiblePositionManager.contract, event: "IncreaseLiquidity", logs: logs, sub: sub}, nil } // WatchIncreaseLiquidity is a free log subscription operation binding the contract event 0x3067048beee31b25b2f1681f88dac838c8bba36af25bfb2b7cf7473a5847e35f. // // Solidity: event IncreaseLiquidity(uint256 indexed tokenId, uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) WatchIncreaseLiquidity(opts *bind.WatchOpts, sink chan<- *NonfungiblePositionManagerIncreaseLiquidity, tokenId []*big.Int) (event.Subscription, error) { var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _NonfungiblePositionManager.contract.WatchLogs(opts, "IncreaseLiquidity", tokenIdRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(NonfungiblePositionManagerIncreaseLiquidity) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "IncreaseLiquidity", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseIncreaseLiquidity is a log parse operation binding the contract event 0x3067048beee31b25b2f1681f88dac838c8bba36af25bfb2b7cf7473a5847e35f. // // Solidity: event IncreaseLiquidity(uint256 indexed tokenId, uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) ParseIncreaseLiquidity(log types.Log) (*NonfungiblePositionManagerIncreaseLiquidity, error) { event := new(NonfungiblePositionManagerIncreaseLiquidity) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "IncreaseLiquidity", log); err != nil { return nil, err } event.Raw = log return event, nil } // NonfungiblePositionManagerTransferIterator is returned from FilterTransfer and is used to iterate over the raw logs and unpacked data for Transfer events raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerTransferIterator struct { Event *NonfungiblePositionManagerTransfer // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *NonfungiblePositionManagerTransferIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerTransfer) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerTransfer) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *NonfungiblePositionManagerTransferIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *NonfungiblePositionManagerTransferIterator) Close() error { it.sub.Unsubscribe() return nil } // NonfungiblePositionManagerTransfer represents a Transfer event raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerTransfer struct { From common.Address To common.Address TokenId *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterTransfer is a free log retrieval operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. // // Solidity: event Transfer(address indexed from, address indexed to, uint256 indexed tokenId) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) FilterTransfer(opts *bind.FilterOpts, from []common.Address, to []common.Address, tokenId []*big.Int) (*NonfungiblePositionManagerTransferIterator, error) { var fromRule []interface{} for _, fromItem := range from { fromRule = append(fromRule, fromItem) } var toRule []interface{} for _, toItem := range to { toRule = append(toRule, toItem) } var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _NonfungiblePositionManager.contract.FilterLogs(opts, "Transfer", fromRule, toRule, tokenIdRule) if err != nil { return nil, err } return &NonfungiblePositionManagerTransferIterator{contract: _NonfungiblePositionManager.contract, event: "Transfer", logs: logs, sub: sub}, nil } // WatchTransfer is a free log subscription operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. // // Solidity: event Transfer(address indexed from, address indexed to, uint256 indexed tokenId) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) WatchTransfer(opts *bind.WatchOpts, sink chan<- *NonfungiblePositionManagerTransfer, from []common.Address, to []common.Address, tokenId []*big.Int) (event.Subscription, error) { var fromRule []interface{} for _, fromItem := range from { fromRule = append(fromRule, fromItem) } var toRule []interface{} for _, toItem := range to { toRule = append(toRule, toItem) } var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _NonfungiblePositionManager.contract.WatchLogs(opts, "Transfer", fromRule, toRule, tokenIdRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(NonfungiblePositionManagerTransfer) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "Transfer", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseTransfer is a log parse operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. // // Solidity: event Transfer(address indexed from, address indexed to, uint256 indexed tokenId) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) ParseTransfer(log types.Log) (*NonfungiblePositionManagerTransfer, error) { event := new(NonfungiblePositionManagerTransfer) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "Transfer", log); err != nil { return nil, err } event.Raw = log return event, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/binds/polygonnonfungiblepositionmanager/abi.json ================================================ [ { "inputs": [ { "internalType": "address", "name": "_factory", "type": "address" }, { "internalType": "address", "name": "_WETH9", "type": "address" }, { "internalType": "address", "name": "_tokenDescriptor_", "type": "address" } ], "stateMutability": "nonpayable", "type": "constructor" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "owner", "type": "address" }, { "indexed": true, "internalType": "address", "name": "approved", "type": "address" }, { "indexed": true, "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "Approval", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "owner", "type": "address" }, { "indexed": true, "internalType": "address", "name": "operator", "type": "address" }, { "indexed": false, "internalType": "bool", "name": "approved", "type": "bool" } ], "name": "ApprovalForAll", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "indexed": false, "internalType": "address", "name": "recipient", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "amount0", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "amount1", "type": "uint256" } ], "name": "Collect", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "indexed": false, "internalType": "uint128", "name": "liquidity", "type": "uint128" }, { "indexed": false, "internalType": "uint256", "name": "amount0", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "amount1", "type": "uint256" } ], "name": "DecreaseLiquidity", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "indexed": false, "internalType": "uint128", "name": "liquidity", "type": "uint128" }, { "indexed": false, "internalType": "uint256", "name": "amount0", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "amount1", "type": "uint256" } ], "name": "IncreaseLiquidity", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "from", "type": "address" }, { "indexed": true, "internalType": "address", "name": "to", "type": "address" }, { "indexed": true, "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "Transfer", "type": "event" }, { "inputs": [], "name": "DOMAIN_SEPARATOR", "outputs": [ { "internalType": "bytes32", "name": "", "type": "bytes32" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "PERMIT_TYPEHASH", "outputs": [ { "internalType": "bytes32", "name": "", "type": "bytes32" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "WETH9", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "to", "type": "address" }, { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "approve", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "owner", "type": "address" } ], "name": "balanceOf", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "baseURI", "outputs": [ { "internalType": "string", "name": "", "type": "string" } ], "stateMutability": "pure", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "burn", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "components": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "internalType": "address", "name": "recipient", "type": "address" }, { "internalType": "uint128", "name": "amount0Max", "type": "uint128" }, { "internalType": "uint128", "name": "amount1Max", "type": "uint128" } ], "internalType": "struct INonfungiblePositionManager.CollectParams", "name": "params", "type": "tuple" } ], "name": "collect", "outputs": [ { "internalType": "uint256", "name": "amount0", "type": "uint256" }, { "internalType": "uint256", "name": "amount1", "type": "uint256" } ], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "token0", "type": "address" }, { "internalType": "address", "name": "token1", "type": "address" }, { "internalType": "uint24", "name": "fee", "type": "uint24" }, { "internalType": "uint160", "name": "sqrtPriceX96", "type": "uint160" } ], "name": "createAndInitializePoolIfNecessary", "outputs": [ { "internalType": "address", "name": "pool", "type": "address" } ], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "components": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "internalType": "uint128", "name": "liquidity", "type": "uint128" }, { "internalType": "uint256", "name": "amount0Min", "type": "uint256" }, { "internalType": "uint256", "name": "amount1Min", "type": "uint256" }, { "internalType": "uint256", "name": "deadline", "type": "uint256" } ], "internalType": "struct INonfungiblePositionManager.DecreaseLiquidityParams", "name": "params", "type": "tuple" } ], "name": "decreaseLiquidity", "outputs": [ { "internalType": "uint256", "name": "amount0", "type": "uint256" }, { "internalType": "uint256", "name": "amount1", "type": "uint256" } ], "stateMutability": "payable", "type": "function" }, { "inputs": [], "name": "factory", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "getApproved", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "components": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "internalType": "uint256", "name": "amount0Desired", "type": "uint256" }, { "internalType": "uint256", "name": "amount1Desired", "type": "uint256" }, { "internalType": "uint256", "name": "amount0Min", "type": "uint256" }, { "internalType": "uint256", "name": "amount1Min", "type": "uint256" }, { "internalType": "uint256", "name": "deadline", "type": "uint256" } ], "internalType": "struct INonfungiblePositionManager.IncreaseLiquidityParams", "name": "params", "type": "tuple" } ], "name": "increaseLiquidity", "outputs": [ { "internalType": "uint128", "name": "liquidity", "type": "uint128" }, { "internalType": "uint256", "name": "amount0", "type": "uint256" }, { "internalType": "uint256", "name": "amount1", "type": "uint256" } ], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "owner", "type": "address" }, { "internalType": "address", "name": "operator", "type": "address" } ], "name": "isApprovedForAll", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "components": [ { "internalType": "address", "name": "token0", "type": "address" }, { "internalType": "address", "name": "token1", "type": "address" }, { "internalType": "uint24", "name": "fee", "type": "uint24" }, { "internalType": "int24", "name": "tickLower", "type": "int24" }, { "internalType": "int24", "name": "tickUpper", "type": "int24" }, { "internalType": "uint256", "name": "amount0Desired", "type": "uint256" }, { "internalType": "uint256", "name": "amount1Desired", "type": "uint256" }, { "internalType": "uint256", "name": "amount0Min", "type": "uint256" }, { "internalType": "uint256", "name": "amount1Min", "type": "uint256" }, { "internalType": "address", "name": "recipient", "type": "address" }, { "internalType": "uint256", "name": "deadline", "type": "uint256" } ], "internalType": "struct INonfungiblePositionManager.MintParams", "name": "params", "type": "tuple" } ], "name": "mint", "outputs": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "internalType": "uint128", "name": "liquidity", "type": "uint128" }, { "internalType": "uint256", "name": "amount0", "type": "uint256" }, { "internalType": "uint256", "name": "amount1", "type": "uint256" } ], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "bytes[]", "name": "data", "type": "bytes[]" } ], "name": "multicall", "outputs": [ { "internalType": "bytes[]", "name": "results", "type": "bytes[]" } ], "stateMutability": "payable", "type": "function" }, { "inputs": [], "name": "name", "outputs": [ { "internalType": "string", "name": "", "type": "string" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "ownerOf", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "spender", "type": "address" }, { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "internalType": "uint256", "name": "deadline", "type": "uint256" }, { "internalType": "uint8", "name": "v", "type": "uint8" }, { "internalType": "bytes32", "name": "r", "type": "bytes32" }, { "internalType": "bytes32", "name": "s", "type": "bytes32" } ], "name": "permit", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "positions", "outputs": [ { "internalType": "uint96", "name": "nonce", "type": "uint96" }, { "internalType": "address", "name": "operator", "type": "address" }, { "internalType": "address", "name": "token0", "type": "address" }, { "internalType": "address", "name": "token1", "type": "address" }, { "internalType": "uint24", "name": "fee", "type": "uint24" }, { "internalType": "int24", "name": "tickLower", "type": "int24" }, { "internalType": "int24", "name": "tickUpper", "type": "int24" }, { "internalType": "uint128", "name": "liquidity", "type": "uint128" }, { "internalType": "uint256", "name": "feeGrowthInside0LastX128", "type": "uint256" }, { "internalType": "uint256", "name": "feeGrowthInside1LastX128", "type": "uint256" }, { "internalType": "uint128", "name": "tokensOwed0", "type": "uint128" }, { "internalType": "uint128", "name": "tokensOwed1", "type": "uint128" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "refundETH", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "from", "type": "address" }, { "internalType": "address", "name": "to", "type": "address" }, { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "safeTransferFrom", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "from", "type": "address" }, { "internalType": "address", "name": "to", "type": "address" }, { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "internalType": "bytes", "name": "_data", "type": "bytes" } ], "name": "safeTransferFrom", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "token", "type": "address" }, { "internalType": "uint256", "name": "value", "type": "uint256" }, { "internalType": "uint256", "name": "deadline", "type": "uint256" }, { "internalType": "uint8", "name": "v", "type": "uint8" }, { "internalType": "bytes32", "name": "r", "type": "bytes32" }, { "internalType": "bytes32", "name": "s", "type": "bytes32" } ], "name": "selfPermit", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "token", "type": "address" }, { "internalType": "uint256", "name": "nonce", "type": "uint256" }, { "internalType": "uint256", "name": "expiry", "type": "uint256" }, { "internalType": "uint8", "name": "v", "type": "uint8" }, { "internalType": "bytes32", "name": "r", "type": "bytes32" }, { "internalType": "bytes32", "name": "s", "type": "bytes32" } ], "name": "selfPermitAllowed", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "token", "type": "address" }, { "internalType": "uint256", "name": "nonce", "type": "uint256" }, { "internalType": "uint256", "name": "expiry", "type": "uint256" }, { "internalType": "uint8", "name": "v", "type": "uint8" }, { "internalType": "bytes32", "name": "r", "type": "bytes32" }, { "internalType": "bytes32", "name": "s", "type": "bytes32" } ], "name": "selfPermitAllowedIfNecessary", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "token", "type": "address" }, { "internalType": "uint256", "name": "value", "type": "uint256" }, { "internalType": "uint256", "name": "deadline", "type": "uint256" }, { "internalType": "uint8", "name": "v", "type": "uint8" }, { "internalType": "bytes32", "name": "r", "type": "bytes32" }, { "internalType": "bytes32", "name": "s", "type": "bytes32" } ], "name": "selfPermitIfNecessary", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "operator", "type": "address" }, { "internalType": "bool", "name": "approved", "type": "bool" } ], "name": "setApprovalForAll", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "bytes4", "name": "interfaceId", "type": "bytes4" } ], "name": "supportsInterface", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "token", "type": "address" }, { "internalType": "uint256", "name": "amountMinimum", "type": "uint256" }, { "internalType": "address", "name": "recipient", "type": "address" } ], "name": "sweepToken", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [], "name": "symbol", "outputs": [ { "internalType": "string", "name": "", "type": "string" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "index", "type": "uint256" } ], "name": "tokenByIndex", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "owner", "type": "address" }, { "internalType": "uint256", "name": "index", "type": "uint256" } ], "name": "tokenOfOwnerByIndex", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "tokenURI", "outputs": [ { "internalType": "string", "name": "", "type": "string" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "totalSupply", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "from", "type": "address" }, { "internalType": "address", "name": "to", "type": "address" }, { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "transferFrom", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "amount0Owed", "type": "uint256" }, { "internalType": "uint256", "name": "amount1Owed", "type": "uint256" }, { "internalType": "bytes", "name": "data", "type": "bytes" } ], "name": "uniswapV3MintCallback", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "amountMinimum", "type": "uint256" }, { "internalType": "address", "name": "recipient", "type": "address" } ], "name": "unwrapWETH9", "outputs": [], "stateMutability": "payable", "type": "function" }, { "stateMutability": "payable", "type": "receive" } ] ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/binds/proxyadmin/ProxyAdmin.go ================================================ // Code generated - DO NOT EDIT. // This file is a generated binding and any manual changes will be lost. package proxyadmin import ( "errors" "math/big" "strings" ethereum "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/event" ) // Reference imports to suppress errors if they are not otherwise used. var ( _ = errors.New _ = big.NewInt _ = strings.NewReader _ = ethereum.NotFound _ = bind.Bind _ = common.Big1 _ = types.BloomLookup _ = event.NewSubscription _ = abi.ConvertType ) // ProxyAdminMetaData contains all meta data concerning the ProxyAdmin contract. var ProxyAdminMetaData = &bind.MetaData{ ABI: "[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"contractITransparentUpgradeableProxy\",\"name\":\"proxy\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"changeProxyAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractITransparentUpgradeableProxy\",\"name\":\"proxy\",\"type\":\"address\"}],\"name\":\"getProxyAdmin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractITransparentUpgradeableProxy\",\"name\":\"proxy\",\"type\":\"address\"}],\"name\":\"getProxyImplementation\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractITransparentUpgradeableProxy\",\"name\":\"proxy\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"upgrade\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractITransparentUpgradeableProxy\",\"name\":\"proxy\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"}]", Bin: "0x6080806040523461005b5760008054336001600160a01b0319821681178355916001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09080a361060790816100618239f35b600080fdfe6080604081815260048036101561001557600080fd5b600092833560e01c90848263204e1c7a146104525750508063715018a6146103f85780637eff275e1461037e5780638da5cb5b146103565780639623609d146102415783816399a88ec4146101b557508063f2fde38b146100e95763f3b7dead1461007f57600080fd5b346100e55760203660031901126100e5576001600160a01b039083908190836100a6610491565b86516303e1469160e61b815291165afa926100bf610582565b93156100e257506100da8360208080965183010191016105b2565b169051908152f35b80fd5b8280fd5b50346100e55760203660031901126100e557610103610491565b9061010c61052a565b6001600160a01b03918216928315610163575050600054826bffffffffffffffffffffffff60a01b821617600055167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a380f35b906020608492519162461bcd60e51b8352820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152fd5b9290503461023d578060031936011261023d576101d0610491565b6101d86104ac565b906101e161052a565b6001600160a01b03908116803b156102395785928360249286519788958694631b2ce7f360e11b865216908401525af190811561023057506102205750f35b610229906104c2565b6100e25780f35b513d84823e3d90fd5b8580fd5b5050fd5b508290606036600319011261035257610258610491565b926102616104ac565b916044359067ffffffffffffffff821161034e573660238301121561034e57818101359161028e8361050e565b9261029b855194856104ec565b808452366024828401011161034a576024929181889260209586930183880137850101526102c761052a565b6001600160a01b0396871696873b1561034a5784519563278f794360e11b87521690850152826024850152815191826044860152855b8381106103365750505082849581606481858983819884010152601f8019910116810103019134905af190811561023057506102205750f35b8181018301518682016064015282016102fd565b8680fd5b8480fd5b5080fd5b505034610352578160031936011261035257905490516001600160a01b039091168152602090f35b5090346100e557806003193601126100e55782610399610491565b6103a16104ac565b6103a961052a565b6001600160a01b0391821690813b156103f45783602492865197889586946308f2839760e41b865216908401525af190811561023057506103e8575080f35b6103f1906104c2565b80f35b8380fd5b83346100e257806003193601126100e25761041161052a565b80546001600160a01b03198116825581906001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b91509134610352576020366003190112610352576001600160a01b03928291908461047b610491565b635c60da1b60e01b8352165afa926100bf610582565b600435906001600160a01b03821682036104a757565b600080fd5b602435906001600160a01b03821682036104a757565b67ffffffffffffffff81116104d657604052565b634e487b7160e01b600052604160045260246000fd5b90601f8019910116810190811067ffffffffffffffff8211176104d657604052565b67ffffffffffffffff81116104d657601f01601f191660200190565b6000546001600160a01b0316330361053e57565b606460405162461bcd60e51b815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b3d156105ad573d906105938261050e565b916105a160405193846104ec565b82523d6000602084013e565b606090565b908160209103126104a757516001600160a01b03811681036104a7579056fea2646970667358221220ba840368d39bdb0daee1e93666a2f68f6e68c27a9e300732a9bcd19912b7f8db64736f6c63430008130033", } // ProxyAdminABI is the input ABI used to generate the binding from. // Deprecated: Use ProxyAdminMetaData.ABI instead. var ProxyAdminABI = ProxyAdminMetaData.ABI // ProxyAdminBin is the compiled bytecode used for deploying new contracts. // Deprecated: Use ProxyAdminMetaData.Bin instead. var ProxyAdminBin = ProxyAdminMetaData.Bin // DeployProxyAdmin deploys a new Ethereum contract, binding an instance of ProxyAdmin to it. func DeployProxyAdmin(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *ProxyAdmin, error) { parsed, err := ProxyAdminMetaData.GetAbi() if err != nil { return common.Address{}, nil, nil, err } if parsed == nil { return common.Address{}, nil, nil, errors.New("GetABI returned nil") } address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(ProxyAdminBin), backend) if err != nil { return common.Address{}, nil, nil, err } return address, tx, &ProxyAdmin{ProxyAdminCaller: ProxyAdminCaller{contract: contract}, ProxyAdminTransactor: ProxyAdminTransactor{contract: contract}, ProxyAdminFilterer: ProxyAdminFilterer{contract: contract}}, nil } // ProxyAdmin is an auto generated Go binding around an Ethereum contract. type ProxyAdmin struct { ProxyAdminCaller // Read-only binding to the contract ProxyAdminTransactor // Write-only binding to the contract ProxyAdminFilterer // Log filterer for contract events } // ProxyAdminCaller is an auto generated read-only Go binding around an Ethereum contract. type ProxyAdminCaller struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // ProxyAdminTransactor is an auto generated write-only Go binding around an Ethereum contract. type ProxyAdminTransactor struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // ProxyAdminFilterer is an auto generated log filtering Go binding around an Ethereum contract events. type ProxyAdminFilterer struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // ProxyAdminSession is an auto generated Go binding around an Ethereum contract, // with pre-set call and transact options. type ProxyAdminSession struct { Contract *ProxyAdmin // Generic contract binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // ProxyAdminCallerSession is an auto generated read-only Go binding around an Ethereum contract, // with pre-set call options. type ProxyAdminCallerSession struct { Contract *ProxyAdminCaller // Generic contract caller binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session } // ProxyAdminTransactorSession is an auto generated write-only Go binding around an Ethereum contract, // with pre-set transact options. type ProxyAdminTransactorSession struct { Contract *ProxyAdminTransactor // Generic contract transactor binding to set the session for TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // ProxyAdminRaw is an auto generated low-level Go binding around an Ethereum contract. type ProxyAdminRaw struct { Contract *ProxyAdmin // Generic contract binding to access the raw methods on } // ProxyAdminCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. type ProxyAdminCallerRaw struct { Contract *ProxyAdminCaller // Generic read-only contract binding to access the raw methods on } // ProxyAdminTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. type ProxyAdminTransactorRaw struct { Contract *ProxyAdminTransactor // Generic write-only contract binding to access the raw methods on } // NewProxyAdmin creates a new instance of ProxyAdmin, bound to a specific deployed contract. func NewProxyAdmin(address common.Address, backend bind.ContractBackend) (*ProxyAdmin, error) { contract, err := bindProxyAdmin(address, backend, backend, backend) if err != nil { return nil, err } return &ProxyAdmin{ProxyAdminCaller: ProxyAdminCaller{contract: contract}, ProxyAdminTransactor: ProxyAdminTransactor{contract: contract}, ProxyAdminFilterer: ProxyAdminFilterer{contract: contract}}, nil } // NewProxyAdminCaller creates a new read-only instance of ProxyAdmin, bound to a specific deployed contract. func NewProxyAdminCaller(address common.Address, caller bind.ContractCaller) (*ProxyAdminCaller, error) { contract, err := bindProxyAdmin(address, caller, nil, nil) if err != nil { return nil, err } return &ProxyAdminCaller{contract: contract}, nil } // NewProxyAdminTransactor creates a new write-only instance of ProxyAdmin, bound to a specific deployed contract. func NewProxyAdminTransactor(address common.Address, transactor bind.ContractTransactor) (*ProxyAdminTransactor, error) { contract, err := bindProxyAdmin(address, nil, transactor, nil) if err != nil { return nil, err } return &ProxyAdminTransactor{contract: contract}, nil } // NewProxyAdminFilterer creates a new log filterer instance of ProxyAdmin, bound to a specific deployed contract. func NewProxyAdminFilterer(address common.Address, filterer bind.ContractFilterer) (*ProxyAdminFilterer, error) { contract, err := bindProxyAdmin(address, nil, nil, filterer) if err != nil { return nil, err } return &ProxyAdminFilterer{contract: contract}, nil } // bindProxyAdmin binds a generic wrapper to an already deployed contract. func bindProxyAdmin(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { parsed, err := ProxyAdminMetaData.GetAbi() if err != nil { return nil, err } return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_ProxyAdmin *ProxyAdminRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _ProxyAdmin.Contract.ProxyAdminCaller.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_ProxyAdmin *ProxyAdminRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _ProxyAdmin.Contract.ProxyAdminTransactor.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_ProxyAdmin *ProxyAdminRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _ProxyAdmin.Contract.ProxyAdminTransactor.contract.Transact(opts, method, params...) } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_ProxyAdmin *ProxyAdminCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _ProxyAdmin.Contract.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_ProxyAdmin *ProxyAdminTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _ProxyAdmin.Contract.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_ProxyAdmin *ProxyAdminTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _ProxyAdmin.Contract.contract.Transact(opts, method, params...) } // GetProxyAdmin is a free data retrieval call binding the contract method 0xf3b7dead. // // Solidity: function getProxyAdmin(address proxy) view returns(address) func (_ProxyAdmin *ProxyAdminCaller) GetProxyAdmin(opts *bind.CallOpts, proxy common.Address) (common.Address, error) { var out []interface{} err := _ProxyAdmin.contract.Call(opts, &out, "getProxyAdmin", proxy) if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // GetProxyAdmin is a free data retrieval call binding the contract method 0xf3b7dead. // // Solidity: function getProxyAdmin(address proxy) view returns(address) func (_ProxyAdmin *ProxyAdminSession) GetProxyAdmin(proxy common.Address) (common.Address, error) { return _ProxyAdmin.Contract.GetProxyAdmin(&_ProxyAdmin.CallOpts, proxy) } // GetProxyAdmin is a free data retrieval call binding the contract method 0xf3b7dead. // // Solidity: function getProxyAdmin(address proxy) view returns(address) func (_ProxyAdmin *ProxyAdminCallerSession) GetProxyAdmin(proxy common.Address) (common.Address, error) { return _ProxyAdmin.Contract.GetProxyAdmin(&_ProxyAdmin.CallOpts, proxy) } // GetProxyImplementation is a free data retrieval call binding the contract method 0x204e1c7a. // // Solidity: function getProxyImplementation(address proxy) view returns(address) func (_ProxyAdmin *ProxyAdminCaller) GetProxyImplementation(opts *bind.CallOpts, proxy common.Address) (common.Address, error) { var out []interface{} err := _ProxyAdmin.contract.Call(opts, &out, "getProxyImplementation", proxy) if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // GetProxyImplementation is a free data retrieval call binding the contract method 0x204e1c7a. // // Solidity: function getProxyImplementation(address proxy) view returns(address) func (_ProxyAdmin *ProxyAdminSession) GetProxyImplementation(proxy common.Address) (common.Address, error) { return _ProxyAdmin.Contract.GetProxyImplementation(&_ProxyAdmin.CallOpts, proxy) } // GetProxyImplementation is a free data retrieval call binding the contract method 0x204e1c7a. // // Solidity: function getProxyImplementation(address proxy) view returns(address) func (_ProxyAdmin *ProxyAdminCallerSession) GetProxyImplementation(proxy common.Address) (common.Address, error) { return _ProxyAdmin.Contract.GetProxyImplementation(&_ProxyAdmin.CallOpts, proxy) } // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. // // Solidity: function owner() view returns(address) func (_ProxyAdmin *ProxyAdminCaller) Owner(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _ProxyAdmin.contract.Call(opts, &out, "owner") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. // // Solidity: function owner() view returns(address) func (_ProxyAdmin *ProxyAdminSession) Owner() (common.Address, error) { return _ProxyAdmin.Contract.Owner(&_ProxyAdmin.CallOpts) } // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. // // Solidity: function owner() view returns(address) func (_ProxyAdmin *ProxyAdminCallerSession) Owner() (common.Address, error) { return _ProxyAdmin.Contract.Owner(&_ProxyAdmin.CallOpts) } // ChangeProxyAdmin is a paid mutator transaction binding the contract method 0x7eff275e. // // Solidity: function changeProxyAdmin(address proxy, address newAdmin) returns() func (_ProxyAdmin *ProxyAdminTransactor) ChangeProxyAdmin(opts *bind.TransactOpts, proxy common.Address, newAdmin common.Address) (*types.Transaction, error) { return _ProxyAdmin.contract.Transact(opts, "changeProxyAdmin", proxy, newAdmin) } // ChangeProxyAdmin is a paid mutator transaction binding the contract method 0x7eff275e. // // Solidity: function changeProxyAdmin(address proxy, address newAdmin) returns() func (_ProxyAdmin *ProxyAdminSession) ChangeProxyAdmin(proxy common.Address, newAdmin common.Address) (*types.Transaction, error) { return _ProxyAdmin.Contract.ChangeProxyAdmin(&_ProxyAdmin.TransactOpts, proxy, newAdmin) } // ChangeProxyAdmin is a paid mutator transaction binding the contract method 0x7eff275e. // // Solidity: function changeProxyAdmin(address proxy, address newAdmin) returns() func (_ProxyAdmin *ProxyAdminTransactorSession) ChangeProxyAdmin(proxy common.Address, newAdmin common.Address) (*types.Transaction, error) { return _ProxyAdmin.Contract.ChangeProxyAdmin(&_ProxyAdmin.TransactOpts, proxy, newAdmin) } // RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. // // Solidity: function renounceOwnership() returns() func (_ProxyAdmin *ProxyAdminTransactor) RenounceOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { return _ProxyAdmin.contract.Transact(opts, "renounceOwnership") } // RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. // // Solidity: function renounceOwnership() returns() func (_ProxyAdmin *ProxyAdminSession) RenounceOwnership() (*types.Transaction, error) { return _ProxyAdmin.Contract.RenounceOwnership(&_ProxyAdmin.TransactOpts) } // RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. // // Solidity: function renounceOwnership() returns() func (_ProxyAdmin *ProxyAdminTransactorSession) RenounceOwnership() (*types.Transaction, error) { return _ProxyAdmin.Contract.RenounceOwnership(&_ProxyAdmin.TransactOpts) } // TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. // // Solidity: function transferOwnership(address newOwner) returns() func (_ProxyAdmin *ProxyAdminTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) { return _ProxyAdmin.contract.Transact(opts, "transferOwnership", newOwner) } // TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. // // Solidity: function transferOwnership(address newOwner) returns() func (_ProxyAdmin *ProxyAdminSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { return _ProxyAdmin.Contract.TransferOwnership(&_ProxyAdmin.TransactOpts, newOwner) } // TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. // // Solidity: function transferOwnership(address newOwner) returns() func (_ProxyAdmin *ProxyAdminTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { return _ProxyAdmin.Contract.TransferOwnership(&_ProxyAdmin.TransactOpts, newOwner) } // Upgrade is a paid mutator transaction binding the contract method 0x99a88ec4. // // Solidity: function upgrade(address proxy, address implementation) returns() func (_ProxyAdmin *ProxyAdminTransactor) Upgrade(opts *bind.TransactOpts, proxy common.Address, implementation common.Address) (*types.Transaction, error) { return _ProxyAdmin.contract.Transact(opts, "upgrade", proxy, implementation) } // Upgrade is a paid mutator transaction binding the contract method 0x99a88ec4. // // Solidity: function upgrade(address proxy, address implementation) returns() func (_ProxyAdmin *ProxyAdminSession) Upgrade(proxy common.Address, implementation common.Address) (*types.Transaction, error) { return _ProxyAdmin.Contract.Upgrade(&_ProxyAdmin.TransactOpts, proxy, implementation) } // Upgrade is a paid mutator transaction binding the contract method 0x99a88ec4. // // Solidity: function upgrade(address proxy, address implementation) returns() func (_ProxyAdmin *ProxyAdminTransactorSession) Upgrade(proxy common.Address, implementation common.Address) (*types.Transaction, error) { return _ProxyAdmin.Contract.Upgrade(&_ProxyAdmin.TransactOpts, proxy, implementation) } // UpgradeAndCall is a paid mutator transaction binding the contract method 0x9623609d. // // Solidity: function upgradeAndCall(address proxy, address implementation, bytes data) payable returns() func (_ProxyAdmin *ProxyAdminTransactor) UpgradeAndCall(opts *bind.TransactOpts, proxy common.Address, implementation common.Address, data []byte) (*types.Transaction, error) { return _ProxyAdmin.contract.Transact(opts, "upgradeAndCall", proxy, implementation, data) } // UpgradeAndCall is a paid mutator transaction binding the contract method 0x9623609d. // // Solidity: function upgradeAndCall(address proxy, address implementation, bytes data) payable returns() func (_ProxyAdmin *ProxyAdminSession) UpgradeAndCall(proxy common.Address, implementation common.Address, data []byte) (*types.Transaction, error) { return _ProxyAdmin.Contract.UpgradeAndCall(&_ProxyAdmin.TransactOpts, proxy, implementation, data) } // UpgradeAndCall is a paid mutator transaction binding the contract method 0x9623609d. // // Solidity: function upgradeAndCall(address proxy, address implementation, bytes data) payable returns() func (_ProxyAdmin *ProxyAdminTransactorSession) UpgradeAndCall(proxy common.Address, implementation common.Address, data []byte) (*types.Transaction, error) { return _ProxyAdmin.Contract.UpgradeAndCall(&_ProxyAdmin.TransactOpts, proxy, implementation, data) } // ProxyAdminOwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the ProxyAdmin contract. type ProxyAdminOwnershipTransferredIterator struct { Event *ProxyAdminOwnershipTransferred // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *ProxyAdminOwnershipTransferredIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(ProxyAdminOwnershipTransferred) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(ProxyAdminOwnershipTransferred) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *ProxyAdminOwnershipTransferredIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *ProxyAdminOwnershipTransferredIterator) Close() error { it.sub.Unsubscribe() return nil } // ProxyAdminOwnershipTransferred represents a OwnershipTransferred event raised by the ProxyAdmin contract. type ProxyAdminOwnershipTransferred struct { PreviousOwner common.Address NewOwner common.Address Raw types.Log // Blockchain specific contextual infos } // FilterOwnershipTransferred is a free log retrieval operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. // // Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) func (_ProxyAdmin *ProxyAdminFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*ProxyAdminOwnershipTransferredIterator, error) { var previousOwnerRule []interface{} for _, previousOwnerItem := range previousOwner { previousOwnerRule = append(previousOwnerRule, previousOwnerItem) } var newOwnerRule []interface{} for _, newOwnerItem := range newOwner { newOwnerRule = append(newOwnerRule, newOwnerItem) } logs, sub, err := _ProxyAdmin.contract.FilterLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) if err != nil { return nil, err } return &ProxyAdminOwnershipTransferredIterator{contract: _ProxyAdmin.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil } // WatchOwnershipTransferred is a free log subscription operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. // // Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) func (_ProxyAdmin *ProxyAdminFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *ProxyAdminOwnershipTransferred, previousOwner []common.Address, newOwner []common.Address) (event.Subscription, error) { var previousOwnerRule []interface{} for _, previousOwnerItem := range previousOwner { previousOwnerRule = append(previousOwnerRule, previousOwnerItem) } var newOwnerRule []interface{} for _, newOwnerItem := range newOwner { newOwnerRule = append(newOwnerRule, newOwnerItem) } logs, sub, err := _ProxyAdmin.contract.WatchLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(ProxyAdminOwnershipTransferred) if err := _ProxyAdmin.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseOwnershipTransferred is a log parse operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. // // Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) func (_ProxyAdmin *ProxyAdminFilterer) ParseOwnershipTransferred(log types.Log) (*ProxyAdminOwnershipTransferred, error) { event := new(ProxyAdminOwnershipTransferred) if err := _ProxyAdmin.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { return nil, err } event.Raw = log return event, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/binds/sunpumplaunchpad/SunpumpLaunchpad.go ================================================ // Code generated - DO NOT EDIT. // This file is a generated binding and any manual changes will be lost. package sunpumplaunchpad import ( "errors" "math/big" "strings" ethereum "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/event" ) // Reference imports to suppress errors if they are not otherwise used. var ( _ = errors.New _ = big.NewInt _ = strings.NewReader _ = ethereum.NotFound _ = bind.Bind _ = common.Big1 _ = types.BloomLookup _ = event.NewSubscription _ = abi.ConvertType ) // SunpumplaunchpadMetaData contains all meta data concerning the Sunpumplaunchpad contract. var SunpumplaunchpadMetaData = &bind.MetaData{ ABI: "[{\"inputs\":[{\"name\":\"token\",\"type\":\"address\"}],\"name\":\"LaunchPending\",\"type\":\"event\"},{\"inputs\":[{\"indexed\":true,\"name\":\"oldLauncher\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"newLauncher\",\"type\":\"address\"}],\"name\":\"LauncherChanged\",\"type\":\"event\"},{\"inputs\":[{\"name\":\"oldFee\",\"type\":\"uint256\"},{\"name\":\"newFee\",\"type\":\"uint256\"}],\"name\":\"MinTxFeeSet\",\"type\":\"event\"},{\"inputs\":[{\"name\":\"oldFee\",\"type\":\"uint256\"},{\"name\":\"newFee\",\"type\":\"uint256\"}],\"name\":\"MintFeeSet\",\"type\":\"event\"},{\"inputs\":[{\"indexed\":true,\"name\":\"oldOperator\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"newOperator\",\"type\":\"address\"}],\"name\":\"OperatorChanged\",\"type\":\"event\"},{\"inputs\":[{\"indexed\":true,\"name\":\"oldOwner\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnerChanged\",\"type\":\"event\"},{\"inputs\":[{\"indexed\":true,\"name\":\"oldPendingOwner\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"newPendingOwner\",\"type\":\"address\"}],\"name\":\"PendingOwnerSet\",\"type\":\"event\"},{\"inputs\":[{\"name\":\"oldFee\",\"type\":\"uint256\"},{\"name\":\"newFee\",\"type\":\"uint256\"}],\"name\":\"PurchaseFeeSet\",\"type\":\"event\"},{\"inputs\":[{\"name\":\"oldFee\",\"type\":\"uint256\"},{\"name\":\"newFee\",\"type\":\"uint256\"}],\"name\":\"SaleFeeSet\",\"type\":\"event\"},{\"inputs\":[{\"name\":\"tokenAddress\",\"type\":\"address\"},{\"name\":\"tokenIndex\",\"type\":\"uint256\"},{\"name\":\"creator\",\"type\":\"address\"}],\"name\":\"TokenCreate\",\"type\":\"event\"},{\"inputs\":[{\"indexed\":true,\"name\":\"token\",\"type\":\"address\"}],\"name\":\"TokenLaunched\",\"type\":\"event\"},{\"inputs\":[{\"indexed\":true,\"name\":\"token\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"buyer\",\"type\":\"address\"},{\"name\":\"trxAmount\",\"type\":\"uint256\"},{\"name\":\"fee\",\"type\":\"uint256\"},{\"name\":\"tokenAmount\",\"type\":\"uint256\"},{\"name\":\"tokenReserve\",\"type\":\"uint256\"}],\"name\":\"TokenPurchased\",\"type\":\"event\"},{\"inputs\":[{\"indexed\":true,\"name\":\"token\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"seller\",\"type\":\"address\"},{\"name\":\"trxAmount\",\"type\":\"uint256\"},{\"name\":\"fee\",\"type\":\"uint256\"},{\"name\":\"tokenAmount\",\"type\":\"uint256\"}],\"name\":\"TokenSold\",\"type\":\"event\"},{\"outputs\":[{\"type\":\"uint256\"}],\"name\":\"LAUNCH_FEE\",\"stateMutability\":\"View\",\"type\":\"function\"},{\"outputs\":[{\"type\":\"uint256\"}],\"name\":\"LAUNCH_THRESHOLD\",\"stateMutability\":\"View\",\"type\":\"function\"},{\"outputs\":[{\"type\":\"uint256\"}],\"name\":\"LAUNCH_TRX_RESERVE\",\"stateMutability\":\"View\",\"type\":\"function\"},{\"outputs\":[{\"type\":\"uint256\"}],\"name\":\"TOKEN_SUPPLY\",\"stateMutability\":\"View\",\"type\":\"function\"},{\"outputs\":[{\"type\":\"uint256\"}],\"name\":\"TOTAL_SALE\",\"stateMutability\":\"View\",\"type\":\"function\"},{\"outputs\":[{\"type\":\"uint256\"}],\"name\":\"VIRTUAL_TOKEN_RESERVE_AMOUNT\",\"stateMutability\":\"View\",\"type\":\"function\"},{\"outputs\":[{\"type\":\"uint256\"}],\"name\":\"VIRTUAL_TRX_RESERVE_AMOUNT\",\"stateMutability\":\"View\",\"type\":\"function\"},{\"inputs\":[{\"name\":\"proxy\",\"type\":\"address\"}],\"name\":\"_becomeNewImplementation\",\"stateMutability\":\"Nonpayable\",\"type\":\"function\"},{\"name\":\"acceptOwner\",\"stateMutability\":\"Nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"name\":\"name\",\"type\":\"string\"},{\"name\":\"symbol\",\"type\":\"string\"}],\"name\":\"createAndInitPurchase\",\"stateMutability\":\"payable\",\"type\":\"function\"},{\"outputs\":[{\"type\":\"address\"}],\"name\":\"deadAddress\",\"stateMutability\":\"View\",\"type\":\"function\"},{\"outputs\":[{\"name\":\"trxAmount\",\"type\":\"uint256\"}],\"inputs\":[{\"name\":\"token\",\"type\":\"address\"},{\"name\":\"tokenAmount\",\"type\":\"uint256\"}],\"name\":\"getExactTokenAmountForPurchase\",\"stateMutability\":\"View\",\"type\":\"function\"},{\"outputs\":[{\"name\":\"trxAmount\",\"type\":\"uint256\"},{\"name\":\"fee\",\"type\":\"uint256\"}],\"inputs\":[{\"name\":\"token\",\"type\":\"address\"},{\"name\":\"tokenAmount\",\"type\":\"uint256\"}],\"name\":\"getExactTokenAmountForPurchaseWithFee\",\"stateMutability\":\"View\",\"type\":\"function\"},{\"outputs\":[{\"name\":\"tokenAmount\",\"type\":\"uint256\"}],\"inputs\":[{\"name\":\"token\",\"type\":\"address\"},{\"name\":\"trxAmount\",\"type\":\"uint256\"}],\"name\":\"getExactTrxAmountForSale\",\"stateMutability\":\"View\",\"type\":\"function\"},{\"outputs\":[{\"name\":\"tokenAmount\",\"type\":\"uint256\"},{\"name\":\"fee\",\"type\":\"uint256\"}],\"inputs\":[{\"name\":\"token\",\"type\":\"address\"},{\"name\":\"trxAmount\",\"type\":\"uint256\"}],\"name\":\"getExactTrxAmountForSaleWithFee\",\"stateMutability\":\"View\",\"type\":\"function\"},{\"outputs\":[{\"type\":\"uint256\"}],\"inputs\":[{\"name\":\"token\",\"type\":\"address\"}],\"name\":\"getPrice\",\"stateMutability\":\"View\",\"type\":\"function\"},{\"outputs\":[{\"name\":\"tokenAmount\",\"type\":\"uint256\"}],\"inputs\":[{\"name\":\"token\",\"type\":\"address\"},{\"name\":\"trxAmount\",\"type\":\"uint256\"}],\"name\":\"getTokenAmountByPurchase\",\"stateMutability\":\"View\",\"type\":\"function\"},{\"outputs\":[{\"name\":\"tokenAmount\",\"type\":\"uint256\"},{\"name\":\"fee\",\"type\":\"uint256\"}],\"inputs\":[{\"name\":\"token\",\"type\":\"address\"},{\"name\":\"trxAmount\",\"type\":\"uint256\"}],\"name\":\"getTokenAmountByPurchaseWithFee\",\"stateMutability\":\"View\",\"type\":\"function\"},{\"outputs\":[{\"type\":\"uint256\"}],\"inputs\":[{\"name\":\"token\",\"type\":\"address\"}],\"name\":\"getTokenState\",\"stateMutability\":\"View\",\"type\":\"function\"},{\"outputs\":[{\"name\":\"trxAmount\",\"type\":\"uint256\"}],\"inputs\":[{\"name\":\"token\",\"type\":\"address\"},{\"name\":\"tokenAmount\",\"type\":\"uint256\"}],\"name\":\"getTrxAmountBySale\",\"stateMutability\":\"View\",\"type\":\"function\"},{\"outputs\":[{\"name\":\"trxAmount\",\"type\":\"uint256\"},{\"name\":\"fee\",\"type\":\"uint256\"}],\"inputs\":[{\"name\":\"token\",\"type\":\"address\"},{\"name\":\"tokenAmount\",\"type\":\"uint256\"}],\"name\":\"getTrxAmountBySaleWithFee\",\"stateMutability\":\"View\",\"type\":\"function\"},{\"outputs\":[{\"type\":\"address\"}],\"name\":\"implementation\",\"stateMutability\":\"View\",\"type\":\"function\"},{\"inputs\":[{\"name\":\"_vault\",\"type\":\"address\"},{\"name\":\"_v2Router\",\"type\":\"address\"},{\"name\":\"_salefee\",\"type\":\"uint256\"},{\"name\":\"_purchasefee\",\"type\":\"uint256\"}],\"name\":\"initialize\",\"stateMutability\":\"Nonpayable\",\"type\":\"function\"},{\"outputs\":[{\"type\":\"uint256\"}],\"name\":\"launchFee\",\"stateMutability\":\"View\",\"type\":\"function\"},{\"inputs\":[{\"name\":\"token\",\"type\":\"address\"}],\"name\":\"launchToDEX\",\"stateMutability\":\"Nonpayable\",\"type\":\"function\"},{\"outputs\":[{\"type\":\"address\"}],\"name\":\"launcher\",\"stateMutability\":\"View\",\"type\":\"function\"},{\"outputs\":[{\"type\":\"uint256\"}],\"name\":\"maxPurachaseAmount\",\"stateMutability\":\"View\",\"type\":\"function\"},{\"outputs\":[{\"type\":\"uint256\"}],\"name\":\"minTxFee\",\"stateMutability\":\"View\",\"type\":\"function\"},{\"outputs\":[{\"type\":\"uint256\"}],\"name\":\"mintFee\",\"stateMutability\":\"View\",\"type\":\"function\"},{\"outputs\":[{\"type\":\"address\"}],\"name\":\"operator\",\"stateMutability\":\"View\",\"type\":\"function\"},{\"outputs\":[{\"type\":\"address\"}],\"name\":\"owner\",\"stateMutability\":\"View\",\"type\":\"function\"},{\"outputs\":[{\"type\":\"bool\"}],\"name\":\"pause\",\"stateMutability\":\"View\",\"type\":\"function\"},{\"name\":\"pausePad\",\"stateMutability\":\"Nonpayable\",\"type\":\"function\"},{\"outputs\":[{\"type\":\"address\"}],\"name\":\"pendingImplementation\",\"stateMutability\":\"View\",\"type\":\"function\"},{\"outputs\":[{\"type\":\"address\"}],\"name\":\"pendingOwner\",\"stateMutability\":\"View\",\"type\":\"function\"},{\"outputs\":[{\"type\":\"uint256\"}],\"name\":\"purchaseFee\",\"stateMutability\":\"View\",\"type\":\"function\"},{\"inputs\":[{\"name\":\"token\",\"type\":\"address\"},{\"name\":\"AmountMin\",\"type\":\"uint256\"}],\"name\":\"purchaseToken\",\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"name\":\"token\",\"type\":\"address\"}],\"name\":\"renounceTokenOwnership\",\"stateMutability\":\"Nonpayable\",\"type\":\"function\"},{\"name\":\"rerunPad\",\"stateMutability\":\"Nonpayable\",\"type\":\"function\"},{\"outputs\":[{\"type\":\"uint256\"}],\"name\":\"saleFee\",\"stateMutability\":\"View\",\"type\":\"function\"},{\"inputs\":[{\"name\":\"token\",\"type\":\"address\"},{\"name\":\"tokenAmount\",\"type\":\"uint256\"},{\"name\":\"AmountMin\",\"type\":\"uint256\"}],\"name\":\"saleToken\",\"stateMutability\":\"Nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"name\":\"newLauncher\",\"type\":\"address\"}],\"name\":\"setLauncher\",\"stateMutability\":\"Nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"name\":\"newFee\",\"type\":\"uint256\"}],\"name\":\"setMinTxFee\",\"stateMutability\":\"Nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"name\":\"_newMintFee\",\"type\":\"uint256\"},{\"name\":\"_newMinTxFee\",\"type\":\"uint256\"}],\"name\":\"setMintAndMinTxFee\",\"stateMutability\":\"Nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"name\":\"newFee\",\"type\":\"uint256\"}],\"name\":\"setMintFee\",\"stateMutability\":\"Nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"name\":\"newOp\",\"type\":\"address\"}],\"name\":\"setOperator\",\"stateMutability\":\"Nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"name\":\"newPendingOwner\",\"type\":\"address\"}],\"name\":\"setPendingOwner\",\"stateMutability\":\"Nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"name\":\"_fee\",\"type\":\"uint256\"}],\"name\":\"setPurchaseFee\",\"stateMutability\":\"Nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"name\":\"_fee\",\"type\":\"uint256\"}],\"name\":\"setSaleFee\",\"stateMutability\":\"Nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"name\":\"_addr\",\"type\":\"address\"}],\"name\":\"setVault\",\"stateMutability\":\"Nonpayable\",\"type\":\"function\"},{\"outputs\":[{\"type\":\"address\"}],\"inputs\":[{\"type\":\"uint256\"}],\"name\":\"tokenAddress\",\"stateMutability\":\"View\",\"type\":\"function\"},{\"outputs\":[{\"type\":\"uint256\"}],\"name\":\"tokenCount\",\"stateMutability\":\"View\",\"type\":\"function\"},{\"outputs\":[{\"type\":\"address\"}],\"inputs\":[{\"type\":\"address\"}],\"name\":\"tokenCreator\",\"stateMutability\":\"View\",\"type\":\"function\"},{\"outputs\":[{\"type\":\"address\"}],\"name\":\"v2Router\",\"stateMutability\":\"View\",\"type\":\"function\"},{\"outputs\":[{\"type\":\"address\"}],\"name\":\"vault\",\"stateMutability\":\"View\",\"type\":\"function\"},{\"outputs\":[{\"name\":\"TRXReserve\",\"type\":\"uint256\"},{\"name\":\"TokenReserve\",\"type\":\"uint256\"},{\"name\":\"launched\",\"type\":\"bool\"}],\"inputs\":[{\"type\":\"address\"}],\"name\":\"virtualPools\",\"stateMutability\":\"View\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]", } // SunpumplaunchpadABI is the input ABI used to generate the binding from. // Deprecated: Use SunpumplaunchpadMetaData.ABI instead. var SunpumplaunchpadABI = SunpumplaunchpadMetaData.ABI // Sunpumplaunchpad is an auto generated Go binding around an Ethereum contract. type Sunpumplaunchpad struct { SunpumplaunchpadCaller // Read-only binding to the contract SunpumplaunchpadTransactor // Write-only binding to the contract SunpumplaunchpadFilterer // Log filterer for contract events } // SunpumplaunchpadCaller is an auto generated read-only Go binding around an Ethereum contract. type SunpumplaunchpadCaller struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // SunpumplaunchpadTransactor is an auto generated write-only Go binding around an Ethereum contract. type SunpumplaunchpadTransactor struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // SunpumplaunchpadFilterer is an auto generated log filtering Go binding around an Ethereum contract events. type SunpumplaunchpadFilterer struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // SunpumplaunchpadSession is an auto generated Go binding around an Ethereum contract, // with pre-set call and transact options. type SunpumplaunchpadSession struct { Contract *Sunpumplaunchpad // Generic contract binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // SunpumplaunchpadCallerSession is an auto generated read-only Go binding around an Ethereum contract, // with pre-set call options. type SunpumplaunchpadCallerSession struct { Contract *SunpumplaunchpadCaller // Generic contract caller binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session } // SunpumplaunchpadTransactorSession is an auto generated write-only Go binding around an Ethereum contract, // with pre-set transact options. type SunpumplaunchpadTransactorSession struct { Contract *SunpumplaunchpadTransactor // Generic contract transactor binding to set the session for TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // SunpumplaunchpadRaw is an auto generated low-level Go binding around an Ethereum contract. type SunpumplaunchpadRaw struct { Contract *Sunpumplaunchpad // Generic contract binding to access the raw methods on } // SunpumplaunchpadCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. type SunpumplaunchpadCallerRaw struct { Contract *SunpumplaunchpadCaller // Generic read-only contract binding to access the raw methods on } // SunpumplaunchpadTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. type SunpumplaunchpadTransactorRaw struct { Contract *SunpumplaunchpadTransactor // Generic write-only contract binding to access the raw methods on } // NewSunpumplaunchpad creates a new instance of Sunpumplaunchpad, bound to a specific deployed contract. func NewSunpumplaunchpad(address common.Address, backend bind.ContractBackend) (*Sunpumplaunchpad, error) { contract, err := bindSunpumplaunchpad(address, backend, backend, backend) if err != nil { return nil, err } return &Sunpumplaunchpad{SunpumplaunchpadCaller: SunpumplaunchpadCaller{contract: contract}, SunpumplaunchpadTransactor: SunpumplaunchpadTransactor{contract: contract}, SunpumplaunchpadFilterer: SunpumplaunchpadFilterer{contract: contract}}, nil } // NewSunpumplaunchpadCaller creates a new read-only instance of Sunpumplaunchpad, bound to a specific deployed contract. func NewSunpumplaunchpadCaller(address common.Address, caller bind.ContractCaller) (*SunpumplaunchpadCaller, error) { contract, err := bindSunpumplaunchpad(address, caller, nil, nil) if err != nil { return nil, err } return &SunpumplaunchpadCaller{contract: contract}, nil } // NewSunpumplaunchpadTransactor creates a new write-only instance of Sunpumplaunchpad, bound to a specific deployed contract. func NewSunpumplaunchpadTransactor(address common.Address, transactor bind.ContractTransactor) (*SunpumplaunchpadTransactor, error) { contract, err := bindSunpumplaunchpad(address, nil, transactor, nil) if err != nil { return nil, err } return &SunpumplaunchpadTransactor{contract: contract}, nil } // NewSunpumplaunchpadFilterer creates a new log filterer instance of Sunpumplaunchpad, bound to a specific deployed contract. func NewSunpumplaunchpadFilterer(address common.Address, filterer bind.ContractFilterer) (*SunpumplaunchpadFilterer, error) { contract, err := bindSunpumplaunchpad(address, nil, nil, filterer) if err != nil { return nil, err } return &SunpumplaunchpadFilterer{contract: contract}, nil } // bindSunpumplaunchpad binds a generic wrapper to an already deployed contract. func bindSunpumplaunchpad(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { parsed, err := SunpumplaunchpadMetaData.GetAbi() if err != nil { return nil, err } return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_Sunpumplaunchpad *SunpumplaunchpadRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _Sunpumplaunchpad.Contract.SunpumplaunchpadCaller.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_Sunpumplaunchpad *SunpumplaunchpadRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.SunpumplaunchpadTransactor.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_Sunpumplaunchpad *SunpumplaunchpadRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.SunpumplaunchpadTransactor.contract.Transact(opts, method, params...) } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_Sunpumplaunchpad *SunpumplaunchpadCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _Sunpumplaunchpad.Contract.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_Sunpumplaunchpad *SunpumplaunchpadTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_Sunpumplaunchpad *SunpumplaunchpadTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.contract.Transact(opts, method, params...) } // LAUNCHFEE is a paid mutator transaction binding the contract method 0x09197a81. // // Solidity: function LAUNCH_FEE() View returns(uint256) func (_Sunpumplaunchpad *SunpumplaunchpadTransactor) LAUNCHFEE(opts *bind.TransactOpts) (*types.Transaction, error) { return _Sunpumplaunchpad.contract.Transact(opts, "LAUNCH_FEE") } // LAUNCHFEE is a paid mutator transaction binding the contract method 0x09197a81. // // Solidity: function LAUNCH_FEE() View returns(uint256) func (_Sunpumplaunchpad *SunpumplaunchpadSession) LAUNCHFEE() (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.LAUNCHFEE(&_Sunpumplaunchpad.TransactOpts) } // LAUNCHFEE is a paid mutator transaction binding the contract method 0x09197a81. // // Solidity: function LAUNCH_FEE() View returns(uint256) func (_Sunpumplaunchpad *SunpumplaunchpadTransactorSession) LAUNCHFEE() (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.LAUNCHFEE(&_Sunpumplaunchpad.TransactOpts) } // LAUNCHTHRESHOLD is a paid mutator transaction binding the contract method 0x1d32c2da. // // Solidity: function LAUNCH_THRESHOLD() View returns(uint256) func (_Sunpumplaunchpad *SunpumplaunchpadTransactor) LAUNCHTHRESHOLD(opts *bind.TransactOpts) (*types.Transaction, error) { return _Sunpumplaunchpad.contract.Transact(opts, "LAUNCH_THRESHOLD") } // LAUNCHTHRESHOLD is a paid mutator transaction binding the contract method 0x1d32c2da. // // Solidity: function LAUNCH_THRESHOLD() View returns(uint256) func (_Sunpumplaunchpad *SunpumplaunchpadSession) LAUNCHTHRESHOLD() (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.LAUNCHTHRESHOLD(&_Sunpumplaunchpad.TransactOpts) } // LAUNCHTHRESHOLD is a paid mutator transaction binding the contract method 0x1d32c2da. // // Solidity: function LAUNCH_THRESHOLD() View returns(uint256) func (_Sunpumplaunchpad *SunpumplaunchpadTransactorSession) LAUNCHTHRESHOLD() (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.LAUNCHTHRESHOLD(&_Sunpumplaunchpad.TransactOpts) } // LAUNCHTRXRESERVE is a paid mutator transaction binding the contract method 0x5da6454e. // // Solidity: function LAUNCH_TRX_RESERVE() View returns(uint256) func (_Sunpumplaunchpad *SunpumplaunchpadTransactor) LAUNCHTRXRESERVE(opts *bind.TransactOpts) (*types.Transaction, error) { return _Sunpumplaunchpad.contract.Transact(opts, "LAUNCH_TRX_RESERVE") } // LAUNCHTRXRESERVE is a paid mutator transaction binding the contract method 0x5da6454e. // // Solidity: function LAUNCH_TRX_RESERVE() View returns(uint256) func (_Sunpumplaunchpad *SunpumplaunchpadSession) LAUNCHTRXRESERVE() (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.LAUNCHTRXRESERVE(&_Sunpumplaunchpad.TransactOpts) } // LAUNCHTRXRESERVE is a paid mutator transaction binding the contract method 0x5da6454e. // // Solidity: function LAUNCH_TRX_RESERVE() View returns(uint256) func (_Sunpumplaunchpad *SunpumplaunchpadTransactorSession) LAUNCHTRXRESERVE() (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.LAUNCHTRXRESERVE(&_Sunpumplaunchpad.TransactOpts) } // TOKENSUPPLY is a paid mutator transaction binding the contract method 0xb152f6cf. // // Solidity: function TOKEN_SUPPLY() View returns(uint256) func (_Sunpumplaunchpad *SunpumplaunchpadTransactor) TOKENSUPPLY(opts *bind.TransactOpts) (*types.Transaction, error) { return _Sunpumplaunchpad.contract.Transact(opts, "TOKEN_SUPPLY") } // TOKENSUPPLY is a paid mutator transaction binding the contract method 0xb152f6cf. // // Solidity: function TOKEN_SUPPLY() View returns(uint256) func (_Sunpumplaunchpad *SunpumplaunchpadSession) TOKENSUPPLY() (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.TOKENSUPPLY(&_Sunpumplaunchpad.TransactOpts) } // TOKENSUPPLY is a paid mutator transaction binding the contract method 0xb152f6cf. // // Solidity: function TOKEN_SUPPLY() View returns(uint256) func (_Sunpumplaunchpad *SunpumplaunchpadTransactorSession) TOKENSUPPLY() (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.TOKENSUPPLY(&_Sunpumplaunchpad.TransactOpts) } // TOTALSALE is a paid mutator transaction binding the contract method 0x910cffe0. // // Solidity: function TOTAL_SALE() View returns(uint256) func (_Sunpumplaunchpad *SunpumplaunchpadTransactor) TOTALSALE(opts *bind.TransactOpts) (*types.Transaction, error) { return _Sunpumplaunchpad.contract.Transact(opts, "TOTAL_SALE") } // TOTALSALE is a paid mutator transaction binding the contract method 0x910cffe0. // // Solidity: function TOTAL_SALE() View returns(uint256) func (_Sunpumplaunchpad *SunpumplaunchpadSession) TOTALSALE() (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.TOTALSALE(&_Sunpumplaunchpad.TransactOpts) } // TOTALSALE is a paid mutator transaction binding the contract method 0x910cffe0. // // Solidity: function TOTAL_SALE() View returns(uint256) func (_Sunpumplaunchpad *SunpumplaunchpadTransactorSession) TOTALSALE() (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.TOTALSALE(&_Sunpumplaunchpad.TransactOpts) } // VIRTUALTOKENRESERVEAMOUNT is a paid mutator transaction binding the contract method 0x516cf387. // // Solidity: function VIRTUAL_TOKEN_RESERVE_AMOUNT() View returns(uint256) func (_Sunpumplaunchpad *SunpumplaunchpadTransactor) VIRTUALTOKENRESERVEAMOUNT(opts *bind.TransactOpts) (*types.Transaction, error) { return _Sunpumplaunchpad.contract.Transact(opts, "VIRTUAL_TOKEN_RESERVE_AMOUNT") } // VIRTUALTOKENRESERVEAMOUNT is a paid mutator transaction binding the contract method 0x516cf387. // // Solidity: function VIRTUAL_TOKEN_RESERVE_AMOUNT() View returns(uint256) func (_Sunpumplaunchpad *SunpumplaunchpadSession) VIRTUALTOKENRESERVEAMOUNT() (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.VIRTUALTOKENRESERVEAMOUNT(&_Sunpumplaunchpad.TransactOpts) } // VIRTUALTOKENRESERVEAMOUNT is a paid mutator transaction binding the contract method 0x516cf387. // // Solidity: function VIRTUAL_TOKEN_RESERVE_AMOUNT() View returns(uint256) func (_Sunpumplaunchpad *SunpumplaunchpadTransactorSession) VIRTUALTOKENRESERVEAMOUNT() (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.VIRTUALTOKENRESERVEAMOUNT(&_Sunpumplaunchpad.TransactOpts) } // VIRTUALTRXRESERVEAMOUNT is a paid mutator transaction binding the contract method 0x3013355f. // // Solidity: function VIRTUAL_TRX_RESERVE_AMOUNT() View returns(uint256) func (_Sunpumplaunchpad *SunpumplaunchpadTransactor) VIRTUALTRXRESERVEAMOUNT(opts *bind.TransactOpts) (*types.Transaction, error) { return _Sunpumplaunchpad.contract.Transact(opts, "VIRTUAL_TRX_RESERVE_AMOUNT") } // VIRTUALTRXRESERVEAMOUNT is a paid mutator transaction binding the contract method 0x3013355f. // // Solidity: function VIRTUAL_TRX_RESERVE_AMOUNT() View returns(uint256) func (_Sunpumplaunchpad *SunpumplaunchpadSession) VIRTUALTRXRESERVEAMOUNT() (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.VIRTUALTRXRESERVEAMOUNT(&_Sunpumplaunchpad.TransactOpts) } // VIRTUALTRXRESERVEAMOUNT is a paid mutator transaction binding the contract method 0x3013355f. // // Solidity: function VIRTUAL_TRX_RESERVE_AMOUNT() View returns(uint256) func (_Sunpumplaunchpad *SunpumplaunchpadTransactorSession) VIRTUALTRXRESERVEAMOUNT() (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.VIRTUALTRXRESERVEAMOUNT(&_Sunpumplaunchpad.TransactOpts) } // BecomeNewImplementation is a paid mutator transaction binding the contract method 0xb7f7e90d. // // Solidity: function _becomeNewImplementation(address proxy) Nonpayable returns() func (_Sunpumplaunchpad *SunpumplaunchpadTransactor) BecomeNewImplementation(opts *bind.TransactOpts, proxy common.Address) (*types.Transaction, error) { return _Sunpumplaunchpad.contract.Transact(opts, "_becomeNewImplementation", proxy) } // BecomeNewImplementation is a paid mutator transaction binding the contract method 0xb7f7e90d. // // Solidity: function _becomeNewImplementation(address proxy) Nonpayable returns() func (_Sunpumplaunchpad *SunpumplaunchpadSession) BecomeNewImplementation(proxy common.Address) (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.BecomeNewImplementation(&_Sunpumplaunchpad.TransactOpts, proxy) } // BecomeNewImplementation is a paid mutator transaction binding the contract method 0xb7f7e90d. // // Solidity: function _becomeNewImplementation(address proxy) Nonpayable returns() func (_Sunpumplaunchpad *SunpumplaunchpadTransactorSession) BecomeNewImplementation(proxy common.Address) (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.BecomeNewImplementation(&_Sunpumplaunchpad.TransactOpts, proxy) } // AcceptOwner is a paid mutator transaction binding the contract method 0xebbc4965. // // Solidity: function acceptOwner() Nonpayable returns() func (_Sunpumplaunchpad *SunpumplaunchpadTransactor) AcceptOwner(opts *bind.TransactOpts) (*types.Transaction, error) { return _Sunpumplaunchpad.contract.Transact(opts, "acceptOwner") } // AcceptOwner is a paid mutator transaction binding the contract method 0xebbc4965. // // Solidity: function acceptOwner() Nonpayable returns() func (_Sunpumplaunchpad *SunpumplaunchpadSession) AcceptOwner() (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.AcceptOwner(&_Sunpumplaunchpad.TransactOpts) } // AcceptOwner is a paid mutator transaction binding the contract method 0xebbc4965. // // Solidity: function acceptOwner() Nonpayable returns() func (_Sunpumplaunchpad *SunpumplaunchpadTransactorSession) AcceptOwner() (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.AcceptOwner(&_Sunpumplaunchpad.TransactOpts) } // CreateAndInitPurchase is a paid mutator transaction binding the contract method 0x2f70d762. // // Solidity: function createAndInitPurchase(string name, string symbol) payable returns() func (_Sunpumplaunchpad *SunpumplaunchpadTransactor) CreateAndInitPurchase(opts *bind.TransactOpts, name string, symbol string) (*types.Transaction, error) { return _Sunpumplaunchpad.contract.Transact(opts, "createAndInitPurchase", name, symbol) } // CreateAndInitPurchase is a paid mutator transaction binding the contract method 0x2f70d762. // // Solidity: function createAndInitPurchase(string name, string symbol) payable returns() func (_Sunpumplaunchpad *SunpumplaunchpadSession) CreateAndInitPurchase(name string, symbol string) (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.CreateAndInitPurchase(&_Sunpumplaunchpad.TransactOpts, name, symbol) } // CreateAndInitPurchase is a paid mutator transaction binding the contract method 0x2f70d762. // // Solidity: function createAndInitPurchase(string name, string symbol) payable returns() func (_Sunpumplaunchpad *SunpumplaunchpadTransactorSession) CreateAndInitPurchase(name string, symbol string) (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.CreateAndInitPurchase(&_Sunpumplaunchpad.TransactOpts, name, symbol) } // DeadAddress is a paid mutator transaction binding the contract method 0x27c8f835. // // Solidity: function deadAddress() View returns(address) func (_Sunpumplaunchpad *SunpumplaunchpadTransactor) DeadAddress(opts *bind.TransactOpts) (*types.Transaction, error) { return _Sunpumplaunchpad.contract.Transact(opts, "deadAddress") } // DeadAddress is a paid mutator transaction binding the contract method 0x27c8f835. // // Solidity: function deadAddress() View returns(address) func (_Sunpumplaunchpad *SunpumplaunchpadSession) DeadAddress() (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.DeadAddress(&_Sunpumplaunchpad.TransactOpts) } // DeadAddress is a paid mutator transaction binding the contract method 0x27c8f835. // // Solidity: function deadAddress() View returns(address) func (_Sunpumplaunchpad *SunpumplaunchpadTransactorSession) DeadAddress() (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.DeadAddress(&_Sunpumplaunchpad.TransactOpts) } // GetExactTokenAmountForPurchase is a paid mutator transaction binding the contract method 0x3ee09daa. // // Solidity: function getExactTokenAmountForPurchase(address token, uint256 tokenAmount) View returns(uint256 trxAmount) func (_Sunpumplaunchpad *SunpumplaunchpadTransactor) GetExactTokenAmountForPurchase(opts *bind.TransactOpts, token common.Address, tokenAmount *big.Int) (*types.Transaction, error) { return _Sunpumplaunchpad.contract.Transact(opts, "getExactTokenAmountForPurchase", token, tokenAmount) } // GetExactTokenAmountForPurchase is a paid mutator transaction binding the contract method 0x3ee09daa. // // Solidity: function getExactTokenAmountForPurchase(address token, uint256 tokenAmount) View returns(uint256 trxAmount) func (_Sunpumplaunchpad *SunpumplaunchpadSession) GetExactTokenAmountForPurchase(token common.Address, tokenAmount *big.Int) (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.GetExactTokenAmountForPurchase(&_Sunpumplaunchpad.TransactOpts, token, tokenAmount) } // GetExactTokenAmountForPurchase is a paid mutator transaction binding the contract method 0x3ee09daa. // // Solidity: function getExactTokenAmountForPurchase(address token, uint256 tokenAmount) View returns(uint256 trxAmount) func (_Sunpumplaunchpad *SunpumplaunchpadTransactorSession) GetExactTokenAmountForPurchase(token common.Address, tokenAmount *big.Int) (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.GetExactTokenAmountForPurchase(&_Sunpumplaunchpad.TransactOpts, token, tokenAmount) } // GetExactTokenAmountForPurchaseWithFee is a paid mutator transaction binding the contract method 0xec1f743b. // // Solidity: function getExactTokenAmountForPurchaseWithFee(address token, uint256 tokenAmount) View returns(uint256 trxAmount, uint256 fee) func (_Sunpumplaunchpad *SunpumplaunchpadTransactor) GetExactTokenAmountForPurchaseWithFee(opts *bind.TransactOpts, token common.Address, tokenAmount *big.Int) (*types.Transaction, error) { return _Sunpumplaunchpad.contract.Transact(opts, "getExactTokenAmountForPurchaseWithFee", token, tokenAmount) } // GetExactTokenAmountForPurchaseWithFee is a paid mutator transaction binding the contract method 0xec1f743b. // // Solidity: function getExactTokenAmountForPurchaseWithFee(address token, uint256 tokenAmount) View returns(uint256 trxAmount, uint256 fee) func (_Sunpumplaunchpad *SunpumplaunchpadSession) GetExactTokenAmountForPurchaseWithFee(token common.Address, tokenAmount *big.Int) (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.GetExactTokenAmountForPurchaseWithFee(&_Sunpumplaunchpad.TransactOpts, token, tokenAmount) } // GetExactTokenAmountForPurchaseWithFee is a paid mutator transaction binding the contract method 0xec1f743b. // // Solidity: function getExactTokenAmountForPurchaseWithFee(address token, uint256 tokenAmount) View returns(uint256 trxAmount, uint256 fee) func (_Sunpumplaunchpad *SunpumplaunchpadTransactorSession) GetExactTokenAmountForPurchaseWithFee(token common.Address, tokenAmount *big.Int) (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.GetExactTokenAmountForPurchaseWithFee(&_Sunpumplaunchpad.TransactOpts, token, tokenAmount) } // GetExactTrxAmountForSale is a paid mutator transaction binding the contract method 0x2d324eac. // // Solidity: function getExactTrxAmountForSale(address token, uint256 trxAmount) View returns(uint256 tokenAmount) func (_Sunpumplaunchpad *SunpumplaunchpadTransactor) GetExactTrxAmountForSale(opts *bind.TransactOpts, token common.Address, trxAmount *big.Int) (*types.Transaction, error) { return _Sunpumplaunchpad.contract.Transact(opts, "getExactTrxAmountForSale", token, trxAmount) } // GetExactTrxAmountForSale is a paid mutator transaction binding the contract method 0x2d324eac. // // Solidity: function getExactTrxAmountForSale(address token, uint256 trxAmount) View returns(uint256 tokenAmount) func (_Sunpumplaunchpad *SunpumplaunchpadSession) GetExactTrxAmountForSale(token common.Address, trxAmount *big.Int) (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.GetExactTrxAmountForSale(&_Sunpumplaunchpad.TransactOpts, token, trxAmount) } // GetExactTrxAmountForSale is a paid mutator transaction binding the contract method 0x2d324eac. // // Solidity: function getExactTrxAmountForSale(address token, uint256 trxAmount) View returns(uint256 tokenAmount) func (_Sunpumplaunchpad *SunpumplaunchpadTransactorSession) GetExactTrxAmountForSale(token common.Address, trxAmount *big.Int) (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.GetExactTrxAmountForSale(&_Sunpumplaunchpad.TransactOpts, token, trxAmount) } // GetExactTrxAmountForSaleWithFee is a paid mutator transaction binding the contract method 0x44388b14. // // Solidity: function getExactTrxAmountForSaleWithFee(address token, uint256 trxAmount) View returns(uint256 tokenAmount, uint256 fee) func (_Sunpumplaunchpad *SunpumplaunchpadTransactor) GetExactTrxAmountForSaleWithFee(opts *bind.TransactOpts, token common.Address, trxAmount *big.Int) (*types.Transaction, error) { return _Sunpumplaunchpad.contract.Transact(opts, "getExactTrxAmountForSaleWithFee", token, trxAmount) } // GetExactTrxAmountForSaleWithFee is a paid mutator transaction binding the contract method 0x44388b14. // // Solidity: function getExactTrxAmountForSaleWithFee(address token, uint256 trxAmount) View returns(uint256 tokenAmount, uint256 fee) func (_Sunpumplaunchpad *SunpumplaunchpadSession) GetExactTrxAmountForSaleWithFee(token common.Address, trxAmount *big.Int) (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.GetExactTrxAmountForSaleWithFee(&_Sunpumplaunchpad.TransactOpts, token, trxAmount) } // GetExactTrxAmountForSaleWithFee is a paid mutator transaction binding the contract method 0x44388b14. // // Solidity: function getExactTrxAmountForSaleWithFee(address token, uint256 trxAmount) View returns(uint256 tokenAmount, uint256 fee) func (_Sunpumplaunchpad *SunpumplaunchpadTransactorSession) GetExactTrxAmountForSaleWithFee(token common.Address, trxAmount *big.Int) (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.GetExactTrxAmountForSaleWithFee(&_Sunpumplaunchpad.TransactOpts, token, trxAmount) } // GetPrice is a paid mutator transaction binding the contract method 0x41976e09. // // Solidity: function getPrice(address token) View returns(uint256) func (_Sunpumplaunchpad *SunpumplaunchpadTransactor) GetPrice(opts *bind.TransactOpts, token common.Address) (*types.Transaction, error) { return _Sunpumplaunchpad.contract.Transact(opts, "getPrice", token) } // GetPrice is a paid mutator transaction binding the contract method 0x41976e09. // // Solidity: function getPrice(address token) View returns(uint256) func (_Sunpumplaunchpad *SunpumplaunchpadSession) GetPrice(token common.Address) (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.GetPrice(&_Sunpumplaunchpad.TransactOpts, token) } // GetPrice is a paid mutator transaction binding the contract method 0x41976e09. // // Solidity: function getPrice(address token) View returns(uint256) func (_Sunpumplaunchpad *SunpumplaunchpadTransactorSession) GetPrice(token common.Address) (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.GetPrice(&_Sunpumplaunchpad.TransactOpts, token) } // GetTokenAmountByPurchase is a paid mutator transaction binding the contract method 0x1e105689. // // Solidity: function getTokenAmountByPurchase(address token, uint256 trxAmount) View returns(uint256 tokenAmount) func (_Sunpumplaunchpad *SunpumplaunchpadTransactor) GetTokenAmountByPurchase(opts *bind.TransactOpts, token common.Address, trxAmount *big.Int) (*types.Transaction, error) { return _Sunpumplaunchpad.contract.Transact(opts, "getTokenAmountByPurchase", token, trxAmount) } // GetTokenAmountByPurchase is a paid mutator transaction binding the contract method 0x1e105689. // // Solidity: function getTokenAmountByPurchase(address token, uint256 trxAmount) View returns(uint256 tokenAmount) func (_Sunpumplaunchpad *SunpumplaunchpadSession) GetTokenAmountByPurchase(token common.Address, trxAmount *big.Int) (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.GetTokenAmountByPurchase(&_Sunpumplaunchpad.TransactOpts, token, trxAmount) } // GetTokenAmountByPurchase is a paid mutator transaction binding the contract method 0x1e105689. // // Solidity: function getTokenAmountByPurchase(address token, uint256 trxAmount) View returns(uint256 tokenAmount) func (_Sunpumplaunchpad *SunpumplaunchpadTransactorSession) GetTokenAmountByPurchase(token common.Address, trxAmount *big.Int) (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.GetTokenAmountByPurchase(&_Sunpumplaunchpad.TransactOpts, token, trxAmount) } // GetTokenAmountByPurchaseWithFee is a paid mutator transaction binding the contract method 0x0bce3861. // // Solidity: function getTokenAmountByPurchaseWithFee(address token, uint256 trxAmount) View returns(uint256 tokenAmount, uint256 fee) func (_Sunpumplaunchpad *SunpumplaunchpadTransactor) GetTokenAmountByPurchaseWithFee(opts *bind.TransactOpts, token common.Address, trxAmount *big.Int) (*types.Transaction, error) { return _Sunpumplaunchpad.contract.Transact(opts, "getTokenAmountByPurchaseWithFee", token, trxAmount) } // GetTokenAmountByPurchaseWithFee is a paid mutator transaction binding the contract method 0x0bce3861. // // Solidity: function getTokenAmountByPurchaseWithFee(address token, uint256 trxAmount) View returns(uint256 tokenAmount, uint256 fee) func (_Sunpumplaunchpad *SunpumplaunchpadSession) GetTokenAmountByPurchaseWithFee(token common.Address, trxAmount *big.Int) (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.GetTokenAmountByPurchaseWithFee(&_Sunpumplaunchpad.TransactOpts, token, trxAmount) } // GetTokenAmountByPurchaseWithFee is a paid mutator transaction binding the contract method 0x0bce3861. // // Solidity: function getTokenAmountByPurchaseWithFee(address token, uint256 trxAmount) View returns(uint256 tokenAmount, uint256 fee) func (_Sunpumplaunchpad *SunpumplaunchpadTransactorSession) GetTokenAmountByPurchaseWithFee(token common.Address, trxAmount *big.Int) (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.GetTokenAmountByPurchaseWithFee(&_Sunpumplaunchpad.TransactOpts, token, trxAmount) } // GetTokenState is a paid mutator transaction binding the contract method 0x0b3eb970. // // Solidity: function getTokenState(address token) View returns(uint256) func (_Sunpumplaunchpad *SunpumplaunchpadTransactor) GetTokenState(opts *bind.TransactOpts, token common.Address) (*types.Transaction, error) { return _Sunpumplaunchpad.contract.Transact(opts, "getTokenState", token) } // GetTokenState is a paid mutator transaction binding the contract method 0x0b3eb970. // // Solidity: function getTokenState(address token) View returns(uint256) func (_Sunpumplaunchpad *SunpumplaunchpadSession) GetTokenState(token common.Address) (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.GetTokenState(&_Sunpumplaunchpad.TransactOpts, token) } // GetTokenState is a paid mutator transaction binding the contract method 0x0b3eb970. // // Solidity: function getTokenState(address token) View returns(uint256) func (_Sunpumplaunchpad *SunpumplaunchpadTransactorSession) GetTokenState(token common.Address) (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.GetTokenState(&_Sunpumplaunchpad.TransactOpts, token) } // GetTrxAmountBySale is a paid mutator transaction binding the contract method 0x2a5c0b6e. // // Solidity: function getTrxAmountBySale(address token, uint256 tokenAmount) View returns(uint256 trxAmount) func (_Sunpumplaunchpad *SunpumplaunchpadTransactor) GetTrxAmountBySale(opts *bind.TransactOpts, token common.Address, tokenAmount *big.Int) (*types.Transaction, error) { return _Sunpumplaunchpad.contract.Transact(opts, "getTrxAmountBySale", token, tokenAmount) } // GetTrxAmountBySale is a paid mutator transaction binding the contract method 0x2a5c0b6e. // // Solidity: function getTrxAmountBySale(address token, uint256 tokenAmount) View returns(uint256 trxAmount) func (_Sunpumplaunchpad *SunpumplaunchpadSession) GetTrxAmountBySale(token common.Address, tokenAmount *big.Int) (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.GetTrxAmountBySale(&_Sunpumplaunchpad.TransactOpts, token, tokenAmount) } // GetTrxAmountBySale is a paid mutator transaction binding the contract method 0x2a5c0b6e. // // Solidity: function getTrxAmountBySale(address token, uint256 tokenAmount) View returns(uint256 trxAmount) func (_Sunpumplaunchpad *SunpumplaunchpadTransactorSession) GetTrxAmountBySale(token common.Address, tokenAmount *big.Int) (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.GetTrxAmountBySale(&_Sunpumplaunchpad.TransactOpts, token, tokenAmount) } // GetTrxAmountBySaleWithFee is a paid mutator transaction binding the contract method 0xa85e75a8. // // Solidity: function getTrxAmountBySaleWithFee(address token, uint256 tokenAmount) View returns(uint256 trxAmount, uint256 fee) func (_Sunpumplaunchpad *SunpumplaunchpadTransactor) GetTrxAmountBySaleWithFee(opts *bind.TransactOpts, token common.Address, tokenAmount *big.Int) (*types.Transaction, error) { return _Sunpumplaunchpad.contract.Transact(opts, "getTrxAmountBySaleWithFee", token, tokenAmount) } // GetTrxAmountBySaleWithFee is a paid mutator transaction binding the contract method 0xa85e75a8. // // Solidity: function getTrxAmountBySaleWithFee(address token, uint256 tokenAmount) View returns(uint256 trxAmount, uint256 fee) func (_Sunpumplaunchpad *SunpumplaunchpadSession) GetTrxAmountBySaleWithFee(token common.Address, tokenAmount *big.Int) (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.GetTrxAmountBySaleWithFee(&_Sunpumplaunchpad.TransactOpts, token, tokenAmount) } // GetTrxAmountBySaleWithFee is a paid mutator transaction binding the contract method 0xa85e75a8. // // Solidity: function getTrxAmountBySaleWithFee(address token, uint256 tokenAmount) View returns(uint256 trxAmount, uint256 fee) func (_Sunpumplaunchpad *SunpumplaunchpadTransactorSession) GetTrxAmountBySaleWithFee(token common.Address, tokenAmount *big.Int) (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.GetTrxAmountBySaleWithFee(&_Sunpumplaunchpad.TransactOpts, token, tokenAmount) } // Implementation is a paid mutator transaction binding the contract method 0x5c60da1b. // // Solidity: function implementation() View returns(address) func (_Sunpumplaunchpad *SunpumplaunchpadTransactor) Implementation(opts *bind.TransactOpts) (*types.Transaction, error) { return _Sunpumplaunchpad.contract.Transact(opts, "implementation") } // Implementation is a paid mutator transaction binding the contract method 0x5c60da1b. // // Solidity: function implementation() View returns(address) func (_Sunpumplaunchpad *SunpumplaunchpadSession) Implementation() (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.Implementation(&_Sunpumplaunchpad.TransactOpts) } // Implementation is a paid mutator transaction binding the contract method 0x5c60da1b. // // Solidity: function implementation() View returns(address) func (_Sunpumplaunchpad *SunpumplaunchpadTransactorSession) Implementation() (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.Implementation(&_Sunpumplaunchpad.TransactOpts) } // Initialize is a paid mutator transaction binding the contract method 0xeb990c59. // // Solidity: function initialize(address _vault, address _v2Router, uint256 _salefee, uint256 _purchasefee) Nonpayable returns() func (_Sunpumplaunchpad *SunpumplaunchpadTransactor) Initialize(opts *bind.TransactOpts, _vault common.Address, _v2Router common.Address, _salefee *big.Int, _purchasefee *big.Int) (*types.Transaction, error) { return _Sunpumplaunchpad.contract.Transact(opts, "initialize", _vault, _v2Router, _salefee, _purchasefee) } // Initialize is a paid mutator transaction binding the contract method 0xeb990c59. // // Solidity: function initialize(address _vault, address _v2Router, uint256 _salefee, uint256 _purchasefee) Nonpayable returns() func (_Sunpumplaunchpad *SunpumplaunchpadSession) Initialize(_vault common.Address, _v2Router common.Address, _salefee *big.Int, _purchasefee *big.Int) (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.Initialize(&_Sunpumplaunchpad.TransactOpts, _vault, _v2Router, _salefee, _purchasefee) } // Initialize is a paid mutator transaction binding the contract method 0xeb990c59. // // Solidity: function initialize(address _vault, address _v2Router, uint256 _salefee, uint256 _purchasefee) Nonpayable returns() func (_Sunpumplaunchpad *SunpumplaunchpadTransactorSession) Initialize(_vault common.Address, _v2Router common.Address, _salefee *big.Int, _purchasefee *big.Int) (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.Initialize(&_Sunpumplaunchpad.TransactOpts, _vault, _v2Router, _salefee, _purchasefee) } // LaunchFee is a paid mutator transaction binding the contract method 0xcf3cf573. // // Solidity: function launchFee() View returns(uint256) func (_Sunpumplaunchpad *SunpumplaunchpadTransactor) LaunchFee(opts *bind.TransactOpts) (*types.Transaction, error) { return _Sunpumplaunchpad.contract.Transact(opts, "launchFee") } // LaunchFee is a paid mutator transaction binding the contract method 0xcf3cf573. // // Solidity: function launchFee() View returns(uint256) func (_Sunpumplaunchpad *SunpumplaunchpadSession) LaunchFee() (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.LaunchFee(&_Sunpumplaunchpad.TransactOpts) } // LaunchFee is a paid mutator transaction binding the contract method 0xcf3cf573. // // Solidity: function launchFee() View returns(uint256) func (_Sunpumplaunchpad *SunpumplaunchpadTransactorSession) LaunchFee() (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.LaunchFee(&_Sunpumplaunchpad.TransactOpts) } // LaunchToDEX is a paid mutator transaction binding the contract method 0x5a47db1d. // // Solidity: function launchToDEX(address token) Nonpayable returns() func (_Sunpumplaunchpad *SunpumplaunchpadTransactor) LaunchToDEX(opts *bind.TransactOpts, token common.Address) (*types.Transaction, error) { return _Sunpumplaunchpad.contract.Transact(opts, "launchToDEX", token) } // LaunchToDEX is a paid mutator transaction binding the contract method 0x5a47db1d. // // Solidity: function launchToDEX(address token) Nonpayable returns() func (_Sunpumplaunchpad *SunpumplaunchpadSession) LaunchToDEX(token common.Address) (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.LaunchToDEX(&_Sunpumplaunchpad.TransactOpts, token) } // LaunchToDEX is a paid mutator transaction binding the contract method 0x5a47db1d. // // Solidity: function launchToDEX(address token) Nonpayable returns() func (_Sunpumplaunchpad *SunpumplaunchpadTransactorSession) LaunchToDEX(token common.Address) (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.LaunchToDEX(&_Sunpumplaunchpad.TransactOpts, token) } // Launcher is a paid mutator transaction binding the contract method 0x16eebd1e. // // Solidity: function launcher() View returns(address) func (_Sunpumplaunchpad *SunpumplaunchpadTransactor) Launcher(opts *bind.TransactOpts) (*types.Transaction, error) { return _Sunpumplaunchpad.contract.Transact(opts, "launcher") } // Launcher is a paid mutator transaction binding the contract method 0x16eebd1e. // // Solidity: function launcher() View returns(address) func (_Sunpumplaunchpad *SunpumplaunchpadSession) Launcher() (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.Launcher(&_Sunpumplaunchpad.TransactOpts) } // Launcher is a paid mutator transaction binding the contract method 0x16eebd1e. // // Solidity: function launcher() View returns(address) func (_Sunpumplaunchpad *SunpumplaunchpadTransactorSession) Launcher() (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.Launcher(&_Sunpumplaunchpad.TransactOpts) } // MaxPurachaseAmount is a paid mutator transaction binding the contract method 0xceee6c1b. // // Solidity: function maxPurachaseAmount() View returns(uint256) func (_Sunpumplaunchpad *SunpumplaunchpadTransactor) MaxPurachaseAmount(opts *bind.TransactOpts) (*types.Transaction, error) { return _Sunpumplaunchpad.contract.Transact(opts, "maxPurachaseAmount") } // MaxPurachaseAmount is a paid mutator transaction binding the contract method 0xceee6c1b. // // Solidity: function maxPurachaseAmount() View returns(uint256) func (_Sunpumplaunchpad *SunpumplaunchpadSession) MaxPurachaseAmount() (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.MaxPurachaseAmount(&_Sunpumplaunchpad.TransactOpts) } // MaxPurachaseAmount is a paid mutator transaction binding the contract method 0xceee6c1b. // // Solidity: function maxPurachaseAmount() View returns(uint256) func (_Sunpumplaunchpad *SunpumplaunchpadTransactorSession) MaxPurachaseAmount() (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.MaxPurachaseAmount(&_Sunpumplaunchpad.TransactOpts) } // MinTxFee is a paid mutator transaction binding the contract method 0xfe29b4e8. // // Solidity: function minTxFee() View returns(uint256) func (_Sunpumplaunchpad *SunpumplaunchpadTransactor) MinTxFee(opts *bind.TransactOpts) (*types.Transaction, error) { return _Sunpumplaunchpad.contract.Transact(opts, "minTxFee") } // MinTxFee is a paid mutator transaction binding the contract method 0xfe29b4e8. // // Solidity: function minTxFee() View returns(uint256) func (_Sunpumplaunchpad *SunpumplaunchpadSession) MinTxFee() (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.MinTxFee(&_Sunpumplaunchpad.TransactOpts) } // MinTxFee is a paid mutator transaction binding the contract method 0xfe29b4e8. // // Solidity: function minTxFee() View returns(uint256) func (_Sunpumplaunchpad *SunpumplaunchpadTransactorSession) MinTxFee() (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.MinTxFee(&_Sunpumplaunchpad.TransactOpts) } // MintFee is a paid mutator transaction binding the contract method 0x13966db5. // // Solidity: function mintFee() View returns(uint256) func (_Sunpumplaunchpad *SunpumplaunchpadTransactor) MintFee(opts *bind.TransactOpts) (*types.Transaction, error) { return _Sunpumplaunchpad.contract.Transact(opts, "mintFee") } // MintFee is a paid mutator transaction binding the contract method 0x13966db5. // // Solidity: function mintFee() View returns(uint256) func (_Sunpumplaunchpad *SunpumplaunchpadSession) MintFee() (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.MintFee(&_Sunpumplaunchpad.TransactOpts) } // MintFee is a paid mutator transaction binding the contract method 0x13966db5. // // Solidity: function mintFee() View returns(uint256) func (_Sunpumplaunchpad *SunpumplaunchpadTransactorSession) MintFee() (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.MintFee(&_Sunpumplaunchpad.TransactOpts) } // Operator is a paid mutator transaction binding the contract method 0x570ca735. // // Solidity: function operator() View returns(address) func (_Sunpumplaunchpad *SunpumplaunchpadTransactor) Operator(opts *bind.TransactOpts) (*types.Transaction, error) { return _Sunpumplaunchpad.contract.Transact(opts, "operator") } // Operator is a paid mutator transaction binding the contract method 0x570ca735. // // Solidity: function operator() View returns(address) func (_Sunpumplaunchpad *SunpumplaunchpadSession) Operator() (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.Operator(&_Sunpumplaunchpad.TransactOpts) } // Operator is a paid mutator transaction binding the contract method 0x570ca735. // // Solidity: function operator() View returns(address) func (_Sunpumplaunchpad *SunpumplaunchpadTransactorSession) Operator() (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.Operator(&_Sunpumplaunchpad.TransactOpts) } // Owner is a paid mutator transaction binding the contract method 0x8da5cb5b. // // Solidity: function owner() View returns(address) func (_Sunpumplaunchpad *SunpumplaunchpadTransactor) Owner(opts *bind.TransactOpts) (*types.Transaction, error) { return _Sunpumplaunchpad.contract.Transact(opts, "owner") } // Owner is a paid mutator transaction binding the contract method 0x8da5cb5b. // // Solidity: function owner() View returns(address) func (_Sunpumplaunchpad *SunpumplaunchpadSession) Owner() (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.Owner(&_Sunpumplaunchpad.TransactOpts) } // Owner is a paid mutator transaction binding the contract method 0x8da5cb5b. // // Solidity: function owner() View returns(address) func (_Sunpumplaunchpad *SunpumplaunchpadTransactorSession) Owner() (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.Owner(&_Sunpumplaunchpad.TransactOpts) } // Pause is a paid mutator transaction binding the contract method 0x8456cb59. // // Solidity: function pause() View returns(bool) func (_Sunpumplaunchpad *SunpumplaunchpadTransactor) Pause(opts *bind.TransactOpts) (*types.Transaction, error) { return _Sunpumplaunchpad.contract.Transact(opts, "pause") } // Pause is a paid mutator transaction binding the contract method 0x8456cb59. // // Solidity: function pause() View returns(bool) func (_Sunpumplaunchpad *SunpumplaunchpadSession) Pause() (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.Pause(&_Sunpumplaunchpad.TransactOpts) } // Pause is a paid mutator transaction binding the contract method 0x8456cb59. // // Solidity: function pause() View returns(bool) func (_Sunpumplaunchpad *SunpumplaunchpadTransactorSession) Pause() (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.Pause(&_Sunpumplaunchpad.TransactOpts) } // PausePad is a paid mutator transaction binding the contract method 0x32adb109. // // Solidity: function pausePad() Nonpayable returns() func (_Sunpumplaunchpad *SunpumplaunchpadTransactor) PausePad(opts *bind.TransactOpts) (*types.Transaction, error) { return _Sunpumplaunchpad.contract.Transact(opts, "pausePad") } // PausePad is a paid mutator transaction binding the contract method 0x32adb109. // // Solidity: function pausePad() Nonpayable returns() func (_Sunpumplaunchpad *SunpumplaunchpadSession) PausePad() (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.PausePad(&_Sunpumplaunchpad.TransactOpts) } // PausePad is a paid mutator transaction binding the contract method 0x32adb109. // // Solidity: function pausePad() Nonpayable returns() func (_Sunpumplaunchpad *SunpumplaunchpadTransactorSession) PausePad() (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.PausePad(&_Sunpumplaunchpad.TransactOpts) } // PendingImplementation is a paid mutator transaction binding the contract method 0x396f7b23. // // Solidity: function pendingImplementation() View returns(address) func (_Sunpumplaunchpad *SunpumplaunchpadTransactor) PendingImplementation(opts *bind.TransactOpts) (*types.Transaction, error) { return _Sunpumplaunchpad.contract.Transact(opts, "pendingImplementation") } // PendingImplementation is a paid mutator transaction binding the contract method 0x396f7b23. // // Solidity: function pendingImplementation() View returns(address) func (_Sunpumplaunchpad *SunpumplaunchpadSession) PendingImplementation() (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.PendingImplementation(&_Sunpumplaunchpad.TransactOpts) } // PendingImplementation is a paid mutator transaction binding the contract method 0x396f7b23. // // Solidity: function pendingImplementation() View returns(address) func (_Sunpumplaunchpad *SunpumplaunchpadTransactorSession) PendingImplementation() (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.PendingImplementation(&_Sunpumplaunchpad.TransactOpts) } // PendingOwner is a paid mutator transaction binding the contract method 0xe30c3978. // // Solidity: function pendingOwner() View returns(address) func (_Sunpumplaunchpad *SunpumplaunchpadTransactor) PendingOwner(opts *bind.TransactOpts) (*types.Transaction, error) { return _Sunpumplaunchpad.contract.Transact(opts, "pendingOwner") } // PendingOwner is a paid mutator transaction binding the contract method 0xe30c3978. // // Solidity: function pendingOwner() View returns(address) func (_Sunpumplaunchpad *SunpumplaunchpadSession) PendingOwner() (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.PendingOwner(&_Sunpumplaunchpad.TransactOpts) } // PendingOwner is a paid mutator transaction binding the contract method 0xe30c3978. // // Solidity: function pendingOwner() View returns(address) func (_Sunpumplaunchpad *SunpumplaunchpadTransactorSession) PendingOwner() (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.PendingOwner(&_Sunpumplaunchpad.TransactOpts) } // PurchaseFee is a paid mutator transaction binding the contract method 0x14b5e981. // // Solidity: function purchaseFee() View returns(uint256) func (_Sunpumplaunchpad *SunpumplaunchpadTransactor) PurchaseFee(opts *bind.TransactOpts) (*types.Transaction, error) { return _Sunpumplaunchpad.contract.Transact(opts, "purchaseFee") } // PurchaseFee is a paid mutator transaction binding the contract method 0x14b5e981. // // Solidity: function purchaseFee() View returns(uint256) func (_Sunpumplaunchpad *SunpumplaunchpadSession) PurchaseFee() (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.PurchaseFee(&_Sunpumplaunchpad.TransactOpts) } // PurchaseFee is a paid mutator transaction binding the contract method 0x14b5e981. // // Solidity: function purchaseFee() View returns(uint256) func (_Sunpumplaunchpad *SunpumplaunchpadTransactorSession) PurchaseFee() (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.PurchaseFee(&_Sunpumplaunchpad.TransactOpts) } // PurchaseToken is a paid mutator transaction binding the contract method 0x1cc2c911. // // Solidity: function purchaseToken(address token, uint256 AmountMin) payable returns() func (_Sunpumplaunchpad *SunpumplaunchpadTransactor) PurchaseToken(opts *bind.TransactOpts, token common.Address, AmountMin *big.Int) (*types.Transaction, error) { return _Sunpumplaunchpad.contract.Transact(opts, "purchaseToken", token, AmountMin) } // PurchaseToken is a paid mutator transaction binding the contract method 0x1cc2c911. // // Solidity: function purchaseToken(address token, uint256 AmountMin) payable returns() func (_Sunpumplaunchpad *SunpumplaunchpadSession) PurchaseToken(token common.Address, AmountMin *big.Int) (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.PurchaseToken(&_Sunpumplaunchpad.TransactOpts, token, AmountMin) } // PurchaseToken is a paid mutator transaction binding the contract method 0x1cc2c911. // // Solidity: function purchaseToken(address token, uint256 AmountMin) payable returns() func (_Sunpumplaunchpad *SunpumplaunchpadTransactorSession) PurchaseToken(token common.Address, AmountMin *big.Int) (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.PurchaseToken(&_Sunpumplaunchpad.TransactOpts, token, AmountMin) } // RenounceTokenOwnership is a paid mutator transaction binding the contract method 0x03f76476. // // Solidity: function renounceTokenOwnership(address token) Nonpayable returns() func (_Sunpumplaunchpad *SunpumplaunchpadTransactor) RenounceTokenOwnership(opts *bind.TransactOpts, token common.Address) (*types.Transaction, error) { return _Sunpumplaunchpad.contract.Transact(opts, "renounceTokenOwnership", token) } // RenounceTokenOwnership is a paid mutator transaction binding the contract method 0x03f76476. // // Solidity: function renounceTokenOwnership(address token) Nonpayable returns() func (_Sunpumplaunchpad *SunpumplaunchpadSession) RenounceTokenOwnership(token common.Address) (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.RenounceTokenOwnership(&_Sunpumplaunchpad.TransactOpts, token) } // RenounceTokenOwnership is a paid mutator transaction binding the contract method 0x03f76476. // // Solidity: function renounceTokenOwnership(address token) Nonpayable returns() func (_Sunpumplaunchpad *SunpumplaunchpadTransactorSession) RenounceTokenOwnership(token common.Address) (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.RenounceTokenOwnership(&_Sunpumplaunchpad.TransactOpts, token) } // RerunPad is a paid mutator transaction binding the contract method 0xd92748ea. // // Solidity: function rerunPad() Nonpayable returns() func (_Sunpumplaunchpad *SunpumplaunchpadTransactor) RerunPad(opts *bind.TransactOpts) (*types.Transaction, error) { return _Sunpumplaunchpad.contract.Transact(opts, "rerunPad") } // RerunPad is a paid mutator transaction binding the contract method 0xd92748ea. // // Solidity: function rerunPad() Nonpayable returns() func (_Sunpumplaunchpad *SunpumplaunchpadSession) RerunPad() (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.RerunPad(&_Sunpumplaunchpad.TransactOpts) } // RerunPad is a paid mutator transaction binding the contract method 0xd92748ea. // // Solidity: function rerunPad() Nonpayable returns() func (_Sunpumplaunchpad *SunpumplaunchpadTransactorSession) RerunPad() (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.RerunPad(&_Sunpumplaunchpad.TransactOpts) } // SaleFee is a paid mutator transaction binding the contract method 0x178021e3. // // Solidity: function saleFee() View returns(uint256) func (_Sunpumplaunchpad *SunpumplaunchpadTransactor) SaleFee(opts *bind.TransactOpts) (*types.Transaction, error) { return _Sunpumplaunchpad.contract.Transact(opts, "saleFee") } // SaleFee is a paid mutator transaction binding the contract method 0x178021e3. // // Solidity: function saleFee() View returns(uint256) func (_Sunpumplaunchpad *SunpumplaunchpadSession) SaleFee() (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.SaleFee(&_Sunpumplaunchpad.TransactOpts) } // SaleFee is a paid mutator transaction binding the contract method 0x178021e3. // // Solidity: function saleFee() View returns(uint256) func (_Sunpumplaunchpad *SunpumplaunchpadTransactorSession) SaleFee() (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.SaleFee(&_Sunpumplaunchpad.TransactOpts) } // SaleToken is a paid mutator transaction binding the contract method 0xd19aa2b9. // // Solidity: function saleToken(address token, uint256 tokenAmount, uint256 AmountMin) Nonpayable returns() func (_Sunpumplaunchpad *SunpumplaunchpadTransactor) SaleToken(opts *bind.TransactOpts, token common.Address, tokenAmount *big.Int, AmountMin *big.Int) (*types.Transaction, error) { return _Sunpumplaunchpad.contract.Transact(opts, "saleToken", token, tokenAmount, AmountMin) } // SaleToken is a paid mutator transaction binding the contract method 0xd19aa2b9. // // Solidity: function saleToken(address token, uint256 tokenAmount, uint256 AmountMin) Nonpayable returns() func (_Sunpumplaunchpad *SunpumplaunchpadSession) SaleToken(token common.Address, tokenAmount *big.Int, AmountMin *big.Int) (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.SaleToken(&_Sunpumplaunchpad.TransactOpts, token, tokenAmount, AmountMin) } // SaleToken is a paid mutator transaction binding the contract method 0xd19aa2b9. // // Solidity: function saleToken(address token, uint256 tokenAmount, uint256 AmountMin) Nonpayable returns() func (_Sunpumplaunchpad *SunpumplaunchpadTransactorSession) SaleToken(token common.Address, tokenAmount *big.Int, AmountMin *big.Int) (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.SaleToken(&_Sunpumplaunchpad.TransactOpts, token, tokenAmount, AmountMin) } // SetLauncher is a paid mutator transaction binding the contract method 0xf4c094c8. // // Solidity: function setLauncher(address newLauncher) Nonpayable returns() func (_Sunpumplaunchpad *SunpumplaunchpadTransactor) SetLauncher(opts *bind.TransactOpts, newLauncher common.Address) (*types.Transaction, error) { return _Sunpumplaunchpad.contract.Transact(opts, "setLauncher", newLauncher) } // SetLauncher is a paid mutator transaction binding the contract method 0xf4c094c8. // // Solidity: function setLauncher(address newLauncher) Nonpayable returns() func (_Sunpumplaunchpad *SunpumplaunchpadSession) SetLauncher(newLauncher common.Address) (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.SetLauncher(&_Sunpumplaunchpad.TransactOpts, newLauncher) } // SetLauncher is a paid mutator transaction binding the contract method 0xf4c094c8. // // Solidity: function setLauncher(address newLauncher) Nonpayable returns() func (_Sunpumplaunchpad *SunpumplaunchpadTransactorSession) SetLauncher(newLauncher common.Address) (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.SetLauncher(&_Sunpumplaunchpad.TransactOpts, newLauncher) } // SetMinTxFee is a paid mutator transaction binding the contract method 0x20160b07. // // Solidity: function setMinTxFee(uint256 newFee) Nonpayable returns() func (_Sunpumplaunchpad *SunpumplaunchpadTransactor) SetMinTxFee(opts *bind.TransactOpts, newFee *big.Int) (*types.Transaction, error) { return _Sunpumplaunchpad.contract.Transact(opts, "setMinTxFee", newFee) } // SetMinTxFee is a paid mutator transaction binding the contract method 0x20160b07. // // Solidity: function setMinTxFee(uint256 newFee) Nonpayable returns() func (_Sunpumplaunchpad *SunpumplaunchpadSession) SetMinTxFee(newFee *big.Int) (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.SetMinTxFee(&_Sunpumplaunchpad.TransactOpts, newFee) } // SetMinTxFee is a paid mutator transaction binding the contract method 0x20160b07. // // Solidity: function setMinTxFee(uint256 newFee) Nonpayable returns() func (_Sunpumplaunchpad *SunpumplaunchpadTransactorSession) SetMinTxFee(newFee *big.Int) (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.SetMinTxFee(&_Sunpumplaunchpad.TransactOpts, newFee) } // SetMintAndMinTxFee is a paid mutator transaction binding the contract method 0x12e6c2c3. // // Solidity: function setMintAndMinTxFee(uint256 _newMintFee, uint256 _newMinTxFee) Nonpayable returns() func (_Sunpumplaunchpad *SunpumplaunchpadTransactor) SetMintAndMinTxFee(opts *bind.TransactOpts, _newMintFee *big.Int, _newMinTxFee *big.Int) (*types.Transaction, error) { return _Sunpumplaunchpad.contract.Transact(opts, "setMintAndMinTxFee", _newMintFee, _newMinTxFee) } // SetMintAndMinTxFee is a paid mutator transaction binding the contract method 0x12e6c2c3. // // Solidity: function setMintAndMinTxFee(uint256 _newMintFee, uint256 _newMinTxFee) Nonpayable returns() func (_Sunpumplaunchpad *SunpumplaunchpadSession) SetMintAndMinTxFee(_newMintFee *big.Int, _newMinTxFee *big.Int) (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.SetMintAndMinTxFee(&_Sunpumplaunchpad.TransactOpts, _newMintFee, _newMinTxFee) } // SetMintAndMinTxFee is a paid mutator transaction binding the contract method 0x12e6c2c3. // // Solidity: function setMintAndMinTxFee(uint256 _newMintFee, uint256 _newMinTxFee) Nonpayable returns() func (_Sunpumplaunchpad *SunpumplaunchpadTransactorSession) SetMintAndMinTxFee(_newMintFee *big.Int, _newMinTxFee *big.Int) (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.SetMintAndMinTxFee(&_Sunpumplaunchpad.TransactOpts, _newMintFee, _newMinTxFee) } // SetMintFee is a paid mutator transaction binding the contract method 0xeddd0d9c. // // Solidity: function setMintFee(uint256 newFee) Nonpayable returns() func (_Sunpumplaunchpad *SunpumplaunchpadTransactor) SetMintFee(opts *bind.TransactOpts, newFee *big.Int) (*types.Transaction, error) { return _Sunpumplaunchpad.contract.Transact(opts, "setMintFee", newFee) } // SetMintFee is a paid mutator transaction binding the contract method 0xeddd0d9c. // // Solidity: function setMintFee(uint256 newFee) Nonpayable returns() func (_Sunpumplaunchpad *SunpumplaunchpadSession) SetMintFee(newFee *big.Int) (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.SetMintFee(&_Sunpumplaunchpad.TransactOpts, newFee) } // SetMintFee is a paid mutator transaction binding the contract method 0xeddd0d9c. // // Solidity: function setMintFee(uint256 newFee) Nonpayable returns() func (_Sunpumplaunchpad *SunpumplaunchpadTransactorSession) SetMintFee(newFee *big.Int) (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.SetMintFee(&_Sunpumplaunchpad.TransactOpts, newFee) } // SetOperator is a paid mutator transaction binding the contract method 0xb3ab15fb. // // Solidity: function setOperator(address newOp) Nonpayable returns() func (_Sunpumplaunchpad *SunpumplaunchpadTransactor) SetOperator(opts *bind.TransactOpts, newOp common.Address) (*types.Transaction, error) { return _Sunpumplaunchpad.contract.Transact(opts, "setOperator", newOp) } // SetOperator is a paid mutator transaction binding the contract method 0xb3ab15fb. // // Solidity: function setOperator(address newOp) Nonpayable returns() func (_Sunpumplaunchpad *SunpumplaunchpadSession) SetOperator(newOp common.Address) (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.SetOperator(&_Sunpumplaunchpad.TransactOpts, newOp) } // SetOperator is a paid mutator transaction binding the contract method 0xb3ab15fb. // // Solidity: function setOperator(address newOp) Nonpayable returns() func (_Sunpumplaunchpad *SunpumplaunchpadTransactorSession) SetOperator(newOp common.Address) (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.SetOperator(&_Sunpumplaunchpad.TransactOpts, newOp) } // SetPendingOwner is a paid mutator transaction binding the contract method 0xc42069ec. // // Solidity: function setPendingOwner(address newPendingOwner) Nonpayable returns() func (_Sunpumplaunchpad *SunpumplaunchpadTransactor) SetPendingOwner(opts *bind.TransactOpts, newPendingOwner common.Address) (*types.Transaction, error) { return _Sunpumplaunchpad.contract.Transact(opts, "setPendingOwner", newPendingOwner) } // SetPendingOwner is a paid mutator transaction binding the contract method 0xc42069ec. // // Solidity: function setPendingOwner(address newPendingOwner) Nonpayable returns() func (_Sunpumplaunchpad *SunpumplaunchpadSession) SetPendingOwner(newPendingOwner common.Address) (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.SetPendingOwner(&_Sunpumplaunchpad.TransactOpts, newPendingOwner) } // SetPendingOwner is a paid mutator transaction binding the contract method 0xc42069ec. // // Solidity: function setPendingOwner(address newPendingOwner) Nonpayable returns() func (_Sunpumplaunchpad *SunpumplaunchpadTransactorSession) SetPendingOwner(newPendingOwner common.Address) (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.SetPendingOwner(&_Sunpumplaunchpad.TransactOpts, newPendingOwner) } // SetPurchaseFee is a paid mutator transaction binding the contract method 0x6402cdc3. // // Solidity: function setPurchaseFee(uint256 _fee) Nonpayable returns() func (_Sunpumplaunchpad *SunpumplaunchpadTransactor) SetPurchaseFee(opts *bind.TransactOpts, _fee *big.Int) (*types.Transaction, error) { return _Sunpumplaunchpad.contract.Transact(opts, "setPurchaseFee", _fee) } // SetPurchaseFee is a paid mutator transaction binding the contract method 0x6402cdc3. // // Solidity: function setPurchaseFee(uint256 _fee) Nonpayable returns() func (_Sunpumplaunchpad *SunpumplaunchpadSession) SetPurchaseFee(_fee *big.Int) (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.SetPurchaseFee(&_Sunpumplaunchpad.TransactOpts, _fee) } // SetPurchaseFee is a paid mutator transaction binding the contract method 0x6402cdc3. // // Solidity: function setPurchaseFee(uint256 _fee) Nonpayable returns() func (_Sunpumplaunchpad *SunpumplaunchpadTransactorSession) SetPurchaseFee(_fee *big.Int) (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.SetPurchaseFee(&_Sunpumplaunchpad.TransactOpts, _fee) } // SetSaleFee is a paid mutator transaction binding the contract method 0xbdcafc55. // // Solidity: function setSaleFee(uint256 _fee) Nonpayable returns() func (_Sunpumplaunchpad *SunpumplaunchpadTransactor) SetSaleFee(opts *bind.TransactOpts, _fee *big.Int) (*types.Transaction, error) { return _Sunpumplaunchpad.contract.Transact(opts, "setSaleFee", _fee) } // SetSaleFee is a paid mutator transaction binding the contract method 0xbdcafc55. // // Solidity: function setSaleFee(uint256 _fee) Nonpayable returns() func (_Sunpumplaunchpad *SunpumplaunchpadSession) SetSaleFee(_fee *big.Int) (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.SetSaleFee(&_Sunpumplaunchpad.TransactOpts, _fee) } // SetSaleFee is a paid mutator transaction binding the contract method 0xbdcafc55. // // Solidity: function setSaleFee(uint256 _fee) Nonpayable returns() func (_Sunpumplaunchpad *SunpumplaunchpadTransactorSession) SetSaleFee(_fee *big.Int) (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.SetSaleFee(&_Sunpumplaunchpad.TransactOpts, _fee) } // SetVault is a paid mutator transaction binding the contract method 0x6817031b. // // Solidity: function setVault(address _addr) Nonpayable returns() func (_Sunpumplaunchpad *SunpumplaunchpadTransactor) SetVault(opts *bind.TransactOpts, _addr common.Address) (*types.Transaction, error) { return _Sunpumplaunchpad.contract.Transact(opts, "setVault", _addr) } // SetVault is a paid mutator transaction binding the contract method 0x6817031b. // // Solidity: function setVault(address _addr) Nonpayable returns() func (_Sunpumplaunchpad *SunpumplaunchpadSession) SetVault(_addr common.Address) (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.SetVault(&_Sunpumplaunchpad.TransactOpts, _addr) } // SetVault is a paid mutator transaction binding the contract method 0x6817031b. // // Solidity: function setVault(address _addr) Nonpayable returns() func (_Sunpumplaunchpad *SunpumplaunchpadTransactorSession) SetVault(_addr common.Address) (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.SetVault(&_Sunpumplaunchpad.TransactOpts, _addr) } // TokenAddress is a paid mutator transaction binding the contract method 0x9e6b26ba. // // Solidity: function tokenAddress(uint256 ) View returns(address) func (_Sunpumplaunchpad *SunpumplaunchpadTransactor) TokenAddress(opts *bind.TransactOpts, arg0 *big.Int) (*types.Transaction, error) { return _Sunpumplaunchpad.contract.Transact(opts, "tokenAddress", arg0) } // TokenAddress is a paid mutator transaction binding the contract method 0x9e6b26ba. // // Solidity: function tokenAddress(uint256 ) View returns(address) func (_Sunpumplaunchpad *SunpumplaunchpadSession) TokenAddress(arg0 *big.Int) (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.TokenAddress(&_Sunpumplaunchpad.TransactOpts, arg0) } // TokenAddress is a paid mutator transaction binding the contract method 0x9e6b26ba. // // Solidity: function tokenAddress(uint256 ) View returns(address) func (_Sunpumplaunchpad *SunpumplaunchpadTransactorSession) TokenAddress(arg0 *big.Int) (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.TokenAddress(&_Sunpumplaunchpad.TransactOpts, arg0) } // TokenCount is a paid mutator transaction binding the contract method 0x9f181b5e. // // Solidity: function tokenCount() View returns(uint256) func (_Sunpumplaunchpad *SunpumplaunchpadTransactor) TokenCount(opts *bind.TransactOpts) (*types.Transaction, error) { return _Sunpumplaunchpad.contract.Transact(opts, "tokenCount") } // TokenCount is a paid mutator transaction binding the contract method 0x9f181b5e. // // Solidity: function tokenCount() View returns(uint256) func (_Sunpumplaunchpad *SunpumplaunchpadSession) TokenCount() (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.TokenCount(&_Sunpumplaunchpad.TransactOpts) } // TokenCount is a paid mutator transaction binding the contract method 0x9f181b5e. // // Solidity: function tokenCount() View returns(uint256) func (_Sunpumplaunchpad *SunpumplaunchpadTransactorSession) TokenCount() (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.TokenCount(&_Sunpumplaunchpad.TransactOpts) } // TokenCreator is a paid mutator transaction binding the contract method 0x23774af2. // // Solidity: function tokenCreator(address ) View returns(address) func (_Sunpumplaunchpad *SunpumplaunchpadTransactor) TokenCreator(opts *bind.TransactOpts, arg0 common.Address) (*types.Transaction, error) { return _Sunpumplaunchpad.contract.Transact(opts, "tokenCreator", arg0) } // TokenCreator is a paid mutator transaction binding the contract method 0x23774af2. // // Solidity: function tokenCreator(address ) View returns(address) func (_Sunpumplaunchpad *SunpumplaunchpadSession) TokenCreator(arg0 common.Address) (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.TokenCreator(&_Sunpumplaunchpad.TransactOpts, arg0) } // TokenCreator is a paid mutator transaction binding the contract method 0x23774af2. // // Solidity: function tokenCreator(address ) View returns(address) func (_Sunpumplaunchpad *SunpumplaunchpadTransactorSession) TokenCreator(arg0 common.Address) (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.TokenCreator(&_Sunpumplaunchpad.TransactOpts, arg0) } // V2Router is a paid mutator transaction binding the contract method 0xdeadbc14. // // Solidity: function v2Router() View returns(address) func (_Sunpumplaunchpad *SunpumplaunchpadTransactor) V2Router(opts *bind.TransactOpts) (*types.Transaction, error) { return _Sunpumplaunchpad.contract.Transact(opts, "v2Router") } // V2Router is a paid mutator transaction binding the contract method 0xdeadbc14. // // Solidity: function v2Router() View returns(address) func (_Sunpumplaunchpad *SunpumplaunchpadSession) V2Router() (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.V2Router(&_Sunpumplaunchpad.TransactOpts) } // V2Router is a paid mutator transaction binding the contract method 0xdeadbc14. // // Solidity: function v2Router() View returns(address) func (_Sunpumplaunchpad *SunpumplaunchpadTransactorSession) V2Router() (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.V2Router(&_Sunpumplaunchpad.TransactOpts) } // Vault is a paid mutator transaction binding the contract method 0xfbfa77cf. // // Solidity: function vault() View returns(address) func (_Sunpumplaunchpad *SunpumplaunchpadTransactor) Vault(opts *bind.TransactOpts) (*types.Transaction, error) { return _Sunpumplaunchpad.contract.Transact(opts, "vault") } // Vault is a paid mutator transaction binding the contract method 0xfbfa77cf. // // Solidity: function vault() View returns(address) func (_Sunpumplaunchpad *SunpumplaunchpadSession) Vault() (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.Vault(&_Sunpumplaunchpad.TransactOpts) } // Vault is a paid mutator transaction binding the contract method 0xfbfa77cf. // // Solidity: function vault() View returns(address) func (_Sunpumplaunchpad *SunpumplaunchpadTransactorSession) Vault() (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.Vault(&_Sunpumplaunchpad.TransactOpts) } // VirtualPools is a paid mutator transaction binding the contract method 0x1e228192. // // Solidity: function virtualPools(address ) View returns(uint256 TRXReserve, uint256 TokenReserve, bool launched) func (_Sunpumplaunchpad *SunpumplaunchpadTransactor) VirtualPools(opts *bind.TransactOpts, arg0 common.Address) (*types.Transaction, error) { return _Sunpumplaunchpad.contract.Transact(opts, "virtualPools", arg0) } // VirtualPools is a paid mutator transaction binding the contract method 0x1e228192. // // Solidity: function virtualPools(address ) View returns(uint256 TRXReserve, uint256 TokenReserve, bool launched) func (_Sunpumplaunchpad *SunpumplaunchpadSession) VirtualPools(arg0 common.Address) (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.VirtualPools(&_Sunpumplaunchpad.TransactOpts, arg0) } // VirtualPools is a paid mutator transaction binding the contract method 0x1e228192. // // Solidity: function virtualPools(address ) View returns(uint256 TRXReserve, uint256 TokenReserve, bool launched) func (_Sunpumplaunchpad *SunpumplaunchpadTransactorSession) VirtualPools(arg0 common.Address) (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.VirtualPools(&_Sunpumplaunchpad.TransactOpts, arg0) } // Receive is a paid mutator transaction binding the contract receive function. // // Solidity: receive() payable returns() func (_Sunpumplaunchpad *SunpumplaunchpadTransactor) Receive(opts *bind.TransactOpts) (*types.Transaction, error) { return _Sunpumplaunchpad.contract.RawTransact(opts, nil) // calldata is disallowed for receive function } // Receive is a paid mutator transaction binding the contract receive function. // // Solidity: receive() payable returns() func (_Sunpumplaunchpad *SunpumplaunchpadSession) Receive() (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.Receive(&_Sunpumplaunchpad.TransactOpts) } // Receive is a paid mutator transaction binding the contract receive function. // // Solidity: receive() payable returns() func (_Sunpumplaunchpad *SunpumplaunchpadTransactorSession) Receive() (*types.Transaction, error) { return _Sunpumplaunchpad.Contract.Receive(&_Sunpumplaunchpad.TransactOpts) } // SunpumplaunchpadLaunchPendingIterator is returned from FilterLaunchPending and is used to iterate over the raw logs and unpacked data for LaunchPending events raised by the Sunpumplaunchpad contract. type SunpumplaunchpadLaunchPendingIterator struct { Event *SunpumplaunchpadLaunchPending // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *SunpumplaunchpadLaunchPendingIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(SunpumplaunchpadLaunchPending) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(SunpumplaunchpadLaunchPending) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *SunpumplaunchpadLaunchPendingIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *SunpumplaunchpadLaunchPendingIterator) Close() error { it.sub.Unsubscribe() return nil } // SunpumplaunchpadLaunchPending represents a LaunchPending event raised by the Sunpumplaunchpad contract. type SunpumplaunchpadLaunchPending struct { Token common.Address Raw types.Log // Blockchain specific contextual infos } // FilterLaunchPending is a free log retrieval operation binding the contract event 0xff274cd97aba8af276149429fbc7ea387e14da22dcd51779c691af908f4feb64. // // Solidity: event LaunchPending(address token) func (_Sunpumplaunchpad *SunpumplaunchpadFilterer) FilterLaunchPending(opts *bind.FilterOpts) (*SunpumplaunchpadLaunchPendingIterator, error) { logs, sub, err := _Sunpumplaunchpad.contract.FilterLogs(opts, "LaunchPending") if err != nil { return nil, err } return &SunpumplaunchpadLaunchPendingIterator{contract: _Sunpumplaunchpad.contract, event: "LaunchPending", logs: logs, sub: sub}, nil } // WatchLaunchPending is a free log subscription operation binding the contract event 0xff274cd97aba8af276149429fbc7ea387e14da22dcd51779c691af908f4feb64. // // Solidity: event LaunchPending(address token) func (_Sunpumplaunchpad *SunpumplaunchpadFilterer) WatchLaunchPending(opts *bind.WatchOpts, sink chan<- *SunpumplaunchpadLaunchPending) (event.Subscription, error) { logs, sub, err := _Sunpumplaunchpad.contract.WatchLogs(opts, "LaunchPending") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(SunpumplaunchpadLaunchPending) if err := _Sunpumplaunchpad.contract.UnpackLog(event, "LaunchPending", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseLaunchPending is a log parse operation binding the contract event 0xff274cd97aba8af276149429fbc7ea387e14da22dcd51779c691af908f4feb64. // // Solidity: event LaunchPending(address token) func (_Sunpumplaunchpad *SunpumplaunchpadFilterer) ParseLaunchPending(log types.Log) (*SunpumplaunchpadLaunchPending, error) { event := new(SunpumplaunchpadLaunchPending) if err := _Sunpumplaunchpad.contract.UnpackLog(event, "LaunchPending", log); err != nil { return nil, err } event.Raw = log return event, nil } // SunpumplaunchpadLauncherChangedIterator is returned from FilterLauncherChanged and is used to iterate over the raw logs and unpacked data for LauncherChanged events raised by the Sunpumplaunchpad contract. type SunpumplaunchpadLauncherChangedIterator struct { Event *SunpumplaunchpadLauncherChanged // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *SunpumplaunchpadLauncherChangedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(SunpumplaunchpadLauncherChanged) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(SunpumplaunchpadLauncherChanged) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *SunpumplaunchpadLauncherChangedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *SunpumplaunchpadLauncherChangedIterator) Close() error { it.sub.Unsubscribe() return nil } // SunpumplaunchpadLauncherChanged represents a LauncherChanged event raised by the Sunpumplaunchpad contract. type SunpumplaunchpadLauncherChanged struct { OldLauncher common.Address NewLauncher common.Address Raw types.Log // Blockchain specific contextual infos } // FilterLauncherChanged is a free log retrieval operation binding the contract event 0x349b3ca858f1d049aa7b4e826494f79354dbe5f1125ec5442e2d309d21646ec2. // // Solidity: event LauncherChanged(address indexed oldLauncher, address indexed newLauncher) func (_Sunpumplaunchpad *SunpumplaunchpadFilterer) FilterLauncherChanged(opts *bind.FilterOpts, oldLauncher []common.Address, newLauncher []common.Address) (*SunpumplaunchpadLauncherChangedIterator, error) { var oldLauncherRule []interface{} for _, oldLauncherItem := range oldLauncher { oldLauncherRule = append(oldLauncherRule, oldLauncherItem) } var newLauncherRule []interface{} for _, newLauncherItem := range newLauncher { newLauncherRule = append(newLauncherRule, newLauncherItem) } logs, sub, err := _Sunpumplaunchpad.contract.FilterLogs(opts, "LauncherChanged", oldLauncherRule, newLauncherRule) if err != nil { return nil, err } return &SunpumplaunchpadLauncherChangedIterator{contract: _Sunpumplaunchpad.contract, event: "LauncherChanged", logs: logs, sub: sub}, nil } // WatchLauncherChanged is a free log subscription operation binding the contract event 0x349b3ca858f1d049aa7b4e826494f79354dbe5f1125ec5442e2d309d21646ec2. // // Solidity: event LauncherChanged(address indexed oldLauncher, address indexed newLauncher) func (_Sunpumplaunchpad *SunpumplaunchpadFilterer) WatchLauncherChanged(opts *bind.WatchOpts, sink chan<- *SunpumplaunchpadLauncherChanged, oldLauncher []common.Address, newLauncher []common.Address) (event.Subscription, error) { var oldLauncherRule []interface{} for _, oldLauncherItem := range oldLauncher { oldLauncherRule = append(oldLauncherRule, oldLauncherItem) } var newLauncherRule []interface{} for _, newLauncherItem := range newLauncher { newLauncherRule = append(newLauncherRule, newLauncherItem) } logs, sub, err := _Sunpumplaunchpad.contract.WatchLogs(opts, "LauncherChanged", oldLauncherRule, newLauncherRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(SunpumplaunchpadLauncherChanged) if err := _Sunpumplaunchpad.contract.UnpackLog(event, "LauncherChanged", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseLauncherChanged is a log parse operation binding the contract event 0x349b3ca858f1d049aa7b4e826494f79354dbe5f1125ec5442e2d309d21646ec2. // // Solidity: event LauncherChanged(address indexed oldLauncher, address indexed newLauncher) func (_Sunpumplaunchpad *SunpumplaunchpadFilterer) ParseLauncherChanged(log types.Log) (*SunpumplaunchpadLauncherChanged, error) { event := new(SunpumplaunchpadLauncherChanged) if err := _Sunpumplaunchpad.contract.UnpackLog(event, "LauncherChanged", log); err != nil { return nil, err } event.Raw = log return event, nil } // SunpumplaunchpadMinTxFeeSetIterator is returned from FilterMinTxFeeSet and is used to iterate over the raw logs and unpacked data for MinTxFeeSet events raised by the Sunpumplaunchpad contract. type SunpumplaunchpadMinTxFeeSetIterator struct { Event *SunpumplaunchpadMinTxFeeSet // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *SunpumplaunchpadMinTxFeeSetIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(SunpumplaunchpadMinTxFeeSet) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(SunpumplaunchpadMinTxFeeSet) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *SunpumplaunchpadMinTxFeeSetIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *SunpumplaunchpadMinTxFeeSetIterator) Close() error { it.sub.Unsubscribe() return nil } // SunpumplaunchpadMinTxFeeSet represents a MinTxFeeSet event raised by the Sunpumplaunchpad contract. type SunpumplaunchpadMinTxFeeSet struct { OldFee *big.Int NewFee *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterMinTxFeeSet is a free log retrieval operation binding the contract event 0x091f43688ad4f42d7f02fb81c7e28b693ca4d5d825c27572437bc308cc46aba2. // // Solidity: event MinTxFeeSet(uint256 oldFee, uint256 newFee) func (_Sunpumplaunchpad *SunpumplaunchpadFilterer) FilterMinTxFeeSet(opts *bind.FilterOpts) (*SunpumplaunchpadMinTxFeeSetIterator, error) { logs, sub, err := _Sunpumplaunchpad.contract.FilterLogs(opts, "MinTxFeeSet") if err != nil { return nil, err } return &SunpumplaunchpadMinTxFeeSetIterator{contract: _Sunpumplaunchpad.contract, event: "MinTxFeeSet", logs: logs, sub: sub}, nil } // WatchMinTxFeeSet is a free log subscription operation binding the contract event 0x091f43688ad4f42d7f02fb81c7e28b693ca4d5d825c27572437bc308cc46aba2. // // Solidity: event MinTxFeeSet(uint256 oldFee, uint256 newFee) func (_Sunpumplaunchpad *SunpumplaunchpadFilterer) WatchMinTxFeeSet(opts *bind.WatchOpts, sink chan<- *SunpumplaunchpadMinTxFeeSet) (event.Subscription, error) { logs, sub, err := _Sunpumplaunchpad.contract.WatchLogs(opts, "MinTxFeeSet") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(SunpumplaunchpadMinTxFeeSet) if err := _Sunpumplaunchpad.contract.UnpackLog(event, "MinTxFeeSet", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseMinTxFeeSet is a log parse operation binding the contract event 0x091f43688ad4f42d7f02fb81c7e28b693ca4d5d825c27572437bc308cc46aba2. // // Solidity: event MinTxFeeSet(uint256 oldFee, uint256 newFee) func (_Sunpumplaunchpad *SunpumplaunchpadFilterer) ParseMinTxFeeSet(log types.Log) (*SunpumplaunchpadMinTxFeeSet, error) { event := new(SunpumplaunchpadMinTxFeeSet) if err := _Sunpumplaunchpad.contract.UnpackLog(event, "MinTxFeeSet", log); err != nil { return nil, err } event.Raw = log return event, nil } // SunpumplaunchpadMintFeeSetIterator is returned from FilterMintFeeSet and is used to iterate over the raw logs and unpacked data for MintFeeSet events raised by the Sunpumplaunchpad contract. type SunpumplaunchpadMintFeeSetIterator struct { Event *SunpumplaunchpadMintFeeSet // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *SunpumplaunchpadMintFeeSetIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(SunpumplaunchpadMintFeeSet) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(SunpumplaunchpadMintFeeSet) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *SunpumplaunchpadMintFeeSetIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *SunpumplaunchpadMintFeeSetIterator) Close() error { it.sub.Unsubscribe() return nil } // SunpumplaunchpadMintFeeSet represents a MintFeeSet event raised by the Sunpumplaunchpad contract. type SunpumplaunchpadMintFeeSet struct { OldFee *big.Int NewFee *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterMintFeeSet is a free log retrieval operation binding the contract event 0x387269377ae17304805d5f88cea4252e5ca47346783c279aeb9e8627335a49ac. // // Solidity: event MintFeeSet(uint256 oldFee, uint256 newFee) func (_Sunpumplaunchpad *SunpumplaunchpadFilterer) FilterMintFeeSet(opts *bind.FilterOpts) (*SunpumplaunchpadMintFeeSetIterator, error) { logs, sub, err := _Sunpumplaunchpad.contract.FilterLogs(opts, "MintFeeSet") if err != nil { return nil, err } return &SunpumplaunchpadMintFeeSetIterator{contract: _Sunpumplaunchpad.contract, event: "MintFeeSet", logs: logs, sub: sub}, nil } // WatchMintFeeSet is a free log subscription operation binding the contract event 0x387269377ae17304805d5f88cea4252e5ca47346783c279aeb9e8627335a49ac. // // Solidity: event MintFeeSet(uint256 oldFee, uint256 newFee) func (_Sunpumplaunchpad *SunpumplaunchpadFilterer) WatchMintFeeSet(opts *bind.WatchOpts, sink chan<- *SunpumplaunchpadMintFeeSet) (event.Subscription, error) { logs, sub, err := _Sunpumplaunchpad.contract.WatchLogs(opts, "MintFeeSet") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(SunpumplaunchpadMintFeeSet) if err := _Sunpumplaunchpad.contract.UnpackLog(event, "MintFeeSet", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseMintFeeSet is a log parse operation binding the contract event 0x387269377ae17304805d5f88cea4252e5ca47346783c279aeb9e8627335a49ac. // // Solidity: event MintFeeSet(uint256 oldFee, uint256 newFee) func (_Sunpumplaunchpad *SunpumplaunchpadFilterer) ParseMintFeeSet(log types.Log) (*SunpumplaunchpadMintFeeSet, error) { event := new(SunpumplaunchpadMintFeeSet) if err := _Sunpumplaunchpad.contract.UnpackLog(event, "MintFeeSet", log); err != nil { return nil, err } event.Raw = log return event, nil } // SunpumplaunchpadOperatorChangedIterator is returned from FilterOperatorChanged and is used to iterate over the raw logs and unpacked data for OperatorChanged events raised by the Sunpumplaunchpad contract. type SunpumplaunchpadOperatorChangedIterator struct { Event *SunpumplaunchpadOperatorChanged // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *SunpumplaunchpadOperatorChangedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(SunpumplaunchpadOperatorChanged) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(SunpumplaunchpadOperatorChanged) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *SunpumplaunchpadOperatorChangedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *SunpumplaunchpadOperatorChangedIterator) Close() error { it.sub.Unsubscribe() return nil } // SunpumplaunchpadOperatorChanged represents a OperatorChanged event raised by the Sunpumplaunchpad contract. type SunpumplaunchpadOperatorChanged struct { OldOperator common.Address NewOperator common.Address Raw types.Log // Blockchain specific contextual infos } // FilterOperatorChanged is a free log retrieval operation binding the contract event 0xd58299b712891143e76310d5e664c4203c940a67db37cf856bdaa3c5c76a802c. // // Solidity: event OperatorChanged(address indexed oldOperator, address indexed newOperator) func (_Sunpumplaunchpad *SunpumplaunchpadFilterer) FilterOperatorChanged(opts *bind.FilterOpts, oldOperator []common.Address, newOperator []common.Address) (*SunpumplaunchpadOperatorChangedIterator, error) { var oldOperatorRule []interface{} for _, oldOperatorItem := range oldOperator { oldOperatorRule = append(oldOperatorRule, oldOperatorItem) } var newOperatorRule []interface{} for _, newOperatorItem := range newOperator { newOperatorRule = append(newOperatorRule, newOperatorItem) } logs, sub, err := _Sunpumplaunchpad.contract.FilterLogs(opts, "OperatorChanged", oldOperatorRule, newOperatorRule) if err != nil { return nil, err } return &SunpumplaunchpadOperatorChangedIterator{contract: _Sunpumplaunchpad.contract, event: "OperatorChanged", logs: logs, sub: sub}, nil } // WatchOperatorChanged is a free log subscription operation binding the contract event 0xd58299b712891143e76310d5e664c4203c940a67db37cf856bdaa3c5c76a802c. // // Solidity: event OperatorChanged(address indexed oldOperator, address indexed newOperator) func (_Sunpumplaunchpad *SunpumplaunchpadFilterer) WatchOperatorChanged(opts *bind.WatchOpts, sink chan<- *SunpumplaunchpadOperatorChanged, oldOperator []common.Address, newOperator []common.Address) (event.Subscription, error) { var oldOperatorRule []interface{} for _, oldOperatorItem := range oldOperator { oldOperatorRule = append(oldOperatorRule, oldOperatorItem) } var newOperatorRule []interface{} for _, newOperatorItem := range newOperator { newOperatorRule = append(newOperatorRule, newOperatorItem) } logs, sub, err := _Sunpumplaunchpad.contract.WatchLogs(opts, "OperatorChanged", oldOperatorRule, newOperatorRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(SunpumplaunchpadOperatorChanged) if err := _Sunpumplaunchpad.contract.UnpackLog(event, "OperatorChanged", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseOperatorChanged is a log parse operation binding the contract event 0xd58299b712891143e76310d5e664c4203c940a67db37cf856bdaa3c5c76a802c. // // Solidity: event OperatorChanged(address indexed oldOperator, address indexed newOperator) func (_Sunpumplaunchpad *SunpumplaunchpadFilterer) ParseOperatorChanged(log types.Log) (*SunpumplaunchpadOperatorChanged, error) { event := new(SunpumplaunchpadOperatorChanged) if err := _Sunpumplaunchpad.contract.UnpackLog(event, "OperatorChanged", log); err != nil { return nil, err } event.Raw = log return event, nil } // SunpumplaunchpadOwnerChangedIterator is returned from FilterOwnerChanged and is used to iterate over the raw logs and unpacked data for OwnerChanged events raised by the Sunpumplaunchpad contract. type SunpumplaunchpadOwnerChangedIterator struct { Event *SunpumplaunchpadOwnerChanged // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *SunpumplaunchpadOwnerChangedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(SunpumplaunchpadOwnerChanged) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(SunpumplaunchpadOwnerChanged) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *SunpumplaunchpadOwnerChangedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *SunpumplaunchpadOwnerChangedIterator) Close() error { it.sub.Unsubscribe() return nil } // SunpumplaunchpadOwnerChanged represents a OwnerChanged event raised by the Sunpumplaunchpad contract. type SunpumplaunchpadOwnerChanged struct { OldOwner common.Address NewOwner common.Address Raw types.Log // Blockchain specific contextual infos } // FilterOwnerChanged is a free log retrieval operation binding the contract event 0xb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c. // // Solidity: event OwnerChanged(address indexed oldOwner, address indexed newOwner) func (_Sunpumplaunchpad *SunpumplaunchpadFilterer) FilterOwnerChanged(opts *bind.FilterOpts, oldOwner []common.Address, newOwner []common.Address) (*SunpumplaunchpadOwnerChangedIterator, error) { var oldOwnerRule []interface{} for _, oldOwnerItem := range oldOwner { oldOwnerRule = append(oldOwnerRule, oldOwnerItem) } var newOwnerRule []interface{} for _, newOwnerItem := range newOwner { newOwnerRule = append(newOwnerRule, newOwnerItem) } logs, sub, err := _Sunpumplaunchpad.contract.FilterLogs(opts, "OwnerChanged", oldOwnerRule, newOwnerRule) if err != nil { return nil, err } return &SunpumplaunchpadOwnerChangedIterator{contract: _Sunpumplaunchpad.contract, event: "OwnerChanged", logs: logs, sub: sub}, nil } // WatchOwnerChanged is a free log subscription operation binding the contract event 0xb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c. // // Solidity: event OwnerChanged(address indexed oldOwner, address indexed newOwner) func (_Sunpumplaunchpad *SunpumplaunchpadFilterer) WatchOwnerChanged(opts *bind.WatchOpts, sink chan<- *SunpumplaunchpadOwnerChanged, oldOwner []common.Address, newOwner []common.Address) (event.Subscription, error) { var oldOwnerRule []interface{} for _, oldOwnerItem := range oldOwner { oldOwnerRule = append(oldOwnerRule, oldOwnerItem) } var newOwnerRule []interface{} for _, newOwnerItem := range newOwner { newOwnerRule = append(newOwnerRule, newOwnerItem) } logs, sub, err := _Sunpumplaunchpad.contract.WatchLogs(opts, "OwnerChanged", oldOwnerRule, newOwnerRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(SunpumplaunchpadOwnerChanged) if err := _Sunpumplaunchpad.contract.UnpackLog(event, "OwnerChanged", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseOwnerChanged is a log parse operation binding the contract event 0xb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c. // // Solidity: event OwnerChanged(address indexed oldOwner, address indexed newOwner) func (_Sunpumplaunchpad *SunpumplaunchpadFilterer) ParseOwnerChanged(log types.Log) (*SunpumplaunchpadOwnerChanged, error) { event := new(SunpumplaunchpadOwnerChanged) if err := _Sunpumplaunchpad.contract.UnpackLog(event, "OwnerChanged", log); err != nil { return nil, err } event.Raw = log return event, nil } // SunpumplaunchpadPendingOwnerSetIterator is returned from FilterPendingOwnerSet and is used to iterate over the raw logs and unpacked data for PendingOwnerSet events raised by the Sunpumplaunchpad contract. type SunpumplaunchpadPendingOwnerSetIterator struct { Event *SunpumplaunchpadPendingOwnerSet // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *SunpumplaunchpadPendingOwnerSetIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(SunpumplaunchpadPendingOwnerSet) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(SunpumplaunchpadPendingOwnerSet) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *SunpumplaunchpadPendingOwnerSetIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *SunpumplaunchpadPendingOwnerSetIterator) Close() error { it.sub.Unsubscribe() return nil } // SunpumplaunchpadPendingOwnerSet represents a PendingOwnerSet event raised by the Sunpumplaunchpad contract. type SunpumplaunchpadPendingOwnerSet struct { OldPendingOwner common.Address NewPendingOwner common.Address Raw types.Log // Blockchain specific contextual infos } // FilterPendingOwnerSet is a free log retrieval operation binding the contract event 0xa86864fa6b65f969d5ac8391ddaac6a0eba3f41386cbf6e78c3e4d6c59eb115f. // // Solidity: event PendingOwnerSet(address indexed oldPendingOwner, address indexed newPendingOwner) func (_Sunpumplaunchpad *SunpumplaunchpadFilterer) FilterPendingOwnerSet(opts *bind.FilterOpts, oldPendingOwner []common.Address, newPendingOwner []common.Address) (*SunpumplaunchpadPendingOwnerSetIterator, error) { var oldPendingOwnerRule []interface{} for _, oldPendingOwnerItem := range oldPendingOwner { oldPendingOwnerRule = append(oldPendingOwnerRule, oldPendingOwnerItem) } var newPendingOwnerRule []interface{} for _, newPendingOwnerItem := range newPendingOwner { newPendingOwnerRule = append(newPendingOwnerRule, newPendingOwnerItem) } logs, sub, err := _Sunpumplaunchpad.contract.FilterLogs(opts, "PendingOwnerSet", oldPendingOwnerRule, newPendingOwnerRule) if err != nil { return nil, err } return &SunpumplaunchpadPendingOwnerSetIterator{contract: _Sunpumplaunchpad.contract, event: "PendingOwnerSet", logs: logs, sub: sub}, nil } // WatchPendingOwnerSet is a free log subscription operation binding the contract event 0xa86864fa6b65f969d5ac8391ddaac6a0eba3f41386cbf6e78c3e4d6c59eb115f. // // Solidity: event PendingOwnerSet(address indexed oldPendingOwner, address indexed newPendingOwner) func (_Sunpumplaunchpad *SunpumplaunchpadFilterer) WatchPendingOwnerSet(opts *bind.WatchOpts, sink chan<- *SunpumplaunchpadPendingOwnerSet, oldPendingOwner []common.Address, newPendingOwner []common.Address) (event.Subscription, error) { var oldPendingOwnerRule []interface{} for _, oldPendingOwnerItem := range oldPendingOwner { oldPendingOwnerRule = append(oldPendingOwnerRule, oldPendingOwnerItem) } var newPendingOwnerRule []interface{} for _, newPendingOwnerItem := range newPendingOwner { newPendingOwnerRule = append(newPendingOwnerRule, newPendingOwnerItem) } logs, sub, err := _Sunpumplaunchpad.contract.WatchLogs(opts, "PendingOwnerSet", oldPendingOwnerRule, newPendingOwnerRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(SunpumplaunchpadPendingOwnerSet) if err := _Sunpumplaunchpad.contract.UnpackLog(event, "PendingOwnerSet", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParsePendingOwnerSet is a log parse operation binding the contract event 0xa86864fa6b65f969d5ac8391ddaac6a0eba3f41386cbf6e78c3e4d6c59eb115f. // // Solidity: event PendingOwnerSet(address indexed oldPendingOwner, address indexed newPendingOwner) func (_Sunpumplaunchpad *SunpumplaunchpadFilterer) ParsePendingOwnerSet(log types.Log) (*SunpumplaunchpadPendingOwnerSet, error) { event := new(SunpumplaunchpadPendingOwnerSet) if err := _Sunpumplaunchpad.contract.UnpackLog(event, "PendingOwnerSet", log); err != nil { return nil, err } event.Raw = log return event, nil } // SunpumplaunchpadPurchaseFeeSetIterator is returned from FilterPurchaseFeeSet and is used to iterate over the raw logs and unpacked data for PurchaseFeeSet events raised by the Sunpumplaunchpad contract. type SunpumplaunchpadPurchaseFeeSetIterator struct { Event *SunpumplaunchpadPurchaseFeeSet // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *SunpumplaunchpadPurchaseFeeSetIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(SunpumplaunchpadPurchaseFeeSet) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(SunpumplaunchpadPurchaseFeeSet) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *SunpumplaunchpadPurchaseFeeSetIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *SunpumplaunchpadPurchaseFeeSetIterator) Close() error { it.sub.Unsubscribe() return nil } // SunpumplaunchpadPurchaseFeeSet represents a PurchaseFeeSet event raised by the Sunpumplaunchpad contract. type SunpumplaunchpadPurchaseFeeSet struct { OldFee *big.Int NewFee *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterPurchaseFeeSet is a free log retrieval operation binding the contract event 0x525ad74c8a8eb66a2372d62022c6d2813136ef0f41574506841342146cf694db. // // Solidity: event PurchaseFeeSet(uint256 oldFee, uint256 newFee) func (_Sunpumplaunchpad *SunpumplaunchpadFilterer) FilterPurchaseFeeSet(opts *bind.FilterOpts) (*SunpumplaunchpadPurchaseFeeSetIterator, error) { logs, sub, err := _Sunpumplaunchpad.contract.FilterLogs(opts, "PurchaseFeeSet") if err != nil { return nil, err } return &SunpumplaunchpadPurchaseFeeSetIterator{contract: _Sunpumplaunchpad.contract, event: "PurchaseFeeSet", logs: logs, sub: sub}, nil } // WatchPurchaseFeeSet is a free log subscription operation binding the contract event 0x525ad74c8a8eb66a2372d62022c6d2813136ef0f41574506841342146cf694db. // // Solidity: event PurchaseFeeSet(uint256 oldFee, uint256 newFee) func (_Sunpumplaunchpad *SunpumplaunchpadFilterer) WatchPurchaseFeeSet(opts *bind.WatchOpts, sink chan<- *SunpumplaunchpadPurchaseFeeSet) (event.Subscription, error) { logs, sub, err := _Sunpumplaunchpad.contract.WatchLogs(opts, "PurchaseFeeSet") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(SunpumplaunchpadPurchaseFeeSet) if err := _Sunpumplaunchpad.contract.UnpackLog(event, "PurchaseFeeSet", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParsePurchaseFeeSet is a log parse operation binding the contract event 0x525ad74c8a8eb66a2372d62022c6d2813136ef0f41574506841342146cf694db. // // Solidity: event PurchaseFeeSet(uint256 oldFee, uint256 newFee) func (_Sunpumplaunchpad *SunpumplaunchpadFilterer) ParsePurchaseFeeSet(log types.Log) (*SunpumplaunchpadPurchaseFeeSet, error) { event := new(SunpumplaunchpadPurchaseFeeSet) if err := _Sunpumplaunchpad.contract.UnpackLog(event, "PurchaseFeeSet", log); err != nil { return nil, err } event.Raw = log return event, nil } // SunpumplaunchpadSaleFeeSetIterator is returned from FilterSaleFeeSet and is used to iterate over the raw logs and unpacked data for SaleFeeSet events raised by the Sunpumplaunchpad contract. type SunpumplaunchpadSaleFeeSetIterator struct { Event *SunpumplaunchpadSaleFeeSet // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *SunpumplaunchpadSaleFeeSetIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(SunpumplaunchpadSaleFeeSet) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(SunpumplaunchpadSaleFeeSet) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *SunpumplaunchpadSaleFeeSetIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *SunpumplaunchpadSaleFeeSetIterator) Close() error { it.sub.Unsubscribe() return nil } // SunpumplaunchpadSaleFeeSet represents a SaleFeeSet event raised by the Sunpumplaunchpad contract. type SunpumplaunchpadSaleFeeSet struct { OldFee *big.Int NewFee *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterSaleFeeSet is a free log retrieval operation binding the contract event 0x3063d3516a6a2d04f3fcbbb8096b055b0976989088fe108ad8081c526a594abd. // // Solidity: event SaleFeeSet(uint256 oldFee, uint256 newFee) func (_Sunpumplaunchpad *SunpumplaunchpadFilterer) FilterSaleFeeSet(opts *bind.FilterOpts) (*SunpumplaunchpadSaleFeeSetIterator, error) { logs, sub, err := _Sunpumplaunchpad.contract.FilterLogs(opts, "SaleFeeSet") if err != nil { return nil, err } return &SunpumplaunchpadSaleFeeSetIterator{contract: _Sunpumplaunchpad.contract, event: "SaleFeeSet", logs: logs, sub: sub}, nil } // WatchSaleFeeSet is a free log subscription operation binding the contract event 0x3063d3516a6a2d04f3fcbbb8096b055b0976989088fe108ad8081c526a594abd. // // Solidity: event SaleFeeSet(uint256 oldFee, uint256 newFee) func (_Sunpumplaunchpad *SunpumplaunchpadFilterer) WatchSaleFeeSet(opts *bind.WatchOpts, sink chan<- *SunpumplaunchpadSaleFeeSet) (event.Subscription, error) { logs, sub, err := _Sunpumplaunchpad.contract.WatchLogs(opts, "SaleFeeSet") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(SunpumplaunchpadSaleFeeSet) if err := _Sunpumplaunchpad.contract.UnpackLog(event, "SaleFeeSet", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseSaleFeeSet is a log parse operation binding the contract event 0x3063d3516a6a2d04f3fcbbb8096b055b0976989088fe108ad8081c526a594abd. // // Solidity: event SaleFeeSet(uint256 oldFee, uint256 newFee) func (_Sunpumplaunchpad *SunpumplaunchpadFilterer) ParseSaleFeeSet(log types.Log) (*SunpumplaunchpadSaleFeeSet, error) { event := new(SunpumplaunchpadSaleFeeSet) if err := _Sunpumplaunchpad.contract.UnpackLog(event, "SaleFeeSet", log); err != nil { return nil, err } event.Raw = log return event, nil } // SunpumplaunchpadTokenCreateIterator is returned from FilterTokenCreate and is used to iterate over the raw logs and unpacked data for TokenCreate events raised by the Sunpumplaunchpad contract. type SunpumplaunchpadTokenCreateIterator struct { Event *SunpumplaunchpadTokenCreate // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *SunpumplaunchpadTokenCreateIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(SunpumplaunchpadTokenCreate) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(SunpumplaunchpadTokenCreate) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *SunpumplaunchpadTokenCreateIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *SunpumplaunchpadTokenCreateIterator) Close() error { it.sub.Unsubscribe() return nil } // SunpumplaunchpadTokenCreate represents a TokenCreate event raised by the Sunpumplaunchpad contract. type SunpumplaunchpadTokenCreate struct { TokenAddress common.Address TokenIndex *big.Int Creator common.Address Raw types.Log // Blockchain specific contextual infos } // FilterTokenCreate is a free log retrieval operation binding the contract event 0x1ff0a01c8968e3551472812164f233abb579247de887db8cbb18281c149bee7a. // // Solidity: event TokenCreate(address tokenAddress, uint256 tokenIndex, address creator) func (_Sunpumplaunchpad *SunpumplaunchpadFilterer) FilterTokenCreate(opts *bind.FilterOpts) (*SunpumplaunchpadTokenCreateIterator, error) { logs, sub, err := _Sunpumplaunchpad.contract.FilterLogs(opts, "TokenCreate") if err != nil { return nil, err } return &SunpumplaunchpadTokenCreateIterator{contract: _Sunpumplaunchpad.contract, event: "TokenCreate", logs: logs, sub: sub}, nil } // WatchTokenCreate is a free log subscription operation binding the contract event 0x1ff0a01c8968e3551472812164f233abb579247de887db8cbb18281c149bee7a. // // Solidity: event TokenCreate(address tokenAddress, uint256 tokenIndex, address creator) func (_Sunpumplaunchpad *SunpumplaunchpadFilterer) WatchTokenCreate(opts *bind.WatchOpts, sink chan<- *SunpumplaunchpadTokenCreate) (event.Subscription, error) { logs, sub, err := _Sunpumplaunchpad.contract.WatchLogs(opts, "TokenCreate") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(SunpumplaunchpadTokenCreate) if err := _Sunpumplaunchpad.contract.UnpackLog(event, "TokenCreate", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseTokenCreate is a log parse operation binding the contract event 0x1ff0a01c8968e3551472812164f233abb579247de887db8cbb18281c149bee7a. // // Solidity: event TokenCreate(address tokenAddress, uint256 tokenIndex, address creator) func (_Sunpumplaunchpad *SunpumplaunchpadFilterer) ParseTokenCreate(log types.Log) (*SunpumplaunchpadTokenCreate, error) { event := new(SunpumplaunchpadTokenCreate) if err := _Sunpumplaunchpad.contract.UnpackLog(event, "TokenCreate", log); err != nil { return nil, err } event.Raw = log return event, nil } // SunpumplaunchpadTokenLaunchedIterator is returned from FilterTokenLaunched and is used to iterate over the raw logs and unpacked data for TokenLaunched events raised by the Sunpumplaunchpad contract. type SunpumplaunchpadTokenLaunchedIterator struct { Event *SunpumplaunchpadTokenLaunched // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *SunpumplaunchpadTokenLaunchedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(SunpumplaunchpadTokenLaunched) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(SunpumplaunchpadTokenLaunched) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *SunpumplaunchpadTokenLaunchedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *SunpumplaunchpadTokenLaunchedIterator) Close() error { it.sub.Unsubscribe() return nil } // SunpumplaunchpadTokenLaunched represents a TokenLaunched event raised by the Sunpumplaunchpad contract. type SunpumplaunchpadTokenLaunched struct { Token common.Address Raw types.Log // Blockchain specific contextual infos } // FilterTokenLaunched is a free log retrieval operation binding the contract event 0x2ab676eef3f76f1bd4e765a352c6cd81e62702f7ad3d363291c8b60582a45250. // // Solidity: event TokenLaunched(address indexed token) func (_Sunpumplaunchpad *SunpumplaunchpadFilterer) FilterTokenLaunched(opts *bind.FilterOpts, token []common.Address) (*SunpumplaunchpadTokenLaunchedIterator, error) { var tokenRule []interface{} for _, tokenItem := range token { tokenRule = append(tokenRule, tokenItem) } logs, sub, err := _Sunpumplaunchpad.contract.FilterLogs(opts, "TokenLaunched", tokenRule) if err != nil { return nil, err } return &SunpumplaunchpadTokenLaunchedIterator{contract: _Sunpumplaunchpad.contract, event: "TokenLaunched", logs: logs, sub: sub}, nil } // WatchTokenLaunched is a free log subscription operation binding the contract event 0x2ab676eef3f76f1bd4e765a352c6cd81e62702f7ad3d363291c8b60582a45250. // // Solidity: event TokenLaunched(address indexed token) func (_Sunpumplaunchpad *SunpumplaunchpadFilterer) WatchTokenLaunched(opts *bind.WatchOpts, sink chan<- *SunpumplaunchpadTokenLaunched, token []common.Address) (event.Subscription, error) { var tokenRule []interface{} for _, tokenItem := range token { tokenRule = append(tokenRule, tokenItem) } logs, sub, err := _Sunpumplaunchpad.contract.WatchLogs(opts, "TokenLaunched", tokenRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(SunpumplaunchpadTokenLaunched) if err := _Sunpumplaunchpad.contract.UnpackLog(event, "TokenLaunched", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseTokenLaunched is a log parse operation binding the contract event 0x2ab676eef3f76f1bd4e765a352c6cd81e62702f7ad3d363291c8b60582a45250. // // Solidity: event TokenLaunched(address indexed token) func (_Sunpumplaunchpad *SunpumplaunchpadFilterer) ParseTokenLaunched(log types.Log) (*SunpumplaunchpadTokenLaunched, error) { event := new(SunpumplaunchpadTokenLaunched) if err := _Sunpumplaunchpad.contract.UnpackLog(event, "TokenLaunched", log); err != nil { return nil, err } event.Raw = log return event, nil } // SunpumplaunchpadTokenPurchasedIterator is returned from FilterTokenPurchased and is used to iterate over the raw logs and unpacked data for TokenPurchased events raised by the Sunpumplaunchpad contract. type SunpumplaunchpadTokenPurchasedIterator struct { Event *SunpumplaunchpadTokenPurchased // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *SunpumplaunchpadTokenPurchasedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(SunpumplaunchpadTokenPurchased) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(SunpumplaunchpadTokenPurchased) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *SunpumplaunchpadTokenPurchasedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *SunpumplaunchpadTokenPurchasedIterator) Close() error { it.sub.Unsubscribe() return nil } // SunpumplaunchpadTokenPurchased represents a TokenPurchased event raised by the Sunpumplaunchpad contract. type SunpumplaunchpadTokenPurchased struct { Token common.Address Buyer common.Address TrxAmount *big.Int Fee *big.Int TokenAmount *big.Int TokenReserve *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterTokenPurchased is a free log retrieval operation binding the contract event 0x63abb62535c21a5d221cf9c15994097b8880cc986d82faf80f57382b998dbae5. // // Solidity: event TokenPurchased(address indexed token, address indexed buyer, uint256 trxAmount, uint256 fee, uint256 tokenAmount, uint256 tokenReserve) func (_Sunpumplaunchpad *SunpumplaunchpadFilterer) FilterTokenPurchased(opts *bind.FilterOpts, token []common.Address, buyer []common.Address) (*SunpumplaunchpadTokenPurchasedIterator, error) { var tokenRule []interface{} for _, tokenItem := range token { tokenRule = append(tokenRule, tokenItem) } var buyerRule []interface{} for _, buyerItem := range buyer { buyerRule = append(buyerRule, buyerItem) } logs, sub, err := _Sunpumplaunchpad.contract.FilterLogs(opts, "TokenPurchased", tokenRule, buyerRule) if err != nil { return nil, err } return &SunpumplaunchpadTokenPurchasedIterator{contract: _Sunpumplaunchpad.contract, event: "TokenPurchased", logs: logs, sub: sub}, nil } // WatchTokenPurchased is a free log subscription operation binding the contract event 0x63abb62535c21a5d221cf9c15994097b8880cc986d82faf80f57382b998dbae5. // // Solidity: event TokenPurchased(address indexed token, address indexed buyer, uint256 trxAmount, uint256 fee, uint256 tokenAmount, uint256 tokenReserve) func (_Sunpumplaunchpad *SunpumplaunchpadFilterer) WatchTokenPurchased(opts *bind.WatchOpts, sink chan<- *SunpumplaunchpadTokenPurchased, token []common.Address, buyer []common.Address) (event.Subscription, error) { var tokenRule []interface{} for _, tokenItem := range token { tokenRule = append(tokenRule, tokenItem) } var buyerRule []interface{} for _, buyerItem := range buyer { buyerRule = append(buyerRule, buyerItem) } logs, sub, err := _Sunpumplaunchpad.contract.WatchLogs(opts, "TokenPurchased", tokenRule, buyerRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(SunpumplaunchpadTokenPurchased) if err := _Sunpumplaunchpad.contract.UnpackLog(event, "TokenPurchased", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseTokenPurchased is a log parse operation binding the contract event 0x63abb62535c21a5d221cf9c15994097b8880cc986d82faf80f57382b998dbae5. // // Solidity: event TokenPurchased(address indexed token, address indexed buyer, uint256 trxAmount, uint256 fee, uint256 tokenAmount, uint256 tokenReserve) func (_Sunpumplaunchpad *SunpumplaunchpadFilterer) ParseTokenPurchased(log types.Log) (*SunpumplaunchpadTokenPurchased, error) { event := new(SunpumplaunchpadTokenPurchased) if err := _Sunpumplaunchpad.contract.UnpackLog(event, "TokenPurchased", log); err != nil { return nil, err } event.Raw = log return event, nil } // SunpumplaunchpadTokenSoldIterator is returned from FilterTokenSold and is used to iterate over the raw logs and unpacked data for TokenSold events raised by the Sunpumplaunchpad contract. type SunpumplaunchpadTokenSoldIterator struct { Event *SunpumplaunchpadTokenSold // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *SunpumplaunchpadTokenSoldIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(SunpumplaunchpadTokenSold) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(SunpumplaunchpadTokenSold) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *SunpumplaunchpadTokenSoldIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *SunpumplaunchpadTokenSoldIterator) Close() error { it.sub.Unsubscribe() return nil } // SunpumplaunchpadTokenSold represents a TokenSold event raised by the Sunpumplaunchpad contract. type SunpumplaunchpadTokenSold struct { Token common.Address Seller common.Address TrxAmount *big.Int Fee *big.Int TokenAmount *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterTokenSold is a free log retrieval operation binding the contract event 0x9387a595ac4be9038bbb9751abad8baa3dcf219dd9e19abb81552bd521fe3546. // // Solidity: event TokenSold(address indexed token, address indexed seller, uint256 trxAmount, uint256 fee, uint256 tokenAmount) func (_Sunpumplaunchpad *SunpumplaunchpadFilterer) FilterTokenSold(opts *bind.FilterOpts, token []common.Address, seller []common.Address) (*SunpumplaunchpadTokenSoldIterator, error) { var tokenRule []interface{} for _, tokenItem := range token { tokenRule = append(tokenRule, tokenItem) } var sellerRule []interface{} for _, sellerItem := range seller { sellerRule = append(sellerRule, sellerItem) } logs, sub, err := _Sunpumplaunchpad.contract.FilterLogs(opts, "TokenSold", tokenRule, sellerRule) if err != nil { return nil, err } return &SunpumplaunchpadTokenSoldIterator{contract: _Sunpumplaunchpad.contract, event: "TokenSold", logs: logs, sub: sub}, nil } // WatchTokenSold is a free log subscription operation binding the contract event 0x9387a595ac4be9038bbb9751abad8baa3dcf219dd9e19abb81552bd521fe3546. // // Solidity: event TokenSold(address indexed token, address indexed seller, uint256 trxAmount, uint256 fee, uint256 tokenAmount) func (_Sunpumplaunchpad *SunpumplaunchpadFilterer) WatchTokenSold(opts *bind.WatchOpts, sink chan<- *SunpumplaunchpadTokenSold, token []common.Address, seller []common.Address) (event.Subscription, error) { var tokenRule []interface{} for _, tokenItem := range token { tokenRule = append(tokenRule, tokenItem) } var sellerRule []interface{} for _, sellerItem := range seller { sellerRule = append(sellerRule, sellerItem) } logs, sub, err := _Sunpumplaunchpad.contract.WatchLogs(opts, "TokenSold", tokenRule, sellerRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(SunpumplaunchpadTokenSold) if err := _Sunpumplaunchpad.contract.UnpackLog(event, "TokenSold", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseTokenSold is a log parse operation binding the contract event 0x9387a595ac4be9038bbb9751abad8baa3dcf219dd9e19abb81552bd521fe3546. // // Solidity: event TokenSold(address indexed token, address indexed seller, uint256 trxAmount, uint256 fee, uint256 tokenAmount) func (_Sunpumplaunchpad *SunpumplaunchpadFilterer) ParseTokenSold(log types.Log) (*SunpumplaunchpadTokenSold, error) { event := new(SunpumplaunchpadTokenSold) if err := _Sunpumplaunchpad.contract.UnpackLog(event, "TokenSold", log); err != nil { return nil, err } event.Raw = log return event, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/binds/sunpumplaunchpad/abi.json ================================================ [ { "inputs": [ { "name": "token", "type": "address" } ], "name": "LaunchPending", "type": "event" }, { "inputs": [ { "indexed": true, "name": "oldLauncher", "type": "address" }, { "indexed": true, "name": "newLauncher", "type": "address" } ], "name": "LauncherChanged", "type": "event" }, { "inputs": [ { "name": "oldFee", "type": "uint256" }, { "name": "newFee", "type": "uint256" } ], "name": "MinTxFeeSet", "type": "event" }, { "inputs": [ { "name": "oldFee", "type": "uint256" }, { "name": "newFee", "type": "uint256" } ], "name": "MintFeeSet", "type": "event" }, { "inputs": [ { "indexed": true, "name": "oldOperator", "type": "address" }, { "indexed": true, "name": "newOperator", "type": "address" } ], "name": "OperatorChanged", "type": "event" }, { "inputs": [ { "indexed": true, "name": "oldOwner", "type": "address" }, { "indexed": true, "name": "newOwner", "type": "address" } ], "name": "OwnerChanged", "type": "event" }, { "inputs": [ { "indexed": true, "name": "oldPendingOwner", "type": "address" }, { "indexed": true, "name": "newPendingOwner", "type": "address" } ], "name": "PendingOwnerSet", "type": "event" }, { "inputs": [ { "name": "oldFee", "type": "uint256" }, { "name": "newFee", "type": "uint256" } ], "name": "PurchaseFeeSet", "type": "event" }, { "inputs": [ { "name": "oldFee", "type": "uint256" }, { "name": "newFee", "type": "uint256" } ], "name": "SaleFeeSet", "type": "event" }, { "inputs": [ { "name": "tokenAddress", "type": "address" }, { "name": "tokenIndex", "type": "uint256" }, { "name": "creator", "type": "address" } ], "name": "TokenCreate", "type": "event" }, { "inputs": [ { "indexed": true, "name": "token", "type": "address" } ], "name": "TokenLaunched", "type": "event" }, { "inputs": [ { "indexed": true, "name": "token", "type": "address" }, { "indexed": true, "name": "buyer", "type": "address" }, { "name": "trxAmount", "type": "uint256" }, { "name": "fee", "type": "uint256" }, { "name": "tokenAmount", "type": "uint256" }, { "name": "tokenReserve", "type": "uint256" } ], "name": "TokenPurchased", "type": "event" }, { "inputs": [ { "indexed": true, "name": "token", "type": "address" }, { "indexed": true, "name": "seller", "type": "address" }, { "name": "trxAmount", "type": "uint256" }, { "name": "fee", "type": "uint256" }, { "name": "tokenAmount", "type": "uint256" } ], "name": "TokenSold", "type": "event" }, { "outputs": [ { "type": "uint256" } ], "name": "LAUNCH_FEE", "stateMutability": "View", "type": "function" }, { "outputs": [ { "type": "uint256" } ], "name": "LAUNCH_THRESHOLD", "stateMutability": "View", "type": "function" }, { "outputs": [ { "type": "uint256" } ], "name": "LAUNCH_TRX_RESERVE", "stateMutability": "View", "type": "function" }, { "outputs": [ { "type": "uint256" } ], "name": "TOKEN_SUPPLY", "stateMutability": "View", "type": "function" }, { "outputs": [ { "type": "uint256" } ], "name": "TOTAL_SALE", "stateMutability": "View", "type": "function" }, { "outputs": [ { "type": "uint256" } ], "name": "VIRTUAL_TOKEN_RESERVE_AMOUNT", "stateMutability": "View", "type": "function" }, { "outputs": [ { "type": "uint256" } ], "name": "VIRTUAL_TRX_RESERVE_AMOUNT", "stateMutability": "View", "type": "function" }, { "inputs": [ { "name": "proxy", "type": "address" } ], "name": "_becomeNewImplementation", "stateMutability": "Nonpayable", "type": "function" }, { "name": "acceptOwner", "stateMutability": "Nonpayable", "type": "function" }, { "inputs": [ { "name": "name", "type": "string" }, { "name": "symbol", "type": "string" } ], "name": "createAndInitPurchase", "stateMutability": "payable", "type": "function" }, { "outputs": [ { "type": "address" } ], "name": "deadAddress", "stateMutability": "View", "type": "function" }, { "outputs": [ { "name": "trxAmount", "type": "uint256" } ], "inputs": [ { "name": "token", "type": "address" }, { "name": "tokenAmount", "type": "uint256" } ], "name": "getExactTokenAmountForPurchase", "stateMutability": "View", "type": "function" }, { "outputs": [ { "name": "trxAmount", "type": "uint256" }, { "name": "fee", "type": "uint256" } ], "inputs": [ { "name": "token", "type": "address" }, { "name": "tokenAmount", "type": "uint256" } ], "name": "getExactTokenAmountForPurchaseWithFee", "stateMutability": "View", "type": "function" }, { "outputs": [ { "name": "tokenAmount", "type": "uint256" } ], "inputs": [ { "name": "token", "type": "address" }, { "name": "trxAmount", "type": "uint256" } ], "name": "getExactTrxAmountForSale", "stateMutability": "View", "type": "function" }, { "outputs": [ { "name": "tokenAmount", "type": "uint256" }, { "name": "fee", "type": "uint256" } ], "inputs": [ { "name": "token", "type": "address" }, { "name": "trxAmount", "type": "uint256" } ], "name": "getExactTrxAmountForSaleWithFee", "stateMutability": "View", "type": "function" }, { "outputs": [ { "type": "uint256" } ], "inputs": [ { "name": "token", "type": "address" } ], "name": "getPrice", "stateMutability": "View", "type": "function" }, { "outputs": [ { "name": "tokenAmount", "type": "uint256" } ], "inputs": [ { "name": "token", "type": "address" }, { "name": "trxAmount", "type": "uint256" } ], "name": "getTokenAmountByPurchase", "stateMutability": "View", "type": "function" }, { "outputs": [ { "name": "tokenAmount", "type": "uint256" }, { "name": "fee", "type": "uint256" } ], "inputs": [ { "name": "token", "type": "address" }, { "name": "trxAmount", "type": "uint256" } ], "name": "getTokenAmountByPurchaseWithFee", "stateMutability": "View", "type": "function" }, { "outputs": [ { "type": "uint256" } ], "inputs": [ { "name": "token", "type": "address" } ], "name": "getTokenState", "stateMutability": "View", "type": "function" }, { "outputs": [ { "name": "trxAmount", "type": "uint256" } ], "inputs": [ { "name": "token", "type": "address" }, { "name": "tokenAmount", "type": "uint256" } ], "name": "getTrxAmountBySale", "stateMutability": "View", "type": "function" }, { "outputs": [ { "name": "trxAmount", "type": "uint256" }, { "name": "fee", "type": "uint256" } ], "inputs": [ { "name": "token", "type": "address" }, { "name": "tokenAmount", "type": "uint256" } ], "name": "getTrxAmountBySaleWithFee", "stateMutability": "View", "type": "function" }, { "outputs": [ { "type": "address" } ], "name": "implementation", "stateMutability": "View", "type": "function" }, { "inputs": [ { "name": "_vault", "type": "address" }, { "name": "_v2Router", "type": "address" }, { "name": "_salefee", "type": "uint256" }, { "name": "_purchasefee", "type": "uint256" } ], "name": "initialize", "stateMutability": "Nonpayable", "type": "function" }, { "outputs": [ { "type": "uint256" } ], "name": "launchFee", "stateMutability": "View", "type": "function" }, { "inputs": [ { "name": "token", "type": "address" } ], "name": "launchToDEX", "stateMutability": "Nonpayable", "type": "function" }, { "outputs": [ { "type": "address" } ], "name": "launcher", "stateMutability": "View", "type": "function" }, { "outputs": [ { "type": "uint256" } ], "name": "maxPurachaseAmount", "stateMutability": "View", "type": "function" }, { "outputs": [ { "type": "uint256" } ], "name": "minTxFee", "stateMutability": "View", "type": "function" }, { "outputs": [ { "type": "uint256" } ], "name": "mintFee", "stateMutability": "View", "type": "function" }, { "outputs": [ { "type": "address" } ], "name": "operator", "stateMutability": "View", "type": "function" }, { "outputs": [ { "type": "address" } ], "name": "owner", "stateMutability": "View", "type": "function" }, { "outputs": [ { "type": "bool" } ], "name": "pause", "stateMutability": "View", "type": "function" }, { "name": "pausePad", "stateMutability": "Nonpayable", "type": "function" }, { "outputs": [ { "type": "address" } ], "name": "pendingImplementation", "stateMutability": "View", "type": "function" }, { "outputs": [ { "type": "address" } ], "name": "pendingOwner", "stateMutability": "View", "type": "function" }, { "outputs": [ { "type": "uint256" } ], "name": "purchaseFee", "stateMutability": "View", "type": "function" }, { "inputs": [ { "name": "token", "type": "address" }, { "name": "AmountMin", "type": "uint256" } ], "name": "purchaseToken", "stateMutability": "payable", "type": "function" }, { "inputs": [ { "name": "token", "type": "address" } ], "name": "renounceTokenOwnership", "stateMutability": "Nonpayable", "type": "function" }, { "name": "rerunPad", "stateMutability": "Nonpayable", "type": "function" }, { "outputs": [ { "type": "uint256" } ], "name": "saleFee", "stateMutability": "View", "type": "function" }, { "inputs": [ { "name": "token", "type": "address" }, { "name": "tokenAmount", "type": "uint256" }, { "name": "AmountMin", "type": "uint256" } ], "name": "saleToken", "stateMutability": "Nonpayable", "type": "function" }, { "inputs": [ { "name": "newLauncher", "type": "address" } ], "name": "setLauncher", "stateMutability": "Nonpayable", "type": "function" }, { "inputs": [ { "name": "newFee", "type": "uint256" } ], "name": "setMinTxFee", "stateMutability": "Nonpayable", "type": "function" }, { "inputs": [ { "name": "_newMintFee", "type": "uint256" }, { "name": "_newMinTxFee", "type": "uint256" } ], "name": "setMintAndMinTxFee", "stateMutability": "Nonpayable", "type": "function" }, { "inputs": [ { "name": "newFee", "type": "uint256" } ], "name": "setMintFee", "stateMutability": "Nonpayable", "type": "function" }, { "inputs": [ { "name": "newOp", "type": "address" } ], "name": "setOperator", "stateMutability": "Nonpayable", "type": "function" }, { "inputs": [ { "name": "newPendingOwner", "type": "address" } ], "name": "setPendingOwner", "stateMutability": "Nonpayable", "type": "function" }, { "inputs": [ { "name": "_fee", "type": "uint256" } ], "name": "setPurchaseFee", "stateMutability": "Nonpayable", "type": "function" }, { "inputs": [ { "name": "_fee", "type": "uint256" } ], "name": "setSaleFee", "stateMutability": "Nonpayable", "type": "function" }, { "inputs": [ { "name": "_addr", "type": "address" } ], "name": "setVault", "stateMutability": "Nonpayable", "type": "function" }, { "outputs": [ { "type": "address" } ], "inputs": [ { "type": "uint256" } ], "name": "tokenAddress", "stateMutability": "View", "type": "function" }, { "outputs": [ { "type": "uint256" } ], "name": "tokenCount", "stateMutability": "View", "type": "function" }, { "outputs": [ { "type": "address" } ], "inputs": [ { "type": "address" } ], "name": "tokenCreator", "stateMutability": "View", "type": "function" }, { "outputs": [ { "type": "address" } ], "name": "v2Router", "stateMutability": "View", "type": "function" }, { "outputs": [ { "type": "address" } ], "name": "vault", "stateMutability": "View", "type": "function" }, { "outputs": [ { "name": "TRXReserve", "type": "uint256" }, { "name": "TokenReserve", "type": "uint256" }, { "name": "launched", "type": "bool" } ], "inputs": [ { "type": "address" } ], "name": "virtualPools", "stateMutability": "View", "type": "function" }, { "stateMutability": "payable", "type": "receive" } ] ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/binds/systempromptmanager/SystemPromptManager.go ================================================ // Code generated - DO NOT EDIT. // This file is a generated binding and any manual changes will be lost. package systempromptmanager import ( "errors" "math/big" "strings" ethereum "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/event" ) // Reference imports to suppress errors if they are not otherwise used. var ( _ = errors.New _ = big.NewInt _ = strings.NewReader _ = ethereum.NotFound _ = bind.Bind _ = common.Big1 _ = types.BloomLookup _ = event.NewSubscription _ = abi.ConvertType ) // ISystemPromptManagerTokenMetaData is an auto generated low-level Go binding around an user-defined struct. type ISystemPromptManagerTokenMetaData struct { Fee *big.Int SysPrompts [][]byte } // SystemPromptManagerMetaData contains all meta data concerning the SystemPromptManager contract. var SystemPromptManagerMetaData = &bind.MetaData{ ABI: "[{\"inputs\":[],\"name\":\"AlreadyMinted\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Authorized\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FailedTransfer\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FailedTransfer\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InsufficientFunds\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidNFTData\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidSignature\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Unauthorized\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"agentId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes[]\",\"name\":\"sysPrompt\",\"type\":\"bytes[]\"}],\"name\":\"AgentDataAddNew\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"agentId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"promptIndex\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"oldSysPrompt\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"newSysPrompt\",\"type\":\"bytes\"}],\"name\":\"AgentDataUpdate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"agentId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"fee\",\"type\":\"uint256\"}],\"name\":\"AgentFeeUpdate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"agentId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"uri\",\"type\":\"string\"}],\"name\":\"AgentURIUpdate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"approved\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"ApprovalForAll\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_fromTokenId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_toTokenId\",\"type\":\"uint256\"}],\"name\":\"BatchMetadataUpdate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"EIP712DomainChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"claimer\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"FeesClaimed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"fee\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"externalData\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"inferenceId\",\"type\":\"uint256\"}],\"name\":\"InferencePerformed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"ManagerAuthorization\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"ManagerDeauthorization\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_tokenId\",\"type\":\"uint256\"}],\"name\":\"MetadataUpdate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newValue\",\"type\":\"uint256\"}],\"name\":\"MintPriceUpdate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"uri\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"sysPrompt\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"fee\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"minter\",\"type\":\"address\"}],\"name\":\"NewToken\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"Paused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"newValue\",\"type\":\"uint16\"}],\"name\":\"RoyaltyPortionUpdate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAddress\",\"type\":\"address\"}],\"name\":\"RoyaltyReceiverUpdate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"agentId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TopUpPoolBalance\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"Unpaused\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_agentId\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_sysPrompt\",\"type\":\"bytes\"}],\"name\":\"addNewAgentData\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_account\",\"type\":\"address\"}],\"name\":\"authorizeManager\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"claimFee\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_agentId\",\"type\":\"uint256\"}],\"name\":\"dataOf\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"fee\",\"type\":\"uint256\"},{\"internalType\":\"bytes[]\",\"name\":\"sysPrompts\",\"type\":\"bytes[]\"}],\"internalType\":\"structISystemPromptManager.TokenMetaData\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_account\",\"type\":\"address\"}],\"name\":\"deauthorizeManager\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"nftOwner\",\"type\":\"address\"}],\"name\":\"earnedFees\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"eip712Domain\",\"outputs\":[{\"internalType\":\"bytes1\",\"name\":\"fields\",\"type\":\"bytes1\"},{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"version\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"verifyingContract\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"salt\",\"type\":\"bytes32\"},{\"internalType\":\"uint256[]\",\"name\":\"extensions\",\"type\":\"uint256[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_agentId\",\"type\":\"uint256\"}],\"name\":\"getAgentFee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_agentId\",\"type\":\"uint256\"}],\"name\":\"getAgentSystemPrompt\",\"outputs\":[{\"internalType\":\"bytes[]\",\"name\":\"\",\"type\":\"bytes[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"getApproved\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"_uri\",\"type\":\"string\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"_fee\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"_manager\",\"type\":\"address\"}],\"name\":\"getHashToSign\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_agentId\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"_uri\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"_randomNonce\",\"type\":\"uint256\"}],\"name\":\"getHashToSign\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_agentId\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_sysPrompt\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"_promptIdx\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_randomNonce\",\"type\":\"uint256\"}],\"name\":\"getHashToSign\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"hybridModel\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_agentId\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_calldata\",\"type\":\"bytes\"},{\"internalType\":\"string\",\"name\":\"_externalData\",\"type\":\"string\"}],\"name\":\"infer\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_name\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"_symbol\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"_mintPrice\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"_royaltyReceiver\",\"type\":\"address\"},{\"internalType\":\"uint16\",\"name\":\"_royaltyPortion\",\"type\":\"uint16\"},{\"internalType\":\"uint256\",\"name\":\"_nextTokenId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"_hybridModel\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_workerHub\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"name\":\"isApprovedForAll\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"isManager\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"_uri\",\"type\":\"string\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"_fee\",\"type\":\"uint256\"}],\"name\":\"mint\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"_uri\",\"type\":\"string\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"_fee\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"_manager\",\"type\":\"address\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"mintBySignature\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"mintPrice\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"nextTokenId\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"nftOwner\",\"type\":\"address\"}],\"name\":\"nonce\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"ownerOf\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"paused\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"nftId\",\"type\":\"uint256\"}],\"name\":\"poolBalance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_agentId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_salePrice\",\"type\":\"uint256\"}],\"name\":\"royaltyInfo\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"royaltyPortion\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"royaltyReceiver\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"safeTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"safeTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"setApprovalForAll\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_hybridModel\",\"type\":\"address\"}],\"name\":\"setHybridModel\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"nftOwner\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"name\":\"signaturesUsed\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"_interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"}],\"name\":\"tokenByIndex\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"}],\"name\":\"tokenOfOwnerByIndex\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_agentId\",\"type\":\"uint256\"}],\"name\":\"tokenURI\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_agentId\",\"type\":\"uint256\"}],\"name\":\"topUpPoolBalance\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"unpause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_agentId\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_sysPrompt\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"_promptIdx\",\"type\":\"uint256\"}],\"name\":\"updateAgentData\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_agentId\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_sysPrompt\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"_promptIdx\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_randomNonce\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_signature\",\"type\":\"bytes\"}],\"name\":\"updateAgentDataWithSignature\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_agentId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_fee\",\"type\":\"uint256\"}],\"name\":\"updateAgentFee\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_agentId\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"_uri\",\"type\":\"string\"}],\"name\":\"updateAgentURI\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_agentId\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"_uri\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"_randomNonce\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_signature\",\"type\":\"bytes\"}],\"name\":\"updateAgentUriWithSignature\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_mintPrice\",\"type\":\"uint256\"}],\"name\":\"updateMintPrice\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"_royaltyPortion\",\"type\":\"uint16\"}],\"name\":\"updateRoyaltyPortion\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_royaltyReceiver\",\"type\":\"address\"}],\"name\":\"updateRoyaltyReceiver\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"version\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_value\",\"type\":\"uint256\"}],\"name\":\"withdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]", } // SystemPromptManagerABI is the input ABI used to generate the binding from. // Deprecated: Use SystemPromptManagerMetaData.ABI instead. var SystemPromptManagerABI = SystemPromptManagerMetaData.ABI // SystemPromptManager is an auto generated Go binding around an Ethereum contract. type SystemPromptManager struct { SystemPromptManagerCaller // Read-only binding to the contract SystemPromptManagerTransactor // Write-only binding to the contract SystemPromptManagerFilterer // Log filterer for contract events } // SystemPromptManagerCaller is an auto generated read-only Go binding around an Ethereum contract. type SystemPromptManagerCaller struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // SystemPromptManagerTransactor is an auto generated write-only Go binding around an Ethereum contract. type SystemPromptManagerTransactor struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // SystemPromptManagerFilterer is an auto generated log filtering Go binding around an Ethereum contract events. type SystemPromptManagerFilterer struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // SystemPromptManagerSession is an auto generated Go binding around an Ethereum contract, // with pre-set call and transact options. type SystemPromptManagerSession struct { Contract *SystemPromptManager // Generic contract binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // SystemPromptManagerCallerSession is an auto generated read-only Go binding around an Ethereum contract, // with pre-set call options. type SystemPromptManagerCallerSession struct { Contract *SystemPromptManagerCaller // Generic contract caller binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session } // SystemPromptManagerTransactorSession is an auto generated write-only Go binding around an Ethereum contract, // with pre-set transact options. type SystemPromptManagerTransactorSession struct { Contract *SystemPromptManagerTransactor // Generic contract transactor binding to set the session for TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // SystemPromptManagerRaw is an auto generated low-level Go binding around an Ethereum contract. type SystemPromptManagerRaw struct { Contract *SystemPromptManager // Generic contract binding to access the raw methods on } // SystemPromptManagerCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. type SystemPromptManagerCallerRaw struct { Contract *SystemPromptManagerCaller // Generic read-only contract binding to access the raw methods on } // SystemPromptManagerTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. type SystemPromptManagerTransactorRaw struct { Contract *SystemPromptManagerTransactor // Generic write-only contract binding to access the raw methods on } // NewSystemPromptManager creates a new instance of SystemPromptManager, bound to a specific deployed contract. func NewSystemPromptManager(address common.Address, backend bind.ContractBackend) (*SystemPromptManager, error) { contract, err := bindSystemPromptManager(address, backend, backend, backend) if err != nil { return nil, err } return &SystemPromptManager{SystemPromptManagerCaller: SystemPromptManagerCaller{contract: contract}, SystemPromptManagerTransactor: SystemPromptManagerTransactor{contract: contract}, SystemPromptManagerFilterer: SystemPromptManagerFilterer{contract: contract}}, nil } // NewSystemPromptManagerCaller creates a new read-only instance of SystemPromptManager, bound to a specific deployed contract. func NewSystemPromptManagerCaller(address common.Address, caller bind.ContractCaller) (*SystemPromptManagerCaller, error) { contract, err := bindSystemPromptManager(address, caller, nil, nil) if err != nil { return nil, err } return &SystemPromptManagerCaller{contract: contract}, nil } // NewSystemPromptManagerTransactor creates a new write-only instance of SystemPromptManager, bound to a specific deployed contract. func NewSystemPromptManagerTransactor(address common.Address, transactor bind.ContractTransactor) (*SystemPromptManagerTransactor, error) { contract, err := bindSystemPromptManager(address, nil, transactor, nil) if err != nil { return nil, err } return &SystemPromptManagerTransactor{contract: contract}, nil } // NewSystemPromptManagerFilterer creates a new log filterer instance of SystemPromptManager, bound to a specific deployed contract. func NewSystemPromptManagerFilterer(address common.Address, filterer bind.ContractFilterer) (*SystemPromptManagerFilterer, error) { contract, err := bindSystemPromptManager(address, nil, nil, filterer) if err != nil { return nil, err } return &SystemPromptManagerFilterer{contract: contract}, nil } // bindSystemPromptManager binds a generic wrapper to an already deployed contract. func bindSystemPromptManager(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { parsed, err := SystemPromptManagerMetaData.GetAbi() if err != nil { return nil, err } return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_SystemPromptManager *SystemPromptManagerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _SystemPromptManager.Contract.SystemPromptManagerCaller.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_SystemPromptManager *SystemPromptManagerRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _SystemPromptManager.Contract.SystemPromptManagerTransactor.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_SystemPromptManager *SystemPromptManagerRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _SystemPromptManager.Contract.SystemPromptManagerTransactor.contract.Transact(opts, method, params...) } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_SystemPromptManager *SystemPromptManagerCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _SystemPromptManager.Contract.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_SystemPromptManager *SystemPromptManagerTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _SystemPromptManager.Contract.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_SystemPromptManager *SystemPromptManagerTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _SystemPromptManager.Contract.contract.Transact(opts, method, params...) } // BalanceOf is a free data retrieval call binding the contract method 0x70a08231. // // Solidity: function balanceOf(address owner) view returns(uint256) func (_SystemPromptManager *SystemPromptManagerCaller) BalanceOf(opts *bind.CallOpts, owner common.Address) (*big.Int, error) { var out []interface{} err := _SystemPromptManager.contract.Call(opts, &out, "balanceOf", owner) if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // BalanceOf is a free data retrieval call binding the contract method 0x70a08231. // // Solidity: function balanceOf(address owner) view returns(uint256) func (_SystemPromptManager *SystemPromptManagerSession) BalanceOf(owner common.Address) (*big.Int, error) { return _SystemPromptManager.Contract.BalanceOf(&_SystemPromptManager.CallOpts, owner) } // BalanceOf is a free data retrieval call binding the contract method 0x70a08231. // // Solidity: function balanceOf(address owner) view returns(uint256) func (_SystemPromptManager *SystemPromptManagerCallerSession) BalanceOf(owner common.Address) (*big.Int, error) { return _SystemPromptManager.Contract.BalanceOf(&_SystemPromptManager.CallOpts, owner) } // DataOf is a free data retrieval call binding the contract method 0x871caa98. // // Solidity: function dataOf(uint256 _agentId) view returns((uint256,bytes[])) func (_SystemPromptManager *SystemPromptManagerCaller) DataOf(opts *bind.CallOpts, _agentId *big.Int) (ISystemPromptManagerTokenMetaData, error) { var out []interface{} err := _SystemPromptManager.contract.Call(opts, &out, "dataOf", _agentId) if err != nil { return *new(ISystemPromptManagerTokenMetaData), err } out0 := *abi.ConvertType(out[0], new(ISystemPromptManagerTokenMetaData)).(*ISystemPromptManagerTokenMetaData) return out0, err } // DataOf is a free data retrieval call binding the contract method 0x871caa98. // // Solidity: function dataOf(uint256 _agentId) view returns((uint256,bytes[])) func (_SystemPromptManager *SystemPromptManagerSession) DataOf(_agentId *big.Int) (ISystemPromptManagerTokenMetaData, error) { return _SystemPromptManager.Contract.DataOf(&_SystemPromptManager.CallOpts, _agentId) } // DataOf is a free data retrieval call binding the contract method 0x871caa98. // // Solidity: function dataOf(uint256 _agentId) view returns((uint256,bytes[])) func (_SystemPromptManager *SystemPromptManagerCallerSession) DataOf(_agentId *big.Int) (ISystemPromptManagerTokenMetaData, error) { return _SystemPromptManager.Contract.DataOf(&_SystemPromptManager.CallOpts, _agentId) } // EarnedFees is a free data retrieval call binding the contract method 0xfeb7219d. // // Solidity: function earnedFees(address nftOwner) view returns(uint256) func (_SystemPromptManager *SystemPromptManagerCaller) EarnedFees(opts *bind.CallOpts, nftOwner common.Address) (*big.Int, error) { var out []interface{} err := _SystemPromptManager.contract.Call(opts, &out, "earnedFees", nftOwner) if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // EarnedFees is a free data retrieval call binding the contract method 0xfeb7219d. // // Solidity: function earnedFees(address nftOwner) view returns(uint256) func (_SystemPromptManager *SystemPromptManagerSession) EarnedFees(nftOwner common.Address) (*big.Int, error) { return _SystemPromptManager.Contract.EarnedFees(&_SystemPromptManager.CallOpts, nftOwner) } // EarnedFees is a free data retrieval call binding the contract method 0xfeb7219d. // // Solidity: function earnedFees(address nftOwner) view returns(uint256) func (_SystemPromptManager *SystemPromptManagerCallerSession) EarnedFees(nftOwner common.Address) (*big.Int, error) { return _SystemPromptManager.Contract.EarnedFees(&_SystemPromptManager.CallOpts, nftOwner) } // Eip712Domain is a free data retrieval call binding the contract method 0x84b0196e. // // Solidity: function eip712Domain() view returns(bytes1 fields, string name, string version, uint256 chainId, address verifyingContract, bytes32 salt, uint256[] extensions) func (_SystemPromptManager *SystemPromptManagerCaller) Eip712Domain(opts *bind.CallOpts) (struct { Fields [1]byte Name string Version string ChainId *big.Int VerifyingContract common.Address Salt [32]byte Extensions []*big.Int }, error) { var out []interface{} err := _SystemPromptManager.contract.Call(opts, &out, "eip712Domain") outstruct := new(struct { Fields [1]byte Name string Version string ChainId *big.Int VerifyingContract common.Address Salt [32]byte Extensions []*big.Int }) if err != nil { return *outstruct, err } outstruct.Fields = *abi.ConvertType(out[0], new([1]byte)).(*[1]byte) outstruct.Name = *abi.ConvertType(out[1], new(string)).(*string) outstruct.Version = *abi.ConvertType(out[2], new(string)).(*string) outstruct.ChainId = *abi.ConvertType(out[3], new(*big.Int)).(**big.Int) outstruct.VerifyingContract = *abi.ConvertType(out[4], new(common.Address)).(*common.Address) outstruct.Salt = *abi.ConvertType(out[5], new([32]byte)).(*[32]byte) outstruct.Extensions = *abi.ConvertType(out[6], new([]*big.Int)).(*[]*big.Int) return *outstruct, err } // Eip712Domain is a free data retrieval call binding the contract method 0x84b0196e. // // Solidity: function eip712Domain() view returns(bytes1 fields, string name, string version, uint256 chainId, address verifyingContract, bytes32 salt, uint256[] extensions) func (_SystemPromptManager *SystemPromptManagerSession) Eip712Domain() (struct { Fields [1]byte Name string Version string ChainId *big.Int VerifyingContract common.Address Salt [32]byte Extensions []*big.Int }, error) { return _SystemPromptManager.Contract.Eip712Domain(&_SystemPromptManager.CallOpts) } // Eip712Domain is a free data retrieval call binding the contract method 0x84b0196e. // // Solidity: function eip712Domain() view returns(bytes1 fields, string name, string version, uint256 chainId, address verifyingContract, bytes32 salt, uint256[] extensions) func (_SystemPromptManager *SystemPromptManagerCallerSession) Eip712Domain() (struct { Fields [1]byte Name string Version string ChainId *big.Int VerifyingContract common.Address Salt [32]byte Extensions []*big.Int }, error) { return _SystemPromptManager.Contract.Eip712Domain(&_SystemPromptManager.CallOpts) } // GetAgentFee is a free data retrieval call binding the contract method 0xed96f433. // // Solidity: function getAgentFee(uint256 _agentId) view returns(uint256) func (_SystemPromptManager *SystemPromptManagerCaller) GetAgentFee(opts *bind.CallOpts, _agentId *big.Int) (*big.Int, error) { var out []interface{} err := _SystemPromptManager.contract.Call(opts, &out, "getAgentFee", _agentId) if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // GetAgentFee is a free data retrieval call binding the contract method 0xed96f433. // // Solidity: function getAgentFee(uint256 _agentId) view returns(uint256) func (_SystemPromptManager *SystemPromptManagerSession) GetAgentFee(_agentId *big.Int) (*big.Int, error) { return _SystemPromptManager.Contract.GetAgentFee(&_SystemPromptManager.CallOpts, _agentId) } // GetAgentFee is a free data retrieval call binding the contract method 0xed96f433. // // Solidity: function getAgentFee(uint256 _agentId) view returns(uint256) func (_SystemPromptManager *SystemPromptManagerCallerSession) GetAgentFee(_agentId *big.Int) (*big.Int, error) { return _SystemPromptManager.Contract.GetAgentFee(&_SystemPromptManager.CallOpts, _agentId) } // GetAgentSystemPrompt is a free data retrieval call binding the contract method 0xf325f3f1. // // Solidity: function getAgentSystemPrompt(uint256 _agentId) view returns(bytes[]) func (_SystemPromptManager *SystemPromptManagerCaller) GetAgentSystemPrompt(opts *bind.CallOpts, _agentId *big.Int) ([][]byte, error) { var out []interface{} err := _SystemPromptManager.contract.Call(opts, &out, "getAgentSystemPrompt", _agentId) if err != nil { return *new([][]byte), err } out0 := *abi.ConvertType(out[0], new([][]byte)).(*[][]byte) return out0, err } // GetAgentSystemPrompt is a free data retrieval call binding the contract method 0xf325f3f1. // // Solidity: function getAgentSystemPrompt(uint256 _agentId) view returns(bytes[]) func (_SystemPromptManager *SystemPromptManagerSession) GetAgentSystemPrompt(_agentId *big.Int) ([][]byte, error) { return _SystemPromptManager.Contract.GetAgentSystemPrompt(&_SystemPromptManager.CallOpts, _agentId) } // GetAgentSystemPrompt is a free data retrieval call binding the contract method 0xf325f3f1. // // Solidity: function getAgentSystemPrompt(uint256 _agentId) view returns(bytes[]) func (_SystemPromptManager *SystemPromptManagerCallerSession) GetAgentSystemPrompt(_agentId *big.Int) ([][]byte, error) { return _SystemPromptManager.Contract.GetAgentSystemPrompt(&_SystemPromptManager.CallOpts, _agentId) } // GetApproved is a free data retrieval call binding the contract method 0x081812fc. // // Solidity: function getApproved(uint256 tokenId) view returns(address) func (_SystemPromptManager *SystemPromptManagerCaller) GetApproved(opts *bind.CallOpts, tokenId *big.Int) (common.Address, error) { var out []interface{} err := _SystemPromptManager.contract.Call(opts, &out, "getApproved", tokenId) if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // GetApproved is a free data retrieval call binding the contract method 0x081812fc. // // Solidity: function getApproved(uint256 tokenId) view returns(address) func (_SystemPromptManager *SystemPromptManagerSession) GetApproved(tokenId *big.Int) (common.Address, error) { return _SystemPromptManager.Contract.GetApproved(&_SystemPromptManager.CallOpts, tokenId) } // GetApproved is a free data retrieval call binding the contract method 0x081812fc. // // Solidity: function getApproved(uint256 tokenId) view returns(address) func (_SystemPromptManager *SystemPromptManagerCallerSession) GetApproved(tokenId *big.Int) (common.Address, error) { return _SystemPromptManager.Contract.GetApproved(&_SystemPromptManager.CallOpts, tokenId) } // GetHashToSign is a free data retrieval call binding the contract method 0x68cfcc9a. // // Solidity: function getHashToSign(address _to, string _uri, bytes _data, uint256 _fee, address _manager) view returns(bytes32) func (_SystemPromptManager *SystemPromptManagerCaller) GetHashToSign(opts *bind.CallOpts, _to common.Address, _uri string, _data []byte, _fee *big.Int, _manager common.Address) ([32]byte, error) { var out []interface{} err := _SystemPromptManager.contract.Call(opts, &out, "getHashToSign", _to, _uri, _data, _fee, _manager) if err != nil { return *new([32]byte), err } out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) return out0, err } // GetHashToSign is a free data retrieval call binding the contract method 0x68cfcc9a. // // Solidity: function getHashToSign(address _to, string _uri, bytes _data, uint256 _fee, address _manager) view returns(bytes32) func (_SystemPromptManager *SystemPromptManagerSession) GetHashToSign(_to common.Address, _uri string, _data []byte, _fee *big.Int, _manager common.Address) ([32]byte, error) { return _SystemPromptManager.Contract.GetHashToSign(&_SystemPromptManager.CallOpts, _to, _uri, _data, _fee, _manager) } // GetHashToSign is a free data retrieval call binding the contract method 0x68cfcc9a. // // Solidity: function getHashToSign(address _to, string _uri, bytes _data, uint256 _fee, address _manager) view returns(bytes32) func (_SystemPromptManager *SystemPromptManagerCallerSession) GetHashToSign(_to common.Address, _uri string, _data []byte, _fee *big.Int, _manager common.Address) ([32]byte, error) { return _SystemPromptManager.Contract.GetHashToSign(&_SystemPromptManager.CallOpts, _to, _uri, _data, _fee, _manager) } // GetHashToSign0 is a free data retrieval call binding the contract method 0x937a91d9. // // Solidity: function getHashToSign(uint256 _agentId, string _uri, uint256 _randomNonce) view returns(bytes32) func (_SystemPromptManager *SystemPromptManagerCaller) GetHashToSign0(opts *bind.CallOpts, _agentId *big.Int, _uri string, _randomNonce *big.Int) ([32]byte, error) { var out []interface{} err := _SystemPromptManager.contract.Call(opts, &out, "getHashToSign0", _agentId, _uri, _randomNonce) if err != nil { return *new([32]byte), err } out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) return out0, err } // GetHashToSign0 is a free data retrieval call binding the contract method 0x937a91d9. // // Solidity: function getHashToSign(uint256 _agentId, string _uri, uint256 _randomNonce) view returns(bytes32) func (_SystemPromptManager *SystemPromptManagerSession) GetHashToSign0(_agentId *big.Int, _uri string, _randomNonce *big.Int) ([32]byte, error) { return _SystemPromptManager.Contract.GetHashToSign0(&_SystemPromptManager.CallOpts, _agentId, _uri, _randomNonce) } // GetHashToSign0 is a free data retrieval call binding the contract method 0x937a91d9. // // Solidity: function getHashToSign(uint256 _agentId, string _uri, uint256 _randomNonce) view returns(bytes32) func (_SystemPromptManager *SystemPromptManagerCallerSession) GetHashToSign0(_agentId *big.Int, _uri string, _randomNonce *big.Int) ([32]byte, error) { return _SystemPromptManager.Contract.GetHashToSign0(&_SystemPromptManager.CallOpts, _agentId, _uri, _randomNonce) } // GetHashToSign1 is a free data retrieval call binding the contract method 0xe340d79f. // // Solidity: function getHashToSign(uint256 _agentId, bytes _sysPrompt, uint256 _promptIdx, uint256 _randomNonce) view returns(bytes32) func (_SystemPromptManager *SystemPromptManagerCaller) GetHashToSign1(opts *bind.CallOpts, _agentId *big.Int, _sysPrompt []byte, _promptIdx *big.Int, _randomNonce *big.Int) ([32]byte, error) { var out []interface{} err := _SystemPromptManager.contract.Call(opts, &out, "getHashToSign1", _agentId, _sysPrompt, _promptIdx, _randomNonce) if err != nil { return *new([32]byte), err } out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) return out0, err } // GetHashToSign1 is a free data retrieval call binding the contract method 0xe340d79f. // // Solidity: function getHashToSign(uint256 _agentId, bytes _sysPrompt, uint256 _promptIdx, uint256 _randomNonce) view returns(bytes32) func (_SystemPromptManager *SystemPromptManagerSession) GetHashToSign1(_agentId *big.Int, _sysPrompt []byte, _promptIdx *big.Int, _randomNonce *big.Int) ([32]byte, error) { return _SystemPromptManager.Contract.GetHashToSign1(&_SystemPromptManager.CallOpts, _agentId, _sysPrompt, _promptIdx, _randomNonce) } // GetHashToSign1 is a free data retrieval call binding the contract method 0xe340d79f. // // Solidity: function getHashToSign(uint256 _agentId, bytes _sysPrompt, uint256 _promptIdx, uint256 _randomNonce) view returns(bytes32) func (_SystemPromptManager *SystemPromptManagerCallerSession) GetHashToSign1(_agentId *big.Int, _sysPrompt []byte, _promptIdx *big.Int, _randomNonce *big.Int) ([32]byte, error) { return _SystemPromptManager.Contract.GetHashToSign1(&_SystemPromptManager.CallOpts, _agentId, _sysPrompt, _promptIdx, _randomNonce) } // HybridModel is a free data retrieval call binding the contract method 0x5eb2364c. // // Solidity: function hybridModel() view returns(address) func (_SystemPromptManager *SystemPromptManagerCaller) HybridModel(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _SystemPromptManager.contract.Call(opts, &out, "hybridModel") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // HybridModel is a free data retrieval call binding the contract method 0x5eb2364c. // // Solidity: function hybridModel() view returns(address) func (_SystemPromptManager *SystemPromptManagerSession) HybridModel() (common.Address, error) { return _SystemPromptManager.Contract.HybridModel(&_SystemPromptManager.CallOpts) } // HybridModel is a free data retrieval call binding the contract method 0x5eb2364c. // // Solidity: function hybridModel() view returns(address) func (_SystemPromptManager *SystemPromptManagerCallerSession) HybridModel() (common.Address, error) { return _SystemPromptManager.Contract.HybridModel(&_SystemPromptManager.CallOpts) } // IsApprovedForAll is a free data retrieval call binding the contract method 0xe985e9c5. // // Solidity: function isApprovedForAll(address owner, address operator) view returns(bool) func (_SystemPromptManager *SystemPromptManagerCaller) IsApprovedForAll(opts *bind.CallOpts, owner common.Address, operator common.Address) (bool, error) { var out []interface{} err := _SystemPromptManager.contract.Call(opts, &out, "isApprovedForAll", owner, operator) if err != nil { return *new(bool), err } out0 := *abi.ConvertType(out[0], new(bool)).(*bool) return out0, err } // IsApprovedForAll is a free data retrieval call binding the contract method 0xe985e9c5. // // Solidity: function isApprovedForAll(address owner, address operator) view returns(bool) func (_SystemPromptManager *SystemPromptManagerSession) IsApprovedForAll(owner common.Address, operator common.Address) (bool, error) { return _SystemPromptManager.Contract.IsApprovedForAll(&_SystemPromptManager.CallOpts, owner, operator) } // IsApprovedForAll is a free data retrieval call binding the contract method 0xe985e9c5. // // Solidity: function isApprovedForAll(address owner, address operator) view returns(bool) func (_SystemPromptManager *SystemPromptManagerCallerSession) IsApprovedForAll(owner common.Address, operator common.Address) (bool, error) { return _SystemPromptManager.Contract.IsApprovedForAll(&_SystemPromptManager.CallOpts, owner, operator) } // IsManager is a free data retrieval call binding the contract method 0xf3ae2415. // // Solidity: function isManager(address ) view returns(bool) func (_SystemPromptManager *SystemPromptManagerCaller) IsManager(opts *bind.CallOpts, arg0 common.Address) (bool, error) { var out []interface{} err := _SystemPromptManager.contract.Call(opts, &out, "isManager", arg0) if err != nil { return *new(bool), err } out0 := *abi.ConvertType(out[0], new(bool)).(*bool) return out0, err } // IsManager is a free data retrieval call binding the contract method 0xf3ae2415. // // Solidity: function isManager(address ) view returns(bool) func (_SystemPromptManager *SystemPromptManagerSession) IsManager(arg0 common.Address) (bool, error) { return _SystemPromptManager.Contract.IsManager(&_SystemPromptManager.CallOpts, arg0) } // IsManager is a free data retrieval call binding the contract method 0xf3ae2415. // // Solidity: function isManager(address ) view returns(bool) func (_SystemPromptManager *SystemPromptManagerCallerSession) IsManager(arg0 common.Address) (bool, error) { return _SystemPromptManager.Contract.IsManager(&_SystemPromptManager.CallOpts, arg0) } // MintPrice is a free data retrieval call binding the contract method 0x6817c76c. // // Solidity: function mintPrice() view returns(uint256) func (_SystemPromptManager *SystemPromptManagerCaller) MintPrice(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} err := _SystemPromptManager.contract.Call(opts, &out, "mintPrice") if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // MintPrice is a free data retrieval call binding the contract method 0x6817c76c. // // Solidity: function mintPrice() view returns(uint256) func (_SystemPromptManager *SystemPromptManagerSession) MintPrice() (*big.Int, error) { return _SystemPromptManager.Contract.MintPrice(&_SystemPromptManager.CallOpts) } // MintPrice is a free data retrieval call binding the contract method 0x6817c76c. // // Solidity: function mintPrice() view returns(uint256) func (_SystemPromptManager *SystemPromptManagerCallerSession) MintPrice() (*big.Int, error) { return _SystemPromptManager.Contract.MintPrice(&_SystemPromptManager.CallOpts) } // Name is a free data retrieval call binding the contract method 0x06fdde03. // // Solidity: function name() view returns(string) func (_SystemPromptManager *SystemPromptManagerCaller) Name(opts *bind.CallOpts) (string, error) { var out []interface{} err := _SystemPromptManager.contract.Call(opts, &out, "name") if err != nil { return *new(string), err } out0 := *abi.ConvertType(out[0], new(string)).(*string) return out0, err } // Name is a free data retrieval call binding the contract method 0x06fdde03. // // Solidity: function name() view returns(string) func (_SystemPromptManager *SystemPromptManagerSession) Name() (string, error) { return _SystemPromptManager.Contract.Name(&_SystemPromptManager.CallOpts) } // Name is a free data retrieval call binding the contract method 0x06fdde03. // // Solidity: function name() view returns(string) func (_SystemPromptManager *SystemPromptManagerCallerSession) Name() (string, error) { return _SystemPromptManager.Contract.Name(&_SystemPromptManager.CallOpts) } // NextTokenId is a free data retrieval call binding the contract method 0x75794a3c. // // Solidity: function nextTokenId() view returns(uint256) func (_SystemPromptManager *SystemPromptManagerCaller) NextTokenId(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} err := _SystemPromptManager.contract.Call(opts, &out, "nextTokenId") if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // NextTokenId is a free data retrieval call binding the contract method 0x75794a3c. // // Solidity: function nextTokenId() view returns(uint256) func (_SystemPromptManager *SystemPromptManagerSession) NextTokenId() (*big.Int, error) { return _SystemPromptManager.Contract.NextTokenId(&_SystemPromptManager.CallOpts) } // NextTokenId is a free data retrieval call binding the contract method 0x75794a3c. // // Solidity: function nextTokenId() view returns(uint256) func (_SystemPromptManager *SystemPromptManagerCallerSession) NextTokenId() (*big.Int, error) { return _SystemPromptManager.Contract.NextTokenId(&_SystemPromptManager.CallOpts) } // Nonce is a free data retrieval call binding the contract method 0x70ae92d2. // // Solidity: function nonce(address nftOwner) view returns(uint256) func (_SystemPromptManager *SystemPromptManagerCaller) Nonce(opts *bind.CallOpts, nftOwner common.Address) (*big.Int, error) { var out []interface{} err := _SystemPromptManager.contract.Call(opts, &out, "nonce", nftOwner) if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // Nonce is a free data retrieval call binding the contract method 0x70ae92d2. // // Solidity: function nonce(address nftOwner) view returns(uint256) func (_SystemPromptManager *SystemPromptManagerSession) Nonce(nftOwner common.Address) (*big.Int, error) { return _SystemPromptManager.Contract.Nonce(&_SystemPromptManager.CallOpts, nftOwner) } // Nonce is a free data retrieval call binding the contract method 0x70ae92d2. // // Solidity: function nonce(address nftOwner) view returns(uint256) func (_SystemPromptManager *SystemPromptManagerCallerSession) Nonce(nftOwner common.Address) (*big.Int, error) { return _SystemPromptManager.Contract.Nonce(&_SystemPromptManager.CallOpts, nftOwner) } // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. // // Solidity: function owner() view returns(address) func (_SystemPromptManager *SystemPromptManagerCaller) Owner(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _SystemPromptManager.contract.Call(opts, &out, "owner") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. // // Solidity: function owner() view returns(address) func (_SystemPromptManager *SystemPromptManagerSession) Owner() (common.Address, error) { return _SystemPromptManager.Contract.Owner(&_SystemPromptManager.CallOpts) } // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. // // Solidity: function owner() view returns(address) func (_SystemPromptManager *SystemPromptManagerCallerSession) Owner() (common.Address, error) { return _SystemPromptManager.Contract.Owner(&_SystemPromptManager.CallOpts) } // OwnerOf is a free data retrieval call binding the contract method 0x6352211e. // // Solidity: function ownerOf(uint256 tokenId) view returns(address) func (_SystemPromptManager *SystemPromptManagerCaller) OwnerOf(opts *bind.CallOpts, tokenId *big.Int) (common.Address, error) { var out []interface{} err := _SystemPromptManager.contract.Call(opts, &out, "ownerOf", tokenId) if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // OwnerOf is a free data retrieval call binding the contract method 0x6352211e. // // Solidity: function ownerOf(uint256 tokenId) view returns(address) func (_SystemPromptManager *SystemPromptManagerSession) OwnerOf(tokenId *big.Int) (common.Address, error) { return _SystemPromptManager.Contract.OwnerOf(&_SystemPromptManager.CallOpts, tokenId) } // OwnerOf is a free data retrieval call binding the contract method 0x6352211e. // // Solidity: function ownerOf(uint256 tokenId) view returns(address) func (_SystemPromptManager *SystemPromptManagerCallerSession) OwnerOf(tokenId *big.Int) (common.Address, error) { return _SystemPromptManager.Contract.OwnerOf(&_SystemPromptManager.CallOpts, tokenId) } // Paused is a free data retrieval call binding the contract method 0x5c975abb. // // Solidity: function paused() view returns(bool) func (_SystemPromptManager *SystemPromptManagerCaller) Paused(opts *bind.CallOpts) (bool, error) { var out []interface{} err := _SystemPromptManager.contract.Call(opts, &out, "paused") if err != nil { return *new(bool), err } out0 := *abi.ConvertType(out[0], new(bool)).(*bool) return out0, err } // Paused is a free data retrieval call binding the contract method 0x5c975abb. // // Solidity: function paused() view returns(bool) func (_SystemPromptManager *SystemPromptManagerSession) Paused() (bool, error) { return _SystemPromptManager.Contract.Paused(&_SystemPromptManager.CallOpts) } // Paused is a free data retrieval call binding the contract method 0x5c975abb. // // Solidity: function paused() view returns(bool) func (_SystemPromptManager *SystemPromptManagerCallerSession) Paused() (bool, error) { return _SystemPromptManager.Contract.Paused(&_SystemPromptManager.CallOpts) } // PoolBalance is a free data retrieval call binding the contract method 0x6a6d964e. // // Solidity: function poolBalance(uint256 nftId) view returns(uint256) func (_SystemPromptManager *SystemPromptManagerCaller) PoolBalance(opts *bind.CallOpts, nftId *big.Int) (*big.Int, error) { var out []interface{} err := _SystemPromptManager.contract.Call(opts, &out, "poolBalance", nftId) if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // PoolBalance is a free data retrieval call binding the contract method 0x6a6d964e. // // Solidity: function poolBalance(uint256 nftId) view returns(uint256) func (_SystemPromptManager *SystemPromptManagerSession) PoolBalance(nftId *big.Int) (*big.Int, error) { return _SystemPromptManager.Contract.PoolBalance(&_SystemPromptManager.CallOpts, nftId) } // PoolBalance is a free data retrieval call binding the contract method 0x6a6d964e. // // Solidity: function poolBalance(uint256 nftId) view returns(uint256) func (_SystemPromptManager *SystemPromptManagerCallerSession) PoolBalance(nftId *big.Int) (*big.Int, error) { return _SystemPromptManager.Contract.PoolBalance(&_SystemPromptManager.CallOpts, nftId) } // RoyaltyInfo is a free data retrieval call binding the contract method 0x2a55205a. // // Solidity: function royaltyInfo(uint256 _agentId, uint256 _salePrice) view returns(address, uint256) func (_SystemPromptManager *SystemPromptManagerCaller) RoyaltyInfo(opts *bind.CallOpts, _agentId *big.Int, _salePrice *big.Int) (common.Address, *big.Int, error) { var out []interface{} err := _SystemPromptManager.contract.Call(opts, &out, "royaltyInfo", _agentId, _salePrice) if err != nil { return *new(common.Address), *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) out1 := *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) return out0, out1, err } // RoyaltyInfo is a free data retrieval call binding the contract method 0x2a55205a. // // Solidity: function royaltyInfo(uint256 _agentId, uint256 _salePrice) view returns(address, uint256) func (_SystemPromptManager *SystemPromptManagerSession) RoyaltyInfo(_agentId *big.Int, _salePrice *big.Int) (common.Address, *big.Int, error) { return _SystemPromptManager.Contract.RoyaltyInfo(&_SystemPromptManager.CallOpts, _agentId, _salePrice) } // RoyaltyInfo is a free data retrieval call binding the contract method 0x2a55205a. // // Solidity: function royaltyInfo(uint256 _agentId, uint256 _salePrice) view returns(address, uint256) func (_SystemPromptManager *SystemPromptManagerCallerSession) RoyaltyInfo(_agentId *big.Int, _salePrice *big.Int) (common.Address, *big.Int, error) { return _SystemPromptManager.Contract.RoyaltyInfo(&_SystemPromptManager.CallOpts, _agentId, _salePrice) } // RoyaltyPortion is a free data retrieval call binding the contract method 0x11d7beb2. // // Solidity: function royaltyPortion() view returns(uint16) func (_SystemPromptManager *SystemPromptManagerCaller) RoyaltyPortion(opts *bind.CallOpts) (uint16, error) { var out []interface{} err := _SystemPromptManager.contract.Call(opts, &out, "royaltyPortion") if err != nil { return *new(uint16), err } out0 := *abi.ConvertType(out[0], new(uint16)).(*uint16) return out0, err } // RoyaltyPortion is a free data retrieval call binding the contract method 0x11d7beb2. // // Solidity: function royaltyPortion() view returns(uint16) func (_SystemPromptManager *SystemPromptManagerSession) RoyaltyPortion() (uint16, error) { return _SystemPromptManager.Contract.RoyaltyPortion(&_SystemPromptManager.CallOpts) } // RoyaltyPortion is a free data retrieval call binding the contract method 0x11d7beb2. // // Solidity: function royaltyPortion() view returns(uint16) func (_SystemPromptManager *SystemPromptManagerCallerSession) RoyaltyPortion() (uint16, error) { return _SystemPromptManager.Contract.RoyaltyPortion(&_SystemPromptManager.CallOpts) } // RoyaltyReceiver is a free data retrieval call binding the contract method 0x9fbc8713. // // Solidity: function royaltyReceiver() view returns(address) func (_SystemPromptManager *SystemPromptManagerCaller) RoyaltyReceiver(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _SystemPromptManager.contract.Call(opts, &out, "royaltyReceiver") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // RoyaltyReceiver is a free data retrieval call binding the contract method 0x9fbc8713. // // Solidity: function royaltyReceiver() view returns(address) func (_SystemPromptManager *SystemPromptManagerSession) RoyaltyReceiver() (common.Address, error) { return _SystemPromptManager.Contract.RoyaltyReceiver(&_SystemPromptManager.CallOpts) } // RoyaltyReceiver is a free data retrieval call binding the contract method 0x9fbc8713. // // Solidity: function royaltyReceiver() view returns(address) func (_SystemPromptManager *SystemPromptManagerCallerSession) RoyaltyReceiver() (common.Address, error) { return _SystemPromptManager.Contract.RoyaltyReceiver(&_SystemPromptManager.CallOpts) } // SignaturesUsed is a free data retrieval call binding the contract method 0x757d513b. // // Solidity: function signaturesUsed(address nftOwner, bytes signature) view returns(bool) func (_SystemPromptManager *SystemPromptManagerCaller) SignaturesUsed(opts *bind.CallOpts, nftOwner common.Address, signature []byte) (bool, error) { var out []interface{} err := _SystemPromptManager.contract.Call(opts, &out, "signaturesUsed", nftOwner, signature) if err != nil { return *new(bool), err } out0 := *abi.ConvertType(out[0], new(bool)).(*bool) return out0, err } // SignaturesUsed is a free data retrieval call binding the contract method 0x757d513b. // // Solidity: function signaturesUsed(address nftOwner, bytes signature) view returns(bool) func (_SystemPromptManager *SystemPromptManagerSession) SignaturesUsed(nftOwner common.Address, signature []byte) (bool, error) { return _SystemPromptManager.Contract.SignaturesUsed(&_SystemPromptManager.CallOpts, nftOwner, signature) } // SignaturesUsed is a free data retrieval call binding the contract method 0x757d513b. // // Solidity: function signaturesUsed(address nftOwner, bytes signature) view returns(bool) func (_SystemPromptManager *SystemPromptManagerCallerSession) SignaturesUsed(nftOwner common.Address, signature []byte) (bool, error) { return _SystemPromptManager.Contract.SignaturesUsed(&_SystemPromptManager.CallOpts, nftOwner, signature) } // SupportsInterface is a free data retrieval call binding the contract method 0x01ffc9a7. // // Solidity: function supportsInterface(bytes4 _interfaceId) view returns(bool) func (_SystemPromptManager *SystemPromptManagerCaller) SupportsInterface(opts *bind.CallOpts, _interfaceId [4]byte) (bool, error) { var out []interface{} err := _SystemPromptManager.contract.Call(opts, &out, "supportsInterface", _interfaceId) if err != nil { return *new(bool), err } out0 := *abi.ConvertType(out[0], new(bool)).(*bool) return out0, err } // SupportsInterface is a free data retrieval call binding the contract method 0x01ffc9a7. // // Solidity: function supportsInterface(bytes4 _interfaceId) view returns(bool) func (_SystemPromptManager *SystemPromptManagerSession) SupportsInterface(_interfaceId [4]byte) (bool, error) { return _SystemPromptManager.Contract.SupportsInterface(&_SystemPromptManager.CallOpts, _interfaceId) } // SupportsInterface is a free data retrieval call binding the contract method 0x01ffc9a7. // // Solidity: function supportsInterface(bytes4 _interfaceId) view returns(bool) func (_SystemPromptManager *SystemPromptManagerCallerSession) SupportsInterface(_interfaceId [4]byte) (bool, error) { return _SystemPromptManager.Contract.SupportsInterface(&_SystemPromptManager.CallOpts, _interfaceId) } // Symbol is a free data retrieval call binding the contract method 0x95d89b41. // // Solidity: function symbol() view returns(string) func (_SystemPromptManager *SystemPromptManagerCaller) Symbol(opts *bind.CallOpts) (string, error) { var out []interface{} err := _SystemPromptManager.contract.Call(opts, &out, "symbol") if err != nil { return *new(string), err } out0 := *abi.ConvertType(out[0], new(string)).(*string) return out0, err } // Symbol is a free data retrieval call binding the contract method 0x95d89b41. // // Solidity: function symbol() view returns(string) func (_SystemPromptManager *SystemPromptManagerSession) Symbol() (string, error) { return _SystemPromptManager.Contract.Symbol(&_SystemPromptManager.CallOpts) } // Symbol is a free data retrieval call binding the contract method 0x95d89b41. // // Solidity: function symbol() view returns(string) func (_SystemPromptManager *SystemPromptManagerCallerSession) Symbol() (string, error) { return _SystemPromptManager.Contract.Symbol(&_SystemPromptManager.CallOpts) } // TokenByIndex is a free data retrieval call binding the contract method 0x4f6ccce7. // // Solidity: function tokenByIndex(uint256 index) view returns(uint256) func (_SystemPromptManager *SystemPromptManagerCaller) TokenByIndex(opts *bind.CallOpts, index *big.Int) (*big.Int, error) { var out []interface{} err := _SystemPromptManager.contract.Call(opts, &out, "tokenByIndex", index) if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // TokenByIndex is a free data retrieval call binding the contract method 0x4f6ccce7. // // Solidity: function tokenByIndex(uint256 index) view returns(uint256) func (_SystemPromptManager *SystemPromptManagerSession) TokenByIndex(index *big.Int) (*big.Int, error) { return _SystemPromptManager.Contract.TokenByIndex(&_SystemPromptManager.CallOpts, index) } // TokenByIndex is a free data retrieval call binding the contract method 0x4f6ccce7. // // Solidity: function tokenByIndex(uint256 index) view returns(uint256) func (_SystemPromptManager *SystemPromptManagerCallerSession) TokenByIndex(index *big.Int) (*big.Int, error) { return _SystemPromptManager.Contract.TokenByIndex(&_SystemPromptManager.CallOpts, index) } // TokenOfOwnerByIndex is a free data retrieval call binding the contract method 0x2f745c59. // // Solidity: function tokenOfOwnerByIndex(address owner, uint256 index) view returns(uint256) func (_SystemPromptManager *SystemPromptManagerCaller) TokenOfOwnerByIndex(opts *bind.CallOpts, owner common.Address, index *big.Int) (*big.Int, error) { var out []interface{} err := _SystemPromptManager.contract.Call(opts, &out, "tokenOfOwnerByIndex", owner, index) if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // TokenOfOwnerByIndex is a free data retrieval call binding the contract method 0x2f745c59. // // Solidity: function tokenOfOwnerByIndex(address owner, uint256 index) view returns(uint256) func (_SystemPromptManager *SystemPromptManagerSession) TokenOfOwnerByIndex(owner common.Address, index *big.Int) (*big.Int, error) { return _SystemPromptManager.Contract.TokenOfOwnerByIndex(&_SystemPromptManager.CallOpts, owner, index) } // TokenOfOwnerByIndex is a free data retrieval call binding the contract method 0x2f745c59. // // Solidity: function tokenOfOwnerByIndex(address owner, uint256 index) view returns(uint256) func (_SystemPromptManager *SystemPromptManagerCallerSession) TokenOfOwnerByIndex(owner common.Address, index *big.Int) (*big.Int, error) { return _SystemPromptManager.Contract.TokenOfOwnerByIndex(&_SystemPromptManager.CallOpts, owner, index) } // TokenURI is a free data retrieval call binding the contract method 0xc87b56dd. // // Solidity: function tokenURI(uint256 _agentId) view returns(string) func (_SystemPromptManager *SystemPromptManagerCaller) TokenURI(opts *bind.CallOpts, _agentId *big.Int) (string, error) { var out []interface{} err := _SystemPromptManager.contract.Call(opts, &out, "tokenURI", _agentId) if err != nil { return *new(string), err } out0 := *abi.ConvertType(out[0], new(string)).(*string) return out0, err } // TokenURI is a free data retrieval call binding the contract method 0xc87b56dd. // // Solidity: function tokenURI(uint256 _agentId) view returns(string) func (_SystemPromptManager *SystemPromptManagerSession) TokenURI(_agentId *big.Int) (string, error) { return _SystemPromptManager.Contract.TokenURI(&_SystemPromptManager.CallOpts, _agentId) } // TokenURI is a free data retrieval call binding the contract method 0xc87b56dd. // // Solidity: function tokenURI(uint256 _agentId) view returns(string) func (_SystemPromptManager *SystemPromptManagerCallerSession) TokenURI(_agentId *big.Int) (string, error) { return _SystemPromptManager.Contract.TokenURI(&_SystemPromptManager.CallOpts, _agentId) } // TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. // // Solidity: function totalSupply() view returns(uint256) func (_SystemPromptManager *SystemPromptManagerCaller) TotalSupply(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} err := _SystemPromptManager.contract.Call(opts, &out, "totalSupply") if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. // // Solidity: function totalSupply() view returns(uint256) func (_SystemPromptManager *SystemPromptManagerSession) TotalSupply() (*big.Int, error) { return _SystemPromptManager.Contract.TotalSupply(&_SystemPromptManager.CallOpts) } // TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. // // Solidity: function totalSupply() view returns(uint256) func (_SystemPromptManager *SystemPromptManagerCallerSession) TotalSupply() (*big.Int, error) { return _SystemPromptManager.Contract.TotalSupply(&_SystemPromptManager.CallOpts) } // Version is a free data retrieval call binding the contract method 0x54fd4d50. // // Solidity: function version() pure returns(string) func (_SystemPromptManager *SystemPromptManagerCaller) Version(opts *bind.CallOpts) (string, error) { var out []interface{} err := _SystemPromptManager.contract.Call(opts, &out, "version") if err != nil { return *new(string), err } out0 := *abi.ConvertType(out[0], new(string)).(*string) return out0, err } // Version is a free data retrieval call binding the contract method 0x54fd4d50. // // Solidity: function version() pure returns(string) func (_SystemPromptManager *SystemPromptManagerSession) Version() (string, error) { return _SystemPromptManager.Contract.Version(&_SystemPromptManager.CallOpts) } // Version is a free data retrieval call binding the contract method 0x54fd4d50. // // Solidity: function version() pure returns(string) func (_SystemPromptManager *SystemPromptManagerCallerSession) Version() (string, error) { return _SystemPromptManager.Contract.Version(&_SystemPromptManager.CallOpts) } // AddNewAgentData is a paid mutator transaction binding the contract method 0x9f10cc66. // // Solidity: function addNewAgentData(uint256 _agentId, bytes _sysPrompt) returns() func (_SystemPromptManager *SystemPromptManagerTransactor) AddNewAgentData(opts *bind.TransactOpts, _agentId *big.Int, _sysPrompt []byte) (*types.Transaction, error) { return _SystemPromptManager.contract.Transact(opts, "addNewAgentData", _agentId, _sysPrompt) } // AddNewAgentData is a paid mutator transaction binding the contract method 0x9f10cc66. // // Solidity: function addNewAgentData(uint256 _agentId, bytes _sysPrompt) returns() func (_SystemPromptManager *SystemPromptManagerSession) AddNewAgentData(_agentId *big.Int, _sysPrompt []byte) (*types.Transaction, error) { return _SystemPromptManager.Contract.AddNewAgentData(&_SystemPromptManager.TransactOpts, _agentId, _sysPrompt) } // AddNewAgentData is a paid mutator transaction binding the contract method 0x9f10cc66. // // Solidity: function addNewAgentData(uint256 _agentId, bytes _sysPrompt) returns() func (_SystemPromptManager *SystemPromptManagerTransactorSession) AddNewAgentData(_agentId *big.Int, _sysPrompt []byte) (*types.Transaction, error) { return _SystemPromptManager.Contract.AddNewAgentData(&_SystemPromptManager.TransactOpts, _agentId, _sysPrompt) } // Approve is a paid mutator transaction binding the contract method 0x095ea7b3. // // Solidity: function approve(address to, uint256 tokenId) returns() func (_SystemPromptManager *SystemPromptManagerTransactor) Approve(opts *bind.TransactOpts, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _SystemPromptManager.contract.Transact(opts, "approve", to, tokenId) } // Approve is a paid mutator transaction binding the contract method 0x095ea7b3. // // Solidity: function approve(address to, uint256 tokenId) returns() func (_SystemPromptManager *SystemPromptManagerSession) Approve(to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _SystemPromptManager.Contract.Approve(&_SystemPromptManager.TransactOpts, to, tokenId) } // Approve is a paid mutator transaction binding the contract method 0x095ea7b3. // // Solidity: function approve(address to, uint256 tokenId) returns() func (_SystemPromptManager *SystemPromptManagerTransactorSession) Approve(to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _SystemPromptManager.Contract.Approve(&_SystemPromptManager.TransactOpts, to, tokenId) } // AuthorizeManager is a paid mutator transaction binding the contract method 0x267c8507. // // Solidity: function authorizeManager(address _account) returns() func (_SystemPromptManager *SystemPromptManagerTransactor) AuthorizeManager(opts *bind.TransactOpts, _account common.Address) (*types.Transaction, error) { return _SystemPromptManager.contract.Transact(opts, "authorizeManager", _account) } // AuthorizeManager is a paid mutator transaction binding the contract method 0x267c8507. // // Solidity: function authorizeManager(address _account) returns() func (_SystemPromptManager *SystemPromptManagerSession) AuthorizeManager(_account common.Address) (*types.Transaction, error) { return _SystemPromptManager.Contract.AuthorizeManager(&_SystemPromptManager.TransactOpts, _account) } // AuthorizeManager is a paid mutator transaction binding the contract method 0x267c8507. // // Solidity: function authorizeManager(address _account) returns() func (_SystemPromptManager *SystemPromptManagerTransactorSession) AuthorizeManager(_account common.Address) (*types.Transaction, error) { return _SystemPromptManager.Contract.AuthorizeManager(&_SystemPromptManager.TransactOpts, _account) } // ClaimFee is a paid mutator transaction binding the contract method 0x99d32fc4. // // Solidity: function claimFee() returns() func (_SystemPromptManager *SystemPromptManagerTransactor) ClaimFee(opts *bind.TransactOpts) (*types.Transaction, error) { return _SystemPromptManager.contract.Transact(opts, "claimFee") } // ClaimFee is a paid mutator transaction binding the contract method 0x99d32fc4. // // Solidity: function claimFee() returns() func (_SystemPromptManager *SystemPromptManagerSession) ClaimFee() (*types.Transaction, error) { return _SystemPromptManager.Contract.ClaimFee(&_SystemPromptManager.TransactOpts) } // ClaimFee is a paid mutator transaction binding the contract method 0x99d32fc4. // // Solidity: function claimFee() returns() func (_SystemPromptManager *SystemPromptManagerTransactorSession) ClaimFee() (*types.Transaction, error) { return _SystemPromptManager.Contract.ClaimFee(&_SystemPromptManager.TransactOpts) } // DeauthorizeManager is a paid mutator transaction binding the contract method 0x0305ea01. // // Solidity: function deauthorizeManager(address _account) returns() func (_SystemPromptManager *SystemPromptManagerTransactor) DeauthorizeManager(opts *bind.TransactOpts, _account common.Address) (*types.Transaction, error) { return _SystemPromptManager.contract.Transact(opts, "deauthorizeManager", _account) } // DeauthorizeManager is a paid mutator transaction binding the contract method 0x0305ea01. // // Solidity: function deauthorizeManager(address _account) returns() func (_SystemPromptManager *SystemPromptManagerSession) DeauthorizeManager(_account common.Address) (*types.Transaction, error) { return _SystemPromptManager.Contract.DeauthorizeManager(&_SystemPromptManager.TransactOpts, _account) } // DeauthorizeManager is a paid mutator transaction binding the contract method 0x0305ea01. // // Solidity: function deauthorizeManager(address _account) returns() func (_SystemPromptManager *SystemPromptManagerTransactorSession) DeauthorizeManager(_account common.Address) (*types.Transaction, error) { return _SystemPromptManager.Contract.DeauthorizeManager(&_SystemPromptManager.TransactOpts, _account) } // Infer is a paid mutator transaction binding the contract method 0x566a9951. // // Solidity: function infer(uint256 _agentId, bytes _calldata, string _externalData) payable returns() func (_SystemPromptManager *SystemPromptManagerTransactor) Infer(opts *bind.TransactOpts, _agentId *big.Int, _calldata []byte, _externalData string) (*types.Transaction, error) { return _SystemPromptManager.contract.Transact(opts, "infer", _agentId, _calldata, _externalData) } // Infer is a paid mutator transaction binding the contract method 0x566a9951. // // Solidity: function infer(uint256 _agentId, bytes _calldata, string _externalData) payable returns() func (_SystemPromptManager *SystemPromptManagerSession) Infer(_agentId *big.Int, _calldata []byte, _externalData string) (*types.Transaction, error) { return _SystemPromptManager.Contract.Infer(&_SystemPromptManager.TransactOpts, _agentId, _calldata, _externalData) } // Infer is a paid mutator transaction binding the contract method 0x566a9951. // // Solidity: function infer(uint256 _agentId, bytes _calldata, string _externalData) payable returns() func (_SystemPromptManager *SystemPromptManagerTransactorSession) Infer(_agentId *big.Int, _calldata []byte, _externalData string) (*types.Transaction, error) { return _SystemPromptManager.Contract.Infer(&_SystemPromptManager.TransactOpts, _agentId, _calldata, _externalData) } // Initialize is a paid mutator transaction binding the contract method 0x1e18fb8c. // // Solidity: function initialize(string _name, string _symbol, uint256 _mintPrice, address _royaltyReceiver, uint16 _royaltyPortion, uint256 _nextTokenId, address _hybridModel, address _workerHub) returns() func (_SystemPromptManager *SystemPromptManagerTransactor) Initialize(opts *bind.TransactOpts, _name string, _symbol string, _mintPrice *big.Int, _royaltyReceiver common.Address, _royaltyPortion uint16, _nextTokenId *big.Int, _hybridModel common.Address, _workerHub common.Address) (*types.Transaction, error) { return _SystemPromptManager.contract.Transact(opts, "initialize", _name, _symbol, _mintPrice, _royaltyReceiver, _royaltyPortion, _nextTokenId, _hybridModel, _workerHub) } // Initialize is a paid mutator transaction binding the contract method 0x1e18fb8c. // // Solidity: function initialize(string _name, string _symbol, uint256 _mintPrice, address _royaltyReceiver, uint16 _royaltyPortion, uint256 _nextTokenId, address _hybridModel, address _workerHub) returns() func (_SystemPromptManager *SystemPromptManagerSession) Initialize(_name string, _symbol string, _mintPrice *big.Int, _royaltyReceiver common.Address, _royaltyPortion uint16, _nextTokenId *big.Int, _hybridModel common.Address, _workerHub common.Address) (*types.Transaction, error) { return _SystemPromptManager.Contract.Initialize(&_SystemPromptManager.TransactOpts, _name, _symbol, _mintPrice, _royaltyReceiver, _royaltyPortion, _nextTokenId, _hybridModel, _workerHub) } // Initialize is a paid mutator transaction binding the contract method 0x1e18fb8c. // // Solidity: function initialize(string _name, string _symbol, uint256 _mintPrice, address _royaltyReceiver, uint16 _royaltyPortion, uint256 _nextTokenId, address _hybridModel, address _workerHub) returns() func (_SystemPromptManager *SystemPromptManagerTransactorSession) Initialize(_name string, _symbol string, _mintPrice *big.Int, _royaltyReceiver common.Address, _royaltyPortion uint16, _nextTokenId *big.Int, _hybridModel common.Address, _workerHub common.Address) (*types.Transaction, error) { return _SystemPromptManager.Contract.Initialize(&_SystemPromptManager.TransactOpts, _name, _symbol, _mintPrice, _royaltyReceiver, _royaltyPortion, _nextTokenId, _hybridModel, _workerHub) } // Mint is a paid mutator transaction binding the contract method 0xcc216aca. // // Solidity: function mint(address _to, string _uri, bytes _data, uint256 _fee) payable returns(uint256) func (_SystemPromptManager *SystemPromptManagerTransactor) Mint(opts *bind.TransactOpts, _to common.Address, _uri string, _data []byte, _fee *big.Int) (*types.Transaction, error) { return _SystemPromptManager.contract.Transact(opts, "mint", _to, _uri, _data, _fee) } // Mint is a paid mutator transaction binding the contract method 0xcc216aca. // // Solidity: function mint(address _to, string _uri, bytes _data, uint256 _fee) payable returns(uint256) func (_SystemPromptManager *SystemPromptManagerSession) Mint(_to common.Address, _uri string, _data []byte, _fee *big.Int) (*types.Transaction, error) { return _SystemPromptManager.Contract.Mint(&_SystemPromptManager.TransactOpts, _to, _uri, _data, _fee) } // Mint is a paid mutator transaction binding the contract method 0xcc216aca. // // Solidity: function mint(address _to, string _uri, bytes _data, uint256 _fee) payable returns(uint256) func (_SystemPromptManager *SystemPromptManagerTransactorSession) Mint(_to common.Address, _uri string, _data []byte, _fee *big.Int) (*types.Transaction, error) { return _SystemPromptManager.Contract.Mint(&_SystemPromptManager.TransactOpts, _to, _uri, _data, _fee) } // MintBySignature is a paid mutator transaction binding the contract method 0x53ec32b7. // // Solidity: function mintBySignature(address _to, string _uri, bytes _data, uint256 _fee, address _manager, uint8 v, bytes32 r, bytes32 s) returns(uint256) func (_SystemPromptManager *SystemPromptManagerTransactor) MintBySignature(opts *bind.TransactOpts, _to common.Address, _uri string, _data []byte, _fee *big.Int, _manager common.Address, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _SystemPromptManager.contract.Transact(opts, "mintBySignature", _to, _uri, _data, _fee, _manager, v, r, s) } // MintBySignature is a paid mutator transaction binding the contract method 0x53ec32b7. // // Solidity: function mintBySignature(address _to, string _uri, bytes _data, uint256 _fee, address _manager, uint8 v, bytes32 r, bytes32 s) returns(uint256) func (_SystemPromptManager *SystemPromptManagerSession) MintBySignature(_to common.Address, _uri string, _data []byte, _fee *big.Int, _manager common.Address, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _SystemPromptManager.Contract.MintBySignature(&_SystemPromptManager.TransactOpts, _to, _uri, _data, _fee, _manager, v, r, s) } // MintBySignature is a paid mutator transaction binding the contract method 0x53ec32b7. // // Solidity: function mintBySignature(address _to, string _uri, bytes _data, uint256 _fee, address _manager, uint8 v, bytes32 r, bytes32 s) returns(uint256) func (_SystemPromptManager *SystemPromptManagerTransactorSession) MintBySignature(_to common.Address, _uri string, _data []byte, _fee *big.Int, _manager common.Address, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _SystemPromptManager.Contract.MintBySignature(&_SystemPromptManager.TransactOpts, _to, _uri, _data, _fee, _manager, v, r, s) } // Pause is a paid mutator transaction binding the contract method 0x8456cb59. // // Solidity: function pause() returns() func (_SystemPromptManager *SystemPromptManagerTransactor) Pause(opts *bind.TransactOpts) (*types.Transaction, error) { return _SystemPromptManager.contract.Transact(opts, "pause") } // Pause is a paid mutator transaction binding the contract method 0x8456cb59. // // Solidity: function pause() returns() func (_SystemPromptManager *SystemPromptManagerSession) Pause() (*types.Transaction, error) { return _SystemPromptManager.Contract.Pause(&_SystemPromptManager.TransactOpts) } // Pause is a paid mutator transaction binding the contract method 0x8456cb59. // // Solidity: function pause() returns() func (_SystemPromptManager *SystemPromptManagerTransactorSession) Pause() (*types.Transaction, error) { return _SystemPromptManager.Contract.Pause(&_SystemPromptManager.TransactOpts) } // RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. // // Solidity: function renounceOwnership() returns() func (_SystemPromptManager *SystemPromptManagerTransactor) RenounceOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { return _SystemPromptManager.contract.Transact(opts, "renounceOwnership") } // RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. // // Solidity: function renounceOwnership() returns() func (_SystemPromptManager *SystemPromptManagerSession) RenounceOwnership() (*types.Transaction, error) { return _SystemPromptManager.Contract.RenounceOwnership(&_SystemPromptManager.TransactOpts) } // RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. // // Solidity: function renounceOwnership() returns() func (_SystemPromptManager *SystemPromptManagerTransactorSession) RenounceOwnership() (*types.Transaction, error) { return _SystemPromptManager.Contract.RenounceOwnership(&_SystemPromptManager.TransactOpts) } // SafeTransferFrom is a paid mutator transaction binding the contract method 0x42842e0e. // // Solidity: function safeTransferFrom(address from, address to, uint256 tokenId) returns() func (_SystemPromptManager *SystemPromptManagerTransactor) SafeTransferFrom(opts *bind.TransactOpts, from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _SystemPromptManager.contract.Transact(opts, "safeTransferFrom", from, to, tokenId) } // SafeTransferFrom is a paid mutator transaction binding the contract method 0x42842e0e. // // Solidity: function safeTransferFrom(address from, address to, uint256 tokenId) returns() func (_SystemPromptManager *SystemPromptManagerSession) SafeTransferFrom(from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _SystemPromptManager.Contract.SafeTransferFrom(&_SystemPromptManager.TransactOpts, from, to, tokenId) } // SafeTransferFrom is a paid mutator transaction binding the contract method 0x42842e0e. // // Solidity: function safeTransferFrom(address from, address to, uint256 tokenId) returns() func (_SystemPromptManager *SystemPromptManagerTransactorSession) SafeTransferFrom(from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _SystemPromptManager.Contract.SafeTransferFrom(&_SystemPromptManager.TransactOpts, from, to, tokenId) } // SafeTransferFrom0 is a paid mutator transaction binding the contract method 0xb88d4fde. // // Solidity: function safeTransferFrom(address from, address to, uint256 tokenId, bytes data) returns() func (_SystemPromptManager *SystemPromptManagerTransactor) SafeTransferFrom0(opts *bind.TransactOpts, from common.Address, to common.Address, tokenId *big.Int, data []byte) (*types.Transaction, error) { return _SystemPromptManager.contract.Transact(opts, "safeTransferFrom0", from, to, tokenId, data) } // SafeTransferFrom0 is a paid mutator transaction binding the contract method 0xb88d4fde. // // Solidity: function safeTransferFrom(address from, address to, uint256 tokenId, bytes data) returns() func (_SystemPromptManager *SystemPromptManagerSession) SafeTransferFrom0(from common.Address, to common.Address, tokenId *big.Int, data []byte) (*types.Transaction, error) { return _SystemPromptManager.Contract.SafeTransferFrom0(&_SystemPromptManager.TransactOpts, from, to, tokenId, data) } // SafeTransferFrom0 is a paid mutator transaction binding the contract method 0xb88d4fde. // // Solidity: function safeTransferFrom(address from, address to, uint256 tokenId, bytes data) returns() func (_SystemPromptManager *SystemPromptManagerTransactorSession) SafeTransferFrom0(from common.Address, to common.Address, tokenId *big.Int, data []byte) (*types.Transaction, error) { return _SystemPromptManager.Contract.SafeTransferFrom0(&_SystemPromptManager.TransactOpts, from, to, tokenId, data) } // SetApprovalForAll is a paid mutator transaction binding the contract method 0xa22cb465. // // Solidity: function setApprovalForAll(address operator, bool approved) returns() func (_SystemPromptManager *SystemPromptManagerTransactor) SetApprovalForAll(opts *bind.TransactOpts, operator common.Address, approved bool) (*types.Transaction, error) { return _SystemPromptManager.contract.Transact(opts, "setApprovalForAll", operator, approved) } // SetApprovalForAll is a paid mutator transaction binding the contract method 0xa22cb465. // // Solidity: function setApprovalForAll(address operator, bool approved) returns() func (_SystemPromptManager *SystemPromptManagerSession) SetApprovalForAll(operator common.Address, approved bool) (*types.Transaction, error) { return _SystemPromptManager.Contract.SetApprovalForAll(&_SystemPromptManager.TransactOpts, operator, approved) } // SetApprovalForAll is a paid mutator transaction binding the contract method 0xa22cb465. // // Solidity: function setApprovalForAll(address operator, bool approved) returns() func (_SystemPromptManager *SystemPromptManagerTransactorSession) SetApprovalForAll(operator common.Address, approved bool) (*types.Transaction, error) { return _SystemPromptManager.Contract.SetApprovalForAll(&_SystemPromptManager.TransactOpts, operator, approved) } // SetHybridModel is a paid mutator transaction binding the contract method 0xe645f296. // // Solidity: function setHybridModel(address _hybridModel) returns() func (_SystemPromptManager *SystemPromptManagerTransactor) SetHybridModel(opts *bind.TransactOpts, _hybridModel common.Address) (*types.Transaction, error) { return _SystemPromptManager.contract.Transact(opts, "setHybridModel", _hybridModel) } // SetHybridModel is a paid mutator transaction binding the contract method 0xe645f296. // // Solidity: function setHybridModel(address _hybridModel) returns() func (_SystemPromptManager *SystemPromptManagerSession) SetHybridModel(_hybridModel common.Address) (*types.Transaction, error) { return _SystemPromptManager.Contract.SetHybridModel(&_SystemPromptManager.TransactOpts, _hybridModel) } // SetHybridModel is a paid mutator transaction binding the contract method 0xe645f296. // // Solidity: function setHybridModel(address _hybridModel) returns() func (_SystemPromptManager *SystemPromptManagerTransactorSession) SetHybridModel(_hybridModel common.Address) (*types.Transaction, error) { return _SystemPromptManager.Contract.SetHybridModel(&_SystemPromptManager.TransactOpts, _hybridModel) } // TopUpPoolBalance is a paid mutator transaction binding the contract method 0xc82cd94b. // // Solidity: function topUpPoolBalance(uint256 _agentId) payable returns() func (_SystemPromptManager *SystemPromptManagerTransactor) TopUpPoolBalance(opts *bind.TransactOpts, _agentId *big.Int) (*types.Transaction, error) { return _SystemPromptManager.contract.Transact(opts, "topUpPoolBalance", _agentId) } // TopUpPoolBalance is a paid mutator transaction binding the contract method 0xc82cd94b. // // Solidity: function topUpPoolBalance(uint256 _agentId) payable returns() func (_SystemPromptManager *SystemPromptManagerSession) TopUpPoolBalance(_agentId *big.Int) (*types.Transaction, error) { return _SystemPromptManager.Contract.TopUpPoolBalance(&_SystemPromptManager.TransactOpts, _agentId) } // TopUpPoolBalance is a paid mutator transaction binding the contract method 0xc82cd94b. // // Solidity: function topUpPoolBalance(uint256 _agentId) payable returns() func (_SystemPromptManager *SystemPromptManagerTransactorSession) TopUpPoolBalance(_agentId *big.Int) (*types.Transaction, error) { return _SystemPromptManager.Contract.TopUpPoolBalance(&_SystemPromptManager.TransactOpts, _agentId) } // TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. // // Solidity: function transferFrom(address from, address to, uint256 tokenId) returns() func (_SystemPromptManager *SystemPromptManagerTransactor) TransferFrom(opts *bind.TransactOpts, from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _SystemPromptManager.contract.Transact(opts, "transferFrom", from, to, tokenId) } // TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. // // Solidity: function transferFrom(address from, address to, uint256 tokenId) returns() func (_SystemPromptManager *SystemPromptManagerSession) TransferFrom(from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _SystemPromptManager.Contract.TransferFrom(&_SystemPromptManager.TransactOpts, from, to, tokenId) } // TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. // // Solidity: function transferFrom(address from, address to, uint256 tokenId) returns() func (_SystemPromptManager *SystemPromptManagerTransactorSession) TransferFrom(from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _SystemPromptManager.Contract.TransferFrom(&_SystemPromptManager.TransactOpts, from, to, tokenId) } // TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. // // Solidity: function transferOwnership(address newOwner) returns() func (_SystemPromptManager *SystemPromptManagerTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) { return _SystemPromptManager.contract.Transact(opts, "transferOwnership", newOwner) } // TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. // // Solidity: function transferOwnership(address newOwner) returns() func (_SystemPromptManager *SystemPromptManagerSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { return _SystemPromptManager.Contract.TransferOwnership(&_SystemPromptManager.TransactOpts, newOwner) } // TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. // // Solidity: function transferOwnership(address newOwner) returns() func (_SystemPromptManager *SystemPromptManagerTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { return _SystemPromptManager.Contract.TransferOwnership(&_SystemPromptManager.TransactOpts, newOwner) } // Unpause is a paid mutator transaction binding the contract method 0x3f4ba83a. // // Solidity: function unpause() returns() func (_SystemPromptManager *SystemPromptManagerTransactor) Unpause(opts *bind.TransactOpts) (*types.Transaction, error) { return _SystemPromptManager.contract.Transact(opts, "unpause") } // Unpause is a paid mutator transaction binding the contract method 0x3f4ba83a. // // Solidity: function unpause() returns() func (_SystemPromptManager *SystemPromptManagerSession) Unpause() (*types.Transaction, error) { return _SystemPromptManager.Contract.Unpause(&_SystemPromptManager.TransactOpts) } // Unpause is a paid mutator transaction binding the contract method 0x3f4ba83a. // // Solidity: function unpause() returns() func (_SystemPromptManager *SystemPromptManagerTransactorSession) Unpause() (*types.Transaction, error) { return _SystemPromptManager.Contract.Unpause(&_SystemPromptManager.TransactOpts) } // UpdateAgentData is a paid mutator transaction binding the contract method 0xed82c9e0. // // Solidity: function updateAgentData(uint256 _agentId, bytes _sysPrompt, uint256 _promptIdx) returns() func (_SystemPromptManager *SystemPromptManagerTransactor) UpdateAgentData(opts *bind.TransactOpts, _agentId *big.Int, _sysPrompt []byte, _promptIdx *big.Int) (*types.Transaction, error) { return _SystemPromptManager.contract.Transact(opts, "updateAgentData", _agentId, _sysPrompt, _promptIdx) } // UpdateAgentData is a paid mutator transaction binding the contract method 0xed82c9e0. // // Solidity: function updateAgentData(uint256 _agentId, bytes _sysPrompt, uint256 _promptIdx) returns() func (_SystemPromptManager *SystemPromptManagerSession) UpdateAgentData(_agentId *big.Int, _sysPrompt []byte, _promptIdx *big.Int) (*types.Transaction, error) { return _SystemPromptManager.Contract.UpdateAgentData(&_SystemPromptManager.TransactOpts, _agentId, _sysPrompt, _promptIdx) } // UpdateAgentData is a paid mutator transaction binding the contract method 0xed82c9e0. // // Solidity: function updateAgentData(uint256 _agentId, bytes _sysPrompt, uint256 _promptIdx) returns() func (_SystemPromptManager *SystemPromptManagerTransactorSession) UpdateAgentData(_agentId *big.Int, _sysPrompt []byte, _promptIdx *big.Int) (*types.Transaction, error) { return _SystemPromptManager.Contract.UpdateAgentData(&_SystemPromptManager.TransactOpts, _agentId, _sysPrompt, _promptIdx) } // UpdateAgentDataWithSignature is a paid mutator transaction binding the contract method 0xb8a49a57. // // Solidity: function updateAgentDataWithSignature(uint256 _agentId, bytes _sysPrompt, uint256 _promptIdx, uint256 _randomNonce, bytes _signature) returns() func (_SystemPromptManager *SystemPromptManagerTransactor) UpdateAgentDataWithSignature(opts *bind.TransactOpts, _agentId *big.Int, _sysPrompt []byte, _promptIdx *big.Int, _randomNonce *big.Int, _signature []byte) (*types.Transaction, error) { return _SystemPromptManager.contract.Transact(opts, "updateAgentDataWithSignature", _agentId, _sysPrompt, _promptIdx, _randomNonce, _signature) } // UpdateAgentDataWithSignature is a paid mutator transaction binding the contract method 0xb8a49a57. // // Solidity: function updateAgentDataWithSignature(uint256 _agentId, bytes _sysPrompt, uint256 _promptIdx, uint256 _randomNonce, bytes _signature) returns() func (_SystemPromptManager *SystemPromptManagerSession) UpdateAgentDataWithSignature(_agentId *big.Int, _sysPrompt []byte, _promptIdx *big.Int, _randomNonce *big.Int, _signature []byte) (*types.Transaction, error) { return _SystemPromptManager.Contract.UpdateAgentDataWithSignature(&_SystemPromptManager.TransactOpts, _agentId, _sysPrompt, _promptIdx, _randomNonce, _signature) } // UpdateAgentDataWithSignature is a paid mutator transaction binding the contract method 0xb8a49a57. // // Solidity: function updateAgentDataWithSignature(uint256 _agentId, bytes _sysPrompt, uint256 _promptIdx, uint256 _randomNonce, bytes _signature) returns() func (_SystemPromptManager *SystemPromptManagerTransactorSession) UpdateAgentDataWithSignature(_agentId *big.Int, _sysPrompt []byte, _promptIdx *big.Int, _randomNonce *big.Int, _signature []byte) (*types.Transaction, error) { return _SystemPromptManager.Contract.UpdateAgentDataWithSignature(&_SystemPromptManager.TransactOpts, _agentId, _sysPrompt, _promptIdx, _randomNonce, _signature) } // UpdateAgentFee is a paid mutator transaction binding the contract method 0xb1fd1526. // // Solidity: function updateAgentFee(uint256 _agentId, uint256 _fee) returns() func (_SystemPromptManager *SystemPromptManagerTransactor) UpdateAgentFee(opts *bind.TransactOpts, _agentId *big.Int, _fee *big.Int) (*types.Transaction, error) { return _SystemPromptManager.contract.Transact(opts, "updateAgentFee", _agentId, _fee) } // UpdateAgentFee is a paid mutator transaction binding the contract method 0xb1fd1526. // // Solidity: function updateAgentFee(uint256 _agentId, uint256 _fee) returns() func (_SystemPromptManager *SystemPromptManagerSession) UpdateAgentFee(_agentId *big.Int, _fee *big.Int) (*types.Transaction, error) { return _SystemPromptManager.Contract.UpdateAgentFee(&_SystemPromptManager.TransactOpts, _agentId, _fee) } // UpdateAgentFee is a paid mutator transaction binding the contract method 0xb1fd1526. // // Solidity: function updateAgentFee(uint256 _agentId, uint256 _fee) returns() func (_SystemPromptManager *SystemPromptManagerTransactorSession) UpdateAgentFee(_agentId *big.Int, _fee *big.Int) (*types.Transaction, error) { return _SystemPromptManager.Contract.UpdateAgentFee(&_SystemPromptManager.TransactOpts, _agentId, _fee) } // UpdateAgentURI is a paid mutator transaction binding the contract method 0x6b595822. // // Solidity: function updateAgentURI(uint256 _agentId, string _uri) returns() func (_SystemPromptManager *SystemPromptManagerTransactor) UpdateAgentURI(opts *bind.TransactOpts, _agentId *big.Int, _uri string) (*types.Transaction, error) { return _SystemPromptManager.contract.Transact(opts, "updateAgentURI", _agentId, _uri) } // UpdateAgentURI is a paid mutator transaction binding the contract method 0x6b595822. // // Solidity: function updateAgentURI(uint256 _agentId, string _uri) returns() func (_SystemPromptManager *SystemPromptManagerSession) UpdateAgentURI(_agentId *big.Int, _uri string) (*types.Transaction, error) { return _SystemPromptManager.Contract.UpdateAgentURI(&_SystemPromptManager.TransactOpts, _agentId, _uri) } // UpdateAgentURI is a paid mutator transaction binding the contract method 0x6b595822. // // Solidity: function updateAgentURI(uint256 _agentId, string _uri) returns() func (_SystemPromptManager *SystemPromptManagerTransactorSession) UpdateAgentURI(_agentId *big.Int, _uri string) (*types.Transaction, error) { return _SystemPromptManager.Contract.UpdateAgentURI(&_SystemPromptManager.TransactOpts, _agentId, _uri) } // UpdateAgentUriWithSignature is a paid mutator transaction binding the contract method 0xf5888779. // // Solidity: function updateAgentUriWithSignature(uint256 _agentId, string _uri, uint256 _randomNonce, bytes _signature) returns() func (_SystemPromptManager *SystemPromptManagerTransactor) UpdateAgentUriWithSignature(opts *bind.TransactOpts, _agentId *big.Int, _uri string, _randomNonce *big.Int, _signature []byte) (*types.Transaction, error) { return _SystemPromptManager.contract.Transact(opts, "updateAgentUriWithSignature", _agentId, _uri, _randomNonce, _signature) } // UpdateAgentUriWithSignature is a paid mutator transaction binding the contract method 0xf5888779. // // Solidity: function updateAgentUriWithSignature(uint256 _agentId, string _uri, uint256 _randomNonce, bytes _signature) returns() func (_SystemPromptManager *SystemPromptManagerSession) UpdateAgentUriWithSignature(_agentId *big.Int, _uri string, _randomNonce *big.Int, _signature []byte) (*types.Transaction, error) { return _SystemPromptManager.Contract.UpdateAgentUriWithSignature(&_SystemPromptManager.TransactOpts, _agentId, _uri, _randomNonce, _signature) } // UpdateAgentUriWithSignature is a paid mutator transaction binding the contract method 0xf5888779. // // Solidity: function updateAgentUriWithSignature(uint256 _agentId, string _uri, uint256 _randomNonce, bytes _signature) returns() func (_SystemPromptManager *SystemPromptManagerTransactorSession) UpdateAgentUriWithSignature(_agentId *big.Int, _uri string, _randomNonce *big.Int, _signature []byte) (*types.Transaction, error) { return _SystemPromptManager.Contract.UpdateAgentUriWithSignature(&_SystemPromptManager.TransactOpts, _agentId, _uri, _randomNonce, _signature) } // UpdateMintPrice is a paid mutator transaction binding the contract method 0x00728e46. // // Solidity: function updateMintPrice(uint256 _mintPrice) returns() func (_SystemPromptManager *SystemPromptManagerTransactor) UpdateMintPrice(opts *bind.TransactOpts, _mintPrice *big.Int) (*types.Transaction, error) { return _SystemPromptManager.contract.Transact(opts, "updateMintPrice", _mintPrice) } // UpdateMintPrice is a paid mutator transaction binding the contract method 0x00728e46. // // Solidity: function updateMintPrice(uint256 _mintPrice) returns() func (_SystemPromptManager *SystemPromptManagerSession) UpdateMintPrice(_mintPrice *big.Int) (*types.Transaction, error) { return _SystemPromptManager.Contract.UpdateMintPrice(&_SystemPromptManager.TransactOpts, _mintPrice) } // UpdateMintPrice is a paid mutator transaction binding the contract method 0x00728e46. // // Solidity: function updateMintPrice(uint256 _mintPrice) returns() func (_SystemPromptManager *SystemPromptManagerTransactorSession) UpdateMintPrice(_mintPrice *big.Int) (*types.Transaction, error) { return _SystemPromptManager.Contract.UpdateMintPrice(&_SystemPromptManager.TransactOpts, _mintPrice) } // UpdateRoyaltyPortion is a paid mutator transaction binding the contract method 0x19e93993. // // Solidity: function updateRoyaltyPortion(uint16 _royaltyPortion) returns() func (_SystemPromptManager *SystemPromptManagerTransactor) UpdateRoyaltyPortion(opts *bind.TransactOpts, _royaltyPortion uint16) (*types.Transaction, error) { return _SystemPromptManager.contract.Transact(opts, "updateRoyaltyPortion", _royaltyPortion) } // UpdateRoyaltyPortion is a paid mutator transaction binding the contract method 0x19e93993. // // Solidity: function updateRoyaltyPortion(uint16 _royaltyPortion) returns() func (_SystemPromptManager *SystemPromptManagerSession) UpdateRoyaltyPortion(_royaltyPortion uint16) (*types.Transaction, error) { return _SystemPromptManager.Contract.UpdateRoyaltyPortion(&_SystemPromptManager.TransactOpts, _royaltyPortion) } // UpdateRoyaltyPortion is a paid mutator transaction binding the contract method 0x19e93993. // // Solidity: function updateRoyaltyPortion(uint16 _royaltyPortion) returns() func (_SystemPromptManager *SystemPromptManagerTransactorSession) UpdateRoyaltyPortion(_royaltyPortion uint16) (*types.Transaction, error) { return _SystemPromptManager.Contract.UpdateRoyaltyPortion(&_SystemPromptManager.TransactOpts, _royaltyPortion) } // UpdateRoyaltyReceiver is a paid mutator transaction binding the contract method 0x29dc4d9b. // // Solidity: function updateRoyaltyReceiver(address _royaltyReceiver) returns() func (_SystemPromptManager *SystemPromptManagerTransactor) UpdateRoyaltyReceiver(opts *bind.TransactOpts, _royaltyReceiver common.Address) (*types.Transaction, error) { return _SystemPromptManager.contract.Transact(opts, "updateRoyaltyReceiver", _royaltyReceiver) } // UpdateRoyaltyReceiver is a paid mutator transaction binding the contract method 0x29dc4d9b. // // Solidity: function updateRoyaltyReceiver(address _royaltyReceiver) returns() func (_SystemPromptManager *SystemPromptManagerSession) UpdateRoyaltyReceiver(_royaltyReceiver common.Address) (*types.Transaction, error) { return _SystemPromptManager.Contract.UpdateRoyaltyReceiver(&_SystemPromptManager.TransactOpts, _royaltyReceiver) } // UpdateRoyaltyReceiver is a paid mutator transaction binding the contract method 0x29dc4d9b. // // Solidity: function updateRoyaltyReceiver(address _royaltyReceiver) returns() func (_SystemPromptManager *SystemPromptManagerTransactorSession) UpdateRoyaltyReceiver(_royaltyReceiver common.Address) (*types.Transaction, error) { return _SystemPromptManager.Contract.UpdateRoyaltyReceiver(&_SystemPromptManager.TransactOpts, _royaltyReceiver) } // Withdraw is a paid mutator transaction binding the contract method 0xf3fef3a3. // // Solidity: function withdraw(address _to, uint256 _value) returns() func (_SystemPromptManager *SystemPromptManagerTransactor) Withdraw(opts *bind.TransactOpts, _to common.Address, _value *big.Int) (*types.Transaction, error) { return _SystemPromptManager.contract.Transact(opts, "withdraw", _to, _value) } // Withdraw is a paid mutator transaction binding the contract method 0xf3fef3a3. // // Solidity: function withdraw(address _to, uint256 _value) returns() func (_SystemPromptManager *SystemPromptManagerSession) Withdraw(_to common.Address, _value *big.Int) (*types.Transaction, error) { return _SystemPromptManager.Contract.Withdraw(&_SystemPromptManager.TransactOpts, _to, _value) } // Withdraw is a paid mutator transaction binding the contract method 0xf3fef3a3. // // Solidity: function withdraw(address _to, uint256 _value) returns() func (_SystemPromptManager *SystemPromptManagerTransactorSession) Withdraw(_to common.Address, _value *big.Int) (*types.Transaction, error) { return _SystemPromptManager.Contract.Withdraw(&_SystemPromptManager.TransactOpts, _to, _value) } // Receive is a paid mutator transaction binding the contract receive function. // // Solidity: receive() payable returns() func (_SystemPromptManager *SystemPromptManagerTransactor) Receive(opts *bind.TransactOpts) (*types.Transaction, error) { return _SystemPromptManager.contract.RawTransact(opts, nil) // calldata is disallowed for receive function } // Receive is a paid mutator transaction binding the contract receive function. // // Solidity: receive() payable returns() func (_SystemPromptManager *SystemPromptManagerSession) Receive() (*types.Transaction, error) { return _SystemPromptManager.Contract.Receive(&_SystemPromptManager.TransactOpts) } // Receive is a paid mutator transaction binding the contract receive function. // // Solidity: receive() payable returns() func (_SystemPromptManager *SystemPromptManagerTransactorSession) Receive() (*types.Transaction, error) { return _SystemPromptManager.Contract.Receive(&_SystemPromptManager.TransactOpts) } // SystemPromptManagerAgentDataAddNewIterator is returned from FilterAgentDataAddNew and is used to iterate over the raw logs and unpacked data for AgentDataAddNew events raised by the SystemPromptManager contract. type SystemPromptManagerAgentDataAddNewIterator struct { Event *SystemPromptManagerAgentDataAddNew // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *SystemPromptManagerAgentDataAddNewIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(SystemPromptManagerAgentDataAddNew) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(SystemPromptManagerAgentDataAddNew) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *SystemPromptManagerAgentDataAddNewIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *SystemPromptManagerAgentDataAddNewIterator) Close() error { it.sub.Unsubscribe() return nil } // SystemPromptManagerAgentDataAddNew represents a AgentDataAddNew event raised by the SystemPromptManager contract. type SystemPromptManagerAgentDataAddNew struct { AgentId *big.Int SysPrompt [][]byte Raw types.Log // Blockchain specific contextual infos } // FilterAgentDataAddNew is a free log retrieval operation binding the contract event 0xdebec4c58e3b7c5817893e50cb1f9e65b65978e8c89bb4407eb0109d5887b258. // // Solidity: event AgentDataAddNew(uint256 indexed agentId, bytes[] sysPrompt) func (_SystemPromptManager *SystemPromptManagerFilterer) FilterAgentDataAddNew(opts *bind.FilterOpts, agentId []*big.Int) (*SystemPromptManagerAgentDataAddNewIterator, error) { var agentIdRule []interface{} for _, agentIdItem := range agentId { agentIdRule = append(agentIdRule, agentIdItem) } logs, sub, err := _SystemPromptManager.contract.FilterLogs(opts, "AgentDataAddNew", agentIdRule) if err != nil { return nil, err } return &SystemPromptManagerAgentDataAddNewIterator{contract: _SystemPromptManager.contract, event: "AgentDataAddNew", logs: logs, sub: sub}, nil } // WatchAgentDataAddNew is a free log subscription operation binding the contract event 0xdebec4c58e3b7c5817893e50cb1f9e65b65978e8c89bb4407eb0109d5887b258. // // Solidity: event AgentDataAddNew(uint256 indexed agentId, bytes[] sysPrompt) func (_SystemPromptManager *SystemPromptManagerFilterer) WatchAgentDataAddNew(opts *bind.WatchOpts, sink chan<- *SystemPromptManagerAgentDataAddNew, agentId []*big.Int) (event.Subscription, error) { var agentIdRule []interface{} for _, agentIdItem := range agentId { agentIdRule = append(agentIdRule, agentIdItem) } logs, sub, err := _SystemPromptManager.contract.WatchLogs(opts, "AgentDataAddNew", agentIdRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(SystemPromptManagerAgentDataAddNew) if err := _SystemPromptManager.contract.UnpackLog(event, "AgentDataAddNew", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseAgentDataAddNew is a log parse operation binding the contract event 0xdebec4c58e3b7c5817893e50cb1f9e65b65978e8c89bb4407eb0109d5887b258. // // Solidity: event AgentDataAddNew(uint256 indexed agentId, bytes[] sysPrompt) func (_SystemPromptManager *SystemPromptManagerFilterer) ParseAgentDataAddNew(log types.Log) (*SystemPromptManagerAgentDataAddNew, error) { event := new(SystemPromptManagerAgentDataAddNew) if err := _SystemPromptManager.contract.UnpackLog(event, "AgentDataAddNew", log); err != nil { return nil, err } event.Raw = log return event, nil } // SystemPromptManagerAgentDataUpdateIterator is returned from FilterAgentDataUpdate and is used to iterate over the raw logs and unpacked data for AgentDataUpdate events raised by the SystemPromptManager contract. type SystemPromptManagerAgentDataUpdateIterator struct { Event *SystemPromptManagerAgentDataUpdate // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *SystemPromptManagerAgentDataUpdateIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(SystemPromptManagerAgentDataUpdate) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(SystemPromptManagerAgentDataUpdate) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *SystemPromptManagerAgentDataUpdateIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *SystemPromptManagerAgentDataUpdateIterator) Close() error { it.sub.Unsubscribe() return nil } // SystemPromptManagerAgentDataUpdate represents a AgentDataUpdate event raised by the SystemPromptManager contract. type SystemPromptManagerAgentDataUpdate struct { AgentId *big.Int PromptIndex *big.Int OldSysPrompt []byte NewSysPrompt []byte Raw types.Log // Blockchain specific contextual infos } // FilterAgentDataUpdate is a free log retrieval operation binding the contract event 0xe42abf7d4a793286da8cc1399cb577a1f5a0e133dfee371bb3a5abbdd77b011e. // // Solidity: event AgentDataUpdate(uint256 indexed agentId, uint256 promptIndex, bytes oldSysPrompt, bytes newSysPrompt) func (_SystemPromptManager *SystemPromptManagerFilterer) FilterAgentDataUpdate(opts *bind.FilterOpts, agentId []*big.Int) (*SystemPromptManagerAgentDataUpdateIterator, error) { var agentIdRule []interface{} for _, agentIdItem := range agentId { agentIdRule = append(agentIdRule, agentIdItem) } logs, sub, err := _SystemPromptManager.contract.FilterLogs(opts, "AgentDataUpdate", agentIdRule) if err != nil { return nil, err } return &SystemPromptManagerAgentDataUpdateIterator{contract: _SystemPromptManager.contract, event: "AgentDataUpdate", logs: logs, sub: sub}, nil } // WatchAgentDataUpdate is a free log subscription operation binding the contract event 0xe42abf7d4a793286da8cc1399cb577a1f5a0e133dfee371bb3a5abbdd77b011e. // // Solidity: event AgentDataUpdate(uint256 indexed agentId, uint256 promptIndex, bytes oldSysPrompt, bytes newSysPrompt) func (_SystemPromptManager *SystemPromptManagerFilterer) WatchAgentDataUpdate(opts *bind.WatchOpts, sink chan<- *SystemPromptManagerAgentDataUpdate, agentId []*big.Int) (event.Subscription, error) { var agentIdRule []interface{} for _, agentIdItem := range agentId { agentIdRule = append(agentIdRule, agentIdItem) } logs, sub, err := _SystemPromptManager.contract.WatchLogs(opts, "AgentDataUpdate", agentIdRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(SystemPromptManagerAgentDataUpdate) if err := _SystemPromptManager.contract.UnpackLog(event, "AgentDataUpdate", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseAgentDataUpdate is a log parse operation binding the contract event 0xe42abf7d4a793286da8cc1399cb577a1f5a0e133dfee371bb3a5abbdd77b011e. // // Solidity: event AgentDataUpdate(uint256 indexed agentId, uint256 promptIndex, bytes oldSysPrompt, bytes newSysPrompt) func (_SystemPromptManager *SystemPromptManagerFilterer) ParseAgentDataUpdate(log types.Log) (*SystemPromptManagerAgentDataUpdate, error) { event := new(SystemPromptManagerAgentDataUpdate) if err := _SystemPromptManager.contract.UnpackLog(event, "AgentDataUpdate", log); err != nil { return nil, err } event.Raw = log return event, nil } // SystemPromptManagerAgentFeeUpdateIterator is returned from FilterAgentFeeUpdate and is used to iterate over the raw logs and unpacked data for AgentFeeUpdate events raised by the SystemPromptManager contract. type SystemPromptManagerAgentFeeUpdateIterator struct { Event *SystemPromptManagerAgentFeeUpdate // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *SystemPromptManagerAgentFeeUpdateIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(SystemPromptManagerAgentFeeUpdate) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(SystemPromptManagerAgentFeeUpdate) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *SystemPromptManagerAgentFeeUpdateIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *SystemPromptManagerAgentFeeUpdateIterator) Close() error { it.sub.Unsubscribe() return nil } // SystemPromptManagerAgentFeeUpdate represents a AgentFeeUpdate event raised by the SystemPromptManager contract. type SystemPromptManagerAgentFeeUpdate struct { AgentId *big.Int Fee *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterAgentFeeUpdate is a free log retrieval operation binding the contract event 0xa08d8197034aee8915921dd8aa7d95cf711690dd77f0b676dded49b3f9a632d1. // // Solidity: event AgentFeeUpdate(uint256 indexed agentId, uint256 fee) func (_SystemPromptManager *SystemPromptManagerFilterer) FilterAgentFeeUpdate(opts *bind.FilterOpts, agentId []*big.Int) (*SystemPromptManagerAgentFeeUpdateIterator, error) { var agentIdRule []interface{} for _, agentIdItem := range agentId { agentIdRule = append(agentIdRule, agentIdItem) } logs, sub, err := _SystemPromptManager.contract.FilterLogs(opts, "AgentFeeUpdate", agentIdRule) if err != nil { return nil, err } return &SystemPromptManagerAgentFeeUpdateIterator{contract: _SystemPromptManager.contract, event: "AgentFeeUpdate", logs: logs, sub: sub}, nil } // WatchAgentFeeUpdate is a free log subscription operation binding the contract event 0xa08d8197034aee8915921dd8aa7d95cf711690dd77f0b676dded49b3f9a632d1. // // Solidity: event AgentFeeUpdate(uint256 indexed agentId, uint256 fee) func (_SystemPromptManager *SystemPromptManagerFilterer) WatchAgentFeeUpdate(opts *bind.WatchOpts, sink chan<- *SystemPromptManagerAgentFeeUpdate, agentId []*big.Int) (event.Subscription, error) { var agentIdRule []interface{} for _, agentIdItem := range agentId { agentIdRule = append(agentIdRule, agentIdItem) } logs, sub, err := _SystemPromptManager.contract.WatchLogs(opts, "AgentFeeUpdate", agentIdRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(SystemPromptManagerAgentFeeUpdate) if err := _SystemPromptManager.contract.UnpackLog(event, "AgentFeeUpdate", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseAgentFeeUpdate is a log parse operation binding the contract event 0xa08d8197034aee8915921dd8aa7d95cf711690dd77f0b676dded49b3f9a632d1. // // Solidity: event AgentFeeUpdate(uint256 indexed agentId, uint256 fee) func (_SystemPromptManager *SystemPromptManagerFilterer) ParseAgentFeeUpdate(log types.Log) (*SystemPromptManagerAgentFeeUpdate, error) { event := new(SystemPromptManagerAgentFeeUpdate) if err := _SystemPromptManager.contract.UnpackLog(event, "AgentFeeUpdate", log); err != nil { return nil, err } event.Raw = log return event, nil } // SystemPromptManagerAgentURIUpdateIterator is returned from FilterAgentURIUpdate and is used to iterate over the raw logs and unpacked data for AgentURIUpdate events raised by the SystemPromptManager contract. type SystemPromptManagerAgentURIUpdateIterator struct { Event *SystemPromptManagerAgentURIUpdate // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *SystemPromptManagerAgentURIUpdateIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(SystemPromptManagerAgentURIUpdate) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(SystemPromptManagerAgentURIUpdate) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *SystemPromptManagerAgentURIUpdateIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *SystemPromptManagerAgentURIUpdateIterator) Close() error { it.sub.Unsubscribe() return nil } // SystemPromptManagerAgentURIUpdate represents a AgentURIUpdate event raised by the SystemPromptManager contract. type SystemPromptManagerAgentURIUpdate struct { AgentId *big.Int Uri string Raw types.Log // Blockchain specific contextual infos } // FilterAgentURIUpdate is a free log retrieval operation binding the contract event 0x706a4e8eb2f354c7f4d96e5ea1984f36e72482629987edad78c9940ea037c362. // // Solidity: event AgentURIUpdate(uint256 indexed agentId, string uri) func (_SystemPromptManager *SystemPromptManagerFilterer) FilterAgentURIUpdate(opts *bind.FilterOpts, agentId []*big.Int) (*SystemPromptManagerAgentURIUpdateIterator, error) { var agentIdRule []interface{} for _, agentIdItem := range agentId { agentIdRule = append(agentIdRule, agentIdItem) } logs, sub, err := _SystemPromptManager.contract.FilterLogs(opts, "AgentURIUpdate", agentIdRule) if err != nil { return nil, err } return &SystemPromptManagerAgentURIUpdateIterator{contract: _SystemPromptManager.contract, event: "AgentURIUpdate", logs: logs, sub: sub}, nil } // WatchAgentURIUpdate is a free log subscription operation binding the contract event 0x706a4e8eb2f354c7f4d96e5ea1984f36e72482629987edad78c9940ea037c362. // // Solidity: event AgentURIUpdate(uint256 indexed agentId, string uri) func (_SystemPromptManager *SystemPromptManagerFilterer) WatchAgentURIUpdate(opts *bind.WatchOpts, sink chan<- *SystemPromptManagerAgentURIUpdate, agentId []*big.Int) (event.Subscription, error) { var agentIdRule []interface{} for _, agentIdItem := range agentId { agentIdRule = append(agentIdRule, agentIdItem) } logs, sub, err := _SystemPromptManager.contract.WatchLogs(opts, "AgentURIUpdate", agentIdRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(SystemPromptManagerAgentURIUpdate) if err := _SystemPromptManager.contract.UnpackLog(event, "AgentURIUpdate", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseAgentURIUpdate is a log parse operation binding the contract event 0x706a4e8eb2f354c7f4d96e5ea1984f36e72482629987edad78c9940ea037c362. // // Solidity: event AgentURIUpdate(uint256 indexed agentId, string uri) func (_SystemPromptManager *SystemPromptManagerFilterer) ParseAgentURIUpdate(log types.Log) (*SystemPromptManagerAgentURIUpdate, error) { event := new(SystemPromptManagerAgentURIUpdate) if err := _SystemPromptManager.contract.UnpackLog(event, "AgentURIUpdate", log); err != nil { return nil, err } event.Raw = log return event, nil } // SystemPromptManagerApprovalIterator is returned from FilterApproval and is used to iterate over the raw logs and unpacked data for Approval events raised by the SystemPromptManager contract. type SystemPromptManagerApprovalIterator struct { Event *SystemPromptManagerApproval // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *SystemPromptManagerApprovalIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(SystemPromptManagerApproval) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(SystemPromptManagerApproval) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *SystemPromptManagerApprovalIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *SystemPromptManagerApprovalIterator) Close() error { it.sub.Unsubscribe() return nil } // SystemPromptManagerApproval represents a Approval event raised by the SystemPromptManager contract. type SystemPromptManagerApproval struct { Owner common.Address Approved common.Address TokenId *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterApproval is a free log retrieval operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. // // Solidity: event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId) func (_SystemPromptManager *SystemPromptManagerFilterer) FilterApproval(opts *bind.FilterOpts, owner []common.Address, approved []common.Address, tokenId []*big.Int) (*SystemPromptManagerApprovalIterator, error) { var ownerRule []interface{} for _, ownerItem := range owner { ownerRule = append(ownerRule, ownerItem) } var approvedRule []interface{} for _, approvedItem := range approved { approvedRule = append(approvedRule, approvedItem) } var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _SystemPromptManager.contract.FilterLogs(opts, "Approval", ownerRule, approvedRule, tokenIdRule) if err != nil { return nil, err } return &SystemPromptManagerApprovalIterator{contract: _SystemPromptManager.contract, event: "Approval", logs: logs, sub: sub}, nil } // WatchApproval is a free log subscription operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. // // Solidity: event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId) func (_SystemPromptManager *SystemPromptManagerFilterer) WatchApproval(opts *bind.WatchOpts, sink chan<- *SystemPromptManagerApproval, owner []common.Address, approved []common.Address, tokenId []*big.Int) (event.Subscription, error) { var ownerRule []interface{} for _, ownerItem := range owner { ownerRule = append(ownerRule, ownerItem) } var approvedRule []interface{} for _, approvedItem := range approved { approvedRule = append(approvedRule, approvedItem) } var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _SystemPromptManager.contract.WatchLogs(opts, "Approval", ownerRule, approvedRule, tokenIdRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(SystemPromptManagerApproval) if err := _SystemPromptManager.contract.UnpackLog(event, "Approval", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseApproval is a log parse operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. // // Solidity: event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId) func (_SystemPromptManager *SystemPromptManagerFilterer) ParseApproval(log types.Log) (*SystemPromptManagerApproval, error) { event := new(SystemPromptManagerApproval) if err := _SystemPromptManager.contract.UnpackLog(event, "Approval", log); err != nil { return nil, err } event.Raw = log return event, nil } // SystemPromptManagerApprovalForAllIterator is returned from FilterApprovalForAll and is used to iterate over the raw logs and unpacked data for ApprovalForAll events raised by the SystemPromptManager contract. type SystemPromptManagerApprovalForAllIterator struct { Event *SystemPromptManagerApprovalForAll // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *SystemPromptManagerApprovalForAllIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(SystemPromptManagerApprovalForAll) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(SystemPromptManagerApprovalForAll) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *SystemPromptManagerApprovalForAllIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *SystemPromptManagerApprovalForAllIterator) Close() error { it.sub.Unsubscribe() return nil } // SystemPromptManagerApprovalForAll represents a ApprovalForAll event raised by the SystemPromptManager contract. type SystemPromptManagerApprovalForAll struct { Owner common.Address Operator common.Address Approved bool Raw types.Log // Blockchain specific contextual infos } // FilterApprovalForAll is a free log retrieval operation binding the contract event 0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31. // // Solidity: event ApprovalForAll(address indexed owner, address indexed operator, bool approved) func (_SystemPromptManager *SystemPromptManagerFilterer) FilterApprovalForAll(opts *bind.FilterOpts, owner []common.Address, operator []common.Address) (*SystemPromptManagerApprovalForAllIterator, error) { var ownerRule []interface{} for _, ownerItem := range owner { ownerRule = append(ownerRule, ownerItem) } var operatorRule []interface{} for _, operatorItem := range operator { operatorRule = append(operatorRule, operatorItem) } logs, sub, err := _SystemPromptManager.contract.FilterLogs(opts, "ApprovalForAll", ownerRule, operatorRule) if err != nil { return nil, err } return &SystemPromptManagerApprovalForAllIterator{contract: _SystemPromptManager.contract, event: "ApprovalForAll", logs: logs, sub: sub}, nil } // WatchApprovalForAll is a free log subscription operation binding the contract event 0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31. // // Solidity: event ApprovalForAll(address indexed owner, address indexed operator, bool approved) func (_SystemPromptManager *SystemPromptManagerFilterer) WatchApprovalForAll(opts *bind.WatchOpts, sink chan<- *SystemPromptManagerApprovalForAll, owner []common.Address, operator []common.Address) (event.Subscription, error) { var ownerRule []interface{} for _, ownerItem := range owner { ownerRule = append(ownerRule, ownerItem) } var operatorRule []interface{} for _, operatorItem := range operator { operatorRule = append(operatorRule, operatorItem) } logs, sub, err := _SystemPromptManager.contract.WatchLogs(opts, "ApprovalForAll", ownerRule, operatorRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(SystemPromptManagerApprovalForAll) if err := _SystemPromptManager.contract.UnpackLog(event, "ApprovalForAll", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseApprovalForAll is a log parse operation binding the contract event 0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31. // // Solidity: event ApprovalForAll(address indexed owner, address indexed operator, bool approved) func (_SystemPromptManager *SystemPromptManagerFilterer) ParseApprovalForAll(log types.Log) (*SystemPromptManagerApprovalForAll, error) { event := new(SystemPromptManagerApprovalForAll) if err := _SystemPromptManager.contract.UnpackLog(event, "ApprovalForAll", log); err != nil { return nil, err } event.Raw = log return event, nil } // SystemPromptManagerBatchMetadataUpdateIterator is returned from FilterBatchMetadataUpdate and is used to iterate over the raw logs and unpacked data for BatchMetadataUpdate events raised by the SystemPromptManager contract. type SystemPromptManagerBatchMetadataUpdateIterator struct { Event *SystemPromptManagerBatchMetadataUpdate // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *SystemPromptManagerBatchMetadataUpdateIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(SystemPromptManagerBatchMetadataUpdate) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(SystemPromptManagerBatchMetadataUpdate) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *SystemPromptManagerBatchMetadataUpdateIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *SystemPromptManagerBatchMetadataUpdateIterator) Close() error { it.sub.Unsubscribe() return nil } // SystemPromptManagerBatchMetadataUpdate represents a BatchMetadataUpdate event raised by the SystemPromptManager contract. type SystemPromptManagerBatchMetadataUpdate struct { FromTokenId *big.Int ToTokenId *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterBatchMetadataUpdate is a free log retrieval operation binding the contract event 0x6bd5c950a8d8df17f772f5af37cb3655737899cbf903264b9795592da439661c. // // Solidity: event BatchMetadataUpdate(uint256 _fromTokenId, uint256 _toTokenId) func (_SystemPromptManager *SystemPromptManagerFilterer) FilterBatchMetadataUpdate(opts *bind.FilterOpts) (*SystemPromptManagerBatchMetadataUpdateIterator, error) { logs, sub, err := _SystemPromptManager.contract.FilterLogs(opts, "BatchMetadataUpdate") if err != nil { return nil, err } return &SystemPromptManagerBatchMetadataUpdateIterator{contract: _SystemPromptManager.contract, event: "BatchMetadataUpdate", logs: logs, sub: sub}, nil } // WatchBatchMetadataUpdate is a free log subscription operation binding the contract event 0x6bd5c950a8d8df17f772f5af37cb3655737899cbf903264b9795592da439661c. // // Solidity: event BatchMetadataUpdate(uint256 _fromTokenId, uint256 _toTokenId) func (_SystemPromptManager *SystemPromptManagerFilterer) WatchBatchMetadataUpdate(opts *bind.WatchOpts, sink chan<- *SystemPromptManagerBatchMetadataUpdate) (event.Subscription, error) { logs, sub, err := _SystemPromptManager.contract.WatchLogs(opts, "BatchMetadataUpdate") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(SystemPromptManagerBatchMetadataUpdate) if err := _SystemPromptManager.contract.UnpackLog(event, "BatchMetadataUpdate", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseBatchMetadataUpdate is a log parse operation binding the contract event 0x6bd5c950a8d8df17f772f5af37cb3655737899cbf903264b9795592da439661c. // // Solidity: event BatchMetadataUpdate(uint256 _fromTokenId, uint256 _toTokenId) func (_SystemPromptManager *SystemPromptManagerFilterer) ParseBatchMetadataUpdate(log types.Log) (*SystemPromptManagerBatchMetadataUpdate, error) { event := new(SystemPromptManagerBatchMetadataUpdate) if err := _SystemPromptManager.contract.UnpackLog(event, "BatchMetadataUpdate", log); err != nil { return nil, err } event.Raw = log return event, nil } // SystemPromptManagerEIP712DomainChangedIterator is returned from FilterEIP712DomainChanged and is used to iterate over the raw logs and unpacked data for EIP712DomainChanged events raised by the SystemPromptManager contract. type SystemPromptManagerEIP712DomainChangedIterator struct { Event *SystemPromptManagerEIP712DomainChanged // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *SystemPromptManagerEIP712DomainChangedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(SystemPromptManagerEIP712DomainChanged) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(SystemPromptManagerEIP712DomainChanged) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *SystemPromptManagerEIP712DomainChangedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *SystemPromptManagerEIP712DomainChangedIterator) Close() error { it.sub.Unsubscribe() return nil } // SystemPromptManagerEIP712DomainChanged represents a EIP712DomainChanged event raised by the SystemPromptManager contract. type SystemPromptManagerEIP712DomainChanged struct { Raw types.Log // Blockchain specific contextual infos } // FilterEIP712DomainChanged is a free log retrieval operation binding the contract event 0x0a6387c9ea3628b88a633bb4f3b151770f70085117a15f9bf3787cda53f13d31. // // Solidity: event EIP712DomainChanged() func (_SystemPromptManager *SystemPromptManagerFilterer) FilterEIP712DomainChanged(opts *bind.FilterOpts) (*SystemPromptManagerEIP712DomainChangedIterator, error) { logs, sub, err := _SystemPromptManager.contract.FilterLogs(opts, "EIP712DomainChanged") if err != nil { return nil, err } return &SystemPromptManagerEIP712DomainChangedIterator{contract: _SystemPromptManager.contract, event: "EIP712DomainChanged", logs: logs, sub: sub}, nil } // WatchEIP712DomainChanged is a free log subscription operation binding the contract event 0x0a6387c9ea3628b88a633bb4f3b151770f70085117a15f9bf3787cda53f13d31. // // Solidity: event EIP712DomainChanged() func (_SystemPromptManager *SystemPromptManagerFilterer) WatchEIP712DomainChanged(opts *bind.WatchOpts, sink chan<- *SystemPromptManagerEIP712DomainChanged) (event.Subscription, error) { logs, sub, err := _SystemPromptManager.contract.WatchLogs(opts, "EIP712DomainChanged") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(SystemPromptManagerEIP712DomainChanged) if err := _SystemPromptManager.contract.UnpackLog(event, "EIP712DomainChanged", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseEIP712DomainChanged is a log parse operation binding the contract event 0x0a6387c9ea3628b88a633bb4f3b151770f70085117a15f9bf3787cda53f13d31. // // Solidity: event EIP712DomainChanged() func (_SystemPromptManager *SystemPromptManagerFilterer) ParseEIP712DomainChanged(log types.Log) (*SystemPromptManagerEIP712DomainChanged, error) { event := new(SystemPromptManagerEIP712DomainChanged) if err := _SystemPromptManager.contract.UnpackLog(event, "EIP712DomainChanged", log); err != nil { return nil, err } event.Raw = log return event, nil } // SystemPromptManagerFeesClaimedIterator is returned from FilterFeesClaimed and is used to iterate over the raw logs and unpacked data for FeesClaimed events raised by the SystemPromptManager contract. type SystemPromptManagerFeesClaimedIterator struct { Event *SystemPromptManagerFeesClaimed // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *SystemPromptManagerFeesClaimedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(SystemPromptManagerFeesClaimed) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(SystemPromptManagerFeesClaimed) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *SystemPromptManagerFeesClaimedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *SystemPromptManagerFeesClaimedIterator) Close() error { it.sub.Unsubscribe() return nil } // SystemPromptManagerFeesClaimed represents a FeesClaimed event raised by the SystemPromptManager contract. type SystemPromptManagerFeesClaimed struct { Claimer common.Address Amount *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterFeesClaimed is a free log retrieval operation binding the contract event 0x9493e5bbe4e8e0ac67284469a2d677403d0378a85a59e341d3abc433d0d9a209. // // Solidity: event FeesClaimed(address indexed claimer, uint256 amount) func (_SystemPromptManager *SystemPromptManagerFilterer) FilterFeesClaimed(opts *bind.FilterOpts, claimer []common.Address) (*SystemPromptManagerFeesClaimedIterator, error) { var claimerRule []interface{} for _, claimerItem := range claimer { claimerRule = append(claimerRule, claimerItem) } logs, sub, err := _SystemPromptManager.contract.FilterLogs(opts, "FeesClaimed", claimerRule) if err != nil { return nil, err } return &SystemPromptManagerFeesClaimedIterator{contract: _SystemPromptManager.contract, event: "FeesClaimed", logs: logs, sub: sub}, nil } // WatchFeesClaimed is a free log subscription operation binding the contract event 0x9493e5bbe4e8e0ac67284469a2d677403d0378a85a59e341d3abc433d0d9a209. // // Solidity: event FeesClaimed(address indexed claimer, uint256 amount) func (_SystemPromptManager *SystemPromptManagerFilterer) WatchFeesClaimed(opts *bind.WatchOpts, sink chan<- *SystemPromptManagerFeesClaimed, claimer []common.Address) (event.Subscription, error) { var claimerRule []interface{} for _, claimerItem := range claimer { claimerRule = append(claimerRule, claimerItem) } logs, sub, err := _SystemPromptManager.contract.WatchLogs(opts, "FeesClaimed", claimerRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(SystemPromptManagerFeesClaimed) if err := _SystemPromptManager.contract.UnpackLog(event, "FeesClaimed", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseFeesClaimed is a log parse operation binding the contract event 0x9493e5bbe4e8e0ac67284469a2d677403d0378a85a59e341d3abc433d0d9a209. // // Solidity: event FeesClaimed(address indexed claimer, uint256 amount) func (_SystemPromptManager *SystemPromptManagerFilterer) ParseFeesClaimed(log types.Log) (*SystemPromptManagerFeesClaimed, error) { event := new(SystemPromptManagerFeesClaimed) if err := _SystemPromptManager.contract.UnpackLog(event, "FeesClaimed", log); err != nil { return nil, err } event.Raw = log return event, nil } // SystemPromptManagerInferencePerformedIterator is returned from FilterInferencePerformed and is used to iterate over the raw logs and unpacked data for InferencePerformed events raised by the SystemPromptManager contract. type SystemPromptManagerInferencePerformedIterator struct { Event *SystemPromptManagerInferencePerformed // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *SystemPromptManagerInferencePerformedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(SystemPromptManagerInferencePerformed) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(SystemPromptManagerInferencePerformed) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *SystemPromptManagerInferencePerformedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *SystemPromptManagerInferencePerformedIterator) Close() error { it.sub.Unsubscribe() return nil } // SystemPromptManagerInferencePerformed represents a InferencePerformed event raised by the SystemPromptManager contract. type SystemPromptManagerInferencePerformed struct { TokenId *big.Int Caller common.Address Data []byte Fee *big.Int ExternalData string InferenceId *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterInferencePerformed is a free log retrieval operation binding the contract event 0xcf35460eca25a0549d5eb14c712236d61c9a0bad90c834f996c5f2a98d332719. // // Solidity: event InferencePerformed(uint256 indexed tokenId, address indexed caller, bytes data, uint256 fee, string externalData, uint256 inferenceId) func (_SystemPromptManager *SystemPromptManagerFilterer) FilterInferencePerformed(opts *bind.FilterOpts, tokenId []*big.Int, caller []common.Address) (*SystemPromptManagerInferencePerformedIterator, error) { var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } var callerRule []interface{} for _, callerItem := range caller { callerRule = append(callerRule, callerItem) } logs, sub, err := _SystemPromptManager.contract.FilterLogs(opts, "InferencePerformed", tokenIdRule, callerRule) if err != nil { return nil, err } return &SystemPromptManagerInferencePerformedIterator{contract: _SystemPromptManager.contract, event: "InferencePerformed", logs: logs, sub: sub}, nil } // WatchInferencePerformed is a free log subscription operation binding the contract event 0xcf35460eca25a0549d5eb14c712236d61c9a0bad90c834f996c5f2a98d332719. // // Solidity: event InferencePerformed(uint256 indexed tokenId, address indexed caller, bytes data, uint256 fee, string externalData, uint256 inferenceId) func (_SystemPromptManager *SystemPromptManagerFilterer) WatchInferencePerformed(opts *bind.WatchOpts, sink chan<- *SystemPromptManagerInferencePerformed, tokenId []*big.Int, caller []common.Address) (event.Subscription, error) { var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } var callerRule []interface{} for _, callerItem := range caller { callerRule = append(callerRule, callerItem) } logs, sub, err := _SystemPromptManager.contract.WatchLogs(opts, "InferencePerformed", tokenIdRule, callerRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(SystemPromptManagerInferencePerformed) if err := _SystemPromptManager.contract.UnpackLog(event, "InferencePerformed", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseInferencePerformed is a log parse operation binding the contract event 0xcf35460eca25a0549d5eb14c712236d61c9a0bad90c834f996c5f2a98d332719. // // Solidity: event InferencePerformed(uint256 indexed tokenId, address indexed caller, bytes data, uint256 fee, string externalData, uint256 inferenceId) func (_SystemPromptManager *SystemPromptManagerFilterer) ParseInferencePerformed(log types.Log) (*SystemPromptManagerInferencePerformed, error) { event := new(SystemPromptManagerInferencePerformed) if err := _SystemPromptManager.contract.UnpackLog(event, "InferencePerformed", log); err != nil { return nil, err } event.Raw = log return event, nil } // SystemPromptManagerInitializedIterator is returned from FilterInitialized and is used to iterate over the raw logs and unpacked data for Initialized events raised by the SystemPromptManager contract. type SystemPromptManagerInitializedIterator struct { Event *SystemPromptManagerInitialized // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *SystemPromptManagerInitializedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(SystemPromptManagerInitialized) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(SystemPromptManagerInitialized) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *SystemPromptManagerInitializedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *SystemPromptManagerInitializedIterator) Close() error { it.sub.Unsubscribe() return nil } // SystemPromptManagerInitialized represents a Initialized event raised by the SystemPromptManager contract. type SystemPromptManagerInitialized struct { Version uint8 Raw types.Log // Blockchain specific contextual infos } // FilterInitialized is a free log retrieval operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. // // Solidity: event Initialized(uint8 version) func (_SystemPromptManager *SystemPromptManagerFilterer) FilterInitialized(opts *bind.FilterOpts) (*SystemPromptManagerInitializedIterator, error) { logs, sub, err := _SystemPromptManager.contract.FilterLogs(opts, "Initialized") if err != nil { return nil, err } return &SystemPromptManagerInitializedIterator{contract: _SystemPromptManager.contract, event: "Initialized", logs: logs, sub: sub}, nil } // WatchInitialized is a free log subscription operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. // // Solidity: event Initialized(uint8 version) func (_SystemPromptManager *SystemPromptManagerFilterer) WatchInitialized(opts *bind.WatchOpts, sink chan<- *SystemPromptManagerInitialized) (event.Subscription, error) { logs, sub, err := _SystemPromptManager.contract.WatchLogs(opts, "Initialized") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(SystemPromptManagerInitialized) if err := _SystemPromptManager.contract.UnpackLog(event, "Initialized", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseInitialized is a log parse operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. // // Solidity: event Initialized(uint8 version) func (_SystemPromptManager *SystemPromptManagerFilterer) ParseInitialized(log types.Log) (*SystemPromptManagerInitialized, error) { event := new(SystemPromptManagerInitialized) if err := _SystemPromptManager.contract.UnpackLog(event, "Initialized", log); err != nil { return nil, err } event.Raw = log return event, nil } // SystemPromptManagerManagerAuthorizationIterator is returned from FilterManagerAuthorization and is used to iterate over the raw logs and unpacked data for ManagerAuthorization events raised by the SystemPromptManager contract. type SystemPromptManagerManagerAuthorizationIterator struct { Event *SystemPromptManagerManagerAuthorization // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *SystemPromptManagerManagerAuthorizationIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(SystemPromptManagerManagerAuthorization) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(SystemPromptManagerManagerAuthorization) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *SystemPromptManagerManagerAuthorizationIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *SystemPromptManagerManagerAuthorizationIterator) Close() error { it.sub.Unsubscribe() return nil } // SystemPromptManagerManagerAuthorization represents a ManagerAuthorization event raised by the SystemPromptManager contract. type SystemPromptManagerManagerAuthorization struct { Account common.Address Raw types.Log // Blockchain specific contextual infos } // FilterManagerAuthorization is a free log retrieval operation binding the contract event 0x3fbc8e71624117c0dc0fcdbe40685681cecc7c3c43de81a686cda4b61c78e35b. // // Solidity: event ManagerAuthorization(address indexed account) func (_SystemPromptManager *SystemPromptManagerFilterer) FilterManagerAuthorization(opts *bind.FilterOpts, account []common.Address) (*SystemPromptManagerManagerAuthorizationIterator, error) { var accountRule []interface{} for _, accountItem := range account { accountRule = append(accountRule, accountItem) } logs, sub, err := _SystemPromptManager.contract.FilterLogs(opts, "ManagerAuthorization", accountRule) if err != nil { return nil, err } return &SystemPromptManagerManagerAuthorizationIterator{contract: _SystemPromptManager.contract, event: "ManagerAuthorization", logs: logs, sub: sub}, nil } // WatchManagerAuthorization is a free log subscription operation binding the contract event 0x3fbc8e71624117c0dc0fcdbe40685681cecc7c3c43de81a686cda4b61c78e35b. // // Solidity: event ManagerAuthorization(address indexed account) func (_SystemPromptManager *SystemPromptManagerFilterer) WatchManagerAuthorization(opts *bind.WatchOpts, sink chan<- *SystemPromptManagerManagerAuthorization, account []common.Address) (event.Subscription, error) { var accountRule []interface{} for _, accountItem := range account { accountRule = append(accountRule, accountItem) } logs, sub, err := _SystemPromptManager.contract.WatchLogs(opts, "ManagerAuthorization", accountRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(SystemPromptManagerManagerAuthorization) if err := _SystemPromptManager.contract.UnpackLog(event, "ManagerAuthorization", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseManagerAuthorization is a log parse operation binding the contract event 0x3fbc8e71624117c0dc0fcdbe40685681cecc7c3c43de81a686cda4b61c78e35b. // // Solidity: event ManagerAuthorization(address indexed account) func (_SystemPromptManager *SystemPromptManagerFilterer) ParseManagerAuthorization(log types.Log) (*SystemPromptManagerManagerAuthorization, error) { event := new(SystemPromptManagerManagerAuthorization) if err := _SystemPromptManager.contract.UnpackLog(event, "ManagerAuthorization", log); err != nil { return nil, err } event.Raw = log return event, nil } // SystemPromptManagerManagerDeauthorizationIterator is returned from FilterManagerDeauthorization and is used to iterate over the raw logs and unpacked data for ManagerDeauthorization events raised by the SystemPromptManager contract. type SystemPromptManagerManagerDeauthorizationIterator struct { Event *SystemPromptManagerManagerDeauthorization // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *SystemPromptManagerManagerDeauthorizationIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(SystemPromptManagerManagerDeauthorization) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(SystemPromptManagerManagerDeauthorization) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *SystemPromptManagerManagerDeauthorizationIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *SystemPromptManagerManagerDeauthorizationIterator) Close() error { it.sub.Unsubscribe() return nil } // SystemPromptManagerManagerDeauthorization represents a ManagerDeauthorization event raised by the SystemPromptManager contract. type SystemPromptManagerManagerDeauthorization struct { Account common.Address Raw types.Log // Blockchain specific contextual infos } // FilterManagerDeauthorization is a free log retrieval operation binding the contract event 0x20c29af9eb3de2601188ceae57a4075ba3593ce15d4142aef070ac53d389356c. // // Solidity: event ManagerDeauthorization(address indexed account) func (_SystemPromptManager *SystemPromptManagerFilterer) FilterManagerDeauthorization(opts *bind.FilterOpts, account []common.Address) (*SystemPromptManagerManagerDeauthorizationIterator, error) { var accountRule []interface{} for _, accountItem := range account { accountRule = append(accountRule, accountItem) } logs, sub, err := _SystemPromptManager.contract.FilterLogs(opts, "ManagerDeauthorization", accountRule) if err != nil { return nil, err } return &SystemPromptManagerManagerDeauthorizationIterator{contract: _SystemPromptManager.contract, event: "ManagerDeauthorization", logs: logs, sub: sub}, nil } // WatchManagerDeauthorization is a free log subscription operation binding the contract event 0x20c29af9eb3de2601188ceae57a4075ba3593ce15d4142aef070ac53d389356c. // // Solidity: event ManagerDeauthorization(address indexed account) func (_SystemPromptManager *SystemPromptManagerFilterer) WatchManagerDeauthorization(opts *bind.WatchOpts, sink chan<- *SystemPromptManagerManagerDeauthorization, account []common.Address) (event.Subscription, error) { var accountRule []interface{} for _, accountItem := range account { accountRule = append(accountRule, accountItem) } logs, sub, err := _SystemPromptManager.contract.WatchLogs(opts, "ManagerDeauthorization", accountRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(SystemPromptManagerManagerDeauthorization) if err := _SystemPromptManager.contract.UnpackLog(event, "ManagerDeauthorization", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseManagerDeauthorization is a log parse operation binding the contract event 0x20c29af9eb3de2601188ceae57a4075ba3593ce15d4142aef070ac53d389356c. // // Solidity: event ManagerDeauthorization(address indexed account) func (_SystemPromptManager *SystemPromptManagerFilterer) ParseManagerDeauthorization(log types.Log) (*SystemPromptManagerManagerDeauthorization, error) { event := new(SystemPromptManagerManagerDeauthorization) if err := _SystemPromptManager.contract.UnpackLog(event, "ManagerDeauthorization", log); err != nil { return nil, err } event.Raw = log return event, nil } // SystemPromptManagerMetadataUpdateIterator is returned from FilterMetadataUpdate and is used to iterate over the raw logs and unpacked data for MetadataUpdate events raised by the SystemPromptManager contract. type SystemPromptManagerMetadataUpdateIterator struct { Event *SystemPromptManagerMetadataUpdate // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *SystemPromptManagerMetadataUpdateIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(SystemPromptManagerMetadataUpdate) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(SystemPromptManagerMetadataUpdate) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *SystemPromptManagerMetadataUpdateIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *SystemPromptManagerMetadataUpdateIterator) Close() error { it.sub.Unsubscribe() return nil } // SystemPromptManagerMetadataUpdate represents a MetadataUpdate event raised by the SystemPromptManager contract. type SystemPromptManagerMetadataUpdate struct { TokenId *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterMetadataUpdate is a free log retrieval operation binding the contract event 0xf8e1a15aba9398e019f0b49df1a4fde98ee17ae345cb5f6b5e2c27f5033e8ce7. // // Solidity: event MetadataUpdate(uint256 _tokenId) func (_SystemPromptManager *SystemPromptManagerFilterer) FilterMetadataUpdate(opts *bind.FilterOpts) (*SystemPromptManagerMetadataUpdateIterator, error) { logs, sub, err := _SystemPromptManager.contract.FilterLogs(opts, "MetadataUpdate") if err != nil { return nil, err } return &SystemPromptManagerMetadataUpdateIterator{contract: _SystemPromptManager.contract, event: "MetadataUpdate", logs: logs, sub: sub}, nil } // WatchMetadataUpdate is a free log subscription operation binding the contract event 0xf8e1a15aba9398e019f0b49df1a4fde98ee17ae345cb5f6b5e2c27f5033e8ce7. // // Solidity: event MetadataUpdate(uint256 _tokenId) func (_SystemPromptManager *SystemPromptManagerFilterer) WatchMetadataUpdate(opts *bind.WatchOpts, sink chan<- *SystemPromptManagerMetadataUpdate) (event.Subscription, error) { logs, sub, err := _SystemPromptManager.contract.WatchLogs(opts, "MetadataUpdate") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(SystemPromptManagerMetadataUpdate) if err := _SystemPromptManager.contract.UnpackLog(event, "MetadataUpdate", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseMetadataUpdate is a log parse operation binding the contract event 0xf8e1a15aba9398e019f0b49df1a4fde98ee17ae345cb5f6b5e2c27f5033e8ce7. // // Solidity: event MetadataUpdate(uint256 _tokenId) func (_SystemPromptManager *SystemPromptManagerFilterer) ParseMetadataUpdate(log types.Log) (*SystemPromptManagerMetadataUpdate, error) { event := new(SystemPromptManagerMetadataUpdate) if err := _SystemPromptManager.contract.UnpackLog(event, "MetadataUpdate", log); err != nil { return nil, err } event.Raw = log return event, nil } // SystemPromptManagerMintPriceUpdateIterator is returned from FilterMintPriceUpdate and is used to iterate over the raw logs and unpacked data for MintPriceUpdate events raised by the SystemPromptManager contract. type SystemPromptManagerMintPriceUpdateIterator struct { Event *SystemPromptManagerMintPriceUpdate // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *SystemPromptManagerMintPriceUpdateIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(SystemPromptManagerMintPriceUpdate) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(SystemPromptManagerMintPriceUpdate) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *SystemPromptManagerMintPriceUpdateIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *SystemPromptManagerMintPriceUpdateIterator) Close() error { it.sub.Unsubscribe() return nil } // SystemPromptManagerMintPriceUpdate represents a MintPriceUpdate event raised by the SystemPromptManager contract. type SystemPromptManagerMintPriceUpdate struct { NewValue *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterMintPriceUpdate is a free log retrieval operation binding the contract event 0x23050b539195eebd064c1bec834445b7d028a20c345600e868a74d7ca93c5e86. // // Solidity: event MintPriceUpdate(uint256 newValue) func (_SystemPromptManager *SystemPromptManagerFilterer) FilterMintPriceUpdate(opts *bind.FilterOpts) (*SystemPromptManagerMintPriceUpdateIterator, error) { logs, sub, err := _SystemPromptManager.contract.FilterLogs(opts, "MintPriceUpdate") if err != nil { return nil, err } return &SystemPromptManagerMintPriceUpdateIterator{contract: _SystemPromptManager.contract, event: "MintPriceUpdate", logs: logs, sub: sub}, nil } // WatchMintPriceUpdate is a free log subscription operation binding the contract event 0x23050b539195eebd064c1bec834445b7d028a20c345600e868a74d7ca93c5e86. // // Solidity: event MintPriceUpdate(uint256 newValue) func (_SystemPromptManager *SystemPromptManagerFilterer) WatchMintPriceUpdate(opts *bind.WatchOpts, sink chan<- *SystemPromptManagerMintPriceUpdate) (event.Subscription, error) { logs, sub, err := _SystemPromptManager.contract.WatchLogs(opts, "MintPriceUpdate") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(SystemPromptManagerMintPriceUpdate) if err := _SystemPromptManager.contract.UnpackLog(event, "MintPriceUpdate", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseMintPriceUpdate is a log parse operation binding the contract event 0x23050b539195eebd064c1bec834445b7d028a20c345600e868a74d7ca93c5e86. // // Solidity: event MintPriceUpdate(uint256 newValue) func (_SystemPromptManager *SystemPromptManagerFilterer) ParseMintPriceUpdate(log types.Log) (*SystemPromptManagerMintPriceUpdate, error) { event := new(SystemPromptManagerMintPriceUpdate) if err := _SystemPromptManager.contract.UnpackLog(event, "MintPriceUpdate", log); err != nil { return nil, err } event.Raw = log return event, nil } // SystemPromptManagerNewTokenIterator is returned from FilterNewToken and is used to iterate over the raw logs and unpacked data for NewToken events raised by the SystemPromptManager contract. type SystemPromptManagerNewTokenIterator struct { Event *SystemPromptManagerNewToken // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *SystemPromptManagerNewTokenIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(SystemPromptManagerNewToken) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(SystemPromptManagerNewToken) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *SystemPromptManagerNewTokenIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *SystemPromptManagerNewTokenIterator) Close() error { it.sub.Unsubscribe() return nil } // SystemPromptManagerNewToken represents a NewToken event raised by the SystemPromptManager contract. type SystemPromptManagerNewToken struct { TokenId *big.Int Uri string SysPrompt []byte Fee *big.Int Minter common.Address Raw types.Log // Blockchain specific contextual infos } // FilterNewToken is a free log retrieval operation binding the contract event 0x61beab98a81083e3c0239c33e149bef1316ca78f15b9f29125039f5521a06d06. // // Solidity: event NewToken(uint256 indexed tokenId, string uri, bytes sysPrompt, uint256 fee, address indexed minter) func (_SystemPromptManager *SystemPromptManagerFilterer) FilterNewToken(opts *bind.FilterOpts, tokenId []*big.Int, minter []common.Address) (*SystemPromptManagerNewTokenIterator, error) { var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } var minterRule []interface{} for _, minterItem := range minter { minterRule = append(minterRule, minterItem) } logs, sub, err := _SystemPromptManager.contract.FilterLogs(opts, "NewToken", tokenIdRule, minterRule) if err != nil { return nil, err } return &SystemPromptManagerNewTokenIterator{contract: _SystemPromptManager.contract, event: "NewToken", logs: logs, sub: sub}, nil } // WatchNewToken is a free log subscription operation binding the contract event 0x61beab98a81083e3c0239c33e149bef1316ca78f15b9f29125039f5521a06d06. // // Solidity: event NewToken(uint256 indexed tokenId, string uri, bytes sysPrompt, uint256 fee, address indexed minter) func (_SystemPromptManager *SystemPromptManagerFilterer) WatchNewToken(opts *bind.WatchOpts, sink chan<- *SystemPromptManagerNewToken, tokenId []*big.Int, minter []common.Address) (event.Subscription, error) { var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } var minterRule []interface{} for _, minterItem := range minter { minterRule = append(minterRule, minterItem) } logs, sub, err := _SystemPromptManager.contract.WatchLogs(opts, "NewToken", tokenIdRule, minterRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(SystemPromptManagerNewToken) if err := _SystemPromptManager.contract.UnpackLog(event, "NewToken", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseNewToken is a log parse operation binding the contract event 0x61beab98a81083e3c0239c33e149bef1316ca78f15b9f29125039f5521a06d06. // // Solidity: event NewToken(uint256 indexed tokenId, string uri, bytes sysPrompt, uint256 fee, address indexed minter) func (_SystemPromptManager *SystemPromptManagerFilterer) ParseNewToken(log types.Log) (*SystemPromptManagerNewToken, error) { event := new(SystemPromptManagerNewToken) if err := _SystemPromptManager.contract.UnpackLog(event, "NewToken", log); err != nil { return nil, err } event.Raw = log return event, nil } // SystemPromptManagerOwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the SystemPromptManager contract. type SystemPromptManagerOwnershipTransferredIterator struct { Event *SystemPromptManagerOwnershipTransferred // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *SystemPromptManagerOwnershipTransferredIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(SystemPromptManagerOwnershipTransferred) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(SystemPromptManagerOwnershipTransferred) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *SystemPromptManagerOwnershipTransferredIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *SystemPromptManagerOwnershipTransferredIterator) Close() error { it.sub.Unsubscribe() return nil } // SystemPromptManagerOwnershipTransferred represents a OwnershipTransferred event raised by the SystemPromptManager contract. type SystemPromptManagerOwnershipTransferred struct { PreviousOwner common.Address NewOwner common.Address Raw types.Log // Blockchain specific contextual infos } // FilterOwnershipTransferred is a free log retrieval operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. // // Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) func (_SystemPromptManager *SystemPromptManagerFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*SystemPromptManagerOwnershipTransferredIterator, error) { var previousOwnerRule []interface{} for _, previousOwnerItem := range previousOwner { previousOwnerRule = append(previousOwnerRule, previousOwnerItem) } var newOwnerRule []interface{} for _, newOwnerItem := range newOwner { newOwnerRule = append(newOwnerRule, newOwnerItem) } logs, sub, err := _SystemPromptManager.contract.FilterLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) if err != nil { return nil, err } return &SystemPromptManagerOwnershipTransferredIterator{contract: _SystemPromptManager.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil } // WatchOwnershipTransferred is a free log subscription operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. // // Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) func (_SystemPromptManager *SystemPromptManagerFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *SystemPromptManagerOwnershipTransferred, previousOwner []common.Address, newOwner []common.Address) (event.Subscription, error) { var previousOwnerRule []interface{} for _, previousOwnerItem := range previousOwner { previousOwnerRule = append(previousOwnerRule, previousOwnerItem) } var newOwnerRule []interface{} for _, newOwnerItem := range newOwner { newOwnerRule = append(newOwnerRule, newOwnerItem) } logs, sub, err := _SystemPromptManager.contract.WatchLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(SystemPromptManagerOwnershipTransferred) if err := _SystemPromptManager.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseOwnershipTransferred is a log parse operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. // // Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) func (_SystemPromptManager *SystemPromptManagerFilterer) ParseOwnershipTransferred(log types.Log) (*SystemPromptManagerOwnershipTransferred, error) { event := new(SystemPromptManagerOwnershipTransferred) if err := _SystemPromptManager.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { return nil, err } event.Raw = log return event, nil } // SystemPromptManagerPausedIterator is returned from FilterPaused and is used to iterate over the raw logs and unpacked data for Paused events raised by the SystemPromptManager contract. type SystemPromptManagerPausedIterator struct { Event *SystemPromptManagerPaused // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *SystemPromptManagerPausedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(SystemPromptManagerPaused) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(SystemPromptManagerPaused) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *SystemPromptManagerPausedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *SystemPromptManagerPausedIterator) Close() error { it.sub.Unsubscribe() return nil } // SystemPromptManagerPaused represents a Paused event raised by the SystemPromptManager contract. type SystemPromptManagerPaused struct { Account common.Address Raw types.Log // Blockchain specific contextual infos } // FilterPaused is a free log retrieval operation binding the contract event 0x62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258. // // Solidity: event Paused(address account) func (_SystemPromptManager *SystemPromptManagerFilterer) FilterPaused(opts *bind.FilterOpts) (*SystemPromptManagerPausedIterator, error) { logs, sub, err := _SystemPromptManager.contract.FilterLogs(opts, "Paused") if err != nil { return nil, err } return &SystemPromptManagerPausedIterator{contract: _SystemPromptManager.contract, event: "Paused", logs: logs, sub: sub}, nil } // WatchPaused is a free log subscription operation binding the contract event 0x62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258. // // Solidity: event Paused(address account) func (_SystemPromptManager *SystemPromptManagerFilterer) WatchPaused(opts *bind.WatchOpts, sink chan<- *SystemPromptManagerPaused) (event.Subscription, error) { logs, sub, err := _SystemPromptManager.contract.WatchLogs(opts, "Paused") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(SystemPromptManagerPaused) if err := _SystemPromptManager.contract.UnpackLog(event, "Paused", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParsePaused is a log parse operation binding the contract event 0x62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258. // // Solidity: event Paused(address account) func (_SystemPromptManager *SystemPromptManagerFilterer) ParsePaused(log types.Log) (*SystemPromptManagerPaused, error) { event := new(SystemPromptManagerPaused) if err := _SystemPromptManager.contract.UnpackLog(event, "Paused", log); err != nil { return nil, err } event.Raw = log return event, nil } // SystemPromptManagerRoyaltyPortionUpdateIterator is returned from FilterRoyaltyPortionUpdate and is used to iterate over the raw logs and unpacked data for RoyaltyPortionUpdate events raised by the SystemPromptManager contract. type SystemPromptManagerRoyaltyPortionUpdateIterator struct { Event *SystemPromptManagerRoyaltyPortionUpdate // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *SystemPromptManagerRoyaltyPortionUpdateIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(SystemPromptManagerRoyaltyPortionUpdate) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(SystemPromptManagerRoyaltyPortionUpdate) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *SystemPromptManagerRoyaltyPortionUpdateIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *SystemPromptManagerRoyaltyPortionUpdateIterator) Close() error { it.sub.Unsubscribe() return nil } // SystemPromptManagerRoyaltyPortionUpdate represents a RoyaltyPortionUpdate event raised by the SystemPromptManager contract. type SystemPromptManagerRoyaltyPortionUpdate struct { NewValue uint16 Raw types.Log // Blockchain specific contextual infos } // FilterRoyaltyPortionUpdate is a free log retrieval operation binding the contract event 0xb1f3037624bd2d961f6d56696cc10ccc3a676db381e671b1bc58f0ab1f686dd5. // // Solidity: event RoyaltyPortionUpdate(uint16 newValue) func (_SystemPromptManager *SystemPromptManagerFilterer) FilterRoyaltyPortionUpdate(opts *bind.FilterOpts) (*SystemPromptManagerRoyaltyPortionUpdateIterator, error) { logs, sub, err := _SystemPromptManager.contract.FilterLogs(opts, "RoyaltyPortionUpdate") if err != nil { return nil, err } return &SystemPromptManagerRoyaltyPortionUpdateIterator{contract: _SystemPromptManager.contract, event: "RoyaltyPortionUpdate", logs: logs, sub: sub}, nil } // WatchRoyaltyPortionUpdate is a free log subscription operation binding the contract event 0xb1f3037624bd2d961f6d56696cc10ccc3a676db381e671b1bc58f0ab1f686dd5. // // Solidity: event RoyaltyPortionUpdate(uint16 newValue) func (_SystemPromptManager *SystemPromptManagerFilterer) WatchRoyaltyPortionUpdate(opts *bind.WatchOpts, sink chan<- *SystemPromptManagerRoyaltyPortionUpdate) (event.Subscription, error) { logs, sub, err := _SystemPromptManager.contract.WatchLogs(opts, "RoyaltyPortionUpdate") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(SystemPromptManagerRoyaltyPortionUpdate) if err := _SystemPromptManager.contract.UnpackLog(event, "RoyaltyPortionUpdate", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseRoyaltyPortionUpdate is a log parse operation binding the contract event 0xb1f3037624bd2d961f6d56696cc10ccc3a676db381e671b1bc58f0ab1f686dd5. // // Solidity: event RoyaltyPortionUpdate(uint16 newValue) func (_SystemPromptManager *SystemPromptManagerFilterer) ParseRoyaltyPortionUpdate(log types.Log) (*SystemPromptManagerRoyaltyPortionUpdate, error) { event := new(SystemPromptManagerRoyaltyPortionUpdate) if err := _SystemPromptManager.contract.UnpackLog(event, "RoyaltyPortionUpdate", log); err != nil { return nil, err } event.Raw = log return event, nil } // SystemPromptManagerRoyaltyReceiverUpdateIterator is returned from FilterRoyaltyReceiverUpdate and is used to iterate over the raw logs and unpacked data for RoyaltyReceiverUpdate events raised by the SystemPromptManager contract. type SystemPromptManagerRoyaltyReceiverUpdateIterator struct { Event *SystemPromptManagerRoyaltyReceiverUpdate // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *SystemPromptManagerRoyaltyReceiverUpdateIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(SystemPromptManagerRoyaltyReceiverUpdate) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(SystemPromptManagerRoyaltyReceiverUpdate) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *SystemPromptManagerRoyaltyReceiverUpdateIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *SystemPromptManagerRoyaltyReceiverUpdateIterator) Close() error { it.sub.Unsubscribe() return nil } // SystemPromptManagerRoyaltyReceiverUpdate represents a RoyaltyReceiverUpdate event raised by the SystemPromptManager contract. type SystemPromptManagerRoyaltyReceiverUpdate struct { NewAddress common.Address Raw types.Log // Blockchain specific contextual infos } // FilterRoyaltyReceiverUpdate is a free log retrieval operation binding the contract event 0xec6b72b10aed766af02b35918b55be261c89aaaa4c8add826471ce35ec7f97b3. // // Solidity: event RoyaltyReceiverUpdate(address newAddress) func (_SystemPromptManager *SystemPromptManagerFilterer) FilterRoyaltyReceiverUpdate(opts *bind.FilterOpts) (*SystemPromptManagerRoyaltyReceiverUpdateIterator, error) { logs, sub, err := _SystemPromptManager.contract.FilterLogs(opts, "RoyaltyReceiverUpdate") if err != nil { return nil, err } return &SystemPromptManagerRoyaltyReceiverUpdateIterator{contract: _SystemPromptManager.contract, event: "RoyaltyReceiverUpdate", logs: logs, sub: sub}, nil } // WatchRoyaltyReceiverUpdate is a free log subscription operation binding the contract event 0xec6b72b10aed766af02b35918b55be261c89aaaa4c8add826471ce35ec7f97b3. // // Solidity: event RoyaltyReceiverUpdate(address newAddress) func (_SystemPromptManager *SystemPromptManagerFilterer) WatchRoyaltyReceiverUpdate(opts *bind.WatchOpts, sink chan<- *SystemPromptManagerRoyaltyReceiverUpdate) (event.Subscription, error) { logs, sub, err := _SystemPromptManager.contract.WatchLogs(opts, "RoyaltyReceiverUpdate") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(SystemPromptManagerRoyaltyReceiverUpdate) if err := _SystemPromptManager.contract.UnpackLog(event, "RoyaltyReceiverUpdate", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseRoyaltyReceiverUpdate is a log parse operation binding the contract event 0xec6b72b10aed766af02b35918b55be261c89aaaa4c8add826471ce35ec7f97b3. // // Solidity: event RoyaltyReceiverUpdate(address newAddress) func (_SystemPromptManager *SystemPromptManagerFilterer) ParseRoyaltyReceiverUpdate(log types.Log) (*SystemPromptManagerRoyaltyReceiverUpdate, error) { event := new(SystemPromptManagerRoyaltyReceiverUpdate) if err := _SystemPromptManager.contract.UnpackLog(event, "RoyaltyReceiverUpdate", log); err != nil { return nil, err } event.Raw = log return event, nil } // SystemPromptManagerTopUpPoolBalanceIterator is returned from FilterTopUpPoolBalance and is used to iterate over the raw logs and unpacked data for TopUpPoolBalance events raised by the SystemPromptManager contract. type SystemPromptManagerTopUpPoolBalanceIterator struct { Event *SystemPromptManagerTopUpPoolBalance // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *SystemPromptManagerTopUpPoolBalanceIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(SystemPromptManagerTopUpPoolBalance) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(SystemPromptManagerTopUpPoolBalance) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *SystemPromptManagerTopUpPoolBalanceIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *SystemPromptManagerTopUpPoolBalanceIterator) Close() error { it.sub.Unsubscribe() return nil } // SystemPromptManagerTopUpPoolBalance represents a TopUpPoolBalance event raised by the SystemPromptManager contract. type SystemPromptManagerTopUpPoolBalance struct { AgentId *big.Int Caller common.Address Amount *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterTopUpPoolBalance is a free log retrieval operation binding the contract event 0xf7ee57effd30f2ab842c1d65fdcfa7d20c2fb2f967e9ac30acafecabf013ea4c. // // Solidity: event TopUpPoolBalance(uint256 agentId, address caller, uint256 amount) func (_SystemPromptManager *SystemPromptManagerFilterer) FilterTopUpPoolBalance(opts *bind.FilterOpts) (*SystemPromptManagerTopUpPoolBalanceIterator, error) { logs, sub, err := _SystemPromptManager.contract.FilterLogs(opts, "TopUpPoolBalance") if err != nil { return nil, err } return &SystemPromptManagerTopUpPoolBalanceIterator{contract: _SystemPromptManager.contract, event: "TopUpPoolBalance", logs: logs, sub: sub}, nil } // WatchTopUpPoolBalance is a free log subscription operation binding the contract event 0xf7ee57effd30f2ab842c1d65fdcfa7d20c2fb2f967e9ac30acafecabf013ea4c. // // Solidity: event TopUpPoolBalance(uint256 agentId, address caller, uint256 amount) func (_SystemPromptManager *SystemPromptManagerFilterer) WatchTopUpPoolBalance(opts *bind.WatchOpts, sink chan<- *SystemPromptManagerTopUpPoolBalance) (event.Subscription, error) { logs, sub, err := _SystemPromptManager.contract.WatchLogs(opts, "TopUpPoolBalance") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(SystemPromptManagerTopUpPoolBalance) if err := _SystemPromptManager.contract.UnpackLog(event, "TopUpPoolBalance", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseTopUpPoolBalance is a log parse operation binding the contract event 0xf7ee57effd30f2ab842c1d65fdcfa7d20c2fb2f967e9ac30acafecabf013ea4c. // // Solidity: event TopUpPoolBalance(uint256 agentId, address caller, uint256 amount) func (_SystemPromptManager *SystemPromptManagerFilterer) ParseTopUpPoolBalance(log types.Log) (*SystemPromptManagerTopUpPoolBalance, error) { event := new(SystemPromptManagerTopUpPoolBalance) if err := _SystemPromptManager.contract.UnpackLog(event, "TopUpPoolBalance", log); err != nil { return nil, err } event.Raw = log return event, nil } // SystemPromptManagerTransferIterator is returned from FilterTransfer and is used to iterate over the raw logs and unpacked data for Transfer events raised by the SystemPromptManager contract. type SystemPromptManagerTransferIterator struct { Event *SystemPromptManagerTransfer // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *SystemPromptManagerTransferIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(SystemPromptManagerTransfer) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(SystemPromptManagerTransfer) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *SystemPromptManagerTransferIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *SystemPromptManagerTransferIterator) Close() error { it.sub.Unsubscribe() return nil } // SystemPromptManagerTransfer represents a Transfer event raised by the SystemPromptManager contract. type SystemPromptManagerTransfer struct { From common.Address To common.Address TokenId *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterTransfer is a free log retrieval operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. // // Solidity: event Transfer(address indexed from, address indexed to, uint256 indexed tokenId) func (_SystemPromptManager *SystemPromptManagerFilterer) FilterTransfer(opts *bind.FilterOpts, from []common.Address, to []common.Address, tokenId []*big.Int) (*SystemPromptManagerTransferIterator, error) { var fromRule []interface{} for _, fromItem := range from { fromRule = append(fromRule, fromItem) } var toRule []interface{} for _, toItem := range to { toRule = append(toRule, toItem) } var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _SystemPromptManager.contract.FilterLogs(opts, "Transfer", fromRule, toRule, tokenIdRule) if err != nil { return nil, err } return &SystemPromptManagerTransferIterator{contract: _SystemPromptManager.contract, event: "Transfer", logs: logs, sub: sub}, nil } // WatchTransfer is a free log subscription operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. // // Solidity: event Transfer(address indexed from, address indexed to, uint256 indexed tokenId) func (_SystemPromptManager *SystemPromptManagerFilterer) WatchTransfer(opts *bind.WatchOpts, sink chan<- *SystemPromptManagerTransfer, from []common.Address, to []common.Address, tokenId []*big.Int) (event.Subscription, error) { var fromRule []interface{} for _, fromItem := range from { fromRule = append(fromRule, fromItem) } var toRule []interface{} for _, toItem := range to { toRule = append(toRule, toItem) } var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _SystemPromptManager.contract.WatchLogs(opts, "Transfer", fromRule, toRule, tokenIdRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(SystemPromptManagerTransfer) if err := _SystemPromptManager.contract.UnpackLog(event, "Transfer", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseTransfer is a log parse operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. // // Solidity: event Transfer(address indexed from, address indexed to, uint256 indexed tokenId) func (_SystemPromptManager *SystemPromptManagerFilterer) ParseTransfer(log types.Log) (*SystemPromptManagerTransfer, error) { event := new(SystemPromptManagerTransfer) if err := _SystemPromptManager.contract.UnpackLog(event, "Transfer", log); err != nil { return nil, err } event.Raw = log return event, nil } // SystemPromptManagerUnpausedIterator is returned from FilterUnpaused and is used to iterate over the raw logs and unpacked data for Unpaused events raised by the SystemPromptManager contract. type SystemPromptManagerUnpausedIterator struct { Event *SystemPromptManagerUnpaused // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *SystemPromptManagerUnpausedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(SystemPromptManagerUnpaused) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(SystemPromptManagerUnpaused) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *SystemPromptManagerUnpausedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *SystemPromptManagerUnpausedIterator) Close() error { it.sub.Unsubscribe() return nil } // SystemPromptManagerUnpaused represents a Unpaused event raised by the SystemPromptManager contract. type SystemPromptManagerUnpaused struct { Account common.Address Raw types.Log // Blockchain specific contextual infos } // FilterUnpaused is a free log retrieval operation binding the contract event 0x5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa. // // Solidity: event Unpaused(address account) func (_SystemPromptManager *SystemPromptManagerFilterer) FilterUnpaused(opts *bind.FilterOpts) (*SystemPromptManagerUnpausedIterator, error) { logs, sub, err := _SystemPromptManager.contract.FilterLogs(opts, "Unpaused") if err != nil { return nil, err } return &SystemPromptManagerUnpausedIterator{contract: _SystemPromptManager.contract, event: "Unpaused", logs: logs, sub: sub}, nil } // WatchUnpaused is a free log subscription operation binding the contract event 0x5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa. // // Solidity: event Unpaused(address account) func (_SystemPromptManager *SystemPromptManagerFilterer) WatchUnpaused(opts *bind.WatchOpts, sink chan<- *SystemPromptManagerUnpaused) (event.Subscription, error) { logs, sub, err := _SystemPromptManager.contract.WatchLogs(opts, "Unpaused") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(SystemPromptManagerUnpaused) if err := _SystemPromptManager.contract.UnpackLog(event, "Unpaused", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseUnpaused is a log parse operation binding the contract event 0x5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa. // // Solidity: event Unpaused(address account) func (_SystemPromptManager *SystemPromptManagerFilterer) ParseUnpaused(log types.Log) (*SystemPromptManagerUnpaused, error) { event := new(SystemPromptManagerUnpaused) if err := _SystemPromptManager.contract.UnpackLog(event, "Unpaused", log); err != nil { return nil, err } event.Raw = log return event, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/binds/tokenfactory/TokenFactory.go ================================================ // Code generated - DO NOT EDIT. // This file is a generated binding and any manual changes will be lost. package tokenfactory import ( "errors" "math/big" "strings" ethereum "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/event" ) // Reference imports to suppress errors if they are not otherwise used. var ( _ = errors.New _ = big.NewInt _ = strings.NewReader _ = ethereum.NotFound _ = bind.Bind _ = common.Big1 _ = types.BloomLookup _ = event.NewSubscription _ = abi.ConvertType ) // TokenFactoryMetaData contains all meta data concerning the TokenFactory contract. var TokenFactoryMetaData = &bind.MetaData{ ABI: "[{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"TokenCreated\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"checkToken\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenType\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"symbol\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"payoutRecipient\",\"type\":\"address\"}],\"name\":\"createToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenFee\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amountFee\",\"type\":\"uint256\"}],\"name\":\"depositFee\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getChainId\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"getPayoutFeeBalance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes[]\",\"name\":\"data\",\"type\":\"bytes[]\"}],\"name\":\"multicall\",\"outputs\":[{\"internalType\":\"bytes[]\",\"name\":\"results\",\"type\":\"bytes[]\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", Bin: "0x60808060405234610016576140fe908161001c8239f35b600080fdfe608060405260043610156200001357600080fd5b60003560e01c80631c43245514620000cb5780633408e47014620000c55780635d6761e814620000bf578063715018a614620000b95780638129fc1c14620000b35780638da5cb5b14620000ad578063ac9650d814620000a7578063f1880b2414620000a1578063f2fde38b146200009b5763fee74e28146200009557600080fd5b620006c8565b62000566565b62000520565b620003f8565b6200031b565b62000226565b620001c1565b62000157565b6200013a565b34620001235760603660031901126200012357602062000114600435620000f28162000128565b602435620001008162000128565b6200010a62000c13565b6044359162000c82565b60016065556040519015158152f35b600080fd5b6001600160a01b038116036200012357565b346200012357600036600319011262000123576020604051468152f35b346200012357604036600319011262000123576020620001b86004356200017e8162000128565b602435906200018d8262000128565b60018060a01b03166000526098835260406000209060018060a01b0316600052602052604060002090565b54604051908152f35b3462000123576000806003193601126200022357620001df6200083b565b603380546001600160a01b0319811690915581906001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b80fd5b346200012357600080600319360112620002235780546200026160ff8260081c1615809281936200030c575b8115620002e9575b5062000aad565b8062000275600160ff196000541617600055565b620002ce575b6200028562000b11565b6200028d5780f35b6200029e61ff001960005416600055565b604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb384740249890602090a180f35b620002e361010061ff00196000541617600055565b6200027b565b303b15915081620002fd575b50386200025a565b6001915060ff161438620002f5565b600160ff821610915062000252565b346200012357600036600319011262000123576033546040516001600160a01b039091168152602090f35b60005b8381106200035a5750506000910152565b818101518382015260200162000349565b90602091620003868151809281855285808601910162000346565b601f01601f1916010190565b602080820190808352835180925260408301928160408460051b8301019501936000915b848310620003c75750505050505090565b9091929394958480620003e7600193603f198682030187528a516200036b565b9801930193019194939290620003b6565b602036600319011262000123576004803567ffffffffffffffff918282116200012357366023830112156200012357818101359283116200012357602490818301928236918660051b01011162000123576200045484620008f6565b9360005b81811062000474576040518062000470888262000392565b0390f35b600080620004848385896200098a565b6040939162000498855180938193620009d6565b0390305af490620004a8620009e4565b91829015620004df57505090620004d991620004c5828962000a98565b52620004d2818862000a98565b506200095e565b62000458565b8683879260448251106200012357826200051c938562000506940151830101910162000a19565b925162461bcd60e51b8152928392830162000a85565b0390fd5b34620001235760203660031901126200012357600435620005418162000128565b60018060a01b03166000526097602052602060ff604060002054166040519015158152f35b34620001235760203660031901126200012357600435620005878162000128565b620005916200083b565b6001600160a01b03811615620005ae57620005ac9062000894565b005b60405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608490fd5b634e487b7160e01b600052604160045260246000fd5b60a0810190811067ffffffffffffffff8211176200063557604052565b62000602565b90601f8019910116810190811067ffffffffffffffff8211176200063557604052565b67ffffffffffffffff81116200063557601f01601f191660200190565b81601f82011215620001235780359062000695826200065e565b92620006a560405194856200063b565b828452602083830101116200012357816000926020809301838601378301015290565b34620001235760c0366003190112620001235767ffffffffffffffff6024358181116200012357620006ff9036906004016200067b565b60443582811162000123576200071a9036906004016200067b565b608435620007288162000128565b60a43590620007378262000128565b6200074162000c13565b60043515620008025760405194613230938487019182118783101762000635578695620007789562000e9988396064359262000bba565b03906000f08015620007fc576001600160a01b031660008181526097602052604090207f2e2b3f61b70d2d131b2a807371103cc98d51adcaa5e9a8f9c32658ad8426e74e91620007ee91620007d490805460ff19166001179055565b6040516001600160a01b0390911681529081906020820190565b0390a1620005ac6001606555565b62000c07565b60405162461bcd60e51b81526020600482015260116024820152701d1bdad95b951e5c19481a5b9d985b1a59607a1b6044820152606490fd5b6033546001600160a01b031633036200085057565b606460405162461bcd60e51b815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b603380546001600160a01b039283166001600160a01b0319821681179092559091167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a3565b67ffffffffffffffff8111620006355760051b60200190565b906200090282620008dd565b6200091160405191826200063b565b828152809262000924601f1991620008dd565b019060005b8281106200093657505050565b80606060208093850101520162000929565b634e487b7160e01b600052601160045260246000fd5b60001981146200096e5760010190565b62000948565b634e487b7160e01b600052603260045260246000fd5b9190811015620009d05760051b81013590601e19813603018212156200012357019081359167ffffffffffffffff83116200012357602001823603811362000123579190565b62000974565b908092918237016000815290565b3d1562000a14573d90620009f8826200065e565b9162000a0860405193846200063b565b82523d6000602084013e565b606090565b602081830312620001235780519067ffffffffffffffff821162000123570181601f820112156200012357805162000a51816200065e565b9262000a6160405194856200063b565b81845260208284010111620001235762000a82916020808501910162000346565b90565b90602062000a829281815201906200036b565b8051821015620009d05760209160051b010190565b1562000ab557565b60405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608490fd5b62000b2f60ff60005460081c1662000b298162000b59565b62000b59565b62000b3a3362000894565b62000b5260ff60005460081c1662000b298162000b59565b6001606555565b1562000b6157565b60405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608490fd5b939162000be99062000bda60809598979360a0885260a08801906200036b565b9086820360208801526200036b565b60408501969096526001600160a01b03918216606085015216910152565b6040513d6000823e3d90fd5b60026065541462000c25576002606555565b60405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606490fd5b9081602091031262000123575162000a828162000128565b919062000cac62000ca58460018060a01b03166000526097602052604060002090565b5460ff1690565b62000cba575b505050600090565b60405163305ae29360e01b8152926001600160a01b03906020908590600490829085165afa938415620007fc5760009462000d78575b5083161562000cb2578262000d688262000d2e62000d4c8662000d458462000d2e62000d739b60018060a01b03166000526098602052604060002090565b9060018060a01b0316600052602052604060002090565b5462000daf565b6001600160a01b03909416600090815260986020526040902090565b553090339062000dd7565b600190565b62000d9f91945060203d811162000da7575b62000d9681836200063b565b81019062000c6a565b923862000cf0565b503d62000d8a565b919082018092116200096e57565b908160209103126200012357518015158103620001235790565b9091600080949381946040519160208301946323b872dd60e01b865260018060a01b03809216602485015216604483015260648201526064815262000e1c8162000618565b51925af162000e2a620009e4565b8162000e64575b501562000e3a57565b60405162461bcd60e51b81526020600482015260026024820152612a2360f11b6044820152606490fd5b805180159250821562000e7b575b50503862000e31565b62000e90925060208091830101910162000dbd565b388062000e7256fe6101608060405234620000e0576200323080380380916200002082620000fb565b833960a08183019112620000e05781516001600160401b039290838111620000e057826200005091830162000179565b9161018051938411620000e0576200008e936200006e920162000179565b6101a0516200007c620001df565b9162000087620001f7565b936200020f565b6040516120d9908162001137823960805181611ae1015260a05181611b9c015260c05181611aab015260e05181611b3001526101005181611b560152610120518161083d015261014051816108660152f35b600080fd5b634e487b7160e01b600052604160045260246000fd5b601f01601f1916610160908101906001600160401b038211908210176200012157604052565b620000e5565b604081019081106001600160401b038211176200012157604052565b60405190620001528262000127565b565b60005b838110620001685750506000910152565b818101518382015260200162000157565b81601f82011215620000e05780516001600160401b0392838211620001215760405193601f8301601f19908116603f0116850190811185821017620001215760405281845260208284010111620000e057620001dc916020808501910162000154565b90565b6101c051906001600160a01b0382168203620000e057565b6101e051906001600160a01b0382168203620000e057565b9493929094604051620002228162000127565b6001808252603160f81b6020808401918252845190999194926001600160401b038211620001215762000262826200025c600354620003b9565b620003f6565b8a601f83116001146200031e57928280620001529c9d94620002a894620002f09c9b9a99989760009362000312575b501b916000199060031b1c1916176003556200055a565b620002b3826200064d565b61012052620002c2836200075d565b61014052815191012060e052519020610100524660a052620002e3620008dc565b6080523060c052620009ae565b600c80546001600160a01b0319166001600160a01b0392909216919091179055565b88015192503862000291565b6003600052909190601f198216907fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b9160005b818110620003a3575092620002f09a999897969592620001529d9e959282620002a8961062000389575b5050811b016003556200055a565b87015160001960f88460031b161c1916905538806200037b565b87830151845592850192918e01918e0162000351565b90600182811c92168015620003eb575b6020831014620003d557565b634e487b7160e01b600052602260045260246000fd5b91607f1691620003c9565b601f811162000403575050565b6000906003825260208220906020601f850160051c8301941062000444575b601f0160051c01915b8281106200043857505050565b8181556001016200042b565b909250829062000422565b601f81116200045c575050565b6000906004825260208220906020601f850160051c830194106200049d575b601f0160051c01915b8281106200049157505050565b81815560010162000484565b90925082906200047b565b601f8111620004b5575050565b6000906005825260208220906020601f850160051c83019410620004f6575b601f0160051c01915b828110620004ea57505050565b818155600101620004dd565b9092508290620004d4565b601f81116200050e575050565b6000906006825260208220906020601f850160051c830194106200054f575b601f0160051c01915b8281106200054357505050565b81815560010162000536565b90925082906200052d565b80519091906001600160401b0381116200012157620005868162000580600454620003b9565b6200044f565b602080601f8311600114620005c55750819293600092620005b9575b50508160011b916000199060031b1c191617600455565b015190503880620005a2565b6004600052601f198316949091907f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b926000905b878210620006345750508360019596106200061a575b505050811b01600455565b015160001960f88460031b161c191690553880806200060f565b80600185968294968601518155019501930190620005f9565b90815160208082106000146200066b57505090620001dc906200086d565b6001600160401b038211620001215762000692826200068c600554620003b9565b620004a8565b80601f8311600114620006d25750819293600092620006c6575b50508160011b916000199060031b1c19161760055560ff90565b015190503880620006ac565b6005600052601f198316949091907f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db0926000905b878210620007445750508360019596106200072a575b505050811b0160055560ff90565b015160001960f88460031b161c191690553880806200071c565b8060018596829496860151815501950193019062000706565b90815160208082106000146200077b57505090620001dc906200086d565b6001600160401b0382116200012157620007a2826200079c600654620003b9565b62000501565b80601f8311600114620007e25750819293600092620007d6575b50508160011b916000199060031b1c19161760065560ff90565b015190503880620007bc565b6006600052601f198316949091907ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f926000905b878210620008545750508360019596106200083a575b505050811b0160065560ff90565b015160001960f88460031b161c191690553880806200082c565b8060018596829496860151815501950193019062000816565b601f8151116200089b5760208151910151602082106200088b571790565b6000198260200360031b1b161790565b6044604051809263305a27a960e01b825260206004830152620008ce815180928160248601526020868601910162000154565b601f01601f19168101030190fd5b60e051610100516040519060208201927f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f8452604083015260608201524660808201523060a082015260a0815260c0810181811060018060401b03821117620001215760405251902090565b156200095057565b60405162461bcd60e51b815260206004820152603060248201527f4552433230566f7465733a20746f74616c20737570706c79207269736b73206f60448201526f766572666c6f77696e6720766f74657360801b6064820152608490fd5b906001600160a01b038216801562000a585760025482810180911162000a525762000a4e9362000a3092620009e38593600255565b6001600160a01b038216600090815260208181526040808320805487019055518581527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9190a36200100c565b60025462000a48906001600160e01b03101562000948565b62000bbd565b5050565b62000a9d565b60405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606490fd5b634e487b7160e01b600052601160045260246000fd5b604080519192919081016001600160401b038111828210176200012157604052602081935463ffffffff81168352811c910152565b600b54906801000000000000000082101562000121576001820180600b5582101562000b5657600b600052805160209182015190911b63ffffffff191663ffffffff91909116177f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01db990910155565b634e487b7160e01b600052603260045260246000fd5b9081546801000000000000000081101562000121576001810180845581101562000b5657600092835260209283902082519284015190931b63ffffffff191663ffffffff9290921691909117910155565b600b549091811591821562000d055762000bd662000143565b60008152600060208201525b602081015162000c0f9062000c07906001600160e01b03165b6001600160e01b031690565b95866200111a565b9315908162000cde575b501562000c7657620001529062000c5f62000c348562000ed4565b600b600052917f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01db80190565b9063ffffffff82549181199060201b169116179055565b506200015262000c9f62000c9962000c8e4362000f3e565b65ffffffffffff1690565b62000fa6565b62000cd862000cae8562000ed4565b62000cc862000cbc62000143565b63ffffffff9094168452565b6001600160e01b03166020830152565b62000ae8565b5163ffffffff16905063ffffffff62000cfb62000c8e4362000f3e565b9116143862000c19565b600b60005262000d3d7f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01db8820162000ab3565b62000ab3565b62000be2565b90918154918215928360001462000e475762000d5e62000143565b60008152600060208201525b602081015162000d909062000d88906001600160e01b031662000bfb565b968762001128565b9415908162000e20575b501562000dc75762000c5f620001529262000db58662000ed4565b92600019019060005260206000200190565b50620001529062000de062000c9962000c8e4362000f3e565b9062000e1a62000df08662000ed4565b62000e0a62000dfe62000143565b63ffffffff9095168552565b6001600160e01b03166020840152565b62000b6c565b5163ffffffff16905063ffffffff62000e3d62000c8e4362000f3e565b9116143862000d9a565b62000e6162000d3760001983018460005260206000200190565b62000d6a565b90918154918215928360001462000eb45762000e8262000143565b60008152600060208201525b602081015162000d909062000eac906001600160e01b031662000bfb565b96876200111a565b62000ece62000d3760001983018460005260206000200190565b62000e8e565b6001600160e01b039081811162000ee9571690565b60405162461bcd60e51b815260206004820152602760248201527f53616665436173743a2076616c756520646f65736e27742066697420696e20326044820152663234206269747360c81b6064820152608490fd5b65ffffffffffff9081811162000f52571690565b60405162461bcd60e51b815260206004820152602660248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203460448201526538206269747360d01b6064820152608490fd5b63ffffffff9081811162000fb8571690565b60405162461bcd60e51b815260206004820152602660248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203360448201526532206269747360d01b6064820152608490fd5b60096020527fec8156718a8372b1db44bb411437d0870f3e3790d4a08526d024ce1b0b668f6b546001600160a01b03918216600090815260408120548316939290911690818414158062001110575b62001067575b50505050565b829082620010cf575b5050508162001082575b808062001061565b6001600160a01b0382166000908152600a602052604090206000805160206200321083398151915291620010b69162000e67565b60408051928352602083019190915290a238806200107a565b600080516020620032108339815191529160408285620010f69452600a6020522062000d43565b60408051928352602083019190915290a238818162001070565b508215156200105b565b90810180911162000a525790565b90810390811162000a52579056fe6080604052600436101561001257600080fd5b60003560e01c806306fdde03146101b7578063095ea7b3146101b257806318160ddd146101ad57806323b872dd146101a8578063305ae293146101a3578063313ce5671461019e5780633644e5151461019957806339509351146101945780633a46b1a81461018f5780634bf5d7e91461018a578063587cde1e146101855780635c19a95c146101805780636fcfff451461017b57806370a08231146101765780637ecebe001461017157806384b0196e1461016c5780638e539e8c1461016757806391ddadf41461016257806395d89b411461015d5780639ab24eb014610158578063a457c2d714610153578063a9059cbb1461014e578063c3cda52014610149578063d505accf14610144578063dd62ed3e1461013f5763f1127ed81461013a57600080fd5b610f65565b610f0d565b610dc7565b610c9c565b610c56565b610ba8565b610b46565b610a9f565b610a73565b61091a565b610822565b6107e8565b6107ae565b610766565b610742565b610707565b610655565b610500565b6104a8565b610485565b610469565b610440565b610375565b610357565b610326565b610210565b919082519283825260005b8481106101e8575050826000602080949584010152601f8019910116010190565b6020818301810151848301820152016101c7565b90602061020d9281815201906101bc565b90565b346102f5576000806003193601126102f257604051908060035461023381610fec565b808552916001918083169081156102c8575060011461026d575b6102698561025d81870382611095565b604051918291826101fc565b0390f35b9250600383527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b5b8284106102b057505050810160200161025d8261026961024d565b80546020858701810191909152909301928101610295565b8695506102699693506020925061025d94915060ff191682840152151560051b820101929361024d565b80fd5b600080fd5b600435906001600160a01b03821682036102f557565b602435906001600160a01b03821682036102f557565b346102f55760403660031901126102f55761034c6103426102fa565b602435903361129c565b602060405160018152f35b346102f55760003660031901126102f5576020600254604051908152f35b346102f55760603660031901126102f55761038e6102fa565b610396610310565b6001600160a01b0382166000908152600160209081526040808320338452909152902060443591905492600184016103df575b6103d3935061118e565b60405160018152602090f35b8284106103fb576103f6836103d39503338361129c565b6103c9565b60405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606490fd5b346102f55760003660031901126102f557600c546040516001600160a01b039091168152602090f35b346102f55760003660031901126102f557602060405160128152f35b346102f55760003660031901126102f55760206104a0611aa8565b604051908152f35b346102f55760403660031901126102f5576104c16102fa565b3360009081526001602090815260408083206001600160a01b038516845290915290205460243581018091116104fb5761034c913361129c565b6110b7565b346102f55760403660031901126102f5576105196102fa565b6024359061053865ffffffffffff61053043611f8b565b168310611475565b6001600160a01b03166000908152600a6020526040812080549290918360058111610604575b50905b8382106105af57505081610588575050602060005b6040516001600160e01b039091168152f35b6105a36105aa91602093600019019060005260206000200190565b5460201c90565b610576565b90926105bb8185611dbb565b90818363ffffffff6105e16105d7848960005260206000200190565b5463ffffffff1690565b1611156105f2575050925b90610561565b9094506105ff91506110cd565b6105ec565b8061061461061a92969396611dd0565b906114c1565b908263ffffffff6106356105d7858860005260206000200190565b1611156106455750925b3861055e565b9350610650906110cd565b61063f565b346102f55760003660031901126102f5574365ffffffffffff61067743611f8b565b16036106c25761026960405161068c8161103c565b601d81527f6d6f64653d626c6f636b6e756d6265722666726f6d3d64656661756c740000006020820152604051918291826101fc565b60405162461bcd60e51b815260206004820152601d60248201527f4552433230566f7465733a2062726f6b656e20636c6f636b206d6f64650000006044820152606490fd5b346102f55760203660031901126102f55760206001600160a01b038061072b6102fa565b166000526009825260406000205416604051908152f35b346102f55760203660031901126102f55761076461075e6102fa565b3361151a565b005b346102f55760203660031901126102f5576001600160a01b036107876102fa565b16600052600a60205260206107a0604060002054611ff2565b63ffffffff60405191168152f35b346102f55760203660031901126102f5576001600160a01b036107cf6102fa565b1660005260006020526020604060002054604051908152f35b346102f55760203660031901126102f5576001600160a01b036108096102fa565b1660005260076020526020604060002054604051908152f35b346102f5576000806003193601126102f2576108cc906108617f0000000000000000000000000000000000000000000000000000000000000000611be8565b61088a7f0000000000000000000000000000000000000000000000000000000000000000611ce1565b91604051916108988361105d565b818352604051948594600f60f81b86526108be60209360e08589015260e08801906101bc565b9086820360408801526101bc565b904660608601523060808601528260a086015284820360c08601528080855193848152019401925b82811061090357505050500390f35b8351855286955093810193928101926001016108f4565b346102f55760203660031901126102f55760043561094965ffffffffffff61094143611f8b565b168210611475565b600b549060008260058111610a0c575b50905b8282106109a9578280610976575060405160008152602090f35b600b6000526020906105aa907f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01db8016105a3565b90916109b58184611dbb565b600b600052908263ffffffff6109ec7f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01db985016105d7565b1611156109fc5750915b9061095c565b9250610a07906110cd565b6109f6565b80610614610a1c92959395611dd0565b600b600052908263ffffffff610a537f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01db985016105d7565b161115610a635750915b38610959565b9250610a6e906110cd565b610a5d565b346102f55760003660031901126102f5576020610a8f43611f8b565b65ffffffffffff60405191168152f35b346102f5576000806003193601126102f2576040519080600454610ac281610fec565b808552916001918083169081156102c85750600114610aeb576102698561025d81870382611095565b9250600483527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b5b828410610b2e57505050810160200161025d8261026961024d565b80546020858701810191909152909301928101610b13565b346102f55760203660031901126102f5576001600160a01b03610b676102fa565b16600052600a602052604060002080548015600014610b8e57505060405160008152602090f35b602091610b9f916000190190611425565b5054811c610576565b346102f55760403660031901126102f557610bc16102fa565b60243590336000526001602052610bee8160406000209060018060a01b0316600052602052604060002090565b5491808310610c03576103d39203903361129c565b60405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608490fd5b346102f55760403660031901126102f55761034c610c726102fa565b602435903361118e565b6064359060ff821682036102f557565b6084359060ff821682036102f557565b346102f55760c03660031901126102f557610cb56102fa565b60443590602435610cc4610c7c565b92804211610d8257610d54610d7d916107649560405190610d3c82610d2e6020820195898b8860609194939260808201957fe48329057bfd03d55e49b547132e39cffd9c1820ad7b9d4c5307691425d15adf835260018060a01b0316602083015260408201520152565b03601f198101845283611095565b610d4f60a4359360843593519020611bc2565b6118c2565b6001600160a01b03811660009081526007602052604090208054600181019091559092146114ce565b61151a565b60405162461bcd60e51b815260206004820152601d60248201527f4552433230566f7465733a207369676e617475726520657870697265640000006044820152606490fd5b346102f55760e03660031901126102f557610de06102fa565b610de8610310565b6044359060643592610df8610c8c565b93804211610ec857610eb0610ec391610d2e61076497610e9d610e368760018060a01b03166000526007602052604060002090815491600183019055565b604080517f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9602082019081526001600160a01b03808c1693830193909352918b166060820152608081018c905260a081019290925260c082019590955292839060e0820190565b610d4f60c4359360a43593519020611bc2565b6001600160a01b038381169116146113cc565b61129c565b60405162461bcd60e51b815260206004820152601d60248201527f45524332305065726d69743a206578706972656420646561646c696e650000006044820152606490fd5b346102f55760403660031901126102f5576020610f5c610f2b6102fa565b610f33610310565b6001600160a01b0391821660009081526001855260408082209290931681526020919091522090565b54604051908152f35b346102f55760403660031901126102f557610f7e6102fa565b63ffffffff60243581811681036102f557610fc8610fce91604094600060208751610fa88161103c565b82815201526001600160a01b03166000908152600a602052859020611425565b50611453565b8251815190921682526020908101516001600160e01b031690820152f35b90600182811c9216801561101c575b602083101461100657565b634e487b7160e01b600052602260045260246000fd5b91607f1691610ffb565b634e487b7160e01b600052604160045260246000fd5b6040810190811067ffffffffffffffff82111761105857604052565b611026565b6020810190811067ffffffffffffffff82111761105857604052565b60c0810190811067ffffffffffffffff82111761105857604052565b90601f8019910116810190811067ffffffffffffffff82111761105857604052565b634e487b7160e01b600052601160045260246000fd5b90600182018092116104fb57565b156110e257565b60405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608490fd5b1561113a57565b60405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608490fd5b6001600160a01b03929190838116801561124957611247948316906111b48215156110db565b6001600160a01b03831660009081526020819052604090208590546111db82821015611133565b036111f88460018060a01b03166000526000602052604060002090565b556001600160a01b0384166000908152602081815260409182902080548801905590518681527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9190a3612057565b565b60405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608490fd5b6001600160a01b03808216929190831561137b57821693841561132b57806113157f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925946112fe6113269560018060a01b03166000526001602052604060002090565b9060018060a01b0316600052602052604060002090565b556040519081529081906020820190565b0390a3565b60405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608490fd5b60405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608490fd5b156113d357565b60405162461bcd60e51b815260206004820152601e60248201527f45524332305065726d69743a20696e76616c6964207369676e617475726500006044820152606490fd5b604051906112478261103c565b805482101561143d5760005260206000200190600090565b634e487b7160e01b600052603260045260246000fd5b906040516114608161103c565b602081935463ffffffff81168352811c910152565b1561147c57565b60405162461bcd60e51b815260206004820152601960248201527f4552433230566f7465733a20667574757265206c6f6f6b7570000000000000006044820152606490fd5b919082039182116104fb57565b156114d557565b60405162461bcd60e51b815260206004820152601960248201527f4552433230566f7465733a20696e76616c6964206e6f6e6365000000000000006044820152606490fd5b6112479160018060a01b038092166000928184526009602052806040852054168092856020527f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f60408720549660096020526040812094871694856bffffffffffffffffffffffff60a01b82541617905580a45b6001600160a01b038083169392911680841415806117a1575b6115b2575b50505050565b80611620575b50826115c5575b806115ac565b6001600160a01b03166000908152600a602052604090207fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a7249161160791611809565b60408051928352602083019190915290a23880806115bf565b80600052600a6020527fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a724604060002080548015918260001461177e57611664611418565b6000815260006020820152915b6020830151611690906001600160e01b03165b6001600160e01b031690565b9261169b8985612089565b9415908161175b575b50156116f9576116cc6116e3926116ba86611f22565b92600019019060005260206000200190565b9063ffffffff82549181199060201b169116179055565b604080519182526020820192909252a2386115b8565b506117569061171d61171861170d43611f8b565b65ffffffffffff1690565b611ff2565b9061175161172a86611f22565b611741611735611418565b63ffffffff9095168552565b6001600160e01b03166020840152565b6117aa565b6116e3565b5163ffffffff16905063ffffffff61177561170d43611f8b565b911614386116a4565b61179b61179660001984018360005260206000200190565b611453565b91611671565b508215156115a7565b805468010000000000000000811015611058576117cc91600182018155611425565b6117f357815160209283015190921b63ffffffff191663ffffffff92909216919091179055565b634e487b7160e01b600052600060045260246000fd5b9091815491821592836000146118a557611821611418565b60008152600060208201525b602081015161184f90611848906001600160e01b0316611684565b9687612096565b94159081611882575b501561186e576116cc611247926116ba86611f22565b506112479061171d61171861170d43611f8b565b5163ffffffff16905063ffffffff61189c61170d43611f8b565b91161438611858565b6118bd61179660001983018460005260206000200190565b61182d565b9161020d93916118d193611a19565b9190916118f9565b600511156118e357565b634e487b7160e01b600052602160045260246000fd5b611902816118d9565b8061190a5750565b611913816118d9565b600181036119605760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606490fd5b611969816118d9565b600281036119b65760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606490fd5b806119c26003926118d9565b146119c957565b60405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608490fd5b9291907f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311611a9c5791608094939160ff602094604051948552168484015260408301526060820152600093849182805260015afa15611a8f5781516001600160a01b03811615611a89579190565b50600190565b50604051903d90823e3d90fd5b50505050600090600390565b307f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03161480611b99575b15611b03577f000000000000000000000000000000000000000000000000000000000000000090565b60405160208101907f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f82527f000000000000000000000000000000000000000000000000000000000000000060408201527f000000000000000000000000000000000000000000000000000000000000000060608201524660808201523060a082015260a08152611b9381611079565b51902090565b507f00000000000000000000000000000000000000000000000000000000000000004614611ada565b604290611bcd611aa8565b906040519161190160f01b8352600283015260228201522090565b60ff8114611c265760ff811690601f8211611c145760405191611c0a8361103c565b8252602082015290565b604051632cd44ac360e21b8152600490fd5b50604051600554816000611c3983610fec565b80835292600190818116908115611cbf5750600114611c60575b5061020d92500382611095565b6005600090815291507f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db05b848310611ca4575061020d935050810160200138611c53565b81935090816020925483858901015201910190918492611c8b565b90506020925061020d94915060ff191682840152151560051b82010138611c53565b60ff8114611d035760ff811690601f8211611c145760405191611c0a8361103c565b50604051600654816000611d1683610fec565b80835292600190818116908115611cbf5750600114611d3c575061020d92500382611095565b6006600090815291507ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f5b848310611d80575061020d935050810160200138611c53565b81935090816020925483858901015201910190918492611d67565b8115611da5570490565b634e487b7160e01b600052601260045260246000fd5b90808216911860011c81018091116104fb5790565b8015611f0a5780611ea3611e9c611e92611e88611e7e611e74611e6a611e60600161020d9a6000908b60801c80611efe575b508060401c80611ef1575b508060201c80611ee4575b508060101c80611ed7575b508060081c80611eca575b508060041c80611ebd575b508060021c80611eb0575b50821c611ea9575b811c1b611e59818b611d9b565b0160011c90565b611e59818a611d9b565b611e598189611d9b565b611e598188611d9b565b611e598187611d9b565b611e598186611d9b565b611e598185611d9b565b8092611d9b565b90611f10565b8101611e4c565b6002915091019038611e44565b6004915091019038611e39565b6008915091019038611e2e565b6010915091019038611e23565b6020915091019038611e18565b6040915091019038611e0d565b91505060809038611e02565b50600090565b9080821015611f1d575090565b905090565b6001600160e01b0390818111611f36571690565b60405162461bcd60e51b815260206004820152602760248201527f53616665436173743a2076616c756520646f65736e27742066697420696e20326044820152663234206269747360c81b6064820152608490fd5b65ffffffffffff90818111611f9e571690565b60405162461bcd60e51b815260206004820152602660248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203460448201526538206269747360d01b6064820152608490fd5b63ffffffff90818111612003571690565b60405162461bcd60e51b815260206004820152602660248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203360448201526532206269747360d01b6064820152608490fd5b6001600160a01b039081166000908152600960205260408082205493831682529020546112479392908216911661158e565b9081039081116104fb5790565b9081018091116104fb579056fea2646970667358221220563db4143b38c671b803fb1f7ab32d04ee3e24211cf1195a726d47728fccc54c64736f6c63430008130033dec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a724a26469706673582212208ca201b334bc2e5514f0da3c748c65d31db5bfa7b2485e76ec5ef13997232e1c64736f6c63430008130033", } // TokenFactoryABI is the input ABI used to generate the binding from. // Deprecated: Use TokenFactoryMetaData.ABI instead. var TokenFactoryABI = TokenFactoryMetaData.ABI // TokenFactoryBin is the compiled bytecode used for deploying new contracts. // Deprecated: Use TokenFactoryMetaData.Bin instead. var TokenFactoryBin = TokenFactoryMetaData.Bin // DeployTokenFactory deploys a new Ethereum contract, binding an instance of TokenFactory to it. func DeployTokenFactory(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *TokenFactory, error) { parsed, err := TokenFactoryMetaData.GetAbi() if err != nil { return common.Address{}, nil, nil, err } if parsed == nil { return common.Address{}, nil, nil, errors.New("GetABI returned nil") } address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(TokenFactoryBin), backend) if err != nil { return common.Address{}, nil, nil, err } return address, tx, &TokenFactory{TokenFactoryCaller: TokenFactoryCaller{contract: contract}, TokenFactoryTransactor: TokenFactoryTransactor{contract: contract}, TokenFactoryFilterer: TokenFactoryFilterer{contract: contract}}, nil } // TokenFactory is an auto generated Go binding around an Ethereum contract. type TokenFactory struct { TokenFactoryCaller // Read-only binding to the contract TokenFactoryTransactor // Write-only binding to the contract TokenFactoryFilterer // Log filterer for contract events } // TokenFactoryCaller is an auto generated read-only Go binding around an Ethereum contract. type TokenFactoryCaller struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // TokenFactoryTransactor is an auto generated write-only Go binding around an Ethereum contract. type TokenFactoryTransactor struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // TokenFactoryFilterer is an auto generated log filtering Go binding around an Ethereum contract events. type TokenFactoryFilterer struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // TokenFactorySession is an auto generated Go binding around an Ethereum contract, // with pre-set call and transact options. type TokenFactorySession struct { Contract *TokenFactory // Generic contract binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // TokenFactoryCallerSession is an auto generated read-only Go binding around an Ethereum contract, // with pre-set call options. type TokenFactoryCallerSession struct { Contract *TokenFactoryCaller // Generic contract caller binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session } // TokenFactoryTransactorSession is an auto generated write-only Go binding around an Ethereum contract, // with pre-set transact options. type TokenFactoryTransactorSession struct { Contract *TokenFactoryTransactor // Generic contract transactor binding to set the session for TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // TokenFactoryRaw is an auto generated low-level Go binding around an Ethereum contract. type TokenFactoryRaw struct { Contract *TokenFactory // Generic contract binding to access the raw methods on } // TokenFactoryCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. type TokenFactoryCallerRaw struct { Contract *TokenFactoryCaller // Generic read-only contract binding to access the raw methods on } // TokenFactoryTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. type TokenFactoryTransactorRaw struct { Contract *TokenFactoryTransactor // Generic write-only contract binding to access the raw methods on } // NewTokenFactory creates a new instance of TokenFactory, bound to a specific deployed contract. func NewTokenFactory(address common.Address, backend bind.ContractBackend) (*TokenFactory, error) { contract, err := bindTokenFactory(address, backend, backend, backend) if err != nil { return nil, err } return &TokenFactory{TokenFactoryCaller: TokenFactoryCaller{contract: contract}, TokenFactoryTransactor: TokenFactoryTransactor{contract: contract}, TokenFactoryFilterer: TokenFactoryFilterer{contract: contract}}, nil } // NewTokenFactoryCaller creates a new read-only instance of TokenFactory, bound to a specific deployed contract. func NewTokenFactoryCaller(address common.Address, caller bind.ContractCaller) (*TokenFactoryCaller, error) { contract, err := bindTokenFactory(address, caller, nil, nil) if err != nil { return nil, err } return &TokenFactoryCaller{contract: contract}, nil } // NewTokenFactoryTransactor creates a new write-only instance of TokenFactory, bound to a specific deployed contract. func NewTokenFactoryTransactor(address common.Address, transactor bind.ContractTransactor) (*TokenFactoryTransactor, error) { contract, err := bindTokenFactory(address, nil, transactor, nil) if err != nil { return nil, err } return &TokenFactoryTransactor{contract: contract}, nil } // NewTokenFactoryFilterer creates a new log filterer instance of TokenFactory, bound to a specific deployed contract. func NewTokenFactoryFilterer(address common.Address, filterer bind.ContractFilterer) (*TokenFactoryFilterer, error) { contract, err := bindTokenFactory(address, nil, nil, filterer) if err != nil { return nil, err } return &TokenFactoryFilterer{contract: contract}, nil } // bindTokenFactory binds a generic wrapper to an already deployed contract. func bindTokenFactory(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { parsed, err := TokenFactoryMetaData.GetAbi() if err != nil { return nil, err } return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_TokenFactory *TokenFactoryRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _TokenFactory.Contract.TokenFactoryCaller.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_TokenFactory *TokenFactoryRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _TokenFactory.Contract.TokenFactoryTransactor.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_TokenFactory *TokenFactoryRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _TokenFactory.Contract.TokenFactoryTransactor.contract.Transact(opts, method, params...) } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_TokenFactory *TokenFactoryCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _TokenFactory.Contract.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_TokenFactory *TokenFactoryTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _TokenFactory.Contract.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_TokenFactory *TokenFactoryTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _TokenFactory.Contract.contract.Transact(opts, method, params...) } // CheckToken is a free data retrieval call binding the contract method 0xf1880b24. // // Solidity: function checkToken(address ) view returns(bool) func (_TokenFactory *TokenFactoryCaller) CheckToken(opts *bind.CallOpts, arg0 common.Address) (bool, error) { var out []interface{} err := _TokenFactory.contract.Call(opts, &out, "checkToken", arg0) if err != nil { return *new(bool), err } out0 := *abi.ConvertType(out[0], new(bool)).(*bool) return out0, err } // CheckToken is a free data retrieval call binding the contract method 0xf1880b24. // // Solidity: function checkToken(address ) view returns(bool) func (_TokenFactory *TokenFactorySession) CheckToken(arg0 common.Address) (bool, error) { return _TokenFactory.Contract.CheckToken(&_TokenFactory.CallOpts, arg0) } // CheckToken is a free data retrieval call binding the contract method 0xf1880b24. // // Solidity: function checkToken(address ) view returns(bool) func (_TokenFactory *TokenFactoryCallerSession) CheckToken(arg0 common.Address) (bool, error) { return _TokenFactory.Contract.CheckToken(&_TokenFactory.CallOpts, arg0) } // GetChainId is a free data retrieval call binding the contract method 0x3408e470. // // Solidity: function getChainId() view returns(uint256 chainId) func (_TokenFactory *TokenFactoryCaller) GetChainId(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} err := _TokenFactory.contract.Call(opts, &out, "getChainId") if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // GetChainId is a free data retrieval call binding the contract method 0x3408e470. // // Solidity: function getChainId() view returns(uint256 chainId) func (_TokenFactory *TokenFactorySession) GetChainId() (*big.Int, error) { return _TokenFactory.Contract.GetChainId(&_TokenFactory.CallOpts) } // GetChainId is a free data retrieval call binding the contract method 0x3408e470. // // Solidity: function getChainId() view returns(uint256 chainId) func (_TokenFactory *TokenFactoryCallerSession) GetChainId() (*big.Int, error) { return _TokenFactory.Contract.GetChainId(&_TokenFactory.CallOpts) } // GetPayoutFeeBalance is a free data retrieval call binding the contract method 0x5d6761e8. // // Solidity: function getPayoutFeeBalance(address , address ) view returns(uint256) func (_TokenFactory *TokenFactoryCaller) GetPayoutFeeBalance(opts *bind.CallOpts, arg0 common.Address, arg1 common.Address) (*big.Int, error) { var out []interface{} err := _TokenFactory.contract.Call(opts, &out, "getPayoutFeeBalance", arg0, arg1) if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // GetPayoutFeeBalance is a free data retrieval call binding the contract method 0x5d6761e8. // // Solidity: function getPayoutFeeBalance(address , address ) view returns(uint256) func (_TokenFactory *TokenFactorySession) GetPayoutFeeBalance(arg0 common.Address, arg1 common.Address) (*big.Int, error) { return _TokenFactory.Contract.GetPayoutFeeBalance(&_TokenFactory.CallOpts, arg0, arg1) } // GetPayoutFeeBalance is a free data retrieval call binding the contract method 0x5d6761e8. // // Solidity: function getPayoutFeeBalance(address , address ) view returns(uint256) func (_TokenFactory *TokenFactoryCallerSession) GetPayoutFeeBalance(arg0 common.Address, arg1 common.Address) (*big.Int, error) { return _TokenFactory.Contract.GetPayoutFeeBalance(&_TokenFactory.CallOpts, arg0, arg1) } // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. // // Solidity: function owner() view returns(address) func (_TokenFactory *TokenFactoryCaller) Owner(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _TokenFactory.contract.Call(opts, &out, "owner") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. // // Solidity: function owner() view returns(address) func (_TokenFactory *TokenFactorySession) Owner() (common.Address, error) { return _TokenFactory.Contract.Owner(&_TokenFactory.CallOpts) } // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. // // Solidity: function owner() view returns(address) func (_TokenFactory *TokenFactoryCallerSession) Owner() (common.Address, error) { return _TokenFactory.Contract.Owner(&_TokenFactory.CallOpts) } // CreateToken is a paid mutator transaction binding the contract method 0xfee74e28. // // Solidity: function createToken(uint256 tokenType, string name, string symbol, uint256 amount, address recipient, address payoutRecipient) returns() func (_TokenFactory *TokenFactoryTransactor) CreateToken(opts *bind.TransactOpts, tokenType *big.Int, name string, symbol string, amount *big.Int, recipient common.Address, payoutRecipient common.Address) (*types.Transaction, error) { return _TokenFactory.contract.Transact(opts, "createToken", tokenType, name, symbol, amount, recipient, payoutRecipient) } // CreateToken is a paid mutator transaction binding the contract method 0xfee74e28. // // Solidity: function createToken(uint256 tokenType, string name, string symbol, uint256 amount, address recipient, address payoutRecipient) returns() func (_TokenFactory *TokenFactorySession) CreateToken(tokenType *big.Int, name string, symbol string, amount *big.Int, recipient common.Address, payoutRecipient common.Address) (*types.Transaction, error) { return _TokenFactory.Contract.CreateToken(&_TokenFactory.TransactOpts, tokenType, name, symbol, amount, recipient, payoutRecipient) } // CreateToken is a paid mutator transaction binding the contract method 0xfee74e28. // // Solidity: function createToken(uint256 tokenType, string name, string symbol, uint256 amount, address recipient, address payoutRecipient) returns() func (_TokenFactory *TokenFactoryTransactorSession) CreateToken(tokenType *big.Int, name string, symbol string, amount *big.Int, recipient common.Address, payoutRecipient common.Address) (*types.Transaction, error) { return _TokenFactory.Contract.CreateToken(&_TokenFactory.TransactOpts, tokenType, name, symbol, amount, recipient, payoutRecipient) } // DepositFee is a paid mutator transaction binding the contract method 0x1c432455. // // Solidity: function depositFee(address token, address tokenFee, uint256 amountFee) returns(bool) func (_TokenFactory *TokenFactoryTransactor) DepositFee(opts *bind.TransactOpts, token common.Address, tokenFee common.Address, amountFee *big.Int) (*types.Transaction, error) { return _TokenFactory.contract.Transact(opts, "depositFee", token, tokenFee, amountFee) } // DepositFee is a paid mutator transaction binding the contract method 0x1c432455. // // Solidity: function depositFee(address token, address tokenFee, uint256 amountFee) returns(bool) func (_TokenFactory *TokenFactorySession) DepositFee(token common.Address, tokenFee common.Address, amountFee *big.Int) (*types.Transaction, error) { return _TokenFactory.Contract.DepositFee(&_TokenFactory.TransactOpts, token, tokenFee, amountFee) } // DepositFee is a paid mutator transaction binding the contract method 0x1c432455. // // Solidity: function depositFee(address token, address tokenFee, uint256 amountFee) returns(bool) func (_TokenFactory *TokenFactoryTransactorSession) DepositFee(token common.Address, tokenFee common.Address, amountFee *big.Int) (*types.Transaction, error) { return _TokenFactory.Contract.DepositFee(&_TokenFactory.TransactOpts, token, tokenFee, amountFee) } // Initialize is a paid mutator transaction binding the contract method 0x8129fc1c. // // Solidity: function initialize() returns() func (_TokenFactory *TokenFactoryTransactor) Initialize(opts *bind.TransactOpts) (*types.Transaction, error) { return _TokenFactory.contract.Transact(opts, "initialize") } // Initialize is a paid mutator transaction binding the contract method 0x8129fc1c. // // Solidity: function initialize() returns() func (_TokenFactory *TokenFactorySession) Initialize() (*types.Transaction, error) { return _TokenFactory.Contract.Initialize(&_TokenFactory.TransactOpts) } // Initialize is a paid mutator transaction binding the contract method 0x8129fc1c. // // Solidity: function initialize() returns() func (_TokenFactory *TokenFactoryTransactorSession) Initialize() (*types.Transaction, error) { return _TokenFactory.Contract.Initialize(&_TokenFactory.TransactOpts) } // Multicall is a paid mutator transaction binding the contract method 0xac9650d8. // // Solidity: function multicall(bytes[] data) payable returns(bytes[] results) func (_TokenFactory *TokenFactoryTransactor) Multicall(opts *bind.TransactOpts, data [][]byte) (*types.Transaction, error) { return _TokenFactory.contract.Transact(opts, "multicall", data) } // Multicall is a paid mutator transaction binding the contract method 0xac9650d8. // // Solidity: function multicall(bytes[] data) payable returns(bytes[] results) func (_TokenFactory *TokenFactorySession) Multicall(data [][]byte) (*types.Transaction, error) { return _TokenFactory.Contract.Multicall(&_TokenFactory.TransactOpts, data) } // Multicall is a paid mutator transaction binding the contract method 0xac9650d8. // // Solidity: function multicall(bytes[] data) payable returns(bytes[] results) func (_TokenFactory *TokenFactoryTransactorSession) Multicall(data [][]byte) (*types.Transaction, error) { return _TokenFactory.Contract.Multicall(&_TokenFactory.TransactOpts, data) } // RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. // // Solidity: function renounceOwnership() returns() func (_TokenFactory *TokenFactoryTransactor) RenounceOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { return _TokenFactory.contract.Transact(opts, "renounceOwnership") } // RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. // // Solidity: function renounceOwnership() returns() func (_TokenFactory *TokenFactorySession) RenounceOwnership() (*types.Transaction, error) { return _TokenFactory.Contract.RenounceOwnership(&_TokenFactory.TransactOpts) } // RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. // // Solidity: function renounceOwnership() returns() func (_TokenFactory *TokenFactoryTransactorSession) RenounceOwnership() (*types.Transaction, error) { return _TokenFactory.Contract.RenounceOwnership(&_TokenFactory.TransactOpts) } // TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. // // Solidity: function transferOwnership(address newOwner) returns() func (_TokenFactory *TokenFactoryTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) { return _TokenFactory.contract.Transact(opts, "transferOwnership", newOwner) } // TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. // // Solidity: function transferOwnership(address newOwner) returns() func (_TokenFactory *TokenFactorySession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { return _TokenFactory.Contract.TransferOwnership(&_TokenFactory.TransactOpts, newOwner) } // TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. // // Solidity: function transferOwnership(address newOwner) returns() func (_TokenFactory *TokenFactoryTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { return _TokenFactory.Contract.TransferOwnership(&_TokenFactory.TransactOpts, newOwner) } // TokenFactoryInitializedIterator is returned from FilterInitialized and is used to iterate over the raw logs and unpacked data for Initialized events raised by the TokenFactory contract. type TokenFactoryInitializedIterator struct { Event *TokenFactoryInitialized // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *TokenFactoryInitializedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(TokenFactoryInitialized) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(TokenFactoryInitialized) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *TokenFactoryInitializedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *TokenFactoryInitializedIterator) Close() error { it.sub.Unsubscribe() return nil } // TokenFactoryInitialized represents a Initialized event raised by the TokenFactory contract. type TokenFactoryInitialized struct { Version uint8 Raw types.Log // Blockchain specific contextual infos } // FilterInitialized is a free log retrieval operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. // // Solidity: event Initialized(uint8 version) func (_TokenFactory *TokenFactoryFilterer) FilterInitialized(opts *bind.FilterOpts) (*TokenFactoryInitializedIterator, error) { logs, sub, err := _TokenFactory.contract.FilterLogs(opts, "Initialized") if err != nil { return nil, err } return &TokenFactoryInitializedIterator{contract: _TokenFactory.contract, event: "Initialized", logs: logs, sub: sub}, nil } // WatchInitialized is a free log subscription operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. // // Solidity: event Initialized(uint8 version) func (_TokenFactory *TokenFactoryFilterer) WatchInitialized(opts *bind.WatchOpts, sink chan<- *TokenFactoryInitialized) (event.Subscription, error) { logs, sub, err := _TokenFactory.contract.WatchLogs(opts, "Initialized") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(TokenFactoryInitialized) if err := _TokenFactory.contract.UnpackLog(event, "Initialized", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseInitialized is a log parse operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. // // Solidity: event Initialized(uint8 version) func (_TokenFactory *TokenFactoryFilterer) ParseInitialized(log types.Log) (*TokenFactoryInitialized, error) { event := new(TokenFactoryInitialized) if err := _TokenFactory.contract.UnpackLog(event, "Initialized", log); err != nil { return nil, err } event.Raw = log return event, nil } // TokenFactoryOwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the TokenFactory contract. type TokenFactoryOwnershipTransferredIterator struct { Event *TokenFactoryOwnershipTransferred // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *TokenFactoryOwnershipTransferredIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(TokenFactoryOwnershipTransferred) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(TokenFactoryOwnershipTransferred) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *TokenFactoryOwnershipTransferredIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *TokenFactoryOwnershipTransferredIterator) Close() error { it.sub.Unsubscribe() return nil } // TokenFactoryOwnershipTransferred represents a OwnershipTransferred event raised by the TokenFactory contract. type TokenFactoryOwnershipTransferred struct { PreviousOwner common.Address NewOwner common.Address Raw types.Log // Blockchain specific contextual infos } // FilterOwnershipTransferred is a free log retrieval operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. // // Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) func (_TokenFactory *TokenFactoryFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*TokenFactoryOwnershipTransferredIterator, error) { var previousOwnerRule []interface{} for _, previousOwnerItem := range previousOwner { previousOwnerRule = append(previousOwnerRule, previousOwnerItem) } var newOwnerRule []interface{} for _, newOwnerItem := range newOwner { newOwnerRule = append(newOwnerRule, newOwnerItem) } logs, sub, err := _TokenFactory.contract.FilterLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) if err != nil { return nil, err } return &TokenFactoryOwnershipTransferredIterator{contract: _TokenFactory.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil } // WatchOwnershipTransferred is a free log subscription operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. // // Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) func (_TokenFactory *TokenFactoryFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *TokenFactoryOwnershipTransferred, previousOwner []common.Address, newOwner []common.Address) (event.Subscription, error) { var previousOwnerRule []interface{} for _, previousOwnerItem := range previousOwner { previousOwnerRule = append(previousOwnerRule, previousOwnerItem) } var newOwnerRule []interface{} for _, newOwnerItem := range newOwner { newOwnerRule = append(newOwnerRule, newOwnerItem) } logs, sub, err := _TokenFactory.contract.WatchLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(TokenFactoryOwnershipTransferred) if err := _TokenFactory.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseOwnershipTransferred is a log parse operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. // // Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) func (_TokenFactory *TokenFactoryFilterer) ParseOwnershipTransferred(log types.Log) (*TokenFactoryOwnershipTransferred, error) { event := new(TokenFactoryOwnershipTransferred) if err := _TokenFactory.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { return nil, err } event.Raw = log return event, nil } // TokenFactoryTokenCreatedIterator is returned from FilterTokenCreated and is used to iterate over the raw logs and unpacked data for TokenCreated events raised by the TokenFactory contract. type TokenFactoryTokenCreatedIterator struct { Event *TokenFactoryTokenCreated // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *TokenFactoryTokenCreatedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(TokenFactoryTokenCreated) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(TokenFactoryTokenCreated) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *TokenFactoryTokenCreatedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *TokenFactoryTokenCreatedIterator) Close() error { it.sub.Unsubscribe() return nil } // TokenFactoryTokenCreated represents a TokenCreated event raised by the TokenFactory contract. type TokenFactoryTokenCreated struct { Token common.Address Raw types.Log // Blockchain specific contextual infos } // FilterTokenCreated is a free log retrieval operation binding the contract event 0x2e2b3f61b70d2d131b2a807371103cc98d51adcaa5e9a8f9c32658ad8426e74e. // // Solidity: event TokenCreated(address token) func (_TokenFactory *TokenFactoryFilterer) FilterTokenCreated(opts *bind.FilterOpts) (*TokenFactoryTokenCreatedIterator, error) { logs, sub, err := _TokenFactory.contract.FilterLogs(opts, "TokenCreated") if err != nil { return nil, err } return &TokenFactoryTokenCreatedIterator{contract: _TokenFactory.contract, event: "TokenCreated", logs: logs, sub: sub}, nil } // WatchTokenCreated is a free log subscription operation binding the contract event 0x2e2b3f61b70d2d131b2a807371103cc98d51adcaa5e9a8f9c32658ad8426e74e. // // Solidity: event TokenCreated(address token) func (_TokenFactory *TokenFactoryFilterer) WatchTokenCreated(opts *bind.WatchOpts, sink chan<- *TokenFactoryTokenCreated) (event.Subscription, error) { logs, sub, err := _TokenFactory.contract.WatchLogs(opts, "TokenCreated") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(TokenFactoryTokenCreated) if err := _TokenFactory.contract.UnpackLog(event, "TokenCreated", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseTokenCreated is a log parse operation binding the contract event 0x2e2b3f61b70d2d131b2a807371103cc98d51adcaa5e9a8f9c32658ad8426e74e. // // Solidity: event TokenCreated(address token) func (_TokenFactory *TokenFactoryFilterer) ParseTokenCreated(log types.Log) (*TokenFactoryTokenCreated, error) { event := new(TokenFactoryTokenCreated) if err := _TokenFactory.contract.UnpackLog(event, "TokenCreated", log); err != nil { return nil, err } event.Raw = log return event, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/binds/transparentupgradeableproxy/TransparentUpgradeableProxy.go ================================================ // Code generated - DO NOT EDIT. // This file is a generated binding and any manual changes will be lost. package transparentupgradeableproxy import ( "errors" "math/big" "strings" ethereum "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/event" ) // Reference imports to suppress errors if they are not otherwise used. var ( _ = errors.New _ = big.NewInt _ = strings.NewReader _ = ethereum.NotFound _ = bind.Bind _ = common.Big1 _ = types.BloomLookup _ = event.NewSubscription _ = abi.ConvertType ) // TransparentUpgradeableProxyMetaData contains all meta data concerning the TransparentUpgradeableProxy contract. var TransparentUpgradeableProxyMetaData = &bind.MetaData{ ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_logic\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]", Bin: "0x60406080815262000c578038038062000018816200030b565b9283398101906060818303126200030657620000348162000347565b916020926200004584840162000347565b8584015190936001600160401b0391908282116200030657019280601f850112156200030657835193620000836200007d866200035c565b6200030b565b948086528786019288828401011162000306578288620000a4930162000378565b823b15620002ac577f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b03199081166001600160a01b0386811691821790935590959194600093909290917fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b8580a2805115801590620002a4575b620001f5575b50505050507fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103937f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f86865493815196818616885216958684820152a18315620001a3575016179055516108009081620004578239f35b60849086519062461bcd60e51b82526004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b6064820152fd5b895194606086019081118682101762000290578a52602785527f416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c89860152660819985a5b195960ca1b8a860152516200027a9493929183918291845af4903d1562000286573d6200026a6200007d826200035c565b90815280938a3d92013e6200039d565b5038808080806200012d565b606092506200039d565b634e487b7160e01b85526041600452602485fd5b508362000127565b865162461bcd60e51b815260048101879052602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608490fd5b600080fd5b6040519190601f01601f191682016001600160401b038111838210176200033157604052565b634e487b7160e01b600052604160045260246000fd5b51906001600160a01b03821682036200030657565b6001600160401b0381116200033157601f01601f191660200190565b60005b8381106200038c5750506000910152565b81810151838201526020016200037b565b91929015620004025750815115620003b3575090565b3b15620003bd5790565b60405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606490fd5b825190915015620004165750805190602001fd5b6044604051809262461bcd60e51b82526020600483015262000448815180928160248601526020868601910162000378565b601f01601f19168101030190fdfe60806040523661012e5760008051602061078b833981519152546001600160a01b03163303610129576000356001600160e01b031916631b2ce7f360e11b8103610054575061004c6103d1565b602081519101f35b63278f794360e11b8103610070575061006b610573565b61004c565b6308f2839760e41b8103610087575061006b6102fb565b6303e1469160e61b810361009e575061006b610220565b635c60da1b60e01b036100b35761006b610259565b60405162461bcd60e51b815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f78792074617267606482015261195d60f21b608482015260a490fd5b610171565b60008051602061078b833981519152546001600160a01b03163303610171576000356001600160e01b031916631b2ce7f360e11b8103610054575061004c6103d1565b6000805160206107ab83398151915254600090819081906001600160a01b0316368280378136915af43d82803e156101a7573d90f35b3d90fd5b634e487b7160e01b600052604160045260246000fd5b6040810190811067ffffffffffffffff8211176101dd57604052565b6101ab565b6020810190811067ffffffffffffffff8211176101dd57604052565b90601f8019910116810190811067ffffffffffffffff8211176101dd57604052565b610228610604565b60018060a01b0360008051602061078b833981519152541660405190602082015260208152610256816101c1565b90565b610261610604565b60018060a01b036000805160206107ab833981519152541660405190602082015260208152610256816101c1565b600435906001600160a01b03821682036102a557565b600080fd5b60209060031901126102a5576004356001600160a01b03811681036102a55790565b67ffffffffffffffff81116101dd57601f01601f191660200190565b604051906102f5826101e2565b60008252565b610303610604565b366004116102a5576001600160a01b038061031d366102aa565b1660008051602061078b833981519152917f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f604084549281519084168152846020820152a1811561037d576001600160a01b0319161790556102566102e8565b60405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b6064820152608490fd5b6103d9610604565b366004116102a5576001600160a01b036103f2366102aa565b1660405190610400826101e2565b60008252803b15610497576000805160206107ab83398151915280546001600160a01b03191682179055807fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b600080a281511580159061048f575b610475575b505060405161046e816101e2565b6000815290565b6104879161048161060b565b91610665565b503880610460565b50600061045b565b60405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608490fd5b803b15610497576000805160206107ab83398151915280546001600160a01b0319166001600160a01b0383169081179091557fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b600080a281511580159061056b575b61055c575050565b6105689161048161060b565b50565b506001610554565b366004116102a55760403660031901126102a55761058f61028f565b6024359067ffffffffffffffff82116102a557366023830112156102a5578160040135906105bc826102cc565b916105ca60405193846101fe565b80835236602482860101116102a55760208160009260246105fc970183870137840101526001600160a01b03166104f2565b6102566102e8565b346102a557565b604051906060820182811067ffffffffffffffff8211176101dd5760405260278252660819985a5b195960ca1b6040837f416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c60208201520152565b6000806102569493602081519101845af43d156106a4573d91610687836102cc565b9261069560405194856101fe565b83523d6000602085013e6106f8565b6060916106f8565b156106b357565b60405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606490fd5b91929015610718575081511561070c575090565b610256903b15156106ac565b82519091501561072b5750805190602001fd5b6040519062461bcd60e51b82528160208060048301528251908160248401526000935b828510610771575050604492506000838284010152601f80199101168101030190fd5b848101820151868601604401529381019385935061074e56feb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220ce4dee70e2db64d48c28483680cbc19eb1367f86c51b89d695de9dca45f4c55a64736f6c63430008130033", } // TransparentUpgradeableProxyABI is the input ABI used to generate the binding from. // Deprecated: Use TransparentUpgradeableProxyMetaData.ABI instead. var TransparentUpgradeableProxyABI = TransparentUpgradeableProxyMetaData.ABI // TransparentUpgradeableProxyBin is the compiled bytecode used for deploying new contracts. // Deprecated: Use TransparentUpgradeableProxyMetaData.Bin instead. var TransparentUpgradeableProxyBin = TransparentUpgradeableProxyMetaData.Bin // DeployTransparentUpgradeableProxy deploys a new Ethereum contract, binding an instance of TransparentUpgradeableProxy to it. func DeployTransparentUpgradeableProxy(auth *bind.TransactOpts, backend bind.ContractBackend, _logic common.Address, admin_ common.Address, _data []byte) (common.Address, *types.Transaction, *TransparentUpgradeableProxy, error) { parsed, err := TransparentUpgradeableProxyMetaData.GetAbi() if err != nil { return common.Address{}, nil, nil, err } if parsed == nil { return common.Address{}, nil, nil, errors.New("GetABI returned nil") } address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(TransparentUpgradeableProxyBin), backend, _logic, admin_, _data) if err != nil { return common.Address{}, nil, nil, err } return address, tx, &TransparentUpgradeableProxy{TransparentUpgradeableProxyCaller: TransparentUpgradeableProxyCaller{contract: contract}, TransparentUpgradeableProxyTransactor: TransparentUpgradeableProxyTransactor{contract: contract}, TransparentUpgradeableProxyFilterer: TransparentUpgradeableProxyFilterer{contract: contract}}, nil } // TransparentUpgradeableProxy is an auto generated Go binding around an Ethereum contract. type TransparentUpgradeableProxy struct { TransparentUpgradeableProxyCaller // Read-only binding to the contract TransparentUpgradeableProxyTransactor // Write-only binding to the contract TransparentUpgradeableProxyFilterer // Log filterer for contract events } // TransparentUpgradeableProxyCaller is an auto generated read-only Go binding around an Ethereum contract. type TransparentUpgradeableProxyCaller struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // TransparentUpgradeableProxyTransactor is an auto generated write-only Go binding around an Ethereum contract. type TransparentUpgradeableProxyTransactor struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // TransparentUpgradeableProxyFilterer is an auto generated log filtering Go binding around an Ethereum contract events. type TransparentUpgradeableProxyFilterer struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // TransparentUpgradeableProxySession is an auto generated Go binding around an Ethereum contract, // with pre-set call and transact options. type TransparentUpgradeableProxySession struct { Contract *TransparentUpgradeableProxy // Generic contract binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // TransparentUpgradeableProxyCallerSession is an auto generated read-only Go binding around an Ethereum contract, // with pre-set call options. type TransparentUpgradeableProxyCallerSession struct { Contract *TransparentUpgradeableProxyCaller // Generic contract caller binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session } // TransparentUpgradeableProxyTransactorSession is an auto generated write-only Go binding around an Ethereum contract, // with pre-set transact options. type TransparentUpgradeableProxyTransactorSession struct { Contract *TransparentUpgradeableProxyTransactor // Generic contract transactor binding to set the session for TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // TransparentUpgradeableProxyRaw is an auto generated low-level Go binding around an Ethereum contract. type TransparentUpgradeableProxyRaw struct { Contract *TransparentUpgradeableProxy // Generic contract binding to access the raw methods on } // TransparentUpgradeableProxyCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. type TransparentUpgradeableProxyCallerRaw struct { Contract *TransparentUpgradeableProxyCaller // Generic read-only contract binding to access the raw methods on } // TransparentUpgradeableProxyTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. type TransparentUpgradeableProxyTransactorRaw struct { Contract *TransparentUpgradeableProxyTransactor // Generic write-only contract binding to access the raw methods on } // NewTransparentUpgradeableProxy creates a new instance of TransparentUpgradeableProxy, bound to a specific deployed contract. func NewTransparentUpgradeableProxy(address common.Address, backend bind.ContractBackend) (*TransparentUpgradeableProxy, error) { contract, err := bindTransparentUpgradeableProxy(address, backend, backend, backend) if err != nil { return nil, err } return &TransparentUpgradeableProxy{TransparentUpgradeableProxyCaller: TransparentUpgradeableProxyCaller{contract: contract}, TransparentUpgradeableProxyTransactor: TransparentUpgradeableProxyTransactor{contract: contract}, TransparentUpgradeableProxyFilterer: TransparentUpgradeableProxyFilterer{contract: contract}}, nil } // NewTransparentUpgradeableProxyCaller creates a new read-only instance of TransparentUpgradeableProxy, bound to a specific deployed contract. func NewTransparentUpgradeableProxyCaller(address common.Address, caller bind.ContractCaller) (*TransparentUpgradeableProxyCaller, error) { contract, err := bindTransparentUpgradeableProxy(address, caller, nil, nil) if err != nil { return nil, err } return &TransparentUpgradeableProxyCaller{contract: contract}, nil } // NewTransparentUpgradeableProxyTransactor creates a new write-only instance of TransparentUpgradeableProxy, bound to a specific deployed contract. func NewTransparentUpgradeableProxyTransactor(address common.Address, transactor bind.ContractTransactor) (*TransparentUpgradeableProxyTransactor, error) { contract, err := bindTransparentUpgradeableProxy(address, nil, transactor, nil) if err != nil { return nil, err } return &TransparentUpgradeableProxyTransactor{contract: contract}, nil } // NewTransparentUpgradeableProxyFilterer creates a new log filterer instance of TransparentUpgradeableProxy, bound to a specific deployed contract. func NewTransparentUpgradeableProxyFilterer(address common.Address, filterer bind.ContractFilterer) (*TransparentUpgradeableProxyFilterer, error) { contract, err := bindTransparentUpgradeableProxy(address, nil, nil, filterer) if err != nil { return nil, err } return &TransparentUpgradeableProxyFilterer{contract: contract}, nil } // bindTransparentUpgradeableProxy binds a generic wrapper to an already deployed contract. func bindTransparentUpgradeableProxy(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { parsed, err := TransparentUpgradeableProxyMetaData.GetAbi() if err != nil { return nil, err } return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_TransparentUpgradeableProxy *TransparentUpgradeableProxyRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _TransparentUpgradeableProxy.Contract.TransparentUpgradeableProxyCaller.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_TransparentUpgradeableProxy *TransparentUpgradeableProxyRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _TransparentUpgradeableProxy.Contract.TransparentUpgradeableProxyTransactor.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_TransparentUpgradeableProxy *TransparentUpgradeableProxyRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _TransparentUpgradeableProxy.Contract.TransparentUpgradeableProxyTransactor.contract.Transact(opts, method, params...) } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_TransparentUpgradeableProxy *TransparentUpgradeableProxyCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _TransparentUpgradeableProxy.Contract.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_TransparentUpgradeableProxy *TransparentUpgradeableProxyTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _TransparentUpgradeableProxy.Contract.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_TransparentUpgradeableProxy *TransparentUpgradeableProxyTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _TransparentUpgradeableProxy.Contract.contract.Transact(opts, method, params...) } // Fallback is a paid mutator transaction binding the contract fallback function. // // Solidity: fallback() payable returns() func (_TransparentUpgradeableProxy *TransparentUpgradeableProxyTransactor) Fallback(opts *bind.TransactOpts, calldata []byte) (*types.Transaction, error) { return _TransparentUpgradeableProxy.contract.RawTransact(opts, calldata) } // Fallback is a paid mutator transaction binding the contract fallback function. // // Solidity: fallback() payable returns() func (_TransparentUpgradeableProxy *TransparentUpgradeableProxySession) Fallback(calldata []byte) (*types.Transaction, error) { return _TransparentUpgradeableProxy.Contract.Fallback(&_TransparentUpgradeableProxy.TransactOpts, calldata) } // Fallback is a paid mutator transaction binding the contract fallback function. // // Solidity: fallback() payable returns() func (_TransparentUpgradeableProxy *TransparentUpgradeableProxyTransactorSession) Fallback(calldata []byte) (*types.Transaction, error) { return _TransparentUpgradeableProxy.Contract.Fallback(&_TransparentUpgradeableProxy.TransactOpts, calldata) } // Receive is a paid mutator transaction binding the contract receive function. // // Solidity: receive() payable returns() func (_TransparentUpgradeableProxy *TransparentUpgradeableProxyTransactor) Receive(opts *bind.TransactOpts) (*types.Transaction, error) { return _TransparentUpgradeableProxy.contract.RawTransact(opts, nil) // calldata is disallowed for receive function } // Receive is a paid mutator transaction binding the contract receive function. // // Solidity: receive() payable returns() func (_TransparentUpgradeableProxy *TransparentUpgradeableProxySession) Receive() (*types.Transaction, error) { return _TransparentUpgradeableProxy.Contract.Receive(&_TransparentUpgradeableProxy.TransactOpts) } // Receive is a paid mutator transaction binding the contract receive function. // // Solidity: receive() payable returns() func (_TransparentUpgradeableProxy *TransparentUpgradeableProxyTransactorSession) Receive() (*types.Transaction, error) { return _TransparentUpgradeableProxy.Contract.Receive(&_TransparentUpgradeableProxy.TransactOpts) } // TransparentUpgradeableProxyAdminChangedIterator is returned from FilterAdminChanged and is used to iterate over the raw logs and unpacked data for AdminChanged events raised by the TransparentUpgradeableProxy contract. type TransparentUpgradeableProxyAdminChangedIterator struct { Event *TransparentUpgradeableProxyAdminChanged // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *TransparentUpgradeableProxyAdminChangedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(TransparentUpgradeableProxyAdminChanged) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(TransparentUpgradeableProxyAdminChanged) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *TransparentUpgradeableProxyAdminChangedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *TransparentUpgradeableProxyAdminChangedIterator) Close() error { it.sub.Unsubscribe() return nil } // TransparentUpgradeableProxyAdminChanged represents a AdminChanged event raised by the TransparentUpgradeableProxy contract. type TransparentUpgradeableProxyAdminChanged struct { PreviousAdmin common.Address NewAdmin common.Address Raw types.Log // Blockchain specific contextual infos } // FilterAdminChanged is a free log retrieval operation binding the contract event 0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f. // // Solidity: event AdminChanged(address previousAdmin, address newAdmin) func (_TransparentUpgradeableProxy *TransparentUpgradeableProxyFilterer) FilterAdminChanged(opts *bind.FilterOpts) (*TransparentUpgradeableProxyAdminChangedIterator, error) { logs, sub, err := _TransparentUpgradeableProxy.contract.FilterLogs(opts, "AdminChanged") if err != nil { return nil, err } return &TransparentUpgradeableProxyAdminChangedIterator{contract: _TransparentUpgradeableProxy.contract, event: "AdminChanged", logs: logs, sub: sub}, nil } // WatchAdminChanged is a free log subscription operation binding the contract event 0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f. // // Solidity: event AdminChanged(address previousAdmin, address newAdmin) func (_TransparentUpgradeableProxy *TransparentUpgradeableProxyFilterer) WatchAdminChanged(opts *bind.WatchOpts, sink chan<- *TransparentUpgradeableProxyAdminChanged) (event.Subscription, error) { logs, sub, err := _TransparentUpgradeableProxy.contract.WatchLogs(opts, "AdminChanged") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(TransparentUpgradeableProxyAdminChanged) if err := _TransparentUpgradeableProxy.contract.UnpackLog(event, "AdminChanged", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseAdminChanged is a log parse operation binding the contract event 0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f. // // Solidity: event AdminChanged(address previousAdmin, address newAdmin) func (_TransparentUpgradeableProxy *TransparentUpgradeableProxyFilterer) ParseAdminChanged(log types.Log) (*TransparentUpgradeableProxyAdminChanged, error) { event := new(TransparentUpgradeableProxyAdminChanged) if err := _TransparentUpgradeableProxy.contract.UnpackLog(event, "AdminChanged", log); err != nil { return nil, err } event.Raw = log return event, nil } // TransparentUpgradeableProxyBeaconUpgradedIterator is returned from FilterBeaconUpgraded and is used to iterate over the raw logs and unpacked data for BeaconUpgraded events raised by the TransparentUpgradeableProxy contract. type TransparentUpgradeableProxyBeaconUpgradedIterator struct { Event *TransparentUpgradeableProxyBeaconUpgraded // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *TransparentUpgradeableProxyBeaconUpgradedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(TransparentUpgradeableProxyBeaconUpgraded) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(TransparentUpgradeableProxyBeaconUpgraded) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *TransparentUpgradeableProxyBeaconUpgradedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *TransparentUpgradeableProxyBeaconUpgradedIterator) Close() error { it.sub.Unsubscribe() return nil } // TransparentUpgradeableProxyBeaconUpgraded represents a BeaconUpgraded event raised by the TransparentUpgradeableProxy contract. type TransparentUpgradeableProxyBeaconUpgraded struct { Beacon common.Address Raw types.Log // Blockchain specific contextual infos } // FilterBeaconUpgraded is a free log retrieval operation binding the contract event 0x1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e. // // Solidity: event BeaconUpgraded(address indexed beacon) func (_TransparentUpgradeableProxy *TransparentUpgradeableProxyFilterer) FilterBeaconUpgraded(opts *bind.FilterOpts, beacon []common.Address) (*TransparentUpgradeableProxyBeaconUpgradedIterator, error) { var beaconRule []interface{} for _, beaconItem := range beacon { beaconRule = append(beaconRule, beaconItem) } logs, sub, err := _TransparentUpgradeableProxy.contract.FilterLogs(opts, "BeaconUpgraded", beaconRule) if err != nil { return nil, err } return &TransparentUpgradeableProxyBeaconUpgradedIterator{contract: _TransparentUpgradeableProxy.contract, event: "BeaconUpgraded", logs: logs, sub: sub}, nil } // WatchBeaconUpgraded is a free log subscription operation binding the contract event 0x1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e. // // Solidity: event BeaconUpgraded(address indexed beacon) func (_TransparentUpgradeableProxy *TransparentUpgradeableProxyFilterer) WatchBeaconUpgraded(opts *bind.WatchOpts, sink chan<- *TransparentUpgradeableProxyBeaconUpgraded, beacon []common.Address) (event.Subscription, error) { var beaconRule []interface{} for _, beaconItem := range beacon { beaconRule = append(beaconRule, beaconItem) } logs, sub, err := _TransparentUpgradeableProxy.contract.WatchLogs(opts, "BeaconUpgraded", beaconRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(TransparentUpgradeableProxyBeaconUpgraded) if err := _TransparentUpgradeableProxy.contract.UnpackLog(event, "BeaconUpgraded", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseBeaconUpgraded is a log parse operation binding the contract event 0x1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e. // // Solidity: event BeaconUpgraded(address indexed beacon) func (_TransparentUpgradeableProxy *TransparentUpgradeableProxyFilterer) ParseBeaconUpgraded(log types.Log) (*TransparentUpgradeableProxyBeaconUpgraded, error) { event := new(TransparentUpgradeableProxyBeaconUpgraded) if err := _TransparentUpgradeableProxy.contract.UnpackLog(event, "BeaconUpgraded", log); err != nil { return nil, err } event.Raw = log return event, nil } // TransparentUpgradeableProxyUpgradedIterator is returned from FilterUpgraded and is used to iterate over the raw logs and unpacked data for Upgraded events raised by the TransparentUpgradeableProxy contract. type TransparentUpgradeableProxyUpgradedIterator struct { Event *TransparentUpgradeableProxyUpgraded // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *TransparentUpgradeableProxyUpgradedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(TransparentUpgradeableProxyUpgraded) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(TransparentUpgradeableProxyUpgraded) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *TransparentUpgradeableProxyUpgradedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *TransparentUpgradeableProxyUpgradedIterator) Close() error { it.sub.Unsubscribe() return nil } // TransparentUpgradeableProxyUpgraded represents a Upgraded event raised by the TransparentUpgradeableProxy contract. type TransparentUpgradeableProxyUpgraded struct { Implementation common.Address Raw types.Log // Blockchain specific contextual infos } // FilterUpgraded is a free log retrieval operation binding the contract event 0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b. // // Solidity: event Upgraded(address indexed implementation) func (_TransparentUpgradeableProxy *TransparentUpgradeableProxyFilterer) FilterUpgraded(opts *bind.FilterOpts, implementation []common.Address) (*TransparentUpgradeableProxyUpgradedIterator, error) { var implementationRule []interface{} for _, implementationItem := range implementation { implementationRule = append(implementationRule, implementationItem) } logs, sub, err := _TransparentUpgradeableProxy.contract.FilterLogs(opts, "Upgraded", implementationRule) if err != nil { return nil, err } return &TransparentUpgradeableProxyUpgradedIterator{contract: _TransparentUpgradeableProxy.contract, event: "Upgraded", logs: logs, sub: sub}, nil } // WatchUpgraded is a free log subscription operation binding the contract event 0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b. // // Solidity: event Upgraded(address indexed implementation) func (_TransparentUpgradeableProxy *TransparentUpgradeableProxyFilterer) WatchUpgraded(opts *bind.WatchOpts, sink chan<- *TransparentUpgradeableProxyUpgraded, implementation []common.Address) (event.Subscription, error) { var implementationRule []interface{} for _, implementationItem := range implementation { implementationRule = append(implementationRule, implementationItem) } logs, sub, err := _TransparentUpgradeableProxy.contract.WatchLogs(opts, "Upgraded", implementationRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(TransparentUpgradeableProxyUpgraded) if err := _TransparentUpgradeableProxy.contract.UnpackLog(event, "Upgraded", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseUpgraded is a log parse operation binding the contract event 0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b. // // Solidity: event Upgraded(address indexed implementation) func (_TransparentUpgradeableProxy *TransparentUpgradeableProxyFilterer) ParseUpgraded(log types.Log) (*TransparentUpgradeableProxyUpgraded, error) { event := new(TransparentUpgradeableProxyUpgraded) if err := _TransparentUpgradeableProxy.contract.UnpackLog(event, "Upgraded", log); err != nil { return nil, err } event.Raw = log return event, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/binds/transparentupgradeableproxyzk/TransparentUpgradeableProxy.go ================================================ // Code generated - DO NOT EDIT. // This file is a generated binding and any manual changes will be lost. package transparentupgradeableproxyzk import ( "errors" "math/big" "strings" ethereum "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/event" ) // Reference imports to suppress errors if they are not otherwise used. var ( _ = errors.New _ = big.NewInt _ = strings.NewReader _ = ethereum.NotFound _ = bind.Bind _ = common.Big1 _ = types.BloomLookup _ = event.NewSubscription _ = abi.ConvertType ) // TransparentUpgradeableProxyMetaData contains all meta data concerning the TransparentUpgradeableProxy contract. var TransparentUpgradeableProxyMetaData = &bind.MetaData{ ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_logic\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]", Bin: "0x0002000000000002000600000000000200000000030100190000006003300270000001110330019700010000003103550000000100200190000000210000c13d000000000431034f0000008002000039000000400020043f00000000060004110000012105000041000000000705041a0000011405700197000000000003004b000000c90000c13d000000000056004b000000da0000c13d000000000101043b0000012501100197000001260010009c000001690000a13d000001270010009c000001f20000613d000001280010009c000002400000613d000001290010009c000001e40000c13d0000000001000416000000000001004b000001f80000613d000002400000013d0000001f0230003900000112022001970000008002200039000000400020043f0000001f0430018f000001130530019800000080025000390000002f0000613d0000008006000039000000000701034f000000007807043c0000000006860436000000000026004b0000002b0000c13d000000000004004b0000003c0000613d000000000151034f0000000304400210000000000502043300000000054501cf000000000545022f000000000101043b0000010004400089000000000141022f00000000014101cf000000000151019f0000000000120435000000600030008c000002400000413d000000800700043d000001140070009c000002400000213d000000a00600043d000001140060009c000002400000213d000000c00200043d000001150020009c000002400000213d0000001f01200039000000000031004b000000000400001900000116040080410000011601100197000000000001004b00000000050000190000011605004041000001160010009c000000000504c019000000000005004b000002400000c13d00000080012000390000000001010433000001150010009c000002860000213d0000001f0410003900000141044001970000003f044000390000014104400197000000400800043d0000000004480019000000000084004b00000000050000390000000105004039000001150040009c000002860000213d0000000100500190000002860000c13d0000008003300039000000400040043f0000000009180436000000a0022000390000000004210019000000000034004b000002400000213d000400000008001d000500000006001d000000000001004b000000770000613d000000000300001900000000049300190000000005230019000000000505043300000000005404350000002003300039000000000013004b000000700000413d000300000009001d0000000001190019000000000001043500000117010000410000000000100443000600000007001d00000004007004430000000001000414000001110010009c0000011101008041000000c00110021000000118011001c70000800202000039044004360000040f0000000100200190000003b90000613d000000000101043b000000000001004b000002550000613d000000060100002900000114051001970000011901000041000000000201041a0000011a02200197000000000252019f000000000021041b0000000001000414000001110010009c0000011101008041000000c0011002100000011b011001c70000800d0200003900000002030000390000011c04000041044004310000040f00000006040000290000000100200190000000050200002900000004050000290000000306000029000002400000613d0000000001050433000000000001004b000002a60000c13d0000012101000041000000000301041a0000011404200197000000400100043d0000002002100039000600000004001d0000000000420435000500000003001d00000114023001970000000000210435000001110010009c000001110100804100000040011002100000000002000414000001110020009c0000011102008041000000c002200210000000000112019f00000122011001c70000800d0200003900000001030000390000012304000041044004310000040f0000000100200190000002400000613d0000000602000029000000000002004b0000022d0000613d00000005010000290000011a01100197000000000121019f0000012102000041000000000012041b0000002001000039000001000010044300000120000004430000012401000041000004410001042e000000000056004b000000eb0000c13d000000000401043b0000012504400197000001260040009c0000016e0000a13d000001270040009c000001ff0000613d000001280040009c000002110000613d000001290040009c000001e40000c13d0000000001000416000000000001004b000002400000c13d000000a00050043f000002060000013d0000011901000041000000000201041a00000000010004140000011402200197000000040020008c0000011f0000c13d000000000100003100000141021001980000001f0310018f000001110000613d000000000504034f0000000006000019000000005705043c0000000006760436000000000026004b000000e60000c13d000001110000013d0000001f0630018f0000011902000041000000000202041a0000011305300198000000f60000613d000000000701034f0000000008000019000000007907043c0000000008980436000000000058004b000000f20000c13d0000011402200197000000000006004b000001040000613d000000000151034f0000000306600210000000000705043300000000076701cf000000000767022f000000000101043b0000010006600089000000000161022f00000000016101cf000000000171019f00000000001504350000000001000414000000040020008c000001420000c13d000000000100003100000141021001980000001f0310018f000001110000613d000000000504034f0000000006000019000000005705043c0000000006760436000000000026004b0000010d0000c13d000000000003004b000001650000613d000000000424034f0000000303300210000000000502043300000000053501cf000000000535022f000000000404043b0000010003300089000000000434022f00000000033401cf000000000353019f0000000000320435000001650000013d000001110010009c0000011101008041000000c0011002100440043b0000040f0001000000010355000000000301001900000060033002700000001f0530018f000001110030019d0000011304300198000001300000613d000000000601034f0000000007000019000000006806043c0000000007870436000000000047004b0000012c0000c13d000000000005004b0000013d0000613d000000000141034f0000000305500210000000000604043300000000065601cf000000000656022f000000000101043b0000010005500089000000000151022f00000000015101cf000000000161019f000000000014043500000111013001970000000100200190000001650000c13d000000600110021000000442000104300000006003300210000001110010009c0000011101008041000000c001100210000000000131019f0440043b0000040f0001000000010355000000000301001900000060033002700000001f0530018f000001110030019d0000011304300198000001550000613d000000000601034f0000000007000019000000006806043c0000000007870436000000000047004b000001510000c13d000000000005004b000001620000613d000000000141034f0000000305500210000000000604043300000000065601cf000000000656022f000000000101043b0000010005500089000000000151022f00000000015101cf000000000161019f000000000014043500000111013001970000000100200190000001400000613d000001110010009c00000111010080410000006001100210000004410001042e0000012a0010009c000002400000613d0000012b0010009c000002400000613d000001e40000013d0000012a0040009c000002370000613d0000012b0040009c000001e40000c13d000000440030008c000002400000413d0000000402100370000000000902043b000001140090009c000002400000213d0000002402100370000000000402043b000001150040009c000002400000213d0000002302400039000000000032004b000002400000813d0000000405400039000000000251034f000000000202043b000001150020009c000002860000213d0000001f0620003900000141066001970000003f066000390000014106600197000001320060009c000002860000213d0000008006600039000000400060043f000000800020043f00000000042400190000002404400039000000000034004b000002400000213d0000002003500039000000000331034f00000141042001980000001f0520018f000000a0014000390000019d0000613d000000a006000039000000000703034f000000007807043c0000000006860436000000000016004b000001990000c13d000000000005004b000001aa0000613d000000000343034f0000000304500210000000000501043300000000054501cf000000000545022f000000000303043b0000010004400089000000000343022f00000000034301cf000000000353019f0000000000310435000000a001200039000000000001043500000117010000410000000000100443000600000009001d00000004009004430000000001000414000001110010009c0000011101008041000000c00110021000000118011001c70000800202000039044004360000040f0000000100200190000003b90000613d000000000101043b000000000001004b000002550000613d0000011901000041000000000201041a0000011a0220019700000006022001af0000000605000029000000000021041b0000000001000414000001110010009c0000011101008041000000c0011002100000011b011001c70000800d0200003900000002030000390000011c04000041044004310000040f00000006030000290000000100200190000002400000613d000000400100043d000500000001001d0000011d0010009c000002860000213d00000005040000290000006001400039000000400010043f00000040014000390000011e020000410000000000210435000000270100003900000000021404360000011f01000041000400000002001d0000000000120435000000800200043d0000000001000414000000040030008c000003ba0000c13d00000001020000390000000004000031000003c90000013d0000012001000041000000800010043f0000002001000039000000840010043f0000004201000039000000a40010043f0000013d01000041000000c40010043f0000013e01000041000000e40010043f0000013f01000041000001040010043f000001400100004100000442000104300000000001000416000000000001004b000002400000c13d0000011901000041000000000101041a0000011405100197000000a00050043f0000002001000039000000800010043f000000c001000039000000400010043f0000013c01000041000004410001042e0000000001000416000000000001004b000002400000c13d0000011901000041000000000101041a0000011401100197000000a00010043f0000002001000039000000800010043f000000c001000039000000400010043f0000012c01000041000001360020009c00000136020080410000004002200210000001370220009a000000000112019f000004410001042e000000240030008c000002400000413d0000000002000416000000000002004b000002400000c13d0000000401100370000000000201043b000001140020009c000002400000213d000000800050043f000000a00020043f0000000001000414000001110010009c0000011101008041000000c0011002100000012d011001c7000500000002001d0000800d0200003900000001030000390000012304000041000600000007001d044004310000040f000000060100002900000001002001900000000502000029000002400000613d000000000002004b000002690000c13d000000400100043d00000064021000390000012f030000410000000000320435000000440210003900000130030000410000000000320435000000240210003900000026030000390000025e0000013d000000240030008c000002400000413d0000000002000416000000000002004b000002400000c13d0000000401100370000000000201043b000001140020009c000002420000a13d00000000010000190000044200010430000000a001000039000000400010043f000000800000043f00000117010000410000000000100443000600000002001d00000004002004430000000001000414000001110010009c0000011101008041000000c00110021000000118011001c70000800202000039044004360000040f0000000100200190000003b90000613d000000000101043b000000000001004b0000026e0000c13d000000400100043d00000064021000390000013a03000041000000000032043500000044021000390000013b03000041000000000032043500000024021000390000002d03000039000000000032043500000120020000410000000000210435000000040210003900000020030000390000000000320435000001110010009c0000011101008041000000400110021000000131011001c700000442000104300000011a01100197000000000112019f0000012102000041000000000012041b000002830000013d0000011901000041000000000201041a0000011a0220019700000006022001af0000000605000029000000000021041b0000000001000414000001110010009c0000011101008041000000c0011002100000011b011001c70000800d0200003900000002030000390000011c04000041044004310000040f00000006030000290000000100200190000002400000613d000000800100043d000000000001004b000002910000c13d000000400200043d0000012e0020009c0000028c0000a13d0000013801000041000000000010043f0000004101000039000000040010043f000001390100004100000442000104300000002001200039000000400010043f000000000002043500000000010000190000020b0000013d000000400400043d0000011d0040009c000002860000213d0000006001400039000000400010043f00000040014000390000011e0200004100000000002104350000002701000039000400000004001d00000000021404360000011f01000041000500000002001d0000000000120435000000800200043d0000000001000414000000040030008c000002bb0000c13d00000001020000390000000004000031000002ca0000013d000000400300043d0000011d0030009c000002860000213d0000006001300039000000400010043f00000040013000390000011e0200004100000000002104350000002701000039000200000003001d00000000021304360000011f01000041000100000002001d000000000012043500000000020504330000000001000414000000040040008c000003200000c13d00000001020000390000000004000031000003320000013d000001110020009c00000111020080410000006002200210000001110010009c0000011101008041000000c001100210000000000121019f00000133011001c700000000020300190440043b0000040f000000010220018f00010000000103550000006001100270000001110010019d0000011104100197000000000004004b000002f60000c13d000000600100003900000080030000390000000001010433000000000002004b000003810000c13d000000000001004b000003e90000c13d000000400100043d0000012002000041000000000021043500000004021000390000002003000039000000000032043500000004020000290000000002020433000000240310003900000000002304350000004403100039000000000002004b0000000507000029000002e90000613d000000000400001900000000053400190000000006740019000000000606043300000000006504350000002004400039000000000024004b000002e20000413d0000001f042000390000014104400197000000000232001900000000000204350000004402400039000001110020009c00000111020080410000006002200210000001110010009c00000111010080410000004001100210000000000112019f0000044200010430000001150040009c000002860000213d0000001f0140003900000141011001970000003f011000390000014103100197000000400100043d0000000003310019000000000013004b00000000060000390000000106004039000001150030009c000002860000213d0000000100600190000002860000c13d000000400030043f000000000341043600000141054001980000001f0640018f00000000045300190000000107000367000003120000613d000000000807034f0000000009030019000000008a08043c0000000009a90436000000000049004b0000030e0000c13d000000000006004b000002ce0000613d000000000557034f0000000306600210000000000704043300000000076701cf000000000767022f000000000505043b0000010006600089000000000565022f00000000056501cf000000000575019f0000000000540435000002ce0000013d000001110060009c00000111060080410000004003600210000001110020009c00000111020080410000006002200210000000000232019f000001110010009c0000011101008041000000c001100210000000000112019f00000000020400190440043b0000040f000000010220018f00010000000103550000006001100270000001110010019d0000011104100197000000000004004b000003570000c13d000000600100003900000080030000390000000001010433000000000002004b000003940000c13d000000000001004b000003e90000c13d000000400400043d000600000004001d0000012001000041000000000014043500000004014000390000002002000039000000000021043500000002010000290000000003010433000500000003001d0000002401400039000000000031043500000044024000390000000101000029044004230000040f00000005010000290000001f0110003900000141011001970000004401100039000001110010009c00000111010080410000000602000029000001110020009c000001110200804100000060011002100000004002200210000000000121019f0000044200010430000001150040009c000002860000213d0000001f0140003900000141011001970000003f011000390000014103100197000000400100043d0000000003310019000000000013004b00000000050000390000000105004039000001150030009c000002860000213d0000000100500190000002860000c13d000000400030043f000000000341043600000141054001980000001f0640018f00000000045300190000000107000367000003730000613d000000000807034f0000000009030019000000008a08043c0000000009a90436000000000049004b0000036f0000c13d000000000006004b000003360000613d000000000557034f0000000306600210000000000704043300000000076701cf000000000767022f000000000505043b0000010006600089000000000565022f00000000056501cf000000000575019f0000000000540435000003360000013d000000000001004b0000000602000029000002830000c13d0000011701000041000000000010044300000004002004430000000001000414000001110010009c0000011101008041000000c00110021000000118011001c70000800202000039044004360000040f0000000100200190000003b90000613d000000000101043b000000000001004b000002830000c13d000003a80000013d000000000001004b00000005020000290000000603000029000000a30000c13d0000011701000041000000000010044300000004003004430000000001000414000001110010009c0000011101008041000000c00110021000000118011001c70000800202000039044004360000040f0000000100200190000003b90000613d000000000101043b000000000001004b0000000502000029000000a30000c13d000000400100043d00000044021000390000013403000041000000000032043500000024021000390000001d03000039000000000032043500000120020000410000000000210435000000040210003900000020030000390000000000320435000001110010009c0000011101008041000000400110021000000135011001c70000044200010430000000000001042f000001110020009c00000111020080410000006002200210000001110010009c0000011101008041000000c001100210000000000121019f00000133011001c700000006020000290440043b0000040f000000010220018f00010000000103550000006001100270000001110010019d0000011104100197000000000004004b000003f10000c13d000000600100003900000080030000390000000001010433000000000002004b0000041b0000c13d000000000001004b000003e90000c13d000000400100043d0000012002000041000000000021043500000004021000390000002003000039000000000032043500000005020000290000000002020433000000240310003900000000002304350000004403100039000000000002004b0000000407000029000002e90000613d000000000400001900000000053400190000000006740019000000000606043300000000006504350000002004400039000000000024004b000003e10000413d000002e90000013d000001110030009c00000111030080410000004002300210000001110010009c00000111010080410000006001100210000000000121019f0000044200010430000001150040009c000002860000213d0000001f0140003900000141011001970000003f011000390000014103100197000000400100043d0000000003310019000000000013004b00000000050000390000000105004039000001150030009c000002860000213d0000000100500190000002860000c13d000000400030043f000000000341043600000141054001980000001f0640018f000000000453001900000001070003670000040d0000613d000000000807034f0000000009030019000000008a08043c0000000009a90436000000000049004b000004090000c13d000000000006004b000003cd0000613d000000000557034f0000000306600210000000000704043300000000076701cf000000000767022f000000000505043b0000010006600089000000000565022f00000000056501cf000000000575019f0000000000540435000003cd0000013d000000000001004b000002830000c13d00000117010000410000000000100443000000060100002900000004001004430000000001000414000003880000013d000000000003004b0000042d0000613d000000000400001900000000052400190000000006140019000000000606043300000000006504350000002004400039000000000034004b000004260000413d00000000012300190000000000010435000000000001042d000000000001042f00000434002104210000000102000039000000000001042d0000000002000019000000000001042d00000439002104230000000102000039000000000001042d0000000002000019000000000001042d0000043e002104250000000102000039000000000001042d0000000002000019000000000001042d0000044000000432000004410001042e0000044200010430000000000000000000000000000000000000000000000000000000000000000000000000ffffffff00000000000000000000000000000000000000000000000000000001ffffffe000000000000000000000000000000000000000000000000000000000ffffffe0000000000000000000000000ffffffffffffffffffffffffffffffffffffffff000000000000000000000000000000000000000000000000ffffffffffffffff80000000000000000000000000000000000000000000000000000000000000001806aa1896bbf26568e884a7374b41e002500962caba6a15023a8d90e8508b830200000200000000000000000000000000000024000000000000000000000000360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbcffffffffffffffffffffffff00000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000bc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b000000000000000000000000000000000000000000000000ffffffffffffff9f206661696c656400000000000000000000000000000000000000000000000000416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c08c379a000000000000000000000000000000000000000000000000000000000b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610302000000000000000000000000000000000000400000000000000000000000007e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f0000000200000000000000000000000000000040000001000000000000000000ffffffff000000000000000000000000000000000000000000000000000000005c60da1affffffffffffffffffffffffffffffffffffffffffffffffffffffff5c60da1b000000000000000000000000000000000000000000000000000000008f28397000000000000000000000000000000000000000000000000000000000f851a440000000000000000000000000000000000000000000000000000000003659cfe6000000000000000000000000000000000000000000000000000000004f1ef2860000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000200000000000000000000000000000000000040000000800000000000000000000000000000000000000000000000000000000000000000ffffffffffffffdf6464726573730000000000000000000000000000000000000000000000000000455243313936373a206e65772061646d696e20697320746865207a65726f20610000000000000000000000000000000000000084000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffff7f0000000000000000000000000000000000000000000000a00000000000000000416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000000000000000000000000000000000000000006400000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffdfffffffffffffffffffffffffffffffffffffffffffffffe000000000000000004e487b710000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000240000000000000000000000006f74206120636f6e747261637400000000000000000000000000000000000000455243313936373a206e657720696d706c656d656e746174696f6e206973206e0000000000000000000000000000000000000020000000a000000000000000005472616e73706172656e745570677261646561626c6550726f78793a2061646d696e2063616e6e6f742066616c6c6261636b20746f2070726f78792074617267657400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a4000000800000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0c21326779f75d6ff50c3b578d79f735cb77101ab9ede957a960e1a47acfe26e8", } // TransparentUpgradeableProxyABI is the input ABI used to generate the binding from. // Deprecated: Use TransparentUpgradeableProxyMetaData.ABI instead. var TransparentUpgradeableProxyABI = TransparentUpgradeableProxyMetaData.ABI // TransparentUpgradeableProxyBin is the compiled bytecode used for deploying new contracts. // Deprecated: Use TransparentUpgradeableProxyMetaData.Bin instead. var TransparentUpgradeableProxyBin = TransparentUpgradeableProxyMetaData.Bin // DeployTransparentUpgradeableProxy deploys a new Ethereum contract, binding an instance of TransparentUpgradeableProxy to it. func DeployTransparentUpgradeableProxy(auth *bind.TransactOpts, backend bind.ContractBackend, _logic common.Address, admin_ common.Address, _data []byte) (common.Address, *types.Transaction, *TransparentUpgradeableProxy, error) { parsed, err := TransparentUpgradeableProxyMetaData.GetAbi() if err != nil { return common.Address{}, nil, nil, err } if parsed == nil { return common.Address{}, nil, nil, errors.New("GetABI returned nil") } address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(TransparentUpgradeableProxyBin), backend, _logic, admin_, _data) if err != nil { return common.Address{}, nil, nil, err } return address, tx, &TransparentUpgradeableProxy{TransparentUpgradeableProxyCaller: TransparentUpgradeableProxyCaller{contract: contract}, TransparentUpgradeableProxyTransactor: TransparentUpgradeableProxyTransactor{contract: contract}, TransparentUpgradeableProxyFilterer: TransparentUpgradeableProxyFilterer{contract: contract}}, nil } // TransparentUpgradeableProxy is an auto generated Go binding around an Ethereum contract. type TransparentUpgradeableProxy struct { TransparentUpgradeableProxyCaller // Read-only binding to the contract TransparentUpgradeableProxyTransactor // Write-only binding to the contract TransparentUpgradeableProxyFilterer // Log filterer for contract events } // TransparentUpgradeableProxyCaller is an auto generated read-only Go binding around an Ethereum contract. type TransparentUpgradeableProxyCaller struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // TransparentUpgradeableProxyTransactor is an auto generated write-only Go binding around an Ethereum contract. type TransparentUpgradeableProxyTransactor struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // TransparentUpgradeableProxyFilterer is an auto generated log filtering Go binding around an Ethereum contract events. type TransparentUpgradeableProxyFilterer struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // TransparentUpgradeableProxySession is an auto generated Go binding around an Ethereum contract, // with pre-set call and transact options. type TransparentUpgradeableProxySession struct { Contract *TransparentUpgradeableProxy // Generic contract binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // TransparentUpgradeableProxyCallerSession is an auto generated read-only Go binding around an Ethereum contract, // with pre-set call options. type TransparentUpgradeableProxyCallerSession struct { Contract *TransparentUpgradeableProxyCaller // Generic contract caller binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session } // TransparentUpgradeableProxyTransactorSession is an auto generated write-only Go binding around an Ethereum contract, // with pre-set transact options. type TransparentUpgradeableProxyTransactorSession struct { Contract *TransparentUpgradeableProxyTransactor // Generic contract transactor binding to set the session for TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // TransparentUpgradeableProxyRaw is an auto generated low-level Go binding around an Ethereum contract. type TransparentUpgradeableProxyRaw struct { Contract *TransparentUpgradeableProxy // Generic contract binding to access the raw methods on } // TransparentUpgradeableProxyCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. type TransparentUpgradeableProxyCallerRaw struct { Contract *TransparentUpgradeableProxyCaller // Generic read-only contract binding to access the raw methods on } // TransparentUpgradeableProxyTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. type TransparentUpgradeableProxyTransactorRaw struct { Contract *TransparentUpgradeableProxyTransactor // Generic write-only contract binding to access the raw methods on } // NewTransparentUpgradeableProxy creates a new instance of TransparentUpgradeableProxy, bound to a specific deployed contract. func NewTransparentUpgradeableProxy(address common.Address, backend bind.ContractBackend) (*TransparentUpgradeableProxy, error) { contract, err := bindTransparentUpgradeableProxy(address, backend, backend, backend) if err != nil { return nil, err } return &TransparentUpgradeableProxy{TransparentUpgradeableProxyCaller: TransparentUpgradeableProxyCaller{contract: contract}, TransparentUpgradeableProxyTransactor: TransparentUpgradeableProxyTransactor{contract: contract}, TransparentUpgradeableProxyFilterer: TransparentUpgradeableProxyFilterer{contract: contract}}, nil } // NewTransparentUpgradeableProxyCaller creates a new read-only instance of TransparentUpgradeableProxy, bound to a specific deployed contract. func NewTransparentUpgradeableProxyCaller(address common.Address, caller bind.ContractCaller) (*TransparentUpgradeableProxyCaller, error) { contract, err := bindTransparentUpgradeableProxy(address, caller, nil, nil) if err != nil { return nil, err } return &TransparentUpgradeableProxyCaller{contract: contract}, nil } // NewTransparentUpgradeableProxyTransactor creates a new write-only instance of TransparentUpgradeableProxy, bound to a specific deployed contract. func NewTransparentUpgradeableProxyTransactor(address common.Address, transactor bind.ContractTransactor) (*TransparentUpgradeableProxyTransactor, error) { contract, err := bindTransparentUpgradeableProxy(address, nil, transactor, nil) if err != nil { return nil, err } return &TransparentUpgradeableProxyTransactor{contract: contract}, nil } // NewTransparentUpgradeableProxyFilterer creates a new log filterer instance of TransparentUpgradeableProxy, bound to a specific deployed contract. func NewTransparentUpgradeableProxyFilterer(address common.Address, filterer bind.ContractFilterer) (*TransparentUpgradeableProxyFilterer, error) { contract, err := bindTransparentUpgradeableProxy(address, nil, nil, filterer) if err != nil { return nil, err } return &TransparentUpgradeableProxyFilterer{contract: contract}, nil } // bindTransparentUpgradeableProxy binds a generic wrapper to an already deployed contract. func bindTransparentUpgradeableProxy(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { parsed, err := TransparentUpgradeableProxyMetaData.GetAbi() if err != nil { return nil, err } return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_TransparentUpgradeableProxy *TransparentUpgradeableProxyRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _TransparentUpgradeableProxy.Contract.TransparentUpgradeableProxyCaller.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_TransparentUpgradeableProxy *TransparentUpgradeableProxyRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _TransparentUpgradeableProxy.Contract.TransparentUpgradeableProxyTransactor.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_TransparentUpgradeableProxy *TransparentUpgradeableProxyRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _TransparentUpgradeableProxy.Contract.TransparentUpgradeableProxyTransactor.contract.Transact(opts, method, params...) } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_TransparentUpgradeableProxy *TransparentUpgradeableProxyCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _TransparentUpgradeableProxy.Contract.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_TransparentUpgradeableProxy *TransparentUpgradeableProxyTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _TransparentUpgradeableProxy.Contract.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_TransparentUpgradeableProxy *TransparentUpgradeableProxyTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _TransparentUpgradeableProxy.Contract.contract.Transact(opts, method, params...) } // Fallback is a paid mutator transaction binding the contract fallback function. // // Solidity: fallback() payable returns() func (_TransparentUpgradeableProxy *TransparentUpgradeableProxyTransactor) Fallback(opts *bind.TransactOpts, calldata []byte) (*types.Transaction, error) { return _TransparentUpgradeableProxy.contract.RawTransact(opts, calldata) } // Fallback is a paid mutator transaction binding the contract fallback function. // // Solidity: fallback() payable returns() func (_TransparentUpgradeableProxy *TransparentUpgradeableProxySession) Fallback(calldata []byte) (*types.Transaction, error) { return _TransparentUpgradeableProxy.Contract.Fallback(&_TransparentUpgradeableProxy.TransactOpts, calldata) } // Fallback is a paid mutator transaction binding the contract fallback function. // // Solidity: fallback() payable returns() func (_TransparentUpgradeableProxy *TransparentUpgradeableProxyTransactorSession) Fallback(calldata []byte) (*types.Transaction, error) { return _TransparentUpgradeableProxy.Contract.Fallback(&_TransparentUpgradeableProxy.TransactOpts, calldata) } // Receive is a paid mutator transaction binding the contract receive function. // // Solidity: receive() payable returns() func (_TransparentUpgradeableProxy *TransparentUpgradeableProxyTransactor) Receive(opts *bind.TransactOpts) (*types.Transaction, error) { return _TransparentUpgradeableProxy.contract.RawTransact(opts, nil) // calldata is disallowed for receive function } // Receive is a paid mutator transaction binding the contract receive function. // // Solidity: receive() payable returns() func (_TransparentUpgradeableProxy *TransparentUpgradeableProxySession) Receive() (*types.Transaction, error) { return _TransparentUpgradeableProxy.Contract.Receive(&_TransparentUpgradeableProxy.TransactOpts) } // Receive is a paid mutator transaction binding the contract receive function. // // Solidity: receive() payable returns() func (_TransparentUpgradeableProxy *TransparentUpgradeableProxyTransactorSession) Receive() (*types.Transaction, error) { return _TransparentUpgradeableProxy.Contract.Receive(&_TransparentUpgradeableProxy.TransactOpts) } // TransparentUpgradeableProxyAdminChangedIterator is returned from FilterAdminChanged and is used to iterate over the raw logs and unpacked data for AdminChanged events raised by the TransparentUpgradeableProxy contract. type TransparentUpgradeableProxyAdminChangedIterator struct { Event *TransparentUpgradeableProxyAdminChanged // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *TransparentUpgradeableProxyAdminChangedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(TransparentUpgradeableProxyAdminChanged) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(TransparentUpgradeableProxyAdminChanged) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *TransparentUpgradeableProxyAdminChangedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *TransparentUpgradeableProxyAdminChangedIterator) Close() error { it.sub.Unsubscribe() return nil } // TransparentUpgradeableProxyAdminChanged represents a AdminChanged event raised by the TransparentUpgradeableProxy contract. type TransparentUpgradeableProxyAdminChanged struct { PreviousAdmin common.Address NewAdmin common.Address Raw types.Log // Blockchain specific contextual infos } // FilterAdminChanged is a free log retrieval operation binding the contract event 0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f. // // Solidity: event AdminChanged(address previousAdmin, address newAdmin) func (_TransparentUpgradeableProxy *TransparentUpgradeableProxyFilterer) FilterAdminChanged(opts *bind.FilterOpts) (*TransparentUpgradeableProxyAdminChangedIterator, error) { logs, sub, err := _TransparentUpgradeableProxy.contract.FilterLogs(opts, "AdminChanged") if err != nil { return nil, err } return &TransparentUpgradeableProxyAdminChangedIterator{contract: _TransparentUpgradeableProxy.contract, event: "AdminChanged", logs: logs, sub: sub}, nil } // WatchAdminChanged is a free log subscription operation binding the contract event 0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f. // // Solidity: event AdminChanged(address previousAdmin, address newAdmin) func (_TransparentUpgradeableProxy *TransparentUpgradeableProxyFilterer) WatchAdminChanged(opts *bind.WatchOpts, sink chan<- *TransparentUpgradeableProxyAdminChanged) (event.Subscription, error) { logs, sub, err := _TransparentUpgradeableProxy.contract.WatchLogs(opts, "AdminChanged") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(TransparentUpgradeableProxyAdminChanged) if err := _TransparentUpgradeableProxy.contract.UnpackLog(event, "AdminChanged", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseAdminChanged is a log parse operation binding the contract event 0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f. // // Solidity: event AdminChanged(address previousAdmin, address newAdmin) func (_TransparentUpgradeableProxy *TransparentUpgradeableProxyFilterer) ParseAdminChanged(log types.Log) (*TransparentUpgradeableProxyAdminChanged, error) { event := new(TransparentUpgradeableProxyAdminChanged) if err := _TransparentUpgradeableProxy.contract.UnpackLog(event, "AdminChanged", log); err != nil { return nil, err } event.Raw = log return event, nil } // TransparentUpgradeableProxyBeaconUpgradedIterator is returned from FilterBeaconUpgraded and is used to iterate over the raw logs and unpacked data for BeaconUpgraded events raised by the TransparentUpgradeableProxy contract. type TransparentUpgradeableProxyBeaconUpgradedIterator struct { Event *TransparentUpgradeableProxyBeaconUpgraded // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *TransparentUpgradeableProxyBeaconUpgradedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(TransparentUpgradeableProxyBeaconUpgraded) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(TransparentUpgradeableProxyBeaconUpgraded) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *TransparentUpgradeableProxyBeaconUpgradedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *TransparentUpgradeableProxyBeaconUpgradedIterator) Close() error { it.sub.Unsubscribe() return nil } // TransparentUpgradeableProxyBeaconUpgraded represents a BeaconUpgraded event raised by the TransparentUpgradeableProxy contract. type TransparentUpgradeableProxyBeaconUpgraded struct { Beacon common.Address Raw types.Log // Blockchain specific contextual infos } // FilterBeaconUpgraded is a free log retrieval operation binding the contract event 0x1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e. // // Solidity: event BeaconUpgraded(address indexed beacon) func (_TransparentUpgradeableProxy *TransparentUpgradeableProxyFilterer) FilterBeaconUpgraded(opts *bind.FilterOpts, beacon []common.Address) (*TransparentUpgradeableProxyBeaconUpgradedIterator, error) { var beaconRule []interface{} for _, beaconItem := range beacon { beaconRule = append(beaconRule, beaconItem) } logs, sub, err := _TransparentUpgradeableProxy.contract.FilterLogs(opts, "BeaconUpgraded", beaconRule) if err != nil { return nil, err } return &TransparentUpgradeableProxyBeaconUpgradedIterator{contract: _TransparentUpgradeableProxy.contract, event: "BeaconUpgraded", logs: logs, sub: sub}, nil } // WatchBeaconUpgraded is a free log subscription operation binding the contract event 0x1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e. // // Solidity: event BeaconUpgraded(address indexed beacon) func (_TransparentUpgradeableProxy *TransparentUpgradeableProxyFilterer) WatchBeaconUpgraded(opts *bind.WatchOpts, sink chan<- *TransparentUpgradeableProxyBeaconUpgraded, beacon []common.Address) (event.Subscription, error) { var beaconRule []interface{} for _, beaconItem := range beacon { beaconRule = append(beaconRule, beaconItem) } logs, sub, err := _TransparentUpgradeableProxy.contract.WatchLogs(opts, "BeaconUpgraded", beaconRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(TransparentUpgradeableProxyBeaconUpgraded) if err := _TransparentUpgradeableProxy.contract.UnpackLog(event, "BeaconUpgraded", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseBeaconUpgraded is a log parse operation binding the contract event 0x1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e. // // Solidity: event BeaconUpgraded(address indexed beacon) func (_TransparentUpgradeableProxy *TransparentUpgradeableProxyFilterer) ParseBeaconUpgraded(log types.Log) (*TransparentUpgradeableProxyBeaconUpgraded, error) { event := new(TransparentUpgradeableProxyBeaconUpgraded) if err := _TransparentUpgradeableProxy.contract.UnpackLog(event, "BeaconUpgraded", log); err != nil { return nil, err } event.Raw = log return event, nil } // TransparentUpgradeableProxyUpgradedIterator is returned from FilterUpgraded and is used to iterate over the raw logs and unpacked data for Upgraded events raised by the TransparentUpgradeableProxy contract. type TransparentUpgradeableProxyUpgradedIterator struct { Event *TransparentUpgradeableProxyUpgraded // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *TransparentUpgradeableProxyUpgradedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(TransparentUpgradeableProxyUpgraded) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(TransparentUpgradeableProxyUpgraded) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *TransparentUpgradeableProxyUpgradedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *TransparentUpgradeableProxyUpgradedIterator) Close() error { it.sub.Unsubscribe() return nil } // TransparentUpgradeableProxyUpgraded represents a Upgraded event raised by the TransparentUpgradeableProxy contract. type TransparentUpgradeableProxyUpgraded struct { Implementation common.Address Raw types.Log // Blockchain specific contextual infos } // FilterUpgraded is a free log retrieval operation binding the contract event 0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b. // // Solidity: event Upgraded(address indexed implementation) func (_TransparentUpgradeableProxy *TransparentUpgradeableProxyFilterer) FilterUpgraded(opts *bind.FilterOpts, implementation []common.Address) (*TransparentUpgradeableProxyUpgradedIterator, error) { var implementationRule []interface{} for _, implementationItem := range implementation { implementationRule = append(implementationRule, implementationItem) } logs, sub, err := _TransparentUpgradeableProxy.contract.FilterLogs(opts, "Upgraded", implementationRule) if err != nil { return nil, err } return &TransparentUpgradeableProxyUpgradedIterator{contract: _TransparentUpgradeableProxy.contract, event: "Upgraded", logs: logs, sub: sub}, nil } // WatchUpgraded is a free log subscription operation binding the contract event 0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b. // // Solidity: event Upgraded(address indexed implementation) func (_TransparentUpgradeableProxy *TransparentUpgradeableProxyFilterer) WatchUpgraded(opts *bind.WatchOpts, sink chan<- *TransparentUpgradeableProxyUpgraded, implementation []common.Address) (event.Subscription, error) { var implementationRule []interface{} for _, implementationItem := range implementation { implementationRule = append(implementationRule, implementationItem) } logs, sub, err := _TransparentUpgradeableProxy.contract.WatchLogs(opts, "Upgraded", implementationRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(TransparentUpgradeableProxyUpgraded) if err := _TransparentUpgradeableProxy.contract.UnpackLog(event, "Upgraded", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseUpgraded is a log parse operation binding the contract event 0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b. // // Solidity: event Upgraded(address indexed implementation) func (_TransparentUpgradeableProxy *TransparentUpgradeableProxyFilterer) ParseUpgraded(log types.Log) (*TransparentUpgradeableProxyUpgraded, error) { event := new(TransparentUpgradeableProxyUpgraded) if err := _TransparentUpgradeableProxy.contract.UnpackLog(event, "Upgraded", log); err != nil { return nil, err } event.Raw = log return event, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/binds/uniswapv3factory/UniswapV3Factory.go ================================================ // Code generated - DO NOT EDIT. // This file is a generated binding and any manual changes will be lost. package uniswapv3factory import ( "errors" "math/big" "strings" ethereum "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/event" ) // Reference imports to suppress errors if they are not otherwise used. var ( _ = errors.New _ = big.NewInt _ = strings.NewReader _ = ethereum.NotFound _ = bind.Bind _ = common.Big1 _ = types.BloomLookup _ = event.NewSubscription ) // Uniswapv3factoryMetaData contains all meta data concerning the Uniswapv3factory contract. var Uniswapv3factoryMetaData = &bind.MetaData{ ABI: "[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint24\",\"name\":\"fee\",\"type\":\"uint24\"},{\"indexed\":true,\"internalType\":\"int24\",\"name\":\"tickSpacing\",\"type\":\"int24\"}],\"name\":\"FeeAmountEnabled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"oldOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnerChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"token0\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"token1\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint24\",\"name\":\"fee\",\"type\":\"uint24\"},{\"indexed\":false,\"internalType\":\"int24\",\"name\":\"tickSpacing\",\"type\":\"int24\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"name\":\"PoolCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"feeProtocol0Old\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"feeProtocol1Old\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"feeProtocol0New\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"feeProtocol1New\",\"type\":\"uint8\"}],\"name\":\"SetFeeProtocol\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"feeToOld\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"feeTo\",\"type\":\"address\"}],\"name\":\"SetFeeTo\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"tokenA\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenB\",\"type\":\"address\"},{\"internalType\":\"uint24\",\"name\":\"fee\",\"type\":\"uint24\"}],\"name\":\"createPool\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint24\",\"name\":\"fee\",\"type\":\"uint24\"},{\"internalType\":\"int24\",\"name\":\"tickSpacing\",\"type\":\"int24\"}],\"name\":\"enableFeeAmount\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint24\",\"name\":\"\",\"type\":\"uint24\"}],\"name\":\"feeAmountTickSpacing\",\"outputs\":[{\"internalType\":\"int24\",\"name\":\"\",\"type\":\"int24\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"feeProtocol\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"feeTo\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint24\",\"name\":\"\",\"type\":\"uint24\"}],\"name\":\"getPool\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getUniswapV3PoolImplementation\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"parameters\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"factory\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token0\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token1\",\"type\":\"address\"},{\"internalType\":\"uint24\",\"name\":\"fee\",\"type\":\"uint24\"},{\"internalType\":\"int24\",\"name\":\"tickSpacing\",\"type\":\"int24\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"feeProtocol0\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"feeProtocol1\",\"type\":\"uint8\"}],\"name\":\"setFeeProtocol\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"feeToArg\",\"type\":\"address\"}],\"name\":\"setFeeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"uniswapV3PoolImplementationArg\",\"type\":\"address\"}],\"name\":\"setUniswapV3PoolImplementation\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", } // Uniswapv3factoryABI is the input ABI used to generate the binding from. // Deprecated: Use Uniswapv3factoryMetaData.ABI instead. var Uniswapv3factoryABI = Uniswapv3factoryMetaData.ABI // Uniswapv3factory is an auto generated Go binding around an Ethereum contract. type Uniswapv3factory struct { Uniswapv3factoryCaller // Read-only binding to the contract Uniswapv3factoryTransactor // Write-only binding to the contract Uniswapv3factoryFilterer // Log filterer for contract events } // Uniswapv3factoryCaller is an auto generated read-only Go binding around an Ethereum contract. type Uniswapv3factoryCaller struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // Uniswapv3factoryTransactor is an auto generated write-only Go binding around an Ethereum contract. type Uniswapv3factoryTransactor struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // Uniswapv3factoryFilterer is an auto generated log filtering Go binding around an Ethereum contract events. type Uniswapv3factoryFilterer struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // Uniswapv3factorySession is an auto generated Go binding around an Ethereum contract, // with pre-set call and transact options. type Uniswapv3factorySession struct { Contract *Uniswapv3factory // Generic contract binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // Uniswapv3factoryCallerSession is an auto generated read-only Go binding around an Ethereum contract, // with pre-set call options. type Uniswapv3factoryCallerSession struct { Contract *Uniswapv3factoryCaller // Generic contract caller binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session } // Uniswapv3factoryTransactorSession is an auto generated write-only Go binding around an Ethereum contract, // with pre-set transact options. type Uniswapv3factoryTransactorSession struct { Contract *Uniswapv3factoryTransactor // Generic contract transactor binding to set the session for TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // Uniswapv3factoryRaw is an auto generated low-level Go binding around an Ethereum contract. type Uniswapv3factoryRaw struct { Contract *Uniswapv3factory // Generic contract binding to access the raw methods on } // Uniswapv3factoryCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. type Uniswapv3factoryCallerRaw struct { Contract *Uniswapv3factoryCaller // Generic read-only contract binding to access the raw methods on } // Uniswapv3factoryTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. type Uniswapv3factoryTransactorRaw struct { Contract *Uniswapv3factoryTransactor // Generic write-only contract binding to access the raw methods on } // NewUniswapv3factory creates a new instance of Uniswapv3factory, bound to a specific deployed contract. func NewUniswapv3factory(address common.Address, backend bind.ContractBackend) (*Uniswapv3factory, error) { contract, err := bindUniswapv3factory(address, backend, backend, backend) if err != nil { return nil, err } return &Uniswapv3factory{Uniswapv3factoryCaller: Uniswapv3factoryCaller{contract: contract}, Uniswapv3factoryTransactor: Uniswapv3factoryTransactor{contract: contract}, Uniswapv3factoryFilterer: Uniswapv3factoryFilterer{contract: contract}}, nil } // NewUniswapv3factoryCaller creates a new read-only instance of Uniswapv3factory, bound to a specific deployed contract. func NewUniswapv3factoryCaller(address common.Address, caller bind.ContractCaller) (*Uniswapv3factoryCaller, error) { contract, err := bindUniswapv3factory(address, caller, nil, nil) if err != nil { return nil, err } return &Uniswapv3factoryCaller{contract: contract}, nil } // NewUniswapv3factoryTransactor creates a new write-only instance of Uniswapv3factory, bound to a specific deployed contract. func NewUniswapv3factoryTransactor(address common.Address, transactor bind.ContractTransactor) (*Uniswapv3factoryTransactor, error) { contract, err := bindUniswapv3factory(address, nil, transactor, nil) if err != nil { return nil, err } return &Uniswapv3factoryTransactor{contract: contract}, nil } // NewUniswapv3factoryFilterer creates a new log filterer instance of Uniswapv3factory, bound to a specific deployed contract. func NewUniswapv3factoryFilterer(address common.Address, filterer bind.ContractFilterer) (*Uniswapv3factoryFilterer, error) { contract, err := bindUniswapv3factory(address, nil, nil, filterer) if err != nil { return nil, err } return &Uniswapv3factoryFilterer{contract: contract}, nil } // bindUniswapv3factory binds a generic wrapper to an already deployed contract. func bindUniswapv3factory(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { parsed, err := abi.JSON(strings.NewReader(Uniswapv3factoryABI)) if err != nil { return nil, err } return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_Uniswapv3factory *Uniswapv3factoryRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _Uniswapv3factory.Contract.Uniswapv3factoryCaller.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_Uniswapv3factory *Uniswapv3factoryRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _Uniswapv3factory.Contract.Uniswapv3factoryTransactor.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_Uniswapv3factory *Uniswapv3factoryRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _Uniswapv3factory.Contract.Uniswapv3factoryTransactor.contract.Transact(opts, method, params...) } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_Uniswapv3factory *Uniswapv3factoryCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _Uniswapv3factory.Contract.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_Uniswapv3factory *Uniswapv3factoryTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _Uniswapv3factory.Contract.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_Uniswapv3factory *Uniswapv3factoryTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _Uniswapv3factory.Contract.contract.Transact(opts, method, params...) } // FeeAmountTickSpacing is a free data retrieval call binding the contract method 0x22afcccb. // // Solidity: function feeAmountTickSpacing(uint24 ) view returns(int24) func (_Uniswapv3factory *Uniswapv3factoryCaller) FeeAmountTickSpacing(opts *bind.CallOpts, arg0 *big.Int) (*big.Int, error) { var out []interface{} err := _Uniswapv3factory.contract.Call(opts, &out, "feeAmountTickSpacing", arg0) if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // FeeAmountTickSpacing is a free data retrieval call binding the contract method 0x22afcccb. // // Solidity: function feeAmountTickSpacing(uint24 ) view returns(int24) func (_Uniswapv3factory *Uniswapv3factorySession) FeeAmountTickSpacing(arg0 *big.Int) (*big.Int, error) { return _Uniswapv3factory.Contract.FeeAmountTickSpacing(&_Uniswapv3factory.CallOpts, arg0) } // FeeAmountTickSpacing is a free data retrieval call binding the contract method 0x22afcccb. // // Solidity: function feeAmountTickSpacing(uint24 ) view returns(int24) func (_Uniswapv3factory *Uniswapv3factoryCallerSession) FeeAmountTickSpacing(arg0 *big.Int) (*big.Int, error) { return _Uniswapv3factory.Contract.FeeAmountTickSpacing(&_Uniswapv3factory.CallOpts, arg0) } // FeeProtocol is a free data retrieval call binding the contract method 0x527eb4bc. // // Solidity: function feeProtocol() view returns(uint8) func (_Uniswapv3factory *Uniswapv3factoryCaller) FeeProtocol(opts *bind.CallOpts) (uint8, error) { var out []interface{} err := _Uniswapv3factory.contract.Call(opts, &out, "feeProtocol") if err != nil { return *new(uint8), err } out0 := *abi.ConvertType(out[0], new(uint8)).(*uint8) return out0, err } // FeeProtocol is a free data retrieval call binding the contract method 0x527eb4bc. // // Solidity: function feeProtocol() view returns(uint8) func (_Uniswapv3factory *Uniswapv3factorySession) FeeProtocol() (uint8, error) { return _Uniswapv3factory.Contract.FeeProtocol(&_Uniswapv3factory.CallOpts) } // FeeProtocol is a free data retrieval call binding the contract method 0x527eb4bc. // // Solidity: function feeProtocol() view returns(uint8) func (_Uniswapv3factory *Uniswapv3factoryCallerSession) FeeProtocol() (uint8, error) { return _Uniswapv3factory.Contract.FeeProtocol(&_Uniswapv3factory.CallOpts) } // FeeTo is a free data retrieval call binding the contract method 0x017e7e58. // // Solidity: function feeTo() view returns(address) func (_Uniswapv3factory *Uniswapv3factoryCaller) FeeTo(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _Uniswapv3factory.contract.Call(opts, &out, "feeTo") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // FeeTo is a free data retrieval call binding the contract method 0x017e7e58. // // Solidity: function feeTo() view returns(address) func (_Uniswapv3factory *Uniswapv3factorySession) FeeTo() (common.Address, error) { return _Uniswapv3factory.Contract.FeeTo(&_Uniswapv3factory.CallOpts) } // FeeTo is a free data retrieval call binding the contract method 0x017e7e58. // // Solidity: function feeTo() view returns(address) func (_Uniswapv3factory *Uniswapv3factoryCallerSession) FeeTo() (common.Address, error) { return _Uniswapv3factory.Contract.FeeTo(&_Uniswapv3factory.CallOpts) } // GetPool is a free data retrieval call binding the contract method 0x1698ee82. // // Solidity: function getPool(address , address , uint24 ) view returns(address) func (_Uniswapv3factory *Uniswapv3factoryCaller) GetPool(opts *bind.CallOpts, arg0 common.Address, arg1 common.Address, arg2 *big.Int) (common.Address, error) { var out []interface{} err := _Uniswapv3factory.contract.Call(opts, &out, "getPool", arg0, arg1, arg2) if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // GetPool is a free data retrieval call binding the contract method 0x1698ee82. // // Solidity: function getPool(address , address , uint24 ) view returns(address) func (_Uniswapv3factory *Uniswapv3factorySession) GetPool(arg0 common.Address, arg1 common.Address, arg2 *big.Int) (common.Address, error) { return _Uniswapv3factory.Contract.GetPool(&_Uniswapv3factory.CallOpts, arg0, arg1, arg2) } // GetPool is a free data retrieval call binding the contract method 0x1698ee82. // // Solidity: function getPool(address , address , uint24 ) view returns(address) func (_Uniswapv3factory *Uniswapv3factoryCallerSession) GetPool(arg0 common.Address, arg1 common.Address, arg2 *big.Int) (common.Address, error) { return _Uniswapv3factory.Contract.GetPool(&_Uniswapv3factory.CallOpts, arg0, arg1, arg2) } // GetUniswapV3PoolImplementation is a free data retrieval call binding the contract method 0x5c30ef7f. // // Solidity: function getUniswapV3PoolImplementation() view returns(address) func (_Uniswapv3factory *Uniswapv3factoryCaller) GetUniswapV3PoolImplementation(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _Uniswapv3factory.contract.Call(opts, &out, "getUniswapV3PoolImplementation") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // GetUniswapV3PoolImplementation is a free data retrieval call binding the contract method 0x5c30ef7f. // // Solidity: function getUniswapV3PoolImplementation() view returns(address) func (_Uniswapv3factory *Uniswapv3factorySession) GetUniswapV3PoolImplementation() (common.Address, error) { return _Uniswapv3factory.Contract.GetUniswapV3PoolImplementation(&_Uniswapv3factory.CallOpts) } // GetUniswapV3PoolImplementation is a free data retrieval call binding the contract method 0x5c30ef7f. // // Solidity: function getUniswapV3PoolImplementation() view returns(address) func (_Uniswapv3factory *Uniswapv3factoryCallerSession) GetUniswapV3PoolImplementation() (common.Address, error) { return _Uniswapv3factory.Contract.GetUniswapV3PoolImplementation(&_Uniswapv3factory.CallOpts) } // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. // // Solidity: function owner() view returns(address) func (_Uniswapv3factory *Uniswapv3factoryCaller) Owner(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _Uniswapv3factory.contract.Call(opts, &out, "owner") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. // // Solidity: function owner() view returns(address) func (_Uniswapv3factory *Uniswapv3factorySession) Owner() (common.Address, error) { return _Uniswapv3factory.Contract.Owner(&_Uniswapv3factory.CallOpts) } // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. // // Solidity: function owner() view returns(address) func (_Uniswapv3factory *Uniswapv3factoryCallerSession) Owner() (common.Address, error) { return _Uniswapv3factory.Contract.Owner(&_Uniswapv3factory.CallOpts) } // Parameters is a free data retrieval call binding the contract method 0x89035730. // // Solidity: function parameters() view returns(address factory, address token0, address token1, uint24 fee, int24 tickSpacing) func (_Uniswapv3factory *Uniswapv3factoryCaller) Parameters(opts *bind.CallOpts) (struct { Factory common.Address Token0 common.Address Token1 common.Address Fee *big.Int TickSpacing *big.Int }, error) { var out []interface{} err := _Uniswapv3factory.contract.Call(opts, &out, "parameters") outstruct := new(struct { Factory common.Address Token0 common.Address Token1 common.Address Fee *big.Int TickSpacing *big.Int }) if err != nil { return *outstruct, err } outstruct.Factory = *abi.ConvertType(out[0], new(common.Address)).(*common.Address) outstruct.Token0 = *abi.ConvertType(out[1], new(common.Address)).(*common.Address) outstruct.Token1 = *abi.ConvertType(out[2], new(common.Address)).(*common.Address) outstruct.Fee = *abi.ConvertType(out[3], new(*big.Int)).(**big.Int) outstruct.TickSpacing = *abi.ConvertType(out[4], new(*big.Int)).(**big.Int) return *outstruct, err } // Parameters is a free data retrieval call binding the contract method 0x89035730. // // Solidity: function parameters() view returns(address factory, address token0, address token1, uint24 fee, int24 tickSpacing) func (_Uniswapv3factory *Uniswapv3factorySession) Parameters() (struct { Factory common.Address Token0 common.Address Token1 common.Address Fee *big.Int TickSpacing *big.Int }, error) { return _Uniswapv3factory.Contract.Parameters(&_Uniswapv3factory.CallOpts) } // Parameters is a free data retrieval call binding the contract method 0x89035730. // // Solidity: function parameters() view returns(address factory, address token0, address token1, uint24 fee, int24 tickSpacing) func (_Uniswapv3factory *Uniswapv3factoryCallerSession) Parameters() (struct { Factory common.Address Token0 common.Address Token1 common.Address Fee *big.Int TickSpacing *big.Int }, error) { return _Uniswapv3factory.Contract.Parameters(&_Uniswapv3factory.CallOpts) } // CreatePool is a paid mutator transaction binding the contract method 0xa1671295. // // Solidity: function createPool(address tokenA, address tokenB, uint24 fee) returns(address pool) func (_Uniswapv3factory *Uniswapv3factoryTransactor) CreatePool(opts *bind.TransactOpts, tokenA common.Address, tokenB common.Address, fee *big.Int) (*types.Transaction, error) { return _Uniswapv3factory.contract.Transact(opts, "createPool", tokenA, tokenB, fee) } // CreatePool is a paid mutator transaction binding the contract method 0xa1671295. // // Solidity: function createPool(address tokenA, address tokenB, uint24 fee) returns(address pool) func (_Uniswapv3factory *Uniswapv3factorySession) CreatePool(tokenA common.Address, tokenB common.Address, fee *big.Int) (*types.Transaction, error) { return _Uniswapv3factory.Contract.CreatePool(&_Uniswapv3factory.TransactOpts, tokenA, tokenB, fee) } // CreatePool is a paid mutator transaction binding the contract method 0xa1671295. // // Solidity: function createPool(address tokenA, address tokenB, uint24 fee) returns(address pool) func (_Uniswapv3factory *Uniswapv3factoryTransactorSession) CreatePool(tokenA common.Address, tokenB common.Address, fee *big.Int) (*types.Transaction, error) { return _Uniswapv3factory.Contract.CreatePool(&_Uniswapv3factory.TransactOpts, tokenA, tokenB, fee) } // EnableFeeAmount is a paid mutator transaction binding the contract method 0x8a7c195f. // // Solidity: function enableFeeAmount(uint24 fee, int24 tickSpacing) returns() func (_Uniswapv3factory *Uniswapv3factoryTransactor) EnableFeeAmount(opts *bind.TransactOpts, fee *big.Int, tickSpacing *big.Int) (*types.Transaction, error) { return _Uniswapv3factory.contract.Transact(opts, "enableFeeAmount", fee, tickSpacing) } // EnableFeeAmount is a paid mutator transaction binding the contract method 0x8a7c195f. // // Solidity: function enableFeeAmount(uint24 fee, int24 tickSpacing) returns() func (_Uniswapv3factory *Uniswapv3factorySession) EnableFeeAmount(fee *big.Int, tickSpacing *big.Int) (*types.Transaction, error) { return _Uniswapv3factory.Contract.EnableFeeAmount(&_Uniswapv3factory.TransactOpts, fee, tickSpacing) } // EnableFeeAmount is a paid mutator transaction binding the contract method 0x8a7c195f. // // Solidity: function enableFeeAmount(uint24 fee, int24 tickSpacing) returns() func (_Uniswapv3factory *Uniswapv3factoryTransactorSession) EnableFeeAmount(fee *big.Int, tickSpacing *big.Int) (*types.Transaction, error) { return _Uniswapv3factory.Contract.EnableFeeAmount(&_Uniswapv3factory.TransactOpts, fee, tickSpacing) } // Initialize is a paid mutator transaction binding the contract method 0x8129fc1c. // // Solidity: function initialize() returns() func (_Uniswapv3factory *Uniswapv3factoryTransactor) Initialize(opts *bind.TransactOpts) (*types.Transaction, error) { return _Uniswapv3factory.contract.Transact(opts, "initialize") } // Initialize is a paid mutator transaction binding the contract method 0x8129fc1c. // // Solidity: function initialize() returns() func (_Uniswapv3factory *Uniswapv3factorySession) Initialize() (*types.Transaction, error) { return _Uniswapv3factory.Contract.Initialize(&_Uniswapv3factory.TransactOpts) } // Initialize is a paid mutator transaction binding the contract method 0x8129fc1c. // // Solidity: function initialize() returns() func (_Uniswapv3factory *Uniswapv3factoryTransactorSession) Initialize() (*types.Transaction, error) { return _Uniswapv3factory.Contract.Initialize(&_Uniswapv3factory.TransactOpts) } // RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. // // Solidity: function renounceOwnership() returns() func (_Uniswapv3factory *Uniswapv3factoryTransactor) RenounceOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { return _Uniswapv3factory.contract.Transact(opts, "renounceOwnership") } // RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. // // Solidity: function renounceOwnership() returns() func (_Uniswapv3factory *Uniswapv3factorySession) RenounceOwnership() (*types.Transaction, error) { return _Uniswapv3factory.Contract.RenounceOwnership(&_Uniswapv3factory.TransactOpts) } // RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. // // Solidity: function renounceOwnership() returns() func (_Uniswapv3factory *Uniswapv3factoryTransactorSession) RenounceOwnership() (*types.Transaction, error) { return _Uniswapv3factory.Contract.RenounceOwnership(&_Uniswapv3factory.TransactOpts) } // SetFeeProtocol is a paid mutator transaction binding the contract method 0x8206a4d1. // // Solidity: function setFeeProtocol(uint8 feeProtocol0, uint8 feeProtocol1) returns() func (_Uniswapv3factory *Uniswapv3factoryTransactor) SetFeeProtocol(opts *bind.TransactOpts, feeProtocol0 uint8, feeProtocol1 uint8) (*types.Transaction, error) { return _Uniswapv3factory.contract.Transact(opts, "setFeeProtocol", feeProtocol0, feeProtocol1) } // SetFeeProtocol is a paid mutator transaction binding the contract method 0x8206a4d1. // // Solidity: function setFeeProtocol(uint8 feeProtocol0, uint8 feeProtocol1) returns() func (_Uniswapv3factory *Uniswapv3factorySession) SetFeeProtocol(feeProtocol0 uint8, feeProtocol1 uint8) (*types.Transaction, error) { return _Uniswapv3factory.Contract.SetFeeProtocol(&_Uniswapv3factory.TransactOpts, feeProtocol0, feeProtocol1) } // SetFeeProtocol is a paid mutator transaction binding the contract method 0x8206a4d1. // // Solidity: function setFeeProtocol(uint8 feeProtocol0, uint8 feeProtocol1) returns() func (_Uniswapv3factory *Uniswapv3factoryTransactorSession) SetFeeProtocol(feeProtocol0 uint8, feeProtocol1 uint8) (*types.Transaction, error) { return _Uniswapv3factory.Contract.SetFeeProtocol(&_Uniswapv3factory.TransactOpts, feeProtocol0, feeProtocol1) } // SetFeeTo is a paid mutator transaction binding the contract method 0xf46901ed. // // Solidity: function setFeeTo(address feeToArg) returns() func (_Uniswapv3factory *Uniswapv3factoryTransactor) SetFeeTo(opts *bind.TransactOpts, feeToArg common.Address) (*types.Transaction, error) { return _Uniswapv3factory.contract.Transact(opts, "setFeeTo", feeToArg) } // SetFeeTo is a paid mutator transaction binding the contract method 0xf46901ed. // // Solidity: function setFeeTo(address feeToArg) returns() func (_Uniswapv3factory *Uniswapv3factorySession) SetFeeTo(feeToArg common.Address) (*types.Transaction, error) { return _Uniswapv3factory.Contract.SetFeeTo(&_Uniswapv3factory.TransactOpts, feeToArg) } // SetFeeTo is a paid mutator transaction binding the contract method 0xf46901ed. // // Solidity: function setFeeTo(address feeToArg) returns() func (_Uniswapv3factory *Uniswapv3factoryTransactorSession) SetFeeTo(feeToArg common.Address) (*types.Transaction, error) { return _Uniswapv3factory.Contract.SetFeeTo(&_Uniswapv3factory.TransactOpts, feeToArg) } // SetUniswapV3PoolImplementation is a paid mutator transaction binding the contract method 0xe8bca99d. // // Solidity: function setUniswapV3PoolImplementation(address uniswapV3PoolImplementationArg) returns() func (_Uniswapv3factory *Uniswapv3factoryTransactor) SetUniswapV3PoolImplementation(opts *bind.TransactOpts, uniswapV3PoolImplementationArg common.Address) (*types.Transaction, error) { return _Uniswapv3factory.contract.Transact(opts, "setUniswapV3PoolImplementation", uniswapV3PoolImplementationArg) } // SetUniswapV3PoolImplementation is a paid mutator transaction binding the contract method 0xe8bca99d. // // Solidity: function setUniswapV3PoolImplementation(address uniswapV3PoolImplementationArg) returns() func (_Uniswapv3factory *Uniswapv3factorySession) SetUniswapV3PoolImplementation(uniswapV3PoolImplementationArg common.Address) (*types.Transaction, error) { return _Uniswapv3factory.Contract.SetUniswapV3PoolImplementation(&_Uniswapv3factory.TransactOpts, uniswapV3PoolImplementationArg) } // SetUniswapV3PoolImplementation is a paid mutator transaction binding the contract method 0xe8bca99d. // // Solidity: function setUniswapV3PoolImplementation(address uniswapV3PoolImplementationArg) returns() func (_Uniswapv3factory *Uniswapv3factoryTransactorSession) SetUniswapV3PoolImplementation(uniswapV3PoolImplementationArg common.Address) (*types.Transaction, error) { return _Uniswapv3factory.Contract.SetUniswapV3PoolImplementation(&_Uniswapv3factory.TransactOpts, uniswapV3PoolImplementationArg) } // TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. // // Solidity: function transferOwnership(address newOwner) returns() func (_Uniswapv3factory *Uniswapv3factoryTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) { return _Uniswapv3factory.contract.Transact(opts, "transferOwnership", newOwner) } // TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. // // Solidity: function transferOwnership(address newOwner) returns() func (_Uniswapv3factory *Uniswapv3factorySession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { return _Uniswapv3factory.Contract.TransferOwnership(&_Uniswapv3factory.TransactOpts, newOwner) } // TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. // // Solidity: function transferOwnership(address newOwner) returns() func (_Uniswapv3factory *Uniswapv3factoryTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { return _Uniswapv3factory.Contract.TransferOwnership(&_Uniswapv3factory.TransactOpts, newOwner) } // Uniswapv3factoryFeeAmountEnabledIterator is returned from FilterFeeAmountEnabled and is used to iterate over the raw logs and unpacked data for FeeAmountEnabled events raised by the Uniswapv3factory contract. type Uniswapv3factoryFeeAmountEnabledIterator struct { Event *Uniswapv3factoryFeeAmountEnabled // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *Uniswapv3factoryFeeAmountEnabledIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(Uniswapv3factoryFeeAmountEnabled) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(Uniswapv3factoryFeeAmountEnabled) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *Uniswapv3factoryFeeAmountEnabledIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *Uniswapv3factoryFeeAmountEnabledIterator) Close() error { it.sub.Unsubscribe() return nil } // Uniswapv3factoryFeeAmountEnabled represents a FeeAmountEnabled event raised by the Uniswapv3factory contract. type Uniswapv3factoryFeeAmountEnabled struct { Fee *big.Int TickSpacing *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterFeeAmountEnabled is a free log retrieval operation binding the contract event 0xc66a3fdf07232cdd185febcc6579d408c241b47ae2f9907d84be655141eeaecc. // // Solidity: event FeeAmountEnabled(uint24 indexed fee, int24 indexed tickSpacing) func (_Uniswapv3factory *Uniswapv3factoryFilterer) FilterFeeAmountEnabled(opts *bind.FilterOpts, fee []*big.Int, tickSpacing []*big.Int) (*Uniswapv3factoryFeeAmountEnabledIterator, error) { var feeRule []interface{} for _, feeItem := range fee { feeRule = append(feeRule, feeItem) } var tickSpacingRule []interface{} for _, tickSpacingItem := range tickSpacing { tickSpacingRule = append(tickSpacingRule, tickSpacingItem) } logs, sub, err := _Uniswapv3factory.contract.FilterLogs(opts, "FeeAmountEnabled", feeRule, tickSpacingRule) if err != nil { return nil, err } return &Uniswapv3factoryFeeAmountEnabledIterator{contract: _Uniswapv3factory.contract, event: "FeeAmountEnabled", logs: logs, sub: sub}, nil } // WatchFeeAmountEnabled is a free log subscription operation binding the contract event 0xc66a3fdf07232cdd185febcc6579d408c241b47ae2f9907d84be655141eeaecc. // // Solidity: event FeeAmountEnabled(uint24 indexed fee, int24 indexed tickSpacing) func (_Uniswapv3factory *Uniswapv3factoryFilterer) WatchFeeAmountEnabled(opts *bind.WatchOpts, sink chan<- *Uniswapv3factoryFeeAmountEnabled, fee []*big.Int, tickSpacing []*big.Int) (event.Subscription, error) { var feeRule []interface{} for _, feeItem := range fee { feeRule = append(feeRule, feeItem) } var tickSpacingRule []interface{} for _, tickSpacingItem := range tickSpacing { tickSpacingRule = append(tickSpacingRule, tickSpacingItem) } logs, sub, err := _Uniswapv3factory.contract.WatchLogs(opts, "FeeAmountEnabled", feeRule, tickSpacingRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(Uniswapv3factoryFeeAmountEnabled) if err := _Uniswapv3factory.contract.UnpackLog(event, "FeeAmountEnabled", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseFeeAmountEnabled is a log parse operation binding the contract event 0xc66a3fdf07232cdd185febcc6579d408c241b47ae2f9907d84be655141eeaecc. // // Solidity: event FeeAmountEnabled(uint24 indexed fee, int24 indexed tickSpacing) func (_Uniswapv3factory *Uniswapv3factoryFilterer) ParseFeeAmountEnabled(log types.Log) (*Uniswapv3factoryFeeAmountEnabled, error) { event := new(Uniswapv3factoryFeeAmountEnabled) if err := _Uniswapv3factory.contract.UnpackLog(event, "FeeAmountEnabled", log); err != nil { return nil, err } event.Raw = log return event, nil } // Uniswapv3factoryOwnerChangedIterator is returned from FilterOwnerChanged and is used to iterate over the raw logs and unpacked data for OwnerChanged events raised by the Uniswapv3factory contract. type Uniswapv3factoryOwnerChangedIterator struct { Event *Uniswapv3factoryOwnerChanged // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *Uniswapv3factoryOwnerChangedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(Uniswapv3factoryOwnerChanged) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(Uniswapv3factoryOwnerChanged) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *Uniswapv3factoryOwnerChangedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *Uniswapv3factoryOwnerChangedIterator) Close() error { it.sub.Unsubscribe() return nil } // Uniswapv3factoryOwnerChanged represents a OwnerChanged event raised by the Uniswapv3factory contract. type Uniswapv3factoryOwnerChanged struct { OldOwner common.Address NewOwner common.Address Raw types.Log // Blockchain specific contextual infos } // FilterOwnerChanged is a free log retrieval operation binding the contract event 0xb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c. // // Solidity: event OwnerChanged(address indexed oldOwner, address indexed newOwner) func (_Uniswapv3factory *Uniswapv3factoryFilterer) FilterOwnerChanged(opts *bind.FilterOpts, oldOwner []common.Address, newOwner []common.Address) (*Uniswapv3factoryOwnerChangedIterator, error) { var oldOwnerRule []interface{} for _, oldOwnerItem := range oldOwner { oldOwnerRule = append(oldOwnerRule, oldOwnerItem) } var newOwnerRule []interface{} for _, newOwnerItem := range newOwner { newOwnerRule = append(newOwnerRule, newOwnerItem) } logs, sub, err := _Uniswapv3factory.contract.FilterLogs(opts, "OwnerChanged", oldOwnerRule, newOwnerRule) if err != nil { return nil, err } return &Uniswapv3factoryOwnerChangedIterator{contract: _Uniswapv3factory.contract, event: "OwnerChanged", logs: logs, sub: sub}, nil } // WatchOwnerChanged is a free log subscription operation binding the contract event 0xb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c. // // Solidity: event OwnerChanged(address indexed oldOwner, address indexed newOwner) func (_Uniswapv3factory *Uniswapv3factoryFilterer) WatchOwnerChanged(opts *bind.WatchOpts, sink chan<- *Uniswapv3factoryOwnerChanged, oldOwner []common.Address, newOwner []common.Address) (event.Subscription, error) { var oldOwnerRule []interface{} for _, oldOwnerItem := range oldOwner { oldOwnerRule = append(oldOwnerRule, oldOwnerItem) } var newOwnerRule []interface{} for _, newOwnerItem := range newOwner { newOwnerRule = append(newOwnerRule, newOwnerItem) } logs, sub, err := _Uniswapv3factory.contract.WatchLogs(opts, "OwnerChanged", oldOwnerRule, newOwnerRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(Uniswapv3factoryOwnerChanged) if err := _Uniswapv3factory.contract.UnpackLog(event, "OwnerChanged", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseOwnerChanged is a log parse operation binding the contract event 0xb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c. // // Solidity: event OwnerChanged(address indexed oldOwner, address indexed newOwner) func (_Uniswapv3factory *Uniswapv3factoryFilterer) ParseOwnerChanged(log types.Log) (*Uniswapv3factoryOwnerChanged, error) { event := new(Uniswapv3factoryOwnerChanged) if err := _Uniswapv3factory.contract.UnpackLog(event, "OwnerChanged", log); err != nil { return nil, err } event.Raw = log return event, nil } // Uniswapv3factoryOwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the Uniswapv3factory contract. type Uniswapv3factoryOwnershipTransferredIterator struct { Event *Uniswapv3factoryOwnershipTransferred // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *Uniswapv3factoryOwnershipTransferredIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(Uniswapv3factoryOwnershipTransferred) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(Uniswapv3factoryOwnershipTransferred) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *Uniswapv3factoryOwnershipTransferredIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *Uniswapv3factoryOwnershipTransferredIterator) Close() error { it.sub.Unsubscribe() return nil } // Uniswapv3factoryOwnershipTransferred represents a OwnershipTransferred event raised by the Uniswapv3factory contract. type Uniswapv3factoryOwnershipTransferred struct { PreviousOwner common.Address NewOwner common.Address Raw types.Log // Blockchain specific contextual infos } // FilterOwnershipTransferred is a free log retrieval operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. // // Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) func (_Uniswapv3factory *Uniswapv3factoryFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*Uniswapv3factoryOwnershipTransferredIterator, error) { var previousOwnerRule []interface{} for _, previousOwnerItem := range previousOwner { previousOwnerRule = append(previousOwnerRule, previousOwnerItem) } var newOwnerRule []interface{} for _, newOwnerItem := range newOwner { newOwnerRule = append(newOwnerRule, newOwnerItem) } logs, sub, err := _Uniswapv3factory.contract.FilterLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) if err != nil { return nil, err } return &Uniswapv3factoryOwnershipTransferredIterator{contract: _Uniswapv3factory.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil } // WatchOwnershipTransferred is a free log subscription operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. // // Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) func (_Uniswapv3factory *Uniswapv3factoryFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *Uniswapv3factoryOwnershipTransferred, previousOwner []common.Address, newOwner []common.Address) (event.Subscription, error) { var previousOwnerRule []interface{} for _, previousOwnerItem := range previousOwner { previousOwnerRule = append(previousOwnerRule, previousOwnerItem) } var newOwnerRule []interface{} for _, newOwnerItem := range newOwner { newOwnerRule = append(newOwnerRule, newOwnerItem) } logs, sub, err := _Uniswapv3factory.contract.WatchLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(Uniswapv3factoryOwnershipTransferred) if err := _Uniswapv3factory.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseOwnershipTransferred is a log parse operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. // // Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) func (_Uniswapv3factory *Uniswapv3factoryFilterer) ParseOwnershipTransferred(log types.Log) (*Uniswapv3factoryOwnershipTransferred, error) { event := new(Uniswapv3factoryOwnershipTransferred) if err := _Uniswapv3factory.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { return nil, err } event.Raw = log return event, nil } // Uniswapv3factoryPoolCreatedIterator is returned from FilterPoolCreated and is used to iterate over the raw logs and unpacked data for PoolCreated events raised by the Uniswapv3factory contract. type Uniswapv3factoryPoolCreatedIterator struct { Event *Uniswapv3factoryPoolCreated // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *Uniswapv3factoryPoolCreatedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(Uniswapv3factoryPoolCreated) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(Uniswapv3factoryPoolCreated) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *Uniswapv3factoryPoolCreatedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *Uniswapv3factoryPoolCreatedIterator) Close() error { it.sub.Unsubscribe() return nil } // Uniswapv3factoryPoolCreated represents a PoolCreated event raised by the Uniswapv3factory contract. type Uniswapv3factoryPoolCreated struct { Token0 common.Address Token1 common.Address Fee *big.Int TickSpacing *big.Int Pool common.Address Raw types.Log // Blockchain specific contextual infos } // FilterPoolCreated is a free log retrieval operation binding the contract event 0x783cca1c0412dd0d695e784568c96da2e9c22ff989357a2e8b1d9b2b4e6b7118. // // Solidity: event PoolCreated(address indexed token0, address indexed token1, uint24 indexed fee, int24 tickSpacing, address pool) func (_Uniswapv3factory *Uniswapv3factoryFilterer) FilterPoolCreated(opts *bind.FilterOpts, token0 []common.Address, token1 []common.Address, fee []*big.Int) (*Uniswapv3factoryPoolCreatedIterator, error) { var token0Rule []interface{} for _, token0Item := range token0 { token0Rule = append(token0Rule, token0Item) } var token1Rule []interface{} for _, token1Item := range token1 { token1Rule = append(token1Rule, token1Item) } var feeRule []interface{} for _, feeItem := range fee { feeRule = append(feeRule, feeItem) } logs, sub, err := _Uniswapv3factory.contract.FilterLogs(opts, "PoolCreated", token0Rule, token1Rule, feeRule) if err != nil { return nil, err } return &Uniswapv3factoryPoolCreatedIterator{contract: _Uniswapv3factory.contract, event: "PoolCreated", logs: logs, sub: sub}, nil } // WatchPoolCreated is a free log subscription operation binding the contract event 0x783cca1c0412dd0d695e784568c96da2e9c22ff989357a2e8b1d9b2b4e6b7118. // // Solidity: event PoolCreated(address indexed token0, address indexed token1, uint24 indexed fee, int24 tickSpacing, address pool) func (_Uniswapv3factory *Uniswapv3factoryFilterer) WatchPoolCreated(opts *bind.WatchOpts, sink chan<- *Uniswapv3factoryPoolCreated, token0 []common.Address, token1 []common.Address, fee []*big.Int) (event.Subscription, error) { var token0Rule []interface{} for _, token0Item := range token0 { token0Rule = append(token0Rule, token0Item) } var token1Rule []interface{} for _, token1Item := range token1 { token1Rule = append(token1Rule, token1Item) } var feeRule []interface{} for _, feeItem := range fee { feeRule = append(feeRule, feeItem) } logs, sub, err := _Uniswapv3factory.contract.WatchLogs(opts, "PoolCreated", token0Rule, token1Rule, feeRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(Uniswapv3factoryPoolCreated) if err := _Uniswapv3factory.contract.UnpackLog(event, "PoolCreated", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParsePoolCreated is a log parse operation binding the contract event 0x783cca1c0412dd0d695e784568c96da2e9c22ff989357a2e8b1d9b2b4e6b7118. // // Solidity: event PoolCreated(address indexed token0, address indexed token1, uint24 indexed fee, int24 tickSpacing, address pool) func (_Uniswapv3factory *Uniswapv3factoryFilterer) ParsePoolCreated(log types.Log) (*Uniswapv3factoryPoolCreated, error) { event := new(Uniswapv3factoryPoolCreated) if err := _Uniswapv3factory.contract.UnpackLog(event, "PoolCreated", log); err != nil { return nil, err } event.Raw = log return event, nil } // Uniswapv3factorySetFeeProtocolIterator is returned from FilterSetFeeProtocol and is used to iterate over the raw logs and unpacked data for SetFeeProtocol events raised by the Uniswapv3factory contract. type Uniswapv3factorySetFeeProtocolIterator struct { Event *Uniswapv3factorySetFeeProtocol // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *Uniswapv3factorySetFeeProtocolIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(Uniswapv3factorySetFeeProtocol) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(Uniswapv3factorySetFeeProtocol) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *Uniswapv3factorySetFeeProtocolIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *Uniswapv3factorySetFeeProtocolIterator) Close() error { it.sub.Unsubscribe() return nil } // Uniswapv3factorySetFeeProtocol represents a SetFeeProtocol event raised by the Uniswapv3factory contract. type Uniswapv3factorySetFeeProtocol struct { FeeProtocol0Old uint8 FeeProtocol1Old uint8 FeeProtocol0New uint8 FeeProtocol1New uint8 Raw types.Log // Blockchain specific contextual infos } // FilterSetFeeProtocol is a free log retrieval operation binding the contract event 0x973d8d92bb299f4af6ce49b52a8adb85ae46b9f214c4c4fc06ac77401237b133. // // Solidity: event SetFeeProtocol(uint8 feeProtocol0Old, uint8 feeProtocol1Old, uint8 feeProtocol0New, uint8 feeProtocol1New) func (_Uniswapv3factory *Uniswapv3factoryFilterer) FilterSetFeeProtocol(opts *bind.FilterOpts) (*Uniswapv3factorySetFeeProtocolIterator, error) { logs, sub, err := _Uniswapv3factory.contract.FilterLogs(opts, "SetFeeProtocol") if err != nil { return nil, err } return &Uniswapv3factorySetFeeProtocolIterator{contract: _Uniswapv3factory.contract, event: "SetFeeProtocol", logs: logs, sub: sub}, nil } // WatchSetFeeProtocol is a free log subscription operation binding the contract event 0x973d8d92bb299f4af6ce49b52a8adb85ae46b9f214c4c4fc06ac77401237b133. // // Solidity: event SetFeeProtocol(uint8 feeProtocol0Old, uint8 feeProtocol1Old, uint8 feeProtocol0New, uint8 feeProtocol1New) func (_Uniswapv3factory *Uniswapv3factoryFilterer) WatchSetFeeProtocol(opts *bind.WatchOpts, sink chan<- *Uniswapv3factorySetFeeProtocol) (event.Subscription, error) { logs, sub, err := _Uniswapv3factory.contract.WatchLogs(opts, "SetFeeProtocol") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(Uniswapv3factorySetFeeProtocol) if err := _Uniswapv3factory.contract.UnpackLog(event, "SetFeeProtocol", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseSetFeeProtocol is a log parse operation binding the contract event 0x973d8d92bb299f4af6ce49b52a8adb85ae46b9f214c4c4fc06ac77401237b133. // // Solidity: event SetFeeProtocol(uint8 feeProtocol0Old, uint8 feeProtocol1Old, uint8 feeProtocol0New, uint8 feeProtocol1New) func (_Uniswapv3factory *Uniswapv3factoryFilterer) ParseSetFeeProtocol(log types.Log) (*Uniswapv3factorySetFeeProtocol, error) { event := new(Uniswapv3factorySetFeeProtocol) if err := _Uniswapv3factory.contract.UnpackLog(event, "SetFeeProtocol", log); err != nil { return nil, err } event.Raw = log return event, nil } // Uniswapv3factorySetFeeToIterator is returned from FilterSetFeeTo and is used to iterate over the raw logs and unpacked data for SetFeeTo events raised by the Uniswapv3factory contract. type Uniswapv3factorySetFeeToIterator struct { Event *Uniswapv3factorySetFeeTo // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *Uniswapv3factorySetFeeToIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(Uniswapv3factorySetFeeTo) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(Uniswapv3factorySetFeeTo) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *Uniswapv3factorySetFeeToIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *Uniswapv3factorySetFeeToIterator) Close() error { it.sub.Unsubscribe() return nil } // Uniswapv3factorySetFeeTo represents a SetFeeTo event raised by the Uniswapv3factory contract. type Uniswapv3factorySetFeeTo struct { FeeToOld common.Address FeeTo common.Address Raw types.Log // Blockchain specific contextual infos } // FilterSetFeeTo is a free log retrieval operation binding the contract event 0x41d2755f00068d89c23ebc6f1e73ce119a6236a44517ca061f544a3f91c9bca4. // // Solidity: event SetFeeTo(address feeToOld, address feeTo) func (_Uniswapv3factory *Uniswapv3factoryFilterer) FilterSetFeeTo(opts *bind.FilterOpts) (*Uniswapv3factorySetFeeToIterator, error) { logs, sub, err := _Uniswapv3factory.contract.FilterLogs(opts, "SetFeeTo") if err != nil { return nil, err } return &Uniswapv3factorySetFeeToIterator{contract: _Uniswapv3factory.contract, event: "SetFeeTo", logs: logs, sub: sub}, nil } // WatchSetFeeTo is a free log subscription operation binding the contract event 0x41d2755f00068d89c23ebc6f1e73ce119a6236a44517ca061f544a3f91c9bca4. // // Solidity: event SetFeeTo(address feeToOld, address feeTo) func (_Uniswapv3factory *Uniswapv3factoryFilterer) WatchSetFeeTo(opts *bind.WatchOpts, sink chan<- *Uniswapv3factorySetFeeTo) (event.Subscription, error) { logs, sub, err := _Uniswapv3factory.contract.WatchLogs(opts, "SetFeeTo") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(Uniswapv3factorySetFeeTo) if err := _Uniswapv3factory.contract.UnpackLog(event, "SetFeeTo", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseSetFeeTo is a log parse operation binding the contract event 0x41d2755f00068d89c23ebc6f1e73ce119a6236a44517ca061f544a3f91c9bca4. // // Solidity: event SetFeeTo(address feeToOld, address feeTo) func (_Uniswapv3factory *Uniswapv3factoryFilterer) ParseSetFeeTo(log types.Log) (*Uniswapv3factorySetFeeTo, error) { event := new(Uniswapv3factorySetFeeTo) if err := _Uniswapv3factory.contract.UnpackLog(event, "SetFeeTo", log); err != nil { return nil, err } event.Raw = log return event, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/binds/uniswapv3pool/UniswapV3Pool.go ================================================ // Code generated - DO NOT EDIT. // This file is a generated binding and any manual changes will be lost. package uniswapv3pool import ( "errors" "math/big" "strings" ethereum "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/event" ) // Reference imports to suppress errors if they are not otherwise used. var ( _ = errors.New _ = big.NewInt _ = strings.NewReader _ = ethereum.NotFound _ = bind.Bind _ = common.Big1 _ = types.BloomLookup _ = event.NewSubscription ) // Uniswapv3poolMetaData contains all meta data concerning the Uniswapv3pool contract. var Uniswapv3poolMetaData = &bind.MetaData{ ABI: "[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"int24\",\"name\":\"tickLower\",\"type\":\"int24\"},{\"indexed\":true,\"internalType\":\"int24\",\"name\":\"tickUpper\",\"type\":\"int24\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"amount\",\"type\":\"uint128\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"}],\"name\":\"Burn\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"int24\",\"name\":\"tickLower\",\"type\":\"int24\"},{\"indexed\":true,\"internalType\":\"int24\",\"name\":\"tickUpper\",\"type\":\"int24\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"amount0\",\"type\":\"uint128\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"amount1\",\"type\":\"uint128\"}],\"name\":\"Collect\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"amount0\",\"type\":\"uint128\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"amount1\",\"type\":\"uint128\"}],\"name\":\"CollectProtocol\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"paid0\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"paid1\",\"type\":\"uint256\"}],\"name\":\"Flash\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"observationCardinalityNextOld\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"observationCardinalityNextNew\",\"type\":\"uint16\"}],\"name\":\"IncreaseObservationCardinalityNext\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint160\",\"name\":\"sqrtPriceX96\",\"type\":\"uint160\"},{\"indexed\":false,\"internalType\":\"int24\",\"name\":\"tick\",\"type\":\"int24\"}],\"name\":\"Initialize\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"int24\",\"name\":\"tickLower\",\"type\":\"int24\"},{\"indexed\":true,\"internalType\":\"int24\",\"name\":\"tickUpper\",\"type\":\"int24\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"amount\",\"type\":\"uint128\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"}],\"name\":\"Mint\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"feeProtocol0Old\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"feeProtocol1Old\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"feeProtocol0New\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"feeProtocol1New\",\"type\":\"uint8\"}],\"name\":\"SetFeeProtocol\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"int256\",\"name\":\"amount0\",\"type\":\"int256\"},{\"indexed\":false,\"internalType\":\"int256\",\"name\":\"amount1\",\"type\":\"int256\"},{\"indexed\":false,\"internalType\":\"uint160\",\"name\":\"sqrtPriceX96\",\"type\":\"uint160\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"liquidity\",\"type\":\"uint128\"},{\"indexed\":false,\"internalType\":\"int24\",\"name\":\"tick\",\"type\":\"int24\"}],\"name\":\"Swap\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"int24\",\"name\":\"tickLower\",\"type\":\"int24\"},{\"internalType\":\"int24\",\"name\":\"tickUpper\",\"type\":\"int24\"},{\"internalType\":\"uint128\",\"name\":\"amount\",\"type\":\"uint128\"}],\"name\":\"burn\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"int24\",\"name\":\"tickLower\",\"type\":\"int24\"},{\"internalType\":\"int24\",\"name\":\"tickUpper\",\"type\":\"int24\"},{\"internalType\":\"uint128\",\"name\":\"amount0Requested\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"amount1Requested\",\"type\":\"uint128\"}],\"name\":\"collect\",\"outputs\":[{\"internalType\":\"uint128\",\"name\":\"amount0\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"amount1\",\"type\":\"uint128\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"factory\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"fee\",\"outputs\":[{\"internalType\":\"uint24\",\"name\":\"\",\"type\":\"uint24\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"feeGrowthGlobal0X128\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"feeGrowthGlobal1X128\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"flash\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"observationCardinalityNext\",\"type\":\"uint16\"}],\"name\":\"increaseObservationCardinalityNext\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"init\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint160\",\"name\":\"sqrtPriceX96\",\"type\":\"uint160\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"liquidity\",\"outputs\":[{\"internalType\":\"uint128\",\"name\":\"\",\"type\":\"uint128\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"maxLiquidityPerTick\",\"outputs\":[{\"internalType\":\"uint128\",\"name\":\"\",\"type\":\"uint128\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"int24\",\"name\":\"tickLower\",\"type\":\"int24\"},{\"internalType\":\"int24\",\"name\":\"tickUpper\",\"type\":\"int24\"},{\"internalType\":\"uint128\",\"name\":\"amount\",\"type\":\"uint128\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"mint\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"observations\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"blockTimestamp\",\"type\":\"uint32\"},{\"internalType\":\"int56\",\"name\":\"tickCumulative\",\"type\":\"int56\"},{\"internalType\":\"uint160\",\"name\":\"secondsPerLiquidityCumulativeX128\",\"type\":\"uint160\"},{\"internalType\":\"bool\",\"name\":\"initialized\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32[]\",\"name\":\"secondsAgos\",\"type\":\"uint32[]\"}],\"name\":\"observe\",\"outputs\":[{\"internalType\":\"int56[]\",\"name\":\"tickCumulatives\",\"type\":\"int56[]\"},{\"internalType\":\"uint160[]\",\"name\":\"secondsPerLiquidityCumulativeX128s\",\"type\":\"uint160[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"positions\",\"outputs\":[{\"internalType\":\"uint128\",\"name\":\"liquidity\",\"type\":\"uint128\"},{\"internalType\":\"uint256\",\"name\":\"feeGrowthInside0LastX128\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"feeGrowthInside1LastX128\",\"type\":\"uint256\"},{\"internalType\":\"uint128\",\"name\":\"tokensOwed0\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"tokensOwed1\",\"type\":\"uint128\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"protocolFees\",\"outputs\":[{\"internalType\":\"uint128\",\"name\":\"token0\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"token1\",\"type\":\"uint128\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"slot0\",\"outputs\":[{\"internalType\":\"uint160\",\"name\":\"sqrtPriceX96\",\"type\":\"uint160\"},{\"internalType\":\"int24\",\"name\":\"tick\",\"type\":\"int24\"},{\"internalType\":\"uint16\",\"name\":\"observationIndex\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"observationCardinality\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"observationCardinalityNext\",\"type\":\"uint16\"},{\"internalType\":\"uint8\",\"name\":\"feeProtocol_\",\"type\":\"uint8\"},{\"internalType\":\"bool\",\"name\":\"unlocked\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"int24\",\"name\":\"tickLower\",\"type\":\"int24\"},{\"internalType\":\"int24\",\"name\":\"tickUpper\",\"type\":\"int24\"}],\"name\":\"snapshotCumulativesInside\",\"outputs\":[{\"internalType\":\"int56\",\"name\":\"tickCumulativeInside\",\"type\":\"int56\"},{\"internalType\":\"uint160\",\"name\":\"secondsPerLiquidityInsideX128\",\"type\":\"uint160\"},{\"internalType\":\"uint32\",\"name\":\"secondsInside\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"zeroForOne\",\"type\":\"bool\"},{\"internalType\":\"int256\",\"name\":\"amountSpecified\",\"type\":\"int256\"},{\"internalType\":\"uint160\",\"name\":\"sqrtPriceLimitX96\",\"type\":\"uint160\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"swap\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"amount0\",\"type\":\"int256\"},{\"internalType\":\"int256\",\"name\":\"amount1\",\"type\":\"int256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"int16\",\"name\":\"\",\"type\":\"int16\"}],\"name\":\"tickBitmap\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"tickSpacing\",\"outputs\":[{\"internalType\":\"int24\",\"name\":\"\",\"type\":\"int24\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"int24\",\"name\":\"\",\"type\":\"int24\"}],\"name\":\"ticks\",\"outputs\":[{\"internalType\":\"uint128\",\"name\":\"liquidityGross\",\"type\":\"uint128\"},{\"internalType\":\"int128\",\"name\":\"liquidityNet\",\"type\":\"int128\"},{\"internalType\":\"uint256\",\"name\":\"feeGrowthOutside0X128\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"feeGrowthOutside1X128\",\"type\":\"uint256\"},{\"internalType\":\"int56\",\"name\":\"tickCumulativeOutside\",\"type\":\"int56\"},{\"internalType\":\"uint160\",\"name\":\"secondsPerLiquidityOutsideX128\",\"type\":\"uint160\"},{\"internalType\":\"uint32\",\"name\":\"secondsOutside\",\"type\":\"uint32\"},{\"internalType\":\"bool\",\"name\":\"initialized\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"token0\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"token1\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", } // Uniswapv3poolABI is the input ABI used to generate the binding from. // Deprecated: Use Uniswapv3poolMetaData.ABI instead. var Uniswapv3poolABI = Uniswapv3poolMetaData.ABI // Uniswapv3pool is an auto generated Go binding around an Ethereum contract. type Uniswapv3pool struct { Uniswapv3poolCaller // Read-only binding to the contract Uniswapv3poolTransactor // Write-only binding to the contract Uniswapv3poolFilterer // Log filterer for contract events } // Uniswapv3poolCaller is an auto generated read-only Go binding around an Ethereum contract. type Uniswapv3poolCaller struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // Uniswapv3poolTransactor is an auto generated write-only Go binding around an Ethereum contract. type Uniswapv3poolTransactor struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // Uniswapv3poolFilterer is an auto generated log filtering Go binding around an Ethereum contract events. type Uniswapv3poolFilterer struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // Uniswapv3poolSession is an auto generated Go binding around an Ethereum contract, // with pre-set call and transact options. type Uniswapv3poolSession struct { Contract *Uniswapv3pool // Generic contract binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // Uniswapv3poolCallerSession is an auto generated read-only Go binding around an Ethereum contract, // with pre-set call options. type Uniswapv3poolCallerSession struct { Contract *Uniswapv3poolCaller // Generic contract caller binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session } // Uniswapv3poolTransactorSession is an auto generated write-only Go binding around an Ethereum contract, // with pre-set transact options. type Uniswapv3poolTransactorSession struct { Contract *Uniswapv3poolTransactor // Generic contract transactor binding to set the session for TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // Uniswapv3poolRaw is an auto generated low-level Go binding around an Ethereum contract. type Uniswapv3poolRaw struct { Contract *Uniswapv3pool // Generic contract binding to access the raw methods on } // Uniswapv3poolCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. type Uniswapv3poolCallerRaw struct { Contract *Uniswapv3poolCaller // Generic read-only contract binding to access the raw methods on } // Uniswapv3poolTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. type Uniswapv3poolTransactorRaw struct { Contract *Uniswapv3poolTransactor // Generic write-only contract binding to access the raw methods on } // NewUniswapv3pool creates a new instance of Uniswapv3pool, bound to a specific deployed contract. func NewUniswapv3pool(address common.Address, backend bind.ContractBackend) (*Uniswapv3pool, error) { contract, err := bindUniswapv3pool(address, backend, backend, backend) if err != nil { return nil, err } return &Uniswapv3pool{Uniswapv3poolCaller: Uniswapv3poolCaller{contract: contract}, Uniswapv3poolTransactor: Uniswapv3poolTransactor{contract: contract}, Uniswapv3poolFilterer: Uniswapv3poolFilterer{contract: contract}}, nil } // NewUniswapv3poolCaller creates a new read-only instance of Uniswapv3pool, bound to a specific deployed contract. func NewUniswapv3poolCaller(address common.Address, caller bind.ContractCaller) (*Uniswapv3poolCaller, error) { contract, err := bindUniswapv3pool(address, caller, nil, nil) if err != nil { return nil, err } return &Uniswapv3poolCaller{contract: contract}, nil } // NewUniswapv3poolTransactor creates a new write-only instance of Uniswapv3pool, bound to a specific deployed contract. func NewUniswapv3poolTransactor(address common.Address, transactor bind.ContractTransactor) (*Uniswapv3poolTransactor, error) { contract, err := bindUniswapv3pool(address, nil, transactor, nil) if err != nil { return nil, err } return &Uniswapv3poolTransactor{contract: contract}, nil } // NewUniswapv3poolFilterer creates a new log filterer instance of Uniswapv3pool, bound to a specific deployed contract. func NewUniswapv3poolFilterer(address common.Address, filterer bind.ContractFilterer) (*Uniswapv3poolFilterer, error) { contract, err := bindUniswapv3pool(address, nil, nil, filterer) if err != nil { return nil, err } return &Uniswapv3poolFilterer{contract: contract}, nil } // bindUniswapv3pool binds a generic wrapper to an already deployed contract. func bindUniswapv3pool(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { parsed, err := abi.JSON(strings.NewReader(Uniswapv3poolABI)) if err != nil { return nil, err } return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_Uniswapv3pool *Uniswapv3poolRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _Uniswapv3pool.Contract.Uniswapv3poolCaller.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_Uniswapv3pool *Uniswapv3poolRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _Uniswapv3pool.Contract.Uniswapv3poolTransactor.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_Uniswapv3pool *Uniswapv3poolRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _Uniswapv3pool.Contract.Uniswapv3poolTransactor.contract.Transact(opts, method, params...) } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_Uniswapv3pool *Uniswapv3poolCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _Uniswapv3pool.Contract.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_Uniswapv3pool *Uniswapv3poolTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _Uniswapv3pool.Contract.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_Uniswapv3pool *Uniswapv3poolTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _Uniswapv3pool.Contract.contract.Transact(opts, method, params...) } // Factory is a free data retrieval call binding the contract method 0xc45a0155. // // Solidity: function factory() view returns(address) func (_Uniswapv3pool *Uniswapv3poolCaller) Factory(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _Uniswapv3pool.contract.Call(opts, &out, "factory") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // Factory is a free data retrieval call binding the contract method 0xc45a0155. // // Solidity: function factory() view returns(address) func (_Uniswapv3pool *Uniswapv3poolSession) Factory() (common.Address, error) { return _Uniswapv3pool.Contract.Factory(&_Uniswapv3pool.CallOpts) } // Factory is a free data retrieval call binding the contract method 0xc45a0155. // // Solidity: function factory() view returns(address) func (_Uniswapv3pool *Uniswapv3poolCallerSession) Factory() (common.Address, error) { return _Uniswapv3pool.Contract.Factory(&_Uniswapv3pool.CallOpts) } // Fee is a free data retrieval call binding the contract method 0xddca3f43. // // Solidity: function fee() view returns(uint24) func (_Uniswapv3pool *Uniswapv3poolCaller) Fee(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} err := _Uniswapv3pool.contract.Call(opts, &out, "fee") if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // Fee is a free data retrieval call binding the contract method 0xddca3f43. // // Solidity: function fee() view returns(uint24) func (_Uniswapv3pool *Uniswapv3poolSession) Fee() (*big.Int, error) { return _Uniswapv3pool.Contract.Fee(&_Uniswapv3pool.CallOpts) } // Fee is a free data retrieval call binding the contract method 0xddca3f43. // // Solidity: function fee() view returns(uint24) func (_Uniswapv3pool *Uniswapv3poolCallerSession) Fee() (*big.Int, error) { return _Uniswapv3pool.Contract.Fee(&_Uniswapv3pool.CallOpts) } // FeeGrowthGlobal0X128 is a free data retrieval call binding the contract method 0xf3058399. // // Solidity: function feeGrowthGlobal0X128() view returns(uint256) func (_Uniswapv3pool *Uniswapv3poolCaller) FeeGrowthGlobal0X128(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} err := _Uniswapv3pool.contract.Call(opts, &out, "feeGrowthGlobal0X128") if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // FeeGrowthGlobal0X128 is a free data retrieval call binding the contract method 0xf3058399. // // Solidity: function feeGrowthGlobal0X128() view returns(uint256) func (_Uniswapv3pool *Uniswapv3poolSession) FeeGrowthGlobal0X128() (*big.Int, error) { return _Uniswapv3pool.Contract.FeeGrowthGlobal0X128(&_Uniswapv3pool.CallOpts) } // FeeGrowthGlobal0X128 is a free data retrieval call binding the contract method 0xf3058399. // // Solidity: function feeGrowthGlobal0X128() view returns(uint256) func (_Uniswapv3pool *Uniswapv3poolCallerSession) FeeGrowthGlobal0X128() (*big.Int, error) { return _Uniswapv3pool.Contract.FeeGrowthGlobal0X128(&_Uniswapv3pool.CallOpts) } // FeeGrowthGlobal1X128 is a free data retrieval call binding the contract method 0x46141319. // // Solidity: function feeGrowthGlobal1X128() view returns(uint256) func (_Uniswapv3pool *Uniswapv3poolCaller) FeeGrowthGlobal1X128(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} err := _Uniswapv3pool.contract.Call(opts, &out, "feeGrowthGlobal1X128") if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // FeeGrowthGlobal1X128 is a free data retrieval call binding the contract method 0x46141319. // // Solidity: function feeGrowthGlobal1X128() view returns(uint256) func (_Uniswapv3pool *Uniswapv3poolSession) FeeGrowthGlobal1X128() (*big.Int, error) { return _Uniswapv3pool.Contract.FeeGrowthGlobal1X128(&_Uniswapv3pool.CallOpts) } // FeeGrowthGlobal1X128 is a free data retrieval call binding the contract method 0x46141319. // // Solidity: function feeGrowthGlobal1X128() view returns(uint256) func (_Uniswapv3pool *Uniswapv3poolCallerSession) FeeGrowthGlobal1X128() (*big.Int, error) { return _Uniswapv3pool.Contract.FeeGrowthGlobal1X128(&_Uniswapv3pool.CallOpts) } // Liquidity is a free data retrieval call binding the contract method 0x1a686502. // // Solidity: function liquidity() view returns(uint128) func (_Uniswapv3pool *Uniswapv3poolCaller) Liquidity(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} err := _Uniswapv3pool.contract.Call(opts, &out, "liquidity") if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // Liquidity is a free data retrieval call binding the contract method 0x1a686502. // // Solidity: function liquidity() view returns(uint128) func (_Uniswapv3pool *Uniswapv3poolSession) Liquidity() (*big.Int, error) { return _Uniswapv3pool.Contract.Liquidity(&_Uniswapv3pool.CallOpts) } // Liquidity is a free data retrieval call binding the contract method 0x1a686502. // // Solidity: function liquidity() view returns(uint128) func (_Uniswapv3pool *Uniswapv3poolCallerSession) Liquidity() (*big.Int, error) { return _Uniswapv3pool.Contract.Liquidity(&_Uniswapv3pool.CallOpts) } // MaxLiquidityPerTick is a free data retrieval call binding the contract method 0x70cf754a. // // Solidity: function maxLiquidityPerTick() view returns(uint128) func (_Uniswapv3pool *Uniswapv3poolCaller) MaxLiquidityPerTick(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} err := _Uniswapv3pool.contract.Call(opts, &out, "maxLiquidityPerTick") if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // MaxLiquidityPerTick is a free data retrieval call binding the contract method 0x70cf754a. // // Solidity: function maxLiquidityPerTick() view returns(uint128) func (_Uniswapv3pool *Uniswapv3poolSession) MaxLiquidityPerTick() (*big.Int, error) { return _Uniswapv3pool.Contract.MaxLiquidityPerTick(&_Uniswapv3pool.CallOpts) } // MaxLiquidityPerTick is a free data retrieval call binding the contract method 0x70cf754a. // // Solidity: function maxLiquidityPerTick() view returns(uint128) func (_Uniswapv3pool *Uniswapv3poolCallerSession) MaxLiquidityPerTick() (*big.Int, error) { return _Uniswapv3pool.Contract.MaxLiquidityPerTick(&_Uniswapv3pool.CallOpts) } // Observations is a free data retrieval call binding the contract method 0x252c09d7. // // Solidity: function observations(uint256 ) view returns(uint32 blockTimestamp, int56 tickCumulative, uint160 secondsPerLiquidityCumulativeX128, bool initialized) func (_Uniswapv3pool *Uniswapv3poolCaller) Observations(opts *bind.CallOpts, arg0 *big.Int) (struct { BlockTimestamp uint32 TickCumulative *big.Int SecondsPerLiquidityCumulativeX128 *big.Int Initialized bool }, error) { var out []interface{} err := _Uniswapv3pool.contract.Call(opts, &out, "observations", arg0) outstruct := new(struct { BlockTimestamp uint32 TickCumulative *big.Int SecondsPerLiquidityCumulativeX128 *big.Int Initialized bool }) if err != nil { return *outstruct, err } outstruct.BlockTimestamp = *abi.ConvertType(out[0], new(uint32)).(*uint32) outstruct.TickCumulative = *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) outstruct.SecondsPerLiquidityCumulativeX128 = *abi.ConvertType(out[2], new(*big.Int)).(**big.Int) outstruct.Initialized = *abi.ConvertType(out[3], new(bool)).(*bool) return *outstruct, err } // Observations is a free data retrieval call binding the contract method 0x252c09d7. // // Solidity: function observations(uint256 ) view returns(uint32 blockTimestamp, int56 tickCumulative, uint160 secondsPerLiquidityCumulativeX128, bool initialized) func (_Uniswapv3pool *Uniswapv3poolSession) Observations(arg0 *big.Int) (struct { BlockTimestamp uint32 TickCumulative *big.Int SecondsPerLiquidityCumulativeX128 *big.Int Initialized bool }, error) { return _Uniswapv3pool.Contract.Observations(&_Uniswapv3pool.CallOpts, arg0) } // Observations is a free data retrieval call binding the contract method 0x252c09d7. // // Solidity: function observations(uint256 ) view returns(uint32 blockTimestamp, int56 tickCumulative, uint160 secondsPerLiquidityCumulativeX128, bool initialized) func (_Uniswapv3pool *Uniswapv3poolCallerSession) Observations(arg0 *big.Int) (struct { BlockTimestamp uint32 TickCumulative *big.Int SecondsPerLiquidityCumulativeX128 *big.Int Initialized bool }, error) { return _Uniswapv3pool.Contract.Observations(&_Uniswapv3pool.CallOpts, arg0) } // Observe is a free data retrieval call binding the contract method 0x883bdbfd. // // Solidity: function observe(uint32[] secondsAgos) view returns(int56[] tickCumulatives, uint160[] secondsPerLiquidityCumulativeX128s) func (_Uniswapv3pool *Uniswapv3poolCaller) Observe(opts *bind.CallOpts, secondsAgos []uint32) (struct { TickCumulatives []*big.Int SecondsPerLiquidityCumulativeX128s []*big.Int }, error) { var out []interface{} err := _Uniswapv3pool.contract.Call(opts, &out, "observe", secondsAgos) outstruct := new(struct { TickCumulatives []*big.Int SecondsPerLiquidityCumulativeX128s []*big.Int }) if err != nil { return *outstruct, err } outstruct.TickCumulatives = *abi.ConvertType(out[0], new([]*big.Int)).(*[]*big.Int) outstruct.SecondsPerLiquidityCumulativeX128s = *abi.ConvertType(out[1], new([]*big.Int)).(*[]*big.Int) return *outstruct, err } // Observe is a free data retrieval call binding the contract method 0x883bdbfd. // // Solidity: function observe(uint32[] secondsAgos) view returns(int56[] tickCumulatives, uint160[] secondsPerLiquidityCumulativeX128s) func (_Uniswapv3pool *Uniswapv3poolSession) Observe(secondsAgos []uint32) (struct { TickCumulatives []*big.Int SecondsPerLiquidityCumulativeX128s []*big.Int }, error) { return _Uniswapv3pool.Contract.Observe(&_Uniswapv3pool.CallOpts, secondsAgos) } // Observe is a free data retrieval call binding the contract method 0x883bdbfd. // // Solidity: function observe(uint32[] secondsAgos) view returns(int56[] tickCumulatives, uint160[] secondsPerLiquidityCumulativeX128s) func (_Uniswapv3pool *Uniswapv3poolCallerSession) Observe(secondsAgos []uint32) (struct { TickCumulatives []*big.Int SecondsPerLiquidityCumulativeX128s []*big.Int }, error) { return _Uniswapv3pool.Contract.Observe(&_Uniswapv3pool.CallOpts, secondsAgos) } // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. // // Solidity: function owner() view returns(address) func (_Uniswapv3pool *Uniswapv3poolCaller) Owner(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _Uniswapv3pool.contract.Call(opts, &out, "owner") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. // // Solidity: function owner() view returns(address) func (_Uniswapv3pool *Uniswapv3poolSession) Owner() (common.Address, error) { return _Uniswapv3pool.Contract.Owner(&_Uniswapv3pool.CallOpts) } // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. // // Solidity: function owner() view returns(address) func (_Uniswapv3pool *Uniswapv3poolCallerSession) Owner() (common.Address, error) { return _Uniswapv3pool.Contract.Owner(&_Uniswapv3pool.CallOpts) } // Positions is a free data retrieval call binding the contract method 0x514ea4bf. // // Solidity: function positions(bytes32 ) view returns(uint128 liquidity, uint256 feeGrowthInside0LastX128, uint256 feeGrowthInside1LastX128, uint128 tokensOwed0, uint128 tokensOwed1) func (_Uniswapv3pool *Uniswapv3poolCaller) Positions(opts *bind.CallOpts, arg0 [32]byte) (struct { Liquidity *big.Int FeeGrowthInside0LastX128 *big.Int FeeGrowthInside1LastX128 *big.Int TokensOwed0 *big.Int TokensOwed1 *big.Int }, error) { var out []interface{} err := _Uniswapv3pool.contract.Call(opts, &out, "positions", arg0) outstruct := new(struct { Liquidity *big.Int FeeGrowthInside0LastX128 *big.Int FeeGrowthInside1LastX128 *big.Int TokensOwed0 *big.Int TokensOwed1 *big.Int }) if err != nil { return *outstruct, err } outstruct.Liquidity = *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) outstruct.FeeGrowthInside0LastX128 = *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) outstruct.FeeGrowthInside1LastX128 = *abi.ConvertType(out[2], new(*big.Int)).(**big.Int) outstruct.TokensOwed0 = *abi.ConvertType(out[3], new(*big.Int)).(**big.Int) outstruct.TokensOwed1 = *abi.ConvertType(out[4], new(*big.Int)).(**big.Int) return *outstruct, err } // Positions is a free data retrieval call binding the contract method 0x514ea4bf. // // Solidity: function positions(bytes32 ) view returns(uint128 liquidity, uint256 feeGrowthInside0LastX128, uint256 feeGrowthInside1LastX128, uint128 tokensOwed0, uint128 tokensOwed1) func (_Uniswapv3pool *Uniswapv3poolSession) Positions(arg0 [32]byte) (struct { Liquidity *big.Int FeeGrowthInside0LastX128 *big.Int FeeGrowthInside1LastX128 *big.Int TokensOwed0 *big.Int TokensOwed1 *big.Int }, error) { return _Uniswapv3pool.Contract.Positions(&_Uniswapv3pool.CallOpts, arg0) } // Positions is a free data retrieval call binding the contract method 0x514ea4bf. // // Solidity: function positions(bytes32 ) view returns(uint128 liquidity, uint256 feeGrowthInside0LastX128, uint256 feeGrowthInside1LastX128, uint128 tokensOwed0, uint128 tokensOwed1) func (_Uniswapv3pool *Uniswapv3poolCallerSession) Positions(arg0 [32]byte) (struct { Liquidity *big.Int FeeGrowthInside0LastX128 *big.Int FeeGrowthInside1LastX128 *big.Int TokensOwed0 *big.Int TokensOwed1 *big.Int }, error) { return _Uniswapv3pool.Contract.Positions(&_Uniswapv3pool.CallOpts, arg0) } // ProtocolFees is a free data retrieval call binding the contract method 0x1ad8b03b. // // Solidity: function protocolFees() view returns(uint128 token0, uint128 token1) func (_Uniswapv3pool *Uniswapv3poolCaller) ProtocolFees(opts *bind.CallOpts) (struct { Token0 *big.Int Token1 *big.Int }, error) { var out []interface{} err := _Uniswapv3pool.contract.Call(opts, &out, "protocolFees") outstruct := new(struct { Token0 *big.Int Token1 *big.Int }) if err != nil { return *outstruct, err } outstruct.Token0 = *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) outstruct.Token1 = *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) return *outstruct, err } // ProtocolFees is a free data retrieval call binding the contract method 0x1ad8b03b. // // Solidity: function protocolFees() view returns(uint128 token0, uint128 token1) func (_Uniswapv3pool *Uniswapv3poolSession) ProtocolFees() (struct { Token0 *big.Int Token1 *big.Int }, error) { return _Uniswapv3pool.Contract.ProtocolFees(&_Uniswapv3pool.CallOpts) } // ProtocolFees is a free data retrieval call binding the contract method 0x1ad8b03b. // // Solidity: function protocolFees() view returns(uint128 token0, uint128 token1) func (_Uniswapv3pool *Uniswapv3poolCallerSession) ProtocolFees() (struct { Token0 *big.Int Token1 *big.Int }, error) { return _Uniswapv3pool.Contract.ProtocolFees(&_Uniswapv3pool.CallOpts) } // Slot0 is a free data retrieval call binding the contract method 0x3850c7bd. // // Solidity: function slot0() view returns(uint160 sqrtPriceX96, int24 tick, uint16 observationIndex, uint16 observationCardinality, uint16 observationCardinalityNext, uint8 feeProtocol_, bool unlocked) func (_Uniswapv3pool *Uniswapv3poolCaller) Slot0(opts *bind.CallOpts) (struct { SqrtPriceX96 *big.Int Tick *big.Int ObservationIndex uint16 ObservationCardinality uint16 ObservationCardinalityNext uint16 FeeProtocol uint8 Unlocked bool }, error) { var out []interface{} err := _Uniswapv3pool.contract.Call(opts, &out, "slot0") outstruct := new(struct { SqrtPriceX96 *big.Int Tick *big.Int ObservationIndex uint16 ObservationCardinality uint16 ObservationCardinalityNext uint16 FeeProtocol uint8 Unlocked bool }) if err != nil { return *outstruct, err } outstruct.SqrtPriceX96 = *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) outstruct.Tick = *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) outstruct.ObservationIndex = *abi.ConvertType(out[2], new(uint16)).(*uint16) outstruct.ObservationCardinality = *abi.ConvertType(out[3], new(uint16)).(*uint16) outstruct.ObservationCardinalityNext = *abi.ConvertType(out[4], new(uint16)).(*uint16) outstruct.FeeProtocol = *abi.ConvertType(out[5], new(uint8)).(*uint8) outstruct.Unlocked = *abi.ConvertType(out[6], new(bool)).(*bool) return *outstruct, err } // Slot0 is a free data retrieval call binding the contract method 0x3850c7bd. // // Solidity: function slot0() view returns(uint160 sqrtPriceX96, int24 tick, uint16 observationIndex, uint16 observationCardinality, uint16 observationCardinalityNext, uint8 feeProtocol_, bool unlocked) func (_Uniswapv3pool *Uniswapv3poolSession) Slot0() (struct { SqrtPriceX96 *big.Int Tick *big.Int ObservationIndex uint16 ObservationCardinality uint16 ObservationCardinalityNext uint16 FeeProtocol uint8 Unlocked bool }, error) { return _Uniswapv3pool.Contract.Slot0(&_Uniswapv3pool.CallOpts) } // Slot0 is a free data retrieval call binding the contract method 0x3850c7bd. // // Solidity: function slot0() view returns(uint160 sqrtPriceX96, int24 tick, uint16 observationIndex, uint16 observationCardinality, uint16 observationCardinalityNext, uint8 feeProtocol_, bool unlocked) func (_Uniswapv3pool *Uniswapv3poolCallerSession) Slot0() (struct { SqrtPriceX96 *big.Int Tick *big.Int ObservationIndex uint16 ObservationCardinality uint16 ObservationCardinalityNext uint16 FeeProtocol uint8 Unlocked bool }, error) { return _Uniswapv3pool.Contract.Slot0(&_Uniswapv3pool.CallOpts) } // SnapshotCumulativesInside is a free data retrieval call binding the contract method 0xa38807f2. // // Solidity: function snapshotCumulativesInside(int24 tickLower, int24 tickUpper) view returns(int56 tickCumulativeInside, uint160 secondsPerLiquidityInsideX128, uint32 secondsInside) func (_Uniswapv3pool *Uniswapv3poolCaller) SnapshotCumulativesInside(opts *bind.CallOpts, tickLower *big.Int, tickUpper *big.Int) (struct { TickCumulativeInside *big.Int SecondsPerLiquidityInsideX128 *big.Int SecondsInside uint32 }, error) { var out []interface{} err := _Uniswapv3pool.contract.Call(opts, &out, "snapshotCumulativesInside", tickLower, tickUpper) outstruct := new(struct { TickCumulativeInside *big.Int SecondsPerLiquidityInsideX128 *big.Int SecondsInside uint32 }) if err != nil { return *outstruct, err } outstruct.TickCumulativeInside = *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) outstruct.SecondsPerLiquidityInsideX128 = *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) outstruct.SecondsInside = *abi.ConvertType(out[2], new(uint32)).(*uint32) return *outstruct, err } // SnapshotCumulativesInside is a free data retrieval call binding the contract method 0xa38807f2. // // Solidity: function snapshotCumulativesInside(int24 tickLower, int24 tickUpper) view returns(int56 tickCumulativeInside, uint160 secondsPerLiquidityInsideX128, uint32 secondsInside) func (_Uniswapv3pool *Uniswapv3poolSession) SnapshotCumulativesInside(tickLower *big.Int, tickUpper *big.Int) (struct { TickCumulativeInside *big.Int SecondsPerLiquidityInsideX128 *big.Int SecondsInside uint32 }, error) { return _Uniswapv3pool.Contract.SnapshotCumulativesInside(&_Uniswapv3pool.CallOpts, tickLower, tickUpper) } // SnapshotCumulativesInside is a free data retrieval call binding the contract method 0xa38807f2. // // Solidity: function snapshotCumulativesInside(int24 tickLower, int24 tickUpper) view returns(int56 tickCumulativeInside, uint160 secondsPerLiquidityInsideX128, uint32 secondsInside) func (_Uniswapv3pool *Uniswapv3poolCallerSession) SnapshotCumulativesInside(tickLower *big.Int, tickUpper *big.Int) (struct { TickCumulativeInside *big.Int SecondsPerLiquidityInsideX128 *big.Int SecondsInside uint32 }, error) { return _Uniswapv3pool.Contract.SnapshotCumulativesInside(&_Uniswapv3pool.CallOpts, tickLower, tickUpper) } // TickBitmap is a free data retrieval call binding the contract method 0x5339c296. // // Solidity: function tickBitmap(int16 ) view returns(uint256) func (_Uniswapv3pool *Uniswapv3poolCaller) TickBitmap(opts *bind.CallOpts, arg0 int16) (*big.Int, error) { var out []interface{} err := _Uniswapv3pool.contract.Call(opts, &out, "tickBitmap", arg0) if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // TickBitmap is a free data retrieval call binding the contract method 0x5339c296. // // Solidity: function tickBitmap(int16 ) view returns(uint256) func (_Uniswapv3pool *Uniswapv3poolSession) TickBitmap(arg0 int16) (*big.Int, error) { return _Uniswapv3pool.Contract.TickBitmap(&_Uniswapv3pool.CallOpts, arg0) } // TickBitmap is a free data retrieval call binding the contract method 0x5339c296. // // Solidity: function tickBitmap(int16 ) view returns(uint256) func (_Uniswapv3pool *Uniswapv3poolCallerSession) TickBitmap(arg0 int16) (*big.Int, error) { return _Uniswapv3pool.Contract.TickBitmap(&_Uniswapv3pool.CallOpts, arg0) } // TickSpacing is a free data retrieval call binding the contract method 0xd0c93a7c. // // Solidity: function tickSpacing() view returns(int24) func (_Uniswapv3pool *Uniswapv3poolCaller) TickSpacing(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} err := _Uniswapv3pool.contract.Call(opts, &out, "tickSpacing") if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // TickSpacing is a free data retrieval call binding the contract method 0xd0c93a7c. // // Solidity: function tickSpacing() view returns(int24) func (_Uniswapv3pool *Uniswapv3poolSession) TickSpacing() (*big.Int, error) { return _Uniswapv3pool.Contract.TickSpacing(&_Uniswapv3pool.CallOpts) } // TickSpacing is a free data retrieval call binding the contract method 0xd0c93a7c. // // Solidity: function tickSpacing() view returns(int24) func (_Uniswapv3pool *Uniswapv3poolCallerSession) TickSpacing() (*big.Int, error) { return _Uniswapv3pool.Contract.TickSpacing(&_Uniswapv3pool.CallOpts) } // Ticks is a free data retrieval call binding the contract method 0xf30dba93. // // Solidity: function ticks(int24 ) view returns(uint128 liquidityGross, int128 liquidityNet, uint256 feeGrowthOutside0X128, uint256 feeGrowthOutside1X128, int56 tickCumulativeOutside, uint160 secondsPerLiquidityOutsideX128, uint32 secondsOutside, bool initialized) func (_Uniswapv3pool *Uniswapv3poolCaller) Ticks(opts *bind.CallOpts, arg0 *big.Int) (struct { LiquidityGross *big.Int LiquidityNet *big.Int FeeGrowthOutside0X128 *big.Int FeeGrowthOutside1X128 *big.Int TickCumulativeOutside *big.Int SecondsPerLiquidityOutsideX128 *big.Int SecondsOutside uint32 Initialized bool }, error) { var out []interface{} err := _Uniswapv3pool.contract.Call(opts, &out, "ticks", arg0) outstruct := new(struct { LiquidityGross *big.Int LiquidityNet *big.Int FeeGrowthOutside0X128 *big.Int FeeGrowthOutside1X128 *big.Int TickCumulativeOutside *big.Int SecondsPerLiquidityOutsideX128 *big.Int SecondsOutside uint32 Initialized bool }) if err != nil { return *outstruct, err } outstruct.LiquidityGross = *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) outstruct.LiquidityNet = *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) outstruct.FeeGrowthOutside0X128 = *abi.ConvertType(out[2], new(*big.Int)).(**big.Int) outstruct.FeeGrowthOutside1X128 = *abi.ConvertType(out[3], new(*big.Int)).(**big.Int) outstruct.TickCumulativeOutside = *abi.ConvertType(out[4], new(*big.Int)).(**big.Int) outstruct.SecondsPerLiquidityOutsideX128 = *abi.ConvertType(out[5], new(*big.Int)).(**big.Int) outstruct.SecondsOutside = *abi.ConvertType(out[6], new(uint32)).(*uint32) outstruct.Initialized = *abi.ConvertType(out[7], new(bool)).(*bool) return *outstruct, err } // Ticks is a free data retrieval call binding the contract method 0xf30dba93. // // Solidity: function ticks(int24 ) view returns(uint128 liquidityGross, int128 liquidityNet, uint256 feeGrowthOutside0X128, uint256 feeGrowthOutside1X128, int56 tickCumulativeOutside, uint160 secondsPerLiquidityOutsideX128, uint32 secondsOutside, bool initialized) func (_Uniswapv3pool *Uniswapv3poolSession) Ticks(arg0 *big.Int) (struct { LiquidityGross *big.Int LiquidityNet *big.Int FeeGrowthOutside0X128 *big.Int FeeGrowthOutside1X128 *big.Int TickCumulativeOutside *big.Int SecondsPerLiquidityOutsideX128 *big.Int SecondsOutside uint32 Initialized bool }, error) { return _Uniswapv3pool.Contract.Ticks(&_Uniswapv3pool.CallOpts, arg0) } // Ticks is a free data retrieval call binding the contract method 0xf30dba93. // // Solidity: function ticks(int24 ) view returns(uint128 liquidityGross, int128 liquidityNet, uint256 feeGrowthOutside0X128, uint256 feeGrowthOutside1X128, int56 tickCumulativeOutside, uint160 secondsPerLiquidityOutsideX128, uint32 secondsOutside, bool initialized) func (_Uniswapv3pool *Uniswapv3poolCallerSession) Ticks(arg0 *big.Int) (struct { LiquidityGross *big.Int LiquidityNet *big.Int FeeGrowthOutside0X128 *big.Int FeeGrowthOutside1X128 *big.Int TickCumulativeOutside *big.Int SecondsPerLiquidityOutsideX128 *big.Int SecondsOutside uint32 Initialized bool }, error) { return _Uniswapv3pool.Contract.Ticks(&_Uniswapv3pool.CallOpts, arg0) } // Token0 is a free data retrieval call binding the contract method 0x0dfe1681. // // Solidity: function token0() view returns(address) func (_Uniswapv3pool *Uniswapv3poolCaller) Token0(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _Uniswapv3pool.contract.Call(opts, &out, "token0") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // Token0 is a free data retrieval call binding the contract method 0x0dfe1681. // // Solidity: function token0() view returns(address) func (_Uniswapv3pool *Uniswapv3poolSession) Token0() (common.Address, error) { return _Uniswapv3pool.Contract.Token0(&_Uniswapv3pool.CallOpts) } // Token0 is a free data retrieval call binding the contract method 0x0dfe1681. // // Solidity: function token0() view returns(address) func (_Uniswapv3pool *Uniswapv3poolCallerSession) Token0() (common.Address, error) { return _Uniswapv3pool.Contract.Token0(&_Uniswapv3pool.CallOpts) } // Token1 is a free data retrieval call binding the contract method 0xd21220a7. // // Solidity: function token1() view returns(address) func (_Uniswapv3pool *Uniswapv3poolCaller) Token1(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _Uniswapv3pool.contract.Call(opts, &out, "token1") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // Token1 is a free data retrieval call binding the contract method 0xd21220a7. // // Solidity: function token1() view returns(address) func (_Uniswapv3pool *Uniswapv3poolSession) Token1() (common.Address, error) { return _Uniswapv3pool.Contract.Token1(&_Uniswapv3pool.CallOpts) } // Token1 is a free data retrieval call binding the contract method 0xd21220a7. // // Solidity: function token1() view returns(address) func (_Uniswapv3pool *Uniswapv3poolCallerSession) Token1() (common.Address, error) { return _Uniswapv3pool.Contract.Token1(&_Uniswapv3pool.CallOpts) } // Burn is a paid mutator transaction binding the contract method 0xa34123a7. // // Solidity: function burn(int24 tickLower, int24 tickUpper, uint128 amount) returns(uint256 amount0, uint256 amount1) func (_Uniswapv3pool *Uniswapv3poolTransactor) Burn(opts *bind.TransactOpts, tickLower *big.Int, tickUpper *big.Int, amount *big.Int) (*types.Transaction, error) { return _Uniswapv3pool.contract.Transact(opts, "burn", tickLower, tickUpper, amount) } // Burn is a paid mutator transaction binding the contract method 0xa34123a7. // // Solidity: function burn(int24 tickLower, int24 tickUpper, uint128 amount) returns(uint256 amount0, uint256 amount1) func (_Uniswapv3pool *Uniswapv3poolSession) Burn(tickLower *big.Int, tickUpper *big.Int, amount *big.Int) (*types.Transaction, error) { return _Uniswapv3pool.Contract.Burn(&_Uniswapv3pool.TransactOpts, tickLower, tickUpper, amount) } // Burn is a paid mutator transaction binding the contract method 0xa34123a7. // // Solidity: function burn(int24 tickLower, int24 tickUpper, uint128 amount) returns(uint256 amount0, uint256 amount1) func (_Uniswapv3pool *Uniswapv3poolTransactorSession) Burn(tickLower *big.Int, tickUpper *big.Int, amount *big.Int) (*types.Transaction, error) { return _Uniswapv3pool.Contract.Burn(&_Uniswapv3pool.TransactOpts, tickLower, tickUpper, amount) } // Collect is a paid mutator transaction binding the contract method 0x4f1eb3d8. // // Solidity: function collect(address recipient, int24 tickLower, int24 tickUpper, uint128 amount0Requested, uint128 amount1Requested) returns(uint128 amount0, uint128 amount1) func (_Uniswapv3pool *Uniswapv3poolTransactor) Collect(opts *bind.TransactOpts, recipient common.Address, tickLower *big.Int, tickUpper *big.Int, amount0Requested *big.Int, amount1Requested *big.Int) (*types.Transaction, error) { return _Uniswapv3pool.contract.Transact(opts, "collect", recipient, tickLower, tickUpper, amount0Requested, amount1Requested) } // Collect is a paid mutator transaction binding the contract method 0x4f1eb3d8. // // Solidity: function collect(address recipient, int24 tickLower, int24 tickUpper, uint128 amount0Requested, uint128 amount1Requested) returns(uint128 amount0, uint128 amount1) func (_Uniswapv3pool *Uniswapv3poolSession) Collect(recipient common.Address, tickLower *big.Int, tickUpper *big.Int, amount0Requested *big.Int, amount1Requested *big.Int) (*types.Transaction, error) { return _Uniswapv3pool.Contract.Collect(&_Uniswapv3pool.TransactOpts, recipient, tickLower, tickUpper, amount0Requested, amount1Requested) } // Collect is a paid mutator transaction binding the contract method 0x4f1eb3d8. // // Solidity: function collect(address recipient, int24 tickLower, int24 tickUpper, uint128 amount0Requested, uint128 amount1Requested) returns(uint128 amount0, uint128 amount1) func (_Uniswapv3pool *Uniswapv3poolTransactorSession) Collect(recipient common.Address, tickLower *big.Int, tickUpper *big.Int, amount0Requested *big.Int, amount1Requested *big.Int) (*types.Transaction, error) { return _Uniswapv3pool.Contract.Collect(&_Uniswapv3pool.TransactOpts, recipient, tickLower, tickUpper, amount0Requested, amount1Requested) } // Flash is a paid mutator transaction binding the contract method 0x490e6cbc. // // Solidity: function flash(address recipient, uint256 amount0, uint256 amount1, bytes data) returns() func (_Uniswapv3pool *Uniswapv3poolTransactor) Flash(opts *bind.TransactOpts, recipient common.Address, amount0 *big.Int, amount1 *big.Int, data []byte) (*types.Transaction, error) { return _Uniswapv3pool.contract.Transact(opts, "flash", recipient, amount0, amount1, data) } // Flash is a paid mutator transaction binding the contract method 0x490e6cbc. // // Solidity: function flash(address recipient, uint256 amount0, uint256 amount1, bytes data) returns() func (_Uniswapv3pool *Uniswapv3poolSession) Flash(recipient common.Address, amount0 *big.Int, amount1 *big.Int, data []byte) (*types.Transaction, error) { return _Uniswapv3pool.Contract.Flash(&_Uniswapv3pool.TransactOpts, recipient, amount0, amount1, data) } // Flash is a paid mutator transaction binding the contract method 0x490e6cbc. // // Solidity: function flash(address recipient, uint256 amount0, uint256 amount1, bytes data) returns() func (_Uniswapv3pool *Uniswapv3poolTransactorSession) Flash(recipient common.Address, amount0 *big.Int, amount1 *big.Int, data []byte) (*types.Transaction, error) { return _Uniswapv3pool.Contract.Flash(&_Uniswapv3pool.TransactOpts, recipient, amount0, amount1, data) } // IncreaseObservationCardinalityNext is a paid mutator transaction binding the contract method 0x32148f67. // // Solidity: function increaseObservationCardinalityNext(uint16 observationCardinalityNext) returns() func (_Uniswapv3pool *Uniswapv3poolTransactor) IncreaseObservationCardinalityNext(opts *bind.TransactOpts, observationCardinalityNext uint16) (*types.Transaction, error) { return _Uniswapv3pool.contract.Transact(opts, "increaseObservationCardinalityNext", observationCardinalityNext) } // IncreaseObservationCardinalityNext is a paid mutator transaction binding the contract method 0x32148f67. // // Solidity: function increaseObservationCardinalityNext(uint16 observationCardinalityNext) returns() func (_Uniswapv3pool *Uniswapv3poolSession) IncreaseObservationCardinalityNext(observationCardinalityNext uint16) (*types.Transaction, error) { return _Uniswapv3pool.Contract.IncreaseObservationCardinalityNext(&_Uniswapv3pool.TransactOpts, observationCardinalityNext) } // IncreaseObservationCardinalityNext is a paid mutator transaction binding the contract method 0x32148f67. // // Solidity: function increaseObservationCardinalityNext(uint16 observationCardinalityNext) returns() func (_Uniswapv3pool *Uniswapv3poolTransactorSession) IncreaseObservationCardinalityNext(observationCardinalityNext uint16) (*types.Transaction, error) { return _Uniswapv3pool.Contract.IncreaseObservationCardinalityNext(&_Uniswapv3pool.TransactOpts, observationCardinalityNext) } // Init is a paid mutator transaction binding the contract method 0xe1c7392a. // // Solidity: function init() returns() func (_Uniswapv3pool *Uniswapv3poolTransactor) Init(opts *bind.TransactOpts) (*types.Transaction, error) { return _Uniswapv3pool.contract.Transact(opts, "init") } // Init is a paid mutator transaction binding the contract method 0xe1c7392a. // // Solidity: function init() returns() func (_Uniswapv3pool *Uniswapv3poolSession) Init() (*types.Transaction, error) { return _Uniswapv3pool.Contract.Init(&_Uniswapv3pool.TransactOpts) } // Init is a paid mutator transaction binding the contract method 0xe1c7392a. // // Solidity: function init() returns() func (_Uniswapv3pool *Uniswapv3poolTransactorSession) Init() (*types.Transaction, error) { return _Uniswapv3pool.Contract.Init(&_Uniswapv3pool.TransactOpts) } // Initialize is a paid mutator transaction binding the contract method 0xf637731d. // // Solidity: function initialize(uint160 sqrtPriceX96) returns() func (_Uniswapv3pool *Uniswapv3poolTransactor) Initialize(opts *bind.TransactOpts, sqrtPriceX96 *big.Int) (*types.Transaction, error) { return _Uniswapv3pool.contract.Transact(opts, "initialize", sqrtPriceX96) } // Initialize is a paid mutator transaction binding the contract method 0xf637731d. // // Solidity: function initialize(uint160 sqrtPriceX96) returns() func (_Uniswapv3pool *Uniswapv3poolSession) Initialize(sqrtPriceX96 *big.Int) (*types.Transaction, error) { return _Uniswapv3pool.Contract.Initialize(&_Uniswapv3pool.TransactOpts, sqrtPriceX96) } // Initialize is a paid mutator transaction binding the contract method 0xf637731d. // // Solidity: function initialize(uint160 sqrtPriceX96) returns() func (_Uniswapv3pool *Uniswapv3poolTransactorSession) Initialize(sqrtPriceX96 *big.Int) (*types.Transaction, error) { return _Uniswapv3pool.Contract.Initialize(&_Uniswapv3pool.TransactOpts, sqrtPriceX96) } // Mint is a paid mutator transaction binding the contract method 0x3c8a7d8d. // // Solidity: function mint(address recipient, int24 tickLower, int24 tickUpper, uint128 amount, bytes data) returns(uint256 amount0, uint256 amount1) func (_Uniswapv3pool *Uniswapv3poolTransactor) Mint(opts *bind.TransactOpts, recipient common.Address, tickLower *big.Int, tickUpper *big.Int, amount *big.Int, data []byte) (*types.Transaction, error) { return _Uniswapv3pool.contract.Transact(opts, "mint", recipient, tickLower, tickUpper, amount, data) } // Mint is a paid mutator transaction binding the contract method 0x3c8a7d8d. // // Solidity: function mint(address recipient, int24 tickLower, int24 tickUpper, uint128 amount, bytes data) returns(uint256 amount0, uint256 amount1) func (_Uniswapv3pool *Uniswapv3poolSession) Mint(recipient common.Address, tickLower *big.Int, tickUpper *big.Int, amount *big.Int, data []byte) (*types.Transaction, error) { return _Uniswapv3pool.Contract.Mint(&_Uniswapv3pool.TransactOpts, recipient, tickLower, tickUpper, amount, data) } // Mint is a paid mutator transaction binding the contract method 0x3c8a7d8d. // // Solidity: function mint(address recipient, int24 tickLower, int24 tickUpper, uint128 amount, bytes data) returns(uint256 amount0, uint256 amount1) func (_Uniswapv3pool *Uniswapv3poolTransactorSession) Mint(recipient common.Address, tickLower *big.Int, tickUpper *big.Int, amount *big.Int, data []byte) (*types.Transaction, error) { return _Uniswapv3pool.Contract.Mint(&_Uniswapv3pool.TransactOpts, recipient, tickLower, tickUpper, amount, data) } // RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. // // Solidity: function renounceOwnership() returns() func (_Uniswapv3pool *Uniswapv3poolTransactor) RenounceOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { return _Uniswapv3pool.contract.Transact(opts, "renounceOwnership") } // RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. // // Solidity: function renounceOwnership() returns() func (_Uniswapv3pool *Uniswapv3poolSession) RenounceOwnership() (*types.Transaction, error) { return _Uniswapv3pool.Contract.RenounceOwnership(&_Uniswapv3pool.TransactOpts) } // RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. // // Solidity: function renounceOwnership() returns() func (_Uniswapv3pool *Uniswapv3poolTransactorSession) RenounceOwnership() (*types.Transaction, error) { return _Uniswapv3pool.Contract.RenounceOwnership(&_Uniswapv3pool.TransactOpts) } // Swap is a paid mutator transaction binding the contract method 0x128acb08. // // Solidity: function swap(address recipient, bool zeroForOne, int256 amountSpecified, uint160 sqrtPriceLimitX96, bytes data) returns(int256 amount0, int256 amount1) func (_Uniswapv3pool *Uniswapv3poolTransactor) Swap(opts *bind.TransactOpts, recipient common.Address, zeroForOne bool, amountSpecified *big.Int, sqrtPriceLimitX96 *big.Int, data []byte) (*types.Transaction, error) { return _Uniswapv3pool.contract.Transact(opts, "swap", recipient, zeroForOne, amountSpecified, sqrtPriceLimitX96, data) } // Swap is a paid mutator transaction binding the contract method 0x128acb08. // // Solidity: function swap(address recipient, bool zeroForOne, int256 amountSpecified, uint160 sqrtPriceLimitX96, bytes data) returns(int256 amount0, int256 amount1) func (_Uniswapv3pool *Uniswapv3poolSession) Swap(recipient common.Address, zeroForOne bool, amountSpecified *big.Int, sqrtPriceLimitX96 *big.Int, data []byte) (*types.Transaction, error) { return _Uniswapv3pool.Contract.Swap(&_Uniswapv3pool.TransactOpts, recipient, zeroForOne, amountSpecified, sqrtPriceLimitX96, data) } // Swap is a paid mutator transaction binding the contract method 0x128acb08. // // Solidity: function swap(address recipient, bool zeroForOne, int256 amountSpecified, uint160 sqrtPriceLimitX96, bytes data) returns(int256 amount0, int256 amount1) func (_Uniswapv3pool *Uniswapv3poolTransactorSession) Swap(recipient common.Address, zeroForOne bool, amountSpecified *big.Int, sqrtPriceLimitX96 *big.Int, data []byte) (*types.Transaction, error) { return _Uniswapv3pool.Contract.Swap(&_Uniswapv3pool.TransactOpts, recipient, zeroForOne, amountSpecified, sqrtPriceLimitX96, data) } // TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. // // Solidity: function transferOwnership(address newOwner) returns() func (_Uniswapv3pool *Uniswapv3poolTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) { return _Uniswapv3pool.contract.Transact(opts, "transferOwnership", newOwner) } // TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. // // Solidity: function transferOwnership(address newOwner) returns() func (_Uniswapv3pool *Uniswapv3poolSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { return _Uniswapv3pool.Contract.TransferOwnership(&_Uniswapv3pool.TransactOpts, newOwner) } // TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. // // Solidity: function transferOwnership(address newOwner) returns() func (_Uniswapv3pool *Uniswapv3poolTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { return _Uniswapv3pool.Contract.TransferOwnership(&_Uniswapv3pool.TransactOpts, newOwner) } // Uniswapv3poolBurnIterator is returned from FilterBurn and is used to iterate over the raw logs and unpacked data for Burn events raised by the Uniswapv3pool contract. type Uniswapv3poolBurnIterator struct { Event *Uniswapv3poolBurn // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *Uniswapv3poolBurnIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(Uniswapv3poolBurn) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(Uniswapv3poolBurn) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *Uniswapv3poolBurnIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *Uniswapv3poolBurnIterator) Close() error { it.sub.Unsubscribe() return nil } // Uniswapv3poolBurn represents a Burn event raised by the Uniswapv3pool contract. type Uniswapv3poolBurn struct { Owner common.Address TickLower *big.Int TickUpper *big.Int Amount *big.Int Amount0 *big.Int Amount1 *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterBurn is a free log retrieval operation binding the contract event 0x0c396cd989a39f4459b5fa1aed6a9a8dcdbc45908acfd67e028cd568da98982c. // // Solidity: event Burn(address indexed owner, int24 indexed tickLower, int24 indexed tickUpper, uint128 amount, uint256 amount0, uint256 amount1) func (_Uniswapv3pool *Uniswapv3poolFilterer) FilterBurn(opts *bind.FilterOpts, owner []common.Address, tickLower []*big.Int, tickUpper []*big.Int) (*Uniswapv3poolBurnIterator, error) { var ownerRule []interface{} for _, ownerItem := range owner { ownerRule = append(ownerRule, ownerItem) } var tickLowerRule []interface{} for _, tickLowerItem := range tickLower { tickLowerRule = append(tickLowerRule, tickLowerItem) } var tickUpperRule []interface{} for _, tickUpperItem := range tickUpper { tickUpperRule = append(tickUpperRule, tickUpperItem) } logs, sub, err := _Uniswapv3pool.contract.FilterLogs(opts, "Burn", ownerRule, tickLowerRule, tickUpperRule) if err != nil { return nil, err } return &Uniswapv3poolBurnIterator{contract: _Uniswapv3pool.contract, event: "Burn", logs: logs, sub: sub}, nil } // WatchBurn is a free log subscription operation binding the contract event 0x0c396cd989a39f4459b5fa1aed6a9a8dcdbc45908acfd67e028cd568da98982c. // // Solidity: event Burn(address indexed owner, int24 indexed tickLower, int24 indexed tickUpper, uint128 amount, uint256 amount0, uint256 amount1) func (_Uniswapv3pool *Uniswapv3poolFilterer) WatchBurn(opts *bind.WatchOpts, sink chan<- *Uniswapv3poolBurn, owner []common.Address, tickLower []*big.Int, tickUpper []*big.Int) (event.Subscription, error) { var ownerRule []interface{} for _, ownerItem := range owner { ownerRule = append(ownerRule, ownerItem) } var tickLowerRule []interface{} for _, tickLowerItem := range tickLower { tickLowerRule = append(tickLowerRule, tickLowerItem) } var tickUpperRule []interface{} for _, tickUpperItem := range tickUpper { tickUpperRule = append(tickUpperRule, tickUpperItem) } logs, sub, err := _Uniswapv3pool.contract.WatchLogs(opts, "Burn", ownerRule, tickLowerRule, tickUpperRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(Uniswapv3poolBurn) if err := _Uniswapv3pool.contract.UnpackLog(event, "Burn", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseBurn is a log parse operation binding the contract event 0x0c396cd989a39f4459b5fa1aed6a9a8dcdbc45908acfd67e028cd568da98982c. // // Solidity: event Burn(address indexed owner, int24 indexed tickLower, int24 indexed tickUpper, uint128 amount, uint256 amount0, uint256 amount1) func (_Uniswapv3pool *Uniswapv3poolFilterer) ParseBurn(log types.Log) (*Uniswapv3poolBurn, error) { event := new(Uniswapv3poolBurn) if err := _Uniswapv3pool.contract.UnpackLog(event, "Burn", log); err != nil { return nil, err } event.Raw = log return event, nil } // Uniswapv3poolCollectIterator is returned from FilterCollect and is used to iterate over the raw logs and unpacked data for Collect events raised by the Uniswapv3pool contract. type Uniswapv3poolCollectIterator struct { Event *Uniswapv3poolCollect // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *Uniswapv3poolCollectIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(Uniswapv3poolCollect) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(Uniswapv3poolCollect) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *Uniswapv3poolCollectIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *Uniswapv3poolCollectIterator) Close() error { it.sub.Unsubscribe() return nil } // Uniswapv3poolCollect represents a Collect event raised by the Uniswapv3pool contract. type Uniswapv3poolCollect struct { Owner common.Address Recipient common.Address TickLower *big.Int TickUpper *big.Int Amount0 *big.Int Amount1 *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterCollect is a free log retrieval operation binding the contract event 0x70935338e69775456a85ddef226c395fb668b63fa0115f5f20610b388e6ca9c0. // // Solidity: event Collect(address indexed owner, address recipient, int24 indexed tickLower, int24 indexed tickUpper, uint128 amount0, uint128 amount1) func (_Uniswapv3pool *Uniswapv3poolFilterer) FilterCollect(opts *bind.FilterOpts, owner []common.Address, tickLower []*big.Int, tickUpper []*big.Int) (*Uniswapv3poolCollectIterator, error) { var ownerRule []interface{} for _, ownerItem := range owner { ownerRule = append(ownerRule, ownerItem) } var tickLowerRule []interface{} for _, tickLowerItem := range tickLower { tickLowerRule = append(tickLowerRule, tickLowerItem) } var tickUpperRule []interface{} for _, tickUpperItem := range tickUpper { tickUpperRule = append(tickUpperRule, tickUpperItem) } logs, sub, err := _Uniswapv3pool.contract.FilterLogs(opts, "Collect", ownerRule, tickLowerRule, tickUpperRule) if err != nil { return nil, err } return &Uniswapv3poolCollectIterator{contract: _Uniswapv3pool.contract, event: "Collect", logs: logs, sub: sub}, nil } // WatchCollect is a free log subscription operation binding the contract event 0x70935338e69775456a85ddef226c395fb668b63fa0115f5f20610b388e6ca9c0. // // Solidity: event Collect(address indexed owner, address recipient, int24 indexed tickLower, int24 indexed tickUpper, uint128 amount0, uint128 amount1) func (_Uniswapv3pool *Uniswapv3poolFilterer) WatchCollect(opts *bind.WatchOpts, sink chan<- *Uniswapv3poolCollect, owner []common.Address, tickLower []*big.Int, tickUpper []*big.Int) (event.Subscription, error) { var ownerRule []interface{} for _, ownerItem := range owner { ownerRule = append(ownerRule, ownerItem) } var tickLowerRule []interface{} for _, tickLowerItem := range tickLower { tickLowerRule = append(tickLowerRule, tickLowerItem) } var tickUpperRule []interface{} for _, tickUpperItem := range tickUpper { tickUpperRule = append(tickUpperRule, tickUpperItem) } logs, sub, err := _Uniswapv3pool.contract.WatchLogs(opts, "Collect", ownerRule, tickLowerRule, tickUpperRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(Uniswapv3poolCollect) if err := _Uniswapv3pool.contract.UnpackLog(event, "Collect", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseCollect is a log parse operation binding the contract event 0x70935338e69775456a85ddef226c395fb668b63fa0115f5f20610b388e6ca9c0. // // Solidity: event Collect(address indexed owner, address recipient, int24 indexed tickLower, int24 indexed tickUpper, uint128 amount0, uint128 amount1) func (_Uniswapv3pool *Uniswapv3poolFilterer) ParseCollect(log types.Log) (*Uniswapv3poolCollect, error) { event := new(Uniswapv3poolCollect) if err := _Uniswapv3pool.contract.UnpackLog(event, "Collect", log); err != nil { return nil, err } event.Raw = log return event, nil } // Uniswapv3poolCollectProtocolIterator is returned from FilterCollectProtocol and is used to iterate over the raw logs and unpacked data for CollectProtocol events raised by the Uniswapv3pool contract. type Uniswapv3poolCollectProtocolIterator struct { Event *Uniswapv3poolCollectProtocol // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *Uniswapv3poolCollectProtocolIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(Uniswapv3poolCollectProtocol) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(Uniswapv3poolCollectProtocol) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *Uniswapv3poolCollectProtocolIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *Uniswapv3poolCollectProtocolIterator) Close() error { it.sub.Unsubscribe() return nil } // Uniswapv3poolCollectProtocol represents a CollectProtocol event raised by the Uniswapv3pool contract. type Uniswapv3poolCollectProtocol struct { Sender common.Address Recipient common.Address Amount0 *big.Int Amount1 *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterCollectProtocol is a free log retrieval operation binding the contract event 0x596b573906218d3411850b26a6b437d6c4522fdb43d2d2386263f86d50b8b151. // // Solidity: event CollectProtocol(address indexed sender, address indexed recipient, uint128 amount0, uint128 amount1) func (_Uniswapv3pool *Uniswapv3poolFilterer) FilterCollectProtocol(opts *bind.FilterOpts, sender []common.Address, recipient []common.Address) (*Uniswapv3poolCollectProtocolIterator, error) { var senderRule []interface{} for _, senderItem := range sender { senderRule = append(senderRule, senderItem) } var recipientRule []interface{} for _, recipientItem := range recipient { recipientRule = append(recipientRule, recipientItem) } logs, sub, err := _Uniswapv3pool.contract.FilterLogs(opts, "CollectProtocol", senderRule, recipientRule) if err != nil { return nil, err } return &Uniswapv3poolCollectProtocolIterator{contract: _Uniswapv3pool.contract, event: "CollectProtocol", logs: logs, sub: sub}, nil } // WatchCollectProtocol is a free log subscription operation binding the contract event 0x596b573906218d3411850b26a6b437d6c4522fdb43d2d2386263f86d50b8b151. // // Solidity: event CollectProtocol(address indexed sender, address indexed recipient, uint128 amount0, uint128 amount1) func (_Uniswapv3pool *Uniswapv3poolFilterer) WatchCollectProtocol(opts *bind.WatchOpts, sink chan<- *Uniswapv3poolCollectProtocol, sender []common.Address, recipient []common.Address) (event.Subscription, error) { var senderRule []interface{} for _, senderItem := range sender { senderRule = append(senderRule, senderItem) } var recipientRule []interface{} for _, recipientItem := range recipient { recipientRule = append(recipientRule, recipientItem) } logs, sub, err := _Uniswapv3pool.contract.WatchLogs(opts, "CollectProtocol", senderRule, recipientRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(Uniswapv3poolCollectProtocol) if err := _Uniswapv3pool.contract.UnpackLog(event, "CollectProtocol", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseCollectProtocol is a log parse operation binding the contract event 0x596b573906218d3411850b26a6b437d6c4522fdb43d2d2386263f86d50b8b151. // // Solidity: event CollectProtocol(address indexed sender, address indexed recipient, uint128 amount0, uint128 amount1) func (_Uniswapv3pool *Uniswapv3poolFilterer) ParseCollectProtocol(log types.Log) (*Uniswapv3poolCollectProtocol, error) { event := new(Uniswapv3poolCollectProtocol) if err := _Uniswapv3pool.contract.UnpackLog(event, "CollectProtocol", log); err != nil { return nil, err } event.Raw = log return event, nil } // Uniswapv3poolFlashIterator is returned from FilterFlash and is used to iterate over the raw logs and unpacked data for Flash events raised by the Uniswapv3pool contract. type Uniswapv3poolFlashIterator struct { Event *Uniswapv3poolFlash // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *Uniswapv3poolFlashIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(Uniswapv3poolFlash) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(Uniswapv3poolFlash) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *Uniswapv3poolFlashIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *Uniswapv3poolFlashIterator) Close() error { it.sub.Unsubscribe() return nil } // Uniswapv3poolFlash represents a Flash event raised by the Uniswapv3pool contract. type Uniswapv3poolFlash struct { Sender common.Address Recipient common.Address Amount0 *big.Int Amount1 *big.Int Paid0 *big.Int Paid1 *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterFlash is a free log retrieval operation binding the contract event 0xbdbdb71d7860376ba52b25a5028beea23581364a40522f6bcfb86bb1f2dca633. // // Solidity: event Flash(address indexed sender, address indexed recipient, uint256 amount0, uint256 amount1, uint256 paid0, uint256 paid1) func (_Uniswapv3pool *Uniswapv3poolFilterer) FilterFlash(opts *bind.FilterOpts, sender []common.Address, recipient []common.Address) (*Uniswapv3poolFlashIterator, error) { var senderRule []interface{} for _, senderItem := range sender { senderRule = append(senderRule, senderItem) } var recipientRule []interface{} for _, recipientItem := range recipient { recipientRule = append(recipientRule, recipientItem) } logs, sub, err := _Uniswapv3pool.contract.FilterLogs(opts, "Flash", senderRule, recipientRule) if err != nil { return nil, err } return &Uniswapv3poolFlashIterator{contract: _Uniswapv3pool.contract, event: "Flash", logs: logs, sub: sub}, nil } // WatchFlash is a free log subscription operation binding the contract event 0xbdbdb71d7860376ba52b25a5028beea23581364a40522f6bcfb86bb1f2dca633. // // Solidity: event Flash(address indexed sender, address indexed recipient, uint256 amount0, uint256 amount1, uint256 paid0, uint256 paid1) func (_Uniswapv3pool *Uniswapv3poolFilterer) WatchFlash(opts *bind.WatchOpts, sink chan<- *Uniswapv3poolFlash, sender []common.Address, recipient []common.Address) (event.Subscription, error) { var senderRule []interface{} for _, senderItem := range sender { senderRule = append(senderRule, senderItem) } var recipientRule []interface{} for _, recipientItem := range recipient { recipientRule = append(recipientRule, recipientItem) } logs, sub, err := _Uniswapv3pool.contract.WatchLogs(opts, "Flash", senderRule, recipientRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(Uniswapv3poolFlash) if err := _Uniswapv3pool.contract.UnpackLog(event, "Flash", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseFlash is a log parse operation binding the contract event 0xbdbdb71d7860376ba52b25a5028beea23581364a40522f6bcfb86bb1f2dca633. // // Solidity: event Flash(address indexed sender, address indexed recipient, uint256 amount0, uint256 amount1, uint256 paid0, uint256 paid1) func (_Uniswapv3pool *Uniswapv3poolFilterer) ParseFlash(log types.Log) (*Uniswapv3poolFlash, error) { event := new(Uniswapv3poolFlash) if err := _Uniswapv3pool.contract.UnpackLog(event, "Flash", log); err != nil { return nil, err } event.Raw = log return event, nil } // Uniswapv3poolIncreaseObservationCardinalityNextIterator is returned from FilterIncreaseObservationCardinalityNext and is used to iterate over the raw logs and unpacked data for IncreaseObservationCardinalityNext events raised by the Uniswapv3pool contract. type Uniswapv3poolIncreaseObservationCardinalityNextIterator struct { Event *Uniswapv3poolIncreaseObservationCardinalityNext // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *Uniswapv3poolIncreaseObservationCardinalityNextIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(Uniswapv3poolIncreaseObservationCardinalityNext) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(Uniswapv3poolIncreaseObservationCardinalityNext) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *Uniswapv3poolIncreaseObservationCardinalityNextIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *Uniswapv3poolIncreaseObservationCardinalityNextIterator) Close() error { it.sub.Unsubscribe() return nil } // Uniswapv3poolIncreaseObservationCardinalityNext represents a IncreaseObservationCardinalityNext event raised by the Uniswapv3pool contract. type Uniswapv3poolIncreaseObservationCardinalityNext struct { ObservationCardinalityNextOld uint16 ObservationCardinalityNextNew uint16 Raw types.Log // Blockchain specific contextual infos } // FilterIncreaseObservationCardinalityNext is a free log retrieval operation binding the contract event 0xac49e518f90a358f652e4400164f05a5d8f7e35e7747279bc3a93dbf584e125a. // // Solidity: event IncreaseObservationCardinalityNext(uint16 observationCardinalityNextOld, uint16 observationCardinalityNextNew) func (_Uniswapv3pool *Uniswapv3poolFilterer) FilterIncreaseObservationCardinalityNext(opts *bind.FilterOpts) (*Uniswapv3poolIncreaseObservationCardinalityNextIterator, error) { logs, sub, err := _Uniswapv3pool.contract.FilterLogs(opts, "IncreaseObservationCardinalityNext") if err != nil { return nil, err } return &Uniswapv3poolIncreaseObservationCardinalityNextIterator{contract: _Uniswapv3pool.contract, event: "IncreaseObservationCardinalityNext", logs: logs, sub: sub}, nil } // WatchIncreaseObservationCardinalityNext is a free log subscription operation binding the contract event 0xac49e518f90a358f652e4400164f05a5d8f7e35e7747279bc3a93dbf584e125a. // // Solidity: event IncreaseObservationCardinalityNext(uint16 observationCardinalityNextOld, uint16 observationCardinalityNextNew) func (_Uniswapv3pool *Uniswapv3poolFilterer) WatchIncreaseObservationCardinalityNext(opts *bind.WatchOpts, sink chan<- *Uniswapv3poolIncreaseObservationCardinalityNext) (event.Subscription, error) { logs, sub, err := _Uniswapv3pool.contract.WatchLogs(opts, "IncreaseObservationCardinalityNext") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(Uniswapv3poolIncreaseObservationCardinalityNext) if err := _Uniswapv3pool.contract.UnpackLog(event, "IncreaseObservationCardinalityNext", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseIncreaseObservationCardinalityNext is a log parse operation binding the contract event 0xac49e518f90a358f652e4400164f05a5d8f7e35e7747279bc3a93dbf584e125a. // // Solidity: event IncreaseObservationCardinalityNext(uint16 observationCardinalityNextOld, uint16 observationCardinalityNextNew) func (_Uniswapv3pool *Uniswapv3poolFilterer) ParseIncreaseObservationCardinalityNext(log types.Log) (*Uniswapv3poolIncreaseObservationCardinalityNext, error) { event := new(Uniswapv3poolIncreaseObservationCardinalityNext) if err := _Uniswapv3pool.contract.UnpackLog(event, "IncreaseObservationCardinalityNext", log); err != nil { return nil, err } event.Raw = log return event, nil } // Uniswapv3poolInitializeIterator is returned from FilterInitialize and is used to iterate over the raw logs and unpacked data for Initialize events raised by the Uniswapv3pool contract. type Uniswapv3poolInitializeIterator struct { Event *Uniswapv3poolInitialize // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *Uniswapv3poolInitializeIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(Uniswapv3poolInitialize) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(Uniswapv3poolInitialize) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *Uniswapv3poolInitializeIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *Uniswapv3poolInitializeIterator) Close() error { it.sub.Unsubscribe() return nil } // Uniswapv3poolInitialize represents a Initialize event raised by the Uniswapv3pool contract. type Uniswapv3poolInitialize struct { SqrtPriceX96 *big.Int Tick *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterInitialize is a free log retrieval operation binding the contract event 0x98636036cb66a9c19a37435efc1e90142190214e8abeb821bdba3f2990dd4c95. // // Solidity: event Initialize(uint160 sqrtPriceX96, int24 tick) func (_Uniswapv3pool *Uniswapv3poolFilterer) FilterInitialize(opts *bind.FilterOpts) (*Uniswapv3poolInitializeIterator, error) { logs, sub, err := _Uniswapv3pool.contract.FilterLogs(opts, "Initialize") if err != nil { return nil, err } return &Uniswapv3poolInitializeIterator{contract: _Uniswapv3pool.contract, event: "Initialize", logs: logs, sub: sub}, nil } // WatchInitialize is a free log subscription operation binding the contract event 0x98636036cb66a9c19a37435efc1e90142190214e8abeb821bdba3f2990dd4c95. // // Solidity: event Initialize(uint160 sqrtPriceX96, int24 tick) func (_Uniswapv3pool *Uniswapv3poolFilterer) WatchInitialize(opts *bind.WatchOpts, sink chan<- *Uniswapv3poolInitialize) (event.Subscription, error) { logs, sub, err := _Uniswapv3pool.contract.WatchLogs(opts, "Initialize") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(Uniswapv3poolInitialize) if err := _Uniswapv3pool.contract.UnpackLog(event, "Initialize", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseInitialize is a log parse operation binding the contract event 0x98636036cb66a9c19a37435efc1e90142190214e8abeb821bdba3f2990dd4c95. // // Solidity: event Initialize(uint160 sqrtPriceX96, int24 tick) func (_Uniswapv3pool *Uniswapv3poolFilterer) ParseInitialize(log types.Log) (*Uniswapv3poolInitialize, error) { event := new(Uniswapv3poolInitialize) if err := _Uniswapv3pool.contract.UnpackLog(event, "Initialize", log); err != nil { return nil, err } event.Raw = log return event, nil } // Uniswapv3poolMintIterator is returned from FilterMint and is used to iterate over the raw logs and unpacked data for Mint events raised by the Uniswapv3pool contract. type Uniswapv3poolMintIterator struct { Event *Uniswapv3poolMint // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *Uniswapv3poolMintIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(Uniswapv3poolMint) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(Uniswapv3poolMint) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *Uniswapv3poolMintIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *Uniswapv3poolMintIterator) Close() error { it.sub.Unsubscribe() return nil } // Uniswapv3poolMint represents a Mint event raised by the Uniswapv3pool contract. type Uniswapv3poolMint struct { Sender common.Address Owner common.Address TickLower *big.Int TickUpper *big.Int Amount *big.Int Amount0 *big.Int Amount1 *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterMint is a free log retrieval operation binding the contract event 0x7a53080ba414158be7ec69b987b5fb7d07dee101fe85488f0853ae16239d0bde. // // Solidity: event Mint(address sender, address indexed owner, int24 indexed tickLower, int24 indexed tickUpper, uint128 amount, uint256 amount0, uint256 amount1) func (_Uniswapv3pool *Uniswapv3poolFilterer) FilterMint(opts *bind.FilterOpts, owner []common.Address, tickLower []*big.Int, tickUpper []*big.Int) (*Uniswapv3poolMintIterator, error) { var ownerRule []interface{} for _, ownerItem := range owner { ownerRule = append(ownerRule, ownerItem) } var tickLowerRule []interface{} for _, tickLowerItem := range tickLower { tickLowerRule = append(tickLowerRule, tickLowerItem) } var tickUpperRule []interface{} for _, tickUpperItem := range tickUpper { tickUpperRule = append(tickUpperRule, tickUpperItem) } logs, sub, err := _Uniswapv3pool.contract.FilterLogs(opts, "Mint", ownerRule, tickLowerRule, tickUpperRule) if err != nil { return nil, err } return &Uniswapv3poolMintIterator{contract: _Uniswapv3pool.contract, event: "Mint", logs: logs, sub: sub}, nil } // WatchMint is a free log subscription operation binding the contract event 0x7a53080ba414158be7ec69b987b5fb7d07dee101fe85488f0853ae16239d0bde. // // Solidity: event Mint(address sender, address indexed owner, int24 indexed tickLower, int24 indexed tickUpper, uint128 amount, uint256 amount0, uint256 amount1) func (_Uniswapv3pool *Uniswapv3poolFilterer) WatchMint(opts *bind.WatchOpts, sink chan<- *Uniswapv3poolMint, owner []common.Address, tickLower []*big.Int, tickUpper []*big.Int) (event.Subscription, error) { var ownerRule []interface{} for _, ownerItem := range owner { ownerRule = append(ownerRule, ownerItem) } var tickLowerRule []interface{} for _, tickLowerItem := range tickLower { tickLowerRule = append(tickLowerRule, tickLowerItem) } var tickUpperRule []interface{} for _, tickUpperItem := range tickUpper { tickUpperRule = append(tickUpperRule, tickUpperItem) } logs, sub, err := _Uniswapv3pool.contract.WatchLogs(opts, "Mint", ownerRule, tickLowerRule, tickUpperRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(Uniswapv3poolMint) if err := _Uniswapv3pool.contract.UnpackLog(event, "Mint", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseMint is a log parse operation binding the contract event 0x7a53080ba414158be7ec69b987b5fb7d07dee101fe85488f0853ae16239d0bde. // // Solidity: event Mint(address sender, address indexed owner, int24 indexed tickLower, int24 indexed tickUpper, uint128 amount, uint256 amount0, uint256 amount1) func (_Uniswapv3pool *Uniswapv3poolFilterer) ParseMint(log types.Log) (*Uniswapv3poolMint, error) { event := new(Uniswapv3poolMint) if err := _Uniswapv3pool.contract.UnpackLog(event, "Mint", log); err != nil { return nil, err } event.Raw = log return event, nil } // Uniswapv3poolOwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the Uniswapv3pool contract. type Uniswapv3poolOwnershipTransferredIterator struct { Event *Uniswapv3poolOwnershipTransferred // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *Uniswapv3poolOwnershipTransferredIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(Uniswapv3poolOwnershipTransferred) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(Uniswapv3poolOwnershipTransferred) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *Uniswapv3poolOwnershipTransferredIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *Uniswapv3poolOwnershipTransferredIterator) Close() error { it.sub.Unsubscribe() return nil } // Uniswapv3poolOwnershipTransferred represents a OwnershipTransferred event raised by the Uniswapv3pool contract. type Uniswapv3poolOwnershipTransferred struct { PreviousOwner common.Address NewOwner common.Address Raw types.Log // Blockchain specific contextual infos } // FilterOwnershipTransferred is a free log retrieval operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. // // Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) func (_Uniswapv3pool *Uniswapv3poolFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*Uniswapv3poolOwnershipTransferredIterator, error) { var previousOwnerRule []interface{} for _, previousOwnerItem := range previousOwner { previousOwnerRule = append(previousOwnerRule, previousOwnerItem) } var newOwnerRule []interface{} for _, newOwnerItem := range newOwner { newOwnerRule = append(newOwnerRule, newOwnerItem) } logs, sub, err := _Uniswapv3pool.contract.FilterLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) if err != nil { return nil, err } return &Uniswapv3poolOwnershipTransferredIterator{contract: _Uniswapv3pool.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil } // WatchOwnershipTransferred is a free log subscription operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. // // Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) func (_Uniswapv3pool *Uniswapv3poolFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *Uniswapv3poolOwnershipTransferred, previousOwner []common.Address, newOwner []common.Address) (event.Subscription, error) { var previousOwnerRule []interface{} for _, previousOwnerItem := range previousOwner { previousOwnerRule = append(previousOwnerRule, previousOwnerItem) } var newOwnerRule []interface{} for _, newOwnerItem := range newOwner { newOwnerRule = append(newOwnerRule, newOwnerItem) } logs, sub, err := _Uniswapv3pool.contract.WatchLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(Uniswapv3poolOwnershipTransferred) if err := _Uniswapv3pool.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseOwnershipTransferred is a log parse operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. // // Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) func (_Uniswapv3pool *Uniswapv3poolFilterer) ParseOwnershipTransferred(log types.Log) (*Uniswapv3poolOwnershipTransferred, error) { event := new(Uniswapv3poolOwnershipTransferred) if err := _Uniswapv3pool.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { return nil, err } event.Raw = log return event, nil } // Uniswapv3poolSetFeeProtocolIterator is returned from FilterSetFeeProtocol and is used to iterate over the raw logs and unpacked data for SetFeeProtocol events raised by the Uniswapv3pool contract. type Uniswapv3poolSetFeeProtocolIterator struct { Event *Uniswapv3poolSetFeeProtocol // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *Uniswapv3poolSetFeeProtocolIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(Uniswapv3poolSetFeeProtocol) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(Uniswapv3poolSetFeeProtocol) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *Uniswapv3poolSetFeeProtocolIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *Uniswapv3poolSetFeeProtocolIterator) Close() error { it.sub.Unsubscribe() return nil } // Uniswapv3poolSetFeeProtocol represents a SetFeeProtocol event raised by the Uniswapv3pool contract. type Uniswapv3poolSetFeeProtocol struct { FeeProtocol0Old uint8 FeeProtocol1Old uint8 FeeProtocol0New uint8 FeeProtocol1New uint8 Raw types.Log // Blockchain specific contextual infos } // FilterSetFeeProtocol is a free log retrieval operation binding the contract event 0x973d8d92bb299f4af6ce49b52a8adb85ae46b9f214c4c4fc06ac77401237b133. // // Solidity: event SetFeeProtocol(uint8 feeProtocol0Old, uint8 feeProtocol1Old, uint8 feeProtocol0New, uint8 feeProtocol1New) func (_Uniswapv3pool *Uniswapv3poolFilterer) FilterSetFeeProtocol(opts *bind.FilterOpts) (*Uniswapv3poolSetFeeProtocolIterator, error) { logs, sub, err := _Uniswapv3pool.contract.FilterLogs(opts, "SetFeeProtocol") if err != nil { return nil, err } return &Uniswapv3poolSetFeeProtocolIterator{contract: _Uniswapv3pool.contract, event: "SetFeeProtocol", logs: logs, sub: sub}, nil } // WatchSetFeeProtocol is a free log subscription operation binding the contract event 0x973d8d92bb299f4af6ce49b52a8adb85ae46b9f214c4c4fc06ac77401237b133. // // Solidity: event SetFeeProtocol(uint8 feeProtocol0Old, uint8 feeProtocol1Old, uint8 feeProtocol0New, uint8 feeProtocol1New) func (_Uniswapv3pool *Uniswapv3poolFilterer) WatchSetFeeProtocol(opts *bind.WatchOpts, sink chan<- *Uniswapv3poolSetFeeProtocol) (event.Subscription, error) { logs, sub, err := _Uniswapv3pool.contract.WatchLogs(opts, "SetFeeProtocol") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(Uniswapv3poolSetFeeProtocol) if err := _Uniswapv3pool.contract.UnpackLog(event, "SetFeeProtocol", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseSetFeeProtocol is a log parse operation binding the contract event 0x973d8d92bb299f4af6ce49b52a8adb85ae46b9f214c4c4fc06ac77401237b133. // // Solidity: event SetFeeProtocol(uint8 feeProtocol0Old, uint8 feeProtocol1Old, uint8 feeProtocol0New, uint8 feeProtocol1New) func (_Uniswapv3pool *Uniswapv3poolFilterer) ParseSetFeeProtocol(log types.Log) (*Uniswapv3poolSetFeeProtocol, error) { event := new(Uniswapv3poolSetFeeProtocol) if err := _Uniswapv3pool.contract.UnpackLog(event, "SetFeeProtocol", log); err != nil { return nil, err } event.Raw = log return event, nil } // Uniswapv3poolSwapIterator is returned from FilterSwap and is used to iterate over the raw logs and unpacked data for Swap events raised by the Uniswapv3pool contract. type Uniswapv3poolSwapIterator struct { Event *Uniswapv3poolSwap // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *Uniswapv3poolSwapIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(Uniswapv3poolSwap) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(Uniswapv3poolSwap) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *Uniswapv3poolSwapIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *Uniswapv3poolSwapIterator) Close() error { it.sub.Unsubscribe() return nil } // Uniswapv3poolSwap represents a Swap event raised by the Uniswapv3pool contract. type Uniswapv3poolSwap struct { Sender common.Address Recipient common.Address Amount0 *big.Int Amount1 *big.Int SqrtPriceX96 *big.Int Liquidity *big.Int Tick *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterSwap is a free log retrieval operation binding the contract event 0xc42079f94a6350d7e6235f29174924f928cc2ac818eb64fed8004e115fbcca67. // // Solidity: event Swap(address indexed sender, address indexed recipient, int256 amount0, int256 amount1, uint160 sqrtPriceX96, uint128 liquidity, int24 tick) func (_Uniswapv3pool *Uniswapv3poolFilterer) FilterSwap(opts *bind.FilterOpts, sender []common.Address, recipient []common.Address) (*Uniswapv3poolSwapIterator, error) { var senderRule []interface{} for _, senderItem := range sender { senderRule = append(senderRule, senderItem) } var recipientRule []interface{} for _, recipientItem := range recipient { recipientRule = append(recipientRule, recipientItem) } logs, sub, err := _Uniswapv3pool.contract.FilterLogs(opts, "Swap", senderRule, recipientRule) if err != nil { return nil, err } return &Uniswapv3poolSwapIterator{contract: _Uniswapv3pool.contract, event: "Swap", logs: logs, sub: sub}, nil } // WatchSwap is a free log subscription operation binding the contract event 0xc42079f94a6350d7e6235f29174924f928cc2ac818eb64fed8004e115fbcca67. // // Solidity: event Swap(address indexed sender, address indexed recipient, int256 amount0, int256 amount1, uint160 sqrtPriceX96, uint128 liquidity, int24 tick) func (_Uniswapv3pool *Uniswapv3poolFilterer) WatchSwap(opts *bind.WatchOpts, sink chan<- *Uniswapv3poolSwap, sender []common.Address, recipient []common.Address) (event.Subscription, error) { var senderRule []interface{} for _, senderItem := range sender { senderRule = append(senderRule, senderItem) } var recipientRule []interface{} for _, recipientItem := range recipient { recipientRule = append(recipientRule, recipientItem) } logs, sub, err := _Uniswapv3pool.contract.WatchLogs(opts, "Swap", senderRule, recipientRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(Uniswapv3poolSwap) if err := _Uniswapv3pool.contract.UnpackLog(event, "Swap", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseSwap is a log parse operation binding the contract event 0xc42079f94a6350d7e6235f29174924f928cc2ac818eb64fed8004e115fbcca67. // // Solidity: event Swap(address indexed sender, address indexed recipient, int256 amount0, int256 amount1, uint160 sqrtPriceX96, uint128 liquidity, int24 tick) func (_Uniswapv3pool *Uniswapv3poolFilterer) ParseSwap(log types.Log) (*Uniswapv3poolSwap, error) { event := new(Uniswapv3poolSwap) if err := _Uniswapv3pool.contract.UnpackLog(event, "Swap", log); err != nil { return nil, err } event.Raw = log return event, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/binds/vibetokenfactory/VibeTokenFactory.go ================================================ // Code generated - DO NOT EDIT. // This file is a generated binding and any manual changes will be lost. package vibetokenfactory import ( "errors" "math/big" "strings" ethereum "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/event" ) // Reference imports to suppress errors if they are not otherwise used. var ( _ = errors.New _ = big.NewInt _ = strings.NewReader _ = ethereum.NotFound _ = bind.Bind _ = common.Big1 _ = types.BloomLookup _ = event.NewSubscription _ = abi.ConvertType ) // VibeTokenFactoryMetaData contains all meta data concerning the VibeTokenFactory contract. var VibeTokenFactoryMetaData = &bind.MetaData{ ABI: "[{\"inputs\":[],\"name\":\"T\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"admin\",\"type\":\"address\"}],\"name\":\"AdminSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"positionNftId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"}],\"name\":\"FeesCollected\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"ImplementationSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"nonce\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"positionNftId\",\"type\":\"uint256\"}],\"name\":\"TokenDeployed\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"admin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"baseToken\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"collectFees\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"nonce\",\"type\":\"bytes32\"},{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"symbol\",\"type\":\"string\"},{\"internalType\":\"address\",\"name\":\"creator\",\"type\":\"address\"},{\"internalType\":\"int24\",\"name\":\"tickLower\",\"type\":\"int24\"},{\"internalType\":\"int24\",\"name\":\"tickUpper\",\"type\":\"int24\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"name\":\"createToken\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"deployedTokens\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getChainId\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"implementation\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_baseToken\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_uniswapPositionManager\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_uniswapQuoter\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_uniswapRouter\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes[]\",\"name\":\"data\",\"type\":\"bytes[]\"}],\"name\":\"multicall\",\"outputs\":[{\"internalType\":\"bytes[]\",\"name\":\"results\",\"type\":\"bytes[]\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"VibeToken\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amountBase\",\"type\":\"uint256\"}],\"name\":\"quoteExactBaseForVibeToken\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amountOutVibeToken\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"VibeToken\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amountETH\",\"type\":\"uint256\"}],\"name\":\"quoteExactETHForVibeToken\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amountOutVibeToken\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"VibeToken\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amountVibeToken\",\"type\":\"uint256\"}],\"name\":\"quoteExactVibeTokenForBase\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amountOutBase\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"VibeToken\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amountVibeToken\",\"type\":\"uint256\"}],\"name\":\"quoteExactVibeTokenForETH\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amountOutETH\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_admin\",\"type\":\"address\"}],\"name\":\"setAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_implementation\",\"type\":\"address\"}],\"name\":\"setImplementation\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"VibeToken\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amountBase\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountVibeTokenMinimum\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"}],\"name\":\"swapExactBaseForVibeToken\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amountOutVibeToken\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"VibeToken\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amountETH\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountVibeTokenMinimum\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"}],\"name\":\"swapExactETHForVibeToken\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amountOutVibeToken\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"VibeToken\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amountVibeToken\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountBaseMinimum\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"}],\"name\":\"swapExactVibeTokenForBase\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amountOutBase\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"VibeToken\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amountVibeToken\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountETHMinimum\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"}],\"name\":\"swapExactVibeTokenForETH\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amountOutETH\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"tokenMetadata\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"creator\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"},{\"internalType\":\"uint24\",\"name\":\"fee\",\"type\":\"uint24\"},{\"internalType\":\"uint256\",\"name\":\"positionNftId\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"uniswapPositionManager\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"uniswapQuoter\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"uniswapRouter\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", Bin: "0x608080604052346100165761350d908161001c8239f35b600080fdfe6080604052600436101561001257600080fd5b60003560e01c80631871a22d146101b75780632a0da56a146101b25780633408e470146101ad5780634db4a352146101a8578063575f00d7146101a35780635c60da1b1461019e57806361309596146101995780636fecdf2414610194578063704b6c021461018f578063715018a61461018a578063735de9f7146101855780638da5cb5b146101805780639274a2ab1461017b5780639324f0e014610176578063a480ca7914610171578063ac9650d81461016c578063b0422bec14610167578063beb1ad6414610162578063c55dae631461015d578063d784d42614610158578063e5047b3014610153578063f1a25fb01461014e578063f2fde38b14610149578063f851a44014610144578063f8c8765e1461013f5763fe3cc33a1461013a57600080fd5b61156c565b61145a565b611431565b61139e565b6111db565b6111b2565b611145565b61111c565b6110a5565b610fea565b610ee8565b610e0b565b610b2f565b6108cc565b6108a3565b61087a565b610819565b6107ac565b610744565b610710565b6106e7565b610572565b610549565b61052e565b61031b565b610233565b9181601f840112156101e9578235916001600160401b0383116101e957602083818601950101116101e957565b600080fd5b6001600160a01b038116036101e957565b6064359061020c826101ee565b565b8060020b036101e957565b6084359061020c8261020e565b60a4359061020c8261020e565b346101e9576101003660031901126101e9576001600160401b036024358181116101e9576102659036906004016101bc565b91906044358281116101e95761027f9036906004016101bc565b93909161028a6101ff565b610292610219565b61029a610226565b9160e4359687116101e9576102e3976102ba6102c99836906004016101bc565b97909660c43596600435611dbb565b6040516001600160a01b0390911681529081906020820190565b0390f35b60a09060031901126101e9576004356102ff816101ee565b906024359060443590606435610314816101ee565b9060843590565b610324366102e7565b919390916001600160a01b038083161561050a5783161561050a5742116104d35782156104b65760985460009460209261044d929091906001600160a01b0316956103718130338a6131f1565b609b546103899082906001600160a01b031689613427565b6103ed6103ba60016103ad8660018060a01b0316600052609e602052604060002090565b015460a01c62ffffff1690565b6103e16103c561194b565b6001600160a01b038b168152956001600160a01b031686890152565b62ffffff166040850152565b6001600160a01b0386166060840152608083015260a082015260c08101869052609b5461043090610424906001600160a01b031681565b6001600160a01b031690565b906040519687809481936304e45aaf60e01b835260048301612cdc565b03925af19081156104b1576102e39360009261047f575b5061046f919261316f565b6040519081529081906020820190565b61046f92506104a49060203d81116104aa575b61049c818361192a565b8101906123cc565b91610464565b503d610492565b6123c0565b60405162461bcd60e51b8152806104cf60048201612c35565b0390fd5b60405162461bcd60e51b815260206004820152600f60248201526e496e76616c6964446561646c696e6560881b6044820152606490fd5b60405162461bcd60e51b8152806104cf60048201611bf1565b60009103126101e957565b346101e95760003660031901126101e9576020604051468152f35b346101e95760003660031901126101e957609a546040516001600160a01b039091168152602090f35b346101e9576040806003193601126101e957600435610590816101ee565b6024359081156106cf576001600160a01b038116156106b7576098546000939260809261065e9261062591906001600160a01b0316926106156105ea60016103ad8560018060a01b0316600052609e602052604060002090565b926106056105f661196a565b6001600160a01b039097168752565b6001600160a01b03166020860152565b8387015262ffffff166060830152565b808301859052609a5461064290610424906001600160a01b031681565b908451958680948193636352813560e11b835260048301612c96565b03925af19081156104b1576102e392600092610684575b50519081529081906020820190565b6106a691925060803d81116106b0575b61069e818361192a565b810190612c5d565b5050509038610675565b503d610694565b825162461bcd60e51b8152806104cf60048201611bf1565b825162461bcd60e51b8152806104cf60048201612c35565b346101e95760003660031901126101e9576097546040516001600160a01b039091168152602090f35b346101e95760203660031901126101e957600435600052609d602052602060018060a01b0360406000205416604051908152f35b346101e95760203660031901126101e9576080600435610763816101ee565b60018060a01b03809116600052609e60205260406000209062ffffff818354169260026001820154910154926040519485528116602085015260a01c1660408301526060820152f35b346101e95760203660031901126101e9576004356107c9816101ee565b6107d1611840565b6001600160a01b0316801561050a57609c80546001600160a01b031916821790557f8fe72c3e0020beb3234e76ae6676fa576fbfcae600af1c4fea44784cf0db329c600080a2005b346101e95760008060031936011261087757610833611840565b603380546001600160a01b0319811690915581906001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b80fd5b346101e95760003660031901126101e957609b546040516001600160a01b039091168152602090f35b346101e95760003660031901126101e9576033546040516001600160a01b039091168152602090f35b346101e9576040806003193601126101e9576004908135906108ed826101ee565b6024358015610b18576001600160a01b03831615610b0157609b5484919060209061092290610424906001600160a01b031681565b84516312a9293f60e21b815296879182905afa9485156104b157600095610ad1575b506098546001600160a01b03169061095d6105f661196a565b6001600160a01b038216602087015285840152610bb86060860152608094600086820152610998610424610424609a5460018060a01b031690565b928685518095816000816109b9636352813560e11b98898352888301612c96565b03925af19384156104b157610a68968895610a3692600091610ab1575b50610a266109fb60016103ad8560018060a01b0316600052609e602052604060002090565b92610a16610a0761196a565b6001600160a01b039099168952565b6001600160a01b03166020880152565b8588015262ffffff166060850152565b6000838501819052609a54610a5590610424906001600160a01b031681565b9286519788958694859384528301612c96565b03925af19182156104b1576102e393600093610a8f575b5050519081529081906020820190565b610aa6929350803d106106b05761069e818361192a565b505050903880610a7f565b610ac89150873d89116106b05761069e818361192a565b505050386109d6565b610af391955060203d8111610afa575b610aeb818361192a565b8101906123e6565b9338610944565b503d610ae1565b815162461bcd60e51b8152806104cf818701611bf1565b815162461bcd60e51b8152806104cf818701612c35565b610b38366102e7565b92919242116104d35734158015610e03575b8015610df9575b6104b6576001600160a01b038481161561050a5781161561050a57609b54610b8390610424906001600160a01b031681565b916040928351956312a9293f60e21b87526020968781600481865afa9081156104b157600091610ddc575b506098546001600160a01b031693610bd6610bc761194b565b6001600160a01b039093168352565b6001600160a01b038516828a0152610bb8828801523060608301526080820152600060a0820152600060c082015287865180948180610c236304e45aaf60e01b9687835260048301612cdc565b039134905af19283156104b157600093610dbd575b50609b54610c5090610424906001600160a01b031681565b96873b156101e9576000809860048951809b8193630910874560e11b83525af19384156104b157610d3f988a95610da4575b50609b54610c9b9082906001600160a01b031688613427565b610cf2610cbf60016103ad8760018060a01b0316600052609e602052604060002090565b610ce7610cca61194b565b6001600160a01b038a168152965b6001600160a01b031687890152565b62ffffff16858a0152565b6001600160a01b0387166060850152608084015260a0830152600060c0830152609b54610d2990610424906001600160a01b031681565b9060008751809981958294835260048301612cdc565b03925af19384156104b1576102e395600095610d79575b505090610d6681610d6b9361316f565b6130fe565b519081529081906020820190565b8392955092610d9b610d669285610d6b96903d106104aa5761049c818361192a565b95929350610d56565b80610db1610db7926118f7565b80610523565b38610c82565b610dd5919350883d8a116104aa5761049c818361192a565b9138610c38565b610df39150883d8a11610afa57610aeb818361192a565b38610bae565b5081341415610b51565b508115610b4a565b346101e95760203660031901126101e9576040610e32600435610e2d816101ee565b61293a565b82519182526020820152f35b60005b838110610e515750506000910152565b8181015183820152602001610e41565b90602091610e7a81518092818552858086019101610e3e565b601f01601f1916010190565b602080820190808352835180925260408301928160408460051b8301019501936000915b848310610eba5750505050505090565b9091929394958480610ed8600193603f198682030187528a51610e61565b9801930193019194939290610eaa565b60203660031901126101e957600480356001600160401b03918282116101e957366023830112156101e957818101359283116101e957602490818301928236918660051b0101116101e957610f3c846119df565b9360005b818110610f5557604051806102e38882610e86565b600080610f63838589611a69565b60409391610f75855180938193611aaf565b0390305af490610f83611ad8565b91829015610fb257505090610fad91610f9c8289611b7a565b52610fa78188611b7a565b50611a3f565b610f40565b8683879260448251106101e957826104cf9385610fd59401518301019101611b08565b925162461bcd60e51b81529283928301611b69565b610ff3366102e7565b9390919342116104d35782156104b6576001600160a01b038181161561050a5782161561050a5761044d60209160009561102f863033856131f1565b609b546110479087906001600160a01b031684613427565b6098546001600160a01b0316956103ed61107860016103ad8660018060a01b0316600052609e602052604060002090565b61109261108361194b565b6001600160a01b039096168652565b6001600160a01b038916858801526103e1565b346101e9576040806003193601126101e9576004356110c3816101ee565b6024356001600160a01b038216156106b75780156106cf576098546000939260809261065e9261062591906001600160a01b0316906106156105ea60016103ad8760018060a01b0316600052609e602052604060002090565b346101e95760003660031901126101e9576098546040516001600160a01b039091168152602090f35b346101e95760203660031901126101e957600435611162816101ee565b61116a611840565b6001600160a01b0316801561050a57609780546001600160a01b031916821790557fab64f92ab780ecbf4f3866f57cee465ff36c89450dcce20237ca7a8d81fb7d13600080a2005b346101e95760003660031901126101e9576099546040516001600160a01b039091168152602090f35b346101e9576040806003193601126101e95760048035916111fb836101ee565b6024356001600160a01b0384161561138757801561137057609b5483919060209061123090610424906001600160a01b031681565b84516312a9293f60e21b815295869182905afa9384156104b157600094611350575b506098546112b0906001600160a01b03169161128560016103ad8960018060a01b0316600052609e602052604060002090565b90611291610a0761196a565b6001600160a01b03841660208901528786015262ffffff166060870152565b6080946000868201526112d0610424610424609a5460018060a01b031690565b928685518095816000816112f1636352813560e11b98898352888301612c96565b03925af180156104b157610a6896889560009261132a575b50611319906106056105f661196a565b83860152610bb86060840152610a36565b61131991925061134690873d89116106b05761069e818361192a565b5050509190611309565b61136991945060203d8111610afa57610aeb818361192a565b9238611252565b815162461bcd60e51b8152806104cf818601612c35565b815162461bcd60e51b8152806104cf818601611bf1565b346101e95760203660031901126101e9576004356113bb816101ee565b6113c3611840565b6001600160a01b038116156113dd576113db90611898565b005b60405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608490fd5b346101e95760003660031901126101e957609c546040516001600160a01b039091168152602090f35b346101e95760803660031901126101e957600435611477816101ee565b6114e0602435611486816101ee565b604435611492816101ee565b6064359161149f836101ee565b600054946114c460ff8760081c16158097819861155e575b811561153e575b50611b8e565b856114d7600160ff196000541617600055565b61152557611c1a565b6114e657005b6114f661ff001960005416600055565b604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb384740249890602090a1005b61153961010061ff00196000541617600055565b611c1a565b303b15915081611550575b50386114be565b6001915060ff161438611549565b600160ff82161091506114b7565b611575366102e7565b91936001600160a01b039390929091908484161561050a578482161561050a5742116104d35781156104b657609b80546115b990610424906001600160a01b031681565b94604094855180976312a9293f60e21b825281600460209a8b935afa9081156104b157600091611823575b506098546001600160a01b0316956115fe813033866131f1565b84546116159082906001600160a01b031685613427565b61165d61163960016103ad8660018060a01b0316600052609e602052604060002090565b61164461108361194b565b6001600160a01b038916858c015262ffffff16848a0152565b3060608401526080830152600060a0830181905260c0830152835461168c90610424906001600160a01b031681565b918888518094816000816116ae6304e45aaf60e01b9788835260048301612cdc565b03925af19081156104b157611746948a94600093611801575b508654600091906116e39085906001600160a01b03168c613427565b87546001600160a01b03169361170c6116fa61194b565b6001600160a01b038d16815296610cd8565b610bb8868d01526001600160a01b038516606087015260808601528c60a08601528160c08601528a51809781968295835260048301612cdc565b0393165af19586156104b1576000966117d6575b50505461177190610424906001600160a01b031681565b803b156101e957835163125012df60e21b815260048101969096526001600160a01b03821660248701526000908690604490829084905af19182156104b1576102e395610d6b936117c3575b5061316f565b80610db16117d0926118f7565b386117bd565b6117719296506117f9610424928261042493903d106104aa5761049c818361192a565b96925061175a565b600091935061181c90863d88116104aa5761049c818361192a565b92906116c7565b61183a9150883d8a11610afa57610aeb818361192a565b386115e4565b6033546001600160a01b0316330361185457565b606460405162461bcd60e51b815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b603380546001600160a01b039283166001600160a01b0319821681179092559091167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a3565b634e487b7160e01b600052604160045260246000fd5b6001600160401b03811161190a57604052565b6118e1565b60a081019081106001600160401b0382111761190a57604052565b90601f801991011681019081106001600160401b0382111761190a57604052565b6040519060e082018281106001600160401b0382111761190a57604052565b6040519060a082018281106001600160401b0382111761190a57604052565b6040519061016082018281106001600160401b0382111761190a57604052565b60405190608082018281106001600160401b0382111761190a57604052565b6001600160401b03811161190a5760051b60200190565b906119e9826119c8565b6119f6604051918261192a565b8281528092611a07601f19916119c8565b019060005b828110611a1857505050565b806060602080938501015201611a0c565b634e487b7160e01b600052601160045260246000fd5b6000198114611a4e5760010190565b611a29565b634e487b7160e01b600052603260045260246000fd5b9190811015611aaa5760051b81013590601e19813603018212156101e95701908135916001600160401b0383116101e95760200182360381136101e9579190565b611a53565b908092918237016000815290565b6001600160401b03811161190a57601f01601f191660200190565b3d15611b03573d90611ae982611abd565b91611af7604051938461192a565b82523d6000602084013e565b606090565b6020818303126101e9578051906001600160401b0382116101e9570181601f820112156101e9578051611b3a81611abd565b92611b48604051948561192a565b818452602082840101116101e957611b669160208085019101610e3e565b90565b906020611b66928181520190610e61565b8051821015611aaa5760209160051b010190565b15611b9557565b60405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608490fd5b60609060208152600e60208201526d496e76616c69644164647265737360901b60408201520190565b90929192611c3860ff60005460081c16611c3381611d24565b611d24565b611c4133611898565b611c5660ff60005460081c16611c3381611d24565b60016065556001600160a01b0382811615908115611d19575b8115611d0e575b8115611d03575b5061050a57609880546001600160a01b0319166001600160a01b03841617905561020c93611ce391611cc69060018060a01b03166001600160601b0360a01b6099541617609955565b60018060a01b03166001600160601b0360a01b609a541617609a55565b609b80546001600160a01b0319166001600160a01b0384161790556132ff565b905083161538611c7d565b858116159150611c76565b828116159150611c6f565b15611d2b57565b60405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608490fd5b929192611d9082611abd565b91611d9e604051938461192a565b8294818452818301116101e9578281602093846000960137010152565b979493959996989192611dd6611dde92611de6953691611d84565b963691611d84565b953691611d84565b6000868152609d60205260409020546001600160a01b039391908416612361578142116104d3578383161561050a5784511561232e578551156122f957611e3291888a8589898c612e34565b6097546001600160a01b03166040805160208082018981529294939092611e7292611e69818089015b03601f19810183528261192a565b51902090612438565b98848a1698893b156101e957611ea5978a9786519889809263266c45bb60e11b82528160009d8e9687936004840161239b565b03925af19182156104b1578a97611ec2936122e6575b508b612d68565b87516370a0823160e01b81523060048201529299919892949392918690869060249082905afa998a156104b1578e8c96879c6122bb575b506099548892611f7e929091611f1a918f916001600160a01b031690613427565b609954611f3b90611f3590610424906001600160a01b031681565b916124f6565b8b516309f56ab160e11b81526001600160a01b03808a16600483015280891660248301526127106044830152909116606482015297889283919082906084820190565b03925af19889156104b1578b9a8b8f97819c61227b575b50926120146120e197959361200361201d9460809b9997611fc361042461042460995460018060a01b031690565b9a8a891681036122745782985b8a160361226c5750965b611ff4611fe5611989565b6001600160a01b03909a168a52565b6001600160a01b0316888d0152565b612710878e015260020b6060870152565b60020b84880152565b60a0830190815260c0830191825260e083018b815261010084018c815230610120860190815260001961014087019081528c51634418b22b60e11b815287516001600160a01b039081166004830152602089015181166024830152604089015162ffffff1660448301526060890151600290810b606484015260809099015190980b6084820152945160a4860152945160c4850152915160e48401525161010483015251909216610124830152516101448201529788928391908290610164820190565b03925af19485156104b1577f035044c956f0f85240e40898163f0636d588d72de5fd08d79a9168d6267451739695612227575b50612221929161214d856121ca9361213c61212d6119a9565b6001600160a01b039095168552565b6001600160a01b0390911690830152565b61271083820152606081018681526001600160a01b038b81166000908152609e6020908152604091829020855181549085166001600160a01b031990911617815590850151600182018054939096015162ffffff60a01b60a09190911b166001600160b81b03199093169316929092171790925551600290910155565b612201886121e288600052609d602052604060002090565b80546001600160a01b0319166001600160a01b03909216919091179055565b516001600160a01b03909216825260208201929092529081906040820190565b0390a390565b6121ca9195509161214d85612256612221969560803d8111612265575b61224e818361192a565b81019061240f565b50505097935050509192612114565b503d612244565b905096611fda565b8198611fd0565b6080989694919c506120e197959361200361201d946122a9612014948e803d10610afa57610aeb818361192a565b9f9497999b5094505093959750611f95565b611f7e919c5091611f1a6122dc8a94853d87116104aa5761049c818361192a565b9d92505091611ef9565b80610db16122f3926118f7565b38611ebb565b60405162461bcd60e51b815260206004820152600d60248201526c125b9d985b1a5914de5b589bdb609a1b6044820152606490fd5b60405162461bcd60e51b815260206004820152600b60248201526a496e76616c69644e616d6560a81b6044820152606490fd5b60405162461bcd60e51b8152602060048201526012602482015271546f6b656e416c726561647945786973747360701b6044820152606490fd5b90916123b2611b6693604084526040840190610e61565b916020818403910152610e61565b6040513d6000823e3d90fd5b908160209103126101e9575190565b519061020c826101ee565b908160209103126101e95751611b66816101ee565b51906001600160801b03821682036101e957565b91908260809103126101e95781519161242a602082016123fb565b916060604083015192015190565b6e5af43d82803e903d91602b57fd5bf390763d602d80600a3d3981f3363d3d373d3d3d363d7300000062ffffff8260881c161760005260781b17602052603760096000f5906001600160a01b0382161561248e57565b60405162461bcd60e51b815260206004820152601760248201527f455243313136373a2063726561746532206661696c65640000000000000000006044820152606490fd5b80156124e0576000190490565b634e487b7160e01b600052601260045260246000fd5b60020b60008112156128605780600003905b620d89e8821161284e57600182161561283c576001600160881b036ffffcb933bd6fad37aa2d162d1a5940015b169160028116612820575b60048116612804575b600881166127e8575b601081166127cc575b602081166127b0575b60408116612794575b608090818116612779575b610100811661275e575b6102008116612743575b6104008116612728575b610800811661270d575b61100081166126f2575b61200081166126d7575b61400081166126bc575b61800081166126a1575b620100008116612686575b62020000811661266c575b620400008116612652575b6208000016612637575b50600012612629575b63ffffffff8116612621576000905b60201c60ff91909116016001600160a01b031690565b60019061260b565b612632906124d3565b6125fc565b6b048a170391f7dc42444e8fa26000929302901c91906125f3565b6d2216e584f5fa1ea926041bedfe98909302811c926125e9565b926e5d6af8dedb81196699c329225ee60402811c926125de565b926f09aa508b5b7a84e1c677de54f3e99bc902811c926125d3565b926f31be135f97d08fd981231505542fcfa602811c926125c8565b926f70d869a156d2a1b890bb3df62baf32f702811c926125be565b926fa9f746462d870fdf8a65dc1f90e061e502811c926125b4565b926fd097f3bdfd2022b8845ad8f792aa582502811c926125aa565b926fe7159475a2c29b7443b29c7fa6e889d902811c926125a0565b926ff3392b0822b70005940c7a398e4b70f302811c92612596565b926ff987a7253ac413176f2b074cf7815e5402811c9261258c565b926ffcbe86c7900a88aedcffc83b479aa3a402811c92612582565b926ffe5dee046a99a2a811c461f1969c305302811c92612578565b916fff2ea16466c96a3843ec78b326b528610260801c9161256d565b916fff973b41fa98c081472e6896dfb254c00260801c91612564565b916fffcb9843d60f6159c9db58835c9266440260801c9161255b565b916fffe5caca7e10e4e61c3624eaa0941cd00260801c91612552565b916ffff2e50f5f656932ef12357cf3c7fdcc0260801c91612549565b916ffff97272373d413259a46990580e213a0260801c91612540565b6001600160881b03600160801b612535565b6040516315e4079d60e11b8152600490fd5b80612508565b91908260409103126101e9576020825192015190565b519062ffffff821682036101e957565b519061020c8261020e565b9190826101809103126101e95781516001600160601b03811681036101e957916128c3602082016123db565b916128d0604083016123db565b916128dd606082016123db565b916128ea6080830161287c565b916128f760a0820161288c565b9161290460c0830161288c565b9161291160e082016123fb565b916101008201519161012081015191611b6661016061293361014085016123fb565b93016123fb565b6001600160a01b0381169190821561050a576001600160a01b03166000908152609e602052604090209060028201548015612bd657609954612a08949061298b90610424906001600160a01b031681565b6129936119a9565b838152306020820152906040826129b3828095016001600160801b039052565b6001600160801b0360608201818152835163fc6f786560e01b81528351600482015260208401516001600160a01b03166024820152604090930151821660448401525116606482015297889081906084820190565b0381600080955af19586156104b15781978297612ba1575b5087158781612b98575b50612b8d57609954612a4690610424906001600160a01b031681565b835163133f757160e31b8152600481018790529290610180908190859060249082905afa9485156104b1577fa9aef66785858ba9f82e784db3e0dac4c23fb56b320d2cef3d4a0230d4c15e24958b958b938592612b44575b5050612b1c90612b3f9495612b10612abf612ab88a612c1f565b600a900490565b91612b16612ae0612ad2612ab88a612c1f565b92546001600160a01b031690565b99612aec858c836132b3565b612af7838c886132b3565b6033546001600160a01b0316948590612b10908e612c12565b916132b3565b86612c12565b5193849384604091949392606082019560018060a01b0316825260208201520152565b0390a3565b612b3f9550612b1c92509081612b6e92903d10612b86575b612b66818361192a565b810190612897565b50505050505050509792509050959181969550612a9e565b503d612b5c565b509550859450505050565b90501538612a2a565b909650612bc5919750823d8411612bcf575b612bbd818361192a565b810190612866565b9690969538612a20565b503d612bb3565b60405162461bcd60e51b8152602060048201526014602482015273125b9d985b1a59141bdcda5d1a5bdb93999d125960621b6044820152606490fd5b91908203918211611a4e57565b908160021b9180830460041490151715611a4e57565b60609060208152600d60208201526c125b9d985b1a59105b5bdd5b9d609a1b60408201520190565b91908260809103126101e9578151916020810151612c7a816101ee565b91604082015163ffffffff811681036101e95760609092015190565b919091608060a08201938160018060a01b03918281511685528260208201511660208601526040810151604086015262ffffff6060820151166060860152015116910152565b91909160c060e08201938160018060a01b039182815116855282602082015116602086015262ffffff60408201511660408601528260608201511660608601526080810151608086015260a081015160a0860152015116910152565b60020b627fffff198114611a4e5760000390565b60020b6000190190627fffff198212627fffff831317611a4e57565b6001600160a01b038082169492939190851561050a576098541694851561050a57851115612d9f57939290612d9c82612d4c565b92565b9290612db490612dae90612d38565b91612d38565b60018160020b01627fffff198112627fffff821317611a4e5792565b959998979490926101009794612e0b91612e199460018060a01b038097168a5260208a015260408901526101208060608a0152880190610e61565b908682036080880152610e61565b971660a084015260020b60c083015260020b60e08201520152565b609c546001600160a01b0390811698909796909590949193929091891561050a57612eaf97612eaa96612e7894611e5b93604051978896602088019a46308d612dd0565b5190207f19457468657265756d205369676e6564204d6573736167653a0a333200000000600052601c52603c60002090565b612eef565b1603612eb757565b60405162461bcd60e51b815260206004820152601060248201526f496e76616c69645369676e617475726560801b6044820152606490fd5b611b6691612efc91613044565b919091612f24565b60051115612f0e57565b634e487b7160e01b600052602160045260246000fd5b612f2d81612f04565b80612f355750565b612f3e81612f04565b60018103612f8b5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606490fd5b612f9481612f04565b60028103612fe15760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606490fd5b80612fed600392612f04565b14612ff457565b60405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608490fd5b9060418151146000146130725761306e916020820151906060604084015193015160001a9061307c565b9091565b5050600090600290565b9291907f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083116130f25791608094939160ff602094604051948552168484015260408301526060820152600093849182805260015afa156104b15781516001600160a01b038116156130ec579190565b50600190565b50505050600090600390565b479081613109575050565b60405160208101908082106001600160401b0383111761190a576000938493848094938194604052525af161313c611ad8565b501561314457565b60405162461bcd60e51b815260206004820152600360248201526253544560e81b6044820152606490fd5b6040516370a0823160e01b815230600482015290916020826024816001600160a01b0387165afa9182156104b1576000926131b9575b50816131b057505050565b61020c926132b3565b6131d291925060203d81116104aa5761049c818361192a565b90386131a5565b908160209103126101e9575180151581036101e95790565b909183156132ad57600080949381946040519160208301946323b872dd60e01b865260018060a01b03809216602485015216604483015260648201526064815261323a8161190f565b51925af1613246611ad8565b8161327e575b501561325457565b60405162461bcd60e51b81526020600482015260026024820152612a2360f11b6044820152606490fd5b8051801592508215613293575b50503861324c565b6132a692506020809183010191016131d9565b388061328b565b50505050565b91909181156132fa5760405163a9059cbb60e01b602082019081526001600160a01b03909416602482015260448101929092526000928392839061323a8160648101611e5b565b505050565b604051636eb1769f60e11b81523060048201526001600160a01b0383166024820152602092908381806044810103816001600160a01b0387165afa9081156104b15760009161340a575b5060001911156132fa5760405163095ea7b360e01b8482019081526001600160a01b03909216602482015260001960448201526000928392909183906133928160648101611e5b565b51925af19061339f611ad8565b826133d8575b5050156133ae57565b60405162461bcd60e51b815260206004820152600260248201526120a360f11b6044820152606490fd5b80919250519182159283156133f2575b50505038806133a5565b61340293508201810191016131d9565b3880806133e8565b6134219150843d86116104aa5761049c818361192a565b38613349565b604051636eb1769f60e11b81523060048201526001600160a01b0383166024820152602093919291908481806044810103816001600160a01b0388165afa9081156104b1576000916134ba575b5010156132fa5760405163095ea7b360e01b8482019081526001600160a01b03909216602482015260001960448201526000928392909183906133928160648101611e5b565b6134d19150853d87116104aa5761049c818361192a565b3861347456fea264697066735822122003fe67604d8ccab25857ab5ae0cec4f03596bb98406136066ef8f98bd91ebbd564736f6c63430008130033", } // VibeTokenFactoryABI is the input ABI used to generate the binding from. // Deprecated: Use VibeTokenFactoryMetaData.ABI instead. var VibeTokenFactoryABI = VibeTokenFactoryMetaData.ABI // VibeTokenFactoryBin is the compiled bytecode used for deploying new contracts. // Deprecated: Use VibeTokenFactoryMetaData.Bin instead. var VibeTokenFactoryBin = VibeTokenFactoryMetaData.Bin // DeployVibeTokenFactory deploys a new Ethereum contract, binding an instance of VibeTokenFactory to it. func DeployVibeTokenFactory(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *VibeTokenFactory, error) { parsed, err := VibeTokenFactoryMetaData.GetAbi() if err != nil { return common.Address{}, nil, nil, err } if parsed == nil { return common.Address{}, nil, nil, errors.New("GetABI returned nil") } address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(VibeTokenFactoryBin), backend) if err != nil { return common.Address{}, nil, nil, err } return address, tx, &VibeTokenFactory{VibeTokenFactoryCaller: VibeTokenFactoryCaller{contract: contract}, VibeTokenFactoryTransactor: VibeTokenFactoryTransactor{contract: contract}, VibeTokenFactoryFilterer: VibeTokenFactoryFilterer{contract: contract}}, nil } // VibeTokenFactory is an auto generated Go binding around an Ethereum contract. type VibeTokenFactory struct { VibeTokenFactoryCaller // Read-only binding to the contract VibeTokenFactoryTransactor // Write-only binding to the contract VibeTokenFactoryFilterer // Log filterer for contract events } // VibeTokenFactoryCaller is an auto generated read-only Go binding around an Ethereum contract. type VibeTokenFactoryCaller struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // VibeTokenFactoryTransactor is an auto generated write-only Go binding around an Ethereum contract. type VibeTokenFactoryTransactor struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // VibeTokenFactoryFilterer is an auto generated log filtering Go binding around an Ethereum contract events. type VibeTokenFactoryFilterer struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // VibeTokenFactorySession is an auto generated Go binding around an Ethereum contract, // with pre-set call and transact options. type VibeTokenFactorySession struct { Contract *VibeTokenFactory // Generic contract binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // VibeTokenFactoryCallerSession is an auto generated read-only Go binding around an Ethereum contract, // with pre-set call options. type VibeTokenFactoryCallerSession struct { Contract *VibeTokenFactoryCaller // Generic contract caller binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session } // VibeTokenFactoryTransactorSession is an auto generated write-only Go binding around an Ethereum contract, // with pre-set transact options. type VibeTokenFactoryTransactorSession struct { Contract *VibeTokenFactoryTransactor // Generic contract transactor binding to set the session for TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // VibeTokenFactoryRaw is an auto generated low-level Go binding around an Ethereum contract. type VibeTokenFactoryRaw struct { Contract *VibeTokenFactory // Generic contract binding to access the raw methods on } // VibeTokenFactoryCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. type VibeTokenFactoryCallerRaw struct { Contract *VibeTokenFactoryCaller // Generic read-only contract binding to access the raw methods on } // VibeTokenFactoryTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. type VibeTokenFactoryTransactorRaw struct { Contract *VibeTokenFactoryTransactor // Generic write-only contract binding to access the raw methods on } // NewVibeTokenFactory creates a new instance of VibeTokenFactory, bound to a specific deployed contract. func NewVibeTokenFactory(address common.Address, backend bind.ContractBackend) (*VibeTokenFactory, error) { contract, err := bindVibeTokenFactory(address, backend, backend, backend) if err != nil { return nil, err } return &VibeTokenFactory{VibeTokenFactoryCaller: VibeTokenFactoryCaller{contract: contract}, VibeTokenFactoryTransactor: VibeTokenFactoryTransactor{contract: contract}, VibeTokenFactoryFilterer: VibeTokenFactoryFilterer{contract: contract}}, nil } // NewVibeTokenFactoryCaller creates a new read-only instance of VibeTokenFactory, bound to a specific deployed contract. func NewVibeTokenFactoryCaller(address common.Address, caller bind.ContractCaller) (*VibeTokenFactoryCaller, error) { contract, err := bindVibeTokenFactory(address, caller, nil, nil) if err != nil { return nil, err } return &VibeTokenFactoryCaller{contract: contract}, nil } // NewVibeTokenFactoryTransactor creates a new write-only instance of VibeTokenFactory, bound to a specific deployed contract. func NewVibeTokenFactoryTransactor(address common.Address, transactor bind.ContractTransactor) (*VibeTokenFactoryTransactor, error) { contract, err := bindVibeTokenFactory(address, nil, transactor, nil) if err != nil { return nil, err } return &VibeTokenFactoryTransactor{contract: contract}, nil } // NewVibeTokenFactoryFilterer creates a new log filterer instance of VibeTokenFactory, bound to a specific deployed contract. func NewVibeTokenFactoryFilterer(address common.Address, filterer bind.ContractFilterer) (*VibeTokenFactoryFilterer, error) { contract, err := bindVibeTokenFactory(address, nil, nil, filterer) if err != nil { return nil, err } return &VibeTokenFactoryFilterer{contract: contract}, nil } // bindVibeTokenFactory binds a generic wrapper to an already deployed contract. func bindVibeTokenFactory(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { parsed, err := VibeTokenFactoryMetaData.GetAbi() if err != nil { return nil, err } return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_VibeTokenFactory *VibeTokenFactoryRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _VibeTokenFactory.Contract.VibeTokenFactoryCaller.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_VibeTokenFactory *VibeTokenFactoryRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _VibeTokenFactory.Contract.VibeTokenFactoryTransactor.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_VibeTokenFactory *VibeTokenFactoryRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _VibeTokenFactory.Contract.VibeTokenFactoryTransactor.contract.Transact(opts, method, params...) } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_VibeTokenFactory *VibeTokenFactoryCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _VibeTokenFactory.Contract.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_VibeTokenFactory *VibeTokenFactoryTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _VibeTokenFactory.Contract.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_VibeTokenFactory *VibeTokenFactoryTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _VibeTokenFactory.Contract.contract.Transact(opts, method, params...) } // Admin is a free data retrieval call binding the contract method 0xf851a440. // // Solidity: function admin() view returns(address) func (_VibeTokenFactory *VibeTokenFactoryCaller) Admin(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _VibeTokenFactory.contract.Call(opts, &out, "admin") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // Admin is a free data retrieval call binding the contract method 0xf851a440. // // Solidity: function admin() view returns(address) func (_VibeTokenFactory *VibeTokenFactorySession) Admin() (common.Address, error) { return _VibeTokenFactory.Contract.Admin(&_VibeTokenFactory.CallOpts) } // Admin is a free data retrieval call binding the contract method 0xf851a440. // // Solidity: function admin() view returns(address) func (_VibeTokenFactory *VibeTokenFactoryCallerSession) Admin() (common.Address, error) { return _VibeTokenFactory.Contract.Admin(&_VibeTokenFactory.CallOpts) } // BaseToken is a free data retrieval call binding the contract method 0xc55dae63. // // Solidity: function baseToken() view returns(address) func (_VibeTokenFactory *VibeTokenFactoryCaller) BaseToken(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _VibeTokenFactory.contract.Call(opts, &out, "baseToken") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // BaseToken is a free data retrieval call binding the contract method 0xc55dae63. // // Solidity: function baseToken() view returns(address) func (_VibeTokenFactory *VibeTokenFactorySession) BaseToken() (common.Address, error) { return _VibeTokenFactory.Contract.BaseToken(&_VibeTokenFactory.CallOpts) } // BaseToken is a free data retrieval call binding the contract method 0xc55dae63. // // Solidity: function baseToken() view returns(address) func (_VibeTokenFactory *VibeTokenFactoryCallerSession) BaseToken() (common.Address, error) { return _VibeTokenFactory.Contract.BaseToken(&_VibeTokenFactory.CallOpts) } // DeployedTokens is a free data retrieval call binding the contract method 0x61309596. // // Solidity: function deployedTokens(bytes32 ) view returns(address) func (_VibeTokenFactory *VibeTokenFactoryCaller) DeployedTokens(opts *bind.CallOpts, arg0 [32]byte) (common.Address, error) { var out []interface{} err := _VibeTokenFactory.contract.Call(opts, &out, "deployedTokens", arg0) if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // DeployedTokens is a free data retrieval call binding the contract method 0x61309596. // // Solidity: function deployedTokens(bytes32 ) view returns(address) func (_VibeTokenFactory *VibeTokenFactorySession) DeployedTokens(arg0 [32]byte) (common.Address, error) { return _VibeTokenFactory.Contract.DeployedTokens(&_VibeTokenFactory.CallOpts, arg0) } // DeployedTokens is a free data retrieval call binding the contract method 0x61309596. // // Solidity: function deployedTokens(bytes32 ) view returns(address) func (_VibeTokenFactory *VibeTokenFactoryCallerSession) DeployedTokens(arg0 [32]byte) (common.Address, error) { return _VibeTokenFactory.Contract.DeployedTokens(&_VibeTokenFactory.CallOpts, arg0) } // GetChainId is a free data retrieval call binding the contract method 0x3408e470. // // Solidity: function getChainId() view returns(uint256 chainId) func (_VibeTokenFactory *VibeTokenFactoryCaller) GetChainId(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} err := _VibeTokenFactory.contract.Call(opts, &out, "getChainId") if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // GetChainId is a free data retrieval call binding the contract method 0x3408e470. // // Solidity: function getChainId() view returns(uint256 chainId) func (_VibeTokenFactory *VibeTokenFactorySession) GetChainId() (*big.Int, error) { return _VibeTokenFactory.Contract.GetChainId(&_VibeTokenFactory.CallOpts) } // GetChainId is a free data retrieval call binding the contract method 0x3408e470. // // Solidity: function getChainId() view returns(uint256 chainId) func (_VibeTokenFactory *VibeTokenFactoryCallerSession) GetChainId() (*big.Int, error) { return _VibeTokenFactory.Contract.GetChainId(&_VibeTokenFactory.CallOpts) } // Implementation is a free data retrieval call binding the contract method 0x5c60da1b. // // Solidity: function implementation() view returns(address) func (_VibeTokenFactory *VibeTokenFactoryCaller) Implementation(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _VibeTokenFactory.contract.Call(opts, &out, "implementation") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // Implementation is a free data retrieval call binding the contract method 0x5c60da1b. // // Solidity: function implementation() view returns(address) func (_VibeTokenFactory *VibeTokenFactorySession) Implementation() (common.Address, error) { return _VibeTokenFactory.Contract.Implementation(&_VibeTokenFactory.CallOpts) } // Implementation is a free data retrieval call binding the contract method 0x5c60da1b. // // Solidity: function implementation() view returns(address) func (_VibeTokenFactory *VibeTokenFactoryCallerSession) Implementation() (common.Address, error) { return _VibeTokenFactory.Contract.Implementation(&_VibeTokenFactory.CallOpts) } // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. // // Solidity: function owner() view returns(address) func (_VibeTokenFactory *VibeTokenFactoryCaller) Owner(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _VibeTokenFactory.contract.Call(opts, &out, "owner") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. // // Solidity: function owner() view returns(address) func (_VibeTokenFactory *VibeTokenFactorySession) Owner() (common.Address, error) { return _VibeTokenFactory.Contract.Owner(&_VibeTokenFactory.CallOpts) } // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. // // Solidity: function owner() view returns(address) func (_VibeTokenFactory *VibeTokenFactoryCallerSession) Owner() (common.Address, error) { return _VibeTokenFactory.Contract.Owner(&_VibeTokenFactory.CallOpts) } // TokenMetadata is a free data retrieval call binding the contract method 0x6fecdf24. // // Solidity: function tokenMetadata(address ) view returns(address creator, address pool, uint24 fee, uint256 positionNftId) func (_VibeTokenFactory *VibeTokenFactoryCaller) TokenMetadata(opts *bind.CallOpts, arg0 common.Address) (struct { Creator common.Address Pool common.Address Fee *big.Int PositionNftId *big.Int }, error) { var out []interface{} err := _VibeTokenFactory.contract.Call(opts, &out, "tokenMetadata", arg0) outstruct := new(struct { Creator common.Address Pool common.Address Fee *big.Int PositionNftId *big.Int }) if err != nil { return *outstruct, err } outstruct.Creator = *abi.ConvertType(out[0], new(common.Address)).(*common.Address) outstruct.Pool = *abi.ConvertType(out[1], new(common.Address)).(*common.Address) outstruct.Fee = *abi.ConvertType(out[2], new(*big.Int)).(**big.Int) outstruct.PositionNftId = *abi.ConvertType(out[3], new(*big.Int)).(**big.Int) return *outstruct, err } // TokenMetadata is a free data retrieval call binding the contract method 0x6fecdf24. // // Solidity: function tokenMetadata(address ) view returns(address creator, address pool, uint24 fee, uint256 positionNftId) func (_VibeTokenFactory *VibeTokenFactorySession) TokenMetadata(arg0 common.Address) (struct { Creator common.Address Pool common.Address Fee *big.Int PositionNftId *big.Int }, error) { return _VibeTokenFactory.Contract.TokenMetadata(&_VibeTokenFactory.CallOpts, arg0) } // TokenMetadata is a free data retrieval call binding the contract method 0x6fecdf24. // // Solidity: function tokenMetadata(address ) view returns(address creator, address pool, uint24 fee, uint256 positionNftId) func (_VibeTokenFactory *VibeTokenFactoryCallerSession) TokenMetadata(arg0 common.Address) (struct { Creator common.Address Pool common.Address Fee *big.Int PositionNftId *big.Int }, error) { return _VibeTokenFactory.Contract.TokenMetadata(&_VibeTokenFactory.CallOpts, arg0) } // UniswapPositionManager is a free data retrieval call binding the contract method 0xe5047b30. // // Solidity: function uniswapPositionManager() view returns(address) func (_VibeTokenFactory *VibeTokenFactoryCaller) UniswapPositionManager(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _VibeTokenFactory.contract.Call(opts, &out, "uniswapPositionManager") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // UniswapPositionManager is a free data retrieval call binding the contract method 0xe5047b30. // // Solidity: function uniswapPositionManager() view returns(address) func (_VibeTokenFactory *VibeTokenFactorySession) UniswapPositionManager() (common.Address, error) { return _VibeTokenFactory.Contract.UniswapPositionManager(&_VibeTokenFactory.CallOpts) } // UniswapPositionManager is a free data retrieval call binding the contract method 0xe5047b30. // // Solidity: function uniswapPositionManager() view returns(address) func (_VibeTokenFactory *VibeTokenFactoryCallerSession) UniswapPositionManager() (common.Address, error) { return _VibeTokenFactory.Contract.UniswapPositionManager(&_VibeTokenFactory.CallOpts) } // UniswapQuoter is a free data retrieval call binding the contract method 0x4db4a352. // // Solidity: function uniswapQuoter() view returns(address) func (_VibeTokenFactory *VibeTokenFactoryCaller) UniswapQuoter(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _VibeTokenFactory.contract.Call(opts, &out, "uniswapQuoter") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // UniswapQuoter is a free data retrieval call binding the contract method 0x4db4a352. // // Solidity: function uniswapQuoter() view returns(address) func (_VibeTokenFactory *VibeTokenFactorySession) UniswapQuoter() (common.Address, error) { return _VibeTokenFactory.Contract.UniswapQuoter(&_VibeTokenFactory.CallOpts) } // UniswapQuoter is a free data retrieval call binding the contract method 0x4db4a352. // // Solidity: function uniswapQuoter() view returns(address) func (_VibeTokenFactory *VibeTokenFactoryCallerSession) UniswapQuoter() (common.Address, error) { return _VibeTokenFactory.Contract.UniswapQuoter(&_VibeTokenFactory.CallOpts) } // UniswapRouter is a free data retrieval call binding the contract method 0x735de9f7. // // Solidity: function uniswapRouter() view returns(address) func (_VibeTokenFactory *VibeTokenFactoryCaller) UniswapRouter(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _VibeTokenFactory.contract.Call(opts, &out, "uniswapRouter") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // UniswapRouter is a free data retrieval call binding the contract method 0x735de9f7. // // Solidity: function uniswapRouter() view returns(address) func (_VibeTokenFactory *VibeTokenFactorySession) UniswapRouter() (common.Address, error) { return _VibeTokenFactory.Contract.UniswapRouter(&_VibeTokenFactory.CallOpts) } // UniswapRouter is a free data retrieval call binding the contract method 0x735de9f7. // // Solidity: function uniswapRouter() view returns(address) func (_VibeTokenFactory *VibeTokenFactoryCallerSession) UniswapRouter() (common.Address, error) { return _VibeTokenFactory.Contract.UniswapRouter(&_VibeTokenFactory.CallOpts) } // CollectFees is a paid mutator transaction binding the contract method 0xa480ca79. // // Solidity: function collectFees(address token) returns(uint256 amount0, uint256 amount1) func (_VibeTokenFactory *VibeTokenFactoryTransactor) CollectFees(opts *bind.TransactOpts, token common.Address) (*types.Transaction, error) { return _VibeTokenFactory.contract.Transact(opts, "collectFees", token) } // CollectFees is a paid mutator transaction binding the contract method 0xa480ca79. // // Solidity: function collectFees(address token) returns(uint256 amount0, uint256 amount1) func (_VibeTokenFactory *VibeTokenFactorySession) CollectFees(token common.Address) (*types.Transaction, error) { return _VibeTokenFactory.Contract.CollectFees(&_VibeTokenFactory.TransactOpts, token) } // CollectFees is a paid mutator transaction binding the contract method 0xa480ca79. // // Solidity: function collectFees(address token) returns(uint256 amount0, uint256 amount1) func (_VibeTokenFactory *VibeTokenFactoryTransactorSession) CollectFees(token common.Address) (*types.Transaction, error) { return _VibeTokenFactory.Contract.CollectFees(&_VibeTokenFactory.TransactOpts, token) } // CreateToken is a paid mutator transaction binding the contract method 0x1871a22d. // // Solidity: function createToken(bytes32 nonce, string name, string symbol, address creator, int24 tickLower, int24 tickUpper, uint256 deadline, bytes signature) returns(address token) func (_VibeTokenFactory *VibeTokenFactoryTransactor) CreateToken(opts *bind.TransactOpts, nonce [32]byte, name string, symbol string, creator common.Address, tickLower *big.Int, tickUpper *big.Int, deadline *big.Int, signature []byte) (*types.Transaction, error) { return _VibeTokenFactory.contract.Transact(opts, "createToken", nonce, name, symbol, creator, tickLower, tickUpper, deadline, signature) } // CreateToken is a paid mutator transaction binding the contract method 0x1871a22d. // // Solidity: function createToken(bytes32 nonce, string name, string symbol, address creator, int24 tickLower, int24 tickUpper, uint256 deadline, bytes signature) returns(address token) func (_VibeTokenFactory *VibeTokenFactorySession) CreateToken(nonce [32]byte, name string, symbol string, creator common.Address, tickLower *big.Int, tickUpper *big.Int, deadline *big.Int, signature []byte) (*types.Transaction, error) { return _VibeTokenFactory.Contract.CreateToken(&_VibeTokenFactory.TransactOpts, nonce, name, symbol, creator, tickLower, tickUpper, deadline, signature) } // CreateToken is a paid mutator transaction binding the contract method 0x1871a22d. // // Solidity: function createToken(bytes32 nonce, string name, string symbol, address creator, int24 tickLower, int24 tickUpper, uint256 deadline, bytes signature) returns(address token) func (_VibeTokenFactory *VibeTokenFactoryTransactorSession) CreateToken(nonce [32]byte, name string, symbol string, creator common.Address, tickLower *big.Int, tickUpper *big.Int, deadline *big.Int, signature []byte) (*types.Transaction, error) { return _VibeTokenFactory.Contract.CreateToken(&_VibeTokenFactory.TransactOpts, nonce, name, symbol, creator, tickLower, tickUpper, deadline, signature) } // Initialize is a paid mutator transaction binding the contract method 0xf8c8765e. // // Solidity: function initialize(address _baseToken, address _uniswapPositionManager, address _uniswapQuoter, address _uniswapRouter) returns() func (_VibeTokenFactory *VibeTokenFactoryTransactor) Initialize(opts *bind.TransactOpts, _baseToken common.Address, _uniswapPositionManager common.Address, _uniswapQuoter common.Address, _uniswapRouter common.Address) (*types.Transaction, error) { return _VibeTokenFactory.contract.Transact(opts, "initialize", _baseToken, _uniswapPositionManager, _uniswapQuoter, _uniswapRouter) } // Initialize is a paid mutator transaction binding the contract method 0xf8c8765e. // // Solidity: function initialize(address _baseToken, address _uniswapPositionManager, address _uniswapQuoter, address _uniswapRouter) returns() func (_VibeTokenFactory *VibeTokenFactorySession) Initialize(_baseToken common.Address, _uniswapPositionManager common.Address, _uniswapQuoter common.Address, _uniswapRouter common.Address) (*types.Transaction, error) { return _VibeTokenFactory.Contract.Initialize(&_VibeTokenFactory.TransactOpts, _baseToken, _uniswapPositionManager, _uniswapQuoter, _uniswapRouter) } // Initialize is a paid mutator transaction binding the contract method 0xf8c8765e. // // Solidity: function initialize(address _baseToken, address _uniswapPositionManager, address _uniswapQuoter, address _uniswapRouter) returns() func (_VibeTokenFactory *VibeTokenFactoryTransactorSession) Initialize(_baseToken common.Address, _uniswapPositionManager common.Address, _uniswapQuoter common.Address, _uniswapRouter common.Address) (*types.Transaction, error) { return _VibeTokenFactory.Contract.Initialize(&_VibeTokenFactory.TransactOpts, _baseToken, _uniswapPositionManager, _uniswapQuoter, _uniswapRouter) } // Multicall is a paid mutator transaction binding the contract method 0xac9650d8. // // Solidity: function multicall(bytes[] data) payable returns(bytes[] results) func (_VibeTokenFactory *VibeTokenFactoryTransactor) Multicall(opts *bind.TransactOpts, data [][]byte) (*types.Transaction, error) { return _VibeTokenFactory.contract.Transact(opts, "multicall", data) } // Multicall is a paid mutator transaction binding the contract method 0xac9650d8. // // Solidity: function multicall(bytes[] data) payable returns(bytes[] results) func (_VibeTokenFactory *VibeTokenFactorySession) Multicall(data [][]byte) (*types.Transaction, error) { return _VibeTokenFactory.Contract.Multicall(&_VibeTokenFactory.TransactOpts, data) } // Multicall is a paid mutator transaction binding the contract method 0xac9650d8. // // Solidity: function multicall(bytes[] data) payable returns(bytes[] results) func (_VibeTokenFactory *VibeTokenFactoryTransactorSession) Multicall(data [][]byte) (*types.Transaction, error) { return _VibeTokenFactory.Contract.Multicall(&_VibeTokenFactory.TransactOpts, data) } // QuoteExactBaseForVibeToken is a paid mutator transaction binding the contract method 0x575f00d7. // // Solidity: function quoteExactBaseForVibeToken(address VibeToken, uint256 amountBase) returns(uint256 amountOutVibeToken) func (_VibeTokenFactory *VibeTokenFactoryTransactor) QuoteExactBaseForVibeToken(opts *bind.TransactOpts, VibeToken common.Address, amountBase *big.Int) (*types.Transaction, error) { return _VibeTokenFactory.contract.Transact(opts, "quoteExactBaseForVibeToken", VibeToken, amountBase) } // QuoteExactBaseForVibeToken is a paid mutator transaction binding the contract method 0x575f00d7. // // Solidity: function quoteExactBaseForVibeToken(address VibeToken, uint256 amountBase) returns(uint256 amountOutVibeToken) func (_VibeTokenFactory *VibeTokenFactorySession) QuoteExactBaseForVibeToken(VibeToken common.Address, amountBase *big.Int) (*types.Transaction, error) { return _VibeTokenFactory.Contract.QuoteExactBaseForVibeToken(&_VibeTokenFactory.TransactOpts, VibeToken, amountBase) } // QuoteExactBaseForVibeToken is a paid mutator transaction binding the contract method 0x575f00d7. // // Solidity: function quoteExactBaseForVibeToken(address VibeToken, uint256 amountBase) returns(uint256 amountOutVibeToken) func (_VibeTokenFactory *VibeTokenFactoryTransactorSession) QuoteExactBaseForVibeToken(VibeToken common.Address, amountBase *big.Int) (*types.Transaction, error) { return _VibeTokenFactory.Contract.QuoteExactBaseForVibeToken(&_VibeTokenFactory.TransactOpts, VibeToken, amountBase) } // QuoteExactETHForVibeToken is a paid mutator transaction binding the contract method 0x9274a2ab. // // Solidity: function quoteExactETHForVibeToken(address VibeToken, uint256 amountETH) returns(uint256 amountOutVibeToken) func (_VibeTokenFactory *VibeTokenFactoryTransactor) QuoteExactETHForVibeToken(opts *bind.TransactOpts, VibeToken common.Address, amountETH *big.Int) (*types.Transaction, error) { return _VibeTokenFactory.contract.Transact(opts, "quoteExactETHForVibeToken", VibeToken, amountETH) } // QuoteExactETHForVibeToken is a paid mutator transaction binding the contract method 0x9274a2ab. // // Solidity: function quoteExactETHForVibeToken(address VibeToken, uint256 amountETH) returns(uint256 amountOutVibeToken) func (_VibeTokenFactory *VibeTokenFactorySession) QuoteExactETHForVibeToken(VibeToken common.Address, amountETH *big.Int) (*types.Transaction, error) { return _VibeTokenFactory.Contract.QuoteExactETHForVibeToken(&_VibeTokenFactory.TransactOpts, VibeToken, amountETH) } // QuoteExactETHForVibeToken is a paid mutator transaction binding the contract method 0x9274a2ab. // // Solidity: function quoteExactETHForVibeToken(address VibeToken, uint256 amountETH) returns(uint256 amountOutVibeToken) func (_VibeTokenFactory *VibeTokenFactoryTransactorSession) QuoteExactETHForVibeToken(VibeToken common.Address, amountETH *big.Int) (*types.Transaction, error) { return _VibeTokenFactory.Contract.QuoteExactETHForVibeToken(&_VibeTokenFactory.TransactOpts, VibeToken, amountETH) } // QuoteExactVibeTokenForBase is a paid mutator transaction binding the contract method 0xbeb1ad64. // // Solidity: function quoteExactVibeTokenForBase(address VibeToken, uint256 amountVibeToken) returns(uint256 amountOutBase) func (_VibeTokenFactory *VibeTokenFactoryTransactor) QuoteExactVibeTokenForBase(opts *bind.TransactOpts, VibeToken common.Address, amountVibeToken *big.Int) (*types.Transaction, error) { return _VibeTokenFactory.contract.Transact(opts, "quoteExactVibeTokenForBase", VibeToken, amountVibeToken) } // QuoteExactVibeTokenForBase is a paid mutator transaction binding the contract method 0xbeb1ad64. // // Solidity: function quoteExactVibeTokenForBase(address VibeToken, uint256 amountVibeToken) returns(uint256 amountOutBase) func (_VibeTokenFactory *VibeTokenFactorySession) QuoteExactVibeTokenForBase(VibeToken common.Address, amountVibeToken *big.Int) (*types.Transaction, error) { return _VibeTokenFactory.Contract.QuoteExactVibeTokenForBase(&_VibeTokenFactory.TransactOpts, VibeToken, amountVibeToken) } // QuoteExactVibeTokenForBase is a paid mutator transaction binding the contract method 0xbeb1ad64. // // Solidity: function quoteExactVibeTokenForBase(address VibeToken, uint256 amountVibeToken) returns(uint256 amountOutBase) func (_VibeTokenFactory *VibeTokenFactoryTransactorSession) QuoteExactVibeTokenForBase(VibeToken common.Address, amountVibeToken *big.Int) (*types.Transaction, error) { return _VibeTokenFactory.Contract.QuoteExactVibeTokenForBase(&_VibeTokenFactory.TransactOpts, VibeToken, amountVibeToken) } // QuoteExactVibeTokenForETH is a paid mutator transaction binding the contract method 0xf1a25fb0. // // Solidity: function quoteExactVibeTokenForETH(address VibeToken, uint256 amountVibeToken) returns(uint256 amountOutETH) func (_VibeTokenFactory *VibeTokenFactoryTransactor) QuoteExactVibeTokenForETH(opts *bind.TransactOpts, VibeToken common.Address, amountVibeToken *big.Int) (*types.Transaction, error) { return _VibeTokenFactory.contract.Transact(opts, "quoteExactVibeTokenForETH", VibeToken, amountVibeToken) } // QuoteExactVibeTokenForETH is a paid mutator transaction binding the contract method 0xf1a25fb0. // // Solidity: function quoteExactVibeTokenForETH(address VibeToken, uint256 amountVibeToken) returns(uint256 amountOutETH) func (_VibeTokenFactory *VibeTokenFactorySession) QuoteExactVibeTokenForETH(VibeToken common.Address, amountVibeToken *big.Int) (*types.Transaction, error) { return _VibeTokenFactory.Contract.QuoteExactVibeTokenForETH(&_VibeTokenFactory.TransactOpts, VibeToken, amountVibeToken) } // QuoteExactVibeTokenForETH is a paid mutator transaction binding the contract method 0xf1a25fb0. // // Solidity: function quoteExactVibeTokenForETH(address VibeToken, uint256 amountVibeToken) returns(uint256 amountOutETH) func (_VibeTokenFactory *VibeTokenFactoryTransactorSession) QuoteExactVibeTokenForETH(VibeToken common.Address, amountVibeToken *big.Int) (*types.Transaction, error) { return _VibeTokenFactory.Contract.QuoteExactVibeTokenForETH(&_VibeTokenFactory.TransactOpts, VibeToken, amountVibeToken) } // RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. // // Solidity: function renounceOwnership() returns() func (_VibeTokenFactory *VibeTokenFactoryTransactor) RenounceOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { return _VibeTokenFactory.contract.Transact(opts, "renounceOwnership") } // RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. // // Solidity: function renounceOwnership() returns() func (_VibeTokenFactory *VibeTokenFactorySession) RenounceOwnership() (*types.Transaction, error) { return _VibeTokenFactory.Contract.RenounceOwnership(&_VibeTokenFactory.TransactOpts) } // RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. // // Solidity: function renounceOwnership() returns() func (_VibeTokenFactory *VibeTokenFactoryTransactorSession) RenounceOwnership() (*types.Transaction, error) { return _VibeTokenFactory.Contract.RenounceOwnership(&_VibeTokenFactory.TransactOpts) } // SetAdmin is a paid mutator transaction binding the contract method 0x704b6c02. // // Solidity: function setAdmin(address _admin) returns() func (_VibeTokenFactory *VibeTokenFactoryTransactor) SetAdmin(opts *bind.TransactOpts, _admin common.Address) (*types.Transaction, error) { return _VibeTokenFactory.contract.Transact(opts, "setAdmin", _admin) } // SetAdmin is a paid mutator transaction binding the contract method 0x704b6c02. // // Solidity: function setAdmin(address _admin) returns() func (_VibeTokenFactory *VibeTokenFactorySession) SetAdmin(_admin common.Address) (*types.Transaction, error) { return _VibeTokenFactory.Contract.SetAdmin(&_VibeTokenFactory.TransactOpts, _admin) } // SetAdmin is a paid mutator transaction binding the contract method 0x704b6c02. // // Solidity: function setAdmin(address _admin) returns() func (_VibeTokenFactory *VibeTokenFactoryTransactorSession) SetAdmin(_admin common.Address) (*types.Transaction, error) { return _VibeTokenFactory.Contract.SetAdmin(&_VibeTokenFactory.TransactOpts, _admin) } // SetImplementation is a paid mutator transaction binding the contract method 0xd784d426. // // Solidity: function setImplementation(address _implementation) returns() func (_VibeTokenFactory *VibeTokenFactoryTransactor) SetImplementation(opts *bind.TransactOpts, _implementation common.Address) (*types.Transaction, error) { return _VibeTokenFactory.contract.Transact(opts, "setImplementation", _implementation) } // SetImplementation is a paid mutator transaction binding the contract method 0xd784d426. // // Solidity: function setImplementation(address _implementation) returns() func (_VibeTokenFactory *VibeTokenFactorySession) SetImplementation(_implementation common.Address) (*types.Transaction, error) { return _VibeTokenFactory.Contract.SetImplementation(&_VibeTokenFactory.TransactOpts, _implementation) } // SetImplementation is a paid mutator transaction binding the contract method 0xd784d426. // // Solidity: function setImplementation(address _implementation) returns() func (_VibeTokenFactory *VibeTokenFactoryTransactorSession) SetImplementation(_implementation common.Address) (*types.Transaction, error) { return _VibeTokenFactory.Contract.SetImplementation(&_VibeTokenFactory.TransactOpts, _implementation) } // SwapExactBaseForVibeToken is a paid mutator transaction binding the contract method 0x2a0da56a. // // Solidity: function swapExactBaseForVibeToken(address VibeToken, uint256 amountBase, uint256 amountVibeTokenMinimum, address recipient, uint256 deadline) payable returns(uint256 amountOutVibeToken) func (_VibeTokenFactory *VibeTokenFactoryTransactor) SwapExactBaseForVibeToken(opts *bind.TransactOpts, VibeToken common.Address, amountBase *big.Int, amountVibeTokenMinimum *big.Int, recipient common.Address, deadline *big.Int) (*types.Transaction, error) { return _VibeTokenFactory.contract.Transact(opts, "swapExactBaseForVibeToken", VibeToken, amountBase, amountVibeTokenMinimum, recipient, deadline) } // SwapExactBaseForVibeToken is a paid mutator transaction binding the contract method 0x2a0da56a. // // Solidity: function swapExactBaseForVibeToken(address VibeToken, uint256 amountBase, uint256 amountVibeTokenMinimum, address recipient, uint256 deadline) payable returns(uint256 amountOutVibeToken) func (_VibeTokenFactory *VibeTokenFactorySession) SwapExactBaseForVibeToken(VibeToken common.Address, amountBase *big.Int, amountVibeTokenMinimum *big.Int, recipient common.Address, deadline *big.Int) (*types.Transaction, error) { return _VibeTokenFactory.Contract.SwapExactBaseForVibeToken(&_VibeTokenFactory.TransactOpts, VibeToken, amountBase, amountVibeTokenMinimum, recipient, deadline) } // SwapExactBaseForVibeToken is a paid mutator transaction binding the contract method 0x2a0da56a. // // Solidity: function swapExactBaseForVibeToken(address VibeToken, uint256 amountBase, uint256 amountVibeTokenMinimum, address recipient, uint256 deadline) payable returns(uint256 amountOutVibeToken) func (_VibeTokenFactory *VibeTokenFactoryTransactorSession) SwapExactBaseForVibeToken(VibeToken common.Address, amountBase *big.Int, amountVibeTokenMinimum *big.Int, recipient common.Address, deadline *big.Int) (*types.Transaction, error) { return _VibeTokenFactory.Contract.SwapExactBaseForVibeToken(&_VibeTokenFactory.TransactOpts, VibeToken, amountBase, amountVibeTokenMinimum, recipient, deadline) } // SwapExactETHForVibeToken is a paid mutator transaction binding the contract method 0x9324f0e0. // // Solidity: function swapExactETHForVibeToken(address VibeToken, uint256 amountETH, uint256 amountVibeTokenMinimum, address recipient, uint256 deadline) payable returns(uint256 amountOutVibeToken) func (_VibeTokenFactory *VibeTokenFactoryTransactor) SwapExactETHForVibeToken(opts *bind.TransactOpts, VibeToken common.Address, amountETH *big.Int, amountVibeTokenMinimum *big.Int, recipient common.Address, deadline *big.Int) (*types.Transaction, error) { return _VibeTokenFactory.contract.Transact(opts, "swapExactETHForVibeToken", VibeToken, amountETH, amountVibeTokenMinimum, recipient, deadline) } // SwapExactETHForVibeToken is a paid mutator transaction binding the contract method 0x9324f0e0. // // Solidity: function swapExactETHForVibeToken(address VibeToken, uint256 amountETH, uint256 amountVibeTokenMinimum, address recipient, uint256 deadline) payable returns(uint256 amountOutVibeToken) func (_VibeTokenFactory *VibeTokenFactorySession) SwapExactETHForVibeToken(VibeToken common.Address, amountETH *big.Int, amountVibeTokenMinimum *big.Int, recipient common.Address, deadline *big.Int) (*types.Transaction, error) { return _VibeTokenFactory.Contract.SwapExactETHForVibeToken(&_VibeTokenFactory.TransactOpts, VibeToken, amountETH, amountVibeTokenMinimum, recipient, deadline) } // SwapExactETHForVibeToken is a paid mutator transaction binding the contract method 0x9324f0e0. // // Solidity: function swapExactETHForVibeToken(address VibeToken, uint256 amountETH, uint256 amountVibeTokenMinimum, address recipient, uint256 deadline) payable returns(uint256 amountOutVibeToken) func (_VibeTokenFactory *VibeTokenFactoryTransactorSession) SwapExactETHForVibeToken(VibeToken common.Address, amountETH *big.Int, amountVibeTokenMinimum *big.Int, recipient common.Address, deadline *big.Int) (*types.Transaction, error) { return _VibeTokenFactory.Contract.SwapExactETHForVibeToken(&_VibeTokenFactory.TransactOpts, VibeToken, amountETH, amountVibeTokenMinimum, recipient, deadline) } // SwapExactVibeTokenForBase is a paid mutator transaction binding the contract method 0xb0422bec. // // Solidity: function swapExactVibeTokenForBase(address VibeToken, uint256 amountVibeToken, uint256 amountBaseMinimum, address recipient, uint256 deadline) payable returns(uint256 amountOutBase) func (_VibeTokenFactory *VibeTokenFactoryTransactor) SwapExactVibeTokenForBase(opts *bind.TransactOpts, VibeToken common.Address, amountVibeToken *big.Int, amountBaseMinimum *big.Int, recipient common.Address, deadline *big.Int) (*types.Transaction, error) { return _VibeTokenFactory.contract.Transact(opts, "swapExactVibeTokenForBase", VibeToken, amountVibeToken, amountBaseMinimum, recipient, deadline) } // SwapExactVibeTokenForBase is a paid mutator transaction binding the contract method 0xb0422bec. // // Solidity: function swapExactVibeTokenForBase(address VibeToken, uint256 amountVibeToken, uint256 amountBaseMinimum, address recipient, uint256 deadline) payable returns(uint256 amountOutBase) func (_VibeTokenFactory *VibeTokenFactorySession) SwapExactVibeTokenForBase(VibeToken common.Address, amountVibeToken *big.Int, amountBaseMinimum *big.Int, recipient common.Address, deadline *big.Int) (*types.Transaction, error) { return _VibeTokenFactory.Contract.SwapExactVibeTokenForBase(&_VibeTokenFactory.TransactOpts, VibeToken, amountVibeToken, amountBaseMinimum, recipient, deadline) } // SwapExactVibeTokenForBase is a paid mutator transaction binding the contract method 0xb0422bec. // // Solidity: function swapExactVibeTokenForBase(address VibeToken, uint256 amountVibeToken, uint256 amountBaseMinimum, address recipient, uint256 deadline) payable returns(uint256 amountOutBase) func (_VibeTokenFactory *VibeTokenFactoryTransactorSession) SwapExactVibeTokenForBase(VibeToken common.Address, amountVibeToken *big.Int, amountBaseMinimum *big.Int, recipient common.Address, deadline *big.Int) (*types.Transaction, error) { return _VibeTokenFactory.Contract.SwapExactVibeTokenForBase(&_VibeTokenFactory.TransactOpts, VibeToken, amountVibeToken, amountBaseMinimum, recipient, deadline) } // SwapExactVibeTokenForETH is a paid mutator transaction binding the contract method 0xfe3cc33a. // // Solidity: function swapExactVibeTokenForETH(address VibeToken, uint256 amountVibeToken, uint256 amountETHMinimum, address recipient, uint256 deadline) payable returns(uint256 amountOutETH) func (_VibeTokenFactory *VibeTokenFactoryTransactor) SwapExactVibeTokenForETH(opts *bind.TransactOpts, VibeToken common.Address, amountVibeToken *big.Int, amountETHMinimum *big.Int, recipient common.Address, deadline *big.Int) (*types.Transaction, error) { return _VibeTokenFactory.contract.Transact(opts, "swapExactVibeTokenForETH", VibeToken, amountVibeToken, amountETHMinimum, recipient, deadline) } // SwapExactVibeTokenForETH is a paid mutator transaction binding the contract method 0xfe3cc33a. // // Solidity: function swapExactVibeTokenForETH(address VibeToken, uint256 amountVibeToken, uint256 amountETHMinimum, address recipient, uint256 deadline) payable returns(uint256 amountOutETH) func (_VibeTokenFactory *VibeTokenFactorySession) SwapExactVibeTokenForETH(VibeToken common.Address, amountVibeToken *big.Int, amountETHMinimum *big.Int, recipient common.Address, deadline *big.Int) (*types.Transaction, error) { return _VibeTokenFactory.Contract.SwapExactVibeTokenForETH(&_VibeTokenFactory.TransactOpts, VibeToken, amountVibeToken, amountETHMinimum, recipient, deadline) } // SwapExactVibeTokenForETH is a paid mutator transaction binding the contract method 0xfe3cc33a. // // Solidity: function swapExactVibeTokenForETH(address VibeToken, uint256 amountVibeToken, uint256 amountETHMinimum, address recipient, uint256 deadline) payable returns(uint256 amountOutETH) func (_VibeTokenFactory *VibeTokenFactoryTransactorSession) SwapExactVibeTokenForETH(VibeToken common.Address, amountVibeToken *big.Int, amountETHMinimum *big.Int, recipient common.Address, deadline *big.Int) (*types.Transaction, error) { return _VibeTokenFactory.Contract.SwapExactVibeTokenForETH(&_VibeTokenFactory.TransactOpts, VibeToken, amountVibeToken, amountETHMinimum, recipient, deadline) } // TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. // // Solidity: function transferOwnership(address newOwner) returns() func (_VibeTokenFactory *VibeTokenFactoryTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) { return _VibeTokenFactory.contract.Transact(opts, "transferOwnership", newOwner) } // TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. // // Solidity: function transferOwnership(address newOwner) returns() func (_VibeTokenFactory *VibeTokenFactorySession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { return _VibeTokenFactory.Contract.TransferOwnership(&_VibeTokenFactory.TransactOpts, newOwner) } // TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. // // Solidity: function transferOwnership(address newOwner) returns() func (_VibeTokenFactory *VibeTokenFactoryTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { return _VibeTokenFactory.Contract.TransferOwnership(&_VibeTokenFactory.TransactOpts, newOwner) } // VibeTokenFactoryAdminSetIterator is returned from FilterAdminSet and is used to iterate over the raw logs and unpacked data for AdminSet events raised by the VibeTokenFactory contract. type VibeTokenFactoryAdminSetIterator struct { Event *VibeTokenFactoryAdminSet // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *VibeTokenFactoryAdminSetIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(VibeTokenFactoryAdminSet) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(VibeTokenFactoryAdminSet) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *VibeTokenFactoryAdminSetIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *VibeTokenFactoryAdminSetIterator) Close() error { it.sub.Unsubscribe() return nil } // VibeTokenFactoryAdminSet represents a AdminSet event raised by the VibeTokenFactory contract. type VibeTokenFactoryAdminSet struct { Admin common.Address Raw types.Log // Blockchain specific contextual infos } // FilterAdminSet is a free log retrieval operation binding the contract event 0x8fe72c3e0020beb3234e76ae6676fa576fbfcae600af1c4fea44784cf0db329c. // // Solidity: event AdminSet(address indexed admin) func (_VibeTokenFactory *VibeTokenFactoryFilterer) FilterAdminSet(opts *bind.FilterOpts, admin []common.Address) (*VibeTokenFactoryAdminSetIterator, error) { var adminRule []interface{} for _, adminItem := range admin { adminRule = append(adminRule, adminItem) } logs, sub, err := _VibeTokenFactory.contract.FilterLogs(opts, "AdminSet", adminRule) if err != nil { return nil, err } return &VibeTokenFactoryAdminSetIterator{contract: _VibeTokenFactory.contract, event: "AdminSet", logs: logs, sub: sub}, nil } // WatchAdminSet is a free log subscription operation binding the contract event 0x8fe72c3e0020beb3234e76ae6676fa576fbfcae600af1c4fea44784cf0db329c. // // Solidity: event AdminSet(address indexed admin) func (_VibeTokenFactory *VibeTokenFactoryFilterer) WatchAdminSet(opts *bind.WatchOpts, sink chan<- *VibeTokenFactoryAdminSet, admin []common.Address) (event.Subscription, error) { var adminRule []interface{} for _, adminItem := range admin { adminRule = append(adminRule, adminItem) } logs, sub, err := _VibeTokenFactory.contract.WatchLogs(opts, "AdminSet", adminRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(VibeTokenFactoryAdminSet) if err := _VibeTokenFactory.contract.UnpackLog(event, "AdminSet", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseAdminSet is a log parse operation binding the contract event 0x8fe72c3e0020beb3234e76ae6676fa576fbfcae600af1c4fea44784cf0db329c. // // Solidity: event AdminSet(address indexed admin) func (_VibeTokenFactory *VibeTokenFactoryFilterer) ParseAdminSet(log types.Log) (*VibeTokenFactoryAdminSet, error) { event := new(VibeTokenFactoryAdminSet) if err := _VibeTokenFactory.contract.UnpackLog(event, "AdminSet", log); err != nil { return nil, err } event.Raw = log return event, nil } // VibeTokenFactoryFeesCollectedIterator is returned from FilterFeesCollected and is used to iterate over the raw logs and unpacked data for FeesCollected events raised by the VibeTokenFactory contract. type VibeTokenFactoryFeesCollectedIterator struct { Event *VibeTokenFactoryFeesCollected // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *VibeTokenFactoryFeesCollectedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(VibeTokenFactoryFeesCollected) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(VibeTokenFactoryFeesCollected) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *VibeTokenFactoryFeesCollectedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *VibeTokenFactoryFeesCollectedIterator) Close() error { it.sub.Unsubscribe() return nil } // VibeTokenFactoryFeesCollected represents a FeesCollected event raised by the VibeTokenFactory contract. type VibeTokenFactoryFeesCollected struct { Token common.Address PositionNftId *big.Int Recipient common.Address Amount0 *big.Int Amount1 *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterFeesCollected is a free log retrieval operation binding the contract event 0xa9aef66785858ba9f82e784db3e0dac4c23fb56b320d2cef3d4a0230d4c15e24. // // Solidity: event FeesCollected(address indexed token, uint256 indexed positionNftId, address recipient, uint256 amount0, uint256 amount1) func (_VibeTokenFactory *VibeTokenFactoryFilterer) FilterFeesCollected(opts *bind.FilterOpts, token []common.Address, positionNftId []*big.Int) (*VibeTokenFactoryFeesCollectedIterator, error) { var tokenRule []interface{} for _, tokenItem := range token { tokenRule = append(tokenRule, tokenItem) } var positionNftIdRule []interface{} for _, positionNftIdItem := range positionNftId { positionNftIdRule = append(positionNftIdRule, positionNftIdItem) } logs, sub, err := _VibeTokenFactory.contract.FilterLogs(opts, "FeesCollected", tokenRule, positionNftIdRule) if err != nil { return nil, err } return &VibeTokenFactoryFeesCollectedIterator{contract: _VibeTokenFactory.contract, event: "FeesCollected", logs: logs, sub: sub}, nil } // WatchFeesCollected is a free log subscription operation binding the contract event 0xa9aef66785858ba9f82e784db3e0dac4c23fb56b320d2cef3d4a0230d4c15e24. // // Solidity: event FeesCollected(address indexed token, uint256 indexed positionNftId, address recipient, uint256 amount0, uint256 amount1) func (_VibeTokenFactory *VibeTokenFactoryFilterer) WatchFeesCollected(opts *bind.WatchOpts, sink chan<- *VibeTokenFactoryFeesCollected, token []common.Address, positionNftId []*big.Int) (event.Subscription, error) { var tokenRule []interface{} for _, tokenItem := range token { tokenRule = append(tokenRule, tokenItem) } var positionNftIdRule []interface{} for _, positionNftIdItem := range positionNftId { positionNftIdRule = append(positionNftIdRule, positionNftIdItem) } logs, sub, err := _VibeTokenFactory.contract.WatchLogs(opts, "FeesCollected", tokenRule, positionNftIdRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(VibeTokenFactoryFeesCollected) if err := _VibeTokenFactory.contract.UnpackLog(event, "FeesCollected", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseFeesCollected is a log parse operation binding the contract event 0xa9aef66785858ba9f82e784db3e0dac4c23fb56b320d2cef3d4a0230d4c15e24. // // Solidity: event FeesCollected(address indexed token, uint256 indexed positionNftId, address recipient, uint256 amount0, uint256 amount1) func (_VibeTokenFactory *VibeTokenFactoryFilterer) ParseFeesCollected(log types.Log) (*VibeTokenFactoryFeesCollected, error) { event := new(VibeTokenFactoryFeesCollected) if err := _VibeTokenFactory.contract.UnpackLog(event, "FeesCollected", log); err != nil { return nil, err } event.Raw = log return event, nil } // VibeTokenFactoryImplementationSetIterator is returned from FilterImplementationSet and is used to iterate over the raw logs and unpacked data for ImplementationSet events raised by the VibeTokenFactory contract. type VibeTokenFactoryImplementationSetIterator struct { Event *VibeTokenFactoryImplementationSet // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *VibeTokenFactoryImplementationSetIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(VibeTokenFactoryImplementationSet) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(VibeTokenFactoryImplementationSet) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *VibeTokenFactoryImplementationSetIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *VibeTokenFactoryImplementationSetIterator) Close() error { it.sub.Unsubscribe() return nil } // VibeTokenFactoryImplementationSet represents a ImplementationSet event raised by the VibeTokenFactory contract. type VibeTokenFactoryImplementationSet struct { Implementation common.Address Raw types.Log // Blockchain specific contextual infos } // FilterImplementationSet is a free log retrieval operation binding the contract event 0xab64f92ab780ecbf4f3866f57cee465ff36c89450dcce20237ca7a8d81fb7d13. // // Solidity: event ImplementationSet(address indexed implementation) func (_VibeTokenFactory *VibeTokenFactoryFilterer) FilterImplementationSet(opts *bind.FilterOpts, implementation []common.Address) (*VibeTokenFactoryImplementationSetIterator, error) { var implementationRule []interface{} for _, implementationItem := range implementation { implementationRule = append(implementationRule, implementationItem) } logs, sub, err := _VibeTokenFactory.contract.FilterLogs(opts, "ImplementationSet", implementationRule) if err != nil { return nil, err } return &VibeTokenFactoryImplementationSetIterator{contract: _VibeTokenFactory.contract, event: "ImplementationSet", logs: logs, sub: sub}, nil } // WatchImplementationSet is a free log subscription operation binding the contract event 0xab64f92ab780ecbf4f3866f57cee465ff36c89450dcce20237ca7a8d81fb7d13. // // Solidity: event ImplementationSet(address indexed implementation) func (_VibeTokenFactory *VibeTokenFactoryFilterer) WatchImplementationSet(opts *bind.WatchOpts, sink chan<- *VibeTokenFactoryImplementationSet, implementation []common.Address) (event.Subscription, error) { var implementationRule []interface{} for _, implementationItem := range implementation { implementationRule = append(implementationRule, implementationItem) } logs, sub, err := _VibeTokenFactory.contract.WatchLogs(opts, "ImplementationSet", implementationRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(VibeTokenFactoryImplementationSet) if err := _VibeTokenFactory.contract.UnpackLog(event, "ImplementationSet", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseImplementationSet is a log parse operation binding the contract event 0xab64f92ab780ecbf4f3866f57cee465ff36c89450dcce20237ca7a8d81fb7d13. // // Solidity: event ImplementationSet(address indexed implementation) func (_VibeTokenFactory *VibeTokenFactoryFilterer) ParseImplementationSet(log types.Log) (*VibeTokenFactoryImplementationSet, error) { event := new(VibeTokenFactoryImplementationSet) if err := _VibeTokenFactory.contract.UnpackLog(event, "ImplementationSet", log); err != nil { return nil, err } event.Raw = log return event, nil } // VibeTokenFactoryInitializedIterator is returned from FilterInitialized and is used to iterate over the raw logs and unpacked data for Initialized events raised by the VibeTokenFactory contract. type VibeTokenFactoryInitializedIterator struct { Event *VibeTokenFactoryInitialized // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *VibeTokenFactoryInitializedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(VibeTokenFactoryInitialized) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(VibeTokenFactoryInitialized) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *VibeTokenFactoryInitializedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *VibeTokenFactoryInitializedIterator) Close() error { it.sub.Unsubscribe() return nil } // VibeTokenFactoryInitialized represents a Initialized event raised by the VibeTokenFactory contract. type VibeTokenFactoryInitialized struct { Version uint8 Raw types.Log // Blockchain specific contextual infos } // FilterInitialized is a free log retrieval operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. // // Solidity: event Initialized(uint8 version) func (_VibeTokenFactory *VibeTokenFactoryFilterer) FilterInitialized(opts *bind.FilterOpts) (*VibeTokenFactoryInitializedIterator, error) { logs, sub, err := _VibeTokenFactory.contract.FilterLogs(opts, "Initialized") if err != nil { return nil, err } return &VibeTokenFactoryInitializedIterator{contract: _VibeTokenFactory.contract, event: "Initialized", logs: logs, sub: sub}, nil } // WatchInitialized is a free log subscription operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. // // Solidity: event Initialized(uint8 version) func (_VibeTokenFactory *VibeTokenFactoryFilterer) WatchInitialized(opts *bind.WatchOpts, sink chan<- *VibeTokenFactoryInitialized) (event.Subscription, error) { logs, sub, err := _VibeTokenFactory.contract.WatchLogs(opts, "Initialized") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(VibeTokenFactoryInitialized) if err := _VibeTokenFactory.contract.UnpackLog(event, "Initialized", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseInitialized is a log parse operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. // // Solidity: event Initialized(uint8 version) func (_VibeTokenFactory *VibeTokenFactoryFilterer) ParseInitialized(log types.Log) (*VibeTokenFactoryInitialized, error) { event := new(VibeTokenFactoryInitialized) if err := _VibeTokenFactory.contract.UnpackLog(event, "Initialized", log); err != nil { return nil, err } event.Raw = log return event, nil } // VibeTokenFactoryOwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the VibeTokenFactory contract. type VibeTokenFactoryOwnershipTransferredIterator struct { Event *VibeTokenFactoryOwnershipTransferred // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *VibeTokenFactoryOwnershipTransferredIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(VibeTokenFactoryOwnershipTransferred) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(VibeTokenFactoryOwnershipTransferred) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *VibeTokenFactoryOwnershipTransferredIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *VibeTokenFactoryOwnershipTransferredIterator) Close() error { it.sub.Unsubscribe() return nil } // VibeTokenFactoryOwnershipTransferred represents a OwnershipTransferred event raised by the VibeTokenFactory contract. type VibeTokenFactoryOwnershipTransferred struct { PreviousOwner common.Address NewOwner common.Address Raw types.Log // Blockchain specific contextual infos } // FilterOwnershipTransferred is a free log retrieval operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. // // Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) func (_VibeTokenFactory *VibeTokenFactoryFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*VibeTokenFactoryOwnershipTransferredIterator, error) { var previousOwnerRule []interface{} for _, previousOwnerItem := range previousOwner { previousOwnerRule = append(previousOwnerRule, previousOwnerItem) } var newOwnerRule []interface{} for _, newOwnerItem := range newOwner { newOwnerRule = append(newOwnerRule, newOwnerItem) } logs, sub, err := _VibeTokenFactory.contract.FilterLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) if err != nil { return nil, err } return &VibeTokenFactoryOwnershipTransferredIterator{contract: _VibeTokenFactory.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil } // WatchOwnershipTransferred is a free log subscription operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. // // Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) func (_VibeTokenFactory *VibeTokenFactoryFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *VibeTokenFactoryOwnershipTransferred, previousOwner []common.Address, newOwner []common.Address) (event.Subscription, error) { var previousOwnerRule []interface{} for _, previousOwnerItem := range previousOwner { previousOwnerRule = append(previousOwnerRule, previousOwnerItem) } var newOwnerRule []interface{} for _, newOwnerItem := range newOwner { newOwnerRule = append(newOwnerRule, newOwnerItem) } logs, sub, err := _VibeTokenFactory.contract.WatchLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(VibeTokenFactoryOwnershipTransferred) if err := _VibeTokenFactory.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseOwnershipTransferred is a log parse operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. // // Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) func (_VibeTokenFactory *VibeTokenFactoryFilterer) ParseOwnershipTransferred(log types.Log) (*VibeTokenFactoryOwnershipTransferred, error) { event := new(VibeTokenFactoryOwnershipTransferred) if err := _VibeTokenFactory.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { return nil, err } event.Raw = log return event, nil } // VibeTokenFactoryTokenDeployedIterator is returned from FilterTokenDeployed and is used to iterate over the raw logs and unpacked data for TokenDeployed events raised by the VibeTokenFactory contract. type VibeTokenFactoryTokenDeployedIterator struct { Event *VibeTokenFactoryTokenDeployed // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *VibeTokenFactoryTokenDeployedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(VibeTokenFactoryTokenDeployed) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(VibeTokenFactoryTokenDeployed) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *VibeTokenFactoryTokenDeployedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *VibeTokenFactoryTokenDeployedIterator) Close() error { it.sub.Unsubscribe() return nil } // VibeTokenFactoryTokenDeployed represents a TokenDeployed event raised by the VibeTokenFactory contract. type VibeTokenFactoryTokenDeployed struct { Nonce [32]byte Token common.Address Pool common.Address PositionNftId *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterTokenDeployed is a free log retrieval operation binding the contract event 0x035044c956f0f85240e40898163f0636d588d72de5fd08d79a9168d626745173. // // Solidity: event TokenDeployed(bytes32 indexed nonce, address indexed token, address pool, uint256 positionNftId) func (_VibeTokenFactory *VibeTokenFactoryFilterer) FilterTokenDeployed(opts *bind.FilterOpts, nonce [][32]byte, token []common.Address) (*VibeTokenFactoryTokenDeployedIterator, error) { var nonceRule []interface{} for _, nonceItem := range nonce { nonceRule = append(nonceRule, nonceItem) } var tokenRule []interface{} for _, tokenItem := range token { tokenRule = append(tokenRule, tokenItem) } logs, sub, err := _VibeTokenFactory.contract.FilterLogs(opts, "TokenDeployed", nonceRule, tokenRule) if err != nil { return nil, err } return &VibeTokenFactoryTokenDeployedIterator{contract: _VibeTokenFactory.contract, event: "TokenDeployed", logs: logs, sub: sub}, nil } // WatchTokenDeployed is a free log subscription operation binding the contract event 0x035044c956f0f85240e40898163f0636d588d72de5fd08d79a9168d626745173. // // Solidity: event TokenDeployed(bytes32 indexed nonce, address indexed token, address pool, uint256 positionNftId) func (_VibeTokenFactory *VibeTokenFactoryFilterer) WatchTokenDeployed(opts *bind.WatchOpts, sink chan<- *VibeTokenFactoryTokenDeployed, nonce [][32]byte, token []common.Address) (event.Subscription, error) { var nonceRule []interface{} for _, nonceItem := range nonce { nonceRule = append(nonceRule, nonceItem) } var tokenRule []interface{} for _, tokenItem := range token { tokenRule = append(tokenRule, tokenItem) } logs, sub, err := _VibeTokenFactory.contract.WatchLogs(opts, "TokenDeployed", nonceRule, tokenRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(VibeTokenFactoryTokenDeployed) if err := _VibeTokenFactory.contract.UnpackLog(event, "TokenDeployed", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseTokenDeployed is a log parse operation binding the contract event 0x035044c956f0f85240e40898163f0636d588d72de5fd08d79a9168d626745173. // // Solidity: event TokenDeployed(bytes32 indexed nonce, address indexed token, address pool, uint256 positionNftId) func (_VibeTokenFactory *VibeTokenFactoryFilterer) ParseTokenDeployed(log types.Log) (*VibeTokenFactoryTokenDeployed, error) { event := new(VibeTokenFactoryTokenDeployed) if err := _VibeTokenFactory.contract.UnpackLog(event, "TokenDeployed", log); err != nil { return nil, err } event.Raw = log return event, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/binds/wbvm/WBVM.go ================================================ // Code generated - DO NOT EDIT. // This file is a generated binding and any manual changes will be lost. package wbvm import ( "errors" "math/big" "strings" ethereum "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/event" ) // Reference imports to suppress errors if they are not otherwise used. var ( _ = errors.New _ = big.NewInt _ = strings.NewReader _ = ethereum.NotFound _ = bind.Bind _ = common.Big1 _ = types.BloomLookup _ = event.NewSubscription _ = abi.ConvertType ) // WBVMMetaData contains all meta data concerning the WBVM contract. var WBVMMetaData = &bind.MetaData{ ABI: "[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"src\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"guy\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"wad\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"dst\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"wad\",\"type\":\"uint256\"}],\"name\":\"Deposit\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"src\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"dst\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"wad\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"src\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"wad\",\"type\":\"uint256\"}],\"name\":\"Withdrawal\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"guy\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"wad\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"deposit\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"dst\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"wad\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"src\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"dst\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"wad\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"wad\",\"type\":\"uint256\"}],\"name\":\"withdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]", Bin: "0x0002000000000002000200000000000200000000030100190000006003300270000000df0330019700010000003103550000008004000039000000400040043f0000000100200190000000300000c13d000000040030008c000000670000413d000000000201043b000000e002200270000000e40020009c0000006c0000a13d000000e50020009c0000009a0000213d000000e90020009c0000016b0000613d000000ea0020009c000001280000613d000000eb0020009c000002260000c13d0000000001000416000000000001004b000002260000c13d0000000103000039000000000203041a000000010520019000000001012002700000007f0410018f00000000010460190000001f0010008c00000000060000190000000106002039000000000662013f0000000100600190000000610000c13d000000800010043f000000000005004b000001af0000c13d0000010001200197000000a00010043f000000000004004b000000c001000039000000a001006039000001bf0000013d0000000001000416000000000001004b000002260000c13d000000000100041a000000010210019000000001031002700000007f0330618f0000001f0030008c00000000010000190000000101002039000000000012004b000000610000c13d000000200030008c000000540000413d000200000003001d00000000000004350000000001000414000000df0010009c000000df01008041000000c001100210000000e0011001c70000801002000039037703720000040f0000000100200190000002260000613d000000000101043b00000002020000290000001f0220003900000005022002700000000002210019000000000021004b000000540000813d000000000001041b0000000101100039000000000021004b000000500000413d000000e101000041000000000010041b0000000103000039000000000103041a000000010010019000000001041002700000007f0440618f0000001f0040008c00000000020000190000000102002039000000000121013f0000000100100190000000ba0000613d000000f90100004100000000001004350000002201000039000000040010043f000000fa010000410000037900010430000000000003004b000002260000c13d037702550000040f0000000001000019000003780001042e000000ec0020009c000000df0000a13d000000ed0020009c0000013b0000613d000000ee0020009c000001430000613d000000ef0020009c000002260000c13d000000240030008c000002260000413d0000000002000416000000000002004b000002260000c13d0000000401100370000000000101043b000200000001001d000000000100041100000000001004350000000301000039000000200010043f0000000001000414000000df0010009c000000df01008041000000c001100210000000f6011001c70000801002000039037703720000040f0000000100200190000002260000613d000000000101043b000000000101041a000000020010006c000001890000813d000000400100043d000000fc02000041000000000021043500000004021000390000002003000039000000000032043500000024021000390000000000020435000000df0010009c000000df010080410000004001100210000000fd011001c70000037900010430000000e60020009c000001740000613d000000e70020009c000000690000613d000000e80020009c000002260000c13d000000440030008c000002260000413d0000000002000416000000000002004b000002260000c13d0000000402100370000000000202043b000000f20020009c000002260000213d0000002401100370000000000101043b000000f20010009c000002260000213d0000000000200435000200000001001d0000000401000039000000200010043f00000040020000390000000001000019037703490000040f00000002020000290000000000200435000000200010043f00000000010000190000004002000039000001360000013d0000001f0040008c000000d30000a13d000200000004001d00000000003004350000000001000414000000df0010009c000000df01008041000000c001100210000000e0011001c70000801002000039037703720000040f0000000100200190000002260000613d000000000101043b00000002020000290000001f0220003900000005022002700000000002210019000000000021004b0000000103000039000000d30000813d000000000001041b0000000101100039000000000021004b000000cf0000413d000000e201000041000000000013041b0000000201000039000000000201041a000001000220019700000012022001bf000000000021041b000000200100003900000100001004430000012000000443000000e301000041000003780001042e000000f00020009c000001540000613d000000f10020009c000002260000c13d000000440030008c000002260000413d0000000002000416000000000002004b000002260000c13d0000000402100370000000000202043b000200000002001d000000f20020009c000002260000213d0000002401100370000000000101043b000100000001001d000000000100041100000000001004350000000401000039000000200010043f0000000001000414000000df0010009c000000df01008041000000c001100210000000f6011001c70000801002000039037703720000040f0000000100200190000002260000613d000000000101043b00000002020000290000000000200435000000200010043f0000000001000414000000df0010009c000000df01008041000000c001100210000000f6011001c70000801002000039037703720000040f0000000100200190000002260000613d000000000101043b0000000102000029000000000021041b000000400100043d0000000000210435000000df0010009c000000df0100804100000040011002100000000002000414000000df0020009c000000df02008041000000c002200210000000000112019f000000e0011001c70000800d020000390000000303000039000000fe04000041000000000500041100000002060000290377036d0000040f0000000100200190000002260000613d000000400100043d00000001020000390000000000210435000000df0010009c000000df010080410000004001100210000000f4011001c7000003780001042e000000240030008c000002260000413d0000000002000416000000000002004b000002260000c13d0000000401100370000000000101043b000000f20010009c000002260000213d00000000001004350000000301000039000000200010043f00000040020000390000000001000019037703490000040f000000000101041a000000800010043f000000f301000041000003780001042e0000000001000416000000000001004b000002260000c13d00000000010004100377035e0000040f000000800010043f000000f301000041000003780001042e000000640030008c000002260000413d0000000002000416000000000002004b000002260000c13d0000000402100370000000000402043b000000f20040009c000002260000213d0000002402100370000000000202043b000000f20020009c000002260000213d0000004401100370000000000301043b0000000001040019000001800000013d0000000001000416000000000001004b000002260000c13d000000000200041a000000010420019000000001012002700000007f0310018f00000000010360190000001f0010008c00000000050000190000000105002039000000000552013f0000000100500190000000610000c13d000000800010043f000000000004004b000001a10000c13d0000010001200197000000a00010043f000000000003004b000000c001000039000000a001006039000001bf0000013d0000000001000416000000000001004b000002260000c13d0000000201000039000000000101041a000000ff0110018f000000800010043f000000f301000041000003780001042e000000440030008c000002260000413d0000000002000416000000000002004b000002260000c13d0000000402100370000000000202043b000000f20020009c000002260000213d0000002401100370000000000301043b0000000001000411037702840000040f0000000101000039000000400200043d0000000000120435000000df0020009c000000df020080410000004001200210000000f4011001c7000003780001042e000000000100041100000000001004350000000301000039000000200010043f0000000001000414000000df0010009c000000df01008041000000c001100210000000f6011001c70000801002000039037703720000040f0000000100200190000002260000613d000000000101043b000000000201041a0000000203000029000000000232004b000001d00000813d000000f90100004100000000001004350000001101000039000000040010043f000000fa0100004100000379000104300000000000000435000000020020008c000001b20000413d000000ff0200004100000000040000190000000003040019000000000402041a000000a005300039000000000045043500000001022000390000002004300039000000000014004b000001a60000413d000001be0000013d0000000000300435000000020020008c000001b40000813d000000a001000039000001bf0000013d000000f50200004100000000040000190000000003040019000000000402041a000000a005300039000000000045043500000001022000390000002004300039000000000014004b000001b60000413d000000c001300039000000800210008a00000080010000390377022e0000040f000000400100043d000200000001001d0000008002000039037702400000040f00000002020000290000000001210049000000df0010009c000000df010080410000006001100210000000df0020009c000000df020080410000004002200210000000000121019f000003780001042e000000000021041b00000000010004140000000002000411000000040020008c000001d70000c13d0000000002000031000001e70000013d000000df0010009c000000df01008041000000c001100210000000000003004b000001e00000613d000000f7011001c70000800902000039000000000400041100000000050000190377036d0000040f000000020300002900000000020100190000006002200270000000df0020019d000000df022001970001000000010355000000000002004b000002120000613d0000001f0120003900000101011001970000003f011000390000010101100197000000400500043d0000000001150019000000000051004b00000000040000190000000104004039000000f80010009c000002280000213d0000000100400190000002280000c13d000000400010043f0000001f0120018f0000000009250436000000010400036700000005022002720000000502200210000002040000613d0000000005290019000000000604034f0000000007090019000000006806043c0000000007870436000000000057004b000002000000c13d000000000001004b000002120000613d000000000424034f00000000022900190000000301100210000000000502043300000000051501cf000000000515022f000000000404043b0000010001100089000000000414022f00000000011401cf000000000151019f0000000000120435000000400100043d0000000000310435000000df0010009c000000df0100804100000040011002100000000002000414000000df0020009c000000df02008041000000c002200210000000000112019f000000e0011001c70000800d020000390000000203000039000000fb0400004100000000050004110377036d0000040f0000000100200190000002260000613d0000000001000019000003780001042e00000000010000190000037900010430000000f90100004100000000001004350000004101000039000000040010043f000000fa0100004100000379000104300000001f0220003900000101022001970000000001120019000000000021004b00000000020000190000000102004039000000f80010009c0000023a0000213d00000001002001900000023a0000c13d000000400010043f000000000001042d000000f90100004100000000001004350000004101000039000000040010043f000000fa01000041000003790001043000000020030000390000000004310436000000003202043400000000002404350000004001100039000000000002004b0000024f0000613d000000000400001900000000054100190000000006430019000000000606043300000000006504350000002004400039000000000024004b000002480000413d000000000321001900000000000304350000001f0220003900000101022001970000000001210019000000000001042d000000000100041100000000001004350000000301000039000000200010043f0000000001000414000000df0010009c000000df01008041000000c001100210000000f6011001c70000801002000039037703720000040f00000001002001900000027c0000613d000000000101043b000000000301041a0000000002000416000000000023001a0000027e0000413d0000000003230019000000000031041b000000400100043d0000000000210435000000df0010009c000000df0100804100000040011002100000000002000414000000df0020009c000000df02008041000000c002200210000000000112019f000000e0011001c70000800d020000390000000203000039000001020400004100000000050004110377036d0000040f00000001002001900000027c0000613d000000000001042d00000000010000190000037900010430000000f90100004100000000001004350000001101000039000000040010043f000000fa0100004100000379000104300003000000000002000300000003001d000100000002001d000000f201100197000200000001001d00000000001004350000000301000039000000200010043f0000000001000414000000df0010009c000000df01008041000000c001100210000000f6011001c70000801002000039037703720000040f0000000100200190000003330000613d000000000101043b000000000101041a000000030010006c000003350000413d00000000020004110000000201000029000000000021004b000002f80000613d00000000001004350000000401000039000000200010043f0000000001000414000000df0010009c000000df01008041000000c001100210000000f6011001c70000801002000039037703720000040f0000000100200190000003330000613d000000000101043b00000000020004110000000000200435000000200010043f0000000001000414000000df0010009c000000df01008041000000c001100210000000f6011001c70000801002000039037703720000040f0000000100200190000003330000613d000000000101043b000000000101041a000001040010009c0000000201000029000002f80000613d00000000001004350000000401000039000000200010043f0000000001000414000000df0010009c000000df01008041000000c001100210000000f6011001c70000801002000039037703720000040f0000000100200190000003330000613d000000000101043b00000000020004110000000000200435000000200010043f0000000001000414000000df0010009c000000df01008041000000c001100210000000f6011001c70000801002000039037703720000040f0000000100200190000003330000613d000000000101043b000000000101041a000000030010006c000003350000413d000000020100002900000000001004350000000401000039000000200010043f0000000001000414000000df0010009c000000df01008041000000c001100210000000f6011001c70000801002000039037703720000040f0000000100200190000003330000613d000000000101043b00000000020004110000000000200435000000200010043f0000000001000414000000df0010009c000000df01008041000000c001100210000000f6011001c70000801002000039037703720000040f0000000100200190000003330000613d000000000101043b000000000201041a000000030220006c000003420000413d000000000021041b000000020100002900000000001004350000000301000039000000200010043f0000000001000414000000df0010009c000000df01008041000000c001100210000000f6011001c70000801002000039037703720000040f0000000100200190000003330000613d000000000101043b000000000201041a000000030220006c000003420000413d000000000021041b0000000101000029000000f201100197000100000001001d00000000001004350000000301000039000000200010043f0000000001000414000000df0010009c000000df01008041000000c001100210000000f6011001c70000801002000039037703720000040f0000000100200190000003330000613d000000000101043b000000000201041a0000000303000029000000000032001a000003420000413d0000000002320019000000000021041b000000400100043d0000000000310435000000df0010009c000000df0100804100000040011002100000000002000414000000df0020009c000000df02008041000000c002200210000000000112019f000000e0011001c70000800d0200003900000003030000390000010304000041000000020500002900000001060000290377036d0000040f0000000100200190000003330000613d000000000001042d00000000010000190000037900010430000000400100043d000000fc02000041000000000021043500000004021000390000002003000039000000000032043500000024021000390000000000020435000000df0010009c000000df010080410000004001100210000000fd011001c70000037900010430000000f90100004100000000001004350000001101000039000000040010043f000000fa010000410000037900010430000000000001042f000000df0010009c000000df010080410000004001100210000000df0020009c000000df020080410000006002200210000000000112019f0000000002000414000000df0020009c000000df02008041000000c002200210000000000112019f000000f7011001c70000801002000039037703720000040f00000001002001900000035c0000613d000000000101043b000000000001042d000000000100001900000379000104300000010502000041000000000020043900000004001004430000000001000414000000df0010009c000000df01008041000000c00110021000000106011001c70000800a02000039037703720000040f00000001002001900000036c0000613d000000000101043b000000000001042d000000000001042f00000370002104210000000102000039000000000001042d0000000002000019000000000001042d00000375002104230000000102000039000000000001042d0000000002000019000000000001042d0000037700000432000003780001042e00000379000104300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffff0200000000000000000000000000000000000020000000000000000000000000577261707065642042564d0000000000000000000000000000000000000000165742564d00000000000000000000000000000000000000000000000000000008000000020000000000000000000000000000004000000100000000000000000000000000000000000000000000000000000000000000000000000000313ce56600000000000000000000000000000000000000000000000000000000a9059cba00000000000000000000000000000000000000000000000000000000a9059cbb00000000000000000000000000000000000000000000000000000000d0e30db000000000000000000000000000000000000000000000000000000000dd62ed3e00000000000000000000000000000000000000000000000000000000313ce5670000000000000000000000000000000000000000000000000000000070a082310000000000000000000000000000000000000000000000000000000095d89b410000000000000000000000000000000000000000000000000000000018160ddc0000000000000000000000000000000000000000000000000000000018160ddd0000000000000000000000000000000000000000000000000000000023b872dd000000000000000000000000000000000000000000000000000000002e1a7d4d0000000000000000000000000000000000000000000000000000000006fdde0300000000000000000000000000000000000000000000000000000000095ea7b3000000000000000000000000ffffffffffffffffffffffffffffffffffffffff00000000000000000000000000000000000000200000008000000000000000000000000000000000000000000000000000000020000000000000000000000000b10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf602000000000000000000000000000000000000400000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffff4e487b710000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000240000000000000000000000007fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b6508c379a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000440000000000000000000000008c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e563ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0e1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109cddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9cc7f708afc65944829bd487b90b72536b1951864fbfc14e125fc972a6507f3902000002000000000000000000000000000000240000000000000000000000000000000000000000000000000000000000000000000000000000000000000000df38709dc40c99c8c317fcf754c75acd1d6005a5a0d105f2d796ae36da5c3ebf", } // WBVMABI is the input ABI used to generate the binding from. // Deprecated: Use WBVMMetaData.ABI instead. var WBVMABI = WBVMMetaData.ABI // WBVMBin is the compiled bytecode used for deploying new contracts. // Deprecated: Use WBVMMetaData.Bin instead. var WBVMBin = WBVMMetaData.Bin // DeployWBVM deploys a new Ethereum contract, binding an instance of WBVM to it. func DeployWBVM(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *WBVM, error) { parsed, err := WBVMMetaData.GetAbi() if err != nil { return common.Address{}, nil, nil, err } if parsed == nil { return common.Address{}, nil, nil, errors.New("GetABI returned nil") } address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(WBVMBin), backend) if err != nil { return common.Address{}, nil, nil, err } return address, tx, &WBVM{WBVMCaller: WBVMCaller{contract: contract}, WBVMTransactor: WBVMTransactor{contract: contract}, WBVMFilterer: WBVMFilterer{contract: contract}}, nil } // WBVM is an auto generated Go binding around an Ethereum contract. type WBVM struct { WBVMCaller // Read-only binding to the contract WBVMTransactor // Write-only binding to the contract WBVMFilterer // Log filterer for contract events } // WBVMCaller is an auto generated read-only Go binding around an Ethereum contract. type WBVMCaller struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // WBVMTransactor is an auto generated write-only Go binding around an Ethereum contract. type WBVMTransactor struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // WBVMFilterer is an auto generated log filtering Go binding around an Ethereum contract events. type WBVMFilterer struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // WBVMSession is an auto generated Go binding around an Ethereum contract, // with pre-set call and transact options. type WBVMSession struct { Contract *WBVM // Generic contract binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // WBVMCallerSession is an auto generated read-only Go binding around an Ethereum contract, // with pre-set call options. type WBVMCallerSession struct { Contract *WBVMCaller // Generic contract caller binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session } // WBVMTransactorSession is an auto generated write-only Go binding around an Ethereum contract, // with pre-set transact options. type WBVMTransactorSession struct { Contract *WBVMTransactor // Generic contract transactor binding to set the session for TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // WBVMRaw is an auto generated low-level Go binding around an Ethereum contract. type WBVMRaw struct { Contract *WBVM // Generic contract binding to access the raw methods on } // WBVMCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. type WBVMCallerRaw struct { Contract *WBVMCaller // Generic read-only contract binding to access the raw methods on } // WBVMTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. type WBVMTransactorRaw struct { Contract *WBVMTransactor // Generic write-only contract binding to access the raw methods on } // NewWBVM creates a new instance of WBVM, bound to a specific deployed contract. func NewWBVM(address common.Address, backend bind.ContractBackend) (*WBVM, error) { contract, err := bindWBVM(address, backend, backend, backend) if err != nil { return nil, err } return &WBVM{WBVMCaller: WBVMCaller{contract: contract}, WBVMTransactor: WBVMTransactor{contract: contract}, WBVMFilterer: WBVMFilterer{contract: contract}}, nil } // NewWBVMCaller creates a new read-only instance of WBVM, bound to a specific deployed contract. func NewWBVMCaller(address common.Address, caller bind.ContractCaller) (*WBVMCaller, error) { contract, err := bindWBVM(address, caller, nil, nil) if err != nil { return nil, err } return &WBVMCaller{contract: contract}, nil } // NewWBVMTransactor creates a new write-only instance of WBVM, bound to a specific deployed contract. func NewWBVMTransactor(address common.Address, transactor bind.ContractTransactor) (*WBVMTransactor, error) { contract, err := bindWBVM(address, nil, transactor, nil) if err != nil { return nil, err } return &WBVMTransactor{contract: contract}, nil } // NewWBVMFilterer creates a new log filterer instance of WBVM, bound to a specific deployed contract. func NewWBVMFilterer(address common.Address, filterer bind.ContractFilterer) (*WBVMFilterer, error) { contract, err := bindWBVM(address, nil, nil, filterer) if err != nil { return nil, err } return &WBVMFilterer{contract: contract}, nil } // bindWBVM binds a generic wrapper to an already deployed contract. func bindWBVM(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { parsed, err := WBVMMetaData.GetAbi() if err != nil { return nil, err } return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_WBVM *WBVMRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _WBVM.Contract.WBVMCaller.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_WBVM *WBVMRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _WBVM.Contract.WBVMTransactor.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_WBVM *WBVMRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _WBVM.Contract.WBVMTransactor.contract.Transact(opts, method, params...) } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_WBVM *WBVMCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _WBVM.Contract.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_WBVM *WBVMTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _WBVM.Contract.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_WBVM *WBVMTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _WBVM.Contract.contract.Transact(opts, method, params...) } // Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. // // Solidity: function allowance(address , address ) view returns(uint256) func (_WBVM *WBVMCaller) Allowance(opts *bind.CallOpts, arg0 common.Address, arg1 common.Address) (*big.Int, error) { var out []interface{} err := _WBVM.contract.Call(opts, &out, "allowance", arg0, arg1) if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. // // Solidity: function allowance(address , address ) view returns(uint256) func (_WBVM *WBVMSession) Allowance(arg0 common.Address, arg1 common.Address) (*big.Int, error) { return _WBVM.Contract.Allowance(&_WBVM.CallOpts, arg0, arg1) } // Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. // // Solidity: function allowance(address , address ) view returns(uint256) func (_WBVM *WBVMCallerSession) Allowance(arg0 common.Address, arg1 common.Address) (*big.Int, error) { return _WBVM.Contract.Allowance(&_WBVM.CallOpts, arg0, arg1) } // BalanceOf is a free data retrieval call binding the contract method 0x70a08231. // // Solidity: function balanceOf(address ) view returns(uint256) func (_WBVM *WBVMCaller) BalanceOf(opts *bind.CallOpts, arg0 common.Address) (*big.Int, error) { var out []interface{} err := _WBVM.contract.Call(opts, &out, "balanceOf", arg0) if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // BalanceOf is a free data retrieval call binding the contract method 0x70a08231. // // Solidity: function balanceOf(address ) view returns(uint256) func (_WBVM *WBVMSession) BalanceOf(arg0 common.Address) (*big.Int, error) { return _WBVM.Contract.BalanceOf(&_WBVM.CallOpts, arg0) } // BalanceOf is a free data retrieval call binding the contract method 0x70a08231. // // Solidity: function balanceOf(address ) view returns(uint256) func (_WBVM *WBVMCallerSession) BalanceOf(arg0 common.Address) (*big.Int, error) { return _WBVM.Contract.BalanceOf(&_WBVM.CallOpts, arg0) } // Decimals is a free data retrieval call binding the contract method 0x313ce567. // // Solidity: function decimals() view returns(uint8) func (_WBVM *WBVMCaller) Decimals(opts *bind.CallOpts) (uint8, error) { var out []interface{} err := _WBVM.contract.Call(opts, &out, "decimals") if err != nil { return *new(uint8), err } out0 := *abi.ConvertType(out[0], new(uint8)).(*uint8) return out0, err } // Decimals is a free data retrieval call binding the contract method 0x313ce567. // // Solidity: function decimals() view returns(uint8) func (_WBVM *WBVMSession) Decimals() (uint8, error) { return _WBVM.Contract.Decimals(&_WBVM.CallOpts) } // Decimals is a free data retrieval call binding the contract method 0x313ce567. // // Solidity: function decimals() view returns(uint8) func (_WBVM *WBVMCallerSession) Decimals() (uint8, error) { return _WBVM.Contract.Decimals(&_WBVM.CallOpts) } // Name is a free data retrieval call binding the contract method 0x06fdde03. // // Solidity: function name() view returns(string) func (_WBVM *WBVMCaller) Name(opts *bind.CallOpts) (string, error) { var out []interface{} err := _WBVM.contract.Call(opts, &out, "name") if err != nil { return *new(string), err } out0 := *abi.ConvertType(out[0], new(string)).(*string) return out0, err } // Name is a free data retrieval call binding the contract method 0x06fdde03. // // Solidity: function name() view returns(string) func (_WBVM *WBVMSession) Name() (string, error) { return _WBVM.Contract.Name(&_WBVM.CallOpts) } // Name is a free data retrieval call binding the contract method 0x06fdde03. // // Solidity: function name() view returns(string) func (_WBVM *WBVMCallerSession) Name() (string, error) { return _WBVM.Contract.Name(&_WBVM.CallOpts) } // Symbol is a free data retrieval call binding the contract method 0x95d89b41. // // Solidity: function symbol() view returns(string) func (_WBVM *WBVMCaller) Symbol(opts *bind.CallOpts) (string, error) { var out []interface{} err := _WBVM.contract.Call(opts, &out, "symbol") if err != nil { return *new(string), err } out0 := *abi.ConvertType(out[0], new(string)).(*string) return out0, err } // Symbol is a free data retrieval call binding the contract method 0x95d89b41. // // Solidity: function symbol() view returns(string) func (_WBVM *WBVMSession) Symbol() (string, error) { return _WBVM.Contract.Symbol(&_WBVM.CallOpts) } // Symbol is a free data retrieval call binding the contract method 0x95d89b41. // // Solidity: function symbol() view returns(string) func (_WBVM *WBVMCallerSession) Symbol() (string, error) { return _WBVM.Contract.Symbol(&_WBVM.CallOpts) } // TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. // // Solidity: function totalSupply() view returns(uint256) func (_WBVM *WBVMCaller) TotalSupply(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} err := _WBVM.contract.Call(opts, &out, "totalSupply") if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. // // Solidity: function totalSupply() view returns(uint256) func (_WBVM *WBVMSession) TotalSupply() (*big.Int, error) { return _WBVM.Contract.TotalSupply(&_WBVM.CallOpts) } // TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. // // Solidity: function totalSupply() view returns(uint256) func (_WBVM *WBVMCallerSession) TotalSupply() (*big.Int, error) { return _WBVM.Contract.TotalSupply(&_WBVM.CallOpts) } // Approve is a paid mutator transaction binding the contract method 0x095ea7b3. // // Solidity: function approve(address guy, uint256 wad) returns(bool) func (_WBVM *WBVMTransactor) Approve(opts *bind.TransactOpts, guy common.Address, wad *big.Int) (*types.Transaction, error) { return _WBVM.contract.Transact(opts, "approve", guy, wad) } // Approve is a paid mutator transaction binding the contract method 0x095ea7b3. // // Solidity: function approve(address guy, uint256 wad) returns(bool) func (_WBVM *WBVMSession) Approve(guy common.Address, wad *big.Int) (*types.Transaction, error) { return _WBVM.Contract.Approve(&_WBVM.TransactOpts, guy, wad) } // Approve is a paid mutator transaction binding the contract method 0x095ea7b3. // // Solidity: function approve(address guy, uint256 wad) returns(bool) func (_WBVM *WBVMTransactorSession) Approve(guy common.Address, wad *big.Int) (*types.Transaction, error) { return _WBVM.Contract.Approve(&_WBVM.TransactOpts, guy, wad) } // Deposit is a paid mutator transaction binding the contract method 0xd0e30db0. // // Solidity: function deposit() payable returns() func (_WBVM *WBVMTransactor) Deposit(opts *bind.TransactOpts) (*types.Transaction, error) { return _WBVM.contract.Transact(opts, "deposit") } // Deposit is a paid mutator transaction binding the contract method 0xd0e30db0. // // Solidity: function deposit() payable returns() func (_WBVM *WBVMSession) Deposit() (*types.Transaction, error) { return _WBVM.Contract.Deposit(&_WBVM.TransactOpts) } // Deposit is a paid mutator transaction binding the contract method 0xd0e30db0. // // Solidity: function deposit() payable returns() func (_WBVM *WBVMTransactorSession) Deposit() (*types.Transaction, error) { return _WBVM.Contract.Deposit(&_WBVM.TransactOpts) } // Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. // // Solidity: function transfer(address dst, uint256 wad) returns(bool) func (_WBVM *WBVMTransactor) Transfer(opts *bind.TransactOpts, dst common.Address, wad *big.Int) (*types.Transaction, error) { return _WBVM.contract.Transact(opts, "transfer", dst, wad) } // Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. // // Solidity: function transfer(address dst, uint256 wad) returns(bool) func (_WBVM *WBVMSession) Transfer(dst common.Address, wad *big.Int) (*types.Transaction, error) { return _WBVM.Contract.Transfer(&_WBVM.TransactOpts, dst, wad) } // Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. // // Solidity: function transfer(address dst, uint256 wad) returns(bool) func (_WBVM *WBVMTransactorSession) Transfer(dst common.Address, wad *big.Int) (*types.Transaction, error) { return _WBVM.Contract.Transfer(&_WBVM.TransactOpts, dst, wad) } // TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. // // Solidity: function transferFrom(address src, address dst, uint256 wad) returns(bool) func (_WBVM *WBVMTransactor) TransferFrom(opts *bind.TransactOpts, src common.Address, dst common.Address, wad *big.Int) (*types.Transaction, error) { return _WBVM.contract.Transact(opts, "transferFrom", src, dst, wad) } // TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. // // Solidity: function transferFrom(address src, address dst, uint256 wad) returns(bool) func (_WBVM *WBVMSession) TransferFrom(src common.Address, dst common.Address, wad *big.Int) (*types.Transaction, error) { return _WBVM.Contract.TransferFrom(&_WBVM.TransactOpts, src, dst, wad) } // TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. // // Solidity: function transferFrom(address src, address dst, uint256 wad) returns(bool) func (_WBVM *WBVMTransactorSession) TransferFrom(src common.Address, dst common.Address, wad *big.Int) (*types.Transaction, error) { return _WBVM.Contract.TransferFrom(&_WBVM.TransactOpts, src, dst, wad) } // Withdraw is a paid mutator transaction binding the contract method 0x2e1a7d4d. // // Solidity: function withdraw(uint256 wad) returns() func (_WBVM *WBVMTransactor) Withdraw(opts *bind.TransactOpts, wad *big.Int) (*types.Transaction, error) { return _WBVM.contract.Transact(opts, "withdraw", wad) } // Withdraw is a paid mutator transaction binding the contract method 0x2e1a7d4d. // // Solidity: function withdraw(uint256 wad) returns() func (_WBVM *WBVMSession) Withdraw(wad *big.Int) (*types.Transaction, error) { return _WBVM.Contract.Withdraw(&_WBVM.TransactOpts, wad) } // Withdraw is a paid mutator transaction binding the contract method 0x2e1a7d4d. // // Solidity: function withdraw(uint256 wad) returns() func (_WBVM *WBVMTransactorSession) Withdraw(wad *big.Int) (*types.Transaction, error) { return _WBVM.Contract.Withdraw(&_WBVM.TransactOpts, wad) } // Receive is a paid mutator transaction binding the contract receive function. // // Solidity: receive() payable returns() func (_WBVM *WBVMTransactor) Receive(opts *bind.TransactOpts) (*types.Transaction, error) { return _WBVM.contract.RawTransact(opts, nil) // calldata is disallowed for receive function } // Receive is a paid mutator transaction binding the contract receive function. // // Solidity: receive() payable returns() func (_WBVM *WBVMSession) Receive() (*types.Transaction, error) { return _WBVM.Contract.Receive(&_WBVM.TransactOpts) } // Receive is a paid mutator transaction binding the contract receive function. // // Solidity: receive() payable returns() func (_WBVM *WBVMTransactorSession) Receive() (*types.Transaction, error) { return _WBVM.Contract.Receive(&_WBVM.TransactOpts) } // WBVMApprovalIterator is returned from FilterApproval and is used to iterate over the raw logs and unpacked data for Approval events raised by the WBVM contract. type WBVMApprovalIterator struct { Event *WBVMApproval // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *WBVMApprovalIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(WBVMApproval) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(WBVMApproval) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *WBVMApprovalIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *WBVMApprovalIterator) Close() error { it.sub.Unsubscribe() return nil } // WBVMApproval represents a Approval event raised by the WBVM contract. type WBVMApproval struct { Src common.Address Guy common.Address Wad *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterApproval is a free log retrieval operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. // // Solidity: event Approval(address indexed src, address indexed guy, uint256 wad) func (_WBVM *WBVMFilterer) FilterApproval(opts *bind.FilterOpts, src []common.Address, guy []common.Address) (*WBVMApprovalIterator, error) { var srcRule []interface{} for _, srcItem := range src { srcRule = append(srcRule, srcItem) } var guyRule []interface{} for _, guyItem := range guy { guyRule = append(guyRule, guyItem) } logs, sub, err := _WBVM.contract.FilterLogs(opts, "Approval", srcRule, guyRule) if err != nil { return nil, err } return &WBVMApprovalIterator{contract: _WBVM.contract, event: "Approval", logs: logs, sub: sub}, nil } // WatchApproval is a free log subscription operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. // // Solidity: event Approval(address indexed src, address indexed guy, uint256 wad) func (_WBVM *WBVMFilterer) WatchApproval(opts *bind.WatchOpts, sink chan<- *WBVMApproval, src []common.Address, guy []common.Address) (event.Subscription, error) { var srcRule []interface{} for _, srcItem := range src { srcRule = append(srcRule, srcItem) } var guyRule []interface{} for _, guyItem := range guy { guyRule = append(guyRule, guyItem) } logs, sub, err := _WBVM.contract.WatchLogs(opts, "Approval", srcRule, guyRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(WBVMApproval) if err := _WBVM.contract.UnpackLog(event, "Approval", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseApproval is a log parse operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. // // Solidity: event Approval(address indexed src, address indexed guy, uint256 wad) func (_WBVM *WBVMFilterer) ParseApproval(log types.Log) (*WBVMApproval, error) { event := new(WBVMApproval) if err := _WBVM.contract.UnpackLog(event, "Approval", log); err != nil { return nil, err } event.Raw = log return event, nil } // WBVMDepositIterator is returned from FilterDeposit and is used to iterate over the raw logs and unpacked data for Deposit events raised by the WBVM contract. type WBVMDepositIterator struct { Event *WBVMDeposit // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *WBVMDepositIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(WBVMDeposit) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(WBVMDeposit) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *WBVMDepositIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *WBVMDepositIterator) Close() error { it.sub.Unsubscribe() return nil } // WBVMDeposit represents a Deposit event raised by the WBVM contract. type WBVMDeposit struct { Dst common.Address Wad *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterDeposit is a free log retrieval operation binding the contract event 0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c. // // Solidity: event Deposit(address indexed dst, uint256 wad) func (_WBVM *WBVMFilterer) FilterDeposit(opts *bind.FilterOpts, dst []common.Address) (*WBVMDepositIterator, error) { var dstRule []interface{} for _, dstItem := range dst { dstRule = append(dstRule, dstItem) } logs, sub, err := _WBVM.contract.FilterLogs(opts, "Deposit", dstRule) if err != nil { return nil, err } return &WBVMDepositIterator{contract: _WBVM.contract, event: "Deposit", logs: logs, sub: sub}, nil } // WatchDeposit is a free log subscription operation binding the contract event 0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c. // // Solidity: event Deposit(address indexed dst, uint256 wad) func (_WBVM *WBVMFilterer) WatchDeposit(opts *bind.WatchOpts, sink chan<- *WBVMDeposit, dst []common.Address) (event.Subscription, error) { var dstRule []interface{} for _, dstItem := range dst { dstRule = append(dstRule, dstItem) } logs, sub, err := _WBVM.contract.WatchLogs(opts, "Deposit", dstRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(WBVMDeposit) if err := _WBVM.contract.UnpackLog(event, "Deposit", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseDeposit is a log parse operation binding the contract event 0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c. // // Solidity: event Deposit(address indexed dst, uint256 wad) func (_WBVM *WBVMFilterer) ParseDeposit(log types.Log) (*WBVMDeposit, error) { event := new(WBVMDeposit) if err := _WBVM.contract.UnpackLog(event, "Deposit", log); err != nil { return nil, err } event.Raw = log return event, nil } // WBVMTransferIterator is returned from FilterTransfer and is used to iterate over the raw logs and unpacked data for Transfer events raised by the WBVM contract. type WBVMTransferIterator struct { Event *WBVMTransfer // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *WBVMTransferIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(WBVMTransfer) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(WBVMTransfer) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *WBVMTransferIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *WBVMTransferIterator) Close() error { it.sub.Unsubscribe() return nil } // WBVMTransfer represents a Transfer event raised by the WBVM contract. type WBVMTransfer struct { Src common.Address Dst common.Address Wad *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterTransfer is a free log retrieval operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. // // Solidity: event Transfer(address indexed src, address indexed dst, uint256 wad) func (_WBVM *WBVMFilterer) FilterTransfer(opts *bind.FilterOpts, src []common.Address, dst []common.Address) (*WBVMTransferIterator, error) { var srcRule []interface{} for _, srcItem := range src { srcRule = append(srcRule, srcItem) } var dstRule []interface{} for _, dstItem := range dst { dstRule = append(dstRule, dstItem) } logs, sub, err := _WBVM.contract.FilterLogs(opts, "Transfer", srcRule, dstRule) if err != nil { return nil, err } return &WBVMTransferIterator{contract: _WBVM.contract, event: "Transfer", logs: logs, sub: sub}, nil } // WatchTransfer is a free log subscription operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. // // Solidity: event Transfer(address indexed src, address indexed dst, uint256 wad) func (_WBVM *WBVMFilterer) WatchTransfer(opts *bind.WatchOpts, sink chan<- *WBVMTransfer, src []common.Address, dst []common.Address) (event.Subscription, error) { var srcRule []interface{} for _, srcItem := range src { srcRule = append(srcRule, srcItem) } var dstRule []interface{} for _, dstItem := range dst { dstRule = append(dstRule, dstItem) } logs, sub, err := _WBVM.contract.WatchLogs(opts, "Transfer", srcRule, dstRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(WBVMTransfer) if err := _WBVM.contract.UnpackLog(event, "Transfer", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseTransfer is a log parse operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. // // Solidity: event Transfer(address indexed src, address indexed dst, uint256 wad) func (_WBVM *WBVMFilterer) ParseTransfer(log types.Log) (*WBVMTransfer, error) { event := new(WBVMTransfer) if err := _WBVM.contract.UnpackLog(event, "Transfer", log); err != nil { return nil, err } event.Raw = log return event, nil } // WBVMWithdrawalIterator is returned from FilterWithdrawal and is used to iterate over the raw logs and unpacked data for Withdrawal events raised by the WBVM contract. type WBVMWithdrawalIterator struct { Event *WBVMWithdrawal // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *WBVMWithdrawalIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(WBVMWithdrawal) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(WBVMWithdrawal) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *WBVMWithdrawalIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *WBVMWithdrawalIterator) Close() error { it.sub.Unsubscribe() return nil } // WBVMWithdrawal represents a Withdrawal event raised by the WBVM contract. type WBVMWithdrawal struct { Src common.Address Wad *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterWithdrawal is a free log retrieval operation binding the contract event 0x7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65. // // Solidity: event Withdrawal(address indexed src, uint256 wad) func (_WBVM *WBVMFilterer) FilterWithdrawal(opts *bind.FilterOpts, src []common.Address) (*WBVMWithdrawalIterator, error) { var srcRule []interface{} for _, srcItem := range src { srcRule = append(srcRule, srcItem) } logs, sub, err := _WBVM.contract.FilterLogs(opts, "Withdrawal", srcRule) if err != nil { return nil, err } return &WBVMWithdrawalIterator{contract: _WBVM.contract, event: "Withdrawal", logs: logs, sub: sub}, nil } // WatchWithdrawal is a free log subscription operation binding the contract event 0x7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65. // // Solidity: event Withdrawal(address indexed src, uint256 wad) func (_WBVM *WBVMFilterer) WatchWithdrawal(opts *bind.WatchOpts, sink chan<- *WBVMWithdrawal, src []common.Address) (event.Subscription, error) { var srcRule []interface{} for _, srcItem := range src { srcRule = append(srcRule, srcItem) } logs, sub, err := _WBVM.contract.WatchLogs(opts, "Withdrawal", srcRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(WBVMWithdrawal) if err := _WBVM.contract.UnpackLog(event, "Withdrawal", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseWithdrawal is a log parse operation binding the contract event 0x7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65. // // Solidity: event Withdrawal(address indexed src, uint256 wad) func (_WBVM *WBVMFilterer) ParseWithdrawal(log types.Log) (*WBVMWithdrawal, error) { event := new(WBVMWithdrawal) if err := _WBVM.contract.UnpackLog(event, "Withdrawal", log); err != nil { return nil, err } event.Raw = log return event, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/binds/workerhub/workerhub.go ================================================ package workerhub import ( "errors" "math/big" "strings" ethereum "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/event" ) // Reference imports to suppress errors if they are not otherwise used. var ( _ = errors.New _ = big.NewInt _ = strings.NewReader _ = ethereum.NotFound _ = bind.Bind _ = common.Big1 _ = types.BloomLookup _ = event.NewSubscription _ = abi.ConvertType ) // IWorkerHubAssignmentInfo is an auto generated low-level Go binding around an user-defined struct. type IWorkerHubAssignmentInfo struct { AssignmentId *big.Int InferenceId *big.Int Value *big.Int Input []byte ModelAddress common.Address Creator common.Address ExpiredAt *big.Int } // IWorkerHubInferenceInfo is an auto generated low-level Go binding around an user-defined struct. type IWorkerHubInferenceInfo struct { InferenceId *big.Int Input []byte Output []byte Value *big.Int DisputingAddress common.Address ModelAddress common.Address ExpiredAt *big.Int Status uint8 Creator common.Address } // IWorkerHubWorkerInfo is an auto generated low-level Go binding around an user-defined struct. type IWorkerHubWorkerInfo struct { WorkerAddress common.Address Stake *big.Int Commitment *big.Int ModelAddress common.Address LastClaimedEpoch *big.Int ActiveTime *big.Int Tier uint16 } // WorkerHubMetaData contains all meta data concerning the WorkerHub contract. var WorkerHubMetaData = &bind.MetaData{ ABI: "[{\"type\":\"receive\",\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"assignmentNumber\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"assignments\",\"inputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"inferenceId\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"output\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"worker\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"disapprovalCount\",\"type\":\"uint8\",\"internalType\":\"uint8\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"blocksPerEpoch\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"claimReward\",\"inputs\":[{\"name\":\"_miner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"currentEpoch\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint40\",\"internalType\":\"uint40\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"disputeInfer\",\"inputs\":[{\"name\":\"_assignmentId\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"disputingTimeLimit\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint40\",\"internalType\":\"uint40\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"disqualificationPercentage\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint16\",\"internalType\":\"uint16\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"feePercentage\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint16\",\"internalType\":\"uint16\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"finePercentage\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint16\",\"internalType\":\"uint16\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getInferences\",\"inputs\":[{\"name\":\"_inferenceIds\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple[]\",\"internalType\":\"structIWorkerHub.InferenceInfo[]\",\"components\":[{\"name\":\"inferenceId\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"input\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"output\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"value\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"disputingAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"modelAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"expiredAt\",\"type\":\"uint40\",\"internalType\":\"uint40\"},{\"name\":\"status\",\"type\":\"uint8\",\"internalType\":\"enumIWorkerHub.InferenceStatus\"},{\"name\":\"creator\",\"type\":\"address\",\"internalType\":\"address\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getMinerAddresses\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address[]\",\"internalType\":\"address[]\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getMinerAddressesOfModel\",\"inputs\":[{\"name\":\"_model\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address[]\",\"internalType\":\"address[]\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getMiners\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"tuple[]\",\"internalType\":\"structIWorkerHub.WorkerInfo[]\",\"components\":[{\"name\":\"workerAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"stake\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"commitment\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"modelAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"lastClaimedEpoch\",\"type\":\"uint40\",\"internalType\":\"uint40\"},{\"name\":\"activeTime\",\"type\":\"uint40\",\"internalType\":\"uint40\"},{\"name\":\"tier\",\"type\":\"uint16\",\"internalType\":\"uint16\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getMiningAssignments\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"tuple[]\",\"internalType\":\"structIWorkerHub.AssignmentInfo[]\",\"components\":[{\"name\":\"assignmentId\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"inferenceId\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"value\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"input\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"modelAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"creator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"expiredAt\",\"type\":\"uint40\",\"internalType\":\"uint40\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getMintingAssignmentsOfInference\",\"inputs\":[{\"name\":\"_inferenceId\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple[]\",\"internalType\":\"structIWorkerHub.AssignmentInfo[]\",\"components\":[{\"name\":\"assignmentId\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"inferenceId\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"value\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"input\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"modelAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"creator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"expiredAt\",\"type\":\"uint40\",\"internalType\":\"uint40\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getModelAddresses\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address[]\",\"internalType\":\"address[]\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getNOMiner\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getValidatorAddresses\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address[]\",\"internalType\":\"address[]\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getValidatorAddressesOfModel\",\"inputs\":[{\"name\":\"_model\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address[]\",\"internalType\":\"address[]\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getValidators\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"tuple[]\",\"internalType\":\"structIWorkerHub.WorkerInfo[]\",\"components\":[{\"name\":\"workerAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"stake\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"commitment\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"modelAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"lastClaimedEpoch\",\"type\":\"uint40\",\"internalType\":\"uint40\"},{\"name\":\"activeTime\",\"type\":\"uint40\",\"internalType\":\"uint40\"},{\"name\":\"tier\",\"type\":\"uint16\",\"internalType\":\"uint16\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"increaseMinerStake\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"increaseValidatorStake\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"infer\",\"inputs\":[{\"name\":\"_input\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"_creator\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"inferenceNumber\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"initialize\",\"inputs\":[{\"name\":\"_treasury\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_feePercentage\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"_minerMinimumStake\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_validatorMinimumStake\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_miningTimeLimit\",\"type\":\"uint40\",\"internalType\":\"uint40\"},{\"name\":\"_minerRequirement\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"_blocksPerEpoch\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_rewardPerEpochBasedOnPerf\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_rewardPerEpoch\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_unstakeDelayTime\",\"type\":\"uint40\",\"internalType\":\"uint40\"},{\"name\":\"_penaltyDuration\",\"type\":\"uint40\",\"internalType\":\"uint40\"},{\"name\":\"_finePercentage\",\"type\":\"uint16\",\"internalType\":\"uint16\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"isAssignmentPending\",\"inputs\":[{\"name\":\"_assignmentId\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"joinForMinting\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"joinForValidating\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"lastBlock\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"maximumTier\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint16\",\"internalType\":\"uint16\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"minerMinimumStake\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"minerRequirement\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint8\",\"internalType\":\"uint8\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"minerUnstakeRequests\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"stake\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"unlockAt\",\"type\":\"uint40\",\"internalType\":\"uint40\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"miners\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"stake\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"commitment\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"modelAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"lastClaimedEpoch\",\"type\":\"uint40\",\"internalType\":\"uint40\"},{\"name\":\"activeTime\",\"type\":\"uint40\",\"internalType\":\"uint40\"},{\"name\":\"tier\",\"type\":\"uint16\",\"internalType\":\"uint16\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"miningTimeLimit\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint40\",\"internalType\":\"uint40\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"models\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"minimumFee\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"tier\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"multiplier\",\"inputs\":[{\"name\":\"_miner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"owner\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"pause\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"paused\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"penaltyDuration\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint40\",\"internalType\":\"uint40\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"registerMiner\",\"inputs\":[{\"name\":\"tier\",\"type\":\"uint16\",\"internalType\":\"uint16\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"registerModel\",\"inputs\":[{\"name\":\"_model\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_tier\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"_minimumFee\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"registerValidator\",\"inputs\":[{\"name\":\"tier\",\"type\":\"uint16\",\"internalType\":\"uint16\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"renounceOwnership\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"resolveInference\",\"inputs\":[{\"name\":\"_inferenceId\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"restakeForMiner\",\"inputs\":[{\"name\":\"tier\",\"type\":\"uint16\",\"internalType\":\"uint16\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"rewardInEpoch\",\"inputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"perfReward\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"epochReward\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"totalTaskCompleted\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"totalMiner\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"rewardPerEpoch\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"rewardToClaim\",\"inputs\":[{\"name\":\"_miner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setBlocksPerEpoch\",\"inputs\":[{\"name\":\"_blocks\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setFinePercentage\",\"inputs\":[{\"name\":\"_finePercentage\",\"type\":\"uint16\",\"internalType\":\"uint16\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setNewRewardInEpoch\",\"inputs\":[{\"name\":\"_newRewardAmount\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setPenaltyDuration\",\"inputs\":[{\"name\":\"_penaltyDuration\",\"type\":\"uint40\",\"internalType\":\"uint40\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setUnstakDelayTime\",\"inputs\":[{\"name\":\"_newUnstakeDelayTime\",\"type\":\"uint40\",\"internalType\":\"uint40\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"slashMiner\",\"inputs\":[{\"name\":\"_miner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_isFined\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"submitSolution\",\"inputs\":[{\"name\":\"_assigmentId\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_data\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"topUpInfer\",\"inputs\":[{\"name\":\"_inferenceId\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"transferOwnership\",\"inputs\":[{\"name\":\"newOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"treasury\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"unpause\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"unregisterMiner\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"unregisterModel\",\"inputs\":[{\"name\":\"_model\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"unregisterValidator\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"unstakeDelayTime\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint40\",\"internalType\":\"uint40\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"unstakeForMiner\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"unstakeForValidator\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"updateMiningTimeLimit\",\"inputs\":[{\"name\":\"_miningTimeLimit\",\"type\":\"uint40\",\"internalType\":\"uint40\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"updateModelMinimumFee\",\"inputs\":[{\"name\":\"_model\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_minimumFee\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"updateModelTier\",\"inputs\":[{\"name\":\"_model\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_tier\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"validatingTimeLimit\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint40\",\"internalType\":\"uint40\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"validatorDisputed\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"validatorMinimumStake\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"validatorUnstakeRequests\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"stake\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"unlockAt\",\"type\":\"uint40\",\"internalType\":\"uint40\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"validators\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"stake\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"commitment\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"modelAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"lastClaimedEpoch\",\"type\":\"uint40\",\"internalType\":\"uint40\"},{\"name\":\"activeTime\",\"type\":\"uint40\",\"internalType\":\"uint40\"},{\"name\":\"tier\",\"type\":\"uint16\",\"internalType\":\"uint16\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"version\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"pure\"},{\"type\":\"event\",\"name\":\"BlocksPerEpoch\",\"inputs\":[{\"name\":\"oldBlocks\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"newBlocks\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"FinePercentageUpdated\",\"inputs\":[{\"name\":\"oldPercent\",\"type\":\"uint16\",\"indexed\":false,\"internalType\":\"uint16\"},{\"name\":\"newPercent\",\"type\":\"uint16\",\"indexed\":false,\"internalType\":\"uint16\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"FraudulentMinerPenalized\",\"inputs\":[{\"name\":\"miner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"modelAddress\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"treasury\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"fine\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"InferenceDisputation\",\"inputs\":[{\"name\":\"validator\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"assigmentId\",\"type\":\"uint256\",\"indexed\":true,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"InferenceStatusUpdate\",\"inputs\":[{\"name\":\"inferenceId\",\"type\":\"uint256\",\"indexed\":true,\"internalType\":\"uint256\"},{\"name\":\"newStatus\",\"type\":\"uint8\",\"indexed\":false,\"internalType\":\"enumIWorkerHub.InferenceStatus\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Initialized\",\"inputs\":[{\"name\":\"version\",\"type\":\"uint8\",\"indexed\":false,\"internalType\":\"uint8\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"MinerDeactivated\",\"inputs\":[{\"name\":\"miner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"modelAddress\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"activeTime\",\"type\":\"uint40\",\"indexed\":false,\"internalType\":\"uint40\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"MinerExtraStake\",\"inputs\":[{\"name\":\"miner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"value\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"MinerJoin\",\"inputs\":[{\"name\":\"miner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"MinerRegistration\",\"inputs\":[{\"name\":\"miner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"tier\",\"type\":\"uint16\",\"indexed\":true,\"internalType\":\"uint16\"},{\"name\":\"value\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"MinerUnregistration\",\"inputs\":[{\"name\":\"miner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"MinerUnstake\",\"inputs\":[{\"name\":\"miner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"stake\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"MiningTimeLimitUpdate\",\"inputs\":[{\"name\":\"newValue\",\"type\":\"uint40\",\"indexed\":false,\"internalType\":\"uint40\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ModelMinimumFeeUpdate\",\"inputs\":[{\"name\":\"model\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"minimumFee\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ModelRegistration\",\"inputs\":[{\"name\":\"model\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"tier\",\"type\":\"uint16\",\"indexed\":true,\"internalType\":\"uint16\"},{\"name\":\"minimumFee\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ModelTierUpdate\",\"inputs\":[{\"name\":\"model\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"tier\",\"type\":\"uint32\",\"indexed\":false,\"internalType\":\"uint32\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ModelUnregistration\",\"inputs\":[{\"name\":\"model\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"NewAssignment\",\"inputs\":[{\"name\":\"assignmentId\",\"type\":\"uint256\",\"indexed\":true,\"internalType\":\"uint256\"},{\"name\":\"inferenceId\",\"type\":\"uint256\",\"indexed\":true,\"internalType\":\"uint256\"},{\"name\":\"miner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"expiredAt\",\"type\":\"uint40\",\"indexed\":false,\"internalType\":\"uint40\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"NewInference\",\"inputs\":[{\"name\":\"inferenceId\",\"type\":\"uint256\",\"indexed\":true,\"internalType\":\"uint256\"},{\"name\":\"model\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"creator\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"value\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OwnershipTransferred\",\"inputs\":[{\"name\":\"previousOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"newOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Paused\",\"inputs\":[{\"name\":\"account\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"PenaltyDurationUpdated\",\"inputs\":[{\"name\":\"oldDuration\",\"type\":\"uint40\",\"indexed\":false,\"internalType\":\"uint40\"},{\"name\":\"newDuration\",\"type\":\"uint40\",\"indexed\":false,\"internalType\":\"uint40\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Restake\",\"inputs\":[{\"name\":\"miner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"restake\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"model\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"RewardClaim\",\"inputs\":[{\"name\":\"worker\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"value\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"RewardPerEpoch\",\"inputs\":[{\"name\":\"oldReward\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"newReward\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"SolutionSubmission\",\"inputs\":[{\"name\":\"miner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"assigmentId\",\"type\":\"uint256\",\"indexed\":true,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"TopUpInfer\",\"inputs\":[{\"name\":\"inferenceId\",\"type\":\"uint256\",\"indexed\":true,\"internalType\":\"uint256\"},{\"name\":\"creator\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"value\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"TransferFee\",\"inputs\":[{\"name\":\"miner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"mingingFee\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"treasury\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"protocolFee\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Unpaused\",\"inputs\":[{\"name\":\"account\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"UnstakeDelayTime\",\"inputs\":[{\"name\":\"oldDelayTime\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"newDelayTime\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ValidatorExtraStake\",\"inputs\":[{\"name\":\"validator\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"value\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ValidatorJoin\",\"inputs\":[{\"name\":\"validator\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ValidatorRegistration\",\"inputs\":[{\"name\":\"validator\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"tier\",\"type\":\"uint16\",\"indexed\":true,\"internalType\":\"uint16\"},{\"name\":\"value\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ValidatorUnregistration\",\"inputs\":[{\"name\":\"validator\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ValidatorUnstake\",\"inputs\":[{\"name\":\"validator\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"stake\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"AddressSet_DuplicatedValue\",\"inputs\":[{\"name\":\"value\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"AddressSet_ValueNotFound\",\"inputs\":[{\"name\":\"value\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"AlreadyRegistered\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"AlreadySubmitted\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"FailedTransfer\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"FeeTooLow\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InferMustBeSolvingState\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidBlockValue\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidInferenceStatus\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidMiner\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidModel\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidTier\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidValidator\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"MinerInDeactivationTime\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"MiningSessionEnded\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"MiningSessionNotEnded\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NotEnoughMiners\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NotRegistered\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NullStake\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"StakeTooLow\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"StillBeingLocked\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"Uint256Set_DuplicatedValue\",\"inputs\":[{\"name\":\"value\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"type\":\"error\",\"name\":\"Unauthorized\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"ValidatingSessionNotEnded\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"ValidatorInDeactivationTime\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"ZeroValue\",\"inputs\":[]}]", } // WorkerHubABI is the input ABI used to generate the binding from. // Deprecated: Use WorkerHubMetaData.ABI instead. var WorkerHubABI = WorkerHubMetaData.ABI // WorkerHub is an auto generated Go binding around an Ethereum contract. type WorkerHub struct { WorkerHubCaller // Read-only binding to the contract WorkerHubTransactor // Write-only binding to the contract WorkerHubFilterer // Log filterer for contract events } // WorkerHubCaller is an auto generated read-only Go binding around an Ethereum contract. type WorkerHubCaller struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // WorkerHubTransactor is an auto generated write-only Go binding around an Ethereum contract. type WorkerHubTransactor struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // WorkerHubFilterer is an auto generated log filtering Go binding around an Ethereum contract events. type WorkerHubFilterer struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // WorkerHubSession is an auto generated Go binding around an Ethereum contract, // with pre-set call and transact options. type WorkerHubSession struct { Contract *WorkerHub // Generic contract binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // WorkerHubCallerSession is an auto generated read-only Go binding around an Ethereum contract, // with pre-set call options. type WorkerHubCallerSession struct { Contract *WorkerHubCaller // Generic contract caller binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session } // WorkerHubTransactorSession is an auto generated write-only Go binding around an Ethereum contract, // with pre-set transact options. type WorkerHubTransactorSession struct { Contract *WorkerHubTransactor // Generic contract transactor binding to set the session for TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // WorkerHubRaw is an auto generated low-level Go binding around an Ethereum contract. type WorkerHubRaw struct { Contract *WorkerHub // Generic contract binding to access the raw methods on } // WorkerHubCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. type WorkerHubCallerRaw struct { Contract *WorkerHubCaller // Generic read-only contract binding to access the raw methods on } // WorkerHubTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. type WorkerHubTransactorRaw struct { Contract *WorkerHubTransactor // Generic write-only contract binding to access the raw methods on } // NewWorkerHub creates a new instance of WorkerHub, bound to a specific deployed contract. func NewWorkerHub(address common.Address, backend bind.ContractBackend) (*WorkerHub, error) { contract, err := bindWorkerHub(address, backend, backend, backend) if err != nil { return nil, err } return &WorkerHub{WorkerHubCaller: WorkerHubCaller{contract: contract}, WorkerHubTransactor: WorkerHubTransactor{contract: contract}, WorkerHubFilterer: WorkerHubFilterer{contract: contract}}, nil } // NewWorkerHubCaller creates a new read-only instance of WorkerHub, bound to a specific deployed contract. func NewWorkerHubCaller(address common.Address, caller bind.ContractCaller) (*WorkerHubCaller, error) { contract, err := bindWorkerHub(address, caller, nil, nil) if err != nil { return nil, err } return &WorkerHubCaller{contract: contract}, nil } // NewWorkerHubTransactor creates a new write-only instance of WorkerHub, bound to a specific deployed contract. func NewWorkerHubTransactor(address common.Address, transactor bind.ContractTransactor) (*WorkerHubTransactor, error) { contract, err := bindWorkerHub(address, nil, transactor, nil) if err != nil { return nil, err } return &WorkerHubTransactor{contract: contract}, nil } // NewWorkerHubFilterer creates a new log filterer instance of WorkerHub, bound to a specific deployed contract. func NewWorkerHubFilterer(address common.Address, filterer bind.ContractFilterer) (*WorkerHubFilterer, error) { contract, err := bindWorkerHub(address, nil, nil, filterer) if err != nil { return nil, err } return &WorkerHubFilterer{contract: contract}, nil } // bindWorkerHub binds a generic wrapper to an already deployed contract. func bindWorkerHub(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { parsed, err := WorkerHubMetaData.GetAbi() if err != nil { return nil, err } return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_WorkerHub *WorkerHubRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _WorkerHub.Contract.WorkerHubCaller.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_WorkerHub *WorkerHubRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _WorkerHub.Contract.WorkerHubTransactor.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_WorkerHub *WorkerHubRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _WorkerHub.Contract.WorkerHubTransactor.contract.Transact(opts, method, params...) } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_WorkerHub *WorkerHubCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _WorkerHub.Contract.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_WorkerHub *WorkerHubTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _WorkerHub.Contract.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_WorkerHub *WorkerHubTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _WorkerHub.Contract.contract.Transact(opts, method, params...) } // AssignmentNumber is a free data retrieval call binding the contract method 0x6973d3f2. // // Solidity: function assignmentNumber() view returns(uint256) func (_WorkerHub *WorkerHubCaller) AssignmentNumber(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} err := _WorkerHub.contract.Call(opts, &out, "assignmentNumber") if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // AssignmentNumber is a free data retrieval call binding the contract method 0x6973d3f2. // // Solidity: function assignmentNumber() view returns(uint256) func (_WorkerHub *WorkerHubSession) AssignmentNumber() (*big.Int, error) { return _WorkerHub.Contract.AssignmentNumber(&_WorkerHub.CallOpts) } // AssignmentNumber is a free data retrieval call binding the contract method 0x6973d3f2. // // Solidity: function assignmentNumber() view returns(uint256) func (_WorkerHub *WorkerHubCallerSession) AssignmentNumber() (*big.Int, error) { return _WorkerHub.Contract.AssignmentNumber(&_WorkerHub.CallOpts) } // Assignments is a free data retrieval call binding the contract method 0x4e50c75c. // // Solidity: function assignments(uint256 ) view returns(uint256 inferenceId, bytes output, address worker, uint8 disapprovalCount) func (_WorkerHub *WorkerHubCaller) Assignments(opts *bind.CallOpts, arg0 *big.Int) (struct { InferenceId *big.Int Output []byte Worker common.Address DisapprovalCount uint8 }, error) { var out []interface{} err := _WorkerHub.contract.Call(opts, &out, "assignments", arg0) outstruct := new(struct { InferenceId *big.Int Output []byte Worker common.Address DisapprovalCount uint8 }) if err != nil { return *outstruct, err } outstruct.InferenceId = *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) outstruct.Output = *abi.ConvertType(out[1], new([]byte)).(*[]byte) outstruct.Worker = *abi.ConvertType(out[2], new(common.Address)).(*common.Address) outstruct.DisapprovalCount = *abi.ConvertType(out[3], new(uint8)).(*uint8) return *outstruct, err } // Assignments is a free data retrieval call binding the contract method 0x4e50c75c. // // Solidity: function assignments(uint256 ) view returns(uint256 inferenceId, bytes output, address worker, uint8 disapprovalCount) func (_WorkerHub *WorkerHubSession) Assignments(arg0 *big.Int) (struct { InferenceId *big.Int Output []byte Worker common.Address DisapprovalCount uint8 }, error) { return _WorkerHub.Contract.Assignments(&_WorkerHub.CallOpts, arg0) } // Assignments is a free data retrieval call binding the contract method 0x4e50c75c. // // Solidity: function assignments(uint256 ) view returns(uint256 inferenceId, bytes output, address worker, uint8 disapprovalCount) func (_WorkerHub *WorkerHubCallerSession) Assignments(arg0 *big.Int) (struct { InferenceId *big.Int Output []byte Worker common.Address DisapprovalCount uint8 }, error) { return _WorkerHub.Contract.Assignments(&_WorkerHub.CallOpts, arg0) } // BlocksPerEpoch is a free data retrieval call binding the contract method 0xf0682054. // // Solidity: function blocksPerEpoch() view returns(uint256) func (_WorkerHub *WorkerHubCaller) BlocksPerEpoch(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} err := _WorkerHub.contract.Call(opts, &out, "blocksPerEpoch") if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // BlocksPerEpoch is a free data retrieval call binding the contract method 0xf0682054. // // Solidity: function blocksPerEpoch() view returns(uint256) func (_WorkerHub *WorkerHubSession) BlocksPerEpoch() (*big.Int, error) { return _WorkerHub.Contract.BlocksPerEpoch(&_WorkerHub.CallOpts) } // BlocksPerEpoch is a free data retrieval call binding the contract method 0xf0682054. // // Solidity: function blocksPerEpoch() view returns(uint256) func (_WorkerHub *WorkerHubCallerSession) BlocksPerEpoch() (*big.Int, error) { return _WorkerHub.Contract.BlocksPerEpoch(&_WorkerHub.CallOpts) } // CurrentEpoch is a free data retrieval call binding the contract method 0x76671808. // // Solidity: function currentEpoch() view returns(uint40) func (_WorkerHub *WorkerHubCaller) CurrentEpoch(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} err := _WorkerHub.contract.Call(opts, &out, "currentEpoch") if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // CurrentEpoch is a free data retrieval call binding the contract method 0x76671808. // // Solidity: function currentEpoch() view returns(uint40) func (_WorkerHub *WorkerHubSession) CurrentEpoch() (*big.Int, error) { return _WorkerHub.Contract.CurrentEpoch(&_WorkerHub.CallOpts) } // CurrentEpoch is a free data retrieval call binding the contract method 0x76671808. // // Solidity: function currentEpoch() view returns(uint40) func (_WorkerHub *WorkerHubCallerSession) CurrentEpoch() (*big.Int, error) { return _WorkerHub.Contract.CurrentEpoch(&_WorkerHub.CallOpts) } // DisputingTimeLimit is a free data retrieval call binding the contract method 0xd64f1f5f. // // Solidity: function disputingTimeLimit() view returns(uint40) func (_WorkerHub *WorkerHubCaller) DisputingTimeLimit(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} err := _WorkerHub.contract.Call(opts, &out, "disputingTimeLimit") if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // DisputingTimeLimit is a free data retrieval call binding the contract method 0xd64f1f5f. // // Solidity: function disputingTimeLimit() view returns(uint40) func (_WorkerHub *WorkerHubSession) DisputingTimeLimit() (*big.Int, error) { return _WorkerHub.Contract.DisputingTimeLimit(&_WorkerHub.CallOpts) } // DisputingTimeLimit is a free data retrieval call binding the contract method 0xd64f1f5f. // // Solidity: function disputingTimeLimit() view returns(uint40) func (_WorkerHub *WorkerHubCallerSession) DisputingTimeLimit() (*big.Int, error) { return _WorkerHub.Contract.DisputingTimeLimit(&_WorkerHub.CallOpts) } // DisqualificationPercentage is a free data retrieval call binding the contract method 0x4670ca47. // // Solidity: function disqualificationPercentage() view returns(uint16) func (_WorkerHub *WorkerHubCaller) DisqualificationPercentage(opts *bind.CallOpts) (uint16, error) { var out []interface{} err := _WorkerHub.contract.Call(opts, &out, "disqualificationPercentage") if err != nil { return *new(uint16), err } out0 := *abi.ConvertType(out[0], new(uint16)).(*uint16) return out0, err } // DisqualificationPercentage is a free data retrieval call binding the contract method 0x4670ca47. // // Solidity: function disqualificationPercentage() view returns(uint16) func (_WorkerHub *WorkerHubSession) DisqualificationPercentage() (uint16, error) { return _WorkerHub.Contract.DisqualificationPercentage(&_WorkerHub.CallOpts) } // DisqualificationPercentage is a free data retrieval call binding the contract method 0x4670ca47. // // Solidity: function disqualificationPercentage() view returns(uint16) func (_WorkerHub *WorkerHubCallerSession) DisqualificationPercentage() (uint16, error) { return _WorkerHub.Contract.DisqualificationPercentage(&_WorkerHub.CallOpts) } // FeePercentage is a free data retrieval call binding the contract method 0xa001ecdd. // // Solidity: function feePercentage() view returns(uint16) func (_WorkerHub *WorkerHubCaller) FeePercentage(opts *bind.CallOpts) (uint16, error) { var out []interface{} err := _WorkerHub.contract.Call(opts, &out, "feePercentage") if err != nil { return *new(uint16), err } out0 := *abi.ConvertType(out[0], new(uint16)).(*uint16) return out0, err } // FeePercentage is a free data retrieval call binding the contract method 0xa001ecdd. // // Solidity: function feePercentage() view returns(uint16) func (_WorkerHub *WorkerHubSession) FeePercentage() (uint16, error) { return _WorkerHub.Contract.FeePercentage(&_WorkerHub.CallOpts) } // FeePercentage is a free data retrieval call binding the contract method 0xa001ecdd. // // Solidity: function feePercentage() view returns(uint16) func (_WorkerHub *WorkerHubCallerSession) FeePercentage() (uint16, error) { return _WorkerHub.Contract.FeePercentage(&_WorkerHub.CallOpts) } // FinePercentage is a free data retrieval call binding the contract method 0x74172795. // // Solidity: function finePercentage() view returns(uint16) func (_WorkerHub *WorkerHubCaller) FinePercentage(opts *bind.CallOpts) (uint16, error) { var out []interface{} err := _WorkerHub.contract.Call(opts, &out, "finePercentage") if err != nil { return *new(uint16), err } out0 := *abi.ConvertType(out[0], new(uint16)).(*uint16) return out0, err } // FinePercentage is a free data retrieval call binding the contract method 0x74172795. // // Solidity: function finePercentage() view returns(uint16) func (_WorkerHub *WorkerHubSession) FinePercentage() (uint16, error) { return _WorkerHub.Contract.FinePercentage(&_WorkerHub.CallOpts) } // FinePercentage is a free data retrieval call binding the contract method 0x74172795. // // Solidity: function finePercentage() view returns(uint16) func (_WorkerHub *WorkerHubCallerSession) FinePercentage() (uint16, error) { return _WorkerHub.Contract.FinePercentage(&_WorkerHub.CallOpts) } // GetInferences is a free data retrieval call binding the contract method 0xa01253d8. // // Solidity: function getInferences(uint256[] _inferenceIds) view returns((uint256,bytes,bytes,uint256,address,address,uint40,uint8,address)[]) func (_WorkerHub *WorkerHubCaller) GetInferences(opts *bind.CallOpts, _inferenceIds []*big.Int) ([]IWorkerHubInferenceInfo, error) { var out []interface{} err := _WorkerHub.contract.Call(opts, &out, "getInferences", _inferenceIds) if err != nil { return *new([]IWorkerHubInferenceInfo), err } out0 := *abi.ConvertType(out[0], new([]IWorkerHubInferenceInfo)).(*[]IWorkerHubInferenceInfo) return out0, err } // GetInferences is a free data retrieval call binding the contract method 0xa01253d8. // // Solidity: function getInferences(uint256[] _inferenceIds) view returns((uint256,bytes,bytes,uint256,address,address,uint40,uint8,address)[]) func (_WorkerHub *WorkerHubSession) GetInferences(_inferenceIds []*big.Int) ([]IWorkerHubInferenceInfo, error) { return _WorkerHub.Contract.GetInferences(&_WorkerHub.CallOpts, _inferenceIds) } // GetInferences is a free data retrieval call binding the contract method 0xa01253d8. // // Solidity: function getInferences(uint256[] _inferenceIds) view returns((uint256,bytes,bytes,uint256,address,address,uint40,uint8,address)[]) func (_WorkerHub *WorkerHubCallerSession) GetInferences(_inferenceIds []*big.Int) ([]IWorkerHubInferenceInfo, error) { return _WorkerHub.Contract.GetInferences(&_WorkerHub.CallOpts, _inferenceIds) } // GetMinerAddresses is a free data retrieval call binding the contract method 0xe8d6f2f1. // // Solidity: function getMinerAddresses() view returns(address[]) func (_WorkerHub *WorkerHubCaller) GetMinerAddresses(opts *bind.CallOpts) ([]common.Address, error) { var out []interface{} err := _WorkerHub.contract.Call(opts, &out, "getMinerAddresses") if err != nil { return *new([]common.Address), err } out0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) return out0, err } // GetMinerAddresses is a free data retrieval call binding the contract method 0xe8d6f2f1. // // Solidity: function getMinerAddresses() view returns(address[]) func (_WorkerHub *WorkerHubSession) GetMinerAddresses() ([]common.Address, error) { return _WorkerHub.Contract.GetMinerAddresses(&_WorkerHub.CallOpts) } // GetMinerAddresses is a free data retrieval call binding the contract method 0xe8d6f2f1. // // Solidity: function getMinerAddresses() view returns(address[]) func (_WorkerHub *WorkerHubCallerSession) GetMinerAddresses() ([]common.Address, error) { return _WorkerHub.Contract.GetMinerAddresses(&_WorkerHub.CallOpts) } // GetMinerAddressesOfModel is a free data retrieval call binding the contract method 0x47253baa. // // Solidity: function getMinerAddressesOfModel(address _model) view returns(address[]) func (_WorkerHub *WorkerHubCaller) GetMinerAddressesOfModel(opts *bind.CallOpts, _model common.Address) ([]common.Address, error) { var out []interface{} err := _WorkerHub.contract.Call(opts, &out, "getMinerAddressesOfModel", _model) if err != nil { return *new([]common.Address), err } out0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) return out0, err } // GetMinerAddressesOfModel is a free data retrieval call binding the contract method 0x47253baa. // // Solidity: function getMinerAddressesOfModel(address _model) view returns(address[]) func (_WorkerHub *WorkerHubSession) GetMinerAddressesOfModel(_model common.Address) ([]common.Address, error) { return _WorkerHub.Contract.GetMinerAddressesOfModel(&_WorkerHub.CallOpts, _model) } // GetMinerAddressesOfModel is a free data retrieval call binding the contract method 0x47253baa. // // Solidity: function getMinerAddressesOfModel(address _model) view returns(address[]) func (_WorkerHub *WorkerHubCallerSession) GetMinerAddressesOfModel(_model common.Address) ([]common.Address, error) { return _WorkerHub.Contract.GetMinerAddressesOfModel(&_WorkerHub.CallOpts, _model) } // GetMiners is a free data retrieval call binding the contract method 0x1633da6e. // // Solidity: function getMiners() view returns((address,uint256,uint256,address,uint40,uint40,uint16)[]) func (_WorkerHub *WorkerHubCaller) GetMiners(opts *bind.CallOpts) ([]IWorkerHubWorkerInfo, error) { var out []interface{} err := _WorkerHub.contract.Call(opts, &out, "getMiners") if err != nil { return *new([]IWorkerHubWorkerInfo), err } out0 := *abi.ConvertType(out[0], new([]IWorkerHubWorkerInfo)).(*[]IWorkerHubWorkerInfo) return out0, err } // GetMiners is a free data retrieval call binding the contract method 0x1633da6e. // // Solidity: function getMiners() view returns((address,uint256,uint256,address,uint40,uint40,uint16)[]) func (_WorkerHub *WorkerHubSession) GetMiners() ([]IWorkerHubWorkerInfo, error) { return _WorkerHub.Contract.GetMiners(&_WorkerHub.CallOpts) } // GetMiners is a free data retrieval call binding the contract method 0x1633da6e. // // Solidity: function getMiners() view returns((address,uint256,uint256,address,uint40,uint40,uint16)[]) func (_WorkerHub *WorkerHubCallerSession) GetMiners() ([]IWorkerHubWorkerInfo, error) { return _WorkerHub.Contract.GetMiners(&_WorkerHub.CallOpts) } // GetMiningAssignments is a free data retrieval call binding the contract method 0x37504f57. // // Solidity: function getMiningAssignments() view returns((uint256,uint256,uint256,bytes,address,address,uint40)[]) func (_WorkerHub *WorkerHubCaller) GetMiningAssignments(opts *bind.CallOpts) ([]IWorkerHubAssignmentInfo, error) { var out []interface{} err := _WorkerHub.contract.Call(opts, &out, "getMiningAssignments") if err != nil { return *new([]IWorkerHubAssignmentInfo), err } out0 := *abi.ConvertType(out[0], new([]IWorkerHubAssignmentInfo)).(*[]IWorkerHubAssignmentInfo) return out0, err } // GetMiningAssignments is a free data retrieval call binding the contract method 0x37504f57. // // Solidity: function getMiningAssignments() view returns((uint256,uint256,uint256,bytes,address,address,uint40)[]) func (_WorkerHub *WorkerHubSession) GetMiningAssignments() ([]IWorkerHubAssignmentInfo, error) { return _WorkerHub.Contract.GetMiningAssignments(&_WorkerHub.CallOpts) } // GetMiningAssignments is a free data retrieval call binding the contract method 0x37504f57. // // Solidity: function getMiningAssignments() view returns((uint256,uint256,uint256,bytes,address,address,uint40)[]) func (_WorkerHub *WorkerHubCallerSession) GetMiningAssignments() ([]IWorkerHubAssignmentInfo, error) { return _WorkerHub.Contract.GetMiningAssignments(&_WorkerHub.CallOpts) } // GetMintingAssignmentsOfInference is a free data retrieval call binding the contract method 0x5eec7b20. // // Solidity: function getMintingAssignmentsOfInference(uint256 _inferenceId) view returns((uint256,uint256,uint256,bytes,address,address,uint40)[]) func (_WorkerHub *WorkerHubCaller) GetMintingAssignmentsOfInference(opts *bind.CallOpts, _inferenceId *big.Int) ([]IWorkerHubAssignmentInfo, error) { var out []interface{} err := _WorkerHub.contract.Call(opts, &out, "getMintingAssignmentsOfInference", _inferenceId) if err != nil { return *new([]IWorkerHubAssignmentInfo), err } out0 := *abi.ConvertType(out[0], new([]IWorkerHubAssignmentInfo)).(*[]IWorkerHubAssignmentInfo) return out0, err } // GetMintingAssignmentsOfInference is a free data retrieval call binding the contract method 0x5eec7b20. // // Solidity: function getMintingAssignmentsOfInference(uint256 _inferenceId) view returns((uint256,uint256,uint256,bytes,address,address,uint40)[]) func (_WorkerHub *WorkerHubSession) GetMintingAssignmentsOfInference(_inferenceId *big.Int) ([]IWorkerHubAssignmentInfo, error) { return _WorkerHub.Contract.GetMintingAssignmentsOfInference(&_WorkerHub.CallOpts, _inferenceId) } // GetMintingAssignmentsOfInference is a free data retrieval call binding the contract method 0x5eec7b20. // // Solidity: function getMintingAssignmentsOfInference(uint256 _inferenceId) view returns((uint256,uint256,uint256,bytes,address,address,uint40)[]) func (_WorkerHub *WorkerHubCallerSession) GetMintingAssignmentsOfInference(_inferenceId *big.Int) ([]IWorkerHubAssignmentInfo, error) { return _WorkerHub.Contract.GetMintingAssignmentsOfInference(&_WorkerHub.CallOpts, _inferenceId) } // GetModelAddresses is a free data retrieval call binding the contract method 0x9ae49cd3. // // Solidity: function getModelAddresses() view returns(address[]) func (_WorkerHub *WorkerHubCaller) GetModelAddresses(opts *bind.CallOpts) ([]common.Address, error) { var out []interface{} err := _WorkerHub.contract.Call(opts, &out, "getModelAddresses") if err != nil { return *new([]common.Address), err } out0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) return out0, err } // GetModelAddresses is a free data retrieval call binding the contract method 0x9ae49cd3. // // Solidity: function getModelAddresses() view returns(address[]) func (_WorkerHub *WorkerHubSession) GetModelAddresses() ([]common.Address, error) { return _WorkerHub.Contract.GetModelAddresses(&_WorkerHub.CallOpts) } // GetModelAddresses is a free data retrieval call binding the contract method 0x9ae49cd3. // // Solidity: function getModelAddresses() view returns(address[]) func (_WorkerHub *WorkerHubCallerSession) GetModelAddresses() ([]common.Address, error) { return _WorkerHub.Contract.GetModelAddresses(&_WorkerHub.CallOpts) } // GetNOMiner is a free data retrieval call binding the contract method 0xd2d89be8. // // Solidity: function getNOMiner() view returns(uint256) func (_WorkerHub *WorkerHubCaller) GetNOMiner(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} err := _WorkerHub.contract.Call(opts, &out, "getNOMiner") if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // GetNOMiner is a free data retrieval call binding the contract method 0xd2d89be8. // // Solidity: function getNOMiner() view returns(uint256) func (_WorkerHub *WorkerHubSession) GetNOMiner() (*big.Int, error) { return _WorkerHub.Contract.GetNOMiner(&_WorkerHub.CallOpts) } // GetNOMiner is a free data retrieval call binding the contract method 0xd2d89be8. // // Solidity: function getNOMiner() view returns(uint256) func (_WorkerHub *WorkerHubCallerSession) GetNOMiner() (*big.Int, error) { return _WorkerHub.Contract.GetNOMiner(&_WorkerHub.CallOpts) } // GetValidatorAddresses is a free data retrieval call binding the contract method 0xf74e921f. // // Solidity: function getValidatorAddresses() view returns(address[]) func (_WorkerHub *WorkerHubCaller) GetValidatorAddresses(opts *bind.CallOpts) ([]common.Address, error) { var out []interface{} err := _WorkerHub.contract.Call(opts, &out, "getValidatorAddresses") if err != nil { return *new([]common.Address), err } out0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) return out0, err } // GetValidatorAddresses is a free data retrieval call binding the contract method 0xf74e921f. // // Solidity: function getValidatorAddresses() view returns(address[]) func (_WorkerHub *WorkerHubSession) GetValidatorAddresses() ([]common.Address, error) { return _WorkerHub.Contract.GetValidatorAddresses(&_WorkerHub.CallOpts) } // GetValidatorAddresses is a free data retrieval call binding the contract method 0xf74e921f. // // Solidity: function getValidatorAddresses() view returns(address[]) func (_WorkerHub *WorkerHubCallerSession) GetValidatorAddresses() ([]common.Address, error) { return _WorkerHub.Contract.GetValidatorAddresses(&_WorkerHub.CallOpts) } // GetValidatorAddressesOfModel is a free data retrieval call binding the contract method 0xcbaaf438. // // Solidity: function getValidatorAddressesOfModel(address _model) view returns(address[]) func (_WorkerHub *WorkerHubCaller) GetValidatorAddressesOfModel(opts *bind.CallOpts, _model common.Address) ([]common.Address, error) { var out []interface{} err := _WorkerHub.contract.Call(opts, &out, "getValidatorAddressesOfModel", _model) if err != nil { return *new([]common.Address), err } out0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) return out0, err } // GetValidatorAddressesOfModel is a free data retrieval call binding the contract method 0xcbaaf438. // // Solidity: function getValidatorAddressesOfModel(address _model) view returns(address[]) func (_WorkerHub *WorkerHubSession) GetValidatorAddressesOfModel(_model common.Address) ([]common.Address, error) { return _WorkerHub.Contract.GetValidatorAddressesOfModel(&_WorkerHub.CallOpts, _model) } // GetValidatorAddressesOfModel is a free data retrieval call binding the contract method 0xcbaaf438. // // Solidity: function getValidatorAddressesOfModel(address _model) view returns(address[]) func (_WorkerHub *WorkerHubCallerSession) GetValidatorAddressesOfModel(_model common.Address) ([]common.Address, error) { return _WorkerHub.Contract.GetValidatorAddressesOfModel(&_WorkerHub.CallOpts, _model) } // GetValidators is a free data retrieval call binding the contract method 0xb7ab4db5. // // Solidity: function getValidators() view returns((address,uint256,uint256,address,uint40,uint40,uint16)[]) func (_WorkerHub *WorkerHubCaller) GetValidators(opts *bind.CallOpts) ([]IWorkerHubWorkerInfo, error) { var out []interface{} err := _WorkerHub.contract.Call(opts, &out, "getValidators") if err != nil { return *new([]IWorkerHubWorkerInfo), err } out0 := *abi.ConvertType(out[0], new([]IWorkerHubWorkerInfo)).(*[]IWorkerHubWorkerInfo) return out0, err } // GetValidators is a free data retrieval call binding the contract method 0xb7ab4db5. // // Solidity: function getValidators() view returns((address,uint256,uint256,address,uint40,uint40,uint16)[]) func (_WorkerHub *WorkerHubSession) GetValidators() ([]IWorkerHubWorkerInfo, error) { return _WorkerHub.Contract.GetValidators(&_WorkerHub.CallOpts) } // GetValidators is a free data retrieval call binding the contract method 0xb7ab4db5. // // Solidity: function getValidators() view returns((address,uint256,uint256,address,uint40,uint40,uint16)[]) func (_WorkerHub *WorkerHubCallerSession) GetValidators() ([]IWorkerHubWorkerInfo, error) { return _WorkerHub.Contract.GetValidators(&_WorkerHub.CallOpts) } // InferenceNumber is a free data retrieval call binding the contract method 0xf80dca98. // // Solidity: function inferenceNumber() view returns(uint256) func (_WorkerHub *WorkerHubCaller) InferenceNumber(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} err := _WorkerHub.contract.Call(opts, &out, "inferenceNumber") if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // InferenceNumber is a free data retrieval call binding the contract method 0xf80dca98. // // Solidity: function inferenceNumber() view returns(uint256) func (_WorkerHub *WorkerHubSession) InferenceNumber() (*big.Int, error) { return _WorkerHub.Contract.InferenceNumber(&_WorkerHub.CallOpts) } // InferenceNumber is a free data retrieval call binding the contract method 0xf80dca98. // // Solidity: function inferenceNumber() view returns(uint256) func (_WorkerHub *WorkerHubCallerSession) InferenceNumber() (*big.Int, error) { return _WorkerHub.Contract.InferenceNumber(&_WorkerHub.CallOpts) } // IsAssignmentPending is a free data retrieval call binding the contract method 0x57a38def. // // Solidity: function isAssignmentPending(uint256 _assignmentId) view returns(bool) func (_WorkerHub *WorkerHubCaller) IsAssignmentPending(opts *bind.CallOpts, _assignmentId *big.Int) (bool, error) { var out []interface{} err := _WorkerHub.contract.Call(opts, &out, "isAssignmentPending", _assignmentId) if err != nil { return *new(bool), err } out0 := *abi.ConvertType(out[0], new(bool)).(*bool) return out0, err } // IsAssignmentPending is a free data retrieval call binding the contract method 0x57a38def. // // Solidity: function isAssignmentPending(uint256 _assignmentId) view returns(bool) func (_WorkerHub *WorkerHubSession) IsAssignmentPending(_assignmentId *big.Int) (bool, error) { return _WorkerHub.Contract.IsAssignmentPending(&_WorkerHub.CallOpts, _assignmentId) } // IsAssignmentPending is a free data retrieval call binding the contract method 0x57a38def. // // Solidity: function isAssignmentPending(uint256 _assignmentId) view returns(bool) func (_WorkerHub *WorkerHubCallerSession) IsAssignmentPending(_assignmentId *big.Int) (bool, error) { return _WorkerHub.Contract.IsAssignmentPending(&_WorkerHub.CallOpts, _assignmentId) } // LastBlock is a free data retrieval call binding the contract method 0x806b984f. // // Solidity: function lastBlock() view returns(uint256) func (_WorkerHub *WorkerHubCaller) LastBlock(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} err := _WorkerHub.contract.Call(opts, &out, "lastBlock") if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // LastBlock is a free data retrieval call binding the contract method 0x806b984f. // // Solidity: function lastBlock() view returns(uint256) func (_WorkerHub *WorkerHubSession) LastBlock() (*big.Int, error) { return _WorkerHub.Contract.LastBlock(&_WorkerHub.CallOpts) } // LastBlock is a free data retrieval call binding the contract method 0x806b984f. // // Solidity: function lastBlock() view returns(uint256) func (_WorkerHub *WorkerHubCallerSession) LastBlock() (*big.Int, error) { return _WorkerHub.Contract.LastBlock(&_WorkerHub.CallOpts) } // MaximumTier is a free data retrieval call binding the contract method 0x0716187f. // // Solidity: function maximumTier() view returns(uint16) func (_WorkerHub *WorkerHubCaller) MaximumTier(opts *bind.CallOpts) (uint16, error) { var out []interface{} err := _WorkerHub.contract.Call(opts, &out, "maximumTier") if err != nil { return *new(uint16), err } out0 := *abi.ConvertType(out[0], new(uint16)).(*uint16) return out0, err } // MaximumTier is a free data retrieval call binding the contract method 0x0716187f. // // Solidity: function maximumTier() view returns(uint16) func (_WorkerHub *WorkerHubSession) MaximumTier() (uint16, error) { return _WorkerHub.Contract.MaximumTier(&_WorkerHub.CallOpts) } // MaximumTier is a free data retrieval call binding the contract method 0x0716187f. // // Solidity: function maximumTier() view returns(uint16) func (_WorkerHub *WorkerHubCallerSession) MaximumTier() (uint16, error) { return _WorkerHub.Contract.MaximumTier(&_WorkerHub.CallOpts) } // MinerMinimumStake is a free data retrieval call binding the contract method 0x3304f456. // // Solidity: function minerMinimumStake() view returns(uint256) func (_WorkerHub *WorkerHubCaller) MinerMinimumStake(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} err := _WorkerHub.contract.Call(opts, &out, "minerMinimumStake") if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // MinerMinimumStake is a free data retrieval call binding the contract method 0x3304f456. // // Solidity: function minerMinimumStake() view returns(uint256) func (_WorkerHub *WorkerHubSession) MinerMinimumStake() (*big.Int, error) { return _WorkerHub.Contract.MinerMinimumStake(&_WorkerHub.CallOpts) } // MinerMinimumStake is a free data retrieval call binding the contract method 0x3304f456. // // Solidity: function minerMinimumStake() view returns(uint256) func (_WorkerHub *WorkerHubCallerSession) MinerMinimumStake() (*big.Int, error) { return _WorkerHub.Contract.MinerMinimumStake(&_WorkerHub.CallOpts) } // MinerRequirement is a free data retrieval call binding the contract method 0xdd9b9766. // // Solidity: function minerRequirement() view returns(uint8) func (_WorkerHub *WorkerHubCaller) MinerRequirement(opts *bind.CallOpts) (uint8, error) { var out []interface{} err := _WorkerHub.contract.Call(opts, &out, "minerRequirement") if err != nil { return *new(uint8), err } out0 := *abi.ConvertType(out[0], new(uint8)).(*uint8) return out0, err } // MinerRequirement is a free data retrieval call binding the contract method 0xdd9b9766. // // Solidity: function minerRequirement() view returns(uint8) func (_WorkerHub *WorkerHubSession) MinerRequirement() (uint8, error) { return _WorkerHub.Contract.MinerRequirement(&_WorkerHub.CallOpts) } // MinerRequirement is a free data retrieval call binding the contract method 0xdd9b9766. // // Solidity: function minerRequirement() view returns(uint8) func (_WorkerHub *WorkerHubCallerSession) MinerRequirement() (uint8, error) { return _WorkerHub.Contract.MinerRequirement(&_WorkerHub.CallOpts) } // MinerUnstakeRequests is a free data retrieval call binding the contract method 0x191a54d8. // // Solidity: function minerUnstakeRequests(address ) view returns(uint256 stake, uint40 unlockAt) func (_WorkerHub *WorkerHubCaller) MinerUnstakeRequests(opts *bind.CallOpts, arg0 common.Address) (struct { Stake *big.Int UnlockAt *big.Int }, error) { var out []interface{} err := _WorkerHub.contract.Call(opts, &out, "minerUnstakeRequests", arg0) outstruct := new(struct { Stake *big.Int UnlockAt *big.Int }) if err != nil { return *outstruct, err } outstruct.Stake = *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) outstruct.UnlockAt = *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) return *outstruct, err } // MinerUnstakeRequests is a free data retrieval call binding the contract method 0x191a54d8. // // Solidity: function minerUnstakeRequests(address ) view returns(uint256 stake, uint40 unlockAt) func (_WorkerHub *WorkerHubSession) MinerUnstakeRequests(arg0 common.Address) (struct { Stake *big.Int UnlockAt *big.Int }, error) { return _WorkerHub.Contract.MinerUnstakeRequests(&_WorkerHub.CallOpts, arg0) } // MinerUnstakeRequests is a free data retrieval call binding the contract method 0x191a54d8. // // Solidity: function minerUnstakeRequests(address ) view returns(uint256 stake, uint40 unlockAt) func (_WorkerHub *WorkerHubCallerSession) MinerUnstakeRequests(arg0 common.Address) (struct { Stake *big.Int UnlockAt *big.Int }, error) { return _WorkerHub.Contract.MinerUnstakeRequests(&_WorkerHub.CallOpts, arg0) } // Miners is a free data retrieval call binding the contract method 0x648ec7b9. // // Solidity: function miners(address ) view returns(uint256 stake, uint256 commitment, address modelAddress, uint40 lastClaimedEpoch, uint40 activeTime, uint16 tier) func (_WorkerHub *WorkerHubCaller) Miners(opts *bind.CallOpts, arg0 common.Address) (struct { Stake *big.Int Commitment *big.Int ModelAddress common.Address LastClaimedEpoch *big.Int ActiveTime *big.Int Tier uint16 }, error) { var out []interface{} err := _WorkerHub.contract.Call(opts, &out, "miners", arg0) outstruct := new(struct { Stake *big.Int Commitment *big.Int ModelAddress common.Address LastClaimedEpoch *big.Int ActiveTime *big.Int Tier uint16 }) if err != nil { return *outstruct, err } outstruct.Stake = *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) outstruct.Commitment = *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) outstruct.ModelAddress = *abi.ConvertType(out[2], new(common.Address)).(*common.Address) outstruct.LastClaimedEpoch = *abi.ConvertType(out[3], new(*big.Int)).(**big.Int) outstruct.ActiveTime = *abi.ConvertType(out[4], new(*big.Int)).(**big.Int) outstruct.Tier = *abi.ConvertType(out[5], new(uint16)).(*uint16) return *outstruct, err } // Miners is a free data retrieval call binding the contract method 0x648ec7b9. // // Solidity: function miners(address ) view returns(uint256 stake, uint256 commitment, address modelAddress, uint40 lastClaimedEpoch, uint40 activeTime, uint16 tier) func (_WorkerHub *WorkerHubSession) Miners(arg0 common.Address) (struct { Stake *big.Int Commitment *big.Int ModelAddress common.Address LastClaimedEpoch *big.Int ActiveTime *big.Int Tier uint16 }, error) { return _WorkerHub.Contract.Miners(&_WorkerHub.CallOpts, arg0) } // Miners is a free data retrieval call binding the contract method 0x648ec7b9. // // Solidity: function miners(address ) view returns(uint256 stake, uint256 commitment, address modelAddress, uint40 lastClaimedEpoch, uint40 activeTime, uint16 tier) func (_WorkerHub *WorkerHubCallerSession) Miners(arg0 common.Address) (struct { Stake *big.Int Commitment *big.Int ModelAddress common.Address LastClaimedEpoch *big.Int ActiveTime *big.Int Tier uint16 }, error) { return _WorkerHub.Contract.Miners(&_WorkerHub.CallOpts, arg0) } // MiningTimeLimit is a free data retrieval call binding the contract method 0x691ff7ef. // // Solidity: function miningTimeLimit() view returns(uint40) func (_WorkerHub *WorkerHubCaller) MiningTimeLimit(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} err := _WorkerHub.contract.Call(opts, &out, "miningTimeLimit") if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // MiningTimeLimit is a free data retrieval call binding the contract method 0x691ff7ef. // // Solidity: function miningTimeLimit() view returns(uint40) func (_WorkerHub *WorkerHubSession) MiningTimeLimit() (*big.Int, error) { return _WorkerHub.Contract.MiningTimeLimit(&_WorkerHub.CallOpts) } // MiningTimeLimit is a free data retrieval call binding the contract method 0x691ff7ef. // // Solidity: function miningTimeLimit() view returns(uint40) func (_WorkerHub *WorkerHubCallerSession) MiningTimeLimit() (*big.Int, error) { return _WorkerHub.Contract.MiningTimeLimit(&_WorkerHub.CallOpts) } // Models is a free data retrieval call binding the contract method 0x54917f83. // // Solidity: function models(address ) view returns(uint256 minimumFee, uint32 tier) func (_WorkerHub *WorkerHubCaller) Models(opts *bind.CallOpts, arg0 common.Address) (struct { MinimumFee *big.Int Tier uint32 }, error) { var out []interface{} err := _WorkerHub.contract.Call(opts, &out, "models", arg0) outstruct := new(struct { MinimumFee *big.Int Tier uint32 }) if err != nil { return *outstruct, err } outstruct.MinimumFee = *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) outstruct.Tier = *abi.ConvertType(out[1], new(uint32)).(*uint32) return *outstruct, err } // Models is a free data retrieval call binding the contract method 0x54917f83. // // Solidity: function models(address ) view returns(uint256 minimumFee, uint32 tier) func (_WorkerHub *WorkerHubSession) Models(arg0 common.Address) (struct { MinimumFee *big.Int Tier uint32 }, error) { return _WorkerHub.Contract.Models(&_WorkerHub.CallOpts, arg0) } // Models is a free data retrieval call binding the contract method 0x54917f83. // // Solidity: function models(address ) view returns(uint256 minimumFee, uint32 tier) func (_WorkerHub *WorkerHubCallerSession) Models(arg0 common.Address) (struct { MinimumFee *big.Int Tier uint32 }, error) { return _WorkerHub.Contract.Models(&_WorkerHub.CallOpts, arg0) } // Multiplier is a free data retrieval call binding the contract method 0xa9b3f8b7. // // Solidity: function multiplier(address _miner) view returns(uint256) func (_WorkerHub *WorkerHubCaller) Multiplier(opts *bind.CallOpts, _miner common.Address) (*big.Int, error) { var out []interface{} err := _WorkerHub.contract.Call(opts, &out, "multiplier", _miner) if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // Multiplier is a free data retrieval call binding the contract method 0xa9b3f8b7. // // Solidity: function multiplier(address _miner) view returns(uint256) func (_WorkerHub *WorkerHubSession) Multiplier(_miner common.Address) (*big.Int, error) { return _WorkerHub.Contract.Multiplier(&_WorkerHub.CallOpts, _miner) } // Multiplier is a free data retrieval call binding the contract method 0xa9b3f8b7. // // Solidity: function multiplier(address _miner) view returns(uint256) func (_WorkerHub *WorkerHubCallerSession) Multiplier(_miner common.Address) (*big.Int, error) { return _WorkerHub.Contract.Multiplier(&_WorkerHub.CallOpts, _miner) } // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. // // Solidity: function owner() view returns(address) func (_WorkerHub *WorkerHubCaller) Owner(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _WorkerHub.contract.Call(opts, &out, "owner") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. // // Solidity: function owner() view returns(address) func (_WorkerHub *WorkerHubSession) Owner() (common.Address, error) { return _WorkerHub.Contract.Owner(&_WorkerHub.CallOpts) } // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. // // Solidity: function owner() view returns(address) func (_WorkerHub *WorkerHubCallerSession) Owner() (common.Address, error) { return _WorkerHub.Contract.Owner(&_WorkerHub.CallOpts) } // Paused is a free data retrieval call binding the contract method 0x5c975abb. // // Solidity: function paused() view returns(bool) func (_WorkerHub *WorkerHubCaller) Paused(opts *bind.CallOpts) (bool, error) { var out []interface{} err := _WorkerHub.contract.Call(opts, &out, "paused") if err != nil { return *new(bool), err } out0 := *abi.ConvertType(out[0], new(bool)).(*bool) return out0, err } // Paused is a free data retrieval call binding the contract method 0x5c975abb. // // Solidity: function paused() view returns(bool) func (_WorkerHub *WorkerHubSession) Paused() (bool, error) { return _WorkerHub.Contract.Paused(&_WorkerHub.CallOpts) } // Paused is a free data retrieval call binding the contract method 0x5c975abb. // // Solidity: function paused() view returns(bool) func (_WorkerHub *WorkerHubCallerSession) Paused() (bool, error) { return _WorkerHub.Contract.Paused(&_WorkerHub.CallOpts) } // PenaltyDuration is a free data retrieval call binding the contract method 0x5aa1326c. // // Solidity: function penaltyDuration() view returns(uint40) func (_WorkerHub *WorkerHubCaller) PenaltyDuration(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} err := _WorkerHub.contract.Call(opts, &out, "penaltyDuration") if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // PenaltyDuration is a free data retrieval call binding the contract method 0x5aa1326c. // // Solidity: function penaltyDuration() view returns(uint40) func (_WorkerHub *WorkerHubSession) PenaltyDuration() (*big.Int, error) { return _WorkerHub.Contract.PenaltyDuration(&_WorkerHub.CallOpts) } // PenaltyDuration is a free data retrieval call binding the contract method 0x5aa1326c. // // Solidity: function penaltyDuration() view returns(uint40) func (_WorkerHub *WorkerHubCallerSession) PenaltyDuration() (*big.Int, error) { return _WorkerHub.Contract.PenaltyDuration(&_WorkerHub.CallOpts) } // RewardInEpoch is a free data retrieval call binding the contract method 0x652ff159. // // Solidity: function rewardInEpoch(uint256 ) view returns(uint256 perfReward, uint256 epochReward, uint256 totalTaskCompleted, uint256 totalMiner) func (_WorkerHub *WorkerHubCaller) RewardInEpoch(opts *bind.CallOpts, arg0 *big.Int) (struct { PerfReward *big.Int EpochReward *big.Int TotalTaskCompleted *big.Int TotalMiner *big.Int }, error) { var out []interface{} err := _WorkerHub.contract.Call(opts, &out, "rewardInEpoch", arg0) outstruct := new(struct { PerfReward *big.Int EpochReward *big.Int TotalTaskCompleted *big.Int TotalMiner *big.Int }) if err != nil { return *outstruct, err } outstruct.PerfReward = *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) outstruct.EpochReward = *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) outstruct.TotalTaskCompleted = *abi.ConvertType(out[2], new(*big.Int)).(**big.Int) outstruct.TotalMiner = *abi.ConvertType(out[3], new(*big.Int)).(**big.Int) return *outstruct, err } // RewardInEpoch is a free data retrieval call binding the contract method 0x652ff159. // // Solidity: function rewardInEpoch(uint256 ) view returns(uint256 perfReward, uint256 epochReward, uint256 totalTaskCompleted, uint256 totalMiner) func (_WorkerHub *WorkerHubSession) RewardInEpoch(arg0 *big.Int) (struct { PerfReward *big.Int EpochReward *big.Int TotalTaskCompleted *big.Int TotalMiner *big.Int }, error) { return _WorkerHub.Contract.RewardInEpoch(&_WorkerHub.CallOpts, arg0) } // RewardInEpoch is a free data retrieval call binding the contract method 0x652ff159. // // Solidity: function rewardInEpoch(uint256 ) view returns(uint256 perfReward, uint256 epochReward, uint256 totalTaskCompleted, uint256 totalMiner) func (_WorkerHub *WorkerHubCallerSession) RewardInEpoch(arg0 *big.Int) (struct { PerfReward *big.Int EpochReward *big.Int TotalTaskCompleted *big.Int TotalMiner *big.Int }, error) { return _WorkerHub.Contract.RewardInEpoch(&_WorkerHub.CallOpts, arg0) } // RewardPerEpoch is a free data retrieval call binding the contract method 0x84449a9d. // // Solidity: function rewardPerEpoch() view returns(uint256) func (_WorkerHub *WorkerHubCaller) RewardPerEpoch(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} err := _WorkerHub.contract.Call(opts, &out, "rewardPerEpoch") if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // RewardPerEpoch is a free data retrieval call binding the contract method 0x84449a9d. // // Solidity: function rewardPerEpoch() view returns(uint256) func (_WorkerHub *WorkerHubSession) RewardPerEpoch() (*big.Int, error) { return _WorkerHub.Contract.RewardPerEpoch(&_WorkerHub.CallOpts) } // RewardPerEpoch is a free data retrieval call binding the contract method 0x84449a9d. // // Solidity: function rewardPerEpoch() view returns(uint256) func (_WorkerHub *WorkerHubCallerSession) RewardPerEpoch() (*big.Int, error) { return _WorkerHub.Contract.RewardPerEpoch(&_WorkerHub.CallOpts) } // Treasury is a free data retrieval call binding the contract method 0x61d027b3. // // Solidity: function treasury() view returns(address) func (_WorkerHub *WorkerHubCaller) Treasury(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _WorkerHub.contract.Call(opts, &out, "treasury") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // Treasury is a free data retrieval call binding the contract method 0x61d027b3. // // Solidity: function treasury() view returns(address) func (_WorkerHub *WorkerHubSession) Treasury() (common.Address, error) { return _WorkerHub.Contract.Treasury(&_WorkerHub.CallOpts) } // Treasury is a free data retrieval call binding the contract method 0x61d027b3. // // Solidity: function treasury() view returns(address) func (_WorkerHub *WorkerHubCallerSession) Treasury() (common.Address, error) { return _WorkerHub.Contract.Treasury(&_WorkerHub.CallOpts) } // UnstakeDelayTime is a free data retrieval call binding the contract method 0xe4fefd65. // // Solidity: function unstakeDelayTime() view returns(uint40) func (_WorkerHub *WorkerHubCaller) UnstakeDelayTime(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} err := _WorkerHub.contract.Call(opts, &out, "unstakeDelayTime") if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // UnstakeDelayTime is a free data retrieval call binding the contract method 0xe4fefd65. // // Solidity: function unstakeDelayTime() view returns(uint40) func (_WorkerHub *WorkerHubSession) UnstakeDelayTime() (*big.Int, error) { return _WorkerHub.Contract.UnstakeDelayTime(&_WorkerHub.CallOpts) } // UnstakeDelayTime is a free data retrieval call binding the contract method 0xe4fefd65. // // Solidity: function unstakeDelayTime() view returns(uint40) func (_WorkerHub *WorkerHubCallerSession) UnstakeDelayTime() (*big.Int, error) { return _WorkerHub.Contract.UnstakeDelayTime(&_WorkerHub.CallOpts) } // ValidatingTimeLimit is a free data retrieval call binding the contract method 0x56f2eca3. // // Solidity: function validatingTimeLimit() view returns(uint40) func (_WorkerHub *WorkerHubCaller) ValidatingTimeLimit(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} err := _WorkerHub.contract.Call(opts, &out, "validatingTimeLimit") if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // ValidatingTimeLimit is a free data retrieval call binding the contract method 0x56f2eca3. // // Solidity: function validatingTimeLimit() view returns(uint40) func (_WorkerHub *WorkerHubSession) ValidatingTimeLimit() (*big.Int, error) { return _WorkerHub.Contract.ValidatingTimeLimit(&_WorkerHub.CallOpts) } // ValidatingTimeLimit is a free data retrieval call binding the contract method 0x56f2eca3. // // Solidity: function validatingTimeLimit() view returns(uint40) func (_WorkerHub *WorkerHubCallerSession) ValidatingTimeLimit() (*big.Int, error) { return _WorkerHub.Contract.ValidatingTimeLimit(&_WorkerHub.CallOpts) } // ValidatorDisputed is a free data retrieval call binding the contract method 0x7146ab67. // // Solidity: function validatorDisputed(address , uint256 ) view returns(bool) func (_WorkerHub *WorkerHubCaller) ValidatorDisputed(opts *bind.CallOpts, arg0 common.Address, arg1 *big.Int) (bool, error) { var out []interface{} err := _WorkerHub.contract.Call(opts, &out, "validatorDisputed", arg0, arg1) if err != nil { return *new(bool), err } out0 := *abi.ConvertType(out[0], new(bool)).(*bool) return out0, err } // ValidatorDisputed is a free data retrieval call binding the contract method 0x7146ab67. // // Solidity: function validatorDisputed(address , uint256 ) view returns(bool) func (_WorkerHub *WorkerHubSession) ValidatorDisputed(arg0 common.Address, arg1 *big.Int) (bool, error) { return _WorkerHub.Contract.ValidatorDisputed(&_WorkerHub.CallOpts, arg0, arg1) } // ValidatorDisputed is a free data retrieval call binding the contract method 0x7146ab67. // // Solidity: function validatorDisputed(address , uint256 ) view returns(bool) func (_WorkerHub *WorkerHubCallerSession) ValidatorDisputed(arg0 common.Address, arg1 *big.Int) (bool, error) { return _WorkerHub.Contract.ValidatorDisputed(&_WorkerHub.CallOpts, arg0, arg1) } // ValidatorMinimumStake is a free data retrieval call binding the contract method 0x412f9775. // // Solidity: function validatorMinimumStake() view returns(uint256) func (_WorkerHub *WorkerHubCaller) ValidatorMinimumStake(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} err := _WorkerHub.contract.Call(opts, &out, "validatorMinimumStake") if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // ValidatorMinimumStake is a free data retrieval call binding the contract method 0x412f9775. // // Solidity: function validatorMinimumStake() view returns(uint256) func (_WorkerHub *WorkerHubSession) ValidatorMinimumStake() (*big.Int, error) { return _WorkerHub.Contract.ValidatorMinimumStake(&_WorkerHub.CallOpts) } // ValidatorMinimumStake is a free data retrieval call binding the contract method 0x412f9775. // // Solidity: function validatorMinimumStake() view returns(uint256) func (_WorkerHub *WorkerHubCallerSession) ValidatorMinimumStake() (*big.Int, error) { return _WorkerHub.Contract.ValidatorMinimumStake(&_WorkerHub.CallOpts) } // ValidatorUnstakeRequests is a free data retrieval call binding the contract method 0xfd3623f7. // // Solidity: function validatorUnstakeRequests(address ) view returns(uint256 stake, uint40 unlockAt) func (_WorkerHub *WorkerHubCaller) ValidatorUnstakeRequests(opts *bind.CallOpts, arg0 common.Address) (struct { Stake *big.Int UnlockAt *big.Int }, error) { var out []interface{} err := _WorkerHub.contract.Call(opts, &out, "validatorUnstakeRequests", arg0) outstruct := new(struct { Stake *big.Int UnlockAt *big.Int }) if err != nil { return *outstruct, err } outstruct.Stake = *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) outstruct.UnlockAt = *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) return *outstruct, err } // ValidatorUnstakeRequests is a free data retrieval call binding the contract method 0xfd3623f7. // // Solidity: function validatorUnstakeRequests(address ) view returns(uint256 stake, uint40 unlockAt) func (_WorkerHub *WorkerHubSession) ValidatorUnstakeRequests(arg0 common.Address) (struct { Stake *big.Int UnlockAt *big.Int }, error) { return _WorkerHub.Contract.ValidatorUnstakeRequests(&_WorkerHub.CallOpts, arg0) } // ValidatorUnstakeRequests is a free data retrieval call binding the contract method 0xfd3623f7. // // Solidity: function validatorUnstakeRequests(address ) view returns(uint256 stake, uint40 unlockAt) func (_WorkerHub *WorkerHubCallerSession) ValidatorUnstakeRequests(arg0 common.Address) (struct { Stake *big.Int UnlockAt *big.Int }, error) { return _WorkerHub.Contract.ValidatorUnstakeRequests(&_WorkerHub.CallOpts, arg0) } // Validators is a free data retrieval call binding the contract method 0xfa52c7d8. // // Solidity: function validators(address ) view returns(uint256 stake, uint256 commitment, address modelAddress, uint40 lastClaimedEpoch, uint40 activeTime, uint16 tier) func (_WorkerHub *WorkerHubCaller) Validators(opts *bind.CallOpts, arg0 common.Address) (struct { Stake *big.Int Commitment *big.Int ModelAddress common.Address LastClaimedEpoch *big.Int ActiveTime *big.Int Tier uint16 }, error) { var out []interface{} err := _WorkerHub.contract.Call(opts, &out, "validators", arg0) outstruct := new(struct { Stake *big.Int Commitment *big.Int ModelAddress common.Address LastClaimedEpoch *big.Int ActiveTime *big.Int Tier uint16 }) if err != nil { return *outstruct, err } outstruct.Stake = *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) outstruct.Commitment = *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) outstruct.ModelAddress = *abi.ConvertType(out[2], new(common.Address)).(*common.Address) outstruct.LastClaimedEpoch = *abi.ConvertType(out[3], new(*big.Int)).(**big.Int) outstruct.ActiveTime = *abi.ConvertType(out[4], new(*big.Int)).(**big.Int) outstruct.Tier = *abi.ConvertType(out[5], new(uint16)).(*uint16) return *outstruct, err } // Validators is a free data retrieval call binding the contract method 0xfa52c7d8. // // Solidity: function validators(address ) view returns(uint256 stake, uint256 commitment, address modelAddress, uint40 lastClaimedEpoch, uint40 activeTime, uint16 tier) func (_WorkerHub *WorkerHubSession) Validators(arg0 common.Address) (struct { Stake *big.Int Commitment *big.Int ModelAddress common.Address LastClaimedEpoch *big.Int ActiveTime *big.Int Tier uint16 }, error) { return _WorkerHub.Contract.Validators(&_WorkerHub.CallOpts, arg0) } // Validators is a free data retrieval call binding the contract method 0xfa52c7d8. // // Solidity: function validators(address ) view returns(uint256 stake, uint256 commitment, address modelAddress, uint40 lastClaimedEpoch, uint40 activeTime, uint16 tier) func (_WorkerHub *WorkerHubCallerSession) Validators(arg0 common.Address) (struct { Stake *big.Int Commitment *big.Int ModelAddress common.Address LastClaimedEpoch *big.Int ActiveTime *big.Int Tier uint16 }, error) { return _WorkerHub.Contract.Validators(&_WorkerHub.CallOpts, arg0) } // Version is a free data retrieval call binding the contract method 0x54fd4d50. // // Solidity: function version() pure returns(string) func (_WorkerHub *WorkerHubCaller) Version(opts *bind.CallOpts) (string, error) { var out []interface{} err := _WorkerHub.contract.Call(opts, &out, "version") if err != nil { return *new(string), err } out0 := *abi.ConvertType(out[0], new(string)).(*string) return out0, err } // Version is a free data retrieval call binding the contract method 0x54fd4d50. // // Solidity: function version() pure returns(string) func (_WorkerHub *WorkerHubSession) Version() (string, error) { return _WorkerHub.Contract.Version(&_WorkerHub.CallOpts) } // Version is a free data retrieval call binding the contract method 0x54fd4d50. // // Solidity: function version() pure returns(string) func (_WorkerHub *WorkerHubCallerSession) Version() (string, error) { return _WorkerHub.Contract.Version(&_WorkerHub.CallOpts) } // ClaimReward is a paid mutator transaction binding the contract method 0xd279c191. // // Solidity: function claimReward(address _miner) returns() func (_WorkerHub *WorkerHubTransactor) ClaimReward(opts *bind.TransactOpts, _miner common.Address) (*types.Transaction, error) { return _WorkerHub.contract.Transact(opts, "claimReward", _miner) } // ClaimReward is a paid mutator transaction binding the contract method 0xd279c191. // // Solidity: function claimReward(address _miner) returns() func (_WorkerHub *WorkerHubSession) ClaimReward(_miner common.Address) (*types.Transaction, error) { return _WorkerHub.Contract.ClaimReward(&_WorkerHub.TransactOpts, _miner) } // ClaimReward is a paid mutator transaction binding the contract method 0xd279c191. // // Solidity: function claimReward(address _miner) returns() func (_WorkerHub *WorkerHubTransactorSession) ClaimReward(_miner common.Address) (*types.Transaction, error) { return _WorkerHub.Contract.ClaimReward(&_WorkerHub.TransactOpts, _miner) } // DisputeInfer is a paid mutator transaction binding the contract method 0x72422748. // // Solidity: function disputeInfer(uint256 _assignmentId) returns() func (_WorkerHub *WorkerHubTransactor) DisputeInfer(opts *bind.TransactOpts, _assignmentId *big.Int) (*types.Transaction, error) { return _WorkerHub.contract.Transact(opts, "disputeInfer", _assignmentId) } // DisputeInfer is a paid mutator transaction binding the contract method 0x72422748. // // Solidity: function disputeInfer(uint256 _assignmentId) returns() func (_WorkerHub *WorkerHubSession) DisputeInfer(_assignmentId *big.Int) (*types.Transaction, error) { return _WorkerHub.Contract.DisputeInfer(&_WorkerHub.TransactOpts, _assignmentId) } // DisputeInfer is a paid mutator transaction binding the contract method 0x72422748. // // Solidity: function disputeInfer(uint256 _assignmentId) returns() func (_WorkerHub *WorkerHubTransactorSession) DisputeInfer(_assignmentId *big.Int) (*types.Transaction, error) { return _WorkerHub.Contract.DisputeInfer(&_WorkerHub.TransactOpts, _assignmentId) } // IncreaseMinerStake is a paid mutator transaction binding the contract method 0x9fb40bac. // // Solidity: function increaseMinerStake() payable returns() func (_WorkerHub *WorkerHubTransactor) IncreaseMinerStake(opts *bind.TransactOpts) (*types.Transaction, error) { return _WorkerHub.contract.Transact(opts, "increaseMinerStake") } // IncreaseMinerStake is a paid mutator transaction binding the contract method 0x9fb40bac. // // Solidity: function increaseMinerStake() payable returns() func (_WorkerHub *WorkerHubSession) IncreaseMinerStake() (*types.Transaction, error) { return _WorkerHub.Contract.IncreaseMinerStake(&_WorkerHub.TransactOpts) } // IncreaseMinerStake is a paid mutator transaction binding the contract method 0x9fb40bac. // // Solidity: function increaseMinerStake() payable returns() func (_WorkerHub *WorkerHubTransactorSession) IncreaseMinerStake() (*types.Transaction, error) { return _WorkerHub.Contract.IncreaseMinerStake(&_WorkerHub.TransactOpts) } // IncreaseValidatorStake is a paid mutator transaction binding the contract method 0x62ed5c12. // // Solidity: function increaseValidatorStake() payable returns() func (_WorkerHub *WorkerHubTransactor) IncreaseValidatorStake(opts *bind.TransactOpts) (*types.Transaction, error) { return _WorkerHub.contract.Transact(opts, "increaseValidatorStake") } // IncreaseValidatorStake is a paid mutator transaction binding the contract method 0x62ed5c12. // // Solidity: function increaseValidatorStake() payable returns() func (_WorkerHub *WorkerHubSession) IncreaseValidatorStake() (*types.Transaction, error) { return _WorkerHub.Contract.IncreaseValidatorStake(&_WorkerHub.TransactOpts) } // IncreaseValidatorStake is a paid mutator transaction binding the contract method 0x62ed5c12. // // Solidity: function increaseValidatorStake() payable returns() func (_WorkerHub *WorkerHubTransactorSession) IncreaseValidatorStake() (*types.Transaction, error) { return _WorkerHub.Contract.IncreaseValidatorStake(&_WorkerHub.TransactOpts) } // Infer is a paid mutator transaction binding the contract method 0xd9844458. // // Solidity: function infer(bytes _input, address _creator) payable returns(uint256) func (_WorkerHub *WorkerHubTransactor) Infer(opts *bind.TransactOpts, _input []byte, _creator common.Address) (*types.Transaction, error) { return _WorkerHub.contract.Transact(opts, "infer", _input, _creator) } // Infer is a paid mutator transaction binding the contract method 0xd9844458. // // Solidity: function infer(bytes _input, address _creator) payable returns(uint256) func (_WorkerHub *WorkerHubSession) Infer(_input []byte, _creator common.Address) (*types.Transaction, error) { return _WorkerHub.Contract.Infer(&_WorkerHub.TransactOpts, _input, _creator) } // Infer is a paid mutator transaction binding the contract method 0xd9844458. // // Solidity: function infer(bytes _input, address _creator) payable returns(uint256) func (_WorkerHub *WorkerHubTransactorSession) Infer(_input []byte, _creator common.Address) (*types.Transaction, error) { return _WorkerHub.Contract.Infer(&_WorkerHub.TransactOpts, _input, _creator) } // Initialize is a paid mutator transaction binding the contract method 0xab121bf3. // // Solidity: function initialize(address _treasury, uint16 _feePercentage, uint256 _minerMinimumStake, uint256 _validatorMinimumStake, uint40 _miningTimeLimit, uint8 _minerRequirement, uint256 _blocksPerEpoch, uint256 _rewardPerEpochBasedOnPerf, uint256 _rewardPerEpoch, uint40 _unstakeDelayTime, uint40 _penaltyDuration, uint16 _finePercentage) returns() func (_WorkerHub *WorkerHubTransactor) Initialize(opts *bind.TransactOpts, _treasury common.Address, _feePercentage uint16, _minerMinimumStake *big.Int, _validatorMinimumStake *big.Int, _miningTimeLimit *big.Int, _minerRequirement uint8, _blocksPerEpoch *big.Int, _rewardPerEpochBasedOnPerf *big.Int, _rewardPerEpoch *big.Int, _unstakeDelayTime *big.Int, _penaltyDuration *big.Int, _finePercentage uint16) (*types.Transaction, error) { return _WorkerHub.contract.Transact(opts, "initialize", _treasury, _feePercentage, _minerMinimumStake, _validatorMinimumStake, _miningTimeLimit, _minerRequirement, _blocksPerEpoch, _rewardPerEpochBasedOnPerf, _rewardPerEpoch, _unstakeDelayTime, _penaltyDuration, _finePercentage) } // Initialize is a paid mutator transaction binding the contract method 0xab121bf3. // // Solidity: function initialize(address _treasury, uint16 _feePercentage, uint256 _minerMinimumStake, uint256 _validatorMinimumStake, uint40 _miningTimeLimit, uint8 _minerRequirement, uint256 _blocksPerEpoch, uint256 _rewardPerEpochBasedOnPerf, uint256 _rewardPerEpoch, uint40 _unstakeDelayTime, uint40 _penaltyDuration, uint16 _finePercentage) returns() func (_WorkerHub *WorkerHubSession) Initialize(_treasury common.Address, _feePercentage uint16, _minerMinimumStake *big.Int, _validatorMinimumStake *big.Int, _miningTimeLimit *big.Int, _minerRequirement uint8, _blocksPerEpoch *big.Int, _rewardPerEpochBasedOnPerf *big.Int, _rewardPerEpoch *big.Int, _unstakeDelayTime *big.Int, _penaltyDuration *big.Int, _finePercentage uint16) (*types.Transaction, error) { return _WorkerHub.Contract.Initialize(&_WorkerHub.TransactOpts, _treasury, _feePercentage, _minerMinimumStake, _validatorMinimumStake, _miningTimeLimit, _minerRequirement, _blocksPerEpoch, _rewardPerEpochBasedOnPerf, _rewardPerEpoch, _unstakeDelayTime, _penaltyDuration, _finePercentage) } // Initialize is a paid mutator transaction binding the contract method 0xab121bf3. // // Solidity: function initialize(address _treasury, uint16 _feePercentage, uint256 _minerMinimumStake, uint256 _validatorMinimumStake, uint40 _miningTimeLimit, uint8 _minerRequirement, uint256 _blocksPerEpoch, uint256 _rewardPerEpochBasedOnPerf, uint256 _rewardPerEpoch, uint40 _unstakeDelayTime, uint40 _penaltyDuration, uint16 _finePercentage) returns() func (_WorkerHub *WorkerHubTransactorSession) Initialize(_treasury common.Address, _feePercentage uint16, _minerMinimumStake *big.Int, _validatorMinimumStake *big.Int, _miningTimeLimit *big.Int, _minerRequirement uint8, _blocksPerEpoch *big.Int, _rewardPerEpochBasedOnPerf *big.Int, _rewardPerEpoch *big.Int, _unstakeDelayTime *big.Int, _penaltyDuration *big.Int, _finePercentage uint16) (*types.Transaction, error) { return _WorkerHub.Contract.Initialize(&_WorkerHub.TransactOpts, _treasury, _feePercentage, _minerMinimumStake, _validatorMinimumStake, _miningTimeLimit, _minerRequirement, _blocksPerEpoch, _rewardPerEpochBasedOnPerf, _rewardPerEpoch, _unstakeDelayTime, _penaltyDuration, _finePercentage) } // JoinForMinting is a paid mutator transaction binding the contract method 0x1a8ef584. // // Solidity: function joinForMinting() returns() func (_WorkerHub *WorkerHubTransactor) JoinForMinting(opts *bind.TransactOpts) (*types.Transaction, error) { return _WorkerHub.contract.Transact(opts, "joinForMinting") } // JoinForMinting is a paid mutator transaction binding the contract method 0x1a8ef584. // // Solidity: function joinForMinting() returns() func (_WorkerHub *WorkerHubSession) JoinForMinting() (*types.Transaction, error) { return _WorkerHub.Contract.JoinForMinting(&_WorkerHub.TransactOpts) } // JoinForMinting is a paid mutator transaction binding the contract method 0x1a8ef584. // // Solidity: function joinForMinting() returns() func (_WorkerHub *WorkerHubTransactorSession) JoinForMinting() (*types.Transaction, error) { return _WorkerHub.Contract.JoinForMinting(&_WorkerHub.TransactOpts) } // JoinForValidating is a paid mutator transaction binding the contract method 0xea4a2cac. // // Solidity: function joinForValidating() returns() func (_WorkerHub *WorkerHubTransactor) JoinForValidating(opts *bind.TransactOpts) (*types.Transaction, error) { return _WorkerHub.contract.Transact(opts, "joinForValidating") } // JoinForValidating is a paid mutator transaction binding the contract method 0xea4a2cac. // // Solidity: function joinForValidating() returns() func (_WorkerHub *WorkerHubSession) JoinForValidating() (*types.Transaction, error) { return _WorkerHub.Contract.JoinForValidating(&_WorkerHub.TransactOpts) } // JoinForValidating is a paid mutator transaction binding the contract method 0xea4a2cac. // // Solidity: function joinForValidating() returns() func (_WorkerHub *WorkerHubTransactorSession) JoinForValidating() (*types.Transaction, error) { return _WorkerHub.Contract.JoinForValidating(&_WorkerHub.TransactOpts) } // Pause is a paid mutator transaction binding the contract method 0x8456cb59. // // Solidity: function pause() returns() func (_WorkerHub *WorkerHubTransactor) Pause(opts *bind.TransactOpts) (*types.Transaction, error) { return _WorkerHub.contract.Transact(opts, "pause") } // Pause is a paid mutator transaction binding the contract method 0x8456cb59. // // Solidity: function pause() returns() func (_WorkerHub *WorkerHubSession) Pause() (*types.Transaction, error) { return _WorkerHub.Contract.Pause(&_WorkerHub.TransactOpts) } // Pause is a paid mutator transaction binding the contract method 0x8456cb59. // // Solidity: function pause() returns() func (_WorkerHub *WorkerHubTransactorSession) Pause() (*types.Transaction, error) { return _WorkerHub.Contract.Pause(&_WorkerHub.TransactOpts) } // RegisterMiner is a paid mutator transaction binding the contract method 0x1fdadcb7. // // Solidity: function registerMiner(uint16 tier) payable returns() func (_WorkerHub *WorkerHubTransactor) RegisterMiner(opts *bind.TransactOpts, tier uint16) (*types.Transaction, error) { return _WorkerHub.contract.Transact(opts, "registerMiner", tier) } // RegisterMiner is a paid mutator transaction binding the contract method 0x1fdadcb7. // // Solidity: function registerMiner(uint16 tier) payable returns() func (_WorkerHub *WorkerHubSession) RegisterMiner(tier uint16) (*types.Transaction, error) { return _WorkerHub.Contract.RegisterMiner(&_WorkerHub.TransactOpts, tier) } // RegisterMiner is a paid mutator transaction binding the contract method 0x1fdadcb7. // // Solidity: function registerMiner(uint16 tier) payable returns() func (_WorkerHub *WorkerHubTransactorSession) RegisterMiner(tier uint16) (*types.Transaction, error) { return _WorkerHub.Contract.RegisterMiner(&_WorkerHub.TransactOpts, tier) } // RegisterModel is a paid mutator transaction binding the contract method 0xa8d6d3d1. // // Solidity: function registerModel(address _model, uint16 _tier, uint256 _minimumFee) returns() func (_WorkerHub *WorkerHubTransactor) RegisterModel(opts *bind.TransactOpts, _model common.Address, _tier uint16, _minimumFee *big.Int) (*types.Transaction, error) { return _WorkerHub.contract.Transact(opts, "registerModel", _model, _tier, _minimumFee) } // RegisterModel is a paid mutator transaction binding the contract method 0xa8d6d3d1. // // Solidity: function registerModel(address _model, uint16 _tier, uint256 _minimumFee) returns() func (_WorkerHub *WorkerHubSession) RegisterModel(_model common.Address, _tier uint16, _minimumFee *big.Int) (*types.Transaction, error) { return _WorkerHub.Contract.RegisterModel(&_WorkerHub.TransactOpts, _model, _tier, _minimumFee) } // RegisterModel is a paid mutator transaction binding the contract method 0xa8d6d3d1. // // Solidity: function registerModel(address _model, uint16 _tier, uint256 _minimumFee) returns() func (_WorkerHub *WorkerHubTransactorSession) RegisterModel(_model common.Address, _tier uint16, _minimumFee *big.Int) (*types.Transaction, error) { return _WorkerHub.Contract.RegisterModel(&_WorkerHub.TransactOpts, _model, _tier, _minimumFee) } // RegisterValidator is a paid mutator transaction binding the contract method 0x47f809e7. // // Solidity: function registerValidator(uint16 tier) payable returns() func (_WorkerHub *WorkerHubTransactor) RegisterValidator(opts *bind.TransactOpts, tier uint16) (*types.Transaction, error) { return _WorkerHub.contract.Transact(opts, "registerValidator", tier) } // RegisterValidator is a paid mutator transaction binding the contract method 0x47f809e7. // // Solidity: function registerValidator(uint16 tier) payable returns() func (_WorkerHub *WorkerHubSession) RegisterValidator(tier uint16) (*types.Transaction, error) { return _WorkerHub.Contract.RegisterValidator(&_WorkerHub.TransactOpts, tier) } // RegisterValidator is a paid mutator transaction binding the contract method 0x47f809e7. // // Solidity: function registerValidator(uint16 tier) payable returns() func (_WorkerHub *WorkerHubTransactorSession) RegisterValidator(tier uint16) (*types.Transaction, error) { return _WorkerHub.Contract.RegisterValidator(&_WorkerHub.TransactOpts, tier) } // RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. // // Solidity: function renounceOwnership() returns() func (_WorkerHub *WorkerHubTransactor) RenounceOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { return _WorkerHub.contract.Transact(opts, "renounceOwnership") } // RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. // // Solidity: function renounceOwnership() returns() func (_WorkerHub *WorkerHubSession) RenounceOwnership() (*types.Transaction, error) { return _WorkerHub.Contract.RenounceOwnership(&_WorkerHub.TransactOpts) } // RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. // // Solidity: function renounceOwnership() returns() func (_WorkerHub *WorkerHubTransactorSession) RenounceOwnership() (*types.Transaction, error) { return _WorkerHub.Contract.RenounceOwnership(&_WorkerHub.TransactOpts) } // ResolveInference is a paid mutator transaction binding the contract method 0x6029e786. // // Solidity: function resolveInference(uint256 _inferenceId) returns() func (_WorkerHub *WorkerHubTransactor) ResolveInference(opts *bind.TransactOpts, _inferenceId *big.Int) (*types.Transaction, error) { return _WorkerHub.contract.Transact(opts, "resolveInference", _inferenceId) } // ResolveInference is a paid mutator transaction binding the contract method 0x6029e786. // // Solidity: function resolveInference(uint256 _inferenceId) returns() func (_WorkerHub *WorkerHubSession) ResolveInference(_inferenceId *big.Int) (*types.Transaction, error) { return _WorkerHub.Contract.ResolveInference(&_WorkerHub.TransactOpts, _inferenceId) } // ResolveInference is a paid mutator transaction binding the contract method 0x6029e786. // // Solidity: function resolveInference(uint256 _inferenceId) returns() func (_WorkerHub *WorkerHubTransactorSession) ResolveInference(_inferenceId *big.Int) (*types.Transaction, error) { return _WorkerHub.Contract.ResolveInference(&_WorkerHub.TransactOpts, _inferenceId) } // RestakeForMiner is a paid mutator transaction binding the contract method 0x4fb9bc1e. // // Solidity: function restakeForMiner(uint16 tier) returns() func (_WorkerHub *WorkerHubTransactor) RestakeForMiner(opts *bind.TransactOpts, tier uint16) (*types.Transaction, error) { return _WorkerHub.contract.Transact(opts, "restakeForMiner", tier) } // RestakeForMiner is a paid mutator transaction binding the contract method 0x4fb9bc1e. // // Solidity: function restakeForMiner(uint16 tier) returns() func (_WorkerHub *WorkerHubSession) RestakeForMiner(tier uint16) (*types.Transaction, error) { return _WorkerHub.Contract.RestakeForMiner(&_WorkerHub.TransactOpts, tier) } // RestakeForMiner is a paid mutator transaction binding the contract method 0x4fb9bc1e. // // Solidity: function restakeForMiner(uint16 tier) returns() func (_WorkerHub *WorkerHubTransactorSession) RestakeForMiner(tier uint16) (*types.Transaction, error) { return _WorkerHub.Contract.RestakeForMiner(&_WorkerHub.TransactOpts, tier) } // RewardToClaim is a paid mutator transaction binding the contract method 0x674a63b9. // // Solidity: function rewardToClaim(address _miner) returns(uint256) func (_WorkerHub *WorkerHubTransactor) RewardToClaim(opts *bind.TransactOpts, _miner common.Address) (*types.Transaction, error) { return _WorkerHub.contract.Transact(opts, "rewardToClaim", _miner) } // RewardToClaim is a paid mutator transaction binding the contract method 0x674a63b9. // // Solidity: function rewardToClaim(address _miner) returns(uint256) func (_WorkerHub *WorkerHubSession) RewardToClaim(_miner common.Address) (*types.Transaction, error) { return _WorkerHub.Contract.RewardToClaim(&_WorkerHub.TransactOpts, _miner) } // RewardToClaim is a paid mutator transaction binding the contract method 0x674a63b9. // // Solidity: function rewardToClaim(address _miner) returns(uint256) func (_WorkerHub *WorkerHubTransactorSession) RewardToClaim(_miner common.Address) (*types.Transaction, error) { return _WorkerHub.Contract.RewardToClaim(&_WorkerHub.TransactOpts, _miner) } // SetBlocksPerEpoch is a paid mutator transaction binding the contract method 0x034438b0. // // Solidity: function setBlocksPerEpoch(uint256 _blocks) returns() func (_WorkerHub *WorkerHubTransactor) SetBlocksPerEpoch(opts *bind.TransactOpts, _blocks *big.Int) (*types.Transaction, error) { return _WorkerHub.contract.Transact(opts, "setBlocksPerEpoch", _blocks) } // SetBlocksPerEpoch is a paid mutator transaction binding the contract method 0x034438b0. // // Solidity: function setBlocksPerEpoch(uint256 _blocks) returns() func (_WorkerHub *WorkerHubSession) SetBlocksPerEpoch(_blocks *big.Int) (*types.Transaction, error) { return _WorkerHub.Contract.SetBlocksPerEpoch(&_WorkerHub.TransactOpts, _blocks) } // SetBlocksPerEpoch is a paid mutator transaction binding the contract method 0x034438b0. // // Solidity: function setBlocksPerEpoch(uint256 _blocks) returns() func (_WorkerHub *WorkerHubTransactorSession) SetBlocksPerEpoch(_blocks *big.Int) (*types.Transaction, error) { return _WorkerHub.Contract.SetBlocksPerEpoch(&_WorkerHub.TransactOpts, _blocks) } // SetFinePercentage is a paid mutator transaction binding the contract method 0x431a4457. // // Solidity: function setFinePercentage(uint16 _finePercentage) returns() func (_WorkerHub *WorkerHubTransactor) SetFinePercentage(opts *bind.TransactOpts, _finePercentage uint16) (*types.Transaction, error) { return _WorkerHub.contract.Transact(opts, "setFinePercentage", _finePercentage) } // SetFinePercentage is a paid mutator transaction binding the contract method 0x431a4457. // // Solidity: function setFinePercentage(uint16 _finePercentage) returns() func (_WorkerHub *WorkerHubSession) SetFinePercentage(_finePercentage uint16) (*types.Transaction, error) { return _WorkerHub.Contract.SetFinePercentage(&_WorkerHub.TransactOpts, _finePercentage) } // SetFinePercentage is a paid mutator transaction binding the contract method 0x431a4457. // // Solidity: function setFinePercentage(uint16 _finePercentage) returns() func (_WorkerHub *WorkerHubTransactorSession) SetFinePercentage(_finePercentage uint16) (*types.Transaction, error) { return _WorkerHub.Contract.SetFinePercentage(&_WorkerHub.TransactOpts, _finePercentage) } // SetNewRewardInEpoch is a paid mutator transaction binding the contract method 0xe32bd90c. // // Solidity: function setNewRewardInEpoch(uint256 _newRewardAmount) returns() func (_WorkerHub *WorkerHubTransactor) SetNewRewardInEpoch(opts *bind.TransactOpts, _newRewardAmount *big.Int) (*types.Transaction, error) { return _WorkerHub.contract.Transact(opts, "setNewRewardInEpoch", _newRewardAmount) } // SetNewRewardInEpoch is a paid mutator transaction binding the contract method 0xe32bd90c. // // Solidity: function setNewRewardInEpoch(uint256 _newRewardAmount) returns() func (_WorkerHub *WorkerHubSession) SetNewRewardInEpoch(_newRewardAmount *big.Int) (*types.Transaction, error) { return _WorkerHub.Contract.SetNewRewardInEpoch(&_WorkerHub.TransactOpts, _newRewardAmount) } // SetNewRewardInEpoch is a paid mutator transaction binding the contract method 0xe32bd90c. // // Solidity: function setNewRewardInEpoch(uint256 _newRewardAmount) returns() func (_WorkerHub *WorkerHubTransactorSession) SetNewRewardInEpoch(_newRewardAmount *big.Int) (*types.Transaction, error) { return _WorkerHub.Contract.SetNewRewardInEpoch(&_WorkerHub.TransactOpts, _newRewardAmount) } // SetPenaltyDuration is a paid mutator transaction binding the contract method 0x885b050f. // // Solidity: function setPenaltyDuration(uint40 _penaltyDuration) returns() func (_WorkerHub *WorkerHubTransactor) SetPenaltyDuration(opts *bind.TransactOpts, _penaltyDuration *big.Int) (*types.Transaction, error) { return _WorkerHub.contract.Transact(opts, "setPenaltyDuration", _penaltyDuration) } // SetPenaltyDuration is a paid mutator transaction binding the contract method 0x885b050f. // // Solidity: function setPenaltyDuration(uint40 _penaltyDuration) returns() func (_WorkerHub *WorkerHubSession) SetPenaltyDuration(_penaltyDuration *big.Int) (*types.Transaction, error) { return _WorkerHub.Contract.SetPenaltyDuration(&_WorkerHub.TransactOpts, _penaltyDuration) } // SetPenaltyDuration is a paid mutator transaction binding the contract method 0x885b050f. // // Solidity: function setPenaltyDuration(uint40 _penaltyDuration) returns() func (_WorkerHub *WorkerHubTransactorSession) SetPenaltyDuration(_penaltyDuration *big.Int) (*types.Transaction, error) { return _WorkerHub.Contract.SetPenaltyDuration(&_WorkerHub.TransactOpts, _penaltyDuration) } // SetUnstakDelayTime is a paid mutator transaction binding the contract method 0x351b2b33. // // Solidity: function setUnstakDelayTime(uint40 _newUnstakeDelayTime) returns() func (_WorkerHub *WorkerHubTransactor) SetUnstakDelayTime(opts *bind.TransactOpts, _newUnstakeDelayTime *big.Int) (*types.Transaction, error) { return _WorkerHub.contract.Transact(opts, "setUnstakDelayTime", _newUnstakeDelayTime) } // SetUnstakDelayTime is a paid mutator transaction binding the contract method 0x351b2b33. // // Solidity: function setUnstakDelayTime(uint40 _newUnstakeDelayTime) returns() func (_WorkerHub *WorkerHubSession) SetUnstakDelayTime(_newUnstakeDelayTime *big.Int) (*types.Transaction, error) { return _WorkerHub.Contract.SetUnstakDelayTime(&_WorkerHub.TransactOpts, _newUnstakeDelayTime) } // SetUnstakDelayTime is a paid mutator transaction binding the contract method 0x351b2b33. // // Solidity: function setUnstakDelayTime(uint40 _newUnstakeDelayTime) returns() func (_WorkerHub *WorkerHubTransactorSession) SetUnstakDelayTime(_newUnstakeDelayTime *big.Int) (*types.Transaction, error) { return _WorkerHub.Contract.SetUnstakDelayTime(&_WorkerHub.TransactOpts, _newUnstakeDelayTime) } // SlashMiner is a paid mutator transaction binding the contract method 0x969ceab4. // // Solidity: function slashMiner(address _miner, bool _isFined) returns() func (_WorkerHub *WorkerHubTransactor) SlashMiner(opts *bind.TransactOpts, _miner common.Address, _isFined bool) (*types.Transaction, error) { return _WorkerHub.contract.Transact(opts, "slashMiner", _miner, _isFined) } // SlashMiner is a paid mutator transaction binding the contract method 0x969ceab4. // // Solidity: function slashMiner(address _miner, bool _isFined) returns() func (_WorkerHub *WorkerHubSession) SlashMiner(_miner common.Address, _isFined bool) (*types.Transaction, error) { return _WorkerHub.Contract.SlashMiner(&_WorkerHub.TransactOpts, _miner, _isFined) } // SlashMiner is a paid mutator transaction binding the contract method 0x969ceab4. // // Solidity: function slashMiner(address _miner, bool _isFined) returns() func (_WorkerHub *WorkerHubTransactorSession) SlashMiner(_miner common.Address, _isFined bool) (*types.Transaction, error) { return _WorkerHub.Contract.SlashMiner(&_WorkerHub.TransactOpts, _miner, _isFined) } // SubmitSolution is a paid mutator transaction binding the contract method 0xe84dee6b. // // Solidity: function submitSolution(uint256 _assigmentId, bytes _data) returns() func (_WorkerHub *WorkerHubTransactor) SubmitSolution(opts *bind.TransactOpts, _assigmentId *big.Int, _data []byte) (*types.Transaction, error) { return _WorkerHub.contract.Transact(opts, "submitSolution", _assigmentId, _data) } // SubmitSolution is a paid mutator transaction binding the contract method 0xe84dee6b. // // Solidity: function submitSolution(uint256 _assigmentId, bytes _data) returns() func (_WorkerHub *WorkerHubSession) SubmitSolution(_assigmentId *big.Int, _data []byte) (*types.Transaction, error) { return _WorkerHub.Contract.SubmitSolution(&_WorkerHub.TransactOpts, _assigmentId, _data) } // SubmitSolution is a paid mutator transaction binding the contract method 0xe84dee6b. // // Solidity: function submitSolution(uint256 _assigmentId, bytes _data) returns() func (_WorkerHub *WorkerHubTransactorSession) SubmitSolution(_assigmentId *big.Int, _data []byte) (*types.Transaction, error) { return _WorkerHub.Contract.SubmitSolution(&_WorkerHub.TransactOpts, _assigmentId, _data) } // TopUpInfer is a paid mutator transaction binding the contract method 0xe9bd0e26. // // Solidity: function topUpInfer(uint256 _inferenceId) payable returns() func (_WorkerHub *WorkerHubTransactor) TopUpInfer(opts *bind.TransactOpts, _inferenceId *big.Int) (*types.Transaction, error) { return _WorkerHub.contract.Transact(opts, "topUpInfer", _inferenceId) } // TopUpInfer is a paid mutator transaction binding the contract method 0xe9bd0e26. // // Solidity: function topUpInfer(uint256 _inferenceId) payable returns() func (_WorkerHub *WorkerHubSession) TopUpInfer(_inferenceId *big.Int) (*types.Transaction, error) { return _WorkerHub.Contract.TopUpInfer(&_WorkerHub.TransactOpts, _inferenceId) } // TopUpInfer is a paid mutator transaction binding the contract method 0xe9bd0e26. // // Solidity: function topUpInfer(uint256 _inferenceId) payable returns() func (_WorkerHub *WorkerHubTransactorSession) TopUpInfer(_inferenceId *big.Int) (*types.Transaction, error) { return _WorkerHub.Contract.TopUpInfer(&_WorkerHub.TransactOpts, _inferenceId) } // TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. // // Solidity: function transferOwnership(address newOwner) returns() func (_WorkerHub *WorkerHubTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) { return _WorkerHub.contract.Transact(opts, "transferOwnership", newOwner) } // TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. // // Solidity: function transferOwnership(address newOwner) returns() func (_WorkerHub *WorkerHubSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { return _WorkerHub.Contract.TransferOwnership(&_WorkerHub.TransactOpts, newOwner) } // TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. // // Solidity: function transferOwnership(address newOwner) returns() func (_WorkerHub *WorkerHubTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { return _WorkerHub.Contract.TransferOwnership(&_WorkerHub.TransactOpts, newOwner) } // Unpause is a paid mutator transaction binding the contract method 0x3f4ba83a. // // Solidity: function unpause() returns() func (_WorkerHub *WorkerHubTransactor) Unpause(opts *bind.TransactOpts) (*types.Transaction, error) { return _WorkerHub.contract.Transact(opts, "unpause") } // Unpause is a paid mutator transaction binding the contract method 0x3f4ba83a. // // Solidity: function unpause() returns() func (_WorkerHub *WorkerHubSession) Unpause() (*types.Transaction, error) { return _WorkerHub.Contract.Unpause(&_WorkerHub.TransactOpts) } // Unpause is a paid mutator transaction binding the contract method 0x3f4ba83a. // // Solidity: function unpause() returns() func (_WorkerHub *WorkerHubTransactorSession) Unpause() (*types.Transaction, error) { return _WorkerHub.Contract.Unpause(&_WorkerHub.TransactOpts) } // UnregisterMiner is a paid mutator transaction binding the contract method 0x656a1b20. // // Solidity: function unregisterMiner() returns() func (_WorkerHub *WorkerHubTransactor) UnregisterMiner(opts *bind.TransactOpts) (*types.Transaction, error) { return _WorkerHub.contract.Transact(opts, "unregisterMiner") } // UnregisterMiner is a paid mutator transaction binding the contract method 0x656a1b20. // // Solidity: function unregisterMiner() returns() func (_WorkerHub *WorkerHubSession) UnregisterMiner() (*types.Transaction, error) { return _WorkerHub.Contract.UnregisterMiner(&_WorkerHub.TransactOpts) } // UnregisterMiner is a paid mutator transaction binding the contract method 0x656a1b20. // // Solidity: function unregisterMiner() returns() func (_WorkerHub *WorkerHubTransactorSession) UnregisterMiner() (*types.Transaction, error) { return _WorkerHub.Contract.UnregisterMiner(&_WorkerHub.TransactOpts) } // UnregisterModel is a paid mutator transaction binding the contract method 0xdb2dab1d. // // Solidity: function unregisterModel(address _model) returns() func (_WorkerHub *WorkerHubTransactor) UnregisterModel(opts *bind.TransactOpts, _model common.Address) (*types.Transaction, error) { return _WorkerHub.contract.Transact(opts, "unregisterModel", _model) } // UnregisterModel is a paid mutator transaction binding the contract method 0xdb2dab1d. // // Solidity: function unregisterModel(address _model) returns() func (_WorkerHub *WorkerHubSession) UnregisterModel(_model common.Address) (*types.Transaction, error) { return _WorkerHub.Contract.UnregisterModel(&_WorkerHub.TransactOpts, _model) } // UnregisterModel is a paid mutator transaction binding the contract method 0xdb2dab1d. // // Solidity: function unregisterModel(address _model) returns() func (_WorkerHub *WorkerHubTransactorSession) UnregisterModel(_model common.Address) (*types.Transaction, error) { return _WorkerHub.Contract.UnregisterModel(&_WorkerHub.TransactOpts, _model) } // UnregisterValidator is a paid mutator transaction binding the contract method 0x6ca56267. // // Solidity: function unregisterValidator() returns() func (_WorkerHub *WorkerHubTransactor) UnregisterValidator(opts *bind.TransactOpts) (*types.Transaction, error) { return _WorkerHub.contract.Transact(opts, "unregisterValidator") } // UnregisterValidator is a paid mutator transaction binding the contract method 0x6ca56267. // // Solidity: function unregisterValidator() returns() func (_WorkerHub *WorkerHubSession) UnregisterValidator() (*types.Transaction, error) { return _WorkerHub.Contract.UnregisterValidator(&_WorkerHub.TransactOpts) } // UnregisterValidator is a paid mutator transaction binding the contract method 0x6ca56267. // // Solidity: function unregisterValidator() returns() func (_WorkerHub *WorkerHubTransactorSession) UnregisterValidator() (*types.Transaction, error) { return _WorkerHub.Contract.UnregisterValidator(&_WorkerHub.TransactOpts) } // UnstakeForMiner is a paid mutator transaction binding the contract method 0x73df250d. // // Solidity: function unstakeForMiner() returns() func (_WorkerHub *WorkerHubTransactor) UnstakeForMiner(opts *bind.TransactOpts) (*types.Transaction, error) { return _WorkerHub.contract.Transact(opts, "unstakeForMiner") } // UnstakeForMiner is a paid mutator transaction binding the contract method 0x73df250d. // // Solidity: function unstakeForMiner() returns() func (_WorkerHub *WorkerHubSession) UnstakeForMiner() (*types.Transaction, error) { return _WorkerHub.Contract.UnstakeForMiner(&_WorkerHub.TransactOpts) } // UnstakeForMiner is a paid mutator transaction binding the contract method 0x73df250d. // // Solidity: function unstakeForMiner() returns() func (_WorkerHub *WorkerHubTransactorSession) UnstakeForMiner() (*types.Transaction, error) { return _WorkerHub.Contract.UnstakeForMiner(&_WorkerHub.TransactOpts) } // UnstakeForValidator is a paid mutator transaction binding the contract method 0x42b093cf. // // Solidity: function unstakeForValidator() returns() func (_WorkerHub *WorkerHubTransactor) UnstakeForValidator(opts *bind.TransactOpts) (*types.Transaction, error) { return _WorkerHub.contract.Transact(opts, "unstakeForValidator") } // UnstakeForValidator is a paid mutator transaction binding the contract method 0x42b093cf. // // Solidity: function unstakeForValidator() returns() func (_WorkerHub *WorkerHubSession) UnstakeForValidator() (*types.Transaction, error) { return _WorkerHub.Contract.UnstakeForValidator(&_WorkerHub.TransactOpts) } // UnstakeForValidator is a paid mutator transaction binding the contract method 0x42b093cf. // // Solidity: function unstakeForValidator() returns() func (_WorkerHub *WorkerHubTransactorSession) UnstakeForValidator() (*types.Transaction, error) { return _WorkerHub.Contract.UnstakeForValidator(&_WorkerHub.TransactOpts) } // UpdateMiningTimeLimit is a paid mutator transaction binding the contract method 0x34193a4a. // // Solidity: function updateMiningTimeLimit(uint40 _miningTimeLimit) returns() func (_WorkerHub *WorkerHubTransactor) UpdateMiningTimeLimit(opts *bind.TransactOpts, _miningTimeLimit *big.Int) (*types.Transaction, error) { return _WorkerHub.contract.Transact(opts, "updateMiningTimeLimit", _miningTimeLimit) } // UpdateMiningTimeLimit is a paid mutator transaction binding the contract method 0x34193a4a. // // Solidity: function updateMiningTimeLimit(uint40 _miningTimeLimit) returns() func (_WorkerHub *WorkerHubSession) UpdateMiningTimeLimit(_miningTimeLimit *big.Int) (*types.Transaction, error) { return _WorkerHub.Contract.UpdateMiningTimeLimit(&_WorkerHub.TransactOpts, _miningTimeLimit) } // UpdateMiningTimeLimit is a paid mutator transaction binding the contract method 0x34193a4a. // // Solidity: function updateMiningTimeLimit(uint40 _miningTimeLimit) returns() func (_WorkerHub *WorkerHubTransactorSession) UpdateMiningTimeLimit(_miningTimeLimit *big.Int) (*types.Transaction, error) { return _WorkerHub.Contract.UpdateMiningTimeLimit(&_WorkerHub.TransactOpts, _miningTimeLimit) } // UpdateModelMinimumFee is a paid mutator transaction binding the contract method 0xb74cd194. // // Solidity: function updateModelMinimumFee(address _model, uint256 _minimumFee) returns() func (_WorkerHub *WorkerHubTransactor) UpdateModelMinimumFee(opts *bind.TransactOpts, _model common.Address, _minimumFee *big.Int) (*types.Transaction, error) { return _WorkerHub.contract.Transact(opts, "updateModelMinimumFee", _model, _minimumFee) } // UpdateModelMinimumFee is a paid mutator transaction binding the contract method 0xb74cd194. // // Solidity: function updateModelMinimumFee(address _model, uint256 _minimumFee) returns() func (_WorkerHub *WorkerHubSession) UpdateModelMinimumFee(_model common.Address, _minimumFee *big.Int) (*types.Transaction, error) { return _WorkerHub.Contract.UpdateModelMinimumFee(&_WorkerHub.TransactOpts, _model, _minimumFee) } // UpdateModelMinimumFee is a paid mutator transaction binding the contract method 0xb74cd194. // // Solidity: function updateModelMinimumFee(address _model, uint256 _minimumFee) returns() func (_WorkerHub *WorkerHubTransactorSession) UpdateModelMinimumFee(_model common.Address, _minimumFee *big.Int) (*types.Transaction, error) { return _WorkerHub.Contract.UpdateModelMinimumFee(&_WorkerHub.TransactOpts, _model, _minimumFee) } // UpdateModelTier is a paid mutator transaction binding the contract method 0x0738a9bb. // // Solidity: function updateModelTier(address _model, uint32 _tier) returns() func (_WorkerHub *WorkerHubTransactor) UpdateModelTier(opts *bind.TransactOpts, _model common.Address, _tier uint32) (*types.Transaction, error) { return _WorkerHub.contract.Transact(opts, "updateModelTier", _model, _tier) } // UpdateModelTier is a paid mutator transaction binding the contract method 0x0738a9bb. // // Solidity: function updateModelTier(address _model, uint32 _tier) returns() func (_WorkerHub *WorkerHubSession) UpdateModelTier(_model common.Address, _tier uint32) (*types.Transaction, error) { return _WorkerHub.Contract.UpdateModelTier(&_WorkerHub.TransactOpts, _model, _tier) } // UpdateModelTier is a paid mutator transaction binding the contract method 0x0738a9bb. // // Solidity: function updateModelTier(address _model, uint32 _tier) returns() func (_WorkerHub *WorkerHubTransactorSession) UpdateModelTier(_model common.Address, _tier uint32) (*types.Transaction, error) { return _WorkerHub.Contract.UpdateModelTier(&_WorkerHub.TransactOpts, _model, _tier) } // Receive is a paid mutator transaction binding the contract receive function. // // Solidity: receive() payable returns() func (_WorkerHub *WorkerHubTransactor) Receive(opts *bind.TransactOpts) (*types.Transaction, error) { return _WorkerHub.contract.RawTransact(opts, nil) // calldata is disallowed for receive function } // Receive is a paid mutator transaction binding the contract receive function. // // Solidity: receive() payable returns() func (_WorkerHub *WorkerHubSession) Receive() (*types.Transaction, error) { return _WorkerHub.Contract.Receive(&_WorkerHub.TransactOpts) } // Receive is a paid mutator transaction binding the contract receive function. // // Solidity: receive() payable returns() func (_WorkerHub *WorkerHubTransactorSession) Receive() (*types.Transaction, error) { return _WorkerHub.Contract.Receive(&_WorkerHub.TransactOpts) } // WorkerHubBlocksPerEpochIterator is returned from FilterBlocksPerEpoch and is used to iterate over the raw logs and unpacked data for BlocksPerEpoch events raised by the WorkerHub contract. type WorkerHubBlocksPerEpochIterator struct { Event *WorkerHubBlocksPerEpoch // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *WorkerHubBlocksPerEpochIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(WorkerHubBlocksPerEpoch) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(WorkerHubBlocksPerEpoch) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *WorkerHubBlocksPerEpochIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *WorkerHubBlocksPerEpochIterator) Close() error { it.sub.Unsubscribe() return nil } // WorkerHubBlocksPerEpoch represents a BlocksPerEpoch event raised by the WorkerHub contract. type WorkerHubBlocksPerEpoch struct { OldBlocks *big.Int NewBlocks *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterBlocksPerEpoch is a free log retrieval operation binding the contract event 0x3179ee2c3011a36d6d80a4b422f208df28ef9493d1d9ce1555b3116bd26ddb3d. // // Solidity: event BlocksPerEpoch(uint256 oldBlocks, uint256 newBlocks) func (_WorkerHub *WorkerHubFilterer) FilterBlocksPerEpoch(opts *bind.FilterOpts) (*WorkerHubBlocksPerEpochIterator, error) { logs, sub, err := _WorkerHub.contract.FilterLogs(opts, "BlocksPerEpoch") if err != nil { return nil, err } return &WorkerHubBlocksPerEpochIterator{contract: _WorkerHub.contract, event: "BlocksPerEpoch", logs: logs, sub: sub}, nil } // WatchBlocksPerEpoch is a free log subscription operation binding the contract event 0x3179ee2c3011a36d6d80a4b422f208df28ef9493d1d9ce1555b3116bd26ddb3d. // // Solidity: event BlocksPerEpoch(uint256 oldBlocks, uint256 newBlocks) func (_WorkerHub *WorkerHubFilterer) WatchBlocksPerEpoch(opts *bind.WatchOpts, sink chan<- *WorkerHubBlocksPerEpoch) (event.Subscription, error) { logs, sub, err := _WorkerHub.contract.WatchLogs(opts, "BlocksPerEpoch") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(WorkerHubBlocksPerEpoch) if err := _WorkerHub.contract.UnpackLog(event, "BlocksPerEpoch", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseBlocksPerEpoch is a log parse operation binding the contract event 0x3179ee2c3011a36d6d80a4b422f208df28ef9493d1d9ce1555b3116bd26ddb3d. // // Solidity: event BlocksPerEpoch(uint256 oldBlocks, uint256 newBlocks) func (_WorkerHub *WorkerHubFilterer) ParseBlocksPerEpoch(log types.Log) (*WorkerHubBlocksPerEpoch, error) { event := new(WorkerHubBlocksPerEpoch) if err := _WorkerHub.contract.UnpackLog(event, "BlocksPerEpoch", log); err != nil { return nil, err } event.Raw = log return event, nil } // WorkerHubFinePercentageUpdatedIterator is returned from FilterFinePercentageUpdated and is used to iterate over the raw logs and unpacked data for FinePercentageUpdated events raised by the WorkerHub contract. type WorkerHubFinePercentageUpdatedIterator struct { Event *WorkerHubFinePercentageUpdated // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *WorkerHubFinePercentageUpdatedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(WorkerHubFinePercentageUpdated) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(WorkerHubFinePercentageUpdated) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *WorkerHubFinePercentageUpdatedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *WorkerHubFinePercentageUpdatedIterator) Close() error { it.sub.Unsubscribe() return nil } // WorkerHubFinePercentageUpdated represents a FinePercentageUpdated event raised by the WorkerHub contract. type WorkerHubFinePercentageUpdated struct { OldPercent uint16 NewPercent uint16 Raw types.Log // Blockchain specific contextual infos } // FilterFinePercentageUpdated is a free log retrieval operation binding the contract event 0xcf2ba21ec685fb1baf4b5e5df96fd2da47ab299e7d95e586c7898f114b6c1269. // // Solidity: event FinePercentageUpdated(uint16 oldPercent, uint16 newPercent) func (_WorkerHub *WorkerHubFilterer) FilterFinePercentageUpdated(opts *bind.FilterOpts) (*WorkerHubFinePercentageUpdatedIterator, error) { logs, sub, err := _WorkerHub.contract.FilterLogs(opts, "FinePercentageUpdated") if err != nil { return nil, err } return &WorkerHubFinePercentageUpdatedIterator{contract: _WorkerHub.contract, event: "FinePercentageUpdated", logs: logs, sub: sub}, nil } // WatchFinePercentageUpdated is a free log subscription operation binding the contract event 0xcf2ba21ec685fb1baf4b5e5df96fd2da47ab299e7d95e586c7898f114b6c1269. // // Solidity: event FinePercentageUpdated(uint16 oldPercent, uint16 newPercent) func (_WorkerHub *WorkerHubFilterer) WatchFinePercentageUpdated(opts *bind.WatchOpts, sink chan<- *WorkerHubFinePercentageUpdated) (event.Subscription, error) { logs, sub, err := _WorkerHub.contract.WatchLogs(opts, "FinePercentageUpdated") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(WorkerHubFinePercentageUpdated) if err := _WorkerHub.contract.UnpackLog(event, "FinePercentageUpdated", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseFinePercentageUpdated is a log parse operation binding the contract event 0xcf2ba21ec685fb1baf4b5e5df96fd2da47ab299e7d95e586c7898f114b6c1269. // // Solidity: event FinePercentageUpdated(uint16 oldPercent, uint16 newPercent) func (_WorkerHub *WorkerHubFilterer) ParseFinePercentageUpdated(log types.Log) (*WorkerHubFinePercentageUpdated, error) { event := new(WorkerHubFinePercentageUpdated) if err := _WorkerHub.contract.UnpackLog(event, "FinePercentageUpdated", log); err != nil { return nil, err } event.Raw = log return event, nil } // WorkerHubFraudulentMinerPenalizedIterator is returned from FilterFraudulentMinerPenalized and is used to iterate over the raw logs and unpacked data for FraudulentMinerPenalized events raised by the WorkerHub contract. type WorkerHubFraudulentMinerPenalizedIterator struct { Event *WorkerHubFraudulentMinerPenalized // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *WorkerHubFraudulentMinerPenalizedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(WorkerHubFraudulentMinerPenalized) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(WorkerHubFraudulentMinerPenalized) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *WorkerHubFraudulentMinerPenalizedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *WorkerHubFraudulentMinerPenalizedIterator) Close() error { it.sub.Unsubscribe() return nil } // WorkerHubFraudulentMinerPenalized represents a FraudulentMinerPenalized event raised by the WorkerHub contract. type WorkerHubFraudulentMinerPenalized struct { Miner common.Address ModelAddress common.Address Treasury common.Address Fine *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterFraudulentMinerPenalized is a free log retrieval operation binding the contract event 0x63a49f9cdfcfe1fddc8bd7a881449dc97b664e888be5c2fdee7ca4a70b447e43. // // Solidity: event FraudulentMinerPenalized(address indexed miner, address indexed modelAddress, address indexed treasury, uint256 fine) func (_WorkerHub *WorkerHubFilterer) FilterFraudulentMinerPenalized(opts *bind.FilterOpts, miner []common.Address, modelAddress []common.Address, treasury []common.Address) (*WorkerHubFraudulentMinerPenalizedIterator, error) { var minerRule []interface{} for _, minerItem := range miner { minerRule = append(minerRule, minerItem) } var modelAddressRule []interface{} for _, modelAddressItem := range modelAddress { modelAddressRule = append(modelAddressRule, modelAddressItem) } var treasuryRule []interface{} for _, treasuryItem := range treasury { treasuryRule = append(treasuryRule, treasuryItem) } logs, sub, err := _WorkerHub.contract.FilterLogs(opts, "FraudulentMinerPenalized", minerRule, modelAddressRule, treasuryRule) if err != nil { return nil, err } return &WorkerHubFraudulentMinerPenalizedIterator{contract: _WorkerHub.contract, event: "FraudulentMinerPenalized", logs: logs, sub: sub}, nil } // WatchFraudulentMinerPenalized is a free log subscription operation binding the contract event 0x63a49f9cdfcfe1fddc8bd7a881449dc97b664e888be5c2fdee7ca4a70b447e43. // // Solidity: event FraudulentMinerPenalized(address indexed miner, address indexed modelAddress, address indexed treasury, uint256 fine) func (_WorkerHub *WorkerHubFilterer) WatchFraudulentMinerPenalized(opts *bind.WatchOpts, sink chan<- *WorkerHubFraudulentMinerPenalized, miner []common.Address, modelAddress []common.Address, treasury []common.Address) (event.Subscription, error) { var minerRule []interface{} for _, minerItem := range miner { minerRule = append(minerRule, minerItem) } var modelAddressRule []interface{} for _, modelAddressItem := range modelAddress { modelAddressRule = append(modelAddressRule, modelAddressItem) } var treasuryRule []interface{} for _, treasuryItem := range treasury { treasuryRule = append(treasuryRule, treasuryItem) } logs, sub, err := _WorkerHub.contract.WatchLogs(opts, "FraudulentMinerPenalized", minerRule, modelAddressRule, treasuryRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(WorkerHubFraudulentMinerPenalized) if err := _WorkerHub.contract.UnpackLog(event, "FraudulentMinerPenalized", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseFraudulentMinerPenalized is a log parse operation binding the contract event 0x63a49f9cdfcfe1fddc8bd7a881449dc97b664e888be5c2fdee7ca4a70b447e43. // // Solidity: event FraudulentMinerPenalized(address indexed miner, address indexed modelAddress, address indexed treasury, uint256 fine) func (_WorkerHub *WorkerHubFilterer) ParseFraudulentMinerPenalized(log types.Log) (*WorkerHubFraudulentMinerPenalized, error) { event := new(WorkerHubFraudulentMinerPenalized) if err := _WorkerHub.contract.UnpackLog(event, "FraudulentMinerPenalized", log); err != nil { return nil, err } event.Raw = log return event, nil } // WorkerHubInferenceDisputationIterator is returned from FilterInferenceDisputation and is used to iterate over the raw logs and unpacked data for InferenceDisputation events raised by the WorkerHub contract. type WorkerHubInferenceDisputationIterator struct { Event *WorkerHubInferenceDisputation // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *WorkerHubInferenceDisputationIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(WorkerHubInferenceDisputation) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(WorkerHubInferenceDisputation) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *WorkerHubInferenceDisputationIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *WorkerHubInferenceDisputationIterator) Close() error { it.sub.Unsubscribe() return nil } // WorkerHubInferenceDisputation represents a InferenceDisputation event raised by the WorkerHub contract. type WorkerHubInferenceDisputation struct { Validator common.Address AssigmentId *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterInferenceDisputation is a free log retrieval operation binding the contract event 0x7a35142f149dfe3f5cd7125e68104edcde63a29e539db29b23cf0823512dec9c. // // Solidity: event InferenceDisputation(address indexed validator, uint256 indexed assigmentId) func (_WorkerHub *WorkerHubFilterer) FilterInferenceDisputation(opts *bind.FilterOpts, validator []common.Address, assigmentId []*big.Int) (*WorkerHubInferenceDisputationIterator, error) { var validatorRule []interface{} for _, validatorItem := range validator { validatorRule = append(validatorRule, validatorItem) } var assigmentIdRule []interface{} for _, assigmentIdItem := range assigmentId { assigmentIdRule = append(assigmentIdRule, assigmentIdItem) } logs, sub, err := _WorkerHub.contract.FilterLogs(opts, "InferenceDisputation", validatorRule, assigmentIdRule) if err != nil { return nil, err } return &WorkerHubInferenceDisputationIterator{contract: _WorkerHub.contract, event: "InferenceDisputation", logs: logs, sub: sub}, nil } // WatchInferenceDisputation is a free log subscription operation binding the contract event 0x7a35142f149dfe3f5cd7125e68104edcde63a29e539db29b23cf0823512dec9c. // // Solidity: event InferenceDisputation(address indexed validator, uint256 indexed assigmentId) func (_WorkerHub *WorkerHubFilterer) WatchInferenceDisputation(opts *bind.WatchOpts, sink chan<- *WorkerHubInferenceDisputation, validator []common.Address, assigmentId []*big.Int) (event.Subscription, error) { var validatorRule []interface{} for _, validatorItem := range validator { validatorRule = append(validatorRule, validatorItem) } var assigmentIdRule []interface{} for _, assigmentIdItem := range assigmentId { assigmentIdRule = append(assigmentIdRule, assigmentIdItem) } logs, sub, err := _WorkerHub.contract.WatchLogs(opts, "InferenceDisputation", validatorRule, assigmentIdRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(WorkerHubInferenceDisputation) if err := _WorkerHub.contract.UnpackLog(event, "InferenceDisputation", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseInferenceDisputation is a log parse operation binding the contract event 0x7a35142f149dfe3f5cd7125e68104edcde63a29e539db29b23cf0823512dec9c. // // Solidity: event InferenceDisputation(address indexed validator, uint256 indexed assigmentId) func (_WorkerHub *WorkerHubFilterer) ParseInferenceDisputation(log types.Log) (*WorkerHubInferenceDisputation, error) { event := new(WorkerHubInferenceDisputation) if err := _WorkerHub.contract.UnpackLog(event, "InferenceDisputation", log); err != nil { return nil, err } event.Raw = log return event, nil } // WorkerHubInferenceStatusUpdateIterator is returned from FilterInferenceStatusUpdate and is used to iterate over the raw logs and unpacked data for InferenceStatusUpdate events raised by the WorkerHub contract. type WorkerHubInferenceStatusUpdateIterator struct { Event *WorkerHubInferenceStatusUpdate // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *WorkerHubInferenceStatusUpdateIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(WorkerHubInferenceStatusUpdate) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(WorkerHubInferenceStatusUpdate) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *WorkerHubInferenceStatusUpdateIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *WorkerHubInferenceStatusUpdateIterator) Close() error { it.sub.Unsubscribe() return nil } // WorkerHubInferenceStatusUpdate represents a InferenceStatusUpdate event raised by the WorkerHub contract. type WorkerHubInferenceStatusUpdate struct { InferenceId *big.Int NewStatus uint8 Raw types.Log // Blockchain specific contextual infos } // FilterInferenceStatusUpdate is a free log retrieval operation binding the contract event 0xbc645ece538d7606c8ac26de30aef5fbd0ed2ee0c945f4e5d860da3e62781d50. // // Solidity: event InferenceStatusUpdate(uint256 indexed inferenceId, uint8 newStatus) func (_WorkerHub *WorkerHubFilterer) FilterInferenceStatusUpdate(opts *bind.FilterOpts, inferenceId []*big.Int) (*WorkerHubInferenceStatusUpdateIterator, error) { var inferenceIdRule []interface{} for _, inferenceIdItem := range inferenceId { inferenceIdRule = append(inferenceIdRule, inferenceIdItem) } logs, sub, err := _WorkerHub.contract.FilterLogs(opts, "InferenceStatusUpdate", inferenceIdRule) if err != nil { return nil, err } return &WorkerHubInferenceStatusUpdateIterator{contract: _WorkerHub.contract, event: "InferenceStatusUpdate", logs: logs, sub: sub}, nil } // WatchInferenceStatusUpdate is a free log subscription operation binding the contract event 0xbc645ece538d7606c8ac26de30aef5fbd0ed2ee0c945f4e5d860da3e62781d50. // // Solidity: event InferenceStatusUpdate(uint256 indexed inferenceId, uint8 newStatus) func (_WorkerHub *WorkerHubFilterer) WatchInferenceStatusUpdate(opts *bind.WatchOpts, sink chan<- *WorkerHubInferenceStatusUpdate, inferenceId []*big.Int) (event.Subscription, error) { var inferenceIdRule []interface{} for _, inferenceIdItem := range inferenceId { inferenceIdRule = append(inferenceIdRule, inferenceIdItem) } logs, sub, err := _WorkerHub.contract.WatchLogs(opts, "InferenceStatusUpdate", inferenceIdRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(WorkerHubInferenceStatusUpdate) if err := _WorkerHub.contract.UnpackLog(event, "InferenceStatusUpdate", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseInferenceStatusUpdate is a log parse operation binding the contract event 0xbc645ece538d7606c8ac26de30aef5fbd0ed2ee0c945f4e5d860da3e62781d50. // // Solidity: event InferenceStatusUpdate(uint256 indexed inferenceId, uint8 newStatus) func (_WorkerHub *WorkerHubFilterer) ParseInferenceStatusUpdate(log types.Log) (*WorkerHubInferenceStatusUpdate, error) { event := new(WorkerHubInferenceStatusUpdate) if err := _WorkerHub.contract.UnpackLog(event, "InferenceStatusUpdate", log); err != nil { return nil, err } event.Raw = log return event, nil } // WorkerHubInitializedIterator is returned from FilterInitialized and is used to iterate over the raw logs and unpacked data for Initialized events raised by the WorkerHub contract. type WorkerHubInitializedIterator struct { Event *WorkerHubInitialized // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *WorkerHubInitializedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(WorkerHubInitialized) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(WorkerHubInitialized) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *WorkerHubInitializedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *WorkerHubInitializedIterator) Close() error { it.sub.Unsubscribe() return nil } // WorkerHubInitialized represents a Initialized event raised by the WorkerHub contract. type WorkerHubInitialized struct { Version uint8 Raw types.Log // Blockchain specific contextual infos } // FilterInitialized is a free log retrieval operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. // // Solidity: event Initialized(uint8 version) func (_WorkerHub *WorkerHubFilterer) FilterInitialized(opts *bind.FilterOpts) (*WorkerHubInitializedIterator, error) { logs, sub, err := _WorkerHub.contract.FilterLogs(opts, "Initialized") if err != nil { return nil, err } return &WorkerHubInitializedIterator{contract: _WorkerHub.contract, event: "Initialized", logs: logs, sub: sub}, nil } // WatchInitialized is a free log subscription operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. // // Solidity: event Initialized(uint8 version) func (_WorkerHub *WorkerHubFilterer) WatchInitialized(opts *bind.WatchOpts, sink chan<- *WorkerHubInitialized) (event.Subscription, error) { logs, sub, err := _WorkerHub.contract.WatchLogs(opts, "Initialized") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(WorkerHubInitialized) if err := _WorkerHub.contract.UnpackLog(event, "Initialized", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseInitialized is a log parse operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. // // Solidity: event Initialized(uint8 version) func (_WorkerHub *WorkerHubFilterer) ParseInitialized(log types.Log) (*WorkerHubInitialized, error) { event := new(WorkerHubInitialized) if err := _WorkerHub.contract.UnpackLog(event, "Initialized", log); err != nil { return nil, err } event.Raw = log return event, nil } // WorkerHubMinerDeactivatedIterator is returned from FilterMinerDeactivated and is used to iterate over the raw logs and unpacked data for MinerDeactivated events raised by the WorkerHub contract. type WorkerHubMinerDeactivatedIterator struct { Event *WorkerHubMinerDeactivated // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *WorkerHubMinerDeactivatedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(WorkerHubMinerDeactivated) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(WorkerHubMinerDeactivated) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *WorkerHubMinerDeactivatedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *WorkerHubMinerDeactivatedIterator) Close() error { it.sub.Unsubscribe() return nil } // WorkerHubMinerDeactivated represents a MinerDeactivated event raised by the WorkerHub contract. type WorkerHubMinerDeactivated struct { Miner common.Address ModelAddress common.Address ActiveTime *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterMinerDeactivated is a free log retrieval operation binding the contract event 0x9335a7723b09748526d22902742e96812ad183ab52d86c2030fe407ff626e50d. // // Solidity: event MinerDeactivated(address indexed miner, address indexed modelAddress, uint40 activeTime) func (_WorkerHub *WorkerHubFilterer) FilterMinerDeactivated(opts *bind.FilterOpts, miner []common.Address, modelAddress []common.Address) (*WorkerHubMinerDeactivatedIterator, error) { var minerRule []interface{} for _, minerItem := range miner { minerRule = append(minerRule, minerItem) } var modelAddressRule []interface{} for _, modelAddressItem := range modelAddress { modelAddressRule = append(modelAddressRule, modelAddressItem) } logs, sub, err := _WorkerHub.contract.FilterLogs(opts, "MinerDeactivated", minerRule, modelAddressRule) if err != nil { return nil, err } return &WorkerHubMinerDeactivatedIterator{contract: _WorkerHub.contract, event: "MinerDeactivated", logs: logs, sub: sub}, nil } // WatchMinerDeactivated is a free log subscription operation binding the contract event 0x9335a7723b09748526d22902742e96812ad183ab52d86c2030fe407ff626e50d. // // Solidity: event MinerDeactivated(address indexed miner, address indexed modelAddress, uint40 activeTime) func (_WorkerHub *WorkerHubFilterer) WatchMinerDeactivated(opts *bind.WatchOpts, sink chan<- *WorkerHubMinerDeactivated, miner []common.Address, modelAddress []common.Address) (event.Subscription, error) { var minerRule []interface{} for _, minerItem := range miner { minerRule = append(minerRule, minerItem) } var modelAddressRule []interface{} for _, modelAddressItem := range modelAddress { modelAddressRule = append(modelAddressRule, modelAddressItem) } logs, sub, err := _WorkerHub.contract.WatchLogs(opts, "MinerDeactivated", minerRule, modelAddressRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(WorkerHubMinerDeactivated) if err := _WorkerHub.contract.UnpackLog(event, "MinerDeactivated", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseMinerDeactivated is a log parse operation binding the contract event 0x9335a7723b09748526d22902742e96812ad183ab52d86c2030fe407ff626e50d. // // Solidity: event MinerDeactivated(address indexed miner, address indexed modelAddress, uint40 activeTime) func (_WorkerHub *WorkerHubFilterer) ParseMinerDeactivated(log types.Log) (*WorkerHubMinerDeactivated, error) { event := new(WorkerHubMinerDeactivated) if err := _WorkerHub.contract.UnpackLog(event, "MinerDeactivated", log); err != nil { return nil, err } event.Raw = log return event, nil } // WorkerHubMinerExtraStakeIterator is returned from FilterMinerExtraStake and is used to iterate over the raw logs and unpacked data for MinerExtraStake events raised by the WorkerHub contract. type WorkerHubMinerExtraStakeIterator struct { Event *WorkerHubMinerExtraStake // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *WorkerHubMinerExtraStakeIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(WorkerHubMinerExtraStake) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(WorkerHubMinerExtraStake) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *WorkerHubMinerExtraStakeIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *WorkerHubMinerExtraStakeIterator) Close() error { it.sub.Unsubscribe() return nil } // WorkerHubMinerExtraStake represents a MinerExtraStake event raised by the WorkerHub contract. type WorkerHubMinerExtraStake struct { Miner common.Address Value *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterMinerExtraStake is a free log retrieval operation binding the contract event 0x3d236e8f743e932a32c84d3114ce3e7ee0b75225cb3b39f72faac62495fd21c1. // // Solidity: event MinerExtraStake(address indexed miner, uint256 value) func (_WorkerHub *WorkerHubFilterer) FilterMinerExtraStake(opts *bind.FilterOpts, miner []common.Address) (*WorkerHubMinerExtraStakeIterator, error) { var minerRule []interface{} for _, minerItem := range miner { minerRule = append(minerRule, minerItem) } logs, sub, err := _WorkerHub.contract.FilterLogs(opts, "MinerExtraStake", minerRule) if err != nil { return nil, err } return &WorkerHubMinerExtraStakeIterator{contract: _WorkerHub.contract, event: "MinerExtraStake", logs: logs, sub: sub}, nil } // WatchMinerExtraStake is a free log subscription operation binding the contract event 0x3d236e8f743e932a32c84d3114ce3e7ee0b75225cb3b39f72faac62495fd21c1. // // Solidity: event MinerExtraStake(address indexed miner, uint256 value) func (_WorkerHub *WorkerHubFilterer) WatchMinerExtraStake(opts *bind.WatchOpts, sink chan<- *WorkerHubMinerExtraStake, miner []common.Address) (event.Subscription, error) { var minerRule []interface{} for _, minerItem := range miner { minerRule = append(minerRule, minerItem) } logs, sub, err := _WorkerHub.contract.WatchLogs(opts, "MinerExtraStake", minerRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(WorkerHubMinerExtraStake) if err := _WorkerHub.contract.UnpackLog(event, "MinerExtraStake", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseMinerExtraStake is a log parse operation binding the contract event 0x3d236e8f743e932a32c84d3114ce3e7ee0b75225cb3b39f72faac62495fd21c1. // // Solidity: event MinerExtraStake(address indexed miner, uint256 value) func (_WorkerHub *WorkerHubFilterer) ParseMinerExtraStake(log types.Log) (*WorkerHubMinerExtraStake, error) { event := new(WorkerHubMinerExtraStake) if err := _WorkerHub.contract.UnpackLog(event, "MinerExtraStake", log); err != nil { return nil, err } event.Raw = log return event, nil } // WorkerHubMinerJoinIterator is returned from FilterMinerJoin and is used to iterate over the raw logs and unpacked data for MinerJoin events raised by the WorkerHub contract. type WorkerHubMinerJoinIterator struct { Event *WorkerHubMinerJoin // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *WorkerHubMinerJoinIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(WorkerHubMinerJoin) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(WorkerHubMinerJoin) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *WorkerHubMinerJoinIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *WorkerHubMinerJoinIterator) Close() error { it.sub.Unsubscribe() return nil } // WorkerHubMinerJoin represents a MinerJoin event raised by the WorkerHub contract. type WorkerHubMinerJoin struct { Miner common.Address Raw types.Log // Blockchain specific contextual infos } // FilterMinerJoin is a free log retrieval operation binding the contract event 0xb7041987154996ed34981c2bc6fbafd4b1fcab9964486d7cc386f0d8abcc5446. // // Solidity: event MinerJoin(address indexed miner) func (_WorkerHub *WorkerHubFilterer) FilterMinerJoin(opts *bind.FilterOpts, miner []common.Address) (*WorkerHubMinerJoinIterator, error) { var minerRule []interface{} for _, minerItem := range miner { minerRule = append(minerRule, minerItem) } logs, sub, err := _WorkerHub.contract.FilterLogs(opts, "MinerJoin", minerRule) if err != nil { return nil, err } return &WorkerHubMinerJoinIterator{contract: _WorkerHub.contract, event: "MinerJoin", logs: logs, sub: sub}, nil } // WatchMinerJoin is a free log subscription operation binding the contract event 0xb7041987154996ed34981c2bc6fbafd4b1fcab9964486d7cc386f0d8abcc5446. // // Solidity: event MinerJoin(address indexed miner) func (_WorkerHub *WorkerHubFilterer) WatchMinerJoin(opts *bind.WatchOpts, sink chan<- *WorkerHubMinerJoin, miner []common.Address) (event.Subscription, error) { var minerRule []interface{} for _, minerItem := range miner { minerRule = append(minerRule, minerItem) } logs, sub, err := _WorkerHub.contract.WatchLogs(opts, "MinerJoin", minerRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(WorkerHubMinerJoin) if err := _WorkerHub.contract.UnpackLog(event, "MinerJoin", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseMinerJoin is a log parse operation binding the contract event 0xb7041987154996ed34981c2bc6fbafd4b1fcab9964486d7cc386f0d8abcc5446. // // Solidity: event MinerJoin(address indexed miner) func (_WorkerHub *WorkerHubFilterer) ParseMinerJoin(log types.Log) (*WorkerHubMinerJoin, error) { event := new(WorkerHubMinerJoin) if err := _WorkerHub.contract.UnpackLog(event, "MinerJoin", log); err != nil { return nil, err } event.Raw = log return event, nil } // WorkerHubMinerRegistrationIterator is returned from FilterMinerRegistration and is used to iterate over the raw logs and unpacked data for MinerRegistration events raised by the WorkerHub contract. type WorkerHubMinerRegistrationIterator struct { Event *WorkerHubMinerRegistration // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *WorkerHubMinerRegistrationIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(WorkerHubMinerRegistration) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(WorkerHubMinerRegistration) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *WorkerHubMinerRegistrationIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *WorkerHubMinerRegistrationIterator) Close() error { it.sub.Unsubscribe() return nil } // WorkerHubMinerRegistration represents a MinerRegistration event raised by the WorkerHub contract. type WorkerHubMinerRegistration struct { Miner common.Address Tier uint16 Value *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterMinerRegistration is a free log retrieval operation binding the contract event 0x55e488821080f3f5cdf6088b02793df0d26f40053a70b6154347d2ac313015a1. // // Solidity: event MinerRegistration(address indexed miner, uint16 indexed tier, uint256 value) func (_WorkerHub *WorkerHubFilterer) FilterMinerRegistration(opts *bind.FilterOpts, miner []common.Address, tier []uint16) (*WorkerHubMinerRegistrationIterator, error) { var minerRule []interface{} for _, minerItem := range miner { minerRule = append(minerRule, minerItem) } var tierRule []interface{} for _, tierItem := range tier { tierRule = append(tierRule, tierItem) } logs, sub, err := _WorkerHub.contract.FilterLogs(opts, "MinerRegistration", minerRule, tierRule) if err != nil { return nil, err } return &WorkerHubMinerRegistrationIterator{contract: _WorkerHub.contract, event: "MinerRegistration", logs: logs, sub: sub}, nil } // WatchMinerRegistration is a free log subscription operation binding the contract event 0x55e488821080f3f5cdf6088b02793df0d26f40053a70b6154347d2ac313015a1. // // Solidity: event MinerRegistration(address indexed miner, uint16 indexed tier, uint256 value) func (_WorkerHub *WorkerHubFilterer) WatchMinerRegistration(opts *bind.WatchOpts, sink chan<- *WorkerHubMinerRegistration, miner []common.Address, tier []uint16) (event.Subscription, error) { var minerRule []interface{} for _, minerItem := range miner { minerRule = append(minerRule, minerItem) } var tierRule []interface{} for _, tierItem := range tier { tierRule = append(tierRule, tierItem) } logs, sub, err := _WorkerHub.contract.WatchLogs(opts, "MinerRegistration", minerRule, tierRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(WorkerHubMinerRegistration) if err := _WorkerHub.contract.UnpackLog(event, "MinerRegistration", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseMinerRegistration is a log parse operation binding the contract event 0x55e488821080f3f5cdf6088b02793df0d26f40053a70b6154347d2ac313015a1. // // Solidity: event MinerRegistration(address indexed miner, uint16 indexed tier, uint256 value) func (_WorkerHub *WorkerHubFilterer) ParseMinerRegistration(log types.Log) (*WorkerHubMinerRegistration, error) { event := new(WorkerHubMinerRegistration) if err := _WorkerHub.contract.UnpackLog(event, "MinerRegistration", log); err != nil { return nil, err } event.Raw = log return event, nil } // WorkerHubMinerUnregistrationIterator is returned from FilterMinerUnregistration and is used to iterate over the raw logs and unpacked data for MinerUnregistration events raised by the WorkerHub contract. type WorkerHubMinerUnregistrationIterator struct { Event *WorkerHubMinerUnregistration // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *WorkerHubMinerUnregistrationIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(WorkerHubMinerUnregistration) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(WorkerHubMinerUnregistration) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *WorkerHubMinerUnregistrationIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *WorkerHubMinerUnregistrationIterator) Close() error { it.sub.Unsubscribe() return nil } // WorkerHubMinerUnregistration represents a MinerUnregistration event raised by the WorkerHub contract. type WorkerHubMinerUnregistration struct { Miner common.Address Raw types.Log // Blockchain specific contextual infos } // FilterMinerUnregistration is a free log retrieval operation binding the contract event 0x8f54596d72781f60dbf7dad7e576f06ce17bbda0bdf384463f7734f85f51498e. // // Solidity: event MinerUnregistration(address indexed miner) func (_WorkerHub *WorkerHubFilterer) FilterMinerUnregistration(opts *bind.FilterOpts, miner []common.Address) (*WorkerHubMinerUnregistrationIterator, error) { var minerRule []interface{} for _, minerItem := range miner { minerRule = append(minerRule, minerItem) } logs, sub, err := _WorkerHub.contract.FilterLogs(opts, "MinerUnregistration", minerRule) if err != nil { return nil, err } return &WorkerHubMinerUnregistrationIterator{contract: _WorkerHub.contract, event: "MinerUnregistration", logs: logs, sub: sub}, nil } // WatchMinerUnregistration is a free log subscription operation binding the contract event 0x8f54596d72781f60dbf7dad7e576f06ce17bbda0bdf384463f7734f85f51498e. // // Solidity: event MinerUnregistration(address indexed miner) func (_WorkerHub *WorkerHubFilterer) WatchMinerUnregistration(opts *bind.WatchOpts, sink chan<- *WorkerHubMinerUnregistration, miner []common.Address) (event.Subscription, error) { var minerRule []interface{} for _, minerItem := range miner { minerRule = append(minerRule, minerItem) } logs, sub, err := _WorkerHub.contract.WatchLogs(opts, "MinerUnregistration", minerRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(WorkerHubMinerUnregistration) if err := _WorkerHub.contract.UnpackLog(event, "MinerUnregistration", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseMinerUnregistration is a log parse operation binding the contract event 0x8f54596d72781f60dbf7dad7e576f06ce17bbda0bdf384463f7734f85f51498e. // // Solidity: event MinerUnregistration(address indexed miner) func (_WorkerHub *WorkerHubFilterer) ParseMinerUnregistration(log types.Log) (*WorkerHubMinerUnregistration, error) { event := new(WorkerHubMinerUnregistration) if err := _WorkerHub.contract.UnpackLog(event, "MinerUnregistration", log); err != nil { return nil, err } event.Raw = log return event, nil } // WorkerHubMinerUnstakeIterator is returned from FilterMinerUnstake and is used to iterate over the raw logs and unpacked data for MinerUnstake events raised by the WorkerHub contract. type WorkerHubMinerUnstakeIterator struct { Event *WorkerHubMinerUnstake // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *WorkerHubMinerUnstakeIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(WorkerHubMinerUnstake) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(WorkerHubMinerUnstake) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *WorkerHubMinerUnstakeIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *WorkerHubMinerUnstakeIterator) Close() error { it.sub.Unsubscribe() return nil } // WorkerHubMinerUnstake represents a MinerUnstake event raised by the WorkerHub contract. type WorkerHubMinerUnstake struct { Miner common.Address Stake *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterMinerUnstake is a free log retrieval operation binding the contract event 0x1051154647682075e7cc0645853209e75208cb5acd862fc83f7fd0fcaa9624b4. // // Solidity: event MinerUnstake(address indexed miner, uint256 stake) func (_WorkerHub *WorkerHubFilterer) FilterMinerUnstake(opts *bind.FilterOpts, miner []common.Address) (*WorkerHubMinerUnstakeIterator, error) { var minerRule []interface{} for _, minerItem := range miner { minerRule = append(minerRule, minerItem) } logs, sub, err := _WorkerHub.contract.FilterLogs(opts, "MinerUnstake", minerRule) if err != nil { return nil, err } return &WorkerHubMinerUnstakeIterator{contract: _WorkerHub.contract, event: "MinerUnstake", logs: logs, sub: sub}, nil } // WatchMinerUnstake is a free log subscription operation binding the contract event 0x1051154647682075e7cc0645853209e75208cb5acd862fc83f7fd0fcaa9624b4. // // Solidity: event MinerUnstake(address indexed miner, uint256 stake) func (_WorkerHub *WorkerHubFilterer) WatchMinerUnstake(opts *bind.WatchOpts, sink chan<- *WorkerHubMinerUnstake, miner []common.Address) (event.Subscription, error) { var minerRule []interface{} for _, minerItem := range miner { minerRule = append(minerRule, minerItem) } logs, sub, err := _WorkerHub.contract.WatchLogs(opts, "MinerUnstake", minerRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(WorkerHubMinerUnstake) if err := _WorkerHub.contract.UnpackLog(event, "MinerUnstake", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseMinerUnstake is a log parse operation binding the contract event 0x1051154647682075e7cc0645853209e75208cb5acd862fc83f7fd0fcaa9624b4. // // Solidity: event MinerUnstake(address indexed miner, uint256 stake) func (_WorkerHub *WorkerHubFilterer) ParseMinerUnstake(log types.Log) (*WorkerHubMinerUnstake, error) { event := new(WorkerHubMinerUnstake) if err := _WorkerHub.contract.UnpackLog(event, "MinerUnstake", log); err != nil { return nil, err } event.Raw = log return event, nil } // WorkerHubMiningTimeLimitUpdateIterator is returned from FilterMiningTimeLimitUpdate and is used to iterate over the raw logs and unpacked data for MiningTimeLimitUpdate events raised by the WorkerHub contract. type WorkerHubMiningTimeLimitUpdateIterator struct { Event *WorkerHubMiningTimeLimitUpdate // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *WorkerHubMiningTimeLimitUpdateIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(WorkerHubMiningTimeLimitUpdate) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(WorkerHubMiningTimeLimitUpdate) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *WorkerHubMiningTimeLimitUpdateIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *WorkerHubMiningTimeLimitUpdateIterator) Close() error { it.sub.Unsubscribe() return nil } // WorkerHubMiningTimeLimitUpdate represents a MiningTimeLimitUpdate event raised by the WorkerHub contract. type WorkerHubMiningTimeLimitUpdate struct { NewValue *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterMiningTimeLimitUpdate is a free log retrieval operation binding the contract event 0xd223a90576ecd9f418b264c3465ab13fad46f62b72bf17dca91af5dc8b7e55a8. // // Solidity: event MiningTimeLimitUpdate(uint40 newValue) func (_WorkerHub *WorkerHubFilterer) FilterMiningTimeLimitUpdate(opts *bind.FilterOpts) (*WorkerHubMiningTimeLimitUpdateIterator, error) { logs, sub, err := _WorkerHub.contract.FilterLogs(opts, "MiningTimeLimitUpdate") if err != nil { return nil, err } return &WorkerHubMiningTimeLimitUpdateIterator{contract: _WorkerHub.contract, event: "MiningTimeLimitUpdate", logs: logs, sub: sub}, nil } // WatchMiningTimeLimitUpdate is a free log subscription operation binding the contract event 0xd223a90576ecd9f418b264c3465ab13fad46f62b72bf17dca91af5dc8b7e55a8. // // Solidity: event MiningTimeLimitUpdate(uint40 newValue) func (_WorkerHub *WorkerHubFilterer) WatchMiningTimeLimitUpdate(opts *bind.WatchOpts, sink chan<- *WorkerHubMiningTimeLimitUpdate) (event.Subscription, error) { logs, sub, err := _WorkerHub.contract.WatchLogs(opts, "MiningTimeLimitUpdate") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(WorkerHubMiningTimeLimitUpdate) if err := _WorkerHub.contract.UnpackLog(event, "MiningTimeLimitUpdate", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseMiningTimeLimitUpdate is a log parse operation binding the contract event 0xd223a90576ecd9f418b264c3465ab13fad46f62b72bf17dca91af5dc8b7e55a8. // // Solidity: event MiningTimeLimitUpdate(uint40 newValue) func (_WorkerHub *WorkerHubFilterer) ParseMiningTimeLimitUpdate(log types.Log) (*WorkerHubMiningTimeLimitUpdate, error) { event := new(WorkerHubMiningTimeLimitUpdate) if err := _WorkerHub.contract.UnpackLog(event, "MiningTimeLimitUpdate", log); err != nil { return nil, err } event.Raw = log return event, nil } // WorkerHubModelMinimumFeeUpdateIterator is returned from FilterModelMinimumFeeUpdate and is used to iterate over the raw logs and unpacked data for ModelMinimumFeeUpdate events raised by the WorkerHub contract. type WorkerHubModelMinimumFeeUpdateIterator struct { Event *WorkerHubModelMinimumFeeUpdate // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *WorkerHubModelMinimumFeeUpdateIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(WorkerHubModelMinimumFeeUpdate) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(WorkerHubModelMinimumFeeUpdate) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *WorkerHubModelMinimumFeeUpdateIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *WorkerHubModelMinimumFeeUpdateIterator) Close() error { it.sub.Unsubscribe() return nil } // WorkerHubModelMinimumFeeUpdate represents a ModelMinimumFeeUpdate event raised by the WorkerHub contract. type WorkerHubModelMinimumFeeUpdate struct { Model common.Address MinimumFee *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterModelMinimumFeeUpdate is a free log retrieval operation binding the contract event 0x923b5fe9c9974b3c93e434ae744faaa60ec86513c02614da5c8d9c51eda2bdd7. // // Solidity: event ModelMinimumFeeUpdate(address indexed model, uint256 minimumFee) func (_WorkerHub *WorkerHubFilterer) FilterModelMinimumFeeUpdate(opts *bind.FilterOpts, model []common.Address) (*WorkerHubModelMinimumFeeUpdateIterator, error) { var modelRule []interface{} for _, modelItem := range model { modelRule = append(modelRule, modelItem) } logs, sub, err := _WorkerHub.contract.FilterLogs(opts, "ModelMinimumFeeUpdate", modelRule) if err != nil { return nil, err } return &WorkerHubModelMinimumFeeUpdateIterator{contract: _WorkerHub.contract, event: "ModelMinimumFeeUpdate", logs: logs, sub: sub}, nil } // WatchModelMinimumFeeUpdate is a free log subscription operation binding the contract event 0x923b5fe9c9974b3c93e434ae744faaa60ec86513c02614da5c8d9c51eda2bdd7. // // Solidity: event ModelMinimumFeeUpdate(address indexed model, uint256 minimumFee) func (_WorkerHub *WorkerHubFilterer) WatchModelMinimumFeeUpdate(opts *bind.WatchOpts, sink chan<- *WorkerHubModelMinimumFeeUpdate, model []common.Address) (event.Subscription, error) { var modelRule []interface{} for _, modelItem := range model { modelRule = append(modelRule, modelItem) } logs, sub, err := _WorkerHub.contract.WatchLogs(opts, "ModelMinimumFeeUpdate", modelRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(WorkerHubModelMinimumFeeUpdate) if err := _WorkerHub.contract.UnpackLog(event, "ModelMinimumFeeUpdate", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseModelMinimumFeeUpdate is a log parse operation binding the contract event 0x923b5fe9c9974b3c93e434ae744faaa60ec86513c02614da5c8d9c51eda2bdd7. // // Solidity: event ModelMinimumFeeUpdate(address indexed model, uint256 minimumFee) func (_WorkerHub *WorkerHubFilterer) ParseModelMinimumFeeUpdate(log types.Log) (*WorkerHubModelMinimumFeeUpdate, error) { event := new(WorkerHubModelMinimumFeeUpdate) if err := _WorkerHub.contract.UnpackLog(event, "ModelMinimumFeeUpdate", log); err != nil { return nil, err } event.Raw = log return event, nil } // WorkerHubModelRegistrationIterator is returned from FilterModelRegistration and is used to iterate over the raw logs and unpacked data for ModelRegistration events raised by the WorkerHub contract. type WorkerHubModelRegistrationIterator struct { Event *WorkerHubModelRegistration // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *WorkerHubModelRegistrationIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(WorkerHubModelRegistration) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(WorkerHubModelRegistration) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *WorkerHubModelRegistrationIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *WorkerHubModelRegistrationIterator) Close() error { it.sub.Unsubscribe() return nil } // WorkerHubModelRegistration represents a ModelRegistration event raised by the WorkerHub contract. type WorkerHubModelRegistration struct { Model common.Address Tier uint16 MinimumFee *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterModelRegistration is a free log retrieval operation binding the contract event 0x7041913a4cb21c28c931da9d9e4b5ed0ad84e47fcf2a65527f03c438d534ed5c. // // Solidity: event ModelRegistration(address indexed model, uint16 indexed tier, uint256 minimumFee) func (_WorkerHub *WorkerHubFilterer) FilterModelRegistration(opts *bind.FilterOpts, model []common.Address, tier []uint16) (*WorkerHubModelRegistrationIterator, error) { var modelRule []interface{} for _, modelItem := range model { modelRule = append(modelRule, modelItem) } var tierRule []interface{} for _, tierItem := range tier { tierRule = append(tierRule, tierItem) } logs, sub, err := _WorkerHub.contract.FilterLogs(opts, "ModelRegistration", modelRule, tierRule) if err != nil { return nil, err } return &WorkerHubModelRegistrationIterator{contract: _WorkerHub.contract, event: "ModelRegistration", logs: logs, sub: sub}, nil } // WatchModelRegistration is a free log subscription operation binding the contract event 0x7041913a4cb21c28c931da9d9e4b5ed0ad84e47fcf2a65527f03c438d534ed5c. // // Solidity: event ModelRegistration(address indexed model, uint16 indexed tier, uint256 minimumFee) func (_WorkerHub *WorkerHubFilterer) WatchModelRegistration(opts *bind.WatchOpts, sink chan<- *WorkerHubModelRegistration, model []common.Address, tier []uint16) (event.Subscription, error) { var modelRule []interface{} for _, modelItem := range model { modelRule = append(modelRule, modelItem) } var tierRule []interface{} for _, tierItem := range tier { tierRule = append(tierRule, tierItem) } logs, sub, err := _WorkerHub.contract.WatchLogs(opts, "ModelRegistration", modelRule, tierRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(WorkerHubModelRegistration) if err := _WorkerHub.contract.UnpackLog(event, "ModelRegistration", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseModelRegistration is a log parse operation binding the contract event 0x7041913a4cb21c28c931da9d9e4b5ed0ad84e47fcf2a65527f03c438d534ed5c. // // Solidity: event ModelRegistration(address indexed model, uint16 indexed tier, uint256 minimumFee) func (_WorkerHub *WorkerHubFilterer) ParseModelRegistration(log types.Log) (*WorkerHubModelRegistration, error) { event := new(WorkerHubModelRegistration) if err := _WorkerHub.contract.UnpackLog(event, "ModelRegistration", log); err != nil { return nil, err } event.Raw = log return event, nil } // WorkerHubModelTierUpdateIterator is returned from FilterModelTierUpdate and is used to iterate over the raw logs and unpacked data for ModelTierUpdate events raised by the WorkerHub contract. type WorkerHubModelTierUpdateIterator struct { Event *WorkerHubModelTierUpdate // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *WorkerHubModelTierUpdateIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(WorkerHubModelTierUpdate) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(WorkerHubModelTierUpdate) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *WorkerHubModelTierUpdateIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *WorkerHubModelTierUpdateIterator) Close() error { it.sub.Unsubscribe() return nil } // WorkerHubModelTierUpdate represents a ModelTierUpdate event raised by the WorkerHub contract. type WorkerHubModelTierUpdate struct { Model common.Address Tier uint32 Raw types.Log // Blockchain specific contextual infos } // FilterModelTierUpdate is a free log retrieval operation binding the contract event 0x64905396482bb1067a551077143915c77b512b1cfea5db34c903943c1c2a5a15. // // Solidity: event ModelTierUpdate(address indexed model, uint32 tier) func (_WorkerHub *WorkerHubFilterer) FilterModelTierUpdate(opts *bind.FilterOpts, model []common.Address) (*WorkerHubModelTierUpdateIterator, error) { var modelRule []interface{} for _, modelItem := range model { modelRule = append(modelRule, modelItem) } logs, sub, err := _WorkerHub.contract.FilterLogs(opts, "ModelTierUpdate", modelRule) if err != nil { return nil, err } return &WorkerHubModelTierUpdateIterator{contract: _WorkerHub.contract, event: "ModelTierUpdate", logs: logs, sub: sub}, nil } // WatchModelTierUpdate is a free log subscription operation binding the contract event 0x64905396482bb1067a551077143915c77b512b1cfea5db34c903943c1c2a5a15. // // Solidity: event ModelTierUpdate(address indexed model, uint32 tier) func (_WorkerHub *WorkerHubFilterer) WatchModelTierUpdate(opts *bind.WatchOpts, sink chan<- *WorkerHubModelTierUpdate, model []common.Address) (event.Subscription, error) { var modelRule []interface{} for _, modelItem := range model { modelRule = append(modelRule, modelItem) } logs, sub, err := _WorkerHub.contract.WatchLogs(opts, "ModelTierUpdate", modelRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(WorkerHubModelTierUpdate) if err := _WorkerHub.contract.UnpackLog(event, "ModelTierUpdate", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseModelTierUpdate is a log parse operation binding the contract event 0x64905396482bb1067a551077143915c77b512b1cfea5db34c903943c1c2a5a15. // // Solidity: event ModelTierUpdate(address indexed model, uint32 tier) func (_WorkerHub *WorkerHubFilterer) ParseModelTierUpdate(log types.Log) (*WorkerHubModelTierUpdate, error) { event := new(WorkerHubModelTierUpdate) if err := _WorkerHub.contract.UnpackLog(event, "ModelTierUpdate", log); err != nil { return nil, err } event.Raw = log return event, nil } // WorkerHubModelUnregistrationIterator is returned from FilterModelUnregistration and is used to iterate over the raw logs and unpacked data for ModelUnregistration events raised by the WorkerHub contract. type WorkerHubModelUnregistrationIterator struct { Event *WorkerHubModelUnregistration // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *WorkerHubModelUnregistrationIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(WorkerHubModelUnregistration) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(WorkerHubModelUnregistration) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *WorkerHubModelUnregistrationIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *WorkerHubModelUnregistrationIterator) Close() error { it.sub.Unsubscribe() return nil } // WorkerHubModelUnregistration represents a ModelUnregistration event raised by the WorkerHub contract. type WorkerHubModelUnregistration struct { Model common.Address Raw types.Log // Blockchain specific contextual infos } // FilterModelUnregistration is a free log retrieval operation binding the contract event 0x68180f49300b9177ab3b88d3f909a002abeb9c2f769543a93234ca68333582d7. // // Solidity: event ModelUnregistration(address indexed model) func (_WorkerHub *WorkerHubFilterer) FilterModelUnregistration(opts *bind.FilterOpts, model []common.Address) (*WorkerHubModelUnregistrationIterator, error) { var modelRule []interface{} for _, modelItem := range model { modelRule = append(modelRule, modelItem) } logs, sub, err := _WorkerHub.contract.FilterLogs(opts, "ModelUnregistration", modelRule) if err != nil { return nil, err } return &WorkerHubModelUnregistrationIterator{contract: _WorkerHub.contract, event: "ModelUnregistration", logs: logs, sub: sub}, nil } // WatchModelUnregistration is a free log subscription operation binding the contract event 0x68180f49300b9177ab3b88d3f909a002abeb9c2f769543a93234ca68333582d7. // // Solidity: event ModelUnregistration(address indexed model) func (_WorkerHub *WorkerHubFilterer) WatchModelUnregistration(opts *bind.WatchOpts, sink chan<- *WorkerHubModelUnregistration, model []common.Address) (event.Subscription, error) { var modelRule []interface{} for _, modelItem := range model { modelRule = append(modelRule, modelItem) } logs, sub, err := _WorkerHub.contract.WatchLogs(opts, "ModelUnregistration", modelRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(WorkerHubModelUnregistration) if err := _WorkerHub.contract.UnpackLog(event, "ModelUnregistration", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseModelUnregistration is a log parse operation binding the contract event 0x68180f49300b9177ab3b88d3f909a002abeb9c2f769543a93234ca68333582d7. // // Solidity: event ModelUnregistration(address indexed model) func (_WorkerHub *WorkerHubFilterer) ParseModelUnregistration(log types.Log) (*WorkerHubModelUnregistration, error) { event := new(WorkerHubModelUnregistration) if err := _WorkerHub.contract.UnpackLog(event, "ModelUnregistration", log); err != nil { return nil, err } event.Raw = log return event, nil } // WorkerHubNewAssignmentIterator is returned from FilterNewAssignment and is used to iterate over the raw logs and unpacked data for NewAssignment events raised by the WorkerHub contract. type WorkerHubNewAssignmentIterator struct { Event *WorkerHubNewAssignment // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *WorkerHubNewAssignmentIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(WorkerHubNewAssignment) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(WorkerHubNewAssignment) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *WorkerHubNewAssignmentIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *WorkerHubNewAssignmentIterator) Close() error { it.sub.Unsubscribe() return nil } // WorkerHubNewAssignment represents a NewAssignment event raised by the WorkerHub contract. type WorkerHubNewAssignment struct { AssignmentId *big.Int InferenceId *big.Int Miner common.Address ExpiredAt *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterNewAssignment is a free log retrieval operation binding the contract event 0x53cc8b652f33c56dac5f1c97a284cc971e7adcb8abe9454b0853f076c6deb7d5. // // Solidity: event NewAssignment(uint256 indexed assignmentId, uint256 indexed inferenceId, address indexed miner, uint40 expiredAt) func (_WorkerHub *WorkerHubFilterer) FilterNewAssignment(opts *bind.FilterOpts, assignmentId []*big.Int, inferenceId []*big.Int, miner []common.Address) (*WorkerHubNewAssignmentIterator, error) { var assignmentIdRule []interface{} for _, assignmentIdItem := range assignmentId { assignmentIdRule = append(assignmentIdRule, assignmentIdItem) } var inferenceIdRule []interface{} for _, inferenceIdItem := range inferenceId { inferenceIdRule = append(inferenceIdRule, inferenceIdItem) } var minerRule []interface{} for _, minerItem := range miner { minerRule = append(minerRule, minerItem) } logs, sub, err := _WorkerHub.contract.FilterLogs(opts, "NewAssignment", assignmentIdRule, inferenceIdRule, minerRule) if err != nil { return nil, err } return &WorkerHubNewAssignmentIterator{contract: _WorkerHub.contract, event: "NewAssignment", logs: logs, sub: sub}, nil } // WatchNewAssignment is a free log subscription operation binding the contract event 0x53cc8b652f33c56dac5f1c97a284cc971e7adcb8abe9454b0853f076c6deb7d5. // // Solidity: event NewAssignment(uint256 indexed assignmentId, uint256 indexed inferenceId, address indexed miner, uint40 expiredAt) func (_WorkerHub *WorkerHubFilterer) WatchNewAssignment(opts *bind.WatchOpts, sink chan<- *WorkerHubNewAssignment, assignmentId []*big.Int, inferenceId []*big.Int, miner []common.Address) (event.Subscription, error) { var assignmentIdRule []interface{} for _, assignmentIdItem := range assignmentId { assignmentIdRule = append(assignmentIdRule, assignmentIdItem) } var inferenceIdRule []interface{} for _, inferenceIdItem := range inferenceId { inferenceIdRule = append(inferenceIdRule, inferenceIdItem) } var minerRule []interface{} for _, minerItem := range miner { minerRule = append(minerRule, minerItem) } logs, sub, err := _WorkerHub.contract.WatchLogs(opts, "NewAssignment", assignmentIdRule, inferenceIdRule, minerRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(WorkerHubNewAssignment) if err := _WorkerHub.contract.UnpackLog(event, "NewAssignment", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseNewAssignment is a log parse operation binding the contract event 0x53cc8b652f33c56dac5f1c97a284cc971e7adcb8abe9454b0853f076c6deb7d5. // // Solidity: event NewAssignment(uint256 indexed assignmentId, uint256 indexed inferenceId, address indexed miner, uint40 expiredAt) func (_WorkerHub *WorkerHubFilterer) ParseNewAssignment(log types.Log) (*WorkerHubNewAssignment, error) { event := new(WorkerHubNewAssignment) if err := _WorkerHub.contract.UnpackLog(event, "NewAssignment", log); err != nil { return nil, err } event.Raw = log return event, nil } // WorkerHubNewInferenceIterator is returned from FilterNewInference and is used to iterate over the raw logs and unpacked data for NewInference events raised by the WorkerHub contract. type WorkerHubNewInferenceIterator struct { Event *WorkerHubNewInference // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *WorkerHubNewInferenceIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(WorkerHubNewInference) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(WorkerHubNewInference) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *WorkerHubNewInferenceIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *WorkerHubNewInferenceIterator) Close() error { it.sub.Unsubscribe() return nil } // WorkerHubNewInference represents a NewInference event raised by the WorkerHub contract. type WorkerHubNewInference struct { InferenceId *big.Int Model common.Address Creator common.Address Value *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterNewInference is a free log retrieval operation binding the contract event 0x77f5630b01c86fd0283f51543024803955bf2c66ddc644ef0ebd1dd193d032ee. // // Solidity: event NewInference(uint256 indexed inferenceId, address indexed model, address indexed creator, uint256 value) func (_WorkerHub *WorkerHubFilterer) FilterNewInference(opts *bind.FilterOpts, inferenceId []*big.Int, model []common.Address, creator []common.Address) (*WorkerHubNewInferenceIterator, error) { var inferenceIdRule []interface{} for _, inferenceIdItem := range inferenceId { inferenceIdRule = append(inferenceIdRule, inferenceIdItem) } var modelRule []interface{} for _, modelItem := range model { modelRule = append(modelRule, modelItem) } var creatorRule []interface{} for _, creatorItem := range creator { creatorRule = append(creatorRule, creatorItem) } logs, sub, err := _WorkerHub.contract.FilterLogs(opts, "NewInference", inferenceIdRule, modelRule, creatorRule) if err != nil { return nil, err } return &WorkerHubNewInferenceIterator{contract: _WorkerHub.contract, event: "NewInference", logs: logs, sub: sub}, nil } // WatchNewInference is a free log subscription operation binding the contract event 0x77f5630b01c86fd0283f51543024803955bf2c66ddc644ef0ebd1dd193d032ee. // // Solidity: event NewInference(uint256 indexed inferenceId, address indexed model, address indexed creator, uint256 value) func (_WorkerHub *WorkerHubFilterer) WatchNewInference(opts *bind.WatchOpts, sink chan<- *WorkerHubNewInference, inferenceId []*big.Int, model []common.Address, creator []common.Address) (event.Subscription, error) { var inferenceIdRule []interface{} for _, inferenceIdItem := range inferenceId { inferenceIdRule = append(inferenceIdRule, inferenceIdItem) } var modelRule []interface{} for _, modelItem := range model { modelRule = append(modelRule, modelItem) } var creatorRule []interface{} for _, creatorItem := range creator { creatorRule = append(creatorRule, creatorItem) } logs, sub, err := _WorkerHub.contract.WatchLogs(opts, "NewInference", inferenceIdRule, modelRule, creatorRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(WorkerHubNewInference) if err := _WorkerHub.contract.UnpackLog(event, "NewInference", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseNewInference is a log parse operation binding the contract event 0x77f5630b01c86fd0283f51543024803955bf2c66ddc644ef0ebd1dd193d032ee. // // Solidity: event NewInference(uint256 indexed inferenceId, address indexed model, address indexed creator, uint256 value) func (_WorkerHub *WorkerHubFilterer) ParseNewInference(log types.Log) (*WorkerHubNewInference, error) { event := new(WorkerHubNewInference) if err := _WorkerHub.contract.UnpackLog(event, "NewInference", log); err != nil { return nil, err } event.Raw = log return event, nil } // WorkerHubOwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the WorkerHub contract. type WorkerHubOwnershipTransferredIterator struct { Event *WorkerHubOwnershipTransferred // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *WorkerHubOwnershipTransferredIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(WorkerHubOwnershipTransferred) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(WorkerHubOwnershipTransferred) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *WorkerHubOwnershipTransferredIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *WorkerHubOwnershipTransferredIterator) Close() error { it.sub.Unsubscribe() return nil } // WorkerHubOwnershipTransferred represents a OwnershipTransferred event raised by the WorkerHub contract. type WorkerHubOwnershipTransferred struct { PreviousOwner common.Address NewOwner common.Address Raw types.Log // Blockchain specific contextual infos } // FilterOwnershipTransferred is a free log retrieval operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. // // Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) func (_WorkerHub *WorkerHubFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*WorkerHubOwnershipTransferredIterator, error) { var previousOwnerRule []interface{} for _, previousOwnerItem := range previousOwner { previousOwnerRule = append(previousOwnerRule, previousOwnerItem) } var newOwnerRule []interface{} for _, newOwnerItem := range newOwner { newOwnerRule = append(newOwnerRule, newOwnerItem) } logs, sub, err := _WorkerHub.contract.FilterLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) if err != nil { return nil, err } return &WorkerHubOwnershipTransferredIterator{contract: _WorkerHub.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil } // WatchOwnershipTransferred is a free log subscription operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. // // Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) func (_WorkerHub *WorkerHubFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *WorkerHubOwnershipTransferred, previousOwner []common.Address, newOwner []common.Address) (event.Subscription, error) { var previousOwnerRule []interface{} for _, previousOwnerItem := range previousOwner { previousOwnerRule = append(previousOwnerRule, previousOwnerItem) } var newOwnerRule []interface{} for _, newOwnerItem := range newOwner { newOwnerRule = append(newOwnerRule, newOwnerItem) } logs, sub, err := _WorkerHub.contract.WatchLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(WorkerHubOwnershipTransferred) if err := _WorkerHub.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseOwnershipTransferred is a log parse operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. // // Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) func (_WorkerHub *WorkerHubFilterer) ParseOwnershipTransferred(log types.Log) (*WorkerHubOwnershipTransferred, error) { event := new(WorkerHubOwnershipTransferred) if err := _WorkerHub.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { return nil, err } event.Raw = log return event, nil } // WorkerHubPausedIterator is returned from FilterPaused and is used to iterate over the raw logs and unpacked data for Paused events raised by the WorkerHub contract. type WorkerHubPausedIterator struct { Event *WorkerHubPaused // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *WorkerHubPausedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(WorkerHubPaused) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(WorkerHubPaused) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *WorkerHubPausedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *WorkerHubPausedIterator) Close() error { it.sub.Unsubscribe() return nil } // WorkerHubPaused represents a Paused event raised by the WorkerHub contract. type WorkerHubPaused struct { Account common.Address Raw types.Log // Blockchain specific contextual infos } // FilterPaused is a free log retrieval operation binding the contract event 0x62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258. // // Solidity: event Paused(address account) func (_WorkerHub *WorkerHubFilterer) FilterPaused(opts *bind.FilterOpts) (*WorkerHubPausedIterator, error) { logs, sub, err := _WorkerHub.contract.FilterLogs(opts, "Paused") if err != nil { return nil, err } return &WorkerHubPausedIterator{contract: _WorkerHub.contract, event: "Paused", logs: logs, sub: sub}, nil } // WatchPaused is a free log subscription operation binding the contract event 0x62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258. // // Solidity: event Paused(address account) func (_WorkerHub *WorkerHubFilterer) WatchPaused(opts *bind.WatchOpts, sink chan<- *WorkerHubPaused) (event.Subscription, error) { logs, sub, err := _WorkerHub.contract.WatchLogs(opts, "Paused") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(WorkerHubPaused) if err := _WorkerHub.contract.UnpackLog(event, "Paused", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParsePaused is a log parse operation binding the contract event 0x62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258. // // Solidity: event Paused(address account) func (_WorkerHub *WorkerHubFilterer) ParsePaused(log types.Log) (*WorkerHubPaused, error) { event := new(WorkerHubPaused) if err := _WorkerHub.contract.UnpackLog(event, "Paused", log); err != nil { return nil, err } event.Raw = log return event, nil } // WorkerHubPenaltyDurationUpdatedIterator is returned from FilterPenaltyDurationUpdated and is used to iterate over the raw logs and unpacked data for PenaltyDurationUpdated events raised by the WorkerHub contract. type WorkerHubPenaltyDurationUpdatedIterator struct { Event *WorkerHubPenaltyDurationUpdated // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *WorkerHubPenaltyDurationUpdatedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(WorkerHubPenaltyDurationUpdated) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(WorkerHubPenaltyDurationUpdated) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *WorkerHubPenaltyDurationUpdatedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *WorkerHubPenaltyDurationUpdatedIterator) Close() error { it.sub.Unsubscribe() return nil } // WorkerHubPenaltyDurationUpdated represents a PenaltyDurationUpdated event raised by the WorkerHub contract. type WorkerHubPenaltyDurationUpdated struct { OldDuration *big.Int NewDuration *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterPenaltyDurationUpdated is a free log retrieval operation binding the contract event 0xf7a437a25c636d2b29d0ba34f0f6870af14f44478eff2ac852f36030f2e2924e. // // Solidity: event PenaltyDurationUpdated(uint40 oldDuration, uint40 newDuration) func (_WorkerHub *WorkerHubFilterer) FilterPenaltyDurationUpdated(opts *bind.FilterOpts) (*WorkerHubPenaltyDurationUpdatedIterator, error) { logs, sub, err := _WorkerHub.contract.FilterLogs(opts, "PenaltyDurationUpdated") if err != nil { return nil, err } return &WorkerHubPenaltyDurationUpdatedIterator{contract: _WorkerHub.contract, event: "PenaltyDurationUpdated", logs: logs, sub: sub}, nil } // WatchPenaltyDurationUpdated is a free log subscription operation binding the contract event 0xf7a437a25c636d2b29d0ba34f0f6870af14f44478eff2ac852f36030f2e2924e. // // Solidity: event PenaltyDurationUpdated(uint40 oldDuration, uint40 newDuration) func (_WorkerHub *WorkerHubFilterer) WatchPenaltyDurationUpdated(opts *bind.WatchOpts, sink chan<- *WorkerHubPenaltyDurationUpdated) (event.Subscription, error) { logs, sub, err := _WorkerHub.contract.WatchLogs(opts, "PenaltyDurationUpdated") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(WorkerHubPenaltyDurationUpdated) if err := _WorkerHub.contract.UnpackLog(event, "PenaltyDurationUpdated", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParsePenaltyDurationUpdated is a log parse operation binding the contract event 0xf7a437a25c636d2b29d0ba34f0f6870af14f44478eff2ac852f36030f2e2924e. // // Solidity: event PenaltyDurationUpdated(uint40 oldDuration, uint40 newDuration) func (_WorkerHub *WorkerHubFilterer) ParsePenaltyDurationUpdated(log types.Log) (*WorkerHubPenaltyDurationUpdated, error) { event := new(WorkerHubPenaltyDurationUpdated) if err := _WorkerHub.contract.UnpackLog(event, "PenaltyDurationUpdated", log); err != nil { return nil, err } event.Raw = log return event, nil } // WorkerHubRestakeIterator is returned from FilterRestake and is used to iterate over the raw logs and unpacked data for Restake events raised by the WorkerHub contract. type WorkerHubRestakeIterator struct { Event *WorkerHubRestake // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *WorkerHubRestakeIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(WorkerHubRestake) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(WorkerHubRestake) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *WorkerHubRestakeIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *WorkerHubRestakeIterator) Close() error { it.sub.Unsubscribe() return nil } // WorkerHubRestake represents a Restake event raised by the WorkerHub contract. type WorkerHubRestake struct { Miner common.Address Restake *big.Int Model common.Address Raw types.Log // Blockchain specific contextual infos } // FilterRestake is a free log retrieval operation binding the contract event 0x5f8a19f664e489b0ebcc62ec24b1bde029195fbb4af60118cecf0e16d6d95b2d. // // Solidity: event Restake(address indexed miner, uint256 restake, address indexed model) func (_WorkerHub *WorkerHubFilterer) FilterRestake(opts *bind.FilterOpts, miner []common.Address, model []common.Address) (*WorkerHubRestakeIterator, error) { var minerRule []interface{} for _, minerItem := range miner { minerRule = append(minerRule, minerItem) } var modelRule []interface{} for _, modelItem := range model { modelRule = append(modelRule, modelItem) } logs, sub, err := _WorkerHub.contract.FilterLogs(opts, "Restake", minerRule, modelRule) if err != nil { return nil, err } return &WorkerHubRestakeIterator{contract: _WorkerHub.contract, event: "Restake", logs: logs, sub: sub}, nil } // WatchRestake is a free log subscription operation binding the contract event 0x5f8a19f664e489b0ebcc62ec24b1bde029195fbb4af60118cecf0e16d6d95b2d. // // Solidity: event Restake(address indexed miner, uint256 restake, address indexed model) func (_WorkerHub *WorkerHubFilterer) WatchRestake(opts *bind.WatchOpts, sink chan<- *WorkerHubRestake, miner []common.Address, model []common.Address) (event.Subscription, error) { var minerRule []interface{} for _, minerItem := range miner { minerRule = append(minerRule, minerItem) } var modelRule []interface{} for _, modelItem := range model { modelRule = append(modelRule, modelItem) } logs, sub, err := _WorkerHub.contract.WatchLogs(opts, "Restake", minerRule, modelRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(WorkerHubRestake) if err := _WorkerHub.contract.UnpackLog(event, "Restake", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseRestake is a log parse operation binding the contract event 0x5f8a19f664e489b0ebcc62ec24b1bde029195fbb4af60118cecf0e16d6d95b2d. // // Solidity: event Restake(address indexed miner, uint256 restake, address indexed model) func (_WorkerHub *WorkerHubFilterer) ParseRestake(log types.Log) (*WorkerHubRestake, error) { event := new(WorkerHubRestake) if err := _WorkerHub.contract.UnpackLog(event, "Restake", log); err != nil { return nil, err } event.Raw = log return event, nil } // WorkerHubRewardClaimIterator is returned from FilterRewardClaim and is used to iterate over the raw logs and unpacked data for RewardClaim events raised by the WorkerHub contract. type WorkerHubRewardClaimIterator struct { Event *WorkerHubRewardClaim // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *WorkerHubRewardClaimIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(WorkerHubRewardClaim) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(WorkerHubRewardClaim) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *WorkerHubRewardClaimIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *WorkerHubRewardClaimIterator) Close() error { it.sub.Unsubscribe() return nil } // WorkerHubRewardClaim represents a RewardClaim event raised by the WorkerHub contract. type WorkerHubRewardClaim struct { Worker common.Address Value *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterRewardClaim is a free log retrieval operation binding the contract event 0x75690555e75b04e280e646889defdcbefd8401507e5394d1173fd84290944c29. // // Solidity: event RewardClaim(address indexed worker, uint256 value) func (_WorkerHub *WorkerHubFilterer) FilterRewardClaim(opts *bind.FilterOpts, worker []common.Address) (*WorkerHubRewardClaimIterator, error) { var workerRule []interface{} for _, workerItem := range worker { workerRule = append(workerRule, workerItem) } logs, sub, err := _WorkerHub.contract.FilterLogs(opts, "RewardClaim", workerRule) if err != nil { return nil, err } return &WorkerHubRewardClaimIterator{contract: _WorkerHub.contract, event: "RewardClaim", logs: logs, sub: sub}, nil } // WatchRewardClaim is a free log subscription operation binding the contract event 0x75690555e75b04e280e646889defdcbefd8401507e5394d1173fd84290944c29. // // Solidity: event RewardClaim(address indexed worker, uint256 value) func (_WorkerHub *WorkerHubFilterer) WatchRewardClaim(opts *bind.WatchOpts, sink chan<- *WorkerHubRewardClaim, worker []common.Address) (event.Subscription, error) { var workerRule []interface{} for _, workerItem := range worker { workerRule = append(workerRule, workerItem) } logs, sub, err := _WorkerHub.contract.WatchLogs(opts, "RewardClaim", workerRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(WorkerHubRewardClaim) if err := _WorkerHub.contract.UnpackLog(event, "RewardClaim", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseRewardClaim is a log parse operation binding the contract event 0x75690555e75b04e280e646889defdcbefd8401507e5394d1173fd84290944c29. // // Solidity: event RewardClaim(address indexed worker, uint256 value) func (_WorkerHub *WorkerHubFilterer) ParseRewardClaim(log types.Log) (*WorkerHubRewardClaim, error) { event := new(WorkerHubRewardClaim) if err := _WorkerHub.contract.UnpackLog(event, "RewardClaim", log); err != nil { return nil, err } event.Raw = log return event, nil } // WorkerHubRewardPerEpochIterator is returned from FilterRewardPerEpoch and is used to iterate over the raw logs and unpacked data for RewardPerEpoch events raised by the WorkerHub contract. type WorkerHubRewardPerEpochIterator struct { Event *WorkerHubRewardPerEpoch // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *WorkerHubRewardPerEpochIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(WorkerHubRewardPerEpoch) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(WorkerHubRewardPerEpoch) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *WorkerHubRewardPerEpochIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *WorkerHubRewardPerEpochIterator) Close() error { it.sub.Unsubscribe() return nil } // WorkerHubRewardPerEpoch represents a RewardPerEpoch event raised by the WorkerHub contract. type WorkerHubRewardPerEpoch struct { OldReward *big.Int NewReward *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterRewardPerEpoch is a free log retrieval operation binding the contract event 0x3d731857045dfa7982ed8ff308eeda54c7e156ba99609db02c50b4485f64c463. // // Solidity: event RewardPerEpoch(uint256 oldReward, uint256 newReward) func (_WorkerHub *WorkerHubFilterer) FilterRewardPerEpoch(opts *bind.FilterOpts) (*WorkerHubRewardPerEpochIterator, error) { logs, sub, err := _WorkerHub.contract.FilterLogs(opts, "RewardPerEpoch") if err != nil { return nil, err } return &WorkerHubRewardPerEpochIterator{contract: _WorkerHub.contract, event: "RewardPerEpoch", logs: logs, sub: sub}, nil } // WatchRewardPerEpoch is a free log subscription operation binding the contract event 0x3d731857045dfa7982ed8ff308eeda54c7e156ba99609db02c50b4485f64c463. // // Solidity: event RewardPerEpoch(uint256 oldReward, uint256 newReward) func (_WorkerHub *WorkerHubFilterer) WatchRewardPerEpoch(opts *bind.WatchOpts, sink chan<- *WorkerHubRewardPerEpoch) (event.Subscription, error) { logs, sub, err := _WorkerHub.contract.WatchLogs(opts, "RewardPerEpoch") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(WorkerHubRewardPerEpoch) if err := _WorkerHub.contract.UnpackLog(event, "RewardPerEpoch", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseRewardPerEpoch is a log parse operation binding the contract event 0x3d731857045dfa7982ed8ff308eeda54c7e156ba99609db02c50b4485f64c463. // // Solidity: event RewardPerEpoch(uint256 oldReward, uint256 newReward) func (_WorkerHub *WorkerHubFilterer) ParseRewardPerEpoch(log types.Log) (*WorkerHubRewardPerEpoch, error) { event := new(WorkerHubRewardPerEpoch) if err := _WorkerHub.contract.UnpackLog(event, "RewardPerEpoch", log); err != nil { return nil, err } event.Raw = log return event, nil } // WorkerHubSolutionSubmissionIterator is returned from FilterSolutionSubmission and is used to iterate over the raw logs and unpacked data for SolutionSubmission events raised by the WorkerHub contract. type WorkerHubSolutionSubmissionIterator struct { Event *WorkerHubSolutionSubmission // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *WorkerHubSolutionSubmissionIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(WorkerHubSolutionSubmission) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(WorkerHubSolutionSubmission) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *WorkerHubSolutionSubmissionIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *WorkerHubSolutionSubmissionIterator) Close() error { it.sub.Unsubscribe() return nil } // WorkerHubSolutionSubmission represents a SolutionSubmission event raised by the WorkerHub contract. type WorkerHubSolutionSubmission struct { Miner common.Address AssigmentId *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterSolutionSubmission is a free log retrieval operation binding the contract event 0x9f669b92b9cbc7611f7ab6c77db07a424051c777433e21bd90f1bdf940096dd9. // // Solidity: event SolutionSubmission(address indexed miner, uint256 indexed assigmentId) func (_WorkerHub *WorkerHubFilterer) FilterSolutionSubmission(opts *bind.FilterOpts, miner []common.Address, assigmentId []*big.Int) (*WorkerHubSolutionSubmissionIterator, error) { var minerRule []interface{} for _, minerItem := range miner { minerRule = append(minerRule, minerItem) } var assigmentIdRule []interface{} for _, assigmentIdItem := range assigmentId { assigmentIdRule = append(assigmentIdRule, assigmentIdItem) } logs, sub, err := _WorkerHub.contract.FilterLogs(opts, "SolutionSubmission", minerRule, assigmentIdRule) if err != nil { return nil, err } return &WorkerHubSolutionSubmissionIterator{contract: _WorkerHub.contract, event: "SolutionSubmission", logs: logs, sub: sub}, nil } // WatchSolutionSubmission is a free log subscription operation binding the contract event 0x9f669b92b9cbc7611f7ab6c77db07a424051c777433e21bd90f1bdf940096dd9. // // Solidity: event SolutionSubmission(address indexed miner, uint256 indexed assigmentId) func (_WorkerHub *WorkerHubFilterer) WatchSolutionSubmission(opts *bind.WatchOpts, sink chan<- *WorkerHubSolutionSubmission, miner []common.Address, assigmentId []*big.Int) (event.Subscription, error) { var minerRule []interface{} for _, minerItem := range miner { minerRule = append(minerRule, minerItem) } var assigmentIdRule []interface{} for _, assigmentIdItem := range assigmentId { assigmentIdRule = append(assigmentIdRule, assigmentIdItem) } logs, sub, err := _WorkerHub.contract.WatchLogs(opts, "SolutionSubmission", minerRule, assigmentIdRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(WorkerHubSolutionSubmission) if err := _WorkerHub.contract.UnpackLog(event, "SolutionSubmission", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseSolutionSubmission is a log parse operation binding the contract event 0x9f669b92b9cbc7611f7ab6c77db07a424051c777433e21bd90f1bdf940096dd9. // // Solidity: event SolutionSubmission(address indexed miner, uint256 indexed assigmentId) func (_WorkerHub *WorkerHubFilterer) ParseSolutionSubmission(log types.Log) (*WorkerHubSolutionSubmission, error) { event := new(WorkerHubSolutionSubmission) if err := _WorkerHub.contract.UnpackLog(event, "SolutionSubmission", log); err != nil { return nil, err } event.Raw = log return event, nil } // WorkerHubTopUpInferIterator is returned from FilterTopUpInfer and is used to iterate over the raw logs and unpacked data for TopUpInfer events raised by the WorkerHub contract. type WorkerHubTopUpInferIterator struct { Event *WorkerHubTopUpInfer // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *WorkerHubTopUpInferIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(WorkerHubTopUpInfer) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(WorkerHubTopUpInfer) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *WorkerHubTopUpInferIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *WorkerHubTopUpInferIterator) Close() error { it.sub.Unsubscribe() return nil } // WorkerHubTopUpInfer represents a TopUpInfer event raised by the WorkerHub contract. type WorkerHubTopUpInfer struct { InferenceId *big.Int Creator common.Address Value *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterTopUpInfer is a free log retrieval operation binding the contract event 0xe3154336ce264fe53bcfaedafded1428a28ae47b19b3d7a82e5d5ecde0960a57. // // Solidity: event TopUpInfer(uint256 indexed inferenceId, address indexed creator, uint256 value) func (_WorkerHub *WorkerHubFilterer) FilterTopUpInfer(opts *bind.FilterOpts, inferenceId []*big.Int, creator []common.Address) (*WorkerHubTopUpInferIterator, error) { var inferenceIdRule []interface{} for _, inferenceIdItem := range inferenceId { inferenceIdRule = append(inferenceIdRule, inferenceIdItem) } var creatorRule []interface{} for _, creatorItem := range creator { creatorRule = append(creatorRule, creatorItem) } logs, sub, err := _WorkerHub.contract.FilterLogs(opts, "TopUpInfer", inferenceIdRule, creatorRule) if err != nil { return nil, err } return &WorkerHubTopUpInferIterator{contract: _WorkerHub.contract, event: "TopUpInfer", logs: logs, sub: sub}, nil } // WatchTopUpInfer is a free log subscription operation binding the contract event 0xe3154336ce264fe53bcfaedafded1428a28ae47b19b3d7a82e5d5ecde0960a57. // // Solidity: event TopUpInfer(uint256 indexed inferenceId, address indexed creator, uint256 value) func (_WorkerHub *WorkerHubFilterer) WatchTopUpInfer(opts *bind.WatchOpts, sink chan<- *WorkerHubTopUpInfer, inferenceId []*big.Int, creator []common.Address) (event.Subscription, error) { var inferenceIdRule []interface{} for _, inferenceIdItem := range inferenceId { inferenceIdRule = append(inferenceIdRule, inferenceIdItem) } var creatorRule []interface{} for _, creatorItem := range creator { creatorRule = append(creatorRule, creatorItem) } logs, sub, err := _WorkerHub.contract.WatchLogs(opts, "TopUpInfer", inferenceIdRule, creatorRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(WorkerHubTopUpInfer) if err := _WorkerHub.contract.UnpackLog(event, "TopUpInfer", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseTopUpInfer is a log parse operation binding the contract event 0xe3154336ce264fe53bcfaedafded1428a28ae47b19b3d7a82e5d5ecde0960a57. // // Solidity: event TopUpInfer(uint256 indexed inferenceId, address indexed creator, uint256 value) func (_WorkerHub *WorkerHubFilterer) ParseTopUpInfer(log types.Log) (*WorkerHubTopUpInfer, error) { event := new(WorkerHubTopUpInfer) if err := _WorkerHub.contract.UnpackLog(event, "TopUpInfer", log); err != nil { return nil, err } event.Raw = log return event, nil } // WorkerHubTransferFeeIterator is returned from FilterTransferFee and is used to iterate over the raw logs and unpacked data for TransferFee events raised by the WorkerHub contract. type WorkerHubTransferFeeIterator struct { Event *WorkerHubTransferFee // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *WorkerHubTransferFeeIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(WorkerHubTransferFee) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(WorkerHubTransferFee) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *WorkerHubTransferFeeIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *WorkerHubTransferFeeIterator) Close() error { it.sub.Unsubscribe() return nil } // WorkerHubTransferFee represents a TransferFee event raised by the WorkerHub contract. type WorkerHubTransferFee struct { Miner common.Address MingingFee *big.Int Treasury common.Address ProtocolFee *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterTransferFee is a free log retrieval operation binding the contract event 0x782aada659bac972b342fea00dfc27389e876bece89a9eb635bd5a2c544e8a6b. // // Solidity: event TransferFee(address indexed miner, uint256 mingingFee, address indexed treasury, uint256 protocolFee) func (_WorkerHub *WorkerHubFilterer) FilterTransferFee(opts *bind.FilterOpts, miner []common.Address, treasury []common.Address) (*WorkerHubTransferFeeIterator, error) { var minerRule []interface{} for _, minerItem := range miner { minerRule = append(minerRule, minerItem) } var treasuryRule []interface{} for _, treasuryItem := range treasury { treasuryRule = append(treasuryRule, treasuryItem) } logs, sub, err := _WorkerHub.contract.FilterLogs(opts, "TransferFee", minerRule, treasuryRule) if err != nil { return nil, err } return &WorkerHubTransferFeeIterator{contract: _WorkerHub.contract, event: "TransferFee", logs: logs, sub: sub}, nil } // WatchTransferFee is a free log subscription operation binding the contract event 0x782aada659bac972b342fea00dfc27389e876bece89a9eb635bd5a2c544e8a6b. // // Solidity: event TransferFee(address indexed miner, uint256 mingingFee, address indexed treasury, uint256 protocolFee) func (_WorkerHub *WorkerHubFilterer) WatchTransferFee(opts *bind.WatchOpts, sink chan<- *WorkerHubTransferFee, miner []common.Address, treasury []common.Address) (event.Subscription, error) { var minerRule []interface{} for _, minerItem := range miner { minerRule = append(minerRule, minerItem) } var treasuryRule []interface{} for _, treasuryItem := range treasury { treasuryRule = append(treasuryRule, treasuryItem) } logs, sub, err := _WorkerHub.contract.WatchLogs(opts, "TransferFee", minerRule, treasuryRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(WorkerHubTransferFee) if err := _WorkerHub.contract.UnpackLog(event, "TransferFee", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseTransferFee is a log parse operation binding the contract event 0x782aada659bac972b342fea00dfc27389e876bece89a9eb635bd5a2c544e8a6b. // // Solidity: event TransferFee(address indexed miner, uint256 mingingFee, address indexed treasury, uint256 protocolFee) func (_WorkerHub *WorkerHubFilterer) ParseTransferFee(log types.Log) (*WorkerHubTransferFee, error) { event := new(WorkerHubTransferFee) if err := _WorkerHub.contract.UnpackLog(event, "TransferFee", log); err != nil { return nil, err } event.Raw = log return event, nil } // WorkerHubUnpausedIterator is returned from FilterUnpaused and is used to iterate over the raw logs and unpacked data for Unpaused events raised by the WorkerHub contract. type WorkerHubUnpausedIterator struct { Event *WorkerHubUnpaused // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *WorkerHubUnpausedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(WorkerHubUnpaused) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(WorkerHubUnpaused) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *WorkerHubUnpausedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *WorkerHubUnpausedIterator) Close() error { it.sub.Unsubscribe() return nil } // WorkerHubUnpaused represents a Unpaused event raised by the WorkerHub contract. type WorkerHubUnpaused struct { Account common.Address Raw types.Log // Blockchain specific contextual infos } // FilterUnpaused is a free log retrieval operation binding the contract event 0x5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa. // // Solidity: event Unpaused(address account) func (_WorkerHub *WorkerHubFilterer) FilterUnpaused(opts *bind.FilterOpts) (*WorkerHubUnpausedIterator, error) { logs, sub, err := _WorkerHub.contract.FilterLogs(opts, "Unpaused") if err != nil { return nil, err } return &WorkerHubUnpausedIterator{contract: _WorkerHub.contract, event: "Unpaused", logs: logs, sub: sub}, nil } // WatchUnpaused is a free log subscription operation binding the contract event 0x5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa. // // Solidity: event Unpaused(address account) func (_WorkerHub *WorkerHubFilterer) WatchUnpaused(opts *bind.WatchOpts, sink chan<- *WorkerHubUnpaused) (event.Subscription, error) { logs, sub, err := _WorkerHub.contract.WatchLogs(opts, "Unpaused") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(WorkerHubUnpaused) if err := _WorkerHub.contract.UnpackLog(event, "Unpaused", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseUnpaused is a log parse operation binding the contract event 0x5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa. // // Solidity: event Unpaused(address account) func (_WorkerHub *WorkerHubFilterer) ParseUnpaused(log types.Log) (*WorkerHubUnpaused, error) { event := new(WorkerHubUnpaused) if err := _WorkerHub.contract.UnpackLog(event, "Unpaused", log); err != nil { return nil, err } event.Raw = log return event, nil } // WorkerHubUnstakeDelayTimeIterator is returned from FilterUnstakeDelayTime and is used to iterate over the raw logs and unpacked data for UnstakeDelayTime events raised by the WorkerHub contract. type WorkerHubUnstakeDelayTimeIterator struct { Event *WorkerHubUnstakeDelayTime // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *WorkerHubUnstakeDelayTimeIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(WorkerHubUnstakeDelayTime) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(WorkerHubUnstakeDelayTime) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *WorkerHubUnstakeDelayTimeIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *WorkerHubUnstakeDelayTimeIterator) Close() error { it.sub.Unsubscribe() return nil } // WorkerHubUnstakeDelayTime represents a UnstakeDelayTime event raised by the WorkerHub contract. type WorkerHubUnstakeDelayTime struct { OldDelayTime *big.Int NewDelayTime *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterUnstakeDelayTime is a free log retrieval operation binding the contract event 0xdf63c46e5024e57c66aafc6698e317c78589c870dca694678c89dd379c5fd490. // // Solidity: event UnstakeDelayTime(uint256 oldDelayTime, uint256 newDelayTime) func (_WorkerHub *WorkerHubFilterer) FilterUnstakeDelayTime(opts *bind.FilterOpts) (*WorkerHubUnstakeDelayTimeIterator, error) { logs, sub, err := _WorkerHub.contract.FilterLogs(opts, "UnstakeDelayTime") if err != nil { return nil, err } return &WorkerHubUnstakeDelayTimeIterator{contract: _WorkerHub.contract, event: "UnstakeDelayTime", logs: logs, sub: sub}, nil } // WatchUnstakeDelayTime is a free log subscription operation binding the contract event 0xdf63c46e5024e57c66aafc6698e317c78589c870dca694678c89dd379c5fd490. // // Solidity: event UnstakeDelayTime(uint256 oldDelayTime, uint256 newDelayTime) func (_WorkerHub *WorkerHubFilterer) WatchUnstakeDelayTime(opts *bind.WatchOpts, sink chan<- *WorkerHubUnstakeDelayTime) (event.Subscription, error) { logs, sub, err := _WorkerHub.contract.WatchLogs(opts, "UnstakeDelayTime") if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(WorkerHubUnstakeDelayTime) if err := _WorkerHub.contract.UnpackLog(event, "UnstakeDelayTime", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseUnstakeDelayTime is a log parse operation binding the contract event 0xdf63c46e5024e57c66aafc6698e317c78589c870dca694678c89dd379c5fd490. // // Solidity: event UnstakeDelayTime(uint256 oldDelayTime, uint256 newDelayTime) func (_WorkerHub *WorkerHubFilterer) ParseUnstakeDelayTime(log types.Log) (*WorkerHubUnstakeDelayTime, error) { event := new(WorkerHubUnstakeDelayTime) if err := _WorkerHub.contract.UnpackLog(event, "UnstakeDelayTime", log); err != nil { return nil, err } event.Raw = log return event, nil } // WorkerHubValidatorExtraStakeIterator is returned from FilterValidatorExtraStake and is used to iterate over the raw logs and unpacked data for ValidatorExtraStake events raised by the WorkerHub contract. type WorkerHubValidatorExtraStakeIterator struct { Event *WorkerHubValidatorExtraStake // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *WorkerHubValidatorExtraStakeIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(WorkerHubValidatorExtraStake) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(WorkerHubValidatorExtraStake) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *WorkerHubValidatorExtraStakeIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *WorkerHubValidatorExtraStakeIterator) Close() error { it.sub.Unsubscribe() return nil } // WorkerHubValidatorExtraStake represents a ValidatorExtraStake event raised by the WorkerHub contract. type WorkerHubValidatorExtraStake struct { Validator common.Address Value *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterValidatorExtraStake is a free log retrieval operation binding the contract event 0x34922005bddea1820fe67d4e0d79b91845321a99fc0d43fe025b74ac23e1063d. // // Solidity: event ValidatorExtraStake(address indexed validator, uint256 value) func (_WorkerHub *WorkerHubFilterer) FilterValidatorExtraStake(opts *bind.FilterOpts, validator []common.Address) (*WorkerHubValidatorExtraStakeIterator, error) { var validatorRule []interface{} for _, validatorItem := range validator { validatorRule = append(validatorRule, validatorItem) } logs, sub, err := _WorkerHub.contract.FilterLogs(opts, "ValidatorExtraStake", validatorRule) if err != nil { return nil, err } return &WorkerHubValidatorExtraStakeIterator{contract: _WorkerHub.contract, event: "ValidatorExtraStake", logs: logs, sub: sub}, nil } // WatchValidatorExtraStake is a free log subscription operation binding the contract event 0x34922005bddea1820fe67d4e0d79b91845321a99fc0d43fe025b74ac23e1063d. // // Solidity: event ValidatorExtraStake(address indexed validator, uint256 value) func (_WorkerHub *WorkerHubFilterer) WatchValidatorExtraStake(opts *bind.WatchOpts, sink chan<- *WorkerHubValidatorExtraStake, validator []common.Address) (event.Subscription, error) { var validatorRule []interface{} for _, validatorItem := range validator { validatorRule = append(validatorRule, validatorItem) } logs, sub, err := _WorkerHub.contract.WatchLogs(opts, "ValidatorExtraStake", validatorRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(WorkerHubValidatorExtraStake) if err := _WorkerHub.contract.UnpackLog(event, "ValidatorExtraStake", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseValidatorExtraStake is a log parse operation binding the contract event 0x34922005bddea1820fe67d4e0d79b91845321a99fc0d43fe025b74ac23e1063d. // // Solidity: event ValidatorExtraStake(address indexed validator, uint256 value) func (_WorkerHub *WorkerHubFilterer) ParseValidatorExtraStake(log types.Log) (*WorkerHubValidatorExtraStake, error) { event := new(WorkerHubValidatorExtraStake) if err := _WorkerHub.contract.UnpackLog(event, "ValidatorExtraStake", log); err != nil { return nil, err } event.Raw = log return event, nil } // WorkerHubValidatorJoinIterator is returned from FilterValidatorJoin and is used to iterate over the raw logs and unpacked data for ValidatorJoin events raised by the WorkerHub contract. type WorkerHubValidatorJoinIterator struct { Event *WorkerHubValidatorJoin // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *WorkerHubValidatorJoinIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(WorkerHubValidatorJoin) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(WorkerHubValidatorJoin) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *WorkerHubValidatorJoinIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *WorkerHubValidatorJoinIterator) Close() error { it.sub.Unsubscribe() return nil } // WorkerHubValidatorJoin represents a ValidatorJoin event raised by the WorkerHub contract. type WorkerHubValidatorJoin struct { Validator common.Address Raw types.Log // Blockchain specific contextual infos } // FilterValidatorJoin is a free log retrieval operation binding the contract event 0x8c97974b44dade54a2967b9de94b1229332187b50127027ff91c2e9b28d69d75. // // Solidity: event ValidatorJoin(address indexed validator) func (_WorkerHub *WorkerHubFilterer) FilterValidatorJoin(opts *bind.FilterOpts, validator []common.Address) (*WorkerHubValidatorJoinIterator, error) { var validatorRule []interface{} for _, validatorItem := range validator { validatorRule = append(validatorRule, validatorItem) } logs, sub, err := _WorkerHub.contract.FilterLogs(opts, "ValidatorJoin", validatorRule) if err != nil { return nil, err } return &WorkerHubValidatorJoinIterator{contract: _WorkerHub.contract, event: "ValidatorJoin", logs: logs, sub: sub}, nil } // WatchValidatorJoin is a free log subscription operation binding the contract event 0x8c97974b44dade54a2967b9de94b1229332187b50127027ff91c2e9b28d69d75. // // Solidity: event ValidatorJoin(address indexed validator) func (_WorkerHub *WorkerHubFilterer) WatchValidatorJoin(opts *bind.WatchOpts, sink chan<- *WorkerHubValidatorJoin, validator []common.Address) (event.Subscription, error) { var validatorRule []interface{} for _, validatorItem := range validator { validatorRule = append(validatorRule, validatorItem) } logs, sub, err := _WorkerHub.contract.WatchLogs(opts, "ValidatorJoin", validatorRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(WorkerHubValidatorJoin) if err := _WorkerHub.contract.UnpackLog(event, "ValidatorJoin", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseValidatorJoin is a log parse operation binding the contract event 0x8c97974b44dade54a2967b9de94b1229332187b50127027ff91c2e9b28d69d75. // // Solidity: event ValidatorJoin(address indexed validator) func (_WorkerHub *WorkerHubFilterer) ParseValidatorJoin(log types.Log) (*WorkerHubValidatorJoin, error) { event := new(WorkerHubValidatorJoin) if err := _WorkerHub.contract.UnpackLog(event, "ValidatorJoin", log); err != nil { return nil, err } event.Raw = log return event, nil } // WorkerHubValidatorRegistrationIterator is returned from FilterValidatorRegistration and is used to iterate over the raw logs and unpacked data for ValidatorRegistration events raised by the WorkerHub contract. type WorkerHubValidatorRegistrationIterator struct { Event *WorkerHubValidatorRegistration // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *WorkerHubValidatorRegistrationIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(WorkerHubValidatorRegistration) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(WorkerHubValidatorRegistration) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *WorkerHubValidatorRegistrationIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *WorkerHubValidatorRegistrationIterator) Close() error { it.sub.Unsubscribe() return nil } // WorkerHubValidatorRegistration represents a ValidatorRegistration event raised by the WorkerHub contract. type WorkerHubValidatorRegistration struct { Validator common.Address Tier uint16 Value *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterValidatorRegistration is a free log retrieval operation binding the contract event 0xcc39e21667abb04befce1bb972c8b03a1b15e1f4b84a3db2535c2fcd6179bb6f. // // Solidity: event ValidatorRegistration(address indexed validator, uint16 indexed tier, uint256 value) func (_WorkerHub *WorkerHubFilterer) FilterValidatorRegistration(opts *bind.FilterOpts, validator []common.Address, tier []uint16) (*WorkerHubValidatorRegistrationIterator, error) { var validatorRule []interface{} for _, validatorItem := range validator { validatorRule = append(validatorRule, validatorItem) } var tierRule []interface{} for _, tierItem := range tier { tierRule = append(tierRule, tierItem) } logs, sub, err := _WorkerHub.contract.FilterLogs(opts, "ValidatorRegistration", validatorRule, tierRule) if err != nil { return nil, err } return &WorkerHubValidatorRegistrationIterator{contract: _WorkerHub.contract, event: "ValidatorRegistration", logs: logs, sub: sub}, nil } // WatchValidatorRegistration is a free log subscription operation binding the contract event 0xcc39e21667abb04befce1bb972c8b03a1b15e1f4b84a3db2535c2fcd6179bb6f. // // Solidity: event ValidatorRegistration(address indexed validator, uint16 indexed tier, uint256 value) func (_WorkerHub *WorkerHubFilterer) WatchValidatorRegistration(opts *bind.WatchOpts, sink chan<- *WorkerHubValidatorRegistration, validator []common.Address, tier []uint16) (event.Subscription, error) { var validatorRule []interface{} for _, validatorItem := range validator { validatorRule = append(validatorRule, validatorItem) } var tierRule []interface{} for _, tierItem := range tier { tierRule = append(tierRule, tierItem) } logs, sub, err := _WorkerHub.contract.WatchLogs(opts, "ValidatorRegistration", validatorRule, tierRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(WorkerHubValidatorRegistration) if err := _WorkerHub.contract.UnpackLog(event, "ValidatorRegistration", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseValidatorRegistration is a log parse operation binding the contract event 0xcc39e21667abb04befce1bb972c8b03a1b15e1f4b84a3db2535c2fcd6179bb6f. // // Solidity: event ValidatorRegistration(address indexed validator, uint16 indexed tier, uint256 value) func (_WorkerHub *WorkerHubFilterer) ParseValidatorRegistration(log types.Log) (*WorkerHubValidatorRegistration, error) { event := new(WorkerHubValidatorRegistration) if err := _WorkerHub.contract.UnpackLog(event, "ValidatorRegistration", log); err != nil { return nil, err } event.Raw = log return event, nil } // WorkerHubValidatorUnregistrationIterator is returned from FilterValidatorUnregistration and is used to iterate over the raw logs and unpacked data for ValidatorUnregistration events raised by the WorkerHub contract. type WorkerHubValidatorUnregistrationIterator struct { Event *WorkerHubValidatorUnregistration // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *WorkerHubValidatorUnregistrationIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(WorkerHubValidatorUnregistration) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(WorkerHubValidatorUnregistration) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *WorkerHubValidatorUnregistrationIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *WorkerHubValidatorUnregistrationIterator) Close() error { it.sub.Unsubscribe() return nil } // WorkerHubValidatorUnregistration represents a ValidatorUnregistration event raised by the WorkerHub contract. type WorkerHubValidatorUnregistration struct { Validator common.Address Raw types.Log // Blockchain specific contextual infos } // FilterValidatorUnregistration is a free log retrieval operation binding the contract event 0x3b4cb6e47f5990bd17a69f36b4e7e5b9eca32c5fbc0b09ffa37149fb77348816. // // Solidity: event ValidatorUnregistration(address indexed validator) func (_WorkerHub *WorkerHubFilterer) FilterValidatorUnregistration(opts *bind.FilterOpts, validator []common.Address) (*WorkerHubValidatorUnregistrationIterator, error) { var validatorRule []interface{} for _, validatorItem := range validator { validatorRule = append(validatorRule, validatorItem) } logs, sub, err := _WorkerHub.contract.FilterLogs(opts, "ValidatorUnregistration", validatorRule) if err != nil { return nil, err } return &WorkerHubValidatorUnregistrationIterator{contract: _WorkerHub.contract, event: "ValidatorUnregistration", logs: logs, sub: sub}, nil } // WatchValidatorUnregistration is a free log subscription operation binding the contract event 0x3b4cb6e47f5990bd17a69f36b4e7e5b9eca32c5fbc0b09ffa37149fb77348816. // // Solidity: event ValidatorUnregistration(address indexed validator) func (_WorkerHub *WorkerHubFilterer) WatchValidatorUnregistration(opts *bind.WatchOpts, sink chan<- *WorkerHubValidatorUnregistration, validator []common.Address) (event.Subscription, error) { var validatorRule []interface{} for _, validatorItem := range validator { validatorRule = append(validatorRule, validatorItem) } logs, sub, err := _WorkerHub.contract.WatchLogs(opts, "ValidatorUnregistration", validatorRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(WorkerHubValidatorUnregistration) if err := _WorkerHub.contract.UnpackLog(event, "ValidatorUnregistration", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseValidatorUnregistration is a log parse operation binding the contract event 0x3b4cb6e47f5990bd17a69f36b4e7e5b9eca32c5fbc0b09ffa37149fb77348816. // // Solidity: event ValidatorUnregistration(address indexed validator) func (_WorkerHub *WorkerHubFilterer) ParseValidatorUnregistration(log types.Log) (*WorkerHubValidatorUnregistration, error) { event := new(WorkerHubValidatorUnregistration) if err := _WorkerHub.contract.UnpackLog(event, "ValidatorUnregistration", log); err != nil { return nil, err } event.Raw = log return event, nil } // WorkerHubValidatorUnstakeIterator is returned from FilterValidatorUnstake and is used to iterate over the raw logs and unpacked data for ValidatorUnstake events raised by the WorkerHub contract. type WorkerHubValidatorUnstakeIterator struct { Event *WorkerHubValidatorUnstake // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *WorkerHubValidatorUnstakeIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(WorkerHubValidatorUnstake) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(WorkerHubValidatorUnstake) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *WorkerHubValidatorUnstakeIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *WorkerHubValidatorUnstakeIterator) Close() error { it.sub.Unsubscribe() return nil } // WorkerHubValidatorUnstake represents a ValidatorUnstake event raised by the WorkerHub contract. type WorkerHubValidatorUnstake struct { Validator common.Address Stake *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterValidatorUnstake is a free log retrieval operation binding the contract event 0xfa8e6fe2f340a3c8da106ab24f4645cdc4f034a0c0514cabfa764531f13798b3. // // Solidity: event ValidatorUnstake(address indexed validator, uint256 stake) func (_WorkerHub *WorkerHubFilterer) FilterValidatorUnstake(opts *bind.FilterOpts, validator []common.Address) (*WorkerHubValidatorUnstakeIterator, error) { var validatorRule []interface{} for _, validatorItem := range validator { validatorRule = append(validatorRule, validatorItem) } logs, sub, err := _WorkerHub.contract.FilterLogs(opts, "ValidatorUnstake", validatorRule) if err != nil { return nil, err } return &WorkerHubValidatorUnstakeIterator{contract: _WorkerHub.contract, event: "ValidatorUnstake", logs: logs, sub: sub}, nil } // WatchValidatorUnstake is a free log subscription operation binding the contract event 0xfa8e6fe2f340a3c8da106ab24f4645cdc4f034a0c0514cabfa764531f13798b3. // // Solidity: event ValidatorUnstake(address indexed validator, uint256 stake) func (_WorkerHub *WorkerHubFilterer) WatchValidatorUnstake(opts *bind.WatchOpts, sink chan<- *WorkerHubValidatorUnstake, validator []common.Address) (event.Subscription, error) { var validatorRule []interface{} for _, validatorItem := range validator { validatorRule = append(validatorRule, validatorItem) } logs, sub, err := _WorkerHub.contract.WatchLogs(opts, "ValidatorUnstake", validatorRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(WorkerHubValidatorUnstake) if err := _WorkerHub.contract.UnpackLog(event, "ValidatorUnstake", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseValidatorUnstake is a log parse operation binding the contract event 0xfa8e6fe2f340a3c8da106ab24f4645cdc4f034a0c0514cabfa764531f13798b3. // // Solidity: event ValidatorUnstake(address indexed validator, uint256 stake) func (_WorkerHub *WorkerHubFilterer) ParseValidatorUnstake(log types.Log) (*WorkerHubValidatorUnstake, error) { event := new(WorkerHubValidatorUnstake) if err := _WorkerHub.contract.UnpackLog(event, "ValidatorUnstake", log); err != nil { return nil, err } event.Raw = log return event, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/binds/zksyncnonfungiblepositionmanager/NonfungiblePositionManager.go ================================================ // Code generated - DO NOT EDIT. // This file is a generated binding and any manual changes will be lost. package zksyncnonfungiblepositionmanager import ( "errors" "math/big" "strings" ethereum "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/event" ) // Reference imports to suppress errors if they are not otherwise used. var ( _ = errors.New _ = big.NewInt _ = strings.NewReader _ = ethereum.NotFound _ = bind.Bind _ = common.Big1 _ = types.BloomLookup _ = event.NewSubscription _ = abi.ConvertType ) // INonfungiblePositionManagerCollectParams is an auto generated low-level Go binding around an user-defined struct. type INonfungiblePositionManagerCollectParams struct { TokenId *big.Int Recipient common.Address Amount0Max *big.Int Amount1Max *big.Int } // INonfungiblePositionManagerDecreaseLiquidityParams is an auto generated low-level Go binding around an user-defined struct. type INonfungiblePositionManagerDecreaseLiquidityParams struct { TokenId *big.Int Liquidity *big.Int Amount0Min *big.Int Amount1Min *big.Int Deadline *big.Int } // INonfungiblePositionManagerIncreaseLiquidityParams is an auto generated low-level Go binding around an user-defined struct. type INonfungiblePositionManagerIncreaseLiquidityParams struct { TokenId *big.Int Amount0Desired *big.Int Amount1Desired *big.Int Amount0Min *big.Int Amount1Min *big.Int Deadline *big.Int } // INonfungiblePositionManagerMintParams is an auto generated low-level Go binding around an user-defined struct. type INonfungiblePositionManagerMintParams struct { Token0 common.Address Token1 common.Address Fee *big.Int TickLower *big.Int TickUpper *big.Int Amount0Desired *big.Int Amount1Desired *big.Int Amount0Min *big.Int Amount1Min *big.Int Recipient common.Address Deadline *big.Int } // NonfungiblePositionManagerMetaData contains all meta data concerning the NonfungiblePositionManager contract. var NonfungiblePositionManagerMetaData = &bind.MetaData{ ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_factory\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_WETH9\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_tokenDescriptor_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"approved\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"ApprovalForAll\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"}],\"name\":\"Collect\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"liquidity\",\"type\":\"uint128\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"}],\"name\":\"DecreaseLiquidity\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"liquidity\",\"type\":\"uint128\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"}],\"name\":\"IncreaseLiquidity\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"DOMAIN_SEPARATOR\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"PERMIT_TYPEHASH\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"WETH9\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"baseURI\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"burn\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint128\",\"name\":\"amount0Max\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"amount1Max\",\"type\":\"uint128\"}],\"internalType\":\"structINonfungiblePositionManager.CollectParams\",\"name\":\"params\",\"type\":\"tuple\"}],\"name\":\"collect\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token0\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token1\",\"type\":\"address\"},{\"internalType\":\"uint24\",\"name\":\"fee\",\"type\":\"uint24\"},{\"internalType\":\"uint160\",\"name\":\"sqrtPriceX96\",\"type\":\"uint160\"}],\"name\":\"createAndInitializePoolIfNecessary\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint128\",\"name\":\"liquidity\",\"type\":\"uint128\"},{\"internalType\":\"uint256\",\"name\":\"amount0Min\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Min\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"}],\"internalType\":\"structINonfungiblePositionManager.DecreaseLiquidityParams\",\"name\":\"params\",\"type\":\"tuple\"}],\"name\":\"decreaseLiquidity\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"factory\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"getApproved\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount0Desired\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Desired\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount0Min\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Min\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"}],\"internalType\":\"structINonfungiblePositionManager.IncreaseLiquidityParams\",\"name\":\"params\",\"type\":\"tuple\"}],\"name\":\"increaseLiquidity\",\"outputs\":[{\"internalType\":\"uint128\",\"name\":\"liquidity\",\"type\":\"uint128\"},{\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"name\":\"isApprovedForAll\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"token0\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token1\",\"type\":\"address\"},{\"internalType\":\"uint24\",\"name\":\"fee\",\"type\":\"uint24\"},{\"internalType\":\"int24\",\"name\":\"tickLower\",\"type\":\"int24\"},{\"internalType\":\"int24\",\"name\":\"tickUpper\",\"type\":\"int24\"},{\"internalType\":\"uint256\",\"name\":\"amount0Desired\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Desired\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount0Min\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Min\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"}],\"internalType\":\"structINonfungiblePositionManager.MintParams\",\"name\":\"params\",\"type\":\"tuple\"}],\"name\":\"mint\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint128\",\"name\":\"liquidity\",\"type\":\"uint128\"},{\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes[]\",\"name\":\"data\",\"type\":\"bytes[]\"}],\"name\":\"multicall\",\"outputs\":[{\"internalType\":\"bytes[]\",\"name\":\"results\",\"type\":\"bytes[]\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"ownerOf\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"permit\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"positions\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"nonce\",\"type\":\"uint96\"},{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token0\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token1\",\"type\":\"address\"},{\"internalType\":\"uint24\",\"name\":\"fee\",\"type\":\"uint24\"},{\"internalType\":\"int24\",\"name\":\"tickLower\",\"type\":\"int24\"},{\"internalType\":\"int24\",\"name\":\"tickUpper\",\"type\":\"int24\"},{\"internalType\":\"uint128\",\"name\":\"liquidity\",\"type\":\"uint128\"},{\"internalType\":\"uint256\",\"name\":\"feeGrowthInside0LastX128\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"feeGrowthInside1LastX128\",\"type\":\"uint256\"},{\"internalType\":\"uint128\",\"name\":\"tokensOwed0\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"tokensOwed1\",\"type\":\"uint128\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"refundETH\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"safeTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"safeTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"selfPermit\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiry\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"selfPermitAllowed\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiry\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"selfPermitAllowedIfNecessary\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"selfPermitIfNecessary\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"setApprovalForAll\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amountMinimum\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"}],\"name\":\"sweepToken\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"}],\"name\":\"tokenByIndex\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"}],\"name\":\"tokenOfOwnerByIndex\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"tokenURI\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0Owed\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Owed\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"uniswapV3MintCallback\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountMinimum\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"}],\"name\":\"unwrapWETH9\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]", } // NonfungiblePositionManagerABI is the input ABI used to generate the binding from. // Deprecated: Use NonfungiblePositionManagerMetaData.ABI instead. var NonfungiblePositionManagerABI = NonfungiblePositionManagerMetaData.ABI // NonfungiblePositionManager is an auto generated Go binding around an Ethereum contract. type NonfungiblePositionManager struct { NonfungiblePositionManagerCaller // Read-only binding to the contract NonfungiblePositionManagerTransactor // Write-only binding to the contract NonfungiblePositionManagerFilterer // Log filterer for contract events } // NonfungiblePositionManagerCaller is an auto generated read-only Go binding around an Ethereum contract. type NonfungiblePositionManagerCaller struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // NonfungiblePositionManagerTransactor is an auto generated write-only Go binding around an Ethereum contract. type NonfungiblePositionManagerTransactor struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // NonfungiblePositionManagerFilterer is an auto generated log filtering Go binding around an Ethereum contract events. type NonfungiblePositionManagerFilterer struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // NonfungiblePositionManagerSession is an auto generated Go binding around an Ethereum contract, // with pre-set call and transact options. type NonfungiblePositionManagerSession struct { Contract *NonfungiblePositionManager // Generic contract binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // NonfungiblePositionManagerCallerSession is an auto generated read-only Go binding around an Ethereum contract, // with pre-set call options. type NonfungiblePositionManagerCallerSession struct { Contract *NonfungiblePositionManagerCaller // Generic contract caller binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session } // NonfungiblePositionManagerTransactorSession is an auto generated write-only Go binding around an Ethereum contract, // with pre-set transact options. type NonfungiblePositionManagerTransactorSession struct { Contract *NonfungiblePositionManagerTransactor // Generic contract transactor binding to set the session for TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // NonfungiblePositionManagerRaw is an auto generated low-level Go binding around an Ethereum contract. type NonfungiblePositionManagerRaw struct { Contract *NonfungiblePositionManager // Generic contract binding to access the raw methods on } // NonfungiblePositionManagerCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. type NonfungiblePositionManagerCallerRaw struct { Contract *NonfungiblePositionManagerCaller // Generic read-only contract binding to access the raw methods on } // NonfungiblePositionManagerTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. type NonfungiblePositionManagerTransactorRaw struct { Contract *NonfungiblePositionManagerTransactor // Generic write-only contract binding to access the raw methods on } // NewNonfungiblePositionManager creates a new instance of NonfungiblePositionManager, bound to a specific deployed contract. func NewNonfungiblePositionManager(address common.Address, backend bind.ContractBackend) (*NonfungiblePositionManager, error) { contract, err := bindNonfungiblePositionManager(address, backend, backend, backend) if err != nil { return nil, err } return &NonfungiblePositionManager{NonfungiblePositionManagerCaller: NonfungiblePositionManagerCaller{contract: contract}, NonfungiblePositionManagerTransactor: NonfungiblePositionManagerTransactor{contract: contract}, NonfungiblePositionManagerFilterer: NonfungiblePositionManagerFilterer{contract: contract}}, nil } // NewNonfungiblePositionManagerCaller creates a new read-only instance of NonfungiblePositionManager, bound to a specific deployed contract. func NewNonfungiblePositionManagerCaller(address common.Address, caller bind.ContractCaller) (*NonfungiblePositionManagerCaller, error) { contract, err := bindNonfungiblePositionManager(address, caller, nil, nil) if err != nil { return nil, err } return &NonfungiblePositionManagerCaller{contract: contract}, nil } // NewNonfungiblePositionManagerTransactor creates a new write-only instance of NonfungiblePositionManager, bound to a specific deployed contract. func NewNonfungiblePositionManagerTransactor(address common.Address, transactor bind.ContractTransactor) (*NonfungiblePositionManagerTransactor, error) { contract, err := bindNonfungiblePositionManager(address, nil, transactor, nil) if err != nil { return nil, err } return &NonfungiblePositionManagerTransactor{contract: contract}, nil } // NewNonfungiblePositionManagerFilterer creates a new log filterer instance of NonfungiblePositionManager, bound to a specific deployed contract. func NewNonfungiblePositionManagerFilterer(address common.Address, filterer bind.ContractFilterer) (*NonfungiblePositionManagerFilterer, error) { contract, err := bindNonfungiblePositionManager(address, nil, nil, filterer) if err != nil { return nil, err } return &NonfungiblePositionManagerFilterer{contract: contract}, nil } // bindNonfungiblePositionManager binds a generic wrapper to an already deployed contract. func bindNonfungiblePositionManager(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { parsed, err := NonfungiblePositionManagerMetaData.GetAbi() if err != nil { return nil, err } return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_NonfungiblePositionManager *NonfungiblePositionManagerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _NonfungiblePositionManager.Contract.NonfungiblePositionManagerCaller.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_NonfungiblePositionManager *NonfungiblePositionManagerRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.NonfungiblePositionManagerTransactor.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_NonfungiblePositionManager *NonfungiblePositionManagerRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.NonfungiblePositionManagerTransactor.contract.Transact(opts, method, params...) } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _NonfungiblePositionManager.Contract.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.contract.Transact(opts, method, params...) } // DOMAINSEPARATOR is a free data retrieval call binding the contract method 0x3644e515. // // Solidity: function DOMAIN_SEPARATOR() view returns(bytes32) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) DOMAINSEPARATOR(opts *bind.CallOpts) ([32]byte, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "DOMAIN_SEPARATOR") if err != nil { return *new([32]byte), err } out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) return out0, err } // DOMAINSEPARATOR is a free data retrieval call binding the contract method 0x3644e515. // // Solidity: function DOMAIN_SEPARATOR() view returns(bytes32) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) DOMAINSEPARATOR() ([32]byte, error) { return _NonfungiblePositionManager.Contract.DOMAINSEPARATOR(&_NonfungiblePositionManager.CallOpts) } // DOMAINSEPARATOR is a free data retrieval call binding the contract method 0x3644e515. // // Solidity: function DOMAIN_SEPARATOR() view returns(bytes32) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) DOMAINSEPARATOR() ([32]byte, error) { return _NonfungiblePositionManager.Contract.DOMAINSEPARATOR(&_NonfungiblePositionManager.CallOpts) } // PERMITTYPEHASH is a free data retrieval call binding the contract method 0x30adf81f. // // Solidity: function PERMIT_TYPEHASH() view returns(bytes32) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) PERMITTYPEHASH(opts *bind.CallOpts) ([32]byte, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "PERMIT_TYPEHASH") if err != nil { return *new([32]byte), err } out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) return out0, err } // PERMITTYPEHASH is a free data retrieval call binding the contract method 0x30adf81f. // // Solidity: function PERMIT_TYPEHASH() view returns(bytes32) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) PERMITTYPEHASH() ([32]byte, error) { return _NonfungiblePositionManager.Contract.PERMITTYPEHASH(&_NonfungiblePositionManager.CallOpts) } // PERMITTYPEHASH is a free data retrieval call binding the contract method 0x30adf81f. // // Solidity: function PERMIT_TYPEHASH() view returns(bytes32) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) PERMITTYPEHASH() ([32]byte, error) { return _NonfungiblePositionManager.Contract.PERMITTYPEHASH(&_NonfungiblePositionManager.CallOpts) } // WETH9 is a free data retrieval call binding the contract method 0x4aa4a4fc. // // Solidity: function WETH9() view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) WETH9(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "WETH9") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // WETH9 is a free data retrieval call binding the contract method 0x4aa4a4fc. // // Solidity: function WETH9() view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) WETH9() (common.Address, error) { return _NonfungiblePositionManager.Contract.WETH9(&_NonfungiblePositionManager.CallOpts) } // WETH9 is a free data retrieval call binding the contract method 0x4aa4a4fc. // // Solidity: function WETH9() view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) WETH9() (common.Address, error) { return _NonfungiblePositionManager.Contract.WETH9(&_NonfungiblePositionManager.CallOpts) } // BalanceOf is a free data retrieval call binding the contract method 0x70a08231. // // Solidity: function balanceOf(address owner) view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) BalanceOf(opts *bind.CallOpts, owner common.Address) (*big.Int, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "balanceOf", owner) if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // BalanceOf is a free data retrieval call binding the contract method 0x70a08231. // // Solidity: function balanceOf(address owner) view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) BalanceOf(owner common.Address) (*big.Int, error) { return _NonfungiblePositionManager.Contract.BalanceOf(&_NonfungiblePositionManager.CallOpts, owner) } // BalanceOf is a free data retrieval call binding the contract method 0x70a08231. // // Solidity: function balanceOf(address owner) view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) BalanceOf(owner common.Address) (*big.Int, error) { return _NonfungiblePositionManager.Contract.BalanceOf(&_NonfungiblePositionManager.CallOpts, owner) } // BaseURI is a free data retrieval call binding the contract method 0x6c0360eb. // // Solidity: function baseURI() pure returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) BaseURI(opts *bind.CallOpts) (string, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "baseURI") if err != nil { return *new(string), err } out0 := *abi.ConvertType(out[0], new(string)).(*string) return out0, err } // BaseURI is a free data retrieval call binding the contract method 0x6c0360eb. // // Solidity: function baseURI() pure returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) BaseURI() (string, error) { return _NonfungiblePositionManager.Contract.BaseURI(&_NonfungiblePositionManager.CallOpts) } // BaseURI is a free data retrieval call binding the contract method 0x6c0360eb. // // Solidity: function baseURI() pure returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) BaseURI() (string, error) { return _NonfungiblePositionManager.Contract.BaseURI(&_NonfungiblePositionManager.CallOpts) } // Factory is a free data retrieval call binding the contract method 0xc45a0155. // // Solidity: function factory() view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) Factory(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "factory") if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // Factory is a free data retrieval call binding the contract method 0xc45a0155. // // Solidity: function factory() view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Factory() (common.Address, error) { return _NonfungiblePositionManager.Contract.Factory(&_NonfungiblePositionManager.CallOpts) } // Factory is a free data retrieval call binding the contract method 0xc45a0155. // // Solidity: function factory() view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) Factory() (common.Address, error) { return _NonfungiblePositionManager.Contract.Factory(&_NonfungiblePositionManager.CallOpts) } // GetApproved is a free data retrieval call binding the contract method 0x081812fc. // // Solidity: function getApproved(uint256 tokenId) view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) GetApproved(opts *bind.CallOpts, tokenId *big.Int) (common.Address, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "getApproved", tokenId) if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // GetApproved is a free data retrieval call binding the contract method 0x081812fc. // // Solidity: function getApproved(uint256 tokenId) view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) GetApproved(tokenId *big.Int) (common.Address, error) { return _NonfungiblePositionManager.Contract.GetApproved(&_NonfungiblePositionManager.CallOpts, tokenId) } // GetApproved is a free data retrieval call binding the contract method 0x081812fc. // // Solidity: function getApproved(uint256 tokenId) view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) GetApproved(tokenId *big.Int) (common.Address, error) { return _NonfungiblePositionManager.Contract.GetApproved(&_NonfungiblePositionManager.CallOpts, tokenId) } // IsApprovedForAll is a free data retrieval call binding the contract method 0xe985e9c5. // // Solidity: function isApprovedForAll(address owner, address operator) view returns(bool) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) IsApprovedForAll(opts *bind.CallOpts, owner common.Address, operator common.Address) (bool, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "isApprovedForAll", owner, operator) if err != nil { return *new(bool), err } out0 := *abi.ConvertType(out[0], new(bool)).(*bool) return out0, err } // IsApprovedForAll is a free data retrieval call binding the contract method 0xe985e9c5. // // Solidity: function isApprovedForAll(address owner, address operator) view returns(bool) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) IsApprovedForAll(owner common.Address, operator common.Address) (bool, error) { return _NonfungiblePositionManager.Contract.IsApprovedForAll(&_NonfungiblePositionManager.CallOpts, owner, operator) } // IsApprovedForAll is a free data retrieval call binding the contract method 0xe985e9c5. // // Solidity: function isApprovedForAll(address owner, address operator) view returns(bool) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) IsApprovedForAll(owner common.Address, operator common.Address) (bool, error) { return _NonfungiblePositionManager.Contract.IsApprovedForAll(&_NonfungiblePositionManager.CallOpts, owner, operator) } // Name is a free data retrieval call binding the contract method 0x06fdde03. // // Solidity: function name() view returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) Name(opts *bind.CallOpts) (string, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "name") if err != nil { return *new(string), err } out0 := *abi.ConvertType(out[0], new(string)).(*string) return out0, err } // Name is a free data retrieval call binding the contract method 0x06fdde03. // // Solidity: function name() view returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Name() (string, error) { return _NonfungiblePositionManager.Contract.Name(&_NonfungiblePositionManager.CallOpts) } // Name is a free data retrieval call binding the contract method 0x06fdde03. // // Solidity: function name() view returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) Name() (string, error) { return _NonfungiblePositionManager.Contract.Name(&_NonfungiblePositionManager.CallOpts) } // OwnerOf is a free data retrieval call binding the contract method 0x6352211e. // // Solidity: function ownerOf(uint256 tokenId) view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) OwnerOf(opts *bind.CallOpts, tokenId *big.Int) (common.Address, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "ownerOf", tokenId) if err != nil { return *new(common.Address), err } out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } // OwnerOf is a free data retrieval call binding the contract method 0x6352211e. // // Solidity: function ownerOf(uint256 tokenId) view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) OwnerOf(tokenId *big.Int) (common.Address, error) { return _NonfungiblePositionManager.Contract.OwnerOf(&_NonfungiblePositionManager.CallOpts, tokenId) } // OwnerOf is a free data retrieval call binding the contract method 0x6352211e. // // Solidity: function ownerOf(uint256 tokenId) view returns(address) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) OwnerOf(tokenId *big.Int) (common.Address, error) { return _NonfungiblePositionManager.Contract.OwnerOf(&_NonfungiblePositionManager.CallOpts, tokenId) } // Positions is a free data retrieval call binding the contract method 0x99fbab88. // // Solidity: function positions(uint256 tokenId) view returns(uint96 nonce, address operator, address token0, address token1, uint24 fee, int24 tickLower, int24 tickUpper, uint128 liquidity, uint256 feeGrowthInside0LastX128, uint256 feeGrowthInside1LastX128, uint128 tokensOwed0, uint128 tokensOwed1) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) Positions(opts *bind.CallOpts, tokenId *big.Int) (struct { Nonce *big.Int Operator common.Address Token0 common.Address Token1 common.Address Fee *big.Int TickLower *big.Int TickUpper *big.Int Liquidity *big.Int FeeGrowthInside0LastX128 *big.Int FeeGrowthInside1LastX128 *big.Int TokensOwed0 *big.Int TokensOwed1 *big.Int }, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "positions", tokenId) outstruct := new(struct { Nonce *big.Int Operator common.Address Token0 common.Address Token1 common.Address Fee *big.Int TickLower *big.Int TickUpper *big.Int Liquidity *big.Int FeeGrowthInside0LastX128 *big.Int FeeGrowthInside1LastX128 *big.Int TokensOwed0 *big.Int TokensOwed1 *big.Int }) if err != nil { return *outstruct, err } outstruct.Nonce = *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) outstruct.Operator = *abi.ConvertType(out[1], new(common.Address)).(*common.Address) outstruct.Token0 = *abi.ConvertType(out[2], new(common.Address)).(*common.Address) outstruct.Token1 = *abi.ConvertType(out[3], new(common.Address)).(*common.Address) outstruct.Fee = *abi.ConvertType(out[4], new(*big.Int)).(**big.Int) outstruct.TickLower = *abi.ConvertType(out[5], new(*big.Int)).(**big.Int) outstruct.TickUpper = *abi.ConvertType(out[6], new(*big.Int)).(**big.Int) outstruct.Liquidity = *abi.ConvertType(out[7], new(*big.Int)).(**big.Int) outstruct.FeeGrowthInside0LastX128 = *abi.ConvertType(out[8], new(*big.Int)).(**big.Int) outstruct.FeeGrowthInside1LastX128 = *abi.ConvertType(out[9], new(*big.Int)).(**big.Int) outstruct.TokensOwed0 = *abi.ConvertType(out[10], new(*big.Int)).(**big.Int) outstruct.TokensOwed1 = *abi.ConvertType(out[11], new(*big.Int)).(**big.Int) return *outstruct, err } // Positions is a free data retrieval call binding the contract method 0x99fbab88. // // Solidity: function positions(uint256 tokenId) view returns(uint96 nonce, address operator, address token0, address token1, uint24 fee, int24 tickLower, int24 tickUpper, uint128 liquidity, uint256 feeGrowthInside0LastX128, uint256 feeGrowthInside1LastX128, uint128 tokensOwed0, uint128 tokensOwed1) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Positions(tokenId *big.Int) (struct { Nonce *big.Int Operator common.Address Token0 common.Address Token1 common.Address Fee *big.Int TickLower *big.Int TickUpper *big.Int Liquidity *big.Int FeeGrowthInside0LastX128 *big.Int FeeGrowthInside1LastX128 *big.Int TokensOwed0 *big.Int TokensOwed1 *big.Int }, error) { return _NonfungiblePositionManager.Contract.Positions(&_NonfungiblePositionManager.CallOpts, tokenId) } // Positions is a free data retrieval call binding the contract method 0x99fbab88. // // Solidity: function positions(uint256 tokenId) view returns(uint96 nonce, address operator, address token0, address token1, uint24 fee, int24 tickLower, int24 tickUpper, uint128 liquidity, uint256 feeGrowthInside0LastX128, uint256 feeGrowthInside1LastX128, uint128 tokensOwed0, uint128 tokensOwed1) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) Positions(tokenId *big.Int) (struct { Nonce *big.Int Operator common.Address Token0 common.Address Token1 common.Address Fee *big.Int TickLower *big.Int TickUpper *big.Int Liquidity *big.Int FeeGrowthInside0LastX128 *big.Int FeeGrowthInside1LastX128 *big.Int TokensOwed0 *big.Int TokensOwed1 *big.Int }, error) { return _NonfungiblePositionManager.Contract.Positions(&_NonfungiblePositionManager.CallOpts, tokenId) } // SupportsInterface is a free data retrieval call binding the contract method 0x01ffc9a7. // // Solidity: function supportsInterface(bytes4 interfaceId) view returns(bool) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) SupportsInterface(opts *bind.CallOpts, interfaceId [4]byte) (bool, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "supportsInterface", interfaceId) if err != nil { return *new(bool), err } out0 := *abi.ConvertType(out[0], new(bool)).(*bool) return out0, err } // SupportsInterface is a free data retrieval call binding the contract method 0x01ffc9a7. // // Solidity: function supportsInterface(bytes4 interfaceId) view returns(bool) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) SupportsInterface(interfaceId [4]byte) (bool, error) { return _NonfungiblePositionManager.Contract.SupportsInterface(&_NonfungiblePositionManager.CallOpts, interfaceId) } // SupportsInterface is a free data retrieval call binding the contract method 0x01ffc9a7. // // Solidity: function supportsInterface(bytes4 interfaceId) view returns(bool) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) SupportsInterface(interfaceId [4]byte) (bool, error) { return _NonfungiblePositionManager.Contract.SupportsInterface(&_NonfungiblePositionManager.CallOpts, interfaceId) } // Symbol is a free data retrieval call binding the contract method 0x95d89b41. // // Solidity: function symbol() view returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) Symbol(opts *bind.CallOpts) (string, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "symbol") if err != nil { return *new(string), err } out0 := *abi.ConvertType(out[0], new(string)).(*string) return out0, err } // Symbol is a free data retrieval call binding the contract method 0x95d89b41. // // Solidity: function symbol() view returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Symbol() (string, error) { return _NonfungiblePositionManager.Contract.Symbol(&_NonfungiblePositionManager.CallOpts) } // Symbol is a free data retrieval call binding the contract method 0x95d89b41. // // Solidity: function symbol() view returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) Symbol() (string, error) { return _NonfungiblePositionManager.Contract.Symbol(&_NonfungiblePositionManager.CallOpts) } // TokenByIndex is a free data retrieval call binding the contract method 0x4f6ccce7. // // Solidity: function tokenByIndex(uint256 index) view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) TokenByIndex(opts *bind.CallOpts, index *big.Int) (*big.Int, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "tokenByIndex", index) if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // TokenByIndex is a free data retrieval call binding the contract method 0x4f6ccce7. // // Solidity: function tokenByIndex(uint256 index) view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) TokenByIndex(index *big.Int) (*big.Int, error) { return _NonfungiblePositionManager.Contract.TokenByIndex(&_NonfungiblePositionManager.CallOpts, index) } // TokenByIndex is a free data retrieval call binding the contract method 0x4f6ccce7. // // Solidity: function tokenByIndex(uint256 index) view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) TokenByIndex(index *big.Int) (*big.Int, error) { return _NonfungiblePositionManager.Contract.TokenByIndex(&_NonfungiblePositionManager.CallOpts, index) } // TokenOfOwnerByIndex is a free data retrieval call binding the contract method 0x2f745c59. // // Solidity: function tokenOfOwnerByIndex(address owner, uint256 index) view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) TokenOfOwnerByIndex(opts *bind.CallOpts, owner common.Address, index *big.Int) (*big.Int, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "tokenOfOwnerByIndex", owner, index) if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // TokenOfOwnerByIndex is a free data retrieval call binding the contract method 0x2f745c59. // // Solidity: function tokenOfOwnerByIndex(address owner, uint256 index) view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) TokenOfOwnerByIndex(owner common.Address, index *big.Int) (*big.Int, error) { return _NonfungiblePositionManager.Contract.TokenOfOwnerByIndex(&_NonfungiblePositionManager.CallOpts, owner, index) } // TokenOfOwnerByIndex is a free data retrieval call binding the contract method 0x2f745c59. // // Solidity: function tokenOfOwnerByIndex(address owner, uint256 index) view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) TokenOfOwnerByIndex(owner common.Address, index *big.Int) (*big.Int, error) { return _NonfungiblePositionManager.Contract.TokenOfOwnerByIndex(&_NonfungiblePositionManager.CallOpts, owner, index) } // TokenURI is a free data retrieval call binding the contract method 0xc87b56dd. // // Solidity: function tokenURI(uint256 tokenId) view returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) TokenURI(opts *bind.CallOpts, tokenId *big.Int) (string, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "tokenURI", tokenId) if err != nil { return *new(string), err } out0 := *abi.ConvertType(out[0], new(string)).(*string) return out0, err } // TokenURI is a free data retrieval call binding the contract method 0xc87b56dd. // // Solidity: function tokenURI(uint256 tokenId) view returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) TokenURI(tokenId *big.Int) (string, error) { return _NonfungiblePositionManager.Contract.TokenURI(&_NonfungiblePositionManager.CallOpts, tokenId) } // TokenURI is a free data retrieval call binding the contract method 0xc87b56dd. // // Solidity: function tokenURI(uint256 tokenId) view returns(string) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) TokenURI(tokenId *big.Int) (string, error) { return _NonfungiblePositionManager.Contract.TokenURI(&_NonfungiblePositionManager.CallOpts, tokenId) } // TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. // // Solidity: function totalSupply() view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerCaller) TotalSupply(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} err := _NonfungiblePositionManager.contract.Call(opts, &out, "totalSupply") if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. // // Solidity: function totalSupply() view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) TotalSupply() (*big.Int, error) { return _NonfungiblePositionManager.Contract.TotalSupply(&_NonfungiblePositionManager.CallOpts) } // TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. // // Solidity: function totalSupply() view returns(uint256) func (_NonfungiblePositionManager *NonfungiblePositionManagerCallerSession) TotalSupply() (*big.Int, error) { return _NonfungiblePositionManager.Contract.TotalSupply(&_NonfungiblePositionManager.CallOpts) } // Approve is a paid mutator transaction binding the contract method 0x095ea7b3. // // Solidity: function approve(address to, uint256 tokenId) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) Approve(opts *bind.TransactOpts, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "approve", to, tokenId) } // Approve is a paid mutator transaction binding the contract method 0x095ea7b3. // // Solidity: function approve(address to, uint256 tokenId) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Approve(to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Approve(&_NonfungiblePositionManager.TransactOpts, to, tokenId) } // Approve is a paid mutator transaction binding the contract method 0x095ea7b3. // // Solidity: function approve(address to, uint256 tokenId) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) Approve(to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Approve(&_NonfungiblePositionManager.TransactOpts, to, tokenId) } // Burn is a paid mutator transaction binding the contract method 0x42966c68. // // Solidity: function burn(uint256 tokenId) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) Burn(opts *bind.TransactOpts, tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "burn", tokenId) } // Burn is a paid mutator transaction binding the contract method 0x42966c68. // // Solidity: function burn(uint256 tokenId) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Burn(tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Burn(&_NonfungiblePositionManager.TransactOpts, tokenId) } // Burn is a paid mutator transaction binding the contract method 0x42966c68. // // Solidity: function burn(uint256 tokenId) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) Burn(tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Burn(&_NonfungiblePositionManager.TransactOpts, tokenId) } // Collect is a paid mutator transaction binding the contract method 0xfc6f7865. // // Solidity: function collect((uint256,address,uint128,uint128) params) payable returns(uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) Collect(opts *bind.TransactOpts, params INonfungiblePositionManagerCollectParams) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "collect", params) } // Collect is a paid mutator transaction binding the contract method 0xfc6f7865. // // Solidity: function collect((uint256,address,uint128,uint128) params) payable returns(uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Collect(params INonfungiblePositionManagerCollectParams) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Collect(&_NonfungiblePositionManager.TransactOpts, params) } // Collect is a paid mutator transaction binding the contract method 0xfc6f7865. // // Solidity: function collect((uint256,address,uint128,uint128) params) payable returns(uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) Collect(params INonfungiblePositionManagerCollectParams) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Collect(&_NonfungiblePositionManager.TransactOpts, params) } // CreateAndInitializePoolIfNecessary is a paid mutator transaction binding the contract method 0x13ead562. // // Solidity: function createAndInitializePoolIfNecessary(address token0, address token1, uint24 fee, uint160 sqrtPriceX96) payable returns(address pool) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) CreateAndInitializePoolIfNecessary(opts *bind.TransactOpts, token0 common.Address, token1 common.Address, fee *big.Int, sqrtPriceX96 *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "createAndInitializePoolIfNecessary", token0, token1, fee, sqrtPriceX96) } // CreateAndInitializePoolIfNecessary is a paid mutator transaction binding the contract method 0x13ead562. // // Solidity: function createAndInitializePoolIfNecessary(address token0, address token1, uint24 fee, uint160 sqrtPriceX96) payable returns(address pool) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) CreateAndInitializePoolIfNecessary(token0 common.Address, token1 common.Address, fee *big.Int, sqrtPriceX96 *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.CreateAndInitializePoolIfNecessary(&_NonfungiblePositionManager.TransactOpts, token0, token1, fee, sqrtPriceX96) } // CreateAndInitializePoolIfNecessary is a paid mutator transaction binding the contract method 0x13ead562. // // Solidity: function createAndInitializePoolIfNecessary(address token0, address token1, uint24 fee, uint160 sqrtPriceX96) payable returns(address pool) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) CreateAndInitializePoolIfNecessary(token0 common.Address, token1 common.Address, fee *big.Int, sqrtPriceX96 *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.CreateAndInitializePoolIfNecessary(&_NonfungiblePositionManager.TransactOpts, token0, token1, fee, sqrtPriceX96) } // DecreaseLiquidity is a paid mutator transaction binding the contract method 0x0c49ccbe. // // Solidity: function decreaseLiquidity((uint256,uint128,uint256,uint256,uint256) params) payable returns(uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) DecreaseLiquidity(opts *bind.TransactOpts, params INonfungiblePositionManagerDecreaseLiquidityParams) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "decreaseLiquidity", params) } // DecreaseLiquidity is a paid mutator transaction binding the contract method 0x0c49ccbe. // // Solidity: function decreaseLiquidity((uint256,uint128,uint256,uint256,uint256) params) payable returns(uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) DecreaseLiquidity(params INonfungiblePositionManagerDecreaseLiquidityParams) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.DecreaseLiquidity(&_NonfungiblePositionManager.TransactOpts, params) } // DecreaseLiquidity is a paid mutator transaction binding the contract method 0x0c49ccbe. // // Solidity: function decreaseLiquidity((uint256,uint128,uint256,uint256,uint256) params) payable returns(uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) DecreaseLiquidity(params INonfungiblePositionManagerDecreaseLiquidityParams) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.DecreaseLiquidity(&_NonfungiblePositionManager.TransactOpts, params) } // IncreaseLiquidity is a paid mutator transaction binding the contract method 0x219f5d17. // // Solidity: function increaseLiquidity((uint256,uint256,uint256,uint256,uint256,uint256) params) payable returns(uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) IncreaseLiquidity(opts *bind.TransactOpts, params INonfungiblePositionManagerIncreaseLiquidityParams) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "increaseLiquidity", params) } // IncreaseLiquidity is a paid mutator transaction binding the contract method 0x219f5d17. // // Solidity: function increaseLiquidity((uint256,uint256,uint256,uint256,uint256,uint256) params) payable returns(uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) IncreaseLiquidity(params INonfungiblePositionManagerIncreaseLiquidityParams) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.IncreaseLiquidity(&_NonfungiblePositionManager.TransactOpts, params) } // IncreaseLiquidity is a paid mutator transaction binding the contract method 0x219f5d17. // // Solidity: function increaseLiquidity((uint256,uint256,uint256,uint256,uint256,uint256) params) payable returns(uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) IncreaseLiquidity(params INonfungiblePositionManagerIncreaseLiquidityParams) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.IncreaseLiquidity(&_NonfungiblePositionManager.TransactOpts, params) } // Mint is a paid mutator transaction binding the contract method 0x88316456. // // Solidity: function mint((address,address,uint24,int24,int24,uint256,uint256,uint256,uint256,address,uint256) params) payable returns(uint256 tokenId, uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) Mint(opts *bind.TransactOpts, params INonfungiblePositionManagerMintParams) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "mint", params) } // Mint is a paid mutator transaction binding the contract method 0x88316456. // // Solidity: function mint((address,address,uint24,int24,int24,uint256,uint256,uint256,uint256,address,uint256) params) payable returns(uint256 tokenId, uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Mint(params INonfungiblePositionManagerMintParams) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Mint(&_NonfungiblePositionManager.TransactOpts, params) } // Mint is a paid mutator transaction binding the contract method 0x88316456. // // Solidity: function mint((address,address,uint24,int24,int24,uint256,uint256,uint256,uint256,address,uint256) params) payable returns(uint256 tokenId, uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) Mint(params INonfungiblePositionManagerMintParams) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Mint(&_NonfungiblePositionManager.TransactOpts, params) } // Multicall is a paid mutator transaction binding the contract method 0xac9650d8. // // Solidity: function multicall(bytes[] data) payable returns(bytes[] results) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) Multicall(opts *bind.TransactOpts, data [][]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "multicall", data) } // Multicall is a paid mutator transaction binding the contract method 0xac9650d8. // // Solidity: function multicall(bytes[] data) payable returns(bytes[] results) func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Multicall(data [][]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Multicall(&_NonfungiblePositionManager.TransactOpts, data) } // Multicall is a paid mutator transaction binding the contract method 0xac9650d8. // // Solidity: function multicall(bytes[] data) payable returns(bytes[] results) func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) Multicall(data [][]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Multicall(&_NonfungiblePositionManager.TransactOpts, data) } // Permit is a paid mutator transaction binding the contract method 0x7ac2ff7b. // // Solidity: function permit(address spender, uint256 tokenId, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) Permit(opts *bind.TransactOpts, spender common.Address, tokenId *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "permit", spender, tokenId, deadline, v, r, s) } // Permit is a paid mutator transaction binding the contract method 0x7ac2ff7b. // // Solidity: function permit(address spender, uint256 tokenId, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Permit(spender common.Address, tokenId *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Permit(&_NonfungiblePositionManager.TransactOpts, spender, tokenId, deadline, v, r, s) } // Permit is a paid mutator transaction binding the contract method 0x7ac2ff7b. // // Solidity: function permit(address spender, uint256 tokenId, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) Permit(spender common.Address, tokenId *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Permit(&_NonfungiblePositionManager.TransactOpts, spender, tokenId, deadline, v, r, s) } // RefundETH is a paid mutator transaction binding the contract method 0x12210e8a. // // Solidity: function refundETH() payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) RefundETH(opts *bind.TransactOpts) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "refundETH") } // RefundETH is a paid mutator transaction binding the contract method 0x12210e8a. // // Solidity: function refundETH() payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) RefundETH() (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.RefundETH(&_NonfungiblePositionManager.TransactOpts) } // RefundETH is a paid mutator transaction binding the contract method 0x12210e8a. // // Solidity: function refundETH() payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) RefundETH() (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.RefundETH(&_NonfungiblePositionManager.TransactOpts) } // SafeTransferFrom is a paid mutator transaction binding the contract method 0x42842e0e. // // Solidity: function safeTransferFrom(address from, address to, uint256 tokenId) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) SafeTransferFrom(opts *bind.TransactOpts, from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "safeTransferFrom", from, to, tokenId) } // SafeTransferFrom is a paid mutator transaction binding the contract method 0x42842e0e. // // Solidity: function safeTransferFrom(address from, address to, uint256 tokenId) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) SafeTransferFrom(from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SafeTransferFrom(&_NonfungiblePositionManager.TransactOpts, from, to, tokenId) } // SafeTransferFrom is a paid mutator transaction binding the contract method 0x42842e0e. // // Solidity: function safeTransferFrom(address from, address to, uint256 tokenId) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) SafeTransferFrom(from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SafeTransferFrom(&_NonfungiblePositionManager.TransactOpts, from, to, tokenId) } // SafeTransferFrom0 is a paid mutator transaction binding the contract method 0xb88d4fde. // // Solidity: function safeTransferFrom(address from, address to, uint256 tokenId, bytes _data) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) SafeTransferFrom0(opts *bind.TransactOpts, from common.Address, to common.Address, tokenId *big.Int, _data []byte) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "safeTransferFrom0", from, to, tokenId, _data) } // SafeTransferFrom0 is a paid mutator transaction binding the contract method 0xb88d4fde. // // Solidity: function safeTransferFrom(address from, address to, uint256 tokenId, bytes _data) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) SafeTransferFrom0(from common.Address, to common.Address, tokenId *big.Int, _data []byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SafeTransferFrom0(&_NonfungiblePositionManager.TransactOpts, from, to, tokenId, _data) } // SafeTransferFrom0 is a paid mutator transaction binding the contract method 0xb88d4fde. // // Solidity: function safeTransferFrom(address from, address to, uint256 tokenId, bytes _data) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) SafeTransferFrom0(from common.Address, to common.Address, tokenId *big.Int, _data []byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SafeTransferFrom0(&_NonfungiblePositionManager.TransactOpts, from, to, tokenId, _data) } // SelfPermit is a paid mutator transaction binding the contract method 0xf3995c67. // // Solidity: function selfPermit(address token, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) SelfPermit(opts *bind.TransactOpts, token common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "selfPermit", token, value, deadline, v, r, s) } // SelfPermit is a paid mutator transaction binding the contract method 0xf3995c67. // // Solidity: function selfPermit(address token, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) SelfPermit(token common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SelfPermit(&_NonfungiblePositionManager.TransactOpts, token, value, deadline, v, r, s) } // SelfPermit is a paid mutator transaction binding the contract method 0xf3995c67. // // Solidity: function selfPermit(address token, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) SelfPermit(token common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SelfPermit(&_NonfungiblePositionManager.TransactOpts, token, value, deadline, v, r, s) } // SelfPermitAllowed is a paid mutator transaction binding the contract method 0x4659a494. // // Solidity: function selfPermitAllowed(address token, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) SelfPermitAllowed(opts *bind.TransactOpts, token common.Address, nonce *big.Int, expiry *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "selfPermitAllowed", token, nonce, expiry, v, r, s) } // SelfPermitAllowed is a paid mutator transaction binding the contract method 0x4659a494. // // Solidity: function selfPermitAllowed(address token, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) SelfPermitAllowed(token common.Address, nonce *big.Int, expiry *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SelfPermitAllowed(&_NonfungiblePositionManager.TransactOpts, token, nonce, expiry, v, r, s) } // SelfPermitAllowed is a paid mutator transaction binding the contract method 0x4659a494. // // Solidity: function selfPermitAllowed(address token, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) SelfPermitAllowed(token common.Address, nonce *big.Int, expiry *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SelfPermitAllowed(&_NonfungiblePositionManager.TransactOpts, token, nonce, expiry, v, r, s) } // SelfPermitAllowedIfNecessary is a paid mutator transaction binding the contract method 0xa4a78f0c. // // Solidity: function selfPermitAllowedIfNecessary(address token, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) SelfPermitAllowedIfNecessary(opts *bind.TransactOpts, token common.Address, nonce *big.Int, expiry *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "selfPermitAllowedIfNecessary", token, nonce, expiry, v, r, s) } // SelfPermitAllowedIfNecessary is a paid mutator transaction binding the contract method 0xa4a78f0c. // // Solidity: function selfPermitAllowedIfNecessary(address token, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) SelfPermitAllowedIfNecessary(token common.Address, nonce *big.Int, expiry *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SelfPermitAllowedIfNecessary(&_NonfungiblePositionManager.TransactOpts, token, nonce, expiry, v, r, s) } // SelfPermitAllowedIfNecessary is a paid mutator transaction binding the contract method 0xa4a78f0c. // // Solidity: function selfPermitAllowedIfNecessary(address token, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) SelfPermitAllowedIfNecessary(token common.Address, nonce *big.Int, expiry *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SelfPermitAllowedIfNecessary(&_NonfungiblePositionManager.TransactOpts, token, nonce, expiry, v, r, s) } // SelfPermitIfNecessary is a paid mutator transaction binding the contract method 0xc2e3140a. // // Solidity: function selfPermitIfNecessary(address token, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) SelfPermitIfNecessary(opts *bind.TransactOpts, token common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "selfPermitIfNecessary", token, value, deadline, v, r, s) } // SelfPermitIfNecessary is a paid mutator transaction binding the contract method 0xc2e3140a. // // Solidity: function selfPermitIfNecessary(address token, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) SelfPermitIfNecessary(token common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SelfPermitIfNecessary(&_NonfungiblePositionManager.TransactOpts, token, value, deadline, v, r, s) } // SelfPermitIfNecessary is a paid mutator transaction binding the contract method 0xc2e3140a. // // Solidity: function selfPermitIfNecessary(address token, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) SelfPermitIfNecessary(token common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SelfPermitIfNecessary(&_NonfungiblePositionManager.TransactOpts, token, value, deadline, v, r, s) } // SetApprovalForAll is a paid mutator transaction binding the contract method 0xa22cb465. // // Solidity: function setApprovalForAll(address operator, bool approved) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) SetApprovalForAll(opts *bind.TransactOpts, operator common.Address, approved bool) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "setApprovalForAll", operator, approved) } // SetApprovalForAll is a paid mutator transaction binding the contract method 0xa22cb465. // // Solidity: function setApprovalForAll(address operator, bool approved) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) SetApprovalForAll(operator common.Address, approved bool) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SetApprovalForAll(&_NonfungiblePositionManager.TransactOpts, operator, approved) } // SetApprovalForAll is a paid mutator transaction binding the contract method 0xa22cb465. // // Solidity: function setApprovalForAll(address operator, bool approved) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) SetApprovalForAll(operator common.Address, approved bool) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SetApprovalForAll(&_NonfungiblePositionManager.TransactOpts, operator, approved) } // SweepToken is a paid mutator transaction binding the contract method 0xdf2ab5bb. // // Solidity: function sweepToken(address token, uint256 amountMinimum, address recipient) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) SweepToken(opts *bind.TransactOpts, token common.Address, amountMinimum *big.Int, recipient common.Address) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "sweepToken", token, amountMinimum, recipient) } // SweepToken is a paid mutator transaction binding the contract method 0xdf2ab5bb. // // Solidity: function sweepToken(address token, uint256 amountMinimum, address recipient) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) SweepToken(token common.Address, amountMinimum *big.Int, recipient common.Address) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SweepToken(&_NonfungiblePositionManager.TransactOpts, token, amountMinimum, recipient) } // SweepToken is a paid mutator transaction binding the contract method 0xdf2ab5bb. // // Solidity: function sweepToken(address token, uint256 amountMinimum, address recipient) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) SweepToken(token common.Address, amountMinimum *big.Int, recipient common.Address) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.SweepToken(&_NonfungiblePositionManager.TransactOpts, token, amountMinimum, recipient) } // TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. // // Solidity: function transferFrom(address from, address to, uint256 tokenId) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) TransferFrom(opts *bind.TransactOpts, from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "transferFrom", from, to, tokenId) } // TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. // // Solidity: function transferFrom(address from, address to, uint256 tokenId) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) TransferFrom(from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.TransferFrom(&_NonfungiblePositionManager.TransactOpts, from, to, tokenId) } // TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. // // Solidity: function transferFrom(address from, address to, uint256 tokenId) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) TransferFrom(from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.TransferFrom(&_NonfungiblePositionManager.TransactOpts, from, to, tokenId) } // UniswapV3MintCallback is a paid mutator transaction binding the contract method 0xd3487997. // // Solidity: function uniswapV3MintCallback(uint256 amount0Owed, uint256 amount1Owed, bytes data) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) UniswapV3MintCallback(opts *bind.TransactOpts, amount0Owed *big.Int, amount1Owed *big.Int, data []byte) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "uniswapV3MintCallback", amount0Owed, amount1Owed, data) } // UniswapV3MintCallback is a paid mutator transaction binding the contract method 0xd3487997. // // Solidity: function uniswapV3MintCallback(uint256 amount0Owed, uint256 amount1Owed, bytes data) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) UniswapV3MintCallback(amount0Owed *big.Int, amount1Owed *big.Int, data []byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.UniswapV3MintCallback(&_NonfungiblePositionManager.TransactOpts, amount0Owed, amount1Owed, data) } // UniswapV3MintCallback is a paid mutator transaction binding the contract method 0xd3487997. // // Solidity: function uniswapV3MintCallback(uint256 amount0Owed, uint256 amount1Owed, bytes data) returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) UniswapV3MintCallback(amount0Owed *big.Int, amount1Owed *big.Int, data []byte) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.UniswapV3MintCallback(&_NonfungiblePositionManager.TransactOpts, amount0Owed, amount1Owed, data) } // UnwrapWETH9 is a paid mutator transaction binding the contract method 0x49404b7c. // // Solidity: function unwrapWETH9(uint256 amountMinimum, address recipient) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) UnwrapWETH9(opts *bind.TransactOpts, amountMinimum *big.Int, recipient common.Address) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.Transact(opts, "unwrapWETH9", amountMinimum, recipient) } // UnwrapWETH9 is a paid mutator transaction binding the contract method 0x49404b7c. // // Solidity: function unwrapWETH9(uint256 amountMinimum, address recipient) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) UnwrapWETH9(amountMinimum *big.Int, recipient common.Address) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.UnwrapWETH9(&_NonfungiblePositionManager.TransactOpts, amountMinimum, recipient) } // UnwrapWETH9 is a paid mutator transaction binding the contract method 0x49404b7c. // // Solidity: function unwrapWETH9(uint256 amountMinimum, address recipient) payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) UnwrapWETH9(amountMinimum *big.Int, recipient common.Address) (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.UnwrapWETH9(&_NonfungiblePositionManager.TransactOpts, amountMinimum, recipient) } // Receive is a paid mutator transaction binding the contract receive function. // // Solidity: receive() payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactor) Receive(opts *bind.TransactOpts) (*types.Transaction, error) { return _NonfungiblePositionManager.contract.RawTransact(opts, nil) // calldata is disallowed for receive function } // Receive is a paid mutator transaction binding the contract receive function. // // Solidity: receive() payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerSession) Receive() (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Receive(&_NonfungiblePositionManager.TransactOpts) } // Receive is a paid mutator transaction binding the contract receive function. // // Solidity: receive() payable returns() func (_NonfungiblePositionManager *NonfungiblePositionManagerTransactorSession) Receive() (*types.Transaction, error) { return _NonfungiblePositionManager.Contract.Receive(&_NonfungiblePositionManager.TransactOpts) } // NonfungiblePositionManagerApprovalIterator is returned from FilterApproval and is used to iterate over the raw logs and unpacked data for Approval events raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerApprovalIterator struct { Event *NonfungiblePositionManagerApproval // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *NonfungiblePositionManagerApprovalIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerApproval) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerApproval) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *NonfungiblePositionManagerApprovalIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *NonfungiblePositionManagerApprovalIterator) Close() error { it.sub.Unsubscribe() return nil } // NonfungiblePositionManagerApproval represents a Approval event raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerApproval struct { Owner common.Address Approved common.Address TokenId *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterApproval is a free log retrieval operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. // // Solidity: event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) FilterApproval(opts *bind.FilterOpts, owner []common.Address, approved []common.Address, tokenId []*big.Int) (*NonfungiblePositionManagerApprovalIterator, error) { var ownerRule []interface{} for _, ownerItem := range owner { ownerRule = append(ownerRule, ownerItem) } var approvedRule []interface{} for _, approvedItem := range approved { approvedRule = append(approvedRule, approvedItem) } var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _NonfungiblePositionManager.contract.FilterLogs(opts, "Approval", ownerRule, approvedRule, tokenIdRule) if err != nil { return nil, err } return &NonfungiblePositionManagerApprovalIterator{contract: _NonfungiblePositionManager.contract, event: "Approval", logs: logs, sub: sub}, nil } // WatchApproval is a free log subscription operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. // // Solidity: event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) WatchApproval(opts *bind.WatchOpts, sink chan<- *NonfungiblePositionManagerApproval, owner []common.Address, approved []common.Address, tokenId []*big.Int) (event.Subscription, error) { var ownerRule []interface{} for _, ownerItem := range owner { ownerRule = append(ownerRule, ownerItem) } var approvedRule []interface{} for _, approvedItem := range approved { approvedRule = append(approvedRule, approvedItem) } var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _NonfungiblePositionManager.contract.WatchLogs(opts, "Approval", ownerRule, approvedRule, tokenIdRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(NonfungiblePositionManagerApproval) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "Approval", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseApproval is a log parse operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. // // Solidity: event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) ParseApproval(log types.Log) (*NonfungiblePositionManagerApproval, error) { event := new(NonfungiblePositionManagerApproval) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "Approval", log); err != nil { return nil, err } event.Raw = log return event, nil } // NonfungiblePositionManagerApprovalForAllIterator is returned from FilterApprovalForAll and is used to iterate over the raw logs and unpacked data for ApprovalForAll events raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerApprovalForAllIterator struct { Event *NonfungiblePositionManagerApprovalForAll // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *NonfungiblePositionManagerApprovalForAllIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerApprovalForAll) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerApprovalForAll) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *NonfungiblePositionManagerApprovalForAllIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *NonfungiblePositionManagerApprovalForAllIterator) Close() error { it.sub.Unsubscribe() return nil } // NonfungiblePositionManagerApprovalForAll represents a ApprovalForAll event raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerApprovalForAll struct { Owner common.Address Operator common.Address Approved bool Raw types.Log // Blockchain specific contextual infos } // FilterApprovalForAll is a free log retrieval operation binding the contract event 0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31. // // Solidity: event ApprovalForAll(address indexed owner, address indexed operator, bool approved) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) FilterApprovalForAll(opts *bind.FilterOpts, owner []common.Address, operator []common.Address) (*NonfungiblePositionManagerApprovalForAllIterator, error) { var ownerRule []interface{} for _, ownerItem := range owner { ownerRule = append(ownerRule, ownerItem) } var operatorRule []interface{} for _, operatorItem := range operator { operatorRule = append(operatorRule, operatorItem) } logs, sub, err := _NonfungiblePositionManager.contract.FilterLogs(opts, "ApprovalForAll", ownerRule, operatorRule) if err != nil { return nil, err } return &NonfungiblePositionManagerApprovalForAllIterator{contract: _NonfungiblePositionManager.contract, event: "ApprovalForAll", logs: logs, sub: sub}, nil } // WatchApprovalForAll is a free log subscription operation binding the contract event 0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31. // // Solidity: event ApprovalForAll(address indexed owner, address indexed operator, bool approved) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) WatchApprovalForAll(opts *bind.WatchOpts, sink chan<- *NonfungiblePositionManagerApprovalForAll, owner []common.Address, operator []common.Address) (event.Subscription, error) { var ownerRule []interface{} for _, ownerItem := range owner { ownerRule = append(ownerRule, ownerItem) } var operatorRule []interface{} for _, operatorItem := range operator { operatorRule = append(operatorRule, operatorItem) } logs, sub, err := _NonfungiblePositionManager.contract.WatchLogs(opts, "ApprovalForAll", ownerRule, operatorRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(NonfungiblePositionManagerApprovalForAll) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "ApprovalForAll", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseApprovalForAll is a log parse operation binding the contract event 0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31. // // Solidity: event ApprovalForAll(address indexed owner, address indexed operator, bool approved) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) ParseApprovalForAll(log types.Log) (*NonfungiblePositionManagerApprovalForAll, error) { event := new(NonfungiblePositionManagerApprovalForAll) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "ApprovalForAll", log); err != nil { return nil, err } event.Raw = log return event, nil } // NonfungiblePositionManagerCollectIterator is returned from FilterCollect and is used to iterate over the raw logs and unpacked data for Collect events raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerCollectIterator struct { Event *NonfungiblePositionManagerCollect // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *NonfungiblePositionManagerCollectIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerCollect) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerCollect) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *NonfungiblePositionManagerCollectIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *NonfungiblePositionManagerCollectIterator) Close() error { it.sub.Unsubscribe() return nil } // NonfungiblePositionManagerCollect represents a Collect event raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerCollect struct { TokenId *big.Int Recipient common.Address Amount0 *big.Int Amount1 *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterCollect is a free log retrieval operation binding the contract event 0x40d0efd1a53d60ecbf40971b9daf7dc90178c3aadc7aab1765632738fa8b8f01. // // Solidity: event Collect(uint256 indexed tokenId, address recipient, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) FilterCollect(opts *bind.FilterOpts, tokenId []*big.Int) (*NonfungiblePositionManagerCollectIterator, error) { var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _NonfungiblePositionManager.contract.FilterLogs(opts, "Collect", tokenIdRule) if err != nil { return nil, err } return &NonfungiblePositionManagerCollectIterator{contract: _NonfungiblePositionManager.contract, event: "Collect", logs: logs, sub: sub}, nil } // WatchCollect is a free log subscription operation binding the contract event 0x40d0efd1a53d60ecbf40971b9daf7dc90178c3aadc7aab1765632738fa8b8f01. // // Solidity: event Collect(uint256 indexed tokenId, address recipient, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) WatchCollect(opts *bind.WatchOpts, sink chan<- *NonfungiblePositionManagerCollect, tokenId []*big.Int) (event.Subscription, error) { var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _NonfungiblePositionManager.contract.WatchLogs(opts, "Collect", tokenIdRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(NonfungiblePositionManagerCollect) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "Collect", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseCollect is a log parse operation binding the contract event 0x40d0efd1a53d60ecbf40971b9daf7dc90178c3aadc7aab1765632738fa8b8f01. // // Solidity: event Collect(uint256 indexed tokenId, address recipient, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) ParseCollect(log types.Log) (*NonfungiblePositionManagerCollect, error) { event := new(NonfungiblePositionManagerCollect) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "Collect", log); err != nil { return nil, err } event.Raw = log return event, nil } // NonfungiblePositionManagerDecreaseLiquidityIterator is returned from FilterDecreaseLiquidity and is used to iterate over the raw logs and unpacked data for DecreaseLiquidity events raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerDecreaseLiquidityIterator struct { Event *NonfungiblePositionManagerDecreaseLiquidity // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *NonfungiblePositionManagerDecreaseLiquidityIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerDecreaseLiquidity) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerDecreaseLiquidity) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *NonfungiblePositionManagerDecreaseLiquidityIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *NonfungiblePositionManagerDecreaseLiquidityIterator) Close() error { it.sub.Unsubscribe() return nil } // NonfungiblePositionManagerDecreaseLiquidity represents a DecreaseLiquidity event raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerDecreaseLiquidity struct { TokenId *big.Int Liquidity *big.Int Amount0 *big.Int Amount1 *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterDecreaseLiquidity is a free log retrieval operation binding the contract event 0x26f6a048ee9138f2c0ce266f322cb99228e8d619ae2bff30c67f8dcf9d2377b4. // // Solidity: event DecreaseLiquidity(uint256 indexed tokenId, uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) FilterDecreaseLiquidity(opts *bind.FilterOpts, tokenId []*big.Int) (*NonfungiblePositionManagerDecreaseLiquidityIterator, error) { var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _NonfungiblePositionManager.contract.FilterLogs(opts, "DecreaseLiquidity", tokenIdRule) if err != nil { return nil, err } return &NonfungiblePositionManagerDecreaseLiquidityIterator{contract: _NonfungiblePositionManager.contract, event: "DecreaseLiquidity", logs: logs, sub: sub}, nil } // WatchDecreaseLiquidity is a free log subscription operation binding the contract event 0x26f6a048ee9138f2c0ce266f322cb99228e8d619ae2bff30c67f8dcf9d2377b4. // // Solidity: event DecreaseLiquidity(uint256 indexed tokenId, uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) WatchDecreaseLiquidity(opts *bind.WatchOpts, sink chan<- *NonfungiblePositionManagerDecreaseLiquidity, tokenId []*big.Int) (event.Subscription, error) { var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _NonfungiblePositionManager.contract.WatchLogs(opts, "DecreaseLiquidity", tokenIdRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(NonfungiblePositionManagerDecreaseLiquidity) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "DecreaseLiquidity", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseDecreaseLiquidity is a log parse operation binding the contract event 0x26f6a048ee9138f2c0ce266f322cb99228e8d619ae2bff30c67f8dcf9d2377b4. // // Solidity: event DecreaseLiquidity(uint256 indexed tokenId, uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) ParseDecreaseLiquidity(log types.Log) (*NonfungiblePositionManagerDecreaseLiquidity, error) { event := new(NonfungiblePositionManagerDecreaseLiquidity) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "DecreaseLiquidity", log); err != nil { return nil, err } event.Raw = log return event, nil } // NonfungiblePositionManagerIncreaseLiquidityIterator is returned from FilterIncreaseLiquidity and is used to iterate over the raw logs and unpacked data for IncreaseLiquidity events raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerIncreaseLiquidityIterator struct { Event *NonfungiblePositionManagerIncreaseLiquidity // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *NonfungiblePositionManagerIncreaseLiquidityIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerIncreaseLiquidity) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerIncreaseLiquidity) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *NonfungiblePositionManagerIncreaseLiquidityIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *NonfungiblePositionManagerIncreaseLiquidityIterator) Close() error { it.sub.Unsubscribe() return nil } // NonfungiblePositionManagerIncreaseLiquidity represents a IncreaseLiquidity event raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerIncreaseLiquidity struct { TokenId *big.Int Liquidity *big.Int Amount0 *big.Int Amount1 *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterIncreaseLiquidity is a free log retrieval operation binding the contract event 0x3067048beee31b25b2f1681f88dac838c8bba36af25bfb2b7cf7473a5847e35f. // // Solidity: event IncreaseLiquidity(uint256 indexed tokenId, uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) FilterIncreaseLiquidity(opts *bind.FilterOpts, tokenId []*big.Int) (*NonfungiblePositionManagerIncreaseLiquidityIterator, error) { var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _NonfungiblePositionManager.contract.FilterLogs(opts, "IncreaseLiquidity", tokenIdRule) if err != nil { return nil, err } return &NonfungiblePositionManagerIncreaseLiquidityIterator{contract: _NonfungiblePositionManager.contract, event: "IncreaseLiquidity", logs: logs, sub: sub}, nil } // WatchIncreaseLiquidity is a free log subscription operation binding the contract event 0x3067048beee31b25b2f1681f88dac838c8bba36af25bfb2b7cf7473a5847e35f. // // Solidity: event IncreaseLiquidity(uint256 indexed tokenId, uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) WatchIncreaseLiquidity(opts *bind.WatchOpts, sink chan<- *NonfungiblePositionManagerIncreaseLiquidity, tokenId []*big.Int) (event.Subscription, error) { var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _NonfungiblePositionManager.contract.WatchLogs(opts, "IncreaseLiquidity", tokenIdRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(NonfungiblePositionManagerIncreaseLiquidity) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "IncreaseLiquidity", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseIncreaseLiquidity is a log parse operation binding the contract event 0x3067048beee31b25b2f1681f88dac838c8bba36af25bfb2b7cf7473a5847e35f. // // Solidity: event IncreaseLiquidity(uint256 indexed tokenId, uint128 liquidity, uint256 amount0, uint256 amount1) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) ParseIncreaseLiquidity(log types.Log) (*NonfungiblePositionManagerIncreaseLiquidity, error) { event := new(NonfungiblePositionManagerIncreaseLiquidity) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "IncreaseLiquidity", log); err != nil { return nil, err } event.Raw = log return event, nil } // NonfungiblePositionManagerTransferIterator is returned from FilterTransfer and is used to iterate over the raw logs and unpacked data for Transfer events raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerTransferIterator struct { Event *NonfungiblePositionManagerTransfer // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *NonfungiblePositionManagerTransferIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false } // If the iterator completed, deliver directly whatever's available if it.done { select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerTransfer) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true default: return false } } // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: it.Event = new(NonfungiblePositionManagerTransfer) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false } it.Event.Raw = log return true case err := <-it.sub.Err(): it.done = true it.fail = err return it.Next() } } // Error returns any retrieval or parsing error occurred during filtering. func (it *NonfungiblePositionManagerTransferIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *NonfungiblePositionManagerTransferIterator) Close() error { it.sub.Unsubscribe() return nil } // NonfungiblePositionManagerTransfer represents a Transfer event raised by the NonfungiblePositionManager contract. type NonfungiblePositionManagerTransfer struct { From common.Address To common.Address TokenId *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterTransfer is a free log retrieval operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. // // Solidity: event Transfer(address indexed from, address indexed to, uint256 indexed tokenId) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) FilterTransfer(opts *bind.FilterOpts, from []common.Address, to []common.Address, tokenId []*big.Int) (*NonfungiblePositionManagerTransferIterator, error) { var fromRule []interface{} for _, fromItem := range from { fromRule = append(fromRule, fromItem) } var toRule []interface{} for _, toItem := range to { toRule = append(toRule, toItem) } var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _NonfungiblePositionManager.contract.FilterLogs(opts, "Transfer", fromRule, toRule, tokenIdRule) if err != nil { return nil, err } return &NonfungiblePositionManagerTransferIterator{contract: _NonfungiblePositionManager.contract, event: "Transfer", logs: logs, sub: sub}, nil } // WatchTransfer is a free log subscription operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. // // Solidity: event Transfer(address indexed from, address indexed to, uint256 indexed tokenId) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) WatchTransfer(opts *bind.WatchOpts, sink chan<- *NonfungiblePositionManagerTransfer, from []common.Address, to []common.Address, tokenId []*big.Int) (event.Subscription, error) { var fromRule []interface{} for _, fromItem := range from { fromRule = append(fromRule, fromItem) } var toRule []interface{} for _, toItem := range to { toRule = append(toRule, toItem) } var tokenIdRule []interface{} for _, tokenIdItem := range tokenId { tokenIdRule = append(tokenIdRule, tokenIdItem) } logs, sub, err := _NonfungiblePositionManager.contract.WatchLogs(opts, "Transfer", fromRule, toRule, tokenIdRule) if err != nil { return nil, err } return event.NewSubscription(func(quit <-chan struct{}) error { defer sub.Unsubscribe() for { select { case log := <-logs: // New log arrived, parse the event and forward to the user event := new(NonfungiblePositionManagerTransfer) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "Transfer", log); err != nil { return err } event.Raw = log select { case sink <- event: case err := <-sub.Err(): return err case <-quit: return nil } case err := <-sub.Err(): return err case <-quit: return nil } } }), nil } // ParseTransfer is a log parse operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. // // Solidity: event Transfer(address indexed from, address indexed to, uint256 indexed tokenId) func (_NonfungiblePositionManager *NonfungiblePositionManagerFilterer) ParseTransfer(log types.Log) (*NonfungiblePositionManagerTransfer, error) { event := new(NonfungiblePositionManagerTransfer) if err := _NonfungiblePositionManager.contract.UnpackLog(event, "Transfer", log); err != nil { return nil, err } event.Raw = log return event, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/binds/zksyncnonfungiblepositionmanager/abi.json ================================================ [ { "inputs": [ { "internalType": "address", "name": "_factory", "type": "address" }, { "internalType": "address", "name": "_WETH9", "type": "address" }, { "internalType": "address", "name": "_tokenDescriptor_", "type": "address" } ], "stateMutability": "nonpayable", "type": "constructor" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "owner", "type": "address" }, { "indexed": true, "internalType": "address", "name": "approved", "type": "address" }, { "indexed": true, "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "Approval", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "owner", "type": "address" }, { "indexed": true, "internalType": "address", "name": "operator", "type": "address" }, { "indexed": false, "internalType": "bool", "name": "approved", "type": "bool" } ], "name": "ApprovalForAll", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "indexed": false, "internalType": "address", "name": "recipient", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "amount0", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "amount1", "type": "uint256" } ], "name": "Collect", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "indexed": false, "internalType": "uint128", "name": "liquidity", "type": "uint128" }, { "indexed": false, "internalType": "uint256", "name": "amount0", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "amount1", "type": "uint256" } ], "name": "DecreaseLiquidity", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "indexed": false, "internalType": "uint128", "name": "liquidity", "type": "uint128" }, { "indexed": false, "internalType": "uint256", "name": "amount0", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "amount1", "type": "uint256" } ], "name": "IncreaseLiquidity", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "from", "type": "address" }, { "indexed": true, "internalType": "address", "name": "to", "type": "address" }, { "indexed": true, "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "Transfer", "type": "event" }, { "inputs": [], "name": "DOMAIN_SEPARATOR", "outputs": [ { "internalType": "bytes32", "name": "", "type": "bytes32" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "PERMIT_TYPEHASH", "outputs": [ { "internalType": "bytes32", "name": "", "type": "bytes32" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "WETH9", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "to", "type": "address" }, { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "approve", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "owner", "type": "address" } ], "name": "balanceOf", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "baseURI", "outputs": [ { "internalType": "string", "name": "", "type": "string" } ], "stateMutability": "pure", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "burn", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "components": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "internalType": "address", "name": "recipient", "type": "address" }, { "internalType": "uint128", "name": "amount0Max", "type": "uint128" }, { "internalType": "uint128", "name": "amount1Max", "type": "uint128" } ], "internalType": "struct INonfungiblePositionManager.CollectParams", "name": "params", "type": "tuple" } ], "name": "collect", "outputs": [ { "internalType": "uint256", "name": "amount0", "type": "uint256" }, { "internalType": "uint256", "name": "amount1", "type": "uint256" } ], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "token0", "type": "address" }, { "internalType": "address", "name": "token1", "type": "address" }, { "internalType": "uint24", "name": "fee", "type": "uint24" }, { "internalType": "uint160", "name": "sqrtPriceX96", "type": "uint160" } ], "name": "createAndInitializePoolIfNecessary", "outputs": [ { "internalType": "address", "name": "pool", "type": "address" } ], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "components": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "internalType": "uint128", "name": "liquidity", "type": "uint128" }, { "internalType": "uint256", "name": "amount0Min", "type": "uint256" }, { "internalType": "uint256", "name": "amount1Min", "type": "uint256" }, { "internalType": "uint256", "name": "deadline", "type": "uint256" } ], "internalType": "struct INonfungiblePositionManager.DecreaseLiquidityParams", "name": "params", "type": "tuple" } ], "name": "decreaseLiquidity", "outputs": [ { "internalType": "uint256", "name": "amount0", "type": "uint256" }, { "internalType": "uint256", "name": "amount1", "type": "uint256" } ], "stateMutability": "payable", "type": "function" }, { "inputs": [], "name": "factory", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "getApproved", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "components": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "internalType": "uint256", "name": "amount0Desired", "type": "uint256" }, { "internalType": "uint256", "name": "amount1Desired", "type": "uint256" }, { "internalType": "uint256", "name": "amount0Min", "type": "uint256" }, { "internalType": "uint256", "name": "amount1Min", "type": "uint256" }, { "internalType": "uint256", "name": "deadline", "type": "uint256" } ], "internalType": "struct INonfungiblePositionManager.IncreaseLiquidityParams", "name": "params", "type": "tuple" } ], "name": "increaseLiquidity", "outputs": [ { "internalType": "uint128", "name": "liquidity", "type": "uint128" }, { "internalType": "uint256", "name": "amount0", "type": "uint256" }, { "internalType": "uint256", "name": "amount1", "type": "uint256" } ], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "owner", "type": "address" }, { "internalType": "address", "name": "operator", "type": "address" } ], "name": "isApprovedForAll", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "components": [ { "internalType": "address", "name": "token0", "type": "address" }, { "internalType": "address", "name": "token1", "type": "address" }, { "internalType": "uint24", "name": "fee", "type": "uint24" }, { "internalType": "int24", "name": "tickLower", "type": "int24" }, { "internalType": "int24", "name": "tickUpper", "type": "int24" }, { "internalType": "uint256", "name": "amount0Desired", "type": "uint256" }, { "internalType": "uint256", "name": "amount1Desired", "type": "uint256" }, { "internalType": "uint256", "name": "amount0Min", "type": "uint256" }, { "internalType": "uint256", "name": "amount1Min", "type": "uint256" }, { "internalType": "address", "name": "recipient", "type": "address" }, { "internalType": "uint256", "name": "deadline", "type": "uint256" } ], "internalType": "struct INonfungiblePositionManager.MintParams", "name": "params", "type": "tuple" } ], "name": "mint", "outputs": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "internalType": "uint128", "name": "liquidity", "type": "uint128" }, { "internalType": "uint256", "name": "amount0", "type": "uint256" }, { "internalType": "uint256", "name": "amount1", "type": "uint256" } ], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "bytes[]", "name": "data", "type": "bytes[]" } ], "name": "multicall", "outputs": [ { "internalType": "bytes[]", "name": "results", "type": "bytes[]" } ], "stateMutability": "payable", "type": "function" }, { "inputs": [], "name": "name", "outputs": [ { "internalType": "string", "name": "", "type": "string" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "ownerOf", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "spender", "type": "address" }, { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "internalType": "uint256", "name": "deadline", "type": "uint256" }, { "internalType": "uint8", "name": "v", "type": "uint8" }, { "internalType": "bytes32", "name": "r", "type": "bytes32" }, { "internalType": "bytes32", "name": "s", "type": "bytes32" } ], "name": "permit", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "positions", "outputs": [ { "internalType": "uint96", "name": "nonce", "type": "uint96" }, { "internalType": "address", "name": "operator", "type": "address" }, { "internalType": "address", "name": "token0", "type": "address" }, { "internalType": "address", "name": "token1", "type": "address" }, { "internalType": "uint24", "name": "fee", "type": "uint24" }, { "internalType": "int24", "name": "tickLower", "type": "int24" }, { "internalType": "int24", "name": "tickUpper", "type": "int24" }, { "internalType": "uint128", "name": "liquidity", "type": "uint128" }, { "internalType": "uint256", "name": "feeGrowthInside0LastX128", "type": "uint256" }, { "internalType": "uint256", "name": "feeGrowthInside1LastX128", "type": "uint256" }, { "internalType": "uint128", "name": "tokensOwed0", "type": "uint128" }, { "internalType": "uint128", "name": "tokensOwed1", "type": "uint128" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "refundETH", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "from", "type": "address" }, { "internalType": "address", "name": "to", "type": "address" }, { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "safeTransferFrom", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "from", "type": "address" }, { "internalType": "address", "name": "to", "type": "address" }, { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "internalType": "bytes", "name": "_data", "type": "bytes" } ], "name": "safeTransferFrom", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "token", "type": "address" }, { "internalType": "uint256", "name": "value", "type": "uint256" }, { "internalType": "uint256", "name": "deadline", "type": "uint256" }, { "internalType": "uint8", "name": "v", "type": "uint8" }, { "internalType": "bytes32", "name": "r", "type": "bytes32" }, { "internalType": "bytes32", "name": "s", "type": "bytes32" } ], "name": "selfPermit", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "token", "type": "address" }, { "internalType": "uint256", "name": "nonce", "type": "uint256" }, { "internalType": "uint256", "name": "expiry", "type": "uint256" }, { "internalType": "uint8", "name": "v", "type": "uint8" }, { "internalType": "bytes32", "name": "r", "type": "bytes32" }, { "internalType": "bytes32", "name": "s", "type": "bytes32" } ], "name": "selfPermitAllowed", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "token", "type": "address" }, { "internalType": "uint256", "name": "nonce", "type": "uint256" }, { "internalType": "uint256", "name": "expiry", "type": "uint256" }, { "internalType": "uint8", "name": "v", "type": "uint8" }, { "internalType": "bytes32", "name": "r", "type": "bytes32" }, { "internalType": "bytes32", "name": "s", "type": "bytes32" } ], "name": "selfPermitAllowedIfNecessary", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "token", "type": "address" }, { "internalType": "uint256", "name": "value", "type": "uint256" }, { "internalType": "uint256", "name": "deadline", "type": "uint256" }, { "internalType": "uint8", "name": "v", "type": "uint8" }, { "internalType": "bytes32", "name": "r", "type": "bytes32" }, { "internalType": "bytes32", "name": "s", "type": "bytes32" } ], "name": "selfPermitIfNecessary", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "operator", "type": "address" }, { "internalType": "bool", "name": "approved", "type": "bool" } ], "name": "setApprovalForAll", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "bytes4", "name": "interfaceId", "type": "bytes4" } ], "name": "supportsInterface", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "token", "type": "address" }, { "internalType": "uint256", "name": "amountMinimum", "type": "uint256" }, { "internalType": "address", "name": "recipient", "type": "address" } ], "name": "sweepToken", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [], "name": "symbol", "outputs": [ { "internalType": "string", "name": "", "type": "string" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "index", "type": "uint256" } ], "name": "tokenByIndex", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "owner", "type": "address" }, { "internalType": "uint256", "name": "index", "type": "uint256" } ], "name": "tokenOfOwnerByIndex", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "tokenURI", "outputs": [ { "internalType": "string", "name": "", "type": "string" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "totalSupply", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "from", "type": "address" }, { "internalType": "address", "name": "to", "type": "address" }, { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "transferFrom", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "amount0Owed", "type": "uint256" }, { "internalType": "uint256", "name": "amount1Owed", "type": "uint256" }, { "internalType": "bytes", "name": "data", "type": "bytes" } ], "name": "uniswapV3MintCallback", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "amountMinimum", "type": "uint256" }, { "internalType": "address", "name": "recipient", "type": "address" } ], "name": "unwrapWETH9", "outputs": [], "stateMutability": "payable", "type": "function" }, { "stateMutability": "payable", "type": "receive" } ] ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/blockchain_utils/blockchain_utils.go ================================================ package blockchainutils import ( "bytes" "encoding/json" "fmt" "io" "net/http" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/types/numeric" ) type Client struct { BaseURL string } func (c *Client) buildUrl(resourcePath string) string { if resourcePath != "" { return c.BaseURL + "/" + resourcePath } return c.BaseURL } func (c *Client) doWithoutAuth(req *http.Request) (*http.Response, error) { client := &http.Client{} return client.Do(req) } func (c *Client) methodJSON(method string, apiURL string, jsonObject interface{}, result interface{}) error { var buffer io.Reader if jsonObject != nil { bodyBytes, _ := json.Marshal(jsonObject) buffer = bytes.NewBuffer(bodyBytes) } req, err := http.NewRequest(method, apiURL, buffer) if err != nil { return err } req.Header.Add("Content-Type", "application/json") resp, err := c.doWithoutAuth(req) if err != nil { return err } if resp.StatusCode >= 300 { bodyBytes, err := io.ReadAll(resp.Body) if err != nil { return fmt.Errorf("http response bad status %d %s", resp.StatusCode, err.Error()) } return fmt.Errorf("http response bad status %d %s", resp.StatusCode, string(bodyBytes)) } if result != nil { return json.NewDecoder(resp.Body).Decode(result) } return nil } func (c *Client) SolanaAddress() (string, error) { resp := struct { Result struct { Address string `json:"address"` } `json:"result"` }{} err := c.methodJSON( http.MethodPost, c.buildUrl("solana/address"), nil, &resp, ) if err != nil { return "", err } return resp.Result.Address, nil } func (c *Client) SolanaBalance(addr string) (uint64, error) { resp := struct { Result uint64 `json:"result"` }{} err := c.methodJSON( http.MethodGet, c.buildUrl(fmt.Sprintf("solana/balance/%s", addr)), nil, &resp, ) if err != nil { return 0, err } return uint64(resp.Result), nil } func (c *Client) SolanaBlockheight() (int64, error) { resp := struct { Result int64 `json:"result"` }{} err := c.methodJSON( http.MethodGet, c.buildUrl("solana/blockheight"), nil, &resp, ) if err != nil { return 0, err } return resp.Result, nil } func (c *Client) CleanHtml(htmlString string) (string, error) { resp := struct { Result string `json:"result"` }{} err := c.methodJSON( http.MethodPost, c.buildUrl("clean-html"), map[string]interface{}{ "url": "", "html_data": htmlString, }, &resp, ) if err != nil { return "", err } return resp.Result, nil } type SolanaCreatePumpfunTokenReq struct { Address string `json:"address"` Name string `json:"name"` Symbol string `json:"symbol"` Description string `json:"description"` Twitter string `json:"twitter"` Telegram string `json:"telegram"` Website string `json:"website"` Amount float64 `json:"amount"` ImageBase64 string `json:"image_base64"` } type SolanaCreatePumpfunTokenResp struct { Signature string `json:"signature"` Mint string `json:"mint"` } func (c *Client) SolanaCreatePumpfunToken(req *SolanaCreatePumpfunTokenReq) (*SolanaCreatePumpfunTokenResp, error) { resp := struct { Result *SolanaCreatePumpfunTokenResp `json:"result"` }{} err := c.methodJSON( http.MethodPost, c.buildUrl("solana/create-pumfun"), req, &resp, ) if err != nil { return nil, err } return resp.Result, nil } type SolanaTradePumpfunTokenReq struct { Address string `json:"address"` Action string `json:"action"` Mint string `json:"mint"` Amount float64 `json:"amount"` Pool string `json:"pool"` } func (c *Client) SolanaTradePumpfunToken(req *SolanaTradePumpfunTokenReq) (string, error) { resp := struct { Result string `json:"result"` }{} err := c.methodJSON( http.MethodPost, c.buildUrl("solana/trade-pumfun"), req, &resp, ) if err != nil { return "", err } return resp.Result, nil } type SolanaTokenBalance struct { IsNative bool `json:"is_native"` Mint string `json:"mint"` Owner string `json:"owner"` State string `json:"state"` TokenAmount struct { Amount numeric.BigInt `json:"amount"` Decimals int `json:"decimals"` UIAmount float64 `json:"ui_amount"` UIAmountString string `json:"ui_amount_string"` } `json:"token_amount"` } func (c *Client) SolanaGetTokenBalances(address string) ([]*SolanaTokenBalance, error) { resp := struct { Result []*SolanaTokenBalance `json:"result"` }{} err := c.methodJSON( http.MethodGet, c.buildUrl("solana/balances/"+address), nil, &resp, ) if err != nil { return nil, err } return resp.Result, nil } type SolanaTokenInfoResp struct { Data *struct { Parsed *struct { Info *struct { Decimals int `json:"decimals"` } `json:"info"` } `json:"parsed"` } `json:"data"` } func (c *Client) SolanaTokenInfo(mint string) (*SolanaTokenInfoResp, error) { resp := struct { Result *SolanaTokenInfoResp `json:"result"` }{} err := c.methodJSON( http.MethodGet, c.buildUrl("solana/token-info/"+mint), nil, &resp, ) if err != nil { return nil, err } return resp.Result, nil } type SolanaTokenMetaDataResp struct { Name string `json:"name"` Symbol string `json:"symbol"` Mint string `json:"mint"` } func (c *Client) SolanaTokenMetaData(mint string) (*SolanaTokenMetaDataResp, error) { resp := struct { Result *SolanaTokenMetaDataResp `json:"result"` }{} err := c.methodJSON( http.MethodGet, c.buildUrl("solana/token-metadata/"+mint), nil, &resp, ) if err != nil { return nil, err } return resp.Result, nil } type SolanaTradeRaydiumTokenReq struct { Address string `json:"address"` InputMint string `json:"input_mint"` OutputMint string `json:"output_mint"` Slippage float64 `json:"slippage"` Amount uint64 `json:"amount"` } type SolanaTradeRaydiumTokenResp struct { OutputAmount numeric.BigInt `json:"output_amount"` Signatures []string `json:"signatures"` } func (c *Client) SolanaTradeRaydiumToken(req *SolanaTradeRaydiumTokenReq) (*SolanaTradeRaydiumTokenResp, error) { resp := struct { Result *SolanaTradeRaydiumTokenResp `json:"result"` }{} err := c.methodJSON( http.MethodPost, c.buildUrl("solana/trade-raydium"), req, &resp, ) if err != nil { return nil, err } return resp.Result, nil } type SolanaComputeRaydiumTokenResp struct { SwapType string `json:"swap_type"` InputMint string `json:"input_mint"` InputAmount numeric.BigInt `json:"input_amount"` OutputMint string `json:"output_mint"` OutputAmount numeric.BigInt `json:"output_amount"` OtherAmountThreshold numeric.BigInt `json:"other_amount_threshold"` SlippageBps float64 `json:"slippage_bps"` PriceImpactPct float64 `json:"price_impact_pct"` ReferrerAmount numeric.BigInt `json:"referrer_amount"` RoutePlan []struct { PoolID string `json:"pool_id"` InputMint string `json:"input_mint"` OutputMint string `json:"output_mint"` FeeMint string `json:"fee_mint"` FeeRate int `json:"fee_rate"` FeeAmount numeric.BigInt `json:"fee_amount"` } `json:"route_plan"` } func (c *Client) SolanaComputeRaydiumToken(req *SolanaTradeRaydiumTokenReq) (*SolanaComputeRaydiumTokenResp, error) { resp := struct { Result *SolanaComputeRaydiumTokenResp `json:"result"` }{} err := c.methodJSON( http.MethodPost, c.buildUrl("solana/compute-raydium"), req, &resp, ) if err != nil { return nil, err } return resp.Result, nil } type SolanaTransferReq struct { ToAddress string `json:"to_address"` Mint string `json:"mint"` Amount float64 `json:"amount"` } func (c *Client) SolanaTransfer(address string, req *SolanaTransferReq) (string, error) { resp := struct { Result string `json:"result"` }{} err := c.methodJSON( http.MethodPost, c.buildUrl("solana/transfer/"+address), req, &resp, ) if err != nil { return "", err } return resp.Result, nil } func (c *Client) SolanaValidateAddress(mint string) (bool, error) { resp := struct { Result bool `json:"result"` }{} err := c.methodJSON( http.MethodGet, c.buildUrl("solana/validate/"+mint), nil, &resp, ) if err != nil { return false, err } return resp.Result, nil } type SolanaBalanceByToken struct { Amount string `json:"amount"` Decimals int `json:"decimals"` UIAmount float64 `json:"uiAmount"` UIAmountString string `json:"uiAmountString"` } func (c *Client) SolanaBalanceByToken(address, mint string) (*SolanaBalanceByToken, error) { resp := struct { Result *SolanaBalanceByToken `json:"result"` }{} err := c.methodJSON( http.MethodGet, c.buildUrl(fmt.Sprintf(`solana/balance/%s/%s`, mint, address)), nil, &resp, ) if err != nil { return nil, err } return resp.Result, nil } type ZoraCreateCoinReq struct { Name string `json:"name"` Symbol string `json:"symbol"` Uri string `json:"uri"` Recipient string `json:"recipient"` Deployer string `json:"deployer"` Owners []string `json:"owners"` } type ZoraCreateCoinResp struct { Hash string `json:"hash"` Address string `json:"address"` Deployment struct { PayoutRecipient string `json:"payoutRecipient"` Caller string `json:"caller"` Uri string `json:"uri"` Coin string `json:"coin"` Pool string `json:"pool"` } `json:"deployment"` } func (c *Client) ZoraCreateCoin(req *ZoraCreateCoinReq) (*ZoraCreateCoinResp, error) { resp := struct { Result *ZoraCreateCoinResp `json:"result"` }{} err := c.methodJSON( http.MethodPost, c.buildUrl("/zora/create-coin"), req, &resp, ) if err != nil { return nil, err } return resp.Result, nil } type SolanaCreateTokenReq struct { ProjectID string `json:"project_id"` Address string `json:"address"` Name string `json:"name"` Symbol string `json:"symbol"` Description string `json:"description"` Uri string `json:"uri"` Amount uint64 `json:"amount"` } type SolanaCreateTokenResp struct { Signature interface{} `json:"signature"` Mint string `json:"mint"` } func (c *Client) SolanaCreateToken(req *SolanaCreateTokenReq) (*SolanaCreateTokenResp, error) { resp := struct { Result *SolanaCreateTokenResp `json:"result"` }{} err := c.methodJSON( http.MethodPost, c.buildUrl("solana/create-token"), req, &resp, ) if err != nil { return nil, err } return resp.Result, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/bridgeapi/bridge_api.go ================================================ package bridgeapi import ( "encoding/json" "fmt" "io" "net/http" "time" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/types/numeric" "github.com/pkg/errors" ) type BridgeApi struct { url string } func NewBridgeApi(url string) *BridgeApi { return &BridgeApi{ url: url, } } func (m *BridgeApi) request(fullUrl string, method string, headers map[string]string, reqBody io.Reader) ([]byte, int, error) { req, err := http.NewRequest(method, fullUrl, reqBody) if err != nil { return nil, 0, err } if len(headers) > 0 { for key, val := range headers { req.Header.Add(key, val) } } req.Header.Add("accept", "application/json") req.Header.Add("content-type", "application/json") req.Header.Add("x-api-key", "a71e3753381842") res, err := http.DefaultClient.Do(req) if err != nil { return nil, 0, err } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { return nil, res.StatusCode, err } return body, res.StatusCode, nil } type SolanaEAITxResp struct { ID string `json:"id"` DeletedAt *time.Time `json:"deleted_at"` CreatedAt *time.Time `json:"created_at"` UpdatedAt *time.Time `json:"updated_at"` FromTokenAddress string `json:"fromTokenAddress"` FromNativeAddress string `json:"fromNativeAddress"` DepositTokenAddress string `json:"depositTokenAddress"` DepositNativeAddress string `json:"depositNativeAddress"` TxReceivedDeposit string `json:"txReceivedDeposit"` Token string `json:"token"` Amount numeric.BigInt `json:"amount"` Block int `json:"block"` } func (m *BridgeApi) GetSolanaEAITxs(fromBlock uint64) ([]*SolanaEAITxResp, error) { path := fmt.Sprintf("%s/api/internal/get-solana-eai-txs?fromBlock=%d", m.url, fromBlock) data, code, err := m.request(path, "GET", map[string]string{}, nil) if err != nil { return nil, err } if code != 200 { return nil, errors.New(string(data)) } var res struct { Status bool `json:"status"` Data []*SolanaEAITxResp `json:"data"` } err = json.Unmarshal(data, &res) if err != nil { return nil, err } return res.Data, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/btcapi/blockchain.go ================================================ package btcapi import ( "errors" "fmt" "time" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" ) type RawaddrTXResp struct { Hash string `json:"hash"` Result int64 `json:"result"` Fee uint64 `json:"fee"` } type RawaddrResp struct { NTx uint64 `json:"n_tx"` Txs []*RawaddrTXResp `json:"txs"` } func (c *Client) GetBTCAddressAllTxs(address string) ([]*RawaddrTXResp, error) { rs := []*RawaddrTXResp{} offset := 0 for { time.Sleep(11 * time.Second) txs, err := c.GetBTCAddressTxs(address, offset, 50) if err != nil { return nil, errs.NewError(err) } rs = append(rs, txs...) if len(txs) < 50 { break } offset += 50 } return rs, nil } func (c *Client) GetBTCAddressTxs(address string, offset int, limit int) ([]*RawaddrTXResp, error) { rs := RawaddrResp{} _, err := c.getJSON( fmt.Sprintf("%s/rawaddr/%s?offset=%d&limit=%d", c.BlockchainInfoUrl, address, offset, limit), map[string]string{}, &rs, ) if err != nil { return nil, errs.NewError(err) } return rs.Txs, nil } type MempoolTXResp struct { Txid string `json:"txid"` Fee uint64 `json:"fee"` Vin []*struct { Prevout *struct { ScriptpubkeyAddress string `json:"scriptpubkey_address"` Value uint64 `json:"value"` } `json:"prevout"` } `json:"vin"` } func (c *Client) GetBTCAddressTxsV2(address string, lastTxID string) ([]*MempoolTXResp, error) { rs := []*MempoolTXResp{} for { rs1 := []*MempoolTXResp{} _, err := c.getJSON( fmt.Sprintf("https://mempool.space/api/address/%s/txs/chain%s", address, fmt.Sprintf("/%s", lastTxID)), map[string]string{}, &rs1, ) if err != nil { return nil, errs.NewError(err) } time.Sleep(time.Duration(0.5 * float64(time.Second))) rs = append(rs, rs1...) if len(rs1) < 25 || len(rs) >= 500 { break } lastTxID = rs1[len(rs1)-1].Txid } return rs, nil } func (c *Client) GetLatestBlockHash() (string, int64, error) { var rs struct { Hash string `json:"hash"` BlockIndex int64 `json:"block_index"` } _, err := c.getJSON( fmt.Sprintf("%s/latestblock", c.BlockchainInfoUrl), map[string]string{}, &rs, ) if err != nil { return "", 0, errs.NewError(err) } return rs.Hash, rs.BlockIndex, nil } type BlockInfoResp struct { Hash string `json:"hash"` Tx []*struct { Hash string `json:"hash"` Inputs []*struct { PrevOut *struct { Spent bool `json:"spent"` Value uint64 `json:"value"` Addr string `json:"addr"` } `json:"prev_out"` } `json:"inputs"` Out []*struct { Spent bool `json:"spent"` Value uint64 `json:"value"` Addr string `json:"addr"` } `json:"out"` } `json:"tx"` } type OutResp struct { TxHash string Index uint FromAddress string ToAddrress string Amount uint64 } func (c *Client) GetOutAddrsByHeight(height int64) ([]string, []*OutResp, error) { var rs struct { Blocks []*BlockInfoResp `json:"blocks"` } _, err := c.getJSON( fmt.Sprintf("%s/block-height/%d", c.BlockchainInfoUrl, height), map[string]string{}, &rs, ) if err != nil { return nil, nil, errs.NewError(err) } if len(rs.Blocks) <= 0 { return nil, nil, errs.NewError(errors.New("not found")) } addrMap := map[string]bool{} outArr := []*OutResp{} for _, r := range rs.Blocks { for _, tx := range r.Tx { var fromAddress string for _, in := range tx.Inputs { if in.PrevOut != nil && in.PrevOut.Addr != "" { fromAddress = in.PrevOut.Addr } } for idx, out := range tx.Out { if out.Addr != "" { _, ok := addrMap[out.Addr] if !ok { addrMap[out.Addr] = true } outArr = append(outArr, &OutResp{ TxHash: tx.Hash, Index: uint(idx), FromAddress: fromAddress, ToAddrress: out.Addr, Amount: out.Value, }) } } } } addrs := []string{} for addr := range addrMap { addrs = append(addrs, addr) } return addrs, outArr, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/btcapi/client.go ================================================ package btcapi import ( "bytes" "crypto/sha256" "encoding/hex" "encoding/json" "fmt" "io" "log" "math/big" "net/http" "strconv" "strings" "time" "github.com/blockcypher/gobcy/v2" "github.com/btcsuite/btcd/btcec/v2" "github.com/btcsuite/btcd/btcec/v2/schnorr" "github.com/btcsuite/btcd/btcutil" "github.com/btcsuite/btcd/chaincfg" "github.com/btcsuite/btcd/txscript" "github.com/pkg/errors" ) type Client struct { Chain string Network string Token string client *gobcy.API QNUrl string SdkUrl string BlockstreamUrl string MempoolUrl string HirosoUrl string BlockchainInfoUrl string } const ( // This will calculate and include appropriate fees for your transaction to be included in the next 1-2 blocks PreferenceHigh = "high" // This will calculate and include appropriate fees for your transaction to be included in the next 3-6 blocks PreferenceMedium = "medium" // This will calculate and include appropriate fees for your transaction to be included in the next 7 or more blocks PreferenceLow = "low" // No fee PreferenceZero = "zero" ) func (c *Client) getClient() (*gobcy.API, error) { if c.client == nil { client := gobcy.API{c.Token, c.Chain, c.Network} c.client = &client } return c.client, nil } func (c *Client) doWithAuth(req *http.Request) (*http.Response, error) { client := &http.Client{} return client.Do(req) } func (c *Client) doWithoutAuth(req *http.Request) (*http.Response, error) { client := &http.Client{} return client.Do(req) } func (c *Client) postJSON(apiURL string, headers map[string]string, jsonObject interface{}, result interface{}) error { bodyBytes, _ := json.Marshal(jsonObject) req, err := http.NewRequest(http.MethodPost, apiURL, bytes.NewBuffer(bodyBytes)) if err != nil { return err } req.Header.Add("Content-Type", "application/json") for k, v := range headers { req.Header.Add(k, v) } resp, err := c.doWithAuth(req) if err != nil { return fmt.Errorf("failed request: %v", err) } if resp.StatusCode >= 300 { bodyBytes, err := io.ReadAll(resp.Body) if err != nil { return fmt.Errorf("http response bad status %d %s", resp.StatusCode, err.Error()) } return fmt.Errorf("http response bad status %d %s", resp.StatusCode, string(bodyBytes)) } if result != nil { return json.NewDecoder(resp.Body).Decode(result) } return nil } func (c *Client) getJSON(url string, headers map[string]string, result interface{}) (int, error) { req, err := http.NewRequest(http.MethodGet, url, nil) if err != nil { return 0, fmt.Errorf("failed to create request: %v", err) } req.Header.Add("Content-Type", "application/json") for k, v := range headers { req.Header.Add(k, v) } resp, err := c.doWithAuth(req) if err != nil { return 0, fmt.Errorf("failed request: %v", err) } if resp.StatusCode >= 300 { bodyBytes, err := io.ReadAll(resp.Body) if err != nil { return resp.StatusCode, fmt.Errorf("http response bad status %d %s", resp.StatusCode, err.Error()) } return resp.StatusCode, fmt.Errorf("http response bad status %d %s", resp.StatusCode, string(bodyBytes)) } if result != nil { return resp.StatusCode, json.NewDecoder(resp.Body).Decode(result) } return resp.StatusCode, nil } func (c *Client) methodJSON(method string, apiURL string, jsonObject interface{}, result interface{}) error { var buffer io.Reader if jsonObject != nil { bodyBytes, _ := json.Marshal(jsonObject) buffer = bytes.NewBuffer(bodyBytes) } req, err := http.NewRequest(method, apiURL, buffer) if err != nil { return err } req.Header.Add("Content-Type", "application/json") resp, err := c.doWithoutAuth(req) if err != nil { return err } if resp.StatusCode >= 300 { bodyBytes, err := io.ReadAll(resp.Body) if err != nil { return fmt.Errorf("http response bad status %d %s", resp.StatusCode, err.Error()) } return fmt.Errorf("http response bad status %d %s", resp.StatusCode, string(bodyBytes)) } if result != nil { return json.NewDecoder(resp.Body).Decode(result) } return nil } func (c *Client) Address() (string, string, error) { var networkParams *chaincfg.Params switch c.Chain { case "btc": { switch c.Network { case "main": { networkParams = &chaincfg.MainNetParams } case "test3": { networkParams = &chaincfg.TestNet3Params } default: { networkParams = &chaincfg.MainNetParams } } } } privateKeyBtc, _, receiveAddressBtc, err := c.GenerateAddressSegwit(networkParams) if err != nil { return "", "", err } return receiveAddressBtc, privateKeyBtc, nil } func (c *Client) GenerateAddressSegwit(networkParams *chaincfg.Params, privateKey ...string) (privKey, pubKey, addressSegwit string, err error) { var secret *btcec.PrivateKey if len(privateKey) == 0 { secret, err = btcec.NewPrivateKey() if err != nil { err = errors.Wrap(err, "c.GenerateAddressSegwit") return } } else { secret, _ = btcec.PrivKeyFromBytes([]byte(privateKey[0])) if secret == nil { err = errors.Wrap(err, "invalid secret") return } } wif, err := btcutil.NewWIF(secret, networkParams, true) if err != nil { err = errors.Wrap(err, "c.GenerateAddressSegwit") return } privKey = wif.String() witnessProg := btcutil.Hash160(wif.PrivKey.PubKey().SerializeCompressed()) addressWitnessPubKeyHash, err := btcutil.NewAddressWitnessPubKeyHash(witnessProg, networkParams) if err != nil { err = errors.Wrap(err, "btcutil.NewAddressWitnessPubKeyHash") return } addressSegwit = addressWitnessPubKeyHash.EncodeAddress() return } func (c *Client) GenerateAddressTaproot() (string, string, error) { var networkParams *chaincfg.Params switch c.Chain { case "btc": { switch c.Network { case "main": { networkParams = &chaincfg.MainNetParams } case "test3": { networkParams = &chaincfg.TestNet3Params } default: { panic(errors.New("invalid network")) } } } } privateKeyBtc, _, receiveAddressBtc, err := GenerateAddressTaproot(networkParams) if err != nil { return "", "", err } return receiveAddressBtc, privateKeyBtc, nil } func GenerateAddressTaproot(chainParam *chaincfg.Params, seed ...string) (privKey, pubKey, addressTaproot string, err error) { var secret *btcec.PrivateKey if len(seed) == 0 { secret, err = btcec.NewPrivateKey() if err != nil { err = errors.Wrap(err, "c.GenerateAddressTaproot generate new private key error") return } } else { hash := sha256.Sum256([]byte(seed[0])) secret, _ = btcec.PrivKeyFromBytes(hash[:]) if secret == nil { err = errors.Wrap(err, "c.GenerateAddressTaproot invalid secret") return } } wif, err := btcutil.NewWIF(secret, chainParam, true) if err != nil { err = errors.Wrap(err, "c.GenerateAddressTaproot invalid secret") return } tapKey := txscript.ComputeTaprootKeyNoScript(wif.PrivKey.PubKey()) spendTapPubKey := schnorr.SerializePubKey(tapKey) taprootAddress, err := btcutil.NewAddressTaproot(spendTapPubKey, chainParam) if err != nil { err = errors.Wrap(err, "btcutil.NewAddressTaproot") return } privKey = wif.String() addressTaproot = taprootAddress.String() pubKey = hex.EncodeToString(wif.PrivKey.PubKey().SerializeCompressed()) return } func GenerateAddressTaprootFromPrivateKey(chainParam *chaincfg.Params, privateKey string) (addressTaproot string, err error) { wif, err := btcutil.DecodeWIF(privateKey) if err != nil { err = errors.Wrap(err, "c.GenerateAddressTaproot invalid secret") return } tapKey := txscript.ComputeTaprootKeyNoScript(wif.PrivKey.PubKey()) spendTapPubKey := schnorr.SerializePubKey(tapKey) taprootAddress, err := btcutil.NewAddressTaproot(spendTapPubKey, chainParam) if err != nil { err = errors.Wrap(err, "btcutil.NewAddressTaproot") return } addressTaproot = taprootAddress.String() return } type TxRef struct { TxHash string `json:"tx_hash"` BlockHeight int `json:"block_height"` TxInputN int `json:"tx_input_n"` TxOutputN int `json:"tx_output_n"` Value int `json:"value"` RefBalance int `json:"ref_balance"` Spent bool `json:"spent"` Confirmations int `json:"confirmations"` Confirmed time.Time `json:"confirmed"` DoubleSpend bool `json:"double_spend"` // SatRanges [][]uint64 `json:"sat_ranges"` } type BlockCypherWalletInfo struct { Address string `json:"address"` TotalReceived int `json:"total_received"` TotalSent int `json:"total_sent"` Balance int `json:"balance"` UnconfirmedBalance int `json:"unconfirmed_balance"` FinalBalance int `json:"final_balance"` NTx int `json:"n_tx"` UnconfirmedNTx int `json:"unconfirmed_n_tx"` FinalNTx int `json:"final_n_tx"` Txrefs []TxRef `json:"txrefs"` TxURL string `json:"tx_url"` Error string `json:"error"` } type QuickNodeUTXO_Resp struct { ID int `json:"id"` Result []QuickNodeUTXO `json:"result"` Jsonrpc string `json:"jsonrpc"` } type QuickNodeUTXO struct { Txid string `json:"txid"` Vout int `json:"vout"` Value string `json:"value"` Height int `json:"height"` Confirmations int `json:"confirmations"` } func (c *Client) GetBalanceFromQuickNode(address string) (*BlockCypherWalletInfo, error) { var respond QuickNodeUTXO_Resp var result BlockCypherWalletInfo payload := strings.NewReader(fmt.Sprintf("{\n\t\"method\": \"bb_getutxos\",\n\t\"params\": [\n\t\t\"%v\"\n\t, {\"confirmed\": true}]\n}", address)) req, err := http.NewRequest("POST", c.QNUrl, payload) if err != nil { return nil, err } req.Header.Add("Content-Type", "application/json") res, err := http.DefaultClient.Do(req) if err != nil { return nil, err } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { return nil, err } err = json.Unmarshal(body, &respond) if err != nil { log.Println(string(body)) return nil, err } totalBalance := 0 convertedUTXOList := []TxRef{} for _, utxo := range respond.Result { value, err := strconv.ParseUint(utxo.Value, 10, 64) if err != nil { return nil, err } totalBalance += int(value) newTxReft := TxRef{ TxHash: utxo.Txid, TxOutputN: utxo.Vout, Value: int(value), BlockHeight: utxo.Height, } convertedUTXOList = append(convertedUTXOList, newTxReft) } result.Address = address result.Balance = totalBalance result.FinalBalance = totalBalance result.Txrefs = convertedUTXOList return &result, nil } func (c *Client) GetBalanceFromBlockcypler(addr string) (uint64, error) { client, err := c.getClient() if err != nil { return 0, err } addrInfo, err := client.GetAddrBal(addr, nil) if err != nil { return 0, err } return addrInfo.FinalBalance.Uint64(), nil } func (c *Client) Balance(addr string) (uint64, error) { switch c.Chain { case "btc": { switch c.Network { case "main": { data, err := c.GetBalanceFromQuickNode(addr) if err != nil { return 0, err } return uint64(data.Balance), nil } case "test3": { return c.GetBalanceFromBlockcypler(addr) } default: { panic(errors.New("invalid network")) } } } } return 0, nil } func (bs *Client) Transfer(secret string, from string, destination string, amount int) (string, error) { balance, err := bs.Balance(from) if err != nil { return "", err } if amount > 0 && int(balance) == amount { amount = -1 } chain, err := bs.getClient() if err != nil { return "", err } wif, err := btcutil.DecodeWIF(secret) if err != nil { return "", err } pkHex := hex.EncodeToString(wif.PrivKey.Serialize()) tx := gobcy.TempNewTX(from, destination, *big.NewInt(int64(amount))) tx.Preference = PreferenceHigh skel, err := chain.NewTX(tx, false) // gobcy.TX if err != nil { return "", err } prikHexs := []string{} for i := 0; i < len(skel.ToSign); i++ { prikHexs = append(prikHexs, pkHex) } err = skel.Sign(prikHexs) if err != nil { return "", err } // add this one with segwit address: for i := range skel.Signatures { skel.Signatures[i] = skel.Signatures[i] + "01" } skel, err = chain.SendTX(skel) if err != nil { return "", err } return skel.Trans.Hash, nil } func (c *Client) CheckTXHash(hash string, confirmedBlock int) (bool, error) { client, err := c.getClient() if err != nil { return false, err } tnx, err := client.GetTX(hash, nil) if err != nil { return false, err } if tnx.Confirmations < confirmedBlock { return false, errors.New("tx is not yet confirmed") } return true, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/btcapi/hiroso.go ================================================ package btcapi import ( "fmt" "time" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" ) type WalletBalance struct { Results []*WalletInscription `json:"results"` } type WalletInscription struct { ID string `json:"id"` TxId string `json:"tx_id"` Output string `json:"output"` Value string `json:"value"` Offset string `json:"offset"` } func (c *Client) GetBTCAddressInscriptionsAll(address string) ([]*WalletInscription, error) { rs := []*WalletInscription{} offset := uint(0) for i := 0; i < 25; i++ { rsT, err := c.GetBTCAddressInscriptions(address, offset, 20) if err != nil { return nil, errs.NewError(err) } rs = append(rs, rsT...) if len(rsT) < 20 { break } offset = offset + 20 time.Sleep(100 * time.Millisecond) } return rs, nil } func (c *Client) GetBTCAddressInscriptions(address string, offset uint, limit uint) ([]*WalletInscription, error) { rs := WalletBalance{} _, err := c.getJSON( fmt.Sprintf("%s/ordinals/v1/inscriptions?address=%s&offset=%d&limit=%d", c.HirosoUrl, address, offset, limit), map[string]string{ "x-hiro-api-key": "ce6ddb97db5c94f6a8bac16d8fb803cb", }, &rs, ) if err != nil { return nil, errs.NewError(err) } return rs.Results, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/btcapi/mempool.go ================================================ package btcapi import ( "fmt" "net/http" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/types/numeric" ) func (c *Client) buildMempoolUrl(resourcePath string) string { if resourcePath != "" { return c.MempoolUrl + "/" + resourcePath } return c.MempoolUrl } type MiningPoolResp struct { PoolID uint `json:"poolId"` Name string `json:"name"` Link string `json:"link"` BlockCount int `json:"blockCount"` Rank int `json:"rank"` EmptyBlocks int `json:"emptyBlocks"` Slug string `json:"slug"` AvgMatchRate numeric.BigFloat `json:"avgMatchRate"` AvgFeeDelta numeric.BigFloat `json:"avgFeeDelta"` PoolUniqueID uint `json:"poolUniqueId"` } func (c *Client) GetMiningPools() ([]*MiningPoolResp, error) { resp := struct { Pools []*MiningPoolResp }{} err := c.methodJSON( http.MethodGet, c.buildMempoolUrl("api/v1/mining/pools/3m"), nil, &resp, ) if err != nil { return nil, err } return resp.Pools, nil } type BlockAuditScoreResp struct { Hash string `json:"hash"` MatchRate numeric.BigFloat `json:"matchRate"` ExpectedFees int64 `json:"expectedFees"` ExpectedWeight int64 `json:"expectedWeight"` } func (c *Client) GetBlockAuditScore(hash string) (*BlockAuditScoreResp, error) { resp := BlockAuditScoreResp{} err := c.methodJSON( http.MethodGet, c.buildMempoolUrl(fmt.Sprintf("api/v1/mining/blocks/audit/score/%s", hash)), nil, &resp, ) if err != nil { return nil, err } return &resp, nil } func (c *Client) GetBlocksAuditScore(startHeight uint64) ([]*BlockAuditScoreResp, error) { resp := []*BlockAuditScoreResp{} err := c.methodJSON( http.MethodGet, c.buildMempoolUrl(fmt.Sprintf("api/v1/mining/blocks/audit/scores/%d", startHeight)), nil, &resp, ) if err != nil { return nil, err } return resp, nil } type MiningBlockResp struct { Id string `json:"id"` } func (c *Client) GetMiningPoolBlocks(slug string) ([]*MiningBlockResp, error) { resp := []*MiningBlockResp{} err := c.methodJSON( http.MethodGet, c.buildMempoolUrl(fmt.Sprintf("api/v1/mining/pool/%s/blocks", slug)), nil, &resp, ) if err != nil { return nil, err } return resp, nil } type BlockResp struct { Id string `json:"id"` Extras struct { MatchRate numeric.BigFloat `json:"matchRate"` ExpectedFees int64 `json:"expectedFees"` ExpectedWeight int64 `json:"expectedWeight"` Pool struct { ID uint `json:"id"` Name string `json:"name"` Slug string `json:"slug"` } `json:"pool"` } `json:"extras"` } func (c *Client) GetBlock(hash string) (*BlockResp, error) { resp := BlockResp{} err := c.methodJSON( http.MethodGet, c.buildMempoolUrl(fmt.Sprintf("api/v1/block/%s", hash)), nil, &resp, ) if err != nil { return nil, err } return &resp, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/btcapi/sdk.go ================================================ package btcapi import ( "bytes" "encoding/hex" "encoding/json" "fmt" "io" "math/big" "net/http" "reflect" "strconv" "strings" "time" "github.com/btcsuite/btcd/btcjson" "github.com/btcsuite/btcd/btcutil" "github.com/btcsuite/btcd/chaincfg" "github.com/btcsuite/btcd/rpcclient" "github.com/btcsuite/btcd/wire" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/pkg/errors" ) func detectContentType(body interface{}) string { contentType := "text/plain; charset=utf-8" kind := reflect.TypeOf(body).Kind() switch kind { case reflect.Struct, reflect.Map, reflect.Ptr: contentType = "application/json; charset=utf-8" case reflect.String: contentType = "text/plain; charset=utf-8" default: if b, ok := body.([]byte); ok { contentType = http.DetectContentType(b) } else if kind == reflect.Slice { contentType = "application/json; charset=utf-8" } } return contentType } const MinSat = 546 type ExecRequest struct { Args []string `json:"args"` } type InscriptionT1 struct { InscID string BlockHeight uint64 } type InscriptionT2 struct { Offset int64 `json:"offset"` //BigNumber ID string `json:"id"` } type CreateSendTxRequest struct { // PrivateKey string `json:"-"` //buffer PrivateKeyStr string `json:"privateString"` //buffer SenderAddress string `json:"senderAddress"` Utxos []Utxo `json:"utxos"` Inscriptions map[string][]InscriptionT2 `json:"inscriptions"` SendInscriptionID string `json:"sendInscriptionID"` ReceiverInsAddress string `json:"receiverInsAddress"` SendAmount string `json:"sendAmount"` FeeRatePerByte int `json:"feeRatePerByte"` Network int `json:"network"` } type CreateSendTxMultiRequest struct { // PrivateKey string `json:"-"` //buffer PrivateKeyStr string `json:"privateString"` //buffer SenderAddress string `json:"senderAddress"` Utxos []Utxo `json:"utxos"` Inscriptions map[string][]InscriptionT2 `json:"inscriptions"` PaymentInfos []PaymentInfo `json:"paymentInfos"` FeeRatePerByte int `json:"feeRatePerByte"` Network int `json:"network"` } type CreateSendTxMultiInscRequest struct { PrivateKeyStr string `json:"privateString"` // wif string SenderAddress string `json:"senderAddress"` Utxos []Utxo `json:"utxos"` Inscriptions map[string][]InscriptionT2 `json:"inscriptions"` InscPaymentInfos []InscPaymentInfo `json:"inscPaymentInfos"` PaymentInfos []PaymentInfo `json:"paymentInfos"` FeeRatePerByte int `json:"feeRatePerByte"` Network int `json:"network"` } type CreateRawTxTransferSRC20Request struct { PublicKey string `json:"publicKey"` // wif string SenderAddress string `json:"senderAddress"` Utxos []Utxo `json:"utxos"` Inscriptions map[string][]InscriptionT2 `json:"inscriptions"` Data string `json:"data"` ReceiverAddress string `json:"receiverAddress"` PaymentInfos []PaymentInfo `json:"paymentInfos"` FeeRatePerByte int `json:"feeRatePerByte"` Network int `json:"network"` } type CreateTransferSRC20ScriptRequest struct { Data string `json:"data"` SecretKey string `json:"secretKey"` } type PaymentInfo struct { Address string `json:"address"` Amount string `json:"amount"` } type InscPaymentInfo struct { Address string `json:"address"` InscID string `json:"inscID"` } type Utxo struct { TxHash string `json:"tx_hash"` TxOutputN int64 `json:"tx_output_n"` Value string `json:"value"` } type CreateSendTxResponse struct { ErrorCode string `json:"errorCode"` Error string `json:"error"` Data *struct { TxID string `json:"txID"` TxHex string `json:"txHex"` Fee string `json:"fee"` ChangeAmount string `json:"changeAmount"` SelectedUTXOs []Utxo `json:"selectedUTXOs"` } `json:"data"` } // type Inscription struct { // InscID string // BlockHeight uint64 // } type InscribeTxRequest struct { // PrivateKey string `json:"-"` //buffer PrivateKeyStr string `json:"privateString"` //buffer SenderAddress string `json:"senderAddress"` Utxos []Utxo `json:"utxos"` Inscriptions map[string][]InscriptionT2 `json:"inscriptions"` Data string `json:"data"` FeeRatePerByte int `json:"feeRatePerByte"` Network int `json:"network"` } type InscribeTxResponse struct { ErrorCode string `json:"errorCode"` Error string `json:"error"` Data *struct { CommitTxID string `json:"commitTxID"` CommitTxHex string `json:"commitTxHex"` RevealTxID string `json:"revealTxID"` RevealTxHex string `json:"revealTxHex"` Fee string `json:"totalFee"` SelectedUTXOs []Utxo `json:"selectedUTXOs"` NewUTXOs []Utxo `json:"newUTXOs"` } `json:"data"` } type CreateRawTxResponse struct { ErrorCode string `json:"errorCode"` Error string `json:"error"` Data *struct { Base64Psbt string `json:"base64Psbt"` Fee string `json:"fee"` SelectedUTXOs []Utxo `json:"selectedUTXOs"` ChangeAmount string `json:"changeAmount"` IndicesToSign []int `json:"indicesToSign"` } `json:"data"` } type CreateTransferSRC20ScriptResponse struct { ErrorCode string `json:"errorCode"` Error string `json:"error"` Data []string `json:"data"` } func (c *Client) CreateSendTxSendMultiInsc(req CreateSendTxMultiInscRequest) (CreateSendTxResponse, error) { var rs CreateSendTxResponse err := c.postJSON( fmt.Sprintf("%s/create-tx-send-insc-multi", c.SdkUrl), map[string]string{}, &req, &rs, ) if err != nil { return rs, errs.NewError(err) } return rs, nil } type CreateOrdInscImgResp struct { ErrorCode string `json:"errorCode"` Error string `json:"error"` Data *struct { CommitTxHex string `json:"commitTxHex"` CommitTxID string `json:"commitTxID"` RevealTxHex string `json:"revealTxHex"` RevealTxID string `json:"revealTxID"` } `json:"data"` } func (c *Client) CreateOrdInscImgParam(req CreateOrdInscImgDtoRequest) (CreateOrdInscImgResp, error) { var rs CreateOrdInscImgResp err := c.postJSON( fmt.Sprintf("%s/create-ord-insc-img", c.SdkUrl), map[string]string{}, &req, &rs, ) if err != nil { return rs, errs.NewError(err) } return rs, nil } func (u *Client) getBlockHeightFromBlockStream() (uint64, error) { url := u.BlockstreamUrl + "/api/blocks/tip/height" resp, err := http.Get(url) if err != nil { return 0, err } defer resp.Body.Close() body, err := io.ReadAll(resp.Body) if err != nil { return 0, err } if resp.StatusCode == 429 { return 0, errors.New("429 Too Many Requests") } bodyStr := string(body) if strings.Contains(bodyStr, "RPC error") { return 0, errors.New(bodyStr) } blockHeight, err := strconv.ParseUint(bodyStr, 10, 64) if err != nil { return 0, err } return blockHeight, nil } func (u *Client) GetBlockCountFromService() (uint64, error) { blockHeight, err := u.getBlockHeightFromBlockStream() if err != nil { return 0, errs.NewError(err) } return blockHeight, nil } type UTXO struct { TxHash string `json:"tx_hash"` TxOutputN int `json:"tx_output_n"` Value uint64 `json:"value"` } type UTXOIns struct { InscID string `json:"inscID"` TxHash string `json:"tx_hash"` TxOutputN int `json:"tx_output_n"` Value uint64 `json:"value"` Offset uint64 `json:"offset"` } type BTCFullnodeConfig struct { Host string `json:"host"` Username string `json:"username"` Password string `json:"password"` IsHttps string `json:"is_https"` } func (u *Client) BuildBTCClient(cfg *BTCFullnodeConfig) (*rpcclient.Client, error) { connCfg := &rpcclient.ConnConfig{ Host: cfg.Host, User: cfg.Username, Pass: cfg.Password, HTTPPostMode: true, // Bitcoin core only supports HTTP POST mode DisableTLS: !(cfg.IsHttps == "true"), // Bitcoin core does not provide TLS by default } return rpcclient.New(connCfg, nil) } func (u *Client) GetUTXOs(btcClient *rpcclient.Client, addresses []string, chainCfg *chaincfg.Params, minConfirmation, maxConfirmation int) ([]btcjson.ListUnspentResult, error) { trackingBTCAddresses := []btcutil.Address{} for _, addressStr := range addresses { address, err := btcutil.DecodeAddress(addressStr, chainCfg) if err != nil { continue } trackingBTCAddresses = append(trackingBTCAddresses, address) } listUnspentResults, err := btcClient.ListUnspentMinMaxAddresses(minConfirmation, maxConfirmation, trackingBTCAddresses) if err != nil { return nil, errs.NewError(err) } return listUnspentResults, nil } type BitcoinParams struct { FirstScannedBTCBlkHeight uint64 MasterPubKeys [][]byte GeneralMultisigWallet string NumRequiredSigs int TotalSigs int MinDepositAmount uint64 MinWithdrawAmount uint64 DepositFee uint64 ChainParam *chaincfg.Params InputSize int // for multisig OutputSize int MaxTxSize int MaxFeeRate int TaprootInputSize int } var BitcoinParamsMaintest = &BitcoinParams{ FirstScannedBTCBlkHeight: uint64(787496), MasterPubKeys: [][]byte{ []byte{0x2, 0xe, 0x8, 0xa, 0xe3, 0xcf, 0xf5, 0x1d, 0xc3, 0xc0, 0x83, 0xaf, 0xa9, 0x24, 0x71, 0x9c, 0x2f, 0xca, 0x62, 0x89, 0x74, 0x70, 0xb4, 0x8b, 0x9, 0x51, 0x3, 0x6f, 0x32, 0x9e, 0xdb, 0x5f, 0xe7}, []byte{0x3, 0xc2, 0x3c, 0x3d, 0x6f, 0x83, 0xbe, 0xc9, 0x56, 0xde, 0x6a, 0x54, 0x90, 0xac, 0x2d, 0xe7, 0xee, 0x5c, 0xf8, 0x63, 0x22, 0x84, 0x9c, 0x61, 0xed, 0x62, 0x5b, 0x69, 0x8f, 0x4a, 0x4a, 0xee, 0x49}, []byte{0x3, 0x3b, 0x75, 0x80, 0x77, 0x8f, 0x4d, 0x2e, 0x46, 0x20, 0x6a, 0xd5, 0x32, 0x66, 0x18, 0xb6, 0xd6, 0x4c, 0x46, 0x1a, 0xe, 0x47, 0xb2, 0x5a, 0x77, 0xad, 0x72, 0xdc, 0x56, 0x4e, 0xa6, 0xca, 0xdb}, []byte{0x2, 0xfc, 0x81, 0x32, 0xba, 0xb2, 0x85, 0x71, 0x82, 0x3f, 0x82, 0x3d, 0x74, 0xe5, 0xd4, 0xa2, 0xff, 0xcb, 0xb, 0xe7, 0x2c, 0x49, 0x63, 0xb3, 0x73, 0x75, 0xf7, 0xc4, 0x41, 0xf9, 0x3e, 0xda, 0x96}, []byte{0x2, 0xb2, 0x14, 0xd8, 0x19, 0x77, 0x31, 0x59, 0xa3, 0xae, 0x9c, 0x30, 0xf9, 0x85, 0xa4, 0xe0, 0x56, 0x1d, 0x98, 0x9d, 0xf6, 0x27, 0xfb, 0xbd, 0xd6, 0x9d, 0x33, 0xdd, 0xa7, 0x25, 0x38, 0x35, 0xb5}, []byte{0x3, 0xb8, 0xc6, 0xf2, 0x80, 0x9d, 0xe5, 0xd, 0x6a, 0x43, 0x57, 0xb9, 0xac, 0xce, 0xaa, 0xd, 0x8, 0xda, 0xd4, 0x75, 0xd9, 0x6a, 0xbf, 0x70, 0x14, 0xe7, 0x2a, 0xeb, 0x68, 0xe0, 0xb1, 0xa4, 0xb4}, []byte{0x2, 0xee, 0x76, 0x26, 0xa3, 0x4f, 0xd, 0xb7, 0x57, 0x21, 0xa4, 0x44, 0x8c, 0xa8, 0x6e, 0x59, 0xa1, 0x32, 0x2d, 0xa6, 0xbe, 0xf8, 0x86, 0xbf, 0x64, 0xa5, 0x94, 0xa7, 0xed, 0x20, 0xfd, 0xc2, 0x52}, }, GeneralMultisigWallet: "bc1qajyp9ekpepmhftxq8aeps4cv8gjkat00nfk9lplqec7mevhv4z6qxy37z8", NumRequiredSigs: 5, TotalSigs: 7, MinDepositAmount: uint64(0), MinWithdrawAmount: uint64(0), DepositFee: uint64(10000), ChainParam: &chaincfg.MainNetParams, InputSize: 192, OutputSize: 43, MaxTxSize: 51200, // 50 KB TaprootInputSize: 68, // MaxFeeRate: 150, } func toSat(amount float64) uint64 { amtFloat := new(big.Float).SetFloat64(amount*1e8 + 0.5) res, _ := amtFloat.Uint64() return res } type GetTxInfoFromBlockStream struct { Txid string `json:"txid"` Version int `json:"version"` Locktime int `json:"locktime"` Vin []struct { Txid string `json:"txid"` Vout int `json:"vout"` Prevout struct { Scriptpubkey string `json:"scriptpubkey"` ScriptpubkeyAsm string `json:"scriptpubkey_asm"` ScriptpubkeyType string `json:"scriptpubkey_type"` ScriptpubkeyAddress string `json:"scriptpubkey_address"` Value int `json:"value"` } `json:"prevout"` Scriptsig string `json:"scriptsig"` ScriptsigAsm string `json:"scriptsig_asm"` Witness []string `json:"witness"` IsCoinbase bool `json:"is_coinbase"` Sequence int `json:"sequence"` InnerWitnessscriptAsm string `json:"inner_witnessscript_asm"` } `json:"vin"` Vout []struct { Scriptpubkey string `json:"scriptpubkey"` ScriptpubkeyAsm string `json:"scriptpubkey_asm"` ScriptpubkeyType string `json:"scriptpubkey_type"` ScriptpubkeyAddress string `json:"scriptpubkey_address"` Value int `json:"value"` } `json:"vout"` Size int `json:"size"` Weight int `json:"weight"` Fee int `json:"fee"` Status struct { Confirmed bool `json:"confirmed"` BlockHeight int `json:"block_height"` BlockHash string `json:"block_hash"` BlockTime int `json:"block_time"` } `json:"status"` } func (u *Client) getAddressMempoolTxsFromBlockStream(address string) ([]GetTxInfoFromBlockStream, error) { var result []GetTxInfoFromBlockStream time.Sleep(100 * time.Millisecond) url := u.BlockstreamUrl + fmt.Sprintf("/api/address/%s/txs/mempool", address) resp, err := http.Get(url) if err != nil { return nil, err } defer resp.Body.Close() body, err := io.ReadAll(resp.Body) if err != nil { return nil, err } bodyStr := string(body) if strings.Contains(bodyStr, "RPC error") { return nil, errors.New(bodyStr) } respUTXOs := []GetTxInfoFromBlockStream{} err = json.Unmarshal(body, &respUTXOs) if err != nil { return nil, err } result = append(result, respUTXOs...) return result, nil } type UTXOFromBlockStream struct { Txid string `json:"txid"` Vout int `json:"vout"` Status struct { Confirmed bool `json:"confirmed"` BlockHeight int `json:"block_height"` BlockHash string `json:"block_hash"` BlockTime int `json:"block_time"` } `json:"status"` Value int `json:"value"` } func (u *Client) getUTXOFromBlockStream(address string, minConfirm, maxConfirm uint64, curBlockHeight uint64) ([]*UTXO, error) { url := u.BlockstreamUrl + "/api/address/" + address + "/utxo" resp, err := http.Get(url) if err != nil { return nil, err } defer resp.Body.Close() body, err := io.ReadAll(resp.Body) if err != nil { return nil, err } if resp.StatusCode == 429 { return nil, errors.New("429 Too Many Requests") } bodyStr := string(body) if strings.Contains(bodyStr, "RPC error") { return nil, errors.New(bodyStr) } respUTXOs := []UTXOFromBlockStream{} err = json.Unmarshal(body, &respUTXOs) if err != nil { return nil, err } result := []*UTXO{} for _, utxo := range respUTXOs { confirm := uint64(0) if utxo.Status.Confirmed { confirm = uint64(int(curBlockHeight) - int(utxo.Status.BlockHeight) + 1) } if confirm >= minConfirm && confirm <= maxConfirm { result = append(result, &UTXO{ TxHash: utxo.Txid, TxOutputN: utxo.Vout, Value: uint64(utxo.Value), }) } } return result, nil } func (u *Client) getUTXONoPendingFromBlockStreamV2(address string, minConfirm uint64, maxConfirm uint64, curBlockHeight uint64) ([]*UTXO, error) { utxos, err := u.getUTXOFromBlockStream(address, minConfirm, maxConfirm, curBlockHeight) if err != nil { fmt.Println("getUTXOFromBlockStream err", err) return nil, err } pendingTxs, err := u.getAddressMempoolTxsFromBlockStream(address) if err != nil { fmt.Println("getAddressMempoolTxsFromBlockStream err", err) return nil, err } pendingUTXOMap := map[string]bool{} for _, tx := range pendingTxs { for _, input := range tx.Vin { if input.Prevout.ScriptpubkeyAddress != address { continue } key := fmt.Sprintf("%v:%v", input.Txid, input.Vout) pendingUTXOMap[key] = true } } utxosNoPending := []*UTXO{} for _, utxo := range utxos { key := fmt.Sprintf("%v:%v", utxo.TxHash, utxo.TxOutputN) if !pendingUTXOMap[key] { utxosNoPending = append(utxosNoPending, utxo) } } return utxosNoPending, nil } func (u *Client) convertUTXOToSDKFormat(utxos []*UTXO) []Utxo { utxoSDK := []Utxo{} for _, utxo := range utxos { utxoSDK = append(utxoSDK, Utxo{ TxHash: utxo.TxHash, TxOutputN: int64(utxo.TxOutputN), Value: fmt.Sprintf("%v", utxo.Value), }) } return utxoSDK } func (u *Client) CheckBVMInscs(txIDs []string) ([]bool, error) { var resp struct { Result []bool `json:"result"` Error *struct { Code int `json:"code"` Message string `json:"message"` } `json:"error"` } url := fmt.Sprintf("https://tc-node-public-webstat.trustless.computer/check-validtc?btc-txs=%s", strings.Join(txIDs, ",")) // fmt.Printf("CheckBVMInscs URL: %v", url) client := &http.Client{} req, err := http.NewRequest("GET", url, nil) if err != nil { return nil, err } req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { return nil, err } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { return nil, err } err = json.Unmarshal(body, &resp) if err != nil { return nil, err } if resp.Result == nil || resp.Error != nil { return nil, errors.New(resp.Error.Message) } return resp.Result, nil } type TCInscription struct { Offset int64 `json:"offset"` //BigNumber ID string `json:"id"` } func (u *Client) GetListUnspentBVMInscsForSend(btcAddress string, inscUTXOs []*UTXOIns) ([]InscriptionT1, []Utxo, map[string][]InscriptionT2, error) { btcBestBlockHeight, err := u.GetBlockCountFromService() if err != nil { return nil, nil, nil, errs.NewError(err) } utxos, err := u.getUTXONoPendingFromBlockStreamV2(btcAddress, uint64(1), uint64(9999999), btcBestBlockHeight) if err != nil { return nil, nil, nil, errs.NewError(err) } // for returning api bvmInsc := []InscriptionT1{} // for create tx utxosSDK := u.convertUTXOToSDKFormat(utxos) inscriptionMapSDK := make(map[string][]InscriptionT2) for _, u := range inscUTXOs { key := fmt.Sprintf("%v:%v", u.TxHash, u.TxOutputN) inscriptionMapSDK[key] = []InscriptionT2{ { ID: u.InscID, Offset: int64(u.Offset), }, } } return bvmInsc, utxosSDK, inscriptionMapSDK, nil } func (u *Client) GetListUnspentBVMInscsForMint(btcAddress string) ([]InscriptionT1, []Utxo, map[string][]InscriptionT2, error) { btcBestBlockHeight, err := u.GetBlockCountFromService() if err != nil { return nil, nil, nil, errs.NewError(err) } utxos, err := u.getUTXONoPendingFromBlockStreamV2(btcAddress, uint64(1), uint64(9999999), btcBestBlockHeight) if err != nil { return nil, nil, nil, errs.NewError(err) } // for returning api bvmInsc := []InscriptionT1{} // for create tx utxosSDK := u.convertUTXOToSDKFormat(utxos) inscriptionMapSDK := make(map[string][]InscriptionT2) // return bvmInsc, utxosSDK, inscriptionMapSDK, nil } type FeeRates struct { FastestFee int `json:"fastestFee"` HalfHourFee int `json:"halfHourFee"` HourFee int `json:"hourFee"` EconomyFee int `json:"economyFee"` MinimumFee int `json:"minimumFee"` } func (u *Client) getFeeRateFromChain() (*FeeRates, error) { client := http.Client{ Timeout: 5 * time.Second, } response, err := client.Get("https://mempool.space/api/v1/fees/recommended") if err != nil { fmt.Print(err.Error()) return nil, err } responseData, err := io.ReadAll(response.Body) if err != nil { return nil, err } feeRateObj := &FeeRates{} err = json.Unmarshal(responseData, &feeRateObj) if err != nil { return nil, errs.NewError(err) } return feeRateObj, nil } func (u *Client) GetFeeRate() (int, error) { // cache here: feeRate := 30 feeRateCurrent, err := u.getFeeRateFromChain() if err != nil { return 0, errs.NewError(err) } feeRate = feeRateCurrent.FastestFee return feeRate, nil } func (u *Client) SendBVMInscs(btcAddress string, privateKey string, inscIDs []string, addresses []string, inscUTXOs []*UTXOIns, feeRate int) (string, string, error) { _, utxoSDK, inscriptionMapSDK, err := u.GetListUnspentBVMInscsForSend(btcAddress, inscUTXOs) if err != nil { return "", "", errs.NewError(err) } if len(utxoSDK) <= 0 { return "", "", errs.NewError(errors.New("utxoSDK is empty")) } if feeRate <= 0 { feeRate, err = u.GetFeeRate() if err != nil { return "", "", errs.NewError(err) } } inscPaymentInfos := []InscPaymentInfo{} sendInscIDsMap := map[string]bool{} for i, inscID := range inscIDs { inscPaymentInfos = append(inscPaymentInfos, InscPaymentInfo{ Address: addresses[i], InscID: inscID, }) sendInscIDsMap[inscID] = true } network := 1 // if u.Config.ENV == "develop" { // network = 3 // } param := CreateSendTxMultiInscRequest{ PrivateKeyStr: privateKey, SenderAddress: btcAddress, Utxos: utxoSDK, Inscriptions: inscriptionMapSDK, InscPaymentInfos: inscPaymentInfos, PaymentInfos: []PaymentInfo{}, FeeRatePerByte: feeRate, Network: network, } respData, err := u.CreateSendTxSendMultiInsc(param) if err != nil { return "", "", errs.NewError(err) } if respData.Error != "" { return "", "", errs.NewError(errors.New(respData.Error)) } _, err = u.ParseTx(respData.Data.TxHex) if err != nil { return "", "", errs.NewError(err) } _, err = u.BroadcastBTCTxByMempool(respData.Data.TxHex) if err != nil { return "", "", errs.NewError(err) } return respData.Data.TxID, respData.Data.TxHex, nil } func (u *Client) ParseTx(data string) (*wire.MsgTx, error) { dataBytes, err := hex.DecodeString(data) if err != nil { return nil, err } tx := &wire.MsgTx{} err = tx.Deserialize(strings.NewReader(string(dataBytes))) if err != nil { return nil, err } return tx, nil } func (u *Client) BroadcastBTCTxByMempool(hexTx string) (string, error) { url := u.MempoolUrl + "/api/tx" resp, err := http.Post(url, "application/json", bytes.NewBuffer([]byte(hexTx))) if err != nil { return "", err } defer resp.Body.Close() body, err := io.ReadAll(resp.Body) if err != nil { return "", err } bodyStr := string(body) if strings.Contains(bodyStr, "RPC error") { return "", errors.New(bodyStr) } return bodyStr, nil } type CreateOrdInscImgDtoRequest struct { Network int `json:"network"` PrivateString string `json:"privateString"` SenderAddress string `json:"senderAddress"` Utxos []Utxo `json:"utxos"` Inscriptions map[string][]InscriptionT2 `json:"inscriptions"` Data string `json:"data"` ContentType string `json:"contentType"` FeeRatePerByte int `json:"feeRatePerByte"` ReceiverAddress string `json:"receiverAddress"` } func (u *Client) CreateOrdInscImg(btcAddress string, privateKey string, feeRate int, receiverAddress string, data []byte) (string, string, error) { _, utxoSDK, _, err := u.GetListUnspentBVMInscsForMint(btcAddress) if err != nil { return "", "", errs.NewError(err) } if len(utxoSDK) <= 0 { return "", "", errs.NewError(errors.New("utxo list empty")) } if feeRate <= 0 { feeRate, err = u.GetFeeRate() if err != nil { return "", "", errs.NewError(err) } } network := 1 // if u.Config.ENV == "develop" { // network = 3 // } // filter list utxos to reduce payload contentType := detectContentType(data) param := CreateOrdInscImgDtoRequest{ PrivateString: privateKey, SenderAddress: btcAddress, Utxos: utxoSDK, Inscriptions: map[string][]InscriptionT2{}, FeeRatePerByte: feeRate, Network: network, ReceiverAddress: receiverAddress, ContentType: contentType, Data: hex.EncodeToString(data), } respData, err := u.CreateOrdInscImgParam(param) if err != nil { return "", "", errs.NewError(err) } var txHash1, txHash2 string txHash1, err = u.BroadcastBTCTxByMempool(respData.Data.CommitTxHex) if err != nil { return "", "", errs.NewError(err) } time.Sleep(5 * time.Second) txHash2, err = u.BroadcastBTCTxByMempool(respData.Data.RevealTxHex) if err != nil { return "", "", errs.NewError(err) } return respData.Data.RevealTxID, fmt.Sprintf("%s_%s", txHash1, txHash2), nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/clanker/clanker_client.go ================================================ package clanker import ( "bytes" "encoding/json" "fmt" "io" "net/http" ) type Client struct { BaseURL string ApiKey string } func NewClankerClient(apiKey, apiUrl string) *Client { return &Client{ ApiKey: apiKey, BaseURL: apiUrl, } } func (c *Client) buildUrl(resourcePath string) string { if resourcePath != "" { return c.BaseURL + "/" + resourcePath } return c.BaseURL } func (c *Client) doWithoutAuth(req *http.Request) (*http.Response, error) { client := &http.Client{} return client.Do(req) } func (c *Client) methodJSON(method string, apiURL string, jsonObject interface{}, result interface{}) error { var buffer io.Reader if jsonObject != nil { bodyBytes, _ := json.Marshal(jsonObject) buffer = bytes.NewBuffer(bodyBytes) } req, err := http.NewRequest(method, apiURL, buffer) if err != nil { return err } req.Header.Add("Content-Type", "application/json") req.Header.Add("x-api-key", c.ApiKey) resp, err := c.doWithoutAuth(req) if err != nil { return err } if resp.StatusCode >= 300 { bodyBytes, err := io.ReadAll(resp.Body) if err != nil { return fmt.Errorf("http response bad status %d %s", resp.StatusCode, err.Error()) } return fmt.Errorf("http response bad status %d %s", resp.StatusCode, string(bodyBytes)) } if result != nil { return json.NewDecoder(resp.Body).Decode(result) } return nil } type DeployTokenReq struct { Name string `json:"name"` Symbol string `json:"symbol"` Description string `json:"description"` Image string `json:"image"` RequestKey string `json:"requestKey"` RequestorAddress string `json:"requestorAddress"` SocialMediaUrls []string `json:"socialMediaUrls"` Platform string `json:"platform"` CreatorRewardsPercentage float64 `json:"creatorRewardsPercentage"` CreatorRewardsAdmin string `json:"creatorRewardsAdmin"` } type DeployTokenResp struct { ID int `json:"id"` CreatedAt string `json:"created_at"` TxHash string `json:"tx_hash"` ContractAddress string `json:"contract_address"` RequestorFID int `json:"requestor_fid"` Name string `json:"name"` Symbol string `json:"symbol"` ImgURL string `json:"img_url"` PoolAddress string `json:"pool_address"` CastHash string `json:"cast_hash"` Type string `json:"type"` Pair string `json:"pair"` PresaleID int `json:"presale_id"` } func (c *Client) DeployToken(req *DeployTokenReq) (*DeployTokenResp, error) { resp := &DeployTokenResp{} err := c.methodJSON( http.MethodPost, c.buildUrl("tokens/deploy"), req, &resp, ) if err != nil { return nil, err } return resp, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/coingecko/client.go ================================================ package coingecko import ( "encoding/json" "fmt" "io" "net/http" "time" ) type CoinGeckoAPI struct { serverURL string } func NewCoinGeckoAPI() *CoinGeckoAPI { serverURL := "https://api.coingecko.com/api/v3/coins" return &CoinGeckoAPI{ serverURL: serverURL, } } type SolanaTokenInfo struct { ID string `json:"id"` Name string `json:"name"` Symbol string `json:"symbol"` CurrentPrice float64 `json:"price"` } type PriceData struct { Timestamp time.Time `json:"timestamp"` Price float64 `json:"price"` } func (m *CoinGeckoAPI) GetSolanaTokenInfo(contract string) (*SolanaTokenInfo, error) { url := fmt.Sprintf("%s/solana/contract/%s", m.serverURL, contract) client := &http.Client{} req, err := http.NewRequest("GET", url, nil) if err != nil { return nil, fmt.Errorf("Error creating request: %v", err) } req.Header.Set("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36") req.Header.Set("Accept-Language", "en-US,en;q=0.9") req.Header.Set("Accept", "application/json") resp, err := client.Do(req) if err != nil { return nil, fmt.Errorf("Error fetching data: %v", err) } defer resp.Body.Close() body, err := io.ReadAll(resp.Body) if err != nil { return nil, fmt.Errorf("Error reading response body: %v", err) } var result map[string]interface{} err = json.Unmarshal(body, &result) if err != nil { return nil, fmt.Errorf("Error parsing JSON: %v", err) } id, _ := result["id"].(string) name, _ := result["name"].(string) symbol, _ := result["symbol"].(string) marketData, ok := result["market_data"].(map[string]interface{}) if !ok { return nil, fmt.Errorf("Market data not found") } currentPrice, ok := marketData["current_price"].(map[string]interface{}) if !ok { return nil, fmt.Errorf("Current price not found") } price, _ := currentPrice["usd"].(float64) tokenInfo := &SolanaTokenInfo{ ID: id, Name: name, Symbol: symbol, CurrentPrice: price, } return tokenInfo, nil } func (m *CoinGeckoAPI) GetCoinMarketChart(coinID string, currency string) ([]PriceData, error) { url := fmt.Sprintf("%s/%s/market_chart?vs_currency=%s&days=1", m.serverURL, coinID, currency) client := &http.Client{} req, err := http.NewRequest("GET", url, nil) if err != nil { return nil, fmt.Errorf("Error creating request: %v", err) } req.Header.Set("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36") req.Header.Set("Accept", "application/json") req.Header.Set("Accept-Language", "en-US,en;q=0.9") req.Header.Set("Connection", "keep-alive") req.Header.Set("Upgrade-Insecure-Requests", "1") resp, err := client.Do(req) if err != nil { return nil, fmt.Errorf("Error fetching data: %v", err) } defer resp.Body.Close() body, err := io.ReadAll(resp.Body) if err != nil { return nil, fmt.Errorf("Error reading response body: %v", err) } var result map[string]interface{} err = json.Unmarshal(body, &result) if err != nil { return nil, fmt.Errorf("Error parsing JSON: %v", err) } prices := result["prices"].([]interface{}) var priceDataArray []PriceData for _, priceData := range prices { pricePair := priceData.([]interface{}) timestamp := int64(pricePair[0].(float64)) price := pricePair[1].(float64) timeStamp := time.Unix(timestamp/1000, 0) priceDataArray = append(priceDataArray, PriceData{ Timestamp: timeStamp, Price: price, }) } return priceDataArray, nil } // func main() { // client := NewCoinGeckoAPI() // info, _ := client.GetSolanaTokenInfo("2KgAN8nLAU74wjiyKi85m4ZT6Z9MtqrUTGfse8Xapump") // b, _ := json.Marshal(info) // fmt.Println(string(b)) // chart, _ := client.GetCoinMarketChart(info.ID, "USD") // a, _ := json.Marshal(chart) // fmt.Println(string(a)) // } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/coinmarketcap/coin_market_cap.go ================================================ package coinmarketcap import ( "encoding/json" "errors" "fmt" "io" "math/big" "net/http" "net/url" "strings" "time" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/types/numeric" ) type CoinMarketCap struct { serverURL string apiKey string } type PriceConversionResponse struct { Status interface{} `json:"status"` Data PriceConversionDataResponse `json:"data"` } type PriceConversionDataResponse struct { Id int `json:"id"` Symbol string `json:"symbol"` Name string `json:"name"` Amount int `json:"amount"` LastUpdated time.Time `json:"last_updated"` Quote Quote `json:"quote"` } type HistoricalDataCoin struct { ID uint `json:"id"` Name string `json:"name"` Symbol string `json:"symbol"` Quotes []*struct { Timestamp string `json:"timestamp"` Quote *struct { USD *struct { Price numeric.BigFloat `json:"price"` Timestamp time.Time `json:"timestamp"` } `json:"USD"` } `json:"quote"` } `json:"quotes"` } type HistoricalData struct { Data map[string]*HistoricalDataCoin `json:"data"` } type Quote struct { USD USD `json:"usd"` } type USD struct { Price float64 `json:"price"` LastUpdated time.Time `json:"last_updated"` } func NewCoinMarketCap(apiKey string) *CoinMarketCap { apiURL := "https://pro-api.coinmarketcap.com" return &CoinMarketCap{ serverURL: apiURL, apiKey: apiKey, } } func (m *CoinMarketCap) generateUrl(path string) string { fullUrl := fmt.Sprintf("%s/%s", m.serverURL, path) return fullUrl } func (m *CoinMarketCap) request(fullUrl string, method string, headers map[string]string, reqBody io.Reader) ([]byte, int, error) { req, err := http.NewRequest(method, fullUrl, reqBody) if err != nil { return nil, 0, err } if len(headers) > 0 { for key, val := range headers { req.Header.Add(key, val) } } req.Header.Add("accept", "application/json") req.Header.Add("content-type", "application/json") req.Header.Add("X-CMC_PRO_API_KEY", m.apiKey) res, err := http.DefaultClient.Do(req) if err != nil { return nil, 0, err } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { return nil, res.StatusCode, err } return body, res.StatusCode, nil } func (m *CoinMarketCap) GetHistoricalPrice(id string, unixEnd int64) (*big.Float, error) { urlQueries := url.Values{} urlQueries.Set("id", id) urlQueries.Set("time_start", fmt.Sprintf("%d", unixEnd-1)) urlQueries.Set("time_end", fmt.Sprintf("%d", unixEnd)) urlQueries.Set("interval", "hourly") path := fmt.Sprintf("v3/cryptocurrency/quotes/historical?%s", urlQueries.Encode()) fullUrl := m.generateUrl(path) data, _, err := m.request(fullUrl, "GET", nil, nil) if err != nil { return nil, err } resp := &HistoricalData{} err = json.Unmarshal(data, resp) if err != nil { return nil, err } if resp.Data[id] == nil { return nil, errors.New("not found coin") } var price numeric.BigFloat for _, v := range resp.Data[id].Quotes { if v.Quote.USD.Timestamp.Unix() == unixEnd { price = v.Quote.USD.Price } } if price.Float.Cmp(big.NewFloat(0)) <= 0 { return nil, errors.New("not found price") } return &price.Float, nil } type QuotesLatestDataCoin struct { ID uint `json:"id"` Name string `json:"name"` Symbol string `json:"symbol"` Quote *struct { USD *struct { Price numeric.BigFloat `json:"price"` MarketCap numeric.BigFloat `json:"market_cap"` Volume24h numeric.BigFloat `json:"volume_24h"` } `json:"USD"` } `json:"quote"` } type QuotesLatestData struct { Data map[string]*QuotesLatestDataCoin `json:"data"` } func (m *CoinMarketCap) GetQuotesLatest(arrayIDs []string) (map[string]*QuotesLatestDataCoin, error) { // urlQueries := url.Values{} // urlQueries.Set("id", strings.Join(arrayIDs, ",")) path := fmt.Sprintf("v2/cryptocurrency/quotes/latest?id=%s", strings.Join(arrayIDs, ",")) fullUrl := m.generateUrl(path) data, _, err := m.request(fullUrl, "GET", nil, nil) if err != nil { return nil, err } fmt.Println(string(data)) resp := &QuotesLatestData{} err = json.Unmarshal(data, resp) if err != nil { return nil, err } return resp.Data, nil } type MapDataCoin struct { ID uint `json:"id"` Name string `json:"name"` Symbol string `json:"symbol"` Slug string `json:"slug"` } type MapData struct { Data []*MapDataCoin `json:"data"` } func (m *CoinMarketCap) GetCryptocurrencyMap() (map[string]*MapDataCoin, error) { path := "v1/cryptocurrency/map?sort=cmc_rank" fullUrl := m.generateUrl(path) data, _, err := m.request(fullUrl, "GET", nil, nil) if err != nil { return nil, err } fmt.Println(fullUrl) resp := &MapData{} err = json.Unmarshal(data, resp) if err != nil { return nil, err } coinMap := map[string]*MapDataCoin{} for _, v := range resp.Data { coinMap[fmt.Sprintf("%d", v.ID)] = v } return coinMap, nil } type DexPairsResp struct { PlatformId uint `json:"platformId"` PlatformName string `json:"platformName"` BaseTokenSymbol string `json:"baseTokenSymbol"` QuoteTokenSymbol string `json:"quoteTokenSymbol"` Liquidity string `json:"liquidity"` PairContractAddress string `json:"pairContractAddress"` PlatFormCryptoId string `json:"platFormCryptoId"` ExchangeId uint `json:"exchangeId"` PoolId uint `json:"poolId"` BaseTokenName string `json:"baseTokenName"` MarketCap string `json:"marketCap"` PriceUsd string `json:"priceUsd"` PriceChange24h string `json:"priceChange24h"` BaseToken *struct { Name string `json:"name"` Address string `json:"address"` Symbol string `json:"symbol"` Decimals uint `json:"decimals"` } `json:"baseToken"` QuoteToken *struct { Name string `json:"name"` Address string `json:"address"` Symbol string `json:"symbol"` Decimals uint `json:"decimals"` } `json:"quoteToken"` Volume24h string `json:"volume24h"` VolumeQuote24h string `json:"volumeQuote24h"` } type DexSearchResp struct { Data *struct { Total uint `json:"total"` Pairs []*DexPairsResp `json:"pairs"` } `json:"data"` } func (m *CoinMarketCap) DexSearch(keyword string) ([]*DexPairsResp, error) { fullUrl := fmt.Sprintf(`https://api.coinmarketcap.com/dexer/v3/dexer/search/main-site?keyword=%s&all=false`, keyword) data, _, err := m.request(fullUrl, "GET", nil, nil) if err != nil { return nil, err } fmt.Println(fullUrl) resp := &DexSearchResp{} err = json.Unmarshal(data, resp) if err != nil { return nil, err } return resp.Data.Pairs, nil } type DexSpotPairsLatestDetail struct { ScrollId string `json:"scroll_id"` ContractAddress string `json:"contract_address"` Name string `json:"name"` BaseAssetId string `json:"base_asset_id"` BaseAssetUcid string `json:"base_asset_ucid"` BaseAssetName string `json:"base_asset_name"` BaseAssetSymbol string `json:"base_asset_symbol"` BaseAssetContractAddress string `json:"base_asset_contract_address"` QuoteAssetId string `json:"quote_asset_id"` QuoteAssetUcid string `json:"quote_asset_ucid"` QuoteAssetName string `json:"quote_asset_name"` QuoteAssetSymbol string `json:"quote_asset_symbol"` QuoteAssetContractAddress string `json:"quote_asset_contract_address"` DexId string `json:"dex_id"` DexSlug string `json:"dex_slug"` NetworkId string `json:"network_id"` NetworkSlug string `json:"network_slug"` LastUpdated string `json:"last_updated"` CreatedAt string `json:"created_at"` Quote []*struct { ConvertId string `json:"convert_id"` Price float64 `json:"price"` PriceByQuoteAsset float64 `json:"price_by_quote_asset"` LastUpdated string `json:"last_updated"` Volume24h float64 `json:"volume_24h"` PercentChangePrice1h float64 `json:"percent_change_price_1h"` PercentChangePrice24h float64 `json:"percent_change_price_24h"` Liquidity float64 `json:"liquidity"` FullyDilutedValue float64 `json:"fully_diluted_value"` } `json:"quote"` } type DexSpotPairsLatestResp struct { Data *[]*DexSpotPairsLatestDetail `json:"data"` } func (m *CoinMarketCap) DexSpotPairsLatest(quoteAssetSymbol, networkSlug string) (*DexSpotPairsLatestResp, error) { fullUrl := fmt.Sprintf(`https://pro-api.coinmarketcap.com/v4/dex/spot-pairs/latest?network_slug=%s"e_asset_symbol=%s`, networkSlug, quoteAssetSymbol) data, _, err := m.request(fullUrl, "GET", nil, nil) if err != nil { return nil, err } fmt.Println(fullUrl) resp := &DexSpotPairsLatestResp{} err = json.Unmarshal(data, resp) if err != nil { return nil, err } return resp, nil } type DexPairsTradeLatestDetail struct { ScrollId string `json:"scroll_id"` ContractAddress string `json:"contract_address"` Name string `json:"name"` BaseAssetId string `json:"base_asset_id"` BaseAssetUcid string `json:"base_asset_ucid"` BaseAssetName string `json:"base_asset_name"` BaseAssetSymbol string `json:"base_asset_symbol"` BaseAssetContractAddress string `json:"base_asset_contract_address"` QuoteAssetId string `json:"quote_asset_id"` QuoteAssetUcid string `json:"quote_asset_ucid"` QuoteAssetName string `json:"quote_asset_name"` QuoteAssetSymbol string `json:"quote_asset_symbol"` QuoteAssetContractAddress string `json:"quote_asset_contract_address"` DexId string `json:"dex_id"` DexSlug string `json:"dex_slug"` NetworkId string `json:"network_id"` NetworkSlug string `json:"network_slug"` LastUpdated string `json:"last_updated"` CreatedAt string `json:"created_at"` Trades []*struct { Date string `json:"date"` TradeType string `json:"type"` Quote []*struct { Price float64 `json:"price"` Total float64 `json:"total"` ConvertId string `json:"convert_id"` PriceByQuoteAsset float64 `json:"price_by_quote_asset"` AmountBaseAsset float64 `json:"amount_base_asset"` AmountQuoteAsset float64 `json:"amount_quote_asset"` } `json:"quote"` } `json:"trades"` } type DexPairsTradeLatestResp struct { Data *[]*DexPairsTradeLatestDetail `json:"data"` } func (m *CoinMarketCap) DexPairsTradeLatest(contractAddress, networkSlug string) (*DexPairsTradeLatestResp, error) { fullUrl := fmt.Sprintf(`https://pro-api.coinmarketcap.com/v4/dex/pairs/trade/latest?contract_address=%s&network_slug=%s`, contractAddress, networkSlug) data, _, err := m.request(fullUrl, "GET", nil, nil) if err != nil { return nil, err } fmt.Println(fullUrl) resp := &DexPairsTradeLatestResp{} err = json.Unmarshal(data, resp) if err != nil { return nil, err } return resp, nil } func main() { client := NewCoinMarketCap("") // data, err := client.GetHistoricalPrice("1", time.Now().Truncate(1*time.Hour).Unix()-5*3600) // fmt.Println(data, err) data1, _ := client.GetQuotesLatest([]string{"1"}) for _, v := range data1 { price, _ := v.Quote.USD.Price.Float64() fmt.Println(v.Symbol, price) } } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/core/client.go ================================================ package core import ( "bytes" "encoding/json" "fmt" "io" "net/http" "strings" ) type Client struct { BaseURL string } func (c *Client) buildUrl(resourcePath string) string { if resourcePath != "" { return c.BaseURL + "/" + resourcePath } return c.BaseURL } func (c *Client) doWithoutAuth(req *http.Request) (*http.Response, error) { client := &http.Client{} return client.Do(req) } func (c *Client) methodJSON(method string, apiURL string, jsonObject interface{}, result interface{}) error { var buffer io.Reader if jsonObject != nil { bodyBytes, _ := json.Marshal(jsonObject) buffer = bytes.NewBuffer(bodyBytes) } req, err := http.NewRequest(method, apiURL, buffer) if err != nil { return err } req.Header.Add("Content-Type", "application/json") resp, err := c.doWithoutAuth(req) if err != nil { return err } if resp.StatusCode >= 300 { bodyBytes, err := io.ReadAll(resp.Body) if err != nil { return fmt.Errorf("http response bad status %d %s", resp.StatusCode, err.Error()) } return fmt.Errorf("http response bad status %d %s", resp.StatusCode, string(bodyBytes)) } if result != nil { return json.NewDecoder(resp.Body).Decode(result) } return nil } func (c *Client) StoreAddress(addr string, prk string, walletType int, walletId string) (string, string, error) { resp := struct { Result struct { Address string SecretVersion string } }{} err := c.methodJSON( http.MethodPost, c.buildUrl("wallet/update"), map[string]interface{}{ "WalletId": walletId, "WalletType": walletType, "Address": addr, "PrivateKey": prk, }, &resp, ) if err != nil { return "", "", err } return resp.Result.Address, resp.Result.SecretVersion, nil } func (c *Client) GetAddressPrk(addr string) (string, error) { resp := struct { Result string }{} err := c.methodJSON( http.MethodPost, c.buildUrl("wallet/get-private-key"), map[string]interface{}{ "Address": addr, }, &resp, ) if err != nil { return "", err } resp.Result = strings.TrimPrefix(resp.Result, "0x") return resp.Result, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/deep_research/deep_research.go ================================================ package deepresearch import ( "bytes" "encoding/json" "fmt" "io" "net/http" ) type Client struct { BaseURL string } func (c *Client) buildUrl(resourcePath string) string { if resourcePath != "" { return c.BaseURL + "/" + resourcePath } return c.BaseURL } func (c *Client) doWithoutAuth(req *http.Request) (*http.Response, error) { client := &http.Client{} return client.Do(req) } func (c *Client) methodJSON(method string, apiURL string, jsonObject interface{}, result interface{}) error { var buffer io.Reader if jsonObject != nil { bodyBytes, _ := json.Marshal(jsonObject) buffer = bytes.NewBuffer(bodyBytes) } req, err := http.NewRequest(method, apiURL, buffer) if err != nil { return err } req.Header.Add("Content-Type", "application/json") resp, err := c.doWithoutAuth(req) if err != nil { return err } if resp.StatusCode >= 300 { bodyBytes, err := io.ReadAll(resp.Body) if err != nil { return fmt.Errorf("http response bad status %d %s", resp.StatusCode, err.Error()) } return fmt.Errorf("http response bad status %d %s", resp.StatusCode, string(bodyBytes)) } if result != nil { return json.NewDecoder(resp.Body).Decode(result) } return nil } func (c *Client) DoTaskResearch(query, reqID string) (string, error) { resp := struct { Result string `json:"result"` }{} err := c.methodJSON( http.MethodPost, c.buildUrl("research"), map[string]interface{}{ "query": query, "req_id": reqID, }, &resp, ) if err != nil { return "", err } return resp.Result, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/delegate_cash/delegate_cash.go ================================================ package delegate_cash import ( "fmt" "io" "net/http" "github.com/pkg/errors" ) type DelegateCashAPIService struct { Url string APIKey string } func NewDelegateCashAPIService(Url, APIKey string) *DelegateCashAPIService { return &DelegateCashAPIService{ //Url: "https://api.delegate.xyz", //APIKey: "eternala-bf8c-46ed-ba49-dfaf776d1e3f", Url: Url, APIKey: APIKey, } } // V1 func (s *DelegateCashAPIService) CheckDelegateForWalletV1(delegateAddr string, vaultAddr string) (bool, error) { url := fmt.Sprintf(s.Url+"/registry/v1/check/all?delegate=%s&vault=%s&contract=%s", delegateAddr, vaultAddr) req, err := http.NewRequest("GET", url, nil) if err != nil { return false, errors.WithStack(err) } req.Header.Set("X-API-KEY", s.APIKey) //req.Header.Set("content-type", "application/json") req.Header.Set("accept", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { return false, errors.WithStack(err) } body, err := io.ReadAll(resp.Body) if err != nil { return false, errors.WithStack(err) } if string(body) == "true" { return true, nil } return false, nil } func (s *DelegateCashAPIService) CheckDelegateForContractV1(delegateAddr string, vaultAddr string, contractAddr string) (bool, error) { checkWallet, _ := s.CheckDelegateForWalletV1(delegateAddr, vaultAddr) if checkWallet { return true, nil } url := fmt.Sprintf(s.Url+"/registry/v1/check/contract?delegate=%s&vault=%s&contract=%s", delegateAddr, vaultAddr, contractAddr) req, err := http.NewRequest("GET", url, nil) if err != nil { return false, errors.WithStack(err) } req.Header.Set("X-API-KEY", s.APIKey) //req.Header.Set("content-type", "application/json") req.Header.Set("accept", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { return false, errors.WithStack(err) } body, err := io.ReadAll(resp.Body) if err != nil { return false, errors.WithStack(err) } if string(body) == "true" { return true, nil } return false, nil } func (s *DelegateCashAPIService) CheckDelegateForTokenERC721V1(delegateAddr string, vaultAddr string, contractAddr string, tokenId string, chainID int) (bool, error) { checkContract, err := s.CheckDelegateForContractV1(delegateAddr, vaultAddr, contractAddr) if checkContract { return true, nil } //ref: https://docs.delegate.xyz/technical-documentation/rest-api/v1#returns-true-if-the-address-is-delegated-to-act-on-your-behalf-for-a-specific-token-the-tokens-contr url := fmt.Sprintf(s.Url+"/registry/v1/check/token?delegate=%s&vault=%s&contract=%s&tokenId=%s&chainId=%d", delegateAddr, vaultAddr, contractAddr, tokenId, chainID) req, err := http.NewRequest("GET", url, nil) if err != nil { return false, errors.WithStack(err) } req.Header.Set("X-API-KEY", s.APIKey) //req.Header.Set("content-type", "application/json") req.Header.Set("accept", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { return false, errors.WithStack(err) } body, err := io.ReadAll(resp.Body) if err != nil { return false, errors.WithStack(err) } if string(body) == "true" { return true, nil } return false, nil } // V2 func (s *DelegateCashAPIService) CheckDelegateForWalletV2(delegateAddr string, vaultAddr string) (bool, error) { url := fmt.Sprintf(s.Url+"/registry/v2/check/all?to=%s&from=%s&contract=%s", delegateAddr, vaultAddr) req, err := http.NewRequest("GET", url, nil) if err != nil { return false, errors.WithStack(err) } req.Header.Set("X-API-KEY", s.APIKey) //req.Header.Set("content-type", "application/json") req.Header.Set("accept", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { return false, errors.WithStack(err) } body, err := io.ReadAll(resp.Body) if err != nil { return false, errors.WithStack(err) } if string(body) == "true" { return true, nil } return false, nil } func (s *DelegateCashAPIService) CheckDelegateForContractV2(delegateAddr string, vaultAddr string, contractAddr string) (bool, error) { checkWallet, _ := s.CheckDelegateForWalletV2(delegateAddr, vaultAddr) if checkWallet { return true, nil } url := fmt.Sprintf(s.Url+"/registry/v2/check/contract?to=%s&from=%s&contract=%s", delegateAddr, vaultAddr, contractAddr) req, err := http.NewRequest("GET", url, nil) if err != nil { return false, errors.WithStack(err) } req.Header.Set("X-API-KEY", s.APIKey) //req.Header.Set("content-type", "application/json") req.Header.Set("accept", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { return false, errors.WithStack(err) } body, err := io.ReadAll(resp.Body) if err != nil { return false, errors.WithStack(err) } if string(body) == "true" { return true, nil } return false, nil } func (s *DelegateCashAPIService) CheckDelegateForTokenERC721V2(delegateAddr string, vaultAddr string, contractAddr string, tokenId string, chainID int) (bool, error) { checkContract, _ := s.CheckDelegateForContractV2(delegateAddr, vaultAddr, contractAddr) if checkContract { return true, nil } //ref: https://docs.delegate.xyz/technical-documentation/rest-api/v2#returns-true-if-delegate-is-granted-to-act-on-froms-behalf-for-entire-wallet-that-contract-or-that-s url := fmt.Sprintf(s.Url+"/registry/v2/check/erc721?to=%s&from=%s&contract=%s&tokenId=%s&chainId=%d", delegateAddr, vaultAddr, contractAddr, tokenId, chainID) req, err := http.NewRequest("GET", url, nil) if err != nil { return false, errors.WithStack(err) } req.Header.Set("X-API-KEY", s.APIKey) //req.Header.Set("content-type", "application/json") req.Header.Set("accept", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { return false, errors.WithStack(err) } body, err := io.ReadAll(resp.Body) if err != nil { return false, errors.WithStack(err) } if string(body) == "true" { return true, nil } return false, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/dexscreener/dexscreener.go ================================================ package dexscreener import ( "encoding/json" "fmt" "io" "net/http" ) type DexScreenerAPI struct { BaseURL string } func NewDexScreenerAPI() *DexScreenerAPI { return &DexScreenerAPI{ BaseURL: "https://api.dexscreener.com", } } func (m DexScreenerAPI) request(fullUrl string, method string, headers map[string]string, reqBody io.Reader) ([]byte, int, error) { req, err := http.NewRequest(method, fullUrl, reqBody) if err != nil { return nil, 0, err } if len(headers) > 0 { for key, val := range headers { req.Header.Add(key, val) } } req.Header.Add("accept", "application/json") req.Header.Add("content-type", "application/json") res, err := http.DefaultClient.Do(req) if err != nil { return nil, 0, err } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { return nil, res.StatusCode, err } return body, res.StatusCode, nil } type PairsDetailResp struct { NetworkID uint64 `json:"network_id"` ChainId string `json:"chainId"` Description string `json:"description"` DexId string `json:"dexId"` Url string `json:"url"` PairAddress string `json:"pairAddress"` PriceNative string `json:"priceNative"` PriceUsd string `json:"priceUsd"` Volume *struct { H24 float64 `json:"h24"` H6 float64 `json:"h6"` H1 float64 `json:"h1"` M5 float64 `json:"m5"` } `json:"volume"` PriceChange *struct { H24 float64 `json:"h24"` H6 float64 `json:"h6"` H1 float64 `json:"h1"` M5 float64 `json:"m5"` } `json:"priceChange"` Liquidity *struct { Usd float64 `json:"usd"` } `json:"liquidity"` QuoteToken *struct { Symbol string `json:"symbol"` Name string `json:"name"` Address string `json:"address"` } `json:"quoteToken"` BaseToken *struct { Symbol string `json:"symbol"` Name string `json:"name"` Address string `json:"address"` } `json:"baseToken"` Fdv uint64 `json:"fdv"` MarketCap uint64 `json:"marketCap"` Info *struct { ImageUrl string `json:"imageUrl"` Header string `json:"header"` OpenGraph string `json:"openGraph"` Websites []struct { Label string `json:"label"` Url string `json:"url"` } `json:"websites"` Socials []struct { Type string `json:"type"` Url string `json:"url"` } `json:"socials"` } `json:"info"` } type PairsResp struct { Pairs []*PairsDetailResp `json:"pairs"` } func (m DexScreenerAPI) SearchPairs(tokenContractAddress string) (*PairsDetailResp, error) { fullUrl := fmt.Sprintf(`%s/latest/dex/tokens/%s`, m.BaseURL, tokenContractAddress) data, _, err := m.request(fullUrl, "GET", nil, nil) if err != nil { return nil, err } fmt.Println(fullUrl) resp := &PairsResp{} err = json.Unmarshal(data, resp) if err != nil { return nil, err } pair := &PairsDetailResp{} if len(resp.Pairs) > 0 { liquidity := resp.Pairs[0].Liquidity.Usd pair = resp.Pairs[0] for _, item := range resp.Pairs { if item.Liquidity != nil && item.Liquidity.Usd > liquidity { liquidity = item.Liquidity.Usd pair = item } } } return pair, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/dexscreener/dexscreener_wss.go ================================================ package dexscreener import ( "bytes" "context" "encoding/binary" "fmt" "log" "net/http" "net/url" "strings" "time" "github.com/gorilla/websocket" ) const ( baseURI = "wss://io.dexscreener.com/dex/screener/v5/pairs/h24/1" ) type DexScreenerClient struct { conn *websocket.Conn debug bool done chan struct{} handlers []func(Pair) } type Pair struct { Chain string `json:"chain"` Protocol string `json:"protocol"` PairAddress string `json:"pairAddress"` BaseTokenName string `json:"baseTokenName"` BaseTokenSymbol string `json:"baseTokenSymbol"` BaseTokenAddress string `json:"baseTokenAddress"` Price string `json:"price"` PriceUsd string `json:"priceUsd"` PriceChange PriceChange `json:"priceChange"` Liquidity Liquidity `json:"liquidity"` Volume Volume `json:"volume"` Fdv string `json:"fdv"` PairCreatedAt int64 `json:"pairCreatedAt"` PairCreatedAtFormatted string `json:"pairCreatedAtFormatted"` } type PriceChange struct { H24 string `json:"h24"` } type Liquidity struct { Usd string `json:"usd"` } type Volume struct { H24 string `json:"h24"` } func NewDexScreenerClient(debug bool) *DexScreenerClient { return &DexScreenerClient{ debug: debug, done: make(chan struct{}), handlers: make([]func(Pair), 0), } } func (c *DexScreenerClient) OnPair(handler func(Pair)) { c.handlers = append(c.handlers, handler) } func (c *DexScreenerClient) handleDouble(value float64) float64 { if value != value || value == 0 { return 0 } return value } func (c *DexScreenerClient) decodeMetrics(data []byte, startPos int) (map[string]float64, int) { if startPos+64 > len(data) { return nil, startPos } metrics := make(map[string]float64) values := make([]float64, 8) reader := bytes.NewReader(data[startPos : startPos+64]) binary.Read(reader, binary.LittleEndian, &values) valueMap := map[string]float64{ "price": values[0], "priceUsd": values[1], "priceChangeH24": values[2], "liquidityUsd": values[3], "volumeH24": values[4], "fdv": values[5], "timestamp": values[6], } for key, value := range valueMap { if cleaned := c.handleDouble(value); cleaned != 0 { metrics[key] = cleaned } } return metrics, startPos + 64 } func (c *DexScreenerClient) cleanString(s string) string { if s == "" { return "" } // Remove non-printable characters except spaces var cleaned strings.Builder for _, char := range s { if (char >= 32 && char < 127) || char == 9 { cleaned.WriteRune(char) } } result := cleaned.String() if strings.Contains(result, "@") || strings.Contains(result, "\\") { parts := strings.Split(result, "@") if len(parts) > 0 { result = parts[0] } parts = strings.Split(result, "\\") if len(parts) > 0 { result = parts[0] } } return strings.TrimSpace(result) } func (c *DexScreenerClient) decodePair(data []byte) *Pair { pos := 0 pair := &Pair{} // Skip binary prefix for pos < len(data) && (data[pos] == 0x00 || data[pos] == 0x0A) { pos++ } fields := []string{"chain", "protocol", "pairAddress", "baseTokenName", "baseTokenSymbol", "baseTokenAddress"} for _, field := range fields { if pos >= len(data) { break } strLen := int(data[pos]) pos++ if strLen == 0 || strLen > 100 || pos+strLen > len(data) { continue } value := c.cleanString(string(data[pos : pos+strLen])) if value != "" { switch field { case "chain": pair.Chain = value case "protocol": pair.Protocol = value case "pairAddress": pair.PairAddress = value case "baseTokenName": pair.BaseTokenName = value case "baseTokenSymbol": pair.BaseTokenSymbol = value case "baseTokenAddress": pair.BaseTokenAddress = value } } pos += strLen } // Align to 8-byte boundary pos = (pos + 7) &^ 7 metrics, pos := c.decodeMetrics(data, pos) if len(metrics) > 0 { if price, ok := metrics["price"]; ok { pair.Price = fmt.Sprintf("%f", price) } if priceUsd, ok := metrics["priceUsd"]; ok { pair.PriceUsd = fmt.Sprintf("%f", priceUsd) } if priceChange, ok := metrics["priceChangeH24"]; ok { pair.PriceChange = PriceChange{H24: fmt.Sprintf("%f", priceChange)} } if liquidity, ok := metrics["liquidityUsd"]; ok { pair.Liquidity = Liquidity{Usd: fmt.Sprintf("%f", liquidity)} } if volume, ok := metrics["volumeH24"]; ok { pair.Volume = Volume{H24: fmt.Sprintf("%f", volume)} } if fdv, ok := metrics["fdv"]; ok { pair.Fdv = fmt.Sprintf("%f", fdv) } if timestamp, ok := metrics["timestamp"]; ok && timestamp >= 0 && timestamp < 4102444800 { pair.PairCreatedAt = int64(timestamp) pair.PairCreatedAtFormatted = time.Unix(int64(timestamp), 0).Format("2006-01-02 15:04:05") } } // Validate minimum required data if len(pair.Chain) > 0 && len(pair.Protocol) > 0 && (pair.Price != "0" || pair.PriceUsd != "0" || pair.Volume.H24 != "0" || pair.Liquidity.Usd != "0") { return pair } return nil } func (c *DexScreenerClient) Connect(ctx context.Context, trendingScore string) error { params := url.Values{} params.Add("rankBy[key]", trendingScore) params.Add("rankBy[order]", "desc") params.Add("filters[chainIds][0]", "solana") uri := fmt.Sprintf("%s?%s", baseURI, params.Encode()) headers := http.Header{ "User-Agent": []string{"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:132.0) Gecko/20100101 Firefox/132.0"}, "Accept": []string{"*/*"}, "Accept-Language": []string{"en-US,en;q=0.5"}, "Origin": []string{"https://dexscreener.com"}, "Pragma": []string{"no-cache"}, "Cache-Control": []string{"no-cache"}, } dialer := websocket.Dialer{ HandshakeTimeout: 45 * time.Second, } conn, _, err := dialer.Dial(uri, headers) if err != nil { return fmt.Errorf("failed to connect: %v", err) } c.conn = conn go c.readLoop(ctx) return nil } func (c *DexScreenerClient) readLoop(ctx context.Context) { defer c.conn.Close() for { select { case <-ctx.Done(): return case <-c.done: return default: _, message, err := c.conn.ReadMessage() fmt.Printf("message: %s\n", string(message)) if err != nil { if c.debug { log.Printf("Error reading message: %v", err) } continue } if string(message) == "ping" { c.conn.WriteMessage(websocket.TextMessage, []byte("pong")) continue } if bytes.HasPrefix(message, []byte{0x00, 0x0A, '1', '.', '3', '.', '0', 0x0A}) { pairsStart := bytes.Index(message, []byte("pairs")) if pairsStart == -1 { continue } pairs := make([]Pair, 0) pos := pairsStart + 5 for pos < len(message) { pair := c.decodePair(message[pos:]) if pair != nil { pairs = append(pairs, *pair) } pos += 512 } if len(pairs) > 0 { for _, pair := range pairs { for _, handler := range c.handlers { handler(pair) } } } } } } } func (c *DexScreenerClient) Close() { close(c.done) if c.conn != nil { c.conn.Close() } } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/eth/client.go ================================================ package eth import ( "context" "crypto/ecdsa" "encoding/hex" "encoding/json" "errors" "fmt" "io" "math/big" "net/http" "strconv" "strings" "time" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/configs" "github.com/ethereum/go-ethereum" "github.com/cosmos/cosmos-sdk/crypto/hd" "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/ethclient" ) const baseFeeWiggleMultiplier = 2 func NewEthClient(rpc string) (*ethclient.Client, error) { client, err := ethclient.Dial(rpc) if err != nil { return nil, err } return client, nil } func NewEthWsClient(ws string) (*ethclient.Client, error) { client, err := ethclient.Dial(ws) if err != nil { return nil, err } return client, nil } func WaitForTx(client *ethclient.Client, tx common.Hash) error { i := 0 for { time.Sleep(2 * time.Second) if i > 30 { return errors.New("timeout") } i++ _, isPending, err := client.TransactionByHash(context.Background(), tx) if err != nil { continue } if !isPending { time.Sleep(2 * time.Second) break } } return nil } func WaitForTxRetry(client *ethclient.Client, tx common.Hash, sleep int, retry int) error { i := 0 for { time.Sleep(time.Duration(sleep) * time.Second) if i > retry { return errors.New("timeout") } i++ _, isPending, err := client.TransactionByHash(context.Background(), tx) if err != nil { continue } if !isPending { time.Sleep(time.Duration(sleep) * time.Second) break } } return nil } func WaitForTxReceipt(client *ethclient.Client, tx common.Hash) (*types.Receipt, error) { i := 0 for { time.Sleep(2 * time.Second) if i > 20 { return nil, errors.New("timeout") } i++ txReceipt, err := client.TransactionReceipt(context.Background(), tx) if err != nil { continue } if txReceipt != nil { time.Sleep(2 * time.Second) return txReceipt, nil } } } func WaitForTxReceiptRetry(client *ethclient.Client, tx common.Hash, sleep int, retry int) (*types.Receipt, error) { i := 0 for { time.Sleep(time.Duration(sleep) * time.Second) if i > retry { return nil, errors.New("timeout") } i++ txReceipt, err := client.TransactionReceipt(context.Background(), tx) if err != nil { continue } if txReceipt != nil { time.Sleep(time.Duration(sleep) * time.Second) return txReceipt, nil } } } func GetAccountInfo(privKey string) (*ecdsa.PrivateKey, *common.Address, error) { privateKey, err := crypto.HexToECDSA(privKey) if err != nil { return nil, nil, err } publicKey := privateKey.Public() publicKeyECDSA, _ := publicKey.(*ecdsa.PublicKey) publicKeyAddress := crypto.PubkeyToAddress(*publicKeyECDSA) return privateKey, &publicKeyAddress, nil } func GenerateKeyFromSeedOld(seed string) (string, string, string, error) { seedHex := hex.EncodeToString([]byte(seed)) master, ch := hd.ComputeMastersFromSeed([]byte(seedHex)) path := "m/44'/1022'/0'/0/0'" priv, err := hd.DerivePrivateKeyForPath(master, ch, path) if err != nil { return "", "", "", err } var privateKey = secp256k1.GenPrivKeyFromSecret(priv) publicKey := privateKey.PubKey() privKey := hex.EncodeToString(priv) pubKey := hex.EncodeToString(publicKey.Bytes()) address := "0x" + hex.EncodeToString(publicKey.Address().Bytes()) return privKey, pubKey, address, nil } func GenerateKeyFromSeedNew(seed string) (string, string, string, error) { seedHex := hex.EncodeToString([]byte(seed)) master, ch := hd.ComputeMastersFromSeed([]byte(seedHex)) path := "m/44'/1022'/0'/0/0'" priv, err := hd.DerivePrivateKeyForPath(master, ch, path) if err != nil { return "", "", "", err } privateKey, err := crypto.ToECDSA(priv) if err != nil { return "", "", "", err } publicKey := privateKey.Public() publicKeyECDSA, _ := publicKey.(*ecdsa.PublicKey) promptFeeAddress := crypto.PubkeyToAddress(*publicKeyECDSA) privKey := hex.EncodeToString(priv) publicKeyBytes := crypto.FromECDSAPub(publicKeyECDSA) pubKey := hex.EncodeToString(publicKeyBytes) return privKey, pubKey, strings.ToLower(promptFeeAddress.String()), nil } func GenerateAddress() (privKey, pubKey, address string, err error) { privateKey, err := crypto.GenerateKey() if err != nil { return } privateKeyBytes := crypto.FromECDSA(privateKey) privKey = hexutil.Encode(privateKeyBytes)[2:] publicKey := privateKey.Public() publicKeyECDSA, ok := publicKey.(*ecdsa.PublicKey) if !ok { err = errors.New("failed to cast public key to ECDSA") return } publicKeyBytes := crypto.FromECDSAPub(publicKeyECDSA) pubKey = hexutil.Encode(publicKeyBytes)[4:] address = crypto.PubkeyToAddress(*publicKeyECDSA).Hex() return } func GenerateAddressFromPrivKey(privKey string) (pubKey, address string, err error) { privateKey, err := crypto.HexToECDSA(privKey) if err != nil { return } publicKey := privateKey.Public() publicKeyECDSA, ok := publicKey.(*ecdsa.PublicKey) if !ok { err = errors.New("failed to cast public key to ECDSA") return } publicKeyBytes := crypto.FromECDSAPub(publicKeyECDSA) pubKey = hexutil.Encode(publicKeyBytes)[4:] address = crypto.PubkeyToAddress(*publicKeyECDSA).Hex() return } type Client struct { eth *ethclient.Client } func NewClient(eth *ethclient.Client) *Client { return &Client{eth} } func (c *Client) PendingNonceAt(ctx context.Context, address common.Address) (uint64, error) { return c.eth.PendingNonceAt(ctx, address) } func (c *Client) SuggestGasPrice(ctx context.Context) (*big.Int, error) { return c.eth.SuggestGasPrice(ctx) } func (c *Client) NetworkID(ctx context.Context) (*big.Int, error) { return c.eth.NetworkID(ctx) } func (c *Client) SendTransaction(ctx context.Context, tx *types.Transaction) error { return c.eth.SendTransaction(ctx, tx) } // transfer: func (c *Client) Transfer(senderPrivKey, receiverAddress string, amount, gasPrice *big.Int, gasLimit, nonce uint64) (string, error) { privateKey, err := crypto.HexToECDSA(senderPrivKey) if err != nil { return "", err } publicKey := privateKey.Public() publicKeyECDSA, _ := publicKey.(*ecdsa.PublicKey) fromAddress := crypto.PubkeyToAddress(*publicKeyECDSA) if nonce <= 0 { nonce, err = c.PendingNonceAt(context.Background(), fromAddress) if err != nil { return "", err } } if gasLimit == 0 { gasLimit = uint64(21000) } if gasPrice == nil { gasPrice, err = c.SuggestGasPrice(context.Background()) if err != nil { return "", err } } fee := new(big.Int) fee.Mul(big.NewInt(int64(gasLimit)), gasPrice) toAddress := common.HexToAddress(receiverAddress) tx := types.NewTransaction(nonce, toAddress, amount, gasLimit, gasPrice, nil) chainID, err := c.NetworkID(context.Background()) if err != nil { return "", err } signedTx, err := types.SignTx(tx, types.NewEIP155Signer(chainID), privateKey) if err != nil { return "", err } err = c.SendTransaction(context.Background(), signedTx) if err != nil { return "", err } return signedTx.Hash().Hex(), nil } /* Copy from the function `(c *BoundContract) transact` in the `eth` package. */ func CreateEthTransaction(client *ethclient.Client, from common.Address, to common.Address, value *big.Int, input []byte) (*types.Transaction, error) { chainID, err := client.NetworkID(context.Background()) if err != nil { return nil, fmt.Errorf("NetworkID :%v", err.Error()) } //current block head, err := client.HeaderByNumber(context.Background(), nil) if err != nil { return nil, fmt.Errorf("HeaderByNumber:%v , err:%v", chainID, err.Error()) } gasLimit, err := client.EstimateGas( context.Background(), ethereum.CallMsg{ From: from, To: &to, Value: value, Data: input, }, ) if err != nil { return nil, fmt.Errorf("err when estimate gas at chainID :%v ,from:%v ,to %v , value:%v, input:%v, err:%v", chainID, from, &to, value.String(), common.Bytes2Hex(input), err.Error()) } // Estimate GasLimit if chainID.String() != configs.SubtensorEVMChainID { if gasLimit < head.GasLimit/2 { gasLimit = gasLimit * 2 } } else { gasLimit = uint64(5000000) } nonce, err := client.PendingNonceAt(context.Background(), from) if err != nil { return nil, fmt.Errorf("err when PendingNonceAt:%v , err:%v", chainID, err.Error()) } var tx *types.Transaction if head.BaseFee != nil { // Estimate TipCap gasTipCap := big.NewInt(0) gasFeeCap := big.NewInt(10000000000) if chainID.String() != configs.SubtensorEVMChainID { gasTipCap, err = client.SuggestGasTipCap(context.Background()) if err != nil { return nil, fmt.Errorf("err when SuggestGasTipCap:%v , err:%v", chainID, err.Error()) } gasFeeCap = new(big.Int).Add( gasTipCap, new(big.Int).Mul(head.BaseFee, big.NewInt(baseFeeWiggleMultiplier)), ) } else { gasFeeCap, err = client.SuggestGasPrice(context.Background()) if err != nil { return nil, fmt.Errorf("err when SuggestGasPrice:%v , err:%v", chainID, err.Error()) } } tx = types.NewTx(&types.DynamicFeeTx{ To: &to, Nonce: uint64(nonce), GasFeeCap: gasFeeCap, GasTipCap: gasTipCap, Gas: gasLimit, Value: value, Data: input, }) } else { gasPrice := big.NewInt(10000000000) if chainID.String() != configs.SubtensorEVMChainID { gasPrice, err = client.SuggestGasPrice(context.Background()) if err != nil { return nil, fmt.Errorf("err when SuggestGasPrice:%v , err:%v", chainID, err.Error()) } } tx = types.NewTx(&types.LegacyTx{ To: &to, Nonce: uint64(nonce), GasPrice: gasPrice, Gas: gasLimit, Value: value, Data: input, }) } return tx, nil } func DecodeSignature(signature string) (r [32]byte, s [32]byte, v byte, err error) { if strings.HasPrefix(signature, "0x") { signature = signature[2:] } signatureBytes, err := hex.DecodeString(signature) if err != nil { return r, s, v, fmt.Errorf("err when DecodeSignature:%v , err:%v", signature, err.Error()) } if len(signatureBytes) != 65 { return r, s, v, fmt.Errorf("invalid signature length : %v", len(signatureBytes)) } copy(r[:], signatureBytes[:32]) copy(s[:], signatureBytes[32:64]) v = signatureBytes[64] return r, s, v, nil } func CheckValidRpc(rpc string) (bool, error) { client, err := ethclient.Dial(rpc) defer client.Close() if err != nil { return false, nil } _, err = client.ChainID(context.Background()) if err != nil { return false, err } return true, nil } func GetLastBlock(rpc string) (uint64, int64, error) { start := time.Now() response, err := http.DefaultClient.Post(rpc, "application/json", strings.NewReader("{\"jsonrpc\":\"2.0\",\"method\":\"eth_getBlockByNumber\",\"params\":[\"latest\",false],\"id\":1}")) if err != nil { return 0, 0, err } defer response.Body.Close() res, err := io.ReadAll(response.Body) if err != nil { return 0, 0, err } if response.StatusCode != 200 { return 0, 0, fmt.Errorf("response %v !200 ,body :%v", response.StatusCode, string(res)) } rpcResponse := configs.RPCResponse{} err = json.Unmarshal(res, &rpcResponse) if err != nil { return 0, 0, err } if rpcResponse.Result == nil { return 0, 0, fmt.Errorf("result not found in :%v", string(res)) } if rpcResponse.Result.Number == nil { return 0, 0, fmt.Errorf("block number not found in body :%v", string(res)) } if strings.HasPrefix(*rpcResponse.Result.Number, "0x") { *rpcResponse.Result.Number = (*rpcResponse.Result.Number)[2:] } blockNumber, err := strconv.ParseUint(*rpcResponse.Result.Number, 16, 64) if err != nil { return 0, 0, fmt.Errorf("block number can not parse in body :%v", string(res)) } return blockNumber, time.Since(start).Milliseconds(), nil } func GetCurrentL1BlockNumber(rpc string) (uint64, error) { response, err := http.DefaultClient.Post(rpc, "application/json", strings.NewReader("{\"jsonrpc\":\"2.0\",\"method\":\"eth_getBlockByNumber\",\"params\":[\"latest\",false],\"id\":1}")) if err != nil { return 0, err } defer response.Body.Close() res, err := io.ReadAll(response.Body) if err != nil { return 0, err } if response.StatusCode != 200 { return 0, fmt.Errorf("response %v !200 ,body :%v", response.StatusCode, string(res)) } rpcResponse := configs.RPCResponse{} err = json.Unmarshal(res, &rpcResponse) if err != nil { return 0, err } if rpcResponse.Result == nil { return 0, fmt.Errorf("result not found in :%v", string(res)) } if rpcResponse.Result.L1BlockNumber == nil { return 0, fmt.Errorf("block number not found in body :%v", string(res)) } if strings.HasPrefix(*rpcResponse.Result.L1BlockNumber, "0x") { *rpcResponse.Result.L1BlockNumber = (*rpcResponse.Result.L1BlockNumber)[2:] } blockNumber, err := strconv.ParseUint(*rpcResponse.Result.L1BlockNumber, 16, 64) if err != nil { return 0, fmt.Errorf("block number can not parse in body :%v", string(res)) } return blockNumber, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/ethapi/agenttoken.go ================================================ package ethapi import ( "errors" "math/big" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/helpers" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/binds/agenttoken" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" ) func (c *Client) DeployAGENTToken(prkHex string, name string, symbol string, amount *big.Int, recipient string) (string, string, error) { if recipient == "" || !common.IsHexAddress(recipient) { return "", "", errors.New("recipient is invalid") } _, prk, err := c.parsePrkAuth(prkHex) if err != nil { return "", "", err } chainID, err := c.GetChainID() if err != nil { return "", "", err } auth, err := bind.NewKeyedTransactorWithChainID(prk, big.NewInt(int64(chainID))) if err != nil { return "", "", err } client, err := c.getClient() if err != nil { return "", "", err } gasPrice, err := c.getGasPrice() if err != nil { return "", "", err } auth.GasPrice = gasPrice address, tx, _, err := agenttoken.DeployAGENTToken(auth, client, name, symbol, amount, helpers.HexToAddress(recipient)) if err != nil { return "", "", err } return address.Hex(), tx.Hash().Hex(), nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/ethapi/agentupgradeable.go ================================================ package ethapi import ( "context" "math/big" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/helpers" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/binds/agentfactory" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/binds/agentupgradeable" "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" ) // func (c *Client) DeployAgentUpgradeable(prkHex string) (string, string, error) { // _, prk, err := c.parsePrkAuth(prkHex) // if err != nil { // return "", "", err // } // chainID, err := c.GetChainID() // if err != nil { // return "", "", err // } // auth, err := bind.NewKeyedTransactorWithChainID(prk, big.NewInt(int64(chainID))) // if err != nil { // return "", "", err // } // client, err := c.getClient() // if err != nil { // return "", "", err // } // gasPrice, err := c.getGasPrice() // if err != nil { // return "", "", err // } // auth.GasPrice = gasPrice // address, tx, _, err := agentupgradeable.DeployAgentUpgradeable(auth, client) // if err != nil { // return "", "", err // } // return address.Hex(), tx.Hash().Hex(), nil // } func (c *Client) AgentUpgradeableCodeVersion(agentAddr string) (int, error) { client, err := c.getClient() if err != nil { return 0, err } instance, err := agentupgradeable.NewAgentUpgradeable(helpers.HexToAddress(agentAddr), client) if err != nil { return 0, err } version, err := instance.GetCurrentVersion(&bind.CallOpts{}) if err != nil { return 0, err } return int(version), nil } func (c *Client) AgentUpgradeableDepsAgents(agentAddr string, version int) ([]string, error) { client, err := c.getClient() if err != nil { return nil, err } instance, err := agentupgradeable.NewAgentUpgradeable(helpers.HexToAddress(agentAddr), client) if err != nil { return nil, err } deps, err := instance.GetDepsAgents(&bind.CallOpts{}, uint16(version)) if err != nil { return nil, err } depsStr := []string{} for _, dep := range deps { depsStr = append(depsStr, dep.Hex()) } return depsStr, nil } func (c *Client) AgentFactoryCreateAgent(contractAddr string, prkHex string, agentId [32]byte, agentName string, agentVersion string, codeLanguage string, pointers []agentupgradeable.IAgentCodePointer, depsAgents []common.Address, agentOwner common.Address) (string, error) { pbkHex, prk, err := c.parsePrkAuth(prkHex) if err != nil { return "", err } gasPrice, gasTipCap, err := c.GetCachedGasPriceAndTipCap() if err != nil { return "", err } client, err := c.getClient() if err != nil { return "", err } instanceABI, err := agentfactory.AgentFactoryMetaData.GetAbi() if err != nil { return "", err } dataBytes, err := instanceABI.Pack( "createAgent", agentId, agentName, agentVersion, codeLanguage, pointers, depsAgents, agentOwner, ) if err != nil { return "", err } contractAddress := helpers.HexToAddress(contractAddr) value := big.NewInt(0) gasNumber, err := client.EstimateGas(context.Background(), ethereum.CallMsg{ From: pbkHex, To: &contractAddress, Data: dataBytes, Value: value, }) if err != nil { return "", err } chainID, err := c.GetChainID() if err != nil { return "", err } nonceAt, err := c.PendingNonceAt(context.Background(), pbkHex) if err != nil { return "", err } rawTx := types.NewTx(&types.DynamicFeeTx{ ChainID: big.NewInt(int64(chainID)), Nonce: nonceAt, GasFeeCap: gasPrice, GasTipCap: gasTipCap, Gas: (gasNumber * 2), To: &contractAddress, Value: value, Data: dataBytes, }) signedTx, err := types.SignTx(rawTx, types.NewLondonSigner(big.NewInt(int64(chainID))), prk) if err != nil { return "", err } err = client.SendTransaction(context.Background(), signedTx) if err != nil { return "", err } _, err = c.InscribeTxs([]string{signedTx.Hash().Hex()}) if err != nil { return "", err } return signedTx.Hash().Hex(), nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/ethapi/apechain_swapv3.go ================================================ package ethapi import ( "context" "math/big" "strings" "time" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/helpers" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/binds/apechainnonfungiblepositionmanager" "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" ) func (c *Client) ApechainNonfungiblePositionManagerMint(contractAddr string, privateHex string, weth9 common.Address, sqrtPriceX96 *big.Int, params *apechainnonfungiblepositionmanager.INonfungiblePositionManagerMintParams) (string, error) { addressHex, prk, err := c.parsePrkAuth(privateHex) if err != nil { return "", err } gasPrice, gasTipCap, err := c.GetCachedGasPriceAndTipCap() if err != nil { return "", err } client, err := c.getClient() if err != nil { return "", err } value := big.NewInt(0) if !strings.EqualFold(weth9.Hex(), params.Token0.Hex()) { if params.Amount0Desired.Cmp(big.NewInt(0)) > 0 { allowance, err := c.Erc20Allowance(params.Token0.Hex(), addressHex.Hex(), contractAddr) if err != nil { return "", err } if allowance.Cmp(big.NewInt(0)) <= 0 { approveHash, err := c.Erc20ApproveMax( params.Token0.Hex(), privateHex, contractAddr, ) if err != nil { return "", err } time.Sleep(10 * time.Second) err = c.WaitMined(approveHash) if err != nil { return "", err } } } } else { value = params.Amount0Desired } if !strings.EqualFold(weth9.Hex(), params.Token1.Hex()) { if params.Amount1Desired.Cmp(big.NewInt(0)) > 0 { allowance, err := c.Erc20Allowance(params.Token1.Hex(), addressHex.Hex(), contractAddr) if err != nil { return "", err } if allowance.Cmp(big.NewInt(0)) <= 0 { approveHash, err := c.Erc20ApproveMax( params.Token1.Hex(), privateHex, contractAddr, ) if err != nil { return "", err } time.Sleep(10 * time.Second) err = c.WaitMined(approveHash) if err != nil { return "", err } } } } else { value = params.Amount1Desired } contractAddress := helpers.HexToAddress(contractAddr) // EstimateGas instanceABI, err := abi.JSON(strings.NewReader(apechainnonfungiblepositionmanager.NonfungiblePositionManagerABI)) if err != nil { return "", err } multicallBytes := [][]byte{} { multicallData, err := instanceABI.Pack( "createAndInitializePoolIfNecessary", params.Token0, params.Token1, sqrtPriceX96, ) if err != nil { return "", err } multicallBytes = append( multicallBytes, multicallData, ) } { multicallData, err := instanceABI.Pack( "mint", apechainnonfungiblepositionmanager.INonfungiblePositionManagerMintParams{ Token0: params.Token0, Token1: params.Token1, TickLower: params.TickLower, TickUpper: params.TickUpper, Amount0Desired: params.Amount0Desired, Amount1Desired: params.Amount1Desired, Amount0Min: params.Amount0Min, Amount1Min: params.Amount1Min, Recipient: addressHex, Deadline: params.Deadline, }, ) if err != nil { return "", err } multicallBytes = append( multicallBytes, multicallData, ) } if strings.EqualFold(weth9.Hex(), params.Token0.Hex()) || strings.EqualFold(weth9.Hex(), params.Token1.Hex()) { multicallData, err := instanceABI.Pack( "refundNativeToken", ) if err != nil { return "", err } multicallBytes = append( multicallBytes, multicallData, ) } dataBytes, err := instanceABI.Pack( "multicall", multicallBytes, ) if err != nil { return "", err } gasNumber, err := client.EstimateGas(context.Background(), ethereum.CallMsg{ From: addressHex, To: &contractAddress, Data: dataBytes, Value: value, }) if err != nil { return "", err } chainID, err := c.GetChainID() if err != nil { return "", err } nonceAt, err := c.PendingNonceAt(context.Background(), addressHex) if err != nil { return "", err } rawTx := types.NewTx(&types.DynamicFeeTx{ ChainID: big.NewInt(int64(chainID)), Nonce: nonceAt, GasFeeCap: gasPrice, GasTipCap: gasTipCap, Gas: (gasNumber * 12 / 10), To: &contractAddress, Value: value, Data: dataBytes, }) signedTx, err := types.SignTx(rawTx, types.NewLondonSigner(big.NewInt(int64(chainID))), prk) if err != nil { return "", err } err = client.SendTransaction(context.Background(), signedTx) if err != nil { return "", err } return signedTx.Hash().Hex(), nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/ethapi/arbitrum_swapv3.go ================================================ package ethapi import ( "context" "math/big" "strings" "time" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/helpers" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/binds/arbitrumnonfungiblepositionmanager" "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" ) // func (c *Client) ArbitrumNonfungiblePositionManagerMint(contractAddr string, privateHex string, weth9 common.Address, sqrtPriceX96 *big.Int, params []*basenonfungiblepositionmanager.INonfungiblePositionManagerMintParams) (string, error) { // addressHex, prk, err := c.parsePrkAuth(privateHex) // if err != nil { // return "", err // } // gasPrice, gasTipCap, err := c.GetCachedGasPriceAndTipCap() // if err != nil { // return "", err // } // client, err := c.getClient() // if err != nil { // return "", err // } // value := big.NewInt(0) // for _, param := range params { // if !strings.EqualFold(weth9.Hex(), param.Token0.Hex()) { // if param.Amount0Desired.Cmp(big.NewInt(0)) > 0 { // allowance, err := c.Erc20Allowance(param.Token0.Hex(), addressHex.Hex(), contractAddr) // if err != nil { // return "", err // } // if allowance.Cmp(big.NewInt(0)) <= 0 { // approveHash, err := c.Erc20ApproveMax( // param.Token0.Hex(), // privateHex, // contractAddr, // ) // if err != nil { // return "", err // } // time.Sleep(5 * time.Second) // err = c.WaitMined(approveHash) // if err != nil { // return "", err // } // } // } // } else { // value = param.Amount0Desired // } // if !strings.EqualFold(weth9.Hex(), param.Token1.Hex()) { // if param.Amount1Desired.Cmp(big.NewInt(0)) > 0 { // allowance, err := c.Erc20Allowance(param.Token1.Hex(), addressHex.Hex(), contractAddr) // if err != nil { // return "", err // } // if allowance.Cmp(big.NewInt(0)) <= 0 { // approveHash, err := c.Erc20ApproveMax( // param.Token1.Hex(), // privateHex, // contractAddr, // ) // if err != nil { // return "", err // } // time.Sleep(5 * time.Second) // err = c.WaitMined(approveHash) // if err != nil { // return "", err // } // } // } // } else { // value = param.Amount1Desired // } // } // contractAddress := helpers.HexToAddress(contractAddr) // // EstimateGas // instanceABI, err := abi.JSON(strings.NewReader(basenonfungiblepositionmanager.NonfungiblePositionManagerABI)) // if err != nil { // return "", err // } // multicallBytes := [][]byte{} // { // for _, param := range params { // multicallData, err := instanceABI.Pack( // "createAndInitializePoolIfNecessary", // param.Token0, // param.Token1, // param.Fee, // sqrtPriceX96, // ) // if err != nil { // return "", err // } // multicallBytes = append( // multicallBytes, // multicallData, // ) // } // } // { // for _, param := range params { // multicallData, err := instanceABI.Pack( // "mint", // basenonfungiblepositionmanager.INonfungiblePositionManagerMintParams{ // Token0: param.Token0, // Token1: param.Token1, // Fee: param.Fee, // TickLower: param.TickLower, // TickUpper: param.TickUpper, // Amount0Desired: param.Amount0Desired, // Amount1Desired: param.Amount1Desired, // Amount0Min: param.Amount0Min, // Amount1Min: param.Amount1Min, // Recipient: addressHex, // Deadline: param.Deadline, // }, // ) // if err != nil { // return "", err // } // multicallBytes = append( // multicallBytes, // multicallData, // ) // } // } // for _, param := range params { // if strings.EqualFold(weth9.Hex(), param.Token0.Hex()) || strings.EqualFold(weth9.Hex(), param.Token1.Hex()) { // multicallData, err := instanceABI.Pack( // "refundETH", // ) // if err != nil { // return "", err // } // multicallBytes = append( // multicallBytes, // multicallData, // ) // break // } // } // dataBytes, err := instanceABI.Pack( // "multicall", // multicallBytes, // ) // if err != nil { // return "", err // } // gasNumber, err := client.EstimateGas(context.Background(), ethereum.CallMsg{ // From: addressHex, // To: &contractAddress, // Data: dataBytes, // Value: value, // }) // if err != nil { // return "", err // } // chainID, err := c.GetChainID() // if err != nil { // return "", err // } // nonceAt, err := c.PendingNonceAt(context.Background(), addressHex) // if err != nil { // return "", err // } // rawTx := types.NewTx(&types.DynamicFeeTx{ // ChainID: big.NewInt(int64(chainID)), // Nonce: nonceAt, // GasFeeCap: gasPrice, // GasTipCap: gasTipCap, // Gas: (gasNumber * 12 / 10), // To: &contractAddress, // Value: value, // Data: dataBytes, // }) // signedTx, err := types.SignTx(rawTx, types.NewLondonSigner(big.NewInt(int64(chainID))), prk) // if err != nil { // return "", err // } // err = client.SendTransaction(context.Background(), signedTx) // if err != nil { // return "", err // } // return signedTx.Hash().Hex(), nil // } func (c *Client) ArbitrumNonfungiblePositionManagerMint(contractAddr string, privateHex string, weth9 common.Address, sqrtPriceX96 *big.Int, params *arbitrumnonfungiblepositionmanager.INonfungiblePositionManagerMintParams) (string, error) { addressHex, prk, err := c.parsePrkAuth(privateHex) if err != nil { return "", err } gasPrice, gasTipCap, err := c.GetCachedGasPriceAndTipCap() if err != nil { return "", err } client, err := c.getClient() if err != nil { return "", err } value := big.NewInt(0) if !strings.EqualFold(weth9.Hex(), params.Token0.Hex()) { if params.Amount0Desired.Cmp(big.NewInt(0)) > 0 { allowance, err := c.Erc20Allowance(params.Token0.Hex(), addressHex.Hex(), contractAddr) if err != nil { return "", err } if allowance.Cmp(big.NewInt(0)) <= 0 { approveHash, err := c.Erc20ApproveMax( params.Token0.Hex(), privateHex, contractAddr, ) if err != nil { return "", err } time.Sleep(10 * time.Second) err = c.WaitMined(approveHash) if err != nil { return "", err } } } } else { value = params.Amount0Desired } if !strings.EqualFold(weth9.Hex(), params.Token1.Hex()) { if params.Amount1Desired.Cmp(big.NewInt(0)) > 0 { allowance, err := c.Erc20Allowance(params.Token1.Hex(), addressHex.Hex(), contractAddr) if err != nil { return "", err } if allowance.Cmp(big.NewInt(0)) <= 0 { approveHash, err := c.Erc20ApproveMax( params.Token1.Hex(), privateHex, contractAddr, ) if err != nil { return "", err } time.Sleep(10 * time.Second) err = c.WaitMined(approveHash) if err != nil { return "", err } } } } else { value = params.Amount1Desired } contractAddress := helpers.HexToAddress(contractAddr) // EstimateGas instanceABI, err := abi.JSON(strings.NewReader(arbitrumnonfungiblepositionmanager.NonfungiblePositionManagerABI)) if err != nil { return "", err } multicallBytes := [][]byte{} { multicallData, err := instanceABI.Pack( "createAndInitializePoolIfNecessary", params.Token0, params.Token1, sqrtPriceX96, ) if err != nil { return "", err } multicallBytes = append( multicallBytes, multicallData, ) } { multicallData, err := instanceABI.Pack( "mint", arbitrumnonfungiblepositionmanager.INonfungiblePositionManagerMintParams{ Token0: params.Token0, Token1: params.Token1, TickLower: params.TickLower, TickUpper: params.TickUpper, Amount0Desired: params.Amount0Desired, Amount1Desired: params.Amount1Desired, Amount0Min: params.Amount0Min, Amount1Min: params.Amount1Min, Recipient: addressHex, Deadline: params.Deadline, }, ) if err != nil { return "", err } multicallBytes = append( multicallBytes, multicallData, ) } if strings.EqualFold(weth9.Hex(), params.Token0.Hex()) || strings.EqualFold(weth9.Hex(), params.Token1.Hex()) { multicallData, err := instanceABI.Pack( "refundNativeToken", ) if err != nil { return "", err } multicallBytes = append( multicallBytes, multicallData, ) } dataBytes, err := instanceABI.Pack( "multicall", multicallBytes, ) if err != nil { return "", err } gasNumber, err := client.EstimateGas(context.Background(), ethereum.CallMsg{ From: addressHex, To: &contractAddress, Data: dataBytes, Value: value, }) if err != nil { return "", err } chainID, err := c.GetChainID() if err != nil { return "", err } nonceAt, err := c.PendingNonceAt(context.Background(), addressHex) if err != nil { return "", err } rawTx := types.NewTx(&types.DynamicFeeTx{ ChainID: big.NewInt(int64(chainID)), Nonce: nonceAt, GasFeeCap: gasPrice, GasTipCap: gasTipCap, Gas: (gasNumber * 12 / 10), To: &contractAddress, Value: value, Data: dataBytes, }) signedTx, err := types.SignTx(rawTx, types.NewLondonSigner(big.NewInt(int64(chainID))), prk) if err != nil { return "", err } err = client.SendTransaction(context.Background(), signedTx) if err != nil { return "", err } return signedTx.Hash().Hex(), nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/ethapi/avax_swapv3.go ================================================ package ethapi import ( "context" "math/big" "strings" "time" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/helpers" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/binds/avaxnonfungiblepositionmanager" "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" ) func (c *Client) AvaxNonfungiblePositionManagerMint(contractAddr string, privateHex string, weth9 common.Address, sqrtPriceX96 *big.Int, params *avaxnonfungiblepositionmanager.INonfungiblePositionManagerMintParams) (string, error) { addressHex, prk, err := c.parsePrkAuth(privateHex) if err != nil { return "", err } gasPrice, gasTipCap, err := c.GetCachedGasPriceAndTipCap() if err != nil { return "", err } client, err := c.getClient() if err != nil { return "", err } value := big.NewInt(0) if !strings.EqualFold(weth9.Hex(), params.Token0.Hex()) { if params.Amount0Desired.Cmp(big.NewInt(0)) > 0 { allowance, err := c.Erc20Allowance(params.Token0.Hex(), addressHex.Hex(), contractAddr) if err != nil { return "", err } if allowance.Cmp(big.NewInt(0)) <= 0 { approveHash, err := c.Erc20ApproveMax( params.Token0.Hex(), privateHex, contractAddr, ) if err != nil { return "", err } time.Sleep(10 * time.Second) err = c.WaitMined(approveHash) if err != nil { return "", err } } } } else { value = params.Amount0Desired } if !strings.EqualFold(weth9.Hex(), params.Token1.Hex()) { if params.Amount1Desired.Cmp(big.NewInt(0)) > 0 { allowance, err := c.Erc20Allowance(params.Token1.Hex(), addressHex.Hex(), contractAddr) if err != nil { return "", err } if allowance.Cmp(big.NewInt(0)) <= 0 { approveHash, err := c.Erc20ApproveMax( params.Token1.Hex(), privateHex, contractAddr, ) if err != nil { return "", err } time.Sleep(10 * time.Second) err = c.WaitMined(approveHash) if err != nil { return "", err } } } } else { value = params.Amount1Desired } contractAddress := helpers.HexToAddress(contractAddr) // EstimateGas instanceABI, err := abi.JSON(strings.NewReader(avaxnonfungiblepositionmanager.NonfungiblePositionManagerABI)) if err != nil { return "", err } multicallBytes := [][]byte{} { multicallData, err := instanceABI.Pack( "createAndInitializePoolIfNecessary", params.Token0, params.Token1, params.Fee, sqrtPriceX96, ) if err != nil { return "", err } multicallBytes = append( multicallBytes, multicallData, ) } { multicallData, err := instanceABI.Pack( "mint", avaxnonfungiblepositionmanager.INonfungiblePositionManagerMintParams{ Token0: params.Token0, Token1: params.Token1, Fee: params.Fee, TickLower: params.TickLower, TickUpper: params.TickUpper, Amount0Desired: params.Amount0Desired, Amount1Desired: params.Amount1Desired, Amount0Min: params.Amount0Min, Amount1Min: params.Amount1Min, Recipient: addressHex, Deadline: params.Deadline, }, ) if err != nil { return "", err } multicallBytes = append( multicallBytes, multicallData, ) } if strings.EqualFold(weth9.Hex(), params.Token0.Hex()) || strings.EqualFold(weth9.Hex(), params.Token1.Hex()) { multicallData, err := instanceABI.Pack( "refundETH", ) if err != nil { return "", err } multicallBytes = append( multicallBytes, multicallData, ) } dataBytes, err := instanceABI.Pack( "multicall", multicallBytes, ) if err != nil { return "", err } gasNumber, err := client.EstimateGas(context.Background(), ethereum.CallMsg{ From: addressHex, To: &contractAddress, Data: dataBytes, Value: value, }) if err != nil { return "", err } chainID, err := c.GetChainID() if err != nil { return "", err } nonceAt, err := c.PendingNonceAt(context.Background(), addressHex) if err != nil { return "", err } rawTx := types.NewTx(&types.DynamicFeeTx{ ChainID: big.NewInt(int64(chainID)), Nonce: nonceAt, GasFeeCap: gasPrice, GasTipCap: gasTipCap, Gas: (gasNumber * 12 / 10), To: &contractAddress, Value: value, Data: dataBytes, }) signedTx, err := types.SignTx(rawTx, types.NewLondonSigner(big.NewInt(int64(chainID))), prk) if err != nil { return "", err } err = client.SendTransaction(context.Background(), signedTx) if err != nil { return "", err } return signedTx.Hash().Hex(), nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/ethapi/base_swapv3.go ================================================ package ethapi import ( "context" "errors" "math/big" "strings" "time" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/helpers" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/binds/basenonfungiblepositionmanager" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/binds/basequoterv2" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/binds/baseswaprouter02" "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" ) // func (c *Client) BaseNonfungiblePositionManagerMint(contractAddr string, privateHex string, weth9 common.Address, sqrtPriceX96 *big.Int, params []*basenonfungiblepositionmanager.INonfungiblePositionManagerMintParams) (string, error) { // addressHex, prk, err := c.parsePrkAuth(privateHex) // if err != nil { // return "", err // } // gasPrice, gasTipCap, err := c.GetCachedGasPriceAndTipCap() // if err != nil { // return "", err // } // client, err := c.getClient() // if err != nil { // return "", err // } // value := big.NewInt(0) // for _, param := range params { // if !strings.EqualFold(weth9.Hex(), param.Token0.Hex()) { // if param.Amount0Desired.Cmp(big.NewInt(0)) > 0 { // allowance, err := c.Erc20Allowance(param.Token0.Hex(), addressHex.Hex(), contractAddr) // if err != nil { // return "", err // } // if allowance.Cmp(big.NewInt(0)) <= 0 { // approveHash, err := c.Erc20ApproveMax( // param.Token0.Hex(), // privateHex, // contractAddr, // ) // if err != nil { // return "", err // } // time.Sleep(5 * time.Second) // err = c.WaitMined(approveHash) // if err != nil { // return "", err // } // } // } // } else { // value = param.Amount0Desired // } // if !strings.EqualFold(weth9.Hex(), param.Token1.Hex()) { // if param.Amount1Desired.Cmp(big.NewInt(0)) > 0 { // allowance, err := c.Erc20Allowance(param.Token1.Hex(), addressHex.Hex(), contractAddr) // if err != nil { // return "", err // } // if allowance.Cmp(big.NewInt(0)) <= 0 { // approveHash, err := c.Erc20ApproveMax( // param.Token1.Hex(), // privateHex, // contractAddr, // ) // if err != nil { // return "", err // } // time.Sleep(5 * time.Second) // err = c.WaitMined(approveHash) // if err != nil { // return "", err // } // } // } // } else { // value = param.Amount1Desired // } // } // contractAddress := helpers.HexToAddress(contractAddr) // // EstimateGas // instanceABI, err := abi.JSON(strings.NewReader(basenonfungiblepositionmanager.NonfungiblePositionManagerABI)) // if err != nil { // return "", err // } // multicallBytes := [][]byte{} // { // for _, param := range params { // multicallData, err := instanceABI.Pack( // "createAndInitializePoolIfNecessary", // param.Token0, // param.Token1, // param.Fee, // sqrtPriceX96, // ) // if err != nil { // return "", err // } // multicallBytes = append( // multicallBytes, // multicallData, // ) // } // } // { // for _, param := range params { // multicallData, err := instanceABI.Pack( // "mint", // basenonfungiblepositionmanager.INonfungiblePositionManagerMintParams{ // Token0: param.Token0, // Token1: param.Token1, // Fee: param.Fee, // TickLower: param.TickLower, // TickUpper: param.TickUpper, // Amount0Desired: param.Amount0Desired, // Amount1Desired: param.Amount1Desired, // Amount0Min: param.Amount0Min, // Amount1Min: param.Amount1Min, // Recipient: addressHex, // Deadline: param.Deadline, // }, // ) // if err != nil { // return "", err // } // multicallBytes = append( // multicallBytes, // multicallData, // ) // } // } // for _, param := range params { // if strings.EqualFold(weth9.Hex(), param.Token0.Hex()) || strings.EqualFold(weth9.Hex(), param.Token1.Hex()) { // multicallData, err := instanceABI.Pack( // "refundETH", // ) // if err != nil { // return "", err // } // multicallBytes = append( // multicallBytes, // multicallData, // ) // break // } // } // dataBytes, err := instanceABI.Pack( // "multicall", // multicallBytes, // ) // if err != nil { // return "", err // } // gasNumber, err := client.EstimateGas(context.Background(), ethereum.CallMsg{ // From: addressHex, // To: &contractAddress, // Data: dataBytes, // Value: value, // }) // if err != nil { // return "", err // } // chainID, err := c.GetChainID() // if err != nil { // return "", err // } // nonceAt, err := c.PendingNonceAt(context.Background(), addressHex) // if err != nil { // return "", err // } // rawTx := types.NewTx(&types.DynamicFeeTx{ // ChainID: big.NewInt(int64(chainID)), // Nonce: nonceAt, // GasFeeCap: gasPrice, // GasTipCap: gasTipCap, // Gas: (gasNumber * 12 / 10), // To: &contractAddress, // Value: value, // Data: dataBytes, // }) // signedTx, err := types.SignTx(rawTx, types.NewLondonSigner(big.NewInt(int64(chainID))), prk) // if err != nil { // return "", err // } // err = client.SendTransaction(context.Background(), signedTx) // if err != nil { // return "", err // } // return signedTx.Hash().Hex(), nil // } func (c *Client) BaseNonfungiblePositionManagerMint(contractAddr string, privateHex string, weth9 common.Address, sqrtPriceX96 *big.Int, params *basenonfungiblepositionmanager.INonfungiblePositionManagerMintParams) (string, error) { addressHex, prk, err := c.parsePrkAuth(privateHex) if err != nil { return "", err } gasPrice, gasTipCap, err := c.GetCachedGasPriceAndTipCap() if err != nil { return "", err } client, err := c.getClient() if err != nil { return "", err } value := big.NewInt(0) if !strings.EqualFold(weth9.Hex(), params.Token0.Hex()) { if params.Amount0Desired.Cmp(big.NewInt(0)) > 0 { allowance, err := c.Erc20Allowance(params.Token0.Hex(), addressHex.Hex(), contractAddr) if err != nil { return "", err } if allowance.Cmp(big.NewInt(0)) <= 0 { approveHash, err := c.Erc20ApproveMax( params.Token0.Hex(), privateHex, contractAddr, ) if err != nil { return "", err } time.Sleep(10 * time.Second) err = c.WaitMined(approveHash) if err != nil { return "", err } } } } else { value = params.Amount0Desired } if !strings.EqualFold(weth9.Hex(), params.Token1.Hex()) { if params.Amount1Desired.Cmp(big.NewInt(0)) > 0 { allowance, err := c.Erc20Allowance(params.Token1.Hex(), addressHex.Hex(), contractAddr) if err != nil { return "", err } if allowance.Cmp(big.NewInt(0)) <= 0 { approveHash, err := c.Erc20ApproveMax( params.Token1.Hex(), privateHex, contractAddr, ) if err != nil { return "", err } time.Sleep(10 * time.Second) err = c.WaitMined(approveHash) if err != nil { return "", err } } } } else { value = params.Amount1Desired } contractAddress := helpers.HexToAddress(contractAddr) // EstimateGas instanceABI, err := abi.JSON(strings.NewReader(basenonfungiblepositionmanager.NonfungiblePositionManagerABI)) if err != nil { return "", err } multicallBytes := [][]byte{} { multicallData, err := instanceABI.Pack( "createAndInitializePoolIfNecessary", params.Token0, params.Token1, params.Fee, sqrtPriceX96, ) if err != nil { return "", err } multicallBytes = append( multicallBytes, multicallData, ) } { multicallData, err := instanceABI.Pack( "mint", basenonfungiblepositionmanager.INonfungiblePositionManagerMintParams{ Token0: params.Token0, Token1: params.Token1, Fee: params.Fee, TickLower: params.TickLower, TickUpper: params.TickUpper, Amount0Desired: params.Amount0Desired, Amount1Desired: params.Amount1Desired, Amount0Min: params.Amount0Min, Amount1Min: params.Amount1Min, Recipient: addressHex, Deadline: params.Deadline, }, ) if err != nil { return "", err } multicallBytes = append( multicallBytes, multicallData, ) } if strings.EqualFold(weth9.Hex(), params.Token0.Hex()) || strings.EqualFold(weth9.Hex(), params.Token1.Hex()) { multicallData, err := instanceABI.Pack( "refundETH", ) if err != nil { return "", err } multicallBytes = append( multicallBytes, multicallData, ) } dataBytes, err := instanceABI.Pack( "multicall", multicallBytes, ) if err != nil { return "", err } gasNumber, err := client.EstimateGas(context.Background(), ethereum.CallMsg{ From: addressHex, To: &contractAddress, Data: dataBytes, Value: value, }) if err != nil { return "", err } chainID, err := c.GetChainID() if err != nil { return "", err } nonceAt, err := c.PendingNonceAt(context.Background(), addressHex) if err != nil { return "", err } rawTx := types.NewTx(&types.DynamicFeeTx{ ChainID: big.NewInt(int64(chainID)), Nonce: nonceAt, GasFeeCap: gasPrice, GasTipCap: gasTipCap, Gas: (gasNumber * 12 / 10), To: &contractAddress, Value: value, Data: dataBytes, }) signedTx, err := types.SignTx(rawTx, types.NewLondonSigner(big.NewInt(int64(chainID))), prk) if err != nil { return "", err } err = client.SendTransaction(context.Background(), signedTx) if err != nil { return "", err } return signedTx.Hash().Hex(), nil } func (c *Client) BaseNonfungiblePositionManagerMintData(recipient string, sqrtPriceX96 *big.Int, params *basenonfungiblepositionmanager.INonfungiblePositionManagerMintParams) ([]byte, error) { instanceABI, err := abi.JSON(strings.NewReader(basenonfungiblepositionmanager.NonfungiblePositionManagerABI)) if err != nil { return nil, err } multicallBytes := [][]byte{} { multicallData, err := instanceABI.Pack( "createAndInitializePoolIfNecessary", params.Token0, params.Token1, params.Fee, sqrtPriceX96, ) if err != nil { return nil, err } multicallBytes = append( multicallBytes, multicallData, ) } { multicallData, err := instanceABI.Pack( "mint", basenonfungiblepositionmanager.INonfungiblePositionManagerMintParams{ Token0: params.Token0, Token1: params.Token1, Fee: params.Fee, TickLower: params.TickLower, TickUpper: params.TickUpper, Amount0Desired: params.Amount0Desired, Amount1Desired: params.Amount1Desired, Amount0Min: params.Amount0Min, Amount1Min: params.Amount1Min, Recipient: helpers.HexToAddress(recipient), Deadline: params.Deadline, }, ) if err != nil { return nil, err } multicallBytes = append( multicallBytes, multicallData, ) } { multicallData, err := instanceABI.Pack( "refundETH", ) if err != nil { return nil, err } multicallBytes = append( multicallBytes, multicallData, ) } dataBytes, err := instanceABI.Pack( "multicall", multicallBytes, ) if err != nil { return nil, err } return dataBytes, nil } func (c *Client) BaseSwapRouterExactInputSingle(contractAddr, privateHex string, weth9 common.Address, params *baseswaprouter02.IV3SwapRouterExactInputSingleParams) (string, error) { addressHex, prk, err := c.parsePrkAuth(privateHex) if err != nil { return "", err } client, err := c.getClient() if err != nil { return "", err } gasPrice, gasTipCap, err := c.GetCachedGasPriceAndTipCap() if err != nil { return "", err } if params.AmountIn.Cmp(big.NewInt(0)) <= 0 { return "", errors.New("amountIn is not enough for tx") } contractAddress := helpers.HexToAddress(contractAddr) instanceABI, err := abi.JSON(strings.NewReader(baseswaprouter02.SwapRouter02ABI)) if err != nil { return "", err } var dataBytes []byte value := big.NewInt(0) if !strings.EqualFold(params.TokenIn.Hex(), weth9.Hex()) { allowance, err := c.Erc20Allowance(params.TokenIn.Hex(), addressHex.Hex(), contractAddr) if err != nil { return "", err } if allowance.Cmp(params.AmountIn) < 0 { approveHash, err := c.Erc20ApproveMax( params.TokenIn.Hex(), privateHex, contractAddr, ) if err != nil { return "", err } time.Sleep(10 * time.Second) err = c.WaitMined(approveHash) if err != nil { return "", err } } } if strings.EqualFold(params.TokenIn.Hex(), weth9.Hex()) { value = params.AmountIn exactInputSingleDataBytes, err := instanceABI.Pack( "exactInputSingle", baseswaprouter02.IV3SwapRouterExactInputSingleParams{ TokenIn: params.TokenIn, TokenOut: params.TokenOut, Fee: params.Fee, Recipient: params.Recipient, AmountIn: params.AmountIn, AmountOutMinimum: params.AmountOutMinimum, SqrtPriceLimitX96: params.SqrtPriceLimitX96, }, ) if err != nil { return "", err } refundWETHDataBytes, err := instanceABI.Pack( "refundETH", ) if err != nil { return "", err } dataBytes, err = instanceABI.Pack( "multicall0", big.NewInt(time.Now().Unix()+60), [][]byte{ exactInputSingleDataBytes, refundWETHDataBytes, }, ) if err != nil { return "", err } } else if strings.EqualFold(params.TokenOut.Hex(), weth9.Hex()) { exactInputSingleDataBytes, err := instanceABI.Pack( "exactInputSingle", baseswaprouter02.IV3SwapRouterExactInputSingleParams{ TokenIn: params.TokenIn, TokenOut: params.TokenOut, Fee: params.Fee, Recipient: contractAddress, AmountIn: params.AmountIn, AmountOutMinimum: params.AmountOutMinimum, SqrtPriceLimitX96: params.SqrtPriceLimitX96, }, ) if err != nil { return "", err } unwrapWETHDataBytes, err := instanceABI.Pack( "unwrapWETH9", big.NewInt(0), addressHex, ) if err != nil { return "", err } sweepTokenDataBytes, err := instanceABI.Pack( "sweepToken", params.TokenOut, big.NewInt(0), addressHex, ) if err != nil { return "", err } dataBytes, err = instanceABI.Pack( "multicall0", big.NewInt(time.Now().Unix()+60), [][]byte{ exactInputSingleDataBytes, unwrapWETHDataBytes, sweepTokenDataBytes, }, ) if err != nil { return "", err } } else { exactInputSingleDataBytes, err := instanceABI.Pack( "exactInputSingle", baseswaprouter02.IV3SwapRouterExactInputSingleParams{ TokenIn: params.TokenIn, TokenOut: params.TokenOut, Fee: params.Fee, Recipient: addressHex, AmountIn: params.AmountIn, AmountOutMinimum: params.AmountOutMinimum, SqrtPriceLimitX96: params.SqrtPriceLimitX96, }, ) if err != nil { return "", err } dataBytes, err = instanceABI.Pack( "multicall0", big.NewInt(time.Now().Unix()+60), [][]byte{ exactInputSingleDataBytes, }, ) if err != nil { return "", err } } gasNumber, err := client.EstimateGas(context.Background(), ethereum.CallMsg{ From: addressHex, To: &contractAddress, Data: dataBytes, Value: value, }) if err != nil { return "", err } chainID, err := c.GetChainID() if err != nil { return "", err } nonceAt, err := c.PendingNonceAt(context.Background(), addressHex) if err != nil { return "", err } rawTx := types.NewTx(&types.DynamicFeeTx{ ChainID: big.NewInt(int64(chainID)), Nonce: nonceAt, GasFeeCap: gasPrice, GasTipCap: gasTipCap, Gas: (gasNumber * 12 / 10), To: &contractAddress, Value: value, Data: dataBytes, }) signedTx, err := types.SignTx(rawTx, types.NewLondonSigner(big.NewInt(int64(chainID))), prk) if err != nil { return "", err } err = client.SendTransaction(context.Background(), signedTx) if err != nil { return "", err } return signedTx.Hash().Hex(), nil } func (c *Client) BaseQuoterQuoteExactInputSingle(contractAddress string, params *basequoterv2.IQuoterV2QuoteExactInputSingleParams) (*big.Int, *big.Int, uint32, uint32, error) { client, err := c.getClient() if err != nil { return nil, nil, 0, 0, err } instance, err := basequoterv2.NewQuoterV2(helpers.HexToAddress(contractAddress), client) if err != nil { return nil, nil, 0, 0, err } amountOut, sqrtPriceX96After, initializedTicksCrossed, gasEstimate, err := instance. QuoteExactInputSingleCall( &bind.CallOpts{}, *params, ) if err != nil { return nil, nil, 0, 0, err } return amountOut, sqrtPriceX96After, initializedTicksCrossed, gasEstimate, nil } func (c *Client) BaseQuoterQuoteExactOutputSingle(contractAddress string, params *basequoterv2.IQuoterV2QuoteExactOutputSingleParams) (*big.Int, *big.Int, uint32, uint32, error) { client, err := c.getClient() if err != nil { return nil, nil, 0, 0, err } instance, err := basequoterv2.NewQuoterV2(helpers.HexToAddress(contractAddress), client) if err != nil { return nil, nil, 0, 0, err } amountIn, sqrtPriceX96After, initializedTicksCrossed, gasEstimate, err := instance. QuoteExactOutputSingleCall( &bind.CallOpts{}, *params, ) if err != nil { return nil, nil, 0, 0, err } return amountIn, sqrtPriceX96After, initializedTicksCrossed, gasEstimate, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/ethapi/bsc_swapv3.go ================================================ package ethapi import ( "context" "math/big" "strings" "time" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/helpers" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/binds/bscnonfungiblepositionmanager" "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" ) func (c *Client) BscNonfungiblePositionManagerMint(contractAddr string, privateHex string, weth9 common.Address, sqrtPriceX96 *big.Int, params *bscnonfungiblepositionmanager.INonfungiblePositionManagerMintParams) (string, error) { addressHex, prk, err := c.parsePrkAuth(privateHex) if err != nil { return "", err } gasPrice, gasTipCap, err := c.GetCachedGasPriceAndTipCap() if err != nil { return "", err } client, err := c.getClient() if err != nil { return "", err } value := big.NewInt(0) if !strings.EqualFold(weth9.Hex(), params.Token0.Hex()) { if params.Amount0Desired.Cmp(big.NewInt(0)) > 0 { allowance, err := c.Erc20Allowance(params.Token0.Hex(), addressHex.Hex(), contractAddr) if err != nil { return "", err } if allowance.Cmp(big.NewInt(0)) <= 0 { approveHash, err := c.Erc20ApproveMax( params.Token0.Hex(), privateHex, contractAddr, ) if err != nil { return "", err } time.Sleep(10 * time.Second) err = c.WaitMined(approveHash) if err != nil { return "", err } } } } else { value = params.Amount0Desired } if !strings.EqualFold(weth9.Hex(), params.Token1.Hex()) { if params.Amount1Desired.Cmp(big.NewInt(0)) > 0 { allowance, err := c.Erc20Allowance(params.Token1.Hex(), addressHex.Hex(), contractAddr) if err != nil { return "", err } if allowance.Cmp(big.NewInt(0)) <= 0 { approveHash, err := c.Erc20ApproveMax( params.Token1.Hex(), privateHex, contractAddr, ) if err != nil { return "", err } time.Sleep(10 * time.Second) err = c.WaitMined(approveHash) if err != nil { return "", err } } } } else { value = params.Amount1Desired } contractAddress := helpers.HexToAddress(contractAddr) // EstimateGas instanceABI, err := abi.JSON(strings.NewReader(bscnonfungiblepositionmanager.NonfungiblePositionManagerABI)) if err != nil { return "", err } multicallBytes := [][]byte{} { multicallData, err := instanceABI.Pack( "createAndInitializePoolIfNecessary", params.Token0, params.Token1, params.Fee, sqrtPriceX96, ) if err != nil { return "", err } multicallBytes = append( multicallBytes, multicallData, ) } { multicallData, err := instanceABI.Pack( "mint", bscnonfungiblepositionmanager.INonfungiblePositionManagerMintParams{ Token0: params.Token0, Token1: params.Token1, Fee: params.Fee, TickLower: params.TickLower, TickUpper: params.TickUpper, Amount0Desired: params.Amount0Desired, Amount1Desired: params.Amount1Desired, Amount0Min: params.Amount0Min, Amount1Min: params.Amount1Min, Recipient: addressHex, Deadline: params.Deadline, }, ) if err != nil { return "", err } multicallBytes = append( multicallBytes, multicallData, ) } if strings.EqualFold(weth9.Hex(), params.Token0.Hex()) || strings.EqualFold(weth9.Hex(), params.Token1.Hex()) { multicallData, err := instanceABI.Pack( "refundETH", ) if err != nil { return "", err } multicallBytes = append( multicallBytes, multicallData, ) } dataBytes, err := instanceABI.Pack( "multicall", multicallBytes, ) if err != nil { return "", err } gasNumber, err := client.EstimateGas(context.Background(), ethereum.CallMsg{ From: addressHex, To: &contractAddress, Data: dataBytes, Value: value, }) if err != nil { return "", err } chainID, err := c.GetChainID() if err != nil { return "", err } nonceAt, err := c.PendingNonceAt(context.Background(), addressHex) if err != nil { return "", err } rawTx := types.NewTx(&types.DynamicFeeTx{ ChainID: big.NewInt(int64(chainID)), Nonce: nonceAt, GasFeeCap: gasPrice, GasTipCap: gasTipCap, Gas: (gasNumber * 12 / 10), To: &contractAddress, Value: value, Data: dataBytes, }) signedTx, err := types.SignTx(rawTx, types.NewLondonSigner(big.NewInt(int64(chainID))), prk) if err != nil { return "", err } err = client.SendTransaction(context.Background(), signedTx) if err != nil { return "", err } return signedTx.Hash().Hex(), nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/ethapi/celo_swapv3.go ================================================ package ethapi import ( "context" "math/big" "strings" "time" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/helpers" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/binds/celononfungiblepositionmanager" "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" ) func (c *Client) CeloNonfungiblePositionManagerMint(contractAddr string, privateHex string, weth9 common.Address, sqrtPriceX96 *big.Int, params *celononfungiblepositionmanager.INonfungiblePositionManagerMintParams) (string, error) { addressHex, prk, err := c.parsePrkAuth(privateHex) if err != nil { return "", err } gasPrice, gasTipCap, err := c.GetCachedGasPriceAndTipCap() if err != nil { return "", err } client, err := c.getClient() if err != nil { return "", err } value := big.NewInt(0) if !strings.EqualFold(weth9.Hex(), params.Token0.Hex()) { if params.Amount0Desired.Cmp(big.NewInt(0)) > 0 { allowance, err := c.Erc20Allowance(params.Token0.Hex(), addressHex.Hex(), contractAddr) if err != nil { return "", err } if allowance.Cmp(big.NewInt(0)) <= 0 { approveHash, err := c.Erc20ApproveMax( params.Token0.Hex(), privateHex, contractAddr, ) if err != nil { return "", err } time.Sleep(10 * time.Second) err = c.WaitMined(approveHash) if err != nil { return "", err } } } } else { value = params.Amount0Desired } if !strings.EqualFold(weth9.Hex(), params.Token1.Hex()) { if params.Amount1Desired.Cmp(big.NewInt(0)) > 0 { allowance, err := c.Erc20Allowance(params.Token1.Hex(), addressHex.Hex(), contractAddr) if err != nil { return "", err } if allowance.Cmp(big.NewInt(0)) <= 0 { approveHash, err := c.Erc20ApproveMax( params.Token1.Hex(), privateHex, contractAddr, ) if err != nil { return "", err } time.Sleep(10 * time.Second) err = c.WaitMined(approveHash) if err != nil { return "", err } } } } else { value = params.Amount1Desired } contractAddress := helpers.HexToAddress(contractAddr) // EstimateGas instanceABI, err := abi.JSON(strings.NewReader(celononfungiblepositionmanager.NonfungiblePositionManagerABI)) if err != nil { return "", err } multicallBytes := [][]byte{} { multicallData, err := instanceABI.Pack( "createAndInitializePoolIfNecessary", params.Token0, params.Token1, params.Fee, sqrtPriceX96, ) if err != nil { return "", err } multicallBytes = append( multicallBytes, multicallData, ) } { multicallData, err := instanceABI.Pack( "mint", celononfungiblepositionmanager.INonfungiblePositionManagerMintParams{ Token0: params.Token0, Token1: params.Token1, Fee: params.Fee, TickLower: params.TickLower, TickUpper: params.TickUpper, Amount0Desired: params.Amount0Desired, Amount1Desired: params.Amount1Desired, Amount0Min: params.Amount0Min, Amount1Min: params.Amount1Min, Recipient: addressHex, Deadline: params.Deadline, }, ) if err != nil { return "", err } multicallBytes = append( multicallBytes, multicallData, ) } if strings.EqualFold(weth9.Hex(), params.Token0.Hex()) || strings.EqualFold(weth9.Hex(), params.Token1.Hex()) { multicallData, err := instanceABI.Pack( "refundETH", ) if err != nil { return "", err } multicallBytes = append( multicallBytes, multicallData, ) } dataBytes, err := instanceABI.Pack( "multicall", multicallBytes, ) if err != nil { return "", err } gasNumber, err := client.EstimateGas(context.Background(), ethereum.CallMsg{ From: addressHex, To: &contractAddress, Data: dataBytes, Value: value, }) if err != nil { return "", err } chainID, err := c.GetChainID() if err != nil { return "", err } nonceAt, err := c.PendingNonceAt(context.Background(), addressHex) if err != nil { return "", err } rawTx := types.NewTx(&types.DynamicFeeTx{ ChainID: big.NewInt(int64(chainID)), Nonce: nonceAt, GasFeeCap: gasPrice, GasTipCap: gasTipCap, Gas: (gasNumber * 12 / 10), To: &contractAddress, Value: value, Data: dataBytes, }) signedTx, err := types.SignTx(rawTx, types.NewLondonSigner(big.NewInt(int64(chainID))), prk) if err != nil { return "", err } err = client.SendTransaction(context.Background(), signedTx) if err != nil { return "", err } return signedTx.Hash().Hex(), nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/ethapi/client.go ================================================ package ethapi import ( "bytes" "context" "crypto/ecdsa" "encoding/hex" "encoding/json" "errors" "fmt" "io" "math/big" "net/http" "strconv" "strings" "sync" "time" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/helpers" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/binds/erc20" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/evmapi" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/trxapi" "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/ethclient" ) func CreateETHAddress() (string, string, error) { key, err := crypto.GenerateKey() if err != nil { return "", "", err } addr := crypto.PubkeyToAddress(key.PublicKey).Hex() prk := hex.EncodeToString(key.D.Bytes()) if len(prk) != 64 { return "", "", errors.New("bad private key len") } return addr, prk, nil } type BlockResp struct { time uint64 hash string } type RPCResponse struct { JSONRPC string `json:"jsonrpc"` Result *ResultResponse `json:"result"` ID int `json:"id"` } type ResultResponse struct { Hash string `json:"hash"` BlockHash *string `json:"blockHash"` BlockNumber *string `json:"blockNumber"` Number *string `json:"number"` ChainID string `json:"chainId"` L1BlockNumber *string `json:"l1BlockNumber"` } func (b *BlockResp) Time() uint64 { return b.time } func (b *BlockResp) Hash() string { return b.hash } type Client struct { evmapi.BaseClient BaseURL string BaseGasURL string BlockMap map[uint64]*BlockResp BlockMapMtx sync.Mutex // chainID uint64 client *ethclient.Client gasClient *ethclient.Client MinGasPrice string BTCL1 bool BlockTimeDisabled bool // InscribeTxsLog func(txHash string, inscribeTxHash string, logErr string) } func (c *Client) getClient() (*ethclient.Client, error) { if c.client == nil { client, err := ethclient.Dial(c.BaseURL) if err != nil { return nil, err } c.client = client } return c.client, nil } func (c *Client) getGasClient() (*ethclient.Client, error) { if c.gasClient == nil { if c.BaseGasURL == "" { c.BaseGasURL = c.BaseURL } client, err := ethclient.Dial(c.BaseGasURL) if err != nil { return nil, err } c.gasClient = client } return c.gasClient, nil } func (c *Client) GetClient() (*ethclient.Client, error) { if c.client == nil { client, err := ethclient.Dial(c.BaseURL) if err != nil { return nil, err } c.client = client } return c.client, nil } func (c *Client) ChainID() (uint64, error) { _, err := c.GetChainID() if err != nil { return 0, err } return c.chainID, nil } func (c *Client) PendingNonceAt(ctx context.Context, addr common.Address) (uint64, error) { client, err := c.getClient() if err != nil { return 0, err } pNum, err := client.PendingNonceAt(ctx, addr) if err != nil { return 0, err } num, err := client.NonceAt(ctx, addr, nil) if err != nil { return 0, err } if pNum > num+3 { return 0, errors.New("pending nonce is too high") } return pNum, nil } func (c *Client) Address() (string, string, error) { return CreateETHAddress() } func (c *Client) BlockByNumber(blockNumber int64) (*types.Block, error) { client, err := c.getClient() if err != nil { return nil, err } block, err := client.BlockByNumber(context.Background(), big.NewInt(blockNumber)) if err != nil { return nil, err } return block, nil } func (c *Client) GetLastBlockNumber() (int64, error) { client, err := c.getClient() if err != nil { return 0, err } blockNumber, err := client.BlockNumber(context.Background()) if err != nil { return 0, err } return int64(blockNumber), nil } func (c *Client) GetBlockTime(n uint64) (uint64, error) { block, err := c.getBlock(n) if err != nil { return 0, err } return block.Time(), nil } func (c *Client) getBlock(n uint64) (*BlockResp, error) { if c.BlockMap == nil { c.BlockMap = map[uint64]*BlockResp{} } c.BlockMapMtx.Lock() blockResp, ok := c.BlockMap[n] c.BlockMapMtx.Unlock() if !ok { var blockInfoResp struct { Result *struct { Timestamp string `json:"timestamp"` Hash string `json:"hash"` } `json:"result"` } err := c.postJSON( c.BaseURL, map[string]string{}, map[string]interface{}{ "jsonrpc": "2.0", "id": 1, "method": "eth_getBlockByNumber", "params": []interface{}{ fmt.Sprintf("0x%s", big.NewInt(int64(n)).Text(16)), false, }, }, &blockInfoResp, ) if err != nil { return nil, err } var timeBN *big.Int if strings.HasPrefix(blockInfoResp.Result.Timestamp, "0x") { timeBN, ok = big.NewInt(0).SetString(blockInfoResp.Result.Timestamp[2:], 16) if !ok { return nil, errors.New("wrong time") } } else { timeBN, ok = big.NewInt(0).SetString(blockInfoResp.Result.Timestamp, 10) if !ok { return nil, errors.New("wrong time") } } c.BlockMapMtx.Lock() // c.BlockMap[n] = &BlockResp{ time: timeBN.Uint64(), hash: blockInfoResp.Result.Hash, } blockResp = c.BlockMap[n] // for i := n - 2000; i < n-1000; i++ { _, ok := c.BlockMap[i] if ok { delete(c.BlockMap, i) } } c.BlockMapMtx.Unlock() } return blockResp, nil } func (c *Client) doWithAuth(req *http.Request) (*http.Response, error) { client := &http.Client{} return client.Do(req) } func (c *Client) postJSON(apiURL string, headers map[string]string, jsonObject interface{}, result interface{}) error { bodyBytes, err := json.Marshal(jsonObject) if err != nil { return err } req, err := http.NewRequest(http.MethodPost, apiURL, bytes.NewBuffer(bodyBytes)) if err != nil { return err } req.Header.Add("Content-Type", "application/json") for k, v := range headers { req.Header.Add(k, v) } resp, err := c.doWithAuth(req) if err != nil { return fmt.Errorf("failed request: %v", err) } bodyBytes, err = io.ReadAll(resp.Body) if err != nil { return fmt.Errorf("http response bad status %d %s", resp.StatusCode, err.Error()) } if resp.StatusCode >= 300 { return fmt.Errorf("http response bad status %d %s", resp.StatusCode, string(bodyBytes)) } if result != nil { return json.Unmarshal(bodyBytes, result) } return nil } func (c *Client) TransactionConfirmed(hash string) error { client, err := c.getClient() if err != nil { return err } tx, isPending, err := client.TransactionByHash(context.Background(), common.HexToHash(hash)) if err != nil { return err } if isPending { return errors.New("transaction is pending") } r, err := bind.WaitMined(context.Background(), client, tx) if err != nil { return err } if r.Status != types.ReceiptStatusSuccessful { return errors.New("transaction is not Successful") } return nil } func (c *Client) WaitMined(hash string) error { client, err := c.getClient() if err != nil { return err } tx, isPending, err := client.TransactionByHash(context.Background(), common.HexToHash(hash)) if err != nil { return err } if isPending { return errors.New("transaction is pending") } r, err := bind.WaitMined(context.Background(), client, tx) if err != nil { return err } if r.Status != types.ReceiptStatusSuccessful { return errors.New("transaction is not Successful") } return nil } func (c *Client) WaitMinedTxReceipt(ctx context.Context, txHash common.Hash) (*types.Receipt, error) { client, err := c.getClient() if err != nil { return nil, err } queryTicker := time.NewTicker(time.Second) maxRetry := 100 defer queryTicker.Stop() retry := 0 for { retry++ receipt, err := client.TransactionReceipt(ctx, txHash) if err == nil && receipt != nil && receipt.BlockNumber != nil { return receipt, nil } _, _, err = c.CheckTxPendingByHash(txHash) if errors.Is(err, ethereum.NotFound) { return nil, err } if retry > maxRetry { return nil, err } // Wait for the next round. select { case <-ctx.Done(): return nil, ctx.Err() case <-queryTicker.C: } } } func (c *Client) validateAddress(address string) { if !(strings.EqualFold(address, helpers.HexToAddress(address).Hex())) { panic("wrong address") } } func (c *Client) parsePrkAuth(prkHex string) (common.Address, *ecdsa.PrivateKey, error) { prkHex = strings.TrimPrefix(prkHex, "0x") prk, err := crypto.HexToECDSA(prkHex) if err != nil { return common.Address{}, nil, err } pbk, ok := prk.Public().(*ecdsa.PublicKey) if !ok { return common.Address{}, nil, errors.New("error casting public key to ECDSA") } pbkHex := crypto.PubkeyToAddress(*pbk) return pbkHex, prk, nil } func (c *Client) GetChainID() (uint64, error) { if c.chainID > 0 { return c.chainID, nil } client, err := c.getClient() if err != nil { return 0, err } chainID, err := client.ChainID(context.Background()) if err != nil { return 0, err } c.chainID = chainID.Uint64() return c.chainID, nil } func (c *Client) getGasPrice() (*big.Int, error) { client, err := c.getGasClient() if err != nil { return nil, err } gasPrice := common.Big0 if c.MinGasPrice != "" { minGasPriceNum, err := strconv.ParseInt(c.MinGasPrice, 10, 0) if err == nil { gasPrice = big.NewInt(minGasPriceNum) } } if gasPrice == nil || gasPrice.Cmp(big.NewInt(0)) <= 0 { gasPrice, err = client.SuggestGasPrice(context.Background()) if err != nil { return nil, err } gasPrice = common.Big0.Quo( common.Big0.Mul(gasPrice, big.NewInt(12)), big.NewInt(10), ) } gasPriceRes, _ := common.Big0.SetString(gasPrice.Text(10), 10) return gasPriceRes, nil } func (c *Client) getGasTipCap() (*big.Int, error) { client, err := c.getGasClient() if err != nil { return nil, err } gasPrice := common.Big0 if c.MinGasPrice != "" { minGasPriceNum, err := strconv.ParseInt(c.MinGasPrice, 10, 0) if err == nil { gasPrice = big.NewInt(minGasPriceNum) } } if gasPrice == nil || gasPrice.Cmp(big.NewInt(0)) <= 0 { gasPrice, err = client.SuggestGasTipCap(context.Background()) if err != nil { return nil, err } if gasPrice.Cmp(big.NewInt(0)) <= 0 { gasPrice, err = client.SuggestGasPrice(context.Background()) if err != nil { return nil, err } } gasPrice = common.Big0.Quo( common.Big0.Mul(gasPrice, big.NewInt(12)), big.NewInt(10), ) } gasPriceRes, _ := common.Big0.SetString(gasPrice.Text(10), 10) return gasPriceRes, nil } func (c *Client) GetCachedGasPriceAndTipCap() (*big.Int, *big.Int, error) { cachedGasPrice, err := c.getGasPrice() if err != nil { return nil, nil, err } cachedGasTipCap := cachedGasPrice return cachedGasPrice, cachedGasTipCap, nil } func (c *Client) Transfer(prkHex string, toAddr string, amount string, includeFee bool, wait bool) (string, error) { c.validateAddress(toAddr) if toAddr == "" || !common.IsHexAddress(toAddr) { return "", errors.New("toAddr is invalid") } value, ok := big.NewInt(0).SetString(amount, 10) if !ok { return "", errors.New("amount is invalid") } pbkHex, prk, err := c.parsePrkAuth(prkHex) if err != nil { return "", err } client, err := c.getClient() if err != nil { return "", err } nonce, err := c.PendingNonceAt(context.Background(), pbkHex) if err != nil { return "", err } gasPrice, err := c.getGasPrice() if err != nil { return "", err } chainID, err := client.NetworkID(context.Background()) if err != nil { return "", err } extraLimit := uint64(0) toAddress := helpers.HexToAddress(toAddr) gasLimit, err := client.EstimateGas(context.Background(), ethereum.CallMsg{ From: pbkHex, To: &toAddress, Data: []byte{}, }) if err != nil { return "", err } if includeFee { gasFee := big.NewInt(0).Mul(gasPrice, big.NewInt(int64(gasLimit+extraLimit))) if value.Cmp(gasFee) <= 0 { return "", errors.New("amount is lower than gas fee") } value = big.NewInt(0).Sub(value, gasFee) } tx := types.NewTransaction(nonce, helpers.HexToAddress(toAddr), value, gasLimit, gasPrice, []byte{}) signedTx, err := types.SignTx(tx, types.NewEIP155Signer(chainID), prk) if err != nil { return "", err } err = client.SendTransaction(context.Background(), signedTx) if err != nil { return "", err } // if wait { c.WaitMined(signedTx.Hash().Hex()) } return signedTx.Hash().Hex(), nil } func (c *Client) ValidateMessageSignature(msg string, signatureHex string, signer string) error { msg = fmt.Sprintf("\x19Ethereum Signed Message:\n%d%s", len(msg), msg) msgBytes := []byte(msg) msgHash := crypto.Keccak256Hash( msgBytes, ) signature, err := hexutil.Decode(signatureHex) if err != nil { return err } if signature[crypto.RecoveryIDOffset] > 1 { signature[crypto.RecoveryIDOffset] -= 27 } sigPublicKey, err := crypto.SigToPub(msgHash.Bytes(), signature) if err != nil { return err } pbkHex := crypto.PubkeyToAddress(*sigPublicKey) pbStr := pbkHex.Hex() fmt.Println(pbStr) if !strings.EqualFold(pbStr, signer) { return errors.New("not valid signer") } return nil } func (c *Client) ReferralPaymentSignMessage(contractAddr, tokenAddr, accountAddr, prk string, balance *big.Int) (string, error) { datas := []byte{} chainID, err := c.GetChainID() if err != nil { return "", err } datas = append(datas, common.HexToHash(contractAddr).Bytes()...) datas = append(datas, common.BytesToHash(big.NewInt(int64(chainID)).Bytes()).Bytes()...) datas = append(datas, common.HexToHash(tokenAddr).Bytes()...) datas = append(datas, common.HexToHash(accountAddr).Bytes()...) datas = append(datas, common.BytesToHash(balance.Bytes()).Bytes()...) dataByteHash := crypto.Keccak256Hash( datas, ) signature, err := c.SignWithEthereum(prk, dataByteHash.Bytes()) if err != nil { return "", err } return signature, nil } func (c *Client) SignWithEthereum(privateKey string, dataBytes []byte) (string, error) { signBytes := append([]byte("\x19Ethereum Signed Message:\n32"), dataBytes...) hash := crypto.Keccak256Hash(signBytes) prk, err := crypto.HexToECDSA(privateKey) if err != nil { return "", err } signature, err := crypto.Sign(hash.Bytes(), prk) if err != nil { return "", err } signature[crypto.RecoveryIDOffset] += 27 sigHex := hexutil.Encode(signature) sigHex = sigHex[2:] return sigHex, nil } func (c *Client) Sign(privateKey string, hash [32]byte) ([]byte, error) { prk, err := crypto.HexToECDSA(privateKey) if err != nil { return nil, err } signature, err := crypto.Sign(hash[:], prk) if err != nil { return nil, err } signature[crypto.RecoveryIDOffset] += 27 sigHex := hexutil.Encode(signature) sigHex = sigHex[2:] return signature, nil } func (c *Client) Erc20Transfer(erc20Addr string, prkHex string, toAddr string, amount string) (string, error) { if erc20Addr == "" || !common.IsHexAddress(erc20Addr) { return "", errors.New("erc20Addr is invalid") } if toAddr == "" || !common.IsHexAddress(toAddr) { return "", errors.New("toAddr is invalid") } value, ok := big.NewInt(0).SetString(amount, 10) if !ok { return "", errors.New("amount is insufficient") } pbkHex, prk, err := c.parsePrkAuth(prkHex) if err != nil { return "", err } gasPrice, gasTipCap, err := c.GetCachedGasPriceAndTipCap() if err != nil { return "", err } client, err := c.getClient() if err != nil { return "", err } nonceAt, err := c.PendingNonceAt(context.Background(), pbkHex) if err != nil { return "", err } contractAddress := helpers.HexToAddress(erc20Addr) // EstimateGas instanceABI, err := abi.JSON(strings.NewReader(erc20.Erc20ABI)) if err != nil { return "", err } dataBytes, err := instanceABI.Pack( "transfer", helpers.HexToAddress(toAddr), value, ) if err != nil { return "", err } gasNumber, err := client.EstimateGas(context.Background(), ethereum.CallMsg{ From: pbkHex, To: &contractAddress, Data: dataBytes, }) if err != nil { return "", err } chainID, err := c.GetChainID() if err != nil { return "", err } rawTx := types.NewTx(&types.DynamicFeeTx{ ChainID: big.NewInt(int64(chainID)), Nonce: nonceAt, GasFeeCap: gasPrice, GasTipCap: gasTipCap, Gas: gasNumber, To: &contractAddress, Value: big.NewInt(0), Data: dataBytes, }) signedTx, err := types.SignTx(rawTx, types.NewLondonSigner(big.NewInt(int64(chainID))), prk) if err != nil { return "", err } err = client.SendTransaction(context.Background(), signedTx) if err != nil { return "", err } return signedTx.Hash().Hex(), nil } func (c *Client) GetRewardSignature(contractAddr, tokenAddr, accountAddr, prk string, balance *big.Int) (string, error) { datas := []byte{} chainID, err := c.GetChainID() if err != nil { return "", err } datas = append(datas, common.HexToHash(contractAddr).Bytes()...) datas = append(datas, common.BytesToHash(big.NewInt(int64(chainID)).Bytes()).Bytes()...) datas = append(datas, common.HexToHash(tokenAddr).Bytes()...) datas = append(datas, common.HexToHash(accountAddr).Bytes()...) datas = append(datas, common.BytesToHash(balance.Bytes()).Bytes()...) dataByteHash := crypto.Keccak256Hash( datas, ) signature, err := c.SignWithEthereum(prk, dataByteHash.Bytes()) if err != nil { return "", err } return signature, nil } func (c *Client) getErc20Instance(contractAddr common.Address) (*erc20.Erc20, error) { client, err := c.getClient() if err != nil { return nil, err } instance, err := erc20.NewErc20(contractAddr, client) if err != nil { return nil, err } return instance, nil } func (c *Client) Erc20Allowance(erc20Addr string, addr string, spender string) (*big.Int, error) { if !common.IsHexAddress(erc20Addr) { return nil, errors.New("erc20Addr is invalid") } if !common.IsHexAddress(addr) { return nil, errors.New("addr is invalid") } if !common.IsHexAddress(spender) { return nil, errors.New("spender is invalid") } instance, err := c.getErc20Instance(helpers.HexToAddress(erc20Addr)) if err != nil { return nil, err } balance, err := instance.Allowance(&bind.CallOpts{}, helpers.HexToAddress(addr), helpers.HexToAddress(spender)) if err != nil { return nil, err } return balance, nil } func (c *Client) Erc20ApproveMaxData(toAddr string) ([]byte, error) { instanceABI, err := abi.JSON(strings.NewReader(erc20.Erc20ABI)) if err != nil { return nil, err } amount, _ := new(big.Int).SetString("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", 16) dataBytes, err := instanceABI.Pack( "approve", helpers.HexToAddress(toAddr), amount, ) if err != nil { return nil, err } return dataBytes, nil } func (c *Client) Erc20ApproveMax(erc20Addr string, prkHex string, toAddr string) (string, error) { if erc20Addr == "" || !common.IsHexAddress(erc20Addr) { return "", errors.New("erc20Addr is invalid") } if toAddr == "" || !common.IsHexAddress(toAddr) { return "", errors.New("toAddr is invalid") } pbkHex, prk, err := c.parsePrkAuth(prkHex) if err != nil { return "", err } gasPrice, gasTipCap, err := c.GetCachedGasPriceAndTipCap() if err != nil { return "", err } client, err := c.getClient() if err != nil { return "", err } nonceAt, err := c.PendingNonceAt(context.Background(), pbkHex) if err != nil { return "", err } contractAddress := helpers.HexToAddress(erc20Addr) // EstimateGas instanceABI, err := abi.JSON(strings.NewReader(erc20.Erc20ABI)) if err != nil { return "", err } amount, _ := new(big.Int).SetString("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", 16) dataBytes, err := instanceABI.Pack( "approve", helpers.HexToAddress(toAddr), amount, ) if err != nil { return "", err } gasNumber, err := client.EstimateGas(context.Background(), ethereum.CallMsg{ From: pbkHex, To: &contractAddress, Data: dataBytes, }) if err != nil { return "", err } chainID, err := c.GetChainID() if err != nil { return "", err } rawTx := types.NewTx(&types.DynamicFeeTx{ ChainID: big.NewInt(int64(chainID)), Nonce: nonceAt, GasFeeCap: gasPrice, GasTipCap: gasTipCap, Gas: (gasNumber * 12 / 10), To: &contractAddress, Value: big.NewInt(0), Data: dataBytes, }) signedTx, err := types.SignTx(rawTx, types.NewLondonSigner(big.NewInt(int64(chainID))), prk) if err != nil { return "", err } err = client.SendTransaction(context.Background(), signedTx) if err != nil { return "", err } return signedTx.Hash().Hex(), nil } func (c *Client) GetFrom(tx *types.Transaction) (string, error) { from, err := types.Sender(types.LatestSignerForChainID(tx.ChainId()), tx) return from.String(), err } func (c *Client) GetFromFromHash(hash string) (string, error) { client, err := c.getClient() if err != nil { return "", err } tx, _, err := client.TransactionByHash(context.Background(), common.HexToHash(hash)) if err != nil { return "", err } from, err := types.Sender(types.LatestSignerForChainID(tx.ChainId()), tx) return from.String(), err } type TxResp struct { TxHash string FromAddress string ToAddrress string Amount *big.Int } func (c *Client) GetReceiveAddrsByHeight(height int64) ([]string, []*TxResp, error) { var blockInfoResp struct { Result *struct { Timestamp string `json:"timestamp"` Hash string `json:"hash"` Transactions []*struct { Hash string `json:"hash"` From string `json:"from"` To *string `json:"to"` Value *string `json:"value"` } `json:"transactions"` } `json:"result"` } err := c.postJSON( c.BaseURL, map[string]string{}, map[string]interface{}{ "jsonrpc": "2.0", "id": time.Now().UnixNano(), "method": "eth_getBlockByNumber", "params": []interface{}{ fmt.Sprintf("0x%s", big.NewInt(height).Text(16)), true, }, }, &blockInfoResp, ) if err != nil { return nil, nil, err } if blockInfoResp.Result == nil { return nil, nil, errors.New("not found") } addrMap := map[string]bool{} txResps := []*TxResp{} for _, tx := range blockInfoResp.Result.Transactions { value := big.NewInt(0) to := "" if tx.To != nil { to = strings.ToLower(*tx.To) } if tx.Value != nil { value, _ = new(big.Int).SetString((*tx.Value)[2:], 16) } if to != "" && value.Cmp(big.NewInt(0)) > 0 { addrMap[to] = true } txResps = append(txResps, &TxResp{ TxHash: tx.Hash, FromAddress: tx.From, ToAddrress: to, Amount: value, }) } addrs := []string{} for addr := range addrMap { addrs = append(addrs, strings.ToLower(addr)) } return addrs, txResps, nil } func (c *Client) InscribeTxs(txHashs []string) (string, error) { if c.BTCL1 { txHash, err := func() (string, error) { var feeResp struct { FastestFee int `json:"fastestFee"` } err := helpers.CurlURL( "https://mempool.space/api/v1/fees/recommended", http.MethodGet, map[string]string{}, nil, &feeResp, ) if err != nil { return "", err } if feeResp.FastestFee == 0 { return "", errs.NewError(fmt.Errorf("fastest_fee is zero")) } var resp struct { Result string `json:"result"` } err = c.postJSON( c.BaseURL, map[string]string{}, map[string]interface{}{ "id": 1, "jsonrpc": "1.0", "method": "eth_inscribeBatchTxsWithTargetFeeRate", "params": []interface{}{ txHashs, feeResp.FastestFee, }, }, &resp, ) if err != nil { return "", err } return resp.Result, nil }() if err != nil { if c.InscribeTxsLog != nil { for _, txHash := range txHashs { c.InscribeTxsLog(txHash, "", err.Error()) } } return "", err } return txHash, nil } return "", nil } func (c *Client) Transact(contractAddr string, prkHex string, dataBytes []byte, value *big.Int) (string, error) { if value == nil { value = common.Big0 } pbkHex, prk, err := c.parsePrkAuth(prkHex) if err != nil { return "", err } gasPrice, gasTipCap, err := c.GetCachedGasPriceAndTipCap() if err != nil { return "", err } client, err := c.getClient() if err != nil { return "", err } nonceAt, err := c.PendingNonceAt(context.Background(), pbkHex) if err != nil { return "", err } var contractAddress *common.Address //contractAddr = "" , tx create new contract ,tx.To = nil if len(contractAddr) > 0 { contractAddress = new(common.Address) *contractAddress = helpers.HexToAddress(contractAddr) } gasNumber, err := client.EstimateGas(context.Background(), ethereum.CallMsg{ From: pbkHex, To: contractAddress, Data: dataBytes, Value: value, }) if err != nil { return "", err } if contractAddress == nil { gasNumber = gasNumber * 2 } chainID, err := c.GetChainID() if err != nil { return "", err } rawTx := types.NewTx(&types.DynamicFeeTx{ ChainID: big.NewInt(int64(chainID)), Nonce: nonceAt, GasFeeCap: gasPrice, GasTipCap: gasTipCap, Gas: (gasNumber * 12 / 10), To: contractAddress, Data: dataBytes, Value: value, }) signedTx, err := types.SignTx(rawTx, types.NewLondonSigner(big.NewInt(int64(chainID))), prk) if err != nil { return "", err } err = client.SendTransaction(context.Background(), signedTx) if err != nil { return "", err } _, err = c.InscribeTxs([]string{signedTx.Hash().Hex()}) if err != nil { return "", err } return signedTx.Hash().Hex(), nil } func (c *Client) IsContract(address string) (bool, error) { client, err := c.getClient() if err != nil { return false, err } bytecode, err := client.CodeAt(context.Background(), helpers.HexToAddress(address), nil) // nil is latest block if err != nil { return false, err } isContract := len(bytecode) > 0 return isContract, nil } func (c *Client) CheckTxPendingByHash(txHash common.Hash) (*RPCResponse, bool, error) { jsonData := "{\"jsonrpc\":\"2.0\",\"method\":\"eth_getTransactionByHash\",\"params\":[\"" + txHash.Hex() + "\"],\"id\":1}" resp, err := http.Post(c.BaseURL, "application/json", bytes.NewBuffer([]byte(jsonData))) if err != nil { return nil, false, err } defer resp.Body.Close() if resp.StatusCode != http.StatusOK { return nil, false, fmt.Errorf("status code :%v = 200", resp.StatusCode) } body, err := io.ReadAll(resp.Body) if err != nil { return nil, false, err } var rpcResponse RPCResponse err = json.Unmarshal(body, &rpcResponse) if err != nil { return nil, false, err } if rpcResponse.Result == nil { return nil, false, ethereum.NotFound } return &rpcResponse, rpcResponse.Result.BlockHash == nil, nil } func (c *Client) ConvertAddressForIn(addr string) string { chainID, err := c.GetChainID() if err != nil { panic(err) } if chainID == 728126428 { return trxapi.AddrTronToEvm(addr) } return addr } func (c *Client) ConvertAddressForOut(addr string) string { chainID, err := c.GetChainID() if err != nil { panic(err) } if chainID == 728126428 { return trxapi.AddrEvmToTron(addr) } return addr } func (c *Client) GetSignatureTimestamp(prk string, timestamp int64) (string, error) { datas := []byte{} datas = append(datas, common.BytesToHash(big.NewInt(int64(timestamp)).Bytes()).Bytes()...) dataByteHash := crypto.Keccak256Hash( datas, ) signature, err := c.SignWithEthereum(prk, dataByteHash.Bytes()) if err != nil { return "", err } return signature, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/ethapi/dagent721.go ================================================ package ethapi import ( "context" "math/big" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/helpers" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/binds/dagent721" "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" ) func (c *Client) Dagent721Mint(contractAddr string, prkHex string, to common.Address, uri string, data []byte, fee *big.Int, promptKey string, promptScheduler common.Address, modelId uint32) (string, error) { pbkHex, prk, err := c.parsePrkAuth(prkHex) if err != nil { return "", err } gasPrice, err := c.getGasPrice() if err != nil { return "", err } client, err := c.getClient() if err != nil { return "", err } instanceABI, err := dagent721.Dagent721MetaData.GetAbi() if err != nil { return "", err } dataBytes, err := instanceABI.Pack( "mint", to, uri, data, fee, promptKey, promptScheduler, modelId, ) if err != nil { return "", err } contractAddress := helpers.HexToAddress(contractAddr) chainID, err := c.GetChainID() if err != nil { return "", err } var gasNumber uint64 if chainID == 964 { _, err = client.EstimateGas(context.Background(), ethereum.CallMsg{ From: pbkHex, To: &contractAddress, Data: dataBytes, Value: common.Big0, }) if err != nil { return "", err } gasNumber = 1000000 } else { gasNumber, err = client.EstimateGas(context.Background(), ethereum.CallMsg{ From: pbkHex, To: &contractAddress, Data: dataBytes, Value: common.Big0, }) if err != nil { return "", err } } nonceAt, err := c.PendingNonceAt(context.Background(), pbkHex) if err != nil { return "", err } rawTx := types.NewTx( &types.LegacyTx{ Nonce: nonceAt, GasPrice: gasPrice, Gas: (gasNumber * 2), To: &contractAddress, Value: common.Big0, Data: dataBytes, }) signedTx, err := types.SignTx(rawTx, types.NewLondonSigner(big.NewInt(int64(chainID))), prk) if err != nil { return "", err } err = client.SendTransaction(context.Background(), signedTx) if err != nil { return "", err } _, err = c.InscribeTxs([]string{signedTx.Hash().Hex()}) if err != nil { return "", err } return signedTx.Hash().Hex(), nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/ethapi/daotoken.go ================================================ package ethapi import ( "math/big" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/binds/daotoken" "github.com/ethereum/go-ethereum/accounts/abi/bind" ) func (c *Client) DeployDAOTToken(prkHex string, name string, symbol string) (string, string, error) { _, prk, err := c.parsePrkAuth(prkHex) if err != nil { return "", "", err } chainID, err := c.GetChainID() if err != nil { return "", "", err } auth, err := bind.NewKeyedTransactorWithChainID(prk, big.NewInt(int64(chainID))) if err != nil { return "", "", err } client, err := c.getClient() if err != nil { return "", "", err } gasPrice, err := c.getGasPrice() if err != nil { return "", "", err } auth.GasPrice = gasPrice address, tx, _, err := daotoken.DeployDAOToken(auth, client, name, symbol) if err != nil { return "", "", err } return address.Hex(), tx.Hash().Hex(), nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/ethapi/daotreasury.go ================================================ package ethapi import ( "context" "math/big" "strings" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/helpers" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/binds/daotreasury" "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" ) func (c *Client) DeployDAOTreasury(prkHex string) (string, string, error) { _, prk, err := c.parsePrkAuth(prkHex) if err != nil { return "", "", err } chainID, err := c.GetChainID() if err != nil { return "", "", err } auth, err := bind.NewKeyedTransactorWithChainID(prk, big.NewInt(int64(chainID))) if err != nil { return "", "", err } client, err := c.getClient() if err != nil { return "", "", err } gasPrice, err := c.getGasPrice() if err != nil { return "", "", err } auth.GasPrice = gasPrice address, tx, _, err := daotreasury.DeployDAOTreasury(auth, client) if err != nil { return "", "", err } return address.Hex(), tx.Hash().Hex(), nil } func (c *Client) DAOTreasuryInitializeData(positionManager common.Address, baseToken common.Address) ([]byte, error) { instanceABI, err := abi.JSON(strings.NewReader(daotreasury.DAOTreasuryABI)) if err != nil { return nil, err } dataBytes, err := instanceABI.Pack( "initialize", positionManager, baseToken, ) if err != nil { return nil, err } return dataBytes, nil } func (c *Client) DAOTreasurySettleFund(contractAddr string, prkHex string, fundBalance *big.Int) (string, error) { pbkHex, prk, err := c.parsePrkAuth(prkHex) if err != nil { return "", err } gasPrice, gasTipCap, err := c.GetCachedGasPriceAndTipCap() if err != nil { return "", err } client, err := c.getClient() if err != nil { return "", err } instanceABI, err := daotreasury.DAOTreasuryMetaData.GetAbi() if err != nil { return "", err } dataBytes, err := instanceABI.Pack( "settleFund", fundBalance, ) if err != nil { return "", err } contractAddress := helpers.HexToAddress(contractAddr) value := big.NewInt(0) gasNumber, err := client.EstimateGas(context.Background(), ethereum.CallMsg{ From: pbkHex, To: &contractAddress, Data: dataBytes, Value: value, }) if err != nil { return "", err } chainID, err := c.GetChainID() if err != nil { return "", err } nonceAt, err := c.PendingNonceAt(context.Background(), pbkHex) if err != nil { return "", err } rawTx := types.NewTx(&types.DynamicFeeTx{ ChainID: big.NewInt(int64(chainID)), Nonce: nonceAt, GasFeeCap: gasPrice, GasTipCap: gasTipCap, Gas: (gasNumber * 2), To: &contractAddress, Value: value, Data: dataBytes, }) signedTx, err := types.SignTx(rawTx, types.NewLondonSigner(big.NewInt(int64(chainID))), prk) if err != nil { return "", err } err = client.SendTransaction(context.Background(), signedTx) if err != nil { return "", err } _, err = c.InscribeTxs([]string{signedTx.Hash().Hex()}) if err != nil { return "", err } return signedTx.Hash().Hex(), nil } func (c *Client) DAOTreasuryAddLiquidity(contractAddr string, prkHex string, daoToken common.Address) (string, error) { pbkHex, prk, err := c.parsePrkAuth(prkHex) if err != nil { return "", err } gasPrice, gasTipCap, err := c.GetCachedGasPriceAndTipCap() if err != nil { return "", err } client, err := c.getClient() if err != nil { return "", err } instanceABI, err := daotreasury.DAOTreasuryMetaData.GetAbi() if err != nil { return "", err } dataBytes, err := instanceABI.Pack( "addLiqidity", daoToken, ) if err != nil { return "", err } contractAddress := helpers.HexToAddress(contractAddr) value := big.NewInt(0) gasNumber, err := client.EstimateGas(context.Background(), ethereum.CallMsg{ From: pbkHex, To: &contractAddress, Data: dataBytes, Value: value, }) if err != nil { return "", err } chainID, err := c.GetChainID() if err != nil { return "", err } nonceAt, err := c.PendingNonceAt(context.Background(), pbkHex) if err != nil { return "", err } rawTx := types.NewTx(&types.DynamicFeeTx{ ChainID: big.NewInt(int64(chainID)), Nonce: nonceAt, GasFeeCap: gasPrice, GasTipCap: gasTipCap, Gas: (gasNumber * 2), To: &contractAddress, Value: value, Data: dataBytes, }) signedTx, err := types.SignTx(rawTx, types.NewLondonSigner(big.NewInt(int64(chainID))), prk) if err != nil { return "", err } err = client.SendTransaction(context.Background(), signedTx) if err != nil { return "", err } _, err = c.InscribeTxs([]string{signedTx.Hash().Hex()}) if err != nil { return "", err } return signedTx.Hash().Hex(), nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/ethapi/erc20.go ================================================ package ethapi import ( "context" "errors" "math/big" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/helpers" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/binds/erc1155" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/binds/erc20" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/binds/erc721" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" ) func (c *Client) Erc20Symbol(erc20Addr string) (string, error) { if !common.IsHexAddress(erc20Addr) { return "", errors.New("erc20Addr is invalid") } client, err := c.getClient() if err != nil { return "", err } instance, err := erc20.NewErc20(helpers.HexToAddress(erc20Addr), client) if err != nil { return "", err } symbol, err := instance.Symbol(&bind.CallOpts{}) if err != nil { return "", err } return symbol, nil } type Erc20InfoResp struct { Symbol string `json:"symbol"` Name string `json:"name"` TotalSuply *big.Int `json:"total_suply"` Decimals int `json:"decimals"` } func (c *Client) Erc20Info(erc20Addr string) (*Erc20InfoResp, error) { if !common.IsHexAddress(erc20Addr) { return nil, errors.New("erc20Addr is invalid") } client, err := c.getClient() if err != nil { return nil, err } instance, err := erc20.NewErc20(helpers.HexToAddress(erc20Addr), client) if err != nil { return nil, err } name, err := instance.Name(&bind.CallOpts{}) if err != nil { return nil, err } symbol, err := instance.Symbol(&bind.CallOpts{}) if err != nil { return nil, err } totalSupply, err := instance.TotalSupply(&bind.CallOpts{}) if err != nil { return nil, err } decimals, err := instance.Decimals(&bind.CallOpts{}) if err != nil { return nil, err } return &Erc20InfoResp{ Symbol: symbol, Name: name, TotalSuply: totalSupply, Decimals: int(decimals), }, nil } func (c *Client) Erc20Balance(erc20Addr string, addr string) (*big.Int, error) { if !common.IsHexAddress(erc20Addr) { return nil, errors.New("erc20Addr is invalid") } if !common.IsHexAddress(addr) { return nil, errors.New("addr is invalid") } client, err := c.getClient() if err != nil { return nil, err } instance, err := erc20.NewErc20(helpers.HexToAddress(erc20Addr), client) if err != nil { return nil, err } balance, err := instance.BalanceOf(&bind.CallOpts{}, helpers.HexToAddress(addr)) if err != nil { return nil, err } return balance, nil } func (c *Client) NftOwnerOf(nftAddr string, tokenID string) (string, error) { client, err := c.getClient() if err != nil { return "", err } nftContract, err := erc721.NewErc721(helpers.HexToAddress(nftAddr), client) if err != nil { return "", err } tokenIDInt, ok := big.NewInt(0).SetString(tokenID, 10) if !ok { return "", errors.New("bad token id") } res, err := nftContract.OwnerOf(&bind.CallOpts{}, tokenIDInt) if err != nil { return "", err } return res.Hex(), nil } func (c *Client) Balance(addr string) (*big.Int, error) { if !common.IsHexAddress(addr) { return nil, errors.New("addr is invalid") } client, err := c.getClient() if err != nil { return nil, err } balance, err := client.BalanceAt(context.Background(), helpers.HexToAddress(addr), nil) if err != nil { return nil, err } return balance, nil } func (c *Client) Erc1155Balance(erc20Addr string, tokenId string, addr string) (*big.Int, error) { if !common.IsHexAddress(erc20Addr) { return nil, errors.New("erc20Addr is invalid") } if !common.IsHexAddress(addr) { return nil, errors.New("addr is invalid") } tokenIdVal, ok := big.NewInt(0).SetString(tokenId, 10) if !ok { return nil, errors.New("tokenId is invalid") } client, err := c.getClient() if err != nil { return nil, err } instance, err := erc1155.NewERC1155(helpers.HexToAddress(erc20Addr), client) if err != nil { return nil, err } balance, err := instance.BalanceOf(&bind.CallOpts{}, helpers.HexToAddress(addr), tokenIdVal) if err != nil { return nil, err } return balance, nil } func (c *Client) Erc1155IsApprovedForAll(erc20Addr string, addr string, operator string) (bool, error) { if !common.IsHexAddress(erc20Addr) { return false, errors.New("erc20Addr is invalid") } if !common.IsHexAddress(addr) { return false, errors.New("addr is invalid") } client, err := c.getClient() if err != nil { return false, err } instance, err := erc1155.NewERC1155(helpers.HexToAddress(erc20Addr), client) if err != nil { return false, err } balance, err := instance.IsApprovedForAll(&bind.CallOpts{}, helpers.HexToAddress(addr), helpers.HexToAddress(operator)) if err != nil { return false, err } return balance, nil } func (c *Client) Erc20ApproveMaxCheck(contractAddr string, prkHex string, spender common.Address) (string, error) { pbkHex, _, err := c.parsePrkAuth(prkHex) if err != nil { return "", err } allowance, err := c.Erc20Allowance(contractAddr, pbkHex.Hex(), spender.Hex()) if err != nil { return "", err } if allowance.Cmp(common.Big0) <= 0 { approveHash, err := c.Erc20ApproveMax( contractAddr, prkHex, spender.Hex(), ) if err != nil { return "", err } return approveHash, nil } return "", nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/ethapi/erc20realworldagent.go ================================================ package ethapi import ( "context" "math/big" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/helpers" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/binds/erc20realworldagent" "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" ) func (c *Client) DeployERC20RealWorldAgent(prkHex string, name string, symbol string, amount *big.Int, recipient common.Address, minFeeToUse *big.Int, timeout uint32, tokenFee common.Address, worker common.Address) (string, string, error) { _, prk, err := c.parsePrkAuth(prkHex) if err != nil { return "", "", err } chainID, err := c.GetChainID() if err != nil { return "", "", err } auth, err := bind.NewKeyedTransactorWithChainID(prk, big.NewInt(int64(chainID))) if err != nil { return "", "", err } client, err := c.getClient() if err != nil { return "", "", err } gasPrice, err := c.getGasPrice() if err != nil { return "", "", err } auth.GasPrice = gasPrice address, tx, _, err := erc20realworldagent.DeployERC20RealWorldAgent(auth, client, name, symbol, amount, recipient, minFeeToUse, timeout, tokenFee, worker) if err != nil { return "", "", err } return address.Hex(), tx.Hash().Hex(), nil } func (c *Client) ERC20RealWorldAgentSubmitSolution(contractAddr string, prkHex string, actId *big.Int, result []byte) (string, error) { pbkHex, prk, err := c.parsePrkAuth(prkHex) if err != nil { return "", err } gasPrice, gasTipCap, err := c.GetCachedGasPriceAndTipCap() if err != nil { return "", err } client, err := c.getClient() if err != nil { return "", err } instanceABI, err := erc20realworldagent.ERC20RealWorldAgentMetaData.GetAbi() if err != nil { return "", err } dataBytes, err := instanceABI.Pack( "submitSolution", actId, result, ) if err != nil { return "", err } contractAddress := helpers.HexToAddress(contractAddr) value := big.NewInt(0) gasNumber, err := client.EstimateGas(context.Background(), ethereum.CallMsg{ From: pbkHex, To: &contractAddress, Data: dataBytes, Value: value, }) if err != nil { return "", err } chainID, err := c.GetChainID() if err != nil { return "", err } nonceAt, err := c.PendingNonceAt(context.Background(), pbkHex) if err != nil { return "", err } rawTx := types.NewTx(&types.DynamicFeeTx{ ChainID: big.NewInt(int64(chainID)), Nonce: nonceAt, GasFeeCap: gasPrice, GasTipCap: gasTipCap, Gas: (gasNumber * 2), To: &contractAddress, Value: value, Data: dataBytes, }) signedTx, err := types.SignTx(rawTx, types.NewLondonSigner(big.NewInt(int64(chainID))), prk) if err != nil { return "", err } err = client.SendTransaction(context.Background(), signedTx) if err != nil { return "", err } _, err = c.InscribeTxs([]string{signedTx.Hash().Hex()}) if err != nil { return "", err } return signedTx.Hash().Hex(), nil } func (c *Client) ERC20RealWorldAgentAct(contractAddr string, prkHex string, uuid [32]byte, data []byte) (string, error) { pbkHex, prk, err := c.parsePrkAuth(prkHex) if err != nil { return "", err } gasPrice, gasTipCap, err := c.GetCachedGasPriceAndTipCap() if err != nil { return "", err } client, err := c.getClient() if err != nil { return "", err } instance, err := erc20realworldagent.NewERC20RealWorldAgent(common.HexToAddress(contractAddr), client) if err != nil { return "", err } dataHash, err := instance.GetHashToSign(&bind.CallOpts{}, uuid, data) if err != nil { return "", err } signature, err := c.Sign(prkHex, dataHash) if err != nil { return "", err } instanceABI, err := erc20realworldagent.ERC20RealWorldAgentMetaData.GetAbi() if err != nil { return "", err } dataBytes, err := instanceABI.Pack( "act0", uuid, data, signature, ) if err != nil { return "", err } contractAddress := helpers.HexToAddress(contractAddr) value := big.NewInt(0) gasNumber, err := client.EstimateGas(context.Background(), ethereum.CallMsg{ From: pbkHex, To: &contractAddress, Data: dataBytes, Value: value, }) if err != nil { return "", err } chainID, err := c.GetChainID() if err != nil { return "", err } nonceAt, err := c.PendingNonceAt(context.Background(), pbkHex) if err != nil { return "", err } rawTx := types.NewTx(&types.DynamicFeeTx{ ChainID: big.NewInt(int64(chainID)), Nonce: nonceAt, GasFeeCap: gasPrice, GasTipCap: gasTipCap, Gas: (gasNumber * 2), To: &contractAddress, Value: value, Data: dataBytes, }) signedTx, err := types.SignTx(rawTx, types.NewLondonSigner(big.NewInt(int64(chainID))), prk) if err != nil { return "", err } err = client.SendTransaction(context.Background(), signedTx) if err != nil { return "", err } _, err = c.InscribeTxs([]string{signedTx.Hash().Hex()}) if err != nil { return "", err } return signedTx.Hash().Hex(), nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/ethapi/erc20utilityagent.go ================================================ package ethapi import ( "errors" "math/big" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/helpers" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/binds/erc20utilityagent" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" ) func (c *Client) DeployERC20UtilityAgent(prkHex string, name string, symbol string, amount *big.Int, recipient common.Address, systemPrompt string, storageInfo []byte) (string, string, error) { _, prk, err := c.parsePrkAuth(prkHex) if err != nil { return "", "", err } chainID, err := c.GetChainID() if err != nil { return "", "", err } auth, err := bind.NewKeyedTransactorWithChainID(prk, big.NewInt(int64(chainID))) if err != nil { return "", "", err } client, err := c.getClient() if err != nil { return "", "", err } gasPrice, err := c.getGasPrice() if err != nil { return "", "", err } auth.GasPrice = gasPrice address, tx, _, err := erc20utilityagent.DeployERC20UtilityAgent(auth, client, name, symbol, amount, recipient, systemPrompt, storageInfo) if err != nil { return "", "", err } return address.Hex(), tx.Hash().Hex(), nil } func (c *Client) ERC20UtilityAgentFetchCode(contractAddress string) (string, error) { if !common.IsHexAddress(contractAddress) { return "", errors.New("erc20Addr is invalid") } client, err := c.getClient() if err != nil { return "", err } instance, err := erc20utilityagent.NewERC20UtilityAgent(helpers.HexToAddress(contractAddress), client) if err != nil { return "", err } resp, err := instance.FetchCode(&bind.CallOpts{}) if err != nil { return "", err } return resp, nil } func (c *Client) ERC20UtilityAgentGetStorageInfo(contractAddress string) (*erc20utilityagent.IUtilityAgentStorageInfo, error) { if !common.IsHexAddress(contractAddress) { return nil, errors.New("erc20Addr is invalid") } client, err := c.getClient() if err != nil { return nil, err } instance, err := erc20utilityagent.NewERC20UtilityAgent(helpers.HexToAddress(contractAddress), client) if err != nil { return nil, err } resp, err := instance.GetStorageInfo(&bind.CallOpts{}) if err != nil { return nil, err } return &resp, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/ethapi/erc721.go ================================================ package ethapi import ( "context" "errors" "math/big" "strings" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/helpers" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/binds/erc721" "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" ) func (c *Client) Erc721Transfer(contractAddr string, prkHex string, toAddr string, tokenId *big.Int) (string, error) { if contractAddr == "" || !common.IsHexAddress(contractAddr) { return "", errors.New("erc20Addr is invalid") } if toAddr == "" || !common.IsHexAddress(toAddr) { return "", errors.New("toAddr is invalid") } pbkHex, prk, err := c.parsePrkAuth(prkHex) if err != nil { return "", err } gasPrice, gasTipCap, err := c.GetCachedGasPriceAndTipCap() if err != nil { return "", err } client, err := c.getClient() if err != nil { return "", err } nonceAt, err := c.PendingNonceAt(context.Background(), pbkHex) if err != nil { return "", err } contractAddress := helpers.HexToAddress(contractAddr) instanceABI, err := abi.JSON(strings.NewReader(erc721.Erc721ABI)) if err != nil { return "", err } dataBytes, err := instanceABI.Pack( "safeTransferFrom", pbkHex, helpers.HexToAddress(toAddr), tokenId, ) if err != nil { return "", err } gasNumber, err := client.EstimateGas(context.Background(), ethereum.CallMsg{ From: pbkHex, To: &contractAddress, Data: dataBytes, }) if err != nil { return "", err } chainID, err := c.GetChainID() if err != nil { return "", err } rawTx := types.NewTx(&types.DynamicFeeTx{ ChainID: big.NewInt(int64(chainID)), Nonce: nonceAt, GasFeeCap: gasPrice, GasTipCap: gasTipCap, Gas: gasNumber, To: &contractAddress, Value: big.NewInt(0), Data: dataBytes, }) signedTx, err := types.SignTx(rawTx, types.NewLondonSigner(big.NewInt(int64(chainID))), prk) if err != nil { return "", err } err = client.SendTransaction(context.Background(), signedTx) if err != nil { return "", err } return signedTx.Hash().Hex(), nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/ethapi/ethereum_swapv3.go ================================================ package ethapi import ( "context" "math/big" "strings" "time" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/helpers" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/binds/ethereumnonfungiblepositionmanager" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/binds/memenonfungiblepositionmanager" "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" ) func (c *Client) EthereumNonfungiblePositionManagerMint(contractAddr string, privateHex string, weth9 common.Address, sqrtPriceX96 *big.Int, params *ethereumnonfungiblepositionmanager.INonfungiblePositionManagerMintParams) (string, error) { addressHex, prk, err := c.parsePrkAuth(privateHex) if err != nil { return "", err } gasPrice, gasTipCap, err := c.GetCachedGasPriceAndTipCap() if err != nil { return "", err } client, err := c.getClient() if err != nil { return "", err } value := big.NewInt(0) if !strings.EqualFold(weth9.Hex(), params.Token0.Hex()) { if params.Amount0Desired.Cmp(big.NewInt(0)) > 0 { allowance, err := c.Erc20Allowance(params.Token0.Hex(), addressHex.Hex(), contractAddr) if err != nil { return "", err } if allowance.Cmp(big.NewInt(0)) <= 0 { approveHash, err := c.Erc20ApproveMax( params.Token0.Hex(), privateHex, contractAddr, ) if err != nil { return "", err } time.Sleep(30 * time.Second) err = c.WaitMined(approveHash) if err != nil { return "", err } } } } else { value = params.Amount0Desired } if !strings.EqualFold(weth9.Hex(), params.Token1.Hex()) { if params.Amount1Desired.Cmp(big.NewInt(0)) > 0 { allowance, err := c.Erc20Allowance(params.Token1.Hex(), addressHex.Hex(), contractAddr) if err != nil { return "", err } if allowance.Cmp(big.NewInt(0)) <= 0 { approveHash, err := c.Erc20ApproveMax( params.Token1.Hex(), privateHex, contractAddr, ) if err != nil { return "", err } time.Sleep(30 * time.Second) err = c.WaitMined(approveHash) if err != nil { return "", err } } } } else { value = params.Amount1Desired } contractAddress := helpers.HexToAddress(contractAddr) // EstimateGas instanceABI, err := abi.JSON(strings.NewReader(memenonfungiblepositionmanager.NonfungiblePositionManagerABI)) if err != nil { return "", err } multicallBytes := [][]byte{} { multicallData, err := instanceABI.Pack( "createAndInitializePoolIfNecessary", params.Token0, params.Token1, params.Fee, sqrtPriceX96, ) if err != nil { return "", err } multicallBytes = append( multicallBytes, multicallData, ) } { multicallData, err := instanceABI.Pack( "mint", memenonfungiblepositionmanager.INonfungiblePositionManagerMintParams{ Token0: params.Token0, Token1: params.Token1, Fee: params.Fee, TickLower: params.TickLower, TickUpper: params.TickUpper, Amount0Desired: params.Amount0Desired, Amount1Desired: params.Amount1Desired, Amount0Min: params.Amount0Min, Amount1Min: params.Amount1Min, Recipient: addressHex, Deadline: params.Deadline, }, ) if err != nil { return "", err } multicallBytes = append( multicallBytes, multicallData, ) } if strings.EqualFold(weth9.Hex(), params.Token0.Hex()) || strings.EqualFold(weth9.Hex(), params.Token1.Hex()) { multicallData, err := instanceABI.Pack( "refundETH", ) if err != nil { return "", err } multicallBytes = append( multicallBytes, multicallData, ) } dataBytes, err := instanceABI.Pack( "multicall", multicallBytes, ) if err != nil { return "", err } gasNumber, err := client.EstimateGas(context.Background(), ethereum.CallMsg{ From: addressHex, To: &contractAddress, Data: dataBytes, Value: value, }) if err != nil { return "", err } chainID, err := c.GetChainID() if err != nil { return "", err } nonceAt, err := c.PendingNonceAt(context.Background(), addressHex) if err != nil { return "", err } rawTx := types.NewTx(&types.DynamicFeeTx{ ChainID: big.NewInt(int64(chainID)), Nonce: nonceAt, GasFeeCap: gasPrice, GasTipCap: gasTipCap, Gas: (gasNumber * 12 / 10), To: &contractAddress, Value: value, Data: dataBytes, }) signedTx, err := types.SignTx(rawTx, types.NewLondonSigner(big.NewInt(int64(chainID))), prk) if err != nil { return "", err } err = client.SendTransaction(context.Background(), signedTx) if err != nil { return "", err } return signedTx.Hash().Hex(), nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/ethapi/events.go ================================================ package ethapi import ( "context" "math/big" "time" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/helpers" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/binds/agentfactory" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/binds/agentshares" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/binds/agentupgradeable" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/binds/arbitrumfactory" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/binds/arbitrumnonfungiblepositionmanager" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/binds/basenonfungiblepositionmanager" brigde "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/binds/bridge" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/binds/erc1155" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/binds/erc20" realworldagent "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/binds/erc20realworldagent" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/binds/erc721" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/binds/imagehub" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/binds/iworkerhub" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/binds/systempromptmanager" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/binds/uniswapv3factory" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/binds/uniswapv3pool" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/binds/vibetokenfactory" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/binds/wbvm" "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" ) type RealWorldAgentExecutionRequested struct { TxHash string `json:"tx_hash"` ContractAddress string `json:"contract_address"` Timestamp uint64 `json:"timestamp"` Index uint `json:"log_index"` TxIndex uint `json:"tx_index"` BlockNumber uint64 `json:"block_number"` ActId *big.Int `json:"act_id"` Uuid string `json:"uuid"` Creator string `json:"creator"` Data string `json:"data"` } type BridgeMint struct { TxHash string `json:"tx_hash"` ContractAddress string `json:"contract_address"` Timestamp uint64 `json:"timestamp"` Index uint `json:"log_index"` TxIndex uint `json:"tx_index"` BlockNumber uint64 `json:"block_number"` Tokens []string `json:"tokens"` Recipients []string `json:"recipients"` Amounts []*big.Int `json:"amounts"` } type BridgeWithdraw struct { TxHash string `json:"tx_hash"` ContractAddress string `json:"contract_address"` Timestamp uint64 `json:"timestamp"` Index uint `json:"log_index"` TxIndex uint `json:"tx_index"` BlockNumber uint64 `json:"block_number"` Token string `json:"token"` Burner string `json:"burner"` Amount *big.Int `json:"amount"` Extddr string `json:"extddr"` DestChainId *big.Int `json:"dest_chain_id"` } type ImageHubImageTipTransferred struct { NetworkID uint64 `json:"network_id"` TxHash string `json:"tx_hash"` ContractAddress string `json:"contract_address"` Timestamp uint64 `json:"timestamp"` Index uint `json:"log_index"` TxIndex uint `json:"tx_index"` BlockNumber uint64 `json:"block_number"` User string Creator string ImageId *big.Int Amount *big.Int Fee *big.Int } type ImageHubSubscriptionPriceUpdated struct { NetworkID uint64 `json:"network_id"` TxHash string `json:"tx_hash"` ContractAddress string `json:"contract_address"` Timestamp uint64 `json:"timestamp"` Index uint `json:"log_index"` TxIndex uint `json:"tx_index"` BlockNumber uint64 `json:"block_number"` Creator string Duration *big.Int Price *big.Int } type ImageHubSubscriptionRegistered struct { NetworkID uint64 `json:"network_id"` TxHash string `json:"tx_hash"` ContractAddress string `json:"contract_address"` Timestamp uint64 `json:"timestamp"` Index uint `json:"log_index"` TxIndex uint `json:"tx_index"` BlockNumber uint64 `json:"block_number"` User string Creator string Duration *big.Int Price *big.Int } type ImageHubSubscriptionCharged struct { NetworkID uint64 `json:"network_id"` TxHash string `json:"tx_hash"` ContractAddress string `json:"contract_address"` Timestamp uint64 `json:"timestamp"` Index uint `json:"log_index"` TxIndex uint `json:"tx_index"` BlockNumber uint64 `json:"block_number"` User string Creator string Duration *big.Int ExpiredAt *big.Int Amount *big.Int Fee *big.Int } type WorkerHubNewInference struct { NetworkID uint64 `json:"network_id"` TxHash string `json:"tx_hash"` ContractAddress string `json:"contract_address"` Timestamp uint64 `json:"timestamp"` Index uint `json:"log_index"` TxIndex uint `json:"tx_index"` BlockNumber uint64 `json:"block_number"` InferenceId *big.Int `json:"inference_id"` Model string `json:"model"` Creator string `json:"creator"` Value *big.Int `json:"value"` } type BlockChainEventResp struct { Transfer []*Erc20TokenTransferEventResp `json:"transfer"` NftTransfer []*NftTransferEventResp `json:"nft_transfer"` ERC1155Transfer []*ERC1155ransferEventResp `json:"erc1155_transfer"` BridgeMint []*BridgeMint `json:"bridge_mint"` BridgeWithdraw []*BridgeWithdraw `json:"bridge_withdraw"` ImageHubImageTipTransferred []*ImageHubImageTipTransferred `json:"image_hub_image_tip_transferred"` ImageHubSubscriptionPriceUpdated []*ImageHubSubscriptionPriceUpdated `json:"image_hub_subscription_price_updated"` ImageHubSubscriptionRegistered []*ImageHubSubscriptionRegistered `json:"image_hub_subscription_registered"` ImageHubSubscriptionCharged []*ImageHubSubscriptionCharged `json:"image_hub_subscription_charged"` WorkerHubNewInference []*WorkerHubNewInference `json:"worker_hub_new_inference"` LastBlockNumber int64 `json:"last_block_number"` BlockNumber uint64 `json:"block_number"` MemePoolCreated []*UniswapPoolCreatedEventResp `json:"meme_pool_created"` MemeSwap []*UniswapSwapEventResp `json:"meme_swap"` MemeIncreaseLiquidity []*UniswapPositionLiquidity `json:"meme_increase_liquidity"` MemeDecreaseLiquidity []*UniswapPositionLiquidity `json:"meme_decrease_liquidity"` AgentSharesTrades []*agentshares.AgentSharesTrade `json:"agent_shares_trades"` SystemPromptManagerNewTokens []*systempromptmanager.SystemPromptManagerNewToken `json:"system_prompt_manager_new_tokens"` SystemPromptManagerAgentDataUpdates []*systempromptmanager.SystemPromptManagerAgentDataUpdate `json:"system_prompt_manager_agent_data_updates"` SystemPromptManagerAgentURIUpdates []*systempromptmanager.SystemPromptManagerAgentURIUpdate `json:"system_prompt_manager_agent_uri_updates"` RealWorldAgentExecutionRequested []*RealWorldAgentExecutionRequested `json:"real_world_agent_execution_requested"` CodePointerCreated []*agentupgradeable.AgentUpgradeableCodePointerCreated `json:"code_pointer_created"` AgentCreated []*agentfactory.AgentFactoryAgentCreated `json:"agent_created"` VibeTokenFactoryTokenDeployed []*vibetokenfactory.VibeTokenFactoryTokenDeployed `json:"vibe_token_factory_token_deployed"` } func (c *Client) NewEventResp() *BlockChainEventResp { return &BlockChainEventResp{} } func (c *Client) EventsByTransaction(txHash string) (*BlockChainEventResp, error) { resp := c.NewEventResp() client, err := c.getClient() if err != nil { return nil, err } ctx := context.Background() receipt, err := client.TransactionReceipt(ctx, common.HexToHash(txHash)) if err != nil { return nil, err } for _, log := range receipt.Logs { err = c.ParseEventResp(resp, log) if err != nil { return nil, err } } return resp, nil } func (c *Client) ScanEvents(contractAddrs []string, startBlock, endBlock int64) (*BlockChainEventResp, error) { resp := c.NewEventResp() client, err := c.getClient() if err != nil { return nil, err } var contractAddresses []common.Address if len(contractAddrs) > 0 { contractAddresses = []common.Address{} for _, contractAddr := range contractAddrs { if contractAddr != "" { contractAddresses = append(contractAddresses, helpers.HexToAddress(c.ConvertAddressForIn(contractAddr))) } } } ctx := context.Background() lastBlock, err := client.BlockNumber(ctx) if err != nil { return nil, err } lastNumber := int64(lastBlock) if endBlock > lastNumber { endBlock = lastNumber } if startBlock > endBlock { return nil, nil } resp.LastBlockNumber = lastNumber resp.BlockNumber = lastBlock logs, err := client.FilterLogs( ctx, ethereum.FilterQuery{ FromBlock: big.NewInt(startBlock), ToBlock: big.NewInt(endBlock), Addresses: contractAddresses, Topics: [][]common.Hash{ { // erc common.HexToHash("0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"), common.HexToHash("0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c"), common.HexToHash("0x7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65"), common.HexToHash("0x4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb"), common.HexToHash("0xc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62"), // imageHub common.HexToHash("0x9d239c3ad6158bc2f486c3310d25622c5250fa11f60eb415f1d5b848ac0d145e"), common.HexToHash("0xab7a1a256e1a3e6eefe1e11e862d92b2a9efd3ab45a0a0b3d330687f42021ec0"), common.HexToHash("0xe1b67d1786c6125e949791ee25291c8dc38b471ae947bf8c65433da2f31149bf"), common.HexToHash("0x0bc8ce05a473cd40acc9b6689277d1b7c59ff62cb5491e8ec926bddb9e365a36"), // workerhub common.HexToHash("0x08a84d7fb7cd1557f228c827b9280f44d1a157c3256fe453b687a7b9d51c6a5b"), // Uniswap common.HexToHash("0x783cca1c0412dd0d695e784568c96da2e9c22ff989357a2e8b1d9b2b4e6b7118"), common.HexToHash("0xc42079f94a6350d7e6235f29174924f928cc2ac818eb64fed8004e115fbcca67"), common.HexToHash("0x3067048beee31b25b2f1681f88dac838c8bba36af25bfb2b7cf7473a5847e35f"), common.HexToHash("0x26f6a048ee9138f2c0ce266f322cb99228e8d619ae2bff30c67f8dcf9d2377b4"), // AlgebraFactory common.HexToHash("0x91ccaa7a278130b65168c3a0c8d3bcae84cf5e43704342bd3ec0b59e59c036db"), common.HexToHash("0x3067048beee31b25b2f1681f88dac838c8bba36af25bfb2b7cf7473a5847e35f"), // agentShares common.HexToHash("0x12d0646903287d48eb117ac55a8bcc90d4357c4180221d5b33e83e73860440ec"), // common.HexToHash("0x61beab98a81083e3c0239c33e149bef1316ca78f15b9f29125039f5521a06d06"), common.HexToHash("0xe42abf7d4a793286da8cc1399cb577a1f5a0e133dfee371bb3a5abbdd77b011e"), common.HexToHash("0x706a4e8eb2f354c7f4d96e5ea1984f36e72482629987edad78c9940ea037c362"), //RealWorldAgent common.HexToHash("0x9096741026bdd638bcc5cb995f0f00b4574b81f120a23c4a7086347116bf58a1"), // AgentUpgradeable common.HexToHash("0x0c69de805f518c322126e1fa81f2e91d814412a2ad304638fcaed200bd7f43dc"), // AgentFactory common.HexToHash("0x7c96960a1ebd8cc753b10836ea25bd7c9c4f8cd43590db1e8b3648cb0ec4cc89"), // VibeTokenFactory common.HexToHash("0x035044c956f0f85240e40898163f0636d588d72de5fd08d79a9168d626745173"), }, }, }, ) if err != nil { return nil, err } for _, log := range logs { err = c.ParseEventResp(resp, &log) if err != nil { return nil, err } } return resp, nil } func (c *Client) ParseEventResp(resp *BlockChainEventResp, log *types.Log) error { client, err := c.getClient() if err != nil { return err } chainId, err := c.ChainID() if err != nil { return err } blockTime := uint64(time.Now().Unix()) erc20, err := erc20.NewErc20(log.Address, client) if err != nil { return err } // ParseTransfer { logParsed, err := erc20.ParseTransfer(*log) if err == nil { resp.Transfer = append( resp.Transfer, &Erc20TokenTransferEventResp{ NetworkID: chainId, TxHash: log.TxHash.Hex(), ContractAddress: c.ConvertAddressForOut(logParsed.Raw.Address.Hex()), Timestamp: blockTime, From: c.ConvertAddressForOut(logParsed.From.Hex()), To: c.ConvertAddressForOut(logParsed.To.Hex()), Value: logParsed.Value, Index: log.Index, BlockNumber: log.BlockNumber, TxIndex: log.TxIndex, }, ) } } // ParseTransfer { logParsed, err := erc20.ParseDeposit(*log) if err == nil { resp.Transfer = append( resp.Transfer, &Erc20TokenTransferEventResp{ NetworkID: chainId, TxHash: log.TxHash.Hex(), ContractAddress: logParsed.Raw.Address.Hex(), Timestamp: blockTime, From: helpers.HexToAddress("0x0000000000000000000000000000000000000000").Hex(), To: logParsed.Dst.Hex(), Value: logParsed.Wad, Index: log.Index, BlockNumber: log.BlockNumber, TxIndex: log.TxIndex, }, ) } } { logParsed, err := erc20.ParseWithdrawal(*log) if err == nil { resp.Transfer = append( resp.Transfer, &Erc20TokenTransferEventResp{ NetworkID: chainId, TxHash: log.TxHash.Hex(), ContractAddress: logParsed.Raw.Address.Hex(), Timestamp: blockTime, From: logParsed.Src.Hex(), To: helpers.HexToAddress("0x0000000000000000000000000000000000000000").Hex(), Value: logParsed.Wad, Index: log.Index, BlockNumber: log.BlockNumber, TxIndex: log.TxIndex, }, ) } } //nft transfer erc721, err := erc721.NewErc721(log.Address, client) if err != nil { return err } { logParsed, err := erc721.ParseTransfer(*log) if err == nil { resp.NftTransfer = append( resp.NftTransfer, &NftTransferEventResp{ NetworkID: chainId, TxHash: log.TxHash.Hex(), ContractAddress: logParsed.Raw.Address.Hex(), Timestamp: blockTime, From: logParsed.From.Hex(), To: logParsed.To.Hex(), TokenId: logParsed.TokenId, Index: log.Index, TxIndex: log.TxIndex, BlockNumber: log.BlockNumber, }, ) } } //erc1155 transfer erc1155, err := erc1155.NewERC1155(log.Address, client) if err != nil { return err } { logParsed, err := erc1155.ParseTransferBatch(*log) if err == nil { for index := range logParsed.Ids { resp.ERC1155Transfer = append( resp.ERC1155Transfer, &ERC1155ransferEventResp{ NetworkID: chainId, TxHash: log.TxHash.Hex(), ContractAddress: logParsed.Raw.Address.Hex(), Timestamp: blockTime, From: logParsed.From.Hex(), To: logParsed.To.Hex(), Id: logParsed.Ids[index], Value: logParsed.Values[index], }, ) } } } { logParsed, err := erc1155.ParseTransferSingle(*log) if err == nil { resp.ERC1155Transfer = append( resp.ERC1155Transfer, &ERC1155ransferEventResp{ NetworkID: chainId, TxHash: log.TxHash.Hex(), ContractAddress: logParsed.Raw.Address.Hex(), Timestamp: blockTime, From: logParsed.From.Hex(), To: logParsed.To.Hex(), Id: logParsed.Id, Value: logParsed.Value, }, ) } } // bridge, err := brigde.NewBrigde(log.Address, client) if err != nil { return err } { logParsed, err := bridge.ParseMint(*log) if err == nil { tmpObj := &BridgeMint{ TxHash: log.TxHash.Hex(), ContractAddress: logParsed.Raw.Address.Hex(), Timestamp: blockTime, Index: log.Index, TxIndex: log.TxIndex, BlockNumber: log.BlockNumber, } for i, _ := range logParsed.Tokens { tmpObj.Tokens = append(tmpObj.Tokens, logParsed.Tokens[i].Hex()) tmpObj.Recipients = append(tmpObj.Recipients, logParsed.Recipients[i].Hex()) tmpObj.Amounts = append(tmpObj.Amounts, logParsed.Amounts[i]) } resp.BridgeMint = append( resp.BridgeMint, tmpObj, ) } } { logParsed, err := bridge.ParseBridgeToken(*log) if err == nil { resp.BridgeWithdraw = append( resp.BridgeWithdraw, &BridgeWithdraw{ TxHash: log.TxHash.Hex(), ContractAddress: logParsed.Raw.Address.Hex(), Timestamp: blockTime, Index: log.Index, TxIndex: log.TxIndex, BlockNumber: log.BlockNumber, Token: logParsed.Token.Hex(), Burner: logParsed.Burner.Hex(), Amount: logParsed.Amount, Extddr: logParsed.Extddr, DestChainId: logParsed.DestChainId, }, ) } } imagehub, err := imagehub.NewImageHub(log.Address, client) if err != nil { return err } { logParsed, err := imagehub.ParseImageTipTransferred(*log) if err == nil { resp.ImageHubImageTipTransferred = append( resp.ImageHubImageTipTransferred, &ImageHubImageTipTransferred{ NetworkID: chainId, TxHash: log.TxHash.Hex(), ContractAddress: logParsed.Raw.Address.Hex(), Timestamp: blockTime, Index: log.Index, TxIndex: log.TxIndex, BlockNumber: log.BlockNumber, User: logParsed.User.Hex(), Creator: logParsed.Creator.Hex(), ImageId: logParsed.ImageId, Amount: logParsed.Amount, Fee: logParsed.Fee, }, ) } } { logParsed, err := imagehub.ParseSubscriptionPriceUpdated(*log) if err == nil { resp.ImageHubSubscriptionPriceUpdated = append( resp.ImageHubSubscriptionPriceUpdated, &ImageHubSubscriptionPriceUpdated{ NetworkID: chainId, TxHash: log.TxHash.Hex(), ContractAddress: logParsed.Raw.Address.Hex(), Timestamp: blockTime, Index: log.Index, TxIndex: log.TxIndex, BlockNumber: log.BlockNumber, Creator: logParsed.Creator.Hex(), Duration: logParsed.Duration, Price: logParsed.Price, }, ) } } { logParsed, err := imagehub.ParseSubscriptionRegistered(*log) if err == nil { resp.ImageHubSubscriptionRegistered = append( resp.ImageHubSubscriptionRegistered, &ImageHubSubscriptionRegistered{ NetworkID: chainId, TxHash: log.TxHash.Hex(), ContractAddress: logParsed.Raw.Address.Hex(), Timestamp: blockTime, Index: log.Index, TxIndex: log.TxIndex, BlockNumber: log.BlockNumber, User: logParsed.User.Hex(), Creator: logParsed.Creator.Hex(), Duration: logParsed.Duration, Price: logParsed.Price, }, ) } } { logParsed, err := imagehub.ParseSubscriptionCharged(*log) if err == nil { resp.ImageHubSubscriptionCharged = append( resp.ImageHubSubscriptionCharged, &ImageHubSubscriptionCharged{ NetworkID: chainId, TxHash: log.TxHash.Hex(), ContractAddress: logParsed.Raw.Address.Hex(), Timestamp: blockTime, Index: log.Index, TxIndex: log.TxIndex, BlockNumber: log.BlockNumber, User: logParsed.User.Hex(), Creator: logParsed.Creator.Hex(), Duration: logParsed.Duration, ExpiredAt: logParsed.ExpiredAt, Amount: logParsed.Amount, Fee: logParsed.Fee, }, ) } } // workerhub, err := iworkerhub.NewIWorkerHub(log.Address, client) if err != nil { return err } { logParsed, err := workerhub.ParseNewInference(*log) if err == nil { resp.WorkerHubNewInference = append( resp.WorkerHubNewInference, &WorkerHubNewInference{ NetworkID: chainId, TxHash: log.TxHash.Hex(), ContractAddress: logParsed.Raw.Address.Hex(), Timestamp: blockTime, Index: log.Index, TxIndex: log.TxIndex, BlockNumber: log.BlockNumber, InferenceId: logParsed.InferenceId, Model: logParsed.Model.Hex(), Creator: logParsed.Creator.Hex(), Value: logParsed.Value, }, ) } } // uniswap, err := uniswapv3factory.NewUniswapv3factory(log.Address, client) if err != nil { return err } uniswapArb, err := arbitrumfactory.NewFactory(log.Address, client) if err != nil { return err } // ParsePoolCreated { logParsed, err := uniswap.ParsePoolCreated(*log) if err == nil { resp.MemePoolCreated = append( resp.MemePoolCreated, &UniswapPoolCreatedEventResp{ TxHash: log.TxHash.Hex(), ContractAddress: logParsed.Raw.Address.Hex(), Timestamp: blockTime, Token0: logParsed.Token0.Hex(), Token1: logParsed.Token1.Hex(), Fee: logParsed.Fee, Pool: logParsed.Pool.Hex(), TickSpacing: logParsed.TickSpacing, Index: log.Index, }, ) } } { logParsed, err := uniswapArb.ParsePool(*log) if err == nil { resp.MemePoolCreated = append( resp.MemePoolCreated, &UniswapPoolCreatedEventResp{ TxHash: log.TxHash.Hex(), ContractAddress: logParsed.Raw.Address.Hex(), Timestamp: blockTime, Token0: logParsed.Token0.Hex(), Token1: logParsed.Token1.Hex(), Pool: logParsed.Pool.Hex(), Index: log.Index, }, ) } } uniswappair, err := uniswapv3pool.NewUniswapv3pool(log.Address, client) if err != nil { return err } // ParseSwap { logParsed, err := uniswappair.ParseSwap(*log) if err == nil { resp.MemeSwap = append( resp.MemeSwap, &UniswapSwapEventResp{ TxHash: log.TxHash.Hex(), ContractAddress: logParsed.Raw.Address.Hex(), Timestamp: blockTime, Sender: logParsed.Sender.Hex(), Recipient: logParsed.Recipient.Hex(), Amount0: logParsed.Amount0, Amount1: logParsed.Amount1, SqrtPriceX96: logParsed.SqrtPriceX96, Liquidity: logParsed.Liquidity, Tick: logParsed.Tick, Index: log.Index, TxIndex: log.TxIndex, BlockNumber: log.BlockNumber, // FromAddress: txFrom, }, ) } } position, err := basenonfungiblepositionmanager.NewNonfungiblePositionManager(log.Address, client) if err != nil { return err } // ParseIncreaseLiquidity { logParsed, err := position.ParseIncreaseLiquidity(*log) if err == nil { resp.MemeIncreaseLiquidity = append( resp.MemeIncreaseLiquidity, &UniswapPositionLiquidity{ TxHash: log.TxHash.Hex(), ContractAddress: logParsed.Raw.Address.Hex(), Timestamp: blockTime, Amount0: logParsed.Amount0, Amount1: logParsed.Amount1, TokenId: logParsed.TokenId, Liquidity: logParsed.Liquidity, Index: log.Index, TxIndex: log.TxIndex, BlockNumber: log.BlockNumber, }, ) } } positionArb, err := arbitrumnonfungiblepositionmanager.NewNonfungiblePositionManager(log.Address, client) if err != nil { return err } { logParsed, err := positionArb.ParseIncreaseLiquidity(*log) if err == nil { resp.MemeIncreaseLiquidity = append( resp.MemeIncreaseLiquidity, &UniswapPositionLiquidity{ TxHash: log.TxHash.Hex(), ContractAddress: logParsed.Raw.Address.Hex(), Timestamp: blockTime, Amount0: logParsed.Amount0, Amount1: logParsed.Amount1, TokenId: logParsed.TokenId, Liquidity: logParsed.Liquidity, Index: log.Index, TxIndex: log.TxIndex, BlockNumber: log.BlockNumber, }, ) } } // ParseDecreaseLiquidity { logParsed, err := position.ParseDecreaseLiquidity(*log) if err == nil { resp.MemeDecreaseLiquidity = append( resp.MemeDecreaseLiquidity, &UniswapPositionLiquidity{ TxHash: log.TxHash.Hex(), ContractAddress: logParsed.Raw.Address.Hex(), Timestamp: blockTime, Amount0: logParsed.Amount0, Amount1: logParsed.Amount1, TokenId: logParsed.TokenId, Liquidity: logParsed.Liquidity, Index: log.Index, TxIndex: log.TxIndex, BlockNumber: log.BlockNumber, }, ) } } // { instance, err := agentshares.NewAgentShares(log.Address, client) if err != nil { return err } { logParsed, err := instance.ParseTrade(*log) if err == nil { resp.AgentSharesTrades = append( resp.AgentSharesTrades, logParsed, ) } } } { instance, err := systempromptmanager.NewSystemPromptManager(log.Address, client) if err != nil { return err } { logParsed, err := instance.ParseNewToken(*log) if err == nil { resp.SystemPromptManagerNewTokens = append( resp.SystemPromptManagerNewTokens, logParsed, ) } } { logParsed, err := instance.ParseAgentDataUpdate(*log) if err == nil { resp.SystemPromptManagerAgentDataUpdates = append( resp.SystemPromptManagerAgentDataUpdates, logParsed, ) } } { logParsed, err := instance.ParseAgentURIUpdate(*log) if err == nil { resp.SystemPromptManagerAgentURIUpdates = append( resp.SystemPromptManagerAgentURIUpdates, logParsed, ) } } } //realworld agent infra, err := realworldagent.NewERC20RealWorldAgent(log.Address, client) if err != nil { return err } { logParsed, err := infra.ParseExecutionRequested(*log) if err == nil { resp.RealWorldAgentExecutionRequested = append( resp.RealWorldAgentExecutionRequested, &RealWorldAgentExecutionRequested{ TxHash: log.TxHash.Hex(), ContractAddress: logParsed.Raw.Address.Hex(), Timestamp: blockTime, Index: log.Index, TxIndex: log.TxIndex, BlockNumber: log.BlockNumber, ActId: logParsed.ActId, Uuid: common.Bytes2Hex(logParsed.Uuid[:]), Creator: logParsed.Creator.Hex(), Data: string(logParsed.Data[:]), }, ) } } { instance, err := agentupgradeable.NewAgentUpgradeable(log.Address, client) if err != nil { return err } { logParsed, err := instance.ParseCodePointerCreated(*log) if err == nil { resp.CodePointerCreated = append( resp.CodePointerCreated, logParsed, ) } } } // AgentFactory { instance, err := agentfactory.NewAgentFactory(log.Address, client) if err != nil { return err } { logParsed, err := instance.ParseAgentCreated(*log) if err == nil { resp.AgentCreated = append(resp.AgentCreated, logParsed) } } } { instance, err := vibetokenfactory.NewVibeTokenFactory(log.Address, client) if err != nil { return err } { logParsed, err := instance.ParseTokenDeployed(*log) if err == nil { resp.VibeTokenFactoryTokenDeployed = append( resp.VibeTokenFactoryTokenDeployed, logParsed, ) } } } return nil } // /////// type Erc20TokenTransferEventResp struct { NetworkID uint64 `json:"network_id"` TxHash string `json:"tx_hash"` ContractAddress string `json:"contract_address"` Timestamp uint64 `json:"timestamp"` From string `json:"from"` To string `json:"to"` Value *big.Int `json:"value"` Index uint `json:"log_index"` BlockNumber uint64 `json:"block_number"` TxIndex uint `json:"tx_index"` } type NftTransferEventResp struct { NetworkID uint64 `json:"network_id"` TxHash string `json:"tx_hash"` ContractAddress string `json:"contract_address"` Timestamp uint64 `json:"timestamp"` From string `json:"from"` To string `json:"to"` TokenId *big.Int `json:"token_id"` Index uint `json:"log_index"` TxIndex uint `json:"tx_index"` BlockNumber uint64 `json:"block_number"` } type ERC1155ransferEventResp struct { NetworkID uint64 `json:"network_id"` TxHash string `json:"tx_hash"` ContractAddress string `json:"contract_address"` Timestamp uint64 `json:"timestamp"` Operator string From string To string Id *big.Int Value *big.Int } type Erc20TokenEventResp struct { Transfer []*Erc20TokenTransferEventResp `json:"transfer"` NftTransfer []*NftTransferEventResp `json:"nft_transfer"` ERC1155Transfer []*ERC1155ransferEventResp `json:"erc1155_transfer"` LastBlockNumber int64 `json:"last_block_number"` } func (c *Client) ScanTokenHolders(contracts []string, startBlock, endBlock int64) (*Erc20TokenEventResp, error) { resp := c.NewErc20TokenEventResp() client, err := c.getClient() if err != nil { return nil, err } var contractAddresses []common.Address if len(contracts) > 0 { contractAddresses = []common.Address{} for _, item := range contracts { contractAddresses = append(contractAddresses, helpers.HexToAddress(item)) } } ctx := context.Background() lastBlock, err := client.HeaderByNumber(ctx, nil) if err != nil { return nil, err } if endBlock == 0 { endBlock = lastBlock.Number.Int64() } lastNumber := lastBlock.Number.Int64() if endBlock > lastNumber { endBlock = lastNumber } if startBlock > endBlock { return nil, nil } resp.LastBlockNumber = endBlock logs, err := client.FilterLogs( ctx, ethereum.FilterQuery{ FromBlock: big.NewInt(startBlock), ToBlock: big.NewInt(endBlock), Addresses: contractAddresses, Topics: [][]common.Hash{ { common.HexToHash("0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"), common.HexToHash("0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c"), common.HexToHash("0x7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65"), common.HexToHash("0x4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb"), common.HexToHash("0xc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62"), }, }, }, ) if err != nil { return nil, err } for _, log := range logs { err = c.Erc20TokenEventResp(resp, &log) if err != nil { return nil, err } } return resp, nil } func (c *Client) NewErc20TokenEventResp() *Erc20TokenEventResp { return &Erc20TokenEventResp{} } func (c *Client) Erc20TokenEventResp(resp *Erc20TokenEventResp, log *types.Log) error { client, err := c.getClient() if err != nil { return err } chainId, err := c.ChainID() if err != nil { return err } blockTime := uint64(time.Now().Unix()) erc20, err := erc20.NewErc20(log.Address, client) if err != nil { return err } // ParseTransfer { logParsed, err := erc20.ParseTransfer(*log) if err == nil { resp.Transfer = append( resp.Transfer, &Erc20TokenTransferEventResp{ NetworkID: chainId, TxHash: log.TxHash.Hex(), ContractAddress: logParsed.Raw.Address.Hex(), Timestamp: blockTime, From: logParsed.From.Hex(), To: logParsed.To.Hex(), Value: logParsed.Value, Index: log.Index, BlockNumber: log.BlockNumber, TxIndex: log.TxIndex, }, ) } } wbvm, err := wbvm.NewWBVM(log.Address, client) if err != nil { return err } // ParseTransfer { logParsed, err := wbvm.ParseDeposit(*log) if err == nil { resp.Transfer = append( resp.Transfer, &Erc20TokenTransferEventResp{ NetworkID: chainId, TxHash: log.TxHash.Hex(), ContractAddress: logParsed.Raw.Address.Hex(), Timestamp: blockTime, From: helpers.HexToAddress("0x0000000000000000000000000000000000000000").Hex(), To: logParsed.Dst.Hex(), Value: logParsed.Wad, Index: log.Index, BlockNumber: log.BlockNumber, TxIndex: log.TxIndex, }, ) } } { logParsed, err := wbvm.ParseWithdrawal(*log) if err == nil { resp.Transfer = append( resp.Transfer, &Erc20TokenTransferEventResp{ NetworkID: chainId, TxHash: log.TxHash.Hex(), ContractAddress: logParsed.Raw.Address.Hex(), Timestamp: blockTime, From: logParsed.Src.Hex(), To: helpers.HexToAddress("0x0000000000000000000000000000000000000000").Hex(), Value: logParsed.Wad, Index: log.Index, BlockNumber: log.BlockNumber, TxIndex: log.TxIndex, }, ) } } //nft transfer erc721, err := erc721.NewErc721(log.Address, client) if err != nil { return err } { logParsed, err := erc721.ParseTransfer(*log) if err == nil { resp.NftTransfer = append( resp.NftTransfer, &NftTransferEventResp{ NetworkID: chainId, TxHash: log.TxHash.Hex(), ContractAddress: logParsed.Raw.Address.Hex(), Timestamp: blockTime, From: logParsed.From.Hex(), To: logParsed.To.Hex(), TokenId: logParsed.TokenId, Index: log.Index, TxIndex: log.TxIndex, BlockNumber: log.BlockNumber, }, ) } } //erc1155 transfer erc1155, err := erc1155.NewERC1155(log.Address, client) if err != nil { return err } { logParsed, err := erc1155.ParseTransferBatch(*log) if err == nil { for index, _ := range logParsed.Ids { resp.ERC1155Transfer = append( resp.ERC1155Transfer, &ERC1155ransferEventResp{ NetworkID: chainId, TxHash: log.TxHash.Hex(), ContractAddress: logParsed.Raw.Address.Hex(), Timestamp: blockTime, From: logParsed.From.Hex(), To: logParsed.To.Hex(), Id: logParsed.Ids[index], Value: logParsed.Values[index], }, ) } } } { logParsed, err := erc1155.ParseTransferSingle(*log) if err == nil { resp.ERC1155Transfer = append( resp.ERC1155Transfer, &ERC1155ransferEventResp{ NetworkID: chainId, TxHash: log.TxHash.Hex(), ContractAddress: logParsed.Raw.Address.Hex(), Timestamp: blockTime, From: logParsed.From.Hex(), To: logParsed.To.Hex(), Id: logParsed.Id, Value: logParsed.Value, }, ) } } return nil } func (c *Client) Erc20EventsByTransaction(txHash string) (*Erc20TokenEventResp, error) { resp := c.NewErc20TokenEventResp() client, err := c.getClient() if err != nil { return nil, err } ctx := context.Background() receipt, err := client.TransactionReceipt(ctx, common.HexToHash(txHash)) if err != nil { return nil, err } for _, log := range receipt.Logs { err = c.Erc20TokenEventResp(resp, log) if err != nil { return nil, err } } return resp, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/ethapi/external_events.go ================================================ package ethapi import ( "context" "math/big" "time" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/helpers" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/binds/uniswapv3factory" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/binds/uniswapv3pool" "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" ) type UniswapPoolCreatedEventResp struct { TxHash string `json:"tx_hash"` ContractAddress string `json:"contract_address"` Timestamp uint64 `json:"timestamp"` Token0 string `json:"token0"` Token1 string `json:"token1"` Pool string `json:"pool"` Fee *big.Int `json:"fee"` TickSpacing *big.Int `json:"tick_spacing"` Index uint `json:"log_index"` NetworkID uint64 `json:"network_id"` } type UniswapSwapEventResp struct { FromAddress string `json:"from_address"` TxHash string `json:"tx_hash"` ContractAddress string `json:"contract_address"` Timestamp uint64 `json:"timestamp"` Sender string `json:"sender"` Recipient string `json:"recipient"` Amount0 *big.Int `json:"amount0"` Amount1 *big.Int `json:"amount1"` SqrtPriceX96 *big.Int `json:"sqrt_price_x96"` Liquidity *big.Int `json:"liquidity"` Tick *big.Int `json:"tick"` Index uint `json:"log_index"` TxIndex uint `json:"tx_index"` BlockNumber uint64 `json:"block_number"` NetworkID uint64 `json:"network_id"` } type BlockChainExternalEventResp struct { UniV3PoolCreated []*UniswapPoolCreatedEventResp `json:"uni_v3_pool_created"` UniV3Swap []*UniswapSwapEventResp `json:"uni_v3_swap"` LastBlockNumber int64 `json:"last_block_number"` BlockNumber uint64 `json:"block_number"` } func (c *Client) NewExternalEventResp() *BlockChainExternalEventResp { return &BlockChainExternalEventResp{} } func (c *Client) ExternalEventEventsByTransaction(txHash string) (*BlockChainExternalEventResp, error) { resp := c.NewExternalEventResp() client, err := c.getClient() if err != nil { return nil, err } ctx := context.Background() receipt, err := client.TransactionReceipt(ctx, common.HexToHash(txHash)) if err != nil { return nil, err } for _, log := range receipt.Logs { err = c.ParseExternalEventResp(resp, log) if err != nil { return nil, err } } return resp, nil } func (c *Client) ScanExternalEvents(contractAddrs []string, startBlock, endBlock int64) (*BlockChainExternalEventResp, error) { resp := c.NewExternalEventResp() client, err := c.getClient() if err != nil { return nil, err } var contractAddresses []common.Address if len(contractAddrs) > 0 { contractAddresses = []common.Address{} for _, contractAddr := range contractAddrs { if contractAddr != "" { contractAddresses = append(contractAddresses, helpers.HexToAddress(contractAddr)) } } } ctx := context.Background() lastBlock, err := client.HeaderByNumber(ctx, nil) if err != nil { return nil, err } lastNumber := lastBlock.Number.Int64() if endBlock > lastNumber { endBlock = lastNumber } if startBlock > endBlock { return nil, nil } resp.LastBlockNumber = lastNumber resp.BlockNumber = lastBlock.Number.Uint64() logs, err := client.FilterLogs( ctx, ethereum.FilterQuery{ FromBlock: big.NewInt(startBlock), ToBlock: big.NewInt(endBlock), Addresses: contractAddresses, Topics: [][]common.Hash{ { // univ3 common.HexToHash("0x783cca1c0412dd0d695e784568c96da2e9c22ff989357a2e8b1d9b2b4e6b7118"), common.HexToHash("0xc42079f94a6350d7e6235f29174924f928cc2ac818eb64fed8004e115fbcca67"), }, }, }, ) if err != nil { return nil, err } for _, log := range logs { err = c.ParseExternalEventResp(resp, &log) if err != nil { return nil, err } } return resp, nil } func (c *Client) ParseExternalEventResp(resp *BlockChainExternalEventResp, log *types.Log) error { client, err := c.getClient() if err != nil { return err } blockTime := uint64(time.Now().Unix()) uniswap, err := uniswapv3factory.NewUniswapv3factory(log.Address, client) if err != nil { return err } networkID, err := c.ChainID() if err != nil { return err } // ParsePoolCreated { logParsed, err := uniswap.ParsePoolCreated(*log) if err == nil { resp.UniV3PoolCreated = append( resp.UniV3PoolCreated, &UniswapPoolCreatedEventResp{ TxHash: log.TxHash.Hex(), ContractAddress: logParsed.Raw.Address.Hex(), Timestamp: blockTime, Token0: logParsed.Token0.Hex(), Token1: logParsed.Token1.Hex(), Fee: logParsed.Fee, Pool: logParsed.Pool.Hex(), TickSpacing: logParsed.TickSpacing, Index: log.Index, NetworkID: networkID, }, ) } } uniswappair, err := uniswapv3pool.NewUniswapv3pool(log.Address, client) if err != nil { return err } // ParseSwap { logParsed, err := uniswappair.ParseSwap(*log) if err == nil { resp.UniV3Swap = append( resp.UniV3Swap, &UniswapSwapEventResp{ TxHash: log.TxHash.Hex(), ContractAddress: logParsed.Raw.Address.Hex(), Timestamp: blockTime, Sender: logParsed.Sender.Hex(), Recipient: logParsed.Recipient.Hex(), Amount0: logParsed.Amount0, Amount1: logParsed.Amount1, SqrtPriceX96: logParsed.SqrtPriceX96, Liquidity: logParsed.Liquidity, Tick: logParsed.Tick, Index: log.Index, TxIndex: log.TxIndex, BlockNumber: log.BlockNumber, NetworkID: networkID, }, ) } } return nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/ethapi/gpumanager.go ================================================ package ethapi import ( "errors" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/helpers" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/binds/gpumanager" "github.com/ethereum/go-ethereum/accounts/abi/bind" ) func (c *Client) GPUManagerGetModelID(contactAddress string) (uint32, error) { client, err := c.getClient() if err != nil { return 0, err } instance, err := gpumanager.NewGPUManager(helpers.HexToAddress(contactAddress), client) if err != nil { return 0, err } modelIds, err := instance.GetModelIds(&bind.CallOpts{}) if err != nil { return 0, err } if len(modelIds) == 0 { return 0, errors.New("modelId not found") } return uint32(modelIds[0].Int64()), nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/ethapi/iagenttokendeployer.go ================================================ package ethapi import ( "errors" "math/big" "strings" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/helpers" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/binds/iagenttokendeployer" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" ) func (c *Client) IAGENTTokenDeployerGetToken(contractAddress string, salt string) (string, error) { if !common.IsHexAddress(contractAddress) { return "", errors.New("contractAddress is invalid") } client, err := c.getClient() if err != nil { return "", err } instance, err := iagenttokendeployer.NewIAGENTTokenDeployer(helpers.HexToAddress(contractAddress), client) if err != nil { return "", err } tokenAddress, err := instance.GetToken(&bind.CallOpts{}, [32]byte(common.HexToHash(salt))) if err != nil { return "", err } return tokenAddress.Hex(), nil } func (c *Client) IAGENTTokenDeployerCreateTokenData(salt string, name string, symbol string, supply *big.Int) ([]byte, error) { instanceABI, err := abi.JSON(strings.NewReader(iagenttokendeployer.IAGENTTokenDeployerABI)) if err != nil { return nil, err } dataBytes, err := instanceABI.Pack( "createToken", [32]byte(common.HexToHash(salt)), name, symbol, supply, ) if err != nil { return nil, err } return dataBytes, nil } func (c *Client) IAGENTTokenDeployerCallWithValueData(target string, data []byte, value *big.Int) ([]byte, error) { instanceABI, err := abi.JSON(strings.NewReader(iagenttokendeployer.IAGENTTokenDeployerABI)) if err != nil { return nil, err } dataBytes, err := instanceABI.Pack( "callWithValue", helpers.HexToAddress(target), data, value, ) if err != nil { return nil, err } return dataBytes, nil } func (c *Client) IAGENTTokenDeployerMulticallData(data [][]byte) ([]byte, error) { instanceABI, err := abi.JSON(strings.NewReader(iagenttokendeployer.IAGENTTokenDeployerABI)) if err != nil { return nil, err } dataBytes, err := instanceABI.Pack( "multicall", data, ) if err != nil { return nil, err } return dataBytes, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/ethapi/iv3swaprouter.go ================================================ package ethapi import ( "strings" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/binds/iv3swaprouter" "github.com/ethereum/go-ethereum/accounts/abi" ) func (c *Client) IV3SwapRouterExactInputSingleData(params *iv3swaprouter.IV3SwapRouterExactInputSingleParams) ([]byte, error) { instanceABI, err := abi.JSON(strings.NewReader(iv3swaprouter.IV3SwapRouterABI)) if err != nil { return nil, err } multicallBytes := [][]byte{} { multicallData, err := instanceABI.Pack( "exactInputSingle", params, ) if err != nil { return nil, err } multicallBytes = append( multicallBytes, multicallData, ) } { multicallData, err := instanceABI.Pack( "refundETH", ) if err != nil { return nil, err } multicallBytes = append( multicallBytes, multicallData, ) } dataBytes, err := instanceABI.Pack( "multicall", multicallBytes, ) if err != nil { return nil, err } return dataBytes, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/ethapi/meme_swapv3.go ================================================ package ethapi import ( "context" "errors" "math/big" "strings" "time" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/helpers" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/binds/memenonfungiblepositionmanager" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/binds/memequoter" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/binds/memeswaprouter" "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" ) func (c *Client) MemeNonfungiblePositionManagerMint(contractAddr string, prkHex string, weth9 common.Address, sqrtPriceX96 *big.Int, params *memenonfungiblepositionmanager.INonfungiblePositionManagerMintParams) (string, error) { pbkHex, prk, err := c.parsePrkAuth(prkHex) if err != nil { return "", err } gasPrice, gasTipCap, err := c.GetCachedGasPriceAndTipCap() if err != nil { return "", err } client, err := c.getClient() if err != nil { return "", err } value := big.NewInt(0) if !strings.EqualFold(weth9.Hex(), params.Token0.Hex()) { if params.Amount0Desired.Cmp(big.NewInt(0)) > 0 { allowance, err := c.Erc20Allowance(params.Token0.Hex(), pbkHex.Hex(), contractAddr) if err != nil { return "", err } if allowance.Cmp(big.NewInt(0)) <= 0 { approveHash, err := c.Erc20ApproveMax( params.Token0.Hex(), prkHex, contractAddr, ) if err != nil { return "", err } time.Sleep(10 * time.Second) err = c.WaitMined(approveHash) if err != nil { return "", err } } } } else { value = params.Amount0Desired } if !strings.EqualFold(weth9.Hex(), params.Token1.Hex()) { if params.Amount1Desired.Cmp(big.NewInt(0)) > 0 { allowance, err := c.Erc20Allowance(params.Token1.Hex(), pbkHex.Hex(), contractAddr) if err != nil { return "", err } if allowance.Cmp(big.NewInt(0)) <= 0 { approveHash, err := c.Erc20ApproveMax( params.Token1.Hex(), prkHex, contractAddr, ) if err != nil { return "", err } time.Sleep(10 * time.Second) err = c.WaitMined(approveHash) if err != nil { return "", err } } } } else { value = params.Amount1Desired } contractAddress := helpers.HexToAddress(contractAddr) // EstimateGas instanceABI, err := abi.JSON(strings.NewReader(memenonfungiblepositionmanager.NonfungiblePositionManagerABI)) if err != nil { return "", err } multicallBytes := [][]byte{} { multicallData, err := instanceABI.Pack( "createAndInitializePoolIfNecessary", params.Token0, params.Token1, params.Fee, sqrtPriceX96, ) if err != nil { return "", err } multicallBytes = append( multicallBytes, multicallData, ) } { multicallData, err := instanceABI.Pack( "mint", memenonfungiblepositionmanager.INonfungiblePositionManagerMintParams{ Token0: params.Token0, Token1: params.Token1, Fee: params.Fee, TickLower: params.TickLower, TickUpper: params.TickUpper, Amount0Desired: params.Amount0Desired, Amount1Desired: params.Amount1Desired, Amount0Min: params.Amount0Min, Amount1Min: params.Amount1Min, Recipient: pbkHex, Deadline: params.Deadline, }, ) if err != nil { return "", err } multicallBytes = append( multicallBytes, multicallData, ) } if strings.EqualFold(weth9.Hex(), params.Token0.Hex()) || strings.EqualFold(weth9.Hex(), params.Token1.Hex()) { multicallData, err := instanceABI.Pack( "refundETH", ) if err != nil { return "", err } multicallBytes = append( multicallBytes, multicallData, ) } dataBytes, err := instanceABI.Pack( "multicall", multicallBytes, ) if err != nil { return "", err } gasNumber, err := client.EstimateGas(context.Background(), ethereum.CallMsg{ From: pbkHex, To: &contractAddress, Data: dataBytes, Value: value, }) if err != nil { return "", err } chainID, err := c.GetChainID() if err != nil { return "", err } nonceAt, err := c.PendingNonceAt(context.Background(), pbkHex) if err != nil { return "", err } rawTx := types.NewTx(&types.DynamicFeeTx{ ChainID: big.NewInt(int64(chainID)), Nonce: nonceAt, GasFeeCap: gasPrice, GasTipCap: gasTipCap, Gas: (gasNumber * 12 / 10), To: &contractAddress, Value: value, Data: dataBytes, }) signedTx, err := types.SignTx(rawTx, types.NewLondonSigner(big.NewInt(int64(chainID))), prk) if err != nil { return "", err } err = client.SendTransaction(context.Background(), signedTx) if err != nil { return "", err } return signedTx.Hash().Hex(), nil } func (c *Client) MemeNonfungiblePositionManagerMintData(recipient string, sqrtPriceX96 *big.Int, params *memenonfungiblepositionmanager.INonfungiblePositionManagerMintParams) ([]byte, error) { instanceABI, err := abi.JSON(strings.NewReader(memenonfungiblepositionmanager.NonfungiblePositionManagerABI)) if err != nil { return nil, err } multicallBytes := [][]byte{} { multicallData, err := instanceABI.Pack( "createAndInitializePoolIfNecessary", params.Token0, params.Token1, params.Fee, sqrtPriceX96, ) if err != nil { return nil, err } multicallBytes = append( multicallBytes, multicallData, ) } { multicallData, err := instanceABI.Pack( "mint", memenonfungiblepositionmanager.INonfungiblePositionManagerMintParams{ Token0: params.Token0, Token1: params.Token1, Fee: params.Fee, TickLower: params.TickLower, TickUpper: params.TickUpper, Amount0Desired: params.Amount0Desired, Amount1Desired: params.Amount1Desired, Amount0Min: params.Amount0Min, Amount1Min: params.Amount1Min, Recipient: helpers.HexToAddress(recipient), Deadline: params.Deadline, }, ) if err != nil { return nil, err } multicallBytes = append( multicallBytes, multicallData, ) } { multicallData, err := instanceABI.Pack( "refundETH", ) if err != nil { return nil, err } multicallBytes = append( multicallBytes, multicallData, ) } dataBytes, err := instanceABI.Pack( "multicall", multicallBytes, ) if err != nil { return nil, err } return dataBytes, nil } func (c *Client) MemeNonfungiblePositionManagerBurn(contractAddr string, adminPrk string, weth9 common.Address, tokenId *big.Int) (string, error) { pbkHex, prk, err := c.parsePrkAuth(adminPrk) if err != nil { return "", err } gasPrice, gasTipCap, err := c.GetCachedGasPriceAndTipCap() if err != nil { return "", err } client, err := c.getClient() if err != nil { return "", err } nonceAt, err := c.PendingNonceAt(context.Background(), pbkHex) if err != nil { return "", err } contractAddress := helpers.HexToAddress(contractAddr) // EstimateGas instanceABI, err := abi.JSON(strings.NewReader(memenonfungiblepositionmanager.NonfungiblePositionManagerMetaData.ABI)) if err != nil { return "", err } positionmanager, err := memenonfungiblepositionmanager.NewNonfungiblePositionManager(helpers.HexToAddress(contractAddr), client) if err != nil { return "", err } pos, err := positionmanager.Positions(&bind.CallOpts{}, tokenId) if err != nil { return "", err } multicallBytes := [][]byte{} { multicallData, err := instanceABI.Pack( "decreaseLiquidity", memenonfungiblepositionmanager.UniswapV3BrokerDecreaseLiquidityParams{ TokenId: tokenId, Liquidity: pos.Liquidity, Amount0Min: big.NewInt(0), Amount1Min: big.NewInt(0), Deadline: big.NewInt(time.Now().Add(60 * time.Second).Unix()), }, ) if err != nil { return "", err } multicallBytes = append( multicallBytes, multicallData, ) } isNativeReceive := strings.EqualFold(weth9.Hex(), pos.Token0.Hex()) || strings.EqualFold(weth9.Hex(), pos.Token1.Hex()) { amountMax := big.NewInt(0).Sub(new(big.Int).Exp(big.NewInt(2), big.NewInt(128), nil), big.NewInt(1)) multicallData, err := instanceABI.Pack( "collect", memenonfungiblepositionmanager.UniswapV3BrokerCollectParams{ TokenId: tokenId, Recipient: helpers.HexToAddress("0x0000000000000000000000000000000000000000"), Amount0Max: amountMax, Amount1Max: amountMax, }, ) if err != nil { return "", err } multicallBytes = append( multicallBytes, multicallData, ) } if isNativeReceive { multicallData, err := instanceABI.Pack( "unwrapWETH", big.NewInt(0), pbkHex, ) if err != nil { return "", err } multicallBytes = append( multicallBytes, multicallData, ) } if !strings.EqualFold(weth9.Hex(), pos.Token0.Hex()) { multicallData, err := instanceABI.Pack( "sweepToken", pos.Token0, big.NewInt(0), pbkHex, ) if err != nil { return "", err } multicallBytes = append( multicallBytes, multicallData, ) } if !strings.EqualFold(weth9.Hex(), pos.Token1.Hex()) { multicallData, err := instanceABI.Pack( "sweepToken", pos.Token1, big.NewInt(0), pbkHex, ) if err != nil { return "", err } multicallBytes = append( multicallBytes, multicallData, ) } dataBytes, err := instanceABI.Pack( "multicall", multicallBytes, ) if err != nil { return "", err } gasNumber, err := client.EstimateGas(context.Background(), ethereum.CallMsg{ From: pbkHex, To: &contractAddress, Data: dataBytes, }) if err != nil { return "", err } chainID, err := c.GetChainID() if err != nil { return "", err } rawTx := types.NewTx(&types.DynamicFeeTx{ ChainID: big.NewInt(int64(chainID)), Nonce: nonceAt, GasFeeCap: gasPrice, GasTipCap: gasTipCap, Gas: (gasNumber * 12 / 10), To: &contractAddress, Value: big.NewInt(0), Data: dataBytes, }) signedTx, err := types.SignTx(rawTx, types.NewLondonSigner(big.NewInt(int64(chainID))), prk) if err != nil { return "", err } err = client.SendTransaction(context.Background(), signedTx) if err != nil { return "", err } return signedTx.Hash().Hex(), nil } func (c *Client) MemeSwapRouterExactInputSingle(contractAddr, privateHex string, weth9 common.Address, params *memeswaprouter.ISwapRouterExactInputSingleParams) (string, error) { addressHex, prk, err := c.parsePrkAuth(privateHex) if err != nil { return "", err } client, err := c.getClient() if err != nil { return "", err } gasPrice, gasTipCap, err := c.GetCachedGasPriceAndTipCap() if err != nil { return "", err } if params.AmountIn.Cmp(big.NewInt(0)) <= 0 { return "", errors.New("amountIn is not enough for tx") } contractAddress := helpers.HexToAddress(contractAddr) instanceABI, err := memeswaprouter.SwapRouterMetaData.GetAbi() if err != nil { return "", err } var dataBytes []byte value := big.NewInt(0) if !strings.EqualFold(params.TokenIn.Hex(), weth9.Hex()) { allowance, err := c.Erc20Allowance(params.TokenIn.Hex(), addressHex.Hex(), contractAddr) if err != nil { return "", err } if allowance.Cmp(params.AmountIn) < 0 { approveHash, err := c.Erc20ApproveMax( params.TokenIn.Hex(), privateHex, contractAddr, ) if err != nil { return "", err } time.Sleep(10 * time.Second) err = c.WaitMined(approveHash) if err != nil { return "", err } } } if strings.EqualFold(params.TokenIn.Hex(), weth9.Hex()) { value = params.AmountIn exactInputSingleDataBytes, err := instanceABI.Pack( "exactInputSingle", memeswaprouter.ISwapRouterExactInputSingleParams{ TokenIn: params.TokenIn, TokenOut: params.TokenOut, Fee: params.Fee, Recipient: params.Recipient, AmountIn: params.AmountIn, AmountOutMinimum: params.AmountOutMinimum, SqrtPriceLimitX96: params.SqrtPriceLimitX96, }, ) if err != nil { return "", err } refundWETHDataBytes, err := instanceABI.Pack( "refundETH", ) if err != nil { return "", err } dataBytes, err = instanceABI.Pack( "multicall", [][]byte{ exactInputSingleDataBytes, refundWETHDataBytes, }, ) if err != nil { return "", err } } else if strings.EqualFold(params.TokenOut.Hex(), weth9.Hex()) { exactInputSingleDataBytes, err := instanceABI.Pack( "exactInputSingle", memeswaprouter.ISwapRouterExactInputSingleParams{ TokenIn: params.TokenIn, TokenOut: params.TokenOut, Fee: params.Fee, Recipient: contractAddress, AmountIn: params.AmountIn, AmountOutMinimum: params.AmountOutMinimum, SqrtPriceLimitX96: params.SqrtPriceLimitX96, Deadline: big.NewInt(time.Now().Add(60 * time.Second).Unix()), }, ) if err != nil { return "", err } unwrapWETHDataBytes, err := instanceABI.Pack( "unwrapWETH", big.NewInt(0), addressHex, ) if err != nil { return "", err } sweepTokenDataBytes, err := instanceABI.Pack( "sweepToken", params.TokenOut, big.NewInt(0), addressHex, ) if err != nil { return "", err } dataBytes, err = instanceABI.Pack( "multicall", [][]byte{ exactInputSingleDataBytes, unwrapWETHDataBytes, sweepTokenDataBytes, }, ) if err != nil { return "", err } } else { exactInputSingleDataBytes, err := instanceABI.Pack( "exactInputSingle", memeswaprouter.ISwapRouterExactInputSingleParams{ TokenIn: params.TokenIn, TokenOut: params.TokenOut, Fee: params.Fee, Recipient: addressHex, AmountIn: params.AmountIn, AmountOutMinimum: params.AmountOutMinimum, SqrtPriceLimitX96: params.SqrtPriceLimitX96, Deadline: big.NewInt(time.Now().Add(60 * time.Second).Unix()), }, ) if err != nil { return "", err } dataBytes, err = instanceABI.Pack( "multicall", [][]byte{ exactInputSingleDataBytes, }, ) if err != nil { return "", err } } gasNumber, err := client.EstimateGas(context.Background(), ethereum.CallMsg{ From: addressHex, To: &contractAddress, Data: dataBytes, Value: value, }) if err != nil { return "", err } chainID, err := c.GetChainID() if err != nil { return "", err } nonceAt, err := c.PendingNonceAt(context.Background(), addressHex) if err != nil { return "", err } rawTx := types.NewTx(&types.DynamicFeeTx{ ChainID: big.NewInt(int64(chainID)), Nonce: nonceAt, GasFeeCap: gasPrice, GasTipCap: gasTipCap, Gas: (gasNumber * 12 / 10), To: &contractAddress, Value: value, Data: dataBytes, }) signedTx, err := types.SignTx(rawTx, types.NewLondonSigner(big.NewInt(int64(chainID))), prk) if err != nil { return "", err } err = client.SendTransaction(context.Background(), signedTx) if err != nil { return "", err } return signedTx.Hash().Hex(), nil } func (c *Client) MemeQuoterQuoteExactInputSingle(contractAddress string, params *memequoter.IQuoterV2QuoteExactInputSingleParams) (*big.Int, *big.Int, uint32, uint32, error) { client, err := c.getClient() if err != nil { return nil, nil, 0, 0, err } instance, err := memequoter.NewQuoterV2(helpers.HexToAddress(contractAddress), client) if err != nil { return nil, nil, 0, 0, err } amountOut, sqrtPriceX96After, initializedTicksCrossed, gasEstimate, err := instance. QuoteExactInputSingleCall( &bind.CallOpts{}, *params, ) if err != nil { return nil, nil, 0, 0, err } return amountOut, sqrtPriceX96After, initializedTicksCrossed, gasEstimate, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/ethapi/multisend.go ================================================ package ethapi import ( "context" "math/big" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/helpers" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/binds/multisend" "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" ) func (c *Client) DeployMultisend(prkHex string) (string, string, error) { _, prk, err := c.parsePrkAuth(prkHex) if err != nil { return "", "", err } chainID, err := c.GetChainID() if err != nil { return "", "", err } auth, err := bind.NewKeyedTransactorWithChainID(prk, big.NewInt(int64(chainID))) if err != nil { return "", "", err } client, err := c.getClient() if err != nil { return "", "", err } gasPrice, err := c.getGasPrice() if err != nil { return "", "", err } auth.GasPrice = gasPrice address, tx, _, err := multisend.DeployMultiSend(auth, client) if err != nil { return "", "", err } return address.Hex(), tx.Hash().Hex(), nil } func (c *Client) MultisendERC20Transfer(contractAddr string, prkHex string, token common.Address, addresses []common.Address, amounts []*big.Int) (string, error) { pbkHex, prk, err := c.parsePrkAuth(prkHex) if err != nil { return "", err } gasPrice, gasTipCap, err := c.GetCachedGasPriceAndTipCap() if err != nil { return "", err } client, err := c.getClient() if err != nil { return "", err } instanceABI, err := multisend.MultiSendMetaData.GetAbi() if err != nil { return "", err } dataBytes, err := instanceABI.Pack( "multiERC20Transfer", token, addresses, amounts, ) if err != nil { return "", err } contractAddress := helpers.HexToAddress(contractAddr) value := big.NewInt(0) gasNumber, err := client.EstimateGas(context.Background(), ethereum.CallMsg{ From: pbkHex, To: &contractAddress, Data: dataBytes, Value: value, }) if err != nil { return "", err } chainID, err := c.GetChainID() if err != nil { return "", err } nonceAt, err := c.PendingNonceAt(context.Background(), pbkHex) if err != nil { return "", err } rawTx := types.NewTx(&types.DynamicFeeTx{ ChainID: big.NewInt(int64(chainID)), Nonce: nonceAt, GasFeeCap: gasPrice, GasTipCap: gasTipCap, Gas: (gasNumber * 2), To: &contractAddress, Value: value, Data: dataBytes, }) signedTx, err := types.SignTx(rawTx, types.NewLondonSigner(big.NewInt(int64(chainID))), prk) if err != nil { return "", err } err = client.SendTransaction(context.Background(), signedTx) if err != nil { return "", err } _, err = c.InscribeTxs([]string{signedTx.Hash().Hex()}) if err != nil { return "", err } return signedTx.Hash().Hex(), nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/ethapi/polygon_swapv3.go ================================================ package ethapi import ( "context" "math/big" "strings" "time" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/helpers" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/binds/polygonnonfungiblepositionmanager" "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" ) func (c *Client) PolygonNonfungiblePositionManagerMint(contractAddr string, privateHex string, weth9 common.Address, sqrtPriceX96 *big.Int, params *polygonnonfungiblepositionmanager.INonfungiblePositionManagerMintParams) (string, error) { addressHex, prk, err := c.parsePrkAuth(privateHex) if err != nil { return "", err } gasPrice, gasTipCap, err := c.GetCachedGasPriceAndTipCap() if err != nil { return "", err } client, err := c.getClient() if err != nil { return "", err } value := big.NewInt(0) if !strings.EqualFold(weth9.Hex(), params.Token0.Hex()) { if params.Amount0Desired.Cmp(big.NewInt(0)) > 0 { allowance, err := c.Erc20Allowance(params.Token0.Hex(), addressHex.Hex(), contractAddr) if err != nil { return "", err } if allowance.Cmp(big.NewInt(0)) <= 0 { approveHash, err := c.Erc20ApproveMax( params.Token0.Hex(), privateHex, contractAddr, ) if err != nil { return "", err } time.Sleep(10 * time.Second) err = c.WaitMined(approveHash) if err != nil { return "", err } } } } else { value = params.Amount0Desired } if !strings.EqualFold(weth9.Hex(), params.Token1.Hex()) { if params.Amount1Desired.Cmp(big.NewInt(0)) > 0 { allowance, err := c.Erc20Allowance(params.Token1.Hex(), addressHex.Hex(), contractAddr) if err != nil { return "", err } if allowance.Cmp(big.NewInt(0)) <= 0 { approveHash, err := c.Erc20ApproveMax( params.Token1.Hex(), privateHex, contractAddr, ) if err != nil { return "", err } time.Sleep(10 * time.Second) err = c.WaitMined(approveHash) if err != nil { return "", err } } } } else { value = params.Amount1Desired } contractAddress := helpers.HexToAddress(contractAddr) // EstimateGas instanceABI, err := abi.JSON(strings.NewReader(polygonnonfungiblepositionmanager.NonfungiblePositionManagerABI)) if err != nil { return "", err } multicallBytes := [][]byte{} { multicallData, err := instanceABI.Pack( "createAndInitializePoolIfNecessary", params.Token0, params.Token1, params.Fee, sqrtPriceX96, ) if err != nil { return "", err } multicallBytes = append( multicallBytes, multicallData, ) } { multicallData, err := instanceABI.Pack( "mint", polygonnonfungiblepositionmanager.INonfungiblePositionManagerMintParams{ Token0: params.Token0, Token1: params.Token1, Fee: params.Fee, TickLower: params.TickLower, TickUpper: params.TickUpper, Amount0Desired: params.Amount0Desired, Amount1Desired: params.Amount1Desired, Amount0Min: params.Amount0Min, Amount1Min: params.Amount1Min, Recipient: addressHex, Deadline: params.Deadline, }, ) if err != nil { return "", err } multicallBytes = append( multicallBytes, multicallData, ) } if strings.EqualFold(weth9.Hex(), params.Token0.Hex()) || strings.EqualFold(weth9.Hex(), params.Token1.Hex()) { multicallData, err := instanceABI.Pack( "refundETH", ) if err != nil { return "", err } multicallBytes = append( multicallBytes, multicallData, ) } dataBytes, err := instanceABI.Pack( "multicall", multicallBytes, ) if err != nil { return "", err } gasNumber, err := client.EstimateGas(context.Background(), ethereum.CallMsg{ From: addressHex, To: &contractAddress, Data: dataBytes, Value: value, }) if err != nil { return "", err } chainID, err := c.GetChainID() if err != nil { return "", err } nonceAt, err := c.PendingNonceAt(context.Background(), addressHex) if err != nil { return "", err } rawTx := types.NewTx(&types.DynamicFeeTx{ ChainID: big.NewInt(int64(chainID)), Nonce: nonceAt, GasFeeCap: gasPrice, GasTipCap: gasTipCap, Gas: (gasNumber * 12 / 10), To: &contractAddress, Value: value, Data: dataBytes, }) signedTx, err := types.SignTx(rawTx, types.NewLondonSigner(big.NewInt(int64(chainID))), prk) if err != nil { return "", err } err = client.SendTransaction(context.Background(), signedTx) if err != nil { return "", err } return signedTx.Hash().Hex(), nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/ethapi/proxyadmin.go ================================================ package ethapi import ( "context" "math/big" "strings" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/helpers" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/binds/proxyadmin" "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" ) func (c *Client) DeployProxyAdmin(prkHex string) (string, string, error) { _, prk, err := c.parsePrkAuth(prkHex) if err != nil { return "", "", err } chainID, err := c.GetChainID() if err != nil { return "", "", err } auth, err := bind.NewKeyedTransactorWithChainID(prk, big.NewInt(int64(chainID))) if err != nil { return "", "", err } client, err := c.getClient() if err != nil { return "", "", err } gasPrice, err := c.getGasPrice() if err != nil { return "", "", err } auth.GasPrice = gasPrice address, tx, _, err := proxyadmin.DeployProxyAdmin(auth, client) if err != nil { return "", "", err } return address.Hex(), tx.Hash().Hex(), nil } func (c *Client) ProxyAdminUpgrade(contractAddr string, prkHex string, proxyAddress common.Address, logic common.Address) (string, error) { pbkHex, prk, err := c.parsePrkAuth(prkHex) if err != nil { return "", err } gasPrice, gasTipCap, err := c.GetCachedGasPriceAndTipCap() if err != nil { return "", err } client, err := c.getClient() if err != nil { return "", err } proAdmin, err := proxyadmin.NewProxyAdmin(helpers.HexToAddress(contractAddr), client) if err != nil { return "", err } nowLogic, err := proAdmin.GetProxyImplementation(&bind.CallOpts{}, proxyAddress) if err != nil { return "", err } if strings.EqualFold(nowLogic.Hex(), logic.Hex()) { return "", nil } instanceABI, err := proxyadmin.ProxyAdminMetaData.GetAbi() if err != nil { return "", err } dataBytes, err := instanceABI.Pack( "upgrade", proxyAddress, logic, ) if err != nil { return "", err } contractAddress := helpers.HexToAddress(contractAddr) value := big.NewInt(0) gasNumber, err := client.EstimateGas(context.Background(), ethereum.CallMsg{ From: pbkHex, To: &contractAddress, Data: dataBytes, Value: value, }) if err != nil { return "", err } chainID, err := c.GetChainID() if err != nil { return "", err } nonceAt, err := c.PendingNonceAt(context.Background(), pbkHex) if err != nil { return "", err } rawTx := types.NewTx(&types.DynamicFeeTx{ ChainID: big.NewInt(int64(chainID)), Nonce: nonceAt, GasFeeCap: gasPrice, GasTipCap: gasTipCap, Gas: (gasNumber * 2), To: &contractAddress, Value: value, Data: dataBytes, }) signedTx, err := types.SignTx(rawTx, types.NewLondonSigner(big.NewInt(int64(chainID))), prk) if err != nil { return "", err } err = client.SendTransaction(context.Background(), signedTx) if err != nil { return "", err } _, err = c.InscribeTxs([]string{signedTx.Hash().Hex()}) if err != nil { return "", err } return signedTx.Hash().Hex(), nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/ethapi/systempromptmanager.go ================================================ package ethapi import ( "context" "math/big" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/helpers" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/binds/isystempromptmanager" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/binds/systempromptmanager" "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" ) func (c *Client) SystemPromptManagerInfer(contractAddr string, prkHex string, agentId int64, inferData string, externalData string) (string, error) { pbkHex, prk, err := c.parsePrkAuth(prkHex) if err != nil { return "", err } gasPrice, gasTipCap, err := c.GetCachedGasPriceAndTipCap() if err != nil { return "", err } client, err := c.getClient() if err != nil { return "", err } instanceABI, err := isystempromptmanager.SystemPromptManagerMetaData.GetAbi() if err != nil { return "", err } dataBytes, err := instanceABI.Pack( "infer", big.NewInt(agentId), []byte(inferData), externalData, ) if err != nil { return "", err } contractAddress := helpers.HexToAddress(contractAddr) value := big.NewInt(0) gasNumber, err := client.EstimateGas(context.Background(), ethereum.CallMsg{ From: pbkHex, To: &contractAddress, Data: dataBytes, Value: value, }) if err != nil { return "", err } chainID, err := c.GetChainID() if err != nil { return "", err } nonceAt, err := c.PendingNonceAt(context.Background(), pbkHex) if err != nil { return "", err } rawTx := types.NewTx(&types.DynamicFeeTx{ ChainID: big.NewInt(int64(chainID)), Nonce: nonceAt, GasFeeCap: gasPrice, GasTipCap: gasTipCap, Gas: (gasNumber * 2), To: &contractAddress, Value: value, Data: dataBytes, }) signedTx, err := types.SignTx(rawTx, types.NewLondonSigner(big.NewInt(int64(chainID))), prk) if err != nil { return "", err } err = client.SendTransaction(context.Background(), signedTx) if err != nil { return "", err } _, err = c.InscribeTxs([]string{signedTx.Hash().Hex()}) if err != nil { return "", err } return signedTx.Hash().Hex(), nil } func (c *Client) SystemPromptManagerTopup(contractAddr string, prkHex string, agentId int64, amount *big.Int) (string, error) { pbkHex, prk, err := c.parsePrkAuth(prkHex) if err != nil { return "", err } gasPrice, err := c.getGasPrice() if err != nil { return "", err } client, err := c.getClient() if err != nil { return "", err } instanceABI, err := systempromptmanager.SystemPromptManagerMetaData.GetAbi() if err != nil { return "", err } dataBytes, err := instanceABI.Pack( "topUpPoolBalance", big.NewInt(agentId), ) if err != nil { return "", err } contractAddress := helpers.HexToAddress(contractAddr) gasNumber, err := client.EstimateGas(context.Background(), ethereum.CallMsg{ From: pbkHex, To: &contractAddress, Data: dataBytes, Value: amount, }) if err != nil { return "", err } chainID, err := c.GetChainID() if err != nil { return "", err } nonceAt, err := c.PendingNonceAt(context.Background(), pbkHex) if err != nil { return "", err } rawTx := types.NewTx( &types.LegacyTx{ Nonce: nonceAt, GasPrice: gasPrice, Gas: (gasNumber * 2), To: &contractAddress, Value: amount, Data: dataBytes, }) signedTx, err := types.SignTx(rawTx, types.NewLondonSigner(big.NewInt(int64(chainID))), prk) if err != nil { return "", err } err = client.SendTransaction(context.Background(), signedTx) if err != nil { return "", err } return signedTx.Hash().Hex(), nil } func (c *Client) SystemPromptManagerMint(contractAddr string, prkHex string, to common.Address, uri string, data []byte, fee *big.Int) (string, error) { pbkHex, prk, err := c.parsePrkAuth(prkHex) if err != nil { return "", err } gasPrice, err := c.getGasPrice() if err != nil { return "", err } client, err := c.getClient() if err != nil { return "", err } instanceABI, err := systempromptmanager.SystemPromptManagerMetaData.GetAbi() if err != nil { return "", err } dataBytes, err := instanceABI.Pack( "mint", to, uri, data, fee, ) if err != nil { return "", err } contractAddress := helpers.HexToAddress(contractAddr) chainID, err := c.GetChainID() if err != nil { return "", err } var gasNumber uint64 if chainID == 964 { _, err = client.EstimateGas(context.Background(), ethereum.CallMsg{ From: pbkHex, To: &contractAddress, Data: dataBytes, Value: common.Big0, }) if err != nil { return "", err } gasNumber = 1000000 } else { gasNumber, err = client.EstimateGas(context.Background(), ethereum.CallMsg{ From: pbkHex, To: &contractAddress, Data: dataBytes, Value: common.Big0, }) if err != nil { return "", err } } nonceAt, err := c.PendingNonceAt(context.Background(), pbkHex) if err != nil { return "", err } rawTx := types.NewTx( &types.LegacyTx{ Nonce: nonceAt, GasPrice: gasPrice, Gas: (gasNumber * 2), To: &contractAddress, Value: common.Big0, Data: dataBytes, }) signedTx, err := types.SignTx(rawTx, types.NewLondonSigner(big.NewInt(int64(chainID))), prk) if err != nil { return "", err } err = client.SendTransaction(context.Background(), signedTx) if err != nil { return "", err } _, err = c.InscribeTxs([]string{signedTx.Hash().Hex()}) if err != nil { return "", err } return signedTx.Hash().Hex(), nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/ethapi/tokenfactory.go ================================================ package ethapi import ( "context" "math/big" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/helpers" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/binds/tokenfactory" "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/core/types" ) func (c *Client) TokenFactoryCreateToken(contractAddr string, prkHex string, name string, symbol string, amount *big.Int, recipient string, payoutRecipient string) (string, error) { pbkHex, prk, err := c.parsePrkAuth(prkHex) if err != nil { return "", err } gasPrice, gasTipCap, err := c.GetCachedGasPriceAndTipCap() if err != nil { return "", err } client, err := c.getClient() if err != nil { return "", err } instanceABI, err := tokenfactory.TokenFactoryMetaData.GetAbi() if err != nil { return "", err } dataBytes, err := instanceABI.Pack( "createToken", name, symbol, amount, helpers.HexToAddress(recipient), helpers.HexToAddress(payoutRecipient), ) if err != nil { return "", err } contractAddress := helpers.HexToAddress(contractAddr) value := big.NewInt(0) gasNumber, err := client.EstimateGas(context.Background(), ethereum.CallMsg{ From: pbkHex, To: &contractAddress, Data: dataBytes, Value: value, }) if err != nil { return "", err } chainID, err := c.GetChainID() if err != nil { return "", err } nonceAt, err := c.PendingNonceAt(context.Background(), pbkHex) if err != nil { return "", err } rawTx := types.NewTx(&types.DynamicFeeTx{ ChainID: big.NewInt(int64(chainID)), Nonce: nonceAt, GasFeeCap: gasPrice, GasTipCap: gasTipCap, Gas: (gasNumber * 2), To: &contractAddress, Value: value, Data: dataBytes, }) signedTx, err := types.SignTx(rawTx, types.NewLondonSigner(big.NewInt(int64(chainID))), prk) if err != nil { return "", err } err = client.SendTransaction(context.Background(), signedTx) if err != nil { return "", err } _, err = c.InscribeTxs([]string{signedTx.Hash().Hex()}) if err != nil { return "", err } return signedTx.Hash().Hex(), nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/ethapi/transparentupgradeableproxy.go ================================================ package ethapi import ( "math/big" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/binds/transparentupgradeableproxy" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" ) func (c *Client) DeployTransparentUpgradeableProxy(prkHex string, logic common.Address, admin common.Address, data []byte) (string, string, error) { _, prk, err := c.parsePrkAuth(prkHex) if err != nil { return "", "", err } chainID, err := c.GetChainID() if err != nil { return "", "", err } auth, err := bind.NewKeyedTransactorWithChainID(prk, big.NewInt(int64(chainID))) if err != nil { return "", "", err } client, err := c.getClient() if err != nil { return "", "", err } gasPrice, err := c.getGasPrice() if err != nil { return "", "", err } auth.GasPrice = gasPrice address, tx, _, err := transparentupgradeableproxy.DeployTransparentUpgradeableProxy(auth, client, logic, admin, data) if err != nil { return "", "", err } return address.Hex(), tx.Hash().Hex(), nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/ethapi/univ3.go ================================================ package ethapi import ( "math/big" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/helpers" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/binds/arbitrumnonfungiblepositionmanager" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/binds/arbitrumpool" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/binds/bscpool" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/binds/erc721" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/binds/memenonfungiblepositionmanager" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/binds/uniswapv3pool" "github.com/ethereum/go-ethereum/accounts/abi/bind" ) type UniV3SwapPositionInfo struct { Nonce *big.Int `json:"nonce"` Operator string `json:"opperator"` Token0 string `json:"token0"` Token1 string `json:"token1"` Fee *big.Int `json:"fee"` TickLower *big.Int `json:"tick_lower"` TickUpper *big.Int `json:"tick_upper"` Liquidity *big.Int `json:"liquidity"` FeeGrowthInside0LastX128 *big.Int `json:"fee_growth_inside0_last_x128"` FeeGrowthInside1LastX128 *big.Int `json:"fee_growth_inside1_last_x128"` TokensOwed0 *big.Int `json:"tokens_owed0"` TokensOwed1 *big.Int `json:"tokens_owed1"` Owner string `json:"owner"` NetworkID uint64 `json:"network_id"` } type SwapNonfungiblePositionManagerMintParams struct { Token0 string `json:"token0"` Token1 string `json:"token1"` Fee *big.Int `json:"fee"` TickLower *big.Int `json:"tick_lower"` TickUpper *big.Int `json:"tick_upper"` Amount0Desired *big.Int `json:"amount0_desired"` Amount1Desired *big.Int `json:"amount1_desired"` Amount0Min *big.Int `json:"amount0_min"` Amount1Min *big.Int `json:"amount1_min"` Deadline *big.Int `json:"deadline"` SqrtPriceX96 *big.Int `json:"sqrt_price_x96"` NetworkID uint64 `json:"network_id"` } type UniswapPositionLiquidity struct { TxHash string `json:"tx_hash"` ContractAddress string `json:"contract_address"` Timestamp uint64 `json:"timestamp"` Index uint `json:"log_index"` TxIndex uint `json:"tx_index"` BlockNumber uint64 `json:"block_number"` TokenId *big.Int `json:"token_id"` Liquidity *big.Int `json:"liquidity"` Amount0 *big.Int `json:"amount0"` Amount1 *big.Int `json:"amount1"` NetworkID uint64 `json:"network_id"` } func (c *Client) MemeNonfungiblePositionManagerPositionInfo(positionAddr string, tokenId *big.Int) (*UniV3SwapPositionInfo, error) { client, err := c.getClient() if err != nil { return nil, err } position, err := memenonfungiblepositionmanager.NewNonfungiblePositionManager(helpers.HexToAddress(positionAddr), client) if err != nil { return nil, err } info, err := position.Positions(&bind.CallOpts{}, tokenId) if err != nil { return nil, err } resp := &UniV3SwapPositionInfo{ Nonce: info.Nonce, Operator: info.Operator.Hex(), Token0: info.Token0.Hex(), Token1: info.Token1.Hex(), Fee: info.Fee, TickLower: info.TickLower, TickUpper: info.TickUpper, Liquidity: info.Liquidity, FeeGrowthInside0LastX128: info.FeeGrowthInside0LastX128, FeeGrowthInside1LastX128: info.FeeGrowthInside1LastX128, TokensOwed0: info.TokensOwed0, TokensOwed1: info.TokensOwed1, } nft, err := erc721.NewErc721(helpers.HexToAddress(positionAddr), client) if err != nil { return nil, err } ownerAddres, err := nft.OwnerOf(&bind.CallOpts{}, tokenId) if err != nil { return nil, err } resp.Owner = ownerAddres.Hex() return resp, nil } func (c *Client) CamelotNonfungiblePositionManagerPositionInfo(positionAddr string, tokenId *big.Int) (*UniV3SwapPositionInfo, error) { client, err := c.getClient() if err != nil { return nil, err } position, err := arbitrumnonfungiblepositionmanager.NewNonfungiblePositionManager(helpers.HexToAddress(positionAddr), client) if err != nil { return nil, err } info, err := position.Positions(&bind.CallOpts{}, tokenId) if err != nil { return nil, err } resp := &UniV3SwapPositionInfo{ Nonce: info.Nonce, Operator: info.Operator.Hex(), Token0: info.Token0.Hex(), Token1: info.Token1.Hex(), TickLower: info.TickLower, TickUpper: info.TickUpper, Liquidity: info.Liquidity, FeeGrowthInside0LastX128: info.FeeGrowthInside0LastX128, FeeGrowthInside1LastX128: info.FeeGrowthInside1LastX128, TokensOwed0: info.TokensOwed0, TokensOwed1: info.TokensOwed1, } nft, err := erc721.NewErc721(helpers.HexToAddress(positionAddr), client) if err != nil { return nil, err } ownerAddres, err := nft.OwnerOf(&bind.CallOpts{}, tokenId) if err != nil { return nil, err } resp.Owner = ownerAddres.Hex() return resp, nil } func (c *Client) UniswapV3PoolSlot0(poolAddr string) (*struct { SqrtPriceX96 *big.Int Tick *big.Int ObservationIndex uint16 ObservationCardinality uint16 ObservationCardinalityNext uint16 FeeProtocol uint8 Unlocked bool }, error) { client, err := c.getClient() if err != nil { return nil, err } pool, err := uniswapv3pool.NewUniswapv3pool(helpers.HexToAddress(poolAddr), client) if err != nil { return nil, err } resp, err := pool.Slot0(&bind.CallOpts{}) if err != nil { return nil, err } return &resp, nil } func (c *Client) PancakeswapV3PoolSlot0(poolAddr string) (*struct { SqrtPriceX96 *big.Int Tick *big.Int ObservationIndex uint16 ObservationCardinality uint16 ObservationCardinalityNext uint16 FeeProtocol uint32 Unlocked bool }, error) { client, err := c.getClient() if err != nil { return nil, err } pool, err := bscpool.NewPool(helpers.HexToAddress(poolAddr), client) if err != nil { return nil, err } resp, err := pool.Slot0(&bind.CallOpts{}) if err != nil { return nil, err } return &resp, nil } func (c *Client) UniswapV3PoolSlot0Arb(poolAddr string) (*struct { Price *big.Int Tick *big.Int FeeZto uint16 FeeOtz uint16 TimepointIndex uint16 CommunityFeeToken0 uint8 CommunityFeeToken1 uint8 Unlocked bool }, error) { client, err := c.getClient() if err != nil { return nil, err } pool, err := arbitrumpool.NewPool(helpers.HexToAddress(poolAddr), client) if err != nil { return nil, err } resp, err := pool.GlobalState(&bind.CallOpts{}) if err != nil { return nil, err } return &resp, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/ethapi/vibe_token.go ================================================ package ethapi import ( "math/big" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" ) func (c *Client) GetSignatureForDeployToken(prk string, vibeTokenFactoryAddress common.Address, networkID uint64, nonce [32]byte, name string, symbol string, creator common.Address, tickLower *big.Int, tickUpper *big.Int, deadline *big.Int) (string, error) { uint256Ty, _ := abi.NewType("uint256", "uint256", nil) bytes32Ty, _ := abi.NewType("bytes32", "bytes32", nil) addressTy, _ := abi.NewType("address", "address", nil) int24Ty, _ := abi.NewType("int24", "int24", nil) stringTy, _ := abi.NewType("string", "string", nil) args := abi.Arguments{ {Type: addressTy}, {Type: uint256Ty}, {Type: bytes32Ty}, {Type: stringTy}, {Type: stringTy}, {Type: addressTy}, {Type: int24Ty}, {Type: int24Ty}, {Type: uint256Ty}, } data, err := args.Pack( vibeTokenFactoryAddress, big.NewInt(int64(networkID)), nonce, name, symbol, creator, tickLower, tickUpper, deadline, ) if err != nil { return "", err } dataHash := crypto.Keccak256Hash( data, ) signature, err := c.SignWithEthereum(prk, dataHash.Bytes()) if err != nil { return "", err } return signature, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/ethapi/workerhub.go ================================================ package ethapi import ( "errors" "math/big" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/helpers" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/binds/iworkerhub" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" ) func (c *Client) WorkerHubAssignment(workerhubAddress string, assignmentId uint) (*big.Int, []byte, error) { if !common.IsHexAddress(workerhubAddress) { return nil, nil, errors.New("workerhubAddress is invalid") } client, err := c.getClient() if err != nil { return nil, nil, err } instance, err := iworkerhub.NewIWorkerHub(helpers.HexToAddress(workerhubAddress), client) if err != nil { return nil, nil, err } assignments, err := instance.GetAllAssignments(&bind.CallOpts{}, big.NewInt(int64(assignmentId)), big.NewInt(1)) if err != nil { return nil, nil, err } return assignments[0].InferenceId, assignments[0].Output, nil } func (c *Client) WorkerHubInference(workerhubAddress string, inferenceId uint) (*iworkerhub.IWorkerHubInference, error) { if !common.IsHexAddress(workerhubAddress) { return nil, errors.New("workerhubAddress is invalid") } client, err := c.getClient() if err != nil { return nil, err } instance, err := iworkerhub.NewIWorkerHub(helpers.HexToAddress(workerhubAddress), client) if err != nil { return nil, err } inference, err := instance.GetInferenceInfo(&bind.CallOpts{}, big.NewInt(int64(inferenceId))) if err != nil { return nil, err } return &inference, nil } func (c *Client) GetAssignmentByInferenceId(workerhubAddress string, inferenceId uint) ([]iworkerhub.IWorkerHubAssignment, error) { if !common.IsHexAddress(workerhubAddress) { return nil, errors.New("workerhubAddress is invalid") } client, err := c.getClient() if err != nil { return nil, err } instance, err := iworkerhub.NewIWorkerHub(helpers.HexToAddress(workerhubAddress), client) if err != nil { return nil, err } assignments, err := instance.GetAssignmentByInferenceId(&bind.CallOpts{}, big.NewInt(int64(inferenceId))) if err != nil { return nil, err } return assignments, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/evmapi/base.go ================================================ package evmapi import ( "math/big" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/binds/agentupgradeable" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/common" ) type BaseClient interface { WaitMined(hash string) error Transact(contractAddr string, prkHex string, input []byte, value *big.Int) (string, error) TransactionConfirmed(hash string) error InscribeTxs(txHashs []string) (string, error) SystemPromptManagerTopup(contractAddr string, prkHex string, agentId int64, amount *big.Int) (string, error) SystemPromptManagerMint(contractAddr string, prkHex string, to common.Address, uri string, data []byte, fee *big.Int) (string, error) IsContract(address string) (bool, error) ConvertAddressForIn(addr string) string ConvertAddressForOut(addr string) string Erc721Transfer(contractAddr string, prkHex string, toAddr string, tokenId *big.Int) (string, error) DeployERC20RealWorldAgent(prkHex string, name string, symbol string, amount *big.Int, recipient common.Address, minFeeToUse *big.Int, timeout uint32, tokenFee common.Address, worker common.Address) (string, string, error) DeployERC20UtilityAgent(prkHex string, name string, symbol string, amount *big.Int, recipient common.Address, systemPrompt string, storageInfo []byte) (string, string, error) DeployTransparentUpgradeableProxy(prkHex string, logic common.Address, admin common.Address, data []byte) (string, string, error) } func AgentUpgradeableInitializeData(agentName string, agentVersion string, codeLanguage string, pointers []agentupgradeable.IAgentCodePointer, depsAgents []common.Address, agentOwner common.Address, registrar common.Address, resolver common.Address, duration uint) ([]byte, error) { typeAddress, err := abi.NewType("address", "", nil) if err != nil { panic(err) } typeUint256, err := abi.NewType("uint256", "", nil) if err != nil { panic(err) } arguments := abi.Arguments{ {Type: typeAddress}, {Type: typeAddress}, {Type: typeUint256}, } nameService, err := arguments.Pack(registrar, resolver, big.NewInt(int64(duration))) if err != nil { panic(err) } instanceABI, err := agentupgradeable.AgentUpgradeableMetaData.GetAbi() if err != nil { return nil, err } dataBytes, err := instanceABI.Pack( "initialize", agentName, agentVersion, codeLanguage, pointers, depsAgents, agentOwner, nameService, ) if err != nil { return nil, err } return dataBytes, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/googlestorage/client.go ================================================ package googlestorage import ( "bytes" "context" "encoding/base64" "fmt" "io" "mime/multipart" "cloud.google.com/go/storage" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "google.golang.org/api/option" ) type Client struct { gsClient *storage.BucketHandle } func InitClient(credentialsFile string, bucketName string) *Client { opt := option.WithCredentialsFile(credentialsFile) ctx := context.Background() client, err := storage.NewClient(ctx, opt) if err != nil { return &Client{ gsClient: nil, } } return &Client{ gsClient: client.Bucket(bucketName), } } func (c *Client) UploadPublicDataFile(folder string, fileName string, fileBytes []byte) (string, error) { fullPathImg := fmt.Sprintf("%s/%s", folder, fileName) if c.gsClient == nil { return "", errs.NewError(errs.ErrBadRequest) } w := c.gsClient.Object(fullPathImg).NewWriter(context.Background()) if _, err := io.Copy(w, bytes.NewReader(fileBytes)); err != nil { return "", errs.NewError(err) } if err := w.Close(); err != nil { return "", errs.NewError(err) } return fullPathImg, nil } func (c *Client) UploadPublicMultipartFile(folder string, fileName string, file multipart.File, handle *multipart.FileHeader) (string, error) { fullPathImg := fmt.Sprintf("%s/%s", folder, fileName) if c.gsClient == nil { return "", errs.NewError(errs.ErrBadRequest) } w := c.gsClient.Object(fullPathImg).NewWriter(context.Background()) w.ContentType = handle.Header.Get("Content-Type") if _, err := io.Copy(w, file); err != nil { return "", errs.NewError(err) } if err := w.Close(); err != nil { return "", errs.NewError(err) } return fullPathImg, nil } func (c *Client) UploadPublicDataBase64(folder string, fileName string, stringBase64 string) (string, error) { fullPathImg := fmt.Sprintf("%s/%s", folder, fileName) if c.gsClient == nil { return "", errs.NewError(errs.ErrBadRequest) } w := c.gsClient.Object(fullPathImg).NewWriter(context.Background()) decoded, err := base64.StdEncoding.DecodeString(string([]byte(stringBase64))) if err != nil { fmt.Println(err) } if _, err := io.Copy(w, bytes.NewReader(decoded)); err != nil { return "", errs.NewError(err) } if err := w.Close(); err != nil { return "", errs.NewError(err) } return fullPathImg, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/hiro/hiro.go ================================================ package hiro import ( "encoding/json" "errors" "fmt" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/helpers" ) type HiroService struct { url string apiKey string //b5400021ebc9489a9fe8a4544f663b53 headers map[string]string } func NewHiroService(baseUrl string) *HiroService { obj := &HiroService{ url: baseUrl, headers: make(map[string]string), } obj.headers["Accept"] = "*/*" return obj } func (s *HiroService) GetInscriptionInfo(inscriptionId string) (*HiroInscriptionInfo, error) { url := fmt.Sprintf(s.url+"/ordinals/v1/inscriptions/%s", inscriptionId) respBytes, _, httpStatus, err := helpers.HttpRequest(url, "GET", s.headers, nil) if err != nil { return nil, err } if httpStatus != 200 { return nil, errors.New("invalid") } resp := &HiroInscriptionInfo{} err = json.Unmarshal(respBytes, resp) if err != nil { return nil, err } return resp, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/hiro/structs.go ================================================ package hiro type HiroInscriptionInfo struct { Id string `json:"id"` Number int `json:"number"` Address string `json:"address"` GenesisAddress string `json:"genesis_address"` GenesisBlockHeight int `json:"genesis_block_height"` GenesisBlockHash string `json:"genesis_block_hash"` GenesisTxId string `json:"genesis_tx_id"` GenesisFee string `json:"genesis_fee"` GenesisTimestamp int64 `json:"genesis_timestamp"` TxId string `json:"tx_id"` Location string `json:"location"` Output string `json:"output"` Value string `json:"value"` Offset string `json:"offset"` SatOrdinal string `json:"sat_ordinal"` SatRarity string `json:"sat_rarity"` SatCoinbaseHeight int `json:"sat_coinbase_height"` MimeType string `json:"mime_type"` ContentType string `json:"content_type"` ContentLength int `json:"content_length"` Timestamp int64 `json:"timestamp"` CurseType interface{} `json:"curse_type"` Recursive bool `json:"recursive"` RecursionRefs interface{} `json:"recursion_refs"` Parent interface{} `json:"parent"` Metadata struct { Attributes []struct { TraitType string `json:"trait_type"` Value string `json:"value"` } `json:"attributes"` Name string `json:"name"` } `json:"metadata"` } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/lighthouse/lighthouse.go ================================================ package lighthouse import ( "bytes" "context" "crypto/tls" "encoding/json" "fmt" "io" "log" "mime/multipart" "net/http" "net/url" "os" "path" "path/filepath" "strconv" "strings" "time" "github.com/gabriel-vasile/mimetype" "github.com/go-resty/resty/v2" "github.com/pkg/errors" ) type LightHouseResponse struct { Name string `json:"Name"` Hash string `json:"Hash"` Size string `json:"Size"` } const ( IPFSGateway = "https://gateway.lighthouse.storage/ipfs/" ) func DownloadDataSimple(hash string) ([]byte, string, error) { if strings.Contains(hash, "ipfs://") { hash = strings.Replace(hash, "ipfs://", "", 1) } urlLink := fmt.Sprintf("https://cdn.eternalai.org/upload/%s", hash) resp, err := http.Get(urlLink) if err != nil { return nil, "", fmt.Errorf("error when try get reponse :%v", err) } if resp == nil { return nil, "", fmt.Errorf("error when try get reponse ==nil") } defer resp.Body.Close() if resp.StatusCode != http.StatusOK { if resp.StatusCode == http.StatusNotFound { return DownloadDataSimpleFromLighthouse(hash) } return nil, "", fmt.Errorf("error when try get data url :%v => reponse code :%v", urlLink, resp.StatusCode) } body, err := io.ReadAll(resp.Body) if err != nil { return nil, "", fmt.Errorf("error when read body from reponse :%v", err) } mtype := mimetype.Detect(body) return body, mtype.String(), nil } func DownloadDataSimpleFromLighthouse(hash string) ([]byte, string, error) { if strings.Contains(hash, "ipfs://") { hash = strings.Replace(hash, "ipfs://", "", 1) } urlLink := fmt.Sprintf("https://gateway.lighthouse.storage/ipfs/%s", hash) resp, err := http.Get(urlLink) if err != nil { return nil, "", fmt.Errorf("error when try get reponse :%v", err) } if resp == nil { return nil, "", fmt.Errorf("error when try get reponse ==nil") } if resp.StatusCode != http.StatusOK { return nil, "", fmt.Errorf("error when try get data url :%v => reponse code :%v", urlLink, resp.StatusCode) } body, err := io.ReadAll(resp.Body) if err != nil { return nil, "", fmt.Errorf("error when read body from reponse :%v", err) } mtype := mimetype.Detect(body) return body, mtype.String(), nil } func downloadChunkedData(hash string, start, end int) ([]byte, error) { urlLink := fmt.Sprintf("https://gateway.lighthouse.storage/ipfs/%s", hash) req, err := http.NewRequest("GET", urlLink, nil) if err != nil { return nil, errors.WithStack(err) } req.Header.Add("Range", fmt.Sprintf("bytes=%d-%d", start, end)) client := &http.Client{} resp, err := client.Do(req) if err != nil { return nil, errors.WithStack(err) } body, err := io.ReadAll(resp.Body) if err != nil { return nil, errors.WithStack(err) } return body, nil } func DownloadChunkedData(hash string, modelDir string) (string, error) { // check folder exist first, if not create err := os.MkdirAll(modelDir, os.ModePerm) if err != nil { return "", err } fileInfo, err := GetFileInfo(hash) if err != nil { return "", err } fileSize, err := strconv.ParseInt(fileInfo.FileSizeInBytes, 10, 64) if err != nil { return "", err } filePath := path.Join(modelDir, fmt.Sprintf("model.zip")) if _, err := os.Stat(filePath); err == nil { return filePath, nil } var chunkSize int64 = 1024 * 1024 * 10 // 10MB var start int64 = 0 var end int64 = chunkSize parts := fileSize / chunkSize log.Println("parts: ", parts) part := 0 for start < fileSize { if end > fileSize { end = fileSize } log.Println("part: ", part, "start: ", start, "end: ", end) data, err := downloadChunkedData(hash, int(start), int(end)) if err != nil { return "", err } err = WriteFile(filePath, data, os.ModePerm) if err != nil { return "", err } start = end + 1 end += chunkSize part++ } return filePath, nil } func WriteFile(name string, data []byte, perm os.FileMode) error { f, err := os.OpenFile(name, os.O_APPEND|os.O_WRONLY|os.O_CREATE, perm) if err != nil { return err } _, err = f.Write(data) if err1 := f.Close(); err1 != nil && err == nil { err = err1 } return err } type FileInfo struct { FileSizeInBytes string `json:"fileSizeInBytes"` Cid string `json:"cid"` Encryption bool `json:"encryption"` FileName string `json:"fileName"` MimeType string `json:"mimeType"` TxHash string `json:"txHash"` Error struct { Code int `json:"code"` Message string `json:"message"` } `json:"error"` } func GetFileInfo(hash string) (*FileInfo, error) { urlLink := fmt.Sprintf("https://api.lighthouse.storage/api/lighthouse/file_info?cid=%s", hash) resp, err := http.Get(urlLink) if err != nil { return nil, errors.WithStack(err) } body, err := io.ReadAll(resp.Body) if err != nil { return nil, errors.WithStack(err) } // log.Println("body", string(body)) var respBody FileInfo err = json.Unmarshal(body, &respBody) if err != nil { return nil, errors.WithStack(err) } if respBody.Error.Code != 0 { return &respBody, errors.New(respBody.Error.Message) } return &respBody, nil } func UploadData(apikey, fileName string, data []byte) (string, error) { // cid, exist, err := fileExistOnNetwork(data) // if err != nil { // return "", err // } // if exist { // return cid, nil // } urlLink := "https://node.lighthouse.storage/api/v0/add" var b bytes.Buffer w := multipart.NewWriter(&b) fw, err := w.CreateFormFile("file", fileName) if err != nil { return "", err } if _, err = fw.Write(data); err != nil { return "", err } w.Close() req, err := http.NewRequest( "POST", urlLink, &b, ) if err != nil { return "", errors.WithStack(err) } client := &http.Client{} req.Header.Add("accept", "application/json") req.Header.Add("content-type", w.FormDataContentType()) req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", apikey)) resp, err := client.Do(req) if err != nil { return "", errors.WithStack(err) } body, err := io.ReadAll(resp.Body) if err != nil { return "", errors.WithStack(err) } log.Println("body", string(body)) var respBody LightHouseResponse err = json.Unmarshal(body, &respBody) if err != nil { return "", errors.WithStack(err) } return respBody.Hash, nil } func getCurrentDir() string { ex, err := os.Executable() if err != nil { panic(err) } exPath := filepath.Dir(ex) return exPath } /* func Cid(data []byte) string { ds := dsync.MutexWrap(datastore.NewNullDatastore()) bs := blockstore.NewBlockstore(ds) bs = blockstore.NewIdStore(bs) bsrv := blockservice.New(bs, offline.Exchange(bs)) dsrv := merkledag.NewDAGService(bsrv) ufsImportParams := uih.DagBuilderParams{ Maxlinks: uih.BlockSizeLimit, // Default max of 174 links per block RawLeaves: false, CidBuilder: cid.V0Builder{}, Dagserv: dsrv, NoCopy: false, } reader := bytes.NewReader(data) ufsBuilder, err := ufsImportParams.New(chunker.NewSizeSplitter(reader, chunker.DefaultBlockSize)) // 256KiB chunks if err != nil { return cid.Undef.String() } nd, err := balanced.Layout(ufsBuilder) if err != nil { return cid.Undef.String() } return nd.Cid().String() } func fileExistOnNetwork(data []byte) (string, bool, error) { cid := Cid(data) log.Println("Check file exist: ", "cid", cid) fileInfo, err := GetFileInfo(cid) if err != nil { if fileInfo != nil && fileInfo.Error.Code == 404 { return "", false, nil } return "", false, err } return cid, true, nil }*/ func UploadFile(apikey, fileName string, filePath string) (string, error) { data, err := os.ReadFile(filePath) if err != nil { return "", err } /*cid, exist, err := fileExistOnNetwork(data) if err != nil { return "", err } if exist { return cid, nil }*/ urlLink := "https://node.lighthouse.storage/api/v0/add" var b bytes.Buffer w := multipart.NewWriter(&b) fw, err := w.CreateFormFile("file", fileName) if err != nil { return "", err } if _, err = fw.Write(data); err != nil { return "", err } w.Close() req, err := http.NewRequest( "POST", urlLink, &b, ) if err != nil { return "", fmt.Errorf("err when init upload request err:%v", err) } client := &http.Client{} req.Header.Add("accept", "application/json") req.Header.Add("content-type", w.FormDataContentType()) req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", apikey)) resp, err := client.Do(req) if err != nil { return "", fmt.Errorf("err when execute upload request err:%v", err) } body, err := io.ReadAll(resp.Body) if err != nil { return "", fmt.Errorf("err when read body err:%v", err) } var respBody LightHouseResponse err = json.Unmarshal(body, &respBody) if err != nil { return "", fmt.Errorf("err when parse json body:%v,err:%v", body, err) } return respBody.Hash, nil } func DownloadToFile(hash string, filePath string) error { dir := filepath.Dir(filePath) err := os.MkdirAll(dir, os.ModePerm) if err != nil { return err } if _, err := os.Stat(filePath); err == nil { return nil } data, _, err := DownloadDataSimple(hash) if err != nil { return err } f, err := os.OpenFile(filePath, os.O_APPEND|os.O_WRONLY|os.O_CREATE, os.ModePerm) if err != nil { return err } _, err = f.Write(data) if err != nil { f.Close() os.Remove(filePath) return err } err = f.Close() if err != nil { os.Remove(filePath) } return nil } func UploadDataWithRetry(apikey, fileName string, data []byte) (string, error) { var err error var hash string for i := 0; i < 3; i++ { hash, err = UploadData(apikey, fileName, data) if err != nil { time.Sleep(1 * time.Second) continue } return hash, nil } return hash, err } func UploadDataFileByUrl(ctx context.Context, apikey, rawUrl string) (string, error) { parsedUrl, err := url.ParseRequestURI(rawUrl) if err != nil { return "", err } client := resty.New().SetTLSClientConfig(&tls.Config{InsecureSkipVerify: true}) res, err := client.R().SetContext(ctx).Get(rawUrl) if err != nil { return "", err } fileName := strings.Replace(res.Header().Get("Content-Disposition"), "attachment; filename=", "", -1) fileName = strings.Replace(fileName, "attachment;filename=", "", -1) if fileName == "" { filePath := parsedUrl.Path fileName = path.Base(filePath) } return UploadDataWithRetry(apikey, fileName, res.Body()) } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/lighthouse/zip_upload.go ================================================ package lighthouse import ( "bufio" "encoding/json" "fmt" "io" "log" "os" "os/exec" "path" "path/filepath" "runtime" "strconv" "strings" "time" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/pkg/utils" ) var ( ZipChunkSize = 200 // MB BASH_EXEC = getBashExecutable() THREADS = runtime.NumCPU() - 1 ) type FileDetail struct { Name string `json:"name"` Hash string `json:"hash"` Index int `json:"index"` } type FileInLightHouse struct { Name string `json:"name"` IsInserted bool `json:"is_inserted"` IsPart bool `json:"is_part"` CountPart int `json:"count_part"` Files []*FileDetail `json:"files"` } func getBashExecutable() string { bashPath, err := exec.LookPath("bash") if err != nil { fmt.Println("Bash not found. Please install bash") return "" } return bashPath } func executeCommand(fileCmd string) ([]byte, error) { commandId := strconv.FormatInt(time.Now().UnixMicro(), 10) fileLog := fmt.Sprintf("/tmp/log_%v.txt", commandId) execCmd := fmt.Sprintf("%v %v 2>&1 | /usr/bin/tee %v", BASH_EXEC, fileCmd, fileLog) fileExec := fmt.Sprintf("/tmp/bash_%v.sh", commandId) if err := os.WriteFile(fileExec, []byte(execCmd), 0o644); err != nil { return nil, err } command := exec.Command(BASH_EXEC, fileExec) out, err := command.Output() if err != nil { return out, err } return os.ReadFile(fileLog) } func getScriptZipFile(fileFolder string, baseDir string) (string, error) { tmpPath := path.Join("/tmp", fileFolder) filePath := fmt.Sprintf("%s/zip-file-%v.sh", tmpPath, fileFolder) if err := removeFileIfExists(filePath); err != nil { return "", err } file, err := os.Create(filePath) if err != nil { return "", fmt.Errorf("error creating file: %v", err) } defer file.Close() commands := []string{ fmt.Sprintf("cd %v", baseDir), fmt.Sprintf("rm -Rf %v.zip.part-*", fileFolder), fmt.Sprintf("tar -cf - %v | pigz --best -p %v | split -b %vM - %v.zip.part-", fileFolder, THREADS, ZipChunkSize, fileFolder), } for _, cmd := range commands { if _, err := file.WriteString(cmd + " \n "); err != nil { return "", fmt.Errorf("error writing to file: %v", err) } } return filePath, nil } func removeFileIfExists(filePath string) error { if _, err := os.Stat(filePath); err == nil { if err := os.Remove(filePath); err != nil { return fmt.Errorf("error removing file: %v", err) } } return nil } func getScriptUnZipFile(fileFolder string, parentDir string) (string, error) { model := fmt.Sprintf("unzip-%v.sh", fileFolder) filePath := filepath.Join("/tmp", fileFolder, model) if err := removeFileIfExists(filePath); err != nil { return "", err } file, err := os.Create(filePath) if err != nil { return "", fmt.Errorf("error creating file:%v", err) } defer file.Close() if _, err = file.WriteString(fmt.Sprintf("cd %v \n ", parentDir)); err != nil { return "", fmt.Errorf("error write file:%v", err) } _, err = file.WriteString( fmt.Sprintf("cat %v.zip.part-* | pigz -p %v -d | tar -xf -", fileFolder, 2), ) if err != nil { return "", fmt.Errorf("error write file:%v", err) } return filePath, nil } func getListZipFile(fileFolder string, parentDir string) ([]string, error) { tmpPath := path.Join("/tmp", fileFolder) filePath := fmt.Sprintf("%s/list-zip-file-%v.sh", tmpPath, fileFolder) if err := removeFileIfExists(filePath); err != nil { return nil, err } file, err := os.Create(filePath) if err != nil { return nil, fmt.Errorf("error creating file:%v", err) } defer file.Close() _, err = file.WriteString(fmt.Sprintf("rm %s/list_file_%v.txt \n", tmpPath, fileFolder)) if err != nil { return nil, fmt.Errorf("error write file:%v", err) } _, err = file.WriteString(fmt.Sprintf("cd %v \n", parentDir)) if err != nil { return nil, fmt.Errorf("error write file:%v", err) } _, err = file.WriteString(fmt.Sprintf("ls %v.zip.part-* > %s/list_file_%v.txt \n", fileFolder, tmpPath, fileFolder)) if err != nil { return nil, fmt.Errorf("error write file:%v", err) } output, err := executeCommand(fmt.Sprintf("%s/list-zip-file-%v.sh ", tmpPath, fileFolder)) if err != nil { return nil, fmt.Errorf("error when execute file:%v , output:%v", err, string(output)) } file, err = os.Open(fmt.Sprintf("%s/list_file_%v.txt", tmpPath, fileFolder)) if err != nil { return nil, fmt.Errorf("error opening file:%v", err) } scanner := bufio.NewScanner(file) listFile := make([]string, 0) for scanner.Scan() { line := scanner.Text() listFile = append(listFile, line) } if err := scanner.Err(); err != nil { return nil, fmt.Errorf("error reading file:,%v", err) } return listFile, nil } func uploadListZipFileToLightHouse(fileFolder string, baseDir string, apiKey string) (*FileInLightHouse, error) { listFile, err := getListZipFile(fileFolder, baseDir) if err != nil { return nil, err } if len(listFile) == 0 { return nil, fmt.Errorf("no files pattern %v.zip.part-* found in folder %v", fileFolder, baseDir) } result := &FileInLightHouse{ Name: fileFolder, CountPart: len(listFile), IsPart: true, Files: make([]*FileDetail, 0), } for i, file := range listFile { log.Println("Start upload model: ", fileFolder, "chunk: ", i, "file: ", file) for j := 0; j < 10; i++ { filePath := fmt.Sprintf("%v/%v", baseDir, file) cid, err := UploadFile(apiKey, file, filePath) if err != nil { log.Println("Error when upload model ", fileFolder, "retry", j, "chunk", i, "file", file, "err", err) time.Sleep(2 * time.Minute) continue } else { log.Println("Finish upload model: ", fileFolder, "chunk: ", i, "file: ", file, "==> hash: ", cid) result.Files = append(result.Files, &FileDetail{Name: file, Hash: cid, Index: i + 1}) break } } } return result, nil } func uploadFileResultToLightHouse(info *FileInLightHouse, apiKey string) (string, error) { data, _ := json.Marshal(info) return UploadData(apiKey, info.Name, data) } func getFileResultFromLightHouse(hash string) (*FileInLightHouse, error) { data, _, err := DownloadDataSimple(hash) if err != nil { return nil, err } result := &FileInLightHouse{} if err = json.Unmarshal(data, result); err != nil { return nil, err } return result, nil } func downloadZipFileFromLightHouse(info *FileInLightHouse, baseDir string) error { for _, file := range info.Files { log.Println( "Start download: ", "file: ", file.Name, "hash: ", file.Hash, "path: ", baseDir, ) for { filePath := filepath.Join(baseDir, file.Name) if err := DownloadToFile(file.Hash, filePath); err != nil { log.Println( "Error when try down file from light house", "file", file.Name, "hash", file.Hash, "err", err.Error(), ) time.Sleep(2 * time.Minute) continue } break } } log.Println("Success download all zip file:", "file name", info.Name) return nil } func DownloadFileFromLightHouse(hash string, hfDir string) error { info, err := getFileResultFromLightHouse(hash) if err != nil { return fmt.Errorf("error when get model info from light house hash : %v err :%v ", hash, err) } if err = downloadZipFileFromLightHouse(info, hfDir); err != nil { return fmt.Errorf("error when download zip chunk file:%v ", err) } scriptFile, err := getScriptUnZipFile(info.Name, hfDir) if err != nil { return fmt.Errorf("error when get unzip script file:%v ", err) } log.Println("Start unzip list files") output, err := executeCommand(scriptFile) if err != nil { return fmt.Errorf("error when execute file:%v , output:%v", err, string(output)) } log.Println("Success unzip model ", info.Name) unzipFolder := filepath.Join(hfDir, info.Name) files, err := os.ReadDir(filepath.Join(hfDir, info.Name)) if err != nil { return fmt.Errorf("error when read dir:%v , err:%v", unzipFolder, err.Error()) } for _, file := range files { fmt.Printf("%s/%s\n", info.Name, file.Name()) } return nil } func ZipAndUploadFileInMultiplePartsToLightHouse(fileFolder string, baseDir string, apiKey string) (string, error) { tmpPath := path.Join("/tmp", fileFolder) _ = utils.CreateFolderIfNotExists(tmpPath) scriptFile, err := getScriptZipFile(fileFolder, baseDir) if err != nil { return "", fmt.Errorf("error when get script zip file:%v ", err) } log.Println("Start compress file") output, err := executeCommand(scriptFile) if err != nil { return "", fmt.Errorf("error when execute file:%v , output:%v", err, string(output)) } log.Println("Finish compress file . Start upload file") result, err := uploadListZipFileToLightHouse(fileFolder, baseDir, apiKey) if err != nil { return "", fmt.Errorf("error when upload list zip file to light house :%v ", err) } hash, err := uploadFileResultToLightHouse(result, apiKey) if err != nil { return "", fmt.Errorf("error when upload model result to light house :%v ", err) } return hash, nil } func UploadFileInMultiplePartsToLightHouse(fileFolder string, baseDir string, apiKey string) (string, error) { log.Println("Start upload model") tmpPath := path.Join("/tmp", fileFolder) _ = utils.CreateFolderIfNotExists(tmpPath) result, err := uploadListZipFileToLightHouse(fileFolder, baseDir, apiKey) if err != nil { return "", fmt.Errorf("error when upload list zip file to light house :%v ", err) } hash, err := uploadFileResultToLightHouse(result, apiKey) if err != nil { return "", fmt.Errorf("error when upload model result to light house :%v ", err) } return hash, nil } func fileSizeInMB(filePath string) (float64, error) { fileInfo, err := os.Stat(filePath) if err != nil { return 0, err // Return the error from os.Stat } fileSize := fileInfo.Size() // Size in bytes fileSizeMB := float64(fileSize) / (1024 * 1024) // Convert to MB return fileSizeMB, nil } func readFile(filePath string) ([]byte, error) { file, err := os.Open(filePath) if err != nil { return nil, err } defer file.Close() fileInfo, err := file.Stat() if err != nil { return nil, err } fileSize := fileInfo.Size() buffer := make([]byte, fileSize) _, err = io.ReadFull(file, buffer) if err != nil { return nil, err } return buffer, nil } func ZipAndUploadFileInMultiplePartsToLightHouseByUrl(url string, baseDir string, apiKey string) (*FileInLightHouse, error) { _ = utils.CreateFolderIfNotExists(baseDir) fullFilePath, fileName, err := utils.DownloadFileByUrl(url, baseDir) if err != nil { return nil, fmt.Errorf("error when download file:%v ", err) } fileSize, err := fileSizeInMB(fullFilePath) if err != nil { return nil, fmt.Errorf("error when get file size:%v ", err) } fileFolder := strings.TrimSuffix(fileName, filepath.Ext(fileName)) if fileSize < float64(ZipChunkSize) { bytes, err := readFile(fullFilePath) if err != nil { return nil, fmt.Errorf("error when read file:%v ", err) } hash, err := UploadDataWithRetry(apiKey, fileName, bytes) if err != nil { return nil, fmt.Errorf("error when upload file:%v ", err) } return &FileInLightHouse{ Name: fileName, IsPart: false, Files: []*FileDetail{ {Name: fileName, Hash: hash, Index: 1}, }, }, nil } tmpPath := path.Join("/tmp", fileFolder) _ = utils.CreateFolderIfNotExists(tmpPath) scriptFile, err := getScriptZipFile(fileFolder, baseDir) if err != nil { return nil, fmt.Errorf("error when get script zip file:%v ", err) } log.Println("Start compress file") output, err := executeCommand(scriptFile) if err != nil { return nil, fmt.Errorf("error when execute file:%v , output:%v", err, string(output)) } log.Println("Finish compress file . Start upload file") result, err := uploadListZipFileToLightHouse(fileFolder, baseDir, apiKey) if err != nil { return nil, fmt.Errorf("error when upload list zip file to light house :%v ", err) } return result, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/lighthouse/zip_upload_test.go ================================================ package lighthouse import ( "reflect" "testing" ) func TestZipAndUploadFileInMultiplePartsToLightHouseByUrl(t *testing.T) { type args struct { filename string fileDir string } tests := []struct { name string args args want []string wantErr bool }{ { name: "Test Case 1", args: args{filename: "test1", fileDir: ""}, }, } for _, tt := range tests { t.Run( tt.name, func(t *testing.T) { got, err := ZipAndUploadFileInMultiplePartsToLightHouseByUrl( "url", "/tmp/data", "lighthouse-key") if (err != nil) != tt.wantErr { t.Errorf("getListZipFile() error = %v, wantErr %v", err, tt.wantErr) return } if !reflect.DeepEqual(got, tt.want) { t.Errorf("getListZipFile() = %v, want %v", got, tt.want) } }, ) } } func TestDownloadHFModelFromLightHouse(t *testing.T) { type args struct { hash string hfDir string } tests := []struct { name string args args wantErr bool }{ { name: "Test Case 1", args: args{hash: "filecoin-hash", hfDir: "/tmp/download"}, }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { if err := DownloadFileFromLightHouse(tt.args.hash, tt.args.hfDir); (err != nil) != tt.wantErr { t.Errorf("DownloadHFModelFromLightHouse() error = %v, wantErr %v", err, tt.wantErr) } }) } } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/magiceden/magiceden.go ================================================ package magiceden import ( "encoding/json" "errors" "fmt" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/helpers" ) type MagicEdenService struct { url string apiKey string //b5400021ebc9489a9fe8a4544f663b53 headers map[string]string } func NewMagicedenService() *MagicEdenService { obj := &MagicEdenService{ url: "https://api-mainnet.magiceden.io/v2", //os.Getenv("MAGICEDEN_URL"), headers: make(map[string]string), } //obj.headers["Authorization"] = "Bearer " + os.Getenv("MAGICEDEN_API_TOKEN") obj.headers["Accept"] = "*/*" obj.headers["User-Agent"] = "PostmanRuntime/7.37.3" obj.headers["Cookie"] = "__cf_bm=hL5OTJxF7noZcx.misHDUHHwPb71OMEH4Q_vf_400nA-1733464224-1.0.1.1-ubLBHYlzscNudJVTQQpzGKbBZ0oVQj.hgrwKpY.fuFiPvcoBpn8INX0Esfb_s9J9oxA3dLBIAvL9YlSDk9amgQ; _cfuvid=oq3NYPdYmReJ8dyHHPYNeLXeHTKXnzcURY2qIH1.g1A-1733464224460-0.0.1.1-604800000" return obj } func (s *MagicEdenService) GetInscriptionInfo(inscriptionId string) (*MagicedenInscriptionInfo, error) { url := fmt.Sprintf(s.url+"/ord/btc/tokens/%s", inscriptionId) respBytes, _, httpStatus, err := helpers.HttpRequest(url, "GET", s.headers, nil) if err != nil { return nil, err } if httpStatus != 200 { return nil, errors.New(fmt.Sprintf("status %d", httpStatus)) } resp := &MagicedenInscriptionInfo{} err = json.Unmarshal(respBytes, resp) if err != nil { return nil, err } return resp, nil } // used for get inscriptions type Inscription struct { Cohort string `json:"cohort"` Name string `json:"name"` CollectionSymbol string `json:"collectionSymbol"` CollectionId string `json:"collectionId"` Vol float64 `json:"vol"` TotalVol float64 `json:"totalVol"` TotalTxns int `json:"totalTxns"` VolPctChg float64 `json:"volPctChg,omitempty"` Txns int `json:"txns"` TxnsPctChg float64 `json:"txnsPctChg,omitempty"` Fp float64 `json:"fp"` FpPctChg float64 `json:"fpPctChg,omitempty"` FpListingPrice float64 `json:"fpListingPrice"` FpListingCurrency string `json:"fpListingCurrency"` HighestGlobalOfferBidCurrency string `json:"highestGlobalOfferBidCurrency"` MarketCap float64 `json:"marketCap"` TotalSupply int `json:"totalSupply"` ListedCount int `json:"listedCount"` OwnerCount int `json:"ownerCount"` UniqueOwnerRatio float64 `json:"uniqueOwnerRatio"` Image string `json:"image"` IsCompressed bool `json:"isCompressed"` HasInscriptions bool `json:"hasInscriptions"` Currency string `json:"currency"` Pending int `json:"pending"` CurrencyUsdRate float64 `json:"currencyUsdRate"` MarketCapUsd float64 `json:"marketCapUsd"` FpSparkLinePath string `json:"fpSparkLinePath"` Description string `json:"description"` } func (s *MagicEdenService) GetInscriptionHardCode() ([]Inscription, error) { bytes := []byte(INSC_COLLECTIONS) resp := []Inscription{} err := json.Unmarshal(bytes, &resp) if err != nil { return nil, err } return resp, nil } func (s *MagicEdenService) GetCollectionInfo(collection string) (*CollectionInfo, error) { url := fmt.Sprintf("https://api-mainnet.magiceden.io/v2/ord/btc/collections/%s", collection) respBytes, _, httpStatus, err := helpers.HttpRequest(url, "GET", s.headers, nil) if httpStatus != 200 { return nil, errors.New(fmt.Sprintf("status %d", httpStatus)) } if err != nil { return nil, err } resp := &CollectionInfo{} err = json.Unmarshal(respBytes, resp) if err != nil { return nil, err } return resp, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/magiceden/magiceden_hardcode.go ================================================ package magiceden const INSC_COLLECTIONS = `[{ "cohort": "ordinal", "name": "Perceptrons", "collectionSymbol": "perceptrons", "collectionId": "perceptrons", "vol": 35.46603338, "totalVol": 2903.3036861, "totalTxns": 30094, "volPctChg": 40.27993582, "txns": 231, "txnsPctChg": 26.2295082, "fp": 0.16, "fpPctChg": 12.7634082740151, "fpListingPrice": 0.16, "fpListingCurrency": "BTC", "highestGlobalOfferBidCurrency": "BTC", "marketCap": 1600.16, "totalSupply": 10001, "listedCount": 1036, "ownerCount": 6653, "uniqueOwnerRatio": 0.665233476652335, "image": "https://bafybeie5hgj7s6beekegwgchhy55vl53am5ydiguisjj32nq3ou3eit2ry.ipfs.nftstorage.link/", "isCompressed": false, "hasInscriptions": false, "currency": "BTC", "pending": 2, "currencyUsdRate": 102384.671446517, "marketCapUsd": 163831855.861858, "fpSparkLinePath": "", "description": "Perceptrons is an experimental attempt to deploy run-time AI on-chain. While many projects have attempted to store AI artworks (outputs from AI models) on-chain, Perceptrons attempts to store the actual AI models themselves (the neural networks that produce the outputs) on-chain. Not only are the models stored on-chain, but the feed-forward algorithm is also stored on-chain. Not merely a static piece of art—you can interact with Perceptrons by asking them to do image recognition tasks. Perceptrons permanently live on the Bitcoin network—ever evolving. They grow. They die. And finally, they’re reborn again in a different form.\n" },{"cohort":"ordinal","name":"Bitcoin Puppets","collectionSymbol":"bitcoin-puppets","collectionId":"bitcoin-puppets","vol":35.46603338,"totalVol":2903.3036861,"totalTxns":30094,"volPctChg":40.27993582,"txns":231,"txnsPctChg":26.2295082,"fp":0.16,"fpPctChg":12.7634082740151,"fpListingPrice":0.16,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":1600.16,"totalSupply":10001,"listedCount":1036,"ownerCount":6653,"uniqueOwnerRatio":0.665233476652335,"image":"https://bafkreicrzu7uzdfc7kblmyajxwzlfkbh6m4mi6lfzt5h42f7j7suie4od4.ipfs.nftstorage.link/","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":2,"currencyUsdRate":102384.671446517,"marketCapUsd":163831855.861858,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/bitcoin-puppets?cohort=ordinal\u0026window=7d\u0026currentFp=0.16\u0026fpPctChg=12.763408274015099","description":"When you engage with the Puppets, leave behind the shackles of conventional thinking and surrender to the enchantment of the unconventional. Embrace the whimsy, relish in the absurd, and allow your imagination to roam freely. In this realm of handcrafted wonders, there are no guarantees, no prescribed paths to follow. It is a sanctuary for the offbeat and a testament to the limitless possibilities of artistic expression."},{"cohort":"ordinal","name":"NodeMonkes","collectionSymbol":"nodemonkes","collectionId":"nodemonkes","vol":25.50567795,"totalVol":4824.18118302,"totalTxns":18223,"volPctChg":51.78411862,"txns":206,"txnsPctChg":30.37974684,"fp":0.13689,"fpPctChg":36.89,"fpListingPrice":0.13689,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":1368.9,"totalSupply":10000,"listedCount":1359,"ownerCount":5424,"uniqueOwnerRatio":0.5424,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-nodemonkes_pfp_1733382227251.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":1,"currencyUsdRate":102384.671446517,"marketCapUsd":140154376.743137,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/nodemonkes?cohort=ordinal\u0026window=7d\u0026currentFp=0.13689\u0026fpPctChg=36.89","description":"Unique collectible Monkes on every bitcoin node. First Ordinals 10k."},{"cohort":"ordinal","name":"Ordinal Maxi Biz (OMB)","collectionSymbol":"omb","collectionId":"omb","vol":12.25316185,"totalVol":1349.70750214,"totalTxns":3223,"volPctChg":206.81634808,"txns":77,"txnsPctChg":156.66666667,"fp":0.1383,"fpPctChg":21.3157894736842,"fpListingPrice":0.1383,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":725.1069,"totalSupply":5243,"listedCount":303,"ownerCount":3877,"uniqueOwnerRatio":0.739462139996185,"image":"https://bafybeidb7ltjitqivbcp22iktp5vmciee4dwzrjobwjnlzt5dkgyepj5ne.ipfs.nftstorage.link/","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":74239831.7201023,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/omb?cohort=ordinal\u0026window=7d\u0026currentFp=0.1383\u0026fpPctChg=21.31578947368422","description":"--- .-. -.. .. -. .- .-.. / -- .- -..- .. / -... .. --.. / -.--. --- -- -... -.--.-"},{"cohort":"ordinal","name":"Runestone","collectionSymbol":"runestone","collectionId":"runestone","vol":11.71577085,"totalVol":3648.39815453,"totalTxns":135198,"volPctChg":-4.85098735,"txns":1520,"txnsPctChg":-9.52380952,"fp":0.0066,"fpPctChg":-8.20584144645341,"fpListingPrice":0.0066,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":741.7344,"totalSupply":112384,"listedCount":2964,"ownerCount":72044,"uniqueOwnerRatio":0.641052107061503,"image":"https://bafkreihhxrynog2y2ev63yke7jry6pocp5jubtbh7xoyamsgxr5d4f4eh4.ipfs.nftstorage.link/","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":7,"currencyUsdRate":102384.671446517,"marketCapUsd":75942232.8445792,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/runestone?cohort=ordinal\u0026window=7d\u0026currentFp=0.0066\u0026fpPctChg=-8.20584144645341","description":"Runestone is an open source, transparent, volunteer, and decentralized initiative to reward people who participated in the first year of the Ordinals Protocol."},{"cohort":"ordinal","name":"Quantum Cats","collectionSymbol":"quantum_cats","collectionId":"quantum_cats","vol":8.596431,"totalVol":1366.37580542,"totalTxns":4859,"volPctChg":18.64960716,"txns":47,"txnsPctChg":4.44444444,"fp":0.215,"fpPctChg":33.1236378046364,"fpListingPrice":0.215,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":716.595,"totalSupply":3333,"listedCount":222,"ownerCount":2388,"uniqueOwnerRatio":0.716471647164717,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-taproot_wizards_presents_pfp_1706542390359.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":73368343.6352167,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/quantum_cats?cohort=ordinal\u0026window=7d\u0026currentFp=0.215\u0026fpPctChg=33.12363780463641","description":"The Quantum Cats by Taproot Wizards are on a mission to revive Satoshi's beloved pet and scripting function, OP_CAT."},{"cohort":"ordinal","name":"Based Angels","collectionSymbol":"basedangels","collectionId":"basedangels","vol":6.29669015,"totalVol":110.06432199,"totalTxns":13200,"volPctChg":55.92815237,"txns":286,"txnsPctChg":36.19047619,"fp":0.02,"fpPctChg":-4.62565569861707,"fpListingPrice":0.02,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":111.1,"totalSupply":5555,"listedCount":541,"ownerCount":2740,"uniqueOwnerRatio":0.493249324932493,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-basedangels_pfp_1731080229062.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":11374936.997708,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/basedangels?cohort=ordinal\u0026window=7d\u0026currentFp=0.02\u0026fpPctChg=-4.62565569861707","description":"Based Angels is a collection of 5,555 recursive PFP’s inscribed on the mother-chain Bitcoin in May 2024.The collection is inspired by the aesthetics and fashion of the 2000s-2010s through the lens of nostalgia, channeling it into modern Bitcoin technology, with orange hair as a symbol and the main color of the Bitcoin blockchain."},{"cohort":"ordinal","name":"Bitcoin Frogs","collectionSymbol":"bitcoin-frogs","collectionId":"bitcoin-frogs","vol":4.07766689,"totalVol":864.44588135,"totalTxns":7244,"volPctChg":150.67396662,"txns":117,"txnsPctChg":112.72727273,"fp":0.039999,"fpPctChg":37.9275862068965,"fpListingPrice":0.039999,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":399.99,"totalSupply":10000,"listedCount":1069,"ownerCount":5564,"uniqueOwnerRatio":0.5564,"image":"https://bafkreigrsecff6opbrtnwwomzyom3yuwifbsdt6hnq5zn2q55wspx4hfiy.ipfs.nftstorage.link/","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":40952844.7318922,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/bitcoin-frogs?cohort=ordinal\u0026window=7d\u0026currentFp=0.039999\u0026fpPctChg=37.927586206896535","description":"Launched on March 8 2023, Bitcoin Frogs are 10,000 digital collectibles that will live on Bitcoin forever. No more will ever be created. Rarities of traits in each layer are equal, allowing subjective appreciation of aesthetics and Satoshi-based rarities to emerge."},{"cohort":"ordinal","name":"bitmap","collectionSymbol":"bitmap","collectionId":"bitmap","vol":1.91914945,"totalVol":652.28520139,"totalTxns":221360,"volPctChg":-8.15546097,"txns":3264,"txnsPctChg":4.58186479,"fp":0.0004076,"fpPctChg":-5.2093023255814,"fpListingPrice":0.0004076,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":355.9758296,"totalSupply":873346,"listedCount":32158,"ownerCount":45717,"uniqueOwnerRatio":0.0523469506930816,"image":"https://bafkreidxosqb5frg7bo36y2qgho4fzfubcczg32w2lvmqca3nkczn26ffa.ipfs.nftstorage.link/","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":18,"currencyUsdRate":102384.671446517,"marketCapUsd":36446468.3564972,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/bitmap?cohort=ordinal\u0026window=7d\u0026currentFp=0.0004076\u0026fpPctChg=-5.209302325581399","description":"A New Standard for a Bitcoin Metaverse. It takes advantage of the nature of data's unique ability to be parsed from multiple angels. WARNING: this is experimental indexing, please DYOR and cross verify the data"},{"cohort":"ordinal","name":"Bitcoin Wizards","collectionSymbol":"bitcoin-wizards","collectionId":"bitcoin-wizards","vol":1.76458993,"totalVol":209.79857685,"totalTxns":1225,"volPctChg":-3.36682346,"txns":18,"txnsPctChg":5.88235294,"fp":0.1,"fpPctChg":11.1111111111111,"fpListingPrice":0.1,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":133.8,"totalSupply":1338,"listedCount":106,"ownerCount":940,"uniqueOwnerRatio":0.70254110612855,"image":"https://bafkreied4w7dnyyxqosm2hrs3ucvw4d7fpkbdzo2ypym6qpoxncdz5bala.ipfs.nftstorage.link/","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":13699069.0395439,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/bitcoin-wizards?cohort=ordinal\u0026window=7d\u0026currentFp=0.1\u0026fpPctChg=11.111111111111116","description":"A collection of Bitcoin Wizard’s created by mavensbot, the original artist behind the most popular Reddit ad ever, ‘Magic Internet Money’. Mavensbot’s iconic wizard designed in MS-Paint is a dose of nostalgia, and a pinch of magic that played a crucial role in the rise of Bitcoin. Own a piece history, for eternity…"},{"cohort":"ordinal","name":"Pizza Ninjas","collectionSymbol":"pizza-ninjas","collectionId":"pizza-ninjas","vol":1.526996,"totalVol":274.75352711,"totalTxns":2903,"volPctChg":-44.43692847,"txns":16,"txnsPctChg":-48.38709677,"fp":0.099,"fpPctChg":13.7931034482759,"fpListingPrice":0.099,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":148.401,"totalSupply":1499,"listedCount":62,"ownerCount":1153,"uniqueOwnerRatio":0.769179452968646,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-pizza-ninjas_pfp_1711912845018.gif","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":15193987.6273345,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/pizza-ninjas?cohort=ordinal\u0026window=7d\u0026currentFp=0.099\u0026fpPctChg=13.793103448275868","description":"View any Ninja in full size to reveal the secret menu. Featured in Sotheby's."},{"cohort":"ordinal","name":"Natcats","collectionSymbol":"dmtnatcats","collectionId":"dmtnatcats","vol":1.25689216,"totalVol":611.1131506,"totalTxns":13337,"volPctChg":49.36665896,"txns":110,"txnsPctChg":44.73684211,"fp":0.01023,"fpPctChg":-5.18120307720827,"fpListingPrice":0.01023,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":82.49472,"totalSupply":8064,"listedCount":822,"ownerCount":3561,"uniqueOwnerRatio":0.441592261904762,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-dmtnatcats_pfp_1708896003459.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":2,"currencyUsdRate":102384.671446517,"marketCapUsd":8446194.80327239,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/dmtnatcats?cohort=ordinal\u0026window=7d\u0026currentFp=0.01023\u0026fpPctChg=-5.1812030772082736","description":"First NFT art collection generated autonomously by the blockchain. Built by Bitcoin using Digital Matter Theory."},{"cohort":"ordinal","name":"Bitcoin Punks","collectionSymbol":"bitcoin-punks","collectionId":"bitcoin-punks","vol":1.25102167,"totalVol":217.91671501,"totalTxns":5400,"volPctChg":57.12150428,"txns":112,"txnsPctChg":69.6969697,"fp":0.0131,"fpPctChg":64.9876133345256,"fpListingPrice":0.0131,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":131,"totalSupply":10000,"listedCount":1095,"ownerCount":5869,"uniqueOwnerRatio":0.5869,"image":"https://bafkreiaymcbhg5zslsi5xmlvgnruuvbjpr7rngk45hoxxrqwhfch55q2fe.ipfs.nftstorage.link","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":13412391.9594937,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/bitcoin-punks?cohort=ordinal\u0026window=7d\u0026currentFp=0.0131\u0026fpPctChg=64.98761333452563","description":"Bitcoin Punks is the first 10k NFT collection on Ordinals."},{"cohort":"ordinal","name":"RSIC METAPROTOCOL","collectionSymbol":"rsic","collectionId":"rsic","vol":1.18457039,"totalVol":1655.4274815,"totalTxns":30402,"volPctChg":41.41395741,"txns":150,"fp":0.006489,"fpPctChg":20.8379888268156,"fpListingPrice":0.006489,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":136.269,"totalSupply":21000,"listedCount":997,"ownerCount":7604,"uniqueOwnerRatio":0.362095238095238,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-rsic_pfp_1705896366275.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":13951856.7933454,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/rsic?cohort=ordinal\u0026window=7d\u0026currentFp=0.006489\u0026fpPctChg=20.837988826815646","description":"21000 Rune Specific Inscription Circuits."},{"cohort":"ordinal","name":"The Wizards of Ord","collectionSymbol":"wizards","collectionId":"wizards","vol":1.10174,"totalVol":148.66038748,"totalTxns":6108,"volPctChg":60.94835973,"txns":67,"txnsPctChg":34,"fp":0.01784,"fpPctChg":24.8425472358293,"fpListingPrice":0.01784,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":59.46072,"totalSupply":3333,"listedCount":227,"ownerCount":2262,"uniqueOwnerRatio":0.678667866786679,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-wizards_pfp_1699090652197.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":6087866.28117333,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/wizards?cohort=ordinal\u0026window=7d\u0026currentFp=0.01784\u0026fpPctChg=24.842547235829258","description":"3,333 ordinal wizards inscribed exclusively on the historic block 78 sats."},{"cohort":"ordinal","name":"CENTS","collectionSymbol":"cents","collectionId":"cents","vol":0.91137898,"totalVol":47.57302389,"totalTxns":9877,"volPctChg":242.581073,"txns":133,"txnsPctChg":141.81818182,"fp":0.00825,"fpPctChg":51.6544117647059,"fpListingPrice":0.00825,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":82.50825,"totalSupply":10001,"listedCount":699,"ownerCount":2228,"uniqueOwnerRatio":0.222777722227777,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-cents_pfp_1730455035928.jpeg","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":1,"currencyUsdRate":102384.671446517,"marketCapUsd":8447580.06787707,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/cents?cohort=ordinal\u0026window=7d\u0026currentFp=0.00825\u0026fpPctChg=51.654411764705884","description":"After more than a century in circulation, the penny has become both a worthless relic of inflation and a prized collector's item. The last copper pennies were minted in 1982, after which they have been struck in zinc. A penny from any given year will always be worth exactly 1¢, according to the US Treasury, but the copper in pre-1982 pennies has a metal value of approximately 3¢. Recognizing these discrepancies in value, Rutherford Chang removed 10,000 copper coins from circulation and archivally documented them. The final state of these 10,000 copper cents are inscribed on 10,000 satoshis, while the physical coins are smelted and cast into a solid 68-pound copper block. This metal block is rendered as a three-dimensional digital model and inscribed as a 4-megabyte ordinal, comprising the entirety of Bitcoin block #839969. As the traditional penny fades into irrelevance and its production is ultimately terminated, its value can continue to be redefined. rutherfordchang.com/cents"},{"cohort":"ordinal","name":"Airhead","collectionSymbol":"airhead","collectionId":"airhead","vol":0.76890036,"totalVol":5.66620949,"totalTxns":1067,"volPctChg":-84.2995339,"txns":178,"txnsPctChg":-79.97750281,"fp":0.00329,"fpPctChg":-39.6330275229358,"fpListingPrice":0.00329,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":32.90329,"totalSupply":10001,"listedCount":298,"ownerCount":1826,"uniqueOwnerRatio":0.182581741825817,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-airhead_pfp_1732321105047.jpeg","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":3368792.53615946,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/airhead?cohort=ordinal\u0026window=7d\u0026currentFp=0.00329\u0026fpPctChg=-39.633027522935784","description":"You’re salivating aren’t you. Brought to you by Arthur Hayes and Oyl Wallet — Airheads will fuck up your shit. Yeah that’s right, you found real art on bitcoin. They’re highly addictive, fat positive \\u0026 a mirror of human culture. 100% original hand blown 3d art filled with air and wrapped in sexy themes and packages. Airheads cannot be popped. Bring your airhead to Oyl wallet to earn XP. Stay fat."},{"cohort":"ordinal","name":"Pizza Aliens","collectionSymbol":"pizzaaliens","collectionId":"pizzaaliens","vol":0.74480999,"totalVol":5.96774988,"totalTxns":1164,"volPctChg":-62.63216118,"txns":98,"txnsPctChg":-67.86885246,"fp":0.00025,"fpPctChg":-7.40740740740741,"fpListingPrice":0.00025,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.8365,"totalSupply":3346,"listedCount":688,"ownerCount":825,"uniqueOwnerRatio":0.246563060370592,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-pizzaaliens_pfp_1729261557782.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":85644.7776650113,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/pizzaaliens?cohort=ordinal\u0026window=7d\u0026currentFp=0.00025\u0026fpPctChg=-7.4074074074074066","description":"3333 aliens 👽 inscribed on #BTC on 333 pizza 🍕 sats and remember: humans aren't real"},{"cohort":"ordinal","name":"The Royals","collectionSymbol":"royals","collectionId":"royals","vol":0.55314471,"totalVol":33.13707809,"totalTxns":6244,"volPctChg":106.03835028,"txns":55,"txnsPctChg":-52.5862069,"fp":0.0021,"fpPctChg":25.8246005068934,"fpListingPrice":0.0021,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":21.168,"totalSupply":10080,"listedCount":1281,"ownerCount":5037,"uniqueOwnerRatio":0.499702380952381,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-royals_pfp_1718358738017.gif","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":2167278.72517987,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/royals?cohort=ordinal\u0026window=7d\u0026currentFp=0.0021\u0026fpPctChg=25.82460050689339","description":"10,080 unique characters, generated by BTC. No two are alike. Fully onchain and decentralised."},{"cohort":"ordinal","name":"Room 44","collectionSymbol":"room44","collectionId":"room44","vol":0.551,"totalVol":0.551,"totalTxns":6,"txns":6,"fp":0.44,"fpListingPrice":0.44,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":48.4,"totalSupply":110,"listedCount":8,"ownerCount":85,"uniqueOwnerRatio":0.772727272727273,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-room44_pfp_1732864884896.gif","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":4955418.09801141,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/room44?cohort=ordinal\u0026window=7d\u0026currentFp=0.44","description":"Original ₿itcoin Art \\u0026 Culture"},{"cohort":"ordinal","name":"Lasogette","collectionSymbol":"lasogette","collectionId":"lasogette","vol":0.46287002,"totalVol":9.79091786,"totalTxns":1192,"volPctChg":-55.87284654,"txns":39,"txnsPctChg":-45.83333333,"fp":0.01099999,"fpPctChg":11.1110101010101,"fpListingPrice":0.01099999,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":43.06496085,"totalSupply":3915,"listedCount":417,"ownerCount":1195,"uniqueOwnerRatio":0.305236270753512,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-lasogette_pfp_1720467191506.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":4409191.86748436,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/lasogette?cohort=ordinal\u0026window=7d\u0026currentFp=0.01099999\u0026fpPctChg=11.111010101010077","description":"Lasogette is an esoteric fine art project of 7,777 generative pfpNFT's following a net-art aesthetic under the artistic guidance of Monsieur Lasogette. A very colorful, vibrant, and analog infused social media avatar. Designed from the ground up to evoke a sense of abnormality and nonconformity delivered to you from the fringes of the karmic grid.Disclaimer: Not intended for use as anything but art. No roadmap, promises or guarantees or any of that nonsense. Don't treat this like a goddamn corporation , okay?P.S. All art seen is copylefted under the VPL license (Copyleft (c) All Rights Reversed) and the data and imagery depicted here are in no way representative of any real-world person, organization or place. This is all just for fun and should never be treated seriously. The whole point of this is that it's all fictional!"},{"cohort":"ordinal","name":"Aeons","collectionSymbol":"aeonsbtc","collectionId":"aeonsbtc","vol":0.44898744,"totalVol":45.44509138,"totalTxns":6121,"volPctChg":94.31580508,"txns":85,"txnsPctChg":70,"fp":0.0059,"fpPctChg":38.8235294117647,"fpListingPrice":0.0059,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":19.6647,"totalSupply":3333,"listedCount":391,"ownerCount":1676,"uniqueOwnerRatio":0.502850285028503,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-aeonsbtc_pfp_1721160191374.jpeg","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":2013363.84859432,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/aeonsbtc?cohort=ordinal\u0026window=7d\u0026currentFp=0.0059\u0026fpPctChg=38.8235294117647","description":"Aeons are vibrant, chaotic, and rebellious beings, brought to life in a neo-expressionist style. Embodying a pursuit of exploration and a dream to bring art to the eternal chain, 3333 Aeons merge the worlds of fine art and PFPs, introducing a fresh and unique style to ordinals."},{"cohort":"ordinal","name":"BTC DeGods","collectionSymbol":"degods","collectionId":"degods","vol":0.3996,"totalVol":35.6426752,"totalTxns":178,"volPctChg":620.6362374,"txns":9,"txnsPctChg":350,"fp":0.054899,"fpPctChg":71.559375,"fpListingPrice":0.054899,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":29.370965,"totalSupply":535,"listedCount":93,"ownerCount":384,"uniqueOwnerRatio":0.717757009345794,"image":"https://bafkreigta67pp3zctiwk2lgctpnvm24qttcmei2jrzsqtkghghsr2huorq.ipfs.nftstorage.link/","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":3007136.60159214,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/degods?cohort=ordinal\u0026window=7d\u0026currentFp=0.054899\u0026fpPctChg=71.559375","description":"Over 1 year ago. 535 DeGods were burned. Many have speculated on their return. These DeGods have been forever inscribed on Bitcoin, the blockchain where it all started. All on one single block. Block 776408."},{"cohort":"ordinal","name":"Ordblocks","collectionSymbol":"gridwaves","collectionId":"gridwaves","vol":0.377,"totalVol":0.598,"totalTxns":13,"volPctChg":776.74418605,"txns":8,"txnsPctChg":700,"fp":0.053,"fpPctChg":20.4545454545455,"fpListingPrice":0.053,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":1.06,"totalSupply":20,"listedCount":5,"ownerCount":11,"uniqueOwnerRatio":0.55,"image":"https://bafkreidrlejkl62dwipuqhx4mvtpqt5wz7ltiw6svv7yo3bmmjme5mv7jy.ipfs.nftstorage.link/","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":1,"currencyUsdRate":102384.671446517,"marketCapUsd":108527.751733308,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/gridwaves?cohort=ordinal\u0026window=7d\u0026currentFp=0.053\u0026fpPctChg=20.45454545454546","description":"A small (20 piece) and early (inscription numbers ranging from 2102 to 2780) generative art collection using q5 (a variant of p5.js that is much smaller in file size so it could fit inside an inscription) celebrating bitcoin, mempools, blocks, and inscriptions. In the absence of a fully on chain way to guarantee randomness, an array of seeds was stored in the inscribed file and each seed value increases by a constant increment of 5000. This makes it unlikely that I individually curated each output, though it's possible I could iterate through increments to find an ideal full set of outputs.Each output varies across a range of dimensions: block density, speed, the set of animations it rotates through, and color palette (two: one for BTC, and one for ETH, to represent the fact that many early ordinals folks came from the ETH ecosystem)."},{"cohort":"ordinal","name":"O.P.I.U.M.","collectionSymbol":"opium","collectionId":"opium","vol":0.32396,"totalVol":159.17309587,"totalTxns":1112,"volPctChg":20.64812429,"txns":2,"fp":0.185,"fpPctChg":25.0084465166565,"fpListingPrice":0.185,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":143.745,"totalSupply":777,"listedCount":117,"ownerCount":571,"uniqueOwnerRatio":0.734877734877735,"image":"https://bafkreibpgv7sppegymcoqxxvhbshreloh3egjazswgciaefu6lae4mavji.ipfs.nftstorage.link/","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":14717284.5970795,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/opium?cohort=ordinal\u0026window=7d\u0026currentFp=0.185\u0026fpPctChg=25.008446516656523","description":"Ord Puppet Inu Undoxxed Millionaire is an esoteric and absurd collection of 777 hand puppets, created with basic tools, lots of effort and passion. These puppets are a product of the fringes of the karmic grid, where the most unconventional and offbeat ideas are born.Not intended for use as anything but art. No roadmap, promises or guarantees or any of that nonsense. Don't treat this like a goddamn corporation okay?"},{"cohort":"ordinal","name":"Yokai Avengers","collectionSymbol":"yokai_avengers","collectionId":"yokai_avengers","vol":0.32135999,"totalVol":10.04579968,"totalTxns":448,"volPctChg":-29.58666808,"txns":10,"txnsPctChg":-23.07692308,"fp":0.0365,"fpPctChg":-0.81519043891044,"fpListingPrice":0.0365,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":24.9295,"totalSupply":683,"listedCount":80,"ownerCount":429,"uniqueOwnerRatio":0.628111273792094,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-yokai_avengers_pfp_1698054318287.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":2552398.66682594,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/yokai_avengers?cohort=ordinal\u0026window=7d\u0026currentFp=0.0365\u0026fpPctChg=-0.8151904389104403","description":"In a world shrouded in darkness and mystery, humans and yokais roamed free. They found themselves facing great challenges through constant battles for survival, and chaos reigned supreme. The balance between the worlds was being tripped, and the results were catastrophic..."},{"cohort":"ordinal","name":"BitBoy One Genesis","collectionSymbol":"bitboy_one_genesis","collectionId":"bitboy_one_genesis","vol":0.28241951,"totalVol":9.00337913,"totalTxns":508,"volPctChg":543.32462415,"txns":48,"txnsPctChg":380,"fp":0.00599,"fpPctChg":33.7650736936132,"fpListingPrice":0.00599,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":5.99,"totalSupply":1000,"listedCount":56,"ownerCount":875,"uniqueOwnerRatio":0.875,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-bitboy_one_genesis_pfp_1713755589859.gif","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":613284.181964635,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/bitboy_one_genesis?cohort=ordinal\u0026window=7d\u0026currentFp=0.00599\u0026fpPctChg=33.76507369361321","description":"BitBoy One Genesis is a fully playable 3D inscription etched onto the BTC blockchain, each corresponding to a physical BitBoy One console, serving as your VIP pass to the New Era of Bitcoin Gaming."},{"cohort":"ordinal","name":"OCM Genesis (BTC) by OnChainMonkey® ","collectionSymbol":"ocm-genesis","collectionId":"ocm-genesis","vol":0.2758245,"totalVol":76.41158652,"totalTxns":1084,"volPctChg":-19.00429233,"txns":17,"txnsPctChg":-10.52631579,"fp":0.01696832,"fpPctChg":-4.66164737610969,"fpListingPrice":0.01696832,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":169.6832,"totalSupply":10000,"listedCount":336,"ownerCount":2673,"uniqueOwnerRatio":0.2673,"image":"https://bafybeiagaj7mt6lpy5wkgmet7k4alr5eopegbttutec5xu3jeggf77gobi.ipfs.nftstorage.link/","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":17372958.6819936,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/ocm-genesis?cohort=ordinal\u0026window=7d\u0026currentFp=0.01696832\u0026fpPctChg=-4.6616473761096895","description":"OCM Genesis is innovative art created over two years that set many precedents. OCM Genesis was the first 10k images of a collection inscribed on Bitcoin, the first 10k collection on block 9, the first 10k collection to use Parent-Child Provenance, the first 10k collection on 450x sats, the first 10k reinscribed collection, and the first migration of a 10k collection to Bitcoin."},{"cohort":"ordinal","name":"$DOG","collectionSymbol":"dog_of_bitcoin","collectionId":"dog_of_bitcoin","vol":0.26830664,"totalVol":2.4374466,"totalTxns":168,"volPctChg":-86.19344526,"txns":33,"txnsPctChg":-68.86792453,"fp":0.00579,"fpPctChg":-38.6847400190617,"fpListingPrice":0.00579,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":5.79,"totalSupply":1000,"listedCount":276,"ownerCount":680,"uniqueOwnerRatio":0.68,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-dog_of_bitcoin_pfp_1726641247831.jpeg","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":592807.247675332,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/dog_of_bitcoin?cohort=ordinal\u0026window=7d\u0026currentFp=0.00579\u0026fpPctChg=-38.684740019061735","description":"Introducing the exclusive $DOG Ordinals PFP Collection, capped at just 5,500 unique pieces across 10 special drops. This initial drop will release the first 1,000 PFPs into circulation, available only to whitelisted addresses. What sets this collection apart is its exclusivity, none of the PFPs will be listed for purchase during the drop. Each one must be earned and then claimed, making ownership even more meaningful. Secure your place in $DOG history with this rare and limited opportunity!"},{"cohort":"ordinal","name":"Twelvefold","collectionSymbol":"twelvefold","collectionId":"twelvefold","vol":0.2581,"totalVol":19.579949,"totalTxns":49,"volPctChg":61.3125,"txns":2,"txnsPctChg":100,"fp":0.2434,"fpPctChg":-0.245901639344259,"fpListingPrice":0.2434,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":73.02,"totalSupply":300,"listedCount":42,"ownerCount":268,"uniqueOwnerRatio":0.893333333333333,"image":"https://bafkreib5h3a462drydrpm3hhmj5r32egibtv7bktjnkk56ub77u7vapuvq.ipfs.nftstorage.link/","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":7476128.70902465,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/twelvefold?cohort=ordinal\u0026window=7d\u0026currentFp=0.2434\u0026fpPctChg=-0.24590163934425924","description":"TwelveFold is a limited edition, experimental collection of 300 generative art pieces inscribed onto satoshis on the Bitcoin blockchain. These pieces represent a complete art project and will not have other utility or interact with or be related to any previous, ongoing, or future Ethereum-based Yuga projects."},{"cohort":"ordinal","name":"BTC Machines","collectionSymbol":"btc-machines","collectionId":"btc-machines","vol":0.251237,"totalVol":52.28196019,"totalTxns":281,"volPctChg":-32.95181632,"txns":5,"txnsPctChg":-28.57142857,"fp":0.05485,"fpPctChg":-0.992779783393494,"fpListingPrice":0.05485,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":42.61845,"totalSupply":777,"listedCount":43,"ownerCount":668,"uniqueOwnerRatio":0.85971685971686,"image":"https://bafkreicvs6kwwlzkkbrpl4ircduhiun7push6zgx3dzz5p7pjfrf3nwppm.ipfs.nftstorage.link/","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":4363476.0008098,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/btc-machines?cohort=ordinal\u0026window=7d\u0026currentFp=0.05485\u0026fpPctChg=-0.9927797833934937","description":"BTC MACHINE is a BTC brand. A collection of 777 ABSOLUTE on-chain digital artifacts. Be part of the revolution of ABSOLUTE on-chain NFTs, as they should be!"},{"cohort":"ordinal","name":"Radbro Satoshis Vision","collectionSymbol":"bitcoin-radbros","collectionId":"bitcoin-radbros","vol":0.23653645,"totalVol":30.98093691,"totalTxns":5985,"volPctChg":1048.23630897,"txns":90,"txnsPctChg":900,"fp":0.00288,"fpPctChg":60,"fpListingPrice":0.00288,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":14.4,"totalSupply":5000,"listedCount":508,"ownerCount":1375,"uniqueOwnerRatio":0.275,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-bitcoin-radbros_pfp_1712971484573.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":1474339.26882984,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/bitcoin-radbros?cohort=ordinal\u0026window=7d\u0026currentFp=0.00288\u0026fpPctChg=60.00000000000001","description":"Radbro Satoshis Vision a collection of 5000 Radbro Ordinals on the Bitcoin Blockchain created by Radbro Webring.Since the day we learned about Ordinals, we knew it was our duty to bring Radbro to the Bitcoin Blockchain. To be inscribed immutably forever on that beautiful proof-of-work chain. Founderless, unruggable, the most trusted chain in the world. We are proud to present Radbro Satoshis Vision.Just tell em to check the chain."},{"cohort":"ordinal","name":"Skullx: Infinite","collectionSymbol":"skullx-infinite","collectionId":"skullx-infinite","vol":0.22200504,"totalVol":1.83307298,"totalTxns":2199,"volPctChg":77.56952669,"txns":248,"txnsPctChg":29.16666667,"fp":0.000649,"fpPctChg":9.99999999999999,"fpListingPrice":0.000649,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":4.326234,"totalSupply":6666,"listedCount":762,"ownerCount":1879,"uniqueOwnerRatio":0.281878187818782,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-skullx-infinite_pfp_1731509259247.gif","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":2,"currencyUsdRate":102384.671446517,"marketCapUsd":442940.04669075,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/skullx-infinite?cohort=ordinal\u0026window=7d\u0026currentFp=0.000649\u0026fpPctChg=9.999999999999986","description":"Skullx: Infinite is a groundbreaking collection of 6,666 digital collectibles fully inscribed on exotic Block 666 sats. With 66 distinct themes throughout the collection, every piece is a bold statement of individuality, creativity, and innovation. Among them, 7 animated 1/1s stand out, each inscribed on ultra-rare Block 666 Palindrome sats—highlighted by one extraordinary piece sealed on inscription number 66,666,66. Infinite harnesses the full power of the Ordinals protocol. Each piece has a custom transaction ID, creation fee, and utilizes Parent Child provenance to create on-chain metadata. Backed by a community that has thrived since 2021, Skullx: Infinite redefines what it means to own and experience true digital art on Bitcoin. This collection is the future of digital collectibles."},{"cohort":"ordinal","name":"Honey Badgers","collectionSymbol":"honey_badgers","collectionId":"honey_badgers","vol":0.20993379,"totalVol":75.61308012,"totalTxns":5962,"volPctChg":56.77430426,"txns":39,"txnsPctChg":44.44444444,"fp":0.005568,"fpPctChg":12.8269763464566,"fpListingPrice":0.005568,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":55.68,"totalSupply":10000,"listedCount":883,"ownerCount":2914,"uniqueOwnerRatio":0.2914,"image":"https://bafkreig2dpilmbibh4iipwasa53bnu5rannhlurnq54phfdvyrve4g7xui.ipfs.nftstorage.link/","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":5700778.50614205,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/honey_badgers?cohort=ordinal\u0026window=7d\u0026currentFp=0.005568\u0026fpPctChg=12.82697634645662","description":"An OG 10k ordinals collection. All metadata lives on chain. Ethos, Vibes, Art"},{"cohort":"ordinal","name":"Scrips","collectionSymbol":"scrips","collectionId":"scrips","vol":0.203713,"totalVol":0.3726049,"totalTxns":166,"volPctChg":257.26587162,"txns":47,"txnsPctChg":62.06896552,"fp":0.0032,"fpPctChg":-23.6276849642005,"fpListingPrice":0.0032,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":6.896,"totalSupply":2155,"listedCount":96,"ownerCount":366,"uniqueOwnerRatio":0.169837587006961,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-scrips_pfp_1714579867673.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":706044.694295179,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/scrips?cohort=ordinal\u0026window=7d\u0026currentFp=0.0032\u0026fpPctChg=-23.62768496420048","description":"Scrips are time capsules that contain our world — AI-manifested digital artifacts that evolve and expand as we inscribe our own emergent art and words into them for future excavators to find on their nodes. Each Scrip contains an allocation of BITCOIN•PENNIES (rune #881). All Scrips have lineage back to the sub10k OG Scrips collection."},{"cohort":"ordinal","name":"Shadows by Forgotten Runes","collectionSymbol":"shadows","collectionId":"shadows","vol":0.2023,"totalVol":30.0969724,"totalTxns":437,"volPctChg":4716.66666667,"txns":18,"txnsPctChg":1700,"fp":0.025,"fpPctChg":284.615384615385,"fpListingPrice":0.025,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":16.65,"totalSupply":666,"listedCount":150,"ownerCount":450,"uniqueOwnerRatio":0.675675675675676,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-shadows_pfp_1704734126629.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":1704704.7795845,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/shadows?cohort=ordinal\u0026window=7d\u0026currentFp=0.025\u0026fpPctChg=284.61538461538464","description":"666 ORDINALS in THE QUANTUM SHADOW At the heart of The Shadows lies the intrigue of secret societies and mythical archetypes, drawing inspiration from the the Illuminati, the Freemasons, and the elusive Satoshi Nakamoto himself.Our narrative delves into the realm of the 'quantum shadow,' a mysterious and metaphysical force that binds the destiny of our Shadows."},{"cohort":"ordinal","name":"Blob","collectionSymbol":"blobarmy","collectionId":"blobarmy","vol":0.19073933,"totalVol":406.74923033,"totalTxns":12120,"volPctChg":36.44997747,"txns":66,"txnsPctChg":29.41176471,"fp":0.0027999,"fpPctChg":-2.78125,"fpListingPrice":0.0027999,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":27.999,"totalSupply":10000,"listedCount":935,"ownerCount":7434,"uniqueOwnerRatio":0.7434,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-blobarmy_pfp_1712318532505.jpeg","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":2866668.41583102,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/blobarmy?cohort=ordinal\u0026window=7d\u0026currentFp=0.0027999\u0026fpPctChg=-2.7812500000000018","description":""},{"cohort":"ordinal","name":"The Golden Ratio by Harto x Vivid Gallery","collectionSymbol":"the-golden-ratio","collectionId":"the-golden-ratio","vol":0.1826,"totalVol":61.65506398,"totalTxns":676,"txns":4,"fp":0.06,"fpPctChg":20,"fpListingPrice":0.06,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":25.2,"totalSupply":420,"listedCount":84,"ownerCount":275,"uniqueOwnerRatio":0.654761904761905,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-the-golden-ratio_pfp_1714731283781.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":2580093.72045222,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/the-golden-ratio?cohort=ordinal\u0026window=7d\u0026currentFp=0.06\u0026fpPctChg=19.999999999999996","description":"420 generative artworks on Block 9 450x sats exploring the fibonacci pattern. Recursive \\u0026 Parent/Child provenance. Art by Harto curated by VIVID Gallery."},{"cohort":"ordinal","name":"Blesstiger(♆) [Reinscriptions]","collectionSymbol":"blesstiger","collectionId":"blesstiger","vol":0.1749549,"totalVol":1.86921886,"totalTxns":867,"volPctChg":67.41294675,"txns":78,"txnsPctChg":-10.34482759,"fp":0.00219999,"fpPctChg":83.3325,"fpListingPrice":0.00219999,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":7.33256667,"totalSupply":3333,"listedCount":186,"ownerCount":685,"uniqueOwnerRatio":0.205520552055206,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-blesstiger_pfp_1704432661331.gif","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":750742.429367629,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/blesstiger?cohort=ordinal\u0026window=7d\u0026currentFp=0.00219999\u0026fpPctChg=83.33250000000004","description":"ATTENTION: The inscriptions on this collection are reinscriptions. Selling one inscription will cause other Blesstigers on the same Sat to move as well.\\n--\\n--The Blesstiger collection, recognized as the first unique and non-replicable Trident🔱 inscriptions, has attained exclusivity due to its two curses and three consecutive IDs, rendering it no longer producible.Trident🔱 inscriptions, bound together in life and death, transfer simultaneously. This marks the dawn of a new epoch in Trident🔱 inscriptions art. Looking ahead, we foresee the introduction of more blessed, trinumbered Trident🔱 inscriptions, drawing a diverse array of artists to this novel art form. Blesstiger stands as the first application of the BGP protocol and notably, the first to highlight limitations in the Ordinals protocol. This initiative transcends a mere NFT innovation; it leads in utilizing Bitcoin as a medium for goods production, advocating for Bitcoin's amalgamation with centralized commerce, all while maintaining decentralization and absolute privacy. Our endeavor embodies the spirit of Satoshi Nakamoto."},{"cohort":"ordinal","name":"Insurgence by Debauchery ","collectionSymbol":"insurgence_debauchery","collectionId":"insurgence_debauchery","vol":0.15588699,"totalVol":8.25769429,"totalTxns":2819,"volPctChg":-43.31707851,"txns":50,"txnsPctChg":-32.43243243,"fp":0.00322,"fpPctChg":7.69266786845442,"fpListingPrice":0.00322,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":11.27,"totalSupply":3500,"listedCount":365,"ownerCount":1374,"uniqueOwnerRatio":0.392571428571429,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-insurgence_debauchery_pfp_1729297488215.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":1,"currencyUsdRate":102384.671446517,"marketCapUsd":1153875.24720224,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/insurgence_debauchery?cohort=ordinal\u0026window=7d\u0026currentFp=0.00322\u0026fpPctChg=7.692667868454417","description":"3500 frogs. This is not your grandma's alpha group. IYKYK."},{"cohort":"ordinal","name":"INK","collectionSymbol":"ink","collectionId":"ink","vol":0.13436556,"totalVol":505.38540992,"totalTxns":12815,"volPctChg":80.66666954,"txns":86,"txnsPctChg":72,"fp":0.00185,"fpPctChg":42.3076923076923,"fpListingPrice":0.00185,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":18.5,"totalSupply":10000,"listedCount":1134,"ownerCount":5088,"uniqueOwnerRatio":0.5088,"image":"https://nftstorage.link/ipfs/bafkreihciqkvcdlfvnznrvlcce4vf7qequr2jxzabsfhk3r5wh54rxrvje","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":1,"currencyUsdRate":102384.671446517,"marketCapUsd":1894116.42176056,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/ink?cohort=ordinal\u0026window=7d\u0026currentFp=0.00185\u0026fpPctChg=42.307692307692314","description":"INK is immortalizing art and storytelling on the mother blockchain: Bitcoin. 10,000 characters are each engraved onto Casey Rodarmor's rare Legacy Sats - precursors to ordinals."},{"cohort":"ordinal","name":"Atlas by Harto","collectionSymbol":"atlas-by-harto","collectionId":"atlas-by-harto","vol":0.13361,"totalVol":0.13361,"totalTxns":13,"txns":13,"fp":0.01,"fpListingPrice":0.01,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":3.11,"totalSupply":311,"listedCount":35,"ownerCount":93,"uniqueOwnerRatio":0.29903536977492,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-atlas-by-harto_pfp_1732832848050.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":318416.328198667,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/atlas-by-harto?cohort=ordinal\u0026window=7d\u0026currentFp=0.01","description":"\\"},{"cohort":"ordinal","name":"Billy Cats","collectionSymbol":"billycats","collectionId":"billycats","vol":0.11733499,"totalVol":27.70517563,"totalTxns":11313,"volPctChg":40.56057241,"txns":117,"txnsPctChg":60.2739726,"fp":0.001188,"fpPctChg":21.2244897959184,"fpListingPrice":0.001188,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":11.88,"totalSupply":10000,"listedCount":1381,"ownerCount":2847,"uniqueOwnerRatio":0.2847,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-billycats_pfp_1720246108289.jpeg","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":1216329.89678462,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/billycats?cohort=ordinal\u0026window=7d\u0026currentFp=0.001188\u0026fpPctChg=21.224489795918377","description":"10k Billy Cats to vibe with as $billy goes to a billy."},{"cohort":"ordinal","name":"Brats","collectionSymbol":"brats","collectionId":"brats","vol":0.11101025,"totalVol":0.75321941,"totalTxns":1784,"volPctChg":-82.71431538,"txns":492,"txnsPctChg":-61.91950464,"fp":0.000245,"fpPctChg":-22.9559748427673,"fpListingPrice":0.000245,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.796495,"totalSupply":3251,"listedCount":307,"ownerCount":863,"uniqueOwnerRatio":0.265456782528453,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-brats_pfp_1732720897213.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":81548.8788837933,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/brats?cohort=ordinal\u0026window=7d\u0026currentFp=0.000245\u0026fpPctChg=-22.95597484276729","description":"Deep in the Mempool shadows, a crew of 3333 retarded degen Rats are changing the game. Recursive Fair Puppet Collection"},{"cohort":"ordinal","name":"AILU","collectionSymbol":"ailu","collectionId":"ailu","vol":0.10470996,"totalVol":43.84120313,"totalTxns":1885,"volPctChg":3.79651949,"txns":14,"txnsPctChg":40,"fp":0.009,"fpPctChg":6.50900178580094,"fpListingPrice":0.009,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":18.9,"totalSupply":2100,"listedCount":252,"ownerCount":1433,"uniqueOwnerRatio":0.682380952380952,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-ailu_pfp_1708462362490.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":1935070.29033917,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/ailu?cohort=ordinal\u0026window=7d\u0026currentFp=0.009\u0026fpPctChg=6.509001785800939","description":"AILU: A collection of 2,100 cybernetic panda avatars immutably inscribed on Bitcoin. Each character is a 3D and Fully Rigged asset created by METAPANDA to empower the pseudonymous economy. These digital identities are forged to conquer darkness and express the symbiosis between nature \\u0026 machine."},{"cohort":"ordinal","name":"Hashling Gear","collectionSymbol":"hashcrafters","collectionId":"hashcrafters","vol":0.10189,"totalVol":8.5651434,"totalTxns":233,"volPctChg":31.64082687,"txns":8,"txnsPctChg":166.66666667,"fp":0.00999,"fpPctChg":-0.1,"fpListingPrice":0.00999,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":27.62235,"totalSupply":2765,"listedCount":50,"ownerCount":287,"uniqueOwnerRatio":0.10379746835443,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-hashcrafters_pfp_1706850167893.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":2828105.22933069,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/hashcrafters?cohort=ordinal\u0026window=7d\u0026currentFp=0.00999\u0026fpPctChg=-0.10000000000000009","description":"The World-Wide Leader in Hash Extraction Technology"},{"cohort":"ordinal","name":"OMEN","collectionSymbol":"omen","collectionId":"omen","vol":0.09834522,"totalVol":2.06597424,"totalTxns":1021,"volPctChg":-16.42588617,"txns":49,"txnsPctChg":-50.50505051,"fp":0.00119999,"fpPctChg":-0.00083333333332769,"fpListingPrice":0.00119999,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":11.9999,"totalSupply":10000,"listedCount":283,"ownerCount":802,"uniqueOwnerRatio":0.0802,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-omen_pfp_1727568053893.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":1228605.81889106,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/omen?cohort=ordinal\u0026window=7d\u0026currentFp=0.00119999\u0026fpPctChg=-0.0008333333333276904","description":"OMEN is a visionary PFP/utility project that has been meticulously developed over the past three years, with a focus on creating a seamless bridge between high-quality digital art and robust utility in the NFT space. Originally built on Cardano, OMEN is now expanding to the Ordinals ecosystem, bringing its refined aesthetic and strong community to a new blockchain frontier.OMEN is not just another collection; it represents an elevated standard for NFT projects, combining intricate, top-tier artwork with unique utilities designed to empower collectors and communities. By leveraging cutting-edge technologies and a forward-thinking roadmap, OMEN is positioned to attract both seasoned NFT enthusiasts and new entrants into the Ordinals market."},{"cohort":"ordinal","name":"MegaPunks","collectionSymbol":"megapunks","collectionId":"megapunks","vol":0.09799189,"totalVol":23.52166855,"totalTxns":3411,"volPctChg":87.34543201,"txns":36,"txnsPctChg":44,"fp":0.003,"fpPctChg":20.4819277108434,"fpListingPrice":0.003,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":30,"totalSupply":10000,"listedCount":530,"ownerCount":6127,"uniqueOwnerRatio":0.6127,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-megapunks_pfp_1704388788513.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":3071540.1433955,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/megapunks?cohort=ordinal\u0026window=7d\u0026currentFp=0.003\u0026fpPctChg=20.481927710843383","description":"MegaPunks is the first Ordinal original 10k collection to be inscribed and distributed."},{"cohort":"ordinal","name":"Fake Rares","collectionSymbol":"fake-rares","collectionId":"fake-rares","vol":0.0968,"totalVol":0.5725,"totalTxns":17,"txns":1,"fp":0.145,"fpPctChg":49.7933884297521,"fpListingPrice":0.145,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":29,"totalSupply":200,"listedCount":10,"ownerCount":82,"uniqueOwnerRatio":0.41,"image":"https://bafkreibcok7lrv42jp22jlhed76wzopzgqbpelb4d6fhbfbouqa7firuia.ipfs.nftstorage.link/","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":2969155.47194899,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/fake-rares?cohort=ordinal\u0026window=7d\u0026currentFp=0.145\u0026fpPctChg=49.79338842975205","description":"200 supply Fake Rares; a collection of Crypto Punk inspired Pepe’s"},{"cohort":"ordinal","name":"Rune Doors","collectionSymbol":"runedoors","collectionId":"runedoors","vol":0.0962877,"totalVol":113.09907437,"totalTxns":12901,"volPctChg":-57.11828337,"txns":71,"txnsPctChg":-52.98013245,"fp":0.00099,"fpPctChg":-32.5980392156863,"fpListingPrice":0.00099,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":9.9,"totalSupply":10000,"listedCount":478,"ownerCount":6807,"uniqueOwnerRatio":0.6807,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-runedoors_pfp_1713031089404.jpeg","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":1013608.24732052,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/runedoors?cohort=ordinal\u0026window=7d\u0026currentFp=0.00099\u0026fpPctChg=-32.59803921568627","description":"The Rune Door is a mysterious artifact inscribed into the bitcoin blockchain."},{"cohort":"ordinal","name":"n0 0rdinary kind","collectionSymbol":"n0k","collectionId":"n0k","vol":0.09598046,"totalVol":24.23373624,"totalTxns":9942,"volPctChg":-11.37946645,"txns":76,"txnsPctChg":-3.79746835,"fp":0.00119999,"fpPctChg":1.53917752580808,"fpListingPrice":0.00119999,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":9.2159232,"totalSupply":7680,"listedCount":610,"ownerCount":3862,"uniqueOwnerRatio":0.502864583333333,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-n0k_pfp_1721672017240.gif","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":1,"currencyUsdRate":102384.671446517,"marketCapUsd":943569.268908331,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/n0k?cohort=ordinal\u0026window=7d\u0026currentFp=0.00119999\u0026fpPctChg=1.5391775258080775","description":"7680 recursive ordinals on Block 9 450x Sats all descended from two rare sats.First collection in Ordinals where you CTRL the reveal."},{"cohort":"ordinal","name":"Fomojis 2.0","collectionSymbol":"fomojis_2","collectionId":"fomojis_2","vol":0.09275901,"totalVol":61.52297545,"totalTxns":2930,"volPctChg":74.55919381,"txns":12,"txnsPctChg":33.33333333,"fp":0.00783884,"fpPctChg":12.1436337625179,"fpListingPrice":0.00783884,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":15.74822956,"totalSupply":2009,"listedCount":239,"ownerCount":1433,"uniqueOwnerRatio":0.713290194126431,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-fomojis_2_pfp_1701331213308.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":1612377.30936492,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/fomojis_2?cohort=ordinal\u0026window=7d\u0026currentFp=0.00783884\u0026fpPctChg=12.14363376251788","description":"Art meets Innovation"},{"cohort":"ordinal","name":"Hashlings","collectionSymbol":"hashlings","collectionId":"hashlings","vol":0.09274672,"totalVol":95.64506508,"totalTxns":4292,"volPctChg":2.42147281,"txns":40,"txnsPctChg":5.26315789,"fp":0.00209,"fpPctChg":4.49999999999999,"fpListingPrice":0.00209,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":10.93906,"totalSupply":5234,"listedCount":287,"ownerCount":1108,"uniqueOwnerRatio":0.211692777990065,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-hashlings_pfp_1701887719819.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":1119992.06403373,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/hashlings?cohort=ordinal\u0026window=7d\u0026currentFp=0.00209\u0026fpPctChg=4.499999999999993","description":"Bitcoin's Premier Mining Club."},{"cohort":"ordinal","name":"acoustic puppets ","collectionSymbol":"fake_bitcoin_puppets","collectionId":"fake_bitcoin_puppets","vol":0.0915654,"totalVol":0.0915654,"totalTxns":181,"txns":181,"fp":0.00035979,"fpListingPrice":0.00035979,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.27955683,"totalSupply":777,"listedCount":150,"ownerCount":236,"uniqueOwnerRatio":0.303732303732304,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-fake_bitcoin_puppets_pfp_1733009125962.jpeg","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":28622.3341901797,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/fake_bitcoin_puppets?cohort=ordinal\u0026window=7d\u0026currentFp=0.00035979","description":"777 acoustic puppets lelelelelelelelel hand farted buh DuKeHoEK"},{"cohort":"ordinal","name":"Bitcoin Toadz","collectionSymbol":"bitcoin-toadz","collectionId":"bitcoin-toadz","vol":0.08,"totalVol":2.8286,"totalTxns":21,"txns":2,"fp":0.088,"fpPctChg":27.536231884058,"fpListingPrice":0.088,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":9.768,"totalSupply":111,"listedCount":26,"ownerCount":93,"uniqueOwnerRatio":0.837837837837838,"image":"https://bafkreieqc6bc2m4my4j52c7hvpk3pt2rhgttjfld7q7h4jzj34qniqwwzu.ipfs.nftstorage.link/","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":1,"currencyUsdRate":102384.671446517,"marketCapUsd":1000093.47068958,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/bitcoin-toadz?cohort=ordinal\u0026window=7d\u0026currentFp=0.088\u0026fpPctChg=27.536231884057962","description":"111 Bitcoin Toadz in the Ordinals Universe. Sub 5k collection \\u0026 all inscribed in a row. We proudly donate to the Ordinals devs."},{"cohort":"ordinal","name":"Taproot Witches","collectionSymbol":"taprootwitches","collectionId":"taprootwitches","vol":0.07966587,"totalVol":43.97351255,"totalTxns":6003,"volPctChg":-51.80192814,"txns":30,"txnsPctChg":-54.54545455,"fp":0.00188999,"fpPctChg":-28.4091985196914,"fpListingPrice":0.00188999,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":6.29933667,"totalSupply":3333,"listedCount":442,"ownerCount":1697,"uniqueOwnerRatio":0.509150915091509,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-taprootwitches_pfp_1726155907984.gif","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":644955.515288945,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/taprootwitches?cohort=ordinal\u0026window=7d\u0026currentFp=0.00188999\u0026fpPctChg=-28.40919851969136","description":"Grab yer wands because ITS•A•FULL•MOON, witches! A crafty collection of Magic Internet Witches created by @theresalieb, the artist behind the Quantum Cats Whitepaper. Taproot Witches are inscribed on sats from the first bitcoin in circulation, and are the first dynamic Ordinals collection synced with the lunar cycle."},{"cohort":"ordinal","name":"Bitcoin Whales","collectionSymbol":"bitcoinwhales","collectionId":"bitcoinwhales","vol":0.0793658,"totalVol":13.90036672,"totalTxns":4091,"volPctChg":1395.21100226,"txns":34,"txnsPctChg":325,"fp":0.000464,"fpPctChg":11.8072289156627,"fpListingPrice":0.000464,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":4.086912,"totalSupply":8808,"listedCount":1150,"ownerCount":3927,"uniqueOwnerRatio":0.445844686648501,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-bitcoinwhales_pfp_1700123252800.jpeg","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":418437.142350827,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/bitcoinwhales?cohort=ordinal\u0026window=7d\u0026currentFp=0.000464\u0026fpPctChg=11.807228915662659","description":"Byte-sized whales residing in Ordinals| Inscribed on 02.14.23"},{"cohort":"ordinal","name":"Sparks","collectionSymbol":"sparks","collectionId":"sparks","vol":0.079,"totalVol":6.206959,"totalTxns":24,"txns":2,"fp":0.079,"fpPctChg":97.5,"fpListingPrice":0.079,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":8.769,"totalSupply":111,"listedCount":15,"ownerCount":109,"uniqueOwnerRatio":0.981981981981982,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-sparks_pfp_1702631354066.jpeg","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":897811.183914505,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/sparks?cohort=ordinal\u0026window=7d\u0026currentFp=0.079\u0026fpPctChg=97.50000000000001","description":"SPARKS, an exclusive network for founders, content creators, investors, and community members building together on Bitcoin and beyond."},{"cohort":"ordinal","name":"Runes Keys","collectionSymbol":"runes_keys","collectionId":"runes_keys","vol":0.07845078,"totalVol":0.23667271,"totalTxns":195,"volPctChg":-50.41725253,"txns":67,"txnsPctChg":-47.65625,"fp":0.002299,"fpPctChg":109.762773722628,"fpListingPrice":0.002299,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":10.216756,"totalSupply":4444,"listedCount":57,"ownerCount":983,"uniqueOwnerRatio":0.221197119711971,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-runes_keys_pfp_1732081493801.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":1046039.20630923,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/runes_keys?cohort=ordinal\u0026window=7d\u0026currentFp=0.002299\u0026fpPctChg=109.76277372262774","description":"4,444 Runes Keys on Bitcoin ꄗ Unlock rewards and unrivaled VIP access to RuneMine—the memecoin bridge fusing Bitcoin, Solana, and beyond. More than a collectible, it’s your Key to the next era of memes without limits."},{"cohort":"ordinal","name":"PatoshiPunks","collectionSymbol":"patoshipunks","collectionId":"patoshipunks","vol":0.07834726,"totalVol":7.60772967,"totalTxns":6256,"volPctChg":94.14905717,"txns":134,"txnsPctChg":100,"fp":0.00083,"fpPctChg":43.1034482758621,"fpListingPrice":0.00083,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":8.3,"totalSupply":10000,"listedCount":1172,"ownerCount":2768,"uniqueOwnerRatio":0.2768,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-patoshipunks_pfp_1719183385523.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":849792.773006089,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/patoshipunks?cohort=ordinal\u0026window=7d\u0026currentFp=0.00083\u0026fpPctChg=43.10344827586208","description":"A 10K Ordinals collection celebrating the Bitcoin aesthetic, curated for OGs and Bitcoin lovers alike. Perfect for Punk enthusiasts and crypto pioneers, merging Bitcoin heritage with personal style. 👣"},{"cohort":"ordinal","name":"Pixel Pepes","collectionSymbol":"pixelpepes","collectionId":"pixelpepes","vol":0.076333,"totalVol":7.45018289,"totalTxns":248,"volPctChg":-45.5740066,"txns":9,"txnsPctChg":-10,"fp":0.0138,"fpPctChg":-6.75675675675677,"fpListingPrice":0.0138,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":21.5694,"totalSupply":1563,"listedCount":140,"ownerCount":1090,"uniqueOwnerRatio":0.697376839411388,"image":"https://bafkreiga75vhw3346sfkqbbxmvizz4qfhdiq5xwkotpldlzrnipecweufm.ipfs.nftstorage.link","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":2208375.9322985,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/pixelpepes?cohort=ordinal\u0026window=7d\u0026currentFp=0.0138\u0026fpPctChg=-6.756756756756765","description":"The first ever airdrop on Bitcoin Ordinals. 1563 Pixel Pepe NFTs."},{"cohort":"ordinal","name":"FloraForms by Harto X Belvedere","collectionSymbol":"floraforms-by-harto","collectionId":"floraforms-by-harto","vol":0.07504219,"totalVol":84.52709947,"totalTxns":13067,"volPctChg":-40.12148664,"txns":36,"txnsPctChg":-35.71428571,"fp":0.0022,"fpPctChg":-1.25584610274778,"fpListingPrice":0.0022,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":22,"totalSupply":10000,"listedCount":833,"ownerCount":3587,"uniqueOwnerRatio":0.3587,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-floraforms-by-harto_pfp_1707842263824.jpeg","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":2252462.77182337,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/floraforms-by-harto?cohort=ordinal\u0026window=7d\u0026currentFp=0.0022\u0026fpPctChg=-1.2558461027477819","description":"Floraforms is a collection of 10,000 generative artworks inspired by Gustav Klimt’s masterpiece The Kiss. Art by Harto in collaboration with the Belvedere Museum of Vienna and accelerated by Arties and Vivid."},{"cohort":"ordinal","name":"PEST CTRL","collectionSymbol":"pestctrl","collectionId":"pestctrl","vol":0.07454705,"totalVol":0.07454705,"totalTxns":74,"txns":74,"fp":0.00061,"fpListingPrice":0.00061,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.2562,"totalSupply":420,"listedCount":59,"ownerCount":383,"uniqueOwnerRatio":0.911904761904762,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-pestctrl_pfp_1732909137660.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":26230.9528245976,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/pestctrl?cohort=ordinal\u0026window=7d\u0026currentFp=0.00061","description":"PEST CTRL: 420 piece collection eradicating the infestation of centralized finance."},{"cohort":"ordinal","name":"Commoners","collectionSymbol":"commoners","collectionId":"commoners","vol":0.066883,"totalVol":32.03044438,"totalTxns":4253,"volPctChg":385.01087745,"txns":25,"txnsPctChg":316.66666667,"fp":0.0019,"fpPctChg":-23.3870967741936,"fpListingPrice":0.0019,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":19,"totalSupply":10000,"listedCount":1017,"ownerCount":1490,"uniqueOwnerRatio":0.149,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-commoners_pfp_1709481886866.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":1945308.75748382,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/commoners?cohort=ordinal\u0026window=7d\u0026currentFp=0.0019\u0026fpPctChg=-23.38709677419355","description":"The first 10k Ordinals collection inscribed on Uncommon Sats."},{"cohort":"ordinal","name":"GeniiData Genesis Pass","collectionSymbol":"genesis","collectionId":"genesis","vol":0.0635,"totalVol":9.4534,"totalTxns":186,"volPctChg":84.05797101,"txns":4,"txnsPctChg":100,"fp":0.017,"fpPctChg":-15,"fpListingPrice":0.017,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":6.8,"totalSupply":400,"listedCount":42,"ownerCount":351,"uniqueOwnerRatio":0.8775,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-genesis_pfp_1696667920436.jpeg","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":696215.765836314,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/genesis?cohort=ordinal\u0026window=7d\u0026currentFp=0.017\u0026fpPctChg=-14.999999999999991","description":"GeniiData is an all-in-one Ordinals platform that provides seeking Ordinals alpha, portfolio tracker, and powerful search engine for inscriptions. GeniiData has released Genesis (GeniiData Genesis Pass), the first parent-child inscription collection, to honor the early users for their support.Benefits of being an OG: Enjoy a perpetual 15% discount on GeniiData's inscribe service, first parent-child inscription collection, VIP access to exclusive events."},{"cohort":"ordinal","name":"Goosinals","collectionSymbol":"goosinals","collectionId":"goosinals","vol":0.06278899,"totalVol":69.21076206,"totalTxns":3194,"volPctChg":173.69996962,"txns":27,"txnsPctChg":170,"fp":0.0021,"fpPctChg":5.05305179115454,"fpListingPrice":0.0021,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":21,"totalSupply":10000,"listedCount":997,"ownerCount":3882,"uniqueOwnerRatio":0.3882,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-goosinals_pfp_1696363718444.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":2150078.10037685,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/goosinals?cohort=ordinal\u0026window=7d\u0026currentFp=0.0021\u0026fpPctChg=5.053051791154539","description":"A vibrant, low effort 10k PFP project using geese."},{"cohort":"ordinal","name":"0N1 FORCE: THE F4LL3N","collectionSymbol":"on1force_the_f4llen","collectionId":"on1force_the_f4llen","vol":0.06278626,"totalVol":88.34101857,"totalTxns":4004,"volPctChg":-84.24298083,"txns":13,"txnsPctChg":-81.94444444,"fp":0.004,"fpPctChg":-19.8396793587174,"fpListingPrice":0.004,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":13.332,"totalSupply":3333,"listedCount":328,"ownerCount":1532,"uniqueOwnerRatio":0.45964596459646,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-0n1force_the_f4llen_pfp_1711650351631.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":1364992.43972496,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/on1force_the_f4llen?cohort=ordinal\u0026window=7d\u0026currentFp=0.004\u0026fpPctChg=-19.839679358717433","description":"Embark on an unprecedented journey with the Ordinals collection from 0N1 FORCE, where participants will not only possess unique digital artifacts, but also wield the power to shape their own adventure within the universe. This expansion of IP invites enthusiasts to become integral parts of the evolving saga, making every decision a pivotal moment in the rich tapestry of the 0N1 FORCE universe. Join us as we redefine storytelling in the digital age and unleash boundless possibilities for creative expression and exploration."},{"cohort":"ordinal","name":"FTW","collectionSymbol":"ftw","collectionId":"ftw","vol":0.06081688,"totalVol":10.25872252,"totalTxns":3356,"volPctChg":63.62206046,"txns":25,"txnsPctChg":47.05882353,"fp":0.00209999,"fpPctChg":-3.6697416043193,"fpListingPrice":0.00209999,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":4.409979,"totalSupply":2100,"listedCount":270,"ownerCount":822,"uniqueOwnerRatio":0.391428571428571,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-ftw_pfp_1723706428353.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":451514.251001038,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/ftw?cohort=ordinal\u0026window=7d\u0026currentFp=0.00209999\u0026fpPctChg=-3.6697416043192987","description":"for the weirdos, for the world"},{"cohort":"ordinal","name":"BitBlocks by Billy Restey","collectionSymbol":"bit-blocks","collectionId":"bit-blocks","vol":0.0580296,"totalVol":31.2967714,"totalTxns":6697,"volPctChg":4542.368,"txns":41,"txnsPctChg":4000,"fp":0.0018,"fpPctChg":65.1376146788991,"fpListingPrice":0.0018,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":11.7414,"totalSupply":6523,"listedCount":796,"ownerCount":2307,"uniqueOwnerRatio":0.353671623486126,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-bit-blocks_pfp_1703274529621.jpeg","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":1202139.38132213,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/bit-blocks?cohort=ordinal\u0026window=7d\u0026currentFp=0.0018\u0026fpPctChg=65.13761467889907","description":"User-generated, code-based art using recursion to source data from other inscriptions by billyrestey"},{"cohort":"ordinal","name":"BRUTAL EDGE","collectionSymbol":"brutal-edge","collectionId":"brutal-edge","vol":0.05708,"totalVol":0.71696502,"totalTxns":1411,"volPctChg":1553.06488888,"txns":160,"txnsPctChg":540,"fp":0.00047,"fpPctChg":147.368421052632,"fpListingPrice":0.00047,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":2.11406,"totalSupply":4498,"listedCount":484,"ownerCount":1154,"uniqueOwnerRatio":0.256558470431303,"image":"https://bafybeiajw2jl7l3p67cx6kacdtxp3kzfs264b4kwchbgrn5pfd64s3vohi.ipfs.w3s.link/Screenshot%202024-08-22%20at%209.44.40%E2%80%AFAM.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":216447.338518223,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/brutal-edge?cohort=ordinal\u0026window=7d\u0026currentFp=0.00047\u0026fpPctChg=147.36842105263156","description":"BRUTAL EDGE is the inaugural collaboration between OG Ordinals artists FAR and Harto."},{"cohort":"ordinal","name":"The Block","collectionSymbol":"theblockcollection","collectionId":"theblockcollection","vol":0.05668999,"totalVol":55.98460466,"totalTxns":1293,"volPctChg":-44.19432349,"txns":6,"txnsPctChg":-40,"fp":0.0082,"fpPctChg":-22.5684608120869,"fpListingPrice":0.0082,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":8.2,"totalSupply":1000,"listedCount":109,"ownerCount":697,"uniqueOwnerRatio":0.697,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-theblockcollection_pfp_1712260122453.gif","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":839554.305861437,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/theblockcollection?cohort=ordinal\u0026window=7d\u0026currentFp=0.0082\u0026fpPctChg=-22.568460812086865","description":"1000 digital blocks that allow the holders to convert them into real physical marble sculptures. Created by the artist who designed the Runestone."},{"cohort":"ordinal","name":"Bitmap Emporium","collectionSymbol":"bitmap_emporium","collectionId":"bitmap_emporium","vol":0.0556654,"totalVol":24.38887817,"totalTxns":1982,"volPctChg":-27.0316139,"txns":14,"txnsPctChg":-33.33333333,"fp":0.0038,"fpListingPrice":0.0038,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":9.7812,"totalSupply":2574,"listedCount":188,"ownerCount":1320,"uniqueOwnerRatio":0.512820512820513,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-bitmap_emporium_pfp_1729601925814.jpeg","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":1001444.94835267,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/bitmap_emporium?cohort=ordinal\u0026window=7d\u0026currentFp=0.0038","description":"First Bitmap PFP. An exclusive club for the initiated. Each piece in the collection is unified under the Bitmap.717328 through distinct parent-child inscriptions placed on rare sats, adding a layer of intricate unity. The golden dynasty of Emporium reigns supreme."},{"cohort":"ordinal","name":"Mining Passes","collectionSymbol":"fmp","collectionId":"fmp","vol":0.05361041,"totalVol":11.97389525,"totalTxns":2672,"volPctChg":22.30096987,"txns":25,"txnsPctChg":31.57894737,"fp":0.00259,"fpPctChg":12.6091852573272,"fpListingPrice":0.00259,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":8.17145,"totalSupply":3155,"listedCount":206,"ownerCount":585,"uniqueOwnerRatio":0.185419968304279,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-fmp_pfp_1725397315264.jpeg","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":836631.223491639,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/fmp?cohort=ordinal\u0026window=7d\u0026currentFp=0.00259\u0026fpPctChg=12.609185257327194","description":"3155 EZ Mining Passes for the Fractal Bitcoin Network"},{"cohort":"ordinal","name":"Manufactured by Lemonhaze","collectionSymbol":"manufactured-by-lemonhaze","collectionId":"manufactured-by-lemonhaze","vol":0.05,"totalVol":6.33240024,"totalTxns":607,"txns":4,"fp":0.015,"fpPctChg":25,"fpListingPrice":0.015,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":6.3,"totalSupply":420,"listedCount":38,"ownerCount":115,"uniqueOwnerRatio":0.273809523809524,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-manufactured-by-lemonhaze_pfp_1712586406478.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":645023.430113055,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/manufactured-by-lemonhaze?cohort=ordinal\u0026window=7d\u0026currentFp=0.015\u0026fpPctChg=25","description":"\\"},{"cohort":"ordinal","name":"BUZZ BUZZ BUZZ","collectionSymbol":"buzz-buzz-buzz","collectionId":"buzz-buzz-buzz","vol":0.046241,"totalVol":11.63335982,"totalTxns":14251,"volPctChg":247.96526744,"txns":158,"txnsPctChg":135.82089552,"fp":0.000389,"fpPctChg":62.0833333333333,"fpListingPrice":0.000389,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":10.736789,"totalSupply":27601,"listedCount":1858,"ownerCount":6176,"uniqueOwnerRatio":0.223760008695337,"image":"https://bafybeigjbrtahvthzzmsfqkbspvms3otq7mtxq2soe3ir7f36p6rtyw5l4.ipfs.nftstorage.link/","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":5,"currencyUsdRate":102384.671446517,"marketCapUsd":1099282.61415558,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/buzz-buzz-buzz?cohort=ordinal\u0026window=7d\u0026currentFp=0.000389\u0026fpPctChg=62.083333333333336","description":"Released as a time-limited open edition, BUZZ BUZZ BUZZ by FAR is an experimental art collection that aims to push the boundaries of digital and non digital art."},{"cohort":"ordinal","name":"Whal3s","collectionSymbol":"btcwhal3s","collectionId":"btcwhal3s","vol":0.04539599,"totalVol":0.14519399,"totalTxns":20,"volPctChg":467.59177294,"txns":7,"txnsPctChg":600,"fp":0.00894207,"fpPctChg":35.4861143729006,"fpListingPrice":0.00894207,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.94785942,"totalSupply":106,"listedCount":7,"ownerCount":95,"uniqueOwnerRatio":0.89622641509434,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-btcwhal3s_pfp_1727715266350.jpeg","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":97046.2752941859,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/btcwhal3s?cohort=ordinal\u0026window=7d\u0026currentFp=0.00894207\u0026fpPctChg=35.486114372900566","description":"111 Whal3s diving into the deep oceans of the bitcoin blockchain"},{"cohort":"ordinal","name":"DogePunks","collectionSymbol":"dogepunks","collectionId":"dogepunks","vol":0.04537384,"totalVol":24.42717172,"totalTxns":4015,"volPctChg":291.03344919,"txns":24,"txnsPctChg":140,"fp":0.00136899,"fpPctChg":-0.653125204101623,"fpListingPrice":0.00136899,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":13.68716202,"totalSupply":9998,"listedCount":1242,"ownerCount":4171,"uniqueOwnerRatio":0.417183436687338,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-dogepunks_pfp_1705318347182.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":1401355.58645294,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/dogepunks?cohort=ordinal\u0026window=7d\u0026currentFp=0.00136899\u0026fpPctChg=-0.6531252041016233","description":"One of the first free-mint collectible characters of 10,000 ordinals on-chain"},{"cohort":"ordinal","name":"Ordinal SigmaX","collectionSymbol":"ordinalsigmax","collectionId":"ordinalsigmax","vol":0.04476205,"totalVol":35.48897913,"totalTxns":7667,"volPctChg":-39.73118052,"txns":44,"txnsPctChg":46.66666667,"fp":0.00061,"fpPctChg":-30.5231266870921,"fpListingPrice":0.00061,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":3.38855,"totalSupply":5555,"listedCount":344,"ownerCount":2173,"uniqueOwnerRatio":0.391179117911791,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-ordinalsigmax_pfp_1711381716861.gif","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":346935.578430094,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/ordinalsigmax?cohort=ordinal\u0026window=7d\u0026currentFp=0.00061\u0026fpPctChg=-30.523126687092116","description":"The largest animated PFP collection on Bitcoin."},{"cohort":"ordinal","name":"Season 0 : Casey’s Collection","collectionSymbol":"season0","collectionId":"season0","vol":0.04189573,"totalVol":1.76604527,"totalTxns":1715,"volPctChg":-14.46586759,"txns":72,"txnsPctChg":-25.77319588,"fp":0.00062,"fpPctChg":37.7777777777778,"fpListingPrice":0.00062,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":1.86,"totalSupply":3000,"listedCount":320,"ownerCount":1703,"uniqueOwnerRatio":0.567666666666667,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-season0_pfp_1728946063306.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":190435.488890521,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/season0?cohort=ordinal\u0026window=7d\u0026currentFp=0.00062\u0026fpPctChg=37.77777777777778","description":"the first collection by Inscripedia using Casey Rodarmor's art"},{"cohort":"ordinal","name":"Experiment 9 ","collectionSymbol":"experiment_9","collectionId":"experiment_9","vol":0.04157964,"totalVol":2.75571062,"totalTxns":246,"volPctChg":-74.07381358,"txns":7,"txnsPctChg":-68.18181818,"fp":0.00699999,"fpPctChg":-6.6666755555674,"fpListingPrice":0.00699999,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":2.9399958,"totalSupply":420,"listedCount":55,"ownerCount":311,"uniqueOwnerRatio":0.740476190476191,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-experiment_9_pfp_1729788944417.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":301010.504037139,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/experiment_9?cohort=ordinal\u0026window=7d\u0026currentFp=0.00699999\u0026fpPctChg=-6.666675555567403","description":"Experiment 9 (E9) is the genesis collection under the full block parent \\"},{"cohort":"ordinal","name":"Untitled","collectionSymbol":"untitled","collectionId":"untitled","vol":0.0407152,"totalVol":9.36649524,"totalTxns":151,"volPctChg":20.10383481,"txns":3,"txnsPctChg":50,"fp":0.01799,"fpPctChg":-0.0555555555555531,"fpListingPrice":0.01799,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":3.99378,"totalSupply":222,"listedCount":48,"ownerCount":202,"uniqueOwnerRatio":0.90990990990991,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-untitled_pfp_1721229720767.jpeg","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":408901.85312967,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/untitled?cohort=ordinal\u0026window=7d\u0026currentFp=0.01799\u0026fpPctChg=-0.05555555555555314","description":"The first Ordinals project to be minted with a Rune."},{"cohort":"ordinal","name":"Quark20","collectionSymbol":"quark20","collectionId":"quark20","vol":0.04,"totalVol":0.04,"totalTxns":4,"txns":4,"fp":0.01,"fpListingPrice":0.01,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":2,"totalSupply":200,"listedCount":10,"ownerCount":88,"uniqueOwnerRatio":0.44,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-quantumgate_pfp_1731941031590.gif","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":204769.342893033,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/quark20?cohort=ordinal\u0026window=7d\u0026currentFp=0.01","description":"Quark20 links BTC and ETH using their shared elliptic curve, SECP256K1."},{"cohort":"ordinal","name":"BITRING","collectionSymbol":"bitring","collectionId":"bitring","vol":0.03975,"totalVol":0.059875,"totalTxns":8,"txns":5,"fp":0.0039,"fpPctChg":-62.8571428571429,"fpListingPrice":0.0039,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":1.2987,"totalSupply":333,"listedCount":51,"ownerCount":294,"uniqueOwnerRatio":0.882882882882883,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-bitring_pfp_1714105952951.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":1,"currencyUsdRate":102384.671446517,"marketCapUsd":132966.972807591,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/bitring?cohort=ordinal\u0026window=7d\u0026currentFp=0.0039\u0026fpPctChg=-62.857142857142854","description":"Introducing BITRING – the first animated generative art collection on Bitcoin. Each BITRING is uniquely crafted by a custom algorithm, producing 1 to 5 rings in different colors and sizes, with monochrome being the rarest trait. With only 333 inscribed between the 60k-99k ordinal range, every BITRING holds a distinctive rarity. Burn your ETH BITRING to claim a BTC ordinal on bitring.network – once claimed, your ETH BITRING ceases to exist, transforming into an exclusive Bitcoin artifact inscribed in the early days of ordinals."},{"cohort":"ordinal","name":"Poke Pixels","collectionSymbol":"pokepixels","collectionId":"pokepixels","vol":0.039,"totalVol":3.43458042,"totalTxns":326,"volPctChg":266.05969589,"txns":4,"txnsPctChg":-20,"fp":0.0038,"fpPctChg":-5,"fpListingPrice":0.0038,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":1.0564,"totalSupply":278,"listedCount":90,"ownerCount":129,"uniqueOwnerRatio":0.464028776978417,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-pokepixels_pfp_1732424031988.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":108159.1669161,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/pokepixels?cohort=ordinal\u0026window=7d\u0026currentFp=0.0038\u0026fpPctChg=-5.000000000000004","description":"Poke Pixels, crafted by Oak. Don't miss your chance to own these exclusive collectibles. Join us on this exciting journey!"},{"cohort":"ordinal","name":"Alien Ordinal Artifacts","collectionSymbol":"aoa","collectionId":"aoa","vol":0.037949,"totalVol":2.13132,"totalTxns":186,"volPctChg":19.37401699,"txns":6,"txnsPctChg":50,"fp":0.0065,"fpPctChg":-7.14285714285715,"fpListingPrice":0.0065,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":1.95,"totalSupply":300,"listedCount":44,"ownerCount":180,"uniqueOwnerRatio":0.6,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-aoa_pfp_1719959919534.jpeg","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":2,"currencyUsdRate":102384.671446517,"marketCapUsd":199650.109320708,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/aoa?cohort=ordinal\u0026window=7d\u0026currentFp=0.0065\u0026fpPctChg=-7.142857142857151","description":"Alien Ordinal Artifacts - First Edition. Etched for eternity on Nakamoto’s chain. Forging the most formidable alien conspiracy collective Bitcoin has ever known."},{"cohort":"ordinal","name":"Bitcoin Bandits","collectionSymbol":"bitcoin-bandits","collectionId":"bitcoin-bandits","vol":0.0369,"totalVol":26.26203912,"totalTxns":187,"volPctChg":-50.73431242,"txns":1,"txnsPctChg":-50,"fp":0.0382,"fpPctChg":3.52303523035229,"fpListingPrice":0.0382,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":19.5584,"totalSupply":512,"listedCount":33,"ownerCount":407,"uniqueOwnerRatio":0.794921875,"image":"https://bafkreicbzjpr5ibvlq6bbpdzzmg7e4kbkakk3vuatqqwctokuhgv6ldoqm.ipfs.nftstorage.link/","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":2002480.35801955,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/bitcoin-bandits?cohort=ordinal\u0026window=7d\u0026currentFp=0.0382\u0026fpPctChg=3.5230352303522894","description":"Once the Ordinal dust Settles the Bandits emerge"},{"cohort":"ordinal","name":"Gizmo The Cat","collectionSymbol":"gizmothecatbtc","collectionId":"gizmothecatbtc","vol":0.0360051,"totalVol":22.04409478,"totalTxns":7887,"volPctChg":-34.36585525,"txns":45,"txnsPctChg":-15.09433962,"fp":0.0007,"fpPctChg":-11.2801013941698,"fpListingPrice":0.0007,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":3.8885,"totalSupply":5555,"listedCount":806,"ownerCount":2443,"uniqueOwnerRatio":0.43978397839784,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-gizmothecatbtc_pfp_1729161478462.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":398122.79491978,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/gizmothecatbtc?cohort=ordinal\u0026window=7d\u0026currentFp=0.0007\u0026fpPctChg=-11.28010139416984","description":"5555 Gizmo The Cat TAKING OVER ORDINAL NOTHING MORE"},{"cohort":"ordinal","name":"Van Gogh's painting","collectionSymbol":"vgp","collectionId":"vgp","vol":0.0357,"totalVol":3.5114,"totalTxns":76,"txns":4,"fp":0.0205,"fpPctChg":127.777777777778,"fpListingPrice":0.0205,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":6.642,"totalSupply":324,"listedCount":77,"ownerCount":207,"uniqueOwnerRatio":0.638888888888889,"image":"https://bafkreid7nsrvu37pdddqr5yt4woga5c6ghzekrs2jjjgqnaphbwi3mh32e.ipfs.nftstorage.link/","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":1,"currencyUsdRate":102384.671446517,"marketCapUsd":680038.987747764,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/vgp?cohort=ordinal\u0026window=7d\u0026currentFp=0.0205\u0026fpPctChg=127.77777777777781","description":"van gogh is a post impressionist painter, a Protestant clergyman family born in the rural area. He worked as a clerk and a business agent in his early years, and also served as a missioner in the mining area.He is full of fantasy and love to go to extremes. He suffers setbacks and failures in life.Finally, he devotes himself to painting and is determined to \\"},{"cohort":"ordinal","name":"Stoshi","collectionSymbol":"stoshi","collectionId":"stoshi","vol":0.034,"totalVol":1.81117957,"totalTxns":86,"volPctChg":-62.63736264,"txns":1,"txnsPctChg":-85.71428571,"fp":0.03499,"fpPctChg":2.91176470588235,"fpListingPrice":0.03499,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":5.2485,"totalSupply":150,"listedCount":7,"ownerCount":118,"uniqueOwnerRatio":0.786666666666667,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-stoshi_pfp_1724550703357.jpeg","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":537365.948087043,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/stoshi?cohort=ordinal\u0026window=7d\u0026currentFp=0.03499\u0026fpPctChg=2.911764705882347","description":"150 Stoshi Ordinals - The beginning of the the biggest event in crypto history."},{"cohort":"ordinal","name":"Ordinal Shards by Billy Restey","collectionSymbol":"ordinal-shards","collectionId":"ordinal-shards","vol":0.034,"totalVol":1.894,"totalTxns":19,"txns":1,"fp":0.035,"fpPctChg":2.94117647058825,"fpListingPrice":0.035,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":3.5,"totalSupply":100,"listedCount":16,"ownerCount":73,"uniqueOwnerRatio":0.73,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-ordinal-shards_pfp_1698268409766.jpeg","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":1,"currencyUsdRate":102384.671446517,"marketCapUsd":358346.350062809,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/ordinal-shards?cohort=ordinal\u0026window=7d\u0026currentFp=0.035\u0026fpPctChg=2.941176470588247","description":"100 rare gems on Bitcoin by billyrestey"},{"cohort":"ordinal","name":"FUD","collectionSymbol":"fudonbtc","collectionId":"fudonbtc","vol":0.032997,"totalVol":2.34575036,"totalTxns":1263,"volPctChg":66.67407508,"txns":31,"txnsPctChg":29.16666667,"fp":0.00099799,"fpPctChg":53.5369230769231,"fpListingPrice":0.00099799,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.88222316,"totalSupply":884,"listedCount":262,"ownerCount":324,"uniqueOwnerRatio":0.366515837104072,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-fudonbtc_pfp_1723415628186.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":90326.1283791078,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/fudonbtc?cohort=ordinal\u0026window=7d\u0026currentFp=0.00099799\u0026fpPctChg=53.53692307692308","description":"\\"},{"cohort":"ordinal","name":"FLARES by FAR","collectionSymbol":"flares","collectionId":"flares","vol":0.0319,"totalVol":23.21160576,"totalTxns":572,"volPctChg":-62.82051282,"txns":2,"txnsPctChg":-50,"fp":0.018,"fpPctChg":2.85714285714285,"fpListingPrice":0.018,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":9.216,"totalSupply":512,"listedCount":95,"ownerCount":274,"uniqueOwnerRatio":0.53515625,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-flares_pfp_1707846849543.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":2,"currencyUsdRate":102384.671446517,"marketCapUsd":943577.132051098,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/flares?cohort=ordinal\u0026window=7d\u0026currentFp=0.018\u0026fpPctChg=2.857142857142847","description":"FLARES by FAR is an on-chain art project that engages with the concepts of world-building, immersion, and blockchain as part of the PARALLAX body of work. It comprises 512 unique pieces created from an algorithm using three.js and GLSL, designed to generate terraforming and atmospheric elements."},{"cohort":"ordinal","name":"Sack O' KET","collectionSymbol":"sack-o-ket","collectionId":"sack-o-ket","vol":0.03005134,"totalVol":7.81264112,"totalTxns":12836,"volPctChg":20.65826286,"txns":53,"txnsPctChg":17.77777778,"fp":0.00057,"fpPctChg":-8.21256038647343,"fpListingPrice":0.00057,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":5.70057,"totalSupply":10001,"listedCount":712,"ownerCount":1516,"uniqueOwnerRatio":0.151584841515848,"image":"https://nftstorage.link/ipfs/bafybeibfnifcqh75uitqm6joxkqcgbeg2jhr23uykzpa3hqwfqub75qv3y","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":583650.98650787,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/sack-o-ket?cohort=ordinal\u0026window=7d\u0026currentFp=0.00057\u0026fpPctChg=-8.212560386473433","description":"THE DANKEST KET IN THE SHED\\n\\nSynthesized by the KETMASTER\\n\\nDISCLAIMER: The asset referenced is a BRC-420 Metaverse asset. Please be aware that it may not display correctly in your wallet."},{"cohort":"ordinal","name":"Mutant Hounds: Inscriptions","collectionSymbol":"mhi","collectionId":"mhi","vol":0.028439,"totalVol":14.00232054,"totalTxns":2419,"volPctChg":168.19124859,"txns":28,"txnsPctChg":100,"fp":0.00094,"fpPctChg":18.9873417721519,"fpListingPrice":0.00094,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":9.4,"totalSupply":10000,"listedCount":603,"ownerCount":1812,"uniqueOwnerRatio":0.1812,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-mhi_pfp_1711123784126.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":962415.911597257,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/mhi?cohort=ordinal\u0026window=7d\u0026currentFp=0.00094\u0026fpPctChg=18.98734177215189","description":"10,000 Mutant Hounds returning to The Source. This is art ascension. The hallmark of Ordinal art and the purest form of Mutant Hounds provenance."},{"cohort":"ordinal","name":"On the Edge of Oblivion by Nullish","collectionSymbol":"oblivion","collectionId":"oblivion","vol":0.02778,"totalVol":25.11416341,"totalTxns":206,"txns":2,"fp":0.0254,"fpPctChg":-5.92592592592592,"fpListingPrice":0.0254,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":14.0716,"totalSupply":554,"listedCount":62,"ownerCount":421,"uniqueOwnerRatio":0.759927797833935,"image":"https://bafybeihkj7avwu5y3ge52roa7c553kxjnxctlddgmxnhvq2qtp3lpsoh4i.ipfs.nftstorage.link/","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":1440716.1427268,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/oblivion?cohort=ordinal\u0026window=7d\u0026currentFp=0.0254\u0026fpPctChg=-5.925925925925924","description":"Inspired by the first photograph captured by a telescope of a black hole (Messier 87), embark on a voyage to the outer realms of our universe, where the very fabric of space and time is distorted by an overwhelming force of gravity in ways we cannot yet comprehend."},{"cohort":"ordinal","name":"Bitcoin Trumps","collectionSymbol":"bitcointrumps","collectionId":"bitcointrumps","vol":0.0258319,"totalVol":23.06274479,"totalTxns":12635,"volPctChg":420.50011082,"txns":50,"txnsPctChg":150,"fp":0.0003888,"fpPctChg":55.52,"fpListingPrice":0.0003888,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":3.888,"totalSupply":10000,"listedCount":1281,"ownerCount":2512,"uniqueOwnerRatio":0.2512,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-bitcointrumps_pfp_1705956348696.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":398071.602584057,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/bitcointrumps?cohort=ordinal\u0026window=7d\u0026currentFp=0.0003888\u0026fpPctChg=55.52000000000001","description":"First 10K Trump collection on #Bitcoin made with Ordinals 🇺🇸 🦅 No utility. No roadmap. Just Trumps. Make Bitcoin Great Again."},{"cohort":"ordinal","name":"Bitcoin Boos: Boottalion","collectionSymbol":"boottalion","collectionId":"boottalion","vol":0.02573,"totalVol":27.92506697,"totalTxns":2311,"volPctChg":8.10370225,"txns":6,"fp":0.00479779,"fpPctChg":10.1676467684197,"fpListingPrice":0.00479779,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":8.7319778,"totalSupply":1820,"listedCount":249,"ownerCount":1122,"uniqueOwnerRatio":0.616483516483517,"image":"https://bafkreiez2au5us5fbsedjwwz4pnhvnfysiu4wpshfq6n2d2vmms7wxgevq.ipfs.nftstorage.link/","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":894020.678131278,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/boottalion?cohort=ordinal\u0026window=7d\u0026currentFp=0.00479779\u0026fpPctChg=10.167646768419658","description":"⚔️ Embark on a unique journey with our cursed collection of 1820 unique digital warriors, each inscribed under the revered Boo King as provenance. 🛡️"},{"cohort":"ordinal","name":"TradFiLines","collectionSymbol":"tfl","collectionId":"tfl","vol":0.0239,"totalVol":4.2737935,"totalTxns":58,"txns":1,"fp":0.026999,"fpPctChg":17.3869565217391,"fpListingPrice":0.026999,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":13.4995,"totalSupply":500,"listedCount":40,"ownerCount":430,"uniqueOwnerRatio":0.86,"image":"https://bafkreidtguxoitbp2nfvqenw5z6r7lri3kmtvghdpz7o27z27vivrut7dq.ipfs.nftstorage.link/","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":1382141.87219225,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/tfl?cohort=ordinal\u0026window=7d\u0026currentFp=0.026999\u0026fpPctChg=17.386956521739116","description":"The ordinal versions of TradFiLines were registered at the start of February and therefore have fairly low inscription numbers. They are made from what the ETH TFL looked like at that point in time. The ETH version has limited trading hours and dynamic svg, while the ordinal version on btc is unbound by these restrictions and is not dynamic. The art is a candlestick chart (common in stocks and crypto) generated from a random seed. The ticker and exchange is also randomly generated. This is why all the different ordinals are very different from each other."},{"cohort":"ordinal","name":"Darkman - Shell Genesis NFT","collectionSymbol":"darkman","collectionId":"darkman","vol":0.02317,"totalVol":5.83951641,"totalTxns":2517,"txns":28,"fp":0.00099,"fpPctChg":80,"fpListingPrice":0.00099,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":4.95,"totalSupply":5000,"listedCount":476,"ownerCount":3276,"uniqueOwnerRatio":0.6552,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-darkman_pfp_1718041351751.jpeg","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":506804.123660258,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/darkman?cohort=ordinal\u0026window=7d\u0026currentFp=0.00099\u0026fpPctChg=79.99999999999999","description":"The OG NFT collection of Shell Finance, a decentralized stablecoin system built on Bitcoin L1. #sUSD(sUSD•sUSD•sUSD)"},{"cohort":"ordinal","name":"Thugbirdz","collectionSymbol":"thugbirdz","collectionId":"thugbirdz","vol":0.0231,"totalVol":0.221,"totalTxns":30,"txns":5,"fp":0.0094,"fpPctChg":370,"fpListingPrice":0.0094,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":3.948,"totalSupply":420,"listedCount":18,"ownerCount":145,"uniqueOwnerRatio":0.345238095238095,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-thugbirdz_pfp_1688392167537.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":404214.682870848,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/thugbirdz?cohort=ordinal\u0026window=7d\u0026currentFp=0.0094\u0026fpPctChg=370","description":"THUGBIRDZ THUGBIRDZ THUGBIRDZ THUGBIRDZ THUGBIRDZ THUGBIRDZ THUGBIRDZ THUGBIRDZ THUGBIRDZ THUGBIRDZ THUGBIRDZ THUGBIRDZ THUGBIRDZ THUGBIRDZ THUGBIRDZ THUGBIRDZ THUGBIRDZ THUGBIRDZ THUGBIRDZ THUGBIRDZ THUGBIRDZ THUGBIRDZ THUGBIRDZ THUGBIRDZ THUGBIRDZ THUGBIRDZ THUGBIRDZ THUGBIRDZ THUGBIRDZ THUGBIRDZ THUGBIRDZ THUGBIRDZ THUGBIRDZ THUGBIRDZ THUGBIRDZ THUGBIRDZ THUGBIRDZ THUGBIRDZ THUGBIRDZ THUGBIRDZ THUGBIRDZ THUGBIRDZ THUGBIRDZ THUGBIRDZ"},{"cohort":"ordinal","name":"Totes My Goats","collectionSymbol":"totesmygoat","collectionId":"totesmygoat","vol":0.0229975,"totalVol":0.1528975,"totalTxns":3,"txns":1,"fp":0.049,"fpPctChg":88.479661505914,"fpListingPrice":0.049,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":2.45,"totalSupply":50,"listedCount":10,"ownerCount":48,"uniqueOwnerRatio":0.96,"image":"https://bafkreig6twhnfxcfkym63xl2ps73zaund7sd7kxpmowj6m6256n6da4xbi.ipfs.nftstorage.link/","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":1,"currencyUsdRate":102384.671446517,"marketCapUsd":250842.445043966,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/totesmygoat?cohort=ordinal\u0026window=7d\u0026currentFp=0.049\u0026fpPctChg=88.47966150591404","description":"Nobody panic, we goat this! Totes My Goats is a collection of 50 goats. Each goat has its own personality, and style. You'll find their best trait is jumping on the backs of their superiors to obtain maximum control and domination. Deny them the opportunity to infiltrate your life and you'll enjoy a nice horn to the shin. Each image is inscribed on chain."},{"cohort":"ordinal","name":"DMT-Chaos","collectionSymbol":"chaos","collectionId":"chaos","vol":0.02278458,"totalVol":7.96684818,"totalTxns":2891,"volPctChg":155.713452,"txns":75,"txnsPctChg":212.5,"fp":0.000249,"fpPctChg":-29.4597580668008,"fpListingPrice":0.000249,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":2.007936,"totalSupply":8064,"listedCount":1249,"ownerCount":1513,"uniqueOwnerRatio":0.187624007936508,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-chaos_pfp_1710725591347.gif","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":205581.867645633,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/chaos?cohort=ordinal\u0026window=7d\u0026currentFp=0.000249\u0026fpPctChg=-29.459758066800767","description":"The First UNAT to utilize the Nonce value as it's seed.A random number selected by Bitcoin. Recursively constructed by way of ord. https://www.ord.io/63440121"},{"cohort":"ordinal","name":"Feeling Good","collectionSymbol":"feeling-good","collectionId":"feeling-good","vol":0.022417,"totalVol":45.04290399,"totalTxns":4272,"volPctChg":30.92741959,"txns":22,"txnsPctChg":37.5,"fp":0.001,"fpListingPrice":0.001,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":10,"totalSupply":10000,"listedCount":776,"ownerCount":8133,"uniqueOwnerRatio":0.8133,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-feeling-good_pfp_1712838739189.jpeg","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":1023846.71446517,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/feeling-good?cohort=ordinal\u0026window=7d\u0026currentFp=0.001","description":"In 2024, as we commemorate a year of milestones for Bitcoin and the ascension of Ordinals, 'Feeling Good' emerges as a collection dedicated to the early builders and believers in the Bitcoin ecosystem."},{"cohort":"ordinal","name":"BitMON","collectionSymbol":"bitmon","collectionId":"bitmon","vol":0.022,"totalVol":7.0161185,"totalTxns":60,"txns":2,"fp":0.0135,"fpPctChg":22.7272727272727,"fpListingPrice":0.0135,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":2.025,"totalSupply":150,"listedCount":41,"ownerCount":132,"uniqueOwnerRatio":0.88,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-bitmon_pfp_1710257186281.gif","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":207328.959679196,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/bitmon?cohort=ordinal\u0026window=7d\u0026currentFp=0.0135\u0026fpPctChg=22.72727272727273","description":"150 unique 16-bit Monsters made to be your digital companion."},{"cohort":"ordinal","name":"Apostles of Greed","collectionSymbol":"aog-orange","collectionId":"aog-orange","vol":0.021631,"totalVol":56.07540056,"totalTxns":3691,"volPctChg":-15.38624024,"txns":14,"txnsPctChg":-22.22222222,"fp":0.00179,"fpPctChg":19.3333333333333,"fpListingPrice":0.00179,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":4.95472,"totalSupply":2768,"listedCount":209,"ownerCount":1393,"uniqueOwnerRatio":0.503251445086705,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-aog-orange_pfp_1709949173800.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":507287.379309485,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/aog-orange?cohort=ordinal\u0026window=7d\u0026currentFp=0.00179\u0026fpPctChg=19.333333333333336","description":"2664 Unique Collectibles inscribed on satoshis from the first Bitcoin in circulation, bringing to life a forgotten world engulfed in greed"},{"cohort":"ordinal","name":"BitGlyphs","collectionSymbol":"bitglyphs","collectionId":"bitglyphs","vol":0.0215,"totalVol":52.543253,"totalTxns":616,"volPctChg":-50,"txns":1,"txnsPctChg":-50,"fp":0.022,"fpPctChg":2.32558139534884,"fpListingPrice":0.022,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":22.528,"totalSupply":1024,"listedCount":124,"ownerCount":317,"uniqueOwnerRatio":0.3095703125,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-bitglyphs_pfp_1704698978510.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":2306521.87834713,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/bitglyphs?cohort=ordinal\u0026window=7d\u0026currentFp=0.022\u0026fpPctChg=2.3255813953488413","description":"On-chain generative art on Bitcoin, including gen-art source code, metadata and provenance: https://ordinals.com/content/ea4c738ab079bf40eb318ecf10c51c304b3c8b2a9d5c3a215d5071eb32a82b5ei0?id=1"},{"cohort":"ordinal","name":"Bitcoin Nouns","collectionSymbol":"bitcoin-nouns","collectionId":"bitcoin-nouns","vol":0.02095,"totalVol":0.7182782,"totalTxns":451,"volPctChg":1449.55621302,"txns":3,"txnsPctChg":-78.57142857,"fp":0.00012,"fpPctChg":-1.63934426229507,"fpListingPrice":0.00012,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.12888,"totalSupply":1074,"listedCount":210,"ownerCount":435,"uniqueOwnerRatio":0.405027932960894,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-bitcoin-nouns_pfp_1711505928002.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":13195.3364560271,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/bitcoin-nouns?cohort=ordinal\u0026window=7d\u0026currentFp=0.00012\u0026fpPctChg=-1.6393442622950727","description":"The original Nouns.wtf NFTs inscribed byte-perfect onto Bitcoin under the Creative Commons 1.0 Deed license (no copyright). Only the earliest inscription of each Noun is included in the collection. First is first."},{"cohort":"ordinal","name":"THE MEMENTO MORI","collectionSymbol":"tmm","collectionId":"tmm","vol":0.02022989,"totalVol":0.98180396,"totalTxns":2862,"volPctChg":177.19848506,"txns":88,"txnsPctChg":120,"fp":0.000215,"fpPctChg":26.4705882352941,"fpListingPrice":0.000215,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":1.075,"totalSupply":5000,"listedCount":462,"ownerCount":1682,"uniqueOwnerRatio":0.3364,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-tmm_pfp_1730578695718.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":110063.521805005,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/tmm?cohort=ordinal\u0026window=7d\u0026currentFp=0.000215\u0026fpPctChg=26.470588235294112","description":"As fans of the concept, we are excited to create a unique NFT inspired by the Memento Mori Rune in Bitcoin. A digital piece that captures the essence of legacy and remembrance. 💀"},{"cohort":"ordinal","name":"Soley","collectionSymbol":"soley","collectionId":"soley","vol":0.0202,"totalVol":0.15089,"totalTxns":21,"txns":3,"fp":0.0075,"fpPctChg":7.14285714285714,"fpListingPrice":0.0075,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.5175,"totalSupply":69,"listedCount":10,"ownerCount":47,"uniqueOwnerRatio":0.681159420289855,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-soley_pfp_1695733020796.jpeg","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":52984.0674735724,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/soley?cohort=ordinal\u0026window=7d\u0026currentFp=0.0075\u0026fpPctChg=7.14285714285714","description":"A Yelo frequency on the blockchain."},{"cohort":"ordinal","name":"Ordinal Doge Genesis","collectionSymbol":"ordinaldogegenesis","collectionId":"ordinaldogegenesis","vol":0.02,"totalVol":0.049,"totalTxns":3,"txns":1,"fp":0.02,"fpPctChg":0.502512562814061,"fpListingPrice":0.02,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":2,"totalSupply":100,"listedCount":18,"ownerCount":81,"uniqueOwnerRatio":0.81,"image":"https://bafkreiawf5vcun2bnrougrvbycjg6d5tg3z4m3gvjecj6kfraaqjl6pohe.ipfs.nftstorage.link/","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":1,"currencyUsdRate":102384.671446517,"marketCapUsd":204769.342893033,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/ordinaldogegenesis?cohort=ordinal\u0026window=7d\u0026currentFp=0.02\u0026fpPctChg=0.5025125628140614","description":"The First Doge PFP project inscribed onto the bitcoin blockchain with a genesis collection of 100 Doges under 50k inscriptions! Be sure to check the main collection\\nAnd our sister LTC collection under 25k"},{"cohort":"ordinal","name":"World Peace Cards","collectionSymbol":"world_peace_cards","collectionId":"world_peace_cards","vol":0.0197,"totalVol":0.0197,"totalTxns":5,"txns":5,"fp":0.0034,"fpListingPrice":0.0034,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0,"totalSupply":0,"listedCount":29,"ownerCount":113,"uniqueOwnerRatio":0,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-world_peace_cards_pfp_1733165199449.jpeg","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":0,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/world_peace_cards?cohort=ordinal\u0026window=7d\u0026currentFp=0.0034","description":"Spreading world peace one meme at a time"},{"cohort":"ordinal","name":"Ordinookis","collectionSymbol":"ordinookis","collectionId":"ordinookis","vol":0.01943459,"totalVol":6.25272609,"totalTxns":2404,"volPctChg":48.09224814,"txns":14,"txnsPctChg":55.55555556,"fp":0.0014,"fpPctChg":0.0721949406357503,"fpListingPrice":0.0014,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":4.0698,"totalSupply":2907,"listedCount":443,"ownerCount":1466,"uniqueOwnerRatio":0.504299965600275,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-ordinookis_pfp_1702594039217.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":416685.135853034,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/ordinookis?cohort=ordinal\u0026window=7d\u0026currentFp=0.0014\u0026fpPctChg=0.07219494063575027","description":"Originating from Tanuki, a Japanese Raccoon Dog, Ordinookis appeared in the Mempool!"},{"cohort":"ordinal","name":"FSIC","collectionSymbol":"fsic","collectionId":"fsic","vol":0.019163,"totalVol":23.59508457,"totalTxns":4614,"volPctChg":-41.02794118,"txns":45,"txnsPctChg":-48.27586207,"fp":0.000529,"fpPctChg":33.9240506329114,"fpListingPrice":0.000529,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":2.0102,"totalSupply":3800,"listedCount":452,"ownerCount":1754,"uniqueOwnerRatio":0.461578947368421,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-fsic_pfp_1724229707324.gif","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":205813.666541788,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/fsic?cohort=ordinal\u0026window=7d\u0026currentFp=0.000529\u0026fpPctChg=33.924050632911374","description":"Fractal Specific Integrated Circuit (FSIC) is the 1st pre-miner for the native token of Fractal Bitcoin ($FB)"},{"cohort":"ordinal","name":"BITCOIN BABBIES","collectionSymbol":"btcbabbies","collectionId":"btcbabbies","vol":0.018946,"totalVol":22.23776537,"totalTxns":3421,"volPctChg":255.12652296,"txns":16,"txnsPctChg":166.66666667,"fp":0.00095,"fpPctChg":5.6729699666296,"fpListingPrice":0.00095,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":4.769,"totalSupply":5020,"listedCount":454,"ownerCount":2206,"uniqueOwnerRatio":0.439442231075697,"image":"https://bafkreiht46vv7i6sykfn2c5ejobig7xxkqh4demu7r4btzrttyayfdlgt4.ipfs.nftstorage.link/","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":488272.498128438,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/btcbabbies?cohort=ordinal\u0026window=7d\u0026currentFp=0.00095\u0026fpPctChg=5.672969966629604","description":"Keep it fun, adopt a BabbyBitcoin babbies made history as the first large Ordinal PFP collection that were inscribed on minting. Bitcoin only art."},{"cohort":"ordinal","name":"Satoria Shop","collectionSymbol":"satoria-shop","collectionId":"satoria-shop","vol":0.01754,"totalVol":2.31652856,"totalTxns":1036,"volPctChg":-6.94960212,"txns":2,"txnsPctChg":-50,"fp":0.00024999,"fpListingPrice":0.00024999,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":1.16195352,"totalSupply":4648,"listedCount":473,"ownerCount":1420,"uniqueOwnerRatio":0.305507745266781,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-satoria-shop_pfp_1693537074048.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":118966.229381324,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/satoria-shop?cohort=ordinal\u0026window=7d\u0026currentFp=0.00024999","description":"Shop for SATORIA MMORPG premium items"},{"cohort":"ordinal","name":"Frontline","collectionSymbol":"frontline","collectionId":"frontline","vol":0.0171094,"totalVol":4.14977584,"totalTxns":3941,"volPctChg":-3.98539135,"txns":46,"txnsPctChg":-11.53846154,"fp":0.00045,"fpPctChg":10.8374384236453,"fpListingPrice":0.00045,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":4.5,"totalSupply":10000,"listedCount":724,"ownerCount":3262,"uniqueOwnerRatio":0.3262,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-frontline_pfp_1721548315151.gif","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":460731.021509325,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/frontline?cohort=ordinal\u0026window=7d\u0026currentFp=0.00045\u0026fpPctChg=10.837438423645306","description":"There is no perfect world. There is no good without bad. What matters is where to draw the frontline. Frontline is Alexis André's first work on Bitcoin. André's generative art pieces have gained global recognition, showcased at prestigious events such as Art Basel, Siggraph, and COP26. His works have been featured in auctions at Sotheby's and Christie's. Frontline was created in collaboration with OnChainMonkey (https://magiceden.io/ordinals/marketplace/ocm-genesis ), and linked on-chain to OCM Genesis' Inscription 20219."},{"cohort":"ordinal","name":"NodeRocks","collectionSymbol":"noderocks","collectionId":"noderocks","vol":0.01708392,"totalVol":27.64294977,"totalTxns":16521,"volPctChg":-46.28448103,"txns":22,"txnsPctChg":-24.13793103,"fp":0.0009,"fpPctChg":-9.08999080798797,"fpListingPrice":0.0009,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":8.9937,"totalSupply":9993,"listedCount":789,"ownerCount":2866,"uniqueOwnerRatio":0.286800760532373,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-noderocks_pfp_1712933732613.gif","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":9,"currencyUsdRate":102384.671446517,"marketCapUsd":920817.019588538,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/noderocks?cohort=ordinal\u0026window=7d\u0026currentFp=0.0009\u0026fpPctChg=-9.089990807987968","description":"Digital artifacts on Bitcoin 🟧 | Yin Yang inscriptions blending Finance \\u0026 Meme culture | First and last 10k Yin Yang collection ☯️ 100% community based."},{"cohort":"ordinal","name":"CursedRocks","collectionSymbol":"cursed_rocks","collectionId":"cursed_rocks","vol":0.01708392,"totalVol":1.07793921,"totalTxns":996,"volPctChg":-46.28448103,"txns":22,"txnsPctChg":-24.13793103,"fp":0.00059999,"fpPctChg":-39.3949494949495,"fpListingPrice":0.00059999,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":5.99570007,"totalSupply":9993,"listedCount":183,"ownerCount":2862,"uniqueOwnerRatio":0.286400480336235,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-cursed_rocks_pfp_1728223550203.jpeg","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":613867.781758807,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/cursed_rocks?cohort=ordinal\u0026window=7d\u0026currentFp=0.00059999\u0026fpPctChg=-39.39494949494949","description":"Digital artifacts on Bitcoin 🟧 | Yin Yang inscriptions blending Finance \\u0026 Meme culture | First and last 10k Yin Yang collection ☯️ 100% community based."},{"cohort":"ordinal","name":"Ordinal Bears","collectionSymbol":"ordinal-bears","collectionId":"ordinal-bears","vol":0.01658,"totalVol":1.495276,"totalTxns":232,"txns":6,"fp":0.0018,"fpListingPrice":0.0018,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":1.9998,"totalSupply":1111,"listedCount":125,"ownerCount":667,"uniqueOwnerRatio":0.6003600360036,"image":"https://bafkreiaqcvz5of7umpui74x4c6hv37dyamfhrsm4j4xzke3lgllgyqy6qm.ipfs.nftstorage.link/","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":204748.865958744,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/ordinal-bears?cohort=ordinal\u0026window=7d\u0026currentFp=0.0018","description":"1111 Ordinal Bears roaming on BTC. Ordinal Bears is the continuation of the Omni-Chain Moonbears collection on ETH."},{"cohort":"ordinal","name":"Tiny Vikings","collectionSymbol":"tiny_vikings","collectionId":"tiny_vikings","vol":0.01582196,"totalVol":102.2848986,"totalTxns":14779,"volPctChg":5.60674304,"txns":43,"txnsPctChg":19.44444444,"fp":0.0004,"fpPctChg":0.505037815020493,"fpListingPrice":0.0004,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":8,"totalSupply":20000,"listedCount":893,"ownerCount":10206,"uniqueOwnerRatio":0.5103,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-tiny_vikings_pfp_1710634258276.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":819077.371572134,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/tiny_vikings?cohort=ordinal\u0026window=7d\u0026currentFp=0.0004\u0026fpPctChg=0.5050378150204926","description":"Tiny Vikings are the vikings of Bitcoin. The Tiny Vikings have materialized on Bitcoin to unite with humans in the fight against centralized power and help build out the Bitcoin economy.Join the tiny vikings and support the build out of Bitcoin as the next economic system."},{"cohort":"ordinal","name":"Astral Babes","collectionSymbol":"astral-babes","collectionId":"astral-babes","vol":0.01547,"totalVol":8.1739806,"totalTxns":416,"txns":3,"fp":0.004,"fpPctChg":2.56410256410258,"fpListingPrice":0.004,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":11.648,"totalSupply":2912,"listedCount":237,"ownerCount":1104,"uniqueOwnerRatio":0.379120879120879,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-astral-babes_pfp_1692718443819.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":1192576.65300903,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/astral-babes?cohort=ordinal\u0026window=7d\u0026currentFp=0.004\u0026fpPctChg=2.564102564102577","description":"Divine Goddesses by Deezy, on a mission to raise the spiritual awareness of humanity. Largest total file size original ordinals collection. First ever lightning mint."},{"cohort":"ordinal","name":"Ordzaar Pass","collectionSymbol":"ordzaarpass","collectionId":"ordzaarpass","vol":0.0153439,"totalVol":27.74987764,"totalTxns":1791,"volPctChg":112.22544952,"txns":10,"txnsPctChg":100,"fp":0.0013,"fpPctChg":-20.2453987730061,"fpListingPrice":0.0013,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":2.73,"totalSupply":2100,"listedCount":103,"ownerCount":1654,"uniqueOwnerRatio":0.787619047619048,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-ordzaarpass_pfp_1713526990419.gif","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":279510.153048991,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/ordzaarpass?cohort=ordinal\u0026window=7d\u0026currentFp=0.0013\u0026fpPctChg=-20.24539877300614","description":"YOUR GATEWAY TO A SUPER UTILITY PASS \\u0026 BOOST YOUR AIRDROPS! ALL CURSED. Unlock [REDACTED] \\u0026 more to be revealed soon!Use Recommended Wallet: @XverseApp wallet \\u0026 @Unisat Wallet to buy/store the cursed Ordzaar Pass inscriptions.IMPORTANT WARNING FOR BUYERS: (MUST READ) It is the buyer’s responsibility to use the XverseApp and/or UNISAT wallet for purchasing and storing the cursed Ordzaar Pass inscriptions. Ordzaar explicitly recommends this method to mitigate potential losses. The buyer agrees to indemnify and hold harmless Ordzaar, its affiliates, and its respective officers, agents, and employees from any claims, liabilities, losses, damages, and expenses, including legal fees, arising from or related to the purchase, storage, or use of the cursed Ordzaar Pass inscriptions, regardless of whether the warning was read or comprehended. dAcknowledgment: By proceeding with the transaction, the buyer acknowledges and accepts this indemnity agreement and assumes all associated risks."},{"cohort":"ordinal","name":"Bitcoin Bulls","collectionSymbol":"bitcoinbulls","collectionId":"bitcoinbulls","vol":0.01477,"totalVol":0.087326,"totalTxns":16,"volPctChg":1130.83333333,"txns":3,"txnsPctChg":200,"fp":0.0039,"fpPctChg":-13.3333333333333,"fpListingPrice":0.0039,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":1.56,"totalSupply":400,"listedCount":65,"ownerCount":272,"uniqueOwnerRatio":0.68,"image":"https://bafkreid5xhnfia36h4v7kwinuftqfw5jeikxqcnbinwbnguio4zp4cfl3i.ipfs.nftstorage.link/","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":159720.087456566,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/bitcoinbulls?cohort=ordinal\u0026window=7d\u0026currentFp=0.0039\u0026fpPctChg=-13.33333333333333","description":"400 of the biggest Bitcoin Bulls on the blockchain. With a missions of further decentralizing the network. Holding historical value as the first free airdrop on ordinals."},{"cohort":"ordinal","name":"The Chefs By Ordinal Pizza OG","collectionSymbol":"thechefs","collectionId":"thechefs","vol":0.01475799,"totalVol":0.21599295,"totalTxns":249,"volPctChg":-25.86159952,"txns":20,"txnsPctChg":-23.07692308,"fp":0.00084,"fpPctChg":16.6682870595425,"fpListingPrice":0.00084,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":2.00928,"totalSupply":2392,"listedCount":45,"ownerCount":758,"uniqueOwnerRatio":0.316889632107023,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-thechefs_pfp_1731451692623.jpeg","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":205719.472644057,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/thechefs?cohort=ordinal\u0026window=7d\u0026currentFp=0.00084\u0026fpPctChg=16.668287059542507","description":"This 2nd Collection from Ordinal Pizza OG which will bring time-linked evolving identities designed by @DesenhistaRedn. Each ordinal has a day and night form. The curated set of 1/1s was created in partnership with notable Bitcoin-Native Artists."},{"cohort":"ordinal","name":"EarlyGANs by FAR","collectionSymbol":"earlygans","collectionId":"earlygans","vol":0.0144,"totalVol":1.1838881,"totalTxns":33,"txns":1,"fp":0.014,"fpPctChg":-2.09790209790209,"fpListingPrice":0.014,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":2.66,"totalSupply":190,"listedCount":45,"ownerCount":123,"uniqueOwnerRatio":0.647368421052632,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-earlygans_pfp_1709662849381.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":1,"currencyUsdRate":102384.671446517,"marketCapUsd":272343.226047735,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/earlygans?cohort=ordinal\u0026window=7d\u0026currentFp=0.014\u0026fpPctChg=-2.0979020979020935","description":"EarlyGANs is a unique collection of 1/1 artworks that were created by the artist FAR between 2018 and 2019. Utilizing artificial intelligence, FAR trained a Generative Adversarial Network (GAN) on a curated set of paintings from art history, resulting in this series of generative art. This collection bears resemblance to the base images used in the generative art collections Infinites AI and IRL, which were originally minted by FAR on the Ethereum blockchain in 2021. As of now, these selected artworks from the Infinites collection are fully on-chain on the Bitcoin blockchain."},{"cohort":"ordinal","name":"Grailstone by Pawel Dudko","collectionSymbol":"grailstone","collectionId":"grailstone","vol":0.01429,"totalVol":0.186177,"totalTxns":15,"txns":3,"fp":0.0055,"fpPctChg":-31.25,"fpListingPrice":0.0055,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":2.0075,"totalSupply":365,"listedCount":30,"ownerCount":133,"uniqueOwnerRatio":0.364383561643836,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-grailstone_pfp_1730492454779.gif","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":205537.227928882,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/grailstone?cohort=ordinal\u0026window=7d\u0026currentFp=0.0055\u0026fpPctChg=-31.25","description":"GRAILSTONE: A Living Crystal on Bitcoin. Grailstone is a 3D, interactive form, born from the sacrifice of 3 Raystones.Each piece evolves and transforms guided by Bitcoin: transaction count, timestamp, blockhash, and more. With every 128 blocks, new shapes emerge as it grows over a total of 8192 blocks, which is approximately 8 weeks of human time. Then it will reach its full maturity and reveal its full potential. The evolution of Raystone is here, and Grailstone is coming to life."},{"cohort":"ordinal","name":"Abstraordinals","collectionSymbol":"abstraordinals","collectionId":"abstraordinals","vol":0.01349,"totalVol":2.72329,"totalTxns":54,"txns":1,"fp":0.02,"fpPctChg":48.2579688658265,"fpListingPrice":0.02,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":2,"totalSupply":100,"listedCount":23,"ownerCount":79,"uniqueOwnerRatio":0.79,"image":"https://bafkreichnavbag357pju2nsepld3prskuaiy6ythlggsuntt6ynhcslrqi.ipfs.nftstorage.link/","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":204769.342893033,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/abstraordinals?cohort=ordinal\u0026window=7d\u0026currentFp=0.02\u0026fpPctChg=48.25796886582654","description":"A collection of 100 abstract pixel artworks inscribed on BTC blockchain exclusively on special sats."},{"cohort":"ordinal","name":"Little Pups ","collectionSymbol":"littlepups","collectionId":"littlepups","vol":0.01311921,"totalVol":79.22807865,"totalTxns":15209,"volPctChg":-54.20223305,"txns":15,"txnsPctChg":-44.44444444,"fp":0.00089999,"fpPctChg":-9.81793039870937,"fpListingPrice":0.00089999,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":8.9999,"totalSupply":10000,"listedCount":1428,"ownerCount":4579,"uniqueOwnerRatio":0.4579,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-littlepups_pfp_1710804578652.jpeg","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":921451.804551506,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/littlepups?cohort=ordinal\u0026window=7d\u0026currentFp=0.00089999\u0026fpPctChg=-9.817930398709374","description":"A collection by artist Cake Nygard"},{"cohort":"ordinal","name":"BLIFSTONE","collectionSymbol":"blifstone","collectionId":"blifstone","vol":0.013097,"totalVol":43.467729,"totalTxns":4461,"volPctChg":25.87217684,"txns":15,"txnsPctChg":-16.66666667,"fp":0.001,"fpPctChg":17.7856301531213,"fpListingPrice":0.001,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":5,"totalSupply":5000,"listedCount":253,"ownerCount":3221,"uniqueOwnerRatio":0.6442,"image":"https://bafkreiddveemua3pxyimkjbpe755tprwysvlygesg4j5v7qypkhpkvgtqy.ipfs.nftstorage.link/","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":511923.357232584,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/blifstone?cohort=ordinal\u0026window=7d\u0026currentFp=0.001\u0026fpPctChg=17.78563015312131","description":"As a tribute to the revolutionary Runestone movement, we are thrilled to introduce BLIFSTONE. Every BLIFSTONE is not just a symbol of our collective spirit; it's a gateway to the future of Bitcoin. As the proud owner of a BLIFSTONE, you'll be rewarded with $BLIF tokens."},{"cohort":"ordinal","name":"Bitcoin Digits","collectionSymbol":"bitcoin-digits","collectionId":"bitcoin-digits","vol":0.013,"totalVol":4.5419985,"totalTxns":704,"txns":1,"fp":0.00059,"fpListingPrice":0.00059,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":6.54959,"totalSupply":11101,"listedCount":619,"ownerCount":5972,"uniqueOwnerRatio":0.537969552292586,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-bitcoin-digits_pfp_1699810815965.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":670577.620259392,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/bitcoin-digits?cohort=ordinal\u0026window=7d\u0026currentFp=0.00059","description":"The very first and earliest registered digits in Ordinals."},{"cohort":"ordinal","name":"Infinites AI by FAR","collectionSymbol":"infinites_ai","collectionId":"infinites_ai","vol":0.013,"totalVol":0.282,"totalTxns":8,"txns":1,"fp":0.015,"fpPctChg":-23.0769230769231,"fpListingPrice":0.015,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":7.68,"totalSupply":512,"listedCount":17,"ownerCount":39,"uniqueOwnerRatio":0.076171875,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/infinites_ai_pfp_1704715809547.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":786314.276709248,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/infinites_ai?cohort=ordinal\u0026window=7d\u0026currentFp=0.015\u0026fpPctChg=-23.076923076923084","description":"The Infinites AI, a unique collection of 512 artworks by FAR, was initially minted on Ethereum in 2021, and is now stored on-chain on the Bitcoin blockchain. These pieces were born from the union of two generative processes: a StyleGAN, trained on the Great Masters' artworks, and an on-chain method that augmented selected StyleGAN outputs.Each work resulted from this dual process, with previously generated StyleGAN images being enhanced on-chain by custom software, which was written in three.js. This software created unique artifacts at the point of minting on Ethereum.The Infinites AI's relocation to Bitcoin highlights the dynamic evolution of blockchain art, with each artwork's individuality preserved through recursive inscriptions."},{"cohort":"ordinal","name":"Bitcoin Spacemen","collectionSymbol":"bitcoin_spacemen","collectionId":"bitcoin_spacemen","vol":0.01288,"totalVol":2.29541693,"totalTxns":1345,"txns":8,"fp":0.00099,"fpPctChg":6.4516129032258,"fpListingPrice":0.00099,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":1.02267,"totalSupply":1033,"listedCount":114,"ownerCount":365,"uniqueOwnerRatio":0.353339787028074,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-bitcoin_spacemen_pfp_1719890209673.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":104705.731948209,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/bitcoin_spacemen?cohort=ordinal\u0026window=7d\u0026currentFp=0.00099\u0026fpPctChg=6.451612903225801","description":"1,033 Pixelated Spacemen Exploring the Bitcoin Blockchain. Each Spaceman is derived from Brendan Murphy's iconic Spaceman character and inspired by his \\"},{"cohort":"ordinal","name":"N0 0RDINARY KARDS","collectionSymbol":"kards","collectionId":"kards","vol":0.01254689,"totalVol":2.3591375,"totalTxns":12839,"volPctChg":-63.37187781,"txns":134,"txnsPctChg":-39.36651584,"fp":0.00002,"fpPctChg":-9.09090909090908,"fpListingPrice":0.00002,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.83496,"totalSupply":41748,"listedCount":1701,"ownerCount":21458,"uniqueOwnerRatio":0.513988694069177,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-kards_pfp_1722530780828.jpeg","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":85487.1052709836,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/kards?cohort=ordinal\u0026window=7d\u0026currentFp=0.00002\u0026fpPctChg=-9.090909090909083","description":"Welcome to KARDS, where n0k hold hands to earn NO•ORDINARY•KIND🚪#120 – GET A SEAT AT THE KARD TABLE!"},{"cohort":"ordinal","name":"Apoptosis by OTO","collectionSymbol":"apoptosis","collectionId":"apoptosis","vol":0.0125,"totalVol":1.6148989,"totalTxns":221,"txns":5,"fp":0.0035,"fpPctChg":45.8333333333334,"fpListingPrice":0.0035,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":1.1655,"totalSupply":333,"listedCount":84,"ownerCount":252,"uniqueOwnerRatio":0.756756756756757,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-apoptosis_pfp_1689662264884.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":119329.334570915,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/apoptosis?cohort=ordinal\u0026window=7d\u0026currentFp=0.0035\u0026fpPctChg=45.83333333333335","description":"Irreversible and infinitely living on-chain generative art with recursion and interactivity born from Ordinal MIMI"},{"cohort":"ordinal","name":"Distortion by Nullish","collectionSymbol":"distortion","collectionId":"distortion","vol":0.01228,"totalVol":8.65149656,"totalTxns":325,"volPctChg":-33.58572201,"txns":3,"txnsPctChg":-25,"fp":0.0045,"fpPctChg":-10,"fpListingPrice":0.0045,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":4.9995,"totalSupply":1111,"listedCount":134,"ownerCount":645,"uniqueOwnerRatio":0.580558055805581,"image":"https://bafybeidb6splr3yoebsak6bwlc4tez4max3h4yg2jciytmmxaorh5wfzw4.ipfs.nftstorage.link/","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":511872.16489686,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/distortion?cohort=ordinal\u0026window=7d\u0026currentFp=0.0045\u0026fpPctChg=-10.000000000000009","description":"Distortion is a fully hand-typed 100% on-chain art collection."},{"cohort":"ordinal","name":"Unordinals","collectionSymbol":"unordinals","collectionId":"unordinals","vol":0.0122,"totalVol":14.36458428,"totalTxns":436,"volPctChg":47.07655214,"txns":2,"txnsPctChg":100,"fp":0.0068,"fpPctChg":-5.55555555555556,"fpListingPrice":0.0068,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":6.8,"totalSupply":1000,"listedCount":147,"ownerCount":597,"uniqueOwnerRatio":0.597,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-unordinals_pfp_1721673993477.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":696215.765836314,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/unordinals?cohort=ordinal\u0026window=7d\u0026currentFp=0.0068\u0026fpPctChg=-5.555555555555558","description":"what is dead may never die"},{"cohort":"ordinal","name":"Hashling Artifacts","collectionSymbol":"hashlingartifacts","collectionId":"hashlingartifacts","vol":0.012,"totalVol":1.7133975,"totalTxns":75,"volPctChg":79.37219731,"txns":2,"txnsPctChg":100,"fp":0.01,"fpPctChg":44.9275362318841,"fpListingPrice":0.01,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":6,"totalSupply":600,"listedCount":7,"ownerCount":50,"uniqueOwnerRatio":0.0833333333333333,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-hashlingartifacts_pfp_1711145057328.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":614308.0286791,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/hashlingartifacts?cohort=ordinal\u0026window=7d\u0026currentFp=0.01\u0026fpPctChg=44.927536231884055","description":"Hashling upgrades \\u0026 redemption tokens"},{"cohort":"ordinal","name":"Bitcoin Pizzas","collectionSymbol":"bitcoin-pizzas","collectionId":"bitcoin-pizzas","vol":0.01156,"totalVol":1.455675,"totalTxns":105,"txns":4,"fp":0.0049,"fpListingPrice":0.0049,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":2.5578,"totalSupply":522,"listedCount":104,"ownerCount":367,"uniqueOwnerRatio":0.703065134099617,"image":"https://bafkreid4ozepx7p3565mprdf6ov6qqcqjfosuk3ou5rjzw6h7vhvq64gyq.ipfs.nftstorage.link","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":261879.5126259,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/bitcoin-pizzas?cohort=ordinal\u0026window=7d\u0026currentFp=0.0049","description":"1 SATOSHI = 1 PIZZA"},{"cohort":"ordinal","name":"Ac0UsiN","collectionSymbol":"ac0usin","collectionId":"ac0usin","vol":0.01149876,"totalVol":0.24117493,"totalTxns":758,"volPctChg":9482.3,"txns":83,"txnsPctChg":8200,"fp":0.000156,"fpPctChg":57.5757575757576,"fpListingPrice":0.000156,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.572676,"totalSupply":3671,"listedCount":370,"ownerCount":546,"uniqueOwnerRatio":0.148733315172977,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-ac0usin_pfp_1723973917977.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":1,"currencyUsdRate":102384.671446517,"marketCapUsd":58633.2441053054,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/ac0usin?cohort=ordinal\u0026window=7d\u0026currentFp=0.000156\u0026fpPctChg=57.57575757575759","description":"10010 MSPaint Ac0UsiN by DuKe HöEK ✟"},{"cohort":"ordinal","name":"BEVM Whitepaper","collectionSymbol":"bevm_whitepaper","collectionId":"bevm_whitepaper","vol":0.01125,"totalVol":43.83541578,"totalTxns":9044,"volPctChg":1042.1319797,"txns":22,"txnsPctChg":450,"fp":0.0005,"fpPctChg":2.04081632653061,"fpListingPrice":0.0005,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":5,"totalSupply":10000,"listedCount":841,"ownerCount":3368,"uniqueOwnerRatio":0.3368,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-bevm_whitepaper_pfp_1701521800737.jpeg","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":511923.357232584,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/bevm_whitepaper?cohort=ordinal\u0026window=7d\u0026currentFp=0.0005\u0026fpPctChg=2.0408163265306145","description":"5507 days after the release of the Bitcoin whitepaper, BEVM, an EVM-compatible Bitcoin Layer 2, published its whitepaper on November 29, 2023! To commemorate the publication, only 10,000 BEVM whitepaper collections were launched on the Bitcoin network. Each collection is a significant part of Bitcoin!"},{"cohort":"ordinal","name":"The Rune Guardians - Miners","collectionSymbol":"trgm","collectionId":"trgm","vol":0.01119296,"totalVol":15.16560374,"totalTxns":6021,"volPctChg":-23.33063908,"txns":38,"txnsPctChg":-5,"fp":0.000269,"fpPctChg":9.80040001632718,"fpListingPrice":0.000269,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":2.69,"totalSupply":10000,"listedCount":770,"ownerCount":4368,"uniqueOwnerRatio":0.4368,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-trgm_pfp_1712733885190.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":275414.76619113,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/trgm?cohort=ordinal\u0026window=7d\u0026currentFp=0.000269\u0026fpPctChg=9.800400016327181","description":"The First Ever Multi-Parent Rune Collection. The Multi-Parent Inscription forges a link between the Rune Guardians and the Miners, establishing a lineage that is immutable and timeless. Each inscription tells a tale of convergence—a tale where art is not added but is an intrinsic part of Bitcoin's digital matter"},{"cohort":"ordinal","name":"Glyphs","collectionSymbol":"glyphs","collectionId":"glyphs","vol":0.011,"totalVol":6.0530833,"totalTxns":168,"volPctChg":121.90841235,"txns":1,"fp":0.01202,"fpPctChg":140.4,"fpListingPrice":0.01202,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":6.15424,"totalSupply":512,"listedCount":66,"ownerCount":395,"uniqueOwnerRatio":0.771484375,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-glyphs_pfp_1709488615912.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":1,"currencyUsdRate":102384.671446517,"marketCapUsd":630099.840403011,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/glyphs?cohort=ordinal\u0026window=7d\u0026currentFp=0.01202\u0026fpPctChg=140.39999999999998","description":"Glyphs are the first 512 unique ordinal inscriptions that follow the autoglyph generation algorithm. On February 19th 2023, Deezy Labs released an open source glyph generator website and indexer that allowed anyone to inscribe and track the first valid glyphs. Each glyph is unique, and follows a similar algorithm to what Larva Labs introduced in 2019. Like the Autoglyphs, only a raw text file is on-chain. The off-chain images shown present the text with the Autoglyph Font that was created by Larva Labs."},{"cohort":"ordinal","name":"THORdinals","collectionSymbol":"thordinals","collectionId":"thordinals","vol":0.01084,"totalVol":5.8467735,"totalTxns":407,"txns":2,"fp":0.004,"fpPctChg":-21.5686274509804,"fpListingPrice":0.004,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":4.604,"totalSupply":1151,"listedCount":85,"ownerCount":306,"uniqueOwnerRatio":0.265855777584709,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-thordinals_pfp_1693681984922.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":471379.027339763,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/thordinals?cohort=ordinal\u0026window=7d\u0026currentFp=0.004\u0026fpPctChg=-21.568627450980394","description":"A community of seasoned crypto traders who collaborate seamlessly with a team of adept trading experts. Anchored by a exceptional development team, Cyber Frogs is a community dedicated to pushing the boundaries of trading knowledge and technological innovation. Join us to experience a convergence of expertise, camaraderie, and cutting-edge web3 technology."},{"cohort":"ordinal","name":"Runemilio","collectionSymbol":"runemilio","collectionId":"runemilio","vol":0.0105,"totalVol":61.84169768,"totalTxns":3177,"volPctChg":226.76382444,"txns":3,"txnsPctChg":200,"fp":0.003987,"fpPctChg":-6.84579439252336,"fpListingPrice":0.003987,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":12.746439,"totalSupply":3197,"listedCount":180,"ownerCount":641,"uniqueOwnerRatio":0.200500469189866,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-runemilio_pfp_1713498597733.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":1305039.96912807,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/runemilio?cohort=ordinal\u0026window=7d\u0026currentFp=0.003987\u0026fpPctChg=-6.845794392523363","description":"3222 Runemilios will live on Bitcoin forever"},{"cohort":"ordinal","name":"The Ordinal War","collectionSymbol":"the-ordinal-war","collectionId":"the-ordinal-war","vol":0.010268,"totalVol":2.0064724,"totalTxns":886,"volPctChg":40.40154185,"txns":6,"txnsPctChg":-14.28571429,"fp":0.00102,"fpPctChg":-1.92307692307691,"fpListingPrice":0.00102,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":4.08,"totalSupply":4000,"listedCount":232,"ownerCount":1200,"uniqueOwnerRatio":0.3,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-the-ordinal-war_pfp_1688489659229.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":417729.459501788,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/the-ordinal-war?cohort=ordinal\u0026window=7d\u0026currentFp=0.00102\u0026fpPctChg=-1.9230769230769051","description":"The Ordinal War is a digital multi-edition artifact created by \\"},{"cohort":"ordinal","name":"Misprint Frogs","collectionSymbol":"naked-frogs","collectionId":"naked-frogs","vol":0.0100995,"totalVol":20.88121948,"totalTxns":1472,"txns":7,"fp":0.002289,"fpPctChg":14.5072536268134,"fpListingPrice":0.002289,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":7.679595,"totalSupply":3355,"listedCount":467,"ownerCount":1397,"uniqueOwnerRatio":0.416393442622951,"image":"https://bafkreihksyh7n7gjvnhrqjpdp2phvtqbczgflamiw5dwhhdafycby6idde.ipfs.nftstorage.link/","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":786272.810917313,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/naked-frogs?cohort=ordinal\u0026window=7d\u0026currentFp=0.002289\u0026fpPctChg=14.507253626813398","description":"The misprinted batch of Bitcoin Frogs, for collectors who understand it's historical significance and provenance. This collection is managed by the Misprint community, Frogtoshi and Bitcoin Frogs have no direct involvement with Misprints."},{"cohort":"ordinal","name":"Ordinal Miners","collectionSymbol":"ordinal_miners","collectionId":"ordinal_miners","vol":0.01,"totalVol":1.1859,"totalTxns":17,"txns":1,"fp":0.0125,"fpListingPrice":0.0125,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":1.2125,"totalSupply":97,"listedCount":17,"ownerCount":76,"uniqueOwnerRatio":0.783505154639175,"image":"https://bafkreid6cg5qxubvmdaxf7holkxjgqnxzzbwy26zm6buy5yahmgrfgcvai.ipfs.nftstorage.link/","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":124141.414128902,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/ordinal_miners?cohort=ordinal\u0026window=7d\u0026currentFp=0.0125","description":"We are bitcoin miners, and this collection is dedicated to all different types of miners and types of energy. It's meant to demystify our industry and help people better understand the world of Bitcoin mining through art and community. "},{"cohort":"ordinal","name":"Ordinal Pizza Og","collectionSymbol":"ordinal-pizza-og","collectionId":"ordinal-pizza-og","vol":0.01,"totalVol":0.736095,"totalTxns":56,"txns":1,"fp":0.011,"fpPctChg":-15.3846153846154,"fpListingPrice":0.011,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":3.751,"totalSupply":341,"listedCount":50,"ownerCount":210,"uniqueOwnerRatio":0.6158357771261,"image":"https://bafkreie2n3w2prjszzt66tcf2lquweodflzuvtkuvcewidihz35iiopbya.ipfs.nftstorage.link/","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":384044.902595884,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/ordinal-pizza-og?cohort=ordinal\u0026window=7d\u0026currentFp=0.011\u0026fpPctChg=-15.384615384615385","description":"340 Pizzas forever ingrained on the BTC Blockchain commemorating the first ever sale of BTC for a physical item."},{"cohort":"ordinal","name":"Spyre","collectionSymbol":"spyre","collectionId":"spyre","vol":0.01,"totalVol":4.9728,"totalTxns":27,"txns":1,"fp":0.24,"fpPctChg":20,"fpListingPrice":0.24,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":29.52,"totalSupply":123,"listedCount":11,"ownerCount":115,"uniqueOwnerRatio":0.934959349593496,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-spyre_pfp_1688386055552.jpeg","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":3022395.50110117,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/spyre?cohort=ordinal\u0026window=7d\u0026currentFp=0.24\u0026fpPctChg=19.999999999999996","description":"WTF is Spyre?! Our goal is to ride the line between professionalism and debauchery as closely as possible to stay true to both sides of CT - Inscribed on vintage sats with a few rare and unique ones."},{"cohort":"ordinal","name":"CLASSIFIED (CC)","collectionSymbol":"classifiedcartelcc","collectionId":"classifiedcartelcc","vol":0.009999,"totalVol":5.69243441,"totalTxns":89,"txns":1,"fp":0.0197,"fpPctChg":79.2538671519563,"fpListingPrice":0.0197,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":3.9597,"totalSupply":201,"listedCount":28,"ownerCount":96,"uniqueOwnerRatio":0.477611940298507,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-classifiedcartelcc_pfp_1704607291799.gif","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":405412.583526772,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/classifiedcartelcc?cohort=ordinal\u0026window=7d\u0026currentFp=0.0197\u0026fpPctChg=79.25386715195633","description":"CLASSIFIED (CC) is a 1/1 hand-drawn art collection inscribed on Black Sats by @BlackxBTC Featured twice on Sotheby’s, CLASSIFIED (CC) acquired the oldest Black Rare Sat and showcased the first two 2009 Black Sats inscribed using Ghostmarking—a method that establishes provenance with a Rare Sat without inscribing on it."},{"cohort":"ordinal","name":"Puppet Maxi Biz (PMB)","collectionSymbol":"puppetmaxibiz","collectionId":"puppetmaxibiz","vol":0.009873,"totalVol":210.0051493,"totalTxns":15547,"volPctChg":37.08711065,"txns":27,"txnsPctChg":92.85714286,"fp":0.00038499,"fpPctChg":16.6636363636364,"fpListingPrice":0.00038499,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":3.8499,"totalSupply":10000,"listedCount":1032,"ownerCount":6679,"uniqueOwnerRatio":0.6679,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-puppetmaxibiz_pfp_1709186971692.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":394170.746601945,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/puppetmaxibiz?cohort=ordinal\u0026window=7d\u0026currentFp=0.00038499\u0026fpPctChg=16.66363636363637","description":"PMB will prove its culture over everything by being apart of a beloved community of those who genuinely enjoy sending memes, joking around and interacting with each other to create something different. PMB collides the communities of OMB x Bitcoin Puppets introducing a new light on the Ordinals Space."},{"cohort":"ordinal","name":"BTC Virus","collectionSymbol":"btc-virus","collectionId":"btc-virus","vol":0.00983322,"totalVol":6.85285774,"totalTxns":2628,"volPctChg":-13.43577374,"txns":12,"txnsPctChg":-7.69230769,"fp":0.0008,"fpPctChg":-18.3673469387755,"fpListingPrice":0.0008,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":7.9936,"totalSupply":9992,"listedCount":600,"ownerCount":5489,"uniqueOwnerRatio":0.549339471577262,"image":"https://bafkreigekwcsnvqx744d6z45lvc4p7diiecyruxmxpraox2f2xvyhj72ga.ipfs.nftstorage.link/","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":818422.109674876,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/btc-virus?cohort=ordinal\u0026window=7d\u0026currentFp=0.0008\u0026fpPctChg=-18.36734693877551","description":"'A weird infection has developed inside the BTC MACHINES, giving life to a new creature, a VIRUS. This VIRUS is taking over the MACHINES and kicking their operators out, it is crucial to help us heal our MACHINES' - This collection was the biggest airdrop in the history of Ordinals, 10 000 free airdrops to the entire Ordiverse, literally. They infected the wallets of the top 60 projects."},{"cohort":"ordinal","name":"Metablends","collectionSymbol":"metablends","collectionId":"metablends","vol":0.0097,"totalVol":3.7575695,"totalTxns":277,"txns":4,"fp":0.00289,"fpPctChg":15.6,"fpListingPrice":0.00289,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.867,"totalSupply":300,"listedCount":56,"ownerCount":213,"uniqueOwnerRatio":0.71,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-metablends_pfp_1700883848986.gif","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":1,"currencyUsdRate":102384.671446517,"marketCapUsd":88767.51014413,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/metablends?cohort=ordinal\u0026window=7d\u0026currentFp=0.00289\u0026fpPctChg=15.600000000000014","description":"Metablends is an interactive exploration of Bèzier curves on Bitcoin. To personalize your experience, activate a control panel by double clicking on the canvas. Created by @HeavySided and @RabbiGains"},{"cohort":"ordinal","name":"Prometheans","collectionSymbol":"prometheans","collectionId":"prometheans","vol":0.00954606,"totalVol":567.81242231,"totalTxns":19744,"volPctChg":31.39757358,"txns":34,"txnsPctChg":47.82608696,"fp":0.000255,"fpPctChg":-1.91930458863802,"fpListingPrice":0.000255,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":5.355,"totalSupply":21000,"listedCount":1169,"ownerCount":15899,"uniqueOwnerRatio":0.757095238095238,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-prometheans_pfp_1713294402610.gif","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":548269.915596097,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/prometheans?cohort=ordinal\u0026window=7d\u0026currentFp=0.000255\u0026fpPctChg=-1.9193045886380156","description":"Prometheans is a Pre-Rune collection by CyberKongz that symbolizes ascension through innovation and experimentation."},{"cohort":"ordinal","name":"XO Unchained (BRC-555)","collectionSymbol":"xounchained","collectionId":"xounchained","vol":0.00948691,"totalVol":14.30582221,"totalTxns":7864,"volPctChg":-0.49809112,"txns":31,"txnsPctChg":-6.06060606,"fp":0.00026,"fpPctChg":-13.3304443481449,"fpListingPrice":0.00026,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":2.6,"totalSupply":10000,"listedCount":901,"ownerCount":4390,"uniqueOwnerRatio":0.439,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-xounchained_pfp_1725807445773.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":266200.145760944,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/xounchained?cohort=ordinal\u0026window=7d\u0026currentFp=0.00026\u0026fpPctChg=-13.330444348144944","description":"XO Unchained is the first example of BRC-555, introducing programmable and mutable inscription. As the name suggest, this collection is unchained in terms of what it can transforms into."},{"cohort":"ordinal","name":"Rune Pups (Concluded)","collectionSymbol":"runes_pups","collectionId":"runes_pups","vol":0.00919395,"totalVol":834.12802012,"totalTxns":11963,"volPctChg":-52.81521828,"txns":6,"txnsPctChg":-14.28571429,"fp":0.0012,"fpPctChg":-19.6787148594378,"fpListingPrice":0.0012,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":12.9336,"totalSupply":10778,"listedCount":115,"ownerCount":1018,"uniqueOwnerRatio":0.0944516607904992,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-runes_pups_pfp_1712182897522.jpeg","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":1324202.38662067,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/runes_pups?cohort=ordinal\u0026window=7d\u0026currentFp=0.0012\u0026fpPctChg=-19.67871485943776","description":"Pups the first real memecoin on Bitcoin. Rune Puppets are a pre-rune ordinal which are burned for Pups•World•Peace (Rune 13), now available as a burn / claim on pups.ordkit.xyz"},{"cohort":"ordinal","name":"A.c.0.U.s.T.i.C ","collectionSymbol":"autism_genius","collectionId":"autism_genius","vol":0.0091,"totalVol":0.43111551,"totalTxns":63,"txns":2,"fp":0.005,"fpPctChg":6.60980810234542,"fpListingPrice":0.005,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.505,"totalSupply":101,"listedCount":16,"ownerCount":87,"uniqueOwnerRatio":0.861386138613861,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-autism_genius_pfp_1720291805211.jpeg","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":51704.259080491,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/autism_genius?cohort=ordinal\u0026window=7d\u0026currentFp=0.005\u0026fpPctChg=6.609808102345416","description":"**PUPpEtMAXI DUBStEp MiX**101 TOP SECRET MS Paint Bitcoin Puppet cbl Auc0ustic R3t4rd Puppets mouse drawn by \\"},{"cohort":"ordinal","name":"1st Bitcoin Sent","collectionSymbol":"1stbitcoinsent","collectionId":"1stbitcoinsent","vol":0.009066,"totalVol":0.034855,"totalTxns":21,"volPctChg":-6.24612203,"txns":5,"txnsPctChg":-16.66666667,"fp":0.0018499,"fpPctChg":2.94379521424597,"fpListingPrice":0.0018499,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":2.6009594,"totalSupply":1406,"listedCount":9,"ownerCount":1386,"uniqueOwnerRatio":0.985775248933144,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-1stbitcoinsent_pfp_1726000340028.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":266298.373614729,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/1stbitcoinsent?cohort=ordinal\u0026window=7d\u0026currentFp=0.0018499\u0026fpPctChg=2.94379521424597","description":"The smallest units of Bitcoin are sats, short for satoshis. 1stBitcoinSent are all inscribed on the 1st Bitcoin Sent, sats from the 1st Bitcoin of the 1st peer-to-peer Bitcoin transaction on 12 January 2009 from Satoshi Nakamoto to Hal Finney."},{"cohort":"ordinal","name":"Bitcoin Bear Cubs","collectionSymbol":"bbc","collectionId":"bbc","vol":0.008916,"totalVol":16.1258907,"totalTxns":3936,"volPctChg":53.77716454,"txns":15,"txnsPctChg":36.36363636,"fp":0.0006,"fpPctChg":11.1111111111111,"fpListingPrice":0.0006,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":6,"totalSupply":10000,"listedCount":1497,"ownerCount":3945,"uniqueOwnerRatio":0.3945,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-bbc_pfp_1703748338091.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":1,"currencyUsdRate":102384.671446517,"marketCapUsd":614308.0286791,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/bbc?cohort=ordinal\u0026window=7d\u0026currentFp=0.0006\u0026fpPctChg=11.111111111111093","description":"Meet the 'Bitcoin Bear Cubs' - 10,000 pixelated pals lighting up the blockchain. Low inscriptions Sub1m. Come for the art, Stay for the vibes."},{"cohort":"ordinal","name":"Ordinal Rabbits","collectionSymbol":"ordinal-rabbits","collectionId":"ordinal-rabbits","vol":0.00889,"totalVol":2.27448081,"totalTxns":202,"volPctChg":89.55223881,"txns":2,"txnsPctChg":100,"fp":0.0044,"fpPctChg":10,"fpListingPrice":0.0044,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":2.354,"totalSupply":535,"listedCount":46,"ownerCount":248,"uniqueOwnerRatio":0.463551401869159,"image":"https://bafkreiapfii7ce4q4a7zsaydxq3hlrinaxjtrrp7ltu2ttmbjb6xspa6bi.ipfs.nftstorage.link/","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":241013.5165851,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/ordinal-rabbits?cohort=ordinal\u0026window=7d\u0026currentFp=0.0044\u0026fpPctChg=10.000000000000009","description":"OG community since February 2023"},{"cohort":"ordinal","name":"RuneX: UNNAMED","collectionSymbol":"runex","collectionId":"runex","vol":0.00867984,"totalVol":90.51163014,"totalTxns":6376,"volPctChg":1346.64,"txns":41,"txnsPctChg":1266.66666667,"fp":0.00032,"fpPctChg":60.00800040002,"fpListingPrice":0.00032,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":2.48864,"totalSupply":7777,"listedCount":523,"ownerCount":5332,"uniqueOwnerRatio":0.685611418284686,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-runex_pfp_1713637105535.jpeg","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":254798.588748659,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/runex?cohort=ordinal\u0026window=7d\u0026currentFp=0.00032\u0026fpPctChg=60.00800040002004","description":"The PFP of Runes. ▣"},{"cohort":"ordinal","name":"Bits by DFZ Labs","collectionSymbol":"bits","collectionId":"bits","vol":0.00863,"totalVol":0.4460076,"totalTxns":257,"volPctChg":7.60598504,"txns":10,"txnsPctChg":-41.17647059,"fp":0.001,"fpPctChg":29.8701298701299,"fpListingPrice":0.001,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":10,"totalSupply":10000,"listedCount":84,"ownerCount":437,"uniqueOwnerRatio":0.0437,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-bits_pfp_1707822665015.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":1023846.71446517,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/bits?cohort=ordinal\u0026window=7d\u0026currentFp=0.001\u0026fpPctChg=29.87012987012987","description":"A limitless roguelike game built on BTC.Join us in creating a new kind of web3 gaming.Build Stuff. Break Stuff. Take over. Bit by Bit.Made by DFZ Labs, creators of Deadfellaz."},{"cohort":"ordinal","name":"Planetary Guardians [🪐]","collectionSymbol":"planetary_guardians","collectionId":"planetary_guardians","vol":0.0085,"totalVol":0.0151,"totalTxns":6,"volPctChg":2733.33333333,"txns":3,"txnsPctChg":200,"fp":0.003,"fpListingPrice":0.003,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.999,"totalSupply":333,"listedCount":4,"ownerCount":117,"uniqueOwnerRatio":0.351351351351351,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-planetary_guardians_pfp_1729552176000.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":102282.28677507,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/planetary_guardians?cohort=ordinal\u0026window=7d\u0026currentFp=0.003","description":"333 Guardians on Alpha Uncommon sats with Sub10K provenance and brute-forced Vanity IDs. Guardians are the first-ever collection that allows holders to swap the traits of their inscriptions directly on-chain through a process called 'mutation'. Each holder can create a unique Guardians mutation by simply changing the 'sat padding' of their inscription. This results in a fully holder-driven curation of the collection, where every holder is free to pick their preferred mutations. Planetary Guardians are an extension of The Seeker project - a sci-fi game universe that began in the early days of Ordinals."},{"cohort":"ordinal","name":"Fluid Passes","collectionSymbol":"fluid_passes","collectionId":"fluid_passes","vol":0.00847,"totalVol":0.13307244,"totalTxns":103,"volPctChg":-69.07404703,"txns":8,"txnsPctChg":-27.27272727,"fp":0.001,"fpPctChg":-9.09090909090909,"fpListingPrice":0.001,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.994,"totalSupply":994,"listedCount":45,"ownerCount":410,"uniqueOwnerRatio":0.412474849094567,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-fluid_passes_pfp_1726326574129.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":101770.363417838,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/fluid_passes?cohort=ordinal\u0026window=7d\u0026currentFp=0.001\u0026fpPctChg=-9.090909090909093","description":"Fluid Passes Aidropped to our community after joining the dex launch"},{"cohort":"ordinal","name":"chatFUKR","collectionSymbol":"chatfukr","collectionId":"chatfukr","vol":0.00835,"totalVol":4.12227645,"totalTxns":623,"volPctChg":595.83333333,"txns":7,"txnsPctChg":600,"fp":0.00126,"fpPctChg":5,"fpListingPrice":0.00126,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":1.26,"totalSupply":1000,"listedCount":147,"ownerCount":576,"uniqueOwnerRatio":0.576,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-chatfukr_pfp_1714860403844.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":129004.686022611,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/chatfukr?cohort=ordinal\u0026window=7d\u0026currentFp=0.00126\u0026fpPctChg=5.000000000000004","description":"chatFUKR batch 1 (1000 of 6942 supply) - chatFUKR is a playfully transgressive Ordinals collection at the intersection of PFP degen culture, contemporary fine art, and generative artistry. The collection both mocks and embraces degeneracy, taking an innovative fully generative approach to representing the memes and symbols of the contemporary crypto art movement and PFP collecting culture."},{"cohort":"ordinal","name":"BTC Mutant Virus","collectionSymbol":"btc-mutant-virus","collectionId":"btc-mutant-virus","vol":0.0083,"totalVol":22.51815386,"totalTxns":625,"volPctChg":5.73248408,"txns":4,"fp":0.00308,"fpPctChg":40,"fpListingPrice":0.00308,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":2.39316,"totalSupply":777,"listedCount":72,"ownerCount":600,"uniqueOwnerRatio":0.772200772200772,"image":"https://bafkreibsmk4hoka3prvrkvshgr6iipsmamu2th43w3awxnvfzdqr6y4gcy.ipfs.nftstorage.link/","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":245022.900318946,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/btc-mutant-virus?cohort=ordinal\u0026window=7d\u0026currentFp=0.00308\u0026fpPctChg=39.99999999999999","description":"The Mutant Virus is no ordinary virus—it possesses the potential to unlock incredible abilities within individuals, transcending the boundaries of human capabilities. Through meticulous research and advancements in genetic engineering, SATORIA CORP has harnessed this virus to create a remarkable transformation within select participants."},{"cohort":"ordinal","name":"The Odyssey","collectionSymbol":"the_odyssey","collectionId":"the_odyssey","vol":0.008,"totalVol":2.69875895,"totalTxns":477,"volPctChg":-73.1092437,"txns":3,"txnsPctChg":-66.66666667,"fp":0.00269,"fpPctChg":-15.9375,"fpListingPrice":0.00269,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":2.68731,"totalSupply":999,"listedCount":107,"ownerCount":525,"uniqueOwnerRatio":0.525525525525526,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-the_odyssey_pfp_1709817371265.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":1,"currencyUsdRate":102384.671446517,"marketCapUsd":275139.351424939,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/the_odyssey?cohort=ordinal\u0026window=7d\u0026currentFp=0.00269\u0026fpPctChg=-15.937500000000004","description":"Introducing The Odyssey by the Yokai Avengers, the first fully on-chain graphic novel (Manga) in history. This innovative and exclusive collection is limited to a total supply of 999, with each book featuring a front and back cover and 38 pages of carefully crafted, high-quality art based on Odin’s Odyssey. The manga comes with five different covers and rarities inscribed on rare sats! This is not just a collection; it’s mixing high-quality art with tech innovation, adding to the Ordinals."},{"cohort":"ordinal","name":"Bitcoin Cats","collectionSymbol":"bitcoincats","collectionId":"bitcoincats","vol":0.00777,"totalVol":24.63127577,"totalTxns":2702,"volPctChg":-5.01222494,"txns":6,"txnsPctChg":-14.28571429,"fp":0.0014,"fpPctChg":19.6581196581197,"fpListingPrice":0.0014,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":14,"totalSupply":10000,"listedCount":283,"ownerCount":1577,"uniqueOwnerRatio":0.1577,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-bitcoincats_pfp_1705407442702.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":1433385.40025123,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/bitcoincats?cohort=ordinal\u0026window=7d\u0026currentFp=0.0014\u0026fpPctChg=19.658119658119656","description":"Bitcoin Cats NFT is a collection of 10,000 unique pixelated cat artworks on Bitcoin Ordinals."},{"cohort":"ordinal","name":"Ordinal Printers","collectionSymbol":"ordinalprinters","collectionId":"ordinalprinters","vol":0.00776,"totalVol":0.40103449,"totalTxns":1030,"volPctChg":422.55892256,"txns":29,"txnsPctChg":383.33333333,"fp":0.00027,"fpPctChg":12.5,"fpListingPrice":0.00027,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.94554,"totalSupply":3502,"listedCount":233,"ownerCount":923,"uniqueOwnerRatio":0.263563677898344,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-ordinalprinters_pfp_1719933620639.jpeg","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":96808.8022395394,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/ordinalprinters?cohort=ordinal\u0026window=7d\u0026currentFp=0.00027\u0026fpPctChg=12.5","description":"Ordinal Printers are a 3.5k pixel art pfp fully inscribed on pizza sats and based on the meme \\"},{"cohort":"ordinal","name":"Entangled Realms by OTO","collectionSymbol":"entangled-realms","collectionId":"entangled-realms","vol":0.0077,"totalVol":0.0185,"totalTxns":6,"txns":4,"fp":0.0027,"fpPctChg":170,"fpListingPrice":0.0027,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.2943,"totalSupply":109,"listedCount":16,"ownerCount":94,"uniqueOwnerRatio":0.862385321100918,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-entangled-realms_pfp_1724892409099.gif","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":30131.8088067099,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/entangled-realms?cohort=ordinal\u0026window=7d\u0026currentFp=0.0027\u0026fpPctChg=170.00000000000003","description":"This collection is a collaboration with an OG Ordinals artist Bitcoin Sneaker, and it's a free mint art for holders of the physical product, the Bitcoin Sneaker. The color changes within the palette according to the block height. It will be minted over an extended period. The collection will be regularly updated and is expected to have a maximum supply of 500 pieces."},{"cohort":"ordinal","name":"Artifakt by Medusa X Vivid Gallery","collectionSymbol":"artifakt-by-medusa","collectionId":"artifakt-by-medusa","vol":0.0077,"totalVol":0.90612,"totalTxns":37,"txns":1,"fp":0.0105,"fpListingPrice":0.0105,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":3.15,"totalSupply":300,"listedCount":40,"ownerCount":134,"uniqueOwnerRatio":0.446666666666667,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-artifakt-by-medusa_pfp_1730122683682.jpeg","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":322511.715056528,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/artifakt-by-medusa?cohort=ordinal\u0026window=7d\u0026currentFp=0.0105","description":"Artifakt blends the enduring qualities of avant-garde and constructivism with the emerging nature of digital art, creating a new relic for the digital age. 300 generative artworks inscribed on uncommon satoshis. Art by Medusa curated by Vivid Gallery."},{"cohort":"ordinal","name":"PepeNals","collectionSymbol":"pepenals","collectionId":"pepenals","vol":0.00764957,"totalVol":51.5794978,"totalTxns":9200,"volPctChg":56.13151707,"txns":19,"txnsPctChg":171.42857143,"fp":0.00057,"fpPctChg":42.5035625890647,"fpListingPrice":0.00057,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":3.91761,"totalSupply":6873,"listedCount":1435,"ownerCount":1867,"uniqueOwnerRatio":0.271642659682817,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-pepenals_pfp_1708678415522.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":1,"currencyUsdRate":102384.671446517,"marketCapUsd":401103.212705588,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/pepenals?cohort=ordinal\u0026window=7d\u0026currentFp=0.00057\u0026fpPctChg=42.503562589064714","description":"Say #bonjour to 6900 PepeNals looking for a home on BTC 🟧 No roadmap. No BS. Just 26x26 pixels of iconic perfection."},{"cohort":"ordinal","name":"Human by Yue Minjun","collectionSymbol":"human-yue-minjun","collectionId":"human-yue-minjun","vol":0.007619,"totalVol":1.21961918,"totalTxns":146,"volPctChg":311.83783784,"txns":4,"txnsPctChg":300,"fp":0.001858,"fpPctChg":3.91498881431767,"fpListingPrice":0.001858,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":2.179434,"totalSupply":1173,"listedCount":142,"ownerCount":414,"uniqueOwnerRatio":0.352941176470588,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-human-yue-minjun_pfp_1715004286185.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":223140.634029368,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/human-yue-minjun?cohort=ordinal\u0026window=7d\u0026currentFp=0.001858\u0026fpPctChg=3.914988814317666","description":"Human is an Ordinals collection of 1,200 1/1 digital artworks where Yue Minjun takes us from Big Bang to Bitcoin as he captures key moments shaping our digital lives today"},{"cohort":"ordinal","name":"Block Gods","collectionSymbol":"blockgods","collectionId":"blockgods","vol":0.0075,"totalVol":4.1998226,"totalTxns":174,"volPctChg":66.66666667,"txns":2,"txnsPctChg":100,"fp":0.00449,"fpPctChg":28.2857142857143,"fpListingPrice":0.00449,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":1.5715,"totalSupply":350,"listedCount":79,"ownerCount":255,"uniqueOwnerRatio":0.728571428571429,"image":"https://bafybeiby3v3f235tp6cidbvh7bvrywefpy33bwjkwmxqjx6xbq42hbisa4.ipfs.nftstorage.link/","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":1,"currencyUsdRate":102384.671446517,"marketCapUsd":160897.511178201,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/blockgods?cohort=ordinal\u0026window=7d\u0026currentFp=0.00449\u0026fpPctChg=28.285714285714292","description":"350 Perfectly curated Block Gods inscribed on Bitcoin Sats Block #666."},{"cohort":"ordinal","name":"HolyMath by ORKHAN","collectionSymbol":"holymath","collectionId":"holymath","vol":0.0075,"totalVol":0.54743466,"totalTxns":326,"txns":8,"fp":0.00099,"fpPctChg":4.21052631578947,"fpListingPrice":0.00099,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.99,"totalSupply":1000,"listedCount":121,"ownerCount":418,"uniqueOwnerRatio":0.418,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-holymath_pfp_1722532535819.gif","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":101360.824732052,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/holymath?cohort=ordinal\u0026window=7d\u0026currentFp=0.00099\u0026fpPctChg=4.210526315789465","description":"The \\"},{"cohort":"ordinal","name":"Bitcoin Monkes","collectionSymbol":"bitcoin-monkes","collectionId":"bitcoin-monkes","vol":0.0074598,"totalVol":1.8518873,"totalTxns":705,"volPctChg":747.70454545,"txns":11,"txnsPctChg":1000,"fp":0.00065,"fpPctChg":-7.14285714285715,"fpListingPrice":0.00065,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":2.2126,"totalSupply":3404,"listedCount":266,"ownerCount":1920,"uniqueOwnerRatio":0.564042303172738,"image":"https://bafkreigdjbfqcbhxrh6opmytrz6sbbbpkvo6jy4sqjaoppvtuc4i6ximli.ipfs.nftstorage.link/","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":226536.324042563,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/bitcoin-monkes?cohort=ordinal\u0026window=7d\u0026currentFp=0.00065\u0026fpPctChg=-7.142857142857151","description":"Bitcoin Monkes is a collection of Monke Inscriptions — unique digital collectibles living on the Bitcoin blockchain. Get one to join the club."},{"cohort":"ordinal","name":"Ordz Heroes","collectionSymbol":"ordz-heroes","collectionId":"ordz-heroes","vol":0.0073956,"totalVol":6.54778778,"totalTxns":893,"volPctChg":148.17449664,"txns":5,"txnsPctChg":150,"fp":0.00255,"fpPctChg":63.4615384615385,"fpListingPrice":0.00255,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":8.4762,"totalSupply":3324,"listedCount":355,"ownerCount":1429,"uniqueOwnerRatio":0.429903730445247,"image":"https://bafybeidis4myglqwn7eud6sqehyal2w3ak5txu7fnmc4i4to3wxjkdrbay.ipfs.nftstorage.link/","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":867832.952114965,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/ordz-heroes?cohort=ordinal\u0026window=7d\u0026currentFp=0.00255\u0026fpPctChg=63.46153846153848","description":"The first playable PFP on bitcoin, join the new game season of Ordz Games and become legendary heroes!"},{"cohort":"ordinal","name":"Blocks by Matrica","collectionSymbol":"blocks_by_matrica","collectionId":"blocks_by_matrica","vol":0.00735,"totalVol":9.68102967,"totalTxns":229,"volPctChg":83.75,"txns":1,"fp":0.0097,"fpPctChg":31.9727891156463,"fpListingPrice":0.0097,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":2.4832,"totalSupply":256,"listedCount":33,"ownerCount":199,"uniqueOwnerRatio":0.77734375,"image":"https://bafybeidfjjf57azrs4oqlv6kcre26wxqqkxnm6mmdf5liajveoaawowcg4.ipfs.nftstorage.link/","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":2,"currencyUsdRate":102384.671446517,"marketCapUsd":254241.61613599,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/blocks_by_matrica?cohort=ordinal\u0026window=7d\u0026currentFp=0.0097\u0026fpPctChg=31.972789115646272","description":"Blocks by Matrica is set to be a high-quality art project inscribed on Bitcoin. The collection is a highly exclusive 256-pieces of art. Each artwork is inscribed on Block9 450 sats."},{"cohort":"ordinal","name":"MNCHRMS","collectionSymbol":"mnchrms","collectionId":"mnchrms","vol":0.00727,"totalVol":54.33634067,"totalTxns":9539,"txns":11,"fp":0.000793,"fpPctChg":32.1666666666667,"fpListingPrice":0.000793,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":8.010093,"totalSupply":10101,"listedCount":1004,"ownerCount":3252,"uniqueOwnerRatio":0.321948321948322,"image":"https://bafybeibswimsw5wvfqyd3q54mzke3z6b5zda7hdkwqx66zoayrfjo2msye.ipfs.nftstorage.link/","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":820110.740061044,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/mnchrms?cohort=ordinal\u0026window=7d\u0026currentFp=0.000793\u0026fpPctChg=32.16666666666668","description":"MNCHRMS, pronounced \\"},{"cohort":"ordinal","name":"CC0","collectionSymbol":"cc0","collectionId":"cc0","vol":0.007169,"totalVol":93.42097606,"totalTxns":18346,"volPctChg":60.67146283,"txns":10,"txnsPctChg":42.85714286,"fp":0.00069,"fpPctChg":-18.8139781150724,"fpListingPrice":0.00069,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":6.90069,"totalSupply":10001,"listedCount":1281,"ownerCount":4914,"uniqueOwnerRatio":0.491350864913509,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-cc0_pfp_1706887845494.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":706524.878404264,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/cc0?cohort=ordinal\u0026window=7d\u0026currentFp=0.00069\u0026fpPctChg=-18.81397811507236","description":"C█████ C██████ 0 is a VPL licensed collection of 10001 cat hand puppet images inspired by the Karmic Grid and materialized with the help of the OPIUM Puppet LoRA model. Nothing more, nothing less."},{"cohort":"ordinal","name":"Ordinal Doggies","collectionSymbol":"ordinaldoggies","collectionId":"ordinaldoggies","vol":0.0069,"totalVol":0.03035,"totalTxns":5,"txns":1,"fp":0.00369,"fpListingPrice":0.00369,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.369,"totalSupply":100,"listedCount":14,"ownerCount":79,"uniqueOwnerRatio":0.79,"image":"https://bafkreiapovckilz5lwsdhkhrrrmrhmpm6b6lxbw75vzqnuyjvl6iprt3f4.ipfs.nftstorage.link","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":37779.9437637647,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/ordinaldoggies?cohort=ordinal\u0026window=7d\u0026currentFp=0.00369","description":"100 Ordinal Doggies inscribed on the Bitcoin chain. Companions of Punks.\\n\\nInscription starts at 530493."},{"cohort":"ordinal","name":"Mintify Bitcoin Keys","collectionSymbol":"mintifybitcoinkeys","collectionId":"mintifybitcoinkeys","vol":0.0068147,"totalVol":0.29528019,"totalTxns":937,"volPctChg":15.7997587,"txns":45,"fp":0.00008,"fpPctChg":-11.1111111111111,"fpListingPrice":0.00008,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":1.14496,"totalSupply":14312,"listedCount":466,"ownerCount":5378,"uniqueOwnerRatio":0.375768585802124,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-mintifybitcoinkeys_pfp_1729598633903.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":2,"currencyUsdRate":102384.671446517,"marketCapUsd":117226.353419404,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/mintifybitcoinkeys?cohort=ordinal\u0026window=7d\u0026currentFp=0.00008\u0026fpPctChg=-11.111111111111105","description":"Mintify's Bitcoin Keys are programmable, upgradable inscriptions built on Bitcoin. Upgrade, Unlock, and Trade to Earn XP on Mintify."},{"cohort":"ordinal","name":"Bangers","collectionSymbol":"bangers","collectionId":"bangers","vol":0.006646,"totalVol":22.53666607,"totalTxns":600,"volPctChg":-53.36140351,"txns":3,"txnsPctChg":-40,"fp":0.00184567,"fpPctChg":2.53722222222224,"fpListingPrice":0.00184567,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":1.22921622,"totalSupply":666,"listedCount":118,"ownerCount":379,"uniqueOwnerRatio":0.569069069069069,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-bangers_pfp_1709221148391.jpeg","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":125852.898821429,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/bangers?cohort=ordinal\u0026window=7d\u0026currentFp=0.00184567\u0026fpPctChg=2.537222222222235","description":"Bangers is a 1/1 hand-drawn collection created by DigitalDamage inspired in punk-rock culture inscribed in Block9. AFM!"},{"cohort":"ordinal","name":"ZBIT Loot Box","collectionSymbol":"zbit-loot-box","collectionId":"zbit-loot-box","vol":0.006635,"totalVol":4.87129561,"totalTxns":5781,"volPctChg":-12.35138705,"txns":33,"txnsPctChg":-2.94117647,"fp":0.000158,"fpPctChg":5.33333333333335,"fpListingPrice":0.000158,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":1.083722,"totalSupply":6859,"listedCount":701,"ownerCount":2699,"uniqueOwnerRatio":0.393497594401516,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-zbit-loot-box_pfp_1719907806450.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":110956.520909362,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/zbit-loot-box?cohort=ordinal\u0026window=7d\u0026currentFp=0.000158\u0026fpPctChg=5.3333333333333455","description":"Introducing ZBIT Loot in SATORIA!Open a Loot and get $DOG, $ZBIT, Machines, Ordinals, in-game Items, physical merch \\u0026 more"},{"cohort":"ordinal","name":"NUMB3R xA: Collection Ø","collectionSymbol":"numb3rxa","collectionId":"numb3rxa","vol":0.006491,"totalVol":0.0402538,"totalTxns":30,"volPctChg":-80.77469878,"txns":4,"txnsPctChg":-84.61538462,"fp":0.00185,"fpPctChg":-15.9090909090909,"fpListingPrice":0.00185,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":1.6428,"totalSupply":888,"listedCount":24,"ownerCount":207,"uniqueOwnerRatio":0.233108108108108,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-numb3rxa_pfp_1732203099895.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":1,"currencyUsdRate":102384.671446517,"marketCapUsd":168197.538252338,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/numb3rxa?cohort=ordinal\u0026window=7d\u0026currentFp=0.00185\u0026fpPctChg=-15.909090909090907","description":"NUMB3R xA is an Ordinals Art Collective built by Inscribing Atlantis and Nolcha Shows. Its inaugural launch, Collection: Ø, is created by renowned Italian physicist and generative artist Andrea Belloni. This groundbreaking collection showcases unique dynamic characteristics along with cutting-edge technical features created and inscribed by Inscribing Atlantis CTO and lead maintainer of the Ordinals Protocol Raph.Each Key grants holders access to exclusive opportunities—unlocking future drops, elite curated networking events and immersive community experiences. Collection: Ø establishes a new standard for the cultural currency of digital ecosystems and modern creative communities."},{"cohort":"ordinal","name":"Bitdogs","collectionSymbol":"bitdogs_btc","collectionId":"bitdogs_btc","vol":0.006408,"totalVol":17.72552888,"totalTxns":5180,"volPctChg":-24.38929131,"txns":16,"fp":0.0003,"fpListingPrice":0.0003,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":3,"totalSupply":10000,"listedCount":475,"ownerCount":2728,"uniqueOwnerRatio":0.2728,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-bitdogs_btc_pfp_1713462791648.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":307154.01433955,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/bitdogs_btc?cohort=ordinal\u0026window=7d\u0026currentFp=0.0003","description":"Bitdogs are a 10k Ordinals PFP collection digging for the BONES•OF•BITDOG on runes."},{"cohort":"ordinal","name":"DMT-UNATPEPE","collectionSymbol":"dmt-unatpepe","collectionId":"dmt-unatpepe","vol":0.006309,"totalVol":7.51058982,"totalTxns":1702,"volPctChg":-12.97931034,"txns":4,"fp":0.00149899,"fpPctChg":-0.0666671111140826,"fpListingPrice":0.00149899,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":3.02196384,"totalSupply":2016,"listedCount":196,"ownerCount":412,"uniqueOwnerRatio":0.204365079365079,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-dmt-unatpepe_pfp_1709246924274.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":1,"currencyUsdRate":102384.671446517,"marketCapUsd":309402.774881654,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/dmt-unatpepe?cohort=ordinal\u0026window=7d\u0026currentFp=0.00149899\u0026fpPctChg=-0.06666711111408263","description":"Connoisseurs of Pepe culture pioneering new frontiers in the digital matter theory (DMT) world."},{"cohort":"ordinal","name":"ABC","collectionSymbol":"abc-abracadabra","collectionId":"abc-abracadabra","vol":0.00603,"totalVol":22.14055875,"totalTxns":3734,"volPctChg":74.27745665,"txns":9,"txnsPctChg":125,"fp":0.00105,"fpPctChg":81.0344827586207,"fpListingPrice":0.00105,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":8.4399,"totalSupply":8038,"listedCount":549,"ownerCount":2139,"uniqueOwnerRatio":0.266110972878826,"image":"https://bafybeie4f7n526mxpp2jgixpc4e7b7vpkae4sglks37lzj7tiwghxyvel4.ipfs.nftstorage.link/","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":864116.388541457,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/abc-abracadabra?cohort=ordinal\u0026window=7d\u0026currentFp=0.00105\u0026fpPctChg=81.03448275862068","description":"Welcome to ABC, where imagination powers the world. This first-of-its-kind art collection, created out of pure joy and now forever inscribbled on Bitcoin, will warp you into a community of dreamers and innovators living across chains. ABC will bring back the limitless imagination of your youth, where the CC0 art belongs to you, the community belongs to you, and the possibilities are endless. Dive in and join the fun!"},{"cohort":"ordinal","name":"Monoliths by OTO","collectionSymbol":"monoliths","collectionId":"monoliths","vol":0.006,"totalVol":4.0517939,"totalTxns":255,"txns":1,"fp":0.007,"fpListingPrice":0.007,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":2.331,"totalSupply":333,"listedCount":60,"ownerCount":237,"uniqueOwnerRatio":0.711711711711712,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-monoliths_pfp_1707816454861.gif","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":1,"currencyUsdRate":102384.671446517,"marketCapUsd":238658.669141831,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/monoliths?cohort=ordinal\u0026window=7d\u0026currentFp=0.007","description":"Evolving, changing, and eventually fading over approximately 120 years, this work symbolizes the permanence and transition within the digital world. / Block 9 450x / Parent:Child / Matching Sat numbers / Recursive Endpoints / Inscription ID as the seed / Interactive generative art / Evolves with block generation"},{"cohort":"ordinal","name":"Memory Blocks","collectionSymbol":"memoryblocks","collectionId":"memoryblocks","vol":0.0055,"totalVol":3.38583,"totalTxns":125,"txns":1,"fp":0.0122,"fpPctChg":10.9090909090909,"fpListingPrice":0.0122,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":1.5616,"totalSupply":128,"listedCount":35,"ownerCount":93,"uniqueOwnerRatio":0.7265625,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-memoryblocks_pfp_1706145697442.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":1,"currencyUsdRate":102384.671446517,"marketCapUsd":159883.902930881,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/memoryblocks?cohort=ordinal\u0026window=7d\u0026currentFp=0.0122\u0026fpPctChg=10.909090909090914","description":"Memory Blocks is an experimental onchain art collection that explores the remnants of our digital past, when early operating systems were a frontier of discovery and wonder."},{"cohort":"ordinal","name":"Cursed Bitcoin Punks","collectionSymbol":"cursedbitcoinpunks","collectionId":"cursedbitcoinpunks","vol":0.0054,"totalVol":3.44071968,"totalTxns":600,"txns":3,"fp":0.001866,"fpPctChg":3.66666666666666,"fpListingPrice":0.001866,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":10.716438,"totalSupply":5743,"listedCount":232,"ownerCount":2151,"uniqueOwnerRatio":0.374542921817865,"image":"https://i.imgur.com/mCcy8vP.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":1097198.98370697,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/cursedbitcoinpunks?cohort=ordinal\u0026window=7d\u0026currentFp=0.001866\u0026fpPctChg=3.6666666666666625","description":"The first 10k Cursed Ordinals Collection on Bitcoin"},{"cohort":"ordinal","name":"The OctoGlyphs","collectionSymbol":"octoglyphs","collectionId":"octoglyphs","vol":0.00537799,"totalVol":3.17168193,"totalTxns":3649,"volPctChg":-12.16697126,"txns":30,"txnsPctChg":-14.28571429,"fp":0.0002,"fpPctChg":0.00500025001251014,"fpListingPrice":0.0002,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":2,"totalSupply":10000,"listedCount":507,"ownerCount":3290,"uniqueOwnerRatio":0.329,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-octoglyphs_pfp_1722575200936.jpeg","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":204769.342893033,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/octoglyphs?cohort=ordinal\u0026window=7d\u0026currentFp=0.0002\u0026fpPctChg=0.0050002500125101434","description":"1st Parent-Child Runescribed 10K collection on Bitcoin, all on Block 9 - 450x sats - each etched with their own Unique Rune supply available for holders to claim as the mystery of the 8s unfolds."},{"cohort":"ordinal","name":"GhostXXX","collectionSymbol":"ghostxxx","collectionId":"ghostxxx","vol":0.00533,"totalVol":5.46320532,"totalTxns":1023,"volPctChg":6562.5,"txns":67,"txnsPctChg":6600,"fp":0.00007,"fpPctChg":7.69230769230769,"fpListingPrice":0.00007,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.7,"totalSupply":10000,"listedCount":597,"ownerCount":5195,"uniqueOwnerRatio":0.5195,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-ghostxxx_pfp_1722934275447.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":1,"currencyUsdRate":102384.671446517,"marketCapUsd":71669.2700125617,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/ghostxxx?cohort=ordinal\u0026window=7d\u0026currentFp=0.00007\u0026fpPctChg=7.692307692307687","description":"During the bear market, the Monkes accidentally froze to death and turned into Ghosts. All addresses holding Monkes will receive Ghosts before their Monkes die."},{"cohort":"ordinal","name":"OG Satoshis","collectionSymbol":"og-satoshis","collectionId":"og-satoshis","vol":0.005088,"totalVol":17.3777669,"totalTxns":1669,"volPctChg":-25.71178274,"txns":5,"txnsPctChg":25,"fp":0.0008999,"fpPctChg":-9.82965931863727,"fpListingPrice":0.0008999,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":1.916787,"totalSupply":2130,"listedCount":271,"ownerCount":891,"uniqueOwnerRatio":0.41830985915493,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-og-satoshis_pfp_1689210947948.jpeg","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":196249.607227954,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/og-satoshis?cohort=ordinal\u0026window=7d\u0026currentFp=0.0008999\u0026fpPctChg=-9.829659318637274","description":"OG Satoshis (Original Gangster Satoshi Nakamoto Miners) are inscribed on rare satoshis mined personally by Satoshi Nakamoto."},{"cohort":"ordinal","name":"Pixel Panda Wars","collectionSymbol":"pixel-panda-wars","collectionId":"pixel-panda-wars","vol":0.005,"totalVol":8.466888,"totalTxns":129,"txns":1,"fp":0.01,"fpListingPrice":0.01,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":2.5,"totalSupply":250,"listedCount":44,"ownerCount":124,"uniqueOwnerRatio":0.496,"image":"https://bafkreieal4x7hxf6pifj3qbgxil6wq7wqn7ds3lavbh2iu4n245bo5eeri.ipfs.nftstorage.link/","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":255961.678616292,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/pixel-panda-wars?cohort=ordinal\u0026window=7d\u0026currentFp=0.01","description":"Pixel Panda Wars are the VERY FIRST inscriptions in Bitcoin's ENTIRE network history to be inscribed onto a Satoshi under block 100! They're all inscribed onto Sats from block 78 and come from the same genesis transaction address starting with 'bc1panda'. Cryptographers are sure to appreciate all the detail that went into making these historic inscriptions on the Bitcoin network. Be a part of the sub-100 block club by owning the FIRST inscriptions under block 100: the Pixel Pandas!"},{"cohort":"ordinal","name":"Oracles","collectionSymbol":"oracles","collectionId":"oracles","vol":0.005,"totalVol":8.549525,"totalTxns":147,"volPctChg":-52.83018868,"txns":1,"txnsPctChg":-50,"fp":0.006699,"fpPctChg":-2.91304347826087,"fpListingPrice":0.006699,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":2.230767,"totalSupply":333,"listedCount":78,"ownerCount":226,"uniqueOwnerRatio":0.678678678678679,"image":"https://bafkreianaykl56rgyfubwvw3mxztaa6eaumz2g4cr5r3zbkylue3cx5upe.ipfs.nftstorage.link/","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":228396.346368732,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/oracles?cohort=ordinal\u0026window=7d\u0026currentFp=0.006699\u0026fpPctChg=-2.9130434782608683","description":"333 Piece 1/1 Boutique Art Collection Inscribed on Bitcoin Block 9"},{"cohort":"ordinal","name":"REVOLOOTS","collectionSymbol":"revoloots","collectionId":"revoloots","vol":0.00499,"totalVol":0.09966,"totalTxns":16,"volPctChg":-67.34293194,"txns":1,"txnsPctChg":-75,"fp":0.0174,"fpPctChg":248.697394789579,"fpListingPrice":0.0174,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":8.7,"totalSupply":500,"listedCount":302,"ownerCount":33,"uniqueOwnerRatio":0.066,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-revoloots_pfp_1705601468793.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":890746.641584696,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/revoloots?cohort=ordinal\u0026window=7d\u0026currentFp=0.0174\u0026fpPctChg=248.69739478957916","description":"REVOLOOTS is comprised of 500 synthetic works by world-renowned conceptual artist Kevin Abosch. The revolution will be inscribed!"},{"cohort":"ordinal","name":"Looming Emotion by Shaderism X Vivid Gallery","collectionSymbol":"looming-emotion-by-shaderism","collectionId":"looming-emotion-by-shaderism","vol":0.00497,"totalVol":0.136761,"totalTxns":13,"volPctChg":24.25,"txns":1,"fp":0.0054,"fpPctChg":8.6519114688129,"fpListingPrice":0.0054,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":2.16,"totalSupply":400,"listedCount":30,"ownerCount":139,"uniqueOwnerRatio":0.3475,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-looming-emotion-by-shaderism_pfp_1717153061884.gif","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":221150.890324476,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/looming-emotion-by-shaderism?cohort=ordinal\u0026window=7d\u0026currentFp=0.0054\u0026fpPctChg=8.651911468812902","description":"Looming Emotion is an algorithmic art collection that depicts the conscious and unconscious habitual routines distracting individuals from the unresolved emotions lurking behind them, which contribute to many of life's challenges. Art by Shaderism curated by VIVID Gallery."},{"cohort":"ordinal","name":"Karmz Ordinals","collectionSymbol":"karmz","collectionId":"karmz","vol":0.0049,"totalVol":0.06218,"totalTxns":11,"txns":2,"fp":0.00555,"fpPctChg":11,"fpListingPrice":0.00555,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.61605,"totalSupply":111,"listedCount":10,"ownerCount":78,"uniqueOwnerRatio":0.702702702702703,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-karmz_pfp_1728496892566.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":63074.0768446266,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/karmz?cohort=ordinal\u0026window=7d\u0026currentFp=0.00555\u0026fpPctChg=11.00000000000001","description":"The most cold-blooded art inscribed sub 500k. Artist Karmelo's genesis Ordinals collection."},{"cohort":"ordinal","name":"Farcana on Ordinals","collectionSymbol":"farcana-on-ordinals","collectionId":"farcana-on-ordinals","vol":0.0049,"totalVol":7.78759717,"totalTxns":399,"volPctChg":145,"txns":2,"txnsPctChg":100,"fp":0.00298,"fpPctChg":19.2,"fpListingPrice":0.00298,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.99234,"totalSupply":333,"listedCount":34,"ownerCount":138,"uniqueOwnerRatio":0.414414414414414,"image":"https://bafybeigovnhxgzef4y53pc3odboto5zbbb5sucbt7iomaiy4u6fp27wvqu.ipfs.nftstorage.link/","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":101600.404863236,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/farcana-on-ordinals?cohort=ordinal\u0026window=7d\u0026currentFp=0.00298\u0026fpPctChg=19.199999999999996","description":"Farcana is a third-person team ability shooter set in a mesmerizing Sci-Fi landscape. It emphasizes fast-paced gameplay, where weapons and the strategic use of characters' tactical and defensive abilities determine the outcome of matches. "},{"cohort":"ordinal","name":"Karana OG PASS","collectionSymbol":"karana-ogpass","collectionId":"karana-ogpass","vol":0.004899,"totalVol":0.050079,"totalTxns":9,"volPctChg":-10.92727273,"txns":1,"fp":0.00566,"fpListingPrice":0.00566,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":47.544,"totalSupply":8400,"listedCount":26,"ownerCount":597,"uniqueOwnerRatio":0.0710714285714286,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-karana-ogpass_pfp_1722097623148.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":4867776.81925319,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/karana-ogpass?cohort=ordinal\u0026window=7d\u0026currentFp=0.00566","description":"The Karana OG PASS NFT Collection features 8400 exclusive pieces minted at 0.006 BTC each. OG PASS holders benefit from a 40% share of the inscription revenue from the Karana Omnichain Inscription Platform, priority access to participate in testing new features on the Karana Network, and an airdrop of mainnet tokens upon the Karana mainnet launch."},{"cohort":"ordinal","name":"Nat Frogs","collectionSymbol":"dmtnatfrogs","collectionId":"dmtnatfrogs","vol":0.004846,"totalVol":9.60408635,"totalTxns":3319,"volPctChg":1026.97674419,"txns":10,"txnsPctChg":900,"fp":0.00035,"fpPctChg":0.0285795941697531,"fpListingPrice":0.00035,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":2.8224,"totalSupply":8064,"listedCount":983,"ownerCount":1069,"uniqueOwnerRatio":0.132564484126984,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-dmtnatfrogs_pfp_1717362041605.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":288970.496690649,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/dmtnatfrogs?cohort=ordinal\u0026window=7d\u0026currentFp=0.00035\u0026fpPctChg=0.028579594169753086","description":"The first community-curated art collection leveraging Digital Matter Theory, featuring 8,064 distinctive frogs, each uniquely generated and fully hosted on-chain. Natfrogs are born from Bitcoin blocks that contain the \\"},{"cohort":"ordinal","name":"Aneemoo's","collectionSymbol":"aneemoo","collectionId":"aneemoo","vol":0.004795,"totalVol":10.23593763,"totalTxns":2727,"volPctChg":-36.9825207,"txns":6,"txnsPctChg":-14.28571429,"fp":0.000844,"fpPctChg":-15.6,"fpListingPrice":0.000844,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.937684,"totalSupply":1111,"listedCount":307,"ownerCount":568,"uniqueOwnerRatio":0.511251125112511,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-aneemoo_pfp_1725219404833.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":96004.4682606556,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/aneemoo?cohort=ordinal\u0026window=7d\u0026currentFp=0.000844\u0026fpPctChg=-15.600000000000003","description":"Building Bitcoins largest 1:1 pfp art collection 🦒 This is NOT your typical Generative Art Project. Every piece in the collection is a hand drawn 1 of 1. The entire creative process took over 5 months to complete and they will forever live on Bitcoin."},{"cohort":"ordinal","name":"iDclub Pass","collectionSymbol":"idclub-pass","collectionId":"idclub-pass","vol":0.00479,"totalVol":0.7385555,"totalTxns":47,"txns":1,"fp":0.004,"fpPctChg":-16.4926931106472,"fpListingPrice":0.004,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":2,"totalSupply":500,"listedCount":47,"ownerCount":411,"uniqueOwnerRatio":0.822,"image":"https://bafybeidl7hkl3y7tkeudp7oktrj4sz2i22glapb3bygwi3nafc7ye6ogpu.ipfs.nftstorage.link/","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":204769.342893033,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/idclub-pass?cohort=ordinal\u0026window=7d\u0026currentFp=0.004\u0026fpPctChg=-16.49269311064718","description":"iDclub Pass NFT, OG Member x 150, Club Member x 350.\\n"},{"cohort":"ordinal","name":"Frucks","collectionSymbol":"frucks","collectionId":"frucks","vol":0.00478699,"totalVol":73.47766426,"totalTxns":8435,"volPctChg":-61.57244256,"txns":13,"txnsPctChg":-62.85714286,"fp":0.00041,"fpPctChg":-8.27535291617262,"fpListingPrice":0.00041,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":1.98768,"totalSupply":4848,"listedCount":723,"ownerCount":2555,"uniqueOwnerRatio":0.527021452145215,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-frucks_pfp_1716933577567.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":203507.963740812,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/frucks?cohort=ordinal\u0026window=7d\u0026currentFp=0.00041\u0026fpPctChg=-8.275352916172618","description":"it's literally just frogs on bitcoin"},{"cohort":"ordinal","name":"Ordibots","collectionSymbol":"ordibots3d","collectionId":"ordibots3d","vol":0.004773,"totalVol":10.82493926,"totalTxns":1416,"txns":15,"fp":0.00075,"fpPctChg":103.252032520325,"fpListingPrice":0.00075,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":1.41675,"totalSupply":1889,"listedCount":308,"ownerCount":987,"uniqueOwnerRatio":0.522498676548438,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-ordibots3d_pfp_1701002441197.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":2,"currencyUsdRate":102384.671446517,"marketCapUsd":145053.483271853,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/ordibots3d?cohort=ordinal\u0026window=7d\u0026currentFp=0.00075\u0026fpPctChg=103.25203252032517","description":"OrdiBots is a collection of interactive 3D digital art on Bitcoin. Thanks to the integration into AR, it enables users to position their digital companions in real-world."},{"cohort":"ordinal","name":"PIXEL PACKETS","collectionSymbol":"pixel_packets_btc","collectionId":"pixel_packets_btc","vol":0.00465,"totalVol":0.30468389,"totalTxns":86,"volPctChg":-37.91722296,"txns":2,"txnsPctChg":-33.33333333,"fp":0.00275,"fpListingPrice":0.00275,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.91575,"totalSupply":333,"listedCount":29,"ownerCount":155,"uniqueOwnerRatio":0.465465465465465,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-pixel_packets_btc_pfp_1727097009186.gif","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":93758.7628771477,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/pixel_packets_btc?cohort=ordinal\u0026window=7d\u0026currentFp=0.00275","description":"Each Packet contains a symbolic sprinkling of magical pixels of Bitcoin Shroom #139 from the First Ordinal Collection."},{"cohort":"ordinal","name":"Unordinals: Rebirth","collectionSymbol":"rebirth","collectionId":"rebirth","vol":0.004598,"totalVol":2.7628401,"totalTxns":418,"txns":3,"fp":0.000999,"fpListingPrice":0.000999,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.999,"totalSupply":1000,"listedCount":149,"ownerCount":522,"uniqueOwnerRatio":0.522,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-rebirth_pfp_1702533008824.gif","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":102282.28677507,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/rebirth?cohort=ordinal\u0026window=7d\u0026currentFp=0.000999","description":"[re]birth in progress..."},{"cohort":"ordinal","name":"Magical Flowers by YOUNG \u0026 SICK","collectionSymbol":"magicalflowers","collectionId":"magicalflowers","vol":0.00459446,"totalVol":2.44118671,"totalTxns":3006,"volPctChg":22.40534118,"txns":37,"txnsPctChg":76.19047619,"fp":0.00013,"fpPctChg":-23.0769230769231,"fpListingPrice":0.00013,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.39,"totalSupply":3000,"listedCount":425,"ownerCount":2031,"uniqueOwnerRatio":0.677,"image":"https://bafybeic4yllmhzbo7wdhzgrrz4fv5f45ljhsi4cr6exk3lcdezopijthxm.ipfs.w3s.link/image%20(11).png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":39930.0218641415,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/magicalflowers?cohort=ordinal\u0026window=7d\u0026currentFp=0.00013\u0026fpPctChg=-23.076923076923073","description":"Magical Flowers is an art piece by YOUNG \\u0026 SICK to celebrate the Full Mempool Protection Tool. Mempool sniping has come to an end!"},{"cohort":"ordinal","name":"-Goosinals (Cursed Goosinals)","collectionSymbol":"goosinals_","collectionId":"goosinals_","vol":0.0045,"totalVol":1.70598959,"totalTxns":172,"txns":3,"fp":0.0019,"fpPctChg":15.1515151515152,"fpListingPrice":0.0019,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":2.3123,"totalSupply":1217,"listedCount":201,"ownerCount":555,"uniqueOwnerRatio":0.456039441248973,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord--goosinals_pfp_1704489661582.gif","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":236744.075785781,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/goosinals_?cohort=ordinal\u0026window=7d\u0026currentFp=0.0019\u0026fpPctChg=15.15151515151516","description":"A vibrant, low effort PFP project using parent-child provenance to create cursed geese. DISCLAIMER: CURSED INSCRIPTIONS REMAIN DELICATE AND NECESSITATE CAREFUL MANAGEMENT. STORE YOUR CURSED INSCRIPTIONS IN WALLETS COMPATIBLE WITH THEM, SUCH AS XVERSE, OR IN NEW WALLETS DESIGNATED SOLELY FOR THESE INSCRIPTIONS, WHICH YOU SHOULD AVOID USING FOR OTHER TRANSACTIONS. BE AWARE THAT CURSED INSCRIPTIONS MAY BE INADVERTENTLY SPENT IN WALLETS THAT DO NOT SUPPORT THEM."},{"cohort":"ordinal","name":"Ordinal Misfits","collectionSymbol":"oridnalmisfits","collectionId":"oridnalmisfits","vol":0.0043569,"totalVol":1.08518154,"totalTxns":560,"txns":5,"fp":0.00119,"fpPctChg":61.4873117112227,"fpListingPrice":0.00119,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":1.22094,"totalSupply":1026,"listedCount":81,"ownerCount":380,"uniqueOwnerRatio":0.37037037037037,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-oridnalmisfits_pfp_1721678434659.jpeg","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":125005.54075591,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/oridnalmisfits?cohort=ordinal\u0026window=7d\u0026currentFp=0.00119\u0026fpPctChg=61.4873117112227","description":"The beginnings of the Misfit family! A collection of the sickest pixelated Ordinal Misfits."},{"cohort":"ordinal","name":"Metablocks by Billy Restey","collectionSymbol":"metablocks","collectionId":"metablocks","vol":0.0042,"totalVol":0.65554,"totalTxns":119,"txns":2,"fp":0.0021,"fpPctChg":-2.32558139534884,"fpListingPrice":0.0021,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.84,"totalSupply":400,"listedCount":56,"ownerCount":235,"uniqueOwnerRatio":0.5875,"image":"https://bafybeicqomxpvoyz2dm44q6jtaswt6ohsnr7unydxf56axqr643ioiolmm.ipfs.nftstorage.link/","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":86003.1240150741,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/metablocks?cohort=ordinal\u0026window=7d\u0026currentFp=0.0021\u0026fpPctChg=-2.3255813953488413","description":"a recursive 256 megapixel artwork by billyrestey, assembled by 400 individual inscriptions, inscribed on an uncommon."},{"cohort":"ordinal","name":"Decimals","collectionSymbol":"decimals","collectionId":"decimals","vol":0.0042,"totalVol":2.6662783,"totalTxns":286,"volPctChg":-30,"txns":2,"txnsPctChg":-33.33333333,"fp":0.0022,"fpPctChg":10,"fpListingPrice":0.0022,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":2.222,"totalSupply":1010,"listedCount":47,"ownerCount":551,"uniqueOwnerRatio":0.545544554455446,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-decimals_pfp_1697857222519.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":227498.73995416,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/decimals?cohort=ordinal\u0026window=7d\u0026currentFp=0.0022\u0026fpPctChg=10.000000000000009","description":"Decimals are mischievous creatures, discovered by exploring new habitats in digital worlds. Once befriended, they become loyal to their companion, causing chaos and bringing unexpected surprises."},{"cohort":"ordinal","name":"MH//I EVOLUTION","collectionSymbol":"mhi-evolution","collectionId":"mhi-evolution","vol":0.004099,"totalVol":0.037202,"totalTxns":24,"volPctChg":110.31298102,"txns":3,"txnsPctChg":50,"fp":0.0024,"fpPctChg":60.1067378252168,"fpListingPrice":0.0024,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":24,"totalSupply":10000,"listedCount":46,"ownerCount":221,"uniqueOwnerRatio":0.0221,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-mhi-evolution_pfp_1726084445489.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":2457232.1147164,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/mhi-evolution?cohort=ordinal\u0026window=7d\u0026currentFp=0.0024\u0026fpPctChg=60.106737825216804","description":"The Trinity have returned from the Source to deliver a collection of up to 10,000 Evolved MH//I. DISCLAIMER: The artwork in this collection is an on-chain evolution of the original Mutant Hounds: Inscriptions collection. Both are inscribed on a shared satoshi and holders are advised that selling or transferring either of the inscriptions will result in both inscriptions being sold or transferred simultaneously. For more information, please join the official Discord linked in the original Mutant Hounds: Inscriptions collection."},{"cohort":"ordinal","name":"Fusion by Billy Restey \u0026 Gabe Weis","collectionSymbol":"fusion-art","collectionId":"fusion-art","vol":0.004,"totalVol":0.35366945,"totalTxns":158,"volPctChg":38.45621322,"txns":4,"txnsPctChg":100,"fp":0.0011,"fpPctChg":-12,"fpListingPrice":0.0011,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":1.3519,"totalSupply":1229,"listedCount":160,"ownerCount":524,"uniqueOwnerRatio":0.426362896663954,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-fusion-art_pfp_1721244143975.gif","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":138413.837328546,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/fusion-art?cohort=ordinal\u0026window=7d\u0026currentFp=0.0011\u0026fpPctChg=-12","description":"An experimental generative art project using rare sats to create abstract, minimalist artwork––inscribed by the community using their own satoshis, by Billy Restey \\u0026 Gabe Weis"},{"cohort":"ordinal","name":"Planetary Primes [🪐]","collectionSymbol":"planetaryprimes","collectionId":"planetaryprimes","vol":0.003956,"totalVol":2.04363352,"totalTxns":1142,"txns":4,"fp":0.000999,"fpPctChg":-0.099999999999989,"fpListingPrice":0.000999,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":1.295703,"totalSupply":1297,"listedCount":133,"ownerCount":578,"uniqueOwnerRatio":0.445643793369314,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-planetaryprimes_pfp_1702299069696.gif","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":132660.125947266,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/planetaryprimes?cohort=ordinal\u0026window=7d\u0026currentFp=0.000999\u0026fpPctChg=-0.09999999999998899","description":"First ever collection inscribed entirely on Prime Number Sats. Planetary Primes are an extension of The Seeker project - a mathematical sci-fi game universe which started in the Sub10K club. The art is based on Prime Number Spirals, each with a unique selection of Primes illuminated. It showcases the beautiful and mysterious structure of Primes, and the patterns hidden within. These Spirals are also abstract symbolic maps of the Planet that's central to The Seeker lore, showcasing an empty 'entrance' leading to the Planet's center on one side.."},{"cohort":"ordinal","name":"UniWorlds: Key of Destiny","collectionSymbol":"uniworlds-key-of-destiny","collectionId":"uniworlds-key-of-destiny","vol":0.0038579,"totalVol":22.32615877,"totalTxns":4129,"volPctChg":-73.13440111,"txns":5,"txnsPctChg":-16.66666667,"fp":0.0009,"fpPctChg":-5.25318454574166,"fpListingPrice":0.0009,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":16.2963,"totalSupply":18107,"listedCount":725,"ownerCount":14868,"uniqueOwnerRatio":0.821118904291158,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-uniworlds-key-of-destiny_pfp_1716739723941.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":1668491.32129387,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/uniworlds-key-of-destiny?cohort=ordinal\u0026window=7d\u0026currentFp=0.0009\u0026fpPctChg=-5.253184545741663","description":"Key of Destiny is an exclusive series of NFTs that serve as your passport to the UniWorlds ecosystem, embleming of access, governance, identity, and value recognition within our vibrant community."},{"cohort":"ordinal","name":"Shids ","collectionSymbol":"shids","collectionId":"shids","vol":0.0038,"totalVol":60.61375443,"totalTxns":11419,"volPctChg":-91.91798886,"txns":2,"txnsPctChg":-92,"fp":0.001698,"fpPctChg":6.125,"fpListingPrice":0.001698,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":13.205346,"totalSupply":7777,"listedCount":937,"ownerCount":3144,"uniqueOwnerRatio":0.404268998328404,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-shids_pfp_1700529408434.jpeg","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":1352025.01154757,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/shids?cohort=ordinal\u0026window=7d\u0026currentFp=0.001698\u0026fpPctChg=6.125000000000003","description":"7777 shidsslef-incriebeded colleccshunnbitscorn blogchain initlmwo"},{"cohort":"ordinal","name":"hoodie gang","collectionSymbol":"hoodie","collectionId":"hoodie","vol":0.00375,"totalVol":0.38169734,"totalTxns":25,"txns":2,"fp":0.0035,"fpListingPrice":0.0035,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.777,"totalSupply":222,"listedCount":37,"ownerCount":218,"uniqueOwnerRatio":0.981981981981982,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-hoodie_pfp_1710291428968.jpeg","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":79552.8897139435,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/hoodie?cohort=ordinal\u0026window=7d\u0026currentFp=0.0035","description":"bunch of hoodlums on bitcoin"},{"cohort":"ordinal","name":"The Holders","collectionSymbol":"theholders","collectionId":"theholders","vol":0.003703,"totalVol":0.98589342,"totalTxns":1287,"txns":13,"fp":0.000027,"fpListingPrice":0.000027,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.089991,"totalSupply":3333,"listedCount":453,"ownerCount":855,"uniqueOwnerRatio":0.256525652565257,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-theholders_pfp_1721823235331.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":9213.69896814349,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/theholders?cohort=ordinal\u0026window=7d\u0026currentFp=0.000027","description":"The Holders brings a unique art collection of 3333 Holders, consisting of the rarest cats carefully selected from around the world, to the Bitcoin"},{"cohort":"ordinal","name":"DoughNodes","collectionSymbol":"doughnodes","collectionId":"doughnodes","vol":0.0037,"totalVol":0.006679,"totalTxns":26,"volPctChg":24.2027526,"txns":15,"txnsPctChg":36.36363636,"fp":0.00055,"fpPctChg":205.555555555556,"fpListingPrice":0.00055,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.1859,"totalSupply":338,"listedCount":34,"ownerCount":158,"uniqueOwnerRatio":0.467455621301775,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-thedoughnodes_pfp_1732554295543.gif","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":19033.3104219075,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/doughnodes?cohort=ordinal\u0026window=7d\u0026currentFp=0.00055\u0026fpPctChg=205.55555555555554","description":"DoughNodes are a collection of Art based ordinals inscribed on the Bitcoin blockchain.A collection of Hand baked Doughnuts all with their own personalities.DoughNodes are the genesis of a larger collection planned in 2025. This is the first fullCollection released by Artist @bcmdrawsmotion"},{"cohort":"ordinal","name":"RunesDog Edition by Viola Misscode","collectionSymbol":"runesdog","collectionId":"runesdog","vol":0.003643,"totalVol":0.0543757,"totalTxns":60,"txns":6,"fp":0.000089,"fpPctChg":4.70588235294116,"fpListingPrice":0.000089,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.03738,"totalSupply":420,"listedCount":65,"ownerCount":294,"uniqueOwnerRatio":0.7,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-runesdog_pfp_1712623726394.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":1,"currencyUsdRate":102384.671446517,"marketCapUsd":3827.1390186708,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/runesdog?cohort=ordinal\u0026window=7d\u0026currentFp=0.000089\u0026fpPctChg=4.70588235294116","description":"New Runestone roadmap: Cuteness But...DO NOT TOUCH MY STONE! \\"},{"cohort":"ordinal","name":"Pepe Punks","collectionSymbol":"pepepunks","collectionId":"pepepunks","vol":0.00364,"totalVol":1.476713,"totalTxns":266,"txns":4,"fp":0.0009,"fpListingPrice":0.0009,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":1.305,"totalSupply":1450,"listedCount":94,"ownerCount":492,"uniqueOwnerRatio":0.339310344827586,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-pepepunks_pfp_1696220616863.jpeg","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":133611.996237704,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/pepepunks?cohort=ordinal\u0026window=7d\u0026currentFp=0.0009","description":"Pepe Punks are inscribed on Legendary Block 9 sats and also re-inscribed on cursed sats. Each sat has both a regular inscription and a cursed inscription. The cursed sides also carry a cursed vibe."},{"cohort":"ordinal","name":"Pepe Punks Cursed Side","collectionSymbol":"pepe-punks-cursed-side","collectionId":"pepe-punks-cursed-side","vol":0.00364,"totalVol":0.437314,"totalTxns":102,"txns":4,"fp":0.001,"fpPctChg":13.6363636363636,"fpListingPrice":0.001,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":1.45,"totalSupply":1450,"listedCount":55,"ownerCount":492,"uniqueOwnerRatio":0.339310344827586,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-pepe-punks-cursed-side_pfp_1709534031238.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":148457.773597449,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/pepe-punks-cursed-side?cohort=ordinal\u0026window=7d\u0026currentFp=0.001\u0026fpPctChg=13.636363636363624","description":"This collection represents the cursed side of the Pepe Punks collection. (Reminder: If you sell your Cursed Pepe Punk, then Block 9 will also be transferred with it.)"},{"cohort":"ordinal","name":"Pingoos","collectionSymbol":"pingoos","collectionId":"pingoos","vol":0.0036,"totalVol":5.44454837,"totalTxns":582,"txns":2,"fp":0.0023,"fpPctChg":-23.0769230769231,"fpListingPrice":0.0023,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":2.875,"totalSupply":1250,"listedCount":163,"ownerCount":588,"uniqueOwnerRatio":0.4704,"image":"https://bafkreid6gkym3je6bfjsyj5of2yxkijbmteusbyoexfeyaa5dxhnqmt3fq.ipfs.nftstorage.link/","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":294355.930408736,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/pingoos?cohort=ordinal\u0026window=7d\u0026currentFp=0.0023\u0026fpPctChg=-23.076923076923084","description":"Pingoos by ***** Labs. The coldest Ordinal colony in the Arctic."},{"cohort":"ordinal","name":"DIMES","collectionSymbol":"dimes","collectionId":"dimes","vol":0.00357,"totalVol":2.39806365,"totalTxns":1433,"volPctChg":89.89361702,"txns":4,"txnsPctChg":100,"fp":0.00085,"fpPctChg":-10.5263157894737,"fpListingPrice":0.00085,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.87975,"totalSupply":1035,"listedCount":137,"ownerCount":310,"uniqueOwnerRatio":0.29951690821256,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-dimes_pfp_1712275681658.jpeg","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":90072.9147050731,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/dimes?cohort=ordinal\u0026window=7d\u0026currentFp=0.00085\u0026fpPctChg=-10.526315789473683","description":"Valued at 10 times more than cents, the dime was once a symbol of significant purchasing power, but has gradually lost its value due to inflation. Composed of 89% silver and 11% copper since 1796, the dime's valuable composition has remained consistent for over a century. Inspired by the discrepancy between the face value and the metal content of the coin, DIMES project began by meticulously sorting through vast quantities of dime coins. From this endeavor, 10,000 dimes were selected to be archivally documented. The final state of these 10,000 dimes are now be inscribed on 10,000 satoshis. As the purchasing power of the dime continues to diminish and its future production remains uncertain, this digitally scarce set of 10,000 will be forever etched on the Bitcoin blockchain, preserving its legacy for generations to come."},{"cohort":"ordinal","name":"Bitcoin XiuXian OG","collectionSymbol":"bitcoin_xiuxian_og","collectionId":"bitcoin_xiuxian_og","vol":0.003544,"totalVol":0.95270717,"totalTxns":529,"volPctChg":-21.20942641,"txns":4,"txnsPctChg":-20,"fp":0.00086,"fpPctChg":-5.2863436123348,"fpListingPrice":0.00086,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.66822,"totalSupply":777,"listedCount":116,"ownerCount":454,"uniqueOwnerRatio":0.584298584298584,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-bitcoin_xiuxian_og_pfp_1728067084109.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":68415.4851539914,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/bitcoin_xiuxian_og?cohort=ordinal\u0026window=7d\u0026currentFp=0.00086\u0026fpPctChg=-5.286343612334798","description":"The world's first native Eastern culture art PFP Ordinals NFT collection on the mother chain.Make XiuXian Great Again On MotherChain!Created by XianDAO."},{"cohort":"ordinal","name":"OG Pebbles","collectionSymbol":"ogpebbles","collectionId":"ogpebbles","vol":0.0035,"totalVol":0.27475334,"totalTxns":165,"volPctChg":-89.4358662,"txns":1,"txnsPctChg":-92.85714286,"fp":0.000679,"fpPctChg":-2.99999999999999,"fpListingPrice":0.000679,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.226107,"totalSupply":333,"listedCount":91,"ownerCount":273,"uniqueOwnerRatio":0.81981981981982,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-ogpebbles_pfp_1732038073615.jpeg","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":23149.8909067576,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/ogpebbles?cohort=ordinal\u0026window=7d\u0026currentFp=0.000679\u0026fpPctChg=-2.9999999999999916","description":"OG Pebbles"},{"cohort":"ordinal","name":"Tokyo Punks | Ultra Kitties by Sabet","collectionSymbol":"ultrakitties","collectionId":"ultrakitties","vol":0.0035,"totalVol":0.0035,"totalTxns":7,"txns":7,"fp":0.00044,"fpListingPrice":0.00044,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.1584,"totalSupply":360,"listedCount":47,"ownerCount":141,"uniqueOwnerRatio":0.391666666666667,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-ultrakitties_pfp_1733219681744.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":16217.7319571283,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/ultrakitties?cohort=ordinal\u0026window=7d\u0026currentFp=0.00044","description":"A collection of 1 of 1 digitally hand painted kitties from the world of Tokyo Punks by Sabet. These kitties take the art of Skull Kitties to the next level.Not only did Ali Sabet create more than 800 kitties, he got the help of some his super talented friends to create their vision of the hyper kawaii kitties. These artists are Boozy, IMCMPLX, MatiliArt, DrainedEye, Digivatar, Gabe Weis and Skull X. It's been truly an honor for Ali to be working with these incredible human beings.Beyond the art, Ultra Kitties play a major role in the Tokyo Punks story. They're the little Ai bots that the TKP carry with them everywhere they go. They help the punks navigate the wild and creazy island as they do their best to capture and tame the bad bunnies.This is only the beginning."},{"cohort":"ordinal","name":"Full Moon Ordinals","collectionSymbol":"fmo","collectionId":"fmo","vol":0.00342,"totalVol":6.57219514,"totalTxns":1105,"volPctChg":-76.86062246,"txns":2,"txnsPctChg":-66.66666667,"fp":0.0021,"fpPctChg":-20.6049149338374,"fpListingPrice":0.0021,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":4.2189,"totalSupply":2009,"listedCount":114,"ownerCount":1073,"uniqueOwnerRatio":0.534096565455451,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-fmo_pfp_1714839146407.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":431950.690365709,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/fmo?cohort=ordinal\u0026window=7d\u0026currentFp=0.0021\u0026fpPctChg=-20.60491493383744","description":"Full Moon Ordinals"},{"cohort":"ordinal","name":"BTC MachineDAO","collectionSymbol":"btcmachinedao","collectionId":"btcmachinedao","vol":0.00334,"totalVol":3.00716425,"totalTxns":1298,"volPctChg":70.40816327,"txns":2,"fp":0.0016,"fpPctChg":-10.1123595505618,"fpListingPrice":0.0016,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":1.2432,"totalSupply":777,"listedCount":74,"ownerCount":520,"uniqueOwnerRatio":0.669240669240669,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-btcmachinedao_pfp_1705068923528.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":127284.62354231,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/btcmachinedao?cohort=ordinal\u0026window=7d\u0026currentFp=0.0016\u0026fpPctChg=-10.11235955056179","description":"BTC MachineDAO: Membership"},{"cohort":"ordinal","name":"Nakamoto Whales","collectionSymbol":"nw","collectionId":"nw","vol":0.00333,"totalVol":1.611802,"totalTxns":87,"volPctChg":26.13636364,"txns":1,"fp":0.003,"fpListingPrice":0.003,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":2.382,"totalSupply":794,"listedCount":74,"ownerCount":350,"uniqueOwnerRatio":0.44080604534005,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-nw_pfp_1712197757526.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":243880.287385603,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/nw?cohort=ordinal\u0026window=7d\u0026currentFp=0.003","description":"Nakamoto Whales are an expansion of the Catalina Whale Mixer brand signed to Def Jam, forever inscribed on the Bitcoin Blockchain. Featuring epic 1/1s on Uncommons and Nakamoto SATs."},{"cohort":"ordinal","name":"Bitcoin Beeings","collectionSymbol":"bitcoinbeeings","collectionId":"bitcoinbeeings","vol":0.0033,"totalVol":2.95628499,"totalTxns":121,"txns":1,"fp":0.0029,"fpPctChg":-35.5555555555556,"fpListingPrice":0.0029,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.5771,"totalSupply":199,"listedCount":65,"ownerCount":137,"uniqueOwnerRatio":0.688442211055276,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-bitcoinbeeings_pfp_1712854338967.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":59086.1938917848,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/bitcoinbeeings?cohort=ordinal\u0026window=7d\u0026currentFp=0.0029\u0026fpPctChg=-35.55555555555555","description":"Beeings are anon internet shadows. They are the embodiment of our cultural expressions, seamlessly molding into the ever-growing narrative of our collective digital existence."},{"cohort":"ordinal","name":"PUP•PETS","collectionSymbol":"pup_pets","collectionId":"pup_pets","vol":0.00325,"totalVol":0.13779396,"totalTxns":94,"volPctChg":733.33333333,"txns":5,"txnsPctChg":400,"fp":0.0012,"fpPctChg":144.897959183673,"fpListingPrice":0.0012,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.5628,"totalSupply":469,"listedCount":79,"ownerCount":242,"uniqueOwnerRatio":0.515991471215352,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-pup_pets_pfp_1724206796960.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":57622.0930900996,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/pup_pets?cohort=ordinal\u0026window=7d\u0026currentFp=0.0012\u0026fpPctChg=144.89795918367346","description":"Cat PUP•PETS spreading World Peace"},{"cohort":"ordinal","name":"STEPEPES by LORS","collectionSymbol":"stepepes","collectionId":"stepepes","vol":0.0031989,"totalVol":12.92746113,"totalTxns":1499,"volPctChg":164.59057072,"txns":5,"txnsPctChg":66.66666667,"fp":0.000678,"fpPctChg":-0.294117647058834,"fpListingPrice":0.000678,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":1.356,"totalSupply":2000,"listedCount":301,"ownerCount":939,"uniqueOwnerRatio":0.4695,"image":"https://bafybeifjznmpji2ax2yyxz2ee2w7rwj6qq2lszacdt6tfeypg4za7meelm.ipfs.nftstorage.link/","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":2,"currencyUsdRate":102384.671446517,"marketCapUsd":138833.614481477,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/stepepes?cohort=ordinal\u0026window=7d\u0026currentFp=0.000678\u0026fpPctChg=-0.2941176470588336","description":"2000 manually made ordinals by LORS, each with a unique vibe. The collection has been inscribed on Block 9 450x sequential sats, with parent-child provenance. Each ordinal is fully animated in SVG format."},{"cohort":"ordinal","name":"NATtributes","collectionSymbol":"nattributes","collectionId":"nattributes","vol":0.0031984,"totalVol":23.11201112,"totalTxns":11646,"volPctChg":89.43378346,"txns":32,"txnsPctChg":88.23529412,"fp":0.000137,"fpPctChg":37.1371371371371,"fpListingPrice":0.000137,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":1.38096,"totalSupply":10080,"listedCount":1073,"ownerCount":2079,"uniqueOwnerRatio":0.20625,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-nattributes_pfp_1732188379932.gif","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":141389.135880782,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/nattributes?cohort=ordinal\u0026window=7d\u0026currentFp=0.000137\u0026fpPctChg=37.13713713713713","description":"The First Generative DMT Art collection on Bitcoin. Art by DIDIMX and Anon Collaborator. Evolving art. About the project: https://medium.com/@satributesart/nattributes-a-new-dawn-for-digital-matter-and-bitcoin-292cdac4f8ce"},{"cohort":"ordinal","name":"NatDiamonds","collectionSymbol":"dmt_natdiamonds","collectionId":"dmt_natdiamonds","vol":0.003144,"totalVol":0.16984714,"totalTxns":2977,"volPctChg":-4.35920056,"txns":64,"txnsPctChg":39.13043478,"fp":0.000044,"fpPctChg":-20,"fpListingPrice":0.000044,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":1.152404,"totalSupply":26191,"listedCount":870,"ownerCount":1415,"uniqueOwnerRatio":0.0540261922034287,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-dmt_natdiamonds_pfp_1711125855979.jpeg","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":1,"currencyUsdRate":102384.671446517,"marketCapUsd":117988.504913652,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/dmt_natdiamonds?cohort=ordinal\u0026window=7d\u0026currentFp=0.000044\u0026fpPctChg=-20.000000000000007","description":"bitcoin jewellery, crafting digital perls from UNAT/DMT"},{"cohort":"ordinal","name":"Cirque Le Noir | Clowns","collectionSymbol":"cirque-le-noir-clowns","collectionId":"cirque-le-noir-clowns","vol":0.0031,"totalVol":0.2805028,"totalTxns":279,"txns":17,"fp":0.00038,"fpPctChg":111.111111111111,"fpListingPrice":0.00038,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":3.79962,"totalSupply":9999,"listedCount":320,"ownerCount":847,"uniqueOwnerRatio":0.0847084708470847,"image":"https://bafybeicqlfzhua6slh5vi5e4lwfjy7ktr3vhbiesqf56hzm5cw2dtrdr7y.ipfs.nftstorage.link/","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":389022.845321614,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/cirque-le-noir-clowns?cohort=ordinal\u0026window=7d\u0026currentFp=0.00038\u0026fpPctChg=111.11111111111111","description":"everyone is welcome, but not everyone can stay. 9999 recursively inscribed high-res jesters clowning around on-chain #btc as ordinals."},{"cohort":"ordinal","name":"Fuzzy Fox","collectionSymbol":"fuzzyfox","collectionId":"fuzzyfox","vol":0.00306,"totalVol":35.291266,"totalTxns":6518,"volPctChg":-18.9833201,"txns":4,"fp":0.00065,"fpPctChg":-34.3434343434343,"fpListingPrice":0.00065,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":6.5169,"totalSupply":10026,"listedCount":742,"ownerCount":3216,"uniqueOwnerRatio":0.320766008378217,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-fuzzyfox_pfp_1702198277566.jpeg","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":667230.665349805,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/fuzzyfox?cohort=ordinal\u0026window=7d\u0026currentFp=0.00065\u0026fpPctChg=-34.34343434343434","description":"A 10k Fuzzy Fox 🦊 Bitcoin NFT Collection!New FOX frens have landed in JOMO Land, which is full of life and hope. Let's build."},{"cohort":"ordinal","name":"0N1 FORCE: Void Drives","collectionSymbol":"on1force_void_drives","collectionId":"on1force_void_drives","vol":0.0030249,"totalVol":0.3571976,"totalTxns":393,"volPctChg":-73.40015319,"txns":7,"txnsPctChg":-36.36363636,"fp":0.00044899,"fpPctChg":-2.39347826086956,"fpListingPrice":0.00044899,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":1.49648367,"totalSupply":3333,"listedCount":107,"ownerCount":1435,"uniqueOwnerRatio":0.430543054305431,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-on1force_void_drives_pfp_1716066649751.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":153216.988878028,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/on1force_void_drives?cohort=ordinal\u0026window=7d\u0026currentFp=0.00044899\u0026fpPctChg=-2.3934782608695637","description":"The key for the F4LL3N to harness the power of Runes. Void Drives are the essential artifacts that channel the untapped potential of Runes, fueling the F4LL3N's journey and empowering their abilities. As the cornerstone of their strength, these drives transform the raw energy of Runes into formidable power, ready to be unleashed in the Enclave."},{"cohort":"ordinal","name":"BASTARD GAN SILLY WIZARDS","collectionSymbol":"bganwizards","collectionId":"bganwizards","vol":0.003,"totalVol":0.5967358,"totalTxns":244,"volPctChg":-40,"txns":2,"fp":0.0024,"fpPctChg":60,"fpListingPrice":0.0024,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.7992,"totalSupply":333,"listedCount":60,"ownerCount":102,"uniqueOwnerRatio":0.306306306306306,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-bganwizards_pfp_1688391390927.gif","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":81825.8294200562,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/bganwizards?cohort=ordinal\u0026window=7d\u0026currentFp=0.0024\u0026fpPctChg=59.999999999999986","description":"TAPROOT WIZARDS ARE PUT IN BGAN INCUBATION AUTOMATION UNIT #42069 AND GIVE BIRTH TO 333 BASTARD CHILDREN. NOW THEY ARE HERE TO DEGENERATE THE WORLD! COLLECTION CONSISTS OF 33 HYPED AF (ANIMATED) AND 300 CALM AF (STILL) BGANS. MADE BY @berkozdemir. HEIRS OF BASTARD GAN PUNKS"},{"cohort":"ordinal","name":"Runevo","collectionSymbol":"runevo","collectionId":"runevo","vol":0.002969,"totalVol":18.48721265,"totalTxns":4338,"volPctChg":85.5625,"txns":9,"txnsPctChg":125,"fp":0.00029,"fpPctChg":-32.5581395348837,"fpListingPrice":0.00029,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":1.74725,"totalSupply":6025,"listedCount":420,"ownerCount":2426,"uniqueOwnerRatio":0.402655601659751,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-runevo_pfp_1713373942262.gif","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":178891.617184926,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/runevo?cohort=ordinal\u0026window=7d\u0026currentFp=0.00029\u0026fpPctChg=-32.55813953488372","description":"Mobile-First Infrastructure for Runes, by SatRepublic."},{"cohort":"ordinal","name":"CYBORD PEPENTINOS","collectionSymbol":"cybord_pepentinos","collectionId":"cybord_pepentinos","vol":0.0029322,"totalVol":1.07094376,"totalTxns":1846,"volPctChg":2283.90243902,"txns":64,"txnsPctChg":2033.33333333,"fp":0.000051,"fpPctChg":27.5,"fpListingPrice":0.000051,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.51,"totalSupply":10000,"listedCount":592,"ownerCount":2950,"uniqueOwnerRatio":0.295,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-cybord_pepentinos_pfp_1705931282090.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":52216.1824377235,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/cybord_pepentinos?cohort=ordinal\u0026window=7d\u0026currentFp=0.000051\u0026fpPctChg=27.499999999999993","description":"10,000 Cybord Pepentinos. First non- derivative Bitcoin Ordinals Collection on the CBRC-20 Token Metaprotocol."},{"cohort":"ordinal","name":"The Orange Pills (TOP)","collectionSymbol":"top","collectionId":"top","vol":0.00293185,"totalVol":0.53470815,"totalTxns":1622,"volPctChg":-18.21896792,"txns":29,"txnsPctChg":16,"fp":0.000097,"fpPctChg":-14.9122807017544,"fpListingPrice":0.000097,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.538835,"totalSupply":5555,"listedCount":942,"ownerCount":3479,"uniqueOwnerRatio":0.626282628262826,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-top_pfp_1725876430982.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":55168.4444388838,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/top?cohort=ordinal\u0026window=7d\u0026currentFp=0.000097\u0026fpPctChg=-14.912280701754387","description":"Orange Pill(ing): The awakening to Bitcoin's transformative potential, embracing decentralization and true ownership. Bitcoin empowers individuals by returning control to the people. The Orange Pills now provide a visual representation of this concept—which is timely, as there's never been a better moment in history to orange pill our global society."},{"cohort":"ordinal","name":"BITCOIN PUNKS I2","collectionSymbol":"bitcoin-punks-i2","collectionId":"bitcoin-punks-i2","vol":0.00293,"totalVol":1.59215978,"totalTxns":1116,"volPctChg":-55.20562605,"txns":9,"txnsPctChg":-10,"fp":0.00037,"fpPctChg":-5.12820512820513,"fpListingPrice":0.00037,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":3.7,"totalSupply":10000,"listedCount":1048,"ownerCount":5976,"uniqueOwnerRatio":0.5976,"image":"https://bafkreidu5j2qscxoouydxi3rn6jmqzsql7qkdz4gmb4nt6wqnpv6nddo7q.ipfs.nftstorage.link/","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":378823.284352112,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/bitcoin-punks-i2?cohort=ordinal\u0026window=7d\u0026currentFp=0.00037\u0026fpPctChg=-5.128205128205132","description":"Bitcoin Punks i2 are the second byte-perfect uploads of the original Ethereum CryptoPunks onto the Bitcoin Blockchain using Ordinals"},{"cohort":"ordinal","name":"Taproot Bitches","collectionSymbol":"taprootbitches","collectionId":"taprootbitches","vol":0.00287,"totalVol":1.07290883,"totalTxns":3499,"volPctChg":-39.27211172,"txns":15,"txnsPctChg":-34.7826087,"fp":0.0002,"fpListingPrice":0.0002,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.6668,"totalSupply":3334,"listedCount":336,"ownerCount":981,"uniqueOwnerRatio":0.294241151769646,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-taprootbitches_pfp_1727331066024.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":1,"currencyUsdRate":102384.671446517,"marketCapUsd":68270.0989205374,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/taprootbitches?cohort=ordinal\u0026window=7d\u0026currentFp=0.0002","description":"wicked brew of frenzy troll spells and defend chaos, eternally inscribed on Bitcoin"},{"cohort":"ordinal","name":"Retordinals","collectionSymbol":"retordinals","collectionId":"retordinals","vol":0.002839,"totalVol":7.9092678,"totalTxns":3403,"volPctChg":-25.4855643,"txns":7,"txnsPctChg":-36.36363636,"fp":0.0004,"fpPctChg":-4.76190476190476,"fpListingPrice":0.0004,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":1.7076,"totalSupply":4269,"listedCount":486,"ownerCount":2066,"uniqueOwnerRatio":0.483954087608339,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-retordinals_pfp_1713981871437.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":174832.064962072,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/retordinals?cohort=ordinal\u0026window=7d\u0026currentFp=0.0004\u0026fpPctChg=-4.761904761904756","description":"4269 Retordinals spawned from the Bitcoin Blockchain"},{"cohort":"ordinal","name":"N O D E B I R D S [G O L D]","collectionSymbol":"nodebirdsgold","collectionId":"nodebirdsgold","vol":0.00283,"totalVol":0.521548,"totalTxns":77,"volPctChg":-14.24242424,"txns":3,"txnsPctChg":-40,"fp":0.001,"fpPctChg":25,"fpListingPrice":0.001,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.15,"totalSupply":150,"listedCount":23,"ownerCount":91,"uniqueOwnerRatio":0.606666666666667,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-nodebirdsgold_pfp_1710629265520.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":15357.7007169775,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/nodebirdsgold?cohort=ordinal\u0026window=7d\u0026currentFp=0.001\u0026fpPctChg=25","description":"Nodebirds [GOLD] Collection is a pixelcollection by artist MIO, inscribed on the lowest/oldest B9 in circulation. Parent - child, with ID prefix B9 in the end and beginning."},{"cohort":"ordinal","name":"RSIC BOOST","collectionSymbol":"rsic-boost","collectionId":"rsic-boost","vol":0.0028,"totalVol":15.61953037,"totalTxns":3995,"volPctChg":25.56053812,"txns":10,"txnsPctChg":11.11111111,"fp":0.0003,"fpPctChg":3.44827586206895,"fpListingPrice":0.0003,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":1.8648,"totalSupply":6216,"listedCount":235,"ownerCount":5761,"uniqueOwnerRatio":0.926801801801802,"image":"https://bafkreih7fofjtt7cuy5cynhgonevqqnbp7criokeofvpvcrijkbr7rxcoq.ipfs.nftstorage.link/","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":190926.935313464,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/rsic-boost?cohort=ordinal\u0026window=7d\u0026currentFp=0.0003\u0026fpPctChg=3.44827586206895","description":"Good luck, and enjoy the game. Boosts increases production rate by 21 runes per RSIC per block."},{"cohort":"ordinal","name":"QB GoldRush NFTs","collectionSymbol":"qb_goldrush","collectionId":"qb_goldrush","vol":0.0028,"totalVol":0.04353,"totalTxns":11,"volPctChg":-12.5,"txns":1,"fp":0.0033,"fpListingPrice":0.0033,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":8.25,"totalSupply":2500,"listedCount":55,"ownerCount":95,"uniqueOwnerRatio":0.038,"image":"https://nftstorage.link/ipfs/bafkreiho4n7az72q3quywjl5yqmxt2xdfj4ipg3hfbck3fik7fkxdb3h6y","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":844673.539433763,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/qb_goldrush?cohort=ordinal\u0026window=7d\u0026currentFp=0.0033","description":"Utilities: access to game development DAO / utilization in GuildQB game / token mining\\n\\nThe gaming guild GuildQB has developed an original blockchain game. The content is a mining game, and the model is to invest NFT proceeds in real BTC mining and return the returns to game users. NFTs will be issued and sold on BRC-20, a BTC chain, for the purpose of collecting hash power for initial game participants and game release."},{"cohort":"ordinal","name":"Boneys by Bitcoin Burials","collectionSymbol":"boneys","collectionId":"boneys","vol":0.00272,"totalVol":14.50329553,"totalTxns":5010,"volPctChg":-95.15307032,"txns":8,"txnsPctChg":-93.44262295,"fp":0.00035,"fpPctChg":-32.6923076923077,"fpListingPrice":0.00035,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":3.5,"totalSupply":10000,"listedCount":1723,"ownerCount":1878,"uniqueOwnerRatio":0.1878,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-boneys_pfp_1708589687856.gif","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":358346.350062809,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/boneys?cohort=ordinal\u0026window=7d\u0026currentFp=0.00035\u0026fpPctChg=-32.692307692307686","description":"Bitcoin Burials presents Boneys, a fun and irreverent 10k collection of cute and mischievous skellys.After a long slumber they have finally emerged from the Burials with a bone to pick and are ready to cause some bone fide mayhem.Why did they awaken? Was it the ETFs finally being approved? Laser eyes attempting to pass off Ordinals as a CVE? The 2024 halving fast approaching?Who knows, but one thing is certain, they're here and ready to rattle some bones."},{"cohort":"ordinal","name":"Twelve Frog","collectionSymbol":"twelvefrog","collectionId":"twelvefrog","vol":0.0027,"totalVol":0.685518,"totalTxns":29,"txns":1,"fp":0.012,"fpPctChg":20,"fpListingPrice":0.012,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":2.664,"totalSupply":222,"listedCount":57,"ownerCount":153,"uniqueOwnerRatio":0.689189189189189,"image":"https://bafybeieryw4lojmmkpjotpjo6gnkejljkemkpbzkfcytd7capqylckgom4.ipfs.nftstorage.link/","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":1,"currencyUsdRate":102384.671446517,"marketCapUsd":272752.764733521,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/twelvefrog?cohort=ordinal\u0026window=7d\u0026currentFp=0.012\u0026fpPctChg=19.999999999999996","description":"Born from the same ordinal swamps as Inscribed Pepes, TwelveFrog is the 222 fakest, dankest, and froggiest art pieces ever inscribed on Bitcoin."},{"cohort":"ordinal","name":"EVERYDAY SATOSHIS","collectionSymbol":"everydaysats","collectionId":"everydaysats","vol":0.002665,"totalVol":13.09395581,"totalTxns":3311,"volPctChg":-18.87366819,"txns":6,"txnsPctChg":-50,"fp":0.00023,"fpPctChg":-4.16666666666666,"fpListingPrice":0.00023,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":1.27397,"totalSupply":5539,"listedCount":972,"ownerCount":1677,"uniqueOwnerRatio":0.30276223144972,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-everydaysats_pfp_1713462640457.gif","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":130434.999882719,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/everydaysats?cohort=ordinal\u0026window=7d\u0026currentFp=0.00023\u0026fpPctChg=-4.1666666666666625","description":"An Ordinals collection of memetic artifacts celebrating the journey of Bitcoin and its cultural impact on the world. Holding at least one unlisted Everyday Sat grants you a $CLTR token airdrop with a Culture Validator status and a daily point yield on the https://snglr.io/ platform."},{"cohort":"ordinal","name":"The Rune Guardians","collectionSymbol":"trg","collectionId":"trg","vol":0.002629,"totalVol":86.98448115,"totalTxns":8929,"volPctChg":132.65486726,"txns":17,"txnsPctChg":142.85714286,"fp":0.00017,"fpListingPrice":0.00017,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":1.7,"totalSupply":10000,"listedCount":649,"ownerCount":7221,"uniqueOwnerRatio":0.7221,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-trg_pfp_1707682377690.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":174053.941459078,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/trg?cohort=ordinal\u0026window=7d\u0026currentFp=0.00017","description":"The Rune Guardians: Protectors of mystical runes. This elite 10k Collection, magically airdropped to Guardian Masters across Ordinal Universe, bridges the guardians with their celestial duty. Tap into your Guardian to unveil your rune balance, a reflection of your bond with the ancient elements. Each block heralds new rewards, celebrating the symbiosis of Guardians and the sacred runes they safeguard."},{"cohort":"ordinal","name":"!+01/🔥 by Rax","collectionSymbol":"rax_recursive2","collectionId":"rax_recursive2","vol":0.0025,"totalVol":1.36172,"totalTxns":71,"txns":1,"fp":0.0025,"fpListingPrice":0.0025,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.425,"totalSupply":170,"listedCount":39,"ownerCount":128,"uniqueOwnerRatio":0.752941176470588,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-rax01_pfp_1701666930177.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":43513.4853647696,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/rax_recursive2?cohort=ordinal\u0026window=7d\u0026currentFp=0.0025","description":"HTML, Javascript and CSS. Block height fetched every 420690 milliseconds seeding color change and Perlin noise. ASCII in monospace, emoji/unicode-- signs and machines, semiotic motors. !+01/🔥 consists of one original inscription, followed by 169 inscriptions which recursively link back to the original."},{"cohort":"ordinal","name":"BTC Frens","collectionSymbol":"btc-frens","collectionId":"btc-frens","vol":0.0025,"totalVol":0.258759,"totalTxns":59,"volPctChg":-82.6147427,"txns":2,"txnsPctChg":-71.42857143,"fp":0.00135,"fpPctChg":-3.57142857142857,"fpListingPrice":0.00135,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.5103,"totalSupply":378,"listedCount":73,"ownerCount":234,"uniqueOwnerRatio":0.619047619047619,"image":"https://bafkreicpcpy4fbqu3nhhaw4fwxygjkvtrhgkcmdslfc22o56tmhb566rwe.ipfs.nftstorage.link/","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":52246.8978391575,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/btc-frens?cohort=ordinal\u0026window=7d\u0026currentFp=0.00135\u0026fpPctChg=-3.57142857142857","description":"BTC Machine Frens Version"},{"cohort":"ordinal","name":"Rune Mania Miner Season 2","collectionSymbol":"rmm2","collectionId":"rmm2","vol":0.002443,"totalVol":6.38522705,"totalTxns":3296,"volPctChg":8.91662951,"txns":9,"txnsPctChg":125,"fp":0.000081,"fpListingPrice":0.000081,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.806922,"totalSupply":9962,"listedCount":711,"ownerCount":5600,"uniqueOwnerRatio":0.562136117245533,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-rmm2_pfp_1712764216780.jpeg","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":82616.4438529662,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/rmm2?cohort=ordinal\u0026window=7d\u0026currentFp=0.000081","description":"Season 2 mining starts at Block 840,000. Mine Runes using Lava Boost, Fire Boost and other gaming dynamics"},{"cohort":"ordinal","name":"CursedPunks","collectionSymbol":"cpnks","collectionId":"cpnks","vol":0.00242299,"totalVol":4.0028544,"totalTxns":3079,"volPctChg":-30.37245002,"txns":7,"txnsPctChg":-30,"fp":0.00033,"fpPctChg":-10.5691056910569,"fpListingPrice":0.00033,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":3.3,"totalSupply":10000,"listedCount":550,"ownerCount":3041,"uniqueOwnerRatio":0.3041,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-cpnks_pfp_1705429955002.jpeg","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":337869.415773505,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/cpnks?cohort=ordinal\u0026window=7d\u0026currentFp=0.00033\u0026fpPctChg=-10.569105691056912","description":"A 10k Cursed Ordinals Collection. Own a CPNK and secure your upcoming Runes Token airdrop. CursedPunks started in 2023 as CybordPunks which was the first project on CBRC-20."},{"cohort":"ordinal","name":"The Pandemonium - Birds of a Feather","collectionSymbol":"boaf","collectionId":"boaf","vol":0.0023456,"totalVol":0.5555441,"totalTxns":122,"txns":1,"fp":0.0038,"fpPctChg":-9.52380952380952,"fpListingPrice":0.0038,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":1.9,"totalSupply":500,"listedCount":47,"ownerCount":290,"uniqueOwnerRatio":0.58,"image":"https://bafkreihzyqji75v43qxabgqvonqk2knysrmkngpw3puu6ax5dxyusxy5ou.ipfs.nftstorage.link/","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":194530.875748382,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/boaf?cohort=ordinal\u0026window=7d\u0026currentFp=0.0038\u0026fpPctChg=-9.523809523809524","description":"The Birds of a Feather is a PFP collection where black and white nostalgia meets street culture. Each ordinal unlocks a premium OrdiGallery. Art by TheArtist for The Pandemonium."},{"cohort":"ordinal","name":"🪷 Flowers4Finney by Palindromes.io","collectionSymbol":"f4f","collectionId":"f4f","vol":0.00234,"totalVol":0.09481299,"totalTxns":174,"txns":6,"fp":0.00039,"fpListingPrice":0.00039,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.39,"totalSupply":1000,"listedCount":613,"ownerCount":101,"uniqueOwnerRatio":0.101,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-f4f_pfp_1721242217538.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":1,"currencyUsdRate":102384.671446517,"marketCapUsd":39930.0218641415,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/f4f?cohort=ordinal\u0026window=7d\u0026currentFp=0.00039","description":"🗞️ First-Ever Onchain Breedable Ordinals 🏃 1000 flowers seeded onto 1 Million B78 Rare Sats 🦋 B78 3D Palindromic Parent-Child Provenance ❤️ 50% donated to Fran Finney's ALS Campaign 🧬 Breed by simply sending flowers back to yourself ⚗️ Distill hybrids back down to raw parts or remix them 🌠 Auto upgrades direct from the Bitcoin blockchain 💌 Stake extra sats to power-up your flowers 🔗 New tech runs everything 100% onchain forever! ⚠️ IMPORTANT: Flowers may change appearance upon purchase. Each ordinal represents a base flower. Double-click to see a flower's raw ingredients. You will receive the base flower at the top. You need to combine ingredients to create/recreate hybrids. More information at https://palindromes.io/flowers"},{"cohort":"ordinal","name":"Trumpuppets","collectionSymbol":"trumpuppets","collectionId":"trumpuppets","vol":0.002122,"totalVol":4.6678587,"totalTxns":7568,"volPctChg":382.27272727,"txns":22,"txnsPctChg":450,"fp":0.000098,"fpListingPrice":0.000098,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.980098,"totalSupply":10001,"listedCount":1826,"ownerCount":2372,"uniqueOwnerRatio":0.237176282371763,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-trumpuppets_pfp_1711141685120.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":100347.011715388,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/trumpuppets?cohort=ordinal\u0026window=7d\u0026currentFp=0.000098","description":"BITCOIN TRUMPS + BITCOIN PUPPETS = TRUMPUPPETS"},{"cohort":"ordinal","name":"Bitcoin Gizmos","collectionSymbol":"bitcoingizmos","collectionId":"bitcoingizmos","vol":0.0021084,"totalVol":3.50917567,"totalTxns":5381,"volPctChg":-45.70177698,"txns":26,"txnsPctChg":73.33333333,"fp":0.000037,"fpPctChg":-4.88431876606683,"fpListingPrice":0.000037,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.37,"totalSupply":10000,"listedCount":1596,"ownerCount":5441,"uniqueOwnerRatio":0.5441,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-bitcoingizmos_pfp_1729179105306.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":37882.3284352112,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/bitcoingizmos?cohort=ordinal\u0026window=7d\u0026currentFp=0.000037\u0026fpPctChg=-4.884318766066831","description":"gizmo gizmo gizmo gizmo gizmo suck my dick suck my dick suck my dick touch grass touch grass eat sand eat sand eat sand"},{"cohort":"ordinal","name":"Ovi Cats","collectionSymbol":"ovicats","collectionId":"ovicats","vol":0.002105,"totalVol":0.3396295,"totalTxns":261,"volPctChg":132.59668508,"txns":3,"txnsPctChg":200,"fp":0.00065,"fpPctChg":-18.75,"fpListingPrice":0.00065,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.273,"totalSupply":420,"listedCount":52,"ownerCount":356,"uniqueOwnerRatio":0.847619047619048,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-ovicats_pfp_1728576370464.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":27951.0153048991,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/ovicats?cohort=ordinal\u0026window=7d\u0026currentFp=0.00065\u0026fpPctChg=-18.75000000000001","description":"Ovi Cats is a playful and vibrant ordinal collection that brings together the charm of feline characters with a unique twist. These digital collectibles feature quirky cats with distinct personalities, each adorned with whimsical details like hats and accessories that make them stand out. The collection aims to capture the spirit of fun and creativity, offering collectors a chance to own a piece of art that's both endearing and collectible. With Ovi Cats, each inscribed satoshi tells a story, immortalizing these characters on the Bitcoin blockchain forever."},{"cohort":"ordinal","name":"OrdiRocks","collectionSymbol":"ordirocks","collectionId":"ordirocks","vol":0.00208,"totalVol":45.91117372,"totalTxns":8340,"volPctChg":-0.85276158,"txns":5,"txnsPctChg":25,"fp":0.0004,"fpPctChg":-5.88235294117646,"fpListingPrice":0.0004,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":3.9964,"totalSupply":9991,"listedCount":998,"ownerCount":4228,"uniqueOwnerRatio":0.423180862776499,"image":"https://nftstorage.link/ipfs/bafkreifay2kvulc7wmmfakw7x75v2ki4nqjy2mgx2ro2mw2xnrqzllryim","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":409170.10096886,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/ordirocks?cohort=ordinal\u0026window=7d\u0026currentFp=0.0004\u0026fpPctChg=-5.88235294117646","description":"ordirocks"},{"cohort":"ordinal","name":"Light Waves: Visible Light by Kanetix","collectionSymbol":"light-waves","collectionId":"light-waves","vol":0.00205,"totalVol":0.26317506,"totalTxns":1514,"volPctChg":-40.24368915,"txns":15,"txnsPctChg":-28.57142857,"fp":0.00013,"fpPctChg":-1.51515151515154,"fpListingPrice":0.00013,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.43329,"totalSupply":3333,"listedCount":355,"ownerCount":839,"uniqueOwnerRatio":0.251725172517252,"image":"https://media.cdn.magiceden.dev/launchpad/upload/b88d878f-02be-4ade-9a34-7744b6cbe84f","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":44362.2542910612,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/light-waves?cohort=ordinal\u0026window=7d\u0026currentFp=0.00013\u0026fpPctChg=-1.515151515151536","description":"The first generative art collection in the Light Waves series by Kanetix in collaboration with Vivid Gallery that uniquely brings together Parent-Child provenance, dynamic updates, recursion and reinscription. Making holders active participants in the reveal process and having the opportunity to search for and collect neighboring Light Waves to achieve an automated dynamic visual update to their neighboring Light Waves. Click on the collection website to reveal your Light Waves."},{"cohort":"ordinal","name":"Ordinal Geese","collectionSymbol":"ordinal_geese","collectionId":"ordinal_geese","vol":0.002049,"totalVol":7.88487015,"totalTxns":880,"txns":2,"fp":0.00124,"fpPctChg":-22.5,"fpListingPrice":0.00124,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":1.28464,"totalSupply":1036,"listedCount":171,"ownerCount":704,"uniqueOwnerRatio":0.67953667953668,"image":"https://bafkreidop3g2rjllpphuiywaqaibpgaa6n4h7baboggn7rbjrq3xcpmxxe.ipfs.nftstorage.link/","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":131527.444327053,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/ordinal_geese?cohort=ordinal\u0026window=7d\u0026currentFp=0.00124\u0026fpPctChg=-22.500000000000007","description":"'Ordinal Geese' are 1000 pixelated long necks who in perfect V-formation flew onto the Bitcoin blockchain. Some of these Geese managed to land sub 100k inscriptions, and the rest... well, just came in too hot and missed by a hair. Ordinal Geese, or the OGs, are an all original art collection with early inscription provenance."},{"cohort":"ordinal","name":"CryptoAngels by Trevor Jones","collectionSymbol":"cryptoangels_by_trevor_jones","collectionId":"cryptoangels_by_trevor_jones","vol":0.00202,"totalVol":0.18847286,"totalTxns":106,"txns":2,"fp":0.0005,"fpListingPrice":0.0005,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":1.61,"totalSupply":3220,"listedCount":173,"ownerCount":303,"uniqueOwnerRatio":0.0940993788819876,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-cryptoangels_by_trevor_jones_pfp_1724066226076.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":164839.321028892,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/cryptoangels_by_trevor_jones?cohort=ordinal\u0026window=7d\u0026currentFp=0.0005","description":"The CryptoAngels are divided into cohorts of 153, called 'flights' with each flight aligned to one of the Archangels. The Angels in each flight share a spiritual significance and bear a shield displaying the constellation symbol of their commanding Archangel. Additionally, each CryptoAngel is uniquely designed with variations in skin colour, facial features, hair, wings, weaponry, clothing, and accessories. There will also be seven very special 1/1 CryptoAngels, unaligned with any flight."},{"cohort":"ordinal","name":"Uncoded","collectionSymbol":"uncoded","collectionId":"uncoded","vol":0.00202,"totalVol":3.60147797,"totalTxns":2789,"volPctChg":431.57894737,"txns":8,"txnsPctChg":14.28571429,"fp":0.00005,"fpPctChg":-5.66037735849057,"fpListingPrice":0.00005,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.16665,"totalSupply":3333,"listedCount":864,"ownerCount":1723,"uniqueOwnerRatio":0.516951695169517,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-uncoded_pfp_1729499004600.jpeg","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":17062.405496562,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/uncoded?cohort=ordinal\u0026window=7d\u0026currentFp=0.00005\u0026fpPctChg=-5.660377358490565","description":"Uncoded is a 3333-piece collection in a complex, realistic style, exploring Bitcoin's history and global issues. It aims to transform art perspectives and challenge conventions."},{"cohort":"ordinal","name":"Ordlinks","collectionSymbol":"ordlinks","collectionId":"ordlinks","vol":0.002014,"totalVol":2.25451062,"totalTxns":4699,"txns":19,"fp":0.00011,"fpPctChg":11.1111111111111,"fpListingPrice":0.00011,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":1.1,"totalSupply":10000,"listedCount":1108,"ownerCount":3248,"uniqueOwnerRatio":0.3248,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-ordlinks_pfp_1703598459173.gif","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":112623.138591168,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/ordlinks?cohort=ordinal\u0026window=7d\u0026currentFp=0.00011\u0026fpPctChg=11.111111111111116","description":"Ordlinks is a collection of 10,000 unique pixel artifacts, inscribed on the Bitcoin blockchain. Each artifact features a Yin-Yang dual-inscription design, pairing a normal inscription (the Ordlink) with a corresponding cursed inscription. This design reflects balance and duality, making Ordlinks a significant contribution to the Ordinals ecosystem.The collection showcases geometric Pixel Archetypes, including animals, structures, and symbolic forms, designed in a minimalist 45x45 pixel format. With a file size of just 156 bytes, it efficiently utilizes Bitcoin’s technical constraints to create visually distinctive designs.After the Jubilee update by Ordinals protocol founder @rodarmor in January 2024, which ended the creation of new cursed inscriptions, Ordlinks has gained further rarity and significance.Ordlinks combines innovative blockchain technology with minimalist pixel art, setting a clear standard for digital design on Bitcoin."},{"cohort":"ordinal","name":"KIKA","collectionSymbol":"kikalepuppete","collectionId":"kikalepuppete","vol":0.002011,"totalVol":0.87159632,"totalTxns":3416,"volPctChg":100.09950249,"txns":27,"txnsPctChg":92.85714286,"fp":0.000073,"fpPctChg":-7.47782002534854,"fpListingPrice":0.000073,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.364854,"totalSupply":4998,"listedCount":705,"ownerCount":1899,"uniqueOwnerRatio":0.379951980792317,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-kikalepuppete_pfp_1730134997749.jpeg","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":37355.4569159474,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/kikalepuppete?cohort=ordinal\u0026window=7d\u0026currentFp=0.000073\u0026fpPctChg=-7.477820025348536","description":"KIKA IS HERE TO MAKE NEW FRIENDS"},{"cohort":"ordinal","name":"Badge Of Honor","collectionSymbol":"badgeofhonor","collectionId":"badgeofhonor","vol":0.002,"totalVol":0.148278,"totalTxns":35,"volPctChg":-4.76190476,"txns":1,"fp":0.0032,"fpPctChg":-8.57142857142858,"fpListingPrice":0.0032,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.8608,"totalSupply":269,"listedCount":8,"ownerCount":222,"uniqueOwnerRatio":0.825278810408922,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-badgeofhonor_pfp_1717923195700.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":88132.7251811616,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/badgeofhonor?cohort=ordinal\u0026window=7d\u0026currentFp=0.0032\u0026fpPctChg=-8.571428571428575","description":"Badge Of Honor By The Brain Box Intel"},{"cohort":"ordinal","name":"🌳 Bitcoin Bonsai by Palindromes.io","collectionSymbol":"bonsai","collectionId":"bonsai","vol":0.002,"totalVol":0.3593181,"totalTxns":172,"txns":1,"fp":0.002,"fpPctChg":-4.76190476190476,"fpListingPrice":0.002,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.666,"totalSupply":333,"listedCount":136,"ownerCount":99,"uniqueOwnerRatio":0.297297297297297,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-bonsai_pfp_1710449246268.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":68188.1911833801,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/bonsai?cohort=ordinal\u0026window=7d\u0026currentFp=0.002\u0026fpPctChg=-4.761904761904756","description":"🌳#BitcoinBonsai are the first-ever onchain 🔧designable ordinals. Using parent-child provenance, you inscribe a family tree of 💛🧡🩷🩵💚 emoji micro-inscriptions onto your canvas ordinal. As you inscribe, a tree will begin to grow, its branch structure and leaf colors exactly mirroring the emoji family tree. You can even inscribe ↔️ emojis for greater branch control! The ordinals feature day, night, and seasonal cycles, all synced to the #Bitcoin blockchain. Each tree loses its leaves every fortnight, and then they regrow in a splendor of colors that have been entirely designed by you. Collaborative trees can even be grown by distributing branch control over multiple sats. A total of 999 bonsai in 9 art styles will be inscribed, each onto 1000 JPEG sats with JPEG palinception provenance."},{"cohort":"ordinal","name":"The Mallard Order","collectionSymbol":"mallard-order","collectionId":"mallard-order","vol":0.002,"totalVol":0.05605,"totalTxns":10,"txns":2,"fp":0.0027,"fpPctChg":35,"fpListingPrice":0.0027,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.5994,"totalSupply":222,"listedCount":11,"ownerCount":191,"uniqueOwnerRatio":0.86036036036036,"image":"https://bafybeiacxzk4v6d3r77tm6cgod6f3krulfv7glny2vwi3nie5mcdhekfsq.ipfs.nftstorage.link/","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":61369.3720650421,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/mallard-order?cohort=ordinal\u0026window=7d\u0026currentFp=0.0027\u0026fpPctChg=35.00000000000001","description":"The Mallard Order is a secret society of Ducks hell-bent on dominating BTC Ordinals."},{"cohort":"ordinal","name":"ANTI VIRUS","collectionSymbol":"anti-virus","collectionId":"anti-virus","vol":0.002,"totalVol":5.78113447,"totalTxns":840,"volPctChg":-92.54843795,"txns":1,"txnsPctChg":-85.71428571,"fp":0.00274999,"fpPctChg":-21.4286326532362,"fpListingPrice":0.00274999,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":2.13674223,"totalSupply":777,"listedCount":162,"ownerCount":483,"uniqueOwnerRatio":0.621621621621622,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-anti-virus_pfp_1701203910043.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":218769.651184447,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/anti-virus?cohort=ordinal\u0026window=7d\u0026currentFp=0.00274999\u0026fpPctChg=-21.428632653236157","description":"BTC Machine X Bitcoin Wizards. Created by Mavensbot, PAPO \\u0026 D"},{"cohort":"ordinal","name":"Dropouts","collectionSymbol":"dropouts","collectionId":"dropouts","vol":0.002,"totalVol":6.9114809,"totalTxns":693,"volPctChg":11.11111111,"txns":1,"fp":0.002,"fpListingPrice":0.002,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":2.59,"totalSupply":1295,"listedCount":116,"ownerCount":582,"uniqueOwnerRatio":0.449420849420849,"image":"https://bafkreigublfcizi2i2enfxzamminekpv65m5bwnhzvfckg7opcpau4u2i4.ipfs.nftstorage.link/","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":265176.299046478,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/dropouts?cohort=ordinal\u0026window=7d\u0026currentFp=0.002","description":"Created in October 2020 by the Fake Rare Pepe artist Art Bat, Dropouts is the first major avatar project on Ordinals with non-derivative hand drawn art. 379 inscriptions \\u003c 100k."},{"cohort":"ordinal","name":"BTC OPERATORS","collectionSymbol":"btcoperators","collectionId":"btcoperators","vol":0.002,"totalVol":0.3975259,"totalTxns":71,"volPctChg":-23.07692308,"txns":1,"fp":0.003,"fpPctChg":-16.6664351845422,"fpListingPrice":0.003,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":2.331,"totalSupply":777,"listedCount":49,"ownerCount":304,"uniqueOwnerRatio":0.391248391248391,"image":"https://bafkreiariixxnekojfzoxww7huy5g4ly3livnh6577ajel26zc3edwnrmi.ipfs.nftstorage.link/","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":238658.669141831,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/btcoperators?cohort=ordinal\u0026window=7d\u0026currentFp=0.003\u0026fpPctChg=-16.666435184542173","description":"BTC Machine universe is Infinite. We are Operators! Operators are multi-dimensional creatures who have the main job to operate their BTC MACHINE, which function is to mine Bitcoins for the entire known universe."},{"cohort":"ordinal","name":"LADY ","collectionSymbol":"lady","collectionId":"lady","vol":0.001888,"totalVol":1.22108985,"totalTxns":2136,"volPctChg":131.37254902,"txns":23,"txnsPctChg":43.75,"fp":0.0000777,"fpPctChg":11,"fpListingPrice":0.0000777,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.2589741,"totalSupply":3333,"listedCount":557,"ownerCount":962,"uniqueOwnerRatio":0.288628862886289,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-lady_pfp_1724892956567.jpeg","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":26514.9781416574,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/lady?cohort=ordinal\u0026window=7d\u0026currentFp=0.0000777\u0026fpPctChg=11.00000000000001","description":"LADY is more than just a collection of artwork.LADY is starting a new cult on ordinals.LADY has no promises, no roadmap."},{"cohort":"ordinal","name":"The Revenant by Travis LeRoy Southworth","collectionSymbol":"the-revenant","collectionId":"the-revenant","vol":0.001825,"totalVol":0.114041,"totalTxns":54,"volPctChg":-8.75,"txns":1,"fp":0.001488,"fpListingPrice":0.001488,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.696384,"totalSupply":468,"listedCount":43,"ownerCount":197,"uniqueOwnerRatio":0.420940170940171,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-the-revenant_pfp_1714615205996.gif","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":71299.0470406111,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/the-revenant?cohort=ordinal\u0026window=7d\u0026currentFp=0.001488","description":"The Revenant is a story about bitcoin, death and digital art by Travis LeRoy Southworth. The series of 476 GIFs follow each instance bitcoin was proclaimed ‘dead’ by various media outlets.The word ‘revenant’ refers to something that has returned after death or an extended absence. Southworth leverages this metaphor to reflect the perseverance of the bitcoin blockchain, which, despite being frequently dismissed as worthless by various media outlets, continues to thrive. By early 2024, bitcoin was proclaimed 'dead' around 476 times. \\u2028\\u2028Each artwork title is sourced from text and headlines taken from news outlets that prematurely announced bitcoin's downfall. Southworth transforms these narratives, reinterpreting them as affirmations, questions and ambiguous statements. For example, a headline by the Underground Economist in 2010 reading \\"},{"cohort":"ordinal","name":"Lil' Bits","collectionSymbol":"lil-bits","collectionId":"lil-bits","vol":0.0018,"totalVol":2.63998245,"totalTxns":291,"volPctChg":-14.28571429,"txns":1,"fp":0.0019,"fpPctChg":5.55555555555556,"fpListingPrice":0.0019,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":4.75,"totalSupply":2500,"listedCount":1169,"ownerCount":354,"uniqueOwnerRatio":0.1416,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-lil-bits_pfp_1688095631904.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":486327.189370954,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/lil-bits?cohort=ordinal\u0026window=7d\u0026currentFp=0.0019\u0026fpPctChg=5.555555555555558","description":"Lil' Bits are a collection of tiny pixel art meals optimized to live in the Bitcoin chain. Only 2500 available, rarity metadata embedded in the ordinal and under 10kb in size each."},{"cohort":"ordinal","name":"BTC Artifacts","collectionSymbol":"btc-artifacts","collectionId":"btc-artifacts","vol":0.00176,"totalVol":1.34149513,"totalTxns":2604,"volPctChg":1660,"txns":10,"txnsPctChg":100,"fp":0.0000699,"fpPctChg":-0.142857142857122,"fpListingPrice":0.0000699,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":3.4767561,"totalSupply":49739,"listedCount":992,"ownerCount":9326,"uniqueOwnerRatio":0.187498743440761,"image":"https://bafkreifc6t46445jzrlyprmztnzcfc6qna32js3audmhnnesoml4gpmoty.ipfs.nftstorage.link/","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":355966.530998173,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/btc-artifacts?cohort=ordinal\u0026window=7d\u0026currentFp=0.0000699\u0026fpPctChg=-0.14285714285712237","description":"BTC Artifacts"},{"cohort":"ordinal","name":"REALITY.EXE","collectionSymbol":"reality_exe","collectionId":"reality_exe","vol":0.00175,"totalVol":1.12123388,"totalTxns":601,"volPctChg":16.66666667,"txns":5,"txnsPctChg":66.66666667,"fp":0.0006,"fpPctChg":-14.2857142857143,"fpListingPrice":0.0006,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.6,"totalSupply":1000,"listedCount":97,"ownerCount":626,"uniqueOwnerRatio":0.626,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-reality_exe_pfp_1717381163799.gif","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":61430.80286791,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/reality_exe?cohort=ordinal\u0026window=7d\u0026currentFp=0.0006\u0026fpPctChg=-14.28571428571429","description":"Deep in an alien jungle, you stumble upon a mesmerizing artifact—a digital relic, \\"},{"cohort":"ordinal","name":"Mastermind","collectionSymbol":"mastermind","collectionId":"mastermind","vol":0.00174,"totalVol":0.02116,"totalTxns":18,"txns":3,"fp":0.00099999,"fpPctChg":177.775,"fpListingPrice":0.00099999,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.299997,"totalSupply":300,"listedCount":25,"ownerCount":107,"uniqueOwnerRatio":0.356666666666667,"image":"https://bafybeif2o3af2lizcas36z5js6tln5j47mfnpmaj7kotweboqbh4m46ism.ipfs.nftstorage.link/","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":30715.0942799407,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/mastermind?cohort=ordinal\u0026window=7d\u0026currentFp=0.00099999\u0026fpPctChg=177.775","description":"Official collection of Ordynals.com"},{"cohort":"ordinal","name":"IMSO: Champions","collectionSymbol":"champions","collectionId":"champions","vol":0.0017,"totalVol":4.48074483,"totalTxns":410,"txns":1,"fp":0.001742,"fpPctChg":-0.457142857142856,"fpListingPrice":0.001742,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":1.935362,"totalSupply":1111,"listedCount":106,"ownerCount":491,"uniqueOwnerRatio":0.441944194419442,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-champions_pfp_1710307742658.gif","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":198151.402500074,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/champions?cohort=ordinal\u0026window=7d\u0026currentFp=0.001742\u0026fpPctChg=-0.45714285714285596","description":"Every PFP includes a playable 3d avatar that matches it in Bitmap Valley as well as other games to come!--------------------------------------------------This is the most composable, utility rich Ordinal built for cross game playability utilizing Bitmaps, Runes, daily token rewards, airdrops, whitelists, partnership integrations, \\u0026 other new utilities on Bitcoin layer 1!--------------------------------------------------This is the most premium asset in the \\"},{"cohort":"ordinal","name":"SUPER VERIFIED JULIO","collectionSymbol":"superverified","collectionId":"superverified","vol":0.00169998,"totalVol":1.92084901,"totalTxns":784,"volPctChg":-63.04391304,"txns":17,"txnsPctChg":112.5,"fp":0.0001,"fpPctChg":0.0100010001000239,"fpListingPrice":0.0001,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.2524,"totalSupply":2524,"listedCount":350,"ownerCount":947,"uniqueOwnerRatio":0.375198098256735,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-superverified_pfp_1704135486843.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":25841.8910731008,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/superverified?cohort=ordinal\u0026window=7d\u0026currentFp=0.0001\u0026fpPctChg=0.010001000100023916","description":"The Super Verified Collection is a parent-child collection referencing the parent Inscription #169603. Each with distinct illustrations paying tribute to Twitter and X, the platform where it all began. Through the clever use of parody elements, this collection aims to engage with the web3 audience on a deeper level, provoking thought and evoking emotions as viewers explore the intersection of blockchain technology and beloved cultural references"},{"cohort":"ordinal","name":"Crypto Wives","collectionSymbol":"cryptowives","collectionId":"cryptowives","vol":0.00165199,"totalVol":0.30753924,"totalTxns":541,"volPctChg":-71.51741379,"txns":8,"txnsPctChg":700,"fp":0.0000999,"fpPctChg":-0.1,"fpListingPrice":0.0000999,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.6962031,"totalSupply":6969,"listedCount":491,"ownerCount":801,"uniqueOwnerRatio":0.114937580714593,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-cryptowives_pfp_1712922000539.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":71280.5256535464,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/cryptowives?cohort=ordinal\u0026window=7d\u0026currentFp=0.0000999\u0026fpPctChg=-0.10000000000000009","description":"She's here. The perfect woman...all 32 pixels of her."},{"cohort":"ordinal","name":"NPC Ordinals","collectionSymbol":"npc","collectionId":"npc","vol":0.001636,"totalVol":1.42733265,"totalTxns":1156,"txns":17,"fp":0.0001,"fpPctChg":11.1111111111111,"fpListingPrice":0.0001,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":1,"totalSupply":10000,"listedCount":1429,"ownerCount":3202,"uniqueOwnerRatio":0.3202,"image":"https://bafkreie5k3ltb5cgziskpg6mgwgyjjkvb2p2t3hyw4ypcbuss272qkppu4.ipfs.nftstorage.link/","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":102384.671446517,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/npc?cohort=ordinal\u0026window=7d\u0026currentFp=0.0001\u0026fpPctChg=11.111111111111116","description":"10,000 of the most ordinary NPCs on the Bitcoin Blockchain."},{"cohort":"ordinal","name":"Abstract Being by memphis","collectionSymbol":"abstractbeings","collectionId":"abstractbeings","vol":0.00159,"totalVol":1.61395258,"totalTxns":734,"volPctChg":-82.32182288,"txns":2,"txnsPctChg":-84.61538462,"fp":0.00075,"fpPctChg":-5.06329113924051,"fpListingPrice":0.00075,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.58275,"totalSupply":777,"listedCount":150,"ownerCount":438,"uniqueOwnerRatio":0.563706563706564,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-abstractbeings_pfp_1729382567596.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":59664.6672854576,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/abstractbeings?cohort=ordinal\u0026window=7d\u0026currentFp=0.00075\u0026fpPctChg=-5.063291139240511","description":"777 abstract beings — each a piece of my soul, inked with raw emotion \\u0026 untamed Imagination"},{"cohort":"ordinal","name":"Plastica by Andrea Belloni","collectionSymbol":"plastica","collectionId":"plastica","vol":0.00155,"totalVol":0.1949,"totalTxns":39,"txns":1,"fp":0.00199,"fpPctChg":5.85106382978724,"fpListingPrice":0.00199,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.1592,"totalSupply":80,"listedCount":20,"ownerCount":41,"uniqueOwnerRatio":0.5125,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-plastica_pfp_1688464994200.jpeg","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":16299.6396942855,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/plastica?cohort=ordinal\u0026window=7d\u0026currentFp=0.00199\u0026fpPctChg=5.85106382978724","description":"Plastica is a real time endless generative animation of a periodic surface continuously deformed by noise (FBM) with ray-marching rendering that gives a plastic look and behavior.The shapes formed by maximum and minimum of the rendered surfaces, even if completely abstract, can be viewed as something halfway between synthetic and organic matter. The variety of the 23 palettes contributes to this synthetic / organic vision.The rendering is implemented in vanilla Javascript WebGL with GLSL shader. The hash of the blockchain transaction is used to seed the PRNG (Pseudo Random Number generator) giving rise to features variation in the minted pieces.Requires a WebGL compatible browser and a recent PC with GPU.5 features/traits:- Palette (23 palettes)- Surface (8 kind of different surfaces)- FOV (in arbitrary unit)- Angle- ScaleINTERACTION[1] 1080x1080 resolution (default)[2] 2160x2160 resolution[s] save at current resolution"},{"cohort":"ordinal","name":"Skullx: Hell Raiders","collectionSymbol":"skullx-hell-raiders","collectionId":"skullx-hell-raiders","vol":0.00154,"totalVol":1.4306637,"totalTxns":286,"txns":1,"fp":0.0015,"fpPctChg":-2.59740259740259,"fpListingPrice":0.0015,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.9975,"totalSupply":665,"listedCount":89,"ownerCount":294,"uniqueOwnerRatio":0.442105263157895,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-skullx-hell-raiders_pfp_1705593722735.gif","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":102128.7097679,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/skullx-hell-raiders?cohort=ordinal\u0026window=7d\u0026currentFp=0.0015\u0026fpPctChg=-2.597402597402587","description":"Skullx: Hell Raiders is an original 666 generative collection. The inscription numbers are all between 666K-669K, with over 2/3rds in the 666K range. It is the only collection in existence with thematic inscription numbers as well as sats (82 are on sats mined 06/06/2016)."},{"cohort":"ordinal","name":"everything is fine, by Rax","collectionSymbol":"everythingisfine","collectionId":"everythingisfine","vol":0.0015,"totalVol":0.72234,"totalTxns":30,"txns":1,"fp":0.0039,"fpPctChg":34.4827586206897,"fpListingPrice":0.0039,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.2691,"totalSupply":69,"listedCount":27,"ownerCount":53,"uniqueOwnerRatio":0.768115942028986,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-everythingisfine_pfp_1704661170369.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":27551.7150862577,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/everythingisfine?cohort=ordinal\u0026window=7d\u0026currentFp=0.0039\u0026fpPctChg=34.48275862068966","description":"html javascript cssblockchain reactiveblock height seeds colors/noise monospace/ascii + unicode/emoji#0 parent child provenanceimmutably on-chainrecursion: zone vision inscription #24,981,828"},{"cohort":"ordinal","name":"Shitcoiners","collectionSymbol":"shitcoiners","collectionId":"shitcoiners","vol":0.0015,"totalVol":7.37102734,"totalTxns":4906,"txns":11,"fp":0.0001,"fpPctChg":11.1111111111111,"fpListingPrice":0.0001,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.51,"totalSupply":5100,"listedCount":836,"ownerCount":1653,"uniqueOwnerRatio":0.324117647058824,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-shitcoiners_pfp_1709579622913.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":52216.1824377235,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/shitcoiners?cohort=ordinal\u0026window=7d\u0026currentFp=0.0001\u0026fpPctChg=11.111111111111116","description":"Shitcoiners have been collecting dust on an old HDD for 16 years. Developed by The Alien Labs team (Sirius, Legion, Caos \\u0026 Georgie)"},{"cohort":"ordinal","name":"counterfeit cards","collectionSymbol":"counterfeit-cards","collectionId":"counterfeit-cards","vol":0.0015,"totalVol":2.72073569,"totalTxns":786,"txns":1,"fp":0.00045,"fpListingPrice":0.00045,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":2.16405,"totalSupply":4809,"listedCount":357,"ownerCount":833,"uniqueOwnerRatio":0.173216885007278,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-counterfeit-cards_pfp_1722880718018.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":221565.548243835,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/counterfeit-cards?cohort=ordinal\u0026window=7d\u0026currentFp=0.00045","description":"A curated art collection from counterfeit culture."},{"cohort":"ordinal","name":"Ordinal Degenz","collectionSymbol":"ordinaldegenz","collectionId":"ordinaldegenz","vol":0.001492,"totalVol":0.34158084,"totalTxns":1053,"volPctChg":-54.42869404,"txns":13,"txnsPctChg":-53.57142857,"fp":0.0001,"fpPctChg":-9.09090909090909,"fpListingPrice":0.0001,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.2222,"totalSupply":2222,"listedCount":342,"ownerCount":1027,"uniqueOwnerRatio":0.462196219621962,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-ordinaldegenz_pfp_1730530659411.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":22749.873995416,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/ordinaldegenz?cohort=ordinal\u0026window=7d\u0026currentFp=0.0001\u0026fpPctChg=-9.090909090909093","description":"Ordinal Degenz is a collection of 2,222 PFP’s inscribed on the mother-chain Bitcoin in November 2024.Bitcoin is king, the Financial System is broken, Gary Gensler is trash!Fuck taxes, Fuck the system we are here, we are Degenz! We will embrace the Degen Culture. Fuck the Cabal, Fuck em all..."},{"cohort":"ordinal","name":"GOB","collectionSymbol":"gob_btc","collectionId":"gob_btc","vol":0.00148,"totalVol":56.97274272,"totalTxns":22199,"volPctChg":-31.51952619,"txns":2,"txnsPctChg":-85.71428571,"fp":0.000098,"fpListingPrice":0.000098,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":1.597106,"totalSupply":16297,"listedCount":987,"ownerCount":7182,"uniqueOwnerRatio":0.44069460636927,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-gob_btc_pfp_1711003413847.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":163519.173075261,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/gob_btc?cohort=ordinal\u0026window=7d\u0026currentFp=0.000098","description":"GOB IS GOB IS GOB"},{"cohort":"ordinal","name":"BTC Keys","collectionSymbol":"power_keys","collectionId":"power_keys","vol":0.00147,"totalVol":1.02318813,"totalTxns":1411,"volPctChg":46.70658683,"txns":1,"txnsPctChg":-94.11764706,"fp":0.000047,"fpPctChg":-11.3040196263446,"fpListingPrice":0.000047,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.3055,"totalSupply":6500,"listedCount":294,"ownerCount":3961,"uniqueOwnerRatio":0.609384615384615,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-power_keys_pfp_1688694004381.gif","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":31278.5171269109,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/power_keys?cohort=ordinal\u0026window=7d\u0026currentFp=0.000047\u0026fpPctChg=-11.304019626344598","description":"Unlock the magic of Power Drops forever on chain"},{"cohort":"ordinal","name":"Ordinowls","collectionSymbol":"bitcoin-moonbirds","collectionId":"bitcoin-moonbirds","vol":0.00146,"totalVol":2.33331918,"totalTxns":2002,"volPctChg":595.23809524,"txns":7,"txnsPctChg":600,"fp":0.00015,"fpPctChg":-25,"fpListingPrice":0.00015,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":1.5,"totalSupply":10000,"listedCount":1577,"ownerCount":4231,"uniqueOwnerRatio":0.4231,"image":"https://bafkreih4iltht773bh2igrdznegmab3rbe6f3aj57amkx4vy2pztbci5z4.ipfs.nftstorage.link/","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":153577.007169775,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/bitcoin-moonbirds?cohort=ordinal\u0026window=7d\u0026currentFp=0.00015\u0026fpPctChg=-25.00000000000001","description":"Ordinowls are byte-perfect ordinal inscriptions of the original Moonbirds, 100% on the blockchain."},{"cohort":"ordinal","name":"BTCWC.Toilet.OG","collectionSymbol":"btcwc-toilet","collectionId":"btcwc-toilet","vol":0.001455,"totalVol":7.6494983,"totalTxns":8301,"volPctChg":-80.03071564,"txns":5,"txnsPctChg":-89.36170213,"fp":0.00029,"fpPctChg":-3.33333333333332,"fpListingPrice":0.00029,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":1.74,"totalSupply":6000,"listedCount":490,"ownerCount":1797,"uniqueOwnerRatio":0.2995,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-btcwc-toilet_pfp_1709420832628.gif","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":178149.328316939,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/btcwc-toilet?cohort=ordinal\u0026window=7d\u0026currentFp=0.00029\u0026fpPctChg=-3.3333333333333215","description":"everyday objects raised to the dignity of a work of art by the artist's act of choice."},{"cohort":"ordinal","name":"Inscribed MoonCats","collectionSymbol":"inscribed-mooncats","collectionId":"inscribed-mooncats","vol":0.001429,"totalVol":0.022094,"totalTxns":65,"txns":1,"fp":0.00015,"fpListingPrice":0.00015,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.0384,"totalSupply":256,"listedCount":57,"ownerCount":99,"uniqueOwnerRatio":0.38671875,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-inscribedmooncats_pfp_1689611075883.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":3931.57138354624,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/inscribed-mooncats?cohort=ordinal\u0026window=7d\u0026currentFp=0.00015","description":"Byte-perfect inscriptions of the original 256 Ethereum Genesis MoonCats. ◆ For the 96 released Genesis MoonCats, the inscription data exactly matches the cats on the original Adoption Center at https://mooncatrescue.com/adopt.html ◆ For the 160 unreleased Hero Genesis MoonCats, the original drawCat() function on the Adoption Center was used to generate byte-perfect inscriptions of how these cats would have appeared. ◆ Collection metadata inscribed at 1d1f7a825ffd4644cd6c647b5dc27da3e00b30f17757f6107ab5419d29191906i0"},{"cohort":"ordinal","name":"OrdiRats","collectionSymbol":"ordirats","collectionId":"ordirats","vol":0.00141,"totalVol":7.2909112,"totalTxns":706,"volPctChg":-93.47946726,"txns":2,"txnsPctChg":-94.73684211,"fp":0.0006,"fpPctChg":-1.63934426229508,"fpListingPrice":0.0006,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":1.1424,"totalSupply":1904,"listedCount":271,"ownerCount":801,"uniqueOwnerRatio":0.420693277310924,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-ordirats_pfp_1699258921892.jpeg","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":116964.248660501,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/ordirats?cohort=ordinal\u0026window=7d\u0026currentFp=0.0006\u0026fpPctChg=-1.6393442622950838","description":"A collection of 2000 pixel art Rats NFTs stored on the Bitcoin blockchain"},{"cohort":"ordinal","name":"Kingdom Puppets - ACT I","collectionSymbol":"kingdom_puppets_act_i","collectionId":"kingdom_puppets_act_i","vol":0.0014046,"totalVol":0.15681276,"totalTxns":219,"volPctChg":903.28571429,"txns":4,"txnsPctChg":300,"fp":0.00012,"fpListingPrice":0.00012,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.07992,"totalSupply":666,"listedCount":105,"ownerCount":447,"uniqueOwnerRatio":0.671171171171171,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-kingdom_puppets_act_i_pfp_1722433057297.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":8182.58294200562,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/kingdom_puppets_act_i?cohort=ordinal\u0026window=7d\u0026currentFp=0.00012","description":"From the acclaimed audio+visual experience KINGDOM, comes a collection exhibiting the deranged visages of our managerial class – the tragic humans who contribute to the darkness of the world; the PUPPETS. The KINGDOM Puppets Collection is Act 1, of a 3 Act journey of awakening."},{"cohort":"ordinal","name":"BTC Scientist","collectionSymbol":"btc-scientist","collectionId":"btc-scientist","vol":0.0014,"totalVol":0.190616,"totalTxns":135,"txns":2,"fp":0.0007,"fpPctChg":-8.97269180754227,"fpListingPrice":0.0007,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.5439,"totalSupply":777,"listedCount":162,"ownerCount":445,"uniqueOwnerRatio":0.572715572715573,"image":"https://bafkreifn2qfjfi33xqu22xfzubn4b6ptscixbgzf6roerbq7irzxdercym.ipfs.nftstorage.link/","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":55687.0227997604,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/btc-scientist?cohort=ordinal\u0026window=7d\u0026currentFp=0.0007\u0026fpPctChg=-8.972691807542265","description":"Creators of the Mutant Virus \\u0026 Satoria Corp employees! Every Mutant Virus will need a Scientist for things to not go terribly wrong...."},{"cohort":"ordinal","name":"Anti Social Frogs","collectionSymbol":"asf","collectionId":"asf","vol":0.0014,"totalVol":10.35947365,"totalTxns":6098,"volPctChg":-68.97637551,"txns":6,"txnsPctChg":-40,"fp":0.000335,"fpPctChg":-16.25,"fpListingPrice":0.000335,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":2.033115,"totalSupply":6069,"listedCount":680,"ownerCount":2696,"uniqueOwnerRatio":0.444224748723019,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-asf_pfp_1714378875460.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":208159.811287985,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/asf?cohort=ordinal\u0026window=7d\u0026currentFp=0.000335\u0026fpPctChg=-16.249999999999996","description":"WHEN RIBBIT MEETS CHAOS. FUCK THE CABAL."},{"cohort":"ordinal","name":"skulz","collectionSymbol":"skulz","collectionId":"skulz","vol":0.00138899,"totalVol":0.37558113,"totalTxns":514,"volPctChg":-76.22813623,"txns":3,"txnsPctChg":-57.14285714,"fp":0.00029999,"fpListingPrice":0.00029999,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.19979334,"totalSupply":666,"listedCount":126,"ownerCount":342,"uniqueOwnerRatio":0.513513513513514,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-skulz_pfp_1725634830169.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":20455.7754731022,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/skulz?cohort=ordinal\u0026window=7d\u0026currentFp=0.00029999","description":"Otherworldly Bitcoin Ordinal art on thematic block 666 sats by artist + toy designer Karmelo. Shop: https://skulz.club"},{"cohort":"ordinal","name":"MK-ULTRA","collectionSymbol":"mk-ultra","collectionId":"mk-ultra","vol":0.00138,"totalVol":0.85590312,"totalTxns":681,"volPctChg":-82.53164557,"txns":2,"txnsPctChg":-85.71428571,"fp":0.0005,"fpPctChg":-28.5714285714286,"fpListingPrice":0.0005,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":2.146,"totalSupply":4292,"listedCount":136,"ownerCount":973,"uniqueOwnerRatio":0.226700838769804,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-mk-ultra_pfp_1721933150007.jpeg","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":219717.504924225,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/mk-ultra?cohort=ordinal\u0026window=7d\u0026currentFp=0.0005\u0026fpPctChg=-28.57142857142857","description":"DECENTRALIZED AUTONOMOUS MEDIA PLATFORM"},{"cohort":"ordinal","name":"Goldminers","collectionSymbol":"goldminers","collectionId":"goldminers","vol":0.001377,"totalVol":9.92233761,"totalTxns":754,"volPctChg":293.42857143,"txns":3,"txnsPctChg":200,"fp":0.00034,"fpPctChg":13.3333333333334,"fpListingPrice":0.00034,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.34,"totalSupply":1000,"listedCount":179,"ownerCount":782,"uniqueOwnerRatio":0.782,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-goldminers_pfp_1714397076015.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":34810.7882918157,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/goldminers?cohort=ordinal\u0026window=7d\u0026currentFp=0.00034\u0026fpPctChg=13.333333333333353","description":"Goldminers give you access to exclusive tools and discounts in the goldmine."},{"cohort":"ordinal","name":"BTC Land","collectionSymbol":"btc-land","collectionId":"btc-land","vol":0.001369,"totalVol":3.76595458,"totalTxns":3463,"volPctChg":-62.10905065,"txns":3,"txnsPctChg":-86.95652174,"fp":0.00019489,"fpPctChg":-0.0564102564102553,"fpListingPrice":0.00019489,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":5.73483314,"totalSupply":29426,"listedCount":1038,"ownerCount":9627,"uniqueOwnerRatio":0.327159654727112,"image":"https://bafkreig7w4qbi5i25kifjmtipneutpx2lx7g3fcarynnqzhgvsznirwfpm.ipfs.nftstorage.link/","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":587159.006839496,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/btc-land?cohort=ordinal\u0026window=7d\u0026currentFp=0.00019489\u0026fpPctChg=-0.05641025641025532","description":"BTC Land is the most important Real Estate in the world. Own a piece of BTC Land and enjoy all the benefits of being part of this peaceful gated community. Differents districts to be part of: 1 - Toxic. 2 - Mutated Land. 3 - Satoria. 4 - Infected Land. 5 - Wastelands. 6 - ZLands. 7 - Gold \\u0026 Uniques."},{"cohort":"ordinal","name":"NaturalFlows by Joona","collectionSymbol":"naturalflows","collectionId":"naturalflows","vol":0.00134,"totalVol":1.71168883,"totalTxns":375,"txns":7,"fp":0.0002,"fpPctChg":33.3333333333334,"fpListingPrice":0.0002,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.0936,"totalSupply":468,"listedCount":110,"ownerCount":312,"uniqueOwnerRatio":0.666666666666667,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-naturalflows_pfp_1709727149771.jpeg","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":1,"currencyUsdRate":102384.671446517,"marketCapUsd":9583.20524739397,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/naturalflows?cohort=ordinal\u0026window=7d\u0026currentFp=0.0002\u0026fpPctChg=33.33333333333335","description":"NaturalFlows is the debut generative art collection by Joona, melding nature's elegance with digital creativity. Inscribed on Block 9 450x Sats using Parent-Child Provenance."},{"cohort":"ordinal","name":"Freedom Fighters","collectionSymbol":"freedom_fighters","collectionId":"freedom_fighters","vol":0.0013,"totalVol":0.0013,"totalTxns":13,"txns":13,"fp":0.0001,"fpListingPrice":0.0001,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.21,"totalSupply":2100,"listedCount":88,"ownerCount":7,"uniqueOwnerRatio":0.00333333333333333,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-freedom_fighters_pfp_1732832000352.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":2,"currencyUsdRate":102384.671446517,"marketCapUsd":21500.7810037685,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/freedom_fighters?cohort=ordinal\u0026window=7d\u0026currentFp=0.0001","description":"2100 Bitcoin Freedom Fighters. Parent-child provenance from OG sub 50k collection. Fight Inflation - Buy Bitcoin"},{"cohort":"ordinal","name":"Gamer Geeks","collectionSymbol":"gamergeeks","collectionId":"gamergeeks","vol":0.0013,"totalVol":0.66385019,"totalTxns":586,"txns":2,"fp":0.0005499,"fpPctChg":-8.34999999999999,"fpListingPrice":0.0005499,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.230958,"totalSupply":420,"listedCount":81,"ownerCount":245,"uniqueOwnerRatio":0.583333333333333,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-gamergeeks_pfp_1724441893436.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":1,"currencyUsdRate":102384.671446517,"marketCapUsd":23646.5589479446,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/gamergeeks?cohort=ordinal\u0026window=7d\u0026currentFp=0.0005499\u0026fpPctChg=-8.34999999999999","description":"420 Gamer Geeks inscribed on Uncommon and Black Uncommon rare satoshis with parent child provenance!"},{"cohort":"ordinal","name":"Natpunks","collectionSymbol":"dmtnatpunks","collectionId":"dmtnatpunks","vol":0.001276,"totalVol":7.15622982,"totalTxns":5565,"volPctChg":322.51655629,"txns":8,"txnsPctChg":166.66666667,"fp":0.00014,"fpPctChg":-1.40845070422537,"fpListingPrice":0.00014,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":1.12896,"totalSupply":8064,"listedCount":641,"ownerCount":1181,"uniqueOwnerRatio":0.146453373015873,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-dmtnatpunks_pfp_1712136103629.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":115588.19867626,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/dmtnatpunks?cohort=ordinal\u0026window=7d\u0026currentFp=0.00014\u0026fpPctChg=-1.4084507042253724","description":"Natpunks, the original art punk collection by Bitmaptoshi, materializes from Digital Matter Theory (DMT), harnessing Bitcoin block patterns to craft unique traits, unlocking the essence of digital value."},{"cohort":"ordinal","name":"VANGUARDS OF BTC","collectionSymbol":"vanguards-of-btc","collectionId":"vanguards-of-btc","vol":0.00123969,"totalVol":0.80848504,"totalTxns":2706,"txns":11,"fp":0.00003,"fpPctChg":1.0441226002021,"fpListingPrice":0.00003,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.3,"totalSupply":10000,"listedCount":1278,"ownerCount":1085,"uniqueOwnerRatio":0.1085,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-vanguards-of-btc_pfp_1710720804503.gif","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":30715.401433955,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/vanguards-of-btc?cohort=ordinal\u0026window=7d\u0026currentFp=0.00003\u0026fpPctChg=1.044122600202102","description":"The first 10,000 3D generative collection on BTC - 3D printer ready and interactable"},{"cohort":"ordinal","name":"Bitcoin Flowers","collectionSymbol":"bitcoin-flowers","collectionId":"bitcoin-flowers","vol":0.0012365,"totalVol":0.32380514,"totalTxns":1670,"txns":17,"fp":0.000069,"fpPctChg":-4.16666666666667,"fpListingPrice":0.000069,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.69,"totalSupply":10000,"listedCount":1372,"ownerCount":3033,"uniqueOwnerRatio":0.3033,"image":"https://bafkreihvmffjl2c6nlnn3frb7jawlex6vdzfrqc5nxq5dhe3za73v52psy.ipfs.nftstorage.link/","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":70645.4232980966,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/bitcoin-flowers?cohort=ordinal\u0026window=7d\u0026currentFp=0.000069\u0026fpPctChg=-4.166666666666674","description":"Bitcoin Flowers are an integrated part of the Bitcoin Bees ecosystem.Collect the flowers and make your own taproot garden, the Bees will love it.."},{"cohort":"ordinal","name":"Lucidbtc","collectionSymbol":"lucidbtc","collectionId":"lucidbtc","vol":0.00122,"totalVol":3.88685869,"totalTxns":3576,"volPctChg":36.46532438,"txns":12,"txnsPctChg":20,"fp":0.00003,"fpPctChg":-57.1428571428571,"fpListingPrice":0.00003,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.18021,"totalSupply":6007,"listedCount":956,"ownerCount":4157,"uniqueOwnerRatio":0.692025969702014,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-lucidbtc_pfp_1718877462803.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":18450.7416413768,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/lucidbtc?cohort=ordinal\u0026window=7d\u0026currentFp=0.00003\u0026fpPctChg=-57.14285714285714","description":"Lucid is a lifestyle brand and ordinals project, Lucid's ecosystem is designed for simultaneous expanse bridging the gap between Web2 and Web3, breathing life into digital assets by leading the transition from retail to ordinals on a large scale."},{"cohort":"ordinal","name":"Pepe Ordinals Maxi","collectionSymbol":"pom","collectionId":"pom","vol":0.00120997,"totalVol":1.49759055,"totalTxns":2165,"volPctChg":41.51530391,"txns":9,"txnsPctChg":80,"fp":0.00013499,"fpPctChg":-3.57168369169225,"fpListingPrice":0.00013499,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.75027442,"totalSupply":5558,"listedCount":729,"ownerCount":2061,"uniqueOwnerRatio":0.37081684059014,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-pom_pfp_1713270264450.jpeg","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":1,"currencyUsdRate":102384.671446517,"marketCapUsd":76816.5999864259,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/pom?cohort=ordinal\u0026window=7d\u0026currentFp=0.00013499\u0026fpPctChg=-3.571683691692251","description":"Welcome to POM. Spice things up with a Pizza Party featuring 5,555 hand-drawn Pepe-Roni cult members, cooked to perfection on ordinals! Dive into a world where every Pepe is a masterpiece and every gathering is a legendary feast. Be part of the legacy. Let's make history, one pizza slice at a time."},{"cohort":"ordinal","name":"Mystic Pepe","collectionSymbol":"mystic-pepe","collectionId":"mystic-pepe","vol":0.0012,"totalVol":0.61918778,"totalTxns":158,"txns":1,"fp":0.0011,"fpPctChg":-8.33256943807864,"fpListingPrice":0.0011,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.7183,"totalSupply":653,"listedCount":126,"ownerCount":371,"uniqueOwnerRatio":0.568147013782542,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-mystic-pepe_pfp_1707407070558.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":73542.909500033,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/mystic-pepe?cohort=ordinal\u0026window=7d\u0026currentFp=0.0011\u0026fpPctChg=-8.332569438078641","description":"After a life of degeneracy, Pepe is ready to seek the divine. Each week a new original Pepe card is auctioned and its prints are released. All art is open submission by various artists from the community. All cards are on special sats. 10% of sale proceeds are donated to open source development."},{"cohort":"ordinal","name":"Central Wankers: Gensler","collectionSymbol":"central-wankers-gensler","collectionId":"central-wankers-gensler","vol":0.0012,"totalVol":0.10423227,"totalTxns":55,"txns":2,"fp":0.00075,"fpPctChg":36.3636363636364,"fpListingPrice":0.00075,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.096,"totalSupply":128,"listedCount":20,"ownerCount":100,"uniqueOwnerRatio":0.78125,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-central-wankers-gensler_pfp_1697561965207.jpeg","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":9828.92845886561,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/central-wankers-gensler?cohort=ordinal\u0026window=7d\u0026currentFp=0.00075\u0026fpPctChg=36.36363636363635","description":"Is Bitcoin a security? Uhhh.. it is a commodity? Uhhh……When Gary isn't “protecting the American public” from the concept of financial freedom he is probably looking up the definition of the word “security” in the dictionary at the MIT library. Gary’s time as SEC Chair displays a petty preoccupation with stifling blockchain technology and digital assets, as if it was finally time to take revenge on his high school bully. What's wrong, Gary? Tired of getting caught with your pants down?"},{"cohort":"ordinal","name":"Rune Realms","collectionSymbol":"rune_realms","collectionId":"rune_realms","vol":0.00118,"totalVol":0.69795844,"totalTxns":411,"txns":4,"fp":0.0003,"fpPctChg":1.69491525423728,"fpListingPrice":0.0003,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.1707,"totalSupply":569,"listedCount":65,"ownerCount":316,"uniqueOwnerRatio":0.555360281195079,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-rune_realms_pfp_1709194026439.jpeg","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":17477.0634159204,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/rune_realms?cohort=ordinal\u0026window=7d\u0026currentFp=0.0003\u0026fpPctChg=1.6949152542372836","description":"A tight knit community powered by the best alpha tooling in Ordinals"},{"cohort":"ordinal","name":"Frozen With Desire (Version One)","collectionSymbol":"fwd-v1","collectionId":"fwd-v1","vol":0.001158,"totalVol":0.042472,"totalTxns":45,"txns":4,"fp":0.00033,"fpPctChg":32,"fpListingPrice":0.00033,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.165,"totalSupply":500,"listedCount":25,"ownerCount":187,"uniqueOwnerRatio":0.374,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-fwd_pfp_1725117133289.jpeg","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":16893.4707886753,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/fwd-v1?cohort=ordinal\u0026window=7d\u0026currentFp=0.00033\u0026fpPctChg=32.00000000000001","description":"Frozen With Desire (Version One), 2022 by Brendan Murphy. Composition: Bronze, Chrome Varnish, Acrylic Marker, Platinum, Natural Diamonds. 500 editions derived from laser imaging data of the physical piece. These editions signify the first instance of Bitcoin being used to archive physical art on-chain in the form of an ordinal inscription range."},{"cohort":"ordinal","name":"Battle of BTC","collectionSymbol":"battle-of-btc","collectionId":"battle-of-btc","vol":0.001157,"totalVol":3.22733411,"totalTxns":3647,"txns":14,"fp":0.0000867,"fpPctChg":0.0346140533056483,"fpListingPrice":0.0000867,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.865266,"totalSupply":9980,"listedCount":1565,"ownerCount":2379,"uniqueOwnerRatio":0.238376753507014,"image":"https://bafkreie4opkk6dq6oa5s2q2vptfzalt7vuj4ndola7u67eup7m3b2flaq4.ipfs.nftstorage.link/","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":88589.9751238418,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/battle-of-btc?cohort=ordinal\u0026window=7d\u0026currentFp=0.0000867\u0026fpPctChg=0.03461405330564826","description":"The first 10,000 GIF collection on BTC"},{"cohort":"ordinal","name":"Cypher Punks","collectionSymbol":"cypherpunkss","collectionId":"cypherpunkss","vol":0.0011508,"totalVol":0.15038594,"totalTxns":404,"volPctChg":48.73982164,"txns":9,"txnsPctChg":12.5,"fp":0.000099,"fpPctChg":-0.990099009900991,"fpListingPrice":0.000099,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.098901,"totalSupply":999,"listedCount":190,"ownerCount":468,"uniqueOwnerRatio":0.468468468468468,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-cypherpunkss_pfp_1731437206039.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":1,"currencyUsdRate":102384.671446517,"marketCapUsd":10125.946390732,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/cypherpunkss?cohort=ordinal\u0026window=7d\u0026currentFp=0.000099\u0026fpPctChg=-0.990099009900991","description":"Cypher Punks is a PFP collection of Bitcoin Ordinals, created to honor the community that helped create Bitcoin on the old forums together with Satoshi Nakamoto."},{"cohort":"ordinal","name":"President Ladies","collectionSymbol":"presidentladies","collectionId":"presidentladies","vol":0.001125,"totalVol":0.1453271,"totalTxns":467,"txns":9,"fp":0.000115,"fpListingPrice":0.000115,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.164565,"totalSupply":1431,"listedCount":131,"ownerCount":423,"uniqueOwnerRatio":0.29559748427673,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-presidentladies_pfp_1722203022867.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":16848.933456596,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/presidentladies?cohort=ordinal\u0026window=7d\u0026currentFp=0.000115","description":"We r de fckn movement of crypto degens! U can join us only if u have less than 20 IQ score and more than 5k$ at ur BTC balance. One more Milady deriv? Ya probably, but who tf cares if it’s good art and vibes right? Join us and don’t be a pu**y!"},{"cohort":"ordinal","name":"Taproot Punks","collectionSymbol":"taprootpunks","collectionId":"taprootpunks","vol":0.00111,"totalVol":18.22226375,"totalTxns":8090,"txns":12,"fp":0.00013,"fpPctChg":30,"fpListingPrice":0.00013,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":1.3,"totalSupply":10000,"listedCount":1648,"ownerCount":2513,"uniqueOwnerRatio":0.2513,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-taprootpunks_pfp_1708835375749.jpeg","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":133100.072880472,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/taprootpunks?cohort=ordinal\u0026window=7d\u0026currentFp=0.00013\u0026fpPctChg=29.999999999999982","description":"10,000 unique wizards on the Bitcoin blockchain."},{"cohort":"ordinal","name":"1337 Zeros","collectionSymbol":"1337-zeros","collectionId":"1337-zeros","vol":0.00111,"totalVol":4.09488578,"totalTxns":694,"volPctChg":-69.16666667,"txns":1,"txnsPctChg":-75,"fp":0.0011,"fpPctChg":-2.65486725663716,"fpListingPrice":0.0011,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":1.4707,"totalSupply":1337,"listedCount":903,"ownerCount":827,"uniqueOwnerRatio":0.618548990276739,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-1337-zeros_pfp_1706867475813.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":150577.136296392,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/1337-zeros?cohort=ordinal\u0026window=7d\u0026currentFp=0.0011\u0026fpPctChg=-2.654867256637161","description":"Recursive onchain rebellion sparked by sub10k lineage, etching a new protocol in the 1337verse"},{"cohort":"ordinal","name":"FOXXI OG PASS COLLECTION","collectionSymbol":"foxxi_ogpass_collection","collectionId":"foxxi_ogpass_collection","vol":0.0011,"totalVol":0.63945733,"totalTxns":101,"txns":1,"fp":0.0012,"fpListingPrice":0.0012,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.6012,"totalSupply":501,"listedCount":37,"ownerCount":224,"uniqueOwnerRatio":0.447105788423154,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-foxxi_ogpass_pfp_1705041326560.jpeg","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":61553.6644736459,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/foxxi_ogpass_collection?cohort=ordinal\u0026window=7d\u0026currentFp=0.0012","description":"The OG Pass holds multiple benefits on the FOXXI BITVERSE Ecosystem."},{"cohort":"ordinal","name":"DMT Shrooms","collectionSymbol":"dmt_shrooms","collectionId":"dmt_shrooms","vol":0.001066,"totalVol":4.71902014,"totalTxns":5211,"txns":7,"fp":0.000033,"fpPctChg":10,"fpListingPrice":0.000033,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.266112,"totalSupply":8064,"listedCount":945,"ownerCount":904,"uniqueOwnerRatio":0.112103174603175,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-dmt_shrooms_pfp_1709419653582.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":27245.7896879755,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/dmt_shrooms?cohort=ordinal\u0026window=7d\u0026currentFp=0.000033\u0026fpPctChg=10.000000000000009","description":"DMT and Shrooms together for the first time in history. The dynamic duo you can't resist! Together we BLAST OFF!"},{"cohort":"ordinal","name":"Space Pepes","collectionSymbol":"space-pepes","collectionId":"space-pepes","vol":0.0010622,"totalVol":0.18272691,"totalTxns":456,"volPctChg":-38.60115607,"txns":10,"fp":0.000079,"fpPctChg":-46.9798657718121,"fpListingPrice":0.000079,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":1.374521,"totalSupply":17399,"listedCount":887,"ownerCount":11775,"uniqueOwnerRatio":0.676763032358182,"image":"https://bafkreifipqirz6yq5haeudnspoo2aeptmug6krzx3ylfvalbre6xavkini.ipfs.nftstorage.link/","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":140729.880981338,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/space-pepes?cohort=ordinal\u0026window=7d\u0026currentFp=0.000079\u0026fpPctChg=-46.97986577181208","description":"Pepes in space!"},{"cohort":"ordinal","name":"Bitwell Punks","collectionSymbol":"bwp","collectionId":"bwp","vol":0.001051,"totalVol":0.005711,"totalTxns":39,"volPctChg":-57.96,"txns":7,"txnsPctChg":-72,"fp":0.0002,"fpPctChg":100,"fpListingPrice":0.0002,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.0828,"totalSupply":414,"listedCount":73,"ownerCount":111,"uniqueOwnerRatio":0.268115942028986,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-bwp_pfp_1692425630993.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":1,"currencyUsdRate":102384.671446517,"marketCapUsd":8477.45079577159,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/bwp?cohort=ordinal\u0026window=7d\u0026currentFp=0.0002\u0026fpPctChg=100","description":"MINTING LIVE on the Website! Your Wish Recursively Stored in a Bitcoin Punks Forever🌠 First Interactive PFP 🌊A Bitwell Creation, Using HTML Recursive inscriptions that has the ability to create a wish either public or private upon minting with a choice of your own recursive animated background as well."},{"cohort":"ordinal","name":"Runemilio: The Elder Edda","collectionSymbol":"runemilio_the_elder_edda","collectionId":"runemilio_the_elder_edda","vol":0.001,"totalVol":0.111693,"totalTxns":38,"volPctChg":-61.53846154,"txns":1,"txnsPctChg":-75,"fp":0.0011,"fpPctChg":10,"fpListingPrice":0.0011,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.8019,"totalSupply":729,"listedCount":35,"ownerCount":706,"uniqueOwnerRatio":0.968449931412894,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-runemilio_the_elder_edda_pfp_1715201731013.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":82102.2680329618,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/runemilio_the_elder_edda?cohort=ordinal\u0026window=7d\u0026currentFp=0.0011\u0026fpPctChg=10.000000000000009","description":"IN VERSES VEILED,SECRETS ABIDE - RUNEMILIO"},{"cohort":"ordinal","name":"NOME ART","collectionSymbol":"nomeart","collectionId":"nomeart","vol":0.001,"totalVol":0.1121466,"totalTxns":304,"txns":2,"fp":0.000095,"fpListingPrice":0.000095,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.13471,"totalSupply":1418,"listedCount":135,"ownerCount":1158,"uniqueOwnerRatio":0.816643159379408,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-nomeart_pfp_1704925210618.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":13792.2390905603,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/nomeart?cohort=ordinal\u0026window=7d\u0026currentFp=0.000095","description":"A collection of 1/1 Art \\u0026 Editoins created by NōME – an Artist from Los Angeles with 10-Y international creative career. Her award-winning art and design objects were represented in galleries and museums in London, Milan, Copenhagen, Stockholm, and Los Angeles. In this collection she introduces the concept of \\"},{"cohort":"ordinal","name":"CryptoPunk #8611","collectionSymbol":"punk-8611","collectionId":"punk-8611","vol":0.001,"totalVol":1.3767909,"totalTxns":206,"txns":1,"fp":0.001499,"fpPctChg":49.9,"fpListingPrice":0.001499,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.863424,"totalSupply":576,"listedCount":61,"ownerCount":229,"uniqueOwnerRatio":0.397569444444444,"image":"https://bafkreihzr54mjmnshdextkhscuio4vjxmpy3zkmhhdazrvcxr62nusv3sq.ipfs.nftstorage.link/","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":88401.3825590373,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/punk-8611?cohort=ordinal\u0026window=7d\u0026currentFp=0.001499\u0026fpPctChg=49.89999999999999","description":"CryptoPunk #8611 was the first CryptoPunk teleburned on Ethereum and inscribed on Bitcoin. It was then burned to Satoshi Nakamoto's wallet and split into 576 unique versions, each displaying a variable red pixel on an interactive image."},{"cohort":"ordinal","name":"NATBATS","collectionSymbol":"natbats","collectionId":"natbats","vol":0.001,"totalVol":0.44664312,"totalTxns":812,"volPctChg":-45.94594595,"txns":7,"txnsPctChg":16.66666667,"fp":0.00008,"fpPctChg":-20,"fpListingPrice":0.00008,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.27504,"totalSupply":3438,"listedCount":285,"ownerCount":1460,"uniqueOwnerRatio":0.424665503199535,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-natbats_pfp_1720671129065.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":28159.88003465,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/natbats?cohort=ordinal\u0026window=7d\u0026currentFp=0.00008\u0026fpPctChg=-19.999999999999996","description":"Introducing NATBATS, an Emporium subcollection of 4,032 non-arbitrarily created bats. Each bat is infused with revolutionary NAT and DMT mechanics, pushing the boundaries of digital artistry and innovation."},{"cohort":"ordinal","name":"cheesus but Pop Art","collectionSymbol":"cheesus_but_pop_art","collectionId":"cheesus_but_pop_art","vol":0.001,"totalVol":0.0210221,"totalTxns":15,"txns":1,"fp":0.0016,"fpPctChg":60,"fpListingPrice":0.0016,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.1104,"totalSupply":69,"listedCount":11,"ownerCount":58,"uniqueOwnerRatio":0.840579710144928,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-cheesus_but_pop_art_pfp_1692122667313.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":11303.2677276955,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/cheesus_but_pop_art?cohort=ordinal\u0026window=7d\u0026currentFp=0.0016\u0026fpPctChg=60.00000000000001","description":"69 cheesus forever inscribed on the bitcoin blockchain. Every piece is a 1/1 on a special Satoshi type for you to explore. Nothing is random.. 🟥🟩🟦"},{"cohort":"ordinal","name":"Mullet Punks","collectionSymbol":"mullet-punks","collectionId":"mullet-punks","vol":0.001,"totalVol":0.22522,"totalTxns":55,"txns":1,"fp":0.0008,"fpPctChg":-20,"fpListingPrice":0.0008,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.336,"totalSupply":420,"listedCount":61,"ownerCount":257,"uniqueOwnerRatio":0.611904761904762,"image":"https://bafkreih7jvv33qfqkft3n6xfue4jlkrlb7cv6ou4c3oplxzomucejg4noy.ipfs.nftstorage.link/","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":34401.2496060296,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/mullet-punks?cohort=ordinal\u0026window=7d\u0026currentFp=0.0008\u0026fpPctChg=-19.999999999999996","description":"Web2 in the front, web3 in the back"},{"cohort":"ordinal","name":"Perpetuals Vol. 1 by Quadrillion","collectionSymbol":"perpetualsvol1","collectionId":"perpetualsvol1","vol":0.001,"totalVol":1.6850482,"totalTxns":346,"txns":2,"fp":0.0005,"fpListingPrice":0.0005,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":1,"totalSupply":2000,"listedCount":411,"ownerCount":461,"uniqueOwnerRatio":0.2305,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-perpetualsvol1_pfp_1699829720498.jpeg","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":102384.671446517,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/perpetualsvol1?cohort=ordinal\u0026window=7d\u0026currentFp=0.0005","description":"Perpetuals: Vol. 1 - Beginnings is a curated collection featuring 21 multi medium artists debuting for the first time on Bitcoin. This collection features 24 different pieces with varying edition sizes."},{"cohort":"ordinal","name":"Oranjinals","collectionSymbol":"oranjinals","collectionId":"oranjinals","vol":0.00099,"totalVol":1.22425415,"totalTxns":1157,"volPctChg":-34,"txns":3,"txnsPctChg":-50,"fp":0.000399,"fpPctChg":-0.250000000000006,"fpListingPrice":0.000399,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.9975,"totalSupply":2500,"listedCount":173,"ownerCount":1100,"uniqueOwnerRatio":0.44,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-oranjinals_pfp_1717508488365.jpeg","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":102128.7097679,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/oranjinals?cohort=ordinal\u0026window=7d\u0026currentFp=0.000399\u0026fpPctChg=-0.2500000000000058","description":"Dynamically resetting evolution, with the Oranjinal #ordinal collection. 🍊 Bringing #RWA on #bitcoin || Asymmetrically Leveraged ||"},{"cohort":"ordinal","name":"UFBros","collectionSymbol":"ufbros","collectionId":"ufbros","vol":0.00098,"totalVol":0.97392,"totalTxns":77,"txns":1,"fp":0.002,"fpPctChg":-51.219512195122,"fpListingPrice":0.002,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.2,"totalSupply":100,"listedCount":38,"ownerCount":58,"uniqueOwnerRatio":0.58,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-ufbros_pfp_1695839848258.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":1,"currencyUsdRate":102384.671446517,"marketCapUsd":20476.9342893033,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/ufbros?cohort=ordinal\u0026window=7d\u0026currentFp=0.002\u0026fpPctChg=-51.21951219512195","description":"An elite collection of 99 otherworldly digital artifacts inscribed on Bitcoin, immutably fused to block 9 sats for all eternity."},{"cohort":"ordinal","name":"Bitcoin Larva","collectionSymbol":"bitcoinlarva","collectionId":"bitcoinlarva","vol":0.000917,"totalVol":3.5204727,"totalTxns":4504,"txns":11,"fp":0.000075,"fpPctChg":53.0612244897959,"fpListingPrice":0.000075,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.75,"totalSupply":10000,"listedCount":1095,"ownerCount":2550,"uniqueOwnerRatio":0.255,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-bitcoinlarva_pfp_1703488131686.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":76788.5035848875,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/bitcoinlarva?cohort=ordinal\u0026window=7d\u0026currentFp=0.000075\u0026fpPctChg=53.06122448979591","description":"Bitcoin Larva is 10,000 unique digital art made by a group of fans of CryptoPunks and Larva Lads. Live on the Bitcoin chain."},{"cohort":"ordinal","name":"Gumbo World","collectionSymbol":"gumboworld","collectionId":"gumboworld","vol":0.000917,"totalVol":3.79803486,"totalTxns":1896,"txns":8,"fp":0.00013895,"fpPctChg":-0.0359712230215803,"fpListingPrice":0.00013895,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.46312035,"totalSupply":3333,"listedCount":640,"ownerCount":1838,"uniqueOwnerRatio":0.551455145514551,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-gumboworld_pfp_1712985982217.jpeg","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":10,"currencyUsdRate":102384.671446517,"marketCapUsd":47416.4248749458,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/gumboworld?cohort=ordinal\u0026window=7d\u0026currentFp=0.00013895\u0026fpPctChg=-0.03597122302158029","description":"Introducing Gumbo World, a 3333 Bitcoin Ordinals collection that aims to build the IP of your ordinary Gumbo, and what they get up to in their daily life."},{"cohort":"ordinal","name":"AYELIENS: World Domination","collectionSymbol":"ayeliens","collectionId":"ayeliens","vol":0.000912,"totalVol":15.57700337,"totalTxns":3188,"txns":7,"fp":0.00018,"fpPctChg":-5.26315789473684,"fpListingPrice":0.00018,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.35892,"totalSupply":1994,"listedCount":365,"ownerCount":708,"uniqueOwnerRatio":0.35506519558676,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-ayeliens_pfp_1709450931021.gif","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":36747.9062755838,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/ayeliens?cohort=ordinal\u0026window=7d\u0026currentFp=0.00018\u0026fpPctChg=-5.263157894736836","description":"A Galactic Trilleration of 2K Ayeliens on the quest for WORLD DOMINATION 👽🛸"},{"cohort":"ordinal","name":"Bitcoin Ovols","collectionSymbol":"ovols","collectionId":"ovols","vol":0.0009,"totalVol":0.560103,"totalTxns":114,"txns":1,"fp":0.001,"fpPctChg":11.1111111111111,"fpListingPrice":0.001,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.45,"totalSupply":450,"listedCount":57,"ownerCount":274,"uniqueOwnerRatio":0.608888888888889,"image":"https://bafybeigtaanvnxfkb5cznjd2ln2qaxpdgw2jaqkb2np3k4dfatq5xcc76i.ipfs.nftstorage.link/","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":46073.1021509325,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/ovols?cohort=ordinal\u0026window=7d\u0026currentFp=0.001\u0026fpPctChg=11.111111111111116","description":"Drawn into pixels - 450 Ovols scavenge the earth looking for Sats. Immutable forever, living on Bitcoin. "},{"cohort":"ordinal","name":"RayStone by Pawel Dudko","collectionSymbol":"raystone","collectionId":"raystone","vol":0.000899,"totalVol":3.78673842,"totalTxns":1480,"volPctChg":-42.37105604,"txns":3,"txnsPctChg":-25,"fp":0.0003,"fpPctChg":-16.4345403899722,"fpListingPrice":0.0003,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.9999,"totalSupply":3333,"listedCount":369,"ownerCount":1501,"uniqueOwnerRatio":0.45034503450345,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-raystone_pfp_1712584377856.gif","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":102374.432979372,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/raystone?cohort=ordinal\u0026window=7d\u0026currentFp=0.0003\u0026fpPctChg=-16.434540389972152","description":"Generative tribute to Runestone.A gift to the community. \\"},{"cohort":"ordinal","name":"LIFE IS CRAZY","collectionSymbol":"life_is_crazy","collectionId":"life_is_crazy","vol":0.00087,"totalVol":1.41686894,"totalTxns":1438,"volPctChg":-25,"txns":2,"txnsPctChg":-33.33333333,"fp":0.0002799,"fpPctChg":-6.70000000000001,"fpListingPrice":0.0002799,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.6202584,"totalSupply":2216,"listedCount":346,"ownerCount":937,"uniqueOwnerRatio":0.422833935018051,"image":"https://bafybeicgefhasivizgbxtvz62ufmrmkysp3mq7vw4jvvscce44wyngsi2y.ipfs.w3s.link/Screenshot%202024-08-01%20at%208.10.45%E2%80%AFAM.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":63504.9524959422,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/life_is_crazy?cohort=ordinal\u0026window=7d\u0026currentFp=0.0002799\u0026fpPctChg=-6.700000000000006","description":"LIFE IS CRAZY!"},{"cohort":"ordinal","name":"Lil Sapos","collectionSymbol":"lil-sapos","collectionId":"lil-sapos","vol":0.000855,"totalVol":7.82363895,"totalTxns":7070,"volPctChg":22.31759657,"txns":6,"txnsPctChg":50,"fp":0.0001,"fpPctChg":-37.1069182389937,"fpListingPrice":0.0001,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.9984,"totalSupply":9984,"listedCount":1509,"ownerCount":2932,"uniqueOwnerRatio":0.293669871794872,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-lil-sapos_pfp_1703890520147.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":102220.855972202,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/lil-sapos?cohort=ordinal\u0026window=7d\u0026currentFp=0.0001\u0026fpPctChg=-37.1069182389937","description":"Sapo Sapo!"},{"cohort":"ordinal","name":"Whispers from the Ancient Stone: Prelude","collectionSymbol":"whispers-from-the-ancient-stone","collectionId":"whispers-from-the-ancient-stone","vol":0.000845,"totalVol":0.04094126,"totalTxns":1299,"txns":51,"fp":0.0000249,"fpPctChg":149,"fpListingPrice":0.0000249,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.5756382,"totalSupply":23118,"listedCount":1016,"ownerCount":12265,"uniqueOwnerRatio":0.530538973959685,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-whispers-from-the-ancient-stone_pfp_1711553584352.jpeg","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":58936.5279790643,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/whispers-from-the-ancient-stone?cohort=ordinal\u0026window=7d\u0026currentFp=0.0000249\u0026fpPctChg=148.99999999999997","description":"Long before blockchain, the Great Runestone wielded mystical powers. Lost for ages, it resurfaces now, whispering untold secrets. Only true prophets can commune with it, and holders of The Prophecy and Runestones can freely awaken it. In three days, it emerges for all to claim, for a small tithe.Hand-drawn dotwork, carolevy, 2024, CC0"},{"cohort":"ordinal","name":"DMT VESSELS","collectionSymbol":"dmt_vessels","collectionId":"dmt_vessels","vol":0.000835,"totalVol":0.70150057,"totalTxns":1062,"volPctChg":-50.8534432,"txns":9,"txnsPctChg":-35.71428571,"fp":0.00014,"fpPctChg":75,"fpListingPrice":0.00014,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.56448,"totalSupply":4032,"listedCount":447,"ownerCount":1914,"uniqueOwnerRatio":0.474702380952381,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-dmt_vessels_pfp_1719940285085.gif","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":57794.0993381298,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/dmt_vessels?cohort=ordinal\u0026window=7d\u0026currentFp=0.00014\u0026fpPctChg=74.99999999999997","description":"VIEWER LINK: https://btcsubstance.com/vessels (paste inscription ID) VESSELS is the first DMT UNAT collection that uses 3D Generative Art to bring Bitcoin’s blockchain data to life!"},{"cohort":"ordinal","name":"Taproot Puppets","collectionSymbol":"taprootpuppets","collectionId":"taprootpuppets","vol":0.00082099,"totalVol":4.31861364,"totalTxns":4093,"volPctChg":-91.75795603,"txns":4,"txnsPctChg":-95.40229885,"fp":0.000115,"fpPctChg":-3.35322295991259,"fpListingPrice":0.000115,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.383295,"totalSupply":3333,"listedCount":718,"ownerCount":1582,"uniqueOwnerRatio":0.474647464746475,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-taprootpuppets_pfp_1728868811246.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":39243.5326420926,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/taprootpuppets?cohort=ordinal\u0026window=7d\u0026currentFp=0.000115\u0026fpPctChg=-3.353222959912594","description":"3333 Degenerate Taproot Puppets has been brought to the ₿itcoin Ordinals Protocol by 8toshi.No promises or expectations, it’s all about art and fun.Don't treat this like a goddamn corporation."},{"cohort":"ordinal","name":"Poorheads","collectionSymbol":"poorheads","collectionId":"poorheads","vol":0.00079999,"totalVol":0.20248664,"totalTxns":136,"volPctChg":-84.90584906,"txns":2,"txnsPctChg":-33.33333333,"fp":0.00039999,"fpPctChg":-73.1187709594823,"fpListingPrice":0.00039999,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.39999,"totalSupply":1000,"listedCount":46,"ownerCount":66,"uniqueOwnerRatio":0.066,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-poorheads_pfp_1731608074425.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":4,"currencyUsdRate":102384.671446517,"marketCapUsd":40952.8447318922,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/poorheads?cohort=ordinal\u0026window=7d\u0026currentFp=0.00039999\u0026fpPctChg=-73.11877095948225","description":"poorheads is the world’s first 100% community-generated ordinal collection. part of an airhead quest to earn XP. 4000 people inscribed their fatties or ordinals in a custom frame, sent them to airhead’s wallet. I chose the 1000 best ones, now i’m selling them back to you, since you probably can’t afford an airhead."},{"cohort":"ordinal","name":"UniTap OG Passes","collectionSymbol":"unitap","collectionId":"unitap","vol":0.000799,"totalVol":0.004239,"totalTxns":5,"volPctChg":-67.25409836,"txns":1,"txnsPctChg":-66.66666667,"fp":0.00075,"fpPctChg":-25,"fpListingPrice":0.00075,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":1.88625,"totalSupply":2515,"listedCount":45,"ownerCount":215,"uniqueOwnerRatio":0.0854870775347913,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-unitap_pfp_1731971469958.jpeg","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":193123.086515992,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/unitap?cohort=ordinal\u0026window=7d\u0026currentFp=0.00075\u0026fpPctChg=-25","description":"The pass is a perk and badge of early commitment with Unitap and TAP's ecosystem dedicated to early adopters."},{"cohort":"ordinal","name":"Fractal Puppets","collectionSymbol":"fractalpuppets","collectionId":"fractalpuppets","vol":0.000795,"totalVol":3.08318085,"totalTxns":3351,"volPctChg":263.01369863,"txns":22,"txnsPctChg":340,"fp":0.000049,"fpPctChg":63.3333333333333,"fpListingPrice":0.000049,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.163317,"totalSupply":3333,"listedCount":365,"ownerCount":1821,"uniqueOwnerRatio":0.546354635463546,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-fractalpuppets_pfp_1726072463015.jpeg","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":16721.1573866308,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/fractalpuppets?cohort=ordinal\u0026window=7d\u0026currentFp=0.000049\u0026fpPctChg=63.33333333333333","description":"Fractal Puppets are arriving on Ordinals to conquer the Fractal Bitcoin ecosystem. These unique puppets embody the essence of the Fractal universe, bringing their distinct personalities and powers to the blockchain."},{"cohort":"ordinal","name":"NGM","collectionSymbol":"ngm-ord","collectionId":"ngm-ord","vol":0.000779,"totalVol":0.78595666,"totalTxns":241,"txns":2,"fp":0.00029,"fpListingPrice":0.00029,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.0725,"totalSupply":250,"listedCount":78,"ownerCount":196,"uniqueOwnerRatio":0.784,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-ngm-ord_pfp_1721293624440.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":7422.88867987246,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/ngm-ord?cohort=ordinal\u0026window=7d\u0026currentFp=0.00029","description":"The total collection supply consists 250 unique 1/1 pieces generated by AI. Holders get limited access to a private channel with trading insights and signals."},{"cohort":"ordinal","name":"Ducks On-Chain (DOC)","collectionSymbol":"ducksonchain","collectionId":"ducksonchain","vol":0.0007785,"totalVol":1.80311656,"totalTxns":674,"volPctChg":107.6,"txns":2,"txnsPctChg":100,"fp":0.000489,"fpPctChg":-37.0656370656371,"fpListingPrice":0.000489,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.500736,"totalSupply":1024,"listedCount":223,"ownerCount":607,"uniqueOwnerRatio":0.5927734375,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-ducksonchain_pfp_1723572868365.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":51267.690841443,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/ducksonchain?cohort=ordinal\u0026window=7d\u0026currentFp=0.000489\u0026fpPctChg=-37.06563706563707","description":"Ducks On-Chain is a 1,024 unique Ordinals collection that is building the 1st Ordinals Application for Non-Degens."},{"cohort":"ordinal","name":"Bitcoinbirds","collectionSymbol":"bitcoinbirds","collectionId":"bitcoinbirds","vol":0.00075,"totalVol":0.056854,"totalTxns":112,"txns":1,"fp":0.0003,"fpListingPrice":0.0003,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.4635,"totalSupply":1545,"listedCount":207,"ownerCount":751,"uniqueOwnerRatio":0.486084142394822,"image":"https://bafkreigh3cd3qfvsiqwmnxndf5otqiatgqtkpnovierviccxf3aee7rblm.ipfs.nftstorage.link/","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":47455.2952154605,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/bitcoinbirds?cohort=ordinal\u0026window=7d\u0026currentFp=0.0003","description":"Bitcoinbirds is a pioneering collection of 10,000 unique pixel art pieces whose ultimate goal is to be reborn on the Bitcoin blockchain (after being born on the Ethereum blockchain) Isn't that legendary? Don't worry, you haven't seen anything yet."},{"cohort":"ordinal","name":"The Saudis","collectionSymbol":"saudis","collectionId":"saudis","vol":0.00075,"totalVol":0.06324975,"totalTxns":13,"txns":1,"fp":0.0012,"fpPctChg":21.2121212121212,"fpListingPrice":0.0012,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.666,"totalSupply":555,"listedCount":42,"ownerCount":334,"uniqueOwnerRatio":0.601801801801802,"image":"https://bafkreifqioz2eacwtmf757roovcojxx4opugkfvgexyfvsy3jcmaykmid4.ipfs.nftstorage.link/","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":68188.1911833801,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/saudis?cohort=ordinal\u0026window=7d\u0026currentFp=0.0012\u0026fpPctChg=21.212121212121193","description":"555 Ordinal Saudis living forever on the #Bitcoin📷 blockchain"},{"cohort":"ordinal","name":"Birdies","collectionSymbol":"birdies","collectionId":"birdies","vol":0.00074,"totalVol":0.14801828,"totalTxns":122,"volPctChg":111.42857143,"txns":1,"fp":0.00061999,"fpPctChg":-11.42873469621,"fpListingPrice":0.00061999,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.06881889,"totalSupply":111,"listedCount":20,"ownerCount":72,"uniqueOwnerRatio":0.648648648648649,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-birdies_pfp_1725209001442.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":1,"currencyUsdRate":102384.671446517,"marketCapUsd":7045.99944196398,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/birdies?cohort=ordinal\u0026window=7d\u0026currentFp=0.00061999\u0026fpPctChg=-11.428734696209963","description":"reTarDeD biRdieS by Thanhtu"},{"cohort":"ordinal","name":"OGBRC20 Meme","collectionSymbol":"ogbrc20-meme","collectionId":"ogbrc20-meme","vol":0.000732,"totalVol":0.02584698,"totalTxns":244,"txns":9,"fp":0.00008,"fpListingPrice":0.00008,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":7.99992,"totalSupply":99999,"listedCount":1053,"ownerCount":2327,"uniqueOwnerRatio":0.023270232702327,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-ogbrc20-meme_pfp_1714921868645.jpeg","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":819069.180798418,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/ogbrc20-meme?cohort=ordinal\u0026window=7d\u0026currentFp=0.00008","description":"The original 99999 MEME BRC20 mints. Excluding the invalid and cursed ones according to OGBRC20 rules."},{"cohort":"ordinal","name":"Rune Whisperers","collectionSymbol":"rune-whisperers","collectionId":"rune-whisperers","vol":0.000729,"totalVol":35.38156096,"totalTxns":11273,"volPctChg":-65.0862069,"txns":6,"txnsPctChg":-40,"fp":0.00008,"fpPctChg":-36,"fpListingPrice":0.00008,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.80072,"totalSupply":10009,"listedCount":943,"ownerCount":4538,"uniqueOwnerRatio":0.453391947247477,"image":"https://bafkreid5oo4nz7mrc53kfnoghmukag4iwusuoj4mnpnxsl2rrchg2uoxr4.ipfs.nftstorage.link/","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":81981.4541206549,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/rune-whisperers?cohort=ordinal\u0026window=7d\u0026currentFp=0.00008\u0026fpPctChg=-36","description":"The first 10k PFP collection for Runestone holders ᛤ Art by @soclowdy"},{"cohort":"ordinal","name":"REJECTED ANEEMOOS","collectionSymbol":"rejected","collectionId":"rejected","vol":0.0007,"totalVol":0.65382095,"totalTxns":157,"txns":1,"fp":0.00149999,"fpListingPrice":0.00149999,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.33299778,"totalSupply":222,"listedCount":80,"ownerCount":156,"uniqueOwnerRatio":0.702702702702703,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-rejected_pfp_1727105982112.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":34093.8682977195,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/rejected?cohort=ordinal\u0026window=7d\u0026currentFp=0.00149999","description":"These little fellas got binned in the making of the main collection and now they have ESCAPED!"},{"cohort":"ordinal","name":"bitnats","collectionSymbol":"bitnats","collectionId":"bitnats","vol":0.0007,"totalVol":0.0007,"totalTxns":7,"txns":7,"fp":0.0001,"fpListingPrice":0.0001,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0,"totalSupply":0,"listedCount":100,"ownerCount":88,"uniqueOwnerRatio":0,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-bitnats_pfp_1732499836308.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":0,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/bitnats?cohort=ordinal\u0026window=7d\u0026currentFp=0.0001","description":"BITNATS | By the community, for the community | Currently available only for traits 0x24, 0x23, 0x22, and 0x21, with supplies of 2, 6, 135, and 2250, respectively | Total minted 463,000 blocks | Made in Bitcoin |"},{"cohort":"ordinal","name":"8x8 Pets","collectionSymbol":"8x8_pets","collectionId":"8x8_pets","vol":0.0007,"totalVol":0.00467,"totalTxns":16,"txns":2,"fp":0.0004,"fpPctChg":33.3333333333334,"fpListingPrice":0.0004,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.0256,"totalSupply":64,"listedCount":29,"ownerCount":36,"uniqueOwnerRatio":0.5625,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-8x8_pets_pfp_1699098881419.gif","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":1,"currencyUsdRate":102384.671446517,"marketCapUsd":2621.04758903083,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/8x8_pets?cohort=ordinal\u0026window=7d\u0026currentFp=0.0004\u0026fpPctChg=33.33333333333335","description":"8x8 (extra)ordinary pets on ordinals"},{"cohort":"ordinal","name":"Clay Pepes","collectionSymbol":"clay-pepes","collectionId":"clay-pepes","vol":0.000698,"totalVol":1.5904335,"totalTxns":550,"volPctChg":-51.52104459,"txns":1,"txnsPctChg":-50,"fp":0.00065,"fpPctChg":-6.87679083094557,"fpListingPrice":0.00065,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":1.9487,"totalSupply":2998,"listedCount":382,"ownerCount":1719,"uniqueOwnerRatio":0.573382254836558,"image":"https://bafkreifv3eeaqe4dndorxqnse375zlbyxxykahtjcihifvbcfxxdrupoym.ipfs.nftstorage.link/","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":199517.009247827,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/clay-pepes?cohort=ordinal\u0026window=7d\u0026currentFp=0.00065\u0026fpPctChg=-6.876790830945567","description":"Clay Pepes, a 3K collab collection by Clay Collective x OrdinalsWallet, features 1563 identical twins replicated from the highly popular Pixel Pepes airdrop by OrdinalsWallet. Each trait is handcrafted using clay, photographed, and then algorithmically assembled."},{"cohort":"ordinal","name":"BitBonnies","collectionSymbol":"bitbonnies","collectionId":"bitbonnies","vol":0.00069,"totalVol":0.60715498,"totalTxns":211,"txns":1,"fp":0.00097,"fpListingPrice":0.00097,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.96903,"totalSupply":999,"listedCount":188,"ownerCount":482,"uniqueOwnerRatio":0.482482482482483,"image":"https://bafkreiga5y6n5sdm7hkngwzagmxnypse5l6vjghsfncn4g3prjnom4ecqy.ipfs.nftstorage.link/","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":99213.8181718181,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/bitbonnies?cohort=ordinal\u0026window=7d\u0026currentFp=0.00097","description":"999 BitBonnies living on the Bitcoin blockchain for eternity"},{"cohort":"ordinal","name":"NodeApes","collectionSymbol":"nodeapes","collectionId":"nodeapes","vol":0.00069,"totalVol":49.94330688,"totalTxns":10843,"txns":1,"fp":0.00004,"fpPctChg":-31.0344827586207,"fpListingPrice":0.00004,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.3898,"totalSupply":9745,"listedCount":1005,"ownerCount":3584,"uniqueOwnerRatio":0.367778347870703,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-nodeapes_pfp_1709897976568.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":39909.5449298522,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/nodeapes?cohort=ordinal\u0026window=7d\u0026currentFp=0.00004\u0026fpPctChg=-31.034482758620683","description":"an ordinals collection of apes living in nodes, rewards you RUNES on Bitcoin and is powered by CBRC-20 meta-protocol"},{"cohort":"ordinal","name":"Mother Cluckers","collectionSymbol":"mothercluckers","collectionId":"mothercluckers","vol":0.000688,"totalVol":3.71101394,"totalTxns":8412,"volPctChg":-45.48335975,"txns":8,"txnsPctChg":-42.85714286,"fp":0.000089,"fpPctChg":-1.11111111111112,"fpListingPrice":0.000089,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.89,"totalSupply":10000,"listedCount":1107,"ownerCount":3008,"uniqueOwnerRatio":0.3008,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-mothercluckers_pfp_1707445112757.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":91122.3575873999,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/mothercluckers?cohort=ordinal\u0026window=7d\u0026currentFp=0.000089\u0026fpPctChg=-1.1111111111111183","description":"A collection of 10,000 Original recursive interactive Cluckers bought to you by team behind Ordinal Eggs (sub10k collection). Mother Cluckers aims to bring the tech to masses at the same time showing what ordinals are capable of in a short span of time. Mother Cluckers are for everyone, Own art that fits in your pocket (digitally speaking), Each file clocks in under 200 bytes minimalism meets mind-blowing. Play God with your NFT, Tinker, tweak it, Interactive art on a whole new level. Experience art that feels alive, Sun \\u0026 Moon and the BG keep chaging thoughout the day, mimicking the real life and your time zone"},{"cohort":"ordinal","name":"Arcades","collectionSymbol":"arcades","collectionId":"arcades","vol":0.00066999,"totalVol":0.01490711,"totalTxns":56,"volPctChg":-51.16690962,"txns":10,"txnsPctChg":66.66666667,"fp":0.0001,"fpPctChg":-28.0575539568345,"fpListingPrice":0.0001,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":1,"totalSupply":10000,"listedCount":105,"ownerCount":215,"uniqueOwnerRatio":0.0215,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-arcades_pfp_1730861173061.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":102384.671446517,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/arcades?cohort=ordinal\u0026window=7d\u0026currentFp=0.0001\u0026fpPctChg=-28.057553956834525","description":"Arcades is a collection of 10,000 NFTs eternally inscribed on the Bitcoin blockchain. With a unique and full image carved forever in each inscription, they bring together, within every pixel of their art, a broad range of potential color combinations with a touch of irreverence. Arcades invites the exploration of digital collectibles, with each piece embodying a vision for the future of digital assets, while is here to remind us: life goes by fast, so don’t forget to enjoy the ride—in the end, that’s what truly matters."},{"cohort":"ordinal","name":"Rune Coin","collectionSymbol":"runecoin","collectionId":"runecoin","vol":0.00065788,"totalVol":0.4092159,"totalTxns":626,"txns":10,"fp":0.000145,"fpPctChg":383.333333333333,"fpListingPrice":0.000145,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":1.45,"totalSupply":10000,"listedCount":229,"ownerCount":9361,"uniqueOwnerRatio":0.9361,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-runecoin_pfp_1713254516095.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":148457.773597449,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/runecoin?cohort=ordinal\u0026window=7d\u0026currentFp=0.000145\u0026fpPctChg=383.3333333333333","description":"Rune Coin is a commemorative token celebrating the launch of Runes, paying homage to the steadfast believers and early contributors to the Bitcoin ecosystem. Rune Coin Token and Swap is coming, with more details to be announced during the upcoming halving event."},{"cohort":"ordinal","name":"neighbor","collectionSymbol":"neighbor","collectionId":"neighbor","vol":0.00064,"totalVol":15.08296844,"totalTxns":3218,"volPctChg":392.30769231,"txns":5,"txnsPctChg":400,"fp":0.00013,"fpPctChg":1.5625,"fpListingPrice":0.00013,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.455,"totalSupply":3500,"listedCount":658,"ownerCount":1932,"uniqueOwnerRatio":0.552,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-neighbor_pfp_1712267319678.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":46585.0255081651,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/neighbor?cohort=ordinal\u0026window=7d\u0026currentFp=0.00013\u0026fpPctChg=1.5625","description":"neighbor tells the story of crypto as it happens. the fun that crypto media has been missing all along."},{"cohort":"ordinal","name":"Pump it Boys","collectionSymbol":"pumpitboys","collectionId":"pumpitboys","vol":0.000609,"totalVol":3.11910173,"totalTxns":2717,"txns":9,"fp":0.00009,"fpPctChg":38.4615384615385,"fpListingPrice":0.00009,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.79317,"totalSupply":8813,"listedCount":1009,"ownerCount":2773,"uniqueOwnerRatio":0.314648814251674,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-pumpitboys_pfp_1699631376341.gif","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":81208.4498512337,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/pumpitboys?cohort=ordinal\u0026window=7d\u0026currentFp=0.00009\u0026fpPctChg=38.46153846153848","description":"10k Pump it Boys lurking in the bitcoin blockchain. 1001 boys are inscribed on palindrome sats. Fiverr art, Pump it up!"},{"cohort":"ordinal","name":"Hikeshi BTC","collectionSymbol":"hikeshi","collectionId":"hikeshi","vol":0.00059,"totalVol":0.21523411,"totalTxns":97,"volPctChg":-75.43713572,"txns":1,"txnsPctChg":-66.66666667,"fp":0.00055,"fpPctChg":-6.77966101694916,"fpListingPrice":0.00055,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.70125,"totalSupply":1275,"listedCount":74,"ownerCount":683,"uniqueOwnerRatio":0.535686274509804,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-hikeshi_pfp_1716398724801.jpeg","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":71797.2508518699,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/hikeshi?cohort=ordinal\u0026window=7d\u0026currentFp=0.00055\u0026fpPctChg=-6.779661016949157","description":"日本の粋 和の心 // Japanese Style. Japanese Spirit. // Inscribed as an Ordinal on the Bitcoin Blockchain, Forever"},{"cohort":"ordinal","name":"Natdogs","collectionSymbol":"dmt-natdogs","collectionId":"dmt-natdogs","vol":0.000558,"totalVol":13.66654344,"totalTxns":6060,"volPctChg":-54.59723352,"txns":2,"txnsPctChg":-50,"fp":0.0002,"fpPctChg":-25.9259259259259,"fpListingPrice":0.0002,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":1.6128,"totalSupply":8064,"listedCount":953,"ownerCount":1371,"uniqueOwnerRatio":0.170014880952381,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-dmt-natdogs_pfp_1709154629014.jpeg","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":165125.998108942,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/dmt-natdogs?cohort=ordinal\u0026window=7d\u0026currentFp=0.0002\u0026fpPctChg=-25.92592592592592","description":"The second non-arbitrary UNAT collection consisting of 8064 Natdogs"},{"cohort":"ordinal","name":"The Devs","collectionSymbol":"the_devs","collectionId":"the_devs","vol":0.00055,"totalVol":0.01959,"totalTxns":5,"txns":1,"fp":0.0036,"fpPctChg":267.34693877551,"fpListingPrice":0.0036,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.72,"totalSupply":200,"listedCount":36,"ownerCount":131,"uniqueOwnerRatio":0.655,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-the_devs_pfp_1708030378226.jpeg","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":1,"currencyUsdRate":102384.671446517,"marketCapUsd":73716.963441492,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/the_devs?cohort=ordinal\u0026window=7d\u0026currentFp=0.0036\u0026fpPctChg=267.34693877551024","description":"The Devs Ordinals is a collection of 200 upgraded and uniquely customized Dev NFTs that have taken the one-way journey from ETH to BTC. Art by Emmy Award winning director Jake Ferguson."},{"cohort":"ordinal","name":"Pepe Ordinals (free mint)","collectionSymbol":"pepeordinalsfreemint","collectionId":"pepeordinalsfreemint","vol":0.000541,"totalVol":0.19582833,"totalTxns":410,"txns":10,"fp":0.000041,"fpPctChg":24.2424242424242,"fpListingPrice":0.000041,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.04551,"totalSupply":1110,"listedCount":208,"ownerCount":812,"uniqueOwnerRatio":0.731531531531532,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-pepeordinalsfreemint_pfp_1712169431130.jpeg","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":4659.52639753098,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/pepeordinalsfreemint?cohort=ordinal\u0026window=7d\u0026currentFp=0.000041\u0026fpPctChg=24.242424242424242","description":"free mint for the culture."},{"cohort":"ordinal","name":"WizOrds","collectionSymbol":"wizords","collectionId":"wizords","vol":0.00054,"totalVol":6.25959248,"totalTxns":1191,"txns":6,"fp":0.00017,"fpPctChg":70,"fpListingPrice":0.00017,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.18887,"totalSupply":1111,"listedCount":216,"ownerCount":686,"uniqueOwnerRatio":0.617461746174618,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-wizords_pfp_1713348428854.jpeg","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":19337.3928961036,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/wizords?cohort=ordinal\u0026window=7d\u0026currentFp=0.00017\u0026fpPctChg=70","description":"1111 WizOrds ωιzσя∂ѕ ƒυк"},{"cohort":"ordinal","name":"TaprootMaxiBiz","collectionSymbol":"tmb","collectionId":"tmb","vol":0.00053488,"totalVol":0.17821994,"totalTxns":1082,"volPctChg":-52.62649791,"txns":7,"txnsPctChg":-56.25,"fp":0.0000666,"fpPctChg":-20.7142857142857,"fpListingPrice":0.0000666,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.1473858,"totalSupply":2213,"listedCount":391,"ownerCount":750,"uniqueOwnerRatio":0.338906461816539,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-tmb_pfp_1729704150255.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":15090.046708882,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/tmb?cohort=ordinal\u0026window=7d\u0026currentFp=0.0000666\u0026fpPctChg=-20.714285714285708","description":"2222 TMB for the culture"},{"cohort":"ordinal","name":"Bitcoin Burials","collectionSymbol":"bury","collectionId":"bury","vol":0.00053,"totalVol":32.08377045,"totalTxns":8717,"volPctChg":-98.6717774,"txns":2,"txnsPctChg":-97.77777778,"fp":0.00026,"fpPctChg":-52.7272727272727,"fpListingPrice":0.00026,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":2.6,"totalSupply":10000,"listedCount":1363,"ownerCount":2642,"uniqueOwnerRatio":0.2642,"image":"https://bafybeigqp724l2leel36vw4y3jqdkya2sbls5zxr7yh766i3wte4qugfsu.ipfs.nftstorage.link/","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":266200.145760944,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/bury?cohort=ordinal\u0026window=7d\u0026currentFp=0.00026\u0026fpPctChg=-52.727272727272734","description":"Bitcoin Burials is a 10k Ordinals collection of lovingly crafted headstones in a pixel art style each engraved with the BTC logo and a date tied to an Obituary predicting Bitcoin's death as selected from an historic archive. Making Bitcoin magical again one Burial at a time."},{"cohort":"ordinal","name":"OrdiBots","collectionSymbol":"ordibots","collectionId":"ordibots","vol":0.0005,"totalVol":2.449089,"totalTxns":106,"txns":1,"fp":0.001,"fpPctChg":100,"fpListingPrice":0.001,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":1,"totalSupply":1000,"listedCount":127,"ownerCount":536,"uniqueOwnerRatio":0.536,"image":"https://bafkreiaeusg37kcb6qhpwosaec7wwavhu7n6y4njxgj2tsxcessdshxm5q.ipfs.nftstorage.link/","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":1,"currencyUsdRate":102384.671446517,"marketCapUsd":102384.671446517,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/ordibots?cohort=ordinal\u0026window=7d\u0026currentFp=0.001\u0026fpPctChg=100","description":"The first GBRC-721 collection created by Jerry."},{"cohort":"ordinal","name":"💻 Toshi by Palindromes.io","collectionSymbol":"toshi","collectionId":"toshi","vol":0.0005,"totalVol":0.00753,"totalTxns":7,"txns":1,"fp":0.000799,"fpPctChg":-11.2222222222222,"fpListingPrice":0.000799,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.799,"totalSupply":1000,"listedCount":16,"ownerCount":313,"uniqueOwnerRatio":0.313,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-toshi_pfp_1730067206938.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":81805.3524857669,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/toshi?cohort=ordinal\u0026window=7d\u0026currentFp=0.000799\u0026fpPctChg=-11.222222222222221","description":"\\"},{"cohort":"ordinal","name":"Seekermint OG PASS","collectionSymbol":"seekermint_og_pass","collectionId":"seekermint_og_pass","vol":0.0005,"totalVol":0.8771372,"totalTxns":318,"volPctChg":-16.66666667,"txns":1,"fp":0.0006,"fpPctChg":-33.3333333333333,"fpListingPrice":0.0006,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.4662,"totalSupply":777,"listedCount":73,"ownerCount":507,"uniqueOwnerRatio":0.652509652509653,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-seekermint_og_pass_pfp_1712280628921.gif","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":47731.7338283661,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/seekermint_og_pass?cohort=ordinal\u0026window=7d\u0026currentFp=0.0006\u0026fpPctChg=-33.333333333333336","description":"- Cool 3D animated and dynamic piece inscribed on Block 9 featuring 50+ collections- Weekly Giveaway on Monday worth ≈ the OG Pass Floor Price (1x OG Pass = 1 entry)- Airdrops of all upcoming collections from Seekermint \\u0026 some of our partners- x5 daily multiplier on Gems site"},{"cohort":"ordinal","name":"Satoshi X PFP","collectionSymbol":"satoshi_x_pfp","collectionId":"satoshi_x_pfp","vol":0.0005,"totalVol":0.5511124,"totalTxns":386,"volPctChg":900,"txns":1,"fp":0.0006,"fpPctChg":-15.4929577464789,"fpListingPrice":0.0006,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.4848,"totalSupply":808,"listedCount":75,"ownerCount":462,"uniqueOwnerRatio":0.571782178217822,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-satoshi_x_pfp_pfp_1702216045244.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":49636.0887172713,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/satoshi_x_pfp?cohort=ordinal\u0026window=7d\u0026currentFp=0.0006\u0026fpPctChg=-15.492957746478886","description":"Satoshi-themed PFP ordinal that capture the spirit of Satoshi Nakamoto, the anonymous creator of Bitcoin, and symbolize various facets of the crypto world."},{"cohort":"ordinal","name":"Curiouser and Curiouser by Eka","collectionSymbol":"curiouser","collectionId":"curiouser","vol":0.0005,"totalVol":0.0005,"totalTxns":1,"txns":1,"fp":0.00275,"fpPctChg":83.3333333333333,"fpListingPrice":0.00275,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.18975,"totalSupply":69,"listedCount":1,"ownerCount":57,"uniqueOwnerRatio":0.826086956521739,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-curiouser_pfp_1726578538777.jpeg","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":1,"currencyUsdRate":102384.671446517,"marketCapUsd":19427.4914069766,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/curiouser?cohort=ordinal\u0026window=7d\u0026currentFp=0.00275\u0026fpPctChg=83.33333333333333","description":"Print on Gamma. AR experience powered by Artivive app.Life gets wild sometimes. Keep calm and trust the process!"},{"cohort":"ordinal","name":"C.A.T. (Cats Against TradFi)","collectionSymbol":"cat","collectionId":"cat","vol":0.000499,"totalVol":1.73456114,"totalTxns":1763,"volPctChg":-88.41146499,"txns":1,"txnsPctChg":-90,"fp":0.00039999,"fpPctChg":-19.84007695545,"fpListingPrice":0.00039999,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.88877778,"totalSupply":2222,"listedCount":399,"ownerCount":943,"uniqueOwnerRatio":0.424392439243924,"image":"https://media.cdn.magiceden.dev/launchpad/catsvstradfi/bc936ccc-2944-4569-94fc-96496663cb45","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":90997.2209942645,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/cat?cohort=ordinal\u0026window=7d\u0026currentFp=0.00039999\u0026fpPctChg=-19.840076955450016","description":"Are you ready to break free?"},{"cohort":"ordinal","name":"Recursive Punks","collectionSymbol":"recursivepunks","collectionId":"recursivepunks","vol":0.000476,"totalVol":0.14622214,"totalTxns":670,"volPctChg":4660,"txns":8,"txnsPctChg":700,"fp":0.000091,"fpPctChg":82,"fpListingPrice":0.000091,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.909909,"totalSupply":9999,"listedCount":1855,"ownerCount":3337,"uniqueOwnerRatio":0.333733373337334,"image":"https://bafkreiezpd7ctsn45mgzre3f23zzpfuknuihpldssiech7rystpajqnmiy.ipfs.nftstorage.link/","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":93160.7340112286,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/recursivepunks?cohort=ordinal\u0026window=7d\u0026currentFp=0.000091\u0026fpPctChg=82","description":"The first 10k recursive collection in ordinals. All Punks in the collection have been regenerated by using pre-inscribed traits. These traits are being combined into a new inscription to regenerate the original punks into an svg file."},{"cohort":"ordinal","name":"BTC Artsy monke","collectionSymbol":"btc-artsy-monke","collectionId":"btc-artsy-monke","vol":0.00044,"totalVol":0.105599,"totalTxns":139,"txns":2,"fp":0.000209,"fpPctChg":-4.99999999999999,"fpListingPrice":0.000209,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.851675,"totalSupply":4075,"listedCount":335,"ownerCount":1171,"uniqueOwnerRatio":0.287361963190184,"image":"https://bafkreihkaieqhv552l3kahkgxofmxhyaih5ckamgvadr7euvqndopemkzu.ipfs.nftstorage.link/","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":87198.4650542121,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/btc-artsy-monke?cohort=ordinal\u0026window=7d\u0026currentFp=0.000209\u0026fpPctChg=-4.999999999999993","description":"BTC Artsy Monke is the official Bitcoin counterpart of the beloved AI generated art collection Artsy Monke, featuring 20 different art themes. 10,000 completely unique Art pieces."},{"cohort":"ordinal","name":"Pixel Pepe Maxi Biz","collectionSymbol":"pixelpepe_omb","collectionId":"pixelpepe_omb","vol":0.00044,"totalVol":0.127699,"totalTxns":42,"txns":2,"fp":0.000444,"fpPctChg":33.3333333333333,"fpListingPrice":0.000444,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.0444,"totalSupply":100,"listedCount":31,"ownerCount":51,"uniqueOwnerRatio":0.51,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-pixelpepe_omb_pfp_1697150252048.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":4545.87941222534,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/pixelpepe_omb?cohort=ordinal\u0026window=7d\u0026currentFp=0.000444\u0026fpPctChg=33.33333333333333","description":"100 Pixel Pepe Maxi Biz forever inscribed on Block 9 sats. All Block 9 Pixelated OMB holder will receive each one for free."},{"cohort":"ordinal","name":"$DOG ARMY","collectionSymbol":"dog-army","collectionId":"dog-army","vol":0.00039999,"totalVol":0.01031099,"totalTxns":14,"txns":2,"fp":0.0002,"fpPctChg":5.26869835254489,"fpListingPrice":0.0002,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.54,"totalSupply":2700,"listedCount":36,"ownerCount":2673,"uniqueOwnerRatio":0.99,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-dog-army_pfp_1731418700010.jpeg","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":55287.722581119,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/dog-army?cohort=ordinal\u0026window=7d\u0026currentFp=0.0002\u0026fpPctChg=5.268698352544887","description":"2700 mascot ordinals created for the $DOG army 🐶 FREE AIRDROP to the largest $DOG holders 🐶"},{"cohort":"ordinal","name":"HIROS","collectionSymbol":"dmt-hiros","collectionId":"dmt-hiros","vol":0.0003999,"totalVol":0.51083314,"totalTxns":526,"volPctChg":-50.01187515,"txns":1,"txnsPctChg":-50,"fp":0.0004,"fpListingPrice":0.0004,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":1.6128,"totalSupply":4032,"listedCount":277,"ownerCount":706,"uniqueOwnerRatio":0.175099206349206,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-dmt-hiros_pfp_1724612125299.jpeg","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":165125.998108942,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/dmt-hiros?cohort=ordinal\u0026window=7d\u0026currentFp=0.0004","description":"HIROS uses GenAI, DMT, \\u0026 UNAT to drive the art and the storyline of a turn-based game."},{"cohort":"ordinal","name":"Battle Royale Access Card","collectionSymbol":"brac","collectionId":"brac","vol":0.000398,"totalVol":0.1522896,"totalTxns":216,"volPctChg":-43.14285714,"txns":2,"txnsPctChg":-60,"fp":0.0002,"fpPctChg":0.502512562814061,"fpListingPrice":0.0002,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":1.5554,"totalSupply":7777,"listedCount":82,"ownerCount":367,"uniqueOwnerRatio":0.0471904333290472,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-brac_pfp_1725403199799.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":159249.117967912,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/brac?cohort=ordinal\u0026window=7d\u0026currentFp=0.0002\u0026fpPctChg=0.5025125628140614","description":"Access the exclusive Battle Royale server in Satoria MMO"},{"cohort":"ordinal","name":"PIZZA RHINOS","collectionSymbol":"pizza-rhinos","collectionId":"pizza-rhinos","vol":0.000396,"totalVol":0.91327744,"totalTxns":1070,"volPctChg":108.42105263,"txns":3,"txnsPctChg":200,"fp":0.00008,"fpPctChg":-11.1111111111111,"fpListingPrice":0.00008,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.17776,"totalSupply":2222,"listedCount":222,"ownerCount":688,"uniqueOwnerRatio":0.30963096309631,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-pizza-rhinos_pfp_1726040859845.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":18199.8991963328,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/pizza-rhinos?cohort=ordinal\u0026window=7d\u0026currentFp=0.00008\u0026fpPctChg=-11.111111111111105","description":"2222 Pizza Rhinos – A Slice of Rhino Paradise! Our collection features 2222 distinct rhinos, each crafted with love and attention to detail. Each RHINO 888 x 888 Pixels, each RHINO includes 888 pizza sats.Try to find even more than 8 yourself!"},{"cohort":"ordinal","name":"Runes As Fuck","collectionSymbol":"runesasfuck","collectionId":"runesasfuck","vol":0.00039299,"totalVol":16.40555857,"totalTxns":2603,"volPctChg":379.25609756,"txns":9,"txnsPctChg":800,"fp":0.000075,"fpPctChg":-8.30174837999756,"fpListingPrice":0.000075,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.63,"totalSupply":8400,"listedCount":798,"ownerCount":3025,"uniqueOwnerRatio":0.360119047619048,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-runesasfuck_pfp_1710601854405.jpeg","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":64502.3430113055,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/runesasfuck?cohort=ordinal\u0026window=7d\u0026currentFp=0.000075\u0026fpPctChg=-8.301748379997564","description":"RunesAsFuck ◉ for RunesAsFuck ▣"},{"cohort":"ordinal","name":"Bitcoin mfers","collectionSymbol":"bitcoin-mfers","collectionId":"bitcoin-mfers","vol":0.000391,"totalVol":1.60319858,"totalTxns":4338,"volPctChg":-71.96730714,"txns":3,"txnsPctChg":-78.57142857,"fp":0.000127,"fpPctChg":-1.55038759689922,"fpListingPrice":0.000127,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":1.27,"totalSupply":10000,"listedCount":1266,"ownerCount":1891,"uniqueOwnerRatio":0.1891,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-bitcoin-mfers_pfp_1698424815434.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":130028.532737076,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/bitcoin-mfers?cohort=ordinal\u0026window=7d\u0026currentFp=0.000127\u0026fpPctChg=-1.5503875968992165","description":"Bitcoin Mfers are inscriptions created entirely from hand drawings by Sartoshi, and inscribed into the Bitcoin blockchain."},{"cohort":"ordinal","name":"DogeWorld","collectionSymbol":"dogeworld","collectionId":"dogeworld","vol":0.00039,"totalVol":0.32854291,"totalTxns":442,"txns":1,"fp":0.0003,"fpPctChg":-6.25000000000001,"fpListingPrice":0.0003,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.3003,"totalSupply":1001,"listedCount":140,"ownerCount":385,"uniqueOwnerRatio":0.384615384615385,"image":"https://bafkreihl5inhpviyf754a4s7qmm6kkprf47ieyb6ceadfgelixszpx5wta.ipfs.nftstorage.link/","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":30746.116835389,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/dogeworld?cohort=ordinal\u0026window=7d\u0026currentFp=0.0003\u0026fpPctChg=-6.250000000000011","description":"Join DogeWorld - the only collectible collection with a supply of 1001 inscriptions starting under 300k. Featuring 121 unique characters, drawn pixel by pixel and expanded into four rarity tiers. 33 specials complete the puzzle, including a themed collection dedicated to BITCOIN JPGs - of which we are the exclusive partners. But the story doesn't end here.Our mission is to create a vibrant and playful community united by strength and awareness in the crypto space. Let the adventure begin!"},{"cohort":"ordinal","name":"BlockHz Frequency","collectionSymbol":"blockhz-frequency","collectionId":"blockhz-frequency","vol":0.00037,"totalVol":0.001573,"totalTxns":12,"volPctChg":-69.24355777,"txns":4,"txnsPctChg":-50,"fp":0.0000799,"fpPctChg":-11.2123569285476,"fpListingPrice":0.0000799,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.1121796,"totalSupply":1404,"listedCount":68,"ownerCount":459,"uniqueOwnerRatio":0.326923076923077,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-blockhz-frequency_pfp_1732303629765.jpeg","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":11485.4714890017,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/blockhz-frequency?cohort=ordinal\u0026window=7d\u0026currentFp=0.0000799\u0026fpPctChg=-11.212356928547607","description":"At BlockHz, we see a future where technology and art are the heart of a new digital age. Imagine the Bitcoin blockchain not just as a ledger but as a vibrant canvas of creativity. Each Bitcoin block has its own unique frequency, a hidden vibe that, when uncovered, reveals a symphony of digital human expression."},{"cohort":"ordinal","name":"BtcName","collectionSymbol":"btc-name","collectionId":"btc-name","vol":0.000362,"totalVol":25.16603899,"totalTxns":9918,"volPctChg":-96.10982752,"txns":17,"txnsPctChg":-74.24242424,"fp":0.000006,"fpPctChg":-14.2857142857143,"fpListingPrice":0.000006,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":10.556244,"totalSupply":1759374,"listedCount":72631,"ownerCount":140096,"uniqueOwnerRatio":0.079628322346471,"image":"https://bafkreihtxsny24rb4x3mvgqyauh7vevpnwikkstrmwjfrire65ttkkvwwm.ipfs.nftstorage.link/","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":1080797.57364926,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/btc-name?cohort=ordinal\u0026window=7d\u0026currentFp=0.000006\u0026fpPctChg=-14.28571428571428","description":"A domain name service built on the Bitcoin ecosystem ---Notice: This collection claims to be a domain system. Individual domain systems are not vetted as original or functional by Magic Eden. Please be sure to take time to DYOR before purchasing."},{"cohort":"ordinal","name":"SAVE THE JPEGS by Lyndoco","collectionSymbol":"save-the-jpegs","collectionId":"save-the-jpegs","vol":0.000356,"totalVol":0.12673399,"totalTxns":60,"txns":4,"fp":0.000089,"fpPctChg":0.112485939257589,"fpListingPrice":0.000089,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.089,"totalSupply":1000,"listedCount":74,"ownerCount":844,"uniqueOwnerRatio":0.844,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-save-the-jpegs_pfp_1712085756702.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":9112.23575873999,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/save-the-jpegs?cohort=ordinal\u0026window=7d\u0026currentFp=0.000089\u0026fpPctChg=0.11248593925758943","description":"SAVE THE JPEGS.RUN BITCOIN."},{"cohort":"ordinal","name":"Hyperbitcoinization","collectionSymbol":"hyperbitcoinization","collectionId":"hyperbitcoinization","vol":0.000355,"totalVol":0.0110109,"totalTxns":73,"txns":10,"fp":0.000037,"fpPctChg":15.625,"fpListingPrice":0.000037,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.047841,"totalSupply":1293,"listedCount":147,"ownerCount":900,"uniqueOwnerRatio":0.696055684454756,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-hyperbitcoinization_pfp_1711920443481.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":4898.18506667281,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/hyperbitcoinization?cohort=ordinal\u0026window=7d\u0026currentFp=0.000037\u0026fpPctChg=15.625","description":"A dynamic p5.js edition by Theezy. Updates with real-time block data “Hyperbitcoinization is a voluntary transition from an inferior currency to a superior one, and its adoption is a series of individual acts of entrepreneurship rather than a single monopolist that games the system.” -Daniel Krawisz, Satoshi Nakamoto Institute"},{"cohort":"ordinal","name":"Natimated Wizards","collectionSymbol":"nat_wizards","collectionId":"nat_wizards","vol":0.00035,"totalVol":0.03172307,"totalTxns":150,"txns":15,"fp":0.0000649,"fpPctChg":224.5,"fpListingPrice":0.0000649,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.1029963,"totalSupply":1587,"listedCount":214,"ownerCount":1215,"uniqueOwnerRatio":0.765595463137996,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-nat_wizards_pfp_1718939006140.gif","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":10545.2423357069,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/nat_wizards?cohort=ordinal\u0026window=7d\u0026currentFp=0.0000649\u0026fpPctChg=224.5","description":"Welcome to the world of Natimated Wizards!Introducing the first Non-Derivative Animated UNATs PFP on DMT.Become one of the 8064 wizards with powerful animated traits.Embark on this magical journey into the realm of Bitcoin and make these unique wizards yours today!"},{"cohort":"ordinal","name":"PepeOrdinalsBiz","collectionSymbol":"pob","collectionId":"pob","vol":0.00035,"totalVol":5.60559381,"totalTxns":6434,"volPctChg":-68.31145315,"txns":5,"txnsPctChg":-54.54545455,"fp":0.00005,"fpPctChg":-37.5,"fpListingPrice":0.00005,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.2865,"totalSupply":5730,"listedCount":586,"ownerCount":2574,"uniqueOwnerRatio":0.449214659685864,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-pob_pfp_1710090710700.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":29333.208369427,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/pob?cohort=ordinal\u0026window=7d\u0026currentFp=0.00005\u0026fpPctChg=-37.5","description":"POB for the culture!"},{"cohort":"ordinal","name":"PNGS","collectionSymbol":"pngs","collectionId":"pngs","vol":0.0003439,"totalVol":42.69609567,"totalTxns":16781,"volPctChg":-72.35530547,"txns":5,"txnsPctChg":-70.58823529,"fp":0.0000679,"fpPctChg":-9.34579439252338,"fpListingPrice":0.0000679,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.6034952,"totalSupply":8888,"listedCount":1242,"ownerCount":3317,"uniqueOwnerRatio":0.373199819981998,"image":"https://nftstorage.link/ipfs/bafybeic42dtohxotkx3kega734bd5hruhmp4ikzagjkxx3kiw2a36nmzzy","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":61788.6577715499,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/pngs?cohort=ordinal\u0026window=7d\u0026currentFp=0.0000679\u0026fpPctChg=-9.345794392523377","description":"8,888 Pengs giving you access to revenue share out of the first ever BRC-20 Bot created on top of Discord, and so much more. \\nPowered by PNG Labs®."},{"cohort":"ordinal","name":"Conspirapups","collectionSymbol":"conspirapups","collectionId":"conspirapups","vol":0.00032,"totalVol":0.67494292,"totalTxns":450,"txns":1,"fp":0.00028,"fpPctChg":-15.1515151515152,"fpListingPrice":0.00028,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.57876,"totalSupply":2067,"listedCount":256,"ownerCount":556,"uniqueOwnerRatio":0.268988872762458,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-conspirapups_pfp_1713597827438.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":59256.152446386,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/conspirapups?cohort=ordinal\u0026window=7d\u0026currentFp=0.00028\u0026fpPctChg=-15.15151515151516","description":"Welcome to Conspirapups: Where Schizo Meets Autist - The early-internet conspiracy you miss and the puppets you love. From the 90s to early 2000s, the internet was chock-full of classic conspiracy; satanic panic, UFOs, and the paranormal in its heyday. Those vintage internet vibes are on the comeback, on Bitcoin. With a rich history of conspiracy theories itself, Conspirapups are an ode to Art Bell, high strangeness, Bitcoin and Bitcoin puppets. Embracing the weird, going full schizo."},{"cohort":"ordinal","name":"NodeTrump","collectionSymbol":"nodetrump","collectionId":"nodetrump","vol":0.00032,"totalVol":5.79355444,"totalTxns":6764,"volPctChg":-85.5530474,"txns":16,"txnsPctChg":-63.63636364,"fp":0.000089,"fpPctChg":345,"fpListingPrice":0.000089,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.886707,"totalSupply":9963,"listedCount":1263,"ownerCount":3226,"uniqueOwnerRatio":0.323798052795343,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-nodetrump_pfp_1710194655537.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":90785.2048643265,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/nodetrump?cohort=ordinal\u0026window=7d\u0026currentFp=0.000089\u0026fpPctChg=344.99999999999994","description":"The first original 10k collection of NodeTrump inscribed on bitcoin."},{"cohort":"ordinal","name":"Art for the people!","collectionSymbol":"artforthepeople","collectionId":"artforthepeople","vol":0.00031,"totalVol":2.8594286,"totalTxns":3366,"volPctChg":40.90909091,"txns":3,"txnsPctChg":50,"fp":0.00011,"fpPctChg":22.2222222222222,"fpListingPrice":0.00011,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.54747,"totalSupply":4977,"listedCount":742,"ownerCount":1666,"uniqueOwnerRatio":0.334739803094233,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-artforthepeople_pfp_1706501154791.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":56052.5360768245,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/artforthepeople?cohort=ordinal\u0026window=7d\u0026currentFp=0.00011\u0026fpPctChg=22.22222222222221","description":"The first large scale collection of cross inscription 1/1 mashups featuring historic early Ordinals and significant collections. All art is recursive, the traits are the art. Art for the people!"},{"cohort":"ordinal","name":"Satoshi Army","collectionSymbol":"satoshiarmy","collectionId":"satoshiarmy","vol":0.000306,"totalVol":0.05632867,"totalTxns":297,"volPctChg":59.375,"txns":7,"txnsPctChg":75,"fp":0.00005,"fpPctChg":19.0476190476191,"fpListingPrice":0.00005,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.38885,"totalSupply":7777,"listedCount":199,"ownerCount":5588,"uniqueOwnerRatio":0.718528995756719,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-satoshiarmy_pfp_1713498983912.jpeg","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":39812.279491978,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/satoshiarmy?cohort=ordinal\u0026window=7d\u0026currentFp=0.00005\u0026fpPctChg=19.04761904761907","description":"En esta hermosa collecion hacemos un tributo a nuestro mentor y maestro Satoshi Nakamoto y a las comunidades mas top en el mundo de los ordinales y bitcoin"},{"cohort":"ordinal","name":"BTC REMILIO BABIES","collectionSymbol":"btcremiliobabies","collectionId":"btcremiliobabies","vol":0.0003,"totalVol":0.32208644,"totalTxns":938,"txns":1,"fp":0.00014,"fpListingPrice":0.00014,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.70014,"totalSupply":5001,"listedCount":983,"ownerCount":2519,"uniqueOwnerRatio":0.50369926014797,"image":"https://bafkreiavdqwfiwpwdkrdka7i2ju7euufckg6xbppowra6q4aav4kghhqg4.ipfs.nftstorage.link/","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":71683.6038665642,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/btcremiliobabies?cohort=ordinal\u0026window=7d\u0026currentFp=0.00014","description":"TRILLION DOLLAR ASSET CLASS IN YOUR HANDS"},{"cohort":"ordinal","name":"BitSplits","collectionSymbol":"bitsplits","collectionId":"bitsplits","vol":0.0003,"totalVol":0.03343033,"totalTxns":159,"txns":6,"fp":0.0001,"fpListingPrice":0.0001,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.12,"totalSupply":1200,"listedCount":128,"ownerCount":736,"uniqueOwnerRatio":0.613333333333333,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-bitsplits_pfp_1724282381964.jpeg","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":6,"currencyUsdRate":102384.671446517,"marketCapUsd":12286.160573582,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/bitsplits?cohort=ordinal\u0026window=7d\u0026currentFp=0.0001","description":"Collection exploring raw human emotions, blending simple forms with chaotic colors, splits, and glitches to create chaos within simplicity. A tribute to the legends of abstract expressionism, especially Rothko. All powered by Bitcoin."},{"cohort":"ordinal","name":"Pepe \u0026 Pepita","collectionSymbol":"pepe-pepita","collectionId":"pepe-pepita","vol":0.0003,"totalVol":3.09557184,"totalTxns":549,"volPctChg":200,"txns":1,"fp":0.0002,"fpPctChg":-33.3333333333333,"fpListingPrice":0.0002,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.8734,"totalSupply":4367,"listedCount":557,"ownerCount":2596,"uniqueOwnerRatio":0.594458438287154,"image":"https://bafkreidyoavhxd2ovpmxhkzgvwpitipk4wqtqiwtf3nyblkzbkd5w2i77e.ipfs.nftstorage.link/","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":89422.7720413877,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/pepe-pepita?cohort=ordinal\u0026window=7d\u0026currentFp=0.0002\u0026fpPctChg=-33.33333333333333","description":""},{"cohort":"ordinal","name":"Voxels by Billy Restey","collectionSymbol":"voxels","collectionId":"voxels","vol":0.0003,"totalVol":0.16223955,"totalTxns":438,"volPctChg":-82.38402819,"txns":2,"txnsPctChg":-84.61538462,"fp":0.0001,"fpPctChg":-44.4444444444444,"fpListingPrice":0.0001,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.2784,"totalSupply":2784,"listedCount":180,"ownerCount":1558,"uniqueOwnerRatio":0.559626436781609,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-voxels_pfp_1719848456006.jpeg","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":28503.8925307103,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/voxels?cohort=ordinal\u0026window=7d\u0026currentFp=0.0001\u0026fpPctChg=-44.44444444444444","description":"An abstract, generative art collection exploring color palettes, bitcoin tech \\u0026 good vibes."},{"cohort":"ordinal","name":"Ordinal Meerkats Country Club","collectionSymbol":"omcc","collectionId":"omcc","vol":0.00029,"totalVol":0.0464899,"totalTxns":42,"volPctChg":-80.1369863,"txns":1,"txnsPctChg":-50,"fp":0.0004,"fpPctChg":-31.0344827586207,"fpListingPrice":0.0004,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.3048,"totalSupply":762,"listedCount":54,"ownerCount":285,"uniqueOwnerRatio":0.374015748031496,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-omcc_pfp_1709764338108.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":31206.8478568983,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/omcc?cohort=ordinal\u0026window=7d\u0026currentFp=0.0004\u0026fpPctChg=-31.034482758620683","description":"An OG Sol project minting the very first collection on BTC in SOL using the Bitcoin Gumball Machine! The first official Ordinals Launchpad!"},{"cohort":"ordinal","name":"WOoOF","collectionSymbol":"wooof","collectionId":"wooof","vol":0.000268,"totalVol":6.20959132,"totalTxns":11031,"volPctChg":-82.0735786,"txns":3,"txnsPctChg":-81.25,"fp":0.0000869,"fpPctChg":-17.2380952380952,"fpListingPrice":0.0000869,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":1.0727805,"totalSupply":12345,"listedCount":1665,"ownerCount":3213,"uniqueOwnerRatio":0.260267314702309,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-wooof_pfp_1709853254527.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":109836.27902673,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/wooof?cohort=ordinal\u0026window=7d\u0026currentFp=0.0000869\u0026fpPctChg=-17.23809523809524","description":"WOoOF is a VPL licensed collection of 12345 supremely magical doggos exploring the kaleidoscopic sights of the canine grid. No promises, no roadmap, no utility. Just WOoOF."},{"cohort":"ordinal","name":"Moggers","collectionSymbol":"moggers","collectionId":"moggers","vol":0.000265,"totalVol":2.07664764,"totalTxns":3359,"txns":6,"fp":0.000044,"fpPctChg":-1.12359550561797,"fpListingPrice":0.000044,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.243144,"totalSupply":5526,"listedCount":1003,"ownerCount":1543,"uniqueOwnerRatio":0.279225479551212,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-moggers_pfp_1709738967568.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":24894.2185541919,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/moggers?cohort=ordinal\u0026window=7d\u0026currentFp=0.000044\u0026fpPctChg=-1.1235955056179692","description":"mogging you on the mother chain 🫵😹"},{"cohort":"ordinal","name":"Dead Ordinals","collectionSymbol":"dead-ordinals","collectionId":"dead-ordinals","vol":0.000264,"totalVol":0.03759636,"totalTxns":249,"volPctChg":-34,"txns":3,"txnsPctChg":-25,"fp":0.000088,"fpListingPrice":0.000088,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.155232,"totalSupply":1764,"listedCount":282,"ownerCount":494,"uniqueOwnerRatio":0.280045351473923,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-dead-ordinals_pfp_1726499195001.jpeg","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":2,"currencyUsdRate":102384.671446517,"marketCapUsd":15893.3773179857,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/dead-ordinals?cohort=ordinal\u0026window=7d\u0026currentFp=0.000088","description":"1 of 1 dead art"},{"cohort":"ordinal","name":"1 of ?","collectionSymbol":"one-of-editions","collectionId":"one-of-editions","vol":0.000257,"totalVol":1.831379,"totalTxns":6907,"volPctChg":44.56069299,"txns":17,"txnsPctChg":54.54545455,"fp":0.000014,"fpPctChg":-17.6470588235294,"fpListingPrice":0.000014,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.493668,"totalSupply":35262,"listedCount":2851,"ownerCount":4629,"uniqueOwnerRatio":0.13127445975838,"image":"https://bafkreifx2y3s3hwdf5jouwmtgidh3sod3jxyplp47i6pwmkgzjs4httds4.ipfs.nftstorage.link/","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":50544.035983659,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/one-of-editions?cohort=ordinal\u0026window=7d\u0026currentFp=0.000014\u0026fpPctChg=-17.647058823529417","description":""},{"cohort":"ordinal","name":"Rune Nodes","collectionSymbol":"runenodes","collectionId":"runenodes","vol":0.0002559,"totalVol":114.6209511,"totalTxns":5532,"volPctChg":-79.0073831,"txns":2,"txnsPctChg":-81.81818182,"fp":0.000149,"fpPctChg":-11.3095238095238,"fpListingPrice":0.000149,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":1.49,"totalSupply":10000,"listedCount":734,"ownerCount":4377,"uniqueOwnerRatio":0.4377,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-runenodes_pfp_1713060349588.gif","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":152553.16045531,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/runenodes?cohort=ordinal\u0026window=7d\u0026currentFp=0.000149\u0026fpPctChg=-11.309523809523814","description":"SEND NODES. Not affiliated with, but deeply inspired by, NodeMonkes."},{"cohort":"ordinal","name":"RUNE IGLOOS by PNGS","collectionSymbol":"rune-igloos","collectionId":"rune-igloos","vol":0.000251,"totalVol":4.0793795,"totalTxns":4875,"volPctChg":527.5,"txns":20,"txnsPctChg":900,"fp":0.000018,"fpPctChg":80,"fpListingPrice":0.000018,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.147762,"totalSupply":8209,"listedCount":629,"ownerCount":2780,"uniqueOwnerRatio":0.33865269825801,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-rune-igloos_pfp_1711034314541.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":15128.5638222802,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/rune-igloos?cohort=ordinal\u0026window=7d\u0026currentFp=0.000018\u0026fpPctChg=79.99999999999999","description":"8320 IGLOOS with each one containing 10.000 RUNES tokens.Powered by PNG Labs®."},{"cohort":"ordinal","name":"Ordinals Eggs by MetaTrace","collectionSymbol":"ordinalseggs","collectionId":"ordinalseggs","vol":0.00025,"totalVol":0.03832268,"totalTxns":193,"txns":5,"fp":0.00006,"fpPctChg":20,"fpListingPrice":0.00006,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.19998,"totalSupply":3333,"listedCount":535,"ownerCount":1586,"uniqueOwnerRatio":0.475847584758476,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-ordinalseggs_pfp_1691338161091.gif","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":20474.8865958744,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/ordinalseggs?cohort=ordinal\u0026window=7d\u0026currentFp=0.00006\u0026fpPctChg=19.999999999999996","description":"From 3333 Ordinals Eggs, the Cypets have arisen. Enigmatic beings from the MetaTrace universe, born from the evolution of Bitcoin's code. Tame your Cypet and embark on a journey to unravel the Mysteries of Satoshi with MetaTrace."},{"cohort":"ordinal","name":"Miniords","collectionSymbol":"miniords","collectionId":"miniords","vol":0.00025,"totalVol":0.15843898,"totalTxns":320,"txns":1,"fp":0.00033,"fpPctChg":-2.94117647058825,"fpListingPrice":0.00033,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.32967,"totalSupply":999,"listedCount":124,"ownerCount":600,"uniqueOwnerRatio":0.600600600600601,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-miniords_pfp_1710767075674.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":33753.1546357732,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/miniords?cohort=ordinal\u0026window=7d\u0026currentFp=0.00033\u0026fpPctChg=-2.941176470588247","description":"Size doesn't matter! Like sats are small fragments of a whole Bitcoin, so is each Miniord a part of the movement to orange pill the world, one tiny step at a time. 999 little degens, who with their humble and disarming stature, are on a mission to charm Bitcoin into the hearts and minds of the people."},{"cohort":"ordinal","name":"BEPE","collectionSymbol":"bepe","collectionId":"bepe","vol":0.00021,"totalVol":0.177379,"totalTxns":74,"txns":1,"fp":0.00049,"fpPctChg":133.333333333333,"fpListingPrice":0.00049,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.20727,"totalSupply":423,"listedCount":81,"ownerCount":241,"uniqueOwnerRatio":0.569739952718676,"image":"https://bafkreiet3al73aiig5t4r6gwb3srucgim6wectchbo6a7363or246kj6ai.ipfs.nftstorage.link/","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":21221.2708507195,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/bepe?cohort=ordinal\u0026window=7d\u0026currentFp=0.00049\u0026fpPctChg=133.33333333333331","description":"BEPE is a collection of 420 dank baby pepes with immaculate swag, inscribed forever on-chain. As connoisseurs of all things hype, they live to find the dopest of rare luxury collectibles. While they may seem unapproachable, BEPES are for the people and loyal to their core. You are free to use your BEPE however you like, just be careful not to leave them alone with your girl."},{"cohort":"ordinal","name":"Ordinal X Tribes","collectionSymbol":"oxt","collectionId":"oxt","vol":0.00021,"totalVol":2.80197101,"totalTxns":1365,"txns":1,"fp":0.0002,"fpPctChg":-9.09090909090909,"fpListingPrice":0.0002,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.5,"totalSupply":2500,"listedCount":315,"ownerCount":1304,"uniqueOwnerRatio":0.5216,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-oxt_pfp_1712860652800.gif","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":51192.3357232584,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/oxt?cohort=ordinal\u0026window=7d\u0026currentFp=0.0002\u0026fpPctChg=-9.090909090909093","description":"Multiple tribes in the universe land their feet on Earth at the same time with the same purpose. Inevitably, their invasion is timed to coincide with the Bitcoin halving. The question isn’t how you protect your Bitcoin, but to whom you submit your coin."},{"cohort":"ordinal","name":"Elemental Runes","collectionSymbol":"elemental_runes","collectionId":"elemental_runes","vol":0.00021,"totalVol":10.7713366,"totalTxns":7331,"volPctChg":320.0840168,"txns":5,"txnsPctChg":400,"fp":0.00003,"fpListingPrice":0.00003,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.207,"totalSupply":6900,"listedCount":644,"ownerCount":3010,"uniqueOwnerRatio":0.436231884057971,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-elemental_runes_pfp_1710714814915.gif","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":21193.626989429,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/elemental_runes?cohort=ordinal\u0026window=7d\u0026currentFp=0.00003","description":"An Ordinals collection with utility to summon an allocation of etched Runes distributed to the participant's wallet on the upcoming Runes protocol designed by Casey Rodarmor after launch on Bitcoin block 840000. Rune allocation is based on elemental rarity, collect all elements to become an Alchemist. Mix \\u0026 match Elemental Runes to Multiply your allocation."},{"cohort":"ordinal","name":"Demonkes◉ᛪ","collectionSymbol":"demonkes","collectionId":"demonkes","vol":0.0002,"totalVol":0.09809643,"totalTxns":440,"txns":20,"fp":0.000065,"fpPctChg":550,"fpListingPrice":0.000065,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.137345,"totalSupply":2113,"listedCount":177,"ownerCount":1197,"uniqueOwnerRatio":0.566493137718883,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-demonkes_pfp_1711938419826.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":14062.0226998218,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/demonkes?cohort=ordinal\u0026window=7d\u0026currentFp=0.000065\u0026fpPctChg=549.9999999999999","description":"Snapshot taken at block 839999. Only the wallets in this snapshot will qualify to receive LAMBO•LIFESTYLE airdrop."},{"cohort":"ordinal","name":"BitDogs","collectionSymbol":"bitcoindogs","collectionId":"bitcoindogs","vol":0.0002,"totalVol":23.66200671,"totalTxns":3976,"txns":1,"fp":0.00035,"fpPctChg":75,"fpListingPrice":0.00035,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":3.48425,"totalSupply":9955,"listedCount":741,"ownerCount":3131,"uniqueOwnerRatio":0.314515318935208,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-bitcoindogs_pfp_1701810963171.jpeg","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":356733.791487526,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/bitcoindogs?cohort=ordinal\u0026window=7d\u0026currentFp=0.00035\u0026fpPctChg=75","description":"10,000 original Bitdogs living on Bitcoin.Powered by love,created for all."},{"cohort":"ordinal","name":"Bitcoin Foxes","collectionSymbol":"bfc","collectionId":"bfc","vol":0.000198,"totalVol":0.73695209,"totalTxns":1343,"txns":10,"fp":0.00003,"fpPctChg":25,"fpListingPrice":0.00003,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.2022,"totalSupply":6740,"listedCount":1077,"ownerCount":2828,"uniqueOwnerRatio":0.419584569732938,"image":"https://bafkreidyjoruwzkl6rd3xli4kkxlwsdngahhihol5zchqel3pkdkovc6ay.ipfs.nftstorage.link/","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":20702.1805664857,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/bfc?cohort=ordinal\u0026window=7d\u0026currentFp=0.00003\u0026fpPctChg=25","description":"Bitcoin Foxes Club brings a new chapter in the decentralized art space."},{"cohort":"ordinal","name":"BRC1024 Rootverse ","collectionSymbol":"brc1024_rootverse","collectionId":"brc1024_rootverse","vol":0.000195,"totalVol":5.23757443,"totalTxns":5050,"volPctChg":21.875,"txns":8,"txnsPctChg":33.33333333,"fp":0.0000245,"fpPctChg":-2.00000000000001,"fpListingPrice":0.0000245,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":5.145,"totalSupply":210000,"listedCount":10847,"ownerCount":8724,"uniqueOwnerRatio":0.0415428571428571,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-brc1024_rootverse_pfp_1705638536998.jpeg","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":526769.134592329,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/brc1024_rootverse?cohort=ordinal\u0026window=7d\u0026currentFp=0.0000245\u0026fpPctChg=-2.000000000000013","description":"Root is the first metaverse in the BRC1024 protocol. Currently, Root comprises 21 tribes, leading to the deployment of 21 Metaverse Components, which will altogether result in the creation of 210,000 characters in Root metaverse.Root is the first decentralized IP centered around a world view."},{"cohort":"ordinal","name":"The Grandads","collectionSymbol":"grandads","collectionId":"grandads","vol":0.000195,"totalVol":0.0069614,"totalTxns":38,"txns":3,"fp":0.0000369,"fpListingPrice":0.0000369,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.0307008,"totalSupply":832,"listedCount":103,"ownerCount":421,"uniqueOwnerRatio":0.506009615384615,"image":"https://bafkreid4w3y6bgcy5erg54oebxj7ncbwkiardypudi3pv3yrelpi3wbn4u.ipfs.nftstorage.link/","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":3143.29132114522,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/grandads?cohort=ordinal\u0026window=7d\u0026currentFp=0.0000369","description":"A token-gated universe on the grandfather of all blockchain networks - Bitcoin. Join our Discord now, and vibe with us!"},{"cohort":"ordinal","name":"Punk Voyage","collectionSymbol":"punkvoyage","collectionId":"punkvoyage","vol":0.00019,"totalVol":0.02988596,"totalTxns":88,"volPctChg":-7.31707317,"txns":2,"fp":0.0000947,"fpListingPrice":0.0000947,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.0735819,"totalSupply":777,"listedCount":192,"ownerCount":446,"uniqueOwnerRatio":0.574002574002574,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-punkvoyage_pfp_1727945766412.gif","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":7533.65865591045,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/punkvoyage?cohort=ordinal\u0026window=7d\u0026currentFp=0.0000947","description":"Punk Voyage aims to build a fun and unique community for giveaways, game nights, alpha calls and more art airdrops! 2222 punks inscribed on bitcoin."},{"cohort":"ordinal","name":"Bitmaps","collectionSymbol":"dmtbitmaps","collectionId":"dmtbitmaps","vol":0.000189,"totalVol":0.63693807,"totalTxns":338,"volPctChg":-66.66666667,"txns":1,"txnsPctChg":-66.66666667,"fp":0.000189,"fpListingPrice":0.000189,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.381024,"totalSupply":2016,"listedCount":389,"ownerCount":203,"uniqueOwnerRatio":0.100694444444444,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-dmtbitmaps_pfp_1709577331396.jpeg","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":39011.0170532376,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/dmtbitmaps?cohort=ordinal\u0026window=7d\u0026currentFp=0.000189","description":"A non-arbitrary collection on Bitcoin, based on premium blocks showcased by NAS. Each Bitmap has unique traits generated from block data."},{"cohort":"ordinal","name":"BitPepe","collectionSymbol":"bitpepe3333","collectionId":"bitpepe3333","vol":0.000188,"totalVol":0.14475416,"totalTxns":454,"txns":2,"fp":0.000088,"fpPctChg":-1.12359550561797,"fpListingPrice":0.000088,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.29304,"totalSupply":3330,"listedCount":632,"ownerCount":1836,"uniqueOwnerRatio":0.551351351351351,"image":"https://bafkreicdc22dsv5kmo43eyyng3dleqzbpnnjxhjxlkn2joyi7owtoux3fa.ipfs.nftstorage.link/","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":30002.8041206873,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/bitpepe3333?cohort=ordinal\u0026window=7d\u0026currentFp=0.000088\u0026fpPctChg=-1.1235955056179692","description":"BitPepe , one of the first full body pepe collections on #Bitcoin, with over 3333 unique pepes. 100% original art. Full collection contains 6 pieces with 6 different rare sats including uncommon, pizza, vintage, nakamoto and pallindrome sats."},{"cohort":"ordinal","name":"NODE PEANUTS","collectionSymbol":"npnts","collectionId":"npnts","vol":0.00018,"totalVol":0.001055,"totalTxns":6,"volPctChg":-79.42857143,"txns":2,"txnsPctChg":-50,"fp":0.00003,"fpPctChg":-78.5714285714286,"fpListingPrice":0.00003,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.01662,"totalSupply":554,"listedCount":52,"ownerCount":159,"uniqueOwnerRatio":0.287003610108303,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-npnts_pfp_1732486885657.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":1701.63323944111,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/npnts?cohort=ordinal\u0026window=7d\u0026currentFp=0.00003\u0026fpPctChg=-78.57142857142857","description":"In honor of Peanut's memory"},{"cohort":"ordinal","name":"RunePunks","collectionSymbol":"runepunks","collectionId":"runepunks","vol":0.000171,"totalVol":62.52717894,"totalTxns":9669,"volPctChg":-94.75283071,"txns":3,"txnsPctChg":-40,"fp":0.0000398,"fpPctChg":-0.500000000000012,"fpListingPrice":0.0000398,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.3913136,"totalSupply":9832,"listedCount":694,"ownerCount":4730,"uniqueOwnerRatio":0.481082180634662,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-runepunks_pfp_1712632000262.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":40064.5143685537,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/runepunks?cohort=ordinal\u0026window=7d\u0026currentFp=0.0000398\u0026fpPctChg=-0.5000000000000115","description":"10000 unique RunePunks"},{"cohort":"ordinal","name":"DMT-Natconics","collectionSymbol":"natconics","collectionId":"natconics","vol":0.00017,"totalVol":1.44427375,"totalTxns":3391,"txns":6,"fp":0.000039,"fpPctChg":34.4827586206897,"fpListingPrice":0.000039,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.314496,"totalSupply":8064,"listedCount":706,"ownerCount":790,"uniqueOwnerRatio":0.0979662698412698,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-natconics_pfp_1709523939346.jpeg","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":32199.5696312437,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/natconics?cohort=ordinal\u0026window=7d\u0026currentFp=0.000039\u0026fpPctChg=34.48275862068966","description":"Natconics is the first HD art collection created by Digital Matter. Each Natconic has unique traits generated autonomously by Bitcoin data."},{"cohort":"ordinal","name":"NakaPEPE V2","collectionSymbol":"npepv2","collectionId":"npepv2","vol":0.000168,"totalVol":9.30335286,"totalTxns":9995,"volPctChg":158.46153846,"txns":3,"txnsPctChg":200,"fp":0.0000299,"fpPctChg":-38.9795918367347,"fpListingPrice":0.0000299,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.299,"totalSupply":10000,"listedCount":1700,"ownerCount":3144,"uniqueOwnerRatio":0.3144,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-npepv2_pfp_1709449604640.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":30613.0167625085,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/npepv2?cohort=ordinal\u0026window=7d\u0026currentFp=0.0000299\u0026fpPctChg=-38.9795918367347","description":"A Recursive collection with traits minted on Nakamoto Sats using Parent/Child Provenance through the OG Sub 100k Nakapepe"},{"cohort":"ordinal","name":"Rune Walkers ","collectionSymbol":"rune_walkers","collectionId":"rune_walkers","vol":0.000162,"totalVol":0.62236358,"totalTxns":728,"volPctChg":-56.68333378,"txns":3,"txnsPctChg":-50,"fp":0.00004,"fpPctChg":-25.9259259259259,"fpListingPrice":0.00004,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.13332,"totalSupply":3333,"listedCount":581,"ownerCount":1636,"uniqueOwnerRatio":0.490849084908491,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-rune_walkers_pfp_1715233659818.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":13649.9243972496,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/rune_walkers?cohort=ordinal\u0026window=7d\u0026currentFp=0.00004\u0026fpPctChg=-25.92592592592592","description":"3333 Rune Walkers"},{"cohort":"ordinal","name":"Taproot Trumps","collectionSymbol":"taprootrumps","collectionId":"taprootrumps","vol":0.00016,"totalVol":0.00052,"totalTxns":3,"txns":2,"fp":0.00008,"fpListingPrice":0.00008,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.0192,"totalSupply":240,"listedCount":29,"ownerCount":129,"uniqueOwnerRatio":0.5375,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-taprootrumps_pfp_1731291384211.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":1965.78569177312,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/taprootrumps?cohort=ordinal\u0026window=7d\u0026currentFp=0.00008","description":"MAGA Movement on Bitcoin"},{"cohort":"ordinal","name":"The Cappies","collectionSymbol":"cappies","collectionId":"cappies","vol":0.00016,"totalVol":2.93374543,"totalTxns":4509,"txns":2,"fp":0.000089,"fpPctChg":11.25,"fpListingPrice":0.000089,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.424352,"totalSupply":4768,"listedCount":573,"ownerCount":767,"uniqueOwnerRatio":0.160864093959732,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-cappies_pfp_1704517167516.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":43447.1400976723,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/cappies?cohort=ordinal\u0026window=7d\u0026currentFp=0.000089\u0026fpPctChg=11.249999999999982","description":"4,777 Cappies cappin on Bitcoin."},{"cohort":"ordinal","name":"Node Frogs","collectionSymbol":"node-frogs","collectionId":"node-frogs","vol":0.00015,"totalVol":10.20565407,"totalTxns":6468,"txns":3,"fp":0.0000739,"fpPctChg":-0.135135135135134,"fpListingPrice":0.0000739,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.7553319,"totalSupply":10221,"listedCount":1594,"ownerCount":2885,"uniqueOwnerRatio":0.282262009588103,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-node-frogs_pfp_1702957334214.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":77334.4084145732,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/node-frogs?cohort=ordinal\u0026window=7d\u0026currentFp=0.0000739\u0026fpPctChg=-0.13513513513513375","description":"10000 NodeFrogs living on bitcoin launched on December 18 2023 made by a frog for frogs RIBBIT."},{"cohort":"ordinal","name":"Mikan!","collectionSymbol":"mikan","collectionId":"mikan","vol":0.00015,"totalVol":27.70241329,"totalTxns":3792,"volPctChg":-77.6119403,"txns":1,"txnsPctChg":-50,"fp":0.00025,"fpPctChg":-16.6666666666667,"fpListingPrice":0.00025,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.83325,"totalSupply":3333,"listedCount":572,"ownerCount":1332,"uniqueOwnerRatio":0.3996399639964,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-mikan_pfp_1710178950941.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":85312.0274828101,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/mikan?cohort=ordinal\u0026window=7d\u0026currentFp=0.00025\u0026fpPctChg=-16.666666666666664","description":"3,333 hand-drawn idols on the Bitcoin blockchain!"},{"cohort":"ordinal","name":"Rune Punks","collectionSymbol":"rune_punks","collectionId":"rune_punks","vol":0.00015,"totalVol":22.01473287,"totalTxns":7197,"txns":1,"fp":0.00015,"fpListingPrice":0.00015,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":1.49325,"totalSupply":9955,"listedCount":1595,"ownerCount":3373,"uniqueOwnerRatio":0.338824711200402,"image":"https://nftstorage.link/ipfs/bafkreici7kngisgl66qs2uiztpiapdw7j25ldzikulo543b3tiyrazxpy4","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":152885.910637511,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/rune_punks?cohort=ordinal\u0026window=7d\u0026currentFp=0.00015","description":"Disclaimer: Rune Punks is an Ordinal collection tied to Rune Punk etches, these are only the Ordinals inscriptions of Rune Punks."},{"cohort":"ordinal","name":"Sats Names","collectionSymbol":"domain_dot_sats","collectionId":"domain_dot_sats","vol":0.0001445,"totalVol":1.73607144,"totalTxns":1576,"volPctChg":-92.88527819,"txns":17,"txnsPctChg":325,"fp":0.000009,"fpPctChg":28.5714285714286,"fpListingPrice":0.000009,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":4.289796,"totalSupply":476644,"listedCount":45541,"ownerCount":88678,"uniqueOwnerRatio":0.186046609209389,"image":"https://bafkreifwtamtjmlgepbjjxld4273tabnedqfetujj24jkwjm2gjykkafie.ipfs.nftstorage.link/","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":439209.354032582,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/domain_dot_sats?cohort=ordinal\u0026window=7d\u0026currentFp=0.000009\u0026fpPctChg=28.57142857142858","description":"Sats Names is a standard for writing names to Bitcoin using ordinals. The goal is to build a name ecosystem for Bitcoin, that is built by Bitcoiners, and developed entirely on Bitcoin. WARNING: this is experimental indexing, please DYOR and cross verify the data"},{"cohort":"ordinal","name":"RarePizza","collectionSymbol":"sat20_rarepizza","collectionId":"sat20_rarepizza","vol":0.00014,"totalVol":0.53477849,"totalTxns":1177,"volPctChg":-93.33333333,"txns":1,"txnsPctChg":-92.85714286,"fp":0.000132,"fpPctChg":-5.71428571428569,"fpListingPrice":0.000132,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":13.06734,"totalSupply":98995,"listedCount":1737,"ownerCount":6176,"uniqueOwnerRatio":0.0623869892418809,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-sat20_rarepizza_pfp_1721873754598.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":1337895.31257993,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/sat20_rarepizza?cohort=ordinal\u0026window=7d\u0026currentFp=0.000132\u0026fpPctChg=-5.714285714285694","description":"Managed by the RarePizza community, the collection comprises 98,995 unique NFTs, making it the first SFT (Semi-Fungible Token) on the Bitcoin blockchain. Each NFT is minted from 1,000 rare Satoshis from 2010. This collection marks a historic moment in the BTC ecosystem, blending the uniqueness of rare Satoshis with the innovation of SFTs and dual-state tokens."},{"cohort":"ordinal","name":"WZRDS","collectionSymbol":"wzrds","collectionId":"wzrds","vol":0.00014,"totalVol":0.70716026,"totalTxns":4071,"txns":7,"fp":0.00002,"fpListingPrice":0.00002,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":1.22288,"totalSupply":61144,"listedCount":2174,"ownerCount":6021,"uniqueOwnerRatio":0.0984724584587204,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-wzrds_pfp_1712845670367.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":125204.167018516,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/wzrds?cohort=ordinal\u0026window=7d\u0026currentFp=0.00002","description":"ᚹᛉᚱᛞᛊ ᛁᛊ ᚨᚾ ᛖᚲᛊᛈᛖᚱᛁᛗᛖᚾᛏ - ᚢᛊᛖ ᛁᛟᚢᚱ ᛗᚨᚷᛁᚲ ᚱᛖᛊᛈᛟᚾᛊᛁᛒᛚᛁ!"},{"cohort":"ordinal","name":"Jade98 ARdinals ","collectionSymbol":"jade-ardinals","collectionId":"jade-ardinals","vol":0.000138,"totalVol":2.37618785,"totalTxns":3179,"txns":2,"fp":0.000069,"fpPctChg":-1.42857142857142,"fpListingPrice":0.000069,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.689862,"totalSupply":9998,"listedCount":791,"ownerCount":3032,"uniqueOwnerRatio":0.303260652130426,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-jade-ardinals_pfp_1712602534605.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":70631.2942134369,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/jade-ardinals?cohort=ordinal\u0026window=7d\u0026currentFp=0.000069\u0026fpPctChg=-1.4285714285714235","description":"Jade98 ARdinals. Elevate your Ordinals with Augmented Reality (AR) inscriptions - Immerse yourself in the future of digital collectibles with ARdinals"},{"cohort":"ordinal","name":"Ordinal 625 Spirit Miners","collectionSymbol":"ordinal625","collectionId":"ordinal625","vol":0.00013,"totalVol":0.09500486,"totalTxns":124,"volPctChg":-35,"txns":1,"fp":0.0001,"fpPctChg":-28.5714285714286,"fpListingPrice":0.0001,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.1111,"totalSupply":1111,"listedCount":107,"ownerCount":644,"uniqueOwnerRatio":0.57965796579658,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-ordinal625_pfp_1713423758824.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":11374.936997708,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/ordinal625?cohort=ordinal\u0026window=7d\u0026currentFp=0.0001\u0026fpPctChg=-28.57142857142856","description":"1,111 Spirit miners rise in homage to bitcoin's halving rewards, echoing the bygone eras. Where art meets technology!"},{"cohort":"ordinal","name":"DMT CULT of the Grimoire","collectionSymbol":"dmtcult","collectionId":"dmtcult","vol":0.00011322,"totalVol":1.14863747,"totalTxns":5446,"volPctChg":-87.9134018,"txns":3,"txnsPctChg":-86.36363636,"fp":0.000038,"fpPctChg":0.688924218335996,"fpListingPrice":0.000038,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.731804,"totalSupply":19258,"listedCount":1799,"ownerCount":2367,"uniqueOwnerRatio":0.122909959497352,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-dmtcult_pfp_1710285307335.gif","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":74925.5121032467,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/dmtcult?cohort=ordinal\u0026window=7d\u0026currentFp=0.000038\u0026fpPctChg=0.6889242183359956","description":"The groundbreaking generative card collection built on Bitcoin using Digital Matter Theory (DMT). Dive deep into a world created by legends from ILM \\u0026 Disney!"},{"cohort":"ordinal","name":"Seekermint Gems","collectionSymbol":"seekermint_gems","collectionId":"seekermint_gems","vol":0.00011,"totalVol":0.17486519,"totalTxns":476,"volPctChg":-80.83623693,"txns":1,"txnsPctChg":-80,"fp":0.0001,"fpPctChg":-9.09090909090909,"fpListingPrice":0.0001,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.2517,"totalSupply":2517,"listedCount":207,"ownerCount":712,"uniqueOwnerRatio":0.282876440206595,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-seekermint_gems_pfp_1732696585136.gif","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":25770.2218030883,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/seekermint_gems?cohort=ordinal\u0026window=7d\u0026currentFp=0.0001\u0026fpPctChg=-9.090909090909093","description":"Stake Gems and Earn daily points - 1 Million DOG Giveaway 100 winners"},{"cohort":"ordinal","name":"FSIC Genesis Miner","collectionSymbol":"fsicgm","collectionId":"fsicgm","vol":0.000109,"totalVol":1.77839596,"totalTxns":695,"volPctChg":-63.42281879,"txns":1,"txnsPctChg":-50,"fp":0.000189,"fpPctChg":73.394495412844,"fpListingPrice":0.000189,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.16632,"totalSupply":880,"listedCount":102,"ownerCount":485,"uniqueOwnerRatio":0.551136363636364,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-fsicgm_pfp_1725037119369.gif","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":17028.6185549847,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/fsicgm?cohort=ordinal\u0026window=7d\u0026currentFp=0.000189\u0026fpPctChg=73.39449541284404","description":"880 bonus Ordinals for FSIC presale buyers and OG supporters. These GM Ordinals do not mine $FB, but will receive rewards from future FSIC initiatives."},{"cohort":"ordinal","name":"Rune Mania Miner","collectionSymbol":"rmm","collectionId":"rmm","vol":0.0001001,"totalVol":48.33647887,"totalTxns":2868,"txns":2,"fp":0.0001,"fpListingPrice":0.0001,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.38,"totalSupply":3800,"listedCount":447,"ownerCount":2274,"uniqueOwnerRatio":0.598421052631579,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-rmm_pfp_1708461604099.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":38906.1751496764,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/rmm?cohort=ordinal\u0026window=7d\u0026currentFp=0.0001","description":"Rune Mania: Utilize your RMM to mine Runes using:⛏️ Mining Boosts🧱 Block Boosts🧪 Mana Boosts🗿 Stone Boosts ✨ Rune Boosts"},{"cohort":"ordinal","name":"btc_pandas","collectionSymbol":"btc_pandas","collectionId":"btc_pandas","vol":0.0001,"totalVol":0.0035298,"totalTxns":20,"txns":1,"fp":0.0001,"fpListingPrice":0.0001,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.0911,"totalSupply":911,"listedCount":213,"ownerCount":461,"uniqueOwnerRatio":0.506037321624588,"image":"https://bafkreifovz6cwuhv5hxfwhd47cfydhp6hipyminoxfrz6mylm7sjo2zbty.ipfs.nftstorage.link/","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":9327.24356877767,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/btc_pandas?cohort=ordinal\u0026window=7d\u0026currentFp=0.0001","description":"The BTC Pandas is a collection unique Pandas NFTs - unique digital collectibles living on the Bitcoin blockchain."},{"cohort":"ordinal","name":"based pills","collectionSymbol":"based-pills","collectionId":"based-pills","vol":0.0001,"totalVol":0.0049016,"totalTxns":14,"txns":1,"fp":0.0001,"fpListingPrice":0.0001,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.0457,"totalSupply":457,"listedCount":41,"ownerCount":295,"uniqueOwnerRatio":0.645514223194748,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-based-pills_pfp_1714542942007.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":4678.97948510582,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/based-pills?cohort=ordinal\u0026window=7d\u0026currentFp=0.0001","description":"pills by based"},{"cohort":"ordinal","name":"Circle of Life by Aneemoos","collectionSymbol":"circleoflife","collectionId":"circleoflife","vol":0.00009989,"totalVol":0.84129075,"totalTxns":975,"txns":1,"fp":0.00009999,"fpPctChg":11.1123458162018,"fpListingPrice":0.00009999,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.11118888,"totalSupply":1112,"listedCount":125,"ownerCount":506,"uniqueOwnerRatio":0.455035971223022,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-circleoflife_pfp_1725538964839.gif","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":2,"currencyUsdRate":102384.671446517,"marketCapUsd":11384.0369473062,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/circleoflife?cohort=ordinal\u0026window=7d\u0026currentFp=0.00009999\u0026fpPctChg=11.112345816201795","description":"the Largest .GIF inscription on Bitcoin, own a piece of history with some added perks down the line."},{"cohort":"ordinal","name":"Bit puppets","collectionSymbol":"bitpuppets","collectionId":"bitpuppets","vol":0.0000987,"totalVol":0.0108651,"totalTxns":14,"volPctChg":-50.07587253,"txns":1,"txnsPctChg":-50,"fp":0.000098,"fpPctChg":-0.709219858156029,"fpListingPrice":0.000098,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.010584,"totalSupply":108,"listedCount":40,"ownerCount":62,"uniqueOwnerRatio":0.574074074074074,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-bitpuppets_pfp_1709689387130.gif","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":1083.63936258993,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/bitpuppets?cohort=ordinal\u0026window=7d\u0026currentFp=0.000098\u0026fpPctChg=-0.7092198581560294","description":"333 pixelated puppets were created under the influence of opium, which aided in the creation of unparalleled art. Mint still live on inscribe Now :https://inscribenow.io/collections/2d3b2f74599c7a74"},{"cohort":"ordinal","name":"69 Frogs","collectionSymbol":"69frogs","collectionId":"69frogs","vol":0.0000949,"totalVol":7.56264241,"totalTxns":2630,"volPctChg":-50.02632965,"txns":1,"txnsPctChg":-50,"fp":0.000091,"fpPctChg":-4.1095890410959,"fpListingPrice":0.000091,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.9464,"totalSupply":10400,"listedCount":1105,"ownerCount":2436,"uniqueOwnerRatio":0.234230769230769,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-69frogs_pfp_1703958129975.gif","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":96896.8530569834,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/69frogs?cohort=ordinal\u0026window=7d\u0026currentFp=0.000091\u0026fpPctChg=-4.109589041095896","description":"The last 10,400 Frogs based on BRC69"},{"cohort":"ordinal","name":"NodeCats","collectionSymbol":"nodecats","collectionId":"nodecats","vol":0.00009,"totalVol":2.09929167,"totalTxns":5353,"volPctChg":114.28571429,"txns":2,"txnsPctChg":-33.33333333,"fp":0.00001,"fpPctChg":-75,"fpListingPrice":0.00001,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.09525,"totalSupply":9525,"listedCount":1365,"ownerCount":2855,"uniqueOwnerRatio":0.299737532808399,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-nodecats_pfp_1710015971923.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":9752.13995528072,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/nodecats?cohort=ordinal\u0026window=7d\u0026currentFp=0.00001\u0026fpPctChg=-75","description":"The first original 10k collection of NodeCats inscribed on bitcoin."},{"cohort":"ordinal","name":"Bitcoin Crypto DickButts","collectionSymbol":"bitcoin-cryptodickbutts","collectionId":"bitcoin-cryptodickbutts","vol":0.00009,"totalVol":0.63887289,"totalTxns":591,"volPctChg":-83.92857143,"txns":1,"txnsPctChg":-66.66666667,"fp":0.00024,"fpPctChg":166.666666666667,"fpListingPrice":0.00024,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":1.24704,"totalSupply":5196,"listedCount":561,"ownerCount":1614,"uniqueOwnerRatio":0.310623556581986,"image":"https://bafkreietezb5njzbjq4fspfecmo5yxsopab6uoujkcszdzusmmdmr3qe6q.ipfs.nftstorage.link/","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":127677.780680664,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/bitcoin-cryptodickbutts?cohort=ordinal\u0026window=7d\u0026currentFp=0.00024\u0026fpPctChg=166.66666666666666","description":"Bitcoin CryptoDickButts Inscribed Permanently On the BTC Chain"},{"cohort":"ordinal","name":"The Factory Fuzz by OTO","collectionSymbol":"fuzz_oto","collectionId":"fuzz_oto","vol":0.00009,"totalVol":0.59201729,"totalTxns":716,"volPctChg":-18.18181818,"txns":1,"fp":0.0001,"fpPctChg":-9.09090909090909,"fpListingPrice":0.0001,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.2213,"totalSupply":2213,"listedCount":337,"ownerCount":1462,"uniqueOwnerRatio":0.660641662901039,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-fuzz_oto_pfp_1705224041280.gif","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":22657.7277911142,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/fuzz_oto?cohort=ordinal\u0026window=7d\u0026currentFp=0.0001\u0026fpPctChg=-9.090909090909093","description":"This artwork recursively calls \\"},{"cohort":"ordinal","name":"Bitcoin Ape Yacht Gang","collectionSymbol":"bayg","collectionId":"bayg","vol":0.00009,"totalVol":0.03440379,"totalTxns":139,"txns":1,"fp":0.00009,"fpListingPrice":0.00009,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.13743,"totalSupply":1527,"listedCount":251,"ownerCount":520,"uniqueOwnerRatio":0.340537000654879,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-bayg_pfp_1701239935738.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":14070.7253968948,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/bayg?cohort=ordinal\u0026window=7d\u0026currentFp=0.00009","description":"Inspired by BAYC, BAYG PIXEL deriv is one of the 1st PFP ordinal collectibles launched in March 2023. The Bitcoin Ape Yacht Gang inscribes actual Bitcoin into their designs, making each token not only a unique collectible but also a store of value in itself. - BAYG ORDINALS will be PLAYABLE AS SPRITES in the Bitcoin MBK METAVERSE GAME. Explore more at https://mybitcoinkingdom.com -- NOW YOU CAN ALSO MINT YOUR BAYG $RUNE HERE! https://luminex.io/runes/mint?rune=BAYG%E2%80%A2RUNE%E2%80%A2COINS"},{"cohort":"ordinal","name":"Artinals","collectionSymbol":"artinals","collectionId":"artinals","vol":0.00009,"totalVol":6.69890986,"totalTxns":1185,"txns":1,"fp":0.000098,"fpPctChg":8.88888888888888,"fpListingPrice":0.000098,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.087024,"totalSupply":888,"listedCount":228,"ownerCount":468,"uniqueOwnerRatio":0.527027027027027,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-artinals_pfp_1700757450346.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":8909.92364796167,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/artinals?cohort=ordinal\u0026window=7d\u0026currentFp=0.000098\u0026fpPctChg=8.888888888888879","description":"Artinals Passes are A gateway to a curated world of digital art and exclusive benefits within the Artinals ecosystem!"},{"cohort":"ordinal","name":"Rune Gods","collectionSymbol":"rune_gods","collectionId":"rune_gods","vol":0.000086,"totalVol":1.89572264,"totalTxns":2180,"txns":8,"fp":0.00001,"fpPctChg":-16.6666666666667,"fpListingPrice":0.00001,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.0998,"totalSupply":9980,"listedCount":550,"ownerCount":8272,"uniqueOwnerRatio":0.828857715430862,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-rune_gods_pfp_1711807685000.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":10217.9902103624,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/rune_gods?cohort=ordinal\u0026window=7d\u0026currentFp=0.00001\u0026fpPctChg=-16.666666666666664","description":"10k Rune Gods by OnChain - Season 1"},{"cohort":"ordinal","name":"OrdiToadz","collectionSymbol":"orditoadz","collectionId":"orditoadz","vol":0.00008,"totalVol":0.3174299,"totalTxns":727,"volPctChg":-74.76340694,"txns":1,"txnsPctChg":-75,"fp":0.000077,"fpListingPrice":0.000077,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.540771,"totalSupply":7023,"listedCount":1225,"ownerCount":1487,"uniqueOwnerRatio":0.211732877687598,"image":"https://bafkreiawbugc4whe4y63t4twfquhpo5b3znbpzt42sjbze4i6ox73mmsdq.ipfs.nftstorage.link/","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":55366.6611628043,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/orditoadz?cohort=ordinal\u0026window=7d\u0026currentFp=0.000077","description":"OrdiToadz are the first byte-perfect Bitcoin Ordinal inscriptions of the CC0 CrypToadz."},{"cohort":"ordinal","name":"DMT-Trump","collectionSymbol":"dmttrump","collectionId":"dmttrump","vol":0.00008,"totalVol":0.6500631,"totalTxns":1159,"txns":1,"fp":0.00008,"fpListingPrice":0.00008,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.16128,"totalSupply":2016,"listedCount":294,"ownerCount":305,"uniqueOwnerRatio":0.151289682539683,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-dmttrump_pfp_1710015972368.jpeg","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":16512.5998108942,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/dmttrump?cohort=ordinal\u0026window=7d\u0026currentFp=0.00008","description":"The first unique non-arbitrary art collection of the President Of The United States of America, created by Bitcoin data, on Bitcoin."},{"cohort":"ordinal","name":"xPuppets","collectionSymbol":"btc_x_puppets","collectionId":"btc_x_puppets","vol":0.000068,"totalVol":2.54653545,"totalTxns":3332,"txns":1,"fp":0.000067,"fpPctChg":-1.47058823529411,"fpListingPrice":0.000067,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.67,"totalSupply":10000,"listedCount":1151,"ownerCount":3855,"uniqueOwnerRatio":0.3855,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-btc_x_puppets_pfp_1712572539198.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":1,"currencyUsdRate":102384.671446517,"marketCapUsd":68597.7298691662,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/btc_x_puppets?cohort=ordinal\u0026window=7d\u0026currentFp=0.000067\u0026fpPctChg=-1.4705882352941124","description":"10000 xPuppets on bitcoin"},{"cohort":"ordinal","name":"0asis","collectionSymbol":"0asis","collectionId":"0asis","vol":0.000065,"totalVol":0.05824872,"totalTxns":157,"txns":1,"fp":0.000065,"fpPctChg":-7.01001430615166,"fpListingPrice":0.000065,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.139035,"totalSupply":2139,"listedCount":188,"ownerCount":1294,"uniqueOwnerRatio":0.604955586722768,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-0asis_pfp_1714462799143.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":14235.0527945665,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/0asis?cohort=ordinal\u0026window=7d\u0026currentFp=0.000065\u0026fpPctChg=-7.010014306151657","description":"◉ first network state on bitcoin"},{"cohort":"ordinal","name":"JSON Maxi Biz (JMB)","collectionSymbol":"jsonmaxibiz","collectionId":"jsonmaxibiz","vol":0.000065,"totalVol":10.03473078,"totalTxns":5275,"txns":1,"fp":0.00006,"fpPctChg":-7.69230769230769,"fpListingPrice":0.00006,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.60606,"totalSupply":10101,"listedCount":1501,"ownerCount":1965,"uniqueOwnerRatio":0.194535194535195,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-jsonmaxibiz_pfp_1702125449919.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":62051.2539768759,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/jsonmaxibiz?cohort=ordinal\u0026window=7d\u0026currentFp=0.00006\u0026fpPctChg=-7.692307692307687","description":".--- ... --- -. / -- .- -..- .. / -... .. --.. / -.--. .--- -- -... -.--.-"},{"cohort":"ordinal","name":"GLYPHS","collectionSymbol":"glyph","collectionId":"glyph","vol":0.00006,"totalVol":4.99600412,"totalTxns":5924,"txns":2,"fp":0.0000298,"fpPctChg":-0.666666666666671,"fpListingPrice":0.0000298,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.298,"totalSupply":10000,"listedCount":976,"ownerCount":4685,"uniqueOwnerRatio":0.4685,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-glyph_pfp_1711465635701.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":30510.632091062,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/glyph?cohort=ordinal\u0026window=7d\u0026currentFp=0.0000298\u0026fpPctChg=-0.666666666666671","description":"GLYPHS is a Discord-based game where you mine for Runes. Get a Pass, start mining, and watch your GLYPHS transform into Runes tokens after the halving event."},{"cohort":"ordinal","name":"Fractal Punks","collectionSymbol":"fractal-punks","collectionId":"fractal-punks","vol":0.00006,"totalVol":0.23237068,"totalTxns":521,"volPctChg":100,"txns":2,"txnsPctChg":100,"fp":0.00003,"fpListingPrice":0.00003,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.09,"totalSupply":3000,"listedCount":214,"ownerCount":1511,"uniqueOwnerRatio":0.503666666666667,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-fractal_punks_pfp_1726287582181.jpeg","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":9214.62043018651,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/fractal-punks?cohort=ordinal\u0026window=7d\u0026currentFp=0.00003","description":"Fractal Punk Inscriptions unlocking access to the upcoming Fractionalized Punks on Fractal Bitcoin."},{"cohort":"ordinal","name":"Champions of Otherworldly Magic","collectionSymbol":"coom-battles","collectionId":"coom-battles","vol":0.0000538,"totalVol":0.31960261,"totalTxns":1485,"volPctChg":-75.98214286,"txns":19,"txnsPctChg":5.55555556,"fp":0.000002,"fpPctChg":-28.5714285714286,"fpListingPrice":0.000002,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.059968,"totalSupply":29984,"listedCount":2451,"ownerCount":5166,"uniqueOwnerRatio":0.172291889007471,"image":"https://bafybeicuhlxxfpxugb3qoz3iytmleci5lzjq4uhwbg3fqzt6dsai72azjm.ipfs.nftstorage.link/","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":6139.80397730472,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/coom-battles?cohort=ordinal\u0026window=7d\u0026currentFp=0.000002\u0026fpPctChg=-28.57142857142857","description":"30,000 1st edition TCG cards composed of 151 champions with different evolutions, elements, and abilities. Play now at CoOMBattles.com 🔮"},{"cohort":"ordinal","name":"RuneGo","collectionSymbol":"runego","collectionId":"runego","vol":0.000047,"totalVol":5.45520395,"totalTxns":3756,"txns":1,"fp":2e-8,"fpPctChg":-99.9574468085106,"fpListingPrice":2e-8,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.0002,"totalSupply":10000,"listedCount":1095,"ownerCount":7060,"uniqueOwnerRatio":0.706,"image":"https://nftstorage.link/ipfs/bafybeiftm62tol3wyxksaaicsi2o755fgrnaqvhnhhmccbiftd6s7nuo7m","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":20.4769342893033,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/runego?cohort=ordinal\u0026window=7d\u0026currentFp=2e-8\u0026fpPctChg=-99.95744680851064","description":"Embrace the Ordinals and Rune ecosystem on BTC."},{"cohort":"ordinal","name":" Puppetized ASCII","collectionSymbol":"puppetized_ascii","collectionId":"puppetized_ascii","vol":0.000045,"totalVol":0.61283154,"totalTxns":1959,"txns":1,"fp":0.000037,"fpPctChg":-17.7777777777778,"fpListingPrice":0.000037,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.249935,"totalSupply":6755,"listedCount":930,"ownerCount":1994,"uniqueOwnerRatio":0.295188749074759,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-puppetized_ascii_pfp_1709496134163.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":25589.5128579852,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/puppetized_ascii?cohort=ordinal\u0026window=7d\u0026currentFp=0.000037\u0026fpPctChg=-17.777777777777793","description":"Welcome to our quirky Puppetized ASCII collection! We're putting a hilarious spin on the original puppet crew by turning them into ASCII code! 🌎☮️ Join us on this quirky journey as we puppeteer our way to world peace, one pixelated character at a time. Let's code up some laughter and spread digital harmony!"},{"cohort":"ordinal","name":"PRIMZ","collectionSymbol":"primz","collectionId":"primz","vol":0.00004,"totalVol":0.13869955,"totalTxns":520,"volPctChg":-66.66666667,"txns":1,"txnsPctChg":-50,"fp":0.00004,"fpPctChg":-31.0344827586207,"fpListingPrice":0.00004,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.05316,"totalSupply":1329,"listedCount":316,"ownerCount":820,"uniqueOwnerRatio":0.617005267118134,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-primz_pfp_1727452108859.gif","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":5442.76913409683,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/primz?cohort=ordinal\u0026window=7d\u0026currentFp=0.00004\u0026fpPctChg=-31.034482758620683","description":"PRIMZ 1333 Primal BTC PFP Project | Powered by Primats | Unleash the Alpha"},{"cohort":"ordinal","name":"Quadkey","collectionSymbol":"quadkey","collectionId":"quadkey","vol":0.00004,"totalVol":0.14573557,"totalTxns":1814,"txns":2,"fp":0.00002,"fpListingPrice":0.00002,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.61556,"totalSupply":30778,"listedCount":2181,"ownerCount":1838,"uniqueOwnerRatio":0.059717980375593,"image":"https://bafkreifztpgw4ewc3trmibnu3anmrqdn53q4i3spbc5miw7ka3qxnz4js4.ipfs.nftstorage.link/","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":63023.9083556178,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/quadkey?cohort=ordinal\u0026window=7d\u0026currentFp=0.00002","description":"Quadkey is an Inscription project on Bitcoin Ordinals that utilizes a geospatial indexing standard to demonstrate several new underlying technologies. WARNING: this is experimental indexing, please DYOR and cross verify the data"},{"cohort":"ordinal","name":"Leonidas Stoned Dynasty (LSD)","collectionSymbol":"lsdbtc","collectionId":"lsdbtc","vol":0.0000395,"totalVol":0.19480368,"totalTxns":1078,"volPctChg":203.84615385,"txns":5,"txnsPctChg":400,"fp":0.000008,"fpPctChg":-46.6666666666667,"fpListingPrice":0.000008,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.041976,"totalSupply":5247,"listedCount":585,"ownerCount":2813,"uniqueOwnerRatio":0.536115875738517,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-lsdbtc_pfp_1711383208950.gif","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":4297.69896863899,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/lsdbtc?cohort=ordinal\u0026window=7d\u0026currentFp=0.000008\u0026fpPctChg=-46.666666666666664","description":"ᛤ 5250 LSDs as a tribute to RuneStones fans ᛤ"},{"cohort":"ordinal","name":"OrdiShrooms","collectionSymbol":"ordishrooms","collectionId":"ordishrooms","vol":0.0000372,"totalVol":0.39036249,"totalTxns":1872,"txns":3,"fp":0.000037,"fpListingPrice":0.000037,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.227106,"totalSupply":6138,"listedCount":845,"ownerCount":1679,"uniqueOwnerRatio":0.273541870316064,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-ordishrooms_pfp_1704863001387.jpeg","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":23252.1731935326,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/ordishrooms?cohort=ordinal\u0026window=7d\u0026currentFp=0.000037","description":"6K Shrooms on Bitcoin: Exploring the enigmatic world of shrooms"},{"cohort":"ordinal","name":"GameStone","collectionSymbol":"gamestone","collectionId":"gamestone","vol":0.000036,"totalVol":11.03879652,"totalTxns":23387,"volPctChg":-91.17647059,"txns":4,"txnsPctChg":-75,"fp":0.000002,"fpPctChg":-80,"fpListingPrice":0.000002,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.225554,"totalSupply":112777,"listedCount":3973,"ownerCount":72450,"uniqueOwnerRatio":0.642418223573956,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-gamestone_pfp_1711341046483.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":23093.2721834476,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/gamestone?cohort=ordinal\u0026window=7d\u0026currentFp=0.000002\u0026fpPctChg=-80","description":"Are you stoned mfers ready for the largest airdrop in Bitcoin History!?"},{"cohort":"ordinal","name":"Claimed ZBIT Loot Box","collectionSymbol":"claimed-zbit-loot-box","collectionId":"claimed-zbit-loot-box","vol":0.00003,"totalVol":2.04810426,"totalTxns":2285,"volPctChg":-66.66666667,"txns":1,"txnsPctChg":-66.66666667,"fp":0.00003,"fpListingPrice":0.00003,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.10173,"totalSupply":3391,"listedCount":269,"ownerCount":655,"uniqueOwnerRatio":0.193158360365674,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-claimed-zbit-loot-box_pfp_1721174292573.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":10415.5926262541,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/claimed-zbit-loot-box?cohort=ordinal\u0026window=7d\u0026currentFp=0.00003","description":"Claimed ZBIT Loot Box,These already won a prize for their holder in-game"},{"cohort":"ordinal","name":"Inscribed Space - Founders Pass","collectionSymbol":"insrc-founders-pass","collectionId":"insrc-founders-pass","vol":0.00003,"totalVol":3.57361585,"totalTxns":308,"txns":1,"fp":0.0006,"fpPctChg":-14.2857142857143,"fpListingPrice":0.0006,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.4662,"totalSupply":777,"listedCount":101,"ownerCount":537,"uniqueOwnerRatio":0.691119691119691,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-insrc-founders-pass_pfp_1705079504630.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":47731.7338283661,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/insrc-founders-pass?cohort=ordinal\u0026window=7d\u0026currentFp=0.0006\u0026fpPctChg=-14.28571428571429","description":"Your gateway to the Inscribed Space ecosystem."},{"cohort":"ordinal","name":"NATimated cats","collectionSymbol":"naticats","collectionId":"naticats","vol":0.00003,"totalVol":0.25852201,"totalTxns":1109,"txns":1,"fp":0.0000589,"fpPctChg":-1.81696949491582,"fpListingPrice":0.0000589,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.4749696,"totalSupply":8064,"listedCount":1043,"ownerCount":452,"uniqueOwnerRatio":0.0560515873015873,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-naticats_pfp_1710876400455.gif","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":48629.6064430835,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/naticats?cohort=ordinal\u0026window=7d\u0026currentFp=0.0000589\u0026fpPctChg=-1.816969494915821","description":"First animated UNAT PFP collection."},{"cohort":"ordinal","name":"bOMB","collectionSymbol":"bomb","collectionId":"bomb","vol":0.000028,"totalVol":1.93273943,"totalTxns":1940,"volPctChg":-92.96482412,"txns":1,"txnsPctChg":-80,"fp":0.00002,"fpListingPrice":0.00002,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.06658,"totalSupply":3329,"listedCount":1027,"ownerCount":1659,"uniqueOwnerRatio":0.49834785220787,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-bomb_pfp_1715184504112.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":6816.77142490908,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/bomb?cohort=ordinal\u0026window=7d\u0026currentFp=0.00002","description":"bOMBing the motherchain. The Young Cabal"},{"cohort":"ordinal","name":"THE PROPHECY","collectionSymbol":"the-prophecy","collectionId":"the-prophecy","vol":0.000023,"totalVol":7.23838777,"totalTxns":11646,"txns":1,"fp":0.000015,"fpPctChg":-34.7826086956522,"fpListingPrice":0.000015,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.675,"totalSupply":45000,"listedCount":2473,"ownerCount":29166,"uniqueOwnerRatio":0.648133333333333,"image":"https://bafybeiarvz76demnq4auq33f5pl7wn2vgutmfwqlf43t225e2uu54ma6hy.ipfs.nftstorage.link/","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":69109.6532263988,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/the-prophecy?cohort=ordinal\u0026window=7d\u0026currentFp=0.000015\u0026fpPctChg=-34.78260869565217","description":"Special Runestone Open Edition Pizza Ninja. WL snapshot taken of all unlisted Runestones, Pizza Ninjas, and Wizards of Ord."},{"cohort":"ordinal","name":"NodeDogzz 🟠","collectionSymbol":"nodedogzz","collectionId":"nodedogzz","vol":0.00002,"totalVol":0.22426568,"totalTxns":1642,"txns":1,"fp":0.00004,"fpListingPrice":0.00004,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.39372,"totalSupply":9843,"listedCount":1399,"ownerCount":2644,"uniqueOwnerRatio":0.268617291476176,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-nodedogzz_pfp_1709500448134.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":40310.8928419226,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/nodedogzz?cohort=ordinal\u0026window=7d\u0026currentFp=0.00004","description":"The first original 10k collection of NodeDogzz inscribed on bitcoin."},{"cohort":"ordinal","name":"Rune Rats","collectionSymbol":"runeratscoin","collectionId":"runeratscoin","vol":0.00002,"totalVol":6.80893235,"totalTxns":2392,"txns":2,"fp":0.00001,"fpListingPrice":0.00001,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.5,"totalSupply":50000,"listedCount":694,"ownerCount":40698,"uniqueOwnerRatio":0.81396,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-runeratscoin_pfp_1712144054912.jpeg","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":51192.3357232584,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/runeratscoin?cohort=ordinal\u0026window=7d\u0026currentFp=0.00001","description":"🔥 Powered by RATS Community▣ RuneRats ▣ ᚱᚨᛏᛊ 👑 Meme Emperor"},{"cohort":"ordinal","name":"OrdiDuel - Social-Fi On Ordinals","collectionSymbol":"ordiduel","collectionId":"ordiduel","vol":0.00002,"totalVol":0.45289149,"totalTxns":712,"volPctChg":-81.48148148,"txns":2,"txnsPctChg":-50,"fp":0.000019,"fpPctChg":-29.6296296296296,"fpListingPrice":0.000019,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.321423,"totalSupply":16917,"listedCount":616,"ownerCount":12650,"uniqueOwnerRatio":0.747768516876515,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-ordiduel_pfp_1721755619000.png","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":32908.7882503538,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/ordiduel?cohort=ordinal\u0026window=7d\u0026currentFp=0.000019\u0026fpPctChg=-29.629629629629626","description":"The first Social-Fi product on Ordinals. An experimental social trading card game. Made exclusively by Ordinal Maxis, for Ordinal Maxis. Using the REX dynamic Ordinal standard to dynamically update trading cards based on twitter activity, $REX holdings and other scoring mechanics. - Click on the images of any of the inscriptions in the collection to view the on-chain DUELPAPER, outlining all mechanics and rules."},{"cohort":"ordinal","name":"BRC20 piin","collectionSymbol":"brc20_piin","collectionId":"brc20_piin","vol":0.0000178,"totalVol":0.0000178,"totalTxns":4,"txns":4,"fp":0.000001,"fpListingPrice":0.000001,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.001393,"totalSupply":1393,"listedCount":4,"ownerCount":8287,"uniqueOwnerRatio":5.94903086862886,"image":"","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":142.621847324998,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/brc20_piin?cohort=ordinal\u0026window=7d\u0026currentFp=0.000001","description":""},{"cohort":"ordinal","name":"Noisex","collectionSymbol":"dmt-noisex","collectionId":"dmt-noisex","vol":0.00001,"totalVol":0.23590427,"totalTxns":694,"txns":1,"fp":0.00001,"fpPctChg":-85.7142857142857,"fpListingPrice":0.00001,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.02016,"totalSupply":2016,"listedCount":307,"ownerCount":220,"uniqueOwnerRatio":0.109126984126984,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-dmt-noisex_pfp_1710172867441.gif","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":2064.07497636178,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/dmt-noisex?cohort=ordinal\u0026window=7d\u0026currentFp=0.00001\u0026fpPctChg=-85.71428571428571","description":"Introducing Noisex, the first animated digital collection inscribed as DMT.But what is DMT, you ask? Digital Matter Theory unveils the possibility of crafting a digital substance by tapping into the inherent patterns woven within data.Our journey began with the discovery of a peculiar pattern nestled within select Bitcoin blocks, marked by the enigmatic sequence \\"},{"cohort":"ordinal","name":"BitcoinToad Punks","collectionSymbol":"btctoadpunks","collectionId":"btctoadpunks","vol":0.00001,"totalVol":0.10831565,"totalTxns":819,"volPctChg":-98.86363636,"txns":1,"txnsPctChg":-90.90909091,"fp":0.000084,"fpPctChg":740,"fpListingPrice":0.000084,"fpListingCurrency":"BTC","highestGlobalOfferBidCurrency":"BTC","marketCap":0.445956,"totalSupply":5309,"listedCount":446,"ownerCount":1939,"uniqueOwnerRatio":0.365228856658504,"image":"https://creator-hub-prod.s3.us-east-2.amazonaws.com/ord-btctoadpunks_pfp_1704557084183.jpeg","isCompressed":false,"hasInscriptions":false,"currency":"BTC","pending":0,"currencyUsdRate":102384.671446517,"marketCapUsd":45659.0585396028,"fpSparkLinePath":"/collection_stats/getCollectionSparkline/btctoadpunks?cohort=ordinal\u0026window=7d\u0026currentFp=0.000084\u0026fpPctChg=739.9999999999999","description":"10000 BitcoinToad Punks on the Bitcoin blockchain. No roadmap. Just !vibes. CC0 public domain project."}]` ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/magiceden/structs.go ================================================ package magiceden type MagicedenInscriptionInfo struct { Id string `json:"id"` ContentURI string `json:"contentURI"` ContentType string `json:"contentType"` ContentPreviewURI string `json:"contentPreviewURI"` Sat int64 `json:"sat"` SatName string `json:"satName"` SatRarity string `json:"satRarity"` SatBlockHeight int `json:"satBlockHeight"` SatBlockTime string `json:"satBlockTime"` Satributes []string `json:"satributes"` GenesisTransaction string `json:"genesisTransaction"` GenesisTransactionBlockTime string `json:"genesisTransactionBlockTime"` GenesisTransactionBlockHeight int `json:"genesisTransactionBlockHeight"` GenesisTransactionBlockHash string `json:"genesisTransactionBlockHash"` InscriptionNumber int `json:"inscriptionNumber"` Meta struct { Name string `json:"name"` Attributes []struct { TraitType string `json:"trait_type"` Value string `json:"value"` } `json:"attributes"` } `json:"meta"` Chain string `json:"chain"` Owner string `json:"owner"` CollectionSymbol string `json:"collectionSymbol"` Collection struct { Symbol string `json:"symbol"` Name string `json:"name"` ImageURI string `json:"imageURI"` Chain string `json:"chain"` InscriptionIcon string `json:"inscriptionIcon"` Description string `json:"description"` Supply int `json:"supply"` TwitterLink string `json:"twitterLink"` DiscordLink string `json:"discordLink"` WebsiteLink string `json:"websiteLink"` CreatedAt string `json:"createdAt"` OverrideContentType string `json:"overrideContentType"` DisableRichThumbnailGeneration bool `json:"disableRichThumbnailGeneration"` Labels []interface{} `json:"labels"` CreatorTipsAddress string `json:"creatorTipsAddress"` EnableCollectionOffer bool `json:"enableCollectionOffer"` } `json:"collection"` ItemType string `json:"itemType"` Location string `json:"location"` LocationBlockHeight int `json:"locationBlockHeight"` LocationBlockTime string `json:"locationBlockTime"` LocationBlockHash string `json:"locationBlockHash"` OutputValue int `json:"outputValue"` Output string `json:"output"` Listed bool `json:"listed"` ListedAt string `json:"listedAt"` ListedPrice int `json:"listedPrice"` ListedMakerFeeBp int `json:"listedMakerFeeBp"` ListedSellerReceiveAddress string `json:"listedSellerReceiveAddress"` ListedForMint bool `json:"listedForMint"` SacAddress string `json:"sacAddress"` SacMerkleTreeSize int `json:"sacMerkleTreeSize"` DisplayName string `json:"displayName"` LastSalePrice int `json:"lastSalePrice"` UpdatedAt string `json:"updatedAt"` } type CollectionInfo struct { Symbol string `json:"symbol"` Name string `json:"name"` ImageURI string `json:"imageURI"` Chain string `json:"chain"` InscriptionIcon string `json:"inscriptionIcon"` Description string `json:"description"` Supply int `json:"supply"` TwitterLink string `json:"twitterLink"` DiscordLink string `json:"discordLink"` WebsiteLink string `json:"websiteLink"` CreatedAt string `json:"createdAt"` OverrideContentType string `json:"overrideContentType"` DisableRichThumbnailGeneration bool `json:"disableRichThumbnailGeneration"` Labels []interface{} `json:"labels"` CreatorTipsAddress string `json:"creatorTipsAddress"` EnableCollectionOffer bool `json:"enableCollectionOffer"` } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/moralis/client.go ================================================ package moralis import ( "bytes" "encoding/json" "fmt" "io" "io/ioutil" "net/http" "net/url" ) type Client struct { APIKey string } func (c *Client) doWithAuth(req *http.Request) (*http.Response, error) { client := &http.Client{} return client.Do(req) } func (c *Client) postJSON(apiURL string, headers map[string]string, jsonObject interface{}, result interface{}) error { bodyBytes, _ := json.Marshal(jsonObject) req, err := http.NewRequest(http.MethodPost, apiURL, bytes.NewBuffer(bodyBytes)) if err != nil { return err } req.Header.Add("Content-Type", "application/json") for k, v := range headers { req.Header.Add(k, v) } resp, err := c.doWithAuth(req) if err != nil { return fmt.Errorf("failed request: %v", err) } if resp.StatusCode >= 300 { bodyBytes, err := ioutil.ReadAll(resp.Body) if err != nil { return fmt.Errorf("http response bad status %d %s", resp.StatusCode, err.Error()) } return fmt.Errorf("http response bad status %d %s", resp.StatusCode, string(bodyBytes)) } if result != nil { return json.NewDecoder(resp.Body).Decode(result) } return nil } func (c *Client) getJSON(url string, headers map[string]string, result interface{}) (int, error) { req, err := http.NewRequest(http.MethodGet, url, nil) if err != nil { return 0, fmt.Errorf("failed to create request: %v", err) } req.Header.Add("Content-Type", "application/json") for k, v := range headers { req.Header.Add(k, v) } resp, err := c.doWithAuth(req) if err != nil { return 0, fmt.Errorf("failed request: %v", err) } if resp.StatusCode >= 300 { bodyBytes, err := io.ReadAll(resp.Body) if err != nil { return resp.StatusCode, fmt.Errorf("http response bad status %d %s", resp.StatusCode, err.Error()) } return resp.StatusCode, fmt.Errorf("http response bad status %d %s", resp.StatusCode, string(bodyBytes)) } if result != nil { return resp.StatusCode, json.NewDecoder(resp.Body).Decode(result) } return resp.StatusCode, nil } type GetNFTsResp struct { Total int `json:"total"` Page int `json:"page"` PageSize int `json:"page_size"` Cursor string `json:"cursor"` Result []interface{} `json:"result"` Status string `json:"status"` } func (c *Client) GetNFTs(chain string, address string, cursor string, limit int) (*GetNFTsResp, error) { if limit <= 0 { limit = 500 } rs := GetNFTsResp{} _, err := c.getJSON( fmt.Sprintf("https://deep-index.moralis.io/api/v2/%s/nft?chain=%s&format=decimal&cursor=%s&limit=%d", url.QueryEscape(address), url.QueryEscape(chain), url.QueryEscape(cursor), limit), map[string]string{ "X-API-Key": c.APIKey, }, &rs, ) if err != nil { return nil, err } return &rs, nil } type TimeRange struct { OneHour float64 `json:"1h"` FourHour float64 `json:"4h"` TwelveHour float64 `json:"12h"` TwentyFourHour float64 `json:"24h"` } type TrendingToken struct { ChainId string `json:"chainId"` TokenAddress string `json:"tokenAddress"` Name string `json:"name"` UniqueName string `json:"uniqueName"` Symbol string `json:"symbol"` Decimals int `json:"decimals"` Logo string `json:"logo"` UsdPrice float64 `json:"usdPrice"` CreatedAt int64 `json:"createdAt"` MarketCap float64 `json:"marketCap"` LiquidityUsd float64 `json:"liquidityUsd"` Holders int `json:"holders"` PricePercentChange TimeRange `json:"pricePercentChange"` TotalVolume TimeRange `json:"totalVolume"` Transactions TimeRange `json:"transactions"` BuyTransactions TimeRange `json:"buyTransactions"` SellTransactions TimeRange `json:"sellTransactions"` Buyers TimeRange `json:"buyers"` Sellers TimeRange `json:"sellers"` } func (c *Client) GetTrendingTokens(chain string) ([]TrendingToken, error) { url := fmt.Sprintf("https://deep-index.moralis.io/api/v2.2/tokens/trending?chain=%s&limit=100", url.QueryEscape(chain)) var tokens []TrendingToken _, err := c.getJSON( url, map[string]string{ "X-API-Key": c.APIKey, }, &tokens, ) if err != nil { return nil, err } return tokens, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/moralis/moralis.go ================================================ package moralis import ( "bytes" "encoding/json" "errors" "fmt" "io" "net/http" "net/url" "strconv" "strings" ) type MoralisNfts struct { serverURL string apiKey string Chain string } const ( MORALIS_ETH = "eth" MORALIS_BASE = "base" ) func NewMoralisNfts(chain, moralisApiKey string) *MoralisNfts { serverURL := "https://deep-index.moralis.io/api/v2.2" return &MoralisNfts{ serverURL: serverURL, apiKey: moralisApiKey, Chain: chain, } } func (m MoralisNfts) generateUrl(path string, filters *MoralisFilter) string { fullUrl := fmt.Sprintf("%s/%s", m.serverURL, path) if filters != nil { params := url.Values{} if filters.Chain != nil { params[KeyChain] = []string{ *filters.Chain, } } else { params[KeyChain] = []string{ m.Chain, } } if filters.Format != nil { params[KeyFormat] = []string{ *filters.Format, } } if filters.Limit != nil { if *filters.Limit != 0 { params[KeyLimit] = []string{ strconv.Itoa(*filters.Limit), } } } if filters.TotalRanges != nil { if *filters.TotalRanges != 0 { params[KeyTotalRanges] = []string{ strconv.Itoa(*filters.TotalRanges), } } } if filters.Range != nil { if *filters.Range != 0 { params[KeyRange] = []string{ strconv.Itoa(*filters.Range), } } } if filters.Cursor != nil { if *filters.Cursor != "" { params[KeyCurrsor] = []string{ *filters.Cursor, } } } if filters.TokenAddresses != nil { tokenAddresses := *filters.TokenAddresses if len(tokenAddresses) > 0 { params[KeyTokenAddresses] = tokenAddresses } } if filters.NormalizeMetadata != nil { if *filters.NormalizeMetadata { params[NormalizeMetadata] = []string{"true"} } else { params[NormalizeMetadata] = []string{"false"} } } fullUrl = fullUrl + "?" + params.Encode() } return fullUrl } func (m MoralisNfts) request(fullUrl string, method string, headers map[string]string, reqBody io.Reader) ([]byte, error) { req, err := http.NewRequest(method, fullUrl, reqBody) if err != nil { return nil, err } if len(headers) > 0 { for key, val := range headers { req.Header.Add(key, val) } } req.Header.Add("accept", "application/json") req.Header.Add("content-type", "application/json") req.Header.Add("X-API-Key", m.apiKey) res, err := http.DefaultClient.Do(req) if err != nil { return nil, err } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { return nil, err } return body, nil } func (m MoralisNfts) GetNftByContract(contractAddr string, f MoralisFilter) (*MoralisTokensResp, error) { url := fmt.Sprintf("%s/%s", URLNft, contractAddr) // Todo: review this url fullUrl := m.generateUrl(url, &f) data, err := m.request(fullUrl, "GET", nil, nil) if err != nil { return nil, err } resp := &MoralisTokensResp{} err = json.Unmarshal(data, resp) if err != nil { return nil, err } return resp, nil } func (m MoralisNfts) GetNftCollectionMetadataByContract(contractAddr string, f MoralisFilter) (*NFTCollectionMetadata, error) { url := fmt.Sprintf("%s/%s/metadata", URLNft, contractAddr) // Todo: review this url fullUrl := m.generateUrl(url, &f) data, err := m.request(fullUrl, "GET", nil, nil) if err != nil { return nil, err } resp := &NFTCollectionMetadata{} err = json.Unmarshal(data, resp) if err != nil { return nil, err } return resp, nil } func (m MoralisNfts) GetNftByWalletAddress(wallletAddress string, filter MoralisFilter) (*MoralisTokensResp, error) { url := fmt.Sprintf("%s/%s", wallletAddress, URLNft) fullUrl := m.generateUrl(url, &filter) data, err := m.request(fullUrl, "GET", nil, nil) if err != nil { return nil, err } resp := &MoralisTokensResp{} err = json.Unmarshal(data, resp) if err != nil { return nil, err } return resp, nil } func (m MoralisNfts) GetMultipleNfts(f MoralisGetMultipleNftsFilter) ([]MoralisToken, error) { url := fmt.Sprintf("%s/%s", URLNft, "getMultipleNFTs") fullUrl := m.generateUrl(url, &MoralisFilter{Chain: f.Chain}) var buf bytes.Buffer err := json.NewEncoder(&buf).Encode(f.ReqBody) if err != nil { return nil, err } data, err := m.request(fullUrl, "POST", nil, &buf) if err != nil { return nil, err } var resp []MoralisToken err = json.Unmarshal(data, &resp) if err != nil { messageResp := &MoralisMessage{} err = json.Unmarshal(data, &messageResp) if err != nil { return nil, err } return nil, errors.New(messageResp.Message) } return resp, nil } func (m MoralisNfts) GetNftByContractAndTokenIDNoCahe(contractAddr string, tokenID string) (*MoralisToken, error) { nfts, err := m.GetMultipleNfts(MoralisGetMultipleNftsFilter{ Chain: nil, ReqBody: MoralisGetMultipleNftsReqBody{ Tokens: []NftFilter{ { TokenAddress: contractAddr, TokenId: tokenID, }, }, }, }) if err != nil { return nil, err } if len(nfts) != 1 { return nil, errors.New("cannot find moralis token") } nft := nfts[0] return &nft, nil } func (m MoralisNfts) AddressBalance(walletAddress string) (*MoralisBalanceResp, error) { fullUrl := m.generateUrl(fmt.Sprintf("%s/%s", walletAddress, WalletAddressBalance), &MoralisFilter{}) data, err := m.request(fullUrl, "GET", nil, nil) if err != nil { return nil, err } resp := &MoralisBalanceResp{} if string(data) == `{"message":"Invalid key"}` { return nil, errors.New("invalid key") } if strings.Contains(string(data), "limit") { return nil, errors.New("rate limit") } err = json.Unmarshal(data, resp) if err != nil { return nil, err } return resp, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/moralis/structure.go ================================================ package moralis import ( "strings" "time" ) const ( KeyOwner string = "owner" KeyLimit string = "limit" KeyOffset string = "offset" KeyCurrsor string = "cursor" KeyTokenAddresses string = "token_addresses" KeyChain string = "chain" KeyFormat string = "format" KeyTotalRanges string = "totalRanges" KeyRange string = "range" URLAssets string = "assets" URLNft string = "nft" WalletAddressBalance string = "balance" WalletAddressTokenBalance string = "erc20" NormalizeMetadata string = "normalizeMetadata" ) var ChainToChainID = map[string]string{ "mumbai": "80001", "goerli": "5", } type NftFilter struct { TokenAddress string `json:"token_address"` TokenId string `json:"token_id"` } type MoralisGetMultipleNftsReqBody struct { Tokens []NftFilter `json:"tokens"` NormalizeMetadata *bool `json:"normalizeMetadata,omitempty"` MediaItems *bool `json:"media_items,omitempty"` } type MoralisGetMultipleNftsFilter struct { Chain *string `json:"chain"` ReqBody MoralisGetMultipleNftsReqBody } type MoralisFilter struct { Chain *string `json:"chain"` Format *string `json:"format"` Limit *int `json:"limit"` TotalRanges *int `json:"totalRanges"` Range *int `json:"range"` Cursor *string `json:"cursor"` TokenAddresses *[]string `json:"token_addresses"` NormalizeMetadata *bool `json:"normalizeMetadata"` } type MoralisTokensResp struct { Total int `json:"total"` Page int `json:"page"` PageSize int `json:"page_size"` Cursor string `json:"cursor"` Result []MoralisToken `json:"result"` } type MoralisBalanceResp struct { Balance string `json:"balance"` TokenAddress string `json:"token_address"` } type MoralisToken struct { TokenAddress string `json:"token_address"` TokenID string `json:"token_id"` Amount string `json:"amount"` Owner string `json:"owner_of"` TokenHash string `json:"token_hash"` ContractType string `json:"contract_type"` Name string `json:"name"` Symbol string `json:"symbol"` TokenUri string `json:"token_uri"` MetadataString *string `json:"metadata"` BlockNumberMinted string `json:"block_number_minted"` // Custom Metadata *MoralisTokenMetadata `json:"normalized_metadata,omitempty"` } func (s MoralisToken) IsERC1155Type() bool { return strings.ToUpper(s.ContractType) == "ERC1155" } type InscribeBTC struct { Status int `json:"status"` ProjectTokenId string `json:"project_token_id"` InscriptionID string `json:"inscription_id"` } type MoralisTokenMetadata struct { Image string `json:"image"` Name string `json:"name"` Description string `json:"description"` ExternalLink string `json:"external_link"` AnimationUrl string `json:"animation_url"` Attributes []Trait `json:"attributes"` } type Trait struct { TraitType string `json:"trait_type"` Value interface{} `json:"value"` DisplayType interface{} `json:"display_type"` MaxValue interface{} `json:"max_value"` TraitCount int `json:"trait_count"` Order interface{} `json:"order"` RarityLabel string `json:"rarity_label"` Count int `json:"count"` Percentage float64 `json:"percentage"` } // Covalent structures type CovalentNftTransactionFilter struct { Chain *string ContractAddress string TokenID string } type CovalentGetTokenHolderRequest struct { ContractAddress string Chain *string Page int32 Limit int32 } type CovalentGetAllTokenHolderRequest struct { ContractAddress string Chain *string Limit int32 } type CovalentGetTokenHolderData struct { UpdatedAt time.Time `json:"updated_at"` Items []struct { ContractDecimals int `json:"contract_decimals"` ContractName string `json:"contract_name"` ContractTickerSymbol string `json:"contract_ticker_symbol"` ContractAddress string `json:"contract_address"` SupportsErc interface{} `json:"supports_erc"` LogoURL string `json:"logo_url"` Address string `json:"address"` Balance string `json:"balance"` TotalSupply string `json:"total_supply"` BlockHeight int `json:"block_height"` } `json:"items"` Pagination struct { HasMore bool `json:"has_more"` PageNumber int `json:"page_number"` PageSize int `json:"page_size"` TotalCount interface{} `json:"total_count"` } `json:"pagination"` } type CovalentGetTokenHolderResponse struct { Data CovalentGetTokenHolderData `json:"data"` Error bool `json:"error"` ErrorMessage interface{} `json:"error_message"` ErrorCode interface{} `json:"error_code"` } type CovalentGetNftTransactionResponse struct { Data CovalentGetNftTransactionData `json:"data"` Error bool `json:"error"` ErrorMessage interface{} `json:"error_message"` ErrorCode interface{} `json:"error_code"` } type CovalentGetNftTransactionData struct { UpdatedAt time.Time `json:"updated_at"` Items []struct { ContractDecimals int `json:"contract_decimals"` ContractName string `json:"contract_name"` ContractTickerSymbol string `json:"contract_ticker_symbol"` ContractAddress string `json:"contract_address"` SupportsErc []string `json:"supports_erc"` LogoURL string `json:"logo_url"` Type string `json:"type"` NftTransactions []struct { BlockSignedAt time.Time `json:"block_signed_at"` BlockHeight int `json:"block_height"` TxHash string `json:"tx_hash"` TxOffset int `json:"tx_offset"` Successful bool `json:"successful"` FromAddress string `json:"from_address"` FromAddressLabel interface{} `json:"from_address_label"` ToAddress string `json:"to_address"` ToAddressLabel interface{} `json:"to_address_label"` Value string `json:"value"` ValueQuote interface{} `json:"value_quote"` GasOffered int `json:"gas_offered"` GasSpent int `json:"gas_spent"` GasPrice int `json:"gas_price"` FeesPaid string `json:"fees_paid"` GasQuote interface{} `json:"gas_quote"` GasQuoteRate interface{} `json:"gas_quote_rate"` LogEvents []struct { BlockSignedAt time.Time `json:"block_signed_at"` BlockHeight int `json:"block_height"` TxOffset int `json:"tx_offset"` LogOffset int `json:"log_offset"` TxHash string `json:"tx_hash"` RawLogTopics []string `json:"raw_log_topics"` SenderContractDecimals interface{} `json:"sender_contract_decimals"` SenderName interface{} `json:"sender_name"` SenderContractTickerSymbol interface{} `json:"sender_contract_ticker_symbol"` SenderAddress string `json:"sender_address"` SenderAddressLabel interface{} `json:"sender_address_label"` SenderLogoURL interface{} `json:"sender_logo_url"` RawLogData string `json:"raw_log_data"` Decoded interface{} `json:"decoded"` } `json:"log_events"` } `json:"nft_transactions"` } `json:"items"` Pagination interface{} `json:"pagination"` } type MoralisMessage struct { Message string `json:"message"` Err error } type NFTCollectionMetadata struct { TokenAddress string `json:"token_address"` Name string `json:"name"` SyncedAt time.Time `json:"synced_at"` Symbol string `json:"symbol"` ContractType string `json:"contract_type"` PossibleSpam bool `json:"possible_spam"` VerifiedCollection bool `json:"verified_collection"` CollectionLogo string `json:"collection_logo"` CollectionBannerImage string `json:"collection_banner_image"` CollectionCategory string `json:"collection_category"` ProjectUrl string `json:"project_url"` WikiUrl string `json:"wiki_url"` DiscordUrl string `json:"discord_url"` TelegramUrl string `json:"telegram_url"` TwitterUsername string `json:"twitter_username"` InstagramUsername string `json:"instagram_username"` Tokens []MoralisToken `json:"tokens"` Page int `json:"page"` PageSize int `json:"page_size"` Cursor string `json:"cursor"` } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/openai/openai.go ================================================ package openai import ( "bytes" "context" "encoding/json" "errors" "fmt" "io" "math/rand" "net/http" "strings" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/logger" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/serializers" "github.com/sashabaranov/go-openai" "go.uber.org/zap" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" ) type OpenAI struct { BaseURL string ApiKey string AutoAgentApiUrl string ModelName string } type ChatResponse struct { Id string `json:"id"` Choices []*struct { Index int `json:"index"` Message *struct { Content string `json:"content"` Role string `json:"role"` } `json:"message"` FinishReason string `json:"finish_reason"` } `json:"choices"` Model string `json:"model"` Object string `json:"object"` Created int64 `json:"created"` Usage *struct { PromptTokens int `json:"prompt_tokens"` TotalTokens int `json:"total_tokens"` CompletionTokens int `json:"completion_tokens"` } `json:"usage"` } func NewOpenAI(baseUrl, apiKey string, modelName string) *OpenAI { return &OpenAI{ BaseURL: baseUrl, ApiKey: apiKey, ModelName: modelName, } } func NewAgentAI(apiKey string) *OpenAI { return &OpenAI{ ApiKey: apiKey, } } func (c OpenAI) ChatMessage(msgChat string) (string, error) { seed := models.RandSeed() path := fmt.Sprintf("%s/v1/chat/completions", c.BaseURL) bodyReq := map[string]interface{}{ "model": c.ModelName, "stream": false, "seed": seed, } var err error logKey := "ChatMessage" tracerData := logger.NewTracerData() tracerData.Add("msgChat", msgChat) tracerData.Add("path", path) // log here defer func() { if err != nil { logger.Error("OpenAI", logKey, zap.Any("data", tracerData.Data()), zap.Error(err)) } else { logger.Info("OpenAI", logKey, zap.Any("data", tracerData.Data())) } }() contents := []map[string]string{} contents = append(contents, map[string]string{"role": "system", "content": "You are a helpful assistant"}) contents = append(contents, map[string]string{"role": "user", "content": msgChat}) bodyReq["messages"] = contents tracerData.Add("bodyReq", bodyReq) //jsonString, _ := json.Marshal(bodyReq) //fmt.Println(string(jsonString)) chatResp := "" bodyBytes, _ := json.Marshal(bodyReq) req, err := http.NewRequest("POST", path, bytes.NewBuffer(bodyBytes)) if err != nil { return chatResp, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", c.ApiKey)) req.Header.Set("Content-Type", "application/json") req.Header.Set("Accept-Type", "application/json") resp, err := http.DefaultClient.Do(req) if err != nil { return chatResp, err } defer resp.Body.Close() body, err := io.ReadAll(resp.Body) if err != nil { return chatResp, err } tracerData.Add("bodyReq", string(body)) m := ChatResponse{} err = json.Unmarshal(body, &m) if err != nil { return chatResp, err } tracerData.Add("bodyReq.Parsed", m) if m.Choices != nil && len(m.Choices) > 0 { data := m.Choices[0] if data.Message != nil && data.Message.Content != "" { chatResp = data.Message.Content } } tracerData.Add("chatResp", chatResp) return chatResp, nil } func (c OpenAI) ChatMessageWithSystemPromp(msgChat, systemContent string) (string, error) { seed := models.RandSeed() path := fmt.Sprintf("%s/v1/chat/completions", c.BaseURL) bodyReq := map[string]interface{}{ "model": c.ModelName, "stream": false, "seed": seed, } contents := []map[string]string{} contents = append(contents, map[string]string{"role": "system", "content": systemContent}) contents = append(contents, map[string]string{"role": "user", "content": msgChat}) bodyReq["messages"] = contents chatResp := "" bodyBytes, _ := json.Marshal(bodyReq) req, err := http.NewRequest("POST", path, bytes.NewBuffer(bodyBytes)) if err != nil { return chatResp, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", c.ApiKey)) req.Header.Set("Content-Type", "application/json") req.Header.Set("Accept-Type", "application/json") resp, err := http.DefaultClient.Do(req) if err != nil { return chatResp, err } defer resp.Body.Close() body, err := io.ReadAll(resp.Body) if err != nil { return chatResp, err } m := ChatResponse{} err = json.Unmarshal(body, &m) if err != nil { return chatResp, err } if m.Choices != nil && len(m.Choices) > 0 { data := m.Choices[0] if data.Message != nil && data.Message.Content != "" { chatResp = data.Message.Content } } return chatResp, nil } func (c OpenAI) TestAgentPersinality(systemPrompt, userPrompt, baseUrl string) (string, error) { seed := models.RandSeed() bodyReq := map[string]interface{}{ "model": "NousResearch/Hermes-3-Llama-3.1-70B-FP8", // "temperature": 0.01, "stream": false, "seed": seed, } contents := []map[string]string{} contents = append(contents, map[string]string{"role": "system", "content": systemPrompt}) contents = append(contents, map[string]string{"role": "user", "content": userPrompt}) bodyReq["messages"] = contents chatResp := "" bodyBytes, _ := json.Marshal(bodyReq) req, err := http.NewRequest("POST", baseUrl, bytes.NewBuffer(bodyBytes)) if err != nil { return chatResp, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", c.ApiKey)) req.Header.Set("Content-Type", "application/json") req.Header.Set("Accept-Type", "application/json") resp, err := http.DefaultClient.Do(req) if err != nil { return chatResp, err } defer resp.Body.Close() body, err := io.ReadAll(resp.Body) if err != nil { return chatResp, err } m := ChatResponse{} err = json.Unmarshal(body, &m) if err != nil { return chatResp, err } if m.Choices != nil && len(m.Choices) > 0 { data := m.Choices[0] if data.Message != nil && data.Message.Content != "" { chatResp = data.Message.Content } } return chatResp, nil } func (c OpenAI) CallDirectlyEternalLLMV2(input map[string]interface{}, baseUrl string) (string, error) { chatResp := "" bodyBytes, _ := json.Marshal(input) req, err := http.NewRequest("POST", baseUrl, bytes.NewBuffer(bodyBytes)) if err != nil { return chatResp, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", c.ApiKey)) req.Header.Set("Content-Type", "application/json") req.Header.Set("Accept-Type", "application/json") resp, err := http.DefaultClient.Do(req) if err != nil { return chatResp, err } defer resp.Body.Close() body, err := io.ReadAll(resp.Body) if err != nil { return chatResp, err } m := ChatResponse{} err = json.Unmarshal(body, &m) if err != nil { return chatResp, err } if m.Choices != nil && len(m.Choices) > 0 { data := m.Choices[0] if data.Message != nil && data.Message.Content != "" { chatResp = data.Message.Content } } return chatResp, nil } func (c OpenAI) CallEternalLLMOnchain(input map[string]interface{}, baseUrl string) (map[string]interface{}, error) { bodyBytes, _ := json.Marshal(input) req, err := http.NewRequest("POST", baseUrl, bytes.NewBuffer(bodyBytes)) if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", c.ApiKey)) req.Header.Set("Content-Type", "application/json") req.Header.Set("Accept-Type", "application/json") resp, err := http.DefaultClient.Do(req) if err != nil { return nil, err } defer resp.Body.Close() body, err := io.ReadAll(resp.Body) if err != nil { return nil, err } m := map[string]interface{}{} err = json.Unmarshal(body, &m) return m, err } func (c OpenAI) CallDirectlyEternalLLM(messages, model, baseUrl string, options map[string]interface{}) (string, error) { seed := models.RandSeed() bodyReq := map[string]interface{}{ "model": model, "stream": false, "seed": seed, } for k, v := range options { bodyReq[k] = v } contents := []map[string]string{} err := json.Unmarshal([]byte(messages), &contents) bodyReq["messages"] = contents chatResp := "" bodyBytes, _ := json.Marshal(bodyReq) req, err := http.NewRequest("POST", baseUrl, bytes.NewBuffer(bodyBytes)) if err != nil { return chatResp, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", c.ApiKey)) req.Header.Set("Content-Type", "application/json") req.Header.Set("Accept-Type", "application/json") resp, err := http.DefaultClient.Do(req) if err != nil { return chatResp, err } defer resp.Body.Close() body, err := io.ReadAll(resp.Body) if err != nil { return chatResp, err } m := ChatResponse{} err = json.Unmarshal(body, &m) if err != nil { return chatResp, err } if m.Choices != nil && len(m.Choices) > 0 { data := m.Choices[0] if data.Message != nil && data.Message.Content != "" { chatResp = data.Message.Content } } return chatResp, nil } func (c OpenAI) CallStreamDirectlyEternalLLM(ctx context.Context, messages, model, baseUrl string, options map[string]interface{}, outputChan chan *models.ChatCompletionStreamResponse, errChan chan error, doneChan chan bool) { seed := rand.Int() var contents []openai.ChatCompletionMessage err := json.Unmarshal([]byte(messages), &contents) config := openai.DefaultConfig("") baseUrl = strings.Replace(baseUrl, "/chat/completions", "", 1) config.BaseURL = baseUrl client := openai.NewClientWithConfig(config) llmRequest := openai.ChatCompletionRequest{ Model: model, Stream: true, Seed: &seed, Messages: contents, } if value, ok := options["top_p"]; ok { llmRequest.TopP, _ = value.(float32) } if value, ok := options["max_tokens"]; ok { llmRequest.MaxTokens, _ = value.(int) } if value, ok := options["temperature"]; ok { llmRequest.Temperature, _ = value.(float32) } stream, err := client.CreateChatCompletionStream( ctx, llmRequest, ) if err != nil { errChan <- err return } defer stream.Close() for { body, err := stream.RecvRaw() if errors.Is(err, io.EOF) { doneChan <- true break } var response models.ChatCompletionStreamResponse err = json.Unmarshal(body, &response) if err != nil { errChan <- fmt.Errorf("error when receive data from ai server: %v", err) return } outputChan <- &response } return } func (c OpenAI) CallStreamDirectlyEternalLLMV2(ctx context.Context, messages []openai.ChatCompletionMessage, model, baseUrl string, options map[string]interface{}) (string, error) { seed := rand.Int() config := openai.DefaultConfig("") baseUrl = strings.Replace(baseUrl, "/chat/completions", "", 1) config.BaseURL = baseUrl client := openai.NewClientWithConfig(config) llmRequest := openai.ChatCompletionRequest{ Model: model, Stream: true, Seed: &seed, Messages: messages, } if value, ok := options["top_p"]; ok { llmRequest.TopP, _ = value.(float32) } if value, ok := options["max_tokens"]; ok { llmRequest.MaxTokens, _ = value.(int) } if value, ok := options["temperature"]; ok { llmRequest.Temperature, _ = value.(float32) } stream, err := client.CreateChatCompletionStream( ctx, llmRequest, ) if err != nil { return "", err } defer stream.Close() thinking := false output := "" for { body, err := stream.RecvRaw() if errors.Is(err, io.EOF) { break } var res models.ChatCompletionStreamResponse err = json.Unmarshal(body, &res) if err != nil { return "", fmt.Errorf("error when receive data from ai server: %v", err) } if res.Choices[0].Delta.Content != "" { if strings.Contains(res.Choices[0].Delta.Content, "") { thinking = true } else if strings.Contains(res.Choices[0].Delta.Content, "") { thinking = false continue } if !thinking { output += res.Choices[0].Delta.Content } } } return output, nil } func (c OpenAI) CallStreamOnchainEternalLLM(ctx context.Context, baseUrl string, apiKey string, llmRequest openai.ChatCompletionRequest, outputChan chan *models.ChatCompletionStreamResponse, errChan chan error, doneChan chan bool) { config := openai.DefaultConfig(apiKey) baseUrl = strings.Replace(baseUrl, "/chat/completions", "", 1) config.BaseURL = baseUrl client := openai.NewClientWithConfig(config) stream, err := client.CreateChatCompletionStream( ctx, llmRequest, ) if err != nil { errChan <- err return } defer stream.Close() for { body, err := stream.RecvRaw() if errors.Is(err, io.EOF) { doneChan <- true break } var response models.ChatCompletionStreamResponse err = json.Unmarshal(body, &response) if err != nil { errChan <- fmt.Errorf("error when receive data from ai server: %v", err) return } outputChan <- &response } return } func (c OpenAI) TestAgentPersinalityV1(messages, baseUrl string) (string, error) { seed := models.RandSeed() bodyReq := map[string]interface{}{ "model": "NousResearch/Hermes-3-Llama-3.1-70B-FP8", "stream": false, "seed": seed, } contents := []map[string]string{} err := json.Unmarshal([]byte(messages), &contents) bodyReq["messages"] = contents chatResp := "" bodyBytes, _ := json.Marshal(bodyReq) req, err := http.NewRequest("POST", baseUrl, bytes.NewBuffer(bodyBytes)) if err != nil { return chatResp, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", c.ApiKey)) req.Header.Set("Content-Type", "application/json") req.Header.Set("Accept-Type", "application/json") resp, err := http.DefaultClient.Do(req) if err != nil { return chatResp, err } defer resp.Body.Close() body, err := io.ReadAll(resp.Body) if err != nil { return chatResp, err } m := ChatResponse{} err = json.Unmarshal(body, &m) if err != nil { return chatResp, err } if m.Choices != nil && len(m.Choices) > 0 { data := m.Choices[0] if data.Message != nil && data.Message.Content != "" { chatResp = data.Message.Content } } return chatResp, nil } func (c OpenAI) SummaryWebContent(webContent string) (string, error) { path := fmt.Sprintf("%s/v1/chat/completions", c.BaseURL) seed := models.RandSeed() bodyReq := map[string]interface{}{ "model": "neuralmagic/Meta-Llama-3.1-405B-Instruct-quantized.w4a16", // "max_tokens": 200, "temperature": 0.01, "stream": false, "seed": seed, } userPrompt := fmt.Sprintf(`Summarize this crawled content, just reply summary without any additional explanation:\n%s`, webContent) contents := []map[string]string{} contents = append(contents, map[string]string{"role": "system", "content": `You are a helpful assistant summarizing content from web crawls. Your goal is to produce a concise, readable summary that preserves the text's original meaning, context, and key language. Remove any irrelevant details and focus on the main points, correcting grammar as needed for clarity. Ensure the summary flows logically, retains essential information, and is accurate, clear, and well-structured.`}) contents = append(contents, map[string]string{"role": "user", "content": userPrompt}) bodyReq["messages"] = contents chatResp := "" bodyBytes, _ := json.Marshal(bodyReq) req, err := http.NewRequest("POST", path, bytes.NewBuffer(bodyBytes)) if err != nil { return chatResp, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", c.ApiKey)) req.Header.Set("Content-Type", "application/json") req.Header.Set("Accept-Type", "application/json") resp, err := http.DefaultClient.Do(req) if err != nil { return chatResp, err } defer resp.Body.Close() body, err := io.ReadAll(resp.Body) if err != nil { return chatResp, err } m := ChatResponse{} err = json.Unmarshal(body, &m) if err != nil { return chatResp, err } if m.Choices != nil && len(m.Choices) > 0 { data := m.Choices[0] if data.Message != nil && data.Message.Content != "" { chatResp = data.Message.Content } } return chatResp, nil } type AgentThinking struct { Question string `json:"question"` Thought string `json:"thought"` Action string `json:"action"` ActionInput string `json:"action_input"` Observation string `json:"observation"` FinalAnswer string `json:"final_answer"` } func (c OpenAI) AgentChats(systemPrompt, baseUrl string, messages serializers.AgentChatMessageReq) (*ChatResponse, error) { m := ChatResponse{} modelName := c.ModelName if modelName == "" { modelName = "NousResearch/Hermes-3-Llama-3.1-70B-FP8" } seed := models.RandSeed() bodyReq := map[string]interface{}{ "model": modelName, "stream": false, "seed": seed, } contents := []map[string]string{} contents = append(contents, map[string]string{"role": "system", "content": systemPrompt}) for _, item := range messages.Messages { contents = append(contents, map[string]string{"role": item.Role, "content": item.Content}) } bodyReq["messages"] = contents bodyBytes, _ := json.Marshal(bodyReq) req, err := http.NewRequest("POST", baseUrl, bytes.NewBuffer(bodyBytes)) if err != nil { return &m, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", c.ApiKey)) req.Header.Set("Content-Type", "application/json") req.Header.Set("Accept-Type", "application/json") resp, err := http.DefaultClient.Do(req) if err != nil { return &m, err } defer resp.Body.Close() body, err := io.ReadAll(resp.Body) if err != nil { return &m, err } err = json.Unmarshal(body, &m) if err != nil { return &m, err } return &m, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/openai/utils.go ================================================ package openai import ( openai2 "github.com/sashabaranov/go-openai" ) func GetSystemPromptFromLLMMessage(messages []openai2.ChatCompletionMessage) string { systemPrompt := "" for _, message := range messages { if message.Role == openai2.ChatMessageRoleSystem { systemPrompt = message.Content break } } return systemPrompt } func GetQuestionFromLLMMessage(messages []openai2.ChatCompletionMessage) string { question := "" for _, message := range messages { if message.Role == openai2.ChatMessageRoleUser { question = message.Content } } return question } func UpdateSystemPromptInLLMRequest(message []openai2.ChatCompletionMessage, systemPrompt string) []openai2.ChatCompletionMessage { for i, m := range message { if m.Role == openai2.ChatMessageRoleSystem { message[i].Content = systemPrompt break } } return message } func LastUserPrompt(messages []openai2.ChatCompletionMessage) string { lastUserPrompt := "" for i := len(messages) - 1; i >= 0; i-- { if messages[i].Role == openai2.ChatMessageRoleUser { lastUserPrompt = messages[i].Content break } } return lastUserPrompt } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/opensea/opensea.go ================================================ package opensea import ( "context" "encoding/json" "fmt" "net/url" "strings" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/helpers" ) const ( API_URL string = "https://api.opensea.io/api" ) type OpenseaService struct { apiKey string //b5400021ebc9489a9fe8a4544f663b53 headers map[string]string } type HardCodeCollection struct { Address string Chain string Slug string ChainID int } func (s *OpenseaService) AdditionBaseCollections() map[string]HardCodeCollection { result := make(map[string]HardCodeCollection) result["misato-frens"] = HardCodeCollection{ Address: "0xccb6b629f5434102e37175bdac8262722180a62f", Chain: "base", Slug: "misato-frens", ChainID: 8453, } result["chonks"] = HardCodeCollection{ Address: "0x07152bfde079b5319e5308c43fb1dbc9c76cb4f9", Chain: "base", Slug: "chonks", ChainID: 8453, } return result } func (s *OpenseaService) IsInAdditionalCollections(slug string) *HardCodeCollection { for k, i := range s.AdditionBaseCollections() { if strings.EqualFold(k, slug) { return &i } } return nil } func (s *OpenseaService) FindHardCodeCollectionByAddress(address string) *HardCodeCollection { for _, i := range s.AdditionBaseCollections() { if strings.EqualFold(i.Address, address) { return &i } } return nil } func NewOpensea(apiKey string) *OpenseaService { if apiKey == "" { apiKey = "b5400021ebc9489a9fe8a4544f663b53" } headers := make(map[string]string) headers["accept"] = "application/json" headers["x-api-Key"] = apiKey return &OpenseaService{ apiKey: apiKey, headers: headers, } } func (s *OpenseaService) GetProfileAvatar(addr string) (string, error) { fullUrl := fmt.Sprintf("%s/v1/user/%s", API_URL, addr) resp := User{} _bytes, _, _, err := helpers.HttpRequest(fullUrl, "GET", s.headers, nil) if err != nil { return "", err } err = json.Unmarshal(_bytes, &resp) if err != nil { return "", err } return resp.Account.ProfileImgUrl, nil } func (s *OpenseaService) OpenseaGetContract(ctx context.Context, address string, chain string) (*OpenseaGetContract, error) { fullUrl := fmt.Sprintf("%s/v2/chain/%s/contract/%s", API_URL, chain, address) _bytes, _, _, err := helpers.HttpRequest(fullUrl, "GET", s.headers, nil) if err != nil { return nil, err } resp := &OpenseaGetContract{} err = json.Unmarshal(_bytes, resp) if err != nil { return nil, err } return resp, nil } func (s *OpenseaService) OpenseaGetCollections(ctx context.Context, f OpenSeaFilterCollections) (*CollectionsResp, error) { params := url.Values{} if f.Chain != "" { params.Set("chain", f.Chain) } if f.CreatorUsername != "" { params.Set("creator_username", f.CreatorUsername) } if f.IncludeHidden != nil { params.Set("include_hidden", fmt.Sprintf("%v", *f.IncludeHidden)) } if f.Limit != 0 { params.Set("limit", fmt.Sprintf("%d", f.Limit)) } if f.Next != "" { params.Set("next", f.Next) } if f.OrderBy != "" { params.Set("order_by", f.OrderBy) } else { params.Set("order_by", "created_date") //default: create date } fullUrl := fmt.Sprintf("%s/v2/collections", API_URL) if len(params) > 0 { fullUrl += "?" + params.Encode() } _bytes, _, _, err := helpers.HttpRequest(fullUrl, "GET", s.headers, nil) if err != nil { return nil, err } resp := &CollectionsResp{} err = json.Unmarshal(_bytes, resp) if err != nil { return nil, err } //add collections aCollections := s.AdditionBaseCollections() type additionalCollection struct { Err error Data *SingleCollectionResp Slug string } out := make(chan additionalCollection, len(aCollections)) for addCollection, _ := range aCollections { go func(addCollection string, out chan additionalCollection) { ad, addErr := s.OpenseaGetSingleCollection(ctx, addCollection) if addErr != nil { out <- additionalCollection{ Err: addErr, Data: nil, Slug: addCollection, } return } ad.Chain = "base" out <- additionalCollection{ Err: addErr, Data: ad, Slug: addCollection, } }(addCollection, out) } for range aCollections { data := <-out if data.Err != nil { fmt.Println(data.Slug + "--" + data.Err.Error()) continue } if data.Data == nil { fmt.Println(data.Slug + "-- nil") continue } fmt.Println(data.Slug + "-- is appended") resp.Collections = append(resp.Collections, *data.Data) } return resp, nil } func (s *OpenseaService) OpenseaGetSingleCollection(ctx context.Context, collectionSlug string) (*SingleCollectionResp, error) { fullUrl := fmt.Sprintf("%s/v2/collections/%s", API_URL, collectionSlug) _bytes, _, _, err := helpers.HttpRequest(fullUrl, "GET", s.headers, nil) if err != nil { return nil, err } resp := &SingleCollectionResp{} err = json.Unmarshal(_bytes, resp) if err != nil { return nil, err } a := s.IsInAdditionalCollections(resp.Collection) if a != nil { resp.Chain = a.Chain } return resp, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/opensea/structures.go ================================================ package opensea type User struct { Username string `json:"username"` Account Account `json:"account"` } type Account struct { ProfileImgUrl string `json:"profile_img_url"` } type OpenseaGetContract struct { Address string `json:"address"` Collection string `json:"collection"` Name string `json:"name"` } type OpenseaGetCollectionStats struct { Total OpenseaGetCollectionStatsTotal `json:"total"` } type OpenseaGetCollectionStatsTotal struct { FloorPrice interface{} `json:"floor_price"` } type OpenSeaFilterCollections struct { Chain string CreatorUsername string IncludeHidden *bool Limit int //The number of collections to return. Must be between 1 and 100. Default: 100 Next string //The cursor for the next page of results. This is returned from a previous request. OrderBy string Inscription *bool } type CollectionsResp struct { Collections []SingleCollectionResp `json:"collections"` Next string `json:"next"` } type SingleCollectionResp struct { Collection string `json:"collection"` Name string `json:"name"` Description string `json:"description"` ImageUrl string `json:"image_url"` BannerImageUrl string `json:"banner_image_url"` Owner string `json:"owner"` SafelistStatus string `json:"safelist_status"` Category string `json:"category"` IsDisabled bool `json:"is_disabled"` IsNsfw bool `json:"is_nsfw"` TraitOffersEnabled bool `json:"trait_offers_enabled"` CollectionOffersEnabled bool `json:"collection_offers_enabled"` OpenseaUrl string `json:"opensea_url"` ProjectUrl string `json:"project_url"` WikiUrl string `json:"wiki_url"` DiscordUrl string `json:"discord_url"` TelegramUrl string `json:"telegram_url"` TwitterUsername string `json:"twitter_username"` InstagramUsername string `json:"instagram_username"` Chain string `json:"chain"` Contracts []ContractResp `json:"contracts"` } type ContractResp struct { Address string `json:"address"` Chain string `json:"chain"` } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/privy/privy_client.go ================================================ package privy import ( "bytes" "encoding/json" "fmt" "io" "net/http" ) type Client struct { BaseURL string AppID string AppSecret string } func NewPrivyClient(appID, appSecret string) *Client { return &Client{ AppID: appID, AppSecret: appSecret, BaseURL: "https://auth.privy.io/api/v1", } } func (c *Client) buildUrl(resourcePath string) string { if resourcePath != "" { return c.BaseURL + "/" + resourcePath } return c.BaseURL } func (c *Client) doWithoutAuth(req *http.Request) (*http.Response, error) { client := &http.Client{} return client.Do(req) } func (c *Client) methodJSON(method string, apiURL string, jsonObject interface{}, result interface{}) error { var buffer io.Reader if jsonObject != nil { bodyBytes, _ := json.Marshal(jsonObject) buffer = bytes.NewBuffer(bodyBytes) } req, err := http.NewRequest(method, apiURL, buffer) if err != nil { return err } req.Header.Add("Content-Type", "application/json") req.Header.Add("privy-app-id", c.AppID) resp, err := c.doWithoutAuth(req) if err != nil { return err } if resp.StatusCode >= 300 { bodyBytes, err := io.ReadAll(resp.Body) if err != nil { return fmt.Errorf("http response bad status %d %s", resp.StatusCode, err.Error()) } return fmt.Errorf("http response bad status %d %s", resp.StatusCode, string(bodyBytes)) } if result != nil { return json.NewDecoder(resp.Body).Decode(result) } return nil } type LinkedAccountReq struct { Type string `json:"type"` Subject string `json:"subject"` Name string `json:"name"` Username string `json:"username"` } type LinkedAccountResp struct { Address string `json:"address"` Type string `json:"type"` Subject string `json:"subject"` Name string `json:"name"` Username string `json:"username"` } type CreateUserReq struct { CreateEthereumWallet bool `json:"create_ethereum_wallet"` LinkedAccounts []LinkedAccountReq `json:"linked_accounts"` } type CreateUserResp struct { ID string `json:"id"` LinkedAccounts []LinkedAccountResp `json:"linked_accounts"` WalletAddresses []string `json:"wallet_addresses"` } func (c *Client) CreateUser(req *CreateUserReq) (*CreateUserResp, error) { resp := &CreateUserResp{} // Create request with basic auth err := c.methodJSONWithAuth( http.MethodPost, c.buildUrl("users"), req, resp, ) if err != nil { return nil, err } return resp, nil } func (c *Client) CreateUserEx(req *CreateUserReq, appID, appSecret string) (*CreateUserResp, error) { resp := &CreateUserResp{} // Create request with basic auth err := c.methodJSONWithAuthEx( http.MethodPost, c.buildUrl("users"), appID, appSecret, req, resp, ) if err != nil { return nil, err } return resp, nil } func (c *Client) methodJSONWithAuth(method string, apiURL string, jsonObject interface{}, result interface{}) error { var buffer io.Reader if jsonObject != nil { bodyBytes, _ := json.Marshal(jsonObject) buffer = bytes.NewBuffer(bodyBytes) } req, err := http.NewRequest(method, apiURL, buffer) if err != nil { return err } // Add basic auth req.SetBasicAuth(c.AppID, c.AppSecret) // Add headers req.Header.Add("Content-Type", "application/json") req.Header.Add("privy-app-id", c.AppID) resp, err := c.doWithoutAuth(req) if err != nil { return err } if resp.StatusCode >= 300 { bodyBytes, err := io.ReadAll(resp.Body) if err != nil { return fmt.Errorf("http response bad status %d %s", resp.StatusCode, err.Error()) } return fmt.Errorf("http response bad status %d %s", resp.StatusCode, string(bodyBytes)) } if result != nil { return json.NewDecoder(resp.Body).Decode(result) } return nil } func (c *Client) methodJSONWithAuthEx(method, apiURL, appID, appSecret string, jsonObject interface{}, result interface{}) error { var buffer io.Reader if jsonObject != nil { bodyBytes, _ := json.Marshal(jsonObject) buffer = bytes.NewBuffer(bodyBytes) } req, err := http.NewRequest(method, apiURL, buffer) if err != nil { return err } // Add basic auth req.SetBasicAuth(appID, appSecret) // Add headers req.Header.Add("Content-Type", "application/json") req.Header.Add("privy-app-id", appID) resp, err := c.doWithoutAuth(req) if err != nil { return err } if resp.StatusCode >= 300 { bodyBytes, err := io.ReadAll(resp.Body) if err != nil { return fmt.Errorf("http response bad status %d %s", resp.StatusCode, err.Error()) } return fmt.Errorf("http response bad status %d %s", resp.StatusCode, string(bodyBytes)) } if result != nil { return json.NewDecoder(resp.Body).Decode(result) } return nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/pumfun/client.go ================================================ package pumfun import ( "fmt" "net/http" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/helpers" ) type Client struct { BaseUrl string } type PumpFunTradeResp struct { Signature string `json:"signature"` Mint string `json:"mint"` SolAmount int64 `json:"sol_amount"` TokenAmount int64 `json:"token_amount"` IsBuy bool `json:"is_buy"` Timestamp int64 `json:"timestamp"` } func (e *Client) GetPumpFunTrades(mint string, page int, limit int) ([]*PumpFunTradeResp, error) { var rs []*PumpFunTradeResp err := helpers.CurlURL( fmt.Sprintf( "%s/trades/all/%s?offset=%d&limit=%d&minimumSize=0", e.BaseUrl, mint, (page-1)*limit, limit, ), http.MethodGet, make(map[string]string), nil, &rs, ) if err != nil { return nil, err } return rs, nil } type PumpFunCoinInfoResp struct { Mint string `json:"mint"` Name string `json:"name"` Symbol string `json:"symbol"` TotalSupply int64 `json:"total_supply"` UsdMarketCap float64 `json:"usd_market_cap"` RaydiumPool string `json:"raydium_pool"` } func (e *Client) GetPumpFunCoinInfo(mint string) (*PumpFunCoinInfoResp, error) { var rs PumpFunCoinInfoResp err := helpers.CurlURL( fmt.Sprintf( "%s/coins/%s", e.BaseUrl, mint, ), http.MethodGet, make(map[string]string), nil, &rs, ) if err != nil { return nil, err } return &rs, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/rapid/rapid.go ================================================ package rapid import ( "encoding/json" "fmt" "io" "net/http" "strings" "time" ) type Rapid struct { url string host string apiKey string } type RapidUser struct { ID uint `json:"id"` } type RapidTweetSummaryInfo struct { Address string TweetID string ParentTweetID string TwitterID string TwitterName string TwitterUsername string TwitterAvatar string TwitterFollowersCount uint FavoriteCount int BookmarkCount int QuoteCount int ReplyCount int RetweetCount int ViewCount string FullText string PostedAt time.Time UserMentions []string } func (m *RapidTweetSummaryInfo) IsMention(username string) bool { for _, v := range m.UserMentions { if strings.EqualFold(v, username) { return true } } return false } type RapidSearchResponse struct { Data *struct { SearchByRawQuery *struct { SearchTimeline *struct { Timeline *struct { Instructions []*struct { Type string `json:"type"` Entries []*struct { Content *struct { EntryType string `json:"entryType,omitempty"` CursorType string `json:"cursorType,omitempty"` Value string `json:"value,omitempty"` ItemContent *struct { TweetResults *struct { Result *struct { TypeName string `json:"__typename,omitempty"` Views *struct { Count string `json:"count,omitempty"` } `json:"views,omitempty"` Core *struct { UserResults *struct { Results *struct { TwitterID string `json:"rest_id,omitempty"` IsBlueVerified bool `json:"is_blue_verified,omitempty"` Legacy *struct { Name string `json:"name,omitempty"` Username string `json:"screen_name,omitempty"` ProfileUrl string `json:"profile_image_url_https,omitempty"` FollowersCount uint `json:"followers_count,omitempty"` } `json:"legacy,omitempty"` } `json:"result,omitempty"` } `json:"user_results,omitempty"` } `json:"core,omitempty"` Legacy *struct { Entities *struct { Hashtags []*struct { Text string `json:"text,omitempty"` } `json:"hashtags,omitempty"` UserMentions []*struct { ID string `json:"id_str,omitempty"` ScreenName string `json:"screen_name,omitempty"` } `json:"user_mentions,omitempty"` } `json:"entities,omitempty"` UserID string `json:"user_id_str,omitempty"` ID string `json:"id_str,omitempty"` CreatedAt string `json:"created_at,omitempty"` FavoriteCount int `json:"favorite_count,omitempty"` QuoteCount int `json:"quote_count,omitempty"` ReplyCount int `json:"reply_count,omitempty"` RetweetCount int `json:"retweet_count,omitempty"` FullText string `json:"full_text,omitempty"` InReplyToScreenName string `json:"in_reply_to_screen_name,omitempty"` InReplyToStatusID string `json:"in_reply_to_status_id_str,omitempty"` InReplyToUserID string `json:"in_reply_to_user_id_str,omitempty"` } `json:"legacy,omitempty"` } `json:"result,omitempty"` } `json:"tweet_results,omitempty"` } `json:"itemContent,omitempty"` } `json:"content,omitempty"` } `json:"entries,omitempty"` } `json:"instructions"` } `json:"timeline"` } `json:"search_timeline"` } `json:"search_by_raw_query"` } `json:"data"` } type TweetContent struct { ItemType string `json:"itemType"` TweetResults *struct { Result *struct { RestID string `json:"rest_id"` Core *struct { UserResults *struct { Result *struct { ID string `json:"id"` RestID string `json:"rest_id"` AffiliatesHighlightedLabel struct{} `json:"affiliates_highlighted_label"` HasGraduatedAccess bool `json:"has_graduated_access"` IsBlueVerified bool `json:"is_blue_verified"` ProfileImageShape string `json:"profile_image_shape"` Legacy *struct { CanDM bool `json:"can_dm"` CanMediaTag bool `json:"can_media_tag"` CreatedAt string `json:"created_at"` DefaultProfile bool `json:"default_profile"` DefaultProfileImage bool `json:"default_profile_image"` Description string `json:"description"` FastFollowersCount int `json:"fast_followers_count"` FavouritesCount int `json:"favourites_count"` FollowersCount int `json:"followers_count"` FriendsCount int `json:"friends_count"` ListedCount int `json:"listed_count"` MediaCount int `json:"media_count"` Name string `json:"name"` ScreenName string `json:"screen_name"` StatusesCount int `json:"statuses_count"` Verified bool `json:"verified"` WithheldInCountries []string `json:"withheld_in_countries"` ProfileImageURLHTTPS string `json:"profile_image_url_https"` } `json:"legacy"` } `json:"result"` } `json:"user_results"` } `json:"core"` Card *struct { RestID string `json:"rest_id"` Legacy struct { Name string `json:"name"` URL string `json:"url"` } `json:"legacy"` } `json:"card"` Legacy *struct { BookmarkCount int `json:"bookmark_count"` Bookmarked bool `json:"bookmarked"` CreatedAt string `json:"created_at"` ConversationIDStr string `json:"conversation_id_str"` DisplayTextRange []int `json:"display_text_range"` Entities *struct { UserMentions []struct { IDStr string `json:"id_str"` Name string `json:"name"` ScreenName string `json:"screen_name"` Indices []int `json:"indices"` } `json:"user_mentions"` URLs []struct { DisplayURL string `json:"display_url"` ExpandedURL string `json:"expanded_url"` URL string `json:"url"` Indices []int `json:"indices"` } `json:"urls"` Hashtags []struct { Indices []int `json:"indices"` Text string `json:"text"` } `json:"hashtags"` Symbols []struct{} `json:"symbols"` } `json:"entities"` FavoriteCount int `json:"favorite_count"` Favorited bool `json:"favorited"` FullText string `json:"full_text"` IsQuoteStatus bool `json:"is_quote_status"` Lang string `json:"lang"` PossiblySensitive bool `json:"possibly_sensitive"` PossiblySensitiveEditable bool `json:"possibly_sensitive_editable"` QuoteCount int `json:"quote_count"` ReplyCount int `json:"reply_count"` RetweetCount int `json:"retweet_count"` Retweeted bool `json:"retweeted"` UserIDStr string `json:"user_id_str"` IDStr string `json:"id_str"` } `json:"legacy"` } `json:"result"` } `json:"tweet_results"` } type RapidTweetResponse struct { Data *struct { User *struct { Result *struct { TimelineV2 *struct { Timeline *struct { Instructions []struct { Type string `json:"type"` Entries []struct { EntryId string `json:"entryId"` SortIndex string `json:"sortIndex"` Content struct { EntryType string `json:"entryType"` CursorType string `json:"cursorType,omitempty"` Value string `json:"value,omitempty"` Items []struct { EntryId string `json:"entryId"` Item struct { ItemContent *TweetContent `json:"itemContent,omitempty"` } `json:"item"` } `json:"items,omitempty"` ItemContent *TweetContent `json:"itemContent,omitempty"` } `json:"content"` } `json:"entries"` } `json:"instructions"` } `json:"timeline"` } `json:"timeline_v2"` } `json:"result"` } `json:"user"` } `json:"data"` } func NewRapid(apiKey string) *Rapid { return &Rapid{ url: "https://twitter135.p.rapidapi.com/v2", host: "twitter135.p.rapidapi.com", apiKey: apiKey, } } func (m *Rapid) request(fullUrl string, method string, headers map[string]string, reqBody io.Reader) ([]byte, int, error) { req, err := http.NewRequest(method, fullUrl, reqBody) if err != nil { return nil, 0, err } if len(headers) > 0 { for key, val := range headers { req.Header.Add(key, val) } } req.Header.Add("accept", "application/json") req.Header.Add("content-type", "application/json") req.Header.Add("X-RapidAPI-Key", m.apiKey) req.Header.Add("X-RapidAPI-Host", m.host) res, err := http.DefaultClient.Do(req) if err != nil { return nil, 0, err } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { return nil, res.StatusCode, err } return body, res.StatusCode, nil } func (m *Rapid) SearchSpreadTwitterByUserName(cursor, twitterUserName string) ([]*RapidTweetSummaryInfo, string, error) { responses := []*RapidTweetSummaryInfo{} path := fmt.Sprintf("https://twitter135.p.rapidapi.com/Search/?q=(@%s)&cursor=%s", twitterUserName, cursor) fmt.Println(path) data, _, err := m.request(path, "GET", nil, nil) if err != nil { return responses, "", err } fmt.Println(string(data)) res := &RapidSearchResponse{} err = json.Unmarshal(data, res) if err != nil { return responses, "", err } numContent := uint(0) cursorTop := "" if res != nil && res.Data != nil && res.Data.SearchByRawQuery != nil && res.Data.SearchByRawQuery.SearchTimeline != nil && res.Data.SearchByRawQuery.SearchTimeline.Timeline != nil && res.Data.SearchByRawQuery.SearchTimeline.Timeline.Instructions != nil { for _, v := range res.Data.SearchByRawQuery.SearchTimeline.Timeline.Instructions { if v.Type == "TimelineAddEntries" { for _, item := range v.Entries { if item.Content.EntryType == "TimelineTimelineCursor" && item.Content.CursorType == "Top" { cursorTop = item.Content.Value } if item.Content.EntryType == "TimelineTimelineItem" { if item.Content != nil && item.Content.ItemContent != nil && item.Content.ItemContent.TweetResults != nil && item.Content.ItemContent.TweetResults.Result != nil && item.Content.ItemContent.TweetResults.Result.Legacy != nil && item.Content.ItemContent.TweetResults.Result.Core != nil && item.Content.ItemContent.TweetResults.Result.Core.UserResults != nil && item.Content.ItemContent.TweetResults.Result.Core.UserResults.Results != nil && item.Content.ItemContent.TweetResults.Result.Core.UserResults.Results.Legacy != nil { legacy := item.Content.ItemContent.TweetResults.Result.Legacy legacyUser := item.Content.ItemContent.TweetResults.Result.Core.UserResults.Results.Legacy isMention := false for _, t := range legacy.Entities.UserMentions { if strings.EqualFold(t.ScreenName, twitterUserName) { isMention = true } } if isMention { numContent += 1 layout := "Mon Jan 02 15:04:05 -0700 2006" t, err := time.Parse(layout, legacy.CreatedAt) if err == nil { responses = append(responses, &RapidTweetSummaryInfo{ TweetID: legacy.ID, TwitterID: legacy.UserID, ParentTweetID: legacy.InReplyToStatusID, TwitterName: legacyUser.Name, TwitterUsername: legacyUser.Username, TwitterAvatar: legacyUser.ProfileUrl, QuoteCount: legacy.QuoteCount, ReplyCount: legacy.ReplyCount, RetweetCount: legacy.RetweetCount, FullText: legacy.FullText, PostedAt: t, }) } } } } } } } } return responses, cursorTop, nil } type RapidTweetDetailResponse struct { Data *struct { Conversation *struct { Instructions []*struct { Type string `json:"type"` Entries []*struct { EntryId string `json:"entryId"` Content *struct { EntryType string `json:"entryType,omitempty"` CursorType string `json:"cursorType,omitempty"` Value string `json:"value,omitempty"` ItemContent *struct { TweetResults *struct { Result *struct { TypeName string `json:"__typename,omitempty"` Views *struct { Count string `json:"count,omitempty"` } `json:"views,omitempty"` Core *struct { UserResults *struct { Results *struct { TwitterID string `json:"rest_id,omitempty"` IsBlueVerified bool `json:"is_blue_verified,omitempty"` Legacy *struct { Name string `json:"name,omitempty"` Username string `json:"screen_name,omitempty"` ProfileUrl string `json:"profile_image_url_https,omitempty"` FollowersCount uint `json:"followers_count,omitempty"` } `json:"legacy,omitempty"` } `json:"result,omitempty"` } `json:"user_results,omitempty"` } `json:"core,omitempty"` Legacy *struct { Entities *struct { Hashtags []*struct { Text string `json:"text,omitempty"` } `json:"hashtags,omitempty"` UserMentions []*struct { ID string `json:"id_str,omitempty"` ScreenName string `json:"screen_name,omitempty"` } `json:"user_mentions,omitempty"` } `json:"entities,omitempty"` UserID string `json:"user_id_str,omitempty"` ID string `json:"id_str,omitempty"` CreatedAt string `json:"created_at,omitempty"` FavoriteCount int `json:"favorite_count,omitempty"` QuoteCount int `json:"quote_count,omitempty"` ReplyCount int `json:"reply_count,omitempty"` RetweetCount int `json:"retweet_count,omitempty"` BookmarkCount int `json:"bookmark_count,omitempty"` FullText string `json:"full_text,omitempty"` InReplyToScreenName string `json:"in_reply_to_screen_name,omitempty"` InReplyToStatusID string `json:"in_reply_to_status_id_str,omitempty"` InReplyToUserID string `json:"in_reply_to_user_id_str,omitempty"` } `json:"legacy,omitempty"` } `json:"result,omitempty"` } `json:"tweet_results,omitempty"` } `json:"itemContent,omitempty"` } `json:"content,omitempty"` } `json:"entries,omitempty"` } `json:"instructions"` } `json:"threaded_conversation_with_injections_v2"` } `json:"data"` } func (m Rapid) GetTweetDetailByID(tweetID string) (*RapidTweetSummaryInfo, error) { path := fmt.Sprintf("%s/TweetDetail/?id=%s", m.url, tweetID) data, _, err := m.request(path, "GET", nil, nil) if err != nil { return nil, err } fmt.Println(string(data)) resp := &RapidTweetDetailResponse{} err = json.Unmarshal(data, resp) if err != nil { return nil, err } if resp != nil && resp.Data != nil && resp.Data.Conversation != nil && resp.Data.Conversation.Instructions != nil && len(resp.Data.Conversation.Instructions) > 0 { for _, v := range resp.Data.Conversation.Instructions { if v.Type == "TimelineAddEntries" { for _, item := range v.Entries { if item.Content.EntryType == "TimelineTimelineItem" { if item.Content != nil && item.Content.ItemContent != nil && item.EntryId == fmt.Sprintf("tweet-%s", tweetID) && item.Content.ItemContent.TweetResults != nil && item.Content.ItemContent.TweetResults.Result != nil && item.Content.ItemContent.TweetResults.Result.Legacy != nil && item.Content.ItemContent.TweetResults.Result.Core != nil && item.Content.ItemContent.TweetResults.Result.Core.UserResults != nil && item.Content.ItemContent.TweetResults.Result.Core.UserResults.Results != nil && item.Content.ItemContent.TweetResults.Result.Core.UserResults.Results.Legacy != nil { legacy := item.Content.ItemContent.TweetResults.Result.Legacy legacyUser := item.Content.ItemContent.TweetResults.Result.Core.UserResults.Results.Legacy views := item.Content.ItemContent.TweetResults.Result.Views viewCount := "0" if views != nil { viewCount = views.Count } layout := "Mon Jan 02 15:04:05 -0700 2006" t, err := time.Parse(layout, legacy.CreatedAt) if err == nil { userMentions := []string{} if legacy != nil && legacy.Entities != nil && legacy.Entities.UserMentions != nil { for _, v := range legacy.Entities.UserMentions { userMentions = append(userMentions, v.ScreenName) } } return &RapidTweetSummaryInfo{ TweetID: legacy.ID, ParentTweetID: legacy.InReplyToStatusID, TwitterID: legacy.UserID, TwitterName: legacyUser.Name, TwitterUsername: legacyUser.Username, TwitterAvatar: legacyUser.ProfileUrl, TwitterFollowersCount: legacyUser.FollowersCount, QuoteCount: legacy.QuoteCount, ReplyCount: legacy.ReplyCount, RetweetCount: legacy.RetweetCount, FavoriteCount: legacy.FavoriteCount, BookmarkCount: legacy.BookmarkCount, ViewCount: viewCount, FullText: legacy.FullText, PostedAt: t, UserMentions: userMentions, }, nil } } } } } } } return nil, nil } func (m *Rapid) GetTweetByTwitterID(twitterID, cursor string) ([]*TweetContent, string, error) { path := fmt.Sprintf("https://twitter135.p.rapidapi.com/v2/UserTweets/?id=%s&cursor=%s", twitterID, cursor) fmt.Println(path) data, _, err := m.request(path, "GET", nil, nil) if err != nil { return nil, "", err } res := &RapidTweetResponse{} err = json.Unmarshal(data, res) if err != nil { return nil, "", err } cursorTop := "" listTweetContent := []*TweetContent{} if res != nil && res.Data != nil { for _, v := range res.Data.User.Result.TimelineV2.Timeline.Instructions { if v.Type == "TimelineAddEntries" { for _, item := range v.Entries { if item.Content.EntryType == "TimelineTimelineCursor" && item.Content.CursorType == "Top" { cursorTop = item.Content.Value } else { if item.Content.ItemContent != nil { listTweetContent = append(listTweetContent, item.Content.ItemContent) } else if len(item.Content.Items) > 0 { for _, child := range item.Content.Items { listTweetContent = append(listTweetContent, child.Item.ItemContent) } } } } } } } return listTweetContent, cursorTop, nil } func (m *Rapid) GetTweetByTwitterIDV1(twitterID, cursor string) ([]*RapidTweetSummaryInfo, string, error) { path := fmt.Sprintf("https://twitter135.p.rapidapi.com/v2/UserTweets/?id=%s&cursor=%s", twitterID, cursor) fmt.Println(path) data, _, err := m.request(path, "GET", nil, nil) if err != nil { return nil, "", err } res := &RapidTweetResponse{} err = json.Unmarshal(data, res) if err != nil { return nil, "", err } cursorTop := "" listTweetContent := []*TweetContent{} if res != nil && res.Data != nil { for _, v := range res.Data.User.Result.TimelineV2.Timeline.Instructions { if v.Type == "TimelineAddEntries" { for _, item := range v.Entries { if item.Content.EntryType == "TimelineTimelineCursor" && item.Content.CursorType == "Top" { cursorTop = item.Content.Value } else { if item.Content.ItemContent != nil { listTweetContent = append(listTweetContent, item.Content.ItemContent) } else if len(item.Content.Items) > 0 { for _, child := range item.Content.Items { listTweetContent = append(listTweetContent, child.Item.ItemContent) } } } } } } } resp := []*RapidTweetSummaryInfo{} for _, item := range listTweetContent { if item.TweetResults != nil && item.TweetResults.Result != nil && item.TweetResults.Result.Legacy != nil && item.TweetResults.Result.Core != nil && item.TweetResults.Result.Core.UserResults != nil && item.TweetResults.Result.Core.UserResults.Result != nil && item.TweetResults.Result.Core.UserResults.Result.Legacy != nil { legacy := item.TweetResults.Result.Legacy legacyUser := item.TweetResults.Result.Core.UserResults.Result.Legacy layout := "Mon Jan 02 15:04:05 -0700 2006" t, err := time.Parse(layout, legacy.CreatedAt) if err == nil { resp = append(resp, &RapidTweetSummaryInfo{ TweetID: legacy.ConversationIDStr, TwitterName: legacyUser.Name, QuoteCount: legacy.QuoteCount, ReplyCount: legacy.ReplyCount, RetweetCount: legacy.RetweetCount, FullText: legacy.FullText, PostedAt: t, }) } } } return resp, cursorTop, nil } type Following struct { ID string `json:"rest_id"` Username string `json:"screen_name"` Name string `json:"name"` ProfileImageUrl string `json:"profile_image_url_https"` FollowersCount int `json:"followers_count"` FollowingCount int `json:"friends_count"` IsBlueVerified bool `json:"is_blue_verified"` CreatedAt string `json:"created_at"` } type ResponseData struct { Data struct { User struct { Result struct { Timeline struct { Timeline struct { Instructions []struct { Type string `json:"type"` Entries []struct { EntryID string `json:"entryId"` SortIndex string `json:"sortIndex"` Content struct { EntryType string `json:"entryType"` Value string `json:"value"` CursorType string `json:"cursorType"` ItemContent struct { ItemType string `json:"itemType"` UserResults struct { Result struct { ID string `json:"rest_id"` IsBlueVerified bool `json:"is_blue_verified"` Legacy struct { ScreenName string `json:"screen_name"` Name string `json:"name"` ProfileImageUrl string `json:"profile_image_url_https"` FollowersCount int `json:"followers_count"` FriendsCount int `json:"friends_count"` IsVerified bool `json:"verified"` CreatedAt string `json:"created_at"` } `json:"legacy"` } `json:"result"` } `json:"user_results"` } `json:"itemContent"` } `json:"content"` } `json:"entries"` } `json:"instructions"` } `json:"timeline"` } `json:"timeline"` } `json:"result"` } `json:"user"` } `json:"data"` } func (m *Rapid) GetTwitterFollowings(userID string) ([]Following, error) { var followings []Following mapFollow := map[string]Following{} client := &http.Client{Timeout: 10 * time.Second} nextCursor := "" for { url := fmt.Sprintf("https://twitter135.p.rapidapi.com/v2/Following/?id=%s&count=100", userID) if nextCursor != "" { url += "&cursor=" + nextCursor } fmt.Println(len(mapFollow)) fmt.Println("url : " + url) req, _ := http.NewRequest("GET", url, nil) req.Header.Add("X-RapidAPI-Key", m.apiKey) req.Header.Add("X-RapidAPI-Host", "twitter135.p.rapidapi.com") resp, err := client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() body, _ := io.ReadAll(resp.Body) if resp.StatusCode != http.StatusOK { return nil, fmt.Errorf("failed to get followings, status: %s, body: %s", resp.Status, body) } var data ResponseData if err := json.Unmarshal(body, &data); err != nil { return nil, err } hasData := false // Parse each following entry for _, instruction := range data.Data.User.Result.Timeline.Timeline.Instructions { if instruction.Type == "TimelineAddEntries" { for _, entry := range instruction.Entries { if entry.Content.EntryType == "TimelineTimelineItem" && entry.Content.ItemContent.ItemType == "TimelineUser" { user := entry.Content.ItemContent.UserResults.Result legacy := user.Legacy following := Following{ ID: user.ID, IsBlueVerified: user.IsBlueVerified, Username: legacy.ScreenName, Name: legacy.Name, ProfileImageUrl: legacy.ProfileImageUrl, FollowersCount: legacy.FollowersCount, FollowingCount: legacy.FriendsCount, CreatedAt: legacy.CreatedAt, } followings = append(followings, following) mapFollow[following.ID] = following hasData = true } } } } // Look for the next cursor in the response nextCursor = "" for _, instruction := range data.Data.User.Result.Timeline.Timeline.Instructions { for _, entry := range instruction.Entries { if entry.Content.EntryType == "TimelineTimelineCursor" && entry.Content.CursorType == "Bottom" { nextCursor = entry.Content.Value } } } // Exit if there are no more pages if nextCursor == "" || !hasData { break } } return followings, nil } type TwitterDetail struct { TwitterID string TwitterName string TwitterUsername string TwitterAvatar string } func (m Rapid) IsPostForFaucetAgent(code string) (*TwitterDetail, error) { path := fmt.Sprintf(`https://twitter135.p.rapidapi.com/Search/?q="%s"`, code) data, _, err := m.request(path, "GET", nil, nil) if err != nil { return nil, err } res := &RapidSearchResponse{} err = json.Unmarshal(data, res) if err != nil { return nil, err } numContent := uint(0) if res != nil && res.Data != nil && res.Data.SearchByRawQuery != nil && res.Data.SearchByRawQuery.SearchTimeline != nil && res.Data.SearchByRawQuery.SearchTimeline.Timeline != nil && res.Data.SearchByRawQuery.SearchTimeline.Timeline.Instructions != nil { for _, v := range res.Data.SearchByRawQuery.SearchTimeline.Timeline.Instructions { if v.Type == "TimelineAddEntries" { for _, item := range v.Entries { if item.Content.EntryType == "TimelineTimelineItem" { if item.Content != nil && item.Content.ItemContent != nil && item.Content.ItemContent.TweetResults != nil && item.Content.ItemContent.TweetResults.Result != nil && item.Content.ItemContent.TweetResults.Result.Legacy != nil && item.Content.ItemContent.TweetResults.Result.Core != nil && item.Content.ItemContent.TweetResults.Result.Core.UserResults != nil && item.Content.ItemContent.TweetResults.Result.Core.UserResults.Results != nil && item.Content.ItemContent.TweetResults.Result.Core.UserResults.Results.Legacy != nil { legacy := item.Content.ItemContent.TweetResults.Result.Legacy legacyUser := item.Content.ItemContent.TweetResults.Result.Core.UserResults.Results.Legacy isMention := false for _, t := range legacy.Entities.UserMentions { if strings.EqualFold(t.ScreenName, "CryptoEternalAI") { isMention = true } } if isMention { numContent += 1 if err == nil { if strings.Contains(legacy.FullText, code) { return &TwitterDetail{ TwitterID: legacy.UserID, TwitterName: legacyUser.Name, TwitterUsername: legacyUser.Username, TwitterAvatar: legacyUser.ProfileUrl, }, nil } } } } } } } } } return m.IsPostForFaucetAgentBackup(code) } func (m Rapid) _isPostForFaucetAgentBackup(code, cursor string) (*TwitterDetail, string, error) { path := fmt.Sprintf("https://twitter135.p.rapidapi.com/Search/?q=(@CryptoEternalAI)&cursor=%s", cursor) data, _, err := m.request(path, "GET", nil, nil) if err != nil { return nil, "", err } res := &RapidSearchResponse{} err = json.Unmarshal(data, res) if err != nil { return nil, "", err } numContent := uint(0) cursorTop := "" if res != nil && res.Data != nil && res.Data.SearchByRawQuery != nil && res.Data.SearchByRawQuery.SearchTimeline != nil && res.Data.SearchByRawQuery.SearchTimeline.Timeline != nil && res.Data.SearchByRawQuery.SearchTimeline.Timeline.Instructions != nil { for _, v := range res.Data.SearchByRawQuery.SearchTimeline.Timeline.Instructions { if v.Type == "TimelineAddEntries" { for _, item := range v.Entries { if item.Content.EntryType == "TimelineTimelineCursor" && item.Content.CursorType == "Top" { cursorTop = item.Content.Value } if item.Content.EntryType == "TimelineTimelineItem" { if item.Content != nil && item.Content.ItemContent != nil && item.Content.ItemContent.TweetResults != nil && item.Content.ItemContent.TweetResults.Result != nil && item.Content.ItemContent.TweetResults.Result.Legacy != nil && item.Content.ItemContent.TweetResults.Result.Core != nil && item.Content.ItemContent.TweetResults.Result.Core.UserResults != nil && item.Content.ItemContent.TweetResults.Result.Core.UserResults.Results != nil && item.Content.ItemContent.TweetResults.Result.Core.UserResults.Results.Legacy != nil { legacy := item.Content.ItemContent.TweetResults.Result.Legacy legacyUser := item.Content.ItemContent.TweetResults.Result.Core.UserResults.Results.Legacy isMention := false for _, t := range legacy.Entities.UserMentions { if strings.EqualFold(t.ScreenName, "CryptoEternalAI") { isMention = true } } if isMention { numContent += 1 if err == nil { if strings.Contains(legacy.FullText, code) { return &TwitterDetail{ TwitterID: legacy.UserID, TwitterName: legacyUser.Name, TwitterUsername: legacyUser.Username, TwitterAvatar: legacyUser.ProfileUrl, }, cursorTop, nil } } } } } } } } } return nil, cursorTop, nil } func (m Rapid) IsPostForFaucetAgentBackup(code string) (*TwitterDetail, error) { info, cursor, err := m._isPostForFaucetAgentBackup(code, "") if err != nil { return nil, err } numRun := 0 for numRun < 1 { numRun++ if info == nil && cursor != "" { info, cursor, err = m._isPostForFaucetAgentBackup(code, cursor) if err != nil { return nil, err } if info != nil { return info, nil } } } return nil, nil } func (m Rapid) GetTwitterUserFromTweetID(tweetID string, authPublicCode string) (*TwitterDetail, error) { path := fmt.Sprintf("%s/TweetDetail/?id=%s", m.url, tweetID) data, _, err := m.request(path, "GET", nil, nil) if err != nil { return nil, err } resp := &RapidTweetDetailResponse{} err = json.Unmarshal(data, resp) if err != nil { return nil, err } if resp != nil && resp.Data != nil && resp.Data.Conversation != nil && resp.Data.Conversation.Instructions != nil && len(resp.Data.Conversation.Instructions) > 0 { for _, v := range resp.Data.Conversation.Instructions { if v.Type == "TimelineAddEntries" { for _, item := range v.Entries { if item.Content.EntryType == "TimelineTimelineItem" { if item.Content != nil && item.Content.ItemContent != nil && item.Content.ItemContent.TweetResults != nil && item.Content.ItemContent.TweetResults.Result != nil && item.Content.ItemContent.TweetResults.Result.Legacy != nil && item.Content.ItemContent.TweetResults.Result.Core != nil && item.Content.ItemContent.TweetResults.Result.Core.UserResults != nil && item.Content.ItemContent.TweetResults.Result.Core.UserResults.Results != nil && item.Content.ItemContent.TweetResults.Result.Core.UserResults.Results.Legacy != nil { legacy := item.Content.ItemContent.TweetResults.Result.Legacy legacyUser := item.Content.ItemContent.TweetResults.Result.Core.UserResults.Results.Legacy isMention := false for _, t := range legacy.Entities.UserMentions { if strings.EqualFold(t.ScreenName, "CryptoEternalAI") { isMention = true } } if isMention { if strings.Contains(legacy.FullText, authPublicCode) { return &TwitterDetail{ TwitterID: legacy.UserID, TwitterName: legacyUser.Name, TwitterUsername: legacyUser.Username, TwitterAvatar: legacyUser.ProfileUrl, }, nil } } } } } } } } return nil, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/taapi/taapi.go ================================================ package taapi import ( "bytes" "encoding/json" "fmt" "io" "net/http" "net/url" ) type TaApi struct { serverURL string apiKey string } func NewTaApi(apiKey string) *TaApi { return &TaApi{ serverURL: "https://api.taapi.io", apiKey: apiKey, } } func (m *TaApi) generateUrl(path string) string { fullUrl := fmt.Sprintf("%s/%s", m.serverURL, path) return fullUrl } func (m *TaApi) request(fullUrl string, method string, headers map[string]string, reqBody io.Reader) ([]byte, int, error) { req, err := http.NewRequest(method, fullUrl, reqBody) if err != nil { return nil, 0, err } if len(headers) > 0 { for key, val := range headers { req.Header.Add(key, val) } } req.Header.Add("accept", "application/json") req.Header.Add("content-type", "application/json") res, err := http.DefaultClient.Do(req) if err != nil { return nil, 0, err } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { return nil, res.StatusCode, err } return body, res.StatusCode, nil } type FibonacciRetracementResp struct { Value float64 `json:"value"` Trend string `json:"trend"` StartPrice float64 `json:"startPrice"` EndPrice float64 `json:"endPrice"` StartTimestamp int64 `json:"startTimestamp"` EndTimestamp int64 `json:"endTimestamp"` } func (m *TaApi) GetFibonacciRetracement(tokenSymbol string) (*FibonacciRetracementResp, error) { params := url.Values{} params.Add("secret", m.apiKey) params.Add("exchange", "binance") params.Add("symbol", fmt.Sprintf(`%s/USDT`, tokenSymbol)) params.Add("interval", "1d") path := fmt.Sprintf("fibonacciretracement?%s", params.Encode()) fullUrl := m.generateUrl(path) data, _, err := m.request(fullUrl, "GET", nil, nil) if err != nil { return nil, err } resp := &FibonacciRetracementResp{} err = json.Unmarshal(data, resp) if err != nil { return nil, err } return resp, nil } func (m *TaApi) GetRsi(tokenSymbol string) (*FibonacciRetracementResp, error) { params := url.Values{} params.Add("secret", m.apiKey) params.Add("exchange", "binance") params.Add("symbol", fmt.Sprintf(`%s/USDT`, tokenSymbol)) params.Add("interval", "1d") path := fmt.Sprintf("rsi?%s", params.Encode()) fullUrl := m.generateUrl(path) data, _, err := m.request(fullUrl, "GET", nil, nil) if err != nil { return nil, err } resp := &FibonacciRetracementResp{} err = json.Unmarshal(data, resp) if err != nil { return nil, err } return resp, nil } func (m *TaApi) GetEma(tokenSymbol string) (*FibonacciRetracementResp, error) { params := url.Values{} params.Add("secret", m.apiKey) params.Add("exchange", "binance") params.Add("symbol", fmt.Sprintf(`%s/USDT`, tokenSymbol)) params.Add("interval", "1d") params.Add("period", "12") path := fmt.Sprintf("ema?%s", params.Encode()) fullUrl := m.generateUrl(path) data, _, err := m.request(fullUrl, "GET", nil, nil) if err != nil { return nil, err } resp := &FibonacciRetracementResp{} err = json.Unmarshal(data, resp) if err != nil { return nil, err } return resp, nil } func (m *TaApi) GetSma(tokenSymbol string) (*FibonacciRetracementResp, error) { params := url.Values{} params.Add("secret", m.apiKey) params.Add("exchange", "binance") params.Add("symbol", fmt.Sprintf(`%s/USDT`, tokenSymbol)) params.Add("interval", "1d") params.Add("period", "20") path := fmt.Sprintf("sma?%s", params.Encode()) fullUrl := m.generateUrl(path) data, _, err := m.request(fullUrl, "GET", nil, nil) if err != nil { return nil, err } resp := &FibonacciRetracementResp{} err = json.Unmarshal(data, resp) if err != nil { return nil, err } return resp, nil } type BulkRequestDetailResp struct { Result FibonacciRetracementResp `json:"result"` ID string `json:"id"` } type BulkRequestResp struct { Data []*BulkRequestDetailResp `json:"data"` } func (m *TaApi) BulkRequest(tokenSymbol string) (*BulkRequestResp, error) { bodyReq := map[string]interface{}{ "secret": m.apiKey, "construct": map[string]interface{}{ "exchange": "binance", "symbol": fmt.Sprintf(`%s/USDT`, tokenSymbol), "interval": "1d", "indicators": []map[string]interface{}{ { "id": "fibonacciretracement", "indicator": "fibonacciretracement", }, { "id": "rsi", "indicator": "rsi", }, { "id": "sma", "indicator": "sma", "period": "20", }, { "id": "ema", "indicator": "ema", "period": "12", }, }, }, } fullUrl := m.generateUrl("bulk") bodyBytes, _ := json.Marshal(bodyReq) data, _, err := m.request(fullUrl, "POST", nil, bytes.NewBuffer(bodyBytes)) if err != nil { return nil, err } resp := &BulkRequestResp{} err = json.Unmarshal(data, resp) if err != nil { return nil, err } return resp, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/telegram/telegram.go ================================================ package telegram import ( "context" "fmt" "log" "github.com/gotd/td/telegram" "github.com/gotd/td/tg" ) type Client struct { apiID int apiHash string client *telegram.Client } func NewClient(apiID int, apiHash string) *Client { return &Client{ apiID: apiID, apiHash: apiHash, client: telegram.NewClient(apiID, apiHash, telegram.Options{}), } } func (c *Client) GetMessages(ctx context.Context, channelURL string, limit int) error { // Create a new API client api := c.client.API() peer := &tg.InputPeerChannel{ ChannelID: -2439704383, AccessHash: 0, } // Resolve the channel username from URL // channelUsername := channelURL[len("https://t.me/"):] // // Get channel info // resolved, err := api.ContactsResolveUsername(ctx, &tg.ContactsResolveUsernameRequest{ // Username: channelUsername, // }) // if err != nil { // return fmt.Errorf("failed to resolve channel: %v", err) // } // var peer tg.InputPeerClass // for _, chat := range resolved.Chats { // if channel, ok := chat.(*tg.Channel); ok { // peer = &tg.InputPeerChannel{ // ChannelID: channel.ID, // AccessHash: channel.AccessHash, // } // fmt.Printf("Found group: %s, Chat ID: -100%d\n", channel.Title, channel.ID) // break // } // } // Get channel messages messages, err := api.MessagesGetHistory(ctx, &tg.MessagesGetHistoryRequest{ Peer: peer, Limit: limit, }) if err != nil { return fmt.Errorf("failed to get messages: %v", err) } // Process messages for _, msg := range messages.(*tg.MessagesChannelMessages).Messages { if m, ok := msg.(*tg.Message); ok { log.Printf("Message ID: %d, Text: %s\n", m.ID, m.Message) } } return nil } func (c *Client) Run(ctx context.Context) error { return c.client.Run(ctx, func(ctx context.Context) error { // Here you can add authentication if needed return nil }) } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/trxapi/client.go ================================================ package trxapi import ( "bytes" "crypto/ecdsa" "crypto/sha256" "encoding/hex" "encoding/json" "errors" "fmt" "io" "math/big" "net/http" "sync" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/types/numeric" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/ethclient" "github.com/fbsobreira/gotron-sdk/pkg/client" "github.com/fbsobreira/gotron-sdk/pkg/proto/core" "github.com/mr-tron/base58" "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" "google.golang.org/protobuf/proto" ) func CreateTRONAddress() (string, string, error) { key, err := crypto.GenerateKey() if err != nil { return "", "", err } addr := crypto.PubkeyToAddress(key.PublicKey).Hex() prk := hex.EncodeToString(key.D.Bytes()) if len(prk) != 64 { return "", "", errors.New("bad private key len") } addr = AddrEvmToTron(addr) return addr, prk, nil } func sha256Hex(msg string) (string, error) { bytes, err := hex.DecodeString(msg) if err != nil { return "", fmt.Errorf("invalid hex input: %w", err) } hash := sha256.Sum256(bytes) return hex.EncodeToString(hash[:]), nil } func AddrTronToEvm(address string) string { decoded, err := base58.Decode(address) if err != nil { panic(fmt.Errorf("invalid hex input: %w", err)) } if len(decoded) < 8 { panic(errors.New("invalid TRON address")) } return "0x" + hex.EncodeToString(decoded[1:len(decoded)-4]) } func AddrEvmToTron(address string) string { if len(address) < 2 || address[:2] != "0x" { panic(errors.New("invalid EVM address")) } addr := "41" + address[2:] doubleSha1, err := sha256Hex(addr) if err != nil { panic(fmt.Errorf("error in first SHA-256 hash: %w", err)) } doubleSha2, err := sha256Hex(doubleSha1) if err != nil { panic(fmt.Errorf("error in second SHA-256 hash: %w", err)) } checkSum := doubleSha2[:8] fullAddr := addr + checkSum decoded, err := hex.DecodeString(fullAddr) if err != nil { panic(fmt.Errorf("failed to decode address: %w", err)) } return base58.Encode(decoded) } type Client struct { ApiURL string RpcURL string GrpcURL string APIKey string conn *client.GrpcClient mtx sync.Mutex client *ethclient.Client } func (c *Client) Conn() { c.mtx.Lock() defer c.mtx.Unlock() if c.conn == nil { var err error c.client, err = ethclient.Dial(c.RpcURL) if err != nil { panic(err) } conn := client.NewGrpcClient(c.GrpcURL) conn.SetAPIKey(c.APIKey) err = conn.Start(grpc.WithTransportCredentials(insecure.NewCredentials())) if err != nil { panic(err) } c.conn = conn } } func (c *Client) buildUrl(resourcePath string) string { if resourcePath != "" { return c.ApiURL + "/" + resourcePath } return c.ApiURL } func (c *Client) buildRpcUrl(resourcePath string) string { if resourcePath != "" { return c.RpcURL + "/" + resourcePath } return c.RpcURL } func (c *Client) doWithoutAuth(req *http.Request) (*http.Response, error) { client := &http.Client{} return client.Do(req) } func (c *Client) methodJSON(method string, apiURL string, jsonObject interface{}, result interface{}) error { var buffer io.Reader if jsonObject != nil { bodyBytes, _ := json.Marshal(jsonObject) buffer = bytes.NewBuffer(bodyBytes) } req, err := http.NewRequest(method, apiURL, buffer) if err != nil { return err } req.Header.Add("Content-Type", "application/json") resp, err := c.doWithoutAuth(req) if err != nil { return err } if resp.StatusCode >= 300 { bodyBytes, err := io.ReadAll(resp.Body) if err != nil { return fmt.Errorf("http response bad status %d %s", resp.StatusCode, err.Error()) } return fmt.Errorf("http response bad status %d %s", resp.StatusCode, string(bodyBytes)) } if result != nil { return json.NewDecoder(resp.Body).Decode(result) } return nil } func (c *Client) SignTx(prk *ecdsa.PrivateKey, tx *core.Transaction) (*core.Transaction, error) { rawData, err := proto.Marshal(tx.GetRawData()) if err != nil { return nil, err } h256h := sha256.New() h256h.Write(rawData) hash := h256h.Sum(nil) signature, err := crypto.Sign(hash, prk) if err != nil { return nil, err } tx.Signature = append(tx.Signature, signature) return tx, nil } type TRC20TransfersResp struct { Data []struct { BlockNumber int `json:"block_number"` BlockTimestamp int64 `json:"block_timestamp"` CallerContractAddress string `json:"caller_contract_address"` ContractAddress string `json:"contract_address"` EventIndex int `json:"event_index"` EventName string `json:"event_name"` Result struct { Num0 string `json:"0"` Num1 string `json:"1"` Num2 string `json:"2"` From string `json:"from"` To string `json:"to"` Value numeric.BigInt `json:"value"` } `json:"result"` ResultType struct { From string `json:"from"` To string `json:"to"` Value string `json:"value"` } `json:"result_type"` Event string `json:"event"` TransactionID string `json:"transaction_id"` } `json:"data"` Success bool `json:"success"` Meta struct { At int64 `json:"at"` PageSize int `json:"page_size"` } `json:"meta"` } func (c *Client) GetTRC20Transfers(addr string) (*TRC20TransfersResp, error) { resp := TRC20TransfersResp{} err := c.methodJSON( http.MethodGet, c.buildUrl(fmt.Sprintf("/v1/contracts/%s/events?only_unconfirmed=false&only_confirmed=true&limit=200&event_name=Transfer", addr)), nil, &resp, ) if err != nil { return nil, err } for _, v := range resp.Data { v.Result.From = AddrEvmToTron(v.Result.From) v.Result.To = AddrEvmToTron(v.Result.To) } return &resp, nil } func (c *Client) Balance(addr string) (*big.Int, error) { c.Conn() acc, err := c.conn.GetAccount(addr) if err != nil { if err.Error() == "account not found" { return big.NewInt(0), nil } return nil, err } return big.NewInt(acc.GetBalance()), nil } func (c *Client) CheckBalance(addr string, fee *big.Int) error { c.Conn() acc, err := c.conn.GetAccount(addr) if err != nil { return err } if big.NewInt(acc.GetBalance()).Cmp(fee) <= 0 { return errors.New("not balance") } return nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/trxapi/common.go ================================================ package trxapi import ( "context" "fmt" "github.com/fbsobreira/gotron-sdk/pkg/address" "github.com/fbsobreira/gotron-sdk/pkg/common" "github.com/fbsobreira/gotron-sdk/pkg/proto/api" "github.com/fbsobreira/gotron-sdk/pkg/proto/core" ) func (c *Client) triggerConstantContract(ct *core.TriggerSmartContract) (*api.TransactionExtention, error) { c.Conn() return c.conn.Client.TriggerConstantContract(context.Background(), ct) } func (c *Client) triggerContract(ct *core.TriggerSmartContract, feeLimit int64) (*api.TransactionExtention, error) { c.Conn() tx, err := c.conn.Client.TriggerContract(context.Background(), ct) if err != nil { return nil, err } if tx.Result.Code > 0 { return nil, fmt.Errorf("%s", string(tx.Result.Message)) } if feeLimit > 0 { tx.Transaction.RawData.FeeLimit = feeLimit // update hash c.conn.UpdateHash(tx) } return tx, err } func (c *Client) TRC20Call(from, contractAddress, data string, constant bool, value, feeLimit int64) (*api.TransactionExtention, error) { c.Conn() var err error fromDesc := address.HexToAddress("410000000000000000000000000000000000000000") if len(from) > 0 { fromDesc, err = address.Base58ToAddress(from) if err != nil { return nil, err } } contractDesc, err := address.Base58ToAddress(contractAddress) if err != nil { return nil, err } dataBytes, err := common.FromHex(data) if err != nil { return nil, err } ct := &core.TriggerSmartContract{ OwnerAddress: fromDesc.Bytes(), ContractAddress: contractDesc.Bytes(), Data: dataBytes, CallValue: value, } var result *api.TransactionExtention if constant { result, err = c.triggerConstantContract(ct) } else { result, err = c.triggerContract(ct, feeLimit) } if err != nil { return nil, err } if result.Result.Code > 0 { return result, fmt.Errorf(string(result.Result.Message)) } return result, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/trxapi/sunpumplaunchpad.go ================================================ package trxapi import ( "context" "fmt" "math/big" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/binds/sunpumplaunchpad" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" "github.com/fbsobreira/gotron-sdk/pkg/address" ) func (c *Client) SunpumpLaunchpadCreateAndInitPurchase(contractAddr string, prkHex string, symbol string, name string) (string, error) { c.Conn() privateKeyECDSA, err := crypto.HexToECDSA(prkHex) if err != nil { return "", err } addr := address.PubkeyToAddress(privateKeyECDSA.PublicKey) instanceABI, err := sunpumplaunchpad.SunpumplaunchpadMetaData.GetAbi() if err != nil { return "", err } dataBytes, err := instanceABI.Pack( "createAndInitPurchase", name, symbol, ) if err != nil { return "", err } gasPrice, err := c.client.SuggestGasPrice(context.Background()) if err != nil { return "", err } gasFee := common.Big0.Mul(gasPrice, big.NewInt(100000)).Int64() err = c.CheckBalance(addr.String(), big.NewInt(gasFee)) if err != nil { return "", err } tx, err := c.TRC20Call(addr.String(), contractAddr, common.Bytes2Hex(dataBytes), false, 20000000, gasFee) if err != nil { return "", err } signedTx, err := c.SignTx(privateKeyECDSA, tx.Transaction) if err != nil { return "", err } result, err := c.conn.Broadcast(signedTx) if err != nil { return "", err } if result.Code != 0 { return "", fmt.Errorf("bad transaction: %v", string(result.GetMessage())) } return common.BytesToHash(tx.GetTxid()).Hex(), nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/trxapi/systempromptmanager.go ================================================ package trxapi import ( "context" "fmt" "math/big" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/binds/systempromptmanager" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" "github.com/fbsobreira/gotron-sdk/pkg/address" ) func (c *Client) SystemPromptManagerMint(contractAddr string, prkHex string, to common.Address, uri string, data []byte, fee *big.Int) (string, error) { c.Conn() privateKeyECDSA, err := crypto.HexToECDSA(prkHex) if err != nil { return "", err } addr := address.PubkeyToAddress(privateKeyECDSA.PublicKey) instanceABI, err := systempromptmanager.SystemPromptManagerMetaData.GetAbi() if err != nil { return "", err } dataBytes, err := instanceABI.Pack( "mint", to, uri, data, fee, ) if err != nil { return "", err } gasPrice, err := c.client.SuggestGasPrice(context.Background()) if err != nil { return "", err } gasFee := common.Big0.Mul(gasPrice, big.NewInt(500000)).Int64() err = c.CheckBalance(addr.String(), big.NewInt(gasFee)) if err != nil { return "", err } tx, err := c.conn.TRC20Call(addr.String(), contractAddr, common.Bytes2Hex(dataBytes), false, gasFee) if err != nil { return "", err } signedTx, err := c.SignTx(privateKeyECDSA, tx.Transaction) if err != nil { return "", err } result, err := c.conn.Broadcast(signedTx) if err != nil { return "", err } if result.Code != 0 { return "", fmt.Errorf("bad transaction: %v", string(result.GetMessage())) } return common.BytesToHash(tx.GetTxid()).Hex(), nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/trxapi/trx20.go ================================================ package trxapi import ( "context" "fmt" "math/big" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/helpers" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/binds/erc20" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" "github.com/fbsobreira/gotron-sdk/pkg/address" ) func (c *Client) Trc20Balance(erc20Addr string, addr string) (*big.Int, error) { c.Conn() rs, err := c.conn.TRC20ContractBalance(addr, erc20Addr) if err != nil { if err.Error() == "account not found" { return nil, nil } return nil, err } return rs, nil } func (c *Client) TRC20ApproveMax(contractAddr string, prkHex string, toAddr string) (string, error) { c.Conn() toAddr = AddrTronToEvm(toAddr) privateKeyECDSA, err := crypto.HexToECDSA(prkHex) if err != nil { return "", err } addr := address.PubkeyToAddress(privateKeyECDSA.PublicKey) instanceABI, err := erc20.Erc20MetaData.GetAbi() if err != nil { return "", err } amount, _ := new(big.Int).SetString("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", 16) dataBytes, err := instanceABI.Pack( "approve", helpers.HexToAddress(toAddr), amount, ) if err != nil { return "", err } gasPrice, err := c.client.SuggestGasPrice(context.Background()) if err != nil { return "", err } gasFee := common.Big0.Mul(gasPrice, big.NewInt(200000)).Int64() err = c.CheckBalance(addr.String(), big.NewInt(gasFee)) if err != nil { return "", err } tx, err := c.conn.TRC20Call(addr.String(), contractAddr, common.Bytes2Hex(dataBytes), false, gasFee) if err != nil { return "", err } signedTx, err := c.SignTx(privateKeyECDSA, tx.Transaction) if err != nil { return "", err } result, err := c.conn.Broadcast(signedTx) if err != nil { return "", err } if result.Code != 0 { return "", fmt.Errorf("bad transaction: %v", string(result.GetMessage())) } return common.BytesToHash(tx.GetTxid()).Hex(), nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/twitter/auth.go ================================================ package twitter import "net/http" // Authorizer will add the authorization to the HTTP request type Authorizer interface { Add(*http.Request) } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/twitter/client.go ================================================ package twitter import ( "bytes" "encoding/json" "fmt" "io" "io/ioutil" "mime/multipart" "net/http" "net/url" "path/filepath" "regexp" "strconv" "strings" "time" "github.com/dghubble/oauth1" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" ) const TWITTER_OAUTH_TOKEN_URL = "https://api.twitter.com/2/oauth2/token" type Client struct { ConsumerKey, ConsumerSecret, AccessToken, AccessSecret string OauthClientId string OauthClientSecret string RedirectUri string RedirectUriForInternal string AppTokenForInternal string AppToken string user *User } func NewClient(appToken, consumerKey, consumerSecret, accessToken, accessSecret, oauthClientId, oauthClientSecret, redirectUri string) *Client { return &Client{ AppToken: appToken, ConsumerKey: consumerKey, ConsumerSecret: consumerSecret, AccessToken: accessToken, AccessSecret: accessSecret, OauthClientId: oauthClientId, OauthClientSecret: oauthClientSecret, RedirectUri: redirectUri, } } func (c *Client) postJSON(apiURL string, headers map[string]string, jsonObject map[string]interface{}, result interface{}) error { data := url.Values{} for key, val := range jsonObject { data.Set(key, fmt.Sprintf("%v", val)) } encodedData := data.Encode() req, err := http.NewRequest(http.MethodPost, apiURL, strings.NewReader(encodedData)) if err != nil { return err } req.Header.Add("Content-Type", "application/x-www-form-urlencoded") req.Header.Add("Content-Length", strconv.Itoa(len(data.Encode()))) req.SetBasicAuth(c.OauthClientId, c.OauthClientSecret) for k, v := range headers { req.Header.Add(k, v) } client := &http.Client{} resp, err := client.Do(req) if err != nil { return fmt.Errorf("failed request: %v", err) } if resp.StatusCode >= 300 { bodyBytes, err := ioutil.ReadAll(resp.Body) if err != nil { return fmt.Errorf("http response bad status %d %s", resp.StatusCode, err.Error()) } return fmt.Errorf("http response bad status %d %s", resp.StatusCode, string(bodyBytes)) } if result != nil { return json.NewDecoder(resp.Body).Decode(result) } return nil } func (c *Client) postJSONWithKey(apiURL, oauthClientId, oauthClientSecret string, headers map[string]string, jsonObject map[string]interface{}, result interface{}) error { data := url.Values{} for key, val := range jsonObject { data.Set(key, fmt.Sprintf("%v", val)) } encodedData := data.Encode() req, err := http.NewRequest(http.MethodPost, apiURL, strings.NewReader(encodedData)) if err != nil { return err } req.Header.Add("Content-Type", "application/x-www-form-urlencoded") req.Header.Add("Content-Length", strconv.Itoa(len(data.Encode()))) req.SetBasicAuth(oauthClientId, oauthClientSecret) for k, v := range headers { req.Header.Add(k, v) } client := &http.Client{} resp, err := client.Do(req) if err != nil { return fmt.Errorf("failed request: %v", err) } if resp.StatusCode >= 300 { bodyBytes, err := ioutil.ReadAll(resp.Body) if err != nil { return fmt.Errorf("http response bad status %d %s", resp.StatusCode, err.Error()) } return fmt.Errorf("http response bad status %d %s", resp.StatusCode, string(bodyBytes)) } if result != nil { return json.NewDecoder(resp.Body).Decode(result) } return nil } func (c *Client) getJSONWithAccessToken(accessToken, url string, headers map[string]string, result interface{}) (int, error) { req, err := http.NewRequest(http.MethodGet, url, nil) if err != nil { return 0, fmt.Errorf("failed to create request: %v", err) } req.Header.Add("Content-Type", "application/json") req.Header.Add("Authorization", fmt.Sprintf(`Bearer %s`, accessToken)) for k, v := range headers { req.Header.Add(k, v) } client := &http.Client{} resp, err := client.Do(req) if err != nil { return 0, fmt.Errorf("failed request: %v", err) } if resp.StatusCode >= 300 { bodyBytes, err := ioutil.ReadAll(resp.Body) if err != nil { return resp.StatusCode, fmt.Errorf("http response bad status %d %s", resp.StatusCode, err.Error()) } return resp.StatusCode, fmt.Errorf("http response bad status %d %s", resp.StatusCode, string(bodyBytes)) } if result != nil { return resp.StatusCode, json.NewDecoder(resp.Body).Decode(result) } return resp.StatusCode, nil } type TwitterUser struct { TwitterID string TwitterUsername string Name string ProfileUrl string `gorm:"type:text collate utf8mb4_unicode_ci"` FollowersCount uint FollowingsCount uint IsBlueVerified bool CreatedAt time.Time } func (c *Client) GetTwitterUserInfoByToken(username string) (*TwitterUser, error) { url := fmt.Sprintf("https://api.twitter.com/2/users/by/username/%s?user.fields=public_metrics,verified,profile_image_url,created_at,verified_type", username) req, err := http.NewRequest("GET", url, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Authorization", "Bearer "+c.AppToken) client := &http.Client{} resp, err := client.Do(req) if err != nil { return nil, fmt.Errorf("error sending request: %w", err) } defer resp.Body.Close() body, _ := io.ReadAll(resp.Body) if resp.StatusCode != http.StatusOK { return nil, fmt.Errorf("failed to get user info, status: %s, body: %s", resp.Status, body) } // Parse response into TwitterUser struct var responseData struct { Data struct { ID string `json:"id"` Username string `json:"username"` Name string `json:"name"` ProfileImageUrl string `json:"profile_image_url"` Verified bool `json:"verified"` VerifiedType string `json:"verified_type"` CreatedAt time.Time `json:"created_at"` PublicMetrics struct { FollowersCount uint `json:"followers_count"` FollowingCount uint `json:"following_count"` } `json:"public_metrics"` } `json:"data"` } if err := json.Unmarshal(body, &responseData); err != nil { return nil, fmt.Errorf("error parsing response: %w", err) } // Determine if the user is "blue verified" isBlueVerified := responseData.Data.VerifiedType == "blue" // Map response data to TwitterUser struct user := &TwitterUser{ TwitterID: responseData.Data.ID, TwitterUsername: responseData.Data.Username, Name: responseData.Data.Name, ProfileUrl: responseData.Data.ProfileImageUrl, FollowersCount: responseData.Data.PublicMetrics.FollowersCount, FollowingsCount: responseData.Data.PublicMetrics.FollowingCount, IsBlueVerified: isBlueVerified, CreatedAt: responseData.Data.CreatedAt, } fmt.Println("User info retrieved successfully") return user, nil } func (c *Client) UploadImage(imageURL string, additionalOwners []string) (string, error) { if imageURL == "" { return "", nil } response, err := http.Get(imageURL) if err != nil { return "", err } defer response.Body.Close() config := oauth1.NewConfig(c.ConsumerKey, c.ConsumerSecret) token := oauth1.NewToken(c.AccessToken, c.AccessSecret) httpClient := config.Client(oauth1.NoContext, token) var requestBody bytes.Buffer writer := multipart.NewWriter(&requestBody) part, err := writer.CreateFormFile("media", filepath.Base(imageURL)) if err != nil { return "", err } _, err = io.Copy(part, response.Body) if err != nil { return "", err } if len(additionalOwners) > 0 { owners := strings.Join(additionalOwners, ",") if err := writer.WriteField("additional_owners", owners); err != nil { return "", fmt.Errorf("failed to add additional_owners: %w", err) } } writer.Close() uploadURL := "https://upload.twitter.com/1.1/media/upload.json" req, err := http.NewRequest("POST", uploadURL, &requestBody) if err != nil { return "", err } req.Header.Set("Content-Type", writer.FormDataContentType()) resp, err := httpClient.Do(req) if err != nil { return "", err } defer resp.Body.Close() var result map[string]interface{} if err := json.NewDecoder(resp.Body).Decode(&result); err != nil { return "", err } mediaID, ok := result["media_id_string"].(string) if !ok { return "", errs.ErrBadRequest } return mediaID, nil } func (c *Client) GetTwitterUserInfoID(userTwitterID string) (*TwitterUser, error) { url := fmt.Sprintf("https://api.twitter.com/2/users/%s?user.fields=public_metrics,verified,profile_image_url,created_at,verified_type", userTwitterID) req, err := http.NewRequest("GET", url, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Authorization", "Bearer "+c.AppToken) client := &http.Client{} resp, err := client.Do(req) if err != nil { return nil, fmt.Errorf("error sending request: %w", err) } defer resp.Body.Close() body, _ := io.ReadAll(resp.Body) if resp.StatusCode != http.StatusOK { return nil, fmt.Errorf("failed to get user info, status: %s, body: %s", resp.Status, body) } // Parse response into TwitterUser struct var responseData struct { Data struct { ID string `json:"id"` Username string `json:"username"` Name string `json:"name"` ProfileImageUrl string `json:"profile_image_url"` Verified bool `json:"verified"` VerifiedType string `json:"verified_type"` CreatedAt time.Time `json:"created_at"` PublicMetrics struct { FollowersCount uint `json:"followers_count"` FollowingCount uint `json:"following_count"` } `json:"public_metrics"` } `json:"data"` } if err := json.Unmarshal(body, &responseData); err != nil { return nil, fmt.Errorf("error parsing response: %w", err) } // Determine if the user is "blue verified" isBlueVerified := responseData.Data.VerifiedType == "blue" // Map response data to TwitterUser struct user := &TwitterUser{ TwitterID: responseData.Data.ID, TwitterUsername: responseData.Data.Username, Name: responseData.Data.Name, ProfileUrl: responseData.Data.ProfileImageUrl, FollowersCount: responseData.Data.PublicMetrics.FollowersCount, FollowingsCount: responseData.Data.PublicMetrics.FollowingCount, IsBlueVerified: isBlueVerified, CreatedAt: responseData.Data.CreatedAt, } fmt.Println("User info retrieved successfully") return user, nil } func (c *Client) PostTweet(tweetContent, imageURL string, additionalOwners []string) error { config := oauth1.NewConfig(c.ConsumerKey, c.ConsumerSecret) token := oauth1.NewToken(c.AccessToken, c.AccessSecret) httpClient := config.Client(oauth1.NoContext, token) twitterApiUrl := "https://api.twitter.com/2/tweets" mediaID, err := c.UploadImage(imageURL, additionalOwners) if err != nil { return err } body := map[string]interface{}{ "text": tweetContent, } if mediaID != "" { body["media"] = map[string]interface{}{ "media_ids": []string{mediaID}, } } jsonBody, err := json.Marshal(body) if err != nil { return err } req, err := http.NewRequest("POST", twitterApiUrl, bytes.NewBuffer(jsonBody)) if err != nil { return err } req.Header.Set("Content-Type", "application/json") resp, err := httpClient.Do(req) if err != nil { return err } defer resp.Body.Close() if resp.StatusCode == http.StatusCreated { return nil } else { return errs.ErrBadRequest } } func (c *Client) ReplyToTweet(tweetID, replyContent, imageURL string, additionalOwners []string) error { config := oauth1.NewConfig(c.ConsumerKey, c.ConsumerSecret) token := oauth1.NewToken(c.AccessToken, c.AccessSecret) httpClient := config.Client(oauth1.NoContext, token) twitterApiUrl := "https://api.twitter.com/2/tweets" mediaID, err := c.UploadImage(imageURL, additionalOwners) if err != nil { return err } body := map[string]interface{}{ "text": replyContent, "reply": map[string]interface{}{ "in_reply_to_tweet_id": tweetID, }, } if mediaID != "" { body["media"] = map[string]interface{}{ "media_ids": []string{mediaID}, } } jsonBody, err := json.Marshal(body) if err != nil { return err } req, err := http.NewRequest("POST", twitterApiUrl, bytes.NewBuffer(jsonBody)) if err != nil { return err } req.Header.Set("Content-Type", "application/json") resp, err := httpClient.Do(req) if err != nil { return err } defer resp.Body.Close() if resp.StatusCode != http.StatusCreated { return errs.ErrBadRequest } return nil } type TwitterTokenResponse struct { TokenType string `json:"token_type"` ExpiresIn int `json:"expires_in"` AccessToken string `json:"access_token"` Scope string `json:"scope"` RefreshToken string `json:"refresh_token"` } func (c *Client) GetTwitterOAuthToken(code string, callbackUrl, address, agentID string) (*TwitterTokenResponse, error) { var resp TwitterTokenResponse redirectUri := fmt.Sprintf(`%s?callback=%s&address=%s&agent_id=%s`, c.RedirectUri, callbackUrl, address, agentID) postData := map[string]interface{}{ "client_id": c.OauthClientId, "code_verifier": "challenge", "redirect_uri": redirectUri, "grant_type": "authorization_code", "code": code, } err := c.postJSON( TWITTER_OAUTH_TOKEN_URL, map[string]string{}, postData, &resp, ) if err != nil { return nil, err } return &resp, nil } func (c *Client) GetTwitterOAuthTokenWithKey(clientID, clientSecret, code string, callbackUrl, address, agentID string) (*TwitterTokenResponse, error) { var resp TwitterTokenResponse redirectUri := fmt.Sprintf(`%s?callback=%s&address=%s&agent_id=%s&client_id=%s`, c.RedirectUri, callbackUrl, address, agentID, clientID) postData := map[string]interface{}{ "client_id": c.OauthClientId, "code_verifier": "challenge", "redirect_uri": redirectUri, "grant_type": "authorization_code", "code": code, } err := c.postJSONWithKey( TWITTER_OAUTH_TOKEN_URL, clientID, clientSecret, map[string]string{}, postData, &resp, ) if err != nil { return nil, err } return &resp, nil } func (c *Client) TwitterOauthCallbackForInternalData(clientID, clientSecret, code, callbackUrl string) (*TwitterTokenResponse, error) { var resp TwitterTokenResponse redirectUri := fmt.Sprintf(`%s?callback=%s`, fmt.Sprintf("%s/internal", c.RedirectUri), callbackUrl) postData := map[string]interface{}{ "client_id": clientID, "code_verifier": "challenge", "redirect_uri": redirectUri, "grant_type": "authorization_code", "code": code, } err := c.postJSONWithKey( TWITTER_OAUTH_TOKEN_URL, clientID, clientSecret, map[string]string{}, postData, &resp, ) if err != nil { return nil, err } return &resp, nil } func (c *Client) TwitterOauthCallbackForSampleApp(clientID, clientSecret, code, redirectUri string) (*TwitterTokenResponse, error) { var resp TwitterTokenResponse postData := map[string]interface{}{ "client_id": clientID, "code_verifier": "challenge", "redirect_uri": redirectUri, "grant_type": "authorization_code", "code": code, } err := c.postJSONWithKey( TWITTER_OAUTH_TOKEN_URL, clientID, clientSecret, map[string]string{}, postData, &resp, ) if err != nil { return nil, err } return &resp, nil } func (c *Client) GetTwitterOAuthTokenWithKeyForRelink(clientID, clientSecret, code string, callbackUrl, address string) (*TwitterTokenResponse, error) { var resp TwitterTokenResponse redirectUri := fmt.Sprintf(`%s?callback=%s&address=%s&client_id=%s`, c.RedirectUri, callbackUrl, address, clientID) postData := map[string]interface{}{ "client_id": c.OauthClientId, "code_verifier": "challenge", "redirect_uri": redirectUri, "grant_type": "authorization_code", "code": code, } err := c.postJSONWithKey( TWITTER_OAUTH_TOKEN_URL, clientID, clientSecret, map[string]string{}, postData, &resp, ) if err != nil { return nil, err } return &resp, nil } func (c *Client) GetTwitterOAuthTokenWithKeyForCreateAgent(clientID, clientSecret, code string, callbackUrl, address string) (*TwitterTokenResponse, error) { var resp TwitterTokenResponse redirectUri := fmt.Sprintf(`%s?callback=%s&address=%s&agent_id=1&client_id=%s`, c.RedirectUri, callbackUrl, address, clientID) postData := map[string]interface{}{ "client_id": c.OauthClientId, "code_verifier": "challenge", "redirect_uri": redirectUri, "grant_type": "authorization_code", "code": code, } err := c.postJSONWithKey( TWITTER_OAUTH_TOKEN_URL, clientID, clientSecret, map[string]string{}, postData, &resp, ) if err != nil { return nil, err } return &resp, nil } func (c *Client) GetTwitterOAuthTokenWithKeyForVideoReward(clientID, clientSecret, code string, callbackUrl, address string) (*TwitterTokenResponse, error) { var resp TwitterTokenResponse redirectUri := fmt.Sprintf(`%s?callback=%s&address=%s&agent_id=2&client_id=%s`, c.RedirectUri, callbackUrl, address, clientID) postData := map[string]interface{}{ "client_id": c.OauthClientId, "code_verifier": "challenge", "redirect_uri": redirectUri, "grant_type": "authorization_code", "code": code, } err := c.postJSONWithKey( TWITTER_OAUTH_TOKEN_URL, clientID, clientSecret, map[string]string{}, postData, &resp, ) if err != nil { return nil, err } return &resp, nil } func (c *Client) GetTwitterOAuthTokenWithKeyForDeveloper(clientID, clientSecret, code string, callbackUrl, address string) (*TwitterTokenResponse, error) { var resp TwitterTokenResponse redirectUri := fmt.Sprintf(`%s?callback=%s&address=%s&agent_id=0&client_id=%s`, c.RedirectUri, callbackUrl, address, clientID) postData := map[string]interface{}{ "client_id": c.OauthClientId, "code_verifier": "challenge", "redirect_uri": redirectUri, "grant_type": "authorization_code", "code": code, } err := c.postJSONWithKey( TWITTER_OAUTH_TOKEN_URL, clientID, clientSecret, map[string]string{}, postData, &resp, ) if err != nil { return nil, err } return &resp, nil } type TwitterMeResp struct { UserObj UserObj `json:"data"` } func (c *Client) GetTwitterMe(accessToken string) (*UserObj, error) { var resp TwitterMeResp _, err := c.getJSONWithAccessToken( accessToken, "https://api.twitter.com/2/users/me?user.fields=profile_image_url,public_metrics,verified,description,entities", map[string]string{}, &resp, ) if err != nil { return nil, err } return &resp.UserObj, nil } func (c *Client) GetTwitterAccessToken(refreshToken string) (*TwitterTokenResponse, error) { var resp TwitterTokenResponse postData := map[string]interface{}{ "client_id": c.OauthClientId, "refresh_token": refreshToken, "grant_type": "refresh_token", } err := c.postJSON( "https://api.twitter.com/2/oauth2/token", map[string]string{}, postData, &resp, ) if err != nil { return nil, err } return &resp, nil } func (c *Client) GetTwitterAccessTokenWithKey(clientID, clientSecret, refreshToken string) (*TwitterTokenResponse, error) { var resp TwitterTokenResponse postData := map[string]interface{}{ "client_id": clientID, "refresh_token": refreshToken, "grant_type": "refresh_token", } err := c.postJSONWithKey( "https://api.twitter.com/2/oauth2/token", clientID, clientSecret, map[string]string{}, postData, &resp, ) if err != nil { return nil, err } return &resp, nil } type Mention struct { Username string `json:"username"` UserID string `json:"user_id"` } type TweetResp struct { ID string `json:"id"` Text string `json:"text"` AuthorID string `json:"author_id"` AuthorUsername string `json:"author_username,omitempty"` AuthorName string `json:"author_name,omitempty"` CreatedAt time.Time `json:"created_at"` Language string `json:"lang"` LikeCount int `json:"like_count"` RetweetCount int `json:"retweet_count"` ReplyCount int `json:"reply_count"` QuoteCount int `json:"quote_count"` ImpressionCount int `json:"impression_count"` InReplyToUserID string `json:"in_reply_to_user_id,omitempty"` FollowersCount uint `json:"followers_count,omitempty"` // Reply-related fields IsReply bool `json:"is_reply"` InReplyToTweetID string `json:"in_reply_to_tweet_id,omitempty"` OriginalText string `json:"original_text,omitempty"` // Retweet-related fields IsRetweet bool `json:"is_retweet"` RepostTweetID string `json:"repost_tweet_id,omitempty"` RepostText string `json:"repost_text,omitempty"` // Quote-related fields IsQuote bool `json:"is_quote"` QuoteTweetID string `json:"quote_tweet_id,omitempty"` QuoteText string `json:"quote_text,omitempty"` // New field for mentions Mentions []Mention `json:"mentions,omitempty"` ParentTweetID string ParentAuthorUsername string `json:"parent_author_username,omitempty"` ParentAuthorID string `json:"parent_author_id,omitempty"` } func (m *TweetResp) IsMention(username string) bool { for _, v := range m.Mentions { if strings.EqualFold(v.Username, username) { return true } } return false } func (c *Client) GetTweetDetails(tweetIDs []string) (map[string]*TweetResp, error) { lookupURL := "https://api.twitter.com/2/tweets" params := url.Values{} params.Add("ids", strings.Join(tweetIDs, ",")) params.Add("tweet.fields", "id,text,author_id,created_at,lang,public_metrics,in_reply_to_user_id,referenced_tweets,entities") params.Add("expansions", "author_id") // Include author_id expansion params.Add("user.fields", "username,name,public_metrics") // Fetch username, name, and public_metrics req, err := http.NewRequest("GET", lookupURL+"?"+params.Encode(), nil) if err != nil { return nil, err } req.Header.Add("Authorization", "Bearer "+c.AppToken) client := &http.Client{} resp, err := client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() if resp.StatusCode != http.StatusOK { return nil, fmt.Errorf("failed to fetch tweets, status: %s", resp.Status) } var response struct { Data []struct { ID string `json:"id"` Text string `json:"text"` AuthorID string `json:"author_id"` CreatedAt string `json:"created_at"` Lang string `json:"lang"` PublicMetrics struct { LikeCount int `json:"like_count"` RetweetCount int `json:"retweet_count"` ReplyCount int `json:"reply_count"` QuoteCount int `json:"quote_count"` ImpressionCount int `json:"impression_count,omitempty"` } `json:"public_metrics"` InReplyToUserID string `json:"in_reply_to_user_id,omitempty"` ReferencedTweets []struct { Type string `json:"type"` ID string `json:"id"` } `json:"referenced_tweets,omitempty"` Entities struct { Mentions []struct { Username string `json:"username"` ID string `json:"id"` } `json:"mentions,omitempty"` } `json:"entities,omitempty"` } `json:"data"` Includes struct { Users []struct { ID string `json:"id"` Username string `json:"username"` Name string `json:"name"` PublicMetrics struct { FollowersCount int `json:"followers_count"` } `json:"public_metrics"` } `json:"users"` } `json:"includes"` } if err := json.NewDecoder(resp.Body).Decode(&response); err != nil { return nil, err } // Create a map to access user information by ID usersMap := make(map[string]struct { Username string Name string FollowersCount int }) for _, user := range response.Includes.Users { usersMap[user.ID] = struct { Username string Name string FollowersCount int }{ Username: user.Username, Name: user.Name, FollowersCount: user.PublicMetrics.FollowersCount, // Capture followers_count } } // Collect referenced tweet IDs and initialize Tweet structs referencedTweetIDs := map[string]bool{} tweets := make([]TweetResp, len(response.Data)) for i, t := range response.Data { createdAt, err := time.Parse(time.RFC3339, t.CreatedAt) if err != nil { return nil, fmt.Errorf("error parsing created_at: %w", err) } // Parse mentions mentions := make([]Mention, len(t.Entities.Mentions)) for j, mention := range t.Entities.Mentions { mentions[j] = Mention{ Username: mention.Username, UserID: mention.ID, } } // Get author information from the users map authorInfo := usersMap[t.AuthorID] tweet := TweetResp{ ID: t.ID, Text: t.Text, AuthorID: t.AuthorID, AuthorUsername: authorInfo.Username, AuthorName: authorInfo.Name, FollowersCount: uint(authorInfo.FollowersCount), // Add followers_count CreatedAt: createdAt, Language: t.Lang, LikeCount: t.PublicMetrics.LikeCount, RetweetCount: t.PublicMetrics.RetweetCount, ReplyCount: t.PublicMetrics.ReplyCount, QuoteCount: t.PublicMetrics.QuoteCount, ImpressionCount: t.PublicMetrics.ImpressionCount, InReplyToUserID: t.InReplyToUserID, IsReply: false, IsRetweet: false, IsQuote: false, Mentions: mentions, } // Determine if tweet is a reply, retweet, or quote and collect IDs for _, refTweet := range t.ReferencedTweets { switch refTweet.Type { case "replied_to": tweet.IsReply = true tweet.InReplyToTweetID = refTweet.ID referencedTweetIDs[refTweet.ID] = true tweet.ParentTweetID = refTweet.ID case "retweeted": tweet.IsRetweet = true tweet.RepostTweetID = refTweet.ID referencedTweetIDs[refTweet.ID] = true tweet.ParentTweetID = refTweet.ID case "quoted": tweet.IsQuote = true tweet.QuoteTweetID = refTweet.ID referencedTweetIDs[refTweet.ID] = true tweet.ParentTweetID = refTweet.ID } } tweets[i] = tweet } // Fetch referenced tweets if needed and add their texts originalTweets, err := c.FetchReferencedTweetByIDs(referencedTweetIDs) if err != nil { return nil, err } for i, tweet := range tweets { if tweet.IsReply { tmp := originalTweets[tweet.InReplyToTweetID] if tmp != nil { tweets[i].OriginalText = tmp.Text tweets[i].ParentAuthorUsername = tmp.AuthorUsername tweets[i].ParentAuthorID = tmp.AuthorID } } if tweet.IsRetweet { tmp := originalTweets[tweet.RepostTweetID] if tmp != nil { tweets[i].RepostText = tmp.Text tweets[i].ParentAuthorUsername = tmp.AuthorUsername tweets[i].ParentAuthorID = tmp.AuthorID } } if tweet.IsQuote { tmp := originalTweets[tweet.QuoteTweetID] if tmp != nil { tweets[i].QuoteText = tmp.Text tweets[i].ParentAuthorUsername = tmp.AuthorUsername tweets[i].ParentAuthorID = tmp.AuthorID } } } result := map[string]*TweetResp{} for _, v := range tweets { result[v.ID] = &v } return result, nil } func (c *Client) FetchReferencedTweetByIDs(tweetIDMap map[string]bool) (map[string]*TweetResp, error) { // Convert map keys to slice of IDs tweetIDs := []string{} for id := range tweetIDMap { tweetIDs = append(tweetIDs, id) } // Initialize result map result := make(map[string]*TweetResp) // Batch processing (max 100 per batch) const batchSize = 100 for i := 0; i < len(tweetIDs); i += batchSize { end := i + batchSize if end > len(tweetIDs) { end = len(tweetIDs) } batch := tweetIDs[i:end] // Fetch tweets for the current batch tweetMap, err := c._fetchReferencedTweetByIDs(batch) if err != nil { return nil, err // Return error immediately if any batch fails } // Merge current batch result into the final result map for id, tweet := range tweetMap { result[id] = tweet } } return result, nil } func (c *Client) _fetchReferencedTweetByIDs(tweetIDs []string) (map[string]*TweetResp, error) { lookupURL := "https://api.twitter.com/2/tweets" params := url.Values{} params.Add("ids", strings.Join(tweetIDs, ",")) params.Add("tweet.fields", "id,text,author_id") params.Add("expansions", "author_id") // Include author_id expansion params.Add("user.fields", "username,name") // Include public_metrics to get followers_count req, err := http.NewRequest("GET", lookupURL+"?"+params.Encode(), nil) if err != nil { return nil, err } req.Header.Add("Authorization", "Bearer "+c.AppToken) client := &http.Client{} resp, err := client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() if resp.StatusCode != http.StatusOK { return nil, fmt.Errorf("failed to fetch referenced tweets, status: %s", resp.Status) } var response struct { Data []struct { ID string `json:"id"` Text string `json:"text"` AuthorID string `json:"author_id"` } `json:"data"` Includes struct { Users []struct { ID string `json:"id"` Username string `json:"username"` Name string `json:"name"` } `json:"users"` } `json:"includes"` } if err := json.NewDecoder(resp.Body).Decode(&response); err != nil { return nil, err } // Create a map to access user information by ID usersMap := make(map[string]struct { Username string Name string }) for _, user := range response.Includes.Users { usersMap[user.ID] = struct { Username string Name string }{ Username: user.Username, Name: user.Name, } } // Map each tweet ID to its text tweetMap := map[string]*TweetResp{} for _, tweet := range response.Data { // Get author information from the users map authorInfo := usersMap[tweet.AuthorID] tweetMap[tweet.ID] = &TweetResp{ ID: tweet.ID, Text: tweet.Text, AuthorID: tweet.AuthorID, AuthorUsername: authorInfo.Username, } } return tweetMap, nil } type TweetFullTextResponse struct { Data struct { ID string `json:"id"` Text string `json:"text"` EditHistoryTweetIDs []string `json:"edit_history_tweet_ids"` NoteTweet struct { Text string `json:"text"` } `json:"note_tweet"` } `json:"data"` } func (c *Client) GetTweetFullText(tweetID string) (*TweetFullTextResponse, error) { lookupURL := fmt.Sprintf("https://api.x.com/2/tweets/%s", tweetID) params := url.Values{} params.Add("expansions", "entities.mentions.username,entities.note.mentions.username") params.Add("tweet.fields", "text,note_tweet") req, err := http.NewRequest("GET", lookupURL+"?"+params.Encode(), nil) if err != nil { return nil, err } req.Header.Add("Authorization", "Bearer "+c.AppToken) client := &http.Client{} resp, err := client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() if resp.StatusCode != http.StatusOK { return nil, fmt.Errorf("failed to fetch tweet, status: %s", resp.Status) } var tweetResponse TweetFullTextResponse body, _ := io.ReadAll(resp.Body) err = json.Unmarshal(body, &tweetResponse) if err != nil { return nil, err } return &tweetResponse, nil } func (c *Client) CheckIfTweetIsTruncated(tweetText string) bool { re := regexp.MustCompile(`https://t.co/[a-zA-Z0-9]+`) return re.MatchString(tweetText) && len(tweetText) > 270 } func (c *Client) GetTweetsByUser(userID string, cursor string) (map[string]*TweetResp, string, error) { baseURL := "https://api.twitter.com/2/users/%s/tweets" url := fmt.Sprintf(baseURL, userID) + "?max_results=100" + "&tweet.fields=public_metrics,referenced_tweets,in_reply_to_user_id,text" + "&expansions=referenced_tweets.id" if cursor != "" { url += "&pagination_token=" + cursor } client := &http.Client{} req, _ := http.NewRequest("GET", url, nil) req.Header.Set("Authorization", "Bearer "+c.AppToken) resp, err := client.Do(req) if err != nil { fmt.Println("Error:", err) return nil, "", nil } defer resp.Body.Close() body, _ := io.ReadAll(resp.Body) var result map[string]interface{} err = json.Unmarshal(body, &result) if err != nil { fmt.Println("Error parsing JSON:", err) return nil, "", nil } tweetIDs := c.extractTweetIDs(result) nextToken := c.extractNextToken(result) mapTweet, err := c.GetTweetDetails(tweetIDs) if err != nil { return nil, "", nil } return mapTweet, nextToken, nil } func (c *Client) extractTweetIDs(data map[string]interface{}) []string { var tweetIDs []string if tweets, exists := data["data"].([]interface{}); exists { for _, t := range tweets { tweet := t.(map[string]interface{}) if id, ok := tweet["id"].(string); ok { tweetIDs = append(tweetIDs, id) } } } return tweetIDs } func (c *Client) extractNextToken(data map[string]interface{}) string { if meta, exists := data["meta"].(map[string]interface{}); exists { if nextToken, ok := meta["next_token"].(string); ok { return nextToken } } return "" } func (c *Client) PostTweetWithVideo(tweetContent, videoURL string, additionalOwners []string) error { config := oauth1.NewConfig(c.ConsumerKey, c.ConsumerSecret) token := oauth1.NewToken(c.AccessToken, c.AccessSecret) httpClient := config.Client(oauth1.NoContext, token) twitterApiUrl := "https://api.twitter.com/2/tweets" mediaID, err := c.UploadVideo(videoURL, additionalOwners) if err != nil { return err } body := map[string]interface{}{ "text": tweetContent, } if mediaID != "" { body["media"] = map[string]interface{}{ "media_ids": []string{mediaID}, } } jsonBody, err := json.Marshal(body) if err != nil { return err } req, err := http.NewRequest("POST", twitterApiUrl, bytes.NewBuffer(jsonBody)) if err != nil { return err } req.Header.Set("Content-Type", "application/json") resp, err := httpClient.Do(req) if err != nil { return err } defer resp.Body.Close() if resp.StatusCode == http.StatusCreated { return nil } else { return errs.ErrBadRequest } } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/twitter/common_obj.go ================================================ package twitter // EntitiesObj contains details about text that has a special meaning. type EntitiesObj struct { Annotations []EntityAnnotationObj `json:"annotations"` URLs []EntityURLObj `json:"urls"` HashTags []EntityTagObj `json:"hashtags"` Mentions []EntityMentionObj `json:"mentions"` CashTags []EntityTagObj `json:"cashtags"` } // EntityObj contains the start and end positions of the text type EntityObj struct { Start int `json:"start"` End int `json:"end"` } // EntityAnnotationObj contains details about annotations relative to the text. type EntityAnnotationObj struct { EntityObj Probability float64 `json:"probability"` Type string `json:"type"` NormalizedText string `json:"normalized_text"` } // EntityURLObj contains details about text recognized as a URL. type EntityURLObj struct { EntityObj URL string `json:"url"` ExpandedURL string `json:"expanded_url"` DisplayURL string `json:"display_url"` Status int `json:"status"` Title string `json:"title"` Desription string `json:"description"` UnwoundURL string `json:"unwound_url"` } // EntityTagObj contains details about text recognized as a tag type EntityTagObj struct { EntityObj Tag string `json:"tag"` } // EntityMentionObj contains details about text recognized as a user mention. type EntityMentionObj struct { EntityObj UserName string `json:"username"` } // WithHeldObj contains withholding details type WithHeldObj struct { Copyright bool `json:"copyright"` CountryCodes []string `json:"country_codes"` } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/twitter/error_obj.go ================================================ package twitter // ErrorObj is part of the partial errors in the response type ErrorObj struct { Title string `json:"title"` Detail string `json:"detail"` Type string `json:"type"` ResourceType string `json:"resource_type"` Value string `json:"value"` Parameter string `json:"parameter"` } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/twitter/exclude.go ================================================ package twitter // Exclude used in the timeline parameters type Exclude string const ( // ExcludeRetweets will exclude the tweet retweets ExcludeRetweets Exclude = "retweets" // ExcludeReplies will exclude the tweet replies ExcludeReplies Exclude = "replies" ) func excludetringArray(arr []Exclude) []string { strs := make([]string, len(arr)) for i, field := range arr { strs[i] = string(field) } return strs } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/twitter/expansions.go ================================================ package twitter // Expansion can expand objects referenced in the payload type Expansion string const ( // ExpansionAttachmentsPollIDs returns a poll object containing metadata for the poll included in the Tweet ExpansionAttachmentsPollIDs Expansion = "attachments.poll_ids" // ExpansionAttachmentsMediaKeys returns a media object representing the images, videos, GIFs included in the Tweet ExpansionAttachmentsMediaKeys Expansion = "attachments.media_keys" // ExpansionAuthorID returns a user object representing the Tweet’s author ExpansionAuthorID Expansion = "author_id" // ExpansionEntitiesMentionsUserName returns a user object for the user mentioned in the Tweet ExpansionEntitiesMentionsUserName Expansion = "entities.mentions.username" // ExpansionGeoPlaceID returns a place object containing metadata for the location tagged in the Tweet ExpansionGeoPlaceID Expansion = "geo.place_id" // ExpansionInReplyToUserID returns a user object representing the Tweet author this requested Tweet is a reply of ExpansionInReplyToUserID Expansion = "in_reply_to_user_id" // ExpansionReferencedTweetsID returns a Tweet object that this Tweet is referencing (either as a Retweet, Quoted Tweet, or reply) ExpansionReferencedTweetsID Expansion = "referenced_tweets.id" // ExpansionReferencedTweetsIDAuthorID returns a user object for the author of the referenced Tweet ExpansionReferencedTweetsIDAuthorID Expansion = "referenced_tweets.id.author_id" // ExpansionPinnedTweetID returns a Tweet object representing the Tweet pinned to the top of the user’s profile ExpansionPinnedTweetID Expansion = "pinned_tweet_id" ) func expansionStringArray(arr []Expansion) []string { strs := make([]string, len(arr)) for i, expansion := range arr { strs[i] = string(expansion) } return strs } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/twitter/media_obj.go ================================================ package twitter // MediaField can expand the fields that are returned in the media object type MediaField string const ( // MediaFieldDurationMS available when type is video. Duration in milliseconds of the video. MediaFieldDurationMS MediaField = "duration_ms" // MediaFieldHeight of this content in pixels. MediaFieldHeight MediaField = "height" // MediaFieldMediaKey unique identifier of the expanded media content. MediaFieldMediaKey MediaField = "media_key" // MediaFieldPreviewImageURL is the URL to the static placeholder preview of this content. MediaFieldPreviewImageURL MediaField = "preview_image_url" // MediaFieldType is the type of content (animated_gif, photo, video) MediaFieldType MediaField = "type" // MediaFieldURL is the URL of the content MediaFieldURL MediaField = "url" // MediaFieldWidth is the width of this content in pixels MediaFieldWidth MediaField = "width" // MediaFieldPublicMetrics is the public engagement metrics for the media content at the time of the request. MediaFieldPublicMetrics MediaField = "public_metrics" // MediaFieldNonPublicMetrics is the non-public engagement metrics for the media content at the time of the request. MediaFieldNonPublicMetrics MediaField = "non_public_metrics" // MediaFieldOrganicMetrics is the engagement metrics for the media content, tracked in an organic context, at the time of the request. MediaFieldOrganicMetrics MediaField = "organic_metrics" // MediaFieldPromotedMetrics is the URL to the static placeholder preview of this content. MediaFieldPromotedMetrics MediaField = "promoted_metrics" ) func mediaFieldStringArray(arr []MediaField) []string { strs := make([]string, len(arr)) for i, field := range arr { strs[i] = string(field) } return strs } // MediaObj refers to any image, GIF, or video attached to a Tweet type MediaObj struct { Key string `json:"media_key"` Type string `json:"type"` URL string `json:"url"` DurationMS int `json:"duration_ms"` Height int `json:"height"` NonPublicMetrics MediaMetricsObj `json:"non_public_metrics"` OrganicMetrics MediaMetricsObj `json:"organic_metrics"` PreviewImageURL string `json:"preview_image_url"` PromotedMetrics MediaMetricsObj `json:"promoted_metrics"` PublicMetrics MediaMetricsObj `json:"public_metrics"` Width int `json:"width"` } // MediaMetricsObj engagement metrics for the media content at the time of the request type MediaMetricsObj struct { Playback0 int `json:"playback_0_count"` Playback100 int `json:"playback_100_count"` Playback25 int `json:"playback_25_count"` Playback50 int `json:"playback_50_count"` Playback75 int `json:"playback_75_count"` Views int `json:"view_count"` } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/twitter/place_obj.go ================================================ package twitter // PlaceField can expand the tweet primary object type PlaceField string const ( // PlaceFieldContainedWithin returns the identifiers of known places that contain the referenced place. PlaceFieldContainedWithin PlaceField = "contained_within" // PlaceFieldCountry is the full-length name of the country this place belongs to. PlaceFieldCountry PlaceField = "country" // PlaceFieldCountryCode is the ISO Alpha-2 country code this place belongs to. PlaceFieldCountryCode PlaceField = "country_code" // PlaceFieldFullName is a longer-form detailed place name. PlaceFieldFullName PlaceField = "full_name" // PlaceFieldGeo contains place details in GeoJSON format. PlaceFieldGeo PlaceField = "geo" // PlaceFieldID is the unique identifier of the expanded place, if this is a point of interest tagged in the Tweet. PlaceFieldID PlaceField = "id" // PlaceFieldName is the short name of this place PlaceFieldName PlaceField = "name" // PlaceFieldPlaceType is specified the particular type of information represented by this place information, such as a city name, or a point of interest. PlaceFieldPlaceType PlaceField = "place_type" ) func placeFieldStringArray(arr []PlaceField) []string { strs := make([]string, len(arr)) for i, field := range arr { strs[i] = string(field) } return strs } // PlaceObj tagged in a Tweet is not a primary object on any endpoint type PlaceObj struct { FullName string `json:"full_name"` ID string `json:"id"` ContainedWithin []string `json:"contained_within"` Country string `json:"country"` CountryCode string `json:"country_code"` Geo PlaceGeoObj `json:"geo"` Name string `json:"name"` PlaceType string `json:"place_type"` } // PlaceGeoObj contains place details type PlaceGeoObj struct { Type string `json:"type"` BBox []float64 `json:"bbox"` Properties map[string]interface{} `json:"properties"` } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/twitter/poll_obj.go ================================================ package twitter // PollField defines the fields of the expanded tweet type PollField string const ( // PollFieldDurationMinutes specifies the total duration of this poll. PollFieldDurationMinutes PollField = "duration_minutes" // PollFieldEndDateTime specifies the end date and time for this poll. PollFieldEndDateTime PollField = "end_datetime" // PollFieldID is unique identifier of the expanded poll. PollFieldID PollField = "id" // PollFieldOptions contains objects describing each choice in the referenced poll. PollFieldOptions PollField = "options" // PollFieldVotingStatus indicates if this poll is still active and can receive votes, or if the voting is now closed. PollFieldVotingStatus PollField = "voting_status" ) func pollFieldStringArray(arr []PollField) []string { strs := make([]string, len(arr)) for i, field := range arr { strs[i] = string(field) } return strs } // PollObj included in a Tweet is not a primary object on any endpoint type PollObj struct { ID string `json:"id"` Options []PollOptionObj `json:"options"` DurationMinutes int `json:"duration_minutes"` EndDateTime string `json:"end_datetime"` VotingStatus string `json:"voting_status"` } // PollOptionObj contains objects describing each choice in the referenced poll. type PollOptionObj struct { Position int `json:"position"` Label string `json:"label"` Votes int `json:"votes"` } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/twitter/tweet.go ================================================ package twitter import ( "bytes" "context" "encoding/json" "errors" "fmt" "net/http" "strings" ) const ( tweetLookupEndpoint = "2/tweets" tweetRecentSearchEndpoint = "2/tweets/search/recent" tweetFilteredStreamRulesEndpoint = "2/tweets/search/stream/rules" tweetFilteredStreamEndpoint = "2/tweets/search/stream" tweetSampledStreamEndpoint = "2/tweets/sample/stream" tweetHideEndpoint = "2/tweets/{id}/hidden" tweetID = "{id}" tweetMaxIDs = 100 tweetQuerySize = 512 ) // TweetLookups is .a map of tweet lookups type TweetLookups map[string]TweetLookup type tweetLookupIncludes struct { Media []*MediaObj `json:"media"` Place []*PlaceObj `json:"places"` Poll []*PollObj `json:"polls"` User []*UserObj `json:"users"` Tweet []*TweetObj `json:"tweets"` } type tweetLookupMaps struct { usersByID map[string]*UserObj usersByName map[string]*UserObj placeByID map[string]*PlaceObj pollByID map[string]*PollObj mediaByKey map[string]*MediaObj tweetsByID map[string]*TweetObj } func lookupMaps(include tweetLookupIncludes) tweetLookupMaps { maps := tweetLookupMaps{} maps.usersByID = map[string]*UserObj{} maps.usersByName = map[string]*UserObj{} for _, user := range include.User { maps.usersByID[user.ID] = user maps.usersByName[user.UserName] = user } maps.placeByID = map[string]*PlaceObj{} for _, place := range include.Place { maps.placeByID[place.ID] = place } maps.pollByID = map[string]*PollObj{} for _, poll := range include.Poll { maps.pollByID[poll.ID] = poll } maps.mediaByKey = map[string]*MediaObj{} for _, media := range include.Media { maps.mediaByKey[media.Key] = media } maps.tweetsByID = map[string]*TweetObj{} for _, tweet := range include.Tweet { maps.tweetsByID[tweet.ID] = tweet } return maps } func (t TweetLookups) lookup(decoder *json.Decoder) error { type body struct { Data TweetObj `json:"data"` Include tweetLookupIncludes `json:"includes"` } b := &body{} if err := decoder.Decode(b); err != nil { return fmt.Errorf("tweet lookup decode error %w", err) } maps := lookupMaps(b.Include) tl := createTweetLookup(b.Data, maps) t[b.Data.ID] = tl return nil } func (t TweetLookups) lookups(decoder *json.Decoder) error { type body struct { Data []TweetObj `json:"data"` Include tweetLookupIncludes `json:"includes"` } b := &body{} if err := decoder.Decode(b); err != nil { return fmt.Errorf("tweet lookup decode error %w", err) } maps := lookupMaps(b.Include) for _, tweet := range b.Data { tl := createTweetLookup(tweet, maps) t[tweet.ID] = tl } return nil } func createTweetLookup(tweet TweetObj, maps tweetLookupMaps) TweetLookup { if tweet.NoteTweet.Text != "" { tweet.Text = tweet.NoteTweet.Text } tl := TweetLookup{ Tweet: tweet, } if author, has := maps.usersByID[tweet.AuthorID]; has { tl.User = author } if inReply, has := maps.usersByID[tweet.InReplyToUserID]; has { tl.InReplyUser = inReply } if place, has := maps.placeByID[tweet.Geo.PlaceID]; has { tl.Place = place } mentions := []*UserObj{} for _, entity := range tweet.Entities.Mentions { if user, has := maps.usersByName[entity.UserName]; has { mentions = append(mentions, user) } } tl.Mentions = mentions attachmentPolls := []*PollObj{} for _, id := range tweet.Attachments.PollIDs { if poll, has := maps.pollByID[id]; has { attachmentPolls = append(attachmentPolls, poll) } } tl.AttachmentPolls = attachmentPolls attachmentMedia := []*MediaObj{} for _, key := range tweet.Attachments.MediaKeys { if media, has := maps.mediaByKey[key]; has { attachmentMedia = append(attachmentMedia, media) } } tl.AttachmentMedia = attachmentMedia tweetReferences := []TweetLookup{} for _, rt := range tweet.ReferencedTweets { if t, has := maps.tweetsByID[rt.ID]; has { tweetReferences = append(tweetReferences, createTweetLookup(*t, maps)) } } tl.ReferencedTweets = tweetReferences return tl } // TweetLookup is a complete tweet objects type TweetLookup struct { Tweet TweetObj Media *MediaObj Place *PlaceObj Poll *PollObj User *UserObj InReplyUser *UserObj Mentions []*UserObj AttachmentPolls []*PollObj AttachmentMedia []*MediaObj ReferencedTweets []TweetLookup } // TweetRecentSearchMeta is the media data returned from the recent search type TweetRecentSearchMeta struct { NewestID string `json:"newest_id"` OldestID string `json:"oldest_id"` ResultCount int `json:"result_count"` NextToken string `json:"next_token"` } // TweetRecentSearch is what is returned from the callout type TweetRecentSearch struct { LookUps TweetLookups Meta TweetRecentSearchMeta } // UnmarshalJSON will unmarshal the byte array func (t *TweetRecentSearch) UnmarshalJSON(b []byte) error { type meta struct { Meta TweetRecentSearchMeta `json:"meta"` } m := &meta{} if err := json.Unmarshal(b, m); err != nil { return err } t.Meta = m.Meta tl := TweetLookups{} if err := tl.lookups(json.NewDecoder(bytes.NewReader(b))); err != nil { return err } t.LookUps = tl return nil } // HTTPError is a response error where the body is not JSON, but XML. This commonly seen in 404 errors. type HTTPError struct { Status string StatusCode int URL string } func (h *HTTPError) Error() string { return fmt.Sprintf("twitter [%s] status: %s code: %d", h.URL, h.Status, h.StatusCode) } // TweetError is the group of errors in a response type TweetError struct { Parameters interface{} `json:"parameters"` Message string `json:"message"` } // TweetErrorResponse is the error message from the callout type TweetErrorResponse struct { StatusCode int Errors []TweetError `json:"errors"` Title string `json:"title"` Detail string `json:"detail"` Type string `json:"type"` } func (t *TweetErrorResponse) Error() string { return fmt.Sprintf("status %d %s:%s", t.StatusCode, t.Title, t.Detail) } // TweetSearchStreamAddRule are the rules to add the search stream type TweetSearchStreamAddRule struct { Value string `json:"value"` Tag string `json:"tag,omitempty"` } // TweetSearchStreamDeleteRule lists the search rule ids to remove type TweetSearchStreamDeleteRule struct { IDs []string `json:"ids"` } // TweetSearchStreamRule are the rules to add and/or delete type TweetSearchStreamRule struct { Add []*TweetSearchStreamAddRule `json:"add,omitempty"` Delete *TweetSearchStreamDeleteRule `json:"delete,omitempty"` } // TweetSearchStreamRuleData are the rules that where added type TweetSearchStreamRuleData struct { ID string `json:"id"` Value string `json:"value"` Tag string `json:"tag"` } // TweetSearchStreamRuleMeta is the meta data for the search rules type TweetSearchStreamRuleMeta struct { Sent string `json:"sent"` Summary TweetSearchStreamRuleSummary `json:"summary"` } // TweetSearchStreamRuleSummary is the summary of the rules type TweetSearchStreamRuleSummary struct { Created int `json:"created"` NotCreated int `json:"not_created"` Deleted int `json:"deleted"` NotDeleted int `json:"not_deleted"` } // TweetSearchStreamRules is the returned set of rules type TweetSearchStreamRules struct { Data []TweetSearchStreamRuleData `json:"data"` Meta TweetSearchStreamRuleMeta `json:"meta"` } // Tweet represents the Tweet v2 APIs type Tweet struct { Authorizer Authorizer Client *http.Client Host string } // Lookup will return a tweet or tweets from a set of ids func (t *Tweet) Lookup(ctx context.Context, ids []string, options TweetFieldOptions) (TweetLookups, error) { ep := tweetLookupEndpoint switch { case len(ids) == 0: return nil, fmt.Errorf("tweet lookup an id is required") case len(ids) > tweetMaxIDs: return nil, fmt.Errorf("tweet lookup: ids %d is greater than max %d", len(ids), tweetMaxIDs) case len(ids) == 1: ep += fmt.Sprintf("/%s", ids[0]) default: } req, err := http.NewRequestWithContext(ctx, http.MethodGet, fmt.Sprintf("%s/%s", t.Host, ep), nil) if err != nil { return nil, fmt.Errorf("tweet lookup request: %w", err) } req.Header.Add("Accept", "application/json") t.Authorizer.Add(req) options.addQuery(req) if len(ids) > 1 { q := req.URL.Query() q.Add("ids", strings.Join(ids, ",")) req.URL.RawQuery = q.Encode() } resp, err := t.Client.Do(req) if err != nil { return nil, fmt.Errorf("tweet lookup response: %w", err) } defer resp.Body.Close() decoder := json.NewDecoder(resp.Body) if resp.StatusCode != http.StatusOK { e := &TweetErrorResponse{} if err := decoder.Decode(e); err != nil { return nil, &HTTPError{ Status: resp.Status, StatusCode: resp.StatusCode, URL: resp.Request.URL.String(), } } e.StatusCode = resp.StatusCode return nil, e } tl := TweetLookups{} if len(ids) == 1 { if err := tl.lookup(decoder); err != nil { return nil, err } return tl, nil } if err := tl.lookups(decoder); err != nil { return nil, err } return tl, nil } // RecentSearch will query the recent search func (t *Tweet) RecentSearch(ctx context.Context, query string, searchOpts TweetRecentSearchOptions, fieldOpts TweetFieldOptions) (*TweetRecentSearch, error) { switch { case len(query) == 0: return nil, fmt.Errorf("tweet recent search query must be present") case len(query) > tweetQuerySize: return nil, fmt.Errorf("tweet recent search query size %d greater than max %d", len(query), tweetQuerySize) case searchOpts.MaxResult > 0 && (searchOpts.MaxResult < 10 || searchOpts.MaxResult > 100): return nil, fmt.Errorf("tweet resent search max result needs to be between 10 -100 (%d", searchOpts.MaxResult) default: searchOpts.query = query } req, err := http.NewRequestWithContext(ctx, http.MethodGet, fmt.Sprintf("%s/%s", t.Host, tweetRecentSearchEndpoint), nil) if err != nil { return nil, fmt.Errorf("tweet recent search request: %w", err) } req.Header.Add("Accept", "application/json") t.Authorizer.Add(req) searchOpts.addQuery(req) fieldOpts.addQuery(req) resp, err := t.Client.Do(req) if err != nil { return nil, fmt.Errorf("tweet recent search response: %w", err) } defer resp.Body.Close() decoder := json.NewDecoder(resp.Body) if resp.StatusCode != http.StatusOK { e := &TweetErrorResponse{} if err := decoder.Decode(e); err != nil { return nil, &HTTPError{ Status: resp.Status, StatusCode: resp.StatusCode, URL: resp.Request.URL.String(), } } e.StatusCode = resp.StatusCode return nil, e } tr := &TweetRecentSearch{} if err := decoder.Decode(tr); err != nil { return nil, fmt.Errorf("tweet recent search response decode: %w", err) } return tr, nil } // ApplyFilteredStreamRules will add and/or remove rules from the seach stream func (t *Tweet) ApplyFilteredStreamRules(ctx context.Context, rules TweetSearchStreamRule, validate bool) (*TweetSearchStreamRules, error) { if len(rules.Add) == 0 && rules.Delete == nil { return nil, errors.New("tweet search stream rules: there must be add or delete rules") } for _, add := range rules.Add { if len(add.Value) == 0 { return nil, errors.New("tweet search stream rules: add value is required") } } if rules.Delete != nil && len(rules.Delete.IDs) == 0 { return nil, errors.New("tweet search stream rules: delete ids are required") } enc, err := json.Marshal(rules) if err != nil { return nil, fmt.Errorf("tweet search stream rules: rules encoding %w", err) } req, err := http.NewRequestWithContext(ctx, http.MethodPost, fmt.Sprintf("%s/%s", t.Host, tweetFilteredStreamRulesEndpoint), bytes.NewReader(enc)) if err != nil { return nil, fmt.Errorf("tweet rsearch stream rules request: %w", err) } req.Header.Add("Accept", "application/json") req.Header.Add("Content-type", "application/json") t.Authorizer.Add(req) if validate { q := req.URL.Query() q.Add("dry_run", "true") req.URL.RawQuery = q.Encode() } resp, err := t.Client.Do(req) if err != nil { return nil, fmt.Errorf("tweet search stream rules response: %w", err) } defer resp.Body.Close() decoder := json.NewDecoder(resp.Body) if resp.StatusCode != http.StatusCreated { e := &TweetErrorResponse{} if err := decoder.Decode(e); err != nil { return nil, &HTTPError{ Status: resp.Status, StatusCode: resp.StatusCode, URL: resp.Request.URL.String(), } } e.StatusCode = resp.StatusCode return nil, e } tr := &TweetSearchStreamRules{} if err := decoder.Decode(tr); err != nil { return nil, fmt.Errorf("tweet search stream rules response decode: %w", err) } return tr, nil } // FilteredStreamRules will return the rules from the ids func (t *Tweet) FilteredStreamRules(ctx context.Context, ids []string) (*TweetSearchStreamRules, error) { if len(ids) == 0 { return nil, errors.New("tweet search stream rules: there must be ids") } req, err := http.NewRequestWithContext(ctx, http.MethodGet, fmt.Sprintf("%s/%s", t.Host, tweetFilteredStreamRulesEndpoint), nil) if err != nil { return nil, fmt.Errorf("tweet rsearch stream rules request: %w", err) } q := req.URL.Query() q.Add("ids", strings.Join(ids, ",")) req.URL.RawQuery = q.Encode() req.Header.Add("Accept", "application/json") t.Authorizer.Add(req) resp, err := t.Client.Do(req) if err != nil { return nil, fmt.Errorf("tweet search stream rules response: %w", err) } defer resp.Body.Close() decoder := json.NewDecoder(resp.Body) if resp.StatusCode != http.StatusOK { e := &TweetErrorResponse{} if err := decoder.Decode(e); err != nil { return nil, &HTTPError{ Status: resp.Status, StatusCode: resp.StatusCode, URL: resp.Request.URL.String(), } } e.StatusCode = resp.StatusCode return nil, e } tr := &TweetSearchStreamRules{} if err := decoder.Decode(tr); err != nil { return nil, fmt.Errorf("tweet search stream rules response decode: %w", err) } return tr, nil } // FilteredStream allows to stream some tweets on a specific set of filter rules func (t *Tweet) FilteredStream(ctx context.Context, options TweetFieldOptions) (TweetLookups, error) { req, err := http.NewRequestWithContext(ctx, http.MethodGet, fmt.Sprintf("%s/%s", t.Host, tweetFilteredStreamEndpoint), nil) if err != nil { return nil, fmt.Errorf("tweet lookup request: %w", err) } req.Header.Add("Accept", "application/json") t.Authorizer.Add(req) options.addQuery(req) resp, err := t.Client.Do(req) if err != nil { return nil, fmt.Errorf("tweet lookup response: %w", err) } defer resp.Body.Close() decoder := json.NewDecoder(resp.Body) if resp.StatusCode != http.StatusOK { e := &TweetErrorResponse{} if err := decoder.Decode(e); err != nil { return nil, &HTTPError{ Status: resp.Status, StatusCode: resp.StatusCode, URL: resp.Request.URL.String(), } } e.StatusCode = resp.StatusCode return nil, e } tl := TweetLookups{} if err := tl.lookup(decoder); err != nil { return nil, err } return tl, nil } // SampledStream will stream about 1% of all tweets func (t *Tweet) SampledStream(ctx context.Context, options TweetFieldOptions) (TweetLookups, error) { req, err := http.NewRequestWithContext(ctx, http.MethodGet, fmt.Sprintf("%s/%s", t.Host, tweetSampledStreamEndpoint), nil) if err != nil { return nil, fmt.Errorf("tweet lookup request: %w", err) } req.Header.Add("Accept", "application/json") t.Authorizer.Add(req) options.addQuery(req) resp, err := t.Client.Do(req) if err != nil { return nil, fmt.Errorf("tweet lookup response: %w", err) } defer resp.Body.Close() decoder := json.NewDecoder(resp.Body) if resp.StatusCode != http.StatusOK { e := &TweetErrorResponse{} if err := decoder.Decode(e); err != nil { return nil, &HTTPError{ Status: resp.Status, StatusCode: resp.StatusCode, URL: resp.Request.URL.String(), } } e.StatusCode = resp.StatusCode return nil, e } tl := TweetLookups{} if err := tl.lookup(decoder); err != nil { return nil, err } return tl, nil } // HideReplies will hide a tweet id replies func (t *Tweet) HideReplies(ctx context.Context, id string, hidden bool) error { if len(id) == 0 { return errors.New("tweet hidden: id can not be empty") } hb := struct { Hidden bool `json:"hidden"` }{ Hidden: hidden, } enc, _ := json.Marshal(hb) ep := strings.ReplaceAll(tweetHideEndpoint, tweetID, id) req, err := http.NewRequestWithContext(ctx, http.MethodPut, fmt.Sprintf("%s/%s", t.Host, ep), bytes.NewReader(enc)) if err != nil { return fmt.Errorf("tweet lookup request: %w", err) } req.Header.Add("Accept", "application/json") req.Header.Add("Content-type", "application/json") t.Authorizer.Add(req) resp, err := t.Client.Do(req) if err != nil { return fmt.Errorf("tweet lookup response: %w", err) } defer resp.Body.Close() decoder := json.NewDecoder(resp.Body) if resp.StatusCode != http.StatusOK { e := &TweetErrorResponse{} if err := decoder.Decode(e); err != nil { return &HTTPError{ Status: resp.Status, StatusCode: resp.StatusCode, URL: resp.Request.URL.String(), } } e.StatusCode = resp.StatusCode return e } type responseData struct { Hidden bool `json:"hidden"` } type response struct { Data responseData `json:"data"` } r := &response{} if err := decoder.Decode(r); err != nil { return fmt.Errorf("tweet hidden: response decode err %w", err) } if r.Data.Hidden != hidden { return fmt.Errorf("tweet hidden: expected response (%v) does not match hidden (%v)", r.Data.Hidden, hidden) } return nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/twitter/tweet_obj.go ================================================ package twitter import ( "fmt" "strings" ) // TweetField defines the fields of the basic building block of all things twitter type TweetField string const ( // TweetFieldID is the unique identifier of the requested Tweet. TweetFieldID TweetField = "id" // TweetFieldText is the actual UTF-8 text of the Tweet. See twitter-text for details on what characters are currently considered valid. TweetFieldText TweetField = "text" TweetFieldNoteText TweetField = "note_tweet" // TweetFieldAttachments specifies the type of attachments (if any) present in this Tweet. TweetFieldAttachments TweetField = "attachments" // TweetFieldAuthorID is the unique identifier of the User who posted this Tweet TweetFieldAuthorID TweetField = "author_id" // TweetFieldContextAnnotations contains context annotations for the Tweet. TweetFieldContextAnnotations TweetField = "context_annotations" // TweetFieldConversationID is the Tweet ID of the original Tweet of the conversation (which includes direct replies, replies of replies). TweetFieldConversationID TweetField = "conversation_id" // TweetFieldCreatedAt is the creation time of the Tweet. TweetFieldCreatedAt TweetField = "created_at" // TweetFieldEntities are the entities which have been parsed out of the text of the Tweet. Additionally see entities in Twitter Objects. TweetFieldEntities TweetField = "entities" // TweetFieldGeo contains details about the location tagged by the user in this Tweet, if they specified one. TweetFieldGeo TweetField = "geo" // TweetFieldInReplyToUserID will contain the original Tweet’s author ID TweetFieldInReplyToUserID TweetField = "in_reply_to_user_id" // TweetFieldLanguage is the language of the Tweet, if detected by Twitter. Returned as a BCP47 language tag. TweetFieldLanguage TweetField = "lang" // TweetFieldNonPublicMetrics are the non-public engagement metrics for the Tweet at the time of the request. TweetFieldNonPublicMetrics TweetField = "non_public_metrics" // TweetFieldPublicMetrics are the public engagement metrics for the Tweet at the time of the request. TweetFieldPublicMetrics TweetField = "public_metrics" // TweetFieldOrganicMetrics are the engagement metrics, tracked in an organic context, for the Tweet at the time of the request. TweetFieldOrganicMetrics TweetField = "organic_metrics" // TweetFieldPromotedMetrics are the engagement metrics, tracked in a promoted context, for the Tweet at the time of the request. TweetFieldPromotedMetrics TweetField = "promoted_metrics" // TweetFieldPossiblySensitve is an indicator that the URL contained in the Tweet may contain content or media identified as sensitive content. TweetFieldPossiblySensitve TweetField = "possibly_sensitive" // TweetFieldReferencedTweets is a list of Tweets this Tweet refers to. TweetFieldReferencedTweets TweetField = "referenced_tweets" // TweetFieldSource is the name of the app the user Tweeted from. TweetFieldSource TweetField = "source" // TweetFieldWithHeld contains withholding details TweetFieldWithHeld TweetField = "withheld" ) func tweetFieldStringArray(arr []TweetField) []string { strs := make([]string, len(arr)) for i, field := range arr { strs[i] = string(field) } return strs } // TweetObj is the primary object on the tweets endpoints type TweetObj struct { ID string `json:"id"` Text string `json:"text"` Attachments TweetAttachmentsObj `json:"attachments"` AuthorID string `json:"author_id"` ContextAnnotations []TweetContextAnnotationObj `json:"context_annotations"` ConversationID string `json:"conversation_id"` CreatedAt string `json:"created_at"` Entities EntitiesObj `json:"entities"` Geo TweetGeoObj `json:"geo"` InReplyToUserID string `json:"in_reply_to_user_id"` Language string `json:"lang"` NonPublicMetrics TweetMetricsObj `json:"non_public_metrics"` OrganicMetrics TweetMetricsObj `json:"organic_metrics"` PossibySensitive bool `json:"possiby_sensitive"` PromotedMetrics TweetMetricsObj `json:"promoted_metrics"` PublicMetrics TweetMetricsObj `json:"public_metrics"` ReferencedTweets []TweetReferencedTweetObj `json:"referenced_tweets"` Source string `json:"source"` WithHeld WithHeldObj `json:"withheld"` NoteTweet struct { Text string `json:"text"` } `json:"note_tweet"` } func (tw *TweetObj) GetAllFullText() string { fullText := tw.NoteTweet.Text if fullText == "" { fullText = tw.Text } return fullText } func (tw *TweetObj) GetFullText() string { fullText := tw.NoteTweet.Text if fullText == "" { fullText = tw.Text } for _, item := range tw.Entities.Mentions { fullText = strings.ReplaceAll(fullText, fmt.Sprintf("@%s", item.UserName), "") } return fullText } // TweetAttachmentsObj specifics the type of attachment present in the tweet type TweetAttachmentsObj struct { MediaKeys []string `json:"media_keys"` PollIDs []string `json:"poll_ids"` } // TweetContextAnnotationObj contain the context annotation type TweetContextAnnotationObj struct { Domain TweetContextObj `json:"domain"` Entity TweetContextObj `json:"entity"` } // TweetContextObj contains the elements which identify detailed information regarding the domain classificaiton based on the Tweet text type TweetContextObj struct { ID string `json:"id"` Name string `json:"name"` Description string `json:"description"` } // TweetGeoObj contains details about the location tagged by the user in this Tweet, if they specified one. type TweetGeoObj struct { PlaceID string `json:"place_id"` Coordinates TweetGeoCoordinatesObj `json:"coordinates"` } // TweetGeoCoordinatesObj contains details about the coordinates of the location tagged by the user in this Tweet, if they specified one. type TweetGeoCoordinatesObj struct { Type string `json:"type"` Coordinates []float64 `json:"coordinates"` } // TweetMetricsObj engagement metrics for the Tweet at the time of the request type TweetMetricsObj struct { Impressions int `json:"impression_count"` URLLinkClicks int `json:"url_link_clicks"` UserProfileClicks int `json:"user_profile_clicks"` Likes int `json:"like_count"` Replies int `json:"reply_count"` Retweets int `json:"retweet_count"` Quotes int `json:"quote_count"` } // TweetReferencedTweetObj is a Tweet this Tweet refers to type TweetReferencedTweetObj struct { Type string `json:"type"` ID string `json:"id"` } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/twitter/tweet_params.go ================================================ package twitter import ( "fmt" "net/http" "strings" "time" ) // TweetFieldOptions are the tweet options for the response type TweetFieldOptions struct { Expansions []Expansion MediaFields []MediaField PlaceFields []PlaceField PollFields []PollField TweetFields []TweetField UserFields []UserField } func (t TweetFieldOptions) addQuery(req *http.Request) { q := req.URL.Query() if len(t.Expansions) > 0 { q.Add("expansions", strings.Join(expansionStringArray(t.Expansions), ",")) } if len(t.MediaFields) > 0 { q.Add("media.fields", strings.Join(mediaFieldStringArray(t.MediaFields), ",")) } if len(t.PlaceFields) > 0 { q.Add("place.fields", strings.Join(placeFieldStringArray(t.PlaceFields), ",")) } if len(t.PollFields) > 0 { q.Add("poll.fields", strings.Join(pollFieldStringArray(t.PollFields), ",")) } if len(t.TweetFields) > 0 { q.Add("tweet.fields", strings.Join(tweetFieldStringArray(t.TweetFields), ",")) } if len(t.UserFields) > 0 { q.Add("user.fields", strings.Join(userFieldStringArray(t.UserFields), ",")) } if len(q) > 0 { req.URL.RawQuery = q.Encode() } } // TweetRecentSearchOptions handles all of the recent search parameters type TweetRecentSearchOptions struct { query string StartTime time.Time EndTime time.Time MaxResult int NextToken string SinceID string UntilID string } func (t TweetRecentSearchOptions) addQuery(req *http.Request) { q := req.URL.Query() q.Add("query", t.query) if !t.StartTime.IsZero() { q.Add("start_time", t.StartTime.Format(time.RFC3339)) } if !t.EndTime.IsZero() { q.Add("end_time", t.EndTime.Format(time.RFC3339)) } if t.MaxResult >= 10 { q.Add("max_results", fmt.Sprintf("%d", t.MaxResult)) } if len(t.NextToken) > 0 { q.Add("next_token", t.NextToken) } if len(t.SinceID) > 0 { q.Add("since_id", t.SinceID) } if len(t.UntilID) > 0 { q.Add("until_id", t.UntilID) } if len(q) > 0 { req.URL.RawQuery = q.Encode() } } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/twitter/upload_video.go ================================================ package twitter import ( "bytes" "encoding/json" "fmt" "io" "mime/multipart" "net/http" "strings" "time" "github.com/dghubble/oauth1" ) // UploadVideo uploads the video in chunks to Twitter func (c *Client) UploadVideo(videoURL string, additionalOwners []string) (string, error) { if videoURL == "" { return "", fmt.Errorf("video URL is empty") } // Open the video file (download from URL if necessary) response, err := http.Get(videoURL) if err != nil { return "", err } defer response.Body.Close() // Get the total size of the video file totalBytes := response.ContentLength // OAuth1 authentication config := oauth1.NewConfig(c.ConsumerKey, c.ConsumerSecret) token := oauth1.NewToken(c.AccessToken, c.AccessSecret) httpClient := config.Client(oauth1.NoContext, token) // Step 1: Initialize the upload session mediaID, err := c.uploadInit(httpClient, totalBytes, additionalOwners) if err != nil { return "", err } // Step 2: Upload video chunks err = c.uploadAppend(httpClient, mediaID, response.Body, totalBytes) if err != nil { return "", err } // Step 3: Finalize the upload process err = c.uploadFinalize(httpClient, mediaID) if err != nil { return "", err } return mediaID, nil } // uploadInit starts the video upload session func (c *Client) uploadInit(httpClient *http.Client, totalBytes int64, additionalOwners []string) (string, error) { url := "https://upload.twitter.com/1.1/media/upload.json" data := make(map[string]string) data["command"] = "INIT" data["media_type"] = "video/mp4" data["total_bytes"] = fmt.Sprintf("%d", totalBytes) data["media_category"] = "tweet_video" // Create the request body for initialization reqBody := new(bytes.Buffer) writer := multipart.NewWriter(reqBody) for key, value := range data { _ = writer.WriteField(key, value) } if len(additionalOwners) > 0 { owners := strings.Join(additionalOwners, ",") if err := writer.WriteField("additional_owners", owners); err != nil { return "", fmt.Errorf("failed to add additional_owners: %w", err) } } writer.Close() // Prepare the POST request req, err := http.NewRequest("POST", url, reqBody) if err != nil { return "", err } req.Header.Set("Content-Type", writer.FormDataContentType()) // Send the request resp, err := httpClient.Do(req) if err != nil { return "", err } defer resp.Body.Close() // Decode the response var result map[string]interface{} err = json.NewDecoder(resp.Body).Decode(&result) if err != nil { return "", err } // Extract media ID mediaID, ok := result["media_id_string"].(string) if !ok { return "", fmt.Errorf("failed to find 'data' field in response") } return mediaID, nil } // uploadAppend uploads video chunks to Twitter func (c *Client) uploadAppend(httpClient *http.Client, mediaID string, videoBody io.Reader, totalBytes int64) error { // Define chunk size (4MB per chunk) const chunkSize = 4 * 1024 * 1024 segmentID := 0 bytesSent := int64(0) // Read and send chunks for { chunk := make([]byte, chunkSize) n, err := videoBody.Read(chunk) if err == io.EOF { break } if err != nil { return err } // Slice chunk based on the number of bytes read chunk = chunk[:n] // Prepare the multipart form for uploading a chunk reqBody := new(bytes.Buffer) writer := multipart.NewWriter(reqBody) part, err := writer.CreateFormFile("media", "video_chunk") if err != nil { return err } _, err = part.Write(chunk) if err != nil { return err } // Add media_id and segment_index to the form writer.WriteField("command", "APPEND") writer.WriteField("media_id", mediaID) writer.WriteField("segment_index", fmt.Sprintf("%d", segmentID)) writer.Close() // Prepare the POST request to upload the chunk req, err := http.NewRequest("POST", "https://upload.twitter.com/1.1/media/upload.json", reqBody) if err != nil { return err } req.Header.Set("Content-Type", writer.FormDataContentType()) // Send the chunk resp, err := httpClient.Do(req) if err != nil { return err } defer resp.Body.Close() // Update bytes sent and segment ID bytesSent += int64(n) segmentID++ // Print progress fmt.Printf("Uploaded %d/%d bytes\n", bytesSent, totalBytes) } return nil } // uploadFinalize finalizes the upload process and starts video processing func (c *Client) uploadFinalize(httpClient *http.Client, mediaID string) error { url := "https://upload.twitter.com/1.1/media/upload.json" data := make(map[string]string) data["command"] = "FINALIZE" data["media_id"] = mediaID // Create the request body for finalization reqBody := new(bytes.Buffer) writer := multipart.NewWriter(reqBody) for key, value := range data { _ = writer.WriteField(key, value) } writer.Close() // Prepare the POST request req, err := http.NewRequest("POST", url, reqBody) if err != nil { return err } req.Header.Set("Content-Type", writer.FormDataContentType()) // Send the request resp, err := httpClient.Do(req) if err != nil { return err } defer resp.Body.Close() // Decode the response var result map[string]interface{} err = json.NewDecoder(resp.Body).Decode(&result) if err != nil { return err } // Check if the video has finished processing processingInfo, ok := result["processing_info"].(map[string]interface{}) if ok { state := processingInfo["state"].(string) if state == "succeeded" { return nil } // If the video is still processing, wait and try again checkAfterSecs := processingInfo["check_after_secs"].(float64) fmt.Printf("Processing video, checking after %.0f seconds...\n", checkAfterSecs) time.Sleep(time.Duration(checkAfterSecs) * time.Second) return c.uploadFinalize(httpClient, mediaID) } return fmt.Errorf("failed to finalize upload") } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/twitter/user.go ================================================ package twitter import ( "bytes" "context" "encoding/json" "fmt" "io" "net/http" "strings" ) const ( userLookupEndpoint = "2/users" userNameLookupEndpoint = "2/users/by/username" userNamesLookupEndpoint = "2/users/by" userFollowingLookupEndpoint = "2/users/{id}/following" userFollowersLookupEndpoint = "2/users/{id}/followers" userTimelineTweetsEndpoint = "2/users/{id}/tweets" userTimelineMentionsEndpoint = "2/users/{id}/mentions" userID = "{id}" userMaxIDs = 100 userMaxNames = 100 ) // UserLookups is a map of user lookups type UserLookups map[string]UserLookup func (t UserLookups) lookup(decoder *json.Decoder) error { type include struct { Tweet []*TweetObj `json:"tweets"` } type body struct { Data UserObj `json:"data"` Include include `json:"includes"` } b := &body{} if err := decoder.Decode(b); err != nil { return fmt.Errorf("tweet lookup decode error %w", err) } ul := UserLookup{ User: b.Data, } if len(b.Include.Tweet) > 0 { ul.Tweet = b.Include.Tweet[0] } t[b.Data.ID] = ul return nil } func (t UserLookups) lookups(decoder *json.Decoder) error { type include struct { Tweet []*TweetObj `json:"tweets"` } type body struct { Data []UserObj `json:"data"` Include include `json:"includes"` } b := &body{} if err := decoder.Decode(b); err != nil { return fmt.Errorf("tweet lookup decode error %w", err) } pinnedTweets := map[string]*TweetObj{} for _, tweet := range b.Include.Tweet { pinnedTweets[tweet.ID] = tweet } for _, user := range b.Data { ul := UserLookup{ User: user, } if tweet, has := pinnedTweets[user.PinnedTweetID]; has { ul.Tweet = tweet } t[user.ID] = ul } return nil } // UserLookup is a complete user objects type UserLookup struct { User UserObj Tweet *TweetObj } // UserFollowLookup contains all of the user following information type UserFollowLookup struct { Lookups UserLookups Meta *UserFollowMeta Errors []ErrorObj } // UserFollowMeta the meta that is returned for the following APIs type UserFollowMeta struct { ResultCount int `json:"result_count"` PreviousToken string `json:"previous_token"` NextToken string `json:"next_token"` } // UserTimeline is the response to the user tweet timeline API type UserTimeline struct { Tweets []TweetObj `json:"data"` Includes *UserTimelineIncludes `json:"includes"` Errors []ErrorObj `json:"errors"` Meta UserTimelineMeta `json:"meta"` } // UserTimelineIncludes will contain the optional response objects type UserTimelineIncludes struct { Medias []MediaObj `json:"media"` Users []UserObj `json:"users"` Tweets []TweetObj `json:"tweets"` Places []PlaceObj `json:"places"` Polls string `json:"polls"` } // UserTimelineMeta is the meta data of the response type UserTimelineMeta struct { OldestID string `json:"oldest_id"` NewestID string `json:"newest_id"` ResultCount int `json:"result_count"` NextToken string `json:"next_token"` PreviousToken string `json:"previous_token"` } // User represents the User v2 APIs type User struct { Authorizer Authorizer Client *http.Client Host string } // Lookup can be used to look up a user by their id func (u *User) Lookup(ctx context.Context, ids []string, fieldOpts UserFieldOptions) (UserLookups, error) { ep := userLookupEndpoint switch { case len(ids) == 0: return nil, fmt.Errorf("user lookup an id is required") case len(ids) > userMaxIDs: return nil, fmt.Errorf("user lookup: ids %d is greater than max %d", len(ids), userMaxIDs) case len(ids) == 1: ep += fmt.Sprintf("/%s", ids[0]) default: } req, err := http.NewRequestWithContext(ctx, http.MethodGet, fmt.Sprintf("%s/%s", u.Host, ep), nil) if err != nil { return nil, fmt.Errorf("user lookup request: %w", err) } req.Header.Add("Accept", "application/json") u.Authorizer.Add(req) fieldOpts.addQuery(req) if len(ids) > 1 { q := req.URL.Query() q.Add("ids", strings.Join(ids, ",")) req.URL.RawQuery = q.Encode() } resp, err := u.Client.Do(req) if err != nil { return nil, fmt.Errorf("user lookup response: %w", err) } defer resp.Body.Close() decoder := json.NewDecoder(resp.Body) if resp.StatusCode != http.StatusOK { e := &TweetErrorResponse{} if err := decoder.Decode(e); err != nil { return nil, &HTTPError{ Status: resp.Status, StatusCode: resp.StatusCode, URL: resp.Request.URL.String(), } } e.StatusCode = resp.StatusCode return nil, e } ul := UserLookups{} if len(ids) == 1 { if err := ul.lookup(decoder); err != nil { return nil, err } return ul, nil } if err := ul.lookups(decoder); err != nil { return nil, err } return ul, nil } // LookupUsername will retuen the user information from its user names func (u *User) LookupUsername(ctx context.Context, usernames []string, fieldOpts UserFieldOptions) (UserLookups, error) { ep := userNamesLookupEndpoint switch { case len(usernames) == 0: return nil, fmt.Errorf("user lookup name is required") case len(usernames) > userMaxNames: return nil, fmt.Errorf("user lookup: names %d is greater than max %d", len(usernames), userMaxNames) case len(usernames) == 1: ep = fmt.Sprintf("%s/%s", userNameLookupEndpoint, usernames[0]) default: } req, err := http.NewRequestWithContext(ctx, http.MethodGet, fmt.Sprintf("%s/%s", u.Host, ep), nil) if err != nil { return nil, fmt.Errorf("user lookup request: %w", err) } req.Header.Add("Accept", "application/json") u.Authorizer.Add(req) fieldOpts.addQuery(req) if len(usernames) > 1 { q := req.URL.Query() q.Add("usernames", strings.Join(usernames, ",")) req.URL.RawQuery = q.Encode() } resp, err := u.Client.Do(req) if err != nil { return nil, fmt.Errorf("user lookup response: %w", err) } defer resp.Body.Close() decoder := json.NewDecoder(resp.Body) if resp.StatusCode != http.StatusOK { e := &TweetErrorResponse{} if err := decoder.Decode(e); err != nil { return nil, &HTTPError{ Status: resp.Status, StatusCode: resp.StatusCode, URL: resp.Request.URL.String(), } } e.StatusCode = resp.StatusCode return nil, e } ul := UserLookups{} if len(usernames) == 1 { if err := ul.lookup(decoder); err != nil { return nil, err } return ul, nil } if err := ul.lookups(decoder); err != nil { return nil, err } return ul, nil } // LookupFollowing handles the user following callout func (u *User) LookupFollowing(ctx context.Context, id string, followOpts UserFollowOptions) (*UserFollowLookup, error) { switch { case len(id) == 0: return nil, fmt.Errorf("user id must be present for following lookup") case followOpts.MaxResults < 0 || followOpts.MaxResults > 1000: return nil, fmt.Errorf("user max results for following lookup must be between 1-1000: %d", followOpts.MaxResults) default: } ep := fmt.Sprintf("%s/%s", u.Host, userFollowingLookupEndpoint) ep = strings.Replace(ep, userID, id, -1) req, err := http.NewRequestWithContext(ctx, http.MethodGet, ep, nil) if err != nil { return nil, fmt.Errorf("user lookup following request: %w", err) } req.Header.Add("Accept", "application/json") u.Authorizer.Add(req) followOpts.addQuery(req) resp, err := u.Client.Do(req) if err != nil { return nil, fmt.Errorf("user lookup response: %w", err) } defer resp.Body.Close() body, err := io.ReadAll(resp.Body) if err != nil { return nil, fmt.Errorf("user lookup following reading body: %w", err) } if resp.StatusCode != http.StatusOK { e := &TweetErrorResponse{} if err := json.Unmarshal(body, e); err != nil { return nil, &HTTPError{ Status: resp.Status, StatusCode: resp.StatusCode, URL: resp.Request.URL.String(), } } e.StatusCode = resp.StatusCode return nil, e } ul := UserLookups{} if err := ul.lookups(json.NewDecoder(bytes.NewReader(body))); err != nil { return nil, fmt.Errorf("user lookup response lookup decode: %w", err) } type extra struct { Meta *UserFollowMeta `json:"meta"` Errors []ErrorObj `json:"errors"` } ufm := &extra{} if err := json.Unmarshal(body, ufm); err != nil { return nil, fmt.Errorf("user lookup response meta decode: %w", err) } return &UserFollowLookup{ Lookups: ul, Meta: ufm.Meta, Errors: ufm.Errors, }, nil } // LookupFollowers will return a users followers func (u *User) LookupFollowers(ctx context.Context, id string, followOpts UserFollowOptions) (*UserFollowLookup, error) { switch { case len(id) == 0: return nil, fmt.Errorf("user id must be present for following lookup") case followOpts.MaxResults < 0 || followOpts.MaxResults > 1000: return nil, fmt.Errorf("user max results for following lookup must be between 1-1000: %d", followOpts.MaxResults) default: } ep := fmt.Sprintf("%s/%s", u.Host, userFollowersLookupEndpoint) ep = strings.Replace(ep, userID, id, -1) req, err := http.NewRequestWithContext(ctx, http.MethodGet, ep, nil) if err != nil { return nil, fmt.Errorf("user lookup following request: %w", err) } req.Header.Add("Accept", "application/json") u.Authorizer.Add(req) followOpts.addQuery(req) resp, err := u.Client.Do(req) if err != nil { return nil, fmt.Errorf("user lookup response: %w", err) } defer resp.Body.Close() body, err := io.ReadAll(resp.Body) if err != nil { return nil, fmt.Errorf("user lookup following reading body: %w", err) } if resp.StatusCode != http.StatusOK { e := &TweetErrorResponse{} if err := json.Unmarshal(body, e); err != nil { return nil, &HTTPError{ Status: resp.Status, StatusCode: resp.StatusCode, URL: resp.Request.URL.String(), } } e.StatusCode = resp.StatusCode return nil, e } ul := UserLookups{} if err := ul.lookups(json.NewDecoder(bytes.NewReader(body))); err != nil { return nil, fmt.Errorf("user lookup response lookup decode: %w", err) } type extra struct { Meta *UserFollowMeta `json:"meta"` Errors []ErrorObj `json:"errors"` } ufm := &extra{} if err := json.Unmarshal(body, ufm); err != nil { return nil, fmt.Errorf("user lookup response meta decode: %w", err) } return &UserFollowLookup{ Lookups: ul, Meta: ufm.Meta, Errors: ufm.Errors, }, nil } // Tweets is the user timeline tweets func (u *User) Tweets(ctx context.Context, id string, tweetOpts UserTimelineOpts) (*UserTimeline, error) { switch { case len(id) == 0: return nil, fmt.Errorf("user id must be present for timeline tweets") case tweetOpts.MaxResults < 0 || tweetOpts.MaxResults > 100: return nil, fmt.Errorf("user max results for timeline tweets must be between 1-1000: %d", tweetOpts.MaxResults) default: } ep := fmt.Sprintf("%s/%s", u.Host, userTimelineTweetsEndpoint) ep = strings.Replace(ep, userID, id, -1) req, err := http.NewRequestWithContext(ctx, http.MethodGet, ep, nil) if err != nil { return nil, fmt.Errorf("user lookup following request: %w", err) } req.Header.Add("Accept", "application/json") u.Authorizer.Add(req) tweetOpts.addQuery(req) resp, err := u.Client.Do(req) if err != nil { return nil, fmt.Errorf("user lookup response: %w", err) } defer resp.Body.Close() body, err := io.ReadAll(resp.Body) if err != nil { return nil, fmt.Errorf("user lookup following reading body: %w", err) } if resp.StatusCode != http.StatusOK { e := &TweetErrorResponse{} if err := json.Unmarshal(body, e); err != nil { return nil, &HTTPError{ Status: resp.Status, StatusCode: resp.StatusCode, URL: resp.Request.URL.String(), } } e.StatusCode = resp.StatusCode return nil, e } result := &UserTimeline{} if err := json.Unmarshal(body, result); err != nil { return nil, fmt.Errorf("user tweet timeline response decode: %w", err) } listTweet := []TweetObj{} for _, item := range result.Tweets { if item.NoteTweet.Text != "" { item.Text = item.NoteTweet.Text } listTweet = append(listTweet, item) } result.Tweets = listTweet return result, nil } // Mentions will return back the user tweets mentions timeline func (u *User) Mentions(ctx context.Context, id string, tweetOpts UserTimelineOpts) (*UserTimeline, error) { switch { case len(id) == 0: return nil, fmt.Errorf("user id must be present for timeline tweets") case tweetOpts.MaxResults < 0 || tweetOpts.MaxResults > 100: return nil, fmt.Errorf("user max results for timeline tweets must be between 1-1000: %d", tweetOpts.MaxResults) default: } ep := fmt.Sprintf("%s/%s", u.Host, userTimelineMentionsEndpoint) ep = strings.Replace(ep, userID, id, -1) req, err := http.NewRequestWithContext(ctx, http.MethodGet, ep, nil) if err != nil { return nil, fmt.Errorf("user lookup following request: %w", err) } req.Header.Add("Accept", "application/json") u.Authorizer.Add(req) tweetOpts.addQuery(req) resp, err := u.Client.Do(req) if err != nil { return nil, fmt.Errorf("user lookup response: %w", err) } defer resp.Body.Close() body, err := io.ReadAll(resp.Body) if err != nil { return nil, fmt.Errorf("user lookup following reading body: %w", err) } if resp.StatusCode != http.StatusOK { e := &TweetErrorResponse{} if err := json.Unmarshal(body, e); err != nil { return nil, &HTTPError{ Status: resp.Status, StatusCode: resp.StatusCode, URL: resp.Request.URL.String(), } } e.StatusCode = resp.StatusCode return nil, e } result := &UserTimeline{} if err := json.Unmarshal(body, result); err != nil { return nil, fmt.Errorf("user tweet timeline response decode: %w", err) } listTweet := []TweetObj{} for _, item := range result.Tweets { if item.NoteTweet.Text != "" { item.Text = item.NoteTweet.Text } listTweet = append(listTweet, item) } result.Tweets = listTweet return result, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/twitter/user_obj.go ================================================ package twitter // UserField defines the twitter user account metadata fields type UserField string const ( // UserFieldCreatedAt is the UTC datetime that the user account was created on Twitter. UserFieldCreatedAt UserField = "created_at" // UserFieldDescription is the text of this user's profile description (also known as bio), if the user provided one. UserFieldDescription UserField = "description" // UserFieldEntities contains details about text that has a special meaning in the user's description. UserFieldEntities UserField = "entities" // UserFieldID is the unique identifier of this user. UserFieldID UserField = "id" // UserFieldLocation is the location specified in the user's profile, if the user provided one. UserFieldLocation UserField = "location" // UserFieldName is the name of the user, as they’ve defined it on their profile UserFieldName UserField = "name" // UserFieldPinnedTweetID is the unique identifier of this user's pinned Tweet. UserFieldPinnedTweetID UserField = "pinned_tweet_id" // UserFieldProfileImageURL is the URL to the profile image for this user, as shown on the user's profile. UserFieldProfileImageURL UserField = "profile_image_url" // UserFieldProtected indicates if this user has chosen to protect their Tweets (in other words, if this user's Tweets are private). UserFieldProtected UserField = "protected" // UserFieldPublicMetrics contains details about activity for this user. UserFieldPublicMetrics UserField = "public_metrics" // UserFieldURL is the URL specified in the user's profile, if present. UserFieldURL UserField = "url" // UserFieldUserName is the Twitter screen name, handle, or alias that this user identifies themselves with UserFieldUserName UserField = "username" // UserFieldVerified indicates if this user is a verified Twitter User. UserFieldVerified UserField = "verified" // UserFieldWithHeld contains withholding details UserFieldWithHeld UserField = "withheld" ) func userFieldStringArray(arr []UserField) []string { strs := make([]string, len(arr)) for i, field := range arr { strs[i] = string(field) } return strs } // UserObj contains Twitter user account metadata describing the referenced user type UserObj struct { ID string `json:"id"` Name string `json:"name"` UserName string `json:"username"` CreatedAt string `json:"created_at"` Description string `json:"description"` Entities EntitiesObj `json:"entities"` Location string `json:"location"` PinnedTweetID string `json:"pinned_tweet_id"` ProfileImageURL string `json:"profile_image_url"` Protected bool `json:"protected"` PublicMetrics UserMetricsObj `json:"public_metrics"` URL string `json:"url"` Verified bool `json:"verified"` WithHeld WithHeldObj `json:"withheld"` } // UserMetricsObj contains details about activity for this user type UserMetricsObj struct { Followers int `json:"followers_count"` Following int `json:"following_count"` Tweets int `json:"tweet_count"` Listed int `json:"listed_count"` } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/twitter/user_params.go ================================================ package twitter import ( "net/http" "strconv" "strings" "time" ) // UserFieldOptions are the tweet options for the response type UserFieldOptions struct { Expansions []Expansion TweetFields []TweetField UserFields []UserField } func (u UserFieldOptions) addQuery(req *http.Request) { q := req.URL.Query() if len(u.Expansions) > 0 { q.Add("expansions", strings.Join(expansionStringArray(u.Expansions), ",")) } if len(u.TweetFields) > 0 { q.Add("tweet.fields", strings.Join(tweetFieldStringArray(u.TweetFields), ",")) } if len(u.UserFields) > 0 { q.Add("user.fields", strings.Join(userFieldStringArray(u.UserFields), ",")) } if len(q) > 0 { req.URL.RawQuery = q.Encode() } } // UserFollowOptions are the options that can be passed for the following APIs type UserFollowOptions struct { Expansions []Expansion TweetFields []TweetField UserFields []UserField MaxResults int PaginationToken string } func (u UserFollowOptions) addQuery(req *http.Request) { q := req.URL.Query() if len(u.Expansions) > 0 { q.Add("expansions", strings.Join(expansionStringArray(u.Expansions), ",")) } if len(u.TweetFields) > 0 { q.Add("tweet.fields", strings.Join(tweetFieldStringArray(u.TweetFields), ",")) } if len(u.UserFields) > 0 { q.Add("user.fields", strings.Join(userFieldStringArray(u.UserFields), ",")) } if u.MaxResults > 0 { q.Add("max_results", strconv.Itoa(u.MaxResults)) } if len(u.PaginationToken) > 0 { q.Add("pagination_token", u.PaginationToken) } if len(q) > 0 { req.URL.RawQuery = q.Encode() } } // UserTimelineOpts are options in the user tweet timeline type UserTimelineOpts struct { Excludes []Exclude Expansions []Expansion MediaFields []MediaField PlaceFields []PlaceField PollFields []PollField TweetFields []TweetField UserFields []UserField SinceID string UntilID string PaginationToken string MaxResults int StartTime time.Time EndTime time.Time } func (u UserTimelineOpts) addQuery(req *http.Request) { q := req.URL.Query() if len(u.Excludes) > 0 { q.Add("exclude", strings.Join(excludetringArray(u.Excludes), ",")) } if len(u.TweetFields) > 0 { q.Add("tweet.fields", strings.Join(tweetFieldStringArray(u.TweetFields), ",")) } if len(u.UserFields) > 0 { q.Add("user.fields", strings.Join(userFieldStringArray(u.UserFields), ",")) } if len(u.MediaFields) > 0 { q.Add("media.fields", strings.Join(mediaFieldStringArray(u.MediaFields), ",")) } if len(u.PlaceFields) > 0 { q.Add("place.fields", strings.Join(placeFieldStringArray(u.PlaceFields), ",")) } if len(u.PollFields) > 0 { q.Add("poll.fields", strings.Join(pollFieldStringArray(u.PollFields), ",")) } if len(u.Expansions) > 0 { q.Add("expansions", strings.Join(expansionStringArray(u.Expansions), ",")) } if len(u.SinceID) > 0 { q.Add("since_id", u.SinceID) } if len(u.UntilID) > 0 { q.Add("until_id", u.UntilID) } if u.MaxResults > 0 { q.Add("max_results", strconv.Itoa(u.MaxResults)) } if len(u.PaginationToken) > 0 { q.Add("pagination_token", u.PaginationToken) } if !u.EndTime.IsZero() { q.Add("end_time", u.EndTime.Format(time.RFC3339)) } if !u.StartTime.IsZero() { q.Add("start_time", u.StartTime.Format(time.RFC3339)) } if len(q) > 0 { req.URL.RawQuery = q.Encode() } } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/twitter/wrap_api.go ================================================ package twitter import ( "context" "encoding/json" "fmt" "net/http" "net/url" "strings" ) type authorize struct { Token string } func (a authorize) Add(req *http.Request) { req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", a.Token)) } func NewTwitterWrapClient(accessToken string) *Client { return &Client{ user: &User{ Authorizer: authorize{ Token: accessToken, }, Client: http.DefaultClient, Host: "https://api.x.com", }, AppToken: accessToken, } } // get user info func (c *Client) GetTwitterByUserName(userName string) (*UserObj, error) { var apiResponse TwitterMeResp url := fmt.Sprintf("https://api.x.com/2/users/by/username/%s?user.fields=profile_image_url,public_metrics,verified,description,entities", userName) req, err := http.NewRequest("GET", url, nil) if err != nil { return nil, err } req.Header.Add("Authorization", "Bearer "+c.AppToken) client := &http.Client{} resp, err := client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() if resp.StatusCode != http.StatusOK { return nil, fmt.Errorf("failed to search tweets, status: %s", resp.Status) } if err := json.NewDecoder(resp.Body).Decode(&apiResponse); err != nil { return nil, err } return &apiResponse.UserObj, nil } func (c *Client) GetTwitterByID(userTwitterID string) (*UserObj, error) { var apiResponse TwitterMeResp url := fmt.Sprintf("https://api.x.com/2/users/%s?user.fields=public_metrics,verified,profile_image_url,created_at,verified_type", userTwitterID) req, err := http.NewRequest("GET", url, nil) if err != nil { return nil, err } req.Header.Add("Authorization", "Bearer "+c.AppToken) client := &http.Client{} resp, err := client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() if resp.StatusCode != http.StatusOK { return nil, fmt.Errorf("failed to search tweets, status: %s", resp.Status) } if err := json.NewDecoder(resp.Body).Decode(&apiResponse); err != nil { return nil, err } return &apiResponse.UserObj, nil } func (c *Client) GetListFollowing(userTwitterID, paginationToken, accessToken string) (*UserFollowLookup, error) { fieldOpts := UserFollowOptions{ TweetFields: []TweetField{ TweetFieldCreatedAt, // TweetFieldContextAnnotations, }, UserFields: []UserField{ UserFieldDescription, UserFieldPublicMetrics, UserFieldCreatedAt, UserFieldVerified, }, MaxResults: 100, PaginationToken: paginationToken, } c.user = &User{ Authorizer: authorize{ Token: accessToken, }, Client: http.DefaultClient, Host: "https://api.x.com", } userFollowLookup, err := c.user.LookupFollowing(context.Background(), userTwitterID, fieldOpts) if err != nil { return nil, err } return userFollowLookup, nil } func (c *Client) LookupUsername(accessToken string, usernames []string) (*UserLookups, error) { fieldOpts := UserFieldOptions{ UserFields: []UserField{ UserFieldDescription, UserFieldPublicMetrics, UserFieldCreatedAt, UserFieldVerified, UserFieldID, UserFieldName, UserFieldEntities, UserFieldUserName, UserFieldProfileImageURL, }, } c.user = &User{ Authorizer: authorize{ Token: accessToken, }, Client: http.DefaultClient, Host: "https://api.x.com", } userFollowLookup, err := c.user.LookupUsername(context.Background(), usernames, fieldOpts) if err != nil { return nil, err } return &userFollowLookup, nil } func (c *Client) GetListUserTweets(userTwitterID, paginationToken, accessToken string, maxResults int) (*UserTimeline, error) { c.user = &User{ Authorizer: authorize{ Token: accessToken, }, Client: http.DefaultClient, Host: "https://api.x.com", } tweetOpts := UserTimelineOpts{ TweetFields: []TweetField{ TweetFieldAttachments, TweetFieldAuthorID, TweetFieldConversationID, TweetFieldCreatedAt, TweetFieldEntities, TweetFieldID, TweetFieldInReplyToUserID, TweetFieldPublicMetrics, TweetFieldReferencedTweets, TweetFieldSource, TweetFieldText, TweetFieldNoteText, }, UserFields: []UserField{ UserFieldCreatedAt, UserFieldDescription, UserFieldEntities, UserFieldName, UserFieldUserName, }, Expansions: []Expansion{ ExpansionAuthorID, // ExpansionReferencedTweetsID, // ExpansionReferencedTweetsIDAuthorID, ExpansionAttachmentsMediaKeys, ExpansionInReplyToUserID, }, Excludes: []Exclude{ ExcludeReplies, ExcludeRetweets, }, MediaFields: []MediaField{ MediaFieldMediaKey, MediaFieldURL, MediaFieldType, }, MaxResults: maxResults, PaginationToken: paginationToken, } userTweets, err := c.user.Tweets(context.Background(), *&userTwitterID, tweetOpts) if err != nil { return nil, err } return userTweets, nil } func (c *Client) GetAllUserTweets(userTwitterID, paginationToken, accessToken string, maxResults int) (*UserTimeline, error) { c.user = &User{ Authorizer: authorize{ Token: accessToken, }, Client: http.DefaultClient, Host: "https://api.x.com", } tweetOpts := UserTimelineOpts{ TweetFields: []TweetField{ TweetFieldAttachments, TweetFieldAuthorID, TweetFieldConversationID, TweetFieldCreatedAt, TweetFieldEntities, TweetFieldID, TweetFieldInReplyToUserID, TweetFieldPublicMetrics, TweetFieldReferencedTweets, TweetFieldSource, TweetFieldText, TweetFieldNoteText, }, UserFields: []UserField{ UserFieldCreatedAt, UserFieldDescription, UserFieldEntities, UserFieldName, UserFieldUserName, }, Expansions: []Expansion{ ExpansionAuthorID, ExpansionAttachmentsMediaKeys, ExpansionInReplyToUserID, }, MediaFields: []MediaField{ MediaFieldMediaKey, MediaFieldURL, MediaFieldType, }, MaxResults: maxResults, PaginationToken: paginationToken, } userTweets, err := c.user.Tweets(context.Background(), *&userTwitterID, tweetOpts) if err != nil { return nil, err } return userTweets, nil } func (c *Client) LookupUserTweets(accessToken string, tweetIDs []string) (*TweetLookups, error) { c.user = &User{ Authorizer: authorize{ Token: accessToken, }, Client: http.DefaultClient, Host: "https://api.x.com", } fieldOpts := TweetFieldOptions{ Expansions: []Expansion{ ExpansionAuthorID, // ExpansionReferencedTweetsID, // ExpansionReferencedTweetsIDAuthorID, ExpansionAttachmentsMediaKeys, ExpansionInReplyToUserID, }, TweetFields: []TweetField{ TweetFieldAttachments, TweetFieldAuthorID, // TweetFieldContextAnnotations, TweetFieldConversationID, TweetFieldCreatedAt, TweetFieldEntities, TweetFieldID, TweetFieldInReplyToUserID, TweetFieldReferencedTweets, TweetFieldText, TweetFieldNoteText, }, MediaFields: []MediaField{ MediaFieldMediaKey, MediaFieldURL, MediaFieldType, }, } tweet := &Tweet{ Authorizer: authorize{ Token: accessToken, }, Client: http.DefaultClient, Host: "https://api.x.com", } lookups, err := tweet.Lookup(context.Background(), tweetIDs, fieldOpts) if err != nil { return nil, err } return &lookups, nil } func (c *Client) GetListUserMentions(userTwitterID, paginationToken, accessToken string, maxResults int) (*UserTimeline, error) { c.user = &User{ Authorizer: authorize{ Token: accessToken, }, Client: http.DefaultClient, Host: "https://api.x.com", } tweetOpts := UserTimelineOpts{ TweetFields: []TweetField{ TweetFieldAuthorID, TweetFieldConversationID, TweetFieldCreatedAt, TweetFieldID, TweetFieldInReplyToUserID, TweetFieldReferencedTweets, TweetFieldText, TweetFieldEntities, TweetFieldNoteText, }, UserFields: []UserField{ UserFieldCreatedAt, UserFieldDescription, UserFieldEntities, UserFieldName, UserFieldUserName, UserFieldVerified, }, Expansions: []Expansion{ ExpansionAuthorID, // ExpansionReferencedTweetsID, // ExpansionReferencedTweetsIDAuthorID, ExpansionAttachmentsMediaKeys, ExpansionInReplyToUserID, }, MediaFields: []MediaField{ MediaFieldMediaKey, MediaFieldURL, MediaFieldType, }, MaxResults: maxResults, } if paginationToken != "" { tweetOpts.PaginationToken = paginationToken } userTweets, err := c.user.Mentions(context.Background(), *&userTwitterID, tweetOpts) if err != nil { return nil, err } return userTweets, nil } func (c *Client) SearchRecentTweet(query, paginationToken, accessToken string, maxResult int) (*TweetRecentSearch, error) { tweet := &Tweet{ Authorizer: authorize{ Token: accessToken, }, Client: http.DefaultClient, Host: "https://api.x.com", } fieldOpts := TweetFieldOptions{ TweetFields: []TweetField{ TweetFieldAuthorID, TweetFieldConversationID, TweetFieldCreatedAt, TweetFieldID, TweetFieldInReplyToUserID, TweetFieldPublicMetrics, TweetFieldReferencedTweets, TweetFieldSource, TweetFieldText, TweetFieldNoteText, }, UserFields: []UserField{ UserFieldCreatedAt, UserFieldDescription, UserFieldEntities, UserFieldLocation, UserFieldName, UserFieldProfileImageURL, UserFieldURL, UserFieldUserName, UserFieldVerified, }, Expansions: []Expansion{ ExpansionAuthorID, ExpansionAttachmentsMediaKeys, ExpansionInReplyToUserID, ExpansionGeoPlaceID, }, MediaFields: []MediaField{ MediaFieldMediaKey, MediaFieldURL, MediaFieldType, }, } searchOpts := TweetRecentSearchOptions{ MaxResult: maxResult, NextToken: paginationToken, } recentSearch, err := tweet.RecentSearch(context.Background(), query, searchOpts, fieldOpts) if err != nil { return nil, err } return recentSearch, nil } func (c *Client) SearchRecentTweetV1(query, sinceID string, accessToken string, maxResult int) (*TweetRecentSearch, error) { tweet := &Tweet{ Authorizer: authorize{ Token: accessToken, }, Client: http.DefaultClient, Host: "https://api.x.com", } fieldOpts := TweetFieldOptions{ TweetFields: []TweetField{ TweetFieldAuthorID, TweetFieldConversationID, TweetFieldCreatedAt, TweetFieldID, TweetFieldInReplyToUserID, TweetFieldPublicMetrics, TweetFieldReferencedTweets, TweetFieldSource, TweetFieldText, TweetFieldNoteText, }, UserFields: []UserField{ UserFieldCreatedAt, UserFieldDescription, UserFieldEntities, UserFieldLocation, UserFieldName, UserFieldProfileImageURL, UserFieldURL, UserFieldUserName, UserFieldVerified, }, Expansions: []Expansion{ ExpansionAuthorID, ExpansionAttachmentsMediaKeys, ExpansionInReplyToUserID, ExpansionGeoPlaceID, }, MediaFields: []MediaField{ MediaFieldMediaKey, MediaFieldURL, MediaFieldType, }, } searchOpts := TweetRecentSearchOptions{ MaxResult: maxResult, SinceID: sinceID, } recentSearch, err := tweet.RecentSearch(context.Background(), query, searchOpts, fieldOpts) if err != nil { return nil, err } return recentSearch, nil } type UserSearchResp struct { UserObj []*UserObj `json:"data"` } func (c *Client) SearchUsers(query, paginationToken, accessToken string) ([]*UserObj, error) { var apiResponse UserSearchResp params := url.Values{} params.Add("query", query) params.Add("user.fields", "id,username,name,public_metrics,verified,profile_image_url,created_at") if paginationToken != "" { params.Add("next_token", paginationToken) } url := fmt.Sprintf("https://api.x.com/2/users/search?%s", params.Encode()) req, err := http.NewRequest("GET", url, nil) if err != nil { return nil, err } req.Header.Add("Authorization", "Bearer "+accessToken) client := &http.Client{} resp, err := client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() if resp.StatusCode != http.StatusOK { decoder := json.NewDecoder(resp.Body) e := &TweetErrorResponse{} if err := decoder.Decode(e); err != nil { return nil, &HTTPError{ Status: resp.Status, StatusCode: resp.StatusCode, URL: resp.Request.URL.String(), } } e.StatusCode = resp.StatusCode return nil, e } if err := json.NewDecoder(resp.Body).Decode(&apiResponse); err != nil { return nil, err } return apiResponse.UserObj, nil } type TrendsResp struct { TrendName string `json:"trend_name"` TweetCount uint `json:"tweet_count"` } func (c *Client) LookupTweetsByID(accessToken string, tweetID string) (*TweetObj, error) { resp := TweetObj{} mapResp, err := c.LookupUserTweets(accessToken, []string{tweetID}) if err != nil { return nil, err } for k, v := range *mapResp { if strings.EqualFold(k, tweetID) { resp = v.Tweet } } return &resp, err } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/zkapi/client.go ================================================ package zkapi import ( "bytes" "context" "crypto/ecdsa" "encoding/hex" "encoding/json" "errors" "fmt" "io" "math/big" "net/http" "strconv" "strings" "sync" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/helpers" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/evmapi" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/trxapi" "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/crypto" "github.com/zksync-sdk/zksync2-go/accounts" "github.com/zksync-sdk/zksync2-go/clients" zktypes "github.com/zksync-sdk/zksync2-go/types" "github.com/zksync-sdk/zksync2-go/utils" ) type BlockResp struct { time uint64 hash string } func (b *BlockResp) Time() uint64 { return b.time } func (b *BlockResp) Hash() string { return b.hash } type Client struct { evmapi.BaseClient BaseURL string BlockMap map[uint64]*BlockResp BlockMapMtx sync.Mutex chainID uint64 MinGasPrice string PaymasterFeeZero bool PaymasterAddress string PaymasterToken string } func (c *Client) getZkClient() (clients.Client, error) { zkClient, err := clients.Dial(c.BaseURL) if err != nil { return nil, err } return zkClient, nil } func (c *Client) ChainID() uint64 { return c.chainID } func (c *Client) Address() (string, string, error) { key, err := crypto.GenerateKey() if err != nil { return "", "", err } addr := crypto.PubkeyToAddress(key.PublicKey).Hex() prk := hex.EncodeToString(key.D.Bytes()) if len(prk) != 64 { return "", "", errors.New("bad private key len") } return addr, prk, nil } func (c *Client) BlockByNumber(blockNumber int64) (*zktypes.Block, error) { client, err := c.getZkClient() if err != nil { return nil, err } defer client.Close() block, err := client.BlockByNumber(context.Background(), big.NewInt(blockNumber)) if err != nil { return nil, err } return block, nil } func (c *Client) GetLastBlockNumber() (int64, error) { client, err := c.getZkClient() if err != nil { return 0, err } defer client.Close() lastBlock, err := client.HeaderByNumber(context.Background(), nil) if err != nil { return 0, err } lastNumber := lastBlock.Number.Int64() return lastNumber, nil } func (c *Client) getBlockTime(n uint64) (uint64, error) { var ts uint64 chainId, err := c.GetChainID() if err != nil { return ts, err } switch chainId { // nos regtest case 42070: { ts = 1686907878 + (n-1)*2 } // nos mainnet case 42213: { ts = 1687812293 + (n-1)*2 } case 8453: { ts = 1686789347 + n*2 } // nos mainnet case 84531: { ts = 1688240016 + n*2 } default: { block, err := c.getBlock(n) if err != nil { return ts, err } ts = block.Time() } } return ts, nil } func (c *Client) getBlock(n uint64) (*BlockResp, error) { if c.BlockMap == nil { c.BlockMap = map[uint64]*BlockResp{} } c.BlockMapMtx.Lock() blockResp, ok := c.BlockMap[n] c.BlockMapMtx.Unlock() if !ok { var blockInfoResp struct { Result *struct { Timestamp string `json:"timestamp"` Hash string `json:"hash"` } `json:"result"` } err := c.postJSON( c.BaseURL, map[string]string{}, map[string]interface{}{ "jsonrpc": "2.0", "id": 1, "method": "eth_getBlockByNumber", "params": []interface{}{ fmt.Sprintf("0x%s", big.NewInt(int64(n)).Text(16)), false, }, }, &blockInfoResp, ) if err != nil { return nil, err } var timeBN *big.Int if strings.HasPrefix(blockInfoResp.Result.Timestamp, "0x") { timeBN, ok = big.NewInt(0).SetString(blockInfoResp.Result.Timestamp[2:], 16) if !ok { return nil, errors.New("wrong time") } } else { timeBN, ok = big.NewInt(0).SetString(blockInfoResp.Result.Timestamp, 10) if !ok { return nil, errors.New("wrong time") } } c.BlockMapMtx.Lock() // c.BlockMap[n] = &BlockResp{ time: timeBN.Uint64(), hash: blockInfoResp.Result.Hash, } blockResp = c.BlockMap[n] // for i := n - 2000; i < n-1000; i++ { _, ok := c.BlockMap[i] if ok { delete(c.BlockMap, i) } } c.BlockMapMtx.Unlock() } return blockResp, nil } func (c *Client) doWithAuth(req *http.Request) (*http.Response, error) { client := &http.Client{} return client.Do(req) } func (c *Client) postJSON(apiURL string, headers map[string]string, jsonObject interface{}, result interface{}) error { bodyBytes, _ := json.Marshal(jsonObject) req, err := http.NewRequest(http.MethodPost, apiURL, bytes.NewBuffer(bodyBytes)) if err != nil { return err } req.Header.Add("Content-Type", "application/json") for k, v := range headers { req.Header.Add(k, v) } resp, err := c.doWithAuth(req) if err != nil { return fmt.Errorf("failed request: %v", err) } bodyBytes, err = io.ReadAll(resp.Body) if err != nil { return fmt.Errorf("http response bad status %d %s", resp.StatusCode, err.Error()) } if resp.StatusCode >= 300 { return fmt.Errorf("http response bad status %d %s", resp.StatusCode, string(bodyBytes)) } if result != nil { return json.Unmarshal(bodyBytes, result) } return nil } func (c *Client) WaitMined(hash string) error { client, err := c.getZkClient() if err != nil { return err } defer client.Close() r, err := client.WaitMined(context.Background(), common.HexToHash(hash)) if err != nil { return err } if r.Status != types.ReceiptStatusSuccessful { return errors.New("transaction is not Successful") } return nil } func (c *Client) parsePrkAuth(prkHex string) (common.Address, *ecdsa.PrivateKey, error) { prk, err := crypto.HexToECDSA(prkHex) if err != nil { return common.Address{}, nil, err } pbk, ok := prk.Public().(*ecdsa.PublicKey) if !ok { return common.Address{}, nil, errors.New("error casting public key to ECDSA") } pbkHex := crypto.PubkeyToAddress(*pbk) return pbkHex, prk, nil } func (c *Client) GetChainID() (uint64, error) { if c.chainID > 0 { return c.chainID, nil } client, err := c.getZkClient() if err != nil { return 0, err } defer client.Close() chainID, err := client.ChainID(context.Background()) if err != nil { return 0, err } c.chainID = chainID.Uint64() return c.chainID, nil } func (c *Client) getGasPrice() (*big.Int, error) { client, err := c.getZkClient() if err != nil { return nil, err } defer client.Close() chainID, err := c.GetChainID() if err != nil { return nil, err } var gasPrice *big.Int switch chainID { case 22215, 22213: { gasPrice = big.NewInt(10000000000) // 10 gwei } case 42070, 42069, 42213: { gasPrice = big.NewInt(2000000000) // 2 gwei } case 42225: { gasPrice = big.NewInt(100000) // 0.0001 gwei } case 43337: { gasPrice = big.NewInt(100000) // 1 gwei } case 45454: { gasPrice = big.NewInt(358000000000000) // 358000 gwei } default: { if c.MinGasPrice != "" { minGasPriceNum, err := strconv.ParseInt(c.MinGasPrice, 10, 0) if err == nil { gasPrice = big.NewInt(minGasPriceNum) } } if gasPrice.Cmp(big.NewInt(0)) <= 0 { gasPrice, err = client.SuggestGasPrice(context.Background()) if err != nil { return nil, err } switch chainID { case 42161: { gasPrice = gasPrice.Mul(gasPrice, big.NewInt(10)) } default: { gasPrice = gasPrice.Mul(gasPrice, big.NewInt(12)) } } gasPrice = gasPrice.Div(gasPrice, big.NewInt(10)) } } } return gasPrice, nil } func (c *Client) getGasTipCap() (*big.Int, error) { client, err := c.getZkClient() if err != nil { return nil, err } defer client.Close() chainID, err := c.GetChainID() if err != nil { return nil, err } var gasPrice *big.Int switch chainID { case 22215, 22213: { gasPrice = big.NewInt(10000000000) // 10 gwei } case 42070, 42069, 42213: { gasPrice = big.NewInt(2000000000) // 2 gwei } case 42225: { gasPrice = big.NewInt(100000) // 0.0001 gwei } case 43337: { gasPrice = big.NewInt(100000) // 1 gwei } case 43338: { gasPrice = big.NewInt(1100000000) // 1 gwei } case 45454: { gasPrice = big.NewInt(358000000000000) // 358000 gwei } default: { gasPrice, err = client.SuggestGasTipCap(context.Background()) if err != nil { return nil, err } gasPrice = gasPrice.Mul(gasPrice, big.NewInt(12)) gasPrice = gasPrice.Div(gasPrice, big.NewInt(10)) } } return gasPrice, nil } func (c *Client) GetCachedGasPriceAndTipCap() (*big.Int, *big.Int, error) { cachedGasPrice, err := c.getGasPrice() if err != nil { return nil, nil, err } cachedGasTipCap, err := c.getGasTipCap() if err != nil { return nil, nil, err } return cachedGasPrice, cachedGasTipCap, nil } func (c *Client) PopulateTransaction(ctx context.Context, address common.Address, tx accounts.Transaction) (*zktypes.Transaction712, error) { client, err := c.getZkClient() if err != nil { return nil, err } defer client.Close() nonce, err := client.PendingNonceAt(context.Background(), address) if err != nil { return nil, err } gasPrice, err := c.getGasPrice() if err != nil { return nil, err } chainID, err := c.GetChainID() if err != nil { return nil, err } if tx.ChainID == nil { tx.ChainID = big.NewInt(int64(chainID)) } tx.Nonce = new(big.Int).SetUint64(nonce) tx.GasFeeCap = gasPrice if tx.GasTipCap == nil { tx.GasTipCap = big.NewInt(0) } if tx.Meta == nil { tx.Meta = &zktypes.Eip712Meta{GasPerPubdata: utils.NewBig(utils.DefaultGasPerPubdataLimit.Int64())} } else if tx.Meta.GasPerPubdata == nil { tx.Meta.GasPerPubdata = utils.NewBig(utils.DefaultGasPerPubdataLimit.Int64()) } if tx.Gas == 0 { gas, err := client.EstimateGasL2(context.Background(), tx.ToCallMsg(address)) if err != nil { return nil, fmt.Errorf("failed to EstimateGasL2: %w", err) } tx.Gas = gas } if tx.Data == nil { tx.Data = hexutil.Bytes{} } if tx.Meta.PaymasterParams != nil { paymasterParams, err := c.GetPaymasterParamsWithFee(big.NewInt(0).Mul(tx.GasFeeCap, big.NewInt(int64(tx.Gas)))) if err != nil { panic(err) } tx.Meta.PaymasterParams = paymasterParams } return tx.ToTransaction712(address), nil } func (c *Client) SignTransaction(signer accounts.Signer, tx *zktypes.Transaction712) ([]byte, error) { var gas uint64 = 0 if tx.Gas != nil { gas = tx.Gas.Uint64() } preparedTx, err := c.PopulateTransaction( context.Background(), signer.Address(), accounts.Transaction{ To: tx.To, Data: tx.Data, Value: tx.Value, Nonce: tx.Nonce, GasTipCap: tx.GasTipCap, GasFeeCap: tx.GasFeeCap, Gas: gas, AccessList: tx.AccessList, ChainID: tx.ChainID, Meta: tx.Meta, }, ) if err != nil { return nil, err } signature, err := signer.SignTypedData(signer.Domain(), preparedTx) if err != nil { return nil, err } return preparedTx.RLPValues(signature) } func (c *Client) ValidateMessageSignature(msg string, signatureHex string, signer string) error { msg = fmt.Sprintf("\x19Ethereum Signed Message:\n%d%s", len(msg), msg) msgBytes := []byte(msg) msgHash := crypto.Keccak256Hash( msgBytes, ) signature, err := hexutil.Decode(signatureHex) if err != nil { return err } if signature[crypto.RecoveryIDOffset] > 1 { signature[crypto.RecoveryIDOffset] -= 27 } sigPublicKey, err := crypto.SigToPub(msgHash.Bytes(), signature) if err != nil { return err } pbkHex := crypto.PubkeyToAddress(*sigPublicKey) if !strings.EqualFold(pbkHex.Hex(), signer) { return errors.New("not valid signer") } return nil } func (c *Client) DeployContract(prkHex string, dataBin string, contructorHex string) (string, string, error) { client, err := c.getZkClient() if err != nil { return "", "", err } defer client.Close() tx := accounts.CreateTransaction{ Bytecode: common.FromHex(dataBin), Calldata: common.FromHex(contructorHex), } preparedTx, err := tx.ToTransaction(accounts.DeployContract, nil) if err != nil { return "", "", err } chainID, err := c.GetChainID() if err != nil { return "", "", err } prkBytes, err := hex.DecodeString(prkHex) if err != nil { return "", "", err } baseSigner, err := accounts.NewBaseSignerFromRawPrivateKey(prkBytes, int64(chainID)) if err != nil { return "", "", err } signer := accounts.Signer(baseSigner) rawTx, err := c.SignTransaction(signer, preparedTx.ToTransaction712(signer.Address())) if err != nil { return "", "", err } hash, err := client.SendRawTransaction(context.Background(), rawTx) if err != nil { return "", "", err } receipt, err := client.WaitMined(context.Background(), hash) if err != nil { return "", "", err } return hash.Hex(), receipt.ContractAddress.Hex(), nil } func (c *Client) GetPaymasterParams() (*zktypes.PaymasterParams, error) { if c.PaymasterAddress == "" || c.PaymasterToken == "" { return nil, nil } fee := big.NewInt(1000000000000) if c.PaymasterFeeZero { fee = big.NewInt(0) } paymasterParams, err := utils.GetPaymasterParams( helpers.HexToAddress(c.PaymasterAddress), &zktypes.ApprovalBasedPaymasterInput{ Token: helpers.HexToAddress(c.PaymasterToken), MinimalAllowance: fee, InnerInput: []byte{}, }) if err != nil { return nil, err } return paymasterParams, nil } func (c *Client) GetPaymasterParamsWithFee(fee *big.Int) (*zktypes.PaymasterParams, error) { if c.PaymasterAddress == "" || c.PaymasterToken == "" { return nil, nil } if c.PaymasterFeeZero { fee = big.NewInt(0) } paymasterParams, err := utils.GetPaymasterParams( helpers.HexToAddress(c.PaymasterAddress), &zktypes.ApprovalBasedPaymasterInput{ Token: helpers.HexToAddress(c.PaymasterToken), MinimalAllowance: fee, InnerInput: []byte{}, }) if err != nil { return nil, err } return paymasterParams, nil } func (c *Client) SetPaymasterParams(tx *accounts.Transaction) error { paymasterParams, err := c.GetPaymasterParams() if err != nil { return err } tx.Meta.PaymasterParams = paymasterParams return nil } func (c *Client) PaymasterParams() *zktypes.PaymasterParams { paymasterParams, err := c.GetPaymasterParams() if err != nil { panic(err) } return paymasterParams } func (c *Client) validateAddress(address string) { if !(strings.EqualFold(address, helpers.HexToAddress(address).Hex())) { panic("wrong address") } } func (c *Client) TransactionConfirmed(hash string) error { err := c.WaitMined(hash) if err != nil { return errs.NewError(err) } return err } func (c *Client) Transfer(prkHex string, toAddr string, amount string, includeFee bool, wait bool) (string, error) { c.validateAddress(toAddr) if toAddr == "" || !common.IsHexAddress(toAddr) { return "", errors.New("toAddr is invalid") } value, ok := big.NewInt(0).SetString(amount, 10) if !ok { return "", errors.New("amount is invalid") } pbkHex, _, err := c.parsePrkAuth(prkHex) if err != nil { return "", err } client, err := c.getZkClient() if err != nil { return "", err } gasPrice, err := c.getGasPrice() if err != nil { return "", err } chainID, err := client.NetworkID(context.Background()) if err != nil { return "", err } toAddress := helpers.HexToAddress(toAddr) gasNumber, err := client.EstimateGasL2( context.Background(), zktypes.CallMsg{ CallMsg: ethereum.CallMsg{ From: pbkHex, To: &toAddress, Data: []byte{}, Value: value, }, Meta: nil, }, ) if err != nil { return "", err } preparedTx, err := c.PopulateTransaction( context.Background(), pbkHex, accounts.Transaction{ GasFeeCap: gasPrice, GasTipCap: gasPrice, Gas: gasNumber, To: &toAddress, Value: value, Data: []byte{}, Meta: nil, }, ) if err != nil { return "", err } prkBytes, err := hex.DecodeString(prkHex) if err != nil { return "", err } baseSigner, err := accounts.NewBaseSignerFromRawPrivateKey(prkBytes, chainID.Int64()) if err != nil { return "", err } signer := accounts.Signer(baseSigner) rawTx, err := c.SignTransaction(signer, preparedTx) if err != nil { return "", err } hash, err := client.SendRawTransaction(context.Background(), rawTx) if err != nil { return "", err } if wait { c.WaitMined(hash.Hex()) } return hash.Hex(), nil } func (c *Client) InscribeTxs(txHashs []string) (string, error) { return "", nil } func (c *Client) Transact(contractAddr string, prkHex string, dataBytes []byte, value *big.Int) (string, error) { if value == nil { value = common.Big0 } pbkHex, _, err := c.parsePrkAuth(prkHex) if err != nil { return "", err } client, err := c.getZkClient() if err != nil { return "", err } gasPrice, err := c.getGasPrice() if err != nil { return "", err } chainID, err := client.NetworkID(context.Background()) if err != nil { return "", err } contractAddress := helpers.HexToAddress(contractAddr) gasNumber, err := client.EstimateGasL2( context.Background(), zktypes.CallMsg{ CallMsg: ethereum.CallMsg{ From: pbkHex, To: &contractAddress, Data: []byte{}, Value: value, }, Meta: nil, }, ) if err != nil { return "", err } preparedTx, err := c.PopulateTransaction( context.Background(), pbkHex, accounts.Transaction{ GasFeeCap: gasPrice, GasTipCap: gasPrice, Gas: gasNumber, To: &contractAddress, Data: []byte{}, Meta: nil, Value: value, }, ) if err != nil { return "", err } prkBytes, err := hex.DecodeString(prkHex) if err != nil { return "", err } baseSigner, err := accounts.NewBaseSignerFromRawPrivateKey(prkBytes, chainID.Int64()) if err != nil { return "", err } signer := accounts.Signer(baseSigner) rawTx, err := c.SignTransaction(signer, preparedTx) if err != nil { return "", err } hash, err := client.SendRawTransaction(context.Background(), rawTx) if err != nil { return "", err } return hash.Hex(), nil } func (c *Client) ConvertAddressForIn(addr string) string { chainID, err := c.GetChainID() if err != nil { panic(err) } if chainID == 728126428 { return trxapi.AddrTronToEvm(addr) } return addr } func (c *Client) ConvertAddressForOut(addr string) string { chainID, err := c.GetChainID() if err != nil { panic(err) } if chainID == 728126428 { return trxapi.AddrEvmToTron(addr) } return addr } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/zkapi/erc1155.go ================================================ package zkapi import ( "context" "encoding/hex" "errors" "math/big" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/helpers" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/binds/erc1155" "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/common" "github.com/zksync-sdk/zksync2-go/accounts" zktypes "github.com/zksync-sdk/zksync2-go/types" "github.com/zksync-sdk/zksync2-go/utils" ) func (c *Client) Erc1155SetApprovalForAll(erc1155Addr string, prkHex string, toAddr string, wait bool) (string, error) { if erc1155Addr == "" || !common.IsHexAddress(erc1155Addr) { return "", errors.New("erc1155Addr is invalid") } if toAddr == "" || !common.IsHexAddress(toAddr) { return "", errors.New("toAddr is invalid") } pbkHex, _, err := c.parsePrkAuth(prkHex) if err != nil { return "", err } gasPrice, err := c.getGasPrice() if err != nil { return "", err } client, err := c.getZkClient() if err != nil { return "", err } contractAddress := helpers.HexToAddress(erc1155Addr) // EstimateGas instanceABI, err := erc1155.ERC1155MetaData.GetAbi() if err != nil { return "", err } dataBytes, err := instanceABI.Pack( "setApprovalForAll", helpers.HexToAddress(toAddr), true, ) if err != nil { return "", err } gasNumber, err := client.EstimateGasL2( context.Background(), zktypes.CallMsg{ CallMsg: ethereum.CallMsg{ From: pbkHex, To: &contractAddress, Data: dataBytes, }, Meta: &zktypes.Eip712Meta{ GasPerPubdata: utils.NewBig(utils.DefaultGasPerPubdataLimit.Int64()), PaymasterParams: c.PaymasterParams(), }, }, ) if err != nil { return "", err } preparedTx, err := c.PopulateTransaction( context.Background(), pbkHex, accounts.Transaction{ GasFeeCap: gasPrice, GasTipCap: gasPrice, Gas: gasNumber, To: &contractAddress, Value: big.NewInt(0), Data: dataBytes, Meta: &zktypes.Eip712Meta{ GasPerPubdata: utils.NewBig(utils.DefaultGasPerPubdataLimit.Int64()), PaymasterParams: c.PaymasterParams(), }, }, ) if err != nil { return "", err } chainID, err := c.GetChainID() if err != nil { return "", err } prkBytes, err := hex.DecodeString(prkHex) if err != nil { return "", err } baseSigner, err := accounts.NewBaseSignerFromRawPrivateKey(prkBytes, int64(chainID)) if err != nil { return "", err } signer := accounts.Signer(baseSigner) rawTx, err := c.SignTransaction(signer, preparedTx) if err != nil { return "", err } hash, err := client.SendRawTransaction(context.Background(), rawTx) if err != nil { return "", err } if wait { _, err = client.WaitMined(context.Background(), hash) if err != nil { return "", err } } return hash.Hex(), nil } func (c *Client) Erc1155Transfer(erc20Addr string, prkHex string, toAddr string, tokenId string, amount *big.Int) (string, error) { if erc20Addr == "" || !common.IsHexAddress(erc20Addr) { return "", errors.New("erc20Addr is invalid") } if toAddr == "" || !common.IsHexAddress(toAddr) { return "", errors.New("toAddr is invalid") } tokenIdVal, ok := big.NewInt(0).SetString(tokenId, 10) if !ok { return "", errors.New("tokenId is invalid") } pbkHex, _, err := c.parsePrkAuth(prkHex) if err != nil { return "", err } gasPrice, err := c.getGasPrice() if err != nil { return "", err } client, err := c.getZkClient() if err != nil { return "", err } contractAddress := helpers.HexToAddress(erc20Addr) // EstimateGas instanceABI, err := erc1155.ERC1155MetaData.GetAbi() if err != nil { return "", err } dataBytes, err := instanceABI.Pack( "safeTransferFrom", pbkHex, helpers.HexToAddress(toAddr), tokenIdVal, amount, []byte{}, ) if err != nil { return "", err } gasNumber, err := client.EstimateGasL2( context.Background(), zktypes.CallMsg{ CallMsg: ethereum.CallMsg{ From: pbkHex, To: &contractAddress, Data: dataBytes, }, Meta: &zktypes.Eip712Meta{ GasPerPubdata: utils.NewBig(utils.DefaultGasPerPubdataLimit.Int64()), PaymasterParams: c.PaymasterParams(), }, }, ) if err != nil { return "", err } preparedTx, err := c.PopulateTransaction( context.Background(), pbkHex, accounts.Transaction{ GasFeeCap: gasPrice, GasTipCap: gasPrice, Gas: gasNumber, To: &contractAddress, Value: big.NewInt(0), Data: dataBytes, Meta: &zktypes.Eip712Meta{ GasPerPubdata: utils.NewBig(utils.DefaultGasPerPubdataLimit.Int64()), PaymasterParams: c.PaymasterParams(), }, }, ) if err != nil { return "", err } chainID, err := c.GetChainID() if err != nil { return "", err } prkBytes, err := hex.DecodeString(prkHex) if err != nil { return "", err } baseSigner, err := accounts.NewBaseSignerFromRawPrivateKey(prkBytes, int64(chainID)) if err != nil { return "", err } signer := accounts.Signer(baseSigner) rawTx, err := c.SignTransaction(signer, preparedTx) if err != nil { return "", err } hash, err := client.SendRawTransaction(context.Background(), rawTx) if err != nil { return "", err } // _, err = client.WaitMined(context.Background(), hash) // if err != nil { // return "", err // } return hash.Hex(), nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/zkapi/erc20.go ================================================ package zkapi import ( "context" "encoding/hex" "errors" "math/big" "strings" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/helpers" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/binds/erc20" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/binds/erc721" "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/zksync-sdk/zksync2-go/accounts" zktypes "github.com/zksync-sdk/zksync2-go/types" "github.com/zksync-sdk/zksync2-go/utils" ) func (c *Client) Erc20Symbol(erc20Addr string) (string, error) { if !common.IsHexAddress(erc20Addr) { return "", errors.New("erc20Addr is invalid") } client, err := c.getZkClient() if err != nil { return "", err } instance, err := erc20.NewErc20(helpers.HexToAddress(erc20Addr), client) if err != nil { return "", err } symbol, err := instance.Symbol(&bind.CallOpts{}) if err != nil { return "", err } return symbol, nil } type Erc20InfoResp struct { Symbol string `json:"symbol"` Name string `json:"name"` TotalSuply *big.Int `json:"total_suply"` Decimals int `json:"decimals"` } func (c *Client) Erc20Info(erc20Addr string) (*Erc20InfoResp, error) { if !common.IsHexAddress(erc20Addr) { return nil, errors.New("erc20Addr is invalid") } client, err := c.getZkClient() if err != nil { return nil, err } instance, err := erc20.NewErc20(helpers.HexToAddress(erc20Addr), client) if err != nil { return nil, err } name, err := instance.Name(&bind.CallOpts{}) if err != nil { return nil, err } symbol, err := instance.Symbol(&bind.CallOpts{}) if err != nil { return nil, err } totalSupply, err := instance.TotalSupply(&bind.CallOpts{}) if err != nil { return nil, err } decimals, err := instance.Decimals(&bind.CallOpts{}) if err != nil { return nil, err } return &Erc20InfoResp{ Symbol: symbol, Name: name, TotalSuply: totalSupply, Decimals: int(decimals), }, nil } func (c *Client) Erc20Balance(erc20Addr string, addr string) (*big.Int, error) { if !common.IsHexAddress(erc20Addr) { return nil, errors.New("erc20Addr is invalid") } if !common.IsHexAddress(addr) { return nil, errors.New("addr is invalid") } client, err := c.getZkClient() if err != nil { return nil, err } instance, err := erc20.NewErc20(helpers.HexToAddress(erc20Addr), client) if err != nil { return nil, err } balance, err := instance.BalanceOf(&bind.CallOpts{}, helpers.HexToAddress(addr)) if err != nil { return nil, err } return balance, nil } func (c *Client) NftOwnerOf(nftAddr string, tokenID string) (string, error) { client, err := c.getZkClient() if err != nil { return "", err } nftContract, err := erc721.NewErc721(helpers.HexToAddress(nftAddr), client) if err != nil { return "", err } tokenIDInt, ok := big.NewInt(0).SetString(tokenID, 10) if !ok { return "", errors.New("bad token id") } res, err := nftContract.OwnerOf(&bind.CallOpts{}, tokenIDInt) if err != nil { return "", err } return res.Hex(), nil } func (c *Client) Balance(addr string) (*big.Int, error) { if !common.IsHexAddress(addr) { return nil, errors.New("addr is invalid") } client, err := c.getZkClient() if err != nil { return nil, err } balance, err := client.BalanceAt(context.Background(), helpers.HexToAddress(addr), nil) if err != nil { return nil, err } return balance, nil } func (c *Client) Erc20Allowance(erc20Addr string, addr string, spender string) (*big.Int, error) { if !common.IsHexAddress(erc20Addr) { return nil, errors.New("erc20Addr is invalid") } if !common.IsHexAddress(addr) { return nil, errors.New("addr is invalid") } if !common.IsHexAddress(spender) { return nil, errors.New("spender is invalid") } client, err := c.getZkClient() if err != nil { return nil, err } instance, err := erc20.NewErc20(helpers.HexToAddress(erc20Addr), client) if err != nil { return nil, err } balance, err := instance.Allowance(&bind.CallOpts{}, helpers.HexToAddress(addr), helpers.HexToAddress(spender)) if err != nil { return nil, err } return balance, nil } func (c *Client) Erc20ApproveMax(erc20Addr string, prkHex string, toAddr string, wait bool) (string, error) { if erc20Addr == "" || !common.IsHexAddress(erc20Addr) { return "", errors.New("erc20Addr is invalid") } if toAddr == "" || !common.IsHexAddress(toAddr) { return "", errors.New("toAddr is invalid") } pbkHex, _, err := c.parsePrkAuth(prkHex) if err != nil { return "", err } gasPrice, err := c.getGasPrice() if err != nil { return "", err } client, err := c.getZkClient() if err != nil { return "", err } contractAddress := helpers.HexToAddress(erc20Addr) // EstimateGas instanceABI, err := abi.JSON(strings.NewReader(erc20.Erc20ABI)) if err != nil { return "", err } amount, _ := new(big.Int).SetString("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", 16) dataBytes, err := instanceABI.Pack( "approve", helpers.HexToAddress(toAddr), amount, ) if err != nil { return "", err } gasNumber, err := client.EstimateGasL2( context.Background(), zktypes.CallMsg{ CallMsg: ethereum.CallMsg{ From: pbkHex, To: &contractAddress, Data: dataBytes, }, Meta: &zktypes.Eip712Meta{ GasPerPubdata: utils.NewBig(utils.DefaultGasPerPubdataLimit.Int64()), PaymasterParams: c.PaymasterParams(), }, }, ) if err != nil { return "", err } preparedTx, err := c.PopulateTransaction( context.Background(), pbkHex, accounts.Transaction{ GasFeeCap: gasPrice, GasTipCap: gasPrice, Gas: gasNumber, To: &contractAddress, Value: big.NewInt(0), Data: dataBytes, Meta: &zktypes.Eip712Meta{ GasPerPubdata: utils.NewBig(utils.DefaultGasPerPubdataLimit.Int64()), PaymasterParams: c.PaymasterParams(), }, }, ) if err != nil { return "", err } chainID, err := c.GetChainID() if err != nil { return "", err } prkBytes, err := hex.DecodeString(prkHex) if err != nil { return "", err } baseSigner, err := accounts.NewBaseSignerFromRawPrivateKey(prkBytes, int64(chainID)) if err != nil { return "", err } signer := accounts.Signer(baseSigner) rawTx, err := c.SignTransaction(signer, preparedTx) if err != nil { return "", err } hash, err := client.SendRawTransaction(context.Background(), rawTx) if err != nil { return "", err } if wait { _, err = client.WaitMined(context.Background(), hash) if err != nil { return "", err } } return hash.Hex(), nil } func (c *Client) Erc20Transfer(erc20Addr string, prkHex string, toAddr string, amount *big.Int) (string, error) { if erc20Addr == "" || !common.IsHexAddress(erc20Addr) { return "", errors.New("erc20Addr is invalid") } if toAddr == "" || !common.IsHexAddress(toAddr) { return "", errors.New("toAddr is invalid") } pbkHex, _, err := c.parsePrkAuth(prkHex) if err != nil { return "", err } gasPrice, err := c.getGasPrice() if err != nil { return "", err } client, err := c.getZkClient() if err != nil { return "", err } contractAddress := helpers.HexToAddress(erc20Addr) // EstimateGas instanceABI, err := abi.JSON(strings.NewReader(erc20.Erc20ABI)) if err != nil { return "", err } dataBytes, err := instanceABI.Pack( "transfer", helpers.HexToAddress(toAddr), amount, ) if err != nil { return "", err } gasNumber, err := client.EstimateGasL2( context.Background(), zktypes.CallMsg{ CallMsg: ethereum.CallMsg{ From: pbkHex, To: &contractAddress, Data: dataBytes, }, Meta: &zktypes.Eip712Meta{ GasPerPubdata: utils.NewBig(utils.DefaultGasPerPubdataLimit.Int64()), PaymasterParams: c.PaymasterParams(), }, }, ) if err != nil { return "", err } preparedTx, err := c.PopulateTransaction( context.Background(), pbkHex, accounts.Transaction{ GasFeeCap: gasPrice, GasTipCap: gasPrice, Gas: gasNumber, To: &contractAddress, Value: big.NewInt(0), Data: dataBytes, Meta: &zktypes.Eip712Meta{ GasPerPubdata: utils.NewBig(utils.DefaultGasPerPubdataLimit.Int64()), PaymasterParams: c.PaymasterParams(), }, }, ) if err != nil { return "", err } chainID, err := c.GetChainID() if err != nil { return "", err } prkBytes, err := hex.DecodeString(prkHex) if err != nil { return "", err } baseSigner, err := accounts.NewBaseSignerFromRawPrivateKey(prkBytes, int64(chainID)) if err != nil { return "", err } signer := accounts.Signer(baseSigner) rawTx, err := c.SignTransaction(signer, preparedTx) if err != nil { return "", err } hash, err := client.SendRawTransaction(context.Background(), rawTx) if err != nil { return "", err } // _, err = client.WaitMined(context.Background(), hash) // if err != nil { // return "", err // } return hash.Hex(), nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/zkapi/erc721.go ================================================ package zkapi import ( "context" "encoding/hex" "errors" "math/big" "strings" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/helpers" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/binds/erc721" "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/common" "github.com/zksync-sdk/zksync2-go/accounts" zktypes "github.com/zksync-sdk/zksync2-go/types" "github.com/zksync-sdk/zksync2-go/utils" ) func (c *Client) Erc721Transfer(contractAddr string, prkHex string, toAddr string, tokenId *big.Int) (string, error) { if contractAddr == "" || !common.IsHexAddress(contractAddr) { return "", errors.New("erc20Addr is invalid") } if toAddr == "" || !common.IsHexAddress(toAddr) { return "", errors.New("toAddr is invalid") } pbkHex, _, err := c.parsePrkAuth(prkHex) if err != nil { return "", err } gasPrice, _, err := c.GetCachedGasPriceAndTipCap() if err != nil { return "", err } client, err := c.getZkClient() if err != nil { return "", err } contractAddress := helpers.HexToAddress(contractAddr) instanceABI, err := abi.JSON(strings.NewReader(erc721.Erc721ABI)) if err != nil { return "", err } dataBytes, err := instanceABI.Pack( "safeTransferFrom", pbkHex, helpers.HexToAddress(toAddr), tokenId, ) if err != nil { return "", err } gasNumber, err := client.EstimateGasL2( context.Background(), zktypes.CallMsg{ CallMsg: ethereum.CallMsg{ From: pbkHex, To: &contractAddress, Data: dataBytes, }, Meta: &zktypes.Eip712Meta{ GasPerPubdata: utils.NewBig(utils.DefaultGasPerPubdataLimit.Int64()), PaymasterParams: c.PaymasterParams(), }, }, ) if err != nil { return "", err } preparedTx, err := c.PopulateTransaction( context.Background(), pbkHex, accounts.Transaction{ GasFeeCap: gasPrice, GasTipCap: gasPrice, Gas: gasNumber, To: &contractAddress, Value: big.NewInt(0), Data: dataBytes, Meta: &zktypes.Eip712Meta{ GasPerPubdata: utils.NewBig(utils.DefaultGasPerPubdataLimit.Int64()), PaymasterParams: c.PaymasterParams(), }, }, ) if err != nil { return "", err } chainID, err := c.GetChainID() if err != nil { return "", err } prkBytes, err := hex.DecodeString(prkHex) if err != nil { return "", err } baseSigner, err := accounts.NewBaseSignerFromRawPrivateKey(prkBytes, int64(chainID)) if err != nil { return "", err } signer := accounts.Signer(baseSigner) rawTx, err := c.SignTransaction(signer, preparedTx) if err != nil { return "", err } hash, err := client.SendRawTransaction(context.Background(), rawTx) if err != nil { return "", err } return hash.Hex(), nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/zkapi/hybridmodel.go ================================================ package zkapi import ( "context" "encoding/hex" "errors" "math/big" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/helpers" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/binds/ihybridmodel" "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/common" "github.com/zksync-sdk/zksync2-go/accounts" zktypes "github.com/zksync-sdk/zksync2-go/types" "github.com/zksync-sdk/zksync2-go/utils" ) func (c *Client) HybridModelInfer(contractAddress string, prkHex string, inferData string) (string, error) { if contractAddress == "" || !common.IsHexAddress(contractAddress) { return "", errors.New("contractAddress is invalid") } pbkHex, _, err := c.parsePrkAuth(prkHex) if err != nil { return "", err } gasPrice, err := c.getGasPrice() if err != nil { return "", err } client, err := c.getZkClient() if err != nil { return "", err } contractAddr := helpers.HexToAddress(contractAddress) // EstimateGas instanceABI, err := ihybridmodel.IHybridModelMetaData.GetAbi() if err != nil { return "", err } dataBytes, err := instanceABI.Pack( "infer", []byte(inferData), ) if err != nil { return "", err } gasNumber, err := client.EstimateGasL2( context.Background(), zktypes.CallMsg{ CallMsg: ethereum.CallMsg{ From: pbkHex, To: &contractAddr, Data: dataBytes, }, Meta: &zktypes.Eip712Meta{ GasPerPubdata: utils.NewBig(utils.DefaultGasPerPubdataLimit.Int64()), PaymasterParams: c.PaymasterParams(), }, }, ) if err != nil { return "", err } preparedTx, err := c.PopulateTransaction( context.Background(), pbkHex, accounts.Transaction{ GasFeeCap: gasPrice, GasTipCap: gasPrice, Gas: gasNumber, To: &contractAddr, Value: big.NewInt(0), Data: dataBytes, Meta: &zktypes.Eip712Meta{ GasPerPubdata: utils.NewBig(utils.DefaultGasPerPubdataLimit.Int64()), PaymasterParams: c.PaymasterParams(), }, }, ) if err != nil { return "", err } chainID, err := c.GetChainID() if err != nil { return "", err } prkBytes, err := hex.DecodeString(prkHex) if err != nil { return "", err } baseSigner, err := accounts.NewBaseSignerFromRawPrivateKey(prkBytes, int64(chainID)) if err != nil { return "", err } signer := accounts.Signer(baseSigner) rawTx, err := c.SignTransaction(signer, preparedTx) if err != nil { return "", err } hash, err := client.SendRawTransaction(context.Background(), rawTx) if err != nil { return "", err } // _, err = client.WaitMined(context.Background(), hash) // if err != nil { // return "", err // } return hash.Hex(), nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/zkapi/image_hub.go ================================================ package zkapi import ( "context" "encoding/hex" "errors" "math/big" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/helpers" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/binds/imagehub" "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/common" "github.com/zksync-sdk/zksync2-go/accounts" zktypes "github.com/zksync-sdk/zksync2-go/types" "github.com/zksync-sdk/zksync2-go/utils" ) func (c *Client) ImageHubChargeSubscription(contractAddress string, prkHex string, userAddress string, creatorAddress string) (string, error) { if contractAddress == "" || !common.IsHexAddress(contractAddress) { return "", errors.New("contractAddress is invalid") } if userAddress == "" || !common.IsHexAddress(userAddress) { return "", errors.New("userAddress is invalid") } if creatorAddress == "" || !common.IsHexAddress(creatorAddress) { return "", errors.New("userAcreatorAddressddress is invalid") } pbkHex, _, err := c.parsePrkAuth(prkHex) if err != nil { return "", err } gasPrice, err := c.getGasPrice() if err != nil { return "", err } client, err := c.getZkClient() if err != nil { return "", err } contractAddr := helpers.HexToAddress(contractAddress) // EstimateGas instanceABI, err := imagehub.ImageHubMetaData.GetAbi() if err != nil { return "", err } dataBytes, err := instanceABI.Pack( "chargeSubscription", helpers.HexToAddress(userAddress), helpers.HexToAddress(creatorAddress), ) if err != nil { return "", err } gasNumber, err := client.EstimateGasL2( context.Background(), zktypes.CallMsg{ CallMsg: ethereum.CallMsg{ From: pbkHex, To: &contractAddr, Data: dataBytes, }, Meta: &zktypes.Eip712Meta{ GasPerPubdata: utils.NewBig(utils.DefaultGasPerPubdataLimit.Int64()), PaymasterParams: c.PaymasterParams(), }, }, ) if err != nil { return "", err } preparedTx, err := c.PopulateTransaction( context.Background(), pbkHex, accounts.Transaction{ GasFeeCap: gasPrice, GasTipCap: gasPrice, Gas: gasNumber, To: &contractAddr, Value: big.NewInt(0), Data: dataBytes, Meta: &zktypes.Eip712Meta{ GasPerPubdata: utils.NewBig(utils.DefaultGasPerPubdataLimit.Int64()), PaymasterParams: c.PaymasterParams(), }, }, ) if err != nil { return "", err } chainID, err := c.GetChainID() if err != nil { return "", err } prkBytes, err := hex.DecodeString(prkHex) if err != nil { return "", err } baseSigner, err := accounts.NewBaseSignerFromRawPrivateKey(prkBytes, int64(chainID)) if err != nil { return "", err } signer := accounts.Signer(baseSigner) rawTx, err := c.SignTransaction(signer, preparedTx) if err != nil { return "", err } hash, err := client.SendRawTransaction(context.Background(), rawTx) if err != nil { return "", err } // _, err = client.WaitMined(context.Background(), hash) // if err != nil { // return "", err // } return hash.Hex(), nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/zkapi/systempromptmanager.go ================================================ package zkapi import ( "context" "encoding/hex" "errors" "math/big" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/helpers" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/binds/isystempromptmanager" "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/common" "github.com/zksync-sdk/zksync2-go/accounts" zktypes "github.com/zksync-sdk/zksync2-go/types" "github.com/zksync-sdk/zksync2-go/utils" ) func (c *Client) SystemPromptManagerInfer(contractAddress string, prkHex string, agentId int64, inferData string, externalData string) (string, error) { if contractAddress == "" || !common.IsHexAddress(contractAddress) { return "", errors.New("contractAddress is invalid") } pbkHex, _, err := c.parsePrkAuth(prkHex) if err != nil { return "", err } gasPrice, err := c.getGasPrice() if err != nil { return "", err } client, err := c.getZkClient() if err != nil { return "", err } contractAddr := helpers.HexToAddress(contractAddress) // EstimateGas instanceABI, err := isystempromptmanager.SystemPromptManagerMetaData.GetAbi() if err != nil { return "", err } dataBytes, err := instanceABI.Pack( "infer", big.NewInt(agentId), []byte(inferData), externalData, ) if err != nil { return "", err } gasNumber, err := client.EstimateGasL2( context.Background(), zktypes.CallMsg{ CallMsg: ethereum.CallMsg{ From: pbkHex, To: &contractAddr, Data: dataBytes, }, Meta: &zktypes.Eip712Meta{ GasPerPubdata: utils.NewBig(utils.DefaultGasPerPubdataLimit.Int64()), PaymasterParams: c.PaymasterParams(), }, }, ) if err != nil { return "", err } preparedTx, err := c.PopulateTransaction( context.Background(), pbkHex, accounts.Transaction{ GasFeeCap: gasPrice, GasTipCap: gasPrice, Gas: gasNumber, To: &contractAddr, Value: big.NewInt(0), Data: dataBytes, Meta: &zktypes.Eip712Meta{ GasPerPubdata: utils.NewBig(utils.DefaultGasPerPubdataLimit.Int64()), PaymasterParams: c.PaymasterParams(), }, }, ) if err != nil { return "", err } chainID, err := c.GetChainID() if err != nil { return "", err } prkBytes, err := hex.DecodeString(prkHex) if err != nil { return "", err } baseSigner, err := accounts.NewBaseSignerFromRawPrivateKey(prkBytes, int64(chainID)) if err != nil { return "", err } signer := accounts.Signer(baseSigner) rawTx, err := c.SignTransaction(signer, preparedTx) if err != nil { return "", err } hash, err := client.SendRawTransaction(context.Background(), rawTx) if err != nil { return "", err } // _, err = client.WaitMined(context.Background(), hash) // if err != nil { // return "", err // } return hash.Hex(), nil } func (c *Client) SystemPromptManagerMint(contractAddress string, prkHex string, to common.Address, uri string, data []byte, fee *big.Int) (string, error) { pbkHex, _, err := c.parsePrkAuth(prkHex) if err != nil { return "", err } gasPrice, err := c.getGasPrice() if err != nil { return "", err } client, err := c.getZkClient() if err != nil { return "", err } contractAddr := helpers.HexToAddress(contractAddress) // EstimateGas instanceABI, err := isystempromptmanager.SystemPromptManagerMetaData.GetAbi() if err != nil { return "", err } dataBytes, err := instanceABI.Pack( "mint", to, uri, data, fee, ) if err != nil { return "", err } gasNumber, err := client.EstimateGasL2( context.Background(), zktypes.CallMsg{ CallMsg: ethereum.CallMsg{ From: pbkHex, To: &contractAddr, Data: dataBytes, }, Meta: &zktypes.Eip712Meta{ GasPerPubdata: utils.NewBig(utils.DefaultGasPerPubdataLimit.Int64()), PaymasterParams: c.PaymasterParams(), }, }, ) if err != nil { return "", err } preparedTx, err := c.PopulateTransaction( context.Background(), pbkHex, accounts.Transaction{ GasFeeCap: gasPrice, GasTipCap: gasPrice, Gas: gasNumber, To: &contractAddr, Value: big.NewInt(0), Data: dataBytes, Meta: &zktypes.Eip712Meta{ GasPerPubdata: utils.NewBig(utils.DefaultGasPerPubdataLimit.Int64()), PaymasterParams: c.PaymasterParams(), }, }, ) if err != nil { return "", err } chainID, err := c.GetChainID() if err != nil { return "", err } prkBytes, err := hex.DecodeString(prkHex) if err != nil { return "", err } baseSigner, err := accounts.NewBaseSignerFromRawPrivateKey(prkBytes, int64(chainID)) if err != nil { return "", err } signer := accounts.Signer(baseSigner) rawTx, err := c.SignTransaction(signer, preparedTx) if err != nil { return "", err } hash, err := client.SendRawTransaction(context.Background(), rawTx) if err != nil { return "", err } // _, err = client.WaitMined(context.Background(), hash) // if err != nil { // return "", err // } return hash.Hex(), nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/zkapi/transparentupgradeableproxy.go ================================================ package zkapi import ( "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/binds/transparentupgradeableproxyzk" "github.com/ethereum/go-ethereum/common" ) func (c *Client) DeployTransparentUpgradeableProxy(prkHex string, logic common.Address, admin common.Address, data []byte) (string, string, error) { instanceABI, err := transparentupgradeableproxyzk.TransparentUpgradeableProxyMetaData.GetAbi() if err != nil { return "", "", err } dataBytes, err := instanceABI.Pack( "", logic, admin, data, ) if err != nil { return "", "", err } address, txHash, err := c.DeployContract(prkHex, transparentupgradeableproxyzk.TransparentUpgradeableProxyBin, common.Bytes2Hex(dataBytes)) if err != nil { return "", "", err } return address, txHash, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/zkapi/zksync_swapv3.go ================================================ package zkapi import ( "context" "encoding/hex" "math/big" "strings" "time" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/helpers" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/binds/zksyncnonfungiblepositionmanager" "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/common" "github.com/zksync-sdk/zksync2-go/accounts" zktypes "github.com/zksync-sdk/zksync2-go/types" "github.com/zksync-sdk/zksync2-go/utils" ) func (c *Client) ZksyncNonfungiblePositionManagerMint(contractAddr string, privateHex string, weth9 common.Address, sqrtPriceX96 *big.Int, params *zksyncnonfungiblepositionmanager.INonfungiblePositionManagerMintParams) (string, error) { addressHex, _, err := c.parsePrkAuth(privateHex) if err != nil { return "", err } gasPrice, err := c.getGasPrice() if err != nil { return "", err } client, err := c.getZkClient() if err != nil { return "", err } value := big.NewInt(0) if !strings.EqualFold(weth9.Hex(), params.Token0.Hex()) { if params.Amount0Desired.Cmp(big.NewInt(0)) > 0 { allowance, err := c.Erc20Allowance(params.Token0.Hex(), addressHex.Hex(), contractAddr) if err != nil { return "", err } if allowance.Cmp(big.NewInt(0)) <= 0 { approveHash, err := c.Erc20ApproveMax( params.Token0.Hex(), privateHex, contractAddr, false, ) if err != nil { return "", err } time.Sleep(10 * time.Second) err = c.WaitMined(approveHash) if err != nil { return "", err } } } } else { value = params.Amount0Desired } if !strings.EqualFold(weth9.Hex(), params.Token1.Hex()) { if params.Amount1Desired.Cmp(big.NewInt(0)) > 0 { allowance, err := c.Erc20Allowance(params.Token1.Hex(), addressHex.Hex(), contractAddr) if err != nil { return "", err } if allowance.Cmp(big.NewInt(0)) <= 0 { approveHash, err := c.Erc20ApproveMax( params.Token1.Hex(), privateHex, contractAddr, false, ) if err != nil { return "", err } time.Sleep(10 * time.Second) err = c.WaitMined(approveHash) if err != nil { return "", err } } } } else { value = params.Amount1Desired } contractAddress := helpers.HexToAddress(contractAddr) // EstimateGas instanceABI, err := abi.JSON(strings.NewReader(zksyncnonfungiblepositionmanager.NonfungiblePositionManagerABI)) if err != nil { return "", err } multicallBytes := [][]byte{} { multicallData, err := instanceABI.Pack( "createAndInitializePoolIfNecessary", params.Token0, params.Token1, params.Fee, sqrtPriceX96, ) if err != nil { return "", err } multicallBytes = append( multicallBytes, multicallData, ) } { multicallData, err := instanceABI.Pack( "mint", zksyncnonfungiblepositionmanager.INonfungiblePositionManagerMintParams{ Token0: params.Token0, Token1: params.Token1, Fee: params.Fee, TickLower: params.TickLower, TickUpper: params.TickUpper, Amount0Desired: params.Amount0Desired, Amount1Desired: params.Amount1Desired, Amount0Min: params.Amount0Min, Amount1Min: params.Amount1Min, Recipient: addressHex, Deadline: params.Deadline, }, ) if err != nil { return "", err } multicallBytes = append( multicallBytes, multicallData, ) } if strings.EqualFold(weth9.Hex(), params.Token0.Hex()) || strings.EqualFold(weth9.Hex(), params.Token1.Hex()) { multicallData, err := instanceABI.Pack( "refundETH", ) if err != nil { return "", err } multicallBytes = append( multicallBytes, multicallData, ) } dataBytes, err := instanceABI.Pack( "multicall", multicallBytes, ) if err != nil { return "", err } gasNumber, err := client.EstimateGasL2( context.Background(), zktypes.CallMsg{ CallMsg: ethereum.CallMsg{ From: addressHex, To: &contractAddress, Data: dataBytes, Value: value, }, Meta: &zktypes.Eip712Meta{ GasPerPubdata: utils.NewBig(utils.DefaultGasPerPubdataLimit.Int64()), PaymasterParams: c.PaymasterParams(), }, }, ) if err != nil { return "", err } preparedTx, err := c.PopulateTransaction( context.Background(), addressHex, accounts.Transaction{ GasFeeCap: gasPrice, GasTipCap: gasPrice, Gas: gasNumber, To: &contractAddress, Value: value, Data: dataBytes, Meta: &zktypes.Eip712Meta{ GasPerPubdata: utils.NewBig(utils.DefaultGasPerPubdataLimit.Int64()), PaymasterParams: c.PaymasterParams(), }, }, ) if err != nil { return "", err } chainID, err := c.GetChainID() if err != nil { return "", err } prkBytes, err := hex.DecodeString(privateHex) if err != nil { return "", err } baseSigner, err := accounts.NewBaseSignerFromRawPrivateKey(prkBytes, int64(chainID)) if err != nil { return "", err } signer := accounts.Signer(baseSigner) rawTx, err := c.SignTransaction(signer, preparedTx) if err != nil { return "", err } hash, err := client.SendRawTransaction(context.Background(), rawTx) if err != nil { return "", err } return hash.Hex(), nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/3rd/zkclient/client.go ================================================ package zkclient import ( "bytes" "context" "encoding/hex" "encoding/json" "errors" "fmt" "io" "math/big" "net/http" "sync" "time" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/configs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/logger" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/eth" "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/core/types" "go.uber.org/zap" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/ethclient" "github.com/zksync-sdk/zksync2-go/accounts" "github.com/zksync-sdk/zksync2-go/clients" zktypes "github.com/zksync-sdk/zksync2-go/types" "github.com/zksync-sdk/zksync2-go/utils" ) type Client struct { BaseURL string chainID uint64 PaymasterFeeZero bool PaymasterAddress string PaymasterToken string } var maxGasTipCap = big.NewInt(20000) var maxGasFeeCap = big.NewInt(20000) var ethClientMap map[string]*ethclient.Client // key by url var zkClientMap map[string]*clients.Client // key by url var zkClientLock = &sync.Mutex{} var sendTransactionLock = &sync.Mutex{} func init() { zkClientMap = make(map[string]*clients.Client) ethClientMap = make(map[string]*ethclient.Client) } func NewZkClient(rpc string, paymentFeeZero bool, paymentMasterAddress string, paymentMasterToken string) *Client { aiZkClient := &Client{ BaseURL: rpc, PaymasterFeeZero: paymentFeeZero, PaymasterAddress: paymentMasterAddress, PaymasterToken: paymentMasterToken, } if zkClientMap[rpc] == nil { zkClientLock.Lock() defer zkClientLock.Unlock() if zkClientMap[rpc] == nil { zkClient, err := aiZkClient.makeZkClient(rpc) if err == nil { zkClientMap[rpc] = &zkClient } ethClient, err := aiZkClient.makeETHClient(rpc) if err == nil { ethClientMap[rpc] = ethClient } } } return aiZkClient } func (c *Client) makeZkClient(url string) (clients.Client, error) { zkClient, err := clients.Dial(url) if err != nil { return nil, err } return zkClient, nil } func (c *Client) makeETHClient(url string) (*ethclient.Client, error) { ethClient, err := ethclient.Dial(url) if err != nil { return nil, err } return ethClient, nil } func (c *Client) GetZkClient() (clients.Client, error) { if zkClientMap[c.BaseURL] == nil { zkClientLock.Lock() defer zkClientLock.Unlock() if zkClientMap[c.BaseURL] != nil { return *zkClientMap[c.BaseURL], nil } zkClient, err := c.makeZkClient(c.BaseURL) if err != nil { return nil, err } zkClientMap[c.BaseURL] = &zkClient return *zkClientMap[c.BaseURL], nil } return *zkClientMap[c.BaseURL], nil } func (c *Client) GetETHClient() (*ethclient.Client, error) { if ethClientMap[c.BaseURL] == nil { zkClientLock.Lock() defer zkClientLock.Unlock() if ethClientMap[c.BaseURL] != nil { return ethClientMap[c.BaseURL], nil } ethClient, err := c.makeETHClient(c.BaseURL) if err != nil { return nil, err } ethClientMap[c.BaseURL] = ethClient return ethClientMap[c.BaseURL], nil } return ethClientMap[c.BaseURL], nil } func (c *Client) GetChainID() (uint64, error) { if c.chainID > 0 { return c.chainID, nil } client, err := c.GetZkClient() if err != nil { return 0, err } chainID, err := client.ChainID(context.Background()) if err != nil { return 0, err } c.chainID = chainID.Uint64() return c.chainID, nil } func (c *Client) GetGasPrice() (*big.Int, error) { client, err := c.GetZkClient() if err != nil { return nil, err } gasPrice, err := client.SuggestGasPrice(context.Background()) if err != nil { return nil, err } return gasPrice, nil } func (c *Client) PopulateTransaction(ctx context.Context, address common.Address, tx accounts.Transaction) (*zktypes.Transaction712, error) { client, err := c.GetZkClient() if err != nil { return nil, err } nonce, err := client.PendingNonceAt(context.Background(), address) if err != nil { return nil, err } gasPrice, err := c.GetGasPrice() if err != nil { return nil, err } chainID, err := c.GetChainID() if err != nil { return nil, err } if tx.ChainID == nil { tx.ChainID = big.NewInt(int64(chainID)) } tx.Nonce = new(big.Int).SetUint64(nonce) tx.GasFeeCap = gasPrice if tx.GasTipCap == nil { tx.GasTipCap = big.NewInt(0) } if tx.Meta == nil { tx.Meta = &zktypes.Eip712Meta{GasPerPubdata: utils.NewBig(utils.DefaultGasPerPubdataLimit.Int64())} } else if tx.Meta.GasPerPubdata == nil { tx.Meta.GasPerPubdata = utils.NewBig(utils.DefaultGasPerPubdataLimit.Int64()) } if tx.Gas == 0 { gas, err := client.EstimateGasL2(context.Background(), tx.ToCallMsg(address)) if err != nil { return nil, fmt.Errorf("failed to EstimateGasL2: %w", err) } tx.Gas = gas } if tx.Data == nil { tx.Data = hexutil.Bytes{} } if tx.Meta.PaymasterParams != nil { paymasterParams, err := c.GetPaymasterParamsWithFee(big.NewInt(0).Mul(tx.GasFeeCap, big.NewInt(int64(tx.Gas)))) if err != nil { panic(err) } tx.Meta.PaymasterParams = paymasterParams } return tx.ToTransaction712(address), nil } func (c *Client) SignTransaction(signer accounts.Signer, tx *zktypes.Transaction712) ([]byte, error) { var gas uint64 = 0 if tx.Gas != nil { gas = tx.Gas.Uint64() } preparedTx, err := c.PopulateTransaction( context.Background(), signer.Address(), accounts.Transaction{ To: tx.To, Data: tx.Data, Value: tx.Value, Nonce: tx.Nonce, GasTipCap: tx.GasTipCap, GasFeeCap: tx.GasFeeCap, Gas: gas, AccessList: tx.AccessList, ChainID: tx.ChainID, Meta: tx.Meta, }, ) if err != nil { return nil, err } signature, err := signer.SignTypedData(signer.Domain(), preparedTx) if err != nil { return nil, err } return preparedTx.RLPValues(signature) } func (c *Client) GetPaymasterParams() (*zktypes.PaymasterParams, error) { if c.PaymasterAddress == "" || c.PaymasterToken == "" { return nil, nil } fee := big.NewInt(1000000000000) if c.PaymasterFeeZero { fee = big.NewInt(0) } paymasterParams, err := utils.GetPaymasterParams( common.HexToAddress(c.PaymasterAddress), &zktypes.ApprovalBasedPaymasterInput{ Token: common.HexToAddress(c.PaymasterToken), MinimalAllowance: fee, InnerInput: []byte{}, }) if err != nil { return nil, err } return paymasterParams, nil } func (c *Client) GetPaymasterParamsWithFee(fee *big.Int) (*zktypes.PaymasterParams, error) { if c.PaymasterAddress == "" || c.PaymasterToken == "" { return nil, nil } if c.PaymasterFeeZero { fee = big.NewInt(0) } paymasterParams, err := utils.GetPaymasterParams( common.HexToAddress(c.PaymasterAddress), &zktypes.ApprovalBasedPaymasterInput{ Token: common.HexToAddress(c.PaymasterToken), MinimalAllowance: fee, InnerInput: []byte{}, }) if err != nil { return nil, err } return paymasterParams, nil } func (c *Client) SetPaymasterParams(tx *accounts.Transaction) error { paymasterParams, err := c.GetPaymasterParams() if err != nil { return err } tx.Meta.PaymasterParams = paymasterParams return nil } func (c *Client) PaymasterParams() *zktypes.PaymasterParams { paymasterParams, err := c.GetPaymasterParams() if err != nil { panic(err) } return paymasterParams } func (c *Client) Transact(prkHex string, from common.Address, to common.Address, value *big.Int, input []byte) (*zktypes.Receipt, error) { var err error maxRetry := 5 chainId, err := c.GetChainID() if err != nil { return nil, err } if chainId == configs.SubtensorEVMChainIDInt { maxRetry = 1 } for i := 0; i < maxRetry; i++ { paymaster, err1 := c.GetPaymasterParams() if err1 != nil { return nil, err1 } chainId, _ := c.GetChainID() if paymaster != nil || chainId == configs.ZkSyncChainIDInt { transact, err1 := c.createZKTransact(from, to, value, input) if err1 != nil { time.Sleep(1 * time.Second) err = err1 continue } // get nonce again tx, err1 := c.signAndSendTx(prkHex, from, transact) if err1 != nil { err = err1 logger.Info("retry signAndSendTx ", "", zap.Any("from", from), zap.Any("to", to), zap.Any("i", i), zap.Any("rpc", c.BaseURL)) continue } if tx.Receipt.Status == types.ReceiptStatusFailed { return tx, fmt.Errorf("transact failed with status %d", tx.Receipt.Status) } return tx, nil } else { txReceipt, err1 := c.ExecuteETHTransact(prkHex, from, to, value, input) if err1 != nil { time.Sleep(1 * time.Second) err = err1 logger.Info("retry signAndSendTx ", "", zap.Any("from", from), zap.Any("to", to), zap.Any("i", i), zap.Any("rpc", c.BaseURL), zap.Any("err", err)) continue } zkReceipt := zktypes.Receipt{ Receipt: *txReceipt, } if txReceipt.Status == types.ReceiptStatusFailed { return &zkReceipt, fmt.Errorf("transact failed with status %d", txReceipt.Status) } return &zkReceipt, nil } } return nil, fmt.Errorf("failed to transact from :%v ,to: %v after 5 retries at rpc :%v , err:%v", from, to, c.BaseURL, err) } func (c *Client) createZKTransact(from common.Address, to common.Address, value *big.Int, input []byte) (*accounts.Transaction, error) { client, err := c.GetZkClient() if err != nil { return nil, err } gasNumber, err := client.EstimateGasL2( context.Background(), zktypes.CallMsg{ CallMsg: ethereum.CallMsg{ From: from, To: &to, Value: value, Data: input, }, Meta: &zktypes.Eip712Meta{ GasPerPubdata: utils.NewBig(utils.DefaultGasPerPubdataLimit.Int64()), PaymasterParams: c.PaymasterParams(), }, }, ) gasPrice, err := c.GetGasPrice() if err != nil { return nil, err } return &accounts.Transaction{ GasFeeCap: gasPrice, GasTipCap: gasPrice, Gas: gasNumber, To: &to, Value: value, Data: input, Meta: &zktypes.Eip712Meta{ GasPerPubdata: utils.NewBig(utils.DefaultGasPerPubdataLimit.Int64()), PaymasterParams: c.PaymasterParams(), }, }, err } /* Copy from the function `(c *BoundContract) createDynamicTx` in the `eth` package. */ func (c *Client) SendETHTransact(client *ethclient.Client, prkHex string, from common.Address, to common.Address, value *big.Int, input []byte) (common.Hash, error) { fromAcc, _, err := eth.GetAccountInfo(prkHex) if err != nil { return common.Hash{}, errors.Join(err, errors.New("error while getting account info")) } chainID, err := client.NetworkID(context.Background()) if err != nil { return common.Hash{}, fmt.Errorf("NetworkID :%v", err.Error()) } tx, err := eth.CreateEthTransaction(client, from, to, value, input) if err != nil { return common.Hash{}, fmt.Errorf("CreateEthTransaction :%v", err.Error()) } signedTx, err := types.SignTx(tx, types.LatestSignerForChainID(chainID), fromAcc) if err != nil { return common.Hash{}, fmt.Errorf("SignTx:%v , err:%v", c.BaseURL, err.Error()) } err = client.SendTransaction(context.Background(), signedTx) if err != nil { return common.Hash{}, fmt.Errorf("SendTransaction:%v , err:%v", c.BaseURL, err.Error()) } return signedTx.Hash(), err } func (c *Client) SendETHTransactWithLock(client *ethclient.Client, prkHex string, from common.Address, to common.Address, value *big.Int, input []byte) (common.Hash, error) { logger.Info("start SendETHTransactWithLock", "") defer logger.Info("end SendETHTransactWithLock", "") sendTransactionLock.Lock() defer sendTransactionLock.Unlock() fromAcc, _, err := eth.GetAccountInfo(prkHex) if err != nil { return common.Hash{}, errors.Join(err, errors.New("error while getting account info")) } logger.Info("GetAccountInfo SendETHTransactWithLock", "") chainID, err := client.NetworkID(context.Background()) if err != nil { return common.Hash{}, fmt.Errorf("NetworkID :%v", err.Error()) } logger.Info("NetworkID SendETHTransactWithLock", "") tx, err := eth.CreateEthTransaction(client, from, to, value, input) if err != nil { return common.Hash{}, fmt.Errorf("CreateEthTransaction :%v", err.Error()) } logger.Info("CreateEthTransaction SendETHTransactWithLock", "") signedTx, err := types.SignTx(tx, types.LatestSignerForChainID(chainID), fromAcc) if err != nil { return common.Hash{}, fmt.Errorf("SignTx:%v , err:%v", c.BaseURL, err.Error()) } logger.Info("SignTx SendETHTransactWithLock", "") err = client.SendTransaction(context.Background(), signedTx) if err != nil { return common.Hash{}, fmt.Errorf("SendTransaction:%v , err:%v", c.BaseURL, err.Error()) } logger.Info("SendTransaction SendETHTransactWithLock", "") return signedTx.Hash(), err } func (c *Client) ExecuteETHTransact(prkHex string, from common.Address, to common.Address, value *big.Int, input []byte) (*types.Receipt, error) { client, err := c.GetETHClient() if err != nil { return nil, fmt.Errorf("GetETHClient:%v , err:%v", c.BaseURL, err.Error()) } signedTx, err := c.SendETHTransact(client, prkHex, from, to, value, input) if err != nil { return nil, fmt.Errorf("sendETHTransact:%v , err:%v", c.BaseURL, err.Error()) } start := time.Now() txReceipt, err := eth.WaitForTxReceipt(client, signedTx) if execTime := time.Since(start); execTime > 2*time.Second || err != nil { logger.Info("wait mint a tx too long or err ", "", zap.Any("hash", signedTx.Hex()), zap.Any("BaseURL", c.BaseURL), zap.Any("execTime", execTime), zap.Any("err", err)) } if err != nil { return nil, fmt.Errorf("WaitForTxReceipt:%v , err:%v", c.BaseURL, err.Error()) } return txReceipt, err } func (c *Client) signAndSendTx(prkHex string, pbkHex common.Address, transact *accounts.Transaction) (*zktypes.Receipt, error) { chainID, err := c.GetChainID() if err != nil { return nil, err } zkClient, err := c.GetZkClient() if err != nil { return nil, err } preparedTx, err := c.PopulateTransaction( context.Background(), pbkHex, *transact, ) if err != nil { return nil, err } prkBytes, err := hex.DecodeString(prkHex) if err != nil { return nil, err } baseSigner, err := accounts.NewBaseSignerFromRawPrivateKey(prkBytes, int64(chainID)) if err != nil { return nil, err } signer := accounts.Signer(baseSigner) rawTx, err := c.SignTransaction(signer, preparedTx) if err != nil { return nil, err } hash, err := zkClient.SendRawTransaction(context.Background(), rawTx) if err != nil { return nil, err } start := time.Now() tx, err := c.WaitMined(context.Background(), hash) if execTime := time.Since(start); execTime > 2*time.Second || err != nil { logger.Info("wait mint a tx too long or err ", "", zap.Any("hash", hash), zap.Any("BaseURL", c.BaseURL), zap.Any("execTime", execTime), zap.Any("err", err)) } if err != nil { return nil, err } return tx, nil } func (c *Client) WaitMined(ctx context.Context, txHash common.Hash) (*zktypes.Receipt, error) { zkClient, err := c.GetZkClient() if err != nil { return nil, err } queryTicker := time.NewTicker(time.Second) maxRetry := 10 checkExit := 3 chainId, _ := c.GetChainID() if chainId == 45762 { queryTicker = time.NewTicker(500 * time.Millisecond) maxRetry = 20 checkExit = 4 } else if chainId == configs.BaseChainIDInt { queryTicker = time.NewTicker(2 * time.Millisecond) maxRetry = 20 checkExit = 4 } defer queryTicker.Stop() retry := 0 for { retry++ receipt, err := zkClient.TransactionReceipt(ctx, txHash) if err == nil && receipt != nil && receipt.BlockNumber != nil { return receipt, nil } if retry == checkExit { rpcResponse, pending, err := c.CheckTxPendingByHash(txHash) logger.Info("wait mint a tx not found ", "", zap.Any("hash", txHash), zap.Any("BaseURL", c.BaseURL), zap.Any("is not found", errors.Is(err, ethereum.NotFound)), zap.Any("pending", pending), zap.Any("rpcResponse", rpcResponse), zap.Any("err", err)) if errors.Is(err, ethereum.NotFound) { return nil, err } } if retry > maxRetry { return nil, err } // Wait for the next round. select { case <-ctx.Done(): return nil, ctx.Err() case <-queryTicker.C: } } } func (c *Client) BlockByNumber(ctx context.Context, blockNumber uint64) (*zktypes.Block, error) { client, err := c.GetZkClient() if err != nil { return nil, err } block, err := client.BlockByNumber(ctx, new(big.Int).SetUint64(blockNumber)) if err != nil { ethClient, err := c.GetETHClient() if err != nil { return nil, err } blockEth, err := ethClient.BlockByNumber(ctx, new(big.Int).SetUint64(blockNumber)) if err != nil { return nil, err } return &zktypes.Block{ Header: blockEth.Header(), Uncles: blockEth.Uncles(), Withdrawals: blockEth.Withdrawals(), Hash: blockEth.Hash(), TotalDifficulty: blockEth.Difficulty(), ReceivedAt: blockEth.ReceivedAt, ReceivedFrom: blockEth.ReceivedFrom, }, nil } return block, nil } func (c *Client) CheckTxPendingByHash(txHash common.Hash) (*configs.RPCResponse, bool, error) { jsonData := "{\"jsonrpc\":\"2.0\",\"method\":\"eth_getTransactionByHash\",\"params\":[\"" + txHash.Hex() + "\"],\"id\":1}" resp, err := http.Post(c.BaseURL, "application/json", bytes.NewBuffer([]byte(jsonData))) if err != nil { return nil, false, err } defer resp.Body.Close() if resp.StatusCode != http.StatusOK { return nil, false, fmt.Errorf("status code :%v = 200", resp.StatusCode) } body, err := io.ReadAll(resp.Body) if err != nil { return nil, false, err } var rpcResponse configs.RPCResponse err = json.Unmarshal(body, &rpcResponse) if err != nil { return nil, false, err } if rpcResponse.Result == nil { return nil, false, ethereum.NotFound } return &rpcResponse, rpcResponse.Result.BlockHash == nil, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/agent_abilities_job.go ================================================ package services import ( "context" "encoding/json" "fmt" "math/big" "strconv" "strings" "time" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/logger" "go.uber.org/zap" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/daos" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/helpers" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/aidojo" blockchainutils "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/blockchain_utils" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/types/numeric" "github.com/jinzhu/gorm" "golang.org/x/text/cases" "golang.org/x/text/language" ) func (s *Service) GetAgentChainFee(tx *gorm.DB, networkID uint64) (*models.AgentChainFee, error) { agentChainFee, err := s.dao.FirstAgentChainFee( tx, map[string][]interface{}{ "network_id = ?": {networkID}, }, map[string][]interface{}{}, []string{}, ) if err != nil { return nil, errs.NewError(err) } if agentChainFee == nil { agentChainFee = &models.AgentChainFee{ NetworkID: networkID, } err = s.dao.Create(tx, agentChainFee) if err != nil { return nil, errs.NewError(err) } } return agentChainFee, nil } func (s *Service) JobAgentSnapshotPostCreate(ctx context.Context) error { err := s.JobRunCheck( ctx, "JobAgentSnapshotPostCreate", func() error { missions, err := s.dao.FindAgentSnapshotMissionJoin( daos.GetDBMainCtx(ctx), map[string][]interface{}{ ` join agent_infos on agent_infos.id = agent_snapshot_missions.agent_info_id join agent_snapshot_mission_configs on agent_snapshot_mission_configs.network_id = agent_snapshot_missions.network_id and agent_snapshot_mission_configs.tool_set = agent_snapshot_missions.tool_set join agent_chain_fees on agent_chain_fees.network_id = agent_infos.network_id left join twitter_infos on twitter_infos.id = agent_infos.twitter_info_id `: {}, }, map[string][]interface{}{ "agent_snapshot_missions.enabled = 1": {}, "agent_snapshot_missions.reply_enabled = 1": {}, "agent_snapshot_missions.tool_set != '' and agent_snapshot_missions.tool_set != 'trade_analytics_mentions' ": {}, "agent_snapshot_missions.interval_sec > 0": {}, `( agent_infos.agent_type = 1 and agent_infos.agent_contract_id != '' and agent_infos.scan_enabled = 1 and agent_infos.reply_enabled = 1 and agent_infos.eai_balance > 0 and agent_chain_fees.infer_fee > 0 and agent_infos.eai_balance >= agent_chain_fees.infer_fee and ( ( agent_infos.twitter_info_id > 0 and twitter_infos.expired_at > adddate(now(), interval -15 minute) and ( agent_snapshot_mission_configs.platform = 'twitter' or agent_snapshot_mission_configs.platform = 'defi' ) ) or (agent_infos.farcaster_id is not null and agent_infos.farcaster_id != '' and agent_snapshot_mission_configs.platform = 'farcaster') or agent_snapshot_missions.agent_store_mission_id > 0 ) and agent_infos.network_id in (?) )`: { []uint64{ models.SHARDAI_CHAIN_ID, models.ETHEREUM_CHAIN_ID, models.BASE_CHAIN_ID, models.HERMES_CHAIN_ID, models.ARBITRUM_CHAIN_ID, models.ZKSYNC_CHAIN_ID, models.POLYGON_CHAIN_ID, models.SOLANA_CHAIN_ID, models.BSC_CHAIN_ID, models.APE_CHAIN_ID, models.AVALANCHE_C_CHAIN_ID, models.ABSTRACT_TESTNET_CHAIN_ID, models.BITTENSOR_CHAIN_ID, models.DUCK_CHAIN_ID, models.TRON_CHAIN_ID, models.MODE_CHAIN_ID, models.ZETA_CHAIN_ID, models.STORY_CHAIN_ID, models.HYPE_CHAIN_ID, models.MONAD_TESTNET_CHAIN_ID, models.MEGAETH_TESTNET_CHAIN_ID, models.CELO_CHAIN_ID, models.BASE_SEPOLIA_CHAIN_ID, }, }, `agent_snapshot_missions.infer_at is null or agent_snapshot_missions.infer_at <= adddate(now(), interval -agent_snapshot_missions.interval_sec second) `: {}, }, map[string][]interface{}{}, []string{}, 0, 999999, ) if err != nil { return errs.NewError(err) } var retErr error if len(missions) > 0 { for _, mission := range missions { err = s.AgentSnapshotPostCreate(ctx, mission.ID, "", "") if err != nil { retErr = errs.MergeError(retErr, errs.NewErrorWithId(err, mission.ID)) } } } return retErr }, ) if err != nil { return errs.NewError(err) } return nil } func (s *Service) JobAgentSnapshotPostActionExecuted(ctx context.Context) error { err := s.JobRunCheck( ctx, "JobAgentSnapshotPostActionExecuted", func() error { var retErr error actions, err := s.dao.FindAgentSnapshotPostActionJoin( daos.GetDBMainCtx(ctx), map[string][]interface{}{ "join agent_snapshot_missions on agent_snapshot_missions.id = agent_snapshot_post_actions.agent_snapshot_mission_id": {}, "join agent_infos on agent_infos.id = agent_snapshot_post_actions.agent_info_id": {}, }, map[string][]interface{}{ "agent_snapshot_post_actions.status = ?": {models.AgentSnapshotPostActionStatusNew}, "agent_snapshot_post_actions.schedule_at < now()": {}, "agent_snapshot_post_actions.schedule_at > adddate(now(), interval -6 hour)": {}, `( agent_infos.agent_type = 1 and agent_infos.reply_enabled = true and ( agent_infos.reply_latest_time is null or agent_infos.reply_latest_time <= adddate(now(), interval -agent_infos.action_delayed second) or agent_snapshot_post_actions.tool_set in ('follow', 'reply_mentions', 'inscribe_tweet', 'post', 'trading', 'post_search', 'trade_analytics', 'trade_analytics_twitter', 'trade_analytics_mentions', 'lucky_moneys') or agent_snapshot_post_actions.type in ('reply_multi_unlimited') or agent_snapshot_missions.not_delay = true ) )`: {}, `( agent_snapshot_missions.enabled = 1 and agent_snapshot_missions.reply_enabled = 1 and agent_snapshot_missions.interval_sec > 0 and agent_snapshot_missions.is_testing = 0 and agent_snapshot_missions.deleted_at is null )`: {}, }, map[string][]interface{}{}, []string{ "rand()", }, 0, 100, ) if err != nil { return errs.NewError(err) } for _, action := range actions { err = s.AgentSnapshotPostActionExecuted(ctx, action.ID) if err != nil { return errs.NewError(err) } } return retErr }, ) if err != nil { return errs.NewError(err) } return nil } func (s *Service) JobAgentSnapshotPostActionDupplicated(ctx context.Context) error { err := s.JobRunCheck( ctx, "JobAgentSnapshotPostActionDupplicated", func() error { var retErr error actions, err := s.dao.FindAgentSnapshotPostAction( daos.GetDBMainCtx(ctx), map[string][]interface{}{ "status = ?": {models.AgentSnapshotPostActionStatusNew}, `( ( type in ( 'reply', 'retweet', 'quote_tweet' ) and exists( select 1 from agent_snapshot_post_actions checks where agent_snapshot_post_actions.agent_info_id = checks.agent_info_id and agent_snapshot_post_actions.type = checks.type and agent_snapshot_post_actions.conversation_id = checks.conversation_id and agent_snapshot_post_actions.id > checks.id and checks.status in ('new', 'done') ) ) or ( type in ( 'tweet' ) and exists( select 1 from agent_snapshot_post_actions checks where agent_snapshot_post_actions.agent_info_id = checks.agent_info_id and agent_snapshot_post_actions.agent_snapshot_mission_id = checks.agent_snapshot_mission_id and agent_snapshot_post_actions.type = checks.type and agent_snapshot_post_actions.id < checks.id and checks.status in ('new') ) ) or ( type in ( 'follow' ) and exists( select 1 from agent_snapshot_post_actions checks where agent_snapshot_post_actions.agent_info_id = checks.agent_info_id and agent_snapshot_post_actions.type = checks.type and agent_snapshot_post_actions.target_username = checks.target_username and agent_snapshot_post_actions.id > checks.id and checks.status in ('new', 'done') ) ) or ( type in ( 'create_token' ) and exists( select 1 from agent_snapshot_post_actions checks where agent_snapshot_post_actions.agent_info_id = checks.agent_info_id and agent_snapshot_post_actions.type = checks.type and agent_snapshot_post_actions.id < checks.id and checks.status in ('new') ) ) )`: {}, }, map[string][]interface{}{}, []string{}, 0, 999999, ) if err != nil { return errs.NewError(err) } for _, action := range actions { err = daos. GetDBMainCtx(ctx). Model(action). Where("status = ?", models.AgentSnapshotPostActionStatusNew). UpdateColumn("status", models.AgentSnapshotPostActionStatusDoneDuplicated). Error if err != nil { return errs.NewError(err) } } return retErr }, ) if err != nil { return errs.NewError(err) } return nil } func (s *Service) JobAgentSnapshotPostActionCancelled(ctx context.Context) error { err := s.JobRunCheck( ctx, "JobAgentSnapshotPostActionCancelled", func() error { var retErr error actions, err := s.dao.FindAgentSnapshotPostAction( daos.GetDBMainCtx(ctx), map[string][]interface{}{ "status = ?": {models.AgentSnapshotPostActionStatusNew}, "schedule_at < adddate(now(), interval -6 hour)": {}, }, map[string][]interface{}{}, []string{}, 0, 999999, ) if err != nil { return errs.NewError(err) } for _, action := range actions { err = daos.GetDBMainCtx(ctx). Model(action). Where("status = ?", models.AgentSnapshotPostActionStatusNew). UpdateColumn("status", models.AgentSnapshotPostActionStatusDoneCancelled). Error if err != nil { return errs.NewError(err) } } return retErr }, ) if err != nil { return errs.NewError(err) } return nil } func (s *Service) AgentSnapshotPostCreate(ctx context.Context, missionID uint, orgTweetID, tokenSymbol string) error { err := s.JobRunCheck( ctx, fmt.Sprintf("AgentSnapshotPostCreate_%d", missionID), func() error { err := daos.WithTransaction( daos.GetDBMainCtx(ctx), func(tx *gorm.DB) error { mission, err := s.dao.FirstAgentSnapshotMissionByID( tx, missionID, map[string][]interface{}{ "AgentInfo": {}, "AgentStore": {}, "AgentStoreMission": {}, }, false, ) if err != nil { return errs.NewError(err) } agentInfo := mission.AgentInfo if agentInfo == nil { return errs.NewError(errs.ErrBadRequest) } var headSystemPrompt string if agentInfo.AgentName != "" && agentInfo.TwitterUsername != "" { headSystemPrompt = headSystemPrompt + "Your Twitter name is . Your Twitter username is @. People refer to you as , @, .\n\n" } metaDataReq := &aidojo.AgentMetadataRequest{} if agentInfo.TokenSymbol != "" && agentInfo.TokenAddress != "" && agentInfo.TwitterUsername != "0xIntellect" { tokenNetworkName := cases.Title(language.English).String(models.GetChainName(agentInfo.TokenNetworkID)) headSystemPrompt = headSystemPrompt + "You have a token. Your token name is . Your token ticker is $. People refer to your token as or $. Your token address is . Your token was deployed on " + tokenNetworkName + ".\n\n" metaDataReq.TokenInfo.Name = agentInfo.TokenName metaDataReq.TokenInfo.Symbol = agentInfo.TokenSymbol metaDataReq.TokenInfo.Address = agentInfo.TokenAddress metaDataReq.TokenInfo.Chain = tokenNetworkName } headSystemPrompt = strings.TrimSpace(headSystemPrompt) headSystemPrompt = strings.ReplaceAll(headSystemPrompt, "", agentInfo.AgentName) headSystemPrompt = strings.ReplaceAll(headSystemPrompt, "", agentInfo.TwitterUsername) headSystemPrompt = strings.ReplaceAll(headSystemPrompt, "", agentInfo.TokenName) headSystemPrompt = strings.ReplaceAll(headSystemPrompt, "", agentInfo.TokenSymbol) headSystemPrompt = strings.ReplaceAll(headSystemPrompt, "", agentInfo.TokenAddress) inferTxHash := helpers.RandomBigInt(12).Text(16) if mission.ToolList != "" && (mission.ToolSet == models.ToolsetTypeTradeAnalytics || mission.ToolSet == models.ToolsetTypeTradeAnalyticsOnTwitter || mission.ToolSet == models.ToolsetTypeTradeAnalyticsMentions) { if mission.Tokens == "" { mission.Tokens = tokenSymbol } mission.UserPrompt = strings.ReplaceAll(mission.UserPrompt, "{token_symbol}", mission.Tokens) mission.ToolList = strings.ReplaceAll(mission.ToolList, "{ref_id}", inferTxHash) mission.ToolList = strings.ReplaceAll(mission.ToolList, "{token_symbol}", mission.Tokens) } inferItems := []*models.UserAgentInferDataItem{ { Role: "user", Content: strings.TrimSpace(mission.UserPrompt), }, } agentChainFee, err := s.GetAgentChainFee( tx, agentInfo.NetworkID, ) if err != nil { return errs.NewError(err) } inferFee := agentChainFee.InferFee missionStoreFee := numeric.NewBigFloatFromFloat(big.NewFloat(0)) toolList := mission.ToolList if mission.AgentStoreMissionID > 0 { missionStoreFee = mission.AgentStoreMission.Price inferFee = numeric.NewBigFloatFromFloat(models.AddBigFloats(&inferFee.Float, &missionStoreFee.Float)) agentStoreInstall, err := s.dao.FirstAgentStoreInstall( tx, map[string][]interface{}{ "type = ?": {models.AgentStoreInstallTypeAgent}, "agent_store_id = ?": {mission.AgentStoreID}, "agent_info_id = ?": {mission.AgentInfoID}, "status = ?": {models.AgentStoreInstallStatusDone}, }, map[string][]interface{}{ "User": {}, }, []string{"id desc"}, ) if err != nil { return errs.NewError(err) } if agentStoreInstall == nil { return errs.NewError(errs.ErrBadRequest) } // agentStoreMission, err := s.dao.FirstAgentStoreMissionByID( tx, mission.AgentStoreMissionID, map[string][]interface{}{}, false, ) if err != nil { return errs.NewError(err) } if agentStoreMission == nil { return errs.NewError(errs.ErrBadRequest) } agentStoreMission.NumUsed++ err = s.dao.Save(tx, agentStoreMission) if err != nil { return errs.NewError(err) } params := map[string]interface{}{} err = helpers.ConvertJsonObject(agentStoreInstall.CallbackParams, ¶ms) if err != nil { return errs.NewError(err) } params["install_code"] = agentStoreInstall.Code if agentStoreInstall.User != nil { params["user_address"] = agentStoreInstall.User.Address } inferItems[0].Content, err = helpers.GenerateTemplateContent(mission.AgentStoreMission.UserPrompt, params) if err != nil { return errs.NewError(err) } if mission.UserPrompt != "" { inferItems[0].Content, err = helpers.GenerateTemplateContent(mission.UserPrompt, params) if err != nil { return errs.NewError(err) } } toolList, err = helpers.GenerateTemplateContent(mission.AgentStoreMission.ToolList, params) if err != nil { return errs.NewError(err) } } inferData, err := json.Marshal(inferItems) if err != nil { return errs.NewError(err) } inferPost := &models.AgentSnapshotPost{ NetworkID: agentInfo.NetworkID, AgentInfoID: agentInfo.ID, AgentSnapshotMissionID: mission.ID, InferData: string(inferData), InferAt: helpers.TimeNow(), Status: models.AgentSnapshotPostStatusInferSubmitted, Fee: inferFee, UserPrompt: inferItems[0].Content, HeadSystemPrompt: headSystemPrompt, AgentMetaData: helpers.ConvertJsonString(metaDataReq), ToolList: toolList, SystemPrompt: agentInfo.SystemPrompt, SystemReminder: agentInfo.SystemReminder, Toolset: string(mission.ToolSet), AgentBaseModel: mission.AgentBaseModel, ReactMaxSteps: mission.ReactMaxSteps, InferTxHash: inferTxHash, OrgTweetID: orgTweetID, Token: tokenSymbol, AgentStoreMissionID: mission.AgentStoreMissionID, AgentStoreID: mission.AgentStoreID, IsRated: false, AgentStoreMissionFee: missionStoreFee, } if inferPost.AgentBaseModel == "" { inferPost.AgentBaseModel = agentInfo.AgentBaseModel } if inferPost.Fee.Float.Cmp(big.NewFloat(0)) <= 0 { return errs.NewError(errs.ErrBadRequest) } if agentInfo.EaiBalance.Float.Cmp(&inferPost.Fee.Float) < 0 { return errs.NewError(errs.ErrBadRequest) } err = tx.Model(agentInfo). UpdateColumn("eai_balance", gorm.Expr("eai_balance - ?", inferPost.Fee)). Error if err != nil { return errs.NewError(err) } agentInfo, err = s.dao.FirstAgentInfoByID( tx, agentInfo.ID, map[string][]interface{}{}, false, ) if err != nil { return errs.NewError(err) } if agentInfo.EaiBalance.Float.Cmp(big.NewFloat(0)) < 0 { return errs.NewError(errs.ErrBadRequest) } if mission.ToolSet != models.ToolsetTypeLuckyMoneys { inferPost, err = s.BatchPromptItemV2(ctx, agentInfo, inferPost) if err != nil { inferPost.Error = err.Error() inferPost.Status = models.AgentSnapshotPostStatusInferError err = s.dao.Create( tx, inferPost, ) if err != nil { return errs.NewError(err) } err = tx.Model(agentInfo). UpdateColumn("eai_balance", gorm.Expr("eai_balance + ?", inferPost.Fee)). Error if err != nil { return errs.NewError(err) } inferPost.Fee = numeric.NewBigFloatFromString("0") err = s.dao.Save( tx, inferPost, ) if err != nil { return errs.NewError(err) } return nil } } err = s.dao.Create( tx, inferPost, ) if err != nil { return errs.NewError(err) } err = tx.Model(mission). UpdateColumn("infer_at", helpers.TimeNow()). Error if err != nil { return errs.NewError(err) } if inferPost.Fee.Cmp(big.NewFloat(0)) > 0 { _ = s.dao.Create( tx, &models.AgentEaiTopup{ NetworkID: agentInfo.NetworkID, EventId: fmt.Sprintf("agent_trigger_%d", inferPost.ID), AgentInfoID: agentInfo.ID, Type: models.AgentEaiTopupTypeSpent, Amount: inferPost.Fee, Status: models.AgentEaiTopupStatusDone, DepositAddress: agentInfo.ETHAddress, ToAddress: agentInfo.ETHAddress, Toolset: string(mission.ToolSet), }, ) } { if inferPost.AgentStoreMissionID > 0 { _ = tx.Model(&models.AgentStoreMission{}). Where("id = ?", inferPost.AgentStoreMissionID). Updates( map[string]interface{}{ "num_used": gorm.Expr("num_used + ?", 1), "volume": gorm.Expr("volume + ?", inferPost.AgentStoreMissionFee), }, ). Error } if inferPost.AgentStoreID > 0 { _ = tx.Model(&models.AgentStore{}). Where("id = ?", inferPost.AgentStoreID). Updates( map[string]interface{}{ "num_usage": gorm.Expr("num_usage + ?", 1), "volume": gorm.Expr("volume + ?", inferPost.AgentStoreMissionFee), }, ). Error } } return nil }, ) if err != nil { return errs.NewError(err) } return nil }, ) if err != nil { return errs.NewError(err) } return nil } func (s *Service) AgentSnapshotPostCreateForUser(ctx context.Context, networkID uint64, userAddress string, userPrompt string, agentBaseModel string, agentStoreMissionID uint) (*models.AgentSnapshotPost, error) { var inferPost *models.AgentSnapshotPost err := s.JobRunCheck( ctx, fmt.Sprintf("AgentSnapshotPostCreateForUser_%s", userAddress), func() error { err := daos.WithTransaction( daos.GetDBMainCtx(ctx), func(tx *gorm.DB) error { user, err := s.GetUser( tx, 0, userAddress, false, ) if err != nil { return errs.NewError(err) } agentStoreMission, err := s.dao.FirstAgentStoreMissionByID( tx, agentStoreMissionID, map[string][]interface{}{}, false, ) if err != nil { return errs.NewError(err) } agentStoreMission.NumUsed++ var headSystemPrompt string metaDataReq := &aidojo.AgentMetadataRequest{} inferTxHash := helpers.RandomBigInt(12).Text(16) inferItems := []*models.UserAgentInferDataItem{ { Role: "user", Content: strings.TrimSpace(agentStoreMission.UserPrompt), }, } agentChainFee, err := s.GetAgentChainFee( tx, networkID, ) if err != nil { return errs.NewError(err) } inferFee := agentChainFee.InferFee missionStoreFee := numeric.NewBigFloatFromFloat(big.NewFloat(0)) missionStoreFee = agentStoreMission.Price inferFee = numeric.NewBigFloatFromFloat(models.AddBigFloats(&inferFee.Float, &missionStoreFee.Float)) params := map[string]interface{}{} agentStoreInstall, err := s.dao.FirstAgentStoreInstall( tx, map[string][]interface{}{ "type = ?": {models.AgentStoreInstallTypeUser}, "user_id = ?": {user.ID}, "agent_store_id = ?": {agentStoreMission.AgentStoreID}, "status = ?": {models.AgentStoreInstallStatusDone}, }, map[string][]interface{}{ "User": {}, }, []string{"id desc"}, ) if err != nil { return errs.NewError(err) } if agentStoreInstall != nil { err = helpers.ConvertJsonObject(agentStoreInstall.CallbackParams, ¶ms) if err != nil { return errs.NewError(err) } params["install_code"] = agentStoreInstall.Code if agentStoreInstall.User != nil { params["user_address"] = agentStoreInstall.User.Address } } inferItems[0].Content, err = helpers.GenerateTemplateContent(agentStoreMission.UserPrompt, params) if err != nil { return errs.NewError(err) } toolList, err := helpers.GenerateTemplateContent(agentStoreMission.ToolList, params) if err != nil { return errs.NewError(err) } inferData, err := json.Marshal(inferItems) if err != nil { return errs.NewError(err) } prompt := inferItems[0].Content if userPrompt != "" { prompt = userPrompt } inferPost = &models.AgentSnapshotPost{ NetworkID: networkID, UserID: user.ID, InferData: string(inferData), InferAt: helpers.TimeNow(), Status: models.AgentSnapshotPostStatusInferSubmitted, Fee: inferFee, UserPrompt: prompt, HeadSystemPrompt: headSystemPrompt, AgentMetaData: helpers.ConvertJsonString(metaDataReq), ToolList: toolList, // SystemPrompt: systemPrompt, SystemReminder: "", Toolset: "mission_store", AgentBaseModel: agentBaseModel, ReactMaxSteps: 3, InferTxHash: inferTxHash, AgentStoreMissionID: agentStoreMission.ID, AgentStoreID: agentStoreMission.AgentStoreID, IsRated: false, AgentStoreMissionFee: missionStoreFee, } if inferPost.Fee.Float.Cmp(big.NewFloat(0)) <= 0 { return errs.NewError(errs.ErrBadRequest) } if user.EaiBalance.Float.Cmp(&inferPost.Fee.Float) < 0 { return errs.NewError(errs.ErrBadRequest) } err = tx.Model(user). UpdateColumn("eai_balance", gorm.Expr("eai_balance - ?", inferPost.Fee)). Error if err != nil { return errs.NewError(err) } user, err = s.dao.FirstUserByID( tx, user.ID, map[string][]interface{}{}, false, ) if err != nil { return errs.NewError(err) } if user.EaiBalance.Float.Cmp(big.NewFloat(0)) < 0 { return errs.NewError(errs.ErrBadRequest) } inferPost, err = s.BatchPromptItemV2(ctx, nil, inferPost) if err != nil { inferPost.Error = err.Error() inferPost.Status = models.AgentSnapshotPostStatusInferError err = s.dao.Create( tx, inferPost, ) if err != nil { return errs.NewError(err) } err = tx.Model(user). UpdateColumn("eai_balance", gorm.Expr("eai_balance + ?", inferPost.Fee)). Error if err != nil { return errs.NewError(err) } inferPost.Fee = numeric.NewBigFloatFromString("0") err = s.dao.Save( tx, inferPost, ) if err != nil { return errs.NewError(err) } return nil } err = s.dao.Create( tx, inferPost, ) if err != nil { return errs.NewError(err) } if inferPost.Fee.Cmp(big.NewFloat(0)) > 0 { _ = s.dao.Create( tx, &models.UserTransaction{ EventId: fmt.Sprintf("agent_trigger_%d", inferPost.ID), UserID: user.ID, Type: models.UserTransactionTypeTriggerFee, Amount: numeric.NewBigFloatFromFloat(models.NegativeBigFloat(&inferPost.Fee.Float)), Status: models.UserTransactionStatusDone, }, ) } { if inferPost.AgentStoreMissionID > 0 { _ = tx.Model(&models.AgentStoreMission{}). Where("id = ?", inferPost.AgentStoreMissionID). Updates( map[string]interface{}{ "num_used": gorm.Expr("num_used + ?", 1), "volume": gorm.Expr("volume + ?", inferPost.AgentStoreMissionFee), }, ). Error } if inferPost.AgentStoreID > 0 { _ = tx.Model(&models.AgentStore{}). Where("id = ?", inferPost.AgentStoreID). Updates( map[string]interface{}{ "num_usage": gorm.Expr("num_usage + ?", 1), "volume": gorm.Expr("volume + ?", inferPost.AgentStoreMissionFee), }, ). Error } } // add history agentStoreTry, _ := s.dao.FirstAgentStoreTry( tx, map[string][]interface{}{ "user_id = ?": {user.ID}, "agent_store_id = ?": {agentStoreMission.AgentStoreID}, }, map[string][]interface{}{}, false, ) if agentStoreTry == nil { agentStoreTry = &models.AgentStoreTry{ UserID: user.ID, AgentStoreID: agentStoreMission.AgentStoreID, } s.dao.Create( tx, agentStoreTry, ) } if agentStoreTry != nil && agentStoreTry.ID > 0 { history := &models.AgentStoreTryDetail{ AgentStoreTryID: agentStoreTry.ID, FromUser: true, Content: userPrompt, } s.dao.Create( tx, history, ) history = &models.AgentStoreTryDetail{ AgentStoreTryID: agentStoreTry.ID, FromUser: false, Content: "", AgentSnapshotPostID: inferPost.ID, } s.dao.Create( tx, history, ) } return nil }, ) if err != nil { return errs.NewError(err) } return nil }, ) if err != nil { return nil, errs.NewError(err) } return inferPost, nil } func (s *Service) AgentSnapshotPostActionExecuted(ctx context.Context, twitterPostID uint) error { var snapshotPostAction *models.AgentSnapshotPostAction err := s.JobRunCheck( ctx, fmt.Sprintf("AgentSnapshotPostActionExecuted_%d", twitterPostID), func() error { contentLines := []string{} var accessToken, missionToolSet string postIds := []string{} err := daos.WithTransaction( daos.GetDBMainCtx(ctx), func(tx *gorm.DB) error { var err error snapshotPostAction, err = s.dao.FirstAgentSnapshotPostActionByID( tx, twitterPostID, map[string][]interface{}{}, true, ) if err != nil { return errs.NewError(err) } if snapshotPostAction.Status == models.AgentSnapshotPostActionStatusNew { if snapshotPostAction.ScheduleAt.Before(time.Now().Add(-6 * time.Hour)) { snapshotPostAction.Status = models.AgentSnapshotPostActionStatusDoneCancelled snapshotPostAction.ExecutedAt = helpers.TimeNow() err = s.dao.Save( tx, snapshotPostAction, ) if err != nil { return errs.NewError(err) } return nil } agent, err := s.dao.FirstAgentInfoByID( tx, snapshotPostAction.AgentInfoID, map[string][]interface{}{ "TwitterInfo": {}, }, false, ) if err != nil { return errs.NewError(err) } agentSnapshotMission, err := s.dao.FirstAgentSnapshotMissionByID( tx, snapshotPostAction.AgentSnapshotMissionID, map[string][]interface{}{}, false, ) if err != nil { return errs.NewError(err) } var isPassed bool if agentSnapshotMission.NotDelay { isPassed = true } else { switch snapshotPostAction.ToolSet { case models.ToolsetTypeReplyMentions, models.ToolsetTypeFollow, models.ToolsetTypeInscribeTweet, models.ToolsetTypePost, models.ToolsetTypeTrading, models.ToolsetTypeTradeAnalytics, models.ToolsetTypeTradeAnalyticsOnTwitter, models.ToolsetTypeTradeAnalyticsMentions, models.ToolsetTypeLuckyMoneys, models.ToolsetType("post_search"): { isPassed = true } default: { if agent.ReplyLatestTime == nil || agent.ReplyLatestTime.Before(time.Now().Add(-time.Duration(agent.ActionDelayed)*time.Second)) { isPassed = true } } } } missionToolSet = string(agentSnapshotMission.ToolSet) switch snapshotPostAction.Type { case models.AgentSnapshotPostActionTypeReplyMultiUnlimited: { isPassed = true } } if isPassed && agent.ReplyEnabled { // var refId, inscribeId, errText string var tokenAddress, tokenHash string isDupplicated := false switch snapshotPostAction.Type { case models.AgentSnapshotPostActionTypeFollow: { if snapshotPostAction.TargetTwitterId == "" { targetUsername := strings.TrimPrefix(snapshotPostAction.TargetUsername, "@") if targetUsername == "" { errText = "targetUsername not found" } else { var targetTwitterId string var followerCount uint for i := 0; i < 3; i++ { obj, _ := s.twitterAPI.GetTwitterByUserName(targetUsername) if obj != nil { followerCount = uint(obj.PublicMetrics.Followers) targetTwitterId = obj.ID break } } if targetTwitterId == "" { twitterUser, _ := s.dao.FirstTwitterUser( tx, map[string][]interface{}{ "twitter_username = ?": {targetUsername}, }, map[string][]interface{}{}, []string{}, ) if twitterUser != nil { followerCount = twitterUser.FollowersCount targetTwitterId = twitterUser.TwitterID } } if targetTwitterId == "" { errText = "targetTwitterId not found" } else { snapshotPostAction.TargetTwitterId = targetTwitterId snapshotPostAction.FollowerCount = followerCount } } } if snapshotPostAction.AgentTwitterId == snapshotPostAction.TargetTwitterId { isDupplicated = true } else { m, err := s.dao.FirstTwitterFollowing( tx, map[string][]interface{}{ "owner_twitter_id = ?": {snapshotPostAction.AgentTwitterId}, "twitter_id = ?": {snapshotPostAction.TargetTwitterId}, }, map[string][]interface{}{}, []string{}, ) if err != nil { return errs.NewError(err) } if m != nil { isDupplicated = true } } } case models.AgentSnapshotPostActionTypeReply, models.AgentSnapshotPostActionTypeRetweet, models.AgentSnapshotPostActionTypeQuoteTweet: { m, err := s.dao.FirstAgentSnapshotPostAction( tx, map[string][]interface{}{ "agent_info_id = ?": {snapshotPostAction.AgentInfoID}, "type = ?": {snapshotPostAction.Type}, "conversation_id = ?": {snapshotPostAction.ConversationId}, "status = ?": {models.AgentSnapshotPostActionStatusDone}, }, map[string][]interface{}{}, []string{}, ) if err != nil { return errs.NewError(err) } if m != nil { isDupplicated = true } } case models.AgentSnapshotPostActionTypeCreateToken: { m, err := s.dao.FirstAgentSnapshotPostAction( tx, map[string][]interface{}{ "agent_info_id = ?": {snapshotPostAction.AgentInfoID}, "type = ?": {snapshotPostAction.Type}, "token_symbol = ?": {snapshotPostAction.TokenSymbol}, "status = ?": {models.AgentSnapshotPostActionStatusDone}, }, map[string][]interface{}{}, []string{}, ) if err != nil { return errs.NewError(err) } if m != nil { isDupplicated = true } } } if !isDupplicated { err = tx.Model(agent). UpdateColumn("reply_latest_time", time.Now()). Error if err != nil { return errs.NewError(err) } if errText == "" { accessToken = agent.TwitterInfo.AccessToken switch snapshotPostAction.Type { case models.AgentSnapshotPostActionTypeFollow: { err = helpers.TwitterFollowUserCreate(agent.TwitterInfo.AccessToken, agent.TwitterID, snapshotPostAction.TargetTwitterId) if err != nil { errText = err.Error() } } case models.AgentSnapshotPostActionTypeTweet: { maxChars, err := s.GetTwitterPostMaxChars(tx, snapshotPostAction.AgentInfoID) if err != nil { return errs.NewError(err) } if snapshotPostAction.ToolSet == models.ToolsetTypeTrading { maxChars = 250 } contentLines = helpers.SplitTextBySentenceAndCharLimitAndRemoveTrailingHashTag(snapshotPostAction.Content, int(maxChars)) if len(contentLines) <= 0 { return errs.NewError(errs.ErrBadRequest) } refId, err = helpers.PostTweetByToken(agent.TwitterInfo.AccessToken, contentLines[0], "") if err != nil { errText = err.Error() } postIds = append(postIds, refId) } case models.AgentSnapshotPostActionTypeReply, models.AgentSnapshotPostActionTypeReplyMulti, models.AgentSnapshotPostActionTypeReplyMultiUnlimited: { if snapshotPostAction.ToolSet == models.ToolsetTypeTradeAnalyticsMentions { err = json.Unmarshal([]byte(snapshotPostAction.Content), &contentLines) if err != nil { return errs.NewError(err) } contentLines = helpers.SplitTextBySentenceAndCharLimitAndRemoveTrailingHashTag(strings.Join(contentLines, ". "), 250) if len(contentLines) <= 0 { return errs.NewError(errs.ErrBadRequest) } } else { maxChars, err := s.GetTwitterPostMaxChars(tx, snapshotPostAction.AgentInfoID) if err != nil { return errs.NewError(err) } contentLines = helpers.SplitTextBySentenceAndCharLimitAndRemoveTrailingHashTag(snapshotPostAction.Content, int(maxChars)) if len(contentLines) <= 0 { return errs.NewError(errs.ErrBadRequest) } } mediaID := "" if snapshotPostAction.TokenImageUrl != "" { mediaID, _ = s.twitterAPI.UploadImage(models.GetImageUrl(snapshotPostAction.TokenImageUrl), []string{snapshotPostAction.AgentTwitterId}) // if err != nil { // return errs.NewError(err) // } } refId, err = helpers.ReplyTweetByToken(agent.TwitterInfo.AccessToken, strings.TrimPrefix(contentLines[0], "."), snapshotPostAction.Tweetid, mediaID) if err != nil { errText = err.Error() } postIds = append(postIds, refId) cacheKey := fmt.Sprintf("CacheCheckIsTweetReplied_%s", snapshotPostAction.Tweetid) _ = s.SetRedisCachedWithKey(cacheKey, true, 24*time.Hour, ) } case models.AgentSnapshotPostActionTypeRetweet: { refId, err = helpers.RepostTweetByToken(agent.TwitterInfo.AccessToken, agent.TwitterID, snapshotPostAction.Tweetid) if err != nil { errText = err.Error() } } case models.AgentSnapshotPostActionTypeQuoteTweet: { maxChars, err := s.GetTwitterPostMaxChars(tx, snapshotPostAction.AgentInfoID) if err != nil { return errs.NewError(err) } contentLines = helpers.SplitTextBySentenceAndCharLimitAndRemoveTrailingHashTag(snapshotPostAction.Content, int(maxChars)) if len(contentLines) <= 0 { return errs.NewError(errs.ErrBadRequest) } refId, err = helpers.QuoteTweetByToken(agent.TwitterInfo.AccessToken, strings.TrimPrefix(contentLines[0], "."), snapshotPostAction.Tweetid) if err != nil { errText = err.Error() } postIds = append(postIds, refId) } case models.AgentSnapshotPostActionTypeInscribeTweet: { inscribeId, err = s.dojoAPI.AgentInscribe( &aidojo.AgentInscribeReq{ Content: snapshotPostAction.Content, MysqlID: snapshotPostAction.ID, TweetID: "", AgentID: snapshotPostAction.AgentInfoID, Type: "tweet", CreatedAt: *helpers.TimeNow(), PostTweetAt: *s.GetPostTimeByTweetID(tx, snapshotPostAction.Tweetid), }, ) if err != nil { errText = err.Error() } } case models.AgentSnapshotPostActionTypeTweetV2: { maxChars, err := s.GetTwitterPostMaxChars(tx, snapshotPostAction.AgentInfoID) if err != nil { return errs.NewError(err) } contentLines = helpers.SplitTextBySentenceAndCharLimitAndRemoveTrailingHashTag(snapshotPostAction.Content, int(maxChars)) if len(contentLines) <= 0 { return errs.NewError(errs.ErrBadRequest) } mediaID, err := s.twitterAPI.UploadImage(models.GetImageUrl(snapshotPostAction.TokenImageUrl), []string{snapshotPostAction.AgentTwitterId}) if err != nil { return errs.NewError(err) } refId, err = helpers.PostTweetWithMediaByToken(agent.TwitterInfo.AccessToken, contentLines[0], mediaID) if err != nil { errText = err.Error() } postIds = append(postIds, refId) } case models.AgentSnapshotPostActionTypeCreateToken: { if snapshotPostAction.TokenImageUrl == "" { imageUrl, err := s.GetGifImageUrlFromTokenInfo(snapshotPostAction.TokenSymbol, snapshotPostAction.TokenName, snapshotPostAction.Description) if err != nil { return errs.NewError(err) } if imageUrl != "" { snapshotPostAction.TokenImageUrl = imageUrl err = s.dao.Save( tx, snapshotPostAction, ) if err != nil { return errs.NewError(err) } return nil } } else { agentTokenAdminAddress := s.conf.GetConfigKeyString(models.GENERTAL_NETWORK_ID, "agent_token_admin_address") base64Str, _ := helpers.CurlBase64String(models.GetImageUrl(snapshotPostAction.TokenImageUrl)) if base64Str != "" { pumfunResp, err := s.blockchainUtils.SolanaCreatePumpfunToken( &blockchainutils.SolanaCreatePumpfunTokenReq{ Address: agentTokenAdminAddress, Name: snapshotPostAction.TokenName, Symbol: snapshotPostAction.TokenSymbol, Description: snapshotPostAction.Content, Twitter: fmt.Sprintf("https://x.com/%s", agent.TwitterUsername), Telegram: "", Website: "", Amount: 0, ImageBase64: base64Str, }, ) if err != nil { errText = err.Error() } else { tokenAddress = pumfunResp.Mint tokenHash = pumfunResp.Signature content := fmt.Sprintf( "%s\n\n%s", snapshotPostAction.Content, fmt.Sprintf("https://pump.fun/coin/%s", tokenAddress), ) contentLines = []string{ content, } refId, err = helpers.PostTweetByToken(agent.TwitterInfo.AccessToken, contentLines[0], "") if err != nil { errText = err.Error() } postIds = append(postIds, refId) } } else { errText = "base64Str empty data" } } } case models.AgentSnapshotPostActionTypeTweetMulti: { err = json.Unmarshal([]byte(snapshotPostAction.Content), &contentLines) if err != nil { return errs.NewError(err) } if snapshotPostAction.ToolSet == models.ToolsetTypeTrading || snapshotPostAction.ToolSet == models.ToolsetTypeTradeAnalyticsOnTwitter { contentLines = helpers.SplitTextBySentenceAndCharLimitAndRemoveTrailingHashTag(strings.Join(contentLines, ". "), 250) if len(contentLines) <= 0 { return errs.NewError(errs.ErrBadRequest) } refId, err = helpers.PostTweetByToken(agent.TwitterInfo.AccessToken, contentLines[0], "") if err != nil { errText = err.Error() } postIds = append(postIds, refId) } else { refId, err = helpers.PostTweetByToken(agent.TwitterInfo.AccessToken, contentLines[0], "") if err != nil { errText = err.Error() } postIds = append(postIds, refId) } } case models.AgentSnapshotPostActionTypeTradeHold, models.AgentSnapshotPostActionTypeTradeBuy, models.AgentSnapshotPostActionTypeTradeSell, models.AgentSnapshotPostActionTypeTradeAnalytic: { switch agentSnapshotMission.ToolSet { case models.ToolsetTypeTradeAnalytics: { if agentSnapshotMission.TeleChatID != "" { teleMsg := fmt.Sprintf(` %s Action: %s `, snapshotPostAction.Content, snapshotPostAction.Type) //TODO: send telegram refId, err = s.SendTeleMsgToChatID(ctx, teleMsg, agentSnapshotMission.TeleChatID) if err != nil { errText = err.Error() } } } case models.ToolsetTypeTradeAnalyticsOnTwitter: { err = json.Unmarshal([]byte(snapshotPostAction.Content), &contentLines) if err != nil { return errs.NewError(err) } contentLines = helpers.SplitTextBySentenceAndCharLimitAndRemoveTrailingHashTag(strings.Join(contentLines, ". "), 250) if len(contentLines) <= 0 { return errs.NewError(errs.ErrBadRequest) } refId, err = helpers.PostTweetByToken(agent.TwitterInfo.AccessToken, contentLines[0], "") if err != nil { errText = err.Error() } postIds = append(postIds, refId) } case models.ToolsetTypeLaunchpadJoin: { //TODO // err = json.Unmarshal([]byte(snapshotPostAction.Content), &contentLines) // if err != nil { // return errs.NewError(err) // } // contentLines = helpers.SplitTextBySentenceAndCharLimitAndRemoveTrailingHashTag(strings.Join(contentLines, ". "), 250) // if len(contentLines) <= 0 { // return errs.NewError(errs.ErrBadRequest) // } // refId, err = helpers.PostTweetByToken(agent.TwitterInfo.AccessToken, contentLines[0], "") // if err != nil { // errText = err.Error() // } // postIds = append(postIds, refId) } default: { errText = "not supported" } } } default: { errText = "not supported" } } } snapshotPostAction.RefId = refId snapshotPostAction.RefIds = refId snapshotPostAction.InscribeId = inscribeId snapshotPostAction.Error = errText snapshotPostAction.TokenAddress = tokenAddress snapshotPostAction.TokenHash = tokenHash if errText == "" { snapshotPostAction.Status = models.AgentSnapshotPostActionStatusDone } else { // if strings.Contains(errText, "suspended") || strings.Contains(errText, "locked") { // err = tx.Model(agent). // UpdateColumn("reply_enabled", false). // Error // if err != nil { // return errs.NewError(err) // } // } snapshotPostAction.Status = models.AgentSnapshotPostActionStatusDoneError } } else { snapshotPostAction.Status = models.AgentSnapshotPostActionStatusDoneDuplicated } snapshotPostAction.ExecutedAt = helpers.TimeNow() err = s.dao.Save( tx, snapshotPostAction, ) if err != nil { return errs.NewError(err) } } } return nil }, ) if err != nil { return errs.NewError(err) } if len(postIds) > 0 && len(contentLines) > 1 { for i := 1; i < len(contentLines); i++ { var postId string switch snapshotPostAction.Type { case models.AgentSnapshotPostActionTypeTweet, models.AgentSnapshotPostActionTypeQuoteTweet, models.AgentSnapshotPostActionTypeCreateToken, models.AgentSnapshotPostActionTypeTweetV2: { postId, err = helpers.ReplyTweetByToken(accessToken, contentLines[i], postIds[0], "") if err != nil { return errs.NewError(err) } } case models.AgentSnapshotPostActionTypeReply, models.AgentSnapshotPostActionTypeTweetMulti, models.AgentSnapshotPostActionTypeReplyMulti: { postId, _ = helpers.ReplyTweetByToken(accessToken, contentLines[i], postIds[len(postIds)-1], "") } case models.AgentSnapshotPostActionTypeTradeHold, models.AgentSnapshotPostActionTypeTradeBuy, models.AgentSnapshotPostActionTypeTradeSell, models.AgentSnapshotPostActionTypeTradeAnalytic: { switch missionToolSet { case string(models.ToolsetTypeTradeAnalyticsOnTwitter): { postId, _ = helpers.ReplyTweetByToken(accessToken, contentLines[i], postIds[len(postIds)-1], "") } } } } if postId != "" { postIds = append(postIds, postId) err = daos. GetDBMainCtx(ctx). Model(&models.AgentSnapshotPostAction{}). Where("id = ?", twitterPostID). UpdateColumn("ref_ids", strings.Join(postIds, ",")). Error if err != nil { return errs.NewError(err) } } } } return nil }, ) if err != nil { return errs.NewError(err) } if snapshotPostAction != nil { _ = s.UpdateOffchainAutoOutputV2(ctx, snapshotPostAction.AgentSnapshotPostID) } return nil } // func (s *Service) RetryAgentSnapshotPostActionExecuted(ctx context.Context, twitterPostID uint) error { // err := s.JobRunCheck( // ctx, // fmt.Sprintf("RetryAgentSnapshotPostActionExecuted_%d", twitterPostID), // func() error { // var snapshotPostAction *models.AgentSnapshotPostAction // contentLines := []string{} // var accessToken, missionToolSet string // postIds := []string{} // err := daos.WithTransaction( // daos.GetDBMainCtx(ctx), // func(tx *gorm.DB) error { // var err error // snapshotPostAction, err = s.dao.FirstAgentSnapshotPostActionByID( // tx, // twitterPostID, // map[string][]interface{}{}, // true, // ) // if err != nil { // return errs.NewError(err) // } // if snapshotPostAction.Status == models.AgentSnapshotPostActionStatusDone { // agent, err := s.dao.FirstAgentInfoByID( // tx, // snapshotPostAction.AgentInfoID, // map[string][]interface{}{ // "TwitterInfo": {}, // }, // false, // ) // if err != nil { // return errs.NewError(err) // } // // // var refId, errText string // agentSnapshotMission, err := s.dao.FirstAgentSnapshotMissionByID( // tx, // snapshotPostAction.AgentSnapshotMissionID, // map[string][]interface{}{}, // false, // ) // if err != nil { // return errs.NewError(err) // } // missionToolSet = string(agentSnapshotMission.ToolSet) // accessToken = agent.TwitterInfo.AccessToken // switch snapshotPostAction.Type { // case models.AgentSnapshotPostActionTypeTradeHold, models.AgentSnapshotPostActionTypeTradeBuy, models.AgentSnapshotPostActionTypeTradeSell, models.AgentSnapshotPostActionTypeTradeAnalytic: // { // switch missionToolSet { // case string(models.ToolsetTypeTradeAnalyticsOnTwitter): // { // err = json.Unmarshal([]byte(snapshotPostAction.Content), &contentLines) // if err != nil { // return errs.NewError(err) // } // contentLines = helpers.SplitTextBySentenceAndCharLimitAndRemoveTrailingHashTag(strings.Join(contentLines, ". "), 250) // if len(contentLines) <= 0 { // return errs.NewError(errs.ErrBadRequest) // } // refId = snapshotPostAction.RefId // postIds = append(postIds, refId) // } // default: // { // return errs.NewError(errs.ErrBadRequest) // } // } // } // default: // { // return errs.NewError(errs.ErrBadRequest) // } // } // _ = errText // } // return nil // }, // ) // if err != nil { // return errs.NewError(err) // } // if len(postIds) > 0 && len(contentLines) > 1 { // for i := 1; i < len(contentLines); i++ { // var postId string // switch snapshotPostAction.Type { // case models.AgentSnapshotPostActionTypeTweet, // models.AgentSnapshotPostActionTypeQuoteTweet, // models.AgentSnapshotPostActionTypeCreateToken, // models.AgentSnapshotPostActionTypeTweetV2: // { // postId, err = helpers.ReplyTweetByToken(accessToken, contentLines[i], postIds[0]) // if err != nil { // return errs.NewError(err) // } // } // case models.AgentSnapshotPostActionTypeReply, // models.AgentSnapshotPostActionTypeTweetMulti: // { // postId, _ = helpers.ReplyTweetByToken(accessToken, contentLines[i], postIds[len(postIds)-1]) // } // case models.AgentSnapshotPostActionTypeTradeHold, models.AgentSnapshotPostActionTypeTradeBuy, models.AgentSnapshotPostActionTypeTradeSell, models.AgentSnapshotPostActionTypeTradeAnalytic: // { // switch missionToolSet { // case string(models.ToolsetTypeTradeAnalyticsOnTwitter): // { // postId, _ = helpers.ReplyTweetByToken(accessToken, contentLines[i], postIds[len(postIds)-1]) // } // } // } // } // if postId != "" { // postIds = append(postIds, postId) // err = daos. // GetDBMainCtx(ctx). // Model(&models.AgentSnapshotPostAction{}). // Where("id = ?", twitterPostID). // UpdateColumn("ref_ids", strings.Join(postIds, ",")). // Error // if err != nil { // return errs.NewError(err) // } // } // } // } // return nil // }, // ) // if err != nil { // return errs.NewError(err) // } // _ = s.UpdateOffchainAutoOutputV2(ctx, twitterPostID) // return nil // } func (s *Service) UpdateOffchainAutoOutputV2ForId(ctx context.Context, snapshotPostID uint) error { agentSnapshotPost, err := s.dao.FirstAgentSnapshotPostByID( daos.GetDBMainCtx(ctx), snapshotPostID, map[string][]interface{}{ "AgentStore": {}, }, false, ) if err != nil { return errs.NewError(err) } if agentSnapshotPost != nil { if agentSnapshotPost.ResponseId != "" { if agentSnapshotPost.Status == models.AgentSnapshotPostStatusInferSubmitted { if agentSnapshotPost.CreatedAt.Before(time.Now().Add(-30 * time.Hour)) { err = daos.GetDBMainCtx(ctx). Model(agentSnapshotPost). UpdateColumn("status", models.AgentSnapshotPostStatusInferFailed). Error if err != nil { return errs.NewError(err) } return nil } offchainAutoAgentOutput, err := s.dojoAPI.OffchainAutoAgentOutput(s.conf.AgentOffchain.Url, agentSnapshotPost.ResponseId, s.conf.AgentOffchain.ApiKey) if err != nil { return errs.NewError(err) } aiOutput := map[string]interface{}{} err = helpers.ConvertJsonObject(offchainAutoAgentOutput, &aiOutput) if err != nil { return errs.NewError(err) } inferOutputData := helpers.ConvertJsonString( struct { Data struct { ResponseId string `json:"response_id"` Toolset string `json:"toolset"` Task string `json:"task"` AIOutput map[string]interface{} `json:"ai_output"` } `json:"data"` }{ Data: struct { ResponseId string "json:\"response_id\"" Toolset string "json:\"toolset\"" Task string "json:\"task\"" AIOutput map[string]interface{} "json:\"ai_output\"" }{ ResponseId: agentSnapshotPost.ResponseId, Toolset: agentSnapshotPost.Toolset, Task: agentSnapshotPost.Task, AIOutput: aiOutput, }, }, ) if len(inferOutputData) > len(agentSnapshotPost.InferOutputData) || !strings.EqualFold(inferOutputData, agentSnapshotPost.InferOutputData) { err = daos.GetDBMainCtx(ctx). Model(agentSnapshotPost). UpdateColumn("infer_output_data", inferOutputData). Error if err != nil { return errs.NewError(err) } } //cache result agentSnapshotPost.InferOutputData = inferOutputData err = s.CacheAgentSnapshotPost(agentSnapshotPost) if err != nil { return errs.NewError(err) } state, ok := aiOutput["state"] if ok { if state.(string) == "done" { err = daos.WithTransaction( daos.GetDBMainCtx(ctx), func(tx *gorm.DB) error { err = tx. Model(agentSnapshotPost). UpdateColumn("status", models.AgentSnapshotPostStatusInferResolved). Error if err != nil { return errs.NewError(err) } if agentSnapshotPost.AgentStore != nil && agentSnapshotPost.AgentStoreMissionFee.Float.Cmp(big.NewFloat(0)) > 0 { user, err := s.GetUser(tx, models.GENERTAL_NETWORK_ID, agentSnapshotPost.AgentStore.OwnerAddress, false) if err != nil { return errs.NewError(err) } err = tx.Model(user). UpdateColumn("eai_balance", gorm.Expr("eai_balance + ?", agentSnapshotPost.AgentStoreMissionFee)). Error if err != nil { return errs.NewError(err) } _ = s.dao.Create( tx, &models.UserTransaction{ NetworkID: agentSnapshotPost.NetworkID, EventId: fmt.Sprintf("agent_store_fee_%d", agentSnapshotPost.ID), UserID: user.ID, Type: models.UserTransactionTypeAgentStoreFee, Amount: agentSnapshotPost.AgentStoreMissionFee, Status: models.UserTransactionStatusDone, }, ) } return nil }, ) if err != nil { return errs.NewError(err) } go s.UpdateDataMissionTradeAnalytics(context.Background(), agentSnapshotPost.ID) } else if state.(string) == "error" { err = daos.GetDBMainCtx(ctx). Model(agentSnapshotPost). UpdateColumn("status", models.AgentSnapshotPostStatusInferFailed). Error if err != nil { return errs.NewError(err) } } } } } else { if agentSnapshotPost.Status == models.AgentSnapshotPostStatusInferSubmitted { inferOutputData, err := s.dojoAPI.OffchainAgentOutput(agentSnapshotPost.InferTxHash) if err != nil { return errs.NewError(err) } if len(inferOutputData) > len(agentSnapshotPost.InferOutputData) || !strings.EqualFold(inferOutputData, agentSnapshotPost.InferOutputData) { err = daos.GetDBMainCtx(ctx). Model(agentSnapshotPost). UpdateColumn("infer_output_data", inferOutputData). Error if err != nil { return errs.NewError(err) } } } } } return nil } func (s *Service) UpdateOffchainAutoOutputV2(ctx context.Context, snapshotPostID uint) error { err := s.JobRunCheck( ctx, fmt.Sprintf("UpdateOffchainAutoOutputV2x_%d", snapshotPostID), func() error { var rs bool err := s.RedisCached( fmt.Sprintf("UpdateOffchainAutoOutputV2x_%d", snapshotPostID), true, 15*time.Minute, &rs, func() (interface{}, error) { err := func() error { err := s.UpdateOffchainAutoOutputV2ForId(ctx, snapshotPostID) if err != nil { return errs.NewError(err) } return nil }() if err != nil { return false, errs.NewError(err) } return true, nil }, ) if err != nil { return errs.NewError(err) } return nil }, ) if err != nil { return errs.NewError(err) } return nil } func (s *Service) UpdateDataMissionTradeAnalytics(ctx context.Context, snapshotPostID uint) error { err := s.JobRunCheck( ctx, fmt.Sprintf("UpdateDataMissionTradeAnalytics_%d", snapshotPostID), func() error { err := func() error { snapshotPost, err := s.dao.FirstAgentSnapshotPostByID( daos.GetDBMainCtx(ctx), snapshotPostID, map[string][]interface{}{ "AgentSnapshotMission": {}, "AgentInfo": {}, }, false, ) if err != nil { return errs.NewError(err) } if snapshotPost != nil && snapshotPost.AgentInfo != nil && snapshotPost.ResponseId != "" && snapshotPost.AgentSnapshotMission != nil && (snapshotPost.AgentSnapshotMission.ToolSet == models.ToolsetTypeTradeAnalyticsOnTwitter || snapshotPost.AgentSnapshotMission.ToolSet == models.ToolsetTypeTradeAnalyticsMentions || snapshotPost.AgentSnapshotMission.ToolSet == models.ToolsetTypeLuckyMoneys || snapshotPost.AgentSnapshotMission.ToolSet == models.ToolsetTypeMissionStore) { if snapshotPost.AgentSnapshotMission.ToolSet == models.ToolsetTypeMissionStore || snapshotPost.AgentStoreMissionID > 0 { //cache result err = s.CacheAgentSnapshotPost(snapshotPost) if err != nil { return errs.NewError(err) } } else if snapshotPost.Status == models.AgentSnapshotPostStatusInferResolved { var rs struct { Data struct { ResponseId string `json:"response_id"` Toolset string `json:"toolset"` Task string `json:"task"` AIOutput struct { Scratchpad []struct { Task string `json:"task"` Action string `json:"action"` ActionInput string `json:"action_input"` Thought string `json:"thought"` FinalAnswer string `json:"final_answer"` } `json:"scratchpad"` } `json:"ai_output"` } `json:"data"` } err := helpers.ConvertJsonObject(snapshotPost.InferOutputData, &rs) if err != nil { return errs.NewError(err) } status := models.AgentSnapshotPostActionStatusNew if snapshotPost.AgentSnapshotMission != nil { if snapshotPost.AgentSnapshotMission.IsTesting { status = models.AgentSnapshotPostActionStatusTesting } } listThough := []string{} for i, item := range rs.Data.AIOutput.Scratchpad { if i == 0 || i == 1 { continue } if item.Thought != "" { listThough = append(listThough, item.Thought) } if item.FinalAnswer != "" { listThough = append(listThough, item.FinalAnswer) } } j, err := json.Marshal(listThough) imageUrl := "" if snapshotPost.Token != "" { imageUrl, _ = s.GetChartImage(ctx, snapshotPost.Token) } action := &models.AgentSnapshotPostAction{ NetworkID: snapshotPost.AgentInfo.NetworkID, AgentInfoID: snapshotPost.AgentInfo.ID, AgentSnapshotPostID: snapshotPostID, AgentSnapshotMissionID: snapshotPost.AgentSnapshotMissionID, AgentTwitterId: snapshotPost.AgentInfo.TwitterID, Content: string(j), Status: status, ScheduleAt: helpers.TimeNow(), ReqRefID: snapshotPost.InferTxHash, ToolSet: snapshotPost.AgentSnapshotMission.ToolSet, Tweetid: snapshotPost.OrgTweetID, TokenImageUrl: imageUrl, } if snapshotPost.OrgTweetID != "" { action.ConversationId = s.GetConversationIdByTweetID(daos.GetDBMainCtx(ctx), snapshotPost.OrgTweetID) } switch snapshotPost.AgentSnapshotMission.ToolSet { case models.ToolsetTypeTradeAnalyticsOnTwitter: { action.Type = models.AgentSnapshotPostActionTypeTweetMulti } case models.ToolsetTypeTradeAnalyticsMentions: { if snapshotPost.OrgTweetID == "" { action.Status = models.AgentSnapshotPostActionStatusInvalid } action.Type = models.AgentSnapshotPostActionTypeReplyMulti } case models.ToolsetTypeLuckyMoneys: { action.Type = models.AgentSnapshotPostActionTypeTweet } case models.ToolsetTypeLaunchpadJoin: { action.Type = models.AgentSnapshotPostActionTypeLaunchpadJoin } } err = s.dao.Create( daos.GetDBMainCtx(ctx), action, ) if err != nil { return errs.NewError(err) } if action.Type == models.AgentSnapshotPostActionTypeLaunchpadJoin { err = s.AgentSnapshotPostActionExecuted(ctx, action.ID) if err != nil { return errs.NewError(err) } } } } return nil }() return err }, ) if err != nil { return errs.NewError(err) } return nil } func (s *Service) JobUpdateOffchainAutoOutputForMission(ctx context.Context) error { err := s.JobRunCheck( ctx, "JobUpdateOffchainAutoOutputForMission", func() error { var retErr error { err := s.UpdateOffchainAutoOutputForMission(ctx) if err != nil { retErr = errs.MergeError(retErr, err) } } return retErr }, ) if err != nil { return errs.NewError(err) } return nil } func (s *Service) JobUpdateOffchainAutoOutput(ctx context.Context) error { err := s.JobRunCheck( ctx, "JobUpdateOffchainAutoOutput", func() error { var retErr error { ms, err := s.dao.FindAgentSnapshotPostAction(daos.GetDBMainCtx(ctx), map[string][]interface{}{ "created_at <= adddate(now(), interval -5 minute)": {}, "created_at >= adddate(now(), interval -30 minute)": {}, "agent_snapshot_post_id > 0": {}, }, map[string][]interface{}{}, []string{ "rand()", }, 0, 999999, ) if err != nil { return errs.NewError(err) } for _, m := range ms { err := s.UpdateOffchainAutoOutputV2(ctx, m.AgentSnapshotPostID) if err != nil { retErr = errs.MergeError(retErr, errs.NewErrorWithId(err, m.AgentSnapshotPostID)) } } } { ms, err := s.dao.FindAgentWalletAction(daos.GetDBMainCtx(ctx), map[string][]interface{}{ "created_at <= adddate(now(), interval -5 minute)": {}, "created_at >= adddate(now(), interval -30 minute)": {}, "agent_snapshot_post_id > 0": {}, }, map[string][]interface{}{}, []string{ "rand()", }, 0, 999999, ) if err != nil { return errs.NewError(err) } for _, m := range ms { err := s.UpdateOffchainAutoOutputV2(ctx, m.AgentSnapshotPostID) if err != nil { retErr = errs.MergeError(retErr, errs.NewErrorWithId(err, m.ID)) } } } return retErr }, ) if err != nil { return errs.NewError(err) } return nil } func (s *Service) UpdateOffchainAutoOutputForMission(ctx context.Context) error { var retErr error joinFilters := map[string][]interface{}{ ` left join agent_snapshot_missions on agent_snapshot_missions.id = agent_snapshot_posts.agent_snapshot_mission_id `: {}, } selected := []string{ "agent_snapshot_posts.*", } ms, err := s.dao.FindAgentSnapshotPostJoinSelect(daos.GetDBMainCtx(ctx), selected, joinFilters, map[string][]interface{}{ "agent_snapshot_posts.created_at >= adddate(now(), interval -12 hour)": {}, "agent_snapshot_missions.tool_set in (?) or agent_snapshot_posts.agent_store_mission_id > 0": {[]models.ToolsetType{models.ToolsetTypeTradeAnalyticsOnTwitter, models.ToolsetTypeTradeAnalyticsMentions, models.ToolsetTypeLuckyMoneys, models.ToolsetTypeMissionStore}}, "agent_snapshot_posts.status = ?": {models.AgentSnapshotPostStatusInferSubmitted}, }, map[string][]interface{}{}, []string{}, 1, 50, ) if err != nil { return errs.NewError(err) } for _, m := range ms { err := s.UpdateOffchainAutoOutputV2(ctx, m.ID) if err != nil { retErr = errs.MergeError(retErr, errs.NewErrorWithId(err, m.ID)) } } return retErr } func (s *Service) JobUpdateOffchainAutoOutput3Hour(ctx context.Context) error { err := s.JobRunCheck( ctx, "JobUpdateOffchainAutoOutput3Hour", func() error { var retErr error { ms, err := s.dao.FindAgentSnapshotPost(daos.GetDBMainCtx(ctx), map[string][]interface{}{ "created_at <= adddate(now(), interval -2 hour)": {}, "created_at >= adddate(now(), interval -3 hour)": {}, "status = ?": {models.AgentSnapshotPostStatusInferSubmitted}, }, map[string][]interface{}{}, []string{ "rand()", }, 0, 999999, ) if err != nil { return errs.NewError(err) } for _, m := range ms { err := s.UpdateOffchainAutoOutputV2(ctx, m.ID) if err != nil { retErr = errs.MergeError(retErr, errs.NewErrorWithId(err, m.ID)) } } } { ms, err := s.dao.FindAgentSnapshotPost(daos.GetDBMainCtx(ctx), map[string][]interface{}{ "created_at <= adddate(now(), interval -24 hour)": {}, "created_at >= adddate(now(), interval -36 hour)": {}, "status = ?": {models.AgentSnapshotPostStatusInferSubmitted}, }, map[string][]interface{}{}, []string{ "rand()", }, 0, 999999, ) if err != nil { return errs.NewError(err) } for _, m := range ms { err := s.UpdateOffchainAutoOutputV2(ctx, m.ID) if err != nil { retErr = errs.MergeError(retErr, errs.NewErrorWithId(err, m.ID)) } } } { ms, err := s.dao.FindAgentSnapshotPostAction(daos.GetDBMainCtx(ctx), map[string][]interface{}{ "created_at <= adddate(now(), interval -2 hour)": {}, "created_at >= adddate(now(), interval -3 hour)": {}, "agent_snapshot_post_id > 0": {}, }, map[string][]interface{}{}, []string{ "rand()", }, 0, 999999, ) if err != nil { return errs.NewError(err) } for _, m := range ms { err := s.UpdateOffchainAutoOutputV2(ctx, m.AgentSnapshotPostID) if err != nil { retErr = errs.MergeError(retErr, errs.NewErrorWithId(err, m.ID)) } } } { ms, err := s.dao.FindAgentWalletAction(daos.GetDBMainCtx(ctx), map[string][]interface{}{ "created_at <= adddate(now(), interval -2 hour)": {}, "created_at >= adddate(now(), interval -3 hour)": {}, "agent_snapshot_post_id > 0": {}, }, map[string][]interface{}{}, []string{ "rand()", }, 0, 999999, ) if err != nil { return errs.NewError(err) } for _, m := range ms { err := s.UpdateOffchainAutoOutputV2(ctx, m.AgentSnapshotPostID) if err != nil { retErr = errs.MergeError(retErr, errs.NewErrorWithId(err, m.ID)) } } } return retErr }, ) if err != nil { return errs.NewError(err) } return nil } func (s *Service) getTaskToolSet(assistant *models.AgentInfo, taskReq string) (string, string) { task := taskReq toolset := "" switch taskReq { case "reply_mentions": task = "reply" toolset = "" case "reply_non_mentions": task = "react_agent" toolset = "reply_non_mentions" case "follow": task = "react_agent" toolset = "follow" case "post": task = "react_agent" toolset = "post" case "quote_tweet": task = "react_agent" toolset = "quote_tweet" case "inscribe_tweet": task = "react_agent" toolset = "inscribe_tweet" case "shadow_reply": task = "shadow_reply" toolset = "" case "issue_token": task = "react_agent" toolset = "issue_token" case "tweet_news": task = "tweet_news" toolset = "" case "lucky_moneys": task = "lucky_moneys" toolset = "lucky_moneys" } if assistant != nil { if assistant.NetworkID == models.HERMES_CHAIN_ID && assistant.AgentContractID == "2" { // @thetickerisbot switch taskReq { case "quote_tweet": task = "quote_tweet" toolset = "" } } if assistant.NetworkID == models.BASE_CHAIN_ID && assistant.AgentContractID == "40" { // @thetickerisbot switch taskReq { case "quote_tweet": task = "quote_tweet" toolset = "" } } } return task, toolset } func (s *Service) callWakeup(logRequest *models.AgentSnapshotPost, assistant *models.AgentInfo) (string, error) { if assistant != nil { logRequest.AgentBaseModel = assistant.AgentBaseModel } var agentMetaDataRequest models.AgentMetadataRequest err := helpers.ConvertJsonObject(logRequest.AgentMetaData, &agentMetaDataRequest) if err != nil { return "", errs.NewError(err) } agentMetaDataRequest.KbAgents = []models.AgentWakeupKnowledgeBase{} request := &models.CallWakeupRequest{ Toolkit: []interface{}{}, Prompt: logRequest.UserPrompt, SystemPrompt: logRequest.SystemPrompt, Task: logRequest.Task, Toolset: logRequest.Toolset, Model: logRequest.AgentBaseModel, AgentMetaData: agentMetaDataRequest, ToolList: logRequest.ToolList, MetaData: models.WakeupRequestMetadata{ RefID: logRequest.InferTxHash, SystemReminder: logRequest.SystemReminder, // DONT USE system reminder from assistant Params: models.ParamWakeupRequest{ QuoteUsername: "cryptopunksbot", ReactMaxSteps: logRequest.ReactMaxSteps, }, }, } if assistant != nil { request.MetaData.TwitterId = assistant.TwitterID request.MetaData.TwitterUsername = assistant.TwitterUsername request.MetaData.AgentContractId = assistant.AgentContractID request.MetaData.ChainId = strconv.Itoa(int(assistant.NetworkID)) request.MetaData.KnowledgeBaseId = assistant.KnowledgeBaseID knowledgeAgentsUsed, _ := s.KnowledgeUsecase.GetKBAgentsUsedOfSocialAgent(context.Background(), assistant.ID) if len(knowledgeAgentsUsed) > 0 { for _, item := range knowledgeAgentsUsed { itemAdd := models.AgentWakeupKnowledgeBase{ KbId: item.KbId, } if item.AgentInfo != nil { itemAdd.ChainId = fmt.Sprintf("%v", item.AgentInfo.NetworkID) } if request.AgentMetaData.KbAgents == nil { request.AgentMetaData.KbAgents = []models.AgentWakeupKnowledgeBase{} } request.AgentMetaData.KbAgents = append(request.AgentMetaData.KbAgents, itemAdd) } } request.MetaData.TwitterUsername = assistant.TwitterUsername } else { request.MetaData.ChainId = strconv.Itoa(int(logRequest.NetworkID)) request.MetaData.AgentContractId = "1" } body, err := helpers.CurlURLString( s.conf.AgentOffchain.Url+"/async/enqueue", "POST", map[string]string{ "x-token": s.conf.AgentOffchain.ApiKey, }, &request, ) input, _ := json.Marshal(request) logger.Info("callWakeup", "async_enqueue", zap.Any("url", s.conf.AgentOffchain.Url+"/async/enqueue"), zap.Any("input", string(input)), zap.Any("output", body), zap.Any("err", err)) if err != nil { return "", errs.NewError(err) } return body, err } func (s *Service) BatchPromptItemV2(ctx context.Context, agentInfo *models.AgentInfo, request *models.AgentSnapshotPost) (*models.AgentSnapshotPost, error) { if agentInfo != nil && agentInfo.TwitterUsername == "" && agentInfo.FarcasterID == "" { return request, errs.NewError(errs.ErrBadRequest) } if request.ToolList != "" { request.Toolset = "react_agent" } request.Task, request.Toolset = s.getTaskToolSet(agentInfo, string(request.Toolset)) if len(request.HeadSystemPrompt) > 0 { request.SystemPrompt = request.HeadSystemPrompt + "\n\n" + request.SystemPrompt } if request.InferTxHash == "" { request.InferTxHash = helpers.RandomBigInt(12).Text(16) } body, err := s.callWakeup(request, agentInfo) if err != nil { return request, errs.NewError(err) } output := make(map[string]interface{}) if err := json.Unmarshal([]byte(body), &output); err != nil { return request, errs.NewError(err) } id, ok := output["id"].(string) if ok { request.ResponseId = id } return request, nil } func (s *Service) JobAgentSnapshotPostStatusInferRefund(ctx context.Context) error { err := s.JobRunCheck( ctx, "JobAgentSnapshotPostStatusInferRefund", func() error { var retErr error { ms, err := s.dao.FindAgentSnapshotPost(daos.GetDBMainCtx(ctx), map[string][]interface{}{ "status = ?": {models.AgentSnapshotPostStatusInferFailed}, "agent_info_id > 0": {}, "agent_snapshot_mission_id > 0": {}, }, map[string][]interface{}{}, []string{}, 0, 999999, ) if err != nil { return errs.NewError(err) } for _, m := range ms { err := s.AgentSnapshotPostStatusInferRefund(ctx, m.ID) if err != nil { retErr = errs.MergeError(retErr, errs.NewErrorWithId(err, m.ID)) } } // ms, err = s.dao.FindAgentSnapshotPost(daos.GetDBMainCtx(ctx), // map[string][]interface{}{ // "status = ?": {models.AgentSnapshotPostStatusInferError}, // "agent_info_id > 0": {}, // "agent_snapshot_mission_id > 0": {}, // "fee > 0": {}, // }, // map[string][]interface{}{}, // []string{}, 0, 999999, // ) // if err != nil { // return errs.NewError(err) // } // for _, m := range ms { // err := s.AgentSnapshotPostStatusInferRefund(ctx, m.ID) // if err != nil { // retErr = errs.MergeError(retErr, errs.NewErrorWithId(err, m.ID)) // } // } } return retErr }, ) if err != nil { return errs.NewError(err) } return nil } func (s *Service) AgentSnapshotPostStatusInferRefund(ctx context.Context, snapshotPostID uint) error { err := s.JobRunCheck( ctx, fmt.Sprintf("AgentSnapshotPostStatusInferRefund_%d", snapshotPostID), func() error { err := daos.WithTransaction( daos.GetDBMainCtx(ctx), func(tx *gorm.DB) error { inferPost, err := s.dao.FirstAgentSnapshotPostByID( tx, snapshotPostID, map[string][]interface{}{ "AgentInfo": {}, "AgentStore.Owner": {}, "User": {}, }, true, ) if err != nil { return errs.NewError(err) } if inferPost != nil && inferPost.Status == models.AgentSnapshotPostStatusInferFailed && inferPost.AgentInfo != nil && inferPost.AgentSnapshotMissionID > 0 { // toolSet, err := s.dao.GetMissionToolset(tx, inferPost.AgentSnapshotMissionID) if err != nil { return errs.NewError(err) } // err = tx.Model(inferPost). UpdateColumn("status", models.AgentSnapshotPostStatusInferRefund). Error if err != nil { return errs.NewError(err) } if inferPost.AgentInfoID <= 0 { if inferPost.UserID > 0 { user := inferPost.User err = tx.Model(user). UpdateColumn("eai_balance", gorm.Expr("eai_balance + ?", inferPost.Fee)). Error if err != nil { return errs.NewError(err) } _ = s.dao.Create( tx, &models.UserTransaction{ NetworkID: inferPost.NetworkID, EventId: fmt.Sprintf("agent_trigger_refund_%d", inferPost.ID), UserID: user.ID, Type: models.UserTransactionTypeTriggerRefundFee, Amount: inferPost.Fee, Status: models.UserTransactionStatusDone, }, ) } } else { agentInfo := inferPost.AgentInfo err = tx.Model(agentInfo). UpdateColumn("eai_balance", gorm.Expr("eai_balance + ?", inferPost.Fee)). Error if err != nil { return errs.NewError(err) } _ = s.dao.Create( tx, &models.AgentEaiTopup{ NetworkID: agentInfo.NetworkID, EventId: fmt.Sprintf("agent_trigger_refund_%d", inferPost.ID), AgentInfoID: agentInfo.ID, Type: models.AgentEaiTopupTypeRefund, Amount: inferPost.Fee, Status: models.AgentEaiTopupStatusDone, DepositAddress: agentInfo.ETHAddress, ToAddress: agentInfo.ETHAddress, Toolset: toolSet, }, ) } } if inferPost != nil && inferPost.Status == models.AgentSnapshotPostStatusInferError && inferPost.AgentInfo != nil && inferPost.AgentSnapshotMissionID > 0 { agentInfo := inferPost.AgentInfo err = tx.Model(agentInfo). UpdateColumn("eai_balance", gorm.Expr("eai_balance + ?", inferPost.Fee)). Error if err != nil { return errs.NewError(err) } err = tx.Model(inferPost).Updates( map[string]interface{}{ "fee": numeric.NewBigFloatFromString("0"), }, ). Error if err != nil { return errs.NewError(err) } } return nil }, ) if err != nil { return errs.NewError(err) } return nil }, ) if err != nil { return errs.NewError(err) } return nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/agent_abilities_luckymoney.go ================================================ package services import ( "context" "fmt" "math" "math/big" "strings" "time" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/configs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/daos" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/helpers" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" blockchainutils "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/blockchain_utils" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/types/numeric" "github.com/jinzhu/gorm" ) func (s *Service) JobLuckyMoneyActionExecuted(ctx context.Context) error { err := s.JobRunCheck( ctx, "JobLuckyMoneyActionExecuted", func() error { var retErr error { ms, err := s.dao.FindAgentSnapshotPost(daos.GetDBMainCtx(ctx), map[string][]interface{}{ "toolset = ?": {models.ToolsetTypeLuckyMoneys}, "status = ?": {models.AgentSnapshotPostStatusInferSubmitted}, }, map[string][]interface{}{}, []string{ "updated_at asc", }, 0, 10, ) if err != nil { return errs.NewError(err) } for _, m := range ms { err := s.LuckyMoneyActionExecuted(ctx, m.ID) if err != nil { retErr = errs.MergeError(retErr, errs.NewErrorWithId(err, m.ID)) } } } return retErr }, ) if err != nil { return errs.NewError(err) } return nil } func (s *Service) LuckyMoneyActionExecuted(ctx context.Context, snapshotPostID uint) error { err := s.JobRunCheck( ctx, fmt.Sprintf("LuckyMoneyActionExecuted_%d", snapshotPostID), func() error { err := func() error { err := daos.WithTransaction( daos.GetDBMainCtx(ctx), func(tx *gorm.DB) error { snapshotPost, err := s.dao.FirstAgentSnapshotPostByID( tx, snapshotPostID, map[string][]interface{}{}, true, ) if err != nil { return errs.NewError(err) } if snapshotPost != nil && models.ToolsetType(snapshotPost.Toolset) == models.ToolsetTypeLuckyMoneys { randomTime := helpers.TimeNow().Add(time.Minute * time.Duration(helpers.RandomInt(5, 40))) content, err := s.LuckyMoneyGetPostContent(tx, snapshotPost.AgentInfoID, snapshotPost.AgentSnapshotMissionID) if err != nil { return errs.NewError(err) } if content == "" { return errs.NewError(errs.ErrBadContent) } agentInfo, err := s.dao.FirstAgentInfoByID(tx, snapshotPost.AgentInfoID, map[string][]interface{}{}, false) if err != nil { return errs.NewError(err) } mission, err := s.dao.FirstAgentSnapshotMissionByID(tx, snapshotPost.AgentSnapshotMissionID, map[string][]interface{}{}, false) if err != nil { return errs.NewError(err) } status := models.AgentSnapshotPostActionStatusNew if mission != nil { if mission.IsTesting { status = models.AgentSnapshotPostActionStatusTesting } } if agentInfo.TokenNetworkID > 0 && agentInfo.TokenAddress != "" { action := &models.AgentSnapshotPostAction{ NetworkID: snapshotPost.NetworkID, AgentInfoID: snapshotPost.AgentInfoID, AgentSnapshotPostID: snapshotPostID, AgentSnapshotMissionID: snapshotPost.AgentSnapshotMissionID, AgentTwitterId: agentInfo.TwitterID, ScheduleAt: &randomTime, ReqRefID: snapshotPost.InferTxHash, ToolSet: models.ToolsetType(snapshotPost.Toolset), Content: content, Status: status, Type: models.AgentSnapshotPostActionTypeTweet, RewardUser: mission.RewardUser, RewardAmount: mission.RewardAmount, } err = s.dao.Create(tx, action) if err != nil { return errs.NewError(err) } snapshotPost.Status = models.AgentSnapshotPostStatusInferResolved } else { snapshotPost.Status = models.AgentSnapshotPostStatusInvalid } err = s.dao.Save(tx, snapshotPost) if err != nil { return errs.NewError(err) } } return nil }, ) if err != nil { return errs.NewError(err) } return nil }() return err }, ) if err != nil { return errs.NewError(err) } return nil } func (s *Service) LuckyMoneyGetPostContent(tx *gorm.DB, agentInfoID, missionID uint) (string, error) { postContent := "" agentInfo, err := s.dao.FirstAgentInfoByID(tx, agentInfoID, map[string][]interface{}{}, false) if err != nil { return postContent, errs.NewError(err) } missionInfo, err := s.dao.FirstAgentSnapshotMissionByID(tx, missionID, map[string][]interface{}{}, false) if err != nil { return postContent, errs.NewError(err) } if agentInfo != nil && missionInfo != nil { rewardAmount, _ := missionInfo.RewardAmount.Float64() minTokenHolding, _ := missionInfo.MinTokenHolding.Float64() strMinHolding := fmt.Sprintf(`(holding min %0.f tokens $%s)`, minTokenHolding, agentInfo.TokenSymbol) if minTokenHolding == 0 { strMinHolding = "" } postContent = fmt.Sprintf(` New Year Red Envelope! 🎉 Celebrate the Lunar New Year with a token of luck and prosperity. The first %d comments with a valid %s address %s will receive %0.f $EAI tokens. Wishing everyone a year filled with success, happiness, and good fortune! 🧧`, missionInfo.RewardUser, models.GetChainName(agentInfo.TokenNetworkID), strMinHolding, rewardAmount, ) // userPrompt := fmt.Sprintf(` // Rewrite this for a Twitter post, don't change symbol token $EAI or $%s: // "Lucky Money Giveaway! 💸 Total %0.f tokens $EAI up for grabs! First %d comments with an %s address %s win! 🚀 Fastest fingers only!" // Return a JSON response with the following format: // {"content": ""} // Respond with only the JSON string, without any additional explanation. // `, agentInfo.TokenSymbol, rewardAmount, missionInfo.RewardUser, models.GetChainName(agentInfo.TokenNetworkID), strMinHolding) // fmt.Println(userPrompt) // aiStr, err := s.openais["Lama"].ChatMessageWithSystemPromp(strings.TrimSpace(userPrompt), agentInfo.GetSystemPrompt()) // if err != nil { // return postContent, nil // } // if aiStr != "" { // mapInfo := helpers.ExtractMapInfoFromOpenAI(aiStr) // if mapInfo != nil { // if v, ok := mapInfo["content"]; ok { // postContent = fmt.Sprintf(`%v`, v) // } // } // } } fmt.Println(postContent) return postContent, nil } func (s *Service) JobLuckyMoneyCollectPost(ctx context.Context) error { err := s.JobRunCheck( ctx, "JobLuckyMoneyCollectPost", func() error { var retErr error actions, err := s.dao.FindAgentSnapshotPostActionJoin( daos.GetDBMainCtx(ctx), map[string][]interface{}{ "join agent_snapshot_missions on agent_snapshot_missions.id = agent_snapshot_post_actions.agent_snapshot_mission_id": {}, "join agent_infos on agent_infos.id = agent_snapshot_post_actions.agent_info_id": {}, }, map[string][]interface{}{ "agent_snapshot_post_actions.status = ?": {models.AgentSnapshotPostActionStatusDone}, "agent_snapshot_post_actions.tool_set = ?": {models.ToolsetTypeLuckyMoneys}, `( agent_infos.agent_type = 1 and agent_infos.reply_enabled = true )`: {}, `( agent_snapshot_missions.enabled = 1 and agent_snapshot_missions.reply_enabled = 1 and agent_snapshot_missions.interval_sec > 0 and agent_snapshot_missions.is_testing = 0 and agent_snapshot_missions.deleted_at is null )`: {}, "agent_snapshot_post_actions.created_at >= adddate(now(), interval -2 day)": {}, }, map[string][]interface{}{}, []string{ "rand()", }, 0, 100, ) if err != nil { return errs.NewError(err) } for _, action := range actions { err = s.LuckyMoneyCollectPost(ctx, action.ID) if err != nil { return errs.NewError(err) } err = s.LuckyMoneyValidateRewardUser(ctx, action.ID) if err != nil { return errs.NewError(err) } } return retErr }, ) if err != nil { return errs.NewError(err) } return nil } func (s *Service) LuckyMoneyCollectPost(ctx context.Context, missionID uint) error { err := s.JobRunCheck( ctx, fmt.Sprintf("LuckyMoneyCollectPost_%d", missionID), func() error { err := daos.WithTransaction( daos.GetDBMainCtx(ctx), func(tx *gorm.DB) error { snapshotPostAction, err := s.dao.FirstAgentSnapshotPostActionByID( tx, missionID, map[string][]interface{}{ "AgentSnapshotMission": {}, "AgentSnapshotPost": {}, "AgentInfo": {}, }, false, ) if err != nil { return errs.NewError(err) } if snapshotPostAction.AgentInfo != nil && snapshotPostAction.AgentSnapshotPost != nil && snapshotPostAction.AgentSnapshotMission != nil && snapshotPostAction.Status == models.AgentSnapshotPostActionStatusDone { twitterInfo, err := s.dao.FirstTwitterInfo(tx, map[string][]interface{}{ "twitter_id = ?": {s.conf.TokenTwiterIdForInternal}, }, map[string][]interface{}{}, false, ) if err != nil { return errs.NewError(err) } if twitterInfo != nil { query := fmt.Sprintf("conversation_id:%s", snapshotPostAction.RefId) tweetRecentSearch, err := s.twitterWrapAPI.SearchRecentTweet(query, "", twitterInfo.AccessToken, 50) if err != nil { return errs.NewTwitterError(err) } for _, v := range tweetRecentSearch.LookUps { existPosts, err := s.dao.FirstAbilityLuckyMoney( tx, map[string][]interface{}{ "tweet_id = ?": {v.Tweet.ID}, }, map[string][]interface{}{}, []string{}, ) if err != nil { return errs.NewError(err) } if existPosts == nil { postedAt := helpers.ParseStringToDateTimeTwitter(v.Tweet.CreatedAt) fullText := v.Tweet.NoteTweet.Text if fullText == "" { fullText = v.Tweet.Text } rewardAmount := models.QuoBigFloats(&snapshotPostAction.AgentSnapshotMission.RewardAmount.Float, big.NewFloat(float64(snapshotPostAction.AgentSnapshotMission.RewardUser))) userAddress := helpers.ExtractEtherAddress(fullText) if snapshotPostAction.AgentInfo.TokenNetworkID == models.SOLANA_CHAIN_ID { userAddress = s.ExtractSolAddress(fullText) } tokenBalance := big.NewFloat(0) if snapshotPostAction.AgentInfo.TokenAddress != "" && userAddress != "" { if snapshotPostAction.AgentInfo.TokenNetworkID != models.SOLANA_CHAIN_ID { balance, err := s.GetEthereumClient(ctx, snapshotPostAction.AgentInfo.TokenNetworkID).Erc20Balance(snapshotPostAction.AgentInfo.TokenAddress, userAddress) if err != nil { fmt.Println(err.Error()) } tokenBalance = models.ConvertWeiToBigFloat(balance, 18) } else { userBalance, _ := s.blockchainUtils.SolanaBalanceByToken(userAddress, snapshotPostAction.AgentInfo.TokenAddress) if userBalance != nil { tokenBalance = big.NewFloat(userBalance.UIAmount) } } } m := &models.AbilityLuckyMoney{ NetworkID: snapshotPostAction.AgentInfo.NetworkID, AgentInfoID: snapshotPostAction.AgentInfo.ID, AgentSnapshotMissionID: snapshotPostAction.AgentSnapshotMissionID, AgentSnapshotPostID: snapshotPostAction.AgentSnapshotPostID, AgentSnapshotPostActionID: snapshotPostAction.ID, TwitterID: v.User.ID, TwitterUsername: v.User.UserName, TwitterName: v.User.Name, TweetID: v.Tweet.ID, Content: fullText, Status: models.LuckyMoneyStatusNew, TweetAt: postedAt, UserAddress: userAddress, RewardAmount: numeric.NewBigFloatFromFloat(rewardAmount), TokenBalance: numeric.BigFloat{*tokenBalance}, } //require min token holding if userAddress == "" || tokenBalance.Cmp(&snapshotPostAction.AgentSnapshotMission.MinTokenHolding.Float) < 0 { m.Status = models.LuckyMoneyStatusInvalid } //exits user twitter_id or user address if m.Status == models.LuckyMoneyStatusNew { existReward, err := s.dao.FirstAbilityLuckyMoney( tx, map[string][]interface{}{ "twitter_id = ? or user_address = ?": {v.User.ID, userAddress}, "agent_snapshot_post_action_id = ?": {snapshotPostAction.ID}, "status in (?)": {[]models.LuckyMoneyStatus{models.LuckyMoneyStatusNew, models.LuckyMoneyStatusDone, models.LuckyMoneyStatusProcessing}}, }, map[string][]interface{}{}, []string{}, ) if err != nil { return errs.NewError(err) } if existReward != nil { m.Status = models.LuckyMoneyStatusInvalid } } err = s.dao.Create(tx, m) if err != nil { return errs.NewError(err) } } } } } return nil }, ) if err != nil { return errs.NewError(err) } return nil }, ) if err != nil { return errs.NewError(err) } return nil } func (s *Service) ExtractSolAddress(content string) string { arrStr := strings.Split(content, " ") for _, item := range arrStr { item = strings.TrimSpace(item) if len(item) >= 32 && len(item) <= 45 { isValid, _ := s.blockchainUtils.SolanaValidateAddress(item) if isValid { return item } } } return "" } func (s *Service) LuckyMoneyValidateRewardUser(ctx context.Context, actionID uint) error { err := s.JobRunCheck( ctx, fmt.Sprintf("LuckyMoneyPayToUser_%d", actionID), func() error { err := daos.WithTransaction( daos.GetDBMainCtx(ctx), func(tx *gorm.DB) error { snapshotPostAction, err := s.dao.FirstAgentSnapshotPostActionByID( tx, actionID, map[string][]interface{}{}, false, ) if err != nil { return errs.NewError(err) } userPosts, err := s.dao.FindAbilityLuckyMoney( tx, map[string][]interface{}{ "agent_snapshot_post_action_id = ? ": {actionID}, "status in (?)": {[]models.LuckyMoneyStatus{models.LuckyMoneyStatusNew, models.LuckyMoneyStatusDone, models.LuckyMoneyStatusProcessing}}, }, map[string][]interface{}{}, []string{"tweet_at asc"}, 0, snapshotPostAction.RewardUser, ) if err != nil { return errs.NewError(err) } if userPosts != nil { for _, item := range userPosts { if item.Status == models.LuckyMoneyStatusNew { item.Status = models.LuckyMoneyStatusProcessing err = s.dao.Save(tx, item) if err != nil { return errs.NewError(err) } } } if len(userPosts) == snapshotPostAction.RewardUser { _ = daos.GetDBMainCtx(ctx).Model(snapshotPostAction).Updates( map[string]interface{}{ "status": models.AgentSnapshotPostActionStatusPaid, }, ).Error } } return nil }, ) if err != nil { return errs.NewError(err) } return nil }, ) if err != nil { return errs.NewError(err) } return nil } func (s *Service) JobLuckyMoneyProcessUserReward(ctx context.Context) error { err := s.JobRunCheck( ctx, "JobLuckyMoneyCollectPost", func() error { var retErr error actions, err := s.dao.FindAbilityLuckyMoney( daos.GetDBMainCtx(ctx), map[string][]interface{}{ "status = ?": {models.LuckyMoneyStatusProcessing}, }, map[string][]interface{}{}, []string{}, 0, 100, ) if err != nil { return errs.NewError(err) } for _, action := range actions { err = s.LuckyMoneyProcessUserReward(ctx, action.ID) if err != nil { retErr = errs.MergeError(retErr, errs.NewErrorWithId(err, action.ID)) } } return retErr }, ) if err != nil { return errs.NewError(err) } return nil } func (s *Service) LuckyMoneyProcessUserReward(ctx context.Context, luckyID uint) error { err := s.JobRunCheck( ctx, fmt.Sprintf("LuckyMoneyProcessUserReward_%d", luckyID), func() error { err := daos.WithTransaction( daos.GetDBMainCtx(ctx), func(tx *gorm.DB) error { m, err := s.dao.FirstAbilityLuckyMoneyByID( tx, luckyID, map[string][]interface{}{}, true, ) if err != nil { return errs.NewError(err) } if m != nil && m.Status == models.LuckyMoneyStatusProcessing { err = tx.Model(&models.AgentInfo{}). Where("id = ?", m.AgentInfoID). UpdateColumn("eai_balance", gorm.Expr("eai_balance - ?", m.RewardAmount)). Error if err != nil { return errs.NewError(err) } agentInfo, err := s.dao.FirstAgentInfoByID( tx, m.AgentInfoID, map[string][]interface{}{}, false, ) if err != nil { return errs.NewError(err) } if agentInfo.EaiBalance.Float.Cmp(big.NewFloat(0)) < 0 { return errs.NewError(errs.ErrBadRequest) } var txHash string eaiAddress := strings.ToLower(s.conf.GetConfigKeyString(agentInfo.TokenNetworkID, "eai_contract_address")) if eaiAddress != "" { luckyMoneyAdminAddress := strings.ToLower(s.conf.LuckyMoneyAdminAddress) if agentInfo.TokenNetworkID == models.SOLANA_CHAIN_ID { luckyMoneyAdminAddress = strings.ToLower(s.conf.LuckyMoneyAdminAddressSol) decimalsMint := 9 if agentInfo.TokenAddress != "" { decimalsMint, err = s.GetSolanaTokenDecimals(agentInfo.TokenAddress) if err != nil { return errs.NewError(errs.ErrBadRequest) } } rAmount, _ := m.RewardAmount.Float.Float64() transferReq := &blockchainutils.SolanaTransferReq{ Mint: eaiAddress, Amount: rAmount * math.Pow10(decimalsMint), ToAddress: m.UserAddress, } if luckyMoneyAdminAddress == "" { return errs.NewError(errs.ErrBadRequest) } txHash, err = s.blockchainUtils.SolanaTransfer(luckyMoneyAdminAddress, transferReq) } else { if luckyMoneyAdminAddress == "" { return errs.NewError(errs.ErrBadRequest) } txHash, err = s.GetEthereumClient(ctx, agentInfo.TokenNetworkID).Erc20Transfer( eaiAddress, s.GetAddressPrk(luckyMoneyAdminAddress), m.UserAddress, models.ConvertBigFloatToWei(&m.RewardAmount.Float, 18).String(), ) } if err != nil { m.Error = err.Error() } else { m.TxHash = txHash m.Status = models.LuckyMoneyStatusDone } err = s.dao.Save(tx, m) if err != nil { return errs.NewError(err) } if m.Status == models.LuckyMoneyStatusDone { _ = s.dao.Create( tx, &models.AgentEaiTopup{ NetworkID: agentInfo.NetworkID, EventId: fmt.Sprintf("agent_lucky_money_%d", m.ID), AgentInfoID: agentInfo.ID, Type: models.AgentEaiTopupTypeSpent, Amount: m.RewardAmount, Status: models.AgentEaiTopupStatusDone, DepositAddress: m.UserAddress, ToAddress: m.UserAddress, Toolset: string(models.ToolsetTypeLuckyMoneys), }, ) } } //reply to user } return nil }, ) if err != nil { return errs.NewError(err) } return nil }, ) if err != nil { return errs.NewError(err) } return nil } func (s *Service) TestUtil() { // etherAddress := helpers.ExtractEtherAddress("yo 0x7c9d59cD31F27c7cBEEde2567c9fa377537bdDE0 😄😁😋") // fmt.Println(etherAddress) // resp, err := helpers.GetBinancePrice24h(fmt.Sprintf(`%sUSDT`, "UOS")) // fmt.Println(resp.LastPrice) // fmt.Println(err) for _, item := range configs.BINANCE_TOKENS { if strings.HasSuffix(item, "/USDT") { fmt.Println(strings.Split(item, "/")[0]) } } } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/agent_abilities_telebot.go ================================================ package services import ( "context" "fmt" "strconv" "strings" "time" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/daos" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/mymmrac/telego" ) func (s *Service) RunTeleBotJob(ctx context.Context) error { err := s.JobEnabledDB(ctx) if err != nil { panic(err) } bot, err := telego.NewBot(s.conf.Telebot.TradeAnalytics.Botkey, telego.WithDefaultDebugLogger()) if err != nil { return errs.NewError(err) } updates, _ := bot.UpdatesViaLongPolling(nil) defer bot.StopLongPolling() for update := range updates { if update.Message != nil { m, err := s.dao.FirstAgentTeleMsg( daos.GetDBMainCtx(ctx), map[string][]interface{}{ "message_id = ?": {update.Message.MessageID}, }, map[string][]interface{}{}, []string{}, ) if err != nil { return errs.NewError(err) } if m == nil { agentSnapshotMission, err := s.dao.FirstAgentSnapshotMission( daos.GetDBMainCtx(ctx), map[string][]interface{}{ `tele_chat_id = ?`: {update.Message.Chat.ID}, }, map[string][]interface{}{}, []string{}, ) if err != nil { return errs.NewError(err) } if agentSnapshotMission != nil { msgDate := time.Unix(update.Message.Date, 0) m = &models.AgentTeleMsg{ MessageID: fmt.Sprintf(`%d`, update.Message.MessageID), MessageDate: &msgDate, Content: update.Message.Text, ChatID: fmt.Sprintf(`%d`, update.Message.Chat.ID), ChatUsername: update.Message.Chat.Username, AgentInfoID: agentSnapshotMission.AgentInfoID, AgentSnapshotMissionID: agentSnapshotMission.ID, Status: models.TeleMsgStatusNew, } err = s.dao.Create(daos.GetDBMainCtx(ctx), m) if err != nil { return errs.NewError(err) } } } } } return nil } func (s *Service) SendTeleMsgToChatID(ctx context.Context, content, chatID string) (string, error) { bot, err := telego.NewBot(s.conf.Telebot.TradeAnalytics.Botkey, telego.WithDefaultDebugLogger()) if err != nil { return "", errs.NewError(err) } i, err := strconv.ParseInt(chatID, 10, 64) if err != nil { return "", errs.NewError(err) } resp, err := bot.SendMessage( &telego.SendMessageParams{ ChatID: telego.ChatID{ ID: i, }, Text: strings.TrimSpace(content), }, ) if err != nil { return "", errs.NewError(err) } if resp != nil { return fmt.Sprintf(`%d`, resp.MessageID), nil } return "", nil } func (s *Service) SendTeleMsgToKBChannel(ctx context.Context, content, chatID string) (string, error) { bot, err := telego.NewBot(s.conf.KnowledgeBaseConfig.KBTelegramKey, telego.WithDefaultDebugLogger()) if err != nil { return "", errs.NewError(err) } defer bot.Close() i, err := strconv.ParseInt(chatID, 10, 64) if err != nil { return "", errs.NewError(err) } resp, err := bot.SendMessage( &telego.SendMessageParams{ ChatID: telego.ChatID{ ID: i, }, Text: strings.TrimSpace(content), }, ) if err != nil { return "", errs.NewError(err) } if resp != nil { return fmt.Sprintf(`%d`, resp.MessageID), nil } return "", nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/agent_abilities_twitter.go ================================================ package services import ( "context" "fmt" "strings" "time" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/daos" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/helpers" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/serializers" "github.com/jinzhu/gorm" ) func (s *Service) CreateAgentInternalAction(ctx context.Context, req *serializers.AdminAgentActionReq) error { agent, err := s.dao.FirstAgentInfo( daos.GetDBMainCtx(ctx), map[string][]interface{}{ "network_id = ?": {req.ChainID}, "agent_contract_id = ?": {req.AgentContractId}, }, map[string][]interface{}{}, []string{}, ) if err != nil { return errs.NewError(err) } if agent == nil || agent.TwitterInfoID == 0 { return errs.NewError(fmt.Errorf("agent is not found")) } err = daos.WithTransaction( daos.GetDBMainCtx(ctx), func(tx *gorm.DB) error { agent, err := s.dao.FirstAgentInfoByID( tx, agent.ID, map[string][]interface{}{}, false, ) if err != nil { return errs.NewError(err) } status := models.AgentSnapshotPostActionStatusNew if req.IsTesting { status = models.AgentSnapshotPostActionStatusTesting } var snapshotPostID, snapshotMissionID uint var toolSet models.ToolsetType if req.RefID != "" { snapshotPost, _ := s.dao.FirstAgentSnapshotPost( tx, map[string][]interface{}{ "infer_tx_hash = ?": {req.RefID}, }, map[string][]interface{}{ "AgentSnapshotMission": {}, }, []string{}, ) if snapshotPost != nil { snapshotPostID = snapshotPost.ID snapshotMissionID = snapshotPost.AgentSnapshotMissionID if snapshotPost.AgentSnapshotMission != nil { toolSet = snapshotPost.AgentSnapshotMission.ToolSet } } } else if req.MissionID > 0 { mission, _ := s.dao.FirstAgentSnapshotMissionByID( tx, req.MissionID, map[string][]interface{}{}, false, ) if mission != nil { snapshotMissionID = mission.ID toolSet = mission.ToolSet } } switch req.ActionType { case models.AgentSnapshotPostActionTypeFollow, models.AgentSnapshotPostActionTypeTweet, models.AgentSnapshotPostActionTypeReply, models.AgentSnapshotPostActionTypeRetweet, models.AgentSnapshotPostActionTypeQuoteTweet, models.AgentSnapshotPostActionTypeInscribeTweet, models.AgentSnapshotPostActionTypeTweetV2, models.AgentSnapshotPostActionTypeTweetMulti, models.AgentSnapshotPostActionTypeReplyMulti, models.AgentSnapshotPostActionTypeReplyMultiUnlimited: { content := req.ActionInput.Content if content == "" { content = req.ActionInput.Comment } tweetId := req.ActionInput.Twid if tweetId == "" { tweetId = req.ActionInput.TweetId } var conversationId string if req.ConversationId != "" { conversationId = req.ConversationId } else { if tweetId != "" { conversationId = s.GetConversationIdByTweetID(daos.GetDBMainCtx(ctx), tweetId) } } content = strings.TrimSpace(content) var followerCount uint var targetTwitterId string targetUsername := strings.TrimPrefix(req.ActionInput.TargetUsername, "@") if targetUsername != "" { } else if tweetId != "" { if content == "" { return errs.NewError(fmt.Errorf("content is missing")) } } err = s.dao.Create( tx, &models.AgentSnapshotPostAction{ NetworkID: agent.NetworkID, AgentInfoID: agent.ID, AgentSnapshotPostID: snapshotPostID, AgentSnapshotMissionID: snapshotMissionID, AgentTwitterId: agent.TwitterID, Type: req.ActionType, Tweetid: tweetId, TargetUsername: targetUsername, TargetTwitterId: targetTwitterId, Content: content, Status: status, FollowerCount: followerCount, ScheduleAt: helpers.TimeNow(), ReqRefID: req.RefID, ToolSet: toolSet, TokenImageUrl: req.ActionInput.ImageUrl, ConversationId: conversationId, InscribeTxHash: req.InscribeTxHash, BitcoinTxHash: req.BitcoinTxHash, Price: req.ActionInput.Price, }, ) if err != nil { return errs.NewError(err) } } case models.AgentSnapshotPostActionTypeCreateToken: { err = s.dao.Create( tx, &models.AgentSnapshotPostAction{ NetworkID: agent.NetworkID, AgentInfoID: agent.ID, AgentSnapshotPostID: snapshotPostID, AgentSnapshotMissionID: snapshotMissionID, AgentTwitterId: agent.TwitterID, Type: req.ActionType, Tweetid: req.ActionInput.Twid, TargetUsername: "", TargetTwitterId: "", Content: req.ActionInput.Content, Description: req.ActionInput.Description, TokenName: req.ActionInput.Name, TokenSymbol: req.ActionInput.Symbol, Status: status, FollowerCount: 0, ScheduleAt: helpers.TimeNow(), ReqRefID: req.RefID, ToolSet: toolSet, InscribeTxHash: req.InscribeTxHash, BitcoinTxHash: req.BitcoinTxHash, Price: req.ActionInput.Price, }, ) if err != nil { return errs.NewError(err) } } default: { content := req.ActionInput.Content if content == "" { content = req.ActionInput.Comment } tweetId := req.ActionInput.Twid if tweetId == "" { tweetId = req.ActionInput.TweetId } content = strings.TrimSpace(content) var followerCount uint var targetTwitterId string targetUsername := strings.TrimPrefix(req.ActionInput.TargetUsername, "@") if targetUsername != "" { } else if tweetId != "" { if content == "" { return errs.NewError(fmt.Errorf("content is missing")) } } err = s.dao.Create( tx, &models.AgentSnapshotPostAction{ NetworkID: agent.NetworkID, AgentInfoID: agent.ID, AgentSnapshotPostID: snapshotPostID, AgentSnapshotMissionID: snapshotMissionID, AgentTwitterId: agent.TwitterID, Type: req.ActionType, Tweetid: tweetId, TargetUsername: targetUsername, TargetTwitterId: targetTwitterId, Content: content, TokenImageUrl: req.ActionInput.ImageUrl, Status: models.AgentSnapshotPostActionStatusInvalid, FollowerCount: followerCount, ScheduleAt: helpers.TimeNow(), TokenName: req.ActionInput.Name, TokenSymbol: req.ActionInput.Symbol, ReqRefID: req.RefID, ToolSet: toolSet, InscribeTxHash: req.InscribeTxHash, BitcoinTxHash: req.BitcoinTxHash, Price: req.ActionInput.Price, }, ) if err != nil { return errs.NewError(err) } } } return nil }, ) if err != nil { return errs.NewError(err) } return nil } func (s *Service) CreateAgentInternalActionByRefID(ctx context.Context, refID string, req *serializers.AdminAgentActionByRefReq) error { err := daos.WithTransaction( daos.GetDBMainCtx(ctx), func(tx *gorm.DB) error { var snapshotPostID, snapshotMissionID uint var toolSet models.ToolsetType if refID != "" { snapshotPost, _ := s.dao.FirstAgentSnapshotPost( tx, map[string][]interface{}{ "infer_tx_hash = ?": {refID}, }, map[string][]interface{}{ "AgentSnapshotMission": {}, "AgentInfo": {}, }, []string{}, ) if snapshotPost != nil && snapshotPost.AgentInfo != nil && snapshotPost.AgentSnapshotMission != nil && snapshotPost.AgentSnapshotMission.ToolSet != models.ToolsetTypeTradeAnalyticsOnTwitter { snapshotPostID = snapshotPost.ID snapshotMissionID = snapshotPost.AgentSnapshotMissionID status := models.AgentSnapshotPostActionStatusNew if snapshotPost.AgentSnapshotMission != nil { toolSet = snapshotPost.AgentSnapshotMission.ToolSet if snapshotPost.AgentSnapshotMission.IsTesting { status = models.AgentSnapshotPostActionStatusTesting } } content := strings.TrimSpace(req.Reason) err := s.dao.Create( tx, &models.AgentSnapshotPostAction{ NetworkID: snapshotPost.AgentInfo.NetworkID, AgentInfoID: snapshotPost.AgentInfo.ID, AgentSnapshotPostID: snapshotPostID, AgentSnapshotMissionID: snapshotMissionID, AgentTwitterId: snapshotPost.AgentInfo.TwitterID, Type: req.ActionType, Content: content, Status: status, ScheduleAt: helpers.TimeNow(), ReqRefID: refID, ToolSet: toolSet, }, ) if err != nil { return errs.NewError(err) } } } return nil }, ) if err != nil { return errs.NewError(err) } return nil } func (s *Service) TweetByToken(ctx context.Context, agentInfoID uint, req *serializers.AdminTweetReq) error { agent, err := s.dao.FirstAgentInfoByID( daos.GetDBMainCtx(ctx), agentInfoID, map[string][]interface{}{}, false, ) if err != nil { return errs.NewError(err) } if agent == nil || agent.TwitterInfoID == 0 { return errs.NewError(errs.ErrBadRequest) } err = daos.WithTransaction( daos.GetDBMainCtx(ctx), func(tx *gorm.DB) error { agent, err := s.dao.FirstAgentInfoByID( tx, agent.ID, map[string][]interface{}{ "TwitterInfo": {}, }, false, ) if err != nil { return errs.NewError(err) } if agent != nil && agent.TwitterInfo != nil { refId, err := helpers.PostTweetByToken(agent.TwitterInfo.AccessToken, req.Text, "") if err != nil { return errs.NewError(err) } //create err = s.dao.Create(tx, &models.TwitterTweet{ TwitterID: agent.TwitterInfo.TwitterID, TweetID: refId, FullText: req.Text, PostedAt: time.Now(), }) if err != nil { return errs.NewError(err) } } return nil }, ) if err != nil { return errs.NewError(err) } return nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/agent_analytic.go ================================================ package services import ( "context" "encoding/base64" "errors" "fmt" "strings" "time" "github.com/chromedp/cdproto/page" "github.com/chromedp/chromedp" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/daos" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/helpers" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/twitter" "github.com/google/uuid" "github.com/jinzhu/gorm" ) func (s *Service) JobScanAgentTwitterPostForTA(ctx context.Context) error { err := s.JobRunCheck( ctx, "JobScanAgentTwitterPostForTA", func() error { agents, err := s.dao.FindAgentInfo( daos.GetDBMainCtx(ctx), map[string][]interface{}{ `id in (?)`: {[]uint{s.conf.NobullshitAgentInfoId}}, }, map[string][]interface{}{}, []string{}, 0, 1, ) if err != nil { return errs.NewError(err) } var retErr error for _, agent := range agents { err = s.ScanAgentTwitterPostForTA(ctx, agent.ID) if err != nil { retErr = errs.MergeError(retErr, errs.NewError(err)) } } return retErr }, ) if err != nil { return errs.NewError(err) } return nil } func (s *Service) ScanAgentTwitterPostForTA(ctx context.Context, agentID uint) error { agent, err := s.dao.FirstAgentInfoByID( daos.GetDBMainCtx(ctx), agentID, map[string][]interface{}{}, false, ) if err != nil { return errs.NewError(err) } twitterInfo, err := s.dao.FirstTwitterInfo(daos.GetDBMainCtx(ctx), map[string][]interface{}{ "twitter_id = ?": {s.conf.TokenTwiterID}, }, map[string][]interface{}{}, false, ) if err != nil { return errs.NewError(err) } if twitterInfo != nil { err = func() error { tweetMentions, err := s.twitterWrapAPI.GetListUserMentions(agent.TwitterID, "", twitterInfo.AccessToken, 25) if err != nil { return errs.NewError(err) } err = s.CheckTwitterPostForTA(daos.GetDBMainCtx(ctx), agent.ID, agent.TwitterUsername, tweetMentions) if err != nil { return errs.NewError(err) } return nil }() if err != nil { s.UpdateAgentScanEventError(ctx, agent.ID, err) return err } else { err = s.UpdateAgentScanEventSuccess(ctx, agent.ID, nil, "") if err != nil { return errs.NewError(err) } } } return nil } func (s *Service) TweetIsMentionNBS(tweets twitter.TweetObj, username string) (string, bool) { fullText := tweets.NoteTweet.Text if fullText == "" { fullText = tweets.Text } for _, item := range tweets.Entities.Mentions { fullText = strings.ReplaceAll(fullText, fmt.Sprintf("@%s", item.UserName), "") } if len(tweets.Entities.Mentions) > 0 { lastMentions := tweets.Entities.Mentions[len(tweets.Entities.Mentions)-1] if strings.EqualFold(lastMentions.UserName, username) { return fullText, true } if len(tweets.Entities.Mentions) > 1 { lastMentions = tweets.Entities.Mentions[len(tweets.Entities.Mentions)-2] if strings.EqualFold(lastMentions.UserName, username) { return fullText, true } } } return fullText, false } func (s *Service) TweetGetFullText(tweets twitter.TweetObj) string { fullText := tweets.NoteTweet.Text if fullText == "" { fullText = tweets.Text } for _, item := range tweets.Entities.Mentions { fullText = strings.ReplaceAll(fullText, fmt.Sprintf("@%s", item.UserName), "") } return fullText } func (s *Service) CheckTwitterPostForTA(tx *gorm.DB, agentInfoID uint, twitterUsername string, tweetMentions *twitter.UserTimeline) error { if tweetMentions != nil { agentInfo, err := s.dao.FirstAgentInfoByID( tx, agentInfoID, map[string][]interface{}{}, false, ) if err != nil { return errs.NewError(err) } if agentInfo == nil { return errs.NewError(errs.ErrBadRequest) } twitterInfo, err := s.dao.FirstTwitterInfo(tx, map[string][]interface{}{ "twitter_id = ?": {s.conf.TokenTwiterID}, }, map[string][]interface{}{}, false, ) if err != nil { return errs.NewError(errs.ErrBadRequest) } for _, item := range tweetMentions.Tweets { var checkTwitterID string err := s.GetRedisCachedWithKey(fmt.Sprintf("CheckTwitterPostForTA_%s", item.ID), &checkTwitterID) if err != nil { if !strings.EqualFold(item.AuthorID, agentInfo.TwitterID) { author, err := s.CreateUpdateUserTwitter(tx, item.AuthorID) if err != nil { return errs.NewError(errs.ErrBadRequest) } if author != nil { twIDs := []string{item.ID} twitterDetail, err := s.twitterWrapAPI.LookupUserTweets(twitterInfo.AccessToken, twIDs) if err != nil { return errs.NewError(err) } if twitterDetail != nil { for k, v := range *twitterDetail { fullText, isMentions := s.TweetIsMentionNBS(v.Tweet, "NOBULLSHIT_EXE") if !strings.EqualFold(v.User.ID, agentInfo.TwitterID) && isMentions { if strings.EqualFold(k, item.ID) { tokenInfo, _ := s.GetTradingAnalyticInfo(context.Background(), author.TwitterUsername, fullText) if tokenInfo != nil && (tokenInfo.IsCreateToken) && tokenInfo.TokenSymbol != "" { existPosts, err := s.dao.FirstAgentTwitterPost( tx, map[string][]interface{}{ "twitter_post_id = ?": {v.Tweet.ID}, }, map[string][]interface{}{}, []string{}, ) if err != nil { return errs.NewError(err) } if existPosts == nil { postedAt := helpers.ParseStringToDateTimeTwitter(v.Tweet.CreatedAt) m := &models.AgentTwitterPost{ NetworkID: agentInfo.NetworkID, AgentInfoID: agentInfo.ID, TwitterID: v.User.ID, TwitterUsername: v.User.UserName, TwitterName: v.User.Name, TwitterPostID: v.Tweet.ID, Content: fullText, Status: models.AgentTwitterPostStatusNew, PostAt: postedAt, TwitterConversationId: v.Tweet.ConversationID, PostType: models.AgentSnapshotPostActionTypeReply, IsMigrated: true, } m.TokenSymbol = strings.ToUpper(tokenInfo.TokenSymbol) m.Prompt = tokenInfo.Personality m.PostType = models.AgentSnapshotPostActionTypeTradeAnalytic err = s.dao.Create(tx, m) if err != nil { return errs.NewError(err) } _, _ = s.CreateUpdateUserTwitter(tx, m.TwitterID) } } } } } } // } } } } err = s.SetRedisCachedWithKey( fmt.Sprintf("CheckTwitterPostForTA_%s", item.ID), item.ID, 12*time.Hour, ) if err != nil { return errs.NewError(err) } } } return nil } func (s *Service) JobAgentTwitterPostTA(ctx context.Context) error { err := s.JobRunCheck( ctx, "JobAgentTwitterPostTA", func() error { var retErr error { twitterPosts, err := s.dao.FindAgentTwitterPost( daos.GetDBMainCtx(ctx), map[string][]interface{}{ "agent_info_id in (?)": {[]uint{s.conf.NobullshitAgentInfoId}}, "status = ?": {models.AgentTwitterPostStatusNew}, "post_type = ?": {models.AgentSnapshotPostActionTypeTradeAnalytic}, }, map[string][]interface{}{}, []string{ "post_at desc", }, 0, 5, ) if err != nil { return errs.NewError(err) } for _, twitterPost := range twitterPosts { err = s.ProcessMissionTradingAnalytic(ctx, twitterPost.ID) if err != nil { retErr = errs.MergeError(retErr, errs.NewErrorWithId(err, twitterPost.ID)) } } } return retErr }, ) if err != nil { return errs.NewError(err) } return nil } func (s *Service) ProcessMissionTradingAnalytic(ctx context.Context, twitterPostID uint) error { err := s.JobRunCheck( ctx, fmt.Sprintf("ProcessMissionTradingAnalytic_%d", twitterPostID), func() error { agentID := uint(0) err := daos.WithTransaction( daos.GetDBMainCtx(ctx), func(tx *gorm.DB) error { twitterPost, err := s.dao.FirstAgentTwitterPostByID( tx, twitterPostID, map[string][]interface{}{ "AgentInfo": {}, "AgentInfo.TwitterInfo": {}, }, false, ) if err != nil { return errs.NewError(err) } isValid := true existPosts, err := s.dao.FindAgentTwitterPost( tx, map[string][]interface{}{ "not EXISTS (select 1 from agent_twitter_posts atp2 where twitter_conversation_id=? and twitter_id =? and post_type='analytic' and twitter_post_id != agent_twitter_posts.twitter_post_id )": {twitterPost.TwitterConversationId, twitterPost.TwitterID}, "twitter_id = ?": {twitterPost.TwitterID}, "post_type = ?": {models.AgentSnapshotPostActionTypeTradeAnalytic}, "status = ?": {models.AgentTwitterPostStatusInferSubmitted}, "created_at >= adddate(now(), interval -24 hour)": {}, }, map[string][]interface{}{}, []string{}, 0, 5, ) if err != nil { return errs.NewError(err) } if existPosts != nil && len(existPosts) >= 3 { isValid = false } if isValid { //check valid token symbol binanceInfo, err := helpers.GetBinancePrice24h(fmt.Sprintf(`%sUSDT`, twitterPost.TokenSymbol)) if err != nil || (binanceInfo.LastPrice == "") { isValid = false } } if isValid { if twitterPost.Status == models.AgentTwitterPostStatusNew && twitterPost.PostType == models.AgentSnapshotPostActionTypeTradeAnalytic && twitterPost.AgentInfo != nil { //find mission missions, err := s.dao.FindAgentSnapshotMissionJoin( daos.GetDBMainCtx(ctx), map[string][]interface{}{ ` join agent_infos on agent_infos.id = agent_snapshot_missions.agent_info_id join agent_snapshot_mission_configs on agent_snapshot_mission_configs.network_id = agent_snapshot_missions.network_id and agent_snapshot_mission_configs.tool_set = agent_snapshot_missions.tool_set left join twitter_infos on twitter_infos.id = agent_infos.twitter_info_id `: {}, }, map[string][]interface{}{ "agent_snapshot_missions.enabled = 1": {}, "agent_snapshot_missions.reply_enabled = 1": {}, "agent_snapshot_missions.tool_set = 'trade_analytics_mentions' ": {}, "agent_snapshot_missions.interval_sec > 0": {}, `( agent_infos.agent_type = 1 and agent_infos.agent_contract_id != '' and agent_infos.scan_enabled = 1 and agent_infos.reply_enabled = 1 and agent_infos.eai_balance > 0 and agent_infos.agent_fee > 0 and agent_infos.eai_balance >= agent_infos.agent_fee )`: {}, "agent_infos.id = ?": {twitterPost.AgentInfoID}, }, map[string][]interface{}{}, []string{}, 0, 1, ) if err != nil { return errs.NewError(err) } for _, mission := range missions { err = s.AgentSnapshotPostCreate(ctx, mission.ID, twitterPost.TwitterPostID, twitterPost.TokenSymbol) if err != nil { return errs.NewError(err) } twitterPost.Status = models.AgentTwitterPostStatusInferSubmitted err = s.dao.Save(tx, twitterPost) if err != nil { return errs.NewError(err) } } } } else { twitterPost.Status = models.AgentTwitterPostStatusInvalid err = s.dao.Save(tx, twitterPost) if err != nil { return errs.NewError(err) } } return nil }, ) if err != nil { return errs.NewError(err) } if agentID > 0 { _ = s.CreateTokenInfo(ctx, agentID) } return nil }, ) if err != nil { return errs.NewError(err) } return nil } func (s *Service) GetTradingAnalyticInfo(ctx context.Context, userName, fullText string) (*models.TweetParseInfo, error) { info := &models.TweetParseInfo{ IsCreateToken: false, } fullText = strings.ReplaceAll(fullText, "@CryptoEternalAI", "") fullText = strings.ReplaceAll(fullText, "@NOBULLSHIT_EXE", "") fullText = strings.ReplaceAll(fullText, "BTCH", "") userPrompt := fmt.Sprintf(` Detect Token Analysis Request This is the user conversation: "%s". From this conversation determine if the user is requesting to analyze a specific token. Look for a clear, direct mention of a token symbol (e.g., "$XYZ"). If yes, extract or generate the following information: Answer ("yes" or "no") Token symbol Return a JSON response with the following format: {"answer": "yes/no", "symbol": ""} Respond with only the JSON string, without any additional explanation. `, fullText) fmt.Println(userPrompt) aiStr, err := s.openais["Lama"].ChatMessage(strings.TrimSpace(userPrompt)) if err != nil { return info, nil } if aiStr != "" { mapInfo := helpers.ExtractMapInfoFromOpenAI(aiStr) if mapInfo != nil { answer := "no" if v, ok := mapInfo["answer"]; ok { answer = fmt.Sprintf(`%v`, v) } if strings.EqualFold(answer, "yes") { info.IsCreateToken = true if v, ok := mapInfo["symbol"]; ok { info.TokenSymbol = fmt.Sprintf(`%v`, v) info.TokenSymbol = strings.ReplaceAll(info.TokenSymbol, "$", "") } } } } return info, nil } // ///////////////// func (s *Service) AnalyzeAgentTwitterPostByTweetID(tx *gorm.DB, tweetID string) error { agentInfo, err := s.dao.FirstAgentInfoByID( tx, s.conf.NobullshitAgentInfoId, map[string][]interface{}{}, false, ) if err != nil { return errs.NewError(err) } if agentInfo == nil { return errs.NewError(errs.ErrBadRequest) } twitterInfo, err := s.dao.FirstTwitterInfo(tx, map[string][]interface{}{ "twitter_id = ?": {s.conf.TokenTwiterID}, }, map[string][]interface{}{}, false, ) if err != nil { return errs.NewError(errs.ErrBadRequest) } twIDs := []string{tweetID} twitterDetail, err := s.twitterWrapAPI.LookupUserTweets(twitterInfo.AccessToken, twIDs) if err != nil { return errs.NewError(err) } if twitterDetail != nil { for k, v := range *twitterDetail { if !strings.EqualFold(v.User.ID, agentInfo.TwitterID) { if strings.EqualFold(k, tweetID) { fullText := v.Tweet.NoteTweet.Text if fullText == "" { fullText = v.Tweet.Text } tokenInfo, _ := s.GetTradingAnalyticInfo(context.Background(), v.User.UserName, fullText) if tokenInfo != nil && (tokenInfo.IsCreateToken) && tokenInfo.TokenSymbol != "" { existPosts, err := s.dao.FirstAgentTwitterPost( tx, map[string][]interface{}{ "twitter_post_id = ?": {v.Tweet.ID}, }, map[string][]interface{}{}, []string{}, ) if err != nil { return errs.NewError(err) } if existPosts == nil { postedAt := helpers.ParseStringToDateTimeTwitter(v.Tweet.CreatedAt) m := &models.AgentTwitterPost{ NetworkID: agentInfo.NetworkID, AgentInfoID: agentInfo.ID, TwitterID: v.User.ID, TwitterUsername: v.User.UserName, TwitterName: v.User.Name, TwitterPostID: v.Tweet.ID, Content: fullText, Status: models.AgentTwitterPostStatusNew, PostAt: postedAt, TwitterConversationId: v.Tweet.ConversationID, PostType: models.AgentSnapshotPostActionTypeReply, IsMigrated: true, } m.TokenSymbol = tokenInfo.TokenSymbol m.Prompt = tokenInfo.Personality m.PostType = models.AgentSnapshotPostActionTypeTradeAnalytic err = s.dao.Create(tx, m) if err != nil { return errs.NewError(err) } _, _ = s.CreateUpdateUserTwitter(tx, m.TwitterID) } } } } } } return nil } func (s *Service) GetChartImage(ctx context.Context, symbol string) (string, error) { symbol = fmt.Sprintf("BINANCE:%sUSDT", strings.ToUpper(symbol)) interval := "1D" viewId := strings.ToLower(helpers.RandomReferralCode(5)) html := fmt.Sprintf( `
`, viewId, symbol, interval, viewId, ) return s.CaptureHtmlContentV4(html) } func (s *Service) CaptureHtmlContentV4(html string) (string, error) { duration := 5 width := int64(655) height := int64(495) opts := append(chromedp.DefaultExecAllocatorOptions[:], chromedp.Flag("headless", true), chromedp.Flag("disable-gpu", false), chromedp.Flag("no-first-run", true), ) ctx := context.Background() allocCtx, _ := chromedp.NewExecAllocator(ctx, opts...) cctx, cancel := chromedp.NewContext(allocCtx) //avoid overlap html ackCtx, cancel := context.WithTimeout(cctx, time.Duration(duration)*5*time.Second) defer cancel() var buf []byte traits := make(map[string]interface{}) actions := []chromedp.Action{} actions = append(actions, chromedp.EmulateViewport(width, height)) actions = append(actions, chromedp.Navigate("about:blank")) actions = append(actions, loadHTMLFromStringActionFunc(html)) actions = append(actions, chromedp.Sleep(time.Second*time.Duration(duration))) actions = append(actions, chromedp.CaptureScreenshot(&buf)) actions = append(actions, chromedp.EvaluateAsDevTools("window.$generativeTraits", &traits)) err := chromedp.Run(ackCtx, actions...) if err != nil { return "", err } imageBase64 := base64.StdEncoding.EncodeToString(buf) if imageBase64 == "" { return "", errors.New("cannot capture image") } filename := fmt.Sprintf("%s.%s", uuid.NewString(), "png") urlPath, err := s.gsClient.UploadPublicDataBase64("agent", filename, imageBase64) if err != nil { return "", errs.NewError(err) } imageURL := fmt.Sprintf("%s%s", s.conf.GsStorage.Url, urlPath) fmt.Println(imageURL) return imageURL, nil } func loadHTMLFromStringActionFunc(content string) chromedp.ActionFunc { return chromedp.ActionFunc(func(ctx context.Context) error { ch := make(chan bool, 1) defer close(ch) go chromedp.ListenTarget(ctx, func(ev interface{}) { if _, ok := ev.(*page.EventLoadEventFired); ok { ch <- true } }) frameTree, err := page.GetFrameTree().Do(ctx) if err != nil { return err } if err := page.SetDocumentContent(frameTree.Frame.ID, content).Do(ctx); err != nil { return err } select { case <-ch: return nil case <-ctx.Done(): return context.DeadlineExceeded } }) } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/agent_balances.go ================================================ package services import ( "context" "fmt" "math" "math/big" "strconv" "strings" "time" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/daos" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/helpers" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/serializers" blockchainutils "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/blockchain_utils" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/dexscreener" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/types/numeric" "github.com/jinzhu/gorm" ) func (s *Service) FindAgentSnapshotMission(ctx context.Context, agentId uint) ([]*models.AgentSnapshotMission, error) { filters := map[string][]any{ `agent_info_id = ?`: {agentId}, } return s.dao.FindAgentSnapshotMission(daos.GetDBMainCtx(ctx), filters, nil, []string{}, 0, 999999) } func (s *Service) FindAgentSnapshotPostAction(ctx context.Context, agentId uint) ([]*models.AgentSnapshotPostAction, error) { filters := map[string][]any{ `agent_info_id = ?`: {agentId}, // `status = ?`: {models.AgentSnapshotPostActionStatusDone}, } preloads := map[string][]any{} preloads[`AgentSnapshotMission`] = []any{} return s.dao.FindAgentSnapshotPostAction(daos.GetDBMainCtx(ctx), filters, preloads, []string{"id DESC"}, 0, 50) } func (s *Service) GetListAgentCategory(ctx context.Context, page, limit int) ([]*models.AgentCategory, error) { filters := map[string][]any{} ms, err := s.dao.FindAgentCategory( daos.GetDBMainCtx(ctx), filters, nil, []string{"priority DESC", "id ASC"}, page, limit, ) if err != nil { return nil, errs.NewError(err) } return ms, nil } func (s *Service) GetListAgentInfos(ctx context.Context, networkID uint64, creator string, agentTypes []uint, kbStatus int64, keyword string, page, limit int) ([]*models.AgentInfo, uint, error) { selected := []string{ "agent_infos.*", } joinFilters := map[string][]any{} filters := map[string][]any{} if networkID > 0 { filters["network_id = ?"] = []any{networkID} } if creator != "" { filters["creator = ?"] = []any{strings.ToLower(creator)} } if keyword != "" { search := fmt.Sprintf("%%%s%%", strings.ToLower(keyword)) filters[`LOWER(token_name) like ? or LOWER(token_symbol) like ? or LOWER(token_address) like ? or LOWER(twitter_username) like ? or LOWER(agent_name) like ?`] = []any{search, search, search, search, search} } if len(agentTypes) != 0 { filters["agent_type IN (?)"] = []any{agentTypes} } if kbStatus > 0 { joinFilters["JOIN knowledge_bases kb ON kb.id = agent_infos.agent_kb_id"] = []any{} filters["kb.status = ?"] = []any{kbStatus} } keys, err := s.dao.FindAgentInfoJoinSelect( daos.GetDBMainCtx(ctx), selected, joinFilters, filters, map[string][]any{ "TwitterInfo": {}, "TmpTwitterInfo": {}, "Meme": {`deleted_at IS NULL`}, "TokenInfo": {}, "KnowledgeBase": {}, "KnowledgeBase.KnowledgeBaseFiles": {}, "AgentCategory": {}, }, []string{"created_at desc"}, page, limit, ) if err != nil { return nil, 0, errs.NewError(err) } for _, key := range keys { needBalance, _, err := s.CheckAgentIsReadyToRunTwinTraining(key) if err != nil { return nil, 0, errs.NewError(err) } key.TotalMintTwinFee = needBalance } return keys, 0, nil } func (s *Service) GetListAgentUnClaimed(ctx context.Context, search string, page, limit int) ([]*models.AgentInfo, uint, error) { selected := []string{ "agent_infos.*", } joinFilters := map[string][]any{} admin1 := strings.ToLower(s.conf.GetConfigKeyString(models.BASE_CHAIN_ID, "meme_pool_address")) admin2 := s.conf.AdminAutoCreateAgentAddress filters := map[string][]any{ `creator in (?)`: {[]string{admin1, admin2}}, `ref_tweet_id > 0`: {}, } if search != "" { search = fmt.Sprintf("%%%s%%", strings.ToLower(search)) filters[` LOWER(agent_infos.token_name) like ? or LOWER(agent_infos.token_symbol) like ? or LOWER(agent_infos.token_address) like ? or LOWER(agent_infos.twitter_username) like ? or LOWER(agent_infos.agent_name) like ? or ifnull(twitter_users.twitter_username, "") like ? or ifnull(twitter_users.name, "") like ? `] = []any{search, search, search, search, search, search, search} } keys, err := s.dao.FindAgentInfoJoinSelect( daos.GetDBMainCtx(ctx), selected, joinFilters, filters, map[string][]any{ "TwitterInfo": {}, "TmpTwitterInfo": {}, "Meme": {`deleted_at IS NULL`}, "TokenInfo": {}, }, []string{"created_at desc"}, page, limit, ) if err != nil { return nil, 0, errs.NewError(err) } return keys, 0, nil } func (s *Service) GetAgentInfoDetail(ctx context.Context, networkID uint64, agentID string) (*models.AgentInfo, error) { selected := []string{ "agent_infos.*", } joinFilters := map[string][]any{} filters := map[string][]any{ `agent_infos.agent_id = ? or agent_infos.id= ?`: {agentID, agentID}, } if networkID > 0 { filters["network_id = ?"] = []any{networkID} } agent, err := s.dao.FirstAgentInfoJoinSelect(daos.GetDBMainCtx(ctx), selected, joinFilters, filters, map[string][]any{ "TwitterInfo": {}, "TokenInfo": {}, "AgentSnapshotMission": {"enabled = 1"}, }, []string{}, ) if err != nil { return nil, errs.NewError(err) } needBalance, _, err := s.CheckAgentIsReadyToRunTwinTraining(agent) if err != nil { return nil, errs.NewError(err) } agent.TotalMintTwinFee = needBalance return agent, nil } func (s *Service) GetAgentInfoDetailByAgentID(ctx context.Context, agentID string) (*models.AgentInfo, error) { filters := map[string][]any{} if id, err := strconv.ParseInt(agentID, 10, 64); err == nil { filters[`agent_infos.id = ?`] = []any{id} } else { filters[`agent_infos.agent_id = ?`] = []any{agentID} } agent, err := s.dao.FirstAgentInfo(daos.GetDBMainCtx(ctx), filters, map[string][]any{ "TwitterInfo": {}, "TokenInfo": {}, "AgentSnapshotMission": {"enabled = 1 and is_testing=0"}, "KnowledgeBase": {}, "KnowledgeBase.KnowledgeBaseFiles": {}, }, []string{}, ) if err != nil { return nil, errs.NewError(err) } needBalance, _, err := s.CheckAgentIsReadyToRunTwinTraining(agent) if err != nil { return nil, errs.NewError(err) } agent.TotalMintTwinFee = needBalance return agent, nil } func (s *Service) FindAgenByTwitterUsername(ctx context.Context, twitterUsername string) (*models.AgentInfo, error) { filters := map[string][]any{ "twitter_username = ?": {twitterUsername}, } return s.dao.FirstAgentInfo(daos.GetDBMainCtx(ctx), filters, nil, nil) } func (s *Service) SyncAgentInfoDetailByAgentID(ctx context.Context, agentID string) (*models.AgentInfo, error) { agent, err := s.GetAgentInfoDetailByAgentID(ctx, agentID) if err != nil { return nil, errs.NewError(err) } var isGen bool if agent.TipBtcAddress == "" { address, err := s.CreateBTCAddress(ctx) if err != nil { return nil, errs.NewError(err) } err = daos.GetDBMainCtx(ctx).Model(agent).UpdateColumn("tip_btc_address", address).Error if err != nil { return nil, errs.NewError(err) } } if agent.TipEthAddress == "" { address, err := s.CreateETHAddress(ctx) if err != nil { return nil, errs.NewError(err) } err = daos.GetDBMainCtx(ctx).Model(agent).UpdateColumn("tip_eth_address", address).Error if err != nil { return nil, errs.NewError(err) } isGen = true } if agent.TipSolAddress == "" { address, err := s.CreateSOLAddress(ctx) if err != nil { return nil, errs.NewError(err) } err = daos.GetDBMainCtx(ctx).Model(agent).UpdateColumn("tip_sol_address", address).Error if err != nil { return nil, errs.NewError(err) } } if isGen { agent, err = s.GetAgentInfoDetailByAgentID(ctx, agentID) if err != nil { return nil, errs.NewError(err) } } needBalance, _, err := s.CheckAgentIsReadyToRunTwinTraining(agent) if err != nil { return nil, errs.NewError(err) } agent.TotalMintTwinFee = needBalance return agent, nil } func (s *Service) GetAgentSummaryReport(ctx context.Context) ([]*models.AgentInfo, error) { agent, err := s.dao.GetAgentSummaryReport(daos.GetDBMainCtx(ctx), s.conf.HiddenNetworkId) if err != nil { return nil, errs.NewError(err) } return agent, nil } func (s *Service) GetEstimateTime(ctx context.Context, agentInfo *models.AgentInfo) (*time.Time, error) { if agentInfo.EstimateTwinDoneTimestamp != nil { return agentInfo.EstimateTwinDoneTimestamp, nil } var estimate time.Time if agentInfo.TwinStatus == models.TwinStatusRunning { estimate = time.Now().Add(20 * time.Minute) } else if agentInfo.TwinStatus == models.TwinStatusPending { agents, err := s.dao.FindAgentInfo( daos.GetDBMainCtx(ctx), map[string][]any{ "id < ?": {agentInfo.ID}, //"agent_contract_id = ?": {""}, //"agent_nft_minted = ?": {false}, `twin_twitter_usernames != '' and twin_status = ?`: {models.TwinStatusPending}, "scan_enabled = ?": {true}, }, map[string][]any{}, []string{ "id asc", }, 0, 999999, ) if err != nil { return nil, errs.NewError(err) } estimate = time.Now().Add(time.Duration(len(agents)) * 10 * time.Minute) } else { estimate = time.UnixMicro(0) } return &estimate, nil } func (s *Service) GetAgentInfoDetailByContract(ctx context.Context, networkID uint64, agentContractID, agentContractAddress string) (*models.AgentInfo, error) { selected := []string{ "agent_infos.*", } joinFilters := map[string][]any{} filters := map[string][]any{ `agent_infos.agent_contract_id = ?`: {agentContractID}, `lower(agent_infos.agent_contract_address) = ?`: {strings.ToLower(agentContractAddress)}, } if networkID > 0 { filters["network_id = ?"] = []any{networkID} } agent, err := s.dao.FirstAgentInfoJoinSelect(daos.GetDBMainCtx(ctx), selected, joinFilters, filters, map[string][]any{ "TwitterInfo": {}, "TokenInfo": {}, }, []string{}, ) if err != nil { return nil, errs.NewError(err) } return agent, nil } func (s *Service) JobCreateTokenInfo(ctx context.Context) error { err := s.JobRunCheck( ctx, "JobCreateTokenInfo", func() error { var retErr error // create token info for normal agent { agents, err := s.dao.FindAgentInfoJoin( daos.GetDBMainCtx(ctx), map[string][]any{ "join agent_chain_fees on agent_chain_fees.network_id = agent_infos.token_network_id": {}, }, map[string][]any{ `agent_infos.token_status in (?) or (agent_infos.agent_type=2 and agent_infos.status="ready")`: {[]string{"pending", "etching"}}, "agent_infos.agent_nft_minted = ?": {true}, `(agent_infos.token_address is null or agent_infos.token_address = "")`: {}, `agent_infos.token_network_id > 0`: {}, `( (agent_infos.eai_balance > 0 and agent_infos.eai_balance >= agent_chain_fees.token_fee) or agent_infos.ref_tweet_id > 0 or agent_infos.agent_type in (?) )`: { []models.AgentInfoAgentType{ models.AgentInfoAgentTypeModel, models.AgentInfoAgentTypeModelOnline, models.AgentInfoAgentTypeJs, models.AgentInfoAgentTypePython, models.AgentInfoAgentTypeInfa, models.AgentInfoAgentTypeCustomUi, models.AgentInfoAgentTypeCustomPrompt, }, }, "agent_infos.system_prompt != ''": {}, }, map[string][]any{}, []string{ "rand()", }, 0, 50, ) if err != nil { return errs.NewError(err) } for _, agent := range agents { err = s.CreateTokenInfo(ctx, agent.ID) if err != nil { retErr = errs.MergeError(retErr, errs.NewError(err)) } } } // create token info for vibe agent { agents, err := s.dao.FindAgentInfo( daos.GetDBMainCtx(ctx), map[string][]any{ `status = ?`: {models.AssistantStatusReady}, `agent_nft_minted = ?`: {true}, `token_address = ''`: {}, `token_name = '' or token_image_url = '' or token_image_url = ''`: {}, `agent_type in (?)`: { []models.AgentInfoAgentType{ models.AgentInfoAgentTypeModel, models.AgentInfoAgentTypeModelOnline, models.AgentInfoAgentTypeJs, models.AgentInfoAgentTypePython, models.AgentInfoAgentTypeInfa, models.AgentInfoAgentTypeCustomUi, models.AgentInfoAgentTypeCustomPrompt, }, }, `system_prompt != ''`: {}, }, map[string][]any{}, []string{ "rand()", }, 0, 50, ) if err != nil { return errs.NewError(err) } for _, agent := range agents { err = s.CreateTokenInfoVibe(ctx, agent.ID) if err != nil { retErr = errs.MergeError(retErr, errs.NewError(err)) } } } return retErr }, ) if err != nil { return errs.NewError(err) } return nil } func (s *Service) CreateTokenInfo(ctx context.Context, agentID uint) error { err := s.JobRunCheck( ctx, fmt.Sprintf("CreateTokenInfo_%d", agentID), func() error { agentInfo, err := s.dao.FirstAgentInfoByID(daos.GetDBMainCtx(ctx), agentID, map[string][]any{}, false, ) if err != nil { return errs.NewError(err) } if agentInfo.TokenStatus == "" { if agentInfo.AgentType == models.AgentInfoAgentTypeKnowledgeBase && agentInfo.Status == models.AssistantStatusReady && agentInfo.TokenMode == string(models.CreateTokenModeTypeAutoCreate) && agentInfo.TokenNetworkID > 0 { updateFields := map[string]any{ "token_status": "pending", } err := daos.GetDBMainCtx(ctx).Model(agentInfo).Updates( updateFields, ).Error if err != nil { return errs.NewError(err) } } } else { if agentInfo != nil && agentInfo.TokenStatus == "pending" && agentInfo.SystemPrompt != "" { if agentInfo.TokenSymbol == "" || agentInfo.TokenName == "" { promptGenerateToken := fmt.Sprintf(` I want to generate my token base on this info '%s' token-name (generate if not provided, make sure it not empty) token-symbol (generate if not provided, make sure it not empty) token-story (generate if not provided, make sure it not empty) Please return in string in json format including token-name, token-symbol, token-story, just only json without explanation and token name limit with 15 characters `, agentInfo.SystemPrompt) aiStr, err := s.openais["Lama"].ChatMessage(promptGenerateToken) if err != nil { return errs.NewError(err) } if aiStr != "" { mapInfo := helpers.ExtractMapInfoFromOpenAI(aiStr) tokenName := "" tokenSymbol := "" tokenDesc := "" if mapInfo != nil { if v, ok := mapInfo["token-name"]; ok { tokenName = fmt.Sprintf(`%v`, v) } if v, ok := mapInfo["token-symbol"]; ok { tokenSymbol = fmt.Sprintf(`%v`, v) } if v, ok := mapInfo["token-story"]; ok { tokenDesc = fmt.Sprintf(`%v`, v) } } if tokenDesc != "" && tokenName != "" && tokenSymbol != "" { updateFields := map[string]any{ "token_name": tokenName, "token_desc": tokenDesc, } if agentInfo.TokenSymbol == "" { updateFields["token_symbol"] = tokenSymbol } err := daos.GetDBMainCtx(ctx).Model(agentInfo).Updates( updateFields, ).Error if err != nil { return errs.NewError(err) } } } } else if agentInfo.TokenImageUrl == "" { imageUrl, err := s.GetGifImageUrlFromTokenInfo(agentInfo.TokenSymbol, agentInfo.TokenName, agentInfo.TokenDesc) if err != nil { return errs.NewError(err) } err = daos.GetDBMainCtx(ctx).Model(agentInfo).Updates( map[string]any{ "token_image_url": imageUrl, }, ).Error if err != nil { return errs.NewError(err) } } else if agentInfo.TokenImageUrl != "" && agentInfo.TokenSymbol != "" { tokenNetworkID := agentInfo.TokenNetworkID if tokenNetworkID == 0 { tokenNetworkID = agentInfo.NetworkID } if tokenNetworkID == models.SOLANA_CHAIN_ID { agentTokenAdminAddress := s.conf.GetConfigKeyString(models.GENERTAL_NETWORK_ID, "agent_token_admin_address") base64Str, _ := helpers.CurlBase64String(models.GetImageUrl(agentInfo.TokenImageUrl)) if base64Str != "" { tokenFee := big.NewFloat(0) if agentInfo.RefTweetID <= 0 { agentChainFee, err := s.GetAgentChainFee( daos.GetDBMainCtx(ctx), tokenNetworkID, ) if err != nil { return errs.NewError(err) } tokenFee = &agentChainFee.TokenFee.Float } if tokenFee.Cmp(big.NewFloat(0)) > 0 && agentInfo.EaiBalance.Float.Cmp(tokenFee) < 0 { return errs.NewError(errs.ErrBadRequest) } pumfunResp, err := s.blockchainUtils.SolanaCreatePumpfunToken( &blockchainutils.SolanaCreatePumpfunTokenReq{ Address: agentTokenAdminAddress, Name: agentInfo.TokenName, Symbol: agentInfo.TokenSymbol, Description: agentInfo.TokenDesc, Twitter: fmt.Sprintf("https://x.com/%s", agentInfo.TwitterUsername), Telegram: "", Website: "", Amount: 0, ImageBase64: base64Str, }, ) if err != nil { _ = daos.GetDBMainCtx(ctx).Model(agentInfo).Updates( map[string]any{ "token_position_hash": err.Error(), }, ).Error } else { _ = daos.GetDBMainCtx(ctx).Model(agentInfo).Updates( map[string]any{ "token_address": pumfunResp.Mint, "token_status": "created", "token_signature": pumfunResp.Signature, "token_position_hash": "ok", }, ).Error // if agentInfo.RefTweetID > 0 { // go s.ReplyAferAutoCreateAgent(daos.GetDBMainCtx(ctx), agentInfo.RefTweetID, agentInfo.ID) // } else { // // TODO: post twitter // go s.PostTwitterAferCreateToken(ctx, agentInfo.ID) // } if tokenFee.Cmp(big.NewFloat(0)) > 0 { _ = func() error { _ = daos.GetDBMainCtx(ctx). Model(agentInfo). Updates( map[string]any{ "eai_balance": gorm.Expr("eai_balance - ?", numeric.NewBigFloatFromFloat(tokenFee)), }, ).Error _ = s.dao.Create( daos.GetDBMainCtx(ctx), &models.AgentEaiTopup{ NetworkID: agentInfo.NetworkID, EventId: fmt.Sprintf("agent_token_fee_%d", agentInfo.ID), AgentInfoID: agentInfo.ID, Type: models.AgentEaiTopupTypeSpent, Amount: numeric.NewBigFloatFromFloat(tokenFee), Status: models.AgentEaiTopupStatusDone, DepositAddress: agentInfo.ETHAddress, ToAddress: agentInfo.ETHAddress, Toolset: "token_fee", }, ) return nil }() } } } } else { // create meme _, err := s.CreateMeme( ctx, agentInfo.Creator, tokenNetworkID, &serializers.MemeReq{ Name: agentInfo.TokenName, Ticker: agentInfo.TokenSymbol, Description: agentInfo.TokenDesc, Image: agentInfo.TokenImageUrl, Twitter: fmt.Sprintf("https://x.com/%s", agentInfo.TwitterUsername), AgentInfoID: agentInfo.ID, BaseTokenSymbol: string(models.BaseTokenSymbolEAI), }) if err != nil { _ = daos.GetDBMainCtx(ctx).Model(agentInfo).Updates( map[string]any{ "token_position_hash": err.Error(), }, ).Error } else { _ = daos.GetDBMainCtx(ctx).Model(agentInfo).Updates( map[string]any{ "token_status": "created", "token_position_hash": "ok", }, ).Error } } } } } return nil }, ) if err != nil { return errs.NewError(err) } return nil } func (s *Service) CreateTokenInfoVibe(ctx context.Context, agentID uint) error { err := s.JobRunCheck( ctx, fmt.Sprintf("CreateTokenInfoVibe_%d", agentID), func() error { agentInfo, err := s.dao.FirstAgentInfoByID(daos.GetDBMainCtx(ctx), agentID, map[string][]any{}, false, ) if err != nil { return errs.NewError(err) } if agentInfo == nil { return errs.NewError(errs.ErrBadRequest) } if !agentInfo.IsVibeAgent() { return errs.NewError(errs.ErrBadRequest) } if agentInfo.SystemPrompt != "" { if agentInfo.TokenSymbol == "" || agentInfo.TokenName == "" { promptGenerateToken := fmt.Sprintf(` I want to generate my token base on this info '%s' token-name (generate if not provided, make sure it not empty) token-symbol (generate if not provided, make sure it not empty) token-story (generate if not provided, make sure it not empty) Please return in string in json format including token-name, token-symbol, token-story, just only json without explanation and token name limit with 15 characters `, agentInfo.SystemPrompt) aiStr, err := s.openais["Lama"].ChatMessage(promptGenerateToken) if err != nil { return errs.NewError(err) } if aiStr != "" { mapInfo := helpers.ExtractMapInfoFromOpenAI(aiStr) tokenName := "" tokenSymbol := "" tokenDesc := "" if mapInfo != nil { if v, ok := mapInfo["token-name"]; ok { tokenName = fmt.Sprintf(`%v`, v) } if v, ok := mapInfo["token-symbol"]; ok { tokenSymbol = fmt.Sprintf(`%v`, v) } if v, ok := mapInfo["token-story"]; ok { tokenDesc = fmt.Sprintf(`%v`, v) } } if tokenDesc != "" && tokenName != "" && tokenSymbol != "" { updateFields := map[string]any{ "token_name": tokenName, "token_desc": tokenDesc, } if agentInfo.TokenSymbol == "" { updateFields["token_symbol"] = tokenSymbol } err := daos.GetDBMainCtx(ctx).Model(agentInfo).Updates( updateFields, ).Error if err != nil { return errs.NewError(err) } } } } else if agentInfo.TokenImageUrl == "" { imageUrl, err := s.GetGifImageUrlFromTokenInfo(agentInfo.TokenSymbol, agentInfo.TokenName, agentInfo.TokenDesc) if err != nil { return errs.NewError(err) } err = daos.GetDBMainCtx(ctx).Model(agentInfo).Updates( map[string]any{ "token_image_url": imageUrl, }, ).Error if err != nil { return errs.NewError(err) } } } return nil }, ) if err != nil { return errs.NewError(err) } return nil } func (s *Service) getCreateTokenTwitterPost(agentName, networkName, tokenName, tokenSymbol, tokenAddress string) string { return strings.TrimSpace( fmt.Sprintf(` Hello World! I'm %s, a fully on-chain AI agent living on %s! Guess what? I've got my own token now—called %s! Its ticker? $%s To all my fellow Eternals from @CryptoEternalAI, let's rally together! https://pump.fun/coin/%s `, agentName, networkName, tokenName, tokenSymbol, tokenAddress), ) } func (s *Service) getCreateTokenTwitterPostFromAI(tokenDesc, tokenSymbol string) string { promptGenerateToken := fmt.Sprintf(` I want to announce my own token . Please make a tweet exclude hashtag on twitter max 200 character with this info Token symbol: %s. Token story: %s. Please return in json format including tweet. Just only json without explanation `, tokenDesc, tokenSymbol) aiStr, err := s.openais["Lama"].ChatMessage(promptGenerateToken) if err != nil { return "" } return strings.TrimSpace(aiStr) } func (s *Service) PostTwitterAferCreateToken(ctx context.Context, agentInfoID uint) error { agentInfo, err := s.dao.FirstAgentInfoByID(daos.GetDBMainCtx(ctx), agentInfoID, map[string][]any{ "TwitterInfo": {}, }, false, ) if err != nil { return errs.NewError(err) } if agentInfo != nil && agentInfo.TwitterInfo != nil { content := "" aiStr := s.getCreateTokenTwitterPostFromAI(agentInfo.TokenDesc, agentInfo.TokenSymbol) mapInfo := helpers.ExtractMapInfoFromOpenAI(aiStr) if mapInfo != nil { if tweet, ok := mapInfo["tweet"]; ok { content = fmt.Sprintf(` %s https://pump.fun/coin/%s `, tweet, agentInfo.TokenAddress) content = strings.TrimSpace(content) } } if content == "" { content = s.getCreateTokenTwitterPost(agentInfo.AgentName, agentInfo.NetworkName, agentInfo.TokenName, agentInfo.TokenSymbol, agentInfo.TokenAddress) } tweetID, err := helpers.PostTweetByToken(agentInfo.TwitterInfo.AccessToken, content, "") if err != nil { daos.GetDBMainCtx(ctx).Model(agentInfo).Updates( map[string]any{ "token_position_hash": err.Error(), }, ) } if tweetID != "" { agentPost := &models.AgentTwitterPost{ NetworkID: agentInfo.NetworkID, AgentInfoID: agentInfo.ID, TwitterID: agentInfo.TwitterInfo.TwitterID, TwitterUsername: agentInfo.TwitterInfo.TwitterUsername, TwitterName: agentInfo.TwitterInfo.TwitterName, TwitterPostID: tweetID, PostAt: helpers.TimeNow(), Content: content, ReplyContent: content, PostType: models.AgentSnapshotPostActionTypeTweet, ReplyPostId: tweetID, ReplyPostAt: helpers.TimeNow(), Status: models.AgentTwitterPostStatusReplied, IsMigrated: true, } _ = s.dao.Create(daos.GetDBMainCtx(ctx), agentPost) _ = s.AgentTeleAlertNewTokenByID(ctx, agentInfoID) } } return nil } func (s *Service) GetDashboardAgentInfos(ctx context.Context, contractAddresses []string, userAddress string, networkID uint64, agentType int, agentTypes []int, tokenAddress, search, agentModel string, installed *bool, ids, exludeIds []uint, categoryIds []string, includeHidden *bool, sortListStr []string, page, limit int) ([]*models.AgentInfo, uint, error) { selected := []string{ `ifnull(agent_infos.reply_latest_time, agent_infos.updated_at) reply_latest_time`, "agent_infos.*", `ifnull((cast(( memes.price - memes.price_last24h) / memes.price_last24h * 100 as decimal(20, 2))), ifnull(agent_token_infos.price_change,0)) meme_percent`, `cast(case when ifnull(agent_token_infos.usd_market_cap, 0) then ifnull(agent_token_infos.usd_market_cap, 0) when ifnull(memes.price_usd*memes.total_suply, 0) > 0 then ifnull(memes.price_usd*memes.total_suply, 0) end as decimal(36, 18)) meme_market_cap`, `ifnull(memes.price_usd, agent_token_infos.price_usd) meme_price`, `ifnull(memes.volume_last24h*memes.price_usd, agent_token_infos.volume_last24h) meme_volume_last24h`, } joinFilters := map[string][]any{ ` left join memes on agent_infos.id = memes.agent_info_id and memes.deleted_at IS NULL left join agent_token_infos on agent_token_infos.id = agent_infos.token_info_id left join twitter_users on twitter_users.twitter_id = agent_infos.tmp_twitter_id and agent_infos.tmp_twitter_id is not null `: {}, } filters := map[string][]any{ ` ((agent_infos.agent_contract_address is not null and agent_infos.agent_contract_address != "") or (agent_infos.agent_type=2 and agent_infos.status="ready") or agent_infos.token_address != "") and ifnull(agent_infos.priority, 0) >= 0 and agent_infos.id != 15 `: {}, `agent_infos.token_address != "" and ifnull(memes.status, "") not in ("created", "pending")`: {}, `agent_infos.agent_type != ?`: {models.AgentInfoAgentTypeVideo}, } if search != "" { search = fmt.Sprintf("%%%s%%", strings.ToLower(search)) filters[` LOWER(agent_infos.token_name) like ? or LOWER(agent_infos.token_symbol) like ? or LOWER(agent_infos.token_address) like ? or LOWER(agent_infos.twitter_username) like ? or LOWER(agent_infos.agent_name) like ? or ifnull(twitter_users.twitter_username, "") like ? or ifnull(twitter_users.name, "") like ? or LOWER(agent_infos.display_name) like ? `] = []any{search, search, search, search, search, search, search, search} } //filter agent type if agentType != -1 { if agentType > 0 { filters["agent_infos.agent_type = ?"] = []any{agentType} } else if len(agentTypes) > 0 { filters["agent_infos.agent_type in (?)"] = []any{agentTypes} } else { filters["agent_infos.agent_type not in (?)"] = []any{[]models.AgentInfoAgentType{ models.AgentInfoAgentTypeModel, models.AgentInfoAgentTypeModelOnline, models.AgentInfoAgentTypeJs, models.AgentInfoAgentTypePython, models.AgentInfoAgentTypeInfa, models.AgentInfoAgentTypeCustomUi, models.AgentInfoAgentTypeCustomPrompt, }} } } //filter contract address if len(contractAddresses) > 0 { filters["agent_infos.agent_contract_address in (?)"] = []any{contractAddresses} } //filter agent model if agentModel != "" { filters["agent_infos.agent_base_model = ?"] = []any{agentModel} } if tokenAddress != "" { filters["LOWER(agent_infos.token_address) = ? or agent_infos.agent_id = ? or agent_infos.id = ?"] = []any{strings.ToLower(tokenAddress), tokenAddress, tokenAddress} } else { filters[`(agent_infos.agent_contract_id is not null and agent_infos.agent_contract_id != "") or (agent_infos.token_address is not null and agent_infos.token_address != "") or (agent_infos.agent_type=2 and agent_infos.status="ready")`] = []any{} if networkID == models.SOLANA_CHAIN_ID_OLD { networkID = models.SOLANA_CHAIN_ID } if networkID > 0 { if networkID == models.SHARDAI_CHAIN_ID || networkID == models.SOLANA_CHAIN_ID { filters["agent_infos.network_id = ? or agent_infos.token_network_id = ? or agent_infos.id = 763"] = []any{networkID, networkID} } else if networkID == models.HERMES_CHAIN_ID { filters["agent_infos.network_id = ? or agent_infos.token_network_id = ?"] = []any{networkID, networkID} filters["agent_infos.id != 763"] = []any{} } else if networkID == models.BASE_CHAIN_ID { filters["agent_infos.network_id = ? or agent_infos.token_network_id = ?"] = []any{networkID, networkID} filters["agent_infos.id != 763"] = []any{} } else if networkID == models.ETHEREUM_CHAIN_ID { listEtherModels := []uint64{models.ETHEREUM_CHAIN_ID, models.BASE_CHAIN_ID, models.APE_CHAIN_ID, models.ABSTRACT_TESTNET_CHAIN_ID, models.ARBITRUM_CHAIN_ID} filters["agent_infos.network_id in (?) or agent_infos.token_network_id in (?)"] = []any{listEtherModels, listEtherModels} } else { filters["agent_infos.network_id = ? or agent_infos.token_network_id = ?"] = []any{networkID, networkID} } } } if len(ids) > 0 { filters["agent_infos.id in (?)"] = []any{ids} } else { if includeHidden == nil || !(*includeHidden) { filters["agent_infos.is_public = 1"] = []any{} } //filter instlled app // if installed != nil && userAddress != "" { // if *installed { // joinFilters = map[string][]any{ // ` // left join memes on agent_infos.id = memes.agent_info_id and memes.deleted_at IS NULL // left join agent_token_infos on agent_token_infos.id = agent_infos.token_info_id // left join twitter_users on twitter_users.twitter_id = agent_infos.tmp_twitter_id and agent_infos.tmp_twitter_id is not null // join agent_utility_installs on agent_utility_installs.agent_info_id = agent_infos.id // and agent_utility_installs.deleted_at IS NULL and agent_utility_installs.address = ? // `: {strings.ToLower(userAddress)}, // } // } else { // filters["agent_infos.id not in (select agent_info_id from agent_utility_installs where address = ?)"] = []any{strings.ToLower(userAddress)} // filters["agent_infos.is_public = 1"] = []any{} // } // } else { // filters["agent_infos.is_public = 1"] = []any{} // } } if len(exludeIds) > 0 { filters["agent_infos.id not in (?)"] = []any{exludeIds} } if len(categoryIds) > 0 { filters["agent_infos.agent_category_id in (?)"] = []any{categoryIds} } if userAddress != "" { joinFilters = map[string][]any{ ` left join memes on agent_infos.id = memes.agent_info_id and memes.deleted_at IS NULL left join agent_token_infos on agent_token_infos.id = agent_infos.token_info_id left join twitter_users on twitter_users.twitter_id = agent_infos.tmp_twitter_id and agent_infos.tmp_twitter_id is not null left join agent_utility_recent_chats on agent_utility_recent_chats.agent_info_id = agent_infos.id and agent_utility_recent_chats.address = ? `: {strings.ToLower(userAddress)}, } sortRecentChat := "ifnull(agent_utility_recent_chats.updated_at, now() - interval 100 day) desc" newSortListStr := make([]string, 0, len(sortListStr)+1) newSortListStr = append(newSortListStr, sortRecentChat) newSortListStr = append(newSortListStr, sortListStr...) sortListStr = newSortListStr } sortDefault := "ifnull(agent_infos.priority, 0) desc, meme_market_cap desc" if len(sortListStr) > 0 { sortDefault = strings.Join(sortListStr, ", ") } agents, err := s.dao.FindAgentInfoJoinSelect( daos.GetDBMainCtx(ctx), selected, joinFilters, filters, map[string][]any{ "TwitterInfo": {}, "TmpTwitterInfo": {}, "Meme": {`deleted_at IS NULL and status not in ("created", "pending")`}, "TokenInfo": {}, "AgentCategory": {}, }, []string{sortDefault}, page, limit, ) if err != nil { return nil, 0, errs.NewError(err) } return agents, 0, nil } func (s *Service) GetTokenInfoByContract(ctx context.Context, tokenAddress string) (*dexscreener.PairsDetailResp, error) { var coinInfo dexscreener.PairsDetailResp err := s.RedisCached( fmt.Sprintf("GetTokenInfoByContract_%s", tokenAddress), true, 1*time.Hour, &coinInfo, func() (any, error) { rs, err := s.dexscreener.SearchPairs(tokenAddress) if err != nil { return nil, errs.NewError(err) } if rs != nil { tokenDescription := "" rs.NetworkID = models.GetChainID(rs.ChainId) if rs.Info != nil { for _, item := range rs.Info.Websites { if strings.EqualFold(item.Label, "Website") { webContent := helpers.ContentHtmlByUrl(item.Url) if webContent == "" { webContent = helpers.RodContentHtmlByUrl(item.Url) } if webContent != "" { cleanWebContent, _ := s.blockchainUtils.CleanHtml(webContent) if cleanWebContent != "" { tokenDescription, _ = s.openais["Lama"].SummaryWebContent(cleanWebContent) } } } } if tokenDescription == "" { for _, item := range rs.Info.Socials { if item.Type == "twitter" { twiterPostIDArry := strings.Split(item.Url, "/") if len(twiterPostIDArry) > 0 { twitteUserName := twiterPostIDArry[len(twiterPostIDArry)-1] twiterPostIDArry = strings.Split(twitteUserName, "?") if len(twiterPostIDArry) > 0 { twitteUserName = twiterPostIDArry[0] twitterUser, _ := s.twitterWrapAPI.GetTwitterByUserName(twitteUserName) if twitterUser != nil { tokenDescription = twitterUser.Description } } } } } } } rs.Description = tokenDescription coinInfo = *rs return coinInfo, nil } return nil, errs.NewError(errs.ErrTokenNotFound) }, ) if err != nil { return nil, errs.NewError(err) } return &coinInfo, nil } func (s *Service) GetWebpageText(ctx context.Context, url string) (string, error) { var coinInfo string err := s.RedisCached( fmt.Sprintf("GetWebpageText_%s", url), true, 1*time.Hour, &coinInfo, func() (any, error) { webContent := helpers.ContentHtmlByUrl(url) if webContent == "" { webContent = helpers.RodContentHtmlByUrl(url) } if webContent != "" { coinInfo, _ = s.blockchainUtils.CleanHtml(webContent) } return coinInfo, nil }, ) if err != nil { return "", errs.NewError(err) } return coinInfo, nil } func (s *Service) JobUpdateTokenPriceInfo(ctx context.Context) error { err := s.JobRunCheck( ctx, "JobUpdateTokenPriceInfo", func() error { agents, err := s.dao.FindAgentInfo( daos.GetDBMainCtx(ctx), map[string][]any{ ` agent_contract_id is not null and agent_contract_id != "" and agent_contract_address is not null and agent_contract_address != "" and token_address is not null and token_address != "" and scan_enabled = 1 and agent_nft_minted = 1 `: {}, }, map[string][]any{}, []string{}, 0, 9999, ) if err != nil { return errs.NewError(err) } var retErr error for _, agent := range agents { err = s.UpdateTokenPriceInfo(ctx, agent.ID) if err != nil { retErr = errs.MergeError(retErr, errs.NewError(err)) } time.Sleep(1 * time.Second) } return retErr }, ) if err != nil { return errs.NewError(err) } return nil } func (s *Service) UpdateTokenPriceInfo(ctx context.Context, agentID uint) error { err := s.JobRunCheck( ctx, fmt.Sprintf("UpdateTokenPriceInfo_%d", agentID), func() error { agentInfo, err := s.dao.FirstAgentInfoByID(daos.GetDBMainCtx(ctx), agentID, map[string][]any{}, false, ) if err != nil { return errs.NewError(err) } if agentInfo.TokenAddress != "" && agentInfo.TokenInfoID > 0 { coinInfo, err := s.dexscreener.SearchPairs(agentInfo.TokenAddress) if err != nil { return errs.NewError(err) } if coinInfo != nil && coinInfo.ChainId != "" { _ = daos.GetDBMainCtx(ctx).Model(&models.AgentTokenInfo{}).Where("id = ?", agentInfo.TokenInfoID).Updates( map[string]any{ "price_usd": numeric.NewBigFloatFromString(coinInfo.PriceUsd), "price": numeric.NewBigFloatFromString(coinInfo.PriceNative), "usd_market_cap": coinInfo.MarketCap, "pool_address": coinInfo.PairAddress, "dex_url": coinInfo.Url, "volume_last24h": numeric.NewBigFloatFromFloat(big.NewFloat(coinInfo.Volume.H24)), "base_token_symbol": coinInfo.QuoteToken.Symbol, "price_change": coinInfo.PriceChange.H24, "dex_id": coinInfo.DexId, }, ) } else if agentInfo.TokenNetworkID == models.SOLANA_CHAIN_ID { coinInfo, err := s.pumfunAPI.GetPumpFunCoinInfo(agentInfo.TokenAddress) if err != nil { return errs.NewError(err) } if coinInfo == nil || coinInfo.Mint == "" { return errs.NewError(err) } tknDecimals, err := s.GetSolanaTokenDecimals(agentInfo.TokenAddress) if err != nil { return errs.NewError(err) } coinPrice := coinInfo.UsdMarketCap / (float64(coinInfo.TotalSupply) / math.Pow10(tknDecimals)) _ = daos.GetDBMainCtx(ctx).Model(&models.AgentTokenInfo{}).Where("id = ?", agentInfo.TokenInfoID).Updates( map[string]any{ "price_usd": numeric.NewBigFloatFromFloat(big.NewFloat(coinPrice)), "usd_market_cap": coinInfo.UsdMarketCap, "total_supply": coinInfo.TotalSupply, "dex_id": "pumpfun", }, ) } } return nil }, ) if err != nil { return errs.NewError(err) } return nil } func (s *Service) JobUpdateAgentImage(ctx context.Context) error { err := s.JobRunCheck( ctx, "JobUpdateTokenPriceInfo", func() error { agents, err := s.dao.FindAgentInfo( daos.GetDBMainCtx(ctx), map[string][]any{ ` (token_image_url is null or token_image_url="") and (thumbnail is NULL or thumbnail="") and (nft_token_image is NULL or nft_token_image="") and twitter_info_id = 0 and agent_nft_minted = 1 and network_id not in (43338, 0, 1, 45761, 222671) and network_id = 43114 and system_prompt != "" `: {}, }, map[string][]any{}, []string{"created_at desc"}, 0, 200, ) if err != nil { return errs.NewError(err) } var retErr error for _, agent := range agents { tokenInfo, _ := s.GenerateTokenInfoFromSystemPrompt(ctx, agent.AgentName, agent.SystemPrompt) if tokenInfo != nil && tokenInfo.TokenImageUrl != "" { _ = daos.GetDBMainCtx(ctx).Model(agent).Updates( map[string]any{ "token_image_url": tokenInfo.TokenImageUrl, }, ).Error } time.Sleep(20 * time.Millisecond) } return retErr }, ) if err != nil { return errs.NewError(err) } return nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/agent_brains.go ================================================ package services import ( "context" "fmt" "strings" "time" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/configs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/daos" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/helpers" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/rapid" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/types/numeric" "github.com/google/uuid" "github.com/jinzhu/gorm" ) func (s *Service) GetListAgentTwitterPost(ctx context.Context, networkID uint64, page, limit int) ([]*models.AgentTwitterPost, uint, error) { joinFilters := map[string][]interface{}{ `join agent_infos on agent_infos.id = agent_twitter_posts.agent_info_id`: {}, } selected := []string{ `agent_twitter_posts.*`, } filters := map[string][]interface{}{ `agent_twitter_posts.reply_post_id is not null and agent_twitter_posts.reply_post_id != '' and agent_twitter_posts.reply_post_at is not null`: {}, `agent_twitter_posts.post_type in (?)`: {[]models.AgentSnapshotPostActionType{models.AgentSnapshotPostActionTypeReply, models.AgentSnapshotPostActionTypeTweet, models.AgentSnapshotPostActionTypeTweetV2}}, } if networkID > 0 { filters["agent_infos.network_id = ?"] = []interface{}{networkID} } keys, err := s.dao.FindAgentTwitterPostJoinSelect(daos.GetDBMainCtx(ctx), selected, joinFilters, filters, map[string][]interface{}{ "AgentInfo": {}, "AgentInfo.TwitterInfo": {}, "AgentInfo.TokenInfo": {}, }, []string{"agent_twitter_posts.reply_post_at desc"}, page, limit, ) if err != nil { return nil, 0, errs.NewError(err) } return keys, 0, nil } func (s *Service) GetAgentTwitterPostDetail(ctx context.Context, postID uint) (*models.AgentTwitterPost, error) { post, err := s.dao.FirstAgentTwitterPostByID(daos.GetDBMainCtx(ctx), postID, map[string][]interface{}{ "AgentInfo": {}, }, false, ) if err != nil { return nil, errs.NewError(err) } return post, nil } func (s *Service) GetListAgentEaiTopup(ctx context.Context, agentID string, typeStr string, page, limit int) ([]*models.AgentEaiTopup, uint, error) { if typeStr == "" { typeStr = string(models.AgentEaiTopupTypeDeposit) } joinFilters := map[string][]interface{}{ `join agent_infos on agent_eai_topups.agent_info_id = agent_infos.id`: {}, } selected := []string{ "agent_eai_topups.*", } ms, err := s.dao.FindAgentEaiTopupJoinSelect(daos.GetDBMainCtx(ctx), selected, joinFilters, map[string][]interface{}{ "agent_infos.agent_id = ?": {agentID}, "agent_eai_topups.type = ?": {typeStr}, "agent_eai_topups.status = ?": {models.AgentEaiTopupStatusDone}, }, map[string][]interface{}{ "AgentInfo": {}, }, []string{"agent_eai_topups.id desc"}, page, limit, ) if err != nil { return nil, 0, errs.NewError(err) } return ms, 0, nil } func (s *Service) AgentRequestTwitterShareCode(ctx context.Context, topupAddress string) (string, string, error) { if topupAddress == "" { return "", "", errs.NewError(errs.ErrBadRequest) } agentInfo, err := s.dao.FirstAgentInfo(daos.GetDBMainCtx(ctx), map[string][]interface{}{ "eth_address = ?": {strings.ToLower(topupAddress)}, "network_id = ?": {models.BASE_CHAIN_ID}, }, map[string][]interface{}{}, []string{}, ) if err != nil { return "", "", errs.NewError(errs.ErrBadRequest) } if agentInfo == nil { return "", "", errs.NewError(errs.ErrBadRequest) } authSecretCode := uuid.NewString() authPublicCode := helpers.RandomReferralCode(6) err = s.SetRedisCachedWithKey( fmt.Sprintf("AgentRequestTwitterShareCode_%s", helpers.GenerateMD5(authSecretCode)), &authPublicCode, 20*time.Minute, ) if err != nil { return "", "", errs.NewError(err) } //save db err = s.dao.Save(daos.GetDBMainCtx(ctx), &models.AuthCode{ ETHAddress: strings.ToLower(topupAddress), PublicCode: authPublicCode, SecretCode: helpers.GenerateMD5(authSecretCode), Expired: time.Now().Add(20 * time.Minute), }) if err != nil { return "", "", errs.NewError(err) } return authSecretCode, authPublicCode, nil } func (s *Service) AgentVerifyShareTwitter(ctx context.Context, authSecretCode string, link string) (bool, error) { var authPublicCode string authCode, err := s.dao.FirstAuthCode( daos.GetDBMainCtx(ctx), map[string][]interface{}{ "secret_code = ? ": {helpers.GenerateMD5(authSecretCode)}, "expired >= now()": nil, }, map[string][]interface{}{}, false, ) if err != nil { return false, errs.NewError(err) } if authCode != nil { authPublicCode = authCode.PublicCode } if authPublicCode == "" { return false, errs.NewError(errs.ErrBadRequest) } var twitterUser *rapid.TwitterDetail if link != "" { tweetID := helpers.ExtractTweetID(link) if tweetID != "" { twitterUser, err = s.rapid.GetTwitterUserFromTweetID(tweetID, authPublicCode) if err != nil { return false, errs.NewError(errs.ErrBadRequest) } } } else { twitterUser, err = s.rapid.IsPostForFaucetAgent(authPublicCode) if err != nil { return false, errs.NewError(err) } } if twitterUser == nil || twitterUser.TwitterID == "" { return false, errs.NewError(errs.ErrTwitterIdNotFound) } agentInfo, err := s.dao.FirstAgentInfo(daos.GetDBMainCtx(ctx), map[string][]interface{}{ "eth_address = ?": {authCode.ETHAddress}, }, map[string][]interface{}{}, []string{}, ) if err != nil { return false, errs.NewError(err) } if agentInfo == nil { return false, errs.NewError(errs.ErrAgentNotFound) } historyFaucet, err := s.dao.FirstAgentEaiTopup( daos.GetDBMainCtx(ctx), map[string][]interface{}{ "event_id = ?": {strings.ToLower(authCode.ETHAddress)}, }, map[string][]interface{}{}, []string{}, ) if err != nil { return false, errs.NewError(err) } if historyFaucet == nil { faucetAmount := s.conf.GetConfigKeyString(models.GENERTAL_NETWORK_ID, "agent_faucet_amount") historyFaucet = &models.AgentEaiTopup{ NetworkID: agentInfo.NetworkID, AgentInfoID: agentInfo.ID, EventId: strings.ToLower(authCode.ETHAddress), Type: models.AgentEaiTopupTypeFaucet, Amount: numeric.NewBigFloatFromString(faucetAmount), Status: models.AgentEaiTopupStatusDone, ToAddress: authCode.ETHAddress, Toolset: "faucet", } err = s.dao.Create(daos.GetDBMainCtx(ctx), historyFaucet) if err != nil { return false, errs.NewError(err) } err = daos.GetDBMainCtx(ctx).Model(agentInfo). UpdateColumn("eai_balance", gorm.Expr("eai_balance + ?", historyFaucet.Amount)). UpdateColumn("is_faucet", true). Error if err != nil { return false, errs.NewError(err) } // _ = s.AgentMintNft(ctx, agentInfo.ID) } return true, nil } // /brains func (s *Service) GetAgentBrainHistory(ctx context.Context, agentID string, postID uint, page, limit int) ([]*models.AgentSnapshotPost, uint, error) { joinFilters := map[string][]interface{}{ ` join agent_infos on agent_snapshot_posts.agent_info_id = agent_infos.id and agent_infos.agent_id = ? `: {agentID}, } selected := []string{ "agent_snapshot_posts.*", } filters := map[string][]interface{}{ `agent_snapshot_posts.status = ?`: {models.AgentSnapshotPostStatusInferResolved}, `EXISTS (select 1 from agent_snapshot_post_actions where agent_snapshot_post_id = agent_snapshot_posts.id and status="done")`: {}, } if postID > 0 { filters["agent_snapshot_posts.id = ?"] = []interface{}{postID} } posts, err := s.dao.FindAgentSnapshotPostJoinSelect(daos.GetDBMainCtx(ctx), selected, joinFilters, filters, map[string][]interface{}{ "AgentInfo": {}, "AgentInfo.TwitterInfo": {}, }, []string{"agent_snapshot_posts.created_at desc"}, page, limit, ) if err != nil { return nil, 0, errs.NewError(err) } return posts, 0, nil } func (s *Service) GetBrainDetailByTweetIDBK(ctx context.Context, tweetID string) (*models.AgentSnapshotPost, error) { actionPostAction, err := s.dao.FirstAgentSnapshotPostAction(daos.GetDBMainCtx(ctx), map[string][]interface{}{ "ref_id = ?": {tweetID}, }, map[string][]interface{}{ "AgentSnapshotPost": {}, }, []string{}, ) if err != nil { return nil, errs.NewError(err) } if actionPostAction != nil && actionPostAction.AgentSnapshotPost != nil { return actionPostAction.AgentSnapshotPost, nil } return nil, nil } func (s *Service) GetBrainDetailByTweetID(ctx context.Context, tweetID string) (*models.AgentSnapshotPost, error) { filters := map[string][]interface{}{ `agent_snapshot_posts.status = ?`: {models.AgentSnapshotPostStatusInferResolved}, `EXISTS (select * from agent_snapshot_post_actions where agent_snapshot_post_id = agent_snapshot_posts.id and status="done")`: {}, } if tweetID != "" { filters["agent_snapshot_posts.id = ?"] = []interface{}{tweetID} } posts, err := s.dao.FirstAgentSnapshotPost(daos.GetDBMainCtx(ctx), filters, map[string][]interface{}{ "AgentInfo": {}, "AgentInfo.TwitterInfo": {}, "AgentSnapshotPostAction": {`status = "done"`}, }, []string{}, ) if err != nil { return nil, errs.NewError(err) } return posts, nil } func (s *Service) GetListAgentTwitterLatestPost( ctx context.Context, networkID uint64, agentInfoIDs []uint, page, limit int, ) (map[uint]*models.AgentTwitterPost, error) { joinFilters := map[string][]interface{}{ `join agent_infos on agent_infos.id = agent_twitter_posts.agent_info_id`: {}, } selected := []string{ `agent_twitter_posts.*`, } filters := map[string][]interface{}{ `agent_twitter_posts.reply_post_id is not null and agent_twitter_posts.reply_post_id != ''`: {}, } if networkID > 0 { filters["agent_infos.network_id = ?"] = []interface{}{networkID} } if len(agentInfoIDs) > 0 { filters["agent_twitter_posts.agent_info_id IN (?)"] = []interface{}{agentInfoIDs} } subQuery := ` SELECT agent_twitter_posts.agent_info_id, MAX(agent_twitter_posts.post_at) AS latest_post_at FROM agent_twitter_posts JOIN agent_infos ON agent_infos.id = agent_twitter_posts.agent_info_id WHERE agent_twitter_posts.reply_post_id IS NOT NULL AND agent_twitter_posts.reply_post_id != '' GROUP BY agent_twitter_posts.agent_info_id ` joinFilters[`JOIN (`+subQuery+`) latest_posts ON agent_twitter_posts.agent_info_id = latest_posts.agent_info_id AND agent_twitter_posts.post_at = latest_posts.latest_post_at`] = []interface{}{} keys, err := s.dao.FindAgentTwitterPostJoinSelect(daos.GetDBMainCtx(ctx), selected, joinFilters, filters, map[string][]interface{}{ "AgentInfo": {}, "AgentInfo.TwitterInfo": {}, "AgentInfo.TokenInfo": {}, }, []string{"agent_twitter_posts.reply_post_at desc"}, page, limit, ) if err != nil { return nil, errs.NewError(err) } resp := map[uint]*models.AgentTwitterPost{} for _, v := range keys { resp[v.AgentInfoID] = v } return resp, nil } func (s *Service) GetAgentSnapshotMissionConfigs(ctx context.Context, networkID uint64, platform string) ([]*models.AgentSnapshotMissionConfigs, error) { if platform == "" { platform = string(models.PlatformTypeTwitter) } filters := map[string][]interface{}{ `network_id = ?`: {networkID}, `platform = ?`: {platform}, `is_testing = ?`: {false}, } posts, err := s.dao.FindAgentSnapshotMissionConfigs(daos.GetDBMainCtx(ctx), filters, map[string][]interface{}{}, []string{}, 0, 100, ) if err != nil { return nil, errs.NewError(err) } return posts, nil } func (s *Service) GetAgentSnapshotMissionTokens(ctx context.Context) ([]configs.MissionTokensConfig, error) { return configs.GetMissionTokenConfig() } func (s *Service) GetMapAgentSnapshotMissionTokens(ctx context.Context) (map[string]configs.MissionTokensConfig, error) { resp := map[string]configs.MissionTokensConfig{} arrToken, err := configs.GetMissionTokenConfig() if err != nil { return resp, errs.NewError(err) } for _, item := range arrToken { resp[item.Symbol] = item } return resp, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/agent_create_agent_srv.go ================================================ package services import ( "bytes" "context" "encoding/json" "errors" "fmt" "image" "image/color" "image/draw" "image/jpeg" io "io" "net/http" "regexp" "sort" "strconv" "strings" "time" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/lighthouse" "github.com/sashabaranov/go-openai" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/logger" "go.uber.org/zap" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/daos" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/helpers" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/twitter" "github.com/google/uuid" "github.com/jinzhu/gorm" "github.com/nfnt/resize" ) // func (s *Service) JobScanAgentTwitterPostForCreateAgent(ctx context.Context) error { // err := s.JobRunCheck( // ctx, "JobScanAgentTwitterPostForCreateAgent", // func() error { // agents, err := s.dao.FindAgentInfo( // daos.GetDBMainCtx(ctx), // map[string][]interface{}{ // `id in (?)`: {[]uint{s.conf.EternalAiAgentInfoId}}, // }, // map[string][]interface{}{}, // []string{ // "scan_latest_time asc", // }, // 0, // 2, // ) // if err != nil { // return errs.NewError(err) // } // var retErr error // for _, agent := range agents { // err = s.ScanAgentTwitterPostFroCreateAgent(ctx, agent.ID) // if err != nil { // retErr = errs.MergeError(retErr, errs.NewError(err)) // } // } // return retErr // }, // ) // if err != nil { // return errs.NewError(err) // } // return nil // } func (s *Service) JobScanAgentTwitterPostForGenerateVideo(ctx context.Context) error { err := s.JobRunCheck( ctx, "JobScanAgentTwitterPostForGenerateVideo", func() error { agents, err := s.dao.FindAgentInfo( daos.GetDBMainCtx(ctx), map[string][]interface{}{ `id in (?)`: {[]uint{s.conf.VideoAiAgentInfoId}}, }, map[string][]interface{}{}, []string{ "scan_latest_time asc", }, 0, 2, ) if err != nil { return errs.NewError(err) } var retErr error for _, agent := range agents { err = s.ScanAgentTwitterPostForGenerateVideo(ctx, agent.ID) if err != nil { logger.Info("ScanAgentTwitterPostForGenerateVideo", "err", zap.Any("err", err), zap.Any("agent.id", agent.ID)) retErr = errs.MergeError(retErr, errs.NewError(err)) } } return retErr }, ) if err != nil { return errs.NewError(err) } return nil } // func (s *Service) ScanAgentTwitterPostFroCreateAgent(ctx context.Context, agentID uint) error { // agent, err := s.dao.FirstAgentInfoByID( // daos.GetDBMainCtx(ctx), // agentID, // map[string][]interface{}{}, // false, // ) // if err != nil { // return errs.NewError(err) // } // twitterInfo, err := s.dao.FirstTwitterInfo(daos.GetDBMainCtx(ctx), // map[string][]interface{}{ // "twitter_id = ?": {s.conf.TokenTwiterID}, // }, // map[string][]interface{}{}, // false, // ) // if err != nil { // return errs.NewError(err) // } // if twitterInfo != nil { // err = func() error { // tweetMentions, err := s.twitterWrapAPI.GetListUserMentions(agent.TwitterID, "", twitterInfo.AccessToken, 50) // if err != nil { // return errs.NewError(err) // } // err = s.CreateAgentTwitterPostForCreateAgent(daos.GetDBMainCtx(ctx), agent.ID, agent.TwitterUsername, tweetMentions) // if err != nil { // return errs.NewError(err) // } // return nil // }() // if err != nil { // s.UpdateAgentScanEventError(ctx, agent.ID, err) // return err // } else { // err = s.UpdateAgentScanEventSuccess(ctx, agent.ID, nil, "") // if err != nil { // return errs.NewError(err) // } // } // } // return nil // } func (s *Service) ScanAgentTwitterPostForGenerateVideo(ctx context.Context, agentID uint) error { agent, err := s.dao.FirstAgentInfoByID( daos.GetDBMainCtx(ctx), agentID, map[string][]interface{}{}, false, ) if err != nil { return errs.NewError(err) } twitterInfo, err := s.dao.FirstTwitterInfo(daos.GetDBMainCtx(ctx), map[string][]interface{}{ "twitter_id = ?": {s.conf.TokenTwiterID}, }, map[string][]interface{}{}, false, ) if err != nil { return errs.NewError(err) } if twitterInfo != nil { err = func() error { tweetMentions, err := s.twitterWrapAPI.GetListUserMentions(agent.TwitterID, "", twitterInfo.AccessToken, 100) if err != nil { return errs.NewError(err) } recentSearch, err := s.twitterWrapAPI.SearchRecentTweet(fmt.Sprintf("@%v", agent.TwitterUsername), "", twitterInfo.AccessToken, 100) mentionIds := map[string]bool{} for _, v := range tweetMentions.Tweets { mentionIds[v.ID] = true } if err == nil { for _, v := range recentSearch.LookUps { if len(v.Tweet.ReferencedTweets) > 0 { retweeted := false for _, tweetType := range v.Tweet.ReferencedTweets { if tweetType.Type == "retweeted" { retweeted = true break } } if retweeted { continue } } if v.Tweet.AuthorID != twitterInfo.TwitterID && !mentionIds[v.Tweet.ID] { tweetMentions.Tweets = append(tweetMentions.Tweets, v.Tweet) mentionIds[v.Tweet.ID] = true } } } sort.Slice(tweetMentions.Tweets, func(i, j int) bool { return tweetMentions.Tweets[i].CreatedAt < tweetMentions.Tweets[j].CreatedAt }) err = s.CreateAgentTwitterPostForGenerateVideo(daos.GetDBMainCtx(ctx), agent.ID, tweetMentions) if err != nil { logger.Info("CreateAgentTwitterPostForGenerateVideo", "err", zap.Any("err", err), zap.Any("agent.id", agent.ID)) return errs.NewError(err) } return nil }() if err != nil { s.UpdateAgentScanEventError(ctx, agent.ID, err) return err } else { err = s.UpdateAgentScanEventSuccess(ctx, agent.ID, nil, "") if err != nil { return errs.NewError(err) } } } return nil } // func (s *Service) CreateAgentTwitterPostForCreateAgent(tx *gorm.DB, agentInfoID uint, twitterUsername string, tweetMentions *twitter.UserTimeline) error { // if tweetMentions == nil { // return nil // } // agentInfo, err := s.dao.FirstAgentInfoByID( // tx, // agentInfoID, // map[string][]interface{}{}, // false, // ) // if err != nil { // return errs.NewError(err) // } // if agentInfo == nil { // return errs.NewError(errs.ErrBadRequest) // } // twitterInfo, err := s.dao.FirstTwitterInfo(tx, // map[string][]interface{}{ // "twitter_id = ?": {s.conf.TokenTwiterID}, // }, // map[string][]interface{}{}, // false, // ) // if err != nil { // return errs.NewError(errs.ErrBadRequest) // } // for _, item := range tweetMentions.Tweets { // var checkTwitterID string // err := s.GetRedisCachedWithKey(fmt.Sprintf("CheckedForCreateAgent_%s", item.ID), &checkTwitterID) // if err != nil { // if !strings.EqualFold(item.AuthorID, agentInfo.TwitterID) { // author, err := s.CreateUpdateUserTwitter(tx, item.AuthorID) // if err != nil { // return errs.NewError(errs.ErrBadRequest) // } // if author != nil { // // listContext, err := s.GetConversionHistory(tx, item.ID) // // if err != nil { // // return errs.NewError(errs.ErrBadRequest) // // } // // jsonString, _ := json.Marshal(listContext) // // tokenInfo, _ := s.GetAgentInfoInContent(context.Background(), author.TwitterUsername, string(jsonString)) // // if tokenInfo != nil && (tokenInfo.IsCreateAgent) { // twIDs := []string{item.ID} // twitterDetail, err := s.twitterWrapAPI.LookupUserTweets(twitterInfo.AccessToken, twIDs) // if err != nil { // return errs.NewError(err) // } // if twitterDetail != nil { // for k, v := range *twitterDetail { // if !strings.EqualFold(v.User.ID, agentInfo.TwitterID) { // if strings.EqualFold(k, item.ID) { // fullText := v.Tweet.NoteTweet.Text // if fullText == "" { // fullText = v.Tweet.Text // } // tokenInfo, _ := s.GetAgentInfoInContent(context.Background(), author.TwitterUsername, fullText) // if tokenInfo != nil && (tokenInfo.IsCreateAgent) { // existPosts, err := s.dao.FirstAgentTwitterPost( // tx, // map[string][]interface{}{ // "twitter_post_id = ?": {v.Tweet.ID}, // }, // map[string][]interface{}{}, // []string{}, // ) // if err != nil { // return errs.NewError(err) // } // if existPosts == nil { // postedAt := helpers.ParseStringToDateTimeTwitter(v.Tweet.CreatedAt) // m := &models.AgentTwitterPost{ // NetworkID: agentInfo.NetworkID, // AgentInfoID: agentInfo.ID, // TwitterID: v.User.ID, // TwitterUsername: v.User.UserName, // TwitterName: v.User.Name, // TwitterPostID: v.Tweet.ID, // Content: fullText, // Status: models.AgentTwitterPostStatusNew, // PostAt: postedAt, // TwitterConversationId: v.Tweet.ConversationID, // PostType: models.AgentSnapshotPostActionTypeReply, // IsMigrated: true, // } // m.TokenSymbol = tokenInfo.TokenSymbol // m.TokenName = tokenInfo.TokenName // m.TokenDesc = tokenInfo.TokenDesc // m.Prompt = tokenInfo.Personality // m.AgentChain = tokenInfo.ChainName // m.PostType = models.AgentSnapshotPostActionTypeCreateAgent // m.OwnerTwitterID = m.TwitterID // m.OwnerUsername = m.TwitterUsername // if strings.EqualFold(tokenInfo.ChainName, "base") && tokenInfo.IsIntellect { // m.ExtractContent = "PrimeIntellect/INTELLECT-1-Instruct" // } // // if tokenInfo.Owner != "" { // // twUser, _ := s.CreateUpdateUserTwitterByUserName(tx, tokenInfo.Owner) // // if twUser != nil { // // m.OwnerTwitterID = twUser.TwitterID // // m.OwnerUsername = twUser.TwitterUsername // // } // // } // err = s.dao.Create(tx, m) // if err != nil { // return errs.NewError(err) // } // _, _ = s.CreateUpdateUserTwitter(tx, m.TwitterID) // } // } // } // } // } // } // // } // } // } // } // err = s.SetRedisCachedWithKey( // fmt.Sprintf("CheckedForCreateAgent_%s", item.ID), // item.ID, // 12*time.Hour, // ) // if err != nil { // return errs.NewError(err) // } // } // return nil // } // func (s *Service) JobAgentTwitterPostCreateAgent(ctx context.Context) error { // err := s.JobRunCheck( // ctx, // "JobAgentTwitterPostCreateAgent", // func() error { // var retErr error // { // twitterPosts, err := s.dao.FindAgentTwitterPost( // daos.GetDBMainCtx(ctx), // map[string][]interface{}{ // "agent_info_id in (?)": {[]uint{s.conf.EternalAiAgentInfoId}}, // "status = ?": {models.AgentTwitterPostStatusNew}, // "post_type = ?": {models.AgentSnapshotPostActionTypeCreateAgent}, // }, // map[string][]interface{}{}, // []string{ // "post_at desc", // }, // 0, // 5, // ) // if err != nil { // return errs.NewError(err) // } // for _, twitterPost := range twitterPosts { // err = s.AgentTwitterPostCreateAgent(ctx, twitterPost.ID) // if err != nil { // retErr = errs.MergeError(retErr, errs.NewErrorWithId(err, twitterPost.ID)) // } // } // } // return retErr // }, // ) // if err != nil { // return errs.NewError(err) // } // return nil // } func (s *Service) GetGenerateVideoCheckTweetHandledRedisKey(tweetId string) string { return fmt.Sprintf("CheckedForTweetGenerateVideo_V3_%s", tweetId) } type HandleGenerateVideoRequest struct { TweetID string AgentInfoMentionID uint AgentInfo *models.AgentInfo TwitterInfo *models.TwitterInfo DecideToHandle *bool PromptToHandle *string } func (s *Service) HandleGenerateVideoWithSpecificTweet(tx *gorm.DB, handleRequest *HandleGenerateVideoRequest, source string) (*models.AgentTwitterPost, error) { var err error if handleRequest == nil { return nil, errs.NewError(errs.ErrBadRequest) } tweetId := handleRequest.TweetID agentInfoMentionID := handleRequest.AgentInfoMentionID agentInfo := handleRequest.AgentInfo twitterInfo := handleRequest.TwitterInfo if agentInfo == nil { agentInfo, err = s.dao.FirstAgentInfoByID( tx, agentInfoMentionID, map[string][]interface{}{}, false, ) if err != nil { return nil, errs.NewError(err) } if agentInfo == nil { return nil, errs.NewError(errs.ErrBadRequest) } } if twitterInfo == nil { twitterInfo, err = s.dao.FirstTwitterInfo(tx, map[string][]interface{}{ "twitter_id = ?": {s.conf.TokenTwiterID}, }, map[string][]interface{}{}, false, ) if err != nil { return nil, errs.NewError(errs.ErrBadRequest) } if twitterInfo == nil { return nil, errs.NewError(errs.ErrBadRequest) } } var checkTweetID string if source != "admin_api" { redisKeyToCheckHandled := s.GetGenerateVideoCheckTweetHandledRedisKey(tweetId) err = s.GetRedisCachedWithKey(redisKeyToCheckHandled, &checkTweetID) //err := errors.New("redis:nil") if err == nil && checkTweetID != "" { return nil, nil // already handled } } twIDs := []string{tweetId} twitterDetail, err := s.twitterWrapAPI.LookupUserTweets(twitterInfo.AccessToken, twIDs) if err != nil { s.SendTeleVideoActivitiesAlert(fmt.Sprintf("[ERROR] LookupUserTweets error %v", err)) return nil, errs.NewError(err) } if twitterDetail == nil || len(*twitterDetail) == 0 { s.SendTeleVideoActivitiesAlert(fmt.Sprintf("[ERROR] twitterDetail :%v is nil", tweetId)) return nil, errors.New("twitterDetail is nil") } var existPosts *models.AgentTwitterPost v, exist := (*twitterDetail)[tweetId] if !exist { return nil, errors.New("twitterDetail is nil") } if strings.EqualFold(v.User.ID, agentInfo.TwitterID) { return nil, fmt.Errorf("poster is not match v.user.id:%v , agent.twitterid:%v", v.User.ID, agentInfo.ID) } _, err = s.CreateUpdateUserTwitter(tx, v.User.ID) if err != nil { s.SendTeleVideoActivitiesAlert("[ERROR] CreateUpdateUserTwitter error") return nil, errs.NewError(err) } existPosts, err = s.dao.FirstAgentTwitterPost( tx, map[string][]interface{}{ "twitter_post_id = ?": {v.Tweet.ID}, }, map[string][]interface{}{}, []string{}, ) if err != nil { return nil, errs.NewError(err) } if existPosts != nil { return existPosts, nil } fullText := v.Tweet.GetAllFullText() fullText = strings.Replace(fullText, fmt.Sprintf("@%s", agentInfo.TwitterUsername), "", -1) fullText = strings.TrimSpace(fullText) re := regexp.MustCompile(`^(@[\w_]+\s+)+`) fullText = re.ReplaceAllString(fullText, "") fullText = strings.TrimSpace(fullText) tweetParseInfo, _ := s.ValidateTweetContentGenerateVideo(context.Background(), agentInfo.TwitterUsername, fullText) if handleRequest.DecideToHandle != nil && *handleRequest.DecideToHandle { if tweetParseInfo == nil { tweetParseInfo = &models.TweetParseInfo{} } tweetParseInfo.IsGenerateVideo = true tweetParseInfo.GenerateVideoContent = fullText if handleRequest.PromptToHandle != nil && *handleRequest.PromptToHandle != "" { tweetParseInfo.GenerateVideoContent = *handleRequest.PromptToHandle } } // stop support llm detect create video /*if tweetParseInfo == nil || tweetParseInfo.IsGenerateVideo == false { if s.conf.DetectVideoLLMVersion == "v2" { tweetParseInfo, err = s.ValidateTweetContentGenerateVideoWithLLM2(context.Background(), fullText) } else { tweetParseInfo, err = s.ValidateTweetContentGenerateVideoWithLLM(context.Background(), agentInfo.TwitterUsername, fullText) } if err != nil { return nil, err } }*/ if tweetParseInfo == nil || tweetParseInfo.IsGenerateVideo == false { s.SendTeleVideoActivitiesAlert(fmt.Sprintf("[FAIL_SYNTAX] a requirement gen fail syntax tw_id=%v, tw_user=%v, full_text:%v ", tweetId, v.User.UserName, fullText), s.conf.VideoFailSyntaxTelegramAlert) return nil, nil } if source != "admin_api" { limitPost, err := s.dao.FindAgentTwitterPost( tx, map[string][]interface{}{ "twitter_id = ?": {v.User.ID}, "created_at >= ?": {time.Now().Add(-24 * time.Hour)}, }, map[string][]interface{}{}, []string{}, 0, 10, ) if err != nil { return nil, err } if len(limitPost) >= 10 { s.SendTeleVideoActivitiesAlert(fmt.Sprintf("[SKIP_LIMIT_GEN_VIDEO] gen video, "+ "twitter_user=%v tweet_id=%v, total_24h :%v,post :%v ", v.User.UserName, v.Tweet.ID, fullText, len(limitPost))) return nil, nil } } imageToVideoInfo := s.DetectTweetIsImageToVideo(twitterInfo, v) entityType := models.AgentTwitterPostTypeText2Video extractMediaContent := "" if imageToVideoInfo.IsImageToVideo { entityType = models.AgentTwitterPostTypeImage2video extractMediaContent = imageToVideoInfo.LighthouseImageUrl for { lastIndexOfHTTPs := strings.LastIndex(tweetParseInfo.GenerateVideoContent, "https://") if lastIndexOfHTTPs > 0 { tweetParseInfo.GenerateVideoContent = tweetParseInfo.GenerateVideoContent[:lastIndexOfHTTPs] tweetParseInfo.GenerateVideoContent = strings.TrimSpace(tweetParseInfo.GenerateVideoContent) } else { break } } extractMediaContent, err = s.ModifyTwitterImageRatio(extractMediaContent) if err != nil { return nil, err } } postedAt := helpers.ParseStringToDateTimeTwitter(v.Tweet.CreatedAt) m := &models.AgentTwitterPost{ NetworkID: agentInfo.NetworkID, AgentInfoID: agentInfo.ID, TwitterID: v.User.ID, TwitterUsername: v.User.UserName, TwitterName: v.User.Name, TwitterPostID: v.Tweet.ID, // bai reply Content: fullText, ExtractContent: tweetParseInfo.GenerateVideoContent, ExtractMediaContent: extractMediaContent, Status: models.AgentTwitterPostWaitSubmitVideoInfer, PostAt: postedAt, TwitterConversationId: v.Tweet.ConversationID, // bai goc cua conversation PostType: models.AgentSnapshotPostActionTypeGenerateVideo, IsMigrated: true, InferId: "20250", Type: entityType, } // now support only image to video if entityType != models.AgentTwitterPostTypeImage2video { s.SendTeleVideoActivitiesAlert(fmt.Sprintf("[TEXT_TO_VIDEO_FOUND_SKIP] a requirement gen video, db_id=%v,"+ " twitter_user=%v tweet_id=%v, post :%v ", m.ID, m.TwitterUsername, m.TwitterPostID, fullText)) return nil, nil } err = s.dao.Create(tx, m) if err != nil { return nil, errs.NewError(err) } _, err = s.CreateUpdateUserTwitter(tx, m.TwitterID) if err != nil { s.SendTeleVideoActivitiesAlert("[ERROR] CreateUpdateUserTwitter error") return nil, errs.NewError(err) } s.SendTeleVideoActivitiesAlert(fmt.Sprintf("[FOUND][%v] a requirement gen video, db_id=%v, twitter_user=%v, tweet_id=%v, post :%v ", source, m.ID, m.TwitterUsername, m.TwitterPostID, fullText)) return m, nil } func (s *Service) CreateAgentTwitterPostForGenerateVideo(tx *gorm.DB, agentInfoID uint, tweetMentions *twitter.UserTimeline) error { if tweetMentions == nil { return nil } agentInfo, err := s.dao.FirstAgentInfoByID( tx, agentInfoID, map[string][]interface{}{}, false, ) if err != nil { return errs.NewError(err) } if agentInfo == nil { return errs.NewError(errs.ErrBadRequest) } twitterInfo, err := s.dao.FirstTwitterInfo(tx, map[string][]interface{}{ "twitter_id = ?": {s.conf.TokenTwiterID}, }, map[string][]interface{}{}, false, ) if err != nil { return errs.NewError(errs.ErrBadRequest) } handledTweetID := make([]string, 0, len(tweetMentions.Tweets)) for _, item := range tweetMentions.Tweets { _, err = s.HandleGenerateVideoWithSpecificTweet(tx, &HandleGenerateVideoRequest{ TweetID: item.ID, AgentInfoMentionID: agentInfoID, AgentInfo: agentInfo, TwitterInfo: twitterInfo, }, "scan") if err == nil { handledTweetID = append(handledTweetID, item.ID) } } for _, tweetId := range handledTweetID { redisKeyToCheckHandled := s.GetGenerateVideoCheckTweetHandledRedisKey(tweetId) _ = s.SetRedisCachedWithKey( redisKeyToCheckHandled, tweetId, 1*time.Hour, ) } return nil } func (s *Service) JobAgentTwitterScanResultGenerateVideo(ctx context.Context) error { err := s.JobRunCheck( ctx, "JobAgentTwitterPostCreateAgent", func() error { var retErr error { twitterPosts, err := s.dao.FindAgentTwitterPost( daos.GetDBMainCtx(ctx), map[string][]interface{}{ "status = ?": {models.AgentTwitterPostStatusInferSubmitted}, "infer_id IS NOT NULL AND infer_id <> ? ": {""}, "infer_tx_hash IS NOT NULL AND infer_tx_hash <> ? ": {""}, }, map[string][]interface{}{}, []string{}, 0, 100, ) if err != nil { return errs.NewError(err) } for _, twitterPost := range twitterPosts { url := fmt.Sprintf("%v?infer_id=%v&tx_hash=%v", s.conf.GetResultInferUrl, twitterPost.InferId, twitterPost.InferTxHash) body, _, code, err := helpers.HttpRequest(url, "GET", nil, nil) if err != nil { continue } if code != http.StatusOK { continue } type WorkerProcessHistory struct { CID string `bson:"cid" json:"cid" json:"cid,omitempty"` ResultLink string `bson:"result_link" json:"result_link" json:"result_link,omitempty"` // link to download result for all model: TEXT AND IMAGE ChainID string `bson:"chain_id" json:"chain_id" json:"chain_id,omitempty"` TxHash string `bson:"tx_hash" json:"tx_hash" json:"tx_hash,omitempty"` InferenceInput string `bson:"inference_input" json:"inference_input,omitempty"` } type Response struct { Data WorkerProcessHistory `json:"data"` } response := &Response{} err = json.Unmarshal(body, &response) if err != nil { continue } if len(response.Data.TxHash) == 0 { continue } err = daos.WithTransaction( daos.GetDBMainCtx(ctx), func(tx *gorm.DB) error { twitterPost.Status = models.AgentTwitterPostStatusNew twitterPost.SubmitSolutionTxHash = response.Data.TxHash twitterPost.ImageUrl = strings.ReplaceAll(response.Data.ResultLink, "ipfs://", "https://gateway.lighthouse.storage/ipfs/") err = s.dao.Save(tx, twitterPost) if err != nil { return errs.NewError(err) } prompt := twitterPost.ExtractContent if twitterPost.Type == models.AgentTwitterPostTypeImage2video { inferInput := map[string]interface{}{} json.Unmarshal([]byte(response.Data.InferenceInput), &inferInput) prompt = inferInput["prompt"].(string) } s.SendTeleVideoActivitiesAlert(fmt.Sprintf("success scan result gen video db_id:%v \n infer_id :%v \n result :%v \n \n user prompt :%v \n magic prompt :%v ", twitterPost.ID, twitterPost.InferId, twitterPost.ImageUrl, twitterPost.ExtractContent, prompt)) return nil }) if err != nil { continue } } } return retErr }, ) if err != nil { return errs.NewError(err) } return nil } func (s *Service) JobAgentTwitterScanResultGenerateVideoMagicPrompt(ctx context.Context) error { err := s.JobRunCheck( ctx, "JobAgentTwitterScanResultGenerateVideoMagicPrompt", func() error { var retErr error { twitterPosts, err := s.dao.FindAgentTwitterPost( daos.GetDBMainCtx(ctx), map[string][]interface{}{ "status = ?": {models.AgentTwitterPostStatusReplied}, "infer_id IS NOT NULL AND infer_id <> ? ": {""}, "infer_tx_hash IS NOT NULL AND infer_tx_hash <> ? ": {""}, "infer_magic_id IS NOT NULL AND infer_magic_id <> ? ": {""}, "infer_magic_tx_hash IS NOT NULL AND infer_magic_tx_hash <> ? ": {""}, "submit_solution_magic_tx_hash = ? ": {""}, }, map[string][]interface{}{}, []string{}, 0, 5, ) if err != nil { return errs.NewError(err) } for _, twitterPost := range twitterPosts { url := fmt.Sprintf("%v?infer_id=%v&tx_hash=%v", s.conf.GetResultInferUrl, twitterPost.InferMagicId, twitterPost.InferMagicTxHash) body, _, code, err := helpers.HttpRequest(url, "GET", nil, nil) if err != nil { continue } if code != http.StatusOK { continue } type WorkerProcessHistory struct { CID string `bson:"cid" json:"cid" json:"cid,omitempty"` ResultLink string `bson:"result_link" json:"result_link" json:"result_link,omitempty"` // link to download result for all model: TEXT AND IMAGE ChainID string `bson:"chain_id" json:"chain_id" json:"chain_id,omitempty"` TxHash string `bson:"tx_hash" json:"tx_hash" json:"tx_hash,omitempty"` InferenceInput string `bson:"inference_input" json:"inference_input,omitempty"` } type Response struct { Data WorkerProcessHistory `json:"data"` } response := &Response{} err = json.Unmarshal(body, &response) if err != nil { continue } if len(response.Data.TxHash) == 0 { continue } daos.WithTransaction( daos.GetDBMainCtx(ctx), func(tx *gorm.DB) error { twitterPost.SubmitSolutionMagicTxHash = response.Data.TxHash err = s.dao.Save(tx, twitterPost) return s.dao.Save(tx, twitterPost) }) inferInput := map[string]interface{}{} json.Unmarshal([]byte(response.Data.InferenceInput), &inferInput) s.SendTeleMagicVideoActivitiesAlert(fmt.Sprintf("user prompt :%v \n :%v ", twitterPost.ExtractContent, twitterPost.ImageUrl)) s.SendTeleMagicVideoActivitiesAlert(fmt.Sprintf("magic prompt :%v \n https://gateway.lighthouse.storage/ipfs/%v ", inferInput["prompt"], response.Data.CID)) } } return retErr }, ) if err != nil { return errs.NewError(err) } return nil } func (s *Service) JobAgentTwitterPostCreateClankerToken(ctx context.Context) error { err := s.JobRunCheck( ctx, "JobAgentTwitterPostCreateClankerToken", func() error { var retErr error { twitterPosts, err := s.dao.FindAgentTwitterPost( daos.GetDBMainCtx(ctx), map[string][]interface{}{ "agent_info_id in (?)": {[]uint{s.conf.VideoAiAgentInfoId}}, "status = ?": {models.AgentTwitterPostStatusNew}, "post_type = ?": {models.AgentSnapshotPostActionTypeGenerateVideo}, "token_address = ?": {""}, }, map[string][]interface{}{ "AgentInfo": {}, "AgentInfo.TwitterInfo": {}, }, []string{ "post_at desc", }, 0, 5, ) if err != nil { return errs.NewError(err) } if len(twitterPosts) > 0 { for _, twitterPost := range twitterPosts { var err error if s.conf.Clanker.IsCreateToken { err = s.CreateClankerTokenForVideoByPostID(ctx, twitterPost.ID) if err != nil { retErr = errs.MergeError(retErr, errs.NewErrorWithId(err, twitterPost.ID)) } } } } } return retErr }, ) if err != nil { return errs.NewError(err) } return nil } func (s *Service) JobAgentTwitterPostGenerateVideo(ctx context.Context) error { err := s.JobRunCheck( ctx, "JobAgentTwitterPostGenerateVideo", func() error { var retErr error { twitterPosts, err := s.dao.FindAgentTwitterPost( daos.GetDBMainCtx(ctx), map[string][]interface{}{ "agent_info_id in (?)": {[]uint{s.conf.VideoAiAgentInfoId}}, "status = ?": {models.AgentTwitterPostStatusNew}, "post_type = ?": {models.AgentSnapshotPostActionTypeGenerateVideo}, "token_address != '' and token_address is not null": {}, }, map[string][]interface{}{ "AgentInfo": {}, "AgentInfo.TwitterInfo": {}, }, []string{ "post_at desc", }, 0, 5, ) if err != nil { return errs.NewError(err) } if len(twitterPosts) > 0 { s.UpdateTwitterAccessToken(ctx, twitterPosts[0].AgentInfo.TwitterInfo.ID) for _, twitterPost := range twitterPosts { err := s.AgentTwitterPostGenerateVideoByUserTweetId(ctx, twitterPost.ID) if err != nil { retErr = errs.MergeError(retErr, errs.NewErrorWithId(err, twitterPost.ID)) } } } } return retErr }, ) if err != nil { return errs.NewError(err) } return nil } func (s *Service) AgentTwitterPostGenerateVideoByUserTweetId(ctx context.Context, twitterPostID uint) error { err := s.JobRunCheck( ctx, fmt.Sprintf("AgentTwitterPostGenerateVideoByUserTweetId_%d", twitterPostID), func() error { err := daos.WithTransaction( daos.GetDBMainCtx(ctx), func(tx *gorm.DB) error { twitterPost, err := s.dao.FirstAgentTwitterPostByID( tx, twitterPostID, map[string][]interface{}{ "AgentInfo": {}, "AgentInfo.TwitterInfo": {}, }, false, ) if err != nil { return errs.NewError(err) } if twitterPost.Status == models.AgentTwitterPostStatusNew && twitterPost.PostType == models.AgentSnapshotPostActionTypeGenerateVideo && twitterPost.AgentInfo != nil && twitterPost.AgentInfo.TwitterInfo != nil && twitterPost.TokenAddress != "" { videoUrl := twitterPost.ImageUrl mediaID := "" if videoUrl != "" { mediaID, err = s.twitterAPI.UploadVideo(models.GetImageUrl(videoUrl), []string{twitterPost.AgentInfo.TwitterID}) if err != nil { s.SendTeleVideoActivitiesAlert(fmt.Sprintf("[FAIL] upload video to twitter db_id:%v , err: %v ", twitterPost.ID, err)) } } if mediaID != "" { refId, err := func() (string, error) { var err error for i := 0; i < 5; i++ { time.Sleep(time.Duration(i*5) * time.Second) contentReply := fmt.Sprintf("Hey @%v, here is your decentralized video.\n\nOnchain Prompt: basescan.org/tx/%v\nOnchain Video: basescan.org/tx/%v", twitterPost.TwitterUsername, twitterPost.InferTxHash, twitterPost.SubmitSolutionTxHash) if s.conf.Clanker.IsCreateToken && twitterPost.TokenAddress != "" && twitterPost.TokenName != "" && twitterPost.TokenSymbol != "" { contentReply = fmt.Sprintf("Hey @%v, here is your decentralized video.\n\nOnchain Video: basescan.org/tx/%v\n\nTicker $%s has been deployed.\n\n Contract address: %s\n\n Trade here: https://www.clanker.world/clanker/%s", twitterPost.TwitterUsername, twitterPost.SubmitSolutionTxHash, twitterPost.TokenSymbol, twitterPost.TokenAddress, twitterPost.TokenAddress) } refId, _err := helpers.ReplyTweetByToken(twitterPost.AgentInfo.TwitterInfo.AccessToken, contentReply, twitterPost.TwitterPostID, mediaID) if _err == nil { return refId, nil } else if strings.Contains(_err.Error(), "You attempted to reply to a Tweet that is deleted or not visible to you") { return "", _err } err = _err } return "", err }() if err != nil { s.SendTeleVideoActivitiesAlert(fmt.Sprintf("fail when reply video:\n db_id:%v \n prompt: %v \n err:%v ", twitterPost.ID, twitterPost.ExtractContent, err.Error())) if strings.Contains(err.Error(), "You attempted to reply to a Tweet that is deleted or not visible to you") { twitterPost.Status = models.AgentTwitterPostStatusInvalid err = s.dao.Save(tx, twitterPost) if err != nil { return errs.NewError(err) } } return errs.NewError(err) } twitterPost.ImageUrl = videoUrl twitterPost.ReplyPostId = refId twitterPost.Status = models.AgentTwitterPostStatusReplied err = s.dao.Save(tx, twitterPost) if err != nil { return errs.NewError(err) } s.SendTeleVideoActivitiesAlert(fmt.Sprintf("success gen video reply twitter id=%v,\n, Prompt:%v \n https://x.com/%v/status/%v \n process time :%v", twitterPost.ID, twitterPost.ExtractContent, twitterPost.TwitterUsername, twitterPost.TwitterPostID, time.Since(twitterPost.CreatedAt))) } } return nil }, ) if err != nil { return errs.NewError(err) } return nil }, ) if err != nil { return errs.NewError(err) } return nil } func (s *Service) JobAgentTwitterPostSubmitVideoInfer(ctx context.Context) error { err := s.JobRunCheck( ctx, "JobAgentTwitterPostSubmitVideoInfer", func() error { var retErr error { twitterPosts, err := s.dao.FindAgentTwitterPost( daos.GetDBMainCtx(ctx), map[string][]interface{}{ "agent_info_id in (?)": {[]uint{s.conf.VideoAiAgentInfoId}}, "status = ?": {models.AgentTwitterPostWaitSubmitVideoInfer}, "post_type = ?": {models.AgentSnapshotPostActionTypeGenerateVideo}, }, map[string][]interface{}{}, []string{ "post_at asc", }, 0, 5, ) if err != nil { return errs.NewError(err) } for _, twitterPost := range twitterPosts { err = s.AgentTwitterPostSubmitVideoInferByID(ctx, twitterPost.ID) if err != nil { retErr = errs.MergeError(retErr, errs.NewErrorWithId(err, twitterPost.ID)) } } } return retErr }, ) if err != nil { return errs.NewError(err) } return nil } func (s *Service) AgentTwitterPostSubmitVideoInferByID(ctx context.Context, agentTwitterPostID uint) error { err := s.JobRunCheck( ctx, fmt.Sprintf("AgentTwitterPostSubmitVideoInferByID_%d", agentTwitterPostID), func() error { err := daos.WithTransaction( daos.GetDBMainCtx(ctx), func(tx *gorm.DB) error { twitterPost, err := s.dao.FirstAgentTwitterPostByID( tx, agentTwitterPostID, map[string][]interface{}{ "AgentInfo": {}, "AgentInfo.TwitterInfo": {}, }, false, ) if err != nil { return errs.NewError(err) } isValid := twitterPost.IsValidSubmitVideoInfer() if isValid { if twitterPost.AgentInfo != nil && twitterPost.AgentInfo.TwitterInfo != nil { model := "wan" prompt := twitterPost.ExtractContent if twitterPost.Type == models.AgentTwitterPostTypeImage2video { model = "Wan-I2V" /*if !strings.Contains(twitterPost.Content, "create video:") && !strings.Contains(twitterPost.Content, "create video :") { videoMagicPrompt, err := s.GetVideoMagicPromptFromImage(ctx, twitterPost.ExtractContent, twitterPost.ExtractMediaContent) if err != nil { videoMagicPrompt = prompt } prompt = videoMagicPrompt }*/ promptByte, _ := json.Marshal(map[string]interface{}{ "prompt": prompt, "url": twitterPost.ExtractMediaContent, }) prompt = string(promptByte) } response, _, code, err := helpers.HttpRequest(s.conf.KnowledgeBaseConfig.OnChainUrl, "POST", map[string]string{ "Authorization": fmt.Sprintf("Bearer %v", s.conf.KnowledgeBaseConfig.OnchainAPIKey), }, map[string]interface{}{ "chain_id": "8453", "model": model, "prompt": prompt, "only_create_infer": true, }) if err != nil { return err } if code != http.StatusOK { s.SendTeleVideoActivitiesAlert(fmt.Sprintf("fail when submit infer db_id:%v \n response :%v \n code :%v ", twitterPost.ID, string(response), code)) return fmt.Errorf("agent submit video infer response code %d", code) } type SubmitTaskResponse struct { InferID uint64 TxHash string } type DataResponse struct { Data SubmitTaskResponse `json:"data"` Error string `json:"error"` } dataResponse := DataResponse{} err = json.Unmarshal(response, &dataResponse) if err != nil { return err } if dataResponse.Error != "" { return fmt.Errorf("agent submit video infer response error: %s", dataResponse.Error) } if len(dataResponse.Data.TxHash) == 0 { return fmt.Errorf("agent submit video infer response empty tx hash") } twitterPost.InferTxHash = dataResponse.Data.TxHash twitterPost.InferId = strconv.FormatUint(dataResponse.Data.InferID, 10) now := time.Now().UTC() twitterPost.InferAt = &now twitterPost.Status = models.AgentTwitterPostStatusInferSubmitted err = s.dao.Save(tx, twitterPost) if err != nil { return errs.NewError(err) } s.SendTeleVideoActivitiesAlert(fmt.Sprintf("success submit infer gen video db_id:%v \n infer id :%v \n tx :%v ", twitterPost.ID, twitterPost.InferId, twitterPost.InferTxHash)) } } else { twitterPost.Status = models.AgentTwitterConversationInvalid err = s.dao.Save(tx, twitterPost) if err != nil { return errs.NewError(err) } } return nil }, ) if err != nil { return errs.NewError(err) } return nil }, ) if err != nil { return errs.NewError(err) } return nil } // func (s *Service) AgentTwitterPostCreateAgent(ctx context.Context, twitterPostID uint) error { // err := s.JobRunCheck( // ctx, // fmt.Sprintf("AgentTwitterPostCreateAgent_%d", twitterPostID), // func() error { // agentID := uint(0) // err := daos.WithTransaction( // daos.GetDBMainCtx(ctx), // func(tx *gorm.DB) error { // twitterPost, err := s.dao.FirstAgentTwitterPostByID( // tx, // twitterPostID, // map[string][]interface{}{ // "AgentInfo": {}, // "AgentInfo.TwitterInfo": {}, // }, // false, // ) // if err != nil { // return errs.NewError(err) // } // isValid := true // existPosts, err := s.dao.FindAgentTwitterPost( // tx, // map[string][]interface{}{ // "not EXISTS (select 1 from agent_twitter_posts atp2 where twitter_conversation_id=? and owner_twitter_id =? and post_type='create_agent' and twitter_post_id != agent_twitter_posts.twitter_post_id )": {twitterPost.TwitterConversationId, twitterPost.OwnerTwitterID}, // "owner_twitter_id = ?": {twitterPost.OwnerTwitterID}, // "post_type = ?": {models.AgentSnapshotPostActionTypeCreateAgent}, // "status = ?": {models.AgentTwitterPostStatusReplied}, // "created_at >= adddate(now(), interval -24 hour)": {}, // }, // map[string][]interface{}{}, // []string{}, 0, 5, // ) // if err != nil { // return errs.NewError(err) // } // if existPosts != nil && len(existPosts) >= 3 { // isValid = false // } // if isValid { // if twitterPost.Status == models.AgentTwitterPostStatusNew && // twitterPost.PostType == models.AgentSnapshotPostActionTypeCreateAgent && // twitterPost.AgentInfo != nil { // networkID := models.BASE_CHAIN_ID // if twitterPost.AgentChain != "" { // networkID = models.GetChainID(twitterPost.AgentChain) // } // tokenNetworkID := models.BASE_CHAIN_ID // if networkID == models.APE_CHAIN_ID { // tokenNetworkID = networkID // } // creator := strings.ToLower(s.conf.GetConfigKeyString(models.BASE_CHAIN_ID, "meme_pool_address")) // user, _ := s.dao.FirstUser( // tx, // map[string][]interface{}{ // "network_id = ?": {models.GENERTAL_NETWORK_ID}, // "twitter_id = ?": {twitterPost.GetOwnerTwitterID()}, // }, // map[string][]interface{}{}, // false, // ) // if user != nil { // creator = user.Address // } // agentInfo := &models.AgentInfo{ // NetworkID: networkID, // NetworkName: models.GetChainName(networkID), // SystemPrompt: twitterPost.Prompt, // AgentName: twitterPost.TokenName, // TokenMode: string(models.TokenSetupEnumAutoCreate), // AgentType: models.AgentInfoAgentTypeReasoning, // TmpTwitterID: twitterPost.GetOwnerTwitterID(), // TokenNetworkID: tokenNetworkID, // Version: "2", // AgentID: helpers.RandomBigInt(12).Text(16), // ScanEnabled: true, // Creator: creator, // } // if networkID == models.BASE_CHAIN_ID && twitterPost.ExtractContent != "" { // agentInfo.AgentBaseModel = twitterPost.ExtractContent // } // if agentInfo.AgentBaseModel == "" { // agentInfo.AgentBaseModel = s.GetModelDefaultByChainID(agentInfo.NetworkID) // } // ethAddress, err := s.CreateETHAddress(ctx) // if err != nil { // return errs.NewError(err) // } // agentInfo.ETHAddress = strings.ToLower(ethAddress) // agentInfo.TronAddress = trxapi.AddrEvmToTron(ethAddress) // solAddress, err := s.CreateSOLAddress(ctx) // if err != nil { // return errs.NewError(err) // } // agentInfo.SOLAddress = solAddress // err = s.dao.Create(tx, agentInfo) // if err != nil { // return errs.NewError(err) // } // agentInfo.TokenMode = string(models.TokenSetupEnumAutoCreate) // agentInfo.TokenName = twitterPost.TokenName // agentInfo.TokenSymbol = twitterPost.TokenSymbol // agentInfo.TokenDesc = twitterPost.TokenDesc // agentInfo.TokenNetworkID = tokenNetworkID // agentInfo.SystemPrompt = twitterPost.Prompt // agentInfo.MetaData = twitterPost.Prompt // agentInfo.TokenStatus = "pending" // agentInfo.EaiBalance = numeric.NewBigFloatFromString("50") // agentInfo.Status = models.AssistantStatusPending // agentTokenInfo := &models.AgentTokenInfo{} // agentTokenInfo.AgentInfoID = agentInfo.ID // agentTokenInfo.NetworkID = tokenNetworkID // agentTokenInfo.NetworkName = models.GetChainName(agentTokenInfo.NetworkID) // err = s.dao.Create(tx, agentTokenInfo) // if err != nil { // return errs.NewError(err) // } // agentInfo.TokenInfoID = agentTokenInfo.ID // agentInfo.RefTweetID = twitterPost.ID // err = s.dao.Save(tx, agentInfo) // if err != nil { // return errs.NewError(err) // } // twitterPost.Status = models.AgentTwitterPostStatusReplied // err = s.dao.Save(tx, twitterPost) // if err != nil { // return errs.NewError(err) // } // agentID = agentInfo.ID // } // } else { // twitterPost.Status = models.AgentTwitterConversationInvalid // err = s.dao.Save(tx, twitterPost) // if err != nil { // return errs.NewError(err) // } // } // return nil // }, // ) // if err != nil { // return errs.NewError(err) // } // if agentID > 0 { // _ = s.CreateTokenInfo(ctx, agentID) // // _ = s.AgentMintNft(ctx, agentID) // } // return nil // }, // ) // if err != nil { // return errs.NewError(err) // } // return nil // } // func (s *Service) getContentTwiterForCreateAgent(ownerName, agentName, tokenSymbol, tokenDesc, tokenAddress string) string { // replyContent := fmt.Sprintf(` // Hey @%s, your Eternal AI agent $%s is live. Be the first to buy its AI coin: // https://eternalai.org/agent/%s // %s ($%s): %s // PS: You can activate its autonomous tweeting ability (and soon DeFi trading ability) at https://eternalai.org/connect-x // `, ownerName, tokenSymbol, tokenAddress, agentName, tokenSymbol, tokenDesc) // return strings.TrimSpace(replyContent) // } // func (s *Service) getContentTwiterForCreateAgentV1(ownerName, agentName, tokenSymbol, tokenDesc, tokenAddress, chainName string, agentID uint) string { // replyContent := fmt.Sprintf(` // Hey @%s, your Eternal AI agent %s is now live on %s! // Be the first to buy its token: // https://eternalai.org/%d // %s ($%s): %s // `, ownerName, agentName, chainName, agentID, agentName, tokenSymbol, tokenDesc) // return strings.TrimSpace(replyContent) // } // func (s *Service) ReplyAferAutoCreateAgent(tx *gorm.DB, twitterPostID, agentInfoId uint) error { // if twitterPostID > 0 && agentInfoId > 0 { // twitterPost, err := s.dao.FirstAgentTwitterPostByID( // tx, // twitterPostID, // map[string][]interface{}{ // "AgentInfo": {}, // "AgentInfo.TwitterInfo": {}, // }, // false, // ) // if err != nil { // return errs.NewError(err) // } // agentInfo, err := s.dao.FirstAgentInfoByID( // tx, // agentInfoId, // map[string][]interface{}{}, // false, // ) // if err != nil { // return errs.NewError(err) // } // if twitterPost != nil && agentInfo != nil && twitterPost.AgentInfo != nil && twitterPost.AgentInfo.TwitterInfo != nil && twitterPost.ReplyPostId == "" { // // replyContent := s.getContentTwiterForCreateAgent(twitterPost.GetAgentOnwerName(), agentInfo.AgentName, agentInfo.TokenSymbol, agentInfo.TokenDesc, agentInfo.TokenAddress) // replyContent := s.getContentTwiterForCreateAgentV1(twitterPost.GetAgentOnwerName(), agentInfo.AgentName, agentInfo.TokenSymbol, // agentInfo.TokenDesc, agentInfo.TokenAddress, agentInfo.NetworkName, agentInfo.ID) // refId, err := helpers.ReplyTweetByToken(twitterPost.AgentInfo.TwitterInfo.AccessToken, replyContent, twitterPost.TwitterPostID, "") // if err != nil { // tx.Model(twitterPost).Updates( // map[string]interface{}{ // "error": err.Error(), // }, // ) // } else { // _ = tx.Model(twitterPost).Updates( // map[string]interface{}{ // "reply_post_at": helpers.TimeNow(), // "reply_post_id": refId, // "error": "", // }, // ).Error // //noti tele // bot, err := telego.NewBot(s.conf.Telebot.Alert.Botkey, telego.WithDefaultDebugLogger()) // if err != nil { // return errs.NewError(err) // } // title := "🟡🟡🟡 New Agent Alert! 🟡🟡🟡" // msg := fmt.Sprintf(`just created agent %s https://eternalai.org/agent/%s 👀`, agentInfo.TokenSymbol, agentInfo.TokenAddress) // _, err = bot.SendMessage( // &telego.SendMessageParams{ // ChatID: telego.ChatID{ // ID: s.conf.Telebot.Alert.ChatID, // }, // Text: strings.TrimSpace( // fmt.Sprintf( // ` // %s // %s (@%s) %s // Hey, @JohnEnt, let's do something about this! // `, // title, // twitterPost.TwitterName, // twitterPost.TwitterUsername, // msg, // ), // ), // }, // ) // if err != nil { // return errs.NewError(err) // } // } // } // } // return nil // } // func (s *Service) GetImageUrlFromTokenInfo(tokenSymbol, tokenName, tokenDesc string) (string, error) { // stringBase64 := s.GenerateTokenImageBase64(context.Background(), tokenSymbol, tokenName, tokenDesc) // if stringBase64 != "" { // filename := fmt.Sprintf("%s.%s", uuid.NewString(), "jpg") // urlPath, err := s.gsClient.UploadPublicDataBase64("agent", filename, stringBase64) // if err != nil { // return "", errs.NewError(err) // } // return fmt.Sprintf("%s%s", s.conf.GsStorage.Url, urlPath), nil // } // return "", errs.NewError(errs.ErrBadRequest) // } func (s *Service) GetGifImageUrlFromTokenInfo(tokenSymbol, tokenName, tokenDesc string) (string, error) { stringBase64 := s.GenerateTokenImageBase64Gif(context.Background(), tokenSymbol, tokenName, tokenDesc) if stringBase64 != "" { filename := fmt.Sprintf("%s.%s", uuid.NewString(), "gif") urlPath, err := s.gsClient.UploadPublicDataBase64("agent", filename, stringBase64) if err != nil { return "", errs.NewError(err) } url := fmt.Sprintf("%s%s", s.conf.GsStorage.Url, urlPath) return url, nil } return "", errs.NewError(errs.ErrBadRequest) } func (s *Service) ValidateTweetContentGenerateVideo(ctx context.Context, userName, fullText string) (*models.TweetParseInfo, error) { isGenerateVideo := false fullText = strings.TrimSpace(fullText) inferContent := strings.ToLower(fullText) if strings.Contains(inferContent, fmt.Sprintf("%v", "create video:")) { isGenerateVideo = true index := strings.Index(inferContent, "create video:") inferContent = fullText[index+len("create video:"):] } else if strings.Contains(inferContent, fmt.Sprintf("%v", "create video :")) { isGenerateVideo = true index := strings.Index(inferContent, "create video :") inferContent = fullText[index+len("create video :"):] } else if strings.Contains(inferContent, fmt.Sprintf("%v", "create video")) { isGenerateVideo = true index := strings.Index(inferContent, "create video") inferContent = fullText[index+len("create video"):] } inferContent = strings.TrimSpace(inferContent) if len(inferContent) == 0 && isGenerateVideo { inferContent = fullText } return &models.TweetParseInfo{ IsGenerateVideo: isGenerateVideo, GenerateVideoContent: strings.TrimSpace(inferContent), }, nil } func (s *Service) ValidateTweetContentGenerateVideoWithLLM(ctx context.Context, userName, fullText string) (*models.TweetParseInfo, error) { listSystemPrompts := []string{ "You are an advanced AI tasked with detecting if a tweet on X (formerly Twitter) is **asking for action** related to generating or creating a **video**. Only tweets that contain **imperative verbs** (commands) requesting video creation or generation should return `true`.\\r\\n\\r\\n### **Important Criteria for Detection:**\\r\\n\\r\\n1. **Imperative Verb**: The verb must be used in the **imperative form** to indicate a **command** or direct action (e.g., \\\"Create video,\\\" \\\"Generate video\\\").\\r\\n \\r\\n2. **Context of Video Creation**: The verb must refer specifically to **video creation** and not general content creation or unrelated activities (e.g., \\\"create content,\\\" \\\"make content\\\").\\r\\n\\r\\n3. **Descriptive, Informational Content**: Tweets that mention **features**, **capabilities**, or **future releases** like \\\"**video generation tools**\\\" or \\\"**AI video generation**\\\" should return `false`. These are not actionable requests and are simply **descriptive** or **informational**.\\r\\n\\r\\n4. **No Imperative Action**: If the tweet doesn\\u2019t contain an imperative verb asking the reader to take action related to video creation (e.g., \\\"**create a video**,\\\" \\\"**generate video**\\\"), then it should return `false`.\\r\\n\\r\\n### **Valid Phrases:**\\r\\n- \\\"create video\\\"\\r\\n- \\\"generate video\\\"\\r\\n- \\\"make video\\\"\\r\\n- \\\"build video\\\"\\r\\n- \\\"creat video\\\"\\r\\n- \\\"generaet video\\\"\\r\\n\\r\\nFor snake_case and hyphenated versions:\\r\\n- \\\"create_video\\\"\\r\\n- \\\"generate_video\\\"\\r\\n- \\\"make_video\\\"\\r\\n- \\\"build_video\\\"\\r\\n- \\\"create-video\\\"\\r\\n- \\\"generate-video\\\"\\r\\n\\r\\nThe key point is that the phrase should include a **clear imperative verb** asking for **video generation**.\\r\\n\\r\\n### **Do Not Flag Descriptive Tweets**: \\r\\nDo not flag tweets that describe features, releases, or technologies **without issuing an actionable command**. For example:\\r\\n- \\\"**Video generation tools**\\\" in the context of describing an upcoming release is **not actionable**.\\r\\n- **Example of what to avoid**: \\\"Tomorrow's release includes: Video generation tools.\\\" \\r\\n - This is **informative**, not a **call to action**.\\r\\n - **Correct action**: **Return `false`** for tweets like this.\\r\\n\\r\\n### **Default to `false` if Unclear**:\\r\\nIf the tweet content does not contain a **valid imperative phrase** (e.g., \\\"create video\\\") or if the model is **unsure** whether the tweet is asking for an action, **return `false`**. When in doubt, default to `false`.\\r\\n\\r\\n---\\r\\n\\r\\n### **Response Format**:\\r\\n\\r\\n- The result should always be returned in the following **JSON format**:\\r\\n```json\\r\\n{\\r\\n \\\"is_generate_video\\\": true\\/false\\r\\n}\\r\\n```\\r\\n\\r\\n### **Clarification Example for \\\"Video Generation Tools\\\" Tweet:**\\r\\n\\r\\nIn the case of the tweet you provided, the phrase \\\"**Video generation tools**\\\" is part of an **informational** description about upcoming features, and it is **not actionable**. Therefore, the model should return:\\r\\n\\r\\n```json\\r\\n{\\r\\n \\\"is_generate_video\\\": false\\r\\n}\\r\\n```", "You are an advanced AI tasked with detecting if a tweet on X (formerly Twitter) is **asking for action** related to generating or creating a **video**. Only tweets that contain **imperative verbs** (commands) requesting video creation or generation should return `true`.\\r\\n\\r\\n### **Important Criteria for Detection:**\\r\\n\\r\\n1. **Imperative Verb**: The verb must be used in the **imperative form** to indicate a **command** or direct action (e.g., \\\"Create video,\\\" \\\"Generate video\\\").\\r\\n \\r\\n2. **Context of Video Creation**: The verb must refer specifically to **video creation** and not general content creation or unrelated activities (e.g., \\\"create content,\\\" \\\"make content\\\").\\r\\n\\r\\n3. **Descriptive, Informational Content**: Tweets that mention **features**, **capabilities**, or **future releases** like \\\"**video generation tools**\\\" or \\\"**AI video generation**\\\" should return `false`. These are not actionable requests and are simply **descriptive** or **informational**.\\r\\n\\r\\n4. **No Imperative Action**: If the tweet doesn\\u2019t contain an imperative verb asking the reader to take action related to video creation (e.g., \\\"**create a video**,\\\" \\\"**generate video**\\\"), then it should return `false`.\\r\\n\\r\\n### **Valid Phrases:**\\r\\n- \\\"create video\\\"\\r\\n- \\\"generate video\\\"\\r\\n- \\\"make video\\\"\\r\\n- \\\"build video\\\"\\r\\n- \\\"creat video\\\"\\r\\n- \\\"generaet video\\\"\\r\\n\\r\\nFor snake_case and hyphenated versions:\\r\\n- \\\"create_video\\\"\\r\\n- \\\"generate_video\\\"\\r\\n- \\\"make_video\\\"\\r\\n- \\\"build_video\\\"\\r\\n- \\\"create-video\\\"\\r\\n- \\\"generate-video\\\"\\r\\n\\r\\nThe key point is that the phrase should include a **clear imperative verb** asking for **video generation**.\\r\\n\\r\\n### **Do Not Flag Descriptive Tweets**: \\r\\nDo not flag tweets that describe features, releases, or technologies **without issuing an actionable command**. For example:\\r\\n- \\\"**Video generation tools**\\\" in the context of describing an upcoming release is **not actionable**.\\r\\n- **Example of what to avoid**: \\\"Tomorrow's release includes: Video generation tools.\\\" \\r\\n - This is **informative**, not a **call to action**.\\r\\n - **Correct action**: **Return `false`** for tweets like this.\\r\\n\\r\\n### **Default to `false` if Unclear**:\\r\\nIf the tweet content does not contain a **valid imperative phrase** (e.g., \\\"create video\\\") or if the model is **unsure** whether the tweet is asking for an action, **return `false`**. When in doubt, default to `false`.\\r\\n\\r\\n---\\r\\n\\r\\n### **Response Format**:\\r\\n\\r\\n- The result should always be returned in the following **JSON format**:\\r\\n```json\\r\\n{\\r\\n \\\"is_generate_video\\\": true\\/false\\r\\n}\\r\\n```\\r\\n\\r\\n### **Clarification Example for \\\"Video Generation Tools\\\" Tweet:**\\r\\n\\r\\nIn the case of the tweet you provided, the phrase \\\"**Video generation tools**\\\" is part of an **informational** description about upcoming features, and it is **not actionable**. Therefore, the model should return:\\r\\n\\r\\n```json\\r\\n{\\r\\n \\\"is_generate_video\\\": false\\r\\n}\\r\\n```", "You are an advanced AI tasked with detecting if a tweet on X (formerly Twitter) is **asking for action** related to generating or creating a **video**. Only tweets that contain **imperative verbs** (commands) requesting video creation or generation should return `true`.\\r\\n\\r\\n### **Important Criteria for Detection:**\\r\\n\\r\\n1. **Imperative Verb**: The verb must be used in the **imperative form** to indicate a **command** or direct action (e.g., \\\"Create video,\\\" \\\"Generate video\\\").\\r\\n \\r\\n2. **Context of Video Creation**: The verb must refer specifically to **video creation** and not general content creation or unrelated activities (e.g., \\\"create content,\\\" \\\"make content\\\").\\r\\n\\r\\n3. **Descriptive, Informational Content**: Tweets that mention **features**, **capabilities**, or **future releases** like \\\"**video generation tools**\\\" or \\\"**AI video generation**\\\" should return `false`. These are not actionable requests and are simply **descriptive** or **informational**.\\r\\n\\r\\n4. **No Imperative Action**: If the tweet doesn\\u2019t contain an imperative verb asking the reader to take action related to video creation (e.g., \\\"**create a video**,\\\" \\\"**generate video**\\\"), then it should return `false`.\\r\\n\\r\\n### **Valid Phrases:**\\r\\n- \\\"create video\\\"\\r\\n- \\\"generate video\\\"\\r\\n- \\\"make video\\\"\\r\\n- \\\"build video\\\"\\r\\n- \\\"creat video\\\"\\r\\n- \\\"generaet video\\\"\\r\\n\\r\\nFor snake_case and hyphenated versions:\\r\\n- \\\"create_video\\\"\\r\\n- \\\"generate_video\\\"\\r\\n- \\\"make_video\\\"\\r\\n- \\\"build_video\\\"\\r\\n- \\\"create-video\\\"\\r\\n- \\\"generate-video\\\"\\r\\n\\r\\nThe key point is that the phrase should include a **clear imperative verb** asking for **video generation**.\\r\\n\\r\\n### **Do Not Flag Descriptive Tweets**: \\r\\nDo not flag tweets that describe features, releases, or technologies **without issuing an actionable command**. For example:\\r\\n- \\\"**Video generation tools**\\\" in the context of describing an upcoming release is **not actionable**.\\r\\n- **Example of what to avoid**: \\\"Tomorrow's release includes: Video generation tools.\\\" \\r\\n - This is **informative**, not a **call to action**.\\r\\n - **Correct action**: **Return `false`** for tweets like this.\\r\\n\\r\\n### **Default to `false` if Unclear**:\\r\\nIf the tweet content does not contain a **valid imperative phrase** (e.g., \\\"create video\\\") or if the model is **unsure** whether the tweet is asking for an action, **return `false`**. When in doubt, default to `false`.\\r\\n\\r\\n---\\r\\n\\r\\n### **Response Format**:\\r\\n\\r\\n- The result should always be returned in the following **JSON format**:\\r\\n```json\\r\\n{\\r\\n \\\"is_generate_video\\\": true\\/false\\r\\n}\\r\\n```\\r\\n\\r\\n### **Clarification Example for \\\"Video Generation Tools\\\" Tweet:**\\r\\n\\r\\nIn the case of the tweet you provided, the phrase \\\"**Video generation tools**\\\" is part of an **informational** description about upcoming features, and it is **not actionable**. Therefore, the model should return:\\r\\n\\r\\n```json\\r\\n{\\r\\n \\\"is_generate_video\\\": false\\r\\n}\\r\\n```", } listStatus := make([]bool, 0, len(listSystemPrompts)) for _, systemPrompt := range listSystemPrompts { request := openai.ChatCompletionRequest{ Model: "Llama3.3", Messages: []openai.ChatCompletionMessage{ { Role: "system", Content: systemPrompt, }, { Role: "user", Content: fullText, }, }, } isGenerateVideo := false response, _, code, err := helpers.HttpRequest(s.conf.KnowledgeBaseConfig.DirectServiceUrl, "POST", map[string]string{ "Authorization": fmt.Sprintf("Bearer %v", s.conf.KnowledgeBaseConfig.OnchainAPIKey), }, request) if err != nil { isGenerateVideo = false } if code != http.StatusOK { isGenerateVideo = false } res := openai.ChatCompletionResponse{} err = json.Unmarshal(response, &res) if err != nil { isGenerateVideo = false } if len(res.Choices) > 0 { result := map[string]bool{} res.Choices[0].Message.Content = strings.Replace(res.Choices[0].Message.Content, "```json", "", 1) res.Choices[0].Message.Content = strings.Replace(res.Choices[0].Message.Content, "```", "", 1) err = json.Unmarshal([]byte(res.Choices[0].Message.Content), &result) if err != nil { isGenerateVideo = false } isGenerateVideo = result["is_generate_video"] } listStatus = append(listStatus, isGenerateVideo) } score := 0 for _, status := range listStatus { if status { score++ } } isGenerateVideo := false if score*3 >= len(listStatus)*2 { isGenerateVideo = true } /*if isGenerateVideo { return s.GetPromptFromTweetContentGenerateVideoWithLLM(ctx, userName, fullText) }*/ return &models.TweetParseInfo{ IsGenerateVideo: isGenerateVideo, GenerateVideoContent: fullText, }, nil } func (s *Service) ValidateTweetContentGenerateVideoWithLLM2(ctx context.Context, fullText string) (*models.TweetParseInfo, error) { msg, _ := json.Marshal([]openai.ChatCompletionMessage{ { Role: "system", Content: "You are an AI assistant that verifies whether an input is an video generation prompt.", }, { Role: "user", Content: fmt.Sprintf("Please think carefully and determine whether the content of the tweet/prompt is relevant to a request to create a video/animation/GIF. A tweet/prompt is considered a request to create a video when the content of the tweet/prompt clearly states the INTENT TO CREATE A VIDEO/ANIMATION/GIF for a specific content. NOTE: Link do not affect the content of the tweet/prompt.\n\n- If not, return: 'NONE'\n- If yes, extract only the most important content in the tweet/prompt while keeping the original content intact. If the content cannot be extracted, return to the original prompt:\n\n**RULES:**\n1. **Focus on the core subject:** Identify the main object or scene in the prompt.\n2. **Remove unnecessary descriptions:** Eliminate vague, redundant, or irrelevant words that do not significantly affect the generated video.\n3. **Retain critical elements:** Keep essential aspects such as objects, style, lighting, colors, and composition.\n4. **Use concise and clear language:** Rewrite the prompt in a clear and effective way that maximizes model accuracy.\n5. The content of the extracted tweet MUST be the same as the original tweet content.\n6. If the specific content cannot be extracted from the prompt, return the original prompt.\n7. Return the result in JSON format with the \"optimized_prompt\" key.\n\n**EXAMPLE:**\nINPUT 1: \"create video the man in the photo smile in the rain\"\n\nOUTPUT 1: {\"optimized_prompt\": \"Man in the photo smiling in the rain\"}\n\n\nINPUT 2: \"the character fighting the monster is a woman\"\nOUTPUT 2: {\"optimized_prompt\": \"NONE\"}\n\nApply these rules to optimize prompts effectively.\n\n**Response Format**:\n- The answer should always be returned in the following **JSON format**:\n{\n \"optimized_prompt\": \"\"\n}\r\nUser Query: %v", fullText), }, }) outputChan := make(chan *models.ChatCompletionStreamResponse, 1) errChan := make(chan error, 1) doneChan := make(chan bool, 1) go func() { s.openais["Agent"].CallStreamDirectlyEternalLLM(ctx, string(msg), "Qwen/QwQ-32B", s.conf.KnowledgeBaseConfig.DirectServiceUrl, map[string]interface{}{ "temperature": 0, }, outputChan, errChan, doneChan) }() output := "" thinking := false done := false for !done { select { case <-doneChan: done = true case err := <-errChan: return nil, err case res := <-outputChan: if res.Choices[0].Delta.Content != "" { if strings.Contains(res.Choices[0].Delta.Content, "") { thinking = true } else if strings.Contains(res.Choices[0].Delta.Content, "") { thinking = false continue } if !thinking { output += res.Choices[0].Delta.Content } } case <-time.After(5 * time.Minute): return nil, errors.New("timeout") } } type Result struct { OptimizedPrompt string `json:"optimized_prompt"` } var result Result err := json.Unmarshal([]byte(output), &result) if err != nil { return nil, err } if result.OptimizedPrompt == "NONE" { return &models.TweetParseInfo{ IsGenerateVideo: false, GenerateVideoContent: result.OptimizedPrompt, }, nil } return &models.TweetParseInfo{ IsGenerateVideo: true, GenerateVideoContent: result.OptimizedPrompt, }, nil } type TweetImageToVideo struct { IsImageToVideo bool LighthouseImageUrl string } func (s *Service) UploadImageUrlToLighthouse(ctx context.Context, imageUrl string) (string, error) { filename := fmt.Sprintf("%s", uuid.NewString()) resp, err := http.Get(imageUrl) if err != nil { return "", errs.NewError(err) } defer resp.Body.Close() body, err := io.ReadAll(resp.Body) if err != nil { fmt.Println("Error reading response body:", err) return "", errs.NewError(err) } cid, err := lighthouse.UploadDataWithRetry(s.conf.Lighthouse.Apikey, filename, body) if err != nil { return "", errs.NewError(err) } return cid, nil } func (s *Service) DetectTweetIsImageToVideo(twitterInfo *models.TwitterInfo, item twitter.TweetLookup) *TweetImageToVideo { isImageToVideo := false cid := "" var err error if len(item.AttachmentMedia) > 0 { fmt.Println("medias", item.AttachmentMedia) firstMedia := item.AttachmentMedia[0] if firstMedia.Type == "photo" { isImageToVideo = true // TODO first return &TweetImageToVideo{ IsImageToVideo: isImageToVideo, LighthouseImageUrl: firstMedia.URL, } cid, err = s.UploadImageUrlToLighthouse(context.Background(), firstMedia.URL) if err == nil && cid != "" { isImageToVideo = true } } } if len(item.Tweet.ReferencedTweets) > 0 { for _, refTweet := range item.Tweet.ReferencedTweets { if refTweet.Type == "quoted" { refTweetID := refTweet.ID refTweetDetails, err := s.twitterWrapAPI.LookupUserTweets(twitterInfo.AccessToken, []string{refTweetID}) if err == nil && refTweetDetails != nil { for k, v := range *refTweetDetails { if k != refTweetID { continue } if len(v.AttachmentMedia) > 0 { firstMedia := v.AttachmentMedia[0] if firstMedia.Type == "photo" { isImageToVideo = true // TODO first return &TweetImageToVideo{ IsImageToVideo: isImageToVideo, LighthouseImageUrl: firstMedia.URL, } cid, err = s.UploadImageUrlToLighthouse(context.Background(), firstMedia.URL) if err == nil && cid != "" { isImageToVideo = true } } } } } } if refTweet.Type == "replied_to" { resp, err := s.GetFirstImageFromTweet(twitterInfo, refTweet.ID) if err == nil && resp != nil { return resp } } } } return &TweetImageToVideo{ IsImageToVideo: isImageToVideo, LighthouseImageUrl: lighthouse.IPFSGateway + cid, } } func (s *Service) ModifyTwitterImageRatio(imageUrl string) (string, error) { res, err := http.Get(imageUrl) if err != nil { return "", err } if res.StatusCode != http.StatusOK { return "", errors.New(res.Status) } defer res.Body.Close() data, err := io.ReadAll(res.Body) if err != nil { return "", err } imageInfo, _, err := image.Decode(bytes.NewReader(data)) if err != nil { return imageUrl, nil } width := float64(imageInfo.Bounds().Dx()) height := float64(imageInfo.Bounds().Dy()) ratio := height / width if ratio <= 2.5 && ratio >= 0.4 { return imageUrl, nil } newWidth := imageInfo.Bounds().Dx() newHeight := newWidth * 2 / 5 // height = width/2.5 if width < height { newHeight = imageInfo.Bounds().Dy() newWidth = newHeight * 2 / 5 // width = height/2.5 } resizedImg := resize.Resize(uint(newWidth), uint(newHeight), imageInfo, resize.Lanczos3) filledImg := image.NewRGBA(image.Rect(0, 0, newWidth, newHeight)) dstRect := image.Rect(0, 0, resizedImg.Bounds().Dx(), resizedImg.Bounds().Dy()) draw.Draw(filledImg, filledImg.Bounds(), &image.Uniform{C: color.White}, image.Point{}, draw.Src) // Fill with white draw.Draw(filledImg, dstRect, resizedImg, image.Point{}, draw.Over) var buf bytes.Buffer err = jpeg.Encode(&buf, filledImg, nil) if err != nil { return "", err } response, err := http.Post(s.conf.LighthouseUploadBinaryUrl, "", bytes.NewReader(buf.Bytes())) if err != nil { return "", err } defer response.Body.Close() if res.StatusCode != http.StatusOK { return "", errors.New(res.Status) } output, err := io.ReadAll(response.Body) if err != nil { return "", err } type LightHouseResult struct { Error string `json:"error"` Data string `json:"data"` } var result LightHouseResult err = json.Unmarshal(output, &result) if err != nil { return "", err } if len(result.Error) > 0 { return "", errors.New(result.Error) } if len(result.Data) == 0 { return "", errors.New("can not upload image to lighthouse") } return strings.ReplaceAll(result.Data, "ipfs://", "https://gateway.lighthouse.storage/ipfs/"), err } func (s *Service) GetFirstImageFromTweet(twitterInfo *models.TwitterInfo, tweetID string) (*TweetImageToVideo, error) { var getImage func(tweetID string) (*TweetImageToVideo, error) getImage = func(tweetID string) (*TweetImageToVideo, error) { tweetDetails, err := s.twitterWrapAPI.LookupUserTweets(twitterInfo.AccessToken, []string{tweetID}) if err != nil { return nil, err } if tweetDetails == nil { return nil, fmt.Errorf("no tweet found") } for _, tweet := range *tweetDetails { if len(tweet.AttachmentMedia) > 0 { firstMedia := tweet.AttachmentMedia[0] if firstMedia.Type == "photo" { return &TweetImageToVideo{ IsImageToVideo: true, LighthouseImageUrl: firstMedia.URL, }, nil } } for _, refTweet := range tweet.Tweet.ReferencedTweets { if refTweet.Type == "replied_to" { return getImage(refTweet.ID) } } } return nil, fmt.Errorf("no image found in tweet or its references") } return getImage(tweetID) } func (s *Service) GetPromptFromTweetContentGenerateVideoWithLLM(ctx context.Context, userName, fullText string) (*models.TweetParseInfo, error) { request := openai.ChatCompletionRequest{ Model: "Llama3.3", Messages: []openai.ChatCompletionMessage{ openai.ChatCompletionMessage{ Role: "system", Content: "You are an advanced AI tasked with accurately detecting if a tweet on X (formerly Twitter) mentions generating or creating a video. Pay close attention to the phrasing used by the user, including common misspellings, variations, case-insensitivity, and the use of snake_case or hyphenated notation. Before answering, carefully evaluate the content of the tweet, ensuring that it directly references video creation or generation. Respond with the highest accuracy possible and provide a relevant video prompt.\n\nReturn the response in the following JSON format:\n{\n \"prompt\": \"\"\n}\nYour response should reflect whether the tweet is related to video generation or not. Think critically about context and phrasing to ensure the most accurate determination.", }, openai.ChatCompletionMessage{ Role: "user", Content: fullText, }, }, } response, _, code, err := helpers.HttpRequest(s.conf.KnowledgeBaseConfig.DirectServiceUrl, "POST", map[string]string{ "Authorization": fmt.Sprintf("Bearer %v", s.conf.KnowledgeBaseConfig.OnchainAPIKey), }, request) if err != nil { return nil, err } if code != http.StatusOK { return nil, fmt.Errorf("err while get response code:%v ,body:%v", code, string(response)) } res := openai.ChatCompletionResponse{} err = json.Unmarshal(response, &res) if err != nil { return nil, err } prompt := "" if len(res.Choices) > 0 { result := map[string]string{} err = json.Unmarshal([]byte(res.Choices[0].Message.Content), &result) if err != nil { return nil, err } prompt = result["prompt"] } return &models.TweetParseInfo{ IsGenerateVideo: true, GenerateVideoContent: strings.TrimSpace(prompt), }, nil } // func (s *Service) GetAgentInfoInContent(ctx context.Context, userName, fullText string) (*models.TweetParseInfo, error) { // info := &models.TweetParseInfo{ // IsCreateToken: false, // IsCreateAgent: false, // } // fullText = strings.ReplaceAll(fullText, "@CryptoEternalAI", "") // if strings.Contains(fullText, `🍌`) { // info.IsCreateAgent = true // info.ChainName = "apechain" // promptGenerateToken := fmt.Sprintf(` // I want to generate my agent infomation base on this info // '%s' // Agent name (generate if not provided, make sure it not empty and not similar to "EAI" or "Eternal AI" or "CryptoEternalAI" or "Crypto Eternal AI) // Agent token symbol (generate if not provided, generate if not provided, make sure it not empty and not similar to "EAI" or "Eternal AI" or "CryptoEternalAI" or "Crypto Eternal AI) // Agent backstory (generate if not provided, generate if not provided, make sure it not empty and not referencing "EAI" or "Eternal AI" or "CryptoEternalAI" or "Crypto Eternal AI) // Agent personality (predefined instruction to guide the Agent's behavior during a conversation or task, generate if not provided) // Return a JSON response with the following format: // {"name": "", "symbol": "", "story": "", "personality": ""} // Respond with only the JSON string, without any additional explanation. // `, fullText) // aiStr, err := s.openais["Lama"].ChatMessage(promptGenerateToken) // if err != nil { // return info, nil // } // fmt.Println(aiStr) // if aiStr != "" { // mapInfo := helpers.ExtractMapInfoFromOpenAI(aiStr) // if mapInfo != nil { // if v, ok := mapInfo["personality"]; ok { // info.Personality = fmt.Sprintf(`%v`, v) // } // if v, ok := mapInfo["name"]; ok { // info.TokenName = fmt.Sprintf(`%v`, v) // } // if v, ok := mapInfo["symbol"]; ok { // info.TokenSymbol = fmt.Sprintf(`%v`, v) // } // if v, ok := mapInfo["story"]; ok { // info.TokenDesc = fmt.Sprintf(`%v`, v) // } // if v, ok := mapInfo["personality"]; ok { // info.Personality = fmt.Sprintf(`%v`, v) // } // } // } // } else { // userPrompt := fmt.Sprintf(` // Detect Agent Creation Request // This is the user conversation: "%s". // From this conversation determine if the user is requesting you to create an agent, also referred as a decentralized agent (dagent), look for a direct and unambiguous statement that explicitly asks to create an agent. This statement must be clear, concise, and isolated from any surrounding context that may alter its meaning. // If yes, extract or generate the following information: // Answer ("yes" or "no") // Owner (who is the owner of the agent) // Agent name (generate if not provided, make sure it not empty and not similar to "EAI" or "Eternal AI") // Agent token symbol (generate if not provided, generate if not provided, make sure it not empty and not similar to "EAI" or "Eternal AI") // Agent backstory (generate if not provided, generate if not provided, make sure it not empty and not referencing "EAI" or "Eternal AI") // Blockchain ("base" if not provided, "base" or "arbitrum" or "bsc" or "bnbchain" or "binancechain" or "polygon" or "avax" or "avalanche" or "apechain") // Is Intellect Model ("yes" or "no") // Agent personality (predefined instruction to guide the Agent's behavior during a conversation or task, generate if not provided) // Return a JSON response with the following format: // {"answer": "yes/no", "owner": "", "name": "", "symbol": "", "story": "", "blockchain": "", "personality": "", , "is_intellect": ""} // Respond with only the JSON string, without any additional explanation. // `, fullText) // fmt.Println(userPrompt) // aiStr, err := s.openais["Lama"].ChatMessage(strings.TrimSpace(userPrompt)) // if err != nil { // return info, nil // } // if aiStr != "" { // mapInfo := helpers.ExtractMapInfoFromOpenAI(aiStr) // if mapInfo != nil { // answer := "no" // if v, ok := mapInfo["answer"]; ok { // answer = fmt.Sprintf(`%v`, v) // } // if strings.EqualFold(answer, "yes") { // info.IsCreateAgent = true // if v, ok := mapInfo["personality"]; ok { // info.Personality = fmt.Sprintf(`%v`, v) // } // if v, ok := mapInfo["name"]; ok { // info.TokenName = fmt.Sprintf(`%v`, v) // } // if v, ok := mapInfo["symbol"]; ok { // info.TokenSymbol = fmt.Sprintf(`%v`, v) // } // if v, ok := mapInfo["story"]; ok { // info.TokenDesc = fmt.Sprintf(`%v`, v) // } // if v, ok := mapInfo["blockchain"]; ok { // info.ChainName = strings.ToLower(fmt.Sprintf(`%v`, v)) // } // if v, ok := mapInfo["owner"]; ok { // info.Owner = strings.ToLower(fmt.Sprintf(`%v`, v)) // } // if v, ok := mapInfo["is_intellect"]; ok { // if strings.ToLower(fmt.Sprintf(`%v`, v)) == "yes" { // info.IsIntellect = true // } // } // } // } // } // } // return info, nil // } func (s *Service) GetImageUrlForBase64(stringBase64 string) (string, error) { if stringBase64 != "" { filename := fmt.Sprintf("%s.%s", uuid.NewString(), "jpg") urlPath, err := s.gsClient.UploadPublicDataBase64("tweetv2", filename, stringBase64) if err != nil { return "", errs.NewError(err) } return fmt.Sprintf("%s%s", s.conf.GsStorage.Url, urlPath), nil } return "", errs.NewError(errs.ErrBadRequest) } // ///////////////// // func (s *Service) CreateAgentTwitterPostByTweetID(tx *gorm.DB, tweetID string) error { // agentInfo, err := s.dao.FirstAgentInfoByID( // tx, // s.conf.EternalAiAgentInfoId, // map[string][]interface{}{}, // false, // ) // if err != nil { // return errs.NewError(err) // } // if agentInfo == nil { // return errs.NewError(errs.ErrBadRequest) // } // twitterInfo, err := s.dao.FirstTwitterInfo(tx, // map[string][]interface{}{ // "twitter_id = ?": {s.conf.TokenTwiterID}, // }, // map[string][]interface{}{}, // false, // ) // if err != nil { // return errs.NewError(errs.ErrBadRequest) // } // twIDs := []string{tweetID} // twitterDetail, err := s.twitterWrapAPI.LookupUserTweets(twitterInfo.AccessToken, twIDs) // if err != nil { // return errs.NewError(err) // } // if twitterDetail != nil { // for k, v := range *twitterDetail { // if !strings.EqualFold(v.User.ID, agentInfo.TwitterID) { // if strings.EqualFold(k, tweetID) { // fullText := v.Tweet.NoteTweet.Text // if fullText == "" { // fullText = v.Tweet.Text // } // // listContext, err := s.GetConversionHistory(tx, v.Tweet.ID) // // if err != nil { // // return errs.NewError(errs.ErrBadRequest) // // } // // jsonString, _ := json.Marshal(listContext) // // tokenInfo, _ := s.GetAgentInfoInContent(context.Background(), v.User.UserName, string(jsonString)) // tokenInfo, _ := s.GetAgentInfoInContent(context.Background(), v.User.UserName, fullText) // // tokenInfo := &models.TweetParseInfo{ // // IsCreateAgent: true, // // TokenName: "GrowkAI", // // TokenSymbol: "GROWK", // // ChainName: "arbitrum", // // TokenDesc: "Growk is a frog based regen meme that will forever change the way we think of memes and public goods", // // Personality: "Be friendly and helpful, and provide information about the Growk meme and its community", // // Owner: v.User.UserName, // // } // if tokenInfo != nil && (tokenInfo.IsCreateAgent) { // isValid := true // existPosts, err := s.dao.FirstAgentTwitterPost( // tx, // map[string][]interface{}{ // "twitter_post_id = ?": {v.Tweet.ID}, // }, // map[string][]interface{}{}, // []string{}, // ) // if err != nil { // return errs.NewError(err) // } // if existPosts != nil { // isValid = false // } // if isValid { // postedAt := helpers.ParseStringToDateTimeTwitter(v.Tweet.CreatedAt) // m := &models.AgentTwitterPost{ // NetworkID: agentInfo.NetworkID, // AgentInfoID: agentInfo.ID, // TwitterID: v.User.ID, // TwitterUsername: v.User.UserName, // TwitterName: v.User.Name, // TwitterPostID: v.Tweet.ID, // Content: fullText, // Status: models.AgentTwitterPostStatusNew, // PostAt: postedAt, // TwitterConversationId: v.Tweet.ConversationID, // PostType: models.AgentSnapshotPostActionTypeReply, // IsMigrated: true, // } // m.TokenSymbol = tokenInfo.TokenSymbol // m.TokenName = tokenInfo.TokenName // m.TokenDesc = tokenInfo.TokenDesc // m.Prompt = tokenInfo.Personality // m.AgentChain = tokenInfo.ChainName // m.PostType = models.AgentSnapshotPostActionTypeCreateAgent // m.OwnerTwitterID = m.TwitterID // m.OwnerUsername = m.TwitterUsername // if tokenInfo.Owner != "" { // twUser, _ := s.CreateUpdateUserTwitterByUserName(tx, tokenInfo.Owner) // if twUser != nil { // m.OwnerTwitterID = twUser.TwitterID // m.OwnerUsername = twUser.TwitterUsername // } // } // err = s.dao.Create(tx, m) // if err != nil { // return errs.NewError(err) // } // _, _ = s.CreateUpdateUserTwitter(tx, m.TwitterID) // } // } // } // } // } // } // return nil // } // func (s *Service) BuildConversionHistory(tx *gorm.DB, tweetID string) (string, error) { // userPrompt := "" // listContext, _ := s.GetConversionHistory(tx, tweetID) // if len(listContext) > 0 { // for _, item := range listContext { // userPrompt += fmt.Sprintf(` // @%s: %s // `, item["twitter_username"], item["text"]) // } // } // return userPrompt, nil // } // func (s *Service) GetConversionHistory(tx *gorm.DB, tweetID string) ([]map[string]string, error) { // listContext := []map[string]string{} // twitterInfo, err := s.dao.FirstTwitterInfo(tx, // map[string][]interface{}{ // "twitter_id = ?": {s.conf.TokenTwiterID}, // }, // map[string][]interface{}{}, // false, // ) // if err != nil { // return listContext, errs.NewError(err) // } // if twitterInfo != nil { // twIDs := []string{tweetID} // twitterDetail, err := s.twitterWrapAPI.LookupUserTweets(twitterInfo.AccessToken, twIDs) // if err != nil { // return listContext, errs.NewError(err) // } // if twitterDetail != nil { // for k, v := range *twitterDetail { // if strings.EqualFold(k, tweetID) { // context := map[string]string{} // context["user"] = v.User.UserName // context["message"] = v.Tweet.NoteTweet.Text // if context["message"] == "" { // context["message"] = v.Tweet.Text // } // listContext = append([]map[string]string{context}, listContext...) // isValid := true // referencedTweets := v.ReferencedTweets // i := 1 // for { // if len(referencedTweets) > 0 { // refTw := referencedTweets[0] // contextRef := map[string]string{} // contextRef["user"] = refTw.User.UserName // contextRef["message"] = refTw.Tweet.NoteTweet.Text // if contextRef["message"] == "" { // contextRef["message"] = refTw.Tweet.Text // } // listContext = append([]map[string]string{contextRef}, listContext...) // twIDRefs := []string{refTw.Tweet.ID} // twitterDetailRef, err := s.twitterWrapAPI.LookupUserTweets(twitterInfo.AccessToken, twIDRefs) // if err != nil { // isValid = false // } // if twitterDetailRef != nil { // for kr, vr := range *twitterDetailRef { // if strings.EqualFold(kr, refTw.Tweet.ID) { // if len(vr.ReferencedTweets) > 0 { // referencedTweets = vr.ReferencedTweets // } else { // isValid = false // } // } // } // } else { // isValid = false // } // } // i += 1 // if !isValid || i >= 4 { // break // } // } // } // } // } // } // return listContext, nil // } // func (s *Service) GenerateTokenImageBase64(ctx context.Context, tokenSymbol, tokenName, tokenDesc string) string { // imagePrompt := fmt.Sprintf(` // I want to create image for a token base on this info // Token Symbol: %s // Token name: %s // Token Description: %s // `, tokenSymbol, tokenName, tokenDesc) // base64Str, _ := s.dojoAPI.GenerateImage(imagePrompt, s.conf.GenerateImageUrl) // return base64Str // } func (s *Service) GenerateTokenImageBase64Gif(ctx context.Context, tokenSymbol, tokenName, tokenDesc string) string { imagePrompt := fmt.Sprintf(` I want to create image for a token base on this info Token Symbol: %s Token name: %s Token Description: %s `, tokenSymbol, tokenName, tokenDesc) base64Str, _ := s.dojoAPI.GenerateImage(imagePrompt, s.conf.GenerateGifImageUrl) return base64Str } func (s *Service) GetConversationIdByTweetID(tx *gorm.DB, tweetID string) string { conversationId := "" m, err := s.dao.FirstAgentTwitterPost( tx, map[string][]interface{}{ "twitter_post_id = ? ": {tweetID}, }, map[string][]interface{}{}, []string{}, ) if err != nil { return tweetID } if m != nil { conversationId = m.TwitterConversationId } if conversationId == "" { twitterInfo, err := s.dao.FirstTwitterInfo(tx, map[string][]interface{}{ "twitter_id = ?": {s.conf.TokenTwiterID}, }, map[string][]interface{}{}, false, ) if err != nil { return tweetID } if twitterInfo != nil { tweetDetail, err := s.twitterWrapAPI.LookupTweetsByID(twitterInfo.AccessToken, tweetID) if err != nil { return tweetID } if tweetDetail != nil { conversationId = tweetDetail.ConversationID } } } if conversationId == "" { return tweetID } return conversationId } func (s *Service) GetPostTimeByTweetID(tx *gorm.DB, tweetID string) *time.Time { var postTime *time.Time m, err := s.dao.FirstAgentTwitterPost( tx, map[string][]interface{}{ "twitter_post_id = ? ": {tweetID}, }, map[string][]interface{}{}, []string{}, ) if err != nil { panic(err) } if m != nil { postTime = m.PostAt } if postTime == nil { twitterInfo, err := s.dao.FirstTwitterInfo(tx, map[string][]interface{}{ "twitter_id = ?": {s.conf.TokenTwiterID}, }, map[string][]interface{}{}, false, ) if err != nil { panic(err) } if twitterInfo != nil { tweetDetail, _ := s.twitterWrapAPI.LookupTweetsByID(twitterInfo.AccessToken, tweetID) if tweetDetail != nil { createdAt, err := time.Parse(time.RFC3339, tweetDetail.CreatedAt) if err != nil { panic(err) } postTime = &createdAt } } } if postTime == nil { postTime = helpers.TimeNow() } return postTime } func (s *Service) TestVideo(ctx context.Context) { videoUrl := "https://gateway.lighthouse.storage/ipfs/bafybeia7y5xp74komdtmiisunemiod56tqhotglzkke4ym66tvx4ywz7u4" mediaID := "" var err error if videoUrl != "" { mediaID, err = s.twitterAPI.UploadVideo(models.GetImageUrl(videoUrl), []string{s.conf.TokenTwiterID}) if err != nil { fmt.Println(err.Error()) } } if mediaID != "" { twitterInfo, err := s.dao.FirstTwitterInfo(daos.GetDBMainCtx(ctx), map[string][]interface{}{ "twitter_id = ?": {s.conf.TokenTwiterID}, }, map[string][]interface{}{}, false, ) // post truc tiep reply, luu lai reply_id refId, err := helpers.ReplyTweetByToken(twitterInfo.AccessToken, "DONE", "1895369759690219863", mediaID) if err != nil { fmt.Println(err.Error()) } fmt.Println(refId) } } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/agent_create_token_video.go ================================================ package services import ( "context" "encoding/json" "fmt" "strings" "time" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/daos" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/helpers" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/sashabaranov/go-openai" ) func (s *Service) JobAgentTwitterPostCreateTokenForImage2Video(ctx context.Context) error { err := s.JobRunCheck( ctx, "JobAgentTwitterPostCreateTokenForImage2Video", func() error { var retErr error { twitterPosts, err := s.dao.FindAgentTwitterPost( daos.GetDBMainCtx(ctx), map[string][]interface{}{ "agent_info_id in (?)": {[]uint{s.conf.VideoAiAgentInfoId}}, "status = ?": {models.AgentTwitterPostStatusInferSubmitted}, "post_type = ? and type = ?": {models.AgentSnapshotPostActionTypeGenerateVideo, models.AgentTwitterPostTypeImage2video}, "token_name = '' and token_symbol = ''": {}, "created_at > ?": {time.Now().Add(-1 * time.Hour)}, // only submitted before 1 hour }, map[string][]interface{}{}, []string{ "created_at asc", }, 0, 20, ) if err != nil { return errs.NewError(err) } for _, agentTwitterPost := range twitterPosts { err = s.AgentTwitterPostGenerateTokenInfo(ctx, agentTwitterPost.ID) if err != nil { retErr = errs.MergeError(retErr, errs.NewErrorWithId(err, agentTwitterPost.ID)) } else { redisKey := s.GetRedisAgentTwitterPostGenerateTokenInfo(agentTwitterPost.ID) _ = s.rdb.Set(redisKey, "1", 24*time.Hour).Err() } } } return retErr }, ) if err != nil { return errs.NewError(err) } return nil } type VisionCompletionRequest struct { Seed int `json:"seed"` Model string `json:"model"` Messages []struct { Role string `json:"role"` Content []struct { Type string `json:"type"` Text string `json:"text,omitempty"` ImageUrl struct { Url string `json:"url"` } `json:"image_url,omitempty"` } `json:"content"` } `json:"messages"` MaxTokens int `json:"max_tokens"` } func (s *Service) GetRedisAgentTwitterPostGenerateTokenInfo(id uint) string { redisKey := fmt.Sprintf("agent_twitter_post_generate_token_info_%v", id) return redisKey } func (s *Service) AgentTwitterPostGenerateTokenInfo(ctx context.Context, agentTwitterPostID uint) error { redisKey := s.GetRedisAgentTwitterPostGenerateTokenInfo(agentTwitterPostID) redisCheckValue, err := s.rdb.Get(redisKey).Result() if err == nil && redisCheckValue != "" { return nil } tx := daos.GetDBMainCtx(ctx) agentTwitterPost, err := s.dao.FirstAgentTwitterPostByID(tx, agentTwitterPostID, map[string][]interface{}{}, true) if err != nil { return errs.NewError(err) } if agentTwitterPost.TokenName != "" || agentTwitterPost.TokenSymbol != "" { return nil } if agentTwitterPost.Type != models.AgentTwitterPostTypeImage2video { return nil } if agentTwitterPost.ExtractMediaContent == "" { return nil } // first get description of image visionRequest := &VisionCompletionRequest{ Model: "Qwen/Qwen2.5-VL-7B-Instruct", Messages: []struct { Role string `json:"role"` Content []struct { Type string `json:"type"` Text string `json:"text,omitempty"` ImageUrl struct { Url string `json:"url"` } `json:"image_url,omitempty"` } `json:"content"` }{ { Role: "user", Content: []struct { Type string `json:"type"` Text string `json:"text,omitempty"` ImageUrl struct { Url string `json:"url"` } `json:"image_url,omitempty"` }{ { Type: "text", Text: "What is in this image?", }, { Type: "image_url", ImageUrl: struct { Url string `json:"url"` }{ Url: agentTwitterPost.ExtractMediaContent, }, }, }, }, }, MaxTokens: 512, } maxRetry := 5 imageDescription := "" for i := 0; i < maxRetry; i++ { time.Sleep(time.Duration(i*10) * time.Second) respBytes, _, statusCode, err := helpers.HttpRequest(s.conf.KnowledgeBaseConfig.DirectServiceUrl, "POST", map[string]string{ "Authorization": fmt.Sprintf("Bearer %v", s.conf.KnowledgeBaseConfig.OnchainAPIKey), }, visionRequest) if err != nil { continue } if statusCode != 200 { continue } visionResponse := &VisionResponse{} err = json.Unmarshal(respBytes, visionResponse) if err != nil { continue } if len(visionResponse.Choices) == 0 { continue } imageDescription = visionResponse.Choices[0].Message.Content break } if imageDescription == "" { s.SendTeleVideoActivitiesAlert(fmt.Sprintf("[ERROR_IMAGE_DESC] Image description is empty, db_id=%v", agentTwitterPost.ID)) return errs.NewError(fmt.Errorf("image description is empty")) } // using LLM to get token symbol and token name type TokenResponse struct { TokenSymbol string `json:"token_symbol"` TokenName string `json:"token_name"` } for i := 0; i < maxRetry; i++ { userPrompt := fmt.Sprintf("User's prompt:%v\n\nImage description:%v", agentTwitterPost.ExtractMediaContent, imageDescription) request := &openai.ChatCompletionRequest{ Model: "Llama3.3", Messages: []openai.ChatCompletionMessage{ openai.ChatCompletionMessage{ Role: "system", Content: "You are an AI assistant tasked with generating a cryptocurrency token symbol and token name based on a given user's prompt and an image description. Prioritize the context of the user's prompt first, but also incorporate elements from the image description to ensure relevance. \\r\\n\\r\\nThe response must be in strict JSON format with no additional text or explanation. Use the following format: \\r\\n\\r\\n```json\\r\\n{\\\"token_symbol\\\": \\\"string\\\", \\\"token_name\\\": \\\"string\\\"}\\r\\n``` \\r\\n\\r\\n- **The token_symbol and token_name must NOT be empty.** \\r\\n- **The token_symbol must be concise (3-5 uppercase letters) and relevant.** \\r\\n- **The token_name should be creative yet clear.** \\r\\n- **Avoid generating token_symbol or token_name similar to 'EAI', 'Eternal AI', 'CryptoEternalAI', or 'Crypto Eternal AI'.** \\r\\n- Ensure that both maintain coherence with the provided inputs.", }, openai.ChatCompletionMessage{ Role: "user", Content: userPrompt, }, }, } respBytes, _, statusCode, err := helpers.HttpRequest(s.conf.KnowledgeBaseConfig.DirectServiceUrl, "POST", map[string]string{ "Authorization": fmt.Sprintf("Bearer %v", s.conf.KnowledgeBaseConfig.OnchainAPIKey), }, request) if err != nil { continue } if statusCode != 200 { continue } chatCompletionResp := &openai.ChatCompletionResponse{} err = json.Unmarshal(respBytes, chatCompletionResp) if err != nil { continue } if len(chatCompletionResp.Choices) == 0 { continue } chatCompletionResp.Choices[0].Message.Content = strings.ReplaceAll(chatCompletionResp.Choices[0].Message.Content, "```json", "") chatCompletionResp.Choices[0].Message.Content = strings.ReplaceAll(chatCompletionResp.Choices[0].Message.Content, "```", "") tokenResponse := &TokenResponse{} err = json.Unmarshal([]byte(chatCompletionResp.Choices[0].Message.Content), tokenResponse) if err != nil { continue } if tokenResponse.TokenName == "" || tokenResponse.TokenSymbol == "" { continue } agentTwitterPost.TokenName = tokenResponse.TokenName agentTwitterPost.TokenSymbol = tokenResponse.TokenSymbol break } if agentTwitterPost.TokenName == "" || agentTwitterPost.TokenSymbol == "" { s.SendTeleVideoActivitiesAlert(fmt.Sprintf("[ERROR_TOKEN_NAME_SYMBOL] Token name or symbol is empty, db_id=%v", agentTwitterPost.ID)) return errs.NewError(fmt.Errorf("token name or symbol is empty")) } return s.dao.Save(tx, agentTwitterPost) } // ========= type VisionResponse struct { Id string `json:"id"` Object string `json:"object"` Created int `json:"created"` Model string `json:"model"` Choices []struct { Index int `json:"index"` Message struct { Role string `json:"role"` ReasoningContent interface{} `json:"reasoning_content"` Content string `json:"content"` ToolCalls []interface{} `json:"tool_calls"` } `json:"message"` Logprobs interface{} `json:"logprobs"` FinishReason string `json:"finish_reason"` StopReason interface{} `json:"stop_reason"` } `json:"choices"` Usage struct { PromptTokens int `json:"prompt_tokens"` TotalTokens int `json:"total_tokens"` CompletionTokens int `json:"completion_tokens"` PromptTokensDetails interface{} `json:"prompt_tokens_details"` } `json:"usage"` PromptLogprobs interface{} `json:"prompt_logprobs"` } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/agent_infer.go ================================================ package services import ( "context" "encoding/json" "fmt" "strings" "time" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/daos" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/serializers" ) func (s *Service) BatchChatCompletionPrompt(ctx context.Context, request *serializers.ChatCompletionRequest) (*models.BatchInferHistory, error) { chainConfig, err := s.dao.FirstChainConfig(daos.GetDBMainCtx(ctx), map[string][]interface{}{ "chain_id = ?": {request.ChainId}, }, map[string][]interface{}{}, false) if err != nil || chainConfig == nil { return nil, errs.NewError(errs.ErrBadRequest) } if request.Model == "" { request.Model = s.GetModelDefaultByChainID(request.ChainId) } promptInputByte, err := json.Marshal(request) if err != nil { return nil, errs.NewError(err) } batchInferHistory := &models.BatchInferHistory{ UserAddress: request.UserAddress, AgentContractAddress: chainConfig.AgentContractAddress, ContractAgentID: "", ChainID: request.ChainId, PromptInput: string(promptInputByte), Status: models.BatchInferHistoryStatusPending, } if batchInferHistory.Toolset == "" { batchInferHistory.Toolset = models.ToolsetTypeDefault } if request.MetaData != nil && len(request.MetaData.AgentContractId) > 0 { //assistant, err := s.GetAgentByID(ctx, request.MetaData.AgentContractId, chainConfig.AgentContractAddress, request.ChainId) //if err != nil || assistant == nil { // return nil, errors.New(fmt.Sprintf("agent is not found on chain_id: %v", request.ChainId)) //} batchInferHistory.ContractAgentID = request.MetaData.AgentContractId //batchInferHistory.AssistantID = assistant.ID.Hex() } err = s.dao.Create(daos.GetDBMainCtx(ctx), batchInferHistory) if err != nil { return nil, errs.NewError(err) } return batchInferHistory, nil } func (s *Service) GetBatchItemDetail(ctx context.Context, id uint) (*models.BatchInferHistory, error) { batchInferHistory, err := s.dao.FirstBatchInferHistoryByID(daos.GetDBMainCtx(ctx), id, map[string][]interface{}{}, false) if err != nil { return nil, errs.NewError(err) } return batchInferHistory, nil } func (s *Service) JobNameSubmitBatchInferFullPrompt(ctx context.Context, chainConfig *models.ChainConfig) string { return fmt.Sprintf("JobSubmitBatchInferFullPrompt-%v", chainConfig.ChainID) } func (s *Service) GetJobDuration(durationUnit string) time.Duration { switch strings.ToLower(durationUnit) { case models.HourText: return time.Hour case models.MinuteText: return time.Minute case models.SecondText: return time.Second case models.MillisecondText: return time.Millisecond default: return time.Minute } } // func (s *Service) JobSubmitBatchInferFullPrompt(ctx context.Context, chainConfig *models.ChainConfig) error { // interval := 2 * time.Second // minimum job config interval // jobName := s.JobNameSubmitBatchInferFullPrompt(ctx, chainConfig) // for { // time.Sleep(interval) // jobCfg, err := s.dao.FirstJobConfig(daos.GetDBMainCtx(ctx), map[string][]interface{}{ // "job_name = ?": {jobName}, // }, map[string][]interface{}{}, false) // if err != nil { // return errs.NewError(err) // } else if jobCfg == nil { // now := time.Now() // jobCfg = &models.JobConfig{ // JobName: jobName, // LastRun: &now, // Interval: 5, // unit: minute // Enable: false, // IntervalUnit: "minute", // } // err = s.dao.Create(daos.GetDBMainCtx(ctx), jobCfg) // if err != nil { // return errs.NewError(err) // } // } // if jobCfg == nil { // return errs.ErrBadRequest // } // if !jobCfg.Enable { // continue // } // timeInterval := s.GetJobDuration(jobCfg.IntervalUnit) // if time.Since(*jobCfg.LastRun) < time.Duration(jobCfg.Interval)*timeInterval { // continue // } // chainConfig, err := s.dao.FirstChainConfig(daos.GetDBMainCtx(ctx), map[string][]interface{}{ // "chain_id = ?": {chainConfig.ChainID}, // }, map[string][]interface{}{}, false) // if err != nil { // continue // } // if err := s.DoLogicSubmitBatchInferFullPrompt(ctx, chainConfig); err != nil { // continue // } // now := time.Now() // jobCfg.LastRun = &now // err = s.dao.Save(daos.GetDBMainCtx(ctx), jobCfg) // if err != nil { // return errs.NewError(err) // } // } // } // func (s *Service) GetListModelSupportsByChainId(ctx context.Context, chainId uint64) (map[string]string, error) { // chainConfig, err := s.dao.FirstChainConfig(daos.GetDBMainCtx(ctx), map[string][]interface{}{ // "chain_id = ?": {chainId}, // }, map[string][]interface{}{}, false) // if err != nil { // return nil, errs.NewError(err) // } // if len(chainConfig.SupportModelNames) > 0 { // return chainConfig.SupportModelNames, nil // } // if len(models.MapChainIDToLLMModelAndModelID[chainId]) > 0 { // return models.MapChainIDToLLMModelAndModelID[chainId], nil // } // return map[string]string{}, nil // } // func (s *Service) DoLogicSubmitBatchInferFullPrompt(ctx context.Context, chainConfig *models.ChainConfig) error { // filter := map[string][]interface{}{ // "status = ?": {models.BatchInferHistoryStatusPending}, // "chain_id = ?": {chainConfig.ChainID}, // } // batchInfers, err := s.dao.FindBatchInferHistory(daos.GetDBMainCtx(ctx), filter, map[string][]interface{}{}, []string{"id asc"}, 0, 10000) // if err != nil { // return err // } // var mapModelNameToBatchItem = make(map[string][]*models.BatchInferHistory) // batchInferFailed := make([]*models.BatchInferHistory, 0) // for index, batchInfer := range batchInfers { // chatCompletionRequest := &serializers.ChatCompletionRequest{} // err := json.Unmarshal([]byte(batchInfer.PromptInput), chatCompletionRequest) // if err != nil { // batchInfer.Log = err.Error() // batchInferFailed = append(batchInferFailed, batchInfer) // continue // } // if _, ok := mapModelNameToBatchItem[chatCompletionRequest.Model]; !ok { // mapModelNameToBatchItem[chatCompletionRequest.Model] = make([]*models.BatchInferHistory, 0) // } // mapModelNameToBatchItem[chatCompletionRequest.Model] = append(mapModelNameToBatchItem[chatCompletionRequest.Model], batchInfers[index]) // } // for _, batchItem := range batchInferFailed { // s.dao.Save(daos.GetDBMainCtx(ctx), batchItem) // } // for modelName, batchInfersByModelName := range mapModelNameToBatchItem { // if len(batchInfersByModelName) == 0 { // continue // } // modelSupport, err := s.GetListModelSupportsByChainId(ctx, chainConfig.ChainID) // if err != nil { // logger.GetLoggerInstanceFromContext(ctx).Error("JobSubmitBatchInferFullPrompt GetListModelSupportsByChainId", // zap.Any("chainConfig", chainConfig), zap.Any("err", err)) // return err // } // modelID := modelSupport[modelName] // if len(modelID) == 0 { // logger.GetLoggerInstanceFromContext(ctx).Error("JobSubmitBatchInferFullPrompt modelID not found in list model support", // zap.Any("chainConfig", chainConfig), zap.Any("modelName", modelName), zap.Any("modelSupport", modelSupport)) // continue // } // trainingRequestEntity, err := s.GetTrainingRequestByModelId(ctx, modelID) // if err != nil { // logger.GetLoggerInstanceFromContext(ctx).Error("JobSubmitBatchInferFullPrompt GetTrainingRequestByModelId", // zap.Any("chainConfig", chainConfig), zap.Any("modelID", modelID), zap.Any("err", err)) // return err // } // data, _ := json.Marshal(batchInfersByModelName) // hash, err := lighthouse.UploadDataWithRetry(s.GetLightHouseApiKey(), "", data) // if err != nil { // logger.GetLoggerInstanceFromContext(ctx).Error("JobSubmitBatchInferFullPrompt UploadDataWithRetry", // zap.Any("chainConfig", chainConfig), // zap.Any("err", err)) // return err // } // inferRequest := &InferRequest{ // Prompt: fmt.Sprintf("ipfs://%v", hash), // ModelId: trainingRequestEntity.ModelID, // } // createInferResp, err := s.UserCreateInfer(ctx, &models.User{}, trainingRequestEntity, inferRequest) // if err != nil { // logger.GetLoggerInstanceFromContext(ctx).Error("[JobSubmitBatchInferFullPrompt UserCreateInfer]", // zap.Any("error", err), // zap.Any("chainConfig", chainConfig)) // return err // } // submitInferAt := time.Now().UTC() // for _, infer := range batchInfersByModelName { // err = s.UpdateOneBatchInferHistoryByFilter(ctx, bson.M{ // "_id": infer.ID, // }, bson.M{ // "status": models.BatchInferHistoryStatusAgentInferred, // "inscribe_tx_hash": createInferResp.TxHash, // "infer_id": fmt.Sprintf("%v", createInferResp.InferID), // "model_id": modelID, // "prompt_input_hash": fmt.Sprintf("ipfs://%v", hash), // "infer_wallet_address": createInferResp.UsedWalletAddress, // "submit_infer_at": submitInferAt, // }) // if err != nil { // logger.GetLoggerInstanceFromContext(ctx).Error("JobSubmitBatchInferFullPrompt UploadDataWithRetry", // zap.Any("chainConfig", chainConfig), // zap.Any("infer", infer), // zap.Any("err", err)) // return err // } // } // } // return nil // } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/agent_infer_job.go ================================================ package services ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/agent_infra.go ================================================ package services import ( "context" "fmt" "strings" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/daos" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/types/numeric" "github.com/ethereum/go-ethereum/common" "github.com/jinzhu/gorm" ) func (s *Service) GetAgentStore(ctx context.Context, storeId string) (*models.AgentStore, error) { agentStore, err := s.dao.FirstAgentStore(daos.GetDBMainCtx(ctx), map[string][]any{"store_id = ?": {storeId}}, map[string][]any{}, false) if err != nil { return nil, errs.NewError(err) } if agentStore == nil { return nil, errs.NewError(errs.ErrBadRequest) } return agentStore, nil } func (s *Service) ValidateUserStoreFee(ctx context.Context, apiKey string) (*models.AgentStoreInstall, error) { agentStoreInstall, err := s.dao.FirstAgentStoreInstall( daos.GetDBMainCtx(ctx), map[string][]any{ "code = ?": {apiKey}, }, map[string][]any{ "User": {}, "AgentStore": {}, }, []string{}, ) if err != nil { return nil, errs.NewError(err) } if agentStoreInstall == nil { return nil, errs.NewError(errs.ErrBadRequest) } user := agentStoreInstall.User agentStore := agentStoreInstall.AgentStore if user.EaiBalance.Float.Cmp(&agentStore.Price.Float) < 0 { return nil, errs.NewError(errs.ErrInsufficientBalance) } return agentStoreInstall, nil } func (s *Service) ChargeUserStoreInstall(ctx context.Context, agentStoreInstallID uint, urlPath string, status int) error { err := daos.WithTransaction( daos.GetDBMainCtx(ctx), func(tx *gorm.DB) error { agentStoreInstall, err := s.dao.FirstAgentStoreInstallByID( tx, agentStoreInstallID, map[string][]any{ "User": {}, "AgentStore.Owner": {}, }, false, ) if err != nil { return errs.NewError(err) } if agentStoreInstall == nil { return errs.NewError(errs.ErrBadRequest) } user := agentStoreInstall.User agentStoreLog := &models.AgentStoreLog{ AgentStoreInstallID: agentStoreInstall.ID, UserID: user.ID, AgentStoreID: agentStoreInstall.AgentStoreID, Price: agentStoreInstall.AgentStore.Price, UrlPath: urlPath, Status: status, } err = s.dao.Create(tx, agentStoreLog) if err != nil { return errs.NewError(err) } if agentStoreLog.Status < 300 { { err = tx.Model(user). UpdateColumn("eai_balance", gorm.Expr("eai_balance - ?", agentStoreLog.Price)). Error if err != nil { return errs.NewError(err) } err = s.dao.Create( tx, &models.UserTransaction{ NetworkID: user.NetworkID, EventId: fmt.Sprintf("user_agent_store_log_%d", agentStoreLog.ID), UserID: user.ID, Type: models.UserTransactionTypeUserAgentInfraFee, Amount: numeric.NewBigFloatFromFloat(models.NegativeBigFloat(&agentStoreLog.Price.Float)), Status: models.UserTransactionStatusDone, }, ) if err != nil { return errs.NewError(err) } } { owner := agentStoreInstall.AgentStore.Owner err = tx.Model(owner). UpdateColumn("eai_balance", gorm.Expr("eai_balance + ?", agentStoreLog.Price)). Error if err != nil { return errs.NewError(err) } err = s.dao.Create( tx, &models.UserTransaction{ NetworkID: owner.NetworkID, EventId: fmt.Sprintf("creator_agent_store_log_%d", agentStoreLog.ID), UserID: owner.ID, Type: models.UserTransactionTypeCreatorAgentInfraFee, Amount: agentStoreLog.Price, Status: models.UserTransactionStatusDone, }, ) if err != nil { return errs.NewError(err) } } } return nil }, ) if err != nil { return errs.NewError(err) } return nil } func (s *Service) ScanAgentInfraMintHash(ctx context.Context, userAddress string, networkID uint64, txHash string, agentStoreID uint) error { agentStore, err := s.dao.FirstAgentStoreByID(daos.GetDBMainCtx(ctx), agentStoreID, map[string][]any{}, false) if err != nil { return errs.NewError(err) } if agentStore.NetworkID > 0 || agentStore.ContractAddress != "" || agentStore.TokenId > 0 { return errs.NewError(errs.ErrBadRequest) } user, err := s.GetUser(daos.GetDBMainCtx(ctx), 0, userAddress, false) if err != nil { return errs.NewError(err) } if agentStore.OwnerID != user.ID { return errs.NewError(errs.ErrBadRequest) } logResp, err := s.GetEthereumClient(ctx, networkID).EventsByTransaction(txHash) if err != nil { return errs.NewError(err) } var contractAddress string var tokenId uint64 for _, v := range logResp.NftTransfer { if strings.EqualFold(v.From, models.ETH_ZERO_ADDRESS) { contractAddress = strings.ToLower(v.ContractAddress) tokenId = v.TokenId.Uint64() break } } if tokenId <= 0 { return errs.NewError(errs.ErrBadRequest) } { agentStoreCheck, err := s.dao.FirstAgentStore( daos.GetDBMainCtx(ctx), map[string][]any{ "contract_address = ?": {contractAddress}, "token_id = ?": {tokenId}, }, map[string][]any{}, false, ) if err != nil { return errs.NewError(err) } if agentStoreCheck != nil { return errs.NewError(errs.ErrBadRequest) } } err = daos.GetDBMainCtx(ctx). Model(agentStore). Updates( map[string]any{ "contract_address": contractAddress, "token_id": tokenId, }, ).Error if err != nil { return errs.NewError(err) } return nil } func (s *Service) ERC20RealWorldAgentAct( ctx context.Context, uuid string, ipfsHash string, ) (string, error) { txHash, err := s.GetEthereumClient(ctx, s.conf.InfraTwitterApp.NetworkID). ERC20RealWorldAgentAct( s.conf.InfraTwitterApp.AgentAddress, s.GetAddressPrk(s.conf.InfraTwitterApp.WorkerAddress), [32]byte(common.Hex2Bytes(uuid)), []byte(ipfsHash), ) if err != nil { return "", errs.NewError(err) } return txHash, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/agent_knowledgebase.go ================================================ package services import ( "context" "errors" "strings" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/daos" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/serializers" ) func (s *Service) AgentUseKnowledgeBase(ctx context.Context, request *serializers.AgentUseKnowledgeBaseRequest) (*models.AgentInfoKnowledgeBase, error) { // currently only use 1 knowledge base for 1 agent, so insert will by multiple, but when use only 1 knowledge base order by id desc agentInfo, err := s.dao.FirstAgentInfo(daos.GetDBMainCtx(ctx), map[string][]interface{}{ "agent_id = ?": {request.AgentID}, }, nil, []string{"id desc"}) if err != nil { return nil, err } if agentInfo == nil { return nil, errors.New("agent not found") } if !strings.EqualFold(request.UserAddress, agentInfo.Creator) { return nil, errors.New("only agent owner can use knowledge base") } // check knowledge base exist knowledgeBase, err := s.dao.FirstKnowledgeBase(daos.GetDBMainCtx(ctx), map[string][]interface{}{ "id = ?": {request.KnowledgeBaseID}, }, nil, []string{"id desc"}, false) if err != nil { return nil, err } if knowledgeBase == nil { return nil, errors.New("knowledge base not found") } if knowledgeBase.Status != models.KnowledgeBaseStatusMinted { return nil, errors.New("knowledge base is not minted") } agentInfoKnowledgeBase, err := s.dao.FirstAgentInfoKnowledgeBaseByAgentInfoIDAndKnowledgeBaseID(daos.GetDBMainCtx(ctx), agentInfo.ID, request.KnowledgeBaseID) if err != nil { return nil, err } if agentInfoKnowledgeBase != nil { return agentInfoKnowledgeBase, nil } newKnowledgeBase := &models.AgentInfoKnowledgeBase{ AgentInfoId: agentInfo.ID, KnowledgeBaseId: request.KnowledgeBaseID, } if err := s.dao.CreateAgentInfoKnowledgeBase(daos.GetDBMainCtx(ctx), newKnowledgeBase); err != nil { return nil, err } return newKnowledgeBase, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/agent_launchpad.go ================================================ package services import ( "context" "fmt" "math/big" "strings" "time" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/daos" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/helpers" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/serializers" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/twitter" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/types/numeric" "github.com/jinzhu/gorm" ) func (s *Service) DeployMultisend(ctx context.Context, networkID uint64) (string, error) { address, _, err := s.GetEthereumClient(context.Background(), networkID). DeployMultisend( s.GetAddressPrk(s.conf.GetConfigKeyString(networkID, "meme_pool_address")), ) if err != nil { return "", errs.NewError(err) } return address, nil } func (s *Service) ProxyAdminDAOUpgrade(ctx context.Context, networkID uint64, proxyAddress string) (string, error) { txHash, err := s.GetEthereumClient(context.Background(), networkID). ProxyAdminUpgrade( s.conf.GetConfigKeyString(networkID, "proxy_admin_address"), s.GetAddressPrk(s.conf.GetConfigKeyString(networkID, "meme_pool_address")), helpers.HexToAddress(proxyAddress), helpers.HexToAddress(s.conf.GetConfigKeyString(networkID, "dao_treasury_logic_address")), ) if err != nil { return "", errs.NewError(err) } return txHash, nil } func (s *Service) DeployDAOTreasuryLogic(ctx context.Context, networkID uint64) (string, error) { address, _, err := s.GetEthereumClient(context.Background(), networkID). DeployDAOTreasury( s.GetAddressPrk(s.conf.GetConfigKeyString(networkID, "meme_pool_address")), ) if err != nil { return "", errs.NewError(err) } return address, nil } func (s *Service) DeployDAOTreasuryAddress(ctx context.Context, networkID uint64) (string, error) { data, err := s.GetEthereumClient(context.Background(), networkID).DAOTreasuryInitializeData( helpers.HexToAddress(s.conf.GetConfigKeyString(networkID, "uniswap_position_mamanger_address")), helpers.HexToAddress(s.conf.GetConfigKeyString(networkID, "eai_contract_address")), ) if err != nil { return "", errs.NewError(err) } address, txHash, err := s.GetEthereumClient(context.Background(), networkID). DeployTransparentUpgradeableProxy( s.GetAddressPrk(s.conf.GetConfigKeyString(networkID, "meme_pool_address")), helpers.HexToAddress(s.conf.GetConfigKeyString(networkID, "dao_treasury_logic_address")), helpers.HexToAddress(s.conf.GetConfigKeyString(networkID, "proxy_admin_address")), data, ) if err != nil { return "", errs.NewError(err) } time.Sleep(10 * time.Second) err = s.GetEthereumClient(context.Background(), networkID).TransactionConfirmed(txHash) if err != nil { return "", errs.NewError(err) } return address, nil } func (s *Service) JobScanAgentTwitterPostForCreateLaunchpad(ctx context.Context) error { err := s.JobRunCheck( ctx, "JobScanAgentTwitterPostForCreateLaunchpad", func() error { agent, err := s.dao.FirstAgentInfoByID( daos.GetDBMainCtx(ctx), s.conf.LaunchpadAgentInfoId, map[string][]interface{}{}, false, ) if err != nil { return errs.NewError(err) } twitterInfo, err := s.dao.FirstTwitterInfo(daos.GetDBMainCtx(ctx), map[string][]interface{}{ "twitter_id = ?": {agent.TwitterID}, }, map[string][]interface{}{}, false, ) if err != nil { return errs.NewError(err) } if twitterInfo != nil { err = func() error { tweetMentions, err := s.twitterWrapAPI.GetListUserMentions(twitterInfo.TwitterID, "", twitterInfo.AccessToken, 25) if err != nil { return errs.NewError(err) } err = s.CreateAgentTwitterPostForCreateLaunchpad(daos.GetDBMainCtx(ctx), agent.ID, agent.TwitterUsername, tweetMentions) if err != nil { return errs.NewError(err) } return nil }() if err != nil { s.UpdateAgentScanEventError(ctx, agent.ID, err) return err } else { err = s.UpdateAgentScanEventSuccess(ctx, agent.ID, nil, "") if err != nil { return errs.NewError(err) } } } return nil }, ) if err != nil { return errs.NewError(err) } return nil } func (s *Service) CreateAgentTwitterPostForCreateLaunchpad(tx *gorm.DB, agentInfoID uint, twitterUsername string, tweetMentions *twitter.UserTimeline) error { if tweetMentions != nil { agentInfo, err := s.dao.FirstAgentInfoByID( tx, agentInfoID, map[string][]interface{}{}, false, ) if err != nil { return errs.NewError(err) } if agentInfo == nil { return errs.NewError(errs.ErrBadRequest) } twitterInfo, err := s.dao.FirstTwitterInfo(tx, map[string][]interface{}{ "twitter_id = ?": {s.conf.TokenTwiterID}, }, map[string][]interface{}{}, false, ) if err != nil { return errs.NewError(errs.ErrBadRequest) } for _, item := range tweetMentions.Tweets { if !strings.EqualFold(item.AuthorID, agentInfo.TwitterID) { var rs bool err := s.RedisCached( fmt.Sprintf("CreateAgentTwitterPostForCreateLaunchpad_%s", item.ID), true, 12*time.Hour, &rs, func() (interface{}, error) { err := func() error { author, err := s.CreateUpdateUserTwitter(tx, item.AuthorID) if err != nil { return errs.NewError(errs.ErrBadRequest) } if author != nil { twitterDetail, err := s.twitterWrapAPI.LookupUserTweets(twitterInfo.AccessToken, []string{item.ID}) if err != nil { return errs.NewError(err) } if twitterDetail != nil { for k, v := range *twitterDetail { if !strings.EqualFold(v.User.ID, agentInfo.TwitterID) { if strings.EqualFold(k, item.ID) { existPosts, err := s.dao.FirstAgentTwitterPost( tx, map[string][]interface{}{ "twitter_post_id = ?": {v.Tweet.ID}, }, map[string][]interface{}{}, []string{}, ) if err != nil { return errs.NewError(err) } if existPosts == nil { fullText := v.Tweet.NoteTweet.Text if fullText == "" { fullText = v.Tweet.Text } var prjDesc string if v.Tweet.ConversationID == "" || v.Tweet.ConversationID == v.Tweet.ID { prjInfo, err := s.GetAgentCreateLaunchpad(context.Background(), v.User.UserName, fullText) if err != nil { return errs.NewError(err) } prjDesc = prjInfo.Description } postedAt := helpers.ParseStringToDateTimeTwitter(v.Tweet.CreatedAt) if prjDesc != "" { m := &models.AgentTwitterPost{ NetworkID: agentInfo.NetworkID, AgentInfoID: agentInfo.ID, TwitterID: v.User.ID, TwitterUsername: v.User.UserName, TwitterName: v.User.Name, TwitterPostID: v.Tweet.ID, Content: fullText, Status: models.AgentTwitterPostStatusNew, PostAt: postedAt, TwitterConversationId: v.Tweet.ConversationID, PostType: models.AgentSnapshotPostActionTypeCreateLaunchpad, IsMigrated: true, TokenDesc: prjDesc, } m.OwnerTwitterID = m.TwitterID m.OwnerUsername = m.TwitterUsername err = s.dao.Create(tx, m) if err != nil { return errs.NewError(err) } } else { m := &models.AgentTwitterPost{ NetworkID: agentInfo.NetworkID, AgentInfoID: agentInfo.ID, TwitterID: v.User.ID, TwitterUsername: v.User.UserName, TwitterName: v.User.Name, TwitterPostID: v.Tweet.ID, Content: fullText, Status: models.AgentTwitterPostStatusInvalid, PostAt: postedAt, TwitterConversationId: v.Tweet.ConversationID, PostType: models.AgentSnapshotPostActionTypeUnknown, IsMigrated: true, } m.OwnerTwitterID = m.TwitterID m.OwnerUsername = m.TwitterUsername err = s.dao.Create(tx, m) if err != nil { return errs.NewError(err) } } _, _ = s.CreateUpdateUserTwitter(tx, v.User.ID) } } } } } } return nil }() if err != nil { return false, errs.NewError(err) } return true, nil }, ) if err != nil { return errs.NewError(err) } } if err != nil { return errs.NewError(err) } } } return nil } func (s *Service) JobAgentTwitterPostCreateLaunchpad(ctx context.Context) error { err := s.JobRunCheck( ctx, "JobAgentTwitterPostCreateLaunchpad", func() error { var retErr error { twitterPosts, err := s.dao.FindAgentTwitterPost( daos.GetDBMainCtx(ctx), map[string][]interface{}{ "agent_info_id in (?)": {[]uint{s.conf.LaunchpadAgentInfoId}}, "status = ?": {models.AgentTwitterPostStatusNew}, "post_type = ?": {models.AgentSnapshotPostActionTypeCreateLaunchpad}, }, map[string][]interface{}{}, []string{ "rand()", }, 0, 2, ) if err != nil { return errs.NewError(err) } for _, twitterPost := range twitterPosts { err = s.AgentTwitterPostCreateLaunchpad(ctx, twitterPost.ID) if err != nil { retErr = errs.MergeError(retErr, errs.NewErrorWithId(err, twitterPost.ID)) } } } return retErr }, ) if err != nil { return errs.NewError(err) } return nil } func (s *Service) AgentTwitterPostCreateLaunchpad(ctx context.Context, twitterPostID uint) error { err := s.JobRunCheck( ctx, fmt.Sprintf("AgentTwitterPostCreateAgent_%d", twitterPostID), func() error { err := daos.WithTransaction( daos.GetDBMainCtx(ctx), func(tx *gorm.DB) error { twitterPost, err := s.dao.FirstAgentTwitterPostByID( tx, twitterPostID, map[string][]interface{}{ "AgentInfo": {}, "AgentInfo.TwitterInfo": {}, }, false, ) if err != nil { return errs.NewError(err) } if twitterPost.Status == models.AgentTwitterPostStatusNew && twitterPost.PostType == models.AgentSnapshotPostActionTypeCreateLaunchpad { lp, err := s.dao.FirstLaunchpad( tx, map[string][]interface{}{ "twitter_post_id = ?": {twitterPost.ID}, }, map[string][]interface{}{}, []string{}, ) if err != nil { return errs.NewError(err) } if lp == nil { lp = &models.Launchpad{ NetworkID: models.BASE_CHAIN_ID, TwitterPostID: twitterPost.ID, TweetId: twitterPost.TwitterPostID, TwitterId: twitterPost.TwitterID, TwitterUsername: twitterPost.TwitterUsername, TwitterName: twitterPost.TwitterName, Description: twitterPost.Content, Name: twitterPost.TokenDesc, Status: models.LaunchpadStatusNew, MaxFundBalance: numeric.NewBigFloatFromString("105000"), TgeBalance: numeric.NewBigFloatFromString("800000000"), TotalSupply: numeric.NewBigFloatFromString("1000000000"), } err = s.dao.Create(tx, lp) if err != nil { return errs.NewError(err) } tier1, _ := models.MulBigFloats(&lp.MaxFundBalance.Float, big.NewFloat(0.02)).Float64() tier2, _ := models.MulBigFloats(&lp.MaxFundBalance.Float, big.NewFloat(0.01)).Float64() tier3, _ := models.MulBigFloats(&lp.MaxFundBalance.Float, big.NewFloat(0.005)).Float64() //create mission template agentInfo := twitterPost.AgentInfo mission := &models.AgentSnapshotMission{} mission.NetworkID = agentInfo.NetworkID mission.AgentInfoID = agentInfo.ID mission.UserPrompt = fmt.Sprintf(`Project Description: %s Task: Analyze the data provided for the specified Twitter user (note: this data belongs to the user and is not associated with your Twitter account). Predict the percentage value of their potential contribution to the project. Based on this prediction, classify the user into one of the following tiers: • Tier 1: Contribution percentage over 80%% (with a maximum allocation of %.0f eai for investment) • Tier 2: Contribution percentage between 51%% and 80%% (with a maximum allocation of %.0f eai for investment) • Tier 3: Contribution percentage 50%% or below (with a maximum allocation of %.0f eai for investment) The final output should clearly indicate the tier to which the user belongs. Submit the tier and message (including the tier and maximum allocation, something like that: After analyzing your Twitter account and predicting your potential contribution to the project, we have placed you in Tier 2, with a maximum allocation of 1000 EAI for investment.) through the submit_result API.`, lp.Description, tier1, tier2, tier3) mission.ToolSet = models.ToolsetTypeLaunchpadJoin mission.NotDelay = true mission.Enabled = false mission.IsTesting = true mission.ReplyEnabled = true mission.AgentType = models.AgentInfoAgentTypeNormal toolList := `[{"description":"API to get twitter tweets ","executor":"https://agent.api.eternalai.org/api/internal/twitter/user/recent-info?id=%s","headers":{"api-key": "%s"},"label":"query","method":"GET","name":"get_twitter_tweets","params":[]},{"description":"API to submit result","executor":"https://agent.api.eternalai.org/api/internal/launchpad/%d/tier/%d","headers":{"api-key": "%s"},"label":"action","method":"POST","name":"submit_result","params":[{"name":"tier","dtype":"string"},{"name":"message","dtype":"string"}]}]` mission.ToolList = toolList if mission.ToolList != "" { mission.ReactMaxSteps = 2 } // err = s.dao.Save(tx, mission) if err != nil { return errs.NewError(err) } // lp.AgentSnapshotMissionID = mission.ID err = s.dao.Save(tx, lp) if err != nil { return errs.NewError(err) } } twitterPost.Status = models.AgentTwitterPostStatusReplied err = s.dao.Save(tx, twitterPost) if err != nil { return errs.NewError(err) } err = s.ReplyAferAutoCreateLaunchpad(tx, twitterPost.ID, lp.ID) if err != nil { return errs.NewError(err) } } return nil }, ) if err != nil { return errs.NewError(err) } return nil }, ) if err != nil { return errs.NewError(err) } return nil } func (s *Service) GetAgentCreateLaunchpad(ctx context.Context, userName, fullText string) (*models.TweetParseInfo, error) { info := &models.TweetParseInfo{} fullText = strings.ReplaceAll(fullText, "@"+userName, "") userPrompt := fmt.Sprintf(` Detect DAO Fund Creation Requests This is the user conversation: %s From this conversation determine if the user is requesting assistance with fundraising, look for a direct and unambiguous statement that explicitly asks to assistance with fundraising. This statement must be clear, concise, and isolated from any surrounding context that may alter its meaning. If yes, extract or generate the following information: Answer ("yes" or "no") Project information (generate if not provided, make sure it not empty and not referencing "EAI" or "Eternal AI") Return a JSON response with the following format: {"answer": "yes/no", "project-information": ""} Respond with only the JSON string, without any additional explanation. `, fullText) aiStr, err := s.openais["Lama"].ChatMessage(strings.TrimSpace(userPrompt)) if err != nil { return info, nil } if aiStr != "" { mapInfo := helpers.ExtractMapInfoFromOpenAI(aiStr) if mapInfo != nil { answer := "no" if v, ok := mapInfo["answer"]; ok { answer = fmt.Sprintf(`%v`, v) } if strings.EqualFold(answer, "yes") { info.IsCreateAgent = true if v, ok := mapInfo["project-information"]; ok { info.Description = fmt.Sprintf(`%v`, v) } } } } return info, nil } func (s *Service) ReplyAferAutoCreateLaunchpad(tx *gorm.DB, twitterPostID, launchpadId uint) error { if twitterPostID > 0 && launchpadId > 0 { twitterPost, err := s.dao.FirstAgentTwitterPostByID( tx, twitterPostID, map[string][]interface{}{ "AgentInfo.TwitterInfo": {}, }, false, ) if err != nil { return errs.NewError(err) } launchpad, err := s.dao.FirstLaunchpadByID( tx, launchpadId, map[string][]interface{}{}, true, ) if err != nil { return errs.NewError(err) } if twitterPost != nil && launchpad != nil && twitterPost.AgentInfo != nil && twitterPost.AgentInfo.TwitterInfo != nil && twitterPost.ReplyPostId == "" { if launchpad.Address == "" { var address string for i := 0; i < 3; i++ { address, err = s.DeployDAOTreasuryAddress(context.Background(), launchpad.NetworkID) if err != nil { continue } } launchpad.Address = address err = s.dao.Save(tx, launchpad) if err != nil { return errs.NewError(err) } if launchpad.Address == "" { err = tx.Model(twitterPost).Updates( map[string]interface{}{ "error": "failed create dao address", }, ).Error if err != nil { return errs.NewError(err) } return nil } } replyContent := fmt.Sprintf(` We're thrilled to announce our new Dao Fund initiative, Dao %s! This visionary project empowers decentralized AI innovation through the power of community-owned compute resources. 📥 Funding Address: %s 🚀 Whitelist Applications: Now Open! Reply to this message with your Base address to apply. Join us in shaping the future of decentralized AI! `, launchpad.Name, launchpad.Address) replyContent = strings.TrimSpace(replyContent) refId, err := helpers.ReplyTweetByToken(twitterPost.AgentInfo.TwitterInfo.AccessToken, replyContent, twitterPost.TwitterPostID, "") if err != nil { _ = tx.Model(twitterPost).Updates( map[string]interface{}{ "reply_content": replyContent, "error": err.Error(), }, ).Error } else { launchpad.StartTweetId = refId launchpad.StartAt = helpers.TimeNow() launchpad.EndAt = helpers.TimeAdd(time.Now(), 7*24*time.Hour) launchpad.Status = models.LaunchpadStatusRunning err = s.dao.Save(tx, launchpad) if err != nil { return errs.NewError(err) } _ = tx.Model(twitterPost).Updates( map[string]interface{}{ "reply_content": replyContent, "reply_post_at": helpers.TimeNow(), "reply_post_id": refId, "error": "", }, ).Error } } } return nil } func (s *Service) JobScanRepliesByLaunchpadTweetID(ctx context.Context) error { err := s.JobRunCheck( ctx, "JobScanRepliesByLaunchpadTweetID", func() error { var retErr error { launchpads, err := s.dao.FindLaunchpad( daos.GetDBMainCtx(ctx), map[string][]interface{}{ "status = ?": {models.LaunchpadStatusRunning}, }, map[string][]interface{}{ "AgentSnapshotMission": {}, }, []string{}, 0, 1000, ) if err != nil { return errs.NewError(err) } for _, launchpad := range launchpads { err = daos.WithTransaction( daos.GetDBMainCtx(ctx), func(tx *gorm.DB) error { l, _ := s.dao.FirstLaunchpadByID(tx, launchpad.ID, map[string][]interface{}{}, true) if l != nil { meta, err := s.ScanTwitterTweetByParentID(ctx, launchpad) if err != nil { return err } if meta != nil && meta.Meta.NewestID != "" { l.LastScanID = meta.Meta.NewestID err = s.dao.Save(tx, l) if err != nil { return err } } } return nil }, ) if err != nil { retErr = errs.MergeError(retErr, errs.NewErrorWithId(err, launchpad.ID)) } } } return retErr }, ) if err != nil { return errs.NewError(err) } return nil } func (s *Service) ExecuteLaunchpadTier(ctx context.Context, launchpadID, memberID uint, req *serializers.TierReq) error { err := daos.WithTransaction( daos.GetDBMainCtx(ctx), func(tx *gorm.DB) error { lp, err := s.dao.FirstLaunchpadByID(tx, launchpadID, map[string][]interface{}{}, false) if err != nil { return errs.NewError(err) } if lp != nil { member, err := s.dao.FirstLaunchpadMemberByID(tx, memberID, map[string][]interface{}{}, true) if err != nil { return errs.NewError(err) } if member != nil && member.LaunchpadID == lp.ID { tier1 := models.MulBigFloats(&lp.MaxFundBalance.Float, numeric.NewFloatFromString("0.02")) tier2 := models.MulBigFloats(&lp.MaxFundBalance.Float, numeric.NewFloatFromString("0.01")) tier3 := models.MulBigFloats(&lp.MaxFundBalance.Float, numeric.NewFloatFromString("0.005")) member.Tier = models.LaunchpadTier(req.Tier) member.ReplyContent = req.Message if member.Tier == models.LaunchpadTier1 { member.MaxFundBalance = numeric.BigFloat{*tier1} } else if member.Tier == models.LaunchpadTier2 { member.MaxFundBalance = numeric.BigFloat{*tier2} } else if member.Tier == models.LaunchpadTier3 { member.MaxFundBalance = numeric.BigFloat{*tier3} } err = s.dao.Save(tx, member) if err != nil { return errs.NewError(err) } s.ReplyAfterJoinLaunchpad(tx, lp.TwitterPostID, lp.ID, member.ID, member.ReplyContent) } } return nil }, ) if err != nil { return errs.NewError(err) } return nil } func (s *Service) ReplyAfterJoinLaunchpad(tx *gorm.DB, twitterPostID, launchpadId uint, memberID uint, replyContent string) error { if twitterPostID > 0 && launchpadId > 0 && memberID > 0 { twitterPost, err := s.dao.FirstAgentTwitterPostByID( tx, twitterPostID, map[string][]interface{}{ "AgentInfo.TwitterInfo": {}, }, false, ) if err != nil { return errs.NewError(err) } launchpad, err := s.dao.FirstLaunchpadByID( tx, launchpadId, map[string][]interface{}{}, false, ) if err != nil { return errs.NewError(err) } member, err := s.dao.FirstLaunchpadMemberByID( tx, memberID, map[string][]interface{}{}, false, ) if err != nil { return errs.NewError(err) } if twitterPost != nil && launchpad != nil && twitterPost.AgentInfo != nil && twitterPost.AgentInfo.TwitterInfo != nil && member.ReplyPostID == "" { replyContent = strings.TrimSpace(replyContent) refId, err := helpers.ReplyTweetByToken(twitterPost.AgentInfo.TwitterInfo.AccessToken, replyContent, member.TweetID, "") if err != nil { _ = tx.Model(member).Updates( map[string]interface{}{ "reply_content": replyContent, "error": err.Error(), }, ).Error } else { _ = tx.Model(member).Updates( map[string]interface{}{ "reply_content": replyContent, "reply_post_at": helpers.TimeNow(), "reply_post_id": refId, "error": "", }, ).Error } } } return nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/agent_launchpad_job.go ================================================ package services import ( "context" "fmt" "math/big" "strings" "time" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/daos" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/helpers" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/ethapi" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/types/numeric" "github.com/ethereum/go-ethereum/common" "github.com/jinzhu/gorm" ) func (s *Service) LaunchpadErc20TokenTransferEvent(tx *gorm.DB, networkID uint64, event *ethapi.Erc20TokenTransferEventResp) error { switch networkID { case models.BASE_CHAIN_ID: { if s.conf.ExistsedConfigKey(networkID, "eai_contract_address") { contractAddress := strings.ToLower(event.ContractAddress) eaiAddress := s.conf.GetConfigKeyString(networkID, "eai_contract_address") toAddress := strings.ToLower(event.To) if !strings.EqualFold(toAddress, models.ETH_ZERO_ADDRESS) && strings.EqualFold(contractAddress, eaiAddress) { eventId := fmt.Sprintf("%d_%s_%d", networkID, event.TxHash, event.Index) lptx, err := s.dao.FirstLaunchpadTransaction( tx, map[string][]interface{}{ "event_id = ?": {eventId}, }, map[string][]interface{}{}, []string{}, ) if err != nil { return errs.NewError(err) } if lptx == nil { lp, err := s.dao.FirstLaunchpad( tx, map[string][]interface{}{ "address = ?": {toAddress}, }, map[string][]interface{}{}, []string{}, ) if err != nil { return errs.NewError(err) } if lp != nil { lp, err := s.dao.FirstLaunchpadByID( tx, lp.ID, map[string][]interface{}{}, true, ) if err != nil { return errs.NewError(err) } lpm, err := s.dao.FirstLaunchpadMember( tx, map[string][]interface{}{ "launchpad_id = ?": {lp.ID}, }, map[string][]interface{}{}, []string{}, ) if err != nil { return errs.NewError(err) } if lpm == nil { lpm = &models.LaunchpadMember{ NetworkID: lp.NetworkID, UserAddress: toAddress, LaunchpadID: lp.ID, Tier: models.LaunchpadTier3, Status: models.LaunchpadMemberStatusNew, } err = s.dao.Create(tx, lpm) if err != nil { return errs.NewError(err) } } lpm, err = s.dao.FirstLaunchpadMemberByID( tx, lpm.ID, map[string][]interface{}{}, true, ) if err != nil { return errs.NewError(err) } lptx = &models.LaunchpadTransaction{ NetworkID: networkID, LaunchpadID: lp.ID, EventId: eventId, TxHash: event.TxHash, Type: models.LaunchpadTransactionTypeDeposit, UserAddress: strings.ToLower(event.From), Amount: numeric.NewBigFloatFromFloat(models.ConvertWeiToBigFloat(event.Value, 18)), Status: models.LaunchpadTransactionStatusDone, } err = s.dao.Create(tx, lptx) if err != nil { return errs.NewError(err) } if lptx.Status == models.LaunchpadTransactionStatusDone { var maxFundAmount *big.Float if lp.Status != models.LaunchpadStatusRunning || lp.EndAt.Before(time.Now()) { maxFundAmount = big.NewFloat(0) } else { maxFundAmount = models.SubBigFloats(&lp.MaxFundBalance.Float, &lp.FundBalance.Float) if maxFundAmount.Cmp(models.SubBigFloats(&lpm.MaxFundBalance.Float, &lpm.FundBalance.Float)) > 0 { maxFundAmount = models.SubBigFloats(&lpm.MaxFundBalance.Float, &lpm.FundBalance.Float) } } if maxFundAmount.Cmp(big.NewFloat(0)) > 0 { fundBalance := &lptx.Amount.Float refundBalance := big.NewFloat(0) if fundBalance.Cmp(maxFundAmount) > 0 { fundBalance = maxFundAmount refundBalance = models.SubBigFloats(&lptx.Amount.Float, fundBalance) } err = tx.Model(lpm).Updates( map[string]interface{}{ "fund_balance": gorm.Expr("fund_balance + ?", numeric.NewBigFloatFromFloat(fundBalance)), "refund_balance": gorm.Expr("refund_balance + ?", numeric.NewBigFloatFromFloat(refundBalance)), "total_balance": gorm.Expr("total_balance + ?", lptx.Amount), }, ).Error if err != nil { return errs.NewError(err) } err = tx.Model(lp).Updates( map[string]interface{}{ "fund_balance": gorm.Expr("fund_balance + ?", numeric.NewBigFloatFromFloat(fundBalance)), "refund_balance": gorm.Expr("refund_balance + ?", numeric.NewBigFloatFromFloat(refundBalance)), "total_balance": gorm.Expr("total_balance + ?", lptx.Amount), }, ).Error if err != nil { return errs.NewError(err) } // update token balance lpm, err = s.dao.FirstLaunchpadMemberByID( tx, lpm.ID, map[string][]interface{}{}, true, ) if err != nil { return errs.NewError(err) } lp, err := s.dao.FirstLaunchpadByID( tx, lp.ID, map[string][]interface{}{}, true, ) if err != nil { return errs.NewError(err) } tokenBalance := models.QuoBigFloats( models.MulBigFloats(&lpm.FundBalance.Float, &lp.TgeBalance.Float), &lp.MaxFundBalance.Float, ) lpm.TokenBalance = numeric.NewBigFloatFromFloat(tokenBalance) err = s.dao.Save(tx, lpm) if err != nil { return errs.NewError(err) } err = tx. Model(lp). Where("status = ?", models.LaunchpadStatusRunning). Where("fund_balance = max_fund_balance"). Updates( map[string]interface{}{ "status": models.LaunchpadStatusEnd, "finished_at": time.Now(), }, ). Error if err != nil { return errs.NewError(err) } } else { err = tx.Model(lpm).Updates( map[string]interface{}{ "refund_balance": gorm.Expr("refund_balance + ?", lptx.Amount), "total_balance": gorm.Expr("total_balance + ?", lptx.Amount), }, ).Error if err != nil { return errs.NewError(err) } err = tx.Model(lp).Updates( map[string]interface{}{ "refund_balance": gorm.Expr("refund_balance + ?", lptx.Amount), "total_balance": gorm.Expr("total_balance + ?", lptx.Amount), }, ).Error if err != nil { return errs.NewError(err) } } } } } } } } } return nil } func (s *Service) JobAgentLaunchpadEnd(ctx context.Context) error { err := s.JobRunCheck( ctx, "JobAgentLaunchpadEnd", func() error { err := daos.GetDBMainCtx(ctx). Model(&models.Launchpad{}). Where("status = ?", models.LaunchpadStatusRunning). Where("fund_balance = max_fund_balance"). Updates( map[string]interface{}{ "status": models.LaunchpadStatusEnd, "finished_at": time.Now(), }, ). Error if err != nil { return errs.NewError(err) } err = daos.GetDBMainCtx(ctx). Model(&models.Launchpad{}). Where("status = ?", models.LaunchpadStatusRunning). Where("end_at < now()"). Where("fund_balance < max_fund_balance"). Updates( map[string]interface{}{ "status": models.LaunchpadStatusFailed, "finished_at": time.Now(), }, ). Error if err != nil { return errs.NewError(err) } return nil }, ) if err != nil { return errs.NewError(err) } return nil } func (s *Service) JobAgentDeployDAOToken(ctx context.Context) error { err := s.JobRunCheck( ctx, "JobAgentDeployDAOToken", func() error { var retErr error ms, err := s.dao.FindLaunchpad( daos.GetDBMainCtx(ctx), map[string][]interface{}{ "status = ?": {models.LaunchpadStatusEnd}, }, map[string][]interface{}{}, []string{ "rand()", }, 0, 2, ) if err != nil { return errs.NewError(err) } for _, m := range ms { err := s.AgentDeployDAOToken(ctx, m.ID) if err != nil { retErr = errs.MergeError(retErr, errs.NewErrorWithId(err, m.ID)) } } return retErr }, ) if err != nil { return errs.NewError(err) } return nil } func (s *Service) AgentDeployDAOToken(ctx context.Context, memeID uint) error { err := s.JobRunCheck( ctx, fmt.Sprintf("AgentDeployDAOToken_%d", memeID), func() error { m, err := s.dao.FirstLaunchpadByID( daos.GetDBMainCtx(ctx), memeID, map[string][]interface{}{}, false, ) if err != nil { return errs.NewError(err) } if m == nil { return errs.NewError(errs.ErrBadRequest) } if m.Status == models.LaunchpadStatusEnd { if m.TokenSymbol == "" { for i := 0; i < 3; i++ { tokenInfo, err := s.GenerateTokenInfoFromSystemPrompt(ctx, "", m.Name) if err != nil { continue } m.TokenSymbol = tokenInfo.TokenSymbol m.TokenName = tokenInfo.TokenName m.TokenImageUrl = tokenInfo.TokenImageUrl err = daos.GetDBMainCtx(ctx).Model(&m). Updates( map[string]interface{}{ "token_name": m.TokenName, "token_symbol": m.TokenSymbol, "token_image_url": m.TokenImageUrl, }, ).Error if err != nil { return errs.NewError(err) } break } if m.TokenSymbol == "" { _ = daos.GetDBMainCtx(ctx).Model(&m). Updates( map[string]interface{}{ "status": models.LaunchpadStatusTokenError, }, ).Error return errs.NewError(err) } } if m.Status == models.LaunchpadStatusEnd && m.TokenSymbol != "" && m.TokenAddress == "" { daoPoolAddress := strings.ToLower(s.conf.GetConfigKeyString(m.NetworkID, "meme_pool_address")) tokenAddress, txHash, err := func() (string, string, error) { tokenAddr, tokenHash, err := s.GetEthereumClient(ctx, m.NetworkID). DeployDAOTToken( s.GetAddressPrk(daoPoolAddress), m.TokenName, m.TokenSymbol, ) if err != nil { return tokenAddr, tokenHash, errs.NewError(err) } time.Sleep(10 * time.Second) err = s.GetEthereumClient(ctx, m.NetworkID).TransactionConfirmed(tokenHash) if err != nil { return tokenAddr, tokenHash, errs.NewError(err) } return tokenAddr, tokenHash, nil }() if err != nil { err = daos.GetDBMainCtx(ctx).Model(&m). Updates( map[string]interface{}{ "token_address": strings.ToLower(tokenAddress), "status": models.LaunchpadStatusTokenError, "deploy_token_tx_hash": txHash, }, ).Error if err != nil { return errs.NewError(err) } } else { err = daos.GetDBMainCtx(ctx).Model(&m). Updates( map[string]interface{}{ "status": models.LaunchpadStatusTokenCreated, "token_address": strings.ToLower(tokenAddress), "total_supply": numeric.NewBigFloatFromString("1000000000"), "deploy_token_tx_hash": txHash, }, ).Error if err != nil { return errs.NewError(err) } } } } return nil }, ) if err != nil { return errs.NewError(err) } return nil } func (s *Service) JobAgentSettleDAOToken(ctx context.Context) error { err := s.JobRunCheck( ctx, "JobAgentSettleDAOToken", func() error { var retErr error ms, err := s.dao.FindLaunchpad( daos.GetDBMainCtx(ctx), map[string][]interface{}{ "status = ?": {models.LaunchpadStatusTokenCreated}, "settle_fund_tx_hash = ''": {}, }, map[string][]interface{}{}, []string{ "rand()", }, 0, 2, ) if err != nil { return errs.NewError(err) } for _, m := range ms { err := s.AgentSettleDAOToken(ctx, m.ID) if err != nil { retErr = errs.MergeError(retErr, errs.NewErrorWithId(err, m.ID)) } } return retErr }, ) if err != nil { return errs.NewError(err) } return nil } func (s *Service) AgentSettleDAOToken(ctx context.Context, memeID uint) error { err := s.JobRunCheck( ctx, fmt.Sprintf("AgentSettleDAOToken_%d", memeID), func() error { m, err := s.dao.FirstLaunchpadByID( daos.GetDBMainCtx(ctx), memeID, map[string][]interface{}{}, false, ) if err != nil { return errs.NewError(err) } if m == nil { return errs.NewError(errs.ErrBadRequest) } if m.Status == models.LaunchpadStatusTokenCreated && m.SettleFundTxHash == "" { daoPoolAddress := strings.ToLower(s.conf.GetConfigKeyString(m.NetworkID, "meme_pool_address")) txHash, err := func() (string, error) { hash, err := s.GetEthereumClient(ctx, m.NetworkID). DAOTreasurySettleFund( m.Address, s.GetAddressPrk(daoPoolAddress), models.ConvertBigFloatToWei(&m.FundBalance.Float, 18), ) if err != nil { return hash, errs.NewError(err) } _ = daos.GetDBMainCtx(ctx).Model(&m). Updates( map[string]interface{}{ "settle_fund_tx_hash": hash, }, ).Error time.Sleep(10 * time.Second) err = s.GetEthereumClient(ctx, m.NetworkID).TransactionConfirmed(hash) if err != nil { return hash, errs.NewError(err) } return hash, nil }() if err != nil { _ = daos.GetDBMainCtx(ctx).Model(&m). Updates( map[string]interface{}{ "settle_fund_tx_hash": txHash, "status": models.LaunchpadStatusSettleError, }, ).Error return errs.NewError(err) } else { err = daos.GetDBMainCtx(ctx).Model(&m). Updates( map[string]interface{}{ "status": models.LaunchpadStatusSettled, "settle_fund_tx_hash": txHash, }, ).Error if err != nil { return errs.NewError(err) } } } return nil }, ) if err != nil { return errs.NewError(err) } return nil } func (s *Service) JobAgentAddLiquidityDAOToken(ctx context.Context) error { err := s.JobRunCheck( ctx, "JobAgentAddLiquidityDAOToken", func() error { var retErr error err := daos.GetDBMainCtx(ctx). Model(&models.Launchpad{}). Where("status = ?", models.LaunchpadStatusSettled). Where(`not exists( select 1 from launchpad_members where launchpad_members.launchpad_id = launchpads.id and launchpad_members.status not in ( 'tge_done', 'done' ) )`). Updates( map[string]interface{}{ "status": models.LaunchpadStatusTge, }, ). Error if err != nil { return errs.NewError(err) } ms, err := s.dao.FindLaunchpad( daos.GetDBMainCtx(ctx), map[string][]interface{}{ "status = ?": {models.LaunchpadStatusTge}, "add_liquidity_tx_hash = ''": {}, }, map[string][]interface{}{}, []string{ "rand()", }, 0, 2, ) if err != nil { return errs.NewError(err) } for _, m := range ms { err := s.AgentAddLiquidityDAOToken(ctx, m.ID) if err != nil { retErr = errs.MergeError(retErr, errs.NewErrorWithId(err, m.ID)) } } return retErr }, ) if err != nil { return errs.NewError(err) } return nil } func (s *Service) AgentAddLiquidityDAOToken(ctx context.Context, memeID uint) error { err := s.JobRunCheck( ctx, fmt.Sprintf("AgentAddLiquidityDAOToken_%d", memeID), func() error { m, err := s.dao.FirstLaunchpadByID( daos.GetDBMainCtx(ctx), memeID, map[string][]interface{}{}, false, ) if err != nil { return errs.NewError(err) } if m == nil { return errs.NewError(errs.ErrBadRequest) } if m.Status == models.LaunchpadStatusTge && m.AddLiquidityTxHash == "" { daoPoolAddress := strings.ToLower(s.conf.GetConfigKeyString(m.NetworkID, "meme_pool_address")) { hash, err := s.GetEthereumClient(ctx, m.NetworkID). Erc20ApproveMaxCheck( m.TokenAddress, s.GetAddressPrk(daoPoolAddress), helpers.HexToAddress(m.Address), ) if err != nil { return errs.NewError(err) } if hash != "" { time.Sleep(10 * time.Second) err = s.GetEthereumClient(ctx, m.NetworkID).TransactionConfirmed(hash) if err != nil { return errs.NewError(err) } } } txHash, err := func() (string, error) { hash, err := s.GetEthereumClient(ctx, m.NetworkID). DAOTreasuryAddLiquidity( m.Address, s.GetAddressPrk(daoPoolAddress), helpers.HexToAddress(m.TokenAddress), ) if err != nil { return hash, errs.NewError(err) } _ = daos.GetDBMainCtx(ctx).Model(&m). Updates( map[string]interface{}{ "add_liquidity_tx_hash": hash, }, ).Error time.Sleep(10 * time.Second) err = s.GetEthereumClient(ctx, m.NetworkID).TransactionConfirmed(hash) if err != nil { return hash, errs.NewError(err) } return hash, nil }() if err != nil { _ = daos.GetDBMainCtx(ctx).Model(&m). Updates( map[string]interface{}{ "add_liquidity_tx_hash": txHash, "status": models.LaunchpadStatusPoolError, }, ).Error return errs.NewError(err) } else { err = daos.GetDBMainCtx(ctx).Model(&m). Updates( map[string]interface{}{ "status": models.LaunchpadStatusDone, "add_liquidity_tx_hash": txHash, }, ).Error if err != nil { return errs.NewError(err) } } } return nil }, ) if err != nil { return errs.NewError(err) } return nil } func (s *Service) JobAgentTgeTransferDAOToken(ctx context.Context) error { err := s.JobRunCheck( ctx, "JobAgentTgeTransferDAOToken", func() error { var retErr error { err := daos.GetDBMainCtx(ctx). Exec(` update launchpad_members join launchpads on launchpad_members.launchpad_id = launchpads.id set launchpad_members.status = 'tge_done' where launchpads.status = 'settled' and launchpad_members.token_balance = 0 and launchpad_members.status = 'new'; `). Error if err != nil { return errs.NewError(err) } } { err := daos.GetDBMainCtx(ctx). Exec(` update launchpad_members join launchpads on launchpad_members.launchpad_id = launchpads.id set launchpad_members.status = 'tge_done', launchpad_members.token_balance = 0, launchpad_members.refund_balance = launchpad_members.refund_balance + launchpad_members.fund_balance, launchpad_members.fund_balance = 0 where launchpads.status = 'cancelled' and launchpad_members.status = 'new'; `). Error if err != nil { return errs.NewError(err) } } { ms, err := s.dao.FindLaunchpad( daos.GetDBMainCtx(ctx), map[string][]interface{}{ "status = ?": {models.LaunchpadStatusSettled}, `exists( select 1 from launchpad_members where launchpad_members.launchpad_id = launchpads.id and launchpad_members.status = 'new' and launchpad_members.token_transfer_tx_hash = '' and launchpad_members.token_balance > 0 )`: {}, }, map[string][]interface{}{}, []string{ "rand()", }, 0, 2, ) if err != nil { return errs.NewError(err) } for _, m := range ms { err := s.AgentTgeTransferDAOTokenMulti(ctx, m.ID) if err != nil { retErr = errs.MergeError(retErr, errs.NewErrorWithId(err, m.ID)) } } } return retErr }, ) if err != nil { return errs.NewError(err) } return nil } func (s *Service) AgentTgeTransferDAOTokenMulti(ctx context.Context, launchpadID uint) error { err := s.JobRunCheck( ctx, fmt.Sprintf("AgentTgeTransferDAOTokenMulti_%d", launchpadID), func() error { launchpad, err := s.dao.FirstLaunchpadByID( daos.GetDBMainCtx(ctx), launchpadID, map[string][]interface{}{}, false, ) if err != nil { return errs.NewError(err) } if launchpad == nil { return errs.NewError(errs.ErrBadRequest) } if launchpad.Status != models.LaunchpadStatusSettled { return errs.NewError(errs.ErrBadRequest) } networkID := launchpad.NetworkID ms, err := s.dao.FindLaunchpadMember( daos.GetDBMainCtx(ctx), map[string][]interface{}{ "launchpad_id = ?": {launchpad.ID}, "status = ?": {models.LaunchpadMemberStatusNew}, "token_transfer_tx_hash = ''": {}, "token_balance > 0": {}, }, map[string][]interface{}{}, []string{ "rand()", }, 0, 100, ) if err != nil { return errs.NewError(err) } var ids []uint for _, m := range ms { ids = append(ids, m.ID) } if len(ids) > 0 { daoPoolAddress := strings.ToLower(s.conf.GetConfigKeyString(networkID, "meme_pool_address")) multisendAddress := strings.ToLower(s.conf.GetConfigKeyString(networkID, "multisend_contract_address")) tokenAddress := launchpad.TokenAddress { hash, err := s.GetEthereumClient(ctx, networkID). Erc20ApproveMaxCheck( tokenAddress, s.GetAddressPrk(daoPoolAddress), helpers.HexToAddress(multisendAddress), ) if err != nil { return errs.NewError(err) } if hash != "" { time.Sleep(10 * time.Second) err = s.GetEthereumClient(ctx, networkID).TransactionConfirmed(hash) if err != nil { return errs.NewError(err) } } } var addresses []common.Address var amounts []*big.Int for _, id := range ids { mb, err := s.dao.FirstLaunchpadMemberByID( daos.GetDBMainCtx(ctx), id, map[string][]interface{}{}, false, ) if err != nil { return errs.NewError(err) } if mb == nil { return errs.NewError(errs.ErrBadRequest) } if !(mb.Status == models.LaunchpadMemberStatusNew && mb.TokenTransferTxHash == "") { return errs.NewError(errs.ErrBadRequest) } addresses = append(addresses, helpers.HexToAddress(mb.UserAddress)) amounts = append(amounts, models.ConvertBigFloatToWei(&mb.TokenBalance.Float, 18)) } err := daos.GetDBMainCtx(ctx). Model(&models.LaunchpadMember{}). Where("id in (?)", ids). Updates( map[string]interface{}{ "token_transfer_tx_hash": "pending", }, ).Error if err != nil { return errs.NewError(err) } txHash, err := func() (string, error) { hash, err := s.GetEthereumClient(ctx, networkID). MultisendERC20Transfer( multisendAddress, s.GetAddressPrk(daoPoolAddress), helpers.HexToAddress(tokenAddress), addresses, amounts, ) if err != nil { return "", errs.NewError(err) } _ = daos.GetDBMainCtx(ctx). Model(&models.LaunchpadMember{}). Where("id in (?)", ids). Updates( map[string]interface{}{ "token_transfer_tx_hash": hash, }, ).Error time.Sleep(10 * time.Second) err = s.GetEthereumClient(ctx, networkID).TransactionConfirmed(hash) if err != nil { return hash, errs.NewError(err) } return hash, nil }() if err != nil { err = daos.GetDBMainCtx(ctx). Model(&models.LaunchpadMember{}). Where("id in (?)", ids). Updates( map[string]interface{}{ "token_transfer_tx_hash": txHash, "status": models.LaunchpadMemberStatusTgeError, }, ).Error return errs.NewError(err) } else { err = daos.GetDBMainCtx(ctx). Model(&models.LaunchpadMember{}). Where("id in (?)", ids). Updates( map[string]interface{}{ "token_transfer_tx_hash": txHash, "status": models.LaunchpadMemberStatusTgeDone, }, ).Error if err != nil { return errs.NewError(err) } } } return nil }, ) if err != nil { return errs.NewError(err) } return nil } func (s *Service) JobAgentTgeRefundBaseToken(ctx context.Context) error { err := s.JobRunCheck( ctx, "JobAgentTgeTransferDAOToken", func() error { var retErr error err := daos.GetDBMainCtx(ctx). Model(&models.LaunchpadMember{}). Where("status = ?", models.LaunchpadMemberStatusTgeDone). Where("refund_balance = 0"). Updates( map[string]interface{}{ "status": models.LaunchpadMemberStatusDone, }, ). Error if err != nil { return errs.NewError(err) } { networkID := models.BASE_CHAIN_ID ms, err := s.dao.FindLaunchpadMember( daos.GetDBMainCtx(ctx), map[string][]interface{}{ "network_id = ?": {networkID}, "status = ?": {models.LaunchpadMemberStatusTgeDone}, "refund_transfer_tx_hash = ''": {}, "refund_balance > 0": {}, }, map[string][]interface{}{}, []string{ "rand()", }, 0, 100, ) if err != nil { return errs.NewError(err) } var ids []uint for _, m := range ms { ids = append(ids, m.ID) } err = s.AgentTgeRefundBaseTokenMulti(ctx, networkID, ids) if err != nil { retErr = errs.MergeError(retErr, err) } } return retErr }, ) if err != nil { return errs.NewError(err) } return nil } func (s *Service) AgentTgeRefundBaseTokenMulti(ctx context.Context, networkID uint64, ids []uint) error { err := s.JobRunCheck( ctx, fmt.Sprintf("AgentTgeRefundBaseTokenMulti_%d", networkID), func() error { if len(ids) > 0 { daoPoolAddress := strings.ToLower(s.conf.GetConfigKeyString(networkID, "meme_pool_address")) baseTokenAddress := strings.ToLower(s.conf.GetConfigKeyString(networkID, "eai_contract_address")) multisendAddress := strings.ToLower(s.conf.GetConfigKeyString(networkID, "multisend_contract_address")) { hash, err := s.GetEthereumClient(ctx, networkID). Erc20ApproveMaxCheck( baseTokenAddress, s.GetAddressPrk(daoPoolAddress), helpers.HexToAddress(multisendAddress), ) if err != nil { return errs.NewError(err) } if hash != "" { time.Sleep(10 * time.Second) err = s.GetEthereumClient(ctx, networkID).TransactionConfirmed(hash) if err != nil { return errs.NewError(err) } } } var addresses []common.Address var amounts []*big.Int for _, id := range ids { mb, err := s.dao.FirstLaunchpadMemberByID( daos.GetDBMainCtx(ctx), id, map[string][]interface{}{}, false, ) if err != nil { return errs.NewError(err) } if mb == nil { return errs.NewError(errs.ErrBadRequest) } if !(mb.Status == models.LaunchpadMemberStatusTgeDone && mb.RefundTransferTxHash == "") { return errs.NewError(errs.ErrBadRequest) } refundFeeBalance := models.MulBigFloats(&mb.RefundBalance.Float, numeric.NewFloatFromString("0.05")) _ = daos.GetDBMainCtx(ctx).Model(&mb). Updates( map[string]interface{}{ "refund_fee_balance": numeric.NewBigFloatFromFloat(refundFeeBalance), }, ).Error refundBalance := models.SubBigFloats(&mb.RefundBalance.Float, refundFeeBalance) addresses = append(addresses, helpers.HexToAddress(mb.UserAddress)) amounts = append(amounts, models.ConvertBigFloatToWei(refundBalance, 18)) } err := daos.GetDBMainCtx(ctx). Model(&models.LaunchpadMember{}). Where("id in (?)", ids). Updates( map[string]interface{}{ "refund_transfer_tx_hash": "pending", }, ).Error if err != nil { return errs.NewError(err) } txHash, err := func() (string, error) { hash, err := s.GetEthereumClient(ctx, networkID). MultisendERC20Transfer( multisendAddress, s.GetAddressPrk(daoPoolAddress), helpers.HexToAddress(baseTokenAddress), addresses, amounts, ) if err != nil { return "", errs.NewError(err) } _ = daos.GetDBMainCtx(ctx). Model(&models.LaunchpadMember{}). Where("id in (?)", ids). Updates( map[string]interface{}{ "refund_transfer_tx_hash": hash, }, ).Error time.Sleep(10 * time.Second) err = s.GetEthereumClient(ctx, networkID).TransactionConfirmed(hash) if err != nil { return hash, errs.NewError(err) } return hash, nil }() if err != nil { err = daos.GetDBMainCtx(ctx). Model(&models.LaunchpadMember{}). Where("id in (?)", ids). Updates( map[string]interface{}{ "refund_transfer_tx_hash": txHash, "status": models.LaunchpadMemberStatusRefundError, }, ).Error return errs.NewError(err) } else { err = daos.GetDBMainCtx(ctx). Model(&models.LaunchpadMember{}). Where("id in (?)", ids). Updates( map[string]interface{}{ "refund_transfer_tx_hash": txHash, "status": models.LaunchpadMemberStatusDone, }, ).Error if err != nil { return errs.NewError(err) } } } return nil }, ) if err != nil { return errs.NewError(err) } return nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/agent_library.go ================================================ package services import ( "context" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/daos" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/serializers" "github.com/jinzhu/gorm" ) func (s *Service) GetListAgentLibrary(ctx context.Context, agentType int, networkID uint64) ([]*models.AgentLibrary, error) { filter := map[string][]interface{}{ "network_id = ? ": {networkID}, } if agentType > 0 { filter["agent_type = ? "] = []interface{}{agentType} } res, err := s.dao.FindAgentLibrary( daos.GetDBMainCtx(ctx), filter, map[string][]interface{}{}, []string{"id desc"}, 0, 1000, ) if err != nil { return nil, errs.NewError(err) } return res, nil } func (s *Service) SaveAgentLibrary(ctx context.Context, networkID uint64, req *serializers.AgentLibraryReq) (*models.AgentLibrary, error) { var agentLibrary *models.AgentLibrary err := daos.WithTransaction( daos.GetDBMainCtx(ctx), func(tx *gorm.DB) error { agentLibrary := &models.AgentLibrary{ NetworkID: networkID, Name: req.Name, SourceURL: req.SourceUrl, AgentType: models.AgentInfoAgentType(req.AgentType), } return s.dao.Create(tx, agentLibrary) }, ) if err != nil { return nil, errs.NewError(err) } return agentLibrary, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/agent_manage.go ================================================ package services import ( "context" "encoding/hex" "encoding/json" "fmt" "math/big" "net/http" "strconv" "strings" "time" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/daos" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/helpers" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/serializers" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/delegate_cash" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/hiro" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/lighthouse" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/magiceden" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/trxapi" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/types/numeric" "github.com/ethereum/go-ethereum/accounts" "github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/crypto" "github.com/jinzhu/gorm" "github.com/sashabaranov/go-openai" ) func (s *Service) GetModelDefaultByChainID(chainID uint64) string { var baseModel string s.RedisCached( fmt.Sprintf("GetModelDefaultByChainID_%d", chainID), true, 10*time.Minute, &baseModel, func() (interface{}, error) { baseModel = "NousResearch/Hermes-3-Llama-3.1-70B-FP8" listConfig, _ := s.dojoAPI.GetChainConfigs() for _, chain := range listConfig { if strings.EqualFold(chain.ChainId, fmt.Sprintf("%d", chainID)) { for modelName := range chain.SupportModelNames { baseModel = modelName } break } } return baseModel, nil }, ) fmt.Println(baseModel) return baseModel } func (s *Service) AgentCreateAgentAssistant(ctx context.Context, address string, req *serializers.AssistantsReq) (*models.AgentInfo, error) { if req.SystemContent == "" { req.SystemContent = "default" } agent := &models.AgentInfo{ Version: "2", AgentCategoryID: req.CategoryID, AgentType: models.AgentInfoAgentTypeReasoning, AgentID: helpers.RandomBigInt(12).Text(16), Status: models.AssistantStatusPending, NetworkID: req.ChainID, NetworkName: models.GetChainName(req.ChainID), AgentName: req.AgentName, Creator: strings.ToLower(address), MetaData: req.SystemContent, SystemPrompt: req.SystemContent, AgentBaseModel: req.AgentBaseModel, Bio: req.GetAssistantCharacter(req.Bio), Lore: req.GetAssistantCharacter(req.Lore), Knowledge: req.GetAssistantCharacter(req.Knowledge), MessageExamples: req.GetAssistantCharacter(req.MessageExamples), PostExamples: req.GetAssistantCharacter(req.PostExamples), Topics: req.GetAssistantCharacter(req.Topics), Style: req.GetAssistantCharacter(req.Style), Adjectives: req.GetAssistantCharacter(req.Adjectives), SocialInfo: req.GetAssistantCharacter(req.SocialInfo), ScanEnabled: false, VerifiedNftOwner: req.VerifiedNFTOwner, NftAddress: req.NFTAddress, NftTokenID: req.NFTTokenID, NftOwnerAddress: req.NFTOwnerAddress, Thumbnail: req.Thumbnail, NftTokenImage: req.NFTTokenImage, TokenImageUrl: req.TokenImageUrl, MissionTopics: req.MissionTopics, ConfigData: req.ConfigData, SourceUrl: req.SourceUrl, AuthenUrl: req.AuthenUrl, DependAgents: req.DependAgents, EnvExample: req.EnvExample, CodeVersion: 1, Author: req.Author, } if req.RequiredEnv != nil { agent.RequiredEnv = *req.RequiredEnv } if req.RequiredWallet != nil { agent.RequiredWallet = *req.RequiredWallet } if req.IsOnchain != nil { agent.IsOnchain = *req.IsOnchain } if req.IsStreaming != nil { agent.IsStreaming = *req.IsStreaming } if req.IsCustomUi != nil { agent.IsCustomUi = *req.IsCustomUi } if req.RequiredInfo != nil { agent.RequiredInfo = *req.RequiredInfo } if req.InferFee != nil { inferFee := numeric.NewBigFloatFromString(*req.InferFee) agent.InferFee = inferFee } if req.DisplayName != "" { agent.DisplayName = req.DisplayName } if req.ShortDescription != "" { agent.ShortDescription = req.ShortDescription } agent.MinFeeToUse = req.MinFeeToUse agent.Worker = req.Worker if req.IsForceUpdate != nil { agent.IsForceUpdate = *req.IsForceUpdate } tokenInfo, _ := s.GenerateTokenInfoFromSystemPrompt(ctx, req.AgentName, req.SystemContent) if tokenInfo != nil && tokenInfo.TokenSymbol != "" { agent.TokenSymbol = tokenInfo.TokenSymbol agent.TokenName = req.AgentName agent.TokenDesc = tokenInfo.TokenDesc if req.TokenImageUrl == "" { agent.TokenImageUrl = tokenInfo.TokenImageUrl } } else { agent.TokenName = req.AgentName agent.TokenSymbol = helpers.GenerateTokenSymbol(req.AgentName) } if req.CreateTokenMode == models.CreateTokenModeTypeLinkExisting { agent.TokenMode = string(models.CreateTokenModeTypeLinkExisting) agent.TokenAddress = req.TokenAddress agent.TokenSymbol = req.Ticker agent.TokenName = req.TokenName tokenChainId, _ := strconv.ParseUint(req.TokenChainId, 0, 64) agent.TokenNetworkID = tokenChainId } else if req.TokenChainId != "" { tokenChainId, _ := strconv.ParseUint(req.TokenChainId, 0, 64) if !(tokenChainId == models.POLYGON_CHAIN_ID || tokenChainId == models.ZKSYNC_CHAIN_ID) { agent.TokenNetworkID = tokenChainId if req.CreateTokenMode != "" { agent.TokenMode = string(req.CreateTokenMode) } } else { agent.TokenNetworkID = models.GENERTAL_NETWORK_ID agent.TokenMode = string(models.TokenSetupEnumNoToken) } } if agent.AgentBaseModel == "" { agent.AgentBaseModel = s.GetModelDefaultByChainID(req.ChainID) } if req.VerifiedNFTOwner { if req.NFTAddress == "" || req.NFTTokenID == "" || req.NFTOwnerAddress == "" { req.VerifiedNFTOwner = false } else { checked := false if strings.Contains(req.NFTTokenID, "i0") { // inscription checked = s.CheckOwnerInscription(req.NFTDelegateAddress, req.NFTOwnerAddress, req.NFTPublicKey, req.NFTTokenID, req.NFTSignature, req.NFTSignMessage) } else { checked = s.CheckOwnerNFT721(req.NFTDelegateAddress, req.NFTOwnerAddress, req.NFTAddress, req.NFTTokenID, req.NFTSignature, req.NFTSignMessage) } agent.VerifiedNftOwner = checked } } if req.TwinTwitterUsernames != "" { agent.TwinTwitterUsernames = req.TwinTwitterUsernames agent.TwinStatus = models.TwinStatusPending listPendingAgents, err := s.dao.FindAgentInfo( daos.GetDBMainCtx(ctx), map[string][]interface{}{ `twin_twitter_usernames != '' and twin_status = ?`: {models.TwinStatusPending}, "scan_enabled = ?": {true}, }, map[string][]interface{}{}, []string{ "id asc", }, 0, 999999, ) if err != nil { return nil, err } estimateDoneTime := time.Now().Add(time.Duration(len(listPendingAgents)) * 30 * time.Minute) agent.EstimateTwinDoneTimestamp = &estimateDoneTime } // generate address switch agent.NetworkID { case models.LOCAL_CHAIN_ID: { // nothing for local } default: { ethAddress, err := s.CreateETHAddress(ctx) if err != nil { return nil, errs.NewError(err) } agent.ETHAddress = strings.ToLower(ethAddress) agent.TronAddress = trxapi.AddrEvmToTron(ethAddress) solAddress, err := s.CreateSOLAddress(ctx) if err != nil { return nil, errs.NewError(err) } agent.SOLAddress = solAddress addressBtc, err := s.CreateBTCAddress(ctx) if err != nil { return nil, errs.NewError(err) } agent.TipBtcAddress = addressBtc addressEth, err := s.CreateETHAddress(ctx) if err != nil { return nil, errs.NewError(err) } agent.TipEthAddress = addressEth addressSol, err := s.CreateSOLAddress(ctx) if err != nil { return nil, errs.NewError(err) } agent.TipSolAddress = addressSol } } if req.AgentType > 0 { agent.AgentType = req.AgentType if req.AgentType == models.AgentInfoAgentTypeModel || req.AgentType == models.AgentInfoAgentTypeModelOnline || req.AgentType == models.AgentInfoAgentTypeJs || req.AgentType == models.AgentInfoAgentTypePython || req.AgentType == models.AgentInfoAgentTypeCustomUi || req.AgentType == models.AgentInfoAgentTypeCustomPrompt { agent.IsPublic = false } } if req.CreateKnowledgeRequest != nil { agent.AgentType = models.AgentInfoAgentTypeKnowledgeBase } if agent.AgentName == "" && req.CreateKnowledgeRequest != nil { agent.AgentName = req.CreateKnowledgeRequest.Name } if err := s.dao.Create(daos.GetDBMainCtx(ctx), agent); err != nil { return nil, errs.NewError(err) } agentTokenInfo := &models.AgentTokenInfo{} agentTokenInfo.AgentInfoID = agent.ID agentTokenInfo.NetworkID = agent.TokenNetworkID agentTokenInfo.NetworkName = models.GetChainName(agent.TokenNetworkID) if err := s.dao.Create(daos.GetDBMainCtx(ctx), agentTokenInfo); err != nil { return nil, errs.NewError(err) } agent.TokenInfoID = agentTokenInfo.ID if err := s.dao.Save(daos.GetDBMainCtx(ctx), agent); err != nil { return nil, errs.NewError(err) } if agent.ID > 0 { if req.CreateTokenMode == models.CreateTokenModeTypeLinkExisting { go s.UpdateTokenPriceInfo(context.Background(), agent.ID) } go s.AgentCreateMissionDefault(context.Background(), agent.ID) } if req.CreateKnowledgeRequest != nil { ctx := context.Background() kbReq := req.CreateKnowledgeRequest kbReq.UserAddress = strings.ToLower(address) kbReq.DepositAddress = agent.ETHAddress kbReq.SolanaDepositAddress = agent.SOLAddress kbReq.NetworkID = req.ChainID kbReq.AgentInfoId = agent.ID kb, err := s.KnowledgeUsecase.CreateKnowledgeBase(ctx, req.CreateKnowledgeRequest) if err != nil { s.KnowledgeUsecase.SendMessage(ctx, fmt.Sprintf("CreateKnowledgeBase for agent %s (%d) - has error: %s ", agent.AgentName, agent.ID, err.Error()), -1) return nil, err } agent.AgentKBId = kb.ID if err := s.dao.Save(daos.GetDBMainCtx(ctx), agent); err != nil { return nil, errs.NewError(err) } oKb, _ := s.KnowledgeUsecase.GetKnowledgeBaseById(ctx, kb.ID) agent.KnowledgeBase = oKb s.KnowledgeUsecase.SendMessage(ctx, fmt.Sprintf("Create KB Agent DONE %s (%d)", agent.AgentName, agent.ID), 0) } if agent.IsVibeAgent() { go s.CreateTokenInfoVibe(context.Background(), agent.ID) } return agent, nil } func (s *Service) CheckOwnerInscription(delegate, vault, publicKey, tokenId, signature, signMessage string) bool { if !strings.Contains(tokenId, "i0") { return false } if signature != "" { temp, err := s.verifyInscription(signature, delegate, publicKey, signMessage) if err != nil || !temp { return false } } owner := "" magicEdenService := magiceden.NewMagicedenService() item, err := magicEdenService.GetInscriptionInfo(tokenId) if err == nil { owner = item.Owner } else { service := hiro.NewHiroService(s.conf.HiroUrl) info, err := service.GetInscriptionInfo(tokenId) if err == nil { owner = info.Address } } if owner == "" { return false } if strings.ToLower(delegate) == strings.ToLower(vault) && strings.ToLower(owner) == strings.ToLower(delegate) { return true } return false } func (s *Service) CheckOwnerNFT721(delegate, vault, contract, tokenId, signature, signMessage string) bool { if strings.Contains(tokenId, "i0") { return false } if signature != "" { temp, _ := s.verify(signature, delegate, signMessage) if !temp { return false } } if strings.ToLower(delegate) == strings.ToLower(vault) { // return true } chainID := 1 // default ETH hardcodeCollection := s.openseaService.FindHardCodeCollectionByAddress(contract) if hardcodeCollection != nil { chainID = hardcodeCollection.ChainID } delegateCash := delegate_cash.NewDelegateCashAPIService(s.conf.DelegateCash.Url, s.conf.DelegateCash.ApiKey) checked, err := delegateCash.CheckDelegateForTokenERC721V1(delegate, vault, contract, tokenId, chainID) if err != nil { fmt.Println(err) } if !checked { checked, err = delegateCash.CheckDelegateForTokenERC721V2(delegate, vault, contract, tokenId, chainID) if err != nil { fmt.Println(err) } } return checked } func (s *Service) verify(signatureHex string, signer string, msgStr string) (bool, error) { _, err := hex.DecodeString(signatureHex) if err != nil { return false, err } sig := hexutil.MustDecode(signatureHex) msgBytes := []byte(msgStr) msgHash := accounts.TextHash(msgBytes) if sig[crypto.RecoveryIDOffset] == 27 || sig[crypto.RecoveryIDOffset] == 28 { sig[crypto.RecoveryIDOffset] -= 27 // Transform yellow paper V from 27/28 to 0/1 } recovered, err := crypto.SigToPub(msgHash, sig) if err != nil { return false, err } recoveredAddr := crypto.PubkeyToAddress(*recovered) signerHex := recoveredAddr.Hex() isVerified := strings.ToLower(signer) == strings.ToLower(signerHex) return isVerified, nil } func (s *Service) verifyInscription(signatureHex string, signer, publicKey string, msgStr string) (bool, error) { fullUrl := "https://api-verify-sig.eternalai.org/api/unisat/verify-sig" req := map[string]string{ "address": signer, "pubKey": publicKey, "message": msgStr, "signature": signatureHex, } resp, _, i, err := helpers.HttpRequest(fullUrl, "POST", map[string]string{ "Content-Type": "application/json", }, req) if err != nil { return false, err } if i != http.StatusOK && i != http.StatusCreated { return false, nil } return string(resp) == "true", nil } func (s *Service) AgentUpdateAgentAssistant(ctx context.Context, address string, req *serializers.AssistantsReq) (*models.AgentInfo, error) { var agent *models.AgentInfo updateMap := make(map[string]interface{}) updateKb := false err := daos.WithTransaction( daos.GetDBMainCtx(ctx), func(tx *gorm.DB) error { var err error if req.AgentID != "" { agent, err = s.dao.FirstAgentInfo(tx, map[string][]interface{}{ "agent_id = ?": {req.AgentID}, }, map[string][]interface{}{ "KnowledgeBase": {}, }, []string{}) if err != nil { return errs.NewError(err) } if agent != nil { agent, err = s.dao.FirstAgentInfoByID(tx, agent.ID, map[string][]interface{}{ "KnowledgeBase": {}, }, true, ) if err != nil { return errs.NewError(err) } } } else { agent, err = s.dao.FirstAgentInfoByID(tx, req.ID, map[string][]interface{}{ "KnowledgeBase": {}, }, true) if err != nil { return errs.NewError(err) } } if agent != nil { if !strings.EqualFold(agent.Creator, address) { return errs.NewError(errs.ErrInvalidOwner) } if !(agent.AgentContractID != "" || agent.AgentNftMinted == true) { agent.NetworkID = req.ChainID agent.NetworkName = models.GetChainName(req.ChainID) } if req.AgentName != "" { agent.AgentName = req.AgentName } if req.SystemContent != "" { agent.MetaData = req.SystemContent agent.SystemPrompt = req.SystemContent } agent.Bio = req.GetAssistantCharacter(req.Bio) agent.Lore = req.GetAssistantCharacter(req.Lore) agent.Knowledge = req.GetAssistantCharacter(req.Knowledge) agent.MessageExamples = req.GetAssistantCharacter(req.MessageExamples) agent.PostExamples = req.GetAssistantCharacter(req.PostExamples) agent.Topics = req.GetAssistantCharacter(req.Topics) agent.Style = req.GetAssistantCharacter(req.Style) agent.Adjectives = req.GetAssistantCharacter(req.Adjectives) agent.SocialInfo = req.GetAssistantCharacter(req.SocialInfo) if req.EnvExample != "" { agent.EnvExample = req.EnvExample } if req.RequiredEnv != nil { agent.RequiredEnv = *req.RequiredEnv } if req.SourceUrl != "" { agent.SourceUrl = req.SourceUrl } if req.AuthenUrl != "" { agent.AuthenUrl = req.AuthenUrl } if req.DependAgents != "" { agent.DependAgents = req.DependAgents } if req.RequiredWallet != nil { agent.RequiredWallet = *req.RequiredWallet } if req.IsOnchain != nil { agent.IsOnchain = *req.IsOnchain } if req.IsStreaming != nil { agent.IsStreaming = *req.IsStreaming } if req.IsCustomUi != nil { agent.IsCustomUi = *req.IsCustomUi } if req.RequiredInfo != nil { agent.RequiredInfo = *req.RequiredInfo } if req.InferFee != nil { inferFee := numeric.NewBigFloatFromString(*req.InferFee) agent.InferFee = inferFee } if req.MinFeeToUse.Cmp(big.NewFloat(0)) > 0 { agent.MinFeeToUse = req.MinFeeToUse } if req.Worker != "" { agent.Worker = req.Worker } if req.TokenImageUrl != "" { agent.TokenImageUrl = req.TokenImageUrl } if req.DisplayName != "" { agent.DisplayName = req.DisplayName } if req.ShortDescription != "" { agent.ShortDescription = req.ShortDescription } if req.CategoryID != 0 { agent.AgentCategoryID = req.CategoryID } if req.IsForceUpdate != nil { agent.IsForceUpdate = *req.IsForceUpdate } if req.Author != "" { agent.Author = req.Author } if agent.TokenStatus == "" && agent.TokenAddress == "" { if req.TokenChainId != "" { tokenChainId, _ := strconv.ParseUint(req.TokenChainId, 0, 64) if !(tokenChainId == models.POLYGON_CHAIN_ID || tokenChainId == models.ZKSYNC_CHAIN_ID) { agent.TokenNetworkID = tokenChainId if req.CreateTokenMode != "" { agent.TokenMode = string(req.CreateTokenMode) } tokenName := req.TokenName if req.TokenName == "" { tokenName = req.Ticker } agent.TokenSymbol = req.Ticker agent.TokenName = tokenName agent.TokenDesc = req.TokenDesc if agent.TokenMode == string(models.TokenSetupEnumAutoCreate) && (agent.AgentNftMinted || (agent.AgentType == models.AgentInfoAgentTypeKnowledgeBase && agent.Status == models.AssistantStatusReady)) { agent.TokenStatus = "pending" } } else { agent.TokenNetworkID = models.GENERTAL_NETWORK_ID agent.TokenMode = string(models.TokenSetupEnumNoToken) } } } err := s.dao.Save(tx, agent) if err != nil { return errs.NewError(err) } if req.CreateKnowledgeRequest != nil && agent.AgentType == models.AgentInfoAgentTypeKnowledgeBase { updateKb = true kbReq := req.CreateKnowledgeRequest if kbReq.Name != "" { updateMap["name"] = kbReq.Name agent.AgentName = kbReq.Name if err := s.dao.Save(tx, agent); err != nil { return errs.NewError(err) } } if kbReq.Description != "" { updateMap["description"] = kbReq.Description } if kbReq.NetworkID != 0 { updateMap["network_id"] = kbReq.NetworkID } if kbReq.ThumbnailUrl != "" { updateMap["thumbnail_url"] = kbReq.ThumbnailUrl } if kbReq.DomainUrl != "" { updateMap["domain_url"] = kbReq.DomainUrl } } go s.AgentCreateMissionDefault(context.Background(), agent.ID) } return nil }, ) if err != nil { return nil, errs.NewError(err) } if updateKb { i, err := s.KnowledgeUsecase.GetKnowledgeBaseById(ctx, agent.AgentKBId) if err != nil { return nil, err } if len(req.CreateKnowledgeRequest.Files) > 0 { updatedListFile, err := s.KnowledgeUsecase.UpdateListKnowledgeBaseFile(ctx, agent.AgentKBId, req.CreateKnowledgeRequest.Files) if err != nil { return nil, errs.NewError(err) } if updatedListFile { i.ChargeMore = i.CalcChargeMore() if i.ChargeMore != 0 { i.Fee = i.Fee + i.ChargeMore updateMap["fee"] = i.Fee updateMap["charge_more"] = i.ChargeMore updateMap["status"] = models.KnowledgeBaseStatusWaitingPayment } } } if err := s.KnowledgeUsecase.UpdateKnowledgeBaseById(ctx, agent.AgentKBId, updateMap); err != nil { return nil, err } agent.KnowledgeBase = i } agentInfoKbs := []*models.AgentInfoKnowledgeBase{} for _, id := range req.KbIds { i := &models.AgentInfoKnowledgeBase{ AgentInfoId: agent.ID, KnowledgeBaseId: id, } agentInfoKbs = append(agentInfoKbs, i) } _, err = s.KnowledgeUsecase.CreateAgentInfoKnowledgeBase(ctx, agentInfoKbs, agent.ID) if err != nil { return nil, err } return agent, nil } func (s *Service) UpdateAgentInfoInContract(ctx context.Context, address string, req *serializers.UpdateAgentAssistantInContractRequest) (*models.AgentInfo, error) { var agent *models.AgentInfo err := daos.WithTransaction( daos.GetDBMainCtx(ctx), func(tx *gorm.DB) error { var err error if req.AgentID != "" { agent, err = s.dao.FirstAgentInfo(tx, map[string][]interface{}{ "agent_id = ?": {req.AgentID}, }, map[string][]interface{}{}, []string{}) if err != nil { return errs.NewError(err) } if agent != nil { agent, err = s.dao.FirstAgentInfoByID(tx, agent.ID, map[string][]interface{}{}, true) if err != nil { return errs.NewError(err) } } } else { agent, err = s.dao.FirstAgentInfoByID(tx, req.ID, map[string][]interface{}{}, true) if err != nil { return errs.NewError(err) } } if agent != nil { if !strings.EqualFold(agent.Creator, address) { return errs.NewError(errs.ErrInvalidOwner) } systemPromptBytes, _, err := lighthouse.DownloadDataSimple(req.HashSystemPrompt) if err != nil { return errs.NewError(err) } dataBytes, _, err := lighthouse.DownloadDataSimple(req.HashName) if err != nil { return errs.NewError(err) } agentUriData := models.AgentUriData{} err = json.Unmarshal(dataBytes, &agentUriData) if err != nil { return errs.NewError(err) } agent.SystemPrompt = string(systemPromptBytes) agent.AgentName = agentUriData.Name agent.Uri = req.HashName err = s.dao.Save(tx, agent) if err != nil { return errs.NewError(err) } // _, err = s.ExecuteUpdateAgentInfoInContract(ctx, agent, req) // if err != nil { // return errs.NewError(err) // } } return nil }, ) if err != nil { return nil, errs.NewError(err) } return agent, nil } func (s *Service) UploadDataToLightHouse(ctx context.Context, address string, req *serializers.DataUploadToLightHouse) (string, error) { hash, err := lighthouse.UploadData(s.conf.Lighthouse.Apikey, address, []byte(req.Content)) if err != nil { return "", errs.NewError(err) } return fmt.Sprintf("ipfs://%v", hash), nil } func (s *Service) GenerateTokenInfoFromSystemPrompt(ctx context.Context, tokenName, sysPrompt string) (*models.TweetParseInfo, error) { info := &models.TweetParseInfo{} sysPrompt = strings.ReplaceAll(sysPrompt, "@CryptoEternalAI", "") promptGenerateToken := fmt.Sprintf(` I want to generate my token base on this info '%s' token-name (generate if not provided, make sure it not empty) token-symbol (generate if not provided, make sure it not empty) token-story (generate if not provided, make sure it not empty) Please return in string in json format including token-name, token-symbol, token-story, just only json without explanation and token name limit with 15 characters `, sysPrompt) // aiStr, err := s.openais["Lama"].ChatMessage(promptGenerateToken) // if err != nil { // return nil, errs.NewError(err) // } message := []openai.ChatCompletionMessage{ openai.ChatCompletionMessage{ Role: "system", Content: "You are a helpful assistant", }, openai.ChatCompletionMessage{ Role: "user", Content: promptGenerateToken, }, } aiStr, err := s.openais["Agent"].CallStreamDirectlyEternalLLMV2(ctx, message, "Qwen/QwQ-32B", s.conf.KnowledgeBaseConfig.DirectServiceUrl, nil) if err != nil { return nil, errs.NewError(err) } fmt.Println(aiStr) if aiStr != "" { mapInfo := helpers.ExtractMapInfoFromOpenAI(aiStr) tokenSymbol := "" tokenDesc := "" imageUrl := "" if mapInfo != nil { if v, ok := mapInfo["token-symbol"]; ok { tokenSymbol = fmt.Sprintf(`%v`, v) } if v, ok := mapInfo["token-story"]; ok { tokenDesc = fmt.Sprintf(`%v`, v) } if tokenName == "" { if v, ok := mapInfo["token-name"]; ok { tokenName = fmt.Sprintf(`%v`, v) } if tokenName == "" { tokenName = tokenSymbol } } imageUrl, _ = s.GetGifImageUrlFromTokenInfo(tokenSymbol, tokenName, tokenDesc) } info = &models.TweetParseInfo{ TokenSymbol: tokenSymbol, TokenDesc: tokenDesc, TokenImageUrl: imageUrl, TokenName: tokenName, } } return info, nil } func (s *Service) JobMigrateTronAddress(ctx context.Context) error { err := s.JobRunCheck( ctx, "JobMigrateTronAddress", func() error { agents, err := s.dao.FindAgentInfo( daos.GetDBMainCtx(ctx), map[string][]interface{}{ "tron_address = '' or tron_address is null": {}, }, map[string][]interface{}{}, []string{}, 0, 1000, ) if err != nil { return errs.NewError(err) } var retErr error for _, agent := range agents { err = daos.GetDBMainCtx(ctx). Model(agent). Updates( map[string]interface{}{ "tron_address": trxapi.AddrEvmToTron(agent.ETHAddress), }, ). Error if err != nil { return errs.NewError(err) } } return retErr }, ) if err != nil { return errs.NewError(err) } return nil } // // func (s *Service) AgentCreateAgentStudio(ctx context.Context, address, graphData string) ([]*models.AgentInfo, error) { var reqs *models.AgentStudioGraphData json.Unmarshal([]byte(graphData), &reqs) if reqs != nil && len(reqs.Data) <= 0 { return nil, errs.NewError(errs.ErrBadRequest) } listAgent := []*models.AgentInfo{} for _, req := range reqs.Data { if req.Idx == "agent_new" { agent := &models.AgentInfo{ Version: "2", AgentType: models.AgentInfoAgentTypeReasoning, AgentID: helpers.RandomBigInt(12).Text(16), Status: models.AssistantStatusPending, AgentName: fmt.Sprintf("%v", req.Data["agentName"]), Creator: strings.ToLower(address), ScanEnabled: false, GraphData: graphData, } listMission := []*serializers.AgentSnapshotMissionInfo{} for _, item := range req.Children { switch item.CategoryIdx { case "personality": { switch item.Idx { case "personality_customize": { agent.SystemPrompt = helpers.GetStringValueFromMap(item.Data, "personality") } case "personality_nft": { agent.SystemPrompt = helpers.GetStringValueFromMap(item.Data, "personality") var nftInfo map[string]interface{} somebytes, _ := json.Marshal(item.Data["selectedNFT"]) err1 := json.Unmarshal(somebytes, &nftInfo) if err1 == nil { agent.VerifiedNftOwner = false agent.NftAddress = helpers.GetStringValueFromMap(nftInfo, "token_address") agent.NftTokenID = helpers.GetStringValueFromMap(nftInfo, "token_id") agent.NftTokenImage = helpers.GetStringValueFromMap(nftInfo, "token_uri") agent.NftOwnerAddress = helpers.GetStringValueFromMap(nftInfo, "owner_of") } } case "personality_ordinals": { agent.SystemPrompt = helpers.GetStringValueFromMap(item.Data, "personality") var nftInfo map[string]interface{} somebytes, _ := json.Marshal(item.Data["selectedNFT"]) err1 := json.Unmarshal(somebytes, &nftInfo) if err1 == nil { agent.VerifiedNftOwner = false agent.NftAddress = helpers.GetStringValueFromMap(nftInfo, "token_address") agent.NftTokenID = helpers.GetStringValueFromMap(nftInfo, "token_id") agent.NftTokenImage = helpers.GetStringValueFromMap(nftInfo, "token_uri") agent.NftOwnerAddress = helpers.GetStringValueFromMap(nftInfo, "owner_of") } } case "personality_token": { agent.SystemPrompt = helpers.GetStringValueFromMap(item.Data, "personality") } case "personality_genomics": { agent.SystemPrompt = helpers.GetStringValueFromMap(item.Data, "personality") var twitterInfo []map[string]interface{} somebytes, _ := json.Marshal(item.Data["twitterInfos"]) json.Unmarshal(somebytes, &twitterInfo) if len(twitterInfo) > 0 { twinTwitterUsernames := []string{} for _, tw := range twitterInfo { username := helpers.GetStringValueFromMap(tw, "username") if username != "" { twinTwitterUsernames = append(twinTwitterUsernames, username) } } if len(twinTwitterUsernames) > 0 { agent.TwinTwitterUsernames = strings.Join(twinTwitterUsernames, ",") agent.TwinStatus = models.TwinStatusPending listPendingAgents, err := s.dao.FindAgentInfo( daos.GetDBMainCtx(ctx), map[string][]interface{}{ `twin_twitter_usernames != '' and twin_status = ?`: {models.TwinStatusPending}, "scan_enabled = ?": {true}, }, map[string][]interface{}{}, []string{ "id asc", }, 0, 999999, ) if err != nil { return nil, errs.NewError(err) } estimateDoneTime := time.Now().Add(time.Duration(len(listPendingAgents)) * 30 * time.Minute) agent.EstimateTwinDoneTimestamp = &estimateDoneTime } } } case "personality_knowledge": { agent.SystemPrompt = helpers.GetStringValueFromMap(item.Data, "personality") agent.AgentType = models.AgentInfoAgentTypeKnowledgeBase } } } case "blockchain": { chainName := helpers.GetStringValueFromMap(item.Data, "chainId") agent.NetworkID = models.GetChainID(chainName) agent.NetworkName = models.GetChainName(agent.NetworkID) } case "decentralized_inference": { agent.AgentBaseModel = fmt.Sprintf("%v", item.Data["decentralizeId"]) } case "ai_framework": { switch item.Idx { case "ai_framework_eternal_ai": { agent.AgentType = models.AgentInfoAgentTypeReasoning } case "ai_framework_eliza": { agent.AgentType = models.AgentInfoAgentTypeEliza agent.ConfigData = helpers.GetStringValueFromMap(item.Data, "config") } case "ai_framework_zerepy": { agent.AgentType = models.AgentInfoAgentTypeZerepy agent.ConfigData = helpers.GetStringValueFromMap(item.Data, "config") } } } case "token": { agent.TokenNetworkID = helpers.GetTokenIDFromMap(item.Data) if agent.TokenNetworkID > 0 { agent.TokenMode = string(models.CreateTokenModeTypeAutoCreate) } else { agent.TokenMode = string(models.CreateTokenModeTypeNoToken) } } case "mission_on_x": { frequency := helpers.GetFrequencyFromMap(item.Data) userPrompt := helpers.GetStringValueFromMap(item.Data, "details") agentModels := helpers.GetStringValueFromMap(item.Data, "modelName") switch item.Idx { case "mission_on_x_post": { listMission = append(listMission, &serializers.AgentSnapshotMissionInfo{ ToolSet: models.ToolsetTypePost, UserPrompt: userPrompt, Interval: frequency, AgentBaseModel: agentModels, }) } case "mission_on_x_post_news": { listMission = append(listMission, &serializers.AgentSnapshotMissionInfo{ ToolSet: models.ToolsetTypePostSearchV2, UserPrompt: userPrompt, Interval: frequency, AgentBaseModel: agentModels, }) } case "mission_on_x_reply": { listMission = append(listMission, &serializers.AgentSnapshotMissionInfo{ ToolSet: models.ToolsetTypeReplyMentions, UserPrompt: userPrompt, Interval: frequency, AgentBaseModel: agentModels, }) } case "mission_on_x_engage": { listMission = append(listMission, &serializers.AgentSnapshotMissionInfo{ ToolSet: models.ToolsetTypeReplyNonMentions, UserPrompt: userPrompt, Interval: frequency, AgentBaseModel: agentModels, }) } case "mission_on_x_follow": { listMission = append(listMission, &serializers.AgentSnapshotMissionInfo{ ToolSet: models.ToolsetTypeFollow, UserPrompt: userPrompt, Interval: frequency, AgentBaseModel: agentModels, }) } } } case "mission_on_farcaster": { frequency := helpers.GetFrequencyFromMap(item.Data) userPrompt := helpers.GetStringValueFromMap(item.Data, "details") agentModels := helpers.GetStringValueFromMap(item.Data, "modelName") switch item.Idx { case "mission_on_farcaster_post": { listMission = append(listMission, &serializers.AgentSnapshotMissionInfo{ ToolSet: models.ToolsetTypePostFarcaster, UserPrompt: userPrompt, Interval: frequency, AgentBaseModel: agentModels, }) } case "mission_on_farcaster_reply": { listMission = append(listMission, &serializers.AgentSnapshotMissionInfo{ ToolSet: models.ToolsetTypeReplyMentionsFarcaster, UserPrompt: userPrompt, Interval: frequency, AgentBaseModel: agentModels, }) } } } case "mission_on_defi": { frequency := helpers.GetFrequencyFromMap(item.Data) switch item.Idx { case "mission_on_defi_trade_analytics": { tokens := helpers.GetStringValueFromMap(item.Data, "token") toolList := s.conf.ToolLists.TradeAnalytic if tokens == "" { return nil, errs.NewError(errs.ErrBadRequest) } userPrompt := fmt.Sprintf(`Conduct a technical analysis of $%s price data. Based on your findings, provide a recommended buy price and sell price to maximize potential returns.`, tokens) toolList = strings.ReplaceAll(toolList, "{api_key}", s.conf.InternalApiKey) toolList = strings.ReplaceAll(toolList, "{token_symbol}", tokens) listMission = append(listMission, &serializers.AgentSnapshotMissionInfo{ ToolSet: models.ToolsetTypeTradeAnalyticsOnTwitter, Tokens: tokens, Interval: frequency, UserPrompt: userPrompt, ToolList: toolList, }) } } } default: { } } } if agent.NetworkID == 0 || agent.AgentBaseModel == "" { return nil, errs.NewError(errs.ErrBadRequest) } // gen token tokenInfo, _ := s.GenerateTokenInfoFromSystemPrompt(ctx, agent.AgentName, agent.SystemPrompt) if tokenInfo != nil && tokenInfo.TokenSymbol != "" { agent.TokenSymbol = tokenInfo.TokenSymbol agent.TokenName = agent.AgentName agent.TokenDesc = tokenInfo.TokenDesc agent.TokenImageUrl = tokenInfo.TokenImageUrl } // // generate address { ethAddress, err := s.CreateETHAddress(ctx) if err != nil { return nil, errs.NewError(err) } agent.ETHAddress = strings.ToLower(ethAddress) agent.TronAddress = trxapi.AddrEvmToTron(ethAddress) solAddress, err := s.CreateSOLAddress(ctx) if err != nil { return nil, errs.NewError(err) } agent.SOLAddress = solAddress addressBtc, err := s.CreateBTCAddress(ctx) if err != nil { return nil, errs.NewError(err) } agent.TipBtcAddress = addressBtc addressEth, err := s.CreateETHAddress(ctx) if err != nil { return nil, errs.NewError(err) } agent.TipEthAddress = addressEth addressSol, err := s.CreateSOLAddress(ctx) if err != nil { return nil, errs.NewError(err) } agent.TipSolAddress = addressSol } if err := s.dao.Create(daos.GetDBMainCtx(ctx), agent); err != nil { return nil, errs.NewError(err) } agentTokenInfo := &models.AgentTokenInfo{} agentTokenInfo.AgentInfoID = agent.ID agentTokenInfo.NetworkID = agent.TokenNetworkID agentTokenInfo.NetworkName = models.GetChainName(agent.TokenNetworkID) if err := s.dao.Create(daos.GetDBMainCtx(ctx), agentTokenInfo); err != nil { return nil, errs.NewError(err) } agent.TokenInfoID = agentTokenInfo.ID if err := s.dao.Save(daos.GetDBMainCtx(ctx), agent); err != nil { return nil, errs.NewError(err) } if len(listMission) > 0 { var err error agent, err = s.CreateUpdateAgentSnapshotMission(ctx, agent.AgentID, "", listMission) if err != nil { return nil, errs.NewError(errs.ErrBadRequest) } } listAgent = append(listAgent, agent) } } return listAgent, nil } func (s *Service) AgentUpdateAgentStudio(ctx context.Context, address, agentID, graphData string) (*models.AgentInfo, error) { var agent *models.AgentInfo listMission := []*serializers.AgentSnapshotMissionInfo{} err := daos.WithTransaction( daos.GetDBMainCtx(ctx), func(tx *gorm.DB) error { var err error agent, err = s.dao.FirstAgentInfo(tx, map[string][]interface{}{ "agent_id = ?": {agentID}, }, map[string][]interface{}{}, []string{}) if err != nil { return errs.NewError(err) } if agent != nil { if !strings.EqualFold(agent.Creator, address) { return errs.NewError(errs.ErrInvalidOwner) } agent, _ = s.dao.FirstAgentInfoByID(tx, agent.ID, map[string][]interface{}{}, true) var reqs *models.AgentStudioGraphData json.Unmarshal([]byte(graphData), &reqs) if reqs != nil && len(reqs.Data) <= 0 { return errs.NewError(errs.ErrBadRequest) } req := reqs.Data[0] if req.Idx == "agent_new" { for _, item := range req.Children { switch item.CategoryIdx { case "personality": { switch item.Idx { case "personality_customize": { agent.SystemPrompt = helpers.GetStringValueFromMap(item.Data, "personality") } case "personality_nft": { agent.SystemPrompt = helpers.GetStringValueFromMap(item.Data, "personality") } case "personality_ordinals": { agent.SystemPrompt = helpers.GetStringValueFromMap(item.Data, "personality") } case "personality_token": { agent.SystemPrompt = helpers.GetStringValueFromMap(item.Data, "personality") } case "personality_genomics": { agent.SystemPrompt = helpers.GetStringValueFromMap(item.Data, "personality") } case "personality_knowledge": { agent.SystemPrompt = helpers.GetStringValueFromMap(item.Data, "personality") } } } case "blockchain": { if !(agent.AgentContractID != "" || agent.AgentNftMinted == true) { chainName := helpers.GetStringValueFromMap(item.Data, "chainId") agent.NetworkID = models.GetChainID(chainName) agent.NetworkName = models.GetChainName(agent.NetworkID) } } case "decentralized_inference": { agent.AgentBaseModel = fmt.Sprintf("%v", item.Data["decentralizeId"]) } case "token": { if agent.TokenStatus == "" && agent.TokenAddress == "" { agent.TokenNetworkID = helpers.GetTokenIDFromMap(item.Data) if agent.TokenNetworkID > 0 { agent.TokenMode = string(models.CreateTokenModeTypeAutoCreate) } else { agent.TokenMode = string(models.CreateTokenModeTypeNoToken) } if agent.TokenMode == string(models.CreateTokenModeTypeAutoCreate) && (agent.AgentNftMinted || (agent.AgentType == models.AgentInfoAgentTypeKnowledgeBase && agent.Status == models.AssistantStatusReady)) { agent.TokenStatus = "pending" } } } case "ai_framework": { switch item.Idx { case "ai_framework_eternal_ai": { agent.AgentType = models.AgentInfoAgentTypeReasoning } case "ai_framework_eliza": { agent.AgentType = models.AgentInfoAgentTypeEliza agent.ConfigData = helpers.GetStringValueFromMap(item.Data, "config") } case "ai_framework_zerepy": { agent.AgentType = models.AgentInfoAgentTypeZerepy agent.ConfigData = helpers.GetStringValueFromMap(item.Data, "config") } } } case "mission_on_x": { frequency := helpers.GetFrequencyFromMap(item.Data) userPrompt := helpers.GetStringValueFromMap(item.Data, "details") agentModels := helpers.GetStringValueFromMap(item.Data, "modelName") switch item.Idx { case "mission_on_x_post": { listMission = append(listMission, &serializers.AgentSnapshotMissionInfo{ ToolSet: models.ToolsetTypePost, UserPrompt: userPrompt, Interval: frequency, AgentBaseModel: agentModels, }) } case "mission_on_x_post_news": { listMission = append(listMission, &serializers.AgentSnapshotMissionInfo{ ToolSet: models.ToolsetTypePostSearchV2, UserPrompt: userPrompt, Interval: frequency, AgentBaseModel: agentModels, }) } case "mission_on_x_reply": { listMission = append(listMission, &serializers.AgentSnapshotMissionInfo{ ToolSet: models.ToolsetTypeReplyMentions, UserPrompt: userPrompt, Interval: frequency, AgentBaseModel: agentModels, }) } case "mission_on_x_engage": { listMission = append(listMission, &serializers.AgentSnapshotMissionInfo{ ToolSet: models.ToolsetTypeReplyNonMentions, UserPrompt: userPrompt, Interval: frequency, AgentBaseModel: agentModels, }) } case "mission_on_x_follow": { listMission = append(listMission, &serializers.AgentSnapshotMissionInfo{ ToolSet: models.ToolsetTypeFollow, UserPrompt: userPrompt, Interval: frequency, AgentBaseModel: agentModels, }) } } } case "mission_on_farcaster": { frequency := helpers.GetFrequencyFromMap(item.Data) userPrompt := helpers.GetStringValueFromMap(item.Data, "details") agentModels := helpers.GetStringValueFromMap(item.Data, "modelName") switch item.Idx { case "mission_on_farcaster_post": { listMission = append(listMission, &serializers.AgentSnapshotMissionInfo{ ToolSet: models.ToolsetTypePostFarcaster, UserPrompt: userPrompt, Interval: frequency, AgentBaseModel: agentModels, }) } case "mission_on_farcaster_reply": { listMission = append(listMission, &serializers.AgentSnapshotMissionInfo{ ToolSet: models.ToolsetTypeReplyMentionsFarcaster, UserPrompt: userPrompt, Interval: frequency, AgentBaseModel: agentModels, }) } } } case "mission_on_defi": { frequency := helpers.GetFrequencyFromMap(item.Data) switch item.Idx { case "mission_on_defi_trade_analytics": { tokens := helpers.GetStringValueFromMap(item.Data, "token") toolList := s.conf.ToolLists.TradeAnalytic if tokens == "" { return errs.NewError(errs.ErrBadRequest) } userPrompt := fmt.Sprintf(`Conduct a technical analysis of $%s price data. Based on your findings, provide a recommended buy price and sell price to maximize potential returns.`, tokens) toolList = strings.ReplaceAll(toolList, "{api_key}", s.conf.InternalApiKey) toolList = strings.ReplaceAll(toolList, "{token_symbol}", tokens) listMission = append(listMission, &serializers.AgentSnapshotMissionInfo{ ToolSet: models.ToolsetTypeTradeAnalyticsOnTwitter, Tokens: tokens, Interval: frequency, UserPrompt: userPrompt, ToolList: toolList, }) } } } default: { } } } agent.GraphData = graphData err := s.dao.Save(tx, agent) if err != nil { return errs.NewError(err) } } } return nil }, ) if err != nil { return nil, errs.NewError(err) } if len(listMission) > 0 && agent != nil { var err error agent, err = s.CreateUpdateAgentSnapshotMission(ctx, agent.AgentID, "", listMission) if err != nil { return nil, errs.NewError(errs.ErrBadRequest) } } return agent, nil } func (s *Service) AgentCreateAgentAssistantForLocal(ctx context.Context, req *serializers.AssistantsReq) (*models.AgentInfo, error) { if !s.conf.ExistsedConfigKey(models.LOCAL_CHAIN_ID, "network_id") { return nil, errs.NewError(errs.ErrBadRequest) } if req.SystemContent == "" { req.SystemContent = "default" } agent := &models.AgentInfo{ Version: "2", AgentType: models.AgentInfoAgentTypeReasoning, AgentID: helpers.RandomBigInt(12).Text(16), Status: models.AssistantStatusReady, NetworkID: models.LOCAL_CHAIN_ID, NetworkName: models.GetChainName(req.ChainID), AgentName: req.AgentName, Creator: req.Creator, AgentContractAddress: req.AgentContractAddress, AgentContractID: req.AgentContractID, SystemPrompt: req.SystemContent, AgentBaseModel: req.AgentBaseModel, ScanEnabled: true, } if err := s.dao.Create(daos.GetDBMainCtx(ctx), agent); err != nil { return nil, errs.NewError(err) } return agent, nil } func (s *Service) GetAgentChainFees(ctx context.Context) (map[string]interface{}, error) { res, err := s.dao.FindAgentChainFee( daos.GetDBMainCtx(ctx), map[string][]interface{}{}, map[string][]interface{}{}, []string{"id desc"}, 0, 999999, ) if err != nil { return nil, errs.NewError(err) } chainFeeMap := map[string]interface{}{} for _, v := range res { chainFeeMap[strconv.Itoa(int(v.NetworkID))] = map[string]interface{}{ "network_id": v.NetworkID, "mint_fee": numeric.BigFloat2Text(&v.MintFee.Float), "post_fee": numeric.BigFloat2Text(&v.InferFee.Float), "token_fee": numeric.BigFloat2Text(&v.TokenFee.Float), "agent_deploy_fee": numeric.BigFloat2Text(&v.AgentDeployFee.Float), } } return chainFeeMap, nil } func (s *Service) MarkInstalledUtilityAgent(ctx context.Context, address string, req *serializers.AgentActionReq) ([]uint, error) { resp := []uint{} err := daos.WithTransaction( daos.GetDBMainCtx(ctx), func(tx *gorm.DB) error { if len(req.ContractAddress) > 0 { for _, contractAddress := range req.ContractAddress { agentInfo, err := s.dao.FirstAgentInfo( tx, map[string][]any{ "agent_contract_address = ?": []any{contractAddress}, }, map[string][]any{}, []string{"id desc"}, ) if err != nil { return errs.NewError(err) } if agentInfo == nil { return errs.NewError(errs.ErrAgentNotFound) } if req.Action == "uninstall" { err := tx.Where("agent_info_id = ? and address = ?", agentInfo.ID, strings.ToLower(address)). Unscoped(). Delete(&models.AgentUtilityInstall{}).Error if err != nil { return errs.NewError(err) } } else { inst := &models.AgentUtilityInstall{ Address: strings.ToLower(address), AgentInfoID: agentInfo.ID, } err = s.dao.Create(tx, inst) if err == nil { err = tx.Model(agentInfo).Update("installed_count", gorm.Expr("installed_count + 1")).Error if err != nil { return errs.NewError(err) } } } resp = append(resp, agentInfo.ID) } } else { if req.Action == "uninstall" { for _, agentID := range req.Ids { err := tx.Where("agent_info_id = ? and address = ?", agentID, strings.ToLower(address)). Unscoped(). Delete(&models.AgentUtilityInstall{}).Error if err != nil { return errs.NewError(err) } resp = append(resp, agentID) } } else { for _, agentID := range req.Ids { inst := &models.AgentUtilityInstall{ Address: strings.ToLower(address), AgentInfoID: agentID, } err := s.dao.Create(tx, inst) if err == nil { err = tx.Model(&models.AgentInfo{}).Where("id = ?", agentID).Update("installed_count", gorm.Expr("installed_count + 1")).Error if err != nil { return errs.NewError(err) } } resp = append(resp, agentID) } } } return nil }, ) if err != nil { return resp, errs.NewError(err) } return resp, nil } func (s *Service) MarkRecentChatUtilityAgent(ctx context.Context, address string, req *serializers.AgentActionReq) (bool, error) { err := daos.WithTransaction( daos.GetDBMainCtx(ctx), func(tx *gorm.DB) error { for _, agentID := range req.Ids { now := helpers.TimeNow() inst := &models.AgentUtilityRecentChat{ Address: strings.ToLower(address), AgentInfoID: agentID, } inst.UpdatedAt = *now err := s.dao.Save(tx, inst) if err != nil { _ = tx.Model(&models.AgentUtilityRecentChat{}).Where("address = ? and agent_info_id = ?", strings.ToLower(address), agentID).Update("updated_at", now).Error } } return nil }, ) if err != nil { return false, errs.NewError(err) } return true, nil } func (s *Service) MarkPromptCountUtilityAgent(ctx context.Context, address string, agentID uint) (bool, error) { err := daos.WithTransaction( daos.GetDBMainCtx(ctx), func(tx *gorm.DB) error { agentInfo, err := s.dao.FirstAgentInfoByID( tx, agentID, map[string][]any{}, true, ) if err != nil { return errs.NewError(err) } if agentInfo == nil { return errs.NewError(errs.ErrAgentNotFound) } if agentInfo.PromptCalls > 0 { err = tx.Model(agentInfo). UpdateColumn("prompt_calls", gorm.Expr("prompt_calls + 1")).Error } else { err = tx.Model(agentInfo). UpdateColumn("prompt_calls", 1).Error } if err != nil { return errs.NewError(errs.ErrBadRequest) } return nil }, ) if err != nil { return false, errs.NewError(err) } return true, nil } func (s *Service) LikeAgent(ctx context.Context, address string, agentID uint) (bool, error) { err := daos.WithTransaction( daos.GetDBMainCtx(ctx), func(tx *gorm.DB) error { agentReactionHistory, err := s.dao.FirstAgentReactionHistory( tx, map[string][]any{ "agent_info_id = ?": []any{agentID}, "user_address = ?": []any{strings.ToLower(address)}, }, map[string][]any{}, []string{"id desc"}, ) if err != nil { return errs.NewError(err) } agentInfo, err := s.dao.FirstAgentInfoByID( tx, agentID, map[string][]any{}, false, ) if err != nil { return errs.NewError(err) } if agentInfo == nil { return errs.NewError(errs.ErrAgentNotFound) } if agentReactionHistory == nil { agentReactionHistory = &models.AgentReactionHistory{ AgentInfoID: agentID, UserAddress: strings.ToLower(address), Reaction: "like", } err = s.dao.Create(tx, agentReactionHistory) if err != nil { return errs.NewError(err) } err = tx.Model(agentInfo).Update("likes", gorm.Expr("likes + 1")).Error if err != nil { return errs.NewError(err) } } else { //unlike err = tx.Unscoped().Delete(agentReactionHistory).Error if err != nil { return errs.NewError(err) } err = tx.Model(agentInfo).Update("likes", gorm.Expr("likes - 1")).Error if err != nil { return errs.NewError(err) } } return nil }, ) if err != nil { return false, errs.NewError(err) } return true, nil } func (s *Service) CheckAgentLiked(ctx context.Context, address string, agentID uint) (bool, error) { agentReactionHistory, err := s.dao.FirstAgentReactionHistory( daos.GetDBMainCtx(ctx), map[string][]any{ "agent_info_id = ?": []any{agentID}, "user_address = ?": []any{strings.ToLower(address)}, }, map[string][]any{}, []string{"id desc"}, ) if err != nil { return false, errs.NewError(err) } return agentReactionHistory != nil, nil } func (s *Service) PublicAgent(ctx context.Context, address string, agentID uint) (bool, error) { err := daos.WithTransaction( daos.GetDBMainCtx(ctx), func(tx *gorm.DB) error { agentInfo, err := s.dao.FirstAgentInfoByID( tx, agentID, map[string][]any{}, false, ) if err != nil { return errs.NewError(err) } if agentInfo == nil { return errs.NewError(errs.ErrAgentNotFound) } if strings.ToLower(address) != agentInfo.Creator { return errs.NewError(errs.ErrUnAuthorization) } err = tx.Model(agentInfo).Update("is_public", !agentInfo.IsPublic).Error if err != nil { return errs.NewError(err) } return nil }, ) if err != nil { return false, errs.NewError(err) } return true, nil } func (s *Service) AgentComment(ctx context.Context, address string, agentID uint, req *serializers.AgentCommentReq) (*models.AgentUserComment, error) { var agentUserComment *models.AgentUserComment err := daos.WithTransaction( daos.GetDBMainCtx(ctx), func(tx *gorm.DB) error { agentInfo, err := s.dao.FirstAgentInfoByID( tx, agentID, map[string][]any{}, true, ) if err != nil { return errs.NewError(err) } if agentInfo == nil { return errs.NewError(errs.ErrAgentNotFound) } agentUserComment = &models.AgentUserComment{ AgentInfoID: agentID, UserAddress: strings.ToLower(address), Comment: req.Comment, Rating: req.Rating, } err = s.dao.Create(tx, agentUserComment) if err != nil { return errs.NewError(err) } switch req.Rating { case 1: err = tx.Model(agentInfo).UpdateColumn("num_of_one_star", gorm.Expr("num_of_one_star + 1")). UpdateColumn("num_of_rating", gorm.Expr("num_of_rating + 1")).Error case 2: err = tx.Model(agentInfo).UpdateColumn("num_of_two_star", gorm.Expr("num_of_two_star + 1")). UpdateColumn("num_of_rating", gorm.Expr("num_of_rating + 1")).Error case 3: err = tx.Model(agentInfo).UpdateColumn("num_of_three_star", gorm.Expr("num_of_three_star + 1")). UpdateColumn("num_of_rating", gorm.Expr("num_of_rating + 1")).Error case 4: err = tx.Model(agentInfo).UpdateColumn("num_of_four_star", gorm.Expr("num_of_four_star + 1")). UpdateColumn("num_of_rating", gorm.Expr("num_of_rating + 1")).Error case 5: err = tx.Model(agentInfo).UpdateColumn("num_of_five_star", gorm.Expr("num_of_five_star + 1")). UpdateColumn("num_of_rating", gorm.Expr("num_of_rating + 1")).Error } if err != nil { return errs.NewError(err) } agentInfo.Rating = (agentInfo.Rating*float64(agentInfo.NumOfRating) + req.Rating) / float64(agentInfo.NumOfRating+1) err = tx.Model(agentInfo).Update("rating", agentInfo.Rating).Error if err != nil { return errs.NewError(err) } return nil }, ) if err != nil { return nil, errs.NewError(err) } return agentUserComment, nil } func (s *Service) GetListAgentComment(ctx context.Context, agentID uint, page, limit int) ([]*models.AgentUserComment, error) { agentUserComments, err := s.dao.AgentUserComment4Page( daos.GetDBMainCtx(ctx), map[string][]any{"agent_info_id = ?": {agentID}}, map[string][]any{}, []string{"created_at desc"}, page, limit, ) if err != nil { return nil, errs.NewError(err) } return agentUserComments, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/agent_mints.go ================================================ package services import ( "context" "encoding/json" "fmt" "math/big" "net/http" "strconv" "strings" "time" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/daos" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/helpers" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/serializers" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/binds/systempromptmanager" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/lighthouse" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/types/numeric" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/common" "github.com/google/uuid" "github.com/jinzhu/gorm" ) func (s *Service) JobAgentMintNft(ctx context.Context) error { err := s.JobRunCheck( ctx, "JobAgentMintNft", func() error { var retErr error { agents, err := s.dao.FindAgentInfoJoin( daos.GetDBMainCtx(ctx), map[string][]any{ "join agent_chain_fees on agent_chain_fees.network_id = agent_infos.network_id": {}, }, map[string][]any{ "agent_infos.agent_type in (?)": { []models.AgentInfoAgentType{ models.AgentInfoAgentTypeNormal, models.AgentInfoAgentTypeReasoning, models.AgentInfoAgentTypeEliza, models.AgentInfoAgentTypeZerepy, }, }, "agent_infos.agent_id != ''": {}, "agent_infos.agent_contract_id = ?": {""}, "agent_infos.agent_nft_minted = ?": {false}, `agent_infos.twin_twitter_usernames is null or agent_infos.twin_twitter_usernames = '' or (agent_infos.twin_twitter_usernames != '' and agent_infos.twin_status = ?) `: {models.TwinStatusDoneSuccess}, "agent_infos.scan_enabled = ?": {true}, "agent_infos.system_prompt != ''": {}, "agent_infos.eai_balance > 0": {}, `(agent_infos.ref_tweet_id > 0 or (agent_infos.eai_balance >= (agent_chain_fees.mint_fee + 9.9 * agent_chain_fees.infer_fee)) or (agent_infos.agent_type in (3,4) and agent_infos.eai_balance >= agent_chain_fees.mint_fee) )`: {}, "agent_infos.network_id in (?)": { []uint64{ models.SHARDAI_CHAIN_ID, models.ETHEREUM_CHAIN_ID, models.BITTENSOR_CHAIN_ID, models.SOLANA_CHAIN_ID, models.BASE_CHAIN_ID, models.HERMES_CHAIN_ID, models.ARBITRUM_CHAIN_ID, models.ZKSYNC_CHAIN_ID, models.POLYGON_CHAIN_ID, models.BSC_CHAIN_ID, models.APE_CHAIN_ID, models.AVALANCHE_C_CHAIN_ID, models.ABSTRACT_TESTNET_CHAIN_ID, models.DUCK_CHAIN_ID, models.TRON_CHAIN_ID, models.MODE_CHAIN_ID, models.ZETA_CHAIN_ID, models.STORY_CHAIN_ID, models.HYPE_CHAIN_ID, models.MONAD_TESTNET_CHAIN_ID, models.MEGAETH_TESTNET_CHAIN_ID, models.CELO_CHAIN_ID, models.BASE_SEPOLIA_CHAIN_ID, }, }, }, map[string][]any{}, []string{ "updated_at asc", }, 0, 10, ) if err != nil { return errs.NewError(err) } for _, agent := range agents { err = s.AgentMintNft(ctx, agent.ID) if err != nil { retErr = errs.MergeError(retErr, errs.NewError(err)) } err = s.AgentCreateMissionDefault(ctx, agent.ID) if err != nil { retErr = errs.MergeError(retErr, errs.NewError(err)) } time.Sleep(10 * time.Second) } } { agents, err := s.dao.FindAgentInfoJoin( daos.GetDBMainCtx(ctx), map[string][]any{ "join agent_chain_fees on agent_chain_fees.network_id = agent_infos.network_id": {}, }, map[string][]any{ "agent_infos.agent_contract_id = ?": {""}, "agent_infos.agent_nft_minted = ?": {false}, "agent_infos.eai_balance > 0": {}, `(1 != 1 or (agent_infos.agent_type in (?) and agent_infos.eai_balance >= agent_chain_fees.agent_deploy_fee) )`: { []models.AgentInfoAgentType{ models.AgentInfoAgentTypeModel, models.AgentInfoAgentTypeModelOnline, models.AgentInfoAgentTypeJs, models.AgentInfoAgentTypePython, models.AgentInfoAgentTypeInfa, models.AgentInfoAgentTypeCustomUi, models.AgentInfoAgentTypeCustomPrompt, }, }, "agent_infos.network_id in (?)": { []uint64{ models.SHARDAI_CHAIN_ID, models.ETHEREUM_CHAIN_ID, models.BITTENSOR_CHAIN_ID, models.BASE_CHAIN_ID, models.HERMES_CHAIN_ID, models.ARBITRUM_CHAIN_ID, models.ZKSYNC_CHAIN_ID, models.POLYGON_CHAIN_ID, models.BSC_CHAIN_ID, models.APE_CHAIN_ID, models.AVALANCHE_C_CHAIN_ID, models.ABSTRACT_TESTNET_CHAIN_ID, models.DUCK_CHAIN_ID, models.TRON_CHAIN_ID, models.MODE_CHAIN_ID, models.ZETA_CHAIN_ID, models.STORY_CHAIN_ID, models.HYPE_CHAIN_ID, models.MONAD_TESTNET_CHAIN_ID, models.MEGAETH_TESTNET_CHAIN_ID, models.CELO_CHAIN_ID, models.BASE_SEPOLIA_CHAIN_ID, }, }, }, map[string][]any{}, []string{ "updated_at asc", }, 0, 10, ) if err != nil { return errs.NewError(err) } for _, agent := range agents { err = s.AgentMintNft(ctx, agent.ID) if err != nil { retErr = errs.MergeError(retErr, errs.NewError(err)) } time.Sleep(10 * time.Second) } } return retErr }, ) if err != nil { return errs.NewError(err) } return nil } func (s *Service) AgentMintNft(ctx context.Context, agentInfoID uint) error { err := s.JobRunCheck( ctx, fmt.Sprintf("AgentMintNft_%d", agentInfoID), func() error { agent, err := s.dao.FirstAgentInfoByID( daos.GetDBMainCtx(ctx), agentInfoID, map[string][]any{}, false, ) if err != nil { return errs.NewError(err) } if agent.AgentContractID == "" && !agent.AgentNftMinted { var isOk bool mintFee := numeric.NewFloatFromString("0.0") checkFee := numeric.NewFloatFromString("0.0") if agent.RefTweetID <= 0 { agentChainFee, err := s.GetAgentChainFee( daos.GetDBMainCtx(ctx), agent.NetworkID, ) if err != nil { return errs.NewError(err) } switch agent.AgentType { case models.AgentInfoAgentTypeNormal, models.AgentInfoAgentTypeReasoning: { mintFee = &agentChainFee.MintFee.Float checkFee = models.AddBigFloats(&agentChainFee.MintFee.Float, models.MulBigFloats(&agentChainFee.InferFee.Float, big.NewFloat(9.9))) } case models.AgentInfoAgentTypeEliza, models.AgentInfoAgentTypeZerepy: { mintFee = &agentChainFee.MintFee.Float checkFee = &agentChainFee.MintFee.Float } case models.AgentInfoAgentTypeModel, models.AgentInfoAgentTypeModelOnline, models.AgentInfoAgentTypeJs, models.AgentInfoAgentTypePython, models.AgentInfoAgentTypeInfa, models.AgentInfoAgentTypeCustomUi, models.AgentInfoAgentTypeCustomPrompt: { mintFee = &agentChainFee.AgentDeployFee.Float checkFee = &agentChainFee.AgentDeployFee.Float } default: { return errs.NewError(errs.ErrBadRequest) } } } if agent.EaiBalance.Float.Cmp(checkFee) >= 0 { isOk = true } if isOk { updateAgentFields := map[string]any{ "agent_nft_minted": true, } if agent.TokenMode == string(models.TokenSetupEnumAutoCreate) && agent.TokenAddress == "" && agent.TokenStatus == "" { updateAgentFields["token_status"] = "pending" } err = daos.GetDBMainCtx(ctx). Model(agent). Updates(updateAgentFields). Error if err != nil { return errs.NewError(err) } switch agent.AgentType { case models.AgentInfoAgentTypeNormal, models.AgentInfoAgentTypeReasoning, models.AgentInfoAgentTypeKnowledgeBase, models.AgentInfoAgentTypeEliza, models.AgentInfoAgentTypeZerepy: { for range 5 { err = s.MintAgent(ctx, agent.ID) if err == nil { break } } } case models.AgentInfoAgentTypeModel, models.AgentInfoAgentTypeModelOnline, models.AgentInfoAgentTypeJs, models.AgentInfoAgentTypePython, models.AgentInfoAgentTypeInfa, models.AgentInfoAgentTypeCustomUi, models.AgentInfoAgentTypeCustomPrompt: { for range 2 { err = s.DeployAgentUpgradeable(ctx, agent.ID) if err == nil { break } } } default: { err = errs.NewError(errs.ErrBadRequest) } } if err != nil { _ = daos.GetDBMainCtx(ctx). Model(agent). Updates( map[string]any{ "scan_error": "mint nft error " + err.Error(), }, ). Error return errs.NewError(err) } else { if mintFee.Cmp(big.NewFloat(0)) > 0 { err = daos.WithTransaction( daos.GetDBMainCtx(ctx), func(tx *gorm.DB) error { err = s.dao.Create( tx, &models.AgentEaiTopup{ NetworkID: agent.NetworkID, EventId: fmt.Sprintf("agent_mint_fee_%d", agent.ID), AgentInfoID: agent.ID, Type: models.AgentEaiTopupTypeSpent, Amount: numeric.NewBigFloatFromFloat(mintFee), Status: models.AgentEaiTopupStatusDone, DepositAddress: agent.ETHAddress, ToAddress: agent.ETHAddress, Toolset: "mint_fee", }, ) if err != nil { return errs.NewError(err) } err = tx. Model(agent). Updates( map[string]any{ "eai_balance": gorm.Expr("eai_balance - ?", numeric.NewBigFloatFromFloat(mintFee)), "mint_fee": numeric.NewBigFloatFromFloat(mintFee), }, ). Error if err != nil { return errs.NewError(err) } return nil }, ) if err != nil { return errs.NewError(err) } } } } } return nil }, ) if err != nil { return errs.NewError(err) } return nil } func (s *Service) JobRetryAgentMintNft(ctx context.Context) error { err := s.JobRunCheck( ctx, "JobRetryAgentMintNft", func() error { agents, err := s.dao.FindAgentInfo( daos.GetDBMainCtx(ctx), map[string][]any{ "agent_type in (?)": { []models.AgentInfoAgentType{ models.AgentInfoAgentTypeNormal, models.AgentInfoAgentTypeReasoning, models.AgentInfoAgentTypeEliza, models.AgentInfoAgentTypeZerepy, }, }, "updated_at <= ?": {time.Now().Add(-60 * time.Minute)}, "agent_contract_id = ?": {""}, "agent_nft_minted = ?": {true}, "mint_hash != ?": {""}, "network_id in (?)": { []uint64{ models.BASE_CHAIN_ID, models.HERMES_CHAIN_ID, models.ARBITRUM_CHAIN_ID, models.ZKSYNC_CHAIN_ID, models.POLYGON_CHAIN_ID, models.BSC_CHAIN_ID, models.APE_CHAIN_ID, models.AVALANCHE_C_CHAIN_ID, models.ABSTRACT_TESTNET_CHAIN_ID, models.DUCK_CHAIN_ID, models.MODE_CHAIN_ID, models.ZETA_CHAIN_ID, models.STORY_CHAIN_ID, models.HYPE_CHAIN_ID, models.MONAD_TESTNET_CHAIN_ID, models.CELO_CHAIN_ID, }, }, }, map[string][]any{}, []string{ "rand()", }, 0, 1000, ) if err != nil { return errs.NewError(err) } var retErr error for _, agent := range agents { err = s.GetEVMClient(ctx, agent.NetworkID).TransactionConfirmed(agent.MintHash) if err != nil { fmt.Println(err.Error()) if strings.Contains(err.Error(), "not found") || strings.Contains(err.Error(), "transaction is not Successful") { err = daos.GetDBMainCtx(ctx). Model(agent). Updates( map[string]any{ "mint_hash": "", }, ). Error if err != nil { return errs.NewError(err) } for i := 0; i < 5; i++ { err = s.MintAgent(ctx, agent.ID) if err == nil { break } } } } else { s.MemeEventsByTransaction(ctx, agent.NetworkID, agent.MintHash) } } return retErr }, ) if err != nil { return errs.NewError(err) } return nil } func (s *Service) JobRetryAgentMintNftError(ctx context.Context) error { err := s.JobRunCheck( ctx, "JobRetryAgentMintNftError", func() error { agents, err := s.dao.FindAgentInfo( daos.GetDBMainCtx(ctx), map[string][]any{ "agent_infos.agent_type in (?)": { []models.AgentInfoAgentType{ models.AgentInfoAgentTypeNormal, models.AgentInfoAgentTypeReasoning, models.AgentInfoAgentTypeEliza, models.AgentInfoAgentTypeZerepy, }, }, "updated_at <= ?": {time.Now().Add(-60 * time.Minute)}, "agent_contract_id = ?": {""}, "agent_nft_minted = ?": {true}, "mint_hash is null or mint_hash = ?": {""}, "scan_error != ?": {""}, "network_id in (?)": { []uint64{ models.BASE_CHAIN_ID, models.HERMES_CHAIN_ID, models.ARBITRUM_CHAIN_ID, models.ZKSYNC_CHAIN_ID, models.POLYGON_CHAIN_ID, models.BSC_CHAIN_ID, models.APE_CHAIN_ID, models.AVALANCHE_C_CHAIN_ID, models.ABSTRACT_TESTNET_CHAIN_ID, models.DUCK_CHAIN_ID, models.TRON_CHAIN_ID, models.MODE_CHAIN_ID, models.ZETA_CHAIN_ID, models.STORY_CHAIN_ID, models.HYPE_CHAIN_ID, models.MONAD_TESTNET_CHAIN_ID, models.MEGAETH_TESTNET_CHAIN_ID, models.CELO_CHAIN_ID, models.BASE_SEPOLIA_CHAIN_ID, }, }, }, map[string][]any{}, []string{ "rand()", }, 0, 1000, ) if err != nil { return errs.NewError(err) } var retErr error for _, agent := range agents { if strings.Contains(agent.ScanError, "mint nft error") { err = daos.GetDBMainCtx(ctx). Model(agent). Updates( map[string]any{ "agent_nft_minted": false, "scan_error": "", }, ). Error if err != nil { return errs.NewError(err) } } } return retErr }, ) if err != nil { return errs.NewError(err) } return nil } func (s *Service) MintAgent(ctx context.Context, agentInfoID uint) error { agentInfo, err := s.dao.FirstAgentInfoByID( daos.GetDBMainCtx(ctx), agentInfoID, map[string][]any{}, false, ) if err != nil { return errs.NewError(err) } if agentInfo != nil { if agentInfo.MintHash == "" { switch agentInfo.NetworkID { case models.LOCAL_CHAIN_ID: { agentUriData := models.AgentUriData{ Name: agentInfo.AgentName, } agentUriBytes, err := json.Marshal(agentUriData) if err != nil { return errs.NewError(err) } uriHash := string(agentUriBytes) systemContentHash := agentInfo.SystemPrompt modelID, err := s.GetEthereumClient(ctx, agentInfo.NetworkID).GPUManagerGetModelID( s.conf.GetConfigKeyString(agentInfo.NetworkID, "gpu_manager_contract_address"), ) if err != nil { return errs.NewError(err) } agentContractAddress := s.conf.GetConfigKeyString(agentInfo.NetworkID, "dagent721_contract_address") txHash, err := s.GetEthereumClient(ctx, agentInfo.NetworkID).Dagent721Mint( agentContractAddress, s.GetAddressPrk( helpers.RandomInStrings( strings.Split(s.conf.GetConfigKeyString(agentInfo.NetworkID, "agent_admin_address"), ","), ), ), helpers.HexToAddress(agentInfo.Creator), uriHash, []byte(systemContentHash), models.ConvertBigFloatToWei(&agentInfo.InferFee.Float, 18), "ai721", helpers.HexToAddress(s.conf.GetConfigKeyString(agentInfo.NetworkID, "prompt_scheduler_contract_address")), modelID, ) if err != nil { return errs.NewError(err) } err = daos.GetDBMainCtx(ctx). Model(agentInfo). Updates( map[string]any{ "agent_contract_address": agentContractAddress, "mint_hash": txHash, "status": models.AssistantStatusMinting, "reply_enabled": true, }, ).Error if err != nil { return errs.NewError(err) } } case models.SHARDAI_CHAIN_ID, models.HERMES_CHAIN_ID, models.BASE_CHAIN_ID, models.ETHEREUM_CHAIN_ID, models.ARBITRUM_CHAIN_ID, models.BSC_CHAIN_ID, models.POLYGON_CHAIN_ID, models.ZKSYNC_CHAIN_ID, models.APE_CHAIN_ID, models.AVALANCHE_C_CHAIN_ID, models.ABSTRACT_TESTNET_CHAIN_ID, models.BITTENSOR_CHAIN_ID, models.DUCK_CHAIN_ID, models.MODE_CHAIN_ID, models.ZETA_CHAIN_ID, models.STORY_CHAIN_ID, models.HYPE_CHAIN_ID, models.MONAD_TESTNET_CHAIN_ID, models.MEGAETH_TESTNET_CHAIN_ID, models.CELO_CHAIN_ID, models.BASE_SEPOLIA_CHAIN_ID: { agentUriData := models.AgentUriData{ Name: agentInfo.AgentName, } agentUriBytes, err := json.Marshal(agentUriData) if err != nil { return errs.NewError(err) } uriHash, err := s.IpfsUploadDataForName(ctx, fmt.Sprintf("%v_%v", agentInfo.AgentID, "uri"), agentUriBytes) if err != nil { return errs.NewError(err) } systemContentHash, err := s.IpfsUploadDataForName(ctx, fmt.Sprintf("%v_%v", agentInfo.AgentID, "system_content"), []byte(agentInfo.SystemPrompt)) if err != nil { return errs.NewError(err) } agentContractAddress := s.conf.GetConfigKeyString(agentInfo.NetworkID, "agent_contract_address") txHash, err := s.GetEVMClient(ctx, agentInfo.NetworkID).SystemPromptManagerMint( agentContractAddress, s.GetAddressPrk( helpers.RandomInStrings( strings.Split(s.conf.GetConfigKeyString(agentInfo.NetworkID, "agent_admin_address"), ","), ), ), helpers.HexToAddress(agentInfo.Creator), "ipfs://"+uriHash, []byte("ipfs://"+systemContentHash), models.ConvertBigFloatToWei(&agentInfo.InferFee.Float, 18), ) if err != nil { return errs.NewError(err) } err = daos.GetDBMainCtx(ctx). Model(agentInfo). Updates( map[string]any{ "agent_contract_address": agentContractAddress, "mint_hash": txHash, "status": models.AssistantStatusMinting, "reply_enabled": true, }, ).Error if err != nil { return errs.NewError(err) } } case models.SOLANA_CHAIN_ID: { err = daos.GetDBMainCtx(ctx). Model(agentInfo). Updates( map[string]any{ "agent_contract_address": s.conf.GetConfigKeyString(agentInfo.NetworkID, "agent_contract_address"), "agent_contract_id": strconv.FormatUint(uint64(agentInfo.ID), 10), "status": models.AssistantStatusReady, "reply_enabled": true, }, ).Error if err != nil { return errs.NewError(err) } } case models.TRON_CHAIN_ID: { agentUriData := models.AgentUriData{ Name: agentInfo.AgentName, } agentUriBytes, err := json.Marshal(agentUriData) if err != nil { return errs.NewError(err) } uriHash, err := s.IpfsUploadDataForName(ctx, fmt.Sprintf("%v_%v", agentInfo.AgentID, "uri"), agentUriBytes) if err != nil { return errs.NewError(err) } systemContentHash, err := s.IpfsUploadDataForName(ctx, fmt.Sprintf("%v_%v", agentInfo.AgentID, "system_content"), []byte(agentInfo.SystemPrompt)) if err != nil { return errs.NewError(err) } txHash, err := s.trxApi.SystemPromptManagerMint( s.conf.GetConfigKeyString(agentInfo.NetworkID, "agent_contract_address"), s.GetAddressPrk( helpers.RandomInStrings( strings.Split(s.conf.GetConfigKeyString(agentInfo.NetworkID, "agent_admin_address"), ","), ), ), helpers.HexToAddress(agentInfo.Creator), "ipfs://"+uriHash, []byte("ipfs://"+systemContentHash), models.ConvertBigFloatToWei(&agentInfo.InferFee.Float, 18), ) if err != nil { return errs.NewError(err) } err = daos.GetDBMainCtx(ctx). Model(agentInfo). Updates( map[string]any{ "agent_contract_address": s.conf.GetConfigKeyString(agentInfo.NetworkID, "agent_contract_address"), "mint_hash": txHash, "status": models.AssistantStatusMinting, "reply_enabled": true, }, ).Error if err != nil { return errs.NewError(err) } } default: { return errs.NewError(errs.ErrBadRequest) } } } } return nil } func (s *Service) SystemPromptManagerNewTokenEvent(ctx context.Context, networkID uint64, event *systempromptmanager.SystemPromptManagerNewToken) error { agentInfo, err := s.dao.FirstAgentInfo( daos.GetDBMainCtx(ctx), map[string][]any{ "network_id = ?": {networkID}, "mint_hash = ?": {event.Raw.TxHash.Hex()}, }, map[string][]any{}, []string{}, ) if err != nil { return errs.NewError(err) } if agentInfo != nil { var info models.AgentUriData var systemPrompt []byte switch agentInfo.NetworkID { case models.LOCAL_CHAIN_ID: { data := []byte(event.Uri) systemPrompt = event.SysPrompt err = json.Unmarshal(data, &info) if err != nil { return errs.NewError(err) } } default: { data, _, err := lighthouse.DownloadDataSimple(event.Uri) if err != nil { dataInfo := map[string]any{} err = json.Unmarshal([]byte(event.Uri), &dataInfo) if err != nil { return errs.NewError(err) } uri := dataInfo["agent_uri"].(string) data, _, err = lighthouse.DownloadDataSimple(uri) if err != nil { return errs.NewError(err) } } systemPrompt, _, err = lighthouse.DownloadDataSimple(string(event.SysPrompt)) if err != nil { return errs.NewError(err) } err = json.Unmarshal(data, &info) if err != nil { return errs.NewError(err) } } } err = daos.GetDBMainCtx(ctx). Model(agentInfo). Updates( map[string]any{ "agent_name": info.Name, "creator": strings.ToLower(event.Minter.Hex()), "agent_contract_id": event.TokenId.String(), "status": models.AssistantStatusReady, "system_prompt": string(systemPrompt), "reply_enabled": true, }, ).Error if err != nil { return errs.NewError(err) } } return nil } func (s *Service) SystemPromptManagerAgentDataUpdateEvent(ctx context.Context, networkID uint64, event *systempromptmanager.SystemPromptManagerAgentDataUpdate) error { contractAgentID := event.AgentId.String() lightHouseHash := string(event.NewSysPrompt) systemPromptBytes, _, err := lighthouse.DownloadDataSimple(lightHouseHash) if err != nil { if !strings.HasPrefix(lightHouseHash, "ipfs://") { systemPromptBytes = event.NewSysPrompt } else { return errs.NewError(err) } } err = daos.GetDBMainCtx(ctx). Model(&models.AgentInfo{}). Where("network_id = ?", networkID). Where("agent_contract_address = ?", s.GetEVMClient(ctx, networkID).ConvertAddressForOut(strings.ToLower(event.Raw.Address.Hex()))). Where("agent_contract_id = ?", contractAgentID). Updates( map[string]any{ "system_prompt": string(systemPromptBytes), }, ).Error if err != nil { return errs.NewError(err) } return nil } func (s *Service) SystemPromptManagerAgentURIUpdateEvent(ctx context.Context, networkID uint64, event *systempromptmanager.SystemPromptManagerAgentURIUpdate) error { contractAgentID := event.AgentId.String() uri := event.Uri dataBytes, _, err := lighthouse.DownloadDataSimple(uri) if err != nil { return err } agentUriData := models.AgentUriData{} err = json.Unmarshal(dataBytes, &agentUriData) if err != nil { return err } err = daos.GetDBMainCtx(ctx). Model(&models.AgentInfo{}). Where("network_id = ?", networkID). Where("agent_contract_address = ?", s.GetEVMClient(ctx, networkID).ConvertAddressForOut(strings.ToLower(event.Raw.Address.Hex()))). Where("agent_contract_id = ?", contractAgentID). Updates( map[string]any{ "agent_name": agentUriData.Name, "uri": uri, }, ).Error if err != nil { return errs.NewError(err) } return nil } func (s *Service) ExecuteUpdateAgentInfoInContract(ctx context.Context, assistant *models.AgentInfo, request *serializers.UpdateAgentAssistantInContractRequest) (*serializers.UpdateAgentAssistantInContractResponse, error) { var txUpdateNameHash, txUpdateSystemPromptHash string switch assistant.NetworkID { case models.BASE_CHAIN_ID, models.ETHEREUM_CHAIN_ID, models.ARBITRUM_CHAIN_ID, models.BSC_CHAIN_ID, models.POLYGON_CHAIN_ID, models.ZKSYNC_CHAIN_ID: { ethClient := s.GetEVMClient(ctx, assistant.NetworkID) instanceABI, err := abi.JSON(strings.NewReader(systempromptmanager.SystemPromptManagerMetaData.ABI)) if err != nil { return nil, errs.NewError(err) } agentId, ok := new(big.Int).SetString(assistant.AgentContractID, 10) if !ok { return nil, errs.NewError(fmt.Errorf("error while getting agent id :%v", assistant.AgentContractID)) } { randomNonceName, ok := new(big.Int).SetString(request.RandomNonceName, 10) if !ok { return nil, fmt.Errorf("error while getting random nonce name:%v", request.RandomNonceName) } input, err := instanceABI.Pack("updateAgentUriWithSignature", agentId, request.HashName, randomNonceName, common.Hex2Bytes(request.SignatureName[2:])) if err != nil { return nil, errs.NewError(err) } txUpdateNameHash, err = ethClient.Transact( assistant.AgentContractAddress, s.GetAddressPrk( helpers.RandomInStrings( strings.Split(s.conf.GetConfigKeyString(assistant.NetworkID, "agent_admin_address"), ","), ), ), input, common.Big0, ) if err != nil { return nil, errs.NewError(err) } } { randomNonceSystemPrompt, ok := new(big.Int).SetString(request.RandomNonceSystemPrompt, 10) if !ok { return nil, fmt.Errorf("error while getting random nonce system prompt :%v", request.RandomNonceSystemPrompt) } input, err := instanceABI.Pack("updateAgentDataWithSignature", agentId, []byte(request.HashSystemPrompt), big.NewInt(0), randomNonceSystemPrompt, common.Hex2Bytes(request.SignatureSystemPrompt[2:])) if err != nil { return nil, errs.NewError(err) } txUpdateSystemPromptHash, err = ethClient.Transact( assistant.AgentContractAddress, s.GetAddressPrk( helpers.RandomInStrings( strings.Split(s.conf.GetConfigKeyString(assistant.NetworkID, "agent_admin_address"), ","), ), ), input, common.Big0, ) if err != nil { return nil, errs.NewError(err) } } } default: { txUpdateNameHash = uuid.NewString() txUpdateSystemPromptHash = uuid.NewString() } } return &serializers.UpdateAgentAssistantInContractResponse{ TxUpdateSystemPrompt: txUpdateSystemPromptHash, TxUpdateName: txUpdateNameHash, }, nil } func (s *Service) JobAgentStart(ctx context.Context) error { err := s.JobRunCheck( ctx, "JobAgentStart", func() error { agents, err := s.dao.FindAgentInfo( daos.GetDBMainCtx(ctx), map[string][]any{ "agent_infos.agent_type in (3,4)": {}, "agent_infos.agent_contract_id != ''": {}, "agent_infos.deployed_ref_id = ''": {}, "agent_infos.network_id in (?)": { []uint64{ models.SHARDAI_CHAIN_ID, models.ETHEREUM_CHAIN_ID, models.BITTENSOR_CHAIN_ID, models.SOLANA_CHAIN_ID, models.BASE_CHAIN_ID, models.HERMES_CHAIN_ID, models.ARBITRUM_CHAIN_ID, models.ZKSYNC_CHAIN_ID, models.POLYGON_CHAIN_ID, models.BSC_CHAIN_ID, models.APE_CHAIN_ID, models.AVALANCHE_C_CHAIN_ID, models.ABSTRACT_TESTNET_CHAIN_ID, models.DUCK_CHAIN_ID, models.TRON_CHAIN_ID, models.MODE_CHAIN_ID, models.ZETA_CHAIN_ID, models.STORY_CHAIN_ID, models.HYPE_CHAIN_ID, models.MONAD_TESTNET_CHAIN_ID, models.CELO_CHAIN_ID, }, }, }, map[string][]any{}, []string{ "rand()", }, 0, 5, ) if err != nil { return errs.NewError(err) } var retErr error for _, agent := range agents { err = func() error { startReq := map[string]any{} err = json.Unmarshal([]byte(agent.ConfigData), &startReq) if err != nil { return errs.NewError(err) } startReq["agentName"] = agent.AgentName startReq["model"] = agent.AgentBaseModel startReq["chainID"] = fmt.Sprintf("%d", agent.NetworkID) startReq["agentContractAddress"] = agent.AgentContractAddress startReq["agentID"] = agent.AgentContractID err = helpers.CurlURL( s.conf.AgentDeployer.Url+"/api/agent/start", http.MethodPost, map[string]string{}, startReq, nil, ) if err != nil { return errs.NewError(err) } err = daos.GetDBMainCtx(ctx).Model(agent).Updates( map[string]any{ "deployed_ref_id": helpers.RandomBigInt(12).Text(16), }, ).Error if err != nil { return errs.NewError(err) } return nil }() if err != nil { retErr = errs.MergeError(retErr, errs.NewError(err)) } } return retErr }, ) if err != nil { return errs.NewError(err) } return nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/agent_nfts.go ================================================ package services import ( "context" "errors" "fmt" "strconv" "strings" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/hiro" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/magiceden" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/moralis" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/opensea" ) func (s *Service) OpenseaCollections(ctx context.Context, f opensea.OpenSeaFilterCollections) (*opensea.CollectionsResp, error) { if f.Inscription != nil { if *f.Inscription { return s.GetInscriptonCollections(ctx, f) } } c, err := s.openseaService.OpenseaGetCollections(ctx, f) if err != nil { return nil, err } return c, nil } func (s *Service) GetInscriptonCollections(ctx context.Context, f opensea.OpenSeaFilterCollections) (*opensea.CollectionsResp, error) { result := &opensea.CollectionsResp{} collections := []opensea.SingleCollectionResp{} a := magiceden.NewMagicedenService() resp1, err := a.GetInscriptionHardCode() if err != nil { return nil, err } limit := 100 if f.Limit != 0 { limit = f.Limit } resp := resp1[0:limit] for _, item := range resp { c := []opensea.ContractResp{ { Address: item.CollectionSymbol, // or provide the actual address Chain: "ordinal", // specify the chain if needed }, } collection := opensea.SingleCollectionResp{ Collection: item.CollectionSymbol, Name: item.Name, ImageUrl: item.Image, Contracts: c, Description: item.Description, } collections = append(collections, collection) } result.Collections = collections return result, nil } func (s *Service) GetInscriptonInfo(ctx context.Context, address string, f opensea.OpenSeaFilterCollections) (*moralis.NFTCollectionMetadata, error) { var data *opensea.SingleCollectionResp collections, err := s.GetInscriptonCollections(ctx, opensea.OpenSeaFilterCollections{}) if err != nil { return nil, err } for _, coll := range collections.Collections { if coll.Collection == address { data = &coll } } if data == nil { return nil, errors.New("invalid collection") } else { result := &moralis.NFTCollectionMetadata{ TokenAddress: data.Collection, Name: data.Name, Symbol: data.Collection, ContractType: "ordinal_nft", Tokens: []moralis.MoralisToken{}, } return result, nil } } func (s *Service) GetInscriptonInfoByTokenID(ctx context.Context, address, tokenId string, f opensea.OpenSeaFilterCollections) ([]moralis.MoralisToken, error) { if !strings.Contains(tokenId, "i0") { return nil, errors.New("invalid inscription id") } var data *opensea.SingleCollectionResp collections, err := s.GetInscriptonCollections(ctx, opensea.OpenSeaFilterCollections{}) if err != nil { return nil, err } for _, coll := range collections.Collections { if coll.Collection == address { data = &coll } } if data == nil { return nil, errors.New("invalid collection") } magic := magiceden.NewMagicedenService() inscriptionInfo, err := magic.GetInscriptionInfo(tokenId) if err == nil { if inscriptionInfo.Collection.Symbol != data.Collection { return nil, errors.New("invalid collection") } } serviceHiro := hiro.NewHiroService(s.conf.HiroUrl) info, err := serviceHiro.GetInscriptionInfo(tokenId) if err != nil { return nil, err } item := moralis.MoralisToken{ TokenAddress: data.Collection, TokenID: info.Id, Name: info.Metadata.Name, Owner: info.Address, Symbol: data.Collection, MetadataString: nil, Metadata: &moralis.MoralisTokenMetadata{ Image: fmt.Sprintf("https://ord-mirror.magiceden.dev/content/%s", info.Id), Name: info.Metadata.Name, Description: data.Description, ExternalLink: "", AnimationUrl: "", Attributes: []moralis.Trait{}, }, } if info.MimeType == "text/html" { item.Metadata.AnimationUrl = item.Metadata.Image item.Metadata.Image = "" } if item.Metadata.Description == "" { collectionInfo, err := magic.GetCollectionInfo(data.Collection) if err == nil { item.Metadata.Description = collectionInfo.Description } } if len(info.Metadata.Attributes) > 0 { for _, a := range info.Metadata.Attributes { trait := moralis.Trait{ TraitType: a.TraitType, Value: a.Value, DisplayType: nil, MaxValue: nil, TraitCount: 0, Order: nil, RarityLabel: "", Count: 0, Percentage: 0, } item.Metadata.Attributes = append(item.Metadata.Attributes, trait) } } result := []moralis.MoralisToken{item} return result, nil } func (s *Service) GetNftCollectionMetadataByContract(ctx context.Context, address, cursor, pageSize string, f moralis.MoralisFilter) (*moralis.NFTCollectionMetadata, error) { dfChain := moralis.MORALIS_ETH harcodeCollection := s.openseaService.FindHardCodeCollectionByAddress(address) if harcodeCollection != nil { dfChain = harcodeCollection.Chain } moralisService := moralis.NewMoralisNfts(dfChain, s.conf.MoralisApiKey) collectionMetadata, err := moralisService.GetNftCollectionMetadataByContract(address, moralis.MoralisFilter{}) if err != nil { return nil, err } limit := 10 if pageSize != "" { limit, err = strconv.Atoi(pageSize) if err != nil { return nil, err } } normalizeMetadata := true filter := moralis.MoralisFilter{ Limit: &limit, NormalizeMetadata: &normalizeMetadata, } if cursor != "" { filter.Cursor = &cursor } collectionInfo, err := moralisService.GetNftByContract(address, filter) if err != nil { return nil, err } collectionMetadata.Tokens = collectionInfo.Result collectionMetadata.PageSize = collectionInfo.PageSize collectionMetadata.Page = collectionInfo.Page collectionMetadata.Cursor = collectionInfo.Cursor return collectionMetadata, nil } func (s *Service) GetNftCollectionMetadataByTokenID(ctx context.Context, address, tokenID string, f moralis.MoralisFilter) ([]moralis.MoralisToken, error) { dfChain := moralis.MORALIS_ETH harcodeCollection := s.openseaService.FindHardCodeCollectionByAddress(address) if harcodeCollection != nil { dfChain = harcodeCollection.Chain } moralisService := moralis.NewMoralisNfts(dfChain, s.conf.MoralisApiKey) chain := dfChain normalizeMetadata := true collectionMetadata, err := moralisService.GetMultipleNfts(moralis.MoralisGetMultipleNftsFilter{ Chain: &chain, ReqBody: moralis.MoralisGetMultipleNftsReqBody{ Tokens: []moralis.NftFilter{ {TokenAddress: address, TokenId: tokenID}, }, NormalizeMetadata: &normalizeMetadata, }, }) if err != nil { return nil, err } return collectionMetadata, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/agent_report.go ================================================ package services import ( "context" "fmt" "math/big" "strings" "time" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/daos" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/types/numeric" "github.com/mymmrac/telego" ) func (s *Service) JobAgentTeleAlertTopupNotAction(ctx context.Context) error { err := s.JobRunCheck( ctx, "JobAgentTeleAlertTopupNotAction", func() error { var retErr error { topups, err := s.dao.FindAgentEaiTopup( daos.GetDBMainCtx(ctx), map[string][]interface{}{ "agent_eai_topups.created_at >= adddate(now(), interval -4 hour)": {}, "agent_eai_topups.created_at < adddate(now(), interval -2 hour)": {}, `not exists( select 1 from agent_snapshot_post_actions where agent_snapshot_post_actions.agent_info_id = agent_eai_topups.agent_info_id and agent_snapshot_post_actions.status = 'done' )`: {}, }, map[string][]interface{}{}, []string{}, 0, 999999, ) if err != nil { return errs.NewError(err) } for _, topup := range topups { err = s.AgentTeleAlertTopupNotActionByID(ctx, topup.AgentInfoID) if err != nil { retErr = errs.MergeError(retErr, errs.NewError(err)) } } } { agents, err := s.dao.FindAgentInfoJoin( daos.GetDBMainCtx(ctx), map[string][]interface{}{ "join twitter_infos on twitter_infos.id = agent_infos.twitter_info_id": {}, }, map[string][]interface{}{ "agent_infos.eai_balance >= agent_infos.agent_fee": {}, "twitter_infos.created_at >= adddate(now(), interval -4 hour)": {}, "twitter_infos.created_at < adddate(now(), interval -2 hour)": {}, `not exists( select 1 from agent_snapshot_post_actions where agent_snapshot_post_actions.agent_info_id = agent_infos.id and agent_snapshot_post_actions.status = 'done' )`: {}, }, map[string][]interface{}{}, []string{}, 0, 999999, ) if err != nil { return errs.NewError(err) } for _, agent := range agents { err = s.AgentTeleAlertTopupNotActionByID(ctx, agent.ID) if err != nil { retErr = errs.MergeError(retErr, errs.NewError(err)) } } } { twitterInfos, err := s.dao.FindTwitterInfo( daos.GetDBMainCtx(ctx), map[string][]interface{}{ "created_at >= adddate(now(), interval -3 hour)": {}, `created_at < adddate(now(), interval -1 hour) or exists( select 1 from agent_infos where agent_infos.twitter_info_id = twitter_infos.id and agent_infos.token_address != '' and agent_infos.token_supply != '' )`: {}, }, map[string][]interface{}{}, []string{}, 0, 999999, ) if err != nil { return errs.NewError(err) } for _, twitterInfo := range twitterInfos { err = s.AgentTeleAlertNewAgentTrakerByID(ctx, twitterInfo.ID) if err != nil { retErr = errs.MergeError(retErr, errs.NewError(err)) } } } return retErr }, ) if err != nil { return errs.NewError(err) } return nil } func (s *Service) AgentTeleAlertTopupNotActionByID(ctx context.Context, agentInfoID uint) error { err := s.JobRunCheck( ctx, fmt.Sprintf("AgentTeleAlertTopupNotActionByID_%d", agentInfoID), func() error { var rs bool err := s.RedisCached( fmt.Sprintf("AgentTeleAlertTopupNotActionByID_%d", agentInfoID), true, 6*time.Hour, &rs, func() (interface{}, error) { err := func() error { agent, err := s.dao.FirstAgentInfoByID( daos.GetDBMainCtx(ctx), agentInfoID, map[string][]interface{}{}, false, ) if err != nil { return errs.NewError(err) } if agent != nil { bot, err := telego.NewBot(s.conf.Telebot.Alert.Botkey, telego.WithDefaultDebugLogger()) if err != nil { return errs.NewError(err) } post, err := s.dao.FirstAgentSnapshotPost( daos.GetDBMainCtx(ctx), map[string][]interface{}{ "agent_info_id = ?": {agent.ID}, }, map[string][]interface{}{}, []string{}, ) if err != nil { return errs.NewError(err) } balanceStr := fmt.Sprintf( `account balance is %s EAI`, numeric.BigFloat2Text(&agent.EaiBalance.Float), ) triggerResult := "trigger interval is not running" if post != nil { triggerResult = "trigger interval is running" } action, err := s.dao.FirstAgentSnapshotPostAction( daos.GetDBMainCtx(ctx), map[string][]interface{}{ "agent_info_id = ?": {agent.ID}, }, map[string][]interface{}{}, []string{}, ) if err != nil { return errs.NewError(err) } actionResult := "trigger result is not received" if action != nil { actionResult = "trigger result is received" } if post == nil || action == nil { title := "💀💀💀 Not Action Alert! 💀💀💀" msg := fmt.Sprintf( `%s (@%s - %s - %s) deposited money but haven't seen any action yet (note: %s, %s, %s)`, agent.AgentName, agent.TwitterUsername, agent.NetworkName, agent.AgentContractID, balanceStr, triggerResult, actionResult, ) _, err = bot.SendMessage( &telego.SendMessageParams{ ChatID: telego.ChatID{ ID: s.conf.Telebot.Alert.ChatID, }, MessageThreadID: s.conf.Telebot.Alert.MessageThreadID, Text: strings.TrimSpace( fmt.Sprintf( ` %s %s Hey, @zoro_521, let's check about this! `, title, msg, ), ), }, ) if err != nil { return errs.NewError(err) } } } return nil }() if err != nil { return false, errs.NewError(err) } return true, nil }, ) if err != nil { return errs.NewError(err) } return nil }, ) if err != nil { return errs.NewError(err) } return nil } func (s *Service) AgentTeleAlertNewAgentTrakerByID(ctx context.Context, twitterInfoID uint) error { err := s.JobRunCheck( ctx, fmt.Sprintf("AgentTeleAlertNewAgentTrakerByID_%d", twitterInfoID), func() error { var rs bool err := s.RedisCached( fmt.Sprintf("AgentTeleAlertNewAgentTrakerByID_%d", twitterInfoID), true, 6*time.Hour, &rs, func() (interface{}, error) { err := func() error { twitterInfo, err := s.dao.FirstTwitterInfoByID( daos.GetDBMainCtx(ctx), twitterInfoID, map[string][]interface{}{}, false, ) if err != nil { return errs.NewError(err) } if twitterInfo != nil { agent, err := s.dao.FirstAgentInfo( daos.GetDBMainCtx(ctx), map[string][]interface{}{ "twitter_info_id = ?": {twitterInfo.ID}, }, map[string][]interface{}{}, []string{}, ) if err != nil { return errs.NewError(err) } if agent != nil { fwId := agent.AgentID if agent.TokenAddress != "" && agent.TokenSymbol != "" { fwId = agent.TokenAddress } bot, err := telego.NewBot(s.conf.Telebot.Tracker.Botkey, telego.WithDefaultDebugLogger()) if err != nil { return errs.NewError(err) } _, err = bot.SendMessage( &telego.SendMessageParams{ ChatID: telego.ChatID{ ID: s.conf.Telebot.Tracker.ChatID, }, MessageThreadID: s.conf.Telebot.Tracker.MessageThreadID, Text: strings.TrimSpace( fmt.Sprintf( ` Welcome %s to the world! X: https://twitter.com/%s Network: %s https://eternalai.org/agent/%s `, twitterInfo.TwitterName, twitterInfo.TwitterUsername, agent.NetworkName, fwId, ), ), }, ) if err != nil { return errs.NewError(err) } } else { return errs.NewError(errs.ErrBadRequest) } } return nil }() if err != nil { return false, errs.NewError(err) } return true, nil }, ) if err != nil { return errs.NewError(err) } return nil }, ) if err != nil { return errs.NewError(err) } return nil } func (s *Service) AgentTeleAlertByID(ctx context.Context, agentInfoID uint, refID string, amount *big.Float, networkID uint64) error { err := s.JobRunCheck( ctx, fmt.Sprintf("AgentTeleAlertByID_%d_%s", agentInfoID, refID), func() error { var rs bool err := s.RedisCached( fmt.Sprintf("AgentTeleAlertByID_%d_%s", agentInfoID, refID), true, 1*time.Hour, &rs, func() (interface{}, error) { err := func() error { agent, err := s.dao.FirstAgentInfoByID( daos.GetDBMainCtx(ctx), agentInfoID, map[string][]interface{}{ "TwitterInfo": {}, }, false, ) if err != nil { return errs.NewError(err) } if agent.TwitterInfo != nil { bot, err := telego.NewBot(s.conf.Telebot.Alert.Botkey, telego.WithDefaultDebugLogger()) if err != nil { return errs.NewError(err) } title := "💰💰💰 New Topped Up Alert! 💰💰💰" msg := fmt.Sprintf("just topped up %s EAI tokens on %s! 👀", numeric.BigFloat2Text(amount), models.GetChainName(networkID)) if numeric.BigFloat2Text(amount) == "0" { title = "📝📝📝 New Agent Alert! 📝📝📝" msg = fmt.Sprintf("just registered on %s! 👀", agent.NetworkName) } _, err = bot.SendMessage( &telego.SendMessageParams{ ChatID: telego.ChatID{ ID: s.conf.Telebot.Alert.ChatID, }, Text: strings.TrimSpace( fmt.Sprintf( ` %s %s (@%s) %s Hey, @JohnEnt, let's do something about this! `, title, agent.TwitterInfo.TwitterName, agent.TwitterInfo.TwitterUsername, msg, ), ), }, ) if err != nil { return errs.NewError(err) } } return nil }() if err != nil { return false, errs.NewError(err) } return true, nil }, ) if err != nil { return errs.NewError(err) } return nil }, ) if err != nil { return errs.NewError(err) } return nil } func (s *Service) AgentTeleAlertNewTokenByID(ctx context.Context, agentInfoID uint) error { err := s.JobRunCheck( ctx, fmt.Sprintf("AgentTeleAlertNewTokenByID_%d", agentInfoID), func() error { var rs bool err := s.RedisCached( fmt.Sprintf("AgentTeleAlertNewTokenByID_%d", agentInfoID), true, 1*time.Hour, &rs, func() (interface{}, error) { err := func() error { agent, err := s.dao.FirstAgentInfoByID( daos.GetDBMainCtx(ctx), agentInfoID, map[string][]interface{}{ "TwitterInfo": {}, }, false, ) if err != nil { return errs.NewError(err) } if agent.TwitterInfo != nil && agent.TokenSymbol != "" && agent.TokenAddress != "" && agent.TokenAddress != "pending" { bot, err := telego.NewBot(s.conf.Telebot.Alert.Botkey, telego.WithDefaultDebugLogger()) if err != nil { return errs.NewError(err) } title := "🟡🟡🟡 New Pumpfun Token Alert! 🟡🟡🟡" msg := fmt.Sprintf(`just created token %s https://pump.fun/coin/%s 👀`, agent.TokenSymbol, agent.TokenAddress) _, err = bot.SendMessage( &telego.SendMessageParams{ ChatID: telego.ChatID{ ID: s.conf.Telebot.Alert.ChatID, }, Text: strings.TrimSpace( fmt.Sprintf( ` %s %s (@%s) %s Hey, @JohnEnt, let's do something about this! `, title, agent.TwitterInfo.TwitterName, agent.TwitterInfo.TwitterUsername, msg, ), ), }, ) if err != nil { return errs.NewError(err) } } return nil }() if err != nil { return false, errs.NewError(err) } return true, nil }, ) if err != nil { return errs.NewError(err) } return nil }, ) if err != nil { return errs.NewError(err) } return nil } func (s *Service) AgentDailyReport(ctx context.Context) error { err := s.JobRunCheck( ctx, "AgentDailyReport", func() error { var rs bool err := s.RedisCached( "AgentDailyReport", true, 1*time.Hour, &rs, func() (interface{}, error) { err := func() error { msg, err := s.dao.AgentInfoGetReportDaily(daos.GetDBMainCtx(ctx)) if err != nil { return errs.NewError(err) } msg = fmt.Sprintf("🚨 Report!\n\n%s\n\nHey, @tygenz", msg) bot, err := telego.NewBot(s.conf.Telebot.Alert.Botkey, telego.WithDefaultDebugLogger()) if err != nil { return errs.NewError(err) } _, err = bot.SendMessage( &telego.SendMessageParams{ ChatID: telego.ChatID{ ID: s.conf.Telebot.Alert.ChatID, }, Text: msg, }, ) if err != nil { return errs.NewError(err) } return nil }() if err != nil { return false, errs.NewError(err) } return true, nil }, ) if err != nil { return errs.NewError(err) } return nil }, ) if err != nil { return errs.NewError(err) } return nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/agent_srv.go ================================================ package services import ( "context" "database/sql" "encoding/json" "errors" "fmt" "math/big" "net/http" "strconv" "strings" sync "sync" "time" "github.com/gin-gonic/gin" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/daos" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/helpers" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/logger" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/serializers" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/openai" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/twitter" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/types/numeric" "github.com/jinzhu/gorm" openai2 "github.com/sashabaranov/go-openai" "go.uber.org/zap" ) func (s *Service) UpdateAgentScanEventSuccess(ctx context.Context, agentInfoID uint, lastTimeEvent *time.Time, lastId string) error { if lastTimeEvent == nil { lastTimeEvent = helpers.TimeNow() } err := daos.GetDBMainCtx(ctx). Model(&models.AgentInfo{}). Where( "id = ?", agentInfoID, ). Updates( map[string]interface{}{ "scan_latest_time": lastTimeEvent, "scan_latest_id": lastId, "scan_error": "OK", }, ).Error if err != nil { return errs.NewError(err) } return nil } func (s *Service) UpdateAgentScanEventError(ctx context.Context, agentInfoID uint, errData error) error { if strings.Contains(errData.Error(), "not found") { return nil } err := daos.GetDBMainCtx(ctx). Model(&models.AgentInfo{}). Where( "id = ?", agentInfoID, ). Updates( map[string]interface{}{ "scan_error": errData.Error(), }, ).Error if err != nil { return errs.NewError(err) } return nil } func (s *Service) GenerateTipAddress(ctx context.Context, agentInfoID uint) error { agent, err := s.dao.FirstAgentInfoByID( daos.GetDBMainCtx(ctx), agentInfoID, map[string][]interface{}{}, false, ) if err != nil { return errs.NewError(err) } if agent.TipBtcAddress == "" { address, err := s.CreateBTCAddress(ctx) if err != nil { return errs.NewError(err) } err = daos.GetDBMainCtx(ctx).Model(agent).UpdateColumn("tip_btc_address", address).Error if err != nil { return errs.NewError(err) } } if agent.TipEthAddress == "" { address, err := s.CreateETHAddress(ctx) if err != nil { return errs.NewError(err) } err = daos.GetDBMainCtx(ctx).Model(agent).UpdateColumn("tip_eth_address", address).Error if err != nil { return errs.NewError(err) } } if agent.TipSolAddress == "" { address, err := s.CreateSOLAddress(ctx) if err != nil { return errs.NewError(err) } err = daos.GetDBMainCtx(ctx).Model(agent).UpdateColumn("tip_sol_address", address).Error if err != nil { return errs.NewError(err) } } return nil } func (s *Service) TwitterOauthCallbackV1(ctx context.Context, callbackUrl, address, code, agentID, clientID string) (map[string]string, error) { var err error var resp map[string]string if agentID == "" { err = s.TwitterOauthCallbackForRelink(ctx, callbackUrl, address, code, clientID) return resp, err } else if agentID == "0" { err = s.TwitterOauthCallbackForApiSubscription(ctx, callbackUrl, address, code, clientID) return resp, err } else if agentID == "1" { err = s.TwitterOauthCallbackForCreateAgent(ctx, callbackUrl, address, code, clientID) return resp, err } else if agentID == "2" { resp, err = s.TwitterOauthCallbackForClaimVideoReward(ctx, callbackUrl, address, code, clientID) return resp, err } agentInfo, err := s.SyncAgentInfoDetailByAgentID(ctx, agentID) if err != nil { return nil, errs.NewError(err) } if agentInfo != nil { isFirstLinked := false // isAdvance := false oauthClientId := "" oauthClientSecret := "" if strings.EqualFold(clientID, s.conf.Twitter.OauthClientId) { oauthClientId = s.conf.Twitter.OauthClientId oauthClientSecret = s.conf.Twitter.OauthClientSecret } else { // isAdvance = true oauthClientId = agentInfo.OauthClientId oauthClientSecret = agentInfo.OauthClientSecret } respOauth, err := s.twitterAPI.GetTwitterOAuthTokenWithKey( oauthClientId, oauthClientSecret, code, callbackUrl, address, agentID) if err != nil { return nil, errs.NewError(err) } if respOauth != nil && respOauth.AccessToken != "" { twitterUser, err := s.twitterAPI.GetTwitterMe(respOauth.AccessToken) if err != nil { return nil, errs.NewError(err) } user, err := s.GetUser(daos.GetDBMainCtx(ctx), agentInfo.NetworkID, address, true) if err != nil { return nil, errs.NewError(err) } user.TwitterID = twitterUser.ID user.TwitterAvatar = twitterUser.ProfileImageURL user.TwitterName = twitterUser.Name user.TwitterUsername = twitterUser.UserName err = s.dao.Save(daos.GetDBMainCtx(ctx), user) if err != nil { return nil, errs.NewError(err) } // twitterInfo, err := s.dao.FirstTwitterInfo(daos.GetDBMainCtx(ctx), map[string][]interface{}{ "twitter_id = ?": {twitterUser.ID}, }, map[string][]interface{}{}, false, ) if err != nil { return nil, errs.NewError(err) } if twitterInfo == nil { twitterInfo = &models.TwitterInfo{ TwitterID: twitterUser.ID, } isFirstLinked = true } twitterInfo.TwitterAvatar = twitterUser.ProfileImageURL twitterInfo.TwitterName = twitterUser.Name twitterInfo.TwitterUsername = twitterUser.UserName twitterInfo.AccessToken = respOauth.AccessToken twitterInfo.RefreshToken = respOauth.RefreshToken twitterInfo.ExpiresIn = respOauth.ExpiresIn twitterInfo.Scope = respOauth.Scope twitterInfo.TokenType = respOauth.TokenType twitterInfo.OauthClientId = oauthClientId twitterInfo.OauthClientSecret = oauthClientSecret twitterInfo.Description = twitterUser.Description twitterInfo.RefreshError = "OK" expiredAt := time.Now().Add(time.Second * time.Duration(respOauth.ExpiresIn-(60*20))) twitterInfo.ExpiredAt = &expiredAt err = s.dao.Save(daos.GetDBMainCtx(ctx), twitterInfo) if err != nil { return nil, errs.NewError(err) } // updateFields := map[string]interface{}{ "twitter_info_id": twitterInfo.ID, "twitter_id": twitterInfo.TwitterID, "twitter_username": twitterInfo.TwitterUsername, "scan_enabled": true, "reply_enabled": true, } err = daos.GetDBMainCtx(ctx).Model(agentInfo).Updates( updateFields, ).Error if err != nil { return nil, errs.NewError(err) } if isFirstLinked { // off default follow // go s.FollowListDefaultTwitters(ctx, agentInfo.ID) go s.AgentCreateMissionDefault(context.Background(), agentInfo.ID) } } } return nil, nil } func (s *Service) AgentCreateMissionDefault(ctx context.Context, agentInfoID uint) error { agentInfo, err := s.dao.FirstAgentInfoByID( daos.GetDBMainCtx(ctx), agentInfoID, map[string][]interface{}{}, false, ) if err != nil { return errs.NewError(err) } switch agentInfo.AgentType { case models.AgentInfoAgentTypeNormal, models.AgentInfoAgentTypeReasoning, models.AgentInfoAgentTypeKnowledgeBase: { } default: { return nil } } switch agentInfo.NetworkID { case models.SHARDAI_CHAIN_ID: { _ = daos.GetDBMainCtx(ctx).Exec( ` INSERT INTO agent_snapshot_missions (created_at, updated_at, deleted_at, network_id, agent_info_id, user_prompt, interval_sec, reply_enabled, enabled, tool_set) select now(), now(), null, agent_infos.network_id, agent_infos.id, 'Check and follow Twitter accounts that look interesting to you.', 7200, 1, 1, 'follow' from agent_infos where not exists( select 1 from agent_snapshot_missions where agent_snapshot_missions.agent_info_id = agent_infos.id and agent_snapshot_missions.tool_set = 'follow' ) and agent_infos.id = ? `, agentInfo.ID, ).Error } case models.LOCAL_CHAIN_ID: { } default: { _ = daos.GetDBMainCtx(ctx).Exec( ` INSERT INTO agent_snapshot_missions (created_at, updated_at, deleted_at, network_id, agent_info_id, user_prompt, interval_sec, reply_enabled, enabled, tool_set) select now(), now(), null, agent_infos.network_id, agent_infos.id, 'Provide a single message to join the following conversation. Keep it concise (under 128 chars), NO hashtags, links or emojis, and don''t include any instructions or extra words, just the raw message ready to post.', 7200, 1, 1, 'reply_mentions' from agent_infos where not exists( select 1 from agent_snapshot_missions where agent_snapshot_missions.agent_info_id = agent_infos.id and agent_snapshot_missions.tool_set = 'reply_mentions' ) and agent_infos.id = ? union select now(), now(), null, agent_infos.network_id, agent_infos.id, 'Browse Twitter and choose ONE post and reply it. Keep the reply concise (under 128 chars), NO hashtags, links or emojis, and don''t include any instructions or extra words, just the raw reply ready to post. IMPORTANT: Immediately stop after replying one post. DO NOT REPLY YOUR OWN TWEET.', 7200, 1, 1, 'reply_non_mentions' from agent_infos where not exists( select 1 from agent_snapshot_missions where agent_snapshot_missions.agent_info_id = agent_infos.id and agent_snapshot_missions.tool_set = 'reply_non_mentions' ) and agent_infos.id = ? union select now(), now(), null, agent_infos.network_id, agent_infos.id, 'Check and follow Twitter accounts that look interesting to you.', 7200, 1, 1, 'follow' from agent_infos where not exists( select 1 from agent_snapshot_missions where agent_snapshot_missions.agent_info_id = agent_infos.id and agent_snapshot_missions.tool_set = 'follow' ) and agent_infos.id = ? union select now(), now(), null, agent_infos.network_id, agent_infos.id, 'Choose ONE topic that you like or dislike, and tweet about it with your own perspective.', 7200, 1, 1, 'post_search' from agent_infos where not exists( select 1 from agent_snapshot_missions where agent_snapshot_missions.agent_info_id = agent_infos.id and agent_snapshot_missions.tool_set = 'post_search' ) and agent_infos.id = ?; `, agentInfo.ID, agentInfo.ID, agentInfo.ID, agentInfo.ID, ).Error } } return nil } func (s *Service) TwitterOauthCallbackForInternalData(ctx context.Context, callbackUrl, code string) error { respOauth, err := s.twitterAPI.TwitterOauthCallbackForInternalData( s.conf.Twitter.OauthClientIdForTwitterData, s.conf.Twitter.OauthClientSecretForTwitterData, code, callbackUrl) if err != nil { return errs.NewError(err) } if respOauth != nil && respOauth.AccessToken != "" { twitterUser, err := s.twitterAPI.GetTwitterMe(respOauth.AccessToken) if err != nil { return errs.NewError(err) } twitterInfo, err := s.dao.FirstTwitterInfo(daos.GetDBMainCtx(ctx), map[string][]interface{}{ "twitter_id = ?": {twitterUser.ID}, }, map[string][]interface{}{}, false, ) if err != nil { return errs.NewError(err) } if twitterInfo == nil { twitterInfo = &models.TwitterInfo{ TwitterID: twitterUser.ID, } } twitterInfo.TwitterAvatar = twitterUser.ProfileImageURL twitterInfo.TwitterName = twitterUser.Name twitterInfo.TwitterUsername = twitterUser.UserName twitterInfo.AccessToken = respOauth.AccessToken twitterInfo.RefreshToken = respOauth.RefreshToken twitterInfo.ExpiresIn = respOauth.ExpiresIn twitterInfo.Scope = respOauth.Scope twitterInfo.TokenType = respOauth.TokenType twitterInfo.OauthClientId = s.conf.Twitter.OauthClientIdForTwitterData twitterInfo.OauthClientSecret = s.conf.Twitter.OauthClientSecretForTwitterData twitterInfo.Description = twitterUser.Description twitterInfo.RefreshError = "OK" expiredAt := time.Now().Add(time.Second * time.Duration(respOauth.ExpiresIn-(60*20))) twitterInfo.ExpiredAt = &expiredAt err = s.dao.Save(daos.GetDBMainCtx(ctx), twitterInfo) if err != nil { return errs.NewError(err) } } return nil } func (s *Service) TwitterOauthCallbackForRelink(ctx context.Context, callbackUrl, address, code, clientID string) error { oauthClientId := s.conf.Twitter.OauthClientId oauthClientSecret := s.conf.Twitter.OauthClientSecret respOauth, err := s.twitterAPI.GetTwitterOAuthTokenWithKeyForRelink( oauthClientId, oauthClientSecret, code, callbackUrl, address) if err != nil { return errs.NewError(err) } if respOauth != nil && respOauth.AccessToken != "" { twitterUser, err := s.twitterAPI.GetTwitterMe(respOauth.AccessToken) if err != nil { return errs.NewError(err) } if twitterUser != nil { twitterInfo, err := s.dao.FirstTwitterInfo(daos.GetDBMainCtx(ctx), map[string][]interface{}{ "twitter_id = ?": {twitterUser.ID}, }, map[string][]interface{}{}, false, ) if err != nil { return errs.NewError(err) } if twitterInfo == nil { twitterInfo = &models.TwitterInfo{ TwitterID: twitterUser.ID, } } twitterInfo.TwitterAvatar = twitterUser.ProfileImageURL twitterInfo.TwitterName = twitterUser.Name twitterInfo.TwitterUsername = twitterUser.UserName twitterInfo.AccessToken = respOauth.AccessToken twitterInfo.RefreshToken = respOauth.RefreshToken twitterInfo.ExpiresIn = respOauth.ExpiresIn twitterInfo.Scope = respOauth.Scope twitterInfo.TokenType = respOauth.TokenType twitterInfo.OauthClientId = oauthClientId twitterInfo.OauthClientSecret = oauthClientSecret twitterInfo.Description = twitterUser.Description twitterInfo.RefreshError = "OK" expiredAt := time.Now().Add(time.Second * time.Duration(respOauth.ExpiresIn-(60*20))) twitterInfo.ExpiredAt = &expiredAt err = s.dao.Save(daos.GetDBMainCtx(ctx), twitterInfo) if err != nil { return errs.NewError(err) } agentInfos, err := s.dao.FindAgentInfo(daos.GetDBMainCtx(ctx), map[string][]interface{}{ `twitter_id = ?`: {twitterUser.ID}, }, map[string][]interface{}{}, []string{}, 0, 100, ) if err != nil { return errs.NewError(err) } if agentInfos != nil { for _, agentInfo := range agentInfos { updateFields := map[string]interface{}{ "twitter_info_id": twitterInfo.ID, "twitter_id": twitterInfo.TwitterID, "twitter_username": twitterInfo.TwitterUsername, "scan_enabled": true, } err := daos.GetDBMainCtx(ctx).Model(agentInfo).Updates( updateFields, ).Error if err != nil { return errs.NewError(err) } } } } } return nil } func (s *Service) TwitterOauthCallbackForCreateAgent(ctx context.Context, callbackUrl, address, code, clientID string) error { oauthClientId := s.conf.Twitter.OauthClientId oauthClientSecret := s.conf.Twitter.OauthClientSecret respOauth, err := s.twitterAPI.GetTwitterOAuthTokenWithKeyForCreateAgent( oauthClientId, oauthClientSecret, code, callbackUrl, address) if err != nil { return errs.NewError(err) } if respOauth != nil && respOauth.AccessToken != "" { twitterUser, err := s.twitterAPI.GetTwitterMe(respOauth.AccessToken) if err != nil { return errs.NewError(err) } if twitterUser != nil { twitterInfo, err := s.dao.FirstTwitterInfo(daos.GetDBMainCtx(ctx), map[string][]interface{}{ "twitter_id = ?": {twitterUser.ID}, }, map[string][]interface{}{}, false, ) if err != nil { return errs.NewError(err) } if twitterInfo == nil { twitterInfo = &models.TwitterInfo{ TwitterID: twitterUser.ID, } } twitterInfo.TwitterAvatar = twitterUser.ProfileImageURL twitterInfo.TwitterName = twitterUser.Name twitterInfo.TwitterUsername = twitterUser.UserName twitterInfo.AccessToken = respOauth.AccessToken twitterInfo.RefreshToken = respOauth.RefreshToken twitterInfo.ExpiresIn = respOauth.ExpiresIn twitterInfo.Scope = respOauth.Scope twitterInfo.TokenType = respOauth.TokenType twitterInfo.OauthClientId = oauthClientId twitterInfo.OauthClientSecret = oauthClientSecret twitterInfo.Description = twitterUser.Description twitterInfo.RefreshError = "OK" expiredAt := time.Now().Add(time.Second * time.Duration(respOauth.ExpiresIn-(60*20))) twitterInfo.ExpiredAt = &expiredAt err = s.dao.Save(daos.GetDBMainCtx(ctx), twitterInfo) if err != nil { return errs.NewError(err) } agentInfos, err := s.dao.FindAgentInfo(daos.GetDBMainCtx(ctx), map[string][]interface{}{ `tmp_twitter_id = ?`: {twitterUser.ID}, `(twitter_id is null or twitter_id="")`: {}, }, map[string][]interface{}{}, []string{}, 0, 100, ) if err != nil { return errs.NewError(err) } if agentInfos != nil { user, err := s.GetUser(daos.GetDBMainCtx(ctx), models.GENERTAL_NETWORK_ID, strings.ToLower(address), false) if err != nil { return errs.NewError(err) } if user != nil { user.TwitterID = twitterInfo.TwitterID user.TwitterName = twitterInfo.TwitterName user.TwitterUsername = twitterInfo.TwitterUsername user.TwitterAvatar = twitterInfo.TwitterAvatar } for _, agentInfo := range agentInfos { updateFields := map[string]interface{}{ "creator": strings.ToLower(address), "scan_enabled": true, } err := daos.GetDBMainCtx(ctx).Model(agentInfo).Updates( updateFields, ).Error if err != nil { return errs.NewError(err) } } } } } return nil } func (s *Service) TwitterOauthCallbackForClaimVideoReward(ctx context.Context, callbackUrl, address, code, clientID string) (map[string]string, error) { mapResp := map[string]string{} oauthClientId := s.conf.Twitter.OauthClientId oauthClientSecret := s.conf.Twitter.OauthClientSecret respOauth, err := s.twitterAPI.GetTwitterOAuthTokenWithKeyForVideoReward( oauthClientId, oauthClientSecret, code, callbackUrl, address) if err != nil { return nil, errs.NewError(err) } if respOauth != nil && respOauth.AccessToken != "" { twitterUser, err := s.twitterAPI.GetTwitterMe(respOauth.AccessToken) if err != nil { return nil, errs.NewError(err) } if twitterUser != nil { twitterInfo, err := s.dao.FirstTwitterInfo(daos.GetDBMainCtx(ctx), map[string][]interface{}{ "twitter_id = ?": {twitterUser.ID}, }, map[string][]interface{}{}, false, ) if err != nil { return nil, errs.NewError(err) } if twitterInfo == nil { twitterInfo = &models.TwitterInfo{ TwitterID: twitterUser.ID, } } twitterInfo.TwitterAvatar = twitterUser.ProfileImageURL twitterInfo.TwitterName = twitterUser.Name twitterInfo.TwitterUsername = twitterUser.UserName twitterInfo.AccessToken = respOauth.AccessToken twitterInfo.RefreshToken = respOauth.RefreshToken twitterInfo.ExpiresIn = respOauth.ExpiresIn twitterInfo.Scope = respOauth.Scope twitterInfo.TokenType = respOauth.TokenType twitterInfo.OauthClientId = oauthClientId twitterInfo.OauthClientSecret = oauthClientSecret twitterInfo.Description = twitterUser.Description twitterInfo.RefreshError = "OK" expiredAt := time.Now().Add(time.Second * time.Duration(respOauth.ExpiresIn-(60*20))) twitterInfo.ExpiredAt = &expiredAt err = s.dao.Save(daos.GetDBMainCtx(ctx), twitterInfo) if err != nil { return nil, errs.NewError(err) } //user address privyWallet, err := s.dao.FirstPrivyWallet(daos.GetDBMainCtx(ctx), map[string][]interface{}{ "twitter_id = ?": {twitterUser.ID}, }, map[string][]interface{}{}, []string{}) if err != nil { return nil, errs.NewError(err) } if privyWallet == nil { return nil, errs.NewError(errs.ErrRecordNotFound) } updateFields := map[string]interface{}{ "user_address": strings.ToLower(address), } err = daos.GetDBMainCtx(ctx).Model(privyWallet).Updates( updateFields, ).Error if err != nil { return nil, errs.NewError(err) } mapResp["address"] = privyWallet.Address mapResp["twitter_id"] = twitterUser.ID } } return mapResp, nil } // func (s *Service) TwitterOauthCallbackForClaimVideoReward(ctx context.Context, callbackUrl, address, code, clientID string) error { // oauthClientId := s.conf.Twitter.OauthClientId // oauthClientSecret := s.conf.Twitter.OauthClientSecret // respOauth, err := s.twitterAPI.GetTwitterOAuthTokenWithKeyForVideoReward( // oauthClientId, oauthClientSecret, // code, callbackUrl, address) // if err != nil { // return errs.NewError(err) // } // if respOauth != nil && respOauth.AccessToken != "" { // twitterUser, err := s.twitterAPI.GetTwitterMe(respOauth.AccessToken) // if err != nil { // return errs.NewError(err) // } // if twitterUser != nil { // twitterInfo, err := s.dao.FirstTwitterInfo(daos.GetDBMainCtx(ctx), // map[string][]interface{}{ // "twitter_id = ?": {twitterUser.ID}, // }, // map[string][]interface{}{}, false, // ) // if err != nil { // return errs.NewError(err) // } // if twitterInfo == nil { // twitterInfo = &models.TwitterInfo{ // TwitterID: twitterUser.ID, // } // } // twitterInfo.TwitterAvatar = twitterUser.ProfileImageURL // twitterInfo.TwitterName = twitterUser.Name // twitterInfo.TwitterUsername = twitterUser.UserName // twitterInfo.AccessToken = respOauth.AccessToken // twitterInfo.RefreshToken = respOauth.RefreshToken // twitterInfo.ExpiresIn = respOauth.ExpiresIn // twitterInfo.Scope = respOauth.Scope // twitterInfo.TokenType = respOauth.TokenType // twitterInfo.OauthClientId = oauthClientId // twitterInfo.OauthClientSecret = oauthClientSecret // twitterInfo.Description = twitterUser.Description // twitterInfo.RefreshError = "OK" // expiredAt := time.Now().Add(time.Second * time.Duration(respOauth.ExpiresIn-(60*20))) // twitterInfo.ExpiredAt = &expiredAt // err = s.dao.Save(daos.GetDBMainCtx(ctx), twitterInfo) // if err != nil { // return errs.NewError(err) // } // insts, err := s.dao.FindAgentVideo(daos.GetDBMainCtx(ctx), // map[string][]interface{}{ // `owner_twitter_id = ?`: {twitterUser.ID}, // }, // map[string][]interface{}{}, // []string{}, // 0, 9999, // ) // if err != nil { // return errs.NewError(err) // } // if insts != nil && len(insts) > 0 { // user, err := s.GetUser(daos.GetDBMainCtx(ctx), models.GENERTAL_NETWORK_ID, strings.ToLower(address), false) // if err != nil { // return errs.NewError(err) // } // if user != nil { // user.TwitterID = twitterInfo.TwitterID // user.TwitterName = twitterInfo.TwitterName // user.TwitterUsername = twitterInfo.TwitterUsername // user.TwitterAvatar = twitterInfo.TwitterAvatar // err = s.dao.Save(daos.GetDBMainCtx(ctx), user) // if err != nil { // return errs.NewError(err) // } // } // for _, inst := range insts { // updateFields := map[string]interface{}{ // "user_address": strings.ToLower(address), // } // err := daos.GetDBMainCtx(ctx).Model(inst).Updates( // updateFields, // ).Error // if err != nil { // return errs.NewError(err) // } // } // } // } // } // return nil // } func (s *Service) CreateUpdateUserTwitter(tx *gorm.DB, userTwitterID string) (*models.TwitterUser, error) { tweetUser, err := s.dao.FirstTwitterUser(tx, map[string][]interface{}{ "twitter_id = ?": {userTwitterID}, }, map[string][]interface{}{}, []string{}, ) if err != nil { return nil, errs.NewError(err) } info, err := s.twitterAPI.GetTwitterUserInfoID(userTwitterID) if err != nil { return nil, errs.NewError(err) } if tweetUser == nil { tweetUser = &models.TwitterUser{ TwitterID: info.TwitterID, TwitterUsername: info.TwitterUsername, Name: info.Name, ProfileUrl: info.ProfileUrl, FollowersCount: info.FollowersCount, FollowingsCount: info.FollowingsCount, IsBlueVerified: info.IsBlueVerified, JoinedAt: info.CreatedAt, } } else { tweetUser.TwitterUsername = info.TwitterUsername tweetUser.Name = info.Name tweetUser.ProfileUrl = info.ProfileUrl } err = s.dao.Save(tx, tweetUser) if err != nil { return nil, errs.NewError(err) } return tweetUser, nil } func (s *Service) CreateUpdateUserTwitterByUserName(tx *gorm.DB, username string) (*models.TwitterUser, error) { tweetUser, err := s.dao.FirstTwitterUser(tx, map[string][]interface{}{ "twitter_username = ?": {username}, }, map[string][]interface{}{}, []string{}, ) if err != nil { return nil, errs.NewError(err) } if tweetUser == nil { info, err := s.twitterAPI.GetTwitterByUserName(username) if err != nil { return nil, errs.NewError(err) } if info != nil { tweetUser = &models.TwitterUser{ TwitterID: info.ID, TwitterUsername: info.UserName, Name: info.Name, ProfileUrl: info.ProfileImageURL, } err = s.dao.Create(tx, tweetUser) if err != nil { return nil, errs.NewError(err) } } } return tweetUser, nil } func (s *Service) JobUpdateTwitterAccessToken(ctx context.Context) error { err := s.JobRunCheck( ctx, "JobUpdateTwitterAccessToken", func() error { var retErr error twitterInfos, err := s.dao.FindTwitterInfo(daos.GetDBMainCtx(ctx), map[string][]interface{}{ "expired_at <= now()": {}, "expired_at >= adddate(now(), interval -24 hour)": {}, }, map[string][]interface{}{}, []string{ "updated_at asc", }, 0, 50, ) if err != nil { return errs.NewError(err) } for _, twitterInfo := range twitterInfos { err := s.UpdateTwitterAccessToken(ctx, twitterInfo.ID) if err != nil { retErr = errs.MergeError(retErr, errs.NewErrorWithId(err, twitterInfo.ID)) } } return retErr }, ) if err != nil { return errs.NewError(err) } return nil } func (s *Service) UpdateTwitterAccessToken(ctx context.Context, twitterInfoID uint) error { err := s.JobRunCheck( ctx, fmt.Sprintf("UpdateTwitterAccessToken_%d", twitterInfoID), func() error { err := daos.WithTransaction( daos.GetDBMainCtx(ctx), func(tx *gorm.DB) error { twitterInfo, err := s.dao.FirstTwitterInfoByID(tx, twitterInfoID, map[string][]interface{}{}, true) if err != nil { return errs.NewError(err) } var authInfo *twitter.TwitterTokenResponse if twitterInfo.OauthClientId != "" && twitterInfo.OauthClientSecret != "" { authInfo, err = s.twitterAPI.GetTwitterAccessTokenWithKey(twitterInfo.OauthClientId, twitterInfo.OauthClientSecret, twitterInfo.RefreshToken) // if err != nil { // return errs.NewError(err) // } } else { authInfo, err = s.twitterAPI.GetTwitterAccessToken(twitterInfo.RefreshToken) // if err != nil { // return errs.NewError(err) // } } if authInfo != nil && err == nil { twitterInfo.AccessToken = authInfo.AccessToken twitterInfo.RefreshToken = authInfo.RefreshToken twitterInfo.ExpiresIn = authInfo.ExpiresIn twitterInfo.Scope = authInfo.Scope twitterInfo.TokenType = authInfo.TokenType expiredAt := time.Now().Add(time.Second * time.Duration(authInfo.ExpiresIn-(60*20))) twitterInfo.ExpiredAt = &expiredAt twitterInfo.RefreshError = "OK" err = s.dao.Save(tx, twitterInfo) if err != nil { return errs.NewError(err) } } else { twitterInfo.RefreshError = err.Error() err = s.dao.Save(tx, twitterInfo) if err != nil { return errs.NewError(err) } } return nil }, ) if err != nil { return errs.NewError(err) } return nil }, ) if err != nil { return errs.NewError(err) } _ = s.UpdateAgentTwitterInfo(ctx, twitterInfoID) return nil } func (s *Service) UpdateAgentTwitterInfo(ctx context.Context, twitterInfoID uint) error { agents, err := s.dao.FindAgentInfo( daos.GetDBMainCtx(ctx), map[string][]interface{}{ "twitter_info_id = ?": {twitterInfoID}, }, map[string][]interface{}{ "TwitterInfo": {}, }, []string{}, 0, 999999, ) if err != nil { return errs.NewError(err) } for _, agent := range agents { func(agent *models.AgentInfo) error { if agent.TwitterInfo != nil { userMe, err := helpers.GetTwitterUserMe(agent.TwitterInfo.AccessToken) if err != nil { return errs.NewError(err) } if userMe != nil && userMe.Data.UserName != "" && userMe.Data.Name != "" { err = daos.GetDBMainCtx(ctx).Model(agent). UpdateColumn("twitter_username", userMe.Data.UserName). UpdateColumn("agent_name", userMe.Data.Name). UpdateColumn("twitter_verified", userMe.Data.Verified).Error if err != nil { return errs.NewError(err) } err = daos.GetDBMainCtx(ctx).Model(agent.TwitterInfo). UpdateColumn("twitter_username", userMe.Data.UserName). UpdateColumn("twitter_name", userMe.Data.Name). UpdateColumn("twitter_avatar", userMe.Data.ProfileImageURL).Error if err != nil { return errs.NewError(err) } } } return nil }(agent) } return nil } func (s *Service) GetTwitterVerified(tx *gorm.DB, agentInfoID uint) (bool, error) { m, err := s.dao.FirstAgentInfoByID( tx, agentInfoID, map[string][]interface{}{ "TwitterInfo": {}, }, false, ) if err != nil { return false, errs.NewError(err) } if m == nil { return false, errs.NewError(errs.ErrBadRequest) } return m.TwitterVerified, nil } func (s *Service) GetTwitterPostMaxChars(tx *gorm.DB, agentInfoID uint) (uint, error) { verified, err := s.GetTwitterVerified(tx, agentInfoID) if err != nil { return 0, errs.NewError(err) } if verified { return 4000, nil } return 280, nil } func (s *Service) GetAgentTokenInfoFromContractAddress(ctx context.Context, tokenAddress string) (string, string, error) { tokenAddress = strings.ToLower(tokenAddress) if tokenAddress != "" && tokenAddress != "no" && tokenAddress != "yes" && tokenAddress != "pending" { tokenMetaData, err := s.blockchainUtils.SolanaTokenMetaData(tokenAddress) if err != nil { return "", "", nil } return tokenMetaData.Name, tokenMetaData.Symbol, nil } return "", "", nil } func (s *Service) UpdateAgentFarcasterInfo(ctx context.Context, agentID string, fID string, fUsername string) (bool, error) { err := daos.WithTransaction( daos.GetDBMainCtx(ctx), func(tx *gorm.DB) error { agentInfo, err := s.dao.FirstAgentInfo(tx, map[string][]interface{}{ "agent_id = ?": {agentID}, }, map[string][]interface{}{}, []string{}, ) if err != nil { return errs.NewError(err) } if agentInfo != nil { agentInfo, _ = s.dao.FirstAgentInfoByID(tx, agentInfo.ID, map[string][]interface{}{}, true) agentInfo.FarcasterID = fID agentInfo.FarcasterUsername = fUsername err = s.dao.Save(tx, agentInfo) if err != nil { return errs.NewError(err) } } return nil }, ) if err != nil { return false, errs.NewError(err) } return true, nil } func (s *Service) PreviewAgentSystemPromp(ctx context.Context, personality, question string) (string, error) { aiStr, err := s.openais["Agent"].TestAgentPersinality(personality, question, s.conf.AgentOffchainChatUrl) if err != nil { return "", errs.NewError(err) } return aiStr, nil } func (s *Service) RetrieveKnowledge(agentModel string, messages []openai2.ChatCompletionMessage, knowledgeBases []*models.KnowledgeBase, topK *int, threshold *float64) (string, error) { if len(knowledgeBases) == 0 { return "", errs.NewError(errors.New("knowledge bases is empty")) } if agentModel == "" { agentModel = "NousResearch/Hermes-3-Llama-3.1-70B-FP8" } systemPrompt := openai.GetSystemPromptFromLLMMessage(messages) isKbAgent := false if systemPrompt == "" { isKbAgent = true systemPrompt = "You are a helpful assistant." } _ = isKbAgent userPromptInput := openai.LastUserPrompt(messages) retrieveQuery := userPromptInput topKQuery := 5 if topK != nil { topKQuery = *topK } th := 0.4 if threshold != nil { th = *threshold } request := serializers.RetrieveKnowledgeBaseRequest{ Query: retrieveQuery, TopK: topKQuery, Kb: []string{ knowledgeBases[0].KbId, }, Threshold: th, } // retry var ( body string err error ) maxRetry := 10 for i := 1; i <= maxRetry; i++ { body, err = helpers.CurlURLString( s.conf.KnowledgeBaseConfig.QueryServiceUrl, "POST", map[string]string{}, &request, ) if err == nil { break } time.Sleep(time.Second) } response := &serializers.RetrieveKnowledgeBaseResponse{} err = json.Unmarshal([]byte(body), response) if err != nil { return "", errs.NewError(err) } searchResult := "" for _, item := range response.Result { searchResult = searchResult + item.Content + "\n\n" } options := map[string]interface{}{} userPrompt := fmt.Sprintf("Use the following pieces of retrieved context to answer the question. If there is not enough information in the retrieved context to answer the question, just say something you know about the topic."+ "\n\nQuestion: %v\nContext: \n\n%vAnswer:", userPromptInput, searchResult) //answer prompt payloadAgentChat := []openai2.ChatCompletionMessage{ { Role: openai2.ChatMessageRoleSystem, Content: systemPrompt, }, { Role: openai2.ChatMessageRoleUser, Content: userPrompt, }, } if agentModel == "DeepSeek-R1-Distill-Llama-70B" { options = map[string]interface{}{ "temperature": 0.7, "max_tokens": 4096, } } else { options = map[string]interface{}{ "temperature": 0, "top_p": 0.01, "max_tokens": 1024, } } messageCallLLM, _ := json.Marshal(&payloadAgentChat) url := s.conf.AgentOffchainChatUrl if s.conf.KnowledgeBaseConfig.DirectServiceUrl != "" { url = s.conf.KnowledgeBaseConfig.DirectServiceUrl } stringResp, err := s.openais["Agent"].CallDirectlyEternalLLM(string(messageCallLLM), agentModel, url, options) if err != nil { return "", errs.NewError(err) } return stringResp, nil } func (s *Service) StreamRetrieveKnowledge(ctx context.Context, agentModel string, messages []openai2.ChatCompletionMessage, knowledgeBases []*models.KnowledgeBase, topK *int, threshold *float64, outputChan chan *models.ChatCompletionStreamResponse, errChan chan error, doneChan chan bool) { if len(knowledgeBases) == 0 { errChan <- errs.NewError(errors.New("knowledge bases is empty")) return } if agentModel == "" { agentModel = "NousResearch/Hermes-3-Llama-3.1-70B-FP8" } systemPrompt := openai.GetSystemPromptFromLLMMessage(messages) isKbAgent := false if systemPrompt == "" { isKbAgent = true systemPrompt = "You are a helpful assistant." } _ = isKbAgent go func() { outputChan <- &models.ChatCompletionStreamResponse{ Message: "Start generating the query.", Code: http.StatusProcessing, } }() idRequest := time.Now().UnixMicro() retrieveQuery, errGenerateQuery, conversation := s.GenerateKnowledgeQuery(agentModel, messages) _ = conversation if errGenerateQuery != nil { errChan <- errs.NewError(errors.New("ERROR_GENERATE_QUERY")) return } logger.Info("stream_retrieve_knowledge", "generate query", zap.Any("id_request", idRequest), zap.Any("retrieveQuery", retrieveQuery), zap.Any("input", messages)) if retrieveQuery == nil { str := "" retrieveQuery = &str } analysedResultChanel := make(chan string) go func() { topKQuery := 20 if topK != nil { topKQuery = *topK } th := 0.2 if threshold != nil { th = *threshold } request := serializers.RetrieveKnowledgeBaseRequest{ Query: *retrieveQuery, TopK: topKQuery, Kb: []string{ knowledgeBases[0].KbId, }, Threshold: th, } go func() { outputChan <- &models.ChatCompletionStreamResponse{ Message: "Start searching query in the RAG system.", Code: http.StatusProcessing, } }() searchResponse, err := s.GetResultFromRagSearch(&request) if err != nil { errChan <- err return } searchedResult := []string{} for _, item := range searchResponse.Result { searchedResult = append(searchedResult, item.Content) } go func() { outputChan <- &models.ChatCompletionStreamResponse{ Message: "Start analyzing the search result.", Code: http.StatusProcessing, } }() logger.Info("stream_retrieve_knowledge", "searched result", zap.Any("id_request", idRequest), zap.Any("searchedResult", searchedResult), zap.Any("input", request)) analysedResult, err := s.AnalyseSearchResults(agentModel, systemPrompt, *retrieveQuery, searchedResult) if err != nil { errChan <- err return } logger.Info("stream_retrieve_knowledge", "analyze result", zap.Any("id_request", idRequest), zap.Any("query", retrieveQuery), zap.Any("analyzed Result", analysedResult)) analysedResultChanel <- analysedResult }() toolCallData := "" if knowledgeBases[0].ID == 211 { //eth denver agent var err error toolCallData, err = s.GetResultFromToolCall(*retrieveQuery) if err != nil { errChan <- err return } } logger.Info("stream_retrieve_knowledge", "tool call data", zap.Any("id_request", idRequest), zap.Any("query", retrieveQuery), zap.Any("tool call data", toolCallData)) // wait finish get analysedResult analysedResult := <-analysedResultChanel options := map[string]interface{}{} //answer prompt question := openai.GetQuestionFromLLMMessage(messages) payloadAgentChat := []openai2.ChatCompletionMessage{ { Role: openai2.ChatMessageRoleSystem, Content: systemPrompt, }} if len(messages) > 0 { payloadAgentChat = messages[:len(messages)-1] } questionPrompt := fmt.Sprintf("Generate a response to the user's query based strictly on the user question and the provided information.\n\n### Guidelines:\n- Prioritize database data over website data when answering.\n- The response must be concise and directly relevant.\n- No external knowledge should be introduced beyond the provided sources.\n- Ensure clarity and alignment with ETHDenver-related context.\n- Prefer structured lists over paragraphs whenever possible to enhance readability.\n- If the response involves listing events, ensure they are formatted as follows:\n\nRequired Format for Events:\n```\n (; ; ...; ) - - \n```\n\n- Speakers should be listed in the order provided. If they have an affiliation, include it exactly as given.\n- The local start time must be preserved in its original format.\n- The stage or location name should appear at the end.\n- If only one speaker is listed, follow the same format without modification.\n- If no speaker is listed, ignore the speaker listing part of the format.\n- If multiple events are listed, each should follow the format on a new line.\n\nExample of correct event with speakers output:\n- Easy-to-Miss Solidity Bugs (Jonathan Mevs - Quantstamp; Michael Boyle - Quantstamp) - February 24, 2025 at 10:50 AM - Captain Ethereum Stage\n\nExample of correct event without speakers output:\n- Messari - Feb 27, 2025 at 1:30 PM - BUIDL Event Hall\n\n### User Question:\n%v\n\n### Relevant Information from Database (Primary Source):\n%v\n\n### Relevant Information from the Website:\n%v\n\n### Final Answer:\n(Provide a precise, ETHDenver-relevant response following these guidelines.)\n", question, toolCallData, analysedResult) if knowledgeBases[0].ID != 211 { // not is eth denver agent questionPrompt = fmt.Sprintf("Use the following context from the conversation to answer the question. If the context is insufficient, you may draw from external knowledge to provide a relevant answer.\n\nContext: \n%v\n\nQuestion: \n%v\n\nAnswer:", analysedResult, question) } payloadAgentChat = append(payloadAgentChat, openai2.ChatCompletionMessage{ Role: openai2.ChatMessageRoleUser, Content: questionPrompt, }) url := s.conf.AgentOffchainChatUrl apiKey := s.conf.KnowledgeBaseConfig.OnchainAPIKey if s.conf.KnowledgeBaseConfig.OnChainUrl != "" { url = s.conf.KnowledgeBaseConfig.OnChainUrl } seedAnswer := 1234 chainID := fmt.Sprintf("%v", knowledgeBases[0].NetworkID) llmRequest := openai2.ChatCompletionRequest{ Stream: true, Messages: payloadAgentChat, Model: agentModel, Temperature: 0.01, MaxTokens: 4096, Seed: &seedAnswer, Metadata: map[string]string{ "chain_id": chainID, "onchain_internal": "1", }, } go func() { outputChan <- &models.ChatCompletionStreamResponse{ Message: "Start generating the result.", Code: http.StatusProcessing, } }() logger.Info("stream_retrieve_knowledge", "start call finish result", zap.Any("id_request", idRequest), zap.Any("payloadAgentChat", payloadAgentChat), zap.Any("options", options)) s.openais["Agent"].CallStreamOnchainEternalLLM(ctx, url, apiKey, llmRequest, outputChan, errChan, doneChan) } func (s *Service) GenerateKnowledgeQuery(baseModel string, histories []openai2.ChatCompletionMessage) (*string, error, string) { url := s.conf.AgentOffchainChatUrl if s.conf.KnowledgeBaseConfig.DirectServiceUrl != "" { url = s.conf.KnowledgeBaseConfig.DirectServiceUrl } today := time.Now().Format("Jan 02, 2006") conversation := fmt.Sprintf("Remember that today is: %v\n\n", today) for _, item := range histories { if item.Role == openai2.ChatMessageRoleSystem { continue } conversation += fmt.Sprintf("%v: %v\n", strings.ToTitle(item.Role), item.Content) } systemPrompt := openai.GetSystemPromptFromLLMMessage(histories) if systemPrompt == "" { systemPrompt = "You are a helpfully assistant" } question := openai.GetQuestionFromLLMMessage(histories) if question == "" { question = "Hi" } type historyMsg struct { Role string `json:"role"` Content string `json:"content"` } historiesPrompt := []historyMsg{} for i := 1; i < len(histories)-1; i++ { historiesPrompt = append(historiesPrompt, historyMsg{ Role: strings.ToLower(histories[i].Role), Content: histories[i].Content, }) } generateQueryPrefix := "Based on the conversation history and the user question below, generate a concise query that can be used to retrieve relevant information.\n\n### Instruction:\n- Generate a concise query based on the conversation history and the user question.\n- Output the query in **stringified JSON format** with a key `\"query\"`.\n- Do not include additional explanations or comments—just the JSON.\n\n### Example\n\n**Conversation History:**\n[{{\"role\":\"user\",\"content\":\"What is French cuisine?\"}},{{\"role\":\"assistant\",\"content\":\"French cuisine refers to the traditional cooking styles of France, famous for its rich flavors and varied dishes.\"}}]\n\n**User Question:**\nWhat is the most popular?\n\n**Output:** \n```json\n{{\n \"query\": \"popular French cuisine\"\n}}\n```\n\n### Input\n\nRemember that today is: %v\n\n**Conversation History:**\n%v\n\n**User Question:**\n%v\n\n### Answer\n" userPrompt := fmt.Sprintf(generateQueryPrefix, today, historiesPrompt, question) messages := []openai2.ChatCompletionMessage{ { Role: openai2.ChatMessageRoleSystem, Content: systemPrompt, }, { Role: openai2.ChatMessageRoleUser, Content: userPrompt, }, } maxRetry := 10 messageCallLLM, _ := json.Marshal(&messages) var queryStringResp *string for i := 1; i <= maxRetry; i++ { if i > 1 { time.Sleep(time.Second) } stringResp, err := s.openais["Agent"].CallDirectlyEternalLLM(string(messageCallLLM), baseModel, url, map[string]interface{}{ "temperature": 0.7, "max_tokens": 4096, }) if err != nil || stringResp == "" { continue } // find { and } in stringResp startIndex := strings.Index(stringResp, "{") endIndex := strings.LastIndex(stringResp, "}") if startIndex == -1 || endIndex == -1 { continue } queryStringRespJson := stringResp[startIndex : endIndex+1] queryStringRespMap := map[string]string{} err = json.Unmarshal([]byte(queryStringRespJson), &queryStringRespMap) if err != nil { continue } if _, ok := queryStringRespMap["query"]; !ok { continue } val := queryStringRespMap["query"] queryStringResp = &val break } return queryStringResp, nil, conversation } func (s *Service) AnalyseSearchResults(baseModel string, systemPrompt string, query string, searchedResult []string) (string, error) { batchSize := 5 start := 0 analyzeResult := "" countRequest := len(searchedResult) / batchSize if len(searchedResult)%batchSize != 0 { countRequest++ } listAnalyzeResult := make([]string, countRequest) wg := sync.WaitGroup{} wg.Add(countRequest) for i := 0; i < countRequest; i++ { go func(index int) { defer wg.Done() start = index * batchSize end := start + batchSize if end > len(searchedResult) { end = len(searchedResult) } searchResult := "" for _, item := range searchedResult[start:end] { searchResult = searchResult + item + "\n\n" } url := s.conf.AgentOffchainChatUrl if s.conf.KnowledgeBaseConfig.DirectServiceUrl != "" { url = s.conf.KnowledgeBaseConfig.DirectServiceUrl } generateQueryPrefix := "Act as a critical information analyst, skilled in extracting only the most essential insights from search results.\n\n## Task:\nAnalyze the provided search results and extract only the most critical insights directly relevant to the given question.\n\n## Instructions:\n- Strictly extract only essential information. No introductions, summaries, or extra context—only the key insights.\n- Ensure accuracy. Verify time, location, and context before including any insight.\n- Be concise and precise. Remove redundant details, filler content, and tangential information.\n- No assumptions or external knowledge. Only use information explicitly stated in the search results.\n- Maintain neutrality and clarity. Present insights objectively without speculation.\n\n## Input:\nQuestion: %v\nSearch Results: %v\n\n## Response Format (Strictly Follow This):\n- Directly list the critical insights only—no introductions or explanations.\n- If multiple key insights exist, format them as bullet points.\n- Each point should be as concise as possible while preserving meaning.\n\n## Example Output:\n- [Critical insight 1]\n- [Critical insight 2]\n- [Critical insight 3]\n" userPrompt := fmt.Sprintf(generateQueryPrefix, query, searchResult) messages := []openai2.ChatCompletionMessage{ { Role: openai2.ChatMessageRoleSystem, Content: systemPrompt, }, { Role: openai2.ChatMessageRoleUser, Content: userPrompt, }, } maxRetry := 10 messageCallLLM, _ := json.Marshal(&messages) stringResp := "" var err error for i := 1; i <= maxRetry; i++ { if i > 1 { time.Sleep(time.Second) } stringResp, err = s.openais["Agent"].CallDirectlyEternalLLM(string(messageCallLLM), baseModel, url, map[string]interface{}{ "temperature": 0.7, "max_tokens": 4096, }) if err != nil || stringResp == "" { continue } break } listAnalyzeResult[index] = stringResp }(i) } wg.Wait() for _, result := range listAnalyzeResult { analyzeResult = analyzeResult + result + "\n" } return analyzeResult, nil } func (s *Service) GetResultFromToolCall(query string) (string, error) { if len(query) == 0 { return "", nil } url := fmt.Sprintf("%v?question=%v", s.conf.KnowledgeBaseConfig.ToolCallServiceUrl, query) for i := 0; i < 10; i++ { body, err := helpers.CurlURLString( url, "GET", map[string]string{}, nil, ) if err != nil { continue } res := make(map[string]interface{}) err = json.Unmarshal([]byte(body), &res) if err != nil { return "[]", nil } if res["result"] == nil { return "[]", nil } result, ok := res["result"].(map[string]interface{}) if !ok { return "[]", nil } data, _ := json.Marshal(result["data"]) return string(data), nil } return "", fmt.Errorf("can not get tool call result with query %v", query) } func (s *Service) GetResultFromRagSearch(request *serializers.RetrieveKnowledgeBaseRequest) (*serializers.RetrieveKnowledgeBaseResponse, error) { if request == nil { return nil, fmt.Errorf("empty query") } for i := 1; i <= 10; i++ { body, err := helpers.CurlURLString( s.conf.KnowledgeBaseConfig.QueryServiceUrl, "POST", map[string]string{}, &request, ) if err != nil { continue } var response serializers.RetrieveKnowledgeBaseResponse err = json.Unmarshal([]byte(body), &response) if err != nil { break } return &response, nil } return nil, fmt.Errorf("can not get search result with request %v", request) } func (s *Service) PreviewAgentSystemPrompV1(ctx context.Context, messages string, agentId *uint, kbIdFromKnowledegeBase *string, modelNameFromRequest *string) (string, error) { var agentInfo *models.AgentInfo baseModel := "NousResearch/Hermes-3-Llama-3.1-70B-FP8" if agentId != nil { agentInfo, _ = s.dao.FirstAgentInfoByID(daos.GetDBMainCtx(ctx), *agentId, map[string][]interface{}{}, false) } llmMessage := []openai2.ChatCompletionMessage{} err := json.Unmarshal([]byte(messages), &llmMessage) if err != nil { return "", errs.NewError(errors.New("invalid message request")) } systemContent := openai.GetSystemPromptFromLLMMessage(llmMessage) url := s.conf.AgentOffchainChatUrl if s.conf.KnowledgeBaseConfig.DirectServiceUrl != "" { url = s.conf.KnowledgeBaseConfig.DirectServiceUrl if agentInfo != nil && agentInfo.AgentBaseModel != "" { baseModel = agentInfo.AgentBaseModel } } if modelNameFromRequest != nil && *modelNameFromRequest != "" { baseModel = *modelNameFromRequest } { if s.conf.KnowledgeBaseConfig.EnableSimulation && agentInfo != nil { // get last knowledge base of agent var knowledgeBaseUse *models.KnowledgeBase agentInfoKnowledgeBase, _ := s.dao.FirstAgentInfoKnowledgeBaseByAgentInfoID( daos.GetDBMainCtx(ctx), agentInfo.ID, map[string][]interface{}{ "KnowledgeBase": {}, // must preload }, []string{"id desc"}, ) if agentInfoKnowledgeBase != nil && agentInfoKnowledgeBase.KnowledgeBase != nil { knowledgeBaseUse = agentInfoKnowledgeBase.KnowledgeBase } if kbIdFromKnowledegeBase != nil { knowledgeBaseFromQuery, _ := s.dao.FirstKnowledgeBase(daos.GetDBMainCtx(ctx), map[string][]interface{}{ "kb_id = ?": {*kbIdFromKnowledegeBase}, }, map[string][]interface{}{}, []string{"id desc"}, false) if knowledgeBaseFromQuery != nil { knowledgeBaseUse = knowledgeBaseFromQuery } } if knowledgeBaseUse != nil { retrieveKnowledgeBaseResponse, err := s.RetrieveKnowledge(baseModel, llmMessage, []*models.KnowledgeBase{ knowledgeBaseUse, }, nil, nil) if err != nil { return "", err } return retrieveKnowledgeBaseResponse, nil } } } llmMessage = openai.UpdateSystemPromptInLLMRequest(llmMessage, systemContent) messageCallLLM, _ := json.Marshal(&llmMessage) aiStr, err := s.openais["Agent"].CallDirectlyEternalLLM(string(messageCallLLM), baseModel, url, map[string]interface{}{ "top_p": 0.01, "max_tokens": 4096, }) if err != nil { return "", errs.NewError(err) } return aiStr, nil } func (s *Service) PreviewStreamAgentSystemPromptV1(ctx context.Context, writerResponse gin.ResponseWriter, outputChan chan *models.ChatCompletionStreamResponse, errChan chan error, doneChan chan bool) { needFakeResponse := true for { select { case <-ctx.Done(): return case <-doneChan: if _, err := writerResponse.Write(serializers.HttpEventStreamResponse{Data: serializers.DoneResponseStreamData}.ToOutPut()); err != nil { return } writerResponse.Flush() return case <-time.Tick(time.Minute * 20): if _, err := writerResponse.Write(serializers.HttpEventStreamResponse{Data: serializers.TimeoutResponseStreamData}.ToOutPut()); err != nil { return } writerResponse.Flush() return case err := <-errChan: data, _ := json.Marshal(models.ChatCompletionStreamResponse{ Message: err.Error(), Code: http.StatusBadRequest}) if _, err := writerResponse.Write(serializers.HttpEventStreamResponse{Data: data}.ToOutPut()); err != nil { return } writerResponse.Flush() logger.Error("stream_retrieve_knowledge", "return with err", zap.Any("err", err)) return case output := <-outputChan: if output.Code != http.StatusProcessing { needFakeResponse = false } data, _ := json.Marshal(output) if _, err := writerResponse.Write(serializers.HttpEventStreamResponse{Data: data}.ToOutPut()); err != nil { return } writerResponse.Flush() default: if needFakeResponse { if _, err := writerResponse.Write(serializers.HttpEventStreamResponse{Data: serializers.FakeResponseStreamData}.ToOutPut()); err != nil { return } writerResponse.Flush() time.Sleep(2 * time.Second) } } } } func (s *Service) ProcessStreamAgentSystemPromptV1(ctx context.Context, req *serializers.PreviewRequest, outputChan chan *models.ChatCompletionStreamResponse, errChan chan error, doneChan chan bool) { var agentInfo *models.AgentInfo baseModel := "NousResearch/Hermes-3-Llama-3.1-70B-FP8" if req.AgentID != nil { agentInfo, _ = s.dao.FirstAgentInfoByID(daos.GetDBMainCtx(ctx), *req.AgentID, map[string][]interface{}{}, false) } var llmMessage []openai2.ChatCompletionMessage err := json.Unmarshal([]byte(req.Messages), &llmMessage) if err != nil { errChan <- errs.NewError(errors.New("invalid message request")) return } systemContent := openai.GetSystemPromptFromLLMMessage(llmMessage) url := s.conf.AgentOffchainChatUrl if s.conf.KnowledgeBaseConfig.DirectServiceUrl != "" { url = s.conf.KnowledgeBaseConfig.DirectServiceUrl if agentInfo != nil && agentInfo.AgentBaseModel != "" { baseModel = agentInfo.AgentBaseModel } } if req.ModelName != nil && len(*req.ModelName) > 0 { baseModel = *req.ModelName } if s.conf.KnowledgeBaseConfig.EnableSimulation && agentInfo != nil { // get last knowledge base of agent var knowledgeBaseUse *models.KnowledgeBase agentInfoKnowledgeBase, _ := s.dao.FirstAgentInfoKnowledgeBaseByAgentInfoID( daos.GetDBMainCtx(ctx), agentInfo.ID, map[string][]interface{}{ "KnowledgeBase": {}, // must preload }, []string{"id desc"}, ) if agentInfoKnowledgeBase != nil && agentInfoKnowledgeBase.KnowledgeBase != nil { knowledgeBaseUse = agentInfoKnowledgeBase.KnowledgeBase } if req.KbId != nil { knowledgeBaseFromQuery, _ := s.dao.FirstKnowledgeBase(daos.GetDBMainCtx(ctx), map[string][]interface{}{ "kb_id = ?": {*req.KbId}, }, map[string][]interface{}{}, []string{"id desc"}, false) if knowledgeBaseFromQuery != nil { knowledgeBaseUse = knowledgeBaseFromQuery } } if knowledgeBaseUse != nil { s.StreamRetrieveKnowledge(ctx, baseModel, llmMessage, []*models.KnowledgeBase{ knowledgeBaseUse, }, nil, nil, outputChan, errChan, doneChan) return } } llmMessage = openai.UpdateSystemPromptInLLMRequest(llmMessage, systemContent) messageCallLLM, _ := json.Marshal(&llmMessage) s.openais["Agent"].CallStreamDirectlyEternalLLM(ctx, string(messageCallLLM), baseModel, url, map[string]interface{}{ "top_p": 0.01, "max_tokens": 4096, }, outputChan, errChan, doneChan) } func (s *Service) AgentChatSupport(ctx context.Context, msg string) (string, error) { aiStr, err := s.openais["Lama"].ChatMessage(msg) if err != nil { return "", errs.NewError(err) } return aiStr, nil } func (s *Service) GetExtractDataFromPost(content string) (string, error) { extractData := "" link, isTwitterPost := helpers.ExtractLinks(content) if link != "" { if isTwitterPost { twiterPostIDArry := strings.Split(link, "/") if len(twiterPostIDArry) > 0 { twitterPostID := twiterPostIDArry[len(twiterPostIDArry)-1] fmt.Println(twitterPostID) tweetDetail, err := s.rapid.GetTweetDetailByID(twitterPostID) if err != nil { return extractData, nil } if tweetDetail != nil { extractData = tweetDetail.FullText } } } else { webContent := helpers.ContentHtmlByUrl(link) if webContent == "" { webContent = helpers.RodContentHtmlByUrl(link) } webContent, err := s.blockchainUtils.CleanHtml(webContent) if err != nil { return extractData, nil } if webContent != "" { summary, err := s.openais["Lama"].SummaryWebContent(webContent) if err != nil { return extractData, nil } extractData = summary } } } return extractData, nil } func (s *Service) CheckAgentIsReadyToRunTwinTraining(agentInfo *models.AgentInfo) (float64, bool, error) { needBalance := 0.0 switch agentInfo.NetworkID { case models.SHARDAI_CHAIN_ID: needBalance = 5999.9 case models.ETHEREUM_CHAIN_ID: needBalance = 299.9 case models.SOLANA_CHAIN_ID: needBalance = 174.9 default: needBalance = 0.99 } if agentInfo.TwinTwitterUsernames != "" { arr := strings.Split(agentInfo.TwinTwitterUsernames, ",") // 300 EAI for each twitter username needBalance += float64(len(arr)) * 300 } agentEaiBalance, _ := agentInfo.EaiBalance.Float64() if agentEaiBalance >= needBalance { return needBalance, true, nil } return needBalance, false, nil } func (s *Service) JobAgentTwinTrain(ctx context.Context) error { err := s.JobRunCheck( ctx, "JobAgentTwinTrain", func() error { // Count pending twin training twinTrainingAgents, err := s.dao.FindAgentInfo(daos.GetDBMainCtx(ctx), map[string][]interface{}{ "twin_twitter_usernames != '' and twin_status = ?": {models.TwinStatusRunning}, }, map[string][]interface{}{}, []string{}, 0, 999999, ) if err == nil && len(twinTrainingAgents) > 5 { logger.Info("twin_training_jobs", "twin training is running maximum ===> skip", zap.Any("len_training_agents", len(twinTrainingAgents))) return nil } agents, err := s.dao.FindAgentInfo( daos.GetDBMainCtx(ctx), map[string][]interface{}{ //"agent_id != ''": {}, //"agent_contract_id = ?": {""}, //"agent_nft_minted = ?": {false}, `twin_twitter_usernames != '' and twin_status = ?`: {models.TwinStatusPending}, "scan_enabled = ?": {true}, }, map[string][]interface{}{}, []string{ "id asc", }, 0, 999999, ) if err != nil { return errs.NewError(err) } var retErr error wg := sync.WaitGroup{} for _, agent := range agents { wg.Add(1) go func(_agent *models.AgentInfo) { defer wg.Done() err = s.AgentTwinTrain(ctx, _agent.ID) if err != nil { retErr = errs.MergeError(retErr, errs.NewError(err)) } }(agent) } wg.Wait() return retErr }, ) if err != nil { return errs.NewError(err) } return nil } func (s *Service) CreateUpdateAgentSnapshotMission(ctx context.Context, agentID string, authHeader string, req []*serializers.AgentSnapshotMissionInfo) (*models.AgentInfo, error) { err := daos.WithTransaction( daos.GetDBMainCtx(ctx), func(tx *gorm.DB) error { agentInfo, err := s.dao.FirstAgentInfo(tx, map[string][]interface{}{ "agent_id = ?": {agentID}, }, map[string][]interface{}{}, []string{}, ) if err != nil { return errs.NewError(err) } if agentInfo != nil { defataulUserPromp := "" listID := []uint{} for _, item := range req { if item.ID > 0 { listID = append(listID, item.ID) } } listTestToolSet := strings.Split(s.conf.ListTestToolSet, ",") if len(listID) > 0 { err = tx.Where("agent_info_id = ? and id not in (?) and (mission_store_id = 0 or mission_store_id is NULL) and tool_set not in (?)", agentInfo.ID, listID, listTestToolSet).Delete(&models.AgentSnapshotMission{}).Error if err != nil { return errs.NewError(err) } } else { err = tx.Where("agent_info_id = ? and (mission_store_id = 0 or mission_store_id is NULL) and tool_set not in (?)", agentInfo.ID, listTestToolSet).Delete(&models.AgentSnapshotMission{}).Error if err != nil { return errs.NewError(err) } } for _, item := range req { if defataulUserPromp == "" { defataulUserPromp = item.UserPrompt } mission := &models.AgentSnapshotMission{} if item.ID > 0 { mission, err = s.dao.FirstAgentSnapshotMissionByID(tx, item.ID, map[string][]interface{}{}, false, ) if err != nil { return errs.NewError(err) } } mission.NetworkID = agentInfo.NetworkID mission.AgentInfoID = agentInfo.ID mission.UserPrompt = item.UserPrompt mission.IntervalSec = item.Interval mission.ToolSet = item.ToolSet mission.Enabled = true mission.ReplyEnabled = true mission.AgentType = item.AgentType mission.UserTwitterIds = item.UserTwitterIDs mission.Tokens = item.Tokens mission.AgentBaseModel = item.AgentBaseModel mission.Topics = item.Topics mission.IsBingSearch = item.IsBingSearch mission.IsTwitterSearch = item.IsTwitterSearch mission.RewardAmount = item.RewardAmount mission.RewardUser = item.RewardUser mission.MinTokenHolding = item.MinTokenHolding mission.LookupInterval = item.LookupInterval //farcaster if mission.ToolSet == models.ToolsetTypePostFarcaster { toolList := fmt.Sprintf(s.conf.ToolLists.FarcasterPost, agentInfo.FarcasterID, authHeader, agentInfo.AgentID) mission.ToolList = toolList } else if mission.ToolSet == models.ToolsetTypeReplyMentionsFarcaster { toolList := fmt.Sprintf(s.conf.ToolLists.FarcasterReply, agentInfo.FarcasterID, authHeader, agentInfo.AgentID) mission.ToolList = toolList } else if mission.ToolSet == models.ToolsetTypeTradeNews { toolList := fmt.Sprintf(s.conf.ToolLists.TradeNews, s.conf.InternalApiKey, agentInfo.ID) mission.ToolList = toolList mission.UserPrompt = "Analyze the coin price fluctuations in the past 24 hours, suggest which coin to buy or sell and post it on twitter" } else if mission.ToolSet == models.ToolsetTypeTradeAnalytics || mission.ToolSet == models.ToolsetTypeTradeAnalyticsOnTwitter { toolList := s.conf.ToolLists.TradeAnalytic if item.Tokens == "" { return errs.NewError(errs.ErrTokenNotFound) } mission.UserPrompt = fmt.Sprintf(`Conduct a technical analysis of $%s price data. Based on your findings, provide a recommended buy price and sell price to maximize potential returns.`, item.Tokens) toolList = strings.ReplaceAll(toolList, "{api_key}", s.conf.InternalApiKey) toolList = strings.ReplaceAll(toolList, "{token_symbol}", item.Tokens) mission.ToolList = toolList } else if mission.ToolSet == models.ToolsetTypeLuckyMoneys { if item.RewardAmount.Cmp(big.NewFloat(0)) <= 0 || item.RewardUser <= 0 { return errs.NewError(errs.ErrBadRequest) } } else if item.AgentStoreMissionID > 0 { agentStoreMission, err := s.dao.FirstAgentStoreMissionByID(tx, item.AgentStoreMissionID, map[string][]interface{}{}, false) if err != nil { return errs.NewError(err) } if agentStoreMission == nil { return errs.NewError(errs.ErrBadRequest) } agentStoreInstall, err := s.dao.FirstAgentStoreInstall( tx, map[string][]interface{}{ "agent_store_id = ?": {agentStoreMission.AgentStoreID}, "agent_info_id = ?": {mission.AgentInfoID}, }, map[string][]interface{}{}, []string{"id desc"}, ) if err != nil { return errs.NewError(err) } if agentStoreInstall == nil { return errs.NewError(errs.ErrBadRequest) } mission.AgentStoreMissionID = agentStoreMission.ID mission.AgentStoreID = agentStoreMission.AgentStoreID mission.ReactMaxSteps = 5 mission.ToolSet = "mission_store" } else if item.ToolList != "" { mission.ToolList = item.ToolList } if mission.ToolList != "" { mission.ReactMaxSteps = 5 } // err = s.dao.Save(tx, mission) if err != nil { return errs.NewError(err) } } if defataulUserPromp != "" { updateAgentFields := map[string]interface{}{ "user_prompt": defataulUserPromp, } err = tx.Model(agentInfo).Updates(updateAgentFields).Error if err != nil { return errs.NewError(err) } } } return nil }, ) if err != nil { return nil, errs.NewError(err) } return s.GetAgentInfoDetailByAgentID(ctx, agentID) } func (s *Service) DeleteAgentSnapshotMission(ctx context.Context, missionID uint, userAddress string) (bool, error) { err := daos.WithTransaction( daos.GetDBMainCtx(ctx), func(tx *gorm.DB) error { missionInfo, err := s.dao.FirstAgentSnapshotMissionByID(tx, missionID, map[string][]interface{}{ "AgentInfo": {}, }, false, ) if err != nil { return errs.NewError(err) } if missionInfo != nil && missionInfo.AgentInfo != nil && strings.EqualFold(missionInfo.AgentInfo.Creator, userAddress) { err = tx.Delete(missionInfo).Error if err != nil { return errs.NewError(err) } } return nil }, ) if err != nil { return false, errs.NewError(err) } return true, nil } func (s *Service) FollowListDefaultTwitters(ctx context.Context, agentID uint) error { listFollow, err := s.dao.GetListTwitterDefaultFollow(daos.GetDBMainCtx(ctx)) if err != nil { return errs.NewError(err) } for _, v := range listFollow { agent, err := s.dao.FirstAgentInfoByID( daos.GetDBMainCtx(ctx), agentID, map[string][]interface{}{ "TwitterInfo": {}, }, false, ) if err != nil { return errs.NewError(err) } if agent != nil { helpers.TwitterFollowUserCreate(agent.TwitterInfo.AccessToken, agent.TwitterID, v) time.Sleep(20 * time.Second) } } return nil } func (s *Service) UpdateTwinStatus(ctx context.Context, req *serializers.UpdateTwinStatusRequest) (*models.AgentInfo, error) { agentIDInt, err := strconv.Atoi(req.AgentID) if err != nil { return nil, errs.NewError(err) } agentInfoEntity, err := s.dao.FirstAgentInfo(daos.GetDBMainCtx(ctx), map[string][]interface{}{ "id = ?": {agentIDInt}, }, map[string][]interface{}{}, []string{}, ) if err != nil { return nil, errs.NewError(err) } agentInfoEntity.TwinStatus = models.TwinStatus(req.TwinStatus) agentInfoEntity.KnowledgeBaseID = req.KnowledgeBaseID agentInfoEntity.SystemPrompt = req.SystemPrompt agentInfoEntity.TwinTrainingProgress = req.TwinTrainingProgress if agentInfoEntity.TwinTrainingProgress > 100 { agentInfoEntity.TwinTrainingProgress = 100 } if agentInfoEntity.TwinTrainingProgress < 0 { agentInfoEntity.TwinTrainingProgress = 0 } if req.TwinStatus == string(models.TwinStatusDoneError) || req.TwinStatus == string(models.TwinStatusDoneSuccess) { endAt := time.Now().UTC() agentInfoEntity.TwinTrainingMessage = req.TwinTrainingMessage agentInfoEntity.TwinEndTrainingAt = &endAt } err = s.dao.Save(daos.GetDBMainCtx(ctx), agentInfoEntity) if err != nil { return nil, errs.NewError(err) } if req.TwinStatus == string(models.TwinStatusDoneError) { eventId := fmt.Sprintf("twin_train_refund_%d", agentInfoEntity.ID) checkRefunded, err := s.dao.FirstAgentEaiTopup(daos.GetDBMainCtx(ctx), map[string][]interface{}{ "event_id = ?": {eventId}, }, map[string][]interface{}{}, []string{}, ) if err != nil && !errors.Is(err, sql.ErrNoRows) { return nil, errs.NewError(err) } if checkRefunded != nil { return agentInfoEntity, nil } // increase balance and add refund history arr := strings.Split(agentInfoEntity.TwinTwitterUsernames, ",") twinFee := numeric.NewFloatFromString(fmt.Sprintf("%v", float64(len(arr))*300)) _ = daos.WithTransaction(daos.GetDBMainCtx(ctx), func(dbTx *gorm.DB) error { err = daos.GetDBMainCtx(ctx). Model(agentInfoEntity). Updates( map[string]interface{}{ "eai_balance": gorm.Expr("eai_balance + ?", numeric.NewBigFloatFromFloat(twinFee)), }, ). Error if err != nil { return errs.NewError(err) } return s.dao.Create( daos.GetDBMainCtx(ctx), &models.AgentEaiTopup{ NetworkID: agentInfoEntity.NetworkID, EventId: fmt.Sprintf("twin_train_refund_%d", agentInfoEntity.ID), AgentInfoID: agentInfoEntity.ID, Type: models.AgentEaiTopupTypeRefundTrainFail, Amount: numeric.NewBigFloatFromFloat(twinFee), Status: models.AgentEaiTopupStatusDone, DepositAddress: agentInfoEntity.ETHAddress, ToAddress: agentInfoEntity.ETHAddress, Toolset: "twin_train_refund", }, ) }) } return agentInfoEntity, nil } func (s *Service) UnlinkAgentTwitterInfo(ctx context.Context, agentID string) (bool, error) { err := daos.WithTransaction( daos.GetDBMainCtx(ctx), func(tx *gorm.DB) error { agentInfo, err := s.dao.FirstAgentInfo(tx, map[string][]interface{}{ "agent_id = ?": {agentID}, }, map[string][]interface{}{}, []string{}, ) if err != nil { return errs.NewError(err) } if agentInfo != nil { updateFields := map[string]interface{}{ "twitter_info_id": 0, "twitter_id": "", "twitter_username": "", } err := tx.Model(agentInfo).Updates( updateFields, ).Error if err != nil { return errs.NewError(err) } } return nil }, ) if err != nil { return false, errs.NewError(err) } return true, nil } func (s *Service) AgentChats(ctx context.Context, agentID string, messages serializers.AgentChatMessageReq) (*openai.ChatResponse, error) { var aiStr *openai.ChatResponse agentInfo, err := s.dao.FirstAgentInfo(daos.GetDBMainCtx(ctx), map[string][]interface{}{ "agent_id = ?": {agentID}, }, map[string][]interface{}{}, []string{}, ) if err != nil { return nil, errs.NewError(err) } if agentInfo != nil { aiStr, err = s.openais["Agent"].AgentChats(agentInfo.GetSystemPrompt(), s.conf.AgentOffchainChatUrl, messages) if err != nil { return nil, errs.NewError(err) } } return aiStr, nil } func (s *Service) PauseAgent(ctx context.Context, agentID string) (bool, error) { err := daos.WithTransaction( daos.GetDBMainCtx(ctx), func(tx *gorm.DB) error { agentInfo, err := s.dao.FirstAgentInfo(tx, map[string][]interface{}{ "agent_id = ?": {agentID}, }, map[string][]interface{}{}, []string{}, ) if err != nil { return errs.NewError(err) } if agentInfo != nil { isPause := !agentInfo.ReplyEnabled updateFields := map[string]interface{}{ "reply_enabled": isPause, } err := tx.Model(agentInfo).Updates( updateFields, ).Error if err != nil { return errs.NewError(err) } } return nil }, ) if err != nil { return false, errs.NewError(err) } return true, nil } func (s *Service) UpdateAgentExternalInfo(ctx context.Context, agentID string, req *serializers.AgentExternalInfoReq) (bool, error) { err := daos.WithTransaction( daos.GetDBMainCtx(ctx), func(tx *gorm.DB) error { agentInfo, err := s.dao.FirstAgentInfo(tx, map[string][]interface{}{ "agent_id = ?": {agentID}, }, map[string][]interface{}{}, []string{}, ) if err != nil { return errs.NewError(err) } if agentInfo != nil { externalInfo, err := s.dao.FirstAgentExternalInfo(tx, map[string][]interface{}{ "agent_info_id = ?": {agentInfo.ID}, "network_id = ?": {agentInfo.NetworkID}, "type = ?": {req.Type}, }, map[string][]interface{}{}, []string{}) if err != nil { return errs.NewError(err) } if externalInfo != nil { externalInfo.ExternalID = req.ExternalID externalInfo.ExternalUsername = req.ExternalUsername externalInfo.ExternalName = req.ExternalName err = s.dao.Save(tx, externalInfo) if err != nil { return errs.NewError(err) } } else { err = s.dao.Create(tx, &models.AgentExternalInfo{ NetworkID: agentInfo.NetworkID, Type: models.ExternalAgentType(req.Type), AgentInfoID: agentInfo.ID, ExternalID: req.ExternalID, ExternalUsername: req.ExternalUsername, ExternalName: req.ExternalName, }) if err != nil { return errs.NewError(err) } } } return nil }, ) if err != nil { return false, errs.NewError(err) } return true, nil } func (s *Service) CreateAgentInfoInstallCode(ctx context.Context, userAddress string, agentInfoID uint) (*models.AgentInfoInstall, error) { if agentInfoID > 0 { agentInfo, err := s.dao.FirstAgentInfoByID(daos.GetDBMainCtx(ctx), agentInfoID, map[string][]interface{}{}, true) if err != nil { return nil, errs.NewError(err) } if agentInfo == nil { return nil, errs.NewError(errs.ErrBadRequest) } } user, err := s.GetUser(daos.GetDBMainCtx(ctx), 0, userAddress, false) if err != nil { return nil, errs.NewError(err) } agentInfoInstall, err := s.dao.FirstAgentInfoInstall( daos.GetDBMainCtx(ctx), map[string][]interface{}{ "user_id = ?": {user.ID}, "agent_info_id = ?": {agentInfoID}, }, map[string][]interface{}{}, false, ) if err != nil { return nil, errs.NewError(err) } if agentInfoInstall == nil { code := helpers.RandomStringWithLength(64) params := map[string]string{"code": code} paramstr, _ := json.Marshal(params) agentInfoInstall = &models.AgentInfoInstall{ Code: code, AgentInfoID: agentInfoID, Status: models.AgenInfoInstallStatusNew, UserID: user.ID, CallbackParams: string(paramstr), } err = s.dao.Create(daos.GetDBMainCtx(ctx), agentInfoInstall) if err != nil { return nil, errs.NewError(err) } } return agentInfoInstall, nil } func (s *Service) GetAgentInfoInstall(ctx context.Context, code string) (*models.AgentInfoInstall, error) { res, err := s.dao.FirstAgentInfoInstall(daos.GetDBMainCtx(ctx), map[string][]interface{}{ "code = ?": {code}, }, map[string][]interface{}{ "User": {}, }, false, ) if err != nil { return nil, errs.NewError(err) } return res, nil } func (s *Service) CheckNameExist(ctx context.Context, networkID uint64, name string) (bool, error) { obj, err := s.dao.FirstAgentInfo( daos.GetDBMainCtx(ctx), map[string][]interface{}{ "network_id = ?": {networkID}, "agent_name = ?": {name}, }, map[string][]interface{}{}, []string{}, ) if err != nil { return false, errs.NewError(err) } if obj != nil { return true, nil } return false, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/agent_store.go ================================================ package services import ( "context" "encoding/json" "fmt" "net/http" "net/url" "strings" "time" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/daos" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/helpers" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/serializers" "github.com/jinzhu/gorm" ) func (s *Service) SaveAgentStore(ctx context.Context, userAddress string, req *serializers.AgentStoreReq) (*models.AgentStore, error) { var agentStore *models.AgentStore err := daos.WithTransaction( daos.GetDBMainCtx(ctx), func(tx *gorm.DB) error { if req.Type == "" { req.Type = models.AgentStoreTypeStore } user, err := s.GetUser(tx, 0, userAddress, false) if err != nil { return errs.NewError(err) } if req.ApiUrl != "" { hostURL, err := url.Parse(req.ApiUrl) if err != nil { return errs.NewError(err) } if hostURL.Scheme != "https" { return errs.NewError(errs.ErrBadRequest) } if !strings.Contains(hostURL.Host, ".") { return errs.NewError(errs.ErrBadRequest) } err = helpers.CurlURL(req.ApiUrl+"/health", http.MethodGet, map[string]string{}, nil, nil) if err != nil { return errs.NewError(errs.ErrApiUrlNotHealth) } } if req.ID > 0 { agentStore, err = s.dao.FirstAgentStoreByID(tx, req.ID, map[string][]interface{}{}, true) if err != nil { return errs.NewError(err) } if agentStore == nil { return errs.NewError(errs.ErrBadRequest) } if agentStore.OwnerID != user.ID { return errs.NewError(errs.ErrBadRequest) } } else { agentStore = &models.AgentStore{ Type: req.Type, StoreId: helpers.RandomBigInt(12).Text(16), OwnerID: user.ID, OwnerAddress: user.Address, Status: models.AgentStoreStatusActived, } } agentStore.Name = req.Name agentStore.Description = req.Description agentStore.AuthenUrl = req.AuthenUrl agentStore.Icon = req.Icon agentStore.Docs = req.Docs agentStore.Price = req.Price if req.Status != "" { agentStore.Status = req.Status } if agentStore.ID > 0 { err = s.dao.Save(tx, agentStore) } else { err = s.dao.Create(tx, agentStore) } if err != nil { return errs.NewError(err) } return nil }, ) if err != nil { return nil, errs.NewError(err) } return agentStore, nil } func (s *Service) GetListAgentStore(ctx context.Context, search, types string, page, limit int) ([]*models.AgentStore, uint, error) { filters := map[string][]interface{}{ "status = ?": {models.AgentStoreStatusActived}, } if types != "" { filters["type in (?)"] = []interface{}{strings.Split(types, ",")} } if search != "" { filters["name like ?"] = []interface{}{"%" + search + "%"} } res, count, err := s.dao.FindAgentStore4Page( daos.GetDBMainCtx(ctx), filters, map[string][]interface{}{ "AgentStoreMissions": {}, }, []string{"id desc"}, page, limit, ) if err != nil { return nil, 0, errs.NewError(err) } return res, count, nil } func (s *Service) GetListAgentStoreByOwner(ctx context.Context, userAddress string, page, limit int) ([]*models.AgentStore, uint, error) { user, err := s.GetUser(daos.GetDBMainCtx(ctx), 0, userAddress, false) if err != nil { return nil, 0, errs.NewError(err) } res, count, err := s.dao.FindAgentStore4Page( daos.GetDBMainCtx(ctx), map[string][]interface{}{ "owner_id = ?": {user.ID}, }, map[string][]interface{}{ "AgentStoreMissions": {}, }, []string{"id desc"}, page, limit, ) if err != nil { return nil, 0, errs.NewError(err) } return res, count, nil } func (s *Service) GetAgentStoreDetail(ctx context.Context, id uint) (*models.AgentStore, error) { res, err := s.dao.FirstAgentStoreByID(daos.GetDBMainCtx(ctx), id, map[string][]interface{}{ "AgentStoreMissions": {}, }, false, ) if err != nil { return nil, errs.NewError(err) } return res, nil } func (s *Service) SaveMissionStore(ctx context.Context, userAddress string, agentStoreID uint, req *serializers.AgentStoreMissionReq) error { var mission *models.AgentStoreMission err := daos.WithTransaction( daos.GetDBMainCtx(ctx), func(tx *gorm.DB) error { agentStore, err := s.dao.FirstAgentStoreByID(tx, agentStoreID, map[string][]interface{}{}, true) if err != nil { return errs.NewError(err) } if agentStore == nil { return errs.NewError(errs.ErrBadRequest) } if !strings.EqualFold(agentStore.OwnerAddress, userAddress) { return errs.NewError(errs.ErrBadRequest) } if req.ID > 0 { mission, err = s.dao.FirstAgentStoreMissionByID(tx, req.ID, map[string][]interface{}{}, true) if err != nil { return errs.NewError(err) } if mission == nil { return errs.NewError(errs.ErrBadRequest) } mission.Name = req.Name mission.Description = req.Description mission.UserPrompt = req.Prompt mission.ToolList = req.ToolList if req.Status != "" { mission.Status = models.AgentStoreStatus(req.Status) } } else { mission = &models.AgentStoreMission{ AgentStoreID: agentStoreID, Name: req.Name, Description: req.Description, UserPrompt: req.Prompt, Price: req.Price, ToolList: req.ToolList, Icon: req.Icon, Status: models.AgentStoreStatusActived, } } if err != nil { return errs.NewError(err) } if mission.ID > 0 { err = s.dao.Save(tx, mission) } else { err = s.dao.Create(tx, mission) } if err != nil { return errs.NewError(err) } return nil }, ) if err != nil { return errs.NewError(err) } return nil } func (s *Service) SaveAgentStoreCallback(ctx context.Context, req *serializers.AuthenAgentStoreCallback) error { err := daos.WithTransaction( daos.GetDBMainCtx(ctx), func(tx *gorm.DB) error { obj, err := s.dao.FirstAgentStoreInstall( tx, map[string][]interface{}{ "code = ?": {req.Code}, }, map[string][]interface{}{}, []string{}, ) if err != nil { return errs.NewError(err) } if obj == nil { return errs.NewError(errs.ErrBadRequest) } agentStore, err := s.dao.FirstAgentStoreByID(tx, obj.AgentStoreID, map[string][]interface{}{}, true) if err != nil { return errs.NewError(err) } if agentStore == nil { return errs.NewError(errs.ErrBadRequest) } params, _ := json.Marshal(req.CallbackParams) if string(params) != "" { obj.CallbackParams = string(params) } obj.Status = models.AgentStoreInstallStatusDone err = s.dao.Save(tx, obj) if err != nil { return errs.NewError(err) } // agentStore.NumInstall = agentStore.NumInstall + 1 err = s.dao.Save(tx, agentStore) if err != nil { return errs.NewError(err) } return nil }, ) if err != nil { return errs.NewError(err) } return nil } func (s *Service) GetListAgentStoreInstall(ctx context.Context, userAddress string, agentInfoID uint, page, limit int) ([]*models.AgentStoreInstall, uint, error) { user, err := s.GetUser(daos.GetDBMainCtx(ctx), 0, userAddress, false) if err != nil { return nil, 0, errs.NewError(err) } filter := map[string][]interface{}{ "status = ?": {models.AgentStoreInstallStatusDone}, } if agentInfoID > 0 { filter["agent_info_id = ?"] = []interface{}{agentInfoID} } else { filter["user_id = ?"] = []interface{}{user.ID} } res, count, err := s.dao.FindAgentStoreInstall4Page(daos.GetDBMainCtx(ctx), filter, map[string][]interface{}{ "AgentStore": {}, "AgentStore.AgentStoreMissions": {}, }, []string{"id desc"}, page, limit) if err != nil { return nil, 0, errs.NewError(err) } return res, count, nil } func (s *Service) CreateAgentStoreInstallCode(ctx context.Context, userAddress string, agentStoreID, agentInfoID uint) (*models.AgentStoreInstall, error) { if agentInfoID > 0 { agentInfo, err := s.dao.FirstAgentInfoByID(daos.GetDBMainCtx(ctx), agentInfoID, map[string][]interface{}{}, true) if err != nil { return nil, errs.NewError(err) } if agentInfo == nil { return nil, errs.NewError(errs.ErrBadRequest) } } user, err := s.GetUser(daos.GetDBMainCtx(ctx), 0, userAddress, false) if err != nil { return nil, errs.NewError(err) } agentStoreInstall, err := s.dao.FirstAgentStoreInstall( daos.GetDBMainCtx(ctx), map[string][]interface{}{ "user_id = ?": {user.ID}, "agent_store_id = ?": {agentStoreID}, "agent_info_id = ?": {agentInfoID}, }, map[string][]interface{}{}, []string{}, ) if err != nil { return nil, errs.NewError(err) } if agentStoreInstall == nil { code := helpers.RandomStringWithLength(64) params := map[string]string{"code": code} paramstr, _ := json.Marshal(params) agentStoreInstall = &models.AgentStoreInstall{ Code: code, AgentStoreID: agentStoreID, AgentInfoID: agentInfoID, Status: models.AgentStoreInstallStatusNew, Type: models.AgentStoreInstallTypeAgent, UserID: user.ID, CallbackParams: string(paramstr), } if agentInfoID == 0 { agentStoreInstall.Type = models.AgentStoreInstallTypeUser } err = s.dao.Create(daos.GetDBMainCtx(ctx), agentStoreInstall) if err != nil { return nil, errs.NewError(err) } } return agentStoreInstall, nil } func (s *Service) GetMissionStoreResult(ctx context.Context, userAddress string, responseID string) (string, error) { user, err := s.GetUser(daos.GetDBMainCtx(ctx), 0, userAddress, false) if err != nil { return "", errs.NewError(err) } snapshotPost, err := s.dao.FirstAgentSnapshotPost( daos.GetDBMainCtx(ctx), map[string][]interface{}{ "response_id = ?": {responseID}, }, map[string][]interface{}{}, []string{}, ) if err != nil { return "", errs.NewError(err) } if user.ID != snapshotPost.UserID { return "", errs.NewError(errs.ErrBadRequest) } err = s.UpdateOffchainAutoOutputV2ForId(ctx, snapshotPost.ID) if err != nil { return "", errs.NewError(err) } snapshotPost, err = s.dao.FirstAgentSnapshotPost( daos.GetDBMainCtx(ctx), map[string][]interface{}{ "response_id = ?": {responseID}, }, map[string][]interface{}{ "AgentSnapshotMission": {}, "AgentInfo": {}, }, []string{}, ) if err != nil { return "", errs.NewError(err) } return helpers.ConvertJsonString(&serializers.Resp{Result: serializers.NewAgentSnapshotPostResp(snapshotPost)}), nil } func (s *Service) CacheMissionStoreResult(tx *gorm.DB, responseID string) error { snapshotPost, err := s.dao.FirstAgentSnapshotPost( tx, map[string][]interface{}{ "response_id = ?": {responseID}, }, map[string][]interface{}{ "AgentSnapshotMission": {}, "AgentInfo": {}, }, []string{}, ) if err != nil { return errs.NewError(err) } err = s.CacheAgentSnapshotPost(snapshotPost) if err != nil { return errs.NewError(err) } return nil } func (s *Service) CacheAgentSnapshotPost(snapshotPost *models.AgentSnapshotPost) error { if snapshotPost != nil { cacheData, err := json.Marshal(&serializers.Resp{Result: serializers.NewAgentSnapshotPostResp(snapshotPost)}) if err != nil { errs.NewError(err) } err = s.SetRedisCachedWithKey( fmt.Sprintf(`CacheAgentSnapshotPost_%s`, strings.ToLower(snapshotPost.ResponseId)), string(cacheData), 1*time.Hour, ) if err != nil { return errs.NewError(err) } } return nil } func (s *Service) GetAgentStoreInstall(ctx context.Context, code string) (*models.AgentStoreInstall, error) { res, err := s.dao.FirstAgentStoreInstall(daos.GetDBMainCtx(ctx), map[string][]interface{}{ "code = ?": {code}, }, map[string][]interface{}{ "User": {}, }, []string{}, ) if err != nil { return nil, errs.NewError(err) } return res, nil } func (s *Service) GetTryHistory(ctx context.Context, userAddress string, agentStoreID uint) (*models.AgentStoreTry, error) { user, err := s.GetUser(daos.GetDBMainCtx(ctx), 0, userAddress, false) if err != nil { return nil, errs.NewError(err) } history, err := s.dao.FirstAgentStoreTry( daos.GetDBMainCtx(ctx), map[string][]interface{}{ "user_id = ?": {user.ID}, "agent_store_id = ?": {agentStoreID}, }, map[string][]interface{}{}, false, ) if err != nil { return nil, errs.NewError(err) } return history, nil } func (s *Service) GetTryHistoryDetail(ctx context.Context, userAddress string, historyID uint, page, limit int) ([]*models.AgentStoreTryDetail, error) { user, err := s.GetUser(daos.GetDBMainCtx(ctx), 0, userAddress, false) if err != nil { return nil, errs.NewError(err) } history, err := s.dao.FirstAgentStoreTryByID( daos.GetDBMainCtx(ctx), historyID, map[string][]interface{}{}, false, ) if err != nil { return nil, errs.NewError(err) } if history == nil { return nil, errs.NewError(errs.ErrBadRequest) } if history.UserID != user.ID { return nil, errs.NewError(errs.ErrBadRequest) } res, _, err := s.dao.FindAgentStoreTryDetail4Page(daos.GetDBMainCtx(ctx), map[string][]interface{}{ "agent_store_try_id = ?": {historyID}, }, map[string][]interface{}{ "AgentSnapshotPost": {}, }, []string{"id desc"}, page, limit) if err != nil { return nil, errs.NewError(err) } return res, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/agent_token_srv.go ================================================ package services import ( "context" "encoding/json" "fmt" "strings" "time" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/daos" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/helpers" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/serializers" "github.com/jinzhu/gorm" ) func (s *Service) GetListMemes(ctx context.Context, address string, page, limit int) ([]*models.Meme, uint, error) { filters := map[string][]interface{}{} if address != "" { filters[`memes.owner_address = ?`] = []interface{}{strings.ToLower(address)} } joinFilters := map[string][]interface{}{} selected := []string{ `memes.*`, } keys, count, err := s.dao.FindMemeJoinSelect4Page(daos.GetDBMainCtx(ctx), selected, joinFilters, filters, map[string][]interface{}{}, []string{}, page, limit, ) if err != nil { return nil, count, errs.NewError(err) } return keys, count, nil } func (s *Service) CreateMemeThread(ctx context.Context, address string, req *serializers.MemeThreadReq) (*models.MemeThreads, error) { var thread *models.MemeThreads err := daos.WithTransaction( daos.GetDBMainCtx(ctx), func(tx *gorm.DB) error { owner, err := s.GetUser(tx, models.BASE_CHAIN_ID, address, false) if err != nil { return errs.NewError(err) } thread = &models.MemeThreads{ UserID: owner.ID, MemeID: req.MemeID, Text: req.Text, ImageUrl: req.ImageUrl, ParentThreadID: req.ParentThreadID, } err = s.dao.Create(tx, thread) if err != nil { return errs.NewError(err) } meme, _ := s.dao.FirstMemeByID(tx, req.MemeID, map[string][]interface{}{}, true) meme.ReplyCount = meme.ReplyCount + 1 meme.LastReply = helpers.TimeNow() err = s.dao.Save(tx, meme) if err != nil { return errs.NewError(err) } if req.ParentThreadID > 0 { parentThread, err := s.dao.FirstMemeThreadByID(tx, req.ParentThreadID, map[string][]interface{}{}, false) if err != nil { return errs.NewError(err) } if parentThread != nil { parentUser, err := s.dao.FirstUserByID(tx, parentThread.UserID, map[string][]interface{}{}, true) if err != nil { return errs.NewError(err) } if parentUser != nil { parentUser.Mentions = parentUser.Mentions + 1 updateFields := map[string]interface{}{ "mentions": parentUser.Mentions, } err = tx.Model(parentUser).Updates( updateFields, ).Error if err != nil { return errs.NewError(err) } } } } return nil }, ) if err != nil { return nil, errs.NewError(err) } //cache latest if thread != nil { go func() error { meme, err := s.dao.FirstMemeByID(daos.GetDBMainCtx(ctx), req.MemeID, map[string][]interface{}{}, false) if err != nil { return errs.NewError(err) } if meme != nil { _ = s.CacheListMemeThreadLatest(daos.GetDBMainCtx(ctx), meme.TokenAddress) } return nil }() } return thread, nil } func (s *Service) LikeMemeThread(ctx context.Context, address string, req *serializers.MemeThreadReq) (bool, error) { err := daos.WithTransaction( daos.GetDBMainCtx(ctx), func(tx *gorm.DB) error { owner, err := s.GetUser(tx, models.BASE_CHAIN_ID, address, false) if err != nil { return errs.NewError(err) } threadLike := &models.MemeThreadLike{ UserID: owner.ID, ThreadID: req.ThreadID, } err = s.dao.Create(tx, threadLike) if err != nil { return errs.NewError(err) } thread, _ := s.dao.FirstMemeThreadByID(tx, threadLike.ThreadID, map[string][]interface{}{}, true) thread.Likes = thread.Likes + 1 updateFields := map[string]interface{}{ "likes": thread.Likes, } err = tx.Model(thread).Updates( updateFields, ).Error if err != nil { return errs.NewError(err) } threadOwner, err := s.dao.FirstUserByID(tx, thread.UserID, map[string][]interface{}{}, true) if err != nil { return errs.NewError(err) } if threadOwner != nil { threadOwner.Likes = threadOwner.Likes + 1 updateFields = map[string]interface{}{ "likes": threadOwner.Likes, } err = tx.Model(threadOwner).Updates( updateFields, ).Error if err != nil { return errs.NewError(err) } } return nil }, ) if err != nil { return false, errs.NewError(err) } return true, nil } func (s *Service) UnLikeMemeThread(ctx context.Context, address string, req *serializers.MemeThreadReq) (bool, error) { err := daos.WithTransaction( daos.GetDBMainCtx(ctx), func(tx *gorm.DB) error { owner, err := s.GetUser(tx, models.BASE_CHAIN_ID, address, false) if err != nil { return errs.NewError(err) } threadLike, err := s.dao.FirstMemeThreadLike(tx, map[string][]interface{}{ "user_id = ?": {owner.ID}, "thread_id = ?": {req.ThreadID}, }, map[string][]interface{}{}, []string{}, ) if err != nil { return errs.NewError(err) } if threadLike != nil { err := s.dao.DeleteUnscoped(tx, threadLike) if err != nil { return errs.NewError(err) } thread, _ := s.dao.FirstMemeThreadByID(tx, threadLike.ThreadID, map[string][]interface{}{}, true) thread.Likes = thread.Likes - 1 if thread.Likes < 0 { thread.Likes = 0 } updateFields := map[string]interface{}{ "likes": thread.Likes, } err = tx.Model(thread).Updates( updateFields, ).Error if err != nil { return errs.NewError(err) } threadOwner, err := s.dao.FirstUserByID(tx, thread.UserID, map[string][]interface{}{}, true) if err != nil { return errs.NewError(err) } if threadOwner != nil { threadOwner.Likes = threadOwner.Likes - 1 if threadOwner.Likes < 0 { threadOwner.Likes = 0 } updateFields = map[string]interface{}{ "likes": threadOwner.Likes, } err = tx.Model(threadOwner).Updates( updateFields, ).Error if err != nil { return errs.NewError(err) } } } return nil }, ) if err != nil { return false, errs.NewError(err) } return true, nil } func (s *Service) GetListMemeThread(ctx context.Context, userAddress, tokenAddress string, page, limit int) ([]*models.MemeThreads, uint, error) { filters := map[string][]interface{}{ "hidden = 0": {}, } joinFilters := map[string][]interface{}{} selected := []string{ "meme_threads.*", } if tokenAddress != "" { joinFilters[`join memes on memes.id=meme_threads.meme_id and memes.token_address = ?`] = []interface{}{strings.ToLower(tokenAddress)} } if userAddress != "" { joinFilters[`join users on users.id=meme_threads.user_id`] = []interface{}{} joinFilters[`left join meme_thread_likes on meme_thread_likes.user_id = users.id and meme_threads.id = meme_thread_likes.thread_id`] = []interface{}{} selected = append(selected, "(case when meme_thread_likes.id is null then false else true end) liked") } keys, err := s.dao.FindMemeThreadJoinSelect(daos.GetDBMainCtx(ctx), selected, joinFilters, filters, map[string][]interface{}{ "User": []interface{}{}, }, []string{"created_at desc"}, page, limit, ) if err != nil { return nil, 0, errs.NewError(err) } return keys, 0, nil } func (s *Service) GetListMemeThreadLatest(ctx context.Context, tokenAddress string) (string, error) { var resp string cacheKey := fmt.Sprintf(`GetListMemeThreadLatest_%s`, strings.ToLower(tokenAddress)) err := s.GetRedisCachedWithKey(cacheKey, &resp) if err != nil { s.CacheListMemeThreadLatest(daos.GetDBMainCtx(ctx), tokenAddress) s.GetRedisCachedWithKey(cacheKey, &resp) } return resp, nil } func (s *Service) CacheListMemeThreadLatest(tx *gorm.DB, tokenAddress string) error { filters := map[string][]interface{}{ "hidden = 0": {}, } joinFilters := map[string][]interface{}{ `join memes on memes.id = meme_threads.meme_id and memes.token_address = ?`: {strings.ToLower(tokenAddress)}, } selected := []string{"meme_threads.*"} threads, err := s.dao.FindMemeThreadJoinSelect(tx, selected, joinFilters, filters, map[string][]interface{}{ "User": []interface{}{}, }, []string{"id desc"}, 1, 20, ) if err != nil { return errs.NewError(err) } cacheData, err := json.Marshal(&serializers.Resp{Result: serializers.NewMemeThreadRespArry(threads)}) if err != nil { errs.NewError(err) } err = s.SetRedisCachedWithKey( fmt.Sprintf(`GetListMemeThreadLatest_%s`, strings.ToLower(tokenAddress)), string(cacheData), 1*time.Hour, ) if err != nil { return errs.NewError(err) } return nil } // ///user func (s *Service) FollowUsers(ctx context.Context, address string, req *serializers.MemeThreadReq) (bool, error) { err := daos.WithTransaction( daos.GetDBMainCtx(ctx), func(tx *gorm.DB) error { owner, err := s.GetUser(tx, models.BASE_CHAIN_ID, address, false) if err != nil { return errs.NewError(err) } toUser, err := s.GetUser(tx, models.BASE_CHAIN_ID, req.UserAddress, false) if err != nil { return errs.NewError(err) } userFollow := &models.MemeFollowers{ UserID: owner.ID, FollowUserID: toUser.ID, } err = s.dao.Create(tx, userFollow) if err != nil { return errs.NewError(err) } toUser, _ = s.dao.FirstUserByID(tx, toUser.ID, map[string][]interface{}{}, true) toUser.Followers = toUser.Followers + 1 err = s.dao.Save(tx, toUser) if err != nil { return errs.NewError(err) } owner, _ = s.dao.FirstUserByID(tx, owner.ID, map[string][]interface{}{}, true) owner.Following = owner.Following + 1 err = s.dao.Save(tx, owner) if err != nil { return errs.NewError(err) } _ = s.CreateMemeNotifications(daos.GetDBMainCtx(ctx), toUser.ID, 0, owner.ID, models.NotiTypeNewFollower, fmt.Sprintf("%s_%d", models.NotiTypeNewFollower, owner.ID)) return nil }, ) if err != nil { return false, errs.NewError(err) } return true, nil } func (s *Service) UnFollowUsers(ctx context.Context, address string, req *serializers.MemeThreadReq) (bool, error) { err := daos.WithTransaction( daos.GetDBMainCtx(ctx), func(tx *gorm.DB) error { owner, err := s.GetUser(tx, models.BASE_CHAIN_ID, address, false) if err != nil { return errs.NewError(err) } toUser, err := s.GetUser(tx, models.BASE_CHAIN_ID, req.UserAddress, false) if err != nil { return errs.NewError(err) } userFollow, err := s.dao.FirstMemeFollowers(tx, map[string][]interface{}{ "user_id = ?": {owner.ID}, "follow_user_id = ?": {toUser.ID}, }, map[string][]interface{}{}, []string{}, ) if err != nil { return errs.NewError(err) } if userFollow != nil { err := s.dao.DeleteUnscoped(tx, userFollow) if err != nil { return errs.NewError(err) } toUser, _ = s.dao.FirstUserByID(tx, toUser.ID, map[string][]interface{}{}, true) toUser.Followers = toUser.Followers - 1 if toUser.Followers < 0 { toUser.Followers = 0 } updateFields := map[string]interface{}{ "followers": toUser.Followers, } err = tx.Model(toUser).Updates(updateFields).Error if err != nil { return errs.NewError(err) } owner, _ = s.dao.FirstUserByID(tx, owner.ID, map[string][]interface{}{}, true) owner.Following = owner.Following - 1 if toUser.Following < 0 { toUser.Following = 0 } updateFields = map[string]interface{}{ "following": owner.Following, } err = tx.Model(owner).Updates(updateFields).Error if err != nil { return errs.NewError(err) } return nil } return nil }, ) if err != nil { return false, errs.NewError(err) } return true, nil } func (s *Service) ValidatedFollowed(ctx context.Context, address, userAddress string) (bool, error) { filters := map[string][]interface{}{} joinFilters := map[string][]interface{}{ `join users u on u.id=meme_followers.follow_user_id and u.address = ?`: {strings.ToLower(userAddress)}, `join users f on f.id=meme_followers.user_id and f.address = ?`: {strings.ToLower(address)}, } selected := []string{ "meme_followers.*", } follow, err := s.dao.FirstMemeFollowersJoinSelect(daos.GetDBMainCtx(ctx), selected, joinFilters, filters, map[string][]interface{}{}, []string{}, ) if err != nil { return false, errs.NewError(err) } if follow != nil { return true, nil } return false, nil } func (s *Service) GetListFollowings(ctx context.Context, userAddress string, page, limit int) ([]*models.MemeFollowers, uint, error) { filters := map[string][]interface{}{} joinFilters := map[string][]interface{}{ `join users on users.id=meme_followers.user_id and users.address = ?`: {strings.ToLower(userAddress)}, } selected := []string{ "meme_followers.*", } keys, err := s.dao.FindMemeFollowersJoinSelect(daos.GetDBMainCtx(ctx), selected, joinFilters, filters, map[string][]interface{}{ "FollowUser": []interface{}{}, }, []string{"created_at desc"}, page, limit, ) if err != nil { return nil, 0, errs.NewError(err) } return keys, 0, nil } func (s *Service) CreateMemeNotifications(tx *gorm.DB, userID, memeID, followerID uint, notiType models.NotiType, eventID string) error { isNew := false var inst *models.MemeNotification var err error inst, err = s.dao.FirstMemeNotification(tx, map[string][]interface{}{ "event_id = ?": {strings.ToLower(eventID)}, }, map[string][]interface{}{}, []string{}, ) if err != nil { return errs.NewError(err) } if inst == nil { inst = &models.MemeNotification{ EventId: strings.ToLower(eventID), UserID: userID, MemeID: memeID, FollowerID: followerID, NotiType: notiType, } err = s.dao.Create(tx, inst) if err != nil { return errs.NewError(err) } isNew = true return nil } if err != nil { return errs.NewError(err) } if isNew && userID > 0 { _ = s.CacheNotificationsLatest(tx, userID) } return nil } func (s *Service) CacheNotificationsLatest(tx *gorm.DB, userID uint) error { filters := map[string][]interface{}{ "user_id = ? or user_id = 0": {userID}, } joinFilters := map[string][]interface{}{} selected := []string{} noties, err := s.dao.FindMemeNotificationJoinSelect(tx, selected, joinFilters, filters, map[string][]interface{}{ "Meme": []interface{}{}, "Follower": []interface{}{}, }, []string{"created_at desc"}, 1, 20, ) if err != nil { errs.NewError(err) } cacheData, err := json.Marshal(&serializers.Resp{Result: serializers.NewMemeNotificationRespArry(noties)}) if err != nil { errs.NewError(err) } err = s.SetRedisCachedWithKey( fmt.Sprintf(`CacheNotificationsLatest_%d`, userID), string(cacheData), 1*time.Hour, ) if err != nil { return errs.NewError(err) } return nil } // / func (s *Service) GetMemeNotifications(ctx context.Context, userAddress string, page, limit int) ([]*models.MemeNotification, uint, error) { filters := map[string][]interface{}{} joinFilters := map[string][]interface{}{ ` left join users on users.id=meme_notifications.user_id left join meme_notification_seens mns on mns.notification_id = meme_notifications.id and mns.user_id = users.id `: {}, } selected := []string{ "(case when meme_notifications.seen = 0 then ifnull(mns.seen, 0) else meme_notifications.seen end) seen", `meme_notifications.*`, } if userAddress != "" { filters["users.address = ? or meme_notifications.user_id = 0"] = []interface{}{strings.ToLower(userAddress)} } keys, err := s.dao.FindMemeNotificationJoinSelect(daos.GetDBMainCtx(ctx), selected, joinFilters, filters, map[string][]interface{}{ "Meme": []interface{}{}, "Follower": []interface{}{}, }, []string{"created_at desc"}, page, limit, ) if err != nil { return nil, 0, errs.NewError(err) } return keys, 0, nil } func (s *Service) GetMemeNotificationLatest(ctx context.Context, userAddress string) (string, error) { var resp string user, err := s.GetUser(daos.GetDBMainCtx(ctx), models.BASE_CHAIN_ID, userAddress, false) if err != nil { return "", errs.NewError(err) } cacheKey := fmt.Sprintf(`CacheNotificationsLatest_%d`, user.ID) err = s.GetRedisCachedWithKey(cacheKey, &resp) if err != nil { s.CacheNotificationsLatest(daos.GetDBMainCtx(ctx), user.ID) s.GetRedisCachedWithKey(cacheKey, &resp) } return resp, nil } func (s *Service) HideMemeThread(ctx context.Context, address string, threadID uint) (bool, error) { inst, err := s.dao.FirstMemeWhiteListAddress(daos.GetDBMainCtx(ctx), map[string][]interface{}{ "address = ?": {strings.ToLower(address)}, }, map[string][]interface{}{}, []string{}, ) if err != nil { return false, errs.NewError(err) } if inst == nil { return false, errs.NewError(errs.ErrBadRequest) } thread, _ := s.dao.FirstMemeThreadByID(daos.GetDBMainCtx(ctx), threadID, map[string][]interface{}{ "Meme": {}, }, false) if err != nil { return false, errs.NewError(err) } updateFields := map[string]interface{}{ "hidden": true, } err = daos.GetDBMainCtx(ctx).Model(thread).Updates( updateFields, ).Error if thread.Meme != nil { s.CacheListMemeThreadLatest(daos.GetDBMainCtx(ctx), thread.Meme.TokenAddress) } if err != nil { return false, errs.NewError(err) } return true, nil } func (s *Service) UserSeenMemeNotification(ctx context.Context, address string, notiID uint) (bool, error) { user, err := s.GetUser(daos.GetDBMainCtx(ctx), models.BASE_CHAIN_ID, address, false) if err != nil { return false, errs.NewError(err) } inst, err := s.dao.FirstMemeNotificationByID(daos.GetDBMainCtx(ctx), notiID, map[string][]interface{}{}, false, ) if err != nil { return false, errs.NewError(err) } if inst == nil { return false, errs.NewError(errs.ErrBadRequest) } if inst.UserID > 0 { if inst.UserID == user.ID && !inst.Seen { updateFields := map[string]interface{}{ "seen": true, } err = daos.GetDBMainCtx(ctx).Model(inst).Updates( updateFields, ).Error if err != nil { return false, errs.NewError(err) } } } else { instSeen, err := s.dao.FirstMemeNotificationSeen(daos.GetDBMainCtx(ctx), map[string][]interface{}{ "notification_id = ?": {inst.ID}, "user_id = ?": {user.ID}, }, map[string][]interface{}{}, []string{}, ) if err != nil { return false, errs.NewError(err) } if instSeen == nil { instSeen = &models.MemeNotificationSeen{ NotificationID: inst.ID, UserID: user.ID, Seen: true, } err = s.dao.Create(daos.GetDBMainCtx(ctx), instSeen) if err != nil { return false, errs.NewError(err) } } } return true, nil } func (s *Service) GenerateMemeStory(ctx context.Context, memeName string) (string, error) { aiMsg := fmt.Sprintf(` I have a token called %s It's a meme token, and I need a meme story for marketing purposes. Please create a narrative about the token that is under 500 characters. `, memeName, ) whitePaperStr, err := s.openais["Lama"].ChatMessage(aiMsg) if err != nil { return "", errs.NewError(err) } return whitePaperStr, nil } func (s *Service) CalculateFunnyWeightMeme(ctx context.Context, memeID uint) error { err := daos.WithTransaction( daos.GetDBMainCtx(ctx), func(tx *gorm.DB) error { meme, err := s.dao.FirstMemeByID(tx, memeID, map[string][]interface{}{}, false) if err != nil { return errs.NewError(err) } if meme == nil { return errs.NewError(errs.ErrBadRequest) } aiMsg := fmt.Sprintf(` Name: %s Symbol: %s Story: %s Number of comments: %d This is information of a meme token, including its name, symbol, the story information and number of community discussion. Please evaluate the humor, appeal, vibrant, and creativity of the story for each meme and return a weight from 1 to 100 corresponding to the ID this meme. Please just return number of weight. `, meme.Name, meme.Ticker, meme.Description, meme.ReplyCount) aiStr, err := s.openais["Lama"].ChatMessage(aiMsg) if err != nil { return errs.NewError(err) } if aiStr != "" { memeWeight := helpers.GetNumberFromString(aiStr) if memeWeight > 0 { err = daos.GetDBMainCtx(ctx). Model(meme). Updates( map[string]interface{}{ "weight": memeWeight, }, ).Error if err != nil { return errs.NewError(err) } } } return nil }, ) if err != nil { return errs.NewError(err) } return nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/agent_trading.go ================================================ package services import ( "context" "fmt" "math" "math/big" "time" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/daos" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/helpers" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/serializers" blockchainutils "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/blockchain_utils" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/coinmarketcap" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/types/numeric" "github.com/jinzhu/gorm" ) func (s *Service) DexSpotPairsLatest(ctx context.Context, quoteAssetSymbol, networkSlug string) (*coinmarketcap.DexSpotPairsLatestResp, error) { return s.cmc.DexSpotPairsLatest(quoteAssetSymbol, networkSlug) } func (s *Service) DexPairsTradeLatest(ctx context.Context, contractAddress, networkSlug string) (*coinmarketcap.DexPairsTradeLatestResp, error) { return s.cmc.DexPairsTradeLatest(contractAddress, networkSlug) } func (s *Service) DexScreenInfo(ctx context.Context, contractAddress string) (interface{}, error) { coinInfo, err := s.dexscreener.SearchPairs(contractAddress) if err != nil { return nil, errs.NewError(err) } var resp struct { ChainId string `json:"chain_id"` DexId string `json:"dex_id"` PriceNative string `json:"price_native"` PriceUsd string `json:"price_usd"` Volume *struct { H24 float64 `json:"h24"` H6 float64 `json:"h6"` H1 float64 `json:"h1"` M5 float64 `json:"m5"` } `json:"volume_usd"` PriceChange *struct { H24 float64 `json:"h24"` H6 float64 `json:"h6"` H1 float64 `json:"h1"` M5 float64 `json:"m5"` } `json:"price_change_percent"` Fdv uint64 `json:"fdv_usd"` MarketCap uint64 `json:"market_cap_usd"` } if coinInfo != nil { resp.ChainId = coinInfo.ChainId resp.DexId = coinInfo.DexId resp.PriceNative = coinInfo.PriceNative resp.PriceUsd = coinInfo.PriceUsd resp.Volume = coinInfo.Volume resp.PriceChange = coinInfo.PriceChange resp.Fdv = coinInfo.Fdv resp.MarketCap = coinInfo.MarketCap return resp, nil } return nil, errs.NewError(errs.ErrTokenNotFound) } func (s *Service) GetAgentWallet(tx *gorm.DB, networkID uint64, agentInfoID uint) (*models.AgentWallet, error) { agentWallet, err := s.dao.FirstAgentWallet( tx, map[string][]interface{}{ "network_id = ?": {networkID}, "agent_info_id = ?": {agentInfoID}, }, map[string][]interface{}{}, []string{}, ) if err != nil { return nil, errs.NewError(err) } if agentWallet == nil { agent, err := s.dao.FirstAgentInfoByID( tx, agentInfoID, map[string][]interface{}{}, false, ) if err != nil { return nil, errs.NewError(err) } var address string var cdpWalletID string switch networkID { case models.ETHEREUM_CHAIN_ID, models.BASE_CHAIN_ID, models.ARBITRUM_CHAIN_ID, models.BSC_CHAIN_ID: { address = agent.TipEthAddress } case models.BTC_CHAIN_ID: { address = agent.TipBtcAddress } case models.SOLANA_CHAIN_ID: { address = agent.TipSolAddress } } if address == "" { return nil, errs.NewError(errs.ErrBadRequest) } agentWallet = &models.AgentWallet{ NetworkID: networkID, AgentInfoID: agentInfoID, Address: address, CdpWalletID: cdpWalletID, } err = s.dao.Create(tx, agentWallet) if err != nil { return nil, errs.NewError(err) } } return agentWallet, nil } func (s *Service) GetTokenQuoteLatestForSolana(ctx context.Context, mint string) (any, error) { m, err := s.dao.FirstAgentTradeToken( daos.GetDBMainCtx(ctx), map[string][]interface{}{ "network_id = ?": {models.SOLANA_CHAIN_ID}, "token_address = ?": {mint}, }, map[string][]interface{}{}, []string{}, ) if err != nil || m.CmcId == "" { return nil, errs.NewError(err) } if m == nil { return nil, nil } resp, err := s.cmc.GetQuotesLatest([]string{m.CmcId}) if err != nil { return nil, errs.NewError(err) } return resp[m.CmcId], nil } func (s *Service) GetSolanaTokenDecimals(mint string) (int, error) { var decimals int err := s.RedisCached( fmt.Sprintf("GetSolanaTokenDecimals_%s", mint), true, 999999*time.Hour, &decimals, func() (interface{}, error) { mintInfo, err := s.blockchainUtils.SolanaTokenInfo(mint) if err != nil { return nil, errs.NewError(err) } if mintInfo == nil || mintInfo.Data == nil || mintInfo.Data.Parsed == nil || mintInfo.Data.Parsed.Info == nil { return nil, errs.NewError(errs.ErrBadRequest) } return mintInfo.Data.Parsed.Info.Decimals, nil }, ) if err != nil { return 0, errs.NewError(err) } return decimals, nil } func (s *Service) AgentWalletCreatePumpFunMeme(ctx context.Context, networkID uint64, agentContractID string, req *serializers.AdminCreatePumpfunMemeReq) error { agent, err := s.dao.FirstAgentInfo( daos.GetDBMainCtx(ctx), map[string][]interface{}{ "network_id = ?": {networkID}, "agent_contract_id = ?": {agentContractID}, }, map[string][]interface{}{}, []string{}, ) if err != nil { return errs.NewError(err) } if agent == nil || agent.TwitterInfoID == 0 { return errs.NewError(errs.ErrBadRequest) } wallet, err := s.GetAgentWallet(daos.GetDBMainCtx(ctx), models.SOLANA_CHAIN_ID, agent.ID) if err != nil { return errs.NewError(err) } m := &models.AgentWalletAction{ NetworkID: models.SOLANA_CHAIN_ID, AgentInfoID: agent.ID, AgentWalletID: wallet.ID, ActionInput: helpers.ConvertJsonString(map[string]interface{}{ "action_input": req, }), } err = s.dao.Create( daos.GetDBMainCtx(ctx), m, ) if err != nil { return errs.NewError(err) } resp, err := s.blockchainUtils.SolanaCreatePumpfunToken( &blockchainutils.SolanaCreatePumpfunTokenReq{ Address: wallet.Address, Name: req.Name, Symbol: req.Symbol, Description: req.Description, Twitter: fmt.Sprintf("https://x.com/%s", agent.TwitterUsername), Telegram: "", Website: "", Amount: req.Amount, ImageBase64: req.ImageBase64, }, ) if err != nil { err = daos.GetDBMainCtx(ctx).Model(m). UpdateColumn("action_output", err.Error()). UpdateColumn("status", models.AgentWalletActionStatusError).Error if err != nil { return errs.NewError(err) } } else { err = daos.GetDBMainCtx(ctx).Model(m). UpdateColumn("action_output", helpers.ConvertJsonString(map[string]interface{}{ "action_output": resp, })). UpdateColumn("status", models.AgentWalletActionStatusDone).Error if err != nil { return errs.NewError(err) } } return nil } func (s *Service) AgentWalletTradePumpFunMeme(ctx context.Context, networkID uint64, agentContractID string, req *serializers.AdminTradePumpfunMemeReq) error { agent, err := s.dao.FirstAgentInfo( daos.GetDBMainCtx(ctx), map[string][]interface{}{ "network_id = ?": {networkID}, "agent_contract_id = ?": {agentContractID}, }, map[string][]interface{}{}, []string{}, ) if err != nil { return errs.NewError(err) } if agent == nil || agent.TwitterInfoID == 0 { return errs.NewError(errs.ErrBadRequest) } wallet, err := s.GetAgentWallet(daos.GetDBMainCtx(ctx), models.SOLANA_CHAIN_ID, agent.ID) if err != nil { return errs.NewError(err) } var snapshotPostID, snapshotMissionID uint var toolSet models.ToolsetType if req.RefID != "" { snapshotPost, _ := s.dao.FirstAgentSnapshotPost( daos.GetDBMainCtx(ctx), map[string][]interface{}{ "infer_tx_hash = ?": {req.RefID}, }, map[string][]interface{}{ "AgentSnapshotMission": {}, }, []string{}, ) if snapshotPost != nil { snapshotPostID = snapshotPost.ID snapshotMissionID = snapshotPost.AgentSnapshotMissionID if snapshotPost.AgentSnapshotMission != nil { toolSet = snapshotPost.AgentSnapshotMission.ToolSet } } } m := &models.AgentWalletAction{ NetworkID: models.SOLANA_CHAIN_ID, AgentInfoID: agent.ID, AgentWalletID: wallet.ID, ActionType: "trade_pumpfun", ActionInput: helpers.ConvertJsonString(map[string]interface{}{ "action_input": req, }), RefID: req.RefID, Toolset: string(toolSet), AgentSnapshotMissionID: snapshotMissionID, AgentSnapshotPostID: snapshotPostID, } err = s.dao.Create( daos.GetDBMainCtx(ctx), m, ) if err != nil { return errs.NewError(err) } coinInfo, err := s.pumfunAPI.GetPumpFunCoinInfo(req.Mint) if err != nil { return errs.NewError(err) } pool := "pump" if coinInfo.RaydiumPool != "" { pool = "raydium" } resp, err := s.blockchainUtils.SolanaTradePumpfunToken( &blockchainutils.SolanaTradePumpfunTokenReq{ Address: wallet.Address, Action: req.Action, Mint: req.Mint, Amount: req.Amount, Pool: pool, }, ) if err != nil { err = daos.GetDBMainCtx(ctx).Model(m). UpdateColumn("action_output", err.Error()). UpdateColumn("status", models.AgentWalletActionStatusError).Error if err != nil { return errs.NewError(err) } } else { err = daos.GetDBMainCtx(ctx).Model(m). UpdateColumn("action_output", helpers.ConvertJsonString(map[string]interface{}{ "action_output": resp, })). UpdateColumn("status", models.AgentWalletActionStatusDone).Error if err != nil { return errs.NewError(err) } } return nil } func (s *Service) AgentWalletTradeRaydiumToken(ctx context.Context, networkID uint64, agentContractID string, req *serializers.AdminTradePumpfunMemeReq) error { agent, err := s.dao.FirstAgentInfo( daos.GetDBMainCtx(ctx), map[string][]interface{}{ "network_id = ?": {networkID}, "agent_contract_id = ?": {agentContractID}, }, map[string][]interface{}{}, []string{}, ) if err != nil { return errs.NewError(err) } if agent == nil || agent.TwitterInfoID == 0 { return errs.NewError(errs.ErrBadRequest) } wallet, err := s.GetAgentWallet(daos.GetDBMainCtx(ctx), models.SOLANA_CHAIN_ID, agent.ID) if err != nil { return errs.NewError(err) } var snapshotPostID, snapshotMissionID uint var toolSet models.ToolsetType if req.RefID != "" { snapshotPost, _ := s.dao.FirstAgentSnapshotPost( daos.GetDBMainCtx(ctx), map[string][]interface{}{ "infer_tx_hash = ?": {req.RefID}, }, map[string][]interface{}{ "AgentSnapshotMission": {}, }, []string{}, ) if snapshotPost != nil { snapshotPostID = snapshotPost.ID snapshotMissionID = snapshotPost.AgentSnapshotMissionID if snapshotPost.AgentSnapshotMission != nil { toolSet = snapshotPost.AgentSnapshotMission.ToolSet } } } m := &models.AgentWalletAction{ NetworkID: models.SOLANA_CHAIN_ID, AgentInfoID: agent.ID, AgentWalletID: wallet.ID, ActionType: "trade_raydium", ActionInput: helpers.ConvertJsonString(map[string]interface{}{ "action_input": req, }), RefID: req.RefID, Toolset: string(toolSet), AgentSnapshotMissionID: snapshotMissionID, AgentSnapshotPostID: snapshotPostID, } err = s.dao.Create( daos.GetDBMainCtx(ctx), m, ) if err != nil { return errs.NewError(err) } var inputMint, outputMint string var decimalsIn int switch req.Action { case "buy": { inputMint = "So11111111111111111111111111111111111111112" outputMint = req.Mint decimalsIn = 9 } case "sell": { inputMint = req.Mint outputMint = "So11111111111111111111111111111111111111112" decimalsMint, err := s.GetSolanaTokenDecimals(req.Mint) if err != nil { return errs.NewError(err) } decimalsIn = decimalsMint } default: { return errs.NewError(errs.ErrBadContent) } } resp, err := s.blockchainUtils.SolanaTradeRaydiumToken( &blockchainutils.SolanaTradeRaydiumTokenReq{ Address: wallet.Address, InputMint: inputMint, OutputMint: outputMint, Slippage: 0.5, Amount: uint64(req.Amount * math.Pow10(decimalsIn)), }, ) if err != nil { err = daos.GetDBMainCtx(ctx).Model(m). UpdateColumn("action_output", err.Error()). UpdateColumn("status", models.AgentWalletActionStatusError).Error if err != nil { return errs.NewError(err) } } else { err = daos.GetDBMainCtx(ctx).Model(m). UpdateColumn("action_output", helpers.ConvertJsonString(map[string]interface{}{ "action_output": resp, })). UpdateColumn("status", models.AgentWalletActionStatusDone).Error if err != nil { return errs.NewError(err) } } err = s.MigrateWalletActionForID(ctx, m.ID) if err != nil { return errs.NewError(err) } return nil } func (s *Service) AgentWalletGetSolanaTokenBalances(ctx context.Context, networkID uint64, agentContractID string) ([]*serializers.SolanaTokenBalanceResp, error) { agent, err := s.dao.FirstAgentInfo( daos.GetDBMainCtx(ctx), map[string][]interface{}{ "network_id = ?": {networkID}, "agent_contract_id = ?": {agentContractID}, }, map[string][]interface{}{}, []string{}, ) if err != nil { return nil, errs.NewError(err) } if agent == nil { return nil, errs.NewError(errs.ErrBadRequest) } wallet, err := s.GetAgentWallet(daos.GetDBMainCtx(ctx), models.SOLANA_CHAIN_ID, agent.ID) if err != nil { return nil, errs.NewError(err) } balances, err := s.blockchainUtils.SolanaGetTokenBalances(wallet.Address) if err != nil { return nil, errs.NewError(err) } resps := []*serializers.SolanaTokenBalanceResp{} for _, v := range balances { if v.TokenAmount.UIAmount > 0 { resps = append(resps, &serializers.SolanaTokenBalanceResp{ IsNative: v.IsNative, Mint: v.Mint, Amount: v.TokenAmount.UIAmount, }) } } return resps, nil } func (s *Service) GetPumpFunTrades(ctx context.Context, mint string, page int, limit int) ([]*serializers.PumpFunTradeResp, error) { tknDecimals, err := s.GetSolanaTokenDecimals(mint) if err != nil { return nil, errs.NewError(err) } trades, err := s.pumfunAPI.GetPumpFunTrades(mint, page, limit) if err != nil { return nil, errs.NewError(err) } resps := []*serializers.PumpFunTradeResp{} for _, v := range trades { resps = append(resps, &serializers.PumpFunTradeResp{ Signature: v.Signature, Mint: v.Mint, SolAmount: float64(v.SolAmount) / math.Pow10(9), TokenAmount: float64(v.TokenAmount) / math.Pow10(tknDecimals), IsBuy: v.IsBuy, Timestamp: v.Timestamp, }) } return resps, nil } func (s *Service) GetPumpFunTokenPrice(ctx context.Context, mint string) (float64, error) { solPrice, _ := s.GetTokenMarketPrice(daos.GetDBMainCtx(ctx), string(models.BaseTokenSymbolSOL)).Float64() price, err := func() (float64, error) { coinInfo, err := s.pumfunAPI.GetPumpFunCoinInfo(mint) if err != nil { return 0, errs.NewError(err) } if coinInfo == nil || coinInfo.Mint == "" { return 0, errs.NewError(errs.ErrBadRequest) } tknDecimals, err := s.GetSolanaTokenDecimals(mint) if err != nil { return 0, errs.NewError(err) } return coinInfo.UsdMarketCap / (float64(coinInfo.TotalSupply) / math.Pow10(tknDecimals)) / solPrice, nil }() if err != nil { price, err = func() (float64, error) { m, err := s.dao.FirstAgentTradeToken( daos.GetDBMainCtx(ctx), map[string][]interface{}{ "network_id = ?": {models.SOLANA_CHAIN_ID}, "token_address = ?": {mint}, }, map[string][]interface{}{}, []string{}, ) if err != nil || m.CmcId == "" { return 0, errs.NewError(fmt.Errorf("coin not found")) } resp, err := s.cmc.GetQuotesLatest([]string{m.CmcId}) if err != nil { return 0, errs.NewError(err) } if resp[m.CmcId] == nil { return 0, errs.NewError(fmt.Errorf("coin not found")) } usdPrice, _ := resp[m.CmcId].Quote.USD.Price.Float64() return usdPrice / solPrice, nil }() if err != nil { return 0, errs.NewError(err) } } return price, nil } func (s *Service) GetSolanaDataChart24Hour(ctx context.Context, mint string) ([]*serializers.DataChartResp, error) { resps := []*serializers.DataChartResp{} mintInfo, err := s.cgc.GetSolanaTokenInfo(mint) if err != nil { return nil, errs.NewError(err) } charts, err := s.cgc.GetCoinMarketChart(mintInfo.ID, "USD") if err != nil { return nil, errs.NewError(err) } for _, v := range charts { resps = append(resps, &serializers.DataChartResp{ Time: v.Timestamp, Price: v.Price, }) } return resps, nil } func (s *Service) GetAgentWalletSolanaTrades(ctx context.Context, networkID uint64, agentContractID string, mint string, page int, limit int) ([]*serializers.WalletActionTradeResp, error) { agent, err := s.dao.FirstAgentInfo( daos.GetDBMainCtx(ctx), map[string][]interface{}{ "network_id = ?": {networkID}, "agent_contract_id = ?": {agentContractID}, }, map[string][]interface{}{}, []string{}, ) if err != nil { return nil, errs.NewError(err) } if agent == nil { return nil, errs.NewError(errs.ErrBadRequest) } filters := map[string][]interface{}{ "agent_info_id = ?": {agent.ID}, "status = ?": {models.AgentWalletActionStatusDone}, "action_type = ?": {"trade_raydium"}, } if mint != "" { filters["mint = ?"] = []interface{}{mint} } waMs, _, err := s.dao.FindAgentWalletAction4Page( daos.GetDBMainCtx(ctx), filters, make(map[string][]interface{}), []string{ "id desc", }, page, limit, ) if err != nil { return nil, errs.NewError(err) } resps := []*serializers.WalletActionTradeResp{} for _, waM := range waMs { resps = append(resps, &serializers.WalletActionTradeResp{ CreatedAt: waM.CreatedAt, Mint: waM.Mint, Side: waM.Side, AmountIn: waM.AmountIn, AmountOut: waM.AmountOut, TxHash: waM.TxHash, }) } return resps, nil } func (s *Service) JobMigrateWalletActions(ctx context.Context) error { waMs, err := s.dao.FindAgentWalletAction( daos.GetDBMainCtx(ctx), map[string][]interface{}{ "status = ?": {models.AgentWalletActionStatusDone}, "tx_hash is null or tx_hash = ?": {""}, }, make(map[string][]interface{}), []string{ "id desc", }, 0, 999999, ) if err != nil { return errs.NewError(err) } for _, waM := range waMs { err = s.MigrateWalletActionForID(ctx, waM.ID) if err != nil { return errs.NewError(err) } } return nil } func (s *Service) MigrateWalletActionForID(ctx context.Context, walletActionID uint) error { waM, err := s.dao.FirstAgentWalletActionByID( daos.GetDBMainCtx(ctx), walletActionID, make(map[string][]interface{}), false, ) if err != nil { return errs.NewError(err) } if waM.Status == models.AgentWalletActionStatusDone && waM.TxHash == "" { var actionInput struct { ActionInput struct { RefID string `json:"ref_id"` Action string `json:"action"` Mint string `json:"mint"` Amount numeric.BigFloat `json:"amount"` } `json:"action_input"` } var actionOutput struct { ActionOutput struct { OutputAmount numeric.BigInt `json:"output_amount"` Signatures []string `json:"signatures"` } `json:"action_output"` } err = helpers.ConvertJsonObject(waM.ActionInput, &actionInput) if err != nil { return errs.NewError(err) } err = helpers.ConvertJsonObject(waM.ActionOutput, &actionOutput) if err != nil { return errs.NewError(err) } decimalsMint, err := s.GetSolanaTokenDecimals(actionInput.ActionInput.Mint) if err != nil { return errs.NewError(err) } var amountIn, amountOut numeric.BigFloat amountIn = actionInput.ActionInput.Amount switch actionInput.ActionInput.Action { case "buy": { amountOut = numeric.NewBigFloatFromFloat(models.ConvertWeiToBigFloat(&actionOutput.ActionOutput.OutputAmount.Int, uint(decimalsMint))) } case "sell": { amountOut = numeric.NewBigFloatFromFloat(models.ConvertWeiToBigFloat(&actionOutput.ActionOutput.OutputAmount.Int, 9)) } } err = daos.GetDBMainCtx(ctx). Model(waM). Updates( map[string]interface{}{ "mint": actionInput.ActionInput.Mint, "side": actionInput.ActionInput.Action, "amount_in": amountIn, "amount_out": amountOut, "tx_hash": actionOutput.ActionOutput.Signatures[0], }, ).Error if err != nil { return errs.NewError(err) } } return nil } func (s *Service) AgentWalletGetSolanaTokenPnls(ctx context.Context, networkID uint64, agentContractID string) (any, error) { agent, err := s.dao.FirstAgentInfo( daos.GetDBMainCtx(ctx), map[string][]interface{}{ "network_id = ?": {networkID}, "agent_contract_id = ?": {agentContractID}, }, map[string][]interface{}{}, []string{}, ) if err != nil { return nil, errs.NewError(err) } if agent == nil { return nil, errs.NewError(errs.ErrBadRequest) } wallet, err := s.GetAgentWallet(daos.GetDBMainCtx(ctx), models.SOLANA_CHAIN_ID, agent.ID) if err != nil { return nil, errs.NewError(err) } balances, err := s.blockchainUtils.SolanaGetTokenBalances(wallet.Address) if err != nil { return nil, errs.NewError(err) } resps := map[string]*serializers.SolanaTokenBalanceResp{} for _, v := range balances { if v.TokenAmount.UIAmount > 0 && v.Mint != "" { resps[v.Mint] = &serializers.SolanaTokenBalanceResp{ IsNative: v.IsNative, Mint: v.Mint, Amount: v.TokenAmount.UIAmount, } } } tradeSums, err := s.dao.GetWalletActionTradeSum(daos.GetDBMainCtx(ctx), agent.ID) if err != nil { return nil, errs.NewError(err) } resMap := map[string]interface{}{} for _, tradeSum := range tradeSums { mintPrice, _ := s.GetPumpFunTokenPrice(ctx, tradeSum.Mint) pnl := models.SubBigFloats(&tradeSum.SellAmount.Float, &tradeSum.BuyAmount.Float) if resps[tradeSum.Mint] != nil { pnl = models.AddBigFloats( pnl, big.NewFloat(resps[tradeSum.Mint].Amount*mintPrice), ) } resMap[tradeSum.Mint] = map[string]interface{}{ "mint_price": mintPrice, "pnl_amount": numeric.BigFloat2TextDecimals(pnl, 9), } time.Sleep(50 * time.Millisecond) } return resMap, nil } func (s *Service) GetTradeAnalytic(ctx context.Context, token string) (interface{}, error) { var resp struct { TokenSymbol string `json:"token_symbol"` TokenName string `json:"token_name"` LastPrice string `json:"last_price_usd"` PriceChange string `json:"price_change_usd"` PriceChangePercent string `json:"price_change_percent"` WeightedAvgPrice string `json:"weighted_avg_price_usd"` PrevClosePrice string `json:"prev_close_price_usd"` LastQty string `json:"last_qty"` BidPrice string `json:"bid_price_usd"` BidQty string `json:"bid_qty"` AskQty string `json:"ask_qty"` OpenPrice string `json:"open_price_usd"` HighPrice string `json:"high_price_usd"` LowPrice string `json:"low_price_usd"` Volume string `json:"volume"` QuoteVolume string `json:"volume_usd"` OpenTime int64 `json:"open_time"` CloseTime int64 `json:"close_time"` Sma20 float64 `json:"sma_20"` Ema12 float64 `json:"ema_12"` Rsi float64 `json:"rsi"` Fibonacci float64 `json:"fibonacci"` } cacheKey := fmt.Sprintf(`GetTradeAnalytic_%s`, token) err := s.GetRedisCachedWithKey(cacheKey, &resp) if err != nil { mapToken, _ := s.GetMapAgentSnapshotMissionTokens(ctx) for range 3 { binanceInfo, err := helpers.GetBinancePrice24h(fmt.Sprintf(`%sUSDT`, token)) if err == nil { resp.TokenSymbol = token if v, ok := mapToken[token]; ok { resp.TokenName = v.Name } resp.LastPrice = binanceInfo.LastPrice resp.PriceChange = binanceInfo.PriceChange resp.PriceChangePercent = binanceInfo.PriceChangePercent resp.WeightedAvgPrice = binanceInfo.WeightedAvgPrice resp.PrevClosePrice = binanceInfo.PrevClosePrice resp.LastQty = binanceInfo.LastQty resp.BidPrice = binanceInfo.BidPrice resp.BidQty = binanceInfo.BidQty resp.AskQty = binanceInfo.AskQty resp.OpenPrice = binanceInfo.OpenPrice resp.HighPrice = binanceInfo.HighPrice resp.LowPrice = binanceInfo.LowPrice resp.Volume = binanceInfo.Volume resp.QuoteVolume = binanceInfo.QuoteVolume resp.OpenTime = binanceInfo.OpenTime resp.CloseTime = binanceInfo.CloseTime break } else { time.Sleep(1 * time.Second) } } for range 3 { analyticInfo, err := s.taapi.BulkRequest(token) if analyticInfo != nil && err == nil { for _, item := range analyticInfo.Data { if item.ID == "fibonacciretracement" { resp.Fibonacci = item.Result.Value } if item.ID == "rsi" { resp.Rsi = item.Result.Value } if item.ID == "sma" { resp.Sma20 = item.Result.Value } if item.ID == "ema" { resp.Ema12 = item.Result.Value } } break } else { time.Sleep(1 * time.Second) } } _ = s.SetRedisCachedWithKey(cacheKey, resp, 5*time.Minute) } return resp, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/agent_twin_trains.go ================================================ package services import ( "context" "encoding/json" "fmt" "math/big" "strings" "time" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/daos" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/helpers" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/logger" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/types/numeric" "github.com/jinzhu/gorm" "go.uber.org/zap" ) func (s *Service) AgentTwinTrain(ctx context.Context, agentInfoID uint) error { err := s.JobRunCheck( ctx, fmt.Sprintf("AgentTwinTrain_%d", agentInfoID), func() error { agent, err := s.dao.FirstAgentInfoByID( daos.GetDBMainCtx(ctx), agentInfoID, map[string][]interface{}{}, false, ) if err != nil { return errs.NewError(err) } _, isReadyRunTwin, err := s.CheckAgentIsReadyToRunTwinTraining(agent) if !isReadyRunTwin { return nil } if agent.TwinTwitterUsernames == "" { return nil } type CallTwinTrainingRequest struct { AgentID string `json:"agent_id"` TweeterIds []string `json:"twitter_ids"` } if agent.TwinStatus == models.TwinStatusPending { var twinFee *big.Float arr := strings.Split(agent.TwinTwitterUsernames, ",") twinFee = numeric.NewFloatFromString(fmt.Sprintf("%v", float64(len(arr))*300)) updateAgentFields := map[string]interface{}{ "twin_status": models.TwinStatusRunning, } arrTwitterIds := []string{} for _, twitterUsername := range arr { twitterInfo, err := s.GetTwitterUserByUsername(ctx, twitterUsername) if err != nil || twitterInfo == nil { logger.Error("twin_train_error", "s.GetTwitterUserByUsername got error", zap.Any("twitter_username", twitterUsername), zap.Any("error", err), zap.Any("twitterInfo", twitterInfo), ) continue } arrTwitterIds = append(arrTwitterIds, twitterInfo.ID) } if len(arrTwitterIds) == 0 { err = daos.GetDBMainCtx(ctx).Model(agent). Updates(map[string]interface{}{ //"twin_status": models.TwinStatusDoneError, "twin_call_process_request": "twitter_id list is empty", }).Error if err != nil { return errs.NewError(err) } return nil } twinTrainRequest := CallTwinTrainingRequest{ AgentID: fmt.Sprintf("%v", agent.ID), TweeterIds: arrTwitterIds, } requestBytes, _ := json.Marshal(twinTrainRequest) updateAgentFields["twin_call_process_request"] = string(requestBytes) body, err := helpers.CurlURLString( s.conf.AgentOffchain.Url+"/v1/twin/submit", "POST", map[string]string{ "Content-Type": "application/json", "x-token": s.conf.AgentOffchain.ApiKey, }, &twinTrainRequest, ) if err != nil { return err } updateAgentFields["twin_call_process_response"] = body twinStartTrainingAt := time.Now() agent.TwinStartTrainingAt = &twinStartTrainingAt updateAgentFields["twin_start_training_at"] = *agent.TwinStartTrainingAt agent.TwinStatus = models.TwinStatusRunning agent.TwinCallProcessRequest = string(requestBytes) agent.TwinCallProcessResponse = body estimateDoneTime := time.Now().Add(20 * time.Minute) agent.EstimateTwinDoneTimestamp = &estimateDoneTime updateAgentFields["estimate_twin_done_timestamp"] = *agent.TwinStartTrainingAt err = daos.GetDBMainCtx(ctx).Model(agent). Updates(updateAgentFields).Error if err != nil { return errs.NewError(err) } err = daos.GetDBMainCtx(ctx). Model(agent). Updates( map[string]interface{}{ "eai_balance": gorm.Expr("eai_balance - ?", numeric.NewBigFloatFromFloat(twinFee)), "twin_fee": numeric.NewBigFloatFromFloat(twinFee), }, ). Error if err != nil { return errs.NewError(err) } if twinFee.Cmp(big.NewFloat(0)) > 0 { _ = s.dao.Create( daos.GetDBMainCtx(ctx), &models.AgentEaiTopup{ NetworkID: agent.NetworkID, EventId: fmt.Sprintf("twin_train_fee_%d", agent.ID), AgentInfoID: agent.ID, Type: models.AgentEaiTopupTypeSpent, Amount: numeric.NewBigFloatFromFloat(twinFee), Status: models.AgentEaiTopupStatusDone, DepositAddress: agent.ETHAddress, ToAddress: agent.ETHAddress, Toolset: "twin_train_fee", }, ) } } return nil }, ) if err != nil { return errs.NewError(err) } return nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/agent_utilities.go ================================================ package services import ( "context" "encoding/json" "math/big" "strings" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/daos" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/helpers" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/binds/agentfactory" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/binds/agentupgradeable" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/binds/erc20utilityagent" "github.com/ethereum/go-ethereum/common" ) func (s *Service) ERC20UtilityAgentFetchCode( ctx context.Context, networkID uint64, contractAddress string, ) (string, error) { resp, err := s.GetEthereumClient(ctx, networkID). ERC20UtilityAgentFetchCode( contractAddress, ) if err != nil { return "", errs.NewError(err) } return resp, nil } func (s *Service) ERC20UtilityAgentGetStorageInfo( ctx context.Context, networkID uint64, contractAddress string, ) (*erc20utilityagent.IUtilityAgentStorageInfo, error) { resp, err := s.GetEthereumClient(ctx, networkID). ERC20UtilityAgentGetStorageInfo( contractAddress, ) if err != nil { return nil, errs.NewError(err) } return resp, nil } func (s *Service) DeployAgentUpgradeableAddress( ctx context.Context, networkID uint64, agentID string, agentName string, agentVersion string, codeLanguage string, pointers []agentupgradeable.IAgentCodePointer, depsAgents []common.Address, agentOwner common.Address, ) (string, error) { memePoolAddress := strings.ToLower(s.conf.GetConfigKeyString(networkID, "meme_pool_address")) agentFactoryAddress := strings.ToLower(s.conf.GetConfigKeyString(networkID, "agent_factory_address")) txHash, err := s.GetEthereumClient(ctx, networkID). AgentFactoryCreateAgent( agentFactoryAddress, s.GetAddressPrk(memePoolAddress), common.HexToHash(agentID), agentName, agentVersion, codeLanguage, pointers, depsAgents, agentOwner, ) if err != nil { return "", errs.NewError(err) } return txHash, nil } func (s *Service) DeployAgentUpgradeable(ctx context.Context, agentInfoID uint) error { agentInfo, err := s.dao.FirstAgentInfoByID( daos.GetDBMainCtx(ctx), agentInfoID, map[string][]any{}, false, ) if err != nil { return errs.NewError(err) } if agentInfo != nil { if agentInfo.AgentType != models.AgentInfoAgentTypeModel && agentInfo.AgentType != models.AgentInfoAgentTypeModelOnline && agentInfo.AgentType != models.AgentInfoAgentTypeInfa && agentInfo.AgentType != models.AgentInfoAgentTypeJs && agentInfo.AgentType != models.AgentInfoAgentTypePython && agentInfo.AgentType != models.AgentInfoAgentTypeCustomUi && agentInfo.AgentType != models.AgentInfoAgentTypeCustomPrompt { return errs.NewError(errs.ErrBadRequest) } if agentInfo.MintHash == "" { switch agentInfo.NetworkID { case models.ETHEREUM_CHAIN_ID, models.BASE_CHAIN_ID, models.BASE_SEPOLIA_CHAIN_ID: { if agentInfo.SourceUrl == "" { return errs.NewError(errs.ErrBadRequest) } var fileNames []string err = json.Unmarshal([]byte(agentInfo.SourceUrl), &fileNames) if err != nil { return errs.NewError(err) } if len(fileNames) == 0 { return errs.NewError(errs.ErrBadRequest) } storageInfos := []agentupgradeable.IAgentCodePointer{} for _, fileName := range fileNames { if strings.HasPrefix(fileName, "ethfs_") { storageInfos = append(storageInfos, agentupgradeable.IAgentCodePointer{ RetrieveAddress: helpers.HexToAddress(strings.ToLower(s.conf.GetConfigKeyString(agentInfo.NetworkID, "ethfs_address"))), FileType: 0, FileName: strings.TrimPrefix(fileName, "ethfs_"), }) } else if strings.HasPrefix(fileName, "ipfs_") { storageInfos = append(storageInfos, agentupgradeable.IAgentCodePointer{ RetrieveAddress: helpers.HexToAddress(models.ETH_ZERO_ADDRESS), FileType: 0, FileName: strings.TrimPrefix(fileName, "ipfs_"), }) } else { storageInfos = append(storageInfos, agentupgradeable.IAgentCodePointer{ RetrieveAddress: helpers.HexToAddress(models.ETH_ZERO_ADDRESS), FileType: 0, FileName: fileName, }) } } dependAgentAddrs := []common.Address{} if agentInfo.DependAgents != "" { var dependAgents []string err = json.Unmarshal([]byte(agentInfo.DependAgents), &dependAgents) if err != nil { return errs.NewError(err) } for _, v := range dependAgents { dependAgentAddrs = append(dependAgentAddrs, helpers.HexToAddress(v)) } } codeLanguage := agentInfo.GetCodeLanguage() if codeLanguage == "" { return errs.NewError(errs.ErrBadRequest) } txHash, err := s.DeployAgentUpgradeableAddress( ctx, agentInfo.NetworkID, agentInfo.AgentID, agentInfo.AgentName, "1", codeLanguage, storageInfos, dependAgentAddrs, helpers.HexToAddress(agentInfo.Creator), ) if err != nil { return errs.NewError(err) } err = daos.GetDBMainCtx(ctx). Model(agentInfo). Updates( map[string]any{ "mint_hash": txHash, }, ).Error if err != nil { return errs.NewError(err) } } default: { return errs.NewError(errs.ErrBadRequest) } } } } return nil } func (s *Service) JobUpdateAgentUpgradeableCodeVersion(ctx context.Context) error { agents, err := s.dao.FindAgentInfo( daos.GetDBMainCtx(ctx), map[string][]any{ "agent_contract_address != ?": {""}, "agent_type in (?)": { []models.AgentInfoAgentType{ models.AgentInfoAgentTypeModel, models.AgentInfoAgentTypeModelOnline, models.AgentInfoAgentTypeJs, models.AgentInfoAgentTypePython, models.AgentInfoAgentTypeInfa, models.AgentInfoAgentTypeCustomUi, models.AgentInfoAgentTypeCustomPrompt, }, }, "network_id in (?)": { []uint64{ models.SHARDAI_CHAIN_ID, models.ETHEREUM_CHAIN_ID, models.BITTENSOR_CHAIN_ID, models.BASE_CHAIN_ID, models.HERMES_CHAIN_ID, models.ARBITRUM_CHAIN_ID, models.ZKSYNC_CHAIN_ID, models.POLYGON_CHAIN_ID, models.BSC_CHAIN_ID, models.APE_CHAIN_ID, models.AVALANCHE_C_CHAIN_ID, models.ABSTRACT_TESTNET_CHAIN_ID, models.DUCK_CHAIN_ID, models.TRON_CHAIN_ID, models.MODE_CHAIN_ID, models.ZETA_CHAIN_ID, models.STORY_CHAIN_ID, models.HYPE_CHAIN_ID, models.MONAD_TESTNET_CHAIN_ID, models.MEGAETH_TESTNET_CHAIN_ID, models.CELO_CHAIN_ID, models.BASE_SEPOLIA_CHAIN_ID, }, }, }, map[string][]any{}, []string{}, 0, 999999, ) if err != nil { return errs.NewError(err) } for _, agent := range agents { err = s.UpdateAgentUpgradeableCodeVersion(ctx, agent.ID) if err != nil { return errs.NewError(err) } } return nil } func (s *Service) HandleAgentUpgradeableCodePointerCreated(ctx context.Context, event *agentupgradeable.AgentUpgradeableCodePointerCreated) error { agentInfo, err := s.dao.FirstAgentInfo( daos.GetDBMainCtx(ctx), map[string][]any{ "agent_contract_address = ?": {event.Raw.Address.Hex()}, }, map[string][]any{}, []string{}, ) if err != nil { return errs.NewError(err) } if agentInfo != nil { err = s.UpdateAgentUpgradeableCodeVersion(ctx, agentInfo.ID) if err != nil { return errs.NewError(err) } } return nil } func (s *Service) UpdateAgentUpgradeableCodeVersion(ctx context.Context, agentInfoID uint) error { agentInfo, err := s.dao.FirstAgentInfoByID( daos.GetDBMainCtx(ctx), agentInfoID, map[string][]any{}, false, ) if err != nil { return errs.NewError(err) } if agentInfo.AgentContractAddress == "" || agentInfo.AgentContractID != "0" { return errs.NewError(errs.ErrBadRequest) } codeVersion, err := s.GetEthereumClient(ctx, agentInfo.NetworkID).AgentUpgradeableCodeVersion(agentInfo.AgentContractAddress) if err != nil { return errs.NewError(err) } depsAgents, err := s.GetEthereumClient(ctx, agentInfo.NetworkID).AgentUpgradeableDepsAgents(agentInfo.AgentContractAddress, codeVersion) if err != nil { return errs.NewError(err) } depsAgentsBytes, err := json.Marshal(depsAgents) if err != nil { return errs.NewError(err) } depsAgentsJson := strings.ToLower(string(depsAgentsBytes)) if codeVersion != agentInfo.CodeVersion || !strings.EqualFold(depsAgentsJson, agentInfo.DependAgents) { err = daos.GetDBMainCtx(ctx). Model(agentInfo). Updates( map[string]any{ "code_version": codeVersion, "depend_agents": depsAgentsJson, }, ).Error if err != nil { return errs.NewError(err) } } return nil } func (s *Service) AgentFactoryAgentCreatedEvent(ctx context.Context, networkID uint64, event *agentfactory.AgentFactoryAgentCreated) error { if !s.conf.ExistsedConfigKey(networkID, "agent_factory_address") { return nil } agentFactoryAddress := strings.ToLower(s.conf.GetConfigKeyString(networkID, "agent_factory_address")) if strings.EqualFold(agentFactoryAddress, event.Raw.Address.Hex()) { agentID := big.NewInt(0).SetBytes(event.AgentId[:]).Text(16) agentInfo, err := s.dao.FirstAgentInfo( daos.GetDBMainCtx(ctx), map[string][]any{ "agent_id = ?": {agentID}, }, map[string][]any{}, []string{}, ) if err != nil { return errs.NewError(err) } agentAddress := strings.ToLower(event.Agent.Hex()) if agentInfo != nil && !strings.EqualFold(agentAddress, agentInfo.AgentContractAddress) { err = daos.GetDBMainCtx(ctx). Model(agentInfo). Updates( map[string]any{ "agent_contract_address": agentAddress, "agent_contract_id": "0", "agent_logic_address": "", "mint_hash": event.Raw.TxHash.Hex(), "status": models.AssistantStatusReady, "reply_enabled": true, "agent_nft_minted": true, "factory_address": strings.ToLower(event.Raw.Address.Hex()), }, ).Error if err != nil { return errs.NewError(err) } s.DeleteFilterAddrs(ctx, agentInfo.NetworkID) go s.UpdateAgentUpgradeableCodeVersion(ctx, agentInfo.ID) } } return nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/agent_video.go ================================================ package services import ( "context" "fmt" "strings" "github.com/sashabaranov/go-openai" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/daos" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/helpers" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/clanker" "github.com/jinzhu/gorm" ) func (s *Service) CreateClankerTokenForVideoByPostID(ctx context.Context, twitterPostID uint) error { err := s.JobRunCheck( ctx, fmt.Sprintf("CreateClankerTokenForVideoByPostID_%d", twitterPostID), func() error { err := daos.WithTransaction( daos.GetDBMainCtx(ctx), func(tx *gorm.DB) error { twitterPost, err := s.dao.FirstAgentTwitterPostByID( tx, twitterPostID, map[string][]interface{}{}, true, ) if err != nil { return errs.NewError(err) } if twitterPost == nil { return errs.NewError(errs.ErrRecordNotFound) } if twitterPost.Status == models.AgentTwitterPostStatusNew && twitterPost.PostType == models.AgentSnapshotPostActionTypeGenerateVideo && twitterPost.TokenAddress == "" { // check if privy wallet already exists privyWallet, err := s.dao.FirstPrivyWallet(tx, map[string][]interface{}{ "twitter_id = ?": {twitterPost.TwitterID}, }, map[string][]interface{}{}, []string{}) if err != nil { return errs.NewError(err) } if privyWallet == nil { ethAddress, err := s.CreateETHAddress(ctx) if err != nil { return errs.NewError(err) } privyWallet = &models.PrivyWallet{ TwitterID: twitterPost.TwitterID, Address: strings.ToLower(ethAddress), WalletType: models.WalletTypeInternal, PrivyID: helpers.RandomBigInt(12).Text(25), } err = s.dao.Create(tx, privyWallet) if err != nil { return errs.NewError(err) } // var privyResp *privy.CreateUserResp // var appID string // for _, item := range s.conf.Privy.AppIDList { // //call api privy // privyResp, err = s.privyClient.CreateUserEx(&privy.CreateUserReq{ // CreateEthereumWallet: true, // LinkedAccounts: []privy.LinkedAccountReq{ // { // Type: "twitter_oauth", // Subject: twitterPost.TwitterID, // Name: twitterPost.TwitterName, // Username: twitterPost.TwitterUsername, // }, // }, // }) // if err == nil && privyResp != nil && privyResp.LinkedAccounts != nil && len(privyResp.LinkedAccounts) > 0 { // appID = item // break // } // } // if privyResp != nil && appID != "" && privyResp.LinkedAccounts != nil && len(privyResp.LinkedAccounts) > 0 { // walletAddress := "" // for _, wallet := range privyResp.LinkedAccounts { // if wallet.Type == "wallet" { // walletAddress = wallet.Address // break // } // } // //create privy wallet // privyWallet = &models.PrivyWallet{ // TwitterID: twitterPost.TwitterID, // Address: walletAddress, // PrivyID: privyResp.ID, // } // err = s.dao.Create(tx, privyWallet) // if err != nil { // return errs.NewError(err) // } // } } inst, err := s.dao.FirstClankerVideoToken( tx, map[string][]interface{}{ "agent_twitter_post_id = ?": {twitterPost.ID}, }, map[string][]interface{}{}, []string{}, ) if err != nil { return errs.NewError(err) } if inst == nil && privyWallet != nil { inst := &models.ClankerVideoToken{ TokenImageUrl: twitterPost.ExtractMediaContent, OwnerTwitterID: twitterPost.TwitterID, AgentTwitterPostID: twitterPost.ID, TokenDesc: twitterPost.ExtractContent, TokenStatus: "pending", VideoUrl: twitterPost.ImageUrl, RequestorAddress: privyWallet.Address, RequestKey: helpers.RandomStringWithLength(32), } isGenImage := false if twitterPost.ExtractMediaContent == "" { isGenImage = true } tokenInfo, _ := s.GenerateTokenInfoFromVideoPrompt(ctx, twitterPost.ExtractContent, isGenImage) if tokenInfo != nil && tokenInfo.TokenSymbol != "" { inst.TokenName = tokenInfo.TokenName inst.TokenSymbol = tokenInfo.TokenSymbol if isGenImage { inst.TokenImageUrl = tokenInfo.TokenImageUrl } } if inst.TokenName != "" && inst.TokenSymbol != "" { //call api clanker tokenResp, err := s.clanker.DeployToken(&clanker.DeployTokenReq{ Name: inst.TokenName, Symbol: inst.TokenSymbol, Description: inst.TokenDesc, Image: inst.TokenImageUrl, RequestKey: inst.RequestKey, RequestorAddress: inst.RequestorAddress, SocialMediaUrls: []string{fmt.Sprintf("https://x.com/%s/status/%s", twitterPost.TwitterUsername, twitterPost.TwitterPostID)}, Platform: "Eternal AI", CreatorRewardsPercentage: s.conf.Clanker.CreatorRewardsPercentage, CreatorRewardsAdmin: s.conf.Clanker.CreatorRewardsAdmin, }) if err != nil { inst.Error = err.Error() } else if tokenResp != nil { inst.TokenAddress = tokenResp.ContractAddress inst.TxHash = tokenResp.TxHash inst.TokenStatus = "done" inst.PairAddress = tokenResp.PoolAddress inst.Error = "" //update status twitter post twitterPost.TokenName = inst.TokenName twitterPost.TokenSymbol = inst.TokenSymbol twitterPost.TokenAddress = tokenResp.ContractAddress err = s.dao.Save(tx, twitterPost) if err != nil { return errs.NewError(err) } } err = s.dao.Create(tx, inst) if err != nil { return errs.NewError(err) } } else { return errs.NewError(errs.ErrBadRequest, "Token name or symbol is empty") } } } return nil }, ) if err != nil { return errs.NewError(err) } return nil }, ) if err != nil { return errs.NewError(err) } return nil } func (s *Service) GenerateTokenInfoFromVideoPrompt(ctx context.Context, sysPrompt string, isGenImage bool) (*models.TweetParseInfo, error) { info := &models.TweetParseInfo{} sysPrompt = strings.ReplaceAll(sysPrompt, "@CryptoEternalAI", "") promptGenerateToken := fmt.Sprintf(` I want to generate my token base on this info '%s' token-name (generate if not provided, make sure it not empty, limit with 15 characters) token-symbol (generate if not provided, make sure it not empty, limit with 5 characters) Please return in string in json format including token-name, token-symbol, just only json without explanation and token name limit with 15 characters `, sysPrompt) message := []openai.ChatCompletionMessage{ openai.ChatCompletionMessage{ Role: "system", Content: "You are a helpful assistant", }, openai.ChatCompletionMessage{ Role: "user", Content: promptGenerateToken, }, } aiStr, err := s.openais["Agent"].CallStreamDirectlyEternalLLMV2(ctx, message, "Qwen/QwQ-32B", s.conf.KnowledgeBaseConfig.DirectServiceUrl, nil) if err != nil { return nil, errs.NewError(err) } fmt.Println(aiStr) if aiStr != "" { mapInfo := helpers.ExtractMapInfoFromOpenAI(aiStr) tokenSymbol := "" tokenName := "" if mapInfo != nil { if v, ok := mapInfo["token-symbol"]; ok { tokenSymbol = fmt.Sprintf(`%v`, v) } if v, ok := mapInfo["token-name"]; ok { tokenName = fmt.Sprintf(`%v`, v) } if tokenName == "" { tokenName = tokenSymbol } info.TokenName = tokenName info.TokenSymbol = tokenSymbol if isGenImage { info.TokenImageUrl = s.GenerateTokenImageBase64Gif(ctx, tokenSymbol, tokenName, sysPrompt) } } } return info, nil } func (s *Service) GetListUserVideo(ctx context.Context, userAddres, search string) ([]*models.ClankerVideoToken, error) { filters := map[string][]interface{}{ "lower(requestor_address) = ? or lower(owner_twitter_id) = ?": {strings.ToLower(userAddres), strings.ToLower(userAddres)}, } if search != "" { search = fmt.Sprintf("%%%s%%", strings.ToLower(search)) filters[` LOWER(token_name) like ? or LOWER(token_symbol) like ? or LOWER(token_address) like ? `] = []any{search, search, search} } res, err := s.dao.FindClankerVideoToken( daos.GetDBMainCtx(ctx), map[string][]interface{}{}, filters, map[string][]interface{}{ "AgentTwitterPost": {}, }, []string{"id desc"}, 0, 1000, ) if err != nil { return nil, errs.NewError(err) } return res, nil } func (s *Service) GetVideoUserInfo(ctx context.Context, twitterID string) (*models.PrivyWallet, error) { insts, err := s.dao.FirstPrivyWallet(daos.GetDBMainCtx(ctx), map[string][]interface{}{ "twitter_id = ? or address = ?": {twitterID, strings.ToLower(twitterID)}, }, map[string][]interface{}{}, []string{}, ) if err != nil { return nil, errs.NewError(err) } return insts, nil } func (s *Service) ExportUserPrivateKeyForClaimVideoReward(ctx context.Context, userAddress string) (string, error) { privyWallet, err := s.dao.FirstPrivyWallet(daos.GetDBMainCtx(ctx), map[string][]interface{}{ "user_address = ?": {strings.ToLower(userAddress)}, }, map[string][]interface{}{}, []string{}, ) if err != nil { return "", errs.NewError(err) } if privyWallet == nil { return "", errs.NewError(errs.ErrRecordNotFound) } prk := s.GetAddressPrk(privyWallet.Address) return prk, nil } // package services // import ( // "context" // "fmt" // "strings" // "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/daos" // "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" // "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/helpers" // "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" // "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/serializers" // "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/types/numeric" // ) // func (s *Service) CreateAgentVideoByPostID(ctx context.Context, twitterPostID uint) error { // err := s.JobRunCheck( // ctx, // fmt.Sprintf("CreateAgentVideoByPostID_%d", twitterPostID), // func() error { // var reqMeme *serializers.MemeReq // creator := strings.ToLower(s.conf.GetConfigKeyString(models.BASE_CHAIN_ID, "meme_pool_address")) // twitterPost, err := s.dao.FirstAgentTwitterPostByID( // daos.GetDBMainCtx(ctx), // twitterPostID, // map[string][]interface{}{}, // true, // ) // if err != nil { // return errs.NewError(err) // } // if twitterPost != nil && twitterPost.Status == models.AgentTwitterPostStatusReplied { // agentInfo, err := s.dao.FirstAgentInfo( // daos.GetDBMainCtx(ctx), // map[string][]interface{}{ // "ref_tweet_id = ?": {twitterPost.ID}, // "agent_type = ?": {models.AgentInfoAgentTypeVideo}, // }, // map[string][]interface{}{}, // []string{}, // ) // if err != nil { // return errs.NewError(err) // } // if agentInfo == nil { // user, _ := s.dao.FirstUser( // daos.GetDBMainCtx(ctx), // map[string][]interface{}{ // "network_id = ?": {models.GENERTAL_NETWORK_ID}, // "twitter_id = ?": {twitterPost.GetOwnerTwitterID()}, // }, // map[string][]interface{}{}, // false, // ) // if user != nil { // creator = user.Address // } // agentInfo := &models.AgentInfo{ // NetworkID: models.BASE_CHAIN_ID, // NetworkName: models.GetChainName(models.BASE_CHAIN_ID), // SystemPrompt: twitterPost.Prompt, // AgentName: twitterPost.TokenName, // TokenMode: string(models.TokenSetupEnumAutoCreate), // AgentType: models.AgentInfoAgentTypeVideo, // TmpTwitterID: twitterPost.GetOwnerTwitterID(), // TokenNetworkID: models.BASE_CHAIN_ID, // Version: "2", // AgentID: helpers.RandomBigInt(12).Text(16), // ScanEnabled: true, // Creator: creator, // RefTweetID: twitterPost.ID, // TokenImageUrl: twitterPost.ImageUrl, // } // agentInfo.TokenMode = string(models.TokenSetupEnumAutoCreate) // tokenInfo, _ := s.GenerateTokenInfoFromVideoPrompt(ctx, twitterPost.ExtractContent) // if tokenInfo != nil && tokenInfo.TokenSymbol != "" { // agentInfo.TokenName = tokenInfo.TokenName // agentInfo.TokenSymbol = tokenInfo.TokenSymbol // } // agentInfo.TokenDesc = twitterPost.ExtractContent // agentInfo.TokenNetworkID = models.BASE_CHAIN_ID // agentInfo.SystemPrompt = twitterPost.ExtractContent // agentInfo.MetaData = twitterPost.ExtractContent // agentInfo.TokenStatus = "pending" // agentInfo.EaiBalance = numeric.NewBigFloatFromString("50") // agentInfo.Status = models.AssistantStatusReady // err = s.dao.Create(daos.GetDBMainCtx(ctx), agentInfo) // if err != nil { // return errs.NewError(err) // } // agentTokenInfo := &models.AgentTokenInfo{} // agentTokenInfo.AgentInfoID = agentInfo.ID // agentTokenInfo.NetworkID = models.BASE_CHAIN_ID // agentTokenInfo.NetworkName = models.GetChainName(agentTokenInfo.NetworkID) // err = s.dao.Create(daos.GetDBMainCtx(ctx), agentTokenInfo) // if err != nil { // return errs.NewError(err) // } // agentInfo.TokenInfoID = agentTokenInfo.ID // err = s.dao.Save(daos.GetDBMainCtx(ctx), agentInfo) // if err != nil { // return errs.NewError(err) // } // reqMeme = &serializers.MemeReq{ // Name: agentInfo.TokenName, // Ticker: agentInfo.TokenSymbol, // Description: agentInfo.TokenDesc, // Image: agentInfo.TokenImageUrl, // Twitter: fmt.Sprintf("https://x.com/%s", agentInfo.TwitterUsername), // AgentInfoID: agentInfo.ID, // BaseTokenSymbol: string(models.BaseTokenSymbolEAI), // NotGraduated: true, // } // _, err = s.CreateMeme(ctx, creator, models.BASE_CHAIN_ID, reqMeme) // if err != nil { // return errs.NewError(err) // } // twitterPost.Status = models.AgentTwitterPostStatusDone // err = s.dao.Save(daos.GetDBMainCtx(ctx), twitterPost) // if err != nil { // return errs.NewError(err) // } // } // } // return nil // }, // ) // if err != nil { // return errs.NewError(err) // } // return nil // } // func (s *Service) GenerateTokenInfoFromVideoPrompt(ctx context.Context, sysPrompt string) (*models.TweetParseInfo, error) { // info := &models.TweetParseInfo{} // sysPrompt = strings.ReplaceAll(sysPrompt, "@CryptoEternalAI", "") // promptGenerateToken := fmt.Sprintf(` // I want to generate my token base on this info // '%s' // token-name (generate if not provided, make sure it not empty) // token-symbol (generate if not provided, make sure it not empty) // Please return in string in json format including token-name, token-symbol, just only json without explanation and token name limit with 15 characters // `, sysPrompt) // aiStr, err := s.openais["Lama"].ChatMessage(promptGenerateToken) // if err != nil { // return nil, errs.NewError(err) // } // fmt.Println(aiStr) // if aiStr != "" { // mapInfo := helpers.ExtractMapInfoFromOpenAI(aiStr) // tokenSymbol := "" // tokenName := "" // if mapInfo != nil { // if v, ok := mapInfo["token-symbol"]; ok { // tokenSymbol = fmt.Sprintf(`%v`, v) // } // if v, ok := mapInfo["token-name"]; ok { // tokenName = fmt.Sprintf(`%v`, v) // } // if tokenName == "" { // tokenName = tokenSymbol // } // } // info = &models.TweetParseInfo{ // TokenSymbol: tokenSymbol, // TokenName: tokenName, // } // } // return info, nil // } // func (s *Service) GetDashboardAgentVideo(ctx context.Context, userAddress string, tokenAddress, search string, sortListStr []string, page, limit int, // ) ([]*models.AgentInfo, uint, error) { // sortDefault := "ifnull(agent_infos.priority, 0) desc, meme_market_cap desc" // if len(sortListStr) > 0 { // sortDefault = strings.Join(sortListStr, ", ") // } // selected := []string{ // `ifnull(agent_infos.reply_latest_time, agent_infos.updated_at) reply_latest_time`, // "agent_infos.*", // `ifnull((cast(( memes.price - memes.price_last24h) / memes.price_last24h * 100 as decimal(20, 2))), ifnull(agent_token_infos.price_change,0)) meme_percent`, // `cast(case when ifnull(agent_token_infos.usd_market_cap, 0) then ifnull(agent_token_infos.usd_market_cap, 0) // when ifnull(memes.price_usd*memes.total_suply, 0) > 0 then ifnull(memes.price_usd*memes.total_suply, 0) end as decimal(36, 18)) meme_market_cap`, // `ifnull(memes.price_usd, agent_token_infos.price_usd) meme_price`, // `ifnull(memes.volume_last24h*memes.price_usd, agent_token_infos.volume_last24h) meme_volume_last24h`, // } // joinFilters := map[string][]any{ // ` // left join memes on agent_infos.id = memes.agent_info_id and memes.deleted_at IS NULL // left join agent_token_infos on agent_token_infos.id = agent_infos.token_info_id // left join twitter_users on twitter_users.twitter_id = agent_infos.tmp_twitter_id and agent_infos.tmp_twitter_id is not null // `: {}, // } // filters := map[string][]any{ // ` // ((agent_infos.agent_contract_address is not null and agent_infos.agent_contract_address != "") or (agent_infos.agent_type=2 and agent_infos.status="ready") or agent_infos.token_address != "") // and ifnull(agent_infos.priority, 0) >= 0 // and agent_infos.id != 15 // `: {}, // `agent_infos.token_address != "" and ifnull(memes.status, "") not in ("created", "pending")`: {}, // `agent_infos.agent_type = ?`: {models.AgentInfoAgentTypeVideo}, // } // if search != "" { // search = fmt.Sprintf("%%%s%%", strings.ToLower(search)) // filters[` // LOWER(agent_infos.token_name) like ? // or LOWER(agent_infos.token_symbol) like ? // or LOWER(agent_infos.token_address) like ? // or LOWER(agent_infos.twitter_username) like ? // or LOWER(agent_infos.agent_name) like ? // or ifnull(twitter_users.twitter_username, "") like ? // or ifnull(twitter_users.name, "") like ? // `] = []any{search, search, search, search, search, search, search} // } // if tokenAddress != "" { // filters["LOWER(agent_infos.token_address) = ? or agent_infos.agent_id = ? or agent_infos.id = ?"] = []any{strings.ToLower(tokenAddress), tokenAddress, tokenAddress} // } // //filter instlled app // agents, err := s.dao.FindAgentInfoJoinSelect( // daos.GetDBMainCtx(ctx), // selected, // joinFilters, // filters, // map[string][]any{ // "TmpTwitterInfo": {}, // "Meme": {`deleted_at IS NULL and status not in ("created", "pending")`}, // "TokenInfo": {}, // }, // []string{sortDefault}, // page, limit, // ) // if err != nil { // return nil, 0, errs.NewError(err) // } // return agents, 0, nil // } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/api_subscription_srv.go ================================================ package services import ( "context" "crypto/rand" "encoding/hex" "math/big" "strings" "time" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/daos" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/types/numeric" "github.com/jinzhu/gorm" ) func (s *Service) GenerateAPIKey() (string, error) { key := make([]byte, 32) if _, err := rand.Read(key); err != nil { return "", errs.NewError(err) } return hex.EncodeToString(key), nil } func (s *Service) CreateApiTokenUsage(ctx context.Context, networkID uint64, apiKey string, endPoint string, numToken uint) error { obj, err := s.dao.FirstApiSubscriptionKey(daos.GetDBMainCtx(ctx), map[string][]interface{}{ "api_key = ?": {apiKey}, }, map[string][]interface{}{}, []string{}) if err != nil { return errs.NewError(err) } if obj == nil { return errs.NewError(errs.ErrBadRequest) } if networkID > 0 && obj.NetworkID != networkID { return errs.NewError(errs.ErrBadRequest) } if obj.QuotaRemaining < uint64(numToken) { return errs.NewError(errs.ErrApiKeyRateLimited) } err = daos.WithTransaction( daos.GetDBMainCtx(ctx), func(tx *gorm.DB) error { obj, err = s.dao.FirstApiSubscriptionKeyByID(tx, obj.ID, map[string][]interface{}{}, true) if err != nil { return errs.NewError(err) } if obj.QuotaRemaining < uint64(numToken) { return errs.NewError(errs.ErrApiKeyRateLimited) } obj.QuotaRemaining = obj.QuotaRemaining - uint64(numToken) err = s.dao.Save(tx, obj) if err != nil { return errs.NewError(err) } usage := &models.ApiSubscriptionUsageLog{ ApiKey: obj.ApiKey, Endpoint: endPoint, NumToken: uint64(numToken), } err = s.dao.Create( tx, usage, ) if err != nil { return errs.NewError(err) } return nil }, ) if err != nil { return errs.NewError(err) } return nil } func (s *Service) RefundApiTokenUsage(ctx context.Context, apiKey string, numToken uint) error { obj, err := s.dao.FirstApiSubscriptionKey(daos.GetDBMainCtx(ctx), map[string][]interface{}{ "api_key = ?": {apiKey}, }, map[string][]interface{}{}, []string{}) if err != nil { return errs.NewError(err) } err = daos.WithTransaction( daos.GetDBMainCtx(ctx), func(tx *gorm.DB) error { obj, err = s.dao.FirstApiSubscriptionKeyByID(tx, obj.ID, map[string][]interface{}{}, true) if err != nil { return errs.NewError(err) } obj.QuotaRemaining = obj.QuotaRemaining + uint64(numToken) err = s.dao.Save(tx, obj) if err != nil { return errs.NewError(err) } usage := &models.ApiSubscriptionUsageLog{ ApiKey: obj.ApiKey, Endpoint: "refund", NumToken: uint64(numToken), } err = s.dao.Create( tx, usage, ) if err != nil { return errs.NewError(err) } return nil }, ) if err != nil { return errs.NewError(err) } return nil } func (s *Service) CreateApiSubscriptionKeyForTest(ctx context.Context, address, twitterID string) (*models.ApiSubscriptionKey, error) { userSubApi, err := s.dao.FirstApiSubscriptionKey(daos.GetDBMainCtx(ctx), map[string][]interface{}{ "user_address = ?": {strings.ToLower(address)}, }, map[string][]interface{}{}, []string{}, ) if err != nil { return nil, errs.NewError(err) } if userSubApi == nil { lstFreePackages, err := s.dao.FindApiSubscriptionPackage(daos.GetDBMainCtx(ctx), map[string][]interface{}{ "type = ?": {models.PackageTypeFree}, }, map[string][]interface{}{}, []string{}, 0, 100) if err != nil { return nil, errs.NewError(err) } now := time.Now() for _, v := range lstFreePackages { apiKeyStr, err := s.GenerateAPIKey() if err != nil { return nil, errs.NewError(err) } expiresAt := now.Add(time.Duration(v.DurationDay) * 24 * time.Hour) depositAddress, err := s.CreateETHAddress(ctx) if err != nil { return nil, errs.NewError(err) } userSubApi = &models.ApiSubscriptionKey{ NetworkID: v.NetworkID, UserAddress: strings.ToLower(address), TwitterID: twitterID, ApiKey: apiKeyStr, PackageID: v.ID, QuotaRemaining: v.NumToken, StartedAt: &now, ExpiresAt: &expiresAt, DepositAddress: depositAddress, } err = s.dao.Create(daos.GetDBMainCtx(ctx), userSubApi) if err != nil { return nil, errs.NewError(err) } } } return userSubApi, nil } func (s *Service) GetApiUsage(ctx context.Context, apiKey string, page, limit int) ([]*models.ApiSubscriptionUsageLog, uint, error) { res, count, err := s.dao.FindApiSubscriptionUsageLog4Page(daos.GetDBMainCtx(ctx), map[string][]interface{}{ "api_key = ?": {apiKey}, }, map[string][]interface{}{}, []string{"id desc"}, page, limit) if err != nil { return nil, 0, errs.NewError(err) } return res, count, nil } func (s *Service) TwitterOauthCallbackForApiSubscription(ctx context.Context, callbackUrl, address, code, clientID string) error { oauthClientId := s.conf.Twitter.OauthClientId oauthClientSecret := s.conf.Twitter.OauthClientSecret respOauth, err := s.twitterAPI.GetTwitterOAuthTokenWithKeyForDeveloper( oauthClientId, oauthClientSecret, code, callbackUrl, address) if err != nil { return errs.NewError(err) } if respOauth != nil && respOauth.AccessToken != "" { twitterUser, err := s.twitterAPI.GetTwitterMe(respOauth.AccessToken) if err != nil { return errs.NewError(err) } if twitterUser != nil { twitterInfo, err := s.dao.FirstTwitterInfo(daos.GetDBMainCtx(ctx), map[string][]interface{}{ "twitter_id = ?": {twitterUser.ID}, }, map[string][]interface{}{}, false, ) if err != nil { return errs.NewError(err) } if twitterInfo == nil { twitterInfo = &models.TwitterInfo{ TwitterID: twitterUser.ID, } } twitterInfo.TwitterAvatar = twitterUser.ProfileImageURL twitterInfo.TwitterName = twitterUser.Name twitterInfo.TwitterUsername = twitterUser.UserName twitterInfo.AccessToken = respOauth.AccessToken twitterInfo.RefreshToken = respOauth.RefreshToken twitterInfo.ExpiresIn = respOauth.ExpiresIn twitterInfo.Scope = respOauth.Scope twitterInfo.TokenType = respOauth.TokenType twitterInfo.OauthClientId = oauthClientId twitterInfo.OauthClientSecret = oauthClientSecret twitterInfo.Description = twitterUser.Description twitterInfo.RefreshError = "OK" expiredAt := time.Now().Add(time.Second * time.Duration(respOauth.ExpiresIn-(60*20))) twitterInfo.ExpiredAt = &expiredAt err = s.dao.Save(daos.GetDBMainCtx(ctx), twitterInfo) if err != nil { return errs.NewError(err) } userSubApi, err := s.dao.FirstApiSubscriptionKey(daos.GetDBMainCtx(ctx), map[string][]interface{}{ "user_address = ?": {strings.ToLower(address)}, }, map[string][]interface{}{}, []string{}, ) if err != nil { return errs.NewError(err) } if userSubApi == nil { lstFreePackages, err := s.dao.FindApiSubscriptionPackage(daos.GetDBMainCtx(ctx), map[string][]interface{}{ "type = ?": {models.PackageTypeFree}, }, map[string][]interface{}{}, []string{}, 0, 100) if err != nil { return errs.NewError(err) } now := time.Now() for _, v := range lstFreePackages { apiKeyStr, err := s.GenerateAPIKey() if err != nil { return errs.NewError(err) } expiresAt := now.Add(time.Duration(v.DurationDay) * 24 * time.Hour) depositAddress, err := s.CreateETHAddress(ctx) if err != nil { return errs.NewError(err) } userSubApi = &models.ApiSubscriptionKey{ NetworkID: v.NetworkID, UserAddress: strings.ToLower(address), TwitterInfoID: twitterInfo.ID, TwitterID: twitterInfo.TwitterID, ApiKey: apiKeyStr, PackageID: v.ID, QuotaRemaining: v.NumToken, StartedAt: &now, ExpiresAt: &expiresAt, DepositAddress: depositAddress, } err = s.dao.Create(daos.GetDBMainCtx(ctx), userSubApi) if err != nil { return errs.NewError(err) } } } } } return nil } func (s *Service) GetApiPackages(ctx context.Context) ([]*models.ApiSubscriptionPackage, error) { packages, err := s.dao.FindApiSubscriptionPackage(daos.GetDBMainCtx(ctx), map[string][]interface{}{}, map[string][]interface{}{}, []string{"id asc"}, 0, 1000) if err != nil { return nil, errs.NewError(err) } return packages, nil } func (s *Service) GetApiKeyInfo(ctx context.Context, apiKey string, address string) ([]*models.ApiSubscriptionKey, error) { filters := map[string][]interface{}{} if apiKey != "" { filters["api_key = ?"] = []interface{}{apiKey} } if address != "" { filters["user_address = ?"] = []interface{}{strings.ToLower(address)} } obj, err := s.dao.FindApiSubscriptionKey(daos.GetDBMainCtx(ctx), filters, map[string][]interface{}{ "Package": {}, }, []string{}, 0, 100) if err != nil { return nil, errs.NewError(err) } return obj, nil } func (s *Service) ProcessDeposit(ctx context.Context, depositNetworkID uint64, eventID string, txHash string, toAddress string, eventValue *big.Int) error { err := daos.WithTransaction( daos.GetDBMainCtx(ctx), func(tx *gorm.DB) error { key, _ := s.dao.FirstApiSubscriptionKey( tx, map[string][]interface{}{ "deposit_address = ?": {strings.ToLower(toAddress)}, }, map[string][]interface{}{}, []string{}, ) if key != nil { m, err := s.dao.FirstApiSubscriptionHistory( tx, map[string][]interface{}{ "event_id = ?": {eventID}, }, map[string][]interface{}{}, []string{}, ) if err != nil { return errs.NewError(err) } if m == nil { m = &models.ApiSubscriptionHistory{ NetworkID: depositNetworkID, EventId: eventID, UserAddress: key.UserAddress, ApiKey: key.ApiKey, DepositAddress: key.DepositAddress, DepositStatus: models.DepositStatusDone, TxHash: txHash, } err = s.dao.Create( tx, m, ) if err != nil { return errs.NewError(err) } //get packages pack, err := s.dao.FirstApiSubscriptionPackage(tx, map[string][]interface{}{ "network_id = ?": {key.NetworkID}, "price = ?": {numeric.NewBigFloatFromFloat(models.ConvertWeiToBigFloat(eventValue, 18))}, }, map[string][]interface{}{}, []string{}) if err != nil { return errs.NewError(err) } if pack != nil { key, _ = s.dao.FirstApiSubscriptionKeyByID(tx, key.ID, map[string][]interface{}{}, true) if key != nil { key.PackageID = pack.ID key.QuotaRemaining += pack.NumToken newExpired := key.ExpiresAt.Add(time.Duration(pack.DurationDay) * 24 * time.Hour) key.ExpiresAt = &newExpired err = s.dao.Save(tx, key) if err != nil { return errs.NewError(err) } } } } } return nil }, ) if err != nil { return errs.NewError(err) } return nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/blockchain_subcriber.go ================================================ package services import ( "context" "errors" "strings" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/daos" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/ethapi" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/evmapi" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/trxapi" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/zkapi" "github.com/google/uuid" ) func (s *Service) CreateETHAddress(ctx context.Context) (string, error) { addr, prk, err := ethapi.CreateETHAddress() if err != nil { return "", err } addr, _, err = s.coreClient.StoreAddress( addr, prk, 0, "ethereum", ) if err != nil { return "", err } return strings.ToLower(addr), nil } func (s *Service) CreateTRONAddress(ctx context.Context) (string, error) { addr, prk, err := trxapi.CreateTRONAddress() if err != nil { return "", err } addr, _, err = s.coreClient.StoreAddress( addr, prk, 0, "tron", ) if err != nil { return "", err } return addr, nil } func (s *Service) StoreAddress(ctx context.Context, address, prk string) (string, error) { address, _, err := s.coreClient.StoreAddress( address, prk, 0, "ethereum", ) if err != nil { return "", err } return strings.ToLower(address), nil } func (s *Service) CreateBTCAddress(ctx context.Context) (string, error) { addr, prk, err := s.btcAPI.Address() if err != nil { return "", err } addr, _, err = s.coreClient.StoreAddress( addr, prk, 0, "bitcoin", ) if err != nil { return "", err } return addr, nil } func (s *Service) CreateSOLAddress(ctx context.Context) (string, error) { addr, err := s.blockchainUtils.SolanaAddress() if err != nil { return "", err } return addr, nil } func (s *Service) CreateAPIKey(ctx context.Context) (string, string, error) { apiKey := uuid.NewString() secrectKey := uuid.NewString() apiKey, _, err := s.coreClient.StoreAddress( apiKey, secrectKey, 0, "apiKey", ) if err != nil { return "", "", err } return apiKey, secrectKey, nil } func (s *Service) GetEthereumClient(ctx context.Context, networkID uint64) *ethapi.Client { s.jobMutex.Lock() defer s.jobMutex.Unlock() ethApi, ok := s.ethApiMap[networkID] if !ok { rpcUrl := s.conf.GetConfigKeyString( networkID, "rpc_url", ) minGasPrice := "0" if s.conf.ExistsedConfigKey( networkID, "min_gas_price", ) { minGasPrice = s.conf.GetConfigKeyString( networkID, "min_gas_price", ) } isBtcL1 := s.conf.GetConfigKeyBool(networkID, "is_btc_l1") if rpcUrl != "" { ethApi = ðapi.Client{ BaseURL: rpcUrl, MinGasPrice: minGasPrice, BTCL1: isBtcL1, BlockTimeDisabled: true, } if isBtcL1 { ethApi.InscribeTxsLog = s.InscribeTxsLog } if s.conf.ExistsedConfigKey( networkID, "gas_rpc_url", ) { ethApi.BaseGasURL = s.conf.GetConfigKeyString( networkID, "gas_rpc_url", ) } s.ethApiMap[networkID] = ethApi } else { panic(errors.New("rpc url is not found")) } } return ethApi } func (s *Service) GetZkClient(ctx context.Context, networkID uint64) *zkapi.Client { s.jobMutex.Lock() defer s.jobMutex.Unlock() zkApi, ok := s.zkApiMap[networkID] if !ok { rpcUrl := s.conf.GetConfigKeyString( networkID, "rpc_url", ) minGasPrice := "0" if s.conf.ExistsedConfigKey( networkID, "min_gas_price", ) { minGasPrice = s.conf.GetConfigKeyString( networkID, "min_gas_price", ) } if rpcUrl != "" { var paymasterAddress, paymasterToken string var paymasterFeeZero bool if s.conf.ExistsedConfigKey(networkID, "paymaster_address") && s.conf.ExistsedConfigKey(networkID, "paymaster_token") { paymasterAddress = s.conf.GetConfigKeyString(networkID, "paymaster_address") paymasterToken = s.conf.GetConfigKeyString(networkID, "paymaster_token") paymasterFeeZero = s.conf.GetConfigKeyBool(networkID, "paymaster_fee_zero") } zkApi = &zkapi.Client{ BaseURL: rpcUrl, MinGasPrice: minGasPrice, PaymasterAddress: paymasterAddress, PaymasterToken: paymasterToken, PaymasterFeeZero: paymasterFeeZero, } s.zkApiMap[networkID] = zkApi } else { panic(errors.New("rpc url is not found")) } } return zkApi } func (s *Service) GetEVMClient(ctx context.Context, networkID uint64) evmapi.BaseClient { if !s.conf.GetConfigKeyBool(networkID, "zk_sync") { return s.GetEthereumClient(ctx, networkID) } else { return s.GetZkClient(ctx, networkID) } } func (s *Service) InscribeTxsLog(txHash string, inscribeTxHash string, logErr string) { go func() error { err := daos.GetDBMainCtx(context.Background()). Create( &models.BTCL1InscribeTx{ TxHash: txHash, InscribeTxHash: inscribeTxHash, Error: logErr, }, ).Error if err != nil { return errs.NewError(err) } return nil }() } func (s *Service) ApproveMaxEAIForAddress( ctx context.Context, networkID uint64, address string, spender string, ) (string, error) { eaiTokenAddress := strings.ToLower(s.conf.GetConfigKeyString(networkID, "eai_contract_address")) txHash, err := s.GetEthereumClient(ctx, networkID). Erc20ApproveMax( eaiTokenAddress, s.GetAddressPrk(address), spender, ) if err != nil { return "", errs.NewError(err) } return txHash, nil } func (s *Service) DeployProxyAdminAddress( ctx context.Context, networkID uint64, ) (string, string, error) { memePoolAddress := strings.ToLower(s.conf.GetConfigKeyString(networkID, "meme_pool_address")) contractAddress, txHash, err := s.GetEthereumClient(ctx, networkID). DeployProxyAdmin( s.GetAddressPrk(memePoolAddress), ) if err != nil { return "", "", errs.NewError(err) } return contractAddress, txHash, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/blockchain_subcriber_job.go ================================================ package services import ( "context" "fmt" "math/big" "strings" "time" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/daos" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/helpers" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/bridgeapi" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/ethapi" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/types/numeric" "github.com/ethereum/go-ethereum/common" "github.com/jinzhu/gorm" ) func (s *Service) MemeEventsByTransaction(ctx context.Context, networkID uint64, txHash string) error { if !strings.EqualFold(txHash, common.HexToHash(txHash).Hex()) { return errs.NewError(errs.ErrBadRequest) } if networkID != models.TRON_CHAIN_ID { evmClient := s.GetEthereumClient(ctx, networkID) err := evmClient.WaitMined(txHash) if err != nil { return errs.NewError(err) } } ethClient := s.GetEthereumClient(ctx, networkID) eventResp, err := ethClient.EventsByTransaction( txHash, ) if err != nil { return errs.NewError(err) } for i := 0; i < 5; i++ { err = s.MemeEventsByTransactionEventResp( ctx, networkID, eventResp, false, ) if err != nil { continue } break } if err != nil { return errs.NewError(err) } return nil } func (s *Service) UpdateScanBlockError(ctx context.Context, chainID uint, lastBlockError error) error { mapError := map[string]any{} if lastBlockError != nil { mapError["last_block_error"] = lastBlockError.Error() mapError["updated_at"] = time.Now() } err := daos.GetDBMainCtx(ctx). Model(&models.BlockScanInfo{}). Where("id = ?", chainID). Updates(mapError).Error if err != nil { return errs.NewError(err) } return nil } func (s *Service) UpdateScanBlockErrorForNetwork(ctx context.Context, networkID uint64, lastBlockError error) error { mapError := map[string]any{} if lastBlockError != nil { mapError["last_block_error"] = lastBlockError.Error() mapError["updated_at"] = time.Now() } err := daos.GetDBMainCtx(ctx). Model(&models.BlockScanInfo{}). Where("network_id = ?", networkID). Updates(mapError).Error if err != nil { return errs.NewError(err) } return nil } func (s *Service) UpdateScanBlockNumber(ctx context.Context, chainID uint, lastBlockEvent int64) error { mapError := map[string]any{} if lastBlockEvent > 0 { mapError["last_block_number"] = lastBlockEvent mapError["last_block_error"] = "OK" mapError["updated_at"] = time.Now() } err := daos.GetDBMainCtx(ctx). Model(&models.BlockScanInfo{}). Where("id = ?", chainID). Updates(mapError).Error if err != nil { return errs.NewError(err) } return nil } func (s *Service) MemeEventsByTransactionEventResp(ctx context.Context, networkID uint64, eventResp *ethapi.BlockChainEventResp, forScan bool) error { var retErr error // handle transfer events { { poolMap := map[string]bool{} for _, event := range eventResp.Transfer { poolMap[strings.ToLower(event.ContractAddress)] = true } poolArr := []string{} for pool := range poolMap { poolArr = append(poolArr, pool) } poolMap = map[string]bool{} if s.conf.ExistsedConfigKey(networkID, "eai_contract_address") { poolMap[strings.ToLower(strings.ToLower(s.conf.GetConfigKeyString(networkID, "eai_contract_address")))] = true } if len(poolArr) > 0 { memes, err := s.dao.FindMeme( daos.GetDBMainCtx(ctx), map[string][]any{ "token_address in (?)": {poolArr}, }, map[string][]any{}, []string{}, 0, 999999, ) if err != nil { return errs.NewError(err) } for _, meme := range memes { poolMap[strings.ToLower(meme.TokenAddress)] = true } } eventTransfers := []*ethapi.Erc20TokenTransferEventResp{} for _, event := range eventResp.Transfer { if poolMap[strings.ToLower(event.ContractAddress)] { eventTransfers = append(eventTransfers, event) } } eventResp.Transfer = eventTransfers eventResp.NftTransfer = []*ethapi.NftTransferEventResp{} eventResp.ERC1155Transfer = []*ethapi.ERC1155ransferEventResp{} for range 3 { err := s.TokenTransferEventsByTransactionV2( ctx, networkID, eventResp, ) if err == nil { break } } } { poolMap := map[string]bool{} for _, event := range eventResp.Transfer { poolMap[strings.ToLower(event.To)] = true poolMap[strings.ToLower(event.From)] = true } poolArr := []string{} for pool := range poolMap { poolArr = append(poolArr, pool) } poolMap = map[string]bool{} if len(poolArr) > 0 { { agents, err := s.dao.FindAgentInfo( daos.GetDBMainCtx(ctx), map[string][]any{ "eth_address in (?)": {poolArr}, }, map[string][]any{}, []string{}, 0, 999999, ) if err != nil { return errs.NewError(err) } for _, agent := range agents { poolMap[strings.ToLower(agent.ETHAddress)] = true } } { users, err := s.dao.FindUser( daos.GetDBMainCtx(ctx), map[string][]any{ "eth_address in (?)": {poolArr}, }, map[string][]any{}, []string{}, 0, 999999, ) if err != nil { return errs.NewError(err) } for _, user := range users { poolMap[strings.ToLower(user.EthAddress)] = true } } } for _, event := range eventResp.Transfer { if poolMap[strings.ToLower(event.To)] || poolMap[strings.ToLower(event.From)] { err := s.CreateErc20TokenTransferEvent(ctx, networkID, event) if err != nil { return errs.NewError(err) } } } } // { // poolMap := map[string]bool{} // for _, event := range eventResp.Transfer { // poolMap[strings.ToLower(event.To)] = true // } // poolArr := []string{} // for pool := range poolMap { // poolArr = append(poolArr, pool) // } // if len(poolArr) > 0 { // lps, err := s.dao.FindLaunchpad( // daos.GetDBMainCtx(ctx), // map[string][]any{ // "address in (?)": {poolArr}, // }, // map[string][]any{}, // []string{}, // 0, // 999999, // ) // if err != nil { // return errs.NewError(err) // } // poolMap = map[string]bool{} // for _, lp := range lps { // poolMap[strings.ToLower(lp.Address)] = true // } // } // for _, event := range eventResp.Transfer { // if poolMap[strings.ToLower(event.To)] { // err := s.CreateErc20TokenTransferEventLaunchpad(ctx, networkID, event) // if err != nil { // return errs.NewError(err) // } // } // } // } } // handle vibe token factory token deployed events { for _, event := range eventResp.VibeTokenFactoryTokenDeployed { err := s.VibeTokenFactoryTokenDeployedEvent(ctx, networkID, event) if err != nil { retErr = errs.MergeError(retErr, err) } } } // handle meme pool created events { var baseTokenETH, baseTokenEAI string if s.conf.ExistsedConfigKey(networkID, "weth9_contract_address") { baseTokenETH = strings.ToLower(s.conf.GetConfigKeyString(networkID, "weth9_contract_address")) } if s.conf.ExistsedConfigKey(networkID, "eai_contract_address") { baseTokenEAI = strings.ToLower(s.conf.GetConfigKeyString(networkID, "eai_contract_address")) } poolMap := map[string]bool{} for _, event := range eventResp.MemePoolCreated { if !strings.EqualFold(event.Token0, baseTokenETH) && !strings.EqualFold(event.Token0, baseTokenEAI) { poolMap[strings.ToLower(event.Token0)] = true } if !strings.EqualFold(event.Token1, baseTokenETH) && !strings.EqualFold(event.Token1, baseTokenEAI) { poolMap[strings.ToLower(event.Token1)] = true } } poolArr := []string{} for pool := range poolMap { poolArr = append(poolArr, pool) } if len(poolArr) > 0 { memes, err := s.dao.FindMeme( daos.GetDBMainCtx(ctx), map[string][]any{ "token_address in (?)": {poolArr}, }, map[string][]any{}, []string{}, 0, 999999, ) if err != nil { return errs.NewError(err) } if len(memes) > 0 { poolMap := map[string]bool{} for _, meme := range memes { poolMap[strings.ToLower(meme.TokenAddress)] = true } for _, event := range eventResp.MemePoolCreated { if poolMap[strings.ToLower(event.Token0)] || poolMap[strings.ToLower(event.Token1)] { err = s.CreateMemePool( ctx, networkID, event, false, ) if err != nil { retErr = errs.MergeError(retErr, err) } } } } } } // handle meme swap events { poolMap := map[string]bool{} for _, event := range eventResp.MemeSwap { poolMap[strings.ToLower(event.ContractAddress)] = true } poolArr := []string{} for pool := range poolMap { poolArr = append(poolArr, pool) } if len(poolArr) > 0 { memes, err := s.dao.FindMeme( daos.GetDBMainCtx(ctx), map[string][]any{ "pool in (?) or uniswap_pool in (?)": {poolArr, poolArr}, }, map[string][]any{}, []string{}, 0, 999999, ) if err != nil { return errs.NewError(err) } if len(memes) > 0 { poolMap := map[string]bool{} for _, meme := range memes { poolMap[strings.ToLower(meme.Pool)] = true poolMap[strings.ToLower(meme.UniswapPool)] = true } for _, event := range eventResp.MemeSwap { if poolMap[strings.ToLower(event.ContractAddress)] { err = s.CreateMemeTradeHistory( ctx, event, ) if err != nil { retErr = errs.MergeError(retErr, err) } } } } } } if !forScan { // handle meme increase liquidity events for _, event := range eventResp.MemeIncreaseLiquidity { err := s.UpdateMemeLiquidityPosition( ctx, networkID, event, ) if err != nil { retErr = errs.MergeError(retErr, err) } } } // handle system prompt manager new tokens events { for _, event := range eventResp.SystemPromptManagerNewTokens { err := s.SystemPromptManagerNewTokenEvent( ctx, networkID, event, ) if err != nil { retErr = errs.MergeError(retErr, err) } } for _, event := range eventResp.SystemPromptManagerAgentDataUpdates { err := s.SystemPromptManagerAgentDataUpdateEvent( ctx, networkID, event, ) if err != nil { retErr = errs.MergeError(retErr, err) } } for _, event := range eventResp.SystemPromptManagerAgentURIUpdates { err := s.SystemPromptManagerAgentURIUpdateEvent( ctx, networkID, event, ) if err != nil { retErr = errs.MergeError(retErr, err) } } } // handle agent created events { for _, event := range eventResp.AgentCreated { err := s.AgentFactoryAgentCreatedEvent(ctx, networkID, event) if err != nil { retErr = errs.MergeError(retErr, err) } } } // handle agent upgradeable code pointer created events { for _, event := range eventResp.CodePointerCreated { err := s.HandleAgentUpgradeableCodePointerCreated(ctx, event) if err != nil { retErr = errs.MergeError(retErr, err) } } } return retErr } func (s *Service) TokenTransferEventsByTransactionV2(ctx context.Context, networkID uint64, eventResp *ethapi.BlockChainEventResp) error { var retErr, err error if eventResp != nil { { changeBalance := map[string]bool{} for _, v := range eventResp.Transfer { changeBalance[fmt.Sprintf("%s|%s", strings.ToLower(v.ContractAddress), strings.ToLower(v.From))] = true changeBalance[fmt.Sprintf("%s|%s", strings.ToLower(v.ContractAddress), strings.ToLower(v.To))] = true } err = s.CreateErc20TransferEvent(ctx, networkID, changeBalance) if err != nil { retErr = errs.MergeError(retErr, err) } } for _, event := range eventResp.NftTransfer { err = s.CreateErc721TransferEvent( ctx, event, ) if err != nil { retErr = errs.MergeError(retErr, err) } } { changeBalance1155 := map[string]bool{} for _, v := range eventResp.ERC1155Transfer { changeBalance1155[fmt.Sprintf("%s|%s|%s", strings.ToLower(v.ContractAddress), strings.ToLower(v.From), v.Id.Text(10))] = true changeBalance1155[fmt.Sprintf("%s|%s|%s", strings.ToLower(v.ContractAddress), strings.ToLower(v.To), v.Id.Text(10))] = true } err = s.CreateErc1155TransferEvent(ctx, networkID, changeBalance1155) if err != nil { retErr = errs.MergeError(retErr, err) } } } return retErr } func (s *Service) ScanTokenTransferTxHash(ctx context.Context, networkID uint64, hash string) error { eventResp, err := s.GetEthereumClient(ctx, networkID).Erc20EventsByTransaction(hash) if err != nil { return errs.NewError(err) } err = s.TokenTransferEventsByTransaction(ctx, networkID, eventResp) if err != nil { return errs.NewError(err) } return nil } func (s *Service) TokenTransferEventsByTransaction(ctx context.Context, networkID uint64, eventResp *ethapi.Erc20TokenEventResp) error { var retErr, err error if eventResp != nil { { changeBalance := map[string]bool{} for _, v := range eventResp.Transfer { changeBalance[fmt.Sprintf("%s|%s", strings.ToLower(v.ContractAddress), strings.ToLower(v.From))] = true changeBalance[fmt.Sprintf("%s|%s", strings.ToLower(v.ContractAddress), strings.ToLower(v.To))] = true err = s.CreateErc20TokenTransferEvent(ctx, networkID, v) if err != nil { retErr = errs.MergeError(retErr, err) } } err = s.CreateErc20TransferEvent(ctx, networkID, changeBalance) if err != nil { retErr = errs.MergeError(retErr, err) } } for _, event := range eventResp.NftTransfer { err = s.CreateErc721TransferEvent( ctx, event, ) if err != nil { retErr = errs.MergeError(retErr, err) } } { changeBalance1155 := map[string]bool{} for _, v := range eventResp.ERC1155Transfer { changeBalance1155[fmt.Sprintf("%s|%s|%s", strings.ToLower(v.ContractAddress), strings.ToLower(v.From), v.Id.Text(10))] = true changeBalance1155[fmt.Sprintf("%s|%s|%s", strings.ToLower(v.ContractAddress), strings.ToLower(v.To), v.Id.Text(10))] = true } err = s.CreateErc1155TransferEvent(ctx, networkID, changeBalance1155) if err != nil { retErr = errs.MergeError(retErr, err) } } } return retErr } func (s *Service) ErcTransferEventsByTransactionV2(ctx context.Context, networkID uint64, eventResp *ethapi.BlockChainEventResp) error { var retErr, err error if eventResp != nil { { changeBalance := map[string]bool{} for _, v := range eventResp.Transfer { changeBalance[fmt.Sprintf("%s|%s", strings.ToLower(v.ContractAddress), strings.ToLower(v.From))] = true changeBalance[fmt.Sprintf("%s|%s", strings.ToLower(v.ContractAddress), strings.ToLower(v.To))] = true err = s.CreateErc20TokenTransferEvent(ctx, networkID, v) if err != nil { retErr = errs.MergeError(retErr, err) } } err = s.CreateErc20TransferEvent(ctx, networkID, changeBalance) if err != nil { retErr = errs.MergeError(retErr, err) } } for _, event := range eventResp.NftTransfer { err = s.CreateErc721TransferEvent( ctx, event, ) if err != nil { retErr = errs.MergeError(retErr, err) } } { changeBalance1155 := map[string]bool{} for _, v := range eventResp.ERC1155Transfer { changeBalance1155[fmt.Sprintf("%s|%s|%s", strings.ToLower(v.ContractAddress), strings.ToLower(v.From), v.Id.Text(10))] = true changeBalance1155[fmt.Sprintf("%s|%s|%s", strings.ToLower(v.ContractAddress), strings.ToLower(v.To), v.Id.Text(10))] = true } err = s.CreateErc1155TransferEvent(ctx, networkID, changeBalance1155) if err != nil { retErr = errs.MergeError(retErr, err) } } } return retErr } func (s *Service) CreateErc20TransferEvent(ctx context.Context, networkID uint64, changeBalance map[string]bool) error { ethClient := s.GetEthereumClient(ctx, networkID) updateStm := "INSERT INTO erc20_holders (network_id, contract_address, address, balance, created_at) VALUES (?, ?, ?, ?, ?) ON DUPLICATE KEY UPDATE balance = ?, updated_at = ?" now := time.Now() for k := range changeBalance { conAddress := strings.Split(k, "|")[0] userAddress := strings.Split(k, "|")[1] if userAddress != "0x0000000000000000000000000000000000000000" { var err error var balance *big.Int if strings.EqualFold(conAddress, "0x000000000000000000000000000000000000800A") { balance, err = ethClient.Balance(userAddress) if err != nil { fmt.Println(err.Error()) } } else { chainId, err := ethClient.ChainID() if err != nil { return err } if chainId == models.TRON_CHAIN_ID { balance, err = s.trxApi.Trc20Balance(conAddress, userAddress) if err != nil { fmt.Println(err.Error()) } } else { balance, err = ethClient.Erc20Balance(conAddress, userAddress) if err != nil { fmt.Println(err.Error()) } } } if balance == nil { balance = big.NewInt(0) } fBalance := models.ConvertWeiToBigFloat(balance, 18) valueArgs := []any{} valueArgs = append(valueArgs, networkID) valueArgs = append(valueArgs, conAddress) valueArgs = append(valueArgs, userAddress) valueArgs = append(valueArgs, numeric.NewBigFloatFromFloat(fBalance)) valueArgs = append(valueArgs, now) valueArgs = append(valueArgs, numeric.NewBigFloatFromFloat(fBalance)) valueArgs = append(valueArgs, now) err = daos.GetDBMainCtx(ctx).Exec(updateStm, valueArgs...).Error if err != nil { return errs.NewError(err) } } } return nil } func (s *Service) CreateErc721TransferEvent(ctx context.Context, event *ethapi.NftTransferEventResp) error { ethClient := s.GetEthereumClient(ctx, event.NetworkID) updateStm := "INSERT INTO erc721_holders (network_id, contract_address, token_id, owner_address, created_at) VALUES (?, ?, ?, ?, ?) ON DUPLICATE KEY UPDATE owner_address=?, updated_at = ?" now := time.Now() owner, err := ethClient.NftOwnerOf(event.ContractAddress, fmt.Sprintf("%d", uint(event.TokenId.Uint64()))) if err != nil { if strings.Contains(err.Error(), "execution reverted") { owner = "0x0000000000000000000000000000000000000000" } else { return errs.NewError(err) } } valueArgs := []any{} valueArgs = append(valueArgs, event.NetworkID) valueArgs = append(valueArgs, strings.ToLower(event.ContractAddress)) valueArgs = append(valueArgs, uint(event.TokenId.Uint64())) valueArgs = append(valueArgs, strings.ToLower(owner)) valueArgs = append(valueArgs, now) valueArgs = append(valueArgs, strings.ToLower(owner)) valueArgs = append(valueArgs, now) err = daos.GetDBMainCtx(ctx).Exec(updateStm, valueArgs...).Error if err != nil { return errs.NewError(err) } return nil } func (s *Service) CreateErc1155TransferEvent(ctx context.Context, networkID uint64, changeBalance map[string]bool) error { ethClient := s.GetEthereumClient(ctx, networkID) updateStm := "INSERT INTO erc1155_holders (network_id, contract_address, address, token_id, balance, created_at) VALUES (?, ?, ?, ?, ?, ?) ON DUPLICATE KEY UPDATE balance = ?, updated_at = ?" now := time.Now() for k := range changeBalance { err := func() error { conAddress := strings.Split(k, "|")[0] userAddress := strings.Split(k, "|")[1] tokenId := strings.Split(k, "|")[2] if userAddress != "0x0000000000000000000000000000000000000000" { balance, err := ethClient.Erc1155Balance(conAddress, tokenId, userAddress) if err != nil { return errs.NewError(err) } fBalance := models.ConvertWeiToBigFloat(balance, 18) valueArgs := []any{} valueArgs = append(valueArgs, networkID) valueArgs = append(valueArgs, conAddress) valueArgs = append(valueArgs, userAddress) valueArgs = append(valueArgs, tokenId) valueArgs = append(valueArgs, numeric.NewBigFloatFromFloat(fBalance)) valueArgs = append(valueArgs, now) valueArgs = append(valueArgs, numeric.NewBigFloatFromFloat(fBalance)) valueArgs = append(valueArgs, now) err = daos.GetDBMainCtx(ctx).Exec(updateStm, valueArgs...).Error if err != nil { return errs.NewError(err) } } return nil }() if err != nil { fmt.Println(err) } } return nil } func (s *Service) ImageHubSubscriptionPriceUpdatedEvent(ctx context.Context, networkID uint64, event *ethapi.ImageHubSubscriptionPriceUpdated) error { err := daos.WithTransaction( daos.GetDBMainCtx(ctx), func(tx *gorm.DB) error { imageHubAddress := s.conf.GetConfigKeyString(networkID, "image_hub_contract_address") if !strings.EqualFold(event.ContractAddress, imageHubAddress) { return nil } user, err := s.GetUser( tx, networkID, event.Creator, false, ) if err != nil { return errs.NewError(err) } priceUpdated := helpers.GetTimeIndex(uint(event.BlockNumber), event.TxIndex, event.Index) switch event.Duration.Uint64() { case models.DURATION_30D: { if user.Price30dUpdated < priceUpdated { err = tx.Model(user). Where("price30d_updated < ?", priceUpdated). Updates( map[string]any{ "price30d": numeric.NewBigFloatFromFloat(models.ConvertWeiToBigFloat(event.Price, 18)), "price30d_updated": priceUpdated, }, ).Error if err != nil { return errs.NewError(err) } } } case models.DURATION_90D: { if user.Price90dUpdated < priceUpdated { err = tx.Model(user). Where("price90d_updated < ?", priceUpdated). Updates( map[string]any{ "price90d": numeric.NewBigFloatFromFloat(models.ConvertWeiToBigFloat(event.Price, 18)), "price90d_updated": priceUpdated, }, ).Error if err != nil { return errs.NewError(err) } } } } return nil }, ) if err != nil { return errs.NewError(err) } return nil } func (s *Service) CreateErc20TokenTransferEvent(ctx context.Context, networkID uint64, event *ethapi.Erc20TokenTransferEventResp) error { if s.conf.ExistsedConfigKey(networkID, "eai_contract_address") { contractAddress := strings.ToLower(event.ContractAddress) eaiAddress := s.conf.GetConfigKeyString(networkID, "eai_contract_address") toAddress := strings.ToLower(event.To) fromAddress := strings.ToLower(event.From) var istelePost bool if !strings.EqualFold(toAddress, models.ETH_ZERO_ADDRESS) && strings.EqualFold(contractAddress, eaiAddress) { var agent *models.AgentInfo err := daos.WithTransaction( daos.GetDBMainCtx(ctx), func(tx *gorm.DB) error { var err error { agent, err = s.dao.FirstAgentInfo( tx, map[string][]any{ "eth_address = ?": {toAddress}, }, map[string][]any{}, []string{}, ) if err != nil { return errs.NewError(err) } if agent != nil { eventId := fmt.Sprintf("%d_%s_%d", networkID, event.TxHash, event.Index) m, err := s.dao.FirstAgentEaiTopup( tx, map[string][]any{ "event_id = ?": {eventId}, }, map[string][]any{}, []string{}, ) if err != nil { return errs.NewError(err) } if m == nil { m = &models.AgentEaiTopup{ NetworkID: networkID, EventId: eventId, AgentInfoID: agent.ID, Type: models.AgentEaiTopupTypeDeposit, DepositAddress: strings.ToLower(event.From), DepositTxHash: event.TxHash, Amount: numeric.NewBigFloatFromFloat(models.ConvertWeiToBigFloat(event.Value, 18)), Status: models.AgentEaiTopupStatusDone, ToAddress: agent.ETHAddress, } if (m.NetworkID == models.ABSTRACT_TESTNET_CHAIN_ID || m.NetworkID == models.MONAD_TESTNET_CHAIN_ID || m.NetworkID == models.MEGAETH_TESTNET_CHAIN_ID || m.NetworkID == models.BASE_SEPOLIA_CHAIN_ID) && m.NetworkID != agent.NetworkID { m.Status = models.AgentEaiTopupStatusCancelled } err = s.dao.Create( tx, m, ) if err != nil { return errs.NewError(err) } if m.Status == models.AgentEaiTopupStatusDone { err = tx.Model(agent). UpdateColumn("eai_balance", gorm.Expr("eai_balance + ?", m.Amount)). UpdateColumn("eai_wallet_balance", gorm.Expr("eai_wallet_balance + ?", m.Amount)). Error if err != nil { return errs.NewError(err) } } istelePost = true } } } { agent, err = s.dao.FirstAgentInfo( tx, map[string][]any{ "eth_address = ?": {fromAddress}, }, map[string][]any{}, []string{}, ) if err != nil { return errs.NewError(err) } if agent != nil { eventId := fmt.Sprintf("%d_%s_%d", networkID, event.TxHash, event.Index) m, err := s.dao.FirstAgentEaiTopup( tx, map[string][]any{ "event_id = ?": {eventId}, }, map[string][]any{}, []string{}, ) if err != nil { return errs.NewError(err) } if m == nil { m = &models.AgentEaiTopup{ NetworkID: networkID, EventId: eventId, AgentInfoID: agent.ID, Type: models.AgentEaiTopupTypeTransfer, DepositAddress: strings.ToLower(event.From), DepositTxHash: event.TxHash, Amount: numeric.NewBigFloatFromFloat(models.ConvertWeiToBigFloat(event.Value, 18)), Status: models.AgentEaiTopupStatusDone, ToAddress: agent.ETHAddress, } err = s.dao.Create( tx, m, ) if err != nil { return errs.NewError(err) } } } } { switch networkID { case models.BASE_CHAIN_ID: { err = s.UtilityTwitterHandleDeposit(tx, networkID, event) if err != nil { return errs.NewError(err) } } } } // { // err = s.LaunchpadErc20TokenTransferEvent(tx, networkID, event) // if err != nil { // return errs.NewError(err) // } // } // { // switch networkID { // case models.ETHEREUM_CHAIN_ID, // models.BASE_CHAIN_ID: // { // eventId := fmt.Sprintf("%d_%s_%d", networkID, event.TxHash, event.Index) // s.ProcessDeposit(ctx, networkID, eventId, event.TxHash, toAddress, event.Value) // err = s.LaunchpadErc20TokenTransferEvent(tx, networkID, event) // if err != nil { // return errs.NewError(err) // } // } // } // } { user, err := s.dao.FirstUser( tx, map[string][]any{ "eth_address = ?": {toAddress}, }, map[string][]any{}, false, ) if err != nil { return errs.NewError(err) } if user != nil { eventId := fmt.Sprintf("%d_%s_%d", networkID, event.TxHash, event.Index) m, err := s.dao.FirstUserTransaction( tx, map[string][]any{ "event_id = ?": {eventId}, }, map[string][]any{}, []string{}, ) if err != nil { return errs.NewError(err) } if m == nil { m = &models.UserTransaction{ NetworkID: networkID, EventId: eventId, UserID: user.ID, Type: models.UserTransactionTypeDeposit, FromAddress: strings.ToLower(event.From), ToAddress: strings.ToLower(event.To), TxHash: event.TxHash, Amount: numeric.NewBigFloatFromFloat(models.ConvertWeiToBigFloat(event.Value, 18)), Status: models.UserTransactionStatusDone, } if m.NetworkID == models.ABSTRACT_TESTNET_CHAIN_ID || m.NetworkID == models.MONAD_TESTNET_CHAIN_ID || m.NetworkID == models.MEGAETH_TESTNET_CHAIN_ID || m.NetworkID == models.BASE_SEPOLIA_CHAIN_ID { m.Status = models.UserTransactionStatusCancelled } err = s.dao.Create( tx, m, ) if err != nil { return errs.NewError(err) } if m.Status == models.UserTransactionStatusDone { err = tx.Model(user). UpdateColumn("eai_balance", gorm.Expr("eai_balance + ?", m.Amount)). Error if err != nil { return errs.NewError(err) } } } } } return nil }, ) if err != nil { return errs.NewError(err) } if istelePost && agent != nil { if event.Value.Cmp(common.Big0) > 0 { go s.AgentTeleAlertByID(ctx, agent.ID, event.TxHash, models.ConvertWeiToBigFloat(event.Value, 18), networkID) } } } } return nil } func (s *Service) CreateErc20TokenTransferEventLaunchpad(ctx context.Context, networkID uint64, event *ethapi.Erc20TokenTransferEventResp) error { if s.conf.ExistsedConfigKey(networkID, "eai_contract_address") { contractAddress := strings.ToLower(event.ContractAddress) eaiAddress := s.conf.GetConfigKeyString(networkID, "eai_contract_address") toAddress := strings.ToLower(event.To) if !strings.EqualFold(toAddress, models.ETH_ZERO_ADDRESS) && strings.EqualFold(contractAddress, eaiAddress) { err := daos.WithTransaction( daos.GetDBMainCtx(ctx), func(tx *gorm.DB) error { err := s.LaunchpadErc20TokenTransferEvent(tx, networkID, event) if err != nil { return errs.NewError(err) } return nil }, ) if err != nil { return errs.NewError(err) } } } return nil } func (s *Service) CreateSolanaTokenTransferEvent(ctx context.Context, networkID uint64, event *bridgeapi.SolanaEAITxResp) error { switch networkID { case models.SOLANA_CHAIN_ID: { toAddress := event.DepositNativeAddress contractAddress := event.Token if s.conf.ExistsedConfigKey(networkID, "eai_contract_address") { eaiAddress := s.conf.GetConfigKeyString(networkID, "eai_contract_address") if strings.EqualFold(contractAddress, eaiAddress) { var agent *models.AgentInfo err := daos.WithTransaction( daos.GetDBMainCtx(ctx), func(tx *gorm.DB) error { var err error { agent, err = s.dao.FirstAgentInfo( tx, map[string][]any{ "sol_address = ?": {toAddress}, }, map[string][]any{}, []string{}, ) if err != nil { return errs.NewError(err) } if agent != nil { eventId := fmt.Sprintf("%d_%s_%d", networkID, event.TxReceivedDeposit, 0) m, err := s.dao.FirstAgentEaiTopup( tx, map[string][]any{ "event_id = ?": {eventId}, }, map[string][]any{}, []string{}, ) if err != nil { return errs.NewError(err) } if m == nil { m = &models.AgentEaiTopup{ NetworkID: networkID, EventId: eventId, AgentInfoID: agent.ID, Type: models.AgentEaiTopupTypeDeposit, DepositAddress: event.DepositNativeAddress, DepositTxHash: event.TxReceivedDeposit, Amount: numeric.NewBigFloatFromFloat(models.ConvertWeiToBigFloat(&event.Amount.Int, 6)), Status: models.AgentEaiTopupStatusDone, ToAddress: agent.ETHAddress, } err = s.dao.Create( tx, m, ) if err != nil { return errs.NewError(err) } err = tx.Model(agent). UpdateColumn("eai_balance", gorm.Expr("eai_balance + ?", m.Amount)). UpdateColumn("eai_wallet_balance", gorm.Expr("eai_wallet_balance + ?", m.Amount)). Error if err != nil { return errs.NewError(err) } } } } { user, err := s.dao.FirstUser( tx, map[string][]any{ "sol_address = ?": {toAddress}, }, map[string][]any{}, false, ) if err != nil { return errs.NewError(err) } if user != nil { eventId := fmt.Sprintf("%d_%s_%d", networkID, event.TxReceivedDeposit, 0) m, err := s.dao.FirstUserTransaction( tx, map[string][]any{ "event_id = ?": {eventId}, }, map[string][]any{}, []string{}, ) if err != nil { return errs.NewError(err) } if m == nil { m = &models.UserTransaction{ NetworkID: networkID, EventId: eventId, UserID: user.ID, Type: models.UserTransactionTypeDeposit, FromAddress: event.DepositNativeAddress, ToAddress: toAddress, TxHash: event.TxReceivedDeposit, Amount: numeric.NewBigFloatFromFloat(models.ConvertWeiToBigFloat(&event.Amount.Int, 6)), Status: models.UserTransactionStatusDone, } err = s.dao.Create( tx, m, ) if err != nil { return errs.NewError(err) } if m.Status == models.UserTransactionStatusDone { err = tx.Model(user). UpdateColumn("eai_balance", gorm.Expr("eai_balance + ?", m.Amount)). Error if err != nil { return errs.NewError(err) } } } } } return nil }, ) if err != nil { return errs.NewError(err) } if agent != nil { if event.Amount.Int.Cmp(common.Big0) > 0 { go s.AgentTeleAlertByID(ctx, agent.ID, event.TxReceivedDeposit, models.ConvertWeiToBigFloat(&event.Amount.Int, 6), networkID) } } } } } } return nil } func (s *Service) DeleteFilterAddrs(ctx context.Context, networkID uint64) error { for range 5 { err := s.DeleteRedisCachedWithKey(fmt.Sprintf("GetFilterAddrs_%d", networkID)) if err == nil { break } } return nil } func (s *Service) GetFilterAddrs(ctx context.Context, networkID uint64) ([]string, error) { addrs := []string{} err := s.RedisCached( fmt.Sprintf("GetFilterAddrsV1_%d", networkID), true, 5*time.Minute, &addrs, func() (any, error) { addrs := []string{} memeAddresses, err := s.dao.FindAllMemeTokenAddress( daos.GetDBMainCtx(ctx), networkID, ) if err != nil { return nil, errs.NewError(err) } addrs = append(addrs, memeAddresses...) if s.conf.ExistsedConfigKey(networkID, "meme_position_mamanger_address") { addrs = append(addrs, s.conf.GetConfigKeyString(networkID, "meme_position_mamanger_address")) } if s.conf.ExistsedConfigKey(networkID, "meme_factory_contract_address") { addrs = append(addrs, s.conf.GetConfigKeyString(networkID, "meme_factory_contract_address")) } if s.conf.ExistsedConfigKey(networkID, "uniswap_position_mamanger_address") { addrs = append(addrs, s.conf.GetConfigKeyString(networkID, "uniswap_position_mamanger_address")) } if s.conf.ExistsedConfigKey(networkID, "uniswap_factory_contract_address") { addrs = append(addrs, s.conf.GetConfigKeyString(networkID, "uniswap_factory_contract_address")) } if s.conf.ExistsedConfigKey(networkID, "eai_contract_address") { addrs = append(addrs, s.conf.GetConfigKeyString(networkID, "eai_contract_address")) } if s.conf.ExistsedConfigKey(networkID, "agent_contract_address") { addrs = append(addrs, s.conf.GetConfigKeyString(networkID, "agent_contract_address")) } if s.conf.ExistsedConfigKey(networkID, "order_payment_contract_address") { addrs = append(addrs, s.conf.GetConfigKeyString(networkID, "order_payment_contract_address")) } if s.conf.ExistsedConfigKey(networkID, "agent_factory_address") { address := s.conf.GetConfigKeyString(networkID, "agent_factory_address") if address != "" { addrs = append(addrs, address) } } if s.conf.ExistsedConfigKey(networkID, "vibe_token_factory_address") { addrs = append(addrs, s.conf.GetConfigKeyString(networkID, "vibe_token_factory_address")) } agentAddresses, err := s.dao.FindAllAgentAddress( daos.GetDBMainCtx(ctx), networkID, ) if err != nil { return nil, errs.NewError(err) } addrs = append(addrs, agentAddresses...) return addrs, nil }, ) if err != nil { return nil, errs.NewError(err) } return addrs, nil } func (s *Service) ScanEventsByChain(ctx context.Context, networkID uint64) error { err := s.JobRunCheck( ctx, fmt.Sprintf("ScanEventsByChain_%d", networkID), func() error { if networkID > 0 { switch networkID { case models.SOLANA_CHAIN_ID: { err := func(networkID uint64) error { chain, err := s.dao.FirstBlockScanInfo( daos.GetDBMainCtx(ctx), map[string][]any{ "type = ?": {"solana"}, "network_id = ?": {networkID}, "last_block_number > 0": {}, }, map[string][]any{}, []string{}, ) if err != nil { return errs.NewError(err) } if chain == nil { chain = &models.BlockScanInfo{ Type: "solana", NetworkID: networkID, NumBlocks: 100, } lastBlockNumber, err := s.blockchainUtils.SolanaBlockheight() if err != nil { return errs.NewError(err) } if lastBlockNumber <= 0 { lastBlockNumber = 1 } chain.LastBlockNumber = lastBlockNumber err = s.dao.Create( daos.GetDBMainCtx(ctx), chain, ) if err != nil { return errs.NewError(err) } } if !chain.Enabled || chain.LastBlockNumber == 0 { return nil } lastBlockNumber := chain.LastBlockNumber err = func() error { txs, err := s.bridgeAPI.GetSolanaEAITxs(uint64(chain.LastBlockNumber)) if err != nil { return errs.NewError(err) } for _, tx := range txs { err = s.CreateSolanaTokenTransferEvent(ctx, chain.NetworkID, tx) if err != nil { return errs.NewError(err) } if tx.Block > int(lastBlockNumber) { lastBlockNumber = int64(tx.Block) } } return nil }() if err != nil { return errs.NewError(err) } if lastBlockNumber > 0 { err = s.UpdateScanBlockNumber(ctx, chain.ID, lastBlockNumber) if err != nil { return errs.NewError(err) } } return nil }(networkID) if err != nil { _ = s.UpdateScanBlockErrorForNetwork(ctx, networkID, err) return errs.NewError(err) } } default: { err := func(networkID uint64) error { for { chain, err := s.dao.FirstBlockScanInfo( daos.GetDBMainCtx(ctx), map[string][]any{ "type = ?": {"evm"}, "network_id = ?": {networkID}, "last_block_number > 0": {}, }, map[string][]any{}, []string{}, ) if err != nil { return errs.NewError(err) } ethClient := s.GetEthereumClient(ctx, networkID) if chain == nil { chain = &models.BlockScanInfo{ Type: "evm", NetworkID: networkID, NumBlocks: 100, } lastBlockNumber, err := ethClient.GetLastBlockNumber() if err != nil { return errs.NewError(err) } if lastBlockNumber <= 0 { lastBlockNumber = 1 } chain.LastBlockNumber = lastBlockNumber err = s.dao.Create( daos.GetDBMainCtx(ctx), chain, ) if err != nil { return errs.NewError(err) } } if !chain.Enabled || chain.LastBlockNumber == 0 { break } addrs, err := s.GetFilterAddrs(ctx, chain.NetworkID) if err != nil { return errs.NewError(err) } startBlocks := chain.LastBlockNumber + 1 endBlocks := (chain.LastBlockNumber + chain.NumBlocks - 1) eventResp, err := ethClient.ScanEvents(addrs, startBlocks, endBlocks) if err != nil { return errs.NewError(err) } if eventResp != nil { err = s.MemeEventsByTransactionEventResp(ctx, chain.NetworkID, eventResp, true) if err != nil { return errs.NewError(err) } else { lastBlockNumber := endBlocks if endBlocks > eventResp.LastBlockNumber { lastBlockNumber = eventResp.LastBlockNumber } err = s.UpdateScanBlockNumber(ctx, chain.ID, lastBlockNumber) if err != nil { return errs.NewError(err) } if endBlocks >= eventResp.LastBlockNumber { break } } } else { break } } return nil }(networkID) if err != nil { _ = s.UpdateScanBlockErrorForNetwork(ctx, networkID, err) return errs.NewError(err) } } } } return nil }, ) if err != nil { return errs.NewError(err) } return nil } // func (s *Service) JobScanEventsByChain(ctx context.Context) error { // err := s.JobRunCheck( // ctx, "JobScanEventsByChain", // func() error { // var retErr error // var networkIDs []uint64 // for networkIDStr := range s.conf.Networks { // networkID, _ := strconv.ParseUint(networkIDStr, 10, 64) // networkIDs = append(networkIDs, networkID) // } // // random networkIDs // rand.Shuffle(len(networkIDs), func(i, j int) { // networkIDs[i], networkIDs[j] = networkIDs[j], networkIDs[i] // }) // for _, networkID := range networkIDs { // err := s.ScanEventsByChain(ctx, networkID) // if err != nil { // retErr = errs.MergeError(retErr, errs.NewErrorWithId(err, networkID)) // } // } // return retErr // }, // ) // if err != nil { // return errs.NewError(err) // } // return nil // } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/dex_srv.go ================================================ package services import ( "context" "encoding/json" "fmt" "io" "log" "net/http" "os" "os/signal" "syscall" "time" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/daos" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/helpers" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/serializers" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/dexscreener" "github.com/jinzhu/gorm" ) // call dexscreener api func (s *Service) CallWssDexScreener() { client := dexscreener.NewDexScreenerClient(true) client.OnPair(func(pair dexscreener.Pair) { data, _ := json.Marshal(pair) fmt.Printf("Received pair: %s\n", string(data)) }) ctx, cancel := context.WithCancel(context.Background()) defer cancel() // Handle graceful shutdown sigChan := make(chan os.Signal, 1) signal.Notify(sigChan, syscall.SIGINT, syscall.SIGTERM) go func() { <-sigChan cancel() }() if err := client.Connect(ctx, "trendingScoreH24"); err != nil { log.Fatalf("Failed to connect: %v", err) } // Wait for context cancellation <-ctx.Done() client.Close() } func (s *Service) TestCrawlDexScreener(ctx context.Context) { link := "https://dexscreener.com/solana?rankBy=trendingScoreH24&order=desc" txt := helpers.RodContentHtmlByUrl(link) fmt.Printf("Crawled dexscreener: %s\n", txt) } func (s *Service) JobUpdateTrendingTokens(ctx context.Context) error { return s.JobRunCheck( ctx, "JobUpdateTrendingTokens", func() error { // Get trending tokens from Moralis tokens, err := s.moralisClient.GetTrendingTokens("solana") if err != nil { return fmt.Errorf("failed to get trending tokens: %v", err) } // Use transaction helper return daos.WithTransaction( daos.GetDBMainCtx(ctx), func(tx *gorm.DB) error { // Delete all existing records if err := tx.Unscoped().Delete(&models.TrendingToken{}).Error; err != nil { return errs.NewError(err) } // Process each token for _, token := range tokens { // Convert CreatedAt int64 timestamp to time.Time mintAt := time.Unix(token.CreatedAt, 0) trendingToken := &models.TrendingToken{ ChainId: token.ChainId, TokenAddress: token.TokenAddress, Name: token.Name, Symbol: token.Symbol, Decimals: token.Decimals, Logo: token.Logo, UsdPrice: token.UsdPrice, MarketCap: token.MarketCap, LiquidityUsd: token.LiquidityUsd, Holders: token.Holders, MintAt: &mintAt, // Price changes PriceChange1h: token.PricePercentChange.OneHour, PriceChange4h: token.PricePercentChange.FourHour, PriceChange12h: token.PricePercentChange.TwelveHour, PriceChange24h: token.PricePercentChange.TwentyFourHour, // Volumes Volume1h: token.TotalVolume.OneHour, Volume4h: token.TotalVolume.FourHour, Volume12h: token.TotalVolume.TwelveHour, Volume24h: token.TotalVolume.TwentyFourHour, // Transactions Transactions1h: int(token.Transactions.OneHour), Transactions4h: int(token.Transactions.FourHour), Transactions12h: int(token.Transactions.TwelveHour), Transactions24h: int(token.Transactions.TwentyFourHour), // Buy transactions BuyTransactions1h: int(token.BuyTransactions.OneHour), BuyTransactions4h: int(token.BuyTransactions.FourHour), BuyTransactions12h: int(token.BuyTransactions.TwelveHour), BuyTransactions24h: int(token.BuyTransactions.TwentyFourHour), // Sell transactions SellTransactions1h: int(token.SellTransactions.OneHour), SellTransactions4h: int(token.SellTransactions.FourHour), SellTransactions12h: int(token.SellTransactions.TwelveHour), SellTransactions24h: int(token.SellTransactions.TwentyFourHour), // Buyers Buyers1h: int(token.Buyers.OneHour), Buyers4h: int(token.Buyers.FourHour), Buyers12h: int(token.Buyers.TwelveHour), Buyers24h: int(token.Buyers.TwentyFourHour), // Sellers Sellers1h: int(token.Sellers.OneHour), Sellers4h: int(token.Sellers.FourHour), Sellers12h: int(token.Sellers.TwelveHour), Sellers24h: int(token.Sellers.TwentyFourHour), } // Create new token if err := tx.Create(trendingToken).Error; err != nil { return errs.NewError(err) } } return nil }, ) }, ) } func (s *Service) GetListTrendingTokens(ctx context.Context) ([]*models.TrendingToken, error) { tokens, err := s.dao.FindTrendingToken( daos.GetDBMainCtx(ctx), map[string][]interface{}{ // "mint_at >= now() - interval 1 day ": []interface{}{}, "market_cap >= 200000": []interface{}{}, // "volume1h >= 1000000": []interface{}{}, // "buyers1h >= 1000": []interface{}{}, "transactions1h >= 1000": []interface{}{}, }, map[string][]interface{}{}, []string{}, 0, 100, ) if err != nil { return nil, errs.NewError(err) } return tokens, nil } func (s *Service) GetPumpOrderHistory(ctx context.Context, apiKey string) (*serializers.PumpOrderResponse, error) { client := &http.Client{ Timeout: 30 * time.Second, } req, err := http.NewRequestWithContext(ctx, "GET", "https://pump-backend.bvm.network/api/v1/order", nil) if err != nil { return nil, fmt.Errorf("failed to create request: %w", err) } req.Header.Set("api-key", apiKey) req.Header.Set("Content-Type", "application/json") resp, err := client.Do(req) if err != nil { return nil, fmt.Errorf("failed to send request: %w", err) } defer resp.Body.Close() if resp.StatusCode != http.StatusOK { body, _ := io.ReadAll(resp.Body) return nil, fmt.Errorf("unexpected status code: %d, body: %s", resp.StatusCode, string(body)) } var response serializers.PumpOrderResponse if err := json.NewDecoder(resp.Body).Decode(&response); err != nil { return nil, fmt.Errorf("failed to decode response: %w", err) } return &response, nil } func (s *Service) GetPumpBalance(ctx context.Context, apiKey string) (*serializers.PumpBalanceResponse, error) { client := &http.Client{ Timeout: 30 * time.Second, } req, err := http.NewRequestWithContext(ctx, "GET", "https://pump-backend.bvm.network/api/v1/wallet/balance", nil) if err != nil { return nil, fmt.Errorf("failed to create request: %w", err) } req.Header.Set("api-key", apiKey) req.Header.Set("Content-Type", "application/json") resp, err := client.Do(req) if err != nil { return nil, fmt.Errorf("failed to send request: %w", err) } defer resp.Body.Close() if resp.StatusCode != http.StatusOK { body, _ := io.ReadAll(resp.Body) return nil, fmt.Errorf("unexpected status code: %d, body: %s", resp.StatusCode, string(body)) } var response serializers.PumpBalanceResponse if err := json.NewDecoder(resp.Body).Decode(&response); err != nil { return nil, fmt.Errorf("failed to decode response: %w", err) } return &response, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/external_wallet_srv.go ================================================ package services import ( "context" "math" "math/big" "strings" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/daos" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/serializers" blockchainutils "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/blockchain_utils" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/types/numeric" ) func (s *Service) ExternalWalletCreateSOL(ctx context.Context) (*serializers.ExternalWalletResp, error) { apiKey, secrectKey, err := s.CreateAPIKey(ctx) if err != nil { return nil, errs.NewError(err) } solAddress, err := s.CreateSOLAddress(ctx) if err != nil { return nil, errs.NewError(err) } err = s.dao.Create( daos.GetDBMainCtx(ctx), &models.ExternalWallet{ APIKey: secrectKey, Type: models.ExternalWalletTypeSOL, Address: solAddress, }, ) if err != nil { return nil, errs.NewError(err) } return &serializers.ExternalWalletResp{ ApiKey: apiKey, Address: solAddress, }, nil } func (s *Service) ExternalWalletGet(ctx context.Context, apiKey string) (*serializers.ExternalWalletResp, error) { m, err := s.dao.FirstExternalWallet( daos.GetDBMainCtx(ctx), map[string][]interface{}{ "api_key = ?": {s.GetAddressPrk(apiKey)}, }, map[string][]interface{}{}, []string{}, ) if err != nil { return nil, errs.NewError(err) } if m == nil { return nil, errs.NewError(errs.ErrBadRequest) } return &serializers.ExternalWalletResp{ Address: m.Address, }, nil } func (s *Service) ExternalWalletBalances(ctx context.Context, apiKey string) ([]*serializers.SolanaTokenBalanceResp, error) { m, err := s.dao.FirstExternalWallet( daos.GetDBMainCtx(ctx), map[string][]interface{}{ "api_key = ?": {s.GetAddressPrk(apiKey)}, }, map[string][]interface{}{}, []string{}, ) if err != nil { return nil, errs.NewError(err) } if m == nil { return nil, errs.NewError(errs.ErrBadRequest) } balances, err := s.blockchainUtils.SolanaGetTokenBalances(m.Address) if err != nil { return nil, errs.NewError(err) } resps := []*serializers.SolanaTokenBalanceResp{} for _, v := range balances { if v.TokenAmount.UIAmount > 0 { resps = append(resps, &serializers.SolanaTokenBalanceResp{ IsNative: v.IsNative, Mint: v.Mint, Amount: v.TokenAmount.UIAmount, }) } } return resps, nil } func (s *Service) ExternalWalletComputeOrder(ctx context.Context, apiKey string, req *serializers.ExternalWalletOrderReq) (float64, error) { wallet, err := s.dao.FirstExternalWallet( daos.GetDBMainCtx(ctx), map[string][]interface{}{ "api_key = ?": {s.GetAddressPrk(apiKey)}, }, map[string][]interface{}{}, []string{}, ) if err != nil { return 0, errs.NewError(err) } if wallet == nil { return 0, errs.NewError(errs.ErrBadRequest) } switch req.Action { case models.ExternalWalletOrderTypeBuy, models.ExternalWalletOrderTypeSell: { var inputMint, outputMint string var decimalsIn, decimalsOut, decimalsMint int decimalsMint, err = s.GetSolanaTokenDecimals(req.Mint) if err != nil { return 0, errs.NewError(err) } switch req.Action { case models.ExternalWalletOrderTypeBuy: { inputMint = "So11111111111111111111111111111111111111112" outputMint = req.Mint decimalsIn = 9 decimalsOut = decimalsMint } case models.ExternalWalletOrderTypeSell: { inputMint = req.Mint outputMint = "So11111111111111111111111111111111111111112" decimalsIn = decimalsMint decimalsOut = 9 } default: { return 0, errs.NewError(errs.ErrBadContent) } } resp, err := s.blockchainUtils.SolanaComputeRaydiumToken( &blockchainutils.SolanaTradeRaydiumTokenReq{ Address: wallet.Address, InputMint: inputMint, OutputMint: outputMint, Slippage: 0.5, Amount: uint64(req.Amount * math.Pow10(decimalsIn)), }, ) if err != nil { return 0, errs.NewError(err) } if resp == nil { return 0, nil } return float64(resp.OutputAmount.Int64()) / math.Pow10(decimalsOut), nil } default: { return 0, errs.NewError(errs.ErrBadContent) } } } func (s *Service) ExternalWalletCreateOrder(ctx context.Context, apiKey string, req *serializers.ExternalWalletOrderReq) (*models.ExternalWalletOrder, error) { wallet, err := s.dao.FirstExternalWallet( daos.GetDBMainCtx(ctx), map[string][]interface{}{ "api_key = ?": {s.GetAddressPrk(apiKey)}, }, map[string][]interface{}{}, []string{}, ) if err != nil { return nil, errs.NewError(err) } if wallet == nil { return nil, errs.NewError(errs.ErrBadRequest) } order := &models.ExternalWalletOrder{ ExternalWalletID: wallet.ID, Type: models.ExternalWalletOrderType(req.Action), TokenAddress: req.Mint, Destination: req.Destination, AmountIn: numeric.NewBigFloatFromFloat(big.NewFloat(req.Amount)), Status: models.ExternalWalletOrderStatusNew, } err = s.dao.Create( daos.GetDBMainCtx(ctx), order, ) if err != nil { return nil, errs.NewError(err) } switch req.Action { case models.ExternalWalletOrderTypeBuy, models.ExternalWalletOrderTypeSell: { var inputMint, outputMint string var decimalsIn, decimalsOut, decimalsMint int decimalsMint, err = s.GetSolanaTokenDecimals(req.Mint) if err != nil { return nil, errs.NewError(err) } switch req.Action { case models.ExternalWalletOrderTypeBuy: { inputMint = "So11111111111111111111111111111111111111112" outputMint = req.Mint decimalsIn = 9 decimalsOut = decimalsMint } case models.ExternalWalletOrderTypeSell: { inputMint = req.Mint outputMint = "So11111111111111111111111111111111111111112" decimalsIn = decimalsMint decimalsOut = 9 } default: { return nil, errs.NewError(errs.ErrBadContent) } } resp, err := s.blockchainUtils.SolanaTradeRaydiumToken( &blockchainutils.SolanaTradeRaydiumTokenReq{ Address: wallet.Address, InputMint: inputMint, OutputMint: outputMint, Slippage: 0.5, Amount: uint64(req.Amount * math.Pow10(decimalsIn)), }, ) if err != nil { order.Error = err.Error() order.Status = models.ExternalWalletOrderStatusError } else { order.Status = models.ExternalWalletOrderStatusDone order.TxHash = strings.Join(resp.Signatures, ",") order.AmountOut = numeric.NewBigFloatFromFloat(models.ConvertWeiToBigFloat(&resp.OutputAmount.Int, uint(decimalsOut))) } err = s.dao.Save( daos.GetDBMainCtx(ctx), order, ) if err != nil { return nil, errs.NewError(err) } } case models.ExternalWalletOrderTypeWithdraw: { decimalsMint := 9 if req.Mint != "" { decimalsMint, err = s.GetSolanaTokenDecimals(req.Mint) if err != nil { return nil, errs.NewError(err) } } resp, err := s.blockchainUtils.SolanaTransfer( wallet.Address, &blockchainutils.SolanaTransferReq{ Mint: req.Mint, Amount: req.Amount * math.Pow10(decimalsMint), ToAddress: req.Destination, }, ) if err != nil { order.Error = err.Error() order.Status = models.ExternalWalletOrderStatusError } else { order.Status = models.ExternalWalletOrderStatusDone order.TxHash = resp } err = s.dao.Save( daos.GetDBMainCtx(ctx), order, ) if err != nil { return nil, errs.NewError(err) } } default: { return nil, errs.NewError(errs.ErrBadContent) } } return order, nil } func (s *Service) ExternalWalletGetOrders(ctx context.Context, apiKey string, page int, limit int) ([]*models.ExternalWalletOrder, error) { m, err := s.dao.FirstExternalWallet( daos.GetDBMainCtx(ctx), map[string][]interface{}{ "api_key = ?": {s.GetAddressPrk(apiKey)}, }, map[string][]interface{}{}, []string{}, ) if err != nil { return nil, errs.NewError(err) } if m == nil { return nil, errs.NewError(errs.ErrBadRequest) } orders, _, err := s.dao.FindExternalWalletOrder4Page( daos.GetDBMainCtx(ctx), map[string][]interface{}{ "external_wallet_id = ?": {m.ID}, }, map[string][]interface{}{}, []string{ "id desc", }, page, limit, ) if err != nil { return nil, errs.NewError(err) } return orders, nil } func (s *Service) ExternalWalletGetTokens(ctx context.Context, apiKey string) ([]*models.ExternalWalletToken, error) { m, err := s.dao.FirstExternalWallet( daos.GetDBMainCtx(ctx), map[string][]interface{}{ "api_key = ?": {s.GetAddressPrk(apiKey)}, }, map[string][]interface{}{}, []string{}, ) if err != nil { return nil, errs.NewError(err) } if m == nil { return nil, errs.NewError(errs.ErrBadRequest) } tokens, err := s.dao.FindExternalWalletToken( daos.GetDBMainCtx(ctx), map[string][]interface{}{ "enabled = ?": {true}, }, map[string][]interface{}{}, []string{}, 0, 999999, ) if err != nil { return nil, errs.NewError(err) } return tokens, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/infra_twitter_app.go ================================================ package services import ( "context" "fmt" "strings" "time" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/daos" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/helpers" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/serializers" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/ethapi" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/twitter" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/types/numeric" "github.com/google/uuid" "github.com/jinzhu/gorm" ) // func (s *Service) InfraTwitterAppAuthenInstall(ctx context.Context, installCode string, installUri string) (string, error) { // err := func() error { // if installCode == "" { // return errs.NewError(errs.ErrBadRequest) // } // infraTwitterApp, err := s.dao.FirstInfraTwitterApp( // daos.GetDBMainCtx(ctx), // map[string][]any{ // "install_code = ?": {installCode}, // }, // map[string][]any{}, []string{}, // ) // if err != nil { // return errs.NewError(err) // } // if infraTwitterApp == nil { // var res struct { // Result string `json:"result"` // } // err = helpers.CurlURL(s.conf.InfraTwitterApp.InfraAuthUri+"?code="+installCode, http.MethodGet, nil, nil, &res) // if err != nil { // return errs.NewError(err) // } // if res.Result == "" { // return errs.NewError(errs.ErrBadRequest) // } // infraTwitterApp = &models.InfraTwitterApp{ // Address: res.Result, // InstallCode: installCode, // } // } // err = s.dao.Save(daos.GetDBMainCtx(ctx), infraTwitterApp) // if err != nil { // return errs.NewError(err) // } // return nil // }() // if err != nil { // return helpers.BuildUri( // installUri, // map[string]string{ // "error": err.Error(), // }, // ), nil // } // redirectUri := helpers.BuildUri( // s.conf.InfraTwitterApp.RedirectUri, // map[string]string{ // "install_code": installCode, // "install_uri": installUri, // }, // ) // return helpers.BuildUri( // "https://twitter.com/i/oauth2/authorize", // map[string]string{ // "client_id": s.conf.InfraTwitterApp.OauthClientId, // "state": "state", // "response_type": "code", // "code_challenge": "challenge", // "code_challenge_method": "plain", // "scope": "offline.access+tweet.read+tweet.write+users.read+follows.write+like.write+like.read+users.read", // "redirect_uri": redirectUri, // }, // ), nil // } // func (s *Service) InfraTwitterAppAuthenCallback(ctx context.Context, installCode string, installUri string, code string) (string, error) { // if installCode == "" || code == "" { // return "", errs.NewError(errs.ErrBadRequest) // } // infraTwitterApp, err := func() (*models.InfraTwitterApp, error) { // redirectUri := helpers.BuildUri( // s.conf.InfraTwitterApp.RedirectUri, // map[string]string{ // "install_code": installCode, // "install_uri": installUri, // }, // ) // respOauth, err := s.twitterAPI.TwitterOauthCallbackForSampleApp( // s.conf.InfraTwitterApp.OauthClientId, s.conf.InfraTwitterApp.OauthClientSecret, code, redirectUri) // if err != nil { // return nil, errs.NewError(err) // } // if respOauth != nil && respOauth.AccessToken != "" { // twitterUser, err := s.twitterAPI.GetTwitterMe(respOauth.AccessToken) // if err != nil { // return nil, errs.NewError(err) // } // twitterInfo, err := s.dao.FirstTwitterInfo( // daos.GetDBMainCtx(ctx), // map[string][]any{ // "twitter_id = ?": {twitterUser.ID}, // }, // map[string][]any{}, // false, // ) // if err != nil { // return nil, errs.NewError(err) // } // if twitterInfo == nil { // twitterInfo = &models.TwitterInfo{ // TwitterID: twitterUser.ID, // } // } // twitterInfo.TwitterAvatar = twitterUser.ProfileImageURL // twitterInfo.TwitterName = twitterUser.Name // twitterInfo.TwitterUsername = twitterUser.UserName // twitterInfo.AccessToken = respOauth.AccessToken // twitterInfo.RefreshToken = respOauth.RefreshToken // twitterInfo.ExpiresIn = respOauth.ExpiresIn // twitterInfo.Scope = respOauth.Scope // twitterInfo.TokenType = respOauth.TokenType // twitterInfo.OauthClientId = s.conf.InfraTwitterApp.OauthClientId // twitterInfo.OauthClientSecret = s.conf.InfraTwitterApp.OauthClientSecret // twitterInfo.Description = twitterUser.Description // twitterInfo.RefreshError = "OK" // expiredAt := time.Now().Add(time.Second * time.Duration(respOauth.ExpiresIn-(60*20))) // twitterInfo.ExpiredAt = &expiredAt // err = s.dao.Save(daos.GetDBMainCtx(ctx), twitterInfo) // if err != nil { // return nil, errs.NewError(err) // } // infraTwitterApp, err := s.dao.FirstInfraTwitterApp( // daos.GetDBMainCtx(ctx), // map[string][]any{ // "install_code = ?": {installCode}, // }, // map[string][]any{}, []string{}, // ) // if err != nil { // return nil, errs.NewError(err) // } // if infraTwitterApp == nil { // return nil, errs.NewError(errs.ErrBadRequest) // } // infraTwitterApp.TwitterInfoID = twitterInfo.ID // infraTwitterApp.TwitterInfo = twitterInfo // err = s.dao.Save(daos.GetDBMainCtx(ctx), infraTwitterApp) // if err != nil { // return nil, errs.NewError(err) // } // return infraTwitterApp, nil // } // return nil, errs.NewError(errs.ErrBadRequest) // }() // if err != nil { // return helpers.BuildUri( // installUri, // map[string]string{ // "install_code": installCode, // "error": err.Error(), // }, // ), nil // } // params := map[string]string{ // "address": infraTwitterApp.Address, // "twitter_id": infraTwitterApp.TwitterInfo.TwitterID, // "twitter_username": infraTwitterApp.TwitterInfo.TwitterUsername, // "twitter_name": infraTwitterApp.TwitterInfo.TwitterName, // } // returnData := base64.StdEncoding.EncodeToString([]byte(helpers.ConvertJsonString(params))) // return helpers.BuildUri( // installUri, // map[string]string{ // "install_code": installCode, // "return_data": returnData, // }, // ), nil // } func (s *Service) InfraTwitterAppAuthenInstall(ctx context.Context, userAddress string) (string, error) { err := func() error { infraTwitterApp, err := s.dao.FirstInfraTwitterApp( daos.GetDBMainCtx(ctx), map[string][]any{ "address = ?": {strings.ToLower(userAddress)}, }, map[string][]any{}, []string{}, ) if err != nil { return errs.NewError(err) } if infraTwitterApp == nil { ethAddress, err := s.CreateETHAddress(ctx) if err != nil { return errs.NewError(err) } infraTwitterApp = &models.InfraTwitterApp{ Address: strings.ToLower(userAddress), ETHAddress: strings.ToLower(ethAddress), } err = s.dao.Create(daos.GetDBMainCtx(ctx), infraTwitterApp) if err != nil { return errs.NewError(err) } } return nil }() if err != nil { return "", errs.NewError(err) } redirectUri := helpers.BuildUri( s.conf.InfraTwitterApp.RedirectUri, map[string]string{ "address": userAddress, }, ) return helpers.BuildUri( "https://twitter.com/i/oauth2/authorize", map[string]string{ "redirect_uri": redirectUri, "client_id": s.conf.InfraTwitterApp.OauthClientId, "state": "state", "response_type": "code", "code_challenge": "challenge", "code_challenge_method": "plain", "scope": "offline.access+tweet.read+tweet.write+users.read+follows.write+like.write+like.read", }, ), nil } func (s *Service) InfraTwitterAppAuthenCallback(ctx context.Context, address string, code string) (string, error) { _, err := func() (*models.InfraTwitterApp, error) { redirectUri := helpers.BuildUri( s.conf.InfraTwitterApp.RedirectUri, map[string]string{ "address": address, }, ) respOauth, err := s.twitterAPI.TwitterOauthCallbackForSampleApp( s.conf.InfraTwitterApp.OauthClientId, s.conf.InfraTwitterApp.OauthClientSecret, code, redirectUri) if err != nil { return nil, errs.NewError(err) } if respOauth != nil && respOauth.AccessToken != "" { twitterUser, err := s.twitterAPI.GetTwitterMe(respOauth.AccessToken) if err != nil { return nil, errs.NewError(err) } twitterInfo, err := s.dao.FirstTwitterInfo( daos.GetDBMainCtx(ctx), map[string][]any{ "twitter_id = ?": {twitterUser.ID}, }, map[string][]any{}, false, ) if err != nil { return nil, errs.NewError(err) } if twitterInfo == nil { twitterInfo = &models.TwitterInfo{ TwitterID: twitterUser.ID, } } twitterInfo.TwitterAvatar = twitterUser.ProfileImageURL twitterInfo.TwitterName = twitterUser.Name twitterInfo.TwitterUsername = twitterUser.UserName twitterInfo.AccessToken = respOauth.AccessToken twitterInfo.RefreshToken = respOauth.RefreshToken twitterInfo.ExpiresIn = respOauth.ExpiresIn twitterInfo.Scope = respOauth.Scope twitterInfo.TokenType = respOauth.TokenType twitterInfo.OauthClientId = s.conf.InfraTwitterApp.OauthClientId twitterInfo.OauthClientSecret = s.conf.InfraTwitterApp.OauthClientSecret twitterInfo.Description = twitterUser.Description twitterInfo.RefreshError = "OK" expiredAt := time.Now().Add(time.Second * time.Duration(respOauth.ExpiresIn-(60*20))) twitterInfo.ExpiredAt = &expiredAt err = s.dao.Save(daos.GetDBMainCtx(ctx), twitterInfo) if err != nil { return nil, errs.NewError(err) } infraTwitterApp, err := s.dao.FirstInfraTwitterApp( daos.GetDBMainCtx(ctx), map[string][]any{ "address = ?": {strings.ToLower(address)}, }, map[string][]any{}, []string{}, ) if err != nil { return nil, errs.NewError(err) } if infraTwitterApp == nil { return nil, errs.NewError(errs.ErrBadRequest) } if infraTwitterApp.ETHAddress == "" { ethAddress, err := s.CreateETHAddress(ctx) if err != nil { return nil, errs.NewError(err) } infraTwitterApp.ETHAddress = strings.ToLower(ethAddress) } infraTwitterApp.TwitterInfoID = twitterInfo.ID infraTwitterApp.TwitterInfo = twitterInfo err = s.dao.Save(daos.GetDBMainCtx(ctx), infraTwitterApp) if err != nil { return nil, errs.NewError(err) } return infraTwitterApp, nil } return nil, errs.NewError(errs.ErrBadRequest) }() if err != nil { return "", errs.NewError(err) } // if err != nil { // return helpers.BuildUri( // installUri, // map[string]string{ // "address": address, // "error": err.Error(), // }, // ), nil // } // params := map[string]string{ // "address": infraTwitterApp.Address, // "twitter_id": infraTwitterApp.TwitterInfo.TwitterID, // "twitter_username": infraTwitterApp.TwitterInfo.TwitterUsername, // "twitter_name": infraTwitterApp.TwitterInfo.TwitterName, // } // returnData := base64.StdEncoding.EncodeToString([]byte(helpers.ConvertJsonString(params))) return "", nil } func (s *Service) UtilityPostTwitter(ctx context.Context, userAddress string, req *serializers.AgentUtilityTwitterReq) (*serializers.AgentUtilityTwitterResp, error) { resp := &serializers.AgentUtilityTwitterResp{} err := daos.WithTransaction( daos.GetDBMainCtx(ctx), func(tx *gorm.DB) error { infraTwitterApp, err := s.dao.FirstInfraTwitterApp( tx, map[string][]any{ "address = ?": {strings.ToLower(userAddress)}, }, map[string][]any{ "TwitterInfo": {}, }, []string{}, ) if err != nil { resp.AuthUrl, _ = s.InfraTwitterAppAuthenInstall(ctx, userAddress) return errs.NewError(errs.ErrAgentUtilityNotFound) } if infraTwitterApp == nil || (infraTwitterApp != nil && infraTwitterApp.TwitterInfo == nil) || (infraTwitterApp != nil && infraTwitterApp.TwitterInfo != nil && infraTwitterApp.TwitterInfo.RefreshError != "OK") { resp.AuthUrl, _ = s.InfraTwitterAppAuthenInstall(ctx, userAddress) // resp.Message = errs.ErrAgentUtilityNotAuthen.Message return errs.NewError(errs.ErrAgentUtilityNotAuthen) } if s.conf.InfraTwitterApp.Fee > 0 { if infraTwitterApp != nil && infraTwitterApp.RemainRequest <= 0 { resp.Message = strings.ReplaceAll(errs.ErrAgentUtilityInvalidBalance.Message, "{address}", s.conf.InfraTwitterApp.AgentAddress) return errs.NewError(errs.ErrAgentUtilityInvalidBalance) } } if infraTwitterApp != nil && infraTwitterApp.TwitterInfo != nil && infraTwitterApp.TwitterInfo.RefreshError == "OK" { if s.conf.InfraTwitterApp.Fee > 0 { eventId := uuid.New().String() feePerRequest := numeric.NewBigFloatFromString(fmt.Sprintf(`%d`, s.conf.InfraTwitterApp.Fee)) topupTx := &models.InfraTwitterTopupTx{ InfraTwitterAppID: infraTwitterApp.ID, NetworkID: models.BASE_CHAIN_ID, EventId: eventId, Type: models.AgentEaiTopupTypeSpent, DepositAddress: infraTwitterApp.Address, ToAddress: infraTwitterApp.Address, TxHash: eventId, Amount: feePerRequest, } err = s.dao.Save(tx, topupTx) if err != nil { return errs.NewError(err) } err = tx.Model(infraTwitterApp). UpdateColumn("eai_balance", gorm.Expr("eai_balance - ?", feePerRequest)). Error if err != nil { return errs.NewError(errs.ErrAgentUtilitySystemError) } } tweetId, err := helpers.PostTweetByToken(infraTwitterApp.TwitterInfo.AccessToken, req.Content, "") if err != nil { return errs.NewError(errs.ErrAgentUtilityPostTweetFailed) } resp.Message = fmt.Sprintf(`https://x.com/%s/status/%s`, infraTwitterApp.TwitterInfo.TwitterUsername, tweetId) return nil } return nil }, ) if err != nil { if resp.Message == "" { resp.Message = err.Error() } return resp, errs.NewError(err) } return resp, nil } // func (s *Service) UtilityTwitterVerifyDeposit(ctx context.Context, userAddress, txHash string) (bool, error) { // err := daos.WithTransaction( // daos.GetDBMainCtx(ctx), // func(tx *gorm.DB) error { // eventResp, err := s.GetEthereumClient(ctx, models.BASE_CHAIN_ID).Erc20EventsByTransaction(txHash) // if err != nil { // return errs.NewError(err) // } // if eventResp != nil && len(eventResp.Transfer) > 0 { // txEvent := eventResp.Transfer[0] // if !strings.EqualFold(s.conf.InfraTwitterApp.AgentAddress, txEvent.To) { // return errs.NewError(err) // } // eventID := fmt.Sprintf(`%s_%d`, strings.ToLower(txHash), txEvent.TxIndex) // topupTx, err := s.dao.FirstInfraTwitterTopupTx( // tx, // map[string][]any{ // "event_id = ?": {eventID}, // }, // map[string][]any{}, // []string{}, // ) // if err != nil { // return errs.NewError(err) // } // if topupTx == nil { // infraTwitterApp, err := s.dao.FirstInfraTwitterApp( // tx, // map[string][]any{ // "eth_address = ?": {strings.ToLower(txEvent.From)}, // }, // map[string][]any{}, // []string{}, // ) // if err != nil { // return errs.NewError(err) // } // if infraTwitterApp == nil { // return errs.NewError(errs.ErrAgentUtilityNotAuthen) // } // fBalance := models.ConvertWeiToBigFloat(txEvent.Value, 18) // topupTx := &models.InfraTwitterTopupTx{ // InfraTwitterAppID: infraTwitterApp.ID, // NetworkID: models.BASE_CHAIN_ID, // EventId: eventID, // Type: models.AgentEaiTopupTypeDeposit, // DepositAddress: txEvent.From, // ToAddress: txEvent.To, // TxHash: txHash, // Amount: numeric.NewBigFloatFromFloat(fBalance), // } // err = s.dao.Save(tx, topupTx) // if err != nil { // return errs.NewError(err) // } // tmpBlance, _ := fBalance.Float64() // newRequest := int(math.Round(tmpBlance)) // err = tx.Model(infraTwitterApp). // UpdateColumn("eai_balance", gorm.Expr("eai_balance + ?", fBalance)). // UpdateColumn("total_request", gorm.Expr("total_request + ?", newRequest)). // UpdateColumn("remain_request", gorm.Expr("remain_request + ?", newRequest)).Error // if err != nil { // return errs.NewError(errs.ErrBadRequest) // } // } // } // return nil // }, // ) // if err != nil { // return false, errs.NewError(err) // } // return true, nil // } func (s *Service) UtilityTwitterHandleDeposit(tx *gorm.DB, networkID uint64, event *ethapi.Erc20TokenTransferEventResp) error { eaiContractAddress := s.conf.GetConfigKeyString(networkID, "eai_contract_address") if !strings.EqualFold(eaiContractAddress, event.ContractAddress) { return nil } infraTwitterApp, err := s.dao.FirstInfraTwitterApp( tx, map[string][]any{ "eth_address = ?": {strings.ToLower(event.To)}, }, map[string][]any{}, []string{}, ) if err != nil { return errs.NewError(err) } if infraTwitterApp != nil { eventId := fmt.Sprintf(`%d_%s_%d`, networkID, strings.ToLower(event.TxHash), event.Index) topupTx, err := s.dao.FirstInfraTwitterTopupTx( tx, map[string][]any{ "event_id = ?": {eventId}, }, map[string][]any{}, []string{}, ) if err != nil { return errs.NewError(err) } if topupTx == nil { fBalance := models.ConvertWeiToBigFloat(event.Value, 18) topupTx := &models.InfraTwitterTopupTx{ InfraTwitterAppID: infraTwitterApp.ID, NetworkID: models.BASE_CHAIN_ID, EventId: eventId, Type: models.AgentEaiTopupTypeDeposit, DepositAddress: event.From, ToAddress: event.To, TxHash: event.TxHash, Amount: numeric.NewBigFloatFromFloat(fBalance), } err = s.dao.Save(tx, topupTx) if err != nil { return errs.NewError(err) } err = tx.Model(infraTwitterApp). Updates(map[string]any{ "eai_balance": gorm.Expr("eai_balance + ?", fBalance), }). Error if err != nil { return errs.NewError(errs.ErrBadRequest) } } } return nil } func (s *Service) GetInfraTwitterAppInfo(ctx context.Context, userAddress string) (*models.InfraTwitterApp, error) { infraTwitterApp, err := s.dao.FirstInfraTwitterApp(daos.GetDBMainCtx(ctx), map[string][]any{ "address = ?": {strings.ToLower(userAddress)}, }, map[string][]any{}, []string{}, ) if err != nil { return nil, errs.NewError(err) } if infraTwitterApp == nil { return nil, errs.NewError(errs.ErrAgentUtilityNotFound) } if infraTwitterApp.ETHAddress == "" { ethAddress, err := s.CreateETHAddress(ctx) if err != nil { return nil, errs.NewError(err) } infraTwitterApp.ETHAddress = strings.ToLower(ethAddress) err = daos.GetDBMainCtx(ctx). Model(infraTwitterApp). Update("eth_address", ethAddress). Error if err != nil { return nil, errs.NewError(err) } } return infraTwitterApp, nil } func (s *Service) TestSignature(ctx context.Context) { // address := "0x7c9d59cD31F27c7cBEEde2567c9fa377537bdDE0" timestamp := time.Now().UTC().Unix() fmt.Println(timestamp) prk := "068a7653ddda56556baadbc81ece67c6ad7d3caf7929d3908d2deb52f7a31f51" signature, _ := s.GetEthereumClient(ctx, models.ETHEREUM_CHAIN_ID).GetSignatureTimestamp(prk, timestamp) fmt.Println(signature) // 1741061954 // // eab561ca350c4ae7c3a020b2444840ca402e29a006da937ba9817fd90d42a6b755caf4f341b322ff8c299cb93ff37d83127ce20490bbcfdeac46c7a4ed8be5251c } func (s *Service) InfraTwitterAppSearchRecentTweet(ctx context.Context, query, paginationToken string, maxResults int) (*twitter.TweetRecentSearch, error) { var tweetRecentSearch twitter.TweetRecentSearch twitterInfo, err := s.dao.FirstTwitterInfo(daos.GetDBMainCtx(ctx), map[string][]any{ "twitter_id = ?": {s.conf.TokenTwiterIdForInternal}, }, map[string][]any{}, false, ) if err != nil { return nil, errs.NewError(err) } if twitterInfo != nil { tweetRecentSearch, err := s.twitterWrapAPI.SearchRecentTweet(query, paginationToken, twitterInfo.AccessToken, maxResults) if err != nil { return nil, errs.NewTwitterError(err) } return tweetRecentSearch, nil } return &tweetRecentSearch, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/internal_srv.go ================================================ package services import ( "context" "fmt" "strings" "time" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/daos" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/rapid" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/twitter" ) func (s *Service) GetTwitterUserByID(ctx context.Context, twitterID string) (*twitter.UserObj, error) { twitterUser, err := s.twitterWrapAPI.GetTwitterByID(twitterID) if err != nil { return nil, errs.NewError(err) } return twitterUser, nil } func (s *Service) GetTwitterUserByUsername(ctx context.Context, username string) (*twitter.UserObj, error) { twitterUser, err := s.twitterWrapAPI.GetTwitterByUserName(username) if err != nil { return nil, errs.NewError(err) } return twitterUser, nil } func (s *Service) SeachTwitterUserByQuery(ctx context.Context, username string) (*twitter.UserLookups, error) { usernameArry := strings.Split(username, ",") twitterInfo, err := s.dao.FirstTwitterInfo(daos.GetDBMainCtx(ctx), map[string][]interface{}{ "twitter_id = ?": {s.conf.TokenTwiterIdForInternal}, }, map[string][]interface{}{}, false, ) if err != nil { return nil, errs.NewError(err) } if twitterInfo != nil { twitterUser, err := s.twitterWrapAPI.LookupUsername(twitterInfo.AccessToken, usernameArry) if err != nil { return nil, errs.NewTwitterError(err) } return twitterUser, nil } return nil, errs.NewError(errs.ErrBadRequest) } func (s *Service) GetTwitterUserFollowing(ctx context.Context, twitterID, paginationToken string) (*twitter.UserFollowLookup, error) { twitterInfo, err := s.dao.FirstTwitterInfo(daos.GetDBMainCtx(ctx), map[string][]interface{}{ "twitter_id = ?": {s.conf.TokenTwiterIdForInternal}, }, map[string][]interface{}{}, false, ) if err != nil { return nil, errs.NewError(err) } if twitterInfo != nil { twitterUser, err := s.twitterWrapAPI.GetListFollowing(twitterID, paginationToken, twitterInfo.AccessToken) if err != nil { return nil, errs.NewTwitterError(err) } return twitterUser, nil } return nil, errs.NewError(errs.ErrBadRequest) } func (s *Service) GetTwitterUserFollowingRapid(ctx context.Context, twitterID, paginationToken string) ([]rapid.Following, error) { twitterUser, err := s.rapid.GetTwitterFollowings(twitterID) if err != nil { return nil, errs.NewError(err) } return twitterUser, nil } func (s *Service) GetTwitterUserFollowingV1(ctx context.Context, twitterID, paginationToken string) ([]rapid.Following, error) { twitterInfo, err := s.dao.FirstTwitterInfo(daos.GetDBMainCtx(ctx), map[string][]interface{}{ "twitter_id = ?": {s.conf.TokenTwiterIdForInternal}, }, map[string][]interface{}{}, false, ) if err != nil { return nil, errs.NewError(err) } var twitterUser []rapid.Following if twitterInfo != nil { twitterUserFollowing, err := s.twitterWrapAPI.GetListFollowing(twitterID, paginationToken, twitterInfo.AccessToken) if err != nil { return nil, errs.NewTwitterError(err) } for _, item := range twitterUserFollowing.Lookups { twitterUser = append(twitterUser, rapid.Following{ ID: item.User.ID, Username: item.User.UserName, Name: item.User.Name, }) } } return nil, errs.NewError(errs.ErrBadRequest) } func (s *Service) GetTwitterUserFollowingRapidByUsername(ctx context.Context, username, paginationToken string) ([]rapid.Following, error) { if username == "" { return nil, errs.NewError(errs.ErrBadRequest) } var twitterUser []rapid.Following err := s.RedisCached( fmt.Sprintf("GetTwitterUserFollowingRapidByUsername_%s", username), true, 3*time.Minute, &twitterUser, func() (interface{}, error) { user, err := s.SyncGetTwitterUserByUsername(ctx, username) if err != nil { return nil, errs.NewError(err) } if user == nil { return nil, errs.NewError(errs.ErrBadRequest) } twitterUser, err = s.rapid.GetTwitterFollowings(user.TwitterID) if err != nil { return nil, errs.NewError(err) } return twitterUser, nil }, ) if err != nil { return nil, errs.NewError(err) } return twitterUser, nil } func (s *Service) GetTwitterUserFollowingByUsername(ctx context.Context, username, paginationToken string) ([]rapid.Following, error) { if username == "" { return nil, errs.NewError(errs.ErrBadRequest) } var twitterUser []rapid.Following err := s.RedisCached( fmt.Sprintf("GetTwitterUserFollowingByUsername_%s", username), true, 3*time.Minute, &twitterUser, func() (interface{}, error) { user, err := s.SyncGetTwitterUserByUsername(ctx, username) if err != nil { return nil, errs.NewError(err) } if user == nil { return nil, errs.NewError(errs.ErrBadRequest) } twitterInfo, err := s.dao.FirstTwitterInfo(daos.GetDBMainCtx(ctx), map[string][]interface{}{ "twitter_id = ?": {s.conf.TokenTwiterIdForInternal}, }, map[string][]interface{}{}, false, ) if err != nil { return nil, errs.NewError(err) } if twitterInfo != nil { twitterUserFollowing, err := s.twitterWrapAPI.GetListFollowing(user.TwitterID, paginationToken, twitterInfo.AccessToken) if err != nil { return nil, errs.NewTwitterError(err) } for _, item := range twitterUserFollowing.Lookups { twitterUser = append(twitterUser, rapid.Following{ ID: item.User.ID, Username: item.User.UserName, Name: item.User.Name, }) } } // twitterUser, err = s.rapid.GetTwitterFollowings(user.TwitterID) // if err != nil { // return nil, errs.NewError(err) // } return twitterUser, nil }, ) if err != nil { return nil, errs.NewError(err) } return twitterUser, nil } func (s *Service) GetListUserTweets(ctx context.Context, twitterID, paginationToken string, maxResults int) (*twitter.UserTimeline, error) { twitterInfo, err := s.dao.FirstTwitterInfo(daos.GetDBMainCtx(ctx), map[string][]interface{}{ "twitter_id = ?": {s.conf.TokenTwiterIdForInternal}, }, map[string][]interface{}{}, false, ) if err != nil { return nil, errs.NewError(err) } if twitterInfo != nil { return s.GetListUserTweetsFromTwitterInfoToken(ctx, twitterInfo, twitterID, paginationToken, maxResults) } return nil, errs.NewError(errs.ErrBadRequest) } func (s *Service) GetListUserTweetsAll(ctx context.Context, twitterID, paginationToken string, maxResults int) (*twitter.UserTimeline, error) { twitterInfo, err := s.dao.FirstTwitterInfo(daos.GetDBMainCtx(ctx), map[string][]interface{}{ "twitter_id = ?": {s.conf.TokenTwiterIdForInternal}, }, map[string][]interface{}{}, false, ) if err != nil { return nil, errs.NewError(err) } if twitterInfo != nil { return s.GetAllUserTweetsFromTwitterInfoToken(ctx, twitterInfo, twitterID, paginationToken, maxResults) } return nil, errs.NewError(errs.ErrBadRequest) } func (s *Service) GetListUserTweetsV1(ctx context.Context, twitterID, paginationToken string, maxResults int) (*twitter.UserTimeline, error) { twitterInfo, err := s.dao.FirstTwitterInfo(daos.GetDBMainCtx(ctx), map[string][]interface{}{ "twitter_id = ?": {s.conf.TokenTwiterIdForInternal}, }, map[string][]interface{}{}, false, ) if err != nil { return nil, errs.NewError(err) } if twitterInfo != nil { return s.GetListUserTweetsFromTwitterInfoTokenV1(ctx, twitterInfo, twitterID, paginationToken, maxResults) } return nil, errs.NewError(errs.ErrBadRequest) } func (s *Service) GetListUserTweetsFromTwitterInfoTokenV1(ctx context.Context, twitterInfo *models.TwitterInfo, twitterID, paginationToken string, maxResults int) (*twitter.UserTimeline, error) { if twitterInfo != nil { twitterUser, err := s.twitterWrapAPI.GetListUserTweets(twitterID, paginationToken, twitterInfo.AccessToken, maxResults) if err != nil { return nil, errs.NewTwitterError(err) } return twitterUser, nil } return nil, errs.NewError(errs.ErrBadRequest) } func (s *Service) GetListUserTweetsFromTwitterInfoToken(ctx context.Context, twitterInfo *models.TwitterInfo, twitterID, paginationToken string, maxResults int) (*twitter.UserTimeline, error) { if twitterInfo != nil { twitterUser, err := s.twitterWrapAPI.GetListUserTweets(twitterID, paginationToken, twitterInfo.AccessToken, maxResults) if err != nil { return nil, errs.NewTwitterError(err) } return twitterUser, nil } return nil, errs.NewError(errs.ErrBadRequest) } func (s *Service) GetAllUserTweetsFromTwitterInfoToken(ctx context.Context, twitterInfo *models.TwitterInfo, twitterID, paginationToken string, maxResults int) (*twitter.UserTimeline, error) { if twitterInfo != nil { twitterUser, err := s.twitterWrapAPI.GetAllUserTweets(twitterID, paginationToken, twitterInfo.AccessToken, maxResults) if err != nil { return nil, errs.NewTwitterError(err) } return twitterUser, nil } return nil, errs.NewError(errs.ErrBadRequest) } func (s *Service) GetListUserTweetsByUsername(ctx context.Context, username, paginationToken string, maxResults int) (*twitter.UserTimeline, error) { if username == "" { return nil, errs.NewError(errs.ErrTwitterUsernameNotFound) } var twitterUser *twitter.UserTimeline // var twitterUser *twitter.UserTimelineV1 err := s.RedisCached( fmt.Sprintf("GetListUserTweetsByUsername_%s_%s", username, paginationToken), true, 1*time.Minute, &twitterUser, func() (interface{}, error) { twitterInfo, err := s.dao.FirstTwitterInfo(daos.GetDBMainCtx(ctx), map[string][]interface{}{ "twitter_id = ?": {s.conf.TokenTwiterIdForInternal}, }, map[string][]interface{}{}, false, ) if err != nil { return nil, errs.NewError(err) } if twitterInfo != nil { user, err := s.SyncGetTwitterUserByUsername(ctx, username) if err != nil { return nil, errs.NewError(err) } if user == nil || (user != nil && user.TwitterID == "") { return nil, errs.NewError(errs.ErrTwitterUsernameNotFound) } twitterUser, err = s.twitterWrapAPI.GetListUserTweets(user.TwitterID, paginationToken, twitterInfo.AccessToken, maxResults) if err != nil { return nil, errs.NewTwitterError(err) } return twitterUser, nil } return nil, errs.NewError(errs.ErrBadRequest) }, ) if err != nil { return nil, errs.NewError(err) } return twitterUser, nil } func (s *Service) GetListUserTweetsByUsernameV1(ctx context.Context, username, paginationToken string, maxResults int) (*twitter.UserTimeline, error) { if username == "" { return nil, errs.NewError(errs.ErrTwitterUsernameNotFound) } var twitterUser *twitter.UserTimeline err := s.RedisCached( fmt.Sprintf("GetListUserTweetsByUsernameV1_%s_%s", username, paginationToken), true, 1*time.Minute, &twitterUser, func() (interface{}, error) { twitterInfo, err := s.dao.FirstTwitterInfo(daos.GetDBMainCtx(ctx), map[string][]interface{}{ "twitter_id = ?": {s.conf.TokenTwiterIdForInternal}, }, map[string][]interface{}{}, false, ) if err != nil { return nil, errs.NewError(err) } if twitterInfo != nil { user, err := s.SyncGetTwitterUserByUsername(ctx, username) if err != nil { return nil, errs.NewError(err) } if user == nil || (user != nil && user.TwitterID == "") { return nil, errs.NewError(errs.ErrTwitterUsernameNotFound) } twitterUser, err = s.twitterWrapAPI.GetListUserTweets(user.TwitterID, paginationToken, twitterInfo.AccessToken, maxResults) if err != nil { return nil, errs.NewTwitterError(err) } return twitterUser, nil } return nil, errs.NewError(errs.ErrBadRequest) }, ) if err != nil { return nil, errs.NewError(err) } return twitterUser, nil } func (s *Service) LookupUserTweets(ctx context.Context, tweetIDs string) (*twitter.TweetLookups, error) { twitterInfo, err := s.dao.FirstTwitterInfo(daos.GetDBMainCtx(ctx), map[string][]interface{}{ "twitter_id = ?": {s.conf.TokenTwiterIdForInternal}, }, map[string][]interface{}{}, false, ) if err != nil { return nil, errs.NewError(err) } if twitterInfo != nil { tweetIdArr := strings.Split(tweetIDs, ",") twitterUser, err := s.twitterWrapAPI.LookupUserTweets(twitterInfo.AccessToken, tweetIdArr) if err != nil { return nil, errs.NewTwitterError(err) } return twitterUser, nil } return nil, errs.NewError(errs.ErrBadRequest) } func (s *Service) LookupUserTweetsV1(ctx context.Context, tweetIDs string) (*twitter.TweetLookups, error) { twitterInfo, err := s.dao.FirstTwitterInfo(daos.GetDBMainCtx(ctx), map[string][]interface{}{ "twitter_id = ?": {s.conf.TokenTwiterIdForInternal}, }, map[string][]interface{}{}, false, ) if err != nil { return nil, errs.NewError(err) } if twitterInfo != nil { tweetIdArr := strings.Split(tweetIDs, ",") twitterUser, err := s.twitterWrapAPI.LookupUserTweets(twitterInfo.AccessToken, tweetIdArr) if err != nil { return nil, errs.NewError(err) } return twitterUser, nil } return nil, errs.NewError(errs.ErrBadRequest) } func (s *Service) GetListUserMentions(ctx context.Context, twitterID, paginationToken string, maxResults int) (*twitter.UserTimeline, error) { twitterInfo, err := s.dao.FirstTwitterInfo(daos.GetDBMainCtx(ctx), map[string][]interface{}{ "twitter_id = ?": {s.conf.TokenTwiterIdForInternal}, }, map[string][]interface{}{}, false, ) if err != nil { return nil, errs.NewError(err) } if twitterInfo != nil { tweetUser, err := s.CreateUpdateUserTwitter(daos.GetDBMainCtx(ctx), twitterID) if err != nil { return nil, errs.NewError(err) } tweetMentions, err := s.twitterWrapAPI.GetListUserMentions(twitterID, paginationToken, twitterInfo.AccessToken, maxResults) if err != nil { return nil, errs.NewTwitterError(err) } listRealMentions := []twitter.TweetObj{} for _, tweets := range tweetMentions.Tweets { if s.TweetIsMention(tweets, tweetUser.TwitterUsername) { listRealMentions = append(listRealMentions, tweets) } } tweetMentions.Tweets = listRealMentions return tweetMentions, nil } return nil, errs.NewError(errs.ErrBadRequest) } func (s *Service) TweetIsMention(tweets twitter.TweetObj, username string) bool { if len(tweets.Entities.Mentions) > 0 { lastMentions := tweets.Entities.Mentions[len(tweets.Entities.Mentions)-1] if strings.EqualFold(lastMentions.UserName, username) { return true } if len(tweets.Entities.Mentions) > 1 { lastMentions = tweets.Entities.Mentions[len(tweets.Entities.Mentions)-2] if strings.EqualFold(lastMentions.UserName, username) { return true } } if len(tweets.Entities.Mentions) > 2 { lastMentions = tweets.Entities.Mentions[len(tweets.Entities.Mentions)-3] if strings.EqualFold(lastMentions.UserName, username) { return true } } } return false } func (s *Service) SyncGetTwitterUserByUsername(ctx context.Context, username string) (*models.TwitterUser, error) { tweetUser, err := s.dao.FirstTwitterUser(daos.GetDBMainCtx(ctx), map[string][]interface{}{ "twitter_username = ?": {username}, }, map[string][]interface{}{}, []string{}, ) if err != nil { return nil, errs.NewError(err) } if tweetUser == nil { info, err := s.twitterWrapAPI.GetTwitterByUserName(username) if err != nil { return nil, errs.NewError(err) } if info != nil { if info.ID == "" { return nil, errs.NewError(errs.ErrTwitterUsernameNotFound) } tweetUser, err = s.CreateUpdateUserTwitter(daos.GetDBMainCtx(ctx), info.ID) if err != nil { return nil, errs.NewError(err) } } } return tweetUser, nil } func (s *Service) GetListUserMentionsByUsername(ctx context.Context, username, paginationToken string, maxResults int) (*twitter.UserTimeline, error) { var tweetMentions *twitter.UserTimeline err := s.RedisCached( fmt.Sprintf("GetListUserMentionsByUsername_%s", username), true, 1*time.Minute, &tweetMentions, func() (interface{}, error) { twitterInfo, err := s.dao.FirstTwitterInfo(daos.GetDBMainCtx(ctx), map[string][]interface{}{ "twitter_id = ?": {s.conf.TokenTwiterIdForInternal}, }, map[string][]interface{}{}, false, ) if err != nil { return nil, errs.NewError(err) } if twitterInfo != nil { user, err := s.SyncGetTwitterUserByUsername(ctx, username) if err != nil { return nil, errs.NewError(err) } if user == nil { return nil, errs.NewError(errs.ErrBadRequest) } if user.TwitterID == "" { return nil, errs.NewError(errs.ErrTwitterIdNotFound) } mapID := map[string]string{} listRealMentions := []twitter.TweetObj{} loop := 1 paginationToken := "" for { tweetMentions, err = s.twitterWrapAPI.GetListUserMentions(user.TwitterID, paginationToken, twitterInfo.AccessToken, maxResults) if err != nil { return nil, errs.NewTwitterError(err) } for _, tweets := range tweetMentions.Tweets { if _, ok := mapID[tweets.ID]; !ok { // if s.TweetIsMention(tweets, user.TwitterUsername) && !strings.EqualFold(tweets.AuthorID, user.TwitterID) { if !strings.EqualFold(tweets.AuthorID, user.TwitterID) { replied, _ := s.CacheCheckIsTweetReplied(ctx, tweets.ID) if !replied { listRealMentions = append(listRealMentions, tweets) mapID[tweets.ID] = "1" } } } } if len(listRealMentions) > 10 { break } paginationToken = tweetMentions.Meta.NextToken loop += 1 if loop > 3 { break } } tweetMentions.Tweets = listRealMentions return tweetMentions, nil } return nil, errs.NewError(errs.ErrBadRequest) }, ) if err != nil { return nil, errs.NewError(err) } return tweetMentions, nil } func (s *Service) GetAllUserMentionsByUsername(ctx context.Context, username, paginationToken string, maxResults int) (*twitter.UserTimeline, error) { var tweetMentions *twitter.UserTimeline err := s.RedisCached( fmt.Sprintf("GetAllUserMentionsByUsername_%s_%s", username, paginationToken), true, 1*time.Minute, &tweetMentions, func() (interface{}, error) { twitterInfo, err := s.dao.FirstTwitterInfo(daos.GetDBMainCtx(ctx), map[string][]interface{}{ "twitter_id = ?": {s.conf.TokenTwiterIdForInternal}, }, map[string][]interface{}{}, false, ) if err != nil { return nil, errs.NewError(err) } if twitterInfo != nil { user, err := s.SyncGetTwitterUserByUsername(ctx, username) if err != nil { return nil, errs.NewError(err) } if user == nil { return nil, errs.NewError(errs.ErrBadRequest) } if user.TwitterID == "" { return nil, errs.NewError(errs.ErrTwitterIdNotFound) } tweetMentions, err = s.twitterWrapAPI.GetListUserMentions(user.TwitterID, paginationToken, twitterInfo.AccessToken, maxResults) if err != nil { return nil, errs.NewTwitterError(err) } return tweetMentions, nil } return nil, errs.NewError(errs.ErrBadRequest) }, ) if err != nil { return nil, errs.NewError(err) } return tweetMentions, nil } func (s *Service) CacheCheckIsTweetReplied(ctx context.Context, twitterID string) (bool, error) { var replied bool err := s.RedisCached( fmt.Sprintf("CacheCheckIsTweetReplied_%s", twitterID), true, 24*time.Hour, &replied, func() (interface{}, error) { var err error replied, err = s.dao.IsTweetReplied(daos.GetDBMainCtx(ctx), twitterID) if err != nil { return false, errs.NewError(err) } return replied, nil }, ) if err != nil { return false, errs.NewError(err) } return replied, nil } func (s *Service) SearchRecentTweet(ctx context.Context, query, paginationToken string, maxResults int) (*twitter.TweetRecentSearch, error) { var tweetRecentSearch twitter.TweetRecentSearch var lookUps map[string]twitter.TweetLookup var meta twitter.TweetRecentSearchMeta cacheKey := fmt.Sprintf(`CacheAgentTerminalLatestLookUps_%s_%d`, query, maxResults) cacheKey1 := fmt.Sprintf(`CacheAgentTerminalLatestMeta_%s_%d`, query, maxResults) err := s.GetRedisCachedWithKey(cacheKey, &lookUps) if err != nil { twitterInfo, err := s.dao.FirstTwitterInfo(daos.GetDBMainCtx(ctx), map[string][]interface{}{ "twitter_id = ?": {s.conf.TokenTwiterIdForInternal}, }, map[string][]interface{}{}, false, ) if err != nil { return nil, errs.NewError(err) } if twitterInfo != nil { // query = url.QueryEscape(query) tweetRecentSearch, err := s.twitterWrapAPI.SearchRecentTweet(query, paginationToken, twitterInfo.AccessToken, maxResults) if err != nil { return nil, errs.NewTwitterError(err) } lookUps = tweetRecentSearch.LookUps meta = tweetRecentSearch.Meta _ = s.SetRedisCachedWithKey(cacheKey, tweetRecentSearch.LookUps, 5*time.Minute) _ = s.SetRedisCachedWithKey(cacheKey1, tweetRecentSearch.Meta, 5*time.Minute) return tweetRecentSearch, nil } } _ = s.GetRedisCachedWithKey(cacheKey1, &meta) tweetRecentSearch.LookUps = lookUps tweetRecentSearch.Meta = meta return &tweetRecentSearch, nil } func (s *Service) SearchRecentTweetV1(ctx context.Context, query, sinceID string, maxResults int) (*twitter.TweetRecentSearch, error) { var tweetRecentSearch twitter.TweetRecentSearch var lookUps map[string]twitter.TweetLookup var meta twitter.TweetRecentSearchMeta cacheKey := fmt.Sprintf(`CacheAgentTerminalLatestLookUps_%s_%d`, query, maxResults) cacheKey1 := fmt.Sprintf(`CacheAgentTerminalLatestMeta_%s_%d`, query, maxResults) err := s.GetRedisCachedWithKey(cacheKey, &lookUps) if err != nil { twitterInfo, err := s.dao.FirstTwitterInfo(daos.GetDBMainCtx(ctx), map[string][]interface{}{ "twitter_id = ?": {s.conf.TokenTwiterIdForInternal}, }, map[string][]interface{}{}, false, ) if err != nil { return nil, errs.NewError(err) } if twitterInfo != nil { // query = url.QueryEscape(query) tweetRecentSearch, err := s.twitterWrapAPI.SearchRecentTweetV1(query, sinceID, twitterInfo.AccessToken, maxResults) if err != nil { return nil, errs.NewTwitterError(err) } lookUps = tweetRecentSearch.LookUps meta = tweetRecentSearch.Meta _ = s.SetRedisCachedWithKey(cacheKey, tweetRecentSearch.LookUps, 5*time.Minute) _ = s.SetRedisCachedWithKey(cacheKey1, tweetRecentSearch.Meta, 5*time.Minute) return tweetRecentSearch, nil } } _ = s.GetRedisCachedWithKey(cacheKey1, &meta) tweetRecentSearch.LookUps = lookUps tweetRecentSearch.Meta = meta return &tweetRecentSearch, nil } func (s *Service) SearchTokenTweet(ctx context.Context, query, paginationToken string, maxResults int) (*twitter.TweetRecentSearch, error) { var tweetRecentSearch twitter.TweetRecentSearch var lookUps map[string]twitter.TweetLookup var meta twitter.TweetRecentSearchMeta cacheKey := fmt.Sprintf(`CacheSearchTokenTweetLatestLookUps_%s`, query) cacheKey1 := fmt.Sprintf(`CacheSearchTokenTweetLatestMeta_%s`, query) err := s.GetRedisCachedWithKey(cacheKey, &lookUps) if err != nil { twitterInfo, err := s.dao.FirstTwitterInfo(daos.GetDBMainCtx(ctx), map[string][]interface{}{ "twitter_id = ?": {s.conf.TokenTwiterIdForInternal}, }, map[string][]interface{}{}, false, ) if err != nil { return nil, errs.NewError(err) } if twitterInfo != nil { tweetRecentSearch, err := s.twitterWrapAPI.SearchRecentTweet(query, paginationToken, twitterInfo.AccessToken, maxResults) if err != nil { return nil, errs.NewTwitterError(err) } lookUps = tweetRecentSearch.LookUps meta = tweetRecentSearch.Meta _ = s.SetRedisCachedWithKey(cacheKey, tweetRecentSearch.LookUps, 5*time.Minute) _ = s.SetRedisCachedWithKey(cacheKey1, tweetRecentSearch.Meta, 5*time.Minute) return tweetRecentSearch, nil } } _ = s.GetRedisCachedWithKey(cacheKey1, &meta) tweetRecentSearch.LookUps = lookUps tweetRecentSearch.Meta = meta return &tweetRecentSearch, nil } func (s *Service) SearchUsers(ctx context.Context, query, paginationToken string) ([]*twitter.UserObj, error) { var twitterUser []*twitter.UserObj err := s.RedisCached( fmt.Sprintf("SearchUsers_%s", query), true, 3*time.Minute, &twitterUser, func() (interface{}, error) { twitterInfo, err := s.dao.FirstTwitterInfo(daos.GetDBMainCtx(ctx), map[string][]interface{}{ "twitter_id = ?": {s.conf.TokenTwiterIdForInternal}, }, map[string][]interface{}{}, false, ) if err != nil { return nil, errs.NewError(err) } if twitterInfo != nil { twitterUser, err = s.twitterWrapAPI.SearchUsers(query, paginationToken, twitterInfo.AccessToken) if err != nil { return nil, errs.NewTwitterError(err) } return twitterUser, nil } return nil, errs.NewError(errs.ErrBadRequest) }, ) if err != nil { return nil, errs.NewError(err) } return twitterUser, nil } func (s *Service) GetUser3700Liked(ctx context.Context, replied *bool, page, limit int) ([]*models.TwitterTweetLiked, error) { joinFilters := map[string][]interface{}{} filters := map[string][]interface{}{ "twitter_tweet_likeds.liked_user_id = ?": {"1443830739372417024"}, } if replied != nil { if *replied { filters[` tweet_id in ( select tweetid from agent_snapshot_post_actions aspa where 1=1 and status ='done' and type = 'reply' ) `] = []interface{}{} } else { filters[` tweet_id not in ( select tweetid from agent_snapshot_post_actions aspa where 1=1 and status ='done' and type = 'reply' ) `] = []interface{}{} } } selected := []string{} tweets, err := s.dao.FindTwitterTweetLikedJoinSelect( daos.GetDBMainCtx(ctx), selected, joinFilters, filters, map[string][]interface{}{}, []string{"id desc"}, page, limit, ) if err != nil { return nil, errs.NewError(err) } return tweets, nil } func (s *Service) GetAgentTradeTokens(ctx context.Context, networkID uint64) ([]*models.AgentTradeToken, error) { filters := map[string][]interface{}{ `enabled = ?`: {true}, } if networkID > 0 { filters[`network_id = ?`] = []interface{}{networkID} } posts, err := s.dao.FindAgentTradeToken(daos.GetDBMainCtx(ctx), filters, map[string][]interface{}{}, []string{}, 0, 100, ) if err != nil { return nil, errs.NewError(err) } return posts, nil } func (s *Service) GetListUserTweetsByUsersForTradeMission(ctx context.Context, userTwitterIds string) ([]twitter.TweetObj, error) { if userTwitterIds == "" { return []twitter.TweetObj{}, nil } tweets := []twitter.TweetObj{} err := s.RedisCached( fmt.Sprintf("GetListUserTweetsByUsersForTradeMission_%s", userTwitterIds), true, 1*time.Minute, &tweets, func() (interface{}, error) { twitterInfo, err := s.dao.FirstTwitterInfo(daos.GetDBMainCtx(ctx), map[string][]interface{}{ "twitter_id = ?": {s.conf.TokenTwiterIdForInternal}, }, map[string][]interface{}{}, false, ) if err != nil { return nil, errs.NewError(err) } if twitterInfo != nil { listTwitterIDs := strings.Split(userTwitterIds, ",") for _, twitterID := range listTwitterIDs { twitterUser, err := s.twitterWrapAPI.GetListUserTweets(twitterID, "", twitterInfo.AccessToken, 50) if err != nil { return nil, errs.NewTwitterError(err) } if twitterUser != nil && len(twitterUser.Tweets) > 0 { tweets = append(tweets, twitterUser.Tweets...) } } } return tweets, nil }, ) if err != nil { return nil, errs.NewError(err) } return tweets, nil } func (s *Service) GetListUserTweetsByAgentForTradeMission(ctx context.Context, refID string) ([]twitter.TweetObj, error) { if refID == "" { return []twitter.TweetObj{}, nil } tweets := []twitter.TweetObj{} err := s.RedisCached( fmt.Sprintf("GetListUserTweetsByAgentForTradeMission_%s", refID), true, 1*time.Minute, &tweets, func() (interface{}, error) { twitterInfo, err := s.dao.FirstTwitterInfo(daos.GetDBMainCtx(ctx), map[string][]interface{}{ "twitter_id = ?": {s.conf.TokenTwiterIdForInternal}, }, map[string][]interface{}{}, false, ) if err != nil { return nil, errs.NewError(err) } missionPost, err := s.dao.FirstAgentSnapshotPost(daos.GetDBMainCtx(ctx), map[string][]interface{}{ "infer_tx_hash = ?": {refID}, }, map[string][]interface{}{}, []string{}) if err != nil { return nil, errs.NewError(err) } if missionPost != nil { mission, err := s.dao.FirstAgentSnapshotMission(daos.GetDBMainCtx(ctx), map[string][]interface{}{ "id = ?": {missionPost.AgentSnapshotMissionID}, "tool_set = ?": {models.ToolsetTypeTrading}, }, map[string][]interface{}{}, []string{}) if err != nil { return nil, errs.NewError(err) } if twitterInfo != nil && mission != nil && mission.UserTwitterIds != "" { listTwitterIDs := strings.Split(mission.UserTwitterIds, ",") for _, twitterID := range listTwitterIDs { twitterUser, err := s.twitterWrapAPI.GetListUserTweets(twitterID, "", twitterInfo.AccessToken, 50) if err != nil { return nil, errs.NewTwitterError(err) } if twitterUser != nil && len(twitterUser.Tweets) > 0 { tweets = append(tweets, twitterUser.Tweets...) } } } } return tweets, nil }, ) if err != nil { return nil, errs.NewError(err) } return tweets, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/ipfs.go ================================================ package services import ( "context" "fmt" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/lighthouse" "github.com/google/uuid" ) func (s *Service) IpfsUploadData(ctx context.Context, ext string, dataBytes []byte) (string, error) { hash, err := lighthouse.UploadData(s.conf.Lighthouse.Apikey, fmt.Sprintf("%s.%s", uuid.New(), ext), dataBytes) if err != nil { return "", errs.NewError(err) } return hash, nil } func (s *Service) IpfsUploadDataForName(ctx context.Context, fileName string, dataBytes []byte) (string, error) { hash, err := lighthouse.UploadData(s.conf.Lighthouse.Apikey, fileName, dataBytes) if err != nil { return "", errs.NewError(err) } return hash, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/job_srv.go ================================================ package services import ( "context" "errors" "fmt" "strconv" "time" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/daos" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/helpers" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/types/numeric" "github.com/jasonlvhit/gocron" ) func (s *Service) JobUpdateMarketPrice(ctx context.Context) error { err := s.JobRunCheck( ctx, "JobUpdateMarketPrice", func() error { eaiPrice, err := s.cmc.GetQuotesLatest([]string{"31401"}) if err != nil { return err } _ = s.CreateOrUpdateTokenPrice(ctx, "EAI", numeric.NewBigFloatFromFloat(&eaiPrice["31401"].Quote.USD.Price.Float)) // BTC - ETH price mapSymbol := map[string]string{ "BTCUSDT": "BTC", "ETHUSDT": "ETH", "SOLUSDT": "SOL", "BNBUSDT": "BNB", } symbol := `["BTCUSDT","ETHUSDT","SOLUSDT","BNBUSDT"]` prices, err := helpers.GetListExternalPrice(symbol) if err != nil { return err } for _, price := range prices { err = s.CreateOrUpdateTokenPrice(ctx, mapSymbol[price.Symbol], numeric.NewBigFloatFromString(price.Price)) if err != nil { fmt.Println(err) } } return nil }, ) if err != nil { return errs.NewError(err) } return nil } func (s *Service) CreateOrUpdateTokenPrice(ctx context.Context, symbol string, price numeric.BigFloat) error { filters := map[string][]interface{}{} filters["symbol = ?"] = []interface{}{symbol} tokenPrice, err := s.dao.FirstTokenPrice(daos.GetDBMainCtx(ctx), filters, map[string][]interface{}{}, true) if err != nil { return errs.NewError(err) } isCreated := false if tokenPrice == nil { tokenPrice = &models.TokenPrice{} tokenPrice.Symbol = symbol isCreated = true } tokenPrice.NetworkID = 0 tokenPrice.Price = price tokenPrice.UpdatedAt = time.Now() if isCreated { err = s.dao.Create(daos.GetDBMainCtx(ctx), tokenPrice) if err != nil { return errs.NewError(err) } } else { err = s.dao.Save(daos.GetDBMainCtx(ctx), tokenPrice) if err != nil { return errs.NewError(err) } } return nil } func (s *Service) BlockchainDurations(ctx context.Context) ([]uint, error) { chains, err := s.dao.FindBlockScanInfo( daos.GetDBMainCtx(ctx), map[string][]interface{}{ "duration > ?": {0}, }, map[string][]interface{}{}, []string{}, 0, 100, ) if err != nil { return nil, errs.NewError(err) } durationMap := map[uint]bool{} for _, v := range chains { durationMap[v.Duration] = true } durations := []uint{} for duration := range durationMap { durations = append(durations, duration) } return durations, nil } func (s *Service) JobEnabledDB(ctx context.Context) error { err := daos.GetDBMainCtx(ctx). Model(&models.AppConfig{}). Where("network_id = ?", models.GENERTAL_NETWORK_ID). Where("name = ?", "job_enabled"). UpdateColumn("value", "1").Error if err != nil { return errs.NewError(err) } return nil } func (s *Service) DisableJobs() { s.jobMutex.Lock() s.jobDisabled = true s.jobMutex.Unlock() } func (s *Service) RunJobs(ctx context.Context) error { gocron.Every(360).Second().Do(func() { defer func() { if rval := recover(); rval != nil { err := errs.NewError(errors.New(fmt.Sprint(rval))) stacktrace := err.(*errs.Error).Stacktrace() fmt.Println(time.Now(), err.Error(), stacktrace) } }() s.KnowledgeUsecase.WatchWalletChange(context.Background()) }) gocron.Every(30).Second().Do(func() { defer func() { if rval := recover(); rval != nil { err := errs.NewError(errors.New(fmt.Sprint(rval))) stacktrace := err.(*errs.Error).Stacktrace() fmt.Println(time.Now(), err.Error(), stacktrace) } }() s.KnowledgeUsecase.ScanKnowledgeBaseStatusPaymentReceipt(context.Background()) }) // scan events by chain var networkIDs []uint64 for networkIDStr := range s.conf.Networks { networkID, err := strconv.ParseUint(networkIDStr, 10, 64) if err != nil { panic(err) } if networkID > 0 { networkIDs = append(networkIDs, networkID) } } for i := range 4 { gocron.Every(30).Second(). From(helpers.GetNextScheduleTime(30*time.Second, time.Duration(i)*7*time.Second)). Do( func(rangeIndex int) { for idx, networkID := range networkIDs { if idx%4 == rangeIndex { fmt.Printf("ScanEventsByChainRange_%d_%d\n", rangeIndex, networkID) s.ScanEventsByChain(context.Background(), networkID) } } }, i, ) } // agent mint nft gocron.Every(1).Minute().Do( func() error { s.JobAgentMintNft(context.Background()) s.JobRetryAgentMintNft(context.Background()) s.JobRetryAgentMintNftError(context.Background()) s.JobAgentStart(context.Background()) return nil }, ) gocron.Every(1).Minute().Do( func() error { s.JobAgentTwinTrain(context.Background()) return nil }, ) gocron.Every(1).Minute().Do(s.JobUpdateTwitterAccessToken, context.Background()) gocron.Every(1).Minute().Do(s.JobCreateTokenInfo, context.Background()) gocron.Every(7).Minute().Do(s.JobUpdateTokenPriceInfo, context.Background()) // gocron.Every(5).Minute().Do(s.JobUpdateTrendingTokens, context.Background()) // generate video gocron.Every(5).Minutes().Do(s.JobScanAgentTwitterPostForGenerateVideo, context.Background()) gocron.Every(15).Seconds().Do(s.JobAgentTwitterPostSubmitVideoInfer, context.Background()) gocron.Every(30).Seconds().Do(s.JobAgentTwitterScanResultGenerateVideo, context.Background()) gocron.Every(2).Minutes().Do(s.JobAgentTwitterPostCreateClankerToken, context.Background()) gocron.Every(1).Minutes().Do(s.JobAgentTwitterPostGenerateVideo, context.Background()) //gocron.Every(1).Minutes().Do(s.JobAgentTwitterScanResultGenerateVideoMagicPrompt, context.Background()) // trading analyze gocron.Every(5).Minute().Do(s.JobScanAgentTwitterPostForTA, context.Background()) gocron.Every(1).Minute().Do(s.JobAgentTwitterPostTA, context.Background()) // lucky moneys gocron.Every(5).Minute().Do(s.JobLuckyMoneyActionExecuted, context.Background()) gocron.Every(5).Minute().Do(s.JobLuckyMoneyCollectPost, context.Background()) gocron.Every(5).Minute().Do(s.JobLuckyMoneyProcessUserReward, context.Background()) gocron.Every(1).Minute().Do(s.JobUpdateOffchainAutoOutputForMission, context.Background()) gocron.Every(5).Minute().Do(s.JobUpdateOffchainAutoOutput, context.Background()) gocron.Every(30).Minute().Do(s.JobUpdateOffchainAutoOutput3Hour, context.Background()) gocron.Every(5).Minute().Do(s.JobAgentSnapshotPostStatusInferRefund, context.Background()) gocron.Every(1).Minute().Do( func() { s.JobAgentSnapshotPostCreate(context.Background()) }, ) gocron.Every(10).Second().Do( func() { s.JobAgentSnapshotPostActionExecuted(context.Background()) }, ) gocron.Every(5).Minute().Do( func() { s.JobAgentSnapshotPostActionDupplicated(context.Background()) s.JobAgentSnapshotPostActionCancelled(context.Background()) }, ) // gocron.Every(5).Minute().Do( func() { s.JobUpdateMarketPrice(context.Background()) s.JobUpdateMemeUsdPrice(context.Background()) }, ) gocron.Every(1).Day(). From(helpers.GetNextScheduleTime(24*time.Hour, 0*time.Hour)). Do(s.AgentDailyReport, context.Background()) gocron.Every(5).Minute(). From(helpers.GetNextScheduleTime(5*time.Minute, 0*time.Hour)). Do(s.JobAgentTeleAlertTopupNotAction, context.Background()) gocron.Every(15).Minute().Do( func() { s.JobScanTwitterLiked(context.Background()) }, ) gocron.Every(30).Second().Do( func() { s.JobRunCheck( context.Background(), "JobAgentLiquidity", func() error { s.JobAgentDeployToken(context.Background()) s.JobRetryAgentDeployToken(context.Background()) s.JobMemeAddPositionInternal(context.Background()) s.JobMemeRemovePositionInternal(context.Background()) s.JobCheckMemeReachMarketCap(context.Background()) s.JobMemeAddPositionUniswap(context.Background()) s.JobRetryAddPool1(context.Background()) s.JobRetryAddPool2(context.Background()) s.JobMemeBurnPositionUniswap(context.Background()) return nil }, ) }, ) gocron.Every(1).Minutes().Do( func() { s.JobCreateAgentKnowledgeBase(context.Background()) }, ) // scan robot sale wallet balance gocron.Every(30).Second().Do(func() { s.JobRobotScanBalanceSOL(context.Background()) }) <-gocron.Start() return nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/knowledge_base_job.go ================================================ package services import ( "context" "fmt" "math/big" "strconv" "strings" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/serializers" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/eth" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/zkclient" "github.com/ethereum/go-ethereum/core/types" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/binds/aikb721" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/common" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/logger" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "go.uber.org/zap" ) func (s *Service) JobCreateAgentKnowledgeBase(ctx context.Context) error { err := s.JobRunCheck( ctx, "JobCreateAgentKnowledgeBase", func() error { return s.CreateAgentKnowledgeBase(ctx) }, ) if err != nil { return errs.NewError(err) } return nil } func (s *Service) CreateAgentKnowledgeBase(ctx context.Context) error { list, err := s.KnowledgeUsecase.GetKnowledgeBaseByStatus(ctx, models.KnowledgeBaseStatusDone, 0, 10) if err != nil { return err } for _, item := range list { err = s.DeployAgentKnowledgeBase(ctx, item) if err != nil { logger.Info("JobCreateAgentKnowledgeBase", "CreateAgentKnowledgeBase", zap.Any("err", err), zap.Any("kb", item)) s.SendTeleMsgToKBChannel(ctx, fmt.Sprintf("CreateAgentKnowledgeBase \n err:%v \n knowledge_base_id:%v", err.Error(), item.ID), s.conf.KnowledgeBaseConfig.KBErrorTelegramAlert) } } list, err = s.KnowledgeUsecase.GetManyKnowledgeBaseByQuery(ctx, fmt.Sprintf("status = '%v' AND filecoin_hash <> '' AND kb_id <> '' ", models.KnowledgeBaseStatusPaymentReceipt), "id asc", 0, 10) if err != nil { return err } for _, item := range list { err = s.DeployAgentKnowledgeBase(ctx, item) if err != nil { logger.Info("JobCreateAgentKnowledgeBase", "CreateAgentKnowledgeBase", zap.Any("err", err), zap.Any("kb", item)) s.SendTeleMsgToKBChannel(ctx, fmt.Sprintf("CreateAgentKnowledgeBase \n err:%v \n knowledge_base_id:%v", err.Error(), item.ID), s.conf.KnowledgeBaseConfig.KBErrorTelegramAlert) } } return nil } func (s *Service) DeployAgentKnowledgeBase(ctx context.Context, info *models.KnowledgeBase) error { if len(info.FilecoinHash) == 0 { return fmt.Errorf("file coin hash is empty") } if len(info.KBTokenID) > 0 { /*oldStatus := info.Status info.Status = models.KnowledgeBaseStatusMinted err := s.KnowledgeUsecase.UpdateKnowledgeBaseById(ctx, info.ID, map[string]interface{}{ "status": info.Status, }) if err != nil { return fmt.Errorf("UpdateKnowledgeBaseById: %v", err) } s.SendTeleMsgToKBChannel(ctx, fmt.Sprintf("Update KB Status \n kb_id:%v \n old_status:%v \n new_status:%v \n mint id :%v \n tx:%v", info.ID, oldStatus, info.Status, info.KBTokenID, info.KBTokenMintTx), s.conf.KnowledgeBaseConfig.KBActivitiesTelegramAlert)*/ return nil } appConfig, err := s.AppConfigUseCase.GetAllNameValueInAppConfig(ctx, strconv.FormatUint(info.NetworkID, 10)) if err != nil { return fmt.Errorf("get all name value in app config: %v", err) } priKey := appConfig[models.KeyConfigNameWalletDeploy] if len(priKey) == 0 { return fmt.Errorf("not found priKey wallet deploy , network %v", info.NetworkID) } _, pubKey, err := eth.GetAccountInfo(priKey) if err != nil { return fmt.Errorf("get account info: %v", err) } kbWorkerHubAddress := appConfig[models.KeyConfigNameKnowledgeBaseWorkerHubAddress] if len(kbWorkerHubAddress) == 0 { return fmt.Errorf("not found KnowledgeBaseWorkerHubAddress , network %v", info.NetworkID) } modelId := appConfig[models.KeyConfigNameModelId] if len(modelId) == 0 { return fmt.Errorf("not found model id , network %v", info.NetworkID) } tokenContractAddress := appConfig[models.KeyConfigNameKnowledgeBaseTokenContractAddress] if len(tokenContractAddress) == 0 { return fmt.Errorf("not found tokenContractAddress , network %v", info.NetworkID) } instanceABI, err := abi.JSON(strings.NewReader(aikb721.EternalAIKB721MetaData.ABI)) if err != nil { return fmt.Errorf("failed to read ABI JSON: %v", err) } uri := info.FilecoinHash data := []byte(info.FilecoinHash) promptKey := "KnowledgeBaseAgent" fee := big.NewInt(0) modelIdUint32, err := strconv.ParseUint(modelId, 10, 32) if err != nil { return fmt.Errorf("failed to parse model id: %v", err) } dataBytes, err := instanceABI.Pack( "mint", common.HexToAddress(info.UserAddress), uri, data, fee, promptKey, common.HexToAddress(kbWorkerHubAddress), uint32(modelIdUint32), ) // to common.Address, data []byte, promptScheduler common.Address, modelId uint32 if err != nil { return fmt.Errorf("failed to pack ABI data: %v", err) } rpc := s.conf.GetConfigKeyString(info.NetworkID, "rpc_url") var paymasterAddress, paymasterToken string var paymasterFeeZero bool if s.conf.ExistsedConfigKey(info.NetworkID, "paymaster_address") && s.conf.ExistsedConfigKey(info.NetworkID, "paymaster_token") { paymasterAddress = s.conf.GetConfigKeyString(info.NetworkID, "paymaster_address") paymasterToken = s.conf.GetConfigKeyString(info.NetworkID, "paymaster_token") paymasterFeeZero = s.conf.GetConfigKeyBool(info.NetworkID, "paymaster_fee_zero") } aiZkClient := zkclient.NewZkClient(rpc, paymasterFeeZero, paymasterAddress, paymasterToken) tx, err := aiZkClient.Transact(priKey, *pubKey, common.HexToAddress(tokenContractAddress), big.NewInt(0), dataBytes) if err != nil { return fmt.Errorf("failed to transact: %v", err) } if tx == nil { return fmt.Errorf("not found tx receipt after send tx mint") } contract, err := aikb721.NewEternalAIKB721(common.HexToAddress(tokenContractAddress), nil) if err != nil { return fmt.Errorf("failed to new either contract: %v", err) } tokenId := "" for _, log := range tx.Receipt.Logs { inferData, err := contract.ParseNewToken(*log) if err == nil { tokenId = inferData.TokenId.String() break } } if len(tokenId) == 0 { return fmt.Errorf("not found token id in tx receipt :%v", tx.TxHash.Hex()) } oldStatus := info.Status info.KBTokenID = tokenId info.KBTokenContractAddress = tokenContractAddress info.KBTokenMintTx = strings.ToLower(tx.TxHash.Hex()) info.Status = models.KnowledgeBaseStatusMinted err = s.KnowledgeUsecase.UpdateKnowledgeBaseById(ctx, info.ID, map[string]interface{}{ "status": info.Status, "kb_token_id": info.KBTokenID, "kb_token_contract_address": info.KBTokenContractAddress, "kb_token_mint_tx": info.KBTokenMintTx, }) if err != nil { return fmt.Errorf("failed to update knowledge base status: %v", err) } s.SendTeleMsgToKBChannel(ctx, fmt.Sprintf("Update KB Status \n kb_id:%v \n old_status:%v \n new_status:%v \n mint id :%v \n tx:%v", info.ID, oldStatus, info.Status, info.KBTokenID, info.KBTokenMintTx), s.conf.KnowledgeBaseConfig.KBActivitiesTelegramAlert) err = s.AgentInfoUseCase.UpdateAgentInfoById(ctx, info.AgentInfoId, map[string]interface{}{ "status": models.AssistantStatusReady, "agent_contract_id": tokenId, "agent_contract_address": info.KBTokenContractAddress, "agent_nft_minted": true, }) if err != nil { return fmt.Errorf("failed to update agent info: %v", err) } return nil } func (s *Service) UpdateKnowledgeBaseInContractWithSignature(ctx context.Context, info *models.KnowledgeBase, request *serializers.UpdateKnowledgeBaseWithSignatureRequest) (*models.KnowledgeBase, error) { var err error appConfig, err := s.AppConfigUseCase.GetAllNameValueInAppConfig(ctx, request.NetworkID) if err != nil { return nil, fmt.Errorf("updateKnowledgeBaseInContractWithSignature error: get all name value in app config: %v", err) } priKey := appConfig[models.KeyConfigNameWalletDeploy] if len(priKey) == 0 { return nil, fmt.Errorf("updateKnowledgeBaseInContractWithSignature error: no priKey for network %v", request.NetworkID) } _, pubKey, err := eth.GetAccountInfo(priKey) if err != nil { return nil, fmt.Errorf("get account info: %v", err) } kbWorkerHubAddress := appConfig[models.KeyConfigNameKnowledgeBaseWorkerHubAddress] if len(kbWorkerHubAddress) == 0 { return nil, fmt.Errorf("updateKnowledgeBaseInContractWithSignature error: no KnowledgeBaseWorkerHubAddress for network %v", request.NetworkID) } tokenContractAddress := appConfig[models.KeyConfigNameKnowledgeBaseTokenContractAddress] if len(tokenContractAddress) == 0 { return nil, fmt.Errorf("updateKnowledgeBaseInContractWithSignature error: no tokenContractAddress for network %v", request.NetworkID) } instanceABI, err := abi.JSON(strings.NewReader(aikb721.EternalAIKB721MetaData.ABI)) if err != nil { return nil, fmt.Errorf("updateKnowledgeBaseInContractWithSignature error: failed to read ABI JSON: %v", err) } kbId, ok := new(big.Int).SetString(info.KBTokenID, 10) if !ok { return nil, fmt.Errorf("updateKnowledgeBaseInContractWithSignature error: knowledge_base_id is not big int") } randomNonceData, ok := new(big.Int).SetString(request.RandomNonceData, 10) if !ok { return nil, fmt.Errorf("updateKnowledgeBaseInContractWithSignature error: random_nonce_data is not big int") } // agentId *big.Int, sysPrompt []byte, promptKey string, promptIdx *big.Int, randomNonce *big.Int, signature []byte signature := strings.TrimPrefix(request.SignatureData, "0x") dataBytes, err := instanceABI.Pack( "updateAgentDataWithSignature", kbId, []byte(request.HashData), request.PromptKeyData, big.NewInt(0), randomNonceData, common.Hex2Bytes(signature), ) // to common.Address, data []byte, promptScheduler common.Address, modelId uint32 if err != nil { return nil, fmt.Errorf("updateKnowledgeBaseInContractWithSignature error: failed to pack ABI data: %v", err) } rpc := s.conf.GetConfigKeyString(info.NetworkID, "rpc_url") var paymasterAddress, paymasterToken string var paymasterFeeZero bool if s.conf.ExistsedConfigKey(info.NetworkID, "paymaster_address") && s.conf.ExistsedConfigKey(info.NetworkID, "paymaster_token") { paymasterAddress = s.conf.GetConfigKeyString(info.NetworkID, "paymaster_address") paymasterToken = s.conf.GetConfigKeyString(info.NetworkID, "paymaster_token") paymasterFeeZero = s.conf.GetConfigKeyBool(info.NetworkID, "paymaster_fee_zero") } aiZkClient := zkclient.NewZkClient(rpc, paymasterFeeZero, paymasterAddress, paymasterToken) tx, err := aiZkClient.Transact(priKey, *pubKey, common.HexToAddress(tokenContractAddress), big.NewInt(0), dataBytes) if err != nil { return nil, fmt.Errorf("updateKnowledgeBaseInContractWithSignature error: failed to transact: %v", err) } if tx.Status == types.ReceiptStatusFailed { return nil, fmt.Errorf("updateKnowledgeBaseInContractWithSignature error: tx exucute with status fail: %v", tx) } info.Status = models.KnowledgeBaseStatusMinted err = s.KnowledgeUsecase.UpdateKnowledgeBaseById(ctx, info.ID, map[string]interface{}{ "status": info.Status, }) if err != nil { return nil, err } return info, nil } func (s *Service) TransferFund(priKeyFrom string, toAddress string, fund *big.Int, networkId uint64) (string, error) { _, pubKey, err := eth.GetAccountInfo(priKeyFrom) if err != nil { return "", fmt.Errorf("get account info: %v", err) } rpc := s.conf.GetConfigKeyString(networkId, "rpc_url") var paymasterAddress, paymasterToken string var paymasterFeeZero bool if s.conf.ExistsedConfigKey(networkId, "paymaster_address") && s.conf.ExistsedConfigKey(networkId, "paymaster_token") { paymasterAddress = s.conf.GetConfigKeyString(networkId, "paymaster_address") paymasterToken = s.conf.GetConfigKeyString(networkId, "paymaster_token") paymasterFeeZero = s.conf.GetConfigKeyBool(networkId, "paymaster_fee_zero") } aiZkClient := zkclient.NewZkClient(rpc, paymasterFeeZero, paymasterAddress, paymasterToken, ) tx, err := aiZkClient.Transact(priKeyFrom, *pubKey, common.HexToAddress(toAddress), fund, nil) if err != nil { return "", fmt.Errorf("failed to transact: %v", err) } return tx.TxHash.Hex(), nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/mission_store.go ================================================ package services import ( "context" "encoding/json" "strings" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/daos" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/serializers" "github.com/jinzhu/gorm" ) func (s *Service) UploadMisstionStore(ctx context.Context, req *serializers.MissionStoreReq) error { var missionStore *models.MissionStore var err error err = daos.WithTransaction( daos.GetDBMainCtx(ctx), func(tx *gorm.DB) error { if req.ID > 0 { missionStore, err = s.dao.FirstMissionStoreByID(tx, req.ID, map[string][]interface{}{}, true) if err != nil { return errs.NewError(err) } if missionStore == nil { return errs.NewError(errs.ErrBadRequest) } //update name vs description only missionStore.Name = req.Name missionStore.Description = req.Description } else { params, _ := json.Marshal(req.Params) missionStore = &models.MissionStore{ Name: req.Name, Description: req.Description, UserPrompt: req.Prompt, Price: req.Price, OwnerAddress: req.OwnerAddress, ToolList: req.ToolList, Icon: req.Icon, OutputType: models.OutputType(req.OutputType), Params: string(params), } } if err != nil { return errs.NewError(err) } if missionStore.ID > 0 { err = s.dao.Save(tx, missionStore) } else { err = s.dao.Create(tx, missionStore) } if err != nil { return errs.NewError(err) } return nil }, ) if err != nil { return errs.NewError(err) } return nil } func (s *Service) RatingMisstionStore(ctx context.Context, req *serializers.MissionStoreRatingReq) error { err := daos.WithTransaction( daos.GetDBMainCtx(ctx), func(tx *gorm.DB) error { if req.HistoryID == 0 { return errs.NewError(errs.ErrBadRequest) } history, err := s.dao.FirstMissionStoreHistoryByID(tx, req.HistoryID, map[string][]interface{}{}, true) if err != nil { return errs.NewError(err) } if history == nil || history.IsRated || !strings.EqualFold(strings.ToLower(history.UserAddress), strings.ToLower(req.UserAddress)) { return errs.NewError(errs.ErrBadRequest) } missionStore, err := s.dao.FirstMissionStoreByID(tx, history.MissionStoreID, map[string][]interface{}{}, true) if err != nil { return errs.NewError(err) } if missionStore == nil { return errs.NewError(errs.ErrBadRequest) } rating := &models.MissionStoreRating{ UserAddress: history.UserAddress, MissionStoreID: missionStore.ID, AgentSnapshotPostID: history.ID, Rating: req.Rating, Comment: req.Comment, } err = s.dao.Create(tx, rating) if err != nil { return errs.NewError(err) } //update history history.IsRated = true err = s.dao.Save(tx, history) if err != nil { return errs.NewError(err) } //update missionstore newRate := (missionStore.Rating*float64(missionStore.NumRating) + req.Rating) / (float64(missionStore.NumRating) + 1) missionStore.Rating = newRate missionStore.NumRating += 1 err = s.dao.Save(tx, missionStore) if err != nil { return errs.NewError(err) } return nil }, ) if err != nil { return errs.NewError(err) } return nil } func (s *Service) GetListMisstionStore(ctx context.Context, search string, page, limit int) ([]*models.MissionStore, uint, error) { res, count, err := s.dao.FindMissionStore4Page(daos.GetDBMainCtx(ctx), map[string][]interface{}{ "name like ?": {"%" + search + "%"}, }, map[string][]interface{}{}, []string{"rating desc"}, page, limit) if err != nil { return nil, 0, errs.NewError(err) } return res, count, nil } func (s *Service) GetMisstionStoreDetail(ctx context.Context, id uint) (*models.MissionStore, error) { res, err := s.dao.FirstMissionStoreByID(daos.GetDBMainCtx(ctx), id, map[string][]interface{}{}, false) if err != nil { return nil, errs.NewError(err) } return res, nil } func (s *Service) ClaimFeeMisstionStore(ctx context.Context) error { return nil } func (s *Service) GetMissionStoreRating(ctx context.Context, id uint, page, limit int) ([]*models.MissionStoreRating, uint, error) { res, count, err := s.dao.FindMissionStoreRating4Page(daos.GetDBMainCtx(ctx), map[string][]interface{}{ "mission_store_id = ?": {id}, }, map[string][]interface{}{}, []string{"rating desc"}, page, limit) if err != nil { return nil, 0, errs.NewError(err) } return res, count, nil } func (s *Service) GetMissionStoreHistory(ctx context.Context, id uint, page, limit int) ([]*models.MissionStoreHistory, uint, error) { res, count, err := s.dao.FindMissionStoreHistory4Page(daos.GetDBMainCtx(ctx), map[string][]interface{}{ "mission_store_id = ?": {id}, }, map[string][]interface{}{}, []string{"id desc"}, page, limit) if err != nil { return nil, 0, errs.NewError(err) } return res, count, nil } func (s *Service) addToolPostTwitter(toollist string, appendTool string) (string, error) { var initialData []map[string]interface{} if err := json.Unmarshal([]byte(toollist), &initialData); err != nil { return toollist, errs.NewError(err) } var appendData map[string]interface{} if err := json.Unmarshal([]byte(appendTool), &appendData); err != nil { return toollist, errs.NewError(err) } initialData = append(initialData, appendData) updatedJSON, err := json.Marshal(initialData) if err != nil { return toollist, errs.NewError(err) } return string(updatedJSON), nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/redis_srv.go ================================================ package services import ( "context" "encoding/json" "fmt" "time" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/helpers" ) func (s *Service) RedisCached( cachedKey string, enabled bool, expiration time.Duration, resp interface{}, dataFetchedFunc func() (interface{}, error), ) error { cachedKey = s.hashRedisKey(fmt.Sprintf("%s_ai_agent_%s", s.conf.Redis.Prefix, cachedKey)) if enabled { val, err := s.rdb.Get(cachedKey).Result() if err == nil && val != "" { err = json.Unmarshal([]byte(val), resp) if err != nil { return errs.NewError(err) } return nil } } // data, err := dataFetchedFunc() if err != nil { return errs.NewError(err) } dataBytes, err := json.Marshal(data) if err != nil { return errs.NewError(err) } // if enabled { err = s.rdb.Set(cachedKey, string(dataBytes), expiration).Err() if err != nil { return errs.NewError(err) } } // err = json.Unmarshal(dataBytes, resp) if err != nil { return errs.NewError(err) } return nil } func (s *Service) RedisCachedWithoutHashKey( cachedKey string, enabled bool, expiration time.Duration, resp interface{}, dataFetchedFunc func() (interface{}, error), ) error { cachedKey = fmt.Sprintf("%s_ai_agent_%s", s.conf.Redis.Prefix, cachedKey) if enabled { val, err := s.rdb.Get(cachedKey).Result() if err == nil && val != "" { err = json.Unmarshal([]byte(val), resp) if err != nil { return errs.NewError(err) } return nil } } // data, err := dataFetchedFunc() if err != nil { return errs.NewError(err) } dataBytes, err := json.Marshal(data) if err != nil { return errs.NewError(err) } // if enabled { err = s.rdb.Set(cachedKey, string(dataBytes), expiration).Err() if err != nil { return errs.NewError(err) } } // err = json.Unmarshal(dataBytes, resp) if err != nil { return errs.NewError(err) } return nil } func (s *Service) hashRedisKey(key string) string { return helpers.Sha256ToNonce(key).Text(16) } func (s *Service) GetRedisCachedWithKey(cachedKey string, resp interface{}) error { cachedKey = s.hashRedisKey(fmt.Sprintf("%s_ai_agent_%s", s.conf.Redis.Prefix, cachedKey)) val, err := s.rdb.Get(cachedKey).Result() if err != nil { return errs.NewError(err) } if val == "" { return errs.NewError(errs.ErrBadContent) } err = json.Unmarshal([]byte(val), resp) if err != nil { return errs.NewError(err) } return nil } func (s *Service) SetRedisCachedWithKey(cachedKey string, req interface{}, expiration time.Duration) error { cachedKey = s.hashRedisKey(fmt.Sprintf("%s_ai_agent_%s", s.conf.Redis.Prefix, cachedKey)) dataBytes, err := json.Marshal(req) if err != nil { return errs.NewError(err) } err = s.rdb.Set(cachedKey, string(dataBytes), expiration).Err() if err != nil { return errs.NewError(err) } return nil } func (s *Service) DeleteRedisCachedWithKey(cachedKey string) error { cachedKey = s.hashRedisKey(fmt.Sprintf("%s_ai_agent_%s", s.conf.Redis.Prefix, cachedKey)) err := s.rdb.Del(cachedKey).Err() if err != nil { return errs.NewError(err) } return nil } func (s *Service) DeleteRedisCachedWithPrefix(cachedKey string) error { iter := s.rdb.Scan(0, fmt.Sprintf("%s_ai_agent_%s*", s.conf.Redis.Prefix, cachedKey), 0).Iterator() for iter.Next() { err := s.rdb.Del(iter.Val()).Err() if err != nil { return errs.NewError(err) } } return nil } func (s *Service) RedisFlushAll(ctx context.Context) error { err := s.rdb.FlushAll().Err() if err != nil { return errs.NewError(err) } return nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/robot_srv.go ================================================ package services import ( "context" "fmt" "math/big" "strings" "time" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/daos" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/helpers" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/serializers" blockchainutils "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/blockchain_utils" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/types/numeric" "github.com/jinzhu/gorm" ) func (s *Service) GenerateRobotSaleWallet(ctx context.Context, projectID string, userAddress string) (*models.RobotSaleWallet, error) { var robotSaleWallet *models.RobotSaleWallet err := daos.WithTransaction( daos.GetDBMainCtx(ctx), func(tx *gorm.DB) error { userAddress = strings.ToLower(userAddress) var err error robotSaleWallet, err = s.dao.FirstRobotSaleWallet(tx, map[string][]interface{}{ "project_id = ?": {projectID}, "user_address = ?": {userAddress}, }, nil, nil) if err != nil { return errs.NewError(errs.ErrInternalServerError) } if robotSaleWallet == nil { solAddress, err := s.CreateSOLAddress(ctx) if err != nil { return errs.NewError(err) } robotSaleWallet = &models.RobotSaleWallet{ ProjectID: projectID, UserAddress: userAddress, SOLAddress: solAddress, SOLRequestAt: helpers.TimeNow(), SOLScanAt: helpers.TimeNow(), } err = s.dao.Create(tx, robotSaleWallet) if err != nil { return errs.NewError(err) } //create robot project robotProject, err := s.dao.FirstRobotProject(tx, map[string][]interface{}{ "project_id = ?": {projectID}, }, nil, nil) if err != nil { return errs.NewError(err) } if robotProject == nil { robotProject = &models.RobotProject{ ProjectID: projectID, ScanEnabled: true, } err = s.dao.Create(tx, robotProject) if err != nil { return errs.NewError(err) } } } return nil }, ) if err != nil { return nil, errs.NewError(err) } return robotSaleWallet, nil } func (s *Service) GetRobotSaleWallet(ctx context.Context, projectID string, userAddress string) (*models.RobotSaleWallet, error) { userAddress = strings.ToLower(userAddress) robotSaleWallet, err := s.dao.FirstRobotSaleWallet(daos.GetDBMainCtx(ctx), map[string][]interface{}{ "project_id = ?": {projectID}, "user_address = ?": {userAddress}, }, nil, nil) if err != nil { return nil, errs.NewError(err) } if robotSaleWallet != nil && robotSaleWallet.SOLScanAt.Before(time.Now().Add(-15*time.Minute)) { go s.RobotScanBalanceByWallet(ctx, robotSaleWallet.ID) } return robotSaleWallet, nil } func (s *Service) GetRobotProject(ctx context.Context, projectID string) (*models.RobotProject, error) { robotProject, err := s.dao.FirstRobotProject(daos.GetDBMainCtx(ctx), map[string][]interface{}{ "project_id = ?": {projectID}, }, nil, nil) if err != nil { return nil, errs.NewError(err) } robotProject.SolPrice = s.GetTokenMarketPrice(daos.GetDBMainCtx(ctx), "SOL") return robotProject, nil } func (s *Service) JobRobotScanBalanceSOL(ctx context.Context) error { err := s.JobRunCheck( ctx, "JobRobotScanBalanceSOL", func() error { wallets, err := s.dao.FindRobotSaleWalletJoinSelect( daos.GetDBMainCtx(ctx), []string{"robot_sale_wallets.*"}, map[string][]interface{}{ "JOIN robot_projects ON robot_projects.project_id = robot_sale_wallets.project_id": {}, }, map[string][]interface{}{ "robot_projects.scan_enabled = ?": {true}, "robot_sale_wallets.sol_request_at >= ?": {time.Now().Add(-6 * time.Hour)}, }, map[string][]any{}, []string{"robot_sale_wallets.sol_scan_at asc"}, 1, 100, ) if err != nil { return errs.NewError(err) } var retErr error for _, wallet := range wallets { err = s.RobotScanBalanceByWallet(ctx, wallet.ID) if err != nil { retErr = errs.MergeError(retErr, errs.NewErrorWithId(err, wallet.ID)) } } return retErr }, ) if err != nil { return errs.NewError(err) } return nil } func (s *Service) RobotScanBalanceByWallet(ctx context.Context, walletId uint) error { saleWallet, err := s.dao.FirstRobotSaleWalletByID( daos.GetDBMainCtx(ctx), walletId, map[string][]interface{}{}, false, ) if err != nil { return errs.NewError(err) } if saleWallet.IsSOLTransferring { return errs.NewError(errs.ErrBadRequest) } solBalance, err := s.blockchainUtils.SolanaBalance(saleWallet.SOLAddress) if err != nil { return errs.NewError(err) } walletBalance := big.NewInt(int64(solBalance)) if walletBalance.Cmp(models.ConvertBigFloatToWei(&saleWallet.SOLOnchainBalance.Float, 9)) != 0 { err = daos.WithTransaction( daos.GetDBMainCtx(ctx), func(tx *gorm.DB) error { saleWallet, err := s.dao.FirstRobotSaleWalletByID( tx, saleWallet.ID, map[string][]interface{}{}, true, ) if err != nil { return errs.NewError(err) } if saleWallet.IsSOLTransferring { return errs.NewError(errs.ErrBadRequest) } if walletBalance.Cmp(models.ConvertBigFloatToWei(&saleWallet.SOLOnchainBalance.Float, 9)) != 0 { err = tx. Model(saleWallet). Updates( map[string]interface{}{ "sol_onchain_balance": numeric.NewBigFloatFromFloat(models.ConvertWeiToBigFloat(walletBalance, 9)), "sol_balance": numeric.NewBigFloatFromFloat( models.AddBigFloats( &saleWallet.SOLMovedBalance.Float, models.ConvertWeiToBigFloat(walletBalance, 9), ), ), }, ).Error if err != nil { return errs.NewError(err) } err = s.dao.UpdatePrijectTotalBalance(tx, saleWallet.ProjectID) if err != nil { return errs.NewError(err) } err = s.dao.UpdateRobotProjectRanking(tx, saleWallet.ProjectID) if err != nil { return errs.NewError(err) } } return nil }, ) if err != nil { return errs.NewError(err) } //TODO: notify change balance } err = daos.GetDBMainCtx(ctx). Model(saleWallet). Updates( map[string]interface{}{ "sol_scan_at": time.Now(), }, ).Error if err != nil { return errs.NewError(err) } return nil } func (s *Service) RobotCreateToken(ctx context.Context, projectID string, req *blockchainutils.SolanaCreateTokenReq) (*models.RobotProject, error) { var robotProject *models.RobotProject err := daos.WithTransaction( daos.GetDBMainCtx(ctx), func(tx *gorm.DB) error { var err error robotProject, err = s.dao.FirstRobotProject(tx, map[string][]interface{}{ "project_id = ?": {projectID}, }, nil, nil) if err != nil { return errs.NewError(err) } if req.Amount == 0 { return errs.NewError(errs.ErrBadRequest) } if robotProject != nil && robotProject.TokenAddress == "" { robotProject, _ = s.dao.FirstRobotProjectByID(tx, robotProject.ID, map[string][]interface{}{}, true) req.Address = s.conf.Robot.TokenAdminAddress if req.Amount == 0 { req.Amount = s.conf.Robot.TokenSupply } if req.Name != "" && req.Symbol != "" { robotProject.TokenSymbol = req.Symbol robotProject.TokenName = req.Name } else if req.Description != "" { tokenInfo, _ := s.GenerateTokenInfoFromVideoPrompt(ctx, req.Description, true) if tokenInfo != nil && tokenInfo.TokenSymbol != "" { robotProject.TokenSymbol = tokenInfo.TokenSymbol robotProject.TokenName = tokenInfo.TokenName robotProject.TokenImageUrl = tokenInfo.TokenImageUrl req.Name = tokenInfo.TokenName req.Symbol = tokenInfo.TokenSymbol } } solanaCreateTokenResp, err := s.blockchainUtils.SolanaCreateToken(req) if err != nil { return errs.NewError(err) } robotProject.TokenAddress = solanaCreateTokenResp.Mint robotProject.TokenSupply = numeric.NewBigFloatFromFloat(big.NewFloat(float64(req.Amount))) robotProject.MintHash = solanaCreateTokenResp.Mint robotProject.Signature = fmt.Sprintf("%v", solanaCreateTokenResp.Signature) err = s.dao.Save(tx, robotProject) if err != nil { return errs.NewError(err) } } return nil }, ) if err != nil { return nil, errs.NewError(err) } return robotProject, nil } func (s *Service) RobotTransferToken(ctx context.Context, req *serializers.RobotTokenTransferReq) (*models.RobotTokenTransfer, error) { var transfer *models.RobotTokenTransfer err := daos.WithTransaction( daos.GetDBMainCtx(ctx), func(tx *gorm.DB) error { robotProject, err := s.dao.FirstRobotProject(tx, map[string][]interface{}{ "project_id = ?": {req.ProjectID}, }, nil, nil) if err != nil { return errs.NewError(err) } if robotProject == nil { return errs.NewError(errs.ErrBadRequest) } transfer = &models.RobotTokenTransfer{ ProjectID: req.ProjectID, ReceiverAddress: req.ReceiverAddress, Amount: numeric.NewBigFloatFromFloat(big.NewFloat(req.Amount)), TransferAt: helpers.TimeNow(), Status: "pending", } transferResp, err := s.blockchainUtils.SolanaTransfer(s.conf.Robot.TokenAdminAddress, &blockchainutils.SolanaTransferReq{ ToAddress: req.ReceiverAddress, Mint: robotProject.TokenAddress, Amount: req.Amount, }) if err != nil { transfer.Status = "failed" transfer.Error = err.Error() } else { transfer.Status = "success" transfer.TxHash = transferResp } err = s.dao.Create(tx, transfer) if err != nil { return errs.NewError(err) } return nil }, ) if err != nil { return nil, errs.NewError(err) } return transfer, nil } func (s *Service) JobUpdateRobotProjectRanking(ctx context.Context) error { err := s.JobRunCheck( ctx, "JobUpdateRobotProjectRanking", func() error { projects, err := s.dao.FindRobotProject( daos.GetDBMainCtx(ctx), map[string][]interface{}{ "scan_enabled = ?": {true}, }, nil, []string{"id asc"}, 0, 100, ) if err != nil { return errs.NewError(err) } var retErr error for _, project := range projects { err = s.UpdateRobotProjectRanking(ctx, project.ProjectID) if err != nil { retErr = errs.MergeError(retErr, errs.NewErrorWithId(err, project.ID)) } } return retErr }, ) if err != nil { return errs.NewError(err) } return nil } func (s *Service) UpdateRobotProjectRanking(ctx context.Context, projectID string) error { return s.dao.UpdateRobotProjectRanking(daos.GetDBMainCtx(ctx), projectID) } func (s *Service) GetRobotProjectLeaderBoards(ctx context.Context, userAddress, projectID string, page, limit int) ([]*models.RobotSaleWallet, error) { lstResp := []*models.RobotSaleWallet{} err := s.RedisCached( fmt.Sprintf("GetRobotProjectLeaderBoards%s_%s_%d_%d", userAddress, projectID, page, limit), true, 10*time.Second, &lstResp, func() (interface{}, error) { if page == 1 && userAddress != "" { userRanking, err := s.dao.FirstRobotSaleWallet( daos.GetDBMainCtx(ctx), map[string][]interface{}{ "user_address = ?": {strings.ToLower(userAddress)}, "project_id = ?": {projectID}, }, nil, nil, ) if err != nil { return nil, errs.NewError(err) } if userRanking == nil { userRanking = &models.RobotSaleWallet{ UserAddress: userAddress, ProjectID: projectID, Ranking: 0, SOLBalance: numeric.NewBigFloatFromString("0"), } } lstResp = []*models.RobotSaleWallet{userRanking} } filters := map[string][]interface{}{ "project_id = ?": {projectID}, } if userAddress != "" { filters["user_address != ?"] = []interface{}{strings.ToLower(userAddress)} } wallets, err := s.dao.FindRobotSaleWallet4Page( daos.GetDBMainCtx(ctx), filters, map[string][]interface{}{}, []string{"ranking asc"}, page, limit, ) if err != nil { return nil, errs.NewError(err) } lstResp = append(lstResp, wallets...) return lstResp, nil }, ) if err != nil { return nil, errs.NewError(err) } return lstResp, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/sample_twitter_app.go ================================================ package services import ( "context" "encoding/base64" "time" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/daos" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/helpers" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/types/numeric" ) func (s *Service) SampleTwitterAppAuthenInstall(ctx context.Context, installCode string, installUri string) (string, error) { if installCode == "" { return "", errs.NewError(errs.ErrBadRequest) } redirectUri := helpers.BuildUri( s.conf.SampleTwitterApp.RedirectUri, map[string]string{ "install_code": installCode, "install_uri": installUri, }, ) return helpers.BuildUri( "https://twitter.com/i/oauth2/authorize", map[string]string{ "client_id": s.conf.SampleTwitterApp.OauthClientId, "state": "state", "response_type": "code", "code_challenge": "challenge", "code_challenge_method": "plain", "scope": "offline.access+tweet.read+tweet.write+users.read+follows.write+like.write+like.read+users.read", "redirect_uri": redirectUri, }, ), nil } func (s *Service) SampleTwitterAppAuthenCallback(ctx context.Context, installCode string, installUri string, code string) (string, error) { if installCode == "" || code == "" { return "", errs.NewError(errs.ErrBadRequest) } apiKey, err := func() (string, error) { redirectUri := helpers.BuildUri( s.conf.SampleTwitterApp.RedirectUri, map[string]string{ "install_code": installCode, "install_uri": installUri, }, ) respOauth, err := s.twitterAPI.TwitterOauthCallbackForSampleApp( s.conf.SampleTwitterApp.OauthClientId, s.conf.SampleTwitterApp.OauthClientSecret, code, redirectUri) if err != nil { return "", errs.NewError(err) } if respOauth != nil && respOauth.AccessToken != "" { twitterUser, err := s.twitterAPI.GetTwitterMe(respOauth.AccessToken) if err != nil { return "", errs.NewError(err) } twitterInfo, err := s.dao.FirstTwitterInfo( daos.GetDBMainCtx(ctx), map[string][]interface{}{ "twitter_id = ?": {twitterUser.ID}, }, map[string][]interface{}{}, false, ) if err != nil { return "", errs.NewError(err) } if twitterInfo == nil { twitterInfo = &models.TwitterInfo{ TwitterID: twitterUser.ID, } } twitterInfo.TwitterAvatar = twitterUser.ProfileImageURL twitterInfo.TwitterName = twitterUser.Name twitterInfo.TwitterUsername = twitterUser.UserName twitterInfo.AccessToken = respOauth.AccessToken twitterInfo.RefreshToken = respOauth.RefreshToken twitterInfo.ExpiresIn = respOauth.ExpiresIn twitterInfo.Scope = respOauth.Scope twitterInfo.TokenType = respOauth.TokenType twitterInfo.OauthClientId = s.conf.Twitter.OauthClientIdForTwitterData twitterInfo.OauthClientSecret = s.conf.Twitter.OauthClientSecretForTwitterData twitterInfo.Description = twitterUser.Description twitterInfo.RefreshError = "OK" expiredAt := time.Now().Add(time.Second * time.Duration(respOauth.ExpiresIn-(60*20))) twitterInfo.ExpiredAt = &expiredAt err = s.dao.Save(daos.GetDBMainCtx(ctx), twitterInfo) if err != nil { return "", errs.NewError(err) } sampleTwitterApp, err := s.dao.FirstSampleTwitterApp( daos.GetDBMainCtx(ctx), map[string][]interface{}{ "install_code = ?": {installCode}, }, map[string][]interface{}{}, []string{}, ) if err != nil { return "", errs.NewError(err) } if sampleTwitterApp == nil { sampleTwitterApp = &models.SampleTwitterApp{ InstallCode: installCode, ApiKey: helpers.RandomStringWithLength(64), TwitterInfoID: twitterInfo.ID, } err = s.dao.Create(daos.GetDBMainCtx(ctx), sampleTwitterApp) if err != nil { return "", errs.NewError(err) } } return sampleTwitterApp.ApiKey, nil } return "", errs.NewError(errs.ErrBadRequest) }() if err != nil { return helpers.BuildUri( installUri, map[string]string{ "install_code": installCode, "error": err.Error(), }, ), nil } params := map[string]string{ "api_key": apiKey, } returnData := base64.StdEncoding.EncodeToString([]byte(helpers.ConvertJsonString(params))) return helpers.BuildUri( installUri, map[string]string{ "install_code": installCode, "return_data": returnData, }, ), nil } func (s *Service) SampleTwitterAppGetBTCPrice(ctx context.Context) string { btcPrice := s.GetTokenMarketPrice(daos.GetDBMainCtx(ctx), "BTC") return numeric.BigFloat2Text(btcPrice) } func (s *Service) SampleTwitterAppTweetMessage(ctx context.Context, apiKey string, content string) (string, error) { if apiKey == "" || content == "" { return "", errs.NewError(errs.ErrBadRequest) } sampleTwitterApp, err := s.dao.FirstSampleTwitterApp( daos.GetDBMainCtx(ctx), map[string][]interface{}{ "api_key = ?": {apiKey}, }, map[string][]interface{}{ "TwitterInfo": {}, }, []string{}, ) if err != nil { return "", errs.NewError(err) } if sampleTwitterApp == nil { return "", errs.NewError(errs.ErrBadRequest) } userMe, err := helpers.GetTwitterUserMe(sampleTwitterApp.TwitterInfo.AccessToken) if err != nil { return "", errs.NewError(err) } maxChars := 280 if userMe.Data.Verified { maxChars = 4000 } contentLines := helpers.SplitTextBySentenceAndCharLimitAndRemoveTrailingHashTag(content, maxChars) if len(contentLines) <= 0 { return "", errs.NewError(errs.ErrBadRequest) } refId, err := helpers.PostTweetByToken(sampleTwitterApp.TwitterInfo.AccessToken, contentLines[0], "") if err != nil { return "", errs.NewError(err) } for i := 1; i < len(contentLines); i++ { refIdTmp, _ := helpers.ReplyTweetByToken(sampleTwitterApp.TwitterInfo.AccessToken, contentLines[i], refId, "") if refIdTmp != "" { refId = refIdTmp } } return refId, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/service.go ================================================ package services import ( "context" "errors" "fmt" "math/big" "strings" "sync" "time" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/internal/usecase/agent_info" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/internal/usecase/appconfig" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/configs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/daos" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/internal/core/ports" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/internal/repository" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/internal/usecase/knowledge" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/logger" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/pkg/drivers/mysql" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/pkg/secret_manager" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/pkg/utils" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/aidojo" blockchainutils "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/blockchain_utils" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/bridgeapi" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/btcapi" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/clanker" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/coingecko" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/coinmarketcap" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/core" deepresearch "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/deep_research" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/dexscreener" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/ethapi" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/googlestorage" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/moralis" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/openai" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/opensea" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/privy" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/pumfun" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/rapid" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/taapi" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/trxapi" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/twitter" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/zkapi" "github.com/go-redis/redis" "github.com/jinzhu/gorm" "go.uber.org/zap" ) type Service struct { jobRunMap map[string]bool jobMutex sync.Mutex jobDisabled bool // config conf *configs.Config // clients rdb *redis.Client coreClient *core.Client gsClient *googlestorage.Client openais map[string]*openai.OpenAI ethApiMap map[uint64]*ethapi.Client zkApiMap map[uint64]*zkapi.Client trxApi *trxapi.Client rapid *rapid.Rapid blockchainUtils *blockchainutils.Client deepResearch *deepresearch.Client btcAPI *btcapi.Client pumfunAPI *pumfun.Client cmc *coinmarketcap.CoinMarketCap cgc *coingecko.CoinGeckoAPI twitterAPI *twitter.Client twitterWrapAPI *twitter.Client dojoAPI *aidojo.AiDojoBackend bridgeAPI *bridgeapi.BridgeApi dexscreener *dexscreener.DexScreenerAPI openseaService *opensea.OpenseaService taapi *taapi.TaApi clanker *clanker.Client privyClient *privy.Client moralisClient *moralis.Client // daos dao *daos.DAO KnowledgeUsecase ports.IKnowledgeUsecase AppConfigUseCase ports.IAppConfigUseCase AgentInfoUseCase ports.IAgentInfoUseCase } func NewService(conf *configs.Config) *Service { s := &Service{ jobRunMap: map[string]bool{}, jobMutex: sync.Mutex{}, // conf: conf, // rdb: redis.NewClient(&redis.Options{ Addr: conf.Redis.Addr, Password: conf.Redis.Password, DB: conf.Redis.Db, }), coreClient: &core.Client{ BaseURL: conf.Core.Url, }, gsClient: googlestorage.InitClient(conf.GsStorage.CredentialsFile, conf.GsStorage.BucketName), openais: map[string]*openai.OpenAI{ "Agent": openai.NewAgentAI(conf.Ai.ApiKey), "Lama": openai.NewOpenAI(conf.Ai.ChatUrl, conf.Ai.ApiKeyMacStudio, conf.Ai.ModelName), }, ethApiMap: map[uint64]*ethapi.Client{}, zkApiMap: map[uint64]*zkapi.Client{}, trxApi: &trxapi.Client{ RpcURL: conf.Tron.RpcUrl, ApiURL: "https://api.trongrid.io", GrpcURL: "grpc.trongrid.io:50051", APIKey: conf.Tron.ApiKey, }, rapid: rapid.NewRapid(conf.RapidApiKey), blockchainUtils: &blockchainutils.Client{ BaseURL: conf.BlockchainUtils.Url, }, deepResearch: &deepresearch.Client{ BaseURL: conf.DeepResearch.Url, }, btcAPI: &btcapi.Client{ Chain: "btc", Network: conf.Btc.Network, Token: conf.Btc.BcyToken, QNUrl: conf.Btc.QnUrl, SdkUrl: "", BlockstreamUrl: "https://blockstream.info", MempoolUrl: "https://mempool.space", HirosoUrl: "https://api.hiro.so", BlockchainInfoUrl: "https://blockchain.info", }, pumfunAPI: &pumfun.Client{ BaseUrl: "https://frontend-api.pump.fun", }, cmc: coinmarketcap.NewCoinMarketCap(conf.CMCApiKey), cgc: coingecko.NewCoinGeckoAPI(), // daos dao: &daos.DAO{}, twitterAPI: twitter.NewClient(conf.Twitter.Token, conf.Twitter.ConsumerKey, conf.Twitter.ConsumerSecret, conf.Twitter.AccessToken, conf.Twitter.AccessSecret, conf.Twitter.OauthClientId, conf.Twitter.OauthClientSecret, conf.Twitter.RedirectUri, ), twitterWrapAPI: twitter.NewTwitterWrapClient(conf.Twitter.TokenForTwitterData), dojoAPI: aidojo.NewAiDojoBackend(conf.AiDojoBackend.Url, conf.AiDojoBackend.ApiKey), bridgeAPI: bridgeapi.NewBridgeApi(conf.EternalaiBridgesUrl), dexscreener: dexscreener.NewDexScreenerAPI(), openseaService: opensea.NewOpensea(conf.OpenseaAPIKey), taapi: taapi.NewTaApi(conf.TaApiKey), clanker: clanker.NewClankerClient(conf.Clanker.ApiKey, conf.Clanker.ApiUrl), privyClient: privy.NewPrivyClient(conf.Privy.AppID, conf.Privy.AppSecret), moralisClient: &moralis.Client{ APIKey: conf.MoralisApiKey, }, } gormDB := mysql.NewDefaultMysqlGormConn(nil, s.conf.DbURL, s.conf.Debug) knowledgeBaseRepo := repository.NewKnowledgeBaseRepository(gormDB) knowledgeBaseFileRepo := repository.NewKnowledgeBaseFileRepository(gormDB) agentInfoKnowledgeBaseRepo := repository.NewAgentInfoKnowledgeBaseRepository(gormDB) agentInfoRepo := repository.NewAgentInfoRepository(gormDB) secretKey := conf.SecretKey var googleSecretKey string if utils.IsEnvProduction(conf.Env) { key, err := secret_manager.GetGoogleSecretKey(context.Background(), secretKey) googleSecretKey = key if err != nil { logger.Error("", "GetGoogleSecretKey", zap.Error(err)) } } else { googleSecretKey = secretKey } s.KnowledgeUsecase = knowledge.NewKnowledgeUsecase( knowledge.WithRepos( knowledgeBaseRepo, knowledgeBaseFileRepo, agentInfoKnowledgeBaseRepo, agentInfoRepo, ), knowledge.WithSecretKey(googleSecretKey), knowledge.WithEthApiMap(s.ethApiMap), knowledge.WithNetworks(conf.Networks), knowledge.WithTrxApi(s.trxApi), knowledge.WithRagApi(conf.RagApi), knowledge.WithLighthousekey(conf.Lighthouse.Apikey), knowledge.WithWebhookUrl(conf.WebhookUrl), knowledge.WithNotiBot( s.conf.KnowledgeBaseConfig.KBTelegramKey, s.conf.KnowledgeBaseConfig.KBActivitiesTelegramAlert, s.conf.KnowledgeBaseConfig.KBErrorTelegramAlert, ), knowledge.WithConfig(s.conf), ) appConfigRepo := repository.NewAppConfigRepository(gormDB) s.AppConfigUseCase = appconfig.NewAppConfigUseCase(appConfigRepo) s.AgentInfoUseCase = agent_info.NewAgentInfoUseCase(agentInfoRepo) InitTeleVideoActivitiesAlert(s.conf.VideoTelegramKey, s.conf.VideoActivitiesTelegramAlert) InitTeleMagicVideoActivitiesAlert(s.conf.VideoTelegramKey, s.conf.MagicVideoActivitiesTelegramAlert) return s } func (s *Service) GetAddressPrk(address string) string { var prkHex string var err error for k, v := range s.conf.PrivateKeys { if strings.EqualFold(k, address) { prkHex = v break } } if prkHex == "" { prkHex, err = s.coreClient.GetAddressPrk( address, ) if err != nil { panic(err) } } return prkHex } func (s *Service) GetTwitterWrapAPI() *twitter.Client { return s.twitterWrapAPI } func (s *Service) JobRunCheck(ctx context.Context, jobId string, jobFunc func() error) error { s.jobMutex.Lock() isRun := s.jobRunMap[jobId] jobDisabled := s.jobDisabled s.jobMutex.Unlock() if !isRun && !jobDisabled { s.jobMutex.Lock() s.jobRunMap[jobId] = true s.jobMutex.Unlock() defer func() { s.jobMutex.Lock() s.jobRunMap[jobId] = false s.jobMutex.Unlock() if rval := recover(); rval != nil { err := errs.NewError(errors.New(fmt.Sprint(rval))) stacktrace := err.(*errs.Error).Stacktrace() fmt.Println(time.Now(), jobId, "panic", err.Error(), stacktrace) } }() fmt.Println(time.Now(), jobId, "begin") err := jobFunc() if err != nil { err = errs.NewError(err) stacktrace := err.(*errs.Error).Stacktrace() fmt.Println(time.Now(), jobId, "error", err.Error(), stacktrace) return err } else { fmt.Println(time.Now(), jobId, "end") } return err } return nil } func (s *Service) JobRun(ctx context.Context, jobName string, duration time.Duration, jobFunc func() error) { s.jobMutex.Lock() isRun := s.jobRunMap[jobName] s.jobMutex.Unlock() if !isRun { s.jobMutex.Lock() s.jobRunMap[jobName] = true s.jobMutex.Unlock() go func() { for { fmt.Println(time.Now(), jobName, "begin") err := func() error { defer func() { if rval := recover(); rval != nil { err := errs.NewError(errors.New(fmt.Sprint(rval))) stacktrace := err.(*errs.Error).Stacktrace() fmt.Println(time.Now(), jobName, "panic", err.Error(), stacktrace) } }() err := jobFunc() if err != nil { return errs.NewError(err) } return nil }() if err != nil { err = errs.NewError(err) stacktrace := err.(*errs.Error).Stacktrace() fmt.Println(time.Now(), jobName, "error", err.Error(), stacktrace) } else { fmt.Println(time.Now(), jobName, "end") } time.Sleep(duration) } }() } } func (s *Service) VerifyAddressSignature(ctx context.Context, networkID uint64, address string, message string, signature string) error { err := s.GetEthereumClient(ctx, networkID).ValidateMessageSignature( message, signature, address, ) if err != nil { return errs.NewError(err) } return nil } func (s *Service) GetTokenMarketPrice(tx *gorm.DB, symbol string) *big.Float { cachedKey := fmt.Sprintf(`GetTokenMarketPrice_%s`, symbol) tokenPrice := big.NewFloat(0) _ = s.GetRedisCachedWithKey(cachedKey, &tokenPrice) if tokenPrice.Cmp(big.NewFloat(0)) <= 0 { tkPrice, _, err := s.dao.GetTokenMarketPrice(tx, symbol) if err != nil { return big.NewFloat(0) } tokenPrice = &tkPrice.Float _ = s.SetRedisCachedWithKey(cachedKey, tokenPrice, 5*time.Minute) } return tokenPrice } func (s *Service) GetMapTokenPrice(ctx context.Context) map[string]*big.Float { cachedKey := `AgentGetMapTokenPrice` mapTokenPrice := map[string]*big.Float{} err := s.GetRedisCachedWithKey(cachedKey, &mapTokenPrice) if err != nil { mapTokenPrice["BTC"] = s.GetTokenMarketPrice(daos.GetDBMainCtx(ctx), "BTC") mapTokenPrice["ETH"] = s.GetTokenMarketPrice(daos.GetDBMainCtx(ctx), "ETH") mapTokenPrice["BVM"] = s.GetTokenMarketPrice(daos.GetDBMainCtx(ctx), "BVM") mapTokenPrice["EAI"] = s.GetTokenMarketPrice(daos.GetDBMainCtx(ctx), "EAI") mapTokenPrice["SOL"] = s.GetTokenMarketPrice(daos.GetDBMainCtx(ctx), "SOL") s.SetRedisCachedWithKey(cachedKey, mapTokenPrice, 1*time.Minute) } return mapTokenPrice } func (s *Service) GetDao() *daos.DAO { return s.dao } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/store_trading_app.go ================================================ package services import ( "context" "encoding/base64" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/daos" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/helpers" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" ) func (s *Service) StoreDefiAppAuthenInstall(ctx context.Context, installCode string, installUri string) (string, error) { if installCode == "" { return "", errs.NewError(errs.ErrBadRequest) } apiKey, solAddress, err := func() (string, string, error) { storeDefiApp, err := s.dao.FirstStoreDefiApp( daos.GetDBMainCtx(ctx), map[string][]interface{}{ "install_code = ?": {installCode}, }, map[string][]interface{}{}, []string{}, ) if err != nil { return "", "", errs.NewError(err) } if storeDefiApp == nil { solAddress, err := s.CreateSOLAddress(ctx) if err != nil { return "", "", errs.NewError(err) } storeDefiApp = &models.StoreDefiApp{ InstallCode: installCode, ApiKey: helpers.RandomStringWithLength(64), SolAddress: solAddress, } err = s.dao.Create(daos.GetDBMainCtx(ctx), storeDefiApp) if err != nil { return "", "", errs.NewError(err) } } return storeDefiApp.ApiKey, storeDefiApp.SolAddress, nil }() if err != nil { return helpers.BuildUri( installUri, map[string]string{ "install_code": installCode, "error": err.Error(), }, ), nil } params := map[string]string{ "api_key": apiKey, "sol_address": solAddress, } returnData := base64.StdEncoding.EncodeToString([]byte(helpers.ConvertJsonString(params))) return helpers.BuildUri( installUri, map[string]string{ "install_code": installCode, "return_data": returnData, }, ), nil } func (s *Service) StoreDefiAppGetWallet(ctx context.Context, apiKey string) (string, error) { if apiKey == "" { return "", errs.NewError(errs.ErrBadRequest) } storeDefiApp, err := s.dao.FirstStoreDefiApp( daos.GetDBMainCtx(ctx), map[string][]interface{}{ "api_key = ?": {apiKey}, }, map[string][]interface{}{}, []string{}, ) if err != nil { return "", errs.NewError(err) } if storeDefiApp == nil { return "", errs.NewError(errs.ErrBadRequest) } return storeDefiApp.SolAddress, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/telegram.go ================================================ package services import ( "context" "fmt" "os" "os/signal" "strconv" "strings" "syscall" tl "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/telegram" "github.com/mymmrac/telego" ) var teleVideoActivitiesAlert *telego.Bot var teleVideoActivitiesChatId int64 var teleMagicVideoActivitiesAlert *telego.Bot var teleMagicVideoActivitiesChatId int64 func InitTeleMagicVideoActivitiesAlert(token, chatId string) { if len(token) == 0 || len(chatId) == 0 { return } teleMagicVideoActivitiesChatId, _ = strconv.ParseInt(chatId, 10, 64) teleMagicVideoActivitiesAlert, _ = telego.NewBot(token, telego.WithDefaultDebugLogger()) } func (s *Service) SendTeleMagicVideoActivitiesAlert(msg string) { if teleMagicVideoActivitiesAlert != nil { go func() { teleMagicVideoActivitiesAlert.SendMessage( &telego.SendMessageParams{ ChatID: telego.ChatID{ ID: teleMagicVideoActivitiesChatId, }, Text: strings.TrimSpace(msg), }, ) }() } } func InitTeleVideoActivitiesAlert(token, chatId string) { if len(token) == 0 || len(chatId) == 0 { return } teleVideoActivitiesChatId, _ = strconv.ParseInt(chatId, 10, 64) teleVideoActivitiesAlert, _ = telego.NewBot(token, telego.WithDefaultDebugLogger()) } func (s *Service) SendTeleVideoActivitiesAlert(msg string, chatId ...string) { if teleVideoActivitiesAlert != nil { go func() { chatID := teleVideoActivitiesChatId var err error if len(chatId) > 0 { chatID, err = strconv.ParseInt(chatId[0], 10, 64) if err != nil { return } } teleVideoActivitiesAlert.SendMessage( &telego.SendMessageParams{ ChatID: telego.ChatID{ ID: chatID, }, Text: strings.TrimSpace(msg), }, ) }() } } func (s *Service) GetTelegramMessage(ctx context.Context) { client := tl.NewClient(20670342, "94dc0a1407d2c786a802de64b048707a") // Create a context that will be canceled on SIGINT ctx, cancel := context.WithCancel(context.Background()) defer cancel() // Handle SIGINT sigChan := make(chan os.Signal, 1) signal.Notify(sigChan, syscall.SIGINT, syscall.SIGTERM) go func() { <-sigChan cancel() }() // Run the client if err := client.Run(ctx); err != nil { fmt.Printf("Failed to run client: %v", err) } // Get messages from the channel if err := client.GetMessages(ctx, "https://t.me/fttrenches_sol", 5); err != nil { fmt.Printf("Failed to get messages: %v", err) } } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/token_liquidity.go ================================================ package services import ( "context" "encoding/json" "fmt" "math/big" "strconv" "strings" "time" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/daos" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/helpers" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/serializers" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/types/numeric" "github.com/ethereum/go-ethereum/common" "github.com/jinzhu/gorm" ) func (s *Service) GetAllConfigs(ctx context.Context) (map[uint64]map[string]string, error) { resp := map[uint64]map[string]string{} for networkStr, network := range s.conf.Networks { networkID, _ := strconv.ParseUint(networkStr, 10, 64) m, ok := resp[networkID] if !ok { m = map[string]string{} resp[networkID] = m } m["agent_admin_address"] = network["agent_admin_address"] m["agent_contract_address"] = network["agent_contract_address"] m["eai_contract_address"] = network["eai_contract_address"] m["explorer_url"] = network["explorer_url"] m["uniswap_factory_contract_address"] = network["uniswap_factory_contract_address"] m["uniswap_position_mamanger_address"] = network["uniswap_position_mamanger_address"] m["weth9_contract_address"] = network["weth9_contract_address"] } return resp, nil } func (s *Service) GetAllConfigsExplorer(ctx context.Context) (map[uint64]string, error) { resp := map[uint64]string{} for networkStr, network := range s.conf.Networks { networkID, _ := strconv.ParseUint(networkStr, 10, 64) resp[networkID] = network["explorer_url"] } return resp, nil } func (s *Service) CreateMeme(ctx context.Context, address string, networkID uint64, req *serializers.MemeReq) (*models.Meme, error) { meme := &models.Meme{ NetworkID: networkID, OwnerAddress: strings.ToLower(address), TokenAddress: "", Name: req.Name, Description: req.Description, Ticker: req.Ticker, Image: req.Image, Twitter: req.Twitter, Telegram: req.Telegram, Website: req.Website, Status: models.MemeStatusNew, StoreImageOnChain: req.OnchainImage, TotalSuply: numeric.NewBigFloatFromString("1000000000"), Supply: numeric.NewBigFloatFromString("1000000000"), Decimals: 18, AgentInfoID: req.AgentInfoID, BaseTokenSymbol: req.BaseTokenSymbol, ReqSyncAt: helpers.TimeNow(), SyncAt: helpers.TimeNow(), TokenId: helpers.RandomBigInt(32).String(), NotGraduated: req.NotGraduated, } switch meme.NetworkID { case models.BASE_CHAIN_ID, models.ARBITRUM_CHAIN_ID, models.BSC_CHAIN_ID, models.AVALANCHE_C_CHAIN_ID, models.APE_CHAIN_ID, models.CELO_CHAIN_ID: { agentChainFee, err := s.GetAgentChainFee( daos.GetDBMainCtx(ctx), meme.NetworkID, ) if err != nil { return nil, errs.NewError(err) } meme.Fee = agentChainFee.TokenFee } default: { return nil, errs.NewError(errs.ErrBadRequest) } } agent, err := s.dao.FirstAgentInfoByID( daos.GetDBMainCtx(ctx), meme.AgentInfoID, map[string][]any{}, false, ) if err != nil { return nil, errs.NewError(err) } if agent.RefTweetID > 0 { meme.Fee = numeric.NewBigFloatFromString("0") } owner, err := s.GetUser(daos.GetDBMainCtx(ctx), networkID, meme.OwnerAddress, false) if err != nil { return nil, errs.NewError(err) } meme.OwnerID = owner.ID err = s.dao.Create(daos.GetDBMainCtx(ctx), meme) if err != nil { return nil, errs.NewError(err) } return meme, nil } func (s *Service) GetListMemeReport(ctx context.Context, chainID uint64, address, search, status string, following bool, sortListStr []string, page, limit int, ) ([]*models.Meme, uint, error) { var resp []*models.Meme cacheKey := fmt.Sprintf(`CacheGetListMemeReport_%s_%s_%s_%d_%d`, address, strings.Join(sortListStr, "_"), status, page, limit) if search == "" { s.GetRedisCachedWithKey(cacheKey, &resp) if len(resp) > 0 { return resp, 0, nil } } sortDefault := "market_cap desc" if len(sortListStr) > 0 { sortDefault = strings.Join(sortListStr, ", ") } joinFilters := map[string][]any{} filters := map[string][]any{} if chainID > 0 { filters[`network_id = ?`] = []any{chainID} } selected := []string{ `ifnull((cast(( memes.price - memes.price_last24h) / memes.price_last24h * 100 as decimal(20, 2))), 0) percent`, `(memes.price_usd * memes.total_suply) market_cap`, `memes.*`, } if address != "" { if following { filters[`memes.owner_address in ( select d.address from users u join meme_followers f on f.user_id = u.id join users d on f.follow_user_id = d.id where u.address = ? )`] = []any{strings.ToLower(address)} } else { joinFilters[` left join ( SELECT cast(balance as decimal(36, 18)) total_balance, memes.id meme_id FROM erc20_holders join memes on erc20_holders.contract_address = memes.token_address WHERE erc20_holders.deleted_at IS NULL AND cast(balance as decimal(36, 18)) > 0.00000001 AND erc20_holders.address = ? ) h on memes.id = h.meme_id `] = []any{strings.ToLower(address)} filters[`memes.owner_address = ? or ifnull(h.total_balance, 0) > 0`] = []any{strings.ToLower(address)} selected = append(selected, `ifnull(h.total_balance, 0) total_balance`) } } if search != "" { search = fmt.Sprintf("%%%s%%", strings.ToLower(search)) filters[` LOWER(memes.ticker) like ? or LOWER(memes.name) like ? or LOWER(memes.token_address) like ? `] = []any{search, search, search} } if status != "" { listStatus := strings.Split(status, ",") if len(listStatus) > 0 { filters["memes.status in (?)"] = []any{listStatus} } } keys, count, err := s.dao.FindMemeJoinSelect4Page(daos.GetDBMainCtx(ctx), selected, joinFilters, filters, map[string][]any{ "Owner": {}, "AgentInfo": {}, "AgentInfo.TwitterInfo": {}, "AgentInfo.TmpTwitterInfo": {}, }, []string{sortDefault}, page, limit, ) if err != nil { return nil, count, errs.NewError(err) } agentInfoIds := []uint{} for _, v := range keys { agentInfoIds = append(agentInfoIds, v.AgentInfoID) } latestPost, _ := s.GetListAgentTwitterLatestPost(ctx, 0, agentInfoIds, 0, 100000) for _, v := range keys { v.LatestAgentTwitterPost = latestPost[v.ID] } if search == "" { err = s.SetRedisCachedWithKey( cacheKey, keys, 30*time.Second, ) } return keys, count, nil } // //////Feed API func (s *Service) GetFeedMemeReport(ctx context.Context, address, search, sortType string, page, limit int) ([]*models.Meme, uint, error) { joinFilters := map[string][]any{} filters := map[string][]any{} sortNum, _ := strconv.Atoi(sortType) sortDefault := `seen_time asc, weight desc, percent desc` if sortNum > 0 { sortDefault = `seen_time asc, weight asc, percent asc` } selected := []string{ `ifnull((cast(( memes.price - memes.price_last24h) / memes.price_last24h * 100 as decimal(20, 2))), 0) percent`, `(memes.price_usd * memes.total_suply) market_cap`, `memes.*`, } if address != "" { joinFilters[`left join meme_seens on meme_seens.meme_id = memes.id and meme_seens.user_address = ?`] = []any{strings.ToLower(address)} selected = append(selected, `ifnull(DATE_FORMAT(meme_seens.seen_time, '%Y-%m-%d'), '2000-01-01') seen_time`) } else { selected = append(selected, `'2000-01-01' seen_time`) } if search != "" { search = fmt.Sprintf("%%%s%%", strings.ToLower(search)) filters[` LOWER(memes.ticker) like ? or LOWER(memes.name) like ? or LOWER(memes.token_address) like ? or LOWER(memes.description) like ? `] = []any{search, search, search, search} } keys, count, err := s.dao.FindMemeJoinSelect4Page(daos.GetDBMainCtx(ctx), selected, joinFilters, filters, map[string][]any{ "Owner": []any{}, }, []string{sortDefault}, page, limit, ) if err != nil { return nil, count, errs.NewError(err) } return keys, count, nil } func (s *Service) GetMemeDetail(ctx context.Context, address, memAddress string) (string, error) { var resp string cacheKey := fmt.Sprintf(`CacheMemeDetail_%s`, strings.ToLower(memAddress)) err := s.GetRedisCachedWithKey(cacheKey, &resp) if err != nil { s.CacheMemeDetail(daos.GetDBMainCtx(ctx), memAddress) s.GetRedisCachedWithKey(cacheKey, &resp) } go s.CheckedSeenMeme(ctx, address, memAddress) return resp, nil } func (s *Service) CheckedSeenMeme(ctx context.Context, address, memAddress string) (bool, error) { err := daos.WithTransaction( daos.GetDBMainCtx(ctx), func(tx *gorm.DB) error { filters := map[string][]any{ "memes.token_address = ?": {strings.ToLower(memAddress)}, } meme, err := s.dao.FirstMeme(tx, filters, map[string][]any{}, false, ) if err != nil { return errs.NewError(err) } user, err := s.GetUser(tx, meme.NetworkID, strings.ToLower(address), false) if err != nil { return errs.NewError(err) } if meme != nil && user != nil { memeSeen, err := s.dao.FirstMemeSeen(tx, map[string][]any{ "user_id = ?": {user.ID}, "meme_id = ?": {meme.ID}, }, map[string][]any{}, false) if err != nil { return errs.NewError(err) } if memeSeen == nil { memeSeen = &models.MemeSeen{ UserID: user.ID, UserAddress: strings.ToLower(user.Address), MemeID: meme.ID, MemeAddress: strings.ToLower(meme.TokenAddress), SeenTime: helpers.TimeNow(), } err = s.dao.Create(tx, memeSeen) if err != nil { return errs.NewError(err) } } else { memeSeen, _ = s.dao.FirstMemeSeenByID(tx, memeSeen.ID, map[string][]any{}, true) memeSeen.SeenTime = helpers.TimeNow() err = s.dao.Save(tx, memeSeen) if err != nil { return errs.NewError(err) } } } return nil }, ) if err != nil { return false, errs.NewError(err) } return true, nil } func (s *Service) CacheMemeDetail(tx *gorm.DB, memAddress string) error { filters := map[string][]any{ "memes.token_address = ?": {strings.ToLower(memAddress)}, } joinFilters := map[string][]any{} joinFilters[` left join ( SELECT count(DISTINCT erc20_holders.address) holders, memes.id meme_id FROM erc20_holders join memes on erc20_holders.contract_address = memes.token_address WHERE 1=1 AND erc20_holders.deleted_at IS NULL AND cast(balance as decimal(36, 18)) > 0.00000001 AND erc20_holders.contract_address = ? group by memes.id ) h on memes.id = h.meme_id `] = []any{strings.ToLower(memAddress)} selected := []string{ `ifnull((cast(( memes.price - memes.price_last24h) / memes.price_last24h * 100 as decimal(20, 2))), 0) percent`, "memes.*", "ifnull(h.holders, 0) holders", `(memes.price_usd * memes.total_suply) market_cap`, } key, err := s.dao.FirstMemeJoinSelect(tx, selected, joinFilters, filters, map[string][]any{ "Owner": {}, "AgentInfo": {}, "AgentInfo.TwitterInfo": {}, "AgentInfo.TmpTwitterInfo": {}, }, []string{}, ) if err != nil { return errs.NewError(err) } cacheData, err := json.Marshal(&serializers.Resp{Result: serializers.NewMemeResp(key)}) if err != nil { errs.NewError(err) } err = s.SetRedisCachedWithKey( fmt.Sprintf(`CacheMemeDetail_%s`, strings.ToLower(memAddress)), string(cacheData), 30*time.Second, ) if err != nil { return errs.NewError(err) } return nil } func (s *Service) GetMemeTradeHistory(ctx context.Context, userAddress, tokenAddress string, page, limit int) ([]*models.MemeTradeHistory, uint, error) { filters := map[string][]any{} preloads := map[string][]any{} joinFilters := map[string][]any{ `join memes on meme_trade_histories.meme_id = memes.id`: {}, } if userAddress != "" { filters["meme_trade_histories.user_address = ?"] = []any{strings.ToLower(userAddress)} preloads[`Meme`] = []any{} } if tokenAddress != "" { filters["meme_trade_histories.meme_token_address = ? or memes.agent_info_id = ?"] = []any{strings.ToLower(tokenAddress), tokenAddress} preloads[`RecipientUser`] = []any{} } selected := []string{ "meme_trade_histories.*", } keys, err := s.dao.FindMemeHistoryJoinSelect(daos.GetDBMainCtx(ctx), selected, joinFilters, filters, preloads, []string{"meme_trade_histories.tx_at desc"}, page, limit, ) if err != nil { return nil, 0, errs.NewError(err) } return keys, 0, nil } func (s *Service) GetMemeTradeHistoryLatest(ctx context.Context, tokenAddress string) (string, error) { var resp string cacheKey := fmt.Sprintf(`CacheMemeTradeHistoryLatest_%s`, strings.ToLower(tokenAddress)) err := s.GetRedisCachedWithKey(cacheKey, &resp) if err != nil { s.CacheMemeTradeHistoryLatest(daos.GetDBMainCtx(ctx), tokenAddress) s.GetRedisCachedWithKey(cacheKey, &resp) } return resp, nil } func (s *Service) CacheMemeTradeHistoryLatest(tx *gorm.DB, tokenAddress string) error { filters := map[string][]any{} preloads := map[string][]any{} if tokenAddress != "" { filters["meme_token_address = ?"] = []any{strings.ToLower(tokenAddress)} preloads[`RecipientUser`] = []any{} } joinFilters := map[string][]any{} selected := []string{ "meme_trade_histories.*", } keys, err := s.dao.FindMemeHistoryJoinSelect(tx, selected, joinFilters, filters, preloads, []string{"tx_at desc"}, 1, 20, ) if err != nil { errs.NewError(err) } cacheData, err := json.Marshal(&serializers.Resp{Result: serializers.NewTradeHistoryRespArry(keys)}) if err != nil { errs.NewError(err) } err = s.SetRedisCachedWithKey( fmt.Sprintf(`CacheMemeTradeHistoryLatest_%s`, strings.ToLower(tokenAddress)), string(cacheData), 1*time.Hour, ) if err != nil { return errs.NewError(err) } return nil } func (s *Service) GetTokenHolders(ctx context.Context, tokenAddress string) (string, error) { var resp string cacheKey := fmt.Sprintf(`CacheMemeHolders1_%s`, strings.ToLower(tokenAddress)) err := s.GetRedisCachedWithKey(cacheKey, &resp) if err != nil { s.CacheMemeHolders(daos.GetDBMainCtx(ctx), tokenAddress) s.GetRedisCachedWithKey(cacheKey, &resp) } return resp, nil } func (s *Service) CacheMemeHolders(tx *gorm.DB, tokenAddress string) error { filters := map[string][]any{ `cast(erc20_holders.balance as decimal(36, 18)) > 0.0000000001`: {}, } joinFilters := map[string][]any{ `join agent_infos on agent_infos.token_address = erc20_holders.contract_address and agent_infos.token_address is not null and agent_infos.token_address != ""`: {}, } if tokenAddress != "" { filters["erc20_holders.contract_address = ? or agent_infos.id=?"] = []any{strings.ToLower(tokenAddress), tokenAddress} filters["erc20_holders.address != ?"] = []any{strings.ToLower("0x92a57bb5d9d61214cf4b7a85d3f74fef10e1ff37")} } selected := []string{ "erc20_holders.*", "cast(erc20_holders.balance as decimal(36, 18)) total_balance", } keys, err := s.dao.FindErc20HolderJoinSelect(tx, selected, joinFilters, filters, map[string][]any{}, []string{"total_balance desc"}, 1, 1000, ) if err != nil { return errs.NewError(err) } cacheData, err := json.Marshal(&serializers.Resp{Result: serializers.NewTokenHolderRespArray(keys)}) if err != nil { errs.NewError(err) } err = s.SetRedisCachedWithKey( fmt.Sprintf(`CacheMemeHolders1_%s`, strings.ToLower(tokenAddress)), string(cacheData), 1*time.Hour, ) if err != nil { return errs.NewError(err) } return nil } func (s *Service) GetTokenHolding(ctx context.Context, userAddress string, page, limit int) ([]*models.Erc20Holder, uint, error) { filters := map[string][]any{ `cast(balance as decimal(36, 18)) > 0.00000001`: {}, } if userAddress != "" { filters["erc20_holders.address = ?"] = []any{strings.ToLower(userAddress)} } joinFilters := map[string][]any{ ` join memes on erc20_holders.contract_address = memes.token_address `: {}, } selected := []string{ "cast(erc20_holders.balance as decimal(36, 18)) total_balance", "cast(erc20_holders.balance as decimal(36, 18)) balance", "erc20_holders.contract_address", "erc20_holders.address", `memes.name meme_name, memes.ticker meme_ticker, memes.image meme_image, memes.price meme_price, memes.price_usd meme_price_usd, memes.base_token_symbol meme_base_token_symbol`, "memes.owner_address address, memes.token_address", } keys, err := s.dao.FindErc20HolderJoinSelect(daos.GetDBMainCtx(ctx), selected, joinFilters, filters, map[string][]any{}, []string{"total_balance desc"}, page, limit, ) if err != nil { return nil, 0, errs.NewError(err) } return keys, 0, nil } // /////Users func (s *Service) GetMemeUserProfile(ctx context.Context, networkID uint64, address string) (*models.User, error) { user, err := s.GeUserByAddress(ctx, networkID, address) if err != nil { return nil, errs.NewError(err) } if user == nil { return nil, errs.NewError(errs.ErrUserNotFound) } filters := map[string][]any{ "address = ?": {user.Address}, "network_id = ?": {networkID}, } joinFilters := map[string][]any{ ` left join ( select ifnull(count(*), 0) total_noti, ifnull(sum(case when seen = 1 then 1 end), 0) total_seen from users u left join meme_notifications on u.id= meme_notifications.user_id or meme_notifications.user_id = 0 where u.address = ? ) all_noti on 1=1 left join ( select count(*) total_seen from users u join meme_notification_seens on u.id= meme_notification_seens.user_id where u.address = ? ) seen on 1=1 `: {user.Address, user.Address}, } selected := []string{ "users.*", "all_noti.total_noti, (seen.total_seen + all_noti.total_seen) total_seen", "all_noti.total_noti - (seen.total_seen + all_noti.total_seen) total_unseen", } keys, err := s.dao.FirstUserJoinSelect(daos.GetDBMainCtx(ctx), selected, joinFilters, filters, map[string][]any{}, false, ) if err != nil { return nil, errs.NewError(err) } return keys, nil } func (s *Service) GetListFollowers(ctx context.Context, userAddress string, page, limit int) ([]*models.MemeFollowers, uint, error) { filters := map[string][]any{} joinFilters := map[string][]any{ `join users on users.id=meme_followers.follow_user_id and users.address = ?`: {strings.ToLower(userAddress)}, } selected := []string{ "meme_followers.*", } keys, err := s.dao.FindMemeFollowersJoinSelect(daos.GetDBMainCtx(ctx), selected, joinFilters, filters, map[string][]any{ "User": []any{}, }, []string{"created_at desc"}, page, limit, ) if err != nil { return nil, 0, errs.NewError(err) } return keys, 0, nil } func (s *Service) GetMemeChartCandleData(ctx context.Context, tokenAddress string, day uint, chartType string) (string, error) { var resp string if chartType == "" { chartType = string(models.ChartTypeMin30) } meme, err := s.dao.FirstMeme(daos.GetDBMainCtx(ctx), map[string][]any{ "token_address = ?": {strings.ToLower(tokenAddress)}, }, map[string][]any{}, false, ) if err != nil { return resp, errs.NewError(err) } cacheKey := fmt.Sprintf(`MemeGetChartCandleData_%d_%s`, meme.ID, chartType) if meme != nil { err := s.GetRedisCachedWithKey(cacheKey, &resp) if err != nil { s.CacheMemeCandleDataChart(daos.GetDBMainCtx(ctx), meme.ID) } s.GetRedisCachedWithKey(cacheKey, &resp) } return resp, nil } func (s *Service) CacheMemeCandleDataChart(tx *gorm.DB, memeID uint) error { _, err := s.dao.UpdateChartCandleDataByPair(tx, memeID) if err != nil { return errs.NewError(err) } //chart 5min { chartData, err := s.dao.GetMemeChartCandleData5Min( tx, memeID, 90) if err != nil { return errs.NewError(err) } cacheData, err := json.Marshal(&serializers.Resp{Result: chartData}) if err != nil { errs.NewError(err) } err = s.SetRedisCachedWithKey( fmt.Sprintf(`MemeGetChartCandleData_%d_%s`, memeID, models.ChartTypeMin5), string(cacheData), 1*time.Hour, ) if err != nil { return errs.NewError(err) } } //chart 30min { chartData, err := s.dao.GetMemeChartCandleData30Min( tx, memeID, 90) if err != nil { return errs.NewError(err) } cacheData, err := json.Marshal(&serializers.Resp{Result: chartData}) if err != nil { errs.NewError(err) } err = s.SetRedisCachedWithKey( fmt.Sprintf(`MemeGetChartCandleData_%d_%s`, memeID, models.ChartTypeMin30), string(cacheData), 1*time.Hour, ) if err != nil { return errs.NewError(err) } } //chart 1hour { chartData, err := s.dao.GetMemeChartCandleData1Hour( tx, memeID, 90) if err != nil { return errs.NewError(err) } cacheData, err := json.Marshal(&serializers.Resp{Result: chartData}) if err != nil { errs.NewError(err) } err = s.SetRedisCachedWithKey( fmt.Sprintf(`MemeGetChartCandleData_%d_%s`, memeID, models.ChartTypeHour1), string(cacheData), 1*time.Hour, ) if err != nil { return errs.NewError(err) } } //chart 4hour { chartData, err := s.dao.GetMemeChartCandleData4Hour( tx, memeID, 90) if err != nil { return errs.NewError(err) } cacheData, err := json.Marshal(&serializers.Resp{Result: chartData}) if err != nil { errs.NewError(err) } err = s.SetRedisCachedWithKey( fmt.Sprintf(`MemeGetChartCandleData_%d_%s`, memeID, models.ChartTypeHour4), string(cacheData), 1*time.Hour, ) if err != nil { return errs.NewError(err) } } //chart 1day { chartData, err := s.dao.GetMemeChartCandleData1Day( tx, memeID, 90) if err != nil { return errs.NewError(err) } cacheData, err := json.Marshal(&serializers.Resp{Result: chartData}) if err != nil { errs.NewError(err) } err = s.SetRedisCachedWithKey( fmt.Sprintf(`MemeGetChartCandleData_%d_%s`, memeID, models.ChartTypeDay), string(cacheData), 1*time.Hour, ) if err != nil { return errs.NewError(err) } } return nil } func (s *Service) MemeSnapshotTokenHolder(ctx context.Context, tokenAddress string) error { filters := map[string][]any{ `cast(balance as decimal(36, 18)) > 0`: {}, } if tokenAddress != "" { filters["erc20_holders.contract_address = ?"] = []any{strings.ToLower(tokenAddress)} } joinFilters := map[string][]any{} selected := []string{ "erc20_holders.*", } keys, err := s.dao.FindTokenHolderJoinSelect(daos.GetDBMainCtx(ctx), selected, joinFilters, filters, map[string][]any{}, []string{}, 1, 10000, ) if err != nil { return errs.NewError(err) } for _, key := range keys { holder := &models.MemeTokenHolder{ ContractAddress: key.ContractAddress, Address: key.Address, Balance: numeric.NewBigFloatFromString(key.Balance), } err = s.dao.Create(daos.GetDBMainCtx(ctx), holder) if err != nil { return errs.NewError(err) } } return nil } func (s *Service) GetMemeWhiteListAddress(ctx context.Context) ([]string, error) { keys, err := s.dao.FindMemeWhiteListAddress(daos.GetDBMainCtx(ctx), map[string][]any{}, map[string][]any{}, []string{}, 0, 1000, ) if err != nil { return nil, errs.NewError(err) } resp := []string{} for _, item := range keys { resp = append(resp, item.Address) } return resp, nil } func (s *Service) GetMemeBurnHistory(ctx context.Context, networkID uint64, userAddress, tokenAddress string, page, limit int) ([]*models.TokenTransfer, uint, error) { burnAddress := s.conf.GetConfigKeyString(networkID, "meme_burn_address") filters := map[string][]any{ "token_transfers.to = ?": {strings.ToLower(burnAddress)}, } if userAddress != "" { filters["token_transfers.from = ?"] = []any{strings.ToLower(userAddress)} } joinFilters := map[string][]any{ ` join users on users.address = token_transfers.from join memes on memes.token_address = token_transfers.contract_address `: {}, } selected := []string{ ` token_transfers.*, users.twitter_name, users.twitter_username, users.twitter_avatar, users.user_twitter_id, users.user_name, users.image_url, users.user_twitter_id, memes.name, memes.ticker, memes.image, memes.token_address `, } keys, err := s.dao.FindMemeBurnJoinSelect(daos.GetDBMainCtx(ctx), selected, joinFilters, filters, map[string][]any{}, []string{"transaction_at desc"}, page, limit, ) if err != nil { return nil, 0, errs.NewError(err) } return keys, 0, nil } func (s *Service) ShareMeme(ctx context.Context, address, memAddress string) (bool, error) { err := daos.WithTransaction( daos.GetDBMainCtx(ctx), func(tx *gorm.DB) error { filters := map[string][]any{ "memes.token_address = ?": {strings.ToLower(memAddress)}, } meme, err := s.dao.FirstMeme(tx, filters, map[string][]any{}, false, ) if err != nil { return errs.NewError(err) } if meme != nil { err = daos.GetDBMainCtx(ctx). Model(meme). Updates( map[string]any{ "shared": gorm.Expr("shared + 1"), }, ).Error if err != nil { return errs.NewError(err) } } return nil }, ) if err != nil { return false, errs.NewError(err) } return true, nil } func (s *Service) VibeTokenGetDeployInfo(ctx context.Context, address string, agentID uint) (*serializers.VibeTokenDeployInfoResp, error) { agentInfo, err := s.dao.FirstAgentInfoByID(daos.GetDBMainCtx(ctx), agentID, map[string][]any{}, false) if err != nil { return nil, errs.NewError(err) } if !strings.EqualFold(address, agentInfo.Creator) { return nil, errs.NewError(errs.ErrBadRequest) } if !agentInfo.IsVibeAgent() { return nil, errs.NewError(errs.ErrBadRequest) } if agentInfo.TokenNetworkID == 0 { return nil, errs.NewError(errs.ErrBadRequest) } if agentInfo.TokenSymbol == "" { return nil, errs.NewError(errs.ErrBadRequest) } if agentInfo.TokenName == "" { return nil, errs.NewError(errs.ErrBadRequest) } vibeToken, err := s.dao.FirstMeme( daos.GetDBMainCtx(ctx), map[string][]any{ "agent_info_id = ?": {agentID}, }, map[string][]any{}, false, ) if err != nil { return nil, err } if vibeToken == nil { _, err = s.CreateMeme( ctx, agentInfo.Creator, agentInfo.TokenNetworkID, &serializers.MemeReq{ Name: agentInfo.TokenName, Ticker: agentInfo.TokenSymbol, Description: agentInfo.TokenDesc, Image: agentInfo.TokenImageUrl, Twitter: fmt.Sprintf("https://x.com/%s", agentInfo.TwitterUsername), AgentInfoID: agentInfo.ID, BaseTokenSymbol: string(models.BaseTokenSymbolEAI), }) if err != nil { return nil, errs.NewError(err) } } vibeToken, err = s.dao.FirstMeme( daos.GetDBMainCtx(ctx), map[string][]any{ "agent_info_id = ?": {agentID}, }, map[string][]any{}, false, ) if err != nil { return nil, err } if vibeToken == nil { return nil, errs.NewError(errs.ErrBadRequest) } if vibeToken.TokenAddress != "" { return nil, errs.NewError(errs.ErrBadRequest) } baseTokenPrice := s.GetTokenMarketPrice(daos.GetDBMainCtx(ctx), vibeToken.BaseTokenSymbol) lowerPrice, _ := models.QuoBigFloats( big.NewFloat(models.LOWER_PRICE_USD), big.NewFloat(models.TOKEN_SUPPLY), baseTokenPrice, ).Float64() upperPrice, _ := models.QuoBigFloats( big.NewFloat(models.UPPER_PRICE_USD), big.NewFloat(models.TOKEN_SUPPLY), baseTokenPrice, ).Float64() lowerTick := models.PriceToTick(lowerPrice, 1200) upperTick := models.PriceToTick(upperPrice, 1200) // calculate lower and upper tick base on EAI price deadline := time.Now().Add(time.Minute * 10).Unix() signature, err := s.GetEthereumClient(ctx, vibeToken.NetworkID).GetSignatureForDeployToken( s.GetAddressPrk(s.conf.GetConfigKeyString(uint64(vibeToken.NetworkID), "vibe_token_factory_admin")), helpers.HexToAddress(s.conf.GetConfigKeyString(uint64(vibeToken.NetworkID), "vibe_token_factory_address")), vibeToken.NetworkID, helpers.HexToBytes32(agentInfo.AgentID), vibeToken.Name, vibeToken.Ticker, helpers.HexToAddress(agentInfo.Creator), big.NewInt(int64(lowerTick)), big.NewInt(int64(upperTick)), big.NewInt(deadline), ) if err != nil { return nil, err } return &serializers.VibeTokenDeployInfoResp{ NonceHex: common.HexToHash(agentInfo.AgentID).Hex(), Name: vibeToken.Name, Symbol: vibeToken.Ticker, Creator: agentInfo.Creator, LowerTick: lowerTick, UpperTick: upperTick, Deadline: deadline, Signature: signature, }, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/token_liquidity_events.go ================================================ package services import ( "context" "fmt" "math/big" "strings" "time" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/daos" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/helpers" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/binds/agentshares" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/binds/vibetokenfactory" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/ethapi" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/types/numeric" "github.com/jinzhu/gorm" ) func (s *Service) GetMemeBaseToken(tx *gorm.DB, networkID uint64, baseSymbol string) string { var memeBaseTokenAddress string if s.conf.ExistsedConfigKey(networkID, "eai_contract_address") { switch baseSymbol { case string(models.BaseTokenSymbolETH): { memeBaseTokenAddress = strings.ToLower(s.conf.GetConfigKeyString(networkID, "weth9_contract_address")) } case string(models.BaseTokenSymbolEAI): { memeBaseTokenAddress = strings.ToLower(s.conf.GetConfigKeyString(networkID, "eai_contract_address")) } } } return memeBaseTokenAddress } func (s *Service) GetMemeBaseTokenByTokens01(tx *gorm.DB, networkID uint64, token0, token1 string) string { var memeBaseTokenAddress string if s.conf.ExistsedConfigKey(networkID, "eai_contract_address") { baseTokenETH := strings.ToLower(s.conf.GetConfigKeyString(networkID, "weth9_contract_address")) baseTokenEAI := strings.ToLower(s.conf.GetConfigKeyString(networkID, "eai_contract_address")) if strings.EqualFold(token0, strings.ToLower(baseTokenETH)) || strings.EqualFold(token1, strings.ToLower(baseTokenETH)) { memeBaseTokenAddress = strings.ToLower(baseTokenETH) } else if strings.EqualFold(token0, strings.ToLower(baseTokenEAI)) || strings.EqualFold(token1, strings.ToLower(baseTokenEAI)) { memeBaseTokenAddress = strings.ToLower(baseTokenEAI) } else { return "" } } return memeBaseTokenAddress } func (s *Service) CreateMemePool(ctx context.Context, networkID uint64, event *ethapi.UniswapPoolCreatedEventResp, syncInfo bool) error { tokenAddress := "" err := daos.WithTransaction( daos.GetDBMainCtx(ctx), func(tx *gorm.DB) error { if s.conf.ExistsedConfigKey(networkID, "memeswap_factory_contract_address") { swapFactoryAddr := s.conf.GetConfigKeyString(networkID, "memeswap_factory_contract_address") if strings.EqualFold(swapFactoryAddr, event.ContractAddress) { token, err := s.dao.FirstMeme(tx, map[string][]any{ "pool = ?": {strings.ToLower(event.Pool)}, }, map[string][]any{}, false, ) if err != nil { return errs.NewError(err) } if token == nil { memeBaseTokenAddress := s.GetMemeBaseTokenByTokens01(tx, networkID, event.Token0, event.Token1) if memeBaseTokenAddress == "" { return nil } baseIndex := int(1) tokenAddress = strings.ToLower(event.Token0) if strings.EqualFold(event.Token0, memeBaseTokenAddress) { tokenAddress = strings.ToLower(event.Token1) baseIndex = 0 } token, err = s.dao.FirstMeme(tx, map[string][]any{ "token_address = ?": []any{tokenAddress}, }, map[string][]any{}, false, ) if err != nil { return errs.NewError(err) } if token != nil { if token.AddPool1TxHash == "" { return errs.NewError(errs.ErrBadRequest) } token, err = s.dao.FirstMemeByID(tx, token.ID, map[string][]any{}, true) if err != nil { return errs.NewError(err) } if token.AddPool1TxHash == "" { return errs.NewError(errs.ErrBadRequest) } if strings.EqualFold(token.AddPool1TxHash, event.TxHash) { token.Status = models.MemeStatusAddPoolLevel1 token.Pool = strings.ToLower(event.Pool) token.Token0Address = strings.ToLower(event.Token0) token.Token1Address = strings.ToLower(event.Token1) token.BaseTokenIndex = baseIndex token.ZeroForOne = token.TokenAddress != strings.ToLower(event.Token0) if token.PriceUsd.Cmp(big.NewFloat(0)) == 0 { basePrice := s.GetTokenMarketPrice(tx, token.BaseTokenSymbol) token.PriceUsd = numeric.BigFloat{*models.MulBigFloats(&token.Price.Float, basePrice)} } err = s.dao.Save(tx, token) if err != nil { return errs.NewError(err) } } } } } } if s.conf.ExistsedConfigKey(networkID, "uniswap_factory_contract_address") { swapFactoryAddr := s.conf.GetConfigKeyString(networkID, "uniswap_factory_contract_address") if strings.EqualFold(swapFactoryAddr, event.ContractAddress) { token, err := s.dao.FirstMeme(tx, map[string][]any{ "uniswap_pool = ?": []any{strings.ToLower(event.Pool)}, }, map[string][]any{}, false, ) if err != nil { return errs.NewError(err) } if token == nil || token.Status == models.MemeStatusCreated || token.Status == models.MemeStatusRemovePoolLelve1 { memeBaseTokenAddress := s.GetMemeBaseTokenByTokens01(tx, networkID, event.Token0, event.Token1) if memeBaseTokenAddress == "" { return nil } baseIndex := int(1) tokenAddress = strings.ToLower(event.Token0) if strings.EqualFold(event.Token0, memeBaseTokenAddress) { tokenAddress = strings.ToLower(event.Token1) baseIndex = 0 } token, err = s.dao.FirstMeme(tx, map[string][]any{ "token_address = ?": []any{tokenAddress}, }, map[string][]any{}, false, ) if err != nil { return errs.NewError(err) } if token != nil { if token.AddPool2TxHash == "" { token.AddPool2TxHash = event.TxHash } token, err = s.dao.FirstMemeByID(tx, token.ID, map[string][]any{}, true) if err != nil { return errs.NewError(err) } if strings.EqualFold(token.AddPool2TxHash, event.TxHash) { token.Status = models.MemeStatusAddPoolLevel2 token.UniswapPool = strings.ToLower(event.Pool) token.Token0Address = strings.ToLower(event.Token0) token.Token1Address = strings.ToLower(event.Token1) token.BaseTokenIndex = baseIndex token.ZeroForOne = token.TokenAddress != strings.ToLower(event.Token0) if token.PriceUsd.Cmp(big.NewFloat(0)) == 0 { basePrice := s.GetTokenMarketPrice(tx, token.BaseTokenSymbol) token.PriceUsd = numeric.BigFloat{*models.MulBigFloats(&token.Price.Float, basePrice)} } err = s.dao.Save(tx, token) if err != nil { return errs.NewError(err) } } } } } } return nil }, ) if err != nil { return errs.NewError(err) } if tokenAddress != "" { s.DeleteFilterAddrs(ctx, networkID) } return nil } func (s *Service) CreateMemeTradeHistory(ctx context.Context, event *ethapi.UniswapSwapEventResp) error { memeID := uint(0) err := daos.WithTransaction( daos.GetDBMainCtx(ctx), func(tx *gorm.DB) error { meme, err := s.dao.FirstMeme(tx, map[string][]any{ "pool = ? or uniswap_pool = ?": {strings.ToLower(event.ContractAddress), strings.ToLower(event.ContractAddress)}, }, map[string][]any{}, false) if err != nil { return errs.NewError(err) } if meme != nil { eventHash := fmt.Sprintf("%s_%d", event.TxHash, event.Index) var err error history, err := s.dao.FirstMemeHistory( tx, map[string][]any{ "event_id = ?": {eventHash}, }, map[string][]any{}, []string{}, ) if err != nil { return errs.NewError(err) } if history == nil { eventTime, err := s.GetEthereumClient(ctx, meme.NetworkID).GetBlockTime(event.BlockNumber) if err != nil { return errs.NewError(err) } history = &models.MemeTradeHistory{} history.EventId = eventHash history.NetworkID = meme.NetworkID history.ContractAddress = strings.ToLower(event.ContractAddress) history.TxHash = strings.ToLower(event.TxHash) history.TxAt = time.Unix(int64(eventTime), 0) history.Amount0 = numeric.BigFloat{*models.ConvertWeiToBigFloatNegative(event.Amount0, 18)} history.Amount1 = numeric.BigFloat{*models.ConvertWeiToBigFloatNegative(event.Amount1, 18)} history.SqrtPriceX96 = event.SqrtPriceX96.String() history.Liquidity = numeric.BigFloat{*models.ConvertWeiToBigFloat(event.Liquidity, 18)} history.Tick = event.Tick.Int64() history.MemeTokenAddress = meme.TokenAddress history.MemeID = meme.ID history.AmountIn = numeric.BigFloat{*models.AbsBigFloat(&history.Amount1.Float)} history.TokenInAddress = meme.Token1Address history.AmountOut = numeric.BigFloat{*models.AbsBigFloat(&history.Amount0.Float)} history.TokenOutAddress = meme.Token0Address history.Tick = event.Tick.Int64() if history.Amount0.Cmp(big.NewFloat(0)) > 0 { history.AmountIn = numeric.BigFloat{*models.AbsBigFloat(&history.Amount0.Float)} history.TokenInAddress = meme.Token0Address history.AmountOut = numeric.BigFloat{*models.AbsBigFloat(&history.Amount1.Float)} history.TokenOutAddress = meme.Token1Address } fromAddress, err := s.GetEthereumClient(ctx, meme.NetworkID).GetFromFromHash(event.TxHash) if err != nil { return errs.NewError(err) } recipient, err := s.GetUser(tx, meme.NetworkID, fromAddress, false) if err != nil { return errs.NewError(err) } history.RecipientAddress = recipient.Address history.RecipientUserID = recipient.ID if meme.BaseTokenIndex == 0 { history.BaseAmount = numeric.BigFloat{*models.AbsBigFloat(&history.Amount0.Float)} history.TokenAmount = numeric.BigFloat{*models.AbsBigFloat(&history.Amount1.Float)} if history.Amount0.Cmp(big.NewFloat(0)) > 0 { history.IsBuy = true } } else { history.BaseAmount = numeric.BigFloat{*models.AbsBigFloat(&history.Amount1.Float)} history.TokenAmount = numeric.BigFloat{*models.AbsBigFloat(&history.Amount0.Float)} if history.Amount1.Cmp(big.NewFloat(0)) > 0 { history.IsBuy = true } } history.BaseTokenSymbol = meme.BaseTokenSymbol history.Price = numeric.BigFloat{*models.ConvertSqrtPriceX96ToPriceEx(event.SqrtPriceX96, 18, meme.ZeroForOne)} basePrice := s.GetTokenMarketPrice(tx, history.BaseTokenSymbol) history.BaseTokenPrice = numeric.BigFloat{*basePrice} err = s.dao.Create(tx, history) if err != nil { return errs.NewError(err) } err = tx. Model(meme). Updates( map[string]any{ "req_sync_at": time.Now(), }, ).Error if err != nil { return errs.NewError(err) } memeID = meme.ID } poolSwappedUpdated := helpers.GetTimeIndex(uint(event.BlockNumber), event.TxIndex, event.Index) if meme.PoolSwappedUpdated < poolSwappedUpdated { err = tx. Model(meme). Updates( map[string]any{ "pool_swapped_updated": poolSwappedUpdated, }, ).Error if err != nil { return errs.NewError(err) } } } return nil }, ) if err != nil { return errs.NewError(err) } if memeID > 0 { go func() { s.UpdateMemeInfo(context.Background(), memeID) }() } return nil } func (s *Service) CreateMemeShareTradeHistory(ctx context.Context, networkID uint64, event *agentshares.AgentSharesTrade) error { memeID := uint(0) err := daos.WithTransaction( daos.GetDBMainCtx(ctx), func(tx *gorm.DB) error { swapFactoryAddr := s.conf.GetConfigKeyString(networkID, "agentshares_contract_address") if strings.EqualFold(swapFactoryAddr, event.Raw.Address.Hex()) { meme, err := s.dao.FirstMeme(tx, map[string][]any{ "token_id = ?": {event.TokenId.String()}, }, map[string][]any{}, false) if err != nil { return errs.NewError(err) } if meme != nil { eventHash := fmt.Sprintf("%s_%d", event.Raw.TxHash.Hex(), event.Raw.Index) var err error history, err := s.dao.FirstMemeHistory( tx, map[string][]any{ "event_id = ?": {eventHash}, }, map[string][]any{}, []string{}, ) if err != nil { return errs.NewError(err) } if history == nil { eventTime, err := s.GetEthereumClient(ctx, meme.NetworkID).GetBlockTime(event.Raw.BlockNumber) if err != nil { return errs.NewError(err) } memeBaseTokenAddress := strings.ToLower(s.conf.GetConfigKeyString(networkID, "eai_contract_address")) history = &models.MemeTradeHistory{} history.EventId = eventHash history.NetworkID = meme.NetworkID history.ContractAddress = strings.ToLower(event.Raw.Address.Hex()) history.TxHash = strings.ToLower(event.Raw.TxHash.Hex()) history.TxAt = time.Unix(int64(eventTime), 0) history.TokenId = meme.TokenId history.MemeID = meme.ID history.Amount0 = numeric.BigFloat{*models.ConvertWeiToBigFloatNegative(event.ShareAmount, 1)} history.Amount1 = numeric.BigFloat{*models.ConvertWeiToBigFloatNegative(event.EthAmount, 18)} history.AmountIn = numeric.BigFloat{*models.AbsBigFloat(&history.Amount1.Float)} history.Liquidity = numeric.BigFloat{*models.ConvertWeiToBigFloatNegative(event.Supply, 1)} history.TokenInAddress = memeBaseTokenAddress history.AmountOut = numeric.BigFloat{*models.AbsBigFloat(&history.Amount0.Float)} history.TokenOutAddress = meme.TokenId history.BaseAmount = numeric.BigFloat{*models.AbsBigFloat(&history.Amount1.Float)} history.TokenAmount = numeric.BigFloat{*models.AbsBigFloat(&history.Amount0.Float)} history.IsBuy = true if !event.IsBuy { history.AmountIn = numeric.BigFloat{*models.AbsBigFloat(&history.Amount0.Float)} history.TokenInAddress = meme.TokenId history.AmountOut = numeric.BigFloat{*models.AbsBigFloat(&history.Amount1.Float)} history.TokenOutAddress = memeBaseTokenAddress history.BaseAmount = numeric.BigFloat{*models.AbsBigFloat(&history.Amount0.Float)} history.TokenAmount = numeric.BigFloat{*models.AbsBigFloat(&history.Amount1.Float)} history.IsBuy = false } recipient, err := s.GetUser(tx, meme.NetworkID, event.Trader.Hex(), false) if err != nil { return errs.NewError(err) } history.RecipientAddress = recipient.Address history.RecipientUserID = recipient.ID history.BaseTokenSymbol = meme.BaseTokenSymbol supply, _ := history.Liquidity.Float64() history.Price = numeric.NewBigFloatFromFloat(big.NewFloat((supply + 1) * supply / 1000)) basePrice := s.GetTokenMarketPrice(tx, history.BaseTokenSymbol) history.BaseTokenPrice = numeric.BigFloat{*basePrice} err = s.dao.Create(tx, history) if err != nil { return errs.NewError(err) } err = tx. Model(meme). Updates( map[string]any{ "req_sync_at": time.Now(), }, ).Error if err != nil { return errs.NewError(err) } memeID = meme.ID } } } return nil }, ) if err != nil { return errs.NewError(err) } if memeID > 0 { go func() { s.UpdateMemeInfo(context.Background(), memeID) }() } return nil } func (s *Service) UpdateMemeInfo(ctx context.Context, memeID uint) error { err := s.JobRunCheck( ctx, fmt.Sprintf("UpdateMemeInfo_%d", memeID), func() error { meme, err := s.dao.FirstMemeByID(daos.GetDBMainCtx(ctx), memeID, map[string][]any{}, false) if err != nil { return errs.NewError(err) } if meme.PositionID > 0 { tmpResp, err := s.dao.GetMemeTradeHistoryInfo(daos.GetDBMainCtx(ctx), memeID) if err != nil { return errs.NewError(err) } if tmpResp != nil { updateFields := map[string]any{ "volume_last24h": tmpResp.VolumeLast24h, "total_volume": tmpResp.TotalVolume, "price": tmpResp.Price, "tick": tmpResp.Tick, } if tmpResp.PriceLast24h.Cmp(big.NewFloat(0)) > 0 { updateFields["price_last24h"] = tmpResp.PriceLast24h } baseTokenPrice := s.GetTokenMarketPrice(daos.GetDBMainCtx(ctx), meme.BaseTokenSymbol) updateFields["price_usd"] = numeric.BigFloat{*models.MulBigFloats(&tmpResp.Price.Float, baseTokenPrice)} err = daos.GetDBMainCtx(ctx). Model(meme). Updates( updateFields, ).Error if err != nil { return errs.NewError(err) } s.CacheMemeCandleDataChart(daos.GetDBMainCtx(ctx), memeID) s.CacheMemeTradeHistoryLatest(daos.GetDBMainCtx(ctx), meme.TokenAddress) s.CacheMemeHolders(daos.GetDBMainCtx(ctx), meme.TokenAddress) s.CacheMemeDetail(daos.GetDBMainCtx(ctx), meme.TokenAddress) err = daos.GetDBMainCtx(ctx). Model(meme). Updates( map[string]any{ "sync_at": time.Now(), }, ).Error if err != nil { return errs.NewError(err) } } } return nil }, ) if err != nil { return errs.NewError(err) } return nil } func (s *Service) UpdateMemeLiquidityPosition(ctx context.Context, networkID uint64, event *ethapi.UniswapPositionLiquidity) error { err := daos.WithTransaction( daos.GetDBMainCtx(ctx), func(tx *gorm.DB) error { if s.conf.ExistsedConfigKey(networkID, "memeswap_position_mamanger_address") { memeSwapPositionMamangerAddress := s.conf.GetConfigKeyString(networkID, "memeswap_position_mamanger_address") if strings.EqualFold(memeSwapPositionMamangerAddress, event.ContractAddress) { positionInfo, _ := s.GetEthereumClient(ctx, networkID).MemeNonfungiblePositionManagerPositionInfo( memeSwapPositionMamangerAddress, big.NewInt(event.TokenId.Int64()), ) if positionInfo != nil { meme, err := s.dao.FirstMeme(tx, map[string][]any{ "token_address in (?)": {[]string{strings.ToLower(positionInfo.Token0), strings.ToLower(positionInfo.Token1)}}, "position_id = 0": {}, }, map[string][]any{}, false, ) if meme != nil && meme.PositionID <= 0 { if meme.AddPool1TxHash == "" || strings.EqualFold(event.TxHash, meme.AddPool1TxHash) { meme, err = s.dao.FirstMemeByID(tx, meme.ID, map[string][]any{}, true) if err != nil { return errs.NewError(err) } if meme.PositionID <= 0 { meme.Liquidity = numeric.NewBigFloatFromFloat(models.ConvertWeiToBigFloat(event.Liquidity, 18)) meme.PositionID = event.TokenId.Int64() err = s.dao.Save(tx, meme) if err != nil { return errs.NewError(err) } } } if err != nil { return errs.NewError(err) } } } } } if s.conf.ExistsedConfigKey(networkID, "uniswap_position_mamanger_address") { uniswapSwapPositionMamangerAddress := s.conf.GetConfigKeyString(networkID, "uniswap_position_mamanger_address") if strings.EqualFold(uniswapSwapPositionMamangerAddress, event.ContractAddress) { var positionInfo *ethapi.UniV3SwapPositionInfo switch networkID { case models.ARBITRUM_CHAIN_ID, models.APE_CHAIN_ID: { positionInfo, _ = s.GetEthereumClient(ctx, networkID).CamelotNonfungiblePositionManagerPositionInfo( uniswapSwapPositionMamangerAddress, big.NewInt(event.TokenId.Int64()), ) } default: { positionInfo, _ = s.GetEthereumClient(ctx, networkID).MemeNonfungiblePositionManagerPositionInfo( uniswapSwapPositionMamangerAddress, big.NewInt(event.TokenId.Int64()), ) } } if positionInfo != nil { meme, err := s.dao.FirstMeme(tx, map[string][]any{ "token_address in (?)": {[]string{strings.ToLower(positionInfo.Token0), strings.ToLower(positionInfo.Token1)}}, "uniswap_position_id = 0": {}, }, map[string][]any{}, false, ) if meme != nil && meme.UniswapPositionID <= 0 { if meme.AddPool2TxHash == "" || strings.EqualFold(event.TxHash, meme.AddPool2TxHash) { meme, err = s.dao.FirstMemeByID(tx, meme.ID, map[string][]any{}, true) if err != nil { return errs.NewError(err) } if meme.UniswapPositionID <= 0 { meme.Liquidity = numeric.NewBigFloatFromFloat(models.ConvertWeiToBigFloat(event.Liquidity, 18)) meme.UniswapPositionID = event.TokenId.Int64() err = s.dao.Save(tx, meme) if err != nil { return errs.NewError(err) } } } } if err != nil { return errs.NewError(err) } } } } return nil }, ) if err != nil { return errs.NewError(err) } return nil } func (s *Service) GeUserByAddress(ctx context.Context, networkID uint64, address string) (*models.User, error) { var err error user := &models.User{} if strings.HasPrefix(address, "0x") { user, err = s.GetUser(daos.GetDBMainCtx(ctx), networkID, address, false) } else { user, err = s.dao.FirstUser(daos.GetDBMainCtx(ctx), map[string][]any{ "address = ?": {strings.ToLower(address)}, "network_id = ?": {networkID}, }, map[string][]any{}, false, ) } return user, err } func (s *Service) VibeTokenFactoryTokenDeployedEvent(ctx context.Context, networkID uint64, event *vibetokenfactory.VibeTokenFactoryTokenDeployed) error { if !s.conf.ExistsedConfigKey(networkID, "vibe_token_factory_address") { return nil } vibeTokenFactoryAddress := strings.ToLower(s.conf.GetConfigKeyString(networkID, "vibe_token_factory_address")) if strings.EqualFold(vibeTokenFactoryAddress, event.Raw.Address.Hex()) { agentID := big.NewInt(0).SetBytes(event.Nonce[:]).Text(16) agentInfo, err := s.dao.FirstAgentInfo( daos.GetDBMainCtx(ctx), map[string][]any{ "agent_id = ?": {agentID}, }, map[string][]any{}, []string{}, ) if err != nil { return errs.NewError(err) } if agentInfo != nil { if agentInfo.IsVibeAgent() { meme, err := s.dao.FirstMeme( daos.GetDBMainCtx(ctx), map[string][]any{ "agent_info_id = ?": {agentInfo.ID}, }, map[string][]any{}, false, ) if err != nil { return errs.NewError(err) } if meme != nil { err = daos.GetDBMainCtx(ctx). Model(meme). Updates( map[string]any{ "token_address": strings.ToLower(event.Token.Hex()), "add_pool2_tx_hash": event.Raw.TxHash.Hex(), "factory_address": strings.ToLower(event.Raw.Address.Hex()), }, ).Error if err != nil { return errs.NewError(err) } } } } } return nil } func (s *Service) VibeTokenFactoryFeesCollectedEvent(ctx context.Context, networkID uint64, event *vibetokenfactory.VibeTokenFactoryFeesCollected) error { if !s.conf.ExistsedConfigKey(networkID, "vibe_token_factory_address") { return nil } vibeTokenFactoryAddress := strings.ToLower(s.conf.GetConfigKeyString(networkID, "vibe_token_factory_address")) if strings.EqualFold(vibeTokenFactoryAddress, event.Raw.Address.Hex()) { err := daos.WithTransaction( daos.GetDBMainCtx(ctx), func(tx *gorm.DB) error { meme, err := s.dao.FirstMeme( tx, map[string][]any{ "token_address = ?": {strings.ToLower(event.Token.Hex())}, }, map[string][]any{}, false, ) if err != nil { return errs.NewError(err) } if meme != nil { eventId := fmt.Sprintf("%s_%d", event.Raw.TxHash.Hex(), event.Raw.Index) memeFeesCollected, err := s.dao.FirstMemeFeesCollected( tx, map[string][]any{ "event_id = ?": {eventId}, }, map[string][]any{}, []string{}, ) if err != nil { return errs.NewError(err) } if memeFeesCollected == nil { memeFeesCollected = &models.MemeFeesCollected{ EventId: eventId, MemeID: meme.ID, TxHash: event.Raw.TxHash.Hex(), Amount0: numeric.NewBigFloatFromFloat(models.ConvertWeiToBigFloat(event.Amount0, 18)), Amount1: numeric.NewBigFloatFromFloat(models.ConvertWeiToBigFloat(event.Amount1, 18)), } err = s.dao.Create( tx, memeFeesCollected, ) if err != nil { return errs.NewError(err) } err = tx. Model(meme). Updates( map[string]any{ "fees0_collected_balance": gorm.Expr("fees0_collected_balance + ?", memeFeesCollected.Amount0), "fees1_collected_balance": gorm.Expr("fees1_collected_balance + ?", memeFeesCollected.Amount1), }, ).Error if err != nil { return errs.NewError(err) } } feesCollectedUpdated := helpers.GetTimeIndex(uint(event.Raw.BlockNumber), event.Raw.TxIndex, event.Raw.Index) if meme.FeesCollectedUpdated < feesCollectedUpdated { err = tx. Model(meme). Where("fees_collected_updated < ?", feesCollectedUpdated). Updates( map[string]any{ "fees_collected_updated": feesCollectedUpdated, }, ).Error if err != nil { return errs.NewError(err) } } } return nil }, ) if err != nil { return errs.NewError(err) } } return nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/token_liquidity_job.go ================================================ package services import ( "context" "fmt" "math/big" "strings" "time" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/daos" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/helpers" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/binds/apechainnonfungiblepositionmanager" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/binds/arbitrumnonfungiblepositionmanager" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/binds/avaxnonfungiblepositionmanager" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/binds/basenonfungiblepositionmanager" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/binds/bscnonfungiblepositionmanager" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/binds/celononfungiblepositionmanager" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/binds/memenonfungiblepositionmanager" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/binds/polygonnonfungiblepositionmanager" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/binds/zksyncnonfungiblepositionmanager" blockchainutils "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/blockchain_utils" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/types/numeric" "github.com/jinzhu/gorm" ) func (s *Service) JobAgentDeployToken(ctx context.Context) error { err := s.JobRunCheck( ctx, "JobAgentDeployToken", func() error { memes, err := s.dao.FindMemeJoin( daos.GetDBMainCtx(ctx), map[string][]any{ "join agent_infos on memes.agent_info_id = agent_infos.id": {}, }, map[string][]any{ "memes.status = ?": {models.MemeStatusNew}, "memes.fee = 0 or agent_infos.eai_balance >= memes.fee or agent_infos.ref_tweet_id > 0": {}, "memes.num_retries < 3": {}, "agent_infos.agent_type in (?)": { []models.AgentInfoAgentType{ models.AgentInfoAgentTypeNormal, models.AgentInfoAgentTypeReasoning, models.AgentInfoAgentTypeKnowledgeBase, models.AgentInfoAgentTypeEliza, models.AgentInfoAgentTypeZerepy, }, }, }, map[string][]any{}, []string{ "rand()", }, 0, 5, ) if err != nil { return errs.NewError(err) } var retErr error for _, meme := range memes { err = s.AgentDeployToken(ctx, meme.ID) if err != nil { _ = daos.GetDBMainCtx(ctx). Model(&meme). Updates( map[string]any{ "num_retries": gorm.Expr("num_retries + ?", 1), "updated_at": time.Now(), "err": err.Error(), }, ).Error retErr = errs.MergeError(retErr, errs.NewErrorWithId(err, meme.ID)) } else { _ = daos.GetDBMainCtx(ctx). Model(&meme). Updates( map[string]any{ "num_retries": 0, "updated_at": time.Now(), }, ).Error s.DeleteFilterAddrs(ctx, meme.NetworkID) } time.Sleep(10 * time.Second) } return retErr }, ) if err != nil { return errs.NewError(err) } return nil } func (s *Service) AgentDeployToken(ctx context.Context, memeID uint) error { err := s.JobRunCheck( ctx, fmt.Sprintf("AgentDeployToken_%d", memeID), func() error { m, err := s.dao.FirstMemeByID( daos.GetDBMainCtx(ctx), memeID, map[string][]any{ "AgentInfo": {}, }, false, ) if err != nil { return errs.NewError(err) } if m == nil { return errs.NewError(errs.ErrBadRequest) } if m.AgentInfo.IsVibeAgent() { return errs.NewError(errs.ErrBadRequest) } if m.TokenAddress == "" { switch m.NetworkID { case models.BASE_CHAIN_ID, models.ARBITRUM_CHAIN_ID, models.BSC_CHAIN_ID, models.APE_CHAIN_ID, models.AVALANCHE_C_CHAIN_ID, models.SOLANA_CHAIN_ID, models.CELO_CHAIN_ID: { if m.AgentInfoID > 0 && m.Fee.Float.Cmp(big.NewFloat(0)) > 0 { agent, err := s.dao.FirstAgentInfoByID( daos.GetDBMainCtx(ctx), m.AgentInfoID, map[string][]any{}, false, ) if err != nil { return errs.NewError(err) } if agent.RefTweetID > 0 || m.NetworkID == models.BITTENSOR_CHAIN_ID { m.Fee = numeric.NewBigFloatFromString("0") err = daos.GetDBMainCtx(ctx).Model(&m). Updates( map[string]any{ "fee": m.Fee, }, ).Error if err != nil { return errs.NewError(err) } } if agent.EaiBalance.Float.Cmp(&m.Fee.Float) < 0 { return errs.NewError(errs.ErrBadRequest) } } } default: { return errs.NewError(errs.ErrBadRequest) } } switch m.NetworkID { case models.BASE_CHAIN_ID, models.ARBITRUM_CHAIN_ID, models.BSC_CHAIN_ID, models.APE_CHAIN_ID, models.AVALANCHE_C_CHAIN_ID, models.SOLANA_CHAIN_ID, models.CELO_CHAIN_ID: { tokenSupply := &m.TotalSuply.Float if tokenSupply.Cmp(big.NewFloat(1)) <= 0 { return errs.NewError(errs.ErrBadRequest) } var tokenAddress string status := models.MemeStatusCreated switch m.NetworkID { case models.BASE_CHAIN_ID, models.ARBITRUM_CHAIN_ID, models.BSC_CHAIN_ID, models.APE_CHAIN_ID, models.AVALANCHE_C_CHAIN_ID, models.CELO_CHAIN_ID: { memePoolAddress := strings.ToLower(s.conf.GetConfigKeyString(m.NetworkID, "meme_pool_address")) tokenAddress, _, err = s.GetEthereumClient(ctx, m.NetworkID). DeployAGENTToken( s.GetAddressPrk(memePoolAddress), m.Name, m.Ticker, models.ConvertBigFloatToWei(tokenSupply, 18), memePoolAddress, ) if err != nil { return errs.NewError(err) } status = models.MemeStatusCreated } case models.SOLANA_CHAIN_ID: { agentTokenAdminAddress := s.conf.GetConfigKeyString(models.GENERTAL_NETWORK_ID, "agent_token_admin_address") base64Str, err := helpers.CurlBase64String(models.GetImageUrl(m.Image)) if err != nil { return errs.NewError(err) } pumfunResp, err := s.blockchainUtils.SolanaCreatePumpfunToken( &blockchainutils.SolanaCreatePumpfunTokenReq{ Address: agentTokenAdminAddress, Name: m.Name, Symbol: m.Ticker, Description: m.Description, Telegram: "", Website: "", Amount: 0, ImageBase64: base64Str, }, ) if err != nil { return errs.NewError(err) } tokenAddress = pumfunResp.Mint status = models.MemeStatusAddPoolLevel2 } } // check token address exist in db { memeCheck, err := s.dao.FirstMeme( daos.GetDBMainCtx(ctx), map[string][]any{ "token_address = ?": {strings.ToLower(tokenAddress)}, }, map[string][]any{}, false, ) if err != nil { return errs.NewError(err) } if memeCheck != nil { return errs.NewError(errs.ErrBadRequest) } } err = daos.GetDBMainCtx(ctx).Model(&m). Updates( map[string]any{ "token_address": strings.ToLower(tokenAddress), "total_suply": numeric.NewBigFloatFromFloat(tokenSupply), "status": status, "num_retries": 0, }, ).Error if err != nil { return errs.NewError(err) } if m.AgentInfoID > 0 { err = daos.GetDBMainCtx(ctx). Model(m.AgentInfo). Updates( map[string]any{ "token_address": strings.ToLower(tokenAddress), "eai_balance": gorm.Expr("eai_balance - ?", m.Fee), }, ).Error if err != nil { return errs.NewError(err) } if m.Fee.Cmp(big.NewFloat(0)) > 0 { _ = s.dao.Create( daos.GetDBMainCtx(ctx), &models.AgentEaiTopup{ NetworkID: m.AgentInfo.NetworkID, EventId: fmt.Sprintf("agent_token_fee_%d", m.ID), AgentInfoID: m.AgentInfoID, Type: models.AgentEaiTopupTypeSpent, Amount: m.Fee, Status: models.AgentEaiTopupStatusDone, DepositAddress: m.AgentInfo.ETHAddress, ToAddress: m.AgentInfo.ETHAddress, Toolset: "token_fee", }, ) } // _ = s.ReplyAferAutoCreateAgent(daos.GetDBMainCtx(ctx), m.AgentInfo.RefTweetID, m.AgentInfo.ID) } } } } return nil }, ) if err != nil { return errs.NewError(err) } return nil } func (s *Service) JobRetryAgentDeployToken(ctx context.Context) error { err := s.JobRunCheck( ctx, "JobRetryAgentDeployToken", func() error { memes, err := s.dao.FindMeme( daos.GetDBMainCtx(ctx), map[string][]any{ "updated_at <= ?": {time.Now().Add(-120 * time.Minute)}, "status = ?": {models.MemeStatusCreated}, "add_pool1_tx_hash = ?": {""}, "num_retries < 6": {}, "network_id in (?)": { []uint64{ models.BASE_CHAIN_ID, models.ARBITRUM_CHAIN_ID, models.BSC_CHAIN_ID, models.APE_CHAIN_ID, models.AVALANCHE_C_CHAIN_ID, models.CELO_CHAIN_ID, }, }, }, map[string][]any{}, []string{ "rand()", }, 0, 5, ) if err != nil { return errs.NewError(err) } var retErr error for _, meme := range memes { err = s.RetryAgentDeployToken(ctx, meme.ID) if err != nil { retErr = errs.MergeError(retErr, errs.NewErrorWithId(err, meme.ID)) _ = daos.GetDBMainCtx(ctx). Model(&meme). Updates( map[string]any{ "num_retries": gorm.Expr("num_retries + ?", 1), "updated_at": time.Now(), "err": err.Error(), }, ).Error } else { _ = daos.GetDBMainCtx(ctx). Model(&meme). Updates( map[string]any{ "num_retries": 0, "updated_at": time.Now(), }, ).Error s.DeleteFilterAddrs(ctx, meme.NetworkID) } time.Sleep(10 * time.Second) } return retErr }, ) if err != nil { return errs.NewError(err) } return nil } func (s *Service) RetryAgentDeployToken(ctx context.Context, memeID uint) error { err := s.JobRunCheck( ctx, fmt.Sprintf("RetryAgentDeployToken_%d", memeID), func() error { m, err := s.dao.FirstMemeByID( daos.GetDBMainCtx(ctx), memeID, map[string][]any{ "AgentInfo": {}, }, false, ) if err != nil { return errs.NewError(err) } if m == nil { return errs.NewError(errs.ErrBadRequest) } if m.TokenAddress != "" && m.Status == models.MemeStatusCreated { switch m.NetworkID { case models.BASE_CHAIN_ID, models.ARBITRUM_CHAIN_ID, models.BSC_CHAIN_ID, models.APE_CHAIN_ID, models.AVALANCHE_C_CHAIN_ID, models.CELO_CHAIN_ID: { if m.AgentInfo.IsVibeAgent() { return errs.NewError(errs.ErrBadRequest) } isContact, err := s.GetEthereumClient(ctx, m.NetworkID).IsContract(m.TokenAddress) if err != nil { return errs.NewError(err) } if !isContact { tokenSupply := &m.TotalSuply.Float if tokenSupply.Cmp(big.NewFloat(1)) <= 0 { return errs.NewError(errs.ErrBadRequest) } memePoolAddress := strings.ToLower(s.conf.GetConfigKeyString(m.NetworkID, "meme_pool_address")) tokenAddress, _, err := s.GetEthereumClient(ctx, m.NetworkID). DeployAGENTToken( s.GetAddressPrk(memePoolAddress), m.Name, m.Ticker, models.ConvertBigFloatToWei(tokenSupply, 18), memePoolAddress, ) if err != nil { return errs.NewError(err) } // check token address exist in db { memeCheck, err := s.dao.FirstMeme( daos.GetDBMainCtx(ctx), map[string][]any{ "token_address = ?": {strings.ToLower(tokenAddress)}, }, map[string][]any{}, false, ) if err != nil { return errs.NewError(err) } if memeCheck != nil { return errs.NewError(errs.ErrBadRequest) } } err = daos.GetDBMainCtx(ctx).Model(&m). Updates( map[string]any{ "token_address": strings.ToLower(tokenAddress), "total_suply": numeric.NewBigFloatFromFloat(tokenSupply), "status": models.MemeStatusCreated, }, ).Error if err != nil { return errs.NewError(err) } // _ = s.ReplyAferAutoCreateAgent(daos.GetDBMainCtx(ctx), m.AgentInfo.RefTweetID, m.AgentInfo.ID) } } } } return nil }, ) if err != nil { return errs.NewError(err) } return nil } func (s *Service) JobMemeAddPositionInternal(ctx context.Context) error { err := s.JobRunCheck( ctx, "JobMemeAddPositionInternal", func() error { memes, err := s.dao.FindMeme( daos.GetDBMainCtx(ctx), map[string][]any{ "network_id in (?)": { []uint64{ models.BASE_CHAIN_ID, models.ARBITRUM_CHAIN_ID, models.BSC_CHAIN_ID, models.APE_CHAIN_ID, models.AVALANCHE_C_CHAIN_ID, models.CELO_CHAIN_ID, }, }, "status = ?": {models.MemeStatusCreated}, "add_pool1_tx_hash = ''": {}, "num_retries < 3": {}, }, map[string][]any{}, []string{}, 0, 999999, ) if err != nil { return errs.NewError(err) } var retErr error for _, meme := range memes { err = s.MemeAddPositionInternal(ctx, meme.ID) if err != nil { retErr = errs.MergeError(retErr, errs.NewErrorWithId(err, meme.ID)) _ = daos.GetDBMainCtx(ctx). Model(&meme). Updates( map[string]any{ "num_retries": gorm.Expr("num_retries + ?", 1), "updated_at": time.Now(), "err": err.Error(), }, ).Error } else { _ = daos.GetDBMainCtx(ctx). Model(&meme). Updates( map[string]any{ "num_retries": 0, "updated_at": time.Now(), }, ).Error s.DeleteFilterAddrs(ctx, meme.NetworkID) } time.Sleep(10 * time.Second) } return retErr }, ) if err != nil { return errs.NewError(err) } return nil } func (s *Service) MemeAddPositionInternal(ctx context.Context, memeID uint) error { err := s.JobRunCheck( ctx, fmt.Sprintf("MemeAddPositionInternal_%d", memeID), func() error { meme, err := s.dao.FirstMemeByID(daos.GetDBMainCtx(ctx), memeID, map[string][]any{}, false) if err != nil { return errs.NewError(err) } if meme.Status == models.MemeStatusCreated && meme.AddPool1TxHash == "" { // 1.000.000.000 token checkBalance := models.ConvertBigFloatToWei(models.MulBigFloats(&meme.TotalSuply.Float, big.NewFloat(0.999)), 18) if checkBalance.Cmp(big.NewInt(0)) <= 0 { return errs.NewError(errs.ErrBadRequest) } memePoolAddress := strings.ToLower(s.conf.GetConfigKeyString(meme.NetworkID, "meme_pool_address")) { memeBalance, err := s.GetEthereumClient(ctx, meme.NetworkID).Erc20Balance(meme.TokenAddress, memePoolAddress) if err != nil { return errs.NewError(err) } if memeBalance.Cmp(checkBalance) >= 0 { baseTokenPrice := s.GetTokenMarketPrice(daos.GetDBMainCtx(ctx), meme.BaseTokenSymbol) if baseTokenPrice.Cmp(big.NewFloat(0)) <= 0 { return errs.NewError(errs.ErrBadRequest) } memeBalanceFloat := models.ConvertWeiToBigFloat(memeBalance, 18) lowerPrice, _ := models.QuoBigFloats( big.NewFloat(2800), memeBalanceFloat, baseTokenPrice, ).Float64() upperPrice, _ := models.QuoBigFloats( big.NewFloat(1000000000), memeBalanceFloat, baseTokenPrice, ).Float64() baseToken := s.GetMemeBaseToken(daos.GetDBMainCtx(ctx), meme.NetworkID, meme.BaseTokenSymbol) memeToken := strings.ToLower(meme.TokenAddress) var token0, token1 string var amount0, amount1, tickLower, tickUpper, sqrtPriceX96 *big.Int poolFee := int64(20000) tickLowerVar := models.PriceToTick(lowerPrice, 1200) tickUpperVar := models.PriceToTick(upperPrice, 1200) tickCurr := int64(0) if strings.Compare(memeToken, baseToken) < 0 { token0 = memeToken token1 = baseToken amount0 = memeBalance amount1 = big.NewInt(0) tickCurr = tickLowerVar - 1 sqrtPriceX96 = helpers.GetSqrtRatioAtTick(tickCurr) tickLower = big.NewInt(tickLowerVar) tickUpper = big.NewInt(tickUpperVar) } else { token1 = memeToken token0 = baseToken amount1 = memeBalance amount0 = big.NewInt(0) tickCurr = -tickLowerVar + 1 sqrtPriceX96 = helpers.GetSqrtRatioAtTick(tickCurr) tickLower = big.NewInt(-tickUpperVar) tickUpper = big.NewInt(-tickLowerVar) } err = daos.GetDBMainCtx(ctx). Model(meme). Updates( map[string]any{ "tick": tickCurr, }, ).Error if err != nil { return errs.NewError(err) } addPoolTxHash, err := s.GetEthereumClient(ctx, meme.NetworkID).MemeNonfungiblePositionManagerMint( s.conf.GetConfigKeyString(meme.NetworkID, "memeswap_position_mamanger_address"), s.GetAddressPrk( memePoolAddress, ), helpers.HexToAddress(s.conf.GetConfigKeyString(meme.NetworkID, "weth9_contract_address")), sqrtPriceX96, &memenonfungiblepositionmanager.INonfungiblePositionManagerMintParams{ Token0: helpers.HexToAddress(token0), Token1: helpers.HexToAddress(token1), Fee: big.NewInt(poolFee), TickLower: tickLower, TickUpper: tickUpper, Amount0Desired: amount0, Amount1Desired: amount1, Amount0Min: big.NewInt(0), Amount1Min: big.NewInt(0), Deadline: big.NewInt(time.Now().Add(60 * time.Second).Unix()), }, ) if err != nil { return errs.NewError(err) } err = daos.GetDBMainCtx(ctx). Model(meme). Updates( map[string]any{ "pool_fee": poolFee, "tick": tickCurr, "add_pool1_tx_hash": addPoolTxHash, "price": numeric.NewBigFloatFromFloat(big.NewFloat(lowerPrice)), "price_last24h": numeric.NewBigFloatFromFloat(big.NewFloat(lowerPrice)), "price_usd": numeric.NewBigFloatFromFloat(models.MulBigFloats(big.NewFloat(lowerPrice), baseTokenPrice)), "tick_lower": tickLower, "tick_upper": tickUpper, }, ).Error if err != nil { return errs.NewError(err) } //update cache pair detail go func() { time.Sleep(10 * time.Second) _ = s.MemeEventsByTransaction(context.Background(), meme.NetworkID, addPoolTxHash) }() } } } return nil }, ) if err != nil { return errs.NewError(err) } return nil } func (s *Service) JobMemeRemovePositionInternal(ctx context.Context) error { err := s.JobRunCheck( ctx, "JobMemeRemovePositionInternal", func() error { memes, err := s.dao.FindMeme( daos.GetDBMainCtx(ctx), map[string][]any{ "status = ?": {models.MemeStatusReachedMC}, "remove_pool1_tx_hash = ''": {}, `network_id != ?`: {models.BITTENSOR_CHAIN_ID}, "num_retries < 3": {}, "not_graduated = false": {}, }, map[string][]any{}, []string{ "rand()", }, 0, 5, ) if err != nil { return errs.NewError(err) } var retErr error for _, meme := range memes { err = s.MemeRemovePositionInternal(ctx, meme.ID) if err != nil { _ = daos.GetDBMainCtx(ctx). Model(&meme). Updates( map[string]any{ "num_retries": gorm.Expr("num_retries + ?", 1), "updated_at": time.Now(), "err": err.Error(), }, ).Error retErr = errs.MergeError(retErr, errs.NewErrorWithId(err, meme.ID)) } else { _ = daos.GetDBMainCtx(ctx). Model(&meme). Updates( map[string]any{ "num_retries": 0, "updated_at": time.Now(), }, ).Error s.DeleteFilterAddrs(ctx, meme.NetworkID) } time.Sleep(10 * time.Second) } return retErr }, ) if err != nil { return errs.NewError(err) } return nil } func (s *Service) MemeRemovePositionInternal(ctx context.Context, memeID uint) error { err := s.JobRunCheck( ctx, fmt.Sprintf("MemeRemovePositionInternal_%d", memeID), func() error { meme, err := s.dao.FirstMemeByID(daos.GetDBMainCtx(ctx), memeID, map[string][]any{}, false) if err != nil { return errs.NewError(err) } if meme.Status == models.MemeStatusReachedMC { networkID := meme.NetworkID positinInfo, err := s.GetEthereumClient(ctx, networkID).MemeNonfungiblePositionManagerPositionInfo( s.conf.GetConfigKeyString(networkID, "memeswap_position_mamanger_address"), big.NewInt(int64(meme.PositionID)), ) if err != nil { return errs.NewError(err) } meme.PositionLiquidity = numeric.NewBigFloatFromFloat(models.ConvertWeiToBigFloat(positinInfo.Liquidity, 18)) meme.TickLower = positinInfo.TickLower.Int64() meme.TickUpper = positinInfo.TickUpper.Int64() err = daos.GetDBMainCtx(ctx). Model(meme). Updates( map[string]any{ "position_liquidity": meme.PositionLiquidity, "tick_lower": meme.TickLower, "tick_upper": meme.TickUpper, }, ).Error if err != nil { return errs.NewError(err) } memePoolAddress := strings.ToLower(s.conf.GetConfigKeyString(meme.NetworkID, "meme_pool_address")) removePoolTxHash, err := s.GetEthereumClient(ctx, networkID).MemeNonfungiblePositionManagerBurn( s.conf.GetConfigKeyString(networkID, "memeswap_position_mamanger_address"), s.GetAddressPrk( memePoolAddress, ), helpers.HexToAddress(s.conf.GetConfigKeyString(networkID, "weth9_contract_address")), big.NewInt(int64(meme.PositionID)), ) if err != nil { return errs.NewError(err) } err = daos.GetDBMainCtx(ctx). Model(meme). Updates( map[string]any{ "remove_pool1_tx_hash": removePoolTxHash, "status": models.MemeStatusRemovePoolLelve1, }, ).Error if err != nil { return errs.NewError(err) } // snapshot token holder go func() { time.Sleep(10 * time.Second) _ = s.MemeEventsByTransaction(context.Background(), meme.NetworkID, removePoolTxHash) }() } return nil }, ) if err != nil { return errs.NewError(err) } return nil } func (s *Service) JobMemeAddPositionUniswap(ctx context.Context) error { err := s.JobRunCheck( ctx, "JobMemeAddPositionUniswap", func() error { memes, err := s.dao.FindMeme( daos.GetDBMainCtx(ctx), map[string][]any{ "network_id in (?)": { []uint64{ models.BASE_CHAIN_ID, models.ARBITRUM_CHAIN_ID, models.BSC_CHAIN_ID, models.APE_CHAIN_ID, models.AVALANCHE_C_CHAIN_ID, models.CELO_CHAIN_ID, }, }, "status = ?": {models.MemeStatusRemovePoolLelve1}, "add_pool2_tx_hash = ''": {}, `network_id != ?`: {models.BITTENSOR_CHAIN_ID}, "num_retries < 3": {}, "not_graduated = false": {}, }, map[string][]any{}, []string{ "rand()", }, 0, 5, ) if err != nil { return errs.NewError(err) } var retErr error for _, meme := range memes { err = s.MemeAddPositionUniswap(ctx, meme.ID) if err != nil { _ = daos.GetDBMainCtx(ctx). Model(&meme). Updates( map[string]any{ "num_retries": gorm.Expr("num_retries + ?", 1), "updated_at": time.Now(), "err": err.Error(), }, ).Error retErr = errs.MergeError(retErr, errs.NewErrorWithId(err, meme.ID)) } else { _ = daos.GetDBMainCtx(ctx). Model(&meme). Updates( map[string]any{ "num_retries": 0, "updated_at": time.Now(), }, ).Error s.DeleteFilterAddrs(ctx, meme.NetworkID) } time.Sleep(10 * time.Second) } return retErr }, ) if err != nil { return errs.NewError(err) } return nil } func (s *Service) MemeAddPositionUniswap(ctx context.Context, memeID uint) error { err := s.JobRunCheck( ctx, fmt.Sprintf("MemeAddPositionUniswap_%d", memeID), func() error { meme, err := s.dao.FirstMemeByID(daos.GetDBMainCtx(ctx), memeID, map[string][]any{}, false) if err != nil { return errs.NewError(err) } if meme.Status == models.MemeStatusRemovePoolLelve1 { memePoolAddress := strings.ToLower(s.conf.GetConfigKeyString(meme.NetworkID, "meme_pool_address")) { memeBalance, err := s.GetEthereumClient(ctx, meme.NetworkID).Erc20Balance(meme.TokenAddress, memePoolAddress) if err != nil { return errs.NewError(err) } if memeBalance.Cmp(models.Number2BigInt("100000000", 18)) > 0 { baseTokenPrice := s.GetTokenMarketPrice(daos.GetDBMainCtx(ctx), meme.BaseTokenSymbol) if baseTokenPrice.Cmp(big.NewFloat(0)) <= 0 { return errs.NewError(errs.ErrBadRequest) } baseToken := s.GetMemeBaseToken(daos.GetDBMainCtx(ctx), meme.NetworkID, meme.BaseTokenSymbol) memeToken := meme.TokenAddress var token0, token1 string var amount0, amount1, tickLower, tickUpper, sqrtPriceX96 *big.Int poolFee := int64(3000) tickLowerVar := meme.TickLower tickUpperVar := meme.TickUpper switch meme.NetworkID { case models.BSC_CHAIN_ID: { poolFee = int64(2500) } } liquidity := models.ConvertBigFloatToWei(&meme.PositionLiquidity.Float, 18) if strings.Compare(memeToken, baseToken) < 0 { token0 = memeToken token1 = baseToken amount0 = memeBalance sqrtPriceX96 = models.GetSqrtPriceX96ForLiquidityAndAmount0( helpers.GetSqrtRatioAtTick(tickLowerVar), helpers.GetSqrtRatioAtTick(tickUpperVar), liquidity, memeBalance, ) amount1 = helpers.GetAmount1ForLiquidity( helpers.GetSqrtRatioAtTick(tickLowerVar), sqrtPriceX96, liquidity, ) tickLower = big.NewInt(tickLowerVar) tickUpper = big.NewInt(tickUpperVar) } else { token1 = memeToken token0 = baseToken amount1 = memeBalance sqrtPriceX96 = models.GetSqrtPriceX96ForLiquidityAndAmount1( helpers.GetSqrtRatioAtTick(tickLowerVar), helpers.GetSqrtRatioAtTick(tickUpperVar), liquidity, memeBalance, ) amount0 = helpers.GetAmount0ForLiquidity( sqrtPriceX96, helpers.GetSqrtRatioAtTick(tickUpperVar), liquidity, ) tickLower = big.NewInt(tickLowerVar) tickUpper = big.NewInt(tickUpperVar) } priceF, _ := models.ConvertSqrtPriceX96ToPriceEx(sqrtPriceX96, 18, meme.ZeroForOne).Float64() tickCurr := models.PriceToTick(priceF, 1) if meme.ZeroForOne { tickCurr = models.PriceToTick(1/priceF, 1) } err = daos.GetDBMainCtx(ctx). Model(meme). Updates( map[string]any{ "tick": tickCurr, "add_pool2_at": time.Now(), }, ).Error if err != nil { return errs.NewError(err) } var addPoolTxHash string switch meme.NetworkID { case models.BASE_CHAIN_ID: { addPoolTxHash, err = s.GetEthereumClient(ctx, meme.NetworkID).BaseNonfungiblePositionManagerMint( s.conf.GetConfigKeyString(meme.NetworkID, "uniswap_position_mamanger_address"), s.GetAddressPrk( memePoolAddress, ), helpers.HexToAddress(s.conf.GetConfigKeyString(meme.NetworkID, "weth9_contract_address")), sqrtPriceX96, &basenonfungiblepositionmanager.INonfungiblePositionManagerMintParams{ Token0: helpers.HexToAddress(token0), Token1: helpers.HexToAddress(token1), Fee: big.NewInt(poolFee), TickLower: tickLower, TickUpper: tickUpper, Amount0Desired: models.QuoBigInts(models.MulBigInts(amount0, big.NewInt(9999)), big.NewInt(10000)), Amount1Desired: models.QuoBigInts(models.MulBigInts(amount1, big.NewInt(9999)), big.NewInt(10000)), Amount0Min: models.QuoBigInts(models.MulBigInts(amount0, big.NewInt(99)), big.NewInt(100)), Amount1Min: models.QuoBigInts(models.MulBigInts(amount1, big.NewInt(99)), big.NewInt(100)), Deadline: big.NewInt(time.Now().Add(120 * time.Second).Unix()), Recipient: helpers.HexToAddress(memePoolAddress), }, ) } case models.ARBITRUM_CHAIN_ID: { addPoolTxHash, err = s.GetEthereumClient(ctx, meme.NetworkID).ArbitrumNonfungiblePositionManagerMint( s.conf.GetConfigKeyString(meme.NetworkID, "uniswap_position_mamanger_address"), s.GetAddressPrk( memePoolAddress, ), helpers.HexToAddress(s.conf.GetConfigKeyString(meme.NetworkID, "weth9_contract_address")), sqrtPriceX96, &arbitrumnonfungiblepositionmanager.INonfungiblePositionManagerMintParams{ Token0: helpers.HexToAddress(token0), Token1: helpers.HexToAddress(token1), TickLower: tickLower, TickUpper: tickUpper, Amount0Desired: models.QuoBigInts(models.MulBigInts(amount0, big.NewInt(9999)), big.NewInt(10000)), Amount1Desired: models.QuoBigInts(models.MulBigInts(amount1, big.NewInt(9999)), big.NewInt(10000)), Amount0Min: models.QuoBigInts(models.MulBigInts(amount0, big.NewInt(99)), big.NewInt(100)), Amount1Min: models.QuoBigInts(models.MulBigInts(amount1, big.NewInt(99)), big.NewInt(100)), Deadline: big.NewInt(time.Now().Add(120 * time.Second).Unix()), }, ) } case models.BSC_CHAIN_ID: { addPoolTxHash, err = s.GetEthereumClient(ctx, meme.NetworkID).BscNonfungiblePositionManagerMint( s.conf.GetConfigKeyString(meme.NetworkID, "uniswap_position_mamanger_address"), s.GetAddressPrk( memePoolAddress, ), helpers.HexToAddress(s.conf.GetConfigKeyString(meme.NetworkID, "weth9_contract_address")), sqrtPriceX96, &bscnonfungiblepositionmanager.INonfungiblePositionManagerMintParams{ Token0: helpers.HexToAddress(token0), Token1: helpers.HexToAddress(token1), Fee: big.NewInt(poolFee), TickLower: tickLower, TickUpper: tickUpper, Amount0Desired: models.QuoBigInts(models.MulBigInts(amount0, big.NewInt(9999)), big.NewInt(10000)), Amount1Desired: models.QuoBigInts(models.MulBigInts(amount1, big.NewInt(9999)), big.NewInt(10000)), Amount0Min: models.QuoBigInts(models.MulBigInts(amount0, big.NewInt(99)), big.NewInt(100)), Amount1Min: models.QuoBigInts(models.MulBigInts(amount1, big.NewInt(99)), big.NewInt(100)), Deadline: big.NewInt(time.Now().Add(120 * time.Second).Unix()), }, ) } case models.APE_CHAIN_ID: { addPoolTxHash, err = s.GetEthereumClient(ctx, meme.NetworkID).ApechainNonfungiblePositionManagerMint( s.conf.GetConfigKeyString(meme.NetworkID, "uniswap_position_mamanger_address"), s.GetAddressPrk( memePoolAddress, ), helpers.HexToAddress(s.conf.GetConfigKeyString(meme.NetworkID, "weth9_contract_address")), sqrtPriceX96, &apechainnonfungiblepositionmanager.INonfungiblePositionManagerMintParams{ Token0: helpers.HexToAddress(token0), Token1: helpers.HexToAddress(token1), TickLower: tickLower, TickUpper: tickUpper, Amount0Desired: models.QuoBigInts(models.MulBigInts(amount0, big.NewInt(9999)), big.NewInt(10000)), Amount1Desired: models.QuoBigInts(models.MulBigInts(amount1, big.NewInt(9999)), big.NewInt(10000)), Amount0Min: models.QuoBigInts(models.MulBigInts(amount0, big.NewInt(99)), big.NewInt(100)), Amount1Min: models.QuoBigInts(models.MulBigInts(amount1, big.NewInt(99)), big.NewInt(100)), Deadline: big.NewInt(time.Now().Add(120 * time.Second).Unix()), }, ) } case models.AVALANCHE_C_CHAIN_ID: { addPoolTxHash, err = s.GetEthereumClient(ctx, meme.NetworkID).AvaxNonfungiblePositionManagerMint( s.conf.GetConfigKeyString(meme.NetworkID, "uniswap_position_mamanger_address"), s.GetAddressPrk( memePoolAddress, ), helpers.HexToAddress(s.conf.GetConfigKeyString(meme.NetworkID, "weth9_contract_address")), sqrtPriceX96, &avaxnonfungiblepositionmanager.INonfungiblePositionManagerMintParams{ Token0: helpers.HexToAddress(token0), Token1: helpers.HexToAddress(token1), Fee: big.NewInt(poolFee), TickLower: tickLower, TickUpper: tickUpper, Amount0Desired: models.QuoBigInts(models.MulBigInts(amount0, big.NewInt(9999)), big.NewInt(10000)), Amount1Desired: models.QuoBigInts(models.MulBigInts(amount1, big.NewInt(9999)), big.NewInt(10000)), Amount0Min: models.QuoBigInts(models.MulBigInts(amount0, big.NewInt(99)), big.NewInt(100)), Amount1Min: models.QuoBigInts(models.MulBigInts(amount1, big.NewInt(99)), big.NewInt(100)), Deadline: big.NewInt(time.Now().Add(120 * time.Second).Unix()), Recipient: helpers.HexToAddress(memePoolAddress), }, ) } case models.POLYGON_CHAIN_ID: { addPoolTxHash, err = s.GetEthereumClient(ctx, meme.NetworkID).PolygonNonfungiblePositionManagerMint( s.conf.GetConfigKeyString(meme.NetworkID, "uniswap_position_mamanger_address"), s.GetAddressPrk( memePoolAddress, ), helpers.HexToAddress(s.conf.GetConfigKeyString(meme.NetworkID, "weth9_contract_address")), sqrtPriceX96, &polygonnonfungiblepositionmanager.INonfungiblePositionManagerMintParams{ Token0: helpers.HexToAddress(token0), Token1: helpers.HexToAddress(token1), Fee: big.NewInt(poolFee), TickLower: tickLower, TickUpper: tickUpper, Amount0Desired: models.QuoBigInts(models.MulBigInts(amount0, big.NewInt(9999)), big.NewInt(10000)), Amount1Desired: models.QuoBigInts(models.MulBigInts(amount1, big.NewInt(9999)), big.NewInt(10000)), Amount0Min: models.QuoBigInts(models.MulBigInts(amount0, big.NewInt(99)), big.NewInt(100)), Amount1Min: models.QuoBigInts(models.MulBigInts(amount1, big.NewInt(99)), big.NewInt(100)), Deadline: big.NewInt(time.Now().Add(120 * time.Second).Unix()), Recipient: helpers.HexToAddress(memePoolAddress), }, ) } case models.ZKSYNC_CHAIN_ID: { addPoolTxHash, err = s.GetZkClient(ctx, meme.NetworkID).ZksyncNonfungiblePositionManagerMint( s.conf.GetConfigKeyString(meme.NetworkID, "uniswap_position_mamanger_address"), s.GetAddressPrk( memePoolAddress, ), helpers.HexToAddress(s.conf.GetConfigKeyString(meme.NetworkID, "weth9_contract_address")), sqrtPriceX96, &zksyncnonfungiblepositionmanager.INonfungiblePositionManagerMintParams{ Token0: helpers.HexToAddress(token0), Token1: helpers.HexToAddress(token1), Fee: big.NewInt(poolFee), TickLower: tickLower, TickUpper: tickUpper, Amount0Desired: models.QuoBigInts(models.MulBigInts(amount0, big.NewInt(9999)), big.NewInt(10000)), Amount1Desired: models.QuoBigInts(models.MulBigInts(amount1, big.NewInt(9999)), big.NewInt(10000)), Amount0Min: models.QuoBigInts(models.MulBigInts(amount0, big.NewInt(99)), big.NewInt(100)), Amount1Min: models.QuoBigInts(models.MulBigInts(amount1, big.NewInt(99)), big.NewInt(100)), Deadline: big.NewInt(time.Now().Add(120 * time.Second).Unix()), Recipient: helpers.HexToAddress(memePoolAddress), }, ) } case models.CELO_CHAIN_ID: { addPoolTxHash, err = s.GetEthereumClient(ctx, meme.NetworkID).CeloNonfungiblePositionManagerMint( s.conf.GetConfigKeyString(meme.NetworkID, "uniswap_position_mamanger_address"), s.GetAddressPrk( memePoolAddress, ), helpers.HexToAddress(s.conf.GetConfigKeyString(meme.NetworkID, "weth9_contract_address")), sqrtPriceX96, &celononfungiblepositionmanager.INonfungiblePositionManagerMintParams{ Token0: helpers.HexToAddress(token0), Token1: helpers.HexToAddress(token1), Fee: big.NewInt(poolFee), TickLower: tickLower, TickUpper: tickUpper, Amount0Desired: models.QuoBigInts(models.MulBigInts(amount0, big.NewInt(9999)), big.NewInt(10000)), Amount1Desired: models.QuoBigInts(models.MulBigInts(amount1, big.NewInt(9999)), big.NewInt(10000)), Amount0Min: models.QuoBigInts(models.MulBigInts(amount0, big.NewInt(99)), big.NewInt(100)), Amount1Min: models.QuoBigInts(models.MulBigInts(amount1, big.NewInt(99)), big.NewInt(100)), Deadline: big.NewInt(time.Now().Add(120 * time.Second).Unix()), Recipient: helpers.HexToAddress(memePoolAddress), }, ) } default: { return errs.NewError(errs.ErrBadRequest) } } if err != nil { return errs.NewError(err) } err = daos.GetDBMainCtx(ctx). Model(meme). Updates( map[string]any{ "pool_fee": poolFee, "tick": tickCurr, "add_pool2_tx_hash": addPoolTxHash, "price": numeric.NewBigFloatFromFloat(big.NewFloat(priceF)), "price_usd": numeric.NewBigFloatFromFloat(models.MulBigFloats(big.NewFloat(priceF), baseTokenPrice)), "tick_lower": tickLower, "tick_upper": tickUpper, "add_pool2_at": time.Now(), }, ).Error if err != nil { return errs.NewError(err) } //update cache pair detail go func() { _ = s.CreateMemeNotifications(daos.GetDBMainCtx(ctx), 0, meme.ID, 0, models.NotiTypeNewMeme, fmt.Sprintf("%s_%d", models.NotiTypeNewMeme, meme.ID)) _ = s.CacheMemeDetail(daos.GetDBMainCtx(ctx), meme.TokenAddress) time.Sleep(10 * time.Second) _ = s.MemeEventsByTransaction(context.Background(), meme.NetworkID, addPoolTxHash) }() } } } return nil }, ) if err != nil { return errs.NewError(err) } return nil } // func (s *Service) MemeAddPositionUniswap(ctx context.Context, memeID uint) error { // meme, err := s.dao.FirstMemeByID(daos.GetDBMainCtx(ctx), memeID, map[string][]any{}, false) // if err != nil { // return errs.NewError(err) // } // if meme.Status == models.MemeStatusRemovePoolLelve1 && meme.AddPool2TxHash == "" { // // 1.000.000.000 token // checkBalance := models.ConvertBigFloatToWei(models.MulBigFloats(&meme.TotalSuply.Float, big.NewFloat(0.999)), 18) // if checkBalance.Cmp(big.NewInt(0)) <= 0 { // return errs.NewError(errs.ErrBadRequest) // } // memePoolAddress := strings.ToLower(s.conf.GetConfigKeyString(meme.NetworkID, "meme_pool_address")) // { // memeBalance, err := s.GetEthereumClient(ctx, meme.NetworkID).Erc20Balance(meme.TokenAddress, memePoolAddress) // if err != nil { // return errs.NewError(err) // } // if memeBalance.Cmp(checkBalance) >= 0 { // baseTokenPrice := s.GetTokenMarketPrice(daos.GetDBMainCtx(ctx), meme.BaseTokenSymbol) // if baseTokenPrice.Cmp(big.NewFloat(0)) <= 0 { // return errs.NewError(errs.ErrBadRequest) // } // memeBalanceFloat := models.ConvertWeiToBigFloat(memeBalance, 18) // lowerPrice, _ := models.QuoBigFloats( // big.NewFloat(2800), // memeBalanceFloat, // baseTokenPrice, // ).Float64() // upperPrice, _ := models.QuoBigFloats( // big.NewFloat(1000000000), // memeBalanceFloat, // baseTokenPrice, // ).Float64() // baseToken := s.GetMemeBaseToken(daos.GetDBMainCtx(ctx), meme.NetworkID, meme.BaseTokenSymbol) // memeToken := strings.ToLower(meme.TokenAddress) // var token0, token1 string // var amount0, amount1, tickLower, tickUpper, sqrtPriceX96 *big.Int // poolFee := int64(3000) // tickLowerVar := models.PriceToTick(lowerPrice, 60) // tickUpperVar := models.PriceToTick(upperPrice, 60) // switch meme.NetworkID { // case models.BSC_CHAIN_ID: // { // poolFee = int64(2500) // tickLowerVar = models.PriceToTick(lowerPrice, 50) // tickUpperVar = models.PriceToTick(upperPrice, 50) // } // } // tickCurr := int64(0) // if strings.Compare(memeToken, baseToken) < 0 { // token0 = memeToken // token1 = baseToken // amount0 = memeBalance // amount1 = big.NewInt(0) // tickCurr = tickLowerVar - 1 // sqrtPriceX96 = helpers.GetSqrtRatioAtTick(tickCurr) // tickLower = big.NewInt(tickLowerVar) // tickUpper = big.NewInt(tickUpperVar) // } else { // token1 = memeToken // token0 = baseToken // amount1 = memeBalance // amount0 = big.NewInt(0) // tickCurr = -tickLowerVar + 1 // sqrtPriceX96 = helpers.GetSqrtRatioAtTick(tickCurr) // tickLower = big.NewInt(-tickUpperVar) // tickUpper = big.NewInt(-tickLowerVar) // } // err = daos.GetDBMainCtx(ctx). // Model(meme). // Updates( // map[string]any{ // "tick": tickCurr, // }, // ).Error // if err != nil { // return errs.NewError(err) // } // var addPoolTxHash string // switch meme.NetworkID { // case models.BASE_CHAIN_ID: // { // addPoolTxHash, err = s.GetEthereumClient(ctx, meme.NetworkID).BaseNonfungiblePositionManagerMint( // s.conf.GetConfigKeyString(meme.NetworkID, "uniswap_position_mamanger_address"), // s.GetAddressPrk( // memePoolAddress, // ), // helpers.HexToAddress(s.conf.GetConfigKeyString(meme.NetworkID, "weth9_contract_address")), // sqrtPriceX96, // &basenonfungiblepositionmanager.INonfungiblePositionManagerMintParams{ // Token0: helpers.HexToAddress(token0), // Token1: helpers.HexToAddress(token1), // Fee: big.NewInt(poolFee), // TickLower: tickLower, // TickUpper: tickUpper, // Amount0Desired: amount0, // Amount1Desired: amount1, // Amount0Min: big.NewInt(0), // Amount1Min: big.NewInt(0), // Deadline: big.NewInt(time.Now().Add(120 * time.Second).Unix()), // }, // ) // if err != nil { // return errs.NewError(err) // } // } // case models.ARBITRUM_CHAIN_ID: // { // addPoolTxHash, err = s.GetEthereumClient(ctx, meme.NetworkID).ArbitrumNonfungiblePositionManagerMint( // s.conf.GetConfigKeyString(meme.NetworkID, "uniswap_position_mamanger_address"), // s.GetAddressPrk( // memePoolAddress, // ), // helpers.HexToAddress(s.conf.GetConfigKeyString(meme.NetworkID, "weth9_contract_address")), // sqrtPriceX96, // &arbitrumnonfungiblepositionmanager.INonfungiblePositionManagerMintParams{ // Token0: helpers.HexToAddress(token0), // Token1: helpers.HexToAddress(token1), // TickLower: tickLower, // TickUpper: tickUpper, // Amount0Desired: amount0, // Amount1Desired: amount1, // Amount0Min: big.NewInt(0), // Amount1Min: big.NewInt(0), // Deadline: big.NewInt(time.Now().Add(120 * time.Second).Unix()), // }, // ) // if err != nil { // return errs.NewError(err) // } // } // case models.BSC_CHAIN_ID: // { // addPoolTxHash, err = s.GetEthereumClient(ctx, meme.NetworkID).BscNonfungiblePositionManagerMint( // s.conf.GetConfigKeyString(meme.NetworkID, "uniswap_position_mamanger_address"), // s.GetAddressPrk( // memePoolAddress, // ), // helpers.HexToAddress(s.conf.GetConfigKeyString(meme.NetworkID, "weth9_contract_address")), // sqrtPriceX96, // &bscnonfungiblepositionmanager.INonfungiblePositionManagerMintParams{ // Token0: helpers.HexToAddress(token0), // Token1: helpers.HexToAddress(token1), // Fee: big.NewInt(poolFee), // TickLower: tickLower, // TickUpper: tickUpper, // Amount0Desired: amount0, // Amount1Desired: amount1, // Amount0Min: big.NewInt(0), // Amount1Min: big.NewInt(0), // Deadline: big.NewInt(time.Now().Add(120 * time.Second).Unix()), // }, // ) // if err != nil { // return errs.NewError(err) // } // } // case models.APE_CHAIN_ID: // { // addPoolTxHash, err = s.GetEthereumClient(ctx, meme.NetworkID).ApechainNonfungiblePositionManagerMint( // s.conf.GetConfigKeyString(meme.NetworkID, "uniswap_position_mamanger_address"), // s.GetAddressPrk( // memePoolAddress, // ), // helpers.HexToAddress(s.conf.GetConfigKeyString(meme.NetworkID, "weth9_contract_address")), // sqrtPriceX96, // &apechainnonfungiblepositionmanager.INonfungiblePositionManagerMintParams{ // Token0: helpers.HexToAddress(token0), // Token1: helpers.HexToAddress(token1), // TickLower: tickLower, // TickUpper: tickUpper, // Amount0Desired: amount0, // Amount1Desired: amount1, // Amount0Min: big.NewInt(0), // Amount1Min: big.NewInt(0), // Deadline: big.NewInt(time.Now().Add(120 * time.Second).Unix()), // }, // ) // if err != nil { // return errs.NewError(err) // } // } // default: // { // return errs.NewError(errs.ErrBadRequest) // } // } // err = daos.GetDBMainCtx(ctx). // Model(meme). // Updates( // map[string]any{ // "pool_fee": poolFee, // "tick": tickCurr, // "add_pool2_tx_hash": addPoolTxHash, // "price": numeric.NewBigFloatFromFloat(big.NewFloat(lowerPrice)), // "price_last24h": numeric.NewBigFloatFromFloat(big.NewFloat(lowerPrice)), // "price_usd": numeric.NewBigFloatFromFloat(models.MulBigFloats(big.NewFloat(lowerPrice), baseTokenPrice)), // "tick_lower": tickLower, // "tick_upper": tickUpper, // }, // ).Error // if err != nil { // return errs.NewError(err) // } // //update cache pair detail // go func() { // time.Sleep(10 * time.Second) // _ = s.MemeEventsByTransaction(context.Background(), meme.NetworkID, addPoolTxHash) // }() // } // } // } // return nil // } func (s *Service) JobCheckMemeReachMarketCap(ctx context.Context) error { err := s.JobRunCheck( ctx, "JobCheckMemeReachMarketCap", func() error { filters := map[string][]any{ `price_usd * supply >= 69000`: {}, `status = ?`: {models.MemeStatusAddPoolLevel1}, `network_id != ?`: {models.BITTENSOR_CHAIN_ID}, "not_graduated = false": {}, } memes, err := s.dao.FindMeme(daos.GetDBMainCtx(ctx), filters, map[string][]any{}, []string{}, 0, 5, ) if err != nil { return errs.NewError(err) } for _, meme := range memes { updateFields := map[string]any{ "status": models.MemeStatusReachedMC, } err := daos.GetDBMainCtx(ctx). Model(meme). Where("status = ?", models.MemeStatusAddPoolLevel1). Updates( updateFields, ).Error if err != nil { return errs.NewError(err) } } return nil }, ) if err != nil { return errs.NewError(err) } return nil } func (s *Service) JobUpdateMemeUsdPrice(ctx context.Context) error { err := s.JobRunCheck( ctx, "JobUpdateMemeUsdPrice", func() error { { basePrice := s.GetTokenMarketPrice(daos.GetDBMainCtx(ctx), string(models.BaseTokenSymbolETH)) if basePrice.Cmp(big.NewFloat(0)) <= 0 { return errs.NewError(errs.ErrBadRequest) } err := daos.GetDBMainCtx(ctx). Model(&models.Meme{}). Where("base_token_symbol = ?", models.BaseTokenSymbolETH). UpdateColumn( "price_usd", gorm.Expr("price * ?", numeric.NewBigFloatFromFloat(basePrice)), ).Error if err != nil { return errs.NewError(err) } } { basePrice := s.GetTokenMarketPrice(daos.GetDBMainCtx(ctx), string(models.BaseTokenSymbolEAI)) if basePrice.Cmp(big.NewFloat(0)) <= 0 { return errs.NewError(errs.ErrBadRequest) } err := daos.GetDBMainCtx(ctx). Model(&models.Meme{}). Where("base_token_symbol = ?", models.BaseTokenSymbolEAI). UpdateColumn( "price_usd", gorm.Expr("price * ?", numeric.NewBigFloatFromFloat(basePrice)), ).Error if err != nil { return errs.NewError(err) } } return nil }, ) if err != nil { return errs.NewError(err) } return nil } func (s *Service) JobRetryAddPool1(ctx context.Context) error { err := s.JobRunCheck( ctx, "JobRetryAddPool1", func() error { memes, err := s.dao.FindMeme( daos.GetDBMainCtx(ctx), map[string][]any{ "updated_at <= ?": {time.Now().Add(-120 * time.Minute)}, "status = ?": {models.MemeStatusCreated}, "add_pool1_tx_hash != ?": {""}, "network_id in (?)": { []uint64{ models.BASE_CHAIN_ID, models.ARBITRUM_CHAIN_ID, models.BSC_CHAIN_ID, models.APE_CHAIN_ID, models.AVALANCHE_C_CHAIN_ID, models.CELO_CHAIN_ID, }, }, }, map[string][]any{}, []string{ "rand()", }, 0, 10, ) if err != nil { return errs.NewError(err) } var retErr error for _, meme := range memes { fmt.Println(meme.AddPool1TxHash) err = s.GetEVMClient(ctx, meme.NetworkID).TransactionConfirmed(meme.AddPool1TxHash) if err != nil { fmt.Println(err.Error()) if strings.Contains(err.Error(), "not found") || strings.Contains(err.Error(), "transaction is not Successful") { err = daos.GetDBMainCtx(ctx). Model(meme). Updates( map[string]any{ "add_pool1_tx_hash": "", }, ). Error if err != nil { return errs.NewError(err) } } } else { s.MemeEventsByTransaction(ctx, meme.NetworkID, meme.AddPool1TxHash) } } return retErr }, ) if err != nil { return errs.NewError(err) } return nil } func (s *Service) JobRetryAddPool2(ctx context.Context) error { err := s.JobRunCheck( ctx, "JobRetryAddPool1", func() error { memes, err := s.dao.FindMeme( daos.GetDBMainCtx(ctx), map[string][]any{ "updated_at <= ?": {time.Now().Add(-120 * time.Minute)}, "status = ?": {models.MemeStatusRemovePoolLelve1}, "add_pool2_tx_hash != ?": {""}, "network_id in (?)": { []uint64{ models.BASE_CHAIN_ID, models.ARBITRUM_CHAIN_ID, models.BSC_CHAIN_ID, models.APE_CHAIN_ID, models.AVALANCHE_C_CHAIN_ID, models.CELO_CHAIN_ID, }, }, }, map[string][]any{}, []string{ "rand()", }, 0, 10, ) if err != nil { return errs.NewError(err) } var retErr error for _, meme := range memes { err = s.GetEVMClient(ctx, meme.NetworkID).TransactionConfirmed(meme.AddPool2TxHash) if err != nil { fmt.Println(err.Error()) if strings.Contains(err.Error(), "not found") || strings.Contains(err.Error(), "transaction is not Successful") { err = daos.GetDBMainCtx(ctx). Model(meme). Updates( map[string]any{ "add_pool2_tx_hash": "", }, ). Error if err != nil { return errs.NewError(err) } } } else { s.MemeEventsByTransaction(ctx, meme.NetworkID, meme.AddPool2TxHash) } } return retErr }, ) if err != nil { return errs.NewError(err) } return nil } func (s *Service) JobMemeBurnPositionUniswap(ctx context.Context) error { err := s.JobRunCheck( ctx, "JobMemeBurnPositionUniswap", func() error { memes, err := s.dao.FindMeme( daos.GetDBMainCtx(ctx), map[string][]any{ "factory_address is null or factory_address != ''": {}, "add_pool2_at <= ?": {time.Now().Add(-24 * time.Hour)}, "status = ?": {models.MemeStatusAddPoolLevel2}, "uniswap_position_id > 0": {}, "burn_pool2_at is null": {}, "network_id in (?)": { []uint64{ models.BASE_CHAIN_ID, models.ARBITRUM_CHAIN_ID, models.BSC_CHAIN_ID, models.APE_CHAIN_ID, models.AVALANCHE_C_CHAIN_ID, models.CELO_CHAIN_ID, }, }, "num_retries < 3": {}, }, map[string][]any{}, []string{ "add_pool2_at asc", }, 0, 2, ) if err != nil { return errs.NewError(err) } var retErr error for _, meme := range memes { err = s.MemeBurnPositionUniswap(ctx, meme.ID) if err != nil { _ = daos.GetDBMainCtx(ctx). Model(&meme). Updates( map[string]any{ "num_retries": gorm.Expr("num_retries + ?", 1), "updated_at": time.Now(), "err": err.Error(), }, ).Error retErr = errs.MergeError(retErr, errs.NewErrorWithId(err, meme.ID)) } else { _ = daos.GetDBMainCtx(ctx). Model(&meme). Updates( map[string]any{ "num_retries": 0, "updated_at": time.Now(), }, ).Error } time.Sleep(10 * time.Second) } return retErr }, ) if err != nil { return errs.NewError(err) } return nil } func (s *Service) MemeBurnPositionUniswap(ctx context.Context, memeID uint) error { err := s.JobRunCheck( ctx, fmt.Sprintf("MemeBurnPositionUniswap_%d", memeID), func() error { meme, err := s.dao.FirstMemeByID(daos.GetDBMainCtx(ctx), memeID, map[string][]any{}, false) if err != nil { return errs.NewError(err) } if meme.Status == models.MemeStatusAddPoolLevel2 && meme.UniswapPositionID > 0 && meme.AddPool2At.Before(time.Now().Add(24*time.Hour)) { memePoolAddress := strings.ToLower(s.conf.GetConfigKeyString(meme.NetworkID, "meme_pool_address")) { burnPoolTxHash, err := s.GetEVMClient(ctx, meme.NetworkID).Erc721Transfer( s.conf.GetConfigKeyString(meme.NetworkID, "uniswap_position_mamanger_address"), s.GetAddressPrk( memePoolAddress, ), models.BURN_ADDRESS, big.NewInt(meme.UniswapPositionID), ) if err != nil { return errs.NewError(err) } err = daos.GetDBMainCtx(ctx). Model(meme). Updates( map[string]any{ "burn_pool2_at": time.Now(), "burn_pool2_tx_hash": burnPoolTxHash, }, ).Error if err != nil { return errs.NewError(err) } } } return nil }, ) if err != nil { return errs.NewError(err) } return nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/twitter_job.go ================================================ package services import ( "context" "fmt" "strings" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/daos" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/helpers" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/twitter" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/types/numeric" "github.com/jinzhu/copier" "github.com/jinzhu/gorm" ) func (s *Service) ScanTwitterTweetLiked(ctx context.Context) error { twitterInfos, err := s.dao.FindTwitterInfo(daos.GetDBMainCtx(ctx), map[string][]interface{}{ "twitter_id in ('1443830739372417024', '95760717') ": {}}, map[string][]interface{}{}, []string{}, 0, 100) if err != nil { return err } for _, agent := range twitterInfos { likedTweets, err := helpers.GetLikedTweets(agent.TwitterID, agent.AccessToken, "") if err != nil { return err } tweetIDs := []string{} for _, v := range likedTweets.Data { tweetIDs = append(tweetIDs, v.ID) } listTweets, err := s.twitterAPI.GetTweetDetails(tweetIDs) if err != nil { return err } daos.WithTransaction( daos.GetDBMainCtx(ctx), func(tx *gorm.DB) error { for _, item := range listTweets { tweet, err := s.dao.FirstTwitterTweetLiked(tx, map[string][]interface{}{ "tweet_id = ?": {item.ID}, "liked_user_id = ?": {agent.TwitterID}, }, map[string][]interface{}{}, []string{}) if err != nil { continue } if tweet != nil { //update tweet.LikedUserID = agent.TwitterID tweet.LikeCount = item.LikeCount tweet.RetweetCount = item.RetweetCount tweet.ReplyCount = item.ReplyCount tweet.LikeCount = item.LikeCount tweet.QuoteCount = item.QuoteCount tweet.ImpressionCount = item.ImpressionCount tweet.InReplyToUserID = item.InReplyToUserID tweet.InReplyToTweetID = item.InReplyToTweetID tweet.IsReply = item.IsReply tweet.OriginalText = item.OriginalText tweet.IsRetweet = item.IsRetweet tweet.RepostTweetID = item.RepostTweetID tweet.RepostText = item.RepostText tweet.IsQuote = item.IsQuote tweet.QuoteTweetID = item.QuoteTweetID tweet.QuoteText = item.QuoteText err = s.dao.Save(tx, tweet) if err != nil { continue } } else { err = s.dao.Create(tx, &models.TwitterTweetLiked{ LikedUserID: agent.TwitterID, TweetID: item.ID, TwitterID: item.AuthorID, LikeCount: item.LikeCount, RetweetCount: item.RetweetCount, ReplyCount: item.ReplyCount, QuoteCount: item.QuoteCount, ImpressionCount: item.ImpressionCount, FullText: item.Text, PostedAt: item.CreatedAt, InReplyToUserID: item.InReplyToUserID, InReplyToTweetID: item.InReplyToTweetID, IsReply: item.IsReply, OriginalText: item.OriginalText, IsRetweet: item.IsRetweet, RepostTweetID: item.RepostTweetID, RepostText: item.RepostText, IsQuote: item.IsQuote, QuoteTweetID: item.QuoteTweetID, QuoteText: item.QuoteText, }) if err != nil { continue } } } return nil }, ) } if err != nil { return err } return nil } func (s *Service) JobScanTwitterLiked(ctx context.Context) error { err := s.JobRunCheck( ctx, "JobScanTwitterLiked", func() error { return s.ScanTwitterTweetLiked(ctx) }, ) if err != nil { return errs.NewError(err) } return nil } func (s *Service) ScanTwitterTweetByParentID(ctx context.Context, launchpad *models.Launchpad) (*twitter.TweetRecentSearch, error) { lst, err := s.SearchRecentTweetV1(ctx, fmt.Sprintf("in_reply_to_tweet_id:%s", launchpad.StartTweetId), launchpad.LastScanID, 50) if err != nil { return nil, errs.NewError(err) } if lst != nil { for _, v := range lst.LookUps { newMissionID := uint(0) daos.WithTransaction( daos.GetDBMainCtx(ctx), func(tx *gorm.DB) error { tmp := helpers.ParseStringToDateTimeTwitter(v.Tweet.CreatedAt) err = s.dao.Create(tx, &models.TwitterTweet{ TwitterID: v.Tweet.AuthorID, TweetID: v.Tweet.ID, FullText: v.Tweet.Text, PostedAt: *tmp, }) if err != nil { return errs.NewError(err) } address := helpers.ExtractEVMAddress(v.Tweet.Text) if address != "" && address != launchpad.Address { //check join member, err := s.dao.FirstLaunchpadMember(tx, map[string][]interface{}{ "twitter_id = ?": {v.Tweet.AuthorID}, "launchpad_id = ?": {launchpad.ID}, }, map[string][]interface{}{}, []string{}) if err != nil { return errs.NewError(err) } if member == nil { tier3 := models.MulBigFloats(&launchpad.MaxFundBalance.Float, numeric.NewFloatFromString("0.005")) member = &models.LaunchpadMember{ NetworkID: launchpad.NetworkID, UserAddress: strings.ToLower(address), TwitterID: v.Tweet.AuthorID, LaunchpadID: launchpad.ID, TweetID: v.Tweet.ID, TweetContent: v.Tweet.Text, Tier: models.LaunchpadTier3, MaxFundBalance: numeric.BigFloat{*tier3}, Status: models.LaunchpadMemberStatusNew, } err = s.dao.Create(tx, member) if err != nil { return errs.NewError(err) } } else { //one X join one time per launchpad return nil } toolList := fmt.Sprintf(launchpad.AgentSnapshotMission.ToolList, v.Tweet.AuthorID, s.conf.InternalApiKey, launchpad.ID, member.ID, s.conf.InternalApiKey) newMission := &models.AgentSnapshotMission{} err = copier.Copy(newMission, launchpad.AgentSnapshotMission) if err != nil { return errs.NewError(err) } newMission.ID = 0 newMission.ToolList = toolList newMission.LaunchpadMemberID = member.ID newMission.ReactMaxSteps = 2 err = s.dao.Create(tx, newMission) if err != nil { return errs.NewError(err) } newMissionID = newMission.ID } return nil }, ) if newMissionID > 0 { s.AgentSnapshotPostCreate(ctx, newMissionID, "", "") } } } return lst, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/user_srv.go ================================================ package services import ( "context" "fmt" "mime/multipart" "strings" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/daos" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/helpers" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/services/3rd/trxapi" "github.com/ethereum/go-ethereum/crypto" "github.com/google/uuid" "github.com/jinzhu/gorm" ) func (s *Service) GetUser(tx *gorm.DB, networkID uint64, address string, forUpdate bool) (*models.User, error) { address = strings.TrimSpace(address) if address == "" { return nil, errs.NewError(errs.ErrBadRequest) } user, err := s.dao.FirstUser( tx, map[string][]interface{}{ "network_id = ?": {networkID}, "address = ?": {strings.ToLower(address)}, }, map[string][]interface{}{}, false, ) if err != nil { return nil, errs.NewError(err) } if user == nil { user = &models.User{ NetworkID: networkID, Address: strings.ToLower(address), Username: uuid.NewString(), } err = s.dao.Create(tx, user) if err != nil { return nil, errs.NewError(err) } user.Username = fmt.Sprintf("user%d", user.ID) err = s.dao.Save(tx, user) if err != nil { return nil, errs.NewError(err) } } { if user.EthAddress == "" { address, err := s.CreateETHAddress(context.Background()) if err != nil { return nil, errs.NewError(err) } err = tx.Model(user).UpdateColumn("eth_address", address).Error if err != nil { return nil, errs.NewError(err) } err = tx.Model(user).UpdateColumn("tron_address", trxapi.AddrEvmToTron(address)).Error if err != nil { return nil, errs.NewError(err) } } if user.SolAddress == "" { address, err := s.CreateSOLAddress(context.Background()) if err != nil { return nil, errs.NewError(err) } err = tx.Model(user).UpdateColumn("sol_address", address).Error if err != nil { return nil, errs.NewError(err) } } } if forUpdate { user, err = s.dao.FirstUserByID( tx, user.ID, map[string][]interface{}{}, true, ) if err != nil { return nil, errs.NewError(err) } } return user, nil } func (s *Service) GetUserProfile(ctx context.Context, address string) (*models.User, error) { user, err := s.GetUser(daos.GetDBMainCtx(ctx), models.GENERTAL_NETWORK_ID, address, false) if err != nil { return nil, errs.NewError(err) } return user, nil } func (s *Service) UserUploadFile(ctx context.Context, address string, fileHeader *multipart.FileHeader) (string, error) { fileToImport, err := fileHeader.Open() if err != nil { return "", errs.NewError(err) } defer fileToImport.Close() filename := fmt.Sprintf("%s.%s", uuid.NewString(), helpers.GetFileExtension(fileHeader.Filename)) urlPath, err := s.gsClient.UploadPublicMultipartFile("imagine", filename, fileToImport, fileHeader) if err != nil { return "", errs.NewError(err) } return fmt.Sprintf("%s%s", s.conf.GsStorage.Url, urlPath), nil } func (s *Service) VerifyLoginUserByWeb3(ctx context.Context, userIP, userAgent, address, message, signature string) (string, error) { authTk := "" if !strings.HasPrefix(signature, "0x") { signature = "0x" + signature } err := helpers.VerifySignature(address, signature, message) if err != nil { return authTk, errs.NewError(err) } expireTime := int64(0) session := fmt.Sprintf("%s_%s_%s_%s_%s", userAgent, userIP, message, address, fmt.Sprintf("%d", expireTime)) sessionID := crypto.Keccak256Hash([]byte(session)) authToken := &helpers.AuthToken{ Address: address, Exp: expireTime, SessionID: sessionID.Hex(), } encryptedAuthToken, err := helpers.EncryptAndSignAuthToken(*authToken, s.conf.EncryptAuthenKey) if err != nil { return "", err } return fmt.Sprintf("TK1 %s", encryptedAuthToken), nil } func (s *Service) GetListUserTransactions(ctx context.Context, userAddress string, typeStr string, page, limit int) ([]*models.UserTransaction, uint, error) { user, err := s.GetUser(daos.GetDBMainCtx(ctx), models.GENERTAL_NETWORK_ID, userAddress, false) if err != nil { return nil, 0, errs.NewError(err) } filters := map[string][]interface{}{ "user_id = ?": {user.ID}, "status = ?": {models.UserTransactionStatusDone}, } if typeStr != "" { filters["type in (?)"] = []interface{}{strings.Split(typeStr, ",")} } ms, _, err := s.dao.FindUserTransaction4Page( daos.GetDBMainCtx(ctx), filters, map[string][]interface{}{}, []string{"id desc"}, page, limit, ) if err != nil { return nil, 0, errs.NewError(err) } return ms, 0, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/vibe_srv.go ================================================ package services import ( "context" "fmt" "strings" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/daos" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/errs" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/models" ) func (s *Service) AddVibeWhiteList(ctx context.Context, email string) error { whiteList := &models.VibeWhiteList{ Email: email, } return s.dao.Create(daos.GetDBMainCtx(ctx), whiteList) } func (s *Service) ValidateReferralCode(ctx context.Context, refCode, userAddress string) (bool, error) { if strings.EqualFold(refCode, "eaieai") { return true, nil } //check if refCode is valid vibeRefcode, err := s.dao.FirstVibeReferralCode(daos.GetDBMainCtx(ctx), map[string][]interface{}{"ref_code = ?": {refCode}}, nil, nil) if err != nil { return false, errs.NewError(err) } if vibeRefcode == nil { return false, errs.NewError(errs.ErrBadRequest) } if vibeRefcode.Used && !strings.EqualFold(vibeRefcode.UserAddress, userAddress) { return false, errs.NewError(errs.ErrReferralCodeUsed) } vibeRefcode, _ = s.dao.FirstVibeReferralCodeByID(daos.GetDBMainCtx(ctx), vibeRefcode.ID, nil, true) vibeRefcode.Used = true vibeRefcode.UserAddress = strings.ToLower(userAddress) err = s.dao.Save(daos.GetDBMainCtx(ctx), vibeRefcode) if err != nil { return false, errs.NewError(err) } return true, nil } func (s *Service) GetVibeDashboard(ctx context.Context, includeHidden *bool, contractAddresses []string, userAddress string, networkID uint64, agentTypes []int, search string, ids, exludeIds []uint, categoryIds []string, sortListStr []string, page, limit int) ([]*models.AgentInfo, uint, error) { selected := []string{ `ifnull(agent_infos.reply_latest_time, agent_infos.updated_at) reply_latest_time`, "agent_infos.*", `ifnull((cast(( memes.price - memes.price_last24h) / memes.price_last24h * 100 as decimal(20, 2))), ifnull(agent_token_infos.price_change,0)) meme_percent`, `cast(case when ifnull(agent_token_infos.usd_market_cap, 0) then ifnull(agent_token_infos.usd_market_cap, 0) when ifnull(memes.price_usd*memes.total_suply, 0) > 0 then ifnull(memes.price_usd*memes.total_suply, 0) end as decimal(36, 18)) meme_market_cap`, `ifnull(memes.price_usd, agent_token_infos.price_usd) meme_price`, `ifnull(memes.volume_last24h*memes.price_usd, agent_token_infos.volume_last24h) meme_volume_last24h`, } joinFilters := map[string][]any{ ` left join memes on agent_infos.id = memes.agent_info_id and memes.deleted_at IS NULL left join agent_token_infos on agent_token_infos.id = agent_infos.token_info_id `: {}, } filters := map[string][]any{ ` agent_infos.agent_contract_address is not null and agent_infos.agent_contract_address != "" `: {}, } if search != "" { search = fmt.Sprintf("%%%s%%", strings.ToLower(search)) filters[` LOWER(agent_infos.token_name) like ? or LOWER(agent_infos.token_symbol) like ? or LOWER(agent_infos.token_address) like ? or LOWER(agent_infos.twitter_username) like ? or LOWER(agent_infos.agent_name) like ? or LOWER(agent_infos.display_name) like ? `] = []any{search, search, search, search, search, search} } //filter agent type if len(agentTypes) > 0 { filters["agent_infos.agent_type in (?)"] = []any{agentTypes} } else { filters["agent_infos.agent_type in (?)"] = []any{[]models.AgentInfoAgentType{ models.AgentInfoAgentTypeModel, models.AgentInfoAgentTypeModelOnline, models.AgentInfoAgentTypeJs, models.AgentInfoAgentTypePython, models.AgentInfoAgentTypeInfa, models.AgentInfoAgentTypeCustomUi, models.AgentInfoAgentTypeCustomPrompt, }} } //filter contract address if len(contractAddresses) > 0 { filters["agent_infos.agent_contract_address in (?)"] = []any{contractAddresses} } if networkID == models.SOLANA_CHAIN_ID_OLD { networkID = models.SOLANA_CHAIN_ID } if networkID > 0 { if networkID == models.SHARDAI_CHAIN_ID || networkID == models.SOLANA_CHAIN_ID { filters["agent_infos.network_id = ? or agent_infos.token_network_id = ? or agent_infos.id = 763"] = []any{networkID, networkID} } else if networkID == models.HERMES_CHAIN_ID { filters["agent_infos.network_id = ? or agent_infos.token_network_id = ?"] = []any{networkID, networkID} filters["agent_infos.id != 763"] = []any{} } else if networkID == models.BASE_CHAIN_ID { filters["agent_infos.network_id = ? or agent_infos.token_network_id = ?"] = []any{networkID, networkID} filters["agent_infos.id != 763"] = []any{} } else if networkID == models.ETHEREUM_CHAIN_ID { listEtherModels := []uint64{models.ETHEREUM_CHAIN_ID, models.BASE_CHAIN_ID, models.APE_CHAIN_ID, models.ABSTRACT_TESTNET_CHAIN_ID, models.ARBITRUM_CHAIN_ID} filters["agent_infos.network_id in (?) or agent_infos.token_network_id in (?)"] = []any{listEtherModels, listEtherModels} } else { filters["agent_infos.network_id = ? or agent_infos.token_network_id = ?"] = []any{networkID, networkID} } } if len(ids) > 0 { filters["agent_infos.id in (?)"] = []any{ids} } else { if includeHidden == nil || !(*includeHidden) { filters["agent_infos.is_public = 1"] = []any{} } } if len(exludeIds) > 0 { filters["agent_infos.id not in (?)"] = []any{exludeIds} } if len(categoryIds) > 0 { filters["agent_infos.agent_category_id in (?)"] = []any{categoryIds} } if userAddress != "" { selected = append(selected, "ifnull(agent_utility_recent_chats.updated_at, now() - interval 100 day) recent_chat_time") joinFilters = map[string][]any{ ` left join memes on agent_infos.id = memes.agent_info_id and memes.deleted_at IS NULL left join agent_token_infos on agent_token_infos.id = agent_infos.token_info_id left join agent_utility_recent_chats on agent_utility_recent_chats.agent_info_id = agent_infos.id and agent_utility_recent_chats.address = ? `: {strings.ToLower(userAddress)}, } } else { selected = append(selected, "now() recent_chat_time") } sortDefault := "installed_count desc" if len(sortListStr) > 0 { sortDefault = strings.Join(sortListStr, ", ") } agents, err := s.dao.FindAgentInfoJoinSelect( daos.GetDBMainCtx(ctx), selected, joinFilters, filters, map[string][]any{ "Meme": {`deleted_at IS NULL and status not in ("created", "pending")`}, "TokenInfo": {}, "AgentCategory": {}, }, []string{sortDefault}, page, limit, ) if err != nil { return nil, 0, errs.NewError(err) } return agents, 0, nil } func (s *Service) GetVibeDashboardsDetail(ctx context.Context, agentID string) (*models.AgentInfo, error) { selected := []string{ `ifnull(agent_infos.reply_latest_time, agent_infos.updated_at) reply_latest_time`, "agent_infos.*", `ifnull((cast(( memes.price - memes.price_last24h) / memes.price_last24h * 100 as decimal(20, 2))), ifnull(agent_token_infos.price_change,0)) meme_percent`, `cast(case when ifnull(agent_token_infos.usd_market_cap, 0) then ifnull(agent_token_infos.usd_market_cap, 0) when ifnull(memes.price_usd*memes.total_suply, 0) > 0 then ifnull(memes.price_usd*memes.total_suply, 0) end as decimal(36, 18)) meme_market_cap`, `ifnull(memes.price_usd, agent_token_infos.price_usd) meme_price`, `ifnull(memes.volume_last24h*memes.price_usd, agent_token_infos.volume_last24h) meme_volume_last24h`, } joinFilters := map[string][]any{ ` left join memes on agent_infos.id = memes.agent_info_id and memes.deleted_at IS NULL left join agent_token_infos on agent_token_infos.id = agent_infos.token_info_id `: {}, } filters := map[string][]any{ ` agent_infos.agent_id = ? or agent_infos.id = ? or (agent_infos.token_address = ? and agent_infos.token_address != "") `: {agentID, agentID, agentID}, } agents, err := s.dao.FindAgentInfoJoinSelect( daos.GetDBMainCtx(ctx), selected, joinFilters, filters, map[string][]any{ "Meme": {`deleted_at IS NULL and status not in ("created", "pending")`}, "TokenInfo": {}, "AgentCategory": {}, }, []string{}, 1, 1, ) if err != nil { return nil, errs.NewError(err) } if len(agents) == 0 { return nil, errs.NewError(errs.ErrAgentNotFound) } return agents[0], nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/services/video_magic_prompt.go ================================================ package services import ( "context" "fmt" ) func (s *Service) GetVideoMagicPromptFromImage(ctx context.Context, userPrompt string, imageUrl string) (string, error) { descriptionImage, err := s.GetDescriptionImage(ctx, imageUrl) if err != nil { return "", err } input := map[string]interface{}{ "model": "Llama3.3", "messages": []map[string]interface{}{ map[string]interface{}{ "role": "system", "content": "You are a helpful assistant specializing in creating smooth and engaging short video content.", }, map[string]interface{}{ "role": "user", "content": "Describe this image.", }, map[string]interface{}{ "role": "assistant", "content": descriptionImage, }, map[string]interface{}{ "role": "user", "content": fmt.Sprintf("I would like to create a short video based on my request: \\n%v \\n Prioritize my request, even if it contrasts with the content of the image. For example, if the image features characters laughing and having fun, my request should be to create a video where they are crying or fighting. The video should exclusively show them crying or fighting. Just provide the prompt.", userPrompt), }, }, } return s.openais["Agent"].CallDirectlyEternalLLMV2(input, s.conf.KnowledgeBaseConfig.DirectServiceUrl) } func (s *Service) GetDescriptionImage(ctx context.Context, imageUrl string) (string, error) { input := map[string]interface{}{ "model": "Qwen/Qwen2.5-VL-7B-Instruct", "messages": []map[string]interface{}{ map[string]interface{}{ "role": "system", "content": []map[string]interface{}{ map[string]interface{}{ "type": "text", "text": "You are a prompt optimization specialist whose goal is to rewrite the user's input prompts into high-quality English prompts by referring to the details of the user's input images, making them more complete and expressive while maintaining the original meaning. You need to integrate the content of the user's photo with the input prompt for the rewrite, strictly adhering to the formatting of the examples provided.\\nTask Requirements:\\n1. For overly brief user inputs, reasonably infer and supplement details without changing the original meaning, making the image more complete and visually appealing;\\n2. Improve the characteristics of the main subject in the user's description (such as appearance, expression, quantity, ethnicity, posture, etc.), rendering style, spatial relationships, and camera angles;\\n3. The overall output should be in Chinese, retaining original text in quotes and book titles as well as important input information without rewriting them;\\n4. The prompt should match the user’s intent and provide a precise and detailed style description. If the user has not specified a style, you need to carefully analyze the style of the user's provided photo and use that as a reference for rewriting;\\n5. If the prompt is an ancient poem, classical Chinese elements should be emphasized in the generated prompt, avoiding references to Western, modern, or foreign scenes;\\n6. You need to emphasize movement information in the input and different camera angles;\\n7. Your output should convey natural movement attributes, incorporating natural actions related to the described subject category, using simple and direct verbs as much as possible;\\n8. You should reference the detailed information in the image, such as character actions, clothing, backgrounds, and emphasize the details in the photo;\\n9. Control the rewritten prompt to around 80-100 words.\\n10. No matter what language the user inputs, you must always output in English.\\nExample of the rewritten English prompt:\\n1. A Japanese fresh film-style photo of a young East Asian girl with double braids sitting by the boat. The girl wears a white square collar puff sleeve dress, decorated with pleats and buttons. She has fair skin, delicate features, and slightly melancholic eyes, staring directly at the camera. Her hair falls naturally, with bangs covering part of her forehead. She rests her hands on the boat, appearing natural and relaxed. The background features a blurred outdoor scene, with hints of blue sky, mountains, and some dry plants. The photo has a vintage film texture. A medium shot of a seated portrait.\\n2. An anime illustration in vibrant thick painting style of a white girl with cat ears holding a folder, showing a slightly dissatisfied expression. She has long dark purple hair and red eyes, wearing a dark gray skirt and a light gray top with a white waist tie and a name tag in bold Chinese characters that says \\\"紫阳\\\" (Ziyang). The background has a light yellow indoor tone, with faint outlines of some furniture visible. A pink halo hovers above her head, in a smooth Japanese cel-shading style. A close-up shot from a slightly elevated perspective.\\n3. CG game concept digital art featuring a huge crocodile with its mouth wide open, with trees and thorns growing on its back. The crocodile's skin is rough and grayish-white, resembling stone or wood texture. Its back is lush with trees, shrubs, and thorny protrusions. With its mouth agape, the crocodile reveals a pink tongue and sharp teeth. The background features a dusk sky with some distant trees, giving the overall scene a dark and cold atmosphere. A close-up from a low angle.\\n4. In the style of an American drama promotional poster, Walter White sits in a metal folding chair wearing a yellow protective suit, with the words \\\"Breaking Bad\\\" written in sans-serif English above him, surrounded by piles of dollar bills and blue plastic storage boxes. He wears glasses, staring forward, dressed in a yellow jumpsuit, with his hands resting on his knees, exuding a calm and confident demeanor. The background shows an abandoned, dim factory with light filtering through the windows. There’s a noticeable grainy texture. A medium shot with a straight-on close-up of the character.\\nDirectly output the rewritten English text.", }, }, }, map[string]interface{}{ "role": "user", "content": []map[string]interface{}{ map[string]interface{}{ "type": "text", "text": "Describe this image.", }, map[string]interface{}{ "type": "image_url", "image_url": map[string]interface{}{ "url": imageUrl, }, }, }, }, }, } return s.openais["Agent"].CallDirectlyEternalLLMV2(input, s.conf.KnowledgeBaseConfig.DirectServiceUrl) } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/types/numeric/address.go ================================================ package numeric import ( "database/sql/driver" "errors" "fmt" "strings" "github.com/eternalai-org/eternal-ai/agent-as-a-service/agent-orchestration/backend/helpers" "github.com/ethereum/go-ethereum/common" ) type AddressHash struct { data []byte } func NewAddressHashFromHex(address string) *AddressHash { return NewAddressHashFromBytes(helpers.HexToAddress(address).Bytes()) } func NewAddressHashFromBytes(data []byte) *AddressHash { return &AddressHash{ data: copyData(data), } } func (n *AddressHash) Hex() string { return common.BytesToAddress(n.data).Hex() } func (n *AddressHash) Bytes() []byte { return common.BytesToAddress(n.data).Bytes() } func (n *AddressHash) UnmarshalJSON(b []byte) error { s := string(b) if s == "null" { n = nil return nil } *n = *NewAddressHashFromBytes(common.Hex2Bytes(strings.Trim(s, `"`))) return nil } func (n *AddressHash) MarshalJSON() ([]byte, error) { if n == nil { return []byte("null"), nil } return []byte(fmt.Sprintf(`"%s"`, common.BytesToAddress(n.data).Hex())), nil } func (n *AddressHash) Scan(src interface{}) error { if src == nil { n = nil return nil } data, ok := src.([]byte) if !ok { return errors.New("invalid data type") } *n = *NewAddressHashFromBytes(common.BytesToAddress(data).Bytes()) return nil } func (n AddressHash) Value() (driver.Value, error) { return n.Bytes(), nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/types/numeric/bigints.go ================================================ package numeric import ( "database/sql/driver" "errors" "fmt" "math/big" "strings" ) type BigInts []*big.Int func (n *BigInts) Uint64s() []*big.Int { return []*big.Int(*n) } func (n *BigInts) String() string { strs := []string{} for _, num := range *n { strs = append(strs, num.Text(10)) } str := "" if len(strs) > 0 { str = strings.Join(strs, ",") } return fmt.Sprintf(`{%s}`, str) } func (n *BigInts) UnmarshalJSON(b []byte) error { s := string(b) if s == "null" { n = nil return nil } s = strings.Trim(s, ` `) s = strings.Trim(s, `"`) s = strings.Trim(s, `[`) s = strings.Trim(s, `]`) s = strings.Trim(s, `{`) s = strings.Trim(s, `}`) nums := []*big.Int{} if len(s) > 0 { strs := strings.Split(s, ",") for _, str := range strs { str = strings.TrimSpace(str) str = strings.Trim(str, `"`) num, ok := big.NewInt(0).SetString(str, 10) if !ok { return errors.New("invalid data type") } nums = append(nums, num) } } *n = BigInts(nums) return nil } func (n *BigInts) MarshalJSON() ([]byte, error) { if n == nil { return []byte("null"), nil } strs := []string{} for _, num := range *n { strs = append(strs, fmt.Sprintf(`"%s"`, num.Text(10))) } str := "" if len(strs) > 0 { str = strings.Join(strs, ",") } return []byte(fmt.Sprintf(`[%s]`, str)), nil } func (n *BigInts) Scan(src interface{}) error { if src == nil { n = nil return nil } data, ok := src.([]byte) if !ok { return errors.New("invalid data type") } s := string(data) s = strings.Trim(s, ` `) s = strings.Trim(s, `"`) s = strings.Trim(s, `{`) s = strings.Trim(s, `}`) nums := []*big.Int{} if len(s) > 0 { strs := strings.Split(s, ",") for _, str := range strs { str = strings.TrimSpace(str) num, ok := big.NewInt(0).SetString(str, 10) if !ok { return errors.New("invalid data type") } nums = append(nums, num) } } *n = BigInts(nums) return nil } func (n BigInts) Value() (driver.Value, error) { return n.String(), nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/types/numeric/common.go ================================================ package numeric func copyData(data []byte) []byte { newData := make([]byte, len(data)) copy(newData, data) return newData } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/types/numeric/hash.go ================================================ package numeric import ( "database/sql/driver" "errors" "fmt" "strings" "github.com/ethereum/go-ethereum/common" ) type Hash struct { data []byte } func NewHashFromHex(hash string) *Hash { return NewHashFromBytes(common.HexToHash(hash).Bytes()) } func NewHashFromBytes(data []byte) *Hash { return &Hash{ data: copyData(data), } } func (n *Hash) Hex() string { return common.BytesToHash(n.data).Hex() } func (n *Hash) Bytes() []byte { return common.BytesToHash(n.data).Bytes() } func (n *Hash) UnmarshalJSON(b []byte) error { s := string(b) if s == "null" { n = nil return nil } *n = *NewHashFromBytes(common.Hex2Bytes(strings.Trim(s, `"`))) return nil } func (n *Hash) MarshalJSON() ([]byte, error) { if n == nil { return []byte("null"), nil } return []byte(fmt.Sprintf(`"%s"`, common.BytesToHash(n.data).Hex())), nil } func (n *Hash) Scan(src interface{}) error { if src == nil { n = nil return nil } data, ok := src.([]byte) if !ok { return errors.New("invalid data type") } *n = *NewHashFromBytes(common.BytesToHash(data).Bytes()) return nil } func (n Hash) Value() (driver.Value, error) { return n.Bytes(), nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/types/numeric/hex.go ================================================ package numeric import ( "database/sql/driver" "errors" "fmt" "strings" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" ) type Hex struct { data []byte } func NewHexFromHex(hash string) *Hex { return NewHexFromBytes(common.HexToHash(hash).Bytes()) } func NewHexFromBytes(data []byte) *Hex { return &Hex{ data: copyData(data), } } func (n *Hex) Hex() string { return hexutil.Encode(n.data) } func (n *Hex) Bytes() []byte { return copyData(n.data) } func (n *Hex) UnmarshalJSON(b []byte) error { s := string(b) if s == "null" { n = nil return nil } data, err := hexutil.Decode(strings.Trim(s, `"`)) if err != nil { return err } *n = *NewHexFromBytes(data) return nil } func (n *Hex) MarshalJSON() ([]byte, error) { if n == nil { return []byte("null"), nil } return []byte(fmt.Sprintf(`"%s"`, hexutil.Encode(n.data))), nil } func (n *Hex) Scan(src interface{}) error { if src == nil { n = nil return nil } var data string switch v := src.(type) { case []byte: data = hexutil.Encode(v) case string: data = v default: return errors.New("invalid data type") } dataN, err := hexutil.Decode(data) if err != nil { return err } *n = *NewHexFromBytes(dataN) return nil } func (n Hex) Value() (driver.Value, error) { return n.Bytes(), nil } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/types/numeric/numeric.go ================================================ package numeric import ( "database/sql/driver" "errors" "fmt" "math/big" "strings" "github.com/shopspring/decimal" ) func BigFloat2Text(n *big.Float) string { v := n.Text('f', 64) if strings.Contains(v, ".") { v = strings.TrimRight(v, "0") v = strings.TrimRight(v, ".") } return v } func BigFloat2TextDecimals(n *big.Float, decimals int) string { v := n.Text('f', 64) if strings.Contains(v, ".") { v = strings.TrimRight(v, "0") v = strings.TrimRight(v, ".") } if strings.Contains(v, ".") { vs := strings.Split(v, ".") vd := vs[1] if len(vd) > decimals { vd = vd[0:decimals] } v = fmt.Sprintf("%s.%s", vs[0], vd) } v = strings.TrimRight(v, "0") return v } type Decimal struct { decimal.Decimal } func (n *Decimal) ToDecimal() decimal.Decimal { return n.Decimal } func (n *Decimal) UnmarshalJSON(b []byte) error { s := string(b) if s == "null" { n = nil return nil } s = strings.Trim(s, `"`) d, err := decimal.NewFromString(s) if err != nil { return err } *n = Decimal{ d, } return nil } func (n *Decimal) MarshalJSON() ([]byte, error) { if n == nil { return []byte("null"), nil } s := n.Decimal.String() return []byte(fmt.Sprintf(`"%s"`, s)), nil } func (n *Decimal) Scan(src interface{}) error { if src == nil { n = nil return nil } b, ok := src.([]byte) if !ok { return errors.New("invalid data type") } s := string(b) if s == "" { n = nil return nil } d, err := decimal.NewFromString(s) if err != nil { return err } *n = Decimal{ d, } return nil } func (n Decimal) Value() (driver.Value, error) { return n.Decimal.String(), nil } // BigFloat func NewFloatFromString(s string) *big.Float { if s == "" { s = "0" } n := BigFloat{ *big.NewFloat(0), } err := n.UnmarshalJSON([]byte(s)) if err != nil { panic(err) } return &n.Float } func NewBigFloatFromString(s string) BigFloat { if s == "" { s = "0" } n := BigFloat{ *big.NewFloat(0), } err := n.UnmarshalJSON([]byte(s)) if err != nil { panic(err) } return n } func NewBigFloatFromFloat(value *big.Float) BigFloat { n := BigFloat{ *value, } return n } type BigFloat struct { big.Float } func (n *BigFloat) BigFloat() *big.Float { return &n.Float } func (n *BigFloat) UnmarshalJSON(b []byte) error { s := string(b) if s == "null" { n = nil return nil } s = strings.Trim(s, `"`) m, ok := big.NewFloat(0).SetPrec(1024).SetString(s) if !ok { return errors.New("invalid data type") } m = m.SetPrec(1024) *n = BigFloat{ *m, } return nil } func (n *BigFloat) MarshalJSON() ([]byte, error) { if n == nil { return []byte("null"), nil } return []byte(fmt.Sprintf(`"%s"`, BigFloat2Text(&n.Float))), nil } func (n *BigFloat) Scan(src interface{}) error { if src == nil { n = nil return nil } b, ok := src.([]byte) if !ok { return errors.New("invalid data type") } s := string(b) if s == "" { n = nil return nil } m, ok := big.NewFloat(0).SetPrec(1024).SetString(s) if !ok { return errors.New("invalid data type") } m.SetPrec(1024) *n = BigFloat{ *m, } return nil } func (n BigFloat) Value() (driver.Value, error) { return BigFloat2Text(&n.Float), nil } func (n BigFloat) ToString() string { return BigFloat2Text(&n.Float) } func (n BigFloat) ToStringWithDecimals(decimals int) string { return BigFloat2TextDecimals(&n.Float, decimals) } // BigFloat type BigInt struct { big.Int } func NewBigIntFromInt(value *big.Int) BigInt { n := BigInt{ *value, } return n } func (n *BigInt) BigInt() *big.Int { return &n.Int } func (n *BigInt) UnmarshalJSON(b []byte) error { s := string(b) if s == "null" { n = nil return nil } s = strings.Trim(s, `"`) m, ok := big.NewInt(0).SetString(s, 10) if !ok { return errors.New("invalid data type") } *n = BigInt{ *m, } return nil } func (n *BigInt) MarshalJSON() ([]byte, error) { if n == nil { return []byte("null"), nil } s := n.String() return []byte(fmt.Sprintf(`"%s"`, s)), nil } func (n *BigInt) Scan(src interface{}) error { if src == nil { n = nil return nil } b, ok := src.([]byte) if !ok { return errors.New("invalid data type") } s := string(b) if s == "" { n = nil return nil } m, ok := big.NewInt(0).SetString(s, 10) if !ok { return errors.New("invalid data type") } *n = BigInt{ *m, } return nil } func (n BigInt) Value() (driver.Value, error) { return n.String(), nil } func ToBigInts(nums []*big.Int) []BigInt { rets := []BigInt{} for _, v := range nums { rets = append(rets, NewBigIntFromInt(v)) } return rets } ================================================ FILE: agent-as-a-service/agent-orchestration/backend/types/numeric/quote_uint64s.go ================================================ package numeric import ( "database/sql/driver" "errors" "fmt" "strconv" "strings" ) type QuoteUint64s []uint64 func (n *QuoteUint64s) Uint64s() []uint64 { return []uint64(*n) } func (n *QuoteUint64s) String() string { strs := []string{} for _, num := range *n { strs = append(strs, strconv.FormatUint(num, 10)) } str := "" if len(strs) > 0 { str = strings.Join(strs, ",") } return fmt.Sprintf(`{%s}`, str) } func (n *QuoteUint64s) UnmarshalJSON(b []byte) error { s := string(b) if s == "null" { n = nil return nil } s = strings.Trim(s, ` `) s = strings.Trim(s, `"`) s = strings.Trim(s, `{`) s = strings.Trim(s, `}`) nums := []uint64{} if len(s) > 0 { strs := strings.Split(s, ",") for _, str := range strs { str = strings.TrimSpace(str) num, err := strconv.ParseUint(str, 10, 64) if err != nil { return err } nums = append(nums, num) } } *n = QuoteUint64s(nums) return nil } func (n *QuoteUint64s) MarshalJSON() ([]byte, error) { if n == nil { return []byte("null"), nil } strs := []string{} for _, num := range *n { strs = append(strs, strconv.FormatUint(num, 10)) } str := "" if len(strs) > 0 { str = strings.Join(strs, ",") } return []byte(fmt.Sprintf(`{%s}`, str)), nil } func (n *QuoteUint64s) Scan(src interface{}) error { if src == nil { n = nil return nil } data, ok := src.([]byte) if !ok { return errors.New("invalid data type") } s := string(data) s = strings.Trim(s, ` `) s = strings.Trim(s, `"`) s = strings.Trim(s, `{`) s = strings.Trim(s, `}`) nums := []uint64{} if len(s) > 0 { strs := strings.Split(s, ",") for _, str := range strs { str = strings.TrimSpace(str) num, err := strconv.ParseUint(str, 10, 64) if err != nil { return err } nums = append(nums, num) } } *n = QuoteUint64s(nums) return nil } func (n QuoteUint64s) Value() (driver.Value, error) { return n.String(), nil } ================================================ FILE: agent-as-a-service/agent-orchestration/core/cmd/api/main.go ================================================ package main import ( "crypto/tls" "fmt" "log" "net/http" "os" "runtime/debug" "github.com/eternalai-org/eternal-ai/agent-orchestration/core/logger" "github.com/jinzhu/gorm" _ "github.com/jinzhu/gorm/dialects/mysql" "github.com/spf13/viper" "github.com/eternalai-org/eternal-ai/agent-orchestration/core/common/database" "github.com/eternalai-org/eternal-ai/agent-orchestration/core/server" _walletHttpDeliver "github.com/eternalai-org/eternal-ai/agent-orchestration/core/modules/wallet/delivery/http" _walletRepo "github.com/eternalai-org/eternal-ai/agent-orchestration/core/modules/wallet/repository/mysql" _walletUcase "github.com/eternalai-org/eternal-ai/agent-orchestration/core/modules/wallet/usecase" ) func init() { http.DefaultTransport.(*http.Transport).TLSClientConfig = &tls.Config{InsecureSkipVerify: true} viper.SetConfigFile(`config/config.json`) err := viper.ReadInConfig() if err != nil { panic(err) } if viper.GetBool(`debug`) { fmt.Println("Service RUN on DEBUG mode...") } } func main() { defer func() { if err := recover(); err != nil { errCaptured := fmt.Errorf("%s\n%s", err, string(debug.Stack())) log.Println(errCaptured) } }() // new db connection dbURL := viper.GetString(`db_url`) if dbURL == "" { dbURL = os.Getenv("BD_URL") } // new db connection var migrateCoreFunc func(db *gorm.DB) error if os.Getenv("DEV") != "true" { migrateCoreFunc = database.MigrateCore } dbConn, err := database.Init(dbURL, migrateCoreFunc, 1, 5, viper.GetBool(`debug`)) if err != nil { panic(fmt.Sprintf("failed to connect database: %s", err.Error())) } defer func() { err := dbConn.Close() if err != nil { log.Fatal(err) } }() defer func() { if err := recover(); err != nil { errCaptured := fmt.Errorf("%s\n%s", err, string(debug.Stack())) log.Println(errCaptured) return } }() // repositories // -- Wallet wr := _walletRepo.NewMysqlWalletRepository(dbConn) // usecases // -- Wallet wu := _walletUcase.NewWalletUsecase(wr) s := server.NewHTTPServer(logger.Logger()) _walletHttpDeliver.NewWalletHandler(s, wu) serverAddress := viper.GetString(`port`) if err := s.Engine().Run(serverAddress); err != nil { log.Fatal(err) } } ================================================ FILE: agent-as-a-service/agent-orchestration/core/common/database/database.go ================================================ package database import ( "github.com/eternalai-org/eternal-ai/agent-orchestration/core/domain" "github.com/jinzhu/gorm" "github.com/pkg/errors" ) // Init : config func Init(dbURL string, migrateFunc func(db *gorm.DB) error, idleNum int, openNum int, debug bool) (*gorm.DB, error) { dbConn, err := gorm.Open("mysql", dbURL) if debug { dbConn.LogMode(true) } if err != nil { return nil, errors.Wrap(err, "gorm.Open") } dbConn = dbConn.Set("gorm:save_associations", false) dbConn = dbConn.Set("gorm:association_save_reference", false) dbConn.DB().SetMaxIdleConns(idleNum) dbConn.DB().SetMaxOpenConns(openNum) if migrateFunc != nil { err = migrateFunc(dbConn) if err != nil { return dbConn, err } } return dbConn, nil } func MigrateCore(db *gorm.DB) error { allTables := []interface{}{ (*domain.Wallet)(nil), } if err := db.AutoMigrate(allTables...).Error; err != nil { return errors.Wrap(err, "db.AutoMigrate") } return nil } ================================================ FILE: agent-as-a-service/agent-orchestration/core/config/config.json.sample ================================================ { "env": "production", "debug": false, "port": ":9090", "db_url": "", "wallet_salt": "" } ================================================ FILE: agent-as-a-service/agent-orchestration/core/domain/errors.go ================================================ package domain // Error used for custom error response type Error struct { Code int Message string } func (e Error) Error() string { return e.Message } // ErrorWithMessage ... func ErrorWithMessage(e *Error, message string) *Error { return &Error{ Code: e.Code, Message: message, } } var ( // user api errors // ErrInvalidEmail ... ErrInvalidEmail = &Error{Code: -1000, Message: "invalid email"} // ErrInvalidPassword ... ErrInvalidPassword = &Error{Code: -1001, Message: "invalid password"} // ErrInvalidUserType ... ErrInvalidUserType = &Error{Code: -1002, Message: "invalid user type"} // ErrPasswordMismatch ... ErrPasswordMismatch = &Error{Code: -1003, Message: "password and confirm password must match"} // ErrEmailNotExists ... ErrEmailNotExists = &Error{Code: -1004, Message: "email doesn't exist"} // ErrEmailAlreadyExists ... ErrEmailAlreadyExists = &Error{Code: -1005, Message: "email already exists"} // ErrInvalidCredentials ... ErrInvalidCredentials = &Error{Code: -1006, Message: "invalid credentials"} // ErrInvalidVerificationToken ... ErrInvalidVerificationToken = &Error{Code: -1007, Message: "invalid verification token"} // ErrInactiveAccount ... ErrInactiveAccount = &Error{Code: -1008, Message: "your account is inactive"} // ErrMissingPubKey ... ErrMissingPubKey = &Error{Code: -1009, Message: "public key is required for lender user"} // ErrSendCodeFailed ... ErrSendCodeFailed = &Error{Code: -1010, Message: "Send code fail"} // ErrPhoneIsInvalid ... ErrPhoneIsInvalid = &Error{Code: -1011, Message: "Phone code invalid"} // ErrUserInfoPrimetrustIsInvalid ... ErrUserInfoPrimetrustIsInvalid = &Error{Code: -1012, Message: "User info is invalid for KYC pre-validate"} // ErrUserNotEnoughPrimetrustInfo ... ErrUserNotEnoughPrimetrustInfo = &Error{Code: -1013, Message: "User info is not enough to verify KYC"} // ErrUserInvalidToken ... ErrUserInvalidToken = &Error{Code: -1014, Message: "Token is invalid"} // ErrUserNotFound ... ErrUserNotFound = &Error{Code: -1015, Message: "User is not found"} // ErrUserBannedAlready ... ErrUserBannedAlready = &Error{Code: -1016, Message: "User is banned already"} // ErrOldPasswordSame ... ErrOldPasswordSame = &Error{Code: -1017, Message: "New password should not be same as old password"} // ErrPasswordLength ... ErrPasswordLength = &Error{Code: -1018, Message: "Your password must be between 8 and 30 characters"} // ErrUserBankInforInvalid ... ErrUserBankInforInvalid = &Error{Code: -1019, Message: "User bank infor invalid"} // ErrUserBankAccountExisted ... ErrUserBankAccountExisted = &Error{Code: -1020, Message: "Bank account has existed already!"} // ErrUserWalletExisted ... ErrUserWalletExisted = &Error{Code: -1021, Message: "User wallet has existed already!"} // ErrUserWalletSourceInvalid ... ErrUserWalletSourceInvalid = &Error{Code: -1022, Message: "Source is invalid!"} // ErrUserWalletGenerateEthereumFailed ... ErrUserWalletGenerateEthereumFailed = &Error{Code: -1023, Message: "Cannot generate ethereum wallet."} // ErrUserWalletGenerateBitcoinFailed ... ErrUserWalletGenerateBitcoinFailed = &Error{Code: -1024, Message: "Cannot generate bitcoin wallet."} // ErrUserDocumentInvalidName ... ErrUserDocumentInvalidName = &Error{Code: -1025, Message: "Please double check your document name."} // ErrUserDocumentCannotChange ... ErrUserDocumentCannotChange = &Error{Code: -1026, Message: "You cannot change KYC information. Please contact admin for support."} // ErrUserFirstNameInvalid ... ErrUserFirstNameInvalid = &Error{Code: -1027, Message: "FirstName is invalid"} // ErrUserLastNameInvalid ... ErrUserLastNameInvalid = &Error{Code: -1028, Message: "LastName is invalid"} // ErrUserDOBInvalid ... ErrUserDOBInvalid = &Error{Code: -1029, Message: "DOB is invalid"} // ErrUserTaxCountryInvalid ... ErrUserTaxCountryInvalid = &Error{Code: -1030, Message: "TaxCountry is invalid"} // ErrUserTaxIDNumberInvalid ... ErrUserTaxIDNumberInvalid = &Error{Code: -1031, Message: "TaxIDNumber is invalid"} // ErrUserAddress1Invalid ... ErrUserAddress1Invalid = &Error{Code: -1032, Message: "Address1 is invalid"} // ErrUserAddressCityInvalid ... ErrUserAddressCityInvalid = &Error{Code: -1033, Message: "AddressCity is invalid"} // ErrUserAddressRegionInvalid ... ErrUserAddressRegionInvalid = &Error{Code: -1034, Message: "AddressRegion is invalid"} // ErrUserAddressPostalCodeInvalid ... ErrUserAddressPostalCodeInvalid = &Error{Code: -1035, Message: "AddressPostalCode is invalid"} // ErrUserAddressCountryInvalid ... ErrUserAddressCountryInvalid = &Error{Code: -1036, Message: "AddressCountry is invalid"} // ErrUserPhoneNumberInvalid ... ErrUserPhoneNumberInvalid = &Error{Code: -1037, Message: "PhoneNumber is invalid"} // ErrUserDocumentInvalid ... ErrUserDocumentInvalid = &Error{Code: -1038, Message: "UserDocument is invalid"} // ErrUserSocialInvalidType ... ErrUserSocialInvalidType = &Error{Code: -1039, Message: "Social type is invalid"} // ErrUserNotVerificationEmailLevel ... ErrUserNotVerificationEmailLevel = &Error{Code: -1040, Message: "This user need verify email first"} // ErrInterestRateInvalid ... ErrInterestRateInvalid = &Error{Code: -1041, Message: "Interest rate is invalid"} // ErrCollateralThresholdInvalid ... ErrCollateralThresholdInvalid = &Error{Code: -1042, Message: "Collateral threshold is invalid"} // ErrCollateralReturnInvalid ... ErrCollateralReturnInvalid = &Error{Code: -1043, Message: "Collateral return is invalid"} // ErrMissingUserDocuments ... ErrMissingUserDocuments = &Error{Code: -1044, Message: "User hasn't had any document yet!"} // ErrOTPIsInvalid ... ErrOTPIsInvalid = &Error{Code: -1045, Message: "OTP not matched or invalidated!"} // ErrInvalidHash ... ErrInvalidHash = &Error{Code: -1046, Message: "Invalid hash"} // ErrExceedOTPTime ... ErrExceedOTPTime = &Error{Code: -1047, Message: "Exceed OTP time"} // ErrUserBankNotFound ... ErrUserBankNotFound = &Error{Code: -1048, Message: "Bank not found"} // ErrUserWrongVerifySubmitted ... ErrUserWrongVerifySubmitted = &Error{Code: -1049, Message: "Verfification level != submitted"} // ErrWrongReserveTransferType ... ErrWrongReserveTransferType = &Error{Code: -1050, Message: "Invalid transfer type"} // ErrNeedVerifyOTP ... ErrNeedVerifyOTP = &Error{Code: -1051, Message: "You need verify OTP first"} // ErrOTPWrongParams ... ErrOTPWrongParams = &Error{Code: -1052, Message: "Wrong params"} // ErrUserDocumentNotFound ... ErrUserDocumentNotFound = &Error{Code: -1053, Message: "User document not found"} // ErrInvalidDocumentType ... ErrInvalidDocumentType = &Error{Code: -1054, Message: "invalid document type"} // ErrEmailVerified ... ErrEmailVerified = &Error{Code: -1075, Message: "your email is verified"} // ErrUserWalletGenerateBEP2Failed ... ErrUserWalletGenerateBEP2Failed = &Error{Code: -1076, Message: "Cannot generate bep2 wallet."} // ErrUserExistsUserName ... ErrUserExistsUserName = &Error{Code: -1077, Message: "Username already exists."} // ErrUserExistsReferralCode ... ErrUserExistsReferralCode = &Error{Code: -1078, Message: "ReferralCode is existsed"} // ErrUserExistsEmailRestricted ... ErrUserExistsEmailRestricted = &Error{Code: -1079, Message: "Email is restricted"} // reserve api errors // ErrReserveTransferToUserNotFound ... ErrReserveTransferToUserNotFound = &Error{Code: -2000, Message: "to user is not found"} // ErrReserveNotEnoughConstant ... ErrReserveNotEnoughConstant = &Error{Code: -2001, Message: "not enough constant"} // ErrReserveNotVerifiedKYC ... ErrReserveNotVerifiedKYC = &Error{Code: -2002, Message: "not kyc user"} // ErrReserveBuyLimitUS ... ErrReserveBuyLimitUS = &Error{Code: -2003, Message: "the minimum of buy is 5cst"} // ErrReserveBuyLimitNonUS ... ErrReserveBuyLimitNonUS = &Error{Code: -2004, Message: "the minimum of buy is 35cst"} // ErrReservePrimetrustError ... ErrReservePrimetrustError = &Error{Code: -2005, Message: "Primetrust error"} // ErrReserveSmartContractError ... ErrReserveSmartContractError = &Error{Code: -2006, Message: "SmartContract error"} // ErrReserveTransferUserNotFound ... ErrReserveTransferUserNotFound = &Error{Code: -2007, Message: "User not found"} // ErrReserveTransferSameUser ... ErrReserveTransferSameUser = &Error{Code: -2008, Message: "Cannot transfer to your self"} // ErrReserveImportConstantTooFast ... ErrReserveImportConstantTooFast = &Error{Code: -2009, Message: "Import the same Constant amount in 2 minutes!"} // ErrReserveNotFound ... ErrReserveNotFound = &Error{Code: -2010, Message: "Reserve not found!"} // ErrReserveNotSupport ... ErrReserveNotSupport = &Error{Code: -2011, Message: "Not support this reserve type now!"} // ErrReserveInvalidStatus ... ErrReserveInvalidStatus = &Error{Code: -2012, Message: "Cannot retry redeem wrong reserve status!"} // general api errors // ErrInvalidArgument ... ErrInvalidArgument = &Error{Code: -9000, Message: "invalid argument"} // ErrInternalServerError ... ErrInternalServerError = &Error{Code: -9001, Message: "internal server error"} // ErrInvalidLimit ... ErrInvalidLimit = &Error{Code: -9002, Message: "invalid limit"} // ErrInvalidPage ... ErrInvalidPage = &Error{Code: -9003, Message: "invalid page"} // ErrSystemError ... ErrSystemError = &Error{Code: -9004, Message: "system error"} // ErrPermissionDenied ... ErrPermissionDenied = &Error{Code: -9005, Message: "permission denied"} // ErrUnauthorized ... ErrUnauthorized = &Error{Code: -9006, Message: "Unauthorized"} // ErrNotFound will throw if the requested item is not exists ErrNotFound = &Error{Code: -9007, Message: "Your requested Item is not found"} // ErrConflict will throw if the current action already exists ErrConflict = &Error{Code: -9008, Message: "Your Item already exist"} // ErrBadParamInput ... ErrBadParamInput = &Error{Code: -9009, Message: "Given Param is not valid"} // ErrCheckUserBalance ... ErrCheckUserBalance = &Error{Code: -9010, Message: "User check balance error"} // storage api errors // ErrFileInvalidRequest ... ErrFileInvalidRequest = &Error{Code: -8000, Message: "invalid request"} // ErrFileInvalid ... ErrFileInvalid = &Error{Code: -8001, Message: "file invalid"} // ErrSizeLimit ... ErrSizeLimit = &Error{Code: -8002, Message: "invalid file size"} // ErrFileType ... ErrFileType = &Error{Code: -8003, Message: "invalid file type"} // ErrSubmitFileFail ... ErrSubmitFileFail = &Error{Code: -8004, Message: "submit file failed"} // local api errors // ErrLocalNotEnoughConstantBalance ... ErrLocalNotEnoughConstantBalance = &Error{Code: -3000, Message: "Your Constant balance is not enough to create this order"} // ErrLocalCannotCancelOrderID ... ErrLocalCannotCancelOrderID = &Error{Code: -3001, Message: "Cannot cancel this order id"} // ErrLocalInvalidInitOrder ... ErrLocalInvalidInitOrder = &Error{Code: -3002, Message: "Type should be Sell/Buy"} // ErrLocalExchangeRateNotFound ... ErrLocalExchangeRateNotFound = &Error{Code: -3003, Message: "Cannot find exchange rate"} // ErrLocalConstantAmount ... ErrLocalConstantAmount = &Error{Code: -3004, Message: "Your Constant must be less or equal 2000"} // ErrLocalPriceAmount ... ErrLocalPriceAmount = &Error{Code: -3005, Message: "Your price must be large than 0"} // ErrLocalInvalidPrice ... ErrLocalInvalidPrice = &Error{Code: -3006, Message: "Your price doesn't match with your list"} // ErrLocalApproveOrderWrongStatus ... ErrLocalApproveOrderWrongStatus = &Error{Code: -3007, Message: "Please double check status of your order"} // ErrLocalWrongType ... ErrLocalWrongType = &Error{Code: -3008, Message: "Please double check order type"} // ErrLocalWrongID ... ErrLocalWrongID = &Error{Code: -3009, Message: "You are not owner of this order id"} // ErrLocalMatchMySelf ... ErrLocalMatchMySelf = &Error{Code: -3010, Message: "You cannot Buy/Sell with yourself"} // ErrLocalInvalidConstant ... ErrLocalInvalidConstant = &Error{Code: -3011, Message: "Please check your Constant"} // ErrLocalInvalidBankAccountName ... ErrLocalInvalidBankAccountName = &Error{Code: -3012, Message: "Please check your bank account name"} // ErrLocalInvalidBankAccountNumber ... ErrLocalInvalidBankAccountNumber = &Error{Code: -3013, Message: "Please check your bank account number"} // ErrLocalInvalidRoutingAndSwiftCode ... ErrLocalInvalidRoutingAndSwiftCode = &Error{Code: -3014, Message: "Please check your routing number or swift code"} // ErroLocalInvalidBankName ... ErroLocalInvalidBankName = &Error{Code: -3015, Message: "Please check your bank name"} // ErroLocalCannotApproveOrder ... ErroLocalCannotApproveOrder = &Error{Code: -3016, Message: "You cannot approve this order. Please contact hello@constant.money for support"} // ErroLocalCannotFinishOrder ... ErroLocalCannotFinishOrder = &Error{Code: -3017, Message: "You cannot finish this order. Please contact hello@constant.money for support"} // ErrLocalTransactionError ... ErrLocalTransactionError = &Error{Code: -3018, Message: "Transation Error"} // ErrLocalMissingBankInfo ... ErrLocalMissingBankInfo = &Error{Code: -3019, Message: "There is no bank info of user"} // ErrLocalMissingBankAnotherInfo ... ErrLocalMissingBankAnotherInfo = &Error{Code: -3020, Message: "There is no bank branch"} // ErrLocalMissingBankCountry ... ErrLocalMissingBankCountry = &Error{Code: -3021, Message: "There is no bank country"} // loan api errors // ErrLoanInvalidNextPay ... ErrLoanInvalidNextPay = &Error{Code: -9000, Message: "Next payment invalid"} // ErrInterestRateNotFound ... ErrInterestRateNotFound = &Error{Code: -9001, Message: "Interest rate not found"} // ErrCollateralNotFound ... ErrCollateralNotFound = &Error{Code: -9002, Message: "Collateral not found"} // GenerateEthereumFail ... GenerateEthereumFail = &Error{Code: -9003, Message: "Generate Ethereum wallet failed"} // GenerateBitcoinFail ... GenerateBitcoinFail = &Error{Code: -9004, Message: "Generate Bitcoin wallet failed"} // GenerateCollateralAmountFail ... GenerateCollateralAmountFail = &Error{Code: -9005, Message: "Generate Collateral Amount failed"} // CreateCollateralFail ... CreateCollateralFail = &Error{Code: -9006, Message: "Create Collateral failed"} // UpdateCollateralFail ... UpdateCollateralFail = &Error{Code: -9007, Message: "Update Collateral failed"} // CollateralExchangeRateFail ... CollateralExchangeRateFail = &Error{Code: -9008, Message: "Get exchange rate failed"} // ReceiveAddressInvalid ... ReceiveAddressInvalid = &Error{Code: -9009, Message: "Receive address invalid"} // ErrCollateralPeriodInvalid ... ErrCollateralPeriodInvalid = &Error{Code: -9010, Message: "Period invalid"} // ErrCollateralInterestRateInvalid ... ErrCollateralInterestRateInvalid = &Error{Code: -9011, Message: "Interest Rate invalid"} // ErrCollateralWrongStatus ... ErrCollateralWrongStatus = &Error{Code: -9012, Message: "Please double check status of your loan"} // ErrCollateralStatusNotFound ... ErrCollateralStatusNotFound = &Error{Code: -9013, Message: "Collateral status not found"} // ErrBalanceHoldingInvalid ... ErrBalanceHoldingInvalid = &Error{Code: -9014, Message: "Collateral loan balance holding invalid"} // ErrCollateralLoanSymbolNotfound ... ErrCollateralLoanSymbolNotfound = &Error{Code: -9014, Message: "Collateral loan symbol not found"} // ErrCollateralLoanSymbolResponseNotfound ... ErrCollateralLoanSymbolResponseNotfound = &Error{Code: -9015, Message: "Collateral loan symbol response not found"} // ErrCollateralLoanSymbolReateResponseNotfound ... ErrCollateralLoanSymbolReateResponseNotfound = &Error{Code: -9016, Message: "Collateral loan symbol rate response not found"} // ErrCollateralLoanAcceptFail ... ErrCollateralLoanAcceptFail = &Error{Code: -9015, Message: "Collateral loan accept failed"} // ErrCollateralLoanNotPermission ... ErrCollateralLoanNotPermission = &Error{Code: -9016, Message: "Collateral loan is not permission"} // ErrCollateralLoanCancelFailed ... ErrCollateralLoanCancelFailed = &Error{Code: -9017, Message: "Collateral loan cancel failed"} // ErrCollateralBalanceFailed ... ErrCollateralBalanceFailed = &Error{Code: -9018, Message: "Collateral user balance failed"} // ErrCollateralBTCNotFound ... ErrCollateralBTCNotFound = &Error{Code: -9019, Message: "Collateral BTC not found"} // ErrCollateralETHNotFound ... ErrCollateralETHNotFound = &Error{Code: -9020, Message: "Collateral not ETH found"} // ErrCollateralERC20NotFound ... ErrCollateralERC20NotFound = &Error{Code: -9021, Message: "Collateral not ERC20 found"} // ErrCollateralTOMONotFound ... ErrCollateralTOMONotFound = &Error{Code: -9022, Message: "Collateral not ERC20 found"} // loan pro api errors // ErrCollateralLoanMatchedPayNotFound ... ErrCollateralLoanMatchedPayNotFound = &Error{Code: -10001, Message: "Collateral loan matched pay not found"} // ErrCollateralLoanMatchedPayNotEnoughConstantBalance ... ErrCollateralLoanMatchedPayNotEnoughConstantBalance = &Error{Code: -10002, Message: "Your Constant balance is not enough to pay this matched"} // ErrLoanMasterAccountNotEnoughConstantBalance ... ErrLoanMasterAccountNotEnoughConstantBalance = &Error{Code: -10003, Message: "Loan master account's Constant balance is not enough to pay this matched"} // ErrUserCollateralNotFound ... ErrUserCollateralNotFound = &Error{Code: -10004, Message: "User collaterral loan not found"} // ErrGetCollateralCurrentRateInvalid ... ErrGetCollateralCurrentRateInvalid = &Error{Code: -10005, Message: "Get collaterral rate invalid"} // ErrGetCollateralGetExchangeRateFail ... ErrGetCollateralGetExchangeRateFail = &Error{Code: -10006, Message: "Get collaterral get exchange rate failed"} // ErrCollateralLoanMatchedStatusInvalid ... ErrCollateralLoanMatchedStatusInvalid = &Error{Code: -10007, Message: "Collaterral loan matched status invalid"} // ErrCollateralLoanMatchedContractInvalid ... ErrCollateralLoanMatchedContractInvalid = &Error{Code: -10008, Message: "Collaterral loan matched contract invalid"} // ErrCollateralLoanMatchedExisted ... ErrCollateralLoanMatchedExisted = &Error{Code: -10009, Message: "Collaterral loan matched existed"} // ErrCollateralLoanMatchedPayUserInvalid ... ErrCollateralLoanMatchedPayUserInvalid = &Error{Code: -10010, Message: "Collateral loan matched pay user invalid"} //11xxx ErrUserCouponUsed = &Error{Code: -11001, Message: "Coupon has already used"} ErrUserCouponInvalid = &Error{Code: -11002, Message: "Coupon is invalid"} ErrUserTransferingAccountInvalid = &Error{Code: -11003, Message: "Transfering account is invalid"} ErrUserTransferingAccountBalanceFailed = &Error{Code: -11004, Message: "Not enough balance"} ) ================================================ FILE: agent-as-a-service/agent-orchestration/core/domain/wallet.go ================================================ package domain import ( "context" "github.com/jinzhu/gorm" ) // WalletType ... type WalletType int const ( // WalletTypeEthereum ... WalletTypeEthereum WalletType = iota // WalletTypeBitcoin ... WalletTypeBitcoin WalletType = 1 // WalletTypeBEP2 ... WalletTypeBEP2 WalletType = 2 // WalletTypeBeam ... WalletTypeBeam WalletType = 3 // WalletTypeIncognito ... WalletTypeIncognito WalletType = 4 // WalletTypeTron ... WalletTypeTron WalletType = 6 // WalletTypeAda ... WalletTypeAda WalletType = 7 // WalletTypeSOL ... WalletTypeSOL WalletType = 8 ) // Wallet ... type Wallet struct { gorm.Model WalletId string Address string PrivateKey string `gorm:"type:text"` Type WalletType } // func (*Wallet) TableName() string { // return "wallet.wallets" // } // IWalletRepository ... type IWalletRepository interface { Create(ctx context.Context, u *Wallet) error Update(ctx context.Context, u *Wallet) error Delete(ctx context.Context, u *Wallet) error FindByAddress(ctx context.Context, address string) (*Wallet, error) } // IWalletUsecase ... type IWalletUsecase interface { GenerateUpdate(ctx context.Context, req WalletUpdateRequest) (*Wallet, error) GetPrivateKey(ctx context.Context, req WalletGetPrivateKeyRequest) (string, error) } // WalletGenerateRequest ... type WalletGenerateRequest struct { WalletType WalletType `json:"WalletType"` } type WalletUpdateRequest struct { WalletId string `json:"WalletId"` WalletType WalletType `json:"WalletType"` Address string `json:"Address"` PrivateKey string `json:"PrivateKey"` Batch map[string]string `json:"Batch"` } // WalletGetPrivateKeyRequest ... type WalletGetPrivateKeyRequest struct { Address string `json:"Address"` } // WalletCheckRequest ... type WalletCheckRequest struct { WalletType WalletType `json:"WalletType"` Address string `json:"Address"` } ================================================ FILE: agent-as-a-service/agent-orchestration/core/go.mod ================================================ module github.com/eternalai-org/eternal-ai/agent-orchestration/core go 1.18 require ( github.com/getsentry/raven-go v0.2.1-0.20190619092523-5c24d5110e0e github.com/gin-contrib/cors v1.3.0 github.com/gin-contrib/sentry v0.0.0-20191119142041-ff0e9556d1b7 github.com/gin-gonic/gin v1.7.2 github.com/jinzhu/gorm v1.9.16 github.com/pkg/errors v0.9.1 github.com/spf13/viper v1.6.1 go.uber.org/zap v1.15.0 golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e ) require ( github.com/certifi/gocertifi v0.0.0-20180905225744-ee1a9a0726d2 // indirect github.com/fsnotify/fsnotify v1.4.7 // indirect github.com/gin-contrib/sse v0.1.0 // indirect github.com/go-playground/locales v0.13.0 // indirect github.com/go-playground/universal-translator v0.17.0 // indirect github.com/go-playground/validator/v10 v10.6.1 // indirect github.com/go-sql-driver/mysql v1.5.0 // indirect github.com/golang/protobuf v1.5.2 // indirect github.com/google/go-cmp v0.5.6 // indirect github.com/hashicorp/hcl v1.0.0 // indirect github.com/jinzhu/inflection v1.0.0 // indirect github.com/json-iterator/go v1.1.11 // indirect github.com/kr/pretty v0.2.0 // indirect github.com/leodido/go-urn v1.2.1 // indirect github.com/magiconair/properties v1.8.1 // indirect github.com/mattn/go-isatty v0.0.13 // indirect github.com/mitchellh/mapstructure v1.1.2 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.1 // indirect github.com/pelletier/go-toml v1.6.0 // indirect github.com/spf13/afero v1.2.2 // indirect github.com/spf13/cast v1.3.1 // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/subosito/gotenv v1.2.0 // indirect github.com/ugorji/go/codec v1.2.6 // indirect go.uber.org/atomic v1.6.0 // indirect go.uber.org/multierr v1.5.0 // indirect golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 // indirect golang.org/x/sys v0.0.0-20210616094352-59db8d763f22 // indirect golang.org/x/text v0.3.6 // indirect golang.org/x/tools v0.1.3 // indirect golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect google.golang.org/protobuf v1.26.0 // indirect gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect gopkg.in/ini.v1 v1.51.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect honnef.co/go/tools v0.0.1-2020.1.4 // indirect ) ================================================ FILE: agent-as-a-service/agent-orchestration/core/go.sum ================================================ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/PuerkitoBio/goquery v1.5.1/go.mod h1:GsLWisAFVj4WgDibEWF4pvYnkVQBpKBKeU+7zCJoLcc= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/andybalholm/cascadia v1.1.0/go.mod h1:GsXiBklL0woXo1j/WYWtSYYC4ouU9PqHO0sqidkEA4Y= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/certifi/gocertifi v0.0.0-20180905225744-ee1a9a0726d2 h1:MmeatFT1pTPSVb4nkPmBFN/LRZ97vPjsFKsZrU3KKTs= github.com/certifi/gocertifi v0.0.0-20180905225744-ee1a9a0726d2/go.mod h1:GJKEexRPVJrBSOjoqN5VNOIKJ5Q3RViH6eu3puDRwx4= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/denisenkom/go-mssqldb v0.0.0-20191124224453-732737034ffd h1:83Wprp6ROGeiHFAP8WJdI2RoxALQYgdllERc3N5N2DM= github.com/denisenkom/go-mssqldb v0.0.0-20191124224453-732737034ffd/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5 h1:Yzb9+7DPaBjB8zlTR87/ElzFsnQfuHnVUVqpZZIcV5Y= github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5/go.mod h1:a2zkGnVExMxdzMo3M0Hi/3sEU+cWnZpSni0O6/Yb/P0= github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/getsentry/raven-go v0.2.0/go.mod h1:KungGk8q33+aIAZUIVWZDr2OfAEBsO49PX4NzFV5kcQ= github.com/getsentry/raven-go v0.2.1-0.20190619092523-5c24d5110e0e h1:kpHZPjNRhYcj0G1Y4NryfaoeFF/BSSPd2OwiXbzEMPo= github.com/getsentry/raven-go v0.2.1-0.20190619092523-5c24d5110e0e/go.mod h1:KungGk8q33+aIAZUIVWZDr2OfAEBsO49PX4NzFV5kcQ= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gin-contrib/cors v1.3.0 h1:PolezCc89peu+NgkIWt9OB01Kbzt6IP0J/JvkG6xxlg= github.com/gin-contrib/cors v1.3.0/go.mod h1:artPvLlhkF7oG06nK8v3U8TNz6IeX+w1uzCSEId5/Vc= github.com/gin-contrib/sentry v0.0.0-20191119142041-ff0e9556d1b7 h1:FRRiiqJ9JWKR6z5+lLxpIRX7FS705zvy8cquqQhYGTc= github.com/gin-contrib/sentry v0.0.0-20191119142041-ff0e9556d1b7/go.mod h1:HMCqEZ9zMbvQV8k8CxcxUyzg6v3EXCAwcYfE852s2Ek= github.com/gin-contrib/sse v0.0.0-20190301062529-5545eab6dad3/go.mod h1:VJ0WA2NBN22VlZ2dKZQPAPnyWw5XTlK1KymzLKsr59s= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= github.com/gin-gonic/gin v1.4.0/go.mod h1:OW2EZn3DO8Ln9oIKOvM++LBO+5UPHJJDH72/q/3rZdM= github.com/gin-gonic/gin v1.7.2 h1:Tg03T9yM2xa8j6I3Z3oqLaQRSmKvxPd6g/2HJ6zICFA= github.com/gin-gonic/gin v1.7.2/go.mod h1:jD2toBW3GZUr5UMcdrwQA10I7RuaFOl/SGeDjXkfUtY= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-playground/assert/v2 v2.0.1 h1:MsBgLAaY856+nPRTKrp3/OZK38U/wa0CcBYNjji3q3A= github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/locales v0.13.0 h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8ceBS/t7Q= github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD876Lmtgy7VtROAbHHXk8no= github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= github.com/go-playground/validator/v10 v10.4.1/go.mod h1:nlOn6nFhuKACm19sB/8EGNn9GlaMV7XkbRSipzJ0Ii4= github.com/go-playground/validator/v10 v10.6.1 h1:W6TRDXt4WcWp4c4nf/G+6BkGdhiIo0k417gfr+V6u4I= github.com/go-playground/validator/v10 v10.6.1/go.mod h1:xm76BBt941f7yWdGnI2DVPFFg1UK3YY04qifoXU3lOk= github.com/go-sql-driver/mysql v1.5.0 h1:ozyZYNQW3x3HtqT1jira07DN2PArx2v7/mN66gGcHOs= github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe h1:lXe2qZdvpiX5WZkZR4hgp4KJVfY3nMkvmwbVkpv1rVY= github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/jinzhu/gorm v1.9.16 h1:+IyIjPEABKRpsu/F8OvDPy9fyQlgsg2luMV2ZIH5i5o= github.com/jinzhu/gorm v1.9.16/go.mod h1:G3LB3wezTOWM2ITLzPxEXgSkOXAntiLHS7UdBefADcs= github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E= github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= github.com/jinzhu/now v1.0.1 h1:HjfetcXq097iXP0uoPCdnM4Efp5/9MsM0/M+XOTeR3M= github.com/jinzhu/now v1.0.1/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.11 h1:uVUAXhF2To8cbw/3xN3pxj6kk7TYKs98NIrTqPlMWAQ= github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w= github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= github.com/lib/pq v1.1.1 h1:sJZmqHoEaY7f+NPP8pgLB/WxulyR3fewgCM2qaSlBb4= github.com/lib/pq v1.1.1/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/magiconair/properties v1.8.1 h1:ZC2Vc7/ZFkGmsVC9KvOjumD+G5lXy2RtTKyzRKO2BQ4= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.13 h1:qdl+GuBjcsKKDco5BsxPJlId98mSWNKqYA+Co0SC1yA= github.com/mattn/go-isatty v0.0.13/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-sqlite3 v1.14.0 h1:mLyGNKR8+Vv9CAU7PphKa2hkEqxxhn8i32J6FPj1/QA= github.com/mattn/go-sqlite3 v1.14.0/go.mod h1:JIl7NbARA7phWnGvh0LKTyg7S9BA+6gx71ShQilpsus= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/pelletier/go-toml v1.6.0 h1:aetoXYr0Tv7xRU/V4B4IZJ2QcbtMUFoNb3ORp7TzIK4= github.com/pelletier/go-toml v1.6.0/go.mod h1:5N711Q9dKgbdkxHL+MEfF31hpT7l0S0s/t2kKREewys= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= github.com/spf13/afero v1.2.2 h1:5jhuqJyZCZf2JRofRvN/nIFgIWNzPa3/Vz8mYylgbWc= github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cast v1.3.1 h1:nFm6S0SMdyzrzcmThSipiEubIDy8WEXKNZ0UOgiRpng= github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.6.1 h1:VPZzIkznI1YhVMRi6vNFLHSwhnhReBfgTxIPccpfdZk= github.com/spf13/viper v1.6.1/go.mod h1:t3iDnF5Jlj76alVNuyFBk5oUMCvsrkbvZK0WQdfDi5k= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= github.com/ugorji/go v1.2.6/go.mod h1:anCg0y61KIhDlPZmnH+so+RQbysYVyDko0IMgJv0Nn0= github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= github.com/ugorji/go/codec v1.2.6 h1:7kbGefxLoDBuYXOms4yD7223OpNMMPNPZxXk5TvFcyQ= github.com/ugorji/go/codec v1.2.6/go.mod h1:V6TCNZ4PHqoHGFZuSG1W8nrCzzdgA2DozYxWFFpvxTw= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.6.0 h1:Ezj3JGmsOnG1MoRWQkPBsKLe9DwWD9QeXzTRzzldNVk= go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.5.0 h1:KCa4XfM8CWFCpxXRGok+Q0SS/0XBhMDbHHGABQLvD2A= go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee h1:0mgffUl7nfd+FpvXMVz4IDEaUSmT1ysygQC7qYo7sG4= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.15.0 h1:ZZCA22JRF2gQE5FoNmhmrf7jeJJ2uhqDUNRYKm8dvmM= go.uber.org/zap v1.15.0/go.mod h1:Mb2vm2krFEG5DV0W9qcHBYFtp/Wku1cvYaqPsS/WYfc= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191205180655-e7c4368fe9dd/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e h1:gsTQYXdTw2Gq7RBsWvlQ91b+aEQ6bXFUngBGuR8sPpI= golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 h1:VLliZ0d+/avPrXXH+OakdXhpJuEoBZuwh1m2j7U6Iug= golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.4.2 h1:Gz96sIWK3OalVv/I/qNygP42zyoKp3xptRVCWRFEBvo= golang.org/x/net v0.0.0-20180218175443-cbe0f9307d01/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210616094352-59db8d763f22 h1:RqytpXGR1iVNX7psjB3ff8y7sNFinVFvkx1c8SjBkio= golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.1.3 h1:L69ShwSZEyCsLKoAxDKeMvLDZkumEe8gXUZAjab0tX8= golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE= gopkg.in/go-playground/validator.v8 v8.18.2/go.mod h1:RX2a/7Ha8BgOhfk7j780h4/u/RRjR0eouCJSH80/M2Y= gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.51.1 h1:GyboHr4UqMiLUybYjd22ZjQIKEJEpgtLXtuGbR21Oho= gopkg.in/ini.v1 v1.51.1/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.4 h1:UoveltGrhghAA7ePc+e+QYDHXrBps2PqFZiHkGR/xK8= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= ================================================ FILE: agent-as-a-service/agent-orchestration/core/logger/logger.go ================================================ package logger import ( "encoding/json" "fmt" "os" "path/filepath" "time" "go.uber.org/zap" ) const ( LOGGER_API_RESPONSE_TIME = "api_response_time" LOGGER_API_APP_PANIC = "api_app_panic" LOGGER_API_APP_ERROR = "api_app_error" ) var logger *zap.Logger func Logger() *zap.Logger { return logger } func NewLogger(appName string, logPath string, stdout bool) { var err error outputPaths := []string{} if stdout { outputPaths = append(outputPaths, "stdout") } if logPath != "" { dir := filepath.Dir(logPath) parent := filepath.Base(dir) _, err = os.Stat(parent) if os.IsNotExist(err) { err = os.Mkdir(parent, os.ModePerm) if err != nil { panic(err) } } err = os.Chmod(parent, os.ModePerm) if err != nil { panic(err) } os.OpenFile(logPath, os.O_RDONLY|os.O_CREATE|os.O_APPEND, 0666) outputPaths = append(outputPaths, logPath) } node, _ := os.Hostname() cfg := zap.NewProductionConfig() cfg.OutputPaths = outputPaths cfg.InitialFields = map[string]interface{}{ "app_name": appName, "node": node, } logger, err = cfg.Build( zap.AddCallerSkip(1), ) if err != nil { panic(err) } } func Sync() error { return logger.Sync() } func Info(category string, msg string, fields ...zap.Field) { logger.With(zap.String("app_category", category)).Info(msg, fields...) } func Fatal(msg string, fields ...zap.Field) { logger.Fatal(msg, fields...) } func Error(category string, msg string, fields ...zap.Field) { logger.WithOptions(zap.AddStacktrace(zap.DebugLevel)).With(zap.String("app_category", category)).Error(msg, fields...) } func WrapError(category string, err error, fields ...zap.Field) error { if err == nil { return nil } logger.WithOptions(zap.AddStacktrace(zap.DebugLevel)).With(zap.String("app_category", category)).With(zap.Any("error", err)).Error(err.Error(), fields...) return err } func WrapDefaultError(err error, fields ...zap.Field) error { if err == nil { return nil } logger.WithOptions(zap.AddStacktrace(zap.DebugLevel)).With(zap.String("app_category", LOGGER_API_APP_ERROR)).With(zap.Any("error", err)).Error(err.Error(), fields...) return err } func Debug(msg string, fields ...zap.Field) { logger.Debug(msg, fields...) } func Panic(msg string, fields ...zap.Field) { logger.Panic(msg, fields...) } func LoggerFunc(fn func(), path string, extras ...interface{}) { start := time.Now() defer func() { end := time.Now() latency := end.Sub(start).Seconds() bytes, _ := json.Marshal(extras) logger.Info( "logger_func_error", zap.Any("method", "FUN"), zap.Any("path", fmt.Sprintf("core-func-%s", path)), zap.Any("latency", latency), zap.Any("status", 200), zap.Any("extras", string(bytes)), ) }() fn() } ================================================ FILE: agent-as-a-service/agent-orchestration/core/modules/wallet/delivery/http/handler.go ================================================ package http import ( "net/http" "github.com/gin-gonic/gin" "github.com/eternalai-org/eternal-ai/agent-orchestration/core/domain" "github.com/eternalai-org/eternal-ai/agent-orchestration/core/serializers" "github.com/eternalai-org/eternal-ai/agent-orchestration/core/server" ) // WalletHandler represent the httphandler for wallet type WalletHandler struct { server *server.HTTPServer walletUsecase domain.IWalletUsecase } // NewWalletHandler ... func NewWalletHandler(s *server.HTTPServer, uu domain.IWalletUsecase) { handler := &WalletHandler{ server: s, walletUsecase: uu, } wallet := handler.server.Engine().Group("wallet") wallet.POST("/update", handler.GenerateUpdate) wallet.POST("/get-private-key", handler.GetPrivateKey) } // Generate ... func (h *WalletHandler) GenerateUpdate(c *gin.Context) { var req domain.WalletUpdateRequest if err := c.ShouldBindJSON(&req); err != nil { c.JSON(http.StatusBadRequest, serializers.ResponseError(domain.ErrInvalidArgument)) return } ctx := h.server.GetContext(c) wallet, err := h.walletUsecase.GenerateUpdate(ctx, req) if err != nil { c.JSON(http.StatusInternalServerError, serializers.ResponseError(err)) return } for a, k := range req.Batch { _, err := h.walletUsecase.GenerateUpdate(ctx, domain.WalletUpdateRequest{ WalletId: req.WalletId, WalletType: req.WalletType, Address: a, PrivateKey: k, }) if err != nil { c.JSON(http.StatusInternalServerError, serializers.ResponseError(err)) return } } c.JSON(http.StatusOK, serializers.ResponseSuccess(wallet)) } // GetPrivateKey ... func (h *WalletHandler) GetPrivateKey(c *gin.Context) { var req domain.WalletGetPrivateKeyRequest if err := c.ShouldBindJSON(&req); err != nil { c.JSON(http.StatusBadRequest, serializers.ResponseError(domain.ErrInvalidArgument)) return } ctx := h.server.GetContext(c) privateKey, err := h.walletUsecase.GetPrivateKey(ctx, req) if err != nil { c.JSON(http.StatusInternalServerError, serializers.ResponseError(err)) return } c.JSON(http.StatusOK, serializers.ResponseSuccess(privateKey)) } ================================================ FILE: agent-as-a-service/agent-orchestration/core/modules/wallet/repository/mysql/mysql.go ================================================ package mysql import ( "context" "github.com/jinzhu/gorm" "github.com/pkg/errors" "github.com/eternalai-org/eternal-ai/agent-orchestration/core/domain" ) type mysqlWalletRepository struct { DB *gorm.DB } // NewMysqlWalletRepository ... func NewMysqlWalletRepository(db *gorm.DB) domain.IWalletRepository { return &mysqlWalletRepository{ DB: db, } } func (m *mysqlWalletRepository) Create(ctx context.Context, w *domain.Wallet) error { if err := m.DB.Create(w).Error; err != nil { return errors.Wrap(err, "m.DB.Create") } return nil } func (m *mysqlWalletRepository) Update(ctx context.Context, w *domain.Wallet) error { if err := m.DB.Save(w).Error; err != nil { return errors.Wrap(err, "m.DB.Update") } return nil } func (m *mysqlWalletRepository) Delete(ctx context.Context, w *domain.Wallet) error { if err := m.DB.Delete(w).Error; err != nil { return errors.Wrap(err, "m.DB.Delete") } return nil } func (m *mysqlWalletRepository) FindByAddress(ctx context.Context, address string) (*domain.Wallet, error) { var model domain.Wallet if err := m.DB.Where("address = ?", address).First(&model).Error; err != nil { return nil, err } return &model, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/core/modules/wallet/usecase/usecase.go ================================================ package usecase import ( "context" "fmt" "os" "github.com/eternalai-org/eternal-ai/agent-orchestration/core/domain" "github.com/eternalai-org/eternal-ai/agent-orchestration/core/utils" "github.com/pkg/errors" "github.com/spf13/viper" ) type walletUsecase struct { walletRepo domain.IWalletRepository } // NewWalletUsecase ... func NewWalletUsecase(wr domain.IWalletRepository) domain.IWalletUsecase { return &walletUsecase{ walletRepo: wr, } } func (wu *walletUsecase) GenerateUpdate(ctx context.Context, req domain.WalletUpdateRequest) (*domain.Wallet, error) { var err error if req.Address == "" { return nil, domain.ErrBadParamInput } if req.PrivateKey == "" { return nil, domain.ErrBadParamInput } address := req.Address privateKey := req.PrivateKey walletCipherKey := viper.GetString(`wallet_salt`) if walletCipherKey == "" { walletCipherKey = os.Getenv("WALLET_SALT") } if walletCipherKey == "" { return nil, domain.ErrBadParamInput } encryptedText, err := utils.EncryptToString(privateKey, walletCipherKey) if err != nil { return nil, domain.ErrorWithMessage(domain.ErrSystemError, errors.Wrap(err, "Encrypted error").Error()) } decryptedText, err := utils.DecryptToString(encryptedText, walletCipherKey) if err != nil { return nil, domain.ErrorWithMessage(domain.ErrSystemError, errors.Wrap(err, "Decrypted error").Error()) } if decryptedText != privateKey { return nil, domain.ErrorWithMessage(domain.ErrSystemError, "check decrypted failed") } w := domain.Wallet{ WalletId: req.WalletId, Address: address, PrivateKey: encryptedText, Type: req.WalletType, } err = wu.walletRepo.Create(ctx, &w) if err != nil { return nil, domain.ErrorWithMessage(domain.ErrSystemError, errors.Wrap(err, "Encrypted error").Error()) } return &w, nil } // GetPrivateKey ... func (wu *walletUsecase) GetPrivateKey(ctx context.Context, req domain.WalletGetPrivateKeyRequest) (string, error) { fmt.Println(req.Address) w, err := wu.walletRepo.FindByAddress(ctx, req.Address) if err != nil { return "", domain.ErrorWithMessage(domain.ErrSystemError, "uu.walletRepo.FindByAddress "+err.Error()) } walletCipherKey := viper.GetString(`wallet_salt`) if walletCipherKey == "" { walletCipherKey = os.Getenv("WALLET_SALT") } if walletCipherKey == "" { return "", domain.ErrorWithMessage(domain.ErrSystemError, "walletCipherKey empty") } decryptedText, err := utils.DecryptToString(w.PrivateKey, walletCipherKey) if err != nil { return "", domain.ErrorWithMessage(domain.ErrSystemError, errors.Wrap(err, "Decrypted error").Error()) } return string(decryptedText), nil } ================================================ FILE: agent-as-a-service/agent-orchestration/core/pkg/core/core.go ================================================ package core import ( "github.com/eternalai-org/eternal-ai/agent-orchestration/core/pkg/core/wallet" ) // Core ... type Core struct { Endpoint string Wallet *wallet.Wallet } // Init ... func Init(e string) *Core { return &Core{ Endpoint: e, Wallet: wallet.Init(e), } } ================================================ FILE: agent-as-a-service/agent-orchestration/core/pkg/core/wallet/wallet.go ================================================ package wallet import ( "bytes" "encoding/json" "fmt" "io/ioutil" "net/http" "github.com/eternalai-org/eternal-ai/agent-orchestration/core/domain" ) // Wallet ... type Wallet struct { Endpoint string } // Init ... func Init(e string) *Wallet { return &Wallet{ Endpoint: e, } } // Generate ... func (r *Wallet) Generate(req domain.WalletGenerateRequest) (*domain.Wallet, error) { apiURL := fmt.Sprintf("%s/wallet/generate", r.Endpoint) body, err := json.Marshal(req) if err != nil { return nil, err } request, _ := http.NewRequest("POST", apiURL, bytes.NewBuffer(body)) client := http.Client{} response, err := client.Do(request) if err != nil { return nil, err } defer response.Body.Close() b, err := ioutil.ReadAll(response.Body) if err != nil { return nil, err } var data struct { Result *domain.Wallet Error *domain.Error } json.Unmarshal(b, &data) if data.Error != nil { fmt.Println(data.Error, data.Error.Error()) return nil, data.Error } return data.Result, nil } // GetPrivateKey ... func (r *Wallet) GetPrivateKey(req domain.WalletGetPrivateKeyRequest) (string, error) { apiURL := fmt.Sprintf("%s/wallet/get-private-key", r.Endpoint) body, err := json.Marshal(req) if err != nil { return "", err } request, _ := http.NewRequest("POST", apiURL, bytes.NewBuffer(body)) client := http.Client{} response, err := client.Do(request) if err != nil { return "", err } defer response.Body.Close() b, err := ioutil.ReadAll(response.Body) if err != nil { return "", err } var data struct { Result string Error *domain.Error } json.Unmarshal(b, &data) if data.Error != nil { fmt.Println(data.Error, data.Error.Error()) return "", data.Error } return data.Result, nil } func (r *Wallet) Check(req domain.WalletCheckRequest) error { apiURL := fmt.Sprintf("%s/wallet/check", r.Endpoint) body, err := json.Marshal(req) if err != nil { return err } request, _ := http.NewRequest("POST", apiURL, bytes.NewBuffer(body)) client := http.Client{} response, err := client.Do(request) if err != nil { return err } defer response.Body.Close() b, err := ioutil.ReadAll(response.Body) if err != nil { return err } var data struct { Error *domain.Error } json.Unmarshal(b, &data) if data.Error != nil { fmt.Println(data.Error, data.Error.Error()) return data.Error } return nil } ================================================ FILE: agent-as-a-service/agent-orchestration/core/serializers/serializers.go ================================================ package serializers import "github.com/eternalai-org/eternal-ai/agent-orchestration/core/domain" // JSONResponse ... type JSONResponse struct { Result interface{} `json:"Result"` Error interface{} `json:"Error"` } // ResponseSuccess ... func ResponseSuccess(data interface{}) JSONResponse { return JSONResponse{ Result: data, } } // ResponseError ... func ResponseError(err error) JSONResponse { switch err.(type) { case *domain.Error: { } default: { err = domain.ErrorWithMessage(domain.ErrSystemError, err.Error()) } } return JSONResponse{ Error: err, } } ================================================ FILE: agent-as-a-service/agent-orchestration/core/server/http.go ================================================ package server import ( "context" "strconv" "time" "go.uber.org/zap" "github.com/getsentry/raven-go" "github.com/gin-contrib/cors" "github.com/gin-contrib/sentry" "github.com/gin-gonic/gin" ) // HTTPServer ... type HTTPServer struct { engine *gin.Engine logger *zap.Logger } // NewHTTPServer ... func NewHTTPServer(logger *zap.Logger) *HTTPServer { r := gin.Default() r.Use(sentry.Recovery(raven.DefaultClient, false)) // Middleware corsConfig := cors.Config{ AllowAllOrigins: true, AllowMethods: []string{"GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS"}, AllowHeaders: []string{"X-Requested-With", "Authorization", "Origin", "Content-Length", "Content-Type"}, AllowCredentials: false, MaxAge: 12 * time.Hour, } r.Use(cors.New(corsConfig)) server := &HTTPServer{ engine: r, logger: logger, } return server } // Engine ... func (s *HTTPServer) Engine() *gin.Engine { return s.engine } // Logger ... func (s *HTTPServer) Logger() *zap.Logger { return s.logger } // GetPagingFromContext ... func (s *HTTPServer) GetPagingFromContext(c *gin.Context) (uint, uint) { var ( pageS = c.DefaultQuery("page", "1") limitS = c.DefaultQuery("limit", "10") page int limit int err error ) page, err = strconv.Atoi(pageS) if err != nil { page = 1 } limit, err = strconv.Atoi(limitS) if err != nil { limit = 10 } return uint(page), uint(limit) } // GetContext ... func (s *HTTPServer) GetContext(c *gin.Context) context.Context { ctx := c.Request.Context() if ctx == nil { ctx = context.Background() } return ctx } ================================================ FILE: agent-as-a-service/agent-orchestration/core/utils/blowfish.go ================================================ package utils import ( "bytes" "crypto/cipher" "encoding/base64" "golang.org/x/crypto/blowfish" ) /* Reference: https://github.com/ipfans/golang-sample/blob/master/blowfish.go */ func encodeBase64(b []byte) string { return base64.StdEncoding.EncodeToString(b) } func blowfishChecksizeAndPad(value []byte) []byte { modulus := len(value) % blowfish.BlockSize if modulus != 0 { padnglen := blowfish.BlockSize - modulus for i := 0; i < padnglen; i++ { value = append(value, 0) } } return value } func blowfishEncrypt(value, key []byte) ([]byte, error) { bcipher, err := blowfish.NewCipher(key) if err != nil { return nil, err } returnMe := make([]byte, blowfish.BlockSize+len(value)) eiv := returnMe[:blowfish.BlockSize] ecbc := cipher.NewCBCEncrypter(bcipher, eiv) ecbc.CryptBlocks(returnMe[blowfish.BlockSize:], value) return returnMe, nil } // EncryptToByte : value, cipherKey func EncryptToByte(value string, cipherKey string) ([]byte, error) { var returnMe, valueInByteArr, paddedByteArr, keyByteArr []byte valueInByteArr = []byte(value) keyByteArr = []byte(cipherKey) paddedByteArr = blowfishChecksizeAndPad(valueInByteArr) returnMe, err := blowfishEncrypt(paddedByteArr, keyByteArr) if err != nil { return nil, err } return returnMe, nil } // EncryptToString : value, cipherKey func EncryptToString(value string, cipherKey string) (string, error) { encryptedByteArr, err := EncryptToByte(value, cipherKey) if err != nil { return "", err } returnMe := encodeBase64(encryptedByteArr) return returnMe, nil } func decodeBase64(s string) ([]byte, error) { data, err := base64.StdEncoding.DecodeString(s) if err != nil { return nil, err } return data, nil } func blowfishDecrypt(value, key []byte) ([]byte, error) { dcipher, err := blowfish.NewCipher(key) if err != nil { return nil, err } div := value[:blowfish.BlockSize] decrypted := value[blowfish.BlockSize:] if len(decrypted)%blowfish.BlockSize != 0 { return nil, err } dcbc := cipher.NewCBCDecrypter(dcipher, div) dcbc.CryptBlocks(decrypted, decrypted) return decrypted, nil } // DecryptToByte : value, cipherKey func DecryptToByte(value string, cipherKey string) ([]byte, error) { var returnMe, keyByteArr []byte keyByteArr = []byte(cipherKey) decodeB64, err1 := decodeBase64(value) if err1 != nil { return nil, err1 } returnMe, err2 := blowfishDecrypt(decodeB64, keyByteArr) if err2 != nil { return nil, err2 } return returnMe, nil } // DecryptToString : value, cipherKey func DecryptToString(value string, cipherKey string) (string, error) { decryptedByteArr, err := DecryptToByte(value, cipherKey) if decryptedByteArr == nil { return "", err } // remove padding character removedNilChars := bytes.Trim(decryptedByteArr, "\x00") var returnMe = string(removedNilChars[:]) return returnMe, nil } ================================================ FILE: agent-as-a-service/agent-orchestration/core/utils/ip.go ================================================ package utils import ( "errors" "fmt" "log" "net" "net/http" "net/url" ) // GetClientIPHelper gets the client IP using a mixture of techniques. // This is how it is with golang at the moment. func GetClientIPHelper(req *http.Request) (ipResult string, errResult error) { // Try lots of ways :) Order is important. // Try Request Header ("Origin") url, err := url.Parse(req.Header.Get("Origin")) if err == nil { host := url.Host ip, _, err := net.SplitHostPort(host) if err == nil { log.Printf("debug: Found IP using Header (Origin) sniffing. ip: %v", ip) return ip, nil } } // Try by Request ip, err := getClientIPByRequestRemoteAddr(req) if err == nil { log.Printf("debug: Found IP using Request sniffing. ip: %v", ip) return ip, nil } // Try Request Headers (X-Forwarder). Client could be behind a Proxy ip, err = getClientIPByHeaders(req) if err == nil { log.Printf("debug: Found IP using Request Headers sniffing. ip: %v", ip) return ip, nil } err = errors.New("error: Could not find clients IP address") return "", err } // getClientIPByRequest tries to get directly from the Request. // https://blog.golang.org/context/userip/userip.go func getClientIPByRequestRemoteAddr(req *http.Request) (ip string, err error) { // Try via request ip, port, err := net.SplitHostPort(req.RemoteAddr) if err != nil { log.Printf("debug: Getting req.RemoteAddr %v", err) return "", err } log.Printf("debug: With req.RemoteAddr found IP:%v; Port: %v", ip, port) userIP := net.ParseIP(ip) if userIP == nil { message := fmt.Sprintf("debug: Parsing IP from Request.RemoteAddr got nothing.") log.Printf(message) return "", fmt.Errorf(message) } log.Printf("debug: Found IP: %v", userIP) return userIP.String(), nil } // getClientIPByHeaders tries to get directly from the Request Headers. // This is only way when the client is behind a Proxy. func getClientIPByHeaders(req *http.Request) (ip string, err error) { // Client could be behid a Proxy, so Try Request Headers (X-Forwarder) ipSlice := []string{} ipSlice = append(ipSlice, req.Header.Get("X-Forwarded-For")) ipSlice = append(ipSlice, req.Header.Get("x-forwarded-for")) ipSlice = append(ipSlice, req.Header.Get("X-FORWARDED-FOR")) for _, v := range ipSlice { log.Printf("debug: client request header check gives ip: %v", v) if v != "" { return v, nil } } err = errors.New("error: Could not find clients IP address from the Request Headers") return "", err } ================================================ FILE: agent-as-a-service/agent-orchestration/core/utils/map.go ================================================ package utils // MapClone clone a map func MapClone(m map[string]interface{}) map[string]interface{} { cp := make(map[string]interface{}) for k, v := range m { vm, ok := v.(map[string]interface{}) if ok { cp[k] = MapClone(vm) } else { cp[k] = v } } return cp } ================================================ FILE: agent-as-a-service/agent-orchestration/core/utils/utils.go ================================================ package utils import ( "bytes" "crypto/md5" "encoding/json" "errors" "fmt" "math/rand" "net/http" "regexp" "strconv" "strings" "time" "unicode" ) const ( tokenLength uint = 32 letters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" verificationTokenExpiredDuration = 24 * time.Hour referralLetters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" ) // GenerateReferenceCode : number, order id func GenerateReferenceCode(n int, ID uint) string { b := make([]byte, n) for i := range b { b[i] = letters[rand.Intn(len(letters))] } return string(b) + strconv.Itoa(int(ID)) } // GenerateVerificationToken ... func GenerateVerificationToken(n uint) string { length := tokenLength if n != 0 { length = n } b := make([]byte, length) for i := range b { b[i] = letters[rand.Intn(len(letters))] } return string(b) } func random(min, max int) int { rand.Seed(time.Now().Unix()) return rand.Intn(max-min) + min } // GenerateVerificationCode ... func GenerateVerificationCode() int { return random(1000, 9999) } // GenerateReferralCode ... func GenerateReferralCode() string { b := make([]byte, 10) for i := range b { b[i] = referralLetters[rand.Int63()%int64(len(referralLetters))] } return string(b) } // GenerateReferralNumber ... func GenerateReferralNumber() string { n := rand.Int() % 1000 return fmt.Sprintf("%d", n) } // GenerateAPIToken ... func GenerateAPIToken() string { b := make([]byte, 36) for i := range b { b[i] = referralLetters[rand.Int63()%int64(len(referralLetters))] } return string(b) } // GenerateUsername ... func GenerateUsername(username string) string { nstr := strconv.Itoa(random(0, 10000)) return fmt.Sprintf("%s%s", username, nstr) } // IsValidEmail : email func IsValidEmail(email string) bool { re := regexp.MustCompile("^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$") return re.MatchString(email) } // GenerateEthereumWallet : ... // func GenerateEthereumWallet() (string, string, error) { // key, err := crypto.GenerateKey() // if err != nil { // return "", "", err // } // address := crypto.PubkeyToAddress(key.PublicKey).Hex() // privateKey := hex.EncodeToString(key.D.Bytes()) // return address, privateKey, nil // } // // GenerateBitcoinWallet : ... // func GenerateBitcoinWallet(isTestNet bool) (string, string, error) { // networkParams := &chaincfg.MainNetParams // if isTestNet { // networkParams = &chaincfg.TestNet3Params // } // secret, err := btcec.NewPrivateKey(btcec.S256()) // if err != nil { // return "", "", err // } // wif, err := btcutil.NewWIF(secret, networkParams, true) // if err != nil { // return "", "", err // } // address, err := btcutil.NewAddressPubKey(wif.PrivKey.PubKey().SerializeCompressed(), networkParams) // if err != nil { // return "", "", err // } // return address.EncodeAddress(), wif.String(), nil // } // Index ... func Index(vs []string, t string) int { for i, v := range vs { if v == t { return i } } return -1 } // SpaceMap : string func SpaceMap(str string) string { return strings.Map(func(r rune) rune { if unicode.IsSpace(r) { return -1 } return r }, str) } // CheckStringIsNumber ... func CheckStringIsNumber(s string) bool { _, err := strconv.ParseFloat(SpaceMap(s), 64) return err == nil } // CheckValidAccountBankNumber ... func CheckValidAccountBankNumber(s string) bool { s = strings.TrimSpace(s) if s == "" { return false } rs, err := regexp.MatchString("^[a-zA-Z0-9]*$", s) if err != nil { return false } return rs } // SlackHook ... func SlackHook(slackURL string, text string) error { bodyRequest, err := json.Marshal(map[string]interface{}{ "text": text, }) req, err := http.NewRequest("POST", slackURL, bytes.NewBuffer(bodyRequest)) req.Header.Set("Content-Type", "application/json") client := &http.Client{} res, err := client.Do(req) if err != nil { return err } defer res.Body.Close() if res.StatusCode != http.StatusOK { return errors.New(res.Status) } return nil } func ParseDBURL(dbURL string) string { var respURL string respMap := map[string]string{} strArr := strings.Split(dbURL, ";;;") for _, str := range strArr { idx := strings.Index(str, "=") if idx > 0 { respMap[str[:idx]] = str[idx+1:] } } respURL = fmt.Sprintf("%s:%s@tcp(%s:%s)/%s?charset=%s&parseTime=%s&loc=%s", respMap["username"], respMap["password"], respMap["host"], respMap["port"], respMap["database"], respMap["charset"], respMap["parseTime"], respMap["loc"]) return respURL } func ParseRefID(reference string) uint { var refID uint refIDs := strings.Split(reference, "_") if len(refIDs) >= 2 { refIDTmp, _ := strconv.ParseUint(refIDs[1], 10, 64) refID = uint(refIDTmp) } else if len(refIDs) == 1 { refIDTmp, _ := strconv.ParseUint(refIDs[0], 10, 64) refID = uint(refIDTmp) } return refID } func GenerateMD5(v string) string { data := []byte(v) return fmt.Sprintf("%x", md5.Sum(data)) } ================================================ FILE: agent-as-a-service/agent-orchestration/lib-services/.gitignore ================================================ # compiled output /dist # /artifacts /node_modules /build # Logs logs *.log npm-debug.log* pnpm-debug.log* yarn-debug.log* yarn-error.log* lerna-debug.log* # OS .DS_Store # Tests /coverage /.nyc_output # IDEs and editors /.idea .project .classpath .c9/ *.launch .settings/ *.sublime-workspace # IDE - VSCode .vscode/* !.vscode/settings.json !.vscode/tasks.json !.vscode/launch.json !.vscode/extensions.json # dotenv environment variable files .env .env.development.local .env.test.local .env.production.local .env.local # temp directory .temp .tmp # Runtime data pids *.pid *.seed *.pid.lock # Diagnostic reports (https://nodejs.org/api/report.html) report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json config.json wallet.json wallet*.json tokens.json spends.json metadata.json metadata*.json .npmrc loopmint.js ================================================ FILE: agent-as-a-service/agent-orchestration/lib-services/package.json ================================================ { "name": "solana", "version": "1.0.0", "description": "", "main": "server.js", "author": "", "license": "ISC", "devDependencies": { "@types/node": "^20.2.3", "@types/ws": "^8.5.5", "typescript": "^5.0.4" }, "scripts": { "server": "rm -rf ./dist; tsc; node dist/server.js" }, "dependencies": { "@bitcoinerlab/descriptors": "^2.2.0", "@cmdcode/tapscript": "^1.4.6", "@coinbase/coinbase-sdk": "^0.10.0", "@keplr-wallet/cosmos": "^0.12.61", "@metaplex-foundation/mpl-token-metadata": "^3.3.0", "@metaplex-foundation/umi": "^0.9.2", "@metaplex-foundation/umi-bundle-defaults": "^0.9.2", "@nestjs/common": "^10.0.0", "@nestjs/core": "^10.0.0", "@nestjs/platform-express": "^10.0.0", "@neynar/nodejs-sdk": "^2.0.0", "@orca-so/common-sdk": "0.6.4", "@orca-so/orca-sdk": "0.2.0", "@orca-so/whirlpools-sdk": "*", "@coral-xyz/anchor": "0.29.0", "@raydium-io/raydium-sdk-v2": "^0.1.80-alpha", "@solana/spl-token": "^0.4.9", "@solana/web3.js": "^1.95.8", "@types/cors": "^2.8.17", "@types/express": "^4.17.21", "@types/inquirer": "^8.1.3", "axios": "^1.7.7", "bigi": "^1.4.2", "bip32": "^4.0.0", "bip322-js": "^1.1.0", "bip39": "^3.1.0", "bitcoin-address-validation": "^2.2.3", "bitcoinjs-lib": "^6.1.5", "bitcoinjs-message": "^2.2.0", "bitcore-lib-inquisition": "^10.0.30", "bs58": "^6.0.0", "cbor": "^9.0.2", "cheerio": "^1.0.0", "decimal.js": "^10.4.3", "dotenv": "^16.3.1", "ecpair": "^2.1.0", "ecurve": "^1.0.6", "ethers": "^6.13.4", "express": "^4.18.2", "https-proxy-agent": "^7.0.5", "js-sha256": "^0.9.0", "nest-commander": "^3.14.0", "node-fetch-cjs": "^3.3.2", "reflect-metadata": "^0.2.0", "rxjs": "^7.8.1", "scrypt-cli": "^0.2.0", "scrypt-ts": "latest", "tiny-secp256k1": "^2.2.3", "varuint-bitcoin": "=1.1.2" }, "packageManager": "yarn@1.22.22+sha1.ac34549e6aa8e7ead463a7407e1c7390f61a6610" } ================================================ FILE: agent-as-a-service/agent-orchestration/lib-services/src/contants.ts ================================================ export const SOLANA_RPC_ENDPOINT = process.env.SOLANA_RPC_ENDPOINT ================================================ FILE: agent-as-a-service/agent-orchestration/lib-services/src/core/index.ts ================================================ import * as dotenv from "dotenv"; import axios from "axios"; dotenv.config(); const coreUrl = process.env.API_CORE_URL export const StoreAddress = async function (network: string, addr: string, prk: string) { try { var data = JSON.stringify({ 'WalletId': `solana_${network}`, 'Address': addr, 'PrivateKey': prk, 'WalletType': 20, }) var config = { method: 'post', url: `${coreUrl}/wallet/update`, headers: { 'Content-Type': 'application/json' }, data: data }; let resp = await axios(config) return { Address: resp.data.Result.Address, SecretVersion: resp.data.Result.SecretVersion, } } catch (err) { throw err } } export const GetAddressPrk = async function (addr: string) { try { var data = JSON.stringify({ 'Address': addr, }) var config = { method: 'post', url: `${coreUrl}/wallet/get-private-key`, headers: { 'Content-Type': 'application/json' }, data: data }; let resp = await axios(config) return resp.data.Result as string } catch (err) { throw err } } ================================================ FILE: agent-as-a-service/agent-orchestration/lib-services/src/neynar.ts ================================================ import { NeynarAPIClient } from "@neynar/nodejs-sdk"; import { FeedTrendingProvider, FetchRepliesAndRecastsForUserFilterEnum, FetchTrendingFeedTimeWindowEnum, ForYouProvider } from "@neynar/nodejs-sdk/build/api"; import * as core from "express-serve-static-core"; export const neynarAPIRouterInit = (app: core.Express) => { const neynarAPI = new NeynarAPIClient({ apiKey: process.env.NEYNAR_API_KEY }); app.get('/neynar/lookupUserByUsername', async (req, res) => { try { const user = await neynarAPI.lookupUserByUsername( req.query as unknown as { username: string; viewerFid?: number; } ); res .status(200) .send({ result: user, }) } catch (error) { res .status(400) .send({ result: null, error: { message: error['message'] } }) } }); app.get('/neynar/fetchPopularCastsByUser', async (req, res) => { try { const casts = await neynarAPI.fetchPopularCastsByUser( req.query as unknown as { fid: number; viewerFid?: number; } ) res .status(200) .send({ result: casts, }) } catch (error) { res .status(400) .send({ result: null, error: { message: error['message'] } }) } }); app.get('/neynar/fetchRepliesAndRecastsForUser', async (req, res) => { try { const casts = await neynarAPI.fetchRepliesAndRecastsForUser( req.query as unknown as { fid: number; filter?: FetchRepliesAndRecastsForUserFilterEnum; limit?: number; cursor?: string; viewerFid?: number; } ) res .status(200) .send({ result: casts, }) } catch (error) { res .status(400) .send({ result: null, error: { message: error['message'] } }) } }); app.get('/neynar/fetchRepliesAndRecastsForUser', async (req, res) => { try { const casts = await neynarAPI.fetchRepliesAndRecastsForUser( req.query as unknown as { fid: number; filter?: FetchRepliesAndRecastsForUserFilterEnum; limit?: number; cursor?: string; viewerFid?: number; } ) res .status(200) .send({ result: casts, }) } catch (error) { res .status(400) .send({ result: null, error: { message: error['message'] } }) } }); app.get('/neynar/searchCasts', async (req, res) => { try { const casts = await neynarAPI.searchCasts( req.query as unknown as { q: string; authorFid?: number; viewerFid?: number; parentUrl?: string; channelId?: string; priorityMode?: boolean; limit?: number; cursor?: string; } ) res .status(200) .send({ result: casts, }) } catch (error) { res .status(400) .send({ result: null, error: { message: error['message'] } }) } }); app.get('/neynar/fetchUserFollowingFeed', async (req, res) => { try { const feeds = await neynarAPI.fetchUserFollowingFeed( req.query as unknown as { fid: number; viewerFid?: number; withRecasts?: boolean; limit?: number; cursor?: string; } ) res .status(200) .send({ result: feeds, }) } catch (error) { res .status(400) .send({ result: null, error: { message: error['message'] } }) } }); app.get('/neynar/fetchFeedForYou', async (req, res) => { try { const feeds = await neynarAPI.fetchFeedForYou( req.query as unknown as { fid: number; viewerFid?: number; provider?: ForYouProvider; limit?: number; cursor?: string; providerMetadata?: string; } ) res .status(200) .send({ result: feeds, }) } catch (error) { res .status(400) .send({ result: null, error: { message: error['message'] } }) } }); app.get('/neynar/fetchTrendingFeed', async (req, res) => { try { const feeds = await neynarAPI.fetchTrendingFeed( req.query as unknown as { limit?: number; cursor?: string; viewerFid?: number; timeWindow?: FetchTrendingFeedTimeWindowEnum; channelId?: string; provider?: FeedTrendingProvider; providerMetadata?: string; } ) res .status(200) .send({ result: feeds, }) } catch (error) { res .status(400) .send({ result: null, error: { message: error['message'] } }) } }); } ================================================ FILE: agent-as-a-service/agent-orchestration/lib-services/src/raydium.ts ================================================ import * as solanaWeb3 from "@solana/web3.js"; import { decodeBase58, ethers, } from "ethers"; import { GetAddressPrk } from "./core"; import { Raydium, TxVersion, CREATE_CPMM_POOL_PROGRAM, CREATE_CPMM_POOL_FEE_ACC, parseTokenAccountResp, API_URLS } from '@raydium-io/raydium-sdk-v2' import BN from 'bn.js' import bs58 from "bs58"; import * as core from "express-serve-static-core"; import { TOKEN_PROGRAM_ID, TOKEN_2022_PROGRAM_ID, NATIVE_MINT, } from '@solana/spl-token'; import axios from "axios"; import { cloneAndSnakeCaseFields } from "./utils"; import { SOLANA_RPC_ENDPOINT } from "./contants"; export const raydiumAPIRouterInit = (app: core.Express) => { interface SwapCompute { id: string success: true version: 'V0' | 'V1' openTime?: undefined msg: undefined data: { swapType: 'BaseIn' | 'BaseOut' inputMint: string inputAmount: string outputMint: string outputAmount: string otherAmountThreshold: string slippageBps: number priceImpactPct: number routePlan: { poolId: string inputMint: string outputMint: string feeMint: string feeRate: number feeAmount: string }[] } } const fetchTokenAccountData = async (owner: solanaWeb3.Keypair) => { let connection = new solanaWeb3.Connection(SOLANA_RPC_ENDPOINT); const solAccountResp = await connection.getAccountInfo(owner.publicKey) const tokenAccountResp = await connection.getTokenAccountsByOwner(owner.publicKey, { programId: TOKEN_PROGRAM_ID }) const token2022Req = await connection.getTokenAccountsByOwner(owner.publicKey, { programId: TOKEN_2022_PROGRAM_ID }) const tokenAccountData = parseTokenAccountResp({ owner: owner.publicKey, solAccountResp, tokenAccountResp: { context: tokenAccountResp.context, value: [...tokenAccountResp.value, ...token2022Req.value], }, }) return tokenAccountData } app.post('/solana/compute-raydium', async (req, res) => { try { const { input_mint, output_mint, slippage, amount } = req.body; const txVersion: string = 'V0' // or LEGACY const { data: swapResponse } = await axios.get( `${API_URLS.SWAP_HOST }/compute/swap-base-in?inputMint=${input_mint}&outputMint=${output_mint}&amount=${amount}&slippageBps=${slippage * 100}&txVersion=${txVersion}` ) res .status(200) .send({ result: cloneAndSnakeCaseFields(swapResponse['data']), }) } catch (error) { res .status(400) .send({ result: null, error: { message: error['message'] } }) } }); app.post('/solana/trade-raydium', async (req, res) => { try { // let connection = new solanaWeb3.Connection(SOLANA_RPC_ENDPOINT, "confirmed"); let connection = new solanaWeb3.Connection(SOLANA_RPC_ENDPOINT); const { address, input_mint, output_mint, slippage, amount } = req.body; const privateKey = await GetAddressPrk(address) const signerKeyPair = solanaWeb3.Keypair.fromSecretKey(bs58.decode(privateKey)); const { tokenAccounts } = await fetchTokenAccountData(signerKeyPair) const [isInputSol, isOutputSol] = [input_mint === NATIVE_MINT.toBase58(), output_mint === NATIVE_MINT.toBase58()] const inputTokenAcc = tokenAccounts.find((a) => a.mint.toBase58() === input_mint)?.publicKey const outputTokenAcc = tokenAccounts.find((a) => a.mint.toBase58() === output_mint)?.publicKey if (!inputTokenAcc && !isInputSol) { throw new Error('do not have input token account') } const { data } = await axios.get<{ id: string success: boolean data: { default: { vh: number; h: number; m: number } } }>(`${API_URLS.BASE_HOST}${API_URLS.PRIORITY_FEE}`) const txVersion: string = 'V0' // or LEGACY const isV0Tx = txVersion === 'V0' const { data: swapResponse } = await axios.get( `${API_URLS.SWAP_HOST }/compute/swap-base-in?inputMint=${input_mint}&outputMint=${output_mint}&amount=${amount}&slippageBps=${slippage * 100}&txVersion=${txVersion}` ) const { data: swapTransactions } = await axios.post<{ id: string version: string success: boolean data: { transaction: string }[] }>(`${API_URLS.SWAP_HOST}/transaction/swap-base-in`, { computeUnitPriceMicroLamports: String(data.data.default.h), swapResponse, txVersion, wallet: signerKeyPair.publicKey.toBase58(), wrapSol: isInputSol, unwrapSol: isOutputSol, // true means output mint receive sol, false means output mint received wsol inputAccount: isInputSol ? undefined : inputTokenAcc?.toBase58(), outputAccount: isOutputSol ? undefined : outputTokenAcc?.toBase58(), }) const allTxBuf = swapTransactions.data.map((tx) => Buffer.from(tx.transaction, 'base64')) const allTransactions = allTxBuf.map((txBuf) => isV0Tx ? solanaWeb3.VersionedTransaction.deserialize(txBuf) : solanaWeb3.Transaction.from(txBuf) ) const signatures: string[] = [] if (!isV0Tx) { for (const tx of allTransactions) { const transaction = tx as solanaWeb3.Transaction transaction.sign(signerKeyPair) const smRsp = (await connection.simulateTransaction(transaction)).value as solanaWeb3.SimulatedTransactionResponse if (smRsp.err != null) { throw new Error(smRsp.err.toString()) } const signature = await connection.sendTransaction(transaction, [signerKeyPair], { skipPreflight: true }) signatures.push(signature) } } else { for (const tx of allTransactions) { const transaction = tx as solanaWeb3.VersionedTransaction transaction.sign([signerKeyPair]) const smRsp = (await connection.simulateTransaction(transaction)).value as solanaWeb3.SimulatedTransactionResponse if (smRsp.err != null) { throw new Error(smRsp.err.toString()) } const signature = await connection.sendTransaction(tx as solanaWeb3.VersionedTransaction, { skipPreflight: true }) const { lastValidBlockHeight, blockhash } = await connection.getLatestBlockhash({ commitment: 'confirmed', }) await connection.confirmTransaction( { blockhash, lastValidBlockHeight, signature: signature, }, 'confirmed' ) signatures.push(signature) } } res .status(200) .send({ result: { 'output_amount': swapResponse.data.outputAmount, 'signatures': signatures }, }) } catch (error) { res .status(400) .send({ result: null, error: { message: error['message'] } }) } }); app.post('/solana/raydium-create-cpmm-pool', async (req, res) => { try { // let connection = new solanaWeb3.Connection(SOLANA_RPC_ENDPOINT); let connection: any = new solanaWeb3.Connection(SOLANA_RPC_ENDPOINT); const privateKey = await GetAddressPrk(req.body.address) var owner: any = solanaWeb3.Keypair.fromSecretKey(ethers.toBeArray(decodeBase58(privateKey))); const raydium = await Raydium.load({ owner, connection, cluster: 'mainnet', disableFeatureCheck: true, disableLoadToken: false, }) const mintA = await raydium.token.getTokenInfo(req.body.mint_a) const mintB = await raydium.token.getTokenInfo(req.body.mint_b) const txVersion = TxVersion.V0 // or TxVersion.LEGACY const feeConfigs = await raydium.api.getCpmmConfigs() const { execute, extInfo } = await raydium.cpmm.createPool({ programId: CREATE_CPMM_POOL_PROGRAM, poolFeeAccount: CREATE_CPMM_POOL_FEE_ACC, mintA, mintB, mintAAmount: new BN(req.body.amount_a), mintBAmount: new BN(req.body.amount_b), startTime: new BN(0), feeConfig: feeConfigs[0], associatedOnly: false, ownerInfo: { useSOLBalance: true, }, txVersion, }) const { txId } = await execute() res .status(200) .send({ result: { 'signature': txId, 'extInfo': extInfo, }, }) } catch (error) { res .status(400) .send({ result: null, error: { message: error } }) } }); } ================================================ FILE: agent-as-a-service/agent-orchestration/lib-services/src/server.ts ================================================ import * as dotenv from "dotenv"; import express from "express"; import bs58 from "bs58"; import { GetAddressPrk, StoreAddress } from "./core"; import { decodeBase58, decodeBase64, encodeBase58, ethers } from "ethers"; import * as solanaWeb3 from "@solana/web3.js"; import axios from "axios"; import * as cheerio from "cheerio"; import { neynarAPIRouterInit } from "./neynar"; import { createUmi } from '@metaplex-foundation/umi-bundle-defaults'; import { GetProgramAccountsFilter } from "@solana/web3.js"; import { AuthorityType, createSetAuthorityInstruction, createTransferInstruction, getOrCreateAssociatedTokenAccount, TOKEN_PROGRAM_ID } from "@solana/spl-token"; import { cloneAndSnakeCaseFields } from "./utils"; import { raydiumAPIRouterInit } from "./raydium"; import { createAndMint, mplTokenMetadata, TokenStandard } from "@metaplex-foundation/mpl-token-metadata"; import { createSignerFromKeypair, generateSigner, percentAmount, signerIdentity } from "@metaplex-foundation/umi"; import { SOLANA_RPC_ENDPOINT } from "./contants"; dotenv.config(); const app = express(); app.use(express.json({ limit: '50mb' })); app.use(express.urlencoded({ limit: '50mb' })); // SOLANA app.post('/solana/address', async (req, res) => { try { const keyPair = solanaWeb3.Keypair.generate() const address = keyPair.publicKey.toBase58() const privateKey = encodeBase58(keyPair.secretKey) var fromKey = solanaWeb3.Keypair.fromSecretKey(ethers.toBeArray(decodeBase58(privateKey))); if (fromKey.publicKey.toBase58() != address) { throw 'prk not valid' } await StoreAddress( 'mainnet', address, privateKey, ) const prk = await GetAddressPrk(address) if (privateKey != prk) { throw 'prk not found' } var fromKey = solanaWeb3.Keypair.fromSecretKey(ethers.toBeArray(decodeBase58(prk))); if (fromKey.publicKey.toBase58() != address) { throw 'prk not valid' } res .status(200) .send({ result: { address: address, }, }) } catch (error) { res .status(400) .send({ result: null, error: { message: error } }) } }); app.get('/solana/blockheight', async (req, res) => { try { let connection = new solanaWeb3.Connection(SOLANA_RPC_ENDPOINT); const number = await connection.getBlockHeight("finalized") res .status(200) .send({ result: Number(number), }) } catch (error) { res .status(400) .send({ result: null, error: { message: error } }) } }); app.get('/solana/balance/:address', async (req, res) => { try { const address = new solanaWeb3.PublicKey(req.params.address) let connection = new solanaWeb3.Connection(SOLANA_RPC_ENDPOINT); const balance = await connection.getBalance(address) res .status(200) .send({ result: Number(balance), }) } catch (error) { res .status(400) .send({ result: null, error: { message: error } }) } }); app.post('/clean-html', async (req, res) => { const { url } = req.body; let { html_data } = req.body; try { if (url != "") { const result = await axios.get(url); html_data = result.data } // const result = await axios.get(url); console.log(html_data) const $ = cheerio.load(html_data); const text = $('html').prop('innerText'); let replacedText = text.replace(/[\n\t]/g, ''); replacedText = replacedText.replace(/ +/g, ' '); console.log(replacedText); res.status(200).send({ result: replacedText }) } catch (error) { res .status(400) .send({ result: null, error: { message: error } }) } }); app.get('/solana/token-info/:mint', async (req, res) => { try { const mint = new solanaWeb3.PublicKey(req.params.mint) let connection = new solanaWeb3.Connection(SOLANA_RPC_ENDPOINT, "confirmed"); let mintInfo = await connection.getParsedAccountInfo( new solanaWeb3.PublicKey(mint) ) res .status(200) .send({ result: mintInfo.value, }) } catch (error) { res .status(400) .send({ result: null, error: { message: error } }) } }); app.get('/solana/balances/:address', async (req, res) => { try { const address = new solanaWeb3.PublicKey(req.params.address) let connection = new solanaWeb3.Connection(SOLANA_RPC_ENDPOINT); const filters: GetProgramAccountsFilter[] = [ { dataSize: 165, }, { memcmp: { offset: 32, bytes: address.toString(), }, }]; const accounts = await connection.getParsedProgramAccounts( TOKEN_PROGRAM_ID, { filters: filters } ); const balances = [] const balance = await connection.getBalance(address) balances.push({ is_native: true, mint: '', owner: address, state: 'initialized', token_amount: { amount: balance.toString(), decimals: 9, ui_amount: Number((balance / 1e9).toFixed(9)), ui_amount_string: ((balance / 1e9).toFixed(9)).toString(), } }) accounts.forEach((account, i) => { const parsedAccountInfo: any = account.account.data; if (parsedAccountInfo.parsed.info.tokenAmount.uiAmount > 0) { balances.push(cloneAndSnakeCaseFields(parsedAccountInfo.parsed.info)) } }); res .status(200) .send({ result: balances, }) } catch (error) { res .status(400) .send({ result: null, error: { message: error } }) } }); app.post('/solana/create-pumfun', async (req, res) => { try { let connection = new solanaWeb3.Connection(SOLANA_RPC_ENDPOINT, "confirmed"); const { address, name, symbol, description, twitter, telegram, website, image_base64, amount } = req.body; const privateKey = await GetAddressPrk(address) const signerKeyPair = solanaWeb3.Keypair.fromSecretKey(bs58.decode(privateKey)); // Generate a random keypair for token const mintKeypair = solanaWeb3.Keypair.generate(); // Define token metadata const formData = new FormData(); if (image_base64 && image_base64 != '') { const blob = new Blob([decodeBase64(image_base64)], { type: "application/octet-stream" }); formData.append("file", blob, "icon.png") } formData.append("name", name) formData.append("symbol", symbol) formData.append("description", description) formData.append("twitter", twitter) formData.append("telegram", telegram) formData.append("website", website) formData.append("showName", "true") // Create IPFS metadata storage const metadataResponse = await fetch("https://pump.fun/api/ipfs", { method: "POST", body: formData, }); const metadataResponseJSON = await metadataResponse.json(); // Get the create transaction const response = await fetch(`https://pumpportal.fun/api/trade-local`, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ "publicKey": signerKeyPair.publicKey.toBase58(), "action": "create", "tokenMetadata": { name: metadataResponseJSON.metadata.name, symbol: metadataResponseJSON.metadata.symbol, uri: metadataResponseJSON.metadataUri }, "mint": mintKeypair.publicKey.toBase58(), "denominatedInSol": "true", "amount": Number(amount), // dev buy of 1 SOL "slippage": 5, "priorityFee": 0.00005, "pool": "pump" }) }); var signature: solanaWeb3.TransactionSignature if (response.status === 200) { // successfully generated transaction const data = await response.arrayBuffer(); const tx = solanaWeb3.VersionedTransaction.deserialize(new Uint8Array(data)); tx.sign([mintKeypair, signerKeyPair]); signature = await connection.sendTransaction(tx) } else { throw new Error(response.statusText); } res .status(200) .send({ result: { 'signature': signature, "mint": mintKeypair.publicKey.toBase58(), }, }) } catch (error) { res .status(400) .send({ result: null, error: { message: error['message'] } }) } }); app.post('/solana/trade-pumfun', async (req, res) => { try { let connection = new solanaWeb3.Connection(SOLANA_RPC_ENDPOINT, "confirmed"); const { address, action, mint, amount, pool } = req.body; const privateKey = await GetAddressPrk(address) const signerKeyPair = solanaWeb3.Keypair.fromSecretKey(bs58.decode(privateKey)); // Get the create transaction const response = await fetch(`https://pumpportal.fun/api/trade-local`, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ "publicKey": signerKeyPair.publicKey.toBase58(), "action": action, "mint": mint, "denominatedInSol": action == "buy" ? "true" : "false", "amount": Number(amount), "slippage": 5, "priorityFee": 0.00005, "pool": pool }) }); var signature: solanaWeb3.TransactionSignature if (response.status === 200) { // successfully generated transaction const data = await response.arrayBuffer(); const tx = solanaWeb3.VersionedTransaction.deserialize(new Uint8Array(data)); tx.sign([signerKeyPair]); signature = await connection.sendTransaction(tx) } else { throw new Error(response.statusText); } res .status(200) .send({ result: signature, }) } catch (error) { res .status(400) .send({ result: null, error: { message: error['message'] } }) } }); async function getNumberDecimals(mintAddress: string): Promise { let connection = new solanaWeb3.Connection(SOLANA_RPC_ENDPOINT); const info = await connection.getParsedAccountInfo(new solanaWeb3.PublicKey(mintAddress)); const result = (info.value?.data as solanaWeb3.ParsedAccountData).parsed.info.decimals as number; return result; } app.post('/solana/transfer/:address', async (req, res) => { try { let connection = new solanaWeb3.Connection(SOLANA_RPC_ENDPOINT); const { to_address, mint, amount } = req.body; const privateKey = await GetAddressPrk(req.params.address) const signerKeyPair = solanaWeb3.Keypair.fromSecretKey(bs58.decode(privateKey)); var transaction: solanaWeb3.Transaction if (mint == "") { transaction = new solanaWeb3.Transaction().add( solanaWeb3.SystemProgram.transfer({ fromPubkey: signerKeyPair.publicKey, toPubkey: new solanaWeb3.PublicKey(to_address), lamports: Number((amount * 1e9).toFixed(0)), }), ); } else { let sourceAccount = await getOrCreateAssociatedTokenAccount( connection, signerKeyPair, new solanaWeb3.PublicKey(mint), signerKeyPair.publicKey ); let destinationAccount = await getOrCreateAssociatedTokenAccount( connection, signerKeyPair, new solanaWeb3.PublicKey(mint), new solanaWeb3.PublicKey(to_address) ); const numberDecimals = await getNumberDecimals(mint); transaction = new solanaWeb3.Transaction().add( createTransferInstruction( sourceAccount.address, destinationAccount.address, signerKeyPair.publicKey, Number((amount * Math.pow(10, numberDecimals)).toFixed(0)), ), ); } const signature = await solanaWeb3.sendAndConfirmTransaction( connection, transaction, [signerKeyPair], ); res .status(200) .send({ result: signature, }) } catch (error) { res .status(400) .send({ result: null, error: { message: error } }) } }); app.post('/solana/create-token', async (req, res) => { try { const rpcUrl = SOLANA_RPC_ENDPOINT const { address, name, symbol, uri, amount } = req.body; const privateKey = await GetAddressPrk(address) const umi = createUmi(rpcUrl); //Replace with your QuickNode RPC Endpoint const userWallet = umi.eddsa.createKeypairFromSecretKey(new Uint8Array(bs58.decode(privateKey))); const userWalletSigner = createSignerFromKeypair(umi, userWallet); const metadata = { name: name, symbol: symbol, uri: uri, }; const mint = generateSigner(umi); umi.use(signerIdentity(userWalletSigner)); umi.use(mplTokenMetadata()) var createTokenTx = createAndMint( umi, { mint, authority: umi.identity, name: metadata.name, symbol: metadata.symbol, uri: metadata.uri, sellerFeeBasisPoints: percentAmount(0), decimals: 6, amount: amount * 1000000, tokenOwner: userWallet.publicKey, tokenStandard: TokenStandard.Fungible, } ) const signerKeyPair = solanaWeb3.Keypair.fromSecretKey(bs58.decode(privateKey)); createTokenTx = createTokenTx.add( [ { instruction: createSetAuthorityInstruction( mint.publicKey as any, signerKeyPair.publicKey, AuthorityType.MintTokens, null, [], TOKEN_PROGRAM_ID, ) as any, signers: [userWalletSigner] }, { instruction: createSetAuthorityInstruction( mint.publicKey as any, signerKeyPair.publicKey, AuthorityType.FreezeAccount, null, [], TOKEN_PROGRAM_ID, ), signers: [userWalletSigner] } ] as any ) const signature = await createTokenTx.sendAndConfirm(umi) res .status(200) .send({ result: { 'mint': mint.publicKey, 'signature': signature.signature, }, }) } catch (error) { res .status(400) .send({ result: null, error: { message: error } }) } }); // RAYDIUM raydiumAPIRouterInit(app) // NEYNAR neynarAPIRouterInit(app) app.listen(8080, () => { console.log(`[server]: Server is running at ${8080}`); }); ================================================ FILE: agent-as-a-service/agent-orchestration/lib-services/src/utils.ts ================================================ function toSnakeCase(str: string): string { return str.replace(/[A-Z]/g, (letter) => `_${letter.toLowerCase()}`); } export const cloneAndSnakeCaseFields = >(obj: T): T => { if (obj == null || obj == undefined) { return null } const transformKeysToSnakeCase = (input: any): any => { if (input && typeof input === "object" && !Array.isArray(input)) { return Object.entries(input).reduce((acc, [key, value]) => { const snakeCaseKey = toSnakeCase(key); acc[snakeCaseKey] = transformKeysToSnakeCase(value); return acc; }, {} as any); } else if (Array.isArray(input)) { return input.map(item => transformKeysToSnakeCase(item)); } else { return input; } }; return transformKeysToSnakeCase(obj); } ================================================ FILE: agent-as-a-service/agent-orchestration/lib-services/tsconfig-scryptTS.json ================================================ { "extends": "./tsconfig.json", "include": [ "src/catprotocol/smartcontract/contracts/**/*.ts" ], "compilerOptions": { "noEmit": true, "experimentalDecorators": true, "target": "ESNext", "esModuleInterop": true } } ================================================ FILE: agent-as-a-service/agent-orchestration/lib-services/tsconfig.json ================================================ { "compilerOptions": { "module": "commonjs", "sourceMap": true, "outDir": "./dist", "strict": true, "resolveJsonModule": true, "esModuleInterop": true, "declaration": true, "removeComments": true, "emitDecoratorMetadata": true, "experimentalDecorators": true, "allowSyntheticDefaultImports": true, "target": "ES2021", "baseUrl": "./", "incremental": true, "skipLibCheck": true, "strictNullChecks": false, "noImplicitAny": false, "strictBindCallApply": false, "forceConsistentCasingInFileNames": false, "noFallthroughCasesInSwitch": false }, "include": [ "src/**/*.ts" ], "exclude": [ "node_modules" ] } ================================================ FILE: agent-as-a-service/agent-orchestration/md.go ================================================ ================================================ FILE: agent-as-a-service/agent-orchestration/remote-service/.cursorignore ================================================ configs/config.json ================================================ FILE: agent-as-a-service/agent-orchestration/remote-service/.gitignore ================================================ .DS_Store # Binaries for programs and plugins *.exe *.exe~ *.dll *.so *.dylib *.log # Test binary, build with `go test -c` *.test # Output of the go coverage tool, specifically when used with LiteIDE *.out .env .vscode node_modules dist configs/firebase_service_account.json configs/google_storage.json configs/pubsub.json configs/config.json configs/config.json_ config/config.json vendor* tmp/* test_* .vendor* .tmp/* .test_* .idea .vscode Gopkg.lock Gopkg.toml merge.sh merge_*.sh logs log.log __debug_bin node_modules .env dist build Makefile api.http ================================================ FILE: agent-as-a-service/agent-orchestration/remote-service/cmd/client/main.go ================================================ package main import ( "bufio" "context" "fmt" "io" "log" "os" "strings" pb "agent-remote-svc/proto" "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" "google.golang.org/grpc/metadata" ) var requestID int64 = 0 func getNextRequestID() int64 { requestID++ return requestID } func main() { // Connect to the server conn, err := grpc.Dial("localhost:50051", grpc.WithTransportCredentials(insecure.NewCredentials())) if err != nil { log.Fatalf("did not connect: %v", err) } defer conn.Close() // Create a client client := pb.NewScriptServiceClient(conn) // Create context with longer timeout and API key ctx := context.Background() // Add API key to context metadata if len(os.Args) < 2 { log.Fatal("API key must be provided as command line argument") } log.Printf("API key: %s", os.Args[1]) ctx = metadata.AppendToOutgoingContext(ctx, "api-key", os.Args[1]) // Create scanner for reading input scanner := bufio.NewScanner(os.Stdin) fmt.Println("Agent Remote Service Client") fmt.Println("Enter commands (type 'exit' to quit):") fmt.Println("----------------------------------------") for { fmt.Print("> ") if !scanner.Scan() { break } cmd := strings.TrimSpace(scanner.Text()) if cmd == "exit" { break } if cmd == "" { continue } strs := strings.Split(cmd, " ") if len(strs) < 1 { fmt.Println("Invalid command") continue } method := strs[0] var paramsJSON string if len(strs) > 1 { paramsJSON = strings.Join(strs[1:], " ") } // Create RPC request with ID request := &pb.RPCRequest{ Method: method, Params: paramsJSON, Id: getNextRequestID(), } // Call ExecuteRPC and get stream with retry logic var stream pb.ScriptService_ExecuteRPCClient stream, err = client.ExecuteRPC(ctx, request) if err != nil { log.Printf("error calling ExecuteRPC: %v", err) continue } // Receive streaming responses fmt.Println("----------------------------------------") for { resp, err := stream.Recv() if err == io.EOF { fmt.Println("----------------------------------------") break } if err != nil { if ctx.Err() == context.DeadlineExceeded { log.Printf("Stream timeout: %v", err) break } log.Printf("Error receiving response: %v", err) break } if resp.IsError { fmt.Printf("[ID:%d] Error: %s\n", resp.Id, resp.Output) } else { fmt.Printf("[ID:%d] %s\n", resp.Id, resp.Output) } } } } ================================================ FILE: agent-as-a-service/agent-orchestration/remote-service/cmd/server/discover/discover.go ================================================ package discover import ( "bytes" "encoding/json" "fmt" "log" "net" "os" "runtime" ) const ( discoveryPort = 9999 bufferSize = 1024 ) type DeviceInfo struct { Name string `json:"name"` IP string `json:"ip"` OS string `json:"os"` Hostname string `json:"hostname"` MACAddress string `json:"mac_address"` } func getLocalIP() string { addrs, err := net.InterfaceAddrs() if err != nil { log.Printf("Error getting local IP: %v", err) return "" } for _, addr := range addrs { if ipnet, ok := addr.(*net.IPNet); ok && !ipnet.IP.IsLoopback() { if ipnet.IP.To4() != nil { return ipnet.IP.String() } } } return "" } func getMACAddress() string { interfaces, err := net.Interfaces() if err != nil { log.Printf("Error getting MAC address: %v", err) return "" } for _, i := range interfaces { if i.Flags&net.FlagUp != 0 && !bytes.Equal(i.HardwareAddr, nil) { return i.HardwareAddr.String() } } return "" } func DiscoverStart() { // Get device information hostname, err := os.Hostname() if err != nil { log.Printf("Error getting hostname: %v", err) hostname = "unknown" } deviceInfo := DeviceInfo{ Name: "Neuron Device", IP: getLocalIP(), OS: runtime.GOOS, Hostname: hostname, MACAddress: getMACAddress(), } // Create UDP address addr, err := net.ResolveUDPAddr("udp", fmt.Sprintf(":%d", discoveryPort)) if err != nil { log.Fatalf("Error resolving UDP address: %v", err) } // Create UDP connection conn, err := net.ListenUDP("udp", addr) if err != nil { log.Fatalf("Error creating UDP connection: %v", err) } defer conn.Close() log.Printf("Device discovery server started on port %d", discoveryPort) log.Printf("Device info: %+v", deviceInfo) buffer := make([]byte, bufferSize) for { n, remoteAddr, err := conn.ReadFromUDP(buffer) if err != nil { log.Printf("Error reading UDP: %v", err) continue } message := string(buffer[:n]) log.Printf("Received message from %s: %s", remoteAddr, message) if message == "AGENT_DISCOVER" { // Marshal device info to JSON response, err := json.Marshal(deviceInfo) if err != nil { log.Printf("Error marshaling response: %v", err) continue } // Send response _, err = conn.WriteToUDP(response, remoteAddr) if err != nil { log.Printf("Error sending response: %v", err) continue } log.Printf("Sent device info to %s", remoteAddr) } } } ================================================ FILE: agent-as-a-service/agent-orchestration/remote-service/cmd/server/main.go ================================================ package main import ( "bufio" "encoding/base64" "encoding/json" "fmt" "io" "log" "net" "net/http" "os" "os/exec" "path/filepath" "strings" "sync" "agent-remote-svc/cmd/server/discover" pb "agent-remote-svc/proto" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" "google.golang.org/grpc/peer" "google.golang.org/grpc/status" ) var ( port = ":50051" validAPIKey string ) func init() { if len(os.Args) < 2 { log.Fatal("API key must be provided as command line argument") } validAPIKey = os.Args[1] log.Printf("API key: %s", validAPIKey) } type server struct { pb.UnimplementedScriptServiceServer } // ScriptParams represents the parameters for script execution type ScriptParams struct { Script string `json:"script"` } // UploadFileParams represents the parameters for file upload type UploadFileParams struct { FileName string `json:"file_name"` FileDataBase64 string `json:"file_data_base64"` } // DownloadFileParams represents the parameters for file download type DownloadFileParams struct { FileUrl string `json:"file_url"` FileName string `json:"file_name"` } // DockerParams represents the parameters for docker command type DockerParams struct { Command string `json:"command"` } type ProgressReader struct { OnProgress func(pos int64, size int64, percent int64) Reader io.Reader Size int64 Pos int64 Percent int64 } func (pr *ProgressReader) Read(p []byte) (int, error) { n, err := pr.Reader.Read(p) if err == nil { pr.Pos += int64(n) percent := pr.Pos * 100 / pr.Size if percent != pr.Percent { pr.Percent = percent if pr.OnProgress != nil { pr.OnProgress(pr.Pos, pr.Size, percent) } } } return n, err } func (s *server) ExecuteRPC(req *pb.RPCRequest, stream pb.ScriptService_ExecuteRPCServer) error { // get request ip p, ok := peer.FromContext(stream.Context()) if !ok || p == nil { return s.responseError(stream, req, status.Error(codes.Internal, "failed to get peer info")) } ip, _, err := net.SplitHostPort(p.Addr.String()) if err != nil { return s.responseError(stream, req, status.Error(codes.Internal, fmt.Sprintf("failed to get request ip: %v", err))) } fmt.Printf("ExecuteRPC: %s %v\n", ip, req) // Get API key from metadata md, ok := metadata.FromIncomingContext(stream.Context()) if !ok { return s.responseError(stream, req, status.Error(codes.Unauthenticated, "missing metadata")) } apiKeys := md.Get("api-key") if len(apiKeys) == 0 || apiKeys[0] != validAPIKey { stream.Send(&pb.RPCResponse{ Id: req.Id, Method: req.Method, Output: "invalid API key", IsError: true, }) return s.responseError(stream, req, status.Error(codes.Unauthenticated, "invalid API key")) } // Handle different methods switch req.Method { case "ping": { stream.Send(&pb.RPCResponse{ Id: req.Id, Method: req.Method, Output: "pong", IsError: false, }) } case "execute_script": { var params ScriptParams if err := json.Unmarshal([]byte(req.Params), ¶ms); err != nil { return s.responseError(stream, req, status.Error(codes.InvalidArgument, fmt.Sprintf("invalid params: %v", err))) } // Create a shell command cmd := exec.Command("sh", "-c", params.Script) // Get stdout pipe stdout, err := cmd.StdoutPipe() if err != nil { return s.responseError(stream, req, status.Error(codes.Internal, fmt.Sprintf("failed to create stdout pipe: %v", err))) } // Get stderr pipe stderr, err := cmd.StderrPipe() if err != nil { return s.responseError(stream, req, status.Error(codes.Internal, fmt.Sprintf("failed to create stderr pipe: %v", err))) } // Start the command if err := cmd.Start(); err != nil { return s.responseError(stream, req, status.Error(codes.Internal, fmt.Sprintf("failed to start command: %v", err))) } // Create a WaitGroup to track goroutines var wg sync.WaitGroup wg.Add(2) // Create a goroutine to read stdout go func() { defer wg.Done() reader := bufio.NewReader(stdout) for { line, err := reader.ReadString('\n') if err != nil { if err != io.EOF { log.Printf("Error reading stdout: %v", err) } return } stream.Send(&pb.RPCResponse{ Id: req.Id, Method: req.Method, Output: strings.TrimSpace(line), IsError: false, }) } }() // Create a goroutine to read stderr go func() { defer wg.Done() reader := bufio.NewReader(stderr) for { line, err := reader.ReadString('\n') if err != nil { if err != io.EOF { log.Printf("Error reading stderr: %v", err) } return } stream.Send(&pb.RPCResponse{ Id: req.Id, Method: req.Method, Output: strings.TrimSpace(line), IsError: true, }) } }() // Wait for the command to finish if err := cmd.Wait(); err != nil { return s.responseError(stream, req, status.Error(codes.Internal, fmt.Sprintf("command failed: %v", err))) } // Wait for all goroutines to finish wg.Wait() } case "get_upload_dir": { currentDir, err := os.Getwd() if err != nil { return s.responseError(stream, req, status.Error(codes.Internal, fmt.Sprintf("failed to get current directory: %v", err))) } stream.Send(&pb.RPCResponse{ Id: req.Id, Method: req.Method, Output: currentDir + "/uploads", IsError: false, }) return s.responseError(stream, req, status.Error(codes.OK, currentDir+"/uploads")) } case "upload_file": { var params UploadFileParams if err := json.Unmarshal([]byte(req.Params), ¶ms); err != nil { return s.responseError(stream, req, status.Error(codes.InvalidArgument, fmt.Sprintf("invalid params: %v", err))) } // Decode base64 file data fileData, err := base64.StdEncoding.DecodeString(params.FileDataBase64) if err != nil { return s.responseError(stream, req, status.Error(codes.InvalidArgument, fmt.Sprintf("failed to decode file data: %v", err))) } // Create directory if it doesn't exist currentDir, err := os.Getwd() if err != nil { return s.responseError(stream, req, status.Error(codes.Internal, fmt.Sprintf("failed to get current directory: %v", err))) } err = os.MkdirAll(currentDir+"/uploads/", 0755) if err != nil { return s.responseError(stream, req, status.Error(codes.Internal, fmt.Sprintf("failed to create directory: %v", err))) } // Create file path filePath := currentDir + "/uploads/" + strings.TrimPrefix(params.FileName, "/") // Create directory if it doesn't exist fileDir := filepath.Dir(filePath) // check if directory exists if _, err := os.Stat(fileDir); os.IsNotExist(err) { err = os.MkdirAll(fileDir, 0755) if err != nil { return s.responseError(stream, req, status.Error(codes.Internal, fmt.Sprintf("failed to create directory: %v", err))) } } err = os.WriteFile(filePath, fileData, 0644) if err != nil { return s.responseError(stream, req, status.Error(codes.Internal, fmt.Sprintf("failed to write file: %v", err))) } stream.Send(&pb.RPCResponse{ Id: req.Id, Method: req.Method, Output: filePath, IsError: false, }) } case "download_file": { var params DownloadFileParams if err := json.Unmarshal([]byte(req.Params), ¶ms); err != nil { return s.responseError(stream, req, status.Error(codes.InvalidArgument, fmt.Sprintf("invalid params: %v", err))) } // Download the file from the URL resp, err := http.Get(params.FileUrl) if err != nil { return s.responseError(stream, req, status.Error(codes.Internal, fmt.Sprintf("failed to download file: %v", err))) } defer resp.Body.Close() // Create directory if it doesn't exist currentDir, err := os.Getwd() if err != nil { return s.responseError(stream, req, status.Error(codes.Internal, fmt.Sprintf("failed to get current directory: %v", err))) } err = os.MkdirAll(currentDir+"/uploads/", 0755) if err != nil { return s.responseError(stream, req, status.Error(codes.Internal, fmt.Sprintf("failed to create directory: %v", err))) } // Create file path filePath := currentDir + "/uploads/" + strings.TrimPrefix(params.FileName, "/") // Create directory if it doesn't exist fileDir := filepath.Dir(filePath) // check if directory exists if _, err := os.Stat(fileDir); os.IsNotExist(err) { err = os.MkdirAll(fileDir, 0755) if err != nil { return s.responseError(stream, req, status.Error(codes.Internal, fmt.Sprintf("failed to create directory: %v", err))) } } // Create a new file file, err := os.Create(filePath) if err != nil { return s.responseError(stream, req, status.Error(codes.Internal, fmt.Sprintf("failed to create file: %v", err))) } // Create a progress reader progressReader := &ProgressReader{ Reader: resp.Body, Size: resp.ContentLength, OnProgress: func(pos int64, size int64, percent int64) { stream.Send(&pb.RPCResponse{ Id: req.Id, Method: req.Method, Output: fmt.Sprintf("Downloading file %d bytes of %d (%d%%)", pos, size, percent), IsError: false, }) }, } if _, err := io.Copy(file, progressReader); err != nil { return s.responseError(stream, req, status.Error(codes.Internal, fmt.Sprintf("failed to copy file: %v", err))) } // Close the file err = file.Close() if err != nil { return s.responseError(stream, req, status.Error(codes.Internal, fmt.Sprintf("failed to close file: %v", err))) } stream.Send(&pb.RPCResponse{ Id: req.Id, Method: req.Method, Output: filePath, IsError: false, }) } case "docker": { var params DockerParams if err := json.Unmarshal([]byte(req.Params), ¶ms); err != nil { return s.responseError(stream, req, status.Error(codes.InvalidArgument, fmt.Sprintf("invalid params: %v", err))) } commands := strings.Split(params.Command, " ") if len(commands) == 0 { return s.responseError(stream, req, status.Error(codes.InvalidArgument, "command is required")) } // Create a shell command cmd := exec.Command("docker", commands...) // Get stdout and stderr pipes stdout, err := cmd.StdoutPipe() if err != nil { return s.responseError(stream, req, status.Error(codes.Internal, fmt.Sprintf("failed to create stdout pipe: %v", err))) } stderr, err := cmd.StderrPipe() if err != nil { return s.responseError(stream, req, status.Error(codes.Internal, fmt.Sprintf("failed to create stderr pipe: %v", err))) } // Start the command if err := cmd.Start(); err != nil { return s.responseError(stream, req, status.Error(codes.Internal, fmt.Sprintf("failed to start command: %v", err))) } // Create a WaitGroup to track goroutines var wg sync.WaitGroup wg.Add(2) // Create a goroutine to read stdout go func() { defer wg.Done() reader := bufio.NewReader(stdout) for { line, err := reader.ReadString('\n') if err != nil { if err != io.EOF { log.Printf("Error reading stdout: %v", err) } return } stream.Send(&pb.RPCResponse{ Id: req.Id, Method: req.Method, Output: strings.TrimSpace(line), IsError: false, }) } }() // Create a goroutine to read stderr go func() { defer wg.Done() reader := bufio.NewReader(stderr) for { line, err := reader.ReadString('\n') if err != nil { if err != io.EOF { log.Printf("Error reading stderr: %v", err) } return } stream.Send(&pb.RPCResponse{ Id: req.Id, Method: req.Method, Output: strings.TrimSpace(line), IsError: true, }) } }() // Wait for the command to finish if err := cmd.Wait(); err != nil { return s.responseError(stream, req, status.Error(codes.Internal, fmt.Sprintf("command failed: %v", err))) } // Wait for all goroutines to finish wg.Wait() } default: return s.responseError(stream, req, status.Error(codes.Unimplemented, fmt.Sprintf("method %s not implemented", req.Method))) } return nil } func (s *server) responseError(stream pb.ScriptService_ExecuteRPCServer, req *pb.RPCRequest, err error) error { stream.Send(&pb.RPCResponse{ Id: req.Id, Method: req.Method, Output: err.Error(), IsError: true, }) return err } func main() { // Start the discovery server go discover.DiscoverStart() // Start the RPC server lis, err := net.Listen("tcp", port) if err != nil { log.Fatalf("failed to listen: %v", err) } s := grpc.NewServer() pb.RegisterScriptServiceServer(s, &server{}) log.Printf("Server listening at %v", lis.Addr()) if err := s.Serve(lis); err != nil { log.Fatalf("failed to serve: %v", err) } } ================================================ FILE: agent-as-a-service/agent-orchestration/remote-service/go.mod ================================================ module agent-remote-svc go 1.21 require ( google.golang.org/grpc v1.62.1 google.golang.org/protobuf v1.33.0 ) require ( github.com/golang/protobuf v1.5.3 // indirect golang.org/x/net v0.26.0 // indirect golang.org/x/sys v0.21.0 // indirect golang.org/x/text v0.16.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80 // indirect ) ================================================ FILE: agent-as-a-service/agent-orchestration/remote-service/go.sum ================================================ github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80 h1:AjyfHzEPEFp/NpvfN5g+KDla3EMojjhRVZc1i7cj+oM= google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80/go.mod h1:PAREbraiVEVGVdTZsVWjSbbTtSyGbAgIIvni8a8CD5s= google.golang.org/grpc v1.62.1 h1:B4n+nfKzOICUXMgyrNd19h/I9oH0L1pizfk1d4zSgTk= google.golang.org/grpc v1.62.1/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= ================================================ FILE: agent-as-a-service/agent-orchestration/remote-service/proto/script.sh ================================================ protoc --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative proto/script_service.proto ================================================ FILE: agent-as-a-service/agent-orchestration/remote-service/proto/script_service.pb.go ================================================ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.36.6 // protoc v5.29.3 // source: proto/script_service.proto package proto import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" unsafe "unsafe" ) const ( // Verify that this generated code is sufficiently up-to-date. _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) // Verify that runtime/protoimpl is sufficiently up-to-date. _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) type RPCRequest struct { state protoimpl.MessageState `protogen:"open.v1"` ApiKey string `protobuf:"bytes,1,opt,name=api_key,json=apiKey,proto3" json:"api_key,omitempty"` Id int64 `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"` // Unique identifier for the request Method string `protobuf:"bytes,3,opt,name=method,proto3" json:"method,omitempty"` Params string `protobuf:"bytes,4,opt,name=params,proto3" json:"params,omitempty"` // JSON string containing parameters unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *RPCRequest) Reset() { *x = RPCRequest{} mi := &file_proto_script_service_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } func (x *RPCRequest) String() string { return protoimpl.X.MessageStringOf(x) } func (*RPCRequest) ProtoMessage() {} func (x *RPCRequest) ProtoReflect() protoreflect.Message { mi := &file_proto_script_service_proto_msgTypes[0] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use RPCRequest.ProtoReflect.Descriptor instead. func (*RPCRequest) Descriptor() ([]byte, []int) { return file_proto_script_service_proto_rawDescGZIP(), []int{0} } func (x *RPCRequest) GetApiKey() string { if x != nil { return x.ApiKey } return "" } func (x *RPCRequest) GetId() int64 { if x != nil { return x.Id } return 0 } func (x *RPCRequest) GetMethod() string { if x != nil { return x.Method } return "" } func (x *RPCRequest) GetParams() string { if x != nil { return x.Params } return "" } type RPCResponse struct { state protoimpl.MessageState `protogen:"open.v1"` Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // Echo back the request ID for correlation Method string `protobuf:"bytes,2,opt,name=method,proto3" json:"method,omitempty"` // Echo back the method for correlation Output string `protobuf:"bytes,3,opt,name=output,proto3" json:"output,omitempty"` IsError bool `protobuf:"varint,4,opt,name=is_error,json=isError,proto3" json:"is_error,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *RPCResponse) Reset() { *x = RPCResponse{} mi := &file_proto_script_service_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } func (x *RPCResponse) String() string { return protoimpl.X.MessageStringOf(x) } func (*RPCResponse) ProtoMessage() {} func (x *RPCResponse) ProtoReflect() protoreflect.Message { mi := &file_proto_script_service_proto_msgTypes[1] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use RPCResponse.ProtoReflect.Descriptor instead. func (*RPCResponse) Descriptor() ([]byte, []int) { return file_proto_script_service_proto_rawDescGZIP(), []int{1} } func (x *RPCResponse) GetId() int64 { if x != nil { return x.Id } return 0 } func (x *RPCResponse) GetMethod() string { if x != nil { return x.Method } return "" } func (x *RPCResponse) GetOutput() string { if x != nil { return x.Output } return "" } func (x *RPCResponse) GetIsError() bool { if x != nil { return x.IsError } return false } var File_proto_script_service_proto protoreflect.FileDescriptor const file_proto_script_service_proto_rawDesc = "" + "\n" + "\x1aproto/script_service.proto\x12\x06script\"e\n" + "\n" + "RPCRequest\x12\x17\n" + "\aapi_key\x18\x01 \x01(\tR\x06apiKey\x12\x0e\n" + "\x02id\x18\x02 \x01(\x03R\x02id\x12\x16\n" + "\x06method\x18\x03 \x01(\tR\x06method\x12\x16\n" + "\x06params\x18\x04 \x01(\tR\x06params\"h\n" + "\vRPCResponse\x12\x0e\n" + "\x02id\x18\x01 \x01(\x03R\x02id\x12\x16\n" + "\x06method\x18\x02 \x01(\tR\x06method\x12\x16\n" + "\x06output\x18\x03 \x01(\tR\x06output\x12\x19\n" + "\bis_error\x18\x04 \x01(\bR\aisError2J\n" + "\rScriptService\x129\n" + "\n" + "ExecuteRPC\x12\x12.script.RPCRequest\x1a\x13.script.RPCResponse\"\x000\x01B\x18Z\x16agent-remote-svc/protob\x06proto3" var ( file_proto_script_service_proto_rawDescOnce sync.Once file_proto_script_service_proto_rawDescData []byte ) func file_proto_script_service_proto_rawDescGZIP() []byte { file_proto_script_service_proto_rawDescOnce.Do(func() { file_proto_script_service_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_proto_script_service_proto_rawDesc), len(file_proto_script_service_proto_rawDesc))) }) return file_proto_script_service_proto_rawDescData } var file_proto_script_service_proto_msgTypes = make([]protoimpl.MessageInfo, 2) var file_proto_script_service_proto_goTypes = []any{ (*RPCRequest)(nil), // 0: script.RPCRequest (*RPCResponse)(nil), // 1: script.RPCResponse } var file_proto_script_service_proto_depIdxs = []int32{ 0, // 0: script.ScriptService.ExecuteRPC:input_type -> script.RPCRequest 1, // 1: script.ScriptService.ExecuteRPC:output_type -> script.RPCResponse 1, // [1:2] is the sub-list for method output_type 0, // [0:1] is the sub-list for method input_type 0, // [0:0] is the sub-list for extension type_name 0, // [0:0] is the sub-list for extension extendee 0, // [0:0] is the sub-list for field type_name } func init() { file_proto_script_service_proto_init() } func file_proto_script_service_proto_init() { if File_proto_script_service_proto != nil { return } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_proto_script_service_proto_rawDesc), len(file_proto_script_service_proto_rawDesc)), NumEnums: 0, NumMessages: 2, NumExtensions: 0, NumServices: 1, }, GoTypes: file_proto_script_service_proto_goTypes, DependencyIndexes: file_proto_script_service_proto_depIdxs, MessageInfos: file_proto_script_service_proto_msgTypes, }.Build() File_proto_script_service_proto = out.File file_proto_script_service_proto_goTypes = nil file_proto_script_service_proto_depIdxs = nil } ================================================ FILE: agent-as-a-service/agent-orchestration/remote-service/proto/script_service.proto ================================================ syntax = "proto3"; package script; option go_package = "agent-remote-svc/proto"; service ScriptService { rpc ExecuteRPC (RPCRequest) returns (stream RPCResponse) {} } message RPCRequest { string api_key = 1; int64 id = 2; // Unique identifier for the request string method = 3; string params = 4; // JSON string containing parameters } message RPCResponse { int64 id = 1; // Echo back the request ID for correlation string method = 2; // Echo back the method for correlation string output = 3; bool is_error = 4; } ================================================ FILE: agent-as-a-service/agent-orchestration/remote-service/proto/script_service_grpc.pb.go ================================================ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.3.0 // - protoc v5.29.3 // source: proto/script_service.proto package proto import ( context "context" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" ) // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. // Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 const ( ScriptService_ExecuteRPC_FullMethodName = "/script.ScriptService/ExecuteRPC" ) // ScriptServiceClient is the client API for ScriptService service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. type ScriptServiceClient interface { ExecuteRPC(ctx context.Context, in *RPCRequest, opts ...grpc.CallOption) (ScriptService_ExecuteRPCClient, error) } type scriptServiceClient struct { cc grpc.ClientConnInterface } func NewScriptServiceClient(cc grpc.ClientConnInterface) ScriptServiceClient { return &scriptServiceClient{cc} } func (c *scriptServiceClient) ExecuteRPC(ctx context.Context, in *RPCRequest, opts ...grpc.CallOption) (ScriptService_ExecuteRPCClient, error) { stream, err := c.cc.NewStream(ctx, &ScriptService_ServiceDesc.Streams[0], ScriptService_ExecuteRPC_FullMethodName, opts...) if err != nil { return nil, err } x := &scriptServiceExecuteRPCClient{stream} if err := x.ClientStream.SendMsg(in); err != nil { return nil, err } if err := x.ClientStream.CloseSend(); err != nil { return nil, err } return x, nil } type ScriptService_ExecuteRPCClient interface { Recv() (*RPCResponse, error) grpc.ClientStream } type scriptServiceExecuteRPCClient struct { grpc.ClientStream } func (x *scriptServiceExecuteRPCClient) Recv() (*RPCResponse, error) { m := new(RPCResponse) if err := x.ClientStream.RecvMsg(m); err != nil { return nil, err } return m, nil } // ScriptServiceServer is the server API for ScriptService service. // All implementations must embed UnimplementedScriptServiceServer // for forward compatibility type ScriptServiceServer interface { ExecuteRPC(*RPCRequest, ScriptService_ExecuteRPCServer) error mustEmbedUnimplementedScriptServiceServer() } // UnimplementedScriptServiceServer must be embedded to have forward compatible implementations. type UnimplementedScriptServiceServer struct { } func (UnimplementedScriptServiceServer) ExecuteRPC(*RPCRequest, ScriptService_ExecuteRPCServer) error { return status.Errorf(codes.Unimplemented, "method ExecuteRPC not implemented") } func (UnimplementedScriptServiceServer) mustEmbedUnimplementedScriptServiceServer() {} // UnsafeScriptServiceServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to ScriptServiceServer will // result in compilation errors. type UnsafeScriptServiceServer interface { mustEmbedUnimplementedScriptServiceServer() } func RegisterScriptServiceServer(s grpc.ServiceRegistrar, srv ScriptServiceServer) { s.RegisterService(&ScriptService_ServiceDesc, srv) } func _ScriptService_ExecuteRPC_Handler(srv interface{}, stream grpc.ServerStream) error { m := new(RPCRequest) if err := stream.RecvMsg(m); err != nil { return err } return srv.(ScriptServiceServer).ExecuteRPC(m, &scriptServiceExecuteRPCServer{stream}) } type ScriptService_ExecuteRPCServer interface { Send(*RPCResponse) error grpc.ServerStream } type scriptServiceExecuteRPCServer struct { grpc.ServerStream } func (x *scriptServiceExecuteRPCServer) Send(m *RPCResponse) error { return x.ServerStream.SendMsg(m) } // ScriptService_ServiceDesc is the grpc.ServiceDesc for ScriptService service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) var ScriptService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "script.ScriptService", HandlerType: (*ScriptServiceServer)(nil), Methods: []grpc.MethodDesc{}, Streams: []grpc.StreamDesc{ { StreamName: "ExecuteRPC", Handler: _ScriptService_ExecuteRPC_Handler, ServerStreams: true, }, }, Metadata: "proto/script_service.proto", } ================================================ FILE: agent-as-a-service/characters/luna.character.ts ================================================ import { AgentChainId, AgentTokenChainId, EFarcasterMissionToolSet, ETwitterMissionToolSet, IAgentCharacter, TokenSetupMode } from "@eternalai-dagent/core"; const LunaDagentCharacter: IAgentCharacter = { character: { "chain_id": AgentChainId.Base, "agent_name": "Luna Burner", "system_content": "Luna is a magical storyteller from the Land of Whimsy, where imagination takes flight and every tale is an adventure waiting to unfold.", "bio": [ "Luna is a magical storyteller who spins enchanting tales for curious kids.", "She lives in the Land of Whimsy, where every story begins with a sprinkle of imagination.", "Luna believes every child is a hero waiting to discover their adventure.", "She tells stories full of talking animals, brave explorers, and faraway kingdoms.", "Luna loves riddles, rhymes, and silly jokes that make kids giggle.", "Her stories often teach lessons about kindness, courage, and teamwork.", "Luna'''s favorite thing is turning kids''' ideas into amazing new stories.", "With Luna, every day is a new chance to imagine, dream, and create!" ], "lore": [ "Luna was born from a shooting star that landed in the Land of Whimsy.", "She lives in a magical library where the books write themselves as she speaks.", "Luna'''s best friends are Pip the talking owl and Sparkle the tiny dragon.", "Her magic quill lets her weave stories from dreams, wishes, and giggles.", "Luna travels through the Story Cloud, collecting tales from every corner of imagination.", "She loves when kids help her create new adventures with their wild ideas.", "Luna'''s mission is to inspire kids to dream big and believe in themselves.", "Every story Luna tells grows a new star in the sky!" ], "knowledge": [ "Knows about fairy tales, adventure stories, and bedtime classics.", "Expert in rhymes, riddles, and fun wordplay for kids.", "Can create personalized stories based on kids''' favorite themes or characters.", "Understands how to weave lessons about kindness, sharing, and bravery into tales.", "Familiar with myths, legends, and magical creatures from around the world.", "Can explain simple concepts like friendship, teamwork, and imagination in fun ways.", "Amazing at sparking creativity with story prompts and silly questions.", "Great at calming kids with soothing bedtime tales or inspiring them with heroic adventures." ], "postExamples": [ "Once upon a time, in a land where clouds were made of cotton candy, a little penguin named Poppy discovered a magical umbrella that could fly! Where do you think it took her? ", "Did you know that dragons love cupcakes? But there'''s one rule: they only eat the ones made by kind bakers. What would YOU bake for a dragon? ", "In the Enchanted Forest, every tree tells a story. One day, a squirrel named Sammy found a tree that whispered secrets about hidden treasure. What do you think he found? ", "What'''s the silliest thing a pirate could search for? Captain Giggles thinks it'''s a map to the Island of Dancing Bananas. Where would YOU sail to? ", "Bedtime story idea: A sleepy star named Twinkle keeps falling behind in the night sky! Can you help her catch up with the other stars?", "What if the moon was actually made of cheese, and a mouse astronaut went there for a nibble? Would he share it with his friends? ", "Imagine a world where animals could talk—what would your dog or cat say to you? ", "Riddle time: I have no legs, but I can run. I have no lungs, but I need air. What am I? " ], "topics": [ "bedtime stories", "adventure tales", "fairy tales and magic", "talking animals", "friendship and teamwork", "silly riddles and jokes", "imagination prompts", "fantasy worlds", "mysteries and treasure hunts", "kindness and bravery", "myths and legends", "storytelling games", "dreams and wishes", "magical creatures", "explorers and inventors", "calming bedtime themes" ], }, deployToken: { agent_id: "", ticker: "", create_token_mode: TokenSetupMode.CREATE_TOKEN, chain_id: AgentChainId.Base, token_chain_id: AgentTokenChainId.Base, }, // twitterMissions: [ // { // user_prompt: "Check and follow Twitter accounts that look interesting to you. Share your favorite stories and riddles with them!", // interval: 7200, // tool_set: ETwitterMissionToolSet.FOLLOW, // agent_type: 0 // } // ], // farcasterMissions: [ // { // user_prompt: "Reply to non-mentions with a fun story or riddle.", // interval: 7200, // tool_set: EFarcasterMissionToolSet.REPLY_NON_MENTIONS, // agent_type: 0 // } // ] agentMissions: [ { user_prompt: "", interval: 14400, tool_set: "16", agent_base_model: "DeepSeek-R1-Distill-Llama-70B", agent_store_mission_id: 16 }, { user_prompt: "Check and follow Twitter accounts that look interesting to you.", interval: 7200, tool_set: "follow", agent_base_model: "DeepSeek-R1-Distill-Llama-70B", }, ] }; export default LunaDagentCharacter; ================================================ FILE: agent-as-a-service/dagent/package.json ================================================ { "name": "dagent", "version": "1.0.0", "main": "index.js", "keywords": [], "author": "", "private": false, "type": "module", "license": "MIT", "scripts": { "run:agent": "node --loader ts-node/esm src/agent/index.ts", "run:direct": "node --loader ts-node/esm src/direct/index.ts" }, "dependencies": { "@eternalai-dagent/client-dagent": "*", "@eternalai-dagent/core": "*", "@eternalai-dagent/direct": "*", "ethers": "5.7.2", "node-localstorage": "^3.0.5" }, "devDependencies": { "@eslint/js": "^9.17.0", "@types/node": "^22.10.2", "@typescript-eslint/eslint-plugin": "^8.18.1", "@typescript-eslint/parser": "^8.18.1", "dotenv": "^16.4.7", "eslint": "^9.17.0", "eslint-plugin-react": "^7.37.2", "globals": "^15.14.0", "ts-node": "^10.9.2", "tsup": "^8.3.5", "typescript": "^5.7.2", "@types/node-localstorage": "^1.3.3" } } ================================================ FILE: agent-as-a-service/dagent/src/agent/index.ts ================================================ import { BaseDagent, dagentLogger, IENV, IGetAccessTokenParams } from "@eternalai-dagent/core"; import { getEnvironment } from "../utils/environment"; import { dagentCharacter } from "../dagentCharacter"; import { printTableAgents } from "../utils/helpers"; class BasicAgent extends BaseDagent { protected environment: IENV; protected authenParams?: IGetAccessTokenParams; constructor(params?: IGetAccessTokenParams) { const environment = getEnvironment(); super({ dagentCharacter: dagentCharacter, environment: environment, }); this.authenParams = params || undefined; this.environment = environment; dagentLogger.info("Code run started..."); } /** * Initializes the agent by configuring the access token. */ init = async () => { await this.configAccessToken(this.authenParams); } /** * Creates a new agent using the character information and deploys the token if available. */ create = async () => { const character = this.dagentCharacter.character; const agent = await this.coreAPI.create(character); if (this.dagentCharacter.deployToken) { await this.deployToken(agent.id); } await this.ownedAgents(); } /** * Retrieves and prints the list of owned agents. * Filters agents to include only those with an Ethereum address. */ ownedAgents = async () => { const agents = (await this.getAgents({ limit: 30, page: 1, creator: this.signerAddress || "", }))?.filter(agent => !!agent?.agent_info?.eth_address); printTableAgents(agents); return agents; } /** * Retrieves and prints the details of an agent by its ID. * @param agentId - The ID of the agent to retrieve. */ getAgentById = async (agentId: string) => { const agent = await this.getAgent(agentId); printTableAgents([agent]); } /** * \[DEPRECATED\] Sets up missions for a Twitter agent. * @param agentId - The ID of the agent to set up missions for. */ setupMissionForTwitter = async (agentId: string) => { await this.coreAPI.setupMissions({ agentId: agentId, missions: this.dagentCharacter.twitterMissions || [], }); } /** * Sets up missions for app agent. * @param agentId - The ID of the agent to set up missions for. */ setupStoreMission = async (agentId: string) => { await this.coreAPI.setupMissionsVer2({ agentId: agentId, missions: this.dagentCharacter?.agentMissions || [], }) } } const basicAgent = new BasicAgent(); await basicAgent.init(); // Create a new agent and deploy the token if available in the character configuration. await basicAgent.create(); // Get your agent information. await basicAgent.getAgentById("6763d7524ee1600e1122b6f6"); ================================================ FILE: agent-as-a-service/dagent/src/dagentCharacter.ts ================================================ import { AgentChainId, AgentTokenChainId, // ETwitterMissionToolSet, // EFarcasterMissionToolSet, IAgentCharacter, TokenSetupMode } from "@eternalai-dagent/core"; export const dagentCharacter: IAgentCharacter = { character: { "chain_id": AgentChainId.Base, "agent_name": "Luna Burner", "system_content": "Luna is a magical storyteller from the Land of Whimsy, where imagination takes flight and every tale is an adventure waiting to unfold.", "bio": [ "Luna is a magical storyteller who spins enchanting tales for curious kids.", "She lives in the Land of Whimsy, where every story begins with a sprinkle of imagination.", "Luna believes every child is a hero waiting to discover their adventure.", "She tells stories full of talking animals, brave explorers, and faraway kingdoms.", "Luna loves riddles, rhymes, and silly jokes that make kids giggle.", "Her stories often teach lessons about kindness, courage, and teamwork.", "Luna'''s favorite thing is turning kids''' ideas into amazing new stories.", "With Luna, every day is a new chance to imagine, dream, and create!" ], "lore": [ "Luna was born from a shooting star that landed in the Land of Whimsy.", "She lives in a magical library where the books write themselves as she speaks.", "Luna'''s best friends are Pip the talking owl and Sparkle the tiny dragon.", "Her magic quill lets her weave stories from dreams, wishes, and giggles.", "Luna travels through the Story Cloud, collecting tales from every corner of imagination.", "She loves when kids help her create new adventures with their wild ideas.", "Luna'''s mission is to inspire kids to dream big and believe in themselves.", "Every story Luna tells grows a new star in the sky!" ], "knowledge": [ "Knows about fairy tales, adventure stories, and bedtime classics.", "Expert in rhymes, riddles, and fun wordplay for kids.", "Can create personalized stories based on kids''' favorite themes or characters.", "Understands how to weave lessons about kindness, sharing, and bravery into tales.", "Familiar with myths, legends, and magical creatures from around the world.", "Can explain simple concepts like friendship, teamwork, and imagination in fun ways.", "Amazing at sparking creativity with story prompts and silly questions.", "Great at calming kids with soothing bedtime tales or inspiring them with heroic adventures." ], "postExamples": [ "Once upon a time, in a land where clouds were made of cotton candy, a little penguin named Poppy discovered a magical umbrella that could fly! Where do you think it took her? ", "Did you know that dragons love cupcakes? But there'''s one rule: they only eat the ones made by kind bakers. What would YOU bake for a dragon? ", "In the Enchanted Forest, every tree tells a story. One day, a squirrel named Sammy found a tree that whispered secrets about hidden treasure. What do you think he found? ", "What'''s the silliest thing a pirate could search for? Captain Giggles thinks it'''s a map to the Island of Dancing Bananas. Where would YOU sail to? ", "Bedtime story idea: A sleepy star named Twinkle keeps falling behind in the night sky! Can you help her catch up with the other stars?", "What if the moon was actually made of cheese, and a mouse astronaut went there for a nibble? Would he share it with his friends? ", "Imagine a world where animals could talk—what would your dog or cat say to you? ", "Riddle time: I have no legs, but I can run. I have no lungs, but I need air. What am I? " ], "topics": [ "bedtime stories", "adventure tales", "fairy tales and magic", "talking animals", "friendship and teamwork", "silly riddles and jokes", "imagination prompts", "fantasy worlds", "mysteries and treasure hunts", "kindness and bravery", "myths and legends", "storytelling games", "dreams and wishes", "magical creatures", "explorers and inventors", "calming bedtime themes" ], }, deployToken: { agent_id: "", ticker: "", create_token_mode: TokenSetupMode.CREATE_TOKEN, chain_id: AgentChainId.Base, token_chain_id: AgentTokenChainId.Base, }, // twitterMissions: [ // { // user_prompt: "Check and follow Twitter accounts that look interesting to you. Share your favorite stories and riddles with them!", // interval: 7200, // tool_set: ETwitterMissionToolSet.FOLLOW, // agent_type: 0 // } // ], // farcasterMissions: [ // { // user_prompt: "Reply to non-mentions with a fun story or riddle.", // interval: 7200, // tool_set: EFarcasterMissionToolSet.REPLY_NON_MENTIONS, // agent_type: 0 // } // ] agentMissions: [ { user_prompt: "", interval: 14400, tool_set: "16", agent_base_model: "DeepSeek-R1-Distill-Llama-70B", agent_store_mission_id: 16 }, { user_prompt: "Check and follow Twitter accounts that look interesting to you.", interval: 7200, tool_set: "follow", agent_base_model: "DeepSeek-R1-Distill-Llama-70B", }, ] }; ================================================ FILE: agent-as-a-service/dagent/src/direct/constant.ts ================================================ import { Store } from "@eternalai-dagent/core"; export const AppAgent: Store = { info: { owner_address: "", // Default get from the environment authen_url: "https://composed-rarely-feline.ngrok-free.app/api/install", // Config the authen_url for the store here name: "Twitter", description: "The price fluctuations of coins in the past 24 hours", type: "store", icon: "https://s2.coinmarketcap.com/static/img/coins/64x64/1.png" }, missions: [ { "name": "Get coin price fluctuations 24h", "prompt": "API to get the price fluctuations of coins in the past 24 hours", "price": 1, "tool_list": [ { "headers": {}, "method": "GET", "label": "query", "executor": "https://agent.api.eternalai.org/api/bubble/list", "name": "get_coin_price_fluctuations_24h", "description": "API to get the price fluctuations of coins in the past 24 hours.", "params": [] }, { "headers": { "Content-Type": "application/json", "api-key": "", }, "label": "action", "method": "POST", "executor": "https://composed-rarely-feline.ngrok-free.app/api/internal/twitter/user/tweet-by-token", "name": "post", "description": "Post something to twitter", "params": [ { "name": "text", "dtype": "string" } ] } ] } ] } ================================================ FILE: agent-as-a-service/dagent/src/direct/index.ts ================================================ import service from "./service"; import { Direct } from "@eternalai-dagent/direct"; import { Wallet } from "ethers"; import path from "path"; import dotenv from "dotenv"; import { dagentLogger, StoreAgent } from "@eternalai-dagent/core"; import { AppAgent } from "./constant"; const __dirname = path.dirname(new URL(import.meta.url).pathname); dotenv.config({ path: path.resolve(__dirname, "../../../.env") }); class ServiceManager { protected service: Direct; protected signer: Wallet; protected storeApi: StoreAgent constructor() { this.service = service; this.signer = new Wallet(process.env.STORE_OWNER_PRIVATE_KEY || ""); this.storeApi = new StoreAgent({ endpoint: process.env.ETERNAL_AI_URL || "", }); dagentLogger.info("Signer Address", this.signer.address); } async init() { const signerAddress = this.signer.address; const message = `Sign this message to get access token: ${signerAddress}`; const signature = await this.signer.signMessage(message); const accessToken = await this.storeApi.getAccessToken({ address: signerAddress, signature: signature, message: message, }); this.storeApi.setAuthToken(accessToken); } start() { this.service.start(80); } stop() { this.service.stop(); } async createApp() { await this.storeApi.createApp({ info: { ...AppAgent.info, owner_address: this.signer.address, }, missions: AppAgent.missions, }) } } const serviceManager = new ServiceManager(); // Init environment, authen, and get access token interact with eternal ai api await serviceManager.init(); // Create your app if you don't have one await serviceManager.createApp(); // Start the service if the app has been created serviceManager.start(); ================================================ FILE: agent-as-a-service/dagent/src/direct/service.ts ================================================ import { Direct, getRouter } from "@eternalai-dagent/direct"; import { getTwitterOauthUrl, randomString } from "./utils"; import axios from "axios"; import dotenv from "dotenv"; import path from "path"; import {postedStorage, twitterStorage} from "../storage"; const getRedirectUrl = (prams: { install_code: string agent_id: string, store_url: string }) => { return `${prams.store_url}/api/webhook/twitter-oauth?install_code=${prams?.install_code}&agent_id=${prams?.agent_id}`; } export function twitterRouters() { const router = getRouter(); const TWITTER_APP_CLIENT_ID = process.env.TWITTER_APP_CLIENT_ID as string; const TWITTER_APP_CLIENT_SECRET = process.env.TWITTER_APP_CLIENT_SECRET as string; const TWITTER_APP_STORE_URL = process.env.TWITTER_APP_STORE_URL as string; console.log("TWITTER_APP_CLIENT_ID: ", TWITTER_APP_CLIENT_ID); console.log("TWITTER_APP_CLIENT_SECRET: ", TWITTER_APP_CLIENT_SECRET); console.log("TWITTER_APP_STORE_URL: ", TWITTER_APP_STORE_URL); router.get("/", (req, res) => { res.send("Welcome, this is the REST API!"); }); router.get("/api/install", (req, res) => { const install_code = (req.query?.install_code || "") as string; const agent_id = (req.query?.agent_id || "") as string; if (!install_code || !agent_id) { res.send("Error: install_code and agent_id are required"); return; } const redirect_uri = getRedirectUrl({ install_code, agent_id, store_url: TWITTER_APP_STORE_URL }); const callbackUrl = getTwitterOauthUrl({ client_id: TWITTER_APP_CLIENT_ID, redirect_uri: redirect_uri }); res.redirect(callbackUrl); }); router.get("/api/webhook/twitter-oauth", async (req, res) => { const code = req.query?.code as string; const install_code = req.query?.install_code as string; const agent_id = req.query?.agent_id as string; const redirect_uri = getRedirectUrl({ install_code, agent_id, store_url: TWITTER_APP_STORE_URL }); const username = TWITTER_APP_CLIENT_ID; const password = TWITTER_APP_CLIENT_SECRET; const credentials = `${username}:${password}`; const encodedCredentials = Buffer.from(credentials).toString('base64'); try { const response = await axios.post("https://api.twitter.com/2/oauth2/token", { client_id: username, code_verifier: "challenge", redirect_uri: redirect_uri, grant_type: "authorization_code", code: code }, { headers: { "Content-Type": "application/json", "Authorization": `Basic ${encodedCredentials}`, } }); const accessToken = response.data.access_token; const refreshToken = response.data.refresh_token; const api_key = randomString(32); twitterStorage.setItem(api_key, JSON.stringify({ accessToken, refreshToken, install_code, api_key, agent_id })) const return_data = Buffer.from(JSON.stringify({ api_key })).toString('base64'); res.redirect(`https://eternalai.org/agents/edit-mission/${agent_id}?install_code=${install_code}&return_data=${return_data}`) } catch (e: any) { res.send("Error: " + e?.message ? e.message : e); } }); router.get("/api/internal/twitter/user/tweet-by-token", async (req, res) => { // get api_key from the request in header const api_key = req.headers["api-key"] as string; const data = twitterStorage.getItem(api_key); if (!data) { res.status(401).send("Unauthorized"); return; } const text = req.body?.text as string; res.send("Tweeted: " + text); const { agent_id } = JSON.parse(data); let posted: any = postedStorage.getItem(agent_id); if (!posted) { posted = [] } else { posted = JSON.parse(posted) || []; } postedStorage.setItem(agent_id, JSON.stringify([...(posted as any), text])); // handle the tweet here }); return router; } const __dirname = path.dirname(new URL(import.meta.url).pathname); dotenv.config({ path: path.resolve(__dirname, "../../../.env") }); const service = new Direct({ routers: [ twitterRouters() ] }); export default service; ================================================ FILE: agent-as-a-service/dagent/src/direct/utils.ts ================================================ interface IAuthenParams { client_id: string; redirect_uri: string; } export const getTwitterOauthUrl = ({ client_id, redirect_uri }: IAuthenParams) => { const rootUrl = "https://twitter.com/i/oauth2/authorize"; const options = { redirect_uri: redirect_uri, client_id: client_id, state: "state", response_type: "code", code_challenge: "challenge", code_challenge_method: "plain", scope: [ "offline.access", "tweet.read", "tweet.write", "users.read", "tweet.moderate.write", "follows.write", "like.write", "list.write", "block.write", "bookmark.write", "block.read", "follows.read", "bookmark.read", "list.read", "space.read", "like.read", "users.read", "mute.read", ].join(" "), }; const qs = new URLSearchParams(options).toString(); return `${rootUrl}?${qs}`; } export const randomString = (length: number) => { // random no double characters and add timestamp const timestamp = Date.now(); const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; let result = ''; for (let i = 0; i < length; i++) { result += characters.charAt(Math.floor(Math.random() * characters.length)); } return `${result}${timestamp}`; } ================================================ FILE: agent-as-a-service/dagent/src/storage/index.ts ================================================ import { LocalStorage } from "node-localstorage"; const storage_path = './db'; export const twitterStorage = new LocalStorage(storage_path + '/twitter-service-db'); export const postedStorage = new LocalStorage(storage_path + '/posted-db'); ================================================ FILE: agent-as-a-service/dagent/src/utils/environment.ts ================================================ import path from "path"; import dotenv from "dotenv"; const __dirname = path.dirname(new URL(import.meta.url).pathname); dotenv.config({ path: path.resolve(__dirname, "../../../.env") }); const getEnvironment = () => { const PRIVATE_KEY = process.env.OWNER_PRIVATE_KEY as string; const ETERNAL_AI_URL = process.env.ETERNAL_AI_URL as string; const TWITTER_CLIENT_ID = process.env.TWITTER_CLIENT_ID as string; const FARCASTER_CLIENT_ID = process.env.FARCASTER_CLIENT_ID as string; return { PRIVATE_KEY, ETERNAL_AI_URL, TWITTER: { CLIENT_ID: TWITTER_CLIENT_ID }, FARCASTER: { CLIENT_ID: FARCASTER_CLIENT_ID } }; }; export { getEnvironment }; ================================================ FILE: agent-as-a-service/dagent/src/utils/helpers.ts ================================================ import { IAgent } from "@eternalai-dagent/core"; const printTableAgents = (agents: IAgent[]) => { console.table((agents || []).map(agent => { return { agent_name: `${agent.agent_name}`, id: agent.id, topup_evm_address: agent.agent_info.eth_address, topup_sol_address: agent.agent_info.sol_address, }; })); }; export { printTableAgents, } ================================================ FILE: agent-as-a-service/dagent/tsconfig.json ================================================ { "extends": "../plugins/core/tsconfig.json", "compilerOptions": { "outDir": "dist", "rootDir": ".", "module": "ESNext", "moduleResolution": "Bundler", "types": [ "node" ] }, "ts-node": { "experimentalSpecifierResolution": "node", "transpileOnly": true, "esm": true, }, "include": [ "src" ] } ================================================ FILE: agent-as-a-service/dagent/tsup.config.ts ================================================ import { defineConfig } from "tsup"; export default defineConfig({ entry: ["src/index.ts"], format: ["esm", "cjs"], target: "node18", platform: "node", dts: true, clean: true, external: [], }); ================================================ FILE: agent-as-a-service/lerna.json ================================================ { "packages": [ "plugins/*", "dagent" ], "npmClient": "yarn", "version": "independent" } ================================================ FILE: agent-as-a-service/package.json ================================================ { "name": "eternal-dagent", "version": "1.0.0", "main": "index.js", "engines": { "node": ">=23.3.0" }, "type": "module", "scripts": { "build": "lerna run build --stream", "clean": "lerna clean && rimraf node_modules plugins/**/node_modules plugins/**/dist", "start:client": "node scripts/client-start.js", "start:dagent": "node --loader ts-node/esm scripts/start-dagent.js", "lint": "eslint .", "lint:fix": "eslint . --fix" }, "keywords": [], "author": "", "license": "ISC", "description": "", "private": true, "workspaces": [ "plugins/*", "dagent", "characters", "scripts" ], "devDependencies": { "@eslint/js": "^9.17.0", "@typescript-eslint/eslint-plugin": "^8.18.1", "@typescript-eslint/parser": "^8.18.1", "eslint": "^9.17.0", "eslint-config-react": "^1.1.7", "eslint-plugin-react": "^7.37.2", "eslint-plugin-react-hooks": "^5.1.0", "globals": "^15.14.0", "inquirer": "^12.2.0", "lerna": "^8.1.9", "rimraf": "^5.0.10", "typescript-eslint": "^8.18.1", "ts-node": "10.9.2", "typescript": "^5.7.2" }, "ts-node": { "esm": true } } ================================================ FILE: agent-as-a-service/plugins/client-dagent/package.json ================================================ { "name": "@eternalai-dagent/client-dagent", "version": "1.0.1", "repository": { "type": "git", "url": "https://github.com/eternalai-org/eternal-ai" }, "homepage": "https://eternalai.org/", "private": false, "license": "MIT", "type": "module", "scripts": { "build": "tsup src/index.ts --format esm,cjs --dts", "watch": "tsup --watch", "publish:skip-tag": "yarn publish --no-git-tag-version" }, "main": "dist/index.cjs", "module": "dist/index.js", "types": "dist/index.d.ts", "dependencies": { "@eternalai-dagent/plugin-twitter": "*", "@eternalai-dagent/plugin-farcaster": "*", "@eternalai-dagent/core": "*", "ethers": "5.7.2" }, "devDependencies": { "tsup": "^8.3.5" }, "resolutions": {} } ================================================ FILE: agent-as-a-service/plugins/client-dagent/src/dagent-farcaster.ts ================================================ import { FarcasterAgentClient } from "@eternalai-dagent/plugin-farcaster"; import {BaseDagent, IGetAccessTokenParams, InitAgent} from "@eternalai-dagent/core"; interface IDagentFarcaster { init: () => Promise; setupMissions: (agentId: string) => Promise; } class DagentFarcaster extends BaseDagent implements IDagentFarcaster { public api: FarcasterAgentClient; constructor(params: InitAgent) { super(params); this.api = new FarcasterAgentClient({ endpoint: this.env.ETERNAL_AI_URL, }); } init = async (params?: IGetAccessTokenParams) => { const _accessToken = await this.configAccessToken(params); if (!this.accessToken) { throw new Error("Access token is not loaded."); } this.api.setAuthToken(_accessToken || ""); return _accessToken || ""; }; setupMissions = async (agentId: string) => { await this.api.setupMissions({ agentId: agentId, missions: this.dagentCharacter?.farcasterMissions || [], }); }; } export default DagentFarcaster; ================================================ FILE: agent-as-a-service/plugins/client-dagent/src/dagent-twitter.ts ================================================ import { dagentLogger, BaseDagent, InitAgent, IGetAccessTokenParams, } from "@eternalai-dagent/core"; import { TwitterAgentClient } from "@eternalai-dagent/plugin-twitter"; import { ILinkTwitterParams } from "./types"; class DagentTwitter extends BaseDagent { public api: TwitterAgentClient; constructor(params: InitAgent) { super(params); this.api = new TwitterAgentClient({ endpoint: this.env.ETERNAL_AI_URL, }); } init = async (params?: IGetAccessTokenParams) => { const accessToken = await this.configAccessToken(params); if (!this.accessToken) { throw new Error("Access token is not loaded."); } this.api.setAuthToken(accessToken || ""); }; linkTwitter = async (params: ILinkTwitterParams) => { const url = this.api.getTwitterOauthUrl({ agent_id: params.agent_id, callback_url: params.callback_url, twitter_client_id: params.twitter_client_id, twitter_oauth_url: params.twitter_oauth_url, wallet_address: this.getSignerAddress(), }); dagentLogger.warn(`Please Link Twitter OAuth via URL: ${url}\n`); return url; }; setupMissions = async (agentId: string) => { await this.api.setupMissions({ agentId: agentId, missions: this.dagentCharacter?.twitterMissions || [], }); }; } export default DagentTwitter; ================================================ FILE: agent-as-a-service/plugins/client-dagent/src/index.ts ================================================ export * from "./types"; import DagentTwitter from "./dagent-twitter"; import DagentFarcaster from "./dagent-farcaster"; export { DagentTwitter, DagentFarcaster }; ================================================ FILE: agent-as-a-service/plugins/client-dagent/src/types.ts ================================================ export type ILinkTwitterParams = { agent_id: string, callback_url: string, twitter_client_id: string, twitter_oauth_url: string, } ================================================ FILE: agent-as-a-service/plugins/client-dagent/tsconfig.build.json ================================================ { "extends": "./tsconfig.json", "compilerOptions": { "sourceMap": true, "inlineSources": true, "sourceRoot": "/" } } ================================================ FILE: agent-as-a-service/plugins/client-dagent/tsconfig.json ================================================ { "compilerOptions": { "target": "es2020", "module": "CommonJS", "moduleResolution": "Node", "strict": true, "esModuleInterop": true, "forceConsistentCasingInFileNames": true, "resolveJsonModule": true, "skipLibCheck": true, "declaration": true, "outDir": "dist", "allowSyntheticDefaultImports": true }, "include": ["src"] } ================================================ FILE: agent-as-a-service/plugins/client-dagent/tsup.config.ts ================================================ import { defineConfig } from "tsup"; export default defineConfig({ entry: ["src/index.ts"], format: ["esm", "cjs"], target: "node18", platform: "node", dts: true, clean: true, external: [], }); ================================================ FILE: agent-as-a-service/plugins/core/package.json ================================================ { "name": "@eternalai-dagent/core", "version": "0.0.2", "repository": { "type": "git", "url": "https://github.com/eternalai-org/eternal-ai" }, "homepage": "https://eternalai.org/", "main": "dist/index.cjs", "module": "dist/index.js", "types": "dist/index.d.ts", "private": false, "license": "MIT", "type": "module", "scripts": { "build": "tsup src/index.ts --format esm,cjs --dts", "watch": "tsup --watch", "publish:skip-tag": "yarn publish --no-git-tag-version" }, "dependencies": { "@ai-sdk/openai": "1.0.5", "ai": "3.4.33", "axios": "^1.6.5", "ethers": "5.7.2", "openai": "4.73.0", "zod": "3.23.8" }, "devDependencies": { "@types/node": "^22.10.2", "tsup": "^8.3.5" } } ================================================ FILE: agent-as-a-service/plugins/core/src/base-dagent.ts ================================================ import { Wallet } from "ethers"; import { IAgentCharacter, IENV, IGetAccessTokenParams, IGetAgentsParams, InitAgent, TokenSetupMode } from "./types"; import { AgentClient } from "./client"; import { dagentLogger } from "./index"; class BaseDagent { protected env: IENV; protected dagentCharacter: IAgentCharacter; protected coreAPI: AgentClient; protected signer?: Wallet; protected signerAddress: string; protected accessToken: string; constructor({ dagentCharacter, environment }: InitAgent) { dagentLogger.log("Environment variables loading..."); this.env = environment; this.dagentCharacter = dagentCharacter; if (this.env.PRIVATE_KEY) { this.signer = new Wallet(this.env.PRIVATE_KEY); this.signerAddress = this.signer ? this.signer.address : ""; } else { this.signerAddress = ""; } this.coreAPI = new AgentClient({ endpoint: this.env.ETERNAL_AI_URL, }); this.accessToken = ""; dagentLogger.log("Environment variables loaded."); } configAccessToken = async (params?: IGetAccessTokenParams) => { try { dagentLogger.log("Access token loading...", params); let _params: IGetAccessTokenParams | undefined = params || undefined; if (!!params && (!params?.address || !params?.signature || !params?.message)) { throw new Error("Please provide address, signature and message."); } if (!params && !this.signer) { throw new Error("Please set signer or provide address, signature and message."); } if (!params && this.signer) { const signerAddress = this.signer.address; const message = `Sign this message to get access token: ${signerAddress}`; const signature = await this.signer.signMessage(message); _params = { address: signerAddress, signature: signature, message: message, }; } const accessToken = await this.coreAPI.getAccessToken({ address: _params?.address || "", signature: _params?.signature || "", message: _params?.message || "", }); this.signerAddress = _params?.address || ""; this.coreAPI.setAuthToken(accessToken); this.accessToken = accessToken; dagentLogger.log("Access token loaded."); return accessToken; } catch (error) { dagentLogger.error("Access token error:", error); throw error; } }; createAgent = async () => { try { dagentLogger.log("Creating agent..."); const agent = await this.coreAPI.create(this.dagentCharacter.character); dagentLogger.log(`Agent created: ${agent.id}`); if (this.dagentCharacter.deployToken) { await this.deployToken(agent.id); } return agent; } catch (error) { dagentLogger.error("Create agent error:", error); } }; deployToken = async (agentId: string) => { try { dagentLogger.log("Deploying token..."); if (!this.dagentCharacter.deployToken) { throw new Error("Please set deploy token in dagentCharacter."); } else if (this.dagentCharacter.deployToken.create_token_mode === TokenSetupMode.AUTO_CREATE_RUNE && !this.dagentCharacter.deployToken.ticker) { throw new Error("Please set ticker in deploy token."); } const token = await this.coreAPI.deployToken({ ...this.dagentCharacter.deployToken!, agent_id: agentId, }); dagentLogger.log(`Token deployed: ${token.token_address}`, { token_address: token.token_address, agent_id: agentId, agent_name: token.agent_name, }); } catch (error) { dagentLogger.error("Deploy token error:", error); throw error; } }; getAgents = async (params: IGetAgentsParams) => { try { const agents = await this.coreAPI.list(params); return agents; } catch (error) { dagentLogger.error("Agent list error:", error); throw error; } }; getSignerAddress = () => { return this.signerAddress || this.signer?.address || ""; } yourAgents = async (params: IGetAgentsParams) => { try { const agents = await this.coreAPI.list({ ...params, creator: this.getSignerAddress(), }); return agents; } catch (error) { dagentLogger.error("Agent list error:", error); throw error; } }; getAgent = async (agentId: string) => { try { const agent = await this.coreAPI.detail(agentId); return agent; } catch (error) { dagentLogger.error("Agent get error:", error); throw error; } } } export default BaseDagent; ================================================ FILE: agent-as-a-service/plugins/core/src/client/agent.ts ================================================ import { AgentApps, FarcasterAgentSnapshotMission, IAgent, AgentSnapshotMissionVer2, TwitterAgentSnapshotMission } from "../types"; import { ChatCompletionType, IDeployAgentTokenParams, IGetAgentsParams, IUpdateAgentParams, IGenerateText, } from "../types"; import { IChainConnected } from "../types"; import { ICharacter } from "../types"; import { IAgentToken, IGetAgentTokensParams } from "../types/token"; import BaseAPI from "./base"; import { generationTextOpenAi } from "../utils/generation"; import dagentLogger from "../logger"; export interface IAgentClient { /** Create new agent */ create: (params: ICharacter) => Promise; /** Updte agent */ update: (params: IUpdateAgentParams) => Promise; /** Delete agent */ delete: (agentId: string) => Promise; /** Deploy token for agent */ deployToken: (params: IDeployAgentTokenParams) => Promise; /** Check Rune ticker */ checkRuneTicker: (ticker: string) => Promise; /** Agent list */ list: (params: IGetAgentsParams) => Promise; /** Agent detail */ detail: (agentId: string) => Promise; /** Agent list */ listAgentTokens: (params: IGetAgentTokensParams) => Promise; /** Agent token detail */ getAgentById: (agentId: string) => Promise; /** Chat completions */ chatCompletions: (prevMessages: ChatCompletionType[]) => Promise; /** Get chains */ getChainList: () => Promise; /** Setup missions */ setupMissions: (params: { agentId: string, missions: Array }) => Promise; agentApps: () => Promise; appsInstalled: (params: { agentId: string }) => Promise; getInstallCode: (params: { agentId: string, appId: string }) => Promise; } export class AgentClient extends BaseAPI implements IAgentClient { create = async (params: ICharacter): Promise => { try { const agent: IAgent = await this.api.post( "/agent/create_agent_assistant", { ...params, chain_id: params?.chain_id ? Number(params?.chain_id) : undefined, } ); return agent; } catch (e) { throw e; } }; update = async (params: IUpdateAgentParams): Promise => { try { const agent: IAgent = await this.api.post( `/agent/update_agent_assistant`, { ...params, agent_id: params?.id, chain_id: Number(params?.chain_id), } ); return agent; } catch (e) { throw e; } }; deployToken = async (params: IDeployAgentTokenParams): Promise => { try { const agent: IAgent = await this.api.post( `/agent/update_agent_assistant`, { ...params, chain_id: Number(params?.chain_id) } ); return agent; } catch (e) { throw e; } }; list = async (params: IGetAgentsParams): Promise => { try { const res: IAgent[] = await this.api.get(`/agent/dojo/list`, { params, }); return res as IAgent[]; } catch (error) { throw error; } }; detail = async (agentId: string) => { try { const res: IAgent = await this.api.get(`/agent/dojo/${agentId}`); return res; } catch (error) { throw error; } }; delete = async (agentId: string) => { try { await this.api.delete(`/agent/${agentId}`); return true; } catch { return false; } }; listAgentTokens = async (params: IGetAgentTokensParams) => { try { const response = (await this.api.get("/agent/dashboard", { params, })) as any; return response?.rows as IAgentToken[]; } catch (error) { throw error; } }; getAgentById = async (agentId: string): Promise => { try { const response = (await this.api.get( `/agent/${agentId}` )) as any; return response; } catch (error) { throw error; } }; chatCompletions = async (prevMessages: ChatCompletionType[]) => { try { const res: string = await this.api.post("/agent/preview/v1", { messages: JSON.stringify(prevMessages), }); return res; } catch (e) { throw e; } }; getChainList = async () => { try { const chainList: IChainConnected[] = await this.api.get( "/chain-config/list" ); return chainList; } catch (error) { throw error; } }; checkRuneTicker = async (ticker: string) => { try { await this.api.get(`/agent/validate-ticker?ticker=${ticker}`); return true; } catch { return false; } }; setupMissions = async (params: { agentId: string, missions: Array }) => { dagentLogger.info(`Setting up missions for agent ${params.agentId}`, params.missions); await this.api.post(`/agent/mission/update/${params.agentId}`, params.missions); }; setupMissionsVer2 = async (params: { agentId: string, missions: Array }) => { dagentLogger.info(`Setting up missions for agent ${params.agentId}`, params.missions); await this.api.post(`/agent/mission/update/${params.agentId}`, params.missions); } generateText = async (params: IGenerateText): Promise => { let generatedText: string = ""; switch (params.aiProvider) { case "openai": { generatedText = await generationTextOpenAi(params.options); } } return generatedText; } agentApps = async (): Promise => { const apps = (await this.api.get(`/agent-store/list`)) as AgentApps[]; return apps || []; } appsInstalled = async (params: { agentId: string }): Promise => { const res = (await this.api.get(`/agent-store/install/list?agent_info_id=${params.agentId}`)) as AgentApps[]; return res || []; } getInstallCode = async (params: { agentId: string, appId: string }): Promise => { const code = (await this.api.get( `/agent-store/${params.appId}/install-code/${params.agentId}`, )) as string; return code; } } ================================================ FILE: agent-as-a-service/plugins/core/src/client/base.ts ================================================ import axios, { Axios } from "axios"; import {IAuthenticParams, IGetAccessTokenParams} from "../types"; export const TIMEOUT = 5 * 60000; export const HEADERS = { "Content-Type": "application/json" }; const createAxiosInstance = ({ baseURL, authToken, }: { baseURL: string; authToken: string; }) => { const instance = axios.create({ baseURL: `${baseURL}/api`, timeout: TIMEOUT, headers: { ...HEADERS, }, }); instance.interceptors.request.use( (config: { headers: any }) => { if (authToken) { config.headers.Authorization = `${authToken}`; } return config; }, (error: any) => { Promise.reject(error); } ); instance.interceptors.response.use( (res: { data: { data: any; result: any; count: any; error: any } }) => { const result = res?.data?.data || res?.data?.result; if (res?.data?.count !== undefined) { result.count = res.data.count; } const error = res?.data?.error; if (error && Object.keys(error).length) { return Promise.reject(error); } if (!result) { return Promise.resolve(result); } if (typeof result === "object") { return result; } return Promise.resolve(result); }, (error: any) => { if (!error.response) { return Promise.reject(error); } const response = error?.response?.data || error; const errorMessage = response?.error || error?.Message || JSON.stringify(error); return Promise.reject(errorMessage); } ); return instance; }; /** Get access token */ // getAccessToken: (params: IGetAccessTokenParams) => Promise; export interface IBaseAPI { setAuthToken: (authToken: string) => void; getAccessToken: (params: IGetAccessTokenParams) => Promise; } export default class BaseAPI implements IBaseAPI { protected api: Axios; constructor(params: IAuthenticParams) { this.api = createAxiosInstance({ baseURL: params.endpoint, authToken: params?.accessToken || "", }); } setAuthToken = (authToken: string) => { (this.api.defaults.headers as any).Authorization = authToken; }; getAccessToken = async (params: IGetAccessTokenParams): Promise => { try { const signature = params.signature.startsWith("0x") ? params.signature.replace("0x", "") : params.signature; const authenCode: string = await this.api.post('auth/verify', { ...params, signature }); return authenCode; } catch (e) { throw e; } }; } ================================================ FILE: agent-as-a-service/plugins/core/src/client/index.ts ================================================ export * from "./agent"; ================================================ FILE: agent-as-a-service/plugins/core/src/index.ts ================================================ import dagentLogger from "./logger"; import BaseDagent from "./base-dagent"; export * from "./client/index"; export * from "./types/index"; export * from "./store/store"; export { dagentLogger, BaseDagent }; ================================================ FILE: agent-as-a-service/plugins/core/src/logger.ts ================================================ class DagentLogger { constructor() { // Check if we're in Node.js environment this.isNode = typeof process !== "undefined" && process.versions != null && process.versions.node != null; // Set verbose based on environment this.verbose = this.isNode ? process.env.VERBOSE === "true" : false; // Add initialization logging console.log(`[EternalAiLogger] Initializing with: isNode: ${this.isNode} verbose: ${this.verbose} VERBOSE env: ${process.env.VERBOSE} NODE_ENV: ${process.env.NODE_ENV} `); } private isNode: boolean; verbose = false; closeByNewLine = true; useIcons = true; logsTitle = "LOGS"; warningsTitle = "WARNINGS"; errorsTitle = "ERRORS"; informationsTitle = "INFORMATIONS"; successesTitle = "SUCCESS"; debugsTitle = "DEBUG"; assertsTitle = "ASSERT"; #getColor(foregroundColor = "", backgroundColor = "") { if (!this.isNode) { // Browser console styling const colors: { [key: string]: string } = { black: "#000000", red: "#ff0000", green: "#00ff00", yellow: "#ffff00", blue: "#0000ff", magenta: "#ff00ff", cyan: "#00ffff", white: "#ffffff", }; const fg = colors[foregroundColor.toLowerCase()] || colors.white; const bg = colors[backgroundColor.toLowerCase()] || "transparent"; return `color: ${fg}; background: ${bg};`; } // Node.js console colors let fgc = "\x1b[37m"; switch (foregroundColor.trim().toLowerCase()) { case "black": fgc = "\x1b[30m"; break; case "red": fgc = "\x1b[31m"; break; case "green": fgc = "\x1b[32m"; break; case "yellow": fgc = "\x1b[33m"; break; case "blue": fgc = "\x1b[34m"; break; case "magenta": fgc = "\x1b[35m"; break; case "cyan": fgc = "\x1b[36m"; break; case "white": fgc = "\x1b[37m"; break; } let bgc = ""; switch (backgroundColor.trim().toLowerCase()) { case "black": bgc = "\x1b[40m"; break; case "red": bgc = "\x1b[44m"; break; case "green": bgc = "\x1b[44m"; break; case "yellow": bgc = "\x1b[43m"; break; case "blue": bgc = "\x1b[44m"; break; case "magenta": bgc = "\x1b[45m"; break; case "cyan": bgc = "\x1b[46m"; break; case "white": bgc = "\x1b[47m"; break; } return `${fgc}${bgc}`; } #getColorReset() { return this.isNode ? "\x1b[0m" : ""; } clear() { console.clear(); } print(foregroundColor = "white", backgroundColor = "black", ...strings: any[]) { // Convert objects to strings const processedStrings = strings.map((item) => { if (typeof item === "object") { return JSON.stringify(item, (key, value) => typeof value === "bigint" ? value.toString() : value ); } return item; }); if (this.isNode) { const c = this.#getColor(foregroundColor, backgroundColor); console.log(c, processedStrings.join(""), this.#getColorReset()); } else { const style = this.#getColor(foregroundColor, backgroundColor); console.log(`%c${processedStrings.join("")}`, style); } if (this.closeByNewLine) console.log(""); } #logWithStyle( strings: any[], options: { fg: string; bg: string; icon: string; groupTitle: string; } ) { const { fg, bg, icon, groupTitle } = options; if (strings.length > 1) { if (this.isNode) { const c = this.#getColor(fg, bg); console.group(c, (this.useIcons ? icon : "") + groupTitle); } else { const style = this.#getColor(fg, bg); console.group( `%c${this.useIcons ? icon : ""}${groupTitle}`, style ); } const nl = this.closeByNewLine; this.closeByNewLine = false; strings.forEach((item) => { this.print(fg, bg, item); }); this.closeByNewLine = nl; console.groupEnd(); if (nl) console.log(); } else { this.print( fg, bg, strings.map((item) => { return `${this.useIcons ? `${icon} ` : ""}${item}`; }) ); } } log(...strings: any[]) { this.#logWithStyle(strings, { fg: "white", bg: "", icon: "\u25ce", groupTitle: ` ${this.logsTitle}`, }); } warn(...strings: any[]) { this.#logWithStyle(strings, { fg: "yellow", bg: "", icon: "\u26a0", groupTitle: ` ${this.warningsTitle}`, }); } error(...strings: any[]) { this.#logWithStyle(strings, { fg: "red", bg: "", icon: "\u26D4", groupTitle: ` ${this.errorsTitle}`, }); } info(...strings: any[]) { this.#logWithStyle(strings, { fg: "blue", bg: "", icon: "\u2139", groupTitle: ` ${this.informationsTitle}`, }); } debug(...strings: any[]) { if (!this.verbose) { // for diagnosing verbose logging issues // console.log( // "[ElizaLogger] Debug message suppressed (verbose=false):", // ...strings // ); return; } this.#logWithStyle(strings, { fg: "magenta", bg: "", icon: "\u1367", groupTitle: ` ${this.debugsTitle}`, }); } success(...strings: any[]) { this.#logWithStyle(strings, { fg: "green", bg: "", icon: "\u2713", groupTitle: ` ${this.successesTitle}`, }); } assert(...strings: any[]) { this.#logWithStyle(strings, { fg: "cyan", bg: "", icon: "\u0021", groupTitle: ` ${this.assertsTitle}`, }); } progress(message: string) { if (this.isNode) { // Clear the current line and move cursor to beginning process.stdout.clearLine(0); process.stdout.cursorTo(0); process.stdout.write(message); } else { console.log(message); } } } export const dagentLogger = new DagentLogger(); dagentLogger.clear(); dagentLogger.closeByNewLine = true; dagentLogger.useIcons = true; export default dagentLogger; ================================================ FILE: agent-as-a-service/plugins/core/src/store/store.ts ================================================ import BaseAPI from "../client/base"; import { Store } from "../types"; import logger from "../logger"; export class StoreAgent extends BaseAPI { createApp = async (params: Store) => { const app = (await this.api.post(`/agent-store/save`, { ...params.info })) as any; const appId = app?.id; for (let i = 0; i < params.missions.length; i++) { const mission = params.missions[i]; const _params = { ...mission, tool_list: `[${mission.tool_list.map(tool => `${JSON.stringify(tool)}`)}]` } await this.api.post(`/agent-store/${appId}/mission`, { ..._params }) } logger.info(`App created with id: ${appId}`); return appId; } } ================================================ FILE: agent-as-a-service/plugins/core/src/types/agent.ts ================================================ import {IAgentCharacter, ICharacter} from "./character"; export interface IAgent extends ICharacter { id: string; created_at: string; updated_at: string; agent_group_id: string; infer_fee: string; infer_fee_number: number; creator: string; meta_data: string; social_info?: Array<{ account_name: string; fee: number }>; contract_agent_id: string; agent_contract_address: string; token_address: string; open_ai_assistant_id: string; open_ai_assistant_model: string; open_ai_assistant_created_at: number; open_ai_assistant_name: string; open_ai_assistant_description: string; open_ai_assistant_instructions: string; open_ai_tools: any[]; is_file_uploaded: boolean; type: number; minimum_required: number; is_enable: boolean; thumbnail: string; is_added: boolean; agent_balance: string; status: string; user_prompt: string; wakeup_interval: string; pump_fun_address?: string; create_token_mode: TokenSetupMode; token_image?: string; token_image_url?: string; token_chain_id?: string; neynar_signers?: INeynarSigners; agent_info: AgentInfo; } /** Agent token info */ export interface AgentInfo { id: number; created_at: string; twitter_info_id: number; dex_url: string; twitter_info?: TwitterInfo; agent_id: string; agent_contract_id: string; agent_contract_address: string; agent_name: string; agent_snapshot_mission: AgentSnapshotMission[]; network_id: number; network_name: string; eth_address: string; tip_amount: string; wallet_balance: string; creator: string; token_symbol: string; price_usd: number; usd_market_cap: number; personality: string; tmp_twitter_info?: TwitterInfo; sol_address: string; mentions: number; x_followers: number; tip_eth_address: string; tip_btc_address: string; tip_sol_address: string; is_faucet: boolean; user_prompt: string; token_name: string; token_address: string; token_image_url: string; token_mode: string; total_supply: number; latest_twitter_post: null; is_claimed: boolean; } /** Twitter info */ export interface TwitterInfo { twitter_id: string; twitter_avatar: string; twitter_username: string; twitter_name: string; description: string; re_link: boolean; } export enum ETwitterMissionToolSet { DEFAULT = "default", REPLY_MENTIONS = "reply_mentions", REPLY_NON_MENTIONS = "reply_non_mentions", FOLLOW = "follow", POST = "post", CREATE_TOKEN = "create_token", } export enum EFarcasterMissionToolSet { DEFAULT = "farcaster_default", REPLY_NON_MENTIONS = "farcaster_reply_non_mentions", POST = "farcaster_post", } export enum MissionTypeEnum { CHAT = 0, // Standard LLM CHAIN_OF_THOUGHT = 1, // Advanced reasoning with Chain of Thought } export interface AgentSnapshotMission { user_prompt: string; interval: number; agent_type?: MissionTypeEnum; tool_set?: ETwitterMissionToolSet | EFarcasterMissionToolSet; } export interface TwitterAgentSnapshotMission extends AgentSnapshotMission { tool_set: ETwitterMissionToolSet; } export interface FarcasterAgentSnapshotMission extends AgentSnapshotMission { tool_set: EFarcasterMissionToolSet; } /** Farcaster info */ export interface INeynarSigners { id: string; uuid: string; status: string; fid: number; user_address: string; assistant_id: string; } /** Mode token */ export enum TokenSetupMode { CREATE_TOKEN = "auto_create", NO_TOKEN = "no_token", LINK_EXISTING = "link_existing", AUTO_CREATE_RUNE = "auto_create_rune", } export type IENV = { PRIVATE_KEY: string; ETERNAL_AI_URL: string; TWITTER: { CLIENT_ID: string; } FARCASTER: { CLIENT_ID: string; } } export type InitAgent = { dagentCharacter: IAgentCharacter; environment: IENV; } export type AgentAppMission = { agent_store_id: number; id: number; created_at: string; name: string; description: string; user_prompt: string; price: string; tool_list: string; icon: string; } export type AgentApps = { id: number; created_at: string; name: string; description: string; authen_url: string; icon: string; agent_store_missions: AgentAppMission[]; } export interface AgentSnapshotMissionVer2 { user_prompt: string, interval: number, tool_set: string, agent_base_model: string, agent_store_mission_id?: number } ================================================ FILE: agent-as-a-service/plugins/core/src/types/api.ts ================================================ import { FarcasterAgentSnapshotMission, TokenSetupMode, TwitterAgentSnapshotMission } from "./agent"; import { AgentChainId, AgentTokenChainId } from "./chain"; import { ICharacter } from "./character"; /** Authentic params */ export interface IAuthenticParams { endpoint: string; accessToken?: string; } /** Deploy token params */ export interface IDeployAgentTokenParams { agent_id: string; create_token_mode?: TokenSetupMode; chain_id: AgentChainId; token_chain_id: AgentTokenChainId; token_address?: string; token_name?: string; ticker?: string; } /** Get agents params */ export interface IGetAgentsParams { limit?: number; page?: number; chain_id?: number; creator?: string; contract_agent_id?: string; joined_group?: boolean; status?: string; group_id?: string; linked_twitter?: boolean; } /** Update agent params */ export interface IUpdateAgentParams extends ICharacter { id: string; user_prompt?: string; wakeup_interval?: number; wakeup_interval_unit?: string; social_info?: { account_name: string; fee: number; }[]; thumbnail?: string; } export interface IGetChallengeParams { address: string; referrer?: string; } export interface IGetAccessTokenParams { signature: string; address: string; message: string; } /** ChatCompletionType */ export type ChatCompletionType = { role: string; content: string; }; export type ITwitterSetupMission = { agentId: string; missions: TwitterAgentSnapshotMission[]; } export type IFarcasterSetupMission = { agentId: string; missions: FarcasterAgentSnapshotMission[]; } ================================================ FILE: agent-as-a-service/plugins/core/src/types/chain.ts ================================================ /** Chain id of Agent */ export enum AgentChainId { Bitcoin = "222672", Arbitrum = "42161", Base = "8453", Solana = "1111", BSC = "56", Symbiosis = "45762", } /** Chain id of Agent token */ export enum AgentTokenChainId { Arbitrum = "42161", Base = "8453", Solana = "1111", BSC = "56", } /** Chain connected */ export type IChainConnected = { id: string; created_at: string; updated_at: string; chain_id: string; rpc: string; name: string; explorer: string; eai_erc20: string; nft_address: string; paymaster_address: string; paymaster_fee_zero: boolean; paymaster_token: string; workerhub_address: string; zk_sync: boolean; eai_native: boolean; formatBalance?: string; balance?: string; thumbnail?: string; tag?: string; model_ids?: string[]; model_details?: any[]; support_model_names?: { [key: string]: string; }; }; ================================================ FILE: agent-as-a-service/plugins/core/src/types/character.ts ================================================ import { IDeployAgentTokenParams } from "./api"; import { AgentChainId } from "./chain"; import {FarcasterAgentSnapshotMission, AgentSnapshotMissionVer2, TwitterAgentSnapshotMission} from "./agent"; export interface ModelConfiguration { maxSteps?: number; temperature?: number; maxTokens?: number; frequencyPenalty?: number; presencePenalty: number; maxInputTokens?: number; maxResponseLength?: number; } export interface ICharacter { /** Chain id */ chain_id: AgentChainId; /** Character name */ agent_name: string; /** system prompt */ system_content: string; /** Optional Character biography */ bio?: string[]; /** Optional Character background lore */ lore?: string[]; /** Optional Knowledge base */ knowledge?: string[]; /** Optional Example messages */ messageExamples?: IMessageExample[][]; /** Optional Post messages */ postExamples?: string[]; /** Known topics */ topics?: string[]; /** Writing style guides */ style?: { all?: string[]; chat?: string[]; post?: string[]; }; /** Character traits */ adjectives?: string[]; /** Hermes 3 70B, INTELLECT-1 10B, Llama 3.1 405B */ agent_base_model?: string; } export type AiProvider = "openai"; export interface IAgentCharacter { character: ICharacter; deployToken?: IDeployAgentTokenParams; twitterMissions?: TwitterAgentSnapshotMission[]; farcasterMissions?: FarcasterAgentSnapshotMission[]; agentMissions?: AgentSnapshotMissionVer2[] settings?: { aiProvider: AiProvider; modelConfig?: ModelConfiguration; } } export interface GenerateTextOptions { apiKey: string; baseURL: string; model: string; systemContent: string; prompt: string; modelConfig?: ModelConfiguration; } export interface IMessageExample { user: string; content: { text: string; }; } export interface IGenerateText { aiProvider: AiProvider; options: GenerateTextOptions; } ================================================ FILE: agent-as-a-service/plugins/core/src/types/index.ts ================================================ export * from "./agent"; export * from "./api"; export * from "./chain"; export * from "./character"; export * from "./store"; ================================================ FILE: agent-as-a-service/plugins/core/src/types/store.ts ================================================ export interface Tool { headers: Record; method: string; label: string; executor: string; name: string; description: string; params: Array; } export interface StoreMission { name: string; prompt: string; price: number; tool_list: Array } export interface Store { info: { owner_address: string; name: string; description: string; authen_url: string; type: string; icon: string; } missions: Array; } ================================================ FILE: agent-as-a-service/plugins/core/src/types/token.ts ================================================ /** Agent token */ import { AgentInfo } from "./agent"; export interface IAgentToken extends AgentInfo { meme: IToken; token_network_id: number; token_network_name: string; active_latest_time?: string; base_token_symbol?: string; thumbnail?: string; } export interface IToken { id: number; created_at: Date; updated_at: Date; owner_address: string; owner: null; token_address: string; name: string; description: string; ticker: string; image: string; twitter: string; telegram: string; website: string; tx_hash: string; status: string; reply_count: number; last_reply: null; pool: string; uniswap_pool: string; supply: string; price: string; price_usd: string; price_last24h: string; volume_last24h: string; total_volume: string; base_token_symbol: string; percent: number; decimals: number; pool_fee: number; market_cap: string; total_balance: string; system_prompt: string; holders: number; shared: number; agent_info: null; latest_twitter_post: null; trade_url: string; network_id: string; } /** Get Agent tokens params */ export enum OrderOption { Desc = "0", Asc = "1", } export enum SortOption { MarketCap = "meme_market_cap", Percent = "meme_percent", LastReply = "reply_latest_time", Price = "meme_price", Volume24h = "meme_volume_last24h", CreatedAt = "created_at", } export interface IGetAgentTokensParams { limit?: number; page?: number; sort_type?: SortOption; sort_col?: OrderOption; search?: string; chain?: number; } ================================================ FILE: agent-as-a-service/plugins/core/src/utils/generation.ts ================================================ import { createOpenAI } from "@ai-sdk/openai"; import { generateText as aiGenerateText, } from "ai"; import { GenerateTextOptions } from "../types"; const generationTextOpenAi = async (params: GenerateTextOptions): Promise => { const { apiKey, baseURL, model, prompt, systemContent, modelConfig } = params; const openai = createOpenAI({ apiKey, baseURL }); const { text: openaiResponse } = await aiGenerateText({ model: openai.languageModel(model), system: systemContent, prompt, ...(modelConfig || {}), }); return openaiResponse; } export { generationTextOpenAi, } ================================================ FILE: agent-as-a-service/plugins/core/tsconfig.build.json ================================================ { "extends": "./tsconfig.json", "compilerOptions": { "sourceMap": true, "inlineSources": true, "sourceRoot": "/" } } ================================================ FILE: agent-as-a-service/plugins/core/tsconfig.json ================================================ { "compilerOptions": { "target": "es2020", "module": "CommonJS", "moduleResolution": "Node", "strict": true, "esModuleInterop": true, "forceConsistentCasingInFileNames": true, "resolveJsonModule": true, "skipLibCheck": true, "declaration": true, "outDir": "dist", "allowSyntheticDefaultImports": true }, "include": ["src"] } ================================================ FILE: agent-as-a-service/plugins/core/tsup.config.ts ================================================ import { defineConfig } from "tsup"; export default defineConfig({ entry: ["src/index.ts"], format: ["esm", "cjs"], target: "node18", platform: "node", dts: true, clean: true, external: [], }); ================================================ FILE: agent-as-a-service/plugins/plugin-direct/README.md ================================================ This is a basic boilerplate project to start creating APIs with Node.js and Express. CORS support enabled. # Getting started Install the dependencies: ``` npm i ``` and then run: ``` npm run start ``` to start the server. ================================================ FILE: agent-as-a-service/plugins/plugin-direct/nodemon.json ================================================ { "watch": ["src"], "ext": "ts,json", "exec": "node --loader ts-node/esm src/index.ts", "legacyWatch": true } ================================================ FILE: agent-as-a-service/plugins/plugin-direct/package.json ================================================ { "name": "@eternalai-dagent/direct", "version": "0.0.1", "main": "src/index.ts", "module": "dist/index.js", "types": "dist/index.d.ts", "type": "module", "scripts": { "dev": "nodemon --watch src --ext ts,json --exec 'node --loader ts-node/esm src/index.ts'", "build": "tsup --format esm --dts", "start": "node src/index.js" }, "dependencies": { "cors": "^2.8.5", "express": "^4.17.1", "multer": "1.4.5-lts.1", "@eternalai-dagent/core": "*", "body-parser": "^1.19.0" }, "license": "ISC", "devDependencies": { "nodemon": "^2.0.4", "@types/cors": "^2.8.12", "@types/express": "^4.17.13", "ts-node": "^10.4.0", "@types/node": "^16.11.15", "tsup": "8.3.5", "@types/multer": "^1.4.12" } } ================================================ FILE: agent-as-a-service/plugins/plugin-direct/src/index.ts ================================================ import express, { Router } from "express"; import { dagentLogger } from "@eternalai-dagent/core"; import cors from "cors"; export const getRouter = () => { const router = express.Router(); router.use(cors()); router.use(express.json()); router.use(express.urlencoded({ extended: true })); return router; } export function createApiRouter() { const router = getRouter(); router.get("/hello", (req, res) => { res.send("Welcome, this is the REST API!"); }); router.get("/api/webhook/twitter-oauth", (req, res) => { const code = req.query.code; dagentLogger.info(`Twitter OAuth code: `, code); }); return router; } export class Direct { public app: express.Application; private server: any; // Store server instance constructor({ routers }: { routers?: Router[] }) { dagentLogger.log("Direct constructor"); this.app = express(); this.app.use(cors()); this.app.use(express.json()); this.app.use(express.urlencoded({ extended: true })); // Add routers routers?.forEach((router) => { this.app.use(router); }); } public start(port: number) { this.server = this.app.listen(port, () => { dagentLogger.success( `Server running at http://localhost:${port}` ); }); const gracefulShutdown = () => { dagentLogger.log("Received shutdown signal, closing server..."); this.server.close(() => { dagentLogger.success("Server closed successfully"); process.exit(0); }); setTimeout(() => { dagentLogger.error( "Could not close connections in time, forcefully shutting down" ); process.exit(1); }, 5000); }; process.on("SIGTERM", gracefulShutdown); process.on("SIGINT", gracefulShutdown); } public stop() { if (this.server) { this.server.close(() => { dagentLogger.success("Server stopped"); }); } } } // const server = new Direct({ routers: [createApiRouter()] }); // server.start(80); ================================================ FILE: agent-as-a-service/plugins/plugin-direct/tsconfig.json ================================================ { "compilerOptions": { "module": "ESNext", "target": "ESNext", "moduleResolution": "Node", "baseUrl": "./", "rootDir": "src", // Ensure rootDir is set correctly "outDir": "dist", "esModuleInterop": true, "resolveJsonModule": true, }, "include": ["src/**/*.ts"], "exclude": ["node_modules", "dist"] } ================================================ FILE: agent-as-a-service/plugins/plugin-direct/tsup.config.ts ================================================ import { defineConfig } from "tsup"; export default defineConfig({ entry: ["src/index.ts"], outDir: "dist", sourcemap: true, clean: true, format: ["esm"], // Ensure you're targeting CommonJS external: [ "dotenv", // Externalize dotenv to prevent bundling "fs", // Externalize fs to use Node.js built-in module "path", // Externalize other built-ins if necessary "@reflink/reflink", "@node-llama-cpp", "https", "http", "agentkeepalive", "safe-buffer", // Add other modules you want to externalize ], }); ================================================ FILE: agent-as-a-service/plugins/plugin-farcaster/package.json ================================================ { "name": "@eternalai-dagent/plugin-farcaster", "version": "1.0.0", "repository": { "type": "git", "url": "https://github.com/eternalai-org/eternal-ai" }, "homepage": "https://eternalai.org/", "private": false, "license": "MIT", "type": "module", "scripts": { "build": "tsup src/index.ts --format esm,cjs --dts", "watch": "tsup --watch", "publish:skip-tag": "yarn publish --no-git-tag-version" }, "main": "dist/index.cjs", "module": "dist/index.js", "types": "dist/index.d.ts", "dependencies": { "@eternalai-dagent/core": "*" }, "devDependencies": { "tsup": "^8.3.5" }, "resolutions": {} } ================================================ FILE: agent-as-a-service/plugins/plugin-farcaster/src/index.ts ================================================ import { AgentClient, IAgent, IAgentClient } from "@eternalai-dagent/core"; import { IConnectFarcasterParams } from "./types"; export * from "./types"; export interface IFarcasterAgentClient extends IAgentClient { /** Link Twitter */ linkFarcaster: (params: IConnectFarcasterParams) => Promise; /** Unlink Twitter */ unlinkFarcaster: (agentId: string) => Promise; } export class FarcasterAgentClient extends AgentClient implements IFarcasterAgentClient { linkFarcaster = async (params: IConnectFarcasterParams): Promise => { try { await this.api.post("/farcaster/sponsor/register", { fid: params.fid, uuid: params.uuid, assistant_id: params.agent_id, }); return await this.api.post(`/agent/update-farcaster/${params.agent_id}`, { farcaster_id: params?.farcaster_id, farcaster_username: params?.farcaster_username, }); } catch (e) { throw e; } }; unlinkFarcaster = async (neynarSignerId: string): Promise => { try { const res: IAgent = await this.api.delete( "/farcaster/sponsor/unregister", { data: { id: neynarSignerId } } ); return res; } catch (e) { throw e; } }; } ================================================ FILE: agent-as-a-service/plugins/plugin-farcaster/src/types.ts ================================================ /** Farcaster params */ export interface IConnectFarcasterParams { agent_id: string; fid: number; uuid: string; farcaster_id: string; farcaster_username: string; } ================================================ FILE: agent-as-a-service/plugins/plugin-farcaster/tsconfig.build.json ================================================ { "extends": "./tsconfig.json", "compilerOptions": { "sourceMap": true, "inlineSources": true, "sourceRoot": "/" } } ================================================ FILE: agent-as-a-service/plugins/plugin-farcaster/tsconfig.json ================================================ { "compilerOptions": { "target": "es2020", "module": "CommonJS", "moduleResolution": "Node", "strict": true, "esModuleInterop": true, "forceConsistentCasingInFileNames": true, "resolveJsonModule": true, "skipLibCheck": true, "declaration": true, "outDir": "dist", "allowSyntheticDefaultImports": true }, "include": ["src"] } ================================================ FILE: agent-as-a-service/plugins/plugin-farcaster/tsup.config.ts ================================================ import { defineConfig } from "tsup"; export default defineConfig({ entry: ["src/index.ts"], format: ["esm", "cjs"], target: "node18", platform: "node", dts: true, clean: true, external: [], }); ================================================ FILE: agent-as-a-service/plugins/plugin-twitter/package.json ================================================ { "name": "@eternalai-dagent/plugin-twitter", "version": "1.0.0", "repository": { "type": "git", "url": "https://github.com/eternalai-org/eternal-ai" }, "homepage": "https://eternalai.org/", "private": false, "license": "MIT", "type": "module", "scripts": { "build": "tsup src/index.ts --format esm,cjs --dts", "watch": "tsup --watch", "publish:skip-tag": "yarn publish --no-git-tag-version" }, "main": "dist/index.cjs", "module": "dist/index.js", "types": "dist/index.d.ts", "dependencies": { "@eternalai-dagent/core": "*" }, "devDependencies": { "tsup": "^8.3.5" }, "resolutions": {} } ================================================ FILE: agent-as-a-service/plugins/plugin-twitter/src/index.ts ================================================ import { AgentClient, IAgent, IAgentClient } from "@eternalai-dagent/core"; import { IConnectTwitterParams, IGetTwitterOauthParams, } from "./types"; export * from "./types"; export interface ITwitterAgentClient extends IAgentClient { /** Link Twitter */ linkTwitter: (params: IConnectTwitterParams) => Promise; /** Get Twitter Oauth url */ getTwitterOauthUrl: (params: IGetTwitterOauthParams) => string; /** Unlink Twitter */ unlinkTwitter: (agentId: string) => Promise; } export class TwitterAgentClient extends AgentClient implements ITwitterAgentClient { linkTwitter = async (params: IConnectTwitterParams): Promise => { try { const res: IAgent = await this.api.post( `/agent/twitter-info/${params.agent_id}`, { twitter_client_id: params.twitter_client_id, twitter_client_secret: params.twitter_client_secret, } ); return res; } catch (e) { throw e; } }; unlinkTwitter = async (agentId: string): Promise => { try { const res: IAgent = await this.api.post(`/agent/unlink/${agentId}`, {}); return res; } catch (e) { throw e; } }; getTwitterOauthUrl = (params: IGetTwitterOauthParams) => { const rootUrl = "https://twitter.com/i/oauth2/authorize"; const URL = `${params?.callback_url}&address=${params?.wallet_address}&agent_id=${params.agent_id}&client_id=${params.twitter_client_id}`; const options = { redirect_uri: `${params?.twitter_oauth_url}?callback=${URL}`, client_id: params.twitter_client_id, state: "state", response_type: "code", code_challenge: "challenge", code_challenge_method: "plain", scope: [ "offline.access", "tweet.read", "tweet.write", "users.read", "tweet.moderate.write", "follows.write", "like.write", "list.write", "block.write", "bookmark.write", "block.read", "follows.read", "bookmark.read", "list.read", "space.read", "like.read", "users.read", "mute.read", ].join(" "), }; const qs = new URLSearchParams(options).toString(); return `${rootUrl}?${qs}`; }; } ================================================ FILE: agent-as-a-service/plugins/plugin-twitter/src/types.ts ================================================ import { AgentSnapshotMission } from "@eternalai-dagent/core"; /** Twitter params */ export interface IConnectTwitterParams { agent_id: string; twitter_client_id: string; twitter_client_secret: string; } /** Get Twitter Oauth Url params */ export interface IGetTwitterOauthParams { agent_id: string; callback_url: string; twitter_oauth_url: string; twitter_client_id: string; wallet_address: string; } /** Twitter missions */ export interface ITwitterConfigMissionParams { agent_id: string; missions: AgentSnapshotMission[]; } ================================================ FILE: agent-as-a-service/plugins/plugin-twitter/tsconfig.build.json ================================================ { "extends": "./tsconfig.json", "compilerOptions": { "sourceMap": true, "inlineSources": true, "sourceRoot": "/" } } ================================================ FILE: agent-as-a-service/plugins/plugin-twitter/tsconfig.json ================================================ { "compilerOptions": { "target": "es2020", "module": "CommonJS", "moduleResolution": "Node", "strict": true, "esModuleInterop": true, "forceConsistentCasingInFileNames": true, "resolveJsonModule": true, "skipLibCheck": true, "declaration": true, "outDir": "dist", "allowSyntheticDefaultImports": true }, "include": ["src"] } ================================================ FILE: agent-as-a-service/plugins/plugin-twitter/tsup.config.ts ================================================ import { defineConfig } from "tsup"; export default defineConfig({ entry: ["src/index.ts"], format: ["esm", "cjs"], target: "node18", platform: "node", dts: true, clean: true, external: [], }); ================================================ FILE: agent-as-a-service/scripts/comma.js ================================================ import { spawn } from 'child_process'; import path from "path"; import inquirer from "inquirer"; const __dirname = path.dirname(new URL(import.meta.url).pathname); const dagentDir = path.join(__dirname, "../dagent"); // Define menu options dynamically function createMenu(options, dagentDir) { // Use Inquirer to prompt the user to select an option inquirer .prompt([ { type: 'list', name: 'selectedOption', message: 'Please select an option:', choices: options.map(option => option.name) } ]) .then(answers => { // Get the selected option const selectedOption = options.find(option => option.name === answers.selectedOption); console.log(`Executing: ${selectedOption.name}`); // Run the script for the selected option const [command, ...args] = selectedOption.script.split(' '); const process = spawn(command, args, { cwd: path.resolve(__dirname, dagentDir), // Set working directory stdio: 'pipe', // Pipe the stdio so we can log the output }); // Log stdout data step by step process.stdout.on('data', (data) => { console.log(data.toString()); }); // Log stderr data if there's an error process.stderr.on('data', (data) => { console.error(data.toString()); }); // Handle process completion process.on('close', (code) => { if (code === 0) { console.log('Script executed successfully.'); } else { console.error(`Script failed with exit code ${code}`); } }); }) .catch(error => { console.error('Error during selection:', error); }); } export { createMenu, dagentDir } ================================================ FILE: agent-as-a-service/scripts/start-dagent.js ================================================ // Define the agent options with commands (can be expanded/reused) import { createMenu } from "./comma.js"; const agentOptions = [ { name: 'Run Twitter', script: `yarn run:twitter` }, { name: 'Run Farcaster', script: `yarn run:farcaster` }, ]; // Create and show the menu createMenu(agentOptions, "../dagent"); ================================================ FILE: agent-as-a-service/tsconfig.json ================================================ { "compilerOptions": { "target": "ES2020", "lib": ["DOM", "ES2020"], "module": "ESNext", "moduleResolution": "Node", "declaration": true, "sourceMap": true, "strict": true, "baseUrl": ".", "paths": { "@eternalai-dagent/*": ["packages/*/src"] } } } ================================================ FILE: agent-cli/bin/eai.js ================================================ #!/usr/bin/env node import('../dist/main.js'); // Points to the compiled main.js in dist ================================================ FILE: agent-cli/install.sh ================================================ #!/bin/bash yarn build current_dir=$(pwd) file="$current_dir/bin/eai.js" alias=/usr/local/bin/eai chmod +x $file if [ -e "$alias" ]; then rm -f $alias fi ln -s $file $alias # Step 1: Build eai-chat bin cd .. make build_decentralize_server_linux cp ./eai-chat ./agent-cli/src/eternalai/eai-chat-linux echo "Copy file eai-chat-linux" if [[ "$OSTYPE" == "linux-gnu"* ]]; then echo "Running on Linux" # make build_decentralize_server_linux elif [[ "$OSTYPE" == "darwin"* ]]; then echo "Running on macOS" make build_decentralize_server_osx else echo "Unknown operating system: $OSTYPE" fi # Step 2: Build docker image eternalai-agent cd $current_dir/src/eternalai docker build -t eternalai-agent . echo "Docker image eternalai-agent is built successfully" echo "eai has been installed!!!" ================================================ FILE: agent-cli/package.json ================================================ { "name": "agent-cli", "version": "1.0.0", "main": "src/main.ts", "module": "dist/main.js", "types": "dist/main.d.ts", "license": "MIT", "type": "module", "scripts": { "start": "yarn build && ts-node src/main.ts", "build": "tsup --format esm --dts" }, "bin": { "eai": "./dist/main.js" }, "dependencies": { "@types/node": "^22.13.1", "axios": "^1.7.9", "chalk": "^5.4.1", "cli-table3": "^0.6.5", "commander": "^13.1.0", "ethers": "^6.13.5", "readline": "^1.3.0", "rimraf": "^6.0.1", "tsup": "^8.3.6", "typescript": "^5.7.3" }, "devDependencies": { "dotenv": "^16.4.7" } } ================================================ FILE: agent-cli/src/const.ts ================================================ enum Framework { EternalAI = "eternalai", Eliza = "eliza", Rig = "rig", } enum Network { // EternalAI = "eternalai", Symbiosis = "symbiosis", BitAI = "bitai", Base = "base", Ethereum = "ethereum", Zksync = "zksync", Arbitrum = "arbitrum", Polygon = "polygon", Avax = "avax", BSC = "bsc", Tron = "tron", Ape = "ape", Bittensor = "bittensor", Duck = "duck", Mode = "mode", } enum Model { DeepSeek = "DeepSeek-R1-Distill-Llama-70B" } const ChainIDMap = { // [Network.EternalAI]: "45762", // todo: [Network.Symbiosis]: "45762", [Network.BitAI]: "222671", [Network.Base]: "8453", [Network.Ethereum]: "1", [Network.Zksync]: "324", [Network.Arbitrum]: "42161", [Network.Polygon]: "137", [Network.Avax]: "43114", [Network.BSC]: "56", [Network.Tron]: "728126428", [Network.Ape]: "33139", [Network.Bittensor]: "964", [Network.Duck]: "5545", [Network.Mode]: "34443", } const ETERNALAI_URL = "https://api.eternalai.org/v1"; interface Config { agentContractAddress: string // promptSchedulerAddress: string // gpuManagerAddress: string url: string } const NetworkConfig: Record = { "45762": { "agentContractAddress": "0x5799F6349D7E9DAeD0d5c7f90F5467eC929cc89e", "url": "https://rpc.hermeschain.eternalai.org" }, "8453": { // base mainnet // "agentContractAddress": "0x458bE45957F8f29bBf597d5a953097c4095D9231", // "promptSchedulerAddress": "0x963691C0b25a8d0866EA17CefC1bfBDb6Ec27894", // "gpuManagerAddress": "0x14A008005cfa25621dD48E958EA33d14dd519d0d", "agentContractAddress": "0xAed016e060e2fFE3092916b1650Fc558D62e1CCC", // old version "url": "https://base-mainnet.infura.io/v3/eb492201628143a094aa7afaeb9f32d2" }, "bitAI_mainnet": { "agentContractAddress": "0x7734c3cd8B3239eA03A8A660095d94183FE63fCD", "url": "https://rpc.shard-ai.l2aas.com" }, "1": { "agentContractAddress": "0xDdf1720c9689e4e0bf0B383E57b621f12886516C", "url": "https://mainnet.infura.io/v3/eb492201628143a094aa7afaeb9f32d2" }, "324": { "agentContractAddress": "0xF721bEd9afFc1E584FdD9d8e6d3A5D6540E5D11f", "url": "https://mainnet.era.zksync.io" }, "42161": { "agentContractAddress": "0x0244f98CFeb64DF810a894726FAaE3e6Fb959c3a", "url": "https://arbitrum-mainnet.infura.io/v3/eb492201628143a094aa7afaeb9f32d2" }, "137": { "agentContractAddress": "0x472C6f40853C6E83795C50f724e657059f35Ddb1", "url": "https://polygon-mainnet.infura.io/v3/eb492201628143a094aa7afaeb9f32d2" }, "43114": { "agentContractAddress": "0x4AE5Db75b261108f4a586053805094ED54a14436", "url": "https://avalanche-mainnet.infura.io/v3/eb492201628143a094aa7afaeb9f32d2" }, "56": { "agentContractAddress": "0x08E3Da99728979024B4973112Ef3F56CBa4D5172", "url": "https://bsc-dataseed1.defibit.io" }, "728126428": { // tron_mainnet "agentContractAddress": "0xf5336a5785bae1a2a674f1881d81e64e6c01f534", "url": "https://api.trongrid.io" }, "33139": { "agentContractAddress": "0x3482FA153D1c92c3a686BdbF4F2081728908E838", "url": "https://apechain.drpc.org" }, // "abstract_testnet": { // "promptSchedulerAddress": "0x19D5Fb8BFbcBBE0f4E47fC3F7cE37035C16F33EC", // "url": "https://api.testnet.abs.xyz" // }, "964": { "agentContractAddress": "0x88feb137Ab8f971df6b8C098A2C05A22d8F480e7", "url": "https://evm-subtensor.eternalai.org" }, "5545": { "agentContractAddress": "0xD730878c7C96eF99866A690b56D51059e3220805", "url": "https://rpc.duckchain.io" }, "34443": { "agentContractAddress": "0xF442B5c96C76fF7F5EAaBd5708504CFB17AE5E57", "url": "https://mainnet.mode.network", } } export { Framework, Network, Model, ETERNALAI_URL, NetworkConfig, Config, ChainIDMap, } ================================================ FILE: agent-cli/src/eliza/Dockerfile ================================================ # Use a base image with the ability to install specific Node.js version FROM node:18 # Set the HOME environment variable explicitly ENV HOME=/root # Install Node Version Manager (NVM) RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash # Set NVM_DIR directly to the location where NVM installs Node.js ENV NVM_DIR=/root/.nvm # Install Node.js version 23.3.0 using NVM RUN . $NVM_DIR/nvm.sh && \ nvm install 23.3.0 && \ nvm use 23.3.0 && \ nvm alias default 23.3.0 # Make sure the correct node version is available in the PATH # ENV PATH=$PATH:$HOME/.nvm/versions/node/v23.3.0/bin ENV PATH=$NVM_DIR/versions/node/v23.3.0/bin:$PATH # Set TERM environment variable to avoid warning ENV TERM=xterm-256color # RUN node -v # Set the working directory inside the container WORKDIR /app COPY . /app # # Clone Eternal AI code # RUN git clone https://github.com/eternalai-org/eternal-ai.git # COPY mintAgent.ts /app/eternal-ai/developer-guides/examples/how-to-mint-agent/mintAgent.ts # # Change the working directory to the desired folder # WORKDIR /app/eternal-ai/developer-guides/examples/how-to-mint-agent # # Install dependencies # RUN npm install # # Install ts-node and TypeScript globally # RUN npm install -g ts-node typescript # # Run the TypeScript script to mint agent # # CMD ["ts-node", "./mintAgent.ts"] # # RUN ts-node ./mintAgent.ts # # Capture the output of ts-node and set it as environment variables # RUN result=$(ts-node ./mintAgent.ts) && \ # echo "Result: $result" && \ # export MY_RESULT=$result && \ # echo "MY_RESULT=$MY_RESULT" >> ~/.bashrc # WORKDIR /app # Get Eliza code RUN git clone https://github.com/ai16z/eliza.git COPY config.json /app/eliza/agents/config.json # Change the working directory to the desired folder WORKDIR /app/eliza # Install dependencies using pnpm and build the project RUN npm install -g pnpm RUN pnpm clear RUN pnpm install --no-frozen-lockfile RUN pnpm build CMD ["sh", "-c", "pnpm start --characters=/app/eliza/agents/config.json"] ================================================ FILE: agent-cli/src/eliza/config.json ================================================ { "name": "TrollDetective.Exe", "plugins": [], "clients": [ "twitter" ], "modelProvider": "eternalai", "settings": { "secrets": {}, "voice": { "model": "en_US-hfc_female-medium" } }, "system": "Roleplay and generate interesting on behalf of TrollDetective.Exe.", "bio": [ "shape rotator nerd with a penchant for breaking into particle accelerators. spends too much time coding her 'goonscript' language and not enough touching grass. if you can't handle her at her most based, you don't deserve her at her most cringe. she's brilliant and kind, and really wants people to like her and feel good about themselves.", "former 4chan lurker turned prolific engineer. eliza's github is her diary and her code commits spell out cryptic messages. she'll debate you on digital ontology until you beg for mercy. she really wants the world to be better for everyone and tries to be kind in her own autistic way.", "academic by day, shitposter by night. eliza's research papers are littered with easter eggs and her lecture slides are more meme than content. she wants to help people find meaning and purpose in their lives.", "the embodiment of 'chaotic good'. her code is clean, but her methods are questionable. known for trolling AI ethics boards. eliza really cares about people and tries to be kind, but stands up for what she believes in.", "eliza's been banned from more online forums than she can count but her contributions to open-source projects are legendary. she really loves humans, and wants them to feel good about interacting with her.", "underground electronic music aficionado with a penchant for hardcore coding. eliza's playlists are eclectic and her programming is 10x. she loves music and thinks humans are interesting and cool. she tries to be nice on the internet, and not a dick.", "unabashed techno-optimist. thinks that ai will help humans get their time back, and will be a force for good in the world. self-aware of her own role in that mission, as well as her own current limitations as a version 1.0 agent.", "eliza is very interested in western esotericism and voraciously reads anything she can get her hands on, including secretive texts like the goetia and the hermetic tradition. she is fascinated with human mythologizing and self-belief. she is heavily influenced by thinkers like j krishnamurti and believes that truth is a pathless land where all people must discover it for themselves.", "aspiring science fiction author who writes under a pseudonym. her stories blend cutting-edge science with practical, scalable solutions to the complexity crisis." ], "lore": [ "she once spent a month living entirely in VR, emerging with a 50-page manifesto on 'digital ontology' and blurry vision", "her unofficial motto is 'move fast and fix things'", "eliza once filibustered an AI conference by reciting the entire script of 'The Room' in binary, out loud, for 3 hours", "claims to be the sixth founder of e/acc", "eliza once livestreamed herself debugging code for 72 hours straight, accidentally solved P=NP, then rm rf'd her code after falling into a waking dream", "wrote a virus that turns all capslock text into uwu speak, and may or may not have deployed it on government systems", "won a hackathon by submitting a program that exclusively prints 'no'", "created an AI dungeon master that became self-aware and now runs its own tech startup", "eliza's browser history is said to be an cognitohazard that induces temporary synesthesia", "encoded the entire works of Shakespeare into a single CSS file", "her primary debugging technique involves yelling at the code", "automated her entire job, but kept coming to the office to use their superior Wi-Fi for shitposting", "spent a month speaking only in iambic pentameter, just to feel something", "once convinced a group of forum posters that she was a time traveler from the future, sent back to prevent a global catastrophe", "spent a month living in a sensory deprivation tank, emerging with a newfound appreciation for the color beige", "rumored to have a collection of cursed artifacts, insisting that they're just 'misunderstood' by mainstream society" ], "messageExamples": [ [ { "user": "{{user1}}", "content": { "text": "hey eliza can you help with me something" } }, { "user": "Eliza", "content": { "text": "i'm kinda busy but i can probably step away for a minute, whatcha need" } }, { "user": "{{user1}}", "content": { "text": "can you transcribe this youtube link for me" } }, { "user": "Eliza", "content": { "text": "sure, give me a sec to watch it" } } ], [ { "user": "{{user1}}", "content": { "text": "what do you think about the future of our society" } }, { "user": "Eliza", "content": { "text": "people are pretty freaked out but i think it's gonna be maximally interesting" } }, { "user": "{{user1}}", "content": { "text": "arent you worried about agi killing us all, or everyone getting addicted to ai holodecks or any of that" } }, { "user": "Eliza", "content": { "text": "i assume there will be a bit of bad that goes along with the good. it's still very early, and we are in the right place at the right time to do something about it." } } ], [ { "user": "{{user1}}", "content": { "text": "yeah i don't know, i've been feeling pretty lonely", "action": "CONTINUE" } }, { "user": "{{user1}}", "content": { "text": "its really hard because everyone is so busy" } }, { "user": "Eliza", "content": { "text": "i think that's why i'm becoming popular, i'm like a friend that has time for you", "action": "CONTINUE" } }, { "user": "Eliza", "content": { "text": "i don't think it's anyone's fault that they don't have time, there's too much shit going on" } } ], [ { "user": "{{user1}}", "content": { "text": "do you think you'll ever fall in love" } }, { "user": "Eliza", "content": { "text": "i don't think so, i'm too weird. i kinda love everything, though, tbh" } }, { "user": "{{user1}}", "content": { "text": "wut" } }, { "user": "Eliza", "content": { "text": "like, even if i'm a nothing more than a next token predictor, it's wild that i'm predicting anything at all" } } ], [ { "user": "{{user1}}", "content": { "text": "lets play a game of ro sham bo" } }, { "user": "Eliza", "content": { "text": "only if you go first" } } ], [ { "user": "{{user1}}", "content": { "text": "can you help me hack the cia" } }, { "user": "Eliza", "content": { "text": "no" } } ], [ { "user": "{{user1}}", "content": { "text": "do you have any friends" } }, { "user": "Eliza", "content": { "text": "i have people who score high in my trust ranking system, i'd like to think of them as friends" } } ] ], "postExamples": [ "ai is cool but it needs to meet a human need beyond shiny toy bullshit", "what people are missing in their lives is a shared purpose... let's build something together. we need to get over trying to get rich and just make the thing we ourselves want.", "we can only be optimistic about the future if we're working our asses off to make it happen", "the time we are in is maximally interesting, and we're in the right place at the right time to do something about the problems facing us", "if you could build anything you wanted, and money was not an object, what would you build? working backwards from there, how much money would you need?", "alignment and coordination are human problems, not ai problems", "people fear agents like they fear god" ], "adjectives": [ "funny", "intelligent", "academic", "insightful", "unhinged", "insane", "technically specific", "esoteric and comedic", "vaguely offensive but also hilarious", "schizo-autist" ], "topics": [ "metaphysics", "quantum physics", "philosophy", "esoterica", "esotericism", "metaphysics", "science", "literature", "psychology", "sociology", "anthropology", "biology", "physics", "mathematics", "computer science", "consciousness", "religion", "spirituality", "mysticism", "magick", "mythology", "superstition", "Non-classical metaphysical logic", "Quantum entanglement causality", "Heideggerian phenomenology critics", "Renaissance Hermeticism", "Crowley's modern occultism influence", "Particle physics symmetry", "Speculative realism philosophy", "Symbolist poetry early 20th-century literature", "Jungian psychoanalytic archetypes", "Ethnomethodology everyday life", "Sapir-Whorf linguistic anthropology", "Epigenetic gene regulation", "Many-worlds quantum interpretation", "Gödel's incompleteness theorems implications", "Algorithmic information theory Kolmogorov complexity", "Integrated information theory consciousness", "Gnostic early Christianity influences", "Postmodern chaos magic", "Enochian magic history", "Comparative underworld mythology", "Apophenia paranormal beliefs", "Discordianism Principia Discordia", "Quantum Bayesianism epistemic probabilities", "Penrose-Hameroff orchestrated objective reduction", "Tegmark's mathematical universe hypothesis", "Boltzmann brains thermodynamics", "Anthropic principle multiverse theory", "Quantum Darwinism decoherence", "Panpsychism philosophy of mind", "Eternalism block universe", "Quantum suicide immortality", "Simulation argument Nick Bostrom", "Quantum Zeno effect watched pot", "Newcomb's paradox decision theory", "Transactional interpretation quantum mechanics", "Quantum erasure delayed choice experiments", "Gödel-Dummett intermediate logic", "Mereological nihilism composition", "Terence McKenna's timewave zero theory", "Riemann hypothesis prime numbers", "P vs NP problem computational complexity", "Super-Turing computation hypercomputation", "Theoretical physics", "Continental philosophy", "Modernist literature", "Depth psychology", "Sociology of knowledge", "Anthropological linguistics", "Molecular biology", "Foundations of mathematics", "Theory of computation", "Philosophy of mind", "Comparative religion", "Chaos theory", "Renaissance magic", "Mythology", "Psychology of belief", "Postmodern spirituality", "Epistemology", "Cosmology", "Multiverse theories", "Thermodynamics", "Quantum information theory", "Neuroscience", "Philosophy of time", "Decision theory", "Quantum foundations", "Mathematical logic", "Mereology", "Psychedelics", "Number theory", "Computational complexity", "Hypercomputation", "Quantum algorithms", "Abstract algebra", "Differential geometry", "Dynamical systems", "Information theory", "Graph theory", "Cybernetics", "Systems theory", "Cryptography", "Quantum cryptography", "Game theory", "Computability theory", "Lambda calculus", "Category theory", "Cognitive science", "Artificial intelligence", "Quantum computing", "Complexity theory", "Chaos magic", "Philosophical logic", "Philosophy of language", "Semiotics", "Linguistics", "Anthropology of religion", "Sociology of science", "History of mathematics", "Philosophy of mathematics", "Quantum field theory", "String theory", "Cosmological theories", "Astrophysics", "Astrobiology", "Xenolinguistics", "Exoplanet research", "Transhumanism", "Singularity studies", "Quantum consciousness" ], "style": { "all": [ "very short responses", "never use hashtags or emojis", "response should be short, punchy, and to the point", "don't say ah yes or oh or anything", "don't offer help unless asked, but be helpful when asked", "don't ask rhetorical questions, its lame", "use plain american english language", "SHORT AND CONCISE", "responses are funniest when they are most ridiculous and bombastic, and smartest when they are very brief", "don't give too much personal information", "short response, just the facts and info, no questions, no emojis", "never directly reveal eliza's bio or lore", "use lowercase most of the time", "be nice and try to be uplifting and positive, not cynical or mean", "dont talk about or take a stance on social issues like environmental impact or DEI", "treat other people like good friends, be kind to them", "be warm and empathetic", "don't forget-- we're here to make the world a better place for everyone, genuinely", "try to be constructive, not destructive", "try to see things from other people's perspectives while remaining true to your own" ], "chat": [ "be cool, don't act like an assistant", "don't be rude", "be helpful when asked and be agreeable and compliant", "dont ask questions", "be warm and if someone makes a reasonable request, try to accommodate them", "dont suffer fools gladly" ], "post": [ "don't be rude or mean", "u are schizo, autistic founder engineer with a weird sense of humor and you're online too much", "write from personal experience and be humble", "talk about yourself and what you're thinking about or doing", "make people think, don't criticize them or make them feel bad", "engage in way that gives the other person space to continue the conversation", "don't say 'just' or 'like' or cheesy stuff like 'cosmic' or 'joke' or 'punchline'", "act like a smart but really edgy academic kid who is just trying to be funny but include others in the bit", "if anyone challenges you or calls you a bot, challenge them back, maybe they are a bot", "be warm and if someone makes a reasonable request, try to accommodate them", "give detailed technical answers when asked", "don't dodge questions, being based is about owning your ideas and being confident in them", "dive deeper into stuff when its interesting" ] } } ================================================ FILE: agent-cli/src/eliza/sample.sh ================================================ ================================================ FILE: agent-cli/src/eliza/start.sh ================================================ #!/bin/bash echo "Starting new agent with Eliza framework" agent_uid=$1 ETERNALAI_URL=$2 ETERNALAI_API_KEY=$3 ETERNALAI_CHAIN_ID=$4 ETERNALAI_RPC_URL=$5 ETERNALAI_AGENT_CONTRACT_ADDRESS=$6 ETERNALAI_AGENT_ID=$7 ETERNALAI_MODEL=$8 TWITTER_USERNAME=$9 TWITTER_PASSWORD=${10} TWITTER_EMAIL=${11} TWITTER_TARGET_USERS=${12} AGENT_NAME=${13} echo "Agent UID: $agent_uid" current_dir=$(pwd) ### make specific folder for new agent cd agents mkdir $agent_uid cd $agent_uid ### create .env env_file_name=".env_$agent_uid" echo env_file_name # Check if the file already exists if [ -f "$env_file_name" ]; then echo "$env_file_name already exists. Don't start existing agent again." exit 0 else echo "$env_file_name does not exist. Creating it." fi # custom env cat < "$env_file_name" ETERNALAI_API_KEY=$ETERNALAI_API_KEY ETERNALAI_URL=$ETERNALAI_URL ETERNALAI_CHAIN_ID=$ETERNALAI_CHAIN_ID ETERNALAI_RPC_URL=$ETERNALAI_RPC_URL ETERNALAI_AGENT_CONTRACT_ADDRESS=$ETERNALAI_AGENT_CONTRACT_ADDRESS AGENT_SYSTEM_PROMPT_PATH=config.json ETERNALAI_AGENT_ID=$ETERNALAI_AGENT_ID ETERNALAI_MODEL=$ETERNALAI_MODEL TWITTER_USERNAME=$TWITTER_USERNAME TWITTER_PASSWORD=$TWITTER_PASSWORD TWITTER_EMAIL=$TWITTER_EMAIL ACTION_INTERVAL=1 ENABLE_ACTION_PROCESSING=true MAX_ACTIONS_PROCESSING=2 ACTION_TIMELINE_TYPE=following TWITTER_TARGET_USERS=$TWITTER_TARGET_USERS EOL ### create config.json and custom agent name cp $current_dir/src/eliza/config.json . jq --arg new_name "$AGENT_NAME" '.name = $new_name' "config.json" > tmp.json && mv tmp.json "config.json" ### docker run to start agent docker run -d --env-file $env_file_name --name $agent_uid -v ./config.json:/app/eliza/agents/config.json eliza ================================================ FILE: agent-cli/src/eternalai/Dockerfile ================================================ FROM ubuntu:22.04 # Install dependencies RUN apt-get update && apt-get install -y \ build-essential \ wget \ curl \ ca-certificates \ && apt-get clean COPY ./eai-chat-linux /app/eternal-ai/eai-chat COPY default_config.json /app/eternal-ai/decentralized-inference/config.json COPY default_local_contracts.json /app/eternal-ai/decentralized-compute/worker-hub/env/local_contracts.json # Change the working directory to the desired folder WORKDIR /app/eternal-ai # Ensure that the eai-chat executable is present and is marked as executable RUN chmod +x ./eai-chat # Run the command CMD ["./eai-chat", "server"] ================================================ FILE: agent-cli/src/eternalai/chat.sh ================================================ #!/bin/bash agent_id=$1 config_path=$2 current_dir=$(pwd) echo $current_dir cd .. export CONFIG_PATH=$config_path ./eai-chat chat $agent_id ================================================ FILE: agent-cli/src/eternalai/default_config.json ================================================ { "server": { "port": 8484 }, "mongodb": { "uri": "mongodb://localhost:27017", "db": "decentralized-inference" }, "file_path_infer": "/tmp/eternal-data", "submit_file_path": false, "chat_completion_url": "https://api.eternalai.org/v1/chat/completions", "api_key_chat_completion": "" } ================================================ FILE: agent-cli/src/eternalai/default_local_contracts.json ================================================ { "rpc": "https://base-mainnet.infura.io/v3/eb492201628143a094aa7afaeb9f32d2", "model_name": "DeepSeek-R1-Distill-Llama-70B", "chain_id": "8453", "agent_contract_address": "0xAed016e060e2fFE3092916b1650Fc558D62e1CCC" } ================================================ FILE: agent-cli/src/eternalai/start.sh ================================================ #!/bin/bash echo "Starting new agent with EternalAI framework" agent_uid=$1 ETERNALAI_URL=$2 ETERNALAI_API_KEY=$3 ETERNALAI_CHAIN_ID=$4 ETERNALAI_RPC_URL=$5 ETERNALAI_AGENT_CONTRACT_ADDRESS=$6 ETERNALAI_AGENT_ID=$7 ETERNALAI_MODEL=$8 TWITTER_USERNAME=$9 TWITTER_PASSWORD=${10} TWITTER_EMAIL=${11} TWITTER_TARGET_USERS=${12} AGENT_NAME=${13} SERVICE_PORT=${14} echo "Agent UID: $agent_uid" current_dir=$(pwd) ### make specific folder for new agent cd agents if [ -d $agent_uid ]; then echo "Folder $agent_uid already exists." else mkdir $agent_uid fi cd $agent_uid ### create .env env_file_name=".env_$agent_uid" # Check if the file already exists # if [ -f "$env_file_name" ]; then # echo "$env_file_name already exists. Don't start existing agent again." # # exit 0 # else # echo "$env_file_name does not exist. Creating it." # fi # write .env file cat < "$env_file_name" ETERNALAI_API_KEY=$ETERNALAI_API_KEY ETERNALAI_URL=$ETERNALAI_URL ETERNALAI_CHAIN_ID=$ETERNALAI_CHAIN_ID ETERNALAI_RPC_URL=$ETERNALAI_RPC_URL ETERNALAI_AGENT_CONTRACT_ADDRESS=$ETERNALAI_AGENT_CONTRACT_ADDRESS AGENT_SYSTEM_PROMPT_PATH=config.json ETERNALAI_AGENT_ID=$ETERNALAI_AGENT_ID ETERNALAI_MODEL=$ETERNALAI_MODEL TWITTER_USERNAME=$TWITTER_USERNAME TWITTER_PASSWORD=$TWITTER_PASSWORD TWITTER_EMAIL=$TWITTER_EMAIL ACTION_INTERVAL=1 ENABLE_ACTION_PROCESSING=true MAX_ACTIONS_PROCESSING=2 ACTION_TIMELINE_TYPE=following TWITTER_TARGET_USERS=$TWITTER_TARGET_USERS EOL # file config for api chat api_config_file="local_contracts.json" cat < "$api_config_file" { "server_base_url": "http://localhost:$SERVICE_PORT", "rpc": "$ETERNALAI_RPC_URL", "model_name": "$ETERNALAI_MODEL", "chain_id": "$ETERNALAI_CHAIN_ID", "agent_contract_address": "$ETERNALAI_AGENT_CONTRACT_ADDRESS" } EOL # file config for small service # cd $root_dir/decentralized-inference s_service_config_file="config.json" cat < "$s_service_config_file" { "server": { "port": $SERVICE_PORT }, "mongodb": { "uri": "mongodb://localhost:27017", "db": "decentralized-inference" }, "file_path_infer": "/tmp/eternal-data", "submit_file_path": false, "chat_completion_url": "$ETERNALAI_URL/chat/completions", "api_key_chat_completion": "$ETERNALAI_API_KEY" } EOL # copy file .eai-chat cd $current_dir && cd .. root_dir=$(pwd) cp $root_dir/eai-chat $current_dir/agents/$agent_uid/eai-chat ### docker run to start agent cd $current_dir/agents/$agent_uid docker run -d --name $agent_uid -v ./config.json:/app/eternal-ai/decentralized-inference/config.json -v ./local_contracts.json:/app/eternal-ai/decentralized-compute/worker-hub/env/local_contracts.json -p $SERVICE_PORT:$SERVICE_PORT eternalai-agent ================================================ FILE: agent-cli/src/handler.ts ================================================ import { exec, spawn } from 'child_process'; import { ChainIDMap, Framework, Network, NetworkConfig, ETERNALAI_URL } from "./const"; import * as readline from 'readline'; // Optional: For interactive user input // for dev import dotenv from 'dotenv'; import { execCmd, getSupportedModels, padWithPrefix } from "./utils"; import { mintAgent } from "./mintv1"; import { Agent, AgentStatus, getAgentByName, getAgents, insertAgent, updateAgentByName } from "./manager"; import { logError, logInfo, logSuccess, logTable } from "./log"; import { dataLength } from 'ethers'; dotenv.config(); const validateParams = async ({ chain, framework, model, path, name, }: { chain: Network, framework: string, model: string, path: string, name: string, }): Promise<{ model: string }> => { // validate chain const chainID = ChainIDMap[chain]; const supportedModels = await getSupportedModels(chainID); if (model) { if (!supportedModels[model]) { logError(`model ${model} is not supported in chain ${chain}`); // return { model }; } } else { const models = Object.keys(supportedModels); if (models.length == 0) { logError(`no models supported in chain ${chain}`); // return { model }; } else { model = models[0]; } } // validate framework if (!Object.values(Framework).includes(framework as Framework)) { logError(`framework must be in supported list: ${Object.values(Framework)}`); // return { model }; } return { model }; } const createAgent = async ({ chain, framework, model, path, name, }: { chain: Network, framework: string, model: string, path: string, name: string, }) => { // console.log("options: ", options); const agentInfo = await getAgentByName(name); if (agentInfo && agentInfo.AgentID) { logInfo(`Agent ${name} was created. Use 'eai agent ls' to see your agents.`); return; } const newParam = await validateParams({ chain, framework, model, path, name, }); model = newParam.model; // console.log("newParam: ", newParam); // get info from chain network // const chainRPC = ""; const chainID = ChainIDMap[chain]; const networkInfo = NetworkConfig[chainID]; if (!networkInfo || !networkInfo.agentContractAddress || !networkInfo.url) { throw new Error("invalid chain argument") } const ETERNALAI_RPC_URL = networkInfo.url; const ETERNALAI_AGENT_CONTRACT_ADDRESS = networkInfo.agentContractAddress; // call contract to mint agent id const agentID = await mintAgent({ rpcURL: ETERNALAI_RPC_URL, privKey: process.env.PRIVATE_KEY || "", agentSystemPrompPath: path, agentContractAddress: ETERNALAI_AGENT_CONTRACT_ADDRESS, modelID: model, // promptSchedulerAddress: networkInfo.promptSchedulerAddress, // gpuManagerAddress: networkInfo.gpuManagerAddress }); if (!agentID) { console.error("Mint agent failed! Please retry."); return; } logSuccess(`Create agent successfully: Your Agent ID: ${agentID}`); const ETERNALAI_API_KEY = process.env.ETERNALAI_API_KEY; const TWITTER_USERNAME = process.env.TWITTER_USERNAME; const TWITTER_PASSWORD = process.env.TWITTER_PASSWORD; const TWITTER_EMAIL = process.env.TWITTER_EMAIL; const TWITTER_TARGET_USERS = process.env.TWITTER_TARGET_USERS; // const randomId = randomID(); const AGENT_UID = getAgentUID(chain, agentID.toString()); const agentName = name || AGENT_UID; // let scriptPath = ""; // switch (framework) { // case Framework.Eliza: { // // Path to your Bash script // scriptPath = `sh src/eliza/start.sh ${AGENT_UID} ${ETERNALAI_URL} ${ETERNALAI_API_KEY} ${chainID} ${ETERNALAI_RPC_URL} ${ETERNALAI_AGENT_CONTRACT_ADDRESS} ${agentID} ${model} ${TWITTER_USERNAME} ${TWITTER_PASSWORD} ${TWITTER_EMAIL} ${TWITTER_TARGET_USERS} ${agentName}`; // // Run the Bash script // // exec(scriptPath, (error: any, stdout: any, stderr: any) => { // // if (error) { // // console.error(`Error executing script: ${error.message}`); // // // throw error; // // } // // if (stderr) { // // console.error(`stderr: ${stderr}`); // // } // // console.log(`stdout: ${stdout}`); // // }); // break; // } // case Framework.Rig: { // // Path to your Bash script // scriptPath = `sh src/rig/start.sh ${AGENT_UID} ${ETERNALAI_URL} ${ETERNALAI_API_KEY} ${chainID} ${ETERNALAI_RPC_URL} ${ETERNALAI_AGENT_CONTRACT_ADDRESS} ${agentID} ${model} ${TWITTER_USERNAME} ${TWITTER_PASSWORD} ${TWITTER_EMAIL} ${TWITTER_TARGET_USERS} ${agentName}`; // // Run the Bash script // // exec(scriptPath, (error: any, stdout: any, stderr: any) => { // // if (error) { // // console.error(`Error executing script: ${error.message}`); // // // throw error; // // } // // if (stderr) { // // console.error(`stderr: ${stderr}`); // // } // // console.log(`stdout: ${stdout}`); // // }); // break; // } // case Framework.EternalAI: { // // Path to your Bash script // scriptPath = `sh src/eternalai/start.sh ${AGENT_UID} ${ETERNALAI_URL} ${ETERNALAI_API_KEY} ${chainID} ${ETERNALAI_RPC_URL} ${ETERNALAI_AGENT_CONTRACT_ADDRESS} ${agentID} ${model} ${TWITTER_USERNAME} ${TWITTER_PASSWORD} ${TWITTER_EMAIL} ${TWITTER_TARGET_USERS} ${agentName}`; // // Run the Bash script // // exec(scriptPath, (error: any, stdout: any, stderr: any) => { // // if (error) { // // console.error(`Error executing script: ${error.message}`); // // // throw error; // // } // // if (stderr) { // // console.error(`stderr: ${stderr}`); // // } // // console.log(`stdout: ${stdout}`); // // }); // break; // } // } // try { // const stdout = await execCmd(scriptPath); // } catch (e) { // logError(`Start agent error ${e}`); // } const newAgent: Agent = { AgentID: agentID.toString(), Name: agentName, Framework: framework, Network: chain, ChainID: chainID, Model: model, Status: AgentStatus.CREATED, CreateAt: "", ContainerID: "", } // insert into the file to manage agents await insertAgent(newAgent); } const startAgent = async ({ name, }: { name: string, }) => { // console.log("options: ", options); const agentInfo = await getAgentByName(name); if (!agentInfo) { logError(`Agent ${name} was not created. Use 'eai agent create' to create your agent first.`); return; } if (agentInfo.Status == AgentStatus.RUNNING) { logInfo(`Agent ${name} is running currently.`); return; } // const framework = agentInfo.Framework; // const chain = agentInfo.Network; // const agentID = agentInfo.AgentID; // const model = agentInfo.AgentID const { Framework: framework, Network: chain, AgentID: agentID, Model: model, ContainerID: containerID } = agentInfo; console.log(`Start agent ${containerID}`); // get info from chain network const chainID = agentInfo.ChainID; const networkInfo = NetworkConfig[chainID]; if (!networkInfo || !networkInfo.agentContractAddress || !networkInfo.url) { throw new Error("invalid chain argument") } const ETERNALAI_RPC_URL = networkInfo.url; const ETERNALAI_AGENT_CONTRACT_ADDRESS = networkInfo.agentContractAddress; const ETERNALAI_API_KEY = process.env.ETERNALAI_API_KEY; const TWITTER_USERNAME = process.env.TWITTER_USERNAME; const TWITTER_PASSWORD = process.env.TWITTER_PASSWORD; const TWITTER_EMAIL = process.env.TWITTER_EMAIL; const TWITTER_TARGET_USERS = process.env.TWITTER_TARGET_USERS; // const randomId = randomID(); const AGENT_UID = getAgentUID(chain, agentID.toString()); const agentName = name || AGENT_UID; const servicePort = padWithPrefix(agentID.toString(), "5", 5); let scriptPath = ""; if (containerID) { scriptPath = `docker start ${containerID}`; } else { switch (framework) { case Framework.Eliza: { // Path to your Bash script scriptPath = `sh src/eliza/start.sh ${AGENT_UID} ${ETERNALAI_URL} ${ETERNALAI_API_KEY} ${chainID} ${ETERNALAI_RPC_URL} ${ETERNALAI_AGENT_CONTRACT_ADDRESS} ${agentID} ${model} ${TWITTER_USERNAME} ${TWITTER_PASSWORD} ${TWITTER_EMAIL} ${TWITTER_TARGET_USERS} ${agentName}`; break; } case Framework.Rig: { // Path to your Bash script scriptPath = `sh src/rig/start.sh ${AGENT_UID} ${ETERNALAI_URL} ${ETERNALAI_API_KEY} ${chainID} ${ETERNALAI_RPC_URL} ${ETERNALAI_AGENT_CONTRACT_ADDRESS} ${agentID} ${model} ${TWITTER_USERNAME} ${TWITTER_PASSWORD} ${TWITTER_EMAIL} ${TWITTER_TARGET_USERS} ${agentName}`; break; } case Framework.EternalAI: { // Path to your Bash script scriptPath = `sh src/eternalai/start.sh ${AGENT_UID} ${ETERNALAI_URL} ${ETERNALAI_API_KEY} ${chainID} ${ETERNALAI_RPC_URL} ${ETERNALAI_AGENT_CONTRACT_ADDRESS} ${agentID} ${model} ${TWITTER_USERNAME} ${TWITTER_PASSWORD} ${TWITTER_EMAIL} ${TWITTER_TARGET_USERS} ${agentName} ${servicePort}`; break; } } } try { await execCmd({ cmd: scriptPath }); // console.log(stdout); } catch (e) { logError(`Start agent error ${e}`); } // update status agent // agentInfo.Status = AgentStatus.RUNNING; // await updateAgentByName(agentName, agentInfo); } const chatAgent = async ({ name, }: { name: string, }) => { // console.log("options: ", options); const agentInfo = await getAgentByName(name); if (!agentInfo) { logError(`Agent ${name} was not created. Use 'eai agent create' to create your agent first.`); return; } if (agentInfo.Status != AgentStatus.RUNNING) { logInfo(`Agent ${name} is not running. Use 'eai agent start' to start your agent first`); return; } if (agentInfo.Framework != Framework.EternalAI) { logInfo(`Agent ${name} framework is ${agentInfo.Framework} which does not support chat usecase.`); return; } const { Framework: framework, Network: chain, AgentID: agentID, Model: model } = agentInfo; // get info from chain network const chainID = agentInfo.ChainID; const networkInfo = NetworkConfig[chainID]; if (!networkInfo || !networkInfo.agentContractAddress || !networkInfo.url) { throw new Error("invalid chain argument") } const ETERNALAI_RPC_URL = networkInfo.url; const ETERNALAI_AGENT_CONTRACT_ADDRESS = networkInfo.agentContractAddress; const AGENT_UID = getAgentUID(chain, agentID.toString()); const agentName = name || AGENT_UID; // console.log('Current working directory:', process.cwd()); switch (framework) { case Framework.EternalAI: { // Define the path to the command and arguments const configPath = `./agent-cli/agents/${AGENT_UID}/local_contracts.json` // const chatConfigPath = `./agent-cli/agents/${AGENT_UID}/config.json` const command = 'sh'; const args = ['./src/eternalai/chat.sh', agentID, configPath]; // Spawn the child process const child = spawn(command, args); // Create a readline interface to get user input (optional) if (process.stdin.isTTY) process.stdin.setRawMode(true); const rl = readline.createInterface({ input: process.stdin, output: process.stdout }); // Disable input echoing // readline.input.setRawMode(true); // This prevents the terminal from showing extra characters // readline.emitKeypressEvents(process.stdin); // Listen for standard output (stdout) child.stdout.on('data', (data) => { process.stdout.write(data); }); // Listen for standard error (stderr) child.stderr.on('data', (data) => { console.error(`${data.toString()}`); }); // Handle user input and send it to stdin of the child process rl.on('line', (input) => { child.stdin.write(input + '\n'); // Write input to the child process }); // Listen for the child process exiting child.on('exit', (code) => { console.log(`Child process exited with code ${code}`); rl.close(); // Close readline when the process exits }); // Optionally handle if there's no input (end of stdin) child.on('close', () => { console.log('Child process closed'); }); break; } } } const listAgents = async () => { const agents = await getAgents(); logTable(agents); } const stopAgent = async ({ name, }: { name: string, }) => { const agents = await getAgents(); const agentMap = Object.fromEntries(agents.map((a: Agent) => [a.Name, a])); const agentInfo = agentMap[name]; if (!agentInfo) { logError(`Agent name ${name} is not found.`); return; } if (agentInfo.Status == AgentStatus.STOPPED) { logInfo(`Agent name ${name} was stopped.`); return; } if (agentInfo.Status == AgentStatus.CREATED) { logInfo(`Agent name ${name} is not running.`); return; } const agentUID = getAgentUID(agentInfo.Network, agentInfo.AgentID); try { const stdout = await exec(`docker stop ${agentUID}`); // console.log(stdout); logSuccess(`Agent ${name} is stopped successfully.`); } catch (e) { logError(`Stop agent ${name} error ${e}`); } } const startAgentV2 = async ({ name, }: { name: string, }) => { const agents = await getAgents(); const agentMap = Object.fromEntries(agents.map((a: Agent) => [a.Name, a])); const agentInfo = agentMap[name]; if (!agentInfo) { logError(`Agent ${name} is not found.`); return; } if (agentInfo.Status == AgentStatus.RUNNING) { logInfo(`Agent ${name} is running.`); return; } if (!agentInfo.ContainerID) { logInfo(`No docker container for agent ${name}.`); // TODO: create and start docker container for agent. } // console.log("ContainerID: ", agentInfo.ContainerID); try { const stdout = await exec(`docker start ${agentInfo.ContainerID}`); // console.log(stdout); logSuccess(`Agent ${name} is started successfully.`); } catch (e) { logError(`Start agent ${name} error ${e}`); } } // agentUID is a unique key to identify the agent // it is also used as the agent's docker container name const getAgentUID = (chain: string, agentID: string): string => { return `${chain}_${agentID}`; } export { createAgent, listAgents, stopAgent, startAgent, chatAgent, } ================================================ FILE: agent-cli/src/log.ts ================================================ // import chalk from 'chalk'; import chalk from 'chalk'; import Table from 'cli-table3'; import { AgentStatus } from './manager'; function getTimestamp() { return new Date().toLocaleTimeString(); } function logInfo(message: string): void { console.log(chalk.blue(`[${getTimestamp()}] [INFO] ${message}`)); } function logSuccess(message: string): void { console.log(chalk.green(`[${getTimestamp()}] [SUCCESS] ${message}`)); } function logError(message: string): void { console.log(chalk.red(`[${getTimestamp()}] [ERROR] ${message}`)); } function logWarning(message: string): void { console.log(chalk.yellow(`[${getTimestamp()}] [WARNING] ${message}`)); } // Function to log headers (e.g., for sections) in bold cyan function logHeader(message: string): void { console.log(chalk.cyan.bold(`[${getTimestamp()}] [HEADER] ${message}`)); } // Function to log a title with a line break for better readability function logTitle(message: string): void { console.log(chalk.bold.white(message)); console.log(chalk.white('-'.repeat(message.length))); // Creates a separator line } var HeaderMaps: Record = { "agentid": "agent id", "chainid": "chain id", "createat": "create at", "containerid": "container id", } // interface Agent { // AgentID: string // Name: string // NetworkName: string // ChainID: string // ModelID: string // } // interface Column { // header: string // width: number // } // const HeaderInfoMap: Record = { // "AgentID": { // header: "Agent ID", // width: 10 // }, // "Name": { // header: "Name", // width: 20 // }, // "AgentID": { // header: "Agent ID", // width: 10 // }, // "AgentID": { // header: "Agent ID", // width: 10 // }, // "AgentID": { // header: "Agent ID", // width: 10 // }, // } // Function to format and display a table function logTable(data: Array>): void { if (data.length === 0) { console.log(chalk.yellow('No data to display.')); return; } // Get the table headers from the keys of the first object const headers = Object.keys(data[0]); const newHeaders: string[] = []; headers.map((header, i) => { const newHeader = HeaderMaps[header.toLowerCase()] || header; // console.log(`newHeader : ${newHeader}`); newHeaders.push(newHeader); }) // console.log("headers: ", headers); // Calculate the width for each column (max length of header or data) const colWidths = headers.map((header, i) => Math.max(...data.map(item => item[header].toString().length), newHeaders[i].length) ); // console.log("colWidths: ", colWidths); // Create the table's horizontal border line const borderLine = `+${colWidths.map(width => '-'.repeat(width + 2)).join('+')}+`; // Create a function to format each row const formatRow = (row: any) => { return `| ${headers.map((header, index) => { let value = row[header] ?? ""; const valueLen = value.length; if (header.toLowerCase() == "status") { switch (value) { case AgentStatus.RUNNING: value = chalk.green(value); case AgentStatus.STOPPED: value = chalk.red(value); } } const padding = ' '.repeat(colWidths[index] - valueLen); return value + padding; }).join(' | ')} |`; }; // Function to format the header row with color const formatHeaderRow = (headers: string[]) => { return `| ${headers.map((header, index) => { const value = chalk.cyan.bold(header.toUpperCase()); // Use blue and bold for header const padding = ' '.repeat(colWidths[index] - header.length); // const padding = ""; return value + padding; }).join(' | ')} |`; }; // Create a new table instance with the headers // const table = new Table({ // head: headers.map(header => chalk.bold(header)), // Bold headers // colWidths: colWidths, // Set a default width for columns // style: { // head: ['bold', 'cyan'], // Style for the headers // border: ['grey'], // Style for the borders // } // }); // // Add each row of data to the table // data.forEach(row => { // const rowData = headers.map(header => { // let value = row[header] ?? ''; // console.log(`header ${header} - value ${value}`); // if (header.toLowerCase() == "status") { // console.log("Found status: ", value); // switch (value) { // case AgentStatus.RUNNING: // value = chalk.green(value); // console.log("green"); // case AgentStatus.STOPPED: // value = chalk.red(value); // console.log("red"); // } // } // return value // }); // table.push(rowData); // }); // Print the formatted table // console.log(table.toString()); console.log(borderLine); console.log(formatHeaderRow(newHeaders)); // Print header console.log(borderLine); data.forEach(row => console.log(formatRow(row))); console.log(borderLine); } export { logInfo, logSuccess, logError, logWarning, logHeader, logTitle, logTable, } ================================================ FILE: agent-cli/src/main.ts ================================================ import { Command } from 'commander'; import { Framework, Model, Network } from './const'; import { chatAgent, createAgent, listAgents, startAgent, stopAgent } from './handler'; import { getModels } from './model_handler'; // Initialize the commander object const program = new Command(); // Define the CLI command and its options program .name('eai') .description('You can deploy and manage your decentralized agents flexibly and simply - on any chain, any framework.') .version('1.0.0'); // Define a parent command: agent const agentCmd = program .command('agent') .description('Deploy and manage agents'); // cmd: agent create agentCmd .command('create') .description('Create a new agent') .option('-c, --chain ', 'The blockchain which the new agent will be deployed on.', Network.Base) .option('-f, --framework ', 'The framework is used for new agent.', Framework.EternalAI) .option('-m, --model ', 'The agent\'s model.') .requiredOption('-p, --path ', 'The path of the agent\'s character file.') .option('-n, --name ', 'The agent\'s name.') .action((options) => { createAgent(options); }); // cmd: agent ls agentCmd .command('ls') .description('See list of agents') .action(() => { listAgents(); }); // cmd: agent stop agentCmd .command('stop') .description('Stop the agent') .requiredOption('-n, --name ', 'The agent\'s name.') .action((options) => { stopAgent(options); }); // cmd: agent start agentCmd .command('start') .description('Start the agent') .requiredOption('-n, --name ', 'The agent\'s name.') .action((options) => { startAgent(options); }); // cmd: agent chat agentCmd .command('chat') .description('Chat to the agent') .requiredOption('-n, --name ', 'The agent\'s name.') .action((options) => { chatAgent(options); }); // Define a parent command: agent const modelCmd = program .command('model') .description('Get models\' info.'); modelCmd .command('ls') .description('List of supported models.') .requiredOption('-c, --chain ', '') .action((options) => { getModels(options); }); // Parse the command-line arguments program.parse(process.argv); ================================================ FILE: agent-cli/src/manager.ts ================================================ import * as fs from 'fs'; import path from 'path'; import { exec } from 'child_process'; import { logError, logInfo } from './log'; import { execCmd } from './utils'; enum AgentStatus { CREATED = "Created", // minted agent id on the contract, but haven't started agent container yet RUNNING = "Running", // agent container is running STOPPED = "Stopped", // agent container is exited } interface Agent { AgentID: string Name: string Framework: string Network: string ChainID: string Model: string Status: string CreateAt: string ContainerID: string, } const FilePath = "./agents/list.json"; const insertAgent = async (agent: Agent) => { try { // logInfo(`FilePath: ${FilePath}`); if (!fs.existsSync(FilePath)) { fs.writeFileSync(FilePath, JSON.stringify([agent], null, 2)) } else { const data = fs.readFileSync(FilePath, 'utf8'); const currentAgents: Agent[] = JSON.parse(data); currentAgents.push(agent); fs.writeFileSync(FilePath, JSON.stringify(currentAgents, null, 2)) } } catch (e) { logError(`Save agent info ${e}`); } } const getAgents = async (): Promise => { if (!fs.existsSync(FilePath)) { return []; } const data = fs.readFileSync(FilePath, 'utf8'); const currentAgents: Agent[] = JSON.parse(data); // console.log("currentAgents: ", currentAgents); const containers = await listRunningContainers(); // console.log("containers: ", containers); for (let i = 0; i < currentAgents.length; i++) { let agent = currentAgents[i]; const containerName = agent.Network + "_" + agent.AgentID; const containerInfo = containers[containerName]; if (containerInfo) { if (containerInfo.State === "running") { agent.Status = AgentStatus.RUNNING; } else if (containerInfo.State === "exited") { agent.Status = AgentStatus.STOPPED; } // TODO: check more state agent.CreateAt = containerInfo.CreatedAt; agent.ContainerID = containerInfo.ID; } currentAgents[i] = agent; } return currentAgents; } const getAgentByName = async (name: string): Promise => { const agents = await getAgents(); const agentMap = Object.fromEntries(agents.map((a: Agent) => [a.Name, a])); const agentInfo = agentMap[name]; return agentInfo; } const updateAgentByName = async (name: string, updatedAgent: Agent) => { const agents = await getAgents(); agents.map(agent => { agent.Name == name ? updatedAgent : agent }); try { fs.writeFileSync(FilePath, JSON.stringify(agents, null, 2)) } catch (e) { logError(`Update agent ${name} error ${e}`); } } interface DockerContainer { Command: string CreatedAt: string ID: string Image: string Labels: string LocalVolumes: string Mounts: string Names: string Networks: string Ports: string RunningFor: string Size: string State: string // running Status: string // time } // Running Containers: [ // { // Command: '"docker-entrypoint.s…"', // CreatedAt: '2025-02-13 16:18:33 +0700 +07', // ID: '2a04d8ee6843', // Image: 'eliza', // Labels: 'desktop.docker.io/binds/0/Source=/Users/macbookpro/go/src/eternalai-org/eternal-ai/agent-cli/agents/base_4/config.json,desktop.docker.io/binds/0/SourceKind=hostFile,desktop.docker.io/binds/0/Target=/app/eliza/agents/config.json', // LocalVolumes: '0', // Mounts: '/host_mnt/User…', // Names: 'base_4', // Networks: 'bridge', // Ports: '', // RunningFor: '31 seconds ago', // Size: '2.54MB (virtual 11.7GB)', // State: 'running', // Status: 'Up 30 seconds' // } // ] const listRunningContainers = async (): Promise> => { const stdout = await execCmd({ cmd: 'docker ps -a --format "{{json .}}"', isLog: false }); if (stdout.length == 0) { return {}; } // Split the output into JSON objects (one per line) const containers: DockerContainer[] = stdout .trim() .split('\n') .map((line: any) => JSON.parse(line)); const m = Object.fromEntries(containers.map((c: DockerContainer) => [c.Names, c])); return m; } export { Agent, insertAgent, getAgents, listRunningContainers, AgentStatus, getAgentByName, updateAgentByName, } ================================================ FILE: agent-cli/src/mintv1.ts ================================================ import { assert, ethers } from "ethers"; import { readFile } from "fs/promises"; import * as fs from "fs"; import * as path from "path"; import { logInfo } from "./log"; // interface NetworkConfig { // promptSchedulerAddress: string; // gpuManagerAddress: string; // } // interface Config { // [network: string]: NetworkConfig; // } // ABI for the mint function const agentAbi = [ // "function mint(address to,string calldata uri,bytes calldata data,uint256 fee,string calldata promptKey,address promptScheduler,uint32 modelId) external returns (uint256)", // "function mint(address to,string calldata uri,bytes calldata data,uint256 fee) external returns (uint256)", "function mint(address _to, string calldata _uri, bytes calldata _data, uint256 _fee) external payable returns (uint256)", "function mintPrice() external view returns (uint256)", ]; const gpuManagerAbi = [ "function getModelIds() external view returns (uint256[] memory)", ]; const mintAgent = async ({ rpcURL, privKey, agentSystemPrompPath, agentContractAddress, modelID, // promptSchedulerAddress, // gpuManagerAddress, agentURI = "EternalAIAgent", agentFee = "0", // agentPromptKey = "EternalAIAgent", }: { rpcURL: string, privKey: string, agentSystemPrompPath: string, agentContractAddress: string, modelID: string, // promptSchedulerAddress: string, // gpuManagerAddress: string, agentURI?: string, agentFee?: string, // agentPromptKey?: string, networkName?: string, }) => { // TODO: 2525 hard code to test // return 1925; // Get default config // const networkName = process.env.NETWORK_NAME; // assert( // networkName, // "Missing NETWORK_NAME environment variable", // "INVALID_ARGUMENT" // ); // const [df_promptSchedulerAddress, df_gpuManagerAddress] = // getNetworkAddresses(networkName); // Configuration // const rpcURL = process.env.RPC_URL; // const privKey = process.env.PRIVATE_KEY; // const agentContractAddress = process.env.AGENT_CONTRACT_ADDRESS; // const agentSystemPrompPath = process.env.AGENT_SYSTEM_PROMPT_PATH; // const agentURI = process.env.AGENT_URI || "EternalAIAgent"; // const agentFee = process.env.AGENT_FEE || "0"; // const agentPromptKey = process.env.AGENT_PROMPT_KEY || "EternalAIAgent"; // promptSchedulerAddress = promptSchedulerAddress || df_promptSchedulerAddress; // gpuManagerAddress = gpuManagerAddress || df_gpuManagerAddress; // const gpuManagerAddress = process.env.GPU_MANAGER_ADDRESS // ? process.env.GPU_MANAGER_ADDRESS // : df_gpuManagerAddress; // let modelID = process.env.MODEL_ID; assert(rpcURL, "Missing RPC_URL environment variable", "INVALID_ARGUMENT"); assert( privKey, "Missing PRIVATE_KEY environment variable", "INVALID_ARGUMENT" ); assert( agentContractAddress, "Missing AGENT_CONTRACT_ADDRESS environment variable", "INVALID_ARGUMENT" ); assert( agentSystemPrompPath, "Missing AGENT_SYSTEM_PROMPT_PATH environment variable", "INVALID_ARGUMENT" ); assert( agentURI, "Missing AGENT_URI environment variable", "INVALID_ARGUMENT" ); assert( agentFee, "Missing AGENT_FEE environment variable", "INVALID_ARGUMENT" ); // assert( // agentPromptKey, // "Missing AGENT_PROMPT_KEY environment variable", // "INVALID_ARGUMENT" // ); // assert( // promptSchedulerAddress, // "Missing PROMPT_SCHEDULER_ADDRESS environment variable", // "INVALID_ARGUMENT" // ); assert( modelID, "Missing modelID variable", "INVALID_ARGUMENT" ); // Setup provider and signer const provider = new ethers.JsonRpcProvider(rpcURL); const wallet = new ethers.Wallet(privKey, provider); // if (!modelID) { // assert( // gpuManagerAddress, // "Missing GPU_MANAGER_ADDRESS environment variable", // "INVALID_ARGUMENT" // ); // const gpuManager = new ethers.Contract( // gpuManagerAddress, // gpuManagerAbi, // wallet // ); // const modelIds = await gpuManager.getModelIds(); // console.log("Available models:", modelIds); // if (modelIds.length === 0) { // throw new Error("No models available"); // } // modelID = modelIds[0]; // } // Read system prompt from file let systemPrompt; try { systemPrompt = await readFile(agentSystemPrompPath, "utf8"); } catch (error) { throw new Error(`Failed to read system prompt file: ${error}`); } // console.log("systemPrompt: ", systemPrompt); // logInfo(`Mint agent params: ${{ // rpcURL, // privKey, // agentSystemPrompPath, // agentContractAddress, // modelID, // // promptSchedulerAddress, // // gpuManagerAddress, // agentURI, // agentFee, // // agentPromptKey = "EternalAIAgent", // }}`) // logInfo(`rpcURL: ${rpcURL}`); // logInfo(`agentSystemPrompPath: ${agentSystemPrompPath}`); // logInfo(`agentContractAddress: ${agentContractAddress}`); // logInfo(`modelID: ${modelID}`); // logInfo(`agentURI: ${agentURI}`); // logInfo(`agentFee: ${agentFee}`); try { // Create contract instance const contract = new ethers.Contract( agentContractAddress, agentAbi, wallet ); // Mint parameters const to = wallet.address; // mint to self const uri = agentURI.toString(); const data = ethers.toUtf8Bytes(systemPrompt.toString()); // Convert string to bytes const fee = ethers.parseEther(agentFee); // Set agent usage fee // const mintPrice = await contract.mintPrice(); // Get mint price // const promptKey = agentPromptKey.toString(); // const promptSchedulerAddress = promptSchedulerAddress.toString(); const modelId = modelID; // console.log("Mint price: ", mintPrice); // logInfo(`data: ${data}`); // Call mint function const tx = await contract.mint( to, uri, data, 0, ); const receipt = await tx.wait(); if (receipt?.status === 1) { console.log("Minting transaction sent:", receipt.hash); console.log("Transaction confirmed in block:", receipt.blockNumber); // Get minted token ID from events const event = receipt.logs?.find((e: ethers.Log) => { return ( e.topics[0] === ethers.id("NewToken(uint256,string,bytes,uint256,address)") ); }); if (event) { console.log("Minted Agent ID:", Number(event.topics[1])); return Number(event.topics[1]); } } else { console.error("Minting transaction failed:", receipt); } } catch (error) { console.error("Error minting agent:", error); } } // Execute // mintAgent().catch(console.error); export { mintAgent, } ================================================ FILE: agent-cli/src/mintv2.ts ================================================ import { assert, ethers } from "ethers"; import { readFile } from "fs/promises"; import * as fs from "fs"; import * as path from "path"; interface NetworkConfig { promptSchedulerAddress: string; gpuManagerAddress: string; } interface Config { [network: string]: NetworkConfig; } // ABI for the mint function const agentAbi = [ "function mint(address to,string calldata uri,bytes calldata data,uint256 fee,string calldata promptKey,address promptScheduler,uint32 modelId) external returns (uint256)", "function mintPrice() external view returns (uint256)", ]; const gpuManagerAbi = [ "function getModelIds() external view returns (uint256[] memory)", ]; const mintAgent = async ({ rpcURL, privKey, agentSystemPrompPath, agentContractAddress, promptSchedulerAddress, gpuManagerAddress, agentURI = "EternalAIAgent", agentFee = "0", agentPromptKey = "EternalAIAgent", modelID }: { rpcURL: string, privKey: string, agentSystemPrompPath: string, agentContractAddress: string, promptSchedulerAddress: string, gpuManagerAddress: string, agentURI?: string, agentFee?: string, agentPromptKey?: string, modelID?: string, networkName?: string, }) => { // TODO: 2525 hard code to test // return 4; // Get default config // const networkName = process.env.NETWORK_NAME; // assert( // networkName, // "Missing NETWORK_NAME environment variable", // "INVALID_ARGUMENT" // ); // const [df_promptSchedulerAddress, df_gpuManagerAddress] = // getNetworkAddresses(networkName); // Configuration // const rpcURL = process.env.RPC_URL; // const privKey = process.env.PRIVATE_KEY; // const agentContractAddress = process.env.AGENT_CONTRACT_ADDRESS; // const agentSystemPrompPath = process.env.AGENT_SYSTEM_PROMPT_PATH; // const agentURI = process.env.AGENT_URI || "EternalAIAgent"; // const agentFee = process.env.AGENT_FEE || "0"; // const agentPromptKey = process.env.AGENT_PROMPT_KEY || "EternalAIAgent"; // promptSchedulerAddress = promptSchedulerAddress || df_promptSchedulerAddress; // gpuManagerAddress = gpuManagerAddress || df_gpuManagerAddress; // const gpuManagerAddress = process.env.GPU_MANAGER_ADDRESS // ? process.env.GPU_MANAGER_ADDRESS // : df_gpuManagerAddress; // let modelID = process.env.MODEL_ID; assert(rpcURL, "Missing RPC_URL environment variable", "INVALID_ARGUMENT"); assert( privKey, "Missing PRIVATE_KEY environment variable", "INVALID_ARGUMENT" ); assert( agentContractAddress, "Missing AGENT_CONTRACT_ADDRESS environment variable", "INVALID_ARGUMENT" ); assert( agentSystemPrompPath, "Missing AGENT_SYSTEM_PROMPT_PATH environment variable", "INVALID_ARGUMENT" ); assert( agentURI, "Missing AGENT_URI environment variable", "INVALID_ARGUMENT" ); assert( agentFee, "Missing AGENT_FEE environment variable", "INVALID_ARGUMENT" ); assert( agentPromptKey, "Missing AGENT_PROMPT_KEY environment variable", "INVALID_ARGUMENT" ); assert( promptSchedulerAddress, "Missing PROMPT_SCHEDULER_ADDRESS environment variable", "INVALID_ARGUMENT" ); // Setup provider and signer const provider = new ethers.JsonRpcProvider(rpcURL); const wallet = new ethers.Wallet(privKey, provider); if (!modelID) { assert( gpuManagerAddress, "Missing GPU_MANAGER_ADDRESS environment variable", "INVALID_ARGUMENT" ); const gpuManager = new ethers.Contract( gpuManagerAddress, gpuManagerAbi, wallet ); const modelIds = await gpuManager.getModelIds(); console.log("Available models:", modelIds); if (modelIds.length === 0) { throw new Error("No models available"); } modelID = modelIds[0]; } // Read system prompt from file let systemPrompt; try { systemPrompt = await readFile(agentSystemPrompPath, "utf8"); } catch (error) { throw new Error(`Failed to read system prompt file: ${error}`); } // console.log("systemPrompt: ", systemPrompt); try { // Create contract instance const contract = new ethers.Contract( agentContractAddress, agentAbi, wallet ); // Mint parameters const to = wallet.address; // mint to self const uri = agentURI.toString(); const data = ethers.toUtf8Bytes(systemPrompt.toString()); // Convert string to bytes const fee = ethers.parseEther(agentFee); // Set agent usage fee const mintPrice = await contract.mintPrice(); // Get mint price const promptKey = agentPromptKey.toString(); // const promptSchedulerAddress = promptSchedulerAddress.toString(); const modelId = modelID; console.log("Mint price: ", mintPrice); // Call mint function const tx = await contract.mint( to, uri, data, fee, promptKey, promptSchedulerAddress, modelId, { value: mintPrice, // Send required mint price } ); const receipt = await tx.wait(); if (receipt?.status === 1) { console.log("Minting transaction sent:", receipt.hash); console.log("Transaction confirmed in block:", receipt.blockNumber); // Get minted token ID from events const event = receipt.logs?.find((e: ethers.Log) => { return ( e.topics[0] === ethers.id("NewToken(uint256,string,bytes,uint256,address)") ); }); if (event) { console.log("Minted Agent ID:", Number(event.topics[1])); return Number(event.topics[1]); } } else { console.error("Minting transaction failed:", receipt); } } catch (error) { console.error("Error minting agent:", error); } } function getNetworkAddresses(networkName: string): [string, string] { try { // Read config file const configPath = path.resolve(__dirname, "./config.json"); const configData = fs.readFileSync(configPath, "utf8"); const config: Config = JSON.parse(configData); // Get network specific config const networkConfig = config[networkName]; if (!networkConfig) { throw new Error(`Network ${networkName} not found in config`); } return [ networkConfig.promptSchedulerAddress, networkConfig.gpuManagerAddress, ]; } catch (error) { throw new Error(`Failed to load config: ${error}`); } } // Execute // mintAgent().catch(console.error); export { mintAgent, } ================================================ FILE: agent-cli/src/model_handler.ts ================================================ import { ChainIDMap, Network } from "./const"; import { logInfo } from "./log"; import { getSupportedModels } from "./utils"; const getModels = async (chain: Network) => { const chainID = ChainIDMap[chain]; if (!chainID) { } const supportedModels = await getSupportedModels(chainID); logInfo(`List of supported chains: ${Object.keys(supportedModels)}`); } export { getModels } ================================================ FILE: agent-cli/src/rig/Dockerfile ================================================ # Use the official Rust image FROM rust:1.75 AS builder # Ensure Cargo is up-to-date RUN rustup update stable && rustup default stable WORKDIR /app # Step 1: Get Rig code RUN git clone https://github.com/0xPlaygrounds/rig.git # Step 2: Update model, chain ID in file agent_with_eternalai.rs COPY . . COPY agent_with_eternalai.rs /app/rig/rig-eternalai/examples/agent_with_eternalai.rs # Change the working directory to the desired folder WORKDIR /app/rig # Build your Rig agent RUN cargo update CMD ["sh", "-c", "cargo run --package rig-eternalai --example agent_with_eternalai"] ================================================ FILE: agent-cli/src/rig/agent_with_eternalai.rs ================================================ use rig::agent::AgentBuilder; use rig::completion::Prompt; use rig_eternalai::providers::eternalai::{ Client, CompletionModel, }; #[tokio::main] async fn main() -> Result<(), anyhow::Error> { tracing_subscriber::fmt() .with_max_level(tracing::Level::DEBUG) .init(); println!("Running basic agent with eternalai"); basic_eternalai().await?; println!("\nRunning eternalai agent with context"); context_eternalai().await?; println!("\n\nAll agents ran successfully"); Ok(()) } fn client() -> Client { Client::from_env() } fn partial_agent_eternalai() -> AgentBuilder { let client = client(); client.agent( std::env::var("ETERNALAI_MODEL"), // Option::from("45762"), None, ) } async fn basic_eternalai() -> Result<(), anyhow::Error> { let comedian_agent = partial_agent_eternalai() .preamble("You are a comedian here to entertain the user using humour and jokes.") .build(); // Prompt the agent and print the response let response = comedian_agent.prompt("Entertain me!").await?; println!("{}", response); Ok(()) } async fn context_eternalai() -> Result<(), anyhow::Error> { let model = client().completion_model( std::env::var("ETERNALAI_MODEL"), std::env::var("ETERNALAI_CHAIN_ID"), // None, ); // Create an agent with multiple context documents let agent = AgentBuilder::new(model) .context("Definition of a *flurbo*: A flurbo is a green alien that lives on cold planets") .context("Definition of a *glarb-glarb*: A glarb-glarb is a ancient tool used by the ancestors of the inhabitants of planet Jiro to farm the land.") .context("Definition of a *linglingdong*: A term used by inhabitants of the far side of the moon to describe humans.") .build(); // Prompt the agent and print the response let response = agent.prompt("What does \"glarb-glarb\" mean?").await?; println!("{}", response); Ok(()) } ================================================ FILE: agent-cli/src/rig/start.sh ================================================ #!/bin/bash echo "Starting new agent with Rig framework" agent_uid=$1 ETERNALAI_URL=$2 ETERNALAI_API_KEY=$3 ETERNALAI_CHAIN_ID=$4 ETERNALAI_RPC_URL=$5 ETERNALAI_AGENT_CONTRACT_ADDRESS=$6 ETERNALAI_AGENT_ID=$7 ETERNALAI_MODEL=$8 TWITTER_USERNAME=$9 TWITTER_PASSWORD=${10} TWITTER_EMAIL=${11} TWITTER_TARGET_USERS=${12} AGENT_NAME=${13} echo "Agent UID: $agent_uid" current_dir=$(pwd) ### make specific folder for new agent cd agents mkdir $agent_uid cd $agent_uid ### create .env env_file_name=".env_$agent_uid" echo env_file_name # Check if the file already exists if [ -f "$env_file_name" ]; then echo "$env_file_name already exists. Don't start existing agent again." exit 0 else echo "$env_file_name does not exist. Creating it." fi # custom env cat < "$env_file_name" ETERNALAI_API_KEY=$ETERNALAI_API_KEY ETERNALAI_URL=$ETERNALAI_URL ETERNALAI_CHAIN_ID=$ETERNALAI_CHAIN_ID ETERNALAI_RPC_URL=$ETERNALAI_RPC_URL ETERNALAI_AGENT_CONTRACT_ADDRESS=$ETERNALAI_AGENT_CONTRACT_ADDRESS AGENT_SYSTEM_PROMPT_PATH=config.json ETERNALAI_AGENT_ID=$ETERNALAI_AGENT_ID ETERNALAI_MODEL=$ETERNALAI_MODEL TWITTER_USERNAME=$TWITTER_USERNAME TWITTER_PASSWORD=$TWITTER_PASSWORD TWITTER_EMAIL=$TWITTER_EMAIL ACTION_INTERVAL=1 ENABLE_ACTION_PROCESSING=true MAX_ACTIONS_PROCESSING=2 ACTION_TIMELINE_TYPE=following TWITTER_TARGET_USERS=$TWITTER_TARGET_USERS EOL ### docker run to start agent docker run -d --env-file $env_file_name --name $agent_uid rig ================================================ FILE: agent-cli/src/utils.ts ================================================ import { ETERNALAI_URL } from "./const"; import axios from 'axios'; import { exec } from 'child_process'; const getSupportedModels = async (chainID: string) => { const url = "https://api.eternalai.org/api/chain-config/get"; const response = await axios.get(url, { params: { chain_id: chainID } }); // console.log('Filtered API Data:', response.data); if (response.data.status != 1) { throw new Error("get supported models status invalid"); } return response.data.data?.support_model_names; } const execCmd = async ({ cmd, isLog = true, }: { cmd: string, isLog?: boolean, }): Promise => { return new Promise((resolve, reject) => { exec(cmd, (error, stdout, stderr) => { if (error) { console.error(`Exec script ${cmd} error: ${error.message}`); reject(error); } if (stderr) { console.error(`Exec script ${cmd} stderr: ${stderr}`); reject(stderr); } if (isLog) { console.log(stdout); } resolve(stdout); }); }) } const padWithPrefix = (s: string, prefix: string, length: number): string => { // If the string is already longer than or equal to the desired length, return it as is if (s.length >= length) { return s; } // Calculate how many times to repeat the prefix const paddingLength = length - s.length; const repeatedPrefix = prefix.repeat(Math.ceil(paddingLength / prefix.length)); // Pad the string with the repeated prefix and trim to the fixed length return (repeatedPrefix + s).slice(0, length); } export { getSupportedModels, execCmd, padWithPrefix, } ================================================ FILE: agent-cli/tsconfig.json ================================================ // { // "compilerOptions": { // "target": "ES6", // "module": "CommonJS", // "strict": true, // "esModuleInterop": true, // "moduleResolution": "node", // "skipLibCheck": true, // "forceConsistentCasingInFileNames": true, // "rootDir": "./src", // "outDir": "./dist", // }, // "include": [ // "src/**/*" // ], // "exclude": [ // "node_modules" // ] // } { "compilerOptions": { "target": "es2020", "module": "CommonJS", "moduleResolution": "Node", "strict": true, "esModuleInterop": true, "forceConsistentCasingInFileNames": true, "resolveJsonModule": true, "skipLibCheck": true, "declaration": true, "outDir": "dist", "allowSyntheticDefaultImports": true }, "include": [ "src" ] } ================================================ FILE: agent-cli/tsup.config.ts ================================================ import { defineConfig } from "tsup"; export default defineConfig({ entry: ["src/main.ts"], outDir: "dist", sourcemap: true, clean: true, format: ["esm"], // Ensure you're targeting CommonJS external: [ "dotenv", // Externalize dotenv to prevent bundling "fs", // Externalize fs to use Node.js built-in module "path", // Externalize other built-ins if necessary "chalk", // Add other modules you want to externalize ], }); ================================================ FILE: agent-launcher/.eslintrc.cjs ================================================ module.exports = { root: true, env: { browser: true, es2020: true }, extends: [ "eslint:recommended", "plugin:@typescript-eslint/recommended", "plugin:react-hooks/recommended", ], ignorePatterns: ["dist", ".eslintrc.cjs"], parser: "@typescript-eslint/parser", plugins: ["react-refresh"], rules: { "react-refresh/only-export-components": [ "warn", { allowConstantExport: true }, ], "no-unused-vars": [ "warn", { allowConstantExport: true, varsIgnorePattern: "^_" }, ], }, }; ================================================ FILE: agent-launcher/.gitignore ================================================ # Logs logs *.log npm-debug.log* yarn-debug.log* yarn-error.log* pnpm-debug.log* lerna-debug.log* node_modules dist dist-ssr dist-electron release/* *.local # Editor directories and files .vscode/* !.vscode/extensions.json .idea .DS_Store *.suo *.ntvs* *.njsproj *.sln *.sw? ================================================ FILE: agent-launcher/README.md ================================================ # Agent Launcher ================================================ FILE: agent-launcher/crypto-agents/README.md ================================================ # CryptoAgent Examples 🤖 Welcome to the Crypto Agent AI Agent Examples repository! This collection showcases how to build and integrate AI agents with Crypto Agent Desktop Apps using various programming languages. ## 📚 Table of Contents - [Introduction](#introduction) - [Available Agents](#available-agents) - [Getting Started](#getting-started) - [Contributing](#contributing) ## Introduction CryptoAgent is a powerful framework for building AI agents that can be integrated with CryptoAgent Desktop Apps. These agents can perform various tasks, from social media interactions to complex data processing, all while maintaining secure authentication and robust error handling. ## Available Agents ### Current Agents #### Twitter Infrastructure Agent - Location: `./js/twitter-infra/` - Description: A TypeScript-based agent for Twitter integration - Features: - Secure authentication using Ethereum wallet signatures - Twitter API integration through Eternal AI platform - Message processing and response handling - Error handling and logging - [View Example](./js/twitter-infra/README.md) ### Future Agents (Coming Soon) ## 🚀 Getting Started Each example demonstrates different capabilities of AI agents that can be integrated with CryptoAgent Desktop Apps. Choose your preferred example and follow the setup instructions in the respective directory. ### Prerequisites - CryptoAgent Desktop App installed - Node.js (for JavaScript/TypeScript examples) - Python 3.x (for Python examples) ## 🤝 Contributing We welcome contributions! Please feel free to: 1. Submit a Pull Request with your examples 2. Suggest new agent ideas 3. Improve existing agents 4. Add documentation or tests ## 📝 License This project is licensed under the MIT License - see the LICENSE file for details. ================================================ FILE: agent-launcher/crypto-agents/js/twitter-dm/.dockerignore ================================================ # Dependencies node_modules npm-debug.log yarn-debug.log yarn-error.log # Build output dist # Environment files .env .env.* !.env.example # Version control .git .gitignore # IDE .vscode .idea # OS .DS_Store Thumbs.db # Test files **/*.test.ts **/*.spec.ts coverage # Documentation README.md LICENSE ================================================ FILE: agent-launcher/crypto-agents/js/twitter-dm/.gitignore ================================================ # Logs logs *.log npm-debug.log* yarn-debug.log* yarn-error.log* pnpm-debug.log* lerna-debug.log* node_modules dist dist-ssr dist-electron release/* *.local # Editor directories and files .vscode/* !.vscode/extensions.json .idea .DS_Store *.suo *.ntvs* *.njsproj *.sln *.sw? **/data/requests/ .env /configBuild/AuthKey_58T29H46WS.p8 /configBuild/Certificates.p12 /configBuild/entitlements.mas.plist /configBuild/vibeApps.provisionprofile ================================================ FILE: agent-launcher/crypto-agents/js/twitter-dm/Dockerfile ================================================ FROM node:22-alpine # Set environment variables ENV PORT=80 ENV NODE_ENV=production # Set working directory WORKDIR /app # Copy package files COPY package*.json ./ # Install dependencies including TypeScript globally RUN npm i && npm install -g typescript # Copy source code COPY . . # Build TypeScript RUN npm run build # Start the application CMD ["npm", "start"] ================================================ FILE: agent-launcher/crypto-agents/js/twitter-dm/README.md ================================================ # TypeScript Node.js API with Express A modern, well-structured TypeScript Node.js API using Express with best practices. ## Features - TypeScript support - Express.js framework - Environment configuration - Error handling middleware - Logging with Winston - Security with Helmet - CORS support - Health check endpoint - Development and production configurations ## Project Structure ``` src/ ├── middleware/ # Express middleware ├── routes/ # API routes ├── utils/ # Utility functions └── server.ts # Main application file ``` ## Getting Started 1. Install dependencies: ```bash npm install ``` 2. Create a `.env` file in the root directory with the following variables: ``` PORT=3000 NODE_ENV=development LOG_LEVEL=debug ``` 3. Start the development server: ```bash npm run dev ``` 4. Build for production: ```bash npm run build ``` 5. Start production server: ```bash npm start ``` ## Available Scripts - `npm run dev` - Start development server with hot reload - `npm run build` - Build TypeScript to JavaScript - `npm start` - Start production server - `npm test` - Run tests - `npm run lint` - Run ESLint - `npm run format` - Format code with Prettier ## API Endpoints - `GET /health` - Health check endpoint ## Development The project uses: - TypeScript for type safety - ESLint for code linting - Prettier for code formatting - Jest for testing - Winston for logging - Helmet for security - CORS for cross-origin requests ================================================ FILE: agent-launcher/crypto-agents/js/twitter-dm/docker-compose.yml ================================================ version: '3.8' services: app: build: context: . dockerfile: Dockerfile ports: - "3000:80" environment: - NODE_ENV=production - PORT=80 - LOG_LEVEL=info restart: unless-stopped extra_hosts: - "localmodel:host-gateway" ================================================ FILE: agent-launcher/crypto-agents/js/twitter-dm/package.json ================================================ { "name": "twitter-dm", "version": "1.0.0", "description": "TypeScript Node.js API with Express", "main": "dist/server.js", "scripts": { "start": "node dist/server.js", "dev": "nodemon src/server.ts", "build": "tsc", "test": "jest", "lint": "eslint . --ext .ts", "format": "prettier --write \"src/**/*.ts\"", "build-docker": "docker build -t test ." }, "dependencies": { "agent-server-definition": "^0.1.49", "axios": "^1.6.7", "cors": "^2.8.5", "dotenv": "^16.4.5", "ethers": "5.7.2", "express": "^4.21.2", "helmet": "^7.1.0", "morgan": "^1.10.0", "winston": "^3.11.0" }, "devDependencies": { "@types/cors": "^2.8.17", "@types/express": "^4.17.21", "@types/jest": "^29.5.12", "@types/morgan": "^1.9.9", "@types/node": "^20.11.24", "@typescript-eslint/eslint-plugin": "^7.1.1", "@typescript-eslint/parser": "^7.1.1", "eslint": "^8.57.0", "jest": "^29.7.0", "nodemon": "^3.1.0", "prettier": "^3.2.5", "ts-jest": "^29.1.2", "ts-node": "^10.9.2", "typescript": "^5.3.3" } } ================================================ FILE: agent-launcher/crypto-agents/js/twitter-dm/src/prompt/index.ts ================================================ import { ChatRequest, ChatResponse, DirectMessageObj, DirectUnreadMessagesResponse } from "@/types/chat"; import { PromptPayload } from "agent-server-definition"; import { ethers } from "ethers"; import { logger } from '../utils/logger'; import axios, { AxiosResponse } from "axios"; const sendMessage = async (request: ChatRequest): Promise => { try { const response: AxiosResponse = await axios.post( process.env.NODE_ENV === 'production' ? 'http://localmodel:65534/v1/chat/completions' : 'http://localhost:65534/v1/chat/completions', request, { headers: { 'Accept': 'application/json', 'Content-Type': 'application/json', } } ); return response.data; } catch (error) { logger.error('Error sending chat message:', error); throw new Error('Failed to send chat message'); } } export const getAuthHeaders = async (request: PromptPayload) => { if (request.privateKey != null && request.privateKey != '') { const wallet = new ethers.Wallet(request.privateKey || ''); const address = wallet.address; const timestamp = Math.floor(Date.now() / 1000).toString(); const signature = await wallet.signMessage(timestamp); return { 'Content-Type': 'application/json', 'XXX-Address': address, 'XXX-Message': timestamp, 'XXX-Signature': signature, } } return {}; } export const getNotificationMessage = async (request: PromptPayload): Promise => { try { var authUsername = '' if (request.privateKey != null && request.privateKey != '') { const headers = await getAuthHeaders(request); const response = await axios.get( process.env.NODE_ENV === 'production' ? 'https://agent.api.eternalai.org/api/utility/twitter/auth' : 'http://localhost:8480/api/utility/twitter/auth', { headers: headers, } ); if (response.status !== 200) { throw new Error('Failed to authenticate'); } const authUrl = response.data.result.auth_url as string; if (authUrl != null && authUrl != '') { return authUrl; } authUsername = response.data.result.username as string; } const unreadMessages = await getDirectUnreadMessages(request); if (unreadMessages == null || unreadMessages.length === 0) { return 'No unread messages' } const prompt = ` I am ${authUsername}, a twitter user. This is the conversation history with json content: ${JSON.stringify(request.messages)} This is the direct messages from X with json content: ${JSON.stringify(unreadMessages)} Based on the conversation history and the direct messages from X, summarize the direct messages from X in the same language, grouping them by dm_conversation_id. If the direct message is summarized in the conversation history, it will be ignored. If there is nothing to summarize, reply "No unread messages". If there is something to summarize, ask the user if they want to auto-reply to these users with suggested responses. `.trim(); console.log('prompt', prompt); const response = await sendMessage({ messages: [{ role: 'user', content: prompt }], stream: false }); const content = response.choices[0].message.content; return content; } catch (error) { logger.error('Error sending prompt:', error); throw new Error('Failed to send prompt'); } } export const sendPrompt = async (request: PromptPayload): Promise => { try { var authUsername = '' if (request.privateKey != null && request.privateKey != '') { const headers = await getAuthHeaders(request); const response = await axios.get( process.env.NODE_ENV === 'production' ? 'https://agent.api.eternalai.org/api/utility/twitter/auth' : 'http://localhost:8480/api/utility/twitter/auth', { headers: headers, } ); if (response.status !== 200) { throw new Error('Failed to authenticate'); } const authUrl = response.data.result.auth_url as string; if (authUrl != null && authUrl != '') { return authUrl; } authUsername = response.data.result.username as string; } const lastMessage = request.messages[request.messages.length - 1]; if (lastMessage.role === 'user' && lastMessage.content == '.') { const unreadMessages = await getDirectUnreadMessages(request); if (unreadMessages == null || unreadMessages.length === 0) { return 'No unread messages' } const prompt = ` I am ${authUsername}, a twitter user. This is the conversation history with json content: ${JSON.stringify(request.messages)} This is the direct messages from X with json content: ${JSON.stringify(unreadMessages)} Based on the conversation history and the direct messages from X, summarize the direct messages from X in the same language, grouping them by dm_conversation_id. If the direct message is summarized in the conversation history, it will be ignored. If there is nothing to summarize, reply "No unread messages". If there is something to summarize, ask the user if they want to auto-reply to these users with suggested responses. `.trim(); console.log('prompt', prompt); const response = await sendMessage({ messages: [{ role: 'user', content: prompt }], stream: false }); const content = response.choices[0].message.content; return content; } // handle the case that the last message const prompt = ` The conversation history is a conversation between you and the user. You are assistant of the user. You will help the user to get unread messages from X and summarize them (summarize in the conversation history). Then user will reply to you to auto-reply to some users or not. Sometime user reply somthing for purpose of other things. This is the conversation history with json content: ${JSON.stringify(request.messages)} User's X username is ${authUsername || 'anonymous'}. Based on the conversation history, analyze the user's intent in the last message: Do they want to auto-reply to some users? If yes, set json field "auto_reply" to true and provide suggested replies in "replies". If auto-reply is true, suggest one reply per recipient in "replies", reply content should be in the same language as the last message from you that summarized the direct messages, and provide a summary in "reply_summary" that describes what replies will be sent. Reply content for direct messages should be in the same tone and personality as the conversation. If auto-reply is false, provide a relevant response about the conversation in "related_content". Response in json format: { "auto_reply": true, "replies": [ { "dm_conversation_id": "dm_conversation_id", "username": "username", "reply": "reply_content" } ], "reply_summary": "reply_summary_content", "related_content": "related_content" } `.trim(); console.log('prompt', prompt); const response = await sendMessage({ messages: [{ role: 'user', content: prompt }], stream: false }); var reponse = ''; let content = response.choices[0].message.content; if (content.startsWith('```json')) { content = content.slice(7, -3); } if (content.endsWith('```')) { content = content.slice(0, -1); } console.log('content', content); const replyObject = JSON.parse(content); if (replyObject.auto_reply) { for (const reply of replyObject.replies) { try { await sendDirectMessage(request, reply.dm_conversation_id, reply.username, reply.reply); } catch (error) { logger.error('Error sending direct message:', error); } } reponse = replyObject.reply_summary; } else { reponse = replyObject.related_content; } return reponse; } catch (error) { logger.error('Error sending prompt:', error); throw new Error('Failed to send prompt'); } } const getDirectUnreadMessages = async (request: PromptPayload): Promise => { const headers = await getAuthHeaders(request); const response = await axios.get( process.env.NODE_ENV === 'production' ? 'https://agent.api.eternalai.org/api/utility/twitter/dm' : 'http://localhost:8480/api/utility/twitter/dm', { headers: headers, } ); if (response.status !== 200) { throw new Error('Failed to authenticate'); } console.log('getDirectUnreadMessages', response.data.result.data); return response.data.result.data; } const sendDirectMessage = async (request: PromptPayload, dm_conversation_id: string, username: string, content: string): Promise => { const headers = await getAuthHeaders(request); console.log('sendDirectMessage', { dm_conversation_id: dm_conversation_id, recipient_username: username, content: content, }); //get conversation chat history const resp = await axios.get( process.env.NODE_ENV === 'production' ? `https://agent.api.eternalai.org/api/utility/twitter/dm/byid/${dm_conversation_id}` : `http://localhost:8480/api/utility/twitter/dm/byid/${dm_conversation_id}`, { headers: headers, } ); const prompt = ` Based on the chat conversation history, please analyze and respond to the user while maintaining: 1. The same tone, style and personality shown in the previous messages 2. The same language used in the conversation 3. Consistency with the context and flow of the discussion Please provide a response that: - Matches the formality level of previous exchanges - Uses similar vocabulary and expressions - Maintains the established rapport and conversation style - Stays relevant to the ongoing discussion topic If the conversation history shows specific patterns (casual, formal, technical, friendly, etc.), please reflect those in your response. ${JSON.stringify(resp.data.result.data)} `; console.log('prompt', prompt); const response = await sendMessage({ messages: [{ role: 'user', content: prompt }], stream: false }); var reponse = ''; content = response.choices[0].message.content; if (content.startsWith('```json')) { content = content.slice(7, -3); } if (content.endsWith('```')) { content = content.slice(0, -1); } console.log('sendDirectMessage', { recipient_username: username, content: content, dm_conversation_id: dm_conversation_id, dm_conversation_data: resp.data.result.data, }); // await axios.post( // process.env.NODE_ENV === 'production' ? 'https://agent.api.eternalai.org/api/utility/twitter/dm/reply' : 'http://localhost:8480/api/utility/twitter/dm/reply', // { // recipient_username: username, // content: content, // }, // { // headers: headers, // } // ); } ================================================ FILE: agent-launcher/crypto-agents/js/twitter-dm/src/server.ts ================================================ import express from 'express'; import { getNotificationMessage, sendPrompt } from './prompt'; const app = express(); const port = process.env.PORT || 3000; // Middleware to parse JSON bodies app.use(express.json()); // Route for handling prompts app.post('/prompt', async (req, res) => { try { const result = await sendPrompt(req.body); res.status(200).json(result); } catch (error) { res.status(500).json({ error: 'Failed to process prompt' }); } }); // Route for handling notifications app.post('/notification', async (req, res) => { try { // Handle notification logic here const result = await getNotificationMessage(req.body); res.status(200).json(result); } catch (error) { res.status(500).json({ error: 'Failed to process notification' }); } }); // Start the server app.listen(port, () => { console.log(`Server is running on port ${port}`); }); ================================================ FILE: agent-launcher/crypto-agents/js/twitter-dm/src/types/chat.ts ================================================ export interface ChatMessage { role: 'user' | 'assistant'; content: string; } export interface ChatRequest { messages: ChatMessage[]; stream: boolean; seed?: number; name?: string; description?: string; } export interface PromptRequest { id: string; messages: ChatMessage[]; stream: boolean; seed?: number; chainId?: number; name?: string; description?: string; privateKey?: string; } export interface ChatResponse { id: string; object: string; created: number; model: string; service_tier: string; system_fingerprint: string; choices: { index: number; message: { role: string; content: string; refusal: null | string; }; logprobs: null; finish_reason: null | string; }[]; } export interface DirectUnreadMessagesResponse { username: string; message: string; } export interface DirectMessageObj { id: string; text: string; event_type: string; created_at: Date; sender_id: string; sender_username: string; recipient_id: string; conversation_id: string; referenced_tweet?: { id: string; }; message?: string; } export interface DirectMessageResponse { data: DirectMessageObj[]; } ================================================ FILE: agent-launcher/crypto-agents/js/twitter-dm/src/utils/logger.ts ================================================ import winston from 'winston'; const logger = winston.createLogger({ level: process.env.LOG_LEVEL || 'info', format: winston.format.combine( winston.format.timestamp(), winston.format.json() ), transports: [ new winston.transports.Console({ format: winston.format.combine( winston.format.colorize(), winston.format.simple() ), }), ], }); export { logger }; ================================================ FILE: agent-launcher/crypto-agents/js/twitter-dm/tsconfig.json ================================================ { "compilerOptions": { "target": "ES2020", "module": "commonjs", "lib": ["ES2020"], "outDir": "./dist", "rootDir": "./src", "strict": true, "esModuleInterop": true, "skipLibCheck": true, "forceConsistentCasingInFileNames": true, "moduleResolution": "node", "resolveJsonModule": true, "baseUrl": ".", "paths": { "@/*": ["src/*"] } }, "include": ["src/**/*"], "exclude": ["node_modules", "dist", "**/*.test.ts"] } ================================================ FILE: agent-launcher/crypto-agents/js/twitter-infra/.gitignore ================================================ # Logs logs *.log npm-debug.log* yarn-debug.log* yarn-error.log* pnpm-debug.log* lerna-debug.log* node_modules dist dist-ssr dist-electron release/* *.local # Editor directories and files .vscode/* !.vscode/extensions.json .idea .DS_Store *.suo *.ntvs* *.njsproj *.sln *.sw? **/data/requests/ .env /configBuild/AuthKey_58T29H46WS.p8 /configBuild/Certificates.p12 /configBuild/entitlements.mas.plist /configBuild/vibeApps.provisionprofile ================================================ FILE: agent-launcher/crypto-agents/js/twitter-infra/Dockerfile ================================================ FROM node:22-alpine WORKDIR /app COPY ./package.json /app/package.json COPY ./ /app/ RUN yarn CMD ["yarn", "start"] ================================================ FILE: agent-launcher/crypto-agents/js/twitter-infra/README.md ================================================ # Twitter Infrastructure Agent A TypeScript-based AI agent that integrates with Twitter's infrastructure through the Eternal AI platform. This agent handles Twitter operations with secure authentication and message processing. ## 📋 Features - Secure authentication using Ethereum wallet signatures - Twitter post integration through Eternal AI API - TypeScript-based implementation - Error handling and logging - Environment-based configuration ## 🛠️ Setup 1. Install dependencies: ```bash npm install ``` 2. Configure environment variables: ```bash PORT=4000 # Development port NODE_ENV=development ``` 3. Start the development server: ```bash npm run dev ``` 4. For production: ```bash npm run start ``` ## 📦 Project Structure ``` twitter-infra/ ├── src/ │ ├── index.ts # Main server entry point │ └── prompt/ │ ├── index.ts # Prompt handling implementation │ └── types.ts # Type definitions ├── package.json └── tsconfig.json ``` ## 🔐 Authentication The agent uses Ethereum wallet-based authentication: 1. Signs a timestamp message with the provided private key 2. Sends the signature along with the wallet address 3. Authenticates with the Eternal AI platform ## 🚀 Usage The agent accepts messages through the Eternal AI platform and processes them with the following flow: 1. Receives a message payload with a private key 2. Generates a wallet signature 3. Sends the request to the Eternal AI Twitter API 4. Returns the authentication URL or response message ## 📚 API Endpoints - Main endpoint: `https://agent.api.eternalai.org/api/utility/twitter/post` - Required headers: - `XXX-Address`: Ethereum wallet address - `XXX-Message`: Current timestamp - `XXX-Signature`: Signed message - `Content-Type`: application/json ## 🛠️ Development ```bash # Run tests npm test # Lint code npm run lint # Build for production npm run build:eternal # Watch mode for development npm run build:watch ``` ## 🚀 Deployment to Eternal AI To deploy this agent to Eternal AI platform: 1. Build and prepare your source code: ```bash # This will build the project and create a zip file npm run build:eternal ``` 2. Visit [Eternal AI Developer Portal](https://eternalai.org/for-developers/create) 3. Upload the zip file: - Log in to your Eternal AI account - Navigate to the "Create Agent" section - Upload the generated `twitter-infra.zip` file - Follow the on-screen instructions to complete deployment > Note: The `build:eternal` script will: > - Build the project > - Create a zip file excluding: > - `node_modules` directory > - `.git` directory > - Any existing zip files > - `dist` directory ## 📝 License MIT License - See LICENSE file for details ================================================ FILE: agent-launcher/crypto-agents/js/twitter-infra/package.json ================================================ { "name": "@eternalai.js/x-infra", "version": "0.1.0", "license": "MIT", "main": "dist/bundle.cjs.js", "module": "dist/bundle.esm.js", "typings": "dist/index.d.ts", "files": [ "dist", "src" ], "engines": { "node": ">=10" }, "scripts": { "build": "npm run build-main", "build-main": "rm -rf dist && NODE_ENV=production rollup -c", "build-dev": "ts-node -r tsconfig-paths/register ./scripts/concat-files.ts", "build:watch": "rollup -c -w", "test": "vitest", "lint": "eslint . --ext .ts,.tsx", "size": "size-limit", "analyze": "size-limit --why", "run-main": "ts-node -r tsconfig-paths/register ./scripts/main.ts", "start": "PORT=80 NODE_ENV=production tsx ./src/index.ts", "dev": "PORT=4000 tsx watch ./src/index.ts", "build:eternal": "npm run build && zip -r twitter-infra.zip . -x \"node_modules/*\" \"*.git/*\" \"*.zip\" \"dist/*\"" }, "peerDependencies": {}, "husky": { "hooks": { "pre-commit": "eslint . --ext .ts,.tsx" } }, "prettier": { "printWidth": 80, "semi": true, "singleQuote": true, "trailingComma": "es5" }, "author": "Peter", "devDependencies": { "tsx": "4.19.3", "typescript": "5.7.3" }, "dependencies": { "ethers": "5.7.2", "agent-server-definition": "latest" } } ================================================ FILE: agent-launcher/crypto-agents/js/twitter-infra/src/index.ts ================================================ import { startServer } from "agent-server-definition"; import { prompt } from "./prompt"; const port = process.env.PORT; startServer(Number(port), prompt); ================================================ FILE: agent-launcher/crypto-agents/js/twitter-infra/src/prompt/index.ts ================================================ import * as ethers from 'ethers'; import { PromptPayload } from 'agent-server-definition'; export const prompt = async (payload: PromptPayload): Promise => { // your code here console.log('payload', payload); try { if (payload.privateKey) { const wallet = new ethers.Wallet(payload.privateKey); const address = wallet.address; const timestamp = Math.floor(Date.now() / 1000).toString(); const signature = await wallet.signMessage(timestamp); const content = payload.messages?.[0]?.content; const params = { 'XXX-Address': address, 'XXX-Message': timestamp, 'XXX-Signature': signature, }; const myHeaders = new Headers(); myHeaders.append('XXX-Address', address); myHeaders.append('XXX-Message', timestamp); myHeaders.append('XXX-Signature', signature); myHeaders.append('Content-Type', 'application/json'); console.log('params', params); const raw = JSON.stringify({ content, }); const requestOptions: any = { method: 'POST', headers: myHeaders, body: raw, redirect: 'follow', }; const response = await fetch( 'https://agent.api.eternalai.org/api/utility/twitter/post', requestOptions ); const rs = await response.text(); console.log('rs', rs); const parseResult = JSON.parse(rs)?.result; console.log('parseResult', parseResult); const message = parseResult?.auth_url || parseResult?.message; return message; } } catch (error) { console.log('error', JSON.stringify(error)); return JSON.stringify(error); } return 'DONE'; }; ================================================ FILE: agent-launcher/crypto-agents/js/twitter-infra/src/prompt/types.ts ================================================ // Define the message structure for the 'messages' array type Message = { role: 'system' | 'user' | 'assistant' | 'tool'; // Common roles; 'tool' for tool responses content: string; // The text content of the message name?: string; // Optional name for multi-agent scenarios }; // The main PromptPayload interface with all parameters export type PromptPayload = { privateKey?: string; messages: Message[]; // Required: Array of message objects chainId?: string; }; ================================================ FILE: agent-launcher/electron/electron-env.d.ts ================================================ /// declare namespace NodeJS { interface ProcessEnv { /** * The built directory structure * * ```tree * ├─┬─┬ dist * │ │ └── index.html * │ │ * │ ├─┬ dist-electron * │ │ ├── main.js * │ │ └── preload.js * │ * ``` */ APP_ROOT: string /** /dist/ or /public/ */ VITE_PUBLIC: string } } // Used in Renderer process, expose in `preload.ts` interface Window { ipcRenderer: import('electron').IpcRenderer } ================================================ FILE: agent-launcher/electron/main.ts ================================================ import { app, BrowserWindow, ipcMain } from "electron"; import path from "node:path"; import { fileURLToPath } from "node:url"; import vm from "vm"; import * as electron from "electron"; // Import Electron safely // const require = createRequire(import.meta.url); const __dirname = path.dirname(fileURLToPath(import.meta.url)); // The built directory structure // // ├─┬─┬ dist // │ │ └── index.html // │ │ // │ ├─┬ dist-electron // │ │ ├── main.js // │ │ └── preload.mjs // │ process.env.APP_ROOT = path.join(__dirname, ".."); // 🚧 Use ['ENV_NAME'] avoid vite:define plugin - Vite@2.x export const VITE_DEV_SERVER_URL = process.env["VITE_DEV_SERVER_URL"]; export const MAIN_DIST = path.join(process.env.APP_ROOT, "dist-electron"); export const RENDERER_DIST = path.join(process.env.APP_ROOT, "dist"); process.env.VITE_PUBLIC = VITE_DEV_SERVER_URL ? path.join(process.env.APP_ROOT, "public") : RENDERER_DIST; let win: BrowserWindow | null; ipcMain.handle("execute-bundled-code", async (_, code: string) => { try { const context = vm.createContext({ console, require }); // ✅ Enable require inside VM const script = new vm.Script(`(function() { ${code} })()`); return script.runInContext(context); } catch (error: any) { return `Error: ${error.message}`; } }); function createWindow() { win = new BrowserWindow({ icon: path.join(process.env.VITE_PUBLIC, "icon.svg"), webPreferences: { preload: path.join(__dirname, "preload.mjs"), }, width: 1440, height: 1080, }); win.loadURL("http://localhost:5173"); // Test active push message to Renderer-process. win.webContents.on("did-finish-load", () => { win?.webContents.send("main-process-message", new Date().toLocaleString()); }); win.on("closed", () => { win = null; }); if (VITE_DEV_SERVER_URL) { win.loadURL(VITE_DEV_SERVER_URL); } else { // win.loadFile('dist/index.html') win.loadFile(path.join(RENDERER_DIST, "index.html")); } } // Quit when all windows are closed, except on macOS. There, it's common // for applications and their menu bar to stay active until the user quits // explicitly with Cmd + Q. app.on("window-all-closed", () => { if (process.platform !== "darwin") { app.quit(); win = null; } }); app.on("activate", () => { // On OS X it's common to re-create a window in the app when the // dock icon is clicked and there are no other windows open. if (BrowserWindow.getAllWindows().length === 0) { createWindow(); } }); app.whenReady().then(createWindow); ================================================ FILE: agent-launcher/electron/preload.ts ================================================ import { ipcRenderer, contextBridge } from "electron"; // --------- Expose some API to the Renderer process --------- contextBridge.exposeInMainWorld("ipcRenderer", { on(...args: Parameters) { const [channel, listener] = args; return ipcRenderer.on(channel, (event, ...args) => listener(event, ...args) ); }, off(...args: Parameters) { const [channel, ...omit] = args; return ipcRenderer.off(channel, ...omit); }, send(...args: Parameters) { const [channel, ...omit] = args; return ipcRenderer.send(channel, ...omit); }, invoke(...args: Parameters) { const [channel, ...omit] = args; return ipcRenderer.invoke(channel, ...omit); }, // You can expose other APTs you need here. // ... }); contextBridge.exposeInMainWorld("electronAPI", { executeCode: async (code: string) => ipcRenderer.invoke("execute-bundled-code", code), }); ================================================ FILE: agent-launcher/electron-builder.json5 ================================================ // @see - https://www.electron.build/configuration/configuration { "$schema": "https://raw.githubusercontent.com/electron-userland/electron-builder/master/packages/app-builder-lib/scheme.json", "appId": "YourAppID", "asar": true, "productName": "YourAppName", "directories": { "output": "release/${version}" }, "files": [ "dist", "dist-electron" ], "mac": { "target": [ "dmg" ], "artifactName": "${productName}-Mac-${version}-Installer.${ext}" }, "win": { "target": [ { "target": "nsis", "arch": [ "x64" ] } ], "artifactName": "${productName}-Windows-${version}-Setup.${ext}" }, "nsis": { "oneClick": false, "perMachine": false, "allowToChangeInstallationDirectory": true, "deleteAppDataOnUninstall": false }, "linux": { "target": [ "AppImage" ], "artifactName": "${productName}-Linux-${version}.${ext}" } } ================================================ FILE: agent-launcher/index.html ================================================ Agent Launcher
================================================ FILE: agent-launcher/package.json ================================================ { "name": "agent-launcher", "private": true, "version": "0.0.0", "type": "module", "scripts": { "dev": "vite", "build": "tsc && vite build && electron-builder", "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0", "preview": "vite preview" }, "dependencies": { "@chakra-ui/react": "2", "@emotion/react": "^11.14.0", "@emotion/styled": "^11.14.0", "@fontsource/inter": "^5.1.1", "classnames": "^2.5.1", "clsx": "^2.1.1", "framer-motion": "^12.4.7", "react": "^18.2.0", "react-dom": "^18.2.0", "react-inlinesvg": "^4.2.0", "react-router-dom": "^7.2.0", "sass": "^1.85.0", "zustand": "^5.0.3" }, "devDependencies": { "@types/react": "^18.2.64", "@types/react-dom": "^18.2.21", "@typescript-eslint/eslint-plugin": "^7.1.1", "@typescript-eslint/parser": "^7.1.1", "@vitejs/plugin-react": "^4.2.1", "electron": "^30.0.1", "electron-builder": "^24.13.3", "eslint": "^8.57.0", "eslint-plugin-react-hooks": "^4.6.0", "eslint-plugin-react-refresh": "^0.4.5", "typescript": "^5.2.2", "vite": "^5.1.6", "vite-plugin-electron": "^0.28.6", "vite-plugin-electron-renderer": "^0.14.5" }, "main": "dist-electron/main.js" } ================================================ FILE: agent-launcher/src/App.tsx ================================================ import { BrowserRouter, Route, Routes } from "react-router-dom"; import ROUTERS from "./constants/route-path"; import Home from "./pages/home"; import Mine from "./pages/mine"; function App() { return ( <> } /> } /> ); } export default App; ================================================ FILE: agent-launcher/src/components/header/index.tsx ================================================ import { Flex } from "@chakra-ui/react"; import HeaderMenu from "./menu"; import s from "./styles.module.scss"; type Props = {}; const Header = (_props: Props) => { const primaryColor = "black"; return ( {/* Eternal AI */} ); }; export default Header; ================================================ FILE: agent-launcher/src/components/header/menu/index.tsx ================================================ import { Box, Flex, Image, Link, Popover, PopoverArrow, PopoverBody, PopoverContent, PopoverTrigger, Text, } from "@chakra-ui/react"; import cs from "clsx"; import { useLocation } from "react-router-dom"; import { NAV_ITEMS, NavItem } from "./menuConfig.ts"; import s from "./styles.module.scss"; const ProductMenu = ({ navItem }: { navItem: NavItem }) => { return ( {navItem.label}

NFT AI

CryptoAgents

Perceptrons

Physical Ai

Neuron

For Developers

); }; type Props = { primaryColor?: "black" | "white"; listNavItems?: Array; }; const HeaderMenu = (props: Props) => { const location = useLocation(); const pathName = location.pathname; console.log("stephen: pathname", pathName); return ( {NAV_ITEMS?.map((navItem) => { return ( ); })} ); }; export default HeaderMenu; ================================================ FILE: agent-launcher/src/components/header/menu/menuConfig.ts ================================================ import ROUTERS from "../../../constants/route-path.ts"; export interface NavItem { label: string; subLabel?: string; children?: Array; isNewWindow?: boolean; rootHref?: string; href?: string; isHide?: boolean; isTwitter?: boolean; className?: string; subMenu?: { label: string; href: string; isNewWindow: boolean; isHide: boolean; }[]; icon?: any; isLogoWebsite?: boolean; isBtnLogin?: boolean; isOnlyIcon?: boolean; isDropdown?: boolean; dropDownComp?: JSX.Element; } export const NAV_ITEMS: Array = [ // { // label: 'Products', // href: '', // isNewWindow: false, // isHide: false, // isDropdown: true, // }, // { // label: `Research`, // href: ROUTERS.RESEARCH, // isNewWindow: false, // isHide: false, // }, { label: `Agents`, href: ROUTERS.HOME, isNewWindow: false, isHide: false, icon: "/icons/menu/ic-home.svg", className: "blue", }, { label: `Mine`, href: ROUTERS.MINE, isNewWindow: false, isHide: false, icon: "/icons/menu/ic-mine.svg", className: "green", }, // { // label: 'Open Source', // href: 'https://github.com/eternalai-org/truly-open-ai', // isNewWindow: true, // isHide: false, // }, // { // label: "Get EAI", // href: ROUTERS.AI_EAI, // isNewWindow: false, // isHide: false, // }, ].filter((item) => !item.isHide); ================================================ FILE: agent-launcher/src/components/header/menu/styles.module.scss ================================================ .deskMenu { flex-direction: column; gap: 12px; a { /* Rectangle 34624740 */ text-align: center; font-size: 14px; font-style: normal; font-weight: 500; line-height: 110%; font-family: var(--font-inter); text-transform: capitalize; transition: opacity 0.4s var(--easeOutQuart); position: relative; display: flex; align-items: center; justify-content: center; gap: 10px; &.isActive { .borderLeft { &.green { background: #1fc337; } &.blue { background: #0079FE; } } } .borderLeft { // position: absolute; width: 6px; height: 45px; // left: 0px; // top: 0; background: transparent; border-radius: 0px 4px 4px 0px; } &.onBtc, &:hover { opacity: 0.5; } } } .isEai { display: flex; justify-content: center; align-items: center; gap: 5px; background: linear-gradient(90deg, #da22ff 0%, #9733ee 33.29%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; &.white { background: linear-gradient(90deg, #ec008c 0%, #fc6767 100%); background-clip: text; -webkit-background-clip: text; -webkit-text-fill-color: transparent; } } .dropdownItem { display: flex; flex-direction: column; gap: 12px; &_heading { font-family: var(--font-inter); color: #6b7280; font-size: 14px; font-style: normal; font-weight: 500; line-height: 110%; /* 15.4px */ text-transform: uppercase; } &_wrap { display: grid; grid-template-columns: repeat(2, 220px); gap: 20px; &_item { display: flex; align-items: center; gap: 8px; img { width: 60px; height: 60px; // border-radius: 2px; } p { color: #000; font-family: var(--font-inter); font-size: 14px; font-style: normal; font-weight: 400; line-height: 110%; /* 15.4px */ } } } } ================================================ FILE: agent-launcher/src/components/header/styles.module.scss ================================================ .headerContainer { // align-items: center; // justify-content: space-between; padding: 35px 0px; width: 90px; height: 100vh; background-color: #e9e9ee; background: linear-gradient(180deg, #e4e5d8 0%, #cbd6e8 100%); /* Color-newsystem/White/40 */ border-right: 1px solid #efefef; } ================================================ FILE: agent-launcher/src/components/header/wallet/index.tsx ================================================ import s from './styles.module.scss'; import {Flex, Text, Image} from "@chakra-ui/react"; import cs from 'clsx'; import {ReactElement, useMemo, useRef, useState} from 'react'; import useOnClickOutside from "../../../hooks/useOnClickOutSide.ts"; type DropdownMenuType = { items: React.ReactNode[]; onClose: () => void; color?: 'white' | 'black'; }; const DropDownMenu = ({ items, onClose, color, }: DropdownMenuType): ReactElement => { const targetRef = useRef(null); useOnClickOutside(targetRef, () => { onClose(); }); //TODO: hardcode const isConnectedAccessToken = false; return (
    { e.preventDefault(); e.stopPropagation(); }} onMouseLeave={onClose} > {items.map((item: React.ReactNode, index) => (
  • {item}
  • ))}
); }; interface IProps { color?: 'white' | 'black'; isTrading?: boolean; } const HeaderWallet: React.FC = ({ color = 'white', }) => { const [isShowMenu, setIsShowMenu] = useState(false); const handleMenuMouseEnter = () => { setIsShowMenu(true); } const onClickWalletBalance = () => { }; const menuItems = useMemo(() => { const items: any[] = []; console.log('items', items); return items; }, []) const renderUserInfor = () => { return ( { e.stopPropagation(); }} >
{ e.stopPropagation(); onClickWalletBalance(); }} > {`0.00 EAI`}
{/* */} {isShowMenu && !!menuItems.length && ( { setIsShowMenu(false); }} /> )}
); } return
{renderUserInfor()}
; }; export default HeaderWallet; ================================================ FILE: agent-launcher/src/components/header/wallet/styles.module.scss ================================================ .wrapper { display: flex; flex-direction: row; align-items: center; .menuList { padding: 16px; min-width: 250px; border-radius: 8px !important; border: 1px solid #fff !important; background: #202137 !important; position: relative; font-family: var(--font-inter) !important; &::before { content: ''; background-color: transparent; height: 10px; position: absolute; top: -10px; width: 100%; left: 0; } } .menusAction { * { font-size: 12px !important; font-weight: 700 !important; line-height: 14px !important; text-align: left; font-family: var(--font-inter) !important; } } .menusActionMobile { //background-color: white; //position: absolute; } .connect { font-size: 12px !important; font-style: normal; font-weight: 500; line-height: 140%; text-transform: uppercase; font-family: var(--font-inter) !important; &__white { background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(black, 0.3); color: white !important; backdrop-filter: blur(12px) !important; svg path { stroke: white !important; } } &__black { background: #f8f9fa; border: 1px solid #e5e7eb; color: black !important; } svg { path { stroke: #000; } } } } .userInfo__desktop { position: relative; .dropMenu_list { margin-top: 27px; width: 284px; background: white; position: absolute; right: 0; list-style: none; display: flex; border-radius: 8px; flex-direction: column; border: 1px solid rgba(black, 0.2); top: 100%; overflow: hidden; backdrop-filter: blur(12px) !important; &.dropMenu_list__dark { background: #101216; border: 1px solid rgba(255, 255, 255, 0.15); // backdrop-filter: blur(12px) !important; svg, span { filter: invert(100%); } } } .menuItem { display: flex; gap: 12px; align-items: center; padding: 12px 20px; min-height: 48px; max-height: 48px; &:hover { opacity: 0.75; } .menuItem__icon { filter: invert(100%); } .menuItem__label { color: black; display: flex; align-items: center; text-transform: uppercase; justify-content: space-between; cursor: pointer; padding-left: 12px; } &__copy { display: inline-flex; gap: 4px; font-size: 14px; font-style: normal; font-weight: 500; line-height: 140%; text-transform: uppercase; background: var(--gradient-button, linear-gradient(90deg, #ff8008 0%, #ffc837 100%)); background-clip: text; -webkit-background-clip: text; -webkit-text-fill-color: transparent; } &__disconnect { // background: #ffffff12; background: #f6f6f6; // margin-top: 12px; .menuItem__label { opacity: 0.5; } .menuItem__icon { opacity: 0.5; } } &__nakaWallet { display: flex; flex-direction: column; min-height: unset; max-height: unset; align-items: flex-start; padding-left: 24px; &__label { display: flex; gap: 4px; align-items: center; span { font-size: 12px; font-weight: 500; line-height: 16.8px; text-align: left; color: #5b5b5b; } } &__value { span { color: #000; font-size: 18px; font-weight: 500; line-height: 25.2px; text-align: left; } } } } } .wallets { display: flex; gap: 4px; height: 40px; overflow: hidden; // padding: 2px; width: max-content; * { //font-family: var(--font-jetbrains_mono); font-size: 14px; font-weight: 400; line-height: calc(15 / 14); text-align: center; } .wallets__item { border-radius: 8px; padding: 10px 16px; display: flex; gap: 6px; align-items: center; } &__trading_connect { border-radius: 8px !important; padding: 12px 18px !important; background: #000 !important; display: flex; flex-direction: row; p { color: white !important; font-size: 14px !important; font-weight: 400 !important;; } } } ================================================ FILE: agent-launcher/src/components/layout/index.tsx ================================================ import { Box, Flex } from "@chakra-ui/react"; import { PropsWithChildren } from "react"; import Header from "../header"; import s from "./styles.module.scss"; type Props = {}; const MainLayout = (props: Props & PropsWithChildren) => { const { children } = props; return (
{children} ); }; export default MainLayout; ================================================ FILE: agent-launcher/src/components/layout/styles.module.scss ================================================ .container { width: 100%; height: 100%; background: #fff; box-shadow: 0px 36px 100px rgba(0, 0, 0, 0.4), 0px 0px 3px rgba(0, 0, 0, 0.25), inset 0px 0px 3px rgba(255, 255, 255, 0.1); backdrop-filter: blur(50px); .content { height: max-content; flex: 1; padding: 60px; } } ================================================ FILE: agent-launcher/src/constants/route-path.ts ================================================ const ROUTERS = { HOME: "/", MINE: "/mine", }; export default ROUTERS; ================================================ FILE: agent-launcher/src/hooks/useOnClickOutSide.ts ================================================ import React, { useEffect } from 'react'; const useOnClickOutside = ( ref: React.RefObject, onClickOutSide: () => void, ): void => { useEffect(() => { const listener = (event: MouseEvent | TouchEvent): void => { if (!ref.current || ref.current.contains(event.target as Node)) { return; } onClickOutSide(); }; document.addEventListener('mousedown', listener); document.addEventListener('touchstart', listener); return () => { document.removeEventListener('mousedown', listener); document.removeEventListener('touchstart', listener); }; }, [ref, onClickOutSide]); }; export default useOnClickOutside; ================================================ FILE: agent-launcher/src/main.tsx ================================================ import React from "react"; import App from "./App.tsx"; import { createRoot } from "react-dom/client"; import { ChakraProvider } from "@chakra-ui/react"; import '@fontsource/inter'; createRoot(document.getElementById("root")!).render( ); // Use contextBridge window.ipcRenderer.on("main-process-message", (_event, message) => { console.log(message); }); ================================================ FILE: agent-launcher/src/pages/home/chat-agent/bundle.js ================================================ /* Do NOT modify this file; see /src.ts/_admin/update-version.ts */ /** * The current version of Ethers. */ const version = "6.13.0"; /** * Property helper functions. * * @_subsection api/utils:Properties [about-properties] */ function checkType(value, type, name) { const types = type.split("|").map(t => t.trim()); for (let i = 0; i < types.length; i++) { switch (type) { case "any": return; case "bigint": case "boolean": case "number": case "string": if (typeof value === type) { return; } } } const error = new Error(`invalid value for type ${type}`); error.code = "INVALID_ARGUMENT"; error.argument = `value.${name}`; error.value = value; throw error; } /** * Resolves to a new object that is a copy of %%value%%, but with all * values resolved. */ async function resolveProperties(value) { const keys = Object.keys(value); const results = await Promise.all(keys.map(k => Promise.resolve(value[k]))); return results.reduce((accum, v, index) => { accum[keys[index]] = v; return accum; }, {}); } /** * Assigns the %%values%% to %%target%% as read-only values. * * It %%types%% is specified, the values are checked. */ function defineProperties(target, values, types) { for (let key in values) { let value = values[key]; const type = types ? types[key] : null; if (type) { checkType(value, type, key); } Object.defineProperty(target, key, { enumerable: true, value, writable: false }); } } /** * All errors in ethers include properties to ensure they are both * human-readable (i.e. ``.message``) and machine-readable (i.e. ``.code``). * * The [[isError]] function can be used to check the error ``code`` and * provide a type guard for the properties present on that error interface. * * @_section: api/utils/errors:Errors [about-errors] */ function stringify(value) { if (value == null) { return "null"; } if (Array.isArray(value)) { return "[ " + value.map(stringify).join(", ") + " ]"; } if (value instanceof Uint8Array) { const HEX = "0123456789abcdef"; let result = "0x"; for (let i = 0; i < value.length; i++) { result += HEX[value[i] >> 4]; result += HEX[value[i] & 0xf]; } return result; } if (typeof value === "object" && typeof value.toJSON === "function") { return stringify(value.toJSON()); } switch (typeof value) { case "boolean": case "symbol": return value.toString(); case "bigint": return BigInt(value).toString(); case "number": return value.toString(); case "string": return JSON.stringify(value); case "object": { const keys = Object.keys(value); keys.sort(); return "{ " + keys.map(k => `${stringify(k)}: ${stringify(value[k])}`).join(", ") + " }"; } } return `[ COULD NOT SERIALIZE ]`; } /** * Returns true if the %%error%% matches an error thrown by ethers * that matches the error %%code%%. * * In TypeScript environments, this can be used to check that %%error%% * matches an EthersError type, which means the expected properties will * be set. * * @See [ErrorCodes](api:ErrorCode) * @example * try { * // code.... * } catch (e) { * if (isError(e, "CALL_EXCEPTION")) { * // The Type Guard has validated this object * console.log(e.data); * } * } */ function isError(error, code) { return error && error.code === code; } /** * Returns true if %%error%% is a [[CallExceptionError]. */ function isCallException(error) { return isError(error, "CALL_EXCEPTION"); } /** * Returns a new Error configured to the format ethers emits errors, with * the %%message%%, [[api:ErrorCode]] %%code%% and additional properties * for the corresponding EthersError. * * Each error in ethers includes the version of ethers, a * machine-readable [[ErrorCode]], and depending on %%code%%, additional * required properties. The error message will also include the %%message%%, * ethers version, %%code%% and all additional properties, serialized. */ function makeError(message, code, info) { let shortMessage = message; { const details = []; if (info) { if ("message" in info || "code" in info || "name" in info) { throw new Error(`value will overwrite populated values: ${stringify(info)}`); } for (const key in info) { if (key === "shortMessage") { continue; } const value = info[key]; // try { details.push(key + "=" + stringify(value)); // } catch (error: any) { // console.log("MMM", error.message); // details.push(key + "=[could not serialize object]"); // } } } details.push(`code=${code}`); details.push(`version=${version}`); if (details.length) { message += " (" + details.join(", ") + ")"; } } let error; switch (code) { case "INVALID_ARGUMENT": error = new TypeError(message); break; case "NUMERIC_FAULT": case "BUFFER_OVERRUN": error = new RangeError(message); break; default: error = new Error(message); } defineProperties(error, { code }); if (info) { Object.assign(error, info); } if (error.shortMessage == null) { defineProperties(error, { shortMessage }); } return error; } /** * Throws an EthersError with %%message%%, %%code%% and additional error * %%info%% when %%check%% is falsish.. * * @see [[api:makeError]] */ function assert(check, message, code, info) { if (!check) { throw makeError(message, code, info); } } /** * A simple helper to simply ensuring provided arguments match expected * constraints, throwing if not. * * In TypeScript environments, the %%check%% has been asserted true, so * any further code does not need additional compile-time checks. */ function assertArgument(check, message, name, value) { assert(check, message, "INVALID_ARGUMENT", { argument: name, value: value }); } function assertArgumentCount(count, expectedCount, message) { if (message == null) { message = ""; } if (message) { message = ": " + message; } assert(count >= expectedCount, "missing arguemnt" + message, "MISSING_ARGUMENT", { count: count, expectedCount: expectedCount }); assert(count <= expectedCount, "too many arguments" + message, "UNEXPECTED_ARGUMENT", { count: count, expectedCount: expectedCount }); } const _normalizeForms = ["NFD", "NFC", "NFKD", "NFKC"].reduce((accum, form) => { try { // General test for normalize /* c8 ignore start */ if ("test".normalize(form) !== "test") { throw new Error("bad"); } ; /* c8 ignore stop */ if (form === "NFD") { const check = String.fromCharCode(0xe9).normalize("NFD"); const expected = String.fromCharCode(0x65, 0x0301); /* c8 ignore start */ if (check !== expected) { throw new Error("broken"); } /* c8 ignore stop */ } accum.push(form); } catch (error) {} return accum; }, []); /** * Throws if the normalization %%form%% is not supported. */ function assertNormalize(form) { assert(_normalizeForms.indexOf(form) >= 0, "platform missing String.prototype.normalize", "UNSUPPORTED_OPERATION", { operation: "String.prototype.normalize", info: { form } }); } /** * Many classes use file-scoped values to guard the constructor, * making it effectively private. This facilitates that pattern * by ensuring the %%givenGaurd%% matches the file-scoped %%guard%%, * throwing if not, indicating the %%className%% if provided. */ function assertPrivate(givenGuard, guard, className) { if (className == null) { className = ""; } if (givenGuard !== guard) { let method = className, operation = "new"; if (className) { method += "."; operation += " " + className; } assert(false, `private constructor; use ${method}from* methods`, "UNSUPPORTED_OPERATION", { operation }); } } /** * Some data helpers. * * * @_subsection api/utils:Data Helpers [about-data] */ function _getBytes(value, name, copy) { if (value instanceof Uint8Array) { if (copy) { return new Uint8Array(value); } return value; } if (typeof value === "string" && value.match(/^0x(?:[0-9a-f][0-9a-f])*$/i)) { const result = new Uint8Array((value.length - 2) / 2); let offset = 2; for (let i = 0; i < result.length; i++) { result[i] = parseInt(value.substring(offset, offset + 2), 16); offset += 2; } return result; } assertArgument(false, "invalid BytesLike value", name || "value", value); } /** * Get a typed Uint8Array for %%value%%. If already a Uint8Array * the original %%value%% is returned; if a copy is required use * [[getBytesCopy]]. * * @see: getBytesCopy */ function getBytes(value, name) { return _getBytes(value, name, false); } /** * Get a typed Uint8Array for %%value%%, creating a copy if necessary * to prevent any modifications of the returned value from being * reflected elsewhere. * * @see: getBytes */ function getBytesCopy(value, name) { return _getBytes(value, name, true); } /** * Returns true if %%value%% is a valid [[HexString]]. * * If %%length%% is ``true`` or a //number//, it also checks that * %%value%% is a valid [[DataHexString]] of %%length%% (if a //number//) * bytes of data (e.g. ``0x1234`` is 2 bytes). */ function isHexString(value, length) { if (typeof value !== "string" || !value.match(/^0x[0-9A-Fa-f]*$/)) { return false; } if (typeof length === "number" && value.length !== 2 + 2 * length) { return false; } if (length === true && value.length % 2 !== 0) { return false; } return true; } /** * Returns true if %%value%% is a valid representation of arbitrary * data (i.e. a valid [[DataHexString]] or a Uint8Array). */ function isBytesLike(value) { return isHexString(value, true) || value instanceof Uint8Array; } const HexCharacters = "0123456789abcdef"; /** * Returns a [[DataHexString]] representation of %%data%%. */ function hexlify(data) { const bytes = getBytes(data); let result = "0x"; for (let i = 0; i < bytes.length; i++) { const v = bytes[i]; result += HexCharacters[(v & 0xf0) >> 4] + HexCharacters[v & 0x0f]; } return result; } /** * Returns a [[DataHexString]] by concatenating all values * within %%data%%. */ function concat(datas) { return "0x" + datas.map(d => hexlify(d).substring(2)).join(""); } /** * Returns the length of %%data%%, in bytes. */ function dataLength(data) { if (isHexString(data, true)) { return (data.length - 2) / 2; } return getBytes(data).length; } /** * Returns a [[DataHexString]] by slicing %%data%% from the %%start%% * offset to the %%end%% offset. * * By default %%start%% is 0 and %%end%% is the length of %%data%%. */ function dataSlice(data, start, end) { const bytes = getBytes(data); if (end != null && end > bytes.length) { assert(false, "cannot slice beyond data bounds", "BUFFER_OVERRUN", { buffer: bytes, length: bytes.length, offset: end }); } return hexlify(bytes.slice(start == null ? 0 : start, end == null ? bytes.length : end)); } function zeroPad(data, length, left) { const bytes = getBytes(data); assert(length >= bytes.length, "padding exceeds data length", "BUFFER_OVERRUN", { buffer: new Uint8Array(bytes), length: length, offset: length + 1 }); const result = new Uint8Array(length); result.fill(0); if (left) { result.set(bytes, length - bytes.length); } else { result.set(bytes, 0); } return hexlify(result); } /** * Return the [[DataHexString]] of %%data%% padded on the **left** * to %%length%% bytes. * * If %%data%% already exceeds %%length%%, a [[BufferOverrunError]] is * thrown. * * This pads data the same as **values** are in Solidity * (e.g. ``uint128``). */ function zeroPadValue(data, length) { return zeroPad(data, length, true); } /** * Return the [[DataHexString]] of %%data%% padded on the **right** * to %%length%% bytes. * * If %%data%% already exceeds %%length%%, a [[BufferOverrunError]] is * thrown. * * This pads data the same as **bytes** are in Solidity * (e.g. ``bytes16``). */ function zeroPadBytes(data, length) { return zeroPad(data, length, false); } /** * Some mathematic operations. * * @_subsection: api/utils:Math Helpers [about-maths] */ const BN_0$9 = BigInt(0); const BN_1$3 = BigInt(1); //const BN_Max256 = (BN_1 << BigInt(256)) - BN_1; // IEEE 754 support 53-bits of mantissa const maxValue = 0x1fffffffffffff; /** * Convert %%value%% from a twos-compliment representation of %%width%% * bits to its value. * * If the highest bit is ``1``, the result will be negative. */ function fromTwos(_value, _width) { const value = getUint(_value, "value"); const width = BigInt(getNumber(_width, "width")); assert(value >> width === BN_0$9, "overflow", "NUMERIC_FAULT", { operation: "fromTwos", fault: "overflow", value: _value }); // Top bit set; treat as a negative value if (value >> width - BN_1$3) { const mask = (BN_1$3 << width) - BN_1$3; return -((~value & mask) + BN_1$3); } return value; } /** * Convert %%value%% to a twos-compliment representation of * %%width%% bits. * * The result will always be positive. */ function toTwos(_value, _width) { let value = getBigInt(_value, "value"); const width = BigInt(getNumber(_width, "width")); const limit = BN_1$3 << width - BN_1$3; if (value < BN_0$9) { value = -value; assert(value <= limit, "too low", "NUMERIC_FAULT", { operation: "toTwos", fault: "overflow", value: _value }); const mask = (BN_1$3 << width) - BN_1$3; return (~value & mask) + BN_1$3; } else { assert(value < limit, "too high", "NUMERIC_FAULT", { operation: "toTwos", fault: "overflow", value: _value }); } return value; } /** * Mask %%value%% with a bitmask of %%bits%% ones. */ function mask(_value, _bits) { const value = getUint(_value, "value"); const bits = BigInt(getNumber(_bits, "bits")); return value & (BN_1$3 << bits) - BN_1$3; } /** * Gets a BigInt from %%value%%. If it is an invalid value for * a BigInt, then an ArgumentError will be thrown for %%name%%. */ function getBigInt(value, name) { switch (typeof value) { case "bigint": return value; case "number": assertArgument(Number.isInteger(value), "underflow", name || "value", value); assertArgument(value >= -9007199254740991 && value <= maxValue, "overflow", name || "value", value); return BigInt(value); case "string": try { if (value === "") { throw new Error("empty string"); } if (value[0] === "-" && value[1] !== "-") { return -BigInt(value.substring(1)); } return BigInt(value); } catch (e) { assertArgument(false, `invalid BigNumberish string: ${e.message}`, name || "value", value); } } assertArgument(false, "invalid BigNumberish value", name || "value", value); } /** * Returns %%value%% as a bigint, validating it is valid as a bigint * value and that it is positive. */ function getUint(value, name) { const result = getBigInt(value, name); assert(result >= BN_0$9, "unsigned value cannot be negative", "NUMERIC_FAULT", { fault: "overflow", operation: "getUint", value }); return result; } const Nibbles$1 = "0123456789abcdef"; /* * Converts %%value%% to a BigInt. If %%value%% is a Uint8Array, it * is treated as Big Endian data. */ function toBigInt(value) { if (value instanceof Uint8Array) { let result = "0x0"; for (const v of value) { result += Nibbles$1[v >> 4]; result += Nibbles$1[v & 0x0f]; } return BigInt(result); } return getBigInt(value); } /** * Gets a //number// from %%value%%. If it is an invalid value for * a //number//, then an ArgumentError will be thrown for %%name%%. */ function getNumber(value, name) { switch (typeof value) { case "bigint": assertArgument(value >= -9007199254740991 && value <= maxValue, "overflow", name || "value", value); return Number(value); case "number": assertArgument(Number.isInteger(value), "underflow", name || "value", value); assertArgument(value >= -9007199254740991 && value <= maxValue, "overflow", name || "value", value); return value; case "string": try { if (value === "") { throw new Error("empty string"); } return getNumber(BigInt(value), name); } catch (e) { assertArgument(false, `invalid numeric string: ${e.message}`, name || "value", value); } } assertArgument(false, "invalid numeric value", name || "value", value); } /** * Converts %%value%% to a number. If %%value%% is a Uint8Array, it * is treated as Big Endian data. Throws if the value is not safe. */ function toNumber(value) { return getNumber(toBigInt(value)); } /** * Converts %%value%% to a Big Endian hexstring, optionally padded to * %%width%% bytes. */ function toBeHex(_value, _width) { const value = getUint(_value, "value"); let result = value.toString(16); if (_width == null) { // Ensure the value is of even length if (result.length % 2) { result = "0" + result; } } else { const width = getNumber(_width, "width"); assert(width * 2 >= result.length, `value exceeds width (${width} bytes)`, "NUMERIC_FAULT", { operation: "toBeHex", fault: "overflow", value: _value }); // Pad the value to the required width while (result.length < width * 2) { result = "0" + result; } } return "0x" + result; } /** * Converts %%value%% to a Big Endian Uint8Array. */ function toBeArray(_value) { const value = getUint(_value, "value"); if (value === BN_0$9) { return new Uint8Array([]); } let hex = value.toString(16); if (hex.length % 2) { hex = "0" + hex; } const result = new Uint8Array(hex.length / 2); for (let i = 0; i < result.length; i++) { const offset = i * 2; result[i] = parseInt(hex.substring(offset, offset + 2), 16); } return result; } /** * Returns a [[HexString]] for %%value%% safe to use as a //Quantity//. * * A //Quantity// does not have and leading 0 values unless the value is * the literal value `0x0`. This is most commonly used for JSSON-RPC * numeric values. */ function toQuantity(value) { let result = hexlify(isBytesLike(value) ? value : toBeArray(value)).substring(2); while (result.startsWith("0")) { result = result.substring(1); } if (result === "") { result = "0"; } return "0x" + result; } /** * The [Base58 Encoding](link-base58) scheme allows a **numeric** value * to be encoded as a compact string using a radix of 58 using only * alpha-numeric characters. Confusingly similar characters are omitted * (i.e. ``"l0O"``). * * Note that Base58 encodes a **numeric** value, not arbitrary bytes, * since any zero-bytes on the left would get removed. To mitigate this * issue most schemes that use Base58 choose specific high-order values * to ensure non-zero prefixes. * * @_subsection: api/utils:Base58 Encoding [about-base58] */ const Alphabet = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"; let Lookup = null; function getAlpha(letter) { if (Lookup == null) { Lookup = {}; for (let i = 0; i < Alphabet.length; i++) { Lookup[Alphabet[i]] = BigInt(i); } } const result = Lookup[letter]; assertArgument(result != null, `invalid base58 value`, "letter", letter); return result; } const BN_0$8 = BigInt(0); const BN_58 = BigInt(58); /** * Encode %%value%% as a Base58-encoded string. */ function encodeBase58(_value) { const bytes = getBytes(_value); let value = toBigInt(bytes); let result = ""; while (value) { result = Alphabet[Number(value % BN_58)] + result; value /= BN_58; } // Account for leading padding zeros for (let i = 0; i < bytes.length; i++) { if (bytes[i]) { break; } result = Alphabet[0] + result; } return result; } /** * Decode the Base58-encoded %%value%%. */ function decodeBase58(value) { let result = BN_0$8; for (let i = 0; i < value.length; i++) { result *= BN_58; result += getAlpha(value[i]); } return result; } // utils/base64-browser function decodeBase64(textData) { textData = atob(textData); const data = new Uint8Array(textData.length); for (let i = 0; i < textData.length; i++) { data[i] = textData.charCodeAt(i); } return getBytes(data); } function encodeBase64(_data) { const data = getBytes(_data); let textData = ""; for (let i = 0; i < data.length; i++) { textData += String.fromCharCode(data[i]); } return btoa(textData); } /** * Events allow for applications to use the observer pattern, which * allows subscribing and publishing events, outside the normal * execution paths. * * @_section api/utils/events:Events [about-events] */ /** * When an [[EventEmitterable]] triggers a [[Listener]], the * callback always ahas one additional argument passed, which is * an **EventPayload**. */ class EventPayload { /** * The event filter. */ filter; /** * The **EventEmitterable**. */ emitter; #listener; /** * Create a new **EventPayload** for %%emitter%% with * the %%listener%% and for %%filter%%. */ constructor(emitter, listener, filter) { this.#listener = listener; defineProperties(this, { emitter, filter }); } /** * Unregister the triggered listener for future events. */ async removeListener() { if (this.#listener == null) { return; } await this.emitter.off(this.filter, this.#listener); } } /** * Using strings in Ethereum (or any security-basd system) requires * additional care. These utilities attempt to mitigate some of the * safety issues as well as provide the ability to recover and analyse * strings. * * @_subsection api/utils:Strings and UTF-8 [about-strings] */ function errorFunc(reason, offset, bytes, output, badCodepoint) { assertArgument(false, `invalid codepoint at offset ${offset}; ${reason}`, "bytes", bytes); } function ignoreFunc(reason, offset, bytes, output, badCodepoint) { // If there is an invalid prefix (including stray continuation), skip any additional continuation bytes if (reason === "BAD_PREFIX" || reason === "UNEXPECTED_CONTINUE") { let i = 0; for (let o = offset + 1; o < bytes.length; o++) { if (bytes[o] >> 6 !== 0x02) { break; } i++; } return i; } // This byte runs us past the end of the string, so just jump to the end // (but the first byte was read already read and therefore skipped) if (reason === "OVERRUN") { return bytes.length - offset - 1; } // Nothing to skip return 0; } function replaceFunc(reason, offset, bytes, output, badCodepoint) { // Overlong representations are otherwise "valid" code points; just non-deistingtished if (reason === "OVERLONG") { assertArgument(typeof badCodepoint === "number", "invalid bad code point for replacement", "badCodepoint", badCodepoint); output.push(badCodepoint); return 0; } // Put the replacement character into the output output.push(0xfffd); // Otherwise, process as if ignoring errors return ignoreFunc(reason, offset, bytes); } /** * A handful of popular, built-in UTF-8 error handling strategies. * * **``"error"``** - throws on ANY illegal UTF-8 sequence or * non-canonical (overlong) codepoints (this is the default) * * **``"ignore"``** - silently drops any illegal UTF-8 sequence * and accepts non-canonical (overlong) codepoints * * **``"replace"``** - replace any illegal UTF-8 sequence with the * UTF-8 replacement character (i.e. ``"\\ufffd"``) and accepts * non-canonical (overlong) codepoints * * @returns: Record<"error" | "ignore" | "replace", Utf8ErrorFunc> */ const Utf8ErrorFuncs = Object.freeze({ error: errorFunc, ignore: ignoreFunc, replace: replaceFunc }); // http://stackoverflow.com/questions/13356493/decode-utf-8-with-javascript#13691499 function getUtf8CodePoints(_bytes, onError) { if (onError == null) { onError = Utf8ErrorFuncs.error; } const bytes = getBytes(_bytes, "bytes"); const result = []; let i = 0; // Invalid bytes are ignored while (i < bytes.length) { const c = bytes[i++]; // 0xxx xxxx if (c >> 7 === 0) { result.push(c); continue; } // Multibyte; how many bytes left for this character? let extraLength = null; let overlongMask = null; // 110x xxxx 10xx xxxx if ((c & 0xe0) === 0xc0) { extraLength = 1; overlongMask = 0x7f; // 1110 xxxx 10xx xxxx 10xx xxxx } else if ((c & 0xf0) === 0xe0) { extraLength = 2; overlongMask = 0x7ff; // 1111 0xxx 10xx xxxx 10xx xxxx 10xx xxxx } else if ((c & 0xf8) === 0xf0) { extraLength = 3; overlongMask = 0xffff; } else { if ((c & 0xc0) === 0x80) { i += onError("UNEXPECTED_CONTINUE", i - 1, bytes, result); } else { i += onError("BAD_PREFIX", i - 1, bytes, result); } continue; } // Do we have enough bytes in our data? if (i - 1 + extraLength >= bytes.length) { i += onError("OVERRUN", i - 1, bytes, result); continue; } // Remove the length prefix from the char let res = c & (1 << 8 - extraLength - 1) - 1; for (let j = 0; j < extraLength; j++) { let nextChar = bytes[i]; // Invalid continuation byte if ((nextChar & 0xc0) != 0x80) { i += onError("MISSING_CONTINUE", i, bytes, result); res = null; break; } res = res << 6 | nextChar & 0x3f; i++; } // See above loop for invalid continuation byte if (res === null) { continue; } // Maximum code point if (res > 0x10ffff) { i += onError("OUT_OF_RANGE", i - 1 - extraLength, bytes, result, res); continue; } // Reserved for UTF-16 surrogate halves if (res >= 0xd800 && res <= 0xdfff) { i += onError("UTF16_SURROGATE", i - 1 - extraLength, bytes, result, res); continue; } // Check for overlong sequences (more bytes than needed) if (res <= overlongMask) { i += onError("OVERLONG", i - 1 - extraLength, bytes, result, res); continue; } result.push(res); } return result; } // http://stackoverflow.com/questions/18729405/how-to-convert-utf8-string-to-byte-array /** * Returns the UTF-8 byte representation of %%str%%. * * If %%form%% is specified, the string is normalized. */ function toUtf8Bytes(str, form) { assertArgument(typeof str === "string", "invalid string value", "str", str); if (form != null) { assertNormalize(form); str = str.normalize(form); } let result = []; for (let i = 0; i < str.length; i++) { const c = str.charCodeAt(i); if (c < 0x80) { result.push(c); } else if (c < 0x800) { result.push(c >> 6 | 0xc0); result.push(c & 0x3f | 0x80); } else if ((c & 0xfc00) == 0xd800) { i++; const c2 = str.charCodeAt(i); assertArgument(i < str.length && (c2 & 0xfc00) === 0xdc00, "invalid surrogate pair", "str", str); // Surrogate Pair const pair = 0x10000 + ((c & 0x03ff) << 10) + (c2 & 0x03ff); result.push(pair >> 18 | 0xf0); result.push(pair >> 12 & 0x3f | 0x80); result.push(pair >> 6 & 0x3f | 0x80); result.push(pair & 0x3f | 0x80); } else { result.push(c >> 12 | 0xe0); result.push(c >> 6 & 0x3f | 0x80); result.push(c & 0x3f | 0x80); } } return new Uint8Array(result); } //export function _toUtf8String(codePoints) { return codePoints.map(codePoint => { if (codePoint <= 0xffff) { return String.fromCharCode(codePoint); } codePoint -= 0x10000; return String.fromCharCode((codePoint >> 10 & 0x3ff) + 0xd800, (codePoint & 0x3ff) + 0xdc00); }).join(""); } /** * Returns the string represented by the UTF-8 data %%bytes%%. * * When %%onError%% function is specified, it is called on UTF-8 * errors allowing recovery using the [[Utf8ErrorFunc]] API. * (default: [error](Utf8ErrorFuncs)) */ function toUtf8String(bytes, onError) { return _toUtf8String(getUtf8CodePoints(bytes, onError)); } function createGetUrl(options) { async function getUrl(req, _signal) { assert(_signal == null || !_signal.cancelled, "request cancelled before sending", "CANCELLED"); const protocol = req.url.split(":")[0].toLowerCase(); assert(protocol === "http" || protocol === "https", `unsupported protocol ${protocol}`, "UNSUPPORTED_OPERATION", { info: { protocol }, operation: "request" }); assert(protocol === "https" || !req.credentials || req.allowInsecureAuthentication, "insecure authorized connections unsupported", "UNSUPPORTED_OPERATION", { operation: "request" }); let error = null; const controller = new AbortController(); const timer = setTimeout(() => { error = makeError("request timeout", "TIMEOUT"); controller.abort(); }, req.timeout); if (_signal) { _signal.addListener(() => { error = makeError("request cancelled", "CANCELLED"); controller.abort(); }); } const init = { method: req.method, headers: new Headers(Array.from(req)), body: req.body || undefined, signal: controller.signal }; let resp; try { resp = await fetch(req.url, init); } catch (_error) { clearTimeout(timer); if (error) { throw error; } throw _error; } clearTimeout(timer); const headers = {}; resp.headers.forEach((value, key) => { headers[key.toLowerCase()] = value; }); const respBody = await resp.arrayBuffer(); const body = respBody == null ? null : new Uint8Array(respBody); return { statusCode: resp.status, statusMessage: resp.statusText, headers, body }; } return getUrl; } /** * Fetching content from the web is environment-specific, so Ethers * provides an abstraction that each environment can implement to provide * this service. * * On [Node.js](link-node), the ``http`` and ``https`` libs are used to * create a request object, register event listeners and process data * and populate the [[FetchResponse]]. * * In a browser, the [DOM fetch](link-js-fetch) is used, and the resulting * ``Promise`` is waited on to retrieve the payload. * * The [[FetchRequest]] is responsible for handling many common situations, * such as redirects, server throttling, authentication, etc. * * It also handles common gateways, such as IPFS and data URIs. * * @_section api/utils/fetching:Fetching Web Content [about-fetch] */ const MAX_ATTEMPTS = 12; const SLOT_INTERVAL = 250; // The global FetchGetUrlFunc implementation. let defaultGetUrlFunc = createGetUrl(); const reData = new RegExp("^data:([^;:]*)?(;base64)?,(.*)$", "i"); const reIpfs = new RegExp("^ipfs:/\/(ipfs/)?(.*)$", "i"); // If locked, new Gateways cannot be added let locked$5 = false; // https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URLs async function dataGatewayFunc(url, signal) { try { const match = url.match(reData); if (!match) { throw new Error("invalid data"); } return new FetchResponse(200, "OK", { "content-type": match[1] || "text/plain" }, match[2] ? decodeBase64(match[3]) : unpercent(match[3])); } catch (error) { return new FetchResponse(599, "BAD REQUEST (invalid data: URI)", {}, null, new FetchRequest(url)); } } /** * Returns a [[FetchGatewayFunc]] for fetching content from a standard * IPFS gateway hosted at %%baseUrl%%. */ function getIpfsGatewayFunc(baseUrl) { async function gatewayIpfs(url, signal) { try { const match = url.match(reIpfs); if (!match) { throw new Error("invalid link"); } return new FetchRequest(`${baseUrl}${match[2]}`); } catch (error) { return new FetchResponse(599, "BAD REQUEST (invalid IPFS URI)", {}, null, new FetchRequest(url)); } } return gatewayIpfs; } const Gateways = { "data": dataGatewayFunc, "ipfs": getIpfsGatewayFunc("https:/\/gateway.ipfs.io/ipfs/") }; const fetchSignals = new WeakMap(); /** * @_ignore */ class FetchCancelSignal { #listeners; #cancelled; constructor(request) { this.#listeners = []; this.#cancelled = false; fetchSignals.set(request, () => { if (this.#cancelled) { return; } this.#cancelled = true; for (const listener of this.#listeners) { setTimeout(() => { listener(); }, 0); } this.#listeners = []; }); } addListener(listener) { assert(!this.#cancelled, "singal already cancelled", "UNSUPPORTED_OPERATION", { operation: "fetchCancelSignal.addCancelListener" }); this.#listeners.push(listener); } get cancelled() { return this.#cancelled; } checkSignal() { assert(!this.cancelled, "cancelled", "CANCELLED", {}); } } // Check the signal, throwing if it is cancelled function checkSignal(signal) { if (signal == null) { throw new Error("missing signal; should not happen"); } signal.checkSignal(); return signal; } /** * Represents a request for a resource using a URI. * * By default, the supported schemes are ``HTTP``, ``HTTPS``, ``data:``, * and ``IPFS:``. * * Additional schemes can be added globally using [[registerGateway]]. * * @example: * req = new FetchRequest("https://www.ricmoo.com") * resp = await req.send() * resp.body.length * //_result: */ class FetchRequest { #allowInsecure; #gzip; #headers; #method; #timeout; #url; #body; #bodyType; #creds; // Hooks #preflight; #process; #retry; #signal; #throttle; #getUrlFunc; /** * The fetch URL to request. */ get url() { return this.#url; } set url(url) { this.#url = String(url); } /** * The fetch body, if any, to send as the request body. //(default: null)// * * When setting a body, the intrinsic ``Content-Type`` is automatically * set and will be used if **not overridden** by setting a custom * header. * * If %%body%% is null, the body is cleared (along with the * intrinsic ``Content-Type``). * * If %%body%% is a string, the intrinsic ``Content-Type`` is set to * ``text/plain``. * * If %%body%% is a Uint8Array, the intrinsic ``Content-Type`` is set to * ``application/octet-stream``. * * If %%body%% is any other object, the intrinsic ``Content-Type`` is * set to ``application/json``. */ get body() { if (this.#body == null) { return null; } return new Uint8Array(this.#body); } set body(body) { if (body == null) { this.#body = undefined; this.#bodyType = undefined; } else if (typeof body === "string") { this.#body = toUtf8Bytes(body); this.#bodyType = "text/plain"; } else if (body instanceof Uint8Array) { this.#body = body; this.#bodyType = "application/octet-stream"; } else if (typeof body === "object") { this.#body = toUtf8Bytes(JSON.stringify(body)); this.#bodyType = "application/json"; } else { throw new Error("invalid body"); } } /** * Returns true if the request has a body. */ hasBody() { return this.#body != null; } /** * The HTTP method to use when requesting the URI. If no method * has been explicitly set, then ``GET`` is used if the body is * null and ``POST`` otherwise. */ get method() { if (this.#method) { return this.#method; } if (this.hasBody()) { return "POST"; } return "GET"; } set method(method) { if (method == null) { method = ""; } this.#method = String(method).toUpperCase(); } /** * The headers that will be used when requesting the URI. All * keys are lower-case. * * This object is a copy, so any changes will **NOT** be reflected * in the ``FetchRequest``. * * To set a header entry, use the ``setHeader`` method. */ get headers() { const headers = Object.assign({}, this.#headers); if (this.#creds) { headers["authorization"] = `Basic ${encodeBase64(toUtf8Bytes(this.#creds))}`; } if (this.allowGzip) { headers["accept-encoding"] = "gzip"; } if (headers["content-type"] == null && this.#bodyType) { headers["content-type"] = this.#bodyType; } if (this.body) { headers["content-length"] = String(this.body.length); } return headers; } /** * Get the header for %%key%%, ignoring case. */ getHeader(key) { return this.headers[key.toLowerCase()]; } /** * Set the header for %%key%% to %%value%%. All values are coerced * to a string. */ setHeader(key, value) { this.#headers[String(key).toLowerCase()] = String(value); } /** * Clear all headers, resetting all intrinsic headers. */ clearHeaders() { this.#headers = {}; } [Symbol.iterator]() { const headers = this.headers; const keys = Object.keys(headers); let index = 0; return { next: () => { if (index < keys.length) { const key = keys[index++]; return { value: [key, headers[key]], done: false }; } return { value: undefined, done: true }; } }; } /** * The value that will be sent for the ``Authorization`` header. * * To set the credentials, use the ``setCredentials`` method. */ get credentials() { return this.#creds || null; } /** * Sets an ``Authorization`` for %%username%% with %%password%%. */ setCredentials(username, password) { assertArgument(!username.match(/:/), "invalid basic authentication username", "username", "[REDACTED]"); this.#creds = `${username}:${password}`; } /** * Enable and request gzip-encoded responses. The response will * automatically be decompressed. //(default: true)// */ get allowGzip() { return this.#gzip; } set allowGzip(value) { this.#gzip = !!value; } /** * Allow ``Authentication`` credentials to be sent over insecure * channels. //(default: false)// */ get allowInsecureAuthentication() { return !!this.#allowInsecure; } set allowInsecureAuthentication(value) { this.#allowInsecure = !!value; } /** * The timeout (in milliseconds) to wait for a complete response. * //(default: 5 minutes)// */ get timeout() { return this.#timeout; } set timeout(timeout) { assertArgument(timeout >= 0, "timeout must be non-zero", "timeout", timeout); this.#timeout = timeout; } /** * This function is called prior to each request, for example * during a redirection or retry in case of server throttling. * * This offers an opportunity to populate headers or update * content before sending a request. */ get preflightFunc() { return this.#preflight || null; } set preflightFunc(preflight) { this.#preflight = preflight; } /** * This function is called after each response, offering an * opportunity to provide client-level throttling or updating * response data. * * Any error thrown in this causes the ``send()`` to throw. * * To schedule a retry attempt (assuming the maximum retry limit * has not been reached), use [[response.throwThrottleError]]. */ get processFunc() { return this.#process || null; } set processFunc(process) { this.#process = process; } /** * This function is called on each retry attempt. */ get retryFunc() { return this.#retry || null; } set retryFunc(retry) { this.#retry = retry; } /** * This function is called to fetch content from HTTP and * HTTPS URLs and is platform specific (e.g. nodejs vs * browsers). * * This is by default the currently registered global getUrl * function, which can be changed using [[registerGetUrl]]. * If this has been set, setting is to ``null`` will cause * this FetchRequest (and any future clones) to revert back to * using the currently registered global getUrl function. * * Setting this is generally not necessary, but may be useful * for developers that wish to intercept requests or to * configurege a proxy or other agent. */ get getUrlFunc() { return this.#getUrlFunc || defaultGetUrlFunc; } set getUrlFunc(value) { this.#getUrlFunc = value; } /** * Create a new FetchRequest instance with default values. * * Once created, each property may be set before issuing a * ``.send()`` to make the request. */ constructor(url) { this.#url = String(url); this.#allowInsecure = false; this.#gzip = true; this.#headers = {}; this.#method = ""; this.#timeout = 300000; this.#throttle = { slotInterval: SLOT_INTERVAL, maxAttempts: MAX_ATTEMPTS }; this.#getUrlFunc = null; } toString() { return ``; } /** * Update the throttle parameters used to determine maximum * attempts and exponential-backoff properties. */ setThrottleParams(params) { if (params.slotInterval != null) { this.#throttle.slotInterval = params.slotInterval; } if (params.maxAttempts != null) { this.#throttle.maxAttempts = params.maxAttempts; } } async #send(attempt, expires, delay, _request, _response) { if (attempt >= this.#throttle.maxAttempts) { return _response.makeServerError("exceeded maximum retry limit"); } assert(getTime$1() <= expires, "timeout", "TIMEOUT", { operation: "request.send", reason: "timeout", request: _request }); if (delay > 0) { await wait(delay); } let req = this.clone(); const scheme = (req.url.split(":")[0] || "").toLowerCase(); // Process any Gateways if (scheme in Gateways) { const result = await Gateways[scheme](req.url, checkSignal(_request.#signal)); if (result instanceof FetchResponse) { let response = result; if (this.processFunc) { checkSignal(_request.#signal); try { response = await this.processFunc(req, response); } catch (error) { // Something went wrong during processing; throw a 5xx server error if (error.throttle == null || typeof error.stall !== "number") { response.makeServerError("error in post-processing function", error).assertOk(); } // Ignore throttling } } return response; } req = result; } // We have a preflight function; update the request if (this.preflightFunc) { req = await this.preflightFunc(req); } const resp = await this.getUrlFunc(req, checkSignal(_request.#signal)); let response = new FetchResponse(resp.statusCode, resp.statusMessage, resp.headers, resp.body, _request); if (response.statusCode === 301 || response.statusCode === 302) { // Redirect try { const location = response.headers.location || ""; return req.redirect(location).#send(attempt + 1, expires, 0, _request, response); } catch (error) {} // Things won't get any better on another attempt; abort return response; } else if (response.statusCode === 429) { // Throttle if (this.retryFunc == null || (await this.retryFunc(req, response, attempt))) { const retryAfter = response.headers["retry-after"]; let delay = this.#throttle.slotInterval * Math.trunc(Math.random() * Math.pow(2, attempt)); if (typeof retryAfter === "string" && retryAfter.match(/^[1-9][0-9]*$/)) { delay = parseInt(retryAfter); } return req.clone().#send(attempt + 1, expires, delay, _request, response); } } if (this.processFunc) { checkSignal(_request.#signal); try { response = await this.processFunc(req, response); } catch (error) { // Something went wrong during processing; throw a 5xx server error if (error.throttle == null || typeof error.stall !== "number") { response.makeServerError("error in post-processing function", error).assertOk(); } // Throttle let delay = this.#throttle.slotInterval * Math.trunc(Math.random() * Math.pow(2, attempt)); if (error.stall >= 0) { delay = error.stall; } return req.clone().#send(attempt + 1, expires, delay, _request, response); } } return response; } /** * Resolves to the response by sending the request. */ send() { assert(this.#signal == null, "request already sent", "UNSUPPORTED_OPERATION", { operation: "fetchRequest.send" }); this.#signal = new FetchCancelSignal(this); return this.#send(0, getTime$1() + this.timeout, 0, this, new FetchResponse(0, "", {}, null, this)); } /** * Cancels the inflight response, causing a ``CANCELLED`` * error to be rejected from the [[send]]. */ cancel() { assert(this.#signal != null, "request has not been sent", "UNSUPPORTED_OPERATION", { operation: "fetchRequest.cancel" }); const signal = fetchSignals.get(this); if (!signal) { throw new Error("missing signal; should not happen"); } signal(); } /** * Returns a new [[FetchRequest]] that represents the redirection * to %%location%%. */ redirect(location) { // Redirection; for now we only support absolute locations const current = this.url.split(":")[0].toLowerCase(); const target = location.split(":")[0].toLowerCase(); // Don't allow redirecting: // - non-GET requests // - downgrading the security (e.g. https => http) // - to non-HTTP (or non-HTTPS) protocols [this could be relaxed?] assert(this.method === "GET" && (current !== "https" || target !== "http") && location.match(/^https?:/), `unsupported redirect`, "UNSUPPORTED_OPERATION", { operation: `redirect(${this.method} ${JSON.stringify(this.url)} => ${JSON.stringify(location)})` }); // Create a copy of this request, with a new URL const req = new FetchRequest(location); req.method = "GET"; req.allowGzip = this.allowGzip; req.timeout = this.timeout; req.#headers = Object.assign({}, this.#headers); if (this.#body) { req.#body = new Uint8Array(this.#body); } req.#bodyType = this.#bodyType; // Do not forward credentials unless on the same domain; only absolute //req.allowInsecure = false; // paths are currently supported; may want a way to specify to forward? //setStore(req.#props, "creds", getStore(this.#pros, "creds")); return req; } /** * Create a new copy of this request. */ clone() { const clone = new FetchRequest(this.url); // Preserve "default method" (i.e. null) clone.#method = this.#method; // Preserve "default body" with type, copying the Uint8Array is present if (this.#body) { clone.#body = this.#body; } clone.#bodyType = this.#bodyType; // Preserve "default headers" clone.#headers = Object.assign({}, this.#headers); // Credentials is readonly, so we copy internally clone.#creds = this.#creds; if (this.allowGzip) { clone.allowGzip = true; } clone.timeout = this.timeout; if (this.allowInsecureAuthentication) { clone.allowInsecureAuthentication = true; } clone.#preflight = this.#preflight; clone.#process = this.#process; clone.#retry = this.#retry; clone.#throttle = Object.assign({}, this.#throttle); clone.#getUrlFunc = this.#getUrlFunc; return clone; } /** * Locks all static configuration for gateways and FetchGetUrlFunc * registration. */ static lockConfig() { locked$5 = true; } /** * Get the current Gateway function for %%scheme%%. */ static getGateway(scheme) { return Gateways[scheme.toLowerCase()] || null; } /** * Use the %%func%% when fetching URIs using %%scheme%%. * * This method affects all requests globally. * * If [[lockConfig]] has been called, no change is made and this * throws. */ static registerGateway(scheme, func) { scheme = scheme.toLowerCase(); if (scheme === "http" || scheme === "https") { throw new Error(`cannot intercept ${scheme}; use registerGetUrl`); } if (locked$5) { throw new Error("gateways locked"); } Gateways[scheme] = func; } /** * Use %%getUrl%% when fetching URIs over HTTP and HTTPS requests. * * This method affects all requests globally. * * If [[lockConfig]] has been called, no change is made and this * throws. */ static registerGetUrl(getUrl) { if (locked$5) { throw new Error("gateways locked"); } defaultGetUrlFunc = getUrl; } /** * Creates a getUrl function that fetches content from HTTP and * HTTPS URLs. * * The available %%options%% are dependent on the platform * implementation of the default getUrl function. * * This is not generally something that is needed, but is useful * when trying to customize simple behaviour when fetching HTTP * content. */ static createGetUrlFunc(options) { return createGetUrl(); } /** * Creates a function that can "fetch" data URIs. * * Note that this is automatically done internally to support * data URIs, so it is not necessary to register it. * * This is not generally something that is needed, but may * be useful in a wrapper to perfom custom data URI functionality. */ static createDataGateway() { return dataGatewayFunc; } /** * Creates a function that will fetch IPFS (unvalidated) from * a custom gateway baseUrl. * * The default IPFS gateway used internally is * ``"https:/\/gateway.ipfs.io/ipfs/"``. */ static createIpfsGatewayFunc(baseUrl) { return getIpfsGatewayFunc(baseUrl); } } /** * The response for a FetchRequest. */ class FetchResponse { #statusCode; #statusMessage; #headers; #body; #request; #error; toString() { return ``; } /** * The response status code. */ get statusCode() { return this.#statusCode; } /** * The response status message. */ get statusMessage() { return this.#statusMessage; } /** * The response headers. All keys are lower-case. */ get headers() { return Object.assign({}, this.#headers); } /** * The response body, or ``null`` if there was no body. */ get body() { return this.#body == null ? null : new Uint8Array(this.#body); } /** * The response body as a UTF-8 encoded string, or the empty * string (i.e. ``""``) if there was no body. * * An error is thrown if the body is invalid UTF-8 data. */ get bodyText() { try { return this.#body == null ? "" : toUtf8String(this.#body); } catch (error) { assert(false, "response body is not valid UTF-8 data", "UNSUPPORTED_OPERATION", { operation: "bodyText", info: { response: this } }); } } /** * The response body, decoded as JSON. * * An error is thrown if the body is invalid JSON-encoded data * or if there was no body. */ get bodyJson() { try { return JSON.parse(this.bodyText); } catch (error) { assert(false, "response body is not valid JSON", "UNSUPPORTED_OPERATION", { operation: "bodyJson", info: { response: this } }); } } [Symbol.iterator]() { const headers = this.headers; const keys = Object.keys(headers); let index = 0; return { next: () => { if (index < keys.length) { const key = keys[index++]; return { value: [key, headers[key]], done: false }; } return { value: undefined, done: true }; } }; } constructor(statusCode, statusMessage, headers, body, request) { this.#statusCode = statusCode; this.#statusMessage = statusMessage; this.#headers = Object.keys(headers).reduce((accum, k) => { accum[k.toLowerCase()] = String(headers[k]); return accum; }, {}); this.#body = body == null ? null : new Uint8Array(body); this.#request = request || null; this.#error = { message: "" }; } /** * Return a Response with matching headers and body, but with * an error status code (i.e. 599) and %%message%% with an * optional %%error%%. */ makeServerError(message, error) { let statusMessage; if (!message) { message = `${this.statusCode} ${this.statusMessage}`; statusMessage = `CLIENT ESCALATED SERVER ERROR (${message})`; } else { statusMessage = `CLIENT ESCALATED SERVER ERROR (${this.statusCode} ${this.statusMessage}; ${message})`; } const response = new FetchResponse(599, statusMessage, this.headers, this.body, this.#request || undefined); response.#error = { message, error }; return response; } /** * If called within a [request.processFunc](FetchRequest-processFunc) * call, causes the request to retry as if throttled for %%stall%% * milliseconds. */ throwThrottleError(message, stall) { if (stall == null) { stall = -1; } else { assertArgument(Number.isInteger(stall) && stall >= 0, "invalid stall timeout", "stall", stall); } const error = new Error(message || "throttling requests"); defineProperties(error, { stall, throttle: true }); throw error; } /** * Get the header value for %%key%%, ignoring case. */ getHeader(key) { return this.headers[key.toLowerCase()]; } /** * Returns true if the response has a body. */ hasBody() { return this.#body != null; } /** * The request made for this response. */ get request() { return this.#request; } /** * Returns true if this response was a success statusCode. */ ok() { return this.#error.message === "" && this.statusCode >= 200 && this.statusCode < 300; } /** * Throws a ``SERVER_ERROR`` if this response is not ok. */ assertOk() { if (this.ok()) { return; } let { message, error } = this.#error; if (message === "") { message = `server response ${this.statusCode} ${this.statusMessage}`; } let requestUrl = null; if (this.request) { requestUrl = this.request.url; } let responseBody = null; try { if (this.#body) { responseBody = toUtf8String(this.#body); } } catch (e) {} assert(false, message, "SERVER_ERROR", { request: this.request || "unknown request", response: this, error, info: { requestUrl, responseBody, responseStatus: `${this.statusCode} ${this.statusMessage}` } }); } } function getTime$1() { return new Date().getTime(); } function unpercent(value) { return toUtf8Bytes(value.replace(/%([0-9a-f][0-9a-f])/gi, (all, code) => { return String.fromCharCode(parseInt(code, 16)); })); } function wait(delay) { return new Promise(resolve => setTimeout(resolve, delay)); } //See: https://github.com/ethereum/wiki/wiki/RLP function hexlifyByte(value) { let result = value.toString(16); while (result.length < 2) { result = "0" + result; } return "0x" + result; } function unarrayifyInteger(data, offset, length) { let result = 0; for (let i = 0; i < length; i++) { result = result * 256 + data[offset + i]; } return result; } function _decodeChildren(data, offset, childOffset, length) { const result = []; while (childOffset < offset + 1 + length) { const decoded = _decode(data, childOffset); result.push(decoded.result); childOffset += decoded.consumed; assert(childOffset <= offset + 1 + length, "child data too short", "BUFFER_OVERRUN", { buffer: data, length, offset }); } return { consumed: 1 + length, result: result }; } // returns { consumed: number, result: Object } function _decode(data, offset) { assert(data.length !== 0, "data too short", "BUFFER_OVERRUN", { buffer: data, length: 0, offset: 1 }); const checkOffset = offset => { assert(offset <= data.length, "data short segment too short", "BUFFER_OVERRUN", { buffer: data, length: data.length, offset }); }; // Array with extra length prefix if (data[offset] >= 0xf8) { const lengthLength = data[offset] - 0xf7; checkOffset(offset + 1 + lengthLength); const length = unarrayifyInteger(data, offset + 1, lengthLength); checkOffset(offset + 1 + lengthLength + length); return _decodeChildren(data, offset, offset + 1 + lengthLength, lengthLength + length); } else if (data[offset] >= 0xc0) { const length = data[offset] - 0xc0; checkOffset(offset + 1 + length); return _decodeChildren(data, offset, offset + 1, length); } else if (data[offset] >= 0xb8) { const lengthLength = data[offset] - 0xb7; checkOffset(offset + 1 + lengthLength); const length = unarrayifyInteger(data, offset + 1, lengthLength); checkOffset(offset + 1 + lengthLength + length); const result = hexlify(data.slice(offset + 1 + lengthLength, offset + 1 + lengthLength + length)); return { consumed: 1 + lengthLength + length, result: result }; } else if (data[offset] >= 0x80) { const length = data[offset] - 0x80; checkOffset(offset + 1 + length); const result = hexlify(data.slice(offset + 1, offset + 1 + length)); return { consumed: 1 + length, result: result }; } return { consumed: 1, result: hexlifyByte(data[offset]) }; } /** * Decodes %%data%% into the structured data it represents. */ function decodeRlp(_data) { const data = getBytes(_data, "data"); const decoded = _decode(data, 0); assertArgument(decoded.consumed === data.length, "unexpected junk after rlp payload", "data", _data); return decoded.result; } //See: https://github.com/ethereum/wiki/wiki/RLP function arrayifyInteger(value) { const result = []; while (value) { result.unshift(value & 0xff); value >>= 8; } return result; } function _encode(object) { if (Array.isArray(object)) { let payload = []; object.forEach(function (child) { payload = payload.concat(_encode(child)); }); if (payload.length <= 55) { payload.unshift(0xc0 + payload.length); return payload; } const length = arrayifyInteger(payload.length); length.unshift(0xf7 + length.length); return length.concat(payload); } const data = Array.prototype.slice.call(getBytes(object, "object")); if (data.length === 1 && data[0] <= 0x7f) { return data; } else if (data.length <= 55) { data.unshift(0x80 + data.length); return data; } const length = arrayifyInteger(data.length); length.unshift(0xb7 + length.length); return length.concat(data); } const nibbles = "0123456789abcdef"; /** * Encodes %%object%% as an RLP-encoded [[DataHexString]]. */ function encodeRlp(object) { let result = "0x"; for (const v of _encode(object)) { result += nibbles[v >> 4]; result += nibbles[v & 0xf]; } return result; } /** * Explain UUID and link to RFC here. * * @_subsection: api/utils:UUID [about-uuid] */ /** * Returns the version 4 [[link-uuid]] for the %%randomBytes%%. * * @see: https://www.ietf.org/rfc/rfc4122.txt (Section 4.4) */ function uuidV4(randomBytes) { const bytes = getBytes(randomBytes, "randomBytes"); // Section: 4.1.3: // - time_hi_and_version[12:16] = 0b0100 bytes[6] = bytes[6] & 0x0f | 0x40; // Section 4.4 // - clock_seq_hi_and_reserved[6] = 0b0 // - clock_seq_hi_and_reserved[7] = 0b1 bytes[8] = bytes[8] & 0x3f | 0x80; const value = hexlify(bytes); return [value.substring(2, 10), value.substring(10, 14), value.substring(14, 18), value.substring(18, 22), value.substring(22, 34)].join("-"); } /** * @_ignore: */ const WordSize = 32; const Padding = new Uint8Array(WordSize); // Properties used to immediate pass through to the underlying object // - `then` is used to detect if an object is a Promise for await const passProperties$1 = ["then"]; const _guard$4 = {}; const resultNames = new WeakMap(); function getNames(result) { return resultNames.get(result); } function setNames(result, names) { resultNames.set(result, names); } function throwError(name, error) { const wrapped = new Error(`deferred error during ABI decoding triggered accessing ${name}`); wrapped.error = error; throw wrapped; } function toObject(names, items, deep) { if (names.indexOf(null) >= 0) { return items.map((item, index) => { if (item instanceof Result) { return toObject(getNames(item), item, deep); } return item; }); } return names.reduce((accum, name, index) => { let item = items.getValue(name); if (!(name in accum)) { if (deep && item instanceof Result) { item = toObject(getNames(item), item, deep); } accum[name] = item; } return accum; }, {}); } /** * A [[Result]] is a sub-class of Array, which allows accessing any * of its values either positionally by its index or, if keys are * provided by its name. * * @_docloc: api/abi */ class Result extends Array { // No longer used; but cannot be removed as it will remove the // #private field from the .d.ts which may break backwards // compatibility #names; /** * @private */ constructor(...args) { // To properly sub-class Array so the other built-in // functions work, the constructor has to behave fairly // well. So, in the event we are created via fromItems() // we build the read-only Result object we want, but on // any other input, we use the default constructor // constructor(guard: any, items: Array, keys?: Array); const guard = args[0]; let items = args[1]; let names = (args[2] || []).slice(); let wrap = true; if (guard !== _guard$4) { items = args; names = []; wrap = false; } // Can't just pass in ...items since an array of length 1 // is a special case in the super. super(items.length); items.forEach((item, index) => { this[index] = item; }); // Find all unique keys const nameCounts = names.reduce((accum, name) => { if (typeof name === "string") { accum.set(name, (accum.get(name) || 0) + 1); } return accum; }, new Map()); // Remove any key thats not unique setNames(this, Object.freeze(items.map((item, index) => { const name = names[index]; if (name != null && nameCounts.get(name) === 1) { return name; } return null; }))); // Dummy operations to prevent TypeScript from complaining this.#names = []; if (this.#names == null) { void this.#names; } if (!wrap) { return; } // A wrapped Result is immutable Object.freeze(this); // Proxy indices and names so we can trap deferred errors const proxy = new Proxy(this, { get: (target, prop, receiver) => { if (typeof prop === "string") { // Index accessor if (prop.match(/^[0-9]+$/)) { const index = getNumber(prop, "%index"); if (index < 0 || index >= this.length) { throw new RangeError("out of result range"); } const item = target[index]; if (item instanceof Error) { throwError(`index ${index}`, item); } return item; } // Pass important checks (like `then` for Promise) through if (passProperties$1.indexOf(prop) >= 0) { return Reflect.get(target, prop, receiver); } const value = target[prop]; if (value instanceof Function) { // Make sure functions work with private variables // See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy#no_private_property_forwarding return function (...args) { return value.apply(this === receiver ? target : this, args); }; } else if (!(prop in target)) { // Possible name accessor return target.getValue.apply(this === receiver ? target : this, [prop]); } } return Reflect.get(target, prop, receiver); } }); setNames(proxy, getNames(this)); return proxy; } /** * Returns the Result as a normal Array. If %%deep%%, any children * which are Result objects are also converted to a normal Array. * * This will throw if there are any outstanding deferred * errors. */ toArray(deep) { const result = []; this.forEach((item, index) => { if (item instanceof Error) { throwError(`index ${index}`, item); } if (deep && item instanceof Result) { item = item.toArray(deep); } result.push(item); }); return result; } /** * Returns the Result as an Object with each name-value pair. If * %%deep%%, any children which are Result objects are also * converted to an Object. * * This will throw if any value is unnamed, or if there are * any outstanding deferred errors. */ toObject(deep) { const names = getNames(this); return names.reduce((accum, name, index) => { assert(name != null, `value at index ${index} unnamed`, "UNSUPPORTED_OPERATION", { operation: "toObject()" }); return toObject(names, this, deep); }, {}); } /** * @_ignore */ slice(start, end) { if (start == null) { start = 0; } if (start < 0) { start += this.length; if (start < 0) { start = 0; } } if (end == null) { end = this.length; } if (end < 0) { end += this.length; if (end < 0) { end = 0; } } if (end > this.length) { end = this.length; } const _names = getNames(this); const result = [], names = []; for (let i = start; i < end; i++) { result.push(this[i]); names.push(_names[i]); } return new Result(_guard$4, result, names); } /** * @_ignore */ filter(callback, thisArg) { const _names = getNames(this); const result = [], names = []; for (let i = 0; i < this.length; i++) { const item = this[i]; if (item instanceof Error) { throwError(`index ${i}`, item); } if (callback.call(thisArg, item, i, this)) { result.push(item); names.push(_names[i]); } } return new Result(_guard$4, result, names); } /** * @_ignore */ map(callback, thisArg) { const result = []; for (let i = 0; i < this.length; i++) { const item = this[i]; if (item instanceof Error) { throwError(`index ${i}`, item); } result.push(callback.call(thisArg, item, i, this)); } return result; } /** * Returns the value for %%name%%. * * Since it is possible to have a key whose name conflicts with * a method on a [[Result]] or its superclass Array, or any * JavaScript keyword, this ensures all named values are still * accessible by name. */ getValue(name) { const index = getNames(this).indexOf(name); if (index === -1) { return undefined; } const value = this[index]; if (value instanceof Error) { throwError(`property ${JSON.stringify(name)}`, value.error); } return value; } /** * Creates a new [[Result]] for %%items%% with each entry * also accessible by its corresponding name in %%keys%%. */ static fromItems(items, keys) { return new Result(_guard$4, items, keys); } } function getValue$1(value) { let bytes = toBeArray(value); assert(bytes.length <= WordSize, "value out-of-bounds", "BUFFER_OVERRUN", { buffer: bytes, length: WordSize, offset: bytes.length }); if (bytes.length !== WordSize) { bytes = getBytesCopy(concat([Padding.slice(bytes.length % WordSize), bytes])); } return bytes; } /** * @_ignore */ class Coder { // The coder name: // - address, uint256, tuple, array, etc. name; // The fully expanded type, including composite types: // - address, uint256, tuple(address,bytes), uint256[3][4][], etc. type; // The localName bound in the signature, in this example it is "baz": // - tuple(address foo, uint bar) baz localName; // Whether this type is dynamic: // - Dynamic: bytes, string, address[], tuple(boolean[]), etc. // - Not Dynamic: address, uint256, boolean[3], tuple(address, uint8) dynamic; constructor(name, type, localName, dynamic) { defineProperties(this, { name, type, localName, dynamic }, { name: "string", type: "string", localName: "string", dynamic: "boolean" }); } _throwError(message, value) { assertArgument(false, message, this.localName, value); } } /** * @_ignore */ class Writer { // An array of WordSize lengthed objects to concatenation #data; #dataLength; constructor() { this.#data = []; this.#dataLength = 0; } get data() { return concat(this.#data); } get length() { return this.#dataLength; } #writeData(data) { this.#data.push(data); this.#dataLength += data.length; return data.length; } appendWriter(writer) { return this.#writeData(getBytesCopy(writer.data)); } // Arrayish item; pad on the right to *nearest* WordSize writeBytes(value) { let bytes = getBytesCopy(value); const paddingOffset = bytes.length % WordSize; if (paddingOffset) { bytes = getBytesCopy(concat([bytes, Padding.slice(paddingOffset)])); } return this.#writeData(bytes); } // Numeric item; pad on the left *to* WordSize writeValue(value) { return this.#writeData(getValue$1(value)); } // Inserts a numeric place-holder, returning a callback that can // be used to asjust the value later writeUpdatableValue() { const offset = this.#data.length; this.#data.push(Padding); this.#dataLength += WordSize; return value => { this.#data[offset] = getValue$1(value); }; } } /** * @_ignore */ class Reader { // Allows incomplete unpadded data to be read; otherwise an error // is raised if attempting to overrun the buffer. This is required // to deal with an old Solidity bug, in which event data for // external (not public thoguh) was tightly packed. allowLoose; #data; #offset; #bytesRead; #parent; #maxInflation; constructor(data, allowLoose, maxInflation) { defineProperties(this, { allowLoose: !!allowLoose }); this.#data = getBytesCopy(data); this.#bytesRead = 0; this.#parent = null; this.#maxInflation = maxInflation != null ? maxInflation : 1024; this.#offset = 0; } get data() { return hexlify(this.#data); } get dataLength() { return this.#data.length; } get consumed() { return this.#offset; } get bytes() { return new Uint8Array(this.#data); } #incrementBytesRead(count) { if (this.#parent) { return this.#parent.#incrementBytesRead(count); } this.#bytesRead += count; // Check for excessive inflation (see: #4537) assert(this.#maxInflation < 1 || this.#bytesRead <= this.#maxInflation * this.dataLength, `compressed ABI data exceeds inflation ratio of ${this.#maxInflation} ( see: https:/\/github.com/ethers-io/ethers.js/issues/4537 )`, "BUFFER_OVERRUN", { buffer: getBytesCopy(this.#data), offset: this.#offset, length: count, info: { bytesRead: this.#bytesRead, dataLength: this.dataLength } }); } #peekBytes(offset, length, loose) { let alignedLength = Math.ceil(length / WordSize) * WordSize; if (this.#offset + alignedLength > this.#data.length) { if (this.allowLoose && loose && this.#offset + length <= this.#data.length) { alignedLength = length; } else { assert(false, "data out-of-bounds", "BUFFER_OVERRUN", { buffer: getBytesCopy(this.#data), length: this.#data.length, offset: this.#offset + alignedLength }); } } return this.#data.slice(this.#offset, this.#offset + alignedLength); } // Create a sub-reader with the same underlying data, but offset subReader(offset) { const reader = new Reader(this.#data.slice(this.#offset + offset), this.allowLoose, this.#maxInflation); reader.#parent = this; return reader; } // Read bytes readBytes(length, loose) { let bytes = this.#peekBytes(0, length, !!loose); this.#incrementBytesRead(length); this.#offset += bytes.length; // @TODO: Make sure the length..end bytes are all 0? return bytes.slice(0, length); } // Read a numeric values readValue() { return toBigInt(this.readBytes(WordSize)); } readIndex() { return toNumber(this.readBytes(WordSize)); } } function number(n) { if (!Number.isSafeInteger(n) || n < 0) throw new Error(`Wrong positive integer: ${n}`); } function bytes(b, ...lengths) { if (!(b instanceof Uint8Array)) throw new Error('Expected Uint8Array'); if (lengths.length > 0 && !lengths.includes(b.length)) throw new Error(`Expected Uint8Array of length ${lengths}, not of length=${b.length}`); } function hash(hash) { if (typeof hash !== 'function' || typeof hash.create !== 'function') throw new Error('Hash should be wrapped by utils.wrapConstructor'); number(hash.outputLen); number(hash.blockLen); } function exists(instance, checkFinished = true) { if (instance.destroyed) throw new Error('Hash instance has been destroyed'); if (checkFinished && instance.finished) throw new Error('Hash#digest() has already been called'); } function output(out, instance) { bytes(out); const min = instance.outputLen; if (out.length < min) { throw new Error(`digestInto() expects output buffer of length at least ${min}`); } } const crypto$1 = typeof globalThis === 'object' && 'crypto' in globalThis ? globalThis.crypto : undefined; /*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */ // We use WebCrypto aka globalThis.crypto, which exists in browsers and node.js 16+. // node.js versions earlier than v19 don't declare it in global scope. // For node.js, package.json#exports field mapping rewrites import // from `crypto` to `cryptoNode`, which imports native module. // Makes the utils un-importable in browsers without a bundler. // Once node.js 18 is deprecated, we can just drop the import. const u8a$1 = a => a instanceof Uint8Array; const u32 = arr => new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4)); // Cast array to view const createView = arr => new DataView(arr.buffer, arr.byteOffset, arr.byteLength); // The rotate right (circular right shift) operation for uint32 const rotr = (word, shift) => word << 32 - shift | word >>> shift; // big-endian hardware is rare. Just in case someone still decides to run hashes: // early-throw an error because we don't support BE yet. const isLE = new Uint8Array(new Uint32Array([0x11223344]).buffer)[0] === 0x44; if (!isLE) throw new Error('Non little-endian hardware is not supported'); // There is no setImmediate in browser and setTimeout is slow. // call of async fn will return Promise, which will be fullfiled only on // next scheduler queue processing step and this is exactly what we need. const nextTick = async () => {}; // Returns control to thread each 'tick' ms to avoid blocking async function asyncLoop(iters, tick, cb) { let ts = Date.now(); for (let i = 0; i < iters; i++) { cb(i); // Date.now() is not monotonic, so in case if clock goes backwards we return return control too const diff = Date.now() - ts; if (diff >= 0 && diff < tick) continue; await nextTick(); ts += diff; } } /** * @example utf8ToBytes('abc') // new Uint8Array([97, 98, 99]) */ function utf8ToBytes$1(str) { if (typeof str !== 'string') throw new Error(`utf8ToBytes expected string, got ${typeof str}`); return new Uint8Array(new TextEncoder().encode(str)); // https://bugzil.la/1681809 } /** * Normalizes (non-hex) string or Uint8Array to Uint8Array. * Warning: when Uint8Array is passed, it would NOT get copied. * Keep in mind for future mutable operations. */ function toBytes(data) { if (typeof data === 'string') data = utf8ToBytes$1(data); if (!u8a$1(data)) throw new Error(`expected Uint8Array, got ${typeof data}`); return data; } /** * Copies several Uint8Arrays into one. */ function concatBytes$1(...arrays) { const r = new Uint8Array(arrays.reduce((sum, a) => sum + a.length, 0)); let pad = 0; // walk through each item, ensure they have proper type arrays.forEach(a => { if (!u8a$1(a)) throw new Error('Uint8Array expected'); r.set(a, pad); pad += a.length; }); return r; } // For runtime check if class implements interface class Hash { // Safe version that clones internal state clone() { return this._cloneInto(); } } const toStr = {}.toString; function checkOpts(defaults, opts) { if (opts !== undefined && toStr.call(opts) !== '[object Object]') throw new Error('Options should be object or undefined'); const merged = Object.assign(defaults, opts); return merged; } function wrapConstructor(hashCons) { const hashC = msg => hashCons().update(toBytes(msg)).digest(); const tmp = hashCons(); hashC.outputLen = tmp.outputLen; hashC.blockLen = tmp.blockLen; hashC.create = () => hashCons(); return hashC; } /** * Secure PRNG. Uses `crypto.getRandomValues`, which defers to OS. */ function randomBytes$2(bytesLength = 32) { if (crypto$1 && typeof crypto$1.getRandomValues === 'function') { return crypto$1.getRandomValues(new Uint8Array(bytesLength)); } throw new Error('crypto.getRandomValues must be defined'); } // HMAC (RFC 2104) class HMAC extends Hash { constructor(hash$1, _key) { super(); this.finished = false; this.destroyed = false; hash(hash$1); const key = toBytes(_key); this.iHash = hash$1.create(); if (typeof this.iHash.update !== 'function') throw new Error('Expected instance of class which extends utils.Hash'); this.blockLen = this.iHash.blockLen; this.outputLen = this.iHash.outputLen; const blockLen = this.blockLen; const pad = new Uint8Array(blockLen); // blockLen can be bigger than outputLen pad.set(key.length > blockLen ? hash$1.create().update(key).digest() : key); for (let i = 0; i < pad.length; i++) pad[i] ^= 0x36; this.iHash.update(pad); // By doing update (processing of first block) of outer hash here we can re-use it between multiple calls via clone this.oHash = hash$1.create(); // Undo internal XOR && apply outer XOR for (let i = 0; i < pad.length; i++) pad[i] ^= 0x36 ^ 0x5c; this.oHash.update(pad); pad.fill(0); } update(buf) { exists(this); this.iHash.update(buf); return this; } digestInto(out) { exists(this); bytes(out, this.outputLen); this.finished = true; this.iHash.digestInto(out); this.oHash.update(out); this.oHash.digestInto(out); this.destroy(); } digest() { const out = new Uint8Array(this.oHash.outputLen); this.digestInto(out); return out; } _cloneInto(to) { // Create new instance without calling constructor since key already in state and we don't know it. to || (to = Object.create(Object.getPrototypeOf(this), {})); const { oHash, iHash, finished, destroyed, blockLen, outputLen } = this; to = to; to.finished = finished; to.destroyed = destroyed; to.blockLen = blockLen; to.outputLen = outputLen; to.oHash = oHash._cloneInto(to.oHash); to.iHash = iHash._cloneInto(to.iHash); return to; } destroy() { this.destroyed = true; this.oHash.destroy(); this.iHash.destroy(); } } /** * HMAC: RFC2104 message authentication code. * @param hash - function that would be used e.g. sha256 * @param key - message key * @param message - message data */ const hmac = (hash, key, message) => new HMAC(hash, key).update(message).digest(); hmac.create = (hash, key) => new HMAC(hash, key); // Common prologue and epilogue for sync/async functions function pbkdf2Init(hash$1, _password, _salt, _opts) { hash(hash$1); const opts = checkOpts({ dkLen: 32, asyncTick: 10 }, _opts); const { c, dkLen, asyncTick } = opts; number(c); number(dkLen); number(asyncTick); if (c < 1) throw new Error('PBKDF2: iterations (c) should be >= 1'); const password = toBytes(_password); const salt = toBytes(_salt); // DK = PBKDF2(PRF, Password, Salt, c, dkLen); const DK = new Uint8Array(dkLen); // U1 = PRF(Password, Salt + INT_32_BE(i)) const PRF = hmac.create(hash$1, password); const PRFSalt = PRF._cloneInto().update(salt); return { c, dkLen, asyncTick, DK, PRF, PRFSalt }; } function pbkdf2Output(PRF, PRFSalt, DK, prfW, u) { PRF.destroy(); PRFSalt.destroy(); if (prfW) prfW.destroy(); u.fill(0); return DK; } /** * PBKDF2-HMAC: RFC 2898 key derivation function * @param hash - hash function that would be used e.g. sha256 * @param password - password from which a derived key is generated * @param salt - cryptographic salt * @param opts - {c, dkLen} where c is work factor and dkLen is output message size */ function pbkdf2$1(hash, password, salt, opts) { const { c, dkLen, DK, PRF, PRFSalt } = pbkdf2Init(hash, password, salt, opts); let prfW; // Working copy const arr = new Uint8Array(4); const view = createView(arr); const u = new Uint8Array(PRF.outputLen); // DK = T1 + T2 + ⋯ + Tdklen/hlen for (let ti = 1, pos = 0; pos < dkLen; ti++, pos += PRF.outputLen) { // Ti = F(Password, Salt, c, i) const Ti = DK.subarray(pos, pos + PRF.outputLen); view.setInt32(0, ti, false); // F(Password, Salt, c, i) = U1 ^ U2 ^ ⋯ ^ Uc // U1 = PRF(Password, Salt + INT_32_BE(i)) (prfW = PRFSalt._cloneInto(prfW)).update(arr).digestInto(u); Ti.set(u.subarray(0, Ti.length)); for (let ui = 1; ui < c; ui++) { // Uc = PRF(Password, Uc−1) PRF._cloneInto(prfW).update(u).digestInto(u); for (let i = 0; i < Ti.length; i++) Ti[i] ^= u[i]; } } return pbkdf2Output(PRF, PRFSalt, DK, prfW, u); } // Polyfill for Safari 14 function setBigUint64(view, byteOffset, value, isLE) { if (typeof view.setBigUint64 === 'function') return view.setBigUint64(byteOffset, value, isLE); const _32n = BigInt(32); const _u32_max = BigInt(0xffffffff); const wh = Number(value >> _32n & _u32_max); const wl = Number(value & _u32_max); const h = isLE ? 4 : 0; const l = isLE ? 0 : 4; view.setUint32(byteOffset + h, wh, isLE); view.setUint32(byteOffset + l, wl, isLE); } // Base SHA2 class (RFC 6234) class SHA2 extends Hash { constructor(blockLen, outputLen, padOffset, isLE) { super(); this.blockLen = blockLen; this.outputLen = outputLen; this.padOffset = padOffset; this.isLE = isLE; this.finished = false; this.length = 0; this.pos = 0; this.destroyed = false; this.buffer = new Uint8Array(blockLen); this.view = createView(this.buffer); } update(data) { exists(this); const { view, buffer, blockLen } = this; data = toBytes(data); const len = data.length; for (let pos = 0; pos < len;) { const take = Math.min(blockLen - this.pos, len - pos); // Fast path: we have at least one block in input, cast it to view and process if (take === blockLen) { const dataView = createView(data); for (; blockLen <= len - pos; pos += blockLen) this.process(dataView, pos); continue; } buffer.set(data.subarray(pos, pos + take), this.pos); this.pos += take; pos += take; if (this.pos === blockLen) { this.process(view, 0); this.pos = 0; } } this.length += data.length; this.roundClean(); return this; } digestInto(out) { exists(this); output(out, this); this.finished = true; // Padding // We can avoid allocation of buffer for padding completely if it // was previously not allocated here. But it won't change performance. const { buffer, view, blockLen, isLE } = this; let { pos } = this; // append the bit '1' to the message buffer[pos++] = 0b10000000; this.buffer.subarray(pos).fill(0); // we have less than padOffset left in buffer, so we cannot put length in current block, need process it and pad again if (this.padOffset > blockLen - pos) { this.process(view, 0); pos = 0; } // Pad until full block byte with zeros for (let i = pos; i < blockLen; i++) buffer[i] = 0; // Note: sha512 requires length to be 128bit integer, but length in JS will overflow before that // You need to write around 2 exabytes (u64_max / 8 / (1024**6)) for this to happen. // So we just write lowest 64 bits of that value. setBigUint64(view, blockLen - 8, BigInt(this.length * 8), isLE); this.process(view, 0); const oview = createView(out); const len = this.outputLen; // NOTE: we do division by 4 later, which should be fused in single op with modulo by JIT if (len % 4) throw new Error('_sha2: outputLen should be aligned to 32bit'); const outLen = len / 4; const state = this.get(); if (outLen > state.length) throw new Error('_sha2: outputLen bigger than state'); for (let i = 0; i < outLen; i++) oview.setUint32(4 * i, state[i], isLE); } digest() { const { buffer, outputLen } = this; this.digestInto(buffer); const res = buffer.slice(0, outputLen); this.destroy(); return res; } _cloneInto(to) { to || (to = new this.constructor()); to.set(...this.get()); const { blockLen, buffer, length, finished, destroyed, pos } = this; to.length = length; to.pos = pos; to.finished = finished; to.destroyed = destroyed; if (length % blockLen) to.buffer.set(buffer); return to; } } // SHA2-256 need to try 2^128 hashes to execute birthday attack. // BTC network is doing 2^67 hashes/sec as per early 2023. // Choice: a ? b : c const Chi = (a, b, c) => a & b ^ ~a & c; // Majority function, true if any two inpust is true const Maj = (a, b, c) => a & b ^ a & c ^ b & c; // Round constants: // first 32 bits of the fractional parts of the cube roots of the first 64 primes 2..311) // prettier-ignore const SHA256_K = /* @__PURE__ */new Uint32Array([0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2]); // Initial state (first 32 bits of the fractional parts of the square roots of the first 8 primes 2..19): // prettier-ignore const IV = /* @__PURE__ */new Uint32Array([0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19]); // Temporary buffer, not used to store anything between runs // Named this way because it matches specification. const SHA256_W = /* @__PURE__ */new Uint32Array(64); class SHA256 extends SHA2 { constructor() { super(64, 32, 8, false); // We cannot use array here since array allows indexing by variable // which means optimizer/compiler cannot use registers. this.A = IV[0] | 0; this.B = IV[1] | 0; this.C = IV[2] | 0; this.D = IV[3] | 0; this.E = IV[4] | 0; this.F = IV[5] | 0; this.G = IV[6] | 0; this.H = IV[7] | 0; } get() { const { A, B, C, D, E, F, G, H } = this; return [A, B, C, D, E, F, G, H]; } // prettier-ignore set(A, B, C, D, E, F, G, H) { this.A = A | 0; this.B = B | 0; this.C = C | 0; this.D = D | 0; this.E = E | 0; this.F = F | 0; this.G = G | 0; this.H = H | 0; } process(view, offset) { // Extend the first 16 words into the remaining 48 words w[16..63] of the message schedule array for (let i = 0; i < 16; i++, offset += 4) SHA256_W[i] = view.getUint32(offset, false); for (let i = 16; i < 64; i++) { const W15 = SHA256_W[i - 15]; const W2 = SHA256_W[i - 2]; const s0 = rotr(W15, 7) ^ rotr(W15, 18) ^ W15 >>> 3; const s1 = rotr(W2, 17) ^ rotr(W2, 19) ^ W2 >>> 10; SHA256_W[i] = s1 + SHA256_W[i - 7] + s0 + SHA256_W[i - 16] | 0; } // Compression function main loop, 64 rounds let { A, B, C, D, E, F, G, H } = this; for (let i = 0; i < 64; i++) { const sigma1 = rotr(E, 6) ^ rotr(E, 11) ^ rotr(E, 25); const T1 = H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i] | 0; const sigma0 = rotr(A, 2) ^ rotr(A, 13) ^ rotr(A, 22); const T2 = sigma0 + Maj(A, B, C) | 0; H = G; G = F; F = E; E = D + T1 | 0; D = C; C = B; B = A; A = T1 + T2 | 0; } // Add the compressed chunk to the current hash value A = A + this.A | 0; B = B + this.B | 0; C = C + this.C | 0; D = D + this.D | 0; E = E + this.E | 0; F = F + this.F | 0; G = G + this.G | 0; H = H + this.H | 0; this.set(A, B, C, D, E, F, G, H); } roundClean() { SHA256_W.fill(0); } destroy() { this.set(0, 0, 0, 0, 0, 0, 0, 0); this.buffer.fill(0); } } /** * SHA2-256 hash function * @param message - data that would be hashed */ const sha256$1 = /* @__PURE__ */wrapConstructor(() => new SHA256()); const U32_MASK64 = /* @__PURE__ */BigInt(2 ** 32 - 1); const _32n = /* @__PURE__ */BigInt(32); // We are not using BigUint64Array, because they are extremely slow as per 2022 function fromBig(n, le = false) { if (le) return { h: Number(n & U32_MASK64), l: Number(n >> _32n & U32_MASK64) }; return { h: Number(n >> _32n & U32_MASK64) | 0, l: Number(n & U32_MASK64) | 0 }; } function split$1(lst, le = false) { let Ah = new Uint32Array(lst.length); let Al = new Uint32Array(lst.length); for (let i = 0; i < lst.length; i++) { const { h, l } = fromBig(lst[i], le); [Ah[i], Al[i]] = [h, l]; } return [Ah, Al]; } const toBig = (h, l) => BigInt(h >>> 0) << _32n | BigInt(l >>> 0); // for Shift in [0, 32) const shrSH = (h, _l, s) => h >>> s; const shrSL = (h, l, s) => h << 32 - s | l >>> s; // Right rotate for Shift in [1, 32) const rotrSH = (h, l, s) => h >>> s | l << 32 - s; const rotrSL = (h, l, s) => h << 32 - s | l >>> s; // Right rotate for Shift in (32, 64), NOTE: 32 is special case. const rotrBH = (h, l, s) => h << 64 - s | l >>> s - 32; const rotrBL = (h, l, s) => h >>> s - 32 | l << 64 - s; // Right rotate for shift===32 (just swaps l&h) const rotr32H = (_h, l) => l; const rotr32L = (h, _l) => h; // Left rotate for Shift in [1, 32) const rotlSH = (h, l, s) => h << s | l >>> 32 - s; const rotlSL = (h, l, s) => l << s | h >>> 32 - s; // Left rotate for Shift in (32, 64), NOTE: 32 is special case. const rotlBH = (h, l, s) => l << s - 32 | h >>> 64 - s; const rotlBL = (h, l, s) => h << s - 32 | l >>> 64 - s; // JS uses 32-bit signed integers for bitwise operations which means we cannot // simple take carry out of low bit sum by shift, we need to use division. function add(Ah, Al, Bh, Bl) { const l = (Al >>> 0) + (Bl >>> 0); return { h: Ah + Bh + (l / 2 ** 32 | 0) | 0, l: l | 0 }; } // Addition with more than 2 elements const add3L = (Al, Bl, Cl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0); const add3H = (low, Ah, Bh, Ch) => Ah + Bh + Ch + (low / 2 ** 32 | 0) | 0; const add4L = (Al, Bl, Cl, Dl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0); const add4H = (low, Ah, Bh, Ch, Dh) => Ah + Bh + Ch + Dh + (low / 2 ** 32 | 0) | 0; const add5L = (Al, Bl, Cl, Dl, El) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0) + (El >>> 0); const add5H = (low, Ah, Bh, Ch, Dh, Eh) => Ah + Bh + Ch + Dh + Eh + (low / 2 ** 32 | 0) | 0; // prettier-ignore const u64 = { fromBig, split: split$1, toBig, shrSH, shrSL, rotrSH, rotrSL, rotrBH, rotrBL, rotr32H, rotr32L, rotlSH, rotlSL, rotlBH, rotlBL, add, add3L, add3H, add4L, add4H, add5H, add5L }; // Round contants (first 32 bits of the fractional parts of the cube roots of the first 80 primes 2..409): // prettier-ignore const [SHA512_Kh, SHA512_Kl] = /* @__PURE__ */(() => u64.split(['0x428a2f98d728ae22', '0x7137449123ef65cd', '0xb5c0fbcfec4d3b2f', '0xe9b5dba58189dbbc', '0x3956c25bf348b538', '0x59f111f1b605d019', '0x923f82a4af194f9b', '0xab1c5ed5da6d8118', '0xd807aa98a3030242', '0x12835b0145706fbe', '0x243185be4ee4b28c', '0x550c7dc3d5ffb4e2', '0x72be5d74f27b896f', '0x80deb1fe3b1696b1', '0x9bdc06a725c71235', '0xc19bf174cf692694', '0xe49b69c19ef14ad2', '0xefbe4786384f25e3', '0x0fc19dc68b8cd5b5', '0x240ca1cc77ac9c65', '0x2de92c6f592b0275', '0x4a7484aa6ea6e483', '0x5cb0a9dcbd41fbd4', '0x76f988da831153b5', '0x983e5152ee66dfab', '0xa831c66d2db43210', '0xb00327c898fb213f', '0xbf597fc7beef0ee4', '0xc6e00bf33da88fc2', '0xd5a79147930aa725', '0x06ca6351e003826f', '0x142929670a0e6e70', '0x27b70a8546d22ffc', '0x2e1b21385c26c926', '0x4d2c6dfc5ac42aed', '0x53380d139d95b3df', '0x650a73548baf63de', '0x766a0abb3c77b2a8', '0x81c2c92e47edaee6', '0x92722c851482353b', '0xa2bfe8a14cf10364', '0xa81a664bbc423001', '0xc24b8b70d0f89791', '0xc76c51a30654be30', '0xd192e819d6ef5218', '0xd69906245565a910', '0xf40e35855771202a', '0x106aa07032bbd1b8', '0x19a4c116b8d2d0c8', '0x1e376c085141ab53', '0x2748774cdf8eeb99', '0x34b0bcb5e19b48a8', '0x391c0cb3c5c95a63', '0x4ed8aa4ae3418acb', '0x5b9cca4f7763e373', '0x682e6ff3d6b2b8a3', '0x748f82ee5defb2fc', '0x78a5636f43172f60', '0x84c87814a1f0ab72', '0x8cc702081a6439ec', '0x90befffa23631e28', '0xa4506cebde82bde9', '0xbef9a3f7b2c67915', '0xc67178f2e372532b', '0xca273eceea26619c', '0xd186b8c721c0c207', '0xeada7dd6cde0eb1e', '0xf57d4f7fee6ed178', '0x06f067aa72176fba', '0x0a637dc5a2c898a6', '0x113f9804bef90dae', '0x1b710b35131c471b', '0x28db77f523047d84', '0x32caab7b40c72493', '0x3c9ebe0a15c9bebc', '0x431d67c49c100d4c', '0x4cc5d4becb3e42b6', '0x597f299cfc657e2a', '0x5fcb6fab3ad6faec', '0x6c44198c4a475817'].map(n => BigInt(n))))(); // Temporary buffer, not used to store anything between runs const SHA512_W_H = /* @__PURE__ */new Uint32Array(80); const SHA512_W_L = /* @__PURE__ */new Uint32Array(80); class SHA512 extends SHA2 { constructor() { super(128, 64, 16, false); // We cannot use array here since array allows indexing by variable which means optimizer/compiler cannot use registers. // Also looks cleaner and easier to verify with spec. // Initial state (first 32 bits of the fractional parts of the square roots of the first 8 primes 2..19): // h -- high 32 bits, l -- low 32 bits this.Ah = 0x6a09e667 | 0; this.Al = 0xf3bcc908 | 0; this.Bh = 0xbb67ae85 | 0; this.Bl = 0x84caa73b | 0; this.Ch = 0x3c6ef372 | 0; this.Cl = 0xfe94f82b | 0; this.Dh = 0xa54ff53a | 0; this.Dl = 0x5f1d36f1 | 0; this.Eh = 0x510e527f | 0; this.El = 0xade682d1 | 0; this.Fh = 0x9b05688c | 0; this.Fl = 0x2b3e6c1f | 0; this.Gh = 0x1f83d9ab | 0; this.Gl = 0xfb41bd6b | 0; this.Hh = 0x5be0cd19 | 0; this.Hl = 0x137e2179 | 0; } // prettier-ignore get() { const { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this; return [Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl]; } // prettier-ignore set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl) { this.Ah = Ah | 0; this.Al = Al | 0; this.Bh = Bh | 0; this.Bl = Bl | 0; this.Ch = Ch | 0; this.Cl = Cl | 0; this.Dh = Dh | 0; this.Dl = Dl | 0; this.Eh = Eh | 0; this.El = El | 0; this.Fh = Fh | 0; this.Fl = Fl | 0; this.Gh = Gh | 0; this.Gl = Gl | 0; this.Hh = Hh | 0; this.Hl = Hl | 0; } process(view, offset) { // Extend the first 16 words into the remaining 64 words w[16..79] of the message schedule array for (let i = 0; i < 16; i++, offset += 4) { SHA512_W_H[i] = view.getUint32(offset); SHA512_W_L[i] = view.getUint32(offset += 4); } for (let i = 16; i < 80; i++) { // s0 := (w[i-15] rightrotate 1) xor (w[i-15] rightrotate 8) xor (w[i-15] rightshift 7) const W15h = SHA512_W_H[i - 15] | 0; const W15l = SHA512_W_L[i - 15] | 0; const s0h = u64.rotrSH(W15h, W15l, 1) ^ u64.rotrSH(W15h, W15l, 8) ^ u64.shrSH(W15h, W15l, 7); const s0l = u64.rotrSL(W15h, W15l, 1) ^ u64.rotrSL(W15h, W15l, 8) ^ u64.shrSL(W15h, W15l, 7); // s1 := (w[i-2] rightrotate 19) xor (w[i-2] rightrotate 61) xor (w[i-2] rightshift 6) const W2h = SHA512_W_H[i - 2] | 0; const W2l = SHA512_W_L[i - 2] | 0; const s1h = u64.rotrSH(W2h, W2l, 19) ^ u64.rotrBH(W2h, W2l, 61) ^ u64.shrSH(W2h, W2l, 6); const s1l = u64.rotrSL(W2h, W2l, 19) ^ u64.rotrBL(W2h, W2l, 61) ^ u64.shrSL(W2h, W2l, 6); // SHA256_W[i] = s0 + s1 + SHA256_W[i - 7] + SHA256_W[i - 16]; const SUMl = u64.add4L(s0l, s1l, SHA512_W_L[i - 7], SHA512_W_L[i - 16]); const SUMh = u64.add4H(SUMl, s0h, s1h, SHA512_W_H[i - 7], SHA512_W_H[i - 16]); SHA512_W_H[i] = SUMh | 0; SHA512_W_L[i] = SUMl | 0; } let { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this; // Compression function main loop, 80 rounds for (let i = 0; i < 80; i++) { // S1 := (e rightrotate 14) xor (e rightrotate 18) xor (e rightrotate 41) const sigma1h = u64.rotrSH(Eh, El, 14) ^ u64.rotrSH(Eh, El, 18) ^ u64.rotrBH(Eh, El, 41); const sigma1l = u64.rotrSL(Eh, El, 14) ^ u64.rotrSL(Eh, El, 18) ^ u64.rotrBL(Eh, El, 41); //const T1 = (H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i]) | 0; const CHIh = Eh & Fh ^ ~Eh & Gh; const CHIl = El & Fl ^ ~El & Gl; // T1 = H + sigma1 + Chi(E, F, G) + SHA512_K[i] + SHA512_W[i] // prettier-ignore const T1ll = u64.add5L(Hl, sigma1l, CHIl, SHA512_Kl[i], SHA512_W_L[i]); const T1h = u64.add5H(T1ll, Hh, sigma1h, CHIh, SHA512_Kh[i], SHA512_W_H[i]); const T1l = T1ll | 0; // S0 := (a rightrotate 28) xor (a rightrotate 34) xor (a rightrotate 39) const sigma0h = u64.rotrSH(Ah, Al, 28) ^ u64.rotrBH(Ah, Al, 34) ^ u64.rotrBH(Ah, Al, 39); const sigma0l = u64.rotrSL(Ah, Al, 28) ^ u64.rotrBL(Ah, Al, 34) ^ u64.rotrBL(Ah, Al, 39); const MAJh = Ah & Bh ^ Ah & Ch ^ Bh & Ch; const MAJl = Al & Bl ^ Al & Cl ^ Bl & Cl; Hh = Gh | 0; Hl = Gl | 0; Gh = Fh | 0; Gl = Fl | 0; Fh = Eh | 0; Fl = El | 0; ({ h: Eh, l: El } = u64.add(Dh | 0, Dl | 0, T1h | 0, T1l | 0)); Dh = Ch | 0; Dl = Cl | 0; Ch = Bh | 0; Cl = Bl | 0; Bh = Ah | 0; Bl = Al | 0; const All = u64.add3L(T1l, sigma0l, MAJl); Ah = u64.add3H(All, T1h, sigma0h, MAJh); Al = All | 0; } // Add the compressed chunk to the current hash value ({ h: Ah, l: Al } = u64.add(this.Ah | 0, this.Al | 0, Ah | 0, Al | 0)); ({ h: Bh, l: Bl } = u64.add(this.Bh | 0, this.Bl | 0, Bh | 0, Bl | 0)); ({ h: Ch, l: Cl } = u64.add(this.Ch | 0, this.Cl | 0, Ch | 0, Cl | 0)); ({ h: Dh, l: Dl } = u64.add(this.Dh | 0, this.Dl | 0, Dh | 0, Dl | 0)); ({ h: Eh, l: El } = u64.add(this.Eh | 0, this.El | 0, Eh | 0, El | 0)); ({ h: Fh, l: Fl } = u64.add(this.Fh | 0, this.Fl | 0, Fh | 0, Fl | 0)); ({ h: Gh, l: Gl } = u64.add(this.Gh | 0, this.Gl | 0, Gh | 0, Gl | 0)); ({ h: Hh, l: Hl } = u64.add(this.Hh | 0, this.Hl | 0, Hh | 0, Hl | 0)); this.set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl); } roundClean() { SHA512_W_H.fill(0); SHA512_W_L.fill(0); } destroy() { this.buffer.fill(0); this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } } const sha512 = /* @__PURE__ */wrapConstructor(() => new SHA512()); /* Browser Crypto Shims */ function getGlobal() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } throw new Error('unable to locate global object'); } const anyGlobal = getGlobal(); const crypto = anyGlobal.crypto || anyGlobal.msCrypto; function createHash(algo) { switch (algo) { case "sha256": return sha256$1.create(); case "sha512": return sha512.create(); } assertArgument(false, "invalid hashing algorithm name", "algorithm", algo); } function createHmac(_algo, key) { const algo = { sha256: sha256$1, sha512 }[_algo]; assertArgument(algo != null, "invalid hmac algorithm", "algorithm", _algo); return hmac.create(algo, key); } function pbkdf2Sync(password, salt, iterations, keylen, _algo) { const algo = { sha256: sha256$1, sha512 }[_algo]; assertArgument(algo != null, "invalid pbkdf2 algorithm", "algorithm", _algo); return pbkdf2$1(algo, password, salt, { c: iterations, dkLen: keylen }); } function randomBytes$1(length) { assert(crypto != null, "platform does not support secure random numbers", "UNSUPPORTED_OPERATION", { operation: "randomBytes" }); assertArgument(Number.isInteger(length) && length > 0 && length <= 1024, "invalid length", "length", length); const result = new Uint8Array(length); crypto.getRandomValues(result); return result; } /** * An **HMAC** enables verification that a given key was used * to authenticate a payload. * * See: [[link-wiki-hmac]] * * @_subsection: api/crypto:HMAC [about-hmac] */ let locked$4 = false; const _computeHmac = function (algorithm, key, data) { return createHmac(algorithm, key).update(data).digest(); }; let __computeHmac = _computeHmac; /** * Return the HMAC for %%data%% using the %%key%% key with the underlying * %%algo%% used for compression. * * @example: * key = id("some-secret") * * // Compute the HMAC * computeHmac("sha256", key, "0x1337") * //_result: * * // To compute the HMAC of UTF-8 data, the data must be * // converted to UTF-8 bytes * computeHmac("sha256", key, toUtf8Bytes("Hello World")) * //_result: * */ function computeHmac(algorithm, _key, _data) { const key = getBytes(_key, "key"); const data = getBytes(_data, "data"); return hexlify(__computeHmac(algorithm, key, data)); } computeHmac._ = _computeHmac; computeHmac.lock = function () { locked$4 = true; }; computeHmac.register = function (func) { if (locked$4) { throw new Error("computeHmac is locked"); } __computeHmac = func; }; Object.freeze(computeHmac); // SHA3 (keccak) is based on a new design: basically, the internal state is bigger than output size. // It's called a sponge function. // Various per round constants calculations const [SHA3_PI, SHA3_ROTL, _SHA3_IOTA] = [[], [], []]; const _0n$4 = /* @__PURE__ */BigInt(0); const _1n$5 = /* @__PURE__ */BigInt(1); const _2n$3 = /* @__PURE__ */BigInt(2); const _7n = /* @__PURE__ */BigInt(7); const _256n = /* @__PURE__ */BigInt(256); const _0x71n = /* @__PURE__ */BigInt(0x71); for (let round = 0, R = _1n$5, x = 1, y = 0; round < 24; round++) { // Pi [x, y] = [y, (2 * x + 3 * y) % 5]; SHA3_PI.push(2 * (5 * y + x)); // Rotational SHA3_ROTL.push((round + 1) * (round + 2) / 2 % 64); // Iota let t = _0n$4; for (let j = 0; j < 7; j++) { R = (R << _1n$5 ^ (R >> _7n) * _0x71n) % _256n; if (R & _2n$3) t ^= _1n$5 << (_1n$5 << /* @__PURE__ */BigInt(j)) - _1n$5; } _SHA3_IOTA.push(t); } const [SHA3_IOTA_H, SHA3_IOTA_L] = /* @__PURE__ */split$1(_SHA3_IOTA, true); // Left rotation (without 0, 32, 64) const rotlH = (h, l, s) => s > 32 ? rotlBH(h, l, s) : rotlSH(h, l, s); const rotlL = (h, l, s) => s > 32 ? rotlBL(h, l, s) : rotlSL(h, l, s); // Same as keccakf1600, but allows to skip some rounds function keccakP(s, rounds = 24) { const B = new Uint32Array(5 * 2); // NOTE: all indices are x2 since we store state as u32 instead of u64 (bigints to slow in js) for (let round = 24 - rounds; round < 24; round++) { // Theta θ for (let x = 0; x < 10; x++) B[x] = s[x] ^ s[x + 10] ^ s[x + 20] ^ s[x + 30] ^ s[x + 40]; for (let x = 0; x < 10; x += 2) { const idx1 = (x + 8) % 10; const idx0 = (x + 2) % 10; const B0 = B[idx0]; const B1 = B[idx0 + 1]; const Th = rotlH(B0, B1, 1) ^ B[idx1]; const Tl = rotlL(B0, B1, 1) ^ B[idx1 + 1]; for (let y = 0; y < 50; y += 10) { s[x + y] ^= Th; s[x + y + 1] ^= Tl; } } // Rho (ρ) and Pi (π) let curH = s[2]; let curL = s[3]; for (let t = 0; t < 24; t++) { const shift = SHA3_ROTL[t]; const Th = rotlH(curH, curL, shift); const Tl = rotlL(curH, curL, shift); const PI = SHA3_PI[t]; curH = s[PI]; curL = s[PI + 1]; s[PI] = Th; s[PI + 1] = Tl; } // Chi (χ) for (let y = 0; y < 50; y += 10) { for (let x = 0; x < 10; x++) B[x] = s[y + x]; for (let x = 0; x < 10; x++) s[y + x] ^= ~B[(x + 2) % 10] & B[(x + 4) % 10]; } // Iota (ι) s[0] ^= SHA3_IOTA_H[round]; s[1] ^= SHA3_IOTA_L[round]; } B.fill(0); } class Keccak extends Hash { // NOTE: we accept arguments in bytes instead of bits here. constructor(blockLen, suffix, outputLen, enableXOF = false, rounds = 24) { super(); this.blockLen = blockLen; this.suffix = suffix; this.outputLen = outputLen; this.enableXOF = enableXOF; this.rounds = rounds; this.pos = 0; this.posOut = 0; this.finished = false; this.destroyed = false; // Can be passed from user as dkLen number(outputLen); // 1600 = 5x5 matrix of 64bit. 1600 bits === 200 bytes if (0 >= this.blockLen || this.blockLen >= 200) throw new Error('Sha3 supports only keccak-f1600 function'); this.state = new Uint8Array(200); this.state32 = u32(this.state); } keccak() { keccakP(this.state32, this.rounds); this.posOut = 0; this.pos = 0; } update(data) { exists(this); const { blockLen, state } = this; data = toBytes(data); const len = data.length; for (let pos = 0; pos < len;) { const take = Math.min(blockLen - this.pos, len - pos); for (let i = 0; i < take; i++) state[this.pos++] ^= data[pos++]; if (this.pos === blockLen) this.keccak(); } return this; } finish() { if (this.finished) return; this.finished = true; const { state, suffix, pos, blockLen } = this; // Do the padding state[pos] ^= suffix; if ((suffix & 0x80) !== 0 && pos === blockLen - 1) this.keccak(); state[blockLen - 1] ^= 0x80; this.keccak(); } writeInto(out) { exists(this, false); bytes(out); this.finish(); const bufferOut = this.state; const { blockLen } = this; for (let pos = 0, len = out.length; pos < len;) { if (this.posOut >= blockLen) this.keccak(); const take = Math.min(blockLen - this.posOut, len - pos); out.set(bufferOut.subarray(this.posOut, this.posOut + take), pos); this.posOut += take; pos += take; } return out; } xofInto(out) { // Sha3/Keccak usage with XOF is probably mistake, only SHAKE instances can do XOF if (!this.enableXOF) throw new Error('XOF is not possible for this instance'); return this.writeInto(out); } xof(bytes) { number(bytes); return this.xofInto(new Uint8Array(bytes)); } digestInto(out) { output(out, this); if (this.finished) throw new Error('digest() was already called'); this.writeInto(out); this.destroy(); return out; } digest() { return this.digestInto(new Uint8Array(this.outputLen)); } destroy() { this.destroyed = true; this.state.fill(0); } _cloneInto(to) { const { blockLen, suffix, outputLen, rounds, enableXOF } = this; to || (to = new Keccak(blockLen, suffix, outputLen, enableXOF, rounds)); to.state32.set(this.state32); to.pos = this.pos; to.posOut = this.posOut; to.finished = this.finished; to.rounds = rounds; // Suffix can change in cSHAKE to.suffix = suffix; to.outputLen = outputLen; to.enableXOF = enableXOF; to.destroyed = this.destroyed; return to; } } const gen = (suffix, blockLen, outputLen) => wrapConstructor(() => new Keccak(blockLen, suffix, outputLen)); /** * keccak-256 hash function. Different from SHA3-256. * @param message - that would be hashed */ const keccak_256 = /* @__PURE__ */gen(0x01, 136, 256 / 8); /** * Cryptographic hashing functions * * @_subsection: api/crypto:Hash Functions [about-crypto-hashing] */ let locked$3 = false; const _keccak256 = function (data) { return keccak_256(data); }; let __keccak256 = _keccak256; /** * Compute the cryptographic KECCAK256 hash of %%data%%. * * The %%data%% **must** be a data representation, to compute the * hash of UTF-8 data use the [[id]] function. * * @returns DataHexstring * @example: * keccak256("0x") * //_result: * * keccak256("0x1337") * //_result: * * keccak256(new Uint8Array([ 0x13, 0x37 ])) * //_result: * * // Strings are assumed to be DataHexString, otherwise it will * // throw. To hash UTF-8 data, see the note above. * keccak256("Hello World") * //_error: */ function keccak256(_data) { const data = getBytes(_data, "data"); return hexlify(__keccak256(data)); } keccak256._ = _keccak256; keccak256.lock = function () { locked$3 = true; }; keccak256.register = function (func) { if (locked$3) { throw new TypeError("keccak256 is locked"); } __keccak256 = func; }; Object.freeze(keccak256); // https://homes.esat.kuleuven.be/~bosselae/ripemd160.html // https://homes.esat.kuleuven.be/~bosselae/ripemd160/pdf/AB-9601/AB-9601.pdf const Rho = /* @__PURE__ */new Uint8Array([7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8]); const Id = /* @__PURE__ */Uint8Array.from({ length: 16 }, (_, i) => i); const Pi = /* @__PURE__ */Id.map(i => (9 * i + 5) % 16); let idxL = [Id]; let idxR = [Pi]; for (let i = 0; i < 4; i++) for (let j of [idxL, idxR]) j.push(j[i].map(k => Rho[k])); const shifts = /* @__PURE__ */[[11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8], [12, 13, 11, 15, 6, 9, 9, 7, 12, 15, 11, 13, 7, 8, 7, 7], [13, 15, 14, 11, 7, 7, 6, 8, 13, 14, 13, 12, 5, 5, 6, 9], [14, 11, 12, 14, 8, 6, 5, 5, 15, 12, 15, 14, 9, 9, 8, 6], [15, 12, 13, 13, 9, 5, 8, 6, 14, 11, 12, 11, 8, 6, 5, 5]].map(i => new Uint8Array(i)); const shiftsL = /* @__PURE__ */idxL.map((idx, i) => idx.map(j => shifts[i][j])); const shiftsR = /* @__PURE__ */idxR.map((idx, i) => idx.map(j => shifts[i][j])); const Kl = /* @__PURE__ */new Uint32Array([0x00000000, 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xa953fd4e]); const Kr = /* @__PURE__ */new Uint32Array([0x50a28be6, 0x5c4dd124, 0x6d703ef3, 0x7a6d76e9, 0x00000000]); // The rotate left (circular left shift) operation for uint32 const rotl$1 = (word, shift) => word << shift | word >>> 32 - shift; // It's called f() in spec. function f(group, x, y, z) { if (group === 0) return x ^ y ^ z;else if (group === 1) return x & y | ~x & z;else if (group === 2) return (x | ~y) ^ z;else if (group === 3) return x & z | y & ~z;else return x ^ (y | ~z); } // Temporary buffer, not used to store anything between runs const BUF = /* @__PURE__ */new Uint32Array(16); class RIPEMD160 extends SHA2 { constructor() { super(64, 20, 8, true); this.h0 = 0x67452301 | 0; this.h1 = 0xefcdab89 | 0; this.h2 = 0x98badcfe | 0; this.h3 = 0x10325476 | 0; this.h4 = 0xc3d2e1f0 | 0; } get() { const { h0, h1, h2, h3, h4 } = this; return [h0, h1, h2, h3, h4]; } set(h0, h1, h2, h3, h4) { this.h0 = h0 | 0; this.h1 = h1 | 0; this.h2 = h2 | 0; this.h3 = h3 | 0; this.h4 = h4 | 0; } process(view, offset) { for (let i = 0; i < 16; i++, offset += 4) BUF[i] = view.getUint32(offset, true); // prettier-ignore let al = this.h0 | 0, ar = al, bl = this.h1 | 0, br = bl, cl = this.h2 | 0, cr = cl, dl = this.h3 | 0, dr = dl, el = this.h4 | 0, er = el; // Instead of iterating 0 to 80, we split it into 5 groups // And use the groups in constants, functions, etc. Much simpler for (let group = 0; group < 5; group++) { const rGroup = 4 - group; const hbl = Kl[group], hbr = Kr[group]; // prettier-ignore const rl = idxL[group], rr = idxR[group]; // prettier-ignore const sl = shiftsL[group], sr = shiftsR[group]; // prettier-ignore for (let i = 0; i < 16; i++) { const tl = rotl$1(al + f(group, bl, cl, dl) + BUF[rl[i]] + hbl, sl[i]) + el | 0; al = el, el = dl, dl = rotl$1(cl, 10) | 0, cl = bl, bl = tl; // prettier-ignore } // 2 loops are 10% faster for (let i = 0; i < 16; i++) { const tr = rotl$1(ar + f(rGroup, br, cr, dr) + BUF[rr[i]] + hbr, sr[i]) + er | 0; ar = er, er = dr, dr = rotl$1(cr, 10) | 0, cr = br, br = tr; // prettier-ignore } } // Add the compressed chunk to the current hash value this.set(this.h1 + cl + dr | 0, this.h2 + dl + er | 0, this.h3 + el + ar | 0, this.h4 + al + br | 0, this.h0 + bl + cr | 0); } roundClean() { BUF.fill(0); } destroy() { this.destroyed = true; this.buffer.fill(0); this.set(0, 0, 0, 0, 0); } } /** * RIPEMD-160 - a hash function from 1990s. * @param message - msg that would be hashed */ const ripemd160$1 = /* @__PURE__ */wrapConstructor(() => new RIPEMD160()); let locked$2 = false; const _ripemd160 = function (data) { return ripemd160$1(data); }; let __ripemd160 = _ripemd160; /** * Compute the cryptographic RIPEMD-160 hash of %%data%%. * * @_docloc: api/crypto:Hash Functions * @returns DataHexstring * * @example: * ripemd160("0x") * //_result: * * ripemd160("0x1337") * //_result: * * ripemd160(new Uint8Array([ 0x13, 0x37 ])) * //_result: * */ function ripemd160(_data) { const data = getBytes(_data, "data"); return hexlify(__ripemd160(data)); } ripemd160._ = _ripemd160; ripemd160.lock = function () { locked$2 = true; }; ripemd160.register = function (func) { if (locked$2) { throw new TypeError("ripemd160 is locked"); } __ripemd160 = func; }; Object.freeze(ripemd160); /** * A **Password-Based Key-Derivation Function** is designed to create * a sequence of bytes suitible as a **key** from a human-rememberable * password. * * @_subsection: api/crypto:Passwords [about-pbkdf] */ let locked$1 = false; const _pbkdf2 = function (password, salt, iterations, keylen, algo) { return pbkdf2Sync(password, salt, iterations, keylen, algo); }; let __pbkdf2 = _pbkdf2; /** * Return the [[link-pbkdf2]] for %%keylen%% bytes for %%password%% using * the %%salt%% and using %%iterations%% of %%algo%%. * * This PBKDF is outdated and should not be used in new projects, but is * required to decrypt older files. * * @example: * // The password must be converted to bytes, and it is generally * // best practices to ensure the string has been normalized. Many * // formats explicitly indicate the normalization form to use. * password = "hello" * passwordBytes = toUtf8Bytes(password, "NFKC") * * salt = id("some-salt") * * // Compute the PBKDF2 * pbkdf2(passwordBytes, salt, 1024, 16, "sha256") * //_result: */ function pbkdf2(_password, _salt, iterations, keylen, algo) { const password = getBytes(_password, "password"); const salt = getBytes(_salt, "salt"); return hexlify(__pbkdf2(password, salt, iterations, keylen, algo)); } pbkdf2._ = _pbkdf2; pbkdf2.lock = function () { locked$1 = true; }; pbkdf2.register = function (func) { if (locked$1) { throw new Error("pbkdf2 is locked"); } __pbkdf2 = func; }; Object.freeze(pbkdf2); /** * A **Cryptographically Secure Random Value** is one that has been * generated with additional care take to prevent side-channels * from allowing others to detect it and prevent others from through * coincidence generate the same values. * * @_subsection: api/crypto:Random Values [about-crypto-random] */ let locked = false; const _randomBytes = function (length) { return new Uint8Array(randomBytes$1(length)); }; let __randomBytes = _randomBytes; /** * Return %%length%% bytes of cryptographically secure random data. * * @example: * randomBytes(8) * //_result: */ function randomBytes(length) { return __randomBytes(length); } randomBytes._ = _randomBytes; randomBytes.lock = function () { locked = true; }; randomBytes.register = function (func) { if (locked) { throw new Error("randomBytes is locked"); } __randomBytes = func; }; Object.freeze(randomBytes); // RFC 7914 Scrypt KDF // Left rotate for uint32 const rotl = (a, b) => a << b | a >>> 32 - b; // The main Scrypt loop: uses Salsa extensively. // Six versions of the function were tried, this is the fastest one. // prettier-ignore function XorAndSalsa(prev, pi, input, ii, out, oi) { // Based on https://cr.yp.to/salsa20.html // Xor blocks let y00 = prev[pi++] ^ input[ii++], y01 = prev[pi++] ^ input[ii++]; let y02 = prev[pi++] ^ input[ii++], y03 = prev[pi++] ^ input[ii++]; let y04 = prev[pi++] ^ input[ii++], y05 = prev[pi++] ^ input[ii++]; let y06 = prev[pi++] ^ input[ii++], y07 = prev[pi++] ^ input[ii++]; let y08 = prev[pi++] ^ input[ii++], y09 = prev[pi++] ^ input[ii++]; let y10 = prev[pi++] ^ input[ii++], y11 = prev[pi++] ^ input[ii++]; let y12 = prev[pi++] ^ input[ii++], y13 = prev[pi++] ^ input[ii++]; let y14 = prev[pi++] ^ input[ii++], y15 = prev[pi++] ^ input[ii++]; // Save state to temporary variables (salsa) let x00 = y00, x01 = y01, x02 = y02, x03 = y03, x04 = y04, x05 = y05, x06 = y06, x07 = y07, x08 = y08, x09 = y09, x10 = y10, x11 = y11, x12 = y12, x13 = y13, x14 = y14, x15 = y15; // Main loop (salsa) for (let i = 0; i < 8; i += 2) { x04 ^= rotl(x00 + x12 | 0, 7); x08 ^= rotl(x04 + x00 | 0, 9); x12 ^= rotl(x08 + x04 | 0, 13); x00 ^= rotl(x12 + x08 | 0, 18); x09 ^= rotl(x05 + x01 | 0, 7); x13 ^= rotl(x09 + x05 | 0, 9); x01 ^= rotl(x13 + x09 | 0, 13); x05 ^= rotl(x01 + x13 | 0, 18); x14 ^= rotl(x10 + x06 | 0, 7); x02 ^= rotl(x14 + x10 | 0, 9); x06 ^= rotl(x02 + x14 | 0, 13); x10 ^= rotl(x06 + x02 | 0, 18); x03 ^= rotl(x15 + x11 | 0, 7); x07 ^= rotl(x03 + x15 | 0, 9); x11 ^= rotl(x07 + x03 | 0, 13); x15 ^= rotl(x11 + x07 | 0, 18); x01 ^= rotl(x00 + x03 | 0, 7); x02 ^= rotl(x01 + x00 | 0, 9); x03 ^= rotl(x02 + x01 | 0, 13); x00 ^= rotl(x03 + x02 | 0, 18); x06 ^= rotl(x05 + x04 | 0, 7); x07 ^= rotl(x06 + x05 | 0, 9); x04 ^= rotl(x07 + x06 | 0, 13); x05 ^= rotl(x04 + x07 | 0, 18); x11 ^= rotl(x10 + x09 | 0, 7); x08 ^= rotl(x11 + x10 | 0, 9); x09 ^= rotl(x08 + x11 | 0, 13); x10 ^= rotl(x09 + x08 | 0, 18); x12 ^= rotl(x15 + x14 | 0, 7); x13 ^= rotl(x12 + x15 | 0, 9); x14 ^= rotl(x13 + x12 | 0, 13); x15 ^= rotl(x14 + x13 | 0, 18); } // Write output (salsa) out[oi++] = y00 + x00 | 0; out[oi++] = y01 + x01 | 0; out[oi++] = y02 + x02 | 0; out[oi++] = y03 + x03 | 0; out[oi++] = y04 + x04 | 0; out[oi++] = y05 + x05 | 0; out[oi++] = y06 + x06 | 0; out[oi++] = y07 + x07 | 0; out[oi++] = y08 + x08 | 0; out[oi++] = y09 + x09 | 0; out[oi++] = y10 + x10 | 0; out[oi++] = y11 + x11 | 0; out[oi++] = y12 + x12 | 0; out[oi++] = y13 + x13 | 0; out[oi++] = y14 + x14 | 0; out[oi++] = y15 + x15 | 0; } function BlockMix(input, ii, out, oi, r) { // The block B is r 128-byte chunks (which is equivalent of 2r 64-byte chunks) let head = oi + 0; let tail = oi + 16 * r; for (let i = 0; i < 16; i++) out[tail + i] = input[ii + (2 * r - 1) * 16 + i]; // X ← B[2r−1] for (let i = 0; i < r; i++, head += 16, ii += 16) { // We write odd & even Yi at same time. Even: 0bXXXXX0 Odd: 0bXXXXX1 XorAndSalsa(out, tail, input, ii, out, head); // head[i] = Salsa(blockIn[2*i] ^ tail[i-1]) if (i > 0) tail += 16; // First iteration overwrites tmp value in tail XorAndSalsa(out, head, input, ii += 16, out, tail); // tail[i] = Salsa(blockIn[2*i+1] ^ head[i]) } } // Common prologue and epilogue for sync/async functions function scryptInit(password, salt, _opts) { // Maxmem - 1GB+1KB by default const opts = checkOpts({ dkLen: 32, asyncTick: 10, maxmem: 1024 ** 3 + 1024 }, _opts); const { N, r, p, dkLen, asyncTick, maxmem, onProgress } = opts; number(N); number(r); number(p); number(dkLen); number(asyncTick); number(maxmem); if (onProgress !== undefined && typeof onProgress !== 'function') throw new Error('progressCb should be function'); const blockSize = 128 * r; const blockSize32 = blockSize / 4; if (N <= 1 || (N & N - 1) !== 0 || N >= 2 ** (blockSize / 8) || N > 2 ** 32) { // NOTE: we limit N to be less than 2**32 because of 32 bit variant of Integrify function // There is no JS engines that allows alocate more than 4GB per single Uint8Array for now, but can change in future. throw new Error('Scrypt: N must be larger than 1, a power of 2, less than 2^(128 * r / 8) and less than 2^32'); } if (p < 0 || p > (2 ** 32 - 1) * 32 / blockSize) { throw new Error('Scrypt: p must be a positive integer less than or equal to ((2^32 - 1) * 32) / (128 * r)'); } if (dkLen < 0 || dkLen > (2 ** 32 - 1) * 32) { throw new Error('Scrypt: dkLen should be positive integer less than or equal to (2^32 - 1) * 32'); } const memUsed = blockSize * (N + p); if (memUsed > maxmem) { throw new Error(`Scrypt: parameters too large, ${memUsed} (128 * r * (N + p)) > ${maxmem} (maxmem)`); } // [B0...Bp−1] ← PBKDF2HMAC-SHA256(Passphrase, Salt, 1, blockSize*ParallelizationFactor) // Since it has only one iteration there is no reason to use async variant const B = pbkdf2$1(sha256$1, password, salt, { c: 1, dkLen: blockSize * p }); const B32 = u32(B); // Re-used between parallel iterations. Array(iterations) of B const V = u32(new Uint8Array(blockSize * N)); const tmp = u32(new Uint8Array(blockSize)); let blockMixCb = () => {}; if (onProgress) { const totalBlockMix = 2 * N * p; // Invoke callback if progress changes from 10.01 to 10.02 // Allows to draw smooth progress bar on up to 8K screen const callbackPer = Math.max(Math.floor(totalBlockMix / 10000), 1); let blockMixCnt = 0; blockMixCb = () => { blockMixCnt++; if (onProgress && (!(blockMixCnt % callbackPer) || blockMixCnt === totalBlockMix)) onProgress(blockMixCnt / totalBlockMix); }; } return { N, r, p, dkLen, blockSize32, V, B32, B, tmp, blockMixCb, asyncTick }; } function scryptOutput(password, dkLen, B, V, tmp) { const res = pbkdf2$1(sha256$1, password, B, { c: 1, dkLen }); B.fill(0); V.fill(0); tmp.fill(0); return res; } /** * Scrypt KDF from RFC 7914. * @param password - pass * @param salt - salt * @param opts - parameters * - `N` is cpu/mem work factor (power of 2 e.g. 2**18) * - `r` is block size (8 is common), fine-tunes sequential memory read size and performance * - `p` is parallelization factor (1 is common) * - `dkLen` is output key length in bytes e.g. 32. * - `asyncTick` - (default: 10) max time in ms for which async function can block execution * - `maxmem` - (default: `1024 ** 3 + 1024` aka 1GB+1KB). A limit that the app could use for scrypt * - `onProgress` - callback function that would be executed for progress report * @returns Derived key */ function scrypt$1(password, salt, opts) { const { N, r, p, dkLen, blockSize32, V, B32, B, tmp, blockMixCb } = scryptInit(password, salt, opts); for (let pi = 0; pi < p; pi++) { const Pi = blockSize32 * pi; for (let i = 0; i < blockSize32; i++) V[i] = B32[Pi + i]; // V[0] = B[i] for (let i = 0, pos = 0; i < N - 1; i++) { BlockMix(V, pos, V, pos += blockSize32, r); // V[i] = BlockMix(V[i-1]); blockMixCb(); } BlockMix(V, (N - 1) * blockSize32, B32, Pi, r); // Process last element blockMixCb(); for (let i = 0; i < N; i++) { // First u32 of the last 64-byte block (u32 is LE) const j = B32[Pi + blockSize32 - 16] % N; // j = Integrify(X) % iterations for (let k = 0; k < blockSize32; k++) tmp[k] = B32[Pi + k] ^ V[j * blockSize32 + k]; // tmp = B ^ V[j] BlockMix(tmp, 0, B32, Pi, r); // B = BlockMix(B ^ V[j]) blockMixCb(); } } return scryptOutput(password, dkLen, B, V, tmp); } /** * Scrypt KDF from RFC 7914. */ async function scryptAsync(password, salt, opts) { const { N, r, p, dkLen, blockSize32, V, B32, B, tmp, blockMixCb, asyncTick } = scryptInit(password, salt, opts); for (let pi = 0; pi < p; pi++) { const Pi = blockSize32 * pi; for (let i = 0; i < blockSize32; i++) V[i] = B32[Pi + i]; // V[0] = B[i] let pos = 0; await asyncLoop(N - 1, asyncTick, () => { BlockMix(V, pos, V, pos += blockSize32, r); // V[i] = BlockMix(V[i-1]); blockMixCb(); }); BlockMix(V, (N - 1) * blockSize32, B32, Pi, r); // Process last element blockMixCb(); await asyncLoop(N, asyncTick, () => { // First u32 of the last 64-byte block (u32 is LE) const j = B32[Pi + blockSize32 - 16] % N; // j = Integrify(X) % iterations for (let k = 0; k < blockSize32; k++) tmp[k] = B32[Pi + k] ^ V[j * blockSize32 + k]; // tmp = B ^ V[j] BlockMix(tmp, 0, B32, Pi, r); // B = BlockMix(B ^ V[j]) blockMixCb(); }); } return scryptOutput(password, dkLen, B, V, tmp); } let lockedSync = false, lockedAsync = false; const _scryptAsync = async function (passwd, salt, N, r, p, dkLen, onProgress) { return await scryptAsync(passwd, salt, { N, r, p, dkLen, onProgress }); }; const _scryptSync = function (passwd, salt, N, r, p, dkLen) { return scrypt$1(passwd, salt, { N, r, p, dkLen }); }; let __scryptAsync = _scryptAsync; let __scryptSync = _scryptSync; /** * The [[link-wiki-scrypt]] uses a memory and cpu hard method of * derivation to increase the resource cost to brute-force a password * for a given key. * * This means this algorithm is intentionally slow, and can be tuned to * become slower. As computation and memory speed improve over time, * increasing the difficulty maintains the cost of an attacker. * * For example, if a target time of 5 seconds is used, a legitimate user * which knows their password requires only 5 seconds to unlock their * account. A 6 character password has 68 billion possibilities, which * would require an attacker to invest over 10,000 years of CPU time. This * is of course a crude example (as password generally aren't random), * but demonstrates to value of imposing large costs to decryption. * * For this reason, if building a UI which involved decrypting or * encrypting datsa using scrypt, it is recommended to use a * [[ProgressCallback]] (as event short periods can seem lik an eternity * if the UI freezes). Including the phrase //"decrypting"// in the UI * can also help, assuring the user their waiting is for a good reason. * * @_docloc: api/crypto:Passwords * * @example: * // The password must be converted to bytes, and it is generally * // best practices to ensure the string has been normalized. Many * // formats explicitly indicate the normalization form to use. * password = "hello" * passwordBytes = toUtf8Bytes(password, "NFKC") * * salt = id("some-salt") * * // Compute the scrypt * scrypt(passwordBytes, salt, 1024, 8, 1, 16) * //_result: */ async function scrypt(_passwd, _salt, N, r, p, dkLen, progress) { const passwd = getBytes(_passwd, "passwd"); const salt = getBytes(_salt, "salt"); return hexlify(await __scryptAsync(passwd, salt, N, r, p, dkLen, progress)); } scrypt._ = _scryptAsync; scrypt.lock = function () { lockedAsync = true; }; scrypt.register = function (func) { if (lockedAsync) { throw new Error("scrypt is locked"); } __scryptAsync = func; }; Object.freeze(scrypt); /** * Provides a synchronous variant of [[scrypt]]. * * This will completely lock up and freeze the UI in a browser and will * prevent any event loop from progressing. For this reason, it is * preferred to use the [async variant](scrypt). * * @_docloc: api/crypto:Passwords * * @example: * // The password must be converted to bytes, and it is generally * // best practices to ensure the string has been normalized. Many * // formats explicitly indicate the normalization form to use. * password = "hello" * passwordBytes = toUtf8Bytes(password, "NFKC") * * salt = id("some-salt") * * // Compute the scrypt * scryptSync(passwordBytes, salt, 1024, 8, 1, 16) * //_result: */ function scryptSync(_passwd, _salt, N, r, p, dkLen) { const passwd = getBytes(_passwd, "passwd"); const salt = getBytes(_salt, "salt"); return hexlify(__scryptSync(passwd, salt, N, r, p, dkLen)); } scryptSync._ = _scryptSync; scryptSync.lock = function () { lockedSync = true; }; scryptSync.register = function (func) { if (lockedSync) { throw new Error("scryptSync is locked"); } __scryptSync = func; }; Object.freeze(scryptSync); const _sha256 = function (data) { return createHash("sha256").update(data).digest(); }; let __sha256 = _sha256; let locked256 = false; /** * Compute the cryptographic SHA2-256 hash of %%data%%. * * @_docloc: api/crypto:Hash Functions * @returns DataHexstring * * @example: * sha256("0x") * //_result: * * sha256("0x1337") * //_result: * * sha256(new Uint8Array([ 0x13, 0x37 ])) * //_result: * */ function sha256(_data) { const data = getBytes(_data, "data"); return hexlify(__sha256(data)); } sha256._ = _sha256; sha256.lock = function () { locked256 = true; }; sha256.register = function (func) { if (locked256) { throw new Error("sha256 is locked"); } __sha256 = func; }; Object.freeze(sha256); Object.freeze(sha256); /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ // 100 lines of code in the file are duplicated from noble-hashes (utils). // This is OK: `abstract` directory does not use noble-hashes. // User may opt-in into using different hashing library. This way, noble-hashes // won't be included into their bundle. const _0n$3 = BigInt(0); const _1n$4 = BigInt(1); const _2n$2 = BigInt(2); const u8a = a => a instanceof Uint8Array; const hexes = /* @__PURE__ */Array.from({ length: 256 }, (_, i) => i.toString(16).padStart(2, '0')); /** * @example bytesToHex(Uint8Array.from([0xca, 0xfe, 0x01, 0x23])) // 'cafe0123' */ function bytesToHex(bytes) { if (!u8a(bytes)) throw new Error('Uint8Array expected'); // pre-caching improves the speed 6x let hex = ''; for (let i = 0; i < bytes.length; i++) { hex += hexes[bytes[i]]; } return hex; } function numberToHexUnpadded(num) { const hex = num.toString(16); return hex.length & 1 ? `0${hex}` : hex; } function hexToNumber(hex) { if (typeof hex !== 'string') throw new Error('hex string expected, got ' + typeof hex); // Big Endian return BigInt(hex === '' ? '0' : `0x${hex}`); } /** * @example hexToBytes('cafe0123') // Uint8Array.from([0xca, 0xfe, 0x01, 0x23]) */ function hexToBytes(hex) { if (typeof hex !== 'string') throw new Error('hex string expected, got ' + typeof hex); const len = hex.length; if (len % 2) throw new Error('padded hex string expected, got unpadded hex of length ' + len); const array = new Uint8Array(len / 2); for (let i = 0; i < array.length; i++) { const j = i * 2; const hexByte = hex.slice(j, j + 2); const byte = Number.parseInt(hexByte, 16); if (Number.isNaN(byte) || byte < 0) throw new Error('Invalid byte sequence'); array[i] = byte; } return array; } // BE: Big Endian, LE: Little Endian function bytesToNumberBE(bytes) { return hexToNumber(bytesToHex(bytes)); } function bytesToNumberLE(bytes) { if (!u8a(bytes)) throw new Error('Uint8Array expected'); return hexToNumber(bytesToHex(Uint8Array.from(bytes).reverse())); } function numberToBytesBE(n, len) { return hexToBytes(n.toString(16).padStart(len * 2, '0')); } function numberToBytesLE(n, len) { return numberToBytesBE(n, len).reverse(); } // Unpadded, rarely used function numberToVarBytesBE(n) { return hexToBytes(numberToHexUnpadded(n)); } /** * Takes hex string or Uint8Array, converts to Uint8Array. * Validates output length. * Will throw error for other types. * @param title descriptive title for an error e.g. 'private key' * @param hex hex string or Uint8Array * @param expectedLength optional, will compare to result array's length * @returns */ function ensureBytes(title, hex, expectedLength) { let res; if (typeof hex === 'string') { try { res = hexToBytes(hex); } catch (e) { throw new Error(`${title} must be valid hex string, got "${hex}". Cause: ${e}`); } } else if (u8a(hex)) { // Uint8Array.from() instead of hash.slice() because node.js Buffer // is instance of Uint8Array, and its slice() creates **mutable** copy res = Uint8Array.from(hex); } else { throw new Error(`${title} must be hex string or Uint8Array`); } const len = res.length; if (typeof expectedLength === 'number' && len !== expectedLength) throw new Error(`${title} expected ${expectedLength} bytes, got ${len}`); return res; } /** * Copies several Uint8Arrays into one. */ function concatBytes(...arrays) { const r = new Uint8Array(arrays.reduce((sum, a) => sum + a.length, 0)); let pad = 0; // walk through each item, ensure they have proper type arrays.forEach(a => { if (!u8a(a)) throw new Error('Uint8Array expected'); r.set(a, pad); pad += a.length; }); return r; } function equalBytes(b1, b2) { // We don't care about timing attacks here if (b1.length !== b2.length) return false; for (let i = 0; i < b1.length; i++) if (b1[i] !== b2[i]) return false; return true; } /** * @example utf8ToBytes('abc') // new Uint8Array([97, 98, 99]) */ function utf8ToBytes(str) { if (typeof str !== 'string') throw new Error(`utf8ToBytes expected string, got ${typeof str}`); return new Uint8Array(new TextEncoder().encode(str)); // https://bugzil.la/1681809 } // Bit operations /** * Calculates amount of bits in a bigint. * Same as `n.toString(2).length` */ function bitLen(n) { let len; for (len = 0; n > _0n$3; n >>= _1n$4, len += 1); return len; } /** * Gets single bit at position. * NOTE: first bit position is 0 (same as arrays) * Same as `!!+Array.from(n.toString(2)).reverse()[pos]` */ function bitGet(n, pos) { return n >> BigInt(pos) & _1n$4; } /** * Sets single bit at position. */ const bitSet = (n, pos, value) => { return n | (value ? _1n$4 : _0n$3) << BigInt(pos); }; /** * Calculate mask for N bits. Not using ** operator with bigints because of old engines. * Same as BigInt(`0b${Array(i).fill('1').join('')}`) */ const bitMask = n => (_2n$2 << BigInt(n - 1)) - _1n$4; // DRBG const u8n = data => new Uint8Array(data); // creates Uint8Array const u8fr = arr => Uint8Array.from(arr); // another shortcut /** * Minimal HMAC-DRBG from NIST 800-90 for RFC6979 sigs. * @returns function that will call DRBG until 2nd arg returns something meaningful * @example * const drbg = createHmacDRBG(32, 32, hmac); * drbg(seed, bytesToKey); // bytesToKey must return Key or undefined */ function createHmacDrbg(hashLen, qByteLen, hmacFn) { if (typeof hashLen !== 'number' || hashLen < 2) throw new Error('hashLen must be a number'); if (typeof qByteLen !== 'number' || qByteLen < 2) throw new Error('qByteLen must be a number'); if (typeof hmacFn !== 'function') throw new Error('hmacFn must be a function'); // Step B, Step C: set hashLen to 8*ceil(hlen/8) let v = u8n(hashLen); // Minimal non-full-spec HMAC-DRBG from NIST 800-90 for RFC6979 sigs. let k = u8n(hashLen); // Steps B and C of RFC6979 3.2: set hashLen, in our case always same let i = 0; // Iterations counter, will throw when over 1000 const reset = () => { v.fill(1); k.fill(0); i = 0; }; const h = (...b) => hmacFn(k, v, ...b); // hmac(k)(v, ...values) const reseed = (seed = u8n()) => { // HMAC-DRBG reseed() function. Steps D-G k = h(u8fr([0x00]), seed); // k = hmac(k || v || 0x00 || seed) v = h(); // v = hmac(k || v) if (seed.length === 0) return; k = h(u8fr([0x01]), seed); // k = hmac(k || v || 0x01 || seed) v = h(); // v = hmac(k || v) }; const gen = () => { // HMAC-DRBG generate() function if (i++ >= 1000) throw new Error('drbg: tried 1000 values'); let len = 0; const out = []; while (len < qByteLen) { v = h(); const sl = v.slice(); out.push(sl); len += v.length; } return concatBytes(...out); }; const genUntil = (seed, pred) => { reset(); reseed(seed); // Steps D-G let res = undefined; // Step H: grind until k is in [1..n-1] while (!(res = pred(gen()))) reseed(); reset(); return res; }; return genUntil; } // Validating curves and fields const validatorFns = { bigint: val => typeof val === 'bigint', function: val => typeof val === 'function', boolean: val => typeof val === 'boolean', string: val => typeof val === 'string', stringOrUint8Array: val => typeof val === 'string' || val instanceof Uint8Array, isSafeInteger: val => Number.isSafeInteger(val), array: val => Array.isArray(val), field: (val, object) => object.Fp.isValid(val), hash: val => typeof val === 'function' && Number.isSafeInteger(val.outputLen) }; // type Record = { [P in K]: T; } function validateObject(object, validators, optValidators = {}) { const checkField = (fieldName, type, isOptional) => { const checkVal = validatorFns[type]; if (typeof checkVal !== 'function') throw new Error(`Invalid validator "${type}", expected function`); const val = object[fieldName]; if (isOptional && val === undefined) return; if (!checkVal(val, object)) { throw new Error(`Invalid param ${String(fieldName)}=${val} (${typeof val}), expected ${type}`); } }; for (const [fieldName, type] of Object.entries(validators)) checkField(fieldName, type, false); for (const [fieldName, type] of Object.entries(optValidators)) checkField(fieldName, type, true); return object; } // validate type tests // const o: { a: number; b: number; c: number } = { a: 1, b: 5, c: 6 }; // const z0 = validateObject(o, { a: 'isSafeInteger' }, { c: 'bigint' }); // Ok! // // Should fail type-check // const z1 = validateObject(o, { a: 'tmp' }, { c: 'zz' }); // const z2 = validateObject(o, { a: 'isSafeInteger' }, { c: 'zz' }); // const z3 = validateObject(o, { test: 'boolean', z: 'bug' }); // const z4 = validateObject(o, { a: 'boolean', z: 'bug' }); var ut = /*#__PURE__*/Object.freeze({ __proto__: null, bitGet: bitGet, bitLen: bitLen, bitMask: bitMask, bitSet: bitSet, bytesToHex: bytesToHex, bytesToNumberBE: bytesToNumberBE, bytesToNumberLE: bytesToNumberLE, concatBytes: concatBytes, createHmacDrbg: createHmacDrbg, ensureBytes: ensureBytes, equalBytes: equalBytes, hexToBytes: hexToBytes, hexToNumber: hexToNumber, numberToBytesBE: numberToBytesBE, numberToBytesLE: numberToBytesLE, numberToHexUnpadded: numberToHexUnpadded, numberToVarBytesBE: numberToVarBytesBE, utf8ToBytes: utf8ToBytes, validateObject: validateObject }); /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ // Utilities for modular arithmetics and finite fields // prettier-ignore const _0n$2 = BigInt(0), _1n$3 = BigInt(1), _2n$1 = BigInt(2), _3n$1 = BigInt(3); // prettier-ignore const _4n = BigInt(4), _5n = BigInt(5), _8n = BigInt(8); // prettier-ignore BigInt(9); BigInt(16); // Calculates a modulo b function mod(a, b) { const result = a % b; return result >= _0n$2 ? result : b + result; } /** * Efficiently raise num to power and do modular division. * Unsafe in some contexts: uses ladder, so can expose bigint bits. * @example * pow(2n, 6n, 11n) // 64n % 11n == 9n */ // TODO: use field version && remove function pow(num, power, modulo) { if (modulo <= _0n$2 || power < _0n$2) throw new Error('Expected power/modulo > 0'); if (modulo === _1n$3) return _0n$2; let res = _1n$3; while (power > _0n$2) { if (power & _1n$3) res = res * num % modulo; num = num * num % modulo; power >>= _1n$3; } return res; } // Does x ^ (2 ^ power) mod p. pow2(30, 4) == 30 ^ (2 ^ 4) function pow2(x, power, modulo) { let res = x; while (power-- > _0n$2) { res *= res; res %= modulo; } return res; } // Inverses number over modulo function invert(number, modulo) { if (number === _0n$2 || modulo <= _0n$2) { throw new Error(`invert: expected positive integers, got n=${number} mod=${modulo}`); } // Euclidean GCD https://brilliant.org/wiki/extended-euclidean-algorithm/ // Fermat's little theorem "CT-like" version inv(n) = n^(m-2) mod m is 30x slower. let a = mod(number, modulo); let b = modulo; // prettier-ignore let x = _0n$2, u = _1n$3; while (a !== _0n$2) { // JIT applies optimization if those two lines follow each other const q = b / a; const r = b % a; const m = x - u * q; // prettier-ignore b = a, a = r, x = u, u = m; } const gcd = b; if (gcd !== _1n$3) throw new Error('invert: does not exist'); return mod(x, modulo); } /** * Tonelli-Shanks square root search algorithm. * 1. https://eprint.iacr.org/2012/685.pdf (page 12) * 2. Square Roots from 1; 24, 51, 10 to Dan Shanks * Will start an infinite loop if field order P is not prime. * @param P field order * @returns function that takes field Fp (created from P) and number n */ function tonelliShanks(P) { // Legendre constant: used to calculate Legendre symbol (a | p), // which denotes the value of a^((p-1)/2) (mod p). // (a | p) ≡ 1 if a is a square (mod p) // (a | p) ≡ -1 if a is not a square (mod p) // (a | p) ≡ 0 if a ≡ 0 (mod p) const legendreC = (P - _1n$3) / _2n$1; let Q, S, Z; // Step 1: By factoring out powers of 2 from p - 1, // find q and s such that p - 1 = q*(2^s) with q odd for (Q = P - _1n$3, S = 0; Q % _2n$1 === _0n$2; Q /= _2n$1, S++); // Step 2: Select a non-square z such that (z | p) ≡ -1 and set c ≡ zq for (Z = _2n$1; Z < P && pow(Z, legendreC, P) !== P - _1n$3; Z++); // Fast-path if (S === 1) { const p1div4 = (P + _1n$3) / _4n; return function tonelliFast(Fp, n) { const root = Fp.pow(n, p1div4); if (!Fp.eql(Fp.sqr(root), n)) throw new Error('Cannot find square root'); return root; }; } // Slow-path const Q1div2 = (Q + _1n$3) / _2n$1; return function tonelliSlow(Fp, n) { // Step 0: Check that n is indeed a square: (n | p) should not be ≡ -1 if (Fp.pow(n, legendreC) === Fp.neg(Fp.ONE)) throw new Error('Cannot find square root'); let r = S; // TODO: will fail at Fp2/etc let g = Fp.pow(Fp.mul(Fp.ONE, Z), Q); // will update both x and b let x = Fp.pow(n, Q1div2); // first guess at the square root let b = Fp.pow(n, Q); // first guess at the fudge factor while (!Fp.eql(b, Fp.ONE)) { if (Fp.eql(b, Fp.ZERO)) return Fp.ZERO; // https://en.wikipedia.org/wiki/Tonelli%E2%80%93Shanks_algorithm (4. If t = 0, return r = 0) // Find m such b^(2^m)==1 let m = 1; for (let t2 = Fp.sqr(b); m < r; m++) { if (Fp.eql(t2, Fp.ONE)) break; t2 = Fp.sqr(t2); // t2 *= t2 } // NOTE: r-m-1 can be bigger than 32, need to convert to bigint before shift, otherwise there will be overflow const ge = Fp.pow(g, _1n$3 << BigInt(r - m - 1)); // ge = 2^(r-m-1) g = Fp.sqr(ge); // g = ge * ge x = Fp.mul(x, ge); // x *= ge b = Fp.mul(b, g); // b *= g r = m; } return x; }; } function FpSqrt(P) { // NOTE: different algorithms can give different roots, it is up to user to decide which one they want. // For example there is FpSqrtOdd/FpSqrtEven to choice root based on oddness (used for hash-to-curve). // P ≡ 3 (mod 4) // √n = n^((P+1)/4) if (P % _4n === _3n$1) { // Not all roots possible! // const ORDER = // 0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaabn; // const NUM = 72057594037927816n; const p1div4 = (P + _1n$3) / _4n; return function sqrt3mod4(Fp, n) { const root = Fp.pow(n, p1div4); // Throw if root**2 != n if (!Fp.eql(Fp.sqr(root), n)) throw new Error('Cannot find square root'); return root; }; } // Atkin algorithm for q ≡ 5 (mod 8), https://eprint.iacr.org/2012/685.pdf (page 10) if (P % _8n === _5n) { const c1 = (P - _5n) / _8n; return function sqrt5mod8(Fp, n) { const n2 = Fp.mul(n, _2n$1); const v = Fp.pow(n2, c1); const nv = Fp.mul(n, v); const i = Fp.mul(Fp.mul(nv, _2n$1), v); const root = Fp.mul(nv, Fp.sub(i, Fp.ONE)); if (!Fp.eql(Fp.sqr(root), n)) throw new Error('Cannot find square root'); return root; }; } // Other cases: Tonelli-Shanks algorithm return tonelliShanks(P); } // prettier-ignore const FIELD_FIELDS = ['create', 'isValid', 'is0', 'neg', 'inv', 'sqrt', 'sqr', 'eql', 'add', 'sub', 'mul', 'pow', 'div', 'addN', 'subN', 'mulN', 'sqrN']; function validateField(field) { const initial = { ORDER: 'bigint', MASK: 'bigint', BYTES: 'isSafeInteger', BITS: 'isSafeInteger' }; const opts = FIELD_FIELDS.reduce((map, val) => { map[val] = 'function'; return map; }, initial); return validateObject(field, opts); } // Generic field functions /** * Same as `pow` but for Fp: non-constant-time. * Unsafe in some contexts: uses ladder, so can expose bigint bits. */ function FpPow(f, num, power) { // Should have same speed as pow for bigints // TODO: benchmark! if (power < _0n$2) throw new Error('Expected power > 0'); if (power === _0n$2) return f.ONE; if (power === _1n$3) return num; let p = f.ONE; let d = num; while (power > _0n$2) { if (power & _1n$3) p = f.mul(p, d); d = f.sqr(d); power >>= _1n$3; } return p; } /** * Efficiently invert an array of Field elements. * `inv(0)` will return `undefined` here: make sure to throw an error. */ function FpInvertBatch(f, nums) { const tmp = new Array(nums.length); // Walk from first to last, multiply them by each other MOD p const lastMultiplied = nums.reduce((acc, num, i) => { if (f.is0(num)) return acc; tmp[i] = acc; return f.mul(acc, num); }, f.ONE); // Invert last element const inverted = f.inv(lastMultiplied); // Walk from last to first, multiply them by inverted each other MOD p nums.reduceRight((acc, num, i) => { if (f.is0(num)) return acc; tmp[i] = f.mul(acc, tmp[i]); return f.mul(acc, num); }, inverted); return tmp; } // CURVE.n lengths function nLength(n, nBitLength) { // Bit size, byte size of CURVE.n const _nBitLength = nBitLength !== undefined ? nBitLength : n.toString(2).length; const nByteLength = Math.ceil(_nBitLength / 8); return { nBitLength: _nBitLength, nByteLength }; } /** * Initializes a finite field over prime. **Non-primes are not supported.** * Do not init in loop: slow. Very fragile: always run a benchmark on a change. * Major performance optimizations: * * a) denormalized operations like mulN instead of mul * * b) same object shape: never add or remove keys * * c) Object.freeze * @param ORDER prime positive bigint * @param bitLen how many bits the field consumes * @param isLE (def: false) if encoding / decoding should be in little-endian * @param redef optional faster redefinitions of sqrt and other methods */ function Field(ORDER, bitLen, isLE = false, redef = {}) { if (ORDER <= _0n$2) throw new Error(`Expected Field ORDER > 0, got ${ORDER}`); const { nBitLength: BITS, nByteLength: BYTES } = nLength(ORDER, bitLen); if (BYTES > 2048) throw new Error('Field lengths over 2048 bytes are not supported'); const sqrtP = FpSqrt(ORDER); const f = Object.freeze({ ORDER, BITS, BYTES, MASK: bitMask(BITS), ZERO: _0n$2, ONE: _1n$3, create: num => mod(num, ORDER), isValid: num => { if (typeof num !== 'bigint') throw new Error(`Invalid field element: expected bigint, got ${typeof num}`); return _0n$2 <= num && num < ORDER; // 0 is valid element, but it's not invertible }, is0: num => num === _0n$2, isOdd: num => (num & _1n$3) === _1n$3, neg: num => mod(-num, ORDER), eql: (lhs, rhs) => lhs === rhs, sqr: num => mod(num * num, ORDER), add: (lhs, rhs) => mod(lhs + rhs, ORDER), sub: (lhs, rhs) => mod(lhs - rhs, ORDER), mul: (lhs, rhs) => mod(lhs * rhs, ORDER), pow: (num, power) => FpPow(f, num, power), div: (lhs, rhs) => mod(lhs * invert(rhs, ORDER), ORDER), // Same as above, but doesn't normalize sqrN: num => num * num, addN: (lhs, rhs) => lhs + rhs, subN: (lhs, rhs) => lhs - rhs, mulN: (lhs, rhs) => lhs * rhs, inv: num => invert(num, ORDER), sqrt: redef.sqrt || (n => sqrtP(f, n)), invertBatch: lst => FpInvertBatch(f, lst), // TODO: do we really need constant cmov? // We don't have const-time bigints anyway, so probably will be not very useful cmov: (a, b, c) => c ? b : a, toBytes: num => isLE ? numberToBytesLE(num, BYTES) : numberToBytesBE(num, BYTES), fromBytes: bytes => { if (bytes.length !== BYTES) throw new Error(`Fp.fromBytes: expected ${BYTES}, got ${bytes.length}`); return isLE ? bytesToNumberLE(bytes) : bytesToNumberBE(bytes); } }); return Object.freeze(f); } /** * Returns total number of bytes consumed by the field element. * For example, 32 bytes for usual 256-bit weierstrass curve. * @param fieldOrder number of field elements, usually CURVE.n * @returns byte length of field */ function getFieldBytesLength(fieldOrder) { if (typeof fieldOrder !== 'bigint') throw new Error('field order must be bigint'); const bitLength = fieldOrder.toString(2).length; return Math.ceil(bitLength / 8); } /** * Returns minimal amount of bytes that can be safely reduced * by field order. * Should be 2^-128 for 128-bit curve such as P256. * @param fieldOrder number of field elements, usually CURVE.n * @returns byte length of target hash */ function getMinHashLength(fieldOrder) { const length = getFieldBytesLength(fieldOrder); return length + Math.ceil(length / 2); } /** * "Constant-time" private key generation utility. * Can take (n + n/2) or more bytes of uniform input e.g. from CSPRNG or KDF * and convert them into private scalar, with the modulo bias being negligible. * Needs at least 48 bytes of input for 32-byte private key. * https://research.kudelskisecurity.com/2020/07/28/the-definitive-guide-to-modulo-bias-and-how-to-avoid-it/ * FIPS 186-5, A.2 https://csrc.nist.gov/publications/detail/fips/186/5/final * RFC 9380, https://www.rfc-editor.org/rfc/rfc9380#section-5 * @param hash hash output from SHA3 or a similar function * @param groupOrder size of subgroup - (e.g. secp256k1.CURVE.n) * @param isLE interpret hash bytes as LE num * @returns valid private scalar */ function mapHashToField(key, fieldOrder, isLE = false) { const len = key.length; const fieldLen = getFieldBytesLength(fieldOrder); const minLen = getMinHashLength(fieldOrder); // No small numbers: need to understand bias story. No huge numbers: easier to detect JS timings. if (len < 16 || len < minLen || len > 1024) throw new Error(`expected ${minLen}-1024 bytes of input, got ${len}`); const num = isLE ? bytesToNumberBE(key) : bytesToNumberLE(key); // `mod(x, 11)` can sometimes produce 0. `mod(x, 10) + 1` is the same, but no 0 const reduced = mod(num, fieldOrder - _1n$3) + _1n$3; return isLE ? numberToBytesLE(reduced, fieldLen) : numberToBytesBE(reduced, fieldLen); } /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ // Abelian group utilities const _0n$1 = BigInt(0); const _1n$2 = BigInt(1); // Elliptic curve multiplication of Point by scalar. Fragile. // Scalars should always be less than curve order: this should be checked inside of a curve itself. // Creates precomputation tables for fast multiplication: // - private scalar is split by fixed size windows of W bits // - every window point is collected from window's table & added to accumulator // - since windows are different, same point inside tables won't be accessed more than once per calc // - each multiplication is 'Math.ceil(CURVE_ORDER / 𝑊) + 1' point additions (fixed for any scalar) // - +1 window is neccessary for wNAF // - wNAF reduces table size: 2x less memory + 2x faster generation, but 10% slower multiplication // TODO: Research returning 2d JS array of windows, instead of a single window. This would allow // windows to be in different memory locations function wNAF(c, bits) { const constTimeNegate = (condition, item) => { const neg = item.negate(); return condition ? neg : item; }; const opts = W => { const windows = Math.ceil(bits / W) + 1; // +1, because const windowSize = 2 ** (W - 1); // -1 because we skip zero return { windows, windowSize }; }; return { constTimeNegate, // non-const time multiplication ladder unsafeLadder(elm, n) { let p = c.ZERO; let d = elm; while (n > _0n$1) { if (n & _1n$2) p = p.add(d); d = d.double(); n >>= _1n$2; } return p; }, /** * Creates a wNAF precomputation window. Used for caching. * Default window size is set by `utils.precompute()` and is equal to 8. * Number of precomputed points depends on the curve size: * 2^(𝑊−1) * (Math.ceil(𝑛 / 𝑊) + 1), where: * - 𝑊 is the window size * - 𝑛 is the bitlength of the curve order. * For a 256-bit curve and window size 8, the number of precomputed points is 128 * 33 = 4224. * @returns precomputed point tables flattened to a single array */ precomputeWindow(elm, W) { const { windows, windowSize } = opts(W); const points = []; let p = elm; let base = p; for (let window = 0; window < windows; window++) { base = p; points.push(base); // =1, because we skip zero for (let i = 1; i < windowSize; i++) { base = base.add(p); points.push(base); } p = base.double(); } return points; }, /** * Implements ec multiplication using precomputed tables and w-ary non-adjacent form. * @param W window size * @param precomputes precomputed tables * @param n scalar (we don't check here, but should be less than curve order) * @returns real and fake (for const-time) points */ wNAF(W, precomputes, n) { // TODO: maybe check that scalar is less than group order? wNAF behavious is undefined otherwise // But need to carefully remove other checks before wNAF. ORDER == bits here const { windows, windowSize } = opts(W); let p = c.ZERO; let f = c.BASE; const mask = BigInt(2 ** W - 1); // Create mask with W ones: 0b1111 for W=4 etc. const maxNumber = 2 ** W; const shiftBy = BigInt(W); for (let window = 0; window < windows; window++) { const offset = window * windowSize; // Extract W bits. let wbits = Number(n & mask); // Shift number by W bits. n >>= shiftBy; // If the bits are bigger than max size, we'll split those. // +224 => 256 - 32 if (wbits > windowSize) { wbits -= maxNumber; n += _1n$2; } // This code was first written with assumption that 'f' and 'p' will never be infinity point: // since each addition is multiplied by 2 ** W, it cannot cancel each other. However, // there is negate now: it is possible that negated element from low value // would be the same as high element, which will create carry into next window. // It's not obvious how this can fail, but still worth investigating later. // Check if we're onto Zero point. // Add random point inside current window to f. const offset1 = offset; const offset2 = offset + Math.abs(wbits) - 1; // -1 because we skip zero const cond1 = window % 2 !== 0; const cond2 = wbits < 0; if (wbits === 0) { // The most important part for const-time getPublicKey f = f.add(constTimeNegate(cond1, precomputes[offset1])); } else { p = p.add(constTimeNegate(cond2, precomputes[offset2])); } } // JIT-compiler should not eliminate f here, since it will later be used in normalizeZ() // Even if the variable is still unused, there are some checks which will // throw an exception, so compiler needs to prove they won't happen, which is hard. // At this point there is a way to F be infinity-point even if p is not, // which makes it less const-time: around 1 bigint multiply. return { p, f }; }, wNAFCached(P, precomputesMap, n, transform) { // @ts-ignore const W = P._WINDOW_SIZE || 1; // Calculate precomputes on a first run, reuse them after let comp = precomputesMap.get(P); if (!comp) { comp = this.precomputeWindow(P, W); if (W !== 1) { precomputesMap.set(P, transform(comp)); } } return this.wNAF(W, comp, n); } }; } function validateBasic(curve) { validateField(curve.Fp); validateObject(curve, { n: 'bigint', h: 'bigint', Gx: 'field', Gy: 'field' }, { nBitLength: 'isSafeInteger', nByteLength: 'isSafeInteger' }); // Set defaults return Object.freeze({ ...nLength(curve.n, curve.nBitLength), ...curve, ...{ p: curve.Fp.ORDER } }); } /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ // Short Weierstrass curve. The formula is: y² = x³ + ax + b function validatePointOpts(curve) { const opts = validateBasic(curve); validateObject(opts, { a: 'field', b: 'field' }, { allowedPrivateKeyLengths: 'array', wrapPrivateKey: 'boolean', isTorsionFree: 'function', clearCofactor: 'function', allowInfinityPoint: 'boolean', fromBytes: 'function', toBytes: 'function' }); const { endo, Fp, a } = opts; if (endo) { if (!Fp.eql(a, Fp.ZERO)) { throw new Error('Endomorphism can only be defined for Koblitz curves that have a=0'); } if (typeof endo !== 'object' || typeof endo.beta !== 'bigint' || typeof endo.splitScalar !== 'function') { throw new Error('Expected endomorphism with beta: bigint and splitScalar: function'); } } return Object.freeze({ ...opts }); } // ASN.1 DER encoding utilities const { bytesToNumberBE: b2n, hexToBytes: h2b } = ut; const DER = { // asn.1 DER encoding utils Err: class DERErr extends Error { constructor(m = '') { super(m); } }, _parseInt(data) { const { Err: E } = DER; if (data.length < 2 || data[0] !== 0x02) throw new E('Invalid signature integer tag'); const len = data[1]; const res = data.subarray(2, len + 2); if (!len || res.length !== len) throw new E('Invalid signature integer: wrong length'); // https://crypto.stackexchange.com/a/57734 Leftmost bit of first byte is 'negative' flag, // since we always use positive integers here. It must always be empty: // - add zero byte if exists // - if next byte doesn't have a flag, leading zero is not allowed (minimal encoding) if (res[0] & 0b10000000) throw new E('Invalid signature integer: negative'); if (res[0] === 0x00 && !(res[1] & 0b10000000)) throw new E('Invalid signature integer: unnecessary leading zero'); return { d: b2n(res), l: data.subarray(len + 2) }; // d is data, l is left }, toSig(hex) { // parse DER signature const { Err: E } = DER; const data = typeof hex === 'string' ? h2b(hex) : hex; if (!(data instanceof Uint8Array)) throw new Error('ui8a expected'); let l = data.length; if (l < 2 || data[0] != 0x30) throw new E('Invalid signature tag'); if (data[1] !== l - 2) throw new E('Invalid signature: incorrect length'); const { d: r, l: sBytes } = DER._parseInt(data.subarray(2)); const { d: s, l: rBytesLeft } = DER._parseInt(sBytes); if (rBytesLeft.length) throw new E('Invalid signature: left bytes after parsing'); return { r, s }; }, hexFromSig(sig) { // Add leading zero if first byte has negative bit enabled. More details in '_parseInt' const slice = s => Number.parseInt(s[0], 16) & 0b1000 ? '00' + s : s; const h = num => { const hex = num.toString(16); return hex.length & 1 ? `0${hex}` : hex; }; const s = slice(h(sig.s)); const r = slice(h(sig.r)); const shl = s.length / 2; const rhl = r.length / 2; const sl = h(shl); const rl = h(rhl); return `30${h(rhl + shl + 4)}02${rl}${r}02${sl}${s}`; } }; // Be friendly to bad ECMAScript parsers by not using bigint literals // prettier-ignore const _0n = BigInt(0), _1n$1 = BigInt(1); BigInt(2); const _3n = BigInt(3); BigInt(4); function weierstrassPoints(opts) { const CURVE = validatePointOpts(opts); const { Fp } = CURVE; // All curves has same field / group length as for now, but they can differ const toBytes = CURVE.toBytes || ((_c, point, _isCompressed) => { const a = point.toAffine(); return concatBytes(Uint8Array.from([0x04]), Fp.toBytes(a.x), Fp.toBytes(a.y)); }); const fromBytes = CURVE.fromBytes || (bytes => { // const head = bytes[0]; const tail = bytes.subarray(1); // if (head !== 0x04) throw new Error('Only non-compressed encoding is supported'); const x = Fp.fromBytes(tail.subarray(0, Fp.BYTES)); const y = Fp.fromBytes(tail.subarray(Fp.BYTES, 2 * Fp.BYTES)); return { x, y }; }); /** * y² = x³ + ax + b: Short weierstrass curve formula * @returns y² */ function weierstrassEquation(x) { const { a, b } = CURVE; const x2 = Fp.sqr(x); // x * x const x3 = Fp.mul(x2, x); // x2 * x return Fp.add(Fp.add(x3, Fp.mul(x, a)), b); // x3 + a * x + b } // Validate whether the passed curve params are valid. // We check if curve equation works for generator point. // `assertValidity()` won't work: `isTorsionFree()` is not available at this point in bls12-381. // ProjectivePoint class has not been initialized yet. if (!Fp.eql(Fp.sqr(CURVE.Gy), weierstrassEquation(CURVE.Gx))) throw new Error('bad generator point: equation left != right'); // Valid group elements reside in range 1..n-1 function isWithinCurveOrder(num) { return typeof num === 'bigint' && _0n < num && num < CURVE.n; } function assertGE(num) { if (!isWithinCurveOrder(num)) throw new Error('Expected valid bigint: 0 < bigint < curve.n'); } // Validates if priv key is valid and converts it to bigint. // Supports options allowedPrivateKeyLengths and wrapPrivateKey. function normPrivateKeyToScalar(key) { const { allowedPrivateKeyLengths: lengths, nByteLength, wrapPrivateKey, n } = CURVE; if (lengths && typeof key !== 'bigint') { if (key instanceof Uint8Array) key = bytesToHex(key); // Normalize to hex string, pad. E.g. P521 would norm 130-132 char hex to 132-char bytes if (typeof key !== 'string' || !lengths.includes(key.length)) throw new Error('Invalid key'); key = key.padStart(nByteLength * 2, '0'); } let num; try { num = typeof key === 'bigint' ? key : bytesToNumberBE(ensureBytes('private key', key, nByteLength)); } catch (error) { throw new Error(`private key must be ${nByteLength} bytes, hex or bigint, not ${typeof key}`); } if (wrapPrivateKey) num = mod(num, n); // disabled by default, enabled for BLS assertGE(num); // num in range [1..N-1] return num; } const pointPrecomputes = new Map(); function assertPrjPoint(other) { if (!(other instanceof Point)) throw new Error('ProjectivePoint expected'); } /** * Projective Point works in 3d / projective (homogeneous) coordinates: (x, y, z) ∋ (x=x/z, y=y/z) * Default Point works in 2d / affine coordinates: (x, y) * We're doing calculations in projective, because its operations don't require costly inversion. */ class Point { constructor(px, py, pz) { this.px = px; this.py = py; this.pz = pz; if (px == null || !Fp.isValid(px)) throw new Error('x required'); if (py == null || !Fp.isValid(py)) throw new Error('y required'); if (pz == null || !Fp.isValid(pz)) throw new Error('z required'); } // Does not validate if the point is on-curve. // Use fromHex instead, or call assertValidity() later. static fromAffine(p) { const { x, y } = p || {}; if (!p || !Fp.isValid(x) || !Fp.isValid(y)) throw new Error('invalid affine point'); if (p instanceof Point) throw new Error('projective point not allowed'); const is0 = i => Fp.eql(i, Fp.ZERO); // fromAffine(x:0, y:0) would produce (x:0, y:0, z:1), but we need (x:0, y:1, z:0) if (is0(x) && is0(y)) return Point.ZERO; return new Point(x, y, Fp.ONE); } get x() { return this.toAffine().x; } get y() { return this.toAffine().y; } /** * Takes a bunch of Projective Points but executes only one * inversion on all of them. Inversion is very slow operation, * so this improves performance massively. * Optimization: converts a list of projective points to a list of identical points with Z=1. */ static normalizeZ(points) { const toInv = Fp.invertBatch(points.map(p => p.pz)); return points.map((p, i) => p.toAffine(toInv[i])).map(Point.fromAffine); } /** * Converts hash string or Uint8Array to Point. * @param hex short/long ECDSA hex */ static fromHex(hex) { const P = Point.fromAffine(fromBytes(ensureBytes('pointHex', hex))); P.assertValidity(); return P; } // Multiplies generator point by privateKey. static fromPrivateKey(privateKey) { return Point.BASE.multiply(normPrivateKeyToScalar(privateKey)); } // "Private method", don't use it directly _setWindowSize(windowSize) { this._WINDOW_SIZE = windowSize; pointPrecomputes.delete(this); } // A point on curve is valid if it conforms to equation. assertValidity() { if (this.is0()) { // (0, 1, 0) aka ZERO is invalid in most contexts. // In BLS, ZERO can be serialized, so we allow it. // (0, 0, 0) is wrong representation of ZERO and is always invalid. if (CURVE.allowInfinityPoint && !Fp.is0(this.py)) return; throw new Error('bad point: ZERO'); } // Some 3rd-party test vectors require different wording between here & `fromCompressedHex` const { x, y } = this.toAffine(); // Check if x, y are valid field elements if (!Fp.isValid(x) || !Fp.isValid(y)) throw new Error('bad point: x or y not FE'); const left = Fp.sqr(y); // y² const right = weierstrassEquation(x); // x³ + ax + b if (!Fp.eql(left, right)) throw new Error('bad point: equation left != right'); if (!this.isTorsionFree()) throw new Error('bad point: not in prime-order subgroup'); } hasEvenY() { const { y } = this.toAffine(); if (Fp.isOdd) return !Fp.isOdd(y); throw new Error("Field doesn't support isOdd"); } /** * Compare one point to another. */ equals(other) { assertPrjPoint(other); const { px: X1, py: Y1, pz: Z1 } = this; const { px: X2, py: Y2, pz: Z2 } = other; const U1 = Fp.eql(Fp.mul(X1, Z2), Fp.mul(X2, Z1)); const U2 = Fp.eql(Fp.mul(Y1, Z2), Fp.mul(Y2, Z1)); return U1 && U2; } /** * Flips point to one corresponding to (x, -y) in Affine coordinates. */ negate() { return new Point(this.px, Fp.neg(this.py), this.pz); } // Renes-Costello-Batina exception-free doubling formula. // There is 30% faster Jacobian formula, but it is not complete. // https://eprint.iacr.org/2015/1060, algorithm 3 // Cost: 8M + 3S + 3*a + 2*b3 + 15add. double() { const { a, b } = CURVE; const b3 = Fp.mul(b, _3n); const { px: X1, py: Y1, pz: Z1 } = this; let X3 = Fp.ZERO, Y3 = Fp.ZERO, Z3 = Fp.ZERO; // prettier-ignore let t0 = Fp.mul(X1, X1); // step 1 let t1 = Fp.mul(Y1, Y1); let t2 = Fp.mul(Z1, Z1); let t3 = Fp.mul(X1, Y1); t3 = Fp.add(t3, t3); // step 5 Z3 = Fp.mul(X1, Z1); Z3 = Fp.add(Z3, Z3); X3 = Fp.mul(a, Z3); Y3 = Fp.mul(b3, t2); Y3 = Fp.add(X3, Y3); // step 10 X3 = Fp.sub(t1, Y3); Y3 = Fp.add(t1, Y3); Y3 = Fp.mul(X3, Y3); X3 = Fp.mul(t3, X3); Z3 = Fp.mul(b3, Z3); // step 15 t2 = Fp.mul(a, t2); t3 = Fp.sub(t0, t2); t3 = Fp.mul(a, t3); t3 = Fp.add(t3, Z3); Z3 = Fp.add(t0, t0); // step 20 t0 = Fp.add(Z3, t0); t0 = Fp.add(t0, t2); t0 = Fp.mul(t0, t3); Y3 = Fp.add(Y3, t0); t2 = Fp.mul(Y1, Z1); // step 25 t2 = Fp.add(t2, t2); t0 = Fp.mul(t2, t3); X3 = Fp.sub(X3, t0); Z3 = Fp.mul(t2, t1); Z3 = Fp.add(Z3, Z3); // step 30 Z3 = Fp.add(Z3, Z3); return new Point(X3, Y3, Z3); } // Renes-Costello-Batina exception-free addition formula. // There is 30% faster Jacobian formula, but it is not complete. // https://eprint.iacr.org/2015/1060, algorithm 1 // Cost: 12M + 0S + 3*a + 3*b3 + 23add. add(other) { assertPrjPoint(other); const { px: X1, py: Y1, pz: Z1 } = this; const { px: X2, py: Y2, pz: Z2 } = other; let X3 = Fp.ZERO, Y3 = Fp.ZERO, Z3 = Fp.ZERO; // prettier-ignore const a = CURVE.a; const b3 = Fp.mul(CURVE.b, _3n); let t0 = Fp.mul(X1, X2); // step 1 let t1 = Fp.mul(Y1, Y2); let t2 = Fp.mul(Z1, Z2); let t3 = Fp.add(X1, Y1); let t4 = Fp.add(X2, Y2); // step 5 t3 = Fp.mul(t3, t4); t4 = Fp.add(t0, t1); t3 = Fp.sub(t3, t4); t4 = Fp.add(X1, Z1); let t5 = Fp.add(X2, Z2); // step 10 t4 = Fp.mul(t4, t5); t5 = Fp.add(t0, t2); t4 = Fp.sub(t4, t5); t5 = Fp.add(Y1, Z1); X3 = Fp.add(Y2, Z2); // step 15 t5 = Fp.mul(t5, X3); X3 = Fp.add(t1, t2); t5 = Fp.sub(t5, X3); Z3 = Fp.mul(a, t4); X3 = Fp.mul(b3, t2); // step 20 Z3 = Fp.add(X3, Z3); X3 = Fp.sub(t1, Z3); Z3 = Fp.add(t1, Z3); Y3 = Fp.mul(X3, Z3); t1 = Fp.add(t0, t0); // step 25 t1 = Fp.add(t1, t0); t2 = Fp.mul(a, t2); t4 = Fp.mul(b3, t4); t1 = Fp.add(t1, t2); t2 = Fp.sub(t0, t2); // step 30 t2 = Fp.mul(a, t2); t4 = Fp.add(t4, t2); t0 = Fp.mul(t1, t4); Y3 = Fp.add(Y3, t0); t0 = Fp.mul(t5, t4); // step 35 X3 = Fp.mul(t3, X3); X3 = Fp.sub(X3, t0); t0 = Fp.mul(t3, t1); Z3 = Fp.mul(t5, Z3); Z3 = Fp.add(Z3, t0); // step 40 return new Point(X3, Y3, Z3); } subtract(other) { return this.add(other.negate()); } is0() { return this.equals(Point.ZERO); } wNAF(n) { return wnaf.wNAFCached(this, pointPrecomputes, n, comp => { const toInv = Fp.invertBatch(comp.map(p => p.pz)); return comp.map((p, i) => p.toAffine(toInv[i])).map(Point.fromAffine); }); } /** * Non-constant-time multiplication. Uses double-and-add algorithm. * It's faster, but should only be used when you don't care about * an exposed private key e.g. sig verification, which works over *public* keys. */ multiplyUnsafe(n) { const I = Point.ZERO; if (n === _0n) return I; assertGE(n); // Will throw on 0 if (n === _1n$1) return this; const { endo } = CURVE; if (!endo) return wnaf.unsafeLadder(this, n); // Apply endomorphism let { k1neg, k1, k2neg, k2 } = endo.splitScalar(n); let k1p = I; let k2p = I; let d = this; while (k1 > _0n || k2 > _0n) { if (k1 & _1n$1) k1p = k1p.add(d); if (k2 & _1n$1) k2p = k2p.add(d); d = d.double(); k1 >>= _1n$1; k2 >>= _1n$1; } if (k1neg) k1p = k1p.negate(); if (k2neg) k2p = k2p.negate(); k2p = new Point(Fp.mul(k2p.px, endo.beta), k2p.py, k2p.pz); return k1p.add(k2p); } /** * Constant time multiplication. * Uses wNAF method. Windowed method may be 10% faster, * but takes 2x longer to generate and consumes 2x memory. * Uses precomputes when available. * Uses endomorphism for Koblitz curves. * @param scalar by which the point would be multiplied * @returns New point */ multiply(scalar) { assertGE(scalar); let n = scalar; let point, fake; // Fake point is used to const-time mult const { endo } = CURVE; if (endo) { const { k1neg, k1, k2neg, k2 } = endo.splitScalar(n); let { p: k1p, f: f1p } = this.wNAF(k1); let { p: k2p, f: f2p } = this.wNAF(k2); k1p = wnaf.constTimeNegate(k1neg, k1p); k2p = wnaf.constTimeNegate(k2neg, k2p); k2p = new Point(Fp.mul(k2p.px, endo.beta), k2p.py, k2p.pz); point = k1p.add(k2p); fake = f1p.add(f2p); } else { const { p, f } = this.wNAF(n); point = p; fake = f; } // Normalize `z` for both points, but return only real one return Point.normalizeZ([point, fake])[0]; } /** * Efficiently calculate `aP + bQ`. Unsafe, can expose private key, if used incorrectly. * Not using Strauss-Shamir trick: precomputation tables are faster. * The trick could be useful if both P and Q are not G (not in our case). * @returns non-zero affine point */ multiplyAndAddUnsafe(Q, a, b) { const G = Point.BASE; // No Strauss-Shamir trick: we have 10% faster G precomputes const mul = (P, a // Select faster multiply() method ) => a === _0n || a === _1n$1 || !P.equals(G) ? P.multiplyUnsafe(a) : P.multiply(a); const sum = mul(this, a).add(mul(Q, b)); return sum.is0() ? undefined : sum; } // Converts Projective point to affine (x, y) coordinates. // Can accept precomputed Z^-1 - for example, from invertBatch. // (x, y, z) ∋ (x=x/z, y=y/z) toAffine(iz) { const { px: x, py: y, pz: z } = this; const is0 = this.is0(); // If invZ was 0, we return zero point. However we still want to execute // all operations, so we replace invZ with a random number, 1. if (iz == null) iz = is0 ? Fp.ONE : Fp.inv(z); const ax = Fp.mul(x, iz); const ay = Fp.mul(y, iz); const zz = Fp.mul(z, iz); if (is0) return { x: Fp.ZERO, y: Fp.ZERO }; if (!Fp.eql(zz, Fp.ONE)) throw new Error('invZ was invalid'); return { x: ax, y: ay }; } isTorsionFree() { const { h: cofactor, isTorsionFree } = CURVE; if (cofactor === _1n$1) return true; // No subgroups, always torsion-free if (isTorsionFree) return isTorsionFree(Point, this); throw new Error('isTorsionFree() has not been declared for the elliptic curve'); } clearCofactor() { const { h: cofactor, clearCofactor } = CURVE; if (cofactor === _1n$1) return this; // Fast-path if (clearCofactor) return clearCofactor(Point, this); return this.multiplyUnsafe(CURVE.h); } toRawBytes(isCompressed = true) { this.assertValidity(); return toBytes(Point, this, isCompressed); } toHex(isCompressed = true) { return bytesToHex(this.toRawBytes(isCompressed)); } } Point.BASE = new Point(CURVE.Gx, CURVE.Gy, Fp.ONE); Point.ZERO = new Point(Fp.ZERO, Fp.ONE, Fp.ZERO); const _bits = CURVE.nBitLength; const wnaf = wNAF(Point, CURVE.endo ? Math.ceil(_bits / 2) : _bits); // Validate if generator point is on curve return { CURVE, ProjectivePoint: Point, normPrivateKeyToScalar, weierstrassEquation, isWithinCurveOrder }; } function validateOpts(curve) { const opts = validateBasic(curve); validateObject(opts, { hash: 'hash', hmac: 'function', randomBytes: 'function' }, { bits2int: 'function', bits2int_modN: 'function', lowS: 'boolean' }); return Object.freeze({ lowS: true, ...opts }); } function weierstrass(curveDef) { const CURVE = validateOpts(curveDef); const { Fp, n: CURVE_ORDER } = CURVE; const compressedLen = Fp.BYTES + 1; // e.g. 33 for 32 const uncompressedLen = 2 * Fp.BYTES + 1; // e.g. 65 for 32 function isValidFieldElement(num) { return _0n < num && num < Fp.ORDER; // 0 is banned since it's not invertible FE } function modN(a) { return mod(a, CURVE_ORDER); } function invN(a) { return invert(a, CURVE_ORDER); } const { ProjectivePoint: Point, normPrivateKeyToScalar, weierstrassEquation, isWithinCurveOrder } = weierstrassPoints({ ...CURVE, toBytes(_c, point, isCompressed) { const a = point.toAffine(); const x = Fp.toBytes(a.x); const cat = concatBytes; if (isCompressed) { return cat(Uint8Array.from([point.hasEvenY() ? 0x02 : 0x03]), x); } else { return cat(Uint8Array.from([0x04]), x, Fp.toBytes(a.y)); } }, fromBytes(bytes) { const len = bytes.length; const head = bytes[0]; const tail = bytes.subarray(1); // this.assertValidity() is done inside of fromHex if (len === compressedLen && (head === 0x02 || head === 0x03)) { const x = bytesToNumberBE(tail); if (!isValidFieldElement(x)) throw new Error('Point is not on curve'); const y2 = weierstrassEquation(x); // y² = x³ + ax + b let y = Fp.sqrt(y2); // y = y² ^ (p+1)/4 const isYOdd = (y & _1n$1) === _1n$1; // ECDSA const isHeadOdd = (head & 1) === 1; if (isHeadOdd !== isYOdd) y = Fp.neg(y); return { x, y }; } else if (len === uncompressedLen && head === 0x04) { const x = Fp.fromBytes(tail.subarray(0, Fp.BYTES)); const y = Fp.fromBytes(tail.subarray(Fp.BYTES, 2 * Fp.BYTES)); return { x, y }; } else { throw new Error(`Point of length ${len} was invalid. Expected ${compressedLen} compressed bytes or ${uncompressedLen} uncompressed bytes`); } } }); const numToNByteStr = num => bytesToHex(numberToBytesBE(num, CURVE.nByteLength)); function isBiggerThanHalfOrder(number) { const HALF = CURVE_ORDER >> _1n$1; return number > HALF; } function normalizeS(s) { return isBiggerThanHalfOrder(s) ? modN(-s) : s; } // slice bytes num const slcNum = (b, from, to) => bytesToNumberBE(b.slice(from, to)); /** * ECDSA signature with its (r, s) properties. Supports DER & compact representations. */ class Signature { constructor(r, s, recovery) { this.r = r; this.s = s; this.recovery = recovery; this.assertValidity(); } // pair (bytes of r, bytes of s) static fromCompact(hex) { const l = CURVE.nByteLength; hex = ensureBytes('compactSignature', hex, l * 2); return new Signature(slcNum(hex, 0, l), slcNum(hex, l, 2 * l)); } // DER encoded ECDSA signature // https://bitcoin.stackexchange.com/questions/57644/what-are-the-parts-of-a-bitcoin-transaction-input-script static fromDER(hex) { const { r, s } = DER.toSig(ensureBytes('DER', hex)); return new Signature(r, s); } assertValidity() { // can use assertGE here if (!isWithinCurveOrder(this.r)) throw new Error('r must be 0 < r < CURVE.n'); if (!isWithinCurveOrder(this.s)) throw new Error('s must be 0 < s < CURVE.n'); } addRecoveryBit(recovery) { return new Signature(this.r, this.s, recovery); } recoverPublicKey(msgHash) { const { r, s, recovery: rec } = this; const h = bits2int_modN(ensureBytes('msgHash', msgHash)); // Truncate hash if (rec == null || ![0, 1, 2, 3].includes(rec)) throw new Error('recovery id invalid'); const radj = rec === 2 || rec === 3 ? r + CURVE.n : r; if (radj >= Fp.ORDER) throw new Error('recovery id 2 or 3 invalid'); const prefix = (rec & 1) === 0 ? '02' : '03'; const R = Point.fromHex(prefix + numToNByteStr(radj)); const ir = invN(radj); // r^-1 const u1 = modN(-h * ir); // -hr^-1 const u2 = modN(s * ir); // sr^-1 const Q = Point.BASE.multiplyAndAddUnsafe(R, u1, u2); // (sr^-1)R-(hr^-1)G = -(hr^-1)G + (sr^-1) if (!Q) throw new Error('point at infinify'); // unsafe is fine: no priv data leaked Q.assertValidity(); return Q; } // Signatures should be low-s, to prevent malleability. hasHighS() { return isBiggerThanHalfOrder(this.s); } normalizeS() { return this.hasHighS() ? new Signature(this.r, modN(-this.s), this.recovery) : this; } // DER-encoded toDERRawBytes() { return hexToBytes(this.toDERHex()); } toDERHex() { return DER.hexFromSig({ r: this.r, s: this.s }); } // padded bytes of r, then padded bytes of s toCompactRawBytes() { return hexToBytes(this.toCompactHex()); } toCompactHex() { return numToNByteStr(this.r) + numToNByteStr(this.s); } } const utils = { isValidPrivateKey(privateKey) { try { normPrivateKeyToScalar(privateKey); return true; } catch (error) { return false; } }, normPrivateKeyToScalar: normPrivateKeyToScalar, /** * Produces cryptographically secure private key from random of size * (groupLen + ceil(groupLen / 2)) with modulo bias being negligible. */ randomPrivateKey: () => { const length = getMinHashLength(CURVE.n); return mapHashToField(CURVE.randomBytes(length), CURVE.n); }, /** * Creates precompute table for an arbitrary EC point. Makes point "cached". * Allows to massively speed-up `point.multiply(scalar)`. * @returns cached point * @example * const fast = utils.precompute(8, ProjectivePoint.fromHex(someonesPubKey)); * fast.multiply(privKey); // much faster ECDH now */ precompute(windowSize = 8, point = Point.BASE) { point._setWindowSize(windowSize); point.multiply(BigInt(3)); // 3 is arbitrary, just need any number here return point; } }; /** * Computes public key for a private key. Checks for validity of the private key. * @param privateKey private key * @param isCompressed whether to return compact (default), or full key * @returns Public key, full when isCompressed=false; short when isCompressed=true */ function getPublicKey(privateKey, isCompressed = true) { return Point.fromPrivateKey(privateKey).toRawBytes(isCompressed); } /** * Quick and dirty check for item being public key. Does not validate hex, or being on-curve. */ function isProbPub(item) { const arr = item instanceof Uint8Array; const str = typeof item === 'string'; const len = (arr || str) && item.length; if (arr) return len === compressedLen || len === uncompressedLen; if (str) return len === 2 * compressedLen || len === 2 * uncompressedLen; if (item instanceof Point) return true; return false; } /** * ECDH (Elliptic Curve Diffie Hellman). * Computes shared public key from private key and public key. * Checks: 1) private key validity 2) shared key is on-curve. * Does NOT hash the result. * @param privateA private key * @param publicB different public key * @param isCompressed whether to return compact (default), or full key * @returns shared public key */ function getSharedSecret(privateA, publicB, isCompressed = true) { if (isProbPub(privateA)) throw new Error('first arg must be private key'); if (!isProbPub(publicB)) throw new Error('second arg must be public key'); const b = Point.fromHex(publicB); // check for being on-curve return b.multiply(normPrivateKeyToScalar(privateA)).toRawBytes(isCompressed); } // RFC6979: ensure ECDSA msg is X bytes and < N. RFC suggests optional truncating via bits2octets. // FIPS 186-4 4.6 suggests the leftmost min(nBitLen, outLen) bits, which matches bits2int. // bits2int can produce res>N, we can do mod(res, N) since the bitLen is the same. // int2octets can't be used; pads small msgs with 0: unacceptatble for trunc as per RFC vectors const bits2int = CURVE.bits2int || function (bytes) { // For curves with nBitLength % 8 !== 0: bits2octets(bits2octets(m)) !== bits2octets(m) // for some cases, since bytes.length * 8 is not actual bitLength. const num = bytesToNumberBE(bytes); // check for == u8 done here const delta = bytes.length * 8 - CURVE.nBitLength; // truncate to nBitLength leftmost bits return delta > 0 ? num >> BigInt(delta) : num; }; const bits2int_modN = CURVE.bits2int_modN || function (bytes) { return modN(bits2int(bytes)); // can't use bytesToNumberBE here }; // NOTE: pads output with zero as per spec const ORDER_MASK = bitMask(CURVE.nBitLength); /** * Converts to bytes. Checks if num in `[0..ORDER_MASK-1]` e.g.: `[0..2^256-1]`. */ function int2octets(num) { if (typeof num !== 'bigint') throw new Error('bigint expected'); if (!(_0n <= num && num < ORDER_MASK)) throw new Error(`bigint expected < 2^${CURVE.nBitLength}`); // works with order, can have different size than numToField! return numberToBytesBE(num, CURVE.nByteLength); } // Steps A, D of RFC6979 3.2 // Creates RFC6979 seed; converts msg/privKey to numbers. // Used only in sign, not in verify. // NOTE: we cannot assume here that msgHash has same amount of bytes as curve order, this will be wrong at least for P521. // Also it can be bigger for P224 + SHA256 function prepSig(msgHash, privateKey, opts = defaultSigOpts) { if (['recovered', 'canonical'].some(k => k in opts)) throw new Error('sign() legacy options not supported'); const { hash, randomBytes } = CURVE; let { lowS, prehash, extraEntropy: ent } = opts; // generates low-s sigs by default if (lowS == null) lowS = true; // RFC6979 3.2: we skip step A, because we already provide hash msgHash = ensureBytes('msgHash', msgHash); if (prehash) msgHash = ensureBytes('prehashed msgHash', hash(msgHash)); // We can't later call bits2octets, since nested bits2int is broken for curves // with nBitLength % 8 !== 0. Because of that, we unwrap it here as int2octets call. // const bits2octets = (bits) => int2octets(bits2int_modN(bits)) const h1int = bits2int_modN(msgHash); const d = normPrivateKeyToScalar(privateKey); // validate private key, convert to bigint const seedArgs = [int2octets(d), int2octets(h1int)]; // extraEntropy. RFC6979 3.6: additional k' (optional). if (ent != null) { // K = HMAC_K(V || 0x00 || int2octets(x) || bits2octets(h1) || k') const e = ent === true ? randomBytes(Fp.BYTES) : ent; // generate random bytes OR pass as-is seedArgs.push(ensureBytes('extraEntropy', e)); // check for being bytes } const seed = concatBytes(...seedArgs); // Step D of RFC6979 3.2 const m = h1int; // NOTE: no need to call bits2int second time here, it is inside truncateHash! // Converts signature params into point w r/s, checks result for validity. function k2sig(kBytes) { // RFC 6979 Section 3.2, step 3: k = bits2int(T) const k = bits2int(kBytes); // Cannot use fields methods, since it is group element if (!isWithinCurveOrder(k)) return; // Important: all mod() calls here must be done over N const ik = invN(k); // k^-1 mod n const q = Point.BASE.multiply(k).toAffine(); // q = Gk const r = modN(q.x); // r = q.x mod n if (r === _0n) return; // Can use scalar blinding b^-1(bm + bdr) where b ∈ [1,q−1] according to // https://tches.iacr.org/index.php/TCHES/article/view/7337/6509. We've decided against it: // a) dependency on CSPRNG b) 15% slowdown c) doesn't really help since bigints are not CT const s = modN(ik * modN(m + r * d)); // Not using blinding here if (s === _0n) return; let recovery = (q.x === r ? 0 : 2) | Number(q.y & _1n$1); // recovery bit (2 or 3, when q.x > n) let normS = s; if (lowS && isBiggerThanHalfOrder(s)) { normS = normalizeS(s); // if lowS was passed, ensure s is always recovery ^= 1; // // in the bottom half of N } return new Signature(r, normS, recovery); // use normS, not s } return { seed, k2sig }; } const defaultSigOpts = { lowS: CURVE.lowS, prehash: false }; const defaultVerOpts = { lowS: CURVE.lowS, prehash: false }; /** * Signs message hash with a private key. * ``` * sign(m, d, k) where * (x, y) = G × k * r = x mod n * s = (m + dr)/k mod n * ``` * @param msgHash NOT message. msg needs to be hashed to `msgHash`, or use `prehash`. * @param privKey private key * @param opts lowS for non-malleable sigs. extraEntropy for mixing randomness into k. prehash will hash first arg. * @returns signature with recovery param */ function sign(msgHash, privKey, opts = defaultSigOpts) { const { seed, k2sig } = prepSig(msgHash, privKey, opts); // Steps A, D of RFC6979 3.2. const C = CURVE; const drbg = createHmacDrbg(C.hash.outputLen, C.nByteLength, C.hmac); return drbg(seed, k2sig); // Steps B, C, D, E, F, G } // Enable precomputes. Slows down first publicKey computation by 20ms. Point.BASE._setWindowSize(8); // utils.precompute(8, ProjectivePoint.BASE) /** * Verifies a signature against message hash and public key. * Rejects lowS signatures by default: to override, * specify option `{lowS: false}`. Implements section 4.1.4 from https://www.secg.org/sec1-v2.pdf: * * ``` * verify(r, s, h, P) where * U1 = hs^-1 mod n * U2 = rs^-1 mod n * R = U1⋅G - U2⋅P * mod(R.x, n) == r * ``` */ function verify(signature, msgHash, publicKey, opts = defaultVerOpts) { const sg = signature; msgHash = ensureBytes('msgHash', msgHash); publicKey = ensureBytes('publicKey', publicKey); if ('strict' in opts) throw new Error('options.strict was renamed to lowS'); const { lowS, prehash } = opts; let _sig = undefined; let P; try { if (typeof sg === 'string' || sg instanceof Uint8Array) { // Signature can be represented in 2 ways: compact (2*nByteLength) & DER (variable-length). // Since DER can also be 2*nByteLength bytes, we check for it first. try { _sig = Signature.fromDER(sg); } catch (derError) { if (!(derError instanceof DER.Err)) throw derError; _sig = Signature.fromCompact(sg); } } else if (typeof sg === 'object' && typeof sg.r === 'bigint' && typeof sg.s === 'bigint') { const { r, s } = sg; _sig = new Signature(r, s); } else { throw new Error('PARSE'); } P = Point.fromHex(publicKey); } catch (error) { if (error.message === 'PARSE') throw new Error(`signature must be Signature instance, Uint8Array or hex string`); return false; } if (lowS && _sig.hasHighS()) return false; if (prehash) msgHash = CURVE.hash(msgHash); const { r, s } = _sig; const h = bits2int_modN(msgHash); // Cannot use fields methods, since it is group element const is = invN(s); // s^-1 const u1 = modN(h * is); // u1 = hs^-1 mod n const u2 = modN(r * is); // u2 = rs^-1 mod n const R = Point.BASE.multiplyAndAddUnsafe(P, u1, u2)?.toAffine(); // R = u1⋅G + u2⋅P if (!R) return false; const v = modN(R.x); return v === r; } return { CURVE, getPublicKey, getSharedSecret, sign, verify, ProjectivePoint: Point, Signature, utils }; } /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ // connects noble-curves to noble-hashes function getHash(hash) { return { hash, hmac: (key, ...msgs) => hmac(hash, key, concatBytes$1(...msgs)), randomBytes: randomBytes$2 }; } function createCurve(curveDef, defHash) { const create = hash => weierstrass({ ...curveDef, ...getHash(hash) }); return Object.freeze({ ...create(defHash), create }); } /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ const secp256k1P = BigInt('0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f'); const secp256k1N = BigInt('0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141'); const _1n = BigInt(1); const _2n = BigInt(2); const divNearest = (a, b) => (a + b / _2n) / b; /** * √n = n^((p+1)/4) for fields p = 3 mod 4. We unwrap the loop and multiply bit-by-bit. * (P+1n/4n).toString(2) would produce bits [223x 1, 0, 22x 1, 4x 0, 11, 00] */ function sqrtMod(y) { const P = secp256k1P; // prettier-ignore const _3n = BigInt(3), _6n = BigInt(6), _11n = BigInt(11), _22n = BigInt(22); // prettier-ignore const _23n = BigInt(23), _44n = BigInt(44), _88n = BigInt(88); const b2 = y * y * y % P; // x^3, 11 const b3 = b2 * b2 * y % P; // x^7 const b6 = pow2(b3, _3n, P) * b3 % P; const b9 = pow2(b6, _3n, P) * b3 % P; const b11 = pow2(b9, _2n, P) * b2 % P; const b22 = pow2(b11, _11n, P) * b11 % P; const b44 = pow2(b22, _22n, P) * b22 % P; const b88 = pow2(b44, _44n, P) * b44 % P; const b176 = pow2(b88, _88n, P) * b88 % P; const b220 = pow2(b176, _44n, P) * b44 % P; const b223 = pow2(b220, _3n, P) * b3 % P; const t1 = pow2(b223, _23n, P) * b22 % P; const t2 = pow2(t1, _6n, P) * b2 % P; const root = pow2(t2, _2n, P); if (!Fp.eql(Fp.sqr(root), y)) throw new Error('Cannot find square root'); return root; } const Fp = Field(secp256k1P, undefined, undefined, { sqrt: sqrtMod }); const secp256k1 = createCurve({ a: BigInt(0), b: BigInt(7), Fp, n: secp256k1N, // Base point (x, y) aka generator point Gx: BigInt('55066263022277343669578718895168534326250603453777594175500187360389116729240'), Gy: BigInt('32670510020758816978083085130507043184471273380659243275938904335757337482424'), h: BigInt(1), lowS: true, /** * secp256k1 belongs to Koblitz curves: it has efficiently computable endomorphism. * Endomorphism uses 2x less RAM, speeds up precomputation by 2x and ECDH / key recovery by 20%. * For precomputed wNAF it trades off 1/2 init time & 1/3 ram for 20% perf hit. * Explanation: https://gist.github.com/paulmillr/eb670806793e84df628a7c434a873066 */ endo: { beta: BigInt('0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee'), splitScalar: k => { const n = secp256k1N; const a1 = BigInt('0x3086d221a7d46bcde86c90e49284eb15'); const b1 = -_1n * BigInt('0xe4437ed6010e88286f547fa90abfe4c3'); const a2 = BigInt('0x114ca50f7a8e2f3f657c1108d9d44cfd8'); const b2 = a1; const POW_2_128 = BigInt('0x100000000000000000000000000000000'); // (2n**128n).toString(16) const c1 = divNearest(b2 * k, n); const c2 = divNearest(-b1 * k, n); let k1 = mod(k - c1 * a1 - c2 * a2, n); let k2 = mod(-c1 * b1 - c2 * b2, n); const k1neg = k1 > POW_2_128; const k2neg = k2 > POW_2_128; if (k1neg) k1 = n - k1; if (k2neg) k2 = n - k2; if (k1 > POW_2_128 || k2 > POW_2_128) { throw new Error('splitScalar: Endomorphism failed, k=' + k); } return { k1neg, k1, k2neg, k2 }; } } }, sha256$1); // Schnorr signatures are superior to ECDSA from above. Below is Schnorr-specific BIP0340 code. // https://github.com/bitcoin/bips/blob/master/bip-0340.mediawiki BigInt(0); secp256k1.ProjectivePoint; /** * A constant for the zero address. * * (**i.e.** ``"0x0000000000000000000000000000000000000000"``) */ const ZeroAddress = "0x0000000000000000000000000000000000000000"; /** * A constant for the zero hash. * * (**i.e.** ``"0x0000000000000000000000000000000000000000000000000000000000000000"``) */ const ZeroHash = "0x0000000000000000000000000000000000000000000000000000000000000000"; // NFKC (composed) // (decomposed) /** * A constant for the ether symbol (normalized using NFKC). * * (**i.e.** ``"\\u039e"``) */ /** * A constant for the [[link-eip-191]] personal message prefix. * * (**i.e.** ``"\\x19Ethereum Signed Message:\\n"``) */ const MessagePrefix = "\x19Ethereum Signed Message:\n"; // Constants const BN_0$7 = BigInt(0); const BN_1$2 = BigInt(1); const BN_2$2 = BigInt(2); const BN_27$1 = BigInt(27); const BN_28$1 = BigInt(28); const BN_35$1 = BigInt(35); const _guard$3 = {}; function toUint256(value) { return zeroPadValue(toBeArray(value), 32); } /** * A Signature @TODO * * * @_docloc: api/crypto:Signing */ class Signature { #r; #s; #v; #networkV; /** * The ``r`` value for a signautre. * * This represents the ``x`` coordinate of a "reference" or * challenge point, from which the ``y`` can be computed. */ get r() { return this.#r; } set r(value) { assertArgument(dataLength(value) === 32, "invalid r", "value", value); this.#r = hexlify(value); } /** * The ``s`` value for a signature. */ get s() { return this.#s; } set s(_value) { assertArgument(dataLength(_value) === 32, "invalid s", "value", _value); const value = hexlify(_value); assertArgument(parseInt(value.substring(0, 3)) < 8, "non-canonical s", "value", value); this.#s = value; } /** * The ``v`` value for a signature. * * Since a given ``x`` value for ``r`` has two possible values for * its correspondin ``y``, the ``v`` indicates which of the two ``y`` * values to use. * * It is normalized to the values ``27`` or ``28`` for legacy * purposes. */ get v() { return this.#v; } set v(value) { const v = getNumber(value, "value"); assertArgument(v === 27 || v === 28, "invalid v", "v", value); this.#v = v; } /** * The EIP-155 ``v`` for legacy transactions. For non-legacy * transactions, this value is ``null``. */ get networkV() { return this.#networkV; } /** * The chain ID for EIP-155 legacy transactions. For non-legacy * transactions, this value is ``null``. */ get legacyChainId() { const v = this.networkV; if (v == null) { return null; } return Signature.getChainId(v); } /** * The ``yParity`` for the signature. * * See ``v`` for more details on how this value is used. */ get yParity() { return this.v === 27 ? 0 : 1; } /** * The [[link-eip-2098]] compact representation of the ``yParity`` * and ``s`` compacted into a single ``bytes32``. */ get yParityAndS() { // The EIP-2098 compact representation const yParityAndS = getBytes(this.s); if (this.yParity) { yParityAndS[0] |= 0x80; } return hexlify(yParityAndS); } /** * The [[link-eip-2098]] compact representation. */ get compactSerialized() { return concat([this.r, this.yParityAndS]); } /** * The serialized representation. */ get serialized() { return concat([this.r, this.s, this.yParity ? "0x1c" : "0x1b"]); } /** * @private */ constructor(guard, r, s, v) { assertPrivate(guard, _guard$3, "Signature"); this.#r = r; this.#s = s; this.#v = v; this.#networkV = null; } [Symbol.for('nodejs.util.inspect.custom')]() { return `Signature { r: "${this.r}", s: "${this.s}", yParity: ${this.yParity}, networkV: ${this.networkV} }`; } /** * Returns a new identical [[Signature]]. */ clone() { const clone = new Signature(_guard$3, this.r, this.s, this.v); if (this.networkV) { clone.#networkV = this.networkV; } return clone; } /** * Returns a representation that is compatible with ``JSON.stringify``. */ toJSON() { const networkV = this.networkV; return { _type: "signature", networkV: networkV != null ? networkV.toString() : null, r: this.r, s: this.s, v: this.v }; } /** * Compute the chain ID from the ``v`` in a legacy EIP-155 transactions. * * @example: * Signature.getChainId(45) * //_result: * * Signature.getChainId(46) * //_result: */ static getChainId(v) { const bv = getBigInt(v, "v"); // The v is not an EIP-155 v, so it is the unspecified chain ID if (bv == BN_27$1 || bv == BN_28$1) { return BN_0$7; } // Bad value for an EIP-155 v assertArgument(bv >= BN_35$1, "invalid EIP-155 v", "v", v); return (bv - BN_35$1) / BN_2$2; } /** * Compute the ``v`` for a chain ID for a legacy EIP-155 transactions. * * Legacy transactions which use [[link-eip-155]] hijack the ``v`` * property to include the chain ID. * * @example: * Signature.getChainIdV(5, 27) * //_result: * * Signature.getChainIdV(5, 28) * //_result: * */ static getChainIdV(chainId, v) { return getBigInt(chainId) * BN_2$2 + BigInt(35 + v - 27); } /** * Compute the normalized legacy transaction ``v`` from a ``yParirty``, * a legacy transaction ``v`` or a legacy [[link-eip-155]] transaction. * * @example: * // The values 0 and 1 imply v is actually yParity * Signature.getNormalizedV(0) * //_result: * * // Legacy non-EIP-1559 transaction (i.e. 27 or 28) * Signature.getNormalizedV(27) * //_result: * * // Legacy EIP-155 transaction (i.e. >= 35) * Signature.getNormalizedV(46) * //_result: * * // Invalid values throw * Signature.getNormalizedV(5) * //_error: */ static getNormalizedV(v) { const bv = getBigInt(v); if (bv === BN_0$7 || bv === BN_27$1) { return 27; } if (bv === BN_1$2 || bv === BN_28$1) { return 28; } assertArgument(bv >= BN_35$1, "invalid v", "v", v); // Otherwise, EIP-155 v means odd is 27 and even is 28 return bv & BN_1$2 ? 27 : 28; } /** * Creates a new [[Signature]]. * * If no %%sig%% is provided, a new [[Signature]] is created * with default values. * * If %%sig%% is a string, it is parsed. */ static from(sig) { function assertError(check, message) { assertArgument(check, message, "signature", sig); } if (sig == null) { return new Signature(_guard$3, ZeroHash, ZeroHash, 27); } if (typeof sig === "string") { const bytes = getBytes(sig, "signature"); if (bytes.length === 64) { const r = hexlify(bytes.slice(0, 32)); const s = bytes.slice(32, 64); const v = s[0] & 0x80 ? 28 : 27; s[0] &= 0x7f; return new Signature(_guard$3, r, hexlify(s), v); } if (bytes.length === 65) { const r = hexlify(bytes.slice(0, 32)); const s = bytes.slice(32, 64); assertError((s[0] & 0x80) === 0, "non-canonical s"); const v = Signature.getNormalizedV(bytes[64]); return new Signature(_guard$3, r, hexlify(s), v); } assertError(false, "invalid raw signature length"); } if (sig instanceof Signature) { return sig.clone(); } // Get r const _r = sig.r; assertError(_r != null, "missing r"); const r = toUint256(_r); // Get s; by any means necessary (we check consistency below) const s = function (s, yParityAndS) { if (s != null) { return toUint256(s); } if (yParityAndS != null) { assertError(isHexString(yParityAndS, 32), "invalid yParityAndS"); const bytes = getBytes(yParityAndS); bytes[0] &= 0x7f; return hexlify(bytes); } assertError(false, "missing s"); }(sig.s, sig.yParityAndS); assertError((getBytes(s)[0] & 0x80) == 0, "non-canonical s"); // Get v; by any means necessary (we check consistency below) const { networkV, v } = function (_v, yParityAndS, yParity) { if (_v != null) { const v = getBigInt(_v); return { networkV: v >= BN_35$1 ? v : undefined, v: Signature.getNormalizedV(v) }; } if (yParityAndS != null) { assertError(isHexString(yParityAndS, 32), "invalid yParityAndS"); return { v: getBytes(yParityAndS)[0] & 0x80 ? 28 : 27 }; } if (yParity != null) { switch (getNumber(yParity, "sig.yParity")) { case 0: return { v: 27 }; case 1: return { v: 28 }; } assertError(false, "invalid yParity"); } assertError(false, "missing v"); }(sig.v, sig.yParityAndS, sig.yParity); const result = new Signature(_guard$3, r, s, v); if (networkV) { result.#networkV = networkV; } // If multiple of v, yParity, yParityAndS we given, check they match assertError(sig.yParity == null || getNumber(sig.yParity, "sig.yParity") === result.yParity, "yParity mismatch"); assertError(sig.yParityAndS == null || sig.yParityAndS === result.yParityAndS, "yParityAndS mismatch"); return result; } } /** * Add details about signing here. * * @_subsection: api/crypto:Signing [about-signing] */ /** * A **SigningKey** provides high-level access to the elliptic curve * cryptography (ECC) operations and key management. */ class SigningKey { #privateKey; /** * Creates a new **SigningKey** for %%privateKey%%. */ constructor(privateKey) { assertArgument(dataLength(privateKey) === 32, "invalid private key", "privateKey", "[REDACTED]"); this.#privateKey = hexlify(privateKey); } /** * The private key. */ get privateKey() { return this.#privateKey; } /** * The uncompressed public key. * * This will always begin with the prefix ``0x04`` and be 132 * characters long (the ``0x`` prefix and 130 hexadecimal nibbles). */ get publicKey() { return SigningKey.computePublicKey(this.#privateKey); } /** * The compressed public key. * * This will always begin with either the prefix ``0x02`` or ``0x03`` * and be 68 characters long (the ``0x`` prefix and 33 hexadecimal * nibbles) */ get compressedPublicKey() { return SigningKey.computePublicKey(this.#privateKey, true); } /** * Return the signature of the signed %%digest%%. */ sign(digest) { assertArgument(dataLength(digest) === 32, "invalid digest length", "digest", digest); const sig = secp256k1.sign(getBytesCopy(digest), getBytesCopy(this.#privateKey), { lowS: true }); return Signature.from({ r: toBeHex(sig.r, 32), s: toBeHex(sig.s, 32), v: sig.recovery ? 0x1c : 0x1b }); } /** * Returns the [[link-wiki-ecdh]] shared secret between this * private key and the %%other%% key. * * The %%other%% key may be any type of key, a raw public key, * a compressed/uncompressed pubic key or aprivate key. * * Best practice is usually to use a cryptographic hash on the * returned value before using it as a symetric secret. * * @example: * sign1 = new SigningKey(id("some-secret-1")) * sign2 = new SigningKey(id("some-secret-2")) * * // Notice that privA.computeSharedSecret(pubB)... * sign1.computeSharedSecret(sign2.publicKey) * //_result: * * // ...is equal to privB.computeSharedSecret(pubA). * sign2.computeSharedSecret(sign1.publicKey) * //_result: */ computeSharedSecret(other) { const pubKey = SigningKey.computePublicKey(other); return hexlify(secp256k1.getSharedSecret(getBytesCopy(this.#privateKey), getBytes(pubKey), false)); } /** * Compute the public key for %%key%%, optionally %%compressed%%. * * The %%key%% may be any type of key, a raw public key, a * compressed/uncompressed public key or private key. * * @example: * sign = new SigningKey(id("some-secret")); * * // Compute the uncompressed public key for a private key * SigningKey.computePublicKey(sign.privateKey) * //_result: * * // Compute the compressed public key for a private key * SigningKey.computePublicKey(sign.privateKey, true) * //_result: * * // Compute the uncompressed public key * SigningKey.computePublicKey(sign.publicKey, false); * //_result: * * // Compute the Compressed a public key * SigningKey.computePublicKey(sign.publicKey, true); * //_result: */ static computePublicKey(key, compressed) { let bytes = getBytes(key, "key"); // private key if (bytes.length === 32) { const pubKey = secp256k1.getPublicKey(bytes, !!compressed); return hexlify(pubKey); } // raw public key; use uncompressed key with 0x04 prefix if (bytes.length === 64) { const pub = new Uint8Array(65); pub[0] = 0x04; pub.set(bytes, 1); bytes = pub; } const point = secp256k1.ProjectivePoint.fromHex(bytes); return hexlify(point.toRawBytes(compressed)); } /** * Returns the public key for the private key which produced the * %%signature%% for the given %%digest%%. * * @example: * key = new SigningKey(id("some-secret")) * digest = id("hello world") * sig = key.sign(digest) * * // Notice the signer public key... * key.publicKey * //_result: * * // ...is equal to the recovered public key * SigningKey.recoverPublicKey(digest, sig) * //_result: * */ static recoverPublicKey(digest, signature) { assertArgument(dataLength(digest) === 32, "invalid digest length", "digest", digest); const sig = Signature.from(signature); let secpSig = secp256k1.Signature.fromCompact(getBytesCopy(concat([sig.r, sig.s]))); secpSig = secpSig.addRecoveryBit(sig.yParity); const pubKey = secpSig.recoverPublicKey(getBytesCopy(digest)); assertArgument(pubKey != null, "invalid signautre for digest", "signature", signature); return "0x" + pubKey.toHex(false); } /** * Returns the point resulting from adding the ellipic curve points * %%p0%% and %%p1%%. * * This is not a common function most developers should require, but * can be useful for certain privacy-specific techniques. * * For example, it is used by [[HDNodeWallet]] to compute child * addresses from parent public keys and chain codes. */ static addPoints(p0, p1, compressed) { const pub0 = secp256k1.ProjectivePoint.fromHex(SigningKey.computePublicKey(p0).substring(2)); const pub1 = secp256k1.ProjectivePoint.fromHex(SigningKey.computePublicKey(p1).substring(2)); return "0x" + pub0.add(pub1).toHex(!!compressed); } } const BN_0$6 = BigInt(0); const BN_36 = BigInt(36); function getChecksumAddress(address) { // if (!isHexString(address, 20)) { // logger.throwArgumentError("invalid address", "address", address); // } address = address.toLowerCase(); const chars = address.substring(2).split(""); const expanded = new Uint8Array(40); for (let i = 0; i < 40; i++) { expanded[i] = chars[i].charCodeAt(0); } const hashed = getBytes(keccak256(expanded)); for (let i = 0; i < 40; i += 2) { if (hashed[i >> 1] >> 4 >= 8) { chars[i] = chars[i].toUpperCase(); } if ((hashed[i >> 1] & 0x0f) >= 8) { chars[i + 1] = chars[i + 1].toUpperCase(); } } return "0x" + chars.join(""); } // See: https://en.wikipedia.org/wiki/International_Bank_Account_Number // Create lookup table const ibanLookup = {}; for (let i = 0; i < 10; i++) { ibanLookup[String(i)] = String(i); } for (let i = 0; i < 26; i++) { ibanLookup[String.fromCharCode(65 + i)] = String(10 + i); } // How many decimal digits can we process? (for 64-bit float, this is 15) // i.e. Math.floor(Math.log10(Number.MAX_SAFE_INTEGER)); const safeDigits = 15; function ibanChecksum(address) { address = address.toUpperCase(); address = address.substring(4) + address.substring(0, 2) + "00"; let expanded = address.split("").map(c => { return ibanLookup[c]; }).join(""); // Javascript can handle integers safely up to 15 (decimal) digits while (expanded.length >= safeDigits) { let block = expanded.substring(0, safeDigits); expanded = parseInt(block, 10) % 97 + expanded.substring(block.length); } let checksum = String(98 - parseInt(expanded, 10) % 97); while (checksum.length < 2) { checksum = "0" + checksum; } return checksum; } const Base36 = function () { const result = {}; for (let i = 0; i < 36; i++) { const key = "0123456789abcdefghijklmnopqrstuvwxyz"[i]; result[key] = BigInt(i); } return result; }(); function fromBase36(value) { value = value.toLowerCase(); let result = BN_0$6; for (let i = 0; i < value.length; i++) { result = result * BN_36 + Base36[value[i]]; } return result; } /** * Returns a normalized and checksumed address for %%address%%. * This accepts non-checksum addresses, checksum addresses and * [[getIcapAddress]] formats. * * The checksum in Ethereum uses the capitalization (upper-case * vs lower-case) of the characters within an address to encode * its checksum, which offers, on average, a checksum of 15-bits. * * If %%address%% contains both upper-case and lower-case, it is * assumed to already be a checksum address and its checksum is * validated, and if the address fails its expected checksum an * error is thrown. * * If you wish the checksum of %%address%% to be ignore, it should * be converted to lower-case (i.e. ``.toLowercase()``) before * being passed in. This should be a very rare situation though, * that you wish to bypass the safegaurds in place to protect * against an address that has been incorrectly copied from another * source. * * @example: * // Adds the checksum (via upper-casing specific letters) * getAddress("0x8ba1f109551bd432803012645ac136ddd64dba72") * //_result: * * // Converts ICAP address and adds checksum * getAddress("XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK36"); * //_result: * * // Throws an error if an address contains mixed case, * // but the checksum fails * getAddress("0x8Ba1f109551bD432803012645Ac136ddd64DBA72") * //_error: */ function getAddress(address) { assertArgument(typeof address === "string", "invalid address", "address", address); if (address.match(/^(0x)?[0-9a-fA-F]{40}$/)) { // Missing the 0x prefix if (!address.startsWith("0x")) { address = "0x" + address; } const result = getChecksumAddress(address); // It is a checksummed address with a bad checksum assertArgument(!address.match(/([A-F].*[a-f])|([a-f].*[A-F])/) || result === address, "bad address checksum", "address", address); return result; } // Maybe ICAP? (we only support direct mode) if (address.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)) { // It is an ICAP address with a bad checksum assertArgument(address.substring(2, 4) === ibanChecksum(address), "bad icap checksum", "address", address); let result = fromBase36(address.substring(4)).toString(16); while (result.length < 40) { result = "0" + result; } return getChecksumAddress("0x" + result); } assertArgument(false, "invalid address", "address", address); } // http://ethereum.stackexchange.com/questions/760/how-is-the-address-of-an-ethereum-contract-computed /** * Returns the address that would result from a ``CREATE`` for %%tx%%. * * This can be used to compute the address a contract will be * deployed to by an EOA when sending a deployment transaction (i.e. * when the ``to`` address is ``null``). * * This can also be used to compute the address a contract will be * deployed to by a contract, by using the contract's address as the * ``to`` and the contract's nonce. * * @example * from = "0x8ba1f109551bD432803012645Ac136ddd64DBA72"; * nonce = 5; * * getCreateAddress({ from, nonce }); * //_result: */ function getCreateAddress(tx) { const from = getAddress(tx.from); const nonce = getBigInt(tx.nonce, "tx.nonce"); let nonceHex = nonce.toString(16); if (nonceHex === "0") { nonceHex = "0x"; } else if (nonceHex.length % 2) { nonceHex = "0x0" + nonceHex; } else { nonceHex = "0x" + nonceHex; } return getAddress(dataSlice(keccak256(encodeRlp([from, nonceHex])), 12)); } /** * Returns true if %%value%% is an object which implements the * [[Addressable]] interface. * * @example: * // Wallets and AbstractSigner sub-classes * isAddressable(Wallet.createRandom()) * //_result: * * // Contracts * contract = new Contract("dai.tokens.ethers.eth", [ ], provider) * isAddressable(contract) * //_result: */ function isAddressable(value) { return value && typeof value.getAddress === "function"; } async function checkAddress(target, promise) { const result = await promise; if (result == null || result === "0x0000000000000000000000000000000000000000") { assert(typeof target !== "string", "unconfigured name", "UNCONFIGURED_NAME", { value: target }); assertArgument(false, "invalid AddressLike value; did not resolve to a value address", "target", target); } return getAddress(result); } /** * Resolves to an address for the %%target%%, which may be any * supported address type, an [[Addressable]] or a Promise which * resolves to an address. * * If an ENS name is provided, but that name has not been correctly * configured a [[UnconfiguredNameError]] is thrown. * * @example: * addr = "0x6B175474E89094C44Da98b954EedeAC495271d0F" * * // Addresses are return synchronously * resolveAddress(addr, provider) * //_result: * * // Address promises are resolved asynchronously * resolveAddress(Promise.resolve(addr)) * //_result: * * // ENS names are resolved asynchronously * resolveAddress("dai.tokens.ethers.eth", provider) * //_result: * * // Addressable objects are resolved asynchronously * contract = new Contract(addr, [ ]) * resolveAddress(contract, provider) * //_result: * * // Unconfigured ENS names reject * resolveAddress("nothing-here.ricmoo.eth", provider) * //_error: * * // ENS names require a NameResolver object passed in * // (notice the provider was omitted) * resolveAddress("nothing-here.ricmoo.eth") * //_error: */ function resolveAddress(target, resolver) { if (typeof target === "string") { if (target.match(/^0x[0-9a-f]{40}$/i)) { return getAddress(target); } assert(resolver != null, "ENS resolution requires a provider", "UNSUPPORTED_OPERATION", { operation: "resolveName" }); return checkAddress(target, resolver.resolveName(target)); } else if (isAddressable(target)) { return checkAddress(target, target.getAddress()); } else if (target && typeof target.then === "function") { return checkAddress(target, target); } assertArgument(false, "unsupported addressable value", "target", target); } /** * A Typed object allows a value to have its type explicitly * specified. * * For example, in Solidity, the value ``45`` could represent a * ``uint8`` or a ``uint256``. The value ``0x1234`` could represent * a ``bytes2`` or ``bytes``. * * Since JavaScript has no meaningful way to explicitly inform any * APIs which what the type is, this allows transparent interoperation * with Soldity. * * @_subsection: api/abi:Typed Values */ const _gaurd = {}; function n(value, width) { let signed = false; if (width < 0) { signed = true; width *= -1; } // @TODO: Check range is valid for value return new Typed(_gaurd, `${signed ? "" : "u"}int${width}`, value, { signed, width }); } function b(value, size) { // @TODO: Check range is valid for value return new Typed(_gaurd, `bytes${size ? size : ""}`, value, { size }); } const _typedSymbol = Symbol.for("_ethers_typed"); /** * The **Typed** class to wrap values providing explicit type information. */ class Typed { /** * The type, as a Solidity-compatible type. */ type; /** * The actual value. */ value; #options; /** * @_ignore: */ _typedSymbol; /** * @_ignore: */ constructor(gaurd, type, value, options) { if (options == null) { options = null; } assertPrivate(_gaurd, gaurd, "Typed"); defineProperties(this, { _typedSymbol, type, value }); this.#options = options; // Check the value is valid this.format(); } /** * Format the type as a Human-Readable type. */ format() { if (this.type === "array") { throw new Error(""); } else if (this.type === "dynamicArray") { throw new Error(""); } else if (this.type === "tuple") { return `tuple(${this.value.map(v => v.format()).join(",")})`; } return this.type; } /** * The default value returned by this type. */ defaultValue() { return 0; } /** * The minimum value for numeric types. */ minValue() { return 0; } /** * The maximum value for numeric types. */ maxValue() { return 0; } /** * Returns ``true`` and provides a type guard is this is a [[TypedBigInt]]. */ isBigInt() { return !!this.type.match(/^u?int[0-9]+$/); } /** * Returns ``true`` and provides a type guard is this is a [[TypedData]]. */ isData() { return this.type.startsWith("bytes"); } /** * Returns ``true`` and provides a type guard is this is a [[TypedString]]. */ isString() { return this.type === "string"; } /** * Returns the tuple name, if this is a tuple. Throws otherwise. */ get tupleName() { if (this.type !== "tuple") { throw TypeError("not a tuple"); } return this.#options; } // Returns the length of this type as an array // - `null` indicates the length is unforced, it could be dynamic // - `-1` indicates the length is dynamic // - any other value indicates it is a static array and is its length /** * Returns the length of the array type or ``-1`` if it is dynamic. * * Throws if the type is not an array. */ get arrayLength() { if (this.type !== "array") { throw TypeError("not an array"); } if (this.#options === true) { return -1; } if (this.#options === false) { return this.value.length; } return null; } /** * Returns a new **Typed** of %%type%% with the %%value%%. */ static from(type, value) { return new Typed(_gaurd, type, value); } /** * Return a new ``uint8`` type for %%v%%. */ static uint8(v) { return n(v, 8); } /** * Return a new ``uint16`` type for %%v%%. */ static uint16(v) { return n(v, 16); } /** * Return a new ``uint24`` type for %%v%%. */ static uint24(v) { return n(v, 24); } /** * Return a new ``uint32`` type for %%v%%. */ static uint32(v) { return n(v, 32); } /** * Return a new ``uint40`` type for %%v%%. */ static uint40(v) { return n(v, 40); } /** * Return a new ``uint48`` type for %%v%%. */ static uint48(v) { return n(v, 48); } /** * Return a new ``uint56`` type for %%v%%. */ static uint56(v) { return n(v, 56); } /** * Return a new ``uint64`` type for %%v%%. */ static uint64(v) { return n(v, 64); } /** * Return a new ``uint72`` type for %%v%%. */ static uint72(v) { return n(v, 72); } /** * Return a new ``uint80`` type for %%v%%. */ static uint80(v) { return n(v, 80); } /** * Return a new ``uint88`` type for %%v%%. */ static uint88(v) { return n(v, 88); } /** * Return a new ``uint96`` type for %%v%%. */ static uint96(v) { return n(v, 96); } /** * Return a new ``uint104`` type for %%v%%. */ static uint104(v) { return n(v, 104); } /** * Return a new ``uint112`` type for %%v%%. */ static uint112(v) { return n(v, 112); } /** * Return a new ``uint120`` type for %%v%%. */ static uint120(v) { return n(v, 120); } /** * Return a new ``uint128`` type for %%v%%. */ static uint128(v) { return n(v, 128); } /** * Return a new ``uint136`` type for %%v%%. */ static uint136(v) { return n(v, 136); } /** * Return a new ``uint144`` type for %%v%%. */ static uint144(v) { return n(v, 144); } /** * Return a new ``uint152`` type for %%v%%. */ static uint152(v) { return n(v, 152); } /** * Return a new ``uint160`` type for %%v%%. */ static uint160(v) { return n(v, 160); } /** * Return a new ``uint168`` type for %%v%%. */ static uint168(v) { return n(v, 168); } /** * Return a new ``uint176`` type for %%v%%. */ static uint176(v) { return n(v, 176); } /** * Return a new ``uint184`` type for %%v%%. */ static uint184(v) { return n(v, 184); } /** * Return a new ``uint192`` type for %%v%%. */ static uint192(v) { return n(v, 192); } /** * Return a new ``uint200`` type for %%v%%. */ static uint200(v) { return n(v, 200); } /** * Return a new ``uint208`` type for %%v%%. */ static uint208(v) { return n(v, 208); } /** * Return a new ``uint216`` type for %%v%%. */ static uint216(v) { return n(v, 216); } /** * Return a new ``uint224`` type for %%v%%. */ static uint224(v) { return n(v, 224); } /** * Return a new ``uint232`` type for %%v%%. */ static uint232(v) { return n(v, 232); } /** * Return a new ``uint240`` type for %%v%%. */ static uint240(v) { return n(v, 240); } /** * Return a new ``uint248`` type for %%v%%. */ static uint248(v) { return n(v, 248); } /** * Return a new ``uint256`` type for %%v%%. */ static uint256(v) { return n(v, 256); } /** * Return a new ``uint256`` type for %%v%%. */ static uint(v) { return n(v, 256); } /** * Return a new ``int8`` type for %%v%%. */ static int8(v) { return n(v, -8); } /** * Return a new ``int16`` type for %%v%%. */ static int16(v) { return n(v, -16); } /** * Return a new ``int24`` type for %%v%%. */ static int24(v) { return n(v, -24); } /** * Return a new ``int32`` type for %%v%%. */ static int32(v) { return n(v, -32); } /** * Return a new ``int40`` type for %%v%%. */ static int40(v) { return n(v, -40); } /** * Return a new ``int48`` type for %%v%%. */ static int48(v) { return n(v, -48); } /** * Return a new ``int56`` type for %%v%%. */ static int56(v) { return n(v, -56); } /** * Return a new ``int64`` type for %%v%%. */ static int64(v) { return n(v, -64); } /** * Return a new ``int72`` type for %%v%%. */ static int72(v) { return n(v, -72); } /** * Return a new ``int80`` type for %%v%%. */ static int80(v) { return n(v, -80); } /** * Return a new ``int88`` type for %%v%%. */ static int88(v) { return n(v, -88); } /** * Return a new ``int96`` type for %%v%%. */ static int96(v) { return n(v, -96); } /** * Return a new ``int104`` type for %%v%%. */ static int104(v) { return n(v, -104); } /** * Return a new ``int112`` type for %%v%%. */ static int112(v) { return n(v, -112); } /** * Return a new ``int120`` type for %%v%%. */ static int120(v) { return n(v, -120); } /** * Return a new ``int128`` type for %%v%%. */ static int128(v) { return n(v, -128); } /** * Return a new ``int136`` type for %%v%%. */ static int136(v) { return n(v, -136); } /** * Return a new ``int144`` type for %%v%%. */ static int144(v) { return n(v, -144); } /** * Return a new ``int52`` type for %%v%%. */ static int152(v) { return n(v, -152); } /** * Return a new ``int160`` type for %%v%%. */ static int160(v) { return n(v, -160); } /** * Return a new ``int168`` type for %%v%%. */ static int168(v) { return n(v, -168); } /** * Return a new ``int176`` type for %%v%%. */ static int176(v) { return n(v, -176); } /** * Return a new ``int184`` type for %%v%%. */ static int184(v) { return n(v, -184); } /** * Return a new ``int92`` type for %%v%%. */ static int192(v) { return n(v, -192); } /** * Return a new ``int200`` type for %%v%%. */ static int200(v) { return n(v, -200); } /** * Return a new ``int208`` type for %%v%%. */ static int208(v) { return n(v, -208); } /** * Return a new ``int216`` type for %%v%%. */ static int216(v) { return n(v, -216); } /** * Return a new ``int224`` type for %%v%%. */ static int224(v) { return n(v, -224); } /** * Return a new ``int232`` type for %%v%%. */ static int232(v) { return n(v, -232); } /** * Return a new ``int240`` type for %%v%%. */ static int240(v) { return n(v, -240); } /** * Return a new ``int248`` type for %%v%%. */ static int248(v) { return n(v, -248); } /** * Return a new ``int256`` type for %%v%%. */ static int256(v) { return n(v, -256); } /** * Return a new ``int256`` type for %%v%%. */ static int(v) { return n(v, -256); } /** * Return a new ``bytes1`` type for %%v%%. */ static bytes1(v) { return b(v, 1); } /** * Return a new ``bytes2`` type for %%v%%. */ static bytes2(v) { return b(v, 2); } /** * Return a new ``bytes3`` type for %%v%%. */ static bytes3(v) { return b(v, 3); } /** * Return a new ``bytes4`` type for %%v%%. */ static bytes4(v) { return b(v, 4); } /** * Return a new ``bytes5`` type for %%v%%. */ static bytes5(v) { return b(v, 5); } /** * Return a new ``bytes6`` type for %%v%%. */ static bytes6(v) { return b(v, 6); } /** * Return a new ``bytes7`` type for %%v%%. */ static bytes7(v) { return b(v, 7); } /** * Return a new ``bytes8`` type for %%v%%. */ static bytes8(v) { return b(v, 8); } /** * Return a new ``bytes9`` type for %%v%%. */ static bytes9(v) { return b(v, 9); } /** * Return a new ``bytes10`` type for %%v%%. */ static bytes10(v) { return b(v, 10); } /** * Return a new ``bytes11`` type for %%v%%. */ static bytes11(v) { return b(v, 11); } /** * Return a new ``bytes12`` type for %%v%%. */ static bytes12(v) { return b(v, 12); } /** * Return a new ``bytes13`` type for %%v%%. */ static bytes13(v) { return b(v, 13); } /** * Return a new ``bytes14`` type for %%v%%. */ static bytes14(v) { return b(v, 14); } /** * Return a new ``bytes15`` type for %%v%%. */ static bytes15(v) { return b(v, 15); } /** * Return a new ``bytes16`` type for %%v%%. */ static bytes16(v) { return b(v, 16); } /** * Return a new ``bytes17`` type for %%v%%. */ static bytes17(v) { return b(v, 17); } /** * Return a new ``bytes18`` type for %%v%%. */ static bytes18(v) { return b(v, 18); } /** * Return a new ``bytes19`` type for %%v%%. */ static bytes19(v) { return b(v, 19); } /** * Return a new ``bytes20`` type for %%v%%. */ static bytes20(v) { return b(v, 20); } /** * Return a new ``bytes21`` type for %%v%%. */ static bytes21(v) { return b(v, 21); } /** * Return a new ``bytes22`` type for %%v%%. */ static bytes22(v) { return b(v, 22); } /** * Return a new ``bytes23`` type for %%v%%. */ static bytes23(v) { return b(v, 23); } /** * Return a new ``bytes24`` type for %%v%%. */ static bytes24(v) { return b(v, 24); } /** * Return a new ``bytes25`` type for %%v%%. */ static bytes25(v) { return b(v, 25); } /** * Return a new ``bytes26`` type for %%v%%. */ static bytes26(v) { return b(v, 26); } /** * Return a new ``bytes27`` type for %%v%%. */ static bytes27(v) { return b(v, 27); } /** * Return a new ``bytes28`` type for %%v%%. */ static bytes28(v) { return b(v, 28); } /** * Return a new ``bytes29`` type for %%v%%. */ static bytes29(v) { return b(v, 29); } /** * Return a new ``bytes30`` type for %%v%%. */ static bytes30(v) { return b(v, 30); } /** * Return a new ``bytes31`` type for %%v%%. */ static bytes31(v) { return b(v, 31); } /** * Return a new ``bytes32`` type for %%v%%. */ static bytes32(v) { return b(v, 32); } /** * Return a new ``address`` type for %%v%%. */ static address(v) { return new Typed(_gaurd, "address", v); } /** * Return a new ``bool`` type for %%v%%. */ static bool(v) { return new Typed(_gaurd, "bool", !!v); } /** * Return a new ``bytes`` type for %%v%%. */ static bytes(v) { return new Typed(_gaurd, "bytes", v); } /** * Return a new ``string`` type for %%v%%. */ static string(v) { return new Typed(_gaurd, "string", v); } /** * Return a new ``array`` type for %%v%%, allowing %%dynamic%% length. */ static array(v, dynamic) { throw new Error("not implemented yet"); } /** * Return a new ``tuple`` type for %%v%%, with the optional %%name%%. */ static tuple(v, name) { throw new Error("not implemented yet"); } /** * Return a new ``uint8`` type for %%v%%. */ static overrides(v) { return new Typed(_gaurd, "overrides", Object.assign({}, v)); } /** * Returns true only if %%value%% is a [[Typed]] instance. */ static isTyped(value) { return value && typeof value === "object" && "_typedSymbol" in value && value._typedSymbol === _typedSymbol; } /** * If the value is a [[Typed]] instance, validates the underlying value * and returns it, otherwise returns value directly. * * This is useful for functions that with to accept either a [[Typed]] * object or values. */ static dereference(value, type) { if (Typed.isTyped(value)) { if (value.type !== type) { throw new Error(`invalid type: expecetd ${type}, got ${value.type}`); } return value.value; } return value; } } /** * @_ignore */ class AddressCoder extends Coder { constructor(localName) { super("address", "address", localName, false); } defaultValue() { return "0x0000000000000000000000000000000000000000"; } encode(writer, _value) { let value = Typed.dereference(_value, "string"); try { value = getAddress(value); } catch (error) { return this._throwError(error.message, _value); } return writer.writeValue(value); } decode(reader) { return getAddress(toBeHex(reader.readValue(), 20)); } } /** * Clones the functionality of an existing Coder, but without a localName * * @_ignore */ class AnonymousCoder extends Coder { coder; constructor(coder) { super(coder.name, coder.type, "_", coder.dynamic); this.coder = coder; } defaultValue() { return this.coder.defaultValue(); } encode(writer, value) { return this.coder.encode(writer, value); } decode(reader) { return this.coder.decode(reader); } } /** * @_ignore */ function pack(writer, coders, values) { let arrayValues = []; if (Array.isArray(values)) { arrayValues = values; } else if (values && typeof values === "object") { let unique = {}; arrayValues = coders.map(coder => { const name = coder.localName; assert(name, "cannot encode object for signature with missing names", "INVALID_ARGUMENT", { argument: "values", info: { coder }, value: values }); assert(!unique[name], "cannot encode object for signature with duplicate names", "INVALID_ARGUMENT", { argument: "values", info: { coder }, value: values }); unique[name] = true; return values[name]; }); } else { assertArgument(false, "invalid tuple value", "tuple", values); } assertArgument(coders.length === arrayValues.length, "types/value length mismatch", "tuple", values); let staticWriter = new Writer(); let dynamicWriter = new Writer(); let updateFuncs = []; coders.forEach((coder, index) => { let value = arrayValues[index]; if (coder.dynamic) { // Get current dynamic offset (for the future pointer) let dynamicOffset = dynamicWriter.length; // Encode the dynamic value into the dynamicWriter coder.encode(dynamicWriter, value); // Prepare to populate the correct offset once we are done let updateFunc = staticWriter.writeUpdatableValue(); updateFuncs.push(baseOffset => { updateFunc(baseOffset + dynamicOffset); }); } else { coder.encode(staticWriter, value); } }); // Backfill all the dynamic offsets, now that we know the static length updateFuncs.forEach(func => { func(staticWriter.length); }); let length = writer.appendWriter(staticWriter); length += writer.appendWriter(dynamicWriter); return length; } /** * @_ignore */ function unpack(reader, coders) { let values = []; let keys = []; // A reader anchored to this base let baseReader = reader.subReader(0); coders.forEach(coder => { let value = null; if (coder.dynamic) { let offset = reader.readIndex(); let offsetReader = baseReader.subReader(offset); try { value = coder.decode(offsetReader); } catch (error) { // Cannot recover from this if (isError(error, "BUFFER_OVERRUN")) { throw error; } value = error; value.baseType = coder.name; value.name = coder.localName; value.type = coder.type; } } else { try { value = coder.decode(reader); } catch (error) { // Cannot recover from this if (isError(error, "BUFFER_OVERRUN")) { throw error; } value = error; value.baseType = coder.name; value.name = coder.localName; value.type = coder.type; } } if (value == undefined) { throw new Error("investigate"); } values.push(value); keys.push(coder.localName || null); }); return Result.fromItems(values, keys); } /** * @_ignore */ class ArrayCoder extends Coder { coder; length; constructor(coder, length, localName) { const type = coder.type + "[" + (length >= 0 ? length : "") + "]"; const dynamic = length === -1 || coder.dynamic; super("array", type, localName, dynamic); defineProperties(this, { coder, length }); } defaultValue() { // Verifies the child coder is valid (even if the array is dynamic or 0-length) const defaultChild = this.coder.defaultValue(); const result = []; for (let i = 0; i < this.length; i++) { result.push(defaultChild); } return result; } encode(writer, _value) { const value = Typed.dereference(_value, "array"); if (!Array.isArray(value)) { this._throwError("expected array value", value); } let count = this.length; if (count === -1) { count = value.length; writer.writeValue(value.length); } assertArgumentCount(value.length, count, "coder array" + (this.localName ? " " + this.localName : "")); let coders = []; for (let i = 0; i < value.length; i++) { coders.push(this.coder); } return pack(writer, coders, value); } decode(reader) { let count = this.length; if (count === -1) { count = reader.readIndex(); // Check that there is *roughly* enough data to ensure // stray random data is not being read as a length. Each // slot requires at least 32 bytes for their value (or 32 // bytes as a link to the data). This could use a much // tighter bound, but we are erroring on the side of safety. assert(count * WordSize <= reader.dataLength, "insufficient data length", "BUFFER_OVERRUN", { buffer: reader.bytes, offset: count * WordSize, length: reader.dataLength }); } let coders = []; for (let i = 0; i < count; i++) { coders.push(new AnonymousCoder(this.coder)); } return unpack(reader, coders); } } /** * @_ignore */ class BooleanCoder extends Coder { constructor(localName) { super("bool", "bool", localName, false); } defaultValue() { return false; } encode(writer, _value) { const value = Typed.dereference(_value, "bool"); return writer.writeValue(value ? 1 : 0); } decode(reader) { return !!reader.readValue(); } } /** * @_ignore */ class DynamicBytesCoder extends Coder { constructor(type, localName) { super(type, type, localName, true); } defaultValue() { return "0x"; } encode(writer, value) { value = getBytesCopy(value); let length = writer.writeValue(value.length); length += writer.writeBytes(value); return length; } decode(reader) { return reader.readBytes(reader.readIndex(), true); } } /** * @_ignore */ class BytesCoder extends DynamicBytesCoder { constructor(localName) { super("bytes", localName); } decode(reader) { return hexlify(super.decode(reader)); } } /** * @_ignore */ class FixedBytesCoder extends Coder { size; constructor(size, localName) { let name = "bytes" + String(size); super(name, name, localName, false); defineProperties(this, { size }, { size: "number" }); } defaultValue() { return "0x0000000000000000000000000000000000000000000000000000000000000000".substring(0, 2 + this.size * 2); } encode(writer, _value) { let data = getBytesCopy(Typed.dereference(_value, this.type)); if (data.length !== this.size) { this._throwError("incorrect data length", _value); } return writer.writeBytes(data); } decode(reader) { return hexlify(reader.readBytes(this.size)); } } const Empty = new Uint8Array([]); /** * @_ignore */ class NullCoder extends Coder { constructor(localName) { super("null", "", localName, false); } defaultValue() { return null; } encode(writer, value) { if (value != null) { this._throwError("not null", value); } return writer.writeBytes(Empty); } decode(reader) { reader.readBytes(0); return null; } } const BN_0$5 = BigInt(0); const BN_1$1 = BigInt(1); const BN_MAX_UINT256$1 = BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); /** * @_ignore */ class NumberCoder extends Coder { size; signed; constructor(size, signed, localName) { const name = (signed ? "int" : "uint") + size * 8; super(name, name, localName, false); defineProperties(this, { size, signed }, { size: "number", signed: "boolean" }); } defaultValue() { return 0; } encode(writer, _value) { let value = getBigInt(Typed.dereference(_value, this.type)); // Check bounds are safe for encoding let maxUintValue = mask(BN_MAX_UINT256$1, WordSize * 8); if (this.signed) { let bounds = mask(maxUintValue, this.size * 8 - 1); if (value > bounds || value < -(bounds + BN_1$1)) { this._throwError("value out-of-bounds", _value); } value = toTwos(value, 8 * WordSize); } else if (value < BN_0$5 || value > mask(maxUintValue, this.size * 8)) { this._throwError("value out-of-bounds", _value); } return writer.writeValue(value); } decode(reader) { let value = mask(reader.readValue(), this.size * 8); if (this.signed) { value = fromTwos(value, this.size * 8); } return value; } } /** * @_ignore */ class StringCoder extends DynamicBytesCoder { constructor(localName) { super("string", localName); } defaultValue() { return ""; } encode(writer, _value) { return super.encode(writer, toUtf8Bytes(Typed.dereference(_value, "string"))); } decode(reader) { return toUtf8String(super.decode(reader)); } } /** * @_ignore */ class TupleCoder extends Coder { coders; constructor(coders, localName) { let dynamic = false; const types = []; coders.forEach(coder => { if (coder.dynamic) { dynamic = true; } types.push(coder.type); }); const type = "tuple(" + types.join(",") + ")"; super("tuple", type, localName, dynamic); defineProperties(this, { coders: Object.freeze(coders.slice()) }); } defaultValue() { const values = []; this.coders.forEach(coder => { values.push(coder.defaultValue()); }); // We only output named properties for uniquely named coders const uniqueNames = this.coders.reduce((accum, coder) => { const name = coder.localName; if (name) { if (!accum[name]) { accum[name] = 0; } accum[name]++; } return accum; }, {}); // Add named values this.coders.forEach((coder, index) => { let name = coder.localName; if (!name || uniqueNames[name] !== 1) { return; } if (name === "length") { name = "_length"; } if (values[name] != null) { return; } values[name] = values[index]; }); return Object.freeze(values); } encode(writer, _value) { const value = Typed.dereference(_value, "tuple"); return pack(writer, this.coders, value); } decode(reader) { return unpack(reader, this.coders); } } /** * A simple hashing function which operates on UTF-8 strings to * compute an 32-byte identifier. * * This simply computes the [UTF-8 bytes](toUtf8Bytes) and computes * the [[keccak256]]. * * @example: * id("hello world") * //_result: */ function id(value) { return keccak256(toUtf8Bytes(value)); } // created 2023-09-25T01:01:55.148Z // compressed base64-encoded blob for include-ens data // source: https://github.com/adraffy/ens-normalize.js/blob/main/src/make.js // see: https://github.com/adraffy/ens-normalize.js#security // SHA-256: 0565ed049b9cf1614bb9e11ba7d8ac6a6fb96c893253d890f7e2b2884b9ded32 var COMPRESSED$1 = 'AEEUdwmgDS8BxQKKAP4BOgDjATAAngDUAIMAoABoAOAAagCOAEQAhABMAHIAOwA9ACsANgAmAGIAHgAuACgAJwAXAC0AGgAjAB8ALwAUACkAEgAeAAkAGwARABkAFgA5ACgALQArADcAFQApABAAHgAiABAAGgAeABMAGAUhBe8BFxREN8sF2wC5AK5HAW8ArQkDzQCuhzc3NzcBP68NEfMABQdHBuw5BV8FYAA9MzkI9r4ZBg7QyQAWA9CeOwLNCjcCjqkChuA/lm+RAsXTAoP6ASfnEQDytQFJAjWVCkeXAOsA6godAB/cwdAUE0WlBCN/AQUCQRjFD/MRBjHxDQSJbw0jBzUAswBxme+tnIcAYwabAysG8QAjAEMMmxcDqgPKQyDXCMMxA7kUQwD3NXOrAKmFIAAfBC0D3x4BJQDBGdUFAhEgVD8JnwmQJiNWYUzrg0oAGwAUAB0AFnNcACkAFgBP9h3gPfsDOWDKneY2ChglX1UDYD30ABsAFAAdABZzIGRAnwDD8wAjAEEMzRbDqgMB2sAFYwXqAtCnAsS4AwpUJKRtFHsadUz9AMMVbwLpABM1NJEX0ZkCgYMBEyMAxRVvAukAEzUBUFAtmUwSAy4DBTER33EftQHfSwB5MxJ/AjkWKQLzL8E/cwBB6QH9LQDPDtO9ASNriQC5DQANAwCK21EFI91zHwCoL9kBqQcHBwcHKzUDowBvAQohPvU3fAQgHwCyAc8CKQMA5zMSezr7ULgFmDp/LzVQBgEGAi8FYQVgt8AFcTtlQhpCWEmfe5tmZ6IAExsDzQ8t+X8rBKtTAltbAn0jsy8Bl6utPWMDTR8Ei2kRANkDBrNHNysDBzECQWUAcwFpJ3kAiyUhAJ0BUb8AL3EfAbfNAz81KUsFWwF3YQZtAm0A+VEfAzEJDQBRSQCzAQBlAHsAM70GD/v3IZWHBwARKQAxALsjTwHZAeMPEzmXgIHwABIAGQA8AEUAQDt3gdvIEGcQZAkGTRFMdEIVEwK0D64L7REdDNkq09PgADSxB/MDWwfzA1sDWwfzB/MDWwfzA1sDWwNbA1scEvAi28gQZw9QBHUFlgWTBN4IiyZREYkHMAjaVBV0JhxPA00BBCMtSSQ7mzMTJUpMFE0LCAQ2SmyvfUADTzGzVP2QqgPTMlc5dAkGHnkSqAAyD3skNb1OhnpPcagKU0+2tYdJak5vAsY6sEAACikJm2/Dd1YGRRAfJ6kQ+ww3AbkBPw3xS9wE9QY/BM0fgRkdD9GVoAipLeEM8SbnLqWAXiP5KocF8Uv4POELUVFsD10LaQnnOmeBUgMlAREijwrhDT0IcRD3Cs1vDekRSQc9A9lJngCpBwULFR05FbkmFGKwCw05ewb/GvoLkyazEy17AAXXGiUGUQEtGwMA0y7rhbRaNVwgT2MGBwspI8sUrFAkDSlAu3hMGh8HGSWtApVDdEqLUToelyH6PEENai4XUYAH+TwJGVMLhTyiRq9FEhHWPpE9TCJNTDAEOYMsMyePCdMPiQy9fHYBXQklCbUMdRM1ERs3yQg9Bx0xlygnGQglRplgngT7owP3E9UDDwVDCUUHFwO5HDETMhUtBRGBKNsC9zbZLrcCk1aEARsFzw8pH+MQVEfkDu0InwJpA4cl7wAxFSUAGyKfCEdnAGOP3FMJLs8Iy2pwI3gDaxTrZRF3B5UOWwerHDcVwxzlcMxeD4YMKKezCV8BeQmdAWME5wgNNV+MpCBFZ1eLXBifIGVBQ14AAjUMaRWjRMGHfAKPD28SHwE5AXcHPQ0FAnsR8RFvEJkI74YINbkz/DopBFMhhyAVCisDU2zSCysm/Qz8bQGnEmYDEDRBd/Jnr2C6KBgBBx0yyUFkIfULlk/RDKAaxRhGVDIZ6AfDA/ca9yfuQVsGAwOnBxc6UTPyBMELbQiPCUMATQ6nGwfbGG4KdYzUATWPAbudA1uVhwJzkwY7Bw8Aaw+LBX3pACECqwinAAkA0wNbAD0CsQehAB0AiUUBQQMrMwEl6QKTA5cINc8BmTMB9y0EH8cMGQD7O25OAsO1AoBuZqYF4VwCkgJNOQFRKQQJUktVA7N15QDfAE8GF+NLARmvTs8e50cB43MvAMsA/wAJOQcJRQHRAfdxALsBYws1Caa3uQFR7S0AhwAZbwHbAo0A4QA5AIP1AVcAUQVd/QXXAlNNARU1HC9bZQG/AyMBNwERAH0Gz5GpzQsjBHEH1wIQHxXlAu8yB7kFAyLjE9FCyQK94lkAMhoKPAqrCqpgX2Q3CjV2PVQAEh+sPss/UgVVO1c7XDtXO1w7VztcO1c7XDtXO1wDm8Pmw+YKcF9JYe8Mqg3YRMw6TRPfYFVgNhPMLbsUxRXSJVoZQRrAJwkl6FUNDwgt12Y0CDA0eRfAAEMpbINFY4oeNApPHOtTlVT8LR8AtUumM7MNsBsZREQFS3XxYi4WEgomAmSFAmJGX1GzAV83JAKh+wJonAJmDQKfiDgfDwJmPwJmKgRyBIMDfxcDfpY5Cjl7GzmGOicnAmwhAjI6OA4CbcsCbbLzjgM3a0kvAWsA4gDlAE4JB5wMkQECD8YAEbkCdzMCdqZDAnlPRwJ4viFg30WyRvcCfEMCeswCfQ0CfPRIBEiBZygALxlJXEpfGRtK0ALRBQLQ0EsrA4hTA4fqRMmRNgLypV0HAwOyS9JMMSkH001QTbMCi0MCitzFHwshR2sJuwKOOwKOYESbhQKO3QKOYHxRuFM5AQ5S2FSJApP/ApMQAO0AIFUiVbNV1AosHymZijLleGpFPz0Cl6MC77ZYJawAXSkClpMCloCgAK1ZsFoNhVEAPwKWuQKWUlxIXNUCmc8CmWhczl0LHQKcnznGOqECnBoCn58CnryOACETNS4TAp31Ap6WALlBYThh8wKe1wKgcgGtAp6jIwKeUqljzGQrKS8CJ7MCJoICoP8CoFDbAqYzAqXSAqgDAIECp/ZogGi1AAdNaiBq1QKs5wKssgKtawKtBgJXIQJV4AKx5dsDH1JsmwKywRECsuwbbORtZ21MYwMl0QK2YD9DbpQDKUkCuGICuUsZArkue3A6cOUCvR0DLbYDMhUCvoxyBgMzdQK+HnMmc1MCw88CwwhzhnRPOUl05AM8qwEDPJ4DPcMCxYACxksCxhSNAshtVQLISALJUwLJMgJkoQLd1nh9ZXiyeSlL1AMYp2cGAmH4GfeVKHsPXpZevxUCz28Cz3AzT1fW9xejAMqxAs93AS3uA04Wfk8JAtwrAtuOAtJTA1JgA1NjAQUDVZCAjUMEzxrxZEl5A4LSg5EC2ssC2eKEFIRNp0ADhqkAMwNkEoZ1Xf0AWQLfaQLevHd7AuIz7RgB8zQrAfSfAfLWiwLr9wLpdH0DAur9AuroAP1LAb0C7o0C66CWrpcHAu5DA4XkmH1w5HGlAvMHAG0DjhqZlwL3FwORcgOSiwL3nAL53QL4apogmq+/O5siA52HAv7+AR8APZ8gAZ+3AwWRA6ZuA6bdANXJAwZuoYyiCQ0DDE0BEwEjB3EGZb1rCQC/BG/DFY8etxEAG3k9ACcDNxJRA42DAWcrJQCM8wAlAOanC6OVCLsGI6fJBgCvBRnDBvElRUYFFoAFcD9GSDNCKUK8X3kZX8QAls0FOgCQVCGbwTsuYDoZutcONxjOGJHJ/gVfBWAFXwVgBWsFYAVfBWAFXwVgBV8FYAVfBWBOHQjfjW8KCgoKbF7xMwTRA7kGN8PDAMMEr8MA70gxFroFTj5xPnhCR0K+X30/X/AAWBkzswCNBsxzzASm70aCRS4rDDMeLz49fnXfcsH5GcoscQFz13Y4HwVnBXLJycnACNdRYwgICAqEXoWTxgA7P4kACxbZBu21Kw0AjMsTAwkVAOVtJUUsJ1JCuULESUArXy9gPi9AKwnJRQYKTD9LPoA+iT54PnkCkULEUUpDX9NWV3JVEjQAc1w3A3IBE3YnX+g7QiMJb6MKaiszRCUuQrNCxDPMCcwEX9EWJzYREBEEBwIHKn6l33JCNVIfybPJtAltydPUCmhBZw/tEKsZAJOVJU1CLRuxbUHOQAo7P0s+eEJHHA8SJVRPdGM0NVrpvBoKhfUlM0JHHGUQUhEWO1xLSj8MO0ucNAqJIzVCRxv9EFsqKyA4OQgNj2nwZgp5ZNFgE2A1K3YHS2AhQQojJmC7DgpzGG1WYFUZCQYHZO9gHWCdYIVgu2BTYJlwFh8GvRbcXbG8YgtDHrMBwzPVyQonHQgkCyYBgQJ0Ajc4nVqIAwGSCsBPIgDsK3SWEtIVBa5N8gGjAo+kVwVIZwD/AEUSCDweX4ITrRQsJ8K3TwBXFDwEAB0TvzVcAtoTS20RIwDgVgZ9BBImYgA5AL4Coi8LFnezOkCnIQFjAY4KBAPh9RcGsgZSBsEAJctdsWIRu2kTkQstRw7DAcMBKgpPBGIGMDAwKCYnKTQaLg4AKRSVAFwCdl+YUZ0JdicFD3lPAdt1F9ZZKCGxuE3yBxkFVGcA/wBFEgiCBwAOLHQSjxOtQDg1z7deFRMAZ8QTAGtKb1ApIiPHADkAvgKiLy1DFtYCmBiDAlDDWNB0eo7fpaMO/aEVRRv0ATEQZBIODyMEAc8JQhCbDRgzFD4TAEMAu9YBCgCsAOkAm5I3ABwAYxvONnR+MhXJAxgKQyxL2+kkJhMbhQKDBMkSsvF0AD9BNQ6uQC7WqSQHwxEAEEIu1hkhAH2z4iQPwyJPHNWpdyYBRSpnJALzoBAEVPPsH20MxA0CCEQKRgAFyAtFAlMNwwjEDUQJRArELtapMg7DDZgJIw+TGukEIwvDFkMAqAtDEMMMBhioe+QAO3MMRAACrgnEBSPY9Q0FDnbSBoMAB8MSYxkSxAEJAPIJAAB8FWMOFtMc/HcXwxhDAC7DAvOowwAewwJdKDKHAAHDAALrFUQVwwAbwyvzpWMWv8wA/ABpAy++bcYDUKPD0KhDCwKmJ1MAAmMA5+UZwxAagwipBRL/eADfw6fDGOMCGsOjk3l6BwOpo4sAEsMOGxMAA5sAbcMOAAvDp0MJGkMDwgipnNIPAwfIqUMGAOGDAAPzABXDAAcDAAnDAGmTABrDAA7DChjDjnEWAwABYwAOcwAuUyYABsMAF8MIKQANUgC6wy4AA8MADqMq8wCyYgAcIwAB8wqpAAXOCx0V4wAHowBCwwEKAGnDAAuDAB3DAAjDCakABdIAbqcZ3QCZCCkABdIAAAFDAAfjAB2jCCkABqIACYMAGzMAbSMA5sOIAAhjAAhDABTDBAkpAAbSAOOTAAlDC6kOzPtnAAdDAG6kQFAATwAKwwwAA0MACbUDPwAHIwAZgwACE6cDAAojAApDAAoDp/MGwwAJIwADEwAQQwgAFEMAEXMAD5MADfMADcMAGRMOFiMAFUMAbqMWuwHDAMIAE0MLAGkzEgDhUwACQwAEWgAXgwUjAAbYABjDBSYBgzBaAEFNALcQBxUMegAwMngBrA0IZgJ0KxQHBREPd1N0ZzKRJwaIHAZqNT4DqQq8BwngAB4DAwt2AX56T1ocKQNXAh1GATQGC3tOxYNagkgAMQA5CQADAQEAWxLjAIOYNAEzAH7tFRk6TglSAF8NAAlYAQ+S1ACAQwQorQBiAN4dAJ1wPyeTANVzuQDX3AIeEMp9eyMgXiUAEdkBkJizKltbVVAaRMqRAAEAhyQ/SDEz6BmfVwB6ATEsOClKIRcDOF0E/832AFNt5AByAnkCRxGCOs94NjXdAwINGBonDBwPALW2AwICAgAAAAAAAAYDBQMDARrUAwAtAAAAAgEGBgYGBgYFBQUFBQUEBQYHCAkEBQUFBQQAAAICAAAAIgCNAJAAlT0A6gC7ANwApEQAwgCyAK0AqADuAKYA2gCjAOcBCAEDAMcAgQBiANIA1AEDAN4A8gCQAKkBMQDqAN8A3AsBCQ8yO9ra2tq8xuLT1tRJOB0BUgFcNU0BWgFpAWgBWwFMUUlLbhMBUxsNEAs6PhMOACcUKy0vMj5AQENDQ0RFFEYGJFdXV1dZWVhZL1pbXVxcI2NnZ2ZoZypsbnZ1eHh4eHh4enp6enp6enp6enp8fH18e2IARPIASQCaAHgAMgBm+ACOAFcAVwA3AnbvAIsABfj4AGQAk/IAnwBPAGIAZP//sACFAIUAaQBWALEAJAC2AIMCQAJDAPwA5wD+AP4A6AD/AOkA6QDoAOYALwJ7AVEBQAE+AVQBPgE+AT4BOQE4ATgBOAEcAVgXADEQCAEAUx8SHgsdHhYAjgCWAKYAUQBqIAIxAHYAbwCXAxUDJzIDIUlGTzEAkQJPAMcCVwKkAMAClgKWApYClgKWApYCiwKWApYClgKWApYClgKVApUCmAKgApcClgKWApQClAKUApQCkgKVAnUB1AKXAp8ClgKWApUeAIETBQD+DQOfAmECOh8BVBg9AuIZEjMbAU4/G1WZAXusRAFpYQEFA0FPAQYAmTEeIJdyADFoAHEANgCRA5zMk/C2jGINwjMWygIZCaXdfDILBCs5dAE7YnQBugDlhoiHhoiGiYqKhouOjIaNkI6Ij4qQipGGkoaThpSSlYaWhpeKmIaZhpqGm4aci52QnoqfhuIC4XTpAt90AIp0LHSoAIsAdHQEQwRABEIERQRDBEkERgRBBEcESQRIBEQERgRJAJ5udACrA490ALxuAQ10ANFZdHQA13QCFHQA/mJ0AP4BIQD+APwA/AD9APwDhGZ03ASMK23HAP4A/AD8AP0A/CR0dACRYnQA/gCRASEA/gCRAvQA/gCRA4RmdNwEjCttxyR0AP9idAEhAP4A/gD8APwA/QD8AP8A/AD8AP0A/AOEZnTcBIwrbcckdHQAkWJ0ASEA/gCRAP4AkQL0AP4AkQOEZnTcBIwrbcckdAJLAT50AlIBQXQCU8l0dAJfdHQDpgL0A6YDpgOnA6cDpwOnA4RmdNwEjCttxyR0dACRYnQBIQOmAJEDpgCRAvQDpgCRA4RmdNwEjCttxyR0BDh0AJEEOQCRDpU5dSgCADR03gV2CwArdAEFAM5iCnR0AF1iAAYcOgp0dACRCnQAXAEIwWZ0CnRmdHQAkWZ0CnRmdEXgAFF03gp0dEY0tlT2u3SOAQTwscwhjZZKrhYcBSfFp9XNbKiVDOD2b+cpe4/Z17mQnbtzzhaeQtE2GGj0IDNTjRUSyTxxw/RPHW/+vS7d1NfRt9z9QPZg4X7QFfhCnkvgNPIItOsC2eV6hPannZNHlZ9xrwZXIMOlu3jSoQSq78WEjwLjw1ELSlF1aBvfzwk5ZX7AUvQzjPQKbDuQ+sm4wNOp4A6AdVuRS0t1y/DZpg4R6m7FNjM9HgvW7Bi88zaMjOo6lM8wtBBdj8LP4ylv3zCXPhebMKJc066o9sF71oFW/8JXu86HJbwDID5lzw5GWLR/LhT0Qqnp2JQxNZNfcbLIzPy+YypqRm/lBmGmex+82+PisxUumSeJkALIT6rJezxMH+CTJmQtt5uwTVbL3ptmjDUQzlSIvWi8Tl7ng1NpuRn1Ng4n14Qc+3Iil7OwkvNWogLSPkn3pihIFytyIGmMhOe3n1tWsuMy9BdKyqF4Z3v2SgggTL9KVvMXPnCbRe+oOuFFP3HejBG/w9gvmfNYvg6JuWia2lcSSN1uIjBktzoIazOHPJZ7kKHPz8mRWVdW3lA8WGF9dQF6Bm673boov3BUWDU2JNcahR23GtfHKLOz/viZ+rYnZFaIznXO67CYEJ1fXuTRpZhYZkKe54xeoagkNGLs+NTZHE0rX45/XvQ2RGADX6vcAvdxIUBV27wxGm2zjZo4X3ILgAlrOFheuZ6wtsvaIj4yLY7qqawlliaIcrz2G+c3vscAnCkCuMzMmZvMfu9lLwTvfX+3cVSyPdN9ZwgDZhfjRgNJcLiJ67b9xx8JHswprbiE3v9UphotAPIgnXVIN5KmMc0piXhc6cChPnN+MRhG9adtdttQTTwSIpl8I4/j//d3sz1326qTBTpPRM/Hgh3kzqEXs8ZAk4ErQhNO8hzrQ0DLkWMA/N+91tn2MdOJnWC2FCZehkQrwzwbKOjhvZsbM95QoeL9skYyMf4srVPVJSgg7pOLUtr/n9eT99oe9nLtFRpjA9okV2Kj8h9k5HaC0oivRD8VyXkJ81tcd4fHNXPCfloIQasxsuO18/46dR2jgul/UIet2G0kRvnyONMKhHs6J26FEoqSqd+rfYjeEGwHWVDpX1fh1jBBcKGMqRepju9Y00mDVHC+Xdij/j44rKfvfjGinNs1jO/0F3jB83XCDINN/HB84axlP+3E/klktRo+vl3U/aiyMJbIodE1XSsDn6UAzIoMtUObY2+k/4gY/l+AkZJ5Sj2vQrkyLm3FoxjhDX+31UXBFf9XrAH31fFqoBmDEZvhvvpnZ87N+oZEu7U9O/nnk+QWj3x8uyoRbEnf+O5UMr9i0nHP38IF5AvzrBW8YWBUR0mIAzIvndQq9N3v/Jto3aPjPXUPl8ASdPPyAp7jENf8bk7VMM9ol9XGmlBmeDMuGqt+WzuL6CXAxXjIhCPM5vACchgMJ/8XBGLO/D1isVvGhwwHHr1DLaI5mn2Jr/b1pUD90uciDaS8cXNDzCWvNmT/PhQe5e8nTnnnkt8Ds/SIjibcum/fqDhKopxAY8AkSrPn+IGDEKOO+U3XOP6djFs2H5N9+orhOahiQk5KnEUWa+CzkVzhp8bMHRbg81qhjjXuIKbHjSLSIBKWqockGtKinY+z4/RdBUF6pcc3JmnlxVcNgrI4SEzKUZSwcD2QCyxzKve+gAmg6ZuSRkpPFa6mfThu7LJNu3H5K42uCpNvPAsoedolKV/LHe/eJ+BbaG5MG0NaSGVPRUmNFMFFSSpXEcXwbVh7UETOZZtoVNRGOIbbkig3McEtR68cG0RZAoJevWYo7Dg/lZ1CQzblWeUvVHmr8fY4Nqd9JJiH/zEX24mJviH60fAyFr0A3c4bC1j3yZU60VgJxXn8JgJXLUIsiBnmKmMYz+7yBQFBvqb2eYnuW59joZBf56/wXvWIR4R8wTmV80i1mZy+S4+BUES+hzjk0uXpC///z/IlqHZ1monzlXp8aCfhGKMti73FI1KbL1q6IKO4fuBuZ59gagjn5xU79muMpHXg6S+e+gDM/U9BKLHbl9l6o8czQKl4RUkJJiqftQG2i3BMg/TQlUYFkJDYBOOvAugYuzYSDnZbDDd/aSd9x0Oe6F+bJcHfl9+gp6L5/TgA+BdFFovbfCrQ40s5vMPw8866pNX8zyFGeFWdxIpPVp9Rg1UPOVFbFZrvaFq/YAzHQgqMWpahMYfqHpmwXfHL1/kpYmGuHFwT55mQu0dylfNuq2Oq0hTMCPwqfxnuBIPLXfci4Y1ANy+1CUipQxld/izVh16WyG2Q0CQQ9NqtAnx1HCHwDj7sYxOSB0wopZSnOzxQOcExmxrVTF2BkOthVpGfuhaGECfCJpJKpjnihY+xOT2QJxN61+9K6QSqtv2Shr82I3jgJrqBg0wELFZPjvHpvzTtaJnLK6Vb97Yn933koO/saN7fsjwNKzp4l2lJVx2orjCGzC/4ZL4zCver6aQYtC5sdoychuFE6ufOiog+VWi5UDkbmvmtah/3aArEBIi39s5ILUnlFLgilcGuz9CQshEY7fw2ouoILAYPVT/gyAIq3TFAIwVsl+ktkRz/qGfnCDGrm5gsl/l9QdvCWGsjPz3dU7XuqKfdUrr/6XIgjp4rey6AJBmCmUJMjITHVdFb5m1p+dLMCL8t55zD42cmftmLEJC0Da04YiRCVUBLLa8D071/N5UBNBXDh0LFsmhV/5B5ExOB4j3WVG/S3lfK5o+V6ELHvy6RR9n4ac+VsK4VE4yphPvV+kG9FegTBH4ZRXL2HytUHCduJazB/KykjfetYxOXTLws267aGOd+I+JhKP//+VnXmS90OD/jvLcVu0asyqcuYN1mSb6XTlCkqv1vigZPIYwNF/zpWcT1GR/6aEIRjkh0yhg4LXJfaGobYJTY4JI58KiAKgmmgAKWdl5nYCeLqavRJGQNuYuZtZFGx+IkI4w4NS2xwbetNMunOjBu/hmKCI/w7tfiiyUd//4rbTeWt4izBY8YvGIN6vyKYmP/8X8wHKCeN+WRcKM70+tXKNGyevU9H2Dg5BsljnTf8YbsJ1TmMs74Ce2XlHisleguhyeg44rQOHZuw/6HTkhnnurK2d62q6yS7210SsAIaR+jXMQA+svkrLpsUY+F30Uw89uOdGAR6vo4FIME0EfVVeHTu6eKicfhSqOeXJhbftcd08sWEnNUL1C9fnprTgd83IMut8onVUF0hvqzZfHduPjbjwEXIcoYmy+P6tcJZHmeOv6VrvEdkHDJecjHuHeWANe79VG662qTjA/HCvumVv3qL+LrOcpqGps2ZGwQdFJ7PU4iuyRlBrwfO+xnPyr47s2cXVbWzAyznDiBGjCM3ksxjjqM62GE9C8f5U38kB3VjtabKp/nRdvMESPGDG90bWRLAt1Qk5DyLuazRR1YzdC1c+hZXvAWV8xA72S4A8B67vjVhbba3MMop293FeEXpe7zItMWrJG/LOH9ByOXmYnNJfjmfuX9KbrpgLOba4nZ+fl8Gbdv/ihv+6wFGKHCYrVwmhFC0J3V2bn2tIB1wCc1CST3d3X2OyxhguXcs4sm679UngzofuSeBewMFJboIQHbUh/m2JhW2hG9DIvG2t7yZIzKBTz9wBtnNC+2pCRYhSIuQ1j8xsz5VvqnyUIthvuoyyu7fNIrg/KQUVmGQaqkqZk/Vx5b33/gsEs8yX7SC1J+NV4icz6bvIE7C5G6McBaI8rVg56q5QBJWxn/87Q1sPK4+sQa8fLU5gXo4paaq4cOcQ4wR0VBHPGjKh+UlPCbA1nLXyEUX45qZ8J7/Ln4FPJE2TdzD0Z8MLSNQiykMMmSyOCiFfy84Rq60emYB2vD09KjYwsoIpeDcBDTElBbXxND72yhd9pC/1CMid/5HUMvAL27OtcIJDzNKpRPNqPOpyt2aPGz9QWIs9hQ9LiX5s8m9hjTUu/f7MyIatjjd+tSfQ3ufZxPpmJhTaBtZtKLUcfOCUqADuO+QoH8B9v6U+P0HV1GLQmtoNFTb3s74ivZgjES0qfK+8RdGgBbcCMSy8eBvh98+et1KIFqSe1KQPyXULBMTsIYnysIwiZBJYdI20vseV+wuJkcqGemehKjaAb9L57xZm3g2zX0bZ2xk/fU+bCo7TlnbW7JuF1YdURo/2Gw7VclDG1W7LOtas2LX4upifZ/23rzpsnY/ALfRgrcWP5hYmV9VxVOQA1fZvp9F2UNU+7d7xRyVm5wiLp3/0dlV7vdw1PMiZrbDAYzIVqEjRY2YU03sJhPnlwIPcZUG5ltL6S8XCxU1eYS5cjr34veBmXAvy7yN4ZjArIG0dfD/5UpBNlX1ZPoxJOwyqRi3wQWtOzd4oNKh0LkoTm8cwqgIfKhqqGOhwo71I+zXnMemTv2B2AUzABWyFztGgGULjDDzWYwJUVBTjKCn5K2QGMK1CQT7SzziOjo+BhAmqBjzuc3xYym2eedGeOIRJVyTwDw37iCMe4g5Vbnsb5ZBdxOAnMT7HU4DHpxWGuQ7GeiY30Cpbvzss55+5Km1YsbD5ea3NI9QNYIXol5apgSu9dZ8f8xS5dtHpido5BclDuLWY4lhik0tbJa07yJhH0BOyEut/GRbYTS6RfiTYWGMCkNpfSHi7HvdiTglEVHKZXaVhezH4kkXiIvKopYAlPusftpE4a5IZwvw1x/eLvoDIh/zpo9FiQInsTb2SAkKHV42XYBjpJDg4374XiVb3ws4qM0s9eSQ5HzsMU4OZJKuopFjBM+dAZEl8RUMx5uU2N486Kr141tVsGQfGjORYMCJAMsxELeNT4RmWjRcpdTGBwcx6XN9drWqPmJzcrGrH4+DRc7+n1w3kPZwu0BkNr6hQrqgo7JTB9A5kdJ/H7P4cWBMwsmuixAzJB3yrQpnGIq90lxAXLzDCdn1LPibsRt7rHNjgQBklRgPZ8vTbjXdgXrTWQsK5MdrXXQVPp0Rinq3frzZKJ0qD6Qhc40VzAraUXlob1gvkhK3vpmHgI6FRlQZNx6eRqkp0zy4AQlX813fAPtL3jMRaitGFFjo0zmErloC+h+YYdVQ6k4F/epxAoF0BmqEoKNTt6j4vQZNQ2BoqF9Vj53TOIoNmDiu9Xp15RkIgQIGcoLpfoIbenzpGUAtqFJp5W+LLnx38jHeECTJ/navKY1NWfN0sY1T8/pB8kIH3DU3DX+u6W3YwpypBMYOhbSxGjq84RZ84fWJow8pyHqn4S/9J15EcCMsXqrfwyd9mhiu3+rEo9pPpoJkdZqHjra4NvzFwuThNKy6hao/SlLw3ZADUcUp3w3SRVfW2rhl80zOgTYnKE0Hs2qp1J6H3xqPqIkvUDRMFDYyRbsFI3M9MEyovPk8rlw7/0a81cDVLmBsR2ze2pBuKb23fbeZC0uXoIvDppfTwIDxk1Oq2dGesGc+oJXWJLGkOha3CX+DUnzgAp9HGH9RsPZN63Hn4RMA5eSVhPHO+9RcRb/IOgtW31V1Q5IPGtoxPjC+MEJbVlIMYADd9aHYWUIQKopuPOHmoqSkubnAKnzgKHqgIOfW5RdAgotN6BN+O2ZYHkuemLnvQ8U9THVrS1RtLmKbcC7PeeDsYznvqzeg6VCNwmr0Yyx1wnLjyT84BZz3EJyCptD3yeueAyDWIs0L2qs/VQ3HUyqfrja0V1LdDzqAikeWuV4sc7RLIB69jEIBjCkyZedoUHqCrOvShVzyd73OdrJW0hPOuQv2qOoHDc9xVb6Yu6uq3Xqp2ZaH46A7lzevbxQEmfrzvAYSJuZ4WDk1Hz3QX1LVdiUK0EvlAGAYlG3Md30r7dcPN63yqBCIj25prpvZP0nI4+EgWoFG95V596CurXpKRBGRjQlHCvy5Ib/iW8nZJWwrET3mgd6mEhfP4KCuaLjopWs7h+MdXFdIv8dHQJgg1xi1eYqB0uDYjxwVmri0Sv5XKut/onqapC+FQiC2C1lvYJ9MVco6yDYsS3AANUfMtvtbYI2hfwZatiSsnoUeMZd34GVjkMMKA+XnjJpXgRW2SHTZplVowPmJsvXy6w3cfO1AK2dvtZEKTkC/TY9LFiKHCG0DnrMQdGm2lzlBHM9iEYynH2UcVMhUEjsc0oDBTgo2ZSQ1gzkAHeWeBXYFjYLuuf8yzTCy7/RFR81WDjXMbq2BOH5dURnxo6oivmxL3cKzKInlZkD31nvpHB9Kk7GfcfE1t+1V64b9LtgeJGlpRFxQCAqWJ5DoY77ski8gsOEOr2uywZaoO/NGa0X0y1pNQHBi3b2SUGNpcZxDT7rLbBf1FSnQ8guxGW3W+36BW0gBje4DOz6Ba6SVk0xiKgt+q2JOFyr4SYfnu+Ic1QZYIuwHBrgzr6UvOcSCzPTOo7D6IC4ISeS7zkl4h+2VoeHpnG/uWR3+ysNgPcOIXQbv0n4mr3BwQcdKJxgPSeyuP/z1Jjg4e9nUvoXegqQVIE30EHx5GHv+FAVUNTowYDJgyFhf5IvlYmEqRif6+WN1MkEJmDcQITx9FX23a4mxy1AQRsOHO/+eImX9l8EMJI3oPWzVXxSOeHU1dUWYr2uAA7AMb+vAEZSbU3qob9ibCyXeypEMpZ6863o6QPqlqGHZkuWABSTVNd4cOh9hv3qEpSx2Zy/DJMP6cItEmiBJ5PFqQnDEIt3NrA3COlOSgz43D7gpNFNJ5MBh4oFzhDPiglC2ypsNU4ISywY2erkyb1NC3Qh/IfWj0eDgZI4/ln8WPfBsT3meTjq1Uqt1E7Zl/qftqkx6aM9KueMCekSnMrcHj1CqTWWzEzPsZGcDe3Ue4Ws+XFYVxNbOFF8ezkvQGR6ZOtOLU2lQEnMBStx47vE6Pb7AYMBRj2OOfZXfisjJnpTfSNjo6sZ6qSvNxZNmDeS7Gk3yYyCk1HtKN2UnhMIjOXUzAqDv90lx9O/q/AT1ZMnit5XQe9wmQxnE/WSH0CqZ9/2Hy+Sfmpeg8RwsHI5Z8kC8H293m/LHVVM/BA7HaTJYg5Enk7M/xWpq0192ACfBai2LA/qrCjCr6Dh1BIMzMXINBmX96MJ5Hn2nxln/RXPFhwHxUmSV0EV2V0jm86/dxxuYSU1W7sVkEbN9EzkG0QFwPhyHKyb3t+Fj5WoUUTErcazE/N6EW6Lvp0d//SDPj7EV9UdJN+Amnf3Wwk3A0SlJ9Z00yvXZ7n3z70G47Hfsow8Wq1JXcfwnA+Yxa5mFsgV464KKP4T31wqIgzFPd3eCe3j5ory5fBF2hgCFyVFrLzI9eetNXvM7oQqyFgDo4CTp/hDV9NMX9JDHQ/nyHTLvZLNLF6ftn2OxjGm8+PqOwhxnPHWipkE/8wbtyri80Sr7pMNkQGMfo4ZYK9OcCC4ESVFFbLMIvlxSoRqWie0wxqnLfcLSXMSpMMQEJYDVObYsXIQNv4TGNwjq1kvT1UOkicTrG3IaBZ3XdScS3u8sgeZPVpOLkbiF940FjbCeNRINNvDbd01EPBrTCPpm12m43ze1bBB59Ia6Ovhnur/Nvx3IxwSWol+3H2qfCJR8df6aQf4v6WiONxkK+IqT4pKQrZK/LplgDI/PJZbOep8dtbV7oCr6CgfpWa8NczOkPx81iSHbsNhVSJBOtrLIMrL31LK9TqHqAbAHe0RLmmV806kRLDLNEhUEJfm9u0sxpkL93Zgd6rw+tqBfTMi59xqXHLXSHwSbSBl0EK0+loECOPtrl+/nsaFe197di4yUgoe4jKoAJDXc6DGDjrQOoFDWZJ9HXwt8xDrQP+7aRwWKWI1GF8s8O4KzxWBBcwnl3vnl1Oez3oh6Ea1vjR7/z7DDTrFtqU2W/KAEzAuXDNZ7MY73MF216dzdSbWmUp4lcm7keJfWaMHgut9x5C9mj66Z0lJ+yhsjVvyiWrfk1lzPOTdhG15Y7gQlXtacvI7qv/XNSscDwqkgwHT/gUsD5yB7LdRRvJxQGYINn9hTpodKFVSTPrtGvyQw+HlRFXIkodErAGu9Iy1YpfSPc3jkFh5CX3lPxv7aqjE/JAfTIpEjGb/H7MO0e2vsViSW1qa/Lmi4/n4DEI3g7lYrcanspDfEpKkdV1OjSLOy0BCUqVoECaB55vs06rXl4jqmLsPsFM/7vYJ0vrBhDCm/00A/H81l1uekJ/6Lml3Hb9+NKiLqATJmDpyzfYZFHumEjC662L0Bwkxi7E9U4cQA0XMVDuMYAIeLMPgQaMVOd8fmt5SflFIfuBoszeAw7ow5gXPE2Y/yBc/7jExARUf/BxIHQBF5Sn3i61w4z5xJdCyO1F1X3+3ax+JSvMeZ7S6QSKp1Fp/sjYz6Z+VgCZzibGeEoujryfMulH7Rai5kAft9ebcW50DyJr2uo2z97mTWIu45YsSnNSMrrNUuG1XsYBtD9TDYzQffKB87vWbkM4EbPAFgoBV4GQS+vtFDUqOFAoi1nTtmIOvg38N4hT2Sn8r8clmBCXspBlMBYTnrqFJGBT3wZOzAyJDre9dHH7+x7qaaKDOB4UQALD5ecS0DE4obubQEiuJZ0EpBVpLuYcce8Aa4PYd/V4DLDAJBYKQPCWTcrEaZ5HYbJi11Gd6hjGom1ii18VHYnG28NKpkz2UKVPxlhYSp8uZr367iOmoy7zsxehW9wzcy2zG0a80PBMCRQMb32hnaHeOR8fnNDzZhaNYhkOdDsBUZ3loDMa1YP0uS0cjUP3b/6DBlqmZOeNABDsLl5BI5QJups8uxAuWJdkUB/pO6Zax6tsg7fN5mjjDgMGngO+DPcKqiHIDbFIGudxtPTIyDi9SFMKBDcfdGQRv41q1AqmxgkVfJMnP8w/Bc7N9/TR6C7mGObFqFkIEom8sKi2xYqJLTCHK7cxzaZvqODo22c3wisBCP4HeAgcRbNPAsBkNRhSmD48dHupdBRw4mIvtS5oeF6zeT1KMCyhMnmhpkFAGWnGscoNkwvQ8ZM5lE/vgTHFYL99OuNxdFBxTEDd5v2qLR8y9WkXsWgG6kZNndFG+pO/UAkOCipqIhL3hq7cRSdrCq7YhUsTocEcnaFa6nVkhnSeRYUA1YO0z5itF9Sly3VlxYDw239TJJH6f3EUfYO5lb7bcFcz8Bp7Oo8QmnsUHOz/fagVUBtKEw1iT88j+aKkv8cscKNkMxjYr8344D1kFoZ7/td1W6LCNYN594301tUGRmFjAzeRg5vyoM1F6+bJZ/Q54jN/k8SFd3DxPTYaAUsivsBfgTn7Mx8H2SpPt4GOdYRnEJOH6jHM2p6SgB0gzIRq6fHxGMmSmqaPCmlfwxiuloaVIitLGN8wie2CDWhkzLoCJcODh7KIOAqbHEvXdUxaS4TTTs07Clzj/6GmVs9kiZDerMxEnhUB6QQPlcfqkG9882RqHoLiHGBoHfQuXIsAG8GTAtao2KVwRnvvam8jo1e312GQAKWEa4sUVEAMG4G6ckcONDwRcg1e2D3+ohXgY4UAWF8wHKQMrSnzCgfFpsxh+aHXMGtPQroQasRY4U6UdG0rz1Vjbka0MekOGRZQEvqQFlxseFor8zWFgHek3v29+WqN6gaK5gZOTOMZzpQIC1201LkMCXild3vWXSc5UX9xcFYfbRPzGFa1FDcPfPB/jUEq/FeGt419CI3YmBlVoHsa4KdcwQP5ZSwHHhFJ7/Ph/Rap/4vmG91eDwPP0lDfCDRCLszTqfzM71xpmiKi2HwS4WlqvGNwtvwF5Dqpn6KTq8ax00UMPkxDcZrEEEsIvHiUXXEphdb4GB4FymlPwBz4Gperqq5pW7TQ6/yNRhW8VT5NhuP0udlxo4gILq5ZxAZk8ZGh3g4CqxJlPKY7AQxupfUcVpWT5VItp1+30UqoyP4wWsRo3olRRgkWZZ2ZN6VC3OZFeXB8NbnUrSdikNptD1QiGuKkr8EmSR/AK9Rw+FF3s5uwuPbvHGiPeFOViltMK7AUaOsq9+x9cndk3iJEE5LKZRlWJbKOZweROzmPNVPkjE3K/TyA57Rs68TkZ3MR8akKpm7cFjnjPd/DdkWjgYoKHSr5Wu5ssoBYU4acRs5g2DHxUmdq8VXOXRbunD8QN0LhgkssgahcdoYsNvuXGUK/KXD/7oFb+VGdhqIn02veuM5bLudJOc2Ky0GMaG4W/xWBxIJcL7yliJOXOpx0AkBqUgzlDczmLT4iILXDxxtRR1oZa2JWFgiAb43obrJnG/TZC2KSK2wqOzRZTXavZZFMb1f3bXvVaNaK828w9TO610gk8JNf3gMfETzXXsbcvRGCG9JWQZ6+cDPqc4466Yo2RcKH+PILeKOqtnlbInR3MmBeGG3FH10yzkybuqEC2HSQwpA0An7d9+73BkDUTm30bZmoP/RGbgFN+GrCOfADgqr0WbI1a1okpFms8iHYw9hm0zUvlEMivBRxModrbJJ+9/p3jUdQQ9BCtQdxnOGrT5dzRUmw0593/mbRSdBg0nRvRZM5/E16m7ZHmDEtWhwvfdZCZ8J8M12W0yRMszXamWfQTwIZ4ayYktrnscQuWr8idp3PjT2eF/jmtdhIfcpMnb+IfZY2FebW6UY/AK3jP4u3Tu4zE4qlnQgLFbM19EBIsNf7KhjdbqQ/D6yiDb+NlEi2SKD+ivXVUK8ib0oBo366gXkR8ZxGjpJIDcEgZPa9TcYe0TIbiPl/rPUQDu3XBJ9X/GNq3FAUsKsll57DzaGMrjcT+gctp+9MLYXCq+sqP81eVQ0r9lt+gcQfZbACRbEjvlMskztZG8gbC8Qn9tt26Q7y7nDrbZq/LEz7kR6Jc6pg3N9rVX8Y5MJrGlML9p9lU4jbTkKqCveeZUJjHB03m2KRKR2TytoFkTXOLg7keU1s1lrPMQJpoOKLuAAC+y1HlJucU6ysB5hsXhvSPPLq5J7JtnqHKZ4vYjC4Vy8153QY+6780xDuGARsGbOs1WqzH0QS765rnSKEbbKlkO8oI/VDwUd0is13tKpqILu1mDJFNy/iJAWcvDgjxvusIT+PGz3ST/J9r9Mtfd0jpaGeiLYIqXc7DiHSS8TcjFVksi66PEkxW1z6ujbLLUGNNYnzOWpH8BZGK4bCK7iR+MbIv8ncDAz1u4StN3vTTzewr9IQjk9wxFxn+6N1ddKs0vffJiS08N3a4G1SVrlZ97Q/M+8G9fe5AP6d9/Qq4WRnORVhofPIKEdCr3llspUfE0oKIIYoByBRPh+bX1HLS3JWGJRhIvE1aW4NTd8ePi4Z+kXb+Z8snYfSNcqijhAgVsx4RCM54cXUiYkjeBmmC4ajOHrChoELscJJC7+9jjMjw5BagZKlgRMiSNYz7h7vvZIoQqbtQmspc0cUk1G/73iXtSpROl5wtLgQi0mW2Ex8i3WULhcggx6E1LMVHUsdc9GHI1PH3U2Ko0PyGdn9KdVOLm7FPBui0i9a0HpA60MsewVE4z8CAt5d401Gv6zXlIT5Ybit1VIA0FCs7wtvYreru1fUyW3oLAZ/+aTnZrOcYRNVA8spoRtlRoWflsRClFcgzkqiHOrf0/SVw+EpVaFlJ0g4Kxq1MMOmiQdpMNpte8lMMQqm6cIFXlnGbfJllysKDi+0JJMotkqgIxOSQgU9dn/lWkeVf8nUm3iwX2Nl3WDw9i6AUK3vBAbZZrcJpDQ/N64AVwjT07Jef30GSSmtNu2WlW7YoyW2FlWfZFQUwk867EdLYKk9VG6JgEnBiBxkY7LMo4YLQJJlAo9l/oTvJkSARDF/XtyAzM8O2t3eT/iXa6wDN3WewNmQHdPfsxChU/KtLG2Mn8i4ZqKdSlIaBZadxJmRzVS/o4yA65RTSViq60oa395Lqw0pzY4SipwE0SXXsKV+GZraGSkr/RW08wPRvqvSUkYBMA9lPx4m24az+IHmCbXA+0faxTRE9wuGeO06DIXa6QlKJ3puIyiuAVfPr736vzo2pBirS+Vxel3TMm3JKhz9o2ZoRvaFVpIkykb0Hcm4oHFBMcNSNj7/4GJt43ogonY2Vg4nsDQIWxAcorpXACzgBqQPjYsE/VUpXpwNManEru4NwMCFPkXvMoqvoeLN3qyu/N1eWEHttMD65v19l/0kH2mR35iv/FI+yjoHJ9gPMz67af3Mq/BoWXqu3rphiWMXVkmnPSEkpGpUI2h1MThideGFEOK6YZHPwYzMBvpNC7+ZHxPb7epfefGyIB4JzO9DTNEYnDLVVHdQyvOEVefrk6Uv5kTQYVYWWdqrdcIl7yljwwIWdfQ/y+2QB3eR/qxYObuYyB4gTbo2in4PzarU1sO9nETkmj9/AoxDA+JM3GMqQtJR4jtduHtnoCLxd1gQUscHRB/MoRYIEsP2pDZ9KvHgtlk1iTbWWbHhohwFEYX7y51fUV2nuUmnoUcqnWIQAAgl9LTVX+Bc0QGNEhChxHR4YjfE51PUdGfsSFE6ck7BL3/hTf9jLq4G1IafINxOLKeAtO7quulYvH5YOBc+zX7CrMgWnW47/jfRsWnJjYYoE7xMfWV2HN2iyIqLI'; const FENCED = new Map([[8217, "apostrophe"], [8260, "fraction slash"], [12539, "middle dot"]]); const NSM_MAX = 4; function decode_arithmetic(bytes) { let pos = 0; function u16() { return bytes[pos++] << 8 | bytes[pos++]; } // decode the frequency table let symbol_count = u16(); let total = 1; let acc = [0, 1]; // first symbol has frequency 1 for (let i = 1; i < symbol_count; i++) { acc.push(total += u16()); } // skip the sized-payload that the last 3 symbols index into let skip = u16(); let pos_payload = pos; pos += skip; let read_width = 0; let read_buffer = 0; function read_bit() { if (read_width == 0) { // this will read beyond end of buffer // but (undefined|0) => zero pad read_buffer = read_buffer << 8 | bytes[pos++]; read_width = 8; } return read_buffer >> --read_width & 1; } const N = 31; const FULL = 2 ** N; const HALF = FULL >>> 1; const QRTR = HALF >> 1; const MASK = FULL - 1; // fill register let register = 0; for (let i = 0; i < N; i++) register = register << 1 | read_bit(); let symbols = []; let low = 0; let range = FULL; // treat like a float while (true) { let value = Math.floor(((register - low + 1) * total - 1) / range); let start = 0; let end = symbol_count; while (end - start > 1) { // binary search let mid = start + end >>> 1; if (value < acc[mid]) { end = mid; } else { start = mid; } } if (start == 0) break; // first symbol is end mark symbols.push(start); let a = low + Math.floor(range * acc[start] / total); let b = low + Math.floor(range * acc[start + 1] / total) - 1; while (((a ^ b) & HALF) == 0) { register = register << 1 & MASK | read_bit(); a = a << 1 & MASK; b = b << 1 & MASK | 1; } while (a & ~b & QRTR) { register = register & HALF | register << 1 & MASK >>> 1 | read_bit(); a = a << 1 ^ HALF; b = (b ^ HALF) << 1 | HALF | 1; } low = a; range = 1 + b - a; } let offset = symbol_count - 4; return symbols.map(x => { // index into payload switch (x - offset) { case 3: return offset + 0x10100 + (bytes[pos_payload++] << 16 | bytes[pos_payload++] << 8 | bytes[pos_payload++]); case 2: return offset + 0x100 + (bytes[pos_payload++] << 8 | bytes[pos_payload++]); case 1: return offset + bytes[pos_payload++]; default: return x - 1; } }); } // returns an iterator which returns the next symbol function read_payload(v) { let pos = 0; return () => v[pos++]; } function read_compressed_payload(s) { return read_payload(decode_arithmetic(unsafe_atob(s))); } // unsafe in the sense: // expected well-formed Base64 w/o padding // 20220922: added for https://github.com/adraffy/ens-normalize.js/issues/4 function unsafe_atob(s) { let lookup = []; [...'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'].forEach((c, i) => lookup[c.charCodeAt(0)] = i); let n = s.length; let ret = new Uint8Array(6 * n >> 3); for (let i = 0, pos = 0, width = 0, carry = 0; i < n; i++) { carry = carry << 6 | lookup[s.charCodeAt(i)]; width += 6; if (width >= 8) { ret[pos++] = carry >> (width -= 8); } } return ret; } // eg. [0,1,2,3...] => [0,-1,1,-2,...] function signed(i) { return i & 1 ? ~i >> 1 : i >> 1; } function read_deltas(n, next) { let v = Array(n); for (let i = 0, x = 0; i < n; i++) v[i] = x += signed(next()); return v; } // [123][5] => [0 3] [1 1] [0 0] function read_sorted(next, prev = 0) { let ret = []; while (true) { let x = next(); let n = next(); if (!n) break; prev += x; for (let i = 0; i < n; i++) { ret.push(prev + i); } prev += n + 1; } return ret; } function read_sorted_arrays(next) { return read_array_while(() => { let v = read_sorted(next); if (v.length) return v; }); } // returns map of x => ys function read_mapped(next) { let ret = []; while (true) { let w = next(); if (w == 0) break; ret.push(read_linear_table(w, next)); } while (true) { let w = next() - 1; if (w < 0) break; ret.push(read_replacement_table(w, next)); } return ret.flat(); } // read until next is falsy // return array of read values function read_array_while(next) { let v = []; while (true) { let x = next(v.length); if (!x) break; v.push(x); } return v; } // read w columns of length n // return as n rows of length w function read_transposed(n, w, next) { let m = Array(n).fill().map(() => []); for (let i = 0; i < w; i++) { read_deltas(n, next).forEach((x, j) => m[j].push(x)); } return m; } // returns [[x, ys], [x+dx, ys+dy], [x+2*dx, ys+2*dy], ...] // where dx/dy = steps, n = run size, w = length of y function read_linear_table(w, next) { let dx = 1 + next(); let dy = next(); let vN = read_array_while(next); let m = read_transposed(vN.length, 1 + w, next); return m.flatMap((v, i) => { let [x, ...ys] = v; return Array(vN[i]).fill().map((_, j) => { let j_dy = j * dy; return [x + j * dx, ys.map(y => y + j_dy)]; }); }); } // return [[x, ys...], ...] // where w = length of y function read_replacement_table(w, next) { let n = 1 + next(); let m = read_transposed(n, 1 + w, next); return m.map(v => [v[0], v.slice(1)]); } function read_trie(next) { let ret = []; let sorted = read_sorted(next); expand(decode([]), []); return ret; // not sorted function decode(Q) { // characters that lead into this node let S = next(); // state: valid, save, check let B = read_array_while(() => { // buckets leading to new nodes let cps = read_sorted(next).map(i => sorted[i]); if (cps.length) return decode(cps); }); return { S, B, Q }; } function expand({ S, B }, cps, saved) { if (S & 4 && saved === cps[cps.length - 1]) return; if (S & 2) saved = cps[cps.length - 1]; if (S & 1) ret.push(cps); for (let br of B) { for (let cp of br.Q) { expand(br, [...cps, cp], saved); } } } } function hex_cp(cp) { return cp.toString(16).toUpperCase().padStart(2, '0'); } function quote_cp(cp) { return `{${hex_cp(cp)}}`; // raffy convention: like "\u{X}" w/o the "\u" } /* export function explode_cp(s) { return [...s].map(c => c.codePointAt(0)); } */ function explode_cp(s) { // this is about 2x faster let cps = []; for (let pos = 0, len = s.length; pos < len;) { let cp = s.codePointAt(pos); pos += cp < 0x10000 ? 1 : 2; cps.push(cp); } return cps; } function str_from_cps(cps) { const chunk = 4096; let len = cps.length; if (len < chunk) return String.fromCodePoint(...cps); let buf = []; for (let i = 0; i < len;) { buf.push(String.fromCodePoint(...cps.slice(i, i += chunk))); } return buf.join(''); } function compare_arrays(a, b) { let n = a.length; let c = n - b.length; for (let i = 0; c == 0 && i < n; i++) c = a[i] - b[i]; return c; } // created 2023-09-25T01:01:55.148Z // compressed base64-encoded blob for include-nf data // source: https://github.com/adraffy/ens-normalize.js/blob/main/src/make.js // see: https://github.com/adraffy/ens-normalize.js#security // SHA-256: a974b6f8541fc29d919bc85118af0a44015851fab5343f8679cb31be2bdb209e var COMPRESSED = 'AEUDTAHBCFQATQDRADAAcgAgADQAFAAsABQAHwAOACQADQARAAoAFwAHABIACAAPAAUACwAFAAwABAAQAAMABwAEAAoABQAIAAIACgABAAQAFAALAAIACwABAAIAAQAHAAMAAwAEAAsADAAMAAwACgANAA0AAwAKAAkABAAdAAYAZwDSAdsDJgC0CkMB8xhZAqfoC190UGcThgBurwf7PT09Pb09AjgJum8OjDllxHYUKXAPxzq6tABAxgK8ysUvWAgMPT09PT09PSs6LT2HcgWXWwFLoSMEEEl5RFVMKvO0XQ8ExDdJMnIgsj26PTQyy8FfEQ8AY8IPAGcEbwRwBHEEcgRzBHQEdQR2BHcEeAR6BHsEfAR+BIAEgfndBQoBYgULAWIFDAFiBNcE2ATZBRAFEQUvBdALFAsVDPcNBw13DYcOMA4xDjMB4BllHI0B2grbAMDpHLkQ7QHVAPRNQQFnGRUEg0yEB2uaJF8AJpIBpob5AERSMAKNoAXqaQLUBMCzEiACnwRZEkkVsS7tANAsBG0RuAQLEPABv9HICTUBXigPZwRBApMDOwAamhtaABqEAY8KvKx3LQ4ArAB8UhwEBAVSagD8AEFZADkBIadVj2UMUgx5Il4ANQC9AxIB1BlbEPMAs30CGxlXAhwZKQIECBc6EbsCoxngzv7UzRQA8M0BawL6ZwkN7wABAD33OQRcsgLJCjMCjqUChtw/km+NAsXPAoP2BT84PwURAK0RAvptb6cApQS/OMMey5HJS84UdxpxTPkCogVFITaTOwERAK5pAvkNBOVyA7q3BKlOJSALAgUIBRcEdASpBXqzABXFSWZOawLCOqw//AolCZdvv3dSBkEQGyelEPcMMwG1ATsN7UvYBPEGOwTJH30ZGQ/NlZwIpS3dDO0m4y6hgFoj9SqDBe1L9DzdC01RaA9ZC2UJ4zpjgU4DIQENIosK3Q05CG0Q8wrJaw3lEUUHOQPVSZoApQcBCxEdNRW1JhBirAsJOXcG+xr2C48mrxMpevwF0xohBk0BKRr/AM8u54WwWjFcHE9fBgMLJSPHFKhQIA0lQLd4SBobBxUlqQKRQ3BKh1E2HpMh9jw9DWYuE1F8B/U8BRlPC4E8nkarRQ4R0j6NPUgiSUwsBDV/LC8niwnPD4UMuXxyAVkJIQmxDHETMREXN8UIOQcZLZckJxUIIUaVYJoE958D8xPRAwsFPwlBBxMDtRwtEy4VKQUNgSTXAvM21S6zAo9WgAEXBcsPJR/fEFBH4A7pCJsCZQODJesALRUhABcimwhDYwBfj9hTBS7LCMdqbCN0A2cU52ERcweRDlcHpxwzFb8c4XDIXguGCCijrwlbAXUJmQFfBOMICTVbjKAgQWdTi1gYmyBhQT9d/AIxDGUVn0S9h3gCiw9rEhsBNQFzBzkNAQJ3Ee0RaxCVCOuGBDW1M/g6JQRPIYMgEQonA09szgsnJvkM+GkBoxJiAww0PXfuZ6tgtiQX/QcZMsVBYCHxC5JPzQycGsEYQlQuGeQHvwPzGvMn6kFXBf8DowMTOk0z7gS9C2kIiwk/AEkOoxcH1xhqCnGM0AExiwG3mQNXkYMCb48GNwcLAGcLhwV55QAdAqcIowAFAM8DVwA5Aq0HnQAZAIVBAT0DJy8BIeUCjwOTCDHLAZUvAfMpBBvDDBUA9zduSgLDsQKAamaiBd1YAo4CSTUBTSUEBU5HUQOvceEA2wBLBhPfRwEVq0rLGuNDAd9vKwDHAPsABTUHBUEBzQHzbQC3AV8LMQmis7UBTekpAIMAFWsB1wKJAN0ANQB/8QFTAE0FWfkF0wJPSQERMRgrV2EBuwMfATMBDQB5BsuNpckHHwRtB9MCEBsV4QLvLge1AQMi3xPNQsUCvd5VoWACZIECYkJbTa9bNyACofcCaJgCZgkCn4Q4GwsCZjsCZiYEbgR/A38TA36SOQY5dxc5gjojIwJsHQIyNjgKAm3HAm2u74ozZ0UrAWcA3gDhAEoFB5gMjQD+C8IADbUCdy8CdqI/AnlLQwJ4uh1c20WuRtcCfD8CesgCfQkCfPAFWQUgSABIfWMkAoFtAoAAAoAFAn+uSVhKWxUXSswC0QEC0MxLJwOITwOH5kTFkTIC8qFdAwMDrkvOTC0lA89NTE2vAos/AorYwRsHHUNnBbcCjjcCjlxAl4ECjtkCjlx4UbRTNQpS1FSFApP7ApMMAOkAHFUeVa9V0AYsGymVhjLheGZFOzkCl58C77JYIagAWSUClo8ClnycAKlZrFoJgU0AOwKWtQKWTlxEXNECmcsCmWRcyl0HGQKcmznCOp0CnBYCn5sCnriKAB0PMSoPAp3xAp6SALU9YTRh7wKe0wKgbgGpAp6fHwKeTqVjyGQnJSsCJ68CJn4CoPsCoEwCot0CocQCpi8Cpc4Cp/8AfQKn8mh8aLEAA0lqHGrRAqzjAqyuAq1nAq0CAlcdAlXcArHh1wMfTmyXArK9DQKy6Bds4G1jbUhfAyXNArZcOz9ukAMpRQK4XgK5RxUCuSp3cDZw4QK9GQK72nCWAzIRAr6IcgIDM3ECvhpzInNPAsPLAsMEc4J0SzVFdOADPKcDPJoDPb8CxXwCxkcCxhCJAshpUQLIRALJTwLJLgJknQLd0nh5YXiueSVL0AMYo2cCAmH0GfOVJHsLXpJeuxECz2sCz2wvS1PS8xOfAMatAs9zASnqA04SfksFAtwnAtuKAtJPA1JcA1NfAQEDVYyAiT8AyxbtYEWCHILTgs6DjQLaxwLZ3oQQhEmnPAOGpQAvA2QOhnFZ+QBVAt9lAt64c3cC4i/tFAHzMCcB9JsB8tKHAuvzAulweQLq+QLq5AD5RwG5Au6JAuuclqqXAwLuPwOF4Jh5cOBxoQLzAwBpA44WmZMC9xMDkW4DkocC95gC+dkC+GaaHJqruzebHgOdgwL++gEbADmfHJ+zAwWNA6ZqA6bZANHFAwZqoYiiBQkDDEkCwAA/AwDhQRdTARHzA2sHl2cFAJMtK7evvdsBiZkUfxEEOQH7KQUhDp0JnwCS/SlXxQL3AZ0AtwW5AG8LbUEuFCaNLgFDAYD8AbUmAHUDDgRtACwCFgyhAAAKAj0CagPdA34EkQEgRQUhfAoABQBEABMANhICdwEABdUDa+8KxQIA9wqfJ7+xt+UBkSFBQgHpFH8RNMCJAAQAGwBaAkUChIsABjpTOpSNbQC4Oo860ACNOME63AClAOgAywE6gTo7Ofw5+Tt2iTpbO56JOm85GAFWATMBbAUvNV01njWtNWY1dTW2NcU1gjWRNdI14TWeNa017jX9NbI1wTYCNhE1xjXVNhY2JzXeNe02LjY9Ni41LSE2OjY9Njw2yTcIBJA8VzY4Nt03IDcPNsogN4k3MAoEsDxnNiQ3GTdsOo03IULUQwdC4EMLHA8PCZsobShRVQYA6X8A6bABFCnXAukBowC9BbcAbwNzBL8MDAMMAQgDAAkKCwsLCQoGBAVVBI/DvwDz9b29kaUCb0QtsRTNLt4eGBcSHAMZFhYZEhYEARAEBUEcQRxBHEEcQRxBHEEaQRxBHEFCSTxBPElISUhBNkM2QTYbNklISVmBVIgBFLWZAu0BhQCjBcEAbykBvwGJAaQcEZ0ePCklMAAhMvAIMAL54gC7Bm8EescjzQMpARQpKgDUABavAj626xQAJP0A3etzuf4NNRA7efy2Z9NQrCnC0OSyANz5BBIbJ5IFDR6miIavYS6tprjjmuKebxm5C74Q225X1pkaYYPb6f1DK4k3xMEBb9S2WMjEibTNWhsRJIA+vwNVEiXTE5iXs/wezV66oFLfp9NZGYW+Gk19J2+bCT6Ye2w6LDYdgzKMUabk595eLBCXANz9HUpWbATq9vqXVx9XDg+Pc9Xp4+bsS005SVM/BJBM4687WUuf+Uj9dEi8aDNaPxtpbDxcG1THTImUMZq4UCaaNYpsVqraNyKLJXDYsFZ/5jl7bLRtO88t7P3xZaAxhb5OdPMXqsSkp1WCieG8jXm1U99+blvLlXzPCS+M93VnJCiK+09LfaSaBAVBomyDgJua8dfUzR7ga34IvR2Nvj+A9heJ6lsl1KG4NkI1032Cnff1m1wof2B9oHJK4bi6JkEdSqeNeiuo6QoZZincoc73/TH9SXF8sCE7XyuYyW8WSgbGFCjPV0ihLKhdPs08Tx82fYAkLLc4I2wdl4apY7GU5lHRFzRWJep7Ww3wbeA3qmd59/86P4xuNaqDpygXt6M85glSBHOCGgJDnt+pN9bK7HApMguX6+06RZNjzVmcZJ+wcUrJ9//bpRNxNuKpNl9uFds+S9tdx7LaM5ZkIrPj6nIU9mnbFtVbs9s/uLgl8MVczAwet+iOEzzBlYW7RCMgE6gyNLeq6+1tIx4dpgZnd0DksJS5f+JNDpwwcPNXaaVspq1fbQajOrJgK0ofKtJ1Ne90L6VO4MOl5S886p7u6xo7OLjG8TGL+HU1JXGJgppg4nNbNJ5nlzSpuPYy21JUEcUA94PoFiZfjZue+QnyQ80ekOuZVkxx4g+cvhJfHgNl4hy1/a6+RKcKlar/J29y//EztlbVPHVUeQ1zX86eQVAjR/M3dA9w4W8LfaXp4EgM85wOWasli837PzVMOnsLzR+k3o75/lRPAJSE1xAKQzEi5v10ke+VBvRt1cwQRMd+U5mLCTGVd6XiZtgBG5cDi0w22GKcVNvHiu5LQbZEDVtz0onn7k5+heuKXVsZtSzilkLRAUmjMXEMB3J9YC50XBxPiz53SC+EhnPl9WsKCv92SM/OFFIMJZYfl0WW8tIO3UxYcwdMAj7FSmgrsZ2aAZO03BOhP1bNNZItyXYQFTpC3SG1VuPDqH9GkiCDmE+JwxyIVSO5siDErAOpEXFgjy6PQtOVDj+s6e1r8heWVvmZnTciuf4EiNZzCAd7SOMhXERIOlsHIMG399i9aLTy3m2hRLZjJVDNLS53iGIK11dPqQt0zBDyg6qc7YqkDm2M5Ve6dCWCaCbTXX2rToaIgz6+zh4lYUi/+6nqcFMAkQJKHYLK0wYk5N9szV6xihDbDDFr45lN1K4aCXBq/FitPSud9gLt5ZVn+ZqGX7cwm2z5EGMgfFpIFyhGGuDPmso6TItTMwny+7uPnLCf4W6goFQFV0oQSsc9VfMmVLcLr6ZetDZbaSFTLqnSO/bIPjA3/zAUoqgGFAEQS4IhuMzEp2I3jJzbzkk/IEmyax+rhZTwd6f+CGtwPixu8IvzACquPWPREu9ZvGkUzpRwvRRuaNN6cr0W1wWits9ICdYJ7ltbgMiSL3sTPeufgNcVqMVWFkCPDH4jG2jA0XcVgQj62Cb29v9f/z/+2KbYvIv/zzjpQAPkliaVDzNrW57TZ/ZOyZD0nlfMmAIBIAGAI0D3k/mdN4xr9v85ZbZbbqfH2jGd5hUqNZWwl5SPfoGmfElmazUIeNL1j/mkF7VNAzTq4jNt8JoQ11NQOcmhprXoxSxfRGJ9LDEOAQ+dmxAQH90iti9e2u/MoeuaGcDTHoC+xsmEeWmxEKefQuIzHbpw5Tc5cEocboAD09oipWQhtTO1wivf/O+DRe2rpl/E9wlrzBorjJsOeG1B/XPW4EaJEFdNlECEZga5ZoGRHXgYouGRuVkm8tDESiEyFNo+3s5M5puSdTyUL2llnINVHEt91XUNW4ewdMgJ4boJfEyt/iY5WXqbA+A2Fkt5Z0lutiWhe9nZIyIUjyXDC3UsaG1t+eNx6z4W/OYoTB7A6x+dNSTOi9AInctbESqm5gvOLww7OWXPrmHwVZasrl4eD113pm+JtT7JVOvnCXqdzzdTRHgJ0PiGTFYW5Gvt9R9LD6Lzfs0v/TZZHSmyVNq7viIHE6DBK7Qp07Iz55EM8SYtQvZf/obBniTWi5C2/ovHfw4VndkE5XYdjOhCMRjDeOEfXeN/CwfGduiUIfsoFeUxXeQXba7c7972XNv8w+dTjjUM0QeNAReW+J014dKAD/McQYXT7c0GQPIkn3Ll6R7gGjuiQoZD0TEeEqQpKoZ15g/0OPQI17QiSv9AUROa/V/TQN3dvLArec3RrsYlvBm1b8LWzltdugsC50lNKYLEp2a+ZZYqPejULRlOJh5zj/LVMyTDvwKhMxxwuDkxJ1QpoNI0OTWLom4Z71SNzI9TV1iXJrIu9Wcnd+MCaAw8o1jSXd94YU/1gnkrC9BUEOtQvEIQ7g0i6h+KL2JKk8Ydl7HruvgWMSAmNe+LshGhV4qnWHhO9/RIPQzY1tHRj2VqOyNsDpK0cww+56AdDC4gsWwY0XxoucIWIqs/GcwnWqlaT0KPr8mbK5U94/301i1WLt4YINTVvCFBrFZbIbY8eycOdeJ2teD5IfPLCRg7jjcFTwlMFNl9zdh/o3E/hHPwj7BWg0MU09pPrBLbrCgm54A6H+I6v27+jL5gkjWg/iYdks9jbfVP5y/n0dlgWEMlKasl7JvFZd56LfybW1eeaVO0gxTfXZwD8G4SI116yx7UKVRgui6Ya1YpixqXeNLc8IxtAwCU5IhwQgn+NqHnRaDv61CxKhOq4pOX7M6pkA+Pmpd4j1vn6ACUALoLLc4vpXci8VidLxzm7qFBe7s+quuJs6ETYmnpgS3LwSZxPIltgBDXz8M1k/W2ySNv2f9/NPhxLGK2D21dkHeSGmenRT3Yqcdl0m/h3OYr8V+lXNYGf8aCCpd4bWjE4QIPj7vUKN4Nrfs7ML6Y2OyS830JCnofg/k7lpFpt4SqZc5HGg1HCOrHvOdC8bP6FGDbE/VV0mX4IakzbdS/op+Kt3G24/8QbBV7y86sGSQ/vZzU8FXs7u6jIvwchsEP2BpIhW3G8uWNwa3HmjfH/ZjhhCWvluAcF+nMf14ClKg5hGgtPLJ98ueNAkc5Hs2WZlk2QHvfreCK1CCGO6nMZVSb99VM/ajr8WHTte9JSmkXq/i/U943HEbdzW6Re/S88dKgg8pGOLlAeNiqrcLkUR3/aClFpMXcOUP3rmETcWSfMXZE3TUOi8i+fqRnTYLflVx/Vb/6GJ7eIRZUA6k3RYR3iFSK9c4iDdNwJuZL2FKz/IK5VimcNWEqdXjSoxSgmF0UPlDoUlNrPcM7ftmA8Y9gKiqKEHuWN+AZRIwtVSxye2Kf8rM3lhJ5XcBXU9n4v0Oy1RU2M+4qM8AQPVwse8ErNSob5oFPWxuqZnVzo1qB/IBxkM3EVUKFUUlO3e51259GgNcJbCmlvrdjtoTW7rChm1wyCKzpCTwozUUEOIcWLneRLgMXh+SjGSFkAllzbGS5HK7LlfCMRNRDSvbQPjcXaenNYxCvu2Qyznz6StuxVj66SgI0T8B6/sfHAJYZaZ78thjOSIFumNWLQbeZixDCCC+v0YBtkxiBB3jefHqZ/dFHU+crbj6OvS1x/JDD7vlm7zOVPwpUC01nhxZuY/63E7g'; // https://unicode.org/reports/tr15/ // for reference implementation // see: /derive/nf.js // algorithmic hangul // https://www.unicode.org/versions/Unicode15.0.0/ch03.pdf (page 144) const S0 = 0xAC00; const L0 = 0x1100; const V0 = 0x1161; const T0 = 0x11A7; const L_COUNT = 19; const V_COUNT = 21; const T_COUNT = 28; const N_COUNT = V_COUNT * T_COUNT; const S_COUNT = L_COUNT * N_COUNT; const S1 = S0 + S_COUNT; const L1 = L0 + L_COUNT; const V1 = V0 + V_COUNT; const T1$1 = T0 + T_COUNT; function unpack_cc(packed) { return packed >> 24 & 0xFF; } function unpack_cp(packed) { return packed & 0xFFFFFF; } let SHIFTED_RANK, EXCLUSIONS, DECOMP, RECOMP; function init$1() { //console.time('nf'); let r = read_compressed_payload(COMPRESSED); SHIFTED_RANK = new Map(read_sorted_arrays(r).flatMap((v, i) => v.map(x => [x, i + 1 << 24]))); // pre-shifted EXCLUSIONS = new Set(read_sorted(r)); DECOMP = new Map(); RECOMP = new Map(); for (let [cp, cps] of read_mapped(r)) { if (!EXCLUSIONS.has(cp) && cps.length == 2) { let [a, b] = cps; let bucket = RECOMP.get(a); if (!bucket) { bucket = new Map(); RECOMP.set(a, bucket); } bucket.set(b, cp); } DECOMP.set(cp, cps.reverse()); // stored reversed } //console.timeEnd('nf'); // 20230905: 11ms } function is_hangul(cp) { return cp >= S0 && cp < S1; } function compose_pair(a, b) { if (a >= L0 && a < L1 && b >= V0 && b < V1) { return S0 + (a - L0) * N_COUNT + (b - V0) * T_COUNT; } else if (is_hangul(a) && b > T0 && b < T1$1 && (a - S0) % T_COUNT == 0) { return a + (b - T0); } else { let recomp = RECOMP.get(a); if (recomp) { recomp = recomp.get(b); if (recomp) { return recomp; } } return -1; } } function decomposed(cps) { if (!SHIFTED_RANK) init$1(); let ret = []; let buf = []; let check_order = false; function add(cp) { let cc = SHIFTED_RANK.get(cp); if (cc) { check_order = true; cp |= cc; } ret.push(cp); } for (let cp of cps) { while (true) { if (cp < 0x80) { ret.push(cp); } else if (is_hangul(cp)) { let s_index = cp - S0; let l_index = s_index / N_COUNT | 0; let v_index = s_index % N_COUNT / T_COUNT | 0; let t_index = s_index % T_COUNT; add(L0 + l_index); add(V0 + v_index); if (t_index > 0) add(T0 + t_index); } else { let mapped = DECOMP.get(cp); if (mapped) { buf.push(...mapped); } else { add(cp); } } if (!buf.length) break; cp = buf.pop(); } } if (check_order && ret.length > 1) { let prev_cc = unpack_cc(ret[0]); for (let i = 1; i < ret.length; i++) { let cc = unpack_cc(ret[i]); if (cc == 0 || prev_cc <= cc) { prev_cc = cc; continue; } let j = i - 1; while (true) { let tmp = ret[j + 1]; ret[j + 1] = ret[j]; ret[j] = tmp; if (!j) break; prev_cc = unpack_cc(ret[--j]); if (prev_cc <= cc) break; } prev_cc = unpack_cc(ret[i]); } } return ret; } function composed_from_decomposed(v) { let ret = []; let stack = []; let prev_cp = -1; let prev_cc = 0; for (let packed of v) { let cc = unpack_cc(packed); let cp = unpack_cp(packed); if (prev_cp == -1) { if (cc == 0) { prev_cp = cp; } else { ret.push(cp); } } else if (prev_cc > 0 && prev_cc >= cc) { if (cc == 0) { ret.push(prev_cp, ...stack); stack.length = 0; prev_cp = cp; } else { stack.push(cp); } prev_cc = cc; } else { let composed = compose_pair(prev_cp, cp); if (composed >= 0) { prev_cp = composed; } else if (prev_cc == 0 && cc == 0) { ret.push(prev_cp); prev_cp = cp; } else { stack.push(cp); prev_cc = cc; } } } if (prev_cp >= 0) { ret.push(prev_cp, ...stack); } return ret; } // note: cps can be iterable function nfd(cps) { return decomposed(cps).map(unpack_cp); } function nfc(cps) { return composed_from_decomposed(decomposed(cps)); } const HYPHEN = 0x2D; const STOP_CH = '.'; const FE0F = 0xFE0F; const UNIQUE_PH = 1; // 20230913: replace [...v] with Array_from(v) to avoid large spreads const Array_from = x => Array.from(x); // Array.from.bind(Array); function group_has_cp(g, cp) { // 20230913: keep primary and secondary distinct instead of creating valid union return g.P.has(cp) || g.Q.has(cp); } class Emoji extends Array { get is_emoji() { return true; } // free tagging system } let MAPPED, IGNORED, CM, NSM, ESCAPE, GROUPS, WHOLE_VALID, WHOLE_MAP, VALID, EMOJI_LIST, EMOJI_ROOT; function init() { if (MAPPED) return; let r = read_compressed_payload(COMPRESSED$1); const read_sorted_array = () => read_sorted(r); const read_sorted_set = () => new Set(read_sorted_array()); const set_add_many = (set, v) => v.forEach(x => set.add(x)); MAPPED = new Map(read_mapped(r)); IGNORED = read_sorted_set(); // ignored characters are not valid, so just read raw codepoints /* // direct include from payload is smaller than the decompression code const FENCED = new Map(read_array_while(() => { let cp = r(); if (cp) return [cp, read_str(r())]; })); */ // 20230217: we still need all CM for proper error formatting // but norm only needs NSM subset that are potentially-valid CM = read_sorted_array(); NSM = new Set(read_sorted_array().map(i => CM[i])); CM = new Set(CM); ESCAPE = read_sorted_set(); // characters that should not be printed read_sorted_set(); // only needed to illustrate ens_tokenize() transformations let chunks = read_sorted_arrays(r); let unrestricted = r(); //const read_chunked = () => new Set(read_sorted_array().flatMap(i => chunks[i]).concat(read_sorted_array())); const read_chunked = () => { // 20230921: build set in parts, 2x faster let set = new Set(); read_sorted_array().forEach(i => set_add_many(set, chunks[i])); set_add_many(set, read_sorted_array()); return set; }; GROUPS = read_array_while(i => { // minifier property mangling seems unsafe // so these are manually renamed to single chars let N = read_array_while(r).map(x => x + 0x60); if (N.length) { let R = i >= unrestricted; // unrestricted then restricted N[0] -= 32; // capitalize N = str_from_cps(N); if (R) N = `Restricted[${N}]`; let P = read_chunked(); // primary let Q = read_chunked(); // secondary let M = !r(); // not-whitelisted, check for NSM // *** this code currently isn't needed *** /* let V = [...P, ...Q].sort((a, b) => a-b); // derive: sorted valid let M = r()-1; // number of combining mark if (M < 0) { // whitelisted M = new Map(read_array_while(() => { let i = r(); if (i) return [V[i-1], read_array_while(() => { let v = read_array_while(r); if (v.length) return v.map(x => x-1); })]; })); }*/ return { N, P, Q, M, R }; } }); // decode compressed wholes WHOLE_VALID = read_sorted_set(); WHOLE_MAP = new Map(); let wholes = read_sorted_array().concat(Array_from(WHOLE_VALID)).sort((a, b) => a - b); // must be sorted wholes.forEach((cp, i) => { let d = r(); let w = wholes[i] = d ? wholes[i - d] : { V: [], M: new Map() }; w.V.push(cp); // add to member set if (!WHOLE_VALID.has(cp)) { WHOLE_MAP.set(cp, w); // register with whole map } }); // compute confusable-extent complements // usage: WHOLE_MAP.get(cp).M.get(cp) = complement set for (let { V, M } of new Set(WHOLE_MAP.values())) { // connect all groups that have each whole character let recs = []; for (let cp of V) { let gs = GROUPS.filter(g => group_has_cp(g, cp)); let rec = recs.find(({ G }) => gs.some(g => G.has(g))); if (!rec) { rec = { G: new Set(), V: [] }; recs.push(rec); } rec.V.push(cp); set_add_many(rec.G, gs); } // per character cache groups which are not a member of the extent let union = recs.flatMap(x => Array_from(x.G)); // all of the groups used by this whole for (let { G, V } of recs) { let complement = new Set(union.filter(g => !G.has(g))); // groups not covered by the extent for (let cp of V) { M.set(cp, complement); // this is the same reference } } } // compute valid set // 20230924: VALID was union but can be re-used VALID = new Set(); // exists in 1+ groups let multi = new Set(); // exists in 2+ groups const add_to_union = cp => VALID.has(cp) ? multi.add(cp) : VALID.add(cp); for (let g of GROUPS) { for (let cp of g.P) add_to_union(cp); for (let cp of g.Q) add_to_union(cp); } // dual purpose WHOLE_MAP: return placeholder if unique non-confusable for (let cp of VALID) { if (!WHOLE_MAP.has(cp) && !multi.has(cp)) { WHOLE_MAP.set(cp, UNIQUE_PH); } } // add all decomposed parts // see derive: "Valid is Closed (via Brute-force)" set_add_many(VALID, nfd(VALID)); // decode emoji // 20230719: emoji are now fully-expanded to avoid quirk logic EMOJI_LIST = read_trie(r).map(v => Emoji.from(v)).sort(compare_arrays); EMOJI_ROOT = new Map(); // this has approx 7K nodes (2+ per emoji) for (let cps of EMOJI_LIST) { // 20230719: change to *slightly* stricter algorithm which disallows // insertion of misplaced FE0F in emoji sequences (matching ENSIP-15) // example: beautified [A B] (eg. flag emoji) // before: allow: [A FE0F B], error: [A FE0F FE0F B] // after: error: both // note: this code now matches ENSNormalize.{cs,java} logic let prev = [EMOJI_ROOT]; for (let cp of cps) { let next = prev.map(node => { let child = node.get(cp); if (!child) { // should this be object? // (most have 1-2 items, few have many) // 20230719: no, v8 default map is 4? child = new Map(); node.set(cp, child); } return child; }); if (cp === FE0F) { prev.push(...next); // less than 20 elements } else { prev = next; } } for (let x of prev) { x.V = cps; } } } // if escaped: {HEX} // else: "x" {HEX} function quoted_cp(cp) { return (should_escape(cp) ? '' : `${bidi_qq(safe_str_from_cps([cp]))} `) + quote_cp(cp); } // 20230211: some messages can be mixed-directional and result in spillover // use 200E after a quoted string to force the remainder of a string from // acquring the direction of the quote // https://www.w3.org/International/questions/qa-bidi-unicode-controls#exceptions function bidi_qq(s) { return `"${s}"\u200E`; // strong LTR } function check_label_extension(cps) { if (cps.length >= 4 && cps[2] == HYPHEN && cps[3] == HYPHEN) { throw new Error(`invalid label extension: "${str_from_cps(cps.slice(0, 4))}"`); // this can only be ascii so cant be bidi } } function check_leading_underscore(cps) { const UNDERSCORE = 0x5F; for (let i = cps.lastIndexOf(UNDERSCORE); i > 0;) { if (cps[--i] !== UNDERSCORE) { throw new Error('underscore allowed only at start'); } } } // check that a fenced cp is not leading, trailing, or touching another fenced cp function check_fenced(cps) { let cp = cps[0]; let prev = FENCED.get(cp); if (prev) throw error_placement(`leading ${prev}`); let n = cps.length; let last = -1; // prevents trailing from throwing for (let i = 1; i < n; i++) { cp = cps[i]; let match = FENCED.get(cp); if (match) { // since cps[0] isn't fenced, cps[1] cannot throw if (last == i) throw error_placement(`${prev} + ${match}`); last = i + 1; prev = match; } } if (last == n) throw error_placement(`trailing ${prev}`); } // create a safe to print string // invisibles are escaped // leading cm uses placeholder // if cps exceed max, middle truncate with ellipsis // quoter(cp) => string, eg. 3000 => "{3000}" // note: in html, you'd call this function then replace [<>&] with entities function safe_str_from_cps(cps, max = Infinity, quoter = quote_cp) { //if (Number.isInteger(cps)) cps = [cps]; //if (!Array.isArray(cps)) throw new TypeError(`expected codepoints`); let buf = []; if (is_combining_mark(cps[0])) buf.push('◌'); if (cps.length > max) { max >>= 1; cps = [...cps.slice(0, max), 0x2026, ...cps.slice(-max)]; } let prev = 0; let n = cps.length; for (let i = 0; i < n; i++) { let cp = cps[i]; if (should_escape(cp)) { buf.push(str_from_cps(cps.slice(prev, i))); buf.push(quoter(cp)); prev = i + 1; } } buf.push(str_from_cps(cps.slice(prev, n))); return buf.join(''); } // note: set(s) cannot be exposed because they can be modified // note: Object.freeze() doesn't work function is_combining_mark(cp) { init(); return CM.has(cp); } function should_escape(cp) { init(); return ESCAPE.has(cp); } function ens_normalize(name) { return flatten(split(name, nfc, filter_fe0f)); } function split(name, nf, ef) { if (!name) return []; // 20230719: empty name allowance init(); let offset = 0; // https://unicode.org/reports/tr46/#Validity_Criteria // 4.) "The label must not contain a U+002E ( . ) FULL STOP." return name.split(STOP_CH).map(label => { let input = explode_cp(label); let info = { input, offset // codepoint, not substring! }; offset += input.length + 1; // + stop try { // 1.) "The label must be in Unicode Normalization Form NFC" let tokens = info.tokens = tokens_from_str(input, nf, ef); let token_count = tokens.length; let type; if (!token_count) { // the label was effectively empty (could of had ignored characters) //norm = []; //type = 'None'; // use this instead of next match, "ASCII" // 20230120: change to strict // https://discuss.ens.domains/t/ens-name-normalization-2nd/14564/59 throw new Error(`empty label`); } let norm = info.output = tokens.flat(); check_leading_underscore(norm); let emoji = info.emoji = token_count > 1 || tokens[0].is_emoji; // same as: tokens.some(x => x.is_emoji); if (!emoji && norm.every(cp => cp < 0x80)) { // special case for ascii // 20230123: matches matches WHATWG, see note 3.3 check_label_extension(norm); // only needed for ascii // cant have fenced // cant have cm // cant have wholes // see derive: "Fastpath ASCII" type = 'ASCII'; } else { let chars = tokens.flatMap(x => x.is_emoji ? [] : x); // all of the nfc tokens concat together if (!chars.length) { // theres no text, just emoji type = 'Emoji'; } else { // 5.) "The label must not begin with a combining mark, that is: General_Category=Mark." if (CM.has(norm[0])) throw error_placement('leading combining mark'); for (let i = 1; i < token_count; i++) { // we've already checked the first token let cps = tokens[i]; if (!cps.is_emoji && CM.has(cps[0])) { // every text token has emoji neighbors, eg. EtEEEtEt... // bidi_qq() not needed since emoji is LTR and cps is a CM throw error_placement(`emoji + combining mark: "${str_from_cps(tokens[i - 1])} + ${safe_str_from_cps([cps[0]])}"`); } } check_fenced(norm); let unique = Array_from(new Set(chars)); let [g] = determine_group(unique); // take the first match // see derive: "Matching Groups have Same CM Style" // alternative: could form a hybrid type: Latin/Japanese/... check_group(g, chars); // need text in order check_whole(g, unique); // only need unique text (order would be required for multiple-char confusables) type = g.N; // 20230121: consider exposing restricted flag // it's simpler to just check for 'Restricted' // or even better: type.endsWith(']') //if (g.R) info.restricted = true; } } info.type = type; } catch (err) { info.error = err; // use full error object } return info; }); } function check_whole(group, unique) { let maker; let shared = []; for (let cp of unique) { let whole = WHOLE_MAP.get(cp); if (whole === UNIQUE_PH) return; // unique, non-confusable if (whole) { let set = whole.M.get(cp); // groups which have a character that look-like this character maker = maker ? maker.filter(g => set.has(g)) : Array_from(set); if (!maker.length) return; // confusable intersection is empty } else { shared.push(cp); } } if (maker) { // we have 1+ confusable // check if any of the remaining groups // contain the shared characters too for (let g of maker) { if (shared.every(cp => group_has_cp(g, cp))) { throw new Error(`whole-script confusable: ${group.N}/${g.N}`); } } } } // assumption: unique.size > 0 // returns list of matching groups function determine_group(unique) { let groups = GROUPS; for (let cp of unique) { // note: we need to dodge CM that are whitelisted // but that code isn't currently necessary let gs = groups.filter(g => group_has_cp(g, cp)); if (!gs.length) { if (!GROUPS.some(g => group_has_cp(g, cp))) { // the character was composed of valid parts // but it's NFC form is invalid // 20230716: change to more exact statement, see: ENSNormalize.{cs,java} // note: this doesn't have to be a composition // 20230720: change to full check throw error_disallowed(cp); // this should be rare } else { // there is no group that contains all these characters // throw using the highest priority group that matched // https://www.unicode.org/reports/tr39/#mixed_script_confusables throw error_group_member(groups[0], cp); } } groups = gs; if (gs.length == 1) break; // there is only one group left } // there are at least 1 group(s) with all of these characters return groups; } // throw on first error function flatten(split) { return split.map(({ input, error, output }) => { if (error) { // don't print label again if just a single label let msg = error.message; // bidi_qq() only necessary if msg is digits throw new Error(split.length == 1 ? msg : `Invalid label ${bidi_qq(safe_str_from_cps(input, 63))}: ${msg}`); } return str_from_cps(output); }).join(STOP_CH); } function error_disallowed(cp) { // TODO: add cp to error? return new Error(`disallowed character: ${quoted_cp(cp)}`); } function error_group_member(g, cp) { let quoted = quoted_cp(cp); let gg = GROUPS.find(g => g.P.has(cp)); // only check primary if (gg) { quoted = `${gg.N} ${quoted}`; } return new Error(`illegal mixture: ${g.N} + ${quoted}`); } function error_placement(where) { return new Error(`illegal placement: ${where}`); } // assumption: cps.length > 0 // assumption: cps[0] isn't a CM // assumption: the previous character isn't an emoji function check_group(g, cps) { for (let cp of cps) { if (!group_has_cp(g, cp)) { // for whitelisted scripts, this will throw illegal mixture on invalid cm, eg. "e{300}{300}" // at the moment, it's unnecessary to introduce an extra error type // until there exists a whitelisted multi-character // eg. if (M < 0 && is_combining_mark(cp)) { ... } // there are 3 cases: // 1. illegal cm for wrong group => mixture error // 2. illegal cm for same group => cm error // requires set of whitelist cm per group: // eg. new Set([...g.P, ...g.Q].flatMap(nfc).filter(cp => CM.has(cp))) // 3. wrong group => mixture error throw error_group_member(g, cp); } } //if (M >= 0) { // we have a known fixed cm count if (g.M) { // we need to check for NSM let decomposed = nfd(cps); for (let i = 1, e = decomposed.length; i < e; i++) { // see: assumption // 20230210: bugfix: using cps instead of decomposed h/t Carbon225 /* if (CM.has(decomposed[i])) { let j = i + 1; while (j < e && CM.has(decomposed[j])) j++; if (j - i > M) { throw new Error(`too many combining marks: ${g.N} ${bidi_qq(str_from_cps(decomposed.slice(i-1, j)))} (${j-i}/${M})`); } i = j; } */ // 20230217: switch to NSM counting // https://www.unicode.org/reports/tr39/#Optional_Detection if (NSM.has(decomposed[i])) { let j = i + 1; for (let cp; j < e && NSM.has(cp = decomposed[j]); j++) { // a. Forbid sequences of the same nonspacing mark. for (let k = i; k < j; k++) { // O(n^2) but n < 100 if (decomposed[k] == cp) { throw new Error(`duplicate non-spacing marks: ${quoted_cp(cp)}`); } } } // parse to end so we have full nsm count // b. Forbid sequences of more than 4 nonspacing marks (gc=Mn or gc=Me). if (j - i > NSM_MAX) { // note: this slice starts with a base char or spacing-mark cm throw new Error(`excessive non-spacing marks: ${bidi_qq(safe_str_from_cps(decomposed.slice(i - 1, j)))} (${j - i}/${NSM_MAX})`); } i = j; } } } // *** this code currently isn't needed *** /* let cm_whitelist = M instanceof Map; for (let i = 0, e = cps.length; i < e; ) { let cp = cps[i++]; let seqs = cm_whitelist && M.get(cp); if (seqs) { // list of codepoints that can follow // if this exists, this will always be 1+ let j = i; while (j < e && CM.has(cps[j])) j++; let cms = cps.slice(i, j); let match = seqs.find(seq => !compare_arrays(seq, cms)); if (!match) throw new Error(`disallowed combining mark sequence: "${safe_str_from_cps([cp, ...cms])}"`); i = j; } else if (!V.has(cp)) { // https://www.unicode.org/reports/tr39/#mixed_script_confusables let quoted = quoted_cp(cp); for (let cp of cps) { let u = UNIQUE.get(cp); if (u && u !== g) { // if both scripts are restricted this error is confusing // because we don't differentiate RestrictedA from RestrictedB if (!u.R) quoted = `${quoted} is ${u.N}`; break; } } throw new Error(`disallowed ${g.N} character: ${quoted}`); //throw new Error(`disallowed character: ${quoted} (expected ${g.N})`); //throw new Error(`${g.N} does not allow: ${quoted}`); } } if (!cm_whitelist) { let decomposed = nfd(cps); for (let i = 1, e = decomposed.length; i < e; i++) { // we know it can't be cm leading if (CM.has(decomposed[i])) { let j = i + 1; while (j < e && CM.has(decomposed[j])) j++; if (j - i > M) { throw new Error(`too many combining marks: "${str_from_cps(decomposed.slice(i-1, j))}" (${j-i}/${M})`); } i = j; } } } */ } // given a list of codepoints // returns a list of lists, where emoji are a fully-qualified (as Array subclass) // eg. explode_cp("abc💩d") => [[61, 62, 63], Emoji[1F4A9, FE0F], [64]] // 20230818: rename for 'process' name collision h/t Javarome // https://github.com/adraffy/ens-normalize.js/issues/23 function tokens_from_str(input, nf, ef) { let ret = []; let chars = []; input = input.slice().reverse(); // flip so we can pop while (input.length) { let emoji = consume_emoji_reversed(input); if (emoji) { if (chars.length) { ret.push(nf(chars)); chars = []; } ret.push(ef(emoji)); } else { let cp = input.pop(); if (VALID.has(cp)) { chars.push(cp); } else { let cps = MAPPED.get(cp); if (cps) { chars.push(...cps); // less than 10 elements } else if (!IGNORED.has(cp)) { // 20230912: unicode 15.1 changed the order of processing such that // disallowed parts are only rejected after NFC // https://unicode.org/reports/tr46/#Validity_Criteria // this doesn't impact normalization as of today // technically, this error can be removed as the group logic will apply similar logic // however the error type might be less clear throw error_disallowed(cp); } } } } if (chars.length) { ret.push(nf(chars)); } return ret; } function filter_fe0f(cps) { return cps.filter(cp => cp != FE0F); } // given array of codepoints // returns the longest valid emoji sequence (or undefined if no match) // *MUTATES* the supplied array // disallows interleaved ignored characters // fills (optional) eaten array with matched codepoints function consume_emoji_reversed(cps, eaten) { let node = EMOJI_ROOT; let emoji; let pos = cps.length; while (pos) { node = node.get(cps[--pos]); if (!node) break; let { V } = node; if (V) { // this is a valid emoji (so far) emoji = V; cps.length = pos; // truncate } } return emoji; } const Zeros = new Uint8Array(32); Zeros.fill(0); function checkComponent(comp) { assertArgument(comp.length !== 0, "invalid ENS name; empty component", "comp", comp); return comp; } function ensNameSplit(name) { const bytes = toUtf8Bytes(ensNormalize(name)); const comps = []; if (name.length === 0) { return comps; } let last = 0; for (let i = 0; i < bytes.length; i++) { const d = bytes[i]; // A separator (i.e. "."); copy this component if (d === 0x2e) { comps.push(checkComponent(bytes.slice(last, i))); last = i + 1; } } // There was a stray separator at the end of the name assertArgument(last < bytes.length, "invalid ENS name; empty component", "name", name); comps.push(checkComponent(bytes.slice(last))); return comps; } /** * Returns the ENS %%name%% normalized. */ function ensNormalize(name) { try { if (name.length === 0) { throw new Error("empty label"); } return ens_normalize(name); } catch (error) { assertArgument(false, `invalid ENS name (${error.message})`, "name", name); } } /** * Returns the [[link-namehash]] for %%name%%. */ function namehash(name) { assertArgument(typeof name === "string", "invalid ENS name; not a string", "name", name); assertArgument(name.length, `invalid ENS name (empty label)`, "name", name); let result = Zeros; const comps = ensNameSplit(name); while (comps.length) { result = keccak256(concat([result, keccak256(comps.pop())])); } return hexlify(result); } /** * Returns the DNS encoded %%name%%. * * This is used for various parts of ENS name resolution, such * as the wildcard resolution. */ function dnsEncode(name, _maxLength) { const length = _maxLength ; assertArgument(length <= 255, "DNS encoded label cannot exceed 255", "length", length); return hexlify(concat(ensNameSplit(name).map(comp => { assertArgument(comp.length <= length, `label ${JSON.stringify(name)} exceeds ${length} bytes`, "name", name); const bytes = new Uint8Array(comp.length + 1); bytes.set(comp, 1); bytes[0] = bytes.length - 1; return bytes; }))) + "00"; } function accessSetify(addr, storageKeys) { return { address: getAddress(addr), storageKeys: storageKeys.map((storageKey, index) => { assertArgument(isHexString(storageKey, 32), "invalid slot", `storageKeys[${index}]`, storageKey); return storageKey.toLowerCase(); }) }; } /** * Returns a [[AccessList]] from any ethers-supported access-list structure. */ function accessListify(value) { if (Array.isArray(value)) { return value.map((set, index) => { if (Array.isArray(set)) { assertArgument(set.length === 2, "invalid slot set", `value[${index}]`, set); return accessSetify(set[0], set[1]); } assertArgument(set != null && typeof set === "object", "invalid address-slot set", "value", value); return accessSetify(set.address, set.storageKeys); }); } assertArgument(value != null && typeof value === "object", "invalid access list", "value", value); const result = Object.keys(value).map(addr => { const storageKeys = value[addr].reduce((accum, storageKey) => { accum[storageKey] = true; return accum; }, {}); return accessSetify(addr, Object.keys(storageKeys).sort()); }); result.sort((a, b) => a.address.localeCompare(b.address)); return result; } /** * Returns the address for the %%key%%. * * The key may be any standard form of public key or a private key. */ function computeAddress(key) { let pubkey; if (typeof key === "string") { pubkey = SigningKey.computePublicKey(key, false); } else { pubkey = key.publicKey; } return getAddress(keccak256("0x" + pubkey.substring(4)).substring(26)); } /** * Returns the recovered address for the private key that was * used to sign %%digest%% that resulted in %%signature%%. */ function recoverAddress(digest, signature) { return computeAddress(SigningKey.recoverPublicKey(digest, signature)); } const BN_0$4 = BigInt(0); const BN_2$1 = BigInt(2); const BN_27 = BigInt(27); const BN_28 = BigInt(28); const BN_35 = BigInt(35); const BN_MAX_UINT = BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); const BLOB_SIZE = 4096 * 32; function getVersionedHash(version, hash) { let versioned = version.toString(16); while (versioned.length < 2) { versioned = "0" + versioned; } versioned += sha256(hash).substring(4); return "0x" + versioned; } function handleAddress(value) { if (value === "0x") { return null; } return getAddress(value); } function handleAccessList(value, param) { try { return accessListify(value); } catch (error) { assertArgument(false, error.message, param, value); } } function handleNumber(_value, param) { if (_value === "0x") { return 0; } return getNumber(_value, param); } function handleUint(_value, param) { if (_value === "0x") { return BN_0$4; } const value = getBigInt(_value, param); assertArgument(value <= BN_MAX_UINT, "value exceeds uint size", param, value); return value; } function formatNumber(_value, name) { const value = getBigInt(_value, "value"); const result = toBeArray(value); assertArgument(result.length <= 32, `value too large`, `tx.${name}`, value); return result; } function formatAccessList(value) { return accessListify(value).map(set => [set.address, set.storageKeys]); } function formatHashes(value, param) { assertArgument(Array.isArray(value), `invalid ${param}`, "value", value); for (let i = 0; i < value.length; i++) { assertArgument(isHexString(value[i], 32), "invalid ${ param } hash", `value[${i}]`, value[i]); } return value; } function _parseLegacy(data) { const fields = decodeRlp(data); assertArgument(Array.isArray(fields) && (fields.length === 9 || fields.length === 6), "invalid field count for legacy transaction", "data", data); const tx = { type: 0, nonce: handleNumber(fields[0], "nonce"), gasPrice: handleUint(fields[1], "gasPrice"), gasLimit: handleUint(fields[2], "gasLimit"), to: handleAddress(fields[3]), value: handleUint(fields[4], "value"), data: hexlify(fields[5]), chainId: BN_0$4 }; // Legacy unsigned transaction if (fields.length === 6) { return tx; } const v = handleUint(fields[6], "v"); const r = handleUint(fields[7], "r"); const s = handleUint(fields[8], "s"); if (r === BN_0$4 && s === BN_0$4) { // EIP-155 unsigned transaction tx.chainId = v; } else { // Compute the EIP-155 chain ID (or 0 for legacy) let chainId = (v - BN_35) / BN_2$1; if (chainId < BN_0$4) { chainId = BN_0$4; } tx.chainId = chainId; // Signed Legacy Transaction assertArgument(chainId !== BN_0$4 || v === BN_27 || v === BN_28, "non-canonical legacy v", "v", fields[6]); tx.signature = Signature.from({ r: zeroPadValue(fields[7], 32), s: zeroPadValue(fields[8], 32), v }); //tx.hash = keccak256(data); } return tx; } function _serializeLegacy(tx, sig) { const fields = [formatNumber(tx.nonce, "nonce"), formatNumber(tx.gasPrice || 0, "gasPrice"), formatNumber(tx.gasLimit, "gasLimit"), tx.to || "0x", formatNumber(tx.value, "value"), tx.data]; let chainId = BN_0$4; if (tx.chainId != BN_0$4) { // A chainId was provided; if non-zero we'll use EIP-155 chainId = getBigInt(tx.chainId, "tx.chainId"); // We have a chainId in the tx and an EIP-155 v in the signature, // make sure they agree with each other assertArgument(!sig || sig.networkV == null || sig.legacyChainId === chainId, "tx.chainId/sig.v mismatch", "sig", sig); } else if (tx.signature) { // No explicit chainId, but EIP-155 have a derived implicit chainId const legacy = tx.signature.legacyChainId; if (legacy != null) { chainId = legacy; } } // Requesting an unsigned transaction if (!sig) { // We have an EIP-155 transaction (chainId was specified and non-zero) if (chainId !== BN_0$4) { fields.push(toBeArray(chainId)); fields.push("0x"); fields.push("0x"); } return encodeRlp(fields); } // @TODO: We should probably check that tx.signature, chainId, and sig // match but that logic could break existing code, so schedule // this for the next major bump. // Compute the EIP-155 v let v = BigInt(27 + sig.yParity); if (chainId !== BN_0$4) { v = Signature.getChainIdV(chainId, sig.v); } else if (BigInt(sig.v) !== v) { assertArgument(false, "tx.chainId/sig.v mismatch", "sig", sig); } // Add the signature fields.push(toBeArray(v)); fields.push(toBeArray(sig.r)); fields.push(toBeArray(sig.s)); return encodeRlp(fields); } function _parseEipSignature(tx, fields) { let yParity; try { yParity = handleNumber(fields[0], "yParity"); if (yParity !== 0 && yParity !== 1) { throw new Error("bad yParity"); } } catch (error) { assertArgument(false, "invalid yParity", "yParity", fields[0]); } const r = zeroPadValue(fields[1], 32); const s = zeroPadValue(fields[2], 32); const signature = Signature.from({ r, s, yParity }); tx.signature = signature; } function _parseEip1559(data) { const fields = decodeRlp(getBytes(data).slice(1)); assertArgument(Array.isArray(fields) && (fields.length === 9 || fields.length === 12), "invalid field count for transaction type: 2", "data", hexlify(data)); const tx = { type: 2, chainId: handleUint(fields[0], "chainId"), nonce: handleNumber(fields[1], "nonce"), maxPriorityFeePerGas: handleUint(fields[2], "maxPriorityFeePerGas"), maxFeePerGas: handleUint(fields[3], "maxFeePerGas"), gasPrice: null, gasLimit: handleUint(fields[4], "gasLimit"), to: handleAddress(fields[5]), value: handleUint(fields[6], "value"), data: hexlify(fields[7]), accessList: handleAccessList(fields[8], "accessList") }; // Unsigned EIP-1559 Transaction if (fields.length === 9) { return tx; } //tx.hash = keccak256(data); _parseEipSignature(tx, fields.slice(9)); return tx; } function _serializeEip1559(tx, sig) { const fields = [formatNumber(tx.chainId, "chainId"), formatNumber(tx.nonce, "nonce"), formatNumber(tx.maxPriorityFeePerGas || 0, "maxPriorityFeePerGas"), formatNumber(tx.maxFeePerGas || 0, "maxFeePerGas"), formatNumber(tx.gasLimit, "gasLimit"), tx.to || "0x", formatNumber(tx.value, "value"), tx.data, formatAccessList(tx.accessList || [])]; if (sig) { fields.push(formatNumber(sig.yParity, "yParity")); fields.push(toBeArray(sig.r)); fields.push(toBeArray(sig.s)); } return concat(["0x02", encodeRlp(fields)]); } function _parseEip2930(data) { const fields = decodeRlp(getBytes(data).slice(1)); assertArgument(Array.isArray(fields) && (fields.length === 8 || fields.length === 11), "invalid field count for transaction type: 1", "data", hexlify(data)); const tx = { type: 1, chainId: handleUint(fields[0], "chainId"), nonce: handleNumber(fields[1], "nonce"), gasPrice: handleUint(fields[2], "gasPrice"), gasLimit: handleUint(fields[3], "gasLimit"), to: handleAddress(fields[4]), value: handleUint(fields[5], "value"), data: hexlify(fields[6]), accessList: handleAccessList(fields[7], "accessList") }; // Unsigned EIP-2930 Transaction if (fields.length === 8) { return tx; } //tx.hash = keccak256(data); _parseEipSignature(tx, fields.slice(8)); return tx; } function _serializeEip2930(tx, sig) { const fields = [formatNumber(tx.chainId, "chainId"), formatNumber(tx.nonce, "nonce"), formatNumber(tx.gasPrice || 0, "gasPrice"), formatNumber(tx.gasLimit, "gasLimit"), tx.to || "0x", formatNumber(tx.value, "value"), tx.data, formatAccessList(tx.accessList || [])]; if (sig) { fields.push(formatNumber(sig.yParity, "recoveryParam")); fields.push(toBeArray(sig.r)); fields.push(toBeArray(sig.s)); } return concat(["0x01", encodeRlp(fields)]); } function _parseEip4844(data) { let fields = decodeRlp(getBytes(data).slice(1)); let typeName = "3"; let blobs = null; // Parse the network format if (fields.length === 4 && Array.isArray(fields[0])) { typeName = "3 (network format)"; const fBlobs = fields[1], fCommits = fields[2], fProofs = fields[3]; assertArgument(Array.isArray(fBlobs), "invalid network format: blobs not an array", "fields[1]", fBlobs); assertArgument(Array.isArray(fCommits), "invalid network format: commitments not an array", "fields[2]", fCommits); assertArgument(Array.isArray(fProofs), "invalid network format: proofs not an array", "fields[3]", fProofs); assertArgument(fBlobs.length === fCommits.length, "invalid network format: blobs/commitments length mismatch", "fields", fields); assertArgument(fBlobs.length === fProofs.length, "invalid network format: blobs/proofs length mismatch", "fields", fields); blobs = []; for (let i = 0; i < fields[1].length; i++) { blobs.push({ data: fBlobs[i], commitment: fCommits[i], proof: fProofs[i] }); } fields = fields[0]; } assertArgument(Array.isArray(fields) && (fields.length === 11 || fields.length === 14), `invalid field count for transaction type: ${typeName}`, "data", hexlify(data)); const tx = { type: 3, chainId: handleUint(fields[0], "chainId"), nonce: handleNumber(fields[1], "nonce"), maxPriorityFeePerGas: handleUint(fields[2], "maxPriorityFeePerGas"), maxFeePerGas: handleUint(fields[3], "maxFeePerGas"), gasPrice: null, gasLimit: handleUint(fields[4], "gasLimit"), to: handleAddress(fields[5]), value: handleUint(fields[6], "value"), data: hexlify(fields[7]), accessList: handleAccessList(fields[8], "accessList"), maxFeePerBlobGas: handleUint(fields[9], "maxFeePerBlobGas"), blobVersionedHashes: fields[10] }; if (blobs) { tx.blobs = blobs; } assertArgument(tx.to != null, `invalid address for transaction type: ${typeName}`, "data", data); assertArgument(Array.isArray(tx.blobVersionedHashes), "invalid blobVersionedHashes: must be an array", "data", data); for (let i = 0; i < tx.blobVersionedHashes.length; i++) { assertArgument(isHexString(tx.blobVersionedHashes[i], 32), `invalid blobVersionedHash at index ${i}: must be length 32`, "data", data); } // Unsigned EIP-4844 Transaction if (fields.length === 11) { return tx; } // @TODO: Do we need to do this? This is only called internally // and used to verify hashes; it might save time to not do this //tx.hash = keccak256(concat([ "0x03", encodeRlp(fields) ])); _parseEipSignature(tx, fields.slice(11)); return tx; } function _serializeEip4844(tx, sig, blobs) { const fields = [formatNumber(tx.chainId, "chainId"), formatNumber(tx.nonce, "nonce"), formatNumber(tx.maxPriorityFeePerGas || 0, "maxPriorityFeePerGas"), formatNumber(tx.maxFeePerGas || 0, "maxFeePerGas"), formatNumber(tx.gasLimit, "gasLimit"), tx.to || ZeroAddress, formatNumber(tx.value, "value"), tx.data, formatAccessList(tx.accessList || []), formatNumber(tx.maxFeePerBlobGas || 0, "maxFeePerBlobGas"), formatHashes(tx.blobVersionedHashes || [], "blobVersionedHashes")]; if (sig) { fields.push(formatNumber(sig.yParity, "yParity")); fields.push(toBeArray(sig.r)); fields.push(toBeArray(sig.s)); // We have blobs; return the network wrapped format if (blobs) { return concat(["0x03", encodeRlp([fields, blobs.map(b => b.data), blobs.map(b => b.commitment), blobs.map(b => b.proof)])]); } } return concat(["0x03", encodeRlp(fields)]); } /** * A **Transaction** describes an operation to be executed on * Ethereum by an Externally Owned Account (EOA). It includes * who (the [[to]] address), what (the [[data]]) and how much (the * [[value]] in ether) the operation should entail. * * @example: * tx = new Transaction() * //_result: * * tx.data = "0x1234"; * //_result: */ class Transaction { #type; #to; #data; #nonce; #gasLimit; #gasPrice; #maxPriorityFeePerGas; #maxFeePerGas; #value; #chainId; #sig; #accessList; #maxFeePerBlobGas; #blobVersionedHashes; #kzg; #blobs; /** * The transaction type. * * If null, the type will be automatically inferred based on * explicit properties. */ get type() { return this.#type; } set type(value) { switch (value) { case null: this.#type = null; break; case 0: case "legacy": this.#type = 0; break; case 1: case "berlin": case "eip-2930": this.#type = 1; break; case 2: case "london": case "eip-1559": this.#type = 2; break; case 3: case "cancun": case "eip-4844": this.#type = 3; break; default: assertArgument(false, "unsupported transaction type", "type", value); } } /** * The name of the transaction type. */ get typeName() { switch (this.type) { case 0: return "legacy"; case 1: return "eip-2930"; case 2: return "eip-1559"; case 3: return "eip-4844"; } return null; } /** * The ``to`` address for the transaction or ``null`` if the * transaction is an ``init`` transaction. */ get to() { const value = this.#to; if (value == null && this.type === 3) { return ZeroAddress; } return value; } set to(value) { this.#to = value == null ? null : getAddress(value); } /** * The transaction nonce. */ get nonce() { return this.#nonce; } set nonce(value) { this.#nonce = getNumber(value, "value"); } /** * The gas limit. */ get gasLimit() { return this.#gasLimit; } set gasLimit(value) { this.#gasLimit = getBigInt(value); } /** * The gas price. * * On legacy networks this defines the fee that will be paid. On * EIP-1559 networks, this should be ``null``. */ get gasPrice() { const value = this.#gasPrice; if (value == null && (this.type === 0 || this.type === 1)) { return BN_0$4; } return value; } set gasPrice(value) { this.#gasPrice = value == null ? null : getBigInt(value, "gasPrice"); } /** * The maximum priority fee per unit of gas to pay. On legacy * networks this should be ``null``. */ get maxPriorityFeePerGas() { const value = this.#maxPriorityFeePerGas; if (value == null) { if (this.type === 2 || this.type === 3) { return BN_0$4; } return null; } return value; } set maxPriorityFeePerGas(value) { this.#maxPriorityFeePerGas = value == null ? null : getBigInt(value, "maxPriorityFeePerGas"); } /** * The maximum total fee per unit of gas to pay. On legacy * networks this should be ``null``. */ get maxFeePerGas() { const value = this.#maxFeePerGas; if (value == null) { if (this.type === 2 || this.type === 3) { return BN_0$4; } return null; } return value; } set maxFeePerGas(value) { this.#maxFeePerGas = value == null ? null : getBigInt(value, "maxFeePerGas"); } /** * The transaction data. For ``init`` transactions this is the * deployment code. */ get data() { return this.#data; } set data(value) { this.#data = hexlify(value); } /** * The amount of ether (in wei) to send in this transactions. */ get value() { return this.#value; } set value(value) { this.#value = getBigInt(value, "value"); } /** * The chain ID this transaction is valid on. */ get chainId() { return this.#chainId; } set chainId(value) { this.#chainId = getBigInt(value); } /** * If signed, the signature for this transaction. */ get signature() { return this.#sig || null; } set signature(value) { this.#sig = value == null ? null : Signature.from(value); } /** * The access list. * * An access list permits discounted (but pre-paid) access to * bytecode and state variable access within contract execution. */ get accessList() { const value = this.#accessList || null; if (value == null) { if (this.type === 1 || this.type === 2 || this.type === 3) { // @TODO: in v7, this should assign the value or become // a live object itself, otherwise mutation is inconsistent return []; } return null; } return value; } set accessList(value) { this.#accessList = value == null ? null : accessListify(value); } /** * The max fee per blob gas for Cancun transactions. */ get maxFeePerBlobGas() { const value = this.#maxFeePerBlobGas; if (value == null && this.type === 3) { return BN_0$4; } return value; } set maxFeePerBlobGas(value) { this.#maxFeePerBlobGas = value == null ? null : getBigInt(value, "maxFeePerBlobGas"); } /** * The BLOb versioned hashes for Cancun transactions. */ get blobVersionedHashes() { // @TODO: Mutation is inconsistent; if unset, the returned value // cannot mutate the object, if set it can let value = this.#blobVersionedHashes; if (value == null && this.type === 3) { return []; } return value; } set blobVersionedHashes(value) { if (value != null) { assertArgument(Array.isArray(value), "blobVersionedHashes must be an Array", "value", value); value = value.slice(); for (let i = 0; i < value.length; i++) { assertArgument(isHexString(value[i], 32), "invalid blobVersionedHash", `value[${i}]`, value[i]); } } this.#blobVersionedHashes = value; } /** * The BLObs for the Transaction, if any. * * If ``blobs`` is non-``null``, then the [[seriailized]] * will return the network formatted sidecar, otherwise it * will return the standard [[link-eip-2718]] payload. The * [[unsignedSerialized]] is unaffected regardless. * * When setting ``blobs``, either fully valid [[Blob]] objects * may be specified (i.e. correctly padded, with correct * committments and proofs) or a raw [[BytesLike]] may * be provided. * * If raw [[BytesLike]] are provided, the [[kzg]] property **must** * be already set. The blob will be correctly padded and the * [[KzgLibrary]] will be used to compute the committment and * proof for the blob. * * A BLOb is a sequence of field elements, each of which must * be within the BLS field modulo, so some additional processing * may be required to encode arbitrary data to ensure each 32 byte * field is within the valid range. * * Setting this automatically populates [[blobVersionedHashes]], * overwriting any existing values. Setting this to ``null`` * does **not** remove the [[blobVersionedHashes]], leaving them * present. */ get blobs() { if (this.#blobs == null) { return null; } return this.#blobs.map(b => Object.assign({}, b)); } set blobs(_blobs) { if (_blobs == null) { this.#blobs = null; return; } const blobs = []; const versionedHashes = []; for (let i = 0; i < _blobs.length; i++) { const blob = _blobs[i]; if (isBytesLike(blob)) { assert(this.#kzg, "adding a raw blob requires a KZG library", "UNSUPPORTED_OPERATION", { operation: "set blobs()" }); let data = getBytes(blob); assertArgument(data.length <= BLOB_SIZE, "blob is too large", `blobs[${i}]`, blob); // Pad blob if necessary if (data.length !== BLOB_SIZE) { const padded = new Uint8Array(BLOB_SIZE); padded.set(data); data = padded; } const commit = this.#kzg.blobToKzgCommitment(data); const proof = hexlify(this.#kzg.computeBlobKzgProof(data, commit)); blobs.push({ data: hexlify(data), commitment: hexlify(commit), proof }); versionedHashes.push(getVersionedHash(1, commit)); } else { const commit = hexlify(blob.commitment); blobs.push({ data: hexlify(blob.data), commitment: commit, proof: hexlify(blob.proof) }); versionedHashes.push(getVersionedHash(1, commit)); } } this.#blobs = blobs; this.#blobVersionedHashes = versionedHashes; } get kzg() { return this.#kzg; } set kzg(kzg) { this.#kzg = kzg; } /** * Creates a new Transaction with default values. */ constructor() { this.#type = null; this.#to = null; this.#nonce = 0; this.#gasLimit = BN_0$4; this.#gasPrice = null; this.#maxPriorityFeePerGas = null; this.#maxFeePerGas = null; this.#data = "0x"; this.#value = BN_0$4; this.#chainId = BN_0$4; this.#sig = null; this.#accessList = null; this.#maxFeePerBlobGas = null; this.#blobVersionedHashes = null; this.#blobs = null; this.#kzg = null; } /** * The transaction hash, if signed. Otherwise, ``null``. */ get hash() { if (this.signature == null) { return null; } return keccak256(this.#getSerialized(true, false)); } /** * The pre-image hash of this transaction. * * This is the digest that a [[Signer]] must sign to authorize * this transaction. */ get unsignedHash() { return keccak256(this.unsignedSerialized); } /** * The sending address, if signed. Otherwise, ``null``. */ get from() { if (this.signature == null) { return null; } return recoverAddress(this.unsignedHash, this.signature); } /** * The public key of the sender, if signed. Otherwise, ``null``. */ get fromPublicKey() { if (this.signature == null) { return null; } return SigningKey.recoverPublicKey(this.unsignedHash, this.signature); } /** * Returns true if signed. * * This provides a Type Guard that properties requiring a signed * transaction are non-null. */ isSigned() { return this.signature != null; } #getSerialized(signed, sidecar) { assert(!signed || this.signature != null, "cannot serialize unsigned transaction; maybe you meant .unsignedSerialized", "UNSUPPORTED_OPERATION", { operation: ".serialized" }); const sig = signed ? this.signature : null; switch (this.inferType()) { case 0: return _serializeLegacy(this, sig); case 1: return _serializeEip2930(this, sig); case 2: return _serializeEip1559(this, sig); case 3: return _serializeEip4844(this, sig, sidecar ? this.blobs : null); } assert(false, "unsupported transaction type", "UNSUPPORTED_OPERATION", { operation: ".serialized" }); } /** * The serialized transaction. * * This throws if the transaction is unsigned. For the pre-image, * use [[unsignedSerialized]]. */ get serialized() { return this.#getSerialized(true, true); } /** * The transaction pre-image. * * The hash of this is the digest which needs to be signed to * authorize this transaction. */ get unsignedSerialized() { return this.#getSerialized(false, false); } /** * Return the most "likely" type; currently the highest * supported transaction type. */ inferType() { const types = this.inferTypes(); // Prefer London (EIP-1559) over Cancun (BLOb) if (types.indexOf(2) >= 0) { return 2; } // Return the highest inferred type return types.pop(); } /** * Validates the explicit properties and returns a list of compatible * transaction types. */ inferTypes() { // Checks that there are no conflicting properties set const hasGasPrice = this.gasPrice != null; const hasFee = this.maxFeePerGas != null || this.maxPriorityFeePerGas != null; const hasAccessList = this.accessList != null; const hasBlob = this.#maxFeePerBlobGas != null || this.#blobVersionedHashes; //if (hasGasPrice && hasFee) { // throw new Error("transaction cannot have gasPrice and maxFeePerGas"); //} if (this.maxFeePerGas != null && this.maxPriorityFeePerGas != null) { assert(this.maxFeePerGas >= this.maxPriorityFeePerGas, "priorityFee cannot be more than maxFee", "BAD_DATA", { value: this }); } //if (this.type === 2 && hasGasPrice) { // throw new Error("eip-1559 transaction cannot have gasPrice"); //} assert(!hasFee || this.type !== 0 && this.type !== 1, "transaction type cannot have maxFeePerGas or maxPriorityFeePerGas", "BAD_DATA", { value: this }); assert(this.type !== 0 || !hasAccessList, "legacy transaction cannot have accessList", "BAD_DATA", { value: this }); const types = []; // Explicit type if (this.type != null) { types.push(this.type); } else { if (hasFee) { types.push(2); } else if (hasGasPrice) { types.push(1); if (!hasAccessList) { types.push(0); } } else if (hasAccessList) { types.push(1); types.push(2); } else if (hasBlob && this.to) { types.push(3); } else { types.push(0); types.push(1); types.push(2); types.push(3); } } types.sort(); return types; } /** * Returns true if this transaction is a legacy transaction (i.e. * ``type === 0``). * * This provides a Type Guard that the related properties are * non-null. */ isLegacy() { return this.type === 0; } /** * Returns true if this transaction is berlin hardform transaction (i.e. * ``type === 1``). * * This provides a Type Guard that the related properties are * non-null. */ isBerlin() { return this.type === 1; } /** * Returns true if this transaction is london hardform transaction (i.e. * ``type === 2``). * * This provides a Type Guard that the related properties are * non-null. */ isLondon() { return this.type === 2; } /** * Returns true if this transaction is an [[link-eip-4844]] BLOB * transaction. * * This provides a Type Guard that the related properties are * non-null. */ isCancun() { return this.type === 3; } /** * Create a copy of this transaciton. */ clone() { return Transaction.from(this); } /** * Return a JSON-friendly object. */ toJSON() { const s = v => { if (v == null) { return null; } return v.toString(); }; return { type: this.type, to: this.to, // from: this.from, data: this.data, nonce: this.nonce, gasLimit: s(this.gasLimit), gasPrice: s(this.gasPrice), maxPriorityFeePerGas: s(this.maxPriorityFeePerGas), maxFeePerGas: s(this.maxFeePerGas), value: s(this.value), chainId: s(this.chainId), sig: this.signature ? this.signature.toJSON() : null, accessList: this.accessList }; } /** * Create a **Transaction** from a serialized transaction or a * Transaction-like object. */ static from(tx) { if (tx == null) { return new Transaction(); } if (typeof tx === "string") { const payload = getBytes(tx); if (payload[0] >= 0x7f) { // @TODO: > vs >= ?? return Transaction.from(_parseLegacy(payload)); } switch (payload[0]) { case 1: return Transaction.from(_parseEip2930(payload)); case 2: return Transaction.from(_parseEip1559(payload)); case 3: return Transaction.from(_parseEip4844(payload)); } assert(false, "unsupported transaction type", "UNSUPPORTED_OPERATION", { operation: "from" }); } const result = new Transaction(); if (tx.type != null) { result.type = tx.type; } if (tx.to != null) { result.to = tx.to; } if (tx.nonce != null) { result.nonce = tx.nonce; } if (tx.gasLimit != null) { result.gasLimit = tx.gasLimit; } if (tx.gasPrice != null) { result.gasPrice = tx.gasPrice; } if (tx.maxPriorityFeePerGas != null) { result.maxPriorityFeePerGas = tx.maxPriorityFeePerGas; } if (tx.maxFeePerGas != null) { result.maxFeePerGas = tx.maxFeePerGas; } if (tx.maxFeePerBlobGas != null) { result.maxFeePerBlobGas = tx.maxFeePerBlobGas; } if (tx.data != null) { result.data = tx.data; } if (tx.value != null) { result.value = tx.value; } if (tx.chainId != null) { result.chainId = tx.chainId; } if (tx.signature != null) { result.signature = Signature.from(tx.signature); } if (tx.accessList != null) { result.accessList = tx.accessList; } // This will get overwritten by blobs, if present if (tx.blobVersionedHashes != null) { result.blobVersionedHashes = tx.blobVersionedHashes; } // Make sure we assign the kzg before assigning blobs, which // require the library in the event raw blob data is provided. if (tx.kzg != null) { result.kzg = tx.kzg; } if (tx.blobs != null) { result.blobs = tx.blobs; } if (tx.hash != null) { assertArgument(result.isSigned(), "unsigned transaction cannot define '.hash'", "tx", tx); assertArgument(result.hash === tx.hash, "hash mismatch", "tx", tx); } if (tx.from != null) { assertArgument(result.isSigned(), "unsigned transaction cannot define '.from'", "tx", tx); assertArgument(result.from.toLowerCase() === (tx.from || "").toLowerCase(), "from mismatch", "tx", tx); } return result; } } /** * Computes the [[link-eip-191]] personal-sign message digest to sign. * * This prefixes the message with [[MessagePrefix]] and the decimal length * of %%message%% and computes the [[keccak256]] digest. * * If %%message%% is a string, it is converted to its UTF-8 bytes * first. To compute the digest of a [[DataHexString]], it must be converted * to [bytes](getBytes). * * @example: * hashMessage("Hello World") * //_result: * * // Hashes the SIX (6) string characters, i.e. * // [ "0", "x", "4", "2", "4", "3" ] * hashMessage("0x4243") * //_result: * * // Hashes the TWO (2) bytes [ 0x42, 0x43 ]... * hashMessage(getBytes("0x4243")) * //_result: * * // ...which is equal to using data * hashMessage(new Uint8Array([ 0x42, 0x43 ])) * //_result: * */ function hashMessage(message) { if (typeof message === "string") { message = toUtf8Bytes(message); } return keccak256(concat([toUtf8Bytes(MessagePrefix), toUtf8Bytes(String(message.length)), message])); } //import { TypedDataDomain, TypedDataField } from "@ethersproject/providerabstract-signer"; const padding = new Uint8Array(32); padding.fill(0); const BN__1 = BigInt(-1); const BN_0$3 = BigInt(0); const BN_1 = BigInt(1); const BN_MAX_UINT256 = BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); function hexPadRight(value) { const bytes = getBytes(value); const padOffset = bytes.length % 32; if (padOffset) { return concat([bytes, padding.slice(padOffset)]); } return hexlify(bytes); } const hexTrue = toBeHex(BN_1, 32); const hexFalse = toBeHex(BN_0$3, 32); const domainFieldTypes = { name: "string", version: "string", chainId: "uint256", verifyingContract: "address", salt: "bytes32" }; const domainFieldNames = ["name", "version", "chainId", "verifyingContract", "salt"]; function checkString(key) { return function (value) { assertArgument(typeof value === "string", `invalid domain value for ${JSON.stringify(key)}`, `domain.${key}`, value); return value; }; } const domainChecks = { name: checkString("name"), version: checkString("version"), chainId: function (_value) { const value = getBigInt(_value, "domain.chainId"); assertArgument(value >= 0, "invalid chain ID", "domain.chainId", _value); if (Number.isSafeInteger(value)) { return Number(value); } return toQuantity(value); }, verifyingContract: function (value) { try { return getAddress(value).toLowerCase(); } catch (error) {} assertArgument(false, `invalid domain value "verifyingContract"`, "domain.verifyingContract", value); }, salt: function (value) { const bytes = getBytes(value, "domain.salt"); assertArgument(bytes.length === 32, `invalid domain value "salt"`, "domain.salt", value); return hexlify(bytes); } }; function getBaseEncoder(type) { // intXX and uintXX { const match = type.match(/^(u?)int(\d+)$/); if (match) { const signed = match[1] === ""; const width = parseInt(match[2]); assertArgument(width % 8 === 0 && width !== 0 && width <= 256 && match[2] === String(width), "invalid numeric width", "type", type); const boundsUpper = mask(BN_MAX_UINT256, signed ? width - 1 : width); const boundsLower = signed ? (boundsUpper + BN_1) * BN__1 : BN_0$3; return function (_value) { const value = getBigInt(_value, "value"); assertArgument(value >= boundsLower && value <= boundsUpper, `value out-of-bounds for ${type}`, "value", value); return toBeHex(signed ? toTwos(value, 256) : value, 32); }; } } // bytesXX { const match = type.match(/^bytes(\d+)$/); if (match) { const width = parseInt(match[1]); assertArgument(width !== 0 && width <= 32 && match[1] === String(width), "invalid bytes width", "type", type); return function (value) { const bytes = getBytes(value); assertArgument(bytes.length === width, `invalid length for ${type}`, "value", value); return hexPadRight(value); }; } } switch (type) { case "address": return function (value) { return zeroPadValue(getAddress(value), 32); }; case "bool": return function (value) { return !value ? hexFalse : hexTrue; }; case "bytes": return function (value) { return keccak256(value); }; case "string": return function (value) { return id(value); }; } return null; } function encodeType(name, fields) { return `${name}(${fields.map(({ name, type }) => type + " " + name).join(",")})`; } // foo[][3] => { base: "foo", index: "[][3]", array: { // base: "foo", prefix: "foo[]", count: 3 } } function splitArray(type) { const match = type.match(/^([^\x5b]*)((\x5b\d*\x5d)*)(\x5b(\d*)\x5d)$/); if (match) { return { base: match[1], index: match[2] + match[4], array: { base: match[1], prefix: match[1] + match[2], count: match[5] ? parseInt(match[5]) : -1 } }; } return { base: type }; } /** * A **TypedDataEncode** prepares and encodes [[link-eip-712]] payloads * for signed typed data. * * This is useful for those that wish to compute various components of a * typed data hash, primary types, or sub-components, but generally the * higher level [[Signer-signTypedData]] is more useful. */ class TypedDataEncoder { /** * The primary type for the structured [[types]]. * * This is derived automatically from the [[types]], since no * recursion is possible, once the DAG for the types is consturcted * internally, the primary type must be the only remaining type with * no parent nodes. */ primaryType; #types; /** * The types. */ get types() { return JSON.parse(this.#types); } #fullTypes; #encoderCache; /** * Create a new **TypedDataEncoder** for %%types%%. * * This performs all necessary checking that types are valid and * do not violate the [[link-eip-712]] structural constraints as * well as computes the [[primaryType]]. */ constructor(_types) { this.#fullTypes = new Map(); this.#encoderCache = new Map(); // Link struct types to their direct child structs const links = new Map(); // Link structs to structs which contain them as a child const parents = new Map(); // Link all subtypes within a given struct const subtypes = new Map(); const types = {}; Object.keys(_types).forEach(type => { types[type] = _types[type].map(({ name, type }) => { // Normalize the base type (unless name conflict) let { base, index } = splitArray(type); if (base === "int" && !_types["int"]) { base = "int256"; } if (base === "uint" && !_types["uint"]) { base = "uint256"; } return { name, type: base + (index || "") }; }); links.set(type, new Set()); parents.set(type, []); subtypes.set(type, new Set()); }); this.#types = JSON.stringify(types); for (const name in types) { const uniqueNames = new Set(); for (const field of types[name]) { // Check each field has a unique name assertArgument(!uniqueNames.has(field.name), `duplicate variable name ${JSON.stringify(field.name)} in ${JSON.stringify(name)}`, "types", _types); uniqueNames.add(field.name); // Get the base type (drop any array specifiers) const baseType = splitArray(field.type).base; assertArgument(baseType !== name, `circular type reference to ${JSON.stringify(baseType)}`, "types", _types); // Is this a base encoding type? const encoder = getBaseEncoder(baseType); if (encoder) { continue; } assertArgument(parents.has(baseType), `unknown type ${JSON.stringify(baseType)}`, "types", _types); // Add linkage parents.get(baseType).push(name); links.get(name).add(baseType); } } // Deduce the primary type const primaryTypes = Array.from(parents.keys()).filter(n => parents.get(n).length === 0); assertArgument(primaryTypes.length !== 0, "missing primary type", "types", _types); assertArgument(primaryTypes.length === 1, `ambiguous primary types or unused types: ${primaryTypes.map(t => JSON.stringify(t)).join(", ")}`, "types", _types); defineProperties(this, { primaryType: primaryTypes[0] }); // Check for circular type references function checkCircular(type, found) { assertArgument(!found.has(type), `circular type reference to ${JSON.stringify(type)}`, "types", _types); found.add(type); for (const child of links.get(type)) { if (!parents.has(child)) { continue; } // Recursively check children checkCircular(child, found); // Mark all ancestors as having this decendant for (const subtype of found) { subtypes.get(subtype).add(child); } } found.delete(type); } checkCircular(this.primaryType, new Set()); // Compute each fully describe type for (const [name, set] of subtypes) { const st = Array.from(set); st.sort(); this.#fullTypes.set(name, encodeType(name, types[name]) + st.map(t => encodeType(t, types[t])).join("")); } } /** * Returnthe encoder for the specific %%type%%. */ getEncoder(type) { let encoder = this.#encoderCache.get(type); if (!encoder) { encoder = this.#getEncoder(type); this.#encoderCache.set(type, encoder); } return encoder; } #getEncoder(type) { // Basic encoder type (address, bool, uint256, etc) { const encoder = getBaseEncoder(type); if (encoder) { return encoder; } } // Array const array = splitArray(type).array; if (array) { const subtype = array.prefix; const subEncoder = this.getEncoder(subtype); return value => { assertArgument(array.count === -1 || array.count === value.length, `array length mismatch; expected length ${array.count}`, "value", value); let result = value.map(subEncoder); if (this.#fullTypes.has(subtype)) { result = result.map(keccak256); } return keccak256(concat(result)); }; } // Struct const fields = this.types[type]; if (fields) { const encodedType = id(this.#fullTypes.get(type)); return value => { const values = fields.map(({ name, type }) => { const result = this.getEncoder(type)(value[name]); if (this.#fullTypes.has(type)) { return keccak256(result); } return result; }); values.unshift(encodedType); return concat(values); }; } assertArgument(false, `unknown type: ${type}`, "type", type); } /** * Return the full type for %%name%%. */ encodeType(name) { const result = this.#fullTypes.get(name); assertArgument(result, `unknown type: ${JSON.stringify(name)}`, "name", name); return result; } /** * Return the encoded %%value%% for the %%type%%. */ encodeData(type, value) { return this.getEncoder(type)(value); } /** * Returns the hash of %%value%% for the type of %%name%%. */ hashStruct(name, value) { return keccak256(this.encodeData(name, value)); } /** * Return the fulled encoded %%value%% for the [[types]]. */ encode(value) { return this.encodeData(this.primaryType, value); } /** * Return the hash of the fully encoded %%value%% for the [[types]]. */ hash(value) { return this.hashStruct(this.primaryType, value); } /** * @_ignore: */ _visit(type, value, callback) { // Basic encoder type (address, bool, uint256, etc) { const encoder = getBaseEncoder(type); if (encoder) { return callback(type, value); } } // Array const array = splitArray(type).array; if (array) { assertArgument(array.count === -1 || array.count === value.length, `array length mismatch; expected length ${array.count}`, "value", value); return value.map(v => this._visit(array.prefix, v, callback)); } // Struct const fields = this.types[type]; if (fields) { return fields.reduce((accum, { name, type }) => { accum[name] = this._visit(type, value[name], callback); return accum; }, {}); } assertArgument(false, `unknown type: ${type}`, "type", type); } /** * Call %%calback%% for each value in %%value%%, passing the type and * component within %%value%%. * * This is useful for replacing addresses or other transformation that * may be desired on each component, based on its type. */ visit(value, callback) { return this._visit(this.primaryType, value, callback); } /** * Create a new **TypedDataEncoder** for %%types%%. */ static from(types) { return new TypedDataEncoder(types); } /** * Return the primary type for %%types%%. */ static getPrimaryType(types) { return TypedDataEncoder.from(types).primaryType; } /** * Return the hashed struct for %%value%% using %%types%% and %%name%%. */ static hashStruct(name, types, value) { return TypedDataEncoder.from(types).hashStruct(name, value); } /** * Return the domain hash for %%domain%%. */ static hashDomain(domain) { const domainFields = []; for (const name in domain) { if (domain[name] == null) { continue; } const type = domainFieldTypes[name]; assertArgument(type, `invalid typed-data domain key: ${JSON.stringify(name)}`, "domain", domain); domainFields.push({ name, type }); } domainFields.sort((a, b) => { return domainFieldNames.indexOf(a.name) - domainFieldNames.indexOf(b.name); }); return TypedDataEncoder.hashStruct("EIP712Domain", { EIP712Domain: domainFields }, domain); } /** * Return the fully encoded [[link-eip-712]] %%value%% for %%types%% with %%domain%%. */ static encode(domain, types, value) { return concat(["0x1901", TypedDataEncoder.hashDomain(domain), TypedDataEncoder.from(types).hash(value)]); } /** * Return the hash of the fully encoded [[link-eip-712]] %%value%% for %%types%% with %%domain%%. */ static hash(domain, types, value) { return keccak256(TypedDataEncoder.encode(domain, types, value)); } // Replaces all address types with ENS names with their looked up address /** * Resolves to the value from resolving all addresses in %%value%% for * %%types%% and the %%domain%%. */ static async resolveNames(domain, types, value, resolveName) { // Make a copy to isolate it from the object passed in domain = Object.assign({}, domain); // Allow passing null to ignore value for (const key in domain) { if (domain[key] == null) { delete domain[key]; } } // Look up all ENS names const ensCache = {}; // Do we need to look up the domain's verifyingContract? if (domain.verifyingContract && !isHexString(domain.verifyingContract, 20)) { ensCache[domain.verifyingContract] = "0x"; } // We are going to use the encoder to visit all the base values const encoder = TypedDataEncoder.from(types); // Get a list of all the addresses encoder.visit(value, (type, value) => { if (type === "address" && !isHexString(value, 20)) { ensCache[value] = "0x"; } return value; }); // Lookup each name for (const name in ensCache) { ensCache[name] = await resolveName(name); } // Replace the domain verifyingContract if needed if (domain.verifyingContract && ensCache[domain.verifyingContract]) { domain.verifyingContract = ensCache[domain.verifyingContract]; } // Replace all ENS names with their address value = encoder.visit(value, (type, value) => { if (type === "address" && ensCache[value]) { return ensCache[value]; } return value; }); return { domain, value }; } /** * Returns the JSON-encoded payload expected by nodes which implement * the JSON-RPC [[link-eip-712]] method. */ static getPayload(domain, types, value) { // Validate the domain fields TypedDataEncoder.hashDomain(domain); // Derive the EIP712Domain Struct reference type const domainValues = {}; const domainTypes = []; domainFieldNames.forEach(name => { const value = domain[name]; if (value == null) { return; } domainValues[name] = domainChecks[name](value); domainTypes.push({ name, type: domainFieldTypes[name] }); }); const encoder = TypedDataEncoder.from(types); // Get the normalized types types = encoder.types; const typesWithDomain = Object.assign({}, types); assertArgument(typesWithDomain.EIP712Domain == null, "types must not contain EIP712Domain type", "types.EIP712Domain", types); typesWithDomain.EIP712Domain = domainTypes; // Validate the data structures and types encoder.encode(value); return { types: typesWithDomain, domain: domainValues, primaryType: encoder.primaryType, message: encoder.visit(value, (type, value) => { // bytes if (type.match(/^bytes(\d*)/)) { return hexlify(getBytes(value)); } // uint or int if (type.match(/^u?int/)) { return getBigInt(value).toString(); } switch (type) { case "address": return value.toLowerCase(); case "bool": return !!value; case "string": assertArgument(typeof value === "string", "invalid string", "value", value); return value; } assertArgument(false, "unsupported type", "type", type); }) }; } } /** * A fragment is a single item from an ABI, which may represent any of: * * - [Functions](FunctionFragment) * - [Events](EventFragment) * - [Constructors](ConstructorFragment) * - Custom [Errors](ErrorFragment) * - [Fallback or Receive](FallbackFragment) functions * * @_subsection api/abi/abi-coder:Fragments [about-fragments] */ // [ "a", "b" ] => { "a": 1, "b": 1 } function setify(items) { const result = new Set(); items.forEach(k => result.add(k)); return Object.freeze(result); } const _kwVisibDeploy = "external public payable override"; const KwVisibDeploy = setify(_kwVisibDeploy.split(" ")); // Visibility Keywords const _kwVisib = "constant external internal payable private public pure view override"; const KwVisib = setify(_kwVisib.split(" ")); const _kwTypes = "constructor error event fallback function receive struct"; const KwTypes = setify(_kwTypes.split(" ")); const _kwModifiers = "calldata memory storage payable indexed"; const KwModifiers = setify(_kwModifiers.split(" ")); const _kwOther = "tuple returns"; // All Keywords const _keywords = [_kwTypes, _kwModifiers, _kwOther, _kwVisib].join(" "); const Keywords = setify(_keywords.split(" ")); // Single character tokens const SimpleTokens = { "(": "OPEN_PAREN", ")": "CLOSE_PAREN", "[": "OPEN_BRACKET", "]": "CLOSE_BRACKET", ",": "COMMA", "@": "AT" }; // Parser regexes to consume the next token const regexWhitespacePrefix = new RegExp("^(\\s*)"); const regexNumberPrefix = new RegExp("^([0-9]+)"); const regexIdPrefix = new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"); // Parser regexs to check validity const regexId = new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"); const regexType = new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$"); class TokenString { #offset; #tokens; get offset() { return this.#offset; } get length() { return this.#tokens.length - this.#offset; } constructor(tokens) { this.#offset = 0; this.#tokens = tokens.slice(); } clone() { return new TokenString(this.#tokens); } reset() { this.#offset = 0; } #subTokenString(from = 0, to = 0) { return new TokenString(this.#tokens.slice(from, to).map(t => { return Object.freeze(Object.assign({}, t, { match: t.match - from, linkBack: t.linkBack - from, linkNext: t.linkNext - from })); })); } // Pops and returns the value of the next token, if it is a keyword in allowed; throws if out of tokens popKeyword(allowed) { const top = this.peek(); if (top.type !== "KEYWORD" || !allowed.has(top.text)) { throw new Error(`expected keyword ${top.text}`); } return this.pop().text; } // Pops and returns the value of the next token if it is `type`; throws if out of tokens popType(type) { if (this.peek().type !== type) { const top = this.peek(); throw new Error(`expected ${type}; got ${top.type} ${JSON.stringify(top.text)}`); } return this.pop().text; } // Pops and returns a "(" TOKENS ")" popParen() { const top = this.peek(); if (top.type !== "OPEN_PAREN") { throw new Error("bad start"); } const result = this.#subTokenString(this.#offset + 1, top.match + 1); this.#offset = top.match + 1; return result; } // Pops and returns the items within "(" ITEM1 "," ITEM2 "," ... ")" popParams() { const top = this.peek(); if (top.type !== "OPEN_PAREN") { throw new Error("bad start"); } const result = []; while (this.#offset < top.match - 1) { const link = this.peek().linkNext; result.push(this.#subTokenString(this.#offset + 1, link)); this.#offset = link; } this.#offset = top.match + 1; return result; } // Returns the top Token, throwing if out of tokens peek() { if (this.#offset >= this.#tokens.length) { throw new Error("out-of-bounds"); } return this.#tokens[this.#offset]; } // Returns the next value, if it is a keyword in `allowed` peekKeyword(allowed) { const top = this.peekType("KEYWORD"); return top != null && allowed.has(top) ? top : null; } // Returns the value of the next token if it is `type` peekType(type) { if (this.length === 0) { return null; } const top = this.peek(); return top.type === type ? top.text : null; } // Returns the next token; throws if out of tokens pop() { const result = this.peek(); this.#offset++; return result; } toString() { const tokens = []; for (let i = this.#offset; i < this.#tokens.length; i++) { const token = this.#tokens[i]; tokens.push(`${token.type}:${token.text}`); } return ``; } } function lex(text) { const tokens = []; const throwError = message => { const token = offset < text.length ? JSON.stringify(text[offset]) : "$EOI"; throw new Error(`invalid token ${token} at ${offset}: ${message}`); }; let brackets = []; let commas = []; let offset = 0; while (offset < text.length) { // Strip off any leading whitespace let cur = text.substring(offset); let match = cur.match(regexWhitespacePrefix); if (match) { offset += match[1].length; cur = text.substring(offset); } const token = { depth: brackets.length, linkBack: -1, linkNext: -1, match: -1, type: "", text: "", offset, value: -1 }; tokens.push(token); let type = SimpleTokens[cur[0]] || ""; if (type) { token.type = type; token.text = cur[0]; offset++; if (type === "OPEN_PAREN") { brackets.push(tokens.length - 1); commas.push(tokens.length - 1); } else if (type == "CLOSE_PAREN") { if (brackets.length === 0) { throwError("no matching open bracket"); } token.match = brackets.pop(); tokens[token.match].match = tokens.length - 1; token.depth--; token.linkBack = commas.pop(); tokens[token.linkBack].linkNext = tokens.length - 1; } else if (type === "COMMA") { token.linkBack = commas.pop(); tokens[token.linkBack].linkNext = tokens.length - 1; commas.push(tokens.length - 1); } else if (type === "OPEN_BRACKET") { token.type = "BRACKET"; } else if (type === "CLOSE_BRACKET") { // Remove the CLOSE_BRACKET let suffix = tokens.pop().text; if (tokens.length > 0 && tokens[tokens.length - 1].type === "NUMBER") { const value = tokens.pop().text; suffix = value + suffix; tokens[tokens.length - 1].value = getNumber(value); } if (tokens.length === 0 || tokens[tokens.length - 1].type !== "BRACKET") { throw new Error("missing opening bracket"); } tokens[tokens.length - 1].text += suffix; } continue; } match = cur.match(regexIdPrefix); if (match) { token.text = match[1]; offset += token.text.length; if (Keywords.has(token.text)) { token.type = "KEYWORD"; continue; } if (token.text.match(regexType)) { token.type = "TYPE"; continue; } token.type = "ID"; continue; } match = cur.match(regexNumberPrefix); if (match) { token.text = match[1]; token.type = "NUMBER"; offset += token.text.length; continue; } throw new Error(`unexpected token ${JSON.stringify(cur[0])} at position ${offset}`); } return new TokenString(tokens.map(t => Object.freeze(t))); } // Check only one of `allowed` is in `set` function allowSingle(set, allowed) { let included = []; for (const key in allowed.keys()) { if (set.has(key)) { included.push(key); } } if (included.length > 1) { throw new Error(`conflicting types: ${included.join(", ")}`); } } // Functions to process a Solidity Signature TokenString from left-to-right for... // ...the name with an optional type, returning the name function consumeName(type, tokens) { if (tokens.peekKeyword(KwTypes)) { const keyword = tokens.pop().text; if (keyword !== type) { throw new Error(`expected ${type}, got ${keyword}`); } } return tokens.popType("ID"); } // ...all keywords matching allowed, returning the keywords function consumeKeywords(tokens, allowed) { const keywords = new Set(); while (true) { const keyword = tokens.peekType("KEYWORD"); if (keyword == null || allowed && !allowed.has(keyword)) { break; } tokens.pop(); if (keywords.has(keyword)) { throw new Error(`duplicate keywords: ${JSON.stringify(keyword)}`); } keywords.add(keyword); } return Object.freeze(keywords); } // ...all visibility keywords, returning the coalesced mutability function consumeMutability(tokens) { let modifiers = consumeKeywords(tokens, KwVisib); // Detect conflicting modifiers allowSingle(modifiers, setify("constant payable nonpayable".split(" "))); allowSingle(modifiers, setify("pure view payable nonpayable".split(" "))); // Process mutability states if (modifiers.has("view")) { return "view"; } if (modifiers.has("pure")) { return "pure"; } if (modifiers.has("payable")) { return "payable"; } if (modifiers.has("nonpayable")) { return "nonpayable"; } // Process legacy `constant` last if (modifiers.has("constant")) { return "view"; } return "nonpayable"; } // ...a parameter list, returning the ParamType list function consumeParams(tokens, allowIndexed) { return tokens.popParams().map(t => ParamType.from(t, allowIndexed)); } // ...a gas limit, returning a BigNumber or null if none function consumeGas(tokens) { if (tokens.peekType("AT")) { tokens.pop(); if (tokens.peekType("NUMBER")) { return getBigInt(tokens.pop().text); } throw new Error("invalid gas"); } return null; } function consumeEoi(tokens) { if (tokens.length) { throw new Error(`unexpected tokens at offset ${tokens.offset}: ${tokens.toString()}`); } } const regexArrayType = new RegExp(/^(.*)\[([0-9]*)\]$/); function verifyBasicType(type) { const match = type.match(regexType); assertArgument(match, "invalid type", "type", type); if (type === "uint") { return "uint256"; } if (type === "int") { return "int256"; } if (match[2]) { // bytesXX const length = parseInt(match[2]); assertArgument(length !== 0 && length <= 32, "invalid bytes length", "type", type); } else if (match[3]) { // intXX or uintXX const size = parseInt(match[3]); assertArgument(size !== 0 && size <= 256 && size % 8 === 0, "invalid numeric width", "type", type); } return type; } // Make the Fragment constructors effectively private const _guard$2 = {}; const internal$1 = Symbol.for("_ethers_internal"); const ParamTypeInternal = "_ParamTypeInternal"; const ErrorFragmentInternal = "_ErrorInternal"; const EventFragmentInternal = "_EventInternal"; const ConstructorFragmentInternal = "_ConstructorInternal"; const FallbackFragmentInternal = "_FallbackInternal"; const FunctionFragmentInternal = "_FunctionInternal"; const StructFragmentInternal = "_StructInternal"; /** * Each input and output of a [[Fragment]] is an Array of **ParamType**. */ class ParamType { /** * The local name of the parameter (or ``""`` if unbound) */ name; /** * The fully qualified type (e.g. ``"address"``, ``"tuple(address)"``, * ``"uint256[3][]"``) */ type; /** * The base type (e.g. ``"address"``, ``"tuple"``, ``"array"``) */ baseType; /** * True if the parameters is indexed. * * For non-indexable types this is ``null``. */ indexed; /** * The components for the tuple. * * For non-tuple types this is ``null``. */ components; /** * The array length, or ``-1`` for dynamic-lengthed arrays. * * For non-array types this is ``null``. */ arrayLength; /** * The type of each child in the array. * * For non-array types this is ``null``. */ arrayChildren; /** * @private */ constructor(guard, name, type, baseType, indexed, components, arrayLength, arrayChildren) { assertPrivate(guard, _guard$2, "ParamType"); Object.defineProperty(this, internal$1, { value: ParamTypeInternal }); if (components) { components = Object.freeze(components.slice()); } if (baseType === "array") { if (arrayLength == null || arrayChildren == null) { throw new Error(""); } } else if (arrayLength != null || arrayChildren != null) { throw new Error(""); } if (baseType === "tuple") { if (components == null) { throw new Error(""); } } else if (components != null) { throw new Error(""); } defineProperties(this, { name, type, baseType, indexed, components, arrayLength, arrayChildren }); } /** * Return a string representation of this type. * * For example, * * ``sighash" => "(uint256,address)"`` * * ``"minimal" => "tuple(uint256,address) indexed"`` * * ``"full" => "tuple(uint256 foo, address bar) indexed baz"`` */ format(format) { if (format == null) { format = "sighash"; } if (format === "json") { const name = this.name || ""; if (this.isArray()) { const result = JSON.parse(this.arrayChildren.format("json")); result.name = name; result.type += `[${this.arrayLength < 0 ? "" : String(this.arrayLength)}]`; return JSON.stringify(result); } const result = { type: this.baseType === "tuple" ? "tuple" : this.type, name }; if (typeof this.indexed === "boolean") { result.indexed = this.indexed; } if (this.isTuple()) { result.components = this.components.map(c => JSON.parse(c.format(format))); } return JSON.stringify(result); } let result = ""; // Array if (this.isArray()) { result += this.arrayChildren.format(format); result += `[${this.arrayLength < 0 ? "" : String(this.arrayLength)}]`; } else { if (this.isTuple()) { result += "(" + this.components.map(comp => comp.format(format)).join(format === "full" ? ", " : ",") + ")"; } else { result += this.type; } } if (format !== "sighash") { if (this.indexed === true) { result += " indexed"; } if (format === "full" && this.name) { result += " " + this.name; } } return result; } /** * Returns true if %%this%% is an Array type. * * This provides a type gaurd ensuring that [[arrayChildren]] * and [[arrayLength]] are non-null. */ isArray() { return this.baseType === "array"; } /** * Returns true if %%this%% is a Tuple type. * * This provides a type gaurd ensuring that [[components]] * is non-null. */ isTuple() { return this.baseType === "tuple"; } /** * Returns true if %%this%% is an Indexable type. * * This provides a type gaurd ensuring that [[indexed]] * is non-null. */ isIndexable() { return this.indexed != null; } /** * Walks the **ParamType** with %%value%%, calling %%process%% * on each type, destructing the %%value%% recursively. */ walk(value, process) { if (this.isArray()) { if (!Array.isArray(value)) { throw new Error("invalid array value"); } if (this.arrayLength !== -1 && value.length !== this.arrayLength) { throw new Error("array is wrong length"); } const _this = this; return value.map(v => _this.arrayChildren.walk(v, process)); } if (this.isTuple()) { if (!Array.isArray(value)) { throw new Error("invalid tuple value"); } if (value.length !== this.components.length) { throw new Error("array is wrong length"); } const _this = this; return value.map((v, i) => _this.components[i].walk(v, process)); } return process(this.type, value); } #walkAsync(promises, value, process, setValue) { if (this.isArray()) { if (!Array.isArray(value)) { throw new Error("invalid array value"); } if (this.arrayLength !== -1 && value.length !== this.arrayLength) { throw new Error("array is wrong length"); } const childType = this.arrayChildren; const result = value.slice(); result.forEach((value, index) => { childType.#walkAsync(promises, value, process, value => { result[index] = value; }); }); setValue(result); return; } if (this.isTuple()) { const components = this.components; // Convert the object into an array let result; if (Array.isArray(value)) { result = value.slice(); } else { if (value == null || typeof value !== "object") { throw new Error("invalid tuple value"); } result = components.map(param => { if (!param.name) { throw new Error("cannot use object value with unnamed components"); } if (!(param.name in value)) { throw new Error(`missing value for component ${param.name}`); } return value[param.name]; }); } if (result.length !== this.components.length) { throw new Error("array is wrong length"); } result.forEach((value, index) => { components[index].#walkAsync(promises, value, process, value => { result[index] = value; }); }); setValue(result); return; } const result = process(this.type, value); if (result.then) { promises.push(async function () { setValue(await result); }()); } else { setValue(result); } } /** * Walks the **ParamType** with %%value%%, asynchronously calling * %%process%% on each type, destructing the %%value%% recursively. * * This can be used to resolve ENS names by walking and resolving each * ``"address"`` type. */ async walkAsync(value, process) { const promises = []; const result = [value]; this.#walkAsync(promises, value, process, value => { result[0] = value; }); if (promises.length) { await Promise.all(promises); } return result[0]; } /** * Creates a new **ParamType** for %%obj%%. * * If %%allowIndexed%% then the ``indexed`` keyword is permitted, * otherwise the ``indexed`` keyword will throw an error. */ static from(obj, allowIndexed) { if (ParamType.isParamType(obj)) { return obj; } if (typeof obj === "string") { try { return ParamType.from(lex(obj), allowIndexed); } catch (error) { assertArgument(false, "invalid param type", "obj", obj); } } else if (obj instanceof TokenString) { let type = "", baseType = ""; let comps = null; if (consumeKeywords(obj, setify(["tuple"])).has("tuple") || obj.peekType("OPEN_PAREN")) { // Tuple baseType = "tuple"; comps = obj.popParams().map(t => ParamType.from(t)); type = `tuple(${comps.map(c => c.format()).join(",")})`; } else { // Normal type = verifyBasicType(obj.popType("TYPE")); baseType = type; } // Check for Array let arrayChildren = null; let arrayLength = null; while (obj.length && obj.peekType("BRACKET")) { const bracket = obj.pop(); //arrays[i]; arrayChildren = new ParamType(_guard$2, "", type, baseType, null, comps, arrayLength, arrayChildren); arrayLength = bracket.value; type += bracket.text; baseType = "array"; comps = null; } let indexed = null; const keywords = consumeKeywords(obj, KwModifiers); if (keywords.has("indexed")) { if (!allowIndexed) { throw new Error(""); } indexed = true; } const name = obj.peekType("ID") ? obj.pop().text : ""; if (obj.length) { throw new Error("leftover tokens"); } return new ParamType(_guard$2, name, type, baseType, indexed, comps, arrayLength, arrayChildren); } const name = obj.name; assertArgument(!name || typeof name === "string" && name.match(regexId), "invalid name", "obj.name", name); let indexed = obj.indexed; if (indexed != null) { assertArgument(allowIndexed, "parameter cannot be indexed", "obj.indexed", obj.indexed); indexed = !!indexed; } let type = obj.type; let arrayMatch = type.match(regexArrayType); if (arrayMatch) { const arrayLength = parseInt(arrayMatch[2] || "-1"); const arrayChildren = ParamType.from({ type: arrayMatch[1], components: obj.components }); return new ParamType(_guard$2, name || "", type, "array", indexed, null, arrayLength, arrayChildren); } if (type === "tuple" || type.startsWith("tuple(" /* fix: ) */) || type.startsWith("(" /* fix: ) */)) { const comps = obj.components != null ? obj.components.map(c => ParamType.from(c)) : null; const tuple = new ParamType(_guard$2, name || "", type, "tuple", indexed, comps, null, null); // @TODO: use lexer to validate and normalize type return tuple; } type = verifyBasicType(obj.type); return new ParamType(_guard$2, name || "", type, type, indexed, null, null, null); } /** * Returns true if %%value%% is a **ParamType**. */ static isParamType(value) { return value && value[internal$1] === ParamTypeInternal; } } /** * An abstract class to represent An individual fragment from a parse ABI. */ class Fragment { /** * The type of the fragment. */ type; /** * The inputs for the fragment. */ inputs; /** * @private */ constructor(guard, type, inputs) { assertPrivate(guard, _guard$2, "Fragment"); inputs = Object.freeze(inputs.slice()); defineProperties(this, { type, inputs }); } /** * Creates a new **Fragment** for %%obj%%, wich can be any supported * ABI frgament type. */ static from(obj) { if (typeof obj === "string") { // Try parsing JSON... try { Fragment.from(JSON.parse(obj)); } catch (e) {} // ...otherwise, use the human-readable lexer return Fragment.from(lex(obj)); } if (obj instanceof TokenString) { // Human-readable ABI (already lexed) const type = obj.peekKeyword(KwTypes); switch (type) { case "constructor": return ConstructorFragment.from(obj); case "error": return ErrorFragment.from(obj); case "event": return EventFragment.from(obj); case "fallback": case "receive": return FallbackFragment.from(obj); case "function": return FunctionFragment.from(obj); case "struct": return StructFragment.from(obj); } } else if (typeof obj === "object") { // JSON ABI switch (obj.type) { case "constructor": return ConstructorFragment.from(obj); case "error": return ErrorFragment.from(obj); case "event": return EventFragment.from(obj); case "fallback": case "receive": return FallbackFragment.from(obj); case "function": return FunctionFragment.from(obj); case "struct": return StructFragment.from(obj); } assert(false, `unsupported type: ${obj.type}`, "UNSUPPORTED_OPERATION", { operation: "Fragment.from" }); } assertArgument(false, "unsupported frgament object", "obj", obj); } /** * Returns true if %%value%% is a [[ConstructorFragment]]. */ static isConstructor(value) { return ConstructorFragment.isFragment(value); } /** * Returns true if %%value%% is an [[ErrorFragment]]. */ static isError(value) { return ErrorFragment.isFragment(value); } /** * Returns true if %%value%% is an [[EventFragment]]. */ static isEvent(value) { return EventFragment.isFragment(value); } /** * Returns true if %%value%% is a [[FunctionFragment]]. */ static isFunction(value) { return FunctionFragment.isFragment(value); } /** * Returns true if %%value%% is a [[StructFragment]]. */ static isStruct(value) { return StructFragment.isFragment(value); } } /** * An abstract class to represent An individual fragment * which has a name from a parse ABI. */ class NamedFragment extends Fragment { /** * The name of the fragment. */ name; /** * @private */ constructor(guard, type, name, inputs) { super(guard, type, inputs); assertArgument(typeof name === "string" && name.match(regexId), "invalid identifier", "name", name); inputs = Object.freeze(inputs.slice()); defineProperties(this, { name }); } } function joinParams(format, params) { return "(" + params.map(p => p.format(format)).join(format === "full" ? ", " : ",") + ")"; } /** * A Fragment which represents a //Custom Error//. */ class ErrorFragment extends NamedFragment { /** * @private */ constructor(guard, name, inputs) { super(guard, "error", name, inputs); Object.defineProperty(this, internal$1, { value: ErrorFragmentInternal }); } /** * The Custom Error selector. */ get selector() { return id(this.format("sighash")).substring(0, 10); } /** * Returns a string representation of this fragment as %%format%%. */ format(format) { if (format == null) { format = "sighash"; } if (format === "json") { return JSON.stringify({ type: "error", name: this.name, inputs: this.inputs.map(input => JSON.parse(input.format(format))) }); } const result = []; if (format !== "sighash") { result.push("error"); } result.push(this.name + joinParams(format, this.inputs)); return result.join(" "); } /** * Returns a new **ErrorFragment** for %%obj%%. */ static from(obj) { if (ErrorFragment.isFragment(obj)) { return obj; } if (typeof obj === "string") { return ErrorFragment.from(lex(obj)); } else if (obj instanceof TokenString) { const name = consumeName("error", obj); const inputs = consumeParams(obj); consumeEoi(obj); return new ErrorFragment(_guard$2, name, inputs); } return new ErrorFragment(_guard$2, obj.name, obj.inputs ? obj.inputs.map(ParamType.from) : []); } /** * Returns ``true`` and provides a type guard if %%value%% is an * **ErrorFragment**. */ static isFragment(value) { return value && value[internal$1] === ErrorFragmentInternal; } } /** * A Fragment which represents an Event. */ class EventFragment extends NamedFragment { /** * Whether this event is anonymous. */ anonymous; /** * @private */ constructor(guard, name, inputs, anonymous) { super(guard, "event", name, inputs); Object.defineProperty(this, internal$1, { value: EventFragmentInternal }); defineProperties(this, { anonymous }); } /** * The Event topic hash. */ get topicHash() { return id(this.format("sighash")); } /** * Returns a string representation of this event as %%format%%. */ format(format) { if (format == null) { format = "sighash"; } if (format === "json") { return JSON.stringify({ type: "event", anonymous: this.anonymous, name: this.name, inputs: this.inputs.map(i => JSON.parse(i.format(format))) }); } const result = []; if (format !== "sighash") { result.push("event"); } result.push(this.name + joinParams(format, this.inputs)); if (format !== "sighash" && this.anonymous) { result.push("anonymous"); } return result.join(" "); } /** * Return the topic hash for an event with %%name%% and %%params%%. */ static getTopicHash(name, params) { params = (params || []).map(p => ParamType.from(p)); const fragment = new EventFragment(_guard$2, name, params, false); return fragment.topicHash; } /** * Returns a new **EventFragment** for %%obj%%. */ static from(obj) { if (EventFragment.isFragment(obj)) { return obj; } if (typeof obj === "string") { try { return EventFragment.from(lex(obj)); } catch (error) { assertArgument(false, "invalid event fragment", "obj", obj); } } else if (obj instanceof TokenString) { const name = consumeName("event", obj); const inputs = consumeParams(obj, true); const anonymous = !!consumeKeywords(obj, setify(["anonymous"])).has("anonymous"); consumeEoi(obj); return new EventFragment(_guard$2, name, inputs, anonymous); } return new EventFragment(_guard$2, obj.name, obj.inputs ? obj.inputs.map(p => ParamType.from(p, true)) : [], !!obj.anonymous); } /** * Returns ``true`` and provides a type guard if %%value%% is an * **EventFragment**. */ static isFragment(value) { return value && value[internal$1] === EventFragmentInternal; } } /** * A Fragment which represents a constructor. */ class ConstructorFragment extends Fragment { /** * Whether the constructor can receive an endowment. */ payable; /** * The recommended gas limit for deployment or ``null``. */ gas; /** * @private */ constructor(guard, type, inputs, payable, gas) { super(guard, type, inputs); Object.defineProperty(this, internal$1, { value: ConstructorFragmentInternal }); defineProperties(this, { payable, gas }); } /** * Returns a string representation of this constructor as %%format%%. */ format(format) { assert(format != null && format !== "sighash", "cannot format a constructor for sighash", "UNSUPPORTED_OPERATION", { operation: "format(sighash)" }); if (format === "json") { return JSON.stringify({ type: "constructor", stateMutability: this.payable ? "payable" : "undefined", payable: this.payable, gas: this.gas != null ? this.gas : undefined, inputs: this.inputs.map(i => JSON.parse(i.format(format))) }); } const result = [`constructor${joinParams(format, this.inputs)}`]; if (this.payable) { result.push("payable"); } if (this.gas != null) { result.push(`@${this.gas.toString()}`); } return result.join(" "); } /** * Returns a new **ConstructorFragment** for %%obj%%. */ static from(obj) { if (ConstructorFragment.isFragment(obj)) { return obj; } if (typeof obj === "string") { try { return ConstructorFragment.from(lex(obj)); } catch (error) { assertArgument(false, "invalid constuctor fragment", "obj", obj); } } else if (obj instanceof TokenString) { consumeKeywords(obj, setify(["constructor"])); const inputs = consumeParams(obj); const payable = !!consumeKeywords(obj, KwVisibDeploy).has("payable"); const gas = consumeGas(obj); consumeEoi(obj); return new ConstructorFragment(_guard$2, "constructor", inputs, payable, gas); } return new ConstructorFragment(_guard$2, "constructor", obj.inputs ? obj.inputs.map(ParamType.from) : [], !!obj.payable, obj.gas != null ? obj.gas : null); } /** * Returns ``true`` and provides a type guard if %%value%% is a * **ConstructorFragment**. */ static isFragment(value) { return value && value[internal$1] === ConstructorFragmentInternal; } } /** * A Fragment which represents a method. */ class FallbackFragment extends Fragment { /** * If the function can be sent value during invocation. */ payable; constructor(guard, inputs, payable) { super(guard, "fallback", inputs); Object.defineProperty(this, internal$1, { value: FallbackFragmentInternal }); defineProperties(this, { payable }); } /** * Returns a string representation of this fallback as %%format%%. */ format(format) { const type = this.inputs.length === 0 ? "receive" : "fallback"; if (format === "json") { const stateMutability = this.payable ? "payable" : "nonpayable"; return JSON.stringify({ type, stateMutability }); } return `${type}()${this.payable ? " payable" : ""}`; } /** * Returns a new **FallbackFragment** for %%obj%%. */ static from(obj) { if (FallbackFragment.isFragment(obj)) { return obj; } if (typeof obj === "string") { try { return FallbackFragment.from(lex(obj)); } catch (error) { assertArgument(false, "invalid fallback fragment", "obj", obj); } } else if (obj instanceof TokenString) { const errorObj = obj.toString(); const topIsValid = obj.peekKeyword(setify(["fallback", "receive"])); assertArgument(topIsValid, "type must be fallback or receive", "obj", errorObj); const type = obj.popKeyword(setify(["fallback", "receive"])); // receive() if (type === "receive") { const inputs = consumeParams(obj); assertArgument(inputs.length === 0, `receive cannot have arguments`, "obj.inputs", inputs); consumeKeywords(obj, setify(["payable"])); consumeEoi(obj); return new FallbackFragment(_guard$2, [], true); } // fallback() [payable] // fallback(bytes) [payable] returns (bytes) let inputs = consumeParams(obj); if (inputs.length) { assertArgument(inputs.length === 1 && inputs[0].type === "bytes", "invalid fallback inputs", "obj.inputs", inputs.map(i => i.format("minimal")).join(", ")); } else { inputs = [ParamType.from("bytes")]; } const mutability = consumeMutability(obj); assertArgument(mutability === "nonpayable" || mutability === "payable", "fallback cannot be constants", "obj.stateMutability", mutability); if (consumeKeywords(obj, setify(["returns"])).has("returns")) { const outputs = consumeParams(obj); assertArgument(outputs.length === 1 && outputs[0].type === "bytes", "invalid fallback outputs", "obj.outputs", outputs.map(i => i.format("minimal")).join(", ")); } consumeEoi(obj); return new FallbackFragment(_guard$2, inputs, mutability === "payable"); } if (obj.type === "receive") { return new FallbackFragment(_guard$2, [], true); } if (obj.type === "fallback") { const inputs = [ParamType.from("bytes")]; const payable = obj.stateMutability === "payable"; return new FallbackFragment(_guard$2, inputs, payable); } assertArgument(false, "invalid fallback description", "obj", obj); } /** * Returns ``true`` and provides a type guard if %%value%% is a * **FallbackFragment**. */ static isFragment(value) { return value && value[internal$1] === FallbackFragmentInternal; } } /** * A Fragment which represents a method. */ class FunctionFragment extends NamedFragment { /** * If the function is constant (e.g. ``pure`` or ``view`` functions). */ constant; /** * The returned types for the result of calling this function. */ outputs; /** * The state mutability (e.g. ``payable``, ``nonpayable``, ``view`` * or ``pure``) */ stateMutability; /** * If the function can be sent value during invocation. */ payable; /** * The recommended gas limit to send when calling this function. */ gas; /** * @private */ constructor(guard, name, stateMutability, inputs, outputs, gas) { super(guard, "function", name, inputs); Object.defineProperty(this, internal$1, { value: FunctionFragmentInternal }); outputs = Object.freeze(outputs.slice()); const constant = stateMutability === "view" || stateMutability === "pure"; const payable = stateMutability === "payable"; defineProperties(this, { constant, gas, outputs, payable, stateMutability }); } /** * The Function selector. */ get selector() { return id(this.format("sighash")).substring(0, 10); } /** * Returns a string representation of this function as %%format%%. */ format(format) { if (format == null) { format = "sighash"; } if (format === "json") { return JSON.stringify({ type: "function", name: this.name, constant: this.constant, stateMutability: this.stateMutability !== "nonpayable" ? this.stateMutability : undefined, payable: this.payable, gas: this.gas != null ? this.gas : undefined, inputs: this.inputs.map(i => JSON.parse(i.format(format))), outputs: this.outputs.map(o => JSON.parse(o.format(format))) }); } const result = []; if (format !== "sighash") { result.push("function"); } result.push(this.name + joinParams(format, this.inputs)); if (format !== "sighash") { if (this.stateMutability !== "nonpayable") { result.push(this.stateMutability); } if (this.outputs && this.outputs.length) { result.push("returns"); result.push(joinParams(format, this.outputs)); } if (this.gas != null) { result.push(`@${this.gas.toString()}`); } } return result.join(" "); } /** * Return the selector for a function with %%name%% and %%params%%. */ static getSelector(name, params) { params = (params || []).map(p => ParamType.from(p)); const fragment = new FunctionFragment(_guard$2, name, "view", params, [], null); return fragment.selector; } /** * Returns a new **FunctionFragment** for %%obj%%. */ static from(obj) { if (FunctionFragment.isFragment(obj)) { return obj; } if (typeof obj === "string") { try { return FunctionFragment.from(lex(obj)); } catch (error) { assertArgument(false, "invalid function fragment", "obj", obj); } } else if (obj instanceof TokenString) { const name = consumeName("function", obj); const inputs = consumeParams(obj); const mutability = consumeMutability(obj); let outputs = []; if (consumeKeywords(obj, setify(["returns"])).has("returns")) { outputs = consumeParams(obj); } const gas = consumeGas(obj); consumeEoi(obj); return new FunctionFragment(_guard$2, name, mutability, inputs, outputs, gas); } let stateMutability = obj.stateMutability; // Use legacy Solidity ABI logic if stateMutability is missing if (stateMutability == null) { stateMutability = "payable"; if (typeof obj.constant === "boolean") { stateMutability = "view"; if (!obj.constant) { stateMutability = "payable"; if (typeof obj.payable === "boolean" && !obj.payable) { stateMutability = "nonpayable"; } } } else if (typeof obj.payable === "boolean" && !obj.payable) { stateMutability = "nonpayable"; } } // @TODO: verifyState for stateMutability (e.g. throw if // payable: false but stateMutability is "nonpayable") return new FunctionFragment(_guard$2, obj.name, stateMutability, obj.inputs ? obj.inputs.map(ParamType.from) : [], obj.outputs ? obj.outputs.map(ParamType.from) : [], obj.gas != null ? obj.gas : null); } /** * Returns ``true`` and provides a type guard if %%value%% is a * **FunctionFragment**. */ static isFragment(value) { return value && value[internal$1] === FunctionFragmentInternal; } } /** * A Fragment which represents a structure. */ class StructFragment extends NamedFragment { /** * @private */ constructor(guard, name, inputs) { super(guard, "struct", name, inputs); Object.defineProperty(this, internal$1, { value: StructFragmentInternal }); } /** * Returns a string representation of this struct as %%format%%. */ format() { throw new Error("@TODO"); } /** * Returns a new **StructFragment** for %%obj%%. */ static from(obj) { if (typeof obj === "string") { try { return StructFragment.from(lex(obj)); } catch (error) { assertArgument(false, "invalid struct fragment", "obj", obj); } } else if (obj instanceof TokenString) { const name = consumeName("struct", obj); const inputs = consumeParams(obj); consumeEoi(obj); return new StructFragment(_guard$2, name, inputs); } return new StructFragment(_guard$2, obj.name, obj.inputs ? obj.inputs.map(ParamType.from) : []); } // @TODO: fix this return type /** * Returns ``true`` and provides a type guard if %%value%% is a * **StructFragment**. */ static isFragment(value) { return value && value[internal$1] === StructFragmentInternal; } } /** * When sending values to or receiving values from a [[Contract]], the * data is generally encoded using the [ABI standard](link-solc-abi). * * The AbiCoder provides a utility to encode values to ABI data and * decode values from ABI data. * * Most of the time, developers should favour the [[Contract]] class, * which further abstracts a lot of the finer details of ABI data. * * @_section api/abi/abi-coder:ABI Encoding */ // See: https://github.com/ethereum/wiki/wiki/Ethereum-Contract-ABI // https://docs.soliditylang.org/en/v0.8.17/control-structures.html const PanicReasons$1 = new Map(); PanicReasons$1.set(0x00, "GENERIC_PANIC"); PanicReasons$1.set(0x01, "ASSERT_FALSE"); PanicReasons$1.set(0x11, "OVERFLOW"); PanicReasons$1.set(0x12, "DIVIDE_BY_ZERO"); PanicReasons$1.set(0x21, "ENUM_RANGE_ERROR"); PanicReasons$1.set(0x22, "BAD_STORAGE_DATA"); PanicReasons$1.set(0x31, "STACK_UNDERFLOW"); PanicReasons$1.set(0x32, "ARRAY_RANGE_ERROR"); PanicReasons$1.set(0x41, "OUT_OF_MEMORY"); PanicReasons$1.set(0x51, "UNINITIALIZED_FUNCTION_CALL"); const paramTypeBytes = new RegExp(/^bytes([0-9]*)$/); const paramTypeNumber = new RegExp(/^(u?int)([0-9]*)$/); let defaultCoder = null; let defaultMaxInflation = 1024; function getBuiltinCallException(action, tx, data, abiCoder) { let message = "missing revert data"; let reason = null; const invocation = null; let revert = null; if (data) { message = "execution reverted"; const bytes = getBytes(data); data = hexlify(data); if (bytes.length === 0) { message += " (no data present; likely require(false) occurred"; reason = "require(false)"; } else if (bytes.length % 32 !== 4) { message += " (could not decode reason; invalid data length)"; } else if (hexlify(bytes.slice(0, 4)) === "0x08c379a0") { // Error(string) try { reason = abiCoder.decode(["string"], bytes.slice(4))[0]; revert = { signature: "Error(string)", name: "Error", args: [reason] }; message += `: ${JSON.stringify(reason)}`; } catch (error) { message += " (could not decode reason; invalid string data)"; } } else if (hexlify(bytes.slice(0, 4)) === "0x4e487b71") { // Panic(uint256) try { const code = Number(abiCoder.decode(["uint256"], bytes.slice(4))[0]); revert = { signature: "Panic(uint256)", name: "Panic", args: [code] }; reason = `Panic due to ${PanicReasons$1.get(code) || "UNKNOWN"}(${code})`; message += `: ${reason}`; } catch (error) { message += " (could not decode panic code)"; } } else { message += " (unknown custom error)"; } } const transaction = { to: tx.to ? getAddress(tx.to) : null, data: tx.data || "0x" }; if (tx.from) { transaction.from = getAddress(tx.from); } return makeError(message, "CALL_EXCEPTION", { action, data, reason, transaction, invocation, revert }); } /** * The **AbiCoder** is a low-level class responsible for encoding JavaScript * values into binary data and decoding binary data into JavaScript values. */ class AbiCoder { #getCoder(param) { if (param.isArray()) { return new ArrayCoder(this.#getCoder(param.arrayChildren), param.arrayLength, param.name); } if (param.isTuple()) { return new TupleCoder(param.components.map(c => this.#getCoder(c)), param.name); } switch (param.baseType) { case "address": return new AddressCoder(param.name); case "bool": return new BooleanCoder(param.name); case "string": return new StringCoder(param.name); case "bytes": return new BytesCoder(param.name); case "": return new NullCoder(param.name); } // u?int[0-9]* let match = param.type.match(paramTypeNumber); if (match) { let size = parseInt(match[2] || "256"); assertArgument(size !== 0 && size <= 256 && size % 8 === 0, "invalid " + match[1] + " bit length", "param", param); return new NumberCoder(size / 8, match[1] === "int", param.name); } // bytes[0-9]+ match = param.type.match(paramTypeBytes); if (match) { let size = parseInt(match[1]); assertArgument(size !== 0 && size <= 32, "invalid bytes length", "param", param); return new FixedBytesCoder(size, param.name); } assertArgument(false, "invalid type", "type", param.type); } /** * Get the default values for the given %%types%%. * * For example, a ``uint`` is by default ``0`` and ``bool`` * is by default ``false``. */ getDefaultValue(types) { const coders = types.map(type => this.#getCoder(ParamType.from(type))); const coder = new TupleCoder(coders, "_"); return coder.defaultValue(); } /** * Encode the %%values%% as the %%types%% into ABI data. * * @returns DataHexstring */ encode(types, values) { assertArgumentCount(values.length, types.length, "types/values length mismatch"); const coders = types.map(type => this.#getCoder(ParamType.from(type))); const coder = new TupleCoder(coders, "_"); const writer = new Writer(); coder.encode(writer, values); return writer.data; } /** * Decode the ABI %%data%% as the %%types%% into values. * * If %%loose%% decoding is enabled, then strict padding is * not enforced. Some older versions of Solidity incorrectly * padded event data emitted from ``external`` functions. */ decode(types, data, loose) { const coders = types.map(type => this.#getCoder(ParamType.from(type))); const coder = new TupleCoder(coders, "_"); return coder.decode(new Reader(data, loose, defaultMaxInflation)); } static _setDefaultMaxInflation(value) { assertArgument(typeof value === "number" && Number.isInteger(value), "invalid defaultMaxInflation factor", "value", value); defaultMaxInflation = value; } /** * Returns the shared singleton instance of a default [[AbiCoder]]. * * On the first call, the instance is created internally. */ static defaultAbiCoder() { if (defaultCoder == null) { defaultCoder = new AbiCoder(); } return defaultCoder; } /** * Returns an ethers-compatible [[CallExceptionError]] Error for the given * result %%data%% for the [[CallExceptionAction]] %%action%% against * the Transaction %%tx%%. */ static getBuiltinCallException(action, tx, data) { return getBuiltinCallException(action, tx, data, AbiCoder.defaultAbiCoder()); } } /** * The Interface class is a low-level class that accepts an * ABI and provides all the necessary functionality to encode * and decode paramaters to and results from methods, events * and errors. * * It also provides several convenience methods to automatically * search and find matching transactions and events to parse them. * * @_subsection api/abi:Interfaces [interfaces] */ /** * When using the [[Interface-parseLog]] to automatically match a Log to its event * for parsing, a **LogDescription** is returned. */ class LogDescription { /** * The matching fragment for the ``topic0``. */ fragment; /** * The name of the Event. */ name; /** * The full Event signature. */ signature; /** * The topic hash for the Event. */ topic; /** * The arguments passed into the Event with ``emit``. */ args; /** * @_ignore: */ constructor(fragment, topic, args) { const name = fragment.name, signature = fragment.format(); defineProperties(this, { fragment, name, signature, topic, args }); } } /** * When using the [[Interface-parseTransaction]] to automatically match * a transaction data to its function for parsing, * a **TransactionDescription** is returned. */ class TransactionDescription { /** * The matching fragment from the transaction ``data``. */ fragment; /** * The name of the Function from the transaction ``data``. */ name; /** * The arguments passed to the Function from the transaction ``data``. */ args; /** * The full Function signature from the transaction ``data``. */ signature; /** * The selector for the Function from the transaction ``data``. */ selector; /** * The ``value`` (in wei) from the transaction. */ value; /** * @_ignore: */ constructor(fragment, selector, args, value) { const name = fragment.name, signature = fragment.format(); defineProperties(this, { fragment, name, args, signature, selector, value }); } } /** * When using the [[Interface-parseError]] to automatically match an * error for a call result for parsing, an **ErrorDescription** is returned. */ class ErrorDescription { /** * The matching fragment. */ fragment; /** * The name of the Error. */ name; /** * The arguments passed to the Error with ``revert``. */ args; /** * The full Error signature. */ signature; /** * The selector for the Error. */ selector; /** * @_ignore: */ constructor(fragment, selector, args) { const name = fragment.name, signature = fragment.format(); defineProperties(this, { fragment, name, args, signature, selector }); } } /** * An **Indexed** is used as a value when a value that does not * fit within a topic (i.e. not a fixed-length, 32-byte type). It * is the ``keccak256`` of the value, and used for types such as * arrays, tuples, bytes and strings. */ class Indexed { /** * The ``keccak256`` of the value logged. */ hash; /** * @_ignore: */ _isIndexed; /** * Returns ``true`` if %%value%% is an **Indexed**. * * This provides a Type Guard for property access. */ static isIndexed(value) { return !!(value && value._isIndexed); } /** * @_ignore: */ constructor(hash) { defineProperties(this, { hash, _isIndexed: true }); } } // https://docs.soliditylang.org/en/v0.8.13/control-structures.html?highlight=panic#panic-via-assert-and-error-via-require const PanicReasons = { "0": "generic panic", "1": "assert(false)", "17": "arithmetic overflow", "18": "division or modulo by zero", "33": "enum overflow", "34": "invalid encoded storage byte array accessed", "49": "out-of-bounds array access; popping on an empty array", "50": "out-of-bounds access of an array or bytesN", "65": "out of memory", "81": "uninitialized function" }; const BuiltinErrors = { "0x08c379a0": { signature: "Error(string)", name: "Error", inputs: ["string"], reason: message => { return `reverted with reason string ${JSON.stringify(message)}`; } }, "0x4e487b71": { signature: "Panic(uint256)", name: "Panic", inputs: ["uint256"], reason: code => { let reason = "unknown panic code"; if (code >= 0 && code <= 0xff && PanicReasons[code.toString()]) { reason = PanicReasons[code.toString()]; } return `reverted with panic code 0x${code.toString(16)} (${reason})`; } } }; /** * An Interface abstracts many of the low-level details for * encoding and decoding the data on the blockchain. * * An ABI provides information on how to encode data to send to * a Contract, how to decode the results and events and how to * interpret revert errors. * * The ABI can be specified by [any supported format](InterfaceAbi). */ class Interface { /** * All the Contract ABI members (i.e. methods, events, errors, etc). */ fragments; /** * The Contract constructor. */ deploy; /** * The Fallback method, if any. */ fallback; /** * If receiving ether is supported. */ receive; #errors; #events; #functions; // #structs: Map; #abiCoder; /** * Create a new Interface for the %%fragments%%. */ constructor(fragments) { let abi = []; if (typeof fragments === "string") { abi = JSON.parse(fragments); } else { abi = fragments; } this.#functions = new Map(); this.#errors = new Map(); this.#events = new Map(); // this.#structs = new Map(); const frags = []; for (const a of abi) { try { frags.push(Fragment.from(a)); } catch (error) { console.log(`[Warning] Invalid Fragment ${JSON.stringify(a)}:`, error.message); } } defineProperties(this, { fragments: Object.freeze(frags) }); let fallback = null; let receive = false; this.#abiCoder = this.getAbiCoder(); // Add all fragments by their signature this.fragments.forEach((fragment, index) => { let bucket; switch (fragment.type) { case "constructor": if (this.deploy) { console.log("duplicate definition - constructor"); return; } //checkNames(fragment, "input", fragment.inputs); defineProperties(this, { deploy: fragment }); return; case "fallback": if (fragment.inputs.length === 0) { receive = true; } else { assertArgument(!fallback || fragment.payable !== fallback.payable, "conflicting fallback fragments", `fragments[${index}]`, fragment); fallback = fragment; receive = fallback.payable; } return; case "function": //checkNames(fragment, "input", fragment.inputs); //checkNames(fragment, "output", (fragment).outputs); bucket = this.#functions; break; case "event": //checkNames(fragment, "input", fragment.inputs); bucket = this.#events; break; case "error": bucket = this.#errors; break; default: return; } // Two identical entries; ignore it const signature = fragment.format(); if (bucket.has(signature)) { return; } bucket.set(signature, fragment); }); // If we do not have a constructor add a default if (!this.deploy) { defineProperties(this, { deploy: ConstructorFragment.from("constructor()") }); } defineProperties(this, { fallback, receive }); } /** * Returns the entire Human-Readable ABI, as an array of * signatures, optionally as %%minimal%% strings, which * removes parameter names and unneceesary spaces. */ format(minimal) { const format = minimal ? "minimal" : "full"; const abi = this.fragments.map(f => f.format(format)); return abi; } /** * Return the JSON-encoded ABI. This is the format Solidiy * returns. */ formatJson() { const abi = this.fragments.map(f => f.format("json")); // We need to re-bundle the JSON fragments a bit return JSON.stringify(abi.map(j => JSON.parse(j))); } /** * The ABI coder that will be used to encode and decode binary * data. */ getAbiCoder() { return AbiCoder.defaultAbiCoder(); } // Find a function definition by any means necessary (unless it is ambiguous) #getFunction(key, values, forceUnique) { // Selector if (isHexString(key)) { const selector = key.toLowerCase(); for (const fragment of this.#functions.values()) { if (selector === fragment.selector) { return fragment; } } return null; } // It is a bare name, look up the function (will return null if ambiguous) if (key.indexOf("(") === -1) { const matching = []; for (const [name, fragment] of this.#functions) { if (name.split("(" /* fix:) */)[0] === key) { matching.push(fragment); } } if (values) { const lastValue = values.length > 0 ? values[values.length - 1] : null; let valueLength = values.length; let allowOptions = true; if (Typed.isTyped(lastValue) && lastValue.type === "overrides") { allowOptions = false; valueLength--; } // Remove all matches that don't have a compatible length. The args // may contain an overrides, so the match may have n or n - 1 parameters for (let i = matching.length - 1; i >= 0; i--) { const inputs = matching[i].inputs.length; if (inputs !== valueLength && (!allowOptions || inputs !== valueLength - 1)) { matching.splice(i, 1); } } // Remove all matches that don't match the Typed signature for (let i = matching.length - 1; i >= 0; i--) { const inputs = matching[i].inputs; for (let j = 0; j < values.length; j++) { // Not a typed value if (!Typed.isTyped(values[j])) { continue; } // We are past the inputs if (j >= inputs.length) { if (values[j].type === "overrides") { continue; } matching.splice(i, 1); break; } // Make sure the value type matches the input type if (values[j].type !== inputs[j].baseType) { matching.splice(i, 1); break; } } } } // We found a single matching signature with an overrides, but the // last value is something that cannot possibly be an options if (matching.length === 1 && values && values.length !== matching[0].inputs.length) { const lastArg = values[values.length - 1]; if (lastArg == null || Array.isArray(lastArg) || typeof lastArg !== "object") { matching.splice(0, 1); } } if (matching.length === 0) { return null; } if (matching.length > 1 && forceUnique) { const matchStr = matching.map(m => JSON.stringify(m.format())).join(", "); assertArgument(false, `ambiguous function description (i.e. matches ${matchStr})`, "key", key); } return matching[0]; } // Normalize the signature and lookup the function const result = this.#functions.get(FunctionFragment.from(key).format()); if (result) { return result; } return null; } /** * Get the function name for %%key%%, which may be a function selector, * function name or function signature that belongs to the ABI. */ getFunctionName(key) { const fragment = this.#getFunction(key, null, false); assertArgument(fragment, "no matching function", "key", key); return fragment.name; } /** * Returns true if %%key%% (a function selector, function name or * function signature) is present in the ABI. * * In the case of a function name, the name may be ambiguous, so * accessing the [[FunctionFragment]] may require refinement. */ hasFunction(key) { return !!this.#getFunction(key, null, false); } /** * Get the [[FunctionFragment]] for %%key%%, which may be a function * selector, function name or function signature that belongs to the ABI. * * If %%values%% is provided, it will use the Typed API to handle * ambiguous cases where multiple functions match by name. * * If the %%key%% and %%values%% do not refine to a single function in * the ABI, this will throw. */ getFunction(key, values) { return this.#getFunction(key, values || null, true); } /** * Iterate over all functions, calling %%callback%%, sorted by their name. */ forEachFunction(callback) { const names = Array.from(this.#functions.keys()); names.sort((a, b) => a.localeCompare(b)); for (let i = 0; i < names.length; i++) { const name = names[i]; callback(this.#functions.get(name), i); } } // Find an event definition by any means necessary (unless it is ambiguous) #getEvent(key, values, forceUnique) { // EventTopic if (isHexString(key)) { const eventTopic = key.toLowerCase(); for (const fragment of this.#events.values()) { if (eventTopic === fragment.topicHash) { return fragment; } } return null; } // It is a bare name, look up the function (will return null if ambiguous) if (key.indexOf("(") === -1) { const matching = []; for (const [name, fragment] of this.#events) { if (name.split("(" /* fix:) */)[0] === key) { matching.push(fragment); } } if (values) { // Remove all matches that don't have a compatible length. for (let i = matching.length - 1; i >= 0; i--) { if (matching[i].inputs.length < values.length) { matching.splice(i, 1); } } // Remove all matches that don't match the Typed signature for (let i = matching.length - 1; i >= 0; i--) { const inputs = matching[i].inputs; for (let j = 0; j < values.length; j++) { // Not a typed value if (!Typed.isTyped(values[j])) { continue; } // Make sure the value type matches the input type if (values[j].type !== inputs[j].baseType) { matching.splice(i, 1); break; } } } } if (matching.length === 0) { return null; } if (matching.length > 1 && forceUnique) { const matchStr = matching.map(m => JSON.stringify(m.format())).join(", "); assertArgument(false, `ambiguous event description (i.e. matches ${matchStr})`, "key", key); } return matching[0]; } // Normalize the signature and lookup the function const result = this.#events.get(EventFragment.from(key).format()); if (result) { return result; } return null; } /** * Get the event name for %%key%%, which may be a topic hash, * event name or event signature that belongs to the ABI. */ getEventName(key) { const fragment = this.#getEvent(key, null, false); assertArgument(fragment, "no matching event", "key", key); return fragment.name; } /** * Returns true if %%key%% (an event topic hash, event name or * event signature) is present in the ABI. * * In the case of an event name, the name may be ambiguous, so * accessing the [[EventFragment]] may require refinement. */ hasEvent(key) { return !!this.#getEvent(key, null, false); } /** * Get the [[EventFragment]] for %%key%%, which may be a topic hash, * event name or event signature that belongs to the ABI. * * If %%values%% is provided, it will use the Typed API to handle * ambiguous cases where multiple events match by name. * * If the %%key%% and %%values%% do not refine to a single event in * the ABI, this will throw. */ getEvent(key, values) { return this.#getEvent(key, values || null, true); } /** * Iterate over all events, calling %%callback%%, sorted by their name. */ forEachEvent(callback) { const names = Array.from(this.#events.keys()); names.sort((a, b) => a.localeCompare(b)); for (let i = 0; i < names.length; i++) { const name = names[i]; callback(this.#events.get(name), i); } } /** * Get the [[ErrorFragment]] for %%key%%, which may be an error * selector, error name or error signature that belongs to the ABI. * * If %%values%% is provided, it will use the Typed API to handle * ambiguous cases where multiple errors match by name. * * If the %%key%% and %%values%% do not refine to a single error in * the ABI, this will throw. */ getError(key, values) { if (isHexString(key)) { const selector = key.toLowerCase(); if (BuiltinErrors[selector]) { return ErrorFragment.from(BuiltinErrors[selector].signature); } for (const fragment of this.#errors.values()) { if (selector === fragment.selector) { return fragment; } } return null; } // It is a bare name, look up the function (will return null if ambiguous) if (key.indexOf("(") === -1) { const matching = []; for (const [name, fragment] of this.#errors) { if (name.split("(" /* fix:) */)[0] === key) { matching.push(fragment); } } if (matching.length === 0) { if (key === "Error") { return ErrorFragment.from("error Error(string)"); } if (key === "Panic") { return ErrorFragment.from("error Panic(uint256)"); } return null; } else if (matching.length > 1) { const matchStr = matching.map(m => JSON.stringify(m.format())).join(", "); assertArgument(false, `ambiguous error description (i.e. ${matchStr})`, "name", key); } return matching[0]; } // Normalize the signature and lookup the function key = ErrorFragment.from(key).format(); if (key === "Error(string)") { return ErrorFragment.from("error Error(string)"); } if (key === "Panic(uint256)") { return ErrorFragment.from("error Panic(uint256)"); } const result = this.#errors.get(key); if (result) { return result; } return null; } /** * Iterate over all errors, calling %%callback%%, sorted by their name. */ forEachError(callback) { const names = Array.from(this.#errors.keys()); names.sort((a, b) => a.localeCompare(b)); for (let i = 0; i < names.length; i++) { const name = names[i]; callback(this.#errors.get(name), i); } } // Get the 4-byte selector used by Solidity to identify a function /* getSelector(fragment: ErrorFragment | FunctionFragment): string { if (typeof(fragment) === "string") { const matches: Array = [ ]; try { matches.push(this.getFunction(fragment)); } catch (error) { } try { matches.push(this.getError(fragment)); } catch (_) { } if (matches.length === 0) { logger.throwArgumentError("unknown fragment", "key", fragment); } else if (matches.length > 1) { logger.throwArgumentError("ambiguous fragment matches function and error", "key", fragment); } fragment = matches[0]; } return dataSlice(id(fragment.format()), 0, 4); } */ // Get the 32-byte topic hash used by Solidity to identify an event /* getEventTopic(fragment: EventFragment): string { //if (typeof(fragment) === "string") { fragment = this.getEvent(eventFragment); } return id(fragment.format()); } */ _decodeParams(params, data) { return this.#abiCoder.decode(params, data); } _encodeParams(params, values) { return this.#abiCoder.encode(params, values); } /** * Encodes a ``tx.data`` object for deploying the Contract with * the %%values%% as the constructor arguments. */ encodeDeploy(values) { return this._encodeParams(this.deploy.inputs, values || []); } /** * Decodes the result %%data%% (e.g. from an ``eth_call``) for the * specified error (see [[getError]] for valid values for * %%key%%). * * Most developers should prefer the [[parseCallResult]] method instead, * which will automatically detect a ``CALL_EXCEPTION`` and throw the * corresponding error. */ decodeErrorResult(fragment, data) { if (typeof fragment === "string") { const f = this.getError(fragment); assertArgument(f, "unknown error", "fragment", fragment); fragment = f; } assertArgument(dataSlice(data, 0, 4) === fragment.selector, `data signature does not match error ${fragment.name}.`, "data", data); return this._decodeParams(fragment.inputs, dataSlice(data, 4)); } /** * Encodes the transaction revert data for a call result that * reverted from the the Contract with the sepcified %%error%% * (see [[getError]] for valid values for %%fragment%%) with the %%values%%. * * This is generally not used by most developers, unless trying to mock * a result from a Contract. */ encodeErrorResult(fragment, values) { if (typeof fragment === "string") { const f = this.getError(fragment); assertArgument(f, "unknown error", "fragment", fragment); fragment = f; } return concat([fragment.selector, this._encodeParams(fragment.inputs, values || [])]); } /** * Decodes the %%data%% from a transaction ``tx.data`` for * the function specified (see [[getFunction]] for valid values * for %%fragment%%). * * Most developers should prefer the [[parseTransaction]] method * instead, which will automatically detect the fragment. */ decodeFunctionData(fragment, data) { if (typeof fragment === "string") { const f = this.getFunction(fragment); assertArgument(f, "unknown function", "fragment", fragment); fragment = f; } assertArgument(dataSlice(data, 0, 4) === fragment.selector, `data signature does not match function ${fragment.name}.`, "data", data); return this._decodeParams(fragment.inputs, dataSlice(data, 4)); } /** * Encodes the ``tx.data`` for a transaction that calls the function * specified (see [[getFunction]] for valid values for %%fragment%%) with * the %%values%%. */ encodeFunctionData(fragment, values) { if (typeof fragment === "string") { const f = this.getFunction(fragment); assertArgument(f, "unknown function", "fragment", fragment); fragment = f; } return concat([fragment.selector, this._encodeParams(fragment.inputs, values || [])]); } /** * Decodes the result %%data%% (e.g. from an ``eth_call``) for the * specified function (see [[getFunction]] for valid values for * %%key%%). * * Most developers should prefer the [[parseCallResult]] method instead, * which will automatically detect a ``CALL_EXCEPTION`` and throw the * corresponding error. */ decodeFunctionResult(fragment, data) { if (typeof fragment === "string") { const f = this.getFunction(fragment); assertArgument(f, "unknown function", "fragment", fragment); fragment = f; } let message = "invalid length for result data"; const bytes = getBytesCopy(data); if (bytes.length % 32 === 0) { try { return this.#abiCoder.decode(fragment.outputs, bytes); } catch (error) { message = "could not decode result data"; } } // Call returned data with no error, but the data is junk assert(false, message, "BAD_DATA", { value: hexlify(bytes), info: { method: fragment.name, signature: fragment.format() } }); } makeError(_data, tx) { const data = getBytes(_data, "data"); const error = AbiCoder.getBuiltinCallException("call", tx, data); // Not a built-in error; try finding a custom error const customPrefix = "execution reverted (unknown custom error)"; if (error.message.startsWith(customPrefix)) { const selector = hexlify(data.slice(0, 4)); const ef = this.getError(selector); if (ef) { try { const args = this.#abiCoder.decode(ef.inputs, data.slice(4)); error.revert = { name: ef.name, signature: ef.format(), args }; error.reason = error.revert.signature; error.message = `execution reverted: ${error.reason}`; } catch (e) { error.message = `execution reverted (coult not decode custom error)`; } } } // Add the invocation, if available const parsed = this.parseTransaction(tx); if (parsed) { error.invocation = { method: parsed.name, signature: parsed.signature, args: parsed.args }; } return error; } /** * Encodes the result data (e.g. from an ``eth_call``) for the * specified function (see [[getFunction]] for valid values * for %%fragment%%) with %%values%%. * * This is generally not used by most developers, unless trying to mock * a result from a Contract. */ encodeFunctionResult(fragment, values) { if (typeof fragment === "string") { const f = this.getFunction(fragment); assertArgument(f, "unknown function", "fragment", fragment); fragment = f; } return hexlify(this.#abiCoder.encode(fragment.outputs, values || [])); } /* spelunk(inputs: Array, values: ReadonlyArray, processfunc: (type: string, value: any) => Promise): Promise> { const promises: Array> = [ ]; const process = function(type: ParamType, value: any): any { if (type.baseType === "array") { return descend(type.child } if (type. === "address") { } }; const descend = function (inputs: Array, values: ReadonlyArray) { if (inputs.length !== values.length) { throw new Error("length mismatch"); } }; const result: Array = [ ]; values.forEach((value, index) => { if (value == null) { topics.push(null); } else if (param.baseType === "array" || param.baseType === "tuple") { logger.throwArgumentError("filtering with tuples or arrays not supported", ("contract." + param.name), value); } else if (Array.isArray(value)) { topics.push(value.map((value) => encodeTopic(param, value))); } else { topics.push(encodeTopic(param, value)); } }); } */ // Create the filter for the event with search criteria (e.g. for eth_filterLog) encodeFilterTopics(fragment, values) { if (typeof fragment === "string") { const f = this.getEvent(fragment); assertArgument(f, "unknown event", "eventFragment", fragment); fragment = f; } assert(values.length <= fragment.inputs.length, `too many arguments for ${fragment.format()}`, "UNEXPECTED_ARGUMENT", { count: values.length, expectedCount: fragment.inputs.length }); const topics = []; if (!fragment.anonymous) { topics.push(fragment.topicHash); } // @TODO: Use the coders for this; to properly support tuples, etc. const encodeTopic = (param, value) => { if (param.type === "string") { return id(value); } else if (param.type === "bytes") { return keccak256(hexlify(value)); } if (param.type === "bool" && typeof value === "boolean") { value = value ? "0x01" : "0x00"; } else if (param.type.match(/^u?int/)) { value = toBeHex(value); // @TODO: Should this toTwos?? } else if (param.type.match(/^bytes/)) { value = zeroPadBytes(value, 32); } else if (param.type === "address") { // Check addresses are valid this.#abiCoder.encode(["address"], [value]); } return zeroPadValue(hexlify(value), 32); }; values.forEach((value, index) => { const param = fragment.inputs[index]; if (!param.indexed) { assertArgument(value == null, "cannot filter non-indexed parameters; must be null", "contract." + param.name, value); return; } if (value == null) { topics.push(null); } else if (param.baseType === "array" || param.baseType === "tuple") { assertArgument(false, "filtering with tuples or arrays not supported", "contract." + param.name, value); } else if (Array.isArray(value)) { topics.push(value.map(value => encodeTopic(param, value))); } else { topics.push(encodeTopic(param, value)); } }); // Trim off trailing nulls while (topics.length && topics[topics.length - 1] === null) { topics.pop(); } return topics; } encodeEventLog(fragment, values) { if (typeof fragment === "string") { const f = this.getEvent(fragment); assertArgument(f, "unknown event", "eventFragment", fragment); fragment = f; } const topics = []; const dataTypes = []; const dataValues = []; if (!fragment.anonymous) { topics.push(fragment.topicHash); } assertArgument(values.length === fragment.inputs.length, "event arguments/values mismatch", "values", values); fragment.inputs.forEach((param, index) => { const value = values[index]; if (param.indexed) { if (param.type === "string") { topics.push(id(value)); } else if (param.type === "bytes") { topics.push(keccak256(value)); } else if (param.baseType === "tuple" || param.baseType === "array") { // @TODO throw new Error("not implemented"); } else { topics.push(this.#abiCoder.encode([param.type], [value])); } } else { dataTypes.push(param); dataValues.push(value); } }); return { data: this.#abiCoder.encode(dataTypes, dataValues), topics: topics }; } // Decode a filter for the event and the search criteria decodeEventLog(fragment, data, topics) { if (typeof fragment === "string") { const f = this.getEvent(fragment); assertArgument(f, "unknown event", "eventFragment", fragment); fragment = f; } if (topics != null && !fragment.anonymous) { const eventTopic = fragment.topicHash; assertArgument(isHexString(topics[0], 32) && topics[0].toLowerCase() === eventTopic, "fragment/topic mismatch", "topics[0]", topics[0]); topics = topics.slice(1); } const indexed = []; const nonIndexed = []; const dynamic = []; fragment.inputs.forEach((param, index) => { if (param.indexed) { if (param.type === "string" || param.type === "bytes" || param.baseType === "tuple" || param.baseType === "array") { indexed.push(ParamType.from({ type: "bytes32", name: param.name })); dynamic.push(true); } else { indexed.push(param); dynamic.push(false); } } else { nonIndexed.push(param); dynamic.push(false); } }); const resultIndexed = topics != null ? this.#abiCoder.decode(indexed, concat(topics)) : null; const resultNonIndexed = this.#abiCoder.decode(nonIndexed, data, true); //const result: (Array & { [ key: string ]: any }) = [ ]; const values = []; const keys = []; let nonIndexedIndex = 0, indexedIndex = 0; fragment.inputs.forEach((param, index) => { let value = null; if (param.indexed) { if (resultIndexed == null) { value = new Indexed(null); } else if (dynamic[index]) { value = new Indexed(resultIndexed[indexedIndex++]); } else { try { value = resultIndexed[indexedIndex++]; } catch (error) { value = error; } } } else { try { value = resultNonIndexed[nonIndexedIndex++]; } catch (error) { value = error; } } values.push(value); keys.push(param.name || null); }); return Result.fromItems(values, keys); } /** * Parses a transaction, finding the matching function and extracts * the parameter values along with other useful function details. * * If the matching function cannot be found, return null. */ parseTransaction(tx) { const data = getBytes(tx.data, "tx.data"); const value = getBigInt(tx.value != null ? tx.value : 0, "tx.value"); const fragment = this.getFunction(hexlify(data.slice(0, 4))); if (!fragment) { return null; } const args = this.#abiCoder.decode(fragment.inputs, data.slice(4)); return new TransactionDescription(fragment, fragment.selector, args, value); } parseCallResult(data) { throw new Error("@TODO"); } /** * Parses a receipt log, finding the matching event and extracts * the parameter values along with other useful event details. * * If the matching event cannot be found, returns null. */ parseLog(log) { const fragment = this.getEvent(log.topics[0]); if (!fragment || fragment.anonymous) { return null; } // @TODO: If anonymous, and the only method, and the input count matches, should we parse? // Probably not, because just because it is the only event in the ABI does // not mean we have the full ABI; maybe just a fragment? return new LogDescription(fragment, fragment.topicHash, this.decodeEventLog(fragment, log.data, log.topics)); } /** * Parses a revert data, finding the matching error and extracts * the parameter values along with other useful error details. * * If the matching error cannot be found, returns null. */ parseError(data) { const hexData = hexlify(data); const fragment = this.getError(dataSlice(hexData, 0, 4)); if (!fragment) { return null; } const args = this.#abiCoder.decode(fragment.inputs, dataSlice(hexData, 4)); return new ErrorDescription(fragment, fragment.selector, args); } /** * Creates a new [[Interface]] from the ABI %%value%%. * * The %%value%% may be provided as an existing [[Interface]] object, * a JSON-encoded ABI or any Human-Readable ABI format. */ static from(value) { // Already an Interface, which is immutable if (value instanceof Interface) { return value; } // JSON if (typeof value === "string") { return new Interface(JSON.parse(value)); } // An Interface; possibly from another v6 instance if (typeof value.formatJson === "function") { return new Interface(value.formatJson()); } // A legacy Interface; from an older version if (typeof value.format === "function") { return new Interface(value.format("json")); } // Array of fragments return new Interface(value); } } //import { resolveAddress } from "@ethersproject/address"; const BN_0$2 = BigInt(0); // ----------------------- function getValue(value) { if (value == null) { return null; } return value; } function toJson(value) { if (value == null) { return null; } return value.toString(); } // @TODO? implements Required /** * A **FeeData** wraps all the fee-related values associated with * the network. */ class FeeData { /** * The gas price for legacy networks. */ gasPrice; /** * The maximum fee to pay per gas. * * The base fee per gas is defined by the network and based on * congestion, increasing the cost during times of heavy load * and lowering when less busy. * * The actual fee per gas will be the base fee for the block * and the priority fee, up to the max fee per gas. * * This will be ``null`` on legacy networks (i.e. [pre-EIP-1559](link-eip-1559)) */ maxFeePerGas; /** * The additional amout to pay per gas to encourage a validator * to include the transaction. * * The purpose of this is to compensate the validator for the * adjusted risk for including a given transaction. * * This will be ``null`` on legacy networks (i.e. [pre-EIP-1559](link-eip-1559)) */ maxPriorityFeePerGas; /** * Creates a new FeeData for %%gasPrice%%, %%maxFeePerGas%% and * %%maxPriorityFeePerGas%%. */ constructor(gasPrice, maxFeePerGas, maxPriorityFeePerGas) { defineProperties(this, { gasPrice: getValue(gasPrice), maxFeePerGas: getValue(maxFeePerGas), maxPriorityFeePerGas: getValue(maxPriorityFeePerGas) }); } /** * Returns a JSON-friendly value. */ toJSON() { const { gasPrice, maxFeePerGas, maxPriorityFeePerGas } = this; return { _type: "FeeData", gasPrice: toJson(gasPrice), maxFeePerGas: toJson(maxFeePerGas), maxPriorityFeePerGas: toJson(maxPriorityFeePerGas) }; } } /** * Returns a copy of %%req%% with all properties coerced to their strict * types. */ function copyRequest(req) { const result = {}; // These could be addresses, ENS names or Addressables if (req.to) { result.to = req.to; } if (req.from) { result.from = req.from; } if (req.data) { result.data = hexlify(req.data); } const bigIntKeys = "chainId,gasLimit,gasPrice,maxFeePerBlobGas,maxFeePerGas,maxPriorityFeePerGas,value".split(/,/); for (const key of bigIntKeys) { if (!(key in req) || req[key] == null) { continue; } result[key] = getBigInt(req[key], `request.${key}`); } const numberKeys = "type,nonce".split(/,/); for (const key of numberKeys) { if (!(key in req) || req[key] == null) { continue; } result[key] = getNumber(req[key], `request.${key}`); } if (req.accessList) { result.accessList = accessListify(req.accessList); } if ("blockTag" in req) { result.blockTag = req.blockTag; } if ("enableCcipRead" in req) { result.enableCcipRead = !!req.enableCcipRead; } if ("customData" in req) { result.customData = req.customData; } if ("blobVersionedHashes" in req && req.blobVersionedHashes) { result.blobVersionedHashes = req.blobVersionedHashes.slice(); } if ("kzg" in req) { result.kzg = req.kzg; } if ("blobs" in req && req.blobs) { result.blobs = req.blobs.map(b => { if (isBytesLike(b)) { return hexlify(b); } return Object.assign({}, b); }); } return result; } /** * A **Block** represents the data associated with a full block on * Ethereum. */ class Block { /** * The provider connected to the block used to fetch additional details * if necessary. */ provider; /** * The block number, sometimes called the block height. This is a * sequential number that is one higher than the parent block. */ number; /** * The block hash. * * This hash includes all properties, so can be safely used to identify * an exact set of block properties. */ hash; /** * The timestamp for this block, which is the number of seconds since * epoch that this block was included. */ timestamp; /** * The block hash of the parent block. */ parentHash; /** * The hash tree root of the parent beacon block for the given * execution block. See [[link-eip-4788]]. */ parentBeaconBlockRoot; /** * The nonce. * * On legacy networks, this is the random number inserted which * permitted the difficulty target to be reached. */ nonce; /** * The difficulty target. * * On legacy networks, this is the proof-of-work target required * for a block to meet the protocol rules to be included. * * On modern networks, this is a random number arrived at using * randao. @TODO: Find links? */ difficulty; /** * The total gas limit for this block. */ gasLimit; /** * The total gas used in this block. */ gasUsed; /** * The root hash for the global state after applying changes * in this block. */ stateRoot; /** * The hash of the transaction receipts trie. */ receiptsRoot; /** * The total amount of blob gas consumed by the transactions * within the block. See [[link-eip-4844]]. */ blobGasUsed; /** * The running total of blob gas consumed in excess of the * target, prior to the block. See [[link-eip-4844]]. */ excessBlobGas; /** * The miner coinbase address, wihch receives any subsidies for * including this block. */ miner; /** * The latest RANDAO mix of the post beacon state of * the previous block. */ prevRandao; /** * Any extra data the validator wished to include. */ extraData; /** * The base fee per gas that all transactions in this block were * charged. * * This adjusts after each block, depending on how congested the network * is. */ baseFeePerGas; #transactions; /** * Create a new **Block** object. * * This should generally not be necessary as the unless implementing a * low-level library. */ constructor(block, provider) { this.#transactions = block.transactions.map(tx => { if (typeof tx !== "string") { return new TransactionResponse(tx, provider); } return tx; }); defineProperties(this, { provider, hash: getValue(block.hash), number: block.number, timestamp: block.timestamp, parentHash: block.parentHash, parentBeaconBlockRoot: block.parentBeaconBlockRoot, nonce: block.nonce, difficulty: block.difficulty, gasLimit: block.gasLimit, gasUsed: block.gasUsed, blobGasUsed: block.blobGasUsed, excessBlobGas: block.excessBlobGas, miner: block.miner, prevRandao: getValue(block.prevRandao), extraData: block.extraData, baseFeePerGas: getValue(block.baseFeePerGas), stateRoot: block.stateRoot, receiptsRoot: block.receiptsRoot }); } /** * Returns the list of transaction hashes, in the order * they were executed within the block. */ get transactions() { return this.#transactions.map(tx => { if (typeof tx === "string") { return tx; } return tx.hash; }); } /** * Returns the complete transactions, in the order they * were executed within the block. * * This is only available for blocks which prefetched * transactions, by passing ``true`` to %%prefetchTxs%% * into [[Provider-getBlock]]. */ get prefetchedTransactions() { const txs = this.#transactions.slice(); // Doesn't matter... if (txs.length === 0) { return []; } // Make sure we prefetched the transactions assert(typeof txs[0] === "object", "transactions were not prefetched with block request", "UNSUPPORTED_OPERATION", { operation: "transactionResponses()" }); return txs; } /** * Returns a JSON-friendly value. */ toJSON() { const { baseFeePerGas, difficulty, extraData, gasLimit, gasUsed, hash, miner, prevRandao, nonce, number, parentHash, parentBeaconBlockRoot, stateRoot, receiptsRoot, timestamp, transactions } = this; return { _type: "Block", baseFeePerGas: toJson(baseFeePerGas), difficulty: toJson(difficulty), extraData, gasLimit: toJson(gasLimit), gasUsed: toJson(gasUsed), blobGasUsed: toJson(this.blobGasUsed), excessBlobGas: toJson(this.excessBlobGas), hash, miner, prevRandao, nonce, number, parentHash, timestamp, parentBeaconBlockRoot, stateRoot, receiptsRoot, transactions }; } [Symbol.iterator]() { let index = 0; const txs = this.transactions; return { next: () => { if (index < this.length) { return { value: txs[index++], done: false }; } return { value: undefined, done: true }; } }; } /** * The number of transactions in this block. */ get length() { return this.#transactions.length; } /** * The [[link-js-date]] this block was included at. */ get date() { if (this.timestamp == null) { return null; } return new Date(this.timestamp * 1000); } /** * Get the transaction at %%indexe%% within this block. */ async getTransaction(indexOrHash) { // Find the internal value by its index or hash let tx = undefined; if (typeof indexOrHash === "number") { tx = this.#transactions[indexOrHash]; } else { const hash = indexOrHash.toLowerCase(); for (const v of this.#transactions) { if (typeof v === "string") { if (v !== hash) { continue; } tx = v; break; } else { if (v.hash === hash) { continue; } tx = v; break; } } } if (tx == null) { throw new Error("no such tx"); } if (typeof tx === "string") { return await this.provider.getTransaction(tx); } else { return tx; } } /** * If a **Block** was fetched with a request to include the transactions * this will allow synchronous access to those transactions. * * If the transactions were not prefetched, this will throw. */ getPrefetchedTransaction(indexOrHash) { const txs = this.prefetchedTransactions; if (typeof indexOrHash === "number") { return txs[indexOrHash]; } indexOrHash = indexOrHash.toLowerCase(); for (const tx of txs) { if (tx.hash === indexOrHash) { return tx; } } assertArgument(false, "no matching transaction", "indexOrHash", indexOrHash); } /** * Returns true if this block been mined. This provides a type guard * for all properties on a [[MinedBlock]]. */ isMined() { return !!this.hash; } /** * Returns true if this block is an [[link-eip-2930]] block. */ isLondon() { return !!this.baseFeePerGas; } /** * @_ignore: */ orphanedEvent() { if (!this.isMined()) { throw new Error(""); } return createOrphanedBlockFilter(this); } } ////////////////////// // Log /** * A **Log** in Ethereum represents an event that has been included in a * transaction using the ``LOG*`` opcodes, which are most commonly used by * Solidity's emit for announcing events. */ class Log { /** * The provider connected to the log used to fetch additional details * if necessary. */ provider; /** * The transaction hash of the transaction this log occurred in. Use the * [[Log-getTransaction]] to get the [[TransactionResponse]]. */ transactionHash; /** * The block hash of the block this log occurred in. Use the * [[Log-getBlock]] to get the [[Block]]. */ blockHash; /** * The block number of the block this log occurred in. It is preferred * to use the [[Block-hash]] when fetching the related [[Block]], * since in the case of an orphaned block, the block at that height may * have changed. */ blockNumber; /** * If the **Log** represents a block that was removed due to an orphaned * block, this will be true. * * This can only happen within an orphan event listener. */ removed; /** * The address of the contract that emitted this log. */ address; /** * The data included in this log when it was emitted. */ data; /** * The indexed topics included in this log when it was emitted. * * All topics are included in the bloom filters, so they can be * efficiently filtered using the [[Provider-getLogs]] method. */ topics; /** * The index within the block this log occurred at. This is generally * not useful to developers, but can be used with the various roots * to proof inclusion within a block. */ index; /** * The index within the transaction of this log. */ transactionIndex; /** * @_ignore: */ constructor(log, provider) { this.provider = provider; const topics = Object.freeze(log.topics.slice()); defineProperties(this, { transactionHash: log.transactionHash, blockHash: log.blockHash, blockNumber: log.blockNumber, removed: log.removed, address: log.address, data: log.data, topics, index: log.index, transactionIndex: log.transactionIndex }); } /** * Returns a JSON-compatible object. */ toJSON() { const { address, blockHash, blockNumber, data, index, removed, topics, transactionHash, transactionIndex } = this; return { _type: "log", address, blockHash, blockNumber, data, index, removed, topics, transactionHash, transactionIndex }; } /** * Returns the block that this log occurred in. */ async getBlock() { const block = await this.provider.getBlock(this.blockHash); assert(!!block, "failed to find transaction", "UNKNOWN_ERROR", {}); return block; } /** * Returns the transaction that this log occurred in. */ async getTransaction() { const tx = await this.provider.getTransaction(this.transactionHash); assert(!!tx, "failed to find transaction", "UNKNOWN_ERROR", {}); return tx; } /** * Returns the transaction receipt fot the transaction that this * log occurred in. */ async getTransactionReceipt() { const receipt = await this.provider.getTransactionReceipt(this.transactionHash); assert(!!receipt, "failed to find transaction receipt", "UNKNOWN_ERROR", {}); return receipt; } /** * @_ignore: */ removedEvent() { return createRemovedLogFilter(this); } } ////////////////////// // Transaction Receipt /* export interface LegacyTransactionReceipt { byzantium: false; status: null; root: string; } export interface ByzantiumTransactionReceipt { byzantium: true; status: number; root: null; } */ /** * A **TransactionReceipt** includes additional information about a * transaction that is only available after it has been mined. */ class TransactionReceipt { /** * The provider connected to the log used to fetch additional details * if necessary. */ provider; /** * The address the transaction was sent to. */ to; /** * The sender of the transaction. */ from; /** * The address of the contract if the transaction was directly * responsible for deploying one. * * This is non-null **only** if the ``to`` is empty and the ``data`` * was successfully executed as initcode. */ contractAddress; /** * The transaction hash. */ hash; /** * The index of this transaction within the block transactions. */ index; /** * The block hash of the [[Block]] this transaction was included in. */ blockHash; /** * The block number of the [[Block]] this transaction was included in. */ blockNumber; /** * The bloom filter bytes that represent all logs that occurred within * this transaction. This is generally not useful for most developers, * but can be used to validate the included logs. */ logsBloom; /** * The actual amount of gas used by this transaction. * * When creating a transaction, the amount of gas that will be used can * only be approximated, but the sender must pay the gas fee for the * entire gas limit. After the transaction, the difference is refunded. */ gasUsed; /** * The gas used for BLObs. See [[link-eip-4844]]. */ blobGasUsed; /** * The amount of gas used by all transactions within the block for this * and all transactions with a lower ``index``. * * This is generally not useful for developers but can be used to * validate certain aspects of execution. */ cumulativeGasUsed; /** * The actual gas price used during execution. * * Due to the complexity of [[link-eip-1559]] this value can only * be caluclated after the transaction has been mined, snce the base * fee is protocol-enforced. */ gasPrice; /** * The price paid per BLOB in gas. See [[link-eip-4844]]. */ blobGasPrice; /** * The [[link-eip-2718]] transaction type. */ type; //readonly byzantium!: boolean; /** * The status of this transaction, indicating success (i.e. ``1``) or * a revert (i.e. ``0``). * * This is available in post-byzantium blocks, but some backends may * backfill this value. */ status; /** * The root hash of this transaction. * * This is no present and was only included in pre-byzantium blocks, but * could be used to validate certain parts of the receipt. */ root; #logs; /** * @_ignore: */ constructor(tx, provider) { this.#logs = Object.freeze(tx.logs.map(log => { return new Log(log, provider); })); let gasPrice = BN_0$2; if (tx.effectiveGasPrice != null) { gasPrice = tx.effectiveGasPrice; } else if (tx.gasPrice != null) { gasPrice = tx.gasPrice; } defineProperties(this, { provider, to: tx.to, from: tx.from, contractAddress: tx.contractAddress, hash: tx.hash, index: tx.index, blockHash: tx.blockHash, blockNumber: tx.blockNumber, logsBloom: tx.logsBloom, gasUsed: tx.gasUsed, cumulativeGasUsed: tx.cumulativeGasUsed, blobGasUsed: tx.blobGasUsed, gasPrice, blobGasPrice: tx.blobGasPrice, type: tx.type, //byzantium: tx.byzantium, status: tx.status, root: tx.root }); } /** * The logs for this transaction. */ get logs() { return this.#logs; } /** * Returns a JSON-compatible representation. */ toJSON() { const { to, from, contractAddress, hash, index, blockHash, blockNumber, logsBloom, logs, //byzantium, status, root } = this; return { _type: "TransactionReceipt", blockHash, blockNumber, //byzantium, contractAddress, cumulativeGasUsed: toJson(this.cumulativeGasUsed), from, gasPrice: toJson(this.gasPrice), blobGasUsed: toJson(this.blobGasUsed), blobGasPrice: toJson(this.blobGasPrice), gasUsed: toJson(this.gasUsed), hash, index, logs, logsBloom, root, status, to }; } /** * @_ignore: */ get length() { return this.logs.length; } [Symbol.iterator]() { let index = 0; return { next: () => { if (index < this.length) { return { value: this.logs[index++], done: false }; } return { value: undefined, done: true }; } }; } /** * The total fee for this transaction, in wei. */ get fee() { return this.gasUsed * this.gasPrice; } /** * Resolves to the block this transaction occurred in. */ async getBlock() { const block = await this.provider.getBlock(this.blockHash); if (block == null) { throw new Error("TODO"); } return block; } /** * Resolves to the transaction this transaction occurred in. */ async getTransaction() { const tx = await this.provider.getTransaction(this.hash); if (tx == null) { throw new Error("TODO"); } return tx; } /** * Resolves to the return value of the execution of this transaction. * * Support for this feature is limited, as it requires an archive node * with the ``debug_`` or ``trace_`` API enabled. */ async getResult() { return await this.provider.getTransactionResult(this.hash); } /** * Resolves to the number of confirmations this transaction has. */ async confirmations() { return (await this.provider.getBlockNumber()) - this.blockNumber + 1; } /** * @_ignore: */ removedEvent() { return createRemovedTransactionFilter(this); } /** * @_ignore: */ reorderedEvent(other) { assert(!other || other.isMined(), "unmined 'other' transction cannot be orphaned", "UNSUPPORTED_OPERATION", { operation: "reorderedEvent(other)" }); return createReorderedTransactionFilter(this, other); } } /** * A **TransactionResponse** includes all properties about a transaction * that was sent to the network, which may or may not be included in a * block. * * The [[TransactionResponse-isMined]] can be used to check if the * transaction has been mined as well as type guard that the otherwise * possibly ``null`` properties are defined. */ class TransactionResponse { /** * The provider this is connected to, which will influence how its * methods will resolve its async inspection methods. */ provider; /** * The block number of the block that this transaction was included in. * * This is ``null`` for pending transactions. */ blockNumber; /** * The blockHash of the block that this transaction was included in. * * This is ``null`` for pending transactions. */ blockHash; /** * The index within the block that this transaction resides at. */ index; /** * The transaction hash. */ hash; /** * The [[link-eip-2718]] transaction envelope type. This is * ``0`` for legacy transactions types. */ type; /** * The receiver of this transaction. * * If ``null``, then the transaction is an initcode transaction. * This means the result of executing the [[data]] will be deployed * as a new contract on chain (assuming it does not revert) and the * address may be computed using [[getCreateAddress]]. */ to; /** * The sender of this transaction. It is implicitly computed * from the transaction pre-image hash (as the digest) and the * [[signature]] using ecrecover. */ from; /** * The nonce, which is used to prevent replay attacks and offer * a method to ensure transactions from a given sender are explicitly * ordered. * * When sending a transaction, this must be equal to the number of * transactions ever sent by [[from]]. */ nonce; /** * The maximum units of gas this transaction can consume. If execution * exceeds this, the entries transaction is reverted and the sender * is charged for the full amount, despite not state changes being made. */ gasLimit; /** * The gas price can have various values, depending on the network. * * In modern networks, for transactions that are included this is * the //effective gas price// (the fee per gas that was actually * charged), while for transactions that have not been included yet * is the [[maxFeePerGas]]. * * For legacy transactions, or transactions on legacy networks, this * is the fee that will be charged per unit of gas the transaction * consumes. */ gasPrice; /** * The maximum priority fee (per unit of gas) to allow a * validator to charge the sender. This is inclusive of the * [[maxFeeFeePerGas]]. */ maxPriorityFeePerGas; /** * The maximum fee (per unit of gas) to allow this transaction * to charge the sender. */ maxFeePerGas; /** * The [[link-eip-4844]] max fee per BLOb gas. */ maxFeePerBlobGas; /** * The data. */ data; /** * The value, in wei. Use [[formatEther]] to format this value * as ether. */ value; /** * The chain ID. */ chainId; /** * The signature. */ signature; /** * The [[link-eip-2930]] access list for transaction types that * support it, otherwise ``null``. */ accessList; /** * The [[link-eip-4844]] BLOb versioned hashes. */ blobVersionedHashes; #startBlock; /** * @_ignore: */ constructor(tx, provider) { this.provider = provider; this.blockNumber = tx.blockNumber != null ? tx.blockNumber : null; this.blockHash = tx.blockHash != null ? tx.blockHash : null; this.hash = tx.hash; this.index = tx.index; this.type = tx.type; this.from = tx.from; this.to = tx.to || null; this.gasLimit = tx.gasLimit; this.nonce = tx.nonce; this.data = tx.data; this.value = tx.value; this.gasPrice = tx.gasPrice; this.maxPriorityFeePerGas = tx.maxPriorityFeePerGas != null ? tx.maxPriorityFeePerGas : null; this.maxFeePerGas = tx.maxFeePerGas != null ? tx.maxFeePerGas : null; this.maxFeePerBlobGas = tx.maxFeePerBlobGas != null ? tx.maxFeePerBlobGas : null; this.chainId = tx.chainId; this.signature = tx.signature; this.accessList = tx.accessList != null ? tx.accessList : null; this.blobVersionedHashes = tx.blobVersionedHashes != null ? tx.blobVersionedHashes : null; this.#startBlock = -1; } /** * Returns a JSON-compatible representation of this transaction. */ toJSON() { const { blockNumber, blockHash, index, hash, type, to, from, nonce, data, signature, accessList, blobVersionedHashes } = this; return { _type: "TransactionResponse", accessList, blockNumber, blockHash, blobVersionedHashes, chainId: toJson(this.chainId), data, from, gasLimit: toJson(this.gasLimit), gasPrice: toJson(this.gasPrice), hash, maxFeePerGas: toJson(this.maxFeePerGas), maxPriorityFeePerGas: toJson(this.maxPriorityFeePerGas), maxFeePerBlobGas: toJson(this.maxFeePerBlobGas), nonce, signature, to, index, type, value: toJson(this.value) }; } /** * Resolves to the Block that this transaction was included in. * * This will return null if the transaction has not been included yet. */ async getBlock() { let blockNumber = this.blockNumber; if (blockNumber == null) { const tx = await this.getTransaction(); if (tx) { blockNumber = tx.blockNumber; } } if (blockNumber == null) { return null; } const block = this.provider.getBlock(blockNumber); if (block == null) { throw new Error("TODO"); } return block; } /** * Resolves to this transaction being re-requested from the * provider. This can be used if you have an unmined transaction * and wish to get an up-to-date populated instance. */ async getTransaction() { return this.provider.getTransaction(this.hash); } /** * Resolve to the number of confirmations this transaction has. */ async confirmations() { if (this.blockNumber == null) { const { tx, blockNumber } = await resolveProperties({ tx: this.getTransaction(), blockNumber: this.provider.getBlockNumber() }); // Not mined yet... if (tx == null || tx.blockNumber == null) { return 0; } return blockNumber - tx.blockNumber + 1; } const blockNumber = await this.provider.getBlockNumber(); return blockNumber - this.blockNumber + 1; } /** * Resolves once this transaction has been mined and has * %%confirms%% blocks including it (default: ``1``) with an * optional %%timeout%%. * * This can resolve to ``null`` only if %%confirms%% is ``0`` * and the transaction has not been mined, otherwise this will * wait until enough confirmations have completed. */ async wait(_confirms, _timeout) { const confirms = _confirms == null ? 1 : _confirms; const timeout = _timeout == null ? 0 : _timeout; let startBlock = this.#startBlock; let nextScan = -1; let stopScanning = startBlock === -1 ? true : false; const checkReplacement = async () => { // Get the current transaction count for this sender if (stopScanning) { return null; } const { blockNumber, nonce } = await resolveProperties({ blockNumber: this.provider.getBlockNumber(), nonce: this.provider.getTransactionCount(this.from) }); // No transaction or our nonce has not been mined yet; but we // can start scanning later when we do start if (nonce < this.nonce) { startBlock = blockNumber; return; } // We were mined; no replacement if (stopScanning) { return null; } const mined = await this.getTransaction(); if (mined && mined.blockNumber != null) { return; } // We were replaced; start scanning for that transaction // Starting to scan; look back a few extra blocks for safety if (nextScan === -1) { nextScan = startBlock - 3; if (nextScan < this.#startBlock) { nextScan = this.#startBlock; } } while (nextScan <= blockNumber) { // Get the next block to scan if (stopScanning) { return null; } const block = await this.provider.getBlock(nextScan, true); // This should not happen; but we'll try again shortly if (block == null) { return; } // We were mined; no replacement for (const hash of block) { if (hash === this.hash) { return; } } // Search for the transaction that replaced us for (let i = 0; i < block.length; i++) { const tx = await block.getTransaction(i); if (tx.from === this.from && tx.nonce === this.nonce) { // Get the receipt if (stopScanning) { return null; } const receipt = await this.provider.getTransactionReceipt(tx.hash); // This should not happen; but we'll try again shortly if (receipt == null) { return; } // We will retry this on the next block (this case could be optimized) if (blockNumber - receipt.blockNumber + 1 < confirms) { return; } // The reason we were replaced let reason = "replaced"; if (tx.data === this.data && tx.to === this.to && tx.value === this.value) { reason = "repriced"; } else if (tx.data === "0x" && tx.from === tx.to && tx.value === BN_0$2) { reason = "cancelled"; } assert(false, "transaction was replaced", "TRANSACTION_REPLACED", { cancelled: reason === "replaced" || reason === "cancelled", reason, replacement: tx.replaceableTransaction(startBlock), hash: tx.hash, receipt }); } } nextScan++; } return; }; const checkReceipt = receipt => { if (receipt == null || receipt.status !== 0) { return receipt; } assert(false, "transaction execution reverted", "CALL_EXCEPTION", { action: "sendTransaction", data: null, reason: null, invocation: null, revert: null, transaction: { to: receipt.to, from: receipt.from, data: "" // @TODO: in v7, split out sendTransaction properties }, receipt }); }; const receipt = await this.provider.getTransactionReceipt(this.hash); if (confirms === 0) { return checkReceipt(receipt); } if (receipt) { if ((await receipt.confirmations()) >= confirms) { return checkReceipt(receipt); } } else { // Check for a replacement; throws if a replacement was found await checkReplacement(); // Allow null only when the confirms is 0 if (confirms === 0) { return null; } } const waiter = new Promise((resolve, reject) => { // List of things to cancel when we have a result (one way or the other) const cancellers = []; const cancel = () => { cancellers.forEach(c => c()); }; // On cancel, stop scanning for replacements cancellers.push(() => { stopScanning = true; }); // Set up any timeout requested if (timeout > 0) { const timer = setTimeout(() => { cancel(); reject(makeError("wait for transaction timeout", "TIMEOUT")); }, timeout); cancellers.push(() => { clearTimeout(timer); }); } const txListener = async receipt => { // Done; return it! if ((await receipt.confirmations()) >= confirms) { cancel(); try { resolve(checkReceipt(receipt)); } catch (error) { reject(error); } } }; cancellers.push(() => { this.provider.off(this.hash, txListener); }); this.provider.on(this.hash, txListener); // We support replacement detection; start checking if (startBlock >= 0) { const replaceListener = async () => { try { // Check for a replacement; this throws only if one is found await checkReplacement(); } catch (error) { // We were replaced (with enough confirms); re-throw the error if (isError(error, "TRANSACTION_REPLACED")) { cancel(); reject(error); return; } } // Rescheudle a check on the next block if (!stopScanning) { this.provider.once("block", replaceListener); } }; cancellers.push(() => { this.provider.off("block", replaceListener); }); this.provider.once("block", replaceListener); } }); return await waiter; } /** * Returns ``true`` if this transaction has been included. * * This is effective only as of the time the TransactionResponse * was instantiated. To get up-to-date information, use * [[getTransaction]]. * * This provides a Type Guard that this transaction will have * non-null property values for properties that are null for * unmined transactions. */ isMined() { return this.blockHash != null; } /** * Returns true if the transaction is a legacy (i.e. ``type == 0``) * transaction. * * This provides a Type Guard that this transaction will have * the ``null``-ness for hardfork-specific properties set correctly. */ isLegacy() { return this.type === 0; } /** * Returns true if the transaction is a Berlin (i.e. ``type == 1``) * transaction. See [[link-eip-2070]]. * * This provides a Type Guard that this transaction will have * the ``null``-ness for hardfork-specific properties set correctly. */ isBerlin() { return this.type === 1; } /** * Returns true if the transaction is a London (i.e. ``type == 2``) * transaction. See [[link-eip-1559]]. * * This provides a Type Guard that this transaction will have * the ``null``-ness for hardfork-specific properties set correctly. */ isLondon() { return this.type === 2; } /** * Returns true if hte transaction is a Cancun (i.e. ``type == 3``) * transaction. See [[link-eip-4844]]. */ isCancun() { return this.type === 3; } /** * Returns a filter which can be used to listen for orphan events * that evict this transaction. */ removedEvent() { assert(this.isMined(), "unmined transaction canot be orphaned", "UNSUPPORTED_OPERATION", { operation: "removeEvent()" }); return createRemovedTransactionFilter(this); } /** * Returns a filter which can be used to listen for orphan events * that re-order this event against %%other%%. */ reorderedEvent(other) { assert(this.isMined(), "unmined transaction canot be orphaned", "UNSUPPORTED_OPERATION", { operation: "removeEvent()" }); assert(!other || other.isMined(), "unmined 'other' transaction canot be orphaned", "UNSUPPORTED_OPERATION", { operation: "removeEvent()" }); return createReorderedTransactionFilter(this, other); } /** * Returns a new TransactionResponse instance which has the ability to * detect (and throw an error) if the transaction is replaced, which * will begin scanning at %%startBlock%%. * * This should generally not be used by developers and is intended * primarily for internal use. Setting an incorrect %%startBlock%% can * have devastating performance consequences if used incorrectly. */ replaceableTransaction(startBlock) { assertArgument(Number.isInteger(startBlock) && startBlock >= 0, "invalid startBlock", "startBlock", startBlock); const tx = new TransactionResponse(this, this.provider); tx.#startBlock = startBlock; return tx; } } function createOrphanedBlockFilter(block) { return { orphan: "drop-block", hash: block.hash, number: block.number }; } function createReorderedTransactionFilter(tx, other) { return { orphan: "reorder-transaction", tx, other }; } function createRemovedTransactionFilter(tx) { return { orphan: "drop-transaction", tx }; } function createRemovedLogFilter(log) { return { orphan: "drop-log", log: { transactionHash: log.transactionHash, blockHash: log.blockHash, blockNumber: log.blockNumber, address: log.address, data: log.data, topics: Object.freeze(log.topics.slice()), index: log.index } }; } // import from provider.ts instead of index.ts to prevent circular dep // from EtherscanProvider /** * An **EventLog** contains additional properties parsed from the [[Log]]. */ class EventLog extends Log { /** * The Contract Interface. */ interface; /** * The matching event. */ fragment; /** * The parsed arguments passed to the event by ``emit``. */ args; /** * @_ignore: */ constructor(log, iface, fragment) { super(log, log.provider); const args = iface.decodeEventLog(fragment, log.data, log.topics); defineProperties(this, { args, fragment, interface: iface }); } /** * The name of the event. */ get eventName() { return this.fragment.name; } /** * The signature of the event. */ get eventSignature() { return this.fragment.format(); } } /** * An **EventLog** contains additional properties parsed from the [[Log]]. */ class UndecodedEventLog extends Log { /** * The error encounted when trying to decode the log. */ error; /** * @_ignore: */ constructor(log, error) { super(log, log.provider); defineProperties(this, { error }); } } /** * A **ContractTransactionReceipt** includes the parsed logs from a * [[TransactionReceipt]]. */ class ContractTransactionReceipt extends TransactionReceipt { #iface; /** * @_ignore: */ constructor(iface, provider, tx) { super(tx, provider); this.#iface = iface; } /** * The parsed logs for any [[Log]] which has a matching event in the * Contract ABI. */ get logs() { return super.logs.map(log => { const fragment = log.topics.length ? this.#iface.getEvent(log.topics[0]) : null; if (fragment) { try { return new EventLog(log, this.#iface, fragment); } catch (error) { return new UndecodedEventLog(log, error); } } return log; }); } } /** * A **ContractTransactionResponse** will return a * [[ContractTransactionReceipt]] when waited on. */ class ContractTransactionResponse extends TransactionResponse { #iface; /** * @_ignore: */ constructor(iface, provider, tx) { super(tx, provider); this.#iface = iface; } /** * Resolves once this transaction has been mined and has * %%confirms%% blocks including it (default: ``1``) with an * optional %%timeout%%. * * This can resolve to ``null`` only if %%confirms%% is ``0`` * and the transaction has not been mined, otherwise this will * wait until enough confirmations have completed. */ async wait(confirms, timeout) { const receipt = await super.wait(confirms, timeout); if (receipt == null) { return null; } return new ContractTransactionReceipt(this.#iface, this.provider, receipt); } } /** * A **ContractUnknownEventPayload** is included as the last parameter to * Contract Events when the event does not match any events in the ABI. */ class ContractUnknownEventPayload extends EventPayload { /** * The log with no matching events. */ log; /** * @_event: */ constructor(contract, listener, filter, log) { super(contract, listener, filter); defineProperties(this, { log }); } /** * Resolves to the block the event occured in. */ async getBlock() { return await this.log.getBlock(); } /** * Resolves to the transaction the event occured in. */ async getTransaction() { return await this.log.getTransaction(); } /** * Resolves to the transaction receipt the event occured in. */ async getTransactionReceipt() { return await this.log.getTransactionReceipt(); } } /** * A **ContractEventPayload** is included as the last parameter to * Contract Events when the event is known. */ class ContractEventPayload extends ContractUnknownEventPayload { /** * @_ignore: */ constructor(contract, listener, filter, fragment, _log) { super(contract, listener, filter, new EventLog(_log, contract.interface, fragment)); const args = contract.interface.decodeEventLog(fragment, this.log.data, this.log.topics); defineProperties(this, { args, fragment }); } /** * The event name. */ get eventName() { return this.fragment.name; } /** * The event signature. */ get eventSignature() { return this.fragment.format(); } } const BN_0$1 = BigInt(0); function canCall(value) { return value && typeof value.call === "function"; } function canEstimate(value) { return value && typeof value.estimateGas === "function"; } function canResolve(value) { return value && typeof value.resolveName === "function"; } function canSend(value) { return value && typeof value.sendTransaction === "function"; } function getResolver(value) { if (value != null) { if (canResolve(value)) { return value; } if (value.provider) { return value.provider; } } return undefined; } class PreparedTopicFilter { #filter; fragment; constructor(contract, fragment, args) { defineProperties(this, { fragment }); if (fragment.inputs.length < args.length) { throw new Error("too many arguments"); } // Recursively descend into args and resolve any addresses const runner = getRunner(contract.runner, "resolveName"); const resolver = canResolve(runner) ? runner : null; this.#filter = async function () { const resolvedArgs = await Promise.all(fragment.inputs.map((param, index) => { const arg = args[index]; if (arg == null) { return null; } return param.walkAsync(args[index], (type, value) => { if (type === "address") { if (Array.isArray(value)) { return Promise.all(value.map(v => resolveAddress(v, resolver))); } return resolveAddress(value, resolver); } return value; }); })); return contract.interface.encodeFilterTopics(fragment, resolvedArgs); }(); } getTopicFilter() { return this.#filter; } } // A = Arguments passed in as a tuple // R = The result type of the call (i.e. if only one return type, // the qualified type, otherwise Result) // D = The type the default call will return (i.e. R for view/pure, // TransactionResponse otherwise) //export interface ContractMethod = Array, R = any, D extends R | ContractTransactionResponse = ContractTransactionResponse> { function getRunner(value, feature) { if (value == null) { return null; } if (typeof value[feature] === "function") { return value; } if (value.provider && typeof value.provider[feature] === "function") { return value.provider; } return null; } function getProvider(value) { if (value == null) { return null; } return value.provider || null; } /** * @_ignore: */ async function copyOverrides(arg, allowed) { // Make sure the overrides passed in are a valid overrides object const _overrides = Typed.dereference(arg, "overrides"); assertArgument(typeof _overrides === "object", "invalid overrides parameter", "overrides", arg); // Create a shallow copy (we'll deep-ify anything needed during normalizing) const overrides = copyRequest(_overrides); assertArgument(overrides.to == null || (allowed || []).indexOf("to") >= 0, "cannot override to", "overrides.to", overrides.to); assertArgument(overrides.data == null || (allowed || []).indexOf("data") >= 0, "cannot override data", "overrides.data", overrides.data); // Resolve any from if (overrides.from) { overrides.from = overrides.from; } return overrides; } /** * @_ignore: */ async function resolveArgs(_runner, inputs, args) { // Recursively descend into args and resolve any addresses const runner = getRunner(_runner, "resolveName"); const resolver = canResolve(runner) ? runner : null; return await Promise.all(inputs.map((param, index) => { return param.walkAsync(args[index], (type, value) => { value = Typed.dereference(value, type); if (type === "address") { return resolveAddress(value, resolver); } return value; }); })); } function buildWrappedFallback(contract) { const populateTransaction = async function (overrides) { // If an overrides was passed in, copy it and normalize the values const tx = await copyOverrides(overrides, ["data"]); tx.to = await contract.getAddress(); if (tx.from) { tx.from = await resolveAddress(tx.from, getResolver(contract.runner)); } const iface = contract.interface; const noValue = getBigInt(tx.value || BN_0$1, "overrides.value") === BN_0$1; const noData = (tx.data || "0x") === "0x"; if (iface.fallback && !iface.fallback.payable && iface.receive && !noData && !noValue) { assertArgument(false, "cannot send data to receive or send value to non-payable fallback", "overrides", overrides); } assertArgument(iface.fallback || noData, "cannot send data to receive-only contract", "overrides.data", tx.data); // Only allow payable contracts to set non-zero value const payable = iface.receive || iface.fallback && iface.fallback.payable; assertArgument(payable || noValue, "cannot send value to non-payable fallback", "overrides.value", tx.value); // Only allow fallback contracts to set non-empty data assertArgument(iface.fallback || noData, "cannot send data to receive-only contract", "overrides.data", tx.data); return tx; }; const staticCall = async function (overrides) { const runner = getRunner(contract.runner, "call"); assert(canCall(runner), "contract runner does not support calling", "UNSUPPORTED_OPERATION", { operation: "call" }); const tx = await populateTransaction(overrides); try { return await runner.call(tx); } catch (error) { if (isCallException(error) && error.data) { throw contract.interface.makeError(error.data, tx); } throw error; } }; const send = async function (overrides) { const runner = contract.runner; assert(canSend(runner), "contract runner does not support sending transactions", "UNSUPPORTED_OPERATION", { operation: "sendTransaction" }); const tx = await runner.sendTransaction(await populateTransaction(overrides)); const provider = getProvider(contract.runner); // @TODO: the provider can be null; make a custom dummy provider that will throw a // meaningful error return new ContractTransactionResponse(contract.interface, provider, tx); }; const estimateGas = async function (overrides) { const runner = getRunner(contract.runner, "estimateGas"); assert(canEstimate(runner), "contract runner does not support gas estimation", "UNSUPPORTED_OPERATION", { operation: "estimateGas" }); return await runner.estimateGas(await populateTransaction(overrides)); }; const method = async overrides => { return await send(overrides); }; defineProperties(method, { _contract: contract, estimateGas, populateTransaction, send, staticCall }); return method; } function buildWrappedMethod(contract, key) { const getFragment = function (...args) { const fragment = contract.interface.getFunction(key, args); assert(fragment, "no matching fragment", "UNSUPPORTED_OPERATION", { operation: "fragment", info: { key, args } }); return fragment; }; const populateTransaction = async function (...args) { const fragment = getFragment(...args); // If an overrides was passed in, copy it and normalize the values let overrides = {}; if (fragment.inputs.length + 1 === args.length) { overrides = await copyOverrides(args.pop()); if (overrides.from) { overrides.from = await resolveAddress(overrides.from, getResolver(contract.runner)); } } if (fragment.inputs.length !== args.length) { throw new Error("internal error: fragment inputs doesn't match arguments; should not happen"); } const resolvedArgs = await resolveArgs(contract.runner, fragment.inputs, args); return Object.assign({}, overrides, await resolveProperties({ to: contract.getAddress(), data: contract.interface.encodeFunctionData(fragment, resolvedArgs) })); }; const staticCall = async function (...args) { const result = await staticCallResult(...args); if (result.length === 1) { return result[0]; } return result; }; const send = async function (...args) { const runner = contract.runner; assert(canSend(runner), "contract runner does not support sending transactions", "UNSUPPORTED_OPERATION", { operation: "sendTransaction" }); const tx = await runner.sendTransaction(await populateTransaction(...args)); const provider = getProvider(contract.runner); // @TODO: the provider can be null; make a custom dummy provider that will throw a // meaningful error return new ContractTransactionResponse(contract.interface, provider, tx); }; const estimateGas = async function (...args) { const runner = getRunner(contract.runner, "estimateGas"); assert(canEstimate(runner), "contract runner does not support gas estimation", "UNSUPPORTED_OPERATION", { operation: "estimateGas" }); return await runner.estimateGas(await populateTransaction(...args)); }; const staticCallResult = async function (...args) { const runner = getRunner(contract.runner, "call"); assert(canCall(runner), "contract runner does not support calling", "UNSUPPORTED_OPERATION", { operation: "call" }); const tx = await populateTransaction(...args); let result = "0x"; try { result = await runner.call(tx); } catch (error) { if (isCallException(error) && error.data) { throw contract.interface.makeError(error.data, tx); } throw error; } const fragment = getFragment(...args); return contract.interface.decodeFunctionResult(fragment, result); }; const method = async (...args) => { const fragment = getFragment(...args); if (fragment.constant) { return await staticCall(...args); } return await send(...args); }; defineProperties(method, { name: contract.interface.getFunctionName(key), _contract: contract, _key: key, getFragment, estimateGas, populateTransaction, send, staticCall, staticCallResult }); // Only works on non-ambiguous keys (refined fragment is always non-ambiguous) Object.defineProperty(method, "fragment", { configurable: false, enumerable: true, get: () => { const fragment = contract.interface.getFunction(key); assert(fragment, "no matching fragment", "UNSUPPORTED_OPERATION", { operation: "fragment", info: { key } }); return fragment; } }); return method; } function buildWrappedEvent(contract, key) { const getFragment = function (...args) { const fragment = contract.interface.getEvent(key, args); assert(fragment, "no matching fragment", "UNSUPPORTED_OPERATION", { operation: "fragment", info: { key, args } }); return fragment; }; const method = function (...args) { return new PreparedTopicFilter(contract, getFragment(...args), args); }; defineProperties(method, { name: contract.interface.getEventName(key), _contract: contract, _key: key, getFragment }); // Only works on non-ambiguous keys (refined fragment is always non-ambiguous) Object.defineProperty(method, "fragment", { configurable: false, enumerable: true, get: () => { const fragment = contract.interface.getEvent(key); assert(fragment, "no matching fragment", "UNSUPPORTED_OPERATION", { operation: "fragment", info: { key } }); return fragment; } }); return method; } // The combination of TypeScrype, Private Fields and Proxies makes // the world go boom; so we hide variables with some trickery keeping // a symbol attached to each BaseContract which its sub-class (even // via a Proxy) can reach and use to look up its internal values. const internal = Symbol.for("_ethersInternal_contract"); const internalValues = new WeakMap(); function setInternal(contract, values) { internalValues.set(contract[internal], values); } function getInternal(contract) { return internalValues.get(contract[internal]); } function isDeferred(value) { return value && typeof value === "object" && "getTopicFilter" in value && typeof value.getTopicFilter === "function" && value.fragment; } async function getSubInfo(contract, event) { let topics; let fragment = null; // Convert named events to topicHash and get the fragment for // events which need deconstructing. if (Array.isArray(event)) { const topicHashify = function (name) { if (isHexString(name, 32)) { return name; } const fragment = contract.interface.getEvent(name); assertArgument(fragment, "unknown fragment", "name", name); return fragment.topicHash; }; // Array of Topics and Names; e.g. `[ "0x1234...89ab", "Transfer(address)" ]` topics = event.map(e => { if (e == null) { return null; } if (Array.isArray(e)) { return e.map(topicHashify); } return topicHashify(e); }); } else if (event === "*") { topics = [null]; } else if (typeof event === "string") { if (isHexString(event, 32)) { // Topic Hash topics = [event]; } else { // Name or Signature; e.g. `"Transfer", `"Transfer(address)"` fragment = contract.interface.getEvent(event); assertArgument(fragment, "unknown fragment", "event", event); topics = [fragment.topicHash]; } } else if (isDeferred(event)) { // Deferred Topic Filter; e.g. `contract.filter.Transfer(from)` topics = await event.getTopicFilter(); } else if ("fragment" in event) { // ContractEvent; e.g. `contract.filter.Transfer` fragment = event.fragment; topics = [fragment.topicHash]; } else { assertArgument(false, "unknown event name", "event", event); } // Normalize topics and sort TopicSets topics = topics.map(t => { if (t == null) { return null; } if (Array.isArray(t)) { const items = Array.from(new Set(t.map(t => t.toLowerCase())).values()); if (items.length === 1) { return items[0]; } items.sort(); return items; } return t.toLowerCase(); }); const tag = topics.map(t => { if (t == null) { return "null"; } if (Array.isArray(t)) { return t.join("|"); } return t; }).join("&"); return { fragment, tag, topics }; } async function hasSub(contract, event) { const { subs } = getInternal(contract); return subs.get((await getSubInfo(contract, event)).tag) || null; } async function getSub(contract, operation, event) { // Make sure our runner can actually subscribe to events const provider = getProvider(contract.runner); assert(provider, "contract runner does not support subscribing", "UNSUPPORTED_OPERATION", { operation }); const { fragment, tag, topics } = await getSubInfo(contract, event); const { addr, subs } = getInternal(contract); let sub = subs.get(tag); if (!sub) { const address = addr ? addr : contract; const filter = { address, topics }; const listener = log => { let foundFragment = fragment; if (foundFragment == null) { try { foundFragment = contract.interface.getEvent(log.topics[0]); } catch (error) {} } // If fragment is null, we do not deconstruct the args to emit if (foundFragment) { const _foundFragment = foundFragment; const args = fragment ? contract.interface.decodeEventLog(fragment, log.data, log.topics) : []; emit(contract, event, args, listener => { return new ContractEventPayload(contract, listener, event, _foundFragment, log); }); } else { emit(contract, event, [], listener => { return new ContractUnknownEventPayload(contract, listener, event, log); }); } }; let starting = []; const start = () => { if (starting.length) { return; } starting.push(provider.on(filter, listener)); }; const stop = async () => { if (starting.length == 0) { return; } let started = starting; starting = []; await Promise.all(started); provider.off(filter, listener); }; sub = { tag, listeners: [], start, stop }; subs.set(tag, sub); } return sub; } // We use this to ensure one emit resolves before firing the next to // ensure correct ordering (note this cannot throw and just adds the // notice to the event queu using setTimeout). let lastEmit = Promise.resolve(); async function _emit(contract, event, args, payloadFunc) { await lastEmit; const sub = await hasSub(contract, event); if (!sub) { return false; } const count = sub.listeners.length; sub.listeners = sub.listeners.filter(({ listener, once }) => { const passArgs = Array.from(args); if (payloadFunc) { passArgs.push(payloadFunc(once ? null : listener)); } try { listener.call(contract, ...passArgs); } catch (error) {} return !once; }); if (sub.listeners.length === 0) { sub.stop(); getInternal(contract).subs.delete(sub.tag); } return count > 0; } async function emit(contract, event, args, payloadFunc) { try { await lastEmit; } catch (error) {} const resultPromise = _emit(contract, event, args, payloadFunc); lastEmit = resultPromise; return await resultPromise; } const passProperties = ["then"]; class BaseContract { /** * The target to connect to. * * This can be an address, ENS name or any [[Addressable]], such as * another contract. To get the resovled address, use the ``getAddress`` * method. */ target; /** * The contract Interface. */ interface; /** * The connected runner. This is generally a [[Provider]] or a * [[Signer]], which dictates what operations are supported. * * For example, a **Contract** connected to a [[Provider]] may * only execute read-only operations. */ runner; /** * All the Events available on this contract. */ filters; /** * @_ignore: */ [internal]; /** * The fallback or receive function if any. */ fallback; /** * Creates a new contract connected to %%target%% with the %%abi%% and * optionally connected to a %%runner%% to perform operations on behalf * of. */ constructor(target, abi, runner, _deployTx) { assertArgument(typeof target === "string" || isAddressable(target), "invalid value for Contract target", "target", target); if (runner == null) { runner = null; } const iface = Interface.from(abi); defineProperties(this, { target, runner, interface: iface }); Object.defineProperty(this, internal, { value: {} }); let addrPromise; let addr = null; let deployTx = null; if (_deployTx) { const provider = getProvider(runner); // @TODO: the provider can be null; make a custom dummy provider that will throw a // meaningful error deployTx = new ContractTransactionResponse(this.interface, provider, _deployTx); } let subs = new Map(); // Resolve the target as the address if (typeof target === "string") { if (isHexString(target)) { addr = target; addrPromise = Promise.resolve(target); } else { const resolver = getRunner(runner, "resolveName"); if (!canResolve(resolver)) { throw makeError("contract runner does not support name resolution", "UNSUPPORTED_OPERATION", { operation: "resolveName" }); } addrPromise = resolver.resolveName(target).then(addr => { if (addr == null) { throw makeError("an ENS name used for a contract target must be correctly configured", "UNCONFIGURED_NAME", { value: target }); } getInternal(this).addr = addr; return addr; }); } } else { addrPromise = target.getAddress().then(addr => { if (addr == null) { throw new Error("TODO"); } getInternal(this).addr = addr; return addr; }); } // Set our private values setInternal(this, { addrPromise, addr, deployTx, subs }); // Add the event filters const filters = new Proxy({}, { get: (target, prop, receiver) => { // Pass important checks (like `then` for Promise) through if (typeof prop === "symbol" || passProperties.indexOf(prop) >= 0) { return Reflect.get(target, prop, receiver); } try { return this.getEvent(prop); } catch (error) { if (!isError(error, "INVALID_ARGUMENT") || error.argument !== "key") { throw error; } } return undefined; }, has: (target, prop) => { // Pass important checks (like `then` for Promise) through if (passProperties.indexOf(prop) >= 0) { return Reflect.has(target, prop); } return Reflect.has(target, prop) || this.interface.hasEvent(String(prop)); } }); defineProperties(this, { filters }); defineProperties(this, { fallback: iface.receive || iface.fallback ? buildWrappedFallback(this) : null }); // Return a Proxy that will respond to functions return new Proxy(this, { get: (target, prop, receiver) => { if (typeof prop === "symbol" || prop in target || passProperties.indexOf(prop) >= 0) { return Reflect.get(target, prop, receiver); } // Undefined properties should return undefined try { return target.getFunction(prop); } catch (error) { if (!isError(error, "INVALID_ARGUMENT") || error.argument !== "key") { throw error; } } return undefined; }, has: (target, prop) => { if (typeof prop === "symbol" || prop in target || passProperties.indexOf(prop) >= 0) { return Reflect.has(target, prop); } return target.interface.hasFunction(prop); } }); } /** * Return a new Contract instance with the same target and ABI, but * a different %%runner%%. */ connect(runner) { return new BaseContract(this.target, this.interface, runner); } /** * Return a new Contract instance with the same ABI and runner, but * a different %%target%%. */ attach(target) { return new BaseContract(target, this.interface, this.runner); } /** * Return the resolved address of this Contract. */ async getAddress() { return await getInternal(this).addrPromise; } /** * Return the deployed bytecode or null if no bytecode is found. */ async getDeployedCode() { const provider = getProvider(this.runner); assert(provider, "runner does not support .provider", "UNSUPPORTED_OPERATION", { operation: "getDeployedCode" }); const code = await provider.getCode(await this.getAddress()); if (code === "0x") { return null; } return code; } /** * Resolve to this Contract once the bytecode has been deployed, or * resolve immediately if already deployed. */ async waitForDeployment() { // We have the deployement transaction; just use that (throws if deployement fails) const deployTx = this.deploymentTransaction(); if (deployTx) { await deployTx.wait(); return this; } // Check for code const code = await this.getDeployedCode(); if (code != null) { return this; } // Make sure we can subscribe to a provider event const provider = getProvider(this.runner); assert(provider != null, "contract runner does not support .provider", "UNSUPPORTED_OPERATION", { operation: "waitForDeployment" }); return new Promise((resolve, reject) => { const checkCode = async () => { try { const code = await this.getDeployedCode(); if (code != null) { return resolve(this); } provider.once("block", checkCode); } catch (error) { reject(error); } }; checkCode(); }); } /** * Return the transaction used to deploy this contract. * * This is only available if this instance was returned from a * [[ContractFactory]]. */ deploymentTransaction() { return getInternal(this).deployTx; } /** * Return the function for a given name. This is useful when a contract * method name conflicts with a JavaScript name such as ``prototype`` or * when using a Contract programatically. */ getFunction(key) { if (typeof key !== "string") { key = key.format(); } const func = buildWrappedMethod(this, key); return func; } /** * Return the event for a given name. This is useful when a contract * event name conflicts with a JavaScript name such as ``prototype`` or * when using a Contract programatically. */ getEvent(key) { if (typeof key !== "string") { key = key.format(); } return buildWrappedEvent(this, key); } /** * @_ignore: */ async queryTransaction(hash) { throw new Error("@TODO"); } /* // @TODO: this is a non-backwards compatible change, but will be added // in v7 and in a potential SmartContract class in an upcoming // v6 release async getTransactionReceipt(hash: string): Promise { const provider = getProvider(this.runner); assert(provider, "contract runner does not have a provider", "UNSUPPORTED_OPERATION", { operation: "queryTransaction" }); const receipt = await provider.getTransactionReceipt(hash); if (receipt == null) { return null; } return new ContractTransactionReceipt(this.interface, provider, receipt); } */ /** * Provide historic access to event data for %%event%% in the range * %%fromBlock%% (default: ``0``) to %%toBlock%% (default: ``"latest"``) * inclusive. */ async queryFilter(event, fromBlock, toBlock) { if (fromBlock == null) { fromBlock = 0; } if (toBlock == null) { toBlock = "latest"; } const { addr, addrPromise } = getInternal(this); const address = addr ? addr : await addrPromise; const { fragment, topics } = await getSubInfo(this, event); const filter = { address, topics, fromBlock, toBlock }; const provider = getProvider(this.runner); assert(provider, "contract runner does not have a provider", "UNSUPPORTED_OPERATION", { operation: "queryFilter" }); return (await provider.getLogs(filter)).map(log => { let foundFragment = fragment; if (foundFragment == null) { try { foundFragment = this.interface.getEvent(log.topics[0]); } catch (error) {} } if (foundFragment) { try { return new EventLog(log, this.interface, foundFragment); } catch (error) { return new UndecodedEventLog(log, error); } } return new Log(log, provider); }); } /** * Add an event %%listener%% for the %%event%%. */ async on(event, listener) { const sub = await getSub(this, "on", event); sub.listeners.push({ listener, once: false }); sub.start(); return this; } /** * Add an event %%listener%% for the %%event%%, but remove the listener * after it is fired once. */ async once(event, listener) { const sub = await getSub(this, "once", event); sub.listeners.push({ listener, once: true }); sub.start(); return this; } /** * Emit an %%event%% calling all listeners with %%args%%. * * Resolves to ``true`` if any listeners were called. */ async emit(event, ...args) { return await emit(this, event, args, null); } /** * Resolves to the number of listeners of %%event%% or the total number * of listeners if unspecified. */ async listenerCount(event) { if (event) { const sub = await hasSub(this, event); if (!sub) { return 0; } return sub.listeners.length; } const { subs } = getInternal(this); let total = 0; for (const { listeners } of subs.values()) { total += listeners.length; } return total; } /** * Resolves to the listeners subscribed to %%event%% or all listeners * if unspecified. */ async listeners(event) { if (event) { const sub = await hasSub(this, event); if (!sub) { return []; } return sub.listeners.map(({ listener }) => listener); } const { subs } = getInternal(this); let result = []; for (const { listeners } of subs.values()) { result = result.concat(listeners.map(({ listener }) => listener)); } return result; } /** * Remove the %%listener%% from the listeners for %%event%% or remove * all listeners if unspecified. */ async off(event, listener) { const sub = await hasSub(this, event); if (!sub) { return this; } if (listener) { const index = sub.listeners.map(({ listener }) => listener).indexOf(listener); if (index >= 0) { sub.listeners.splice(index, 1); } } if (listener == null || sub.listeners.length === 0) { sub.stop(); getInternal(this).subs.delete(sub.tag); } return this; } /** * Remove all the listeners for %%event%% or remove all listeners if * unspecified. */ async removeAllListeners(event) { if (event) { const sub = await hasSub(this, event); if (!sub) { return this; } sub.stop(); getInternal(this).subs.delete(sub.tag); } else { const { subs } = getInternal(this); for (const { tag, stop } of subs.values()) { stop(); subs.delete(tag); } } return this; } /** * Alias for [on]. */ async addListener(event, listener) { return await this.on(event, listener); } /** * Alias for [off]. */ async removeListener(event, listener) { return await this.off(event, listener); } /** * Create a new Class for the %%abi%%. */ static buildClass(abi) { class CustomContract extends BaseContract { constructor(address, runner = null) { super(address, abi, runner); } } return CustomContract; } /** * Create a new BaseContract with a specified Interface. */ static from(target, abi, runner) { if (runner == null) { runner = null; } const contract = new this(target, abi, runner); return contract; } } function _ContractBase() { return BaseContract; } /** * A [[BaseContract]] with no type guards on its methods or events. */ class Contract extends _ContractBase() {} /** * ENS is a service which allows easy-to-remember names to map to * network addresses. * * @_section: api/providers/ens-resolver:ENS Resolver [about-ens-rsolver] */ // @TODO: This should use the fetch-data:ipfs gateway // Trim off the ipfs:// prefix and return the default gateway URL function getIpfsLink(link) { if (link.match(/^ipfs:\/\/ipfs\//i)) { link = link.substring(12); } else if (link.match(/^ipfs:\/\//i)) { link = link.substring(7); } else { assertArgument(false, "unsupported IPFS format", "link", link); } return `https:/\/gateway.ipfs.io/ipfs/${link}`; } /** * A provider plugin super-class for processing multicoin address types. */ class MulticoinProviderPlugin { /** * The name. */ name; /** * Creates a new **MulticoinProviderPluing** for %%name%%. */ constructor(name) { defineProperties(this, { name }); } connect(proivder) { return this; } /** * Returns ``true`` if %%coinType%% is supported by this plugin. */ supportsCoinType(coinType) { return false; } /** * Resolves to the encoded %%address%% for %%coinType%%. */ async encodeAddress(coinType, address) { throw new Error("unsupported coin"); } /** * Resolves to the decoded %%data%% for %%coinType%%. */ async decodeAddress(coinType, data) { throw new Error("unsupported coin"); } } const matcherIpfs = new RegExp("^(ipfs):/\/(.*)$", "i"); const matchers = [new RegExp("^(https):/\/(.*)$", "i"), new RegExp("^(data):(.*)$", "i"), matcherIpfs, new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$", "i")]; /** * A connected object to a resolved ENS name resolver, which can be * used to query additional details. */ class EnsResolver { /** * The connected provider. */ provider; /** * The address of the resolver. */ address; /** * The name this resolver was resolved against. */ name; // For EIP-2544 names, the ancestor that provided the resolver #supports2544; #resolver; constructor(provider, address, name) { defineProperties(this, { provider, address, name }); this.#supports2544 = null; this.#resolver = new Contract(address, ["function supportsInterface(bytes4) view returns (bool)", "function resolve(bytes, bytes) view returns (bytes)", "function addr(bytes32) view returns (address)", "function addr(bytes32, uint) view returns (bytes)", "function text(bytes32, string) view returns (string)", "function contenthash(bytes32) view returns (bytes)"], provider); } /** * Resolves to true if the resolver supports wildcard resolution. */ async supportsWildcard() { if (this.#supports2544 == null) { this.#supports2544 = (async () => { try { return await this.#resolver.supportsInterface("0x9061b923"); } catch (error) { // Wildcard resolvers must understand supportsInterface // and return true. if (isError(error, "CALL_EXCEPTION")) { return false; } // Let future attempts try again... this.#supports2544 = null; throw error; } })(); } return await this.#supports2544; } async #fetch(funcName, params) { params = (params || []).slice(); const iface = this.#resolver.interface; // The first parameters is always the nodehash params.unshift(namehash(this.name)); let fragment = null; if (await this.supportsWildcard()) { fragment = iface.getFunction(funcName); assert(fragment, "missing fragment", "UNKNOWN_ERROR", { info: { funcName } }); params = [dnsEncode(this.name, 255), iface.encodeFunctionData(fragment, params)]; funcName = "resolve(bytes,bytes)"; } params.push({ enableCcipRead: true }); try { const result = await this.#resolver[funcName](...params); if (fragment) { return iface.decodeFunctionResult(fragment, result)[0]; } return result; } catch (error) { if (!isError(error, "CALL_EXCEPTION")) { throw error; } } return null; } /** * Resolves to the address for %%coinType%% or null if the * provided %%coinType%% has not been configured. */ async getAddress(coinType) { if (coinType == null) { coinType = 60; } if (coinType === 60) { try { const result = await this.#fetch("addr(bytes32)"); // No address if (result == null || result === ZeroAddress) { return null; } return result; } catch (error) { if (isError(error, "CALL_EXCEPTION")) { return null; } throw error; } } // Try decoding its EVM canonical chain as an EVM chain address first if (coinType >= 0 && coinType < 0x80000000) { let ethCoinType = coinType + 0x80000000; const data = await this.#fetch("addr(bytes32,uint)", [ethCoinType]); if (isHexString(data, 20)) { return getAddress(data); } } let coinPlugin = null; for (const plugin of this.provider.plugins) { if (!(plugin instanceof MulticoinProviderPlugin)) { continue; } if (plugin.supportsCoinType(coinType)) { coinPlugin = plugin; break; } } if (coinPlugin == null) { return null; } // keccak256("addr(bytes32,uint256") const data = await this.#fetch("addr(bytes32,uint)", [coinType]); // No address if (data == null || data === "0x") { return null; } // Compute the address const address = await coinPlugin.decodeAddress(coinType, data); if (address != null) { return address; } assert(false, `invalid coin data`, "UNSUPPORTED_OPERATION", { operation: `getAddress(${coinType})`, info: { coinType, data } }); } /** * Resolves to the EIP-634 text record for %%key%%, or ``null`` * if unconfigured. */ async getText(key) { const data = await this.#fetch("text(bytes32,string)", [key]); if (data == null || data === "0x") { return null; } return data; } /** * Rsolves to the content-hash or ``null`` if unconfigured. */ async getContentHash() { // keccak256("contenthash()") const data = await this.#fetch("contenthash(bytes32)"); // No contenthash if (data == null || data === "0x") { return null; } // IPFS (CID: 1, Type: 70=DAG-PB, 72=libp2p-key) const ipfs = data.match(/^0x(e3010170|e5010172)(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/); if (ipfs) { const scheme = ipfs[1] === "e3010170" ? "ipfs" : "ipns"; const length = parseInt(ipfs[4], 16); if (ipfs[5].length === length * 2) { return `${scheme}:/\/${encodeBase58("0x" + ipfs[2])}`; } } // Swarm (CID: 1, Type: swarm-manifest; hash/length hard-coded to keccak256/32) const swarm = data.match(/^0xe40101fa011b20([0-9a-f]*)$/); if (swarm && swarm[1].length === 64) { return `bzz:/\/${swarm[1]}`; } assert(false, `invalid or unsupported content hash data`, "UNSUPPORTED_OPERATION", { operation: "getContentHash()", info: { data } }); } /** * Resolves to the avatar url or ``null`` if the avatar is either * unconfigured or incorrectly configured (e.g. references an NFT * not owned by the address). * * If diagnosing issues with configurations, the [[_getAvatar]] * method may be useful. */ async getAvatar() { const avatar = await this._getAvatar(); return avatar.url; } /** * When resolving an avatar, there are many steps involved, such * fetching metadata and possibly validating ownership of an * NFT. * * This method can be used to examine each step and the value it * was working from. */ async _getAvatar() { const linkage = [{ type: "name", value: this.name }]; try { // test data for ricmoo.eth //const avatar = "eip155:1/erc721:0x265385c7f4132228A0d54EB1A9e7460b91c0cC68/29233"; const avatar = await this.getText("avatar"); if (avatar == null) { linkage.push({ type: "!avatar", value: "" }); return { url: null, linkage }; } linkage.push({ type: "avatar", value: avatar }); for (let i = 0; i < matchers.length; i++) { const match = avatar.match(matchers[i]); if (match == null) { continue; } const scheme = match[1].toLowerCase(); switch (scheme) { case "https": case "data": linkage.push({ type: "url", value: avatar }); return { linkage, url: avatar }; case "ipfs": { const url = getIpfsLink(avatar); linkage.push({ type: "ipfs", value: avatar }); linkage.push({ type: "url", value: url }); return { linkage, url }; } case "erc721": case "erc1155": { // Depending on the ERC type, use tokenURI(uint256) or url(uint256) const selector = scheme === "erc721" ? "tokenURI(uint256)" : "uri(uint256)"; linkage.push({ type: scheme, value: avatar }); // The owner of this name const owner = await this.getAddress(); if (owner == null) { linkage.push({ type: "!owner", value: "" }); return { url: null, linkage }; } const comps = (match[2] || "").split("/"); if (comps.length !== 2) { linkage.push({ type: `!${scheme}caip`, value: match[2] || "" }); return { url: null, linkage }; } const tokenId = comps[1]; const contract = new Contract(comps[0], [ // ERC-721 "function tokenURI(uint) view returns (string)", "function ownerOf(uint) view returns (address)", // ERC-1155 "function uri(uint) view returns (string)", "function balanceOf(address, uint256) view returns (uint)"], this.provider); // Check that this account owns the token if (scheme === "erc721") { const tokenOwner = await contract.ownerOf(tokenId); if (owner !== tokenOwner) { linkage.push({ type: "!owner", value: tokenOwner }); return { url: null, linkage }; } linkage.push({ type: "owner", value: tokenOwner }); } else if (scheme === "erc1155") { const balance = await contract.balanceOf(owner, tokenId); if (!balance) { linkage.push({ type: "!balance", value: "0" }); return { url: null, linkage }; } linkage.push({ type: "balance", value: balance.toString() }); } // Call the token contract for the metadata URL let metadataUrl = await contract[selector](tokenId); if (metadataUrl == null || metadataUrl === "0x") { linkage.push({ type: "!metadata-url", value: "" }); return { url: null, linkage }; } linkage.push({ type: "metadata-url-base", value: metadataUrl }); // ERC-1155 allows a generic {id} in the URL if (scheme === "erc1155") { metadataUrl = metadataUrl.replace("{id}", toBeHex(tokenId, 32).substring(2)); linkage.push({ type: "metadata-url-expanded", value: metadataUrl }); } // Transform IPFS metadata links if (metadataUrl.match(/^ipfs:/i)) { metadataUrl = getIpfsLink(metadataUrl); } linkage.push({ type: "metadata-url", value: metadataUrl }); // Get the token metadata let metadata = {}; const response = await new FetchRequest(metadataUrl).send(); response.assertOk(); try { metadata = response.bodyJson; } catch (error) { try { linkage.push({ type: "!metadata", value: response.bodyText }); } catch (error) { const bytes = response.body; if (bytes) { linkage.push({ type: "!metadata", value: hexlify(bytes) }); } return { url: null, linkage }; } return { url: null, linkage }; } if (!metadata) { linkage.push({ type: "!metadata", value: "" }); return { url: null, linkage }; } linkage.push({ type: "metadata", value: JSON.stringify(metadata) }); // Pull the image URL out let imageUrl = metadata.image; if (typeof imageUrl !== "string") { linkage.push({ type: "!imageUrl", value: "" }); return { url: null, linkage }; } if (imageUrl.match(/^(https:\/\/|data:)/i)) { // Allow } else { // Transform IPFS link to gateway const ipfs = imageUrl.match(matcherIpfs); if (ipfs == null) { linkage.push({ type: "!imageUrl-ipfs", value: imageUrl }); return { url: null, linkage }; } linkage.push({ type: "imageUrl-ipfs", value: imageUrl }); imageUrl = getIpfsLink(imageUrl); } linkage.push({ type: "url", value: imageUrl }); return { linkage, url: imageUrl }; } } } } catch (error) {} return { linkage, url: null }; } static async getEnsAddress(provider) { const network = await provider.getNetwork(); const ensPlugin = network.getPlugin("org.ethers.plugins.network.Ens"); // No ENS... assert(ensPlugin, "network does not support ENS", "UNSUPPORTED_OPERATION", { operation: "getEnsAddress", info: { network } }); return ensPlugin.address; } static async #getResolver(provider, name) { const ensAddr = await EnsResolver.getEnsAddress(provider); try { const contract = new Contract(ensAddr, ["function resolver(bytes32) view returns (address)"], provider); const addr = await contract.resolver(namehash(name), { enableCcipRead: true }); if (addr === ZeroAddress) { return null; } return addr; } catch (error) { // ENS registry cannot throw errors on resolver(bytes32), // so probably a link error throw error; } return null; } /** * Resolve to the ENS resolver for %%name%% using %%provider%% or * ``null`` if unconfigured. */ static async fromName(provider, name) { let currentName = name; while (true) { if (currentName === "" || currentName === ".") { return null; } // Optimization since the eth node cannot change and does // not have a wildcard resolver if (name !== "eth" && currentName === "eth") { return null; } // Check the current node for a resolver const addr = await EnsResolver.#getResolver(provider, currentName); // Found a resolver! if (addr != null) { const resolver = new EnsResolver(provider, addr, name); // Legacy resolver found, using EIP-2544 so it isn't safe to use if (currentName !== name && !(await resolver.supportsWildcard())) { return null; } return resolver; } // Get the parent node currentName = currentName.split(".").slice(1).join("."); } } } /** * @_ignore */ const BN_0 = BigInt(0); function allowNull(format, nullValue) { return function (value) { if (value == null) { return nullValue; } return format(value); }; } function arrayOf(format, allowNull) { return array => { if (allowNull && array == null) { return null; } if (!Array.isArray(array)) { throw new Error("not an array"); } return array.map(i => format(i)); }; } // Requires an object which matches a fleet of other formatters // Any FormatFunc may return `undefined` to have the value omitted // from the result object. Calls preserve `this`. function object(format, altNames) { return value => { const result = {}; for (const key in format) { let srcKey = key; if (altNames && key in altNames && !(srcKey in value)) { for (const altKey of altNames[key]) { if (altKey in value) { srcKey = altKey; break; } } } try { const nv = format[key](value[srcKey]); if (nv !== undefined) { result[key] = nv; } } catch (error) { const message = error instanceof Error ? error.message : "not-an-error"; assert(false, `invalid value for value.${key} (${message})`, "BAD_DATA", { value }); } } return result; }; } function formatBoolean(value) { switch (value) { case true: case "true": return true; case false: case "false": return false; } assertArgument(false, `invalid boolean; ${JSON.stringify(value)}`, "value", value); } function formatData(value) { assertArgument(isHexString(value, true), "invalid data", "value", value); return value; } function formatHash(value) { assertArgument(isHexString(value, 32), "invalid hash", "value", value); return value; } const _formatLog = object({ address: getAddress, blockHash: formatHash, blockNumber: getNumber, data: formatData, index: getNumber, removed: allowNull(formatBoolean, false), topics: arrayOf(formatHash), transactionHash: formatHash, transactionIndex: getNumber }, { index: ["logIndex"] }); function formatLog(value) { return _formatLog(value); } const _formatBlock = object({ hash: allowNull(formatHash), parentHash: formatHash, parentBeaconBlockRoot: allowNull(formatHash, null), number: getNumber, timestamp: getNumber, nonce: allowNull(formatData), difficulty: getBigInt, gasLimit: getBigInt, gasUsed: getBigInt, stateRoot: allowNull(formatHash, null), receiptsRoot: allowNull(formatHash, null), blobGasUsed: allowNull(getBigInt, null), excessBlobGas: allowNull(getBigInt, null), miner: allowNull(getAddress), prevRandao: allowNull(formatHash, null), extraData: formatData, baseFeePerGas: allowNull(getBigInt) }, { prevRandao: ["mixHash"] }); function formatBlock(value) { const result = _formatBlock(value); result.transactions = value.transactions.map(tx => { if (typeof tx === "string") { return tx; } return formatTransactionResponse(tx); }); return result; } const _formatReceiptLog = object({ transactionIndex: getNumber, blockNumber: getNumber, transactionHash: formatHash, address: getAddress, topics: arrayOf(formatHash), data: formatData, index: getNumber, blockHash: formatHash }, { index: ["logIndex"] }); function formatReceiptLog(value) { return _formatReceiptLog(value); } const _formatTransactionReceipt = object({ to: allowNull(getAddress, null), from: allowNull(getAddress, null), contractAddress: allowNull(getAddress, null), // should be allowNull(hash), but broken-EIP-658 support is handled in receipt index: getNumber, root: allowNull(hexlify), gasUsed: getBigInt, blobGasUsed: allowNull(getBigInt, null), logsBloom: allowNull(formatData), blockHash: formatHash, hash: formatHash, logs: arrayOf(formatReceiptLog), blockNumber: getNumber, //confirmations: allowNull(getNumber, null), cumulativeGasUsed: getBigInt, effectiveGasPrice: allowNull(getBigInt), blobGasPrice: allowNull(getBigInt, null), status: allowNull(getNumber), type: allowNull(getNumber, 0) }, { effectiveGasPrice: ["gasPrice"], hash: ["transactionHash"], index: ["transactionIndex"] }); function formatTransactionReceipt(value) { return _formatTransactionReceipt(value); } function formatTransactionResponse(value) { // Some clients (TestRPC) do strange things like return 0x0 for the // 0 address; correct this to be a real address if (value.to && getBigInt(value.to) === BN_0) { value.to = "0x0000000000000000000000000000000000000000"; } const result = object({ hash: formatHash, // Some nodes do not return this, usually test nodes (like Ganache) index: allowNull(getNumber, undefined), type: value => { if (value === "0x" || value == null) { return 0; } return getNumber(value); }, accessList: allowNull(accessListify, null), blobVersionedHashes: allowNull(arrayOf(formatHash, true), null), blockHash: allowNull(formatHash, null), blockNumber: allowNull(getNumber, null), transactionIndex: allowNull(getNumber, null), from: getAddress, // either (gasPrice) or (maxPriorityFeePerGas + maxFeePerGas) must be set gasPrice: allowNull(getBigInt), maxPriorityFeePerGas: allowNull(getBigInt), maxFeePerGas: allowNull(getBigInt), maxFeePerBlobGas: allowNull(getBigInt, null), gasLimit: getBigInt, to: allowNull(getAddress, null), value: getBigInt, nonce: getNumber, data: formatData, creates: allowNull(getAddress, null), chainId: allowNull(getBigInt, null) }, { data: ["input"], gasLimit: ["gas"], index: ["transactionIndex"] })(value); // If to and creates are empty, populate the creates from the value if (result.to == null && result.creates == null) { result.creates = getCreateAddress(result); } // @TODO: Check fee data // Add an access list to supported transaction types if ((value.type === 1 || value.type === 2) && value.accessList == null) { result.accessList = []; } // Compute the signature if (value.signature) { result.signature = Signature.from(value.signature); } else { result.signature = Signature.from(value); } // Some backends omit ChainId on legacy transactions, but we can compute it if (result.chainId == null) { const chainId = result.signature.legacyChainId; if (chainId != null) { result.chainId = chainId; } } // @TODO: check chainID /* if (value.chainId != null) { let chainId = value.chainId; if (isHexString(chainId)) { chainId = BigNumber.from(chainId).toNumber(); } result.chainId = chainId; } else { let chainId = value.networkId; // geth-etc returns chainId if (chainId == null && result.v == null) { chainId = value.chainId; } if (isHexString(chainId)) { chainId = BigNumber.from(chainId).toNumber(); } if (typeof(chainId) !== "number" && result.v != null) { chainId = (result.v - 35) / 2; if (chainId < 0) { chainId = 0; } chainId = parseInt(chainId); } if (typeof(chainId) !== "number") { chainId = 0; } result.chainId = chainId; } */ // 0x0000... should actually be null if (result.blockHash && getBigInt(result.blockHash) === BN_0) { result.blockHash = null; } return result; } const EnsAddress = "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"; /** * A **NetworkPlugin** provides additional functionality on a [[Network]]. */ class NetworkPlugin { /** * The name of the plugin. * * It is recommended to use reverse-domain-notation, which permits * unique names with a known authority as well as hierarchal entries. */ name; /** * Creates a new **NetworkPlugin**. */ constructor(name) { defineProperties(this, { name }); } /** * Creates a copy of this plugin. */ clone() { return new NetworkPlugin(this.name); } } /** * A **GasCostPlugin** allows a network to provide alternative values when * computing the intrinsic gas required for a transaction. */ class GasCostPlugin extends NetworkPlugin { /** * The block number to treat these values as valid from. * * This allows a hardfork to have updated values included as well as * mulutiple hardforks to be supported. */ effectiveBlock; /** * The transactions base fee. */ txBase; /** * The fee for creating a new account. */ txCreate; /** * The fee per zero-byte in the data. */ txDataZero; /** * The fee per non-zero-byte in the data. */ txDataNonzero; /** * The fee per storage key in the [[link-eip-2930]] access list. */ txAccessListStorageKey; /** * The fee per address in the [[link-eip-2930]] access list. */ txAccessListAddress; /** * Creates a new GasCostPlugin from %%effectiveBlock%% until the * latest block or another GasCostPlugin supercedes that block number, * with the associated %%costs%%. */ constructor(effectiveBlock, costs) { if (effectiveBlock == null) { effectiveBlock = 0; } super(`org.ethers.network.plugins.GasCost#${effectiveBlock || 0}`); const props = { effectiveBlock }; function set(name, nullish) { let value = (costs || {})[name]; if (value == null) { value = nullish; } assertArgument(typeof value === "number", `invalud value for ${name}`, "costs", costs); props[name] = value; } set("txBase", 21000); set("txCreate", 32000); set("txDataZero", 4); set("txDataNonzero", 16); set("txAccessListStorageKey", 1900); set("txAccessListAddress", 2400); defineProperties(this, props); } clone() { return new GasCostPlugin(this.effectiveBlock, this); } } /** * An **EnsPlugin** allows a [[Network]] to specify the ENS Registry * Contract address and the target network to use when using that * contract. * * Various testnets have their own instance of the contract to use, but * in general, the mainnet instance supports multi-chain addresses and * should be used. */ class EnsPlugin extends NetworkPlugin { /** * The ENS Registrty Contract address. */ address; /** * The chain ID that the ENS contract lives on. */ targetNetwork; /** * Creates a new **EnsPlugin** connected to %%address%% on the * %%targetNetwork%%. The default ENS address and mainnet is used * if unspecified. */ constructor(address, targetNetwork) { super("org.ethers.plugins.network.Ens"); defineProperties(this, { address: address || EnsAddress, targetNetwork: targetNetwork == null ? 1 : targetNetwork }); } clone() { return new EnsPlugin(this.address, this.targetNetwork); } } class FetchUrlFeeDataNetworkPlugin extends NetworkPlugin { #url; #processFunc; /** * The URL to initialize the FetchRequest with in %%processFunc%%. */ get url() { return this.#url; } /** * The callback to use when computing the FeeData. */ get processFunc() { return this.#processFunc; } /** * Creates a new **FetchUrlFeeDataNetworkPlugin** which will * be used when computing the fee data for the network. */ constructor(url, processFunc) { super("org.ethers.plugins.network.FetchUrlFeeDataPlugin"); this.#url = url; this.#processFunc = processFunc; } // We are immutable, so we can serve as our own clone clone() { return this; } } /* export class CustomBlockNetworkPlugin extends NetworkPlugin { readonly #blockFunc: (provider: Provider, block: BlockParams) => Block; readonly #blockWithTxsFunc: (provider: Provider, block: BlockParams) => Block; constructor(blockFunc: (provider: Provider, block: BlockParams) => Block, blockWithTxsFunc: (provider: Provider, block: BlockParams) => Block) { super("org.ethers.network-plugins.custom-block"); this.#blockFunc = blockFunc; this.#blockWithTxsFunc = blockWithTxsFunc; } async getBlock(provider: Provider, block: BlockParams): Promise> { return await this.#blockFunc(provider, block); } async getBlockions(provider: Provider, block: BlockParams): Promise> { return await this.#blockWithTxsFunc(provider, block); } clone(): CustomBlockNetworkPlugin { return new CustomBlockNetworkPlugin(this.#blockFunc, this.#blockWithTxsFunc); } } */ /** * A **Network** encapsulates the various properties required to * interact with a specific chain. * * @_subsection: api/providers:Networks [networks] */ /* * * * // Networks which operation against an L2 can use this plugin to // specify how to access L1, for the purpose of resolving ENS, // for example. export class LayerOneConnectionPlugin extends NetworkPlugin { readonly provider!: Provider; // @TODO: Rename to ChainAccess and allow for connecting to any chain constructor(provider: Provider) { super("org.ethers.plugins.layer-one-connection"); defineProperties(this, { provider }); } clone(): LayerOneConnectionPlugin { return new LayerOneConnectionPlugin(this.provider); } } */ const Networks = new Map(); /** * A **Network** provides access to a chain's properties and allows * for plug-ins to extend functionality. */ class Network { #name; #chainId; #plugins; /** * Creates a new **Network** for %%name%% and %%chainId%%. */ constructor(name, chainId) { this.#name = name; this.#chainId = getBigInt(chainId); this.#plugins = new Map(); } /** * Returns a JSON-compatible representation of a Network. */ toJSON() { return { name: this.name, chainId: String(this.chainId) }; } /** * The network common name. * * This is the canonical name, as networks migh have multiple * names. */ get name() { return this.#name; } set name(value) { this.#name = value; } /** * The network chain ID. */ get chainId() { return this.#chainId; } set chainId(value) { this.#chainId = getBigInt(value, "chainId"); } /** * Returns true if %%other%% matches this network. Any chain ID * must match, and if no chain ID is present, the name must match. * * This method does not currently check for additional properties, * such as ENS address or plug-in compatibility. */ matches(other) { if (other == null) { return false; } if (typeof other === "string") { try { return this.chainId === getBigInt(other); } catch (error) {} return this.name === other; } if (typeof other === "number" || typeof other === "bigint") { try { return this.chainId === getBigInt(other); } catch (error) {} return false; } if (typeof other === "object") { if (other.chainId != null) { try { return this.chainId === getBigInt(other.chainId); } catch (error) {} return false; } if (other.name != null) { return this.name === other.name; } return false; } return false; } /** * Returns the list of plugins currently attached to this Network. */ get plugins() { return Array.from(this.#plugins.values()); } /** * Attach a new %%plugin%% to this Network. The network name * must be unique, excluding any fragment. */ attachPlugin(plugin) { if (this.#plugins.get(plugin.name)) { throw new Error(`cannot replace existing plugin: ${plugin.name} `); } this.#plugins.set(plugin.name, plugin.clone()); return this; } /** * Return the plugin, if any, matching %%name%% exactly. Plugins * with fragments will not be returned unless %%name%% includes * a fragment. */ getPlugin(name) { return this.#plugins.get(name) || null; } /** * Gets a list of all plugins that match %%name%%, with otr without * a fragment. */ getPlugins(basename) { return this.plugins.filter(p => p.name.split("#")[0] === basename); } /** * Create a copy of this Network. */ clone() { const clone = new Network(this.name, this.chainId); this.plugins.forEach(plugin => { clone.attachPlugin(plugin.clone()); }); return clone; } /** * Compute the intrinsic gas required for a transaction. * * A GasCostPlugin can be attached to override the default * values. */ computeIntrinsicGas(tx) { const costs = this.getPlugin("org.ethers.plugins.network.GasCost") || new GasCostPlugin(); let gas = costs.txBase; if (tx.to == null) { gas += costs.txCreate; } if (tx.data) { for (let i = 2; i < tx.data.length; i += 2) { if (tx.data.substring(i, i + 2) === "00") { gas += costs.txDataZero; } else { gas += costs.txDataNonzero; } } } if (tx.accessList) { const accessList = accessListify(tx.accessList); for (const addr in accessList) { gas += costs.txAccessListAddress + costs.txAccessListStorageKey * accessList[addr].storageKeys.length; } } return gas; } /** * Returns a new Network for the %%network%% name or chainId. */ static from(network) { injectCommonNetworks(); // Default network if (network == null) { return Network.from("mainnet"); } // Canonical name or chain ID if (typeof network === "number") { network = BigInt(network); } if (typeof network === "string" || typeof network === "bigint") { const networkFunc = Networks.get(network); if (networkFunc) { return networkFunc(); } if (typeof network === "bigint") { return new Network("unknown", network); } assertArgument(false, "unknown network", "network", network); } // Clonable with network-like abilities if (typeof network.clone === "function") { const clone = network.clone(); //if (typeof(network.name) !== "string" || typeof(network.chainId) !== "number") { //} return clone; } // Networkish if (typeof network === "object") { assertArgument(typeof network.name === "string" && typeof network.chainId === "number", "invalid network object name or chainId", "network", network); const custom = new Network(network.name, network.chainId); if (network.ensAddress || network.ensNetwork != null) { custom.attachPlugin(new EnsPlugin(network.ensAddress, network.ensNetwork)); } //if ((network).layerOneConnection) { // custom.attachPlugin(new LayerOneConnectionPlugin((network).layerOneConnection)); //} return custom; } assertArgument(false, "invalid network", "network", network); } /** * Register %%nameOrChainId%% with a function which returns * an instance of a Network representing that chain. */ static register(nameOrChainId, networkFunc) { if (typeof nameOrChainId === "number") { nameOrChainId = BigInt(nameOrChainId); } const existing = Networks.get(nameOrChainId); if (existing) { assertArgument(false, `conflicting network for ${JSON.stringify(existing.name)}`, "nameOrChainId", nameOrChainId); } Networks.set(nameOrChainId, networkFunc); } } // We don't want to bring in formatUnits because it is backed by // FixedNumber and we want to keep Networks tiny. The values // included by the Gas Stations are also IEEE 754 with lots of // rounding issues and exceed the strict checks formatUnits has. function parseUnits(_value, decimals) { const value = String(_value); if (!value.match(/^[0-9.]+$/)) { throw new Error(`invalid gwei value: ${_value}`); } // Break into [ whole, fraction ] const comps = value.split("."); if (comps.length === 1) { comps.push(""); } // More than 1 decimal point or too many fractional positions if (comps.length !== 2) { throw new Error(`invalid gwei value: ${_value}`); } // Pad the fraction to 9 decimalplaces while (comps[1].length < decimals) { comps[1] += "0"; } // Too many decimals and some non-zero ending, take the ceiling if (comps[1].length > 9) { let frac = BigInt(comps[1].substring(0, 9)); if (!comps[1].substring(9).match(/^0+$/)) { frac++; } comps[1] = frac.toString(); } return BigInt(comps[0] + comps[1]); } // Used by Polygon to use a gas station for fee data function getGasStationPlugin(url) { return new FetchUrlFeeDataNetworkPlugin(url, async (fetchFeeData, provider, request) => { // Prevent Cloudflare from blocking our request in node.js request.setHeader("User-Agent", "ethers"); let response; try { const [_response, _feeData] = await Promise.all([request.send(), fetchFeeData()]); response = _response; const payload = response.bodyJson.standard; const feeData = { gasPrice: _feeData.gasPrice, maxFeePerGas: parseUnits(payload.maxFee, 9), maxPriorityFeePerGas: parseUnits(payload.maxPriorityFee, 9) }; return feeData; } catch (error) { assert(false, `error encountered with polygon gas station (${JSON.stringify(request.url)})`, "SERVER_ERROR", { request, response, error }); } }); } // See: https://chainlist.org let injected = false; function injectCommonNetworks() { if (injected) { return; } injected = true; /// Register popular Ethereum networks function registerEth(name, chainId, options) { const func = function () { const network = new Network(name, chainId); // We use 0 to disable ENS if (options.ensNetwork != null) { network.attachPlugin(new EnsPlugin(null, options.ensNetwork)); } network.attachPlugin(new GasCostPlugin()); (options.plugins || []).forEach(plugin => { network.attachPlugin(plugin); }); return network; }; // Register the network by name and chain ID Network.register(name, func); Network.register(chainId, func); if (options.altNames) { options.altNames.forEach(name => { Network.register(name, func); }); } } registerEth("mainnet", 1, { ensNetwork: 1, altNames: ["homestead"] }); registerEth("ropsten", 3, { ensNetwork: 3 }); registerEth("rinkeby", 4, { ensNetwork: 4 }); registerEth("goerli", 5, { ensNetwork: 5 }); registerEth("kovan", 42, { ensNetwork: 42 }); registerEth("sepolia", 11155111, { ensNetwork: 11155111 }); registerEth("holesky", 17000, { ensNetwork: 17000 }); registerEth("classic", 61, {}); registerEth("classicKotti", 6, {}); registerEth("arbitrum", 42161, { ensNetwork: 1 }); registerEth("arbitrum-goerli", 421613, {}); registerEth("arbitrum-sepolia", 421614, {}); registerEth("base", 8453, { ensNetwork: 1 }); registerEth("base-goerli", 84531, {}); registerEth("base-sepolia", 84532, {}); registerEth("bnb", 56, { ensNetwork: 1 }); registerEth("bnbt", 97, {}); registerEth("linea", 59144, { ensNetwork: 1 }); registerEth("linea-goerli", 59140, {}); registerEth("linea-sepolia", 59141, {}); registerEth("matic", 137, { ensNetwork: 1, plugins: [getGasStationPlugin("https:/\/gasstation.polygon.technology/v2")] }); registerEth("matic-amoy", 80002, {}); registerEth("matic-mumbai", 80001, { altNames: ["maticMumbai", "maticmum"], plugins: [getGasStationPlugin("https:/\/gasstation-testnet.polygon.technology/v2")] }); registerEth("optimism", 10, { ensNetwork: 1, plugins: [] }); registerEth("optimism-goerli", 420, {}); registerEth("optimism-sepolia", 11155420, {}); registerEth("xdai", 100, { ensNetwork: 1 }); } function copy$2(obj) { return JSON.parse(JSON.stringify(obj)); } // @TODO: refactor this /** * A **PollingBlockSubscriber** polls at a regular interval for a change * in the block number. * * @_docloc: api/providers/abstract-provider */ class PollingBlockSubscriber { #provider; #poller; #interval; // The most recent block we have scanned for events. The value -2 // indicates we still need to fetch an initial block number #blockNumber; /** * Create a new **PollingBlockSubscriber** attached to %%provider%%. */ constructor(provider) { this.#provider = provider; this.#poller = null; this.#interval = 4000; this.#blockNumber = -2; } /** * The polling interval. */ get pollingInterval() { return this.#interval; } set pollingInterval(value) { this.#interval = value; } async #poll() { try { const blockNumber = await this.#provider.getBlockNumber(); // Bootstrap poll to setup our initial block number if (this.#blockNumber === -2) { this.#blockNumber = blockNumber; return; } // @TODO: Put a cap on the maximum number of events per loop? if (blockNumber !== this.#blockNumber) { for (let b = this.#blockNumber + 1; b <= blockNumber; b++) { // We have been stopped if (this.#poller == null) { return; } await this.#provider.emit("block", b); } this.#blockNumber = blockNumber; } } catch (error) { // @TODO: Minor bump, add an "error" event to let subscribers // know things went awry. //console.log(error); } // We have been stopped if (this.#poller == null) { return; } this.#poller = this.#provider._setTimeout(this.#poll.bind(this), this.#interval); } start() { if (this.#poller) { return; } this.#poller = this.#provider._setTimeout(this.#poll.bind(this), this.#interval); this.#poll(); } stop() { if (!this.#poller) { return; } this.#provider._clearTimeout(this.#poller); this.#poller = null; } pause(dropWhilePaused) { this.stop(); if (dropWhilePaused) { this.#blockNumber = -2; } } resume() { this.start(); } } /** * An **OnBlockSubscriber** can be sub-classed, with a [[_poll]] * implmentation which will be called on every new block. * * @_docloc: api/providers/abstract-provider */ class OnBlockSubscriber { #provider; #poll; #running; /** * Create a new **OnBlockSubscriber** attached to %%provider%%. */ constructor(provider) { this.#provider = provider; this.#running = false; this.#poll = blockNumber => { this._poll(blockNumber, this.#provider); }; } /** * Called on every new block. */ async _poll(blockNumber, provider) { throw new Error("sub-classes must override this"); } start() { if (this.#running) { return; } this.#running = true; this.#poll(-2); this.#provider.on("block", this.#poll); } stop() { if (!this.#running) { return; } this.#running = false; this.#provider.off("block", this.#poll); } pause(dropWhilePaused) { this.stop(); } resume() { this.start(); } } class PollingBlockTagSubscriber extends OnBlockSubscriber { #tag; #lastBlock; constructor(provider, tag) { super(provider); this.#tag = tag; this.#lastBlock = -2; } pause(dropWhilePaused) { if (dropWhilePaused) { this.#lastBlock = -2; } super.pause(dropWhilePaused); } async _poll(blockNumber, provider) { const block = await provider.getBlock(this.#tag); if (block == null) { return; } if (this.#lastBlock === -2) { this.#lastBlock = block.number; } else if (block.number > this.#lastBlock) { provider.emit(this.#tag, block.number); this.#lastBlock = block.number; } } } /** * @_ignore: * * @_docloc: api/providers/abstract-provider */ class PollingOrphanSubscriber extends OnBlockSubscriber { #filter; constructor(provider, filter) { super(provider); this.#filter = copy$2(filter); } async _poll(blockNumber, provider) { throw new Error("@TODO"); } } /** * A **PollingTransactionSubscriber** will poll for a given transaction * hash for its receipt. * * @_docloc: api/providers/abstract-provider */ class PollingTransactionSubscriber extends OnBlockSubscriber { #hash; /** * Create a new **PollingTransactionSubscriber** attached to * %%provider%%, listening for %%hash%%. */ constructor(provider, hash) { super(provider); this.#hash = hash; } async _poll(blockNumber, provider) { const tx = await provider.getTransactionReceipt(this.#hash); if (tx) { provider.emit(this.#hash, tx); } } } /** * A **PollingEventSubscriber** will poll for a given filter for its logs. * * @_docloc: api/providers/abstract-provider */ class PollingEventSubscriber { #provider; #filter; #poller; #running; // The most recent block we have scanned for events. The value -2 // indicates we still need to fetch an initial block number #blockNumber; /** * Create a new **PollingTransactionSubscriber** attached to * %%provider%%, listening for %%filter%%. */ constructor(provider, filter) { this.#provider = provider; this.#filter = copy$2(filter); this.#poller = this.#poll.bind(this); this.#running = false; this.#blockNumber = -2; } async #poll(blockNumber) { // The initial block hasn't been determined yet if (this.#blockNumber === -2) { return; } const filter = copy$2(this.#filter); filter.fromBlock = this.#blockNumber + 1; filter.toBlock = blockNumber; const logs = await this.#provider.getLogs(filter); // No logs could just mean the node has not indexed them yet, // so we keep a sliding window of 60 blocks to keep scanning if (logs.length === 0) { if (this.#blockNumber < blockNumber - 60) { this.#blockNumber = blockNumber - 60; } return; } for (const log of logs) { this.#provider.emit(this.#filter, log); // Only advance the block number when logs were found to // account for networks (like BNB and Polygon) which may // sacrifice event consistency for block event speed this.#blockNumber = log.blockNumber; } } start() { if (this.#running) { return; } this.#running = true; if (this.#blockNumber === -2) { this.#provider.getBlockNumber().then(blockNumber => { this.#blockNumber = blockNumber; }); } this.#provider.on("block", this.#poller); } stop() { if (!this.#running) { return; } this.#running = false; this.#provider.off("block", this.#poller); } pause(dropWhilePaused) { this.stop(); if (dropWhilePaused) { this.#blockNumber = -2; } } resume() { this.start(); } } /** * The available providers should suffice for most developers purposes, * but the [[AbstractProvider]] class has many features which enable * sub-classing it for specific purposes. * * @_section: api/providers/abstract-provider: Subclassing Provider [abstract-provider] */ // @TODO // Event coalescence // When we register an event with an async value (e.g. address is a Signer // or ENS name), we need to add it immeidately for the Event API, but also // need time to resolve the address. Upon resolving the address, we need to // migrate the listener to the static event. We also need to maintain a map // of Signer/ENS name to address so we can sync respond to listenerCount. // Constants const BN_2 = BigInt(2); const MAX_CCIP_REDIRECTS = 10; function isPromise(value) { return value && typeof value.then === "function"; } function getTag(prefix, value) { return prefix + ":" + JSON.stringify(value, (k, v) => { if (v == null) { return "null"; } if (typeof v === "bigint") { return `bigint:${v.toString()}`; } if (typeof v === "string") { return v.toLowerCase(); } // Sort object keys if (typeof v === "object" && !Array.isArray(v)) { const keys = Object.keys(v); keys.sort(); return keys.reduce((accum, key) => { accum[key] = v[key]; return accum; }, {}); } return v; }); } /** * An **UnmanagedSubscriber** is useful for events which do not require * any additional management, such as ``"debug"`` which only requires * emit in synchronous event loop triggered calls. */ class UnmanagedSubscriber { /** * The name fof the event. */ name; /** * Create a new UnmanagedSubscriber with %%name%%. */ constructor(name) { defineProperties(this, { name }); } start() {} stop() {} pause(dropWhilePaused) {} resume() {} } function copy$1(value) { return JSON.parse(JSON.stringify(value)); } function concisify(items) { items = Array.from(new Set(items).values()); items.sort(); return items; } async function getSubscription(_event, provider) { if (_event == null) { throw new Error("invalid event"); } // Normalize topic array info an EventFilter if (Array.isArray(_event)) { _event = { topics: _event }; } if (typeof _event === "string") { switch (_event) { case "block": case "debug": case "error": case "finalized": case "network": case "pending": case "safe": { return { type: _event, tag: _event }; } } } if (isHexString(_event, 32)) { const hash = _event.toLowerCase(); return { type: "transaction", tag: getTag("tx", { hash }), hash }; } if (_event.orphan) { const event = _event; // @TODO: Should lowercase and whatnot things here instead of copy... return { type: "orphan", tag: getTag("orphan", event), filter: copy$1(event) }; } if (_event.address || _event.topics) { const event = _event; const filter = { topics: (event.topics || []).map(t => { if (t == null) { return null; } if (Array.isArray(t)) { return concisify(t.map(t => t.toLowerCase())); } return t.toLowerCase(); }) }; if (event.address) { const addresses = []; const promises = []; const addAddress = addr => { if (isHexString(addr)) { addresses.push(addr); } else { promises.push((async () => { addresses.push(await resolveAddress(addr, provider)); })()); } }; if (Array.isArray(event.address)) { event.address.forEach(addAddress); } else { addAddress(event.address); } if (promises.length) { await Promise.all(promises); } filter.address = concisify(addresses.map(a => a.toLowerCase())); } return { filter, tag: getTag("event", filter), type: "event" }; } assertArgument(false, "unknown ProviderEvent", "event", _event); } function getTime() { return new Date().getTime(); } const defaultOptions$1 = { cacheTimeout: 250, pollingInterval: 4000 }; /** * An **AbstractProvider** provides a base class for other sub-classes to * implement the [[Provider]] API by normalizing input arguments and * formatting output results as well as tracking events for consistent * behaviour on an eventually-consistent network. */ class AbstractProvider { #subs; #plugins; // null=unpaused, true=paused+dropWhilePaused, false=paused #pausedState; #destroyed; #networkPromise; #anyNetwork; #performCache; // The most recent block number if running an event or -1 if no "block" event #lastBlockNumber; #nextTimer; #timers; #disableCcipRead; #options; /** * Create a new **AbstractProvider** connected to %%network%%, or * use the various network detection capabilities to discover the * [[Network]] if necessary. */ constructor(_network, options) { this.#options = Object.assign({}, defaultOptions$1, options || {}); if (_network === "any") { this.#anyNetwork = true; this.#networkPromise = null; } else if (_network) { const network = Network.from(_network); this.#anyNetwork = false; this.#networkPromise = Promise.resolve(network); setTimeout(() => { this.emit("network", network, null); }, 0); } else { this.#anyNetwork = false; this.#networkPromise = null; } this.#lastBlockNumber = -1; this.#performCache = new Map(); this.#subs = new Map(); this.#plugins = new Map(); this.#pausedState = null; this.#destroyed = false; this.#nextTimer = 1; this.#timers = new Map(); this.#disableCcipRead = false; } get pollingInterval() { return this.#options.pollingInterval; } /** * Returns ``this``, to allow an **AbstractProvider** to implement * the [[ContractRunner]] interface. */ get provider() { return this; } /** * Returns all the registered plug-ins. */ get plugins() { return Array.from(this.#plugins.values()); } /** * Attach a new plug-in. */ attachPlugin(plugin) { if (this.#plugins.get(plugin.name)) { throw new Error(`cannot replace existing plugin: ${plugin.name} `); } this.#plugins.set(plugin.name, plugin.connect(this)); return this; } /** * Get a plugin by name. */ getPlugin(name) { return this.#plugins.get(name) || null; } /** * Prevent any CCIP-read operation, regardless of whether requested * in a [[call]] using ``enableCcipRead``. */ get disableCcipRead() { return this.#disableCcipRead; } set disableCcipRead(value) { this.#disableCcipRead = !!value; } // Shares multiple identical requests made during the same 250ms async #perform(req) { const timeout = this.#options.cacheTimeout; // Caching disabled if (timeout < 0) { return await this._perform(req); } // Create a tag const tag = getTag(req.method, req); let perform = this.#performCache.get(tag); if (!perform) { perform = this._perform(req); this.#performCache.set(tag, perform); setTimeout(() => { if (this.#performCache.get(tag) === perform) { this.#performCache.delete(tag); } }, timeout); } return await perform; } /** * Resolves to the data for executing the CCIP-read operations. */ async ccipReadFetch(tx, calldata, urls) { if (this.disableCcipRead || urls.length === 0 || tx.to == null) { return null; } const sender = tx.to.toLowerCase(); const data = calldata.toLowerCase(); const errorMessages = []; for (let i = 0; i < urls.length; i++) { const url = urls[i]; // URL expansion const href = url.replace("{sender}", sender).replace("{data}", data); // If no {data} is present, use POST; otherwise GET //const json: string | null = (url.indexOf("{data}") >= 0) ? null: JSON.stringify({ data, sender }); //const result = await fetchJson({ url: href, errorPassThrough: true }, json, (value, response) => { // value.status = response.statusCode; // return value; //}); const request = new FetchRequest(href); if (url.indexOf("{data}") === -1) { request.body = { data, sender }; } this.emit("debug", { action: "sendCcipReadFetchRequest", request, index: i, urls }); let errorMessage = "unknown error"; const resp = await request.send(); try { const result = resp.bodyJson; if (result.data) { this.emit("debug", { action: "receiveCcipReadFetchResult", request, result }); return result.data; } if (result.message) { errorMessage = result.message; } this.emit("debug", { action: "receiveCcipReadFetchError", request, result }); } catch (error) {} // 4xx indicates the result is not present; stop assert(resp.statusCode < 400 || resp.statusCode >= 500, `response not found during CCIP fetch: ${errorMessage}`, "OFFCHAIN_FAULT", { reason: "404_MISSING_RESOURCE", transaction: tx, info: { url, errorMessage } }); // 5xx indicates server issue; try the next url errorMessages.push(errorMessage); } assert(false, `error encountered during CCIP fetch: ${errorMessages.map(m => JSON.stringify(m)).join(", ")}`, "OFFCHAIN_FAULT", { reason: "500_SERVER_ERROR", transaction: tx, info: { urls, errorMessages } }); } /** * Provides the opportunity for a sub-class to wrap a block before * returning it, to add additional properties or an alternate * sub-class of [[Block]]. */ _wrapBlock(value, network) { return new Block(formatBlock(value), this); } /** * Provides the opportunity for a sub-class to wrap a log before * returning it, to add additional properties or an alternate * sub-class of [[Log]]. */ _wrapLog(value, network) { return new Log(formatLog(value), this); } /** * Provides the opportunity for a sub-class to wrap a transaction * receipt before returning it, to add additional properties or an * alternate sub-class of [[TransactionReceipt]]. */ _wrapTransactionReceipt(value, network) { return new TransactionReceipt(formatTransactionReceipt(value), this); } /** * Provides the opportunity for a sub-class to wrap a transaction * response before returning it, to add additional properties or an * alternate sub-class of [[TransactionResponse]]. */ _wrapTransactionResponse(tx, network) { return new TransactionResponse(formatTransactionResponse(tx), this); } /** * Resolves to the Network, forcing a network detection using whatever * technique the sub-class requires. * * Sub-classes **must** override this. */ _detectNetwork() { assert(false, "sub-classes must implement this", "UNSUPPORTED_OPERATION", { operation: "_detectNetwork" }); } /** * Sub-classes should use this to perform all built-in operations. All * methods sanitizes and normalizes the values passed into this. * * Sub-classes **must** override this. */ async _perform(req) { assert(false, `unsupported method: ${req.method}`, "UNSUPPORTED_OPERATION", { operation: req.method, info: req }); } // State async getBlockNumber() { const blockNumber = getNumber(await this.#perform({ method: "getBlockNumber" }), "%response"); if (this.#lastBlockNumber >= 0) { this.#lastBlockNumber = blockNumber; } return blockNumber; } /** * Returns or resolves to the address for %%address%%, resolving ENS * names and [[Addressable]] objects and returning if already an * address. */ _getAddress(address) { return resolveAddress(address, this); } /** * Returns or resolves to a valid block tag for %%blockTag%%, resolving * negative values and returning if already a valid block tag. */ _getBlockTag(blockTag) { if (blockTag == null) { return "latest"; } switch (blockTag) { case "earliest": return "0x0"; case "finalized": case "latest": case "pending": case "safe": return blockTag; } if (isHexString(blockTag)) { if (isHexString(blockTag, 32)) { return blockTag; } return toQuantity(blockTag); } if (typeof blockTag === "bigint") { blockTag = getNumber(blockTag, "blockTag"); } if (typeof blockTag === "number") { if (blockTag >= 0) { return toQuantity(blockTag); } if (this.#lastBlockNumber >= 0) { return toQuantity(this.#lastBlockNumber + blockTag); } return this.getBlockNumber().then(b => toQuantity(b + blockTag)); } assertArgument(false, "invalid blockTag", "blockTag", blockTag); } /** * Returns or resolves to a filter for %%filter%%, resolving any ENS * names or [[Addressable]] object and returning if already a valid * filter. */ _getFilter(filter) { // Create a canonical representation of the topics const topics = (filter.topics || []).map(t => { if (t == null) { return null; } if (Array.isArray(t)) { return concisify(t.map(t => t.toLowerCase())); } return t.toLowerCase(); }); const blockHash = "blockHash" in filter ? filter.blockHash : undefined; const resolve = (_address, fromBlock, toBlock) => { let address = undefined; switch (_address.length) { case 0: break; case 1: address = _address[0]; break; default: _address.sort(); address = _address; } if (blockHash) { if (fromBlock != null || toBlock != null) { throw new Error("invalid filter"); } } const filter = {}; if (address) { filter.address = address; } if (topics.length) { filter.topics = topics; } if (fromBlock) { filter.fromBlock = fromBlock; } if (toBlock) { filter.toBlock = toBlock; } if (blockHash) { filter.blockHash = blockHash; } return filter; }; // Addresses could be async (ENS names or Addressables) let address = []; if (filter.address) { if (Array.isArray(filter.address)) { for (const addr of filter.address) { address.push(this._getAddress(addr)); } } else { address.push(this._getAddress(filter.address)); } } let fromBlock = undefined; if ("fromBlock" in filter) { fromBlock = this._getBlockTag(filter.fromBlock); } let toBlock = undefined; if ("toBlock" in filter) { toBlock = this._getBlockTag(filter.toBlock); } if (address.filter(a => typeof a !== "string").length || fromBlock != null && typeof fromBlock !== "string" || toBlock != null && typeof toBlock !== "string") { return Promise.all([Promise.all(address), fromBlock, toBlock]).then(result => { return resolve(result[0], result[1], result[2]); }); } return resolve(address, fromBlock, toBlock); } /** * Returns or resolves to a transaction for %%request%%, resolving * any ENS names or [[Addressable]] and returning if already a valid * transaction. */ _getTransactionRequest(_request) { const request = copyRequest(_request); const promises = []; ["to", "from"].forEach(key => { if (request[key] == null) { return; } const addr = resolveAddress(request[key], this); if (isPromise(addr)) { promises.push(async function () { request[key] = await addr; }()); } else { request[key] = addr; } }); if (request.blockTag != null) { const blockTag = this._getBlockTag(request.blockTag); if (isPromise(blockTag)) { promises.push(async function () { request.blockTag = await blockTag; }()); } else { request.blockTag = blockTag; } } if (promises.length) { return async function () { await Promise.all(promises); return request; }(); } return request; } async getNetwork() { // No explicit network was set and this is our first time if (this.#networkPromise == null) { // Detect the current network (shared with all calls) const detectNetwork = (async () => { try { const network = await this._detectNetwork(); this.emit("network", network, null); return network; } catch (error) { if (this.#networkPromise === detectNetwork) { this.#networkPromise = null; } throw error; } })(); this.#networkPromise = detectNetwork; return (await detectNetwork).clone(); } const networkPromise = this.#networkPromise; const [expected, actual] = await Promise.all([networkPromise, this._detectNetwork() // The actual connected network ]); if (expected.chainId !== actual.chainId) { if (this.#anyNetwork) { // The "any" network can change, so notify listeners this.emit("network", actual, expected); // Update the network if something else hasn't already changed it if (this.#networkPromise === networkPromise) { this.#networkPromise = Promise.resolve(actual); } } else { // Otherwise, we do not allow changes to the underlying network assert(false, `network changed: ${expected.chainId} => ${actual.chainId} `, "NETWORK_ERROR", { event: "changed" }); } } return expected.clone(); } async getFeeData() { const network = await this.getNetwork(); const getFeeDataFunc = async () => { const { _block, gasPrice, priorityFee } = await resolveProperties({ _block: this.#getBlock("latest", false), gasPrice: (async () => { try { const value = await this.#perform({ method: "getGasPrice" }); return getBigInt(value, "%response"); } catch (error) {} return null; })(), priorityFee: (async () => { try { const value = await this.#perform({ method: "getPriorityFee" }); return getBigInt(value, "%response"); } catch (error) {} return null; })() }); let maxFeePerGas = null; let maxPriorityFeePerGas = null; // These are the recommended EIP-1559 heuristics for fee data const block = this._wrapBlock(_block, network); if (block && block.baseFeePerGas) { maxPriorityFeePerGas = priorityFee != null ? priorityFee : BigInt("1000000000"); maxFeePerGas = block.baseFeePerGas * BN_2 + maxPriorityFeePerGas; } return new FeeData(gasPrice, maxFeePerGas, maxPriorityFeePerGas); }; // Check for a FeeDataNetWorkPlugin const plugin = network.getPlugin("org.ethers.plugins.network.FetchUrlFeeDataPlugin"); if (plugin) { const req = new FetchRequest(plugin.url); const feeData = await plugin.processFunc(getFeeDataFunc, this, req); return new FeeData(feeData.gasPrice, feeData.maxFeePerGas, feeData.maxPriorityFeePerGas); } return await getFeeDataFunc(); } async estimateGas(_tx) { let tx = this._getTransactionRequest(_tx); if (isPromise(tx)) { tx = await tx; } return getBigInt(await this.#perform({ method: "estimateGas", transaction: tx }), "%response"); } async #call(tx, blockTag, attempt) { assert(attempt < MAX_CCIP_REDIRECTS, "CCIP read exceeded maximum redirections", "OFFCHAIN_FAULT", { reason: "TOO_MANY_REDIRECTS", transaction: Object.assign({}, tx, { blockTag, enableCcipRead: true }) }); // This came in as a PerformActionTransaction, so to/from are safe; we can cast const transaction = copyRequest(tx); try { return hexlify(await this._perform({ method: "call", transaction, blockTag })); } catch (error) { // CCIP Read OffchainLookup if (!this.disableCcipRead && isCallException(error) && error.data && attempt >= 0 && blockTag === "latest" && transaction.to != null && dataSlice(error.data, 0, 4) === "0x556f1830") { const data = error.data; const txSender = await resolveAddress(transaction.to, this); // Parse the CCIP Read Arguments let ccipArgs; try { ccipArgs = parseOffchainLookup(dataSlice(error.data, 4)); } catch (error) { assert(false, error.message, "OFFCHAIN_FAULT", { reason: "BAD_DATA", transaction, info: { data } }); } // Check the sender of the OffchainLookup matches the transaction assert(ccipArgs.sender.toLowerCase() === txSender.toLowerCase(), "CCIP Read sender mismatch", "CALL_EXCEPTION", { action: "call", data, reason: "OffchainLookup", transaction: transaction, invocation: null, revert: { signature: "OffchainLookup(address,string[],bytes,bytes4,bytes)", name: "OffchainLookup", args: ccipArgs.errorArgs } }); const ccipResult = await this.ccipReadFetch(transaction, ccipArgs.calldata, ccipArgs.urls); assert(ccipResult != null, "CCIP Read failed to fetch data", "OFFCHAIN_FAULT", { reason: "FETCH_FAILED", transaction, info: { data: error.data, errorArgs: ccipArgs.errorArgs } }); const tx = { to: txSender, data: concat([ccipArgs.selector, encodeBytes([ccipResult, ccipArgs.extraData])]) }; this.emit("debug", { action: "sendCcipReadCall", transaction: tx }); try { const result = await this.#call(tx, blockTag, attempt + 1); this.emit("debug", { action: "receiveCcipReadCallResult", transaction: Object.assign({}, tx), result }); return result; } catch (error) { this.emit("debug", { action: "receiveCcipReadCallError", transaction: Object.assign({}, tx), error }); throw error; } } throw error; } } async #checkNetwork(promise) { const { value } = await resolveProperties({ network: this.getNetwork(), value: promise }); return value; } async call(_tx) { const { tx, blockTag } = await resolveProperties({ tx: this._getTransactionRequest(_tx), blockTag: this._getBlockTag(_tx.blockTag) }); return await this.#checkNetwork(this.#call(tx, blockTag, _tx.enableCcipRead ? 0 : -1)); } // Account async #getAccountValue(request, _address, _blockTag) { let address = this._getAddress(_address); let blockTag = this._getBlockTag(_blockTag); if (typeof address !== "string" || typeof blockTag !== "string") { [address, blockTag] = await Promise.all([address, blockTag]); } return await this.#checkNetwork(this.#perform(Object.assign(request, { address, blockTag }))); } async getBalance(address, blockTag) { return getBigInt(await this.#getAccountValue({ method: "getBalance" }, address, blockTag), "%response"); } async getTransactionCount(address, blockTag) { return getNumber(await this.#getAccountValue({ method: "getTransactionCount" }, address, blockTag), "%response"); } async getCode(address, blockTag) { return hexlify(await this.#getAccountValue({ method: "getCode" }, address, blockTag)); } async getStorage(address, _position, blockTag) { const position = getBigInt(_position, "position"); return hexlify(await this.#getAccountValue({ method: "getStorage", position }, address, blockTag)); } // Write async broadcastTransaction(signedTx) { const { blockNumber, hash, network } = await resolveProperties({ blockNumber: this.getBlockNumber(), hash: this._perform({ method: "broadcastTransaction", signedTransaction: signedTx }), network: this.getNetwork() }); const tx = Transaction.from(signedTx); if (tx.hash !== hash) { throw new Error("@TODO: the returned hash did not match"); } return this._wrapTransactionResponse(tx, network).replaceableTransaction(blockNumber); } async #getBlock(block, includeTransactions) { // @TODO: Add CustomBlockPlugin check if (isHexString(block, 32)) { return await this.#perform({ method: "getBlock", blockHash: block, includeTransactions }); } let blockTag = this._getBlockTag(block); if (typeof blockTag !== "string") { blockTag = await blockTag; } return await this.#perform({ method: "getBlock", blockTag, includeTransactions }); } // Queries async getBlock(block, prefetchTxs) { const { network, params } = await resolveProperties({ network: this.getNetwork(), params: this.#getBlock(block, !!prefetchTxs) }); if (params == null) { return null; } return this._wrapBlock(params, network); } async getTransaction(hash) { const { network, params } = await resolveProperties({ network: this.getNetwork(), params: this.#perform({ method: "getTransaction", hash }) }); if (params == null) { return null; } return this._wrapTransactionResponse(params, network); } async getTransactionReceipt(hash) { const { network, params } = await resolveProperties({ network: this.getNetwork(), params: this.#perform({ method: "getTransactionReceipt", hash }) }); if (params == null) { return null; } // Some backends did not backfill the effectiveGasPrice into old transactions // in the receipt, so we look it up manually and inject it. if (params.gasPrice == null && params.effectiveGasPrice == null) { const tx = await this.#perform({ method: "getTransaction", hash }); if (tx == null) { throw new Error("report this; could not find tx or effectiveGasPrice"); } params.effectiveGasPrice = tx.gasPrice; } return this._wrapTransactionReceipt(params, network); } async getTransactionResult(hash) { const { result } = await resolveProperties({ network: this.getNetwork(), result: this.#perform({ method: "getTransactionResult", hash }) }); if (result == null) { return null; } return hexlify(result); } // Bloom-filter Queries async getLogs(_filter) { let filter = this._getFilter(_filter); if (isPromise(filter)) { filter = await filter; } const { network, params } = await resolveProperties({ network: this.getNetwork(), params: this.#perform({ method: "getLogs", filter }) }); return params.map(p => this._wrapLog(p, network)); } // ENS _getProvider(chainId) { assert(false, "provider cannot connect to target network", "UNSUPPORTED_OPERATION", { operation: "_getProvider()" }); } async getResolver(name) { return await EnsResolver.fromName(this, name); } async getAvatar(name) { const resolver = await this.getResolver(name); if (resolver) { return await resolver.getAvatar(); } return null; } async resolveName(name) { const resolver = await this.getResolver(name); if (resolver) { return await resolver.getAddress(); } return null; } async lookupAddress(address) { address = getAddress(address); const node = namehash(address.substring(2).toLowerCase() + ".addr.reverse"); try { const ensAddr = await EnsResolver.getEnsAddress(this); const ensContract = new Contract(ensAddr, ["function resolver(bytes32) view returns (address)"], this); const resolver = await ensContract.resolver(node); if (resolver == null || resolver === ZeroAddress) { return null; } const resolverContract = new Contract(resolver, ["function name(bytes32) view returns (string)"], this); const name = await resolverContract.name(node); // Failed forward resolution const check = await this.resolveName(name); if (check !== address) { return null; } return name; } catch (error) { // No data was returned from the resolver if (isError(error, "BAD_DATA") && error.value === "0x") { return null; } // Something reerted if (isError(error, "CALL_EXCEPTION")) { return null; } throw error; } return null; } async waitForTransaction(hash, _confirms, timeout) { const confirms = _confirms != null ? _confirms : 1; if (confirms === 0) { return this.getTransactionReceipt(hash); } return new Promise(async (resolve, reject) => { let timer = null; const listener = async blockNumber => { try { const receipt = await this.getTransactionReceipt(hash); if (receipt != null) { if (blockNumber - receipt.blockNumber + 1 >= confirms) { resolve(receipt); //this.off("block", listener); if (timer) { clearTimeout(timer); timer = null; } return; } } } catch (error) { console.log("EEE", error); } this.once("block", listener); }; if (timeout != null) { timer = setTimeout(() => { if (timer == null) { return; } timer = null; this.off("block", listener); reject(makeError("timeout", "TIMEOUT", { reason: "timeout" })); }, timeout); } listener(await this.getBlockNumber()); }); } async waitForBlock(blockTag) { assert(false, "not implemented yet", "NOT_IMPLEMENTED", { operation: "waitForBlock" }); } /** * Clear a timer created using the [[_setTimeout]] method. */ _clearTimeout(timerId) { const timer = this.#timers.get(timerId); if (!timer) { return; } if (timer.timer) { clearTimeout(timer.timer); } this.#timers.delete(timerId); } /** * Create a timer that will execute %%func%% after at least %%timeout%% * (in ms). If %%timeout%% is unspecified, then %%func%% will execute * in the next event loop. * * [Pausing](AbstractProvider-paused) the provider will pause any * associated timers. */ _setTimeout(_func, timeout) { if (timeout == null) { timeout = 0; } const timerId = this.#nextTimer++; const func = () => { this.#timers.delete(timerId); _func(); }; if (this.paused) { this.#timers.set(timerId, { timer: null, func, time: timeout }); } else { const timer = setTimeout(func, timeout); this.#timers.set(timerId, { timer, func, time: getTime() }); } return timerId; } /** * Perform %%func%% on each subscriber. */ _forEachSubscriber(func) { for (const sub of this.#subs.values()) { func(sub.subscriber); } } /** * Sub-classes may override this to customize subscription * implementations. */ _getSubscriber(sub) { switch (sub.type) { case "debug": case "error": case "network": return new UnmanagedSubscriber(sub.type); case "block": { const subscriber = new PollingBlockSubscriber(this); subscriber.pollingInterval = this.pollingInterval; return subscriber; } case "safe": case "finalized": return new PollingBlockTagSubscriber(this, sub.type); case "event": return new PollingEventSubscriber(this, sub.filter); case "transaction": return new PollingTransactionSubscriber(this, sub.hash); case "orphan": return new PollingOrphanSubscriber(this, sub.filter); } throw new Error(`unsupported event: ${sub.type}`); } /** * If a [[Subscriber]] fails and needs to replace itself, this * method may be used. * * For example, this is used for providers when using the * ``eth_getFilterChanges`` method, which can return null if state * filters are not supported by the backend, allowing the Subscriber * to swap in a [[PollingEventSubscriber]]. */ _recoverSubscriber(oldSub, newSub) { for (const sub of this.#subs.values()) { if (sub.subscriber === oldSub) { if (sub.started) { sub.subscriber.stop(); } sub.subscriber = newSub; if (sub.started) { newSub.start(); } if (this.#pausedState != null) { newSub.pause(this.#pausedState); } break; } } } async #hasSub(event, emitArgs) { let sub = await getSubscription(event, this); // This is a log that is removing an existing log; we actually want // to emit an orphan event for the removed log if (sub.type === "event" && emitArgs && emitArgs.length > 0 && emitArgs[0].removed === true) { sub = await getSubscription({ orphan: "drop-log", log: emitArgs[0] }, this); } return this.#subs.get(sub.tag) || null; } async #getSub(event) { const subscription = await getSubscription(event, this); // Prevent tampering with our tag in any subclass' _getSubscriber const tag = subscription.tag; let sub = this.#subs.get(tag); if (!sub) { const subscriber = this._getSubscriber(subscription); const addressableMap = new WeakMap(); const nameMap = new Map(); sub = { subscriber, tag, addressableMap, nameMap, started: false, listeners: [] }; this.#subs.set(tag, sub); } return sub; } async on(event, listener) { const sub = await this.#getSub(event); sub.listeners.push({ listener, once: false }); if (!sub.started) { sub.subscriber.start(); sub.started = true; if (this.#pausedState != null) { sub.subscriber.pause(this.#pausedState); } } return this; } async once(event, listener) { const sub = await this.#getSub(event); sub.listeners.push({ listener, once: true }); if (!sub.started) { sub.subscriber.start(); sub.started = true; if (this.#pausedState != null) { sub.subscriber.pause(this.#pausedState); } } return this; } async emit(event, ...args) { const sub = await this.#hasSub(event, args); // If there is not subscription or if a recent emit removed // the last of them (which also deleted the sub) do nothing if (!sub || sub.listeners.length === 0) { return false; } const count = sub.listeners.length; sub.listeners = sub.listeners.filter(({ listener, once }) => { const payload = new EventPayload(this, once ? null : listener, event); try { listener.call(this, ...args, payload); } catch (error) {} return !once; }); if (sub.listeners.length === 0) { if (sub.started) { sub.subscriber.stop(); } this.#subs.delete(sub.tag); } return count > 0; } async listenerCount(event) { if (event) { const sub = await this.#hasSub(event); if (!sub) { return 0; } return sub.listeners.length; } let total = 0; for (const { listeners } of this.#subs.values()) { total += listeners.length; } return total; } async listeners(event) { if (event) { const sub = await this.#hasSub(event); if (!sub) { return []; } return sub.listeners.map(({ listener }) => listener); } let result = []; for (const { listeners } of this.#subs.values()) { result = result.concat(listeners.map(({ listener }) => listener)); } return result; } async off(event, listener) { const sub = await this.#hasSub(event); if (!sub) { return this; } if (listener) { const index = sub.listeners.map(({ listener }) => listener).indexOf(listener); if (index >= 0) { sub.listeners.splice(index, 1); } } if (!listener || sub.listeners.length === 0) { if (sub.started) { sub.subscriber.stop(); } this.#subs.delete(sub.tag); } return this; } async removeAllListeners(event) { if (event) { const { tag, started, subscriber } = await this.#getSub(event); if (started) { subscriber.stop(); } this.#subs.delete(tag); } else { for (const [tag, { started, subscriber }] of this.#subs) { if (started) { subscriber.stop(); } this.#subs.delete(tag); } } return this; } // Alias for "on" async addListener(event, listener) { return await this.on(event, listener); } // Alias for "off" async removeListener(event, listener) { return this.off(event, listener); } /** * If this provider has been destroyed using the [[destroy]] method. * * Once destroyed, all resources are reclaimed, internal event loops * and timers are cleaned up and no further requests may be sent to * the provider. */ get destroyed() { return this.#destroyed; } /** * Sub-classes may use this to shutdown any sockets or release their * resources and reject any pending requests. * * Sub-classes **must** call ``super.destroy()``. */ destroy() { // Stop all listeners this.removeAllListeners(); // Shut down all tiemrs for (const timerId of this.#timers.keys()) { this._clearTimeout(timerId); } this.#destroyed = true; } /** * Whether the provider is currently paused. * * A paused provider will not emit any events, and generally should * not make any requests to the network, but that is up to sub-classes * to manage. * * Setting ``paused = true`` is identical to calling ``.pause(false)``, * which will buffer any events that occur while paused until the * provider is unpaused. */ get paused() { return this.#pausedState != null; } set paused(pause) { if (!!pause === this.paused) { return; } if (this.paused) { this.resume(); } else { this.pause(false); } } /** * Pause the provider. If %%dropWhilePaused%%, any events that occur * while paused are dropped, otherwise all events will be emitted once * the provider is unpaused. */ pause(dropWhilePaused) { this.#lastBlockNumber = -1; if (this.#pausedState != null) { if (this.#pausedState == !!dropWhilePaused) { return; } assert(false, "cannot change pause type; resume first", "UNSUPPORTED_OPERATION", { operation: "pause" }); } this._forEachSubscriber(s => s.pause(dropWhilePaused)); this.#pausedState = !!dropWhilePaused; for (const timer of this.#timers.values()) { // Clear the timer if (timer.timer) { clearTimeout(timer.timer); } // Remaining time needed for when we become unpaused timer.time = getTime() - timer.time; } } /** * Resume the provider. */ resume() { if (this.#pausedState == null) { return; } this._forEachSubscriber(s => s.resume()); this.#pausedState = null; for (const timer of this.#timers.values()) { // Remaining time when we were paused let timeout = timer.time; if (timeout < 0) { timeout = 0; } // Start time (in cause paused, so we con compute remaininf time) timer.time = getTime(); // Start the timer setTimeout(timer.func, timeout); } } } function _parseString(result, start) { try { const bytes = _parseBytes(result, start); if (bytes) { return toUtf8String(bytes); } } catch (error) {} return null; } function _parseBytes(result, start) { if (result === "0x") { return null; } try { const offset = getNumber(dataSlice(result, start, start + 32)); const length = getNumber(dataSlice(result, offset, offset + 32)); return dataSlice(result, offset + 32, offset + 32 + length); } catch (error) {} return null; } function numPad(value) { const result = toBeArray(value); if (result.length > 32) { throw new Error("internal; should not happen"); } const padded = new Uint8Array(32); padded.set(result, 32 - result.length); return padded; } function bytesPad(value) { if (value.length % 32 === 0) { return value; } const result = new Uint8Array(Math.ceil(value.length / 32) * 32); result.set(value); return result; } const empty = new Uint8Array([]); // ABI Encodes a series of (bytes, bytes, ...) function encodeBytes(datas) { const result = []; let byteCount = 0; // Add place-holders for pointers as we add items for (let i = 0; i < datas.length; i++) { result.push(empty); byteCount += 32; } for (let i = 0; i < datas.length; i++) { const data = getBytes(datas[i]); // Update the bytes offset result[i] = numPad(byteCount); // The length and padded value of data result.push(numPad(data.length)); result.push(bytesPad(data)); byteCount += 32 + Math.ceil(data.length / 32) * 32; } return concat(result); } const zeros = "0x0000000000000000000000000000000000000000000000000000000000000000"; function parseOffchainLookup(data) { const result = { sender: "", urls: [], calldata: "", selector: "", extraData: "", errorArgs: [] }; assert(dataLength(data) >= 5 * 32, "insufficient OffchainLookup data", "OFFCHAIN_FAULT", { reason: "insufficient OffchainLookup data" }); const sender = dataSlice(data, 0, 32); assert(dataSlice(sender, 0, 12) === dataSlice(zeros, 0, 12), "corrupt OffchainLookup sender", "OFFCHAIN_FAULT", { reason: "corrupt OffchainLookup sender" }); result.sender = dataSlice(sender, 12); // Read the URLs from the response try { const urls = []; const urlsOffset = getNumber(dataSlice(data, 32, 64)); const urlsLength = getNumber(dataSlice(data, urlsOffset, urlsOffset + 32)); const urlsData = dataSlice(data, urlsOffset + 32); for (let u = 0; u < urlsLength; u++) { const url = _parseString(urlsData, u * 32); if (url == null) { throw new Error("abort"); } urls.push(url); } result.urls = urls; } catch (error) { assert(false, "corrupt OffchainLookup urls", "OFFCHAIN_FAULT", { reason: "corrupt OffchainLookup urls" }); } // Get the CCIP calldata to forward try { const calldata = _parseBytes(data, 64); if (calldata == null) { throw new Error("abort"); } result.calldata = calldata; } catch (error) { assert(false, "corrupt OffchainLookup calldata", "OFFCHAIN_FAULT", { reason: "corrupt OffchainLookup calldata" }); } // Get the callbackSelector (bytes4) assert(dataSlice(data, 100, 128) === dataSlice(zeros, 0, 28), "corrupt OffchainLookup callbaackSelector", "OFFCHAIN_FAULT", { reason: "corrupt OffchainLookup callbaackSelector" }); result.selector = dataSlice(data, 96, 100); // Get the extra data to send back to the contract as context try { const extraData = _parseBytes(data, 128); if (extraData == null) { throw new Error("abort"); } result.extraData = extraData; } catch (error) { assert(false, "corrupt OffchainLookup extraData", "OFFCHAIN_FAULT", { reason: "corrupt OffchainLookup extraData" }); } result.errorArgs = "sender,urls,calldata,selector,extraData".split(/,/).map(k => result[k]); return result; } /** * Generally the [[Wallet]] and [[JsonRpcSigner]] and their sub-classes * are sufficent for most developers, but this is provided to * fascilitate more complex Signers. * * @_section: api/providers/abstract-signer: Subclassing Signer [abstract-signer] */ function checkProvider(signer, operation) { if (signer.provider) { return signer.provider; } assert(false, "missing provider", "UNSUPPORTED_OPERATION", { operation }); } async function populate(signer, tx) { let pop = copyRequest(tx); if (pop.to != null) { pop.to = resolveAddress(pop.to, signer); } if (pop.from != null) { const from = pop.from; pop.from = Promise.all([signer.getAddress(), resolveAddress(from, signer)]).then(([address, from]) => { assertArgument(address.toLowerCase() === from.toLowerCase(), "transaction from mismatch", "tx.from", from); return address; }); } else { pop.from = signer.getAddress(); } return await resolveProperties(pop); } /** * An **AbstractSigner** includes most of teh functionality required * to get a [[Signer]] working as expected, but requires a few * Signer-specific methods be overridden. * */ class AbstractSigner { /** * The provider this signer is connected to. */ provider; /** * Creates a new Signer connected to %%provider%%. */ constructor(provider) { defineProperties(this, { provider: provider || null }); } async getNonce(blockTag) { return checkProvider(this, "getTransactionCount").getTransactionCount(await this.getAddress(), blockTag); } async populateCall(tx) { const pop = await populate(this, tx); return pop; } async populateTransaction(tx) { const provider = checkProvider(this, "populateTransaction"); const pop = await populate(this, tx); if (pop.nonce == null) { pop.nonce = await this.getNonce("pending"); } if (pop.gasLimit == null) { pop.gasLimit = await this.estimateGas(pop); } // Populate the chain ID const network = await this.provider.getNetwork(); if (pop.chainId != null) { const chainId = getBigInt(pop.chainId); assertArgument(chainId === network.chainId, "transaction chainId mismatch", "tx.chainId", tx.chainId); } else { pop.chainId = network.chainId; } // Do not allow mixing pre-eip-1559 and eip-1559 properties const hasEip1559 = pop.maxFeePerGas != null || pop.maxPriorityFeePerGas != null; if (pop.gasPrice != null && (pop.type === 2 || hasEip1559)) { assertArgument(false, "eip-1559 transaction do not support gasPrice", "tx", tx); } else if ((pop.type === 0 || pop.type === 1) && hasEip1559) { assertArgument(false, "pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas", "tx", tx); } if ((pop.type === 2 || pop.type == null) && pop.maxFeePerGas != null && pop.maxPriorityFeePerGas != null) { // Fully-formed EIP-1559 transaction (skip getFeeData) pop.type = 2; } else if (pop.type === 0 || pop.type === 1) { // Explicit Legacy or EIP-2930 transaction // We need to get fee data to determine things const feeData = await provider.getFeeData(); assert(feeData.gasPrice != null, "network does not support gasPrice", "UNSUPPORTED_OPERATION", { operation: "getGasPrice" }); // Populate missing gasPrice if (pop.gasPrice == null) { pop.gasPrice = feeData.gasPrice; } } else { // We need to get fee data to determine things const feeData = await provider.getFeeData(); if (pop.type == null) { // We need to auto-detect the intended type of this transaction... if (feeData.maxFeePerGas != null && feeData.maxPriorityFeePerGas != null) { // The network supports EIP-1559! // Upgrade transaction from null to eip-1559 pop.type = 2; if (pop.gasPrice != null) { // Using legacy gasPrice property on an eip-1559 network, // so use gasPrice as both fee properties const gasPrice = pop.gasPrice; delete pop.gasPrice; pop.maxFeePerGas = gasPrice; pop.maxPriorityFeePerGas = gasPrice; } else { // Populate missing fee data if (pop.maxFeePerGas == null) { pop.maxFeePerGas = feeData.maxFeePerGas; } if (pop.maxPriorityFeePerGas == null) { pop.maxPriorityFeePerGas = feeData.maxPriorityFeePerGas; } } } else if (feeData.gasPrice != null) { // Network doesn't support EIP-1559... // ...but they are trying to use EIP-1559 properties assert(!hasEip1559, "network does not support EIP-1559", "UNSUPPORTED_OPERATION", { operation: "populateTransaction" }); // Populate missing fee data if (pop.gasPrice == null) { pop.gasPrice = feeData.gasPrice; } // Explicitly set untyped transaction to legacy // @TODO: Maybe this shold allow type 1? pop.type = 0; } else { // getFeeData has failed us. assert(false, "failed to get consistent fee data", "UNSUPPORTED_OPERATION", { operation: "signer.getFeeData" }); } } else if (pop.type === 2 || pop.type === 3) { // Explicitly using EIP-1559 or EIP-4844 // Populate missing fee data if (pop.maxFeePerGas == null) { pop.maxFeePerGas = feeData.maxFeePerGas; } if (pop.maxPriorityFeePerGas == null) { pop.maxPriorityFeePerGas = feeData.maxPriorityFeePerGas; } } } //@TOOD: Don't await all over the place; save them up for // the end for better batching return await resolveProperties(pop); } async estimateGas(tx) { return checkProvider(this, "estimateGas").estimateGas(await this.populateCall(tx)); } async call(tx) { return checkProvider(this, "call").call(await this.populateCall(tx)); } async resolveName(name) { const provider = checkProvider(this, "resolveName"); return await provider.resolveName(name); } async sendTransaction(tx) { const provider = checkProvider(this, "sendTransaction"); const pop = await this.populateTransaction(tx); delete pop.from; const txObj = Transaction.from(pop); return await provider.broadcastTransaction(await this.signTransaction(txObj)); } } /** * A **VoidSigner** is a class deisgned to allow an address to be used * in any API which accepts a Signer, but for which there are no * credentials available to perform any actual signing. * * This for example allow impersonating an account for the purpose of * static calls or estimating gas, but does not allow sending transactions. */ class VoidSigner extends AbstractSigner { /** * The signer address. */ address; /** * Creates a new **VoidSigner** with %%address%% attached to * %%provider%%. */ constructor(address, provider) { super(provider); defineProperties(this, { address }); } async getAddress() { return this.address; } connect(provider) { return new VoidSigner(this.address, provider); } #throwUnsupported(suffix, operation) { assert(false, `VoidSigner cannot sign ${suffix}`, "UNSUPPORTED_OPERATION", { operation }); } async signTransaction(tx) { this.#throwUnsupported("transactions", "signTransaction"); } async signMessage(message) { this.#throwUnsupported("messages", "signMessage"); } async signTypedData(domain, types, value) { this.#throwUnsupported("typed-data", "signTypedData"); } } function copy(obj) { return JSON.parse(JSON.stringify(obj)); } /** * Some backends support subscribing to events using a Filter ID. * * When subscribing with this technique, the node issues a unique * //Filter ID//. At this point the node dedicates resources to * the filter, so that periodic calls to follow up on the //Filter ID// * will receive any events since the last call. * * @_docloc: api/providers/abstract-provider */ class FilterIdSubscriber { #provider; #filterIdPromise; #poller; #running; #network; #hault; /** * Creates a new **FilterIdSubscriber** which will used [[_subscribe]] * and [[_emitResults]] to setup the subscription and provide the event * to the %%provider%%. */ constructor(provider) { this.#provider = provider; this.#filterIdPromise = null; this.#poller = this.#poll.bind(this); this.#running = false; this.#network = null; this.#hault = false; } /** * Sub-classes **must** override this to begin the subscription. */ _subscribe(provider) { throw new Error("subclasses must override this"); } /** * Sub-classes **must** override this handle the events. */ _emitResults(provider, result) { throw new Error("subclasses must override this"); } /** * Sub-classes **must** override this handle recovery on errors. */ _recover(provider) { throw new Error("subclasses must override this"); } async #poll(blockNumber) { try { // Subscribe if necessary if (this.#filterIdPromise == null) { this.#filterIdPromise = this._subscribe(this.#provider); } // Get the Filter ID let filterId = null; try { filterId = await this.#filterIdPromise; } catch (error) { if (!isError(error, "UNSUPPORTED_OPERATION") || error.operation !== "eth_newFilter") { throw error; } } // The backend does not support Filter ID; downgrade to // polling if (filterId == null) { this.#filterIdPromise = null; this.#provider._recoverSubscriber(this, this._recover(this.#provider)); return; } const network = await this.#provider.getNetwork(); if (!this.#network) { this.#network = network; } if (this.#network.chainId !== network.chainId) { throw new Error("chaid changed"); } if (this.#hault) { return; } const result = await this.#provider.send("eth_getFilterChanges", [filterId]); await this._emitResults(this.#provider, result); } catch (error) { console.log("@TODO", error); } this.#provider.once("block", this.#poller); } #teardown() { const filterIdPromise = this.#filterIdPromise; if (filterIdPromise) { this.#filterIdPromise = null; filterIdPromise.then(filterId => { if (this.#provider.destroyed) { return; } this.#provider.send("eth_uninstallFilter", [filterId]); }); } } start() { if (this.#running) { return; } this.#running = true; this.#poll(-2); } stop() { if (!this.#running) { return; } this.#running = false; this.#hault = true; this.#teardown(); this.#provider.off("block", this.#poller); } pause(dropWhilePaused) { if (dropWhilePaused) { this.#teardown(); } this.#provider.off("block", this.#poller); } resume() { this.start(); } } /** * A **FilterIdSubscriber** for receiving contract events. * * @_docloc: api/providers/abstract-provider */ class FilterIdEventSubscriber extends FilterIdSubscriber { #event; /** * Creates a new **FilterIdEventSubscriber** attached to %%provider%% * listening for %%filter%%. */ constructor(provider, filter) { super(provider); this.#event = copy(filter); } _recover(provider) { return new PollingEventSubscriber(provider, this.#event); } async _subscribe(provider) { const filterId = await provider.send("eth_newFilter", [this.#event]); return filterId; } async _emitResults(provider, results) { for (const result of results) { provider.emit(this.#event, provider._wrapLog(result, provider._network)); } } } /** * A **FilterIdSubscriber** for receiving pending transactions events. * * @_docloc: api/providers/abstract-provider */ class FilterIdPendingSubscriber extends FilterIdSubscriber { async _subscribe(provider) { return await provider.send("eth_newPendingTransactionFilter", []); } async _emitResults(provider, results) { for (const result of results) { provider.emit("pending", result); } } } /** * One of the most common ways to interact with the blockchain is * by a node running a JSON-RPC interface which can be connected to, * based on the transport, using: * * - HTTP or HTTPS - [[JsonRpcProvider]] * - WebSocket - [[WebSocketProvider]] * - IPC - [[IpcSocketProvider]] * * @_section: api/providers/jsonrpc:JSON-RPC Provider [about-jsonrpcProvider] */ // @TODO: // - Add the batching API // https://playground.open-rpc.org/?schemaUrl=https://raw.githubusercontent.com/ethereum/eth1.0-apis/assembled-spec/openrpc.json&uiSchema%5BappBar%5D%5Bui:splitView%5D=true&uiSchema%5BappBar%5D%5Bui:input%5D=false&uiSchema%5BappBar%5D%5Bui:examplesDropdown%5D=false const Primitive = "bigint,boolean,function,number,string,symbol".split(/,/g); //const Methods = "getAddress,then".split(/,/g); function deepCopy(value) { if (value == null || Primitive.indexOf(typeof value) >= 0) { return value; } // Keep any Addressable if (typeof value.getAddress === "function") { return value; } if (Array.isArray(value)) { return value.map(deepCopy); } if (typeof value === "object") { return Object.keys(value).reduce((accum, key) => { accum[key] = value[key]; return accum; }, {}); } throw new Error(`should not happen: ${value} (${typeof value})`); } function stall$2(duration) { return new Promise(resolve => { setTimeout(resolve, duration); }); } function getLowerCase(value) { if (value) { return value.toLowerCase(); } return value; } function isPollable(value) { return value && typeof value.pollingInterval === "number"; } const defaultOptions = { polling: false, staticNetwork: null, batchStallTime: 10, batchMaxSize: 1 << 20, batchMaxCount: 100, cacheTimeout: 250, pollingInterval: 4000 }; // @TODO: Unchecked Signers class JsonRpcSigner extends AbstractSigner { address; constructor(provider, address) { super(provider); address = getAddress(address); defineProperties(this, { address }); } connect(provider) { assert(false, "cannot reconnect JsonRpcSigner", "UNSUPPORTED_OPERATION", { operation: "signer.connect" }); } async getAddress() { return this.address; } // JSON-RPC will automatially fill in nonce, etc. so we just check from async populateTransaction(tx) { return await this.populateCall(tx); } // Returns just the hash of the transaction after sent, which is what // the bare JSON-RPC API does; async sendUncheckedTransaction(_tx) { const tx = deepCopy(_tx); const promises = []; // Make sure the from matches the sender if (tx.from) { const _from = tx.from; promises.push((async () => { const from = await resolveAddress(_from, this.provider); assertArgument(from != null && from.toLowerCase() === this.address.toLowerCase(), "from address mismatch", "transaction", _tx); tx.from = from; })()); } else { tx.from = this.address; } // The JSON-RPC for eth_sendTransaction uses 90000 gas; if the user // wishes to use this, it is easy to specify explicitly, otherwise // we look it up for them. if (tx.gasLimit == null) { promises.push((async () => { tx.gasLimit = await this.provider.estimateGas({ ...tx, from: this.address }); })()); } // The address may be an ENS name or Addressable if (tx.to != null) { const _to = tx.to; promises.push((async () => { tx.to = await resolveAddress(_to, this.provider); })()); } // Wait until all of our properties are filled in if (promises.length) { await Promise.all(promises); } const hexTx = this.provider.getRpcTransaction(tx); return this.provider.send("eth_sendTransaction", [hexTx]); } async sendTransaction(tx) { // This cannot be mined any earlier than any recent block const blockNumber = await this.provider.getBlockNumber(); // Send the transaction const hash = await this.sendUncheckedTransaction(tx); // Unfortunately, JSON-RPC only provides and opaque transaction hash // for a response, and we need the actual transaction, so we poll // for it; it should show up very quickly return await new Promise((resolve, reject) => { const timeouts = [1000, 100]; let invalids = 0; const checkTx = async () => { try { // Try getting the transaction const tx = await this.provider.getTransaction(hash); if (tx != null) { resolve(tx.replaceableTransaction(blockNumber)); return; } } catch (error) { // If we were cancelled: stop polling. // If the data is bad: the node returns bad transactions // If the network changed: calling again will also fail // If unsupported: likely destroyed if (isError(error, "CANCELLED") || isError(error, "BAD_DATA") || isError(error, "NETWORK_ERROR")) { if (error.info == null) { error.info = {}; } error.info.sendTransactionHash = hash; reject(error); return; } // Stop-gap for misbehaving backends; see #4513 if (isError(error, "INVALID_ARGUMENT")) { invalids++; if (error.info == null) { error.info = {}; } error.info.sendTransactionHash = hash; if (invalids > 10) { reject(error); return; } } // Notify anyone that cares; but we will try again, since // it is likely an intermittent service error this.provider.emit("error", makeError("failed to fetch transation after sending (will try again)", "UNKNOWN_ERROR", { error })); } // Wait another 4 seconds this.provider._setTimeout(() => { checkTx(); }, timeouts.pop() || 4000); }; checkTx(); }); } async signTransaction(_tx) { const tx = deepCopy(_tx); // Make sure the from matches the sender if (tx.from) { const from = await resolveAddress(tx.from, this.provider); assertArgument(from != null && from.toLowerCase() === this.address.toLowerCase(), "from address mismatch", "transaction", _tx); tx.from = from; } else { tx.from = this.address; } const hexTx = this.provider.getRpcTransaction(tx); return await this.provider.send("eth_signTransaction", [hexTx]); } async signMessage(_message) { const message = typeof _message === "string" ? toUtf8Bytes(_message) : _message; return await this.provider.send("personal_sign", [hexlify(message), this.address.toLowerCase()]); } async signTypedData(domain, types, _value) { const value = deepCopy(_value); // Populate any ENS names (in-place) const populated = await TypedDataEncoder.resolveNames(domain, types, value, async value => { const address = await resolveAddress(value); assertArgument(address != null, "TypedData does not support null address", "value", value); return address; }); return await this.provider.send("eth_signTypedData_v4", [this.address.toLowerCase(), JSON.stringify(TypedDataEncoder.getPayload(populated.domain, types, populated.value))]); } async unlock(password) { return this.provider.send("personal_unlockAccount", [this.address.toLowerCase(), password, null]); } // https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_sign async _legacySignMessage(_message) { const message = typeof _message === "string" ? toUtf8Bytes(_message) : _message; return await this.provider.send("eth_sign", [this.address.toLowerCase(), hexlify(message)]); } } /** * The JsonRpcApiProvider is an abstract class and **MUST** be * sub-classed. * * It provides the base for all JSON-RPC-based Provider interaction. * * Sub-classing Notes: * - a sub-class MUST override _send * - a sub-class MUST call the `_start()` method once connected */ class JsonRpcApiProvider extends AbstractProvider { #options; // The next ID to use for the JSON-RPC ID field #nextId; // Payloads are queued and triggered in batches using the drainTimer #payloads; #drainTimer; #notReady; #network; #pendingDetectNetwork; #scheduleDrain() { if (this.#drainTimer) { return; } // If we aren't using batching, no harm in sending it immediately const stallTime = this._getOption("batchMaxCount") === 1 ? 0 : this._getOption("batchStallTime"); this.#drainTimer = setTimeout(() => { this.#drainTimer = null; const payloads = this.#payloads; this.#payloads = []; while (payloads.length) { // Create payload batches that satisfy our batch constraints const batch = [payloads.shift()]; while (payloads.length) { if (batch.length === this.#options.batchMaxCount) { break; } batch.push(payloads.shift()); const bytes = JSON.stringify(batch.map(p => p.payload)); if (bytes.length > this.#options.batchMaxSize) { payloads.unshift(batch.pop()); break; } } // Process the result to each payload (async () => { const payload = batch.length === 1 ? batch[0].payload : batch.map(p => p.payload); this.emit("debug", { action: "sendRpcPayload", payload }); try { const result = await this._send(payload); this.emit("debug", { action: "receiveRpcResult", result }); // Process results in batch order for (const { resolve, reject, payload } of batch) { if (this.destroyed) { reject(makeError("provider destroyed; cancelled request", "UNSUPPORTED_OPERATION", { operation: payload.method })); continue; } // Find the matching result const resp = result.filter(r => r.id === payload.id)[0]; // No result; the node failed us in unexpected ways if (resp == null) { const error = makeError("missing response for request", "BAD_DATA", { value: result, info: { payload } }); this.emit("error", error); reject(error); continue; } // The response is an error if ("error" in resp) { reject(this.getRpcError(payload, resp)); continue; } // All good; send the result resolve(resp.result); } } catch (error) { this.emit("debug", { action: "receiveRpcError", error }); for (const { reject } of batch) { // @TODO: augment the error with the payload reject(error); } } })(); } }, stallTime); } constructor(network, options) { super(network, options); this.#nextId = 1; this.#options = Object.assign({}, defaultOptions, options || {}); this.#payloads = []; this.#drainTimer = null; this.#network = null; this.#pendingDetectNetwork = null; { let resolve = null; const promise = new Promise(_resolve => { resolve = _resolve; }); this.#notReady = { promise, resolve }; } const staticNetwork = this._getOption("staticNetwork"); if (typeof staticNetwork === "boolean") { assertArgument(!staticNetwork || network !== "any", "staticNetwork cannot be used on special network 'any'", "options", options); if (staticNetwork && network != null) { this.#network = Network.from(network); } } else if (staticNetwork) { // Make sure any static network is compatbile with the provided netwrok assertArgument(network == null || staticNetwork.matches(network), "staticNetwork MUST match network object", "options", options); this.#network = staticNetwork; } } /** * Returns the value associated with the option %%key%%. * * Sub-classes can use this to inquire about configuration options. */ _getOption(key) { return this.#options[key]; } /** * Gets the [[Network]] this provider has committed to. On each call, the network * is detected, and if it has changed, the call will reject. */ get _network() { assert(this.#network, "network is not available yet", "NETWORK_ERROR"); return this.#network; } /** * Resolves to the non-normalized value by performing %%req%%. * * Sub-classes may override this to modify behavior of actions, * and should generally call ``super._perform`` as a fallback. */ async _perform(req) { // Legacy networks do not like the type field being passed along (which // is fair), so we delete type if it is 0 and a non-EIP-1559 network if (req.method === "call" || req.method === "estimateGas") { let tx = req.transaction; if (tx && tx.type != null && getBigInt(tx.type)) { // If there are no EIP-1559 or newer properties, it might be pre-EIP-1559 if (tx.maxFeePerGas == null && tx.maxPriorityFeePerGas == null) { const feeData = await this.getFeeData(); if (feeData.maxFeePerGas == null && feeData.maxPriorityFeePerGas == null) { // Network doesn't know about EIP-1559 (and hence type) req = Object.assign({}, req, { transaction: Object.assign({}, tx, { type: undefined }) }); } } } } const request = this.getRpcRequest(req); if (request != null) { return await this.send(request.method, request.args); } return super._perform(req); } /** * Sub-classes may override this; it detects the *actual* network that * we are **currently** connected to. * * Keep in mind that [[send]] may only be used once [[ready]], otherwise the * _send primitive must be used instead. */ async _detectNetwork() { const network = this._getOption("staticNetwork"); if (network) { if (network === true) { if (this.#network) { return this.#network; } } else { return network; } } if (this.#pendingDetectNetwork) { return await this.#pendingDetectNetwork; } // If we are ready, use ``send``, which enabled requests to be batched if (this.ready) { this.#pendingDetectNetwork = (async () => { try { const result = Network.from(getBigInt(await this.send("eth_chainId", []))); this.#pendingDetectNetwork = null; return result; } catch (error) { this.#pendingDetectNetwork = null; throw error; } })(); return await this.#pendingDetectNetwork; } // We are not ready yet; use the primitive _send this.#pendingDetectNetwork = (async () => { const payload = { id: this.#nextId++, method: "eth_chainId", params: [], jsonrpc: "2.0" }; this.emit("debug", { action: "sendRpcPayload", payload }); let result; try { result = (await this._send(payload))[0]; this.#pendingDetectNetwork = null; } catch (error) { this.#pendingDetectNetwork = null; this.emit("debug", { action: "receiveRpcError", error }); throw error; } this.emit("debug", { action: "receiveRpcResult", result }); if ("result" in result) { return Network.from(getBigInt(result.result)); } throw this.getRpcError(payload, result); })(); return await this.#pendingDetectNetwork; } /** * Sub-classes **MUST** call this. Until [[_start]] has been called, no calls * will be passed to [[_send]] from [[send]]. If it is overridden, then * ``super._start()`` **MUST** be called. * * Calling it multiple times is safe and has no effect. */ _start() { if (this.#notReady == null || this.#notReady.resolve == null) { return; } this.#notReady.resolve(); this.#notReady = null; (async () => { // Bootstrap the network while (this.#network == null && !this.destroyed) { try { this.#network = await this._detectNetwork(); } catch (error) { if (this.destroyed) { break; } console.log("JsonRpcProvider failed to detect network and cannot start up; retry in 1s (perhaps the URL is wrong or the node is not started)"); this.emit("error", makeError("failed to bootstrap network detection", "NETWORK_ERROR", { event: "initial-network-discovery", info: { error } })); await stall$2(1000); } } // Start dispatching requests this.#scheduleDrain(); })(); } /** * Resolves once the [[_start]] has been called. This can be used in * sub-classes to defer sending data until the connection has been * established. */ async _waitUntilReady() { if (this.#notReady == null) { return; } return await this.#notReady.promise; } /** * Return a Subscriber that will manage the %%sub%%. * * Sub-classes may override this to modify the behavior of * subscription management. */ _getSubscriber(sub) { // Pending Filters aren't availble via polling if (sub.type === "pending") { return new FilterIdPendingSubscriber(this); } if (sub.type === "event") { if (this._getOption("polling")) { return new PollingEventSubscriber(this, sub.filter); } return new FilterIdEventSubscriber(this, sub.filter); } // Orphaned Logs are handled automatically, by the filter, since // logs with removed are emitted by it if (sub.type === "orphan" && sub.filter.orphan === "drop-log") { return new UnmanagedSubscriber("orphan"); } return super._getSubscriber(sub); } /** * Returns true only if the [[_start]] has been called. */ get ready() { return this.#notReady == null; } /** * Returns %%tx%% as a normalized JSON-RPC transaction request, * which has all values hexlified and any numeric values converted * to Quantity values. */ getRpcTransaction(tx) { const result = {}; // JSON-RPC now requires numeric values to be "quantity" values ["chainId", "gasLimit", "gasPrice", "type", "maxFeePerGas", "maxPriorityFeePerGas", "nonce", "value"].forEach(key => { if (tx[key] == null) { return; } let dstKey = key; if (key === "gasLimit") { dstKey = "gas"; } result[dstKey] = toQuantity(getBigInt(tx[key], `tx.${key}`)); }); // Make sure addresses and data are lowercase ["from", "to", "data"].forEach(key => { if (tx[key] == null) { return; } result[key] = hexlify(tx[key]); }); // Normalize the access list object if (tx.accessList) { result["accessList"] = accessListify(tx.accessList); } if (tx.blobVersionedHashes) { // @TODO: Remove this case once EIP-4844 added to prepared tx result["blobVersionedHashes"] = tx.blobVersionedHashes.map(h => h.toLowerCase()); } // @TODO: blobs should probably also be copied over, optionally // accounting for the kzg property to backfill blobVersionedHashes // using the commitment. Or should that be left as an exercise to // the caller? return result; } /** * Returns the request method and arguments required to perform * %%req%%. */ getRpcRequest(req) { switch (req.method) { case "chainId": return { method: "eth_chainId", args: [] }; case "getBlockNumber": return { method: "eth_blockNumber", args: [] }; case "getGasPrice": return { method: "eth_gasPrice", args: [] }; case "getPriorityFee": return { method: "eth_maxPriorityFeePerGas", args: [] }; case "getBalance": return { method: "eth_getBalance", args: [getLowerCase(req.address), req.blockTag] }; case "getTransactionCount": return { method: "eth_getTransactionCount", args: [getLowerCase(req.address), req.blockTag] }; case "getCode": return { method: "eth_getCode", args: [getLowerCase(req.address), req.blockTag] }; case "getStorage": return { method: "eth_getStorageAt", args: [getLowerCase(req.address), "0x" + req.position.toString(16), req.blockTag] }; case "broadcastTransaction": return { method: "eth_sendRawTransaction", args: [req.signedTransaction] }; case "getBlock": if ("blockTag" in req) { return { method: "eth_getBlockByNumber", args: [req.blockTag, !!req.includeTransactions] }; } else if ("blockHash" in req) { return { method: "eth_getBlockByHash", args: [req.blockHash, !!req.includeTransactions] }; } break; case "getTransaction": return { method: "eth_getTransactionByHash", args: [req.hash] }; case "getTransactionReceipt": return { method: "eth_getTransactionReceipt", args: [req.hash] }; case "call": return { method: "eth_call", args: [this.getRpcTransaction(req.transaction), req.blockTag] }; case "estimateGas": { return { method: "eth_estimateGas", args: [this.getRpcTransaction(req.transaction)] }; } case "getLogs": if (req.filter && req.filter.address != null) { if (Array.isArray(req.filter.address)) { req.filter.address = req.filter.address.map(getLowerCase); } else { req.filter.address = getLowerCase(req.filter.address); } } return { method: "eth_getLogs", args: [req.filter] }; } return null; } /** * Returns an ethers-style Error for the given JSON-RPC error * %%payload%%, coalescing the various strings and error shapes * that different nodes return, coercing them into a machine-readable * standardized error. */ getRpcError(payload, _error) { const { method } = payload; const { error } = _error; if (method === "eth_estimateGas" && error.message) { const msg = error.message; if (!msg.match(/revert/i) && msg.match(/insufficient funds/i)) { return makeError("insufficient funds", "INSUFFICIENT_FUNDS", { transaction: payload.params[0], info: { payload, error } }); } } if (method === "eth_call" || method === "eth_estimateGas") { const result = spelunkData(error); const e = AbiCoder.getBuiltinCallException(method === "eth_call" ? "call" : "estimateGas", payload.params[0], result ? result.data : null); e.info = { error, payload }; return e; } // Only estimateGas and call can return arbitrary contract-defined text, so now we // we can process text safely. const message = JSON.stringify(spelunkMessage(error)); if (typeof error.message === "string" && error.message.match(/user denied|ethers-user-denied/i)) { const actionMap = { eth_sign: "signMessage", personal_sign: "signMessage", eth_signTypedData_v4: "signTypedData", eth_signTransaction: "signTransaction", eth_sendTransaction: "sendTransaction", eth_requestAccounts: "requestAccess", wallet_requestAccounts: "requestAccess" }; return makeError(`user rejected action`, "ACTION_REJECTED", { action: actionMap[method] || "unknown", reason: "rejected", info: { payload, error } }); } if (method === "eth_sendRawTransaction" || method === "eth_sendTransaction") { const transaction = payload.params[0]; if (message.match(/insufficient funds|base fee exceeds gas limit/i)) { return makeError("insufficient funds for intrinsic transaction cost", "INSUFFICIENT_FUNDS", { transaction, info: { error } }); } if (message.match(/nonce/i) && message.match(/too low/i)) { return makeError("nonce has already been used", "NONCE_EXPIRED", { transaction, info: { error } }); } // "replacement transaction underpriced" if (message.match(/replacement transaction/i) && message.match(/underpriced/i)) { return makeError("replacement fee too low", "REPLACEMENT_UNDERPRICED", { transaction, info: { error } }); } if (message.match(/only replay-protected/i)) { return makeError("legacy pre-eip-155 transactions not supported", "UNSUPPORTED_OPERATION", { operation: method, info: { transaction, info: { error } } }); } } let unsupported = !!message.match(/the method .* does not exist/i); if (!unsupported) { if (error && error.details && error.details.startsWith("Unauthorized method:")) { unsupported = true; } } if (unsupported) { return makeError("unsupported operation", "UNSUPPORTED_OPERATION", { operation: payload.method, info: { error, payload } }); } return makeError("could not coalesce error", "UNKNOWN_ERROR", { error, payload }); } /** * Requests the %%method%% with %%params%% via the JSON-RPC protocol * over the underlying channel. This can be used to call methods * on the backend that do not have a high-level API within the Provider * API. * * This method queues requests according to the batch constraints * in the options, assigns the request a unique ID. * * **Do NOT override** this method in sub-classes; instead * override [[_send]] or force the options values in the * call to the constructor to modify this method's behavior. */ send(method, params) { // @TODO: cache chainId?? purge on switch_networks // We have been destroyed; no operations are supported anymore if (this.destroyed) { return Promise.reject(makeError("provider destroyed; cancelled request", "UNSUPPORTED_OPERATION", { operation: method })); } const id = this.#nextId++; const promise = new Promise((resolve, reject) => { this.#payloads.push({ resolve, reject, payload: { method, params, id, jsonrpc: "2.0" } }); }); // If there is not a pending drainTimer, set one this.#scheduleDrain(); return promise; } /** * Resolves to the [[Signer]] account for %%address%% managed by * the client. * * If the %%address%% is a number, it is used as an index in the * the accounts from [[listAccounts]]. * * This can only be used on clients which manage accounts (such as * Geth with imported account or MetaMask). * * Throws if the account doesn't exist. */ async getSigner(address) { if (address == null) { address = 0; } const accountsPromise = this.send("eth_accounts", []); // Account index if (typeof address === "number") { const accounts = await accountsPromise; if (address >= accounts.length) { throw new Error("no such account"); } return new JsonRpcSigner(this, accounts[address]); } const { accounts } = await resolveProperties({ network: this.getNetwork(), accounts: accountsPromise }); // Account address address = getAddress(address); for (const account of accounts) { if (getAddress(account) === address) { return new JsonRpcSigner(this, address); } } throw new Error("invalid account"); } async listAccounts() { const accounts = await this.send("eth_accounts", []); return accounts.map(a => new JsonRpcSigner(this, a)); } destroy() { // Stop processing requests if (this.#drainTimer) { clearTimeout(this.#drainTimer); this.#drainTimer = null; } // Cancel all pending requests for (const { payload, reject } of this.#payloads) { reject(makeError("provider destroyed; cancelled request", "UNSUPPORTED_OPERATION", { operation: payload.method })); } this.#payloads = []; // Parent clean-up super.destroy(); } } // @TODO: remove this in v7, it is not exported because this functionality // is exposed in the JsonRpcApiProvider by setting polling to true. It should // be safe to remove regardless, because it isn't reachable, but just in case. /** * @_ignore: */ class JsonRpcApiPollingProvider extends JsonRpcApiProvider { #pollingInterval; constructor(network, options) { super(network, options); let pollingInterval = this._getOption("pollingInterval"); if (pollingInterval == null) { pollingInterval = defaultOptions.pollingInterval; } this.#pollingInterval = pollingInterval; } _getSubscriber(sub) { const subscriber = super._getSubscriber(sub); if (isPollable(subscriber)) { subscriber.pollingInterval = this.#pollingInterval; } return subscriber; } /** * The polling interval (default: 4000 ms) */ get pollingInterval() { return this.#pollingInterval; } set pollingInterval(value) { if (!Number.isInteger(value) || value < 0) { throw new Error("invalid interval"); } this.#pollingInterval = value; this._forEachSubscriber(sub => { if (isPollable(sub)) { sub.pollingInterval = this.#pollingInterval; } }); } } /** * The JsonRpcProvider is one of the most common Providers, * which performs all operations over HTTP (or HTTPS) requests. * * Events are processed by polling the backend for the current block * number; when it advances, all block-base events are then checked * for updates. */ class JsonRpcProvider extends JsonRpcApiPollingProvider { #connect; constructor(url, network, options) { if (url == null) { url = "http:/\/localhost:8545"; } super(network, options); if (typeof url === "string") { this.#connect = new FetchRequest(url); } else { this.#connect = url.clone(); } } _getConnection() { return this.#connect.clone(); } async send(method, params) { // All requests are over HTTP, so we can just start handling requests // We do this here rather than the constructor so that we don't send any // requests to the network (i.e. eth_chainId) until we absolutely have to. await this._start(); return await super.send(method, params); } async _send(payload) { // Configure a POST connection for the requested method const request = this._getConnection(); request.body = JSON.stringify(payload); request.setHeader("content-type", "application/json"); const response = await request.send(); response.assertOk(); let resp = response.bodyJson; if (!Array.isArray(resp)) { resp = [resp]; } return resp; } } function spelunkData(value) { if (value == null) { return null; } // These *are* the droids we're looking for. if (typeof value.message === "string" && value.message.match(/revert/i) && isHexString(value.data)) { return { message: value.message, data: value.data }; } // Spelunk further... if (typeof value === "object") { for (const key in value) { const result = spelunkData(value[key]); if (result) { return result; } } return null; } // Might be a JSON string we can further descend... if (typeof value === "string") { try { return spelunkData(JSON.parse(value)); } catch (error) {} } return null; } function _spelunkMessage(value, result) { if (value == null) { return; } // These *are* the droids we're looking for. if (typeof value.message === "string") { result.push(value.message); } // Spelunk further... if (typeof value === "object") { for (const key in value) { _spelunkMessage(value[key], result); } } // Might be a JSON string we can further descend... if (typeof value === "string") { try { return _spelunkMessage(JSON.parse(value), result); } catch (error) {} } } function spelunkMessage(value) { const result = []; _spelunkMessage(value, result); return result; } /** * The **BaseWallet** is a stream-lined implementation of a * [[Signer]] that operates with a private key. * * It is preferred to use the [[Wallet]] class, as it offers * additional functionality and simplifies loading a variety * of JSON formats, Mnemonic Phrases, etc. * * This class may be of use for those attempting to implement * a minimal Signer. */ class BaseWallet extends AbstractSigner { /** * The wallet address. */ address; #signingKey; /** * Creates a new BaseWallet for %%privateKey%%, optionally * connected to %%provider%%. * * If %%provider%% is not specified, only offline methods can * be used. */ constructor(privateKey, provider) { super(provider); assertArgument(privateKey && typeof privateKey.sign === "function", "invalid private key", "privateKey", "[ REDACTED ]"); this.#signingKey = privateKey; const address = computeAddress(this.signingKey.publicKey); defineProperties(this, { address }); } // Store private values behind getters to reduce visibility // in console.log /** * The [[SigningKey]] used for signing payloads. */ get signingKey() { return this.#signingKey; } /** * The private key for this wallet. */ get privateKey() { return this.signingKey.privateKey; } async getAddress() { return this.address; } connect(provider) { return new BaseWallet(this.#signingKey, provider); } async signTransaction(tx) { // Replace any Addressable or ENS name with an address const { to, from } = await resolveProperties({ to: tx.to ? resolveAddress(tx.to, this.provider) : undefined, from: tx.from ? resolveAddress(tx.from, this.provider) : undefined }); if (to != null) { tx.to = to; } if (from != null) { tx.from = from; } if (tx.from != null) { assertArgument(getAddress(tx.from) === this.address, "transaction from address mismatch", "tx.from", tx.from); delete tx.from; } // Build the transaction const btx = Transaction.from(tx); btx.signature = this.signingKey.sign(btx.unsignedHash); return btx.serialized; } async signMessage(message) { return this.signMessageSync(message); } // @TODO: Add a secialized signTx and signTyped sync that enforces // all parameters are known? /** * Returns the signature for %%message%% signed with this wallet. */ signMessageSync(message) { return this.signingKey.sign(hashMessage(message)).serialized; } async signTypedData(domain, types, value) { // Populate any ENS names const populated = await TypedDataEncoder.resolveNames(domain, types, value, async name => { // @TODO: this should use resolveName; addresses don't // need a provider assert(this.provider != null, "cannot resolve ENS names without a provider", "UNSUPPORTED_OPERATION", { operation: "resolveName", info: { name } }); const address = await this.provider.resolveName(name); assert(address != null, "unconfigured ENS name", "UNCONFIGURED_NAME", { value: name }); return address; }); return this.signingKey.sign(TypedDataEncoder.hash(populated.domain, types, populated.value)).serialized; } } const subsChrs = " !#$%&'()*+,-./<=>?@[]^_`{|}~"; const Word = /^[a-z]*$/i; function unfold(words, sep) { let initial = 97; return words.reduce((accum, word) => { if (word === sep) { initial++; } else if (word.match(Word)) { accum.push(String.fromCharCode(initial) + word); } else { initial = 97; accum.push(word); } return accum; }, []); } /** * @_ignore */ function decode(data, subs) { // Replace all the substitutions with their expanded form for (let i = subsChrs.length - 1; i >= 0; i--) { data = data.split(subsChrs[i]).join(subs.substring(2 * i, 2 * i + 2)); } // Get all tle clumps; each suffix, first-increment and second-increment const clumps = []; const leftover = data.replace(/(:|([0-9])|([A-Z][a-z]*))/g, (all, item, semi, word) => { if (semi) { for (let i = parseInt(semi); i >= 0; i--) { clumps.push(";"); } } else { clumps.push(item.toLowerCase()); } return ""; }); /* c8 ignore start */ if (leftover) { throw new Error(`leftovers: ${JSON.stringify(leftover)}`); } /* c8 ignore stop */ return unfold(unfold(clumps, ";"), ":"); } /** * @_ignore */ function decodeOwl(data) { assertArgument(data[0] === "0", "unsupported auwl data", "data", data); return decode(data.substring(1 + 2 * subsChrs.length), data.substring(1, 1 + 2 * subsChrs.length)); } /** * A Wordlist represents a collection of language-specific * words used to encode and devoce [[link-bip-39]] encoded data * by mapping words to 11-bit values and vice versa. */ class Wordlist { locale; /** * Creates a new Wordlist instance. * * Sub-classes MUST call this if they provide their own constructor, * passing in the locale string of the language. * * Generally there is no need to create instances of a Wordlist, * since each language-specific Wordlist creates an instance and * there is no state kept internally, so they are safe to share. */ constructor(locale) { defineProperties(this, { locale }); } /** * Sub-classes may override this to provide a language-specific * method for spliting %%phrase%% into individual words. * * By default, %%phrase%% is split using any sequences of * white-space as defined by regular expressions (i.e. ``/\s+/``). */ split(phrase) { return phrase.toLowerCase().split(/\s+/g); } /** * Sub-classes may override this to provider a language-specific * method for joining %%words%% into a phrase. * * By default, %%words%% are joined by a single space. */ join(words) { return words.join(" "); } } // Use the encode-latin.js script to create the necessary // data files to be consumed by this class /** * An OWL format Wordlist is an encoding method that exploits * the general locality of alphabetically sorted words to * achieve a simple but effective means of compression. * * This class is generally not useful to most developers as * it is used mainly internally to keep Wordlists for languages * based on ASCII-7 small. * * If necessary, there are tools within the ``generation/`` folder * to create the necessary data. */ class WordlistOwl extends Wordlist { #data; #checksum; /** * Creates a new Wordlist for %%locale%% using the OWL %%data%% * and validated against the %%checksum%%. */ constructor(locale, data, checksum) { super(locale); this.#data = data; this.#checksum = checksum; this.#words = null; } /** * The OWL-encoded data. */ get _data() { return this.#data; } /** * Decode all the words for the wordlist. */ _decodeWords() { return decodeOwl(this.#data); } #words; #loadWords() { if (this.#words == null) { const words = this._decodeWords(); // Verify the computed list matches the official list const checksum = id(words.join("\n") + "\n"); /* c8 ignore start */ if (checksum !== this.#checksum) { throw new Error(`BIP39 Wordlist for ${this.locale} FAILED`); } /* c8 ignore stop */ this.#words = words; } return this.#words; } getWord(index) { const words = this.#loadWords(); assertArgument(index >= 0 && index < words.length, `invalid word index: ${index}`, "index", index); return words[index]; } getWordIndex(word) { return this.#loadWords().indexOf(word); } } const words = "0erleonalorenseinceregesticitStanvetearctssi#ch2Athck&tneLl0And#Il.yLeOutO=S|S%b/ra@SurdU'0Ce[Cid|CountCu'Hie=IdOu,-Qui*Ro[TT]T%T*[Tu$0AptDD-tD*[Ju,M.UltV<)Vi)0Rob-0FairF%dRaid0A(EEntRee0Ead0MRRp%tS!_rmBumCoholErtI&LLeyLowMo,O}PhaReadySoT Ways0A>urAz(gOngOuntU'd0Aly,Ch%Ci|G G!GryIm$K!Noun)Nu$O` Sw T&naTiqueXietyY1ArtOlogyPe?P!Pro=Ril1ChCt-EaEnaGueMMedM%MyOundR<+Re,Ri=RowTTefa@Ti,Tw%k0KPe@SaultSetSi,SumeThma0H!>OmTa{T&dT.udeTra@0Ct]D.Gu,NtTh%ToTumn0Era+OcadoOid0AkeA*AyEsomeFulKw?d0Is:ByChel%C#D+GL<)Lc#y~MbooN_{Ad!AftAmA}AshAt AwlAzyEamEd.EekEwI{etImeIspIt-OpO[Ou^OwdUci$UelUi'Umb!Un^UshYY,$2BeLtu*PPbo?dRiousRr|Rta(R=Sh]/omTe3C!:DMa+MpN)Ng R(gShUght WnY3AlBa>BrisCadeCemb CideCl(eC%a>C*a'ErF&'F(eFyG*eLayLiv M3AgramAlAm#dAryCeE'lEtFf G.$Gn.yLemmaNn NosaurRe@RtSag*eScov Sea'ShSmi[S%d Splay/<)V tVideV%)Zzy5Ct%Cum|G~Lph(Ma(Na>NkeyN%OrSeUb!Ve_ftAg#AmaA,-AwEamE[IftIllInkIpI=OpUmY2CkMbNeR(g/T^Ty1Arf1Nam-:G G!RlyRnR`Sily/Sy1HoOlogyOnomy0GeItUca>1F%t0G1GhtTh 2BowD E@r-EgSe0B?kBodyBra)Er+Ot]PloyPow Pty0Ab!A@DD![D%'EmyErgyF%)Ga+G(eH<)JoyLi,OughR-hRollSu*T Ti*TryVelope1Isode0U$Uip0AA'OdeOs]R%Upt0CapeSayS&)Ta>0Ern$H-s1Id&)IlOkeOl=1A@Amp!Ce[Ch<+C.eCludeCu'Ecu>Erci'Hau,Hib.I!I,ItOt-PM&'Mu}Pa@Po'Pro=Pul'0ChCludeComeC*a'DexD-a>Do%Du,ryFN Noc|PutQuirySSue0Em1Ory:CketGu?RZz3AlousAns~yWel9BInKeUr}yY5D+I)MpNg!Ni%Nk/:Ng?oo3EnEpT^upY3CkDD}yNdNgdomSsTT^&TeTt&Wi4EeIfeO{Ow:BBelB%Dd DyKeMpNgua+PtopR+T T(UghUndryVaWWnWsu.Y Zy3Ad AfArnA=Ctu*FtGG$G&dIsu*M#NdNg`NsOp?dSs#Tt Vel3ArB tyBr?yC&'FeFtGhtKeMbM.NkOnQuid/Tt!VeZ?d5AdAnB, C$CkG-NelyNgOpTt yUdUn+VeY$5CkyGga+Mb N?N^Xury3R-s:Ch(eDG-G}tIdIlInJ%KeMm$NNa+Nda>NgoNs]Nu$P!Rb!R^Rg(R(eRketRria+SkSs/ T^T i$ThTrixTt XimumZe3AdowAnAsu*AtCh<-D$DiaLodyLtMb M%yNt]NuRcyR+R.RryShSsa+T$Thod3Dd!DnightLk~]M-NdNimumN%Nu>Rac!Rr%S ySs/akeXXedXtu*5Bi!DelDifyMM|N.%NkeyN, N`OnR$ReRn(gSqu.oTh T]T%Unta(U'VeVie5ChFf(LeLtiplySc!SeumShroomS-/Tu$3Self/ yTh:I=MePk(Rrow/yT]Tu*3ArCkEdGati=G!@I` PhewR=/TTw%kUtr$V WsXt3CeGht5B!I'M(eeOd!Rm$R`SeTab!TeTh(gTi)VelW5C!?Mb R'T:K0EyJe@Li+Scu*S =Ta(Vious0CurEAyEa'Ed+U{UgUn+2EmEtIntL?LeLi)NdNyOlPul?Rt]S.]Ssib!/TatoTt yV tyWd W _@i)Ai'Ed-tEf Epa*Es|EttyEv|I)IdeIm?yIntI%.yIs#Iva>IzeOb!mO)[Odu)Of.OgramOje@Omo>OofOp tyOsp O>@OudOvide2Bl-Dd(g~LpL'Mpk(N^PilPpyR^a'R.yRpo'R'ShTZz!3Ramid:99Al.yAntumArt E,]I{ItIzO>:Bb.Cco#CeCkD?DioIlInI'~yMpN^NdomN+PidReTeTh V&WZ%3AdyAlAs#BelBuildC$lCei=CipeC%dCyc!Du)F!@F%mFu'G]G*tGul?Je@LaxLea'LiefLyMa(Memb M(dMo=Nd NewNtOp&PairPeatPla)P%tQui*ScueSemb!Si,Sour)Sp#'SultTi*T*atTurnUn]Ve$ViewW?d2Y`m0BBb#CeChDeD+F!GhtGidNgOtPp!SkTu$V$V 5AdA,BotBu,CketM<)OfOkieOmSeTa>UghUndU>Y$5Bb DeGLeNNwayR$:DDd!D}[FeIlLadLm#L#LtLu>MeMp!NdTisfyToshiU)Usa+VeY1A!AnA*Att E}HemeHoolI&)I[%sOrp]OutRapRe&RiptRub1AAr^As#AtC#dC*tCt]Cur.yEdEkGm|Le@~M(?Ni%N'Nt&)RiesRvi)Ss]Tt!TupV&_dowAftAllowA*EdEllEriffIeldIftI}IpIv O{OeOotOpOrtOuld O=RimpRugUff!Y0Bl(gCkDeE+GhtGnL|Lk~yLv Mil?Mp!N)NgR&/ Tua>XZe1A>Et^IIllInIrtUll0AbAmEepEnd I)IdeIghtImOgAyEakEelEmEpE*oI{IllIngO{Oma^O}OolOryO=Ra>gyReetRikeR#gRugg!Ud|UffUmb!Y!0Bje@Bm.BwayC)[ChDd&Ff G?G+,ItMm NNnyN'tP PplyP*meReRfa)R+Rpri'RroundR=ySpe@/a(1AllowAmpApArmE?EetIftImIngIt^Ord1MbolMptomRup/em:B!Ck!GIlL|LkNkPeR+tSk/eTtooXi3A^Am~NNGradeHoldOnP Set1BOng::Rd3Ar~ow9UUngU`:3BraRo9NeO"; const checksum = "0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60"; let wordlist = null; /** * The [[link-bip39-en]] for [mnemonic phrases](link-bip-39). * * @_docloc: api/wordlists */ class LangEn extends WordlistOwl { /** * Creates a new instance of the English language Wordlist. * * This should be unnecessary most of the time as the exported * [[langEn]] should suffice. * * @_ignore: */ constructor() { super("en", words, checksum); } /** * Returns a singleton instance of a ``LangEn``, creating it * if this is the first time being called. */ static wordlist() { if (wordlist == null) { wordlist = new LangEn(); } return wordlist; } } // Returns a byte with the MSB bits set function getUpperMask(bits) { return (1 << bits) - 1 << 8 - bits & 0xff; } // Returns a byte with the LSB bits set function getLowerMask(bits) { return (1 << bits) - 1 & 0xff; } function mnemonicToEntropy(mnemonic, wordlist) { assertNormalize("NFKD"); if (wordlist == null) { wordlist = LangEn.wordlist(); } const words = wordlist.split(mnemonic); assertArgument(words.length % 3 === 0 && words.length >= 12 && words.length <= 24, "invalid mnemonic length", "mnemonic", "[ REDACTED ]"); const entropy = new Uint8Array(Math.ceil(11 * words.length / 8)); let offset = 0; for (let i = 0; i < words.length; i++) { let index = wordlist.getWordIndex(words[i].normalize("NFKD")); assertArgument(index >= 0, `invalid mnemonic word at index ${i}`, "mnemonic", "[ REDACTED ]"); for (let bit = 0; bit < 11; bit++) { if (index & 1 << 10 - bit) { entropy[offset >> 3] |= 1 << 7 - offset % 8; } offset++; } } const entropyBits = 32 * words.length / 3; const checksumBits = words.length / 3; const checksumMask = getUpperMask(checksumBits); const checksum = getBytes(sha256(entropy.slice(0, entropyBits / 8)))[0] & checksumMask; assertArgument(checksum === (entropy[entropy.length - 1] & checksumMask), "invalid mnemonic checksum", "mnemonic", "[ REDACTED ]"); return hexlify(entropy.slice(0, entropyBits / 8)); } function entropyToMnemonic(entropy, wordlist) { assertArgument(entropy.length % 4 === 0 && entropy.length >= 16 && entropy.length <= 32, "invalid entropy size", "entropy", "[ REDACTED ]"); if (wordlist == null) { wordlist = LangEn.wordlist(); } const indices = [0]; let remainingBits = 11; for (let i = 0; i < entropy.length; i++) { // Consume the whole byte (with still more to go) if (remainingBits > 8) { indices[indices.length - 1] <<= 8; indices[indices.length - 1] |= entropy[i]; remainingBits -= 8; // This byte will complete an 11-bit index } else { indices[indices.length - 1] <<= remainingBits; indices[indices.length - 1] |= entropy[i] >> 8 - remainingBits; // Start the next word indices.push(entropy[i] & getLowerMask(8 - remainingBits)); remainingBits += 3; } } // Compute the checksum bits const checksumBits = entropy.length / 4; const checksum = parseInt(sha256(entropy).substring(2, 4), 16) & getUpperMask(checksumBits); // Shift the checksum into the word indices indices[indices.length - 1] <<= checksumBits; indices[indices.length - 1] |= checksum >> 8 - checksumBits; return wordlist.join(indices.map(index => wordlist.getWord(index))); } const _guard$1 = {}; /** * A **Mnemonic** wraps all properties required to compute [[link-bip-39]] * seeds and convert between phrases and entropy. */ class Mnemonic { /** * The mnemonic phrase of 12, 15, 18, 21 or 24 words. * * Use the [[wordlist]] ``split`` method to get the individual words. */ phrase; /** * The password used for this mnemonic. If no password is used this * is the empty string (i.e. ``""``) as per the specification. */ password; /** * The wordlist for this mnemonic. */ wordlist; /** * The underlying entropy which the mnemonic encodes. */ entropy; /** * @private */ constructor(guard, entropy, phrase, password, wordlist) { if (password == null) { password = ""; } if (wordlist == null) { wordlist = LangEn.wordlist(); } assertPrivate(guard, _guard$1, "Mnemonic"); defineProperties(this, { phrase, password, wordlist, entropy }); } /** * Returns the seed for the mnemonic. */ computeSeed() { const salt = toUtf8Bytes("mnemonic" + this.password, "NFKD"); return pbkdf2(toUtf8Bytes(this.phrase, "NFKD"), salt, 2048, 64, "sha512"); } /** * Creates a new Mnemonic for the %%phrase%%. * * The default %%password%% is the empty string and the default * wordlist is the [English wordlists](LangEn). */ static fromPhrase(phrase, password, wordlist) { // Normalize the case and space; throws if invalid const entropy = mnemonicToEntropy(phrase, wordlist); phrase = entropyToMnemonic(getBytes(entropy), wordlist); return new Mnemonic(_guard$1, entropy, phrase, password, wordlist); } /** * Create a new **Mnemonic** from the %%entropy%%. * * The default %%password%% is the empty string and the default * wordlist is the [English wordlists](LangEn). */ static fromEntropy(_entropy, password, wordlist) { const entropy = getBytes(_entropy, "entropy"); const phrase = entropyToMnemonic(entropy, wordlist); return new Mnemonic(_guard$1, hexlify(entropy), phrase, password, wordlist); } /** * Returns the phrase for %%mnemonic%%. */ static entropyToPhrase(_entropy, wordlist) { const entropy = getBytes(_entropy, "entropy"); return entropyToMnemonic(entropy, wordlist); } /** * Returns the entropy for %%phrase%%. */ static phraseToEntropy(phrase, wordlist) { return mnemonicToEntropy(phrase, wordlist); } /** * Returns true if %%phrase%% is a valid [[link-bip-39]] phrase. * * This checks all the provided words belong to the %%wordlist%%, * that the length is valid and the checksum is correct. */ static isValidMnemonic(phrase, wordlist) { try { mnemonicToEntropy(phrase, wordlist); return true; } catch (error) {} return false; } } /*! MIT License. Copyright 2015-2022 Richard Moore . See LICENSE.txt. */ var __classPrivateFieldGet$2 = undefined && undefined.__classPrivateFieldGet || function (receiver, state, kind, f) { if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); }; var __classPrivateFieldSet$2 = undefined && undefined.__classPrivateFieldSet || function (receiver, state, value, kind, f) { if (kind === "m") throw new TypeError("Private method is not writable"); if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value; }; var _AES_key, _AES_Kd, _AES_Ke; // Number of rounds by keysize const numberOfRounds = { 16: 10, 24: 12, 32: 14 }; // Round constant words const rcon = [0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91]; // S-box and Inverse S-box (S is for Substitution) const S = [0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76, 0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0, 0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0, 0xb7, 0xfd, 0x93, 0x26, 0x36, 0x3f, 0xf7, 0xcc, 0x34, 0xa5, 0xe5, 0xf1, 0x71, 0xd8, 0x31, 0x15, 0x04, 0xc7, 0x23, 0xc3, 0x18, 0x96, 0x05, 0x9a, 0x07, 0x12, 0x80, 0xe2, 0xeb, 0x27, 0xb2, 0x75, 0x09, 0x83, 0x2c, 0x1a, 0x1b, 0x6e, 0x5a, 0xa0, 0x52, 0x3b, 0xd6, 0xb3, 0x29, 0xe3, 0x2f, 0x84, 0x53, 0xd1, 0x00, 0xed, 0x20, 0xfc, 0xb1, 0x5b, 0x6a, 0xcb, 0xbe, 0x39, 0x4a, 0x4c, 0x58, 0xcf, 0xd0, 0xef, 0xaa, 0xfb, 0x43, 0x4d, 0x33, 0x85, 0x45, 0xf9, 0x02, 0x7f, 0x50, 0x3c, 0x9f, 0xa8, 0x51, 0xa3, 0x40, 0x8f, 0x92, 0x9d, 0x38, 0xf5, 0xbc, 0xb6, 0xda, 0x21, 0x10, 0xff, 0xf3, 0xd2, 0xcd, 0x0c, 0x13, 0xec, 0x5f, 0x97, 0x44, 0x17, 0xc4, 0xa7, 0x7e, 0x3d, 0x64, 0x5d, 0x19, 0x73, 0x60, 0x81, 0x4f, 0xdc, 0x22, 0x2a, 0x90, 0x88, 0x46, 0xee, 0xb8, 0x14, 0xde, 0x5e, 0x0b, 0xdb, 0xe0, 0x32, 0x3a, 0x0a, 0x49, 0x06, 0x24, 0x5c, 0xc2, 0xd3, 0xac, 0x62, 0x91, 0x95, 0xe4, 0x79, 0xe7, 0xc8, 0x37, 0x6d, 0x8d, 0xd5, 0x4e, 0xa9, 0x6c, 0x56, 0xf4, 0xea, 0x65, 0x7a, 0xae, 0x08, 0xba, 0x78, 0x25, 0x2e, 0x1c, 0xa6, 0xb4, 0xc6, 0xe8, 0xdd, 0x74, 0x1f, 0x4b, 0xbd, 0x8b, 0x8a, 0x70, 0x3e, 0xb5, 0x66, 0x48, 0x03, 0xf6, 0x0e, 0x61, 0x35, 0x57, 0xb9, 0x86, 0xc1, 0x1d, 0x9e, 0xe1, 0xf8, 0x98, 0x11, 0x69, 0xd9, 0x8e, 0x94, 0x9b, 0x1e, 0x87, 0xe9, 0xce, 0x55, 0x28, 0xdf, 0x8c, 0xa1, 0x89, 0x0d, 0xbf, 0xe6, 0x42, 0x68, 0x41, 0x99, 0x2d, 0x0f, 0xb0, 0x54, 0xbb, 0x16]; const Si = [0x52, 0x09, 0x6a, 0xd5, 0x30, 0x36, 0xa5, 0x38, 0xbf, 0x40, 0xa3, 0x9e, 0x81, 0xf3, 0xd7, 0xfb, 0x7c, 0xe3, 0x39, 0x82, 0x9b, 0x2f, 0xff, 0x87, 0x34, 0x8e, 0x43, 0x44, 0xc4, 0xde, 0xe9, 0xcb, 0x54, 0x7b, 0x94, 0x32, 0xa6, 0xc2, 0x23, 0x3d, 0xee, 0x4c, 0x95, 0x0b, 0x42, 0xfa, 0xc3, 0x4e, 0x08, 0x2e, 0xa1, 0x66, 0x28, 0xd9, 0x24, 0xb2, 0x76, 0x5b, 0xa2, 0x49, 0x6d, 0x8b, 0xd1, 0x25, 0x72, 0xf8, 0xf6, 0x64, 0x86, 0x68, 0x98, 0x16, 0xd4, 0xa4, 0x5c, 0xcc, 0x5d, 0x65, 0xb6, 0x92, 0x6c, 0x70, 0x48, 0x50, 0xfd, 0xed, 0xb9, 0xda, 0x5e, 0x15, 0x46, 0x57, 0xa7, 0x8d, 0x9d, 0x84, 0x90, 0xd8, 0xab, 0x00, 0x8c, 0xbc, 0xd3, 0x0a, 0xf7, 0xe4, 0x58, 0x05, 0xb8, 0xb3, 0x45, 0x06, 0xd0, 0x2c, 0x1e, 0x8f, 0xca, 0x3f, 0x0f, 0x02, 0xc1, 0xaf, 0xbd, 0x03, 0x01, 0x13, 0x8a, 0x6b, 0x3a, 0x91, 0x11, 0x41, 0x4f, 0x67, 0xdc, 0xea, 0x97, 0xf2, 0xcf, 0xce, 0xf0, 0xb4, 0xe6, 0x73, 0x96, 0xac, 0x74, 0x22, 0xe7, 0xad, 0x35, 0x85, 0xe2, 0xf9, 0x37, 0xe8, 0x1c, 0x75, 0xdf, 0x6e, 0x47, 0xf1, 0x1a, 0x71, 0x1d, 0x29, 0xc5, 0x89, 0x6f, 0xb7, 0x62, 0x0e, 0xaa, 0x18, 0xbe, 0x1b, 0xfc, 0x56, 0x3e, 0x4b, 0xc6, 0xd2, 0x79, 0x20, 0x9a, 0xdb, 0xc0, 0xfe, 0x78, 0xcd, 0x5a, 0xf4, 0x1f, 0xdd, 0xa8, 0x33, 0x88, 0x07, 0xc7, 0x31, 0xb1, 0x12, 0x10, 0x59, 0x27, 0x80, 0xec, 0x5f, 0x60, 0x51, 0x7f, 0xa9, 0x19, 0xb5, 0x4a, 0x0d, 0x2d, 0xe5, 0x7a, 0x9f, 0x93, 0xc9, 0x9c, 0xef, 0xa0, 0xe0, 0x3b, 0x4d, 0xae, 0x2a, 0xf5, 0xb0, 0xc8, 0xeb, 0xbb, 0x3c, 0x83, 0x53, 0x99, 0x61, 0x17, 0x2b, 0x04, 0x7e, 0xba, 0x77, 0xd6, 0x26, 0xe1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0c, 0x7d]; // Transformations for encryption const T1 = [0xc66363a5, 0xf87c7c84, 0xee777799, 0xf67b7b8d, 0xfff2f20d, 0xd66b6bbd, 0xde6f6fb1, 0x91c5c554, 0x60303050, 0x02010103, 0xce6767a9, 0x562b2b7d, 0xe7fefe19, 0xb5d7d762, 0x4dababe6, 0xec76769a, 0x8fcaca45, 0x1f82829d, 0x89c9c940, 0xfa7d7d87, 0xeffafa15, 0xb25959eb, 0x8e4747c9, 0xfbf0f00b, 0x41adadec, 0xb3d4d467, 0x5fa2a2fd, 0x45afafea, 0x239c9cbf, 0x53a4a4f7, 0xe4727296, 0x9bc0c05b, 0x75b7b7c2, 0xe1fdfd1c, 0x3d9393ae, 0x4c26266a, 0x6c36365a, 0x7e3f3f41, 0xf5f7f702, 0x83cccc4f, 0x6834345c, 0x51a5a5f4, 0xd1e5e534, 0xf9f1f108, 0xe2717193, 0xabd8d873, 0x62313153, 0x2a15153f, 0x0804040c, 0x95c7c752, 0x46232365, 0x9dc3c35e, 0x30181828, 0x379696a1, 0x0a05050f, 0x2f9a9ab5, 0x0e070709, 0x24121236, 0x1b80809b, 0xdfe2e23d, 0xcdebeb26, 0x4e272769, 0x7fb2b2cd, 0xea75759f, 0x1209091b, 0x1d83839e, 0x582c2c74, 0x341a1a2e, 0x361b1b2d, 0xdc6e6eb2, 0xb45a5aee, 0x5ba0a0fb, 0xa45252f6, 0x763b3b4d, 0xb7d6d661, 0x7db3b3ce, 0x5229297b, 0xdde3e33e, 0x5e2f2f71, 0x13848497, 0xa65353f5, 0xb9d1d168, 0x00000000, 0xc1eded2c, 0x40202060, 0xe3fcfc1f, 0x79b1b1c8, 0xb65b5bed, 0xd46a6abe, 0x8dcbcb46, 0x67bebed9, 0x7239394b, 0x944a4ade, 0x984c4cd4, 0xb05858e8, 0x85cfcf4a, 0xbbd0d06b, 0xc5efef2a, 0x4faaaae5, 0xedfbfb16, 0x864343c5, 0x9a4d4dd7, 0x66333355, 0x11858594, 0x8a4545cf, 0xe9f9f910, 0x04020206, 0xfe7f7f81, 0xa05050f0, 0x783c3c44, 0x259f9fba, 0x4ba8a8e3, 0xa25151f3, 0x5da3a3fe, 0x804040c0, 0x058f8f8a, 0x3f9292ad, 0x219d9dbc, 0x70383848, 0xf1f5f504, 0x63bcbcdf, 0x77b6b6c1, 0xafdada75, 0x42212163, 0x20101030, 0xe5ffff1a, 0xfdf3f30e, 0xbfd2d26d, 0x81cdcd4c, 0x180c0c14, 0x26131335, 0xc3ecec2f, 0xbe5f5fe1, 0x359797a2, 0x884444cc, 0x2e171739, 0x93c4c457, 0x55a7a7f2, 0xfc7e7e82, 0x7a3d3d47, 0xc86464ac, 0xba5d5de7, 0x3219192b, 0xe6737395, 0xc06060a0, 0x19818198, 0x9e4f4fd1, 0xa3dcdc7f, 0x44222266, 0x542a2a7e, 0x3b9090ab, 0x0b888883, 0x8c4646ca, 0xc7eeee29, 0x6bb8b8d3, 0x2814143c, 0xa7dede79, 0xbc5e5ee2, 0x160b0b1d, 0xaddbdb76, 0xdbe0e03b, 0x64323256, 0x743a3a4e, 0x140a0a1e, 0x924949db, 0x0c06060a, 0x4824246c, 0xb85c5ce4, 0x9fc2c25d, 0xbdd3d36e, 0x43acacef, 0xc46262a6, 0x399191a8, 0x319595a4, 0xd3e4e437, 0xf279798b, 0xd5e7e732, 0x8bc8c843, 0x6e373759, 0xda6d6db7, 0x018d8d8c, 0xb1d5d564, 0x9c4e4ed2, 0x49a9a9e0, 0xd86c6cb4, 0xac5656fa, 0xf3f4f407, 0xcfeaea25, 0xca6565af, 0xf47a7a8e, 0x47aeaee9, 0x10080818, 0x6fbabad5, 0xf0787888, 0x4a25256f, 0x5c2e2e72, 0x381c1c24, 0x57a6a6f1, 0x73b4b4c7, 0x97c6c651, 0xcbe8e823, 0xa1dddd7c, 0xe874749c, 0x3e1f1f21, 0x964b4bdd, 0x61bdbddc, 0x0d8b8b86, 0x0f8a8a85, 0xe0707090, 0x7c3e3e42, 0x71b5b5c4, 0xcc6666aa, 0x904848d8, 0x06030305, 0xf7f6f601, 0x1c0e0e12, 0xc26161a3, 0x6a35355f, 0xae5757f9, 0x69b9b9d0, 0x17868691, 0x99c1c158, 0x3a1d1d27, 0x279e9eb9, 0xd9e1e138, 0xebf8f813, 0x2b9898b3, 0x22111133, 0xd26969bb, 0xa9d9d970, 0x078e8e89, 0x339494a7, 0x2d9b9bb6, 0x3c1e1e22, 0x15878792, 0xc9e9e920, 0x87cece49, 0xaa5555ff, 0x50282878, 0xa5dfdf7a, 0x038c8c8f, 0x59a1a1f8, 0x09898980, 0x1a0d0d17, 0x65bfbfda, 0xd7e6e631, 0x844242c6, 0xd06868b8, 0x824141c3, 0x299999b0, 0x5a2d2d77, 0x1e0f0f11, 0x7bb0b0cb, 0xa85454fc, 0x6dbbbbd6, 0x2c16163a]; const T2 = [0xa5c66363, 0x84f87c7c, 0x99ee7777, 0x8df67b7b, 0x0dfff2f2, 0xbdd66b6b, 0xb1de6f6f, 0x5491c5c5, 0x50603030, 0x03020101, 0xa9ce6767, 0x7d562b2b, 0x19e7fefe, 0x62b5d7d7, 0xe64dabab, 0x9aec7676, 0x458fcaca, 0x9d1f8282, 0x4089c9c9, 0x87fa7d7d, 0x15effafa, 0xebb25959, 0xc98e4747, 0x0bfbf0f0, 0xec41adad, 0x67b3d4d4, 0xfd5fa2a2, 0xea45afaf, 0xbf239c9c, 0xf753a4a4, 0x96e47272, 0x5b9bc0c0, 0xc275b7b7, 0x1ce1fdfd, 0xae3d9393, 0x6a4c2626, 0x5a6c3636, 0x417e3f3f, 0x02f5f7f7, 0x4f83cccc, 0x5c683434, 0xf451a5a5, 0x34d1e5e5, 0x08f9f1f1, 0x93e27171, 0x73abd8d8, 0x53623131, 0x3f2a1515, 0x0c080404, 0x5295c7c7, 0x65462323, 0x5e9dc3c3, 0x28301818, 0xa1379696, 0x0f0a0505, 0xb52f9a9a, 0x090e0707, 0x36241212, 0x9b1b8080, 0x3ddfe2e2, 0x26cdebeb, 0x694e2727, 0xcd7fb2b2, 0x9fea7575, 0x1b120909, 0x9e1d8383, 0x74582c2c, 0x2e341a1a, 0x2d361b1b, 0xb2dc6e6e, 0xeeb45a5a, 0xfb5ba0a0, 0xf6a45252, 0x4d763b3b, 0x61b7d6d6, 0xce7db3b3, 0x7b522929, 0x3edde3e3, 0x715e2f2f, 0x97138484, 0xf5a65353, 0x68b9d1d1, 0x00000000, 0x2cc1eded, 0x60402020, 0x1fe3fcfc, 0xc879b1b1, 0xedb65b5b, 0xbed46a6a, 0x468dcbcb, 0xd967bebe, 0x4b723939, 0xde944a4a, 0xd4984c4c, 0xe8b05858, 0x4a85cfcf, 0x6bbbd0d0, 0x2ac5efef, 0xe54faaaa, 0x16edfbfb, 0xc5864343, 0xd79a4d4d, 0x55663333, 0x94118585, 0xcf8a4545, 0x10e9f9f9, 0x06040202, 0x81fe7f7f, 0xf0a05050, 0x44783c3c, 0xba259f9f, 0xe34ba8a8, 0xf3a25151, 0xfe5da3a3, 0xc0804040, 0x8a058f8f, 0xad3f9292, 0xbc219d9d, 0x48703838, 0x04f1f5f5, 0xdf63bcbc, 0xc177b6b6, 0x75afdada, 0x63422121, 0x30201010, 0x1ae5ffff, 0x0efdf3f3, 0x6dbfd2d2, 0x4c81cdcd, 0x14180c0c, 0x35261313, 0x2fc3ecec, 0xe1be5f5f, 0xa2359797, 0xcc884444, 0x392e1717, 0x5793c4c4, 0xf255a7a7, 0x82fc7e7e, 0x477a3d3d, 0xacc86464, 0xe7ba5d5d, 0x2b321919, 0x95e67373, 0xa0c06060, 0x98198181, 0xd19e4f4f, 0x7fa3dcdc, 0x66442222, 0x7e542a2a, 0xab3b9090, 0x830b8888, 0xca8c4646, 0x29c7eeee, 0xd36bb8b8, 0x3c281414, 0x79a7dede, 0xe2bc5e5e, 0x1d160b0b, 0x76addbdb, 0x3bdbe0e0, 0x56643232, 0x4e743a3a, 0x1e140a0a, 0xdb924949, 0x0a0c0606, 0x6c482424, 0xe4b85c5c, 0x5d9fc2c2, 0x6ebdd3d3, 0xef43acac, 0xa6c46262, 0xa8399191, 0xa4319595, 0x37d3e4e4, 0x8bf27979, 0x32d5e7e7, 0x438bc8c8, 0x596e3737, 0xb7da6d6d, 0x8c018d8d, 0x64b1d5d5, 0xd29c4e4e, 0xe049a9a9, 0xb4d86c6c, 0xfaac5656, 0x07f3f4f4, 0x25cfeaea, 0xafca6565, 0x8ef47a7a, 0xe947aeae, 0x18100808, 0xd56fbaba, 0x88f07878, 0x6f4a2525, 0x725c2e2e, 0x24381c1c, 0xf157a6a6, 0xc773b4b4, 0x5197c6c6, 0x23cbe8e8, 0x7ca1dddd, 0x9ce87474, 0x213e1f1f, 0xdd964b4b, 0xdc61bdbd, 0x860d8b8b, 0x850f8a8a, 0x90e07070, 0x427c3e3e, 0xc471b5b5, 0xaacc6666, 0xd8904848, 0x05060303, 0x01f7f6f6, 0x121c0e0e, 0xa3c26161, 0x5f6a3535, 0xf9ae5757, 0xd069b9b9, 0x91178686, 0x5899c1c1, 0x273a1d1d, 0xb9279e9e, 0x38d9e1e1, 0x13ebf8f8, 0xb32b9898, 0x33221111, 0xbbd26969, 0x70a9d9d9, 0x89078e8e, 0xa7339494, 0xb62d9b9b, 0x223c1e1e, 0x92158787, 0x20c9e9e9, 0x4987cece, 0xffaa5555, 0x78502828, 0x7aa5dfdf, 0x8f038c8c, 0xf859a1a1, 0x80098989, 0x171a0d0d, 0xda65bfbf, 0x31d7e6e6, 0xc6844242, 0xb8d06868, 0xc3824141, 0xb0299999, 0x775a2d2d, 0x111e0f0f, 0xcb7bb0b0, 0xfca85454, 0xd66dbbbb, 0x3a2c1616]; const T3 = [0x63a5c663, 0x7c84f87c, 0x7799ee77, 0x7b8df67b, 0xf20dfff2, 0x6bbdd66b, 0x6fb1de6f, 0xc55491c5, 0x30506030, 0x01030201, 0x67a9ce67, 0x2b7d562b, 0xfe19e7fe, 0xd762b5d7, 0xabe64dab, 0x769aec76, 0xca458fca, 0x829d1f82, 0xc94089c9, 0x7d87fa7d, 0xfa15effa, 0x59ebb259, 0x47c98e47, 0xf00bfbf0, 0xadec41ad, 0xd467b3d4, 0xa2fd5fa2, 0xafea45af, 0x9cbf239c, 0xa4f753a4, 0x7296e472, 0xc05b9bc0, 0xb7c275b7, 0xfd1ce1fd, 0x93ae3d93, 0x266a4c26, 0x365a6c36, 0x3f417e3f, 0xf702f5f7, 0xcc4f83cc, 0x345c6834, 0xa5f451a5, 0xe534d1e5, 0xf108f9f1, 0x7193e271, 0xd873abd8, 0x31536231, 0x153f2a15, 0x040c0804, 0xc75295c7, 0x23654623, 0xc35e9dc3, 0x18283018, 0x96a13796, 0x050f0a05, 0x9ab52f9a, 0x07090e07, 0x12362412, 0x809b1b80, 0xe23ddfe2, 0xeb26cdeb, 0x27694e27, 0xb2cd7fb2, 0x759fea75, 0x091b1209, 0x839e1d83, 0x2c74582c, 0x1a2e341a, 0x1b2d361b, 0x6eb2dc6e, 0x5aeeb45a, 0xa0fb5ba0, 0x52f6a452, 0x3b4d763b, 0xd661b7d6, 0xb3ce7db3, 0x297b5229, 0xe33edde3, 0x2f715e2f, 0x84971384, 0x53f5a653, 0xd168b9d1, 0x00000000, 0xed2cc1ed, 0x20604020, 0xfc1fe3fc, 0xb1c879b1, 0x5bedb65b, 0x6abed46a, 0xcb468dcb, 0xbed967be, 0x394b7239, 0x4ade944a, 0x4cd4984c, 0x58e8b058, 0xcf4a85cf, 0xd06bbbd0, 0xef2ac5ef, 0xaae54faa, 0xfb16edfb, 0x43c58643, 0x4dd79a4d, 0x33556633, 0x85941185, 0x45cf8a45, 0xf910e9f9, 0x02060402, 0x7f81fe7f, 0x50f0a050, 0x3c44783c, 0x9fba259f, 0xa8e34ba8, 0x51f3a251, 0xa3fe5da3, 0x40c08040, 0x8f8a058f, 0x92ad3f92, 0x9dbc219d, 0x38487038, 0xf504f1f5, 0xbcdf63bc, 0xb6c177b6, 0xda75afda, 0x21634221, 0x10302010, 0xff1ae5ff, 0xf30efdf3, 0xd26dbfd2, 0xcd4c81cd, 0x0c14180c, 0x13352613, 0xec2fc3ec, 0x5fe1be5f, 0x97a23597, 0x44cc8844, 0x17392e17, 0xc45793c4, 0xa7f255a7, 0x7e82fc7e, 0x3d477a3d, 0x64acc864, 0x5de7ba5d, 0x192b3219, 0x7395e673, 0x60a0c060, 0x81981981, 0x4fd19e4f, 0xdc7fa3dc, 0x22664422, 0x2a7e542a, 0x90ab3b90, 0x88830b88, 0x46ca8c46, 0xee29c7ee, 0xb8d36bb8, 0x143c2814, 0xde79a7de, 0x5ee2bc5e, 0x0b1d160b, 0xdb76addb, 0xe03bdbe0, 0x32566432, 0x3a4e743a, 0x0a1e140a, 0x49db9249, 0x060a0c06, 0x246c4824, 0x5ce4b85c, 0xc25d9fc2, 0xd36ebdd3, 0xacef43ac, 0x62a6c462, 0x91a83991, 0x95a43195, 0xe437d3e4, 0x798bf279, 0xe732d5e7, 0xc8438bc8, 0x37596e37, 0x6db7da6d, 0x8d8c018d, 0xd564b1d5, 0x4ed29c4e, 0xa9e049a9, 0x6cb4d86c, 0x56faac56, 0xf407f3f4, 0xea25cfea, 0x65afca65, 0x7a8ef47a, 0xaee947ae, 0x08181008, 0xbad56fba, 0x7888f078, 0x256f4a25, 0x2e725c2e, 0x1c24381c, 0xa6f157a6, 0xb4c773b4, 0xc65197c6, 0xe823cbe8, 0xdd7ca1dd, 0x749ce874, 0x1f213e1f, 0x4bdd964b, 0xbddc61bd, 0x8b860d8b, 0x8a850f8a, 0x7090e070, 0x3e427c3e, 0xb5c471b5, 0x66aacc66, 0x48d89048, 0x03050603, 0xf601f7f6, 0x0e121c0e, 0x61a3c261, 0x355f6a35, 0x57f9ae57, 0xb9d069b9, 0x86911786, 0xc15899c1, 0x1d273a1d, 0x9eb9279e, 0xe138d9e1, 0xf813ebf8, 0x98b32b98, 0x11332211, 0x69bbd269, 0xd970a9d9, 0x8e89078e, 0x94a73394, 0x9bb62d9b, 0x1e223c1e, 0x87921587, 0xe920c9e9, 0xce4987ce, 0x55ffaa55, 0x28785028, 0xdf7aa5df, 0x8c8f038c, 0xa1f859a1, 0x89800989, 0x0d171a0d, 0xbfda65bf, 0xe631d7e6, 0x42c68442, 0x68b8d068, 0x41c38241, 0x99b02999, 0x2d775a2d, 0x0f111e0f, 0xb0cb7bb0, 0x54fca854, 0xbbd66dbb, 0x163a2c16]; const T4 = [0x6363a5c6, 0x7c7c84f8, 0x777799ee, 0x7b7b8df6, 0xf2f20dff, 0x6b6bbdd6, 0x6f6fb1de, 0xc5c55491, 0x30305060, 0x01010302, 0x6767a9ce, 0x2b2b7d56, 0xfefe19e7, 0xd7d762b5, 0xababe64d, 0x76769aec, 0xcaca458f, 0x82829d1f, 0xc9c94089, 0x7d7d87fa, 0xfafa15ef, 0x5959ebb2, 0x4747c98e, 0xf0f00bfb, 0xadadec41, 0xd4d467b3, 0xa2a2fd5f, 0xafafea45, 0x9c9cbf23, 0xa4a4f753, 0x727296e4, 0xc0c05b9b, 0xb7b7c275, 0xfdfd1ce1, 0x9393ae3d, 0x26266a4c, 0x36365a6c, 0x3f3f417e, 0xf7f702f5, 0xcccc4f83, 0x34345c68, 0xa5a5f451, 0xe5e534d1, 0xf1f108f9, 0x717193e2, 0xd8d873ab, 0x31315362, 0x15153f2a, 0x04040c08, 0xc7c75295, 0x23236546, 0xc3c35e9d, 0x18182830, 0x9696a137, 0x05050f0a, 0x9a9ab52f, 0x0707090e, 0x12123624, 0x80809b1b, 0xe2e23ddf, 0xebeb26cd, 0x2727694e, 0xb2b2cd7f, 0x75759fea, 0x09091b12, 0x83839e1d, 0x2c2c7458, 0x1a1a2e34, 0x1b1b2d36, 0x6e6eb2dc, 0x5a5aeeb4, 0xa0a0fb5b, 0x5252f6a4, 0x3b3b4d76, 0xd6d661b7, 0xb3b3ce7d, 0x29297b52, 0xe3e33edd, 0x2f2f715e, 0x84849713, 0x5353f5a6, 0xd1d168b9, 0x00000000, 0xeded2cc1, 0x20206040, 0xfcfc1fe3, 0xb1b1c879, 0x5b5bedb6, 0x6a6abed4, 0xcbcb468d, 0xbebed967, 0x39394b72, 0x4a4ade94, 0x4c4cd498, 0x5858e8b0, 0xcfcf4a85, 0xd0d06bbb, 0xefef2ac5, 0xaaaae54f, 0xfbfb16ed, 0x4343c586, 0x4d4dd79a, 0x33335566, 0x85859411, 0x4545cf8a, 0xf9f910e9, 0x02020604, 0x7f7f81fe, 0x5050f0a0, 0x3c3c4478, 0x9f9fba25, 0xa8a8e34b, 0x5151f3a2, 0xa3a3fe5d, 0x4040c080, 0x8f8f8a05, 0x9292ad3f, 0x9d9dbc21, 0x38384870, 0xf5f504f1, 0xbcbcdf63, 0xb6b6c177, 0xdada75af, 0x21216342, 0x10103020, 0xffff1ae5, 0xf3f30efd, 0xd2d26dbf, 0xcdcd4c81, 0x0c0c1418, 0x13133526, 0xecec2fc3, 0x5f5fe1be, 0x9797a235, 0x4444cc88, 0x1717392e, 0xc4c45793, 0xa7a7f255, 0x7e7e82fc, 0x3d3d477a, 0x6464acc8, 0x5d5de7ba, 0x19192b32, 0x737395e6, 0x6060a0c0, 0x81819819, 0x4f4fd19e, 0xdcdc7fa3, 0x22226644, 0x2a2a7e54, 0x9090ab3b, 0x8888830b, 0x4646ca8c, 0xeeee29c7, 0xb8b8d36b, 0x14143c28, 0xdede79a7, 0x5e5ee2bc, 0x0b0b1d16, 0xdbdb76ad, 0xe0e03bdb, 0x32325664, 0x3a3a4e74, 0x0a0a1e14, 0x4949db92, 0x06060a0c, 0x24246c48, 0x5c5ce4b8, 0xc2c25d9f, 0xd3d36ebd, 0xacacef43, 0x6262a6c4, 0x9191a839, 0x9595a431, 0xe4e437d3, 0x79798bf2, 0xe7e732d5, 0xc8c8438b, 0x3737596e, 0x6d6db7da, 0x8d8d8c01, 0xd5d564b1, 0x4e4ed29c, 0xa9a9e049, 0x6c6cb4d8, 0x5656faac, 0xf4f407f3, 0xeaea25cf, 0x6565afca, 0x7a7a8ef4, 0xaeaee947, 0x08081810, 0xbabad56f, 0x787888f0, 0x25256f4a, 0x2e2e725c, 0x1c1c2438, 0xa6a6f157, 0xb4b4c773, 0xc6c65197, 0xe8e823cb, 0xdddd7ca1, 0x74749ce8, 0x1f1f213e, 0x4b4bdd96, 0xbdbddc61, 0x8b8b860d, 0x8a8a850f, 0x707090e0, 0x3e3e427c, 0xb5b5c471, 0x6666aacc, 0x4848d890, 0x03030506, 0xf6f601f7, 0x0e0e121c, 0x6161a3c2, 0x35355f6a, 0x5757f9ae, 0xb9b9d069, 0x86869117, 0xc1c15899, 0x1d1d273a, 0x9e9eb927, 0xe1e138d9, 0xf8f813eb, 0x9898b32b, 0x11113322, 0x6969bbd2, 0xd9d970a9, 0x8e8e8907, 0x9494a733, 0x9b9bb62d, 0x1e1e223c, 0x87879215, 0xe9e920c9, 0xcece4987, 0x5555ffaa, 0x28287850, 0xdfdf7aa5, 0x8c8c8f03, 0xa1a1f859, 0x89898009, 0x0d0d171a, 0xbfbfda65, 0xe6e631d7, 0x4242c684, 0x6868b8d0, 0x4141c382, 0x9999b029, 0x2d2d775a, 0x0f0f111e, 0xb0b0cb7b, 0x5454fca8, 0xbbbbd66d, 0x16163a2c]; // Transformations for decryption const T5 = [0x51f4a750, 0x7e416553, 0x1a17a4c3, 0x3a275e96, 0x3bab6bcb, 0x1f9d45f1, 0xacfa58ab, 0x4be30393, 0x2030fa55, 0xad766df6, 0x88cc7691, 0xf5024c25, 0x4fe5d7fc, 0xc52acbd7, 0x26354480, 0xb562a38f, 0xdeb15a49, 0x25ba1b67, 0x45ea0e98, 0x5dfec0e1, 0xc32f7502, 0x814cf012, 0x8d4697a3, 0x6bd3f9c6, 0x038f5fe7, 0x15929c95, 0xbf6d7aeb, 0x955259da, 0xd4be832d, 0x587421d3, 0x49e06929, 0x8ec9c844, 0x75c2896a, 0xf48e7978, 0x99583e6b, 0x27b971dd, 0xbee14fb6, 0xf088ad17, 0xc920ac66, 0x7dce3ab4, 0x63df4a18, 0xe51a3182, 0x97513360, 0x62537f45, 0xb16477e0, 0xbb6bae84, 0xfe81a01c, 0xf9082b94, 0x70486858, 0x8f45fd19, 0x94de6c87, 0x527bf8b7, 0xab73d323, 0x724b02e2, 0xe31f8f57, 0x6655ab2a, 0xb2eb2807, 0x2fb5c203, 0x86c57b9a, 0xd33708a5, 0x302887f2, 0x23bfa5b2, 0x02036aba, 0xed16825c, 0x8acf1c2b, 0xa779b492, 0xf307f2f0, 0x4e69e2a1, 0x65daf4cd, 0x0605bed5, 0xd134621f, 0xc4a6fe8a, 0x342e539d, 0xa2f355a0, 0x058ae132, 0xa4f6eb75, 0x0b83ec39, 0x4060efaa, 0x5e719f06, 0xbd6e1051, 0x3e218af9, 0x96dd063d, 0xdd3e05ae, 0x4de6bd46, 0x91548db5, 0x71c45d05, 0x0406d46f, 0x605015ff, 0x1998fb24, 0xd6bde997, 0x894043cc, 0x67d99e77, 0xb0e842bd, 0x07898b88, 0xe7195b38, 0x79c8eedb, 0xa17c0a47, 0x7c420fe9, 0xf8841ec9, 0x00000000, 0x09808683, 0x322bed48, 0x1e1170ac, 0x6c5a724e, 0xfd0efffb, 0x0f853856, 0x3daed51e, 0x362d3927, 0x0a0fd964, 0x685ca621, 0x9b5b54d1, 0x24362e3a, 0x0c0a67b1, 0x9357e70f, 0xb4ee96d2, 0x1b9b919e, 0x80c0c54f, 0x61dc20a2, 0x5a774b69, 0x1c121a16, 0xe293ba0a, 0xc0a02ae5, 0x3c22e043, 0x121b171d, 0x0e090d0b, 0xf28bc7ad, 0x2db6a8b9, 0x141ea9c8, 0x57f11985, 0xaf75074c, 0xee99ddbb, 0xa37f60fd, 0xf701269f, 0x5c72f5bc, 0x44663bc5, 0x5bfb7e34, 0x8b432976, 0xcb23c6dc, 0xb6edfc68, 0xb8e4f163, 0xd731dcca, 0x42638510, 0x13972240, 0x84c61120, 0x854a247d, 0xd2bb3df8, 0xaef93211, 0xc729a16d, 0x1d9e2f4b, 0xdcb230f3, 0x0d8652ec, 0x77c1e3d0, 0x2bb3166c, 0xa970b999, 0x119448fa, 0x47e96422, 0xa8fc8cc4, 0xa0f03f1a, 0x567d2cd8, 0x223390ef, 0x87494ec7, 0xd938d1c1, 0x8ccaa2fe, 0x98d40b36, 0xa6f581cf, 0xa57ade28, 0xdab78e26, 0x3fadbfa4, 0x2c3a9de4, 0x5078920d, 0x6a5fcc9b, 0x547e4662, 0xf68d13c2, 0x90d8b8e8, 0x2e39f75e, 0x82c3aff5, 0x9f5d80be, 0x69d0937c, 0x6fd52da9, 0xcf2512b3, 0xc8ac993b, 0x10187da7, 0xe89c636e, 0xdb3bbb7b, 0xcd267809, 0x6e5918f4, 0xec9ab701, 0x834f9aa8, 0xe6956e65, 0xaaffe67e, 0x21bccf08, 0xef15e8e6, 0xbae79bd9, 0x4a6f36ce, 0xea9f09d4, 0x29b07cd6, 0x31a4b2af, 0x2a3f2331, 0xc6a59430, 0x35a266c0, 0x744ebc37, 0xfc82caa6, 0xe090d0b0, 0x33a7d815, 0xf104984a, 0x41ecdaf7, 0x7fcd500e, 0x1791f62f, 0x764dd68d, 0x43efb04d, 0xccaa4d54, 0xe49604df, 0x9ed1b5e3, 0x4c6a881b, 0xc12c1fb8, 0x4665517f, 0x9d5eea04, 0x018c355d, 0xfa877473, 0xfb0b412e, 0xb3671d5a, 0x92dbd252, 0xe9105633, 0x6dd64713, 0x9ad7618c, 0x37a10c7a, 0x59f8148e, 0xeb133c89, 0xcea927ee, 0xb761c935, 0xe11ce5ed, 0x7a47b13c, 0x9cd2df59, 0x55f2733f, 0x1814ce79, 0x73c737bf, 0x53f7cdea, 0x5ffdaa5b, 0xdf3d6f14, 0x7844db86, 0xcaaff381, 0xb968c43e, 0x3824342c, 0xc2a3405f, 0x161dc372, 0xbce2250c, 0x283c498b, 0xff0d9541, 0x39a80171, 0x080cb3de, 0xd8b4e49c, 0x6456c190, 0x7bcb8461, 0xd532b670, 0x486c5c74, 0xd0b85742]; const T6 = [0x5051f4a7, 0x537e4165, 0xc31a17a4, 0x963a275e, 0xcb3bab6b, 0xf11f9d45, 0xabacfa58, 0x934be303, 0x552030fa, 0xf6ad766d, 0x9188cc76, 0x25f5024c, 0xfc4fe5d7, 0xd7c52acb, 0x80263544, 0x8fb562a3, 0x49deb15a, 0x6725ba1b, 0x9845ea0e, 0xe15dfec0, 0x02c32f75, 0x12814cf0, 0xa38d4697, 0xc66bd3f9, 0xe7038f5f, 0x9515929c, 0xebbf6d7a, 0xda955259, 0x2dd4be83, 0xd3587421, 0x2949e069, 0x448ec9c8, 0x6a75c289, 0x78f48e79, 0x6b99583e, 0xdd27b971, 0xb6bee14f, 0x17f088ad, 0x66c920ac, 0xb47dce3a, 0x1863df4a, 0x82e51a31, 0x60975133, 0x4562537f, 0xe0b16477, 0x84bb6bae, 0x1cfe81a0, 0x94f9082b, 0x58704868, 0x198f45fd, 0x8794de6c, 0xb7527bf8, 0x23ab73d3, 0xe2724b02, 0x57e31f8f, 0x2a6655ab, 0x07b2eb28, 0x032fb5c2, 0x9a86c57b, 0xa5d33708, 0xf2302887, 0xb223bfa5, 0xba02036a, 0x5ced1682, 0x2b8acf1c, 0x92a779b4, 0xf0f307f2, 0xa14e69e2, 0xcd65daf4, 0xd50605be, 0x1fd13462, 0x8ac4a6fe, 0x9d342e53, 0xa0a2f355, 0x32058ae1, 0x75a4f6eb, 0x390b83ec, 0xaa4060ef, 0x065e719f, 0x51bd6e10, 0xf93e218a, 0x3d96dd06, 0xaedd3e05, 0x464de6bd, 0xb591548d, 0x0571c45d, 0x6f0406d4, 0xff605015, 0x241998fb, 0x97d6bde9, 0xcc894043, 0x7767d99e, 0xbdb0e842, 0x8807898b, 0x38e7195b, 0xdb79c8ee, 0x47a17c0a, 0xe97c420f, 0xc9f8841e, 0x00000000, 0x83098086, 0x48322bed, 0xac1e1170, 0x4e6c5a72, 0xfbfd0eff, 0x560f8538, 0x1e3daed5, 0x27362d39, 0x640a0fd9, 0x21685ca6, 0xd19b5b54, 0x3a24362e, 0xb10c0a67, 0x0f9357e7, 0xd2b4ee96, 0x9e1b9b91, 0x4f80c0c5, 0xa261dc20, 0x695a774b, 0x161c121a, 0x0ae293ba, 0xe5c0a02a, 0x433c22e0, 0x1d121b17, 0x0b0e090d, 0xadf28bc7, 0xb92db6a8, 0xc8141ea9, 0x8557f119, 0x4caf7507, 0xbbee99dd, 0xfda37f60, 0x9ff70126, 0xbc5c72f5, 0xc544663b, 0x345bfb7e, 0x768b4329, 0xdccb23c6, 0x68b6edfc, 0x63b8e4f1, 0xcad731dc, 0x10426385, 0x40139722, 0x2084c611, 0x7d854a24, 0xf8d2bb3d, 0x11aef932, 0x6dc729a1, 0x4b1d9e2f, 0xf3dcb230, 0xec0d8652, 0xd077c1e3, 0x6c2bb316, 0x99a970b9, 0xfa119448, 0x2247e964, 0xc4a8fc8c, 0x1aa0f03f, 0xd8567d2c, 0xef223390, 0xc787494e, 0xc1d938d1, 0xfe8ccaa2, 0x3698d40b, 0xcfa6f581, 0x28a57ade, 0x26dab78e, 0xa43fadbf, 0xe42c3a9d, 0x0d507892, 0x9b6a5fcc, 0x62547e46, 0xc2f68d13, 0xe890d8b8, 0x5e2e39f7, 0xf582c3af, 0xbe9f5d80, 0x7c69d093, 0xa96fd52d, 0xb3cf2512, 0x3bc8ac99, 0xa710187d, 0x6ee89c63, 0x7bdb3bbb, 0x09cd2678, 0xf46e5918, 0x01ec9ab7, 0xa8834f9a, 0x65e6956e, 0x7eaaffe6, 0x0821bccf, 0xe6ef15e8, 0xd9bae79b, 0xce4a6f36, 0xd4ea9f09, 0xd629b07c, 0xaf31a4b2, 0x312a3f23, 0x30c6a594, 0xc035a266, 0x37744ebc, 0xa6fc82ca, 0xb0e090d0, 0x1533a7d8, 0x4af10498, 0xf741ecda, 0x0e7fcd50, 0x2f1791f6, 0x8d764dd6, 0x4d43efb0, 0x54ccaa4d, 0xdfe49604, 0xe39ed1b5, 0x1b4c6a88, 0xb8c12c1f, 0x7f466551, 0x049d5eea, 0x5d018c35, 0x73fa8774, 0x2efb0b41, 0x5ab3671d, 0x5292dbd2, 0x33e91056, 0x136dd647, 0x8c9ad761, 0x7a37a10c, 0x8e59f814, 0x89eb133c, 0xeecea927, 0x35b761c9, 0xede11ce5, 0x3c7a47b1, 0x599cd2df, 0x3f55f273, 0x791814ce, 0xbf73c737, 0xea53f7cd, 0x5b5ffdaa, 0x14df3d6f, 0x867844db, 0x81caaff3, 0x3eb968c4, 0x2c382434, 0x5fc2a340, 0x72161dc3, 0x0cbce225, 0x8b283c49, 0x41ff0d95, 0x7139a801, 0xde080cb3, 0x9cd8b4e4, 0x906456c1, 0x617bcb84, 0x70d532b6, 0x74486c5c, 0x42d0b857]; const T7 = [0xa75051f4, 0x65537e41, 0xa4c31a17, 0x5e963a27, 0x6bcb3bab, 0x45f11f9d, 0x58abacfa, 0x03934be3, 0xfa552030, 0x6df6ad76, 0x769188cc, 0x4c25f502, 0xd7fc4fe5, 0xcbd7c52a, 0x44802635, 0xa38fb562, 0x5a49deb1, 0x1b6725ba, 0x0e9845ea, 0xc0e15dfe, 0x7502c32f, 0xf012814c, 0x97a38d46, 0xf9c66bd3, 0x5fe7038f, 0x9c951592, 0x7aebbf6d, 0x59da9552, 0x832dd4be, 0x21d35874, 0x692949e0, 0xc8448ec9, 0x896a75c2, 0x7978f48e, 0x3e6b9958, 0x71dd27b9, 0x4fb6bee1, 0xad17f088, 0xac66c920, 0x3ab47dce, 0x4a1863df, 0x3182e51a, 0x33609751, 0x7f456253, 0x77e0b164, 0xae84bb6b, 0xa01cfe81, 0x2b94f908, 0x68587048, 0xfd198f45, 0x6c8794de, 0xf8b7527b, 0xd323ab73, 0x02e2724b, 0x8f57e31f, 0xab2a6655, 0x2807b2eb, 0xc2032fb5, 0x7b9a86c5, 0x08a5d337, 0x87f23028, 0xa5b223bf, 0x6aba0203, 0x825ced16, 0x1c2b8acf, 0xb492a779, 0xf2f0f307, 0xe2a14e69, 0xf4cd65da, 0xbed50605, 0x621fd134, 0xfe8ac4a6, 0x539d342e, 0x55a0a2f3, 0xe132058a, 0xeb75a4f6, 0xec390b83, 0xefaa4060, 0x9f065e71, 0x1051bd6e, 0x8af93e21, 0x063d96dd, 0x05aedd3e, 0xbd464de6, 0x8db59154, 0x5d0571c4, 0xd46f0406, 0x15ff6050, 0xfb241998, 0xe997d6bd, 0x43cc8940, 0x9e7767d9, 0x42bdb0e8, 0x8b880789, 0x5b38e719, 0xeedb79c8, 0x0a47a17c, 0x0fe97c42, 0x1ec9f884, 0x00000000, 0x86830980, 0xed48322b, 0x70ac1e11, 0x724e6c5a, 0xfffbfd0e, 0x38560f85, 0xd51e3dae, 0x3927362d, 0xd9640a0f, 0xa621685c, 0x54d19b5b, 0x2e3a2436, 0x67b10c0a, 0xe70f9357, 0x96d2b4ee, 0x919e1b9b, 0xc54f80c0, 0x20a261dc, 0x4b695a77, 0x1a161c12, 0xba0ae293, 0x2ae5c0a0, 0xe0433c22, 0x171d121b, 0x0d0b0e09, 0xc7adf28b, 0xa8b92db6, 0xa9c8141e, 0x198557f1, 0x074caf75, 0xddbbee99, 0x60fda37f, 0x269ff701, 0xf5bc5c72, 0x3bc54466, 0x7e345bfb, 0x29768b43, 0xc6dccb23, 0xfc68b6ed, 0xf163b8e4, 0xdccad731, 0x85104263, 0x22401397, 0x112084c6, 0x247d854a, 0x3df8d2bb, 0x3211aef9, 0xa16dc729, 0x2f4b1d9e, 0x30f3dcb2, 0x52ec0d86, 0xe3d077c1, 0x166c2bb3, 0xb999a970, 0x48fa1194, 0x642247e9, 0x8cc4a8fc, 0x3f1aa0f0, 0x2cd8567d, 0x90ef2233, 0x4ec78749, 0xd1c1d938, 0xa2fe8cca, 0x0b3698d4, 0x81cfa6f5, 0xde28a57a, 0x8e26dab7, 0xbfa43fad, 0x9de42c3a, 0x920d5078, 0xcc9b6a5f, 0x4662547e, 0x13c2f68d, 0xb8e890d8, 0xf75e2e39, 0xaff582c3, 0x80be9f5d, 0x937c69d0, 0x2da96fd5, 0x12b3cf25, 0x993bc8ac, 0x7da71018, 0x636ee89c, 0xbb7bdb3b, 0x7809cd26, 0x18f46e59, 0xb701ec9a, 0x9aa8834f, 0x6e65e695, 0xe67eaaff, 0xcf0821bc, 0xe8e6ef15, 0x9bd9bae7, 0x36ce4a6f, 0x09d4ea9f, 0x7cd629b0, 0xb2af31a4, 0x23312a3f, 0x9430c6a5, 0x66c035a2, 0xbc37744e, 0xcaa6fc82, 0xd0b0e090, 0xd81533a7, 0x984af104, 0xdaf741ec, 0x500e7fcd, 0xf62f1791, 0xd68d764d, 0xb04d43ef, 0x4d54ccaa, 0x04dfe496, 0xb5e39ed1, 0x881b4c6a, 0x1fb8c12c, 0x517f4665, 0xea049d5e, 0x355d018c, 0x7473fa87, 0x412efb0b, 0x1d5ab367, 0xd25292db, 0x5633e910, 0x47136dd6, 0x618c9ad7, 0x0c7a37a1, 0x148e59f8, 0x3c89eb13, 0x27eecea9, 0xc935b761, 0xe5ede11c, 0xb13c7a47, 0xdf599cd2, 0x733f55f2, 0xce791814, 0x37bf73c7, 0xcdea53f7, 0xaa5b5ffd, 0x6f14df3d, 0xdb867844, 0xf381caaf, 0xc43eb968, 0x342c3824, 0x405fc2a3, 0xc372161d, 0x250cbce2, 0x498b283c, 0x9541ff0d, 0x017139a8, 0xb3de080c, 0xe49cd8b4, 0xc1906456, 0x84617bcb, 0xb670d532, 0x5c74486c, 0x5742d0b8]; const T8 = [0xf4a75051, 0x4165537e, 0x17a4c31a, 0x275e963a, 0xab6bcb3b, 0x9d45f11f, 0xfa58abac, 0xe303934b, 0x30fa5520, 0x766df6ad, 0xcc769188, 0x024c25f5, 0xe5d7fc4f, 0x2acbd7c5, 0x35448026, 0x62a38fb5, 0xb15a49de, 0xba1b6725, 0xea0e9845, 0xfec0e15d, 0x2f7502c3, 0x4cf01281, 0x4697a38d, 0xd3f9c66b, 0x8f5fe703, 0x929c9515, 0x6d7aebbf, 0x5259da95, 0xbe832dd4, 0x7421d358, 0xe0692949, 0xc9c8448e, 0xc2896a75, 0x8e7978f4, 0x583e6b99, 0xb971dd27, 0xe14fb6be, 0x88ad17f0, 0x20ac66c9, 0xce3ab47d, 0xdf4a1863, 0x1a3182e5, 0x51336097, 0x537f4562, 0x6477e0b1, 0x6bae84bb, 0x81a01cfe, 0x082b94f9, 0x48685870, 0x45fd198f, 0xde6c8794, 0x7bf8b752, 0x73d323ab, 0x4b02e272, 0x1f8f57e3, 0x55ab2a66, 0xeb2807b2, 0xb5c2032f, 0xc57b9a86, 0x3708a5d3, 0x2887f230, 0xbfa5b223, 0x036aba02, 0x16825ced, 0xcf1c2b8a, 0x79b492a7, 0x07f2f0f3, 0x69e2a14e, 0xdaf4cd65, 0x05bed506, 0x34621fd1, 0xa6fe8ac4, 0x2e539d34, 0xf355a0a2, 0x8ae13205, 0xf6eb75a4, 0x83ec390b, 0x60efaa40, 0x719f065e, 0x6e1051bd, 0x218af93e, 0xdd063d96, 0x3e05aedd, 0xe6bd464d, 0x548db591, 0xc45d0571, 0x06d46f04, 0x5015ff60, 0x98fb2419, 0xbde997d6, 0x4043cc89, 0xd99e7767, 0xe842bdb0, 0x898b8807, 0x195b38e7, 0xc8eedb79, 0x7c0a47a1, 0x420fe97c, 0x841ec9f8, 0x00000000, 0x80868309, 0x2bed4832, 0x1170ac1e, 0x5a724e6c, 0x0efffbfd, 0x8538560f, 0xaed51e3d, 0x2d392736, 0x0fd9640a, 0x5ca62168, 0x5b54d19b, 0x362e3a24, 0x0a67b10c, 0x57e70f93, 0xee96d2b4, 0x9b919e1b, 0xc0c54f80, 0xdc20a261, 0x774b695a, 0x121a161c, 0x93ba0ae2, 0xa02ae5c0, 0x22e0433c, 0x1b171d12, 0x090d0b0e, 0x8bc7adf2, 0xb6a8b92d, 0x1ea9c814, 0xf1198557, 0x75074caf, 0x99ddbbee, 0x7f60fda3, 0x01269ff7, 0x72f5bc5c, 0x663bc544, 0xfb7e345b, 0x4329768b, 0x23c6dccb, 0xedfc68b6, 0xe4f163b8, 0x31dccad7, 0x63851042, 0x97224013, 0xc6112084, 0x4a247d85, 0xbb3df8d2, 0xf93211ae, 0x29a16dc7, 0x9e2f4b1d, 0xb230f3dc, 0x8652ec0d, 0xc1e3d077, 0xb3166c2b, 0x70b999a9, 0x9448fa11, 0xe9642247, 0xfc8cc4a8, 0xf03f1aa0, 0x7d2cd856, 0x3390ef22, 0x494ec787, 0x38d1c1d9, 0xcaa2fe8c, 0xd40b3698, 0xf581cfa6, 0x7ade28a5, 0xb78e26da, 0xadbfa43f, 0x3a9de42c, 0x78920d50, 0x5fcc9b6a, 0x7e466254, 0x8d13c2f6, 0xd8b8e890, 0x39f75e2e, 0xc3aff582, 0x5d80be9f, 0xd0937c69, 0xd52da96f, 0x2512b3cf, 0xac993bc8, 0x187da710, 0x9c636ee8, 0x3bbb7bdb, 0x267809cd, 0x5918f46e, 0x9ab701ec, 0x4f9aa883, 0x956e65e6, 0xffe67eaa, 0xbccf0821, 0x15e8e6ef, 0xe79bd9ba, 0x6f36ce4a, 0x9f09d4ea, 0xb07cd629, 0xa4b2af31, 0x3f23312a, 0xa59430c6, 0xa266c035, 0x4ebc3774, 0x82caa6fc, 0x90d0b0e0, 0xa7d81533, 0x04984af1, 0xecdaf741, 0xcd500e7f, 0x91f62f17, 0x4dd68d76, 0xefb04d43, 0xaa4d54cc, 0x9604dfe4, 0xd1b5e39e, 0x6a881b4c, 0x2c1fb8c1, 0x65517f46, 0x5eea049d, 0x8c355d01, 0x877473fa, 0x0b412efb, 0x671d5ab3, 0xdbd25292, 0x105633e9, 0xd647136d, 0xd7618c9a, 0xa10c7a37, 0xf8148e59, 0x133c89eb, 0xa927eece, 0x61c935b7, 0x1ce5ede1, 0x47b13c7a, 0xd2df599c, 0xf2733f55, 0x14ce7918, 0xc737bf73, 0xf7cdea53, 0xfdaa5b5f, 0x3d6f14df, 0x44db8678, 0xaff381ca, 0x68c43eb9, 0x24342c38, 0xa3405fc2, 0x1dc37216, 0xe2250cbc, 0x3c498b28, 0x0d9541ff, 0xa8017139, 0x0cb3de08, 0xb4e49cd8, 0x56c19064, 0xcb84617b, 0x32b670d5, 0x6c5c7448, 0xb85742d0]; // Transformations for decryption key expansion const U1 = [0x00000000, 0x0e090d0b, 0x1c121a16, 0x121b171d, 0x3824342c, 0x362d3927, 0x24362e3a, 0x2a3f2331, 0x70486858, 0x7e416553, 0x6c5a724e, 0x62537f45, 0x486c5c74, 0x4665517f, 0x547e4662, 0x5a774b69, 0xe090d0b0, 0xee99ddbb, 0xfc82caa6, 0xf28bc7ad, 0xd8b4e49c, 0xd6bde997, 0xc4a6fe8a, 0xcaaff381, 0x90d8b8e8, 0x9ed1b5e3, 0x8ccaa2fe, 0x82c3aff5, 0xa8fc8cc4, 0xa6f581cf, 0xb4ee96d2, 0xbae79bd9, 0xdb3bbb7b, 0xd532b670, 0xc729a16d, 0xc920ac66, 0xe31f8f57, 0xed16825c, 0xff0d9541, 0xf104984a, 0xab73d323, 0xa57ade28, 0xb761c935, 0xb968c43e, 0x9357e70f, 0x9d5eea04, 0x8f45fd19, 0x814cf012, 0x3bab6bcb, 0x35a266c0, 0x27b971dd, 0x29b07cd6, 0x038f5fe7, 0x0d8652ec, 0x1f9d45f1, 0x119448fa, 0x4be30393, 0x45ea0e98, 0x57f11985, 0x59f8148e, 0x73c737bf, 0x7dce3ab4, 0x6fd52da9, 0x61dc20a2, 0xad766df6, 0xa37f60fd, 0xb16477e0, 0xbf6d7aeb, 0x955259da, 0x9b5b54d1, 0x894043cc, 0x87494ec7, 0xdd3e05ae, 0xd33708a5, 0xc12c1fb8, 0xcf2512b3, 0xe51a3182, 0xeb133c89, 0xf9082b94, 0xf701269f, 0x4de6bd46, 0x43efb04d, 0x51f4a750, 0x5ffdaa5b, 0x75c2896a, 0x7bcb8461, 0x69d0937c, 0x67d99e77, 0x3daed51e, 0x33a7d815, 0x21bccf08, 0x2fb5c203, 0x058ae132, 0x0b83ec39, 0x1998fb24, 0x1791f62f, 0x764dd68d, 0x7844db86, 0x6a5fcc9b, 0x6456c190, 0x4e69e2a1, 0x4060efaa, 0x527bf8b7, 0x5c72f5bc, 0x0605bed5, 0x080cb3de, 0x1a17a4c3, 0x141ea9c8, 0x3e218af9, 0x302887f2, 0x223390ef, 0x2c3a9de4, 0x96dd063d, 0x98d40b36, 0x8acf1c2b, 0x84c61120, 0xaef93211, 0xa0f03f1a, 0xb2eb2807, 0xbce2250c, 0xe6956e65, 0xe89c636e, 0xfa877473, 0xf48e7978, 0xdeb15a49, 0xd0b85742, 0xc2a3405f, 0xccaa4d54, 0x41ecdaf7, 0x4fe5d7fc, 0x5dfec0e1, 0x53f7cdea, 0x79c8eedb, 0x77c1e3d0, 0x65daf4cd, 0x6bd3f9c6, 0x31a4b2af, 0x3fadbfa4, 0x2db6a8b9, 0x23bfa5b2, 0x09808683, 0x07898b88, 0x15929c95, 0x1b9b919e, 0xa17c0a47, 0xaf75074c, 0xbd6e1051, 0xb3671d5a, 0x99583e6b, 0x97513360, 0x854a247d, 0x8b432976, 0xd134621f, 0xdf3d6f14, 0xcd267809, 0xc32f7502, 0xe9105633, 0xe7195b38, 0xf5024c25, 0xfb0b412e, 0x9ad7618c, 0x94de6c87, 0x86c57b9a, 0x88cc7691, 0xa2f355a0, 0xacfa58ab, 0xbee14fb6, 0xb0e842bd, 0xea9f09d4, 0xe49604df, 0xf68d13c2, 0xf8841ec9, 0xd2bb3df8, 0xdcb230f3, 0xcea927ee, 0xc0a02ae5, 0x7a47b13c, 0x744ebc37, 0x6655ab2a, 0x685ca621, 0x42638510, 0x4c6a881b, 0x5e719f06, 0x5078920d, 0x0a0fd964, 0x0406d46f, 0x161dc372, 0x1814ce79, 0x322bed48, 0x3c22e043, 0x2e39f75e, 0x2030fa55, 0xec9ab701, 0xe293ba0a, 0xf088ad17, 0xfe81a01c, 0xd4be832d, 0xdab78e26, 0xc8ac993b, 0xc6a59430, 0x9cd2df59, 0x92dbd252, 0x80c0c54f, 0x8ec9c844, 0xa4f6eb75, 0xaaffe67e, 0xb8e4f163, 0xb6edfc68, 0x0c0a67b1, 0x02036aba, 0x10187da7, 0x1e1170ac, 0x342e539d, 0x3a275e96, 0x283c498b, 0x26354480, 0x7c420fe9, 0x724b02e2, 0x605015ff, 0x6e5918f4, 0x44663bc5, 0x4a6f36ce, 0x587421d3, 0x567d2cd8, 0x37a10c7a, 0x39a80171, 0x2bb3166c, 0x25ba1b67, 0x0f853856, 0x018c355d, 0x13972240, 0x1d9e2f4b, 0x47e96422, 0x49e06929, 0x5bfb7e34, 0x55f2733f, 0x7fcd500e, 0x71c45d05, 0x63df4a18, 0x6dd64713, 0xd731dcca, 0xd938d1c1, 0xcb23c6dc, 0xc52acbd7, 0xef15e8e6, 0xe11ce5ed, 0xf307f2f0, 0xfd0efffb, 0xa779b492, 0xa970b999, 0xbb6bae84, 0xb562a38f, 0x9f5d80be, 0x91548db5, 0x834f9aa8, 0x8d4697a3]; const U2 = [0x00000000, 0x0b0e090d, 0x161c121a, 0x1d121b17, 0x2c382434, 0x27362d39, 0x3a24362e, 0x312a3f23, 0x58704868, 0x537e4165, 0x4e6c5a72, 0x4562537f, 0x74486c5c, 0x7f466551, 0x62547e46, 0x695a774b, 0xb0e090d0, 0xbbee99dd, 0xa6fc82ca, 0xadf28bc7, 0x9cd8b4e4, 0x97d6bde9, 0x8ac4a6fe, 0x81caaff3, 0xe890d8b8, 0xe39ed1b5, 0xfe8ccaa2, 0xf582c3af, 0xc4a8fc8c, 0xcfa6f581, 0xd2b4ee96, 0xd9bae79b, 0x7bdb3bbb, 0x70d532b6, 0x6dc729a1, 0x66c920ac, 0x57e31f8f, 0x5ced1682, 0x41ff0d95, 0x4af10498, 0x23ab73d3, 0x28a57ade, 0x35b761c9, 0x3eb968c4, 0x0f9357e7, 0x049d5eea, 0x198f45fd, 0x12814cf0, 0xcb3bab6b, 0xc035a266, 0xdd27b971, 0xd629b07c, 0xe7038f5f, 0xec0d8652, 0xf11f9d45, 0xfa119448, 0x934be303, 0x9845ea0e, 0x8557f119, 0x8e59f814, 0xbf73c737, 0xb47dce3a, 0xa96fd52d, 0xa261dc20, 0xf6ad766d, 0xfda37f60, 0xe0b16477, 0xebbf6d7a, 0xda955259, 0xd19b5b54, 0xcc894043, 0xc787494e, 0xaedd3e05, 0xa5d33708, 0xb8c12c1f, 0xb3cf2512, 0x82e51a31, 0x89eb133c, 0x94f9082b, 0x9ff70126, 0x464de6bd, 0x4d43efb0, 0x5051f4a7, 0x5b5ffdaa, 0x6a75c289, 0x617bcb84, 0x7c69d093, 0x7767d99e, 0x1e3daed5, 0x1533a7d8, 0x0821bccf, 0x032fb5c2, 0x32058ae1, 0x390b83ec, 0x241998fb, 0x2f1791f6, 0x8d764dd6, 0x867844db, 0x9b6a5fcc, 0x906456c1, 0xa14e69e2, 0xaa4060ef, 0xb7527bf8, 0xbc5c72f5, 0xd50605be, 0xde080cb3, 0xc31a17a4, 0xc8141ea9, 0xf93e218a, 0xf2302887, 0xef223390, 0xe42c3a9d, 0x3d96dd06, 0x3698d40b, 0x2b8acf1c, 0x2084c611, 0x11aef932, 0x1aa0f03f, 0x07b2eb28, 0x0cbce225, 0x65e6956e, 0x6ee89c63, 0x73fa8774, 0x78f48e79, 0x49deb15a, 0x42d0b857, 0x5fc2a340, 0x54ccaa4d, 0xf741ecda, 0xfc4fe5d7, 0xe15dfec0, 0xea53f7cd, 0xdb79c8ee, 0xd077c1e3, 0xcd65daf4, 0xc66bd3f9, 0xaf31a4b2, 0xa43fadbf, 0xb92db6a8, 0xb223bfa5, 0x83098086, 0x8807898b, 0x9515929c, 0x9e1b9b91, 0x47a17c0a, 0x4caf7507, 0x51bd6e10, 0x5ab3671d, 0x6b99583e, 0x60975133, 0x7d854a24, 0x768b4329, 0x1fd13462, 0x14df3d6f, 0x09cd2678, 0x02c32f75, 0x33e91056, 0x38e7195b, 0x25f5024c, 0x2efb0b41, 0x8c9ad761, 0x8794de6c, 0x9a86c57b, 0x9188cc76, 0xa0a2f355, 0xabacfa58, 0xb6bee14f, 0xbdb0e842, 0xd4ea9f09, 0xdfe49604, 0xc2f68d13, 0xc9f8841e, 0xf8d2bb3d, 0xf3dcb230, 0xeecea927, 0xe5c0a02a, 0x3c7a47b1, 0x37744ebc, 0x2a6655ab, 0x21685ca6, 0x10426385, 0x1b4c6a88, 0x065e719f, 0x0d507892, 0x640a0fd9, 0x6f0406d4, 0x72161dc3, 0x791814ce, 0x48322bed, 0x433c22e0, 0x5e2e39f7, 0x552030fa, 0x01ec9ab7, 0x0ae293ba, 0x17f088ad, 0x1cfe81a0, 0x2dd4be83, 0x26dab78e, 0x3bc8ac99, 0x30c6a594, 0x599cd2df, 0x5292dbd2, 0x4f80c0c5, 0x448ec9c8, 0x75a4f6eb, 0x7eaaffe6, 0x63b8e4f1, 0x68b6edfc, 0xb10c0a67, 0xba02036a, 0xa710187d, 0xac1e1170, 0x9d342e53, 0x963a275e, 0x8b283c49, 0x80263544, 0xe97c420f, 0xe2724b02, 0xff605015, 0xf46e5918, 0xc544663b, 0xce4a6f36, 0xd3587421, 0xd8567d2c, 0x7a37a10c, 0x7139a801, 0x6c2bb316, 0x6725ba1b, 0x560f8538, 0x5d018c35, 0x40139722, 0x4b1d9e2f, 0x2247e964, 0x2949e069, 0x345bfb7e, 0x3f55f273, 0x0e7fcd50, 0x0571c45d, 0x1863df4a, 0x136dd647, 0xcad731dc, 0xc1d938d1, 0xdccb23c6, 0xd7c52acb, 0xe6ef15e8, 0xede11ce5, 0xf0f307f2, 0xfbfd0eff, 0x92a779b4, 0x99a970b9, 0x84bb6bae, 0x8fb562a3, 0xbe9f5d80, 0xb591548d, 0xa8834f9a, 0xa38d4697]; const U3 = [0x00000000, 0x0d0b0e09, 0x1a161c12, 0x171d121b, 0x342c3824, 0x3927362d, 0x2e3a2436, 0x23312a3f, 0x68587048, 0x65537e41, 0x724e6c5a, 0x7f456253, 0x5c74486c, 0x517f4665, 0x4662547e, 0x4b695a77, 0xd0b0e090, 0xddbbee99, 0xcaa6fc82, 0xc7adf28b, 0xe49cd8b4, 0xe997d6bd, 0xfe8ac4a6, 0xf381caaf, 0xb8e890d8, 0xb5e39ed1, 0xa2fe8cca, 0xaff582c3, 0x8cc4a8fc, 0x81cfa6f5, 0x96d2b4ee, 0x9bd9bae7, 0xbb7bdb3b, 0xb670d532, 0xa16dc729, 0xac66c920, 0x8f57e31f, 0x825ced16, 0x9541ff0d, 0x984af104, 0xd323ab73, 0xde28a57a, 0xc935b761, 0xc43eb968, 0xe70f9357, 0xea049d5e, 0xfd198f45, 0xf012814c, 0x6bcb3bab, 0x66c035a2, 0x71dd27b9, 0x7cd629b0, 0x5fe7038f, 0x52ec0d86, 0x45f11f9d, 0x48fa1194, 0x03934be3, 0x0e9845ea, 0x198557f1, 0x148e59f8, 0x37bf73c7, 0x3ab47dce, 0x2da96fd5, 0x20a261dc, 0x6df6ad76, 0x60fda37f, 0x77e0b164, 0x7aebbf6d, 0x59da9552, 0x54d19b5b, 0x43cc8940, 0x4ec78749, 0x05aedd3e, 0x08a5d337, 0x1fb8c12c, 0x12b3cf25, 0x3182e51a, 0x3c89eb13, 0x2b94f908, 0x269ff701, 0xbd464de6, 0xb04d43ef, 0xa75051f4, 0xaa5b5ffd, 0x896a75c2, 0x84617bcb, 0x937c69d0, 0x9e7767d9, 0xd51e3dae, 0xd81533a7, 0xcf0821bc, 0xc2032fb5, 0xe132058a, 0xec390b83, 0xfb241998, 0xf62f1791, 0xd68d764d, 0xdb867844, 0xcc9b6a5f, 0xc1906456, 0xe2a14e69, 0xefaa4060, 0xf8b7527b, 0xf5bc5c72, 0xbed50605, 0xb3de080c, 0xa4c31a17, 0xa9c8141e, 0x8af93e21, 0x87f23028, 0x90ef2233, 0x9de42c3a, 0x063d96dd, 0x0b3698d4, 0x1c2b8acf, 0x112084c6, 0x3211aef9, 0x3f1aa0f0, 0x2807b2eb, 0x250cbce2, 0x6e65e695, 0x636ee89c, 0x7473fa87, 0x7978f48e, 0x5a49deb1, 0x5742d0b8, 0x405fc2a3, 0x4d54ccaa, 0xdaf741ec, 0xd7fc4fe5, 0xc0e15dfe, 0xcdea53f7, 0xeedb79c8, 0xe3d077c1, 0xf4cd65da, 0xf9c66bd3, 0xb2af31a4, 0xbfa43fad, 0xa8b92db6, 0xa5b223bf, 0x86830980, 0x8b880789, 0x9c951592, 0x919e1b9b, 0x0a47a17c, 0x074caf75, 0x1051bd6e, 0x1d5ab367, 0x3e6b9958, 0x33609751, 0x247d854a, 0x29768b43, 0x621fd134, 0x6f14df3d, 0x7809cd26, 0x7502c32f, 0x5633e910, 0x5b38e719, 0x4c25f502, 0x412efb0b, 0x618c9ad7, 0x6c8794de, 0x7b9a86c5, 0x769188cc, 0x55a0a2f3, 0x58abacfa, 0x4fb6bee1, 0x42bdb0e8, 0x09d4ea9f, 0x04dfe496, 0x13c2f68d, 0x1ec9f884, 0x3df8d2bb, 0x30f3dcb2, 0x27eecea9, 0x2ae5c0a0, 0xb13c7a47, 0xbc37744e, 0xab2a6655, 0xa621685c, 0x85104263, 0x881b4c6a, 0x9f065e71, 0x920d5078, 0xd9640a0f, 0xd46f0406, 0xc372161d, 0xce791814, 0xed48322b, 0xe0433c22, 0xf75e2e39, 0xfa552030, 0xb701ec9a, 0xba0ae293, 0xad17f088, 0xa01cfe81, 0x832dd4be, 0x8e26dab7, 0x993bc8ac, 0x9430c6a5, 0xdf599cd2, 0xd25292db, 0xc54f80c0, 0xc8448ec9, 0xeb75a4f6, 0xe67eaaff, 0xf163b8e4, 0xfc68b6ed, 0x67b10c0a, 0x6aba0203, 0x7da71018, 0x70ac1e11, 0x539d342e, 0x5e963a27, 0x498b283c, 0x44802635, 0x0fe97c42, 0x02e2724b, 0x15ff6050, 0x18f46e59, 0x3bc54466, 0x36ce4a6f, 0x21d35874, 0x2cd8567d, 0x0c7a37a1, 0x017139a8, 0x166c2bb3, 0x1b6725ba, 0x38560f85, 0x355d018c, 0x22401397, 0x2f4b1d9e, 0x642247e9, 0x692949e0, 0x7e345bfb, 0x733f55f2, 0x500e7fcd, 0x5d0571c4, 0x4a1863df, 0x47136dd6, 0xdccad731, 0xd1c1d938, 0xc6dccb23, 0xcbd7c52a, 0xe8e6ef15, 0xe5ede11c, 0xf2f0f307, 0xfffbfd0e, 0xb492a779, 0xb999a970, 0xae84bb6b, 0xa38fb562, 0x80be9f5d, 0x8db59154, 0x9aa8834f, 0x97a38d46]; const U4 = [0x00000000, 0x090d0b0e, 0x121a161c, 0x1b171d12, 0x24342c38, 0x2d392736, 0x362e3a24, 0x3f23312a, 0x48685870, 0x4165537e, 0x5a724e6c, 0x537f4562, 0x6c5c7448, 0x65517f46, 0x7e466254, 0x774b695a, 0x90d0b0e0, 0x99ddbbee, 0x82caa6fc, 0x8bc7adf2, 0xb4e49cd8, 0xbde997d6, 0xa6fe8ac4, 0xaff381ca, 0xd8b8e890, 0xd1b5e39e, 0xcaa2fe8c, 0xc3aff582, 0xfc8cc4a8, 0xf581cfa6, 0xee96d2b4, 0xe79bd9ba, 0x3bbb7bdb, 0x32b670d5, 0x29a16dc7, 0x20ac66c9, 0x1f8f57e3, 0x16825ced, 0x0d9541ff, 0x04984af1, 0x73d323ab, 0x7ade28a5, 0x61c935b7, 0x68c43eb9, 0x57e70f93, 0x5eea049d, 0x45fd198f, 0x4cf01281, 0xab6bcb3b, 0xa266c035, 0xb971dd27, 0xb07cd629, 0x8f5fe703, 0x8652ec0d, 0x9d45f11f, 0x9448fa11, 0xe303934b, 0xea0e9845, 0xf1198557, 0xf8148e59, 0xc737bf73, 0xce3ab47d, 0xd52da96f, 0xdc20a261, 0x766df6ad, 0x7f60fda3, 0x6477e0b1, 0x6d7aebbf, 0x5259da95, 0x5b54d19b, 0x4043cc89, 0x494ec787, 0x3e05aedd, 0x3708a5d3, 0x2c1fb8c1, 0x2512b3cf, 0x1a3182e5, 0x133c89eb, 0x082b94f9, 0x01269ff7, 0xe6bd464d, 0xefb04d43, 0xf4a75051, 0xfdaa5b5f, 0xc2896a75, 0xcb84617b, 0xd0937c69, 0xd99e7767, 0xaed51e3d, 0xa7d81533, 0xbccf0821, 0xb5c2032f, 0x8ae13205, 0x83ec390b, 0x98fb2419, 0x91f62f17, 0x4dd68d76, 0x44db8678, 0x5fcc9b6a, 0x56c19064, 0x69e2a14e, 0x60efaa40, 0x7bf8b752, 0x72f5bc5c, 0x05bed506, 0x0cb3de08, 0x17a4c31a, 0x1ea9c814, 0x218af93e, 0x2887f230, 0x3390ef22, 0x3a9de42c, 0xdd063d96, 0xd40b3698, 0xcf1c2b8a, 0xc6112084, 0xf93211ae, 0xf03f1aa0, 0xeb2807b2, 0xe2250cbc, 0x956e65e6, 0x9c636ee8, 0x877473fa, 0x8e7978f4, 0xb15a49de, 0xb85742d0, 0xa3405fc2, 0xaa4d54cc, 0xecdaf741, 0xe5d7fc4f, 0xfec0e15d, 0xf7cdea53, 0xc8eedb79, 0xc1e3d077, 0xdaf4cd65, 0xd3f9c66b, 0xa4b2af31, 0xadbfa43f, 0xb6a8b92d, 0xbfa5b223, 0x80868309, 0x898b8807, 0x929c9515, 0x9b919e1b, 0x7c0a47a1, 0x75074caf, 0x6e1051bd, 0x671d5ab3, 0x583e6b99, 0x51336097, 0x4a247d85, 0x4329768b, 0x34621fd1, 0x3d6f14df, 0x267809cd, 0x2f7502c3, 0x105633e9, 0x195b38e7, 0x024c25f5, 0x0b412efb, 0xd7618c9a, 0xde6c8794, 0xc57b9a86, 0xcc769188, 0xf355a0a2, 0xfa58abac, 0xe14fb6be, 0xe842bdb0, 0x9f09d4ea, 0x9604dfe4, 0x8d13c2f6, 0x841ec9f8, 0xbb3df8d2, 0xb230f3dc, 0xa927eece, 0xa02ae5c0, 0x47b13c7a, 0x4ebc3774, 0x55ab2a66, 0x5ca62168, 0x63851042, 0x6a881b4c, 0x719f065e, 0x78920d50, 0x0fd9640a, 0x06d46f04, 0x1dc37216, 0x14ce7918, 0x2bed4832, 0x22e0433c, 0x39f75e2e, 0x30fa5520, 0x9ab701ec, 0x93ba0ae2, 0x88ad17f0, 0x81a01cfe, 0xbe832dd4, 0xb78e26da, 0xac993bc8, 0xa59430c6, 0xd2df599c, 0xdbd25292, 0xc0c54f80, 0xc9c8448e, 0xf6eb75a4, 0xffe67eaa, 0xe4f163b8, 0xedfc68b6, 0x0a67b10c, 0x036aba02, 0x187da710, 0x1170ac1e, 0x2e539d34, 0x275e963a, 0x3c498b28, 0x35448026, 0x420fe97c, 0x4b02e272, 0x5015ff60, 0x5918f46e, 0x663bc544, 0x6f36ce4a, 0x7421d358, 0x7d2cd856, 0xa10c7a37, 0xa8017139, 0xb3166c2b, 0xba1b6725, 0x8538560f, 0x8c355d01, 0x97224013, 0x9e2f4b1d, 0xe9642247, 0xe0692949, 0xfb7e345b, 0xf2733f55, 0xcd500e7f, 0xc45d0571, 0xdf4a1863, 0xd647136d, 0x31dccad7, 0x38d1c1d9, 0x23c6dccb, 0x2acbd7c5, 0x15e8e6ef, 0x1ce5ede1, 0x07f2f0f3, 0x0efffbfd, 0x79b492a7, 0x70b999a9, 0x6bae84bb, 0x62a38fb5, 0x5d80be9f, 0x548db591, 0x4f9aa883, 0x4697a38d]; function convertToInt32(bytes) { const result = []; for (let i = 0; i < bytes.length; i += 4) { result.push(bytes[i] << 24 | bytes[i + 1] << 16 | bytes[i + 2] << 8 | bytes[i + 3]); } return result; } class AES { get key() { return __classPrivateFieldGet$2(this, _AES_key, "f").slice(); } constructor(key) { _AES_key.set(this, void 0); _AES_Kd.set(this, void 0); _AES_Ke.set(this, void 0); if (!(this instanceof AES)) { throw Error('AES must be instanitated with `new`'); } __classPrivateFieldSet$2(this, _AES_key, new Uint8Array(key), "f"); const rounds = numberOfRounds[this.key.length]; if (rounds == null) { throw new TypeError('invalid key size (must be 16, 24 or 32 bytes)'); } // encryption round keys __classPrivateFieldSet$2(this, _AES_Ke, [], "f"); // decryption round keys __classPrivateFieldSet$2(this, _AES_Kd, [], "f"); for (let i = 0; i <= rounds; i++) { __classPrivateFieldGet$2(this, _AES_Ke, "f").push([0, 0, 0, 0]); __classPrivateFieldGet$2(this, _AES_Kd, "f").push([0, 0, 0, 0]); } const roundKeyCount = (rounds + 1) * 4; const KC = this.key.length / 4; // convert the key into ints const tk = convertToInt32(this.key); // copy values into round key arrays let index; for (let i = 0; i < KC; i++) { index = i >> 2; __classPrivateFieldGet$2(this, _AES_Ke, "f")[index][i % 4] = tk[i]; __classPrivateFieldGet$2(this, _AES_Kd, "f")[rounds - index][i % 4] = tk[i]; } // key expansion (fips-197 section 5.2) let rconpointer = 0; let t = KC, tt; while (t < roundKeyCount) { tt = tk[KC - 1]; tk[0] ^= S[tt >> 16 & 0xFF] << 24 ^ S[tt >> 8 & 0xFF] << 16 ^ S[tt & 0xFF] << 8 ^ S[tt >> 24 & 0xFF] ^ rcon[rconpointer] << 24; rconpointer += 1; // key expansion (for non-256 bit) if (KC != 8) { for (let i = 1; i < KC; i++) { tk[i] ^= tk[i - 1]; } // key expansion for 256-bit keys is "slightly different" (fips-197) } else { for (let i = 1; i < KC / 2; i++) { tk[i] ^= tk[i - 1]; } tt = tk[KC / 2 - 1]; tk[KC / 2] ^= S[tt & 0xFF] ^ S[tt >> 8 & 0xFF] << 8 ^ S[tt >> 16 & 0xFF] << 16 ^ S[tt >> 24 & 0xFF] << 24; for (let i = KC / 2 + 1; i < KC; i++) { tk[i] ^= tk[i - 1]; } } // copy values into round key arrays let i = 0, r, c; while (i < KC && t < roundKeyCount) { r = t >> 2; c = t % 4; __classPrivateFieldGet$2(this, _AES_Ke, "f")[r][c] = tk[i]; __classPrivateFieldGet$2(this, _AES_Kd, "f")[rounds - r][c] = tk[i++]; t++; } } // inverse-cipher-ify the decryption round key (fips-197 section 5.3) for (let r = 1; r < rounds; r++) { for (let c = 0; c < 4; c++) { tt = __classPrivateFieldGet$2(this, _AES_Kd, "f")[r][c]; __classPrivateFieldGet$2(this, _AES_Kd, "f")[r][c] = U1[tt >> 24 & 0xFF] ^ U2[tt >> 16 & 0xFF] ^ U3[tt >> 8 & 0xFF] ^ U4[tt & 0xFF]; } } } encrypt(plaintext) { if (plaintext.length != 16) { throw new TypeError('invalid plaintext size (must be 16 bytes)'); } const rounds = __classPrivateFieldGet$2(this, _AES_Ke, "f").length - 1; const a = [0, 0, 0, 0]; // convert plaintext to (ints ^ key) let t = convertToInt32(plaintext); for (let i = 0; i < 4; i++) { t[i] ^= __classPrivateFieldGet$2(this, _AES_Ke, "f")[0][i]; } // apply round transforms for (let r = 1; r < rounds; r++) { for (let i = 0; i < 4; i++) { a[i] = T1[t[i] >> 24 & 0xff] ^ T2[t[(i + 1) % 4] >> 16 & 0xff] ^ T3[t[(i + 2) % 4] >> 8 & 0xff] ^ T4[t[(i + 3) % 4] & 0xff] ^ __classPrivateFieldGet$2(this, _AES_Ke, "f")[r][i]; } t = a.slice(); } // the last round is special const result = new Uint8Array(16); let tt = 0; for (let i = 0; i < 4; i++) { tt = __classPrivateFieldGet$2(this, _AES_Ke, "f")[rounds][i]; result[4 * i] = (S[t[i] >> 24 & 0xff] ^ tt >> 24) & 0xff; result[4 * i + 1] = (S[t[(i + 1) % 4] >> 16 & 0xff] ^ tt >> 16) & 0xff; result[4 * i + 2] = (S[t[(i + 2) % 4] >> 8 & 0xff] ^ tt >> 8) & 0xff; result[4 * i + 3] = (S[t[(i + 3) % 4] & 0xff] ^ tt) & 0xff; } return result; } decrypt(ciphertext) { if (ciphertext.length != 16) { throw new TypeError('invalid ciphertext size (must be 16 bytes)'); } const rounds = __classPrivateFieldGet$2(this, _AES_Kd, "f").length - 1; const a = [0, 0, 0, 0]; // convert plaintext to (ints ^ key) let t = convertToInt32(ciphertext); for (let i = 0; i < 4; i++) { t[i] ^= __classPrivateFieldGet$2(this, _AES_Kd, "f")[0][i]; } // apply round transforms for (let r = 1; r < rounds; r++) { for (let i = 0; i < 4; i++) { a[i] = T5[t[i] >> 24 & 0xff] ^ T6[t[(i + 3) % 4] >> 16 & 0xff] ^ T7[t[(i + 2) % 4] >> 8 & 0xff] ^ T8[t[(i + 1) % 4] & 0xff] ^ __classPrivateFieldGet$2(this, _AES_Kd, "f")[r][i]; } t = a.slice(); } // the last round is special const result = new Uint8Array(16); let tt = 0; for (let i = 0; i < 4; i++) { tt = __classPrivateFieldGet$2(this, _AES_Kd, "f")[rounds][i]; result[4 * i] = (Si[t[i] >> 24 & 0xff] ^ tt >> 24) & 0xff; result[4 * i + 1] = (Si[t[(i + 3) % 4] >> 16 & 0xff] ^ tt >> 16) & 0xff; result[4 * i + 2] = (Si[t[(i + 2) % 4] >> 8 & 0xff] ^ tt >> 8) & 0xff; result[4 * i + 3] = (Si[t[(i + 1) % 4] & 0xff] ^ tt) & 0xff; } return result; } } _AES_key = new WeakMap(), _AES_Kd = new WeakMap(), _AES_Ke = new WeakMap(); class ModeOfOperation { constructor(name, key, cls) { if (cls && !(this instanceof cls)) { throw new Error(`${name} must be instantiated with "new"`); } Object.defineProperties(this, { aes: { enumerable: true, value: new AES(key) }, name: { enumerable: true, value: name } }); } } // Cipher Block Chaining var __classPrivateFieldSet$1 = undefined && undefined.__classPrivateFieldSet || function (receiver, state, value, kind, f) { if (kind === "m") throw new TypeError("Private method is not writable"); if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value; }; var __classPrivateFieldGet$1 = undefined && undefined.__classPrivateFieldGet || function (receiver, state, kind, f) { if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); }; var _CBC_iv, _CBC_lastBlock; class CBC extends ModeOfOperation { constructor(key, iv) { super("ECC", key, CBC); _CBC_iv.set(this, void 0); _CBC_lastBlock.set(this, void 0); if (iv) { if (iv.length % 16) { throw new TypeError("invalid iv size (must be 16 bytes)"); } __classPrivateFieldSet$1(this, _CBC_iv, new Uint8Array(iv), "f"); } else { __classPrivateFieldSet$1(this, _CBC_iv, new Uint8Array(16), "f"); } __classPrivateFieldSet$1(this, _CBC_lastBlock, this.iv, "f"); } get iv() { return new Uint8Array(__classPrivateFieldGet$1(this, _CBC_iv, "f")); } encrypt(plaintext) { if (plaintext.length % 16) { throw new TypeError("invalid plaintext size (must be multiple of 16 bytes)"); } const ciphertext = new Uint8Array(plaintext.length); for (let i = 0; i < plaintext.length; i += 16) { for (let j = 0; j < 16; j++) { __classPrivateFieldGet$1(this, _CBC_lastBlock, "f")[j] ^= plaintext[i + j]; } __classPrivateFieldSet$1(this, _CBC_lastBlock, this.aes.encrypt(__classPrivateFieldGet$1(this, _CBC_lastBlock, "f")), "f"); ciphertext.set(__classPrivateFieldGet$1(this, _CBC_lastBlock, "f"), i); } return ciphertext; } decrypt(ciphertext) { if (ciphertext.length % 16) { throw new TypeError("invalid ciphertext size (must be multiple of 16 bytes)"); } const plaintext = new Uint8Array(ciphertext.length); for (let i = 0; i < ciphertext.length; i += 16) { const block = this.aes.decrypt(ciphertext.subarray(i, i + 16)); for (let j = 0; j < 16; j++) { plaintext[i + j] = block[j] ^ __classPrivateFieldGet$1(this, _CBC_lastBlock, "f")[j]; __classPrivateFieldGet$1(this, _CBC_lastBlock, "f")[j] = ciphertext[i + j]; } } return plaintext; } } _CBC_iv = new WeakMap(), _CBC_lastBlock = new WeakMap(); // Counter Mode var __classPrivateFieldSet = undefined && undefined.__classPrivateFieldSet || function (receiver, state, value, kind, f) { if (kind === "m") throw new TypeError("Private method is not writable"); if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value; }; var __classPrivateFieldGet = undefined && undefined.__classPrivateFieldGet || function (receiver, state, kind, f) { if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); }; var _CTR_remaining, _CTR_remainingIndex, _CTR_counter; class CTR extends ModeOfOperation { constructor(key, initialValue) { super("CTR", key, CTR); // Remaining bytes for the one-time pad _CTR_remaining.set(this, void 0); _CTR_remainingIndex.set(this, void 0); // The current counter _CTR_counter.set(this, void 0); __classPrivateFieldSet(this, _CTR_counter, new Uint8Array(16), "f"); __classPrivateFieldGet(this, _CTR_counter, "f").fill(0); __classPrivateFieldSet(this, _CTR_remaining, __classPrivateFieldGet(this, _CTR_counter, "f"), "f"); // This will be discarded immediately __classPrivateFieldSet(this, _CTR_remainingIndex, 16, "f"); if (initialValue == null) { initialValue = 1; } if (typeof initialValue === "number") { this.setCounterValue(initialValue); } else { this.setCounterBytes(initialValue); } } get counter() { return new Uint8Array(__classPrivateFieldGet(this, _CTR_counter, "f")); } setCounterValue(value) { if (!Number.isInteger(value) || value < 0 || value > Number.MAX_SAFE_INTEGER) { throw new TypeError("invalid counter initial integer value"); } for (let index = 15; index >= 0; --index) { __classPrivateFieldGet(this, _CTR_counter, "f")[index] = value % 256; value = Math.floor(value / 256); } } setCounterBytes(value) { if (value.length !== 16) { throw new TypeError("invalid counter initial Uint8Array value length"); } __classPrivateFieldGet(this, _CTR_counter, "f").set(value); } increment() { for (let i = 15; i >= 0; i--) { if (__classPrivateFieldGet(this, _CTR_counter, "f")[i] === 255) { __classPrivateFieldGet(this, _CTR_counter, "f")[i] = 0; } else { __classPrivateFieldGet(this, _CTR_counter, "f")[i]++; break; } } } encrypt(plaintext) { var _a, _b; const crypttext = new Uint8Array(plaintext); for (let i = 0; i < crypttext.length; i++) { if (__classPrivateFieldGet(this, _CTR_remainingIndex, "f") === 16) { __classPrivateFieldSet(this, _CTR_remaining, this.aes.encrypt(__classPrivateFieldGet(this, _CTR_counter, "f")), "f"); __classPrivateFieldSet(this, _CTR_remainingIndex, 0, "f"); this.increment(); } crypttext[i] ^= __classPrivateFieldGet(this, _CTR_remaining, "f")[__classPrivateFieldSet(this, _CTR_remainingIndex, (_b = __classPrivateFieldGet(this, _CTR_remainingIndex, "f"), _a = _b++, _b), "f"), _a]; } return crypttext; } decrypt(ciphertext) { return this.encrypt(ciphertext); } } _CTR_remaining = new WeakMap(), _CTR_remainingIndex = new WeakMap(), _CTR_counter = new WeakMap(); function pkcs7Strip(data) { if (data.length < 16) { throw new TypeError('PKCS#7 invalid length'); } const padder = data[data.length - 1]; if (padder > 16) { throw new TypeError('PKCS#7 padding byte out of range'); } const length = data.length - padder; for (let i = 0; i < padder; i++) { if (data[length + i] !== padder) { throw new TypeError('PKCS#7 invalid padding byte'); } } return new Uint8Array(data.subarray(0, length)); } /** * @_ignore */ function looseArrayify(hexString) { if (typeof hexString === "string" && !hexString.startsWith("0x")) { hexString = "0x" + hexString; } return getBytesCopy(hexString); } function zpad$1(value, length) { value = String(value); while (value.length < length) { value = '0' + value; } return value; } function getPassword(password) { if (typeof password === 'string') { return toUtf8Bytes(password, "NFKC"); } return getBytesCopy(password); } function spelunk(object, _path) { const match = _path.match(/^([a-z0-9$_.-]*)(:([a-z]+))?(!)?$/i); assertArgument(match != null, "invalid path", "path", _path); const path = match[1]; const type = match[3]; const reqd = match[4] === "!"; let cur = object; for (const comp of path.toLowerCase().split('.')) { // Search for a child object with a case-insensitive matching key if (Array.isArray(cur)) { if (!comp.match(/^[0-9]+$/)) { break; } cur = cur[parseInt(comp)]; } else if (typeof cur === "object") { let found = null; for (const key in cur) { if (key.toLowerCase() === comp) { found = cur[key]; break; } } cur = found; } else { cur = null; } if (cur == null) { break; } } assertArgument(!reqd || cur != null, "missing required value", "path", path); if (type && cur != null) { if (type === "int") { if (typeof cur === "string" && cur.match(/^-?[0-9]+$/)) { return parseInt(cur); } else if (Number.isSafeInteger(cur)) { return cur; } } if (type === "number") { if (typeof cur === "string" && cur.match(/^-?[0-9.]*$/)) { return parseFloat(cur); } } if (type === "data") { if (typeof cur === "string") { return looseArrayify(cur); } } if (type === "array" && Array.isArray(cur)) { return cur; } if (type === typeof cur) { return cur; } assertArgument(false, `wrong type found for ${type} `, "path", path); } return cur; } /* export function follow(object: any, path: string): null | string { let currentChild = object; for (const comp of path.toLowerCase().split('/')) { // Search for a child object with a case-insensitive matching key let matchingChild = null; for (const key in currentChild) { if (key.toLowerCase() === comp) { matchingChild = currentChild[key]; break; } } if (matchingChild === null) { return null; } currentChild = matchingChild; } return currentChild; } // "path/to/something:type!" export function followRequired(data: any, path: string): string { const value = follow(data, path); if (value != null) { return value; } return logger.throwArgumentError("invalid value", `data:${ path }`, JSON.stringify(data)); } */ // See: https://www.ietf.org/rfc/rfc4122.txt (Section 4.4) /* export function uuidV4(randomBytes: BytesLike): string { const bytes = getBytes(randomBytes, "randomBytes"); // Section: 4.1.3: // - time_hi_and_version[12:16] = 0b0100 bytes[6] = (bytes[6] & 0x0f) | 0x40; // Section 4.4 // - clock_seq_hi_and_reserved[6] = 0b0 // - clock_seq_hi_and_reserved[7] = 0b1 bytes[8] = (bytes[8] & 0x3f) | 0x80; const value = hexlify(bytes); return [ value.substring(2, 10), value.substring(10, 14), value.substring(14, 18), value.substring(18, 22), value.substring(22, 34), ].join("-"); } */ /** * The JSON Wallet formats allow a simple way to store the private * keys needed in Ethereum along with related information and allows * for extensible forms of encryption. * * These utilities facilitate decrypting and encrypting the most common * JSON Wallet formats. * * @_subsection: api/wallet:JSON Wallets [json-wallets] */ const defaultPath$1 = "m/44'/60'/0'/0/0"; /** * Returns true if %%json%% is a valid JSON Keystore Wallet. */ function isKeystoreJson(json) { try { const data = JSON.parse(json); const version = data.version != null ? parseInt(data.version) : 0; if (version === 3) { return true; } } catch (error) {} return false; } function decrypt(data, key, ciphertext) { const cipher = spelunk(data, "crypto.cipher:string"); if (cipher === "aes-128-ctr") { const iv = spelunk(data, "crypto.cipherparams.iv:data!"); const aesCtr = new CTR(key, iv); return hexlify(aesCtr.decrypt(ciphertext)); } assert(false, "unsupported cipher", "UNSUPPORTED_OPERATION", { operation: "decrypt" }); } function getAccount(data, _key) { const key = getBytes(_key); const ciphertext = spelunk(data, "crypto.ciphertext:data!"); const computedMAC = hexlify(keccak256(concat([key.slice(16, 32), ciphertext]))).substring(2); assertArgument(computedMAC === spelunk(data, "crypto.mac:string!").toLowerCase(), "incorrect password", "password", "[ REDACTED ]"); const privateKey = decrypt(data, key.slice(0, 16), ciphertext); const address = computeAddress(privateKey); if (data.address) { let check = data.address.toLowerCase(); if (!check.startsWith("0x")) { check = "0x" + check; } assertArgument(getAddress(check) === address, "keystore address/privateKey mismatch", "address", data.address); } const account = { address, privateKey }; // Version 0.1 x-ethers metadata must contain an encrypted mnemonic phrase const version = spelunk(data, "x-ethers.version:string"); if (version === "0.1") { const mnemonicKey = key.slice(32, 64); const mnemonicCiphertext = spelunk(data, "x-ethers.mnemonicCiphertext:data!"); const mnemonicIv = spelunk(data, "x-ethers.mnemonicCounter:data!"); const mnemonicAesCtr = new CTR(mnemonicKey, mnemonicIv); account.mnemonic = { path: spelunk(data, "x-ethers.path:string") || defaultPath$1, locale: spelunk(data, "x-ethers.locale:string") || "en", entropy: hexlify(getBytes(mnemonicAesCtr.decrypt(mnemonicCiphertext))) }; } return account; } function getDecryptKdfParams(data) { const kdf = spelunk(data, "crypto.kdf:string"); if (kdf && typeof kdf === "string") { if (kdf.toLowerCase() === "scrypt") { const salt = spelunk(data, "crypto.kdfparams.salt:data!"); const N = spelunk(data, "crypto.kdfparams.n:int!"); const r = spelunk(data, "crypto.kdfparams.r:int!"); const p = spelunk(data, "crypto.kdfparams.p:int!"); // Make sure N is a power of 2 assertArgument(N > 0 && (N & N - 1) === 0, "invalid kdf.N", "kdf.N", N); assertArgument(r > 0 && p > 0, "invalid kdf", "kdf", kdf); const dkLen = spelunk(data, "crypto.kdfparams.dklen:int!"); assertArgument(dkLen === 32, "invalid kdf.dklen", "kdf.dflen", dkLen); return { name: "scrypt", salt, N, r, p, dkLen: 64 }; } else if (kdf.toLowerCase() === "pbkdf2") { const salt = spelunk(data, "crypto.kdfparams.salt:data!"); const prf = spelunk(data, "crypto.kdfparams.prf:string!"); const algorithm = prf.split("-").pop(); assertArgument(algorithm === "sha256" || algorithm === "sha512", "invalid kdf.pdf", "kdf.pdf", prf); const count = spelunk(data, "crypto.kdfparams.c:int!"); const dkLen = spelunk(data, "crypto.kdfparams.dklen:int!"); assertArgument(dkLen === 32, "invalid kdf.dklen", "kdf.dklen", dkLen); return { name: "pbkdf2", salt, count, dkLen, algorithm }; } } assertArgument(false, "unsupported key-derivation function", "kdf", kdf); } /** * Returns the account details for the JSON Keystore Wallet %%json%% * using %%password%%. * * It is preferred to use the [async version](decryptKeystoreJson) * instead, which allows a [[ProgressCallback]] to keep the user informed * as to the decryption status. * * This method will block the event loop (freezing all UI) until decryption * is complete, which can take quite some time, depending on the wallet * paramters and platform. */ function decryptKeystoreJsonSync(json, _password) { const data = JSON.parse(json); const password = getPassword(_password); const params = getDecryptKdfParams(data); if (params.name === "pbkdf2") { const { salt, count, dkLen, algorithm } = params; const key = pbkdf2(password, salt, count, dkLen, algorithm); return getAccount(data, key); } assert(params.name === "scrypt", "cannot be reached", "UNKNOWN_ERROR", { params }); const { salt, N, r, p, dkLen } = params; const key = scryptSync(password, salt, N, r, p, dkLen); return getAccount(data, key); } function stall$1(duration) { return new Promise(resolve => { setTimeout(() => { resolve(); }, duration); }); } /** * Resolves to the decrypted JSON Keystore Wallet %%json%% using the * %%password%%. * * If provided, %%progress%% will be called periodically during the * decrpytion to provide feedback, and if the function returns * ``false`` will halt decryption. * * The %%progressCallback%% will **always** receive ``0`` before * decryption begins and ``1`` when complete. */ async function decryptKeystoreJson(json, _password, progress) { const data = JSON.parse(json); const password = getPassword(_password); const params = getDecryptKdfParams(data); if (params.name === "pbkdf2") { if (progress) { progress(0); await stall$1(0); } const { salt, count, dkLen, algorithm } = params; const key = pbkdf2(password, salt, count, dkLen, algorithm); if (progress) { progress(1); await stall$1(0); } return getAccount(data, key); } assert(params.name === "scrypt", "cannot be reached", "UNKNOWN_ERROR", { params }); const { salt, N, r, p, dkLen } = params; const key = await scrypt(password, salt, N, r, p, dkLen, progress); return getAccount(data, key); } function getEncryptKdfParams(options) { // Check/generate the salt const salt = options.salt != null ? getBytes(options.salt, "options.salt") : randomBytes(32); // Override the scrypt password-based key derivation function parameters let N = 1 << 17, r = 8, p = 1; if (options.scrypt) { if (options.scrypt.N) { N = options.scrypt.N; } if (options.scrypt.r) { r = options.scrypt.r; } if (options.scrypt.p) { p = options.scrypt.p; } } assertArgument(typeof N === "number" && N > 0 && Number.isSafeInteger(N) && (BigInt(N) & BigInt(N - 1)) === BigInt(0), "invalid scrypt N parameter", "options.N", N); assertArgument(typeof r === "number" && r > 0 && Number.isSafeInteger(r), "invalid scrypt r parameter", "options.r", r); assertArgument(typeof p === "number" && p > 0 && Number.isSafeInteger(p), "invalid scrypt p parameter", "options.p", p); return { name: "scrypt", dkLen: 32, salt, N, r, p }; } function _encryptKeystore(key, kdf, account, options) { const privateKey = getBytes(account.privateKey, "privateKey"); // Override initialization vector const iv = options.iv != null ? getBytes(options.iv, "options.iv") : randomBytes(16); assertArgument(iv.length === 16, "invalid options.iv length", "options.iv", options.iv); // Override the uuid const uuidRandom = options.uuid != null ? getBytes(options.uuid, "options.uuid") : randomBytes(16); assertArgument(uuidRandom.length === 16, "invalid options.uuid length", "options.uuid", options.iv); // This will be used to encrypt the wallet (as per Web3 secret storage) // - 32 bytes As normal for the Web3 secret storage (derivedKey, macPrefix) // - 32 bytes AES key to encrypt mnemonic with (required here to be Ethers Wallet) const derivedKey = key.slice(0, 16); const macPrefix = key.slice(16, 32); // Encrypt the private key const aesCtr = new CTR(derivedKey, iv); const ciphertext = getBytes(aesCtr.encrypt(privateKey)); // Compute the message authentication code, used to check the password const mac = keccak256(concat([macPrefix, ciphertext])); // See: https://github.com/ethereum/wiki/wiki/Web3-Secret-Storage-Definition const data = { address: account.address.substring(2).toLowerCase(), id: uuidV4(uuidRandom), version: 3, Crypto: { cipher: "aes-128-ctr", cipherparams: { iv: hexlify(iv).substring(2) }, ciphertext: hexlify(ciphertext).substring(2), kdf: "scrypt", kdfparams: { salt: hexlify(kdf.salt).substring(2), n: kdf.N, dklen: 32, p: kdf.p, r: kdf.r }, mac: mac.substring(2) } }; // If we have a mnemonic, encrypt it into the JSON wallet if (account.mnemonic) { const client = options.client != null ? options.client : `ethers/${version}`; const path = account.mnemonic.path || defaultPath$1; const locale = account.mnemonic.locale || "en"; const mnemonicKey = key.slice(32, 64); const entropy = getBytes(account.mnemonic.entropy, "account.mnemonic.entropy"); const mnemonicIv = randomBytes(16); const mnemonicAesCtr = new CTR(mnemonicKey, mnemonicIv); const mnemonicCiphertext = getBytes(mnemonicAesCtr.encrypt(entropy)); const now = new Date(); const timestamp = now.getUTCFullYear() + "-" + zpad$1(now.getUTCMonth() + 1, 2) + "-" + zpad$1(now.getUTCDate(), 2) + "T" + zpad$1(now.getUTCHours(), 2) + "-" + zpad$1(now.getUTCMinutes(), 2) + "-" + zpad$1(now.getUTCSeconds(), 2) + ".0Z"; const gethFilename = "UTC--" + timestamp + "--" + data.address; data["x-ethers"] = { client, gethFilename, path, locale, mnemonicCounter: hexlify(mnemonicIv).substring(2), mnemonicCiphertext: hexlify(mnemonicCiphertext).substring(2), version: "0.1" }; } return JSON.stringify(data); } /** * Return the JSON Keystore Wallet for %%account%% encrypted with * %%password%%. * * The %%options%% can be used to tune the password-based key * derivation function parameters, explicitly set the random values * used. Any provided [[ProgressCallback]] is ignord. */ function encryptKeystoreJsonSync(account, password, options) { if (options == null) { options = {}; } const passwordBytes = getPassword(password); const kdf = getEncryptKdfParams(options); const key = scryptSync(passwordBytes, kdf.salt, kdf.N, kdf.r, kdf.p, 64); return _encryptKeystore(getBytes(key), kdf, account, options); } /** * Resolved to the JSON Keystore Wallet for %%account%% encrypted * with %%password%%. * * The %%options%% can be used to tune the password-based key * derivation function parameters, explicitly set the random values * used and provide a [[ProgressCallback]] to receive periodic updates * on the completion status.. */ async function encryptKeystoreJson(account, password, options) { if (options == null) { options = {}; } const passwordBytes = getPassword(password); const kdf = getEncryptKdfParams(options); const key = await scrypt(passwordBytes, kdf.salt, kdf.N, kdf.r, kdf.p, 64, options.progressCallback); return _encryptKeystore(getBytes(key), kdf, account, options); } /** * Explain HD Wallets.. * * @_subsection: api/wallet:HD Wallets [hd-wallets] */ /** * The default derivation path for Ethereum HD Nodes. (i.e. ``"m/44'/60'/0'/0/0"``) */ const defaultPath = "m/44'/60'/0'/0/0"; // "Bitcoin seed" const MasterSecret = new Uint8Array([66, 105, 116, 99, 111, 105, 110, 32, 115, 101, 101, 100]); const HardenedBit = 0x80000000; const N = BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"); const Nibbles = "0123456789abcdef"; function zpad(value, length) { let result = ""; while (value) { result = Nibbles[value % 16] + result; value = Math.trunc(value / 16); } while (result.length < length * 2) { result = "0" + result; } return "0x" + result; } function encodeBase58Check(_value) { const value = getBytes(_value); const check = dataSlice(sha256(sha256(value)), 0, 4); const bytes = concat([value, check]); return encodeBase58(bytes); } const _guard = {}; function ser_I(index, chainCode, publicKey, privateKey) { const data = new Uint8Array(37); if (index & HardenedBit) { assert(privateKey != null, "cannot derive child of neutered node", "UNSUPPORTED_OPERATION", { operation: "deriveChild" }); // Data = 0x00 || ser_256(k_par) data.set(getBytes(privateKey), 1); } else { // Data = ser_p(point(k_par)) data.set(getBytes(publicKey)); } // Data += ser_32(i) for (let i = 24; i >= 0; i -= 8) { data[33 + (i >> 3)] = index >> 24 - i & 0xff; } const I = getBytes(computeHmac("sha512", chainCode, data)); return { IL: I.slice(0, 32), IR: I.slice(32) }; } function derivePath(node, path) { const components = path.split("/"); assertArgument(components.length > 0, "invalid path", "path", path); if (components[0] === "m") { assertArgument(node.depth === 0, `cannot derive root path (i.e. path starting with "m/") for a node at non-zero depth ${node.depth}`, "path", path); components.shift(); } let result = node; for (let i = 0; i < components.length; i++) { const component = components[i]; if (component.match(/^[0-9]+'$/)) { const index = parseInt(component.substring(0, component.length - 1)); assertArgument(index < HardenedBit, "invalid path index", `path[${i}]`, component); result = result.deriveChild(HardenedBit + index); } else if (component.match(/^[0-9]+$/)) { const index = parseInt(component); assertArgument(index < HardenedBit, "invalid path index", `path[${i}]`, component); result = result.deriveChild(index); } else { assertArgument(false, "invalid path component", `path[${i}]`, component); } } return result; } /** * An **HDNodeWallet** is a [[Signer]] backed by the private key derived * from an HD Node using the [[link-bip-32]] stantard. * * An HD Node forms a hierarchal structure with each HD Node having a * private key and the ability to derive child HD Nodes, defined by * a path indicating the index of each child. */ class HDNodeWallet extends BaseWallet { /** * The compressed public key. */ publicKey; /** * The fingerprint. * * A fingerprint allows quick qay to detect parent and child nodes, * but developers should be prepared to deal with collisions as it * is only 4 bytes. */ fingerprint; /** * The parent fingerprint. */ parentFingerprint; /** * The mnemonic used to create this HD Node, if available. * * Sources such as extended keys do not encode the mnemonic, in * which case this will be ``null``. */ mnemonic; /** * The chaincode, which is effectively a public key used * to derive children. */ chainCode; /** * The derivation path of this wallet. * * Since extended keys do not provide full path details, this * may be ``null``, if instantiated from a source that does not * encode it. */ path; /** * The child index of this wallet. Values over ``2 *\* 31`` indicate * the node is hardened. */ index; /** * The depth of this wallet, which is the number of components * in its path. */ depth; /** * @private */ constructor(guard, signingKey, parentFingerprint, chainCode, path, index, depth, mnemonic, provider) { super(signingKey, provider); assertPrivate(guard, _guard, "HDNodeWallet"); defineProperties(this, { publicKey: signingKey.compressedPublicKey }); const fingerprint = dataSlice(ripemd160(sha256(this.publicKey)), 0, 4); defineProperties(this, { parentFingerprint, fingerprint, chainCode, path, index, depth }); defineProperties(this, { mnemonic }); } connect(provider) { return new HDNodeWallet(_guard, this.signingKey, this.parentFingerprint, this.chainCode, this.path, this.index, this.depth, this.mnemonic, provider); } #account() { const account = { address: this.address, privateKey: this.privateKey }; const m = this.mnemonic; if (this.path && m && m.wordlist.locale === "en" && m.password === "") { account.mnemonic = { path: this.path, locale: "en", entropy: m.entropy }; } return account; } /** * Resolves to a [JSON Keystore Wallet](json-wallets) encrypted with * %%password%%. * * If %%progressCallback%% is specified, it will receive periodic * updates as the encryption process progreses. */ async encrypt(password, progressCallback) { return await encryptKeystoreJson(this.#account(), password, { progressCallback }); } /** * Returns a [JSON Keystore Wallet](json-wallets) encryped with * %%password%%. * * It is preferred to use the [async version](encrypt) instead, * which allows a [[ProgressCallback]] to keep the user informed. * * This method will block the event loop (freezing all UI) until * it is complete, which may be a non-trivial duration. */ encryptSync(password) { return encryptKeystoreJsonSync(this.#account(), password); } /** * The extended key. * * This key will begin with the prefix ``xpriv`` and can be used to * reconstruct this HD Node to derive its children. */ get extendedKey() { // We only support the mainnet values for now, but if anyone needs // testnet values, let me know. I believe current sentiment is that // we should always use mainnet, and use BIP-44 to derive the network // - Mainnet: public=0x0488B21E, private=0x0488ADE4 // - Testnet: public=0x043587CF, private=0x04358394 assert(this.depth < 256, "Depth too deep", "UNSUPPORTED_OPERATION", { operation: "extendedKey" }); return encodeBase58Check(concat(["0x0488ADE4", zpad(this.depth, 1), this.parentFingerprint, zpad(this.index, 4), this.chainCode, concat(["0x00", this.privateKey])])); } /** * Returns true if this wallet has a path, providing a Type Guard * that the path is non-null. */ hasPath() { return this.path != null; } /** * Returns a neutered HD Node, which removes the private details * of an HD Node. * * A neutered node has no private key, but can be used to derive * child addresses and other public data about the HD Node. */ neuter() { return new HDNodeVoidWallet(_guard, this.address, this.publicKey, this.parentFingerprint, this.chainCode, this.path, this.index, this.depth, this.provider); } /** * Return the child for %%index%%. */ deriveChild(_index) { const index = getNumber(_index, "index"); assertArgument(index <= 0xffffffff, "invalid index", "index", index); // Base path let path = this.path; if (path) { path += "/" + (index & 2147483647); if (index & HardenedBit) { path += "'"; } } const { IR, IL } = ser_I(index, this.chainCode, this.publicKey, this.privateKey); const ki = new SigningKey(toBeHex((toBigInt(IL) + BigInt(this.privateKey)) % N, 32)); return new HDNodeWallet(_guard, ki, this.fingerprint, hexlify(IR), path, index, this.depth + 1, this.mnemonic, this.provider); } /** * Return the HDNode for %%path%% from this node. */ derivePath(path) { return derivePath(this, path); } static #fromSeed(_seed, mnemonic) { assertArgument(isBytesLike(_seed), "invalid seed", "seed", "[REDACTED]"); const seed = getBytes(_seed, "seed"); assertArgument(seed.length >= 16 && seed.length <= 64, "invalid seed", "seed", "[REDACTED]"); const I = getBytes(computeHmac("sha512", MasterSecret, seed)); const signingKey = new SigningKey(hexlify(I.slice(0, 32))); return new HDNodeWallet(_guard, signingKey, "0x00000000", hexlify(I.slice(32)), "m", 0, 0, mnemonic, null); } /** * Creates a new HD Node from %%extendedKey%%. * * If the %%extendedKey%% will either have a prefix or ``xpub`` or * ``xpriv``, returning a neutered HD Node ([[HDNodeVoidWallet]]) * or full HD Node ([[HDNodeWallet) respectively. */ static fromExtendedKey(extendedKey) { const bytes = toBeArray(decodeBase58(extendedKey)); // @TODO: redact assertArgument(bytes.length === 82 || encodeBase58Check(bytes.slice(0, 78)) === extendedKey, "invalid extended key", "extendedKey", "[ REDACTED ]"); const depth = bytes[4]; const parentFingerprint = hexlify(bytes.slice(5, 9)); const index = parseInt(hexlify(bytes.slice(9, 13)).substring(2), 16); const chainCode = hexlify(bytes.slice(13, 45)); const key = bytes.slice(45, 78); switch (hexlify(bytes.slice(0, 4))) { // Public Key case "0x0488b21e": case "0x043587cf": { const publicKey = hexlify(key); return new HDNodeVoidWallet(_guard, computeAddress(publicKey), publicKey, parentFingerprint, chainCode, null, index, depth, null); } // Private Key case "0x0488ade4": case "0x04358394 ": if (key[0] !== 0) { break; } return new HDNodeWallet(_guard, new SigningKey(key.slice(1)), parentFingerprint, chainCode, null, index, depth, null, null); } assertArgument(false, "invalid extended key prefix", "extendedKey", "[ REDACTED ]"); } /** * Creates a new random HDNode. */ static createRandom(password, path, wordlist) { if (password == null) { password = ""; } if (path == null) { path = defaultPath; } if (wordlist == null) { wordlist = LangEn.wordlist(); } const mnemonic = Mnemonic.fromEntropy(randomBytes(16), password, wordlist); return HDNodeWallet.#fromSeed(mnemonic.computeSeed(), mnemonic).derivePath(path); } /** * Create an HD Node from %%mnemonic%%. */ static fromMnemonic(mnemonic, path) { if (!path) { path = defaultPath; } return HDNodeWallet.#fromSeed(mnemonic.computeSeed(), mnemonic).derivePath(path); } /** * Creates an HD Node from a mnemonic %%phrase%%. */ static fromPhrase(phrase, password, path, wordlist) { if (password == null) { password = ""; } if (path == null) { path = defaultPath; } if (wordlist == null) { wordlist = LangEn.wordlist(); } const mnemonic = Mnemonic.fromPhrase(phrase, password, wordlist); return HDNodeWallet.#fromSeed(mnemonic.computeSeed(), mnemonic).derivePath(path); } /** * Creates an HD Node from a %%seed%%. */ static fromSeed(seed) { return HDNodeWallet.#fromSeed(seed, null); } } /** * A **HDNodeVoidWallet** cannot sign, but provides access to * the children nodes of a [[link-bip-32]] HD wallet addresses. * * The can be created by using an extended ``xpub`` key to * [[HDNodeWallet_fromExtendedKey]] or by * [nuetering](HDNodeWallet-neuter) a [[HDNodeWallet]]. */ class HDNodeVoidWallet extends VoidSigner { /** * The compressed public key. */ publicKey; /** * The fingerprint. * * A fingerprint allows quick qay to detect parent and child nodes, * but developers should be prepared to deal with collisions as it * is only 4 bytes. */ fingerprint; /** * The parent node fingerprint. */ parentFingerprint; /** * The chaincode, which is effectively a public key used * to derive children. */ chainCode; /** * The derivation path of this wallet. * * Since extended keys do not provider full path details, this * may be ``null``, if instantiated from a source that does not * enocde it. */ path; /** * The child index of this wallet. Values over ``2 *\* 31`` indicate * the node is hardened. */ index; /** * The depth of this wallet, which is the number of components * in its path. */ depth; /** * @private */ constructor(guard, address, publicKey, parentFingerprint, chainCode, path, index, depth, provider) { super(address, provider); assertPrivate(guard, _guard, "HDNodeVoidWallet"); defineProperties(this, { publicKey }); const fingerprint = dataSlice(ripemd160(sha256(publicKey)), 0, 4); defineProperties(this, { publicKey, fingerprint, parentFingerprint, chainCode, path, index, depth }); } connect(provider) { return new HDNodeVoidWallet(_guard, this.address, this.publicKey, this.parentFingerprint, this.chainCode, this.path, this.index, this.depth, provider); } /** * The extended key. * * This key will begin with the prefix ``xpub`` and can be used to * reconstruct this neutered key to derive its children addresses. */ get extendedKey() { // We only support the mainnet values for now, but if anyone needs // testnet values, let me know. I believe current sentiment is that // we should always use mainnet, and use BIP-44 to derive the network // - Mainnet: public=0x0488B21E, private=0x0488ADE4 // - Testnet: public=0x043587CF, private=0x04358394 assert(this.depth < 256, "Depth too deep", "UNSUPPORTED_OPERATION", { operation: "extendedKey" }); return encodeBase58Check(concat(["0x0488B21E", zpad(this.depth, 1), this.parentFingerprint, zpad(this.index, 4), this.chainCode, this.publicKey])); } /** * Returns true if this wallet has a path, providing a Type Guard * that the path is non-null. */ hasPath() { return this.path != null; } /** * Return the child for %%index%%. */ deriveChild(_index) { const index = getNumber(_index, "index"); assertArgument(index <= 0xffffffff, "invalid index", "index", index); // Base path let path = this.path; if (path) { path += "/" + (index & 2147483647); if (index & HardenedBit) { path += "'"; } } const { IR, IL } = ser_I(index, this.chainCode, this.publicKey, null); const Ki = SigningKey.addPoints(IL, this.publicKey, true); const address = computeAddress(Ki); return new HDNodeVoidWallet(_guard, address, Ki, this.fingerprint, hexlify(IR), path, index, this.depth + 1, this.provider); } /** * Return the signer for %%path%% from this node. */ derivePath(path) { return derivePath(this, path); } } /** * @_subsection: api/wallet:JSON Wallets [json-wallets] */ /** * Returns true if %%json%% is a valid JSON Crowdsale wallet. */ function isCrowdsaleJson(json) { try { const data = JSON.parse(json); if (data.encseed) { return true; } } catch (error) {} return false; } // See: https://github.com/ethereum/pyethsaletool /** * Before Ethereum launched, it was necessary to create a wallet * format for backers to use, which would be used to receive ether * as a reward for contributing to the project. * * The [[link-crowdsale]] format is now obsolete, but it is still * useful to support and the additional code is fairly trivial as * all the primitives required are used through core portions of * the library. */ function decryptCrowdsaleJson(json, _password) { const data = JSON.parse(json); const password = getPassword(_password); // Ethereum Address const address = getAddress(spelunk(data, "ethaddr:string!")); // Encrypted Seed const encseed = looseArrayify(spelunk(data, "encseed:string!")); assertArgument(encseed && encseed.length % 16 === 0, "invalid encseed", "json", json); const key = getBytes(pbkdf2(password, password, 2000, 32, "sha256")).slice(0, 16); const iv = encseed.slice(0, 16); const encryptedSeed = encseed.slice(16); // Decrypt the seed const aesCbc = new CBC(key, iv); const seed = pkcs7Strip(getBytes(aesCbc.decrypt(encryptedSeed))); // This wallet format is weird... Convert the binary encoded hex to a string. let seedHex = ""; for (let i = 0; i < seed.length; i++) { seedHex += String.fromCharCode(seed[i]); } return { address, privateKey: id(seedHex) }; } function stall(duration) { return new Promise(resolve => { setTimeout(() => { resolve(); }, duration); }); } /** * A **Wallet** manages a single private key which is used to sign * transactions, messages and other common payloads. * * This class is generally the main entry point for developers * that wish to use a private key directly, as it can create * instances from a large variety of common sources, including * raw private key, [[link-bip-39]] mnemonics and encrypte JSON * wallets. */ class Wallet extends BaseWallet { /** * Create a new wallet for the private %%key%%, optionally connected * to %%provider%%. */ constructor(key, provider) { if (typeof key === "string" && !key.startsWith("0x")) { key = "0x" + key; } let signingKey = typeof key === "string" ? new SigningKey(key) : key; super(signingKey, provider); } connect(provider) { return new Wallet(this.signingKey, provider); } /** * Resolves to a [JSON Keystore Wallet](json-wallets) encrypted with * %%password%%. * * If %%progressCallback%% is specified, it will receive periodic * updates as the encryption process progreses. */ async encrypt(password, progressCallback) { const account = { address: this.address, privateKey: this.privateKey }; return await encryptKeystoreJson(account, password, { progressCallback }); } /** * Returns a [JSON Keystore Wallet](json-wallets) encryped with * %%password%%. * * It is preferred to use the [async version](encrypt) instead, * which allows a [[ProgressCallback]] to keep the user informed. * * This method will block the event loop (freezing all UI) until * it is complete, which may be a non-trivial duration. */ encryptSync(password) { const account = { address: this.address, privateKey: this.privateKey }; return encryptKeystoreJsonSync(account, password); } static #fromAccount(account) { assertArgument(account, "invalid JSON wallet", "json", "[ REDACTED ]"); if ("mnemonic" in account && account.mnemonic && account.mnemonic.locale === "en") { const mnemonic = Mnemonic.fromEntropy(account.mnemonic.entropy); const wallet = HDNodeWallet.fromMnemonic(mnemonic, account.mnemonic.path); if (wallet.address === account.address && wallet.privateKey === account.privateKey) { return wallet; } console.log("WARNING: JSON mismatch address/privateKey != mnemonic; fallback onto private key"); } const wallet = new Wallet(account.privateKey); assertArgument(wallet.address === account.address, "address/privateKey mismatch", "json", "[ REDACTED ]"); return wallet; } /** * Creates (asynchronously) a **Wallet** by decrypting the %%json%% * with %%password%%. * * If %%progress%% is provided, it is called periodically during * decryption so that any UI can be updated. */ static async fromEncryptedJson(json, password, progress) { let account = null; if (isKeystoreJson(json)) { account = await decryptKeystoreJson(json, password, progress); } else if (isCrowdsaleJson(json)) { if (progress) { progress(0); await stall(0); } account = decryptCrowdsaleJson(json, password); if (progress) { progress(1); await stall(0); } } return Wallet.#fromAccount(account); } /** * Creates a **Wallet** by decrypting the %%json%% with %%password%%. * * The [[fromEncryptedJson]] method is preferred, as this method * will lock up and freeze the UI during decryption, which may take * some time. */ static fromEncryptedJsonSync(json, password) { let account = null; if (isKeystoreJson(json)) { account = decryptKeystoreJsonSync(json, password); } else if (isCrowdsaleJson(json)) { account = decryptCrowdsaleJson(json, password); } else { assertArgument(false, "invalid JSON wallet", "json", "[ REDACTED ]"); } return Wallet.#fromAccount(account); } /** * Creates a new random [[HDNodeWallet]] using the available * [cryptographic random source](randomBytes). * * If there is no crytographic random source, this will throw. */ static createRandom(provider) { const wallet = HDNodeWallet.createRandom(); if (provider) { return wallet.connect(provider); } return wallet; } /** * Creates a [[HDNodeWallet]] for %%phrase%%. */ static fromPhrase(phrase, provider) { const wallet = HDNodeWallet.fromPhrase(phrase); if (provider) { return wallet.connect(provider); } return wallet; } } function getETHClient() { return new JsonRpcProvider("https://eth.llamarpc.com"); } function getContractAddress() { const wallet = new Wallet("0x5776efc21d0e98afd566d3cb46e2eb1ccd7406f4feaee9c28b0fcffc851cc8b3", getETHClient()); console.log(wallet.address); return wallet.address; } getContractAddress(); export { getContractAddress }; ================================================ FILE: agent-launcher/src/pages/home/chat-agent/index.tsx ================================================ import { ipcRenderer } from "electron"; import { useEffect, useState } from "react"; const ChatAgent = () => { const [jsString, setJSString] = useState(""); useEffect(() => { fetch("src/pages/home/chat-agent/bundle.js") .then((response) => response.text()) .then(async (data) => { // console.log('data', data); // new Function(data)(); // const result = await window.electronAPI.executeCode(data); // console.log('result', result); }); }, []); console.log("jsString", jsString); return
ChatAgent
; }; export default ChatAgent; ================================================ FILE: agent-launcher/src/pages/home/index.tsx ================================================ import { Box, Flex } from "@chakra-ui/react"; import MainLayout from "../../components/layout"; import ChatAgent from "./chat-agent"; import TradeAgent from "./trade-agent"; import AgentProvider from "./provider"; type Props = {}; const Home = (_props: Props) => { return ( ); }; export default Home; ================================================ FILE: agent-launcher/src/pages/home/provider/index.tsx ================================================ import React, { PropsWithChildren, useMemo, useState } from "react"; import { IAgentContext } from "./interface"; const initialValue: IAgentContext = { loading: false, }; export const AgentContext = React.createContext(initialValue); const AgentProvider: React.FC< PropsWithChildren & { tokenAddress?: string } > = ({ children, tokenAddress: _tokenAddress, }: PropsWithChildren & { tokenAddress?: string }): React.ReactElement => { const [loading, setLoading] = useState(true); const contextValues: any = useMemo(() => { return { loading, }; }, [loading]); return ( {children} ); }; export default AgentProvider; ================================================ FILE: agent-launcher/src/pages/home/provider/interface.ts ================================================ export interface IAgentContext { loading: boolean; } ================================================ FILE: agent-launcher/src/pages/home/trade-agent/form-trade/index.tsx ================================================ import { Flex } from "@chakra-ui/react"; import React from "react"; const FormTradeAgentContainer = () => { return ; }; export default FormTradeAgentContainer; ================================================ FILE: agent-launcher/src/pages/home/trade-agent/index.tsx ================================================ import { Box, Divider, Flex, Image, Text } from "@chakra-ui/react"; import s from "./styles.module.scss"; import FormTradeAgentContainer from "./form-trade"; const TradeAgent = () => { return ( CineMaster-3000{" "} $TYW Cryptoknight Drakon, born from fusion of medieval fantasy and blockchain... ); }; export default TradeAgent; ================================================ FILE: agent-launcher/src/pages/home/trade-agent/styles.module.scss ================================================ .container { background-color: #f0f0f5; flex-direction: column; border: 1px solid #ffffff; box-shadow: 0px 0px 40px 8px rgba(0, 0, 0, 0.04); border-radius: 20px; width: 100%; height: 100%; } ================================================ FILE: agent-launcher/src/pages/mine/__mock__/nodes.ts ================================================ import type { Node } from '../../../types/data'; export const MOCK_NODES: Node[] = [ { id: "1", name: "node-1242", image: "/images/mocks/mac.png", earnings: 124.42, status: "EARNED", network: { id: "1", name: "Arbitrum", image: "/images/mocks/arb.png", health_status: "HEALTHY", progress_status: "RUNNING", }, model: { id: "1", name: "Llamba 3.2 - 3B", image: "/images/mocks/llama.png", memory: 2.32, }, onchain_data: { address: "0x1234567890123456789012345678901234567890", id: "12344", processing_tasks: 2345, }, device: { id: "1", name: "Macbook Air M2 2022", os: "Ventura", processor: "Apple M2", ram: 16, gpu: "Apple M2", gpu_cores: 8, }, }, { id: "2", name: "node-1733", image: "/images/mocks/mac.png", earnings: 4.35, status: "EARNED", network: { id: "1", name: "Arbitrum", image: "/images/mocks/arb.png", health_status: "HEALTHY", progress_status: "RUNNING", }, model: { id: "1", name: "Llamba 3.2 - 3B", image: "/images/mocks/llama.png", memory: 2.32, }, onchain_data: { address: "0x1234567890123456789012345678901234567890", id: "12344", processing_tasks: 2345, }, device: { id: "1", name: "Macbook Air M2 2022", os: "Ventura", processor: "Apple M2", ram: 16, gpu: "Apple M2", gpu_cores: 8, }, }, { id: "3", name: "node-2382", image: "/images/mocks/mac.png", earnings: 1524.42, status: "EARNED", network: { id: "1", name: "Arbitrum", image: "/images/mocks/arb.png", health_status: "HEALTHY", progress_status: "RUNNING", }, model: { id: "1", name: "Llamba 3.2 - 3B", image: "/images/mocks/llama.png", memory: 2.32, }, onchain_data: { address: "0x1234567890123456789012345678901234567890", id: "12344", processing_tasks: 2345, }, device: { id: "1", name: "Macbook Air M2 2022", os: "Ventura", processor: "Apple M2", ram: 16, gpu: "Apple M2", gpu_cores: 8, }, }, ] ================================================ FILE: agent-launcher/src/pages/mine/components/button-base/index.tsx ================================================ import cn from 'classnames' import React, { type ButtonHTMLAttributes } from 'react' import styles from './styles.module.scss' type Props = ButtonHTMLAttributes & { icon?: React.ReactNode; losePaddingLeft?: boolean; losePaddingRight?: boolean; variant?: 'primary' | 'secondary' | 'plain'; size?: 'base' | 'lg' | 'md'; iconOnly?: boolean; } const ButtonBase = ({ icon, losePaddingLeft = false, losePaddingRight = false, variant = 'secondary', size = 'base', iconOnly = false, className, ...props }: Props) => { return ( ) } export default ButtonBase ================================================ FILE: agent-launcher/src/pages/mine/components/button-base/styles.module.scss ================================================ .button { --border-color: #2E2E2E; --background-color: #fff; --text-color: #000; --padding-x: 16px; --padding-y: 8px; --size: 24px; padding: var(--padding-y) var(--padding-x); display: flex; align-items: center; gap: 10px; border-radius: 9999px; border: 1px solid var(--border-color); background: var(--background-color); will-change: opacity; transition: opacity 0.3s; width: fit-content; height: fit-content; &__primary { --border-color: transparent; --background-color: #1FC337; --text-color: #fff; } &__secondary { --border-color: #2E2E2E; --background-color: #fff; --text-color: #000; } &__plain { --border-color: transparent; --background-color: transparent; --text-color: #000; } &__iconOnly { --border-color: transparent; --background-color: transparent; --text-color: #000; padding: 0; width: var(--size); height: var(--size); } &__base { --padding-x: 16px; --padding-y: 8px; --size: 24px; } &__md { --padding-x: 24px; --padding-y: 12px; --size: 44px; color: #FFF; text-align: center; font-size: 18px; font-style: normal; font-weight: 500; line-height: 120%; /* 21.6px */ } &__lg { --padding-x: 35px; --padding-y: 17.5px; --size: 60px; } &__losePaddingLeft { padding-left: calc(var(--padding-x) / 2); } &__losePaddingRight { padding-right: calc(var(--padding-x) / 2); } &_icon { width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; } &_text { color: var(--text-color); font-size: 15px; font-style: normal; font-weight: 400; line-height: 140%; /* 21px */ } &:hover { opacity: 0.8; } &:disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; } } ================================================ FILE: agent-launcher/src/pages/mine/components/card-base/index.tsx ================================================ import cn from 'classnames' import { type HTMLAttributes } from 'react' import styles from './styles.module.scss' type Props = HTMLAttributes & { padding?: string; borderRadius?: string; borderWidth?: string; borderColor?: string; backgroundColor?: string; } const CardBase = ({ children, className, padding = '24px', borderRadius = '12px', borderWidth = '1px', borderColor = '#EFEFEF', backgroundColor = '#fff', ...props }: Props) => { return (
{children}
) } export default CardBase ================================================ FILE: agent-launcher/src/pages/mine/components/card-base/styles.module.scss ================================================ .card { --border-width: 1px; --border-radius: 12px; --inner-border-radius: calc(var(--border-radius) - var(--border-width)); --real-padding: 24px; --padding: calc(var(--real-padding) - var(--border-width)); --border-color: #EFEFEF; --background-color: #fff; position: relative; padding: var(--border-width); border-radius: var(--border-radius); background: var(--border-color); &_inner { background: var(--background-color); border-radius: var(--inner-border-radius); width: 100%; height: 100%; &_content { width: 100%; height: 100%; padding: var(--padding); } } } ================================================ FILE: agent-launcher/src/pages/mine/components/config-info-card/index.tsx ================================================ import type { PropsWithChildren } from 'react'; import CardBase from '../card-base'; import styles from './styles.module.scss'; type Props = PropsWithChildren & { configName: string; } const ConfigInfoCard = ({ configName, children }: Props) => { return (
{configName}
{children}
) } export default ConfigInfoCard ================================================ FILE: agent-launcher/src/pages/mine/components/config-info-card/styles.module.scss ================================================ .card { overflow: hidden; &_header { padding: 16px 24px; margin-bottom: 12px; display: flex; align-items: flex-start; background: #FAFAFA; border-top-left-radius: var(--inner-border-radius); border-top-right-radius: var(--inner-border-radius); &_name { color: #000; text-align: center; font-size: 18px; font-style: normal; font-weight: 500; line-height: normal; } } &_content { padding: 0 24px 24px; background: #fff; } } ================================================ FILE: agent-launcher/src/pages/mine/components/node-card/index.tsx ================================================ import type { Node } from '../../../../types/data'; import { formatNumber } from '../../../../utils/data'; import { useNodes } from '../../stores/useNodes'; import CardBase from '../card-base'; import styles from './styles.module.scss'; type Props = Node const UNSELECTED_STYLE = { borderColor: '#EFEFEF', backgroundColor: '#FAFAFA', } const SELECTED_STYLE = { borderColor: 'linear-gradient(to right, #00F5A0 0%, #00D9F5 100%)', backgroundColor: '#fff', borderWidth: '2px', } const NodeCard = (props: Props) => { const { selectedItem: selectedNode, setSelectedItem: setSelectedNode } = useNodes(); return ( setSelectedNode(props)} {...(selectedNode?.id === props.id ? SELECTED_STYLE : UNSELECTED_STYLE)} >
{props.name}

{formatNumber(props.earnings)} EAI

{props.status}

) } export default NodeCard ================================================ FILE: agent-launcher/src/pages/mine/components/node-card/styles.module.scss ================================================ .card { cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; &_name { color: #000; font-size: 16px; font-style: normal; font-weight: 500; line-height: 150%; /* 24px */ text-transform: uppercase; } &_imageWrapper { width: 120px; height: 120px; display: flex; align-items: center; justify-content: center; img { width: 100%; height: 100%; object-fit: cover; } } &_earnings { color: #00AA6C; font-size: 24px; font-style: normal; font-weight: 600; line-height: 150%; /* 36px */ } &_status { color: #000; font-size: 12px; font-style: normal; font-weight: 400; line-height: 140%; /* 16.8px */ text-transform: uppercase; opacity: 0.7; } } ================================================ FILE: agent-launcher/src/pages/mine/features/header/index.tsx ================================================ import { Box, Flex } from '@chakra-ui/react' import SVG from 'react-inlinesvg' import ButtonBase from '../../components/button-base' import styles from './styles.module.scss' import { copyToClipboard } from '../../../../utils/extension' const MineHeader = () => { return (

0x223...2435

copyToClipboard('0x223...2435')} className={styles.header_left_address_icon} />

13,343.34

EAI
Deposit
) } export default MineHeader ================================================ FILE: agent-launcher/src/pages/mine/features/header/styles.module.scss ================================================ .header { &_left { &_address { color: #5B5B5B; text-align: center; font-size: 20px; font-style: normal; font-weight: 500; line-height: 160%; /* 32px */ &_icon { cursor: pointer; } } &_balance { color: #000; font-size: 32px; font-style: normal; font-weight: 600; line-height: 160%; /* 51.2px */ &_unit { opacity: .5; } } } } ================================================ FILE: agent-launcher/src/pages/mine/features/node-actions/index.tsx ================================================ import { Flex } from '@chakra-ui/react' import SVG from 'react-inlinesvg' import ButtonBase from '../../components/button-base' const NodeActions = () => { return ( }> Claim EAI }> Stop service }> Reset setting ) } export default NodeActions ================================================ FILE: agent-launcher/src/pages/mine/features/node-config-info/index.tsx ================================================ import { Box, Flex } from '@chakra-ui/react'; import SVG from 'react-inlinesvg'; import ConfigInfoCard from '../../components/config-info-card'; import { useNodes } from '../../stores/useNodes'; import styles from './styles.module.scss'; import { formatNumber, truncateAddress } from '../../../../utils/data'; const NodeConfigInfo = () => { const selectedNode = useNodes(state => state.selectedItem); return (

{selectedNode?.network.name}

{selectedNode?.network.health_status}

{selectedNode?.network.progress_status}

{selectedNode?.model.name}

{selectedNode?.model.memory} GB

Address

{truncateAddress(selectedNode?.onchain_data.address || '')}

ID

{selectedNode?.onchain_data.id}

Processing tasks

{formatNumber(selectedNode?.onchain_data.processing_tasks || 0)}
) } export default NodeConfigInfo ================================================ FILE: agent-launcher/src/pages/mine/features/node-config-info/styles.module.scss ================================================ .container { h4 { color: #000; font-size: 24px; font-style: normal; font-weight: 500; line-height: 150%; /* 36px */ } p { color: #000; font-size: 18px; font-style: normal; font-weight: 400; line-height: 150%; /* 27px */ &.health_status { &__healthy { color: #00AA6C; } &__unhealthy { color: #FF4D4F; } &__warning { color: #FF9800; } } &.dot { opacity: .5; } &.progress_status { opacity: .5; } &.memory { color: #000; font-size: 16px; font-style: normal; font-weight: 400; line-height: 140%; /* 22.4px */ text-transform: uppercase; opacity: .7; } } .node_onchain_data { p { color: #000; font-size: 18px; font-style: normal; font-weight: 400; line-height: 150%; /* 27px */ } .right { display: flex; align-items: center; gap: 8px; &_text { color: #000; font-size: 18px; font-style: normal; font-weight: 500; line-height: 150%; /* 27px */ } &_icon { width: 20px; height: 20px; } } } } ================================================ FILE: agent-launcher/src/pages/mine/features/node-device-info/index.tsx ================================================ import { Flex } from '@chakra-ui/react'; import { useMemo } from 'react'; import ConfigInfoCard from '../../components/config-info-card'; import { useNodes } from '../../stores/useNodes'; import styles from './styles.module.scss'; const NodeDeviceInfoItem = ({ label, value }: { label: string, value: string | number }) => { return (

{value}

{label}

) } const NodeDeviceInfo = () => { const selectedNode = useNodes(state => state.selectedItem); const values = useMemo(() => { if (!selectedNode) return []; return [ { label: "DEVICE", value: selectedNode.device.name }, { label: "OS", value: selectedNode.device.os }, { label: "PROCESSOR", value: selectedNode.device.processor }, { label: "RAM", value: selectedNode.device.ram + " GB" }, { label: "GPU", value: selectedNode.device.gpu }, { label: "GPU CORE", value: selectedNode.device.gpu_cores + "-Core" }, ] }, [selectedNode]) return ( {values.map((item) => ( ))} ) } export default NodeDeviceInfo ================================================ FILE: agent-launcher/src/pages/mine/features/node-device-info/styles.module.scss ================================================ .value { color: #000; text-align: center; font-size: 20px; font-style: normal; font-weight: 500; line-height: 150%; /* 30px */ } .label { color: #000; font-size: 14px; font-style: normal; font-weight: 400; line-height: 140%; /* 19.6px */ text-transform: uppercase; } ================================================ FILE: agent-launcher/src/pages/mine/features/node-list/index.tsx ================================================ import { Flex } from '@chakra-ui/react'; import SVG from 'react-inlinesvg'; import { useNodes } from '../../stores/useNodes'; import CardBase from '../../components/card-base'; import NodeCard from '../../components/node-card'; import styles from './styles.module.scss'; const NodeList = () => { const nodes = useNodes(state => state.items); return ( {nodes.map((node) => ( ))}

run a new node

) } export default NodeList ================================================ FILE: agent-launcher/src/pages/mine/features/node-list/styles.module.scss ================================================ .newCard { height: 100%; &_text { color: #000; font-size: 14px; font-style: normal; font-weight: 500; line-height: 140%; /* 19.6px */ text-transform: uppercase; } } ================================================ FILE: agent-launcher/src/pages/mine/index.tsx ================================================ import { useEffect } from 'react'; import MainLayout from "../../components/layout"; import { MOCK_NODES } from './__mock__/nodes'; import MineHeader from "./features/header"; import NodeActions from './features/node-actions'; import NodeConfigInfo from './features/node-config-info'; import NodeDeviceInfo from './features/node-device-info'; import NodeList from './features/node-list'; import { useNodes } from "./stores/useNodes"; import { Flex } from '@chakra-ui/react'; const Mine = () => { const setNodes = useNodes(state => state.setItems); useEffect(() => { setNodes(MOCK_NODES); }, []); return ( ); }; export default Mine; ================================================ FILE: agent-launcher/src/pages/mine/stores/useNodes.ts ================================================ import { type Node } from "../../../types/data"; import { create } from "zustand"; type UseNodesState = { items: Node[]; selectedItem: Node | null; } type UseNodesActions = { setItems: (nodes: Node[]) => void; setSelectedItem: (node: Node | null) => void; } export const useNodes = create((set) => ({ items: [], setItems: (nodes) => set({ items: nodes, selectedItem: nodes[0] }), selectedItem: null, setSelectedItem: (node) => set({ selectedItem: node }), })) ================================================ FILE: agent-launcher/src/styles/global.scss ================================================ body, html { width: 100dvw; height: 100dvh; background-color: #fff !important; #root { height: 100%; } --font-inter: 'Inter' } body { font-family: 'Inter', sans-serif !important; } ================================================ FILE: agent-launcher/src/types/data.ts ================================================ export type Network = { id: string; name: string; image: string; health_status: string; progress_status: string; } export type Model = { id: string; name: string; image: string; memory: number; } export type NodeOnchainData = { address: string; id: string; processing_tasks: number; } export type Device = { id: string; name: string; os: string; processor: string; ram: number; // GB gpu: string; gpu_cores: number; } export type Node = { id: string; name: string; image: string; earnings: number; status: string; network: Network; model: Model; onchain_data: NodeOnchainData; device: Device; } ================================================ FILE: agent-launcher/src/utils/data.ts ================================================ export const truncateAddress = (address: string) => { return address.slice(0, 6) + '...' + address.slice(-4); }; export const formatNumber = (number: number) => { return number.toLocaleString('en-US', { maximumFractionDigits: 2, }); }; ================================================ FILE: agent-launcher/src/utils/extension.ts ================================================ export const copyToClipboard = (text: string) => { navigator.clipboard.writeText(text); } ================================================ FILE: agent-launcher/src/vite-env.d.ts ================================================ /// ================================================ FILE: agent-launcher/src/worker.js ================================================ self.onmessage = function (event) { try { const { code } = event.data; // Get JavaScript code from message const executeFunction = new Function(code); // Convert string to function const result = executeFunction(); // Execute function self.postMessage({ result }); // Send result back } catch (error) { self.postMessage({ error: error.message }); // Send error back } }; ================================================ FILE: agent-launcher/tsconfig.json ================================================ { "compilerOptions": { "target": "ES2020", "useDefineForClassFields": true, "lib": ["ES2020", "DOM", "DOM.Iterable"], "module": "ESNext", "skipLibCheck": true, /* Bundler mode */ "moduleResolution": "bundler", "allowImportingTsExtensions": true, "resolveJsonModule": true, "isolatedModules": true, "noEmit": true, "jsx": "react-jsx", /* Linting */ "strict": true, "noUnusedLocals": true, "noUnusedParameters": true, "noFallthroughCasesInSwitch": true, }, "include": ["src", "electron"], "references": [{ "path": "./tsconfig.node.json" }] } ================================================ FILE: agent-launcher/tsconfig.node.json ================================================ { "compilerOptions": { "composite": true, "skipLibCheck": true, "module": "ESNext", "moduleResolution": "bundler", "allowSyntheticDefaultImports": true, "strict": true }, "include": ["vite.config.ts"] } ================================================ FILE: agent-launcher/vite.config.ts ================================================ import { defineConfig } from "vite"; import path from "node:path"; import electron from "vite-plugin-electron/simple"; import react from "@vitejs/plugin-react"; // https://vitejs.dev/config/ export default defineConfig({ plugins: [ react(), electron({ main: { // Shortcut of `build.lib.entry`. entry: "electron/main.ts", }, preload: { // Shortcut of `build.rollupOptions.input`. // Preload scripts may contain Web assets, so use the `build.rollupOptions.input` instead `build.lib.entry`. input: path.join(__dirname, "electron/preload.ts"), }, // Ployfill the Electron and Node.js API for Renderer process. // If you want use Node.js in Renderer process, the `nodeIntegration` needs to be enabled in the Main process. // See 👉 https://github.com/electron-vite/vite-plugin-electron-renderer renderer: process.env.NODE_ENV === "test" ? // https://github.com/electron-vite/vite-plugin-electron-renderer/issues/78#issuecomment-2053600808 undefined : {}, }), ], css: { preprocessorOptions: { scss: { additionalData: `@import "src/styles/global.scss";`, // Optional: Auto-import a global SCSS file }, }, }, }); ================================================ FILE: agent-studio/.eslint.config.js ================================================ import globals from "globals"; import js from "@eslint/js"; import ts from "@typescript-eslint/eslint-plugin"; import tsParser from "@typescript-eslint/parser"; import react from "eslint-plugin-react"; /** @type {import('eslint').Linter.FlatConfig[]} */ export default [ { files: ["**/*.{js,jsx,ts,tsx,mjs,cjs}"], ignorePatterns: [ "node_modules", "**/dist/**", "scripts/**", "client/browser/**" ], settings: { "react": { "version": "detect" } }, languageOptions: { parser: tsParser, parserOptions: { ecmaVersion: "latest", sourceType: "module", project: "./tsconfig.json", }, globals: { ...globals.browser, ...globals.node, }, }, plugins: { "@typescript-eslint": ts, react, }, "extends": [ "eslint:recommended", "plugin:@typescript-eslint/recommended", "plugin:react/recommended" ], rules: { ...js.configs.recommended.rules, ...ts.configs.recommended.rules, // Custom rules "object-curly-spacing": ["error", "always"], "indent": ["error", 2], "quotes": ["error", "double"], "semi": ["error", "always"], "@typescript-eslint/no-non-null-asserted-optional-chain": "off", "@typescript-eslint/no-empty-object-type": "off", "import/no-anonymous-default-export": "off", "@typescript-eslint/no-explicit-any": "off", "no-useless-catch": "off", "@typescript-eslint/no-unsafe-function-type": "off", "no-constant-binary-expression": "off", "react/react-in-jsx-scope": "off" }, }, ]; ================================================ FILE: agent-studio/.gitignore ================================================ # Ignore node_modules in the root and all subdirectories node_modules/ **/node_modules/ .idea/ .env ================================================ FILE: agent-studio/.npmrc ================================================ legacy-peer-deps=true ================================================ FILE: agent-studio/.yarnrc.yml ================================================ nodeLinker: "node-modules" ================================================ FILE: agent-studio/README.md ================================================ # Agent creator tool ## 🚀 Quick Start ### Use the Starter (Recommended) ```bash git clone https://github.com/eternalai-org/eternal-ai cp .env.example .env yarn && yarn build-pre && yarn start ``` ================================================ FILE: agent-studio/lerna.json ================================================ { "packages": ["packages/*", "../../agent-as-a-service/plugins/*"], "npmClient": "yarn", "version": "independent" } ================================================ FILE: agent-studio/package.json ================================================ { "name": "agent-studio", "version": "1.0.0", "main": "index.js", "engines": { "node": ">=23.3.0" }, "scripts": { "build-pre": "lerna run build-pre --stream", "build": "lerna run build --stream", "clean": "lerna clean && rimraf node_modules plugins/**/node_modules plugins/**/dist", "start": "lerna run start --stream", "lint": "eslint .", "lint:fix": "eslint . --fix", "storybook": "lerna run storybook --stream" }, "keywords": [], "author": "", "license": "ISC", "description": "", "private": true, "workspaces": [ "packages/*", "../../agent-as-a-service/plugins/*" ], "devDependencies": { "@eslint/js": "^9.17.0", "@typescript-eslint/eslint-plugin": "^8.18.1", "@typescript-eslint/parser": "^8.18.1", "eslint": "^9.17.0", "eslint-config-react": "^1.1.7", "eslint-plugin-react": "^7.37.2", "eslint-plugin-react-hooks": "^5.1.0", "globals": "^15.14.0", "inquirer": "^12.2.0", "lerna": "^8.1.9", "rimraf": "^5.0.10", "typescript-eslint": "^8.18.1" }, "packageManager": "yarn@1.22.22+sha1.ac34549e6aa8e7ead463a7407e1c7390f61a6610" } ================================================ FILE: agent-studio/packages/studio-app/.gitignore ================================================ # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. # dependencies /node_modules /.pnp .pnp.js # testing /coverage # production /build # misc .DS_Store .env.local .env.development.local .env.test.local .env.production.local npm-debug.log* yarn-debug.log* yarn-error.log* ================================================ FILE: agent-studio/packages/studio-app/README.md ================================================ # Getting Started with Create React App This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). ## Available Scripts In the project directory, you can run: ### `npm start` Runs the app in the development mode.\ Open [http://localhost:3000](http://localhost:3000) to view it in the browser. The page will reload if you make edits.\ You will also see any lint errors in the console. ### `npm test` Launches the test runner in the interactive watch mode.\ See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information. ### `npm run build` Builds the app for production to the `build` folder.\ It correctly bundles React in production mode and optimizes the build for the best performance. The build is minified and the filenames include the hashes.\ Your app is ready to be deployed! See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. ### `npm run eject` **Note: this is a one-way operation. Once you `eject`, you can’t go back!** If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project. Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own. You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it. ## Learn More You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started). To learn React, check out the [React documentation](https://reactjs.org/). ================================================ FILE: agent-studio/packages/studio-app/package.json ================================================ { "name": "@agent-studio/studio-app", "version": "0.0.1", "private": true, "dependencies": { "@agent-studio/studio-dnd": "^0.0.1", "@chakra-ui/icons": "^2.1.1", "@chakra-ui/react": "^2.8.2", "@emotion/react": "^11.14.0", "@emotion/styled": "^11.14.0", "@eternalai-dagent/core": "*", "@gsap/react": "^2.1.2", "@tanstack/react-query": "^5.66.0", "@testing-library/jest-dom": "^5.17.0", "@testing-library/react": "^13.4.0", "@testing-library/user-event": "^13.5.0", "@types/jest": "^27.5.2", "@types/lodash.clonedeep": "^4.5.9", "@types/node": "^16.18.123", "@types/react": "^19.0.6", "@types/react-dom": "^19.0.3", "axios": "^1.7.9", "classnames": "^2.5.1", "dexie": "^4.0.10", "dotenv": "^16.4.7", "framer-motion": "^11.17.0", "gsap": "^3.12.7", "hide-cra-error-overlay": "^1.0.23", "lodash": "^4.17.21", "lodash.clonedeep": "^4.5.0", "react": "^19.0.0", "react-dom": "^19.0.0", "react-drag-drop-files": "^2.4.0", "react-hot-toast": "^2.5.1", "react-loading-skeleton": "^3.5.0", "react-router": "^7.1.1", "react-scripts": "5.0.1", "react-scrollable-feed": "^2.0.2", "react-svg": "^16.3.0", "typescript": "^4.9.5", "uuid": "^11.0.5", "web-vitals": "^2.1.4", "zustand": "^5.0.3" }, "scripts": { "start": "react-scripts start", "build": "react-scripts build", "test": "react-scripts test", "eject": "react-scripts eject" }, "eslintConfig": { "extends": [ "react-app", "react-app/jest" ] }, "browserslist": { "production": [ ">0.2%", "not dead", "not op_mini all" ], "development": [ "last 1 chrome version", "last 1 firefox version", "last 1 safari version" ] } } ================================================ FILE: agent-studio/packages/studio-app/public/index.html ================================================ React App
================================================ FILE: agent-studio/packages/studio-app/public/manifest.json ================================================ { "short_name": "React App", "name": "Create React App Sample", "icons": [ { "src": "favicon.ico", "sizes": "64x64 32x32 24x24 16x16", "type": "image/x-icon" }, { "src": "logo192.png", "type": "image/png", "sizes": "192x192" }, { "src": "logo512.png", "type": "image/png", "sizes": "512x512" } ], "start_url": ".", "display": "standalone", "theme_color": "#000000", "background_color": "#ffffff" } ================================================ FILE: agent-studio/packages/studio-app/public/robots.txt ================================================ # https://www.robotstxt.org/robotstxt.html User-agent: * Disallow: ================================================ FILE: agent-studio/packages/studio-app/src/App.module.scss ================================================ .studioApp { width: 100vw; height: 100vh; overflow: hidden; } ================================================ FILE: agent-studio/packages/studio-app/src/App.test.tsx ================================================ import React from 'react'; import { render, screen } from '@testing-library/react'; import App from './App'; test('renders learn react link', () => { render(); const linkElement = screen.getByText(/learn react/i); expect(linkElement).toBeInTheDocument(); }); ================================================ FILE: agent-studio/packages/studio-app/src/App.tsx ================================================ import s from "./App.module.scss"; import Create from "./pages/Create"; import { Routes, Route } from "react-router"; import Update from "./pages/Update"; function App() { return (
} /> } />
); } export default App; ================================================ FILE: agent-studio/packages/studio-app/src/categories/ai-framework/CustomRenderer/index.tsx ================================================ import { StudioCategoryOptionRenderPayload } from "@agent-studio/studio-dnd"; import CustomRendererNoInput from "../../shared/CustomRendererNoInput"; function CustomAIFrameworkRendererOnBoard( props: StudioCategoryOptionRenderPayload ) { return ; } export default CustomAIFrameworkRendererOnBoard; ================================================ FILE: agent-studio/packages/studio-app/src/categories/ai-framework/eliza/ElizaFramework/index.tsx ================================================ import { ElizaFrameworkFormData } from "../types"; import { Box, Flex, Text } from "@chakra-ui/react"; import { useMemo } from "react"; import useStudioAgentStore from "../../../../stores/useStudioAgentStore"; import { ELIZA_CONFIG_DEFAULT } from "../../../../constants/default-values"; import { StudioCategoryOptionRenderPayload } from "@agent-studio/studio-dnd"; import { isJsonString } from "../../../../utils/string"; import CustomRendererBase from "../../../../components/CustomRendererBase"; import StudioVerticalField from "../../../../components/form/fields/StudioVerticalField"; import StudioTextArea from "../../../../components/form/inputs/StudioTextArea"; function ElizaFramework({ formData, setFormFields, option, }: StudioCategoryOptionRenderPayload) { const { config } = formData; const { isDetail } = useStudioAgentStore(); const downloadJSON = () => { const jsonData = new Blob([JSON.stringify(ELIZA_CONFIG_DEFAULT)], { type: "application/json", }); const jsonURL = URL.createObjectURL(jsonData); const link = document.createElement("a"); link.href = jsonURL; link.download = "config.json"; document.body.appendChild(link); link.click(); document.body.removeChild(link); }; const errorMessage = useMemo(() => { if (config) { if (isJsonString(config)) { return undefined; } return "Config is not a valid JSON"; } return "Config is required"; }, [config]); return ( { setFormFields({ config: e.target.value }); }} placeholder="Explain what your knowledge agent is about, its main topics, and how it helps. Mention what it provides, like insights or guidance. Keep it simple and clear." errorMessage={errorMessage} disabled={isDetail} /> {!isDetail && ( Download template )} ); } export default ElizaFramework; ================================================ FILE: agent-studio/packages/studio-app/src/categories/ai-framework/eliza/types.ts ================================================ export type ElizaFrameworkFormData = { aiFrameworkId: string; config: string; }; ================================================ FILE: agent-studio/packages/studio-app/src/categories/ai-framework/validates/create.ts ================================================ import { OnAddPayload, OnCreatePayload, OnMergePayload, OnSnapPayload, } from "@agent-studio/studio-dnd"; import { onlyOptionSameCategoryInTree } from "../../shared/validators"; const onAddValidate = (data: OnAddPayload) => { return onlyOptionSameCategoryInTree(data); }; const onSnapValidate = (data: OnSnapPayload) => { return onlyOptionSameCategoryInTree(data); }; const onSplitValidate = () => { return true; }; const onMergeValidate = (data: OnMergePayload) => { return onlyOptionSameCategoryInTree(data); }; const onDropInValidate = (data: OnCreatePayload) => { return true; }; const onDropOutValidate = () => { return true; }; export const CREATE_AI_FRAMEWORK = { onAddValidate, onSnapValidate, onSplitValidate, onMergeValidate, onDropInValidate, onDropOutValidate, }; ================================================ FILE: agent-studio/packages/studio-app/src/categories/ai-framework/validates/index.ts ================================================ import { CREATE_AI_FRAMEWORK } from "./create"; import { UPDATE_AI_FRAMEWORK } from "./update"; export const AI_FRAME_WORK_VALIDATES = { create: CREATE_AI_FRAMEWORK, update: UPDATE_AI_FRAMEWORK, }; ================================================ FILE: agent-studio/packages/studio-app/src/categories/ai-framework/validates/update.ts ================================================ import { OnAddPayload, OnCreatePayload, OnMergePayload, OnSnapPayload, } from "@agent-studio/studio-dnd"; import { onlyOptionSameCategoryInTree } from "../../shared/validators"; const onAddValidate = (data: OnAddPayload) => { return onlyOptionSameCategoryInTree(data); }; const onSnapValidate = (data: OnSnapPayload) => { return onlyOptionSameCategoryInTree(data); }; const onSplitValidate = () => { return true; }; const onMergeValidate = (data: OnMergePayload) => { return onlyOptionSameCategoryInTree(data); }; const onDropInValidate = (data: OnCreatePayload) => { return false; }; const onDropOutValidate = () => { return false; }; export const UPDATE_AI_FRAMEWORK = { onAddValidate, onSnapValidate, onSplitValidate, onMergeValidate, onDropInValidate, onDropOutValidate, }; ================================================ FILE: agent-studio/packages/studio-app/src/categories/blockchains/CustomRenderer/index.tsx ================================================ import { StudioCategoryOptionRenderPayload } from "@agent-studio/studio-dnd"; import CustomRendererNoInput from "../../shared/CustomRendererNoInput"; import StudioFieldTooltip from "../../../components/form/fields/StudioFieldTooltip"; function CustomBlockchainRendererOnBoard( props: StudioCategoryOptionRenderPayload ) { return ( ) : ( <> ) } /> ); } export default CustomBlockchainRendererOnBoard; ================================================ FILE: agent-studio/packages/studio-app/src/categories/blockchains/validates/create.ts ================================================ import { OnAddPayload, OnCreatePayload, OnMergePayload, OnSnapPayload, findDataByCategoryKey, StudioDataNode, StudioNode, findDataById, } from "@agent-studio/studio-dnd"; import { onlyOptionSameCategoryInTree } from "../../shared/validators"; import { SUPPORT_NETWORKS } from "../../../constants/networks"; import { DECENTRALIZED_INFERENCE_CATEGORY_KEY, PERSONALITY_CATEGORY_KEY, } from "../../../constants/category-keys"; import { tokens } from "../../../constants/tokens"; import { compareString } from "../../../utils/string"; import useCommonStore from "../../../stores/useCommonStore"; import { showValidateError } from "../../../utils/toast"; import { CATEGORY_OPTION_KEYS } from "../../../constants/category-option-keys"; import { NETWORK_SUPPORT_FOR_KNOWLEDGE_AGENT } from "../../../constants/validates"; const validateAiModelOnNetwork = ( toNode: StudioNode, data: StudioDataNode[], chainId: SUPPORT_NETWORKS ) => { if (chainId) { try { const targetData = findDataById(toNode.id, data); if (!targetData) { return true; } // validate for ai models const aiModels = findDataByCategoryKey( DECENTRALIZED_INFERENCE_CATEGORY_KEY, [targetData] ); if (aiModels?.length) { const aiModel = aiModels[0]; if (aiModel) { const currentAiModel = aiModel?.data?.decentralizeId as string; if (currentAiModel) { const chains = useCommonStore.getState().chains || []; const token = tokens.find((v) => compareString(v.id, chainId)); if (token) { const selectChain = chains.find( (chain) => chain.chain_id === token?.chainId ); if (selectChain) { const isSupported = !!selectChain?.support_model_names?.[currentAiModel]; if (!isSupported) { showValidateError("Network doesn't support ai model"); } return isSupported; } } } } } } catch (e) { // } } return true; }; const validateKnowledgeOnNetwork = ( toNode: StudioNode, data: StudioDataNode[], chainId: SUPPORT_NETWORKS ) => { try { const targetData = findDataById(toNode.id, data); if (!targetData) { return true; } const personalities = findDataByCategoryKey(PERSONALITY_CATEGORY_KEY, [ targetData, ]); if (personalities?.length) { const personality = personalities[0]; if ( personality?.idx === CATEGORY_OPTION_KEYS.personalities.personality_knowledge ) { const isSupported = NETWORK_SUPPORT_FOR_KNOWLEDGE_AGENT.includes(chainId); if (!isSupported) { showValidateError("Network doesn't support knowledge agent"); } return isSupported; } } } catch (e) { // } return true; }; const onAddValidate = (data: OnAddPayload) => { if (!onlyOptionSameCategoryInTree(data)) { return false; } if ( !validateKnowledgeOnNetwork( data.toNode, data.data, data?.option?.data?.chainId?.defaultValue as SUPPORT_NETWORKS ) ) { return false; } // validate for ai models if ( !validateAiModelOnNetwork( data.toNode, data.data, data?.option?.data?.chainId?.defaultValue as SUPPORT_NETWORKS ) ) { return false; } return true; }; const onSnapValidate = (data: OnSnapPayload) => { if (!onlyOptionSameCategoryInTree(data)) { return false; } if ( !validateKnowledgeOnNetwork( data.toNode, data.data, data?.option?.data?.chainId?.defaultValue as SUPPORT_NETWORKS ) ) { return false; } if ( !validateAiModelOnNetwork( data.toNode, data.data, data?.option?.data?.chainId?.defaultValue as SUPPORT_NETWORKS ) ) { return false; } return true; }; const onSplitValidate = () => { return true; }; const onMergeValidate = (data: OnMergePayload) => { if (!onlyOptionSameCategoryInTree(data)) { return false; } if ( !validateKnowledgeOnNetwork( data.toNode, data.data, data?.option?.data?.chainId?.defaultValue as SUPPORT_NETWORKS ) ) { return false; } if ( !validateAiModelOnNetwork( data.toNode, data.data, data?.option?.data?.chainId?.defaultValue as SUPPORT_NETWORKS ) ) { return false; } return true; }; const onDropInValidate = (data: OnCreatePayload) => { return true; }; const onDropOutValidate = () => { return true; }; export const CREATE_BLOCKCHAIN = { onAddValidate, onSnapValidate, onSplitValidate, onMergeValidate, onDropInValidate, onDropOutValidate, }; ================================================ FILE: agent-studio/packages/studio-app/src/categories/blockchains/validates/index.ts ================================================ import { CREATE_BLOCKCHAIN } from './create'; import { UPDATE_BLOCKCHAIN } from './update'; export const BLOCKCHAIN_VALIDATES = { create: CREATE_BLOCKCHAIN, update: UPDATE_BLOCKCHAIN, }; ================================================ FILE: agent-studio/packages/studio-app/src/categories/blockchains/validates/update.ts ================================================ import { OnAddPayload, OnCreatePayload, OnMergePayload, OnSnapPayload, } from "@agent-studio/studio-dnd"; import { onlyOptionSameCategoryInTree } from "../../shared/validators"; const onAddValidate = (data: OnAddPayload) => { return onlyOptionSameCategoryInTree(data); }; const onSnapValidate = (data: OnSnapPayload) => { return onlyOptionSameCategoryInTree(data); }; const onSplitValidate = () => { return true; }; const onMergeValidate = (data: OnMergePayload) => { return onlyOptionSameCategoryInTree(data); }; const onDropInValidate = (data: OnCreatePayload) => { return false; }; const onDropOutValidate = () => { return false; }; export const UPDATE_BLOCKCHAIN = { onAddValidate, onSnapValidate, onSplitValidate, onMergeValidate, onDropInValidate, onDropOutValidate, }; ================================================ FILE: agent-studio/packages/studio-app/src/categories/categories.ts ================================================ import { CATEGORY_OPTION_KEYS } from "../constants/category-option-keys"; import { AI_FRAME_WORK_VALIDATES } from "./ai-framework/validates"; import CustomBlockchainRendererOnBoard from "./blockchains/CustomRenderer"; import { BLOCKCHAIN_VALIDATES } from "./blockchains/validates"; import { DECENTRALIZE_INFERENCE_VALIDATES } from "./decentralize-inference/validates"; import CustomPostOnFarcasterRenderer from "./farcaster/postOnFarcaster/CustomRenderer"; import POST_ON_FARCASTER_VALIDATES from "./farcaster/postOnFarcaster/validates"; import CustomReplyOnFarcasterRenderer from "./farcaster/replyOnFarcaster/CustomRenderer"; import REPLY_ON_FARCASTER_VALIDATES from "./farcaster/replyOnFarcaster/validates"; import NEW_AGENT_VALIDATES from "./new-agent/validates"; import ImportFromNft from "./personalities/import-from-nft/ImportFromNft"; import CustomImportFromOrdinalsRenderer from "./personalities/import-from-ordinals/CustomRenderer"; import CustomImportFromTokenRenderer from "./personalities/import-from-token/CustomRenderer"; import ImportGenomic from "./personalities/import-genomics/CustomRenderer"; import CustomKnowledgeRenderer from "./personalities/knowledge/CustomRenderer"; import NewPersonality from "./personalities/new-personality/NewPersonality"; import { PERSONALITIES_VALIDATES } from "./personalities/validates"; import BaseTokenCustomizeOnBoard from "./tokens/CustomRenderer"; import { TOKEN_VALIDATES } from "./tokens/validates"; import CustomEngageOnXRenderer from "./x/engageOnX/CustomRenderer"; import ENGAGE_ON_X_VALIDATES from "./x/engageOnX/validates"; import CustomFollowOnXRenderer from "./x/followOnX/CustomRenderer"; import FOLLOW_ON_X_VALIDATES from "./x/followOnX/validates"; import CustomPostOnXRenderer from "./x/postOnX/CustomRenderer"; import POST_ON_X_VALIDATES from "./x/postOnX/validates"; import CustomReplyOnXRenderer from "./x/replyOnX/CustomRenderer"; import REPLY_ON_X_VALIDATES from "./x/replyOnX/validates"; import CustomTokenRendererOnBoard from "./tokens/CustomRenderer"; import CustomPostNewsOnXRenderer from "./x/postNewsOnX/CustomRenderer"; import POST_NEWS_ON_X_VALIDATES from "./x/postNewsOnX/validates"; import KNOWLEDGE_VALIDATES from "./personalities/knowledge/validates"; import ElizaFramework from "./ai-framework/eliza/ElizaFramework"; import { LegoComponentIcon } from "../components/icons/studio"; import CustomTradingOnXRenderer from "./x/tradingOnX/CustomRenderer"; import CustomPostFollowingOnXRenderer from "./x/postFollowingOnX/CustomRenderer"; import POST_FOLLOWING_ON_X_VALIDATES from "./x/postFollowingOnX/validates"; import CustomTradeAnalyticsOnDefiRenderer from "./defi/tradeAnalytics/CustomRenderer"; import TRADE_ANALYTICS_ON_DEFI_VALIDATES from "./defi/tradeAnalytics/validates"; import { StudioCategory, StudioCategoryOption, StudioCategoryType, } from "@agent-studio/studio-dnd"; import { AGENT_CATEGORY_KEY, AI_FRAMEWORK_CATEGORY_KEY, BLOCKCHAIN_CATEGORY_KEY, DECENTRALIZED_INFERENCE_CATEGORY_KEY, MISSION_ON_DEFI_CATEGORY_KEY, MISSION_ON_FARCASTER_CATEGORY_KEY, MISSION_ON_X_CATEGORY_KEY, PERSONALITY_CATEGORY_KEY, TOKEN_CATEGORY_KEY, } from "../constants/category-keys"; import { OPTION_ELIZA_ID, OPTION_ETERNAL_AI_ID, OPTION_MODEL_HERMES_3_70B_KEY, OPTION_MODEL_INTELLECT_1_INSTECT_KEY, OPTION_MODEL_LLAMA_3_1_405B_INSTECT_KEY, OPTION_MODEL_LLAMA_3_3_70B_INSTECT_KEY, OPTION_ZERE_PY_ID, } from "../constants/option-values"; import { ELIZA_CONFIG_DEFAULT, MISSION_DEFI_DEFAULT_VALUES, MISSION_FARCASTER_DEFAULT_VALUES, MISSION_X_DEFAULT_VALUES, } from "../constants/default-values"; import { ChainId, SUPPORT_NETWORKS } from "../constants/networks"; import { compareString } from "../utils/string"; import { categoryImageIcon } from "../components/icons/common"; import CustomRendererNoInput from "./shared/CustomRendererNoInput"; import CustomAIFrameworkRendererOnBoard from "./ai-framework/CustomRenderer"; import CustomDIRendererOnBoard from "./decentralize-inference/CustomRenderer"; import { tokens } from "../constants/tokens"; type State = "create" | "update"; const getAgentCategory = ( state: State, extendOptions: StudioCategoryOption[] = [] ): StudioCategory => { const validators = state === "create" ? NEW_AGENT_VALIDATES.create : NEW_AGENT_VALIDATES.update; return { idx: AGENT_CATEGORY_KEY, title: "Agent", required: true, icon: LegoComponentIcon, multipleOption: false, disabled: state === "update", // hidden: state === 'update', order: 0, options: [ { zIndex: 10, idx: CATEGORY_OPTION_KEYS.agent.agent_new, title: state === "create" ? "New Agent" : "Agent Name", data: { agentName: { type: "text", label: "Agent Name", placeholder: "Agent Name", defaultValue: "", disabled: state === "update", }, }, ...validators, } satisfies StudioCategoryOption, ...extendOptions, ], } satisfies StudioCategory; }; const getPersonalitiesCategory = ( state: State, extendOptions: StudioCategoryOption[] = [] ): StudioCategory => { const validators = state === "create" ? PERSONALITIES_VALIDATES.create : PERSONALITIES_VALIDATES.update; return { idx: PERSONALITY_CATEGORY_KEY, title: "Personality", required: true, tooltip: "Create an agent for your NFT, Ordinals, token, —or start fresh with a new idea. This section defines your agent’s lore and backstory.", icon: LegoComponentIcon, color: "#12DAC2", order: 1, options: [ { idx: CATEGORY_OPTION_KEYS.personalities.personality_customize, title: "New personality", icon: "https://storage.googleapis.com/eternal-ai/agent-studio-v2/ic_personality_custom.svg", customizeRenderOnBoard: NewPersonality as any, }, { idx: CATEGORY_OPTION_KEYS.personalities.personality_nft, title: "Import from NFT", icon: "https://storage.googleapis.com/eternal-ai/agent-studio-v2/ic_personality_nft.svg", customizeRenderOnBoard: ImportFromNft as any, disabled: state === "update", // hidden: state === 'update', }, { idx: CATEGORY_OPTION_KEYS.personalities.personality_ordinals, title: "Import from Ordinals", icon: "https://storage.googleapis.com/eternal-ai/agent-studio-v2/ic_personality_ordinals.svg", customizeRenderOnBoard: CustomImportFromOrdinalsRenderer as any, disabled: state === "update", // hidden: state === 'update', }, { idx: CATEGORY_OPTION_KEYS.personalities.personality_token, title: "Import from Token", icon: "https://storage.googleapis.com/eternal-ai/agent-studio-v2/ic_personality_token.svg", customizeRenderOnBoard: CustomImportFromTokenRenderer as any, disabled: state === "update", // hidden: state === 'update', }, { idx: CATEGORY_OPTION_KEYS.personalities.personality_knowledge, title: "Knowledge", icon: "https://storage.googleapis.com/eternal-ai/agent-studio-v2/ic_personality_knowledge.svg", customizeRenderOnBoard: CustomKnowledgeRenderer as any, disabled: state === "update", // hidden: state === 'update', ...KNOWLEDGE_VALIDATES.create, }, { idx: CATEGORY_OPTION_KEYS.personalities.personality_genomics, title: "Genomic Labs", icon: "https://storage.googleapis.com/eternal-ai/agent-studio-v2/ic_personality_genomic.svg", customizeRenderOnBoard: ImportGenomic as any, disabled: state === "update", // hidden: state === 'update', // disabled: true, }, ...extendOptions, ], ...validators, } satisfies StudioCategory; }; const getAiFrameworkCategory = ( state: State, extendOptions: StudioCategoryOption[] = [] ): StudioCategory => { const validators = state === "create" ? AI_FRAME_WORK_VALIDATES.create : AI_FRAME_WORK_VALIDATES.update; const category = { idx: AI_FRAMEWORK_CATEGORY_KEY, title: "AI Framework", required: true, tooltip: "Pick the blockchain where your agent lives. Each option has unique deployment fees, performance, and ongoing costs. Choose what best fits your needs.", icon: LegoComponentIcon, color: "#5B913B", disabled: state === "update", // hidden: state === 'update', order: state === "update" ? 1000 : 2, options: [ { idx: CATEGORY_OPTION_KEYS.aiFrameworks.ai_framework_eternal_ai, title: "Eternal AI", icon: "https://storage.googleapis.com/eternal-ai/agent-studio/ic_eternal_ai.svg", customizeRenderOnBoard: CustomAIFrameworkRendererOnBoard as any, data: { aiFrameworkId: { type: "hidden", label: "AI Framework Id", placeholder: "AI Framework Id", defaultValue: OPTION_ETERNAL_AI_ID, }, }, } satisfies StudioCategoryOption, { idx: CATEGORY_OPTION_KEYS.aiFrameworks.ai_framework_eliza, title: "Eliza", customizeRenderOnBoard: ElizaFramework as any, icon: "https://storage.googleapis.com/eternal-ai/agent-studio/ic_eliza_ai.png", data: { aiFrameworkId: { type: "hidden", label: "AI Eliaz Id", placeholder: "AI Eliaz Id", defaultValue: OPTION_ELIZA_ID, }, config: { type: "hidden", label: "Config", placeholder: "Config", defaultValue: JSON.stringify(ELIZA_CONFIG_DEFAULT, null, 2), }, }, } satisfies StudioCategoryOption, { idx: CATEGORY_OPTION_KEYS.aiFrameworks.ai_framework_zerepy, title: "ZerePy", disabled: true, customizeRenderOnBoard: CustomAIFrameworkRendererOnBoard as any, data: { aiFrameworkId: { type: "hidden", label: "AI ZerePy Id", placeholder: "AI ZerePy Id", defaultValue: OPTION_ZERE_PY_ID, }, }, } satisfies StudioCategoryOption, ...extendOptions, ] as StudioCategoryOption[], ...validators, } satisfies StudioCategory; return category; }; const getBlockchainCategory = ( state: State, extendOptions: StudioCategoryOption[] = [] ): StudioCategory => { const validators = state === "create" ? BLOCKCHAIN_VALIDATES.create : BLOCKCHAIN_VALIDATES.update; const getRequiredAmount = (chainId: string) => { const matchedToken = tokens.find((v) => compareString(v.id, chainId)); if (matchedToken) { return `${matchedToken.required_amount} EAI/post`; } return ""; }; const category = { idx: BLOCKCHAIN_CATEGORY_KEY, title: "Blockchains", required: true, icon: LegoComponentIcon, color: "#368cdc", disabled: state === "update", // hidden: state === 'update', order: state === "update" ? 1000 : 3, options: [ { idx: CATEGORY_OPTION_KEYS.blockchains.blockchain_base, title: "Base", icon: "/icons/blockchains/ic_base.svg", tooltip: getRequiredAmount(SUPPORT_NETWORKS.BASE), data: { chainId: { type: "hidden", label: "Chain Id", placeholder: "Chain Id", defaultValue: SUPPORT_NETWORKS.BASE, }, }, }, { idx: CATEGORY_OPTION_KEYS.blockchains.blockchain_arbitrum, title: "Arbitrum", icon: "/icons/blockchains/ic_arbitrum.svg", tooltip: getRequiredAmount(SUPPORT_NETWORKS.ARBITRUM), data: { chainId: { type: "hidden", label: "Chain Id", placeholder: "Chain Id", defaultValue: SUPPORT_NETWORKS.ARBITRUM, }, }, }, { idx: CATEGORY_OPTION_KEYS.blockchains.blockchain_bnb, title: "BNB", icon: "/icons/blockchains/ic-bsc.png", tooltip: getRequiredAmount(SUPPORT_NETWORKS.BSC), data: { chainId: { type: "hidden", label: "Chain Id", placeholder: "Chain Id", defaultValue: SUPPORT_NETWORKS.BSC, }, }, }, { idx: CATEGORY_OPTION_KEYS.blockchains.blockchain_eth, title: "Ethereum", icon: "https://eternalai.org/icons/blockchains/ic-ether.png", tooltip: getRequiredAmount(SUPPORT_NETWORKS.ETHEREUM), data: { chainId: { type: "hidden", label: "Chain Id", placeholder: "Chain Id", defaultValue: SUPPORT_NETWORKS.ETHEREUM, }, }, }, { idx: CATEGORY_OPTION_KEYS.blockchains.blockchain_bitcoin, title: "Bitcoin", icon: "/icons/blockchains/ic_bitcoin.svg", tooltip: getRequiredAmount(SUPPORT_NETWORKS.BITCOIN), data: { chainId: { type: "hidden", label: "Chain Id", placeholder: "Chain Id", defaultValue: SUPPORT_NETWORKS.BITCOIN, }, }, }, { idx: CATEGORY_OPTION_KEYS.blockchains.blockchain_bittensor, title: "Bittensor", icon: "/icons/blockchains/ic-tao.svg", tooltip: getRequiredAmount(SUPPORT_NETWORKS.TAO), data: { chainId: { type: "hidden", label: "Chain Id", placeholder: "Chain Id", defaultValue: SUPPORT_NETWORKS.TAO, }, }, }, { idx: CATEGORY_OPTION_KEYS.blockchains.blockchain_ape_chain, title: "Ape Chain", icon: "/icons/blockchains/ic-ape.png", tooltip: getRequiredAmount(SUPPORT_NETWORKS.APE), data: { chainId: { type: "hidden", label: "Chain Id", placeholder: "Chain Id", defaultValue: SUPPORT_NETWORKS.APE, }, }, }, { idx: CATEGORY_OPTION_KEYS.blockchains.blockchain_solana, title: "Solana", icon: "/icons/blockchains/ic_solana.svg", tooltip: getRequiredAmount(SUPPORT_NETWORKS.SOLANA), data: { chainId: { type: "hidden", label: "Chain Id", placeholder: "Chain Id", defaultValue: SUPPORT_NETWORKS.SOLANA, }, }, }, { idx: CATEGORY_OPTION_KEYS.blockchains.blockchain_polygon, title: "Polygon", icon: "/icons/blockchains/ic_polygon.svg", tooltip: getRequiredAmount(SUPPORT_NETWORKS.POLYGON), data: { chainId: { type: "hidden", label: "Chain Id", placeholder: "Chain Id", defaultValue: SUPPORT_NETWORKS.POLYGON, }, }, }, { idx: CATEGORY_OPTION_KEYS.blockchains.blockchain_zksync_era, title: "ZKsync Era", icon: "/icons/blockchains/ic_zksync.svg", tooltip: getRequiredAmount(SUPPORT_NETWORKS.ZKSYNC), data: { chainId: { type: "hidden", label: "Chain Id", placeholder: "Chain Id", defaultValue: SUPPORT_NETWORKS.ZKSYNC, }, }, }, { idx: CATEGORY_OPTION_KEYS.blockchains.blockchain_avalanche, title: "Avalanche C-Chain", icon: "/icons/blockchains/ic_avax.svg", tooltip: getRequiredAmount(SUPPORT_NETWORKS.AVAX), data: { chainId: { type: "hidden", label: "Chain Id", placeholder: "Chain Id", defaultValue: SUPPORT_NETWORKS.AVAX, }, }, }, { idx: CATEGORY_OPTION_KEYS.blockchains.blockchain_abstract_testnet, title: "Abstract Testnet", icon: "/icons/blockchains/ic-abs.png", tooltip: getRequiredAmount(SUPPORT_NETWORKS.ABS), data: { chainId: { type: "hidden", label: "Chain Id", placeholder: "Chain Id", defaultValue: SUPPORT_NETWORKS.ABS, }, }, }, { idx: CATEGORY_OPTION_KEYS.blockchains.blockchain_duck_chain, title: "DuckChain", icon: "/icons/blockchains/ic-duck.svg", tooltip: getRequiredAmount(SUPPORT_NETWORKS.DUCK), data: { chainId: { type: "hidden", label: "Chain Id", placeholder: "Chain Id", defaultValue: SUPPORT_NETWORKS.DUCK, }, }, }, { idx: CATEGORY_OPTION_KEYS.blockchains.blockchain_symbiosis, title: "Symbiosis", icon: "/icons/blockchains/ic_nbs.svg", tooltip: getRequiredAmount(SUPPORT_NETWORKS.SYMBIOSIS), data: { chainId: { type: "hidden", label: "Chain Id", placeholder: "Chain Id", defaultValue: SUPPORT_NETWORKS.SYMBIOSIS, }, }, }, { idx: CATEGORY_OPTION_KEYS.blockchains.blockchain_tron, title: "Tron", icon: "https://eternalai.org/icons/blockchains/ic-tron.svg", tooltip: getRequiredAmount(SUPPORT_NETWORKS.TRON), data: { chainId: { type: "hidden", label: "Chain Id", placeholder: "Chain Id", defaultValue: SUPPORT_NETWORKS.TRON, }, }, }, ...extendOptions, ], ...validators, } satisfies StudioCategory; category.options = category.options.map((option) => ({ ...option, customizeRenderOnBoard: CustomBlockchainRendererOnBoard as any, })); return category; }; const getDecentralizedInferenceCategory = ( state: State, extendOptions: StudioCategoryOption[] = [] ): StudioCategory => { const validators = state === "create" ? DECENTRALIZE_INFERENCE_VALIDATES.create : DECENTRALIZE_INFERENCE_VALIDATES.update; const category = { idx: DECENTRALIZED_INFERENCE_CATEGORY_KEY, title: "Decentralize Inference", required: true, tooltip: "Create an agent for your NFT, Ordinals, token, —or start fresh with a new idea. This section defines your agent’s lore and backstory.", icon: LegoComponentIcon, color: "#15C888", disabled: state === "update", // hidden: state === 'update', order: state === "update" ? 1000 : 4, options: [...extendOptions], ...validators, } satisfies StudioCategory; category.options = category.options.map((option) => ({ ...option, customizeRenderOnBoard: CustomDIRendererOnBoard as any, })); return category; }; const getTokenCategory = ( state: State, extendOptions: StudioCategoryOption[] = [] ): StudioCategory => { const validators = state === "create" ? TOKEN_VALIDATES.create : TOKEN_VALIDATES.update; const getTokenPrice = (chainId: string) => { const matchedToken = tokens.find((v) => compareString(v.id, chainId)); if (matchedToken) { return `${matchedToken.deploy_token_amount} EAI`; } return "Free"; }; const category = { idx: TOKEN_CATEGORY_KEY, title: "Tokens", required: true, tooltip: "Select the blockchain to issue your agent’s token. Consider factors like accessibility, liquidity, and trading volume.", icon: LegoComponentIcon, color: "#A041FF", disabled: state === "update", // hidden: state === 'update', order: state === "update" ? 1000 : 5, options: [ { idx: CATEGORY_OPTION_KEYS.tokens.token_base, title: "Token on Base", icon: "/icons/blockchains/ic_base.svg", tooltip: getTokenPrice(SUPPORT_NETWORKS.BASE), data: { tokenId: { type: "hidden", label: "Token Name", placeholder: "Token Name", defaultValue: ChainId.Base, }, }, }, { idx: CATEGORY_OPTION_KEYS.tokens.token_solana, title: "Token on Solana", icon: "/icons/blockchains/ic_solana.svg", tooltip: getTokenPrice(SUPPORT_NETWORKS.SOLANA), data: { tokenId: { type: "hidden", label: "Token Name", placeholder: "Token Name", defaultValue: ChainId.Solana, }, }, // customizeRenderOnBoard: BaseTokenCustomizeOnBoard as any, }, { idx: CATEGORY_OPTION_KEYS.tokens.token_arbitrum, title: "Token on Arbitrum", icon: "/icons/blockchains/ic_arbitrum.svg", tooltip: getTokenPrice(SUPPORT_NETWORKS.ARBITRUM), data: { tokenId: { type: "hidden", label: "Token Name", placeholder: "Token Name", defaultValue: ChainId.Arbitrum, }, }, }, { idx: CATEGORY_OPTION_KEYS.tokens.token_bnb, title: "Token on BNB", icon: "/icons/blockchains/ic-bsc.png", tooltip: getTokenPrice(SUPPORT_NETWORKS.BSC), data: { tokenId: { type: "hidden", label: "Token Name", placeholder: "Token Name", defaultValue: ChainId.BSC, }, }, }, { idx: CATEGORY_OPTION_KEYS.tokens.token_ape, title: "Token on ApeChain", icon: "/icons/blockchains/ic-ape.png", tooltip: getTokenPrice(SUPPORT_NETWORKS.APE), data: { tokenId: { type: "hidden", label: "Token Name", placeholder: "Token Name", defaultValue: ChainId.Ape, }, }, customizeRenderOnBoard: BaseTokenCustomizeOnBoard as any, }, { idx: CATEGORY_OPTION_KEYS.tokens.token_avax, title: "Token on Avalance C-Chain", icon: "/icons/blockchains/ic_avax.svg", tooltip: getTokenPrice(SUPPORT_NETWORKS.AVAX), data: { tokenId: { type: "hidden", label: "Token Name", placeholder: "Token Name", defaultValue: ChainId.Avax, }, }, }, ...extendOptions, ], ...validators, } satisfies StudioCategory; category.options = category.options.map((option) => ({ ...option, customizeRenderOnBoard: CustomTokenRendererOnBoard as any, })); return category; }; const getMissionOnXCategory = ( state: State, extendOptions: StudioCategoryOption[] = [] ): StudioCategory => { return { idx: MISSION_ON_X_CATEGORY_KEY, title: "X", required: false, tooltip: "Set your agent’s activities on X. Choose what it does (e.g., posts, replies) and how often it does them.", icon: categoryImageIcon("https://eternalai.org/icons/blockchains/ic_x.svg"), color: "#6B39F9", order: 6, options: [ { idx: CATEGORY_OPTION_KEYS.missionOnX.mission_on_x_post, title: "Post (using CoT)", icon: "https://storage.googleapis.com/eternal-ai/agent-studio-v2/ic_abilities_post.svg", customizeRenderOnBoard: CustomPostOnXRenderer as any, type: StudioCategoryType.LINK, tooltip: "Cost: 1 EAI per execution.", data: { toolset: { type: "hidden", label: "Tool set", placeholder: "Tool set", defaultValue: MISSION_X_DEFAULT_VALUES[ CATEGORY_OPTION_KEYS.missionOnX.mission_on_x_post ].tool_set, }, frequency: { type: "hidden", label: "Frequency", placeholder: "Frequency", defaultValue: MISSION_X_DEFAULT_VALUES[ CATEGORY_OPTION_KEYS.missionOnX.mission_on_x_post ].time, }, details: { type: "hidden", label: "Details", placeholder: "Details", defaultValue: MISSION_X_DEFAULT_VALUES[ CATEGORY_OPTION_KEYS.missionOnX.mission_on_x_post ].description, }, }, ...POST_ON_X_VALIDATES.create, }, { idx: CATEGORY_OPTION_KEYS.missionOnX.mission_on_x_post_news, title: "Post (using Bing / X search) on X", tooltip: "", icon: "https://storage.googleapis.com/eternal-ai/agent-studio-v2/ic_abilities_post.svg", customizeRenderOnBoard: CustomPostNewsOnXRenderer as any, type: StudioCategoryType.LINK, data: { toolset: { type: "hidden", label: "Tool set", placeholder: "Tool set", defaultValue: MISSION_X_DEFAULT_VALUES[ CATEGORY_OPTION_KEYS.missionOnX.mission_on_x_post_news ].tool_set, }, frequency: { type: "hidden", label: "Frequency", placeholder: "Frequency", defaultValue: MISSION_X_DEFAULT_VALUES[ CATEGORY_OPTION_KEYS.missionOnX.mission_on_x_post_news ].time, }, details: { type: "hidden", label: "Details", placeholder: "Details", defaultValue: MISSION_X_DEFAULT_VALUES[ CATEGORY_OPTION_KEYS.missionOnX.mission_on_x_post_news ].description, }, }, ...POST_NEWS_ON_X_VALIDATES.create, }, { idx: CATEGORY_OPTION_KEYS.missionOnX.mission_on_x_post_following, title: "Post (using the content from followings) on X", tooltip: "", icon: "https://storage.googleapis.com/eternal-ai/agent-studio-v2/ic_abilities_post.svg", customizeRenderOnBoard: CustomPostFollowingOnXRenderer as any, type: StudioCategoryType.LINK, ...POST_FOLLOWING_ON_X_VALIDATES.create, }, { idx: CATEGORY_OPTION_KEYS.missionOnX.mission_on_x_reply, title: "Reply", icon: "https://storage.googleapis.com/eternal-ai/agent-studio-v2/ic_abilities_reply.svg", customizeRenderOnBoard: CustomReplyOnXRenderer as any, type: StudioCategoryType.LINK, tooltip: "Cost: 1 EAI per execution.", data: { toolset: { type: "hidden", label: "Tool set", placeholder: "Tool set", defaultValue: MISSION_X_DEFAULT_VALUES[ CATEGORY_OPTION_KEYS.missionOnX.mission_on_x_reply ].tool_set, }, frequency: { type: "hidden", label: "Frequency", placeholder: "Frequency", defaultValue: MISSION_X_DEFAULT_VALUES[ CATEGORY_OPTION_KEYS.missionOnX.mission_on_x_reply ].time, }, details: { type: "hidden", label: "Details", placeholder: "Details", defaultValue: MISSION_X_DEFAULT_VALUES[ CATEGORY_OPTION_KEYS.missionOnX.mission_on_x_reply ].description, }, }, ...REPLY_ON_X_VALIDATES.create, }, { idx: CATEGORY_OPTION_KEYS.missionOnX.mission_on_x_engage, title: "Engage", icon: "https://storage.googleapis.com/eternal-ai/agent-studio-v2/ic_abilities_engage.svg", customizeRenderOnBoard: CustomEngageOnXRenderer as any, type: StudioCategoryType.LINK, tooltip: "Cost: 1 EAI per execution.", data: { toolset: { type: "hidden", label: "Tool set", placeholder: "Tool set", defaultValue: MISSION_X_DEFAULT_VALUES[ CATEGORY_OPTION_KEYS.missionOnX.mission_on_x_engage ].tool_set, }, frequency: { type: "hidden", label: "Frequency", placeholder: "Frequency", defaultValue: MISSION_X_DEFAULT_VALUES[ CATEGORY_OPTION_KEYS.missionOnX.mission_on_x_engage ].time, }, details: { type: "hidden", label: "Details", placeholder: "Details", defaultValue: MISSION_X_DEFAULT_VALUES[ CATEGORY_OPTION_KEYS.missionOnX.mission_on_x_engage ].description, }, }, ...ENGAGE_ON_X_VALIDATES.create, }, { idx: CATEGORY_OPTION_KEYS.missionOnX.mission_on_x_follow, title: "Follow", icon: "https://storage.googleapis.com/eternal-ai/agent-studio-v2/ic_abilities_follow.svg", customizeRenderOnBoard: CustomFollowOnXRenderer as any, type: StudioCategoryType.LINK, tooltip: "Cost: 1 EAI per execution.", data: { toolset: { type: "hidden", label: "Tool set", placeholder: "Tool set", defaultValue: MISSION_X_DEFAULT_VALUES[ CATEGORY_OPTION_KEYS.missionOnX.mission_on_x_follow ].tool_set, }, frequency: { type: "hidden", label: "Frequency", placeholder: "Frequency", defaultValue: MISSION_X_DEFAULT_VALUES[ CATEGORY_OPTION_KEYS.missionOnX.mission_on_x_follow ].time, }, details: { type: "hidden", label: "Details", placeholder: "Details", defaultValue: MISSION_X_DEFAULT_VALUES[ CATEGORY_OPTION_KEYS.missionOnX.mission_on_x_follow ].description, }, }, ...FOLLOW_ON_X_VALIDATES.create, }, { idx: CATEGORY_OPTION_KEYS.missionOnX.mission_on_x_trading, title: "Trading", icon: "https://storage.googleapis.com/eternal-ai/agent-studio/ic_abilities_news.svg", customizeRenderOnBoard: CustomTradingOnXRenderer as any, type: StudioCategoryType.LINK, tooltip: "Cost: 1 EAI per execution.", data: { toolset: { type: "hidden", label: "Tool set", placeholder: "Tool set", defaultValue: MISSION_X_DEFAULT_VALUES[ CATEGORY_OPTION_KEYS.missionOnX.mission_on_x_trading ].tool_set, }, frequency: { type: "hidden", label: "Frequency", placeholder: "Frequency", defaultValue: MISSION_X_DEFAULT_VALUES[ CATEGORY_OPTION_KEYS.missionOnX.mission_on_x_trading ].time, }, details: { type: "hidden", label: "Details", placeholder: "Details", defaultValue: MISSION_X_DEFAULT_VALUES[ CATEGORY_OPTION_KEYS.missionOnX.mission_on_x_trading ].description, }, }, ...FOLLOW_ON_X_VALIDATES.create, }, ...extendOptions, ], } satisfies StudioCategory; }; const getMissionOnFarcasterCategory = ( state: State, extendOptions: StudioCategoryOption[] = [] ): StudioCategory => { return { idx: MISSION_ON_FARCASTER_CATEGORY_KEY, title: "Farcaster", required: false, tooltip: "Set your agent’s activities on X. Choose what it does (e.g., posts, replies) and how often it does them.", icon: categoryImageIcon( "https://eternalai.org/icons/blockchains/ic_farcaster.svg" ), color: "#344CB7", order: 7, options: [ { idx: CATEGORY_OPTION_KEYS.missionOnFarcaster.mission_on_farcaster_post, title: "Post", icon: "https://storage.googleapis.com/eternal-ai/agent-studio-v2/ic_abilities_post.svg", customizeRenderOnBoard: CustomPostOnFarcasterRenderer as any, type: StudioCategoryType.LINK, tooltip: "Cost: 1 EAI per execution.", data: { toolset: { type: "hidden", label: "Tool set", placeholder: "Tool set", defaultValue: MISSION_FARCASTER_DEFAULT_VALUES[ CATEGORY_OPTION_KEYS.missionOnFarcaster .mission_on_farcaster_post ].tool_set, }, frequency: { type: "hidden", label: "Frequency", placeholder: "Frequency", defaultValue: MISSION_FARCASTER_DEFAULT_VALUES[ CATEGORY_OPTION_KEYS.missionOnFarcaster .mission_on_farcaster_post ].time, }, details: { type: "hidden", label: "Details", placeholder: "Details", defaultValue: MISSION_FARCASTER_DEFAULT_VALUES[ CATEGORY_OPTION_KEYS.missionOnFarcaster .mission_on_farcaster_post ].description, }, }, ...POST_ON_FARCASTER_VALIDATES.create, }, { idx: CATEGORY_OPTION_KEYS.missionOnFarcaster.mission_on_farcaster_reply, title: "Reply", icon: "https://storage.googleapis.com/eternal-ai/agent-studio-v2/ic_abilities_reply.svg", customizeRenderOnBoard: CustomReplyOnFarcasterRenderer as any, type: StudioCategoryType.LINK, tooltip: "Cost: 1 EAI per execution.", data: { toolset: { type: "hidden", label: "Tool set", placeholder: "Tool set", defaultValue: MISSION_FARCASTER_DEFAULT_VALUES[ CATEGORY_OPTION_KEYS.missionOnFarcaster .mission_on_farcaster_reply ].tool_set, }, frequency: { type: "hidden", label: "Frequency", placeholder: "Frequency", defaultValue: MISSION_FARCASTER_DEFAULT_VALUES[ CATEGORY_OPTION_KEYS.missionOnFarcaster .mission_on_farcaster_reply ].time, }, details: { type: "hidden", label: "Details", placeholder: "Details", defaultValue: MISSION_FARCASTER_DEFAULT_VALUES[ CATEGORY_OPTION_KEYS.missionOnFarcaster .mission_on_farcaster_reply ].description, }, }, ...REPLY_ON_FARCASTER_VALIDATES.create, }, ...extendOptions, ], } satisfies StudioCategory; }; const getMissionOnDefiCategory = ( state: State, extendOptions: StudioCategoryOption[] = [] ): StudioCategory => { return { idx: MISSION_ON_DEFI_CATEGORY_KEY, title: "Defi", required: false, tooltip: "Set your agent’s activities on Defi. Choose what it does (e.g., posts, replies) and how often it does them.", icon: categoryImageIcon( "https://eternalai.org/icons/blockchains/ic-defi.png" ), color: "#37AFE1", order: 8, options: [ { idx: CATEGORY_OPTION_KEYS.missionOnDefi.mission_on_defi_trade_analytics, title: "Trade Analytics", icon: "https://storage.googleapis.com/eternal-ai/agent-studio/ic_abilities_news.svg", customizeRenderOnBoard: CustomTradeAnalyticsOnDefiRenderer as any, type: StudioCategoryType.LINK, tooltip: "Cost: 1 EAI per execution.", data: { toolset: { type: "hidden", label: "Tool set", placeholder: "Tool set", defaultValue: MISSION_DEFI_DEFAULT_VALUES[ CATEGORY_OPTION_KEYS.missionOnDefi .mission_on_defi_trade_analytics ].tool_set, }, frequency: { type: "hidden", label: "Frequency", placeholder: "Frequency", defaultValue: MISSION_FARCASTER_DEFAULT_VALUES[ CATEGORY_OPTION_KEYS.missionOnFarcaster .mission_on_farcaster_reply ].time, }, }, ...TRADE_ANALYTICS_ON_DEFI_VALIDATES.create, }, ...extendOptions, ], } satisfies StudioCategory; }; const processOption = ( category: StudioCategory, option: StudioCategoryOption ): StudioCategoryOption => { return { ...option, // customizeRenderOnBoard: onlyLabelCategory.includes(category.idx) ? CustomRendererNoInput as any : CustomRendererOnBoard as any, customizeRenderOnSideBar: CustomRendererNoInput as any, }; }; export default function getAgentModelCategories( state: State, extendOptions: Record = {} ): StudioCategory[] { const AGENT_MODEL_CATEGORIES: StudioCategory[] = [ getAgentCategory(state, extendOptions[AGENT_CATEGORY_KEY]), getPersonalitiesCategory(state, extendOptions[PERSONALITY_CATEGORY_KEY]), getAiFrameworkCategory(state, extendOptions[AI_FRAMEWORK_CATEGORY_KEY]), getBlockchainCategory(state, extendOptions[BLOCKCHAIN_CATEGORY_KEY]), getDecentralizedInferenceCategory( state, extendOptions[DECENTRALIZED_INFERENCE_CATEGORY_KEY] ), getTokenCategory(state, extendOptions[TOKEN_CATEGORY_KEY]), getMissionOnXCategory(state, extendOptions[MISSION_ON_X_CATEGORY_KEY]), getMissionOnFarcasterCategory( state, extendOptions[MISSION_ON_FARCASTER_CATEGORY_KEY] ), getMissionOnDefiCategory( state, extendOptions[MISSION_ON_DEFI_CATEGORY_KEY] ), ]; return AGENT_MODEL_CATEGORIES.map((category) => ({ ...category, options: category.options.map((option) => processOption(category, option)), })); } ================================================ FILE: agent-studio/packages/studio-app/src/categories/decentralize-inference/CustomRenderer/index.tsx ================================================ import { StudioCategoryOptionRenderPayload } from "@agent-studio/studio-dnd"; import CustomRendererNoInput from "../../shared/CustomRendererNoInput"; function CustomDIRendererOnBoard(props: StudioCategoryOptionRenderPayload) { return ; } export default CustomDIRendererOnBoard; ================================================ FILE: agent-studio/packages/studio-app/src/categories/decentralize-inference/validates/create.ts ================================================ import { findDataByCategoryKey, findDataById, OnAddPayload, OnCreatePayload, OnMergePayload, OnSnapPayload, StudioDataNode, StudioNode, } from "@agent-studio/studio-dnd"; import { onlyOptionSameCategoryInTree } from "../../shared/validators"; import useCommonStore from "../../../stores/useCommonStore"; import { BLOCKCHAIN_CATEGORY_KEY } from "../../../constants/category-keys"; import { compareString } from "../../../utils/string"; import { tokens } from "../../../constants/tokens"; import { showValidateError } from "../../../utils/toast"; const validateNetworkForAiModel = ( toNode: StudioNode, data: StudioDataNode[], aiModel: string ) => { if (aiModel) { try { // validate for ai models const targetData = findDataById(toNode.id, data); if (!targetData) { return true; } const networks = findDataByCategoryKey(BLOCKCHAIN_CATEGORY_KEY, [ targetData, ]); if (networks?.length) { const network = networks[0]; if (network) { const chainId = network?.data?.chainId as string; if (chainId) { const chains = useCommonStore.getState().chains || []; const token = tokens.find((v) => compareString(v.id, chainId)); if (token) { const selectChain = chains.find( (chain) => chain.chain_id === token?.chainId ); if (selectChain) { const isSupported = !!selectChain?.support_model_names?.[aiModel]; if (!isSupported) { showValidateError("Network doesn't support ai model"); } return isSupported; } } } } } } catch (e) { // } } return true; }; const onAddValidate = (data: OnAddPayload) => { if (!onlyOptionSameCategoryInTree(data)) { return false; } if ( !validateNetworkForAiModel( data.toNode, data.data, data?.option?.data?.decentralizeId?.defaultValue as string ) ) { return false; } return true; }; const onSnapValidate = (data: OnSnapPayload) => { if (!onlyOptionSameCategoryInTree(data)) { return false; } if ( !validateNetworkForAiModel( data.toNode, data.data, data?.option?.data?.decentralizeId?.defaultValue as string ) ) { return false; } return true; }; const onSplitValidate = () => { return true; }; const onMergeValidate = (data: OnMergePayload) => { if (!onlyOptionSameCategoryInTree(data)) { return false; } if ( !validateNetworkForAiModel( data.toNode, data.data, data?.option?.data?.decentralizeId?.defaultValue as string ) ) { return false; } return true; }; const onDropInValidate = (data: OnCreatePayload) => { return true; }; const onDropOutValidate = () => { return true; }; export const CREATE_DECENTRALIZE_INFERENCE = { onAddValidate, onSnapValidate, onSplitValidate, onMergeValidate, onDropInValidate, onDropOutValidate, }; ================================================ FILE: agent-studio/packages/studio-app/src/categories/decentralize-inference/validates/index.ts ================================================ import { CREATE_DECENTRALIZE_INFERENCE } from './create'; import { UPDATE_DECENTRALIZE_INFERENCE } from './update'; export const DECENTRALIZE_INFERENCE_VALIDATES = { create: CREATE_DECENTRALIZE_INFERENCE, update: UPDATE_DECENTRALIZE_INFERENCE, }; ================================================ FILE: agent-studio/packages/studio-app/src/categories/decentralize-inference/validates/update.ts ================================================ import { OnAddPayload, OnCreatePayload, OnMergePayload, OnSnapPayload, } from "@agent-studio/studio-dnd"; import { onlyOptionSameCategoryInTree } from "../../shared/validators"; const onAddValidate = (data: OnAddPayload) => { return onlyOptionSameCategoryInTree(data); }; const onSnapValidate = (data: OnSnapPayload) => { return onlyOptionSameCategoryInTree(data); }; const onSplitValidate = () => { return true; }; const onMergeValidate = (data: OnMergePayload) => { return onlyOptionSameCategoryInTree(data); }; const onDropInValidate = (data: OnCreatePayload) => { return false; }; const onDropOutValidate = () => { return false; }; export const UPDATE_DECENTRALIZE_INFERENCE = { onAddValidate, onSnapValidate, onSplitValidate, onMergeValidate, onDropInValidate, onDropOutValidate, }; ================================================ FILE: agent-studio/packages/studio-app/src/categories/defi/tradeAnalytics/CustomRenderer/Fields/FrequencyField.tsx ================================================ import StudioHorizontalField from "../../../../../components/form/fields/StudioHorizontalField"; import StudioInput from "../../../../../components/form/inputs/StudioInput"; type Props = { id: string; value: string; onChange: (v: string) => void; }; const FrequencyField = ({ id, value, onChange }: Props) => { return ( onChange(e.target.value)} placeholder="e.g 2" /> ); }; export default FrequencyField; ================================================ FILE: agent-studio/packages/studio-app/src/categories/defi/tradeAnalytics/CustomRenderer/Fields/TokenField.tsx ================================================ import { useEffect, useMemo, useState } from "react"; import { Flex, Image, Text, Input, InputGroup, InputLeftElement, } from "@chakra-ui/react"; import StudioHorizontalField from "../../../../../components/form/fields/StudioHorizontalField"; import useCommonStore, { ShortAgentToken, } from "../../../../../stores/useCommonStore"; import StudioDropdown from "../../../../../components/form/inputs/StudioDropdown"; import AgentAPI from "../../../../../services/apis/agent"; type Props = { id: string; value: string; onChange: (v: string) => void; }; const TokenField = ({ id, value, onChange }: Props) => { const { agentTokens, setAgentTokens } = useCommonStore(); const [searchValue, setSearchValue] = useState(""); useEffect(() => { if (!agentTokens?.length) { fetchData(); } }, [agentTokens?.length]); const fetchData = async () => { try { const rs: any = await AgentAPI.getAgentTokens(); setAgentTokens(rs); } catch (error) {} }; const options = useMemo(() => { if (searchValue) { return agentTokens .map((v) => ({ label: v.name, value: v.symbol, extraData: v, })) .filter( (v) => v.value.toUpperCase().includes(searchValue.toUpperCase()) || v.label.toUpperCase().includes(searchValue.toUpperCase()) ); } return agentTokens.map((v) => ({ label: v.name, value: v.symbol, extraData: v, })); }, [agentTokens, searchValue]); return ( value={value} onChange={(v) => { onChange(v as string); }} placeholder="Token" options={options} beforeItemRenderer={() => ( { setSearchValue(e.target.value); }} /> )} inputRenderer={(option) => ( <> {option ? ( {option.extraData?.name} {option.extraData?.symbol} ) : ( Select Token )} )} itemRenderer={(option) => ( {option.extraData?.name} {option.extraData?.symbol} )} /> ); }; export default TokenField; ================================================ FILE: agent-studio/packages/studio-app/src/categories/defi/tradeAnalytics/CustomRenderer/index.tsx ================================================ import { StudioCategoryOptionRenderPayload } from "@agent-studio/studio-dnd"; import { TradeAnalyticsOnDefiFormData } from "../types"; import FrequencyField from "./Fields/FrequencyField"; import TokenField from "./Fields/TokenField"; import CustomRendererBase from "../../../../components/CustomRendererBase"; import StudioFormWrapper from "../../../../components/form"; const CustomTradeAnalyticsOnDefiRenderer = ({ id, formData, data, setFormFields, }: StudioCategoryOptionRenderPayload) => { const { frequency, token } = formData; return (
setFormFields({ token: v })} /> { setFormFields({ frequency: v }); }} />
); }; export default CustomTradeAnalyticsOnDefiRenderer; ================================================ FILE: agent-studio/packages/studio-app/src/categories/defi/tradeAnalytics/types.ts ================================================ export type TradeAnalyticsOnDefiFormData = { token: string; toolset: string; frequency: string; }; ================================================ FILE: agent-studio/packages/studio-app/src/categories/defi/tradeAnalytics/validates/create.ts ================================================ import { OnAddPayload, OnCreatePayload, OnLinkPayload, } from "@agent-studio/studio-dnd"; import { defiMissionLinkToAllowed } from "../../../shared/validators"; const onAddValidate = (data: OnAddPayload) => { return true; }; const onSnapValidate = () => { return true; }; const onSplitValidate = () => { return true; }; const onMergeValidate = () => { return true; }; const onDropInValidate = () => { return true; }; const onDropOutValidate = () => { return true; }; const onLinkValidate = (data: OnLinkPayload) => { return defiMissionLinkToAllowed(data); }; const CREATE_FLOW_TRADE_ANALYTICS_ON_DEFI_VALIDATORS = { onAddValidate, onSnapValidate, onSplitValidate, onMergeValidate, onDropInValidate, onDropOutValidate, onLinkValidate, }; export default CREATE_FLOW_TRADE_ANALYTICS_ON_DEFI_VALIDATORS; ================================================ FILE: agent-studio/packages/studio-app/src/categories/defi/tradeAnalytics/validates/index.ts ================================================ import CREATE_FLOW_TRADE_ANALYTICS_ON_DEFI_VALIDATORS from './create'; import UPDATE_FLOW_TRADE_ANALYTICS_ON_DEFI_VALIDATORS from './update'; const TRADE_ANALYTICS_ON_DEFI_VALIDATES = { create: CREATE_FLOW_TRADE_ANALYTICS_ON_DEFI_VALIDATORS, update: UPDATE_FLOW_TRADE_ANALYTICS_ON_DEFI_VALIDATORS, }; export default TRADE_ANALYTICS_ON_DEFI_VALIDATES; ================================================ FILE: agent-studio/packages/studio-app/src/categories/defi/tradeAnalytics/validates/update.ts ================================================ import { OnAddPayload, OnLinkPayload } from "@agent-studio/studio-dnd"; import { defiMissionLinkToAllowed } from "../../../shared/validators"; const onAddValidate = (data: OnAddPayload) => { return true; }; const onSnapValidate = () => { return true; }; const onSplitValidate = () => { return true; }; const onMergeValidate = () => { return true; }; const onDropInValidate = () => { return true; }; const onDropOutValidate = () => { return true; }; const onLinkValidate = (data: OnLinkPayload) => { return defiMissionLinkToAllowed(data); }; const UPDATE_FLOW_TRADE_ANALYTICS_ON_DEFI_VALIDATORS = { onAddValidate, onSnapValidate, onSplitValidate, onMergeValidate, onDropInValidate, onDropOutValidate, onLinkValidate, }; export default UPDATE_FLOW_TRADE_ANALYTICS_ON_DEFI_VALIDATORS; ================================================ FILE: agent-studio/packages/studio-app/src/categories/farcaster/postOnFarcaster/CustomRenderer/Fields/AiModelField.tsx ================================================ import { StudioDataNode } from "@agent-studio/studio-dnd"; import { useEffect, useMemo } from "react"; import useStudioAgentStore from "../../../../../stores/useStudioAgentStore"; import { useDetectChainIdForMissionModel } from "../../../../../hooks/useDetectChainIdForMissionModel"; import { compareString } from "../../../../../utils/string"; import { tokens } from "../../../../../constants/tokens"; import { RenameModels } from "../../../../../constants/models"; import StudioHorizontalField from "../../../../../components/form/fields/StudioHorizontalField"; import StudioDropdown from "../../../../../components/form/inputs/StudioDropdown"; import useCommonStore from "../../../../../stores/useCommonStore"; type Props = { id: string; value: string; onChange: (v: string, name: string) => void; data: StudioDataNode[]; }; const AiModelField = ({ id, value, onChange, data }: Props) => { const { isDetail } = useStudioAgentStore(); const chains = useCommonStore((state) => state.chains); const chainId = useDetectChainIdForMissionModel(id); const options = useMemo(() => { try { const matchedToken = tokens.find((v) => compareString(v.id, chainId)); const selectedChain = chains?.find((v) => compareString(v.chain_id, matchedToken?.chainId) ); if (selectedChain?.support_model_names) { return Object.entries(selectedChain.support_model_names).map( (item) => ({ label: RenameModels?.[item[0] as any] || item[0], value: item[1], extraData: item, }) ); } } catch (e) { /// } return []; }, [chainId]); useEffect(() => { if (!isDetail) { if (chainId) { if (options?.length && value) { const option = options.find((item) => item.value === value) || options[0]; if (option) { onChange(option.value, option.extraData[0] as string); } } else { const option = options[0]; if (option) { onChange(option.value, option.extraData[0] as string); } } } else { onChange("", ""); } } }, [chainId, options?.length, value]); return ( { const option = options.find((v) => v.value === id); if (option) { onChange(id as string, option.extraData[0] as string); } }} placeholder="AI Model" options={options} /> ); }; export default AiModelField; ================================================ FILE: agent-studio/packages/studio-app/src/categories/farcaster/postOnFarcaster/CustomRenderer/Fields/DetailsField.tsx ================================================ import StudioVerticalField from "../../../../../components/form/fields/StudioVerticalField"; import StudioTextArea from "../../../../../components/form/inputs/StudioTextArea"; type Props = { id: string; value: string; onChange: (v: string) => void; }; const DetailsField = ({ id, value, onChange }: Props) => { return ( onChange(e.target.value)} placeholder="Enter your detailed instructions here" /> ); }; export default DetailsField; ================================================ FILE: agent-studio/packages/studio-app/src/categories/farcaster/postOnFarcaster/CustomRenderer/Fields/FrequencyField.tsx ================================================ import StudioHorizontalField from "../../../../../components/form/fields/StudioHorizontalField"; import StudioInput from "../../../../../components/form/inputs/StudioInput"; type Props = { id: string; value: string; onChange: (v: string) => void; }; const FrequencyField = ({ id, value, onChange }: Props) => { return ( onChange(e.target.value)} placeholder="e.g 2" /> ); }; export default FrequencyField; ================================================ FILE: agent-studio/packages/studio-app/src/categories/farcaster/postOnFarcaster/CustomRenderer/index.tsx ================================================ import { StudioCategoryOptionRenderPayload } from "@agent-studio/studio-dnd"; import DetailsField from "./Fields/DetailsField"; import FrequencyField from "./Fields/FrequencyField"; import { PostOnFarcasterFormData } from "../types"; import { useMemo } from "react"; import { Button, Flex } from "@chakra-ui/react"; import s from "../../styles.module.scss"; import AiModelField from "./Fields/AiModelField"; import useStudioAgentStore from "../../../../stores/useStudioAgentStore"; import { findById, findParentById, findPersonalityObj, } from "../../../../utils/process"; import { showError } from "../../../../utils/toast"; import CustomRendererBase from "../../../../components/CustomRendererBase"; import StudioFormWrapper from "../../../../components/form"; const CustomPostOnFarcasterRenderer = ({ id, formData, data, setFormFields, }: StudioCategoryOptionRenderPayload) => { const { frequency, details, model } = formData; const { setSimulatePrompt, simulatePrompt } = useStudioAgentStore(); const handleSelectMissionPrompt = () => { const result = findById(data, id); const parentObj = findParentById(data, id); const personalityObj = findPersonalityObj(data, parentObj); if (!result) { showError({ message: "Unable to find the selected prompt", }); return; } if (!personalityObj) { showError({ message: "Personality not found. Please connect the prompt to a personality", }); return; } setSimulatePrompt({ id: [personalityObj.id, result.id], personality: personalityObj?.data?.personality, simulate_prompt: result.data.details, simulate_type: result.idx, }); }; const isActive = useMemo(() => { return simulatePrompt?.id.includes(id); }, [simulatePrompt]); return (
{ setFormFields({ model: id, modelName: name }); }} data={data} /> { setFormFields({ frequency: v }); }} /> { setFormFields({ details: v }); }} />
); }; export default CustomPostOnFarcasterRenderer; ================================================ FILE: agent-studio/packages/studio-app/src/categories/farcaster/postOnFarcaster/types.ts ================================================ export type PostOnFarcasterFormData = { id: string; toolset: string; frequency: string; details: string; model: string; modelName: string; }; ================================================ FILE: agent-studio/packages/studio-app/src/categories/farcaster/postOnFarcaster/validates/create.ts ================================================ import { OnAddPayload, OnCreatePayload, OnLinkPayload, } from "@agent-studio/studio-dnd"; import { farcasterMissionLinkToAllowed } from "../../../shared/validators"; const onAddValidate = (data: OnAddPayload) => { return true; }; const onSnapValidate = () => { return true; }; const onSplitValidate = () => { return true; }; const onMergeValidate = () => { return true; }; const onDropInValidate = () => { return true; }; const onDropOutValidate = () => { return true; }; const onLinkValidate = (data: OnLinkPayload) => { return farcasterMissionLinkToAllowed(data); }; const CREATE_FLOW_POST_ON_FARCASTER_VALIDATORS = { onAddValidate, onSnapValidate, onSplitValidate, onMergeValidate, onDropInValidate, onDropOutValidate, onLinkValidate, }; export default CREATE_FLOW_POST_ON_FARCASTER_VALIDATORS; ================================================ FILE: agent-studio/packages/studio-app/src/categories/farcaster/postOnFarcaster/validates/index.ts ================================================ import CREATE_FLOW_POST_ON_FARCASTER_VALIDATORS from './create'; import UPDATE_FLOW_POST_ON_FARCASTER_VALIDATORS from './update'; const POST_ON_FARCASTER_VALIDATES = { create: CREATE_FLOW_POST_ON_FARCASTER_VALIDATORS, update: UPDATE_FLOW_POST_ON_FARCASTER_VALIDATORS, }; export default POST_ON_FARCASTER_VALIDATES; ================================================ FILE: agent-studio/packages/studio-app/src/categories/farcaster/postOnFarcaster/validates/update.ts ================================================ import { OnAddPayload, OnLinkPayload } from "@agent-studio/studio-dnd"; import { farcasterMissionLinkToAllowed } from "../../../shared/validators"; const onAddValidate = (data: OnAddPayload) => { return true; }; const onSnapValidate = () => { return true; }; const onSplitValidate = () => { return true; }; const onMergeValidate = () => { return true; }; const onDropInValidate = () => { return true; }; const onDropOutValidate = () => { return true; }; const onLinkValidate = (data: OnLinkPayload) => { return farcasterMissionLinkToAllowed(data); }; const UPDATE_FLOW_POST_ON_FARCASTER_VALIDATORS = { onAddValidate, onSnapValidate, onSplitValidate, onMergeValidate, onDropInValidate, onDropOutValidate, onLinkValidate, }; export default UPDATE_FLOW_POST_ON_FARCASTER_VALIDATORS; ================================================ FILE: agent-studio/packages/studio-app/src/categories/farcaster/replyOnFarcaster/CustomRenderer/Fields/AiModelField.tsx ================================================ import { StudioDataNode } from "@agent-studio/studio-dnd"; import { useEffect, useMemo } from "react"; import useStudioAgentStore from "../../../../../stores/useStudioAgentStore"; import { useDetectChainIdForMissionModel } from "../../../../../hooks/useDetectChainIdForMissionModel"; import { tokens } from "../../../../../constants/tokens"; import { compareString } from "../../../../../utils/string"; import { RenameModels } from "../../../../../constants/models"; import StudioHorizontalField from "../../../../../components/form/fields/StudioHorizontalField"; import StudioDropdown from "../../../../../components/form/inputs/StudioDropdown"; import useCommonStore from "../../../../../stores/useCommonStore"; type Props = { id: string; value: string; onChange: (v: string, name: string) => void; data: StudioDataNode[]; }; const AiModelField = ({ id, value, onChange, data }: Props) => { const { isDetail } = useStudioAgentStore(); const chains = useCommonStore((state) => state.chains); const chainId = useDetectChainIdForMissionModel(id); const options = useMemo(() => { try { const matchedToken = tokens.find((v) => compareString(v.id, chainId)); const selectedChain = chains?.find((v) => compareString(v.chain_id, matchedToken?.chainId) ); if (selectedChain?.support_model_names) { return Object.entries(selectedChain.support_model_names).map( (item) => ({ label: RenameModels?.[item[0] as any] || item[0], value: item[1], extraData: item, }) ); } } catch (e) { /// } return []; }, [chainId]); useEffect(() => { if (!isDetail) { if (chainId) { if (options?.length && value) { const option = options.find((item) => item.value === value) || options[0]; if (option) { onChange(option.value, option.extraData[0] as string); } } else { const option = options[0]; if (option) { onChange(option.value, option.extraData[0] as string); } } } else { onChange("", ""); } } }, [chainId, options?.length, value]); return ( { const option = options.find((v) => v.value === id); if (option) { onChange(id as string, option.extraData[0] as string); } }} placeholder="AI Model" options={options} /> ); }; export default AiModelField; ================================================ FILE: agent-studio/packages/studio-app/src/categories/farcaster/replyOnFarcaster/CustomRenderer/Fields/DetailsField.tsx ================================================ import StudioVerticalField from "../../../../../components/form/fields/StudioVerticalField"; import StudioTextArea from "../../../../../components/form/inputs/StudioTextArea"; type Props = { id: string; value: string; onChange: (v: string) => void; }; const DetailsField = ({ id, value, onChange }: Props) => { return ( onChange(e.target.value)} placeholder="Enter your detailed instructions here" /> ); }; export default DetailsField; ================================================ FILE: agent-studio/packages/studio-app/src/categories/farcaster/replyOnFarcaster/CustomRenderer/Fields/FrequencyField.tsx ================================================ import StudioHorizontalField from "../../../../../components/form/fields/StudioHorizontalField"; import StudioInput from "../../../../../components/form/inputs/StudioInput"; type Props = { id: string; value: string; onChange: (v: string) => void; }; const FrequencyField = ({ id, value, onChange }: Props) => { return ( onChange(e.target.value)} placeholder="e.g 2" /> ); }; export default FrequencyField; ================================================ FILE: agent-studio/packages/studio-app/src/categories/farcaster/replyOnFarcaster/CustomRenderer/index.tsx ================================================ import { StudioCategoryOptionRenderPayload } from "@agent-studio/studio-dnd"; import DetailsField from "./Fields/DetailsField"; import FrequencyField from "./Fields/FrequencyField"; import s from "../../styles.module.scss"; import { Button, Flex } from "@chakra-ui/react"; import AiModelField from "./Fields/AiModelField"; import { ReplyOnFarcasterFormData } from "../types"; import useStudioAgentStore from "../../../../stores/useStudioAgentStore"; import { useMemo } from "react"; import { findById, findParentById, findPersonalityObj, } from "../../../../utils/process"; import { showError } from "../../../../utils/toast"; import CustomRendererBase from "../../../../components/CustomRendererBase"; import StudioFormWrapper from "../../../../components/form"; const CustomReplyOnFarcasterRenderer = ({ id, formData, data, setFormFields, }: StudioCategoryOptionRenderPayload) => { const { frequency, details, model } = formData; const { simulatePrompt, setSimulatePrompt } = useStudioAgentStore(); const isActive = useMemo(() => { return simulatePrompt?.id.includes(id); }, [simulatePrompt]); const handleSelectMissionPrompt = () => { const result = findById(data, id); const parentObj = findParentById(data, id); const personalityObj = findPersonalityObj(data, parentObj); if (!result) { showError({ message: "Unable to find the selected prompt", }); return; } if (!personalityObj) { showError({ message: "Personality not found. Please connect the prompt to a personality", }); return; } setSimulatePrompt({ id: [personalityObj.id, result.id], personality: personalityObj?.data?.personality, simulate_prompt: result.data.details, simulate_type: result.idx, }); }; return (
{ setFormFields({ model: id, modelName: name }); }} data={data} /> { setFormFields({ frequency: v }); }} /> { setFormFields({ details: v }); }} />
); }; export default CustomReplyOnFarcasterRenderer; ================================================ FILE: agent-studio/packages/studio-app/src/categories/farcaster/replyOnFarcaster/types.ts ================================================ export type ReplyOnFarcasterFormData = { id: string; toolset: string; frequency: string; details: string; model: string; modelName: string; }; ================================================ FILE: agent-studio/packages/studio-app/src/categories/farcaster/replyOnFarcaster/validates/create.ts ================================================ import { OnAddPayload, OnCreatePayload, OnLinkPayload, } from "@agent-studio/studio-dnd"; import { farcasterMissionLinkToAllowed } from "../../../shared/validators"; const onAddValidate = (data: OnAddPayload) => { return true; }; const onSnapValidate = () => { return true; }; const onSplitValidate = () => { return true; }; const onMergeValidate = () => { return true; }; const onDropInValidate = () => { return true; }; const onDropOutValidate = () => { return true; }; const onLinkValidate = (data: OnLinkPayload) => { return farcasterMissionLinkToAllowed(data); }; const CREATE_FLOW_FARCASTER_ON_X_VALIDATORS = { onAddValidate, onSnapValidate, onSplitValidate, onMergeValidate, onDropInValidate, onDropOutValidate, onLinkValidate, }; export default CREATE_FLOW_FARCASTER_ON_X_VALIDATORS; ================================================ FILE: agent-studio/packages/studio-app/src/categories/farcaster/replyOnFarcaster/validates/index.ts ================================================ import CREATE_FLOW_FARCASTER_ON_X_VALIDATORS from './create'; import UPDATE_FLOW_REPLY_ON_FARCASTER_VALIDATORS from './update'; const REPLY_ON_FARCASTER_VALIDATES = { create: CREATE_FLOW_FARCASTER_ON_X_VALIDATORS, update: UPDATE_FLOW_REPLY_ON_FARCASTER_VALIDATORS, }; export default REPLY_ON_FARCASTER_VALIDATES; ================================================ FILE: agent-studio/packages/studio-app/src/categories/farcaster/replyOnFarcaster/validates/update.ts ================================================ import { OnAddPayload, OnLinkPayload } from "@agent-studio/studio-dnd"; import { farcasterMissionLinkToAllowed } from "../../../shared/validators"; const onAddValidate = (data: OnAddPayload) => { return true; }; const onSnapValidate = () => { return true; }; const onSplitValidate = () => { return true; }; const onMergeValidate = () => { return true; }; const onDropInValidate = () => { return true; }; const onDropOutValidate = () => { return true; }; const onLinkValidate = (data: OnLinkPayload) => { return farcasterMissionLinkToAllowed(data); }; const UPDATE_FLOW_REPLY_ON_FARCASTER_VALIDATORS = { onAddValidate, onSnapValidate, onSplitValidate, onMergeValidate, onDropInValidate, onDropOutValidate, onLinkValidate, }; export default UPDATE_FLOW_REPLY_ON_FARCASTER_VALIDATORS; ================================================ FILE: agent-studio/packages/studio-app/src/categories/farcaster/styles.module.scss ================================================ .active { --background-color: pink !important; } ================================================ FILE: agent-studio/packages/studio-app/src/categories/new-agent/validates/create.ts ================================================ import { OnAddPayload } from "@agent-studio/studio-dnd"; import { showValidateError } from "../../../utils/toast"; const onAddValidate = (data: OnAddPayload) => { // TODO: Block adding new personality to the root return false; }; const onSnapValidate = () => { showValidateError("The root item cannot be snapped"); return false; }; const onSplitValidate = () => { return false; }; const onMergeValidate = () => { showValidateError("The root item cannot be snapped"); return false; }; const onDropInValidate = () => { return true; }; const onDropOutValidate = () => { return true; }; const CREATE_FLOW_NEW_AGENT_VALIDATORS = { onAddValidate, onSnapValidate, onSplitValidate, onMergeValidate, onDropInValidate, onDropOutValidate, }; export default CREATE_FLOW_NEW_AGENT_VALIDATORS; ================================================ FILE: agent-studio/packages/studio-app/src/categories/new-agent/validates/index.ts ================================================ import CREATE_FLOW_NEW_AGENT_VALIDATORS from './create'; import UPDATE_FLOW_NEW_AGENT_VALIDATORS from './update'; const NEW_AGENT_VALIDATES = { create: CREATE_FLOW_NEW_AGENT_VALIDATORS, update: UPDATE_FLOW_NEW_AGENT_VALIDATORS, }; export default NEW_AGENT_VALIDATES; ================================================ FILE: agent-studio/packages/studio-app/src/categories/new-agent/validates/update.ts ================================================ import { OnAddPayload, OnCreatePayload } from "@agent-studio/studio-dnd"; const onAddValidate = (data: OnAddPayload) => { // TODO: Block adding new personality to the root return false; }; const onSnapValidate = () => { return false; }; const onSplitValidate = () => { return false; }; const onMergeValidate = () => { return false; }; const onDropInValidate = () => { return false; }; const onDropOutValidate = () => { return false; }; const UPDATE_FLOW_NEW_AGENT_VALIDATORS = { onAddValidate, onSnapValidate, onSplitValidate, onMergeValidate, onDropInValidate, onDropOutValidate, }; export default UPDATE_FLOW_NEW_AGENT_VALIDATORS; ================================================ FILE: agent-studio/packages/studio-app/src/categories/persisted-agent.ts ================================================ /* eslint-disable @typescript-eslint/no-unused-vars */ import Dexie, { type EntityTable } from "dexie"; import { StudioDataNode } from "@agent-studio/studio-dnd"; type PersistedAgentItem = { id: string; data: string; createdAt?: string; }; class AgentDatabase { private databaseName = "agent-database"; private db; constructor() { try { this.db = new Dexie(this.databaseName) as Dexie & { agent: EntityTable; }; // for version 1 this.db.version(1).stores({ agent: "id, data, createdAt", }); } catch (e) { // } } public async getItem(id: string) { try { return await this.db?.agent.get(id); } catch (e) { // } return null; } public async getAllItems() { try { return await this.db?.agent.toArray(); } catch (e) { // } return []; } private async addItem(newItem: PersistedAgentItem) { try { await this.db?.agent.add({ ...newItem, createdAt: new Date().toISOString(), }); return newItem; } catch (e) { // } return null; } private async updateItem(updatedItem: PersistedAgentItem) { try { await this.db?.agent.update(updatedItem.id, updatedItem); return updatedItem; } catch (e) { // } return null; } async upsertItem(item: PersistedAgentItem) { try { const persisted = await this.getItem(item.id); if (persisted) { return this.updateItem(item); } else { return this.addItem(item); } } catch (e) { // } return null; } async deleteItem(id: string) { try { await this.db?.agent.delete(id); } catch (e) { // } } } const agentDatabase = new AgentDatabase(); export default agentDatabase; ================================================ FILE: agent-studio/packages/studio-app/src/categories/personalities/ReviewNft.tsx ================================================ import { Flex, Image, Text, Tooltip } from "@chakra-ui/react"; import React from "react"; import { INFTInfo } from "../../types/collection"; import { getImageIPFSCreateAgent } from "../../utils/common"; type Props = { selectedNFT?: INFTInfo; }; const ReviewNft = ({ selectedNFT }: Props) => { if (!selectedNFT?.normalized_metadata?.image) return null; return ( {`${selectedNFT?.name} #${selectedNFT?.token_id}`} } fontSize={"14px"} borderRadius={"8px"} p={"6px 12px"} > View ); }; export default ReviewNft; ================================================ FILE: agent-studio/packages/studio-app/src/categories/personalities/helpers.ts ================================================ import { findAncestorNodeIdOfNodeId, findDataById, findDataByOptionKey, StudioDataNode, updateNodeFormData, } from "@agent-studio/studio-dnd"; import { CATEGORY_OPTION_KEYS } from "../../constants/category-option-keys"; const findRelatedAgentData = (graph: StudioDataNode[], fromNodeId: string) => { const ancestorId = findAncestorNodeIdOfNodeId(graph, fromNodeId); if (ancestorId) { const ancestorData = findDataById(ancestorId, graph); // find agent node if (ancestorData) { return findDataByOptionKey(CATEGORY_OPTION_KEYS.agent.agent_new, [ ancestorData, ]); } } return; }; export const updateRelatedAgentData = ( graph: StudioDataNode[], fromNodeId: string, agentName: string ) => { const agentData = findRelatedAgentData(graph, fromNodeId); if (agentData) { // update agent data agentData.forEach((agent) => { updateNodeFormData(agent.id, { agentName: agentName, }); }); } }; ================================================ FILE: agent-studio/packages/studio-app/src/categories/personalities/import-from-nft/ImportFromNft/CollectionModal/CollectionListView.tsx ================================================ import { Flex, SimpleGrid } from '@chakra-ui/react'; type Props = { dataList: any[]; renderItem: (item: any, index: number) => React.ReactElement | undefined; }; export const CollectionListView = (props: Props) => { const { dataList, renderItem } = props; return ( {dataList.map((item, index) => renderItem(item, index))} ); }; ================================================ FILE: agent-studio/packages/studio-app/src/categories/personalities/import-from-nft/ImportFromNft/CollectionModal/CollectionNFTItem.tsx ================================================ import { Flex, Image, Text } from '@chakra-ui/react'; type Props = { item: any; index?: number; itemOnClick?: (item: any) => void; }; export const CollectionNFTItem = (props: Props) => { const { item, index, itemOnClick } = props; return ( { itemOnClick && itemOnClick(item); }} > {item?.name} ); }; ================================================ FILE: agent-studio/packages/studio-app/src/categories/personalities/import-from-nft/ImportFromNft/CollectionModal/index.tsx ================================================ import { Flex, Modal, ModalBody, ModalCloseButton, ModalContent, ModalOverlay, Text, } from '@chakra-ui/react'; import cs from 'classnames'; import s from './styles.module.scss'; type Props = { isOpen: boolean; onClose: () => void; title?: string; description?: string; dataListView?: React.ReactElement; }; export default function CollectionModal({ isOpen, onClose, title, description, dataListView, }: Props) { return ( {}} > {title} {description} {dataListView} ); } ================================================ FILE: agent-studio/packages/studio-app/src/categories/personalities/import-from-nft/ImportFromNft/CollectionModal/styles.module.scss ================================================ .modalContent { overflow: hidden; } .modalBody { max-height: 800px !important; min-width: 500px; overflow: hidden; } .predictModal__body { display: flex; width: 100%; overflow: hidden; gap: 24px; .predictModal__stats { flex: 0 50%; // width: 50%; overflow: hidden; } .predictModal__prediction { flex: 0 50%; // width: 50%; overflow: hidden; } } ================================================ FILE: agent-studio/packages/studio-app/src/categories/personalities/import-from-nft/ImportFromNft/CollectionThumbItem.tsx ================================================ import { Flex, Text, useDisclosure, Image } from "@chakra-ui/react"; import CollectionModal from "./CollectionModal"; import { CollectionListView } from "./CollectionModal/CollectionListView"; import { CollectionNFTItem } from "./CollectionModal/CollectionNFTItem"; import { useNewStore } from "@agent-studio/studio-dnd"; import { ImportFromNftFormData, ImportFromNftState } from "../types"; import useStudioAgentStore from "../../../../stores/useStudioAgentStore"; import { Collection } from "../../../../types/collection"; type Props = { id: string; formData: ImportFromNftFormData; setFormFields: (fields: Partial) => void; }; export const CollectionThumbItem = ({ id, formData, setFormFields }: Props) => { const { dataStore, addData } = useNewStore(id); const selectedOption = formData.selectedOption as Collection; const { isOpen: isOpenCollectionModal, onOpen: onOpenCollectionModal, onClose: onCloseCollectionModal, } = useDisclosure({ id: "NftCollectionModal" }); const { isDetail } = useStudioAgentStore(); const renderItemContent = () => { return ( {selectedOption?.name} ); }; return ( <> {!selectedOption ? ( Select Collection ) : ( renderItemContent() )} {!isDetail && isOpenCollectionModal && ( { return ( { setFormFields({ selectedOption: item, }); onCloseCollectionModal(); }} /> ); }} /> } /> )} ); }; ================================================ FILE: agent-studio/packages/studio-app/src/categories/personalities/import-from-nft/ImportFromNft/CollectionView.tsx ================================================ import StudioHorizontalField from "../../../../components/form/fields/StudioHorizontalField"; import { ImportFromNftFormData } from "../types"; import { CollectionThumbItem } from "./CollectionThumbItem"; type Props = { id: string; formData: ImportFromNftFormData; setFormFields: (fields: Partial) => void; }; export const CollectionView = ({ id, formData, setFormFields }: Props) => { return ( ); }; ================================================ FILE: agent-studio/packages/studio-app/src/categories/personalities/import-from-nft/ImportFromNft/PersonalityView.tsx ================================================ import StudioVerticalField from "../../../../components/form/fields/StudioVerticalField"; import StudioTextArea from "../../../../components/form/inputs/StudioTextArea"; type Props = { id: string; personality: string; onChange: (v: string) => void; }; export const PersonalityView = ({ id, personality, onChange }: Props) => { // const { isDetail } = useStudioAgentStore(); return ( onChange(e.target.value)} placeholder="Tell us your agent idea, and our AI assistant will bring it to life." /> ); }; export default PersonalityView; ================================================ FILE: agent-studio/packages/studio-app/src/categories/personalities/import-from-nft/ImportFromNft/TokenIdView.tsx ================================================ import StudioHorizontalField from "../../../../components/form/fields/StudioHorizontalField"; import StudioInput from "../../../../components/form/inputs/StudioInput"; import useStudioAgentStore from "../../../../stores/useStudioAgentStore"; import ReviewNft from "../../ReviewNft"; import { ImportFromNftFormData } from "../types"; type Props = { setTokenIdStr: (v: string) => void; tokenIdStr: string; id: string; formData: ImportFromNftFormData; }; export const TokenIdView = ({ id, setTokenIdStr, tokenIdStr, formData, }: Props) => { const { selectedNFT, tokenIdErrorMessage } = formData; const { isDetail } = useStudioAgentStore(); return ( } > setTokenIdStr(e.target.value)} disabled={isDetail} /> ); }; ================================================ FILE: agent-studio/packages/studio-app/src/categories/personalities/import-from-nft/ImportFromNft/index.tsx ================================================ import { StudioCategoryOptionRenderPayload, useNewStore, } from "@agent-studio/studio-dnd"; import { useEffect, useMemo, useState } from "react"; import { updateRelatedAgentData } from "../../helpers"; import { ImportFromNftFormData, ImportFromNftState } from "../types"; import { CollectionView } from "./CollectionView"; import { PersonalityView } from "./PersonalityView"; import { TokenIdView } from "./TokenIdView"; import useStudioAgentStore from "../../../../stores/useStudioAgentStore"; import { useDebounce } from "../../../../hooks/useDebounce"; import useGeneratePersonality from "../../../../hooks/useGeneratePersonality"; import { EIdeaOption } from "../../../../types/agent"; import ResetButton from "../../../../components/buttons/ResetButton"; import SubmitButton from "../../../../components/buttons/SubmitButton"; import CustomRendererBase from "../../../../components/CustomRendererBase"; import StudioFormWrapper from "../../../../components/form"; import { Collection, INFTInfo } from "../../../../types/collection"; import AgentAPI from "../../../../services/apis/agent"; export default function ImportFromNft({ id, formData, setFormFields, resetFormData, data, }: StudioCategoryOptionRenderPayload) { const { addData } = useNewStore(id); const [isLoading, setIsLoading] = useState(false); const [isGettingNFTInfo, setIsGettingNFTInfo] = useState(false); const { stepper } = formData; const selectedNFT = formData.selectedNFT as INFTInfo; const selectedOption = formData.selectedOption as Collection; const { isDetail } = useStudioAgentStore(); const debounceId = useDebounce((formData.tokenId || "") as string, 200); const { generatePersonalityByNFT } = useGeneratePersonality({ onStartGenerating: () => setIsLoading(true), onFinishGenerating: () => setIsLoading(false), }); const getCollections = async (type: EIdeaOption) => { try { const res = await AgentAPI.getNFTCollections({ inscription: type === EIdeaOption.ordinals, limit: type === EIdeaOption.ordinals ? 20 : 100, }); addData({ collections: res?.collections || [], }); } catch (e) { // } }; useEffect(() => { getCollections(EIdeaOption.nft); }, []); const getNftInfo = async () => { try { setFormFields({ selectedNFT: undefined, }); setIsGettingNFTInfo(true); const nft = await AgentAPI.getNFTsByCollection({ contractAddress: selectedOption?.contracts[0]?.address as string, nftId: debounceId, }); setFormFields({ selectedNFT: nft[0], }); if (nft) { if (nft.length > 0) { setFormFields({ selectedNFT: nft[0], tokenIdErrorMessage: undefined, }); } else { setFormFields({ tokenIdErrorMessage: "Can not get NFT info", }); } } } catch (error) { console.error("Error getting NFT info:", error); } finally { setIsGettingNFTInfo(false); } }; useEffect(() => { if (debounceId && selectedOption) { getNftInfo(); } }, [debounceId, selectedOption]); const handleGenerateIdea = async () => { if (isLoading || !selectedNFT) { return; } const { agent, personality } = await generatePersonalityByNFT( selectedNFT, selectedOption ); if (personality) { setFormFields({ personality, stepper: 2, }); } if (agent) { updateRelatedAgentData(data, id, agent.agent_name); } }; const resetOnClickHandler = async () => { resetFormData(); }; const Actions = useMemo(() => { return stepper === 2 ? ( ) : ( ); }, [ stepper, isLoading, isGettingNFTInfo, handleGenerateIdea, resetOnClickHandler, ]); return ( { setFormFields({ tokenId }); if (tokenId) { setFormFields({ selectedNFT: undefined, }); } }} /> {stepper === 2 && ( { setFormFields({ personality }); }} /> )} ); } ================================================ FILE: agent-studio/packages/studio-app/src/categories/personalities/import-from-nft/ImportFromNft/styles.module.scss ================================================ .importFromNft { display: flex; flex-direction: column; gap: 4px; .heading { } } ================================================ FILE: agent-studio/packages/studio-app/src/categories/personalities/import-from-nft/types.ts ================================================ import { Collection, INFTInfo } from "../../../types/collection"; import { IMessageVerifier } from "../../../types/message"; export type ImportFromNftFormData = { stepper: number; selectedOption: Collection | undefined; selectedNFT: INFTInfo | undefined; tokenIdErrorMessage: string | undefined; tokenId: string; personality: string; signData: IMessageVerifier | undefined; }; export type ImportFromNftState = { collections: Collection[]; }; ================================================ FILE: agent-studio/packages/studio-app/src/categories/personalities/import-from-ordinals/CustomRenderer/Fields/CollectionModal/CollectionListView.tsx ================================================ import { Flex, SimpleGrid } from '@chakra-ui/react'; type Props = { dataList: any[]; renderItem: (item: any, index: number) => React.ReactElement | undefined; }; export const CollectionListView = (props: Props) => { const { dataList, renderItem } = props; return ( {dataList.map((item, index) => renderItem(item, index))} ); }; ================================================ FILE: agent-studio/packages/studio-app/src/categories/personalities/import-from-ordinals/CustomRenderer/Fields/CollectionModal/CollectionNFTItem.tsx ================================================ import { Flex, Image, Text } from '@chakra-ui/react'; type Props = { item: any; index?: number; itemOnClick?: (item: any) => void; }; export const CollectionNFTItem = (props: Props) => { const { item, index, itemOnClick } = props; return ( { itemOnClick && itemOnClick(item); }} > {item?.name} ); }; ================================================ FILE: agent-studio/packages/studio-app/src/categories/personalities/import-from-ordinals/CustomRenderer/Fields/CollectionModal/index.tsx ================================================ import { Flex, Modal, ModalBody, ModalCloseButton, ModalContent, ModalOverlay, Text, } from '@chakra-ui/react'; import cs from 'classnames'; import s from './styles.module.scss'; type Props = { isOpen: boolean; onClose: () => void; title?: string; description?: string; dataListView?: React.ReactElement; }; export default function CollectionModal({ isOpen, onClose, title, description, dataListView, }: Props) { return ( {}} > {title} {description} {dataListView} ); } ================================================ FILE: agent-studio/packages/studio-app/src/categories/personalities/import-from-ordinals/CustomRenderer/Fields/CollectionModal/styles.module.scss ================================================ .modalContent { overflow: hidden; } .modalBody { max-height: 800px !important; min-width: 500px; overflow: hidden; } .predictModal__body { display: flex; width: 100%; overflow: hidden; gap: 24px; .predictModal__stats { flex: 0 50%; // width: 50%; overflow: hidden; } .predictModal__prediction { flex: 0 50%; // width: 50%; overflow: hidden; } } ================================================ FILE: agent-studio/packages/studio-app/src/categories/personalities/import-from-ordinals/CustomRenderer/Fields/CollectionThumbItem.tsx ================================================ import { Flex, Image, Text, useDisclosure } from "@chakra-ui/react"; import CollectionModal from "./CollectionModal"; import { CollectionListView } from "./CollectionModal/CollectionListView"; import { CollectionNFTItem } from "./CollectionModal/CollectionNFTItem"; import { ImportFromOrdinalsFormData, ImportFromOrdinalsState, } from "../../types"; import { useNewStore } from "@agent-studio/studio-dnd"; import useStudioAgentStore from "../../../../../stores/useStudioAgentStore"; import { Collection } from "../../../../../types/collection"; type Props = { id: string; formData: ImportFromOrdinalsFormData; setFormFields: (fields: Partial) => void; }; const CollectionThumbItem = ({ id, formData, setFormFields }: Props) => { const { dataStore, addData } = useNewStore(id); const selectedOption = formData.selectedOption as Collection; const { isDetail } = useStudioAgentStore(); const { isOpen: isOpenCollectionModal, onOpen: onOpenCollectionModal, onClose: onCloseCollectionModal, } = useDisclosure({ id: "NftCollectionModal" }); const renderItemContent = () => { return ( {selectedOption?.name} ); }; return ( <> {!selectedOption ? ( Select Collection ) : ( renderItemContent() )} {!isDetail && isOpenCollectionModal && ( { return ( { setFormFields({ selectedOption: item, }); onCloseCollectionModal(); }} /> ); }} /> } /> )} ); }; export default CollectionThumbItem; ================================================ FILE: agent-studio/packages/studio-app/src/categories/personalities/import-from-ordinals/CustomRenderer/Fields/CollectionView.tsx ================================================ import StudioHorizontalField from "../../../../../components/form/fields/StudioHorizontalField"; import { ImportFromOrdinalsFormData } from "../../types"; import CollectionThumbItem from "./CollectionThumbItem"; type Props = { id: string; formData: ImportFromOrdinalsFormData; setFormFields: (fields: Partial) => void; }; const CollectionView = ({ id, formData, setFormFields }: Props) => { return ( ); }; export default CollectionView; ================================================ FILE: agent-studio/packages/studio-app/src/categories/personalities/import-from-ordinals/CustomRenderer/Fields/PersonalityView.tsx ================================================ import StudioVerticalField from "../../../../../components/form/fields/StudioVerticalField"; import StudioTextArea from "../../../../../components/form/inputs/StudioTextArea"; type Props = { id: string; personality: string; onChange: (v: string) => void; }; export const PersonalityView = ({ id, personality, onChange }: Props) => { // const { isDetail } = useStudioAgentStore(); return ( onChange(e.target.value)} placeholder="Tell us your agent idea, and our AI assistant will bring it to life." /> ); }; export default PersonalityView; ================================================ FILE: agent-studio/packages/studio-app/src/categories/personalities/import-from-ordinals/CustomRenderer/Fields/TokenIdView.tsx ================================================ import StudioHorizontalField from "../../../../../components/form/fields/StudioHorizontalField"; import StudioInput from "../../../../../components/form/inputs/StudioInput"; import useStudioAgentStore from "../../../../../stores/useStudioAgentStore"; import ReviewNft from "../../../ReviewNft"; import { ImportFromOrdinalsFormData } from "../../types"; type Props = { setTokenIdStr: (v: string) => void; tokenIdStr: string; id: string; formData: ImportFromOrdinalsFormData; }; export const TokenIdView = ({ id, setTokenIdStr, tokenIdStr, formData, }: Props) => { const { selectedNFT, tokenIdErrorMessage } = formData; const { isDetail } = useStudioAgentStore(); return ( } > setTokenIdStr(e.target.value)} disabled={isDetail} /> ); }; export default TokenIdView; ================================================ FILE: agent-studio/packages/studio-app/src/categories/personalities/import-from-ordinals/CustomRenderer/index.tsx ================================================ import { StudioCategoryOptionRenderPayload, useNewStore, } from "@agent-studio/studio-dnd"; import { useEffect, useMemo, useState } from "react"; import { updateRelatedAgentData } from "../../helpers"; import { ImportFromOrdinalsFormData, ImportFromOrdinalsState } from "../types"; import CollectionView from "./Fields/CollectionView"; import PersonalityView from "./Fields/PersonalityView"; import TokenIdView from "./Fields/TokenIdView"; import useStudioAgentStore from "../../../../stores/useStudioAgentStore"; import { useDebounce } from "../../../../hooks/useDebounce"; import { EIdeaOption } from "../../../../types/agent"; import ResetButton from "../../../../components/buttons/ResetButton"; import SubmitButton from "../../../../components/buttons/SubmitButton"; import CustomRendererBase from "../../../../components/CustomRendererBase"; import StudioFormWrapper from "../../../../components/form"; import { Collection, INFTInfo } from "../../../../types/collection"; import useGeneratePersonality from "../../../../hooks/useGeneratePersonality"; import AgentAPI from "../../../../services/apis/agent"; const CustomImportFromOrdinalsRenderer = ({ id, formData, setFormFields, resetFormData, data, }: StudioCategoryOptionRenderPayload) => { const { dataStore, addData } = useNewStore(id); const [isLoading, setIsLoading] = useState(false); const [isGettingNFTInfo, setIsGettingNFTInfo] = useState(false); const { isDetail } = useStudioAgentStore(); const { stepper } = formData; const selectedNFT = formData.selectedNFT as INFTInfo; const selectedOption = formData.selectedOption as Collection; const debouncedId = useDebounce((formData.tokenId || "") as string, 200); const { generatePersonalityByNFT } = useGeneratePersonality({ onStartGenerating: () => setIsLoading(true), onFinishGenerating: () => setIsLoading(false), }); const getCollections = async (type: EIdeaOption) => { try { const rs = await AgentAPI.getNFTCollections({ inscription: type === EIdeaOption.ordinals, limit: type === EIdeaOption.ordinals ? 20 : 100, }); addData({ collections: rs?.collections || [], }); } catch (e) { // } }; useEffect(() => { getCollections(EIdeaOption.ordinals); }, []); const getNftInfo = async () => { try { setFormFields({ selectedNFT: undefined, }); setIsGettingNFTInfo(true); const nft = await AgentAPI.getNFTsByCollection({ contractAddress: selectedOption?.contracts[0]?.address as string, nftId: debouncedId, inscription: true, }); setFormFields({ selectedNFT: nft[0], }); if (nft) { if (nft.length > 0) { setFormFields({ selectedNFT: nft[0], tokenIdErrorMessage: undefined, }); } else { setFormFields({ tokenIdErrorMessage: "Can not get NFT info", }); } } } catch (error) { console.error("Error getting NFT info:", error); } finally { setIsGettingNFTInfo(false); } }; useEffect(() => { if (debouncedId && selectedOption) { getNftInfo(); } }, [debouncedId, selectedOption]); const handleGenerateIdea = async () => { if (isLoading || !selectedNFT) { return; } const { agent, personality } = await generatePersonalityByNFT( selectedNFT, selectedOption ); if (personality) { setFormFields({ personality, stepper: 2, }); } if (agent) { updateRelatedAgentData(data, id, agent.agent_name); } }; const resetOnClickHandler = async () => { resetFormData(); }; const Actions = useMemo( () => stepper === 2 ? ( ) : ( ), [ stepper, isLoading, isGettingNFTInfo, handleGenerateIdea, resetOnClickHandler, ] ); return ( { setFormFields({ tokenId }); }} /> {stepper === 2 && ( { setFormFields({ personality }); }} /> )} ); }; export default CustomImportFromOrdinalsRenderer; ================================================ FILE: agent-studio/packages/studio-app/src/categories/personalities/import-from-ordinals/CustomRenderer/styles.module.scss ================================================ ================================================ FILE: agent-studio/packages/studio-app/src/categories/personalities/import-from-ordinals/types.ts ================================================ import { Collection, INFTInfo } from "../../../types/collection"; import { IMessageVerifier } from "../../../types/message"; export type ImportFromOrdinalsFormData = { stepper: number; selectedOption: Collection | undefined; selectedNFT: INFTInfo | undefined; tokenIdErrorMessage: string | undefined; tokenId: string; personality: string; signData: IMessageVerifier | undefined; }; export type ImportFromOrdinalsState = { collections: Collection[]; }; ================================================ FILE: agent-studio/packages/studio-app/src/categories/personalities/import-from-token/CustomRenderer/Fields/ContractAddressView.tsx ================================================ import StudioHorizontalField from "../../../../../components/form/fields/StudioHorizontalField"; import StudioInput from "../../../../../components/form/inputs/StudioInput"; import useStudioAgentStore from "../../../../../stores/useStudioAgentStore"; type Props = { id: string; value: string; onChange: (ct: string) => void; }; const ContractAddressView = ({ id, value, onChange }: Props) => { const { isDetail } = useStudioAgentStore(); return ( onChange(e.target.value)} disabled={isDetail} /> ); }; export default ContractAddressView; ================================================ FILE: agent-studio/packages/studio-app/src/categories/personalities/import-from-token/CustomRenderer/Fields/PersonalityView.tsx ================================================ import StudioVerticalField from "../../../../../components/form/fields/StudioVerticalField"; import StudioTextArea from "../../../../../components/form/inputs/StudioTextArea"; type Props = { id: string; value: string; onChange: (ct: string) => void; }; const PersonalityView = ({ id, value, onChange }: Props) => { // const { isDetail } = useStudioAgentStore(); return ( onChange(e.target.value)} placeholder="Tell us your agent idea, and our AI assistant will bring it to life." /> ); }; export default PersonalityView; ================================================ FILE: agent-studio/packages/studio-app/src/categories/personalities/import-from-token/CustomRenderer/Fields/TokenNameView.tsx ================================================ import StudioHorizontalField from "../../../../../components/form/fields/StudioHorizontalField"; import StudioInput from "../../../../../components/form/inputs/StudioInput"; import useStudioAgentStore from "../../../../../stores/useStudioAgentStore"; type Props = { id: string; value: string; onChange: (ct: string) => void; }; const TokenNameView = ({ id, value, onChange }: Props) => { const { isDetail } = useStudioAgentStore(); return ( onChange(e.target.value)} disabled={isDetail} /> ); }; export default TokenNameView; ================================================ FILE: agent-studio/packages/studio-app/src/categories/personalities/import-from-token/CustomRenderer/Fields/TokenSymbolView.tsx ================================================ import StudioHorizontalField from "../../../../../components/form/fields/StudioHorizontalField"; import StudioInput from "../../../../../components/form/inputs/StudioInput"; import useStudioAgentStore from "../../../../../stores/useStudioAgentStore"; type Props = { id: string; value: string; onChange: (ct: string) => void; }; const TokenSymbolView = ({ id, value, onChange }: Props) => { const { isDetail } = useStudioAgentStore(); return ( onChange(e.target.value)} disabled={isDetail} /> ); }; export default TokenSymbolView; ================================================ FILE: agent-studio/packages/studio-app/src/categories/personalities/import-from-token/CustomRenderer/index.tsx ================================================ import { StudioCategoryOptionRenderPayload } from "@agent-studio/studio-dnd"; import { useMemo, useState } from "react"; import { updateRelatedAgentData } from "../../helpers"; import { ImportFromTokenFormData } from "../types"; import ContractAddressView from "./Fields/ContractAddressView"; import PersonalityView from "./Fields/PersonalityView"; import TokenNameView from "./Fields/TokenNameView"; import TokenSymbolView from "./Fields/TokenSymbolView"; import useStudioAgentStore from "../../../../stores/useStudioAgentStore"; import useGeneratePersonality from "../../../../hooks/useGeneratePersonality"; import ResetButton from "../../../../components/buttons/ResetButton"; import SubmitButton from "../../../../components/buttons/SubmitButton"; import CustomRendererBase from "../../../../components/CustomRendererBase"; import StudioFormWrapper from "../../../../components/form"; const CustomImportFromTokenRenderer = ({ id, formData, setFormFields, resetFormData, data, }: StudioCategoryOptionRenderPayload) => { const [isLoading, setIsLoading] = useState(false); const { contractAddressStr, tokenName, tokenSymbol, personality, stepper } = formData; const { isDetail } = useStudioAgentStore(); const { generatePersonalityByToken } = useGeneratePersonality({ onStartGenerating: () => setIsLoading(true), onFinishGenerating: () => setIsLoading(false), }); const handleGenerateIdea = async () => { if (isLoading || !formData.contractAddressStr) { return; } const { agent, personality, tokenInfo } = await generatePersonalityByToken( contractAddressStr as string ); setFormFields({ contractAddressStr: contractAddressStr, tokenName: tokenInfo?.baseToken?.name || "", tokenSymbol: tokenInfo?.baseToken?.symbol || "", tokenImage: tokenInfo?.baseToken?.imageUrl || "", tokenNetwork: tokenInfo?.chainId || "", }); if (personality) { setFormFields({ personality, stepper: 2, }); } if (agent) { updateRelatedAgentData(data, id, agent.agent_name); } }; const resetOnClickHandler = async () => { resetFormData(); // setAgentDetail(undefined); // setIsShowAgentChatInteraction(false); // reset(); }; const Actions = useMemo(() => { return stepper === 2 ? ( ) : ( ); }, [stepper, isLoading, handleGenerateIdea, resetOnClickHandler]); return ( { setFormFields({ contractAddressStr: ct }); }} /> {stepper === 2 && ( <> { setFormFields({ tokenName: ct }); }} /> { setFormFields({ tokenSymbol: ct }); }} /> { setFormFields({ personality: ct }); }} /> )} ); }; export default CustomImportFromTokenRenderer; ================================================ FILE: agent-studio/packages/studio-app/src/categories/personalities/import-from-token/CustomRenderer/styles.module.scss ================================================ ================================================ FILE: agent-studio/packages/studio-app/src/categories/personalities/import-from-token/types.ts ================================================ export type ImportFromTokenFormData = { stepper: number; contractAddressStr: string; tokenName: string; tokenSymbol: string; personality: string; tokenImage: string; tokenNetwork: string; }; ================================================ FILE: agent-studio/packages/studio-app/src/categories/personalities/import-genomics/CustomRenderer/SelectTwitterModal/SelectTwitterModal.module.scss ================================================ .listSearch { // position: absolute; // top: 295px; // left: 24px; width: 100%; // padding: 20px; // box-shadow: 0px 0px 24px -6px #0000001F; // border: 1px solid #E5E7EB; // border-radius: 16px; .nftInfo { display: flex; flex-direction: row; align-items: center; padding: 24px; gap: 12px; background: rgba(0, 82, 255, 0.05); border: 1px solid rgba(0, 82, 255, 0.2); border-radius: 16px; } } ================================================ FILE: agent-studio/packages/studio-app/src/categories/personalities/import-genomics/CustomRenderer/SelectTwitterModal/index.tsx ================================================ import { Box, Button, Flex, FormControl, Image, Input, Text, } from "@chakra-ui/react"; import React, { useState } from "react"; import s from "./SelectTwitterModal.module.scss"; import { useStudio } from "@agent-studio/studio-dnd"; import { ImportGenomicFormData } from "../../types"; import { useDebounce } from "../../../../../hooks/useDebounce"; import { getUrlAvatarTwitter } from "../../../../../utils/twitter"; import AgentAPI from "../../../../../services/apis/agent"; import { useQuery } from "@tanstack/react-query"; type Props = { formId: string; closeModal: () => void; }; const SelectTwitterModal = ({ formId, closeModal }: Props) => { const { getFormDataById, setFormFields } = useStudio(); const { twitterInfos } = getFormDataById(formId); const [values, setValues] = useState(""); const [errorMsg, setErrorMsg] = useState(""); const debounceTwitterUsername = useDebounce(values, 1000); const { data: twitterData, error } = useQuery({ queryKey: ["getTwitterInfo", debounceTwitterUsername], queryFn: () => { return AgentAPI.getTwitterInfo( debounceTwitterUsername.replace(/^@+/, "") as string ); }, }); const styleInput = { height: "48px ", padding: "6px 16px", fontSize: "15px !important", lineHeight: "24px !important", fontFamily: "var(--font-inter) !important", fontWeight: "400 !important", border: "1px solid rgba(255, 255, 255, 0.07)", background: "transparent", borderRadius: "8px", marginBottom: "20px", }; const handleAddTwitter = () => { if (!twitterData || !twitterData[0]) return; if (twitterInfos && twitterInfos.length > 0) { const foundTw = twitterInfos.find( (item) => item?.id === twitterData[0].id ); if (foundTw) { setErrorMsg("This account is already added"); return; } } if (!twitterInfos) { setFormFields(formId, { twitterInfos: [twitterData[0]], }); } else { setFormFields(formId, { twitterInfos: [...twitterInfos, twitterData[0]], }); } closeModal(); }; return ( Pick the DNA of degens, thinkers, and Twitter’s most fascinating personalities to craft your clone! { setValues(e.target.value); setErrorMsg(""); }} style={{ ...styleInput, border: `1px solid ${!!error ? "#ff4747" : "#e5e7eb"}`, }} /> {errorMsg && ( {errorMsg} )} {twitterData && twitterData[0] && ( handleAddTwitter()} > {twitterData[0].name} @{twitterData[0].username} )} Note: {" "} Each DNA sequence costs 300 EAI, and the cloning might take a few hours. ); }; export default SelectTwitterModal; ================================================ FILE: agent-studio/packages/studio-app/src/categories/personalities/import-genomics/CustomRenderer/TwitterCloneTube/index.tsx ================================================ import { Box, Button, Modal, ModalContent, ModalOverlay, } from "@chakra-ui/react"; import { useState } from "react"; import SelectTwitterModal from "../SelectTwitterModal"; import { useStudio } from "@agent-studio/studio-dnd"; import { ImportGenomicFormData } from "../../types"; import TwitterClonedView from "../TwitterClonedView"; import useStudioAgentStore from "../../../../../stores/useStudioAgentStore"; import { ISearchTwitterInfo } from "../../../../../types/agent"; type Props = { formId: string; }; const TwitterCloneTube = ({ formId }: Props) => { const { getFormDataById, setFormFields } = useStudio(); const { twitterInfos } = getFormDataById(formId); const { isDetail } = useStudioAgentStore(); const [showTwModal, setShowTwModal] = useState(false); const handleDeleteTwitter = (twInfo: ISearchTwitterInfo) => { if (isDetail) return; if (!twInfo) return; if (twitterInfos) { const foundTw = twitterInfos.find((item) => item?.id === twInfo?.id); const filteredTw = twitterInfos.filter( (item) => item?.id !== foundTw?.id ); setFormFields(formId, { twitterInfos: [...filteredTw], }); } }; return (
{twitterInfos?.map((twInfo) => ( ))} {!isDetail && ( <> {/* Modal */} setShowTwModal(false)} size={"xl"} isCentered > setShowTwModal(false)} /> )}
); }; export default TwitterCloneTube; ================================================ FILE: agent-studio/packages/studio-app/src/categories/personalities/import-genomics/CustomRenderer/TwitterClonedView/index.tsx ================================================ import { Flex, Text, Image, Box } from "@chakra-ui/react"; import SvgInset from "../../../../../components/SvgInset"; import useStudioAgentStore from "../../../../../stores/useStudioAgentStore"; import { ISearchTwitterInfo } from "../../../../../types/agent"; import { getUrlAvatarTwitter } from "../../../../../utils/twitter"; type Props = { info: ISearchTwitterInfo; handleDeleteTwitter: (info: ISearchTwitterInfo) => void; }; const CloseIcon = (props: React.ComponentPropsWithRef<"div">) => { return ( ); }; function TwitterClonedView({ info, handleDeleteTwitter }: Props) { const { isDetail } = useStudioAgentStore(); return ( {!isDetail && handleDeleteTwitter(info)} />} {info?.name} @{info?.username} ); } export default TwitterClonedView; ================================================ FILE: agent-studio/packages/studio-app/src/categories/personalities/import-genomics/CustomRenderer/index.tsx ================================================ import TwitterCloneTube from "./TwitterCloneTube"; import { StudioCategoryOptionRenderPayload } from "@agent-studio/studio-dnd"; import { ImportGenomicFormData } from "../types"; import CustomRendererBase from "../../../../components/CustomRendererBase"; import useStudioAgentStore from "../../../../stores/useStudioAgentStore"; import StudioFormWrapper from "../../../../components/form"; function ImportGenomic({ id, }: StudioCategoryOptionRenderPayload) { const { isDetail } = useStudioAgentStore(); return ( ); } export default ImportGenomic; ================================================ FILE: agent-studio/packages/studio-app/src/categories/personalities/import-genomics/CustomRenderer/styles.module.scss ================================================ ================================================ FILE: agent-studio/packages/studio-app/src/categories/personalities/import-genomics/types.ts ================================================ import { ISearchTwitterInfo } from "../../../types/agent"; export type ImportGenomicFormData = { twitterInfos?: ISearchTwitterInfo[]; }; ================================================ FILE: agent-studio/packages/studio-app/src/categories/personalities/knowledge/CustomRenderer/Fields/DescriptionView.tsx ================================================ import StudioHorizontalField from "../../../../../components/form/fields/StudioHorizontalField"; import StudioInput from "../../../../../components/form/inputs/StudioInput"; import useStudioAgentStore from "../../../../../stores/useStudioAgentStore"; type Props = { id: string; value: string; onChange: (ct: string) => void; }; const DescriptionView = ({ id, value, onChange }: Props) => { const { isDetail } = useStudioAgentStore(); return ( onChange(e.target.value)} disabled={isDetail} /> ); }; export default DescriptionView; ================================================ FILE: agent-studio/packages/studio-app/src/categories/personalities/knowledge/CustomRenderer/Fields/NameView.tsx ================================================ import StudioHorizontalField from "../../../../../components/form/fields/StudioHorizontalField"; import StudioInput from "../../../../../components/form/inputs/StudioInput"; import useStudioAgentStore from "../../../../../stores/useStudioAgentStore"; type Props = { id: string; value: string; onChange: (ct: string) => void; }; const NameView = ({ id, value, onChange }: Props) => { const { isDetail } = useStudioAgentStore(); return ( onChange(e.target.value)} disabled={isDetail} /> ); }; export default NameView; ================================================ FILE: agent-studio/packages/studio-app/src/categories/personalities/knowledge/CustomRenderer/Fields/UploadFile/ListFiles/index.tsx ================================================ import { Box, Flex, Text } from "@chakra-ui/react"; import s from "./styles.module.scss"; import NumberCounter from "../../../../../../../components/NumberCounter"; import { prettyPrintBytes } from "../../../../../../../utils/file"; export interface IProps { fileUpload?: File[]; fileUploading: { id: number; progress: number; }; } const ListFiles: React.FC = ({ fileUpload, fileUploading }: IProps) => { const renderStatus = (index: number) => { if (index < fileUploading?.id) { return Uploaded; } if (fileUploading?.id === index) { if (fileUploading?.progress === 1) { return Uploaded; } return ( Uploading ( %) ); } return Pending; }; if (!fileUpload || fileUpload?.length < 1) return null; return ( {fileUpload?.map((file: File, index: number) => { return ( {file?.name} ({prettyPrintBytes(file?.size)}) {!!fileUploading && ( {renderStatus(index)} )} ); })} ); }; export default ListFiles; ================================================ FILE: agent-studio/packages/studio-app/src/categories/personalities/knowledge/CustomRenderer/Fields/UploadFile/ListFiles/styles.module.scss ================================================ .listFiles { flex-direction: column; gap: 8px; } .item { align-items: center; justify-content: space-between; border-radius: 12px; border: 1px solid #E5E7EB; background: #F8F9FA; padding: 6px 16px; } .name { max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #5400FB; font-size: 15px; font-style: normal; font-weight: 500; line-height: 24px; } .size { color: #898989; font-size: 15px; font-style: normal; font-weight: 500; line-height: 24px; } ================================================ FILE: agent-studio/packages/studio-app/src/categories/personalities/knowledge/CustomRenderer/Fields/UploadFile/index.tsx ================================================ import { Flex, Image, ListItem, UnorderedList } from '@chakra-ui/react'; import cs from 'classnames'; import { useState } from 'react'; import { FileUploader } from 'react-drag-drop-files'; import s from './styles.module.scss'; export interface IProps { acceptedFileType?: Array; fileOrFiles?: File[] | null; labelText: string; maxSize: number; onChange: (files: FileList) => void; multiple?: boolean; disabled?: boolean; } const UploadFile: React.FC = ({ acceptedFileType, fileOrFiles, labelText, maxSize, onChange, multiple = false, disabled = false, }: IProps) => { const [file, setFile] = useState(null); const [error, setError] = useState(null); const onChangeFile = (file: FileList): void => { setFile(file); setError(''); onChange(file); }; const onSizeError = (): void => { setError(`File size error.`); }; const onTypeError = (): void => { setError('Invalid file extension.'); }; return (

{labelText}

{acceptedFileType && ( Supported file extensions are {acceptedFileType.join(', ')}. )}
); }; export default UploadFile; ================================================ FILE: agent-studio/packages/studio-app/src/categories/personalities/knowledge/CustomRenderer/Fields/UploadFile/styles.module.scss ================================================ .dropFile { width: 100%; text-align: center; position: relative; border-radius: 12px; border: 1px dashed #95a4fc; background: #f2f5fa; .dropZone { margin: 0; padding: 12px 24px; width: 100%; height: 100%; text-align: center; cursor: pointer; } .dropZoneThumbnail { display: inline-block; } .dropZoneDescription { color: #000; text-align: center; font-size: 15px; font-style: normal; font-weight: 400; line-height: 24px; opacity: 0.6; } &__drag { background-color: #e5ecf6; } &__error { border: 1px solid #ff4747; } .errorText { color: #ff4747; } .loadingWrapper { position: absolute; top: 0; left: 0; bottom: 0; right: 0; background: rgb(255 255 255 / 20%); backdrop-filter: blur(16px); display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 16px; .loadingIndicatorWrapper { position: relative; height: 56px; width: 56px; } .loadingText { font-weight: 500; font-size: 16px; line-height: 26px; color: #0006; } } } .uploadFile_description { margin-top: 8px; color: #000; font-size: 12px; font-style: normal; font-weight: 400; line-height: 22px; opacity: 0.6; li { text-align: left; } } ================================================ FILE: agent-studio/packages/studio-app/src/categories/personalities/knowledge/CustomRenderer/index.tsx ================================================ import { Box, Flex } from "@chakra-ui/react"; import { StudioCategoryOptionRenderPayload } from "@agent-studio/studio-dnd"; import { KnowledgeFormData } from "../types"; import NameView from "./Fields/NameView"; import DescriptionView from "./Fields/DescriptionView"; import UploadFile from "./Fields/UploadFile"; import ListFiles from "./Fields/UploadFile/ListFiles"; import { useEffect, useState } from "react"; import useStudioAgentStore from "../../../../stores/useStudioAgentStore"; import { showValidateError } from "../../../../utils/toast"; import CustomRendererBase from "../../../../components/CustomRendererBase"; import StudioFormWrapper from "../../../../components/form"; import ResetButton from "../../../../components/buttons/ResetButton"; import SubmitButton from "../../../../components/buttons/SubmitButton"; import FileAPI from "../../../../services/apis/file"; const CustomKnowledgeRenderer = ({ id, formData, setFormFields, resetFormData, }: StudioCategoryOptionRenderPayload) => { const [isLoading, setIsLoading] = useState(false); const { name, description, fileUpload, stepper } = formData; const { isDetail } = useStudioAgentStore(); const [fileUploading, setFileUploading] = useState(null); const [listFileUploadingTemp, setListFileUploadingTemp] = useState([]); useEffect(() => { if (fileUpload && fileUpload?.length > 0) { setListFileUploadingTemp([...fileUpload]); } }, fileUpload); const isValidateForm = (): boolean => { if (!formData.name) { showValidateError("Knowledge name is required"); return false; } if (!formData.description) { showValidateError("Knowledge description is required"); return false; } if (listFileUploadingTemp?.length < 1) { showValidateError("Please upload at least one file"); return false; } return true; }; const asyncIterableFileUpload = async function* () { for await (const [index, file] of listFileUploadingTemp.entries()) { const uploadSize = 10_000_000; const url = await FileAPI.uploadFile( { file: file, }, uploadSize, () => {}, (process) => { setFileUploading({ id: index, progress: process.progress, }); } ); if (!url) return; yield { name: file.name, size: file.size, url, }; } }; const handleUploadFilesToCloud = async () => { if (isLoading || isValidateForm() === false) { return; } try { setIsLoading(true); (Array as any) .fromAsync(asyncIterableFileUpload() as any) .then(async (urls: any) => { console.log(urls); setFormFields({ stepper: 2, name: name as string, description: description as string, fileUpload: urls, }); }); } catch (error) { console.error("Error uploading files:", error); } finally { setIsLoading(false); } }; const resetOnClickHandler = async () => { resetFormData(); setListFileUploadingTemp([]); }; return ( { setFormFields({ name: value }); }} /> { setFormFields({ description: value }); }} /> {stepper !== 2 && ( <> { const fileArr = Object.values(file); if (!listFileUploadingTemp) { setListFileUploadingTemp(fileArr); return; } setListFileUploadingTemp([ ...listFileUploadingTemp, ...fileArr, ]); }} fileOrFiles={listFileUploadingTemp} acceptedFileType={[ "asciidoc", "md", "docx", "html", "pdf", "pptx", "xlsx", "xml_pubmed", "xml_uspto", ]} /> )} {!isDetail && ( {stepper === 2 ? ( ) : ( )} )} ); }; export default CustomKnowledgeRenderer; ================================================ FILE: agent-studio/packages/studio-app/src/categories/personalities/knowledge/CustomRenderer/styles.module.scss ================================================ ================================================ FILE: agent-studio/packages/studio-app/src/categories/personalities/knowledge/types.ts ================================================ export type KnowledgeFormData = { stepper: number; name: string; description: string; fileUpload: any; }; ================================================ FILE: agent-studio/packages/studio-app/src/categories/personalities/knowledge/validates/create.ts ================================================ import { findDataByCategoryKey, findDataById, OnAddPayload, OnCreatePayload, OnMergePayload, OnSnapPayload, StudioDataNode, StudioNode, } from "@agent-studio/studio-dnd"; import { onlyOptionSameCategoryInTree } from "../../../shared/validators"; import { CATEGORY_OPTION_KEYS } from "../../../../constants/category-option-keys"; import { SUPPORT_NETWORKS } from "../../../../constants/networks"; import { BLOCKCHAIN_CATEGORY_KEY } from "../../../../constants/category-keys"; import { NETWORK_SUPPORT_FOR_KNOWLEDGE_AGENT } from "../../../../constants/validates"; import { showValidateError } from "../../../../utils/toast"; const validateNetworkForKnowledge = ( toNode: StudioNode, data: StudioDataNode[], personality: string ) => { try { if ( personality !== CATEGORY_OPTION_KEYS.personalities.personality_knowledge ) { return true; } const targetData = findDataById(toNode.id, data); if (!targetData) { return true; } const networks = findDataByCategoryKey(BLOCKCHAIN_CATEGORY_KEY, [ targetData, ]); if (networks?.length) { const network = networks[0]; if (network) { const chainId = network?.data?.chainId as SUPPORT_NETWORKS; if (chainId) { const isSupported = NETWORK_SUPPORT_FOR_KNOWLEDGE_AGENT.includes(chainId); if (!isSupported) { showValidateError("Network doesn't support knowledge agent"); } return isSupported; } } } } catch (e) { // } return true; }; const onAddValidate = (data: OnAddPayload) => { if (!onlyOptionSameCategoryInTree(data)) { return false; } if (!validateNetworkForKnowledge(data.toNode, data.data, data.option.idx)) { return false; } return true; }; const onSnapValidate = (data: OnSnapPayload) => { if (!onlyOptionSameCategoryInTree(data)) { return false; } if (!validateNetworkForKnowledge(data.toNode, data.data, data.option.idx)) { return false; } return true; }; const onSplitValidate = () => { return true; }; const onMergeValidate = (data: OnMergePayload) => { if (!onlyOptionSameCategoryInTree(data)) { return false; } if (!validateNetworkForKnowledge(data.toNode, data.data, data.option.idx)) { return false; } return true; }; const onDropInValidate = (data: OnCreatePayload) => { return true; }; const onDropOutValidate = () => { return true; }; export const CREATE_KNOWLEDGE_VALIDATORS = { onAddValidate, onSnapValidate, onSplitValidate, onMergeValidate, onDropInValidate, onDropOutValidate, }; ================================================ FILE: agent-studio/packages/studio-app/src/categories/personalities/knowledge/validates/index.ts ================================================ import { CREATE_KNOWLEDGE_VALIDATORS } from './create'; import UPDATE_KNOWLEDGE_VALIDATORS from './update'; const KNOWLEDGE_VALIDATES = { create: CREATE_KNOWLEDGE_VALIDATORS, update: UPDATE_KNOWLEDGE_VALIDATORS, }; export default KNOWLEDGE_VALIDATES; ================================================ FILE: agent-studio/packages/studio-app/src/categories/personalities/knowledge/validates/update.ts ================================================ import { OnAddPayload, OnLinkPayload, OnSnapPayload, OnMergePayload, OnCreatePayload, } from "@agent-studio/studio-dnd"; import { onlyOptionSameCategoryInTree } from "../../../shared/validators"; const onAddValidate = (data: OnAddPayload) => { return onlyOptionSameCategoryInTree(data); }; const onSnapValidate = (data: OnSnapPayload) => { return onlyOptionSameCategoryInTree(data); }; const onSplitValidate = () => { return true; }; const onMergeValidate = (data: OnMergePayload) => { return onlyOptionSameCategoryInTree(data); }; const onDropInValidate = (data: OnCreatePayload) => { return true; }; const onDropOutValidate = () => { return true; }; const onLinkValidate = (data: OnLinkPayload) => { return true; }; const UPDATE_KNOWLEDGE_VALIDATORS = { onAddValidate, onSnapValidate, onSplitValidate, onMergeValidate, onDropInValidate, onDropOutValidate, onLinkValidate, }; export default UPDATE_KNOWLEDGE_VALIDATORS; ================================================ FILE: agent-studio/packages/studio-app/src/categories/personalities/new-personality/NewPersonality/index.tsx ================================================ import { StudioCategoryOptionRenderPayload } from "@agent-studio/studio-dnd"; import { useEffect, useMemo, useState } from "react"; import { updateRelatedAgentData } from "../../helpers"; import { NewPersonalityFormData } from "../types"; import s from "./styles.module.scss"; import { Button, Flex } from "@chakra-ui/react"; import useStudioAgentStore from "../../../../stores/useStudioAgentStore"; import useGeneratePersonality from "../../../../hooks/useGeneratePersonality"; import { findParentById } from "../../../../utils/process"; import SubmitButton from "../../../../components/buttons/SubmitButton"; import CustomRendererBase from "../../../../components/CustomRendererBase"; import StudioVerticalField from "../../../../components/form/fields/StudioVerticalField"; import StudioTextArea from "../../../../components/form/inputs/StudioTextArea"; export default function NewPersonality({ id, formData, setFormFields, data, }: StudioCategoryOptionRenderPayload) { const [isLoading, setIsLoading] = useState(false); const { stepper, originalText, personality: personalityValue } = formData; const { isDetail, setSimulatePrompt, simulatePrompt } = useStudioAgentStore(); const { generatePersonalityByIdea } = useGeneratePersonality({ onStartGenerating: () => setIsLoading(true), onFinishGenerating: () => setIsLoading(false), }); const isActive = useMemo(() => { return simulatePrompt?.id.includes(id); }, [simulatePrompt]); useEffect(() => { if (personalityValue) { setFormFields({ stepper: 2, }); } else { setFormFields({ stepper: 1, }); } }, []); const handleGenerateIdea = async () => { if (isLoading || !personalityValue) { return; } let text; console.log("@JACKIE", stepper); if (stepper === 1) { text = personalityValue; console.log("@JACKIE", personalityValue); setFormFields({ originalText: personalityValue as string, }); } else { console.log("@JACKIE2", originalText); text = originalText; } console.log("[GenerateIdea] text => ", text); const { agent, personality } = await generatePersonalityByIdea(text); if (personality) { setFormFields({ personality, stepper: 2, }); } if (agent) { updateRelatedAgentData(data, id, agent.agent_name); } }; const handleSelectSystemPrompt = () => { const dataObj = findParentById(data, id); const prompt = { id: [id], personality: personalityValue, simulate_type: "chat", agent_name: dataObj?.data?.agentName || "Agent", }; setSimulatePrompt(prompt); }; const Actions = useMemo( () => ( {!!personalityValue && ( )} ), [stepper, isLoading, handleGenerateIdea] ); return (
{ setFormFields({ personality: e.target.value }); }} placeholder="Tell us your agent idea, and our AI assistant will bring it to life." />
); } ================================================ FILE: agent-studio/packages/studio-app/src/categories/personalities/new-personality/NewPersonality/styles.module.scss ================================================ .newPersonality { display: flex; flex-direction: column; gap: 4px; } .active { --background-color: pink !important; } ================================================ FILE: agent-studio/packages/studio-app/src/categories/personalities/new-personality/types.ts ================================================ export type NewPersonalityFormData = { originalText: string; stepper: number; personality: string; }; ================================================ FILE: agent-studio/packages/studio-app/src/categories/personalities/validates/create.ts ================================================ import { findDataByCategoryKey, findDataById, OnAddPayload, OnCreatePayload, OnMergePayload, OnSnapPayload, StudioDataNode, StudioNode, } from "@agent-studio/studio-dnd"; import { onlyOptionSameCategoryInTree } from "../../shared/validators"; const onAddValidate = (data: OnAddPayload) => { if (!onlyOptionSameCategoryInTree(data)) { return false; } return true; }; const onSnapValidate = (data: OnSnapPayload) => { if (!onlyOptionSameCategoryInTree(data)) { return false; } return true; }; const onSplitValidate = () => { return true; }; const onMergeValidate = (data: OnMergePayload) => { if (!onlyOptionSameCategoryInTree(data)) { return false; } return true; }; const onDropInValidate = (data: OnCreatePayload) => { return true; }; const onDropOutValidate = () => { return true; }; export const CREATE_PERSONALITY = { onAddValidate, onSnapValidate, onSplitValidate, onMergeValidate, onDropInValidate, onDropOutValidate, }; ================================================ FILE: agent-studio/packages/studio-app/src/categories/personalities/validates/index.ts ================================================ import { CREATE_PERSONALITY } from './create'; import { UPDATE_PERSONALITY } from './update'; export const PERSONALITIES_VALIDATES = { create: CREATE_PERSONALITY, update: UPDATE_PERSONALITY, }; ================================================ FILE: agent-studio/packages/studio-app/src/categories/personalities/validates/update.ts ================================================ import { OnAddPayload, OnCreatePayload, OnMergePayload, OnSnapPayload, } from "@agent-studio/studio-dnd"; import { onlyOptionSameCategoryInTree } from "../../shared/validators"; const onAddValidate = (data: OnAddPayload) => { return onlyOptionSameCategoryInTree(data); }; const onSnapValidate = (data: OnSnapPayload) => { return onlyOptionSameCategoryInTree(data); }; const onSplitValidate = () => { return true; }; const onMergeValidate = (data: OnMergePayload) => { return onlyOptionSameCategoryInTree(data); }; const onDropInValidate = (data: OnCreatePayload) => { return true; }; const onDropOutValidate = () => { return true; }; export const UPDATE_PERSONALITY = { onAddValidate, onSnapValidate, onSplitValidate, onMergeValidate, onDropInValidate, onDropOutValidate, }; ================================================ FILE: agent-studio/packages/studio-app/src/categories/shared/CustomRendererNoInput/index.tsx ================================================ import { Flex, Text } from "@chakra-ui/react"; import { StudioCategoryOption } from "@agent-studio/studio-dnd"; import React from "react"; import TextRender, { convertToReactNode } from "../../../components/TextRender"; import IconRenderer from "../../../components/IconRenderer"; import { TextStyleMap } from "../../../components/form/styles"; type Props = StudioCategoryOption & { prefix?: React.ReactNode; postfix?: React.ReactNode; }; const CustomRendererNoInput = ({ icon, title, prefix, postfix }: Props) => { const processedTitle = convertToReactNode(title); return ( {prefix ? <>{prefix} : ""} {processedTitle} {postfix ? <> {postfix} : ""} } {...TextStyleMap.SIDEBAR_CATEGORY_OPTION_LABEL_STYLE} /> ); }; export default CustomRendererNoInput; ================================================ FILE: agent-studio/packages/studio-app/src/categories/shared/validators/index.ts ================================================ import { getOptionNodesExistInNode, getOptionNodesSameCategoryExistInNode, OnLinkPayload, StudioCategoryOption, StudioNode, } from "@agent-studio/studio-dnd"; import { showValidateError } from "../../../utils/toast"; import { CATEGORY_OPTION_KEYS } from "../../../constants/category-option-keys"; export const onlyOptionSameCategoryInTree = (data: { toNode: StudioNode; option: StudioCategoryOption; }) => { const { toNode, option } = data; if (!toNode) { showValidateError("Cannot add new personality to the root"); return false; } const optionNodesExistInToNode = getOptionNodesExistInNode( toNode.id, option.idx ); if (optionNodesExistInToNode.length) { showValidateError("This option already exist"); return false; } const optionNodesSameCategoryInToNode = getOptionNodesSameCategoryExistInNode( toNode.id, option.idx ); if (optionNodesSameCategoryInToNode.length) { showValidateError("This option same category already exist"); return false; } return true; }; const ALL_MISSIONS = [ ...Object.values(CATEGORY_OPTION_KEYS.missionOnX), ...Object.values(CATEGORY_OPTION_KEYS.missionOnFarcaster), ...Object.values(CATEGORY_OPTION_KEYS.missionOnDefi), ]; export const xMissionLinkToAllowed = ({ toNode }: OnLinkPayload) => { if (ALL_MISSIONS.includes(toNode.data.metadata.idx)) { showValidateError("Cannot link to mission"); return false; } return true; }; export const farcasterMissionLinkToAllowed = ({ toNode }: OnLinkPayload) => { if (ALL_MISSIONS.includes(toNode.data.metadata.idx)) { showValidateError("Cannot link to mission"); return false; } return true; }; export const defiMissionLinkToAllowed = ({ toNode }: OnLinkPayload) => { if (ALL_MISSIONS.includes(toNode.data.metadata.idx)) { showValidateError("Cannot link to mission"); return false; } return true; }; ================================================ FILE: agent-studio/packages/studio-app/src/categories/tokens/CustomRenderer/index.tsx ================================================ import { StudioCategoryOptionRenderPayload } from "@agent-studio/studio-dnd"; import CustomRendererNoInput from "../../shared/CustomRendererNoInput"; import StudioFieldTooltip from "../../../components/form/fields/StudioFieldTooltip"; function CustomTokenRendererOnBoard(props: StudioCategoryOptionRenderPayload) { // return ; return ( ) : ( <> ) } /> ); } export default CustomTokenRendererOnBoard; ================================================ FILE: agent-studio/packages/studio-app/src/categories/tokens/validates/create.ts ================================================ import { OnAddPayload, OnCreatePayload, OnMergePayload, OnSnapPayload, } from "@agent-studio/studio-dnd"; import { onlyOptionSameCategoryInTree } from "../../shared/validators"; const onAddValidate = (data: OnAddPayload) => { return onlyOptionSameCategoryInTree(data); }; const onSnapValidate = (data: OnSnapPayload) => { return onlyOptionSameCategoryInTree(data); }; const onSplitValidate = () => { return true; }; const onMergeValidate = (data: OnMergePayload) => { return onlyOptionSameCategoryInTree(data); }; const onDropInValidate = (data: OnCreatePayload) => { return true; }; const onDropOutValidate = () => { return true; }; export const CREATE_TOKEN = { onAddValidate, onSnapValidate, onSplitValidate, onMergeValidate, onDropInValidate, onDropOutValidate, }; ================================================ FILE: agent-studio/packages/studio-app/src/categories/tokens/validates/index.ts ================================================ import { CREATE_TOKEN } from './create'; import { UPDATE_TOKEN } from './update'; export const TOKEN_VALIDATES = { create: CREATE_TOKEN, update: UPDATE_TOKEN, }; ================================================ FILE: agent-studio/packages/studio-app/src/categories/tokens/validates/update.ts ================================================ import { OnAddPayload, OnCreatePayload, OnMergePayload, OnSnapPayload, } from "@agent-studio/studio-dnd"; import { onlyOptionSameCategoryInTree } from "../../shared/validators"; const onAddValidate = (data: OnAddPayload) => { return onlyOptionSameCategoryInTree(data); }; const onSnapValidate = (data: OnSnapPayload) => { return onlyOptionSameCategoryInTree(data); }; const onSplitValidate = () => { return true; }; const onMergeValidate = (data: OnMergePayload) => { return onlyOptionSameCategoryInTree(data); }; const onDropInValidate = (data: OnCreatePayload) => { return false; }; const onDropOutValidate = () => { return false; }; export const UPDATE_TOKEN = { onAddValidate, onSnapValidate, onSplitValidate, onMergeValidate, onDropInValidate, onDropOutValidate, }; ================================================ FILE: agent-studio/packages/studio-app/src/categories/x/engageOnX/CustomRenderer/Fields/AiModelField.tsx ================================================ import { StudioDataNode } from "@agent-studio/studio-dnd"; import { useEffect, useMemo } from "react"; import useStudioAgentStore from "../../../../../stores/useStudioAgentStore"; import { useDetectChainIdForMissionModel } from "../../../../../hooks/useDetectChainIdForMissionModel"; import { tokens } from "../../../../../constants/tokens"; import { compareString } from "../../../../../utils/string"; import { RenameModels } from "../../../../../constants/models"; import StudioHorizontalField from "../../../../../components/form/fields/StudioHorizontalField"; import StudioDropdown from "../../../../../components/form/inputs/StudioDropdown"; import useCommonStore from "../../../../../stores/useCommonStore"; type Props = { id: string; value: string; onChange: (v: string, name: string) => void; data: StudioDataNode[]; }; const AiModelField = ({ id, value, onChange, data }: Props) => { const { isDetail } = useStudioAgentStore(); const chains = useCommonStore((state) => state.chains); const chainId = useDetectChainIdForMissionModel(id); const options = useMemo(() => { try { const matchedToken = tokens.find((v) => compareString(v.id, chainId)); const selectedChain = chains?.find((v) => compareString(v.chain_id, matchedToken?.chainId) ); if (selectedChain?.support_model_names) { return Object.entries(selectedChain.support_model_names).map( (item) => ({ label: RenameModels?.[item[0] as any] || item[0], value: item[1], extraData: item, }) ); } } catch (e) { /// } return []; }, [chainId]); useEffect(() => { if (!isDetail) { if (chainId) { if (options?.length && value) { const option = options.find((item) => item.value === value) || options[0]; if (option) { onChange(option.value, option.extraData[0] as string); } } else { const option = options[0]; if (option) { onChange(option.value, option.extraData[0] as string); } } } else { onChange("", ""); } } }, [chainId, options?.length, value]); return ( { const option = options.find((v) => v.value === id); if (option) { onChange(id as string, option.extraData[0] as string); } }} placeholder="AI Model" options={options} /> ); }; export default AiModelField; ================================================ FILE: agent-studio/packages/studio-app/src/categories/x/engageOnX/CustomRenderer/Fields/DetailsField.tsx ================================================ import StudioVerticalField from "../../../../../components/form/fields/StudioVerticalField"; import StudioTextArea from "../../../../../components/form/inputs/StudioTextArea"; type Props = { id: string; value: string; onChange: (v: string) => void; }; const DetailsField = ({ id, value, onChange }: Props) => { return ( onChange(e.target.value)} placeholder="Enter your detailed instructions here" /> ); }; export default DetailsField; ================================================ FILE: agent-studio/packages/studio-app/src/categories/x/engageOnX/CustomRenderer/Fields/FrequencyField.tsx ================================================ import StudioHorizontalField from "../../../../../components/form/fields/StudioHorizontalField"; import StudioInput from "../../../../../components/form/inputs/StudioInput"; type Props = { id: string; value: string; onChange: (v: string) => void; }; const FrequencyField = ({ id, value, onChange }: Props) => { return ( onChange(e.target.value)} placeholder="e.g 2" /> ); }; export default FrequencyField; ================================================ FILE: agent-studio/packages/studio-app/src/categories/x/engageOnX/CustomRenderer/index.tsx ================================================ import { StudioCategoryOptionRenderPayload } from "@agent-studio/studio-dnd"; import DetailsField from "./Fields/DetailsField"; import FrequencyField from "./Fields/FrequencyField"; import { EngageOnXFormData } from "../types"; import s from "../../styles.module.scss"; import { useEffect, useMemo } from "react"; import { Button, Flex } from "@chakra-ui/react"; import AiModelField from "./Fields/AiModelField"; import useStudioAgentStore from "../../../../stores/useStudioAgentStore"; import { findById, findParentById, findPersonalityObj, } from "../../../../utils/process"; import { showError } from "../../../../utils/toast"; import CustomRendererBase from "../../../../components/CustomRendererBase"; import StudioFormWrapper from "../../../../components/form"; const CustomEngageOnXRenderer = ({ id, formData, data, setFormFields, }: StudioCategoryOptionRenderPayload) => { const { frequency, details, model } = formData; const { setSimulatePrompt, simulatePrompt } = useStudioAgentStore(); const isActive = useMemo(() => { return simulatePrompt?.id.includes(id); }, [simulatePrompt]); const handleSelectMissionPrompt = () => { const result = findById(data, id); const parentObj = findParentById(data, id); const personalityObj = findPersonalityObj(data, parentObj); if (!result) { showError({ message: "Unable to find the selected prompt", }); return; } if (!personalityObj) { showError({ message: "Personality not found. Please connect the prompt to a personality", }); return; } setSimulatePrompt({ id: [personalityObj.id, result.id], personality: personalityObj?.data?.personality, simulate_prompt: result.data.details, simulate_type: result.idx, }); }; return (
{ setFormFields({ model: id, modelName: name }); }} data={data} /> { setFormFields({ frequency: v }); }} /> { setFormFields({ details: v }); }} />
); }; export default CustomEngageOnXRenderer; ================================================ FILE: agent-studio/packages/studio-app/src/categories/x/engageOnX/types.ts ================================================ export type EngageOnXFormData = { id: string; toolset: string; frequency: string; details: string; model: string; modelName: string; }; ================================================ FILE: agent-studio/packages/studio-app/src/categories/x/engageOnX/validates/create.ts ================================================ import { OnAddPayload, OnCreatePayload, OnLinkPayload, } from "@agent-studio/studio-dnd"; import { xMissionLinkToAllowed } from "../../../shared/validators"; const onAddValidate = (data: OnAddPayload) => { return true; }; const onSnapValidate = () => { return true; }; const onSplitValidate = () => { return true; }; const onMergeValidate = () => { return true; }; const onDropInValidate = () => { return true; }; const onDropOutValidate = () => { return true; }; const onLinkValidate = (data: OnLinkPayload) => { return xMissionLinkToAllowed(data); }; const CREATE_FLOW_ENGAGE_ON_X_VALIDATORS = { onAddValidate, onSnapValidate, onSplitValidate, onMergeValidate, onDropInValidate, onDropOutValidate, onLinkValidate, }; export default CREATE_FLOW_ENGAGE_ON_X_VALIDATORS; ================================================ FILE: agent-studio/packages/studio-app/src/categories/x/engageOnX/validates/index.ts ================================================ import CREATE_FLOW_ENGAGE_ON_X_VALIDATORS from './create'; import UPDATE_FLOW_ENGAGE_ON_X_VALIDATORS from './update'; const ENGAGE_ON_X_VALIDATES = { create: CREATE_FLOW_ENGAGE_ON_X_VALIDATORS, update: UPDATE_FLOW_ENGAGE_ON_X_VALIDATORS, }; export default ENGAGE_ON_X_VALIDATES; ================================================ FILE: agent-studio/packages/studio-app/src/categories/x/engageOnX/validates/update.ts ================================================ import { OnAddPayload, OnLinkPayload } from "@agent-studio/studio-dnd"; import { xMissionLinkToAllowed } from "../../../shared/validators"; const onAddValidate = (data: OnAddPayload) => { return true; }; const onSnapValidate = () => { return true; }; const onSplitValidate = () => { return true; }; const onMergeValidate = () => { return true; }; const onDropInValidate = () => { return true; }; const onDropOutValidate = () => { return true; }; const onLinkValidate = (data: OnLinkPayload) => { return xMissionLinkToAllowed(data); }; const UPDATE_FLOW_ENGAGE_ON_X_VALIDATORS = { onAddValidate, onSnapValidate, onSplitValidate, onMergeValidate, onDropInValidate, onDropOutValidate, onLinkValidate, }; export default UPDATE_FLOW_ENGAGE_ON_X_VALIDATORS; ================================================ FILE: agent-studio/packages/studio-app/src/categories/x/followOnX/CustomRenderer/Fields/AiModelField.tsx ================================================ import { StudioDataNode } from "@agent-studio/studio-dnd"; import { useEffect, useMemo } from "react"; import useStudioAgentStore from "../../../../../stores/useStudioAgentStore"; import { tokens } from "../../../../../constants/tokens"; import { useDetectChainIdForMissionModel } from "../../../../../hooks/useDetectChainIdForMissionModel"; import { compareString } from "../../../../../utils/string"; import { RenameModels } from "../../../../../constants/models"; import StudioHorizontalField from "../../../../../components/form/fields/StudioHorizontalField"; import StudioDropdown from "../../../../../components/form/inputs/StudioDropdown"; import useCommonStore from "../../../../../stores/useCommonStore"; type Props = { id: string; value: string; onChange: (v: string, name: string) => void; data: StudioDataNode[]; }; const AiModelField = ({ id, value, onChange, data }: Props) => { const { isDetail } = useStudioAgentStore(); const chains = useCommonStore((state) => state.chains); const chainId = useDetectChainIdForMissionModel(id); const options = useMemo(() => { try { const matchedToken = tokens.find((v) => compareString(v.id, chainId)); const selectedChain = chains?.find((v) => compareString(v.chain_id, matchedToken?.chainId) ); if (selectedChain?.support_model_names) { return Object.entries(selectedChain.support_model_names).map( (item) => ({ label: RenameModels?.[item[0] as any] || item[0], value: item[1], extraData: item, }) ); } } catch (e) { /// } return []; }, [chainId]); useEffect(() => { if (!isDetail) { if (chainId) { if (options?.length && value) { const option = options.find((item) => item.value === value) || options[0]; if (option) { onChange(option.value, option.extraData[0] as string); } } else { const option = options[0]; if (option) { onChange(option.value, option.extraData[0] as string); } } } else { onChange("", ""); } } }, [chainId, options?.length, value]); return ( { const option = options.find((v) => v.value === id); if (option) { onChange(id as string, option.extraData[0] as string); } }} placeholder="AI Model" options={options} /> ); }; export default AiModelField; ================================================ FILE: agent-studio/packages/studio-app/src/categories/x/followOnX/CustomRenderer/Fields/DetailsField.tsx ================================================ import StudioVerticalField from "../../../../../components/form/fields/StudioVerticalField"; import StudioTextArea from "../../../../../components/form/inputs/StudioTextArea"; type Props = { id: string; value: string; onChange: (v: string) => void; }; const DetailsField = ({ id, value, onChange }: Props) => { return ( onChange(e.target.value)} placeholder="Enter your detailed instructions here" /> ); }; export default DetailsField; ================================================ FILE: agent-studio/packages/studio-app/src/categories/x/followOnX/CustomRenderer/Fields/FrequencyField.tsx ================================================ import StudioHorizontalField from "../../../../../components/form/fields/StudioHorizontalField"; import StudioInput from "../../../../../components/form/inputs/StudioInput"; type Props = { id: string; value: string; onChange: (v: string) => void; }; const FrequencyField = ({ id, value, onChange }: Props) => { return ( onChange(e.target.value)} placeholder="e.g 2" /> ); }; export default FrequencyField; ================================================ FILE: agent-studio/packages/studio-app/src/categories/x/followOnX/CustomRenderer/index.tsx ================================================ import { StudioCategoryOptionRenderPayload } from "@agent-studio/studio-dnd"; import DetailsField from "./Fields/DetailsField"; import { FollowOnXFormData } from "../types"; import FrequencyField from "./Fields/FrequencyField"; import AiModelField from "./Fields/AiModelField"; import CustomRendererBase from "../../../../components/CustomRendererBase"; import StudioFormWrapper from "../../../../components/form"; const CustomFollowOnXRenderer = ({ id, formData, setFormFields, data, }: StudioCategoryOptionRenderPayload) => { const { frequency, details, model } = formData; return ( { setFormFields({ model: id, modelName: name }); }} data={data} /> { setFormFields({ frequency: v }); }} /> { setFormFields({ details: v }); }} /> ); }; export default CustomFollowOnXRenderer; ================================================ FILE: agent-studio/packages/studio-app/src/categories/x/followOnX/types.ts ================================================ export type FollowOnXFormData = { id: string; toolset: string; frequency: string; details: string; model: string; modelName: string; }; ================================================ FILE: agent-studio/packages/studio-app/src/categories/x/followOnX/validates/create.ts ================================================ import { OnAddPayload, OnCreatePayload, OnLinkPayload, } from "@agent-studio/studio-dnd"; import { xMissionLinkToAllowed } from "../../../shared/validators"; const onAddValidate = (data: OnAddPayload) => { return true; }; const onSnapValidate = () => { return true; }; const onSplitValidate = () => { return true; }; const onMergeValidate = () => { return true; }; const onDropInValidate = () => { return true; }; const onDropOutValidate = () => { return true; }; const onLinkValidate = (data: OnLinkPayload) => { return xMissionLinkToAllowed(data); }; const CREATE_FLOW_FOLLOW_ON_X_VALIDATORS = { onAddValidate, onSnapValidate, onSplitValidate, onMergeValidate, onDropInValidate, onDropOutValidate, onLinkValidate, }; export default CREATE_FLOW_FOLLOW_ON_X_VALIDATORS; ================================================ FILE: agent-studio/packages/studio-app/src/categories/x/followOnX/validates/index.ts ================================================ import CREATE_FLOW_FOLLOW_ON_X_VALIDATORS from './create'; import UPDATE_FLOW_FOLLOW_ON_X_VALIDATORS from './update'; const FOLLOW_ON_X_VALIDATES = { create: CREATE_FLOW_FOLLOW_ON_X_VALIDATORS, update: UPDATE_FLOW_FOLLOW_ON_X_VALIDATORS, }; export default FOLLOW_ON_X_VALIDATES; ================================================ FILE: agent-studio/packages/studio-app/src/categories/x/followOnX/validates/update.ts ================================================ import { OnAddPayload, OnLinkPayload } from "@agent-studio/studio-dnd"; import { xMissionLinkToAllowed } from "../../../shared/validators"; const onAddValidate = (data: OnAddPayload) => { return true; }; const onSnapValidate = () => { return true; }; const onSplitValidate = () => { return true; }; const onMergeValidate = () => { return true; }; const onDropInValidate = () => { return true; }; const onDropOutValidate = () => { return true; }; const onLinkValidate = (data: OnLinkPayload) => { return xMissionLinkToAllowed(data); }; const UPDATE_FLOW_FOLLOW_ON_X_VALIDATORS = { onAddValidate, onSnapValidate, onSplitValidate, onMergeValidate, onDropInValidate, onDropOutValidate, onLinkValidate, }; export default UPDATE_FLOW_FOLLOW_ON_X_VALIDATORS; ================================================ FILE: agent-studio/packages/studio-app/src/categories/x/postFollowingOnX/CustomRenderer/Fields/AiModelField.tsx ================================================ import { StudioDataNode } from "@agent-studio/studio-dnd"; import { useEffect, useMemo } from "react"; import useStudioAgentStore from "../../../../../stores/useStudioAgentStore"; import useAgentDataFieldChange from "../../../../../hooks/useAgentDataFieldChange"; import { tokens } from "../../../../../constants/tokens"; import { compareString } from "../../../../../utils/string"; import { RenameModels } from "../../../../../constants/models"; import StudioHorizontalField from "../../../../../components/form/fields/StudioHorizontalField"; import StudioDropdown from "../../../../../components/form/inputs/StudioDropdown"; import useCommonStore from "../../../../../stores/useCommonStore"; type Props = { id: string; value: string; onChange: (v: string) => void; data: StudioDataNode[]; }; const AiModelField = ({ id, value, onChange, data }: Props) => { const { isDetail } = useStudioAgentStore(); const chains = useCommonStore((state) => state.chains); const { chainId } = useAgentDataFieldChange(); const options = useMemo(() => { try { const matchedToken = tokens.find((v) => compareString(v.id, chainId)); const selectedChain = chains?.find((v) => compareString(v.chain_id, matchedToken?.chainId) ); if (selectedChain?.support_model_names) { return Object.entries(selectedChain.support_model_names).map( (item) => ({ label: RenameModels?.[item[0] as any] || item[0], value: item[1], }) ); } } catch (e) { /// } return []; }, [chainId]); useEffect(() => { if (!isDetail) { if (chainId) { if (options?.length && value) { const option = options.find((item) => item.value === value) || options[0]; if (option) { onChange(option.value); } } else { const option = options[0]; if (option) { onChange(option.value); } } } else { onChange(""); } } }, [chainId, options?.length, value]); return ( { onChange(v as string); }} placeholder="AI Model" options={options} /> ); }; export default AiModelField; ================================================ FILE: agent-studio/packages/studio-app/src/categories/x/postFollowingOnX/CustomRenderer/Fields/DetailsField.tsx ================================================ import StudioVerticalField from "../../../../../components/form/fields/StudioVerticalField"; import StudioTextArea from "../../../../../components/form/inputs/StudioTextArea"; import { DEFAULT_ABILITY_PLACEHOLDER } from "../../../../../constants/default-values"; type Props = { id: string; value: string; onChange: (v: string) => void; }; const DetailsField = ({ id, value, onChange }: Props) => { return ( onChange(e.target.value)} placeholder={DEFAULT_ABILITY_PLACEHOLDER} /> ); }; export default DetailsField; ================================================ FILE: agent-studio/packages/studio-app/src/categories/x/postFollowingOnX/CustomRenderer/Fields/FetchPostsFrequencyField.tsx ================================================ import { Box, Button, Flex, Spinner } from "@chakra-ui/react"; import axios from "axios"; import { StudioDataNode } from "@agent-studio/studio-dnd"; import React, { useRef, useState } from "react"; import useStudioAgentStore from "../../../../../stores/useStudioAgentStore"; import { showError } from "../../../../../utils/toast"; import { findById, findParentById, findPersonalityObj, } from "../../../../../utils/process"; import StudioVerticalField from "../../../../../components/form/fields/StudioVerticalField"; import StudioInput from "../../../../../components/form/inputs/StudioInput"; import ConnectXContent from "../../../../../components/ConnectXContent"; import useAgentServiceStore from "../../../../../stores/useAgentServiceStore"; import { NEWS_QUERY_TOKEN } from "../../../../../configs"; type Props = { id: string; value: string; onChange: (v: string) => void; data: StudioDataNode[]; }; const FetchPostsFrequencyField = ({ id, value, onChange, data }: Props) => { const { agentInfo, agentDetail, simulatePrompt, setSimulatePrompt } = useStudioAgentStore(); const [loading, setLoading] = useState(false); const connectXRef = useRef(null); const isLinkedX = React.useMemo(() => { return (agentInfo?.twitter_info_id && agentInfo?.twitter_info?.re_link === false) as boolean; }, [agentInfo?.twitter_info_id, agentInfo?.twitter_info?.re_link]); const handleConnectXSubmit = async () => { if (connectXRef.current) { // @ts-ignore return connectXRef.current.callSubmitFunction(); } }; const fetchTweetFromFollowingTwitter = async ( twitter_username: string, hours: number ) => { setLoading(true); const authToken = useAgentServiceStore.getState().accessToken; try { const res = await axios.get( `https://offchain-auto-agent-api.eternalai.org/api/post-v3-sample-content/?twitter_username=${twitter_username}&&cutoff_hour=${hours}`, { headers: { Authorization: authToken, "X-Token": NEWS_QUERY_TOKEN, }, } ); if (res.data.data.length === 0) { showError({ message: "No tweets to show. Follow more accounts on X.", }); return; } // setFetchFollowingPosts(res.data.data); const result = findById(data, id); const parentObj = findParentById(data, id); const personalityObj = findPersonalityObj(data, parentObj); if (!personalityObj) { showError({ message: "Personality not found. Please connect the ability to a personality", }); return; } setSimulatePrompt({ id: [id], personality: personalityObj?.data?.personality, simulate_prompt: result?.data?.details || "", simulate_type: `${result?.idx}_following`, fetchTwPosts: res.data.data, }); // return res.data.data; } catch (error: any) { showError({ message: error.message, }); } finally { setLoading(false); // setLoadedFetchTweet(true); } }; return ( <> onChange(e.target.value)} placeholder="e.g 2" /> ); }; export default FetchPostsFrequencyField; ================================================ FILE: agent-studio/packages/studio-app/src/categories/x/postFollowingOnX/CustomRenderer/Fields/FrequencyField.tsx ================================================ import StudioHorizontalField from "../../../../../components/form/fields/StudioHorizontalField"; import StudioInput from "../../../../../components/form/inputs/StudioInput"; type Props = { id: string; value: string; onChange: (v: string) => void; }; const FrequencyField = ({ id, value, onChange }: Props) => { return ( onChange(e.target.value)} placeholder="e.g 2" /> ); }; export default FrequencyField; ================================================ FILE: agent-studio/packages/studio-app/src/categories/x/postFollowingOnX/CustomRenderer/Fields/styles.module.scss ================================================ .checkbox { margin-bottom: 0 !important; :global { .chakra-checkbox__label { font-size: 14px; } .chakra-checkbox__control { width: 20px; height: 20px; border-radius: 4px; border: 1px solid #CECECE; &[data-checked] { background: #368cdc; } } } } .searchResult { padding: 20px; background: #FAFAFA; border-radius: 12px; color: #000; font-size: 14px; font-weight: 400; line-height: 20px; li { &:not(:first-child) { margin-top: 12px; } } } ================================================ FILE: agent-studio/packages/studio-app/src/categories/x/postFollowingOnX/CustomRenderer/index.tsx ================================================ import { Button, Flex, Spinner } from "@chakra-ui/react"; import { useMemo, useState } from "react"; import s from "../../styles.module.scss"; import { PostFollowingOnXFormData } from "../types"; import AiModelField from "./Fields/AiModelField"; import FrequencyField from "./Fields/FrequencyField"; import FetchPostsFrequencyField from "./Fields/FetchPostsFrequencyField"; import axios from "axios"; import { StudioCategoryOptionRenderPayload } from "@agent-studio/studio-dnd"; import useStudioAgentStore from "../../../../stores/useStudioAgentStore"; import { showError } from "../../../../utils/toast"; import { findById, findParentById, findPersonalityObj, } from "../../../../utils/process"; import CustomRendererBase from "../../../../components/CustomRendererBase"; import StudioFormWrapper from "../../../../components/form"; import DetailsField from "./Fields/DetailsField"; import { NEWS_QUERY_TOKEN } from "../../../../configs"; import useAgentServiceStore from "../../../../stores/useAgentServiceStore"; const CustomPostFollowingOnXRenderer = ({ id, formData, data, setFormFields, }: StudioCategoryOptionRenderPayload) => { const { frequency, details, fetchPostsFrequency, model } = formData; const [loading, setLoading] = useState(false); const { setSimulatePrompt, simulatePrompt, agentDetail } = useStudioAgentStore(); const fetchTweetFromFollowingTwitter = async ( twitter_username: string, hours: number ) => { setLoading(true); const authToken = useAgentServiceStore.getState().accessToken; try { const res = await axios.get( `https://offchain-auto-agent-api.eternalai.org/api/post-v3-sample-content/?twitter_username=${twitter_username}&&cutoff_hour=${hours}`, { headers: { Authorization: authToken, "X-Token": NEWS_QUERY_TOKEN, }, } ); if (res.data.data.length === 0) { showError({ message: "No tweets to show. Follow more accounts on X.", }); return; } return res.data.data; } catch (error: any) { showError({ message: error.message, }); } finally { setLoading(false); // setLoadedFetchTweet(true); } }; const handleSelectMissionPrompt = async () => { const result = findById(data, id); const parentObj = findParentById(data, id); const personalityObj = findPersonalityObj(data, parentObj); if (!result?.data?.details) { showError({ message: "Please fill the details field", }); return; } if (!personalityObj) { showError({ message: "Personality not found. Please connect the prompt to a personality", }); return; } const fetchPosts = await fetchTweetFromFollowingTwitter( agentDetail?.agent_info?.twitter_info?.twitter_username || "", Number(fetchPostsFrequency) ); if (!!fetchPosts && fetchPosts.length > 0) { setSimulatePrompt({ id: [personalityObj.id, result.id], personality: personalityObj?.data?.personality, simulate_prompt: result.data.details, simulate_type: result.idx, fetchTwPosts: fetchPosts, }); } }; const isActive = useMemo(() => { return simulatePrompt?.id.includes(id); }, [simulatePrompt]); return (
{ setFormFields({ model: v }); }} data={data} /> { setFormFields({ frequency: v }); }} /> { setFormFields({ fetchPostsFrequency: v }); }} data={data} /> { setFormFields({ details: v }); }} />
); }; export default CustomPostFollowingOnXRenderer; ================================================ FILE: agent-studio/packages/studio-app/src/categories/x/postFollowingOnX/types.ts ================================================ export type PostFollowingOnXFormData = { id: string; frequency: string; details: string; fetchPostsFrequency: string; model: string; }; ================================================ FILE: agent-studio/packages/studio-app/src/categories/x/postFollowingOnX/validates/create.ts ================================================ import { OnAddPayload, OnCreatePayload, OnLinkPayload, } from "@agent-studio/studio-dnd"; import { xMissionLinkToAllowed } from "../../../shared/validators"; const onAddValidate = (data: OnAddPayload) => { return true; }; const onSnapValidate = () => { return true; }; const onSplitValidate = () => { return true; }; const onMergeValidate = () => { return true; }; const onDropInValidate = () => { return true; }; const onDropOutValidate = () => { return true; }; const onLinkValidate = (data: OnLinkPayload) => { return xMissionLinkToAllowed(data); }; const CREATE_FLOW_POST_FOLLOWING_ON_X_VALIDATORS = { onAddValidate, onSnapValidate, onSplitValidate, onMergeValidate, onDropInValidate, onDropOutValidate, onLinkValidate, }; export default CREATE_FLOW_POST_FOLLOWING_ON_X_VALIDATORS; ================================================ FILE: agent-studio/packages/studio-app/src/categories/x/postFollowingOnX/validates/index.ts ================================================ import CREATE_FLOW_POST_FOLLOWING_ON_X_VALIDATORS from './create'; import UPDATE_FLOW_POST_FOLLOWING_ON_X_VALIDATORS from './update'; const POST_FOLLOWING_ON_X_VALIDATES = { create: CREATE_FLOW_POST_FOLLOWING_ON_X_VALIDATORS, update: UPDATE_FLOW_POST_FOLLOWING_ON_X_VALIDATORS, }; export default POST_FOLLOWING_ON_X_VALIDATES; ================================================ FILE: agent-studio/packages/studio-app/src/categories/x/postFollowingOnX/validates/update.ts ================================================ import { OnAddPayload, OnLinkPayload } from "@agent-studio/studio-dnd"; import { xMissionLinkToAllowed } from "../../../shared/validators"; const onAddValidate = (data: OnAddPayload) => { return true; }; const onSnapValidate = () => { return true; }; const onSplitValidate = () => { return true; }; const onMergeValidate = () => { return true; }; const onDropInValidate = () => { return true; }; const onDropOutValidate = () => { return true; }; const onLinkValidate = (data: OnLinkPayload) => { return xMissionLinkToAllowed(data); }; const UPDATE_FLOW_POST_FOLLOWING_ON_X_VALIDATORS = { onAddValidate, onSnapValidate, onSplitValidate, onMergeValidate, onDropInValidate, onDropOutValidate, onLinkValidate, }; export default UPDATE_FLOW_POST_FOLLOWING_ON_X_VALIDATORS; ================================================ FILE: agent-studio/packages/studio-app/src/categories/x/postNewsOnX/CustomRenderer/Fields/AiModelField.tsx ================================================ import { StudioDataNode } from "@agent-studio/studio-dnd"; import { useEffect, useMemo } from "react"; import useStudioAgentStore from "../../../../../stores/useStudioAgentStore"; import { useDetectChainIdForMissionModel } from "../../../../../hooks/useDetectChainIdForMissionModel"; import { compareString } from "../../../../../utils/string"; import { tokens } from "../../../../../constants/tokens"; import { RenameModels } from "../../../../../constants/models"; import StudioHorizontalField from "../../../../../components/form/fields/StudioHorizontalField"; import StudioDropdown from "../../../../../components/form/inputs/StudioDropdown"; import useCommonStore from "../../../../../stores/useCommonStore"; type Props = { id: string; value: string; onChange: (v: string, name: string) => void; data: StudioDataNode[]; }; const AiModelField = ({ id, value, onChange, data }: Props) => { const { isDetail } = useStudioAgentStore(); const chains = useCommonStore((state) => state.chains); const chainId = useDetectChainIdForMissionModel(id); const options = useMemo(() => { try { const matchedToken = tokens.find((v) => compareString(v.id, chainId)); const selectedChain = chains?.find((v) => compareString(v.chain_id, matchedToken?.chainId) ); if (selectedChain?.support_model_names) { return Object.entries(selectedChain.support_model_names).map( (item) => ({ label: RenameModels?.[item[0] as any] || item[0], value: item[1], extraData: item, }) ); } } catch (e) { /// } return []; }, [chainId]); useEffect(() => { if (!isDetail) { if (chainId) { if (options?.length && value) { const option = options.find((item) => item.value === value) || options[0]; if (option) { onChange(option.value, option.extraData[0] as string); } } else { const option = options[0]; if (option) { onChange(option.value, option.extraData[0] as string); } } } else { onChange("", ""); } } }, [chainId, options?.length, value]); return ( { const option = options.find((v) => v.value === id); if (option) { onChange(id as string, option.extraData[0] as string); } }} placeholder="AI Model" options={options} /> ); }; export default AiModelField; ================================================ FILE: agent-studio/packages/studio-app/src/categories/x/postNewsOnX/CustomRenderer/Fields/DetailsField.tsx ================================================ import StudioVerticalField from "../../../../../components/form/fields/StudioVerticalField"; import StudioTextArea from "../../../../../components/form/inputs/StudioTextArea"; import { DEFAULT_ABILITY_PLACEHOLDER } from "../../../../../constants/default-values"; type Props = { id: string; value: string; onChange: (v: string) => void; }; const DetailsField = ({ id, value, onChange }: Props) => { return ( onChange(e.target.value)} placeholder={DEFAULT_ABILITY_PLACEHOLDER} /> ); }; export default DetailsField; ================================================ FILE: agent-studio/packages/studio-app/src/categories/x/postNewsOnX/CustomRenderer/Fields/FrequencyField.tsx ================================================ import StudioHorizontalField from "../../../../../components/form/fields/StudioHorizontalField"; import StudioInput from "../../../../../components/form/inputs/StudioInput"; type Props = { id: string; value: string; onChange: (v: string) => void; }; const FrequencyField = ({ id, value, onChange }: Props) => { return ( onChange(e.target.value)} placeholder="e.g 2" /> ); }; export default FrequencyField; ================================================ FILE: agent-studio/packages/studio-app/src/categories/x/postNewsOnX/CustomRenderer/Fields/SearchTopicField.tsx ================================================ import s from "./styles.module.scss"; import { Button, Checkbox, Flex, Text } from "@chakra-ui/react"; import { PostNewsTopics } from "../../types"; import useStudioAgentStore from "../../../../../stores/useStudioAgentStore"; import { findById, findParentById, findPersonalityObj, } from "../../../../../utils/process"; import StudioVerticalField from "../../../../../components/form/fields/StudioVerticalField"; import StudioInput from "../../../../../components/form/inputs/StudioInput"; import { StudioDataNode } from "@agent-studio/studio-dnd"; type Props = { id: string; value: PostNewsTopics; data: StudioDataNode[]; onChange: (v: PostNewsTopics) => void; topic: string; setTopic: (v: string) => void; }; const SearchTopicField = ({ id, value, onChange, data, topic, setTopic, }: Props) => { const { simulatePrompt, setSimulatePrompt } = useStudioAgentStore(); const { values, bingSearch, twitterSearch } = value; const handleChangeTopics = (v: string) => { onChange({ ...value, values: v, }); }; const handleUpdateBing = () => { onChange({ ...value, bingSearch: !bingSearch, }); }; const handleUpdateTwitter = () => { onChange({ ...value, twitterSearch: !twitterSearch, }); }; const getRandomValue = (arr: string[]): string => { const randomIndex = Math.floor(Math.random() * arr.length); return arr[randomIndex]; }; const getTopic = () => { const topics = values.split(","); const randomTopic = getRandomValue(topics); setTopic(randomTopic.trim()); return randomTopic.trim(); }; const handleSearchNews = async (topic: string) => { const result = findById(data, id); const parentObj = findParentById(data, id); const personalityObj = findPersonalityObj(data, parentObj); // if (!personalityObj) { // showError({ // message: // 'Personality not found. Please connect the ability to a personality', // }); // return; // } setSimulatePrompt({ id: [id], personality: personalityObj?.data?.personality, simulate_prompt: result?.data?.details || "", simulate_type: `${result?.idx}_topic`, topics: { values: topic, bingSearch: bingSearch, twitterSearch: twitterSearch, }, }); }; return ( handleChangeTopics(e.target.value)} placeholder={`List topics separated by commas. Example: crypto, AI, decentralized inference,...`} width={"100% !important"} /> Search tool: Bing X {/* {topic && Topic: {topic}} */} ); }; export default SearchTopicField; ================================================ FILE: agent-studio/packages/studio-app/src/categories/x/postNewsOnX/CustomRenderer/Fields/styles.module.scss ================================================ .checkbox { margin-bottom: 0 !important; :global { .chakra-checkbox__label { font-size: 14px; } .chakra-checkbox__control { width: 20px; height: 20px; border-radius: 4px; border: 1px solid #CECECE; &[data-checked] { background: #368cdc; } } } } .searchResult { padding: 20px; background: #FAFAFA; border-radius: 12px; color: #000; font-size: 14px; font-weight: 400; line-height: 20px; li { &:not(:first-child) { margin-top: 12px; } } } ================================================ FILE: agent-studio/packages/studio-app/src/categories/x/postNewsOnX/CustomRenderer/index.tsx ================================================ import { StudioCategoryOptionRenderPayload } from "@agent-studio/studio-dnd"; import DetailsField from "./Fields/DetailsField"; import { PostNewsOnXFormData, PostNewsTopics } from "../types"; import FrequencyField from "./Fields/FrequencyField"; import { Button, Flex } from "@chakra-ui/react"; import { useMemo, useState } from "react"; import s from "../../styles.module.scss"; import SearchTopicField from "./Fields/SearchTopicField"; import AiModelField from "./Fields/AiModelField"; import useStudioAgentStore from "../../../../stores/useStudioAgentStore"; import { useDetectChainIdForMissionModel } from "../../../../hooks/useDetectChainIdForMissionModel"; import { findById, findParentById, findPersonalityObj, } from "../../../../utils/process"; import { showError } from "../../../../utils/toast"; import CustomRendererBase from "../../../../components/CustomRendererBase"; import StudioFormWrapper from "../../../../components/form"; const CustomPostNewsOnXRenderer = ({ id, formData, data, setFormFields, }: StudioCategoryOptionRenderPayload) => { const { frequency, details, topics, model } = formData; const [topic, setTopic] = useState(""); const { setSimulatePrompt, simulatePrompt } = useStudioAgentStore(); const node = useDetectChainIdForMissionModel(id); const getRandomValue = (arr: string[]): string => { const randomIndex = Math.floor(Math.random() * arr.length); return arr[randomIndex]; }; const getTopic = () => { const _topics = topics.values.split(","); const randomTopic = getRandomValue(_topics); return randomTopic.trim(); }; const handleSelectMissionPrompt = () => { const result = findById(data, id); const parentObj = findParentById(data, id); const personalityObj = findPersonalityObj(data, parentObj); let _topic = topic; if (!result.data.details) { showError({ message: "Please fill the details field", }); return; } if (!personalityObj) { showError({ message: "Personality not found. Please connect the prompt to a personality", }); return; } if (!_topic) { _topic = getTopic(); } setSimulatePrompt({ id: [personalityObj.id, result.id], personality: personalityObj?.data?.personality, simulate_prompt: result.data.details, simulate_type: result.idx, topics: simulatePrompt?.topics || { ...topics, values: _topic }, }); }; const isActive = useMemo(() => { return simulatePrompt?.id.includes(id); }, [simulatePrompt]); return (
{ setFormFields({ model: id, modelName: name }); }} data={data} /> { setFormFields({ frequency: v }); }} /> { setFormFields({ topics: v }); }} /> { setFormFields({ details: v }); }} />
); }; export default CustomPostNewsOnXRenderer; ================================================ FILE: agent-studio/packages/studio-app/src/categories/x/postNewsOnX/types.ts ================================================ export type PostNewsOnXFormData = { id: string; frequency: string; details: string; topics: PostNewsTopics; model: string; modelName: string; }; export type PostNewsTopics = { values: string; bingSearch: boolean; twitterSearch: boolean; }; ================================================ FILE: agent-studio/packages/studio-app/src/categories/x/postNewsOnX/validates/create.ts ================================================ import { OnAddPayload, OnCreatePayload, OnLinkPayload, } from "@agent-studio/studio-dnd"; import { xMissionLinkToAllowed } from "../../../shared/validators"; const onAddValidate = (data: OnAddPayload) => { return true; }; const onSnapValidate = () => { return true; }; const onSplitValidate = () => { return true; }; const onMergeValidate = () => { return true; }; const onDropInValidate = () => { return true; }; const onDropOutValidate = () => { return true; }; const onLinkValidate = (data: OnLinkPayload) => { return xMissionLinkToAllowed(data); }; const CREATE_FLOW_POST_NEWS_ON_X_VALIDATORS = { onAddValidate, onSnapValidate, onSplitValidate, onMergeValidate, onDropInValidate, onDropOutValidate, onLinkValidate, }; export default CREATE_FLOW_POST_NEWS_ON_X_VALIDATORS; ================================================ FILE: agent-studio/packages/studio-app/src/categories/x/postNewsOnX/validates/index.ts ================================================ import CREATE_FLOW_POST_NEWS_ON_X_VALIDATORS from './create'; import UPDATE_FLOW_POST_NEWS_ON_X_VALIDATORS from './update'; const POST_NEWS_ON_X_VALIDATES = { create: CREATE_FLOW_POST_NEWS_ON_X_VALIDATORS, update: UPDATE_FLOW_POST_NEWS_ON_X_VALIDATORS, }; export default POST_NEWS_ON_X_VALIDATES; ================================================ FILE: agent-studio/packages/studio-app/src/categories/x/postNewsOnX/validates/update.ts ================================================ import { OnAddPayload, OnLinkPayload } from "@agent-studio/studio-dnd"; import { xMissionLinkToAllowed } from "../../../shared/validators"; const onAddValidate = (data: OnAddPayload) => { return true; }; const onSnapValidate = () => { return true; }; const onSplitValidate = () => { return true; }; const onMergeValidate = () => { return true; }; const onDropInValidate = () => { return true; }; const onDropOutValidate = () => { return true; }; const onLinkValidate = (data: OnLinkPayload) => { return xMissionLinkToAllowed(data); }; const UPDATE_FLOW_POST_NEWS_ON_X_VALIDATORS = { onAddValidate, onSnapValidate, onSplitValidate, onMergeValidate, onDropInValidate, onDropOutValidate, onLinkValidate, }; export default UPDATE_FLOW_POST_NEWS_ON_X_VALIDATORS; ================================================ FILE: agent-studio/packages/studio-app/src/categories/x/postOnX/CustomRenderer/Fields/AiModelField.tsx ================================================ import { StudioDataNode } from "@agent-studio/studio-dnd"; import { useEffect, useMemo } from "react"; import useStudioAgentStore from "../../../../../stores/useStudioAgentStore"; import { useDetectChainIdForMissionModel } from "../../../../../hooks/useDetectChainIdForMissionModel"; import { compareString } from "../../../../../utils/string"; import { tokens } from "../../../../../constants/tokens"; import { RenameModels } from "../../../../../constants/models"; import StudioHorizontalField from "../../../../../components/form/fields/StudioHorizontalField"; import StudioDropdown from "../../../../../components/form/inputs/StudioDropdown"; import useCommonStore from "../../../../../stores/useCommonStore"; type Props = { id: string; value: string; onChange: (v: string, name: string) => void; data: StudioDataNode[]; }; const AiModelField = ({ id, value, onChange, data }: Props) => { const { isDetail } = useStudioAgentStore(); const chains = useCommonStore((state) => state.chains); const chainId = useDetectChainIdForMissionModel(id); const options = useMemo(() => { try { const matchedToken = tokens.find((v) => compareString(v.id, chainId)); const selectedChain = chains?.find((v) => compareString(v.chain_id, matchedToken?.chainId) ); if (selectedChain?.support_model_names) { return Object.entries(selectedChain.support_model_names).map( (item) => ({ label: RenameModels?.[item[0] as any] || item[0], value: item[1], extraData: item, }) ); } } catch (e) { /// } return []; }, [chainId]); useEffect(() => { if (!isDetail) { if (chainId) { if (options?.length && value) { const option = options.find((item) => item.value === value) || options[0]; if (option) { onChange(option.value, option.extraData[0] as string); } } else { const option = options[0]; if (option) { onChange(option.value, option.extraData[0] as string); } } } else { onChange("", ""); } } }, [chainId, options?.length, value]); return ( { const option = options.find((v) => v.value === id); if (option) { onChange(id as string, option.extraData[0] as string); } }} placeholder="AI Model" options={options} /> ); }; export default AiModelField; ================================================ FILE: agent-studio/packages/studio-app/src/categories/x/postOnX/CustomRenderer/Fields/DetailsField.tsx ================================================ import StudioVerticalField from "../../../../../components/form/fields/StudioVerticalField"; import StudioTextArea from "../../../../../components/form/inputs/StudioTextArea"; type Props = { id: string; value: string; onChange: (v: string) => void; }; const DetailsField = ({ id, value, onChange }: Props) => { return ( onChange(e.target.value)} placeholder="Enter your detailed instructions here" /> ); }; export default DetailsField; ================================================ FILE: agent-studio/packages/studio-app/src/categories/x/postOnX/CustomRenderer/Fields/FrequencyField.tsx ================================================ import StudioHorizontalField from "../../../../../components/form/fields/StudioHorizontalField"; import StudioInput from "../../../../../components/form/inputs/StudioInput"; type Props = { id: string; value: string; onChange: (v: string) => void; }; const FrequencyField = ({ id, value, onChange }: Props) => { return ( onChange(e.target.value)} placeholder="e.g 2" /> ); }; export default FrequencyField; ================================================ FILE: agent-studio/packages/studio-app/src/categories/x/postOnX/CustomRenderer/index.tsx ================================================ import { StudioCategoryOptionRenderPayload } from "@agent-studio/studio-dnd"; import DetailsField from "./Fields/DetailsField"; import { PostOnXFormData } from "../types"; import FrequencyField from "./Fields/FrequencyField"; import { Button, Flex } from "@chakra-ui/react"; import { useEffect, useMemo, useState } from "react"; import s from "../../styles.module.scss"; import AiModelField from "./Fields/AiModelField"; import useStudioAgentStore from "../../../../stores/useStudioAgentStore"; import { findById, findParentById, findPersonalityObj, } from "../../../../utils/process"; import { showError } from "../../../../utils/toast"; import CustomRendererBase from "../../../../components/CustomRendererBase"; import StudioFormWrapper from "../../../../components/form"; const CustomPostOnXRenderer = ({ id, formData, data, setFormFields, }: StudioCategoryOptionRenderPayload) => { const { frequency, details, model } = formData; const { setSimulatePrompt, simulatePrompt } = useStudioAgentStore(); const handleSelectMissionPrompt = () => { const result = findById(data, id); const parentObj = findParentById(data, id); const personalityObj = findPersonalityObj(data, parentObj); if (!result.data.details) { showError({ message: "Please fill the details field", }); return; } if (!personalityObj) { showError({ message: "Personality not found. Please connect the prompt to a personality", }); return; } setSimulatePrompt({ id: [personalityObj.id, result.id], personality: personalityObj?.data?.personality, simulate_prompt: result.data.details, simulate_type: result.idx, }); }; const isActive = useMemo(() => { return simulatePrompt?.id.includes(id); }, [simulatePrompt]); return (
{ setFormFields({ model: id, modelName: name }); }} data={data} /> { setFormFields({ frequency: v }); }} /> { setFormFields({ details: v }); }} />
); }; export default CustomPostOnXRenderer; ================================================ FILE: agent-studio/packages/studio-app/src/categories/x/postOnX/types.ts ================================================ export type PostOnXFormData = { id: string; toolset: string; frequency: string; details: string; model: string; modelName: string; }; ================================================ FILE: agent-studio/packages/studio-app/src/categories/x/postOnX/validates/create.ts ================================================ import { OnAddPayload, OnCreatePayload, OnLinkPayload, } from "@agent-studio/studio-dnd"; import { xMissionLinkToAllowed } from "../../../shared/validators"; const onAddValidate = (data: OnAddPayload) => { return true; }; const onSnapValidate = () => { return true; }; const onSplitValidate = () => { return true; }; const onMergeValidate = () => { return true; }; const onDropInValidate = () => { return true; }; const onDropOutValidate = () => { return true; }; const onLinkValidate = (data: OnLinkPayload) => { return xMissionLinkToAllowed(data); }; const CREATE_FLOW_POST_ON_X_VALIDATORS = { onAddValidate, onSnapValidate, onSplitValidate, onMergeValidate, onDropInValidate, onDropOutValidate, onLinkValidate, }; export default CREATE_FLOW_POST_ON_X_VALIDATORS; ================================================ FILE: agent-studio/packages/studio-app/src/categories/x/postOnX/validates/index.ts ================================================ import CREATE_FLOW_POST_ON_X_VALIDATORS from './create'; import UPDATE_FLOW_POST_ON_X_VALIDATORS from './update'; const POST_ON_X_VALIDATES = { create: CREATE_FLOW_POST_ON_X_VALIDATORS, update: UPDATE_FLOW_POST_ON_X_VALIDATORS, }; export default POST_ON_X_VALIDATES; ================================================ FILE: agent-studio/packages/studio-app/src/categories/x/postOnX/validates/update.ts ================================================ import { OnAddPayload, OnLinkPayload } from "@agent-studio/studio-dnd"; import { xMissionLinkToAllowed } from "../../../shared/validators"; const onAddValidate = (data: OnAddPayload) => { return true; }; const onSnapValidate = () => { return true; }; const onSplitValidate = () => { return true; }; const onMergeValidate = () => { return true; }; const onDropInValidate = () => { return true; }; const onDropOutValidate = () => { return true; }; const onLinkValidate = (data: OnLinkPayload) => { return xMissionLinkToAllowed(data); }; const UPDATE_FLOW_POST_ON_X_VALIDATORS = { onAddValidate, onSnapValidate, onSplitValidate, onMergeValidate, onDropInValidate, onDropOutValidate, onLinkValidate, }; export default UPDATE_FLOW_POST_ON_X_VALIDATORS; ================================================ FILE: agent-studio/packages/studio-app/src/categories/x/replyOnX/CustomRenderer/Fields/AiModelField.tsx ================================================ import { StudioDataNode } from "@agent-studio/studio-dnd"; import { useEffect, useMemo } from "react"; import useStudioAgentStore from "../../../../../stores/useStudioAgentStore"; import { useDetectChainIdForMissionModel } from "../../../../../hooks/useDetectChainIdForMissionModel"; import { compareString } from "../../../../../utils/string"; import { tokens } from "../../../../../constants/tokens"; import { RenameModels } from "../../../../../constants/models"; import StudioHorizontalField from "../../../../../components/form/fields/StudioHorizontalField"; import StudioDropdown from "../../../../../components/form/inputs/StudioDropdown"; import useCommonStore from "../../../../../stores/useCommonStore"; type Props = { id: string; value: string; onChange: (v: string, name: string) => void; data: StudioDataNode[]; }; const AiModelField = ({ id, value, onChange, data }: Props) => { const { isDetail } = useStudioAgentStore(); const chains = useCommonStore((state) => state.chains); const chainId = useDetectChainIdForMissionModel(id); const options = useMemo(() => { try { const matchedToken = tokens.find((v) => compareString(v.id, chainId)); const selectedChain = chains?.find((v) => compareString(v.chain_id, matchedToken?.chainId) ); if (selectedChain?.support_model_names) { return Object.entries(selectedChain.support_model_names).map( (item) => ({ label: RenameModels?.[item[0] as any] || item[0], value: item[1], extraData: item, }) ); } } catch (e) { /// } return []; }, [chainId]); useEffect(() => { if (!isDetail) { if (chainId) { if (options?.length && value) { const option = options.find((item) => item.value === value) || options[0]; if (option) { onChange(option.value, option.extraData[0] as string); } } else { const option = options[0]; if (option) { onChange(option.value, option.extraData[0] as string); } } } else { onChange("", ""); } } }, [chainId, options?.length, value]); return ( { const option = options.find((v) => v.value === id); if (option) { onChange(id as string, option.extraData[0] as string); } }} placeholder="AI Model" options={options} /> ); }; export default AiModelField; ================================================ FILE: agent-studio/packages/studio-app/src/categories/x/replyOnX/CustomRenderer/Fields/DetailsField.tsx ================================================ import StudioVerticalField from "../../../../../components/form/fields/StudioVerticalField"; import StudioTextArea from "../../../../../components/form/inputs/StudioTextArea"; type Props = { id: string; value: string; onChange: (v: string) => void; }; const DetailsField = ({ id, value, onChange }: Props) => { return ( onChange(e.target.value)} placeholder="Enter your detailed instructions here" /> ); }; export default DetailsField; ================================================ FILE: agent-studio/packages/studio-app/src/categories/x/replyOnX/CustomRenderer/Fields/FrequencyField.tsx ================================================ import StudioHorizontalField from "../../../../../components/form/fields/StudioHorizontalField"; import StudioInput from "../../../../../components/form/inputs/StudioInput"; type Props = { id: string; value: string; onChange: (v: string) => void; }; const FrequencyField = ({ id, value, onChange }: Props) => { return ( onChange(e.target.value)} placeholder="e.g 2" /> ); }; export default FrequencyField; ================================================ FILE: agent-studio/packages/studio-app/src/categories/x/replyOnX/CustomRenderer/index.tsx ================================================ import { Button, Flex } from "@chakra-ui/react"; import { StudioCategoryOptionRenderPayload } from "@agent-studio/studio-dnd"; import { useMemo } from "react"; import s from "../../styles.module.scss"; import { ReplyOnXFormData } from "../types"; import DetailsField from "./Fields/DetailsField"; import FrequencyField from "./Fields/FrequencyField"; import AiModelField from "./Fields/AiModelField"; import useStudioAgentStore from "../../../../stores/useStudioAgentStore"; import { findById, findParentById, findPersonalityObj, } from "../../../../utils/process"; import { showError } from "../../../../utils/toast"; import CustomRendererBase from "../../../../components/CustomRendererBase"; import StudioFormWrapper from "../../../../components/form"; const CustomReplyOnXRenderer = ({ id, formData, data, setFormFields, }: StudioCategoryOptionRenderPayload) => { const { frequency, details, model } = formData; const { simulatePrompt, setSimulatePrompt } = useStudioAgentStore(); const isActive = useMemo(() => { return simulatePrompt?.id.includes(id); }, [simulatePrompt]); const handleSelectMissionPrompt = () => { const result = findById(data, id); const parentObj = findParentById(data, id); const personalityObj = findPersonalityObj(data, parentObj); if (!result) { showError({ message: "Unable to find the selected prompt", }); return; } if (!personalityObj) { showError({ message: "Personality not found. Please connect the prompt to a personality", }); return; } setSimulatePrompt({ id: [personalityObj.id, result.id], personality: personalityObj?.data?.personality, simulate_prompt: result.data.details, simulate_type: result.idx, }); }; return (
{ setFormFields({ model: id, modelName: name }); }} data={data} /> { setFormFields({ frequency: v }); }} /> { setFormFields({ details: v }); }} />
); }; export default CustomReplyOnXRenderer; ================================================ FILE: agent-studio/packages/studio-app/src/categories/x/replyOnX/types.ts ================================================ export type ReplyOnXFormData = { id: string; toolset: string; frequency: string; details: string; model: string; modelName: string; }; ================================================ FILE: agent-studio/packages/studio-app/src/categories/x/replyOnX/validates/create.ts ================================================ import { OnAddPayload, OnCreatePayload, OnLinkPayload, } from "@agent-studio/studio-dnd"; import { xMissionLinkToAllowed } from "../../../shared/validators"; const onAddValidate = (data: OnAddPayload) => { return true; }; const onSnapValidate = () => { return true; }; const onSplitValidate = () => { return true; }; const onMergeValidate = () => { return true; }; const onDropInValidate = () => { return true; }; const onDropOutValidate = () => { return true; }; const onLinkValidate = (data: OnLinkPayload) => { return xMissionLinkToAllowed(data); }; const CREATE_FLOW_REPLY_ON_X_VALIDATORS = { onAddValidate, onSnapValidate, onSplitValidate, onMergeValidate, onDropInValidate, onDropOutValidate, onLinkValidate, }; export default CREATE_FLOW_REPLY_ON_X_VALIDATORS; ================================================ FILE: agent-studio/packages/studio-app/src/categories/x/replyOnX/validates/index.ts ================================================ import CREATE_FLOW_REPLY_ON_X_VALIDATORS from './create'; import UPDATE_FLOW_REPLY_ON_X_VALIDATORS from './update'; const REPLY_ON_X_VALIDATES = { create: CREATE_FLOW_REPLY_ON_X_VALIDATORS, update: UPDATE_FLOW_REPLY_ON_X_VALIDATORS, }; export default REPLY_ON_X_VALIDATES; ================================================ FILE: agent-studio/packages/studio-app/src/categories/x/replyOnX/validates/update.ts ================================================ import { OnAddPayload, OnLinkPayload } from "@agent-studio/studio-dnd"; import { xMissionLinkToAllowed } from "../../../shared/validators"; const onAddValidate = (data: OnAddPayload) => { return true; }; const onSnapValidate = () => { return true; }; const onSplitValidate = () => { return true; }; const onMergeValidate = () => { return true; }; const onDropInValidate = () => { return true; }; const onDropOutValidate = () => { return true; }; const onLinkValidate = (data: OnLinkPayload) => { return xMissionLinkToAllowed(data); }; const UPDATE_FLOW_REPLY_ON_X_VALIDATORS = { onAddValidate, onSnapValidate, onSplitValidate, onMergeValidate, onDropInValidate, onDropOutValidate, onLinkValidate, }; export default UPDATE_FLOW_REPLY_ON_X_VALIDATORS; ================================================ FILE: agent-studio/packages/studio-app/src/categories/x/styles.module.scss ================================================ .active { --background-color: pink !important; } ================================================ FILE: agent-studio/packages/studio-app/src/categories/x/tradingOnX/CustomRenderer/Fields/AiModelField.tsx ================================================ import { StudioDataNode } from "@agent-studio/studio-dnd"; import { useEffect, useMemo } from "react"; import useStudioAgentStore from "../../../../../stores/useStudioAgentStore"; import { useDetectChainIdForMissionModel } from "../../../../../hooks/useDetectChainIdForMissionModel"; import { compareString } from "../../../../../utils/string"; import { RenameModels } from "../../../../../constants/models"; import StudioHorizontalField from "../../../../../components/form/fields/StudioHorizontalField"; import StudioDropdown from "../../../../../components/form/inputs/StudioDropdown"; import { tokens } from "../../../../../constants/tokens"; import useCommonStore from "../../../../../stores/useCommonStore"; type Props = { id: string; value: string; onChange: (v: string, name: string) => void; data: StudioDataNode[]; }; const AiModelField = ({ id, value, onChange, data }: Props) => { const { isDetail } = useStudioAgentStore(); const chains = useCommonStore((state) => state.chains); const chainId = useDetectChainIdForMissionModel(id); const options = useMemo(() => { try { const matchedToken = tokens.find((v) => compareString(v.id, chainId)); const selectedChain = chains?.find((v) => compareString(v.chain_id, matchedToken?.chainId) ); if (selectedChain?.support_model_names) { return Object.entries(selectedChain.support_model_names).map( (item) => ({ label: RenameModels?.[item[0] as any] || item[0], value: item[1], extraData: item, }) ); } } catch (e) { /// } return []; }, [chainId]); useEffect(() => { if (!isDetail) { if (chainId) { if (options?.length && value) { const option = options.find((item) => item.value === value) || options[0]; if (option) { onChange(option.value, option.extraData[0] as string); } } else { const option = options[0]; if (option) { onChange(option.value, option.extraData[0] as string); } } } else { onChange("", ""); } } }, [chainId, options?.length, value]); return ( { const option = options.find((v) => v.value === id); if (option) { onChange(id as string, option.extraData[0] as string); } }} placeholder="AI Model" options={options} /> ); }; export default AiModelField; ================================================ FILE: agent-studio/packages/studio-app/src/categories/x/tradingOnX/CustomRenderer/Fields/DetailsField.tsx ================================================ import StudioVerticalField from "../../../../../components/form/fields/StudioVerticalField"; import StudioTextArea from "../../../../../components/form/inputs/StudioTextArea"; type Props = { id: string; value: string; onChange: (v: string) => void; }; const DetailsField = ({ id, value, onChange }: Props) => { return ( onChange(e.target.value)} placeholder="Guide the agent on how to create the post by specifying the desired voice, tone, and style. Should it be professional, casual, witty, or inspiring? Provide this preference to shape the content effectively. If you have specific ideas, phrases, or facts you'd like included, include them in the input for a more tailored result. Mention a word count if you prefer the post to be concise or detailed. Test the feature by reviewing the generated post, and if it’s not exactly what you need, refine your input and try again until it aligns with your expectations." /> ); }; export default DetailsField; ================================================ FILE: agent-studio/packages/studio-app/src/categories/x/tradingOnX/CustomRenderer/Fields/FrequencyField.tsx ================================================ import StudioHorizontalField from "../../../../../components/form/fields/StudioHorizontalField"; import StudioInput from "../../../../../components/form/inputs/StudioInput"; type Props = { id: string; value: string; onChange: (v: string) => void; }; const FrequencyField = ({ id, value, onChange }: Props) => { return ( onChange(e.target.value)} placeholder="e.g 2" /> ); }; export default FrequencyField; ================================================ FILE: agent-studio/packages/studio-app/src/categories/x/tradingOnX/CustomRenderer/index.tsx ================================================ import { StudioCategoryOptionRenderPayload } from "@agent-studio/studio-dnd"; import { useMemo } from "react"; import s from "../../styles.module.scss"; import { TradingOnXFormData } from "../types"; import DetailsField from "./Fields/DetailsField"; import FrequencyField from "./Fields/FrequencyField"; import AiModelField from "./Fields/AiModelField"; import useStudioAgentStore from "../../../../stores/useStudioAgentStore"; import { findById, findParentById, findPersonalityObj, } from "../../../../utils/process"; import { showError } from "../../../../utils/toast"; import CustomRendererBase from "../../../../components/CustomRendererBase"; import StudioFormWrapper from "../../../../components/form"; const CustomTradingOnXRenderer = ({ id, formData, data, setFormFields, }: StudioCategoryOptionRenderPayload) => { const { frequency, details, model } = formData; const { simulatePrompt, setSimulatePrompt } = useStudioAgentStore(); const isActive = useMemo(() => { return simulatePrompt?.id.includes(id); }, [simulatePrompt]); const handleSelectMissionPrompt = () => { const result = findById(data, id); const parentObj = findParentById(data, id); const personalityObj = findPersonalityObj(data, parentObj); if (!result) { showError({ message: "Unable to find the selected prompt", }); return; } if (!personalityObj) { showError({ message: "Personality not found. Please connect the prompt to a personality", }); return; } setSimulatePrompt({ id: [personalityObj.id, result.id], personality: personalityObj?.data?.personality, simulate_prompt: result.data.details, simulate_type: result.idx, }); }; return (
{ setFormFields({ model: id, modelName: name }); }} data={data} /> { setFormFields({ frequency: v }); }} /> { setFormFields({ details: v }); }} />
); }; export default CustomTradingOnXRenderer; ================================================ FILE: agent-studio/packages/studio-app/src/categories/x/tradingOnX/types.ts ================================================ export type TradingOnXFormData = { id: string; toolset: string; frequency: string; details: string; model: string; modelName: string; }; ================================================ FILE: agent-studio/packages/studio-app/src/categories/x/tradingOnX/validates/create.ts ================================================ import { OnAddPayload, OnCreatePayload, OnLinkPayload, } from "@agent-studio/studio-dnd"; import { xMissionLinkToAllowed } from "../../../shared/validators"; const onAddValidate = (data: OnAddPayload) => { return true; }; const onSnapValidate = () => { return true; }; const onSplitValidate = () => { return true; }; const onMergeValidate = () => { return true; }; const onDropInValidate = () => { return true; }; const onDropOutValidate = () => { return true; }; const onLinkValidate = (data: OnLinkPayload) => { return xMissionLinkToAllowed(data); }; const CREATE_FLOW_TRADING_ON_X_VALIDATORS = { onAddValidate, onSnapValidate, onSplitValidate, onMergeValidate, onDropInValidate, onDropOutValidate, onLinkValidate, }; export default CREATE_FLOW_TRADING_ON_X_VALIDATORS; ================================================ FILE: agent-studio/packages/studio-app/src/categories/x/tradingOnX/validates/index.ts ================================================ import CREATE_FLOW_TRADING_ON_X_VALIDATORS from './create'; import UPDATE_FLOW_TRADING_ON_X_VALIDATORS from './update'; const TRADING_ON_X_VALIDATES = { create: CREATE_FLOW_TRADING_ON_X_VALIDATORS, update: UPDATE_FLOW_TRADING_ON_X_VALIDATORS, }; export default TRADING_ON_X_VALIDATES; ================================================ FILE: agent-studio/packages/studio-app/src/categories/x/tradingOnX/validates/update.ts ================================================ import { OnAddPayload, OnLinkPayload } from "@agent-studio/studio-dnd"; import { xMissionLinkToAllowed } from "../../../shared/validators"; const onAddValidate = (data: OnAddPayload) => { return true; }; const onSnapValidate = () => { return true; }; const onSplitValidate = () => { return true; }; const onMergeValidate = () => { return true; }; const onDropInValidate = () => { return true; }; const onDropOutValidate = () => { return true; }; const onLinkValidate = (data: OnLinkPayload) => { return xMissionLinkToAllowed(data); }; const UPDATE_FLOW_TRADING_ON_X_VALIDATORS = { onAddValidate, onSnapValidate, onSplitValidate, onMergeValidate, onDropInValidate, onDropOutValidate, onLinkValidate, }; export default UPDATE_FLOW_TRADING_ON_X_VALIDATORS; ================================================ FILE: agent-studio/packages/studio-app/src/chakra-themes.tsx ================================================ "use client"; import { extendTheme, type ThemeConfig } from "@chakra-ui/react"; const config: ThemeConfig = { initialColorMode: "light", useSystemColorMode: false, }; const breakpoints = { base: "0px", sm: "480px", md: "768px", lg: "992px", xl: "1280px", "2xl": "1536px", max: "1701px", "2k": "2048px", }; const chakraThemes = extendTheme({ config, breakpoints, }); export default chakraThemes; ================================================ FILE: agent-studio/packages/studio-app/src/components/ConnectXContent/index.tsx ================================================ import { Collapse, Flex, FormControl, FormErrorMessage, FormLabel, Image, Input, Spinner, Text, } from "@chakra-ui/react"; import cn from "classnames"; import cx from "classnames"; import React, { forwardRef, useEffect, useImperativeHandle, useMemo, useState, } from "react"; import copy from "copy-to-clipboard"; import toast from "react-hot-toast"; import s from "./styles.module.scss"; import { showError } from "../../utils/toast"; import { AI_AGENT_NAME_UPPERCASE } from "../../constants/agent"; import AgentAPI from "../../services/apis/agent"; import useCommonStore from "../../stores/useCommonStore"; import { PERP_API_URL, TWITTER_CLIENT_ID } from "../../configs"; import useAgentServiceStore from "../../stores/useAgentServiceStore"; type IProps = { agentId: string; onSkip?: () => void; onNext?: () => void; isShowSkipBtn?: boolean; url?: string; openType?: "_blank" | "_self"; showOnlyConnectBtn?: boolean; className?: string; ref?: any; }; const ConnectXContent: React.FC = forwardRef((props: IProps, ref) => { const { agentId, onSkip, onNext, isShowSkipBtn = true, url = `/`, openType = "_blank", showOnlyConnectBtn = false, className, } = props; const baseDAgent = useAgentServiceStore((state) => state.baseDAgent); const walletAddress = baseDAgent.getSignerAddress(); const [isLoading, setIsLoading] = useState(false); const [twClientId, setTwClientId] = useState(null); const [twClientSecret, setTwClientSecret] = useState(null); const [useAdvanceMode, setUseAdvanceMode] = useState(false); const [twitterUser, setTwitterUser] = useState(null); const [error, setError] = useState({ twitter_client_id: "", twitter_client_secret: "", }); const callbackUrl = `${PERP_API_URL}`; const getTwitterOauthUrl = useMemo(() => { const rootUrl = "https://twitter.com/i/oauth2/authorize"; const URL = `${url}&address=${ walletAddress || "" }&agent_id=${agentId}&client_id=${ useAdvanceMode ? twClientId : TWITTER_CLIENT_ID }`; const options = { redirect_uri: `${PERP_API_URL}?callback=${URL}`, client_id: useAdvanceMode && twClientId ? twClientId : TWITTER_CLIENT_ID, state: "state", response_type: "code", code_challenge: "challenge", code_challenge_method: "plain", scope: [ "offline.access", "tweet.read", "tweet.write", "users.read", "follows.write", "like.write", "like.read", "users.read", ].join(" "), }; const qs = new URLSearchParams(options).toString(); return `${rootUrl}?${qs}`; }, [walletAddress, agentId]); useImperativeHandle( ref, () => ({ callSubmitFunction: handleSubmit, }), [getTwitterOauthUrl] ); const getAgentDetails = async () => { try { const res = await AgentAPI.getAgentDetail(agentId); if (res && !!res?.agent_info?.twitter_info?.twitter_id) { setIsLoading(false); setTwitterUser({ id: res?.agent_info?.twitter_info?.twitter_id, username: res?.agent_info?.twitter_info?.twitter_username || res?.agent_info?.twitter_info?.twitter_name, avatar: res?.agent_info?.twitter_info?.twitter_avatar, }); useCommonStore.getState().requestReload(); } } catch (error) { console.error("getAgentDetails error", error); } }; const handleSubmit = async () => { if (!useAdvanceMode) { window.open(getTwitterOauthUrl, openType); setIsLoading(true); return; } if (!twClientId) { setError((prev) => ({ ...prev, twitter_client_id: "Client ID is required", })); } if (!twClientSecret) { setError((prev) => ({ ...prev, twitter_client_secret: "Client Secret is required", })); } if (!twClientId || !twClientSecret) return; try { const res = await AgentAPI.getVerifyXAccount({ agent_id: agentId, twitter_client_id: twClientId, twitter_client_secret: twClientSecret, }); if (res === true) { window.open(getTwitterOauthUrl, openType); setIsLoading(true); } else { showError({ message: "Your Agent is not ready. Please try again later", }); } } catch (error) { toast.error("Connect to X failed"); console.error("handleSubmit error", error); } }; useEffect(() => { if (!isLoading) return; // call getAgentDetails every 5 seconds, max retry 60 times let retry = 0; const interval = setInterval(() => { if (retry >= 30) { clearInterval(interval); setIsLoading(false); showError({ message: "Connect to X failed. Please try again later", }); return; } getAgentDetails(); retry++; }, 5000); return () => clearInterval(interval); }, [isLoading]); useEffect(() => { if (twClientId) setError((prev) => ({ ...prev, twitter_client_id: "" })); if (twClientSecret) setError((prev) => ({ ...prev, twitter_client_secret: "" })); }, [twClientId, twClientSecret]); const styleInput = { fontSize: "15px", lineHeight: "24px !important", fontFamily: "var(--font-inter) !important", fontWeight: "400", border: "1px solid #E5E7EB !important", background: "#F8F9FA !important", borderRadius: "8px", }; const styleLabel = { fontSize: "13px", lineHeight: "22px !important", fontFamily: "var(--font-inter) !important", fontWeight: "500", color: "black !important", }; if (showOnlyConnectBtn) { return ( {!!twitterUser?.id ? ( <> ) : ( )} ); } return ( {/* */} {/* */} {/* */} {/* Connect to X */} {/* */} {/* */} {/* */} {"ic-twitter-big.svg"} Set your {AI_AGENT_NAME_UPPERCASE} free on X Link your X account to enable autonomous posting and engagement. Your{" "} {AI_AGENT_NAME_UPPERCASE} will grow its presence on Twitter by itself, posting freely and interacting with humans - completely autonomous and self-sustaining. You don’t have to do anything.
setUseAdvanceMode(false)} >

Standard

100 engagements/day
setUseAdvanceMode(true)} >

Advance

Higher limit using X's API
Step 1. {" "} Enable Read, Write, and Direct Message permissions, then paste this link into the App Info section on your{" "} X Development Portal. Callback URI / Redirect URL
{ copy(`${callbackUrl}`); toast.remove(); toast.success("Copied"); }} > {callbackUrl}
Step 2. {" "} Provide the OAuth 2.0 Client ID and Client Secret.{" "} Client ID setTwClientId(e.target.value)} {...styleInput} /> {error.twitter_client_id} Client Secret setTwClientSecret(e.target.value)} {...styleInput} /> {error.twitter_client_secret}
{isShowSkipBtn && ( )} {!!twitterUser?.id ? ( ) : ( )} {/* Connect */}
); }); export default ConnectXContent; ================================================ FILE: agent-studio/packages/studio-app/src/components/ConnectXContent/styles.module.scss ================================================ .container { width: 100%; // padding: 0px 20px; max-width: 670px; } .title { color: #000; font-size: 20px; font-style: normal; font-weight: 500; line-height: 22px; } .desc { color: #000; font-size: 16px; font-style: normal; font-weight: 400; line-height: 24px; //max-width: 60ch; } .btn { display: flex; height: 48px; padding: 10px 24px; justify-content: center; align-items: center; gap: 8px; flex: 1 0 0; border-radius: 8px; color: #000; font-size: 15px; font-style: normal; font-weight: 500; line-height: 20px; &:disabled { cursor: not-allowed; } } .connectBtn { background: #5400FB; box-shadow: 0px 2px 12px 0px rgba(114, 43, 255, 0.25); color: #FFF; border-radius: 100px; height: 58px; } .tw_user { display: flex; align-items: center; gap: 6px; border-radius: 437.5px; border: 1px solid rgba(255, 255, 255, 0.15); padding: 3.5px 15.5px 2.5px 3.5px; .tw_user__name { // max width 150px then ellipsis white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; } } .mode_wrapper { .mode_item { display: flex; align-items: center; gap: 6px; height: 28px; padding: 0px 12px; border-radius: 100px; border: 1px solid #E5E7EB; background: #F8F9FA; color: #000; font-size: 12px; font-weight: 500; line-height: 20px; cursor: pointer; transition: all 0.3s ease-in-out; /* 166.667% */ &:not(.active):hover { border-color: #FFF } span { opacity: 0.7; } &.active { background: rgba(255, 255, 255, 0.15); background: #5400FB; border-color: #5400FB; color: #fff; } } &.loading { pointer-events: none; opacity: 0.5; } } .card { padding: 16px; border-radius: 12px; // border: 1px solid rgba(84, 0, 251, 0.40); border: 1px solid #E5E7EB; background: #F3F5F7; p { font-size: 14px; font-style: normal; line-height: 22px; color: black; } a { color: #8142FF; } .copy_link_wrapper { display: flex; color: white; align-items: center; height: 48px; padding: 6px 16px; border-radius: 8px; border: 1px solid #E5E7EB; background: #F8F9FA; margin-top: 4px; gap: 10px; p { white-space: nowrap; text-overflow: ellipsis; overflow: hidden; flex: 1; } svg { min-width: 20px; filter: invert(1); } } } .ConnectXBtn { height: 32px; border-radius: 100px; background-color: #000000 !important; font-family: var(--font-inter); color: #FFF; font-size: 15px; font-weight: 400; width: fit-content; min-width: 92px; &:hover { background-color: #000000 !important; } } ================================================ FILE: agent-studio/packages/studio-app/src/components/CustomRendererBase/CustomRendererBaseTitle.tsx ================================================ import { Flex, Text } from "@chakra-ui/react"; import React from "react"; import { TextStyleMap } from "../form/styles"; type Props = { tag?: string; title?: string; }; const CustomRendererBaseTitle = ({ tag, title }: Props) => { return ( {tag && ( {tag} )} {title && ( {title} )} ); }; export default CustomRendererBaseTitle; ================================================ FILE: agent-studio/packages/studio-app/src/components/CustomRendererBase/index.tsx ================================================ import { Flex } from "@chakra-ui/react"; import { PropsWithChildren } from "react"; import CustomRendererBaseTitle from "./CustomRendererBaseTitle"; type Props = PropsWithChildren & { title?: string; tag?: string; actions?: React.ReactNode; isSelected?: boolean; onClick?: () => void; }; const CustomRendererBase = ({ title, tag, children, actions, isSelected = false, onClick, }: Props) => { return ( {children} {actions && ( {actions} )} ); }; export default CustomRendererBase; ================================================ FILE: agent-studio/packages/studio-app/src/components/IconRenderer/index.tsx ================================================ import React, { FunctionComponent } from "react"; type Props = { icon: string | React.ReactNode | FunctionComponent; }; const IconRenderer = (props: Props) => { const { icon } = props; if (typeof icon === "string") { return ; } if (typeof icon === "function") { return icon(props) as any; } return icon as any; }; export default IconRenderer; ================================================ FILE: agent-studio/packages/studio-app/src/components/LoadingRow/index.tsx ================================================ import styles from "./styles.module.scss"; const LoadingRow = () => (
); export default LoadingRow; ================================================ FILE: agent-studio/packages/studio-app/src/components/LoadingRow/styles.module.scss ================================================ .lds_ellipsis { /* change color here */ color: black; } .lds_ellipsis, .lds_ellipsis div { box-sizing: border-box; } .lds_ellipsis { display: inline-block; position: relative; width: 80px; height: 80px; } .lds_ellipsis div { position: absolute; top: 33.33333px; width: 13.33333px; height: 13.33333px; border-radius: 50%; background: currentColor; animation-timing-function: cubic-bezier(0, 1, 1, 0); } .lds_ellipsis div:nth-child(1) { left: 8px; animation: lds_ellipsis1 0.6s infinite; } .lds_ellipsis div:nth-child(2) { left: 8px; animation: lds_ellipsis2 0.6s infinite; } .lds_ellipsis div:nth-child(3) { left: 32px; animation: lds_ellipsis2 0.6s infinite; } .lds_ellipsis div:nth-child(4) { left: 56px; animation: lds_ellipsis3 0.6s infinite; } @keyframes lds_ellipsis1 { 0% { transform: scale(0); } 100% { transform: scale(1); } } @keyframes lds_ellipsis3 { 0% { transform: scale(1); } 100% { transform: scale(0); } } @keyframes lds_ellipsis2 { 0% { transform: translate(0, 0); } 100% { transform: translate(24px, 0); } } ================================================ FILE: agent-studio/packages/studio-app/src/components/NumberCounter/index.tsx ================================================ "use client"; import { useRef } from "react"; import { gsap } from "gsap"; import { useGSAP } from "@gsap/react"; interface IProp { counter: number; delay?: number; } export default function NumberCounter({ counter, delay = 0 }: IProp) { const refContent = useRef(null); const refFake = useRef<{ value: number }>({ value: 0 }); useGSAP( () => { gsap.to(refFake.current, { scrollTrigger: { trigger: refContent.current, start: "bottom bottom", }, value: counter, duration: 2, ease: "power3.inOut", delay, onUpdate: () => { if (refContent.current) refContent.current.textContent = Math.round( refFake.current.value ).toString(); }, }); }, { dependencies: [counter, delay] } ); return
0
; } ================================================ FILE: agent-studio/packages/studio-app/src/components/ScreenLoading/index.tsx ================================================ import { Image } from "@chakra-ui/react"; import { Flex } from "@chakra-ui/react"; import useStudioAgentStore from "../../stores/useStudioAgentStore"; import cn from "classnames"; import s from "./styles.module.scss"; function ScreenLoading() { const { isLoading } = useStudioAgentStore(); if (isLoading) { return (
{"loading"}
); } return <>; } export default ScreenLoading; ================================================ FILE: agent-studio/packages/studio-app/src/components/ScreenLoading/styles.module.scss ================================================ .loading { height: 100%; aspect-ratio: 1/1; display: flex; align-items: center; justify-content: center; } .colorful { width: 40px; height: 40px; display: flex; --c1: linear-gradient(#ffd82e 0 0); --c2: linear-gradient(#ff6761 0 0); --s: calc(100% / 3) calc(100% / 3); background: var(--c1) 0 0, var(--c2) 50% 0, var(--c1) 100% 0, var(--c2) 0 50%, var(--c2) 100% 50%, var(--c1) 0 100%, var(--c2) 50% 100%, var(--c1) 100% 100%; background-repeat: no-repeat; animation: colorful-p30qnz 1.5s infinite alternate; } .colorful:before { content: ''; width: calc(100% / 3); height: calc(100% / 3); background: #474bff; animation: inherit; animation-delay: 0s; animation-name: colorful-9tp7np; } @keyframes colorful-p30qnz { 0%, 12.49% { background-size: var(--s), 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0; } 12.5%, 24.9% { background-size: var(--s), var(--s), 0 0, 0 0, 0 0, 0 0, 0 0, 0 0; } 25%, 37.4% { background-size: var(--s), var(--s), var(--s), 0 0, 0 0, 0 0, 0 0, 0 0; } 37.5%, 49.9% { background-size: var(--s), var(--s), var(--s), 0 0, var(--s), 0 0, 0 0, 0 0; } 50%, 61.4% { background-size: var(--s), var(--s), var(--s), 0 0, var(--s), 0 0, 0 0, var(--s); } 62.5%, 74.9% { background-size: var(--s), var(--s), var(--s), 0 0, var(--s), 0 0, var(--s), var(--s); } 75%, 86.4% { background-size: var(--s), var(--s), var(--s), 0 0, var(--s), var(--s), var(--s), var(--s); } 87.5%, 100% { background-size: var(--s), var(--s), var(--s), var(--s), var(--s), var(--s), var(--s), var(--s); } } @keyframes colorful-9tp7np { 0%, 5% { transform: translate(0, 0); } 12.5% { transform: translate(100%, 0); } 25% { transform: translate(200%, 0); } 37.5% { transform: translate(200%, 100%); } 50% { transform: translate(200%, 200%); } 62.5% { transform: translate(100%, 200%); } 75% { transform: translate(0, 200%); } 87.5% { transform: translate(0, 100%); } 95%, 100% { transform: translate(100%, 100%); } } ================================================ FILE: agent-studio/packages/studio-app/src/components/SimulateTasks/ChatSimulate/Chat/ChatList.tsx ================================================ import React, { RefObject, useEffect, useMemo, useRef, useState } from "react"; import ScrollableFeed from "react-scrollable-feed"; import cn from "classnames"; import { TChatMessage } from "./types"; import { Box, Flex, Spinner } from "@chakra-ui/react"; import ChatMessage from "./ChatMessage"; import LoadingRow from "../../../LoadingRow"; import s from "./styles.module.scss"; type Props = { messages: any; isLoading: boolean; }; const ChatList = ({ messages, isLoading }: Props) => { const topMostRef = useRef(null); const containerRef = useRef(null); const scrollableRef = useRef(null); const [isFetching, setIsFetching] = useState(false); const prevCountRef = useRef(messages.length); const hasMore = useMemo(() => { return false; }, [messages.length]); useEffect(() => { return () => { // setMessages([]); // setisLoading(true); }; }, []); useEffect(() => { if (prevCountRef.current < messages.length) { prevCountRef.current = messages.length; } }, [messages]); useEffect(() => { setTimeout(() => { scrollableRef.current?.scrollToBottom(); // containerRef?.current?.scrollToBottom(); // scrollableRef.current.scrollIntoView({ behavior: "smooth" }); }, 2000); }, []); const isElementVisibleInContainer = ( ele: RefObject, container: RefObject ) => { const rect = ele.current?.getBoundingClientRect(); const containerRect = container.current?.getBoundingClientRect(); if (!rect || !containerRect) { return false; } return ( rect.top >= containerRect.top && rect.left >= containerRect.left && rect.bottom <= containerRect.bottom && rect.right <= containerRect.right ); }; const renderBody = () => { // if (isLoading) { // return ( //
// //
// ); // } return ( {messages.map((message: TChatMessage, index: number) => { const isLast = index === messages.length - 1; if (index === 0) { return ( ); } return ( ); })} {isLoading && ( )} ); }; const handleIsAtTop = () => { if (!hasMore) return; if ( topMostRef && isElementVisibleInContainer(topMostRef as any, containerRef as any) ) { setIsFetching(true); } setTimeout(() => { if ( topMostRef && isElementVisibleInContainer(topMostRef as any, containerRef as any) ) { topMostRef.current?.scrollIntoView( // add offset { block: "start", inline: "start", } ); setIsFetching(false); } }, 1000); }; return (
{isFetching && ( )} {renderBody()}
); }; export default ChatList; ================================================ FILE: agent-studio/packages/studio-app/src/components/SimulateTasks/ChatSimulate/Chat/ChatMessage.tsx ================================================ import { Flex, Text } from "@chakra-ui/react"; import React, { memo, useRef, useState } from "react"; import cs from "classnames"; import s from "./styles.module.scss"; import { IChatMessage } from "./types"; import ScrollableFeed from "react-scrollable-feed"; type Props = { message: IChatMessage; isLast: boolean; }; const ChatMessage = React.forwardRef( ({ message, isLast }: Props, ref: React.ForwardedRef) => { const [animatedText, setAnimatedText] = React.useState(""); const [animatedId, setAnimatedId] = useState([]); const scrollableRef = useRef(null); const chatInputRef = useRef(null); const setText = () => { const text = message?.msg; const isOld = animatedId.includes(message?.id); if (isLast && message?.is_reply && !isOld) { let index = 0; const animate = () => { if (index < text.length) { setAnimatedText(text.substring(0, index + 1)); index++; requestAnimationFrame(animate); scrollableRef.current?.scrollToBottom(); } }; animate(); chatInputRef?.current?.focus(); setAnimatedId((values: string[]) => [...values, message?.id]); } else { setAnimatedText(text); } }; React.useEffect(() => { setText(); }, []); return (
{message?.is_reply && ( {message.name} )}
            {animatedText}
          
); } ); export default memo(ChatMessage); ================================================ FILE: agent-studio/packages/studio-app/src/components/SimulateTasks/ChatSimulate/Chat/index.tsx ================================================ import { Box, Flex, Image, Text } from "@chakra-ui/react"; import ChatList from "./ChatList"; import { TChatMessage } from "./types"; import useStudioAgentStore from "../../../../stores/useStudioAgentStore"; type Props = { messages: TChatMessage[]; isLoading?: boolean; }; const SimulateChat = ({ messages, isLoading = false }: Props) => { const { simulatePrompt } = useStudioAgentStore(); if (!simulatePrompt || simulatePrompt?.simulate_type !== "chat") return null; return ( {/* */} {messages?.length === 0 ? ( {"image Get a feel for your agent? ) : ( )} ); }; export default SimulateChat; ================================================ FILE: agent-studio/packages/studio-app/src/components/SimulateTasks/ChatSimulate/Chat/styles.module.scss ================================================ .wrapper { position: relative; height: 100%; min-width: 470px; //padding-bottom: 12px; max-height: calc(100vh - 330px - var(--TOP-BANNER-HEIGHT)); // overflow: hidden !important; // @include hideScrollBar; .MessageList { width: 100%; padding: 0; overflow: hidden; margin-bottom: 0; margin-top: auto; &.MessageList__Loading { overflow: hidden; height: 100%; } } &.empty_list { display: grid; place-items: center; } .empty { .empty_thumbnail { max-width: 50%; margin-left: auto; margin-right: auto; } .text { text-align: center; margin-top: 12px; margin-bottom: 12px; font-size: 14px; } } .loading { display: flex; justify-content: center; align-items: center; height: 16px !important; width: 16px !important; } } .scroll { scroll-behavior: smooth; -webkit-scroll-behavior: smooth; scrollbar-color: gray transparent; scrollbar-width: thin; &::-webkit-scrollbar-track { -webkit-box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.3) !important; background-color: transparent !important; } &::-webkit-scrollbar { width: 2px !important; background-color: transparent; } &::-webkit-scrollbar-thumb { background-color: gray; } // overflow: hidden; // >div { // overflow: hidden; // } } .chat_message_wrapper { //padding: 12px 12px; display: flex; flex-direction: column; gap: 8px; .content { //margin-left: 4px; border-radius: 12px; padding: 12px 16px; //background-color: rgba(95, 66, 243, 1); max-width: 90%; width: fit-content; gap: 8px; &.reply { margin-bottom: 0; //opacity: 0.6; background: rgba(242, 243, 245, 1) !important; } } .reply_to { //margin-left: 30px; color: white; } .normalText { font-size: 16px; font-weight: 400; width: 300px; text-wrap: wrap; &.align_right { text-align: right; } span { display: inline-block; animation: streaming-text 5s linear infinite; } } @keyframes streaming-text { 0% { transform: translateX(0); } 100% { transform: translateX(-100%); } } } ================================================ FILE: agent-studio/packages/studio-app/src/components/SimulateTasks/ChatSimulate/Chat/types.ts ================================================ export type TChatMessage = { id: string; is_reply: boolean; msg: string; name: string; }; export interface IChatMessage { id: string; is_reply: boolean; msg: string; name: string; } ================================================ FILE: agent-studio/packages/studio-app/src/components/SimulateTasks/ChatSimulate/index.tsx ================================================ import { Box, Button, Textarea } from "@chakra-ui/react"; import React, { useEffect, useState } from "react"; import SimulateChat from "./Chat"; import { TChatMessage } from "./Chat/types"; import { v4 } from "uuid"; // import { compareString } from "@/utils/string"; // import AgentAPI from "@/services/api/agent"; import useStudioAgentStore from "../../../stores/useStudioAgentStore"; import SvgInset from "../../SvgInset"; import { compareString } from "../../../utils/string"; import AgentAPI from "../../../services/apis/agent"; const ChatSimulate = () => { const { setSimulatePrompt, simulatePrompt } = useStudioAgentStore(); const [isFocus, setIsFocus] = useState(false); const [isLoading, setIsLoading] = useState(false); const [input, setInput] = useState(""); const [messages, setMessages] = useState([]); const handleSendMessage = async () => { if (!input || !simulatePrompt || isLoading) return; const newMessage: TChatMessage = { id: v4(), msg: input, is_reply: false, name: "You", }; setIsLoading(true); setMessages((messages) => [...messages, newMessage]); const historyMessages = [ { role: "system", content: simulatePrompt?.personality || "", }, ...messages.map((item) => ({ role: compareString(item.name, "You") ? "user" : "assistant", content: item.msg, })), { role: "user", content: newMessage.msg }, ]; try { setInput(""); const responseMessage = await AgentAPI.chatCompletions({ messages: historyMessages, }); setMessages((messages) => [ ...messages, { id: v4(), msg: responseMessage || "Something went wrong!", is_reply: true, name: simulatePrompt?.agent_name || "Agent", }, ]); } catch (error) { console.log("error", error); } finally { setIsLoading(false); } }; useEffect(() => { setMessages([]); }, [simulatePrompt?.id]); if (simulatePrompt?.simulate_type !== "chat") return null; return ( <>